diff --git a/.bazelrc.common b/.bazelrc.common index 7b84ab44af7a9..9acc4ebc875e8 100644 --- a/.bazelrc.common +++ b/.bazelrc.common @@ -49,11 +49,12 @@ query --incompatible_no_implicit_file_export # Log configs ## different from default common --color=yes -common --noshow_progress +common --show_progress common --show_task_finish -build --noshow_loading_progress -query --noshow_loading_progress -build --show_result=0 +common --progress_report_interval=10 +common --show_progress_rate_limit=10 +common --show_loading_progress +build --show_result=1 # Specifies desired output mode for running tests. # Valid values are diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index cc625a09fadd0..a7a96aa346145 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -177,7 +177,8 @@ enabled: - x-pack/test/functional/apps/lens/group1/config.ts - x-pack/test/functional/apps/lens/group2/config.ts - x-pack/test/functional/apps/lens/group3/config.ts - - x-pack/test/functional/apps/lens/open_in_lens/config.ts + - x-pack/test/functional/apps/lens/open_in_lens/tsvb/config.ts + - x-pack/test/functional/apps/lens/open_in_lens/agg_based/config.ts - x-pack/test/functional/apps/license_management/config.ts - x-pack/test/functional/apps/logstash/config.ts - x-pack/test/functional/apps/management/config.ts @@ -271,9 +272,12 @@ enabled: - x-pack/test/upgrade_assistant_integration/config.js - x-pack/test/usage_collection/config.ts - x-pack/performance/journeys/ecommerce_dashboard.ts + - x-pack/performance/journeys/ecommerce_dashboard_map_only.ts - x-pack/performance/journeys/flight_dashboard.ts - x-pack/performance/journeys/login.ts - x-pack/performance/journeys/many_fields_discover.ts - x-pack/performance/journeys/promotion_tracking_dashboard.ts - x-pack/performance/journeys/web_logs_dashboard.ts - x-pack/performance/journeys/data_stress_test_lens.ts + - x-pack/performance/journeys/ecommerce_dashboard_saved_search_only.ts + - x-pack/performance/journeys/ecommerce_dashboard_tsvb_gauge_only.ts diff --git a/.buildkite/pipelines/on_merge.yml b/.buildkite/pipelines/on_merge.yml index 7ea0317b56e70..ffca48499b159 100644 --- a/.buildkite/pipelines/on_merge.yml +++ b/.buildkite/pipelines/on_merge.yml @@ -39,8 +39,8 @@ steps: - exit_status: '*' limit: 1 - - command: .buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh - label: Build TS Refs and Check Public API Docs + - command: .buildkite/scripts/steps/on_merge_api_docs.sh + label: Check Public API Docs key: public-api-docs agents: queue: n2-4-spot diff --git a/.buildkite/scripts/bootstrap.sh b/.buildkite/scripts/bootstrap.sh index 4646da7600ecf..b7576dda72f24 100755 --- a/.buildkite/scripts/bootstrap.sh +++ b/.buildkite/scripts/bootstrap.sh @@ -36,14 +36,3 @@ if [[ "$DISABLE_BOOTSTRAP_VALIDATION" != "true" ]]; then check_for_changed_files 'yarn kbn bootstrap' fi -### -### upload ts-refs-cache artifacts as quickly as possible so they are available for download -### -if [[ "${BUILD_TS_REFS_CACHE_CAPTURE:-}" == "true" ]]; then - echo "--- Build ts-refs-cache" - node scripts/build_ts_refs.js --ignore-type-failures - echo "--- Upload ts-refs-cache" - cd "$KIBANA_DIR/target/ts_refs_cache" - gsutil cp "*.zip" 'gs://kibana-ci-ts-refs-cache/' - cd "$KIBANA_DIR" -fi diff --git a/.buildkite/scripts/common/env.sh b/.buildkite/scripts/common/env.sh index f80acae365d4e..54524568436c3 100755 --- a/.buildkite/scripts/common/env.sh +++ b/.buildkite/scripts/common/env.sh @@ -63,12 +63,6 @@ if is_pr; then export ELASTIC_APM_CONTEXT_PROPAGATION_ONLY=true fi - if [[ "${GITHUB_STEP_COMMIT_STATUS_ENABLED:-}" != "true" ]]; then - export CHECKS_REPORTER_ACTIVE=true - else - export CHECKS_REPORTER_ACTIVE=false - fi - # These can be removed once we're not supporting Jenkins and Buildkite at the same time # These are primarily used by github checks reporter and can be configured via /github_checks_api.json export ghprbGhRepository="elastic/kibana" @@ -83,7 +77,6 @@ if is_pr; then else export ELASTIC_APM_ACTIVE=true export ELASTIC_APM_CONTEXT_PROPAGATION_ONLY=false - export CHECKS_REPORTER_ACTIVE=false fi # These are for backwards-compatibility @@ -106,11 +99,6 @@ export GCS_UPLOAD_PREFIX=FAKE_UPLOAD_PREFIX # TODO remove the need for this export KIBANA_BUILD_LOCATION="$WORKSPACE/kibana-build-xpack" -if [[ "${BUILD_TS_REFS_CACHE_ENABLE:-}" != "true" ]]; then - export BUILD_TS_REFS_CACHE_ENABLE=false -fi - -export BUILD_TS_REFS_DISABLE=true export DISABLE_BOOTSTRAP_VALIDATION=true # Prevent Browserlist from logging on CI about outdated database versions diff --git a/.buildkite/scripts/common/setup_bazel.sh b/.buildkite/scripts/common/setup_bazel.sh index 503ce2ef06c91..ea3c2453de6d2 100755 --- a/.buildkite/scripts/common/setup_bazel.sh +++ b/.buildkite/scripts/common/setup_bazel.sh @@ -42,18 +42,7 @@ cat <> $KIBANA_DIR/.bazelrc EOF fi -if [[ "$BAZEL_CACHE_MODE" == "buildbuddy" ]]; then - echo "[bazel] enabling caching with Buildbuddy" -cat <> $KIBANA_DIR/.bazelrc - build --bes_results_url=https://app.buildbuddy.io/invocation/ - build --bes_backend=grpcs://remote.buildbuddy.io - build --remote_cache=grpcs://remote.buildbuddy.io - build --remote_timeout=3600 - build --remote_header=x-buildbuddy-api-key=$KIBANA_BUILDBUDDY_CI_API_KEY -EOF -fi - -if [[ "$BAZEL_CACHE_MODE" != @(gcs|populate-local-gcs|buildbuddy|none|) ]]; then - echo "invalid value for BAZEL_CACHE_MODE received ($BAZEL_CACHE_MODE), expected one of [gcs,populate-local-gcs|buildbuddy,none]" +if [[ "$BAZEL_CACHE_MODE" != @(gcs|populate-local-gcs|none|) ]]; then + echo "invalid value for BAZEL_CACHE_MODE received ($BAZEL_CACHE_MODE), expected one of [gcs,populate-local-gcs|none]" exit 1 fi diff --git a/.buildkite/scripts/common/util.sh b/.buildkite/scripts/common/util.sh index 748babfc0650b..e22a807fc1830 100755 --- a/.buildkite/scripts/common/util.sh +++ b/.buildkite/scripts/common/util.sh @@ -1,14 +1,5 @@ #!/usr/bin/env bash -checks-reporter-with-killswitch() { - if [ "$CHECKS_REPORTER_ACTIVE" == "true" ] ; then - yarn run github-checks-reporter "$@" - else - arguments=("$@"); - "${arguments[@]:1}"; - fi -} - is_pr() { [[ "${GITHUB_PR_NUMBER-}" ]] && return false diff --git a/.buildkite/scripts/lifecycle/pre_command.sh b/.buildkite/scripts/lifecycle/pre_command.sh index b5d1d905458e8..b945f08d1dfd9 100755 --- a/.buildkite/scripts/lifecycle/pre_command.sh +++ b/.buildkite/scripts/lifecycle/pre_command.sh @@ -145,9 +145,6 @@ export SYNTHETICS_REMOTE_KIBANA_URL export TEST_FAILURES_ES_PASSWORD } -KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key) -export KIBANA_BUILDBUDDY_CI_API_KEY - BAZEL_LOCAL_DEV_CACHE_CREDENTIALS_FILE="$HOME/.kibana-ci-bazel-remote-cache-local-dev.json" export BAZEL_LOCAL_DEV_CACHE_CREDENTIALS_FILE retry 5 5 vault read -field=service_account_json secret/kibana-issues/dev/kibana-ci-bazel-remote-cache-local-dev > "$BAZEL_LOCAL_DEV_CACHE_CREDENTIALS_FILE" diff --git a/.buildkite/scripts/saved_object_field_metrics.sh b/.buildkite/scripts/saved_object_field_metrics.sh index 4cc249db20edc..53f0b22400dde 100755 --- a/.buildkite/scripts/saved_object_field_metrics.sh +++ b/.buildkite/scripts/saved_object_field_metrics.sh @@ -5,8 +5,7 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo '--- Default Saved Object Field Metrics' -checks-reporter-with-killswitch "Capture Kibana Saved Objects field count metrics" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ - --config x-pack/test/saved_objects_field_count/config.ts +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ + --config x-pack/test/saved_objects_field_count/config.ts diff --git a/.buildkite/scripts/steps/build_api_docs.sh b/.buildkite/scripts/steps/build_api_docs.sh index 59f2254e8b8fc..185d8ec09aa5a 100755 --- a/.buildkite/scripts/steps/build_api_docs.sh +++ b/.buildkite/scripts/steps/build_api_docs.sh @@ -4,11 +4,8 @@ set -euo pipefail .buildkite/scripts/bootstrap.sh -echo "--- Build TS Refs" -node scripts/build_ts_refs \ - --clean \ - --no-cache \ - --force +echo "--- Run scripts/type_check to ensure that all build available" +node scripts/type_check echo "--- Build API Docs" node --max-old-space-size=12000 scripts/build_api_docs diff --git a/.buildkite/scripts/steps/check_types.sh b/.buildkite/scripts/steps/check_types.sh index 517f71fbbd730..94c28c9b47d9b 100755 --- a/.buildkite/scripts/steps/check_types.sh +++ b/.buildkite/scripts/steps/check_types.sh @@ -7,5 +7,4 @@ source .buildkite/scripts/common/util.sh .buildkite/scripts/bootstrap.sh echo --- Check Types -checks-reporter-with-killswitch "Check Types" \ - node scripts/type_check --concurrency 8 +node scripts/type_check diff --git a/.buildkite/scripts/steps/checks/bundle_limits.sh b/.buildkite/scripts/steps/checks/bundle_limits.sh index f0885d246f2c6..9be72e12b8671 100755 --- a/.buildkite/scripts/steps/checks/bundle_limits.sh +++ b/.buildkite/scripts/steps/checks/bundle_limits.sh @@ -6,5 +6,4 @@ source .buildkite/scripts/common/util.sh echo --- Check Bundle Limits -checks-reporter-with-killswitch "Check Bundle Limits" \ - node scripts/build_kibana_platform_plugins --validate-limits +node scripts/build_kibana_platform_plugins --validate-limits diff --git a/.buildkite/scripts/steps/checks/file_casing.sh b/.buildkite/scripts/steps/checks/file_casing.sh index 76e3dce506487..c4500de4c57ab 100755 --- a/.buildkite/scripts/steps/checks/file_casing.sh +++ b/.buildkite/scripts/steps/checks/file_casing.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Check File Casing -checks-reporter-with-killswitch "Check File Casing" \ - node scripts/check_file_casing --quiet +node scripts/check_file_casing --quiet diff --git a/.buildkite/scripts/steps/checks/ftr_configs.sh b/.buildkite/scripts/steps/checks/ftr_configs.sh index 629cb748da88c..6959b58916b49 100755 --- a/.buildkite/scripts/steps/checks/ftr_configs.sh +++ b/.buildkite/scripts/steps/checks/ftr_configs.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Check FTR Configs -checks-reporter-with-killswitch "Check FTR Configs" \ - node scripts/check_ftr_configs +node scripts/check_ftr_configs diff --git a/.buildkite/scripts/steps/checks/i18n.sh b/.buildkite/scripts/steps/checks/i18n.sh index fad455899215d..f41d66df90e81 100755 --- a/.buildkite/scripts/steps/checks/i18n.sh +++ b/.buildkite/scripts/steps/checks/i18n.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Check i18n -checks-reporter-with-killswitch "Check i18n" \ - node scripts/i18n_check --ignore-missing +node scripts/i18n_check --ignore-missing diff --git a/.buildkite/scripts/steps/checks/jest_configs.sh b/.buildkite/scripts/steps/checks/jest_configs.sh index b85687333c92b..7834ed8b52ff0 100755 --- a/.buildkite/scripts/steps/checks/jest_configs.sh +++ b/.buildkite/scripts/steps/checks/jest_configs.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Check Jest Configs -checks-reporter-with-killswitch "Check Jest Configs" \ - node scripts/check_jest_configs +node scripts/check_jest_configs diff --git a/.buildkite/scripts/steps/checks/licenses.sh b/.buildkite/scripts/steps/checks/licenses.sh index 58add8a8c9530..dff1738e27555 100755 --- a/.buildkite/scripts/steps/checks/licenses.sh +++ b/.buildkite/scripts/steps/checks/licenses.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Check Licenses -checks-reporter-with-killswitch "Check Licenses" \ - node scripts/check_licenses --dev +node scripts/check_licenses --dev diff --git a/.buildkite/scripts/steps/checks/plugins_with_circular_deps.sh b/.buildkite/scripts/steps/checks/plugins_with_circular_deps.sh index 783b709c18aa4..a09c09f9fb847 100755 --- a/.buildkite/scripts/steps/checks/plugins_with_circular_deps.sh +++ b/.buildkite/scripts/steps/checks/plugins_with_circular_deps.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Check Plugins With Circular Dependencies -checks-reporter-with-killswitch "Check Plugins With Circular Dependencies" \ - node scripts/find_plugins_with_circular_deps +node scripts/find_plugins_with_circular_deps diff --git a/.buildkite/scripts/steps/checks/telemetry.sh b/.buildkite/scripts/steps/checks/telemetry.sh index e058d5ceab857..073f1fbaaff02 100755 --- a/.buildkite/scripts/steps/checks/telemetry.sh +++ b/.buildkite/scripts/steps/checks/telemetry.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Check Telemetry Schema -checks-reporter-with-killswitch "Check Telemetry Schema" \ - node scripts/telemetry_check +node scripts/telemetry_check diff --git a/.buildkite/scripts/steps/checks/test_hardening.sh b/.buildkite/scripts/steps/checks/test_hardening.sh index c80dd1b0b6fd7..7b5a3c2b28937 100755 --- a/.buildkite/scripts/steps/checks/test_hardening.sh +++ b/.buildkite/scripts/steps/checks/test_hardening.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Test Hardening -checks-reporter-with-killswitch "Test Hardening" \ - node scripts/test_hardening +node scripts/test_hardening diff --git a/.buildkite/scripts/steps/checks/test_projects.sh b/.buildkite/scripts/steps/checks/test_projects.sh index 76625b23ac335..e2f84cdf8c4de 100755 --- a/.buildkite/scripts/steps/checks/test_projects.sh +++ b/.buildkite/scripts/steps/checks/test_projects.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Test Projects -checks-reporter-with-killswitch "Test Projects" \ - yarn kbn run-in-packages test +yarn kbn run-in-packages test diff --git a/.buildkite/scripts/steps/checks/ts_projects.sh b/.buildkite/scripts/steps/checks/ts_projects.sh index 53b4f536e8f4b..a98f0f6d90f16 100755 --- a/.buildkite/scripts/steps/checks/ts_projects.sh +++ b/.buildkite/scripts/steps/checks/ts_projects.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Check TypeScript Projects -checks-reporter-with-killswitch "Check TypeScript Projects" \ - node scripts/check_ts_projects +node scripts/check_ts_projects diff --git a/.buildkite/scripts/steps/checks/verify_notice.sh b/.buildkite/scripts/steps/checks/verify_notice.sh index a92a268bdc886..aa21c0a6bb24a 100755 --- a/.buildkite/scripts/steps/checks/verify_notice.sh +++ b/.buildkite/scripts/steps/checks/verify_notice.sh @@ -5,5 +5,4 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Verify NOTICE -checks-reporter-with-killswitch "Verify NOTICE" \ - node scripts/notice --validate +node scripts/notice --validate diff --git a/.buildkite/scripts/steps/fleet/install_all_packages.sh b/.buildkite/scripts/steps/fleet/install_all_packages.sh index f9fbe6d465c69..b02c930160f12 100755 --- a/.buildkite/scripts/steps/fleet/install_all_packages.sh +++ b/.buildkite/scripts/steps/fleet/install_all_packages.sh @@ -6,7 +6,6 @@ source .buildkite/scripts/steps/functional/common.sh echo '--- Installing all packages' -checks-reporter-with-killswitch "Fleet packages Tests" \ - node scripts/functional_tests \ - --debug --bail \ - --config x-pack/test/fleet_packages/config.ts \ No newline at end of file +node scripts/functional_tests \ + --debug --bail \ + --config x-pack/test/fleet_packages/config.ts diff --git a/.buildkite/scripts/steps/functional/apm_cypress.sh b/.buildkite/scripts/steps/functional/apm_cypress.sh index 04f9aee280429..34e94baf180f9 100755 --- a/.buildkite/scripts/steps/functional/apm_cypress.sh +++ b/.buildkite/scripts/steps/functional/apm_cypress.sh @@ -15,8 +15,7 @@ echo "--- APM Cypress Tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "APM Cypress Tests" \ - node plugins/apm/scripts/test/e2e.js \ +node plugins/apm/scripts/test/e2e.js \ --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ --record \ --key "$APM_CYPRESS_RECORD_KEY" diff --git a/.buildkite/scripts/steps/functional/fleet_cypress.sh b/.buildkite/scripts/steps/functional/fleet_cypress.sh index 97371158d7dec..a77d912a59fff 100755 --- a/.buildkite/scripts/steps/functional/fleet_cypress.sh +++ b/.buildkite/scripts/steps/functional/fleet_cypress.sh @@ -8,8 +8,7 @@ export JOB=kibana-fleet-cypress echo "--- Fleet Cypress tests" -checks-reporter-with-killswitch "Fleet Cypress Tests" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ - --config x-pack/test/fleet_cypress/cli_config.ts +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ + --config x-pack/test/fleet_cypress/cli_config.ts diff --git a/.buildkite/scripts/steps/functional/observability_plugin.sh b/.buildkite/scripts/steps/functional/observability_plugin.sh index 4e11fbb1fe10e..e8fee66d79653 100755 --- a/.buildkite/scripts/steps/functional/observability_plugin.sh +++ b/.buildkite/scripts/steps/functional/observability_plugin.sh @@ -13,5 +13,4 @@ echo "--- Observability plugin @elastic/synthetics Tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "Observability plugin @elastic/synthetics Tests" \ - node plugins/observability/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node plugins/observability/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/functional/osquery_cypress.sh b/.buildkite/scripts/steps/functional/osquery_cypress.sh index 02766e0530bfb..c008c3418a2cb 100755 --- a/.buildkite/scripts/steps/functional/osquery_cypress.sh +++ b/.buildkite/scripts/steps/functional/osquery_cypress.sh @@ -4,7 +4,6 @@ set -euo pipefail source .buildkite/scripts/common/util.sh -export BUILD_TS_REFS_DISABLE=false .buildkite/scripts/bootstrap.sh node scripts/build_kibana_platform_plugins.js @@ -12,8 +11,7 @@ export JOB=kibana-osquery-cypress echo "--- Osquery Cypress tests" -checks-reporter-with-killswitch "Osquery Cypress Tests" \ - node scripts/functional_tests \ - --debug --bail \ - --config x-pack/test/osquery_cypress/cli_config.ts +node scripts/functional_tests \ + --debug --bail \ + --config x-pack/test/osquery_cypress/cli_config.ts diff --git a/.buildkite/scripts/steps/functional/performance_playwright.sh b/.buildkite/scripts/steps/functional/performance_playwright.sh index 6f0399b2de90d..5be8f62c7e01f 100644 --- a/.buildkite/scripts/steps/functional/performance_playwright.sh +++ b/.buildkite/scripts/steps/functional/performance_playwright.sh @@ -119,6 +119,14 @@ while read -r journey; do done done <<< "$journeys" +echo "--- Upload journey step screenshots" +JOURNEY_SCREENSHOTS_DIR="${KIBANA_DIR}/data/journey_screenshots" +if [ -d "$JOURNEY_SCREENSHOTS_DIR" ]; then + cd "$JOURNEY_SCREENSHOTS_DIR" + buildkite-agent artifact upload "**/*fullscreen*.png" + cd "$KIBANA_DIR" +fi + echo "--- report/record failed journeys" if [ "${failedJourneys[*]}" != "" ]; then buildkite-agent meta-data set "failed-journeys" "$(printf "%s\n" "${failedJourneys[@]}")" diff --git a/.buildkite/scripts/steps/functional/response_ops.sh b/.buildkite/scripts/steps/functional/response_ops.sh index 9828884e6d6a2..5604cb9774472 100755 --- a/.buildkite/scripts/steps/functional/response_ops.sh +++ b/.buildkite/scripts/steps/functional/response_ops.sh @@ -8,8 +8,7 @@ export JOB=kibana-security-solution-chrome echo "--- Response Ops Cypress Tests on Security Solution" -checks-reporter-with-killswitch "Response Ops Cypress Tests on Security Solution" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ - --config x-pack/test/security_solution_cypress/response_ops_cli_config.ts +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ + --config x-pack/test/security_solution_cypress/response_ops_cli_config.ts diff --git a/.buildkite/scripts/steps/functional/response_ops_cases.sh b/.buildkite/scripts/steps/functional/response_ops_cases.sh index 2485e025833ed..ee6bb2128539e 100755 --- a/.buildkite/scripts/steps/functional/response_ops_cases.sh +++ b/.buildkite/scripts/steps/functional/response_ops_cases.sh @@ -8,8 +8,7 @@ export JOB=kibana-security-solution-chrome echo "--- Response Ops Cases Cypress Tests on Security Solution" -checks-reporter-with-killswitch "Response Ops Cases Cypress Tests on Security Solution" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ - --config x-pack/test/security_solution_cypress/cases_cli_config.ts +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ + --config x-pack/test/security_solution_cypress/cases_cli_config.ts diff --git a/.buildkite/scripts/steps/functional/security_solution.sh b/.buildkite/scripts/steps/functional/security_solution.sh index fa1908683d157..99f605ecd6cc5 100755 --- a/.buildkite/scripts/steps/functional/security_solution.sh +++ b/.buildkite/scripts/steps/functional/security_solution.sh @@ -10,8 +10,7 @@ export CLI_COUNT=${CLI_COUNT:-$BUILDKITE_PARALLEL_JOB_COUNT} echo "--- Security Solution tests (Chrome)" -checks-reporter-with-killswitch "Security Solution Cypress Tests (Chrome) $CLI_NUMBER" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ - --config x-pack/test/security_solution_cypress/cli_config_parallel.ts +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ + --config x-pack/test/security_solution_cypress/cli_config_parallel.ts diff --git a/.buildkite/scripts/steps/functional/synthetics.sh b/.buildkite/scripts/steps/functional/synthetics.sh index 387369805adf1..699f80fd0483c 100644 --- a/.buildkite/scripts/steps/functional/synthetics.sh +++ b/.buildkite/scripts/steps/functional/synthetics.sh @@ -13,5 +13,4 @@ echo "--- synthetics @elastic/synthetics Tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "synthetics @elastic/synthetics Tests" \ - node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement-monitor*" +node 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 0cd9082b8f228..5473d2d9a2b8b 100755 --- a/.buildkite/scripts/steps/functional/synthetics_plugin.sh +++ b/.buildkite/scripts/steps/functional/synthetics_plugin.sh @@ -13,5 +13,4 @@ echo "--- Synthetics plugin @elastic/synthetics Tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "Synthetics plugin @elastic/synthetics Tests" \ - node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node plugins/synthetics/scripts/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 2ede2276a2c2d..f7d6a6276fb56 100755 --- a/.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh +++ b/.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh @@ -13,5 +13,4 @@ echo "--- User Experience @elastic/synthetics Tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "User Experience plugin @elastic/synthetics Tests" \ - node plugins/ux/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node plugins/ux/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/lint.sh b/.buildkite/scripts/steps/lint.sh index 301737c9132a0..05eb3bb602d84 100755 --- a/.buildkite/scripts/steps/lint.sh +++ b/.buildkite/scripts/steps/lint.sh @@ -7,8 +7,7 @@ source .buildkite/scripts/common/util.sh .buildkite/scripts/bootstrap.sh echo '--- Lint: stylelint' -checks-reporter-with-killswitch "Lint: stylelint" \ - node scripts/stylelint +node scripts/stylelint echo "stylelint ✅" echo '--- Lint: eslint' diff --git a/.buildkite/scripts/steps/lint_with_types.sh b/.buildkite/scripts/steps/lint_with_types.sh index 81d5ef03f4989..d54b5e2169074 100755 --- a/.buildkite/scripts/steps/lint_with_types.sh +++ b/.buildkite/scripts/steps/lint_with_types.sh @@ -4,9 +4,7 @@ set -euo pipefail source .buildkite/scripts/common/util.sh -export BUILD_TS_REFS_DISABLE=false .buildkite/scripts/bootstrap.sh echo '--- Lint: eslint (with types)' -checks-reporter-with-killswitch "Lint: eslint (with types)" \ - node scripts/eslint_with_types +node scripts/eslint_with_types diff --git a/.buildkite/scripts/steps/on_merge_api_docs.sh b/.buildkite/scripts/steps/on_merge_api_docs.sh new file mode 100755 index 0000000000000..4ed14093a2108 --- /dev/null +++ b/.buildkite/scripts/steps/on_merge_api_docs.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -euo pipefail + +export DISABLE_BOOTSTRAP_VALIDATION=true + +.buildkite/scripts/bootstrap.sh + +echo "--- Build API Docs" +node --max-old-space-size=12000 scripts/build_api_docs diff --git a/.buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh b/.buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh deleted file mode 100755 index 5659db50e1404..0000000000000 --- a/.buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -export BAZEL_CACHE_MODE=buildbuddy # Populate Buildbuddy bazel remote cache for linux -export BUILD_TS_REFS_CACHE_ENABLE=true -export BUILD_TS_REFS_CACHE_CAPTURE=true -export DISABLE_BOOTSTRAP_VALIDATION=true -export BUILD_TS_REFS_DISABLE=false - -.buildkite/scripts/bootstrap.sh - -echo "--- Build API Docs" -node --max-old-space-size=12000 scripts/build_api_docs diff --git a/.buildkite/scripts/steps/test/jest.sh b/.buildkite/scripts/steps/test/jest.sh index 7b09c3f0d788a..3e39c6bddb19c 100755 --- a/.buildkite/scripts/steps/test/jest.sh +++ b/.buildkite/scripts/steps/test/jest.sh @@ -8,8 +8,5 @@ is_test_execution_step .buildkite/scripts/bootstrap.sh -JOB=${BUILDKITE_PARALLEL_JOB:-0} - echo '--- Jest' -checks-reporter-with-killswitch "Jest Unit Tests $((JOB+1))" \ - .buildkite/scripts/steps/test/jest_parallel.sh jest.config.js +.buildkite/scripts/steps/test/jest_parallel.sh jest.config.js diff --git a/.buildkite/scripts/steps/test/jest_integration.sh b/.buildkite/scripts/steps/test/jest_integration.sh index 2dce8fec0f26c..fd7b9a1d6ad54 100755 --- a/.buildkite/scripts/steps/test/jest_integration.sh +++ b/.buildkite/scripts/steps/test/jest_integration.sh @@ -8,8 +8,5 @@ is_test_execution_step .buildkite/scripts/bootstrap.sh -JOB=${BUILDKITE_PARALLEL_JOB:-0} - echo '--- Jest Integration Tests' -checks-reporter-with-killswitch "Jest Integration Tests $((JOB+1))" \ - .buildkite/scripts/steps/test/jest_parallel.sh jest.integration.config.js +.buildkite/scripts/steps/test/jest_parallel.sh jest.integration.config.js diff --git a/.ci/Jenkinsfile_baseline_capture b/.ci/Jenkinsfile_baseline_capture index 8318998618ee9..79ba63fb63ae5 100644 --- a/.ci/Jenkinsfile_baseline_capture +++ b/.ci/Jenkinsfile_baseline_capture @@ -23,9 +23,6 @@ kibanaPipeline(timeoutMinutes: 210) { ) { withGcpServiceAccount.fromVaultSecret('secret/kibana-issues/dev/ci-artifacts-key', 'value') { withEnv([ - 'BUILD_TS_REFS_DISABLE=false', // disabled in root config so we need to override that here - 'BUILD_TS_REFS_CACHE_ENABLE=true', - 'BUILD_TS_REFS_CACHE_CAPTURE=true', 'DISABLE_BOOTSTRAP_VALIDATION=true', ]) { kibanaPipeline.doSetup() diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 04cd0d29b76d1..20081992d725a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -22,33 +22,31 @@ /src/plugins/saved_objects_finder/ @elastic/kibana-data-discovery # Vis Editors -/x-pack/plugins/lens/ @elastic/kibana-vis-editors -/src/plugins/charts/ @elastic/kibana-vis-editors -/src/plugins/vis_default_editor/ @elastic/kibana-vis-editors -/src/plugins/vis_types/metric/ @elastic/kibana-vis-editors -/src/plugins/vis_types/table/ @elastic/kibana-vis-editors -/src/plugins/vis_types/tagcloud/ @elastic/kibana-vis-editors -/src/plugins/vis_types/timelion/ @elastic/kibana-vis-editors -/src/plugins/vis_types/timeseries/ @elastic/kibana-vis-editors -/src/plugins/vis_types/vega/ @elastic/kibana-vis-editors -/src/plugins/vis_types/vislib/ @elastic/kibana-vis-editors -/src/plugins/vis_types/xy/ @elastic/kibana-vis-editors -/src/plugins/vis_types/pie/ @elastic/kibana-vis-editors -/src/plugins/vis_types/heatmap/ @elastic/kibana-vis-editors -/src/plugins/visualize/ @elastic/kibana-vis-editors -/src/plugins/visualizations/ @elastic/kibana-vis-editors -/src/plugins/chart_expressions/expression_tagcloud/ @elastic/kibana-vis-editors -/src/plugins/chart_expressions/expression_metric/ @elastic/kibana-vis-editors -/src/plugins/chart_expressions/expression_heatmap/ @elastic/kibana-vis-editors -/src/plugins/chart_expressions/expression_gauge/ @elastic/kibana-vis-editors -/src/plugins/chart_expressions/expression_partition_vis/ @elastic/kibana-vis-editors -/src/plugins/chart_expressions/expression_xy/ @elastic/kibana-vis-editors -/src/plugins/url_forwarding/ @elastic/kibana-vis-editors -/x-pack/test/functional/apps/lens @elastic/kibana-vis-editors -/x-pack/test/api_integration/apis/lens/ @elastic/kibana-vis-editors -/test/functional/apps/visualize/ @elastic/kibana-vis-editors -/src/plugins/unified_field_list/ @elastic/kibana-vis-editors -/test/api_integration/apis/unified_field_list/ @elastic/kibana-vis-editors +/x-pack/plugins/lens/ @elastic/kibana-visualizations +/src/plugins/charts/ @elastic/kibana-visualizations +/src/plugins/vis_default_editor/ @elastic/kibana-visualizations +/src/plugins/vis_types/metric/ @elastic/kibana-visualizations +/src/plugins/vis_types/table/ @elastic/kibana-visualizations +/src/plugins/vis_types/tagcloud/ @elastic/kibana-visualizations +/src/plugins/vis_types/timelion/ @elastic/kibana-visualizations +/src/plugins/vis_types/timeseries/ @elastic/kibana-visualizations +/src/plugins/vis_types/vega/ @elastic/kibana-visualizations +/src/plugins/vis_types/vislib/ @elastic/kibana-visualizations +/src/plugins/vis_types/xy/ @elastic/kibana-visualizations +/src/plugins/vis_types/pie/ @elastic/kibana-visualizations +/src/plugins/vis_types/heatmap/ @elastic/kibana-visualizations +/src/plugins/visualize/ @elastic/kibana-visualizations +/src/plugins/visualizations/ @elastic/kibana-visualizations +/src/plugins/chart_expressions/expression_tagcloud/ @elastic/kibana-visualizations +/src/plugins/chart_expressions/expression_metric/ @elastic/kibana-visualizations +/src/plugins/chart_expressions/expression_heatmap/ @elastic/kibana-visualizations +/src/plugins/chart_expressions/expression_gauge/ @elastic/kibana-visualizations +/src/plugins/chart_expressions/expression_partition_vis/ @elastic/kibana-visualizations +/src/plugins/chart_expressions/expression_xy/ @elastic/kibana-visualizations +/src/plugins/url_forwarding/ @elastic/kibana-visualizations +/x-pack/test/functional/apps/lens @elastic/kibana-visualizations +/x-pack/test/api_integration/apis/lens/ @elastic/kibana-visualizations +/test/functional/apps/visualize/ @elastic/kibana-visualizations # Application Services /examples/bfetch_explorer/ @elastic/kibana-app-services @@ -86,11 +84,12 @@ /x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services /x-pack/plugins/runtime_fields @elastic/kibana-app-services /src/plugins/dashboard/public/application/embeddable/viewport/print_media @elastic/kibana-app-services -x-pack/plugins/files @elastic/kibana-app-services -x-pack/examples/files_example @elastic/kibana-app-services +/src/plugins/files @elastic/kibana-app-services +/examples/files_example @elastic/kibana-app-services /x-pack/test/search_sessions_integration/ @elastic/kibana-app-services /test/plugin_functional/test_suites/panel_actions @elastic/kibana-app-services /test/plugin_functional/test_suites/data_plugin @elastic/kibana-app-services +/x-pack/plugins/notifications/ @elastic/kibana-app-services ### Observability Plugins @@ -207,6 +206,7 @@ x-pack/examples/files_example @elastic/kibana-app-services /x-pack/test/alerting_api_integration/spaces_only/tests/alerting/transform_rule_types/ @elastic/ml-ui /x-pack/test/screenshot_creation/apps/ml_docs @elastic/ml-ui /x-pack/test/screenshot_creation/services/ml_screenshots.ts @elastic/ml-ui +/docs/api/machine-learning/ @elastic/mlr-docs # Additional plugins and packages maintained by the ML team. /x-pack/plugins/aiops/ @elastic/ml-ui @@ -227,8 +227,8 @@ x-pack/examples/files_example @elastic/kibana-app-services /x-pack/test/api_integration/apis/maps/ @elastic/kibana-gis /x-pack/test/functional/apps/maps/ @elastic/kibana-gis /x-pack/test/functional/es_archives/maps/ @elastic/kibana-gis -/x-pack/plugins/stack_alerts/server/alert_types/geo_containment @elastic/kibana-gis -/x-pack/plugins/stack_alerts/public/alert_types/geo_containment @elastic/kibana-gis +/x-pack/plugins/stack_alerts/server/rule_types/geo_containment @elastic/kibana-gis +/x-pack/plugins/stack_alerts/public/rule_types/geo_containment @elastic/kibana-gis #CC# /x-pack/plugins/file_upload @elastic/kibana-gis /x-pack/plugins/file_upload @elastic/kibana-gis @@ -354,6 +354,8 @@ x-pack/examples/files_example @elastic/kibana-app-services /x-pack/test/functional/services/cases/ @elastic/response-ops /x-pack/test/functional_with_es_ssl/apps/cases/ @elastic/response-ops /x-pack/test/api_integration/apis/cases/ @elastic/response-ops +/docs/api/cases @elastic/mlr-docs +/x-pack/plugins/cases/docs/openapi @elastic/mlr-docs # Enterprise Search /x-pack/plugins/enterprise_search @elastic/enterprise-search-frontend @@ -707,6 +709,7 @@ packages/core/application/core-application-browser-mocks @elastic/kibana-core packages/core/application/core-application-common @elastic/kibana-core packages/core/apps/core-apps-browser-internal @elastic/kibana-core packages/core/apps/core-apps-browser-mocks @elastic/kibana-core +packages/core/apps/core-apps-server-internal @elastic/kibana-core packages/core/base/core-base-browser-internal @elastic/kibana-core packages/core/base/core-base-browser-mocks @elastic/kibana-core packages/core/base/core-base-common @elastic/kibana-core @@ -784,6 +787,12 @@ packages/core/integrations/core-integrations-browser-mocks @elastic/kibana-core packages/core/lifecycle/core-lifecycle-browser @elastic/kibana-core packages/core/lifecycle/core-lifecycle-browser-internal @elastic/kibana-core packages/core/lifecycle/core-lifecycle-browser-mocks @elastic/kibana-core +packages/core/lifecycle/core-lifecycle-server @elastic/kibana-core +packages/core/lifecycle/core-lifecycle-server-internal @elastic/kibana-core +packages/core/lifecycle/core-lifecycle-server-mocks @elastic/kibana-core +packages/core/logging/core-logging-browser-internal @elastic/kibana-core +packages/core/logging/core-logging-browser-mocks @elastic/kibana-core +packages/core/logging/core-logging-common-internal @elastic/kibana-core packages/core/logging/core-logging-server @elastic/kibana-core packages/core/logging/core-logging-server-internal @elastic/kibana-core packages/core/logging/core-logging-server-mocks @elastic/kibana-core @@ -807,6 +816,9 @@ packages/core/plugins/core-plugins-base-server-internal @elastic/kibana-core packages/core/plugins/core-plugins-browser @elastic/kibana-core packages/core/plugins/core-plugins-browser-internal @elastic/kibana-core packages/core/plugins/core-plugins-browser-mocks @elastic/kibana-core +packages/core/plugins/core-plugins-server @elastic/kibana-core +packages/core/plugins/core-plugins-server-internal @elastic/kibana-core +packages/core/plugins/core-plugins-server-mocks @elastic/kibana-core packages/core/preboot/core-preboot-server @elastic/kibana-core packages/core/preboot/core-preboot-server-internal @elastic/kibana-core packages/core/preboot/core-preboot-server-mocks @elastic/kibana-core @@ -873,12 +885,12 @@ packages/kbn-babel-preset @elastic/kibana-operations packages/kbn-bazel-packages @elastic/kibana-operations packages/kbn-bazel-runner @elastic/kibana-operations packages/kbn-cases-components @elastic/response-ops -packages/kbn-chart-icons @elastic/kibana-vis-editors +packages/kbn-chart-icons @elastic/kibana-visualizations packages/kbn-ci-stats-core @elastic/kibana-operations packages/kbn-ci-stats-performance-metrics @elastic/kibana-operations packages/kbn-ci-stats-reporter @elastic/kibana-operations packages/kbn-cli-dev-mode @elastic/kibana-operations -packages/kbn-coloring @elastic/kibana-vis-editors +packages/kbn-coloring @elastic/kibana-visualizations packages/kbn-config @elastic/kibana-core packages/kbn-config-mocks @elastic/kibana-core packages/kbn-config-schema @elastic/kibana-core @@ -921,7 +933,7 @@ packages/kbn-io-ts-utils @elastic/apm-ui packages/kbn-jest-serializers @elastic/kibana-operations packages/kbn-journeys @elastic/kibana-operations packages/kbn-kibana-manifest-schema @elastic/kibana-operations -packages/kbn-language-documentation-popover @elastic/kibana-vis-editors +packages/kbn-language-documentation-popover @elastic/kibana-visualizations packages/kbn-logging @elastic/kibana-core packages/kbn-logging-mocks @elastic/kibana-core packages/kbn-managed-vscode-config @elastic/kibana-operations @@ -938,7 +950,7 @@ packages/kbn-plugin-helpers @elastic/kibana-operations packages/kbn-react-field @elastic/kibana-app-services packages/kbn-repo-source-classifier @elastic/kibana-operations packages/kbn-repo-source-classifier-cli @elastic/kibana-operations -packages/kbn-rule-data-utils @elastic/apm-ui +packages/kbn-rule-data-utils @elastic/security-detections-response @elastic/actionable-observability @elastic/response-ops packages/kbn-safer-lodash-set @elastic/kibana-security packages/kbn-securitysolution-autocomplete @elastic/security-solution-platform packages/kbn-securitysolution-es-utils @elastic/security-solution-platform @@ -970,8 +982,8 @@ packages/kbn-telemetry-tools @elastic/kibana-core packages/kbn-test @elastic/kibana-operations packages/kbn-test-jest-helpers @elastic/kibana-operations packages/kbn-test-subj-selector @elastic/kibana-operations -packages/kbn-timelion-grammar @elastic/kibana-vis-editors -packages/kbn-tinymath @elastic/kibana-vis-editors +packages/kbn-timelion-grammar @elastic/kibana-visualizations +packages/kbn-tinymath @elastic/kibana-visualizations packages/kbn-tooling-log @elastic/kibana-operations packages/kbn-type-summarizer @elastic/kibana-operations packages/kbn-type-summarizer-cli @elastic/kibana-operations diff --git a/.github/relabel.yml b/.github/relabel.yml index a737be356ce81..eb9a2fd557f45 100644 --- a/.github/relabel.yml +++ b/.github/relabel.yml @@ -1,3 +1,3 @@ issues: - missingLabel: needs-team - regex: ^(\:ml)|(Team:.*)$ \ No newline at end of file + regex: (^\:ml$)|(^Team:.+$)|(^EUI$) diff --git a/.github/workflows/add-fleet-issues-to-ingest-project.yml b/.github/workflows/add-fleet-issues-to-ingest-project.yml new file mode 100644 index 0000000000000..239c05c7028d4 --- /dev/null +++ b/.github/workflows/add-fleet-issues-to-ingest-project.yml @@ -0,0 +1,51 @@ +name: Add Fleet issue to Platform Ingest project + +on: + issues: + types: + - labeled + +env: + INGEST_PROJECT_ID: 'PVT_kwDOAGc3Zs4AEzn4' + FLEET_LABEL: 'Team:Fleet' + AREA_FIELD_ID: 'PVTSSF_lADOAGc3Zs4AEzn4zgEgZSo' + FLEET_UI_OPTION_ID: '411a7b86' + +jobs: + add_to_ingest_project: + runs-on: ubuntu-latest + steps: + - uses: octokit/graphql-action@v2.x + id: add_to_project + if: ${{ github.event.label.name == env.FLEET_LABEL }} + with: + query: | + # Variables have to be snake cased because of https://github.com/octokit/graphql-action/issues/164 + mutation AddToIngestProject($project_id: ID!, $content_id: ID!) { + addProjectV2ItemById(input: { projectId: $project_id, contentId: $content_id }) { + item { + id + } + } + } + project_id: ${{ env.INGEST_PROJECT_ID }} + content_id: ${{ github.event.issue.node_id }} + env: + GITHUB_TOKEN: ${{ secrets.FLEET_PROJECT_TOKEN }} + - uses: octokit/graphql-action@v2.x + id: set_fleet_ui_area + if: github.event.label.name == env.FLEET_LABEL + with: + query: | + mutation updateIngestArea($item_id: ID!, $project_id: ID!, $area_field_id: ID!, $area_id: String) { + updateProjectV2ItemFieldValue( + input: { itemId: $item_id, projectId: $project_id, fieldId: $area_field_id, value: { singleSelectOptionId: $area_id } }) { + clientMutationId + } + } + item_id: ${{ fromJSON(steps.add_to_project.outputs.data).addProjectV2ItemById.item.id }} + project_id: ${{ env.INGEST_PROJECT_ID }} + area_field_id: ${{ env.AREA_FIELD_ID }} + area_id: ${{ env.FLEET_UI_OPTION_ID }} + env: + GITHUB_TOKEN: ${{ secrets.FLEET_PROJECT_TOKEN }} diff --git a/.github/workflows/add-to-fleet-project.yml b/.github/workflows/add-to-fleet-project.yml deleted file mode 100644 index e828a3a5b637e..0000000000000 --- a/.github/workflows/add-to-fleet-project.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Add to Fleet:Quality project -on: - issues: - types: - - labeled -jobs: - add_to_project: - runs-on: ubuntu-latest - if: | - contains(github.event.issue.labels.*.name, 'Team:Fleet') && ( - contains(github.event.issue.labels.*.name, 'technical debt') || - contains(github.event.issue.labels.*.name, 'bug') || - contains(github.event.issue.labels.*.name, 'performance') || - contains(github.event.issue.labels.*.name, 'failed-test') || - contains(github.event.issue.labels.*.name, 'chore') - ) - steps: - - uses: octokit/graphql-action@v2.x - id: add_to_project - with: - headers: '{"GraphQL-Features": "projects_next_graphql"}' - query: | - mutation add_to_project($projectid: ID!, $contentid: ID!) { - addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) { - projectNextItem { - id - } - } - } - projectid: ${{ env.PROJECT_ID }} - contentid: ${{ github.event.issue.node_id }} - env: - # https://github.com/orgs/elastic/projects/763 - PROJECT_ID: "PN_kwDOAGc3Zs4AAsH6" - # Token with `write:org` access - GITHUB_TOKEN: ${{ secrets.FLEET_TECH_KIBANA_USER_TOKEN }} diff --git a/.gitignore b/.gitignore index 82a13e661a5bb..24b636ac3196b 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,12 @@ npm-debug.log* ## @cypress/snapshot from apm plugin /snapshots.js +# transpiled cypress config +x-pack/plugins/fleet/cypress.config.d.ts +x-pack/plugins/fleet/cypress.config.js +x-pack/plugins/osquery/cypress.config.d.ts +x-pack/plugins/osquery/cypress.config.js + # release notes script output report.csv report.asciidoc @@ -88,6 +94,8 @@ report.asciidoc # Automatically generated and user-modifiable /tsconfig.refs.json +tsconfig.base.type_check.json +tsconfig.type_check.json # Yarn local mirror content .yarn-local-mirror diff --git a/.i18nrc.json b/.i18nrc.json index 874c4ecbcc1ba..2894905ae8f88 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -9,10 +9,7 @@ "charts": "src/plugins/charts", "console": "src/plugins/console", "contentManagement": "packages/content-management", - "core": [ - "src/core", - "packages/core" - ], + "core": ["src/core", "packages/core"], "customIntegrations": "src/plugins/custom_integrations", "dashboard": "src/plugins/dashboard", "controls": "src/plugins/controls", @@ -41,6 +38,7 @@ "expressionTagcloud": "src/plugins/chart_expressions/expression_tagcloud", "eventAnnotation": "src/plugins/event_annotation", "fieldFormats": "src/plugins/field_formats", + "files": "src/plugins/files", "flot": "packages/kbn-flot-charts/lib", "guidedOnboarding": "src/plugins/guided_onboarding", "guidedOnboardingPackage": "packages/kbn-guided-onboarding", diff --git a/api_docs/actions.devdocs.json b/api_docs/actions.devdocs.json index 0f63f83fedf12..88a9e275e1fba 100644 --- a/api_docs/actions.devdocs.json +++ b/api_docs/actions.devdocs.json @@ -18,7 +18,13 @@ "text": "Plugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "<", { "pluginId": "actions", @@ -55,7 +61,13 @@ "label": "ctx", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "<", "Config", ">" @@ -527,7 +539,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts", "deprecated": false, @@ -772,6 +790,102 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "actions", + "id": "def-server.UnsecuredActionsClient", + "type": "Class", + "tags": [], + "label": "UnsecuredActionsClient", + "description": [], + "path": "x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "actions", + "id": "def-server.UnsecuredActionsClient.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "actions", + "id": "def-server.UnsecuredActionsClient.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "UnsecuredActionsClientOpts" + ], + "path": "x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "actions", + "id": "def-server.UnsecuredActionsClient.bulkEnqueueExecution", + "type": "Function", + "tags": [], + "label": "bulkEnqueueExecution", + "description": [], + "signature": [ + "(requesterId: string, actionsToExecute: ", + "ExecuteOptions", + "[]) => Promise" + ], + "path": "x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "actions", + "id": "def-server.UnsecuredActionsClient.bulkEnqueueExecution.$1", + "type": "string", + "tags": [], + "label": "requesterId", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "actions", + "id": "def-server.UnsecuredActionsClient.bulkEnqueueExecution.$2", + "type": "Array", + "tags": [], + "label": "actionsToExecute", + "description": [], + "signature": [ + "ExecuteOptions", + "[]" + ], + "path": "x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false } ], "functions": [ @@ -784,7 +898,13 @@ "description": [], "signature": [ "(source: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", "HttpRequestExecutionSource" ], @@ -800,7 +920,13 @@ "label": "source", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/actions/server/lib/action_execution_source.ts", @@ -821,7 +947,13 @@ "description": [], "signature": [ "(source: Omit<", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, ", \"name\">) => ", "SavedObjectExecutionSource" ], @@ -838,7 +970,13 @@ "description": [], "signature": [ "Omit<", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, ", \"name\">" ], "path": "x-pack/plugins/actions/server/lib/action_execution_source.ts", @@ -1397,7 +1535,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/plugins/actions/server/types.ts", "deprecated": false, @@ -1494,6 +1638,70 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "actions", + "id": "def-server.IUnsecuredActionsClient", + "type": "Interface", + "tags": [], + "label": "IUnsecuredActionsClient", + "description": [], + "path": "x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "actions", + "id": "def-server.IUnsecuredActionsClient.bulkEnqueueExecution", + "type": "Function", + "tags": [], + "label": "bulkEnqueueExecution", + "description": [], + "signature": [ + "(requesterId: string, actionsToExecute: ", + "ExecuteOptions", + "[]) => Promise" + ], + "path": "x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "actions", + "id": "def-server.IUnsecuredActionsClient.bulkEnqueueExecution.$1", + "type": "string", + "tags": [], + "label": "requesterId", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "actions", + "id": "def-server.IUnsecuredActionsClient.bulkEnqueueExecution.$2", + "type": "Array", + "tags": [], + "label": "actionsToExecute", + "description": [], + "signature": [ + "ExecuteOptions", + "[]" + ], + "path": "x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "actions", "id": "def-server.PreConfiguredAction", @@ -1613,7 +1821,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/plugins/actions/server/sub_action_framework/types.ts", "deprecated": false, @@ -1753,7 +1967,7 @@ }, "<", "ActionTypeConfig", - ">[]>; getOAuthAccessToken: ({ type, options }: Readonly<{} & { options: Readonly<{} & { config: Readonly<{} & { clientId: string; jwtKeyId: string; userIdentifierValue: string; }>; tokenUrl: string; secrets: Readonly<{ privateKeyPassword?: string | undefined; } & { clientSecret: string; privateKey: string; }>; }> | Readonly<{} & { scope: string; config: Readonly<{} & { clientId: string; tenantId: string; }>; tokenUrl: string; secrets: Readonly<{} & { clientSecret: string; }>; }>; type: \"jwt\" | \"client\"; }>, configurationUtilities: ", + ">[]>; getOAuthAccessToken: ({ type, options }: Readonly<{} & { options: Readonly<{} & { config: Readonly<{} & { clientId: string; jwtKeyId: string; userIdentifierValue: string; }>; tokenUrl: string; secrets: Readonly<{ privateKeyPassword?: string | undefined; } & { clientSecret: string; privateKey: string; }>; }> | Readonly<{} & { scope: string; config: Readonly<{} & { clientId: string; tenantId: string; }>; tokenUrl: string; secrets: Readonly<{} & { clientSecret: string; }>; }>; type: \"client\" | \"jwt\"; }>, configurationUtilities: ", "ActionsConfigurationUtilities", ") => Promise<{ accessToken: string | null; }>; enqueueExecution: (options: ", "ExecuteOptions", @@ -2134,9 +2348,21 @@ "description": [], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise<", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", { "pluginId": "actions", @@ -2159,7 +2385,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/actions/server/plugin.ts", @@ -2179,9 +2411,21 @@ "description": [], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", { "pluginId": "actions", @@ -2204,7 +2448,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/actions/server/plugin.ts", @@ -2240,6 +2490,29 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "actions", + "id": "def-server.PluginStartContract.getUnsecuredActionsClient", + "type": "Function", + "tags": [], + "label": "getUnsecuredActionsClient", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "actions", + "scope": "server", + "docId": "kibActionsPluginApi", + "section": "def-server.IUnsecuredActionsClient", + "text": "IUnsecuredActionsClient" + } + ], + "path": "x-pack/plugins/actions/server/plugin.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "actions", "id": "def-server.PluginStartContract.renderActionParameterTemplates", @@ -3461,10 +3734,13 @@ { "parentPluginId": "actions", "id": "def-common.AlertingConnectorFeature.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/actions/common/connector_feature_config.ts", "deprecated": false, "trackAdoption": false @@ -3472,10 +3748,13 @@ { "parentPluginId": "actions", "id": "def-common.AlertingConnectorFeature.compatibility", - "type": "string", + "type": "Any", "tags": [], "label": "compatibility", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/actions/common/connector_feature_config.ts", "deprecated": false, "trackAdoption": false @@ -3508,10 +3787,13 @@ { "parentPluginId": "actions", "id": "def-common.CasesConnectorFeature.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/actions/common/connector_feature_config.ts", "deprecated": false, "trackAdoption": false @@ -3519,10 +3801,13 @@ { "parentPluginId": "actions", "id": "def-common.CasesConnectorFeature.compatibility", - "type": "string", + "type": "Any", "tags": [], "label": "compatibility", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/actions/common/connector_feature_config.ts", "deprecated": false, "trackAdoption": false @@ -3570,10 +3855,13 @@ { "parentPluginId": "actions", "id": "def-common.SecuritySolutionFeature.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/actions/common/connector_feature_config.ts", "deprecated": false, "trackAdoption": false @@ -3581,10 +3869,13 @@ { "parentPluginId": "actions", "id": "def-common.SecuritySolutionFeature.compatibility", - "type": "string", + "type": "Any", "tags": [], "label": "compatibility", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/actions/common/connector_feature_config.ts", "deprecated": false, "trackAdoption": false @@ -3617,10 +3908,13 @@ { "parentPluginId": "actions", "id": "def-common.UptimeConnectorFeature.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/actions/common/connector_feature_config.ts", "deprecated": false, "trackAdoption": false @@ -3628,10 +3922,13 @@ { "parentPluginId": "actions", "id": "def-common.UptimeConnectorFeature.compatibility", - "type": "string", + "type": "Any", "tags": [], "label": "compatibility", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/actions/common/connector_feature_config.ts", "deprecated": false, "trackAdoption": false diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 6d674fb6c9a18..96a5ce87f4b5d 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 214 | 0 | 209 | 23 | +| 225 | 8 | 220 | 24 | ## Client diff --git a/api_docs/advanced_settings.devdocs.json b/api_docs/advanced_settings.devdocs.json index 7942869bbf8cb..66331982f81ce 100644 --- a/api_docs/advanced_settings.devdocs.json +++ b/api_docs/advanced_settings.devdocs.json @@ -304,11 +304,29 @@ "description": [], "signature": [ "({\n def,\n name,\n value,\n isCustom,\n isOverridden,\n}: { def: ", - "PublicUiSettingsParams", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.PublicUiSettingsParams", + "text": "PublicUiSettingsParams" + }, " & ", - "UserProvidedValues", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UserProvidedValues", + "text": "UserProvidedValues" + }, "; name: string; value: ", - "SavedObjectAttribute", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttribute", + "text": "SavedObjectAttribute" + }, "; isCustom: boolean; isOverridden: boolean; }) => ", "FieldSetting" ], @@ -335,9 +353,21 @@ "label": "def", "description": [], "signature": [ - "PublicUiSettingsParams", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.PublicUiSettingsParams", + "text": "PublicUiSettingsParams" + }, " & ", - "UserProvidedValues", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UserProvidedValues", + "text": "UserProvidedValues" + }, "" ], "path": "src/plugins/advanced_settings/public/management_app/lib/to_editable_config.ts", @@ -363,9 +393,21 @@ "label": "value", "description": [], "signature": [ - "SavedObjectAttributeSingle", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributeSingle", + "text": "SavedObjectAttributeSingle" + }, " | ", - "SavedObjectAttributeSingle", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributeSingle", + "text": "SavedObjectAttributeSingle" + }, "[]" ], "path": "src/plugins/advanced_settings/public/management_app/lib/to_editable_config.ts", diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 736446febbc86..53e647f5006d3 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index 305d1be9b785c..84aea9cd71712 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.devdocs.json b/api_docs/alerting.devdocs.json index 3178e4112dea5..c87ec50c9ab51 100644 --- a/api_docs/alerting.devdocs.json +++ b/api_docs/alerting.devdocs.json @@ -25,7 +25,13 @@ "text": "SanitizedRule" }, ") => string | ", - "JsonObject" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonObject", + "text": "JsonObject" + } ], "path": "x-pack/plugins/alerting/public/alert_navigation_registry/types.ts", "deprecated": false, @@ -551,9 +557,21 @@ ", filterOpts: ", "AlertingAuthorizationFilterOpts", ") => Promise<{ filter?: ", - "JsonObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonObject", + "text": "JsonObject" + }, " | ", - "KueryNode", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.KueryNode", + "text": "KueryNode" + }, " | undefined; ensureRuleTypeIsAuthorized: (ruleTypeId: string, consumer: string, auth: string) => void; }>" ], "path": "x-pack/plugins/alerting/server/authorization/alerting_authorization.ts", @@ -634,9 +652,21 @@ "text": "WriteOperations" }, ") => Promise<{ filter?: ", - "JsonObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonObject", + "text": "JsonObject" + }, " | ", - "KueryNode", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.KueryNode", + "text": "KueryNode" + }, " | undefined; ensureRuleTypeIsAuthorized: (ruleTypeId: string, consumer: string, auth: string) => void; }>" ], "path": "x-pack/plugins/alerting/server/authorization/alerting_authorization.ts", @@ -1200,7 +1230,13 @@ "description": [], "signature": [ "string | ", - "KueryNode", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.KueryNode", + "text": "KueryNode" + }, " | undefined" ], "path": "x-pack/plugins/alerting/server/rules_client/rules_client.ts", @@ -1575,6 +1611,22 @@ "returnComment": [], "children": [] }, + { + "parentPluginId": "alerting", + "id": "def-server.PluginStartContract.getAllTypes", + "type": "Function", + "tags": [], + "label": "getAllTypes", + "description": [], + "signature": [ + "() => string[]" + ], + "path": "x-pack/plugins/alerting/server/plugin.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, { "parentPluginId": "alerting", "id": "def-server.PluginStartContract.getRulesClientWithRequest", @@ -1584,7 +1636,13 @@ "description": [], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", "RulesClientApi" ], @@ -1600,7 +1658,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/alerting/server/plugin.ts", @@ -1620,9 +1684,21 @@ "description": [], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", { "pluginId": "alerting", @@ -1645,7 +1721,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/alerting/server/plugin.ts", @@ -1704,17 +1786,6 @@ "deprecated": false, "trackAdoption": false, "children": [ - { - "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.alertId", - "type": "string", - "tags": [], - "label": "alertId", - "description": [], - "path": "x-pack/plugins/alerting/server/types.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "alerting", "id": "def-server.RuleExecutorOptions.executionId", @@ -1728,48 +1799,19 @@ }, { "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.startedAt", - "type": "Object", - "tags": [], - "label": "startedAt", - "description": [], - "signature": [ - "Date" - ], - "path": "x-pack/plugins/alerting/server/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.previousStartedAt", - "type": "CompoundType", - "tags": [], - "label": "previousStartedAt", - "description": [], - "signature": [ - "Date | null" - ], - "path": "x-pack/plugins/alerting/server/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.services", + "id": "def-server.RuleExecutorOptions.logger", "type": "Object", "tags": [], - "label": "services", + "label": "logger", "description": [], "signature": [ { - "pluginId": "alerting", + "pluginId": "@kbn/logging", "scope": "server", - "docId": "kibAlertingPluginApi", - "section": "def-server.RuleExecutorServices", - "text": "RuleExecutorServices" - }, - "" + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -1791,13 +1833,13 @@ }, { "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.state", - "type": "Uncategorized", + "id": "def-server.RuleExecutorOptions.previousStartedAt", + "type": "CompoundType", "tags": [], - "label": "state", + "label": "previousStartedAt", "description": [], "signature": [ - "State" + "Date | null" ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -1819,7 +1861,7 @@ "section": "def-common.SanitizedRule", "text": "SanitizedRule" }, - ", \"name\" | \"tags\" | \"enabled\" | \"actions\" | \"throttle\" | \"consumer\" | \"schedule\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"notifyWhen\"> & { producer: string; ruleTypeId: string; ruleTypeName: string; }" + ", \"name\" | \"tags\" | \"id\" | \"enabled\" | \"actions\" | \"throttle\" | \"consumer\" | \"schedule\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"notifyWhen\"> & { producer: string; ruleTypeId: string; ruleTypeName: string; }" ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -1827,24 +1869,20 @@ }, { "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.spaceId", - "type": "string", - "tags": [], - "label": "spaceId", - "description": [], - "path": "x-pack/plugins/alerting/server/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.namespace", - "type": "string", + "id": "def-server.RuleExecutorOptions.services", + "type": "Object", "tags": [], - "label": "namespace", + "label": "services", "description": [], "signature": [ - "string | undefined" + { + "pluginId": "alerting", + "scope": "server", + "docId": "kibAlertingPluginApi", + "section": "def-server.RuleExecutorServices", + "text": "RuleExecutorServices" + }, + "" ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -1852,38 +1890,24 @@ }, { "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.name", + "id": "def-server.RuleExecutorOptions.spaceId", "type": "string", "tags": [], - "label": "name", - "description": [], - "path": "x-pack/plugins/alerting/server/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.tags", - "type": "Array", - "tags": [], - "label": "tags", + "label": "spaceId", "description": [], - "signature": [ - "string[]" - ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.createdBy", - "type": "CompoundType", + "id": "def-server.RuleExecutorOptions.startedAt", + "type": "Object", "tags": [], - "label": "createdBy", + "label": "startedAt", "description": [], "signature": [ - "string | null" + "Date" ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -1891,13 +1915,13 @@ }, { "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.updatedBy", - "type": "CompoundType", + "id": "def-server.RuleExecutorOptions.state", + "type": "Uncategorized", "tags": [], - "label": "updatedBy", + "label": "state", "description": [], "signature": [ - "string | null" + "State" ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -1905,13 +1929,13 @@ }, { "parentPluginId": "alerting", - "id": "def-server.RuleExecutorOptions.logger", - "type": "Object", + "id": "def-server.RuleExecutorOptions.namespace", + "type": "string", "tags": [], - "label": "logger", + "label": "namespace", "description": [], "signature": [ - "Logger" + "string | undefined" ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -1969,7 +1993,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -1983,7 +2013,13 @@ "label": "uiSettingsClient", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -1997,7 +2033,13 @@ "label": "scopedClusterClient", "description": [], "signature": [ - "IScopedClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + } ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -2083,7 +2125,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "x-pack/plugins/alerting/server/types.ts", @@ -2356,7 +2404,13 @@ "text": "RuleParamsAndRefs" }, "; injectReferences: (params: ExtractedParams, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => Params; } | undefined" ], "path": "x-pack/plugins/alerting/server/types.ts", @@ -2697,7 +2751,13 @@ "label": "RuleActionParams", "description": [], "signature": [ - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "x-pack/plugins/alerting/common/rule.ts", "deprecated": false, @@ -2824,7 +2884,7 @@ "section": "def-common.IExecutionLogResult", "text": "IExecutionLogResult" }, - ">; getGlobalExecutionLogWithAuth: ({ dateStart, dateEnd, filter, page, perPage, sort, }: ", + ">; getGlobalExecutionLogWithAuth: ({ dateStart, dateEnd, filter, page, perPage, sort, namespaces, }: ", "GetGlobalExecutionLogParams", ") => Promise<", { @@ -2844,11 +2904,25 @@ "section": "def-common.IExecutionErrorsResult", "text": "IExecutionErrorsResult" }, - ">; getGlobalExecutionKpiWithAuth: ({ dateStart, dateEnd, filter, }: ", + ">; getActionErrorLogWithAuth: ({ id, dateStart, dateEnd, filter, page, perPage, sort, namespace, }: ", + "GetActionErrorLogByIdParams", + ") => Promise<", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.IExecutionErrorsResult", + "text": "IExecutionErrorsResult" + }, + ">; getGlobalExecutionKpiWithAuth: ({ dateStart, dateEnd, filter, namespaces, }: ", "GetGlobalExecutionKPIParams", ") => Promise<{ success: number; unknown: number; failure: number; warning: number; activeAlerts: number; newAlerts: number; recoveredAlerts: number; erroredActions: number; triggeredActions: number; }>; getRuleExecutionKPI: ({ id, dateStart, dateEnd, filter }: ", "GetRuleExecutionKPIParams", - ") => Promise<{ success: number; unknown: number; failure: number; warning: number; activeAlerts: number; newAlerts: number; recoveredAlerts: number; erroredActions: number; triggeredActions: number; }>; bulkEdit: Promise<{ success: number; unknown: number; failure: number; warning: number; activeAlerts: number; newAlerts: number; recoveredAlerts: number; erroredActions: number; triggeredActions: number; }>; bulkDeleteRules: (options: ", + "BulkDeleteOptions", + ") => Promise<{ errors: ", + "BulkDeleteError", + "[]; total: number; taskIdsFailedToBeDeleted: string[]; }>; bulkEdit: Promise; unmuteInstance: ({ alertId, alertInstanceId }: ", "MuteOptions", - ") => Promise; runSoon: ({ id }: { id: string; }) => Promise; listAlertTypes: () => Promise Promise; runSoon: ({ id }: { id: string; }) => Promise; listAlertTypes: () => Promise>; getSpaceId: () => string | undefined; }" ], @@ -4154,6 +4228,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "alerting", + "id": "def-common.IExecutionLog.space_ids", + "type": "Array", + "tags": [], + "label": "space_ids", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/alerting/common/execution_log_types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "alerting", "id": "def-common.IExecutionLog.rule_name", @@ -4230,7 +4318,13 @@ "text": "IntervalSchedule" }, " extends ", - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "x-pack/plugins/alerting/common/rule.ts", "deprecated": false, @@ -4987,7 +5081,13 @@ "label": "params", "description": [], "signature": [ - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "x-pack/plugins/alerting/common/rule.ts", "deprecated": false, @@ -5196,7 +5296,13 @@ "text": "RuleMonitoring" }, " extends ", - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "x-pack/plugins/alerting/common/rule.ts", "deprecated": false, @@ -5243,7 +5349,13 @@ "text": "RuleMonitoringHistory" }, " extends ", - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "x-pack/plugins/alerting/common/rule.ts", "deprecated": false, @@ -5390,7 +5502,13 @@ "label": "state", "description": [], "signature": [ - "JsonObject" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonObject", + "text": "JsonObject" + } ], "path": "x-pack/plugins/alerting/common/rule_navigation.ts", "deprecated": false, @@ -5929,7 +6047,13 @@ "label": "MappedParams", "description": [], "signature": [ - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, " & ", { "pluginId": "alerting", @@ -6020,7 +6144,13 @@ "text": "SanitizedRule" }, " & Omit<", - "SavedObjectsResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsResolveResponse", + "text": "SavedObjectsResolveResponse" + }, ", \"saved_object\">" ], "path": "x-pack/plugins/alerting/common/rule.ts", @@ -6036,9 +6166,21 @@ "label": "RuleActionParam", "description": [], "signature": [ - "SavedObjectAttributeSingle", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributeSingle", + "text": "SavedObjectAttributeSingle" + }, " | ", - "SavedObjectAttributeSingle", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributeSingle", + "text": "SavedObjectAttributeSingle" + }, "[]" ], "path": "x-pack/plugins/alerting/common/rule.ts", @@ -6054,7 +6196,13 @@ "label": "RuleActionParams", "description": [], "signature": [ - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "x-pack/plugins/alerting/common/rule.ts", "deprecated": false, @@ -6304,7 +6452,7 @@ "section": "def-common.SanitizedRule", "text": "SanitizedRule" }, - ", \"name\" | \"tags\" | \"enabled\" | \"actions\" | \"throttle\" | \"consumer\" | \"schedule\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"notifyWhen\"> & { producer: string; ruleTypeId: string; ruleTypeName: string; }" + ", \"name\" | \"tags\" | \"id\" | \"enabled\" | \"actions\" | \"throttle\" | \"consumer\" | \"schedule\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"notifyWhen\"> & { producer: string; ruleTypeId: string; ruleTypeName: string; }" ], "path": "x-pack/plugins/alerting/common/rule.ts", "deprecated": false, diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 826701d7cfa01..cd36ee42077e4 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 382 | 0 | 373 | 24 | +| 379 | 0 | 370 | 26 | ## Client diff --git a/api_docs/apm.devdocs.json b/api_docs/apm.devdocs.json index da5b63f9058c4..8eb23ab45ab73 100644 --- a/api_docs/apm.devdocs.json +++ b/api_docs/apm.devdocs.json @@ -66,7 +66,13 @@ "<{ serviceName: undefined; } | ({ serviceName: string; } & { serviceOverviewTab?: \"metrics\" | \"logs\" | \"traces\" | \"errors\" | undefined; } & { query: { environment: \"ENVIRONMENT_NOT_DEFINED\" | \"ENVIRONMENT_ALL\" | ", "Branded", "; }; })>; }" ], "path": "x-pack/plugins/apm/public/plugin.ts", @@ -111,9 +117,9 @@ }, " implements ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, @@ -158,9 +164,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, @@ -184,9 +190,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -198,10 +204,14 @@ "Observable", "; autoCreateApmDataView: boolean; serviceMapEnabled: boolean; serviceMapFingerprintBucketSize: number; serviceMapTraceIdBucketSize: number; serviceMapFingerprintGlobalBucketSize: number; serviceMapTraceIdGlobalBucketSize: number; serviceMapMaxTracesPerRequest: number; ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", - "; telemetryCollectionEnabled: boolean; metricsInterval: number; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }>>; getApmIndices: () => Promise<", - "ApmIndicesConfig", - ">; createApmEventClient: ({ request, context, debug, }: { debug?: boolean | undefined; request: ", - "KibanaRequest", + "; telemetryCollectionEnabled: boolean; metricsInterval: number; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; forceSyntheticSource: boolean; }>>; getApmIndices: () => Promise>; createApmEventClient: ({ request, context, debug, }: { debug?: boolean | undefined; request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "; context: ", "ApmPluginRequestHandlerContext", "; }) => Promise<", @@ -221,9 +231,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -264,9 +274,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, @@ -285,9 +295,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } @@ -341,7 +351,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/apm/server/routes/typings.ts", @@ -356,7 +372,13 @@ "label": "context", "description": [], "signature": [ - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, " & { licensing: Promise<", { "pluginId": "licensing", @@ -411,7 +433,7 @@ "signature": [ "{ readonly indices: Readonly<{} & { metric: string; error: string; span: string; transaction: string; sourcemap: string; onboarding: string; }>; readonly autoCreateApmDataView: boolean; readonly serviceMapEnabled: boolean; readonly serviceMapFingerprintBucketSize: number; readonly serviceMapTraceIdBucketSize: number; readonly serviceMapFingerprintGlobalBucketSize: number; readonly serviceMapTraceIdGlobalBucketSize: number; readonly serviceMapMaxTracesPerRequest: number; readonly ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; readonly searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", - "; readonly telemetryCollectionEnabled: boolean; readonly metricsInterval: number; readonly agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }" + "; readonly telemetryCollectionEnabled: boolean; readonly metricsInterval: number; readonly agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; readonly forceSyntheticSource: boolean; }" ], "path": "x-pack/plugins/apm/server/routes/typings.ts", "deprecated": false, @@ -425,7 +447,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/plugins/apm/server/routes/typings.ts", "deprecated": false, @@ -501,8 +529,14 @@ "section": "def-server.LicensingPluginStart", "text": "LicensingPluginStart" }, - ">; }; observability: { setup: { getScopedAnnotationsClient: (requestContext: ", - "RequestHandlerContext", + ">; }; observability: { setup: { getAlertDetailsConfig(): Readonly<{} & { apm: Readonly<{} & { enabled: boolean; }>; metrics: Readonly<{} & { enabled: boolean; }>; logs: Readonly<{} & { enabled: boolean; }>; uptime: Readonly<{} & { enabled: boolean; }>; }>; getScopedAnnotationsClient: (requestContext: ", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, " & { licensing: Promise<", { "pluginId": "licensing", @@ -512,7 +546,13 @@ "text": "LicensingApiRequestHandlerContext" }, ">; }, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise<{ readonly index: string; create: (createParams: { annotation: { type: string; }; '@timestamp': string; message: string; } & { tags?: string[] | undefined; service?: { name?: string | undefined; environment?: string | undefined; version?: string | undefined; } | undefined; }) => Promise<{ _id: string; _index: string; _source: ", "Annotation", "; }>; getById: (getByIdParams: { id: string; }) => Promise<", @@ -753,7 +793,7 @@ "label": "APIEndpoint", "description": [], "signature": [ - "\"POST /internal/apm/data_view/static\" | \"GET /internal/apm/data_view/title\" | \"GET /internal/apm/environments\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics_by_transaction_name\" | \"POST /internal/apm/services/{serviceName}/errors/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}\" | \"GET /internal/apm/services/{serviceName}/errors/distribution\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}/top_erroneous_transactions\" | \"POST /internal/apm/latency/overall_distribution/transactions\" | \"GET /internal/apm/services/{serviceName}/metrics/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/nodes\" | \"GET /internal/apm/observability_overview\" | \"GET /internal/apm/observability_overview/has_data\" | \"GET /internal/apm/service-map\" | \"GET /internal/apm/service-map/service/{serviceName}\" | \"GET /internal/apm/service-map/dependency\" | \"GET /internal/apm/services\" | \"POST /internal/apm/services/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/metadata/details\" | \"GET /internal/apm/services/{serviceName}/metadata/icons\" | \"GET /internal/apm/services/{serviceName}/agent\" | \"GET /internal/apm/services/{serviceName}/transaction_types\" | \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\" | \"GET /api/apm/services/{serviceName}/annotation/search\" | \"POST /api/apm/services/{serviceName}/annotation\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\" | \"GET /internal/apm/services/{serviceName}/throughput\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/dependencies\" | \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\" | \"GET /internal/apm/services/{serviceName}/anomaly_charts\" | \"GET /internal/apm/sorted_and_filtered_services\" | \"GET /internal/apm/service-groups\" | \"GET /internal/apm/service-group\" | \"POST /internal/apm/service-group\" | \"DELETE /internal/apm/service-group\" | \"GET /internal/apm/service-group/services\" | \"GET /internal/apm/service_groups/services_count\" | \"GET /internal/apm/suggestions\" | \"GET /internal/apm/traces/{traceId}\" | \"GET /internal/apm/traces\" | \"GET /internal/apm/traces/{traceId}/root_transaction\" | \"GET /internal/apm/transactions/{transactionId}\" | \"GET /internal/apm/traces/find\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\" | \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\" | \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name\" | \"GET /internal/apm/rule_types/transaction_error_rate/chart_preview\" | \"GET /internal/apm/rule_types/transaction_duration/chart_preview\" | \"GET /internal/apm/rule_types/error_count/chart_preview\" | \"GET /api/apm/settings/agent-configuration\" | \"GET /api/apm/settings/agent-configuration/view\" | \"DELETE /api/apm/settings/agent-configuration\" | \"PUT /api/apm/settings/agent-configuration\" | \"POST /api/apm/settings/agent-configuration/search\" | \"GET /api/apm/settings/agent-configuration/environments\" | \"GET /api/apm/settings/agent-configuration/agent_name\" | \"GET /internal/apm/settings/anomaly-detection/jobs\" | \"POST /internal/apm/settings/anomaly-detection/jobs\" | \"GET /internal/apm/settings/anomaly-detection/environments\" | \"POST /internal/apm/settings/anomaly-detection/update_to_v3\" | \"GET /internal/apm/settings/apm-index-settings\" | \"GET /internal/apm/settings/apm-indices\" | \"POST /internal/apm/settings/apm-indices/save\" | \"GET /internal/apm/settings/custom_links/transaction\" | \"GET /internal/apm/settings/custom_links\" | \"POST /internal/apm/settings/custom_links\" | \"PUT /internal/apm/settings/custom_links/{id}\" | \"DELETE /internal/apm/settings/custom_links/{id}\" | \"GET /api/apm/sourcemaps\" | \"POST /api/apm/sourcemaps\" | \"DELETE /api/apm/sourcemaps/{id}\" | \"GET /internal/apm/fleet/has_apm_policies\" | \"GET /internal/apm/fleet/agents\" | \"POST /api/apm/fleet/apm_server_schema\" | \"GET /internal/apm/fleet/apm_server_schema/unsupported\" | \"GET /internal/apm/fleet/migration_check\" | \"POST /internal/apm/fleet/cloud_apm_package_policy\" | \"GET /internal/apm/fleet/java_agent_versions\" | \"GET /internal/apm/dependencies/top_dependencies\" | \"GET /internal/apm/dependencies/upstream_services\" | \"GET /internal/apm/dependencies/metadata\" | \"GET /internal/apm/dependencies/charts/latency\" | \"GET /internal/apm/dependencies/charts/throughput\" | \"GET /internal/apm/dependencies/charts/error_rate\" | \"GET /internal/apm/dependencies/operations\" | \"GET /internal/apm/dependencies/charts/distribution\" | \"GET /internal/apm/dependencies/operations/spans\" | \"GET /internal/apm/correlations/field_candidates/transactions\" | \"POST /internal/apm/correlations/field_stats/transactions\" | \"GET /internal/apm/correlations/field_value_stats/transactions\" | \"POST /internal/apm/correlations/field_value_pairs/transactions\" | \"POST /internal/apm/correlations/significant_correlations/transactions\" | \"POST /internal/apm/correlations/p_values/transactions\" | \"GET /internal/apm/fallback_to_transactions\" | \"GET /internal/apm/has_data\" | \"GET /internal/apm/event_metadata/{processorEvent}/{id}\" | \"GET /internal/apm/agent_keys\" | \"GET /internal/apm/agent_keys/privileges\" | \"POST /internal/apm/api_key/invalidate\" | \"POST /api/apm/agent_keys\" | \"GET /internal/apm/storage_explorer\" | \"GET /internal/apm/services/{serviceName}/storage_details\" | \"GET /internal/apm/storage_chart\" | \"GET /internal/apm/storage_explorer/privileges\" | \"GET /internal/apm/storage_explorer_summary_stats\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/parents\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/children\" | \"GET /internal/apm/services/{serviceName}/infrastructure_attributes\" | \"GET /internal/apm/debug-telemetry\" | \"GET /internal/apm/time_range_metadata\" | \"GET /internal/apm/settings/labs\"" + "\"POST /internal/apm/data_view/static\" | \"GET /internal/apm/data_view/title\" | \"GET /internal/apm/environments\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics_by_transaction_name\" | \"POST /internal/apm/services/{serviceName}/errors/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}\" | \"GET /internal/apm/services/{serviceName}/errors/distribution\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}/top_erroneous_transactions\" | \"POST /internal/apm/latency/overall_distribution/transactions\" | \"GET /internal/apm/services/{serviceName}/metrics/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/nodes\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/summary\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances\" | \"GET /internal/apm/observability_overview\" | \"GET /internal/apm/observability_overview/has_data\" | \"GET /internal/apm/service-map\" | \"GET /internal/apm/service-map/service/{serviceName}\" | \"GET /internal/apm/service-map/dependency\" | \"GET /internal/apm/services\" | \"POST /internal/apm/services/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/metadata/details\" | \"GET /internal/apm/services/{serviceName}/metadata/icons\" | \"GET /internal/apm/services/{serviceName}/agent\" | \"GET /internal/apm/services/{serviceName}/transaction_types\" | \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\" | \"GET /api/apm/services/{serviceName}/annotation/search\" | \"POST /api/apm/services/{serviceName}/annotation\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\" | \"GET /internal/apm/services/{serviceName}/throughput\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/dependencies\" | \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\" | \"GET /internal/apm/services/{serviceName}/anomaly_charts\" | \"GET /internal/apm/sorted_and_filtered_services\" | \"GET /internal/apm/service-groups\" | \"GET /internal/apm/service-group\" | \"POST /internal/apm/service-group\" | \"DELETE /internal/apm/service-group\" | \"GET /internal/apm/service-group/services\" | \"GET /internal/apm/service_groups/services_count\" | \"GET /internal/apm/suggestions\" | \"GET /internal/apm/traces/{traceId}\" | \"GET /internal/apm/traces\" | \"GET /internal/apm/traces/{traceId}/root_transaction\" | \"GET /internal/apm/transactions/{transactionId}\" | \"GET /internal/apm/traces/find\" | \"POST /internal/apm/traces/aggregated_critical_path\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\" | \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\" | \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name\" | \"GET /internal/apm/rule_types/transaction_error_rate/chart_preview\" | \"GET /internal/apm/rule_types/transaction_duration/chart_preview\" | \"GET /internal/apm/rule_types/error_count/chart_preview\" | \"GET /api/apm/settings/agent-configuration\" | \"GET /api/apm/settings/agent-configuration/view\" | \"DELETE /api/apm/settings/agent-configuration\" | \"PUT /api/apm/settings/agent-configuration\" | \"POST /api/apm/settings/agent-configuration/search\" | \"GET /api/apm/settings/agent-configuration/environments\" | \"GET /api/apm/settings/agent-configuration/agent_name\" | \"GET /internal/apm/settings/anomaly-detection/jobs\" | \"POST /internal/apm/settings/anomaly-detection/jobs\" | \"GET /internal/apm/settings/anomaly-detection/environments\" | \"POST /internal/apm/settings/anomaly-detection/update_to_v3\" | \"GET /internal/apm/settings/apm-index-settings\" | \"GET /internal/apm/settings/apm-indices\" | \"POST /internal/apm/settings/apm-indices/save\" | \"GET /internal/apm/settings/custom_links/transaction\" | \"GET /internal/apm/settings/custom_links\" | \"POST /internal/apm/settings/custom_links\" | \"PUT /internal/apm/settings/custom_links/{id}\" | \"DELETE /internal/apm/settings/custom_links/{id}\" | \"GET /api/apm/sourcemaps\" | \"POST /api/apm/sourcemaps\" | \"DELETE /api/apm/sourcemaps/{id}\" | \"GET /internal/apm/fleet/has_apm_policies\" | \"GET /internal/apm/fleet/agents\" | \"POST /api/apm/fleet/apm_server_schema\" | \"GET /internal/apm/fleet/apm_server_schema/unsupported\" | \"GET /internal/apm/fleet/migration_check\" | \"POST /internal/apm/fleet/cloud_apm_package_policy\" | \"GET /internal/apm/fleet/java_agent_versions\" | \"GET /internal/apm/dependencies/top_dependencies\" | \"GET /internal/apm/dependencies/upstream_services\" | \"GET /internal/apm/dependencies/metadata\" | \"GET /internal/apm/dependencies/charts/latency\" | \"GET /internal/apm/dependencies/charts/throughput\" | \"GET /internal/apm/dependencies/charts/error_rate\" | \"GET /internal/apm/dependencies/operations\" | \"GET /internal/apm/dependencies/charts/distribution\" | \"GET /internal/apm/dependencies/operations/spans\" | \"GET /internal/apm/correlations/field_candidates/transactions\" | \"POST /internal/apm/correlations/field_stats/transactions\" | \"GET /internal/apm/correlations/field_value_stats/transactions\" | \"POST /internal/apm/correlations/field_value_pairs/transactions\" | \"POST /internal/apm/correlations/significant_correlations/transactions\" | \"POST /internal/apm/correlations/p_values/transactions\" | \"GET /internal/apm/fallback_to_transactions\" | \"GET /internal/apm/has_data\" | \"GET /internal/apm/event_metadata/{processorEvent}/{id}\" | \"GET /internal/apm/agent_keys\" | \"GET /internal/apm/agent_keys/privileges\" | \"POST /internal/apm/api_key/invalidate\" | \"POST /api/apm/agent_keys\" | \"GET /internal/apm/storage_explorer\" | \"GET /internal/apm/services/{serviceName}/storage_details\" | \"GET /internal/apm/storage_chart\" | \"GET /internal/apm/storage_explorer/privileges\" | \"GET /internal/apm/storage_explorer_summary_stats\" | \"GET /internal/apm/storage_explorer/is_cross_cluster_search\" | \"GET /internal/apm/storage_explorer/get_services\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/parents\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/children\" | \"GET /internal/apm/services/{serviceName}/infrastructure_attributes\" | \"GET /internal/apm/debug-telemetry\" | \"GET /internal/apm/time_range_metadata\" | \"GET /internal/apm/settings/labs\" | \"GET /internal/apm/services/{serviceName}/mobile/filters\"" ], "path": "x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts", "deprecated": false, @@ -785,7 +825,7 @@ "signature": [ "{ readonly indices: Readonly<{} & { metric: string; error: string; span: string; transaction: string; sourcemap: string; onboarding: string; }>; readonly autoCreateApmDataView: boolean; readonly serviceMapEnabled: boolean; readonly serviceMapFingerprintBucketSize: number; readonly serviceMapTraceIdBucketSize: number; readonly serviceMapFingerprintGlobalBucketSize: number; readonly serviceMapTraceIdGlobalBucketSize: number; readonly serviceMapMaxTracesPerRequest: number; readonly ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; readonly searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", - "; readonly telemetryCollectionEnabled: boolean; readonly metricsInterval: number; readonly agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }" + "; readonly telemetryCollectionEnabled: boolean; readonly metricsInterval: number; readonly agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; readonly forceSyntheticSource: boolean; }" ], "path": "x-pack/plugins/apm/server/index.ts", "deprecated": false, @@ -815,8 +855,74 @@ "label": "APMServerRouteRepository", "description": [], "signature": [ - "{ \"GET /internal/apm/settings/labs\": ", - "ServerRoute", + "{ \"GET /internal/apm/services/{serviceName}/mobile/filters\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /internal/apm/services/{serviceName}/mobile/filters\", ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ serviceName: ", + "StringC", + "; }>; query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>, ", + "PartialC", + "<{ transactionType: ", + "StringC", + "; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { mobileFilters: MobileFilters; }, ", + "APMRouteCreateOptions", + ">; \"GET /internal/apm/settings/labs\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/settings/labs\", undefined, ", { "pluginId": "apm", @@ -828,7 +934,13 @@ ", { labsItems: string[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/time_range_metadata\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/time_range_metadata\", ", "TypeC", "<{ query: ", @@ -860,7 +972,13 @@ ", ", "APMRouteCreateOptions", ">; \"GET /internal/apm/debug-telemetry\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/debug-telemetry\", undefined, ", { "pluginId": "apm", @@ -872,7 +990,13 @@ ", unknown, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/infrastructure_attributes\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/infrastructure_attributes\", ", "TypeC", "<{ path: ", @@ -904,7 +1028,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>]>; }>, ", { "pluginId": "apm", @@ -916,7 +1046,13 @@ ", { containerIds: string[]; hostNames: string[]; podNames: string[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/children\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/traces/{traceId}/span_links/{spanId}/children\", ", "TypeC", "<{ path: ", @@ -950,7 +1086,13 @@ "[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/parents\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/traces/{traceId}/span_links/{spanId}/parents\", ", "TypeC", "<{ path: ", @@ -1027,8 +1169,102 @@ "SpanLinkDetails", "[]; }, ", "APMRouteCreateOptions", + ">; \"GET /internal/apm/storage_explorer/get_services\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /internal/apm/storage_explorer/get_services\", ", + "TypeC", + "<{ query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ indexLifecyclePhase: ", + "UnionC", + "<[", + "LiteralC", + "<", + "IndexLifecyclePhaseSelectOption", + ".All>, ", + "LiteralC", + "<", + "IndexLifecyclePhaseSelectOption", + ".Hot>, ", + "LiteralC", + "<", + "IndexLifecyclePhaseSelectOption", + ".Warm>, ", + "LiteralC", + "<", + "IndexLifecyclePhaseSelectOption", + ".Cold>, ", + "LiteralC", + "<", + "IndexLifecyclePhaseSelectOption", + ".Frozen>]>; }>, ", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { services: { serviceName: string; }[]; }, ", + "APMRouteCreateOptions", + ">; \"GET /internal/apm/storage_explorer/is_cross_cluster_search\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /internal/apm/storage_explorer/is_cross_cluster_search\", undefined, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { isCrossClusterSearch: boolean; }, ", + "APMRouteCreateOptions", ">; \"GET /internal/apm/storage_explorer_summary_stats\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/storage_explorer_summary_stats\", ", "TypeC", "<{ query: ", @@ -1074,7 +1310,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1093,10 +1335,16 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { tracesPerMinute: number; numberOfServices: number; estimatedSize: number; dailyDataGeneration: number; }, ", + ", { tracesPerMinute: number; numberOfServices: number; totalSize: number; diskSpaceUsedPct: number; estimatedIncrementalSize: number; dailyDataGeneration: number; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/storage_explorer/privileges\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/storage_explorer/privileges\", undefined, ", { "pluginId": "apm", @@ -1108,7 +1356,13 @@ ", { hasPrivileges: boolean; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/storage_chart\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/storage_chart\", ", "TypeC", "<{ query: ", @@ -1154,7 +1408,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1176,7 +1436,13 @@ ", { storageTimeSeries: { serviceName: string; timeseries: { x: number; y: number; }[]; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/storage_details\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/storage_details\", ", "TypeC", "<{ path: ", @@ -1226,7 +1492,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1253,10 +1525,16 @@ "section": "def-common.ProcessorEvent", "text": "ProcessorEvent" }, - "; docs: number; size: number; }[]; }, ", + "; docs: number; size: number; }[]; indicesStats: { indexName: string; numberOfDocs: number; primary?: string | number | undefined; replica?: string | number | undefined; size?: number | undefined; dataStream?: string | undefined; lifecyclePhase?: string | undefined; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/storage_explorer\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/storage_explorer\", ", "TypeC", "<{ query: ", @@ -1302,7 +1580,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1326,7 +1610,13 @@ "; sampling: number; }[]; }, ", "APMRouteCreateOptions", ">; \"POST /api/apm/agent_keys\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /api/apm/agent_keys\", ", "TypeC", "<{ body: ", @@ -1358,7 +1648,13 @@ "; }, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/api_key/invalidate\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/api_key/invalidate\", ", "TypeC", "<{ body: ", @@ -1376,7 +1672,13 @@ ", { invalidatedAgentKeys: string[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/agent_keys/privileges\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/agent_keys/privileges\", undefined, ", { "pluginId": "apm", @@ -1388,7 +1690,13 @@ ", { areApiKeysEnabled: boolean; isAdmin: boolean; canManage: boolean; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/agent_keys\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/agent_keys\", undefined, ", { "pluginId": "apm", @@ -1408,7 +1716,13 @@ "[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/event_metadata/{processorEvent}/{id}\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/event_metadata/{processorEvent}/{id}\", ", "TypeC", "<{ path: ", @@ -1468,7 +1782,13 @@ ", { metadata: Partial>; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/has_data\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/has_data\", undefined, ", { "pluginId": "apm", @@ -1480,7 +1800,13 @@ ", { hasData: boolean; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/fallback_to_transactions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/fallback_to_transactions\", ", "PartialC", "<{ query: ", @@ -1506,7 +1832,13 @@ ", { fallbackToTransactions: boolean; }, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/correlations/p_values/transactions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/correlations/p_values/transactions\", ", "TypeC", "<{ body: ", @@ -1536,7 +1868,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1568,7 +1906,13 @@ " | undefined; }, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/correlations/significant_correlations/transactions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/correlations/significant_correlations/transactions\", ", "TypeC", "<{ body: ", @@ -1598,7 +1942,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1638,7 +1988,13 @@ " | undefined; }, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/correlations/field_value_pairs/transactions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/correlations/field_value_pairs/transactions\", ", "TypeC", "<{ body: ", @@ -1664,7 +2020,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1694,7 +2056,13 @@ "[]; errors: any[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/correlations/field_value_stats/transactions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/correlations/field_value_stats/transactions\", ", "TypeC", "<{ query: ", @@ -1720,7 +2088,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1754,7 +2128,13 @@ ", ", "APMRouteCreateOptions", ">; \"POST /internal/apm/correlations/field_stats/transactions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/correlations/field_stats/transactions\", ", "TypeC", "<{ body: ", @@ -1786,7 +2166,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1810,7 +2196,13 @@ "[]; errors: any[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/correlations/field_candidates/transactions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/correlations/field_candidates/transactions\", ", "TypeC", "<{ query: ", @@ -1836,7 +2228,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1858,7 +2256,13 @@ ", { fieldCandidates: string[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/dependencies/operations/spans\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/dependencies/operations/spans\", ", "TypeC", "<{ query: ", @@ -1882,7 +2286,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -1912,7 +2322,13 @@ "[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/dependencies/charts/distribution\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/dependencies/charts/distribution\", ", "TypeC", "<{ query: ", @@ -1948,10 +2364,16 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", - ">]>; }>]>; }>, ", { - "pluginId": "apm", + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>]>; }>, ", + { + "pluginId": "apm", "scope": "server", "docId": "kibApmPluginApi", "section": "def-server.APMRouteHandlerResources", @@ -1964,7 +2386,13 @@ "; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/dependencies/operations\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/dependencies/operations\", ", "TypeC", "<{ query: ", @@ -1988,7 +2416,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -2016,7 +2450,13 @@ "[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/dependencies/charts/error_rate\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/dependencies/charts/error_rate\", ", "TypeC", "<{ query: ", @@ -2052,7 +2492,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "PartialC", "<{ offset: ", @@ -2068,7 +2514,13 @@ ", { currentTimeseries: { x: number; y: number; }[]; comparisonTimeseries: { x: number; y: number; }[] | null; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/dependencies/charts/throughput\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/dependencies/charts/throughput\", ", "TypeC", "<{ query: ", @@ -2104,7 +2556,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "PartialC", "<{ offset: ", @@ -2120,7 +2578,13 @@ ", { currentTimeseries: { x: number; y: number | null; }[]; comparisonTimeseries: { x: number; y: number | null; }[] | null; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/dependencies/charts/latency\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/dependencies/charts/latency\", ", "TypeC", "<{ query: ", @@ -2156,7 +2620,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "PartialC", "<{ offset: ", @@ -2172,7 +2642,13 @@ ", { currentTimeseries: { x: number; y: number; }[]; comparisonTimeseries: { x: number; y: number; }[] | null; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/dependencies/metadata\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/dependencies/metadata\", ", "TypeC", "<{ query: ", @@ -2198,7 +2674,13 @@ ", { metadata: { spanType: string | undefined; spanSubtype: string | undefined; }; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/dependencies/upstream_services\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/dependencies/upstream_services\", ", "IntersectionC", "<[", @@ -2236,7 +2718,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "PartialC", "<{ offset: ", @@ -2274,7 +2762,13 @@ "; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/dependencies/top_dependencies\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/dependencies/top_dependencies\", ", "IntersectionC", "<[", @@ -2300,7 +2794,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -2344,7 +2844,13 @@ "; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/fleet/java_agent_versions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/fleet/java_agent_versions\", undefined, ", { "pluginId": "apm", @@ -2356,7 +2862,13 @@ ", { versions: string[] | undefined; }, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/fleet/cloud_apm_package_policy\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/fleet/cloud_apm_package_policy\", undefined, ", { "pluginId": "apm", @@ -2376,7 +2888,13 @@ "; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/fleet/migration_check\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/fleet/migration_check\", undefined, ", { "pluginId": "apm", @@ -2396,7 +2914,13 @@ " | undefined; has_apm_integrations: boolean; latest_apm_package_version: string; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/fleet/apm_server_schema/unsupported\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/fleet/apm_server_schema/unsupported\", undefined, ", { "pluginId": "apm", @@ -2408,7 +2932,13 @@ ", { unsupported: { key: string; value: any; }[]; }, ", "APMRouteCreateOptions", ">; \"POST /api/apm/fleet/apm_server_schema\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /api/apm/fleet/apm_server_schema\", ", "TypeC", "<{ body: ", @@ -2430,7 +2960,13 @@ ", void, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/fleet/agents\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/fleet/agents\", undefined, ", { "pluginId": "apm", @@ -2442,7 +2978,13 @@ ", { cloudStandaloneSetup: { apmServerUrl: string | undefined; secretToken: string | undefined; } | undefined; fleetAgents: never[]; isFleetEnabled: false; } | { cloudStandaloneSetup: { apmServerUrl: string | undefined; secretToken: string | undefined; } | undefined; isFleetEnabled: true; fleetAgents: { id: string; name: string; apmServerUrl: any; secretToken: any; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/fleet/has_apm_policies\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/fleet/has_apm_policies\", undefined, ", { "pluginId": "apm", @@ -2454,7 +2996,13 @@ ", { hasApmPolicies: boolean; }, ", "APMRouteCreateOptions", ">; \"DELETE /api/apm/sourcemaps/{id}\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"DELETE /api/apm/sourcemaps/{id}\", ", "TypeC", "<{ path: ", @@ -2472,7 +3020,13 @@ ", void, ", "APMRouteCreateOptions", ">; \"POST /api/apm/sourcemaps\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /api/apm/sourcemaps\", ", "TypeC", "<{ body: ", @@ -2504,7 +3058,13 @@ " | undefined, ", "APMRouteCreateOptions", ">; \"GET /api/apm/sourcemaps\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /api/apm/sourcemaps\", undefined, ", { "pluginId": "apm", @@ -2518,7 +3078,13 @@ "[]; } | undefined, ", "APMRouteCreateOptions", ">; \"DELETE /internal/apm/settings/custom_links/{id}\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"DELETE /internal/apm/settings/custom_links/{id}\", ", "TypeC", "<{ path: ", @@ -2536,7 +3102,13 @@ ", { result: string; }, ", "APMRouteCreateOptions", ">; \"PUT /internal/apm/settings/custom_links/{id}\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"PUT /internal/apm/settings/custom_links/{id}\", ", "TypeC", "<{ path: ", @@ -2586,7 +3158,13 @@ ", void, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/settings/custom_links\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/settings/custom_links\", ", "TypeC", "<{ body: ", @@ -2632,7 +3210,13 @@ ", void, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/settings/custom_links\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/settings/custom_links\", ", "PartialC", "<{ query: ", @@ -2658,7 +3242,13 @@ "[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/settings/custom_links/transaction\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/settings/custom_links/transaction\", ", "PartialC", "<{ query: ", @@ -2684,7 +3274,13 @@ ", ", "APMRouteCreateOptions", ">; \"POST /internal/apm/settings/apm-indices/save\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/settings/apm-indices/save\", ", "TypeC", "<{ body: ", @@ -2698,11 +3294,23 @@ "text": "APMRouteHandlerResources" }, ", ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<{}>, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/settings/apm-indices\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/settings/apm-indices\", undefined, ", { "pluginId": "apm", @@ -2716,7 +3324,13 @@ ", ", "APMRouteCreateOptions", ">; \"GET /internal/apm/settings/apm-index-settings\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/settings/apm-index-settings\", undefined, ", { "pluginId": "apm", @@ -2728,7 +3342,13 @@ ", { apmIndexSettings: { configurationName: \"metric\" | \"error\" | \"span\" | \"transaction\" | \"sourcemap\" | \"onboarding\"; defaultValue: string; savedValue: string | undefined; }[]; }, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/settings/anomaly-detection/update_to_v3\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/settings/anomaly-detection/update_to_v3\", undefined, ", { "pluginId": "apm", @@ -2740,7 +3360,13 @@ ", { update: boolean; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/settings/anomaly-detection/environments\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/settings/anomaly-detection/environments\", undefined, ", { "pluginId": "apm", @@ -2752,7 +3378,13 @@ ", { environments: string[]; }, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/settings/anomaly-detection/jobs\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/settings/anomaly-detection/jobs\", ", "TypeC", "<{ body: ", @@ -2770,7 +3402,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>>; }>; }>, ", { "pluginId": "apm", @@ -2782,7 +3420,13 @@ ", { jobCreated: true; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/settings/anomaly-detection/jobs\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/settings/anomaly-detection/jobs\", undefined, ", { "pluginId": "apm", @@ -2796,7 +3440,13 @@ "[]; hasLegacyJobs: boolean; }, ", "APMRouteCreateOptions", ">; \"GET /api/apm/settings/agent-configuration/agent_name\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /api/apm/settings/agent-configuration/agent_name\", ", "TypeC", "<{ query: ", @@ -2814,7 +3464,13 @@ ", { agentName: string | undefined; }, ", "APMRouteCreateOptions", ">; \"GET /api/apm/settings/agent-configuration/environments\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /api/apm/settings/agent-configuration/environments\", ", "PartialC", "<{ query: ", @@ -2832,7 +3488,13 @@ ", { environments: { name: string; alreadyConfigured: boolean; }[]; }, ", "APMRouteCreateOptions", ">; \"POST /api/apm/settings/agent-configuration/search\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /api/apm/settings/agent-configuration/search\", ", "TypeC", "<{ body: ", @@ -2860,13 +3522,25 @@ "text": "APMRouteHandlerResources" }, ", ", - "SearchHit", + { + "pluginId": "@kbn/es-types", + "scope": "server", + "docId": "kibKbnEsTypesPluginApi", + "section": "def-server.SearchHit", + "text": "SearchHit" + }, "<", "AgentConfiguration", ", undefined, undefined> | null, ", "APMRouteCreateOptions", ">; \"PUT /api/apm/settings/agent-configuration\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"PUT /api/apm/settings/agent-configuration\", ", "IntersectionC", "<[", @@ -2914,7 +3588,13 @@ ", void, ", "APMRouteCreateOptions", ">; \"DELETE /api/apm/settings/agent-configuration\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"DELETE /api/apm/settings/agent-configuration\", ", "TypeC", "<{ body: ", @@ -2936,7 +3616,13 @@ ", { result: string; }, ", "APMRouteCreateOptions", ">; \"GET /api/apm/settings/agent-configuration/view\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /api/apm/settings/agent-configuration/view\", ", "PartialC", "<{ query: ", @@ -2958,7 +3644,13 @@ ", ", "APMRouteCreateOptions", ">; \"GET /api/apm/settings/agent-configuration\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /api/apm/settings/agent-configuration\", undefined, ", { "pluginId": "apm", @@ -2972,7 +3664,13 @@ "[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/rule_types/transaction_duration/chart_preview\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/rule_types/transaction_duration/chart_preview\", ", "TypeC", "<{ query: ", @@ -3010,7 +3708,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ start: ", @@ -3032,7 +3736,13 @@ ", { latencyChartPreview: { name: string; data: { x: number; y: number | null; }[]; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/rule_types/error_count/chart_preview\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/rule_types/error_count/chart_preview\", ", "TypeC", "<{ query: ", @@ -3070,7 +3780,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ start: ", @@ -3092,7 +3808,13 @@ ", { errorCountChartPreview: { x: number; y: number; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/rule_types/transaction_error_rate/chart_preview\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/rule_types/transaction_error_rate/chart_preview\", ", "TypeC", "<{ query: ", @@ -3130,7 +3852,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ start: ", @@ -3152,7 +3880,13 @@ ", { errorRateChartPreview: { x: number; y: number; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name\", ", "TypeC", "<{ path: ", @@ -3182,7 +3916,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -3214,7 +3954,13 @@ "; }[]; average: null; }; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate\", ", "TypeC", "<{ path: ", @@ -3242,7 +3988,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -3274,7 +4026,13 @@ "; }[]; average: null; }; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\", ", "TypeC", "<{ path: ", @@ -3306,7 +4064,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -3338,7 +4102,13 @@ "; }[]; average: null; }; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\", ", "TypeC", "<{ path: ", @@ -3368,7 +4138,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -3390,7 +4166,13 @@ ", { timeseries: { title: string; color: string; type: string; data: { x: number; y: number | null; }[]; hideLegend: boolean; legendValue: string; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/transactions/traces/samples\", ", "TypeC", "<{ path: ", @@ -3428,7 +4210,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -3450,7 +4238,13 @@ ", { traceSamples: { transactionId: string; traceId: string; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/transactions/charts/latency\", ", "TypeC", "<{ path: ", @@ -3496,7 +4290,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -3526,7 +4326,13 @@ "; }[]; overallAvgDuration: null; }; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\", ", "TypeC", "<{ path: ", @@ -3548,7 +4354,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -3612,7 +4424,13 @@ "; }[]; transactionName: string; impact: number; }>; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\", ", "TypeC", "<{ path: ", @@ -3634,7 +4452,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -3673,8 +4497,82 @@ }, ", { transactionGroups: { transactionType: string; name: string; latency: number | null; throughput: number; errorRate: number; impact: number; }[]; isAggregationAccurate: boolean; bucketSize: number; }, ", "APMRouteCreateOptions", + ">; \"POST /internal/apm/traces/aggregated_critical_path\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /internal/apm/traces/aggregated_critical_path\", ", + "TypeC", + "<{ body: ", + "IntersectionC", + "<[", + "TypeC", + "<{ traceIds: ", + "ArrayC", + "<", + "StringC", + ">; serviceName: ", + "UnionC", + "<[", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">, ", + "NullC", + "]>; transactionName: ", + "UnionC", + "<[", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">, ", + "NullC", + "]>; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { criticalPath: ", + "CriticalPathResponse", + " | null; }, ", + "APMRouteCreateOptions", ">; \"GET /internal/apm/traces/find\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/traces/find\", ", "TypeC", "<{ query: ", @@ -3698,9 +4596,15 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", - ">]>; }>, ", - "TypeC", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>, ", + "TypeC", "<{ query: ", "StringC", "; type: ", @@ -3724,7 +4628,13 @@ ", { traceSamples: { traceId: string; transactionId: string; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/transactions/{transactionId}\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/transactions/{transactionId}\", ", "TypeC", "<{ path: ", @@ -3744,7 +4654,13 @@ "; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/traces/{traceId}/root_transaction\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/traces/{traceId}/root_transaction\", ", "TypeC", "<{ path: ", @@ -3764,7 +4680,13 @@ "; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/traces\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/traces\", ", "TypeC", "<{ query: ", @@ -3782,7 +4704,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -3812,7 +4740,13 @@ "; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/traces/{traceId}\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/traces/{traceId}\", ", "TypeC", "<{ path: ", @@ -3842,7 +4776,13 @@ "[]; linkedChildrenOfSpanCountBySpanId: Record; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/suggestions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/suggestions\", ", "TypeC", "<{ query: ", @@ -3874,7 +4814,13 @@ ", { terms: string[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/service_groups/services_count\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/service_groups/services_count\", ", "TypeC", "<{ query: ", @@ -3894,7 +4840,13 @@ ", { servicesCounts: Record; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/service-group/services\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/service-group/services\", ", "TypeC", "<{ query: ", @@ -3922,7 +4874,13 @@ "; }[]; }, ", "APMRouteCreateOptions", ">; \"DELETE /internal/apm/service-group\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"DELETE /internal/apm/service-group\", ", "TypeC", "<{ query: ", @@ -3940,7 +4898,13 @@ ", void, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/service-group\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/service-group\", ", "TypeC", "<{ query: ", @@ -3980,7 +4944,13 @@ ", void, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/service-group\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/service-group\", ", "TypeC", "<{ query: ", @@ -4000,7 +4970,13 @@ "; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/service-groups\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/service-groups\", undefined, ", { "pluginId": "apm", @@ -4014,7 +4990,13 @@ "[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/sorted_and_filtered_services\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/sorted_and_filtered_services\", ", "TypeC", "<{ query: ", @@ -4038,7 +5020,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -4060,7 +5048,13 @@ " | undefined; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/anomaly_charts\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/anomaly_charts\", ", "TypeC", "<{ path: ", @@ -4088,7 +5082,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ transactionType: ", @@ -4106,7 +5106,13 @@ "[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/dependencies/breakdown\", ", "TypeC", "<{ path: ", @@ -4128,7 +5134,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ start: ", @@ -4150,7 +5162,13 @@ ", { breakdown: { title: string; data: { x: number; y: number; }[]; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/dependencies\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/dependencies\", ", "TypeC", "<{ path: ", @@ -4176,7 +5194,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ start: ", @@ -4216,7 +5240,13 @@ "; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\", ", "TypeC", "<{ path: ", @@ -4260,7 +5290,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -4310,7 +5346,13 @@ "; }[]; serviceNodeName: string; }>; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\", ", "TypeC", "<{ path: ", @@ -4354,7 +5396,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -4376,7 +5424,13 @@ ", { currentPeriod: { serviceNodeName: string; errorRate?: number | undefined; latency?: number | undefined; throughput?: number | undefined; cpuUsage?: number | null | undefined; memoryUsage?: number | null | undefined; }[]; previousPeriod: { serviceNodeName: string; errorRate?: number | undefined; latency?: number | undefined; throughput?: number | undefined; cpuUsage?: number | null | undefined; memoryUsage?: number | null | undefined; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/throughput\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/throughput\", ", "TypeC", "<{ path: ", @@ -4408,7 +5462,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -4436,7 +5496,13 @@ "; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\", ", "TypeC", "<{ path: ", @@ -4484,7 +5550,13 @@ " | undefined; }, ", "APMRouteCreateOptions", ">; \"POST /api/apm/services/{serviceName}/annotation\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /api/apm/services/{serviceName}/annotation\", ", "TypeC", "<{ path: ", @@ -4528,7 +5600,13 @@ "; }, ", "APMRouteCreateOptions", ">; \"GET /api/apm/services/{serviceName}/annotation/search\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /api/apm/services/{serviceName}/annotation/search\", ", "TypeC", "<{ path: ", @@ -4550,7 +5628,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ start: ", @@ -4570,7 +5654,13 @@ "[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\", ", "TypeC", "<{ path: ", @@ -4591,7 +5681,27 @@ "Type", "; end: ", "Type", - "; }>]>; }>, ", + "; }>, ", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>]>; }>, ", { "pluginId": "apm", "scope": "server", @@ -4602,7 +5712,13 @@ ", { host: string | number; containerId: string | number; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/transaction_types\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/transaction_types\", ", "TypeC", "<{ path: ", @@ -4626,7 +5742,13 @@ ", { transactionTypes: string[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/agent\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/agent\", ", "TypeC", "<{ path: ", @@ -4650,7 +5772,13 @@ ", { agentName?: undefined; runtimeName?: undefined; } | { agentName: string | undefined; runtimeName: string | undefined; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/metadata/icons\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/metadata/icons\", ", "TypeC", "<{ path: ", @@ -4676,7 +5804,13 @@ ", ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/metadata/details\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/metadata/details\", ", "TypeC", "<{ path: ", @@ -4702,7 +5836,13 @@ ", ", "APMRouteCreateOptions", ">; \"POST /internal/apm/services/detailed_statistics\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/services/detailed_statistics\", ", "TypeC", "<{ query: ", @@ -4720,7 +5860,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -4758,7 +5904,13 @@ "<{ serviceName: string; latency: { x: number; y: number | null; }[]; transactionErrorRate: { x: number; y: number; }[]; throughput: { x: number; y: number; }[]; }>; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services\", ", "TypeC", "<{ query: ", @@ -4776,7 +5928,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -4820,7 +5978,13 @@ "; }>; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/service-map/dependency\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/service-map/dependency\", ", "TypeC", "<{ query: ", @@ -4842,7 +6006,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ start: ", @@ -4868,7 +6038,13 @@ " | undefined; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/service-map/service/{serviceName}\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/service-map/service/{serviceName}\", ", "TypeC", "<{ path: ", @@ -4890,7 +6066,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ start: ", @@ -4916,7 +6098,13 @@ " | undefined; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/service-map\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/service-map\", ", "TypeC", "<{ query: ", @@ -4940,7 +6128,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ start: ", @@ -4962,7 +6156,13 @@ " | undefined; label: string | undefined; id?: string | undefined; parent?: string | undefined; position?: cytoscape.Position | undefined; } | { 'span.destination.service.resource': string; 'span.type': string; 'span.subtype': string; label: string | undefined; id?: string | undefined; parent?: string | undefined; position?: cytoscape.Position | undefined; } | { id: string; source: string | undefined; target: string | undefined; label: string | undefined; bidirectional?: boolean | undefined; isInverseEdge?: boolean | undefined; } | undefined)[]; }; } | { data: { id: string; source: string; target: string; }; })[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/observability_overview/has_data\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/observability_overview/has_data\", undefined, ", { "pluginId": "apm", @@ -4976,7 +6176,13 @@ "; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/observability_overview\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/observability_overview\", ", "TypeC", "<{ query: ", @@ -5003,8 +6209,266 @@ }, ", { serviceCount: number; transactionPerMinute: { value: undefined; timeseries: never[]; } | { value: number; timeseries: { x: number; y: number | null; }[]; }; }, ", "APMRouteCreateOptions", + ">; \"GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances\", ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ serviceName: ", + "StringC", + "; }>; query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "PartialC", + "<{ serverlessId: ", + "StringC", + "; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { activeInstances: ", + "ActiveInstanceOverview", + "[]; timeseries: ", + "Coordinate", + "[]; }, ", + "APMRouteCreateOptions", + ">; \"GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview\", ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ serviceName: ", + "StringC", + "; }>; query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { serverlessFunctionsOverview: { serverlessId: string; serverlessFunctionName: string; serverlessDurationAvg: number | null; billedDurationAvg: number | null; coldStartCount: number | null; avgMemoryUsed: number | undefined; memorySize: number | null; }[]; }, ", + "APMRouteCreateOptions", + ">; \"GET /internal/apm/services/{serviceName}/metrics/serverless/summary\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /internal/apm/services/{serviceName}/metrics/serverless/summary\", ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ serviceName: ", + "StringC", + "; }>; query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "PartialC", + "<{ serverlessId: ", + "StringC", + "; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { memoryUsageAvgRate: number | undefined; serverlessFunctionsTotal: number | undefined; serverlessDurationAvg: number | null | undefined; billedDurationAvg: number | null | undefined; estimatedCost: number | undefined; }, ", + "APMRouteCreateOptions", + ">; \"GET /internal/apm/services/{serviceName}/metrics/serverless/charts\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /internal/apm/services/{serviceName}/metrics/serverless/charts\", ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ serviceName: ", + "StringC", + "; }>; query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "PartialC", + "<{ serverlessId: ", + "StringC", + "; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { charts: [", + "FetchAndTransformMetrics", + ", ", + "FetchAndTransformMetrics", + ", { series: { overallValue: number; data: { x: number; y: number | null | undefined; }[]; title: string; key: string; type: ", + "ChartType", + "; color: string; }[]; title: string; key: string; yUnit: ", + "YUnit", + "; description?: string | undefined; }, ", + "FetchAndTransformMetrics", + ", ", + "FetchAndTransformMetrics", + "]; }, ", + "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/metrics/nodes\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/metrics/nodes\", ", "TypeC", "<{ path: ", @@ -5036,7 +6500,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>]>; }>, ", { "pluginId": "apm", @@ -5048,7 +6518,13 @@ ", { serviceNodes: { name: string; cpu: number | null; heapMemory: number | null; hostName: string | null | undefined; nonHeapMemory: number | null; threadCount: number | null; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/metrics/charts\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/metrics/charts\", ", "TypeC", "<{ path: ", @@ -5065,8 +6541,6 @@ "PartialC", "<{ serviceNodeName: ", "StringC", - "; serviceRuntimeName: ", - "StringC", "; }>, ", "TypeC", "<{ environment: ", @@ -5080,7 +6554,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -5104,7 +6584,13 @@ "[]; }, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/latency/overall_distribution/transactions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/latency/overall_distribution/transactions\", ", "TypeC", "<{ body: ", @@ -5146,7 +6632,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -5192,7 +6684,13 @@ ", ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/errors/{groupId}/top_erroneous_transactions\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/errors/{groupId}/top_erroneous_transactions\", ", "TypeC", "<{ path: ", @@ -5216,7 +6714,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -5246,7 +6750,13 @@ ", { topErroneousTransactions: { transactionName: string; currentPeriodTimeseries: { x: number; y: number; }[]; previousPeriodTimeseries: { x: number; y: number; }[]; transactionType: string | undefined; occurrences: number; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/errors/distribution\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/errors/distribution\", ", "TypeC", "<{ path: ", @@ -5272,7 +6782,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -5300,7 +6816,13 @@ "; }[]; bucketSize: number; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/errors/{groupId}\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/errors/{groupId}\", ", "TypeC", "<{ path: ", @@ -5324,7 +6846,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -5350,7 +6878,13 @@ "; occurrencesCount: number; }, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/services/{serviceName}/errors/groups/detailed_statistics\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/services/{serviceName}/errors/groups/detailed_statistics\", ", "TypeC", "<{ path: ", @@ -5372,7 +6906,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -5414,7 +6954,13 @@ "; }[]; groupId: string; }>; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics_by_transaction_name\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics_by_transaction_name\", ", "TypeC", "<{ path: ", @@ -5444,7 +6990,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -5466,7 +7018,13 @@ ", { errorGroups: { groupId: string; name: string; lastSeen: number; occurrences: number; culprit: string | undefined; handled: boolean | undefined; type: string | undefined; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics\", ", "TypeC", "<{ path: ", @@ -5498,7 +7056,13 @@ "<", "StringC", ", ", - "NonEmptyStringBrand", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, ">]>; }>, ", "TypeC", "<{ kuery: ", @@ -5520,7 +7084,13 @@ ", { errorGroups: { groupId: string; name: string; lastSeen: number; occurrences: number; culprit: string | undefined; handled: boolean | undefined; type: string | undefined; }[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/environments\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/environments\", ", "TypeC", "<{ query: ", @@ -5546,11 +7116,23 @@ ", { environments: (\"ENVIRONMENT_NOT_DEFINED\" | \"ENVIRONMENT_ALL\" | ", "Branded", ")[]; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/data_view/title\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /internal/apm/data_view/title\", undefined, ", { "pluginId": "apm", @@ -5562,7 +7144,13 @@ ", { apmDataViewTitle: string; }, ", "APMRouteCreateOptions", ">; \"POST /internal/apm/data_view/static\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /internal/apm/data_view/static\", undefined, ", { "pluginId": "apm", @@ -5612,7 +7200,7 @@ "Observable", "; autoCreateApmDataView: boolean; serviceMapEnabled: boolean; serviceMapFingerprintBucketSize: number; serviceMapTraceIdBucketSize: number; serviceMapFingerprintGlobalBucketSize: number; serviceMapTraceIdGlobalBucketSize: number; serviceMapMaxTracesPerRequest: number; ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", - "; telemetryCollectionEnabled: boolean; metricsInterval: number; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }>>" + "; telemetryCollectionEnabled: boolean; metricsInterval: number; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; forceSyntheticSource: boolean; }>>" ], "path": "x-pack/plugins/apm/server/types.ts", "deprecated": false, @@ -5626,9 +7214,7 @@ "label": "getApmIndices", "description": [], "signature": [ - "() => Promise<", - "ApmIndicesConfig", - ">" + "() => Promise>" ], "path": "x-pack/plugins/apm/server/types.ts", "deprecated": false, @@ -5645,7 +7231,13 @@ "description": [], "signature": [ "(params: { debug?: boolean | undefined; request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "; context: ", "ApmPluginRequestHandlerContext", "; }) => Promise<", @@ -5689,7 +7281,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/apm/server/types.ts", @@ -5704,7 +7302,13 @@ "label": "context", "description": [], "signature": [ - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, " & { licensing: Promise<", { "pluginId": "licensing", @@ -5747,7 +7351,57 @@ }, "common": { "classes": [], - "functions": [], + "functions": [ + { + "parentPluginId": "apm", + "id": "def-common.getAggregatedCriticalPathRootNodes", + "type": "Function", + "tags": [], + "label": "getAggregatedCriticalPathRootNodes", + "description": [], + "signature": [ + "(params: { criticalPath: ", + "CriticalPathResponse", + "; }) => { rootNodes: ", + "CriticalPathTreeNode", + "[]; maxDepth: number; numNodes: number; }" + ], + "path": "x-pack/plugins/apm/common/critical_path/get_aggregated_critical_path_root_nodes.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "apm", + "id": "def-common.getAggregatedCriticalPathRootNodes.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "path": "x-pack/plugins/apm/common/critical_path/get_aggregated_critical_path_root_nodes.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "apm", + "id": "def-common.getAggregatedCriticalPathRootNodes.$1.criticalPath", + "type": "Object", + "tags": [], + "label": "criticalPath", + "description": [], + "signature": [ + "CriticalPathResponse" + ], + "path": "x-pack/plugins/apm/common/critical_path/get_aggregated_critical_path_root_nodes.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], "interfaces": [], "enums": [], "misc": [], diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index e7f9aa960cfc5..057efa837e916 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; @@ -21,7 +21,7 @@ Contact [APM UI](https://github.com/orgs/elastic/teams/apm-ui) for questions reg | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 38 | 0 | 38 | 53 | +| 41 | 0 | 41 | 58 | ## Client @@ -48,3 +48,8 @@ Contact [APM UI](https://github.com/orgs/elastic/teams/apm-ui) for questions reg ### Consts, variables and types +## Common + +### Functions + + diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index f74799a487c2e..27ccd7d017ef6 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] --- import bannersObj from './banners.devdocs.json'; diff --git a/api_docs/bfetch.devdocs.json b/api_docs/bfetch.devdocs.json index 32dbe24517f93..466493ad34651 100644 --- a/api_docs/bfetch.devdocs.json +++ b/api_docs/bfetch.devdocs.json @@ -288,7 +288,13 @@ "description": [], "signature": [ "(path: string, handler: (request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", { "pluginId": "bfetch", @@ -327,7 +333,13 @@ "description": [], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", { "pluginId": "bfetch", @@ -355,9 +367,21 @@ "description": [], "signature": [ "(path: string, params: (request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", context: ", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ") => ", { "pluginId": "bfetch", @@ -367,11 +391,29 @@ "text": "StreamingResponseHandler" }, ", method?: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | undefined, pluginRouter?: ", - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, "<", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, "> | undefined, options?: ", - "RouteConfigOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfigOptions", + "text": "RouteConfigOptions" + }, "<\"get\" | \"post\" | \"put\" | \"delete\"> | undefined) => void" ], "path": "src/plugins/bfetch/server/plugin.ts", @@ -402,9 +444,21 @@ "description": [], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", context: ", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ") => ", { "pluginId": "bfetch", @@ -443,9 +497,21 @@ "label": "pluginRouter", "description": [], "signature": [ - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, "<", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, "> | undefined" ], "path": "src/plugins/bfetch/server/plugin.ts", @@ -461,7 +527,13 @@ "label": "options", "description": [], "signature": [ - "RouteConfigOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfigOptions", + "text": "RouteConfigOptions" + }, "<\"get\" | \"post\" | \"put\" | \"delete\"> | undefined" ], "path": "src/plugins/bfetch/server/plugin.ts", diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index f120df41c1920..ba0d33ec90a0b 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] --- import bfetchObj from './bfetch.devdocs.json'; diff --git a/api_docs/canvas.devdocs.json b/api_docs/canvas.devdocs.json index 371b2b631b494..e4d58a148abcb 100644 --- a/api_docs/canvas.devdocs.json +++ b/api_docs/canvas.devdocs.json @@ -24,7 +24,13 @@ "description": [], "signature": [ "{ services: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, " & ", "CanvasStartDeps", " & { canvas: ", diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index faafb543217a9..4caa840b79fde 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] --- import canvasObj from './canvas.devdocs.json'; diff --git a/api_docs/cases.devdocs.json b/api_docs/cases.devdocs.json index 4119ccb5ec28f..e285b8ef93fce 100644 --- a/api_docs/cases.devdocs.json +++ b/api_docs/cases.devdocs.json @@ -18,7 +18,13 @@ "text": "CasesUiPlugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "" ], "path": "x-pack/plugins/cases/public/plugin.ts", @@ -79,7 +91,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ", plugins: ", "CasesPluginSetup", ") => ", @@ -103,7 +121,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "x-pack/plugins/cases/public/plugin.ts", @@ -138,7 +162,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", plugins: ", "CasesPluginStart", ") => ", @@ -162,7 +192,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "x-pack/plugins/cases/public/plugin.ts", "deprecated": false, @@ -285,9 +321,21 @@ "description": [], "signature": [ "({ basePath, extend, }: { basePath?: string | undefined; extend?: Partial>> | undefined; }) => { id: \"cases\"; path: string; deepLinks: ({ id: \"cases_create\"; path: string; title: string | T[\"title\"]; keywords?: T[\"keywords\"] | undefined; navLinkStatus?: T[\"navLinkStatus\"] | undefined; searchable?: T[\"searchable\"] | undefined; order?: T[\"order\"] | undefined; tooltip?: T[\"tooltip\"] | undefined; euiIconType?: T[\"euiIconType\"] | undefined; icon?: T[\"icon\"] | undefined; deepLinks?: T[\"deepLinks\"] | undefined; } | { id: \"cases_configure\"; path: string; title: string | T[\"title\"]; keywords?: T[\"keywords\"] | undefined; navLinkStatus?: T[\"navLinkStatus\"] | undefined; searchable?: T[\"searchable\"] | undefined; order?: T[\"order\"] | undefined; tooltip?: T[\"tooltip\"] | undefined; euiIconType?: T[\"euiIconType\"] | undefined; icon?: T[\"icon\"] | undefined; deepLinks?: T[\"deepLinks\"] | undefined; })[]; title: string | T[\"title\"]; keywords?: T[\"keywords\"] | undefined; navLinkStatus?: T[\"navLinkStatus\"] | undefined; searchable?: T[\"searchable\"] | undefined; order?: T[\"order\"] | undefined; tooltip?: T[\"tooltip\"] | undefined; euiIconType?: T[\"euiIconType\"] | undefined; icon?: T[\"icon\"] | undefined; }" + ", Partial>> | undefined; }) => { id: \"cases\"; path: string; deepLinks: ({ id: \"cases_create\"; path: string; title: any; keywords?: T[\"keywords\"] | undefined; navLinkStatus?: T[\"navLinkStatus\"] | undefined; searchable?: T[\"searchable\"] | undefined; order?: T[\"order\"] | undefined; tooltip?: T[\"tooltip\"] | undefined; euiIconType?: T[\"euiIconType\"] | undefined; icon?: T[\"icon\"] | undefined; deepLinks?: T[\"deepLinks\"] | undefined; } | { id: \"cases_configure\"; path: string; title: any; keywords?: T[\"keywords\"] | undefined; navLinkStatus?: T[\"navLinkStatus\"] | undefined; searchable?: T[\"searchable\"] | undefined; order?: T[\"order\"] | undefined; tooltip?: T[\"tooltip\"] | undefined; euiIconType?: T[\"euiIconType\"] | undefined; icon?: T[\"icon\"] | undefined; deepLinks?: T[\"deepLinks\"] | undefined; })[]; title: any; keywords?: T[\"keywords\"] | undefined; navLinkStatus?: T[\"navLinkStatus\"] | undefined; searchable?: T[\"searchable\"] | undefined; order?: T[\"order\"] | undefined; tooltip?: T[\"tooltip\"] | undefined; euiIconType?: T[\"euiIconType\"] | undefined; icon?: T[\"icon\"] | undefined; }" ], "path": "x-pack/plugins/cases/public/common/navigation/deep_links.ts", "deprecated": false, @@ -517,7 +565,7 @@ "signature": [ "{ features?: Partial<", "CasesContextFeatures", - "> | undefined; basePath?: string | undefined; onClose?: (() => void) | undefined; owner: string[]; permissions: ", + "> | undefined; onClose?: (() => void) | undefined; basePath?: string | undefined; owner: string[]; permissions: ", { "pluginId": "cases", "scope": "common", @@ -597,7 +645,7 @@ "signature": [ "{ features?: Partial<", "CasesContextFeatures", - "> | undefined; basePath?: string | undefined; onClose?: (() => void) | undefined; owner: string[]; permissions: ", + "> | undefined; onClose?: (() => void) | undefined; basePath?: string | undefined; owner: string[]; permissions: ", { "pluginId": "cases", "scope": "common", @@ -633,7 +681,7 @@ "section": "def-public.CaseAttachmentsWithoutOwner", "text": "CaseAttachmentsWithoutOwner" }, - " | undefined; }" + " | undefined; headerContent?: React.ReactNode; }" ], "path": "x-pack/plugins/cases/public/client/ui/get_create_case_flyout.tsx", "deprecated": false, @@ -715,7 +763,13 @@ "text": "ExternalReferenceStorageType" }, ".elasticSearchDoc; }; externalReferenceAttachmentTypeId: string; externalReferenceMetadata: { [x: string]: ", - "JsonValue", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonValue", + "text": "JsonValue" + }, "; } | null; type: ", { "pluginId": "cases", @@ -733,7 +787,13 @@ "text": "CommentType" }, ".persistableState; owner: string; persistableStateAttachmentTypeId: string; persistableStateAttachmentState: { [x: string]: ", - "JsonValue", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonValue", + "text": "JsonValue" + }, "; }; }" ], "path": "x-pack/plugins/cases/public/types.ts", @@ -778,8 +838,22 @@ "label": "api", "description": [], "signature": [ - "{ getRelatedCases: (alertId: string, query: { owner?: string | string[] | undefined; }) => Promise<{ id: string; title: string; }[]>; cases: { find: (query: { tags?: string | string[] | undefined; status?: ", - "CaseStatuses", + "{ getRelatedCases: (alertId: string, query: { owner?: string | string[] | undefined; }) => Promise<{ id: string; title: string; description: string; status: ", + { + "pluginId": "@kbn/cases-components", + "scope": "common", + "docId": "kibKbnCasesComponentsPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, + "; createdAt: string; totals: { alerts: number; userComments: number; }; }[]>; cases: { find: (query: { tags?: string | string[] | undefined; status?: ", + { + "pluginId": "@kbn/cases-components", + "scope": "common", + "docId": "kibKbnCasesComponentsPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, " | undefined; severity?: ", "CaseSeverity", " | undefined; assignees?: string | string[] | undefined; reporters?: string | string[] | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; fields?: string | string[] | undefined; from?: string | undefined; page?: number | undefined; perPage?: number | undefined; search?: string | undefined; searchFields?: string | string[] | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | undefined; to?: string | undefined; owner?: string | string[] | undefined; }, signal?: AbortSignal | undefined) => Promise<", @@ -878,7 +952,7 @@ "label": "hooks", "description": [], "signature": [ - "{ getUseCasesAddToNewCaseFlyout: (props?: AddToNewCaseFlyoutProps) => { open: ({ attachments }?: { attachments?: ", + "{ getUseCasesAddToNewCaseFlyout: (props?: AddToNewCaseFlyoutProps) => { open: ({ attachments, headerContent, }?: { attachments?: ", { "pluginId": "cases", "scope": "public", @@ -886,7 +960,7 @@ "section": "def-public.CaseAttachmentsWithoutOwner", "text": "CaseAttachmentsWithoutOwner" }, - " | undefined; }) => void; close: () => void; }; getUseCasesAddToExistingCaseModal: (props?: AddToExistingFlyoutProps) => { open: ({ attachments }?: { attachments?: ", + " | undefined; headerContent?: React.ReactNode; }) => void; close: () => void; }; getUseCasesAddToExistingCaseModal: (props?: AddToExistingFlyoutProps) => { open: ({ attachments }?: { attachments?: ", { "pluginId": "cases", "scope": "public", @@ -1130,7 +1204,13 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise<", { "pluginId": "cases", @@ -1155,7 +1235,13 @@ "a KibanaRequest" ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/cases/server/types.ts", @@ -1469,10 +1555,7 @@ "tags": [], "label": "CaseStatuses", "description": [], - "signature": [ - "CaseStatuses" - ], - "path": "node_modules/@types/kbn__cases-components/index.d.ts", + "path": "packages/kbn-cases-components/src/status/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1512,7 +1595,13 @@ "description": [], "signature": [ "Omit<{ description: string; status: ", - "CaseStatuses", + { + "pluginId": "@kbn/cases-components", + "scope": "common", + "docId": "kibKbnCasesComponentsPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, "; tags: string[]; title: string; connector: { id: string; type: ", "ConnectorTypes", ".casesWebhook; fields: null; name: string; } | { id: string; type: ", @@ -1562,7 +1651,13 @@ "text": "ExternalReferenceStorageType" }, ".elasticSearchDoc; }; externalReferenceAttachmentTypeId: string; externalReferenceMetadata: { [x: string]: ", - "JsonValue", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonValue", + "text": "JsonValue" + }, "; } | null; type: ", { "pluginId": "cases", @@ -1580,7 +1675,13 @@ "text": "ExternalReferenceStorageType" }, ".savedObject; soType: string; }; externalReferenceAttachmentTypeId: string; externalReferenceMetadata: { [x: string]: ", - "JsonValue", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonValue", + "text": "JsonValue" + }, "; } | null; type: ", { "pluginId": "cases", @@ -1598,7 +1699,13 @@ "text": "CommentType" }, ".persistableState; owner: string; persistableStateAttachmentTypeId: string; persistableStateAttachmentState: { [x: string]: ", - "JsonValue", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonValue", + "text": "JsonValue" + }, "; }; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } & { profile_uid?: string | undefined; }; owner: string; pushed_at: string | null; pushed_by: ({ email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } & { profile_uid?: string | undefined; }) | null; updated_at: string | null; updated_by: ({ email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } & { profile_uid?: string | undefined; }) | null; })) & { id: string; version: string; })[] | undefined; }, \"comments\"> & { comments: ", "Comment", "[]; }" diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 7472ea541f9cd..763038bfb52e2 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; @@ -21,7 +21,7 @@ Contact [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) for qu | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 87 | 0 | 70 | 28 | +| 87 | 0 | 71 | 28 | ## Client diff --git a/api_docs/charts.devdocs.json b/api_docs/charts.devdocs.json index 7131b518535f3..992447adfaa38 100644 --- a/api_docs/charts.devdocs.json +++ b/api_docs/charts.devdocs.json @@ -1057,7 +1057,13 @@ "label": "continuity", "description": [], "signature": [ - "PaletteContinuity", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteContinuity", + "text": "PaletteContinuity" + }, " | undefined" ], "path": "src/plugins/charts/common/expressions/palette/types.ts", @@ -1161,7 +1167,13 @@ "label": "continuity", "description": [], "signature": [ - "PaletteContinuity", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteContinuity", + "text": "PaletteContinuity" + }, " | undefined" ], "path": "src/plugins/charts/common/expressions/palette/types.ts", @@ -1478,10 +1490,13 @@ { "parentPluginId": "charts", "id": "def-public.defaultCountLabel", - "type": "string", + "type": "Any", "tags": [], "label": "defaultCountLabel", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/components/collections.ts", "deprecated": false, "trackAdoption": false, @@ -1802,10 +1817,13 @@ { "parentPluginId": "charts", "id": "def-public.vislibColorMaps.ColorSchemas.Blues.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -1861,10 +1879,13 @@ { "parentPluginId": "charts", "id": "def-public.vislibColorMaps.ColorSchemas.Greens.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -1920,10 +1941,13 @@ { "parentPluginId": "charts", "id": "def-public.vislibColorMaps.ColorSchemas.Greys.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -1979,10 +2003,13 @@ { "parentPluginId": "charts", "id": "def-public.vislibColorMaps.ColorSchemas.Reds.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -2038,10 +2065,13 @@ { "parentPluginId": "charts", "id": "def-public.vislibColorMaps.ColorSchemas.YellowToRed.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -2097,10 +2127,13 @@ { "parentPluginId": "charts", "id": "def-public.vislibColorMaps.ColorSchemas.GreenToRed.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -2199,7 +2232,13 @@ "description": [], "signature": [ "{ getPalettes: () => Promise<", - "PaletteRegistry", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteRegistry", + "text": "PaletteRegistry" + }, ">; }" ], "path": "src/plugins/charts/public/plugin.ts", @@ -2354,7 +2393,13 @@ "label": "continuity", "description": [], "signature": [ - "PaletteContinuity", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteContinuity", + "text": "PaletteContinuity" + }, " | undefined" ], "path": "src/plugins/charts/common/expressions/palette/types.ts", @@ -2458,7 +2503,13 @@ "label": "continuity", "description": [], "signature": [ - "PaletteContinuity", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteContinuity", + "text": "PaletteContinuity" + }, " | undefined" ], "path": "src/plugins/charts/common/expressions/palette/types.ts", @@ -2626,7 +2677,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/charts/common/expressions/palette/system_palette.ts", @@ -2877,7 +2934,13 @@ "label": "continuity", "description": [], "signature": [ - "PaletteContinuity", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteContinuity", + "text": "PaletteContinuity" + }, " | undefined" ], "path": "src/plugins/charts/common/expressions/palette/types.ts", @@ -2981,7 +3044,13 @@ "label": "continuity", "description": [], "signature": [ - "PaletteContinuity", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteContinuity", + "text": "PaletteContinuity" + }, " | undefined" ], "path": "src/plugins/charts/common/expressions/palette/types.ts", @@ -3313,10 +3382,13 @@ { "parentPluginId": "charts", "id": "def-common.defaultCountLabel", - "type": "string", + "type": "Any", "tags": [], "label": "defaultCountLabel", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/components/collections.ts", "deprecated": false, "trackAdoption": false, @@ -3650,10 +3722,13 @@ { "parentPluginId": "charts", "id": "def-common.vislibColorMaps.ColorSchemas.Blues.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -3709,10 +3784,13 @@ { "parentPluginId": "charts", "id": "def-common.vislibColorMaps.ColorSchemas.Greens.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -3768,10 +3846,13 @@ { "parentPluginId": "charts", "id": "def-common.vislibColorMaps.ColorSchemas.Greys.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -3827,10 +3908,13 @@ { "parentPluginId": "charts", "id": "def-common.vislibColorMaps.ColorSchemas.Reds.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -3886,10 +3970,13 @@ { "parentPluginId": "charts", "id": "def-common.vislibColorMaps.ColorSchemas.YellowToRed.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false @@ -3945,10 +4032,13 @@ { "parentPluginId": "charts", "id": "def-common.vislibColorMaps.ColorSchemas.GreenToRed.label", - "type": "string", + "type": "Any", "tags": [], "label": "label", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false, "trackAdoption": false diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index fac967851e6f1..bb11b048bee9b 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -8,20 +8,20 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github description: API docs for the charts plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.devdocs.json'; -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](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 | |-------------------|-----------|------------------------|-----------------| -| 264 | 2 | 249 | 9 | +| 264 | 16 | 249 | 9 | ## Client diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index ab73aa422cedc..603cd33e83946 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_chat.mdx b/api_docs/cloud_chat.mdx index 70fca17ae4652..31145474cd93c 100644 --- a/api_docs/cloud_chat.mdx +++ b/api_docs/cloud_chat.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudChat title: "cloudChat" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudChat plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudChat'] --- import cloudChatObj from './cloud_chat.devdocs.json'; diff --git a/api_docs/cloud_experiments.mdx b/api_docs/cloud_experiments.mdx index 118948e4ac2e5..74cde51ddd673 100644 --- a/api_docs/cloud_experiments.mdx +++ b/api_docs/cloud_experiments.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudExperiments title: "cloudExperiments" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudExperiments plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudExperiments'] --- import cloudExperimentsObj from './cloud_experiments.devdocs.json'; diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index e657dd9a0d3ab..f0c52198cda82 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] --- import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json'; diff --git a/api_docs/console.devdocs.json b/api_docs/console.devdocs.json index fe1f0a9e52b46..5dc1b60796d37 100644 --- a/api_docs/console.devdocs.json +++ b/api_docs/console.devdocs.json @@ -18,7 +18,13 @@ "text": "ConsoleUIPlugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "" @@ -49,7 +55,13 @@ "label": "ctx", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "" ], "path": "src/plugins/console/public/plugin.ts", @@ -69,7 +81,13 @@ "description": [], "signature": [ "({ notifications, getStartServices, http }: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ", { devTools, home, share, usageCollection }: ", "AppSetupUIPluginDependencies", ") => ", @@ -93,7 +111,13 @@ "label": "{ notifications, getStartServices, http }", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/console/public/plugin.ts", @@ -200,7 +224,13 @@ "text": "ConsoleUILocatorParams" }, " extends ", - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/console/public/types/locator.ts", "deprecated": false, diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 1451a0d26b087..a83716e68f413 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] --- import consoleObj from './console.devdocs.json'; diff --git a/api_docs/controls.devdocs.json b/api_docs/controls.devdocs.json index 18be82ecd4f7c..88b49be766ce4 100644 --- a/api_docs/controls.devdocs.json +++ b/api_docs/controls.devdocs.json @@ -88,7 +88,13 @@ "signature": [ "Subject", "<", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]>" ], "path": "src/plugins/controls/public/control_group/embeddable/control_group_container.tsx", @@ -239,15 +245,45 @@ "text": "ViewMode" }, "; title: string; id: string; lastReloadRequestTime: number; hidePanelTitles: boolean; enhancements: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "; disabledActions: string[]; disableTriggers: boolean; searchSessionId: string; syncColors: boolean; syncCursor: boolean; syncTooltips: boolean; executionContext: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, "; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; timeslice: [number, number]; controlStyle: \"twoLine\" | \"oneLine\"; ignoreParentSettings: ", "ParentIgnoreSettings", "; fieldName: string; parentFieldName: string; childFieldName: string; dataViewId: string; }, ", @@ -565,7 +601,13 @@ "description": [], "signature": [ "(filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]) => void" ], "path": "src/plugins/controls/public/control_group/embeddable/control_group_container.tsx", @@ -580,7 +622,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/controls/public/control_group/embeddable/control_group_container.tsx", @@ -990,7 +1038,13 @@ "text": "EmbeddableStateWithType" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "embeddable", @@ -1027,7 +1081,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", @@ -1061,7 +1121,13 @@ "text": "EmbeddableStateWithType" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/controls/public/control_group/embeddable/control_group_container_factory.ts", @@ -1147,7 +1213,7 @@ "label": "getDisplayName", "description": [], "signature": [ - "() => string" + "() => any" ], "path": "src/plugins/controls/public/control_group/embeddable/control_group_container_factory.ts", "deprecated": false, @@ -2051,7 +2117,7 @@ "label": "getDisplayName", "description": [], "signature": [ - "() => string" + "() => any" ], "path": "src/plugins/controls/public/options_list/embeddable/options_list_embeddable_factory.tsx", "deprecated": false, @@ -2083,7 +2149,7 @@ "label": "getDescription", "description": [], "signature": [ - "() => string" + "() => any" ], "path": "src/plugins/controls/public/options_list/embeddable/options_list_embeddable_factory.tsx", "deprecated": false, @@ -2108,7 +2174,13 @@ "text": "EmbeddableStateWithType" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "embeddable", @@ -2145,7 +2217,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", @@ -2179,7 +2257,13 @@ "text": "EmbeddableStateWithType" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/controls/public/options_list/embeddable/options_list_embeddable_factory.tsx", @@ -2581,7 +2665,7 @@ "label": "getDisplayName", "description": [], "signature": [ - "() => string" + "() => any" ], "path": "src/plugins/controls/public/range_slider/embeddable/range_slider_embeddable_factory.tsx", "deprecated": false, @@ -2597,7 +2681,7 @@ "label": "getDescription", "description": [], "signature": [ - "() => string" + "() => any" ], "path": "src/plugins/controls/public/range_slider/embeddable/range_slider_embeddable_factory.tsx", "deprecated": false, @@ -2938,7 +3022,13 @@ "text": "EmbeddableStateWithType" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "embeddable", @@ -2975,7 +3065,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", @@ -3009,7 +3105,13 @@ "text": "EmbeddableStateWithType" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/controls/public/range_slider/embeddable/range_slider_embeddable_factory.tsx", @@ -3185,7 +3287,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined" ], "path": "src/plugins/controls/public/types.ts", @@ -3712,6 +3820,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "controls", + "id": "def-public.OptionsListEmbeddableInput.existsSelected", + "type": "CompoundType", + "tags": [], + "label": "existsSelected", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/controls/common/options_list/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "controls", "id": "def-public.OptionsListEmbeddableInput.runPastTimeout", @@ -3739,6 +3861,48 @@ "path": "src/plugins/controls/common/options_list/types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "controls", + "id": "def-public.OptionsListEmbeddableInput.hideExclude", + "type": "CompoundType", + "tags": [], + "label": "hideExclude", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/controls/common/options_list/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "controls", + "id": "def-public.OptionsListEmbeddableInput.hideExists", + "type": "CompoundType", + "tags": [], + "label": "hideExists", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/controls/common/options_list/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "controls", + "id": "def-public.OptionsListEmbeddableInput.exclude", + "type": "CompoundType", + "tags": [], + "label": "exclude", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/controls/common/options_list/types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -3988,11 +4152,29 @@ "text": "EmbeddableInput" }, " & { query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined; filters?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; timeRange?: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined; timeslice?: [number, number] | undefined; controlStyle?: ", "ControlStyle", " | undefined; ignoreParentSettings?: ", @@ -4394,7 +4576,13 @@ "text": "RawControlGroupAttributes" }, ", \"id\">) => ", - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/controls/common/control_group/control_group_persistence.ts", "deprecated": false, @@ -4436,7 +4624,13 @@ "description": [], "signature": [ "(serializable: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => Omit<", { "pluginId": "controls", @@ -4459,7 +4653,13 @@ "label": "serializable", "description": [], "signature": [ - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/controls/common/control_group/control_group_persistence.ts", "deprecated": false, @@ -4811,6 +5011,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "controls", + "id": "def-common.OptionsListEmbeddableInput.existsSelected", + "type": "CompoundType", + "tags": [], + "label": "existsSelected", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/controls/common/options_list/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "controls", "id": "def-common.OptionsListEmbeddableInput.runPastTimeout", @@ -4838,6 +5052,48 @@ "path": "src/plugins/controls/common/options_list/types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "controls", + "id": "def-common.OptionsListEmbeddableInput.hideExclude", + "type": "CompoundType", + "tags": [], + "label": "hideExclude", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/controls/common/options_list/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "controls", + "id": "def-common.OptionsListEmbeddableInput.hideExists", + "type": "CompoundType", + "tags": [], + "label": "hideExists", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/controls/common/options_list/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "controls", + "id": "def-common.OptionsListEmbeddableInput.exclude", + "type": "CompoundType", + "tags": [], + "label": "exclude", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/controls/common/options_list/types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -5055,11 +5311,23 @@ "text": "ControlsPanels" }, " & ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "; ignoreParentSettings: ", "ParentIgnoreSettings", " & ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "; }" ], "path": "src/plugins/controls/common/control_group/types.ts", diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 9b4e242923076..7f9fb3178154c 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-prese | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 229 | 0 | 220 | 7 | +| 237 | 0 | 228 | 7 | ## Client diff --git a/api_docs/core.devdocs.json b/api_docs/core.devdocs.json index a84a901314a3f..b01c00aebe9ec 100644 --- a/api_docs/core.devdocs.json +++ b/api_docs/core.devdocs.json @@ -12,11 +12,23 @@ "\nMethods for adding and removing global toast messages." ], "signature": [ - "ToastsApi", + { + "pluginId": "@kbn/core-notifications-browser-internal", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserInternalPluginApi", + "section": "def-common.ToastsApi", + "text": "ToastsApi" + }, " implements ", - "IToasts" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -30,7 +42,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -41,7 +53,7 @@ "tags": [], "label": "deps", "description": [], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -53,9 +65,15 @@ "label": "uiSettings", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false } @@ -77,10 +95,16 @@ "() => ", "Observable", "<", - "Toast", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + }, "[]>" ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -97,11 +121,23 @@ ], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ") => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -115,9 +151,15 @@ "- a {@link ToastInput }" ], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -138,10 +180,16 @@ ], "signature": [ "(toastOrId: string | ", - "Toast", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -156,9 +204,15 @@ ], "signature": [ "string | ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -177,13 +231,31 @@ ], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: ", - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -197,9 +269,15 @@ "- a {@link ToastInput }" ], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -214,10 +292,16 @@ "- a {@link ToastOptions }" ], "signature": [ - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -238,13 +322,31 @@ ], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: ", - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -258,9 +360,15 @@ "- a {@link ToastInput }" ], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -275,10 +383,16 @@ "- a {@link ToastOptions }" ], "signature": [ - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -299,13 +413,31 @@ ], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: ", - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -319,9 +451,15 @@ "- a {@link ToastInput }" ], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -336,10 +474,16 @@ "- a {@link ToastOptions }" ], "signature": [ - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -360,13 +504,31 @@ ], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: ", - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -380,9 +542,15 @@ "- a {@link ToastInput }" ], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -397,10 +565,16 @@ "- a {@link ToastOptions }" ], "signature": [ - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -421,11 +595,23 @@ ], "signature": [ "(error: Error, options: ", - "ErrorToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + }, ") => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -441,7 +627,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -456,9 +642,15 @@ "- {@link ErrorToastOptions }" ], "signature": [ - "ErrorToastOptions" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser-internal/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -476,944 +668,283 @@ "interfaces": [ { "parentPluginId": "core", - "id": "def-public.AnalyticsClient", + "id": "def-public.App", "type": "Interface", "tags": [], - "label": "AnalyticsClient", - "description": [ - "\nAnalytics client's public APIs" - ], + "label": "App", + "description": [], "signature": [ - "AnalyticsClient" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.App", + "text": "App" + }, + " extends ", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppNavOptions", + "text": "AppNavOptions" + } ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-public.AnalyticsClient.reportEvent", - "type": "Function", - "tags": [ - "track-adoption" - ], - "label": "reportEvent", + "id": "def-public.App.id", + "type": "string", + "tags": [], + "label": "id", "description": [ - "\nReports a telemetry event." + "\nThe unique identifier of the application.\n\nCan only be composed of alphanumeric characters, `-`, `:` and `_`" ], - "signature": [ - "(eventType: string, eventData: EventTypeData) => void" + "path": "packages/core/application/core-application-browser/src/application.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-public.App.title", + "type": "string", + "tags": [], + "label": "title", + "description": [ + "\nThe title of the application." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, - "trackAdoption": true, - "references": [ - { - "plugin": "security", - "path": "x-pack/plugins/security/server/analytics/analytics_service.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/analytics/types.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/analytics/analytics_service.ts" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/fleet_usage_sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "@kbn/ebt-tools", - "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/analytics/analytics_service.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/analytics/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-server-mocks", - "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/analytics/analytics.stub.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-mocks", - "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-mocks", - "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-analytics-server-mocks", - "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-analytics-server-mocks", - "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" - }, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-public.App.category", + "type": "Object", + "tags": [], + "label": "category", + "description": [ + "\nThe category definition of the product\nSee {@link AppCategory}\nSee DEFAULT_APP_CATEGORIES for more reference" + ], + "signature": [ { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + "pluginId": "@kbn/core-application-common", + "scope": "common", + "docId": "kibKbnCoreApplicationCommonPluginApi", + "section": "def-common.AppCategory", + "text": "AppCategory" }, + " | undefined" + ], + "path": "packages/core/application/core-application-browser/src/application.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-public.App.status", + "type": "CompoundType", + "tags": [], + "label": "status", + "description": [ + "\nThe initial status of the application.\nDefaulting to `accessible`" + ], + "signature": [ { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppStatus", + "text": "AppStatus" }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts" - } + " | undefined" ], - "children": [ + "path": "packages/core/application/core-application-browser/src/application.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-public.App.navLinkStatus", + "type": "CompoundType", + "tags": [], + "label": "navLinkStatus", + "description": [ + "\nThe initial status of the application's navLink.\nDefaulting to `visible` if `status` is `accessible` and `hidden` if status is `inaccessible`\nSee {@link AppNavLinkStatus}" + ], + "signature": [ { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.reportEvent.$1", - "type": "string", - "tags": [], - "label": "eventType", - "description": [ - "The event type registered via the `registerEventType` API." - ], - "signature": [ - "string" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppNavLinkStatus", + "text": "AppNavLinkStatus" }, - { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.reportEvent.$2", - "type": "Uncategorized", - "tags": [], - "label": "eventData", - "description": [ - "The properties matching the schema declared in the `registerEventType` API." - ], - "signature": [ - "EventTypeData" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } + " | undefined" ], - "returnComment": [] + "path": "packages/core/application/core-application-browser/src/application.ts", + "deprecated": false, + "trackAdoption": false }, { "parentPluginId": "core", - "id": "def-public.AnalyticsClient.registerEventType", - "type": "Function", + "id": "def-public.App.searchable", + "type": "CompoundType", "tags": [], - "label": "registerEventType", + "label": "searchable", "description": [ - "\nRegisters the event type that will be emitted via the reportEvent API." + "\nThe initial flag to determine if the application is searchable in the global search.\nDefaulting to `true` if `navLinkStatus` is `visible` or omitted." ], "signature": [ - "(eventTypeOps: ", - "EventTypeOpts", - ") => void" + "boolean | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.registerEventType.$1", - "type": "Object", - "tags": [], - "label": "eventTypeOps", - "description": [ - "The definition of the event type {@link EventTypeOpts }." - ], - "signature": [ - "EventTypeOpts", - "" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "core", - "id": "def-public.AnalyticsClient.registerShipper", - "type": "Function", + "id": "def-public.App.defaultPath", + "type": "string", "tags": [], - "label": "registerShipper", + "label": "defaultPath", "description": [ - "\nSet up the shipper that will be used to report the telemetry events." + "\nAllow to define the default path a user should be directed to when navigating to the app.\nWhen defined, this value will be used as a default for the `path` option when calling {@link ApplicationStart.navigateToApp | navigateToApp}`,\nand will also be appended to the {@link ChromeNavLink | application navLink} in the navigation bar." ], "signature": [ - "(Shipper: ", - "ShipperClassConstructor", - ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", - " | undefined) => void" + "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, - "trackAdoption": false, - "children": [ + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-public.App.updater$", + "type": "Object", + "tags": [], + "label": "updater$", + "description": [ + "\nAn {@link AppUpdater} observable that can be used to update the application {@link AppUpdatableFields} at runtime.\n" + ], + "signature": [ + "Observable", + "<", { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.registerShipper.$1", - "type": "Object", - "tags": [], - "label": "Shipper", - "description": [ - "The {@link IShipper } class to instantiate the shipper." - ], - "signature": [ - "ShipperClassConstructor", - "" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUpdater", + "text": "AppUpdater" }, + "> | undefined" + ], + "path": "packages/core/application/core-application-browser/src/application.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-public.App.capabilities", + "type": "Object", + "tags": [], + "label": "capabilities", + "description": [ + "\nCustom capabilities defined by the app." + ], + "signature": [ + "Partial<", { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.registerShipper.$2", - "type": "Uncategorized", - "tags": [], - "label": "shipperConfig", - "description": [ - "The config specific to the Shipper to instantiate." - ], - "signature": [ - "ShipperConfig" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" }, - { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.registerShipper.$3", - "type": "Object", - "tags": [], - "label": "opts", - "description": [ - "Additional options to register the shipper {@link RegisterShipperOpts }." - ], - "signature": [ - "RegisterShipperOpts", - " | undefined" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } + "> | undefined" ], - "returnComment": [] + "path": "packages/core/application/core-application-browser/src/application.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-public.App.chromeless", + "type": "CompoundType", + "tags": [], + "label": "chromeless", + "description": [ + "\nHide the UI chrome when the application is mounted. Defaults to `false`.\nTakes precedence over chrome service visibility settings." + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/core/application/core-application-browser/src/application.ts", + "deprecated": false, + "trackAdoption": false }, { "parentPluginId": "core", - "id": "def-public.AnalyticsClient.optIn", + "id": "def-public.App.mount", "type": "Function", "tags": [], - "label": "optIn", + "label": "mount", "description": [ - "\nUsed to control the user's consent to report the data.\nIn the advanced mode, it allows to \"cherry-pick\" which events and shippers are enabled/disabled." + "\nA mount function called when the user navigates to this app's route." ], "signature": [ - "(optInConfig: ", - "OptInConfig", - ") => void" + "(params: ", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppMountParameters", + "text": "AppMountParameters" + }, + ") => ", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUnmount", + "text": "AppUnmount" + }, + " | Promise<", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUnmount", + "text": "AppUnmount" + }, + ">" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false, + "returnComment": [], "children": [ { "parentPluginId": "core", - "id": "def-public.AnalyticsClient.optIn.$1", + "id": "def-public.App.mount.$1", "type": "Object", "tags": [], - "label": "optInConfig", - "description": [ - "{@link OptInConfig }" - ], + "label": "params", + "description": [], "signature": [ - "OptInConfig" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppMountParameters", + "text": "AppMountParameters" + }, + "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.registerContextProvider", - "type": "Function", - "tags": [ - "track-adoption" - ], - "label": "registerContextProvider", - "description": [ - "\nRegisters the context provider to enrich any reported events." - ], - "signature": [ - "(contextProviderOpts: ", - "ContextProviderOpts", - ") => void" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": true, - "references": [ - { - "plugin": "licensing", - "path": "x-pack/plugins/licensing/common/register_analytics_context_provider.ts" - }, - { - "plugin": "cloud", - "path": "x-pack/plugins/cloud/common/register_cloud_deployment_id_analytics_context.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.ts" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/public/plugin.ts" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/server/plugin.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-elasticsearch-server-internal", - "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.ts" - }, - { - "plugin": "@kbn/core-environment-server-internal", - "path": "packages/core/environment/core-environment-server-internal/src/environment_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-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/analytics_service.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/analytics_service.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-mocks", - "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-execution-context-browser-internal", - "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.test.ts" - }, - { - "plugin": "@kbn/core-execution-context-browser-internal", - "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-server-mocks", - "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-analytics-server-mocks", - "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-elasticsearch-server-internal", - "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.test.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.ts" - } - ], - "children": [ - { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.registerContextProvider.$1", - "type": "Object", - "tags": [], - "label": "contextProviderOpts", - "description": [ - "{@link ContextProviderOpts }" - ], - "signature": [ - "ContextProviderOpts", - "" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.removeContextProvider", - "type": "Function", - "tags": [], - "label": "removeContextProvider", - "description": [ - "\nRemoves the context provider and stop enriching the events from its context." - ], - "signature": [ - "(contextProviderName: string) => void" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.removeContextProvider.$1", - "type": "string", - "tags": [], - "label": "contextProviderName", - "description": [ - "The name of the context provider to remove." - ], - "signature": [ - "string" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.telemetryCounter$", - "type": "Object", - "tags": [], - "label": "telemetryCounter$", - "description": [ - "\nObservable to emit the stats of the processed events." - ], - "signature": [ - "Observable", - "<", - "TelemetryCounter", - ">" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.AnalyticsClient.shutdown", - "type": "Function", - "tags": [], - "label": "shutdown", - "description": [ - "\nStops the client." - ], - "signature": [ - "() => void" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-public.App", - "type": "Interface", - "tags": [], - "label": "App", - "description": [], - "signature": [ - "App", - " extends ", - "AppNavOptions" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-public.App.id", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "\nThe unique identifier of the application.\n\nCan only be composed of alphanumeric characters, `-`, `:` and `_`" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.title", - "type": "string", - "tags": [], - "label": "title", - "description": [ - "\nThe title of the application." - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.category", - "type": "Object", - "tags": [], - "label": "category", - "description": [ - "\nThe category definition of the product\nSee {@link AppCategory}\nSee DEFAULT_APP_CATEGORIES for more reference" - ], - "signature": [ - "AppCategory", - " | undefined" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.status", - "type": "CompoundType", - "tags": [], - "label": "status", - "description": [ - "\nThe initial status of the application.\nDefaulting to `accessible`" - ], - "signature": [ - "AppStatus", - " | undefined" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.navLinkStatus", - "type": "CompoundType", - "tags": [], - "label": "navLinkStatus", - "description": [ - "\nThe initial status of the application's navLink.\nDefaulting to `visible` if `status` is `accessible` and `hidden` if status is `inaccessible`\nSee {@link AppNavLinkStatus}" - ], - "signature": [ - "AppNavLinkStatus", - " | undefined" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.searchable", - "type": "CompoundType", - "tags": [], - "label": "searchable", - "description": [ - "\nThe initial flag to determine if the application is searchable in the global search.\nDefaulting to `true` if `navLinkStatus` is `visible` or omitted." - ], - "signature": [ - "boolean | undefined" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.defaultPath", - "type": "string", - "tags": [], - "label": "defaultPath", - "description": [ - "\nAllow to define the default path a user should be directed to when navigating to the app.\nWhen defined, this value will be used as a default for the `path` option when calling {@link ApplicationStart.navigateToApp | navigateToApp}`,\nand will also be appended to the {@link ChromeNavLink | application navLink} in the navigation bar." - ], - "signature": [ - "string | undefined" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.updater$", - "type": "Object", - "tags": [], - "label": "updater$", - "description": [ - "\nAn {@link AppUpdater} observable that can be used to update the application {@link AppUpdatableFields} at runtime.\n" - ], - "signature": [ - "Observable", - "<", - "AppUpdater", - "> | undefined" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.capabilities", - "type": "Object", - "tags": [], - "label": "capabilities", - "description": [ - "\nCustom capabilities defined by the app." - ], - "signature": [ - "Partial<", - "Capabilities", - "> | undefined" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.chromeless", - "type": "CompoundType", - "tags": [], - "label": "chromeless", - "description": [ - "\nHide the UI chrome when the application is mounted. Defaults to `false`.\nTakes precedence over chrome service visibility settings." - ], - "signature": [ - "boolean | undefined" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.mount", - "type": "Function", - "tags": [], - "label": "mount", - "description": [ - "\nA mount function called when the user navigates to this app's route." - ], - "signature": [ - "(params: ", - "AppMountParameters", - ") => ", - "AppUnmount", - " | Promise<", - "AppUnmount", - ">" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "core", - "id": "def-public.App.mount.$1", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "AppMountParameters", - "" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false } @@ -1431,7 +962,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false }, @@ -1447,7 +978,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false }, @@ -1463,7 +994,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false }, @@ -1477,10 +1008,16 @@ "\nInput type for registering secondary in-app locations for an application.\n\nDeep links must include at least one of `path` or `deepLinks`. A deep link that does not have a `path`\nrepresents a topological level in the application's hierarchy, but does not have a destination URL that is\nuser-accessible.\n" ], "signature": [ - "AppDeepLink", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppDeepLink", + "text": "AppDeepLink" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false } @@ -1496,10 +1033,7 @@ "description": [ "\nA category definition for nav links to know where to sort them in the left hand nav" ], - "signature": [ - "AppCategory" - ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/application/core-application-common/src/app_category.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1512,7 +1046,7 @@ "description": [ "\nUnique identifier for the categories" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/application/core-application-common/src/app_category.ts", "deprecated": false, "trackAdoption": false }, @@ -1525,7 +1059,7 @@ "description": [ "\nLabel used for category name.\nAlso used as aria-label if one isn't set." ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/application/core-application-common/src/app_category.ts", "deprecated": false, "trackAdoption": false }, @@ -1541,7 +1075,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/application/core-application-common/src/app_category.ts", "deprecated": false, "trackAdoption": false }, @@ -1557,7 +1091,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/application/core-application-common/src/app_category.ts", "deprecated": false, "trackAdoption": false }, @@ -1573,7 +1107,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/application/core-application-common/src/app_category.ts", "deprecated": false, "trackAdoption": false } @@ -1589,10 +1123,7 @@ "description": [ "\nAction to return from a {@link AppLeaveHandler} to show a confirmation\nmessage when trying to leave an application.\n\nSee {@link AppLeaveActionFactory}\n" ], - "signature": [ - "AppLeaveConfirmAction" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1604,10 +1135,16 @@ "label": "type", "description": [], "signature": [ - "AppLeaveActionType", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppLeaveActionType", + "text": "AppLeaveActionType" + }, ".confirm" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false }, @@ -1618,7 +1155,7 @@ "tags": [], "label": "text", "description": [], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false }, @@ -1632,7 +1169,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false }, @@ -1646,7 +1183,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false }, @@ -1661,7 +1198,7 @@ "ButtonColor", " | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false }, @@ -1675,7 +1212,7 @@ "signature": [ "(() => void) | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1693,10 +1230,7 @@ "description": [ "\nAction to return from a {@link AppLeaveHandler} to execute the default\nbehaviour when leaving the application.\n\nSee {@link AppLeaveActionFactory}\n" ], - "signature": [ - "AppLeaveDefaultAction" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1708,10 +1242,16 @@ "label": "type", "description": [], "signature": [ - "AppLeaveActionType", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppLeaveActionType", + "text": "AppLeaveActionType" + }, ".default" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false } @@ -1725,10 +1265,7 @@ "tags": [], "label": "ApplicationSetup", "description": [], - "signature": [ - "ApplicationSetup" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1743,10 +1280,16 @@ ], "signature": [ "(app: ", - "App", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.App", + "text": "App" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1760,10 +1303,16 @@ "- an {@link App }" ], "signature": [ - "App", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.App", + "text": "App" + }, "" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1784,10 +1333,16 @@ "(appUpdater$: ", "Observable", "<", - "AppUpdater", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUpdater", + "text": "AppUpdater" + }, ">) => void" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1801,10 +1356,16 @@ "signature": [ "Observable", "<", - "AppUpdater", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUpdater", + "text": "AppUpdater" + }, ">" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1822,10 +1383,7 @@ "tags": [], "label": "ApplicationStart", "description": [], - "signature": [ - "ApplicationStart" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1841,7 +1399,7 @@ "signature": [ "{ readonly [x: string]: Readonly<{ [x: string]: boolean | Readonly<{ [x: string]: boolean; }>; }>; readonly navLinks: Readonly<{ [x: string]: boolean; }>; readonly management: Readonly<{ [x: string]: Readonly<{ [x: string]: boolean; }>; }>; readonly catalogue: Readonly<{ [x: string]: boolean; }>; }" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -1857,10 +1415,16 @@ "signature": [ "Observable", ">" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -1875,10 +1439,16 @@ ], "signature": [ "(appId: string, options?: ", - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined) => Promise" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1892,7 +1462,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1907,10 +1477,16 @@ "- navigation options" ], "signature": [ - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -1929,10 +1505,16 @@ ], "signature": [ "(url: string, options?: ", - "NavigateToUrlOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToUrlOptions", + "text": "NavigateToUrlOptions" + }, " | undefined) => Promise" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1948,7 +1530,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1963,10 +1545,16 @@ "- navigation options" ], "signature": [ - "NavigateToUrlOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToUrlOptions", + "text": "NavigateToUrlOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -1986,7 +1574,7 @@ "signature": [ "(appId: string, options?: { path?: string | undefined; absolute?: boolean | undefined; deepLinkId?: string | undefined; } | undefined) => string" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2000,7 +1588,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2012,7 +1600,7 @@ "tags": [], "label": "options", "description": [], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2026,7 +1614,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -2040,7 +1628,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -2054,7 +1642,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -2076,7 +1664,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -2091,10 +1679,16 @@ "label": "AppMountParameters", "description": [], "signature": [ - "AppMountParameters", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppMountParameters", + "text": "AppMountParameters" + }, "" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2110,7 +1704,7 @@ "signature": [ "HTMLElement" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false }, @@ -2124,10 +1718,16 @@ "\nA scoped history instance for your application. Should be used to wire up\nyour applications Router.\n" ], "signature": [ - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, "" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false }, @@ -2142,11 +1742,19 @@ "description": [ "\nThe route path for configuring navigation to the application.\nThis string should not include the base path from HTTP.\n" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, "references": [ + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/ui/app_container.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" @@ -2162,14 +1770,6 @@ { "plugin": "kibanaOverview", "path": "src/plugins/kibana_overview/public/application.tsx" - }, - { - "plugin": "@kbn/core-application-browser-internal", - "path": "packages/core/application/core-application-browser-internal/src/ui/app_container.tsx" - }, - { - "plugin": "@kbn/core-application-browser-mocks", - "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts" } ] }, @@ -2186,14 +1786,28 @@ ], "signature": [ "(handler: ", - "AppLeaveHandler", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppLeaveHandler", + "text": "AppLeaveHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, "references": [ + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/ui/app_container.tsx" + }, + { + "plugin": "@kbn/core-application-browser-mocks", + "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts" + }, { "plugin": "visualizations", "path": "src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx" @@ -2257,14 +1871,6 @@ { "plugin": "security", "path": "x-pack/plugins/security/public/authentication/logout/logout_app.test.ts" - }, - { - "plugin": "@kbn/core-application-browser-internal", - "path": "packages/core/application/core-application-browser-internal/src/ui/app_container.tsx" - }, - { - "plugin": "@kbn/core-application-browser-mocks", - "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts" } ], "children": [ @@ -2276,9 +1882,15 @@ "label": "handler", "description": [], "signature": [ - "AppLeaveHandler" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppLeaveHandler", + "text": "AppLeaveHandler" + } ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2297,10 +1909,16 @@ ], "signature": [ "(menuMount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined) => void" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2312,10 +1930,16 @@ "label": "menuMount", "description": [], "signature": [ - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -2335,10 +1959,16 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false } @@ -2354,10 +1984,7 @@ "description": [ "\nApp navigation menu options" ], - "signature": [ - "AppNavOptions" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2373,7 +2000,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false }, @@ -2389,7 +2016,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false }, @@ -2405,7 +2032,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false }, @@ -2421,7 +2048,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false } @@ -2437,10 +2064,7 @@ "description": [ "\nThe read-only set of capabilities available for the current UI session.\nCapabilities are simple key-value pairs of (string, boolean), where the string denotes the capability ID,\nand the boolean is a flag indicating if the capability is enabled or disabled.\n" ], - "signature": [ - "Capabilities" - ], - "path": "node_modules/@types/kbn__core-capabilities-common/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-common/src/capabilities.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2456,7 +2080,7 @@ "signature": [ "{ [x: string]: boolean; }" ], - "path": "node_modules/@types/kbn__core-capabilities-common/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-common/src/capabilities.ts", "deprecated": false, "trackAdoption": false }, @@ -2472,7 +2096,7 @@ "signature": [ "{ [sectionId: string]: Record; }" ], - "path": "node_modules/@types/kbn__core-capabilities-common/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-common/src/capabilities.ts", "deprecated": false, "trackAdoption": false }, @@ -2488,7 +2112,7 @@ "signature": [ "{ [x: string]: boolean; }" ], - "path": "node_modules/@types/kbn__core-capabilities-common/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-common/src/capabilities.ts", "deprecated": false, "trackAdoption": false }, @@ -2504,7 +2128,7 @@ "signature": [ "[key: string]: Record>" ], - "path": "node_modules/@types/kbn__core-capabilities-common/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-common/src/capabilities.ts", "deprecated": false, "trackAdoption": false } @@ -2518,10 +2142,7 @@ "tags": [], "label": "ChromeBadge", "description": [], - "signature": [ - "ChromeBadge" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2532,7 +2153,7 @@ "tags": [], "label": "text", "description": [], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -2543,7 +2164,7 @@ "tags": [], "label": "tooltip", "description": [], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -2558,7 +2179,7 @@ "IconType", " | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -2574,10 +2195,7 @@ "description": [ "\nAPIs for accessing and updating the document title.\n" ], - "signature": [ - "ChromeDocTitle" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/doc_title.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2593,7 +2211,7 @@ "signature": [ "(newTitle: string | string[]) => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/doc_title.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2609,7 +2227,7 @@ "signature": [ "string | string[]" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/doc_title.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2629,7 +2247,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/doc_title.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2645,10 +2263,7 @@ "tags": [], "label": "ChromeHelpExtension", "description": [], - "signature": [ - "ChromeHelpExtension" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2661,7 +2276,7 @@ "description": [ "\nProvide your plugin's name to create a header for separation" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false }, @@ -2675,10 +2290,16 @@ "\nCreates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button" ], "signature": [ - "ChromeHelpExtensionMenuLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionMenuLink", + "text": "ChromeHelpExtensionMenuLink" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false }, @@ -2693,10 +2314,16 @@ ], "signature": [ "((element: HTMLDivElement, menuActions: ", - "ChromeHelpMenuActions", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpMenuActions", + "text": "ChromeHelpMenuActions" + }, ") => () => void) | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2710,7 +2337,7 @@ "signature": [ "HTMLDivElement" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2723,9 +2350,15 @@ "label": "menuActions", "description": [], "signature": [ - "ChromeHelpMenuActions" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpMenuActions", + "text": "ChromeHelpMenuActions" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2744,11 +2377,23 @@ "label": "ChromeHelpExtensionMenuCustomLink", "description": [], "signature": [ - "ChromeHelpExtensionMenuCustomLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionMenuCustomLink", + "text": "ChromeHelpExtensionMenuCustomLink" + }, " extends ", - "ChromeHelpExtensionLinkBase" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionLinkBase", + "text": "ChromeHelpExtensionLinkBase" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2764,7 +2409,7 @@ "signature": [ "\"custom\"" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false }, @@ -2777,7 +2422,7 @@ "description": [ "\nURL of the link" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false }, @@ -2793,7 +2438,7 @@ "signature": [ "boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false } @@ -2808,11 +2453,23 @@ "label": "ChromeHelpExtensionMenuDiscussLink", "description": [], "signature": [ - "ChromeHelpExtensionMenuDiscussLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionMenuDiscussLink", + "text": "ChromeHelpExtensionMenuDiscussLink" + }, " extends ", - "ChromeHelpExtensionLinkBase" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionLinkBase", + "text": "ChromeHelpExtensionLinkBase" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2828,7 +2485,7 @@ "signature": [ "\"discuss\"" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false }, @@ -2841,7 +2498,7 @@ "description": [ "\nURL to discuss page.\ni.e. `https://discuss.elastic.co/c/${appName}`" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false } @@ -2856,11 +2513,23 @@ "label": "ChromeHelpExtensionMenuDocumentationLink", "description": [], "signature": [ - "ChromeHelpExtensionMenuDocumentationLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionMenuDocumentationLink", + "text": "ChromeHelpExtensionMenuDocumentationLink" + }, " extends ", - "ChromeHelpExtensionLinkBase" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionLinkBase", + "text": "ChromeHelpExtensionLinkBase" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2876,7 +2545,7 @@ "signature": [ "\"documentation\"" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false }, @@ -2889,7 +2558,7 @@ "description": [ "\nURL to documentation page.\ni.e. `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/${appName}.html`," ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false } @@ -2904,11 +2573,23 @@ "label": "ChromeHelpExtensionMenuGitHubLink", "description": [], "signature": [ - "ChromeHelpExtensionMenuGitHubLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionMenuGitHubLink", + "text": "ChromeHelpExtensionMenuGitHubLink" + }, " extends ", - "ChromeHelpExtensionLinkBase" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionLinkBase", + "text": "ChromeHelpExtensionLinkBase" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2924,7 +2605,7 @@ "signature": [ "\"github\"" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false }, @@ -2940,7 +2621,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false }, @@ -2956,7 +2637,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false } @@ -2970,10 +2651,7 @@ "tags": [], "label": "ChromeHelpMenuActions", "description": [], - "signature": [ - "ChromeHelpMenuActions" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2987,7 +2665,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3003,10 +2681,7 @@ "tags": [], "label": "ChromeNavControl", "description": [], - "signature": [ - "ChromeNavControl" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3020,7 +2695,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false }, @@ -3033,9 +2708,15 @@ "description": [], "signature": [ "(element: HTMLElement) => ", - "UnmountCallback" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.UnmountCallback", + "text": "UnmountCallback" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -3050,7 +2731,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false } @@ -3068,10 +2749,7 @@ "description": [ "\n{@link ChromeNavControls | APIs} for registering new controls to be displayed in the navigation bar.\n" ], - "signature": [ - "ChromeNavControls" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3086,10 +2764,16 @@ ], "signature": [ "(navControl: ", - "ChromeNavControl", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavControl", + "text": "ChromeNavControl" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3101,9 +2785,15 @@ "label": "navControl", "description": [], "signature": [ - "ChromeNavControl" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavControl", + "text": "ChromeNavControl" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3122,10 +2812,16 @@ ], "signature": [ "(navControl: ", - "ChromeNavControl", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavControl", + "text": "ChromeNavControl" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3137,9 +2833,15 @@ "label": "navControl", "description": [], "signature": [ - "ChromeNavControl" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavControl", + "text": "ChromeNavControl" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3158,10 +2860,16 @@ ], "signature": [ "(navControl: ", - "ChromeNavControl", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavControl", + "text": "ChromeNavControl" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3173,9 +2881,15 @@ "label": "navControl", "description": [], "signature": [ - "ChromeNavControl" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavControl", + "text": "ChromeNavControl" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3194,10 +2908,16 @@ ], "signature": [ "(navControl: ", - "ChromeNavControl", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavControl", + "text": "ChromeNavControl" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3209,9 +2929,15 @@ "label": "navControl", "description": [], "signature": [ - "ChromeNavControl" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavControl", + "text": "ChromeNavControl" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3229,10 +2955,7 @@ "tags": [], "label": "ChromeNavLink", "description": [], - "signature": [ - "ChromeNavLink" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3245,7 +2968,7 @@ "description": [ "\nA unique identifier for looking up links." ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3258,7 +2981,7 @@ "description": [ "\nThe title of the application." ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3272,10 +2995,16 @@ "\nThe category the app lives in" ], "signature": [ - "AppCategory", + { + "pluginId": "@kbn/core-application-common", + "scope": "common", + "docId": "kibKbnCoreApplicationCommonPluginApi", + "section": "def-common.AppCategory", + "text": "AppCategory" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3288,7 +3017,7 @@ "description": [ "\nThe base route used to open the root of an application." ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3301,7 +3030,7 @@ "description": [ "\nThe route used to open the default path and the deep links of an application." ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3317,7 +3046,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3333,7 +3062,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3349,7 +3078,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3365,7 +3094,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3378,7 +3107,7 @@ "description": [ "\nSettled state between `url`, `baseUrl`, and `active`" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3394,7 +3123,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false }, @@ -3410,7 +3139,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false } @@ -3426,10 +3155,7 @@ "description": [ "\n{@link ChromeNavLinks | APIs} for manipulating nav links.\n" ], - "signature": [ - "ChromeNavLinks" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3446,10 +3172,16 @@ "() => ", "Observable", "[]>" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3466,10 +3198,16 @@ ], "signature": [ "(id: string) => ", - "ChromeNavLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavLink", + "text": "ChromeNavLink" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3483,7 +3221,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3502,10 +3240,16 @@ ], "signature": [ "() => Readonly<", - "ChromeNavLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavLink", + "text": "ChromeNavLink" + }, ">[]" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3523,7 +3267,7 @@ "signature": [ "(id: string) => boolean" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3537,7 +3281,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3557,7 +3301,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3577,7 +3321,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3595,10 +3339,7 @@ "description": [ "\n{@link ChromeRecentlyAccessed | APIs} for recently accessed history." ], - "signature": [ - "ChromeRecentlyAccessed" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3614,7 +3355,7 @@ "signature": [ "(link: string, label: string, id: string) => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3630,7 +3371,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3647,7 +3388,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3664,7 +3405,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3683,10 +3424,16 @@ ], "signature": [ "() => ", - "ChromeRecentlyAccessedHistoryItem", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeRecentlyAccessedHistoryItem", + "text": "ChromeRecentlyAccessedHistoryItem" + }, "[]" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3705,10 +3452,16 @@ "() => ", "Observable", "<", - "ChromeRecentlyAccessedHistoryItem", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeRecentlyAccessedHistoryItem", + "text": "ChromeRecentlyAccessedHistoryItem" + }, "[]>" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3724,10 +3477,7 @@ "tags": [], "label": "ChromeRecentlyAccessedHistoryItem", "description": [], - "signature": [ - "ChromeRecentlyAccessedHistoryItem" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3738,7 +3488,7 @@ "tags": [], "label": "link", "description": [], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false }, @@ -3749,7 +3499,7 @@ "tags": [], "label": "label", "description": [], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false }, @@ -3760,7 +3510,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/recently_accessed.ts", "deprecated": false, "trackAdoption": false } @@ -3776,10 +3526,7 @@ "description": [ "\nChromeStart allows plugins to customize the global chrome header UI and\nenrich the UX with additional information about the current location of the\nbrowser.\n" ], - "signature": [ - "ChromeStart" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3793,9 +3540,15 @@ "{@inheritdoc ChromeNavLinks}" ], "signature": [ - "ChromeNavLinks" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavLinks", + "text": "ChromeNavLinks" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -3809,9 +3562,15 @@ "{@inheritdoc ChromeNavControls}" ], "signature": [ - "ChromeNavControls" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavControls", + "text": "ChromeNavControls" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -3825,9 +3584,15 @@ "{@inheritdoc ChromeRecentlyAccessed}" ], "signature": [ - "ChromeRecentlyAccessed" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeRecentlyAccessed", + "text": "ChromeRecentlyAccessed" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -3841,9 +3606,15 @@ "{@inheritdoc ChromeDocTitle}" ], "signature": [ - "ChromeDocTitle" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeDocTitle", + "text": "ChromeDocTitle" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -3861,7 +3632,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3879,7 +3650,7 @@ "signature": [ "(isVisible: boolean) => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3893,7 +3664,7 @@ "signature": [ "boolean" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3914,10 +3685,16 @@ "() => ", "Observable", "<", - "ChromeBadge", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeBadge", + "text": "ChromeBadge" + }, " | undefined>" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3934,10 +3711,16 @@ ], "signature": [ "(badge?: ", - "ChromeBadge", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeBadge", + "text": "ChromeBadge" + }, " | undefined) => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3949,10 +3732,16 @@ "label": "badge", "description": [], "signature": [ - "ChromeBadge", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeBadge", + "text": "ChromeBadge" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -3976,7 +3765,7 @@ "EuiBreadcrumbProps", "[]>" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3996,7 +3785,7 @@ "EuiBreadcrumbProps", "[]) => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4011,7 +3800,7 @@ "EuiBreadcrumbProps", "[]" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4032,10 +3821,16 @@ "() => ", "Observable", "<", - "ChromeBreadcrumbsAppendExtension", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeBreadcrumbsAppendExtension", + "text": "ChromeBreadcrumbsAppendExtension" + }, " | undefined>" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4052,10 +3847,16 @@ ], "signature": [ "(breadcrumbsAppendExtension?: ", - "ChromeBreadcrumbsAppendExtension", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeBreadcrumbsAppendExtension", + "text": "ChromeBreadcrumbsAppendExtension" + }, " | undefined) => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4067,10 +3868,16 @@ "label": "breadcrumbsAppendExtension", "description": [], "signature": [ - "ChromeBreadcrumbsAppendExtension", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeBreadcrumbsAppendExtension", + "text": "ChromeBreadcrumbsAppendExtension" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -4091,10 +3898,16 @@ "() => ", "Observable", " | undefined>" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4111,10 +3924,16 @@ ], "signature": [ "(newCustomNavLink?: Partial<", - "ChromeNavLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavLink", + "text": "ChromeNavLink" + }, "> | undefined) => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4127,10 +3946,16 @@ "description": [], "signature": [ "Partial<", - "ChromeNavLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeNavLink", + "text": "ChromeNavLink" + }, "> | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -4138,6 +3963,82 @@ ], "returnComment": [] }, + { + "parentPluginId": "core", + "id": "def-public.ChromeStart.getGlobalHelpExtensionMenuLinks$", + "type": "Function", + "tags": [], + "label": "getGlobalHelpExtensionMenuLinks$", + "description": [ + "\nGet the list of the registered global help extension menu links" + ], + "signature": [ + "() => ", + "Observable", + "<", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeGlobalHelpExtensionMenuLink", + "text": "ChromeGlobalHelpExtensionMenuLink" + }, + "[]>" + ], + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-public.ChromeStart.registerGlobalHelpExtensionMenuLink", + "type": "Function", + "tags": [], + "label": "registerGlobalHelpExtensionMenuLink", + "description": [ + "\nAppend a global help extension menu link" + ], + "signature": [ + "(globalHelpExtensionMenuLink: ", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeGlobalHelpExtensionMenuLink", + "text": "ChromeGlobalHelpExtensionMenuLink" + }, + ") => void" + ], + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-public.ChromeStart.registerGlobalHelpExtensionMenuLink.$1", + "type": "Object", + "tags": [], + "label": "globalHelpExtensionMenuLink", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeGlobalHelpExtensionMenuLink", + "text": "ChromeGlobalHelpExtensionMenuLink" + } + ], + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "core", "id": "def-public.ChromeStart.getHelpExtension$", @@ -4145,16 +4046,22 @@ "tags": [], "label": "getHelpExtension$", "description": [ - "\nGet an observable of the current custom help conttent" + "\nGet an observable of the current custom help content" ], "signature": [ "() => ", "Observable", "<", - "ChromeHelpExtension", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtension", + "text": "ChromeHelpExtension" + }, " | undefined>" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4171,10 +4078,16 @@ ], "signature": [ "(helpExtension?: ", - "ChromeHelpExtension", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtension", + "text": "ChromeHelpExtension" + }, " | undefined) => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4186,10 +4099,16 @@ "label": "helpExtension", "description": [], "signature": [ - "ChromeHelpExtension", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtension", + "text": "ChromeHelpExtension" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -4209,7 +4128,7 @@ "signature": [ "(url: string) => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4225,7 +4144,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4247,7 +4166,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4264,10 +4183,16 @@ ], "signature": [ "(headerBanner?: ", - "ChromeUserBanner", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeUserBanner", + "text": "ChromeUserBanner" + }, " | undefined) => void" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4279,10 +4204,16 @@ "label": "headerBanner", "description": [], "signature": [ - "ChromeUserBanner", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeUserBanner", + "text": "ChromeUserBanner" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -4304,7 +4235,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4320,10 +4251,7 @@ "tags": [], "label": "ChromeUserBanner", "description": [], - "signature": [ - "ChromeUserBanner" - ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4336,9 +4264,15 @@ "description": [], "signature": [ "(element: HTMLDivElement) => ", - "UnmountCallback" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.UnmountCallback", + "text": "UnmountCallback" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4353,7 +4287,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false } @@ -4372,10 +4306,16 @@ "\nDefinition of a context provider" ], "signature": [ - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4388,7 +4328,7 @@ "description": [ "\nThe name of the provider." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -4405,7 +4345,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -4420,10 +4360,16 @@ ], "signature": [ "{ [Key in keyof Required]: ", - "SchemaValue", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.SchemaValue", + "text": "SchemaValue" + }, "; }" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false } @@ -4440,10 +4386,16 @@ "\nCore services exposed to the `Plugin` setup lifecycle\n" ], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4458,24 +4410,66 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -4489,9 +4483,15 @@ "{@link ApplicationSetup}" ], "signature": [ - "ApplicationSetup" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationSetup", + "text": "ApplicationSetup" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -4505,9 +4505,15 @@ "{@link FatalErrorsSetup}" ], "signature": [ - "FatalErrorsSetup" + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -4521,9 +4527,15 @@ "{@link HttpSetup}" ], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -4537,9 +4549,15 @@ "{@link NotificationsSetup}" ], "signature": [ - "NotificationsSetup" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsSetup", + "text": "NotificationsSetup" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -4553,9 +4571,15 @@ "{@link IUiSettingsClient}" ], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -4569,9 +4593,15 @@ "{@link ExecutionContextSetup}" ], "signature": [ - "ExecutionContextSetup" + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -4585,9 +4615,15 @@ "{@link InjectedMetadataSetup}" ], "signature": [ - "InjectedMetadataSetup" + { + "pluginId": "@kbn/core-injected-metadata-browser", + "scope": "common", + "docId": "kibKbnCoreInjectedMetadataBrowserPluginApi", + "section": "def-common.InjectedMetadataSetup", + "text": "InjectedMetadataSetup" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -4601,9 +4637,15 @@ "{@link ThemeServiceSetup}" ], "signature": [ - "ThemeServiceSetup" + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceSetup", + "text": "ThemeServiceSetup" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -4618,10 +4660,16 @@ ], "signature": [ "() => Promise<[", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", TPluginsStart, TStart]>" ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4639,10 +4687,7 @@ "description": [ "\nCore services exposed to the `Plugin` start lifecycle\n" ], - "signature": [ - "CoreStart" - ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4657,14 +4702,26 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; }" ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4678,9 +4735,15 @@ "{@link ApplicationStart}" ], "signature": [ - "ApplicationStart" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationStart", + "text": "ApplicationStart" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4694,9 +4757,15 @@ "{@link ChromeStart}" ], "signature": [ - "ChromeStart" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeStart", + "text": "ChromeStart" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4710,9 +4779,15 @@ "{@link DocLinksStart}" ], "signature": [ - "DocLinksStart" + { + "pluginId": "@kbn/core-doc-links-browser", + "scope": "common", + "docId": "kibKbnCoreDocLinksBrowserPluginApi", + "section": "def-common.DocLinksStart", + "text": "DocLinksStart" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4726,9 +4801,15 @@ "{@link ExecutionContextStart}" ], "signature": [ - "ExecutionContextSetup" + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4742,9 +4823,15 @@ "{@link HttpStart}" ], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4758,9 +4845,15 @@ "{@link SavedObjectsStart}" ], "signature": [ - "SavedObjectsStart" + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4774,9 +4867,15 @@ "{@link I18nStart}" ], "signature": [ - "I18nStart" + { + "pluginId": "@kbn/core-i18n-browser", + "scope": "common", + "docId": "kibKbnCoreI18nBrowserPluginApi", + "section": "def-common.I18nStart", + "text": "I18nStart" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4790,9 +4889,15 @@ "{@link NotificationsStart}" ], "signature": [ - "NotificationsStart" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4806,9 +4911,15 @@ "{@link OverlayStart}" ], "signature": [ - "OverlayStart" + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4822,9 +4933,15 @@ "{@link IUiSettingsClient}" ], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4838,9 +4955,15 @@ "{@link FatalErrorsStart}" ], "signature": [ - "FatalErrorsSetup" + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4854,9 +4977,15 @@ "{@link DeprecationsServiceStart}" ], "signature": [ - "DeprecationsServiceStart" + { + "pluginId": "@kbn/core-deprecations-browser", + "scope": "common", + "docId": "kibKbnCoreDeprecationsBrowserPluginApi", + "section": "def-common.DeprecationsServiceStart", + "text": "DeprecationsServiceStart" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4870,9 +4999,15 @@ "{@link ThemeServiceStart}" ], "signature": [ - "ThemeServiceStart" + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -4886,9 +5021,15 @@ "{@link InjectedMetadataStart}" ], "signature": [ - "InjectedMetadataStart" + { + "pluginId": "@kbn/core-injected-metadata-browser", + "scope": "common", + "docId": "kibKbnCoreInjectedMetadataBrowserPluginApi", + "section": "def-common.InjectedMetadataStart", + "text": "InjectedMetadataStart" + } ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, "trackAdoption": false } @@ -4904,10 +5045,7 @@ "description": [ "\nContains all the required information to apply Kibana's theme at the various levels it can be used.\n" ], - "signature": [ - "CoreTheme" - ], - "path": "node_modules/@types/kbn__core-theme-browser/index.d.ts", + "path": "packages/core/theme/core-theme-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4920,7 +5058,7 @@ "description": [ "is dark mode enabled or not" ], - "path": "node_modules/@types/kbn__core-theme-browser/index.d.ts", + "path": "packages/core/theme/core-theme-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -4936,10 +5074,7 @@ "description": [ "\nDeprecationsService provides methods to fetch domain deprecation details from\nthe Kibana server.\n" ], - "signature": [ - "DeprecationsServiceStart" - ], - "path": "node_modules/@types/kbn__core-deprecations-browser/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4954,10 +5089,16 @@ ], "signature": [ "() => Promise<", - "DomainDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + }, "[]>" ], - "path": "node_modules/@types/kbn__core-deprecations-browser/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4974,10 +5115,16 @@ ], "signature": [ "(domainId: string) => Promise<", - "DomainDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + }, "[]>" ], - "path": "node_modules/@types/kbn__core-deprecations-browser/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4991,7 +5138,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-deprecations-browser/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5010,10 +5157,16 @@ ], "signature": [ "(details: ", - "DomainDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-deprecations-browser/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5025,9 +5178,15 @@ "label": "details", "description": [], "signature": [ - "DomainDeprecationDetails" + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + } ], - "path": "node_modules/@types/kbn__core-deprecations-browser/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5046,12 +5205,24 @@ ], "signature": [ "(details: ", - "DomainDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + }, ") => Promise<", - "ResolveDeprecationResponse", + { + "pluginId": "@kbn/core-deprecations-browser", + "scope": "common", + "docId": "kibKbnCoreDeprecationsBrowserPluginApi", + "section": "def-common.ResolveDeprecationResponse", + "text": "ResolveDeprecationResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-deprecations-browser/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5063,9 +5234,15 @@ "label": "details", "description": [], "signature": [ - "DomainDeprecationDetails" + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + } ], - "path": "node_modules/@types/kbn__core-deprecations-browser/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5083,10 +5260,7 @@ "tags": [], "label": "DocLinksStart", "description": [], - "signature": [ - "DocLinksStart" - ], - "path": "node_modules/@types/kbn__core-doc-links-browser/index.d.ts", + "path": "packages/core/doc-links/core-doc-links-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5097,7 +5271,7 @@ "tags": [], "label": "DOC_LINK_VERSION", "description": [], - "path": "node_modules/@types/kbn__core-doc-links-browser/index.d.ts", + "path": "packages/core/doc-links/core-doc-links-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5108,7 +5282,7 @@ "tags": [], "label": "ELASTIC_WEBSITE_URL", "description": [], - "path": "node_modules/@types/kbn__core-doc-links-browser/index.d.ts", + "path": "packages/core/doc-links/core-doc-links-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5120,9 +5294,15 @@ "label": "links", "description": [], "signature": [ - "DocLinks" + { + "pluginId": "@kbn/doc-links", + "scope": "common", + "docId": "kibKbnDocLinksPluginApi", + "section": "def-common.DocLinks", + "text": "DocLinks" + } ], - "path": "node_modules/@types/kbn__core-doc-links-browser/index.d.ts", + "path": "packages/core/doc-links/core-doc-links-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -5136,10 +5316,7 @@ "tags": [], "label": "EnvironmentMode", "description": [], - "signature": [ - "EnvironmentMode" - ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5153,7 +5330,7 @@ "signature": [ "\"production\" | \"development\"" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5164,7 +5341,7 @@ "tags": [], "label": "dev", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5175,7 +5352,7 @@ "tags": [], "label": "prod", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -5192,11 +5369,23 @@ "\nOptions available for {@link IToasts} error APIs." ], "signature": [ - "ErrorToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + }, " extends ", - "ToastOptions" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5209,7 +5398,7 @@ "description": [ "\nThe title of the toast and the dialog when expanding the message." ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5225,7 +5414,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -5242,10 +5431,16 @@ "\nDefinition of the full event structure" ], "signature": [ - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5258,7 +5453,7 @@ "description": [ "\nThe time the event was generated in ISO format." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5271,7 +5466,7 @@ "description": [ "\nThe event type." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5287,7 +5482,7 @@ "signature": [ "Properties" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5301,9 +5496,15 @@ "\nThe {@link EventContext} enriched during the processing pipeline." ], "signature": [ - "EventContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + } ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false } @@ -5319,10 +5520,7 @@ "description": [ "\nDefinition of the context that can be appended to the events through the {@link IAnalyticsClient.registerContextProvider}." ], - "signature": [ - "EventContext" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5338,7 +5536,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5354,7 +5552,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5370,7 +5568,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5386,7 +5584,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5402,7 +5600,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5418,7 +5616,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5434,7 +5632,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5450,7 +5648,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5466,7 +5664,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5482,7 +5680,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5498,7 +5696,7 @@ "signature": [ "[key: string]: unknown" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false } @@ -5515,10 +5713,16 @@ "\nDefinition of an Event Type." ], "signature": [ - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5531,7 +5735,7 @@ "description": [ "\nThe event type's unique name." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5546,10 +5750,16 @@ ], "signature": [ "{ [Key in keyof Required]: ", - "SchemaValue", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.SchemaValue", + "text": "SchemaValue" + }, "; }" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false } @@ -5565,10 +5775,7 @@ "description": [ "\nKibana execution context.\nUsed to provide execution context to Elasticsearch, reporting, performance monitoring, etc." ], - "signature": [ - "ExecutionContextSetup" - ], - "path": "node_modules/@types/kbn__core-execution-context-browser/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5584,10 +5791,16 @@ "signature": [ "Observable", "<", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, ">" ], - "path": "node_modules/@types/kbn__core-execution-context-browser/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5602,10 +5815,16 @@ ], "signature": [ "(c$: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-execution-context-browser/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5617,9 +5836,15 @@ "label": "c$", "description": [], "signature": [ - "KibanaExecutionContext" + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + } ], - "path": "node_modules/@types/kbn__core-execution-context-browser/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5638,9 +5863,15 @@ ], "signature": [ "() => ", - "KibanaExecutionContext" + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + } ], - "path": "node_modules/@types/kbn__core-execution-context-browser/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -5658,7 +5889,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-execution-context-browser/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -5677,7 +5908,7 @@ "() => ", "Labels" ], - "path": "node_modules/@types/kbn__core-execution-context-browser/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -5694,11 +5925,23 @@ ], "signature": [ "(context?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined) => ", - "KibanaExecutionContext" + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + } ], - "path": "node_modules/@types/kbn__core-execution-context-browser/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5710,10 +5953,16 @@ "label": "context", "description": [], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-execution-context-browser/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -5733,10 +5982,7 @@ "description": [ "\nRepresents the `message` and `stack` of a fatal Error\n" ], - "signature": [ - "FatalErrorInfo" - ], - "path": "node_modules/@types/kbn__core-fatal-errors-browser/index.d.ts", + "path": "packages/core/fatal-errors/core-fatal-errors-browser/src/get_error_info.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5747,7 +5993,7 @@ "tags": [], "label": "message", "description": [], - "path": "node_modules/@types/kbn__core-fatal-errors-browser/index.d.ts", + "path": "packages/core/fatal-errors/core-fatal-errors-browser/src/get_error_info.ts", "deprecated": false, "trackAdoption": false }, @@ -5761,7 +6007,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-fatal-errors-browser/index.d.ts", + "path": "packages/core/fatal-errors/core-fatal-errors-browser/src/get_error_info.ts", "deprecated": false, "trackAdoption": false } @@ -5777,10 +6023,7 @@ "description": [ "\nFatalErrors stop the Kibana Public Core and displays a fatal error screen\nwith details about the Kibana build and the error.\n" ], - "signature": [ - "FatalErrorsSetup" - ], - "path": "node_modules/@types/kbn__core-fatal-errors-browser/index.d.ts", + "path": "packages/core/fatal-errors/core-fatal-errors-browser/src/contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5796,7 +6039,7 @@ "signature": [ "(error: string | Error, source?: string | undefined) => never" ], - "path": "node_modules/@types/kbn__core-fatal-errors-browser/index.d.ts", + "path": "packages/core/fatal-errors/core-fatal-errors-browser/src/contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5812,7 +6055,7 @@ "signature": [ "string | Error" ], - "path": "node_modules/@types/kbn__core-fatal-errors-browser/index.d.ts", + "path": "packages/core/fatal-errors/core-fatal-errors-browser/src/contract.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5829,7 +6072,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-fatal-errors-browser/index.d.ts", + "path": "packages/core/fatal-errors/core-fatal-errors-browser/src/contract.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -5850,10 +6093,16 @@ "() => ", "Observable", "<", - "FatalErrorInfo", + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorInfo", + "text": "FatalErrorInfo" + }, ">" ], - "path": "node_modules/@types/kbn__core-fatal-errors-browser/index.d.ts", + "path": "packages/core/fatal-errors/core-fatal-errors-browser/src/contract.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -5872,11 +6121,23 @@ "\nAll options that may be used with a {@link HttpHandler}." ], "signature": [ - "HttpFetchOptions", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptions", + "text": "HttpFetchOptions" + }, " extends ", - "HttpRequestInit" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpRequestInit", + "text": "HttpRequestInit" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5890,10 +6151,16 @@ "\nThe query string for an HTTP request. See {@link HttpFetchQuery}." ], "signature": [ - "HttpFetchQuery", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchQuery", + "text": "HttpFetchQuery" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5909,7 +6176,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5923,10 +6190,16 @@ "\nHeaders to send with the request. See {@link HttpHeadersInit}." ], "signature": [ - "HttpHeadersInit", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHeadersInit", + "text": "HttpHeadersInit" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5942,7 +6215,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5958,7 +6231,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5970,10 +6243,16 @@ "label": "context", "description": [], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -5990,11 +6269,23 @@ "\nSimilar to {@link HttpFetchOptions} but with the URL path included." ], "signature": [ - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, " extends ", - "HttpFetchOptions" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptions", + "text": "HttpFetchOptions" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6005,7 +6296,7 @@ "tags": [], "label": "path", "description": [], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -6019,10 +6310,7 @@ "tags": [], "label": "HttpFetchQuery", "description": [], - "signature": [ - "HttpFetchQuery" - ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6038,7 +6326,7 @@ "signature": [ "[key: string]: string | number | boolean | string[] | number[] | boolean[] | null | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -6054,10 +6342,7 @@ "description": [ "\nA function for making an HTTP requests to Kibana's backend. See {@link HttpFetchOptions} for options and\n{@link HttpResponse} for the response.\n" ], - "signature": [ - "HttpHandler" - ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6071,7 +6356,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6085,7 +6370,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6099,7 +6384,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6113,7 +6398,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -6129,10 +6414,7 @@ "description": [ "\nHeaders to append to the request. Any headers that begin with `kbn-` are considered private to Core and will cause\n{@link HttpHandler} to throw an error." ], - "signature": [ - "HttpHeadersInit" - ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6146,7 +6428,7 @@ "signature": [ "[name: string]: any" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -6162,10 +6444,7 @@ "description": [ "\nAn object that may define global interceptor functions for different parts of the request and response lifecycle.\nSee {@link IHttpInterceptController}.\n" ], - "signature": [ - "HttpInterceptor" - ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6180,16 +6459,40 @@ ], "signature": [ "((fetchOptions: Readonly<", - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, ">, controller: ", - "IHttpInterceptController", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpInterceptController", + "text": "IHttpInterceptController" + }, ") => void | ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, ">) | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6202,10 +6505,16 @@ "description": [], "signature": [ "Readonly<", - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -6220,9 +6529,15 @@ "{@link IHttpInterceptController }" ], "signature": [ - "IHttpInterceptController" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpInterceptController", + "text": "IHttpInterceptController" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -6241,16 +6556,40 @@ ], "signature": [ "((httpErrorRequest: ", - "HttpInterceptorRequestError", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpInterceptorRequestError", + "text": "HttpInterceptorRequestError" + }, ", controller: ", - "IHttpInterceptController", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpInterceptController", + "text": "IHttpInterceptController" + }, ") => void | ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, ">) | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6264,9 +6603,15 @@ "{@link HttpInterceptorRequestError }" ], "signature": [ - "HttpInterceptorRequestError" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpInterceptorRequestError", + "text": "HttpInterceptorRequestError" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -6281,9 +6626,15 @@ "{@link IHttpInterceptController }" ], "signature": [ - "IHttpInterceptController" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpInterceptController", + "text": "IHttpInterceptController" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -6302,16 +6653,40 @@ ], "signature": [ "((httpResponse: ", - "HttpResponse", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpResponse", + "text": "HttpResponse" + }, ", controller: ", - "IHttpInterceptController", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpInterceptController", + "text": "IHttpInterceptController" + }, ") => void | ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "<", - "IHttpResponseInterceptorOverrides", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpResponseInterceptorOverrides", + "text": "IHttpResponseInterceptorOverrides" + }, ">) | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6325,10 +6700,16 @@ "{@link HttpResponse }" ], "signature": [ - "HttpResponse", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpResponse", + "text": "HttpResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -6343,9 +6724,15 @@ "{@link IHttpInterceptController }" ], "signature": [ - "IHttpInterceptController" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpInterceptController", + "text": "IHttpInterceptController" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -6364,16 +6751,40 @@ ], "signature": [ "((httpErrorResponse: ", - "HttpInterceptorResponseError", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpInterceptorResponseError", + "text": "HttpInterceptorResponseError" + }, ", controller: ", - "IHttpInterceptController", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpInterceptController", + "text": "IHttpInterceptController" + }, ") => void | ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "<", - "IHttpResponseInterceptorOverrides", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpResponseInterceptorOverrides", + "text": "IHttpResponseInterceptorOverrides" + }, ">) | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6387,9 +6798,15 @@ "{@link HttpInterceptorResponseError }" ], "signature": [ - "HttpInterceptorResponseError" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpInterceptorResponseError", + "text": "HttpInterceptorResponseError" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -6404,9 +6821,15 @@ "{@link IHttpInterceptController }" ], "signature": [ - "IHttpInterceptController" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpInterceptController", + "text": "IHttpInterceptController" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -6424,10 +6847,7 @@ "tags": [], "label": "HttpInterceptorRequestError", "description": [], - "signature": [ - "HttpInterceptorRequestError" - ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6440,14 +6860,32 @@ "description": [], "signature": [ "{ readonly path: string; readonly query?: ", - "HttpFetchQuery", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchQuery", + "text": "HttpFetchQuery" + }, " | undefined; readonly prependBasePath?: boolean | undefined; readonly headers?: ", - "HttpHeadersInit", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHeadersInit", + "text": "HttpHeadersInit" + }, " | undefined; readonly asSystemRequest?: boolean | undefined; readonly asResponse?: boolean | undefined; readonly context?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined; readonly body?: BodyInit | null | undefined; readonly cache?: RequestCache | undefined; readonly credentials?: RequestCredentials | undefined; readonly integrity?: string | undefined; readonly keepalive?: boolean | undefined; readonly method?: string | undefined; readonly mode?: RequestMode | undefined; readonly redirect?: RequestRedirect | undefined; readonly referrer?: string | undefined; readonly referrerPolicy?: ReferrerPolicy | undefined; readonly signal?: AbortSignal | null | undefined; readonly window?: null | undefined; }" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6461,7 +6899,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -6476,12 +6914,24 @@ "label": "HttpInterceptorResponseError", "description": [], "signature": [ - "HttpInterceptorResponseError", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpInterceptorResponseError", + "text": "HttpInterceptorResponseError" + }, " extends ", - "HttpResponse", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpResponse", + "text": "HttpResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6495,7 +6945,7 @@ "signature": [ "{ readonly cache: RequestCache; readonly credentials: RequestCredentials; readonly destination: RequestDestination; readonly headers: Headers; readonly integrity: string; readonly keepalive: boolean; readonly method: string; readonly mode: RequestMode; readonly redirect: RequestRedirect; readonly referrer: string; readonly referrerPolicy: ReferrerPolicy; readonly signal: AbortSignal; readonly url: string; readonly clone: () => Request; readonly body: ReadableStream | null; readonly bodyUsed: boolean; readonly arrayBuffer: () => Promise; readonly blob: () => Promise; readonly formData: () => Promise; readonly json: () => Promise; readonly text: () => Promise; }" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6508,10 +6958,16 @@ "description": [], "signature": [ "Error | ", - "IHttpFetchError", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpFetchError", + "text": "IHttpFetchError" + }, "" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -6527,10 +6983,7 @@ "description": [ "\nFetch API options available to {@link HttpHandler}s.\n" ], - "signature": [ - "HttpRequestInit" - ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6546,7 +6999,7 @@ "signature": [ "BodyInit | null | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6562,7 +7015,7 @@ "signature": [ "RequestCache | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6578,7 +7031,7 @@ "signature": [ "RequestCredentials | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6592,10 +7045,16 @@ "{@link HttpHeadersInit}" ], "signature": [ - "HttpHeadersInit", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHeadersInit", + "text": "HttpHeadersInit" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6611,7 +7070,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6627,7 +7086,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6643,7 +7102,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6659,7 +7118,7 @@ "signature": [ "RequestMode | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6675,7 +7134,7 @@ "signature": [ "RequestRedirect | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6691,7 +7150,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6707,7 +7166,7 @@ "signature": [ "ReferrerPolicy | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6723,7 +7182,7 @@ "signature": [ "AbortSignal | null | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6739,7 +7198,7 @@ "signature": [ "null | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -6754,10 +7213,16 @@ "label": "HttpResponse", "description": [], "signature": [ - "HttpResponse", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpResponse", + "text": "HttpResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6772,14 +7237,32 @@ ], "signature": [ "{ readonly path: string; readonly query?: ", - "HttpFetchQuery", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchQuery", + "text": "HttpFetchQuery" + }, " | undefined; readonly prependBasePath?: boolean | undefined; readonly headers?: ", - "HttpHeadersInit", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHeadersInit", + "text": "HttpHeadersInit" + }, " | undefined; readonly asSystemRequest?: boolean | undefined; readonly asResponse?: boolean | undefined; readonly context?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined; readonly body?: BodyInit | null | undefined; readonly cache?: RequestCache | undefined; readonly credentials?: RequestCredentials | undefined; readonly integrity?: string | undefined; readonly keepalive?: boolean | undefined; readonly method?: string | undefined; readonly mode?: RequestMode | undefined; readonly redirect?: RequestRedirect | undefined; readonly referrer?: string | undefined; readonly referrerPolicy?: ReferrerPolicy | undefined; readonly signal?: AbortSignal | null | undefined; readonly window?: null | undefined; }" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6795,7 +7278,7 @@ "signature": [ "{ readonly cache: RequestCache; readonly credentials: RequestCredentials; readonly destination: RequestDestination; readonly headers: Headers; readonly integrity: string; readonly keepalive: boolean; readonly method: string; readonly mode: RequestMode; readonly redirect: RequestRedirect; readonly referrer: string; readonly referrerPolicy: ReferrerPolicy; readonly signal: AbortSignal; readonly url: string; readonly clone: () => Request; readonly body: ReadableStream | null; readonly bodyUsed: boolean; readonly arrayBuffer: () => Promise; readonly blob: () => Promise; readonly formData: () => Promise; readonly json: () => Promise; readonly text: () => Promise; }" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6811,7 +7294,7 @@ "signature": [ "Readonly | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6827,7 +7310,7 @@ "signature": [ "TResponseBody | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -6841,10 +7324,7 @@ "tags": [], "label": "HttpSetup", "description": [], - "signature": [ - "HttpSetup" - ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6858,9 +7338,15 @@ "\nAPIs for manipulating the basePath on URL segments.\nSee {@link IBasePath}" ], "signature": [ - "IBasePath" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IBasePath", + "text": "IBasePath" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6874,9 +7360,15 @@ "\nAPIs for denoting certain paths for not requiring authentication" ], "signature": [ - "IAnonymousPaths" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IAnonymousPaths", + "text": "IAnonymousPaths" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6888,9 +7380,15 @@ "label": "externalUrl", "description": [], "signature": [ - "IExternalUrl" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IExternalUrl", + "text": "IExternalUrl" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6905,10 +7403,16 @@ ], "signature": [ "(interceptor: ", - "HttpInterceptor", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpInterceptor", + "text": "HttpInterceptor" + }, ") => () => void" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6922,9 +7426,15 @@ "a {@link HttpInterceptor }" ], "signature": [ - "HttpInterceptor" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpInterceptor", + "text": "HttpInterceptor" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -6944,9 +7454,15 @@ "Makes an HTTP request. Defaults to a GET request unless overridden. See {@link HttpHandler} for options." ], "signature": [ - "HttpHandler" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHandler", + "text": "HttpHandler" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6960,9 +7476,15 @@ "Makes an HTTP request with the DELETE method. See {@link HttpHandler} for options." ], "signature": [ - "HttpHandler" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHandler", + "text": "HttpHandler" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6976,9 +7498,15 @@ "Makes an HTTP request with the GET method. See {@link HttpHandler} for options." ], "signature": [ - "HttpHandler" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHandler", + "text": "HttpHandler" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6992,9 +7520,15 @@ "Makes an HTTP request with the HEAD method. See {@link HttpHandler} for options." ], "signature": [ - "HttpHandler" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHandler", + "text": "HttpHandler" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7008,9 +7542,15 @@ "Makes an HTTP request with the OPTIONS method. See {@link HttpHandler} for options." ], "signature": [ - "HttpHandler" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHandler", + "text": "HttpHandler" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7024,9 +7564,15 @@ "Makes an HTTP request with the PATCH method. See {@link HttpHandler} for options." ], "signature": [ - "HttpHandler" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHandler", + "text": "HttpHandler" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7040,9 +7586,15 @@ "Makes an HTTP request with the POST method. See {@link HttpHandler} for options." ], "signature": [ - "HttpHandler" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHandler", + "text": "HttpHandler" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7056,9 +7608,15 @@ "Makes an HTTP request with the PUT method. See {@link HttpHandler} for options." ], "signature": [ - "HttpHandler" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpHandler", + "text": "HttpHandler" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7076,7 +7634,7 @@ "Observable", ") => void" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7093,7 +7651,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7115,7 +7673,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -7133,10 +7691,7 @@ "description": [ "\nI18nStart.Context is required by any localizable React component from \\@kbn/i18n and \\@elastic/eui packages\nand is supposed to be used as the topmost component for any i18n-compatible React tree.\n" ], - "signature": [ - "I18nStart" - ], - "path": "node_modules/@types/kbn__core-i18n-browser/index.d.ts", + "path": "packages/core/i18n/core-i18n-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7152,7 +7707,7 @@ "signature": [ "({ children }: { children: React.ReactNode; }) => JSX.Element" ], - "path": "node_modules/@types/kbn__core-i18n-browser/index.d.ts", + "path": "packages/core/i18n/core-i18n-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7163,7 +7718,7 @@ "tags": [], "label": "{ children }", "description": [], - "path": "node_modules/@types/kbn__core-i18n-browser/index.d.ts", + "path": "packages/core/i18n/core-i18n-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7177,7 +7732,7 @@ "signature": [ "boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined" ], - "path": "node_modules/@types/kbn__core-i18n-browser/index.d.ts", + "path": "packages/core/i18n/core-i18n-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -7191,47 +7746,431 @@ }, { "parentPluginId": "core", - "id": "def-public.IAnonymousPaths", + "id": "def-public.IAnalyticsClient", "type": "Interface", "tags": [], - "label": "IAnonymousPaths", + "label": "IAnalyticsClient", "description": [ - "\nAPIs for denoting paths as not requiring authentication" - ], - "signature": [ - "IAnonymousPaths" + "\nAnalytics client's public APIs" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-public.IAnonymousPaths.isAnonymous", + "id": "def-public.IAnalyticsClient.reportEvent", "type": "Function", - "tags": [], - "label": "isAnonymous", + "tags": [ + "track-adoption" + ], + "label": "reportEvent", "description": [ - "\nDetermines whether the provided path doesn't require authentication. `path` should include the current basePath." + "\nReports a telemetry event." ], "signature": [ - "(path: string) => boolean" + "(eventType: string, eventData: EventTypeData) => void" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, - "trackAdoption": false, + "trackAdoption": true, + "references": [ + { + "plugin": "@kbn/ebt-tools", + "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/analytics/analytics_service.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/fleet_usage_sender.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/analytics_service.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-mocks", + "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-mocks", + "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/analytics.stub.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/analytics/analytics_service.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/analytics/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts" + } + ], "children": [ { "parentPluginId": "core", - "id": "def-public.IAnonymousPaths.isAnonymous.$1", + "id": "def-public.IAnalyticsClient.reportEvent.$1", "type": "string", "tags": [], - "label": "path", - "description": [], + "label": "eventType", + "description": [ + "The event type registered via the `registerEventType` API." + ], "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "core", + "id": "def-public.IAnalyticsClient.reportEvent.$2", + "type": "Uncategorized", + "tags": [], + "label": "eventData", + "description": [ + "The properties matching the schema declared in the `registerEventType` API." + ], + "signature": [ + "EventTypeData" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7241,102 +8180,206 @@ }, { "parentPluginId": "core", - "id": "def-public.IAnonymousPaths.register", + "id": "def-public.IAnalyticsClient.registerEventType", "type": "Function", "tags": [], - "label": "register", + "label": "registerEventType", "description": [ - "\nRegister `path` as not requiring authentication. `path` should not include the current basePath." + "\nRegisters the event type that will be emitted via the reportEvent API." ], "signature": [ - "(path: string) => void" + "(eventTypeOps: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, + ") => void" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-public.IAnonymousPaths.register.$1", - "type": "string", + "id": "def-public.IAnalyticsClient.registerEventType.$1", + "type": "Object", "tags": [], - "label": "path", - "description": [], + "label": "eventTypeOps", + "description": [ + "The definition of the event type {@link EventTypeOpts }." + ], "signature": [ - "string" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, + "" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true } ], "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-public.IBasePath", - "type": "Interface", - "tags": [], - "label": "IBasePath", - "description": [ - "\nAPIs for manipulating the basePath on URL segments." - ], - "signature": [ - "IBasePath" - ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "core", - "id": "def-public.IBasePath.get", + "id": "def-public.IAnalyticsClient.registerShipper", "type": "Function", "tags": [], - "label": "get", + "label": "registerShipper", "description": [ - "\nGets the `basePath` string." + "\nSet up the shipper that will be used to report the telemetry events." ], "signature": [ - "() => string" + "(Shipper: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, + ", shipperConfig: ShipperConfig, opts?: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, + " | undefined) => void" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, - "children": [], + "children": [ + { + "parentPluginId": "core", + "id": "def-public.IAnalyticsClient.registerShipper.$1", + "type": "Object", + "tags": [], + "label": "Shipper", + "description": [ + "The {@link IShipper } class to instantiate the shipper." + ], + "signature": [ + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, + "" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "core", + "id": "def-public.IAnalyticsClient.registerShipper.$2", + "type": "Uncategorized", + "tags": [], + "label": "shipperConfig", + "description": [ + "The config specific to the Shipper to instantiate." + ], + "signature": [ + "ShipperConfig" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "core", + "id": "def-public.IAnalyticsClient.registerShipper.$3", + "type": "Object", + "tags": [], + "label": "opts", + "description": [ + "Additional options to register the shipper {@link RegisterShipperOpts }." + ], + "signature": [ + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, + " | undefined" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], "returnComment": [] }, { "parentPluginId": "core", - "id": "def-public.IBasePath.prepend", + "id": "def-public.IAnalyticsClient.optIn", "type": "Function", "tags": [], - "label": "prepend", + "label": "optIn", "description": [ - "\nPrepends `path` with the basePath." + "\nUsed to control the user's consent to report the data.\nIn the advanced mode, it allows to \"cherry-pick\" which events and shippers are enabled/disabled." ], "signature": [ - "(url: string) => string" + "(optInConfig: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, + ") => void" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-public.IBasePath.prepend.$1", - "type": "string", + "id": "def-public.IAnalyticsClient.optIn.$1", + "type": "Object", "tags": [], - "label": "url", - "description": [], + "label": "optInConfig", + "description": [ + "{@link OptInConfig }" + ], "signature": [ - "string" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7346,31 +8389,324 @@ }, { "parentPluginId": "core", - "id": "def-public.IBasePath.remove", + "id": "def-public.IAnalyticsClient.registerContextProvider", + "type": "Function", + "tags": [ + "track-adoption" + ], + "label": "registerContextProvider", + "description": [ + "\nRegisters the context provider to enrich any reported events." + ], + "signature": [ + "(contextProviderOpts: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, + ") => void" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": true, + "references": [ + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.ts" + }, + { + "plugin": "@kbn/core-elasticsearch-server-internal", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.ts" + }, + { + "plugin": "@kbn/core-environment-server-internal", + "path": "packages/core/environment/core-environment-server-internal/src/environment_service.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "licensing", + "path": "x-pack/plugins/licensing/common/register_analytics_context_provider.ts" + }, + { + "plugin": "cloud", + "path": "x-pack/plugins/cloud/common/register_cloud_deployment_id_analytics_context.ts" + }, + { + "plugin": "telemetry", + "path": "src/plugins/telemetry/server/plugin.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.ts" + }, + { + "plugin": "telemetry", + "path": "src/plugins/telemetry/public/plugin.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-mocks", + "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/analytics_service.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/analytics_service.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.test.ts" + }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-elasticsearch-server-internal", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.ts" + } + ], + "children": [ + { + "parentPluginId": "core", + "id": "def-public.IAnalyticsClient.registerContextProvider.$1", + "type": "Object", + "tags": [], + "label": "contextProviderOpts", + "description": [ + "{@link ContextProviderOpts }" + ], + "signature": [ + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, + "" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-public.IAnalyticsClient.removeContextProvider", "type": "Function", "tags": [], - "label": "remove", + "label": "removeContextProvider", "description": [ - "\nRemoves the prepended basePath from the `path`." + "\nRemoves the context provider and stop enriching the events from its context." ], "signature": [ - "(url: string) => string" + "(contextProviderName: string) => void" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-public.IBasePath.remove.$1", + "id": "def-public.IAnalyticsClient.removeContextProvider.$1", "type": "string", "tags": [], - "label": "url", - "description": [], + "label": "contextProviderName", + "description": [ + "The name of the context provider to remove." + ], "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7380,79 +8716,90 @@ }, { "parentPluginId": "core", - "id": "def-public.IBasePath.serverBasePath", - "type": "string", + "id": "def-public.IAnalyticsClient.telemetryCounter$", + "type": "Object", "tags": [], - "label": "serverBasePath", + "label": "telemetryCounter$", "description": [ - "\nReturns the server's root basePath as configured, without any namespace prefix.\n\nSee {@link BasePath.get} for getting the basePath value for a specific request" + "\nObservable to emit the stats of the processed events." + ], + "signature": [ + "Observable", + "<", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, + ">" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "core", - "id": "def-public.IBasePath.publicBaseUrl", - "type": "string", + "id": "def-public.IAnalyticsClient.shutdown", + "type": "Function", "tags": [], - "label": "publicBaseUrl", + "label": "shutdown", "description": [ - "\nThe server's publicly exposed base URL, if configured. Includes protocol, host, port (optional) and the\n{@link IBasePath.serverBasePath}.\n" + "\nStops the client." ], "signature": [ - "string | undefined" + "() => void" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false }, { "parentPluginId": "core", - "id": "def-public.IExternalUrl", + "id": "def-public.IAnonymousPaths", "type": "Interface", "tags": [], - "label": "IExternalUrl", + "label": "IAnonymousPaths", "description": [ - "\nAPIs for working with external URLs.\n" - ], - "signature": [ - "IExternalUrl" + "\nAPIs for denoting paths as not requiring authentication" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-public.IExternalUrl.isInternalUrl", + "id": "def-public.IAnonymousPaths.isAnonymous", "type": "Function", "tags": [], - "label": "isInternalUrl", + "label": "isAnonymous", "description": [ - "\nDetermines if the provided URL is an internal url.\n" + "\nDetermines whether the provided path doesn't require authentication. `path` should include the current basePath." ], "signature": [ - "(relativeOrAbsoluteUrl: string) => boolean" + "(path: string) => boolean" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-public.IExternalUrl.isInternalUrl.$1", + "id": "def-public.IAnonymousPaths.isAnonymous.$1", "type": "string", "tags": [], - "label": "relativeOrAbsoluteUrl", + "label": "path", "description": [], "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7462,31 +8809,31 @@ }, { "parentPluginId": "core", - "id": "def-public.IExternalUrl.validateUrl", + "id": "def-public.IAnonymousPaths.register", "type": "Function", "tags": [], - "label": "validateUrl", + "label": "register", "description": [ - "\nDetermines if the provided URL is a valid location to send users.\nValidation is based on the configured allow list in kibana.yml.\n\nIf the URL is valid, then a URL will be returned.\nOtherwise, this will return null.\n" + "\nRegister `path` as not requiring authentication. `path` should not include the current basePath." ], "signature": [ - "(relativeOrAbsoluteUrl: string) => URL | null" + "(path: string) => void" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-public.IExternalUrl.validateUrl.$1", + "id": "def-public.IAnonymousPaths.register.$1", "type": "string", "tags": [], - "label": "relativeOrAbsoluteUrl", + "label": "path", "description": [], "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7499,43 +8846,264 @@ }, { "parentPluginId": "core", - "id": "def-public.IHttpFetchError", + "id": "def-public.IBasePath", "type": "Interface", "tags": [], - "label": "IHttpFetchError", - "description": [], - "signature": [ - "IHttpFetchError", - " extends Error" + "label": "IBasePath", + "description": [ + "\nAPIs for manipulating the basePath on URL segments." ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-public.IHttpFetchError.name", - "type": "string", + "id": "def-public.IBasePath.get", + "type": "Function", "tags": [], - "label": "name", - "description": [], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "label": "get", + "description": [ + "\nGets the `basePath` string." + ], + "signature": [ + "() => string" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "children": [], + "returnComment": [] }, { "parentPluginId": "core", - "id": "def-public.IHttpFetchError.request", - "type": "Object", + "id": "def-public.IBasePath.prepend", + "type": "Function", "tags": [], - "label": "request", - "description": [], + "label": "prepend", + "description": [ + "\nPrepends `path` with the basePath." + ], "signature": [ - "Request" + "(url: string) => string" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-public.IBasePath.prepend.$1", + "type": "string", + "tags": [], + "label": "url", + "description": [], + "signature": [ + "string" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-public.IBasePath.remove", + "type": "Function", + "tags": [], + "label": "remove", + "description": [ + "\nRemoves the prepended basePath from the `path`." + ], + "signature": [ + "(url: string) => string" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-public.IBasePath.remove.$1", + "type": "string", + "tags": [], + "label": "url", + "description": [], + "signature": [ + "string" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-public.IBasePath.serverBasePath", + "type": "string", + "tags": [], + "label": "serverBasePath", + "description": [ + "\nReturns the server's root basePath as configured, without any namespace prefix.\n\nSee {@link BasePath.get} for getting the basePath value for a specific request" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-public.IBasePath.publicBaseUrl", + "type": "string", + "tags": [], + "label": "publicBaseUrl", + "description": [ + "\nThe server's publicly exposed base URL, if configured. Includes protocol, host, port (optional) and the\n{@link IBasePath.serverBasePath}.\n" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-public.IExternalUrl", + "type": "Interface", + "tags": [], + "label": "IExternalUrl", + "description": [ + "\nAPIs for working with external URLs.\n" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-public.IExternalUrl.isInternalUrl", + "type": "Function", + "tags": [], + "label": "isInternalUrl", + "description": [ + "\nDetermines if the provided URL is an internal url.\n" + ], + "signature": [ + "(relativeOrAbsoluteUrl: string) => boolean" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-public.IExternalUrl.isInternalUrl.$1", + "type": "string", + "tags": [], + "label": "relativeOrAbsoluteUrl", + "description": [], + "signature": [ + "string" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-public.IExternalUrl.validateUrl", + "type": "Function", + "tags": [], + "label": "validateUrl", + "description": [ + "\nDetermines if the provided URL is a valid location to send users.\nValidation is based on the configured allow list in kibana.yml.\n\nIf the URL is valid, then a URL will be returned.\nOtherwise, this will return null.\n" + ], + "signature": [ + "(relativeOrAbsoluteUrl: string) => URL | null" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-public.IExternalUrl.validateUrl.$1", + "type": "string", + "tags": [], + "label": "relativeOrAbsoluteUrl", + "description": [], + "signature": [ + "string" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-public.IHttpFetchError", + "type": "Interface", + "tags": [], + "label": "IHttpFetchError", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpFetchError", + "text": "IHttpFetchError" + }, + " extends Error" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-public.IHttpFetchError.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-public.IHttpFetchError.request", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + "Request" + ], + "path": "packages/core/http/core-http-browser/src/types.ts", + "deprecated": false, + "trackAdoption": false }, { "parentPluginId": "core", @@ -7547,7 +9115,7 @@ "signature": [ "Response | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7563,7 +9131,7 @@ "signature": [ "Request" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": true, "removeBy": "8.8.0\n\nNote to maintainers: when looking at usages, mind that typical use could be inside a `catch` block,\nso TS and code-reference navigation might not highlight them.", "trackAdoption": false, @@ -7598,7 +9166,7 @@ "signature": [ "Response | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": true, "removeBy": "8.8.0\n\nNote to maintainers: when looking at usages, mind that typical use could be inside a `catch` block,\nso TS and code-reference navigation might not highlight them.", "trackAdoption": false, @@ -7623,7 +9191,7 @@ "signature": [ "TResponseBody | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -7639,10 +9207,7 @@ "description": [ "\nUsed to halt a request Promise chain in a {@link HttpInterceptor}." ], - "signature": [ - "IHttpInterceptController" - ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7655,7 +9220,7 @@ "description": [ "Whether or not this chain has been halted." ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7671,7 +9236,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -7690,10 +9255,16 @@ "\nProperties that can be returned by HttpInterceptor.request to override the response." ], "signature": [ - "IHttpResponseInterceptorOverrides", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpResponseInterceptorOverrides", + "text": "IHttpResponseInterceptorOverrides" + }, "" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7709,7 +9280,7 @@ "signature": [ "Readonly | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7725,7 +9296,7 @@ "signature": [ "TResponseBody | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -7741,10 +9312,7 @@ "description": [ "\nBasic structure of a Shipper" ], - "signature": [ - "IShipper" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7759,10 +9327,16 @@ ], "signature": [ "(events: ", - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]) => void" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7776,10 +9350,16 @@ "batched events {@link Event }" ], "signature": [ - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7799,7 +9379,7 @@ "signature": [ "(isOptedIn: boolean) => void" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7815,7 +9395,7 @@ "signature": [ "boolean" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7834,10 +9414,16 @@ ], "signature": [ "((newContext: ", - "EventContext", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + }, ") => void) | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7851,9 +9437,15 @@ "The full new context to set {@link EventContext }" ], "signature": [ - "EventContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + } ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7873,10 +9465,16 @@ "signature": [ "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, "> | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7892,7 +9490,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -7910,10 +9508,7 @@ "description": [ "\nMethods for adding and removing global toast messages. See {@link ToastsApi}." ], - "signature": [ - "IToasts" - ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7928,10 +9523,16 @@ "() => ", "Observable", "<", - "Toast", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + }, "[]>" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -7946,11 +9547,23 @@ "description": [], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ") => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7962,9 +9575,15 @@ "label": "toastOrTitle", "description": [], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7981,10 +9600,16 @@ "description": [], "signature": [ "(toastOrId: string | ", - "Toast", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7997,9 +9622,15 @@ "description": [], "signature": [ "string | ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8016,11 +9647,23 @@ "description": [], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: any) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8032,9 +9675,15 @@ "label": "toastOrTitle", "description": [], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8049,7 +9698,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8066,11 +9715,23 @@ "description": [], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: any) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8082,9 +9743,15 @@ "label": "toastOrTitle", "description": [], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8099,7 +9766,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8116,11 +9783,23 @@ "description": [], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: any) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8132,9 +9811,15 @@ "label": "toastOrTitle", "description": [], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8149,7 +9834,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8166,11 +9851,23 @@ "description": [], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: any) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8182,9 +9879,15 @@ "label": "toastOrTitle", "description": [], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8199,7 +9902,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8216,11 +9919,23 @@ "description": [], "signature": [ "(error: Error, options: ", - "ErrorToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + }, ") => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8234,7 +9949,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8247,9 +9962,15 @@ "label": "options", "description": [], "signature": [ - "ErrorToastOptions" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8269,10 +9990,7 @@ "description": [ "\nClient-side client that provides access to the advanced settings stored in elasticsearch.\nThe settings provide control over the behavior of the Kibana application.\nFor example, a user can specify how to display numeric or date fields.\nUsers can adjust the settings via Management UI.\n{@link IUiSettingsClient}\n" ], - "signature": [ - "IUiSettingsClient" - ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8288,7 +10006,7 @@ "signature": [ "(key: string, defaultOverride?: T | undefined) => T" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8302,7 +10020,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8317,7 +10035,7 @@ "signature": [ "T | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -8339,7 +10057,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8353,7 +10071,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8368,7 +10086,7 @@ "signature": [ "T | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -8387,12 +10105,24 @@ ], "signature": [ "() => Readonly>>" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -8410,7 +10140,7 @@ "signature": [ "(key: string, value: any) => Promise" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8424,7 +10154,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8439,7 +10169,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8459,7 +10189,7 @@ "signature": [ "(key: string) => Promise" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8473,7 +10203,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8493,7 +10223,7 @@ "signature": [ "(key: string) => boolean" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8507,7 +10237,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8527,7 +10257,7 @@ "signature": [ "(key: string) => boolean" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8541,7 +10271,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8561,7 +10291,7 @@ "signature": [ "(key: string) => boolean" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8575,7 +10305,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8595,7 +10325,7 @@ "signature": [ "(key: string) => boolean" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8609,7 +10339,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8631,7 +10361,7 @@ "Observable", "<{ key: string; newValue: T; oldValue: T; }>" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -8651,7 +10381,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -8669,10 +10399,7 @@ "description": [ "\nOptions for the {@link ApplicationStart.navigateToApp | navigateToApp API}" ], - "signature": [ - "NavigateToAppOptions" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8688,7 +10415,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -8704,7 +10431,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -8720,7 +10447,7 @@ "signature": [ "unknown" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -8736,7 +10463,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -8752,7 +10479,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -8768,7 +10495,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -8784,10 +10511,7 @@ "description": [ "\nOptions for the {@link ApplicationStart.navigateToUrl | navigateToUrl API}" ], - "signature": [ - "NavigateToUrlOptions" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8803,7 +10527,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -8819,7 +10543,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -8835,7 +10559,7 @@ "signature": [ "unknown" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -8849,10 +10573,7 @@ "tags": [], "label": "NotificationsSetup", "description": [], - "signature": [ - "NotificationsSetup" - ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8866,9 +10587,15 @@ "{@link ToastsSetup}" ], "signature": [ - "IToasts" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -8882,10 +10609,7 @@ "tags": [], "label": "NotificationsStart", "description": [], - "signature": [ - "NotificationsStart" - ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8899,9 +10623,15 @@ "{@link ToastsStart}" ], "signature": [ - "IToasts" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -8917,10 +10647,7 @@ "description": [ "\n" ], - "signature": [ - "OptInConfig" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8934,9 +10661,15 @@ "\nControls the global enabled/disabled behaviour of the client and shippers." ], "signature": [ - "OptInConfigPerType" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfigPerType", + "text": "OptInConfigPerType" + } ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -8951,10 +10684,16 @@ ], "signature": [ "Record | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false } @@ -8968,10 +10707,7 @@ "tags": [], "label": "OverlayBannersStart", "description": [], - "signature": [ - "OverlayBannersStart" - ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8986,10 +10722,16 @@ ], "signature": [ "(mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", priority?: number | undefined) => string" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9003,10 +10745,16 @@ "{@link MountPoint }" ], "signature": [ - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9023,7 +10771,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -9045,7 +10793,7 @@ "signature": [ "(id: string) => boolean" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9061,7 +10809,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9082,10 +10830,16 @@ ], "signature": [ "(id: string | undefined, mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", priority?: number | undefined) => string" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9101,7 +10855,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -9116,10 +10870,16 @@ "{@link MountPoint }" ], "signature": [ - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9136,7 +10896,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -9156,7 +10916,7 @@ "signature": [ "() => JSX.Element" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -9172,10 +10932,7 @@ "tags": [], "label": "OverlayFlyoutOpenOptions", "description": [], - "signature": [ - "OverlayFlyoutOpenOptions" - ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9189,7 +10946,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false }, @@ -9203,7 +10960,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false }, @@ -9217,7 +10974,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false }, @@ -9231,7 +10988,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false }, @@ -9245,7 +11002,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false }, @@ -9259,7 +11016,7 @@ "signature": [ "\"m\" | \"s\" | \"l\" | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false }, @@ -9273,7 +11030,7 @@ "signature": [ "string | number | boolean | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false }, @@ -9287,7 +11044,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false }, @@ -9301,7 +11058,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false }, @@ -9316,7 +11073,7 @@ "EuiOverlayMaskProps", " | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false }, @@ -9331,10 +11088,16 @@ ], "signature": [ "((flyout: ", - "OverlayRef", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + }, ") => void) | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9346,9 +11109,15 @@ "label": "flyout", "description": [], "signature": [ - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9368,10 +11137,7 @@ "description": [ "\nAPIs to open and manage fly-out dialogs.\n" ], - "signature": [ - "OverlayFlyoutStart" - ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9388,13 +11154,31 @@ ], "signature": [ "(mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", - "OverlayFlyoutOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayFlyoutOpenOptions", + "text": "OverlayFlyoutOpenOptions" + }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9408,10 +11192,16 @@ "{@link MountPoint } - Mounts the children inside a flyout panel" ], "signature": [ - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9426,10 +11216,16 @@ "{@link OverlayFlyoutOpenOptions } - options for the flyout" ], "signature": [ - "OverlayFlyoutOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayFlyoutOpenOptions", + "text": "OverlayFlyoutOpenOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -9447,10 +11243,7 @@ "tags": [], "label": "OverlayModalConfirmOptions", "description": [], - "signature": [ - "OverlayModalConfirmOptions" - ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9464,7 +11257,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9478,7 +11271,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9492,7 +11285,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9506,7 +11299,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9520,7 +11313,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9534,7 +11327,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9548,7 +11341,7 @@ "signature": [ "\"cancel\" | \"confirm\" | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9563,7 +11356,7 @@ "ButtonColor", " | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9579,7 +11372,7 @@ "signature": [ "string | number | boolean | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false } @@ -9593,10 +11386,7 @@ "tags": [], "label": "OverlayModalOpenOptions", "description": [], - "signature": [ - "OverlayModalOpenOptions" - ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9610,7 +11400,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9624,7 +11414,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9638,7 +11428,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -9652,7 +11442,7 @@ "signature": [ "string | number | boolean | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false } @@ -9668,10 +11458,7 @@ "description": [ "\nAPIs to open and manage modal dialogs.\n" ], - "signature": [ - "OverlayModalStart" - ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9688,13 +11475,31 @@ ], "signature": [ "(mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", - "OverlayModalOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayModalOpenOptions", + "text": "OverlayModalOpenOptions" + }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9708,10 +11513,16 @@ "{@link MountPoint } - Mounts the children inside the modal" ], "signature": [ - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9726,10 +11537,16 @@ "{@link OverlayModalOpenOptions } - options for the modal" ], "signature": [ - "OverlayModalOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayModalOpenOptions", + "text": "OverlayModalOpenOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -9748,12 +11565,24 @@ ], "signature": [ "(message: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", - "OverlayModalConfirmOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayModalConfirmOptions", + "text": "OverlayModalConfirmOptions" + }, " | undefined) => Promise" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9768,10 +11597,16 @@ ], "signature": [ "string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9786,10 +11621,16 @@ "{@link OverlayModalConfirmOptions } - options for the confirm modal" ], "signature": [ - "OverlayModalConfirmOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayModalConfirmOptions", + "text": "OverlayModalConfirmOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -9809,10 +11650,7 @@ "description": [ "\nReturned by {@link OverlayStart} methods for closing a mounted overlay." ], - "signature": [ - "OverlayRef" - ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/overlay_ref.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9828,7 +11666,7 @@ "signature": [ "Promise" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/overlay_ref.ts", "deprecated": false, "trackAdoption": false }, @@ -9844,7 +11682,7 @@ "signature": [ "() => Promise" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/overlay_ref.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -9860,10 +11698,7 @@ "tags": [], "label": "OverlayStart", "description": [], - "signature": [ - "OverlayStart" - ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/overlays.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9877,9 +11712,15 @@ "{@link OverlayBannersStart}" ], "signature": [ - "OverlayBannersStart" + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayBannersStart", + "text": "OverlayBannersStart" + } ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/overlays.ts", "deprecated": false, "trackAdoption": false }, @@ -9894,13 +11735,31 @@ ], "signature": [ "(mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", - "OverlayFlyoutOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayFlyoutOpenOptions", + "text": "OverlayFlyoutOpenOptions" + }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/overlays.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -9914,9 +11773,15 @@ "description": [], "signature": [ "(element: HTMLElement) => ", - "UnmountCallback" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.UnmountCallback", + "text": "UnmountCallback" + } ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -9931,7 +11796,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false } @@ -9945,10 +11810,16 @@ "label": "options", "description": [], "signature": [ - "OverlayFlyoutOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayFlyoutOpenOptions", + "text": "OverlayFlyoutOpenOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, "trackAdoption": false } @@ -9965,13 +11836,31 @@ ], "signature": [ "(mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", - "OverlayModalOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayModalOpenOptions", + "text": "OverlayModalOpenOptions" + }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/overlays.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -9985,9 +11874,15 @@ "description": [], "signature": [ "(element: HTMLElement) => ", - "UnmountCallback" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.UnmountCallback", + "text": "UnmountCallback" + } ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -10002,7 +11897,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false } @@ -10016,10 +11911,16 @@ "label": "options", "description": [], "signature": [ - "OverlayModalOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayModalOpenOptions", + "text": "OverlayModalOpenOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false } @@ -10036,12 +11937,24 @@ ], "signature": [ "(message: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", - "OverlayModalConfirmOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayModalConfirmOptions", + "text": "OverlayModalConfirmOptions" + }, " | undefined) => Promise" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/overlays.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -10055,10 +11968,16 @@ "description": [], "signature": [ "string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false }, @@ -10070,10 +11989,16 @@ "label": "options", "description": [], "signature": [ - "OverlayModalConfirmOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayModalConfirmOptions", + "text": "OverlayModalConfirmOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", + "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, "trackAdoption": false } @@ -10089,10 +12014,7 @@ "tags": [], "label": "PackageInfo", "description": [], - "signature": [ - "PackageInfo" - ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10103,7 +12025,7 @@ "tags": [], "label": "version", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -10114,7 +12036,7 @@ "tags": [], "label": "branch", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -10125,7 +12047,7 @@ "tags": [], "label": "buildNum", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -10136,7 +12058,7 @@ "tags": [], "label": "buildSha", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -10147,7 +12069,7 @@ "tags": [], "label": "dist", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -10164,10 +12086,16 @@ "\nThe interface that should be returned by a `PluginInitializer`.\n" ], "signature": [ - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10180,10 +12108,16 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ", plugins: TPluginsSetup) => TSetup" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10195,10 +12129,16 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -10213,7 +12153,7 @@ "signature": [ "TPluginsSetup" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -10230,10 +12170,16 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", plugins: TPluginsStart) => TStart" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10245,9 +12191,15 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -10262,7 +12214,7 @@ "signature": [ "TPluginsStart" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -10280,7 +12232,7 @@ "signature": [ "(() => void) | undefined" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -10299,10 +12251,16 @@ "\nThe available core services passed to a `PluginInitializer`\n" ], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10318,7 +12276,7 @@ "signature": [ "symbol" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", "deprecated": false, "trackAdoption": false }, @@ -10331,12 +12289,44 @@ "description": [], "signature": [ "{ mode: Readonly<", - "EnvironmentMode", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.EnvironmentMode", + "text": "EnvironmentMode" + }, ">; packageInfo: Readonly<", - "PackageInfo", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + }, ">; }" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-public.PluginInitializerContext.logger", + "type": "Object", + "tags": [], + "label": "logger", + "description": [], + "signature": [ + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + } + ], + "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", "deprecated": false, "trackAdoption": false }, @@ -10350,7 +12340,7 @@ "signature": [ "{ get: () => T; }" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", "deprecated": false, "trackAdoption": false } @@ -10367,10 +12357,16 @@ "\nThis interface is a very simple wrapper for SavedObjects resolved from the server\nwith the {@link SavedObjectsClientContract}.\n" ], "signature": [ - "ResolvedSimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.ResolvedSimpleSavedObject", + "text": "ResolvedSimpleSavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/resolve.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10384,10 +12380,16 @@ "\nThe saved object that was found." ], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/resolve.ts", "deprecated": false, "trackAdoption": false }, @@ -10403,7 +12405,7 @@ "signature": [ "\"conflict\" | \"exactMatch\" | \"aliasMatch\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/resolve.ts", "deprecated": false, "trackAdoption": false }, @@ -10419,7 +12421,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/resolve.ts", "deprecated": false, "trackAdoption": false }, @@ -10435,7 +12437,7 @@ "signature": [ "\"savedObjectConversion\" | \"savedObjectImport\" | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/resolve.ts", "deprecated": false, "trackAdoption": false } @@ -10449,10 +12451,7 @@ "tags": [], "label": "ResponseErrorBody", "description": [], - "signature": [ - "ResponseErrorBody" - ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10463,7 +12462,7 @@ "tags": [], "label": "message", "description": [], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -10474,7 +12473,7 @@ "tags": [], "label": "statusCode", "description": [], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -10488,7 +12487,7 @@ "signature": [ "Record | undefined" ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -10503,10 +12502,16 @@ "label": "SavedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10519,7 +12524,7 @@ "description": [ "The ID of this Saved Object, guaranteed to be unique for all objects of the same `type`" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10532,7 +12537,7 @@ "description": [ " The type of Saved Object. Each plugin can define it's own custom Saved Object types." ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10548,7 +12553,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10564,7 +12569,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10580,7 +12585,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10592,10 +12597,16 @@ "label": "error", "description": [], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10611,7 +12622,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10625,10 +12636,16 @@ "{@inheritdoc SavedObjectReference}" ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10642,10 +12659,16 @@ "{@inheritdoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10661,7 +12684,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10677,7 +12700,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -10693,7 +12716,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -10711,13 +12734,22 @@ "description": [ "\nThe data for a Saved Object is stored as an object in the `attributes`\nproperty.\n" ], - "signature": [ - "SavedObjectAttributes" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": true, "trackAdoption": false, "references": [ + { + "plugin": "@kbn/core-saved-objects-common", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts" + }, + { + "plugin": "@kbn/core-saved-objects-common", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts" + }, + { + "plugin": "@kbn/core-saved-objects-common", + "path": "packages/core/saved-objects/core-saved-objects-common/index.ts" + }, { "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/types.ts" @@ -11242,6 +13274,14 @@ "plugin": "savedSearch", "path": "src/plugins/saved_search/server/saved_objects/search_migrations.ts" }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/modules.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/modules.ts" + }, { "plugin": "visualizations", "path": "src/plugins/visualizations/common/types.ts" @@ -11282,14 +13322,6 @@ "plugin": "dashboard", "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts" }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/common/types/modules.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/common/types/modules.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/saved_objects/migrations/7.11/index.ts" @@ -11333,9 +13365,15 @@ "description": [], "signature": [ "[key: string]: ", - "SavedObjectAttribute" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttribute", + "text": "SavedObjectAttribute" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -11349,10 +13387,7 @@ "tags": [], "label": "SavedObjectError", "description": [], - "signature": [ - "SavedObjectError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11363,7 +13398,7 @@ "tags": [], "label": "error", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -11374,7 +13409,7 @@ "tags": [], "label": "message", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -11385,7 +13420,7 @@ "tags": [], "label": "statusCode", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -11399,7 +13434,7 @@ "signature": [ "Record | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -11415,10 +13450,7 @@ "description": [ "\nA reference to another saved object.\n" ], - "signature": [ - "SavedObjectReference" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11429,7 +13461,7 @@ "tags": [], "label": "name", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -11440,7 +13472,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -11451,7 +13483,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -11466,10 +13498,16 @@ "label": "SavedObjectsBatchResponse", "description": [], "signature": [ - "SavedObjectsBatchResponse", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBatchResponse", + "text": "SavedObjectsBatchResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/base.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11481,10 +13519,16 @@ "label": "savedObjects", "description": [], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/base.ts", "deprecated": false, "trackAdoption": false } @@ -11499,11 +13543,23 @@ "label": "SavedObjectsBulkCreateObject", "description": [], "signature": [ - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, " extends ", - "SavedObjectsCreateOptions" + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11514,7 +13570,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false }, @@ -11528,7 +13584,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false } @@ -11542,10 +13598,7 @@ "tags": [], "label": "SavedObjectsBulkCreateOptions", "description": [], - "signature": [ - "SavedObjectsBulkCreateOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11561,7 +13614,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false } @@ -11576,10 +13629,16 @@ "label": "SavedObjectsBulkResolveResponse", "description": [], "signature": [ - "SavedObjectsBulkResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkResolveResponse", + "text": "SavedObjectsBulkResolveResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_resolve.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11591,10 +13650,16 @@ "label": "resolved_objects", "description": [], "signature": [ - "ResolvedSimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.ResolvedSimpleSavedObject", + "text": "ResolvedSimpleSavedObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_resolve.ts", "deprecated": false, "trackAdoption": false } @@ -11609,10 +13674,16 @@ "label": "SavedObjectsBulkUpdateObject", "description": [], "signature": [ - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11623,7 +13694,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false }, @@ -11634,7 +13705,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false }, @@ -11648,7 +13719,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false }, @@ -11662,7 +13733,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false }, @@ -11674,10 +13745,16 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false } @@ -11691,10 +13768,7 @@ "tags": [], "label": "SavedObjectsBulkUpdateOptions", "description": [], - "signature": [ - "SavedObjectsBulkUpdateOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11708,7 +13782,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false } @@ -11724,10 +13798,7 @@ "description": [ "\nThe client-side SavedObjectsClient is a thin convenience library around the SavedObjects\nHTTP API for interacting with Saved Objects.\n" ], - "signature": [ - "SavedObjectsClientContract" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11742,12 +13813,24 @@ ], "signature": [ "(type: string, attributes: T, options?: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined) => Promise<", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11761,7 +13844,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -11776,7 +13859,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -11789,10 +13872,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -11811,14 +13900,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "[], options?: ", - "SavedObjectsBulkCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkCreateOptions", + "text": "SavedObjectsBulkCreateOptions" + }, " | undefined) => Promise<", - "SavedObjectsBatchResponse", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBatchResponse", + "text": "SavedObjectsBatchResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11830,10 +13937,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -11846,10 +13959,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBulkCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkCreateOptions", + "text": "SavedObjectsBulkCreateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -11870,10 +13989,16 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + }, " | undefined) => Promise<{}>" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11887,7 +14012,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -11902,7 +14027,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -11915,10 +14040,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -11937,14 +14068,32 @@ ], "signature": [ "(objects: ", - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[], options?: ", - "SavedObjectsBulkDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkDeleteResponse", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkDeleteResponse", + "text": "SavedObjectsBulkDeleteResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11958,10 +14107,16 @@ "- an array of objects containing id, type" ], "signature": [ - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -11976,10 +14131,16 @@ "- optional force argument to force deletion of objects in a namespace other than the scoped client" ], "signature": [ - "SavedObjectsBulkDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -12008,12 +14169,24 @@ ], "signature": [ "(options: ", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ") => Promise<", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12025,9 +14198,15 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsFindOptions" + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12048,10 +14227,16 @@ ], "signature": [ "(type: string, id: string) => Promise<", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12065,7 +14250,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12080,7 +14265,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12101,12 +14286,24 @@ ], "signature": [ "(objects: ", - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]) => Promise<", - "SavedObjectsBatchResponse", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBatchResponse", + "text": "SavedObjectsBatchResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12120,10 +14317,16 @@ "- an array ids, or an array of objects containing id and optionally type" ], "signature": [ - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12146,10 +14349,16 @@ ], "signature": [ "(type: string, id: string) => Promise<", - "ResolvedSimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.ResolvedSimpleSavedObject", + "text": "ResolvedSimpleSavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12163,7 +14372,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12178,7 +14387,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12201,12 +14410,24 @@ ], "signature": [ "(objects: ", - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]) => Promise<", - "SavedObjectsBulkResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkResolveResponse", + "text": "SavedObjectsBulkResolveResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12220,10 +14441,16 @@ "- an array of objects containing id, type" ], "signature": [ - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12247,12 +14474,24 @@ ], "signature": [ "(type: string, id: string, attributes: T, options?: ", - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, " | undefined) => Promise<", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12266,7 +14505,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12281,7 +14520,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12296,7 +14535,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12309,10 +14548,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -12331,12 +14576,24 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "[]) => Promise<", - "SavedObjectsBatchResponse", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBatchResponse", + "text": "SavedObjectsBatchResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12350,10 +14607,16 @@ "- [{ type, id, attributes, options: { version, references } }]" ], "signature": [ - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -12373,10 +14636,7 @@ "tags": [], "label": "SavedObjectsCreateOptions", "description": [], - "signature": [ - "SavedObjectsCreateOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12392,7 +14652,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -12408,7 +14668,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -12422,10 +14682,16 @@ "{@inheritDoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -12441,7 +14707,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -12453,10 +14719,16 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts", "deprecated": false, "trackAdoption": false } @@ -12470,10 +14742,7 @@ "tags": [], "label": "SavedObjectsDeleteOptions", "description": [], - "signature": [ - "SavedObjectsDeleteOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/delete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12489,7 +14758,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/delete.ts", "deprecated": false, "trackAdoption": false } @@ -12503,10 +14772,7 @@ "tags": [], "label": "SavedObjectsFindOptionsReference", "description": [], - "signature": [ - "SavedObjectsFindOptionsReference" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/find.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12517,7 +14783,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -12528,7 +14794,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/find.ts", "deprecated": false, "trackAdoption": false } @@ -12545,12 +14811,24 @@ "\nReturn type of the Saved Objects `find()` method.\n" ], "signature": [ - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, " extends ", - "SavedObjectsBatchResponse", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsBatchResponse", + "text": "SavedObjectsBatchResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/find.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12564,7 +14842,7 @@ "signature": [ "A | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -12575,7 +14853,7 @@ "tags": [], "label": "total", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -12586,7 +14864,7 @@ "tags": [], "label": "perPage", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -12597,7 +14875,7 @@ "tags": [], "label": "page", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/find.ts", "deprecated": false, "trackAdoption": false } @@ -12613,10 +14891,7 @@ "description": [ "\nA warning meant to notify that a specific user action is required to finalize the import\nof some type of object.\n" ], - "signature": [ - "SavedObjectsImportActionRequiredWarning" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12630,7 +14905,7 @@ "signature": [ "\"action_required\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12643,7 +14918,7 @@ "description": [ "The translated message to display to the user." ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12656,7 +14931,7 @@ "description": [ "The path (without the basePath) that the user should be redirect to address this warning." ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12672,7 +14947,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -12688,10 +14963,7 @@ "description": [ "\nRepresents a failure to import due to a conflict, which can be resolved in different ways with an overwrite." ], - "signature": [ - "SavedObjectsImportAmbiguousConflictError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12705,7 +14977,7 @@ "signature": [ "\"ambiguous_conflict\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12719,7 +14991,7 @@ "signature": [ "{ id: string; title?: string | undefined; updatedAt?: string | undefined; }[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -12735,10 +15007,7 @@ "description": [ "\nRepresents a failure to import due to a conflict." ], - "signature": [ - "SavedObjectsImportConflictError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12752,7 +15021,7 @@ "signature": [ "\"conflict\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12766,7 +15035,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -12782,10 +15051,7 @@ "description": [ "\nRepresents a failure to import." ], - "signature": [ - "SavedObjectsImportFailure" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12796,7 +15062,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12807,7 +15073,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12821,7 +15087,7 @@ "signature": [ "{ title?: string | undefined; icon?: string | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12837,7 +15103,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12849,17 +15115,47 @@ "label": "error", "description": [], "signature": [ - "SavedObjectsImportConflictError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportConflictError", + "text": "SavedObjectsImportConflictError" + }, " | ", - "SavedObjectsImportAmbiguousConflictError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportAmbiguousConflictError", + "text": "SavedObjectsImportAmbiguousConflictError" + }, " | ", - "SavedObjectsImportUnsupportedTypeError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportUnsupportedTypeError", + "text": "SavedObjectsImportUnsupportedTypeError" + }, " | ", - "SavedObjectsImportMissingReferencesError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportMissingReferencesError", + "text": "SavedObjectsImportMissingReferencesError" + }, " | ", - "SavedObjectsImportUnknownError" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportUnknownError", + "text": "SavedObjectsImportUnknownError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -12875,10 +15171,7 @@ "description": [ "\nRepresents a failure to import due to missing references." ], - "signature": [ - "SavedObjectsImportMissingReferencesError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12892,7 +15185,7 @@ "signature": [ "\"missing_references\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12906,7 +15199,7 @@ "signature": [ "{ type: string; id: string; }[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -12922,10 +15215,7 @@ "description": [ "\nThe response describing the result of an import." ], - "signature": [ - "SavedObjectsImportResponse" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12936,7 +15226,7 @@ "tags": [], "label": "success", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12947,7 +15237,7 @@ "tags": [], "label": "successCount", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12959,10 +15249,16 @@ "label": "successResults", "description": [], "signature": [ - "SavedObjectsImportSuccess", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportSuccess", + "text": "SavedObjectsImportSuccess" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12974,10 +15270,16 @@ "label": "warnings", "description": [], "signature": [ - "SavedObjectsImportWarning", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportWarning", + "text": "SavedObjectsImportWarning" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -12989,10 +15291,16 @@ "label": "errors", "description": [], "signature": [ - "SavedObjectsImportFailure", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportFailure", + "text": "SavedObjectsImportFailure" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -13008,10 +15316,7 @@ "description": [ "\nDescribes a retry operation for importing a saved object." ], - "signature": [ - "SavedObjectsImportRetry" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13022,7 +15327,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13033,7 +15338,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13044,7 +15349,7 @@ "tags": [], "label": "overwrite", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13060,7 +15365,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13074,7 +15379,7 @@ "signature": [ "{ type: string; from: string; to: string; }[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13090,7 +15395,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13106,7 +15411,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -13122,10 +15427,7 @@ "description": [ "\nA simple informative warning that will be displayed to the user.\n" ], - "signature": [ - "SavedObjectsImportSimpleWarning" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13139,7 +15441,7 @@ "signature": [ "\"simple\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13152,7 +15454,7 @@ "description": [ "The translated message to display to the user" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -13168,10 +15470,7 @@ "description": [ "\nRepresents a successful import." ], - "signature": [ - "SavedObjectsImportSuccess" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13182,7 +15481,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13193,7 +15492,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13209,7 +15508,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13225,7 +15524,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": true, "trackAdoption": false, "references": [ @@ -13249,7 +15548,7 @@ "signature": [ "{ title?: string | undefined; icon?: string | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13265,7 +15564,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -13281,10 +15580,7 @@ "description": [ "\nRepresents a failure to import due to an unknown reason." ], - "signature": [ - "SavedObjectsImportUnknownError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13298,7 +15594,7 @@ "signature": [ "\"unknown\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13309,7 +15605,7 @@ "tags": [], "label": "message", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -13320,7 +15616,7 @@ "tags": [], "label": "statusCode", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -13336,10 +15632,7 @@ "description": [ "\nRepresents a failure to import due to having an unsupported saved object type." ], - "signature": [ - "SavedObjectsImportUnsupportedTypeError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13353,7 +15646,7 @@ "signature": [ "\"unsupported_type\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -13369,10 +15662,7 @@ "description": [ "\nInformation about the migrations that have been applied to this SavedObject.\nWhen Kibana starts up, KibanaMigrator detects outdated documents and\nmigrates them based on this value. For each migration that has been applied,\nthe plugin's name is used as a key and the latest migration version as the\nvalue.\n" ], - "signature": [ - "SavedObjectsMigrationVersion" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13386,7 +15676,7 @@ "signature": [ "[pluginName: string]: string" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -13400,10 +15690,7 @@ "tags": [], "label": "SavedObjectsStart", "description": [], - "signature": [ - "SavedObjectsStart" - ], - "path": "node_modules/@types/kbn__core-saved-objects-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13417,9 +15704,15 @@ "{@link SavedObjectsClientContract}" ], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -13434,10 +15727,16 @@ "label": "SavedObjectsUpdateOptions", "description": [], "signature": [ - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/update.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13451,7 +15750,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/update.ts", "deprecated": false, "trackAdoption": false }, @@ -13465,7 +15764,7 @@ "signature": [ "Attributes | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/update.ts", "deprecated": false, "trackAdoption": false }, @@ -13477,10 +15776,16 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/update.ts", "deprecated": false, "trackAdoption": false } @@ -13496,10 +15801,7 @@ "description": [ "\nAn identifier for a saved object within a space.\n" ], - "signature": [ - "SavedObjectTypeIdTuple" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13512,7 +15814,7 @@ "description": [ "The id of the saved object" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -13525,7 +15827,7 @@ "description": [ "The type of the saved object" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -13542,12 +15844,18 @@ "\nA wrapper around a `History` instance that is scoped to a particular base path of the history stack. Behaves\nsimilarly to the `basename` option except that this wrapper hides any history stack entries from outside the scope\nof this base path.\n\nThis wrapper also allows Core and Plugins to share a single underlying global `History` instance without exposing\nthe history of other applications.\n\nThe {@link ScopedHistory.createSubHistory | createSubHistory} method is particularly useful for applications that\ncontain any number of \"sub-apps\" which should not have access to the main application's history or basePath.\n" ], "signature": [ - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, " extends ", "History", "" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/scoped_history.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13562,10 +15870,16 @@ ], "signature": [ "(basePath: string) => ", - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, "" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/scoped_history.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13581,7 +15895,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/scoped_history.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13603,7 +15917,7 @@ "LocationDescriptorObject", ", options?: { prependBasePath?: boolean | undefined; } | undefined) => string" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/scoped_history.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13618,7 +15932,7 @@ "LocationDescriptorObject", "" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/scoped_history.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13630,7 +15944,7 @@ "tags": [], "label": "options", "description": [], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/scoped_history.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13644,7 +15958,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/scoped_history.ts", "deprecated": false, "trackAdoption": false } @@ -13666,10 +15980,16 @@ "\nConstructor of a {@link IShipper}" ], "signature": [ - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13682,7 +16002,7 @@ "description": [ "\nThe shipper's unique name" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -13698,7 +16018,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13714,7 +16034,7 @@ "signature": [ "Config" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13729,9 +16049,15 @@ "Common context {@link AnalyticsClientInitContext }" ], "signature": [ - "AnalyticsClientInitContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.AnalyticsClientInitContext", + "text": "AnalyticsClientInitContext" + } ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13752,10 +16078,16 @@ "\nVery simple wrapper for SavedObjects loaded from the server\nwith the {@link SavedObjectsClientContract}.\n\nIt provides basic functionality for creating/saving/deleting saved objects,\nbut doesn't include any type-specific implementations.\n" ], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13769,7 +16101,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13783,7 +16115,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13794,7 +16126,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13805,7 +16137,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13817,10 +16149,16 @@ "label": "migrationVersion", "description": [], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13834,7 +16172,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13846,10 +16184,16 @@ "label": "error", "description": [], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13861,10 +16205,16 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13878,7 +16228,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13892,7 +16242,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13908,7 +16258,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false }, @@ -13922,7 +16272,7 @@ "signature": [ "(key: string) => any" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13936,7 +16286,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13954,7 +16304,7 @@ "signature": [ "(key: string, value: any) => T" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13968,7 +16318,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13983,7 +16333,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -14001,7 +16351,7 @@ "signature": [ "(key: string) => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -14015,7 +16365,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -14032,10 +16382,16 @@ "description": [], "signature": [ "() => Promise<", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -14051,7 +16407,7 @@ "signature": [ "() => Promise<{}>" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -14069,10 +16425,7 @@ "description": [ "\nShape of the events emitted by the telemetryCounter$ observable" ], - "signature": [ - "TelemetryCounter" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -14088,7 +16441,7 @@ "signature": [ "\"failed\" | \"enqueued\" | \"sent_to_shipper\" | \"succeeded\" | \"dropped\"" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -14101,7 +16454,7 @@ "description": [ "\nWho emitted the event? It can be \"client\" or the name of the shipper." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -14114,7 +16467,7 @@ "description": [ "\nThe event type the success/failure/drop event refers to." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -14127,7 +16480,7 @@ "description": [ "\nCode to provide additional information about the success or failure. Examples are 200/400/504/ValidationError/UnknownError" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -14140,7 +16493,7 @@ "description": [ "\nThe number of events that this counter refers to." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false } @@ -14154,10 +16507,7 @@ "tags": [], "label": "ThemeServiceSetup", "description": [], - "signature": [ - "ThemeServiceSetup" - ], - "path": "node_modules/@types/kbn__core-theme-browser/index.d.ts", + "path": "packages/core/theme/core-theme-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -14171,10 +16521,16 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], - "path": "node_modules/@types/kbn__core-theme-browser/index.d.ts", + "path": "packages/core/theme/core-theme-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -14188,10 +16544,7 @@ "tags": [], "label": "ThemeServiceStart", "description": [], - "signature": [ - "ThemeServiceStart" - ], - "path": "node_modules/@types/kbn__core-theme-browser/index.d.ts", + "path": "packages/core/theme/core-theme-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -14205,10 +16558,16 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], - "path": "node_modules/@types/kbn__core-theme-browser/index.d.ts", + "path": "packages/core/theme/core-theme-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -14224,10 +16583,7 @@ "description": [ "\nOptions available for {@link IToasts} APIs." ], - "signature": [ - "ToastOptions" - ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -14243,7 +16599,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -14260,10 +16616,16 @@ "\nUiSettings parameters defined by the plugins." ], "signature": [ - "UiSettingsParams", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UiSettingsParams", + "text": "UiSettingsParams" + }, "" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -14279,7 +16641,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14295,7 +16657,7 @@ "signature": [ "T | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14311,7 +16673,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14327,7 +16689,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14343,7 +16705,7 @@ "signature": [ "string[] | number[] | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14359,7 +16721,7 @@ "signature": [ "Record | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14375,7 +16737,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14391,7 +16753,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14407,7 +16769,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14421,10 +16783,16 @@ "defines a type of UI element {@link UiSettingsType}" ], "signature": [ - "UiSettingsType", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UiSettingsType", + "text": "UiSettingsType" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14438,10 +16806,16 @@ "optional deprecation information. Used to generate a deprecation warning." ], "signature": [ - "DeprecationSettings", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.DeprecationSettings", + "text": "DeprecationSettings" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14457,7 +16831,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14469,10 +16843,16 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14490,7 +16870,7 @@ "signature": [ "{ type: string; name: string; } | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": true, "trackAdoption": false, "references": [ @@ -14522,10 +16902,7 @@ "tags": [], "label": "UiSettingsState", "description": [], - "signature": [ - "UiSettingsState" - ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -14538,12 +16915,24 @@ "description": [], "signature": [ "[key: string]: ", - "PublicUiSettingsParams", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.PublicUiSettingsParams", + "text": "PublicUiSettingsParams" + }, " & ", - "UserProvidedValues", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UserProvidedValues", + "text": "UserProvidedValues" + }, "" ], - "path": "node_modules/@types/kbn__core-ui-settings-browser/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -14560,10 +16949,16 @@ "\nDescribes the values explicitly set by user." ], "signature": [ - "UserProvidedValues", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UserProvidedValues", + "text": "UserProvidedValues" + }, "" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -14577,7 +16972,7 @@ "signature": [ "T | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -14591,7 +16986,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -14609,10 +17004,7 @@ "description": [ "\nPossible type of actions on application leave.\n" ], - "signature": [ - "AppLeaveActionType" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14626,10 +17018,7 @@ "description": [ "\nStatus of the application's navLink.\n" ], - "signature": [ - "AppNavLinkStatus" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14643,10 +17032,7 @@ "description": [ "\nAccessibility status of an application.\n" ], - "signature": [ - "AppStatus" - ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14664,24 +17050,66 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], - "path": "node_modules/@types/kbn__core-analytics-browser/index.d.ts", + "path": "packages/core/analytics/core-analytics-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14697,14 +17125,26 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; }" ], - "path": "node_modules/@types/kbn__core-analytics-browser/index.d.ts", + "path": "packages/core/analytics/core-analytics-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14721,7 +17161,7 @@ "signature": [ "\"kbnAppWrapper\"" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/application/core-application-common/src/app_wrapper_class.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14737,16 +17177,40 @@ ], "signature": [ "{ id: string; title: string; keywords?: string[] | undefined; navLinkStatus?: ", - "AppNavLinkStatus", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppNavLinkStatus", + "text": "AppNavLinkStatus" + }, " | undefined; searchable?: boolean | undefined; } & ", - "AppNavOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppNavOptions", + "text": "AppNavOptions" + }, " & ({ path: string; deepLinks?: ", - "AppDeepLink", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppDeepLink", + "text": "AppDeepLink" + }, "[] | undefined; } | { path?: string | undefined; deepLinks: ", - "AppDeepLink", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppDeepLink", + "text": "AppDeepLink" + }, "[]; })" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14761,11 +17225,23 @@ "\nPossible actions to return from a {@link AppLeaveHandler}\n\nSee {@link AppLeaveConfirmAction} and {@link AppLeaveDefaultAction}\n" ], "signature": [ - "AppLeaveDefaultAction", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppLeaveDefaultAction", + "text": "AppLeaveDefaultAction" + }, " | ", - "AppLeaveConfirmAction" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppLeaveConfirmAction", + "text": "AppLeaveConfirmAction" + } ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14783,58 +17259,54 @@ ], "signature": [ "(factory: ", - "AppLeaveActionFactory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppLeaveActionFactory", + "text": "AppLeaveActionFactory" + }, ", nextAppId?: string | undefined) => ", - "AppLeaveAction" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppLeaveAction", + "text": "AppLeaveAction" + } ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, "references": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx" + "plugin": "@kbn/core-application-browser", + "path": "packages/core/application/core-application-browser/src/app_leave.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx" + "plugin": "@kbn/core-application-browser", + "path": "packages/core/application/core-application-browser/src/app_leave.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/types.ts" + "plugin": "@kbn/core-application-browser", + "path": "packages/core/application/core-application-browser/src/app_leave.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/app/routes.tsx" + "plugin": "@kbn/core-application-browser", + "path": "packages/core/application/core-application-browser/src/app_leave.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/app/routes.tsx" + "plugin": "@kbn/core-application-browser", + "path": "packages/core/application/core-application-browser/src/app_mount.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/app/app.tsx" + "plugin": "@kbn/core-application-browser", + "path": "packages/core/application/core-application-browser/src/app_mount.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/app/app.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/app/app.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts" + "plugin": "@kbn/core-application-browser", + "path": "packages/core/application/core-application-browser/index.ts" }, { "plugin": "@kbn/core-application-browser-internal", @@ -14871,6 +17343,50 @@ { "plugin": "@kbn/core-application-browser-internal", "path": "packages/core/application/core-application-browser-internal/src/application_service.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/routes.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/routes.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/app.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/app.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/app.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts" } ], "returnComment": [], @@ -14883,9 +17399,15 @@ "label": "factory", "description": [], "signature": [ - "AppLeaveActionFactory" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppLeaveActionFactory", + "text": "AppLeaveActionFactory" + } ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false }, @@ -14899,7 +17421,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_leave.ts", "deprecated": false, "trackAdoption": false } @@ -14917,14 +17439,32 @@ ], "signature": [ "(params: ", - "AppMountParameters", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppMountParameters", + "text": "AppMountParameters" + }, ") => ", - "AppUnmount", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUnmount", + "text": "AppUnmount" + }, " | Promise<", - "AppUnmount", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUnmount", + "text": "AppUnmount" + }, ">" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false, "returnComment": [ @@ -14941,10 +17481,16 @@ "{@link AppMountParameters }" ], "signature": [ - "AppMountParameters", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppMountParameters", + "text": "AppMountParameters" + }, "" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false } @@ -14963,7 +17509,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/app_mount.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -14981,14 +17527,32 @@ ], "signature": [ "{ status?: ", - "AppStatus", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppStatus", + "text": "AppStatus" + }, " | undefined; searchable?: boolean | undefined; deepLinks?: ", - "AppDeepLink", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppDeepLink", + "text": "AppDeepLink" + }, "[] | undefined; navLinkStatus?: ", - "AppNavLinkStatus", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppNavLinkStatus", + "text": "AppNavLinkStatus" + }, " | undefined; defaultPath?: string | undefined; tooltip?: string | undefined; }" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15004,12 +17568,24 @@ ], "signature": [ "(app: ", - "App", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.App", + "text": "App" + }, ") => Partial<", - "AppUpdatableFields", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUpdatableFields", + "text": "AppUpdatableFields" + }, "> | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -15022,10 +17598,16 @@ "label": "app", "description": [], "signature": [ - "App", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.App", + "text": "App" + }, "" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false } @@ -15044,7 +17626,7 @@ "CommonProps", " & { href?: string | undefined; rel?: string | undefined; onClick?: React.MouseEventHandler | undefined; text: React.ReactNode; truncate?: boolean | undefined; color?: \"warning\" | \"subdued\" | \"primary\" | \"accent\" | \"success\" | \"danger\" | \"text\" | \"ghost\" | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"time\" | \"page\" | \"false\" | \"true\" | \"step\" | undefined; }" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/breadcrumb.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15061,7 +17643,7 @@ "IconType", " | undefined; 'data-test-subj'?: string | undefined; rel?: string | undefined; target?: string | (string & {}) | undefined; }" ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15074,15 +17656,39 @@ "label": "ChromeHelpExtensionMenuLink", "description": [], "signature": [ - "ChromeHelpExtensionMenuGitHubLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionMenuGitHubLink", + "text": "ChromeHelpExtensionMenuGitHubLink" + }, " | ", - "ChromeHelpExtensionMenuDiscussLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionMenuDiscussLink", + "text": "ChromeHelpExtensionMenuDiscussLink" + }, " | ", - "ChromeHelpExtensionMenuDocumentationLink", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionMenuDocumentationLink", + "text": "ChromeHelpExtensionMenuDocumentationLink" + }, " | ", - "ChromeHelpExtensionMenuCustomLink" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionMenuCustomLink", + "text": "ChromeHelpExtensionMenuCustomLink" + } ], - "path": "node_modules/@types/kbn__core-chrome-browser/index.d.ts", + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15095,10 +17701,16 @@ "label": "DomainDeprecationDetails", "description": [], "signature": [ - "DeprecationsDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DeprecationsDetails", + "text": "DeprecationsDetails" + }, " & { domainId: string; }" ], - "path": "node_modules/@types/kbn__core-deprecations-common/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-common/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15115,7 +17727,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15130,9 +17742,15 @@ "\nSee {@link ExecutionContextSetup}." ], "signature": [ - "ExecutionContextSetup" + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + } ], - "path": "node_modules/@types/kbn__core-execution-context-browser/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15147,9 +17765,15 @@ "\nFatalErrors stop the Kibana Public Core and displays a fatal error screen\nwith details about the Kibana build and the error.\n" ], "signature": [ - "FatalErrorsSetup" + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + } ], - "path": "node_modules/@types/kbn__core-fatal-errors-browser/index.d.ts", + "path": "packages/core/fatal-errors/core-fatal-errors-browser/src/contract.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15164,9 +17788,15 @@ "\nSee {@link HttpSetup}" ], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], - "path": "node_modules/@types/kbn__core-http-browser/index.d.ts", + "path": "packages/core/http/core-http-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15180,10 +17810,16 @@ "description": [], "signature": [ "{ readonly type?: string | undefined; readonly name?: string | undefined; readonly page?: string | undefined; readonly id?: string | undefined; readonly description?: string | undefined; readonly url?: string | undefined; readonly meta?: { [key: string]: string | number | boolean | undefined; } | undefined; child?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined; }" ], - "path": "node_modules/@types/kbn__core-execution-context-common/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-common/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15199,9 +17835,15 @@ ], "signature": [ "(element: T) => ", - "UnmountCallback" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.UnmountCallback", + "text": "UnmountCallback" + } ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false, "returnComment": [ @@ -15220,7 +17862,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false } @@ -15238,12 +17880,24 @@ ], "signature": [ "(core: ", - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, ") => ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -15256,10 +17910,16 @@ "label": "core", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "" ], - "path": "node_modules/@types/kbn__core-plugins-browser/index.d.ts", + "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", "deprecated": false, "trackAdoption": false } @@ -15276,7 +17936,7 @@ "signature": [ "symbol" ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15292,14 +17952,32 @@ ], "signature": [ "Omit<", - "AppDeepLink", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppDeepLink", + "text": "AppDeepLink" + }, ", \"searchable\" | \"keywords\" | \"deepLinks\" | \"navLinkStatus\"> & { deepLinks: ", - "PublicAppDeepLinkInfo", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.PublicAppDeepLinkInfo", + "text": "PublicAppDeepLinkInfo" + }, "[]; keywords: string[]; navLinkStatus: ", - "AppNavLinkStatus", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppNavLinkStatus", + "text": "AppNavLinkStatus" + }, "; searchable: boolean; }" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15315,16 +17993,40 @@ ], "signature": [ "Omit<", - "App", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.App", + "text": "App" + }, ", \"searchable\" | \"mount\" | \"updater$\" | \"keywords\" | \"deepLinks\"> & { status: ", - "AppStatus", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppStatus", + "text": "AppStatus" + }, "; navLinkStatus: ", - "AppNavLinkStatus", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppNavLinkStatus", + "text": "AppNavLinkStatus" + }, "; appRoute: string; keywords: string[]; deepLinks: ", - "PublicAppDeepLinkInfo", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.PublicAppDeepLinkInfo", + "text": "PublicAppDeepLinkInfo" + }, "[]; searchable: boolean; }" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/application.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15340,12 +18042,24 @@ ], "signature": [ "{ name?: string | undefined; value?: unknown; description?: string | undefined; category?: string[] | undefined; options?: string[] | number[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; type?: ", - "UiSettingsType", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UiSettingsType", + "text": "UiSettingsType" + }, " | undefined; deprecation?: ", - "DeprecationSettings", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.DeprecationSettings", + "text": "DeprecationSettings" + }, " | undefined; order?: number | undefined; metric?: { type: string; name: string; } | undefined; }" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15362,7 +18076,7 @@ "signature": [ "{ status: \"ok\"; } | { status: \"fail\"; reason: string; }" ], - "path": "node_modules/@types/kbn__core-deprecations-browser/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15377,12 +18091,24 @@ "\nType definition for a Saved Object attribute value\n" ], "signature": [ - "SavedObjectAttributeSingle", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributeSingle", + "text": "SavedObjectAttributeSingle" + }, " | ", - "SavedObjectAttributeSingle", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributeSingle", + "text": "SavedObjectAttributeSingle" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15398,10 +18124,16 @@ ], "signature": [ "string | number | boolean | ", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, " | null | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15417,16 +18149,40 @@ "{ type: string | string[]; filter?: any; search?: string | undefined; fields?: string[] | undefined; aggs?: Record | undefined; page?: number | undefined; perPage?: number | undefined; sortField?: string | undefined; searchFields?: string[] | undefined; hasReference?: ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined; hasReferenceOperator?: \"AND\" | \"OR\" | undefined; hasNoReference?: ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined; hasNoReferenceOperator?: \"AND\" | \"OR\" | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; namespaces?: string[] | undefined; preference?: string | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-browser/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/find.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15441,11 +18197,23 @@ "\nComposite type of all the possible types of import warnings.\n\nSee {@link SavedObjectsImportSimpleWarning} and {@link SavedObjectsImportActionRequiredWarning}\nfor more details.\n" ], "signature": [ - "SavedObjectsImportSimpleWarning", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportSimpleWarning", + "text": "SavedObjectsImportSimpleWarning" + }, " | ", - "SavedObjectsImportActionRequiredWarning" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportActionRequiredWarning", + "text": "SavedObjectsImportActionRequiredWarning" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15462,7 +18230,7 @@ "signature": [ "\"single\" | \"multiple\" | \"multiple-isolated\" | \"agnostic\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15478,10 +18246,16 @@ ], "signature": [ "() => Promise<[", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", TPluginsStart, TStart]>" ], - "path": "node_modules/@types/kbn__core-lifecycle-browser/index.d.ts", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -15500,7 +18274,7 @@ "signature": [ "\"failed\" | \"enqueued\" | \"sent_to_shipper\" | \"succeeded\" | \"dropped\"" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15516,12 +18290,24 @@ "Pick<", "Toast", ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\" | \"css\"> & { title?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; text?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; } & { id: string; }" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15537,9 +18323,15 @@ ], "signature": [ "string | ", - "ToastInputFields" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInputFields", + "text": "ToastInputFields" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15557,12 +18349,24 @@ "Pick<", "Toast", ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\" | \"css\"> & { title?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; text?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; }" ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15577,9 +18381,15 @@ "\n{@link IToasts}" ], "signature": [ - "IToasts" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15594,9 +18404,15 @@ "\n{@link IToasts}" ], "signature": [ - "IToasts" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } ], - "path": "node_modules/@types/kbn__core-notifications-browser/index.d.ts", + "path": "packages/core/notifications/core-notifications-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15613,7 +18429,7 @@ "signature": [ "\"string\" | \"number\" | \"boolean\" | \"undefined\" | \"color\" | \"image\" | \"json\" | \"markdown\" | \"select\" | \"array\"" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15630,7 +18446,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -15640,13 +18456,16 @@ { "parentPluginId": "core", "id": "def-public.URL_MAX_LENGTH", - "type": "number", + "type": "CompoundType", "tags": [], "label": "URL_MAX_LENGTH", "description": [ "\nThe max URL length allowed by the current browser. Should be used to display warnings to users when query parameters\ncause URL to exceed this limit." ], - "path": "node_modules/@types/kbn__core-apps-browser-internal/index.d.ts", + "signature": [ + "2000 | 25000" + ], + "path": "packages/core/apps/core-apps-browser-internal/src/errors/url_overflow.tsx", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15662,10 +18481,16 @@ "description": [], "signature": [ "{ [x: string]: ", - "AppCategory", + { + "pluginId": "@kbn/core-application-common", + "scope": "common", + "docId": "kibKbnCoreApplicationCommonPluginApi", + "section": "def-common.AppCategory", + "text": "AppCategory" + }, "; }" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/application/core-application-common/src/default_app_categories.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15684,39 +18509,57 @@ "\nCSP configuration for use in Kibana." ], "signature": [ - "CspConfig", + { + "pluginId": "@kbn/core-http-server-internal", + "scope": "server", + "docId": "kibKbnCoreHttpServerInternalPluginApi", + "section": "def-server.CspConfig", + "text": "CspConfig" + }, " implements ", - "ICspConfig" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ICspConfig", + "text": "ICspConfig" + } ], - "path": "node_modules/@types/kbn__core-http-server-internal/index.d.ts", + "path": "packages/core/http/core-http-server-internal/src/csp/csp_config.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-server.CspConfig.private", - "type": "Any", + "id": "def-server.CspConfig.DEFAULT", + "type": "Object", "tags": [], - "label": "#private", + "label": "DEFAULT", "description": [], "signature": [ - "any" + { + "pluginId": "@kbn/core-http-server-internal", + "scope": "server", + "docId": "kibKbnCoreHttpServerInternalPluginApi", + "section": "def-server.CspConfig", + "text": "CspConfig" + } ], - "path": "node_modules/@types/kbn__core-http-server-internal/index.d.ts", + "path": "packages/core/http/core-http-server-internal/src/csp/csp_config.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "core", - "id": "def-server.CspConfig.DEFAULT", + "id": "def-server.CspConfig.directives", "type": "Object", "tags": [], - "label": "DEFAULT", + "label": "#directives", "description": [], "signature": [ - "CspConfig" + "CspDirectives" ], - "path": "node_modules/@types/kbn__core-http-server-internal/index.d.ts", + "path": "packages/core/http/core-http-server-internal/src/csp/csp_config.ts", "deprecated": false, "trackAdoption": false }, @@ -15727,7 +18570,7 @@ "tags": [], "label": "strict", "description": [], - "path": "node_modules/@types/kbn__core-http-server-internal/index.d.ts", + "path": "packages/core/http/core-http-server-internal/src/csp/csp_config.ts", "deprecated": false, "trackAdoption": false }, @@ -15738,7 +18581,7 @@ "tags": [], "label": "warnLegacyBrowsers", "description": [], - "path": "node_modules/@types/kbn__core-http-server-internal/index.d.ts", + "path": "packages/core/http/core-http-server-internal/src/csp/csp_config.ts", "deprecated": false, "trackAdoption": false }, @@ -15749,7 +18592,7 @@ "tags": [], "label": "disableEmbedding", "description": [], - "path": "node_modules/@types/kbn__core-http-server-internal/index.d.ts", + "path": "packages/core/http/core-http-server-internal/src/csp/csp_config.ts", "deprecated": false, "trackAdoption": false }, @@ -15760,7 +18603,7 @@ "tags": [], "label": "header", "description": [], - "path": "node_modules/@types/kbn__core-http-server-internal/index.d.ts", + "path": "packages/core/http/core-http-server-internal/src/csp/csp_config.ts", "deprecated": false, "trackAdoption": false } @@ -15775,14 +18618,32 @@ "label": "EventLoopDelaysMonitor", "description": [], "signature": [ - "EventLoopDelaysMonitor", + { + "pluginId": "@kbn/core-metrics-collectors-server-internal", + "scope": "server", + "docId": "kibKbnCoreMetricsCollectorsServerInternalPluginApi", + "section": "def-server.EventLoopDelaysMonitor", + "text": "EventLoopDelaysMonitor" + }, " implements ", - "IEventLoopDelaysMonitor", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.IEventLoopDelaysMonitor", + "text": "IEventLoopDelaysMonitor" + }, "<", - "IntervalHistogram", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.IntervalHistogram", + "text": "IntervalHistogram" + }, ">" ], - "path": "node_modules/@types/kbn__core-metrics-collectors-server-internal/index.d.ts", + "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/event_loop_delays_monitor.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -15798,7 +18659,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-metrics-collectors-server-internal/index.d.ts", + "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/event_loop_delays_monitor.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -15811,13 +18672,19 @@ "tags": [], "label": "collect", "description": [ - "\nCollect gathers event loop delays metrics from nodejs perf_hooks.monitorEventLoopDelay\nthe histogram calculations start from the last time `reset` was called or this\nEventLoopDelaysMonitor instance was created.\n\nReturns metrics in milliseconds.\n " + "\nCollect gathers event loop delays metrics from nodejs perf_hooks.monitorEventLoopDelay\nthe histogram calculations start from the last time `reset` was called or this\nEventLoopDelaysMonitor instance was created.\n\nReturns metrics in milliseconds." ], "signature": [ "() => ", - "IntervalHistogram" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.IntervalHistogram", + "text": "IntervalHistogram" + } ], - "path": "node_modules/@types/kbn__core-metrics-collectors-server-internal/index.d.ts", + "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/event_loop_delays_monitor.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -15835,7 +18702,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-metrics-collectors-server-internal/index.d.ts", + "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/event_loop_delays_monitor.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -15853,7 +18720,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-metrics-collectors-server-internal/index.d.ts", + "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/event_loop_delays_monitor.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -15872,11 +18739,23 @@ "\nError to return when the validation is not successful." ], "signature": [ - "RouteValidationError", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidationError", + "text": "RouteValidationError" + }, " extends ", - "SchemaTypeError" + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.SchemaTypeError", + "text": "SchemaTypeError" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -15890,7 +18769,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -15904,7 +18783,7 @@ "signature": [ "string | Error" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -15917,12 +18796,12 @@ "label": "path", "description": [], "signature": [ - "string[] | undefined" + "string[]" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -15937,10 +18816,7 @@ "tags": [], "label": "SavedObjectsErrorHelpers", "description": [], - "signature": [ - "SavedObjectsErrorHelpers" - ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -15953,9 +18829,15 @@ "description": [], "signature": [ "(error: any) => error is ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -15969,7 +18851,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -15986,9 +18868,15 @@ "description": [], "signature": [ "(error: Error, reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16002,7 +18890,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16017,7 +18905,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16034,9 +18922,15 @@ "description": [], "signature": [ "(reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16050,7 +18944,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16067,9 +18961,15 @@ "description": [], "signature": [ "(type: string) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16083,7 +18983,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16100,10 +19000,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16116,9 +19022,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16135,9 +19047,15 @@ "description": [], "signature": [ "(versionInput?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16151,7 +19069,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16168,10 +19086,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16184,9 +19108,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16203,9 +19133,15 @@ "description": [], "signature": [ "(error: Error, reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16219,7 +19155,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16234,7 +19170,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16251,10 +19187,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16267,9 +19209,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16286,9 +19234,15 @@ "description": [], "signature": [ "(error: Error, reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16302,7 +19256,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16317,7 +19271,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16334,10 +19288,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16350,9 +19310,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16369,9 +19335,15 @@ "description": [], "signature": [ "(error: Error, reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16385,7 +19357,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16400,7 +19372,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16417,10 +19389,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16433,9 +19411,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16451,10 +19435,16 @@ "label": "createGenericNotFoundError", "description": [], "signature": [ - "(type?: string | null | undefined, id?: string | null | undefined) => ", - "DecoratedError" + "(type?: string | null, id?: string | null) => ", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16466,9 +19456,9 @@ "label": "type", "description": [], "signature": [ - "string | null | undefined" + "string | null" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16481,9 +19471,9 @@ "label": "id", "description": [], "signature": [ - "string | null | undefined" + "string | null" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16500,9 +19490,15 @@ "description": [], "signature": [ "(alias: string) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16516,7 +19512,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16533,9 +19529,15 @@ "description": [], "signature": [ "(error: Error, alias: string) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16549,7 +19551,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16564,7 +19566,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16581,10 +19583,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16597,9 +19605,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16616,9 +19630,15 @@ "description": [], "signature": [ "(error: Error, reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16632,7 +19652,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16647,7 +19667,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16664,9 +19684,15 @@ "description": [], "signature": [ "(type: string, id: string, reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16680,7 +19706,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16695,7 +19721,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16710,7 +19736,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16727,10 +19753,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16743,9 +19775,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16762,9 +19800,15 @@ "description": [], "signature": [ "(error: Error, reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16778,7 +19822,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16793,7 +19837,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16810,9 +19854,15 @@ "description": [], "signature": [ "(type: string, id: string) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16826,7 +19876,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16841,7 +19891,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16858,10 +19908,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16874,9 +19930,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16893,9 +19955,15 @@ "description": [], "signature": [ "(error: Error, reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16909,7 +19977,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16924,7 +19992,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -16941,10 +20009,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16957,9 +20031,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -16976,9 +20056,15 @@ "description": [], "signature": [ "(error: Error, reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -16992,7 +20078,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17007,7 +20093,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -17024,10 +20110,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17040,9 +20132,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17059,9 +20157,15 @@ "description": [], "signature": [ "(error: Error, reason?: string | undefined) => ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17075,7 +20179,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17090,7 +20194,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -17107,10 +20211,16 @@ "description": [], "signature": [ "(error: Error | ", - "DecoratedError", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17123,9 +20233,15 @@ "description": [], "signature": [ "Error | ", - "DecoratedError" + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17141,10 +20257,16 @@ "label": "createGenericNotFoundEsUnavailableError", "description": [], "signature": [ - "(type?: string | null | undefined, id?: string | null | undefined) => ", - "DecoratedError" + "(type?: string | null, id?: string | null) => ", + { + "pluginId": "@kbn/core-saved-objects-utils-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsUtilsServerPluginApi", + "section": "def-server.DecoratedError", + "text": "DecoratedError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17156,9 +20278,9 @@ "label": "type", "description": [], "signature": [ - "string | null | undefined" + "string | null" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -17171,9 +20293,9 @@ "label": "id", "description": [], "signature": [ - "string | null | undefined" + "string | null" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -17192,38 +20314,19 @@ "label": "SavedObjectsExportError", "description": [], "signature": [ - "SavedObjectsExportError", + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsExportError", + "text": "SavedObjectsExportError" + }, " extends Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsExportError.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsExportError.attributes", - "type": "Object", - "tags": [], - "label": "attributes", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "core", "id": "def-server.SavedObjectsExportError.Unnamed", @@ -17234,7 +20337,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17248,7 +20351,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17263,7 +20366,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17278,7 +20381,7 @@ "signature": [ "Record | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -17295,9 +20398,15 @@ "description": [], "signature": [ "(limit: number) => ", - "SavedObjectsExportError" + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsExportError", + "text": "SavedObjectsExportError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17311,7 +20420,7 @@ "signature": [ "number" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17328,11 +20437,23 @@ "description": [], "signature": [ "(objects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]) => ", - "SavedObjectsExportError" + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsExportError", + "text": "SavedObjectsExportError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17344,10 +20465,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17366,11 +20493,23 @@ ], "signature": [ "(objects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[], cause: Error) => ", - "SavedObjectsExportError" + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsExportError", + "text": "SavedObjectsExportError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17382,10 +20521,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17400,7 +20545,7 @@ "signature": [ "Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17419,9 +20564,15 @@ ], "signature": [ "(objectKeys: string[]) => ", - "SavedObjectsExportError" + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsExportError", + "text": "SavedObjectsExportError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17435,7 +20586,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17454,38 +20605,19 @@ "label": "SavedObjectsImportError", "description": [], "signature": [ - "SavedObjectsImportError", + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsImportError", + "text": "SavedObjectsImportError" + }, " extends Error" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsImportError.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsImportError.attributes", - "type": "Object", - "tags": [], - "label": "attributes", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "core", "id": "def-server.SavedObjectsImportError.importSizeExceeded", @@ -17495,9 +20627,15 @@ "description": [], "signature": [ "(limit: number) => ", - "SavedObjectsImportError" + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsImportError", + "text": "SavedObjectsImportError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17511,7 +20649,7 @@ "signature": [ "number" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17528,9 +20666,15 @@ "description": [], "signature": [ "(nonUniqueEntries: string[]) => ", - "SavedObjectsImportError" + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsImportError", + "text": "SavedObjectsImportError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17544,7 +20688,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17561,9 +20705,15 @@ "description": [], "signature": [ "(nonUniqueRetryObjects: string[]) => ", - "SavedObjectsImportError" + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsImportError", + "text": "SavedObjectsImportError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17577,7 +20727,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17594,9 +20744,15 @@ "description": [], "signature": [ "(nonUniqueRetryDestinations: string[]) => ", - "SavedObjectsImportError" + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsImportError", + "text": "SavedObjectsImportError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17610,7 +20766,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17627,11 +20783,23 @@ "description": [], "signature": [ "(objects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]) => ", - "SavedObjectsImportError" + { + "pluginId": "@kbn/core-saved-objects-import-export-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsImportExportServerInternalPluginApi", + "section": "def-server.SavedObjectsImportError", + "text": "SavedObjectsImportError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17643,10 +20811,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-import-export-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17665,11 +20839,23 @@ "label": "SavedObjectsRepository", "description": [], "signature": [ - "SavedObjectsRepository", + { + "pluginId": "@kbn/core-saved-objects-api-server-internal", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerInternalPluginApi", + "section": "def-server.SavedObjectsRepository", + "text": "SavedObjectsRepository" + }, " implements ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17684,12 +20870,24 @@ ], "signature": [ "(type: string, attributes: T, options?: ", - "SavedObjectsCreateOptions", - " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17703,7 +20901,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17718,7 +20916,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17731,13 +20929,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCreateOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -17753,14 +20956,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "[], options?: ", - "SavedObjectsCreateOptions", - " | undefined) => Promise<", - "SavedObjectsBulkResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17772,10 +20993,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17788,13 +21015,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCreateOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -17810,14 +21042,32 @@ ], "signature": [ "(objects?: ", - "SavedObjectsCheckConflictsObject", - "[] | undefined, options?: ", - "SavedObjectsBaseOptions", - " | undefined) => Promise<", - "SavedObjectsCheckConflictsResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsObject", + "text": "SavedObjectsCheckConflictsObject" + }, + "[], options?: ", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsResponse", + "text": "SavedObjectsCheckConflictsResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17829,13 +21079,19 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsCheckConflictsObject", - "[] | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsObject", + "text": "SavedObjectsCheckConflictsObject" + }, + "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true }, { "parentPluginId": "core", @@ -17845,13 +21101,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -17867,10 +21128,16 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsDeleteOptions", - " | undefined) => Promise<{}>" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + }, + ") => Promise<{}>" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17884,7 +21151,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17899,7 +21166,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17912,13 +21179,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsDeleteOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -17934,14 +21206,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkDeleteObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteObject", + "text": "SavedObjectsBulkDeleteObject" + }, "[], options?: ", - "SavedObjectsBulkDeleteOptions", - " | undefined) => Promise<", - "SavedObjectsBulkDeleteResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteResponse", + "text": "SavedObjectsBulkDeleteResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -17953,10 +21243,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkDeleteObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteObject", + "text": "SavedObjectsBulkDeleteObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -17969,13 +21265,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBulkDeleteOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -17991,10 +21292,16 @@ ], "signature": [ "(namespace: string, options?: ", - "SavedObjectsDeleteByNamespaceOptions", - " | undefined) => Promise" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteByNamespaceOptions", + "text": "SavedObjectsDeleteByNamespaceOptions" + }, + ") => Promise" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18008,7 +21315,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18021,13 +21328,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsDeleteByNamespaceOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteByNamespaceOptions", + "text": "SavedObjectsDeleteByNamespaceOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -18043,12 +21355,24 @@ ], "signature": [ "(options: ", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ") => Promise<", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18060,9 +21384,15 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsFindOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18081,14 +21411,32 @@ ], "signature": [ "(objects?: ", - "SavedObjectsBulkGetObject", - "[] | undefined, options?: ", - "SavedObjectsBaseOptions", - " | undefined) => Promise<", - "SavedObjectsBulkResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkGetObject", + "text": "SavedObjectsBulkGetObject" + }, + "[], options?: ", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18100,13 +21448,19 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkGetObject", - "[] | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkGetObject", + "text": "SavedObjectsBulkGetObject" + }, + "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true }, { "parentPluginId": "core", @@ -18116,13 +21470,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -18138,14 +21497,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkResolveObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveObject", + "text": "SavedObjectsBulkResolveObject" + }, "[], options?: ", - "SavedObjectsBaseOptions", - " | undefined) => Promise<", - "SavedObjectsBulkResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveResponse", + "text": "SavedObjectsBulkResolveResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18157,10 +21534,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkResolveObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveObject", + "text": "SavedObjectsBulkResolveObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18173,13 +21556,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -18195,12 +21583,24 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsBaseOptions", - " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18214,7 +21614,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18229,7 +21629,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18242,13 +21642,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -18264,12 +21669,24 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsBaseOptions", - " | undefined) => Promise<", - "SavedObjectsResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsResolveResponse", + "text": "SavedObjectsResolveResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18283,7 +21700,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18298,7 +21715,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18311,13 +21728,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -18333,12 +21755,24 @@ ], "signature": [ "(type: string, id: string, attributes: Partial, options?: ", - "SavedObjectsUpdateOptions", - " | undefined) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18352,7 +21786,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18367,7 +21801,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18382,7 +21816,7 @@ "signature": [ "Partial" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18395,13 +21829,19 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsUpdateOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -18417,14 +21857,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsCollectMultiNamespaceReferencesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesObject", + "text": "SavedObjectsCollectMultiNamespaceReferencesObject" + }, "[], options?: ", - "SavedObjectsCollectMultiNamespaceReferencesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesOptions", + "text": "SavedObjectsCollectMultiNamespaceReferencesOptions" + }, " | undefined) => Promise<", - "SavedObjectsCollectMultiNamespaceReferencesResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesResponse", + "text": "SavedObjectsCollectMultiNamespaceReferencesResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18436,10 +21894,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesObject", + "text": "SavedObjectsCollectMultiNamespaceReferencesObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18452,10 +21916,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesOptions", + "text": "SavedObjectsCollectMultiNamespaceReferencesOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -18474,14 +21944,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsUpdateObjectsSpacesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesObject", + "text": "SavedObjectsUpdateObjectsSpacesObject" + }, "[], spacesToAdd: string[], spacesToRemove: string[], options?: ", - "SavedObjectsUpdateObjectsSpacesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesOptions", + "text": "SavedObjectsUpdateObjectsSpacesOptions" + }, " | undefined) => Promise<", - "SavedObjectsUpdateObjectsSpacesResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesResponse", + "text": "SavedObjectsUpdateObjectsSpacesResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18493,10 +21981,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsUpdateObjectsSpacesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesObject", + "text": "SavedObjectsUpdateObjectsSpacesObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18511,7 +22005,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18526,7 +22020,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18539,10 +22033,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsUpdateObjectsSpacesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesOptions", + "text": "SavedObjectsUpdateObjectsSpacesOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -18561,14 +22061,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "[], options?: ", - "SavedObjectsBulkUpdateOptions", - " | undefined) => Promise<", - "SavedObjectsBulkUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateOptions", + "text": "SavedObjectsBulkUpdateOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateResponse", + "text": "SavedObjectsBulkUpdateResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18580,10 +22098,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18596,13 +22120,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBulkUpdateOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateOptions", + "text": "SavedObjectsBulkUpdateOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -18618,12 +22147,24 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsRemoveReferencesToOptions", - " | undefined) => Promise<", - "SavedObjectsRemoveReferencesToResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToOptions", + "text": "SavedObjectsRemoveReferencesToOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToResponse", + "text": "SavedObjectsRemoveReferencesToResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18637,7 +22178,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18652,7 +22193,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18665,13 +22206,18 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsRemoveReferencesToOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToOptions", + "text": "SavedObjectsRemoveReferencesToOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -18687,14 +22233,32 @@ ], "signature": [ "(type: string, id: string, counterFields: (string | ", - "SavedObjectsIncrementCounterField", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterField", + "text": "SavedObjectsIncrementCounterField" + }, ")[], options?: ", - "SavedObjectsIncrementCounterOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterOptions", + "text": "SavedObjectsIncrementCounterOptions" + }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18708,7 +22272,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18723,7 +22287,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18737,10 +22301,16 @@ "description": [], "signature": [ "(string | ", - "SavedObjectsIncrementCounterField", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterField", + "text": "SavedObjectsIncrementCounterField" + }, ")[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18753,10 +22323,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsIncrementCounterOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterOptions", + "text": "SavedObjectsIncrementCounterOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -18775,12 +22351,24 @@ ], "signature": [ "(type: string | string[], { keepAlive, preference }?: ", - "SavedObjectsOpenPointInTimeOptions", - " | undefined) => Promise<", - "SavedObjectsOpenPointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeOptions", + "text": "SavedObjectsOpenPointInTimeOptions" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeResponse", + "text": "SavedObjectsOpenPointInTimeResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18794,7 +22382,7 @@ "signature": [ "string | string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18804,16 +22392,21 @@ "id": "def-server.SavedObjectsRepository.openPointInTimeForType.$2", "type": "Object", "tags": [], - "label": "{ keepAlive, preference }", + "label": "{ keepAlive = '5m', preference }", "description": [], "signature": [ - "SavedObjectsOpenPointInTimeOptions", - " | undefined" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeOptions", + "text": "SavedObjectsOpenPointInTimeOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -18829,12 +22422,24 @@ ], "signature": [ "(id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsClosePointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClosePointInTimeResponse", + "text": "SavedObjectsClosePointInTimeResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18848,7 +22453,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18861,10 +22466,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -18883,14 +22494,32 @@ ], "signature": [ "(findOptions: ", - "SavedObjectsCreatePointInTimeFinderOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + }, ", dependencies?: ", - "SavedObjectsCreatePointInTimeFinderDependencies", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, " | undefined) => ", - "ISavedObjectsPointInTimeFinder", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsPointInTimeFinder", + "text": "ISavedObjectsPointInTimeFinder" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18902,9 +22531,15 @@ "label": "findOptions", "description": [], "signature": [ - "SavedObjectsCreatePointInTimeFinderOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -18917,10 +22552,16 @@ "label": "dependencies", "description": [], "signature": [ - "SavedObjectsCreatePointInTimeFinderDependencies", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server-internal/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -18938,10 +22579,7 @@ "tags": [], "label": "SavedObjectsUtils", "description": [], - "signature": [ - "SavedObjectsUtils" - ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -18957,10 +22595,9 @@ "signature": [ "(namespace?: string | undefined) => string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, - "returnComment": [], "children": [ { "parentPluginId": "core", @@ -18974,11 +22611,13 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": false } - ] + ], + "returnComment": [] }, { "parentPluginId": "core", @@ -18992,10 +22631,9 @@ "signature": [ "(namespace: string) => string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, - "returnComment": [], "children": [ { "parentPluginId": "core", @@ -19006,11 +22644,16 @@ "description": [ "The namespace string, which must be non-empty." ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "signature": [ + "string" + ], + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true } - ] + ], + "returnComment": [] }, { "parentPluginId": "core", @@ -19023,31 +22666,50 @@ ], "signature": [ "({ page, perPage, }: ", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ") => ", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, - "returnComment": [], "children": [ { "parentPluginId": "core", "id": "def-server.SavedObjectsUtils.createEmptyFindResponse.$1", "type": "Object", "tags": [], - "label": "__0", + "label": "{\n page = FIND_DEFAULT_PAGE,\n perPage = FIND_DEFAULT_PER_PAGE,\n }", "description": [], "signature": [ - "SavedObjectsFindOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true } - ] + ], + "returnComment": [] }, { "parentPluginId": "core", @@ -19061,7 +22723,7 @@ "signature": [ "() => string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -19081,7 +22743,7 @@ "signature": [ "(id: string | undefined) => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -19097,7 +22759,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -19117,7 +22779,7 @@ "signature": [ "(namespace: string | undefined, type: string, id: string) => string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -19133,7 +22795,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -19150,7 +22812,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -19167,7 +22829,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -19193,16 +22855,33 @@ ], "signature": [ "(map1: ", - "SavedObjectMigrationMap", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + }, ", map2: ", - "SavedObjectMigrationMap", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + }, ") => ", - "SavedObjectMigrationMap" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.ts", "deprecated": false, "trackAdoption": false, - "returnComment": [], "children": [ { "parentPluginId": "core", @@ -19212,11 +22891,18 @@ "label": "map1", "description": [], "signature": [ - "SavedObjectMigrationMap" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true }, { "parentPluginId": "core", @@ -19226,13 +22912,21 @@ "label": "map2", "description": [], "signature": [ - "SavedObjectMigrationMap" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-utils-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false }, { @@ -19244,283 +22938,249 @@ "description": [], "signature": [ "({ internalClient, log, kibanaVersion, ignoreVersionMismatch, esVersionCheckInterval: healthCheckInterval, }: ", - "PollEsNodesVersionOptions", + { + "pluginId": "@kbn/core-elasticsearch-server-internal", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerInternalPluginApi", + "section": "def-server.PollEsNodesVersionOptions", + "text": "PollEsNodesVersionOptions" + }, ") => ", "Observable", "<", - "NodesVersionCompatibility", + { + "pluginId": "@kbn/core-elasticsearch-server-internal", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerInternalPluginApi", + "section": "def-server.NodesVersionCompatibility", + "text": "NodesVersionCompatibility" + }, ">" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false, - "returnComment": [], "children": [ { "parentPluginId": "core", "id": "def-server.pollEsNodesVersion.$1", "type": "Object", "tags": [], - "label": "__0", + "label": "{\n internalClient,\n log,\n kibanaVersion,\n ignoreVersionMismatch,\n esVersionCheckInterval: healthCheckInterval,\n}", "description": [], "signature": [ - "PollEsNodesVersionOptions" + { + "pluginId": "@kbn/core-elasticsearch-server-internal", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerInternalPluginApi", + "section": "def-server.PollEsNodesVersionOptions", + "text": "PollEsNodesVersionOptions" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false } ], "interfaces": [ { "parentPluginId": "core", - "id": "def-server.AnalyticsClient", + "id": "def-server.AppCategory", "type": "Interface", "tags": [], - "label": "AnalyticsClient", + "label": "AppCategory", "description": [ - "\nAnalytics client's public APIs" - ], - "signature": [ - "AnalyticsClient" + "\nA category definition for nav links to know where to sort them in the left hand nav" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/application/core-application-common/src/app_category.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-server.AnalyticsClient.reportEvent", - "type": "Function", - "tags": [ - "track-adoption" + "id": "def-server.AppCategory.id", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "\nUnique identifier for the categories" ], - "label": "reportEvent", + "path": "packages/core/application/core-application-common/src/app_category.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.AppCategory.label", + "type": "string", + "tags": [], + "label": "label", "description": [ - "\nReports a telemetry event." + "\nLabel used for category name.\nAlso used as aria-label if one isn't set." + ], + "path": "packages/core/application/core-application-common/src/app_category.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.AppCategory.ariaLabel", + "type": "string", + "tags": [], + "label": "ariaLabel", + "description": [ + "\nIf the visual label isn't appropriate for screen readers,\ncan override it here" ], "signature": [ - "(eventType: string, eventData: EventTypeData) => void" + "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/application/core-application-common/src/app_category.ts", "deprecated": false, - "trackAdoption": true, - "references": [ - { - "plugin": "security", - "path": "x-pack/plugins/security/server/analytics/analytics_service.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/analytics/types.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/analytics/analytics_service.ts" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/fleet_usage_sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "@kbn/ebt-tools", - "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/analytics/analytics_service.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/analytics/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-server-mocks", - "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/analytics/analytics.stub.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-mocks", - "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-mocks", - "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-analytics-server-mocks", - "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-analytics-server-mocks", - "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" - }, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.AppCategory.order", + "type": "number", + "tags": [], + "label": "order", + "description": [ + "\nThe order that categories will be sorted in\nPrefer large steps between categories to allow for further editing\n(Default categories are in steps of 1000)" + ], + "signature": [ + "number | undefined" + ], + "path": "packages/core/application/core-application-common/src/app_category.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.AppCategory.euiIconType", + "type": "string", + "tags": [], + "label": "euiIconType", + "description": [ + "\nDefine an icon to be used for the category\nIf the category is only 1 item, and no icon is defined, will default to the product icon\nDefaults to initials if no icon is defined" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/application/core-application-common/src/app_category.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.AsyncPlugin", + "type": "Interface", + "tags": [ + "deprecated" + ], + "label": "AsyncPlugin", + "description": [ + "\nA plugin with asynchronous lifecycle methods.\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.AsyncPlugin", + "text": "AsyncPlugin" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": true, + "removeBy": "8.8.0", + "trackAdoption": false, + "references": [ + { + "plugin": "@kbn/core-plugins-server", + "path": "packages/core/plugins/core-plugins-server/src/types.ts" + }, + { + "plugin": "@kbn/core-plugins-server", + "path": "packages/core/plugins/core-plugins-server/src/index.ts" + }, + { + "plugin": "@kbn/core-plugins-server", + "path": "packages/core/plugins/core-plugins-server/index.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin.ts" + } + ], + "children": [ + { + "parentPluginId": "core", + "id": "def-server.AsyncPlugin.setup", + "type": "Function", + "tags": [], + "label": "setup", + "description": [], + "signature": [ + "(core: ", { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts" - } + ", plugins: TPluginsSetup) => TSetup | Promise" ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-server.AnalyticsClient.reportEvent.$1", - "type": "string", + "id": "def-server.AsyncPlugin.setup.$1", + "type": "Object", "tags": [], - "label": "eventType", - "description": [ - "The event type registered via the `registerEventType` API." - ], + "label": "core", + "description": [], "signature": [ - "string" + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true }, { "parentPluginId": "core", - "id": "def-server.AnalyticsClient.reportEvent.$2", + "id": "def-server.AsyncPlugin.setup.$2", "type": "Uncategorized", "tags": [], - "label": "eventData", - "description": [ - "The properties matching the schema declared in the `registerEventType` API." - ], + "label": "plugins", + "description": [], "signature": [ - "EventTypeData" + "TPluginsSetup" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -19530,565 +23190,282 @@ }, { "parentPluginId": "core", - "id": "def-server.AnalyticsClient.registerEventType", + "id": "def-server.AsyncPlugin.start", "type": "Function", "tags": [], - "label": "registerEventType", - "description": [ - "\nRegisters the event type that will be emitted via the reportEvent API." - ], + "label": "start", + "description": [], "signature": [ - "(eventTypeOps: ", - "EventTypeOpts", - ") => void" + "(core: ", + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + }, + ", plugins: TPluginsStart) => TStart | Promise" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-server.AnalyticsClient.registerEventType.$1", + "id": "def-server.AsyncPlugin.start.$1", "type": "Object", "tags": [], - "label": "eventTypeOps", - "description": [ - "The definition of the event type {@link EventTypeOpts }." - ], - "signature": [ - "EventTypeOpts", - "" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-server.AnalyticsClient.registerShipper", - "type": "Function", - "tags": [], - "label": "registerShipper", - "description": [ - "\nSet up the shipper that will be used to report the telemetry events." - ], - "signature": [ - "(Shipper: ", - "ShipperClassConstructor", - ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", - " | undefined) => void" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.AnalyticsClient.registerShipper.$1", - "type": "Object", - "tags": [], - "label": "Shipper", - "description": [ - "The {@link IShipper } class to instantiate the shipper." - ], + "label": "core", + "description": [], "signature": [ - "ShipperClassConstructor", - "" + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + } ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true }, { "parentPluginId": "core", - "id": "def-server.AnalyticsClient.registerShipper.$2", + "id": "def-server.AsyncPlugin.start.$2", "type": "Uncategorized", "tags": [], - "label": "shipperConfig", - "description": [ - "The config specific to the Shipper to instantiate." - ], + "label": "plugins", + "description": [], "signature": [ - "ShipperConfig" + "TPluginsStart" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true - }, - { - "parentPluginId": "core", - "id": "def-server.AnalyticsClient.registerShipper.$3", - "type": "Object", - "tags": [], - "label": "opts", - "description": [ - "Additional options to register the shipper {@link RegisterShipperOpts }." - ], - "signature": [ - "RegisterShipperOpts", - " | undefined" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false } ], "returnComment": [] }, { "parentPluginId": "core", - "id": "def-server.AnalyticsClient.optIn", + "id": "def-server.AsyncPlugin.stop", "type": "Function", "tags": [], - "label": "optIn", - "description": [ - "\nUsed to control the user's consent to report the data.\nIn the advanced mode, it allows to \"cherry-pick\" which events and shippers are enabled/disabled." - ], + "label": "stop", + "description": [], "signature": [ - "(optInConfig: ", - "OptInConfig", - ") => void" + "(() => void) | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.AnalyticsClient.optIn.$1", - "type": "Object", - "tags": [], - "label": "optInConfig", - "description": [ - "{@link OptInConfig }" - ], - "signature": [ - "OptInConfig" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-server.AnalyticsClient.registerContextProvider", - "type": "Function", - "tags": [ - "track-adoption" - ], - "label": "registerContextProvider", - "description": [ - "\nRegisters the context provider to enrich any reported events." - ], - "signature": [ - "(contextProviderOpts: ", - "ContextProviderOpts", - ") => void" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": true, - "references": [ - { - "plugin": "licensing", - "path": "x-pack/plugins/licensing/common/register_analytics_context_provider.ts" - }, - { - "plugin": "cloud", - "path": "x-pack/plugins/cloud/common/register_cloud_deployment_id_analytics_context.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.ts" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/public/plugin.ts" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/server/plugin.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-elasticsearch-server-internal", - "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.ts" - }, - { - "plugin": "@kbn/core-environment-server-internal", - "path": "packages/core/environment/core-environment-server-internal/src/environment_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-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/analytics_service.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/analytics_service.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-mocks", - "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-execution-context-browser-internal", - "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.test.ts" - }, - { - "plugin": "@kbn/core-execution-context-browser-internal", - "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-server-mocks", - "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-analytics-server-mocks", - "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" - }, - { - "plugin": "@kbn/core-elasticsearch-server-internal", - "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.test.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" - }, - { - "plugin": "@kbn/core-status-server-internal", - "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.ts" - }, - { - "plugin": "@kbn/core-analytics-server-internal", - "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.ts" - } - ], - "children": [ - { - "parentPluginId": "core", - "id": "def-server.AnalyticsClient.registerContextProvider.$1", - "type": "Object", - "tags": [], - "label": "contextProviderOpts", - "description": [ - "{@link ContextProviderOpts }" - ], - "signature": [ - "ContextProviderOpts", - "" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], + "children": [], "returnComment": [] - }, + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.AuthRedirectedParams", + "type": "Interface", + "tags": [], + "label": "AuthRedirectedParams", + "description": [ + "\nResult of auth redirection." + ], + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "core", - "id": "def-server.AnalyticsClient.removeContextProvider", - "type": "Function", + "id": "def-server.AuthRedirectedParams.headers", + "type": "CompoundType", "tags": [], - "label": "removeContextProvider", + "label": "headers", "description": [ - "\nRemoves the context provider and stop enriching the events from its context." + "\nHeaders to attach for auth redirect.\nMust include \"location\" header" ], "signature": [ - "(contextProviderName: string) => void" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + "{ location: string; } & ", { - "parentPluginId": "core", - "id": "def-server.AnalyticsClient.removeContextProvider.$1", - "type": "string", - "tags": [], - "label": "contextProviderName", - "description": [ - "The name of the context provider to remove." - ], - "signature": [ - "string" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseHeaders", + "text": "ResponseHeaders" } ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-server.AnalyticsClient.telemetryCounter$", - "type": "Object", - "tags": [], - "label": "telemetryCounter$", - "description": [ - "\nObservable to emit the stats of the processed events." - ], - "signature": [ - "Observable", - "<", - "TelemetryCounter", - ">" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-server.AnalyticsClient.shutdown", - "type": "Function", - "tags": [], - "label": "shutdown", - "description": [ - "\nStops the client." - ], - "signature": [ - "() => void" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] } ], "initialIsOpen": false }, { "parentPluginId": "core", - "id": "def-server.AppCategory", + "id": "def-server.AuthResultAuthenticated", "type": "Interface", "tags": [], - "label": "AppCategory", - "description": [ - "\nA category definition for nav links to know where to sort them in the left hand nav" - ], + "label": "AuthResultAuthenticated", + "description": [], "signature": [ - "AppCategory" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultAuthenticated", + "text": "AuthResultAuthenticated" + }, + " extends ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultParams", + "text": "AuthResultParams" + } ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-server.AppCategory.id", + "id": "def-server.AuthResultAuthenticated.type", "type": "string", "tags": [], - "label": "id", - "description": [ - "\nUnique identifier for the categories" + "label": "type", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultType", + "text": "AuthResultType" + }, + ".authenticated" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false - }, + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.AuthResultNotHandled", + "type": "Interface", + "tags": [], + "label": "AuthResultNotHandled", + "description": [], + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "core", - "id": "def-server.AppCategory.label", + "id": "def-server.AuthResultNotHandled.type", "type": "string", "tags": [], - "label": "label", - "description": [ - "\nLabel used for category name.\nAlso used as aria-label if one isn't set." + "label": "type", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultType", + "text": "AuthResultType" + }, + ".notHandled" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false - }, + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.AuthResultParams", + "type": "Interface", + "tags": [], + "label": "AuthResultParams", + "description": [ + "\nResult of successful authentication." + ], + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "core", - "id": "def-server.AppCategory.ariaLabel", - "type": "string", + "id": "def-server.AuthResultParams.state", + "type": "Object", "tags": [], - "label": "ariaLabel", + "label": "state", "description": [ - "\nIf the visual label isn't appropriate for screen readers,\ncan override it here" + "\nData to associate with an incoming request. Any downstream plugin may get access to the data." ], "signature": [ - "string | undefined" + "Record | undefined" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "core", - "id": "def-server.AppCategory.order", - "type": "number", + "id": "def-server.AuthResultParams.requestHeaders", + "type": "Object", "tags": [], - "label": "order", + "label": "requestHeaders", "description": [ - "\nThe order that categories will be sorted in\nPrefer large steps between categories to allow for further editing\n(Default categories are in steps of 1000)" + "\nAuth specific headers to attach to a request object.\nUsed to perform a request to Elasticsearch on behalf of an authenticated user." ], "signature": [ - "number | undefined" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthHeaders", + "text": "AuthHeaders" + }, + " | undefined" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "core", - "id": "def-server.AppCategory.euiIconType", - "type": "string", + "id": "def-server.AuthResultParams.responseHeaders", + "type": "Object", "tags": [], - "label": "euiIconType", + "label": "responseHeaders", "description": [ - "\nDefine an icon to be used for the category\nIf the category is only 1 item, and no icon is defined, will default to the product icon\nDefaults to initials if no icon is defined" + "\nAuth specific headers to attach to a response object.\nUsed to send back authentication mechanism related headers to a client when needed." ], "signature": [ - "string | undefined" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthHeaders", + "text": "AuthHeaders" + }, + " | undefined" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false } @@ -20097,357 +23474,29 @@ }, { "parentPluginId": "core", - "id": "def-server.AsyncPlugin", - "type": "Interface", - "tags": [ - "deprecated" - ], - "label": "AsyncPlugin", - "description": [ - "\nA plugin with asynchronous lifecycle methods.\n" - ], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.AsyncPlugin", - "text": "AsyncPlugin" - }, - "" - ], - "path": "src/core/server/plugins/types.ts", - "deprecated": true, - "removeBy": "8.8.0", - "trackAdoption": false, - "references": [], - "children": [ - { - "parentPluginId": "core", - "id": "def-server.AsyncPlugin.setup", - "type": "Function", - "tags": [], - "label": "setup", - "description": [], - "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreSetup", - "text": "CoreSetup" - }, - ", plugins: TPluginsSetup) => TSetup | Promise" - ], - "path": "src/core/server/plugins/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.AsyncPlugin.setup.$1", - "type": "Object", - "tags": [], - "label": "core", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreSetup", - "text": "CoreSetup" - }, - "" - ], - "path": "src/core/server/plugins/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "core", - "id": "def-server.AsyncPlugin.setup.$2", - "type": "Uncategorized", - "tags": [], - "label": "plugins", - "description": [], - "signature": [ - "TPluginsSetup" - ], - "path": "src/core/server/plugins/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-server.AsyncPlugin.start", - "type": "Function", - "tags": [], - "label": "start", - "description": [], - "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreStart", - "text": "CoreStart" - }, - ", plugins: TPluginsStart) => TStart | Promise" - ], - "path": "src/core/server/plugins/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.AsyncPlugin.start.$1", - "type": "Object", - "tags": [], - "label": "core", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreStart", - "text": "CoreStart" - } - ], - "path": "src/core/server/plugins/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "core", - "id": "def-server.AsyncPlugin.start.$2", - "type": "Uncategorized", - "tags": [], - "label": "plugins", - "description": [], - "signature": [ - "TPluginsStart" - ], - "path": "src/core/server/plugins/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-server.AsyncPlugin.stop", - "type": "Function", - "tags": [], - "label": "stop", - "description": [], - "signature": [ - "(() => void) | undefined" - ], - "path": "src/core/server/plugins/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.AuthRedirectedParams", - "type": "Interface", - "tags": [], - "label": "AuthRedirectedParams", - "description": [ - "\nResult of auth redirection." - ], - "signature": [ - "AuthRedirectedParams" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.AuthRedirectedParams.headers", - "type": "CompoundType", - "tags": [], - "label": "headers", - "description": [ - "\nHeaders to attach for auth redirect.\nMust include \"location\" header" - ], - "signature": [ - "{ location: string; } & ", - "ResponseHeaders" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.AuthResultAuthenticated", - "type": "Interface", - "tags": [], - "label": "AuthResultAuthenticated", - "description": [], - "signature": [ - "AuthResultAuthenticated", - " extends ", - "AuthResultParams" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.AuthResultAuthenticated.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "AuthResultType", - ".authenticated" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.AuthResultNotHandled", + "id": "def-server.AuthResultRedirected", "type": "Interface", "tags": [], - "label": "AuthResultNotHandled", + "label": "AuthResultRedirected", "description": [], "signature": [ - "AuthResultNotHandled" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.AuthResultNotHandled.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "AuthResultType", - ".notHandled" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.AuthResultParams", - "type": "Interface", - "tags": [], - "label": "AuthResultParams", - "description": [ - "\nResult of successful authentication." - ], - "signature": [ - "AuthResultParams" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.AuthResultParams.state", - "type": "Object", - "tags": [], - "label": "state", - "description": [ - "\nData to associate with an incoming request. Any downstream plugin may get access to the data." - ], - "signature": [ - "Record | undefined" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, { - "parentPluginId": "core", - "id": "def-server.AuthResultParams.requestHeaders", - "type": "Object", - "tags": [], - "label": "requestHeaders", - "description": [ - "\nAuth specific headers to attach to a request object.\nUsed to perform a request to Elasticsearch on behalf of an authenticated user." - ], - "signature": [ - "AuthHeaders", - " | undefined" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultRedirected", + "text": "AuthResultRedirected" }, + " extends ", { - "parentPluginId": "core", - "id": "def-server.AuthResultParams.responseHeaders", - "type": "Object", - "tags": [], - "label": "responseHeaders", - "description": [ - "\nAuth specific headers to attach to a response object.\nUsed to send back authentication mechanism related headers to a client when needed." - ], - "signature": [ - "AuthHeaders", - " | undefined" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthRedirectedParams", + "text": "AuthRedirectedParams" } ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.AuthResultRedirected", - "type": "Interface", - "tags": [], - "label": "AuthResultRedirected", - "description": [], - "signature": [ - "AuthResultRedirected", - " extends ", - "AuthRedirectedParams" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20459,10 +23508,16 @@ "label": "type", "description": [], "signature": [ - "AuthResultType", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultType", + "text": "AuthResultType" + }, ".redirected" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false } @@ -20476,10 +23531,7 @@ "tags": [], "label": "AuthToolkit", "description": [], - "signature": [ - "AuthToolkit" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20494,11 +23546,23 @@ ], "signature": [ "(data?: ", - "AuthResultParams", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultParams", + "text": "AuthResultParams" + }, " | undefined) => ", - "AuthResult" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResult", + "text": "AuthResult" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20510,10 +23574,16 @@ "label": "data", "description": [], "signature": [ - "AuthResultParams", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultParams", + "text": "AuthResultParams" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -20532,9 +23602,15 @@ ], "signature": [ "() => ", - "AuthResult" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResult", + "text": "AuthResult" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -20551,11 +23627,23 @@ ], "signature": [ "(headers: { location: string; } & ", - "ResponseHeaders", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseHeaders", + "text": "ResponseHeaders" + }, ") => ", - "AuthResult" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResult", + "text": "AuthResult" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20568,9 +23656,15 @@ "description": [], "signature": [ "{ location: string; } & ", - "ResponseHeaders" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseHeaders", + "text": "ResponseHeaders" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -20590,10 +23684,7 @@ "description": [ "\nThe read-only set of capabilities available for the current UI session.\nCapabilities are simple key-value pairs of (string, boolean), where the string denotes the capability ID,\nand the boolean is a flag indicating if the capability is enabled or disabled.\n" ], - "signature": [ - "Capabilities" - ], - "path": "node_modules/@types/kbn__core-capabilities-common/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-common/src/capabilities.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20609,7 +23700,7 @@ "signature": [ "{ [x: string]: boolean; }" ], - "path": "node_modules/@types/kbn__core-capabilities-common/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-common/src/capabilities.ts", "deprecated": false, "trackAdoption": false }, @@ -20625,7 +23716,7 @@ "signature": [ "{ [sectionId: string]: Record; }" ], - "path": "node_modules/@types/kbn__core-capabilities-common/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-common/src/capabilities.ts", "deprecated": false, "trackAdoption": false }, @@ -20641,7 +23732,7 @@ "signature": [ "{ [x: string]: boolean; }" ], - "path": "node_modules/@types/kbn__core-capabilities-common/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-common/src/capabilities.ts", "deprecated": false, "trackAdoption": false }, @@ -20657,7 +23748,7 @@ "signature": [ "[key: string]: Record>" ], - "path": "node_modules/@types/kbn__core-capabilities-common/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-common/src/capabilities.ts", "deprecated": false, "trackAdoption": false } @@ -20673,10 +23764,7 @@ "description": [ "\nAPIs to manage the {@link Capabilities} that will be used by the application.\n\nPlugins relying on capabilities to toggle some of their features should register them during the setup phase\nusing the `registerProvider` method.\n\nPlugins having the responsibility to restrict capabilities depending on a given context should register\ntheir capabilities switcher using the `registerSwitcher` method.\n\nRefers to the methods documentation for complete description and examples.\n" ], - "signature": [ - "CapabilitiesSetup" - ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20691,10 +23779,16 @@ ], "signature": [ "(provider: ", - "CapabilitiesProvider", + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesProvider", + "text": "CapabilitiesProvider" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20706,9 +23800,15 @@ "label": "provider", "description": [], "signature": [ - "CapabilitiesProvider" + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesProvider", + "text": "CapabilitiesProvider" + } ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -20727,10 +23827,16 @@ ], "signature": [ "(switcher: ", - "CapabilitiesSwitcher", + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesSwitcher", + "text": "CapabilitiesSwitcher" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20742,9 +23848,15 @@ "label": "switcher", "description": [], "signature": [ - "CapabilitiesSwitcher" + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesSwitcher", + "text": "CapabilitiesSwitcher" + } ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -20764,10 +23876,7 @@ "description": [ "\nAPIs to access the application {@link Capabilities}.\n" ], - "signature": [ - "CapabilitiesStart" - ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20782,14 +23891,32 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", options?: ", - "ResolveCapabilitiesOptions", + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.ResolveCapabilitiesOptions", + "text": "ResolveCapabilitiesOptions" + }, " | undefined) => Promise<", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, ">" ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20801,10 +23928,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -20817,10 +23950,16 @@ "label": "options", "description": [], "signature": [ - "ResolveCapabilitiesOptions", + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.ResolveCapabilitiesOptions", + "text": "ResolveCapabilitiesOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -20840,10 +23979,7 @@ "description": [ "\nDeprecation context provided to {@link ConfigDeprecation | config deprecations}\n" ], - "signature": [ - "ConfigDeprecationContext" - ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20856,7 +23992,7 @@ "description": [ "The current Kibana version, e.g `7.16.1`, `8.0.0`" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false }, @@ -20869,7 +24005,7 @@ "description": [ "The current Kibana branch, e.g `7.x`, `7.16`, `master`" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false }, @@ -20883,9 +24019,15 @@ "Allow direct access to the doc links from the deprecation handler" ], "signature": [ - "DocLinks" + { + "pluginId": "@kbn/doc-links", + "scope": "common", + "docId": "kibKbnDocLinksPluginApi", + "section": "def-common.DocLinks", + "text": "DocLinks" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false } @@ -20901,10 +24043,7 @@ "description": [ "\nProvides helpers to generates the most commonly used {@link ConfigDeprecation}\nwhen invoking a {@link ConfigDeprecationProvider}.\n\nSee methods documentation for more detailed examples.\n" ], - "signature": [ - "ConfigDeprecationFactory" - ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20921,9 +24060,15 @@ "(deprecatedKey: string, removeBy: string, details: ", "FactoryConfigDeprecationDetails", ") => ", - "ConfigDeprecation" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -20937,7 +24082,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -20952,7 +24097,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -20967,7 +24112,7 @@ "signature": [ "FactoryConfigDeprecationDetails" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -20988,9 +24133,15 @@ "(deprecatedKey: string, removeBy: string, details: ", "FactoryConfigDeprecationDetails", ") => ", - "ConfigDeprecation" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21004,7 +24155,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21019,7 +24170,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21034,7 +24185,7 @@ "signature": [ "FactoryConfigDeprecationDetails" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21055,9 +24206,15 @@ "(oldKey: string, newKey: string, details: ", "FactoryConfigDeprecationDetails", ") => ", - "ConfigDeprecation" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21071,7 +24228,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21086,7 +24243,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21101,7 +24258,7 @@ "signature": [ "FactoryConfigDeprecationDetails" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21122,9 +24279,15 @@ "(oldKey: string, newKey: string, details: ", "FactoryConfigDeprecationDetails", ") => ", - "ConfigDeprecation" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21138,7 +24301,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21153,7 +24316,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21168,7 +24331,7 @@ "signature": [ "FactoryConfigDeprecationDetails" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21189,9 +24352,15 @@ "(unusedKey: string, details: ", "FactoryConfigDeprecationDetails", ") => ", - "ConfigDeprecation" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21205,7 +24374,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21220,7 +24389,7 @@ "signature": [ "FactoryConfigDeprecationDetails" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21241,9 +24410,15 @@ "(unusedKey: string, details: ", "FactoryConfigDeprecationDetails", ") => ", - "ConfigDeprecation" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21257,7 +24432,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21272,7 +24447,7 @@ "signature": [ "FactoryConfigDeprecationDetails" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -21293,10 +24468,16 @@ "\nDefinition of a context provider" ], "signature": [ - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21309,7 +24490,7 @@ "description": [ "\nThe name of the provider." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -21326,7 +24507,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -21341,10 +24522,16 @@ ], "signature": [ "{ [Key in keyof Required]: ", - "SchemaValue", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.SchemaValue", + "text": "SchemaValue" + }, "; }" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false } @@ -21360,10 +24547,7 @@ "description": [ "\nUsage data on this cluster's configuration of Core features" ], - "signature": [ - "CoreConfigUsageData" - ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21377,7 +24561,7 @@ "signature": [ "{ sniffOnStart: boolean; sniffIntervalMs?: number | undefined; sniffOnConnectionFault: boolean; numberOfHostsConfigured: number; requestHeadersWhitelistConfigured: boolean; customHeadersConfigured: boolean; shardTimeoutMs: number; requestTimeoutMs: number; pingTimeoutMs: number; logQueries: boolean; ssl: { verificationMode: \"none\" | \"full\" | \"certificate\"; certificateAuthoritiesConfigured: boolean; certificateConfigured: boolean; keyConfigured: boolean; keystoreConfigured: boolean; truststoreConfigured: boolean; alwaysPresentCertificate: boolean; }; apiVersion: string; healthCheckDelayMs: number; principal: \"unknown\" | \"elastic_user\" | \"kibana_user\" | \"kibana_system_user\" | \"other_user\" | \"kibana_service_account\"; }" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, "trackAdoption": false }, @@ -21391,7 +24575,7 @@ "signature": [ "{ basePathConfigured: boolean; maxPayloadInBytes: number; rewriteBasePath: boolean; keepaliveTimeout: number; socketTimeout: number; compression: { enabled: boolean; referrerWhitelistConfigured: boolean; }; xsrf: { disableProtection: boolean; allowlistConfigured: boolean; }; requestId: { allowFromAnyIp: boolean; ipAllowlistConfigured: boolean; }; ssl: { certificateAuthoritiesConfigured: boolean; certificateConfigured: boolean; cipherSuites: string[]; keyConfigured: boolean; keystoreConfigured: boolean; truststoreConfigured: boolean; redirectHttpFromPortConfigured: boolean; supportedProtocols: string[]; clientAuthentication: \"optional\" | \"none\" | \"required\"; }; securityResponseHeaders: { strictTransportSecurity: string; xContentTypeOptions: string; referrerPolicy: string; permissionsPolicyConfigured: boolean; disableEmbedding: boolean; }; }" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, "trackAdoption": false }, @@ -21405,7 +24589,7 @@ "signature": [ "{ appendersTypesUsed: string[]; loggersConfiguredCount: number; }" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, "trackAdoption": false }, @@ -21419,7 +24603,7 @@ "signature": [ "{ customIndex: boolean; maxImportPayloadBytes: number; maxImportExportSize: number; }" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, "trackAdoption": false }, @@ -21433,7 +24617,7 @@ "signature": [ "{ set: string[]; unset: string[]; }" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, "trackAdoption": false } @@ -21449,10 +24633,7 @@ "description": [ "\nUsage data on this Kibana node's runtime environment." ], - "signature": [ - "CoreEnvironmentUsageData" - ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21466,7 +24647,7 @@ "signature": [ "{ heapTotalBytes: number; heapUsedBytes: number; heapSizeLimit: number; }" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, "trackAdoption": false } @@ -21480,10 +24661,7 @@ "tags": [], "label": "CoreIncrementCounterParams", "description": [], - "signature": [ - "CoreIncrementCounterParams" - ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/setup_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21496,7 +24674,7 @@ "description": [ "The name of the counter" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/setup_contract.ts", "deprecated": false, "trackAdoption": false }, @@ -21512,7 +24690,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/setup_contract.ts", "deprecated": false, "trackAdoption": false }, @@ -21528,7 +24706,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/setup_contract.ts", "deprecated": false, "trackAdoption": false } @@ -21544,7 +24722,7 @@ "description": [ "\nContext passed to the `setup` method of `preboot` plugins." ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21559,24 +24737,66 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts", "deprecated": false, "trackAdoption": false }, @@ -21590,9 +24810,15 @@ "{@link ElasticsearchServicePreboot}" ], "signature": [ - "ElasticsearchServicePreboot" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchServicePreboot", + "text": "ElasticsearchServicePreboot" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts", "deprecated": false, "trackAdoption": false }, @@ -21606,12 +24832,24 @@ "{@link HttpServicePreboot}" ], "signature": [ - "HttpServicePreboot", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServicePreboot", + "text": "HttpServicePreboot" + }, "<", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ">" ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts", "deprecated": false, "trackAdoption": false }, @@ -21625,9 +24863,15 @@ "{@link PrebootServicePreboot}" ], "signature": [ - "PrebootServicePreboot" + { + "pluginId": "@kbn/core-preboot-server", + "scope": "server", + "docId": "kibKbnCorePrebootServerPluginApi", + "section": "def-server.PrebootServicePreboot", + "text": "PrebootServicePreboot" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts", "deprecated": false, "trackAdoption": false } @@ -21643,10 +24887,7 @@ "description": [ "\nThe `core` context provided to route handler.\n\nProvides the following clients and services:\n - {@link SavedObjectsClient | savedObjects.client} - Saved Objects client\n which uses the credentials of the incoming request\n - {@link ISavedObjectTypeRegistry | savedObjects.typeRegistry} - Type registry containing\n all the registered types.\n - {@link IScopedClusterClient | elasticsearch.client} - Elasticsearch\n data client which uses the credentials of the incoming request\n - {@link IUiSettingsClient | uiSettings.client} - uiSettings client\n which uses the credentials of the incoming request" ], - "signature": [ - "CoreRequestHandlerContext" - ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21658,9 +24899,15 @@ "label": "savedObjects", "description": [], "signature": [ - "SavedObjectsRequestHandlerContext" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRequestHandlerContext", + "text": "SavedObjectsRequestHandlerContext" + } ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false }, @@ -21672,9 +24919,15 @@ "label": "elasticsearch", "description": [], "signature": [ - "ElasticsearchRequestHandlerContext" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchRequestHandlerContext", + "text": "ElasticsearchRequestHandlerContext" + } ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false }, @@ -21686,9 +24939,15 @@ "label": "uiSettings", "description": [], "signature": [ - "UiSettingsRequestHandlerContext" + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.UiSettingsRequestHandlerContext", + "text": "UiSettingsRequestHandlerContext" + } ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false }, @@ -21700,9 +24959,15 @@ "label": "deprecations", "description": [], "signature": [ - "DeprecationsRequestHandlerContext" + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationsRequestHandlerContext", + "text": "DeprecationsRequestHandlerContext" + } ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false } @@ -21718,10 +24983,7 @@ "description": [ "\nUsage data from Core services" ], - "signature": [ - "CoreServicesUsageData" - ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21735,7 +24997,7 @@ "signature": [ "{ indices: { alias: string; docsCount: number; docsDeleted: number; storeSizeBytes: number; primaryStoreSizeBytes: number; savedObjectsDocsCount: number; }[]; legacyUrlAliases: { activeCount: number; inactiveCount: number; disabledCount: number; totalCount: number; }; }" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, "trackAdoption": false } @@ -21753,15 +25015,15 @@ ], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, "" ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -21776,24 +25038,66 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21807,9 +25111,15 @@ "{@link CapabilitiesSetup}" ], "signature": [ - "CapabilitiesSetup" + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesSetup", + "text": "CapabilitiesSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21823,9 +25133,15 @@ "{@link DocLinksServiceSetup}" ], "signature": [ - "DocLinksServiceSetup" + { + "pluginId": "@kbn/core-doc-links-server", + "scope": "server", + "docId": "kibKbnCoreDocLinksServerPluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21839,9 +25155,15 @@ "{@link ElasticsearchServiceSetup}" ], "signature": [ - "ElasticsearchServiceSetup" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchServiceSetup", + "text": "ElasticsearchServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21855,9 +25177,15 @@ "{@link ExecutionContextSetup}" ], "signature": [ - "ExecutionContextSetup" + { + "pluginId": "@kbn/core-execution-context-server", + "scope": "server", + "docId": "kibKbnCoreExecutionContextServerPluginApi", + "section": "def-server.ExecutionContextSetup", + "text": "ExecutionContextSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21871,14 +25199,32 @@ "{@link HttpServiceSetup}" ], "signature": [ - "HttpServiceSetup", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServiceSetup", + "text": "HttpServiceSetup" + }, "<", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, "> & { resources: ", - "HttpResources", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResources", + "text": "HttpResources" + }, "; }" ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21892,9 +25238,15 @@ "{@link I18nServiceSetup}" ], "signature": [ - "I18nServiceSetup" + { + "pluginId": "@kbn/core-i18n-server", + "scope": "common", + "docId": "kibKbnCoreI18nServerPluginApi", + "section": "def-common.I18nServiceSetup", + "text": "I18nServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21908,9 +25260,15 @@ "{@link LoggingServiceSetup}" ], "signature": [ - "LoggingServiceSetup" + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.LoggingServiceSetup", + "text": "LoggingServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21924,9 +25282,15 @@ "{@link MetricsServiceSetup}" ], "signature": [ - "MetricsServiceSetup" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21940,9 +25304,15 @@ "{@link SavedObjectsServiceSetup}" ], "signature": [ - "SavedObjectsServiceSetup" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceSetup", + "text": "SavedObjectsServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21956,9 +25326,15 @@ "{@link StatusServiceSetup}" ], "signature": [ - "StatusServiceSetup" + { + "pluginId": "@kbn/core-status-server", + "scope": "server", + "docId": "kibKbnCoreStatusServerPluginApi", + "section": "def-server.StatusServiceSetup", + "text": "StatusServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21972,9 +25348,15 @@ "{@link UiSettingsServiceSetup}" ], "signature": [ - "UiSettingsServiceSetup" + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.UiSettingsServiceSetup", + "text": "UiSettingsServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -21988,9 +25370,15 @@ "{@link DeprecationsServiceSetup}" ], "signature": [ - "DeprecationsServiceSetup" + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationsServiceSetup", + "text": "DeprecationsServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false }, @@ -22006,15 +25394,15 @@ "signature": [ "() => Promise<[", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, ", TPluginsStart, TStart]>" ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -22032,7 +25420,7 @@ "description": [ "\nContext passed to the plugins `start` method.\n" ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -22047,14 +25435,26 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; }" ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -22068,9 +25468,15 @@ "{@link CapabilitiesStart}" ], "signature": [ - "CapabilitiesStart" + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesStart", + "text": "CapabilitiesStart" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -22084,9 +25490,15 @@ "{@link DocLinksServiceStart}" ], "signature": [ - "DocLinksServiceSetup" + { + "pluginId": "@kbn/core-doc-links-server", + "scope": "server", + "docId": "kibKbnCoreDocLinksServerPluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -22100,9 +25512,15 @@ "{@link ElasticsearchServiceStart}" ], "signature": [ - "ElasticsearchServiceStart" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchServiceStart", + "text": "ElasticsearchServiceStart" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -22116,9 +25534,15 @@ "{@link ExecutionContextStart}" ], "signature": [ - "ExecutionContextSetup" + { + "pluginId": "@kbn/core-execution-context-server", + "scope": "server", + "docId": "kibKbnCoreExecutionContextServerPluginApi", + "section": "def-server.ExecutionContextSetup", + "text": "ExecutionContextSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -22132,9 +25556,15 @@ "{@link HttpServiceStart}" ], "signature": [ - "HttpServiceStart" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServiceStart", + "text": "HttpServiceStart" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -22148,9 +25578,15 @@ "{@link MetricsServiceStart}" ], "signature": [ - "MetricsServiceSetup" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -22164,9 +25600,15 @@ "{@link SavedObjectsServiceStart}" ], "signature": [ - "SavedObjectsServiceStart" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceStart", + "text": "SavedObjectsServiceStart" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", "deprecated": false, "trackAdoption": false }, @@ -22180,9 +25622,15 @@ "{@link UiSettingsServiceStart}" ], "signature": [ - "UiSettingsServiceStart" + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.UiSettingsServiceStart", + "text": "UiSettingsServiceStart" + } ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", "deprecated": false, "trackAdoption": false } @@ -22198,10 +25646,7 @@ "description": [ "\nStatus of core services.\n" ], - "signature": [ - "CoreStatus" - ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/core_status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -22213,10 +25658,16 @@ "label": "elasticsearch", "description": [], "signature": [ - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, "" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/core_status.ts", "deprecated": false, "trackAdoption": false }, @@ -22228,10 +25679,16 @@ "label": "savedObjects", "description": [], "signature": [ - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, "" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/core_status.ts", "deprecated": false, "trackAdoption": false } @@ -22245,10 +25702,7 @@ "tags": [], "label": "CoreUsageCounter", "description": [], - "signature": [ - "CoreUsageCounter" - ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/setup_contract.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -22264,11 +25718,23 @@ "\nType describing Core's usage data payload" ], "signature": [ - "CoreUsageData", + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreUsageData", + "text": "CoreUsageData" + }, " extends ", - "CoreUsageStats" + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreUsageStats", + "text": "CoreUsageStats" + } ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/start_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -22280,9 +25746,15 @@ "label": "config", "description": [], "signature": [ - "CoreConfigUsageData" + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreConfigUsageData", + "text": "CoreConfigUsageData" + } ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/start_contract.ts", "deprecated": false, "trackAdoption": false }, @@ -22294,9 +25766,15 @@ "label": "services", "description": [], "signature": [ - "CoreServicesUsageData" + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreServicesUsageData", + "text": "CoreServicesUsageData" + } ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/start_contract.ts", "deprecated": false, "trackAdoption": false }, @@ -22308,9 +25786,15 @@ "label": "environment", "description": [], "signature": [ - "CoreEnvironmentUsageData" + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreEnvironmentUsageData", + "text": "CoreEnvironmentUsageData" + } ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/start_contract.ts", "deprecated": false, "trackAdoption": false } @@ -22328,10 +25812,7 @@ "description": [ "\nInternal API for registering the Usage Tracker used for Core's usage data payload.\n" ], - "signature": [ - "CoreUsageDataSetup" - ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/setup_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -22346,10 +25827,16 @@ ], "signature": [ "(usageCounter: ", - "CoreUsageCounter", + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreUsageCounter", + "text": "CoreUsageCounter" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/setup_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -22361,9 +25848,15 @@ "label": "usageCounter", "description": [], "signature": [ - "CoreUsageCounter" + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreUsageCounter", + "text": "CoreUsageCounter" + } ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/setup_contract.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -22385,10 +25878,7 @@ "description": [ "\nInternal API for getting Core's usage data payload.\n" ], - "signature": [ - "CoreUsageDataStart" - ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/start_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -22401,10 +25891,16 @@ "description": [], "signature": [ "() => Promise<", - "ConfigUsageData", + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.ConfigUsageData", + "text": "ConfigUsageData" + }, ">" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/start_contract.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -22420,10 +25916,7 @@ "tags": [], "label": "CoreUsageStats", "description": [], - "signature": [ - "CoreUsageStats" - ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -22437,7 +25930,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22451,7 +25944,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22465,7 +25958,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22479,7 +25972,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22493,7 +25986,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22507,7 +26000,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22521,7 +26014,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22535,7 +26028,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22549,7 +26042,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22563,7 +26056,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22577,7 +26070,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22591,7 +26084,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22605,7 +26098,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22619,7 +26112,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22633,7 +26126,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22647,7 +26140,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22661,7 +26154,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22675,7 +26168,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22689,7 +26182,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22703,7 +26196,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22717,7 +26210,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22731,7 +26224,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22745,7 +26238,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22759,7 +26252,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22773,7 +26266,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22787,7 +26280,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22801,7 +26294,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22815,7 +26308,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22829,7 +26322,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22843,7 +26336,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22857,7 +26350,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22871,7 +26364,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22885,7 +26378,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22899,7 +26392,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22913,7 +26406,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22927,7 +26420,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22941,7 +26434,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22955,7 +26448,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22969,7 +26462,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22983,7 +26476,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -22997,7 +26490,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23011,7 +26504,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23025,7 +26518,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23039,7 +26532,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23053,7 +26546,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23067,7 +26560,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23081,7 +26574,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23095,7 +26588,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23109,7 +26602,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23123,7 +26616,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23137,7 +26630,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23151,7 +26644,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23165,7 +26658,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23179,7 +26672,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23193,7 +26686,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23207,7 +26700,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23221,7 +26714,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23235,7 +26728,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23249,7 +26742,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23263,7 +26756,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23277,7 +26770,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23291,7 +26784,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23305,7 +26798,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23319,7 +26812,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23333,7 +26826,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23347,7 +26840,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23361,7 +26854,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23375,7 +26868,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23389,7 +26882,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23403,7 +26896,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23417,7 +26910,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23431,7 +26924,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23445,7 +26938,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23459,7 +26952,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23473,7 +26966,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23487,7 +26980,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23501,7 +26994,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23515,7 +27008,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23529,7 +27022,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23543,7 +27036,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23557,7 +27050,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23571,7 +27064,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23585,7 +27078,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23599,7 +27092,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23613,7 +27106,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23627,7 +27120,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23641,7 +27134,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23655,7 +27148,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23669,7 +27162,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23683,7 +27176,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23697,7 +27190,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23711,7 +27204,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23725,7 +27218,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23739,7 +27232,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23753,7 +27246,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23767,7 +27260,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23781,7 +27274,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23795,7 +27288,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23809,7 +27302,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23823,7 +27316,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23837,7 +27330,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23851,7 +27344,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23865,7 +27358,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23879,7 +27372,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23893,7 +27386,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23907,7 +27400,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23921,7 +27414,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23935,7 +27428,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23949,7 +27442,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23963,7 +27456,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23977,7 +27470,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -23991,7 +27484,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24005,7 +27498,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24019,7 +27512,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24033,7 +27526,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24047,7 +27540,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24061,7 +27554,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24075,7 +27568,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24089,7 +27582,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24103,7 +27596,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24117,7 +27610,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24131,7 +27624,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24145,7 +27638,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24159,7 +27652,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false }, @@ -24173,7 +27666,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_stats.ts", "deprecated": false, "trackAdoption": false } @@ -24190,10 +27683,16 @@ "\nHTTP response parameters for a response with adjustable status code." ], "signature": [ - "CustomHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24209,7 +27708,7 @@ "signature": [ "T | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false }, @@ -24223,10 +27722,16 @@ "HTTP Headers with additional information about response" ], "signature": [ - "ResponseHeaders", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseHeaders", + "text": "ResponseHeaders" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false }, @@ -24242,7 +27747,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false }, @@ -24253,7 +27758,7 @@ "tags": [], "label": "statusCode", "description": [], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false } @@ -24269,10 +27774,7 @@ "description": [ "\nServer-side client that provides access to fetch all Kibana deprecations\n" ], - "signature": [ - "DeprecationsClient" - ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24285,10 +27787,16 @@ "description": [], "signature": [ "() => Promise<", - "DomainDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + }, "[]>" ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -24306,10 +27814,7 @@ "description": [ "\nUiSettings deprecation field options." ], - "signature": [ - "DeprecationSettings" - ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24322,7 +27827,7 @@ "description": [ "Deprecation message" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -24335,7 +27840,7 @@ "description": [ "Key to documentation links" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -24351,10 +27856,7 @@ "description": [ "\nCore's `deprecations` request handler context." ], - "signature": [ - "DeprecationsRequestHandlerContext" - ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24366,9 +27868,15 @@ "label": "client", "description": [], "signature": [ - "DeprecationsClient" + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationsClient", + "text": "DeprecationsClient" + } ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false } @@ -24384,10 +27892,7 @@ "description": [ "\nThe deprecations service provides a way for the Kibana platform to communicate deprecated\nfeatures and configs with its users. These deprecations are only communicated\nif the deployment is using these features. Allowing for a user tailored experience\nfor upgrading the stack version.\n\nThe Deprecation service is consumed by the upgrade assistant to assist with the upgrade\nexperience.\n\nIf a deprecated feature can be resolved without manual user intervention.\nUsing correctiveActions.api allows the Upgrade Assistant to use this api to correct the\ndeprecation upon a user trigger.\n" ], - "signature": [ - "DeprecationsServiceSetup" - ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24400,10 +27905,16 @@ "description": [], "signature": [ "(deprecationContext: ", - "RegisterDeprecationsConfig", + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.RegisterDeprecationsConfig", + "text": "RegisterDeprecationsConfig" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24415,9 +27926,15 @@ "label": "deprecationContext", "description": [], "signature": [ - "RegisterDeprecationsConfig" + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.RegisterDeprecationsConfig", + "text": "RegisterDeprecationsConfig" + } ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -24437,10 +27954,7 @@ "description": [ "\nSmall container object used to expose information about discovered plugins that may\nor may not have been started." ], - "signature": [ - "DiscoveredPlugin" - ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24453,7 +27967,7 @@ "description": [ "\nIdentifier of the plugin." ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false }, @@ -24469,7 +27983,7 @@ "signature": [ "string | string[]" ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false }, @@ -24483,9 +27997,15 @@ "\nType of the plugin, defaults to `standard`." ], "signature": [ - "PluginType" + { + "pluginId": "@kbn/core-base-common", + "scope": "server", + "docId": "kibKbnCoreBaseCommonPluginApi", + "section": "def-server.PluginType", + "text": "PluginType" + } ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false }, @@ -24501,7 +28021,7 @@ "signature": [ "readonly string[]" ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false }, @@ -24517,7 +28037,7 @@ "signature": [ "readonly string[]" ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false }, @@ -24533,7 +28053,7 @@ "signature": [ "readonly string[]" ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false }, @@ -24549,7 +28069,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false } @@ -24563,10 +28083,7 @@ "tags": [], "label": "DocLinksServiceSetup", "description": [], - "signature": [ - "DocLinksServiceSetup" - ], - "path": "node_modules/@types/kbn__core-doc-links-server/index.d.ts", + "path": "packages/core/doc-links/core-doc-links-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24579,7 +28096,7 @@ "description": [ "The branch/version the docLinks are pointing to" ], - "path": "node_modules/@types/kbn__core-doc-links-server/index.d.ts", + "path": "packages/core/doc-links/core-doc-links-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -24592,7 +28109,7 @@ "description": [ "The base url for the elastic website" ], - "path": "node_modules/@types/kbn__core-doc-links-server/index.d.ts", + "path": "packages/core/doc-links/core-doc-links-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -24606,9 +28123,15 @@ "A record of all registered doc links" ], "signature": [ - "DocLinks" + { + "pluginId": "@kbn/doc-links", + "scope": "common", + "docId": "kibKbnDocLinksPluginApi", + "section": "def-common.DocLinks", + "text": "DocLinks" + } ], - "path": "node_modules/@types/kbn__core-doc-links-server/index.d.ts", + "path": "packages/core/doc-links/core-doc-links-server/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -24624,10 +28147,7 @@ "description": [ "\nConfiguration options to be used to create a {@link IClusterClient | cluster client}\n" ], - "signature": [ - "ElasticsearchClientConfig" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24641,7 +28161,7 @@ "signature": [ "{ [x: string]: string; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24655,7 +28175,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24666,7 +28186,7 @@ "tags": [], "label": "maxSockets", "description": [], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24677,7 +28197,7 @@ "tags": [], "label": "maxIdleSockets", "description": [], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24691,7 +28211,7 @@ "signature": [ "moment.Duration" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24702,7 +28222,7 @@ "tags": [], "label": "compression", "description": [], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24713,7 +28233,7 @@ "tags": [], "label": "sniffOnStart", "description": [], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24724,7 +28244,7 @@ "tags": [], "label": "sniffOnConnectionFault", "description": [], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24738,7 +28258,7 @@ "signature": [ "false | moment.Duration" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24752,7 +28272,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24766,7 +28286,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24780,7 +28300,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24794,7 +28314,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24808,7 +28328,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24822,7 +28342,7 @@ "signature": [ "number | moment.Duration | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24836,7 +28356,7 @@ "signature": [ "number | moment.Duration | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24850,7 +28370,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24862,10 +28382,16 @@ "label": "ssl", "description": [], "signature": [ - "ElasticsearchClientSslConfig", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClientSslConfig", + "text": "ElasticsearchClientSslConfig" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false } @@ -24879,10 +28405,7 @@ "tags": [], "label": "ElasticsearchClientSslConfig", "description": [], - "signature": [ - "ElasticsearchClientSslConfig" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24896,7 +28419,7 @@ "signature": [ "\"none\" | \"full\" | \"certificate\" | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24910,7 +28433,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24924,7 +28447,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24938,7 +28461,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24952,7 +28475,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false }, @@ -24966,7 +28489,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts", "deprecated": false, "trackAdoption": false } @@ -24982,10 +28505,7 @@ "description": [ "\nA limited set of Elasticsearch configuration entries exposed to the `preboot` plugins at `setup`.\n" ], - "signature": [ - "ElasticsearchConfigPreboot" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25001,7 +28521,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -25014,7 +28534,7 @@ "description": [ "\nIndicates whether Elasticsearch configuration includes credentials (`username`, `password` or `serviceAccountToken`)." ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -25030,10 +28550,7 @@ "description": [ "\nCore's `elasticsearch` request handler context." ], - "signature": [ - "ElasticsearchRequestHandlerContext" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25045,9 +28562,15 @@ "label": "client", "description": [], "signature": [ - "IScopedClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false } @@ -25061,10 +28584,7 @@ "tags": [], "label": "ElasticsearchServicePreboot", "description": [], - "signature": [ - "ElasticsearchServicePreboot" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25080,7 +28600,7 @@ "signature": [ "{ readonly hosts: string[]; readonly credentialsSpecified: boolean; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -25095,11 +28615,23 @@ ], "signature": [ "(type: string, clientConfig?: Partial<", - "ElasticsearchClientConfig", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClientConfig", + "text": "ElasticsearchClientConfig" + }, "> | undefined) => ", - "ICustomClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ICustomClusterClient", + "text": "ICustomClusterClient" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25115,7 +28647,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -25131,10 +28663,16 @@ ], "signature": [ "Partial<", - "ElasticsearchClientConfig", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClientConfig", + "text": "ElasticsearchClientConfig" + }, "> | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -25152,10 +28690,7 @@ "tags": [], "label": "ElasticsearchServiceSetup", "description": [], - "signature": [ - "ElasticsearchServiceSetup" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25170,10 +28705,16 @@ ], "signature": [ "(handler: ", - "UnauthorizedErrorHandler", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandler", + "text": "UnauthorizedErrorHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25185,9 +28726,15 @@ "label": "handler", "description": [], "signature": [ - "UnauthorizedErrorHandler" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandler", + "text": "UnauthorizedErrorHandler" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -25208,21 +28755,35 @@ "{ readonly config$: ", "Observable", "<", - "IElasticsearchConfig", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IElasticsearchConfig", + "text": "IElasticsearchConfig" + }, ">; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "console", - "path": "src/plugins/console/server/plugin.ts" - }, { "plugin": "@kbn/core-elasticsearch-server-internal", "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.ts" }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "console", + "path": "src/plugins/console/server/plugin.ts" + }, { "plugin": "@kbn/core-elasticsearch-server-internal", "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts" @@ -25239,10 +28800,7 @@ "tags": [], "label": "ElasticsearchServiceStart", "description": [], - "signature": [ - "ElasticsearchServiceStart" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25256,9 +28814,15 @@ "\nA pre-configured {@link IClusterClient | Elasticsearch client}\n" ], "signature": [ - "IClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IClusterClient", + "text": "IClusterClient" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -25273,11 +28837,23 @@ ], "signature": [ "(type: string, clientConfig?: Partial<", - "ElasticsearchClientConfig", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClientConfig", + "text": "ElasticsearchClientConfig" + }, "> | undefined) => ", - "ICustomClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ICustomClusterClient", + "text": "ICustomClusterClient" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25293,7 +28869,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -25309,10 +28885,16 @@ ], "signature": [ "Partial<", - "ElasticsearchClientConfig", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClientConfig", + "text": "ElasticsearchClientConfig" + }, "> | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -25330,10 +28912,7 @@ "tags": [], "label": "EnvironmentMode", "description": [], - "signature": [ - "EnvironmentMode" - ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25347,7 +28926,7 @@ "signature": [ "\"production\" | \"development\"" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25358,7 +28937,7 @@ "tags": [], "label": "dev", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25369,7 +28948,7 @@ "tags": [], "label": "prod", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -25385,10 +28964,7 @@ "description": [ "\nHTTP response parameters" ], - "signature": [ - "ErrorHttpResponseOptions" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25402,10 +28978,16 @@ "HTTP message to send to the client" ], "signature": [ - "ResponseError", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseError", + "text": "ResponseError" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false }, @@ -25419,10 +29001,16 @@ "HTTP Headers with additional information about response" ], "signature": [ - "ResponseHeaders", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseHeaders", + "text": "ResponseHeaders" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false } @@ -25439,10 +29027,16 @@ "\nDefinition of the full event structure" ], "signature": [ - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25455,7 +29049,7 @@ "description": [ "\nThe time the event was generated in ISO format." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25468,7 +29062,7 @@ "description": [ "\nThe event type." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25484,7 +29078,7 @@ "signature": [ "Properties" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25498,9 +29092,15 @@ "\nThe {@link EventContext} enriched during the processing pipeline." ], "signature": [ - "EventContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + } ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false } @@ -25516,10 +29116,7 @@ "description": [ "\nDefinition of the context that can be appended to the events through the {@link IAnalyticsClient.registerContextProvider}." ], - "signature": [ - "EventContext" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25535,7 +29132,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25551,7 +29148,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25567,7 +29164,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25583,7 +29180,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25599,7 +29196,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25615,7 +29212,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25631,7 +29228,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25647,7 +29244,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25663,7 +29260,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25679,7 +29276,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25695,7 +29292,7 @@ "signature": [ "[key: string]: unknown" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false } @@ -25712,10 +29309,16 @@ "\nDefinition of an Event Type." ], "signature": [ - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25728,7 +29331,7 @@ "description": [ "\nThe event type's unique name." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -25743,10 +29346,16 @@ ], "signature": [ "{ [Key in keyof Required]: ", - "SchemaValue", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.SchemaValue", + "text": "SchemaValue" + }, "; }" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false } @@ -25760,10 +29369,7 @@ "tags": [], "label": "ExecutionContextSetup", "description": [], - "signature": [ - "ExecutionContextSetup" - ], - "path": "node_modules/@types/kbn__core-execution-context-server/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25778,10 +29384,16 @@ ], "signature": [ "(context: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined, fn: (...args: any[]) => R) => R" ], - "path": "node_modules/@types/kbn__core-execution-context-server/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25793,10 +29405,16 @@ "label": "context", "description": [], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-execution-context-server/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -25811,7 +29429,7 @@ "signature": [ "(...args: any[]) => R" ], - "path": "node_modules/@types/kbn__core-execution-context-server/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -25830,7 +29448,7 @@ "() => ", "Labels" ], - "path": "node_modules/@types/kbn__core-execution-context-server/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -25848,10 +29466,7 @@ "description": [ "\nFake request object created manually by Kibana plugins." ], - "signature": [ - "FakeRequest" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/scopeable_request.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25867,7 +29482,7 @@ "signature": [ "{ accept?: string | string[] | undefined; \"accept-language\"?: string | string[] | undefined; \"accept-patch\"?: string | string[] | undefined; \"accept-ranges\"?: string | string[] | undefined; \"access-control-allow-credentials\"?: string | string[] | undefined; \"access-control-allow-headers\"?: string | string[] | undefined; \"access-control-allow-methods\"?: string | string[] | undefined; \"access-control-allow-origin\"?: string | string[] | undefined; \"access-control-expose-headers\"?: string | string[] | undefined; \"access-control-max-age\"?: string | string[] | undefined; \"access-control-request-headers\"?: string | string[] | undefined; \"access-control-request-method\"?: string | string[] | undefined; age?: string | string[] | undefined; allow?: string | string[] | undefined; \"alt-svc\"?: string | string[] | undefined; authorization?: string | string[] | undefined; \"cache-control\"?: string | string[] | undefined; connection?: string | string[] | undefined; \"content-disposition\"?: string | string[] | undefined; \"content-encoding\"?: string | string[] | undefined; \"content-language\"?: string | string[] | undefined; \"content-length\"?: string | string[] | undefined; \"content-location\"?: string | string[] | undefined; \"content-range\"?: string | string[] | undefined; \"content-type\"?: string | string[] | undefined; cookie?: string | string[] | undefined; date?: string | string[] | undefined; etag?: string | string[] | undefined; expect?: string | string[] | undefined; expires?: string | string[] | undefined; forwarded?: string | string[] | undefined; from?: string | string[] | undefined; host?: string | string[] | undefined; \"if-match\"?: string | string[] | undefined; \"if-modified-since\"?: string | string[] | undefined; \"if-none-match\"?: string | string[] | undefined; \"if-unmodified-since\"?: string | string[] | undefined; \"last-modified\"?: string | string[] | undefined; location?: string | string[] | undefined; origin?: string | string[] | undefined; pragma?: string | string[] | undefined; \"proxy-authenticate\"?: string | string[] | undefined; \"proxy-authorization\"?: string | string[] | undefined; \"public-key-pins\"?: string | string[] | undefined; range?: string | string[] | undefined; referer?: string | string[] | undefined; \"retry-after\"?: string | string[] | undefined; \"sec-websocket-accept\"?: string | string[] | undefined; \"sec-websocket-extensions\"?: string | string[] | undefined; \"sec-websocket-key\"?: string | string[] | undefined; \"sec-websocket-protocol\"?: string | string[] | undefined; \"sec-websocket-version\"?: string | string[] | undefined; \"set-cookie\"?: string | string[] | undefined; \"strict-transport-security\"?: string | string[] | undefined; tk?: string | string[] | undefined; trailer?: string | string[] | undefined; \"transfer-encoding\"?: string | string[] | undefined; upgrade?: string | string[] | undefined; \"user-agent\"?: string | string[] | undefined; vary?: string | string[] | undefined; via?: string | string[] | undefined; warning?: string | string[] | undefined; \"www-authenticate\"?: string | string[] | undefined; } & { [header: string]: string | string[] | undefined; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/scopeable_request.ts", "deprecated": false, "trackAdoption": false } @@ -25881,10 +29496,7 @@ "tags": [], "label": "GetDeprecationsContext", "description": [], - "signature": [ - "GetDeprecationsContext" - ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25896,9 +29508,15 @@ "label": "esClient", "description": [], "signature": [ - "IScopedClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + } ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -25910,9 +29528,15 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -25926,10 +29550,7 @@ "tags": [], "label": "HttpAuth", "description": [], - "signature": [ - "HttpAuth" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25944,12 +29565,24 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => { status: ", - "AuthStatus", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthStatus", + "text": "AuthStatus" + }, "; state: T; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -25962,10 +29595,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/auth_state.ts", "deprecated": false, "trackAdoption": false } @@ -25982,10 +29621,16 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -25998,10 +29643,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/auth_state.ts", "deprecated": false, "trackAdoption": false } @@ -26019,10 +29670,7 @@ "description": [ "\nHttpResources service is responsible for serving static & dynamic assets for Kibana application via HTTP.\nProvides API allowing plug-ins to respond with:\n- a pre-configured HTML page bootstrapping Kibana client app\n- custom HTML page\n- custom JS script file." ], - "signature": [ - "HttpResources" - ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26037,16 +29685,40 @@ ], "signature": [ "(route: ", - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, ", handler: ", - "HttpResourcesRequestHandler", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesRequestHandler", + "text": "HttpResourcesRequestHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26058,10 +29730,16 @@ "label": "route", "description": [], "signature": [ - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, "" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26074,10 +29752,16 @@ "label": "handler", "description": [], "signature": [ - "HttpResourcesRequestHandler", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesRequestHandler", + "text": "HttpResourcesRequestHandler" + }, "" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26097,10 +29781,7 @@ "description": [ "\nAllows to configure HTTP response parameters" ], - "signature": [ - "HttpResourcesRenderOptions" - ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26114,10 +29795,16 @@ "\nHTTP Headers with additional information about response." ], "signature": [ - "ResponseHeaders", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseHeaders", + "text": "ResponseHeaders" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -26133,10 +29820,7 @@ "description": [ "\nExtended set of {@link KibanaResponseFactory} helpers used to respond with HTML or JS resource." ], - "signature": [ - "HttpResourcesServiceToolkit" - ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26151,12 +29835,24 @@ ], "signature": [ "(options?: ", - "HttpResourcesRenderOptions", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesRenderOptions", + "text": "HttpResourcesRenderOptions" + }, " | undefined) => Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26168,10 +29864,16 @@ "label": "options", "description": [], "signature": [ - "HttpResourcesRenderOptions", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesRenderOptions", + "text": "HttpResourcesRenderOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -26190,12 +29892,24 @@ ], "signature": [ "(options?: ", - "HttpResourcesRenderOptions", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesRenderOptions", + "text": "HttpResourcesRenderOptions" + }, " | undefined) => Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26207,10 +29921,16 @@ "label": "options", "description": [], "signature": [ - "HttpResourcesRenderOptions", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesRenderOptions", + "text": "HttpResourcesRenderOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -26229,12 +29949,24 @@ ], "signature": [ "(options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26246,9 +29978,15 @@ "label": "options", "description": [], "signature": [ - "HttpResponseOptions" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + } ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26267,12 +30005,24 @@ ], "signature": [ "(options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26284,9 +30034,15 @@ "label": "options", "description": [], "signature": [ - "HttpResponseOptions" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + } ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26305,12 +30061,24 @@ ], "signature": [ "(options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26322,9 +30090,15 @@ "label": "options", "description": [], "signature": [ - "HttpResponseOptions" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + } ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26344,10 +30118,7 @@ "description": [ "\nHTTP response parameters" ], - "signature": [ - "HttpResponseOptions" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26365,7 +30136,7 @@ "Stream", " | Buffer | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false }, @@ -26379,10 +30150,16 @@ "HTTP Headers with additional information about response" ], "signature": [ - "ResponseHeaders", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseHeaders", + "text": "ResponseHeaders" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false }, @@ -26398,7 +30175,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false } @@ -26414,10 +30191,7 @@ "description": [ "\nInformation about what hostname, port, and protocol the server process is\nrunning on. Note that this may not match the URL that end-users access\nKibana at. For the public URL, see {@link BasePath.publicBaseUrl}." ], - "signature": [ - "HttpServerInfo" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26430,7 +30204,7 @@ "description": [ "The name of the Kibana server" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false }, @@ -26443,7 +30217,7 @@ "description": [ "The hostname of the server" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false }, @@ -26456,7 +30230,7 @@ "description": [ "The port the server is listening on" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false }, @@ -26472,7 +30246,7 @@ "signature": [ "\"http\" | \"https\" | \"socket\"" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false } @@ -26489,10 +30263,16 @@ "\nKibana HTTP Service provides an abstraction to work with the HTTP stack at the `preboot` stage. This functionality\nallows Kibana to serve user requests even before Kibana becomes fully operational. Only Core and `preboot` plugins\ncan define HTTP routes at this stage.\n" ], "signature": [ - "HttpServicePreboot", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServicePreboot", + "text": "HttpServicePreboot" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26507,10 +30287,16 @@ ], "signature": [ "(path: string, callback: (router: ", - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, ") => void) => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26524,7 +30310,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26538,10 +30324,16 @@ "description": [], "signature": [ "(router: ", - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26559,9 +30351,15 @@ "\nAccess or manipulate the Kibana base path\nSee {@link IBasePath}." ], "signature": [ - "IBasePath" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IBasePath", + "text": "IBasePath" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false }, @@ -26576,9 +30374,15 @@ ], "signature": [ "() => ", - "HttpServerInfo" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServerInfo", + "text": "HttpServerInfo" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -26597,10 +30401,16 @@ "\nKibana HTTP Service provides own abstraction for work with HTTP stack.\nPlugins don't have direct access to `hapi` server and its primitives anymore. Moreover,\nplugins shouldn't rely on the fact that HTTP Service uses one or another library under the hood.\nThis gives the platform flexibility to upgrade or changing our internal HTTP stack without breaking plugins.\nIf the HTTP Service lacks functionality you need, we are happy to discuss and support your needs.\n" ], "signature": [ - "HttpServiceSetup", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServiceSetup", + "text": "HttpServiceSetup" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26615,12 +30425,24 @@ ], "signature": [ "(cookieOptions: ", - "SessionStorageCookieOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageCookieOptions", + "text": "SessionStorageCookieOptions" + }, ") => Promise<", - "SessionStorageFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageFactory", + "text": "SessionStorageFactory" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26634,10 +30456,16 @@ "{@link SessionStorageCookieOptions } - options to configure created cookie session storage." ], "signature": [ - "SessionStorageCookieOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageCookieOptions", + "text": "SessionStorageCookieOptions" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26656,10 +30484,16 @@ ], "signature": [ "(handler: ", - "OnPreRoutingHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreRoutingHandler", + "text": "OnPreRoutingHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -26673,9 +30507,15 @@ "{@link OnPreRoutingHandler } - function to call." ], "signature": [ - "OnPreRoutingHandler" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreRoutingHandler", + "text": "OnPreRoutingHandler" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26694,102 +30534,1424 @@ ], "signature": [ "(handler: ", - "OnPreAuthHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreAuthHandler", + "text": "OnPreAuthHandler" + }, + ") => void" + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.registerOnPreAuth.$1", + "type": "Function", + "tags": [], + "label": "handler", + "description": [ + "{@link OnPreRoutingHandler } - function to call." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreAuthHandler", + "text": "OnPreAuthHandler" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.registerAuth", + "type": "Function", + "tags": [], + "label": "registerAuth", + "description": [ + "\nTo define custom authentication and/or authorization mechanism for incoming requests.\n" + ], + "signature": [ + "(handler: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthenticationHandler", + "text": "AuthenticationHandler" + }, + ") => void" + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.registerAuth.$1", + "type": "Function", + "tags": [], + "label": "handler", + "description": [ + "{@link AuthenticationHandler } - function to perform authentication." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthenticationHandler", + "text": "AuthenticationHandler" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.registerOnPostAuth", + "type": "Function", + "tags": [], + "label": "registerOnPostAuth", + "description": [ + "\nTo define custom logic after Auth interceptor did make sure a user has access to the requested resource.\n" + ], + "signature": [ + "(handler: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPostAuthHandler", + "text": "OnPostAuthHandler" + }, + ") => void" + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.registerOnPostAuth.$1", + "type": "Function", + "tags": [], + "label": "handler", + "description": [ + "{@link OnPostAuthHandler } - function to call." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPostAuthHandler", + "text": "OnPostAuthHandler" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.registerOnPreResponse", + "type": "Function", + "tags": [], + "label": "registerOnPreResponse", + "description": [ + "\nTo define custom logic to perform for the server response.\n" + ], + "signature": [ + "(handler: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseHandler", + "text": "OnPreResponseHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.registerOnPreResponse.$1", + "type": "Function", + "tags": [], + "label": "handler", + "description": [ + "{@link OnPreResponseHandler } - function to call." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseHandler", + "text": "OnPreResponseHandler" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.basePath", + "type": "Object", + "tags": [], + "label": "basePath", + "description": [ + "\nAccess or manipulate the Kibana base path\nSee {@link IBasePath}." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IBasePath", + "text": "IBasePath" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.csp", + "type": "Object", + "tags": [], + "label": "csp", + "description": [ + "\nThe CSP config used for Kibana." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ICspConfig", + "text": "ICspConfig" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.createRouter", + "type": "Function", + "tags": [], + "label": "createRouter", + "description": [ + "\nProvides ability to declare a handler function for a particular path and HTTP request method.\n" + ], + "signature": [ + "() => ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, + "" + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.registerRouteHandlerContext", + "type": "Function", + "tags": [], + "label": "registerRouteHandlerContext", + "description": [ + "\nRegister a context provider for a route handler." + ], + "signature": [ + ">(contextName: ContextName, provider: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IContextProvider", + "text": "IContextProvider" + }, + ") => ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IContextContainer", + "text": "IContextContainer" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ { - "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.registerOnPreAuth.$1", - "type": "Function", - "tags": [], - "label": "handler", - "description": [ - "{@link OnPreRoutingHandler } - function to call." - ], - "signature": [ - "OnPreAuthHandler" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.registerAuth", - "type": "Function", - "tags": [], - "label": "registerAuth", - "description": [ - "\nTo define custom authentication and/or authorization mechanism for incoming requests.\n" - ], - "signature": [ - "(handler: ", - "AuthenticationHandler", - ") => void" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.registerRouteHandlerContext.$1", + "type": "Uncategorized", + "tags": [], + "label": "contextName", + "description": [], + "signature": [ + "ContextName" + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.registerRouteHandlerContext.$2", + "type": "Function", + "tags": [], + "label": "provider", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IContextProvider", + "text": "IContextProvider" + }, + "" + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceSetup.getServerInfo", + "type": "Function", + "tags": [], + "label": "getServerInfo", + "description": [ + "\nProvides common {@link HttpServerInfo | information} about the running http server." + ], + "signature": [ + "() => ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServerInfo", + "text": "HttpServerInfo" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceStart", + "type": "Interface", + "tags": [], + "label": "HttpServiceStart", + "description": [], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.HttpServiceStart.basePath", + "type": "Object", + "tags": [], + "label": "basePath", + "description": [ + "\nAccess or manipulate the Kibana base path\nSee {@link IBasePath}." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IBasePath", + "text": "IBasePath" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceStart.auth", + "type": "Object", + "tags": [], + "label": "auth", + "description": [ + "\nAuth status.\nSee {@link HttpAuth}" + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpAuth", + "text": "HttpAuth" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.HttpServiceStart.getServerInfo", + "type": "Function", + "tags": [], + "label": "getServerInfo", + "description": [ + "\nProvides common {@link HttpServerInfo | information} about the running http server." + ], + "signature": [ + "() => ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServerInfo", + "text": "HttpServerInfo" + } + ], + "path": "packages/core/http/core-http-server/src/http_contract.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.I18nServiceSetup", + "type": "Interface", + "tags": [], + "label": "I18nServiceSetup", + "description": [], + "path": "packages/core/i18n/core-i18n-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.I18nServiceSetup.getLocale", + "type": "Function", + "tags": [], + "label": "getLocale", + "description": [ + "\nReturn the locale currently in use." + ], + "signature": [ + "() => string" + ], + "path": "packages/core/i18n/core-i18n-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.I18nServiceSetup.getTranslationFiles", + "type": "Function", + "tags": [], + "label": "getTranslationFiles", + "description": [ + "\nReturn the absolute paths to translation files currently in use." + ], + "signature": [ + "() => string[]" + ], + "path": "packages/core/i18n/core-i18n-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient", + "type": "Interface", + "tags": [], + "label": "IAnalyticsClient", + "description": [ + "\nAnalytics client's public APIs" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.reportEvent", + "type": "Function", + "tags": [ + "track-adoption" + ], + "label": "reportEvent", + "description": [ + "\nReports a telemetry event." + ], + "signature": [ + "(eventType: string, eventData: EventTypeData) => void" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": true, + "references": [ + { + "plugin": "@kbn/ebt-tools", + "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/analytics/analytics_service.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/fleet_usage_sender.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/analytics_service.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-mocks", + "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-mocks", + "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/analytics.stub.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/analytics/analytics_service.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/analytics/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts" + } + ], + "children": [ + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.reportEvent.$1", + "type": "string", + "tags": [], + "label": "eventType", + "description": [ + "The event type registered via the `registerEventType` API." + ], + "signature": [ + "string" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.reportEvent.$2", + "type": "Uncategorized", + "tags": [], + "label": "eventData", + "description": [ + "The properties matching the schema declared in the `registerEventType` API." + ], + "signature": [ + "EventTypeData" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.registerEventType", + "type": "Function", + "tags": [], + "label": "registerEventType", + "description": [ + "\nRegisters the event type that will be emitted via the reportEvent API." + ], + "signature": [ + "(eventTypeOps: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, + ") => void" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.registerEventType.$1", + "type": "Object", + "tags": [], + "label": "eventTypeOps", + "description": [ + "The definition of the event type {@link EventTypeOpts }." + ], + "signature": [ + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, + "" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.registerShipper", + "type": "Function", + "tags": [], + "label": "registerShipper", + "description": [ + "\nSet up the shipper that will be used to report the telemetry events." + ], + "signature": [ + "(Shipper: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, + ", shipperConfig: ShipperConfig, opts?: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, + " | undefined) => void" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.registerShipper.$1", + "type": "Object", + "tags": [], + "label": "Shipper", + "description": [ + "The {@link IShipper } class to instantiate the shipper." + ], + "signature": [ + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, + "" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.registerShipper.$2", + "type": "Uncategorized", + "tags": [], + "label": "shipperConfig", + "description": [ + "The config specific to the Shipper to instantiate." + ], + "signature": [ + "ShipperConfig" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.registerShipper.$3", + "type": "Object", + "tags": [], + "label": "opts", + "description": [ + "Additional options to register the shipper {@link RegisterShipperOpts }." + ], + "signature": [ + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, + " | undefined" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.optIn", + "type": "Function", + "tags": [], + "label": "optIn", + "description": [ + "\nUsed to control the user's consent to report the data.\nIn the advanced mode, it allows to \"cherry-pick\" which events and shippers are enabled/disabled." + ], + "signature": [ + "(optInConfig: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, + ") => void" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.optIn.$1", + "type": "Object", + "tags": [], + "label": "optInConfig", + "description": [ + "{@link OptInConfig }" + ], + "signature": [ + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + } + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-server.IAnalyticsClient.registerContextProvider", + "type": "Function", + "tags": [ + "track-adoption" + ], + "label": "registerContextProvider", + "description": [ + "\nRegisters the context provider to enrich any reported events." + ], + "signature": [ + "(contextProviderOpts: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, + ") => void" + ], + "path": "packages/analytics/client/src/analytics_client/types.ts", + "deprecated": false, + "trackAdoption": true, + "references": [ + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.ts" + }, + { + "plugin": "@kbn/core-elasticsearch-server-internal", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.ts" + }, + { + "plugin": "@kbn/core-environment-server-internal", + "path": "packages/core/environment/core-environment-server-internal/src/environment_service.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "licensing", + "path": "x-pack/plugins/licensing/common/register_analytics_context_provider.ts" + }, + { + "plugin": "cloud", + "path": "x-pack/plugins/cloud/common/register_cloud_deployment_id_analytics_context.ts" + }, + { + "plugin": "telemetry", + "path": "src/plugins/telemetry/server/plugin.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.ts" + }, + { + "plugin": "telemetry", + "path": "src/plugins/telemetry/public/plugin.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/analytics_client.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-mocks", + "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/analytics_service.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/analytics_service.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.test.ts" + }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-elasticsearch-server-internal", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/analytics-client", + "path": "packages/analytics/client/src/analytics_client/mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.ts" + }, { - "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.registerAuth.$1", - "type": "Function", - "tags": [], - "label": "handler", - "description": [ - "{@link AuthenticationHandler } - function to perform authentication." - ], - "signature": [ - "AuthenticationHandler" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.ts" } ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.registerOnPostAuth", - "type": "Function", - "tags": [], - "label": "registerOnPostAuth", - "description": [ - "\nTo define custom logic after Auth interceptor did make sure a user has access to the requested resource.\n" - ], - "signature": [ - "(handler: ", - "OnPostAuthHandler", - ") => void" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.registerOnPostAuth.$1", - "type": "Function", + "id": "def-server.IAnalyticsClient.registerContextProvider.$1", + "type": "Object", "tags": [], - "label": "handler", + "label": "contextProviderOpts", "description": [ - "{@link OnPostAuthHandler } - function to call." + "{@link ContextProviderOpts }" ], "signature": [ - "OnPostAuthHandler" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, + "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26799,35 +31961,33 @@ }, { "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.registerOnPreResponse", + "id": "def-server.IAnalyticsClient.removeContextProvider", "type": "Function", "tags": [], - "label": "registerOnPreResponse", + "label": "removeContextProvider", "description": [ - "\nTo define custom logic to perform for the server response.\n" + "\nRemoves the context provider and stop enriching the events from its context." ], "signature": [ - "(handler: ", - "OnPreResponseHandler", - ") => void" + "(contextProviderName: string) => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.registerOnPreResponse.$1", - "type": "Function", + "id": "def-server.IAnalyticsClient.removeContextProvider.$1", + "type": "string", "tags": [], - "label": "handler", + "label": "contextProviderName", "description": [ - "{@link OnPreResponseHandler } - function to call." + "The name of the context provider to remove." ], "signature": [ - "OnPreResponseHandler" + "string" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -26837,244 +31997,42 @@ }, { "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.basePath", - "type": "Object", - "tags": [], - "label": "basePath", - "description": [ - "\nAccess or manipulate the Kibana base path\nSee {@link IBasePath}." - ], - "signature": [ - "IBasePath" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.csp", + "id": "def-server.IAnalyticsClient.telemetryCounter$", "type": "Object", "tags": [], - "label": "csp", - "description": [ - "\nThe CSP config used for Kibana." - ], - "signature": [ - "ICspConfig" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.createRouter", - "type": "Function", - "tags": [], - "label": "createRouter", - "description": [ - "\nProvides ability to declare a handler function for a particular path and HTTP request method.\n" - ], - "signature": [ - "() => ", - "IRouter", - "" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.registerRouteHandlerContext", - "type": "Function", - "tags": [], - "label": "registerRouteHandlerContext", + "label": "telemetryCounter$", "description": [ - "\nRegister a context provider for a route handler." + "\nObservable to emit the stats of the processed events." ], "signature": [ - ">(contextName: ContextName, provider: ", - "IContextProvider", - ") => ", - "IContextContainer" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + "Observable", + "<", { - "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.registerRouteHandlerContext.$1", - "type": "Uncategorized", - "tags": [], - "label": "contextName", - "description": [], - "signature": [ - "ContextName" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" }, - { - "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.registerRouteHandlerContext.$2", - "type": "Function", - "tags": [], - "label": "provider", - "description": [], - "signature": [ - "IContextProvider", - "" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-server.HttpServiceSetup.getServerInfo", - "type": "Function", - "tags": [], - "label": "getServerInfo", - "description": [ - "\nProvides common {@link HttpServerInfo | information} about the running http server." - ], - "signature": [ - "() => ", - "HttpServerInfo" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.HttpServiceStart", - "type": "Interface", - "tags": [], - "label": "HttpServiceStart", - "description": [], - "signature": [ - "HttpServiceStart" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.HttpServiceStart.basePath", - "type": "Object", - "tags": [], - "label": "basePath", - "description": [ - "\nAccess or manipulate the Kibana base path\nSee {@link IBasePath}." - ], - "signature": [ - "IBasePath" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "core", - "id": "def-server.HttpServiceStart.auth", - "type": "Object", - "tags": [], - "label": "auth", - "description": [ - "\nAuth status.\nSee {@link HttpAuth}" - ], - "signature": [ - "HttpAuth" + ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "core", - "id": "def-server.HttpServiceStart.getServerInfo", - "type": "Function", - "tags": [], - "label": "getServerInfo", - "description": [ - "\nProvides common {@link HttpServerInfo | information} about the running http server." - ], - "signature": [ - "() => ", - "HttpServerInfo" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.I18nServiceSetup", - "type": "Interface", - "tags": [], - "label": "I18nServiceSetup", - "description": [], - "signature": [ - "I18nServiceSetup" - ], - "path": "node_modules/@types/kbn__core-i18n-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.I18nServiceSetup.getLocale", - "type": "Function", - "tags": [], - "label": "getLocale", - "description": [ - "\nReturn the locale currently in use." - ], - "signature": [ - "() => string" - ], - "path": "node_modules/@types/kbn__core-i18n-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "core", - "id": "def-server.I18nServiceSetup.getTranslationFiles", + "id": "def-server.IAnalyticsClient.shutdown", "type": "Function", "tags": [], - "label": "getTranslationFiles", + "label": "shutdown", "description": [ - "\nReturn the absolute paths to translation files currently in use." + "\nStops the client." ], "signature": [ - "() => string[]" + "() => void" ], - "path": "node_modules/@types/kbn__core-i18n-server/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -27092,10 +32050,7 @@ "description": [ "\nAccess or manipulate the Kibana base path\n" ], - "signature": [ - "IBasePath" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -27108,7 +32063,7 @@ "description": [ "\nreturns the server's basePath.\n\nSee {@link IBasePath.get} for getting the basePath value for a specific request" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false }, @@ -27124,7 +32079,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false }, @@ -27139,10 +32094,16 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => string" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -27154,10 +32115,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -27176,10 +32143,16 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", requestSpecificBasePath: string) => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -27191,10 +32164,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -27209,7 +32188,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -27229,7 +32208,7 @@ "signature": [ "(path: string) => string" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -27243,7 +32222,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -27263,7 +32242,7 @@ "signature": [ "(path: string) => string" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -27277,7 +32256,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/base_path.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -27297,10 +32276,7 @@ "description": [ "\nRepresents an Elasticsearch cluster API client created by the platform.\nIt allows to call API on behalf of the internal Kibana user and\nthe actual user that is derived from the request headers (via `asScoped(...)`).\n" ], - "signature": [ - "IClusterClient" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/cluster_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28502,7 +33478,7 @@ "default", "; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/cluster_client.ts", "deprecated": false, "trackAdoption": false }, @@ -28517,11 +33493,23 @@ ], "signature": [ "(request: ", - "ScopeableRequest", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ScopeableRequest", + "text": "ScopeableRequest" + }, ") => ", - "IScopedClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/cluster_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28533,9 +33521,15 @@ "label": "request", "description": [], "signature": [ - "ScopeableRequest" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ScopeableRequest", + "text": "ScopeableRequest" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/cluster_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -28555,10 +33549,7 @@ "description": [ "\nAn object that handles registration of context providers and configuring handlers with context.\n" ], - "signature": [ - "IContextContainer" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_container.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28573,12 +33564,24 @@ ], "signature": [ "(pluginOpaqueId: symbol, contextName: ContextName, provider: ", - "IContextProvider", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IContextProvider", + "text": "IContextProvider" + }, ") => this" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_container.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28594,7 +33597,7 @@ "signature": [ "symbol" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_container.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -28611,7 +33614,7 @@ "signature": [ "ContextName" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_container.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -28626,10 +33629,16 @@ "- A {@link IContextProvider } to be called each time a new context is created." ], "signature": [ - "IContextProvider", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IContextProvider", + "text": "IContextProvider" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_container.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -28650,20 +33659,56 @@ ], "signature": [ "(pluginOpaqueId: symbol, handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, ") => (request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ") => Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_container.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28679,7 +33724,7 @@ "signature": [ "symbol" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_container.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -28694,14 +33739,32 @@ "- Handler function to pass context object to." ], "signature": [ - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_container.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -28723,10 +33786,7 @@ "description": [ "\nCSP configuration for use in Kibana." ], - "signature": [ - "ICspConfig" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/csp.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28739,7 +33799,7 @@ "description": [ "\nSpecify whether browsers that do not support CSP should be\nable to use Kibana. Use `true` to block and `false` to allow." ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/csp.ts", "deprecated": false, "trackAdoption": false }, @@ -28752,7 +33812,7 @@ "description": [ "\nSpecify whether users with legacy browsers should be warned\nabout their lack of Kibana security compliance." ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/csp.ts", "deprecated": false, "trackAdoption": false }, @@ -28765,7 +33825,7 @@ "description": [ "\nWhether or not embedding (using iframes) should be allowed by the CSP. If embedding is disabled, a restrictive 'frame-ancestors' rule will be added to the default CSP rules." ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/csp.ts", "deprecated": false, "trackAdoption": false }, @@ -28778,7 +33838,7 @@ "description": [ "\nThe CSP rules in a formatted directives string for use\nin a `Content-Security-Policy` header." ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/csp.ts", "deprecated": false, "trackAdoption": false } @@ -28795,11 +33855,23 @@ "\nSee {@link IClusterClient}\n" ], "signature": [ - "ICustomClusterClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ICustomClusterClient", + "text": "ICustomClusterClient" + }, " extends ", - "IClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IClusterClient", + "text": "IClusterClient" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/cluster_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28815,7 +33887,7 @@ "signature": [ "() => Promise" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/cluster_client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28834,10 +33906,16 @@ "\nCreating a new instance from EventLoopDelaysMonitor will\nautomatically start tracking event loop delays.\nSee {@link IntervalHistogram}" ], "signature": [ - "IEventLoopDelaysMonitor", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.IEventLoopDelaysMonitor", + "text": "IEventLoopDelaysMonitor" + }, "" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/collectors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28848,12 +33926,12 @@ "tags": [], "label": "collect", "description": [ - "\nCollect gathers event loop delays metrics from nodejs perf_hooks.monitorEventLoopDelay\nthe histogram calculations start from the last time `reset` was called or this\nEventLoopDelaysMonitor instance was created.\n\nReturns metrics in milliseconds.\n " + "\nCollect gathers event loop delays metrics from nodejs perf_hooks.monitorEventLoopDelay\nthe histogram calculations start from the last time `reset` was called or this\nEventLoopDelaysMonitor instance was created.\n\nReturns metrics in milliseconds." ], "signature": [ "() => T" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/collectors.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28871,7 +33949,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/collectors.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28889,7 +33967,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/collectors.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28905,10 +33983,7 @@ "tags": [], "label": "IExecutionContextContainer", "description": [], - "signature": [ - "IExecutionContextContainer" - ], - "path": "node_modules/@types/kbn__core-execution-context-server/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28922,7 +33997,7 @@ "signature": [ "() => string" ], - "path": "node_modules/@types/kbn__core-execution-context-server/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28937,10 +34012,16 @@ "description": [], "signature": [ "() => Readonly<", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, ">" ], - "path": "node_modules/@types/kbn__core-execution-context-server/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28958,10 +34039,7 @@ "description": [ "\nExternal Url configuration for use in Kibana." ], - "signature": [ - "IExternalUrlConfig" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/external_url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28975,10 +34053,16 @@ "\nA set of policies describing which external urls are allowed." ], "signature": [ - "IExternalUrlPolicy", + { + "pluginId": "@kbn/core-http-common", + "scope": "common", + "docId": "kibKbnCoreHttpCommonPluginApi", + "section": "def-common.IExternalUrlPolicy", + "text": "IExternalUrlPolicy" + }, "[]" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/external_url.ts", "deprecated": false, "trackAdoption": false } @@ -28994,10 +34078,7 @@ "description": [ "\nA policy describing whether access to an external destination is allowed." ], - "signature": [ - "IExternalUrlPolicy" - ], - "path": "node_modules/@types/kbn__core-http-common/index.d.ts", + "path": "packages/core/http/core-http-common/src/external_url_policy.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29010,7 +34091,7 @@ "description": [ "\nIndicates if this policy allows or denies access to the described destination." ], - "path": "node_modules/@types/kbn__core-http-common/index.d.ts", + "path": "packages/core/http/core-http-common/src/external_url_policy.ts", "deprecated": false, "trackAdoption": false }, @@ -29026,7 +34107,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-http-common/index.d.ts", + "path": "packages/core/http/core-http-common/src/external_url_policy.ts", "deprecated": false, "trackAdoption": false }, @@ -29042,7 +34123,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-http-common/index.d.ts", + "path": "packages/core/http/core-http-common/src/external_url_policy.ts", "deprecated": false, "trackAdoption": false } @@ -29059,10 +34140,16 @@ "\nA response data object, expected to returned as a result of {@link RequestHandler} execution" ], "signature": [ - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29073,7 +34160,7 @@ "tags": [], "label": "status", "description": [], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false }, @@ -29087,7 +34174,7 @@ "signature": [ "T | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false }, @@ -29099,9 +34186,15 @@ "label": "options", "description": [], "signature": [ - "HttpResponseOptions" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false } @@ -29117,10 +34210,7 @@ "description": [ "\nA tiny abstraction for TCP socket." ], - "signature": [ - "IKibanaSocket" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29142,7 +34232,7 @@ "DetailedPeerCertificate", " | null; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29156,7 +34246,7 @@ "signature": [ "true" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -29182,7 +34272,7 @@ "DetailedPeerCertificate", " | null; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29196,7 +34286,7 @@ "signature": [ "false" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -29224,7 +34314,7 @@ "DetailedPeerCertificate", " | null; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29240,7 +34330,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -29262,7 +34352,7 @@ "signature": [ "() => string | null" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -29280,7 +34370,7 @@ "signature": [ "(options: { rejectUnauthorized?: boolean | undefined; requestCert?: boolean | undefined; }) => Promise" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29291,7 +34381,7 @@ "tags": [], "label": "options", "description": [], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29305,7 +34395,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false }, @@ -29319,7 +34409,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false } @@ -29342,7 +34432,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false }, @@ -29358,7 +34448,7 @@ "signature": [ "Error | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/socket.ts", "deprecated": false, "trackAdoption": false } @@ -29374,10 +34464,7 @@ "description": [ "\nan IntervalHistogram object that samples and reports the event loop delay over time.\nThe delays will be reported in milliseconds.\n" ], - "signature": [ - "IntervalHistogram" - ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29388,7 +34475,7 @@ "tags": [], "label": "fromTimestamp", "description": [], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -29399,7 +34486,7 @@ "tags": [], "label": "lastUpdatedAt", "description": [], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -29410,7 +34497,7 @@ "tags": [], "label": "min", "description": [], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -29421,7 +34508,7 @@ "tags": [], "label": "max", "description": [], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -29432,7 +34519,7 @@ "tags": [], "label": "mean", "description": [], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -29443,7 +34530,7 @@ "tags": [], "label": "exceeds", "description": [], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -29454,7 +34541,7 @@ "tags": [], "label": "stddev", "description": [], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -29468,7 +34555,7 @@ "signature": [ "{ 50: number; 75: number; 95: number; 99: number; }" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false } @@ -29485,10 +34572,16 @@ "\nRegisters route handlers for specified resource path and method.\nSee {@link RouteConfig} and {@link RequestHandler} for more information about arguments to route registrations.\n" ], "signature": [ - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29501,7 +34594,7 @@ "description": [ "\nResulted path" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false }, @@ -29516,14 +34609,32 @@ ], "signature": [ "(route: ", - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, ", handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -29538,10 +34649,16 @@ "{@link RouteConfig } - a route configuration." ], "signature": [ - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false }, @@ -29556,16 +34673,40 @@ ], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -29580,7 +34721,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -29592,10 +34733,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -29609,7 +34756,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -29628,14 +34775,32 @@ ], "signature": [ "(route: ", - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, ", handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -29650,10 +34815,16 @@ "{@link RouteConfig } - a route configuration." ], "signature": [ - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false }, @@ -29668,16 +34839,40 @@ ], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -29692,7 +34887,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -29704,10 +34899,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -29721,7 +34922,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -29740,14 +34941,32 @@ ], "signature": [ "(route: ", - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, ", handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -29762,10 +34981,16 @@ "{@link RouteConfig } - a route configuration." ], "signature": [ - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false }, @@ -29780,16 +35005,40 @@ ], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -29804,7 +35053,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -29816,10 +35065,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -29833,7 +35088,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -29852,14 +35107,32 @@ ], "signature": [ "(route: ", - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, ", handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -29874,10 +35147,16 @@ "{@link RouteConfig } - a route configuration." ], "signature": [ - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false }, @@ -29892,16 +35171,40 @@ ], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -29916,7 +35219,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -29928,10 +35231,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -29945,7 +35254,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -29964,14 +35273,32 @@ ], "signature": [ "(route: ", - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, ", handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -29986,10 +35313,16 @@ "{@link RouteConfig } - a route configuration." ], "signature": [ - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false }, @@ -30004,16 +35337,40 @@ ], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -30028,7 +35385,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -30040,10 +35397,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -30057,7 +35420,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -30076,22 +35439,64 @@ ], "signature": [ "(handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, ") => ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -30107,14 +35512,32 @@ ], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ResponseFactory) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -30129,7 +35552,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -30141,10 +35564,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -30158,7 +35587,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -30178,10 +35607,7 @@ "description": [ "\nUtility class used to export savedObjects.\n" ], - "signature": [ - "ISavedObjectsExporter" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30198,12 +35624,18 @@ ], "signature": [ "(options: ", - "SavedObjectsExportByTypeOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportByTypeOptions", + "text": "SavedObjectsExportByTypeOptions" + }, ") => Promise<", "Readable", ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30215,9 +35647,15 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsExportByTypeOptions" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportByTypeOptions", + "text": "SavedObjectsExportByTypeOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30238,12 +35676,18 @@ ], "signature": [ "(options: ", - "SavedObjectsExportByObjectOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportByObjectOptions", + "text": "SavedObjectsExportByObjectOptions" + }, ") => Promise<", "Readable", ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30255,9 +35699,15 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsExportByObjectOptions" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportByObjectOptions", + "text": "SavedObjectsExportByObjectOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30277,10 +35727,7 @@ "description": [ "\nUtility class used to import savedObjects.\n" ], - "signature": [ - "ISavedObjectsImporter" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30297,12 +35744,24 @@ ], "signature": [ "(options: ", - "SavedObjectsImportOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsImportOptions", + "text": "SavedObjectsImportOptions" + }, ") => Promise<", - "SavedObjectsImportResponse", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportResponse", + "text": "SavedObjectsImportResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30314,9 +35773,15 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsImportOptions" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsImportOptions", + "text": "SavedObjectsImportOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30337,12 +35802,24 @@ ], "signature": [ "(options: ", - "SavedObjectsResolveImportErrorsOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsResolveImportErrorsOptions", + "text": "SavedObjectsResolveImportErrorsOptions" + }, ") => Promise<", - "SavedObjectsImportResponse", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportResponse", + "text": "SavedObjectsImportResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30354,9 +35831,15 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsResolveImportErrorsOptions" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsResolveImportErrorsOptions", + "text": "SavedObjectsResolveImportErrorsOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30375,10 +35858,16 @@ "label": "ISavedObjectsPointInTimeFinder", "description": [], "signature": [ - "ISavedObjectsPointInTimeFinder", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsPointInTimeFinder", + "text": "ISavedObjectsPointInTimeFinder" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create_point_in_time_finder.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30393,10 +35882,16 @@ ], "signature": [ "() => AsyncGenerator<", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, ", any, unknown>" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create_point_in_time_finder.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -30414,7 +35909,7 @@ "signature": [ "() => Promise" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create_point_in_time_finder.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -30432,10 +35927,7 @@ "description": [ "\nThe savedObjects repository contract.\n" ], - "signature": [ - "ISavedObjectsRepository" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30456,12 +35948,24 @@ ], "signature": [ "(type: string, attributes: T, options?: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30475,7 +35979,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30490,7 +35994,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30503,10 +36007,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -30530,14 +36040,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "[], options?: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30551,10 +36079,16 @@ "- [{ type, id, attributes, references, migrationVersion }]" ], "signature": [ - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30567,10 +36101,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -30591,14 +36131,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsCheckConflictsObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsObject", + "text": "SavedObjectsCheckConflictsObject" + }, "[], options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsCheckConflictsResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsResponse", + "text": "SavedObjectsCheckConflictsResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30610,10 +36168,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsCheckConflictsObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsObject", + "text": "SavedObjectsCheckConflictsObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30626,10 +36190,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -30650,10 +36220,16 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + }, " | undefined) => Promise<{}>" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30667,7 +36243,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30682,7 +36258,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30695,10 +36271,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -30717,14 +36299,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkDeleteObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteObject", + "text": "SavedObjectsBulkDeleteObject" + }, "[], options?: ", - "SavedObjectsBulkDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkDeleteResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteResponse", + "text": "SavedObjectsBulkDeleteResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30738,10 +36338,16 @@ "- an array of objects containing id and type" ], "signature": [ - "SavedObjectsBulkDeleteObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteObject", + "text": "SavedObjectsBulkDeleteObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30754,10 +36360,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBulkDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -30778,10 +36390,16 @@ ], "signature": [ "(namespace: string, options?: ", - "SavedObjectsDeleteByNamespaceOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteByNamespaceOptions", + "text": "SavedObjectsDeleteByNamespaceOptions" + }, " | undefined) => Promise" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30795,7 +36413,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30808,10 +36426,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsDeleteByNamespaceOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteByNamespaceOptions", + "text": "SavedObjectsDeleteByNamespaceOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -30845,12 +36469,24 @@ "description": [], "signature": [ "(options: ", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ") => Promise<", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30862,9 +36498,15 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsFindOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30887,14 +36529,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkGetObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkGetObject", + "text": "SavedObjectsBulkGetObject" + }, "[], options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30908,10 +36568,16 @@ "- an array of objects containing id, type and optionally fields" ], "signature": [ - "SavedObjectsBulkGetObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkGetObject", + "text": "SavedObjectsBulkGetObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30924,10 +36590,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -30950,14 +36622,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkResolveObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveObject", + "text": "SavedObjectsBulkResolveObject" + }, "[], options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveResponse", + "text": "SavedObjectsBulkResolveResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -30971,10 +36661,16 @@ "- an array of objects containing id, type" ], "signature": [ - "SavedObjectsBulkResolveObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveObject", + "text": "SavedObjectsBulkResolveObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -30987,10 +36683,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31013,12 +36715,24 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31032,7 +36746,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31047,7 +36761,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31060,10 +36774,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31086,12 +36806,24 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsResolveResponse", + "text": "SavedObjectsResolveResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31105,7 +36837,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31120,7 +36852,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31133,10 +36865,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31161,12 +36899,24 @@ ], "signature": [ "(type: string, id: string, attributes: Partial, options?: ", - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, " | undefined) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31180,7 +36930,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31195,7 +36945,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31210,7 +36960,7 @@ "signature": [ "Partial" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31223,10 +36973,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31245,14 +37001,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsCollectMultiNamespaceReferencesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesObject", + "text": "SavedObjectsCollectMultiNamespaceReferencesObject" + }, "[], options?: ", - "SavedObjectsCollectMultiNamespaceReferencesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesOptions", + "text": "SavedObjectsCollectMultiNamespaceReferencesOptions" + }, " | undefined) => Promise<", - "SavedObjectsCollectMultiNamespaceReferencesResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesResponse", + "text": "SavedObjectsCollectMultiNamespaceReferencesResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31266,10 +37040,16 @@ "The objects to get the references for." ], "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesObject", + "text": "SavedObjectsCollectMultiNamespaceReferencesObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31282,10 +37062,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesOptions", + "text": "SavedObjectsCollectMultiNamespaceReferencesOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31304,14 +37090,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsUpdateObjectsSpacesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesObject", + "text": "SavedObjectsUpdateObjectsSpacesObject" + }, "[], spacesToAdd: string[], spacesToRemove: string[], options?: ", - "SavedObjectsUpdateObjectsSpacesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesOptions", + "text": "SavedObjectsUpdateObjectsSpacesOptions" + }, " | undefined) => Promise<", - "SavedObjectsUpdateObjectsSpacesResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesResponse", + "text": "SavedObjectsUpdateObjectsSpacesResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31323,10 +37127,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsUpdateObjectsSpacesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesObject", + "text": "SavedObjectsUpdateObjectsSpacesObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31341,7 +37151,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31356,7 +37166,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31369,10 +37179,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsUpdateObjectsSpacesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesOptions", + "text": "SavedObjectsUpdateObjectsSpacesOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31394,14 +37210,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "[], options?: ", - "SavedObjectsBulkUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateOptions", + "text": "SavedObjectsBulkUpdateOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateResponse", + "text": "SavedObjectsBulkUpdateResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31415,10 +37249,16 @@ "- [{ type, id, attributes, options: { version, namespace } references }]" ], "signature": [ - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31431,10 +37271,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBulkUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateOptions", + "text": "SavedObjectsBulkUpdateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31455,12 +37301,24 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsRemoveReferencesToOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToOptions", + "text": "SavedObjectsRemoveReferencesToOptions" + }, " | undefined) => Promise<", - "SavedObjectsRemoveReferencesToResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToResponse", + "text": "SavedObjectsRemoveReferencesToResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31474,7 +37332,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31489,7 +37347,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31502,10 +37360,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsRemoveReferencesToOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToOptions", + "text": "SavedObjectsRemoveReferencesToOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31524,14 +37388,32 @@ ], "signature": [ "(type: string, id: string, counterFields: (string | ", - "SavedObjectsIncrementCounterField", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterField", + "text": "SavedObjectsIncrementCounterField" + }, ")[], options?: ", - "SavedObjectsIncrementCounterOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterOptions", + "text": "SavedObjectsIncrementCounterOptions" + }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31547,7 +37429,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31564,7 +37446,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31580,10 +37462,16 @@ ], "signature": [ "(string | ", - "SavedObjectsIncrementCounterField", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterField", + "text": "SavedObjectsIncrementCounterField" + }, ")[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31598,10 +37486,16 @@ "- {@link SavedObjectsIncrementCounterOptions }" ], "signature": [ - "SavedObjectsIncrementCounterOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterOptions", + "text": "SavedObjectsIncrementCounterOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31625,12 +37519,24 @@ ], "signature": [ "(type: string | string[], options?: ", - "SavedObjectsOpenPointInTimeOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeOptions", + "text": "SavedObjectsOpenPointInTimeOptions" + }, " | undefined) => Promise<", - "SavedObjectsOpenPointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeResponse", + "text": "SavedObjectsOpenPointInTimeResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31644,7 +37550,7 @@ "signature": [ "string | string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31659,10 +37565,16 @@ "- {@link SavedObjectsOpenPointInTimeOptions }" ], "signature": [ - "SavedObjectsOpenPointInTimeOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeOptions", + "text": "SavedObjectsOpenPointInTimeOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31683,12 +37595,24 @@ ], "signature": [ "(id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsClosePointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClosePointInTimeResponse", + "text": "SavedObjectsClosePointInTimeResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31702,7 +37626,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31717,10 +37641,16 @@ "- {@link SavedObjectsClosePointInTimeOptions }" ], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31741,14 +37671,32 @@ ], "signature": [ "(findOptions: ", - "SavedObjectsCreatePointInTimeFinderOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + }, ", dependencies?: ", - "SavedObjectsCreatePointInTimeFinderDependencies", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, " | undefined) => ", - "ISavedObjectsPointInTimeFinder", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsPointInTimeFinder", + "text": "ISavedObjectsPointInTimeFinder" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31760,9 +37708,15 @@ "label": "findOptions", "description": [], "signature": [ - "SavedObjectsCreatePointInTimeFinderOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31775,10 +37729,16 @@ "label": "dependencies", "description": [], "signature": [ - "SavedObjectsCreatePointInTimeFinderDependencies", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31798,10 +37758,7 @@ "description": [ "\nA serializer that can be used to manually convert {@link SavedObjectsRawDoc | raw} or\n{@link SavedObjectSanitizedDoc | sanitized} documents to the other kind.\n" ], - "signature": [ - "ISavedObjectsSerializer" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31816,12 +37773,24 @@ ], "signature": [ "(doc: ", - "SavedObjectsRawDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDoc", + "text": "SavedObjectsRawDoc" + }, ", options?: ", - "SavedObjectsRawDocParseOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDocParseOptions", + "text": "SavedObjectsRawDocParseOptions" + }, " | undefined) => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31835,9 +37804,15 @@ "- The raw ES document to be tested" ], "signature": [ - "SavedObjectsRawDoc" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDoc", + "text": "SavedObjectsRawDoc" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31852,10 +37827,16 @@ "- Options for parsing the raw document." ], "signature": [ - "SavedObjectsRawDocParseOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDocParseOptions", + "text": "SavedObjectsRawDocParseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31874,14 +37855,32 @@ ], "signature": [ "(doc: ", - "SavedObjectsRawDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDoc", + "text": "SavedObjectsRawDoc" + }, ", options?: ", - "SavedObjectsRawDocParseOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDocParseOptions", + "text": "SavedObjectsRawDocParseOptions" + }, " | undefined) => ", - "SavedObjectSanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectSanitizedDoc", + "text": "SavedObjectSanitizedDoc" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31895,9 +37894,15 @@ "- The raw ES document to be converted to saved object format." ], "signature": [ - "SavedObjectsRawDoc" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDoc", + "text": "SavedObjectsRawDoc" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31912,10 +37917,16 @@ "- Options for parsing the raw document." ], "signature": [ - "SavedObjectsRawDocParseOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDocParseOptions", + "text": "SavedObjectsRawDocParseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -31934,11 +37945,23 @@ ], "signature": [ "(savedObj: ", - "SavedObjectSanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectSanitizedDoc", + "text": "SavedObjectSanitizedDoc" + }, ") => ", - "SavedObjectsRawDoc" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDoc", + "text": "SavedObjectsRawDoc" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31952,10 +37975,16 @@ "- The saved object to be converted to raw ES format." ], "signature": [ - "SavedObjectSanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectSanitizedDoc", + "text": "SavedObjectSanitizedDoc" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -31975,7 +38004,7 @@ "signature": [ "(namespace: string | undefined, type: string, id: string) => string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31991,7 +38020,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -32008,7 +38037,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32025,7 +38054,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32045,7 +38074,7 @@ "signature": [ "(namespace: string | undefined, type: string, id: string) => string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -32061,7 +38090,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -32078,7 +38107,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32095,7 +38124,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32115,10 +38144,7 @@ "description": [ "\nRegistry holding information about all the registered {@link SavedObjectsType | saved object types}." ], - "signature": [ - "ISavedObjectTypeRegistry" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -32133,10 +38159,16 @@ ], "signature": [ "(type: string) => ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -32150,7 +38182,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32169,10 +38201,16 @@ ], "signature": [ "() => ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -32189,10 +38227,16 @@ ], "signature": [ "() => ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -32209,10 +38253,16 @@ ], "signature": [ "() => ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -32230,7 +38280,7 @@ "signature": [ "(type: string) => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -32244,7 +38294,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32264,7 +38314,7 @@ "signature": [ "(type: string) => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -32278,7 +38328,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32298,7 +38348,7 @@ "signature": [ "(type: string) => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -32312,7 +38362,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32332,7 +38382,7 @@ "signature": [ "(type: string) => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -32346,7 +38396,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32366,7 +38416,7 @@ "signature": [ "(type: string) => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -32380,7 +38430,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32400,7 +38450,7 @@ "signature": [ "(type: string) => string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -32414,7 +38464,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32434,7 +38484,7 @@ "signature": [ "(type: string) => boolean" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -32448,7 +38498,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/type_registry.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -32468,10 +38518,7 @@ "description": [ "\nServes the same purpose as the normal {@link IClusterClient | cluster client} but exposes\nan additional `asCurrentUser` method that doesn't use credentials of the Kibana internal\nuser (as `asInternalUser` does) to request Elasticsearch API, but rather passes HTTP headers\nextracted from the current user request to the API instead.\n" ], - "signature": [ - "IScopedClusterClient" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/scoped_cluster_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -33673,7 +39720,7 @@ "default", "; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/scoped_cluster_client.ts", "deprecated": false, "trackAdoption": false }, @@ -34875,7 +40922,7 @@ "default", "; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/scoped_cluster_client.ts", "deprecated": false, "trackAdoption": false } @@ -34891,10 +40938,7 @@ "description": [ "\nBasic structure of a Shipper" ], - "signature": [ - "IShipper" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -34909,10 +40953,16 @@ ], "signature": [ "(events: ", - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]) => void" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -34926,10 +40976,16 @@ "batched events {@link Event }" ], "signature": [ - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -34949,7 +41005,7 @@ "signature": [ "(isOptedIn: boolean) => void" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -34965,7 +41021,7 @@ "signature": [ "boolean" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -34984,10 +41040,16 @@ ], "signature": [ "((newContext: ", - "EventContext", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + }, ") => void) | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35001,9 +41063,15 @@ "The full new context to set {@link EventContext }" ], "signature": [ - "EventContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + } ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35023,10 +41091,16 @@ "signature": [ "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, "> | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false }, @@ -35042,7 +41116,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/shippers/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -35060,10 +41134,7 @@ "description": [ "\nServer-side client that provides access to the advanced settings stored in elasticsearch.\nThe settings provide control over the behavior of the Kibana application.\nFor example, a user can specify how to display numeric or date fields.\nUsers can adjust the settings via Management UI.\n" ], - "signature": [ - "IUiSettingsClient" - ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35078,10 +41149,16 @@ ], "signature": [ "() => Readonly>" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -35099,7 +41176,7 @@ "signature": [ "(key: string) => Promise" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35113,7 +41190,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35133,7 +41210,7 @@ "signature": [ "() => Promise>" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -35150,10 +41227,16 @@ ], "signature": [ "() => Promise>>" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -35171,7 +41254,7 @@ "signature": [ "(changes: Record) => Promise" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35185,7 +41268,7 @@ "signature": [ "Record" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35205,7 +41288,7 @@ "signature": [ "(key: string, value: any) => Promise" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35219,7 +41302,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35234,7 +41317,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35254,7 +41337,7 @@ "signature": [ "(key: string) => Promise" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35268,7 +41351,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35288,7 +41371,7 @@ "signature": [ "(keys: string[]) => Promise" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35302,7 +41385,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35322,7 +41405,7 @@ "signature": [ "(key: string) => boolean" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35336,7 +41419,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35356,7 +41439,7 @@ "signature": [ "(key: string) => boolean" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35370,7 +41453,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35391,10 +41474,16 @@ "\nKibana specific abstraction for an incoming request." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35407,7 +41496,7 @@ "description": [ "\nA identifier to identify this request.\n" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35420,7 +41509,7 @@ "description": [ "\nA UUID to identify this request.\n" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35436,7 +41525,7 @@ "signature": [ "URL" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35451,14 +41540,32 @@ ], "signature": [ "{ readonly path: string; readonly method: ", - "RecursiveReadonly", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonly", + "text": "RecursiveReadonly" + }, "; readonly options: ", - "RecursiveReadonly", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonly", + "text": "RecursiveReadonly" + }, "<", - "KibanaRequestRouteOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequestRouteOptions", + "text": "KibanaRequestRouteOptions" + }, ">; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35474,7 +41581,7 @@ "signature": [ "{ accept?: string | string[] | undefined; \"accept-language\"?: string | string[] | undefined; \"accept-patch\"?: string | string[] | undefined; \"accept-ranges\"?: string | string[] | undefined; \"access-control-allow-credentials\"?: string | string[] | undefined; \"access-control-allow-headers\"?: string | string[] | undefined; \"access-control-allow-methods\"?: string | string[] | undefined; \"access-control-allow-origin\"?: string | string[] | undefined; \"access-control-expose-headers\"?: string | string[] | undefined; \"access-control-max-age\"?: string | string[] | undefined; \"access-control-request-headers\"?: string | string[] | undefined; \"access-control-request-method\"?: string | string[] | undefined; age?: string | string[] | undefined; allow?: string | string[] | undefined; \"alt-svc\"?: string | string[] | undefined; authorization?: string | string[] | undefined; \"cache-control\"?: string | string[] | undefined; connection?: string | string[] | undefined; \"content-disposition\"?: string | string[] | undefined; \"content-encoding\"?: string | string[] | undefined; \"content-language\"?: string | string[] | undefined; \"content-length\"?: string | string[] | undefined; \"content-location\"?: string | string[] | undefined; \"content-range\"?: string | string[] | undefined; \"content-type\"?: string | string[] | undefined; cookie?: string | string[] | undefined; date?: string | string[] | undefined; etag?: string | string[] | undefined; expect?: string | string[] | undefined; expires?: string | string[] | undefined; forwarded?: string | string[] | undefined; from?: string | string[] | undefined; host?: string | string[] | undefined; \"if-match\"?: string | string[] | undefined; \"if-modified-since\"?: string | string[] | undefined; \"if-none-match\"?: string | string[] | undefined; \"if-unmodified-since\"?: string | string[] | undefined; \"last-modified\"?: string | string[] | undefined; location?: string | string[] | undefined; origin?: string | string[] | undefined; pragma?: string | string[] | undefined; \"proxy-authenticate\"?: string | string[] | undefined; \"proxy-authorization\"?: string | string[] | undefined; \"public-key-pins\"?: string | string[] | undefined; range?: string | string[] | undefined; referer?: string | string[] | undefined; \"retry-after\"?: string | string[] | undefined; \"sec-websocket-accept\"?: string | string[] | undefined; \"sec-websocket-extensions\"?: string | string[] | undefined; \"sec-websocket-key\"?: string | string[] | undefined; \"sec-websocket-protocol\"?: string | string[] | undefined; \"sec-websocket-version\"?: string | string[] | undefined; \"set-cookie\"?: string | string[] | undefined; \"strict-transport-security\"?: string | string[] | undefined; tk?: string | string[] | undefined; trailer?: string | string[] | undefined; \"transfer-encoding\"?: string | string[] | undefined; upgrade?: string | string[] | undefined; \"user-agent\"?: string | string[] | undefined; vary?: string | string[] | undefined; via?: string | string[] | undefined; warning?: string | string[] | undefined; \"www-authenticate\"?: string | string[] | undefined; } & { [header: string]: string | string[] | undefined; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35487,7 +41594,7 @@ "description": [ "\nWhether or not the request is a \"system request\" rather than an application-level request.\nCan be set on the client using the `HttpFetchOptions#asSystemRequest` option." ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35501,9 +41608,15 @@ "\nThe socket associated with this request.\nSee {@link IKibanaSocket}." ], "signature": [ - "IKibanaSocket" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaSocket", + "text": "IKibanaSocket" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35517,9 +41630,15 @@ "\nAllow to listen to events bound to this request.\nSee {@link KibanaRequestEvents}." ], "signature": [ - "KibanaRequestEvents" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequestEvents", + "text": "KibanaRequestEvents" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35533,9 +41652,15 @@ "\nThe auth status of this request.\nSee {@link KibanaRequestAuth}." ], "signature": [ - "KibanaRequestAuth" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequestAuth", + "text": "KibanaRequestAuth" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35552,7 +41677,7 @@ "URL", " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35568,7 +41693,7 @@ "signature": [ "Params" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35584,7 +41709,7 @@ "signature": [ "Query" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35600,7 +41725,7 @@ "signature": [ "Body" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false } @@ -35616,10 +41741,7 @@ "description": [ "\nRequest events." ], - "signature": [ - "KibanaRequestEvents" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35636,7 +41758,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35653,7 +41775,7 @@ "Observable", "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false } @@ -35670,10 +41792,16 @@ "\nRequest specific route information exposed to a handler." ], "signature": [ - "KibanaRequestRoute", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequestRoute", + "text": "KibanaRequestRoute" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35684,7 +41812,7 @@ "tags": [], "label": "path", "description": [], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35698,7 +41826,7 @@ "signature": [ "Method" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false }, @@ -35711,12 +41839,24 @@ "description": [], "signature": [ "Method extends \"options\" | \"get\" ? Required, \"body\">> : Required<", - "RouteConfigOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfigOptions", + "text": "RouteConfigOptions" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false } @@ -35732,10 +41872,7 @@ "description": [ "\nLogger exposes all the necessary methods to log any type of information and\nthis is the interface used by the logging consumers including plugins.\n" ], - "signature": [ - "Logger" - ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35750,12 +41887,24 @@ ], "signature": [ "(message: string, meta?: Meta | undefined) => void" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35771,7 +41920,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35788,7 +41937,7 @@ "signature": [ "Meta | undefined" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -35807,12 +41956,24 @@ ], "signature": [ "(message: string, meta?: Meta | undefined) => void" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35828,7 +41989,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35845,7 +42006,7 @@ "signature": [ "Meta | undefined" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -35864,12 +42025,24 @@ ], "signature": [ "(message: string, meta?: Meta | undefined) => void" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35885,7 +42058,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35902,7 +42075,7 @@ "signature": [ "Meta | undefined" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -35921,12 +42094,24 @@ ], "signature": [ "(errorOrMessage: string | Error, meta?: Meta | undefined) => void" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35942,7 +42127,7 @@ "signature": [ "string | Error" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -35959,7 +42144,7 @@ "signature": [ "Meta | undefined" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -35978,12 +42163,24 @@ ], "signature": [ "(errorOrMessage: string | Error, meta?: Meta | undefined) => void" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -35999,7 +42196,7 @@ "signature": [ "string | Error" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -36016,7 +42213,7 @@ "signature": [ "Meta | undefined" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -36035,12 +42232,24 @@ ], "signature": [ "(errorOrMessage: string | Error, meta?: Meta | undefined) => void" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36056,7 +42265,7 @@ "signature": [ "string | Error" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -36073,7 +42282,7 @@ "signature": [ "Meta | undefined" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -36081,6 +42290,44 @@ ], "returnComment": [] }, + { + "parentPluginId": "core", + "id": "def-server.Logger.isLevelEnabled", + "type": "Function", + "tags": [], + "label": "isLevelEnabled", + "description": [ + "\nChecks if given level is currently enabled for this logger.\nCan be used to wrap expensive logging operations into conditional blocks\n" + ], + "signature": [ + "(level: ", + "LogLevelId", + ") => boolean" + ], + "path": "packages/kbn-logging/src/logger.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.Logger.isLevelEnabled.$1", + "type": "CompoundType", + "tags": [], + "label": "level", + "description": [ + "The log level to check for." + ], + "signature": [ + "LogLevelId" + ], + "path": "packages/kbn-logging/src/logger.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "core", "id": "def-server.Logger.get", @@ -36092,9 +42339,15 @@ ], "signature": [ "(...childContextPaths: string[]) => ", - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36108,7 +42361,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -36128,10 +42381,7 @@ "description": [ "\nDescribes the configuration of a given logger.\n" ], - "signature": [ - "LoggerConfigType" - ], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/logger.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36145,7 +42395,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/logger.ts", "deprecated": false, "trackAdoption": false }, @@ -36156,7 +42406,7 @@ "tags": [], "label": "name", "description": [], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/logger.ts", "deprecated": false, "trackAdoption": false }, @@ -36170,7 +42420,7 @@ "signature": [ "\"error\" | \"all\" | \"info\" | \"debug\" | \"off\" | \"warn\" | \"trace\" | \"fatal\"" ], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/logger.ts", "deprecated": false, "trackAdoption": false } @@ -36186,10 +42436,7 @@ "description": [ "\nInput used to configure logging dynamically using {@link LoggingServiceSetup.configure}" ], - "signature": [ - "LoggerContextConfigInput" - ], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36202,12 +42449,24 @@ "description": [], "signature": [ "Record | Map | undefined" ], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -36219,10 +42478,16 @@ "label": "loggers", "description": [], "signature": [ - "LoggerConfigType", + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.LoggerConfigType", + "text": "LoggerConfigType" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -36238,10 +42503,7 @@ "description": [ "\nThe single purpose of `LoggerFactory` interface is to define a way to\nretrieve a context-based logger instance.\n" ], - "signature": [ - "LoggerFactory" - ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36256,9 +42518,15 @@ ], "signature": [ "(...contextParts: string[]) => ", - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36274,7 +42542,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/logger_factory.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -36294,10 +42562,7 @@ "description": [ "\nProvides APIs to plugins for customizing the plugin's logger." ], - "signature": [ - "LoggingServiceSetup" - ], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36314,10 +42579,16 @@ "(config$: ", "Observable", "<", - "LoggerContextConfigInput", + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.LoggerContextConfigInput", + "text": "LoggerContextConfigInput" + }, ">) => void" ], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36331,10 +42602,16 @@ "signature": [ "Observable", "<", - "LoggerContextConfigInput", + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.LoggerContextConfigInput", + "text": "LoggerContextConfigInput" + }, ">" ], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -36354,10 +42631,7 @@ "description": [ "\nAPIs to retrieves metrics gathered and exposed by the core platform.\n" ], - "signature": [ - "MetricsServiceSetup" - ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36370,7 +42644,7 @@ "description": [ "Interval metrics are collected in milliseconds" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -36387,10 +42661,16 @@ "() => ", "Observable", "<", - "OpsMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsMetrics", + "text": "OpsMetrics" + }, ">" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -36408,10 +42688,7 @@ "description": [ "\nContains information about how this Kibana process has been configured.\n" ], - "signature": [ - "NodeInfo" - ], - "path": "node_modules/@types/kbn__core-node-server/index.d.ts", + "path": "packages/core/node/core-node-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36425,9 +42702,15 @@ "A list of roles this node has been configured with." ], "signature": [ - "NodeRoles" + { + "pluginId": "@kbn/core-node-server", + "scope": "server", + "docId": "kibKbnCoreNodeServerPluginApi", + "section": "def-server.NodeRoles", + "text": "NodeRoles" + } ], - "path": "node_modules/@types/kbn__core-node-server/index.d.ts", + "path": "packages/core/node/core-node-server/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -36443,10 +42726,7 @@ "description": [ "\nThe Kibana process can be run in dedicated \"modes\" via `node.roles`.\nThis configuration is then exposed to plugins via `NodeRoles`,\nwhich is available on the `PluginInitializerContext`.\n\nThe node roles can be used by plugins to adjust their behavior based\non the way the Kibana process has been configured.\n" ], - "signature": [ - "NodeRoles" - ], - "path": "node_modules/@types/kbn__core-node-server/index.d.ts", + "path": "packages/core/node/core-node-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36459,7 +42739,7 @@ "description": [ "\nThe backgroundTasks role includes operations which don't involve\nresponding to incoming http traffic from the UI." ], - "path": "node_modules/@types/kbn__core-node-server/index.d.ts", + "path": "packages/core/node/core-node-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -36472,7 +42752,7 @@ "description": [ "\nThe ui role covers any operations that need to occur in order\nto handle http traffic from the browser." ], - "path": "node_modules/@types/kbn__core-node-server/index.d.ts", + "path": "packages/core/node/core-node-server/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -36486,10 +42766,7 @@ "tags": [], "label": "NodesVersionCompatibility", "description": [], - "signature": [ - "NodesVersionCompatibility" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36500,7 +42777,7 @@ "tags": [], "label": "isCompatible", "description": [], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false }, @@ -36514,7 +42791,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false }, @@ -36526,10 +42803,16 @@ "label": "incompatibleNodes", "description": [], "signature": [ - "NodeInfo", + { + "pluginId": "@kbn/core-elasticsearch-server-internal", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerInternalPluginApi", + "section": "def-server.NodeInfo", + "text": "NodeInfo" + }, "[]" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false }, @@ -36541,10 +42824,16 @@ "label": "warningNodes", "description": [], "signature": [ - "NodeInfo", + { + "pluginId": "@kbn/core-elasticsearch-server-internal", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerInternalPluginApi", + "section": "def-server.NodeInfo", + "text": "NodeInfo" + }, "[]" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false }, @@ -36555,7 +42844,7 @@ "tags": [], "label": "kibanaVersion", "description": [], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false }, @@ -36569,7 +42858,7 @@ "signature": [ "Error | undefined" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false } @@ -36583,10 +42872,7 @@ "tags": [], "label": "OnPostAuthToolkit", "description": [], - "signature": [ - "OnPostAuthToolkit" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_post_auth.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36601,9 +42887,15 @@ ], "signature": [ "() => ", - "OnPostAuthNextResult" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPostAuthNextResult", + "text": "OnPostAuthNextResult" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_post_auth.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -36619,10 +42911,7 @@ "tags": [], "label": "OnPreAuthToolkit", "description": [], - "signature": [ - "OnPreAuthToolkit" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_auth.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36637,9 +42926,15 @@ ], "signature": [ "() => ", - "OnPreAuthNextResult" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreAuthNextResult", + "text": "OnPreAuthNextResult" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_auth.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -36657,10 +42952,7 @@ "description": [ "\nAdditional data to extend a response." ], - "signature": [ - "OnPreResponseExtensions" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36674,10 +42966,16 @@ "additional headers to attach to the response" ], "signature": [ - "ResponseHeaders", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseHeaders", + "text": "ResponseHeaders" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false } @@ -36693,10 +42991,7 @@ "description": [ "\nResponse status code." ], - "signature": [ - "OnPreResponseInfo" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36707,7 +43002,7 @@ "tags": [], "label": "statusCode", "description": [], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false } @@ -36723,10 +43018,7 @@ "description": [ "\nAdditional data to extend a response when rendering a new body" ], - "signature": [ - "OnPreResponseRender" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36740,10 +43032,16 @@ "additional headers to attach to the response" ], "signature": [ - "ResponseHeaders", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseHeaders", + "text": "ResponseHeaders" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false }, @@ -36756,7 +43054,7 @@ "description": [ "the body to use in the response" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false } @@ -36772,10 +43070,7 @@ "description": [ "\nA tool set defining an outcome of OnPreResponse interceptor for incoming request." ], - "signature": [ - "OnPreResponseToolkit" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36790,11 +43085,23 @@ ], "signature": [ "(responseRender: ", - "OnPreResponseRender", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseRender", + "text": "OnPreResponseRender" + }, ") => ", - "OnPreResponseResult" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseResult", + "text": "OnPreResponseResult" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36806,9 +43113,15 @@ "label": "responseRender", "description": [], "signature": [ - "OnPreResponseRender" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseRender", + "text": "OnPreResponseRender" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -36827,11 +43140,23 @@ ], "signature": [ "(responseExtensions?: ", - "OnPreResponseExtensions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseExtensions", + "text": "OnPreResponseExtensions" + }, " | undefined) => ", - "OnPreResponseResult" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseResult", + "text": "OnPreResponseResult" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36843,10 +43168,16 @@ "label": "responseExtensions", "description": [], "signature": [ - "OnPreResponseExtensions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseExtensions", + "text": "OnPreResponseExtensions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -36864,10 +43195,7 @@ "tags": [], "label": "OnPreRoutingToolkit", "description": [], - "signature": [ - "OnPreRoutingToolkit" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_routing.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36882,9 +43210,15 @@ ], "signature": [ "() => ", - "OnPreRoutingResult" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreRoutingResult", + "text": "OnPreRoutingResult" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_routing.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -36901,9 +43235,15 @@ ], "signature": [ "(url: string) => ", - "OnPreRoutingResult" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreRoutingResult", + "text": "OnPreRoutingResult" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_routing.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36917,7 +43257,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_routing.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -36937,10 +43277,7 @@ "description": [ "\nRegroups metrics gathered by all the collectors.\nThis contains metrics about the os/runtime, the kibana process and the http server.\n" ], - "signature": [ - "OpsMetrics" - ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36956,7 +43293,7 @@ "signature": [ "Date" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -36970,9 +43307,15 @@ "\nMetrics related to the elasticsearch client" ], "signature": [ - "ElasticsearchClientsMetrics" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.ElasticsearchClientsMetrics", + "text": "ElasticsearchClientsMetrics" + } ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -36988,21 +43331,19 @@ "\nProcess related metrics." ], "signature": [ - "OpsProcessMetrics" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsProcessMetrics", + "text": "OpsProcessMetrics" + } ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, "references": [ - { - "plugin": "monitoring", - "path": "x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts" - }, - { - "plugin": "kibanaUsageCollection", - "path": "src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts" - }, { "plugin": "@kbn/core-apps-browser-internal", "path": "packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts" @@ -37055,6 +43396,14 @@ "plugin": "@kbn/core-usage-data-server-internal", "path": "packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts" }, + { + "plugin": "monitoring", + "path": "x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts" + }, + { + "plugin": "kibanaUsageCollection", + "path": "src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts" + }, { "plugin": "@kbn/core-metrics-server-internal", "path": "packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.test.ts" @@ -37075,10 +43424,16 @@ "Process related metrics. Reports an array of objects for each kibana pid." ], "signature": [ - "OpsProcessMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsProcessMetrics", + "text": "OpsProcessMetrics" + }, "[]" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37092,9 +43447,15 @@ "OS related metrics" ], "signature": [ - "OpsOsMetrics" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsOsMetrics", + "text": "OpsOsMetrics" + } ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37110,7 +43471,7 @@ "signature": [ "{ avg_in_millis: number; max_in_millis: number; }" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37126,7 +43487,7 @@ "signature": [ "{ disconnects: number; total: number; statusCodes: Record; }" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37139,7 +43500,7 @@ "description": [ "number of current concurrent connections to the server" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false } @@ -37155,10 +43516,7 @@ "description": [ "\nOS related metrics" ], - "signature": [ - "OpsOsMetrics" - ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37174,7 +43532,7 @@ "signature": [ "\"linux\" | \"aix\" | \"android\" | \"darwin\" | \"freebsd\" | \"haiku\" | \"openbsd\" | \"sunos\" | \"win32\" | \"cygwin\" | \"netbsd\"" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37187,7 +43545,7 @@ "description": [ "The os platform release, prefixed by the platform name" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37203,7 +43561,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37219,7 +43577,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37235,7 +43593,7 @@ "signature": [ "{ '1m': number; '5m': number; '15m': number; }" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37251,7 +43609,7 @@ "signature": [ "{ total_in_bytes: number; free_in_bytes: number; used_in_bytes: number; }" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37264,7 +43622,7 @@ "description": [ "the OS uptime" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37280,7 +43638,7 @@ "signature": [ "{ control_group: string; usage_nanos: number; } | undefined" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37296,7 +43654,7 @@ "signature": [ "{ control_group: string; cfs_period_micros: number; cfs_quota_micros: number; stat: { number_of_elapsed_periods: number; number_of_times_throttled: number; time_throttled_nanos: number; }; } | undefined" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false } @@ -37312,10 +43670,7 @@ "description": [ "\nProcess related metrics" ], - "signature": [ - "OpsProcessMetrics" - ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37328,7 +43683,7 @@ "description": [ "pid of the kibana process" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37344,7 +43699,7 @@ "signature": [ "{ heap: { total_in_bytes: number; used_in_bytes: number; size_limit: number; }; resident_set_size_in_bytes: number; }" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37357,7 +43712,7 @@ "description": [ "mean event loop delay since last collection" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37371,9 +43726,15 @@ "node event loop delay histogram since last collection" ], "signature": [ - "IntervalHistogram" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.IntervalHistogram", + "text": "IntervalHistogram" + } ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37386,7 +43747,7 @@ "description": [ "uptime of the kibana process" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false } @@ -37402,10 +43763,7 @@ "description": [ "\nserver related metrics" ], - "signature": [ - "OpsServerMetrics" - ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37421,7 +43779,7 @@ "signature": [ "{ avg_in_millis: number; max_in_millis: number; }" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37437,7 +43795,7 @@ "signature": [ "{ disconnects: number; total: number; statusCodes: Record; }" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false }, @@ -37450,7 +43808,7 @@ "description": [ "number of current concurrent connections to the server" ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, "trackAdoption": false } @@ -37466,10 +43824,7 @@ "description": [ "\n" ], - "signature": [ - "OptInConfig" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37483,9 +43838,15 @@ "\nControls the global enabled/disabled behaviour of the client and shippers." ], "signature": [ - "OptInConfigPerType" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfigPerType", + "text": "OptInConfigPerType" + } ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37500,10 +43861,16 @@ ], "signature": [ "Record | undefined" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false } @@ -37517,10 +43884,7 @@ "tags": [], "label": "PackageInfo", "description": [], - "signature": [ - "PackageInfo" - ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37531,7 +43895,7 @@ "tags": [], "label": "version", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37542,7 +43906,7 @@ "tags": [], "label": "branch", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37553,7 +43917,7 @@ "tags": [], "label": "buildNum", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37564,7 +43928,7 @@ "tags": [], "label": "buildSha", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37575,7 +43939,7 @@ "tags": [], "label": "dist", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -37593,15 +43957,15 @@ ], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, "" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37615,15 +43979,15 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, ", plugins: TPluginsSetup) => TSetup" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37636,15 +44000,15 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, "" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -37659,7 +44023,7 @@ "signature": [ "TPluginsSetup" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -37677,15 +44041,15 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, ", plugins: TPluginsStart) => TStart" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37698,14 +44062,14 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -37720,7 +44084,7 @@ "signature": [ "TPluginsStart" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -37738,7 +44102,7 @@ "signature": [ "(() => void) | undefined" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -37758,15 +44122,15 @@ ], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginConfigDescriptor", "text": "PluginConfigDescriptor" }, "" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37780,10 +44144,16 @@ "\nProvider for the {@link ConfigDeprecation} to apply to the plugin configuration." ], "signature": [ - "ConfigDeprecationProvider", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationProvider", + "text": "ConfigDeprecationProvider" + }, " | undefined" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37798,15 +44168,15 @@ ], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.ExposedToBrowserDescriptor", "text": "ExposedToBrowserDescriptor" }, " | undefined" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37820,10 +44190,16 @@ "\nSchema to use to validate the plugin configuration.\n\n{@link PluginConfigSchema}" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37838,15 +44214,15 @@ ], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.MakeUsageFromSchema", "text": "MakeUsageFromSchema" }, " | undefined" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -37864,15 +44240,15 @@ ], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, "" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37886,7 +44262,7 @@ "signature": [ "symbol" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37899,12 +44275,24 @@ "description": [], "signature": [ "{ mode: ", - "EnvironmentMode", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.EnvironmentMode", + "text": "EnvironmentMode" + }, "; packageInfo: Readonly<", - "PackageInfo", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + }, ">; instanceUuid: string; configs: readonly string[]; }" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37918,9 +44306,15 @@ "\nAccess the configuration for this particular Kibana node.\nCan be used to determine which `roles` the current process was started with.\n" ], "signature": [ - "NodeInfo" + { + "pluginId": "@kbn/core-node-server", + "scope": "server", + "docId": "kibKbnCoreNodeServerPluginApi", + "section": "def-server.NodeInfo", + "text": "NodeInfo" + } ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37934,9 +44328,15 @@ "\n{@link LoggerFactory | logger factory} instance already bound to the plugin's logging context\n" ], "signature": [ - "LoggerFactory" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + } ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -37952,23 +44352,63 @@ "signature": [ "{ legacy: { globalConfig$: ", "Observable", - " moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", - "ByteSizeValue", + " moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, ") => boolean; isLessThan: (other: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, ") => boolean; isEqualTo: (other: ", - "ByteSizeValue", - ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: ByteSizeValueUnit | undefined) => string; }>; }>; }>>; get: () => Readonly<{ elasticsearch: Readonly<{ readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: ", + "ByteSizeValueUnit", + " | undefined) => string; }>; }>; }>>; get: () => Readonly<{ elasticsearch: Readonly<{ readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, ") => boolean; isLessThan: (other: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, ") => boolean; isEqualTo: (other: ", - "ByteSizeValue", - ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: ByteSizeValueUnit | undefined) => string; }>; }>; }>; }; create: () => ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: ", + "ByteSizeValueUnit", + " | undefined) => string; }>; }>; }>; }; create: () => ", "Observable", "; get: () => T; }" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -37984,7 +44424,7 @@ "description": [ "\nDescribes the set of required and optional properties plugin can define in its\nmandatory JSON manifest file.\n" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -37997,7 +44437,7 @@ "description": [ "\nIdentifier of the plugin. Must be a string in camelCase. Part of a plugin public contract.\nOther plugins leverage it to access plugin API, navigate to the plugin, etc." ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38010,7 +44450,7 @@ "description": [ "\nVersion of the plugin." ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38023,7 +44463,7 @@ "description": [ "\nThe version of Kibana the plugin is compatible with, defaults to \"version\"." ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38037,9 +44477,15 @@ "\nType of the plugin, defaults to `standard`." ], "signature": [ - "PluginType" + { + "pluginId": "@kbn/core-base-common", + "scope": "server", + "docId": "kibKbnCoreBaseCommonPluginApi", + "section": "def-server.PluginType", + "text": "PluginType" + } ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38055,7 +44501,7 @@ "signature": [ "string | string[]" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38071,7 +44517,7 @@ "signature": [ "readonly string[]" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38087,7 +44533,7 @@ "signature": [ "readonly string[]" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38103,7 +44549,7 @@ "signature": [ "readonly string[]" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38116,7 +44562,7 @@ "description": [ "\nSpecifies whether plugin includes some client/browser specific functionality\nthat should be included into client bundle via `public/ui_plugin.js` file." ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38129,7 +44575,7 @@ "description": [ "\nSpecifies whether plugin includes some server-side specific functionality." ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38147,10 +44593,35 @@ "signature": [ "string[] | undefined" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": true, "trackAdoption": false, - "references": [] + "references": [ + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + } + ] }, { "parentPluginId": "core", @@ -38164,7 +44635,7 @@ "signature": [ "readonly string[] | undefined" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38178,7 +44649,7 @@ "signature": [ "{ readonly name: string; readonly githubTeam?: string | undefined; }" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38194,7 +44665,7 @@ "signature": [ "string | undefined" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -38210,7 +44681,7 @@ "signature": [ "boolean | undefined" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -38224,10 +44695,7 @@ "tags": [], "label": "PollEsNodesVersionOptions", "description": [], - "signature": [ - "PollEsNodesVersionOptions" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39427,7 +45895,7 @@ "default", "; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false }, @@ -39439,9 +45907,15 @@ "label": "log", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false }, @@ -39452,7 +45926,7 @@ "tags": [], "label": "kibanaVersion", "description": [], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false }, @@ -39463,7 +45937,7 @@ "tags": [], "label": "ignoreVersionMismatch", "description": [], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false }, @@ -39474,7 +45948,7 @@ "tags": [], "label": "esVersionCheckInterval", "description": [], - "path": "node_modules/@types/kbn__core-elasticsearch-server-internal/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, "trackAdoption": false } @@ -39488,10 +45962,7 @@ "tags": [], "label": "PrebootCoreRequestHandlerContext", "description": [], - "signature": [ - "PrebootCoreRequestHandlerContext" - ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/preboot_request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39503,9 +45974,15 @@ "label": "uiSettings", "description": [], "signature": [ - "PrebootUiSettingsRequestHandlerContext" + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.PrebootUiSettingsRequestHandlerContext", + "text": "PrebootUiSettingsRequestHandlerContext" + } ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/preboot_request_handler_context.ts", "deprecated": false, "trackAdoption": false } @@ -39523,15 +46000,15 @@ ], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PrebootPlugin", "text": "PrebootPlugin" }, "" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39545,15 +46022,15 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CorePreboot", "text": "CorePreboot" }, ", plugins: TPluginsSetup) => TSetup" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39566,14 +46043,14 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CorePreboot", "text": "CorePreboot" } ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -39588,7 +46065,7 @@ "signature": [ "TPluginsSetup" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -39606,7 +46083,7 @@ "signature": [ "(() => void) | undefined" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -39623,11 +46100,23 @@ "label": "PrebootRequestHandlerContext", "description": [], "signature": [ - "PrebootRequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.PrebootRequestHandlerContext", + "text": "PrebootRequestHandlerContext" + }, " extends ", - "RequestHandlerContextBase" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandlerContextBase", + "text": "RequestHandlerContextBase" + } ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/preboot_request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39640,10 +46129,16 @@ "description": [], "signature": [ "Promise<", - "PrebootCoreRequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.PrebootCoreRequestHandlerContext", + "text": "PrebootCoreRequestHandlerContext" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/preboot_request_handler_context.ts", "deprecated": false, "trackAdoption": false } @@ -39657,10 +46152,7 @@ "tags": [], "label": "RegisterDeprecationsConfig", "description": [], - "signature": [ - "RegisterDeprecationsConfig" - ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39673,14 +46165,32 @@ "description": [], "signature": [ "(context: ", - "GetDeprecationsContext", + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.GetDeprecationsContext", + "text": "GetDeprecationsContext" + }, ") => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "<", - "DeprecationsDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DeprecationsDetails", + "text": "DeprecationsDetails" + }, "[]>" ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39692,9 +46202,15 @@ "label": "context", "description": [], "signature": [ - "GetDeprecationsContext" + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.GetDeprecationsContext", + "text": "GetDeprecationsContext" + } ], - "path": "node_modules/@types/kbn__core-deprecations-server/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -39715,11 +46231,23 @@ "\nBase context passed to a route handler, containing the `core` context part.\n" ], "signature": [ - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, " extends ", - "RequestHandlerContextBase" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandlerContextBase", + "text": "RequestHandlerContextBase" + } ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39732,10 +46260,16 @@ "description": [], "signature": [ "Promise<", - "CoreRequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.CoreRequestHandlerContext", + "text": "CoreRequestHandlerContext" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false } @@ -39751,10 +46285,7 @@ "description": [ "\nDefines a set of additional options for the `resolveCapabilities` method of {@link CapabilitiesStart}.\n" ], - "signature": [ - "ResolveCapabilitiesOptions" - ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39767,7 +46298,7 @@ "description": [ "\nIndicates if capability switchers are supposed to return a default set of capabilities." ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -39784,10 +46315,16 @@ "\nRoute specific configuration." ], "signature": [ - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39800,7 +46337,7 @@ "description": [ "\nThe endpoint _within_ the router path to register the route.\n" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false }, @@ -39815,10 +46352,16 @@ ], "signature": [ "false | ", - "RouteValidatorFullConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidatorFullConfig", + "text": "RouteValidatorFullConfig" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false }, @@ -39832,10 +46375,16 @@ "\nAdditional route options {@link RouteConfigOptions}." ], "signature": [ - "RouteConfigOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfigOptions", + "text": "RouteConfigOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false } @@ -39852,10 +46401,16 @@ "\nAdditional route options." ], "signature": [ - "RouteConfigOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfigOptions", + "text": "RouteConfigOptions" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39871,7 +46426,7 @@ "signature": [ "boolean | \"optional\" | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false }, @@ -39887,7 +46442,7 @@ "signature": [ "(Method extends \"get\" ? never : boolean) | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false }, @@ -39903,7 +46458,7 @@ "signature": [ "readonly string[] | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false }, @@ -39918,10 +46473,16 @@ ], "signature": [ "(Method extends \"options\" | \"get\" ? undefined : ", - "RouteConfigOptionsBody", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfigOptionsBody", + "text": "RouteConfigOptionsBody" + }, ") | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false }, @@ -39937,7 +46498,7 @@ "signature": [ "{ payload?: (Method extends \"options\" | \"get\" ? undefined : number) | undefined; idleSocket?: number | undefined; } | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false } @@ -39953,10 +46514,7 @@ "description": [ "\nAdditional body options for a route" ], - "signature": [ - "RouteConfigOptionsBody" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39971,10 +46529,16 @@ ], "signature": [ "string | string[] | ", - "RouteContentType", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteContentType", + "text": "RouteContentType" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false }, @@ -39990,7 +46554,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false }, @@ -40006,7 +46570,7 @@ "signature": [ "\"data\" | \"stream\" | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false }, @@ -40022,7 +46586,7 @@ "signature": [ "boolean | \"gunzip\" | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false } @@ -40038,10 +46602,7 @@ "description": [ "\nValidation result factory to be used in the custom validation function to return the valid data or validation errors\n\nSee {@link RouteValidationFunction}.\n" ], - "signature": [ - "RouteValidationResultFactory" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -40055,7 +46616,7 @@ "signature": [ "(value: T) => { value: T; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -40069,7 +46630,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -40086,10 +46647,16 @@ "description": [], "signature": [ "(error: string | Error, path?: string[] | undefined) => { error: ", - "RouteValidationError", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidationError", + "text": "RouteValidationError" + }, "; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -40103,7 +46670,7 @@ "signature": [ "string | Error" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -40118,7 +46685,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -40139,10 +46706,16 @@ "\nThe configuration object to the RouteValidator class.\nSet `params`, `query` and/or `body` to specify the validation logic to follow for that property.\n" ], "signature": [ - "RouteValidatorConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidatorConfig", + "text": "RouteValidatorConfig" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -40156,10 +46729,16 @@ "\nValidation logic for the URL params" ], "signature": [ - "RouteValidationSpec", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidationSpec", + "text": "RouteValidationSpec" + }, "

| undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false }, @@ -40173,10 +46752,16 @@ "\nValidation logic for the Query params" ], "signature": [ - "RouteValidationSpec", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidationSpec", + "text": "RouteValidationSpec" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false }, @@ -40190,10 +46775,16 @@ "\nValidation logic for the body payload" ], "signature": [ - "RouteValidationSpec", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidationSpec", + "text": "RouteValidationSpec" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false } @@ -40209,10 +46800,7 @@ "description": [ "\nAdditional options for the RouteValidator class to modify its default behaviour.\n" ], - "signature": [ - "RouteValidatorOptions" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -40228,7 +46816,7 @@ "signature": [ "{ params?: boolean | undefined; query?: boolean | undefined; body?: boolean | undefined; } | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false } @@ -40243,10 +46831,16 @@ "label": "SavedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -40259,7 +46853,7 @@ "description": [ "The ID of this Saved Object, guaranteed to be unique for all objects of the same `type`" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40272,7 +46866,7 @@ "description": [ " The type of Saved Object. Each plugin can define it's own custom Saved Object types." ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40288,7 +46882,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40304,7 +46898,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40320,7 +46914,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40332,10 +46926,16 @@ "label": "error", "description": [], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40351,7 +46951,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40365,10 +46965,16 @@ "{@inheritdoc SavedObjectReference}" ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40382,10 +46988,16 @@ "{@inheritdoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40401,7 +47013,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40417,7 +47029,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -40433,7 +47045,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -40451,13 +47063,22 @@ "description": [ "\nThe data for a Saved Object is stored as an object in the `attributes`\nproperty.\n" ], - "signature": [ - "SavedObjectAttributes" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": true, "trackAdoption": false, "references": [ + { + "plugin": "@kbn/core-saved-objects-common", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts" + }, + { + "plugin": "@kbn/core-saved-objects-common", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts" + }, + { + "plugin": "@kbn/core-saved-objects-common", + "path": "packages/core/saved-objects/core-saved-objects-common/index.ts" + }, { "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/types.ts" @@ -40982,6 +47603,14 @@ "plugin": "savedSearch", "path": "src/plugins/saved_search/server/saved_objects/search_migrations.ts" }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/modules.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/modules.ts" + }, { "plugin": "visualizations", "path": "src/plugins/visualizations/common/types.ts" @@ -41022,14 +47651,6 @@ "plugin": "dashboard", "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts" }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/common/types/modules.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/common/types/modules.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/saved_objects/migrations/7.11/index.ts" @@ -41073,9 +47694,15 @@ "description": [], "signature": [ "[key: string]: ", - "SavedObjectAttribute" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttribute", + "text": "SavedObjectAttribute" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -41089,10 +47716,7 @@ "tags": [], "label": "SavedObjectExportBaseOptions", "description": [], - "signature": [ - "SavedObjectExportBaseOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41106,10 +47730,16 @@ "The http request initiating the export." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -41125,7 +47755,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -41141,7 +47771,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -41157,7 +47787,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -41173,7 +47803,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false } @@ -41189,10 +47819,7 @@ "description": [ "\nMigration context provided when invoking a {@link SavedObjectMigrationFn | migration handler}\n" ], - "signature": [ - "SavedObjectMigrationContext" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41206,9 +47833,15 @@ "\nlogger instance to be used by the migration handler" ], "signature": [ - "SavedObjectsMigrationLogger" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsMigrationLogger", + "text": "SavedObjectsMigrationLogger" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false }, @@ -41221,7 +47854,7 @@ "description": [ "\nThe migration version that this migration function is defined for" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false }, @@ -41237,7 +47870,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false }, @@ -41250,7 +47883,7 @@ "description": [ "\nWhether this is a single-namespace type or not" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false } @@ -41266,10 +47899,7 @@ "description": [ "\nA map of {@link SavedObjectMigrationFn | migration functions} to be used for a given type.\nThe map's keys must be valid semver versions, and they cannot exceed the current Kibana version.\n\nFor a given document, only migrations with a higher version number than that of the document will be applied.\nMigrations are executed in order, starting from the lowest version and ending with the highest one.\n" ], - "signature": [ - "SavedObjectMigrationMap" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41282,10 +47912,16 @@ "description": [], "signature": [ "[version: string]: ", - "SavedObjectMigrationFn", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationFn", + "text": "SavedObjectMigrationFn" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false } @@ -41301,10 +47937,7 @@ "description": [ "\nA reference to another saved object.\n" ], - "signature": [ - "SavedObjectReference" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41315,7 +47948,7 @@ "tags": [], "label": "name", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -41326,7 +47959,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -41337,7 +47970,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -41353,10 +47986,7 @@ "description": [ "\nA returned input object or one of its references, with additional context.\n" ], - "signature": [ - "SavedObjectReferenceWithContext" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41369,7 +47999,7 @@ "description": [ "The type of the referenced object" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false }, @@ -41382,7 +48012,7 @@ "description": [ "The ID of the referenced object" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false }, @@ -41398,7 +48028,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false }, @@ -41414,7 +48044,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false }, @@ -41430,7 +48060,7 @@ "signature": [ "{ type: string; id: string; name: string; }[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false }, @@ -41446,7 +48076,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false }, @@ -41462,7 +48092,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false }, @@ -41478,7 +48108,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false } @@ -41494,10 +48124,7 @@ "description": [ "\nBase options used by most of the savedObject APIs." ], - "signature": [ - "SavedObjectsBaseOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/base.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41513,7 +48140,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/base.ts", "deprecated": false, "trackAdoption": false } @@ -41530,10 +48157,16 @@ "\n" ], "signature": [ - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41547,7 +48180,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false }, @@ -41558,7 +48191,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false }, @@ -41572,7 +48205,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false }, @@ -41586,7 +48219,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false }, @@ -41598,10 +48231,16 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false }, @@ -41615,10 +48254,16 @@ "{@inheritDoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false }, @@ -41634,7 +48279,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false }, @@ -41650,7 +48295,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false }, @@ -41666,7 +48311,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", "deprecated": false, "trackAdoption": false } @@ -41682,10 +48327,7 @@ "description": [ "\n" ], - "signature": [ - "SavedObjectsBulkDeleteObject" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_delete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41696,7 +48338,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_delete.ts", "deprecated": false, "trackAdoption": false }, @@ -41707,7 +48349,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_delete.ts", "deprecated": false, "trackAdoption": false } @@ -41722,11 +48364,23 @@ "label": "SavedObjectsBulkDeleteOptions", "description": [], "signature": [ - "SavedObjectsBulkDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_delete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41740,10 +48394,16 @@ "The Elasticsearch Refresh setting for this operation" ], "signature": [ - "MutatingOperationRefreshSetting", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.MutatingOperationRefreshSetting", + "text": "MutatingOperationRefreshSetting" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_delete.ts", "deprecated": false, "trackAdoption": false }, @@ -41759,7 +48419,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_delete.ts", "deprecated": false, "trackAdoption": false } @@ -41773,10 +48433,7 @@ "tags": [], "label": "SavedObjectsBulkDeleteResponse", "description": [], - "signature": [ - "SavedObjectsBulkDeleteResponse" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_delete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41788,10 +48445,16 @@ "label": "statuses", "description": [], "signature": [ - "SavedObjectsBulkDeleteStatus", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteStatus", + "text": "SavedObjectsBulkDeleteStatus" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_delete.ts", "deprecated": false, "trackAdoption": false } @@ -41807,10 +48470,7 @@ "description": [ "\n" ], - "signature": [ - "SavedObjectsBulkGetObject" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_get.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41821,7 +48481,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_get.ts", "deprecated": false, "trackAdoption": false }, @@ -41832,7 +48492,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_get.ts", "deprecated": false, "trackAdoption": false }, @@ -41848,7 +48508,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_get.ts", "deprecated": false, "trackAdoption": false }, @@ -41864,7 +48524,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_get.ts", "deprecated": false, "trackAdoption": false } @@ -41880,10 +48540,7 @@ "description": [ "\n" ], - "signature": [ - "SavedObjectsBulkResolveObject" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_resolve.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41894,7 +48551,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_resolve.ts", "deprecated": false, "trackAdoption": false }, @@ -41905,7 +48562,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_resolve.ts", "deprecated": false, "trackAdoption": false } @@ -41922,10 +48579,16 @@ "\n" ], "signature": [ - "SavedObjectsBulkResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveResponse", + "text": "SavedObjectsBulkResolveResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_resolve.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41937,10 +48600,16 @@ "label": "resolved_objects", "description": [], "signature": [ - "SavedObjectsResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsResolveResponse", + "text": "SavedObjectsResolveResponse" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_resolve.ts", "deprecated": false, "trackAdoption": false } @@ -41957,10 +48626,16 @@ "\n" ], "signature": [ - "SavedObjectsBulkResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/base.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41972,10 +48647,16 @@ "label": "saved_objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/base.ts", "deprecated": false, "trackAdoption": false } @@ -41992,12 +48673,24 @@ "\n" ], "signature": [ - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, " extends Pick<", - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, ", \"version\" | \"references\">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42010,7 +48703,7 @@ "description": [ "The ID of this Saved Object, guaranteed to be unique for all objects of the same `type`" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false }, @@ -42023,7 +48716,7 @@ "description": [ " The type of this Saved Object. Each plugin can define it's own custom Saved Object types." ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false }, @@ -42039,7 +48732,7 @@ "signature": [ "{ [P in keyof T]?: T[P] | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false }, @@ -42055,7 +48748,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false } @@ -42072,11 +48765,23 @@ "\n" ], "signature": [ - "SavedObjectsBulkUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateOptions", + "text": "SavedObjectsBulkUpdateOptions" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42090,10 +48795,16 @@ "The Elasticsearch Refresh setting for this operation" ], "signature": [ - "MutatingOperationRefreshSetting", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.MutatingOperationRefreshSetting", + "text": "MutatingOperationRefreshSetting" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false } @@ -42110,10 +48821,16 @@ "\n" ], "signature": [ - "SavedObjectsBulkUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateResponse", + "text": "SavedObjectsBulkUpdateResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42125,10 +48842,16 @@ "label": "saved_objects", "description": [], "signature": [ - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_update.ts", "deprecated": false, "trackAdoption": false } @@ -42144,10 +48867,7 @@ "description": [ "\n" ], - "signature": [ - "SavedObjectsCheckConflictsObject" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/check_conflicts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42158,7 +48878,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/check_conflicts.ts", "deprecated": false, "trackAdoption": false }, @@ -42169,7 +48889,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/check_conflicts.ts", "deprecated": false, "trackAdoption": false } @@ -42185,10 +48905,7 @@ "description": [ "\n" ], - "signature": [ - "SavedObjectsCheckConflictsResponse" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/check_conflicts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42201,10 +48918,16 @@ "description": [], "signature": [ "{ id: string; type: string; error: ", - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, "; }[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/check_conflicts.ts", "deprecated": false, "trackAdoption": false } @@ -42220,10 +48943,7 @@ "description": [ "\nSaved Objects is Kibana's data persisentence mechanism allowing plugins to\nuse Elasticsearch for storing plugin state.\n\n## SavedObjectsClient errors\n\nSince the SavedObjectsClient has its hands in everything we\nare a little paranoid about the way we present errors back to\nto application code. Ideally, all errors will be either:\n\n 1. Caused by bad implementation (ie. undefined is not a function) and\n as such unpredictable\n 2. An error that has been classified and decorated appropriately\n by the decorators in {@link SavedObjectsErrorHelpers}\n\nType 1 errors are inevitable, but since all expected/handle-able errors\nshould be Type 2 the `isXYZError()` helpers exposed at\n`SavedObjectsErrorHelpers` should be used to understand and manage error\nresponses from the `SavedObjectsClient`.\n\nType 2 errors are decorated versions of the source error, so if\nthe elasticsearch client threw an error it will be decorated based\non its type. That means that rather than looking for `error.body.error.type` or\ndoing substring checks on `error.body.error.reason`, just use the helpers to\nunderstand the meaning of the error:\n\n ```js\n if (SavedObjectsErrorHelpers.isNotFoundError(error)) {\n // handle 404\n }\n\n if (SavedObjectsErrorHelpers.isNotAuthorizedError(error)) {\n // 401 handling should be automatic, but in case you wanted to know\n }\n\n // always rethrow the error unless you handle it\n throw error;\n ```\n\n### 404s from missing index\n\nFrom the perspective of application code and APIs the SavedObjectsClient is\na black box that persists objects. One of the internal details that users have\nno control over is that we use an elasticsearch index for persistence and that\nindex might be missing.\n\nAt the time of writing we are in the process of transitioning away from the\noperating assumption that the SavedObjects index is always available. Part of\nthis transition is handling errors resulting from an index missing. These used\nto trigger a 500 error in most cases, and in others cause 404s with different\nerror messages.\n\nFrom my (Spencer) perspective, a 404 from the SavedObjectsApi is a 404; The\nobject the request/call was targeting could not be found. This is why #14141\ntakes special care to ensure that 404 errors are generic and don't distinguish\nbetween index missing or document missing.\n\nSee {@link SavedObjectsClient}\nSee {@link SavedObjectsErrorHelpers}\n" ], - "signature": [ - "SavedObjectsClientContract" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42238,12 +48958,24 @@ ], "signature": [ "(type: string, attributes: T, options?: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42257,7 +48989,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42272,7 +49004,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42285,10 +49017,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42307,14 +49045,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "[], options?: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42326,10 +49082,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42342,10 +49104,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42364,14 +49132,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsCheckConflictsObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsObject", + "text": "SavedObjectsCheckConflictsObject" + }, "[], options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsCheckConflictsResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsResponse", + "text": "SavedObjectsCheckConflictsResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42383,10 +49169,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsCheckConflictsObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsObject", + "text": "SavedObjectsCheckConflictsObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42399,10 +49191,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42421,10 +49219,16 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + }, " | undefined) => Promise<{}>" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42438,7 +49242,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42453,7 +49257,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42466,10 +49270,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42488,14 +49298,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkDeleteObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteObject", + "text": "SavedObjectsBulkDeleteObject" + }, "[], options?: ", - "SavedObjectsBulkDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkDeleteResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteResponse", + "text": "SavedObjectsBulkDeleteResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42507,10 +49335,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkDeleteObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteObject", + "text": "SavedObjectsBulkDeleteObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42523,10 +49357,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBulkDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42545,12 +49385,24 @@ ], "signature": [ "(options: ", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ") => Promise<", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42562,9 +49414,15 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsFindOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42583,14 +49441,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkGetObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkGetObject", + "text": "SavedObjectsBulkGetObject" + }, "[], options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42604,10 +49480,16 @@ "- an array of ids, or an array of objects containing id, type and optionally fields" ], "signature": [ - "SavedObjectsBulkGetObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkGetObject", + "text": "SavedObjectsBulkGetObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42620,10 +49502,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42642,12 +49530,24 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42663,7 +49563,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42680,7 +49580,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42693,10 +49593,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42717,14 +49623,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkResolveObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveObject", + "text": "SavedObjectsBulkResolveObject" + }, "[], options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveResponse", + "text": "SavedObjectsBulkResolveResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42738,10 +49662,16 @@ "- an array of objects containing id, type" ], "signature": [ - "SavedObjectsBulkResolveObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveObject", + "text": "SavedObjectsBulkResolveObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42754,10 +49684,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42776,12 +49712,24 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsResolveResponse", + "text": "SavedObjectsResolveResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42797,7 +49745,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42814,7 +49762,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42827,10 +49775,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42849,12 +49803,24 @@ ], "signature": [ "(type: string, id: string, attributes: Partial, options?: ", - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, " | undefined) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42868,7 +49834,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42883,7 +49849,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42898,7 +49864,7 @@ "signature": [ "Partial" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42911,10 +49877,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42933,14 +49905,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "[], options?: ", - "SavedObjectsBulkUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateOptions", + "text": "SavedObjectsBulkUpdateOptions" + }, " | undefined) => Promise<", - "SavedObjectsBulkUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateResponse", + "text": "SavedObjectsBulkUpdateResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42952,10 +49942,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -42968,10 +49964,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBulkUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateOptions", + "text": "SavedObjectsBulkUpdateOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -42990,12 +49992,24 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsRemoveReferencesToOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToOptions", + "text": "SavedObjectsRemoveReferencesToOptions" + }, " | undefined) => Promise<", - "SavedObjectsRemoveReferencesToResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToResponse", + "text": "SavedObjectsRemoveReferencesToResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43009,7 +50023,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -43024,7 +50038,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -43037,10 +50051,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsRemoveReferencesToOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToOptions", + "text": "SavedObjectsRemoveReferencesToOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -43059,12 +50079,24 @@ ], "signature": [ "(type: string | string[], options?: ", - "SavedObjectsOpenPointInTimeOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeOptions", + "text": "SavedObjectsOpenPointInTimeOptions" + }, " | undefined) => Promise<", - "SavedObjectsOpenPointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeResponse", + "text": "SavedObjectsOpenPointInTimeResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43078,7 +50110,7 @@ "signature": [ "string | string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -43091,10 +50123,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsOpenPointInTimeOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeOptions", + "text": "SavedObjectsOpenPointInTimeOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -43113,12 +50151,24 @@ ], "signature": [ "(id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsClosePointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClosePointInTimeResponse", + "text": "SavedObjectsClosePointInTimeResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43132,7 +50182,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -43145,10 +50195,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -43167,14 +50223,32 @@ ], "signature": [ "(findOptions: ", - "SavedObjectsCreatePointInTimeFinderOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + }, ", dependencies?: ", - "SavedObjectsCreatePointInTimeFinderDependencies", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, " | undefined) => ", - "ISavedObjectsPointInTimeFinder", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsPointInTimeFinder", + "text": "ISavedObjectsPointInTimeFinder" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43186,9 +50260,15 @@ "label": "findOptions", "description": [], "signature": [ - "SavedObjectsCreatePointInTimeFinderOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -43201,10 +50281,16 @@ "label": "dependencies", "description": [], "signature": [ - "SavedObjectsCreatePointInTimeFinderDependencies", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -43223,14 +50309,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsCollectMultiNamespaceReferencesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesObject", + "text": "SavedObjectsCollectMultiNamespaceReferencesObject" + }, "[], options?: ", - "SavedObjectsCollectMultiNamespaceReferencesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesOptions", + "text": "SavedObjectsCollectMultiNamespaceReferencesOptions" + }, " | undefined) => Promise<", - "SavedObjectsCollectMultiNamespaceReferencesResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesResponse", + "text": "SavedObjectsCollectMultiNamespaceReferencesResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43242,10 +50346,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesObject", + "text": "SavedObjectsCollectMultiNamespaceReferencesObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -43258,10 +50368,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesOptions", + "text": "SavedObjectsCollectMultiNamespaceReferencesOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -43280,14 +50396,32 @@ ], "signature": [ "(objects: ", - "SavedObjectsUpdateObjectsSpacesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesObject", + "text": "SavedObjectsUpdateObjectsSpacesObject" + }, "[], spacesToAdd: string[], spacesToRemove: string[], options?: ", - "SavedObjectsUpdateObjectsSpacesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesOptions", + "text": "SavedObjectsUpdateObjectsSpacesOptions" + }, " | undefined) => Promise<", - "SavedObjectsUpdateObjectsSpacesResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesResponse", + "text": "SavedObjectsUpdateObjectsSpacesResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43299,10 +50433,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsUpdateObjectsSpacesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesObject", + "text": "SavedObjectsUpdateObjectsSpacesObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -43317,7 +50457,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -43332,7 +50472,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -43345,10 +50485,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsUpdateObjectsSpacesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesOptions", + "text": "SavedObjectsUpdateObjectsSpacesOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -43368,10 +50514,7 @@ "description": [ "\nOptions to control the creation of the Saved Objects Client." ], - "signature": [ - "SavedObjectsClientProviderOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43385,7 +50528,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false }, @@ -43399,7 +50542,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false } @@ -43415,10 +50558,7 @@ "description": [ "\nOptions passed to each SavedObjectsClientWrapperFactory to aid in creating the wrapper instance." ], - "signature": [ - "SavedObjectsClientWrapperOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43430,9 +50570,15 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false }, @@ -43444,9 +50590,15 @@ "label": "typeRegistry", "description": [], "signature": [ - "ISavedObjectTypeRegistry" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false }, @@ -43458,10 +50610,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false } @@ -43475,10 +50633,7 @@ "tags": [], "label": "SavedObjectsClosePointInTimeResponse", "description": [], - "signature": [ - "SavedObjectsClosePointInTimeResponse" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/close_point_in_time.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43491,7 +50646,7 @@ "description": [ "\nIf true, all search contexts associated with the PIT id are\nsuccessfully closed." ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/close_point_in_time.ts", "deprecated": false, "trackAdoption": false }, @@ -43504,7 +50659,7 @@ "description": [ "\nThe number of search contexts that have been successfully closed." ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/close_point_in_time.ts", "deprecated": false, "trackAdoption": false } @@ -43520,10 +50675,7 @@ "description": [ "\nAn object to collect references for. It must be a multi-namespace type (in other words, the object type must be registered with the\n`namespaceType: 'multiple'` or `namespaceType: 'multiple-isolated'` option).\n\nNote: if options.purpose is 'updateObjectsSpaces', it must be a shareable type (in other words, the object type must be registered with\nthe `namespaceType: 'multiple'`).\n" ], - "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesObject" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43534,7 +50686,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false }, @@ -43545,7 +50697,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false } @@ -43562,11 +50714,23 @@ "\nOptions for collecting references.\n" ], "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesOptions", + "text": "SavedObjectsCollectMultiNamespaceReferencesOptions" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43582,7 +50746,7 @@ "signature": [ "\"collectMultiNamespaceReferences\" | \"updateObjectsSpaces\" | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false } @@ -43598,10 +50762,7 @@ "description": [ "\nThe response when object references are collected.\n" ], - "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesResponse" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43613,10 +50774,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectReferenceWithContext", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectReferenceWithContext", + "text": "SavedObjectReferenceWithContext" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/collect_multinamespace_references.ts", "deprecated": false, "trackAdoption": false } @@ -43633,11 +50800,23 @@ "\n" ], "signature": [ - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43653,7 +50832,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -43669,7 +50848,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -43685,7 +50864,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -43699,10 +50878,16 @@ "{@inheritDoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -43718,7 +50903,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -43730,10 +50915,16 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -43747,10 +50938,16 @@ "The Elasticsearch Refresh setting for this operation" ], "signature": [ - "MutatingOperationRefreshSetting", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.MutatingOperationRefreshSetting", + "text": "MutatingOperationRefreshSetting" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -43766,7 +50963,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", "deprecated": false, "trackAdoption": false }, @@ -43782,7 +50979,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", "deprecated": false, "trackAdoption": false } @@ -43796,10 +50993,7 @@ "tags": [], "label": "SavedObjectsCreatePointInTimeFinderDependencies", "description": [], - "signature": [ - "SavedObjectsCreatePointInTimeFinderDependencies" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create_point_in_time_finder.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43812,20 +51006,56 @@ "description": [], "signature": [ "{ find: (options: ", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ") => Promise<", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, ">; closePointInTime: (id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsClosePointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClosePointInTimeResponse", + "text": "SavedObjectsClosePointInTimeResponse" + }, ">; openPointInTimeForType: (type: string | string[], options?: ", - "SavedObjectsOpenPointInTimeOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeOptions", + "text": "SavedObjectsOpenPointInTimeOptions" + }, " | undefined) => Promise<", - "SavedObjectsOpenPointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeResponse", + "text": "SavedObjectsOpenPointInTimeResponse" + }, ">; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create_point_in_time_finder.ts", "deprecated": false, "trackAdoption": false } @@ -43842,11 +51072,23 @@ "\n" ], "signature": [ - "SavedObjectsDeleteByNamespaceOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteByNamespaceOptions", + "text": "SavedObjectsDeleteByNamespaceOptions" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/delete_by_namespace.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43862,7 +51104,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/delete_by_namespace.ts", "deprecated": false, "trackAdoption": false } @@ -43879,11 +51121,23 @@ "\n" ], "signature": [ - "SavedObjectsDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/delete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43897,10 +51151,16 @@ "The Elasticsearch Refresh setting for this operation" ], "signature": [ - "MutatingOperationRefreshSetting", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.MutatingOperationRefreshSetting", + "text": "MutatingOperationRefreshSetting" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/delete.ts", "deprecated": false, "trackAdoption": false }, @@ -43916,7 +51176,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/delete.ts", "deprecated": false, "trackAdoption": false } @@ -43933,11 +51193,23 @@ "\nOptions for the {@link ISavedObjectsExporter.exportByObjects | export by objects API}\n" ], "signature": [ - "SavedObjectsExportByObjectOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportByObjectOptions", + "text": "SavedObjectsExportByObjectOptions" + }, " extends ", - "SavedObjectExportBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectExportBaseOptions", + "text": "SavedObjectExportBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43951,10 +51223,16 @@ "optional array of objects to export." ], "signature": [ - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false } @@ -43971,11 +51249,23 @@ "\nOptions for the {@link ISavedObjectsExporter.exportByTypes | export by type API}\n" ], "signature": [ - "SavedObjectsExportByTypeOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportByTypeOptions", + "text": "SavedObjectsExportByTypeOptions" + }, " extends ", - "SavedObjectExportBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectExportBaseOptions", + "text": "SavedObjectExportBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -43991,7 +51281,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -44005,10 +51295,16 @@ "optional array of references to search object for." ], "signature": [ - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -44024,7 +51320,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false } @@ -44038,10 +51334,7 @@ "tags": [], "label": "SavedObjectsExportExcludedObject", "description": [], - "signature": [ - "SavedObjectsExportExcludedObject" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44054,7 +51347,7 @@ "description": [ "id of the excluded object" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -44067,7 +51360,7 @@ "description": [ "type of the excluded object" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -44083,7 +51376,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false } @@ -44099,10 +51392,7 @@ "description": [ "\nStructure of the export result details entry" ], - "signature": [ - "SavedObjectsExportResultDetails" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44115,7 +51405,7 @@ "description": [ "number of successfully exported objects" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -44128,7 +51418,7 @@ "description": [ "number of missing references" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -44142,10 +51432,16 @@ "missing references details" ], "signature": [ - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -44158,7 +51454,7 @@ "description": [ "number of objects that were excluded from the export" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -44172,10 +51468,16 @@ "excluded objects details" ], "signature": [ - "SavedObjectsExportExcludedObject", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportExcludedObject", + "text": "SavedObjectsExportExcludedObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false } @@ -44191,10 +51493,7 @@ "description": [ "\nContext passed down to a {@link SavedObjectsExportTransform | export transform function}\n" ], - "signature": [ - "SavedObjectsExportTransformContext" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44208,10 +51507,16 @@ "\nThe request that initiated the export request. Can be used to create scoped\nservices or client inside the {@link SavedObjectsExportTransform | transformation}" ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false } @@ -44227,10 +51532,7 @@ "description": [ "\n" ], - "signature": [ - "SavedObjectsFindOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44244,7 +51546,7 @@ "signature": [ "string | string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44258,7 +51560,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44272,7 +51574,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44286,7 +51588,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44301,7 +51603,7 @@ "SortOrder", " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44317,7 +51619,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44333,7 +51635,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44349,7 +51651,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44365,7 +51667,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44381,7 +51683,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44395,12 +51697,24 @@ "\nSearch for documents having a reference to the specified objects.\nUse `hasReferenceOperator` to specify the operator to use when searching for multiple references." ], "signature": [ - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44416,7 +51730,7 @@ "signature": [ "\"AND\" | \"OR\" | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44430,12 +51744,24 @@ "\nSearch for documents *not* having a reference to the specified objects.\nUse `hasNoReferenceOperator` to specify the operator to use when searching for multiple references." ], "signature": [ - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44451,7 +51777,7 @@ "signature": [ "\"AND\" | \"OR\" | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44467,7 +51793,7 @@ "signature": [ "\"AND\" | \"OR\" | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44481,7 +51807,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44501,7 +51827,7 @@ "AggregationsAggregationContainer", "> | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44515,7 +51841,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44531,7 +51857,7 @@ "signature": [ "Map | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44547,7 +51873,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44561,10 +51887,16 @@ "\nSearch against a specific Point In Time (PIT) that you've opened with {@link SavedObjectsClient.openPointInTimeForType}." ], "signature": [ - "SavedObjectsPitParams", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsPitParams", + "text": "SavedObjectsPitParams" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false } @@ -44578,10 +51910,7 @@ "tags": [], "label": "SavedObjectsFindOptionsReference", "description": [], - "signature": [ - "SavedObjectsFindOptionsReference" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44592,7 +51921,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44603,7 +51932,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false } @@ -44620,10 +51949,16 @@ "\nReturn type of the Saved Objects `find()` method.\n\n*Note*: this type is different between the Public and Server Saved Objects\nclients.\n" ], "signature": [ - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44637,7 +51972,7 @@ "signature": [ "A | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44649,10 +51984,16 @@ "label": "saved_objects", "description": [], "signature": [ - "SavedObjectsFindResult", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResult", + "text": "SavedObjectsFindResult" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44663,7 +52004,7 @@ "tags": [], "label": "total", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44674,7 +52015,7 @@ "tags": [], "label": "per_page", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44685,7 +52026,7 @@ "tags": [], "label": "page", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44699,7 +52040,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false } @@ -44716,12 +52057,24 @@ "\n" ], "signature": [ - "SavedObjectsFindResult", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResult", + "text": "SavedObjectsFindResult" + }, " extends ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44734,7 +52087,7 @@ "description": [ "\nThe Elasticsearch `_score` of this result." ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -44750,7 +52103,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false } @@ -44766,10 +52119,7 @@ "description": [ "\nA warning meant to notify that a specific user action is required to finalize the import\nof some type of object.\n" ], - "signature": [ - "SavedObjectsImportActionRequiredWarning" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44783,7 +52133,7 @@ "signature": [ "\"action_required\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -44796,7 +52146,7 @@ "description": [ "The translated message to display to the user." ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -44809,7 +52159,7 @@ "description": [ "The path (without the basePath) that the user should be redirect to address this warning." ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -44825,7 +52175,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -44841,10 +52191,7 @@ "description": [ "\nRepresents a failure to import due to a conflict, which can be resolved in different ways with an overwrite." ], - "signature": [ - "SavedObjectsImportAmbiguousConflictError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44858,7 +52205,7 @@ "signature": [ "\"ambiguous_conflict\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -44872,7 +52219,7 @@ "signature": [ "{ id: string; title?: string | undefined; updatedAt?: string | undefined; }[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -44888,10 +52235,7 @@ "description": [ "\nRepresents a failure to import due to a conflict." ], - "signature": [ - "SavedObjectsImportConflictError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44905,7 +52249,7 @@ "signature": [ "\"conflict\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -44919,7 +52263,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -44935,10 +52279,7 @@ "description": [ "\nRepresents a failure to import." ], - "signature": [ - "SavedObjectsImportFailure" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44949,7 +52290,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -44960,7 +52301,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -44974,7 +52315,7 @@ "signature": [ "{ title?: string | undefined; icon?: string | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -44990,7 +52331,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45002,17 +52343,47 @@ "label": "error", "description": [], "signature": [ - "SavedObjectsImportConflictError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportConflictError", + "text": "SavedObjectsImportConflictError" + }, " | ", - "SavedObjectsImportAmbiguousConflictError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportAmbiguousConflictError", + "text": "SavedObjectsImportAmbiguousConflictError" + }, " | ", - "SavedObjectsImportUnsupportedTypeError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportUnsupportedTypeError", + "text": "SavedObjectsImportUnsupportedTypeError" + }, " | ", - "SavedObjectsImportMissingReferencesError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportMissingReferencesError", + "text": "SavedObjectsImportMissingReferencesError" + }, " | ", - "SavedObjectsImportUnknownError" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportUnknownError", + "text": "SavedObjectsImportUnknownError" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -45028,10 +52399,7 @@ "description": [ "\nResult from a {@link SavedObjectsImportHook | import hook}\n" ], - "signature": [ - "SavedObjectsImportHookResult" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45045,10 +52413,16 @@ "\nAn optional list of warnings to display in the UI when the import succeeds." ], "signature": [ - "SavedObjectsImportWarning", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportWarning", + "text": "SavedObjectsImportWarning" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false } @@ -45064,10 +52438,7 @@ "description": [ "\nRepresents a failure to import due to missing references." ], - "signature": [ - "SavedObjectsImportMissingReferencesError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45081,7 +52452,7 @@ "signature": [ "\"missing_references\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45095,7 +52466,7 @@ "signature": [ "{ type: string; id: string; }[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -45111,10 +52482,7 @@ "description": [ "\nOptions to control the import operation." ], - "signature": [ - "SavedObjectsImportOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45130,7 +52498,7 @@ "signature": [ "Readable" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false }, @@ -45143,7 +52511,7 @@ "description": [ "If true, will override existing object if present. Note: this has no effect when used with the `createNewCopies` option." ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false }, @@ -45159,7 +52527,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false }, @@ -45172,7 +52540,7 @@ "description": [ "If true, will create new copies of import objects, each with a random `id` and undefined `originId`." ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false }, @@ -45188,7 +52556,7 @@ "signature": [ "boolean | \"wait_for\" | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false } @@ -45204,10 +52572,7 @@ "description": [ "\nThe response describing the result of an import." ], - "signature": [ - "SavedObjectsImportResponse" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45218,7 +52583,7 @@ "tags": [], "label": "success", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45229,7 +52594,7 @@ "tags": [], "label": "successCount", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45241,10 +52606,16 @@ "label": "successResults", "description": [], "signature": [ - "SavedObjectsImportSuccess", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportSuccess", + "text": "SavedObjectsImportSuccess" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45256,10 +52627,16 @@ "label": "warnings", "description": [], "signature": [ - "SavedObjectsImportWarning", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportWarning", + "text": "SavedObjectsImportWarning" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45271,10 +52648,16 @@ "label": "errors", "description": [], "signature": [ - "SavedObjectsImportFailure", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportFailure", + "text": "SavedObjectsImportFailure" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -45290,10 +52673,7 @@ "description": [ "\nDescribes a retry operation for importing a saved object." ], - "signature": [ - "SavedObjectsImportRetry" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45304,7 +52684,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45315,7 +52695,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45326,7 +52706,7 @@ "tags": [], "label": "overwrite", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45342,7 +52722,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45356,7 +52736,7 @@ "signature": [ "{ type: string; from: string; to: string; }[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45372,7 +52752,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45388,7 +52768,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -45404,10 +52784,7 @@ "description": [ "\nA simple informative warning that will be displayed to the user.\n" ], - "signature": [ - "SavedObjectsImportSimpleWarning" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45421,7 +52798,7 @@ "signature": [ "\"simple\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45434,7 +52811,7 @@ "description": [ "The translated message to display to the user" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -45450,10 +52827,7 @@ "description": [ "\nRepresents a successful import." ], - "signature": [ - "SavedObjectsImportSuccess" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45464,7 +52838,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45475,7 +52849,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45491,7 +52865,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45507,7 +52881,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": true, "trackAdoption": false, "references": [ @@ -45531,7 +52905,7 @@ "signature": [ "{ title?: string | undefined; icon?: string | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45547,7 +52921,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -45563,10 +52937,7 @@ "description": [ "\nRepresents a failure to import due to an unknown reason." ], - "signature": [ - "SavedObjectsImportUnknownError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45580,7 +52951,7 @@ "signature": [ "\"unknown\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45591,7 +52962,7 @@ "tags": [], "label": "message", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false }, @@ -45602,7 +52973,7 @@ "tags": [], "label": "statusCode", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -45618,10 +52989,7 @@ "description": [ "\nRepresents a failure to import due to having an unsupported saved object type." ], - "signature": [ - "SavedObjectsImportUnsupportedTypeError" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45635,7 +53003,7 @@ "signature": [ "\"unsupported_type\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false } @@ -45649,10 +53017,7 @@ "tags": [], "label": "SavedObjectsIncrementCounterField", "description": [], - "signature": [ - "SavedObjectsIncrementCounterField" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/increment_counter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45665,7 +53030,7 @@ "description": [ "The field name to increment the counter by." ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/increment_counter.ts", "deprecated": false, "trackAdoption": false }, @@ -45681,7 +53046,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/increment_counter.ts", "deprecated": false, "trackAdoption": false } @@ -45696,11 +53061,23 @@ "label": "SavedObjectsIncrementCounterOptions", "description": [], "signature": [ - "SavedObjectsIncrementCounterOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterOptions", + "text": "SavedObjectsIncrementCounterOptions" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/increment_counter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45716,7 +53093,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/increment_counter.ts", "deprecated": false, "trackAdoption": false }, @@ -45730,10 +53107,16 @@ "{@link SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/increment_counter.ts", "deprecated": false, "trackAdoption": false }, @@ -45747,10 +53130,16 @@ "\n(default='wait_for') The Elasticsearch refresh setting for this\noperation. See {@link MutatingOperationRefreshSetting}" ], "signature": [ - "MutatingOperationRefreshSetting", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.MutatingOperationRefreshSetting", + "text": "MutatingOperationRefreshSetting" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/increment_counter.ts", "deprecated": false, "trackAdoption": false }, @@ -45766,7 +53155,7 @@ "signature": [ "Attributes | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/increment_counter.ts", "deprecated": false, "trackAdoption": false } @@ -45782,10 +53171,7 @@ "description": [ "\nDescribe the fields of a {@link SavedObjectsTypeMappingDefinition | saved object type}.\n" ], - "signature": [ - "SavedObjectsMappingProperties" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45798,9 +53184,15 @@ "description": [], "signature": [ "[field: string]: ", - "SavedObjectsFieldMapping" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsFieldMapping", + "text": "SavedObjectsFieldMapping" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts", "deprecated": false, "trackAdoption": false } @@ -45814,10 +53206,7 @@ "tags": [], "label": "SavedObjectsMigrationLogger", "description": [], - "signature": [ - "SavedObjectsMigrationLogger" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45831,7 +53220,7 @@ "signature": [ "(msg: string) => void" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45845,7 +53234,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -45863,7 +53252,7 @@ "signature": [ "(msg: string) => void" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45877,7 +53266,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -45897,7 +53286,7 @@ "signature": [ "(msg: string) => void" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, @@ -45934,7 +53323,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -45952,7 +53341,7 @@ "signature": [ "(msg: string) => void" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45966,7 +53355,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -45983,12 +53372,24 @@ "description": [], "signature": [ "(msg: string, meta: Meta) => void" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46002,7 +53403,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -46017,7 +53418,7 @@ "signature": [ "Meta" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -46037,10 +53438,7 @@ "description": [ "\nInformation about the migrations that have been applied to this SavedObject.\nWhen Kibana starts up, KibanaMigrator detects outdated documents and\nmigrates them based on this value. For each migration that has been applied,\nthe plugin's name is used as a key and the latest migration version as the\nvalue.\n" ], - "signature": [ - "SavedObjectsMigrationVersion" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46054,7 +53452,7 @@ "signature": [ "[pluginName: string]: string" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -46068,10 +53466,7 @@ "tags": [], "label": "SavedObjectsOpenPointInTimeOptions", "description": [], - "signature": [ - "SavedObjectsOpenPointInTimeOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/open_point_in_time_for_type.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46087,7 +53482,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/open_point_in_time_for_type.ts", "deprecated": false, "trackAdoption": false }, @@ -46103,7 +53498,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/open_point_in_time_for_type.ts", "deprecated": false, "trackAdoption": false }, @@ -46119,7 +53514,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/open_point_in_time_for_type.ts", "deprecated": false, "trackAdoption": false } @@ -46133,10 +53528,7 @@ "tags": [], "label": "SavedObjectsOpenPointInTimeResponse", "description": [], - "signature": [ - "SavedObjectsOpenPointInTimeResponse" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/open_point_in_time_for_type.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46149,7 +53541,7 @@ "description": [ "\nPIT ID returned from ES." ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/open_point_in_time_for_type.ts", "deprecated": false, "trackAdoption": false } @@ -46163,10 +53555,7 @@ "tags": [], "label": "SavedObjectsPitParams", "description": [], - "signature": [ - "SavedObjectsPitParams" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46177,7 +53566,7 @@ "tags": [], "label": "id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false }, @@ -46191,7 +53580,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", "deprecated": false, "trackAdoption": false } @@ -46207,10 +53596,7 @@ "description": [ "\nA raw document as represented directly in the saved object index.\n" ], - "signature": [ - "SavedObjectsRawDoc" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46221,7 +53607,7 @@ "tags": [], "label": "_id", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46233,9 +53619,15 @@ "label": "_source", "description": [], "signature": [ - "SavedObjectsRawDocSource" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDocSource", + "text": "SavedObjectsRawDocSource" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46249,7 +53641,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46263,7 +53655,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false } @@ -46279,10 +53671,7 @@ "description": [ "\nOptions that can be specified when using the saved objects serializer to parse a raw document.\n" ], - "signature": [ - "SavedObjectsRawDocParseOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46298,7 +53687,7 @@ "signature": [ "\"strict\" | \"lax\" | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false } @@ -46312,10 +53701,7 @@ "tags": [], "label": "SavedObjectsRawDocSource", "description": [], - "signature": [ - "SavedObjectsRawDocSource" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46326,7 +53712,7 @@ "tags": [], "label": "type", "description": [], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46340,7 +53726,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46354,7 +53740,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46366,10 +53752,16 @@ "label": "migrationVersion", "description": [], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46383,7 +53775,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46397,7 +53789,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46409,10 +53801,16 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46426,7 +53824,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false }, @@ -46440,7 +53838,7 @@ "signature": [ "[typeMapping: string]: any" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false } @@ -46457,11 +53855,23 @@ "\n" ], "signature": [ - "SavedObjectsRemoveReferencesToOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToOptions", + "text": "SavedObjectsRemoveReferencesToOptions" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/remove_references_to.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46477,7 +53887,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/remove_references_to.ts", "deprecated": false, "trackAdoption": false } @@ -46494,11 +53904,23 @@ "\n" ], "signature": [ - "SavedObjectsRemoveReferencesToResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToResponse", + "text": "SavedObjectsRemoveReferencesToResponse" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/remove_references_to.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46511,7 +53933,7 @@ "description": [ "The number of objects that have been updated by this operation" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/remove_references_to.ts", "deprecated": false, "trackAdoption": false } @@ -46527,10 +53949,7 @@ "description": [ "\nFactory provided when invoking a {@link SavedObjectsClientFactoryProvider | client factory provider}\nSee {@link SavedObjectsServiceSetup.setClientFactoryProvider}\n" ], - "signature": [ - "SavedObjectsRepositoryFactory" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46545,11 +53964,23 @@ ], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", includedHiddenTypes?: string[] | undefined) => ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46561,10 +53992,16 @@ "label": "req", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -46581,7 +54018,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -46600,9 +54037,15 @@ ], "signature": [ "(includedHiddenTypes?: string[] | undefined) => ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46618,7 +54061,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -46638,10 +54081,7 @@ "description": [ "\nCore's `savedObjects` request handler context." ], - "signature": [ - "SavedObjectsRequestHandlerContext" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46653,9 +54093,15 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false }, @@ -46667,9 +54113,15 @@ "label": "typeRegistry", "description": [], "signature": [ - "ISavedObjectTypeRegistry" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false }, @@ -46682,11 +54134,23 @@ "description": [], "signature": [ "(options?: ", - "SavedObjectsClientProviderOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientProviderOptions", + "text": "SavedObjectsClientProviderOptions" + }, " | undefined) => ", - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46698,10 +54162,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsClientProviderOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientProviderOptions", + "text": "SavedObjectsClientProviderOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -46718,11 +54188,23 @@ "description": [], "signature": [ "(client: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", - "ISavedObjectsExporter" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsExporter", + "text": "ISavedObjectsExporter" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46734,9 +54216,15 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -46753,11 +54241,23 @@ "description": [], "signature": [ "(client: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", - "ISavedObjectsImporter" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsImporter", + "text": "ISavedObjectsImporter" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46769,9 +54269,15 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -46791,10 +54297,7 @@ "description": [ "\nOptions to control the \"resolve import\" operation." ], - "signature": [ - "SavedObjectsResolveImportErrorsOptions" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46810,7 +54313,7 @@ "signature": [ "Readable" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false }, @@ -46824,10 +54327,16 @@ "saved object import references to retry" ], "signature": [ - "SavedObjectsImportRetry", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportRetry", + "text": "SavedObjectsImportRetry" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false }, @@ -46843,7 +54352,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false }, @@ -46856,7 +54365,7 @@ "description": [ "If true, will create new copies of import objects, each with a random `id` and undefined `originId`." ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false } @@ -46873,10 +54382,16 @@ "\n" ], "signature": [ - "SavedObjectsResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsResolveResponse", + "text": "SavedObjectsResolveResponse" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/resolve.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46890,10 +54405,16 @@ "\nThe saved object that was found." ], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/resolve.ts", "deprecated": false, "trackAdoption": false }, @@ -46909,7 +54430,7 @@ "signature": [ "\"conflict\" | \"exactMatch\" | \"aliasMatch\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/resolve.ts", "deprecated": false, "trackAdoption": false }, @@ -46925,7 +54446,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/resolve.ts", "deprecated": false, "trackAdoption": false }, @@ -46941,7 +54462,7 @@ "signature": [ "\"savedObjectConversion\" | \"savedObjectImport\" | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/resolve.ts", "deprecated": false, "trackAdoption": false } @@ -46957,10 +54478,7 @@ "description": [ "\nSaved Objects is Kibana's data persistence mechanism allowing plugins to\nuse Elasticsearch for storing and querying state. The SavedObjectsServiceSetup API exposes methods\nfor registering Saved Object types, creating and registering Saved Object client wrappers and factories.\n" ], - "signature": [ - "SavedObjectsServiceSetup" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46975,10 +54493,16 @@ ], "signature": [ "(clientFactoryProvider: ", - "SavedObjectsClientFactoryProvider", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientFactoryProvider", + "text": "SavedObjectsClientFactoryProvider" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -46990,9 +54514,15 @@ "label": "clientFactoryProvider", "description": [], "signature": [ - "SavedObjectsClientFactoryProvider" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientFactoryProvider", + "text": "SavedObjectsClientFactoryProvider" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47011,10 +54541,16 @@ ], "signature": [ "(priority: number, id: string, factory: ", - "SavedObjectsClientWrapperFactory", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientWrapperFactory", + "text": "SavedObjectsClientWrapperFactory" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47028,7 +54564,7 @@ "signature": [ "number" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47043,7 +54579,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47056,9 +54592,15 @@ "label": "factory", "description": [], "signature": [ - "SavedObjectsClientWrapperFactory" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientWrapperFactory", + "text": "SavedObjectsClientWrapperFactory" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47077,10 +54619,16 @@ ], "signature": [ "(type: ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47092,10 +54640,16 @@ "label": "type", "description": [], "signature": [ - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47115,7 +54669,7 @@ "signature": [ "() => string" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -47133,10 +54687,7 @@ "description": [ "\nSaved Objects is Kibana's data persistence mechanism allowing plugins to\nuse Elasticsearch for storing and querying state. The\nSavedObjectsServiceStart API provides a scoped Saved Objects client for\ninteracting with Saved Objects.\n" ], - "signature": [ - "SavedObjectsServiceStart" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47151,13 +54702,31 @@ ], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", options?: ", - "SavedObjectsClientProviderOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientProviderOptions", + "text": "SavedObjectsClientProviderOptions" + }, " | undefined) => ", - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47169,10 +54738,16 @@ "label": "req", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47185,10 +54760,16 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsClientProviderOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientProviderOptions", + "text": "SavedObjectsClientProviderOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -47207,11 +54788,23 @@ ], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", includedHiddenTypes?: string[] | undefined) => ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47225,10 +54818,16 @@ "- The request to create the scoped repository from." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47245,7 +54844,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -47264,9 +54863,15 @@ ], "signature": [ "(includedHiddenTypes?: string[] | undefined) => ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47282,7 +54887,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -47301,9 +54906,15 @@ ], "signature": [ "() => ", - "ISavedObjectsSerializer" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsSerializer", + "text": "ISavedObjectsSerializer" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -47320,11 +54931,23 @@ ], "signature": [ "(client: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", - "ISavedObjectsExporter" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsExporter", + "text": "ISavedObjectsExporter" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47336,9 +54959,15 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47357,11 +54986,23 @@ ], "signature": [ "(client: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", - "ISavedObjectsImporter" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsImporter", + "text": "ISavedObjectsImporter" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47373,9 +55014,15 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47394,9 +55041,15 @@ ], "signature": [ "() => ", - "ISavedObjectTypeRegistry" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -47414,10 +55067,7 @@ "description": [ "\nMeta information about the SavedObjectService's status. Available to plugins via {@link CoreSetup.status}.\n" ], - "signature": [ - "SavedObjectStatusMeta" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47431,7 +55081,7 @@ "signature": [ "{ [status: string]: number; skipped: number; migrated: number; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_status.ts", "deprecated": false, "trackAdoption": false } @@ -47446,10 +55096,16 @@ "label": "SavedObjectsType", "description": [], "signature": [ - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47462,7 +55118,7 @@ "description": [ "\nThe name of the type, which is also used as the internal id." ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false }, @@ -47475,7 +55131,7 @@ "description": [ "\nIs the type hidden by default. If true, repositories will not have access to this type unless explicitly\ndeclared as an `extraType` when creating the repository.\n\nSee {@link SavedObjectsServiceStart.createInternalRepository | createInternalRepository}." ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false }, @@ -47491,7 +55147,7 @@ "signature": [ "\"single\" | \"multiple\" | \"multiple-isolated\" | \"agnostic\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false }, @@ -47507,7 +55163,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false }, @@ -47523,7 +55179,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false }, @@ -47537,10 +55193,16 @@ "\nIf defined, allows a type to exclude unneeded documents from the migration process and effectively be deleted.\nSee {@link SavedObjectTypeExcludeFromUpgradeFilterHook} for more details." ], "signature": [ - "SavedObjectTypeExcludeFromUpgradeFilterHook", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectTypeExcludeFromUpgradeFilterHook", + "text": "SavedObjectTypeExcludeFromUpgradeFilterHook" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false }, @@ -47554,9 +55216,15 @@ "\nThe {@link SavedObjectsTypeMappingDefinition | mapping definition} for the type." ], "signature": [ - "SavedObjectsTypeMappingDefinition" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsTypeMappingDefinition", + "text": "SavedObjectsTypeMappingDefinition" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false }, @@ -47570,12 +55238,24 @@ "\nAn optional map of {@link SavedObjectMigrationFn | migrations} or a function returning a map of {@link SavedObjectMigrationFn | migrations} to be used to migrate the type." ], "signature": [ - "SavedObjectMigrationMap", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + }, " | (() => ", - "SavedObjectMigrationMap", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + }, ") | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false }, @@ -47589,12 +55269,24 @@ "\nAn optional schema that can be used to validate the attributes of the type.\n\nWhen provided, calls to {@link SavedObjectsClient.create | create} will be validated against this schema.\n\nSee {@link SavedObjectsValidationMap} for more details." ], "signature": [ - "SavedObjectsValidationMap", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsValidationMap", + "text": "SavedObjectsValidationMap" + }, " | (() => ", - "SavedObjectsValidationMap", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsValidationMap", + "text": "SavedObjectsValidationMap" + }, ") | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false }, @@ -47610,7 +55302,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false }, @@ -47624,10 +55316,16 @@ "\nAn optional {@link SavedObjectsTypeManagementDefinition | saved objects management section} definition for the type." ], "signature": [ - "SavedObjectsTypeManagementDefinition", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsTypeManagementDefinition", + "text": "SavedObjectsTypeManagementDefinition" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false } @@ -47644,10 +55342,16 @@ "\nConfiguration options for the {@link SavedObjectsType | type}'s management section.\n" ], "signature": [ - "SavedObjectsTypeManagementDefinition", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsTypeManagementDefinition", + "text": "SavedObjectsTypeManagementDefinition" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47663,7 +55367,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false }, @@ -47679,7 +55383,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false }, @@ -47695,7 +55399,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false }, @@ -47711,7 +55415,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false }, @@ -47727,7 +55431,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false }, @@ -47742,10 +55446,16 @@ ], "signature": [ "((savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ") => string) | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47757,10 +55467,16 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47779,10 +55495,16 @@ ], "signature": [ "((savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ") => string) | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47794,10 +55516,16 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47816,10 +55544,16 @@ ], "signature": [ "((savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ") => { path: string; uiCapabilitiesPath: string; }) | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47831,10 +55565,16 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -47854,10 +55594,16 @@ "\nAn optional export transform function that can be used transform the objects of the registered type during\nthe export process.\n\nIt can be used to either mutate the exported objects, or add additional objects (of any type) to the export list.\n\nSee {@link SavedObjectsExportTransform | the transform type documentation} for more info and examples.\n\nWhen implementing both `isExportable` and `onExport`, it is mandatory that\n`isExportable` returns the same value for an object before and after going\nthough the export transform.\nE.g `isExportable(objectBeforeTransform) === isExportable(objectAfterTransform)`\n" ], "signature": [ - "SavedObjectsExportTransform", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportTransform", + "text": "SavedObjectsExportTransform" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false }, @@ -47871,10 +55617,16 @@ "\nAn optional {@link SavedObjectsImportHook | import hook} to use when importing given type.\n\nImport hooks are executed during the savedObjects import process and allow to interact\nwith the imported objects. See the {@link SavedObjectsImportHook | hook documentation}\nfor more info.\n" ], "signature": [ - "SavedObjectsImportHook", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsImportHook", + "text": "SavedObjectsImportHook" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false }, @@ -47888,10 +55640,16 @@ "\nOptional hook to specify whether an object should be exportable.\n\nIf specified, `isExportable` will be called during export for each\nof this type's objects in the export, and the ones not matching the\npredicate will be excluded from the export.\n\nWhen implementing both `isExportable` and `onExport`, it is mandatory that\n`isExportable` returns the same value for an object before and after going\nthough the export transform.\nE.g `isExportable(objectBeforeTransform) === isExportable(objectAfterTransform)`\n" ], "signature": [ - "SavedObjectsExportablePredicate", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportablePredicate", + "text": "SavedObjectsExportablePredicate" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", "deprecated": false, "trackAdoption": false } @@ -47907,10 +55665,7 @@ "description": [ "\nDescribe a saved object type mapping.\n" ], - "signature": [ - "SavedObjectsTypeMappingDefinition" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47926,7 +55681,7 @@ "signature": [ "false | \"strict\" | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts", "deprecated": false, "trackAdoption": false }, @@ -47940,9 +55695,15 @@ "The underlying properties of the type mapping" ], "signature": [ - "SavedObjectsMappingProperties" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsMappingProperties", + "text": "SavedObjectsMappingProperties" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts", "deprecated": false, "trackAdoption": false } @@ -47958,10 +55719,7 @@ "description": [ "\nAn object that should have its spaces updated.\n" ], - "signature": [ - "SavedObjectsUpdateObjectsSpacesObject" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47974,7 +55732,7 @@ "description": [ "The type of the object to update" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false }, @@ -47987,7 +55745,7 @@ "description": [ "The ID of the object to update" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false } @@ -48004,11 +55762,23 @@ "\nOptions for the update operation.\n" ], "signature": [ - "SavedObjectsUpdateObjectsSpacesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesOptions", + "text": "SavedObjectsUpdateObjectsSpacesOptions" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48022,10 +55792,16 @@ "The Elasticsearch Refresh setting for this operation" ], "signature": [ - "MutatingOperationRefreshSetting", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.MutatingOperationRefreshSetting", + "text": "MutatingOperationRefreshSetting" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false } @@ -48041,10 +55817,7 @@ "description": [ "\nThe response when objects' spaces are updated.\n" ], - "signature": [ - "SavedObjectsUpdateObjectsSpacesResponse" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48056,10 +55829,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsUpdateObjectsSpacesResponseObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesResponseObject", + "text": "SavedObjectsUpdateObjectsSpacesResponseObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false } @@ -48075,10 +55854,7 @@ "description": [ "\nDetails about a specific object's update result.\n" ], - "signature": [ - "SavedObjectsUpdateObjectsSpacesResponseObject" - ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48091,7 +55867,7 @@ "description": [ "The type of the referenced object" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false }, @@ -48104,7 +55880,7 @@ "description": [ "The ID of the referenced object" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false }, @@ -48120,7 +55896,7 @@ "signature": [ "string[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false }, @@ -48134,10 +55910,16 @@ "Included if there was an error updating this object's spaces" ], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", "deprecated": false, "trackAdoption": false } @@ -48154,11 +55936,23 @@ "\n" ], "signature": [ - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, " extends ", - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48174,7 +55968,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", "deprecated": false, "trackAdoption": false }, @@ -48188,10 +55982,16 @@ "{@inheritdoc SavedObjectReference}" ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", "deprecated": false, "trackAdoption": false }, @@ -48205,10 +56005,16 @@ "The Elasticsearch Refresh setting for this operation" ], "signature": [ - "MutatingOperationRefreshSetting", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.MutatingOperationRefreshSetting", + "text": "MutatingOperationRefreshSetting" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", "deprecated": false, "trackAdoption": false }, @@ -48224,7 +56030,7 @@ "signature": [ "Attributes | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", "deprecated": false, "trackAdoption": false }, @@ -48240,7 +56046,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", "deprecated": false, "trackAdoption": false } @@ -48257,12 +56063,24 @@ "\n" ], "signature": [ - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, " extends Omit<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ", \"attributes\" | \"references\">" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48276,7 +56094,7 @@ "signature": [ "{ [P in keyof T]?: T[P] | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", "deprecated": false, "trackAdoption": false }, @@ -48288,10 +56106,16 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", "deprecated": false, "trackAdoption": false } @@ -48307,10 +56131,7 @@ "description": [ "\nA map of {@link SavedObjectsValidationSpec | validation specs} to be used for a given type.\nThe map's keys must be valid semver versions.\n\nAny time you change the schema of a {@link SavedObjectsType}, you should add a new entry\nto this map for the Kibana version the change was introduced in.\n" ], - "signature": [ - "SavedObjectsValidationMap" - ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/validation.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48323,9 +56144,15 @@ "description": [], "signature": [ "[version: string]: ", - "SavedObjectsValidationSpec" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsValidationSpec", + "text": "SavedObjectsValidationSpec" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/validation.ts", "deprecated": false, "trackAdoption": false } @@ -48342,10 +56169,16 @@ "\nThe current status of a service at a point in time.\n" ], "signature": [ - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, "" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48361,7 +56194,7 @@ "signature": [ "Readonly<{ toString: () => \"available\"; valueOf: () => 0; toJSON: () => \"available\"; }> | Readonly<{ toString: () => \"degraded\"; valueOf: () => 1; toJSON: () => \"degraded\"; }> | Readonly<{ toString: () => \"unavailable\"; valueOf: () => 2; toJSON: () => \"unavailable\"; }> | Readonly<{ toString: () => \"critical\"; valueOf: () => 3; toJSON: () => \"critical\"; }>" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false }, @@ -48374,7 +56207,7 @@ "description": [ "\nA high-level summary of the service status." ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false }, @@ -48390,7 +56223,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false }, @@ -48406,7 +56239,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false }, @@ -48422,7 +56255,7 @@ "signature": [ "Meta | undefined" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false } @@ -48438,10 +56271,7 @@ "description": [ "\nReturn type from a function to validate cookie contents." ], - "signature": [ - "SessionCookieValidationResult" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48454,7 +56284,7 @@ "description": [ "\nWhether the cookie is valid or not." ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false }, @@ -48470,7 +56300,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false } @@ -48487,10 +56317,16 @@ "\nProvides an interface to store and retrieve data across requests." ], "signature": [ - "SessionStorage", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorage", + "text": "SessionStorage" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48506,7 +56342,7 @@ "signature": [ "() => Promise" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -48524,7 +56360,7 @@ "signature": [ "(sessionValue: T) => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48540,7 +56376,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -48560,7 +56396,7 @@ "signature": [ "() => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -48579,10 +56415,16 @@ "\nConfiguration used to create HTTP session storage based on top of cookie mechanism." ], "signature": [ - "SessionStorageCookieOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageCookieOptions", + "text": "SessionStorageCookieOptions" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48595,7 +56437,7 @@ "description": [ "\nName of the session cookie." ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false }, @@ -48608,7 +56450,7 @@ "description": [ "\nA key used to encrypt a cookie's value. Should be at least 32 characters long." ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false }, @@ -48623,9 +56465,15 @@ ], "signature": [ "(sessionValue: T | T[]) => ", - "SessionCookieValidationResult" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionCookieValidationResult", + "text": "SessionCookieValidationResult" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48639,7 +56487,7 @@ "signature": [ "T | T[]" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -48656,7 +56504,7 @@ "description": [ "\nFlag indicating whether the cookie should be sent only via a secure connection." ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false }, @@ -48672,7 +56520,7 @@ "signature": [ "\"None\" | \"Strict\" | \"Lax\" | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false } @@ -48689,10 +56537,16 @@ "\nSessionStorage factory to bind one to an incoming request" ], "signature": [ - "SessionStorageFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageFactory", + "text": "SessionStorageFactory" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48705,12 +56559,24 @@ "description": [], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", - "SessionStorage", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorage", + "text": "SessionStorage" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48722,10 +56588,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/session_storage.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -48746,10 +56618,16 @@ "\nConstructor of a {@link IShipper}" ], "signature": [ - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, "" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48762,7 +56640,7 @@ "description": [ "\nThe shipper's unique name" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -48778,7 +56656,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48794,7 +56672,7 @@ "signature": [ "Config" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -48809,9 +56687,15 @@ "Common context {@link AnalyticsClientInitContext }" ], "signature": [ - "AnalyticsClientInitContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.AnalyticsClientInitContext", + "text": "AnalyticsClientInitContext" + } ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -48831,10 +56715,7 @@ "description": [ "\nAPI for accessing status of Core and this plugin's dependencies as well as for customizing this plugin's status.\n" ], - "signature": [ - "StatusServiceSetup" - ], - "path": "node_modules/@types/kbn__core-status-server/index.d.ts", + "path": "packages/core/status/core-status-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48850,10 +56731,16 @@ "signature": [ "Observable", "<", - "CoreStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.CoreStatus", + "text": "CoreStatus" + }, ">" ], - "path": "node_modules/@types/kbn__core-status-server/index.d.ts", + "path": "packages/core/status/core-status-server/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -48869,10 +56756,16 @@ "signature": [ "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">" ], - "path": "node_modules/@types/kbn__core-status-server/index.d.ts", + "path": "packages/core/status/core-status-server/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -48889,10 +56782,16 @@ "(status$: ", "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">) => void" ], - "path": "node_modules/@types/kbn__core-status-server/index.d.ts", + "path": "packages/core/status/core-status-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48906,10 +56805,16 @@ "signature": [ "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">" ], - "path": "node_modules/@types/kbn__core-status-server/index.d.ts", + "path": "packages/core/status/core-status-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -48929,10 +56834,16 @@ "signature": [ "Observable", ">>" ], - "path": "node_modules/@types/kbn__core-status-server/index.d.ts", + "path": "packages/core/status/core-status-server/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -48948,10 +56859,16 @@ "signature": [ "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">" ], - "path": "node_modules/@types/kbn__core-status-server/index.d.ts", + "path": "packages/core/status/core-status-server/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -48967,7 +56884,7 @@ "signature": [ "() => boolean" ], - "path": "node_modules/@types/kbn__core-status-server/index.d.ts", + "path": "packages/core/status/core-status-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -48985,10 +56902,7 @@ "description": [ "\nShape of the events emitted by the telemetryCounter$ observable" ], - "signature": [ - "TelemetryCounter" - ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49004,7 +56918,7 @@ "signature": [ "\"failed\" | \"enqueued\" | \"sent_to_shipper\" | \"succeeded\" | \"dropped\"" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -49017,7 +56931,7 @@ "description": [ "\nWho emitted the event? It can be \"client\" or the name of the shipper." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -49030,7 +56944,7 @@ "description": [ "\nThe event type the success/failure/drop event refers to." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -49043,7 +56957,7 @@ "description": [ "\nCode to provide additional information about the success or failure. Examples are 200/400/504/ValidationError/UnknownError" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false }, @@ -49056,7 +56970,7 @@ "description": [ "\nThe number of events that this counter refers to." ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false } @@ -49073,10 +56987,16 @@ "\nUiSettings parameters defined by the plugins." ], "signature": [ - "UiSettingsParams", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UiSettingsParams", + "text": "UiSettingsParams" + }, "" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49092,7 +57012,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49108,7 +57028,7 @@ "signature": [ "T | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49124,7 +57044,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49140,7 +57060,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49156,7 +57076,7 @@ "signature": [ "string[] | number[] | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49172,7 +57092,7 @@ "signature": [ "Record | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49188,7 +57108,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49204,7 +57124,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49220,7 +57140,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49234,10 +57154,16 @@ "defines a type of UI element {@link UiSettingsType}" ], "signature": [ - "UiSettingsType", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UiSettingsType", + "text": "UiSettingsType" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49251,10 +57177,16 @@ "optional deprecation information. Used to generate a deprecation warning." ], "signature": [ - "DeprecationSettings", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.DeprecationSettings", + "text": "DeprecationSettings" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49270,7 +57202,7 @@ "signature": [ "number | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49282,10 +57214,16 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49303,7 +57241,7 @@ "signature": [ "{ type: string; name: string; } | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": true, "trackAdoption": false, "references": [ @@ -49337,10 +57275,7 @@ "description": [ "\nCore's `uiSettings` request handler context." ], - "signature": [ - "UiSettingsRequestHandlerContext" - ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49352,9 +57287,15 @@ "label": "client", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false } @@ -49368,10 +57309,7 @@ "tags": [], "label": "UiSettingsServiceSetup", "description": [], - "signature": [ - "UiSettingsServiceSetup" - ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49386,10 +57324,16 @@ ], "signature": [ "(settings: Record>) => void" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49402,10 +57346,16 @@ "description": [], "signature": [ "Record>" ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -49423,10 +57373,7 @@ "tags": [], "label": "UiSettingsServiceStart", "description": [], - "signature": [ - "UiSettingsServiceStart" - ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49441,11 +57388,23 @@ ], "signature": [ "(savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49457,9 +57416,15 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-ui-settings-server/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -49477,10 +57442,7 @@ "tags": [], "label": "UnauthorizedErrorHandlerNotHandledResult", "description": [], - "signature": [ - "UnauthorizedErrorHandlerNotHandledResult" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49494,7 +57456,7 @@ "signature": [ "\"notHandled\"" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false } @@ -49508,10 +57470,7 @@ "tags": [], "label": "UnauthorizedErrorHandlerOptions", "description": [], - "signature": [ - "UnauthorizedErrorHandlerOptions" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49526,7 +57485,7 @@ "ResponseError", " & { statusCode: 401; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -49538,10 +57497,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false } @@ -49555,10 +57520,7 @@ "tags": [], "label": "UnauthorizedErrorHandlerResultRetryParams", "description": [], - "signature": [ - "UnauthorizedErrorHandlerResultRetryParams" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49572,7 +57534,7 @@ "signature": [ "{ [x: string]: string | string[]; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false } @@ -49587,11 +57549,23 @@ "label": "UnauthorizedErrorHandlerRetryResult", "description": [], "signature": [ - "UnauthorizedErrorHandlerRetryResult", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerRetryResult", + "text": "UnauthorizedErrorHandlerRetryResult" + }, " extends ", - "UnauthorizedErrorHandlerResultRetryParams" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerResultRetryParams", + "text": "UnauthorizedErrorHandlerResultRetryParams" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49605,7 +57579,7 @@ "signature": [ "\"retry\"" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false } @@ -49621,10 +57595,7 @@ "description": [ "\nToolkit passed to a {@link UnauthorizedErrorHandler} used to generate responses from the handler" ], - "signature": [ - "UnauthorizedErrorHandlerToolkit" - ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49639,9 +57610,15 @@ ], "signature": [ "() => ", - "UnauthorizedErrorHandlerNotHandledResult" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerNotHandledResult", + "text": "UnauthorizedErrorHandlerNotHandledResult" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -49658,11 +57635,23 @@ ], "signature": [ "(params: ", - "UnauthorizedErrorHandlerResultRetryParams", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerResultRetryParams", + "text": "UnauthorizedErrorHandlerResultRetryParams" + }, ") => ", - "UnauthorizedErrorHandlerRetryResult" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerRetryResult", + "text": "UnauthorizedErrorHandlerRetryResult" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49674,9 +57663,15 @@ "label": "params", "description": [], "signature": [ - "UnauthorizedErrorHandlerResultRetryParams" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerResultRetryParams", + "text": "UnauthorizedErrorHandlerResultRetryParams" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -49697,10 +57692,16 @@ "\nDescribes the values explicitly set by user." ], "signature": [ - "UserProvidedValues", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UserProvidedValues", + "text": "UserProvidedValues" + }, "" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -49714,7 +57715,7 @@ "signature": [ "T | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -49728,7 +57729,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -49744,10 +57745,7 @@ "tags": [], "label": "AuthResultType", "description": [], - "signature": [ - "AuthResultType" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -49761,10 +57759,7 @@ "description": [ "\nStatus indicating an outcome of the authentication." ], - "signature": [ - "AuthStatus" - ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/auth_state.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -49776,10 +57771,7 @@ "tags": [], "label": "PluginType", "description": [], - "signature": [ - "PluginType" - ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -49797,10 +57789,16 @@ ], "signature": [ "(details: ", - "DeprecatedConfigDetails", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.DeprecatedConfigDetails", + "text": "DeprecatedConfigDetails" + }, ") => void" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -49813,9 +57811,15 @@ "label": "details", "description": [], "signature": [ - "DeprecatedConfigDetails" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.DeprecatedConfigDetails", + "text": "DeprecatedConfigDetails" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false } @@ -49833,24 +57837,66 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], - "path": "node_modules/@types/kbn__core-analytics-server/index.d.ts", + "path": "packages/core/analytics/core-analytics-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -49866,24 +57912,66 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], - "path": "node_modules/@types/kbn__core-analytics-server/index.d.ts", + "path": "packages/core/analytics/core-analytics-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -49899,14 +57987,26 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; }" ], - "path": "node_modules/@types/kbn__core-analytics-server/index.d.ts", + "path": "packages/core/analytics/core-analytics-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -49923,7 +58023,7 @@ "signature": [ "\"kbnAppWrapper\"" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/application/core-application-common/src/app_wrapper_class.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -49936,15 +58036,39 @@ "label": "AppenderConfigType", "description": [], "signature": [ - "ConsoleAppenderConfig", + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.ConsoleAppenderConfig", + "text": "ConsoleAppenderConfig" + }, " | ", - "FileAppenderConfig", + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.FileAppenderConfig", + "text": "FileAppenderConfig" + }, " | ", - "RewriteAppenderConfig", + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.RewriteAppenderConfig", + "text": "RewriteAppenderConfig" + }, " | ", - "RollingFileAppenderConfig" + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.RollingFileAppenderConfig", + "text": "RollingFileAppenderConfig" + } ], - "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", + "path": "packages/core/logging/core-logging-server/src/appenders/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -49960,22 +58084,64 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "LifecycleResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.LifecycleResponseFactory", + "text": "LifecycleResponseFactory" + }, ", toolkit: ", - "AuthToolkit", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthToolkit", + "text": "AuthToolkit" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | ", - "AuthResult", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResult", + "text": "AuthResult" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | ", - "AuthResult", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResult", + "text": "AuthResult" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -49988,10 +58154,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false }, @@ -50003,11 +58175,23 @@ "label": "response", "description": [], "signature": [ - "KibanaRedirectionResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRedirectionResponseFactory", + "text": "KibanaRedirectionResponseFactory" + }, " & ", - "KibanaErrorResponseFactory" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaErrorResponseFactory", + "text": "KibanaErrorResponseFactory" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false }, @@ -50019,9 +58203,15 @@ "label": "toolkit", "description": [], "signature": [ - "AuthToolkit" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthToolkit", + "text": "AuthToolkit" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false } @@ -50038,7 +58228,7 @@ "signature": [ "{ [x: string]: string | string[]; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50051,13 +58241,31 @@ "label": "AuthResult", "description": [], "signature": [ - "AuthResultAuthenticated", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultAuthenticated", + "text": "AuthResultAuthenticated" + }, " | ", - "AuthResultNotHandled", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultNotHandled", + "text": "AuthResultNotHandled" + }, " | ", - "AuthResultRedirected" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResultRedirected", + "text": "AuthResultRedirected" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50073,10 +58281,16 @@ ], "signature": [ "() => Partial<", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, ">" ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/capabilities.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -50094,16 +58308,40 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", uiCapabilities: ", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, ", useDefaultCapabilities: boolean) => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, ">" ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/capabilities.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -50116,10 +58354,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/capabilities.ts", "deprecated": false, "trackAdoption": false }, @@ -50131,9 +58375,15 @@ "label": "uiCapabilities", "description": [], "signature": [ - "Capabilities" + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + } ], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/capabilities.ts", "deprecated": false, "trackAdoption": false }, @@ -50144,7 +58394,7 @@ "tags": [], "label": "useDefaultCapabilities", "description": [], - "path": "node_modules/@types/kbn__core-capabilities-server/index.d.ts", + "path": "packages/core/capabilities/core-capabilities-server/src/capabilities.ts", "deprecated": false, "trackAdoption": false } @@ -50162,13 +58412,31 @@ ], "signature": [ "(config: Readonly<{ [x: string]: any; }>, fromPath: string, addDeprecation: ", - "AddConfigDeprecation", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.AddConfigDeprecation", + "text": "AddConfigDeprecation" + }, ", context: ", - "ConfigDeprecationContext", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationContext", + "text": "ConfigDeprecationContext" + }, ") => void | ", - "ConfigDeprecationCommand" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationCommand", + "text": "ConfigDeprecationCommand" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -50185,7 +58453,7 @@ "signature": [ "{ readonly [x: string]: any; }" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false }, @@ -50196,7 +58464,7 @@ "tags": [], "label": "fromPath", "description": [], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false }, @@ -50209,10 +58477,16 @@ "description": [], "signature": [ "(details: ", - "DeprecatedConfigDetails", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.DeprecatedConfigDetails", + "text": "DeprecatedConfigDetails" + }, ") => void" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -50225,9 +58499,15 @@ "label": "details", "description": [], "signature": [ - "DeprecatedConfigDetails" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.DeprecatedConfigDetails", + "text": "DeprecatedConfigDetails" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false } @@ -50241,9 +58521,15 @@ "label": "context", "description": [], "signature": [ - "ConfigDeprecationContext" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationContext", + "text": "ConfigDeprecationContext" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false } @@ -50261,12 +58547,24 @@ ], "signature": [ "(factory: ", - "ConfigDeprecationFactory", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationFactory", + "text": "ConfigDeprecationFactory" + }, ") => ", - "ConfigDeprecation", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + }, "[]" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -50279,9 +58577,15 @@ "label": "factory", "description": [], "signature": [ - "ConfigDeprecationFactory" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationFactory", + "text": "ConfigDeprecationFactory" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false } @@ -50298,7 +58602,7 @@ "signature": [ "string | string[]" ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/config.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50315,7 +58619,7 @@ "signature": [ "{ [x: string]: any; }" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/start_contract.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50329,10 +58633,16 @@ "description": [], "signature": [ "(params: ", - "CoreIncrementCounterParams", + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreIncrementCounterParams", + "text": "CoreIncrementCounterParams" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/setup_contract.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -50345,9 +58655,15 @@ "label": "params", "description": [], "signature": [ - "CoreIncrementCounterParams" + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreIncrementCounterParams", + "text": "CoreIncrementCounterParams" + } ], - "path": "node_modules/@types/kbn__core-usage-data-server/index.d.ts", + "path": "packages/core/usage-data/core-usage-data-server/src/setup_contract.ts", "deprecated": false, "trackAdoption": false } @@ -50364,10 +58680,16 @@ "\nMixin allowing plugins to define their own request handler contexts.\n" ], "signature": [ - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, " & { [Key in keyof T]: T[Key] extends Promise ? T[Key] : Promise; }" ], - "path": "node_modules/@types/kbn__core-http-request-handler-context-server/index.d.ts", + "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50380,11 +58702,23 @@ "label": "DeprecationsDetails", "description": [], "signature": [ - "ConfigDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.ConfigDeprecationDetails", + "text": "ConfigDeprecationDetails" + }, " | ", - "FeatureDeprecationDetails" + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.FeatureDeprecationDetails", + "text": "FeatureDeprecationDetails" + } ], - "path": "node_modules/@types/kbn__core-deprecations-common/index.d.ts", + "path": "packages/core/deprecations/core-deprecations-common/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50401,7 +58735,7 @@ "signature": [ "\"post\" | \"put\" | \"delete\" | \"patch\"" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50414,9 +58748,15 @@ "label": "DocLinksServiceStart", "description": [], "signature": [ - "DocLinksServiceSetup" + { + "pluginId": "@kbn/core-doc-links-server", + "scope": "server", + "docId": "kibKbnCoreDocLinksServerPluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + } ], - "path": "node_modules/@types/kbn__core-doc-links-server/index.d.ts", + "path": "packages/core/doc-links/core-doc-links-server/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50434,9 +58774,7 @@ "EcsBase", " & ", "EcsTracing", - " & { ecs: ", - "EcsField", - "; agent?: ", + " & { ecs: EcsField; agent?: ", "EcsAgent", " | undefined; as?: ", "EcsAutonomousSystem", @@ -50508,7 +58846,7 @@ "EcsVulnerability", " | undefined; }" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/ecs/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50523,7 +58861,7 @@ "signature": [ "\"host\" | \"database\" | \"email\" | \"package\" | \"network\" | \"web\" | \"file\" | \"session\" | \"registry\" | \"process\" | \"authentication\" | \"configuration\" | \"driver\" | \"iam\" | \"intrusion_detection\" | \"malware\"" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/ecs/event.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50538,7 +58876,7 @@ "signature": [ "\"metric\" | \"alert\" | \"signal\" | \"state\" | \"event\" | \"pipeline_error\"" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/ecs/event.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50553,7 +58891,7 @@ "signature": [ "\"success\" | \"unknown\" | \"failure\"" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/ecs/event.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -50568,7 +58906,7 @@ "signature": [ "\"start\" | \"error\" | \"connection\" | \"user\" | \"info\" | \"group\" | \"end\" | \"admin\" | \"protocol\" | \"access\" | \"allowed\" | \"change\" | \"creation\" | \"deletion\" | \"denied\" | \"installation\"" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/ecs/event.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -51771,7 +60109,7 @@ "default", "; }" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/client.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -51788,7 +60126,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -51801,9 +60139,15 @@ "label": "ExecutionContextStart", "description": [], "signature": [ - "ExecutionContextSetup" + { + "pluginId": "@kbn/core-execution-context-server", + "scope": "server", + "docId": "kibKbnCoreExecutionContextServerPluginApi", + "section": "def-server.ExecutionContextSetup", + "text": "ExecutionContextSetup" + } ], - "path": "node_modules/@types/kbn__core-execution-context-server/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -51820,15 +60164,15 @@ "signature": [ "{ [Key in keyof T]?: (T[Key] extends Maybe ? boolean : T[Key] extends Maybe ? boolean | ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.ExposedToBrowserDescriptor", "text": "ExposedToBrowserDescriptor" }, " : boolean) | undefined; }" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -51846,12 +60190,24 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", - "AuthHeaders", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthHeaders", + "text": "AuthHeaders" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/auth_headers.ts", "deprecated": false, "trackAdoption": false, "returnComment": [ @@ -51868,10 +60224,16 @@ "{@link KibanaRequest } - an incoming request." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/auth_headers.ts", "deprecated": false, "trackAdoption": false } @@ -51889,12 +60251,24 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => { status: ", - "AuthStatus", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthStatus", + "text": "AuthStatus" + }, "; state: T; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/auth_state.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -51909,10 +60283,16 @@ "{@link KibanaRequest } - an incoming request." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/auth_state.ts", "deprecated": false, "trackAdoption": false } @@ -51930,10 +60310,16 @@ ], "signature": [ "T extends ", - "HandlerFunction", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HandlerFunction", + "text": "HandlerFunction" + }, " ? U : never" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_provider.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -51950,7 +60336,7 @@ "signature": [ "(context: T, ...args: any[]) => any" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_provider.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -51965,7 +60351,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_provider.ts", "deprecated": false, "trackAdoption": false }, @@ -51979,7 +60365,7 @@ "signature": [ "any[]" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_provider.ts", "deprecated": false, "trackAdoption": false } @@ -51998,7 +60384,7 @@ "signature": [ "T extends (context: any, ...args: infer U) => any ? U : never" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_provider.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52015,7 +60401,7 @@ "signature": [ "{ accept?: string | string[] | undefined; \"accept-language\"?: string | string[] | undefined; \"accept-patch\"?: string | string[] | undefined; \"accept-ranges\"?: string | string[] | undefined; \"access-control-allow-credentials\"?: string | string[] | undefined; \"access-control-allow-headers\"?: string | string[] | undefined; \"access-control-allow-methods\"?: string | string[] | undefined; \"access-control-allow-origin\"?: string | string[] | undefined; \"access-control-expose-headers\"?: string | string[] | undefined; \"access-control-max-age\"?: string | string[] | undefined; \"access-control-request-headers\"?: string | string[] | undefined; \"access-control-request-method\"?: string | string[] | undefined; age?: string | string[] | undefined; allow?: string | string[] | undefined; \"alt-svc\"?: string | string[] | undefined; authorization?: string | string[] | undefined; \"cache-control\"?: string | string[] | undefined; connection?: string | string[] | undefined; \"content-disposition\"?: string | string[] | undefined; \"content-encoding\"?: string | string[] | undefined; \"content-language\"?: string | string[] | undefined; \"content-length\"?: string | string[] | undefined; \"content-location\"?: string | string[] | undefined; \"content-range\"?: string | string[] | undefined; \"content-type\"?: string | string[] | undefined; cookie?: string | string[] | undefined; date?: string | string[] | undefined; etag?: string | string[] | undefined; expect?: string | string[] | undefined; expires?: string | string[] | undefined; forwarded?: string | string[] | undefined; from?: string | string[] | undefined; host?: string | string[] | undefined; \"if-match\"?: string | string[] | undefined; \"if-modified-since\"?: string | string[] | undefined; \"if-none-match\"?: string | string[] | undefined; \"if-unmodified-since\"?: string | string[] | undefined; \"last-modified\"?: string | string[] | undefined; location?: string | string[] | undefined; origin?: string | string[] | undefined; pragma?: string | string[] | undefined; \"proxy-authenticate\"?: string | string[] | undefined; \"proxy-authorization\"?: string | string[] | undefined; \"public-key-pins\"?: string | string[] | undefined; range?: string | string[] | undefined; referer?: string | string[] | undefined; \"retry-after\"?: string | string[] | undefined; \"sec-websocket-accept\"?: string | string[] | undefined; \"sec-websocket-extensions\"?: string | string[] | undefined; \"sec-websocket-key\"?: string | string[] | undefined; \"sec-websocket-protocol\"?: string | string[] | undefined; \"sec-websocket-version\"?: string | string[] | undefined; \"set-cookie\"?: string | string[] | undefined; \"strict-transport-security\"?: string | string[] | undefined; tk?: string | string[] | undefined; trailer?: string | string[] | undefined; \"transfer-encoding\"?: string | string[] | undefined; upgrade?: string | string[] | undefined; \"user-agent\"?: string | string[] | undefined; vary?: string | string[] | undefined; via?: string | string[] | undefined; warning?: string | string[] | undefined; \"www-authenticate\"?: string | string[] | undefined; } & { [header: string]: string | string[] | undefined; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/headers.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52031,30 +60417,90 @@ ], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaSuccessResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaSuccessResponseFactory", + "text": "KibanaSuccessResponseFactory" + }, " & ", - "KibanaRedirectionResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRedirectionResponseFactory", + "text": "KibanaRedirectionResponseFactory" + }, " & ", - "KibanaErrorResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaErrorResponseFactory", + "text": "KibanaErrorResponseFactory" + }, " & { custom | Error | ", "Stream", " | Buffer | { message: string | Error; attributes?: ", - "ResponseErrorAttributes", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, " | undefined; } | undefined>(options: ", - "CustomHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, "): ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "; } & ", - "HttpResourcesServiceToolkit", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesServiceToolkit", + "text": "HttpResourcesServiceToolkit" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -52071,7 +60517,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -52085,10 +60531,16 @@ "{@link KibanaRequest } - object containing information about requested resource,\nsuch as path, method, headers, parameters, query, body, etc." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -52104,7 +60556,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -52121,9 +60573,15 @@ "\nHTTP Resources response parameters" ], "signature": [ - "HttpResponseOptions" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + } ], - "path": "node_modules/@types/kbn__core-http-resources-server/index.d.ts", + "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52142,7 +60600,7 @@ "Stream", " | Buffer | undefined" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52158,14 +60616,32 @@ ], "signature": [ "(context: Omit, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ") => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_provider.ts", "deprecated": false, "trackAdoption": false, "returnComment": [ @@ -52184,7 +60660,7 @@ "signature": [ "{ [P in Exclude]: Context[P]; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_provider.ts", "deprecated": false, "trackAdoption": false }, @@ -52199,12 +60675,24 @@ ], "signature": [ "[request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, "]" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/context_provider.ts", "deprecated": false, "trackAdoption": false } @@ -52222,10 +60710,16 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => boolean" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/auth_state.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -52240,10 +60734,16 @@ "{@link KibanaRequest } - an incoming request." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/auth_state.ts", "deprecated": false, "trackAdoption": false } @@ -52259,10 +60759,16 @@ "description": [], "signature": [ "{ readonly type?: string | undefined; readonly name?: string | undefined; readonly page?: string | undefined; readonly id?: string | undefined; readonly description?: string | undefined; readonly url?: string | undefined; readonly meta?: { [key: string]: string | number | boolean | undefined; } | undefined; child?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined; }" ], - "path": "node_modules/@types/kbn__core-execution-context-common/index.d.ts", + "path": "packages/core/execution-context/core-execution-context-common/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52278,40 +60784,24 @@ ], "signature": [ "Method extends \"options\" | \"get\" ? Required, \"body\">> : Required<", - "RouteConfigOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfigOptions", + "text": "RouteConfigOptions" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.kibanaResponseFactory", - "type": "CompoundType", - "tags": [], - "label": "kibanaResponseFactory", - "description": [], - "signature": [ - "KibanaSuccessResponseFactory", - " & ", - "KibanaRedirectionResponseFactory", - " & ", - "KibanaErrorResponseFactory", - " & { custom | Error | ", - "Stream", - " | Buffer | { message: string | Error; attributes?: ", - "ResponseErrorAttributes", - " | undefined; } | undefined>(options: ", - "CustomHttpResponseOptions", - "): ", - "IKibanaResponse", - "; }" - ], - "path": "node_modules/@types/kbn__core-http-router-server-internal/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52326,22 +60816,58 @@ "\nSet of helpers used to create `KibanaResponse` to form HTTP response on an incoming request.\nShould be returned as a result of {@link RequestHandler} execution.\n" ], "signature": [ - "KibanaSuccessResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaSuccessResponseFactory", + "text": "KibanaSuccessResponseFactory" + }, " & ", - "KibanaRedirectionResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRedirectionResponseFactory", + "text": "KibanaRedirectionResponseFactory" + }, " & ", - "KibanaErrorResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaErrorResponseFactory", + "text": "KibanaErrorResponseFactory" + }, " & { custom | Error | ", "Stream", " | Buffer | { message: string | Error; attributes?: ", - "ResponseErrorAttributes", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, " | undefined; } | undefined>(options: ", - "CustomHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, "): ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response_factory.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52358,7 +60884,7 @@ "signature": [ "\"accept\" | \"accept-language\" | \"accept-patch\" | \"accept-ranges\" | \"access-control-allow-credentials\" | \"access-control-allow-headers\" | \"access-control-allow-methods\" | \"access-control-allow-origin\" | \"access-control-expose-headers\" | \"access-control-max-age\" | \"access-control-request-headers\" | \"access-control-request-method\" | \"age\" | \"allow\" | \"alt-svc\" | \"authorization\" | \"cache-control\" | \"connection\" | \"content-disposition\" | \"content-encoding\" | \"content-language\" | \"content-length\" | \"content-location\" | \"content-range\" | \"content-type\" | \"cookie\" | \"date\" | \"etag\" | \"expect\" | \"expires\" | \"forwarded\" | \"from\" | \"host\" | \"if-match\" | \"if-modified-since\" | \"if-none-match\" | \"if-unmodified-since\" | \"last-modified\" | \"location\" | \"origin\" | \"pragma\" | \"proxy-authenticate\" | \"proxy-authorization\" | \"public-key-pins\" | \"range\" | \"referer\" | \"retry-after\" | \"sec-websocket-accept\" | \"sec-websocket-extensions\" | \"sec-websocket-key\" | \"sec-websocket-protocol\" | \"sec-websocket-version\" | \"set-cookie\" | \"strict-transport-security\" | \"tk\" | \"trailer\" | \"transfer-encoding\" | \"upgrade\" | \"user-agent\" | \"vary\" | \"via\" | \"warning\" | \"www-authenticate\"" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/headers.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52373,11 +60899,23 @@ "\nCreates an object containing redirection or error response with error details, HTTP headers, and other data transmitted to the client." ], "signature": [ - "KibanaRedirectionResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRedirectionResponseFactory", + "text": "KibanaRedirectionResponseFactory" + }, " & ", - "KibanaErrorResponseFactory" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaErrorResponseFactory", + "text": "KibanaErrorResponseFactory" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response_factory.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52460,7 +60998,7 @@ "EcsVulnerability", " | undefined; }" ], - "path": "node_modules/@types/kbn__logging/index.d.ts", + "path": "packages/kbn-logging/src/log_meta.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52477,15 +61015,15 @@ "signature": [ "{ [Key in keyof T]?: (T[Key] extends Maybe ? false : T[Key] extends Maybe ? boolean : T[Key] extends Maybe ? boolean | ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.MakeUsageFromSchema", "text": "MakeUsageFromSchema" }, " : boolean) | undefined; }" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52500,9 +61038,15 @@ "\n{@inheritdoc MetricsServiceSetup}\n" ], "signature": [ - "MetricsServiceSetup" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + } ], - "path": "node_modules/@types/kbn__core-metrics-server/index.d.ts", + "path": "packages/core/metrics/core-metrics-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52519,7 +61063,7 @@ "signature": [ "boolean | \"wait_for\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/base.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52535,22 +61079,64 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "LifecycleResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.LifecycleResponseFactory", + "text": "LifecycleResponseFactory" + }, ", toolkit: ", - "OnPostAuthToolkit", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPostAuthToolkit", + "text": "OnPostAuthToolkit" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | ", - "OnPostAuthNextResult", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPostAuthNextResult", + "text": "OnPostAuthNextResult" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | ", - "OnPostAuthNextResult", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPostAuthNextResult", + "text": "OnPostAuthNextResult" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_post_auth.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -52563,10 +61149,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_post_auth.ts", "deprecated": false, "trackAdoption": false }, @@ -52578,11 +61170,23 @@ "label": "response", "description": [], "signature": [ - "KibanaRedirectionResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRedirectionResponseFactory", + "text": "KibanaRedirectionResponseFactory" + }, " & ", - "KibanaErrorResponseFactory" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaErrorResponseFactory", + "text": "KibanaErrorResponseFactory" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_post_auth.ts", "deprecated": false, "trackAdoption": false }, @@ -52594,9 +61198,15 @@ "label": "toolkit", "description": [], "signature": [ - "OnPostAuthToolkit" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPostAuthToolkit", + "text": "OnPostAuthToolkit" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_post_auth.ts", "deprecated": false, "trackAdoption": false } @@ -52614,22 +61224,64 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "LifecycleResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.LifecycleResponseFactory", + "text": "LifecycleResponseFactory" + }, ", toolkit: ", - "OnPreAuthToolkit", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreAuthToolkit", + "text": "OnPreAuthToolkit" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | ", - "OnPreAuthNextResult", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreAuthNextResult", + "text": "OnPreAuthNextResult" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | ", - "OnPreAuthNextResult", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreAuthNextResult", + "text": "OnPreAuthNextResult" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_auth.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -52642,10 +61294,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_auth.ts", "deprecated": false, "trackAdoption": false }, @@ -52657,11 +61315,23 @@ "label": "response", "description": [], "signature": [ - "KibanaRedirectionResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRedirectionResponseFactory", + "text": "KibanaRedirectionResponseFactory" + }, " & ", - "KibanaErrorResponseFactory" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaErrorResponseFactory", + "text": "KibanaErrorResponseFactory" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_auth.ts", "deprecated": false, "trackAdoption": false }, @@ -52673,9 +61343,15 @@ "label": "toolkit", "description": [], "signature": [ - "OnPreAuthToolkit" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreAuthToolkit", + "text": "OnPreAuthToolkit" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_auth.ts", "deprecated": false, "trackAdoption": false } @@ -52693,18 +61369,48 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", preResponse: ", - "OnPreResponseInfo", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseInfo", + "text": "OnPreResponseInfo" + }, ", toolkit: ", - "OnPreResponseToolkit", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseToolkit", + "text": "OnPreResponseToolkit" + }, ") => ", - "OnPreResponseResult", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseResult", + "text": "OnPreResponseResult" + }, " | Promise<", - "OnPreResponseResult", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseResult", + "text": "OnPreResponseResult" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -52717,10 +61423,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false }, @@ -52732,9 +61444,15 @@ "label": "preResponse", "description": [], "signature": [ - "OnPreResponseInfo" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseInfo", + "text": "OnPreResponseInfo" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false }, @@ -52746,9 +61464,15 @@ "label": "toolkit", "description": [], "signature": [ - "OnPreResponseToolkit" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseToolkit", + "text": "OnPreResponseToolkit" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_response.ts", "deprecated": false, "trackAdoption": false } @@ -52766,22 +61490,64 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "LifecycleResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.LifecycleResponseFactory", + "text": "LifecycleResponseFactory" + }, ", toolkit: ", - "OnPreRoutingToolkit", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreRoutingToolkit", + "text": "OnPreRoutingToolkit" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | ", - "OnPreRoutingResult", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreRoutingResult", + "text": "OnPreRoutingResult" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | ", - "OnPreRoutingResult", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreRoutingResult", + "text": "OnPreRoutingResult" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_routing.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -52794,10 +61560,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_routing.ts", "deprecated": false, "trackAdoption": false }, @@ -52809,11 +61581,23 @@ "label": "response", "description": [], "signature": [ - "KibanaRedirectionResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRedirectionResponseFactory", + "text": "KibanaRedirectionResponseFactory" + }, " & ", - "KibanaErrorResponseFactory" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaErrorResponseFactory", + "text": "KibanaErrorResponseFactory" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_routing.ts", "deprecated": false, "trackAdoption": false }, @@ -52825,9 +61609,15 @@ "label": "toolkit", "description": [], "signature": [ - "OnPreRoutingToolkit" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreRoutingToolkit", + "text": "OnPreRoutingToolkit" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_routing.ts", "deprecated": false, "trackAdoption": false } @@ -52844,10 +61634,16 @@ "\nDedicated type for plugin configuration schema.\n" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52864,39 +61660,39 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, ") => ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, " | ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PrebootPlugin", "text": "PrebootPlugin" }, " | ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.AsyncPlugin", "text": "AsyncPlugin" }, "" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -52910,15 +61706,15 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, "" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -52937,7 +61733,7 @@ "signature": [ "string" ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52952,7 +61748,7 @@ "signature": [ "symbol" ], - "path": "node_modules/@types/kbn__core-base-common/index.d.ts", + "path": "packages/core/base/core-base-common/src/plugins.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -52967,7 +61763,13 @@ "\nPublic version of RequestHandlerContext, default-scoped to {@link RequestHandlerContext}\nSee [@link RequestHandlerContext}" ], "signature": [ - "HttpServiceSetup", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServiceSetup", + "text": "HttpServiceSetup" + }, "" ], "path": "src/core/server/index.ts", @@ -52986,11 +61788,29 @@ ], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ResponseFactory) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], "path": "src/core/server/index.ts", @@ -53008,7 +61828,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -53020,10 +61840,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -53037,7 +61863,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -53054,7 +61880,13 @@ "\nPublic version of IRouter, default-scoped to {@link RequestHandlerContext}\nSee [@link IRouter}" ], "signature": [ - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, "" ], "path": "src/core/server/index.ts", @@ -53073,12 +61905,24 @@ ], "signature": [ "{ name?: string | undefined; value?: unknown; description?: string | undefined; category?: string[] | undefined; options?: string[] | number[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; type?: ", - "UiSettingsType", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UiSettingsType", + "text": "UiSettingsType" + }, " | undefined; deprecation?: ", - "DeprecationSettings", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.DeprecationSettings", + "text": "DeprecationSettings" + }, " | undefined; order?: number | undefined; metric?: { type: string; name: string; } | undefined; }" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53093,10 +61937,16 @@ "\nHTTP response parameters for redirection response" ], "signature": [ - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, " & { headers: { location: string; }; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53112,14 +61962,32 @@ ], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ResponseFactory) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53136,7 +62004,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -53150,10 +62018,16 @@ "{@link KibanaRequest } - object containing information about requested resource,\nsuch as path, method, headers, parameters, query, body, etc." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -53169,7 +62043,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -53187,22 +62061,64 @@ ], "signature": [ "(handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, ") => ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53216,14 +62132,32 @@ "description": [], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ResponseFactory) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53238,7 +62172,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -53250,10 +62184,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -53267,7 +62207,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -53287,10 +62227,16 @@ ], "signature": [ "string | Error | { message: string | Error; attributes?: ", - "ResponseErrorAttributes", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, " | undefined; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53307,7 +62253,7 @@ "signature": [ "{ [x: string]: any; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/response.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53324,7 +62270,7 @@ "signature": [ "Record<\"accept\" | \"accept-language\" | \"accept-patch\" | \"accept-ranges\" | \"access-control-allow-credentials\" | \"access-control-allow-headers\" | \"access-control-allow-methods\" | \"access-control-allow-origin\" | \"access-control-expose-headers\" | \"access-control-max-age\" | \"access-control-request-headers\" | \"access-control-request-method\" | \"age\" | \"allow\" | \"alt-svc\" | \"authorization\" | \"cache-control\" | \"connection\" | \"content-disposition\" | \"content-encoding\" | \"content-language\" | \"content-length\" | \"content-location\" | \"content-range\" | \"content-type\" | \"cookie\" | \"date\" | \"etag\" | \"expect\" | \"expires\" | \"forwarded\" | \"from\" | \"host\" | \"if-match\" | \"if-modified-since\" | \"if-none-match\" | \"if-unmodified-since\" | \"last-modified\" | \"location\" | \"origin\" | \"pragma\" | \"proxy-authenticate\" | \"proxy-authorization\" | \"public-key-pins\" | \"range\" | \"referer\" | \"retry-after\" | \"sec-websocket-accept\" | \"sec-websocket-extensions\" | \"sec-websocket-key\" | \"sec-websocket-protocol\" | \"sec-websocket-version\" | \"set-cookie\" | \"strict-transport-security\" | \"tk\" | \"trailer\" | \"transfer-encoding\" | \"upgrade\" | \"user-agent\" | \"vary\" | \"via\" | \"warning\" | \"www-authenticate\", string | string[]> | Record" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/headers.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53341,7 +62287,7 @@ "signature": [ "\"application/json\" | \"multipart/form-data\" | \"application/*+json\" | \"application/octet-stream\" | \"application/x-www-form-urlencoded\" | \"text/*\"" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53356,11 +62302,23 @@ "\nThe set of common HTTP methods supported by Kibana routing." ], "signature": [ - "SafeRouteMethod", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SafeRouteMethod", + "text": "SafeRouteMethod" + }, " | ", - "DestructiveRouteMethod" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.DestructiveRouteMethod", + "text": "DestructiveRouteMethod" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53376,14 +62334,32 @@ ], "signature": [ "(route: ", - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, ", handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, ") => void" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53396,10 +62372,16 @@ "label": "route", "description": [], "signature": [ - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false }, @@ -53412,16 +62394,40 @@ "description": [], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/router.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53436,7 +62442,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -53448,10 +62454,16 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -53465,7 +62477,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -53485,12 +62497,24 @@ ], "signature": [ "(data: any, validationResult: ", - "RouteValidationResultFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidationResultFactory", + "text": "RouteValidationResultFactory" + }, ") => { value: T; error?: undefined; } | { value?: undefined; error: ", - "RouteValidationError", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidationError", + "text": "RouteValidationError" + }, "; }" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53505,7 +62529,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false }, @@ -53517,9 +62541,15 @@ "label": "validationResult", "description": [], "signature": [ - "RouteValidationResultFactory" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidationResultFactory", + "text": "RouteValidationResultFactory" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false } @@ -53536,14 +62566,32 @@ "\nAllowed property validation options: either @kbn/config-schema validations or custom validation functions\n\nSee {@link RouteValidationFunction} for custom validation.\n" ], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, " | ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, " | ", - "RouteValidationFunction", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidationFunction", + "text": "RouteValidationFunction" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53558,11 +62606,23 @@ "\nRoute validations config and options merged into one object" ], "signature": [ - "RouteValidatorConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidatorConfig", + "text": "RouteValidatorConfig" + }, " & ", - "RouteValidatorOptions" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteValidatorOptions", + "text": "RouteValidatorOptions" + } ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53579,7 +62639,7 @@ "signature": [ "\"options\" | \"get\"" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53594,12 +62654,24 @@ "\nType definition for a Saved Object attribute value\n" ], "signature": [ - "SavedObjectAttributeSingle", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributeSingle", + "text": "SavedObjectAttributeSingle" + }, " | ", - "SavedObjectAttributeSingle", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributeSingle", + "text": "SavedObjectAttributeSingle" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53615,10 +62687,16 @@ ], "signature": [ "string | number | boolean | ", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, " | null | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53634,14 +62712,32 @@ ], "signature": [ "(doc: ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, ", context: ", - "SavedObjectMigrationContext", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationContext", + "text": "SavedObjectMigrationContext" + }, ") => ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53654,12 +62750,17 @@ "label": "doc", "description": [], "signature": [ - "SavedObjectDoc", - " & { references?: ", - "SavedObjectReference", + "SavedObjectDoc & { references?: ", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false }, @@ -53671,9 +62772,15 @@ "label": "context", "description": [], "signature": [ - "SavedObjectMigrationContext" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationContext", + "text": "SavedObjectMigrationContext" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false } @@ -53690,12 +62797,17 @@ "\nDescribes Saved Object documents that have passed through the migration\nframework and are guaranteed to have a `references` root property.\n" ], "signature": [ - "SavedObjectDoc", - " & { references: ", - "SavedObjectReference", + "SavedObjectDoc & { references: ", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53711,11 +62823,23 @@ ], "signature": [ "({ request, includedHiddenTypes, }: { request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "; includedHiddenTypes?: string[] | undefined; }) => ", - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53729,10 +62853,16 @@ "description": [], "signature": [ "{ request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "; includedHiddenTypes?: string[] | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false } @@ -53750,11 +62880,23 @@ ], "signature": [ "(repositoryFactory: ", - "SavedObjectsRepositoryFactory", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRepositoryFactory", + "text": "SavedObjectsRepositoryFactory" + }, ") => ", - "SavedObjectsClientFactory" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientFactory", + "text": "SavedObjectsClientFactory" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53767,9 +62909,15 @@ "label": "repositoryFactory", "description": [], "signature": [ - "SavedObjectsRepositoryFactory" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRepositoryFactory", + "text": "SavedObjectsRepositoryFactory" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false } @@ -53787,11 +62935,23 @@ ], "signature": [ "(options: ", - "SavedObjectsClientWrapperOptions", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientWrapperOptions", + "text": "SavedObjectsClientWrapperOptions" + }, ") => ", - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53804,9 +62964,15 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsClientWrapperOptions" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsClientWrapperOptions", + "text": "SavedObjectsClientWrapperOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, "trackAdoption": false } @@ -53821,9 +62987,15 @@ "label": "SavedObjectsClosePointInTimeOptions", "description": [], "signature": [ - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/close_point_in_time.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53841,16 +63013,40 @@ "> | undefined; perPage?: number | undefined; sortField?: string | undefined; sortOrder?: ", "SortOrder", " | undefined; searchFields?: string[] | undefined; rootSearchFields?: string[] | undefined; hasReference?: ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined; hasReferenceOperator?: \"AND\" | \"OR\" | undefined; hasNoReference?: ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined; hasNoReferenceOperator?: \"AND\" | \"OR\" | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; namespaces?: string[] | undefined; typeToNamespacesMap?: Map | undefined; preference?: string | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-api-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create_point_in_time_finder.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53866,16 +63062,40 @@ ], "signature": [ "(context: ", - "SavedObjectsExportTransformContext", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportTransformContext", + "text": "SavedObjectsExportTransformContext" + }, ", objects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]) => ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[] | Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]>" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53888,9 +63108,15 @@ "label": "context", "description": [], "signature": [ - "SavedObjectsExportTransformContext" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsExportTransformContext", + "text": "SavedObjectsExportTransformContext" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false }, @@ -53902,10 +63128,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", "deprecated": false, "trackAdoption": false } @@ -53927,7 +63159,7 @@ "MappingProperty", "> | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53943,14 +63175,32 @@ ], "signature": [ "(objects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]) => ", - "SavedObjectsImportHookResult", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsImportHookResult", + "text": "SavedObjectsImportHookResult" + }, " | Promise<", - "SavedObjectsImportHookResult", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsImportHookResult", + "text": "SavedObjectsImportHookResult" + }, ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -53963,10 +63213,16 @@ "label": "objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", "deprecated": false, "trackAdoption": false } @@ -53983,11 +63239,23 @@ "\nComposite type of all the possible types of import warnings.\n\nSee {@link SavedObjectsImportSimpleWarning} and {@link SavedObjectsImportActionRequiredWarning}\nfor more details.\n" ], "signature": [ - "SavedObjectsImportSimpleWarning", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportSimpleWarning", + "text": "SavedObjectsImportSimpleWarning" + }, " | ", - "SavedObjectsImportActionRequiredWarning" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportActionRequiredWarning", + "text": "SavedObjectsImportActionRequiredWarning" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54004,7 +63272,7 @@ "signature": [ "\"single\" | \"multiple\" | \"multiple-isolated\" | \"agnostic\"" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54019,10 +63287,16 @@ "\nAllows for validating properties using @kbn/config-schema validations.\n" ], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/validation.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54040,14 +63314,26 @@ ], "signature": [ "(toolkit: { readonlyEsClient: Pick<", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", \"search\">; }) => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "<", "QueryDslQueryContainer", ">" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -54061,10 +63347,16 @@ "description": [], "signature": [ "{ readonlyEsClient: Pick<", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", \"search\">; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", "deprecated": false, "trackAdoption": false } @@ -54081,12 +63373,17 @@ "\nDescribes Saved Object documents from Kibana < 7.0.0 which don't have a\n`references` root property defined. This type should only be used in\nmigrations.\n" ], "signature": [ - "SavedObjectDoc", - " & { references?: ", - "SavedObjectReference", + "SavedObjectDoc & { references?: ", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54101,11 +63398,23 @@ "\n A user credentials container.\nIt accommodates the necessary auth credentials to impersonate the current user.\n" ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, " | ", - "FakeRequest" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.FakeRequest", + "text": "FakeRequest" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/scopeable_request.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54122,7 +63431,7 @@ "signature": [ "Readonly<{ toString: () => \"available\"; valueOf: () => 0; toJSON: () => \"available\"; }> | Readonly<{ toString: () => \"degraded\"; valueOf: () => 1; toJSON: () => \"degraded\"; }> | Readonly<{ toString: () => \"unavailable\"; valueOf: () => 2; toJSON: () => \"unavailable\"; }> | Readonly<{ toString: () => \"critical\"; valueOf: () => 3; toJSON: () => \"critical\"; }>" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54135,15 +63444,35 @@ "label": "SharedGlobalConfig", "description": [], "signature": [ - "{ readonly elasticsearch: Readonly<{ readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; readonly path: Readonly<{ readonly data: string; }>; readonly savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", - "ByteSizeValue", + "{ readonly elasticsearch: Readonly<{ readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; }>; readonly path: Readonly<{ readonly data: string; }>; readonly savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, ") => boolean; isLessThan: (other: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, ") => boolean; isEqualTo: (other: ", - "ByteSizeValue", - ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: ByteSizeValueUnit | undefined) => string; }>; }>; }" + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: ", + "ByteSizeValueUnit", + " | undefined) => string; }>; }>; }" ], - "path": "src/core/server/plugins/types.ts", + "path": "packages/core/plugins/core-plugins-server/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54160,15 +63489,15 @@ "signature": [ "() => Promise<[", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, ", TPluginsStart, TStart]>" ], - "path": "src/core/server/index.ts", + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -54187,7 +63516,7 @@ "signature": [ "\"failed\" | \"enqueued\" | \"sent_to_shipper\" | \"succeeded\" | \"dropped\"" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/events/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54204,7 +63533,7 @@ "signature": [ "\"string\" | \"number\" | \"boolean\" | \"undefined\" | \"color\" | \"image\" | \"json\" | \"markdown\" | \"select\" | \"array\"" ], - "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", + "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54220,16 +63549,40 @@ ], "signature": [ "(options: ", - "UnauthorizedErrorHandlerOptions", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerOptions", + "text": "UnauthorizedErrorHandlerOptions" + }, ", toolkit: ", - "UnauthorizedErrorHandlerToolkit", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerToolkit", + "text": "UnauthorizedErrorHandlerToolkit" + }, ") => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "<", - "UnauthorizedErrorHandlerResult", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerResult", + "text": "UnauthorizedErrorHandlerResult" + }, ">" ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -54242,9 +63595,15 @@ "label": "options", "description": [], "signature": [ - "UnauthorizedErrorHandlerOptions" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerOptions", + "text": "UnauthorizedErrorHandlerOptions" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -54256,9 +63615,15 @@ "label": "toolkit", "description": [], "signature": [ - "UnauthorizedErrorHandlerToolkit" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerToolkit", + "text": "UnauthorizedErrorHandlerToolkit" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false } @@ -54273,11 +63638,23 @@ "label": "UnauthorizedErrorHandlerResult", "description": [], "signature": [ - "UnauthorizedErrorHandlerRetryResult", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerRetryResult", + "text": "UnauthorizedErrorHandlerRetryResult" + }, " | ", - "UnauthorizedErrorHandlerNotHandledResult" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.UnauthorizedErrorHandlerNotHandledResult", + "text": "UnauthorizedErrorHandlerNotHandledResult" + } ], - "path": "node_modules/@types/kbn__core-elasticsearch-server/index.d.ts", + "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54293,12 +63670,133 @@ "description": [], "signature": [ "{ [x: string]: ", - "AppCategory", + { + "pluginId": "@kbn/core-application-common", + "scope": "common", + "docId": "kibKbnCoreApplicationCommonPluginApi", + "section": "def-common.AppCategory", + "text": "AppCategory" + }, "; }" ], - "path": "node_modules/@types/kbn__core-application-common/index.d.ts", + "path": "packages/core/application/core-application-common/src/default_app_categories.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.kibanaResponseFactory", + "type": "Object", + "tags": [], + "label": "kibanaResponseFactory", + "description": [], + "path": "packages/core/http/core-http-router-server-internal/src/response.ts", "deprecated": false, "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.kibanaResponseFactory.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/core/http/core-http-router-server-internal/src/response.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.kibanaResponseFactory.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/core/http/core-http-router-server-internal/src/response.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.kibanaResponseFactory.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/core/http/core-http-router-server-internal/src/response.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "core", + "id": "def-server.kibanaResponseFactory.custom", + "type": "Function", + "tags": [], + "label": "custom", + "description": [], + "signature": [ + " | Error | ", + "Stream", + " | Buffer | { message: string | Error; attributes?: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, + " | undefined; } | undefined>(options: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "" + ], + "path": "packages/core/http/core-http-router-server-internal/src/response.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.kibanaResponseFactory.custom.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, + "" + ], + "path": "packages/core/http/core-http-router-server-internal/src/response.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], "initialIsOpen": false }, { @@ -54313,7 +63811,7 @@ "signature": [ "{ readonly available: Readonly<{ toString: () => \"available\"; valueOf: () => 0; toJSON: () => \"available\"; }>; readonly degraded: Readonly<{ toString: () => \"degraded\"; valueOf: () => 1; toJSON: () => \"degraded\"; }>; readonly unavailable: Readonly<{ toString: () => \"unavailable\"; valueOf: () => 2; toJSON: () => \"unavailable\"; }>; readonly critical: Readonly<{ toString: () => \"critical\"; valueOf: () => 3; toJSON: () => \"critical\"; }>; }" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -54330,7 +63828,7 @@ "signature": [ "readonly [\"data\", \"stream\"]" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/route.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 02dac22253f60..cbad9ddfd3aa3 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core title: "core" image: https://source.unsplash.com/400x175/?github description: API docs for the core plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core'] --- import coreObj from './core.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2697 | 0 | 23 | 0 | +| 2704 | 17 | 1202 | 0 | ## Client diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index e459ca347f57e..f5319a5c42bb2 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: 2022-10-25 +date: 2022-11-07 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 a4309f565cf9f..4b2a5f4235d2a 100644 --- a/api_docs/dashboard.devdocs.json +++ b/api_docs/dashboard.devdocs.json @@ -330,7 +330,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/dashboard/public/types.ts", @@ -400,7 +406,13 @@ "label": "executionContext", "description": [], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/dashboard/public/types.ts", @@ -457,7 +469,13 @@ "description": [], "signature": [ "{ [key: string]: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; }" ], "path": "src/plugins/dashboard/common/types.ts", @@ -621,7 +639,13 @@ ], "signature": [ "{ dashboardId?: string | undefined; timeRange?: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined; refreshInterval?: ", { "pluginId": "data", @@ -631,9 +655,21 @@ "text": "RefreshInterval" }, " | undefined; filters?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined; useHash?: boolean | undefined; preserveSavedFilters?: boolean | undefined; viewMode?: ", { "pluginId": "embeddable", @@ -651,7 +687,13 @@ "text": "SavedDashboardPanel" }, " & ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ")[] | undefined; savedQuery?: string | undefined; tags?: string[] | undefined; options?: ", "DashboardOptions", " | undefined; controlGroupInput?: ", @@ -939,9 +981,21 @@ "description": [], "signature": [ "(savedObjectClient: Pick<", - "ISavedObjectsRepository", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + }, ", \"find\">, embeddableType: string) => Promise<{ [key: string]: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; }[]>" ], "path": "src/plugins/dashboard/server/usage/find_by_value_embeddables.ts", @@ -957,7 +1011,13 @@ "description": [], "signature": [ "Pick<", - "ISavedObjectsRepository", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + }, ", \"find\">" ], "path": "src/plugins/dashboard/server/usage/find_by_value_embeddables.ts", @@ -1320,7 +1380,13 @@ "text": "EmbeddableStateWithType" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/dashboard/common/persistable_state/dashboard_container_references.ts", @@ -1377,7 +1443,13 @@ "text": "EmbeddableStateWithType" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "embeddable", @@ -1477,7 +1549,13 @@ "({ attributes, references = [] }: SavedObjectAttributesAndReferences, deps: ", "InjectDeps", ") => ", - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts", "deprecated": false, @@ -1991,7 +2069,13 @@ "description": [], "signature": [ "{ [key: string]: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; }" ], "path": "src/plugins/dashboard/common/types.ts", diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 16f47378912af..7e76b06a669ff 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] --- import dashboardObj from './dashboard.devdocs.json'; diff --git a/api_docs/dashboard_enhanced.devdocs.json b/api_docs/dashboard_enhanced.devdocs.json index a523dacf19c26..7b4a7ac24f943 100644 --- a/api_docs/dashboard_enhanced.devdocs.json +++ b/api_docs/dashboard_enhanced.devdocs.json @@ -212,7 +212,7 @@ "label": "getDisplayName", "description": [], "signature": [ - "() => string" + "() => any" ], "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/abstract_dashboard_drilldown/abstract_dashboard_drilldown.tsx", "deprecated": false, @@ -552,7 +552,13 @@ "text": "DashboardStart" }, "; }, unknown, ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ">" ], "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/abstract_dashboard_drilldown/abstract_dashboard_drilldown.tsx", @@ -642,7 +648,13 @@ "; navigate(options: ", "RedirectOptions", "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">): void; setAnonymousAccessServiceProvider: (provider: () => ", { "pluginId": "share", @@ -758,7 +770,13 @@ "; navigate(options: ", "RedirectOptions", "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">): void; }" ], "path": "x-pack/plugins/dashboard_enhanced/public/plugin.ts", @@ -964,7 +982,13 @@ "text": "SerializedEvent" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "x-pack/plugins/dashboard_enhanced/common/drilldowns/dashboard_drilldown/dashboard_drilldown_persistable_state.ts", @@ -1016,7 +1040,13 @@ "text": "SerializedEvent" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "uiActionsEnhanced", diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index ed6cf316f367b..ab4449c20a21f 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: 2022-10-25 +date: 2022-11-07 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 5b1041ce4f855..d6a14b54f0608 100644 --- a/api_docs/data.devdocs.json +++ b/api_docs/data.devdocs.json @@ -626,7 +626,13 @@ "description": [], "signature": [ "() => { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }" ], "path": "src/plugins/data/common/search/aggs/agg_config.ts", @@ -648,7 +654,13 @@ "description": [], "signature": [ "() => { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }" ], "path": "src/plugins/data/common/search/aggs/agg_config.ts", @@ -670,7 +682,13 @@ ], "signature": [ "() => ", { "pluginId": "fieldFormats", @@ -1010,7 +1028,13 @@ "description": [], "signature": [ "() => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined" ], "path": "src/plugins/data/common/search/aggs/agg_config.ts", @@ -1209,7 +1233,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined" ], "path": "src/plugins/data/common/search/aggs/agg_configs.ts", @@ -1503,7 +1533,13 @@ "description": [], "signature": [ "(timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => void" ], "path": "src/plugins/data/common/search/aggs/agg_configs.ts", @@ -1518,7 +1554,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/search/aggs/agg_configs.ts", "deprecated": false, @@ -2125,7 +2167,13 @@ "description": [], "signature": [ "(forceNow?: Date | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, "[] | { meta: { index: string | undefined; params: {}; alias: string; disabled: boolean; negate: boolean; }; query: { bool: { should: { bool: { filter: { range: { [x: string]: { format: string; gte: string; lte: string; }; }; }[]; }; }[]; minimum_should_match: number; }; }; }[]" ], "path": "src/plugins/data/common/search/aggs/agg_configs.ts", @@ -2463,7 +2511,13 @@ "description": [], "signature": [ "(agg: TAggConfig, state?: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined) => TAggConfig" ], "path": "src/plugins/data/common/search/aggs/param_types/agg.ts", @@ -2494,7 +2548,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/param_types/agg.ts", @@ -2568,7 +2628,13 @@ "text": "DataPublicPlugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "<", { "pluginId": "data", @@ -2617,7 +2683,13 @@ "label": "initializerContext", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "; }>; asyncSearch: Readonly<{ pollInterval?: number | undefined; } & { waitForCompletion: moment.Duration; keepAlive: moment.Duration; batchedReduceSize: number; }>; sessions: Readonly<{} & { enabled: boolean; notTouchedTimeout: moment.Duration; maxUpdateRetries: number; defaultExpiration: moment.Duration; management: Readonly<{} & { refreshInterval: moment.Duration; maxSessions: number; refreshTimeout: moment.Duration; expiresSoonWarning: moment.Duration; }>; }>; }>; }>>" ], "path": "src/plugins/data/public/plugin.ts", @@ -2637,7 +2709,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", "DataStartDependencies", ", ", @@ -2671,7 +2749,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", "DataStartDependencies", ", ", @@ -2716,7 +2800,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", { uiActions, fieldFormats, dataViews, screenshotMode }: ", "DataStartDependencies", ") => ", @@ -2740,7 +2830,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/data/public/plugin.ts", "deprecated": false, @@ -3813,7 +3909,7 @@ "references": [ { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts" + "path": "x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_search_source_query.ts" }, { "plugin": "alerting", @@ -3845,11 +3941,11 @@ }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts" + "path": "x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts" + "path": "x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts" }, { "plugin": "securitySolution", @@ -4055,7 +4151,13 @@ ], "signature": [ "() => { searchSourceJSON: string; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/data/common/search/search_source/search_source.ts", @@ -4151,7 +4253,13 @@ "description": [], "signature": [ "(timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ", options: ", "CalculateBoundsOptions", ") => ", @@ -4175,7 +4283,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/query/timefilter/get_time.ts", "deprecated": false, @@ -4226,7 +4340,13 @@ "text": "SerializedSearchSourceFields" }, ", ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]]" ], "path": "src/plugins/data/common/search/search_source/extract_references.ts", @@ -4423,7 +4543,13 @@ "description": [], "signature": [ "(config: KibanaConfig) => ", - "EsQueryConfig" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.EsQueryConfig", + "text": "EsQueryConfig" + } ], "path": "src/plugins/data/common/es_query/get_es_query_config.ts", "deprecated": false, @@ -4570,11 +4696,29 @@ "text": "DataView" }, " | undefined, timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ", options: { forceNow?: Date | undefined; fieldName?: string | undefined; } | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, " | ", - "ScriptedRangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ScriptedRangeFilter", + "text": "ScriptedRangeFilter" + }, " | ", "MatchAllRangeFilter", " | undefined" @@ -4613,7 +4757,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/query/timefilter/get_time.ts", "deprecated": false, @@ -4682,7 +4832,13 @@ "text": "SerializedSearchSourceFields" }, " & { indexRefName: string; }, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "data", @@ -4726,7 +4882,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/data/common/search/search_source/inject_references.ts", @@ -4897,7 +5059,13 @@ "description": [], "signature": [ "(x: unknown) => x is ", - "Query" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + } ], "path": "src/plugins/data/common/query/is_query.ts", "deprecated": false, @@ -5002,6 +5170,41 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureOpenModalButton", + "type": "Function", + "tags": [], + "label": "ShardFailureOpenModalButton", + "description": [], + "signature": [ + "(props: ", + "ShardFailureOpenModalButtonProps", + ") => JSX.Element" + ], + "path": "src/plugins/data/public/shard_failure_modal/index.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.ShardFailureOpenModalButton.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "ShardFailureOpenModalButtonProps" + ], + "path": "src/plugins/data/public/shard_failure_modal/index.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "data", "id": "def-public.tabifyAggResponse", @@ -5147,7 +5350,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5194,7 +5403,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5241,7 +5456,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5288,7 +5509,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5335,7 +5562,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5382,7 +5615,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5429,7 +5668,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5476,7 +5721,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5523,7 +5774,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5570,7 +5827,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5617,7 +5880,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5664,7 +5933,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5711,7 +5986,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5758,7 +6039,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5805,7 +6092,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5852,7 +6145,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5899,7 +6198,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5946,7 +6251,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -5993,7 +6304,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6040,7 +6357,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6087,7 +6410,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6134,7 +6463,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6181,7 +6516,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6228,7 +6569,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6275,7 +6622,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6322,7 +6675,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6369,7 +6728,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6416,7 +6781,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6463,7 +6834,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6510,7 +6887,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6557,7 +6940,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6604,7 +6993,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6651,7 +7046,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6698,7 +7099,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6745,7 +7152,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6792,7 +7205,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6839,7 +7258,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6886,7 +7311,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -6933,7 +7364,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -7047,7 +7484,13 @@ "description": [], "signature": [ "({ data, negate, }: ValueClickDataContext) => Promise<", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]>" ], "path": "src/plugins/data/public/types.ts", @@ -7080,7 +7523,13 @@ "description": [], "signature": [ "(event: RangeSelectDataContext) => Promise<", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]>" ], "path": "src/plugins/data/public/types.ts", @@ -7737,7 +8186,13 @@ "\nRepresents a meta-information about a Kibana entity intitating a saerch request." ], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/data/common/search/types.ts", @@ -8016,10 +8471,16 @@ "label": "SavedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8032,7 +8493,7 @@ "description": [ "The ID of this Saved Object, guaranteed to be unique for all objects of the same `type`" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8045,7 +8506,7 @@ "description": [ " The type of Saved Object. Each plugin can define it's own custom Saved Object types." ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8061,7 +8522,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8077,7 +8538,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8093,7 +8554,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8105,10 +8566,16 @@ "label": "error", "description": [], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8124,7 +8591,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8138,10 +8605,16 @@ "{@inheritdoc SavedObjectReference}" ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8155,10 +8628,16 @@ "{@inheritdoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", - " | undefined" - ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, + " | undefined" + ], + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8174,7 +8653,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8190,7 +8669,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -8206,7 +8685,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -8250,9 +8729,21 @@ "\n{@link Query}" ], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined" ], "path": "src/plugins/data/common/search/search_source/types.ts", @@ -8269,13 +8760,37 @@ "\n{@link Filter}" ], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, " | ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | (() => ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, " | ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined) | undefined" ], "path": "src/plugins/data/common/search/search_source/types.ts", @@ -8575,6 +9090,104 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest", + "type": "Interface", + "tags": [], + "label": "ShardFailureRequest", + "description": [], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest.docvalue_fields", + "type": "Array", + "tags": [], + "label": "docvalue_fields", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest._source", + "type": "Unknown", + "tags": [], + "label": "_source", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest.query", + "type": "Unknown", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest.script_fields", + "type": "Unknown", + "tags": [], + "label": "script_fields", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest.sort", + "type": "Unknown", + "tags": [], + "label": "sort", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest.stored_fields", + "type": "Array", + "tags": [], + "label": "stored_fields", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false } ], "enums": [ @@ -8597,10 +9210,7 @@ "tags": [], "label": "ES_FIELD_TYPES", "description": [], - "signature": [ - "ES_FIELD_TYPES" - ], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8612,10 +9222,7 @@ "tags": [], "label": "KBN_FIELD_TYPES", "description": [], - "signature": [ - "KBN_FIELD_TYPES" - ], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8663,7 +9270,13 @@ "text": "IAggType" }, "; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; id?: string | undefined; enabled?: boolean | undefined; }" ], "path": "src/plugins/data/common/search/aggs/agg_config.ts", @@ -8680,7 +9293,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }" ], "path": "src/plugins/data/common/search/aggs/agg_config.ts", @@ -8935,7 +9554,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts", @@ -8991,11 +9616,29 @@ "description": [], "signature": [ "{ filters?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "[] | undefined; timeRange?: ", { "pluginId": "data", @@ -9175,7 +9818,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/kql.ts", @@ -9223,7 +9872,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/lucene.ts", @@ -9432,7 +10087,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data_views/common/expressions/load_index_pattern.ts", @@ -9758,7 +10419,13 @@ "text": "SerializedSearchSourceFields" }, "; serialize: () => { searchSourceJSON: string; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }; toExpressionAst: ({ asDatatable }?: ExpressionAstOptions) => ", { "pluginId": "expressions", @@ -9835,7 +10502,13 @@ "description": [], "signature": [ "{ value: number; unit: ", - "Unit", + { + "pluginId": "@kbn/datemath", + "scope": "server", + "docId": "kibKbnDatemathPluginApi", + "section": "def-server.Unit", + "text": "Unit" + }, "; type: \"fixed\" | \"calendar\"; }" ], "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts", @@ -9870,11 +10543,29 @@ "text": "RefreshInterval" }, " | undefined; filters?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined; }" ], "path": "src/plugins/data/common/query/query_state.ts", @@ -9906,11 +10597,29 @@ "description": [], "signature": [ "{ type?: string | undefined; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined; filter?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; sort?: ", { "pluginId": "data", @@ -9920,9 +10629,21 @@ "text": "EsQuerySortValue" }, "[] | undefined; highlight?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; highlightAll?: boolean | undefined; trackTotalHits?: number | boolean | undefined; aggs?: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }[] | undefined; from?: number | undefined; size?: number | undefined; source?: boolean | ", "Fields", " | undefined; version?: boolean | undefined; fields?: ", @@ -10007,10 +10728,13 @@ { "parentPluginId": "data", "id": "def-public.AggGroupLabels.AggGroupNames.Buckets", - "type": "string", + "type": "Any", "tags": [], "label": "[AggGroupNames.Buckets]", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/aggs/agg_groups.ts", "deprecated": false, "trackAdoption": false @@ -10018,10 +10742,13 @@ { "parentPluginId": "data", "id": "def-public.AggGroupLabels.AggGroupNames.Metrics", - "type": "string", + "type": "Any", "tags": [], "label": "[AggGroupNames.Metrics]", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/aggs/agg_groups.ts", "deprecated": false, "trackAdoption": false @@ -10029,10 +10756,13 @@ { "parentPluginId": "data", "id": "def-public.AggGroupLabels.AggGroupNames.None", - "type": "string", + "type": "Any", "tags": [], "label": "[AggGroupNames.None]", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/aggs/agg_groups.ts", "deprecated": false, "trackAdoption": false @@ -10372,7 +11102,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -10405,7 +11141,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -10423,7 +11165,13 @@ "description": [], "signature": [ "(field: HasSubtype) => ", - "IFieldSubTypeMulti", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeMulti", + "text": "IFieldSubTypeMulti" + }, " | undefined" ], "path": "src/plugins/data/public/index.ts", @@ -10440,7 +11188,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -10458,7 +11212,13 @@ "description": [], "signature": [ "(field: HasSubtype) => ", - "IFieldSubTypeNested", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeNested", + "text": "IFieldSubTypeNested" + }, " | undefined" ], "path": "src/plugins/data/public/index.ts", @@ -10475,7 +11235,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -10608,7 +11374,7 @@ "label": "intervalOptions", "description": [], "signature": [ - "({ display: string; val: string; enabled(agg: ", + "({ display: any; val: string; enabled(agg: ", { "pluginId": "data", "scope": "common", @@ -10616,7 +11382,7 @@ "section": "def-common.IBucketAggConfig", "text": "IBucketAggConfig" }, - "): boolean; } | { display: string; val: string; })[]" + "): boolean; } | { display: any; val: string; })[]" ], "path": "src/plugins/data/public/index.ts", "deprecated": false, @@ -10925,10 +11691,13 @@ { "parentPluginId": "data", "id": "def-public.search.aggs.parentPipelineType", - "type": "string", + "type": "Any", "tags": [], "label": "parentPipelineType", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/public/index.ts", "deprecated": false, "trackAdoption": false @@ -10942,7 +11711,13 @@ "description": [], "signature": [ "(interval: string) => { value: number; unit: ", - "Unit", + { + "pluginId": "@kbn/datemath", + "scope": "server", + "docId": "kibKbnDatemathPluginApi", + "section": "def-server.Unit", + "text": "Unit" + }, "; type: \"fixed\" | \"calendar\"; }" ], "path": "src/plugins/data/public/index.ts", @@ -11025,10 +11800,13 @@ { "parentPluginId": "data", "id": "def-public.search.aggs.siblingPipelineType", - "type": "string", + "type": "Any", "tags": [], "label": "siblingPipelineType", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/public/index.ts", "deprecated": false, "trackAdoption": false @@ -11056,7 +11834,13 @@ "description": [], "signature": [ "(range: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => { from: Date; to: Date; } | undefined" ], "path": "src/plugins/data/public/index.ts", @@ -11088,7 +11872,7 @@ "label": "boundsDescendingRaw", "description": [], "signature": [ - "({ bound: number; interval: moment.Duration; boundLabel: string; intervalLabel: string; } | { bound: moment.Duration; interval: moment.Duration; boundLabel: string; intervalLabel: string; })[]" + "({ bound: number; interval: moment.Duration; boundLabel: any; intervalLabel: any; } | { bound: moment.Duration; interval: moment.Duration; boundLabel: any; intervalLabel: any; })[]" ], "path": "src/plugins/data/public/index.ts", "deprecated": false, @@ -11545,23 +12329,23 @@ }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "inputControlVis", @@ -11657,7 +12441,7 @@ }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.tsx" }, { "plugin": "expressionPartitionVis", @@ -11753,9 +12537,9 @@ }, " implements ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, @@ -11808,9 +12592,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, @@ -11834,9 +12618,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -11879,9 +12663,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -11930,9 +12714,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, @@ -11989,9 +12773,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } @@ -12056,7 +12840,13 @@ "text": "DataView" }, " implements ", - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -12093,6 +12883,10 @@ "deprecated": true, "trackAdoption": false, "references": [ + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/types.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" @@ -12169,6 +12963,94 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.test.ts" }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/build_es_query.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_filters.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_filters.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_kuery.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/handle_combined_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/handle_nested_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/build_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/exists_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/get_filter_field.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrases_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/ast/ast.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/and.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/exists.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/is.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/nested.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/not.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/or.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/range.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/node_types/function.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/utils/get_full_field_name_node.test.ts" + }, { "plugin": "dataViews", "path": "src/plugins/data_views/common/data_views/data_view.ts" @@ -12202,44 +13084,88 @@ "path": "src/plugins/unified_search/public/dataview_picker/change_dataview.tsx" }, { - "plugin": "dataViews", - "path": "src/plugins/data_views/server/rest_api_routes/update_data_view.ts" + "plugin": "dataViews", + "path": "src/plugins/data_views/server/rest_api_routes/update_data_view.ts" + }, + { + "plugin": "dataViews", + "path": "src/plugins/data_views/server/rest_api_routes/update_data_view.ts" + }, + { + "plugin": "triggersActionsUi", + "path": "x-pack/plugins/triggers_actions_ui/public/common/lib/data_apis.ts" + }, + { + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx" + }, + { + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx" + }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts" + }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/common/utils/field_existing_utils.ts" + }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/common/utils/field_existing_utils.ts" + }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/common/utils/field_existing_utils.ts" + }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts" + }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts" + }, + { + "plugin": "aiops", + "path": "x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx" }, { - "plugin": "dataViews", - "path": "src/plugins/data_views/server/rest_api_routes/update_data_view.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" }, { - "plugin": "triggersActionsUi", - "path": "x-pack/plugins/triggers_actions_ui/public/common/lib/data_apis.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" }, { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" }, { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" }, { - "plugin": "unifiedFieldList", - "path": "src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_views/resolved_log_view.ts" }, { - "plugin": "unifiedFieldList", - "path": "src/plugins/unified_field_list/common/utils/field_existing_utils.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" }, { - "plugin": "unifiedFieldList", - "path": "src/plugins/unified_field_list/common/utils/field_existing_utils.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" }, { - "plugin": "unifiedFieldList", - "path": "src/plugins/unified_field_list/common/utils/field_existing_utils.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" }, { - "plugin": "aiops", - "path": "x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx" + "plugin": "apm", + "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" }, { "plugin": "presentationUtil", @@ -12277,10 +13203,6 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/common/log_views/resolved_log_view.ts" - }, { "plugin": "dataVisualizer", "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts" @@ -12367,39 +13289,39 @@ }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", @@ -12478,40 +13400,24 @@ "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.tsx" }, { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/services/kibana/data_views.ts" }, { "plugin": "canvas", @@ -12519,7 +13425,7 @@ }, { "plugin": "canvas", - "path": "x-pack/plugins/canvas/public/services/kibana/data_views.ts" + "path": "x-pack/plugins/canvas/public/components/datasource/datasource_component.js" }, { "plugin": "reporting", @@ -12555,39 +13461,39 @@ }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx" }, { "plugin": "synthetics", @@ -12869,18 +13775,6 @@ "plugin": "dataViews", "path": "src/plugins/data_views/common/data_views/data_views.ts" }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/sourcerer/routes/index.ts" @@ -12888,6 +13782,10 @@ { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/sourcerer/routes/index.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts" } ] }, @@ -12910,7 +13808,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -14500,7 +15404,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => void" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -14542,7 +15452,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -14907,7 +15823,13 @@ ], "signature": [ "() => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -15391,7 +16313,13 @@ ], "signature": [ "(savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -15421,7 +16349,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -15508,10 +16442,10 @@ "tags": [], "label": "create", "description": [ - "\nCreate a new data view instance." + "\nCreate data view instance." ], "signature": [ - "({ id, name, title, ...restOfSpec }: ", + "(spec: ", { "pluginId": "dataViews", "scope": "common", @@ -15538,8 +16472,10 @@ "id": "def-server.DataViewsService.create.$1", "type": "Object", "tags": [], - "label": "{ id, name, title, ...restOfSpec }", - "description": [], + "label": "spec", + "description": [ + "data view spec" + ], "signature": [ { "pluginId": "dataViews", @@ -15997,7 +16933,13 @@ "label": "elasticsearchClient", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "src/plugins/data_views/server/fetcher/index_patterns_fetcher.ts", "deprecated": false, @@ -16251,7 +17193,13 @@ "description": [], "signature": [ "(config: KibanaConfig) => ", - "EsQueryConfig" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.EsQueryConfig", + "text": "EsQueryConfig" + } ], "path": "src/plugins/data/common/es_query/get_es_query_config.ts", "deprecated": false, @@ -16333,11 +17281,29 @@ "text": "DataView" }, " | undefined, timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ", options: { forceNow?: Date | undefined; fieldName?: string | undefined; } | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, " | ", - "ScriptedRangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ScriptedRangeFilter", + "text": "ScriptedRangeFilter" + }, " | ", "MatchAllRangeFilter", " | undefined" @@ -16376,7 +17342,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/query/timefilter/get_time.ts", "deprecated": false, @@ -16487,11 +17459,29 @@ ], "signature": [ "(savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", elasticsearchClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", request?: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, " | undefined, byPassCapabilities?: boolean | undefined) => Promise<", { "pluginId": "dataViews", @@ -16515,7 +17505,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "src/plugins/data_views/server/types.ts", "deprecated": false, @@ -17729,7 +18725,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, " | undefined" ], "path": "src/plugins/data_views/server/types.ts", @@ -18109,7 +19111,13 @@ "\nRepresents a meta-information about a Kibana entity intitating a saerch request." ], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/data/common/search/types.ts", @@ -18169,10 +19177,7 @@ "tags": [], "label": "ES_FIELD_TYPES", "description": [], - "signature": [ - "ES_FIELD_TYPES" - ], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -18184,10 +19189,7 @@ "tags": [], "label": "KBN_FIELD_TYPES", "description": [], - "signature": [ - "KBN_FIELD_TYPES" - ], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -18271,7 +19273,13 @@ "description": [], "signature": [ "{ value: number; unit: ", - "Unit", + { + "pluginId": "@kbn/datemath", + "scope": "server", + "docId": "kibKbnDatemathPluginApi", + "section": "def-server.Unit", + "text": "Unit" + }, "; type: \"fixed\" | \"calendar\"; }" ], "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts", @@ -19352,7 +20360,13 @@ "text": "DatatableColumn" }, ") => ", - "Serializable" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + } ], "path": "src/plugins/data/common/datatable_utilities/datatable_utilities_service.ts", "deprecated": false, @@ -19524,7 +20538,13 @@ "text": "DataView" }, " implements ", - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -19561,6 +20581,10 @@ "deprecated": true, "trackAdoption": false, "references": [ + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/types.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" @@ -19582,60 +20606,148 @@ "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_query_filter.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_query_filter.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/mock/index_pattern.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + }, + { + "plugin": "threatIntelligence", + "path": "x-pack/plugins/threat_intelligence/public/common/mocks/mock_security_context.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/build_es_query.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_filters.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_filters.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_kuery.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/handle_combined_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/handle_nested_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/build_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/exists_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/get_filter_field.test.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/mock/index_pattern.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrases_filter.test.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/ast/ast.test.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/and.test.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/exists.test.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/is.test.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/nested.test.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/not.test.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/or.test.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/range.test.ts" }, { - "plugin": "threatIntelligence", - "path": "x-pack/plugins/threat_intelligence/public/common/mocks/mock_security_context.tsx" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/node_types/function.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.test.ts" + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/utils/get_full_field_name_node.test.ts" }, { "plugin": "dataViews", @@ -19705,10 +20817,54 @@ "plugin": "unifiedFieldList", "path": "src/plugins/unified_field_list/common/utils/field_existing_utils.ts" }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts" + }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts" + }, { "plugin": "aiops", "path": "x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx" }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_views/resolved_log_view.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + }, { "plugin": "presentationUtil", "path": "src/plugins/presentation_util/public/services/storybook/data_views.ts" @@ -19745,10 +20901,6 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/common/log_views/resolved_log_view.ts" - }, { "plugin": "dataVisualizer", "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts" @@ -19835,39 +20987,39 @@ }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", @@ -19946,40 +21098,24 @@ "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.tsx" }, { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/services/kibana/data_views.ts" }, { "plugin": "canvas", @@ -19987,7 +21123,7 @@ }, { "plugin": "canvas", - "path": "x-pack/plugins/canvas/public/services/kibana/data_views.ts" + "path": "x-pack/plugins/canvas/public/components/datasource/datasource_component.js" }, { "plugin": "reporting", @@ -20023,39 +21159,39 @@ }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx" }, { "plugin": "synthetics", @@ -20337,18 +21473,6 @@ "plugin": "dataViews", "path": "src/plugins/data_views/common/data_views/data_views.ts" }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/sourcerer/routes/index.ts" @@ -20356,6 +21480,10 @@ { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/sourcerer/routes/index.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts" } ] }, @@ -20378,7 +21506,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -21968,7 +23102,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => void" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -22010,7 +23150,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -22078,7 +23224,13 @@ "text": "DataViewField" }, " implements ", - "DataViewFieldBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + } ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", "deprecated": false, @@ -22092,7 +23244,13 @@ "label": "spec", "description": [], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " & { count?: number | undefined; conflictDescriptions?: Record | undefined; format?: ", { "pluginId": "fieldFormats", @@ -22102,7 +23260,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; esTypes?: string[] | undefined; searchable: boolean; aggregatable: boolean; readFromDocValues?: boolean | undefined; indexed?: boolean | undefined; customLabel?: string | undefined; runtimeField?: ", { "pluginId": "dataViews", @@ -22555,7 +23719,13 @@ "\nReturns field subtype, multi, nested, or undefined if neither" ], "signature": [ - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -22677,7 +23847,13 @@ ], "signature": [ "() => ", - "IFieldSubTypeNested", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeNested", + "text": "IFieldSubTypeNested" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -22697,7 +23873,13 @@ ], "signature": [ "() => ", - "IFieldSubTypeMulti", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeMulti", + "text": "IFieldSubTypeMulti" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -22735,7 +23917,13 @@ ], "signature": [ "() => { count: number; script: string | undefined; lang: string | undefined; conflictDescriptions: Record | undefined; name: string; type: string; esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues: boolean; subType: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; customLabel: string | undefined; }" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -23201,7 +24389,13 @@ ], "signature": [ "() => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -23685,7 +24879,13 @@ ], "signature": [ "(savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -23715,7 +24915,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -23802,10 +25008,10 @@ "tags": [], "label": "create", "description": [ - "\nCreate a new data view instance." + "\nCreate data view instance." ], "signature": [ - "({ id, name, title, ...restOfSpec }: ", + "(spec: ", { "pluginId": "dataViews", "scope": "common", @@ -23832,8 +25038,10 @@ "id": "def-common.DataViewsService.create.$1", "type": "Object", "tags": [], - "label": "{ id, name, title, ...restOfSpec }", - "description": [], + "label": "spec", + "description": [ + "data view spec" + ], "signature": [ { "pluginId": "dataViews", @@ -24327,10 +25535,7 @@ "tags": [], "label": "KbnFieldType", "description": [], - "signature": [ - "KbnFieldType" - ], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/kbn_field_type.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24341,7 +25546,7 @@ "tags": [], "label": "name", "description": [], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/kbn_field_type.ts", "deprecated": false, "trackAdoption": false }, @@ -24352,7 +25557,7 @@ "tags": [], "label": "sortable", "description": [], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/kbn_field_type.ts", "deprecated": false, "trackAdoption": false }, @@ -24363,7 +25568,7 @@ "tags": [], "label": "filterable", "description": [], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/kbn_field_type.ts", "deprecated": false, "trackAdoption": false }, @@ -24376,10 +25581,16 @@ "description": [], "signature": [ "readonly ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[]" ], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/kbn_field_type.ts", "deprecated": false, "trackAdoption": false }, @@ -24393,7 +25604,7 @@ "signature": [ "any" ], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/kbn_field_type.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -24406,13 +25617,19 @@ "description": [], "signature": [ "Partial<", - "KbnFieldTypeOptions", - "> | undefined" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KbnFieldTypeOptions", + "text": "KbnFieldTypeOptions" + }, + ">" ], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/kbn_field_type.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -24646,7 +25863,13 @@ "description": [], "signature": [ "(config: KibanaConfig) => ", - "EsQueryConfig" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.EsQueryConfig", + "text": "EsQueryConfig" + } ], "path": "src/plugins/data/common/es_query/get_es_query_config.ts", "deprecated": false, @@ -24680,7 +25903,13 @@ "description": [], "signature": [ "(field: HasSubtype) => ", - "IFieldSubTypeMulti", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeMulti", + "text": "IFieldSubTypeMulti" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -24697,7 +25926,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -24716,7 +25951,13 @@ "description": [], "signature": [ "(field: HasSubtype) => ", - "IFieldSubTypeNested", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeNested", + "text": "IFieldSubTypeNested" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -24733,7 +25974,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -24839,7 +26086,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -24873,7 +26126,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -25520,7 +26779,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">> | undefined; runtimeFieldMap?: Record" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -25635,7 +26909,7 @@ "description": [ "The ID of this Saved Object, guaranteed to be unique for all objects of the same `type`" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25648,7 +26922,7 @@ "description": [ " The type of Saved Object. Each plugin can define it's own custom Saved Object types." ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25664,7 +26938,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25680,7 +26954,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25696,7 +26970,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25708,10 +26982,16 @@ "label": "error", "description": [], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25727,7 +27007,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25741,10 +27021,16 @@ "{@inheritdoc SavedObjectReference}" ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25758,10 +27044,16 @@ "{@inheritdoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25777,7 +27069,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25793,7 +27085,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -25809,7 +27101,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -25998,10 +27290,7 @@ "tags": [], "label": "ES_FIELD_TYPES", "description": [], - "signature": [ - "ES_FIELD_TYPES" - ], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -26013,10 +27302,7 @@ "tags": [], "label": "KBN_FIELD_TYPES", "description": [], - "signature": [ - "KBN_FIELD_TYPES" - ], - "path": "node_modules/@types/kbn__field-types/index.d.ts", + "path": "packages/kbn-field-types/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -26126,7 +27412,7 @@ "section": "def-common.DataView", "text": "DataView" }, - ">; delete: (indexPatternId: string) => Promise<{}>; create: ({ id, name, title, ...restOfSpec }: ", + ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", { "pluginId": "dataViews", "scope": "common", @@ -26159,7 +27445,13 @@ "text": "DataViewListItem" }, "[]>; clearCache: () => void; clearInstanceCache: (id?: string | undefined) => void; getCache: () => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -26257,7 +27549,13 @@ "text": "DataViewFieldMap" }, "; savedObjectToSpec: (savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -26380,7 +27678,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">> | undefined; runtimeFieldMap?: Record | undefined; format?: ", { "pluginId": "fieldFormats", @@ -26481,7 +27791,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; esTypes?: string[] | undefined; searchable: boolean; aggregatable: boolean; readFromDocValues?: boolean | undefined; indexed?: boolean | undefined; customLabel?: string | undefined; runtimeField?: ", { "pluginId": "dataViews", @@ -26589,7 +27905,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data_views/common/expressions/load_index_pattern.ts", @@ -26639,7 +27961,7 @@ "signature": [ "{ query: string | { [key: string]: any; }; language: string; }" ], - "path": "node_modules/@types/kbn__es-query/index.d.ts", + "path": "packages/kbn-es-query/src/filters/build_filters/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 58ce710450668..4c09dfd7a9c00 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3251 | 33 | 2523 | 24 | +| 3261 | 119 | 2553 | 27 | ## Client diff --git a/api_docs/data_query.devdocs.json b/api_docs/data_query.devdocs.json index 051270f939554..744933b9b734f 100644 --- a/api_docs/data_query.devdocs.json +++ b/api_docs/data_query.devdocs.json @@ -26,7 +26,13 @@ "text": "PersistableStateService" }, "<", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]>" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -55,7 +61,13 @@ "label": "uiSettings", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", "deprecated": false, @@ -74,7 +86,13 @@ "description": [], "signature": [ "() => ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -92,7 +110,13 @@ "description": [], "signature": [ "() => ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -110,7 +134,13 @@ "description": [], "signature": [ "() => ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -180,9 +210,21 @@ "description": [], "signature": [ "(filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, " | ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[], pinFilterStatus?: boolean) => void" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -197,9 +239,21 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, " | ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -234,7 +288,13 @@ "description": [], "signature": [ "(newFilters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[], pinFilterStatus?: boolean) => void" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -249,7 +309,13 @@ "label": "newFilters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -286,7 +352,13 @@ ], "signature": [ "(newGlobalFilters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]) => void" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -301,7 +373,13 @@ "label": "newGlobalFilters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -323,7 +401,13 @@ ], "signature": [ "(newAppFilters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]) => void" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -338,7 +422,13 @@ "label": "newAppFilters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -358,7 +448,13 @@ "description": [], "signature": [ "(filter: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, ") => void" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -373,7 +469,13 @@ "label": "filter", "description": [], "signature": [ - "Filter" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + } ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", "deprecated": false, @@ -408,9 +510,21 @@ "description": [], "signature": [ "(filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[], store: ", - "FilterStateStore", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterStateStore", + "text": "FilterStateStore" + }, ", shouldOverrideStore?: boolean) => void" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -425,7 +539,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -441,7 +561,13 @@ "label": "store", "description": [], "signature": [ - "FilterStateStore" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterStateStore", + "text": "FilterStateStore" + } ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", "deprecated": false, @@ -475,11 +601,29 @@ "description": [], "signature": [ "(filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]) => { state: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -495,7 +639,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/common/query/filters/persistable_state.ts", @@ -513,11 +663,29 @@ "description": [], "signature": [ "(filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[], references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -533,7 +701,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/common/query/filters/persistable_state.ts", @@ -548,7 +722,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/data/common/query/filters/persistable_state.ts", @@ -566,7 +746,13 @@ "description": [], "signature": [ "(filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[], collector: unknown) => {}" ], "path": "src/plugins/data/public/query/filter_manager/filter_manager.ts", @@ -582,7 +768,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/common/query/filters/persistable_state.ts", @@ -968,7 +1160,13 @@ "description": [], "signature": [ "(time: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => void" ], "path": "src/plugins/data/public/query/timefilter/time_history.ts", @@ -983,7 +1181,13 @@ "label": "time", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/public/query/timefilter/time_history.ts", "deprecated": false, @@ -1002,7 +1206,13 @@ "description": [], "signature": [ "() => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "[]" ], "path": "src/plugins/data/public/query/timefilter/time_history.ts", @@ -1022,7 +1232,13 @@ "() => ", "Observable", "<", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "[]>" ], "path": "src/plugins/data/public/query/timefilter/time_history.ts", @@ -1079,7 +1295,13 @@ "text": "BaseStateContainer" }, ", syncConfig: { time?: boolean | undefined; refreshInterval?: boolean | undefined; filters?: boolean | ", - "FilterStateStore", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterStateStore", + "text": "FilterStateStore" + }, " | undefined; query?: boolean | undefined; }) => () => void" ], "path": "src/plugins/data/public/query/state_sync/connect_to_query_state.ts", @@ -1189,7 +1411,13 @@ "description": [], "signature": [ "boolean | ", - "FilterStateStore", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterStateStore", + "text": "FilterStateStore" + }, " | undefined" ], "path": "src/plugins/data/public/query/state_sync/connect_to_query_state.ts", @@ -1225,7 +1453,13 @@ "description": [], "signature": [ "(http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, ") => { createQuery: (attributes: ", { "pluginId": "data", @@ -1296,7 +1530,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "src/plugins/data/public/query/saved_query/saved_query_service.ts", "deprecated": false, @@ -1326,11 +1566,29 @@ "text": "FilterManager" }, ", field: string | ", - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, ", values: any, operation: string, index: ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, ") => ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/lib/generate_filters.ts", @@ -1371,7 +1629,13 @@ ], "signature": [ "string | ", - "DataViewFieldBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + } ], "path": "src/plugins/data/public/query/filter_manager/lib/generate_filters.ts", "deprecated": false, @@ -1422,7 +1686,13 @@ "- Index string to generate filters for" ], "signature": [ - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "src/plugins/data/public/query/filter_manager/lib/generate_filters.ts", "deprecated": false, @@ -1477,7 +1747,13 @@ "description": [], "signature": [ "(filter: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, ", indexPatterns: ", { "pluginId": "dataViews", @@ -1500,7 +1776,13 @@ "label": "filter", "description": [], "signature": [ - "Filter" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + } ], "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts", "deprecated": false, @@ -1542,7 +1824,13 @@ "description": [], "signature": [ "(filter: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, ", indexPatterns: ", { "pluginId": "dataViews", @@ -1565,7 +1853,13 @@ "label": "filter", "description": [], "signature": [ - "Filter" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + } ], "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts", "deprecated": false, @@ -1607,7 +1901,13 @@ "description": [], "signature": [ "(filter: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, ", indexPatterns: ", { "pluginId": "dataViews", @@ -1638,7 +1938,13 @@ "label": "filter", "description": [], "signature": [ - "Filter" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + } ], "path": "src/plugins/data/public/query/filter_manager/lib/get_index_pattern_from_filter.ts", "deprecated": false, @@ -1680,9 +1986,21 @@ "description": [], "signature": [ "(filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]) => ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/lib/map_and_flatten_filters.ts", @@ -1697,7 +2015,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/public/query/filter_manager/lib/map_and_flatten_filters.ts", @@ -2008,7 +2332,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined" ], "path": "src/plugins/data/public/query/state_sync/types.ts", @@ -2104,27 +2434,87 @@ "description": [], "signature": [ "{ getDefaultQuery: () => { query: string; language: any; }; formatQuery: (query: string | ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined) => ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, "; getUpdates$: () => ", "Observable", "<", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, ">; getQuery: () => ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, "; setQuery: (query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, ") => void; clearQuery: () => void; }" ], "path": "src/plugins/data/public/query/query_service.ts", @@ -2274,27 +2664,87 @@ "description": [], "signature": [ "{ getDefaultQuery: () => { query: string; language: any; }; formatQuery: (query: string | ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined) => ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, "; getUpdates$: () => ", "Observable", "<", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, ">; getQuery: () => ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, "; setQuery: (query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, ") => void; clearQuery: () => void; }" ], "path": "src/plugins/data/public/query/query_service.ts", @@ -2364,7 +2814,13 @@ "description": [], "signature": [ "(appName: string, { language, query }: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, ") => void" ], "path": "src/plugins/data/public/query/query_service.ts", @@ -2486,9 +2942,21 @@ "text": "DataView" }, ", timeRange?: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined) => { bool: ", - "BoolQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.BoolQuery", + "text": "BoolQuery" + }, "; }" ], "path": "src/plugins/data/public/query/query_service.ts", @@ -2524,7 +2992,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined" ], "path": "src/plugins/data/public/query/query_service.ts", @@ -2962,9 +3436,21 @@ ">; getFetch$: () => ", "Observable", "; getTime: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; getAbsoluteTime: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; setTime: (time: ", "InputTimeRange", ") => void; getRefreshInterval: () => ", @@ -2992,11 +3478,29 @@ "text": "DataView" }, ", timeRange?: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, " | ", - "ScriptedRangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ScriptedRangeFilter", + "text": "ScriptedRangeFilter" + }, " | ", "MatchAllRangeFilter", " | undefined; createRelativeFilter: (indexPattern: ", @@ -3008,11 +3512,29 @@ "text": "DataView" }, ", timeRange?: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, " | ", - "ScriptedRangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ScriptedRangeFilter", + "text": "ScriptedRangeFilter" + }, " | ", "MatchAllRangeFilter", " | undefined; getBounds: () => ", @@ -3024,7 +3546,13 @@ "text": "TimeRangeBounds" }, "; calculateBounds: (timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => ", { "pluginId": "data", @@ -3042,7 +3570,13 @@ "text": "TimeRangeBounds" }, " | undefined; enableTimeRangeSelector: () => void; disableTimeRangeSelector: () => void; enableAutoRefreshSelector: () => void; disableAutoRefreshSelector: () => void; getTimeDefaults: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; getRefreshIntervalDefaults: () => ", { "pluginId": "data", @@ -3066,13 +3600,31 @@ "description": [], "signature": [ "{ get: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "[]; add: (time: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => void; get$: () => ", "Observable", "<", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "[]>; }" ], "path": "src/plugins/data/public/query/timefilter/timefilter_service.ts", @@ -3143,27 +3695,87 @@ "description": [], "signature": [ "{ getDefaultQuery: () => { query: string; language: any; }; formatQuery: (query: string | ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined) => ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, "; getUpdates$: () => ", "Observable", "<", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, ">; getQuery: () => ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, "; setQuery: (query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, ") => void; clearQuery: () => void; }" ], "path": "src/plugins/data/public/query/query_string/query_string_manager.ts", @@ -3179,7 +3791,13 @@ "label": "SavedQueryTimeFilter", "description": [], "signature": [ - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " & { refreshInterval: ", { "pluginId": "data", @@ -3222,9 +3840,21 @@ ">; getFetch$: () => ", "Observable", "; getTime: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; getAbsoluteTime: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; setTime: (time: ", "InputTimeRange", ") => void; getRefreshInterval: () => ", @@ -3252,11 +3882,29 @@ "text": "DataView" }, ", timeRange?: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, " | ", - "ScriptedRangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ScriptedRangeFilter", + "text": "ScriptedRangeFilter" + }, " | ", "MatchAllRangeFilter", " | undefined; createRelativeFilter: (indexPattern: ", @@ -3268,11 +3916,29 @@ "text": "DataView" }, ", timeRange?: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, " | ", - "ScriptedRangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ScriptedRangeFilter", + "text": "ScriptedRangeFilter" + }, " | ", "MatchAllRangeFilter", " | undefined; getBounds: () => ", @@ -3284,7 +3950,13 @@ "text": "TimeRangeBounds" }, "; calculateBounds: (timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => ", { "pluginId": "data", @@ -3302,7 +3974,13 @@ "text": "TimeRangeBounds" }, " | undefined; enableTimeRangeSelector: () => void; disableTimeRangeSelector: () => void; enableAutoRefreshSelector: () => void; disableAutoRefreshSelector: () => void; getTimeDefaults: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; getRefreshIntervalDefaults: () => ", { "pluginId": "data", @@ -3327,13 +4005,31 @@ "description": [], "signature": [ "{ get: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "[]; add: (time: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => void; get$: () => ", "Observable", "<", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "[]>; }" ], "path": "src/plugins/data/public/query/timefilter/time_history.ts", @@ -3364,7 +4060,13 @@ "description": [], "signature": [ "(timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ", options: ", "CalculateBoundsOptions", ") => ", @@ -3388,7 +4090,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/query/timefilter/get_time.ts", "deprecated": false, @@ -3423,9 +4131,21 @@ "description": [], "signature": [ "(timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ", { forceNow }: { forceNow?: Date | undefined; }) => ", - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/query/timefilter/get_time.ts", "deprecated": false, @@ -3439,7 +4159,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/query/timefilter/get_time.ts", "deprecated": false, @@ -3494,11 +4220,29 @@ "text": "DataView" }, " | undefined, timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ", options: { forceNow?: Date | undefined; fieldName?: string | undefined; } | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, " | ", - "ScriptedRangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ScriptedRangeFilter", + "text": "ScriptedRangeFilter" + }, " | ", "MatchAllRangeFilter", " | undefined" @@ -3537,7 +4281,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/query/timefilter/get_time.ts", "deprecated": false, @@ -3606,11 +4356,29 @@ "text": "DataView" }, " | undefined, timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ", options: { forceNow?: Date | undefined; fieldName?: string | undefined; } | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, " | ", - "ScriptedRangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ScriptedRangeFilter", + "text": "ScriptedRangeFilter" + }, " | ", "MatchAllRangeFilter", " | undefined" @@ -3649,7 +4417,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/query/timefilter/get_time.ts", "deprecated": false, @@ -3710,7 +4484,13 @@ "description": [], "signature": [ "(x: unknown) => x is ", - "Query" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + } ], "path": "src/plugins/data/common/query/is_query.ts", "deprecated": false, @@ -3962,7 +4742,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined" ], "path": "src/plugins/data/common/query/types.ts", @@ -4065,11 +4851,29 @@ "text": "RefreshInterval" }, " | undefined; filters?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined; }" ], "path": "src/plugins/data/common/query/query_state.ts", diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index dad41749303b4..77d60b8fd3826 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3251 | 33 | 2523 | 24 | +| 3261 | 119 | 2553 | 27 | ## Client diff --git a/api_docs/data_search.devdocs.json b/api_docs/data_search.devdocs.json index 9aa18ac220570..5b91e46b4d394 100644 --- a/api_docs/data_search.devdocs.json +++ b/api_docs/data_search.devdocs.json @@ -221,7 +221,13 @@ "text": "ISearchOptions" }, ", \"isStored\" | \"isRestore\" | \"sessionId\">> | null; enableStorage:

(searchSessionInfoProvider: ", { "pluginId": "data", @@ -251,7 +257,13 @@ ">; delete: (sessionId: string) => Promise; create: ({ name, appId, locatorId, initialState, restoreState, sessionId, }: { name: string; appId: string; locatorId: string; initialState: Record; restoreState: Record; sessionId: string; }) => Promise<", "SearchSessionSavedObject", ">; find: (options: Omit<", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ", \"type\">) => Promise<", { "pluginId": "data", @@ -261,7 +273,13 @@ "text": "SearchSessionsFindResponse" }, ">; update: (sessionId: string, attributes: unknown) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -271,7 +289,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">>; rename: (sessionId: string, newName: string) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, ">>; extend: (sessionId: string, expires: string) => Promise<", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, "<", { "pluginId": "data", @@ -659,7 +689,13 @@ "text": "ISearchOptions" }, ", \"isStored\" | \"isRestore\" | \"sessionId\">> | null; enableStorage:

(searchSessionInfoProvider: ", { "pluginId": "data", @@ -689,7 +725,13 @@ ">; delete: (sessionId: string) => Promise; create: ({ name, appId, locatorId, initialState, restoreState, sessionId, }: { name: string; appId: string; locatorId: string; initialState: Record; restoreState: Record; sessionId: string; }) => Promise<", "SearchSessionSavedObject", ">; find: (options: Omit<", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ", \"type\">) => Promise<", { "pluginId": "data", @@ -699,7 +741,13 @@ "text": "SearchSessionsFindResponse" }, ">; update: (sessionId: string, attributes: unknown) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -709,7 +757,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">>; rename: (sessionId: string, newName: string) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, ">>; extend: (sessionId: string, expires: string) => Promise<", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, "<", { "pluginId": "data", @@ -1242,7 +1302,13 @@ ">; delete: (sessionId: string) => Promise; create: ({ name, appId, locatorId, initialState, restoreState, sessionId, }: { name: string; appId: string; locatorId: string; initialState: Record; restoreState: Record; sessionId: string; }) => Promise<", "SearchSessionSavedObject", ">; find: (options: Omit<", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ", \"type\">) => Promise<", { "pluginId": "data", @@ -1252,7 +1318,13 @@ "text": "SearchSessionsFindResponse" }, ">; update: (sessionId: string, attributes: unknown) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -1262,7 +1334,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">>; rename: (sessionId: string, newName: string) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, ">>; extend: (sessionId: string, expires: string) => Promise<", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, "<", { "pluginId": "data", @@ -1323,7 +1407,13 @@ "text": "ISearchOptions" }, ", \"isStored\" | \"isRestore\" | \"sessionId\">> | null; enableStorage:

(searchSessionInfoProvider: ", { "pluginId": "data", @@ -1342,12 +1432,15 @@ { "parentPluginId": "data", "id": "def-public.noSearchSessionStorageCapabilityMessage", - "type": "string", + "type": "Any", "tags": [], "label": "noSearchSessionStorageCapabilityMessage", "description": [ "\nMessage to display in case storing\nsession session is disabled due to turned off capability" ], + "signature": [ + "any" + ], "path": "src/plugins/data/public/search/session/i18n.ts", "deprecated": false, "trackAdoption": false, @@ -1367,6 +1460,25 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchResponseWarning", + "type": "Type", + "tags": [], + "label": "SearchResponseWarning", + "description": [ + "\nA warning object for a search response with warnings" + ], + "signature": [ + "SearchResponseTimeoutWarning", + " | ", + "SearchResponseShardFailureWarning" + ], + "path": "src/plugins/data/public/search/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [] @@ -1470,7 +1582,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "src/plugins/data/server/search/session/session_service.ts", "deprecated": false, @@ -1520,9 +1638,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -1541,9 +1659,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -1582,9 +1700,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, @@ -1603,9 +1721,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } @@ -1676,7 +1794,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "data", @@ -1788,7 +1912,13 @@ "text": "AuthenticatedUser" }, " | null, sessionId: string) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "data", @@ -1877,7 +2007,13 @@ "text": "AuthenticatedUser" }, " | null, options: Omit<", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ", \"type\">) => Promise<", { "pluginId": "data", @@ -1938,7 +2074,13 @@ "description": [], "signature": [ "Omit<", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ", \"type\">" ], "path": "src/plugins/data/server/search/session/session_service.ts", @@ -1976,7 +2118,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -2088,7 +2236,13 @@ "text": "AuthenticatedUser" }, " | null, sessionId: string, expires: Date) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -2192,7 +2346,13 @@ "text": "AuthenticatedUser" }, " | null, sessionId: string) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -2517,14 +2677,20 @@ "signature": [ "({ savedObjects, elasticsearch }: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, ") => (request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => { getId: (args_0: ", { "pluginId": "data", @@ -2566,7 +2732,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "data", @@ -2576,7 +2748,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">>; get: (sessionId: string) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "data", @@ -2586,7 +2764,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">>; find: (options: Omit<", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ", \"type\">) => Promise<", { "pluginId": "data", @@ -2604,7 +2788,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -2614,7 +2804,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">>; extend: (sessionId: string, expires: Date) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -2624,7 +2820,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">>; cancel: (sessionId: string) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -2656,9 +2858,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } @@ -2773,7 +2975,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "data", @@ -2809,9 +3017,21 @@ "description": [], "signature": [ "{ sessionId?: string | undefined; name?: string | undefined; appId?: string | undefined; created?: string | undefined; expires?: string | undefined; locatorId?: string | undefined; initialState?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; restoreState?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; idMapping?: Record Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "data", @@ -2875,7 +3101,13 @@ "description": [], "signature": [ "(options: Omit<", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ", \"type\">) => Promise<", { "pluginId": "data", @@ -2904,15 +3136,45 @@ "> | undefined; searchAfter?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; sortField?: string | undefined; sortOrder?: ", "SortOrder", " | undefined; searchFields?: string[] | undefined; rootSearchFields?: string[] | undefined; hasReference?: ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined; hasReferenceOperator?: \"AND\" | \"OR\" | undefined; hasNoReference?: ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined; hasNoReferenceOperator?: \"AND\" | \"OR\" | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; namespaces?: string[] | undefined; typeToNamespacesMap?: Map | undefined; preference?: string | undefined; pit?: ", - "SavedObjectsPitParams", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsPitParams", + "text": "SavedObjectsPitParams" + }, " | undefined; }" ], "path": "src/plugins/data/server/search/session/types.ts", @@ -2938,7 +3200,13 @@ "text": "SearchSessionSavedObjectAttributes" }, ">) => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -2974,9 +3242,21 @@ "description": [], "signature": [ "{ sessionId?: string | undefined; name?: string | undefined; appId?: string | undefined; created?: string | undefined; expires?: string | undefined; locatorId?: string | undefined; initialState?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; restoreState?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; idMapping?: Record Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, "<", { "pluginId": "data", @@ -3161,14 +3447,20 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, ") => (request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", "IScopedSearchSessionsClient" ], @@ -3185,9 +3477,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } @@ -3535,7 +3827,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "src/plugins/data/server/search/types.ts", "deprecated": false, @@ -3549,7 +3847,13 @@ "label": "esClient", "description": [], "signature": [ - "IScopedClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + } ], "path": "src/plugins/data/server/search/types.ts", "deprecated": false, @@ -3591,7 +3895,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "src/plugins/data/server/search/types.ts", @@ -3612,7 +3922,13 @@ "label": "DataRequestHandlerContext", "description": [], "signature": [ - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, " & { search: Promise<", { "pluginId": "data", @@ -4278,7 +4594,13 @@ "description": [], "signature": [ "() => { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }" ], "path": "src/plugins/data/common/search/aggs/agg_config.ts", @@ -4300,7 +4622,13 @@ "description": [], "signature": [ "() => { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }" ], "path": "src/plugins/data/common/search/aggs/agg_config.ts", @@ -4322,7 +4650,13 @@ ], "signature": [ "() => ", { "pluginId": "fieldFormats", @@ -4662,7 +4996,13 @@ "description": [], "signature": [ "() => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined" ], "path": "src/plugins/data/common/search/aggs/agg_config.ts", @@ -4861,7 +5201,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined" ], "path": "src/plugins/data/common/search/aggs/agg_configs.ts", @@ -5155,7 +5501,13 @@ "description": [], "signature": [ "(timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => void" ], "path": "src/plugins/data/common/search/aggs/agg_configs.ts", @@ -5170,7 +5522,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/search/aggs/agg_configs.ts", "deprecated": false, @@ -5777,7 +6135,13 @@ "description": [], "signature": [ "(forceNow?: Date | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, "[] | { meta: { index: string | undefined; params: {}; alias: string; disabled: boolean; negate: boolean; }; query: { bool: { should: { bool: { filter: { range: { [x: string]: { format: string; gte: string; lte: string; }; }; }[]; }; }[]; minimum_should_match: number; }; }; }[]" ], "path": "src/plugins/data/common/search/aggs/agg_configs.ts", @@ -6115,7 +6479,13 @@ "description": [], "signature": [ "(agg: TAggConfig, state?: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined) => TAggConfig" ], "path": "src/plugins/data/common/search/aggs/param_types/agg.ts", @@ -6146,7 +6516,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/param_types/agg.ts", @@ -7049,7 +7425,13 @@ "text": "SerializedSearchSourceFields" }, "; serialize: () => { searchSourceJSON: string; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }; toExpressionAst: ({ asDatatable }?: ExpressionAstOptions) => ", { "pluginId": "expressions", @@ -7146,7 +7528,13 @@ ], "signature": [ "(agg: TAggConfig) => ", { "pluginId": "fieldFormats", @@ -8529,9 +8917,21 @@ "label": "filterFieldTypes", "description": [], "signature": [ - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, " | \"*\" | ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "[]" ], "path": "src/plugins/data/common/search/aggs/param_types/field.ts", @@ -8736,7 +9136,13 @@ "label": "unit", "description": [], "signature": [ - "Unit" + { + "pluginId": "@kbn/datemath", + "scope": "server", + "docId": "kibKbnDatemathPluginApi", + "section": "def-server.Unit", + "text": "Unit" + } ], "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.ts", "deprecated": false, @@ -10185,7 +10591,7 @@ "references": [ { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts" + "path": "x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_search_source_query.ts" }, { "plugin": "alerting", @@ -10217,11 +10623,11 @@ }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts" + "path": "x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts" + "path": "x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts" }, { "plugin": "securitySolution", @@ -10427,7 +10833,13 @@ ], "signature": [ "() => { searchSourceJSON: string; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/data/common/search/search_source/search_source.ts", @@ -10612,7 +11024,13 @@ "text": "SerializedSearchSourceFields" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }; inject: (searchSourceFields: ", { "pluginId": "data", @@ -10622,7 +11040,13 @@ "text": "SerializedSearchSourceFields" }, " & { indexRefName: string; }, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "data", @@ -11067,7 +11491,13 @@ "description": [], "signature": [ "(filter: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, ") => ", { "pluginId": "expressions", @@ -11089,7 +11519,13 @@ "label": "filter", "description": [], "signature": [ - "Filter" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + } ], "path": "src/plugins/data/common/search/expressions/utils/filters_adapter.ts", "deprecated": false, @@ -11619,7 +12055,13 @@ "description": [], "signature": [ "(query: ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, ", timeField?: string | undefined) => ", { "pluginId": "expressions", @@ -11642,7 +12084,13 @@ "label": "query", "description": [], "signature": [ - "AggregateQuery" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + } ], "path": "src/plugins/data/common/search/expressions/aggregate_query_to_ast.ts", "deprecated": false, @@ -12443,7 +12891,13 @@ "text": "SerializedSearchSourceFields" }, ", ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]]" ], "path": "src/plugins/data/common/search/search_source/extract_references.ts", @@ -12484,9 +12938,21 @@ "description": [], "signature": [ "(filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, " | ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]) => ", { "pluginId": "expressions", @@ -12509,9 +12975,21 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, " | ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/data/common/search/expressions/filters_to_ast.ts", @@ -12644,7 +13122,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => any" ], "path": "src/plugins/data/common/search/expressions/utils/function_wrapper.ts", @@ -13507,7 +13991,13 @@ "description": [], "signature": [ "(timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => ", { "pluginId": "data", @@ -13899,7 +14389,13 @@ "description": [], "signature": [ "(getStartDependencies: (getKibanaRequest: (() => ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") | undefined) => Promise<", { "pluginId": "data", @@ -13930,7 +14426,13 @@ "description": [], "signature": [ "(getKibanaRequest: (() => ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") | undefined) => Promise<", { "pluginId": "data", @@ -15218,7 +15720,13 @@ "text": "SerializedSearchSourceFields" }, " & { indexRefName: string; }, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "data", @@ -15262,7 +15770,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/data/common/search/search_source/inject_references.ts", @@ -15974,7 +16488,13 @@ ], "signature": [ "(interval: string) => { value: number; unit: ", - "Unit", + { + "pluginId": "@kbn/datemath", + "scope": "server", + "docId": "kibKbnDatemathPluginApi", + "section": "def-server.Unit", + "text": "Unit" + }, "; type: \"fixed\" | \"calendar\"; }" ], "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts", @@ -16295,7 +16815,13 @@ "description": [], "signature": [ "(query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, ") => ", { "pluginId": "expressions", @@ -16317,7 +16843,13 @@ "label": "query", "description": [], "signature": [ - "Query" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + } ], "path": "src/plugins/data/common/search/expressions/query_to_ast.ts", "deprecated": false, @@ -16337,7 +16869,13 @@ "description": [], "signature": [ "(interval: string) => { value: number; unit: ", - "Unit", + { + "pluginId": "@kbn/datemath", + "scope": "server", + "docId": "kibKbnDatemathPluginApi", + "section": "def-server.Unit", + "text": "Unit" + }, "; } | null" ], "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_interval.ts", @@ -16679,7 +17217,13 @@ "description": [], "signature": [ "(range: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => { from: Date; to: Date; } | undefined" ], "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.ts", @@ -16694,7 +17238,13 @@ "label": "range", "description": [], "signature": [ - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.ts", "deprecated": false, @@ -16871,7 +17421,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -16934,7 +17490,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -16981,7 +17543,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17028,7 +17596,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17075,7 +17649,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17122,7 +17702,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17169,7 +17755,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17216,7 +17808,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17263,7 +17861,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17310,7 +17914,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17357,7 +17967,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17404,7 +18020,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17451,7 +18073,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17498,7 +18126,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17545,7 +18179,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17592,7 +18232,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17639,7 +18285,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17686,7 +18338,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17733,7 +18391,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17780,7 +18444,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17827,7 +18497,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17874,7 +18550,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17921,7 +18603,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -17968,7 +18656,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18015,7 +18709,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18062,7 +18762,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18109,7 +18815,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18156,7 +18868,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18203,7 +18921,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18250,7 +18974,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18297,7 +19027,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18344,7 +19080,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18391,7 +19133,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18438,7 +19186,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18485,7 +19239,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18532,7 +19292,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18579,7 +19345,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18626,7 +19398,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18673,7 +19451,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18720,7 +19504,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/aggs/types.ts", @@ -18964,7 +19754,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/bucket_avg.ts", @@ -18980,7 +19776,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/bucket_avg.ts", @@ -19100,7 +19902,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/bucket_max.ts", @@ -19116,7 +19924,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/bucket_max.ts", @@ -19236,7 +20050,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/bucket_min.ts", @@ -19252,7 +20072,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/bucket_min.ts", @@ -19372,7 +20198,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/bucket_sum.ts", @@ -19388,7 +20220,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/bucket_sum.ts", @@ -19588,7 +20426,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/cumulative_sum.ts", @@ -19635,7 +20479,13 @@ "description": [], "signature": [ "string | ", - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined" ], "path": "src/plugins/data/common/search/aggs/buckets/date_histogram.ts", @@ -19650,7 +20500,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined" ], "path": "src/plugins/data/common/search/aggs/buckets/date_histogram.ts", @@ -19990,7 +20846,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/derivative.ts", @@ -20273,7 +21135,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/filtered_metric.ts", @@ -20289,7 +21157,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/filtered_metric.ts", @@ -21948,7 +22822,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/moving_avg.ts", @@ -22033,7 +22913,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/buckets/multi_terms.ts", @@ -22410,7 +23296,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/metrics/serial_diff.ts", @@ -22937,7 +23829,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined" ], "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", @@ -23726,9 +24624,21 @@ "text": "FormatFactory" }, "; getDefaultConfig: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", { "pluginId": "fieldFormats", @@ -23754,9 +24664,21 @@ "text": "FieldFormatInstanceType" }, " | undefined; getDefaultType: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", { "pluginId": "fieldFormats", @@ -23766,19 +24688,61 @@ "text": "FieldFormatInstanceType" }, " | undefined; getTypeNameByEsTypes: (esTypes: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, " | undefined; getDefaultTypeName: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, " | ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "; getInstance: (formatId: string, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -23788,11 +24752,29 @@ "text": "FieldFormat" }, "; getDefaultInstancePlain: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -23802,11 +24784,29 @@ "text": "FieldFormat" }, "; getDefaultInstanceCacheResolver: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => string; getByFieldType: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ") => ", { "pluginId": "fieldFormats", @@ -23816,11 +24816,29 @@ "text": "FieldFormatInstanceType" }, "[]; getDefaultInstance: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -23852,7 +24870,13 @@ "description": [], "signature": [ "(timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => ", { "pluginId": "data", @@ -24256,7 +25280,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) | undefined" ], "path": "src/plugins/data/common/search/aggs/agg_type.ts", @@ -24477,7 +25507,13 @@ "description": [], "signature": [ "(timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => ", { "pluginId": "data", @@ -27311,7 +28347,13 @@ "\nRepresents a meta-information about a Kibana entity intitating a saerch request." ], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/data/common/search/types.ts", @@ -28160,7 +29202,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined" ], "path": "src/plugins/data/common/search/expressions/esaggs/request_handler.ts", @@ -28216,7 +29264,13 @@ "label": "query", "description": [], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined" ], "path": "src/plugins/data/common/search/expressions/esaggs/request_handler.ts", @@ -28279,7 +29333,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined" ], "path": "src/plugins/data/common/search/expressions/esaggs/request_handler.ts", @@ -28324,7 +29384,13 @@ "label": "executionContext", "description": [], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/data/common/search/expressions/esaggs/request_handler.ts", @@ -28646,7 +29712,13 @@ "\nThe application state that was used to create the session.\nShould be used, for example, to re-load an expired search session." ], "signature": [ - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined" ], "path": "src/plugins/data/common/search/session/types.ts", @@ -28663,7 +29735,13 @@ "\nApplication state that should be used to restore the session.\nFor example, relative dates are conveted to absolute ones." ], "signature": [ - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined" ], "path": "src/plugins/data/common/search/session/types.ts", @@ -28788,7 +29866,13 @@ "text": "SearchSessionsFindResponse" }, " extends ", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, "<", { "pluginId": "data", @@ -29128,9 +30212,21 @@ "\n{@link Query}" ], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined" ], "path": "src/plugins/data/common/search/search_source/types.ts", @@ -29147,13 +30243,37 @@ "\n{@link Filter}" ], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, " | ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | (() => ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, " | ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined) | undefined" ], "path": "src/plugins/data/common/search/search_source/types.ts", @@ -30005,7 +31125,13 @@ "text": "IAggType" }, "; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; id?: string | undefined; enabled?: boolean | undefined; }" ], "path": "src/plugins/data/common/search/aggs/agg_config.ts", @@ -30022,7 +31148,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }" ], "path": "src/plugins/data/common/search/aggs/agg_config.ts", @@ -30821,7 +31953,7 @@ "label": "boundsDescendingRaw", "description": [], "signature": [ - "({ bound: number; interval: moment.Duration; boundLabel: string; intervalLabel: string; } | { bound: moment.Duration; interval: moment.Duration; boundLabel: string; intervalLabel: string; })[]" + "({ bound: number; interval: moment.Duration; boundLabel: any; intervalLabel: any; } | { bound: moment.Duration; interval: moment.Duration; boundLabel: any; intervalLabel: any; })[]" ], "path": "src/plugins/data/common/search/aggs/buckets/lib/time_buckets/calc_auto_interval.ts", "deprecated": false, @@ -30867,7 +31999,13 @@ "text": "IAggType" }, "; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; id?: string | undefined; enabled?: boolean | undefined; }" ], "path": "src/plugins/data/common/search/aggs/agg_configs.ts", @@ -30974,7 +32112,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/eql.ts", @@ -31106,7 +32250,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts", @@ -31146,7 +32296,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/esdsl.ts", @@ -31255,11 +32411,29 @@ "description": [], "signature": [ "{ filters?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "[] | undefined; timeRange?: ", { "pluginId": "data", @@ -31323,7 +32497,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/cidr.ts", @@ -31379,7 +32559,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/date_range.ts", @@ -31427,7 +32613,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/exists_filter.ts", @@ -31483,7 +32675,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/extended_bounds.ts", @@ -31531,7 +32729,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/field.ts", @@ -31579,7 +32783,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", @@ -31627,7 +32837,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/geo_point.ts", @@ -31683,7 +32899,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/ip_range.ts", @@ -31855,7 +33077,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", @@ -31911,7 +33139,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/timerange.ts", @@ -31959,7 +33193,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/kql.ts", @@ -32007,7 +33247,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/lucene.ts", @@ -32063,7 +33309,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/numerical_range.ts", @@ -32111,7 +33363,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", @@ -32159,7 +33417,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/query_filter.ts", @@ -32207,7 +33471,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/range.ts", @@ -32255,7 +33525,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/range_filter.ts", @@ -32311,7 +33587,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/remove_filter.ts", @@ -32367,7 +33649,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data/common/search/expressions/select_filter.ts", @@ -32427,9 +33715,21 @@ "label": "FieldTypes", "description": [], "signature": [ - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, " | \"*\" | ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "[]" ], "path": "src/plugins/data/common/search/aggs/param_types/field.ts", @@ -32733,7 +34033,7 @@ "label": "intervalOptions", "description": [], "signature": [ - "({ display: string; val: string; enabled(agg: ", + "({ display: any; val: string; enabled(agg: ", { "pluginId": "data", "scope": "common", @@ -32741,7 +34041,7 @@ "section": "def-common.IBucketAggConfig", "text": "IBucketAggConfig" }, - "): boolean; } | { display: string; val: string; })[]" + "): boolean; } | { display: any; val: string; })[]" ], "path": "src/plugins/data/common/search/aggs/buckets/_interval_options.ts", "deprecated": false, @@ -33062,7 +34362,13 @@ ], "signature": [ "{ executionContext?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined; isStored?: boolean | undefined; isRestore?: boolean | undefined; sessionId?: string | undefined; strategy?: string | undefined; legacyHitsTotal?: boolean | undefined; isSearchStored?: boolean | undefined; }" ], "path": "src/plugins/data/common/search/types.ts", @@ -33309,7 +34615,13 @@ "text": "SerializedSearchSourceFields" }, "; serialize: () => { searchSourceJSON: string; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }; toExpressionAst: ({ asDatatable }?: ExpressionAstOptions) => ", { "pluginId": "expressions", @@ -33393,7 +34705,13 @@ "description": [], "signature": [ "{ type: \"kibana_filter\"; } & ", - "Filter" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + } ], "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", "deprecated": false, @@ -33409,7 +34727,13 @@ "description": [], "signature": [ "{ type: \"kibana_query\"; } & ", - "Query" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + } ], "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", "deprecated": false, @@ -33478,10 +34802,13 @@ { "parentPluginId": "data", "id": "def-common.parentPipelineType", - "type": "string", + "type": "Any", "tags": [], "label": "parentPipelineType", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", "deprecated": false, "trackAdoption": false, @@ -33496,7 +34823,13 @@ "description": [], "signature": [ "{ value: number; unit: ", - "Unit", + { + "pluginId": "@kbn/datemath", + "scope": "server", + "docId": "kibKbnDatemathPluginApi", + "section": "def-server.Unit", + "text": "Unit" + }, "; type: \"fixed\" | \"calendar\"; }" ], "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts", @@ -33610,11 +34943,29 @@ "description": [], "signature": [ "{ type?: string | undefined; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined; filter?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; sort?: ", { "pluginId": "data", @@ -33624,9 +34975,21 @@ "text": "EsQuerySortValue" }, "[] | undefined; highlight?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; highlightAll?: boolean | undefined; trackTotalHits?: number | boolean | undefined; aggs?: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }[] | undefined; from?: number | undefined; size?: number | undefined; source?: boolean | ", "Fields", " | undefined; version?: boolean | undefined; fields?: ", @@ -33688,10 +35051,13 @@ { "parentPluginId": "data", "id": "def-common.siblingPipelineType", - "type": "string", + "type": "Any", "tags": [], "label": "siblingPipelineType", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", "deprecated": false, "trackAdoption": false, @@ -33838,10 +35204,13 @@ { "parentPluginId": "data", "id": "def-common.AggGroupLabels.AggGroupNames.Buckets", - "type": "string", + "type": "Any", "tags": [], "label": "[AggGroupNames.Buckets]", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/aggs/agg_groups.ts", "deprecated": false, "trackAdoption": false @@ -33849,10 +35218,13 @@ { "parentPluginId": "data", "id": "def-common.AggGroupLabels.AggGroupNames.Metrics", - "type": "string", + "type": "Any", "tags": [], "label": "[AggGroupNames.Metrics]", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/aggs/agg_groups.ts", "deprecated": false, "trackAdoption": false @@ -33860,10 +35232,13 @@ { "parentPluginId": "data", "id": "def-common.AggGroupLabels.AggGroupNames.None", - "type": "string", + "type": "Any", "tags": [], "label": "[AggGroupNames.None]", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/aggs/agg_groups.ts", "deprecated": false, "trackAdoption": false @@ -33942,10 +35317,13 @@ { "parentPluginId": "data", "id": "def-common.cidrFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/cidr.ts", "deprecated": false, "trackAdoption": false @@ -34003,10 +35381,13 @@ { "parentPluginId": "data", "id": "def-common.cidrFunction.args.mask.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/cidr.ts", "deprecated": false, "trackAdoption": false @@ -34135,10 +35516,13 @@ { "parentPluginId": "data", "id": "def-common.dateRangeFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/date_range.ts", "deprecated": false, "trackAdoption": false @@ -34182,10 +35566,13 @@ { "parentPluginId": "data", "id": "def-common.dateRangeFunction.args.from.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/date_range.ts", "deprecated": false, "trackAdoption": false @@ -34220,10 +35607,13 @@ { "parentPluginId": "data", "id": "def-common.dateRangeFunction.args.to.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/date_range.ts", "deprecated": false, "trackAdoption": false @@ -34527,10 +35917,13 @@ { "parentPluginId": "data", "id": "def-common.existsFilterFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/exists_filter.ts", "deprecated": false, "trackAdoption": false @@ -34588,10 +35981,13 @@ { "parentPluginId": "data", "id": "def-common.existsFilterFunction.args.field.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/exists_filter.ts", "deprecated": false, "trackAdoption": false @@ -34640,10 +36036,13 @@ { "parentPluginId": "data", "id": "def-common.existsFilterFunction.args.negate.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/exists_filter.ts", "deprecated": false, "trackAdoption": false @@ -34661,9 +36060,21 @@ "description": [], "signature": [ "(input: null, args: Arguments) => { $state?: { store: ", - "FilterStateStore", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterStateStore", + "text": "FilterStateStore" + }, "; } | undefined; meta: ", - "FilterMeta", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterMeta", + "text": "FilterMeta" + }, "; query?: Record | undefined; type: \"kibana_filter\"; }" ], "path": "src/plugins/data/common/search/expressions/exists_filter.ts", @@ -34762,10 +36173,13 @@ { "parentPluginId": "data", "id": "def-common.extendedBoundsFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/extended_bounds.ts", "deprecated": false, "trackAdoption": false @@ -34809,10 +36223,13 @@ { "parentPluginId": "data", "id": "def-common.extendedBoundsFunction.args.min.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/extended_bounds.ts", "deprecated": false, "trackAdoption": false @@ -34847,10 +36264,13 @@ { "parentPluginId": "data", "id": "def-common.extendedBoundsFunction.args.max.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/extended_bounds.ts", "deprecated": false, "trackAdoption": false @@ -34979,10 +36399,13 @@ { "parentPluginId": "data", "id": "def-common.fieldFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/field.ts", "deprecated": false, "trackAdoption": false @@ -35040,10 +36463,13 @@ { "parentPluginId": "data", "id": "def-common.fieldFunction.args.name.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/field.ts", "deprecated": false, "trackAdoption": false @@ -35092,10 +36518,13 @@ { "parentPluginId": "data", "id": "def-common.fieldFunction.args.type.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/field.ts", "deprecated": false, "trackAdoption": false @@ -35130,10 +36559,13 @@ { "parentPluginId": "data", "id": "def-common.fieldFunction.args.script.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/field.ts", "deprecated": false, "trackAdoption": false @@ -35255,10 +36687,13 @@ { "parentPluginId": "data", "id": "def-common.geoBoundingBoxFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", "deprecated": false, "trackAdoption": false @@ -35302,10 +36737,13 @@ { "parentPluginId": "data", "id": "def-common.geoBoundingBoxFunction.args.top.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", "deprecated": false, "trackAdoption": false @@ -35340,10 +36778,13 @@ { "parentPluginId": "data", "id": "def-common.geoBoundingBoxFunction.args.left.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", "deprecated": false, "trackAdoption": false @@ -35378,10 +36819,13 @@ { "parentPluginId": "data", "id": "def-common.geoBoundingBoxFunction.args.bottom.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", "deprecated": false, "trackAdoption": false @@ -35416,10 +36860,13 @@ { "parentPluginId": "data", "id": "def-common.geoBoundingBoxFunction.args.right.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", "deprecated": false, "trackAdoption": false @@ -35454,10 +36901,13 @@ { "parentPluginId": "data", "id": "def-common.geoBoundingBoxFunction.args.wkt.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", "deprecated": false, "trackAdoption": false @@ -35492,10 +36942,13 @@ { "parentPluginId": "data", "id": "def-common.geoBoundingBoxFunction.args.topLeft.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", "deprecated": false, "trackAdoption": false @@ -35530,10 +36983,13 @@ { "parentPluginId": "data", "id": "def-common.geoBoundingBoxFunction.args.bottomRight.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", "deprecated": false, "trackAdoption": false @@ -35568,10 +37024,13 @@ { "parentPluginId": "data", "id": "def-common.geoBoundingBoxFunction.args.topRight.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", "deprecated": false, "trackAdoption": false @@ -35606,10 +37065,13 @@ { "parentPluginId": "data", "id": "def-common.geoBoundingBoxFunction.args.bottomLeft.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_bounding_box.ts", "deprecated": false, "trackAdoption": false @@ -35731,10 +37193,13 @@ { "parentPluginId": "data", "id": "def-common.geoPointFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_point.ts", "deprecated": false, "trackAdoption": false @@ -35778,10 +37243,13 @@ { "parentPluginId": "data", "id": "def-common.geoPointFunction.args.lat.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_point.ts", "deprecated": false, "trackAdoption": false @@ -35816,10 +37284,13 @@ { "parentPluginId": "data", "id": "def-common.geoPointFunction.args.lon.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_point.ts", "deprecated": false, "trackAdoption": false @@ -35882,10 +37353,13 @@ { "parentPluginId": "data", "id": "def-common.geoPointFunction.args.point.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/geo_point.ts", "deprecated": false, "trackAdoption": false @@ -36007,10 +37481,13 @@ { "parentPluginId": "data", "id": "def-common.ipRangeFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/ip_range.ts", "deprecated": false, "trackAdoption": false @@ -36068,10 +37545,13 @@ { "parentPluginId": "data", "id": "def-common.ipRangeFunction.args.from.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/ip_range.ts", "deprecated": false, "trackAdoption": false @@ -36120,10 +37600,13 @@ { "parentPluginId": "data", "id": "def-common.ipRangeFunction.args.to.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/ip_range.ts", "deprecated": false, "trackAdoption": false @@ -36252,10 +37735,13 @@ { "parentPluginId": "data", "id": "def-common.kibana.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/kibana.ts", "deprecated": false, "trackAdoption": false @@ -36598,10 +38084,13 @@ { "parentPluginId": "data", "id": "def-common.kibanaFilterFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", "deprecated": false, "trackAdoption": false @@ -36673,10 +38162,13 @@ { "parentPluginId": "data", "id": "def-common.kibanaFilterFunction.args.query.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", "deprecated": false, "trackAdoption": false @@ -36725,10 +38217,13 @@ { "parentPluginId": "data", "id": "def-common.kibanaFilterFunction.args.negate.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", "deprecated": false, "trackAdoption": false @@ -36777,10 +38272,13 @@ { "parentPluginId": "data", "id": "def-common.kibanaFilterFunction.args.disabled.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", "deprecated": false, "trackAdoption": false @@ -36895,10 +38393,13 @@ { "parentPluginId": "data", "id": "def-common.kibanaTimerangeFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/timerange.ts", "deprecated": false, "trackAdoption": false @@ -36956,10 +38457,13 @@ { "parentPluginId": "data", "id": "def-common.kibanaTimerangeFunction.args.from.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/timerange.ts", "deprecated": false, "trackAdoption": false @@ -37008,10 +38512,13 @@ { "parentPluginId": "data", "id": "def-common.kibanaTimerangeFunction.args.to.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/timerange.ts", "deprecated": false, "trackAdoption": false @@ -37060,10 +38567,13 @@ { "parentPluginId": "data", "id": "def-common.kibanaTimerangeFunction.args.mode.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/timerange.ts", "deprecated": false, "trackAdoption": false @@ -37192,10 +38702,13 @@ { "parentPluginId": "data", "id": "def-common.kqlFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/kql.ts", "deprecated": false, "trackAdoption": false @@ -37267,10 +38780,13 @@ { "parentPluginId": "data", "id": "def-common.kqlFunction.args.q.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/kql.ts", "deprecated": false, "trackAdoption": false @@ -37385,10 +38901,13 @@ { "parentPluginId": "data", "id": "def-common.luceneFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/lucene.ts", "deprecated": false, "trackAdoption": false @@ -37460,10 +38979,13 @@ { "parentPluginId": "data", "id": "def-common.luceneFunction.args.q.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/lucene.ts", "deprecated": false, "trackAdoption": false @@ -37555,7 +39077,13 @@ "text": "IBucketAggConfig" }, ", state?: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; } | undefined) => ", { "pluginId": "data", @@ -37715,10 +39243,13 @@ { "parentPluginId": "data", "id": "def-common.numericalRangeFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/numerical_range.ts", "deprecated": false, "trackAdoption": false @@ -37762,10 +39293,13 @@ { "parentPluginId": "data", "id": "def-common.numericalRangeFunction.args.from.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/numerical_range.ts", "deprecated": false, "trackAdoption": false @@ -37800,10 +39334,13 @@ { "parentPluginId": "data", "id": "def-common.numericalRangeFunction.args.to.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/numerical_range.ts", "deprecated": false, "trackAdoption": false @@ -37838,10 +39375,13 @@ { "parentPluginId": "data", "id": "def-common.numericalRangeFunction.args.label.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/numerical_range.ts", "deprecated": false, "trackAdoption": false @@ -37928,10 +39468,13 @@ { "parentPluginId": "data", "id": "def-common.parentPipelineAggHelper.subtype", - "type": "string", + "type": "Any", "tags": [], "label": "subtype", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", "deprecated": false, "trackAdoption": false @@ -38073,10 +39616,13 @@ { "parentPluginId": "data", "id": "def-common.phraseFilterFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", "deprecated": false, "trackAdoption": false @@ -38134,10 +39680,13 @@ { "parentPluginId": "data", "id": "def-common.phraseFilterFunction.args.field.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", "deprecated": false, "trackAdoption": false @@ -38200,10 +39749,13 @@ { "parentPluginId": "data", "id": "def-common.phraseFilterFunction.args.phrase.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", "deprecated": false, "trackAdoption": false @@ -38252,10 +39804,13 @@ { "parentPluginId": "data", "id": "def-common.phraseFilterFunction.args.negate.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", "deprecated": false, "trackAdoption": false @@ -38273,9 +39828,21 @@ "description": [], "signature": [ "(input: null, args: Arguments) => { $state?: { store: ", - "FilterStateStore", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterStateStore", + "text": "FilterStateStore" + }, "; } | undefined; meta: ", - "FilterMeta", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterMeta", + "text": "FilterMeta" + }, "; query?: Record | undefined; type: \"kibana_filter\"; }" ], "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", @@ -38374,10 +39941,13 @@ { "parentPluginId": "data", "id": "def-common.queryFilterFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/query_filter.ts", "deprecated": false, "trackAdoption": false @@ -38449,10 +40019,13 @@ { "parentPluginId": "data", "id": "def-common.queryFilterFunction.args.input.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/query_filter.ts", "deprecated": false, "trackAdoption": false @@ -38487,10 +40060,13 @@ { "parentPluginId": "data", "id": "def-common.queryFilterFunction.args.label.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/query_filter.ts", "deprecated": false, "trackAdoption": false @@ -38612,10 +40188,13 @@ { "parentPluginId": "data", "id": "def-common.rangeFilterFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/range_filter.ts", "deprecated": false, "trackAdoption": false @@ -38673,10 +40252,13 @@ { "parentPluginId": "data", "id": "def-common.rangeFilterFunction.args.field.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/range_filter.ts", "deprecated": false, "trackAdoption": false @@ -38725,10 +40307,13 @@ { "parentPluginId": "data", "id": "def-common.rangeFilterFunction.args.range.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/range_filter.ts", "deprecated": false, "trackAdoption": false @@ -38777,10 +40362,13 @@ { "parentPluginId": "data", "id": "def-common.rangeFilterFunction.args.negate.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/range_filter.ts", "deprecated": false, "trackAdoption": false @@ -38798,9 +40386,21 @@ "description": [], "signature": [ "(input: null, args: Arguments) => { $state?: { store: ", - "FilterStateStore", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterStateStore", + "text": "FilterStateStore" + }, "; } | undefined; meta: ", - "FilterMeta", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterMeta", + "text": "FilterMeta" + }, "; query?: Record | undefined; type: \"kibana_filter\"; }" ], "path": "src/plugins/data/common/search/expressions/range_filter.ts", @@ -38899,10 +40499,13 @@ { "parentPluginId": "data", "id": "def-common.rangeFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/range.ts", "deprecated": false, "trackAdoption": false @@ -38946,10 +40549,13 @@ { "parentPluginId": "data", "id": "def-common.rangeFunction.args.gt.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/range.ts", "deprecated": false, "trackAdoption": false @@ -38984,10 +40590,13 @@ { "parentPluginId": "data", "id": "def-common.rangeFunction.args.lt.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/range.ts", "deprecated": false, "trackAdoption": false @@ -39022,10 +40631,13 @@ { "parentPluginId": "data", "id": "def-common.rangeFunction.args.gte.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/range.ts", "deprecated": false, "trackAdoption": false @@ -39060,10 +40672,13 @@ { "parentPluginId": "data", "id": "def-common.rangeFunction.args.lte.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/range.ts", "deprecated": false, "trackAdoption": false @@ -39178,10 +40793,13 @@ { "parentPluginId": "data", "id": "def-common.removeFilterFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/remove_filter.ts", "deprecated": false, "trackAdoption": false @@ -39239,10 +40857,13 @@ { "parentPluginId": "data", "id": "def-common.removeFilterFunction.args.group.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/remove_filter.ts", "deprecated": false, "trackAdoption": false @@ -39277,10 +40898,13 @@ { "parentPluginId": "data", "id": "def-common.removeFilterFunction.args.from.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/remove_filter.ts", "deprecated": false, "trackAdoption": false @@ -39343,10 +40967,13 @@ { "parentPluginId": "data", "id": "def-common.removeFilterFunction.args.ungrouped.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/remove_filter.ts", "deprecated": false, "trackAdoption": false @@ -39372,11 +40999,29 @@ "text": "ExpressionValueSearchContext" }, ", { group, from, ungrouped }: Arguments) => { filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; type: \"kibana_context\"; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "[] | undefined; timeRange?: ", { "pluginId": "data", @@ -39489,10 +41134,13 @@ { "parentPluginId": "data", "id": "def-common.selectFilterFunction.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/select_filter.ts", "deprecated": false, "trackAdoption": false @@ -39550,10 +41198,13 @@ { "parentPluginId": "data", "id": "def-common.selectFilterFunction.args.group.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/select_filter.ts", "deprecated": false, "trackAdoption": false @@ -39602,10 +41253,13 @@ { "parentPluginId": "data", "id": "def-common.selectFilterFunction.args.from.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/select_filter.ts", "deprecated": false, "trackAdoption": false @@ -39668,10 +41322,13 @@ { "parentPluginId": "data", "id": "def-common.selectFilterFunction.args.ungrouped.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/expressions/select_filter.ts", "deprecated": false, "trackAdoption": false @@ -39697,11 +41354,29 @@ "text": "ExpressionValueSearchContext" }, ", { group, ungrouped, from }: Arguments) => { filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; type: \"kibana_context\"; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "[] | undefined; timeRange?: ", { "pluginId": "data", @@ -39772,10 +41447,13 @@ { "parentPluginId": "data", "id": "def-common.siblingPipelineAggHelper.subtype", - "type": "string", + "type": "Any", "tags": [], "label": "subtype", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", "deprecated": false, "trackAdoption": false diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index aac967b04b83a..cd9e5e4381e5d 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3251 | 33 | 2523 | 24 | +| 3261 | 119 | 2553 | 27 | ## Client diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index f7df206f7f231..c6569eb627352 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] --- import dataViewEditorObj from './data_view_editor.devdocs.json'; diff --git a/api_docs/data_view_field_editor.devdocs.json b/api_docs/data_view_field_editor.devdocs.json index 50c48bbe6aed2..f12453271d43b 100644 --- a/api_docs/data_view_field_editor.devdocs.json +++ b/api_docs/data_view_field_editor.devdocs.json @@ -95,7 +95,7 @@ "section": "def-public.FormatEditorState", "text": "FormatEditorState" }, - ") => { error: string | undefined; samples: ", + ") => { error: any; samples: ", { "pluginId": "dataViewFieldEditor", "scope": "public", @@ -406,7 +406,13 @@ "description": [], "signature": [ "(newParams: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => void" ], "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", @@ -421,7 +427,13 @@ "label": "newParams", "description": [], "signature": [ - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false, diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index 9a7678522e99a..28f900dd1120f 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: 2022-10-25 +date: 2022-11-07 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 4b0c4c2c59d23..cbdc499bc922b 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: 2022-10-25 +date: 2022-11-07 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 e66691e1282d6..8047f7677001f 100644 --- a/api_docs/data_views.devdocs.json +++ b/api_docs/data_views.devdocs.json @@ -20,7 +20,13 @@ "text": "DataView" }, " implements ", - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -57,6 +63,10 @@ "deprecated": true, "trackAdoption": false, "references": [ + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/types.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" @@ -145,6 +155,94 @@ "plugin": "data", "path": "src/plugins/data/common/search/expressions/kibana_context.test.ts" }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/build_es_query.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_filters.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_filters.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_kuery.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/handle_combined_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/handle_nested_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/build_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/exists_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/get_filter_field.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrases_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/ast/ast.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/and.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/exists.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/is.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/nested.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/not.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/or.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/range.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/node_types/function.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/utils/get_full_field_name_node.test.ts" + }, { "plugin": "data", "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts" @@ -209,10 +307,54 @@ "plugin": "unifiedFieldList", "path": "src/plugins/unified_field_list/common/utils/field_existing_utils.ts" }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts" + }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts" + }, { "plugin": "aiops", "path": "x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx" }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_views/resolved_log_view.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + }, { "plugin": "presentationUtil", "path": "src/plugins/presentation_util/public/services/storybook/data_views.ts" @@ -249,10 +391,6 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/common/log_views/resolved_log_view.ts" - }, { "plugin": "dataVisualizer", "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts" @@ -339,39 +477,39 @@ }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", @@ -450,40 +588,24 @@ "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.tsx" }, { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/services/kibana/data_views.ts" }, { "plugin": "canvas", @@ -491,7 +613,7 @@ }, { "plugin": "canvas", - "path": "x-pack/plugins/canvas/public/services/kibana/data_views.ts" + "path": "x-pack/plugins/canvas/public/components/datasource/datasource_component.js" }, { "plugin": "reporting", @@ -527,39 +649,39 @@ }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx" }, { "plugin": "synthetics", @@ -869,18 +991,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/sourcerer/routes/index.ts" @@ -888,6 +998,10 @@ { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/sourcerer/routes/index.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts" } ] }, @@ -910,7 +1024,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -2452,7 +2572,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => void" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -2494,7 +2620,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -2562,7 +2694,13 @@ "text": "DataViewField" }, " implements ", - "DataViewFieldBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + } ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", "deprecated": false, @@ -2576,7 +2714,13 @@ "label": "spec", "description": [], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " & { count?: number | undefined; conflictDescriptions?: Record | undefined; format?: ", { "pluginId": "fieldFormats", @@ -2586,7 +2730,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; esTypes?: string[] | undefined; searchable: boolean; aggregatable: boolean; readFromDocValues?: boolean | undefined; indexed?: boolean | undefined; customLabel?: string | undefined; runtimeField?: ", { "pluginId": "dataViews", @@ -3039,7 +3189,13 @@ "\nReturns field subtype, multi, nested, or undefined if neither" ], "signature": [ - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -3161,7 +3317,13 @@ ], "signature": [ "() => ", - "IFieldSubTypeNested", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeNested", + "text": "IFieldSubTypeNested" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -3181,7 +3343,13 @@ ], "signature": [ "() => ", - "IFieldSubTypeMulti", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeMulti", + "text": "IFieldSubTypeMulti" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -3219,7 +3387,13 @@ ], "signature": [ "() => { count: number; script: string | undefined; lang: string | undefined; conflictDescriptions: Record | undefined; name: string; type: string; esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues: boolean; subType: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; customLabel: string | undefined; }" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -3364,7 +3538,13 @@ "http dependency" ], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "src/plugins/data_views/public/data_views/data_views_api_client.ts", "deprecated": false, @@ -3525,7 +3705,13 @@ "text": "DataViewsPublicPlugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "<", { "pluginId": "dataViews", @@ -3573,7 +3759,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", { "pluginId": "dataViews", @@ -3619,7 +3811,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", { "pluginId": "dataViews", @@ -3676,7 +3874,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", { fieldFormats }: ", { "pluginId": "dataViews", @@ -3706,7 +3910,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/data_views/public/plugin.ts", "deprecated": false, @@ -4071,7 +4281,13 @@ ], "signature": [ "() => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -4555,7 +4771,13 @@ ], "signature": [ "(savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -4585,7 +4807,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -4672,10 +4900,10 @@ "tags": [], "label": "create", "description": [ - "\nCreate a new data view instance." + "\nCreate data view instance." ], "signature": [ - "({ id, name, title, ...restOfSpec }: ", + "(spec: ", { "pluginId": "dataViews", "scope": "common", @@ -4702,8 +4930,10 @@ "id": "def-public.DataViewsService.create.$1", "type": "Object", "tags": [], - "label": "{ id, name, title, ...restOfSpec }", - "description": [], + "label": "spec", + "description": [ + "data view spec" + ], "signature": [ { "pluginId": "dataViews", @@ -5355,7 +5585,13 @@ "text": "SavedObjectsClientCommonFindArgs" }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]>" ], "path": "src/plugins/data_views/public/saved_objects_client_wrapper.ts", @@ -5395,7 +5631,13 @@ "description": [], "signature": [ "(type: string, id: string) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/public/saved_objects_client_wrapper.ts", @@ -5452,9 +5694,21 @@ "text": "DataViewAttributes" }, ", options: ", - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/public/saved_objects_client_wrapper.ts", @@ -5520,7 +5774,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, "" ], "path": "src/plugins/data_views/public/saved_objects_client_wrapper.ts", @@ -5548,9 +5808,21 @@ "text": "DataViewAttributes" }, ", options?: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/public/saved_objects_client_wrapper.ts", @@ -5601,7 +5873,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, " | undefined" ], "path": "src/plugins/data_views/public/saved_objects_client_wrapper.ts", @@ -5712,7 +5990,13 @@ "label": "uiSettings", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "src/plugins/data_views/public/ui_settings_wrapper.ts", "deprecated": false, @@ -5763,9 +6047,21 @@ "description": [], "signature": [ "() => Promise) | undefined>>" ], "path": "src/plugins/data_views/public/ui_settings_wrapper.ts", @@ -5867,7 +6163,13 @@ "description": [], "signature": [ "(field: HasSubtype) => ", - "IFieldSubTypeMulti", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeMulti", + "text": "IFieldSubTypeMulti" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -5884,7 +6186,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -5903,7 +6211,13 @@ "description": [], "signature": [ "(field: HasSubtype) => ", - "IFieldSubTypeNested", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeNested", + "text": "IFieldSubTypeNested" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -5920,7 +6234,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -7208,7 +7528,13 @@ "text": "SavedObjectsClientCommonFindArgs" }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]>" ], "path": "src/plugins/data_views/common/types.ts", @@ -7252,7 +7578,13 @@ ], "signature": [ "(type: string, id: string) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/common/types.ts", @@ -7315,9 +7647,21 @@ "text": "DataViewAttributes" }, ", options: ", - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/common/types.ts", @@ -7391,7 +7735,13 @@ "- client options" ], "signature": [ - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, "" ], "path": "src/plugins/data_views/common/types.ts", @@ -7421,9 +7771,21 @@ "text": "DataViewAttributes" }, ", options: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/common/types.ts", @@ -7480,7 +7842,13 @@ "- client options" ], "signature": [ - "SavedObjectsCreateOptions" + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -7700,7 +8068,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">> | undefined; runtimeFieldMap?: Record | undefined; format?: ", { "pluginId": "fieldFormats", @@ -7744,7 +8124,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; esTypes?: string[] | undefined; searchable: boolean; aggregatable: boolean; readFromDocValues?: boolean | undefined; indexed?: boolean | undefined; customLabel?: string | undefined; runtimeField?: ", { "pluginId": "dataViews", @@ -7931,7 +8317,13 @@ "text": "DataView" }, " implements ", - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -7968,6 +8360,10 @@ "deprecated": true, "trackAdoption": false, "references": [ + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/types.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" @@ -8056,6 +8452,94 @@ "plugin": "data", "path": "src/plugins/data/common/search/expressions/kibana_context.test.ts" }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/build_es_query.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_filters.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_filters.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_kuery.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/handle_combined_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/handle_nested_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/build_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/exists_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/get_filter_field.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrases_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/ast/ast.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/and.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/exists.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/is.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/nested.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/not.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/or.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/range.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/node_types/function.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/utils/get_full_field_name_node.test.ts" + }, { "plugin": "data", "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts" @@ -8120,10 +8604,54 @@ "plugin": "unifiedFieldList", "path": "src/plugins/unified_field_list/common/utils/field_existing_utils.ts" }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts" + }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts" + }, { "plugin": "aiops", "path": "x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx" }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_views/resolved_log_view.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + }, { "plugin": "presentationUtil", "path": "src/plugins/presentation_util/public/services/storybook/data_views.ts" @@ -8160,10 +8688,6 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/common/log_views/resolved_log_view.ts" - }, { "plugin": "dataVisualizer", "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts" @@ -8250,39 +8774,39 @@ }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", @@ -8361,40 +8885,24 @@ "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.tsx" }, { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/services/kibana/data_views.ts" }, { "plugin": "canvas", @@ -8402,7 +8910,7 @@ }, { "plugin": "canvas", - "path": "x-pack/plugins/canvas/public/services/kibana/data_views.ts" + "path": "x-pack/plugins/canvas/public/components/datasource/datasource_component.js" }, { "plugin": "reporting", @@ -8438,39 +8946,39 @@ }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx" }, { "plugin": "synthetics", @@ -8780,18 +9288,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/sourcerer/routes/index.ts" @@ -8799,6 +9295,10 @@ { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/sourcerer/routes/index.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts" } ] }, @@ -8821,7 +9321,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -10363,7 +10869,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => void" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -10405,7 +10917,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -10472,9 +10990,9 @@ }, " implements ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, @@ -10539,9 +11057,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, @@ -10565,9 +11083,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -10610,9 +11128,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -10673,9 +11191,9 @@ "signature": [ "({ uiSettings, capabilities }: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, @@ -10688,11 +11206,29 @@ "text": "DataViewsServerPluginStartDependencies" }, ") => { dataViewsServiceFactory: (savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", elasticsearchClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", request?: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, " | undefined, byPassCapabilities?: boolean | undefined) => Promise<", { "pluginId": "dataViews", @@ -10716,9 +11252,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } @@ -11086,7 +11622,13 @@ ], "signature": [ "() => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -11570,7 +12112,13 @@ ], "signature": [ "(savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -11600,7 +12148,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -11687,10 +12241,10 @@ "tags": [], "label": "create", "description": [ - "\nCreate a new data view instance." + "\nCreate data view instance." ], "signature": [ - "({ id, name, title, ...restOfSpec }: ", + "(spec: ", { "pluginId": "dataViews", "scope": "common", @@ -11717,8 +12271,10 @@ "id": "def-server.DataViewsService.create.$1", "type": "Object", "tags": [], - "label": "{ id, name, title, ...restOfSpec }", - "description": [], + "label": "spec", + "description": [ + "data view spec" + ], "signature": [ { "pluginId": "dataViews", @@ -12176,7 +12732,13 @@ "label": "elasticsearchClient", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "src/plugins/data_views/server/fetcher/index_patterns_fetcher.ts", "deprecated": false, @@ -12386,11 +12948,29 @@ ], "signature": [ "(deps: DataViewsServiceFactoryDeps) => (savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", elasticsearchClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", request?: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, " | undefined, byPassCapabilities?: boolean | undefined) => Promise<", { "pluginId": "dataViews", @@ -12437,9 +13017,21 @@ "description": [], "signature": [ "(savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", index: string) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -12480,7 +13072,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "src/plugins/data_views/server/utils.ts", "deprecated": false, @@ -12563,7 +13161,13 @@ "description": [], "signature": [ "(fieldName: string, indexPattern: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -12627,7 +13231,13 @@ "label": "indexPattern", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -12777,7 +13387,13 @@ "\nLogger" ], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "src/plugins/data_views/server/types.ts", "deprecated": false, @@ -13027,7 +13643,13 @@ "text": "SavedObjectsClientCommonFindArgs" }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]>" ], "path": "src/plugins/data_views/common/types.ts", @@ -13071,7 +13693,13 @@ ], "signature": [ "(type: string, id: string) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/common/types.ts", @@ -13134,9 +13762,21 @@ "text": "DataViewAttributes" }, ", options: ", - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/common/types.ts", @@ -13210,7 +13850,13 @@ "- client options" ], "signature": [ - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, "" ], "path": "src/plugins/data_views/common/types.ts", @@ -13240,9 +13886,21 @@ "text": "DataViewAttributes" }, ", options: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/common/types.ts", @@ -13299,7 +13957,13 @@ "- client options" ], "signature": [ - "SavedObjectsCreateOptions" + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -13406,7 +14070,13 @@ "\nSerialized version of DataViewField" ], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " & { count?: number | undefined; conflictDescriptions?: Record | undefined; format?: ", { "pluginId": "fieldFormats", @@ -13416,7 +14086,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; esTypes?: string[] | undefined; searchable: boolean; aggregatable: boolean; readFromDocValues?: boolean | undefined; indexed?: boolean | undefined; customLabel?: string | undefined; runtimeField?: ", { "pluginId": "dataViews", @@ -13683,11 +14359,29 @@ ], "signature": [ "(savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", elasticsearchClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", request?: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, " | undefined, byPassCapabilities?: boolean | undefined) => Promise<", { "pluginId": "dataViews", @@ -13711,7 +14405,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "src/plugins/data_views/server/types.ts", "deprecated": false, @@ -14925,7 +15625,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, " | undefined" ], "path": "src/plugins/data_views/server/types.ts", @@ -14989,7 +15695,13 @@ "text": "DataView" }, " implements ", - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -15026,6 +15738,10 @@ "deprecated": true, "trackAdoption": false, "references": [ + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/types.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" @@ -15114,6 +15830,94 @@ "plugin": "data", "path": "src/plugins/data/common/search/expressions/kibana_context.test.ts" }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/build_es_query.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_filters.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_filters.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/from_kuery.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/handle_combined_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/es_query/handle_nested_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/build_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/exists_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/get_filter_field.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/filters/build_filters/phrases_filter.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/ast/ast.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/and.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/exists.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/is.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/nested.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/not.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/or.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/range.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/node_types/function.test.ts" + }, + { + "plugin": "@kbn/es-query", + "path": "packages/kbn-es-query/src/kuery/functions/utils/get_full_field_name_node.test.ts" + }, { "plugin": "data", "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts" @@ -15178,10 +15982,54 @@ "plugin": "unifiedFieldList", "path": "src/plugins/unified_field_list/common/utils/field_existing_utils.ts" }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts" + }, + { + "plugin": "unifiedFieldList", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts" + }, { "plugin": "aiops", "path": "x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx" }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_views/resolved_log_view.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + }, { "plugin": "presentationUtil", "path": "src/plugins/presentation_util/public/services/storybook/data_views.ts" @@ -15218,10 +16066,6 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/common/log_views/resolved_log_view.ts" - }, { "plugin": "dataVisualizer", "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts" @@ -15308,39 +16152,39 @@ }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx" }, { "plugin": "ml", @@ -15419,40 +16263,20 @@ "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx" }, { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.tsx" }, { "plugin": "canvas", @@ -15462,6 +16286,10 @@ "plugin": "canvas", "path": "x-pack/plugins/canvas/public/services/kibana/data_views.ts" }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/components/datasource/datasource_component.js" + }, { "plugin": "reporting", "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" @@ -15496,39 +16324,39 @@ }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx" + "path": "x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx" }, { "plugin": "synthetics", @@ -15838,18 +16666,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/data_views_service/loader.test.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/sourcerer/routes/index.ts" @@ -15857,6 +16673,10 @@ { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/sourcerer/routes/index.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts" } ] }, @@ -15879,7 +16699,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -17421,7 +18247,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => void" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -17463,7 +18295,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", @@ -17531,7 +18369,13 @@ "text": "DataViewField" }, " implements ", - "DataViewFieldBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + } ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", "deprecated": false, @@ -17545,7 +18389,13 @@ "label": "spec", "description": [], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " & { count?: number | undefined; conflictDescriptions?: Record | undefined; format?: ", { "pluginId": "fieldFormats", @@ -17555,7 +18405,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; esTypes?: string[] | undefined; searchable: boolean; aggregatable: boolean; readFromDocValues?: boolean | undefined; indexed?: boolean | undefined; customLabel?: string | undefined; runtimeField?: ", { "pluginId": "dataViews", @@ -18008,7 +18864,13 @@ "\nReturns field subtype, multi, nested, or undefined if neither" ], "signature": [ - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -18130,7 +18992,13 @@ ], "signature": [ "() => ", - "IFieldSubTypeNested", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeNested", + "text": "IFieldSubTypeNested" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -18150,7 +19018,13 @@ ], "signature": [ "() => ", - "IFieldSubTypeMulti", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeMulti", + "text": "IFieldSubTypeMulti" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -18188,7 +19062,13 @@ ], "signature": [ "() => { count: number; script: string | undefined; lang: string | undefined; conflictDescriptions: Record | undefined; name: string; type: string; esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues: boolean; subType: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; customLabel: string | undefined; }" ], "path": "src/plugins/data_views/common/fields/data_view_field.ts", @@ -18716,7 +19596,13 @@ ], "signature": [ "() => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -19200,7 +20086,13 @@ ], "signature": [ "(savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -19230,7 +20122,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -19317,10 +20215,10 @@ "tags": [], "label": "create", "description": [ - "\nCreate a new data view instance." + "\nCreate data view instance." ], "signature": [ - "({ id, name, title, ...restOfSpec }: ", + "(spec: ", { "pluginId": "dataViews", "scope": "common", @@ -19347,8 +20245,10 @@ "id": "def-common.DataViewsService.create.$1", "type": "Object", "tags": [], - "label": "{ id, name, title, ...restOfSpec }", - "description": [], + "label": "spec", + "description": [ + "data view spec" + ], "signature": [ { "pluginId": "dataViews", @@ -19916,7 +20816,13 @@ "description": [], "signature": [ "(field: HasSubtype) => ", - "IFieldSubTypeMulti", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeMulti", + "text": "IFieldSubTypeMulti" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -19933,7 +20839,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -19952,7 +20864,13 @@ "description": [], "signature": [ "(field: HasSubtype) => ", - "IFieldSubTypeNested", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeNested", + "text": "IFieldSubTypeNested" + }, " | undefined" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -19969,7 +20887,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -20075,7 +20999,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -20109,7 +21039,13 @@ "description": [], "signature": [ "{ subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/fields/utils.ts", @@ -20516,9 +21452,21 @@ "text": "FormatFactory" }, "; getDefaultConfig: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", { "pluginId": "fieldFormats", @@ -20544,9 +21492,21 @@ "text": "FieldFormatInstanceType" }, " | undefined; getDefaultType: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", { "pluginId": "fieldFormats", @@ -20556,19 +21516,61 @@ "text": "FieldFormatInstanceType" }, " | undefined; getTypeNameByEsTypes: (esTypes: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, " | undefined; getDefaultTypeName: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, " | ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "; getInstance: (formatId: string, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -20578,11 +21580,29 @@ "text": "FieldFormat" }, "; getDefaultInstancePlain: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -20592,11 +21612,29 @@ "text": "FieldFormat" }, "; getDefaultInstanceCacheResolver: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => string; getByFieldType: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ") => ", { "pluginId": "fieldFormats", @@ -20606,11 +21644,29 @@ "text": "FieldFormatInstanceType" }, "[]; getDefaultInstance: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -20644,7 +21700,13 @@ ], "signature": [ "(toastInputFields: ", - "ToastInputFields", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInputFields", + "text": "ToastInputFields" + }, ", key: string) => void" ], "path": "src/plugins/data_views/common/data_views/data_views.ts", @@ -20663,9 +21725,21 @@ "Pick<", "Toast", ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\" | \"css\"> & { title?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; text?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/types.ts", @@ -20696,7 +21770,13 @@ ], "signature": [ "(error: Error, toastInputFields: ", - "ErrorToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + }, ", key: string) => void" ], "path": "src/plugins/data_views/common/data_views/data_views.ts", @@ -20726,7 +21806,13 @@ "label": "toastInputFields", "description": [], "signature": [ - "ErrorToastOptions" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -21419,7 +22505,13 @@ ], "signature": [ "() => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -21919,7 +23011,13 @@ ], "signature": [ "(savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -21949,7 +23047,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -22164,7 +23268,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | null | undefined" ], "path": "src/plugins/data_views/common/types.ts", @@ -22971,7 +24081,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">> | undefined; runtimeFieldMap?: Record" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -23132,7 +24254,7 @@ "description": [ "The ID of this Saved Object, guaranteed to be unique for all objects of the same `type`" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23145,7 +24267,7 @@ "description": [ " The type of Saved Object. Each plugin can define it's own custom Saved Object types." ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23161,7 +24283,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23177,7 +24299,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23193,7 +24315,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23205,10 +24327,16 @@ "label": "error", "description": [], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23224,7 +24352,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23238,10 +24366,16 @@ "{@inheritdoc SavedObjectReference}" ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23255,10 +24389,16 @@ "{@inheritdoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23274,7 +24414,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23290,7 +24430,7 @@ "signature": [ "string[] | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false }, @@ -23306,7 +24446,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-saved-objects-common/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": false, "trackAdoption": false } @@ -23345,7 +24485,13 @@ "text": "SavedObjectsClientCommonFindArgs" }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]>" ], "path": "src/plugins/data_views/common/types.ts", @@ -23389,7 +24535,13 @@ ], "signature": [ "(type: string, id: string) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/common/types.ts", @@ -23452,9 +24604,21 @@ "text": "DataViewAttributes" }, ", options: ", - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/common/types.ts", @@ -23528,7 +24692,13 @@ "- client options" ], "signature": [ - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, "" ], "path": "src/plugins/data_views/common/types.ts", @@ -23558,9 +24728,21 @@ "text": "DataViewAttributes" }, ", options: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/data_views/common/types.ts", @@ -23617,7 +24799,13 @@ "- client options" ], "signature": [ - "SavedObjectsCreateOptions" + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -24171,7 +25359,7 @@ "section": "def-common.DataView", "text": "DataView" }, - ">; delete: (indexPatternId: string) => Promise<{}>; create: ({ id, name, title, ...restOfSpec }: ", + ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", { "pluginId": "dataViews", "scope": "common", @@ -24204,7 +25392,13 @@ "text": "DataViewListItem" }, "[]>; clearCache: () => void; clearInstanceCache: (id?: string | undefined) => void; getCache: () => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -24302,7 +25496,13 @@ "text": "DataViewFieldMap" }, "; savedObjectToSpec: (savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "dataViews", @@ -24425,7 +25625,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">> | undefined; runtimeFieldMap?: Record; }" ], "path": "src/plugins/data_views/common/types.ts", @@ -24526,7 +25738,13 @@ "\nSerialized version of DataViewField" ], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " & { count?: number | undefined; conflictDescriptions?: Record | undefined; format?: ", { "pluginId": "fieldFormats", @@ -24536,7 +25754,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; esTypes?: string[] | undefined; searchable: boolean; aggregatable: boolean; readFromDocValues?: boolean | undefined; indexed?: boolean | undefined; customLabel?: string | undefined; runtimeField?: ", { "pluginId": "dataViews", @@ -24599,7 +25823,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/data_views/common/expressions/load_index_pattern.ts", @@ -24635,7 +25865,13 @@ ], "signature": [ "(error: Error, toastInputFields: ", - "ErrorToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + }, ", key: string) => void" ], "path": "src/plugins/data_views/common/types.ts", @@ -24669,7 +25905,13 @@ "Toast notif config" ], "signature": [ - "ErrorToastOptions" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -24702,7 +25944,13 @@ ], "signature": [ "(toastInputFields: ", - "ToastInputFields", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInputFields", + "text": "ToastInputFields" + }, ", key: string) => void" ], "path": "src/plugins/data_views/common/types.ts", @@ -24723,9 +25971,21 @@ "Pick<", "Toast", ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\" | \"css\"> & { title?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; text?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; }" ], "path": "src/plugins/data_views/common/types.ts", @@ -24924,7 +26184,13 @@ "text": "DataViewSpec" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "dataViews", @@ -24967,7 +26233,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/data_views/common/data_views/persistable_state.ts", diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index 0b70882fda9a5..992d513318623 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] --- import dataViewsObj from './data_views.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1021 | 0 | 229 | 2 | +| 1021 | 0 | 228 | 2 | ## Client diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index dd0bef405d5dd..fb72a70c2c66c 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 36437e5539be4..097cbbb2fdd5a 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -24,15 +24,17 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | alerting, discover, securitySolution | - | | | stackAlerts, alerting, securitySolution, inputControlVis | - | | | actions, alerting | - | -| | savedObjects, embeddable, fleet, visualizations, dashboard, infra, canvas, graph, actions, alerting, enterpriseSearch, securitySolution, taskManager, savedSearch, ml, @kbn/core-saved-objects-server-internal | - | -| | savedObjects, embeddable, fleet, visualizations, dashboard, infra, canvas, graph, actions, alerting, enterpriseSearch, securitySolution, taskManager, savedSearch, ml, @kbn/core-saved-objects-server-internal | - | +| | @kbn/core-saved-objects-common, savedObjects, embeddable, fleet, visualizations, dashboard, infra, canvas, graph, actions, alerting, enterpriseSearch, securitySolution, taskManager, savedSearch, ml, @kbn/core-saved-objects-server-internal | - | +| | @kbn/core-saved-objects-common, savedObjects, embeddable, fleet, visualizations, dashboard, infra, canvas, graph, actions, alerting, enterpriseSearch, securitySolution, taskManager, savedSearch, ml, @kbn/core-saved-objects-server-internal | - | +| | core, savedObjects, embeddable, fleet, visualizations, dashboard, infra, canvas, graph, actions, alerting, enterpriseSearch, securitySolution, taskManager, savedSearch, ml, @kbn/core-saved-objects-server-internal | - | | | discover, maps, monitoring | - | -| | securitySolution, timelines, lists, threatIntelligence, dataViews, dataViewEditor, unifiedSearch, triggersActionsUi, savedObjectsManagement, unifiedFieldList, aiops, presentationUtil, controls, lens, observability, infra, dataVisualizer, ml, fleet, visTypeTimeseries, apm, canvas, reporting, graph, stackAlerts, synthetics, transform, upgradeAssistant, ux, maps, dataViewManagement, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega, discover, data | - | -| | securitySolution, timelines, lists, threatIntelligence, dataViews, dataViewEditor, unifiedSearch, triggersActionsUi, savedObjectsManagement, unifiedFieldList, aiops, presentationUtil, controls, lens, observability, infra, dataVisualizer, ml, fleet, visTypeTimeseries, apm, canvas, reporting, graph, stackAlerts, synthetics, transform, upgradeAssistant, ux, maps, dataViewManagement, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega, discover, data | - | -| | securitySolution, timelines, lists, threatIntelligence, data, dataViewEditor, unifiedSearch, triggersActionsUi, savedObjectsManagement, unifiedFieldList, aiops, presentationUtil, controls, lens, observability, infra, dataVisualizer, ml, fleet, visTypeTimeseries, apm, canvas, reporting, graph, stackAlerts, synthetics, transform, upgradeAssistant, ux, maps, dataViewManagement, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega, discover | - | +| | @kbn/es-query, securitySolution, timelines, lists, threatIntelligence, dataViews, dataViewEditor, unifiedSearch, triggersActionsUi, savedObjectsManagement, unifiedFieldList, aiops, ml, infra, visTypeTimeseries, apm, presentationUtil, controls, lens, observability, dataVisualizer, fleet, canvas, reporting, graph, stackAlerts, synthetics, transform, upgradeAssistant, ux, maps, dataViewManagement, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega, discover, data | - | +| | @kbn/es-query, securitySolution, timelines, lists, threatIntelligence, dataViews, dataViewEditor, unifiedSearch, triggersActionsUi, savedObjectsManagement, unifiedFieldList, aiops, ml, infra, visTypeTimeseries, apm, presentationUtil, controls, lens, observability, dataVisualizer, fleet, canvas, reporting, graph, stackAlerts, synthetics, transform, upgradeAssistant, ux, maps, dataViewManagement, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega, discover, data | - | +| | @kbn/es-query, securitySolution, timelines, lists, threatIntelligence, data, dataViewEditor, unifiedSearch, triggersActionsUi, savedObjectsManagement, unifiedFieldList, aiops, ml, infra, visTypeTimeseries, apm, presentationUtil, controls, lens, observability, dataVisualizer, fleet, canvas, reporting, graph, stackAlerts, synthetics, transform, upgradeAssistant, ux, maps, dataViewManagement, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega, discover | - | | | data, discover, embeddable | - | | | advancedSettings, discover | - | | | advancedSettings, discover | - | +| | advancedSettings, discover | - | | | infra, graph, securitySolution, stackAlerts, inputControlVis, savedObjects | - | | | securitySolution | - | | | encryptedSavedObjects, actions, data, ml, logstash, securitySolution, cloudChat | - | @@ -54,7 +56,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | home, data, esUiShared, spaces, savedObjectsManagement, fleet, observability, ml, apm, indexLifecycleManagement, synthetics, upgradeAssistant, ux, kibanaOverview | - | | | spaces, savedObjectsManagement | - | | | spaces, savedObjectsManagement | - | -| | spaces, ml, canvas, osquery | - | +| | spaces, savedObjectsManagement | - | +| | home, spaces, ml, canvas, osquery | - | | | actions, ml, savedObjectsTagging, enterpriseSearch | - | | | canvas | - | | | canvas | - | @@ -69,31 +72,46 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | dataViewManagement | - | | | dataViewManagement | - | | | enterpriseSearch | - | -| | console, @kbn/core-elasticsearch-server-internal | - | +| | @kbn/core-elasticsearch-server-internal, @kbn/core-plugins-server-internal, console | - | +| | @kbn/core-plugins-server-internal | - | | | spaces, security, alerting | 8.8.0 | | | spaces, security, actions, alerting, ml, remoteClusters, graph, indexLifecycleManagement, mapsEms, painlessLab, rollup, searchprofiler, securitySolution, snapshotRestore, transform, upgradeAssistant | 8.8.0 | | | embeddable, discover, presentationUtil, dashboard, graph | 8.8.0 | | | apm, security, securitySolution | 8.8.0 | | | apm, security, securitySolution | 8.8.0 | -| | visualizations, dashboard, lens, maps, ml, securitySolution, security, @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks | 8.8.0 | -| | securitySolution, @kbn/core-application-browser-internal | 8.8.0 | +| | @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks, visualizations, dashboard, lens, maps, ml, securitySolution, security | 8.8.0 | +| | @kbn/core-application-browser, @kbn/core-application-browser-internal, securitySolution | 8.8.0 | +| | @kbn/core-application-browser-internal, core, securitySolution | 8.8.0 | +| | @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks, visualizations, dashboard, lens, maps, ml, securitySolution, security, core | 8.8.0 | | | maps, dashboard, @kbn/core-saved-objects-migration-server-internal | 8.8.0 | -| | monitoring, kibanaUsageCollection, @kbn/core-apps-browser-internal, @kbn/core-metrics-server-internal, @kbn/core-status-server-internal, @kbn/core-usage-data-server-internal | 8.8.0 | +| | @kbn/core-apps-browser-internal, @kbn/core-metrics-server-internal, @kbn/core-status-server-internal, @kbn/core-usage-data-server-internal, monitoring, kibanaUsageCollection | 8.8.0 | | | savedObjectsTaggingOss, dashboard | 8.8.0 | | | security, licenseManagement, ml, apm, crossClusterReplication, logstash, painlessLab, searchprofiler, watcher | 8.8.0 | +| | apm | 8.8.0 | | | security, fleet | 8.8.0 | | | security, fleet | 8.8.0 | | | security, fleet | 8.8.0 | -| | management, fleet, security, kibanaOverview, @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks | 8.8.0 | -| | apm | 8.8.0 | +| | @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks, management, fleet, security, kibanaOverview | 8.8.0 | +| | @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks, management, fleet, security, kibanaOverview, core | 8.8.0 | | | security | 8.8.0 | | | mapsEms | 8.8.0 | +| | @kbn/core-plugins-server, @kbn/core-plugins-server-internal, core | 8.8.0 | +| | @kbn/core-lifecycle-browser | 8.8.0 | +| | @kbn/core-lifecycle-browser | 8.8.0 | | | ml, @kbn/core-http-browser-internal | 8.8.0 +Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, +so TS and code-reference navigation might not highlight them. | +| | ml, @kbn/core-http-browser-internal | 8.8.0 + Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, so TS and code-reference navigation might not highlight them. | | | @kbn/core-http-browser-internal | 8.8.0 +Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, +so TS and code-reference navigation might not highlight them. | +| | @kbn/core-http-browser-internal | 8.8.0 + Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, so TS and code-reference navigation might not highlight them. | | | security | 8.8.0 @@ -142,19 +160,4 @@ Safe to remove. | | reporting | | | reporting | | | taskManager | -| | core | -| | core | -| | @kbn/storybook | -| | @kbn/core-application-browser | -| | @kbn/core-application-browser | -| | @kbn/core-application-browser | -| | @kbn/core-elasticsearch-server | -| | @kbn/core-http-browser | -| | @kbn/core-http-browser | -| | @kbn/core-injected-metadata-browser | -| | @kbn/core-injected-metadata-browser | -| | @kbn/core-metrics-server | -| | @kbn/core-saved-objects-common | -| | @kbn/core-saved-objects-common | -| | @kbn/core-saved-objects-server | -| | @kbn/core-ui-settings-common | \ No newline at end of file +| | @kbn/storybook | \ No newline at end of file diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index d741999d51363..13621ac820d58 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -7,11 +7,19 @@ 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- +## @kbn/core-application-browser + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [app_leave.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser/src/app_leave.ts#:~:text=AppLeaveHandler), [app_leave.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser/src/app_leave.ts#:~:text=AppLeaveHandler), [app_leave.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser/src/app_leave.ts#:~:text=AppLeaveHandler), [app_leave.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser/src/app_leave.ts#:~:text=AppLeaveHandler), [app_mount.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser/src/app_mount.ts#:~:text=AppLeaveHandler), [app_mount.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser/src/app_mount.ts#:~:text=AppLeaveHandler), [index.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser/index.ts#:~:text=AppLeaveHandler) | 8.8.0 | + + + ## @kbn/core-application-browser-internal | Deprecated API | Reference location(s) | Remove By | @@ -19,6 +27,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=appBasePath) | 8.8.0 | | | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=onAppLeave) | 8.8.0 | | | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=AppLeaveHandler), [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=AppLeaveHandler), [app_router.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_router.tsx#:~:text=AppLeaveHandler), [app_router.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_router.tsx#:~:text=AppLeaveHandler), [application_leave.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_leave.tsx#:~:text=AppLeaveHandler), [application_leave.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_leave.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler) | 8.8.0 | +| | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=AppLeaveHandler), [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=AppLeaveHandler), [app_router.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_router.tsx#:~:text=AppLeaveHandler), [app_router.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_router.tsx#:~:text=AppLeaveHandler), [application_leave.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_leave.tsx#:~:text=AppLeaveHandler), [application_leave.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_leave.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler) | 8.8.0 | +| | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=appBasePath) | 8.8.0 | +| | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=onAppLeave) | 8.8.0 | @@ -28,6 +39,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | ---------------|-----------|-----------| | | [application_service.mock.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-mocks/src/application_service.mock.ts#:~:text=appBasePath) | 8.8.0 | | | [application_service.mock.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-mocks/src/application_service.mock.ts#:~:text=onAppLeave) | 8.8.0 | +| | [application_service.mock.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-mocks/src/application_service.mock.ts#:~:text=appBasePath) | 8.8.0 | +| | [application_service.mock.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-mocks/src/application_service.mock.ts#:~:text=onAppLeave) | 8.8.0 | @@ -35,7 +48,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.test.ts#:~:text=process) | 8.8.0 | +| | [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.test.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process)+ 4 more | 8.8.0 | @@ -43,7 +56,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [elasticsearch_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.ts#:~:text=legacy), [elasticsearch_service.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts#:~:text=legacy) | - | +| | [elasticsearch_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.ts#:~:text=legacy), [elasticsearch_service.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts#:~:text=legacy), [elasticsearch_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.ts#:~:text=legacy), [elasticsearch_service.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts#:~:text=legacy) | - | @@ -59,6 +72,23 @@ so TS and code-reference navigation might not highlight them. | Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, so TS and code-reference navigation might not highlight them. | +| | [http_fetch_error.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=req), [http_fetch_error.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=req) | 8.8.0 + +Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, +so TS and code-reference navigation might not highlight them. | +| | [http_fetch_error.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=res), [http_fetch_error.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=res) | 8.8.0 + +Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, +so TS and code-reference navigation might not highlight them. | + + + +## @kbn/core-lifecycle-browser + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [core_start.ts](https://github.com/elastic/kibana/tree/main/packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts#:~:text=InjectedMetadataStart), [core_start.ts](https://github.com/elastic/kibana/tree/main/packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts#:~:text=InjectedMetadataStart) | 8.8.0 | +| | [core_setup.ts](https://github.com/elastic/kibana/tree/main/packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts#:~:text=InjectedMetadataSetup), [core_setup.ts](https://github.com/elastic/kibana/tree/main/packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts#:~:text=InjectedMetadataSetup) | 8.8.0 | @@ -66,7 +96,34 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [ops_metrics_collector.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.ts#:~:text=process), [get_ops_metrics_log.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.ts#:~:text=process), [get_ops_metrics_log.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.test.ts#:~:text=process) | 8.8.0 | +| | [ops_metrics_collector.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.ts#:~:text=process), [get_ops_metrics_log.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.ts#:~:text=process), [get_ops_metrics_log.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.test.ts#:~:text=process), [ops_metrics_collector.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.ts#:~:text=process), [get_ops_metrics_log.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.ts#:~:text=process), [get_ops_metrics_log.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.test.ts#:~:text=process) | 8.8.0 | + + + +## @kbn/core-plugins-server + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [types.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server/src/types.ts#:~:text=AsyncPlugin), [index.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server/src/index.ts#:~:text=AsyncPlugin), [index.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server/index.ts#:~:text=AsyncPlugin) | 8.8.0 | + + + +## @kbn/core-plugins-server-internal + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [plugin_context.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts#:~:text=legacy), [plugin_context.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts#:~:text=legacy), [plugin_context.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts#:~:text=legacy), [plugin_context.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts#:~:text=legacy) | - | +| | [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin.ts#:~:text=AsyncPlugin), [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin.ts#:~:text=AsyncPlugin), [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin.ts#:~:text=AsyncPlugin), [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin.ts#:~:text=AsyncPlugin) | 8.8.0 | +| | [plugin_manifest_parser.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts#:~:text=extraPublicDirs), [plugin_manifest_parser.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts#:~:text=extraPublicDirs), [plugin_manifest_parser.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts#:~:text=extraPublicDirs), [plugin_manifest_parser.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts#:~:text=extraPublicDirs), [plugin_manifest_parser.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts#:~:text=extraPublicDirs), [plugin_manifest_parser.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts#:~:text=extraPublicDirs), [plugin_manifest_parser.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts#:~:text=extraPublicDirs), [plugin_manifest_parser.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts#:~:text=extraPublicDirs), [plugin_manifest_parser.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts#:~:text=extraPublicDirs), [plugin_manifest_parser.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts#:~:text=extraPublicDirs)+ 2 more | - | + + + +## @kbn/core-saved-objects-common + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [saved_objects.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts#:~:text=SavedObjectAttributes), [saved_objects.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts#:~:text=SavedObjectAttributes), [index.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-common/index.ts#:~:text=SavedObjectAttributes) | - | +| | [saved_objects.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts#:~:text=SavedObjectAttributes), [saved_objects.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts#:~:text=SavedObjectAttributes), [index.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-common/index.ts#:~:text=SavedObjectAttributes) | - | @@ -74,7 +131,7 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [document_migrator.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts#:~:text=warning), [migration_logger.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts#:~:text=warning) | 8.8.0 | +| | [document_migrator.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts#:~:text=warning), [migration_logger.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts#:~:text=warning), [document_migrator.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts#:~:text=warning), [migration_logger.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts#:~:text=warning) | 8.8.0 | @@ -84,6 +141,7 @@ so TS and code-reference navigation might not highlight them. | | ---------------|-----------|-----------| | | [collect_references_deep.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/collect_references_deep.test.ts#:~:text=SavedObjectAttributes), [collect_references_deep.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/collect_references_deep.test.ts#:~:text=SavedObjectAttributes) | - | | | [collect_references_deep.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/collect_references_deep.test.ts#:~:text=SavedObjectAttributes), [collect_references_deep.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/collect_references_deep.test.ts#:~:text=SavedObjectAttributes) | - | +| | [collect_references_deep.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/collect_references_deep.test.ts#:~:text=SavedObjectAttributes), [collect_references_deep.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/collect_references_deep.test.ts#:~:text=SavedObjectAttributes) | - | @@ -91,7 +149,7 @@ so TS and code-reference navigation might not highlight them. | | 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=process), [status.ts](https://github.com/elastic/kibana/tree/main/packages/core/status/core-status-server-internal/src/routes/status.ts#:~:text=process) | 8.8.0 | +| | [status.ts](https://github.com/elastic/kibana/tree/main/packages/core/status/core-status-server-internal/src/routes/status.ts#:~:text=process), [status.ts](https://github.com/elastic/kibana/tree/main/packages/core/status/core-status-server-internal/src/routes/status.ts#:~:text=process), [status.ts](https://github.com/elastic/kibana/tree/main/packages/core/status/core-status-server-internal/src/routes/status.ts#:~:text=process), [status.ts](https://github.com/elastic/kibana/tree/main/packages/core/status/core-status-server-internal/src/routes/status.ts#:~:text=process) | 8.8.0 | @@ -99,7 +157,17 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [core_usage_data_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts#:~:text=process), [core_usage_data_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts#:~:text=process), [core_usage_data_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts#:~:text=process) | 8.8.0 | +| | [core_usage_data_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts#:~:text=process), [core_usage_data_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts#:~:text=process), [core_usage_data_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts#:~:text=process), [core_usage_data_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts#:~:text=process), [core_usage_data_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts#:~:text=process), [core_usage_data_service.ts](https://github.com/elastic/kibana/tree/main/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts#:~:text=process) | 8.8.0 | + + + +## @kbn/es-query + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [types.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/types.ts#:~:text=title), [build_es_query.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/build_es_query.test.ts#:~:text=title), [from_filters.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/from_filters.test.ts#:~:text=title), [from_filters.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/from_filters.test.ts#:~:text=title), [from_kuery.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/from_kuery.test.ts#:~:text=title), [handle_combined_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/handle_combined_filter.test.ts#:~:text=title), [handle_nested_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/handle_nested_filter.test.ts#:~:text=title), [build_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/filters/build_filters/build_filter.test.ts#:~:text=title), [exists_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/filters/build_filters/exists_filter.test.ts#:~:text=title), [get_filter_field.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/filters/build_filters/get_filter_field.test.ts#:~:text=title)+ 36 more | - | +| | [types.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/types.ts#:~:text=title), [build_es_query.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/build_es_query.test.ts#:~:text=title), [from_filters.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/from_filters.test.ts#:~:text=title), [from_filters.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/from_filters.test.ts#:~:text=title), [from_kuery.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/from_kuery.test.ts#:~:text=title), [handle_combined_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/handle_combined_filter.test.ts#:~:text=title), [handle_nested_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/handle_nested_filter.test.ts#:~:text=title), [build_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/filters/build_filters/build_filter.test.ts#:~:text=title), [exists_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/filters/build_filters/exists_filter.test.ts#:~:text=title), [get_filter_field.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/filters/build_filters/get_filter_field.test.ts#:~:text=title)+ 36 more | - | +| | [types.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/types.ts#:~:text=title), [build_es_query.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/build_es_query.test.ts#:~:text=title), [from_filters.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/from_filters.test.ts#:~:text=title), [from_filters.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/from_filters.test.ts#:~:text=title), [from_kuery.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/from_kuery.test.ts#:~:text=title), [handle_combined_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/handle_combined_filter.test.ts#:~:text=title), [handle_nested_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/es_query/handle_nested_filter.test.ts#:~:text=title), [build_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/filters/build_filters/build_filter.test.ts#:~:text=title), [exists_filter.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/filters/build_filters/exists_filter.test.ts#:~:text=title), [get_filter_field.test.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-es-query/src/filters/build_filters/get_filter_field.test.ts#:~:text=title)+ 13 more | - | @@ -113,6 +181,7 @@ so TS and code-reference navigation might not highlight them. | | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/plugin.ts#:~:text=index), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/plugin.ts#:~:text=index) | - | | | [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/types.ts#:~:text=SavedObjectAttributes)+ 3 more | - | | | [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/types.ts#:~:text=SavedObjectAttributes)+ 3 more | - | +| | [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [actions_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/actions_client.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/server/types.ts#:~:text=SavedObjectAttributes)+ 3 more | - | @@ -122,6 +191,7 @@ so TS and code-reference navigation might not highlight them. | | ---------------|-----------|-----------| | | [to_editable_config.ts](https://github.com/elastic/kibana/tree/main/src/plugins/advanced_settings/public/management_app/lib/to_editable_config.ts#:~:text=metric) | - | | | [to_editable_config.ts](https://github.com/elastic/kibana/tree/main/src/plugins/advanced_settings/public/management_app/lib/to_editable_config.ts#:~:text=metric) | - | +| | [to_editable_config.ts](https://github.com/elastic/kibana/tree/main/src/plugins/advanced_settings/public/management_app/lib/to_editable_config.ts#:~:text=metric) | - | @@ -148,6 +218,7 @@ so TS and code-reference navigation might not highlight them. | | | [task.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/usage/task.ts#:~:text=index) | - | | | [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts#:~:text=SavedObjectAttributes), [migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/types.ts#:~:text=SavedObjectAttributes)+ 11 more | - | | | [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts#:~:text=SavedObjectAttributes), [migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/types.ts#:~:text=SavedObjectAttributes)+ 11 more | - | +| | [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/common/rule.ts#:~:text=SavedObjectAttributes), [migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts#:~:text=SavedObjectAttributes), [migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/alerting/server/types.ts#:~:text=SavedObjectAttributes)+ 11 more | - | @@ -170,9 +241,9 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title) | - | -| | [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title) | - | -| | [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title) | - | +| | [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.tsx#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [datasource_component.js](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/datasource/datasource_component.js#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title)+ 4 more | - | +| | [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.tsx#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [datasource_component.js](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/datasource/datasource_component.js#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title)+ 4 more | - | +| | [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.component.tsx#:~:text=title), [es_data_view_select.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/es_data_view_select/es_data_view_select.tsx#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/services/kibana/data_views.ts#:~:text=title), [datasource_component.js](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/datasource/datasource_component.js#:~:text=title) | - | | | [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), [esdocs.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/esdocs.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), [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) | - | @@ -186,6 +257,7 @@ so TS and code-reference navigation might not highlight them. | | | [home.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/home/home.component.tsx#:~:text=KibanaPageTemplate), [home.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/home/home.component.tsx#:~:text=KibanaPageTemplate), [home.component.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/home/home.component.tsx#:~:text=KibanaPageTemplate) | - | | | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/shareable_runtime/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/shareable_runtime/types.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/custom_elements/find.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/custom_elements/find.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/workpad/find.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/workpad/find.ts#:~:text=SavedObjectAttributes) | - | | | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/shareable_runtime/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/shareable_runtime/types.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/custom_elements/find.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/custom_elements/find.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/workpad/find.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/workpad/find.ts#:~:text=SavedObjectAttributes) | - | +| | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/shareable_runtime/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/shareable_runtime/types.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/custom_elements/find.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/custom_elements/find.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/workpad/find.ts#:~:text=SavedObjectAttributes), [find.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/workpad/find.ts#:~:text=SavedObjectAttributes) | - | @@ -209,7 +281,7 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [plugin.ts](https://github.com/elastic/kibana/tree/main/src/plugins/console/server/plugin.ts#:~:text=legacy) | - | +| | [plugin.ts](https://github.com/elastic/kibana/tree/main/src/plugins/console/server/plugin.ts#:~:text=legacy), [plugin.ts](https://github.com/elastic/kibana/tree/main/src/plugins/console/server/plugin.ts#:~:text=legacy) | - | @@ -223,6 +295,18 @@ so TS and code-reference navigation might not highlight them. | +## core + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=AppLeaveHandler) | 8.8.0 | +| | [mocks.ts](https://github.com/elastic/kibana/tree/main/src/core/public/mocks.ts#:~:text=appBasePath) | 8.8.0 | +| | [mocks.ts](https://github.com/elastic/kibana/tree/main/src/core/public/mocks.ts#:~:text=onAppLeave) | 8.8.0 | +| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/server/index.ts#:~:text=AsyncPlugin) | 8.8.0 | +| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectAttributes), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/server/index.ts#:~:text=SavedObjectAttributes), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/core/server/types.ts#:~:text=SavedObjectAttributes) | - | + + + ## crossClusterReplication | Deprecated API | Reference location(s) | Remove By | @@ -242,7 +326,9 @@ so TS and code-reference navigation might not highlight them. | | | [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/types.ts#:~:text=onAppLeave), [plugin.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/plugin.tsx#:~:text=onAppLeave) | 8.8.0 | | | [load_dashboard_state_from_saved_object.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_saved_object/lib/load_dashboard_state_from_saved_object.ts#:~:text=SavedObjectAttributes), [load_dashboard_state_from_saved_object.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_saved_object/lib/load_dashboard_state_from_saved_object.ts#:~:text=SavedObjectAttributes), [migrate_extract_panel_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_extract_panel_references.ts#:~:text=SavedObjectAttributes), [migrate_extract_panel_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_extract_panel_references.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry_collection_task.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry_collection_task.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry_collection_task.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry.ts#:~:text=SavedObjectAttributes), [find_by_value_embeddables.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/find_by_value_embeddables.ts#:~:text=SavedObjectAttributes)+ 11 more | - | | | [load_dashboard_state_from_saved_object.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_saved_object/lib/load_dashboard_state_from_saved_object.ts#:~:text=SavedObjectAttributes), [load_dashboard_state_from_saved_object.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_saved_object/lib/load_dashboard_state_from_saved_object.ts#:~:text=SavedObjectAttributes), [migrate_extract_panel_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_extract_panel_references.ts#:~:text=SavedObjectAttributes), [migrate_extract_panel_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_extract_panel_references.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry_collection_task.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry_collection_task.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry_collection_task.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry.ts#:~:text=SavedObjectAttributes), [find_by_value_embeddables.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/find_by_value_embeddables.ts#:~:text=SavedObjectAttributes)+ 11 more | - | -| | [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning), [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning) | 8.8.0 | +| | [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning), [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning), [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning), [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning) | 8.8.0 | +| | [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/types.ts#:~:text=onAppLeave), [plugin.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/plugin.tsx#:~:text=onAppLeave) | 8.8.0 | +| | [load_dashboard_state_from_saved_object.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_saved_object/lib/load_dashboard_state_from_saved_object.ts#:~:text=SavedObjectAttributes), [load_dashboard_state_from_saved_object.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_saved_object/lib/load_dashboard_state_from_saved_object.ts#:~:text=SavedObjectAttributes), [migrate_extract_panel_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_extract_panel_references.ts#:~:text=SavedObjectAttributes), [migrate_extract_panel_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_extract_panel_references.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry_collection_task.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry_collection_task.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry_collection_task.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry.ts#:~:text=SavedObjectAttributes), [dashboard_telemetry.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/dashboard_telemetry.ts#:~:text=SavedObjectAttributes), [find_by_value_embeddables.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/usage/find_by_value_embeddables.ts#:~:text=SavedObjectAttributes)+ 11 more | - | @@ -331,6 +417,7 @@ so TS and code-reference navigation might not highlight them. | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=executeTriggerActions), [search_embeddable_factory.ts](https://github.com/elastic/kibana/tree/main/src/plugins/discover/public/embeddable/search_embeddable_factory.ts#:~:text=executeTriggerActions), [plugin.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/discover/public/plugin.tsx#:~:text=executeTriggerActions) | - | | | [ui_settings.ts](https://github.com/elastic/kibana/tree/main/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/main/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/main/src/plugins/discover/server/ui_settings.ts#:~:text=metric) | - | | | [ui_settings.ts](https://github.com/elastic/kibana/tree/main/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/main/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/main/src/plugins/discover/server/ui_settings.ts#:~:text=metric) | - | +| | [ui_settings.ts](https://github.com/elastic/kibana/tree/main/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/main/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/main/src/plugins/discover/server/ui_settings.ts#:~:text=metric) | - | @@ -350,6 +437,7 @@ so TS and code-reference navigation might not highlight them. | | | [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), [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) | - | | | [add_panel_flyout.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx#:~:text=SavedObjectAttributes), [add_panel_flyout.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx#:~:text=SavedObjectAttributes), [add_panel_flyout.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx#:~: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), [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) | - | | | [add_panel_flyout.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx#:~:text=SavedObjectAttributes), [add_panel_flyout.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx#:~:text=SavedObjectAttributes), [add_panel_flyout.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx#:~: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), [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) | - | +| | [add_panel_flyout.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx#:~:text=SavedObjectAttributes), [add_panel_flyout.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx#:~:text=SavedObjectAttributes), [add_panel_flyout.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx#:~: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), [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) | - | @@ -369,6 +457,7 @@ so TS and code-reference navigation might not highlight them. | | | [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) | - | | | [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) | - | +| | [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) | - | @@ -392,9 +481,9 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [filter_dataset.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx#:~:text=title), [filter_log_level.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx#:~:text=title), [query_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=title), [search_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=title), [filter_dataset.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx#:~:text=title), [filter_log_level.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx#:~:text=title), [query_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=title), [search_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=title) | - | -| | [filter_dataset.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx#:~:text=title), [filter_log_level.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx#:~:text=title), [query_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=title), [search_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=title), [filter_dataset.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx#:~:text=title), [filter_log_level.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx#:~:text=title), [query_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=title), [search_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=title) | - | -| | [filter_dataset.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx#:~:text=title), [filter_log_level.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx#:~:text=title), [query_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=title), [search_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=title) | - | +| | [filter_dataset.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx#:~:text=title), [filter_log_level.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx#:~:text=title), [query_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=title), [filter_dataset.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx#:~:text=title), [filter_log_level.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx#:~:text=title), [query_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=title) | - | +| | [filter_dataset.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx#:~:text=title), [filter_log_level.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx#:~:text=title), [query_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=title), [filter_dataset.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx#:~:text=title), [filter_log_level.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx#:~:text=title), [query_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=title) | - | +| | [filter_dataset.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx#:~:text=title), [filter_log_level.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx#:~:text=title), [query_bar.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=title) | - | | | [use_get_logs_discover_link.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/hooks/use_get_logs_discover_link.tsx#:~:text=indexPatternId) | - | | | [tutorial_directory_header_link.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/components/home_integration/tutorial_directory_header_link.tsx#:~:text=RedirectAppLinks), [tutorial_directory_header_link.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/components/home_integration/tutorial_directory_header_link.tsx#:~:text=RedirectAppLinks), [tutorial_directory_header_link.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/components/home_integration/tutorial_directory_header_link.tsx#:~:text=RedirectAppLinks), [custom_assets_accordion.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/components/custom_assets_accordion.tsx#:~:text=RedirectAppLinks), [custom_assets_accordion.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/components/custom_assets_accordion.tsx#:~:text=RedirectAppLinks), [custom_assets_accordion.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/components/custom_assets_accordion.tsx#:~:text=RedirectAppLinks), [agent_logs.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx#:~:text=RedirectAppLinks), [agent_logs.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx#:~:text=RedirectAppLinks), [agent_logs.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx#:~:text=RedirectAppLinks), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/integrations/app.tsx#:~:text=RedirectAppLinks)+ 5 more | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/server/plugin.ts#:~:text=disabled) | 8.8.0 | @@ -403,6 +492,8 @@ so TS and code-reference navigation might not highlight them. | | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/integrations/index.tsx#:~:text=appBasePath) | 8.8.0 | | | [epm.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/epm.ts#:~:text=SavedObjectAttributes), [epm.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/epm.ts#:~:text=SavedObjectAttributes), [settings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/settings.ts#:~:text=SavedObjectAttributes), [settings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/settings.ts#:~:text=SavedObjectAttributes) | - | | | [epm.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/epm.ts#:~:text=SavedObjectAttributes), [epm.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/epm.ts#:~:text=SavedObjectAttributes), [settings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/settings.ts#:~:text=SavedObjectAttributes), [settings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/settings.ts#:~:text=SavedObjectAttributes) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/integrations/index.tsx#:~:text=appBasePath) | 8.8.0 | +| | [epm.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/epm.ts#:~:text=SavedObjectAttributes), [epm.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/epm.ts#:~:text=SavedObjectAttributes), [settings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/settings.ts#:~:text=SavedObjectAttributes), [settings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/common/types/models/settings.ts#:~:text=SavedObjectAttributes) | - | @@ -421,6 +512,7 @@ so TS and code-reference navigation might not highlight them. | | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/server/plugin.ts#:~:text=license%24) | 8.8.0 | | | [saved_workspace_references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts#:~:text=SavedObjectAttributes), [saved_workspace_references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts#:~:text=SavedObjectAttributes), [saved_workspace_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts#:~:text=SavedObjectAttributes), [saved_workspace_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts#:~:text=SavedObjectAttributes) | - | | | [saved_workspace_references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts#:~:text=SavedObjectAttributes), [saved_workspace_references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts#:~:text=SavedObjectAttributes), [saved_workspace_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts#:~:text=SavedObjectAttributes), [saved_workspace_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts#:~:text=SavedObjectAttributes) | - | +| | [saved_workspace_references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts#:~:text=SavedObjectAttributes), [saved_workspace_references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts#:~:text=SavedObjectAttributes), [saved_workspace_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts#:~:text=SavedObjectAttributes), [saved_workspace_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts#:~:text=SavedObjectAttributes) | - | @@ -428,7 +520,8 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/application.tsx#:~:text=RedirectAppLinks), [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/application.tsx#:~:text=RedirectAppLinks), [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/application.tsx#:~:text=RedirectAppLinks), [add_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/add_data/add_data.tsx#:~:text=RedirectAppLinks), [add_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/add_data/add_data.tsx#:~:text=RedirectAppLinks), [add_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/add_data/add_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks)+ 1 more | - | +| | [tutorial_directory.js](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/tutorial_directory.js#:~:text=KibanaPageTemplate), [tutorial_directory.js](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/tutorial_directory.js#:~:text=KibanaPageTemplate), [tutorial_directory.js](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/tutorial_directory.js#:~:text=KibanaPageTemplate), [tutorial.js](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/tutorial/tutorial.js#:~:text=KibanaPageTemplate), [tutorial.js](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/tutorial/tutorial.js#:~:text=KibanaPageTemplate), [tutorial.js](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/tutorial/tutorial.js#:~:text=KibanaPageTemplate), [tutorial.js](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/tutorial/tutorial.js#:~:text=KibanaPageTemplate) | - | +| | [add_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/add_data/add_data.tsx#:~:text=RedirectAppLinks), [add_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/add_data/add_data.tsx#:~:text=RedirectAppLinks), [add_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/add_data/add_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks), [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/application.tsx#:~:text=RedirectAppLinks), [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/home/public/application/application.tsx#:~:text=RedirectAppLinks)+ 1 more | - | @@ -446,11 +539,12 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [use_kibana_index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_kibana_index_patterns.ts#:~:text=indexPatterns) | - | -| | [resolved_log_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/log_views/resolved_log_view.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [resolved_log_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/log_views/resolved_log_view.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title)+ 6 more | - | -| | [resolved_log_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/log_views/resolved_log_view.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [resolved_log_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/log_views/resolved_log_view.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title)+ 6 more | - | -| | [resolved_log_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/log_views/resolved_log_view.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title) | - | +| | [resolved_log_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/log_views/resolved_log_view.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [use_data_view.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts#:~:text=title), [resolved_log_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/log_views/resolved_log_view.ts#:~:text=title)+ 8 more | - | +| | [resolved_log_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/log_views/resolved_log_view.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [use_data_view.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts#:~:text=title), [resolved_log_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/log_views/resolved_log_view.ts#:~:text=title)+ 8 more | - | +| | [resolved_log_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/log_views/resolved_log_view.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [validation_errors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=title), [use_data_view.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts#:~:text=title) | - | | | [use_find_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_find_saved_object.tsx#:~:text=SavedObjectAttributes), [use_find_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_find_saved_object.tsx#:~:text=SavedObjectAttributes), [use_create_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx#:~:text=SavedObjectAttributes), [use_create_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx#:~:text=SavedObjectAttributes), [use_create_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx#:~:text=SavedObjectAttributes), [use_get_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_get_saved_object.tsx#:~:text=SavedObjectAttributes), [use_get_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_get_saved_object.tsx#:~:text=SavedObjectAttributes), [use_update_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx#:~:text=SavedObjectAttributes), [use_update_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx#:~:text=SavedObjectAttributes), [use_update_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx#:~:text=SavedObjectAttributes)+ 2 more | - | | | [use_find_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_find_saved_object.tsx#:~:text=SavedObjectAttributes), [use_find_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_find_saved_object.tsx#:~:text=SavedObjectAttributes), [use_create_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx#:~:text=SavedObjectAttributes), [use_create_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx#:~:text=SavedObjectAttributes), [use_create_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx#:~:text=SavedObjectAttributes), [use_get_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_get_saved_object.tsx#:~:text=SavedObjectAttributes), [use_get_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_get_saved_object.tsx#:~:text=SavedObjectAttributes), [use_update_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx#:~:text=SavedObjectAttributes), [use_update_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx#:~:text=SavedObjectAttributes), [use_update_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx#:~:text=SavedObjectAttributes)+ 2 more | - | +| | [use_find_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_find_saved_object.tsx#:~:text=SavedObjectAttributes), [use_find_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_find_saved_object.tsx#:~:text=SavedObjectAttributes), [use_create_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx#:~:text=SavedObjectAttributes), [use_create_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx#:~:text=SavedObjectAttributes), [use_create_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx#:~:text=SavedObjectAttributes), [use_get_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_get_saved_object.tsx#:~:text=SavedObjectAttributes), [use_get_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_get_saved_object.tsx#:~:text=SavedObjectAttributes), [use_update_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx#:~:text=SavedObjectAttributes), [use_update_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx#:~:text=SavedObjectAttributes), [use_update_saved_object.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx#:~:text=SavedObjectAttributes)+ 2 more | - | @@ -473,6 +567,7 @@ so TS and code-reference navigation might not highlight them. | | ---------------|-----------|-----------| | | [add_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_overview/public/components/add_data/add_data.tsx#:~:text=RedirectAppLinks), [add_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_overview/public/components/add_data/add_data.tsx#:~:text=RedirectAppLinks), [add_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_overview/public/components/add_data/add_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks), [manage_data.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx#:~:text=RedirectAppLinks) | - | | | [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_overview/public/application.tsx#:~:text=appBasePath) | 8.8.0 | +| | [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_overview/public/application.tsx#:~:text=appBasePath) | 8.8.0 | @@ -480,7 +575,7 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [ops_stats_collector.ts](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts#:~:text=process) | 8.8.0 | +| | [ops_stats_collector.ts](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts#:~:text=process), [ops_stats_collector.ts](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts#:~:text=process) | 8.8.0 | @@ -488,10 +583,11 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.ts#:~:text=title), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.ts#:~:text=title), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title) | - | -| | [loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.ts#:~:text=title), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.ts#:~:text=title), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title) | - | -| | [loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.ts#:~:text=title), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title), [loader.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.test.ts#:~:text=title) | - | +| | [loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.ts#:~:text=title), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=title), [loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.ts#:~:text=title), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=title) | - | +| | [loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.ts#:~:text=title), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=title), [loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.ts#:~:text=title), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=title) | - | +| | [loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/data_views_service/loader.ts#:~:text=title), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=title) | - | | | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [mounter.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/mounter.tsx#:~:text=onAppLeave) | 8.8.0 | +| | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [mounter.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/mounter.tsx#:~:text=onAppLeave) | 8.8.0 | @@ -527,6 +623,7 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/management/public/application.tsx#:~:text=appBasePath) | 8.8.0 | +| | [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/management/public/application.tsx#:~:text=appBasePath) | 8.8.0 | @@ -542,7 +639,8 @@ so TS and code-reference navigation might not highlight them. | | | [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=title) | - | | | [es_search_source.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit) | - | | | [render_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/render_app.tsx#:~:text=onAppLeave), [map_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx#:~:text=onAppLeave), [map_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/routes/map_page/map_page.tsx#:~:text=onAppLeave) | 8.8.0 | -| | [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts#:~:text=warning) | 8.8.0 | +| | [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts#:~:text=warning), [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts#:~:text=warning) | 8.8.0 | +| | [render_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/render_app.tsx#:~:text=onAppLeave), [map_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx#:~:text=onAppLeave), [map_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/routes/map_page/map_page.tsx#:~:text=onAppLeave) | 8.8.0 | @@ -559,9 +657,9 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title), [data_loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title)+ 76 more | - | -| | [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title), [data_loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title)+ 76 more | - | -| | [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title), [data_loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title)+ 33 more | - | +| | [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=title), [rollup.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=title), [alerting_service.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts#:~:text=title), [data_recognizer.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title)+ 76 more | - | +| | [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=title), [rollup.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=title), [alerting_service.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts#:~:text=title), [data_recognizer.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title)+ 76 more | - | +| | [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=title), [rollup.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=title), [alerting_service.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts#:~:text=title), [data_recognizer.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [index_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=title), [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title)+ 33 more | - | | | [ml_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx#:~:text=KibanaPageTemplate), [ml_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx#:~:text=KibanaPageTemplate), [ml_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx#:~:text=KibanaPageTemplate) | - | | | [ml_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx#:~:text=RedirectAppLinks), [ml_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx#:~:text=RedirectAppLinks), [ml_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx#:~:text=RedirectAppLinks), [jobs_list_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx#:~:text=RedirectAppLinks), [jobs_list_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx#:~:text=RedirectAppLinks), [jobs_list_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx#:~:text=RedirectAppLinks) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/plugin.ts#:~:text=license%24) | 8.8.0 | @@ -575,6 +673,12 @@ so TS and code-reference navigation might not highlight them. | Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, so TS and code-reference navigation might not highlight them. | | | [modules.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/common/types/modules.ts#:~:text=SavedObjectAttributes), [modules.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/common/types/modules.ts#:~:text=SavedObjectAttributes) | - | +| | [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/app.tsx#:~:text=onAppLeave) | 8.8.0 | +| | [errors.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/common/util/errors/errors.test.ts#:~:text=req), [errors.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/common/util/errors/errors.test.ts#:~:text=req) | 8.8.0 + +Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, +so TS and code-reference navigation might not highlight them. | +| | [modules.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/common/types/modules.ts#:~:text=SavedObjectAttributes), [modules.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/common/types/modules.ts#:~:text=SavedObjectAttributes) | - | @@ -583,7 +687,7 @@ so TS and code-reference navigation might not highlight them. | | 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) | - | -| | [bulk_uploader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts#:~:text=process) | 8.8.0 | +| | [bulk_uploader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts#:~:text=process), [bulk_uploader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts#:~:text=process) | 8.8.0 | @@ -661,6 +765,7 @@ so TS and code-reference navigation might not highlight them. | | | [saved_object.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=indexPatterns), [saved_object.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=indexPatterns) | - | | | [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [create_source.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/create_source.ts#:~:text=SavedObjectAttributes), [create_source.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/create_source.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/find_object_by_title.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/find_object_by_title.ts#:~:text=SavedObjectAttributes), [save_with_confirmation.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts#:~:text=SavedObjectAttributes)+ 15 more | - | | | [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [create_source.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/create_source.ts#:~:text=SavedObjectAttributes), [create_source.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/create_source.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/find_object_by_title.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/find_object_by_title.ts#:~:text=SavedObjectAttributes), [save_with_confirmation.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts#:~:text=SavedObjectAttributes)+ 15 more | - | +| | [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/types.ts#:~:text=SavedObjectAttributes), [create_source.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/create_source.ts#:~:text=SavedObjectAttributes), [create_source.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/create_source.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/find_object_by_title.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/find_object_by_title.ts#:~:text=SavedObjectAttributes), [save_with_confirmation.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts#:~:text=SavedObjectAttributes)+ 15 more | - | @@ -674,6 +779,7 @@ so TS and code-reference navigation might not highlight them. | | | [saved_objects_edition_page.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_management/public/management_section/saved_objects_edition_page.tsx#:~:text=RedirectAppLinks), [saved_objects_edition_page.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_management/public/management_section/saved_objects_edition_page.tsx#:~:text=RedirectAppLinks), [saved_objects_edition_page.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_management/public/management_section/saved_objects_edition_page.tsx#:~:text=RedirectAppLinks), [saved_objects_table.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx#:~:text=RedirectAppLinks), [saved_objects_table.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx#:~:text=RedirectAppLinks), [saved_objects_table.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx#:~:text=RedirectAppLinks) | - | | | [resolve_import_errors.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_management/public/lib/resolve_import_errors.ts#:~:text=createNewCopy) | - | | | [resolve_import_errors.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_management/public/lib/resolve_import_errors.ts#:~:text=createNewCopy) | - | +| | [resolve_import_errors.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_management/public/lib/resolve_import_errors.ts#:~:text=createNewCopy) | - | @@ -699,6 +805,7 @@ so TS and code-reference navigation might not highlight them. | | ---------------|-----------|-----------| | | [search_migrations.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_search/server/saved_objects/search_migrations.ts#:~:text=SavedObjectAttributes), [search_migrations.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_search/server/saved_objects/search_migrations.ts#:~:text=SavedObjectAttributes) | - | | | [search_migrations.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_search/server/saved_objects/search_migrations.ts#:~:text=SavedObjectAttributes), [search_migrations.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_search/server/saved_objects/search_migrations.ts#:~:text=SavedObjectAttributes) | - | +| | [search_migrations.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_search/server/saved_objects/search_migrations.ts#:~:text=SavedObjectAttributes), [search_migrations.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_search/server/saved_objects/search_migrations.ts#:~:text=SavedObjectAttributes) | - | @@ -715,13 +822,13 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | +| | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | | | [disable_ui_capabilities.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts#:~:text=requiredRoles) | 8.8.0 This is relied on by the reporting feature, and should be removed once reporting migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/issues/19914 | -| | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | -| | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | +| | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | +| | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | | | [disable_ui_capabilities.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts#:~:text=requiredRoles) | 8.8.0 This is relied on by the reporting feature, and should be removed once reporting @@ -734,6 +841,8 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [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) | 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=onAppLeave) | 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) | 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=onAppLeave) | 8.8.0 | @@ -758,6 +867,9 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx#:~:text=AppLeaveHandler), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/types.ts#:~:text=AppLeaveHandler), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/types.ts#:~:text=AppLeaveHandler), [routes.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/routes.tsx#:~:text=AppLeaveHandler), [routes.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/routes.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [use_timeline_save_prompt.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts#:~:text=AppLeaveHandler)+ 1 more | 8.8.0 | | | [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) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx#:~:text=AppLeaveHandler), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/types.ts#:~:text=AppLeaveHandler), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/types.ts#:~:text=AppLeaveHandler), [routes.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/routes.tsx#:~:text=AppLeaveHandler), [routes.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/routes.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [use_timeline_save_prompt.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts#:~:text=AppLeaveHandler)+ 1 more | 8.8.0 | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/index.tsx#:~:text=onAppLeave), [plugin.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/plugin.tsx#:~:text=onAppLeave) | 8.8.0 | +| | [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) | - | @@ -779,6 +891,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [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 | | | [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) | - | | | [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) | - | +| | [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) | - | @@ -786,13 +899,13 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [fetch_search_source_query.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts#:~:text=fetch), [rule_type.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts#:~:text=fetch), [rule_type.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts#:~:text=fetch) | - | -| | [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=indexPatterns), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns) | - | -| | [expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx#:~:text=fieldFormats) | - | -| | [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=title), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=title), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=title)+ 8 more | - | -| | [fetch_search_source_query.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts#:~:text=fetch), [rule_type.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts#:~:text=fetch), [rule_type.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts#:~:text=fetch) | - | -| | [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=title), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=title), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=title)+ 8 more | - | -| | [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=title), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=title), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=title) | - | +| | [fetch_search_source_query.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_search_source_query.ts#:~:text=fetch), [rule_type.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts#:~:text=fetch), [rule_type.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts#:~:text=fetch) | - | +| | [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=indexPatterns), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns) | - | +| | [expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.tsx#:~:text=fieldFormats) | - | +| | [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=title), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx#:~:text=title), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=title)+ 8 more | - | +| | [fetch_search_source_query.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_search_source_query.ts#:~:text=fetch), [rule_type.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts#:~:text=fetch), [rule_type.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts#:~:text=fetch) | - | +| | [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=title), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx#:~:text=title), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=title)+ 8 more | - | +| | [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=title), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx#:~:text=title), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx#:~:text=title) | - | @@ -814,6 +927,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | ---------------|-----------|-----------| | | [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) | - | @@ -862,9 +976,9 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title), [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title)+ 2 more | - | -| | [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title), [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title)+ 2 more | - | -| | [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title) | - | +| | [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [use_existing_fields.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/hooks/use_existing_fields.ts#:~:text=title), [use_existing_fields.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/hooks/use_existing_fields.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title), [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title)+ 6 more | - | +| | [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [use_existing_fields.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/hooks/use_existing_fields.ts#:~:text=title), [use_existing_fields.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/hooks/use_existing_fields.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title), [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title)+ 6 more | - | +| | [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/services/field_stats/load_field_stats.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [field_existing_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/common/utils/field_existing_utils.ts#:~:text=title), [use_existing_fields.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/hooks/use_existing_fields.ts#:~:text=title), [use_existing_fields.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/public/hooks/use_existing_fields.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title), [field_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/server/routes/field_stats.ts#:~:text=title) | - | @@ -970,6 +1084,8 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/index.tsx#:~:text=onAppLeave) | 8.8.0 | | | [save_with_confirmation.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts#:~:text=SavedObjectAttributes), [save_with_confirmation.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.ts#:~:text=SavedObjectAttributes), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectAttributes), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes)+ 13 more | - | | | [save_with_confirmation.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts#:~:text=SavedObjectAttributes), [save_with_confirmation.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.ts#:~:text=SavedObjectAttributes), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectAttributes), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes)+ 13 more | - | +| | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/index.tsx#:~:text=onAppLeave) | 8.8.0 | +| | [save_with_confirmation.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts#:~:text=SavedObjectAttributes), [save_with_confirmation.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.ts#:~:text=SavedObjectAttributes), [find_object_by_title.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.ts#:~:text=SavedObjectAttributes), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectAttributes), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes)+ 13 more | - | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index 1acb6bf498874..3a1e40507f7f9 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -48,6 +48,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | fleet | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/server/plugin.ts#:~:text=disabled) | 8.8.0 | | fleet | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/server/plugin.ts#:~:text=disabled) | 8.8.0 | | fleet | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/integrations/index.tsx#:~:text=appBasePath) | 8.8.0 | +| fleet | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/fleet/public/applications/integrations/index.tsx#:~:text=appBasePath) | 8.8.0 | @@ -56,7 +57,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| | maps | | [render_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/render_app.tsx#:~:text=onAppLeave), [map_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx#:~:text=onAppLeave), [map_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/routes/map_page/map_page.tsx#:~:text=onAppLeave) | 8.8.0 | -| maps | | [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts#:~:text=warning) | 8.8.0 | +| maps | | [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts#:~:text=warning), [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts#:~:text=warning) | 8.8.0 | +| maps | | [render_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/render_app.tsx#:~:text=onAppLeave), [map_app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx#:~:text=onAppLeave), [map_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/maps/public/routes/map_page/map_page.tsx#:~:text=onAppLeave) | 8.8.0 | | mapsEms | | [index.ts](https://github.com/elastic/kibana/tree/main/src/plugins/maps_ems/server/index.ts#:~:text=license%24) | 8.8.0 | | mapsEms | | [index.ts](https://github.com/elastic/kibana/tree/main/src/plugins/maps_ems/server/index.ts#:~:text=refresh) | 8.8.0 | @@ -67,9 +69,12 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| | kibanaOverview | | [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_overview/public/application.tsx#:~:text=appBasePath), [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=appBasePath), [application_service.mock.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-mocks/src/application_service.mock.ts#:~:text=appBasePath) | 8.8.0 | +| kibanaOverview | | [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_overview/public/application.tsx#:~:text=appBasePath), [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=appBasePath), [application_service.mock.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-mocks/src/application_service.mock.ts#:~:text=appBasePath), [mocks.ts](https://github.com/elastic/kibana/tree/main/src/core/public/mocks.ts#:~:text=appBasePath) | 8.8.0 | | savedObjectsTaggingOss | | [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/types.ts#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/types.ts#:~:text=SavedObject), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObject), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObject) | 8.8.0 | | @kbn/core-application-browser-internal | | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=onAppLeave), [application_service.mock.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-mocks/src/application_service.mock.ts#:~:text=onAppLeave) | 8.8.0 | -| @kbn/core-application-browser-internal | | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=AppLeaveHandler), [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=AppLeaveHandler), [app_router.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_router.tsx#:~:text=AppLeaveHandler), [app_router.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_router.tsx#:~:text=AppLeaveHandler), [application_leave.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_leave.tsx#:~:text=AppLeaveHandler), [application_leave.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_leave.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler) | 8.8.0 | +| @kbn/core-application-browser-internal | | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=AppLeaveHandler), [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=AppLeaveHandler), [app_router.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_router.tsx#:~:text=AppLeaveHandler), [app_router.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_router.tsx#:~:text=AppLeaveHandler), [application_leave.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_leave.tsx#:~:text=AppLeaveHandler), [application_leave.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_leave.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [app_leave.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser/src/app_leave.ts#:~:text=AppLeaveHandler)+ 6 more | 8.8.0 | +| @kbn/core-application-browser-internal | | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=AppLeaveHandler), [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=AppLeaveHandler), [app_router.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_router.tsx#:~:text=AppLeaveHandler), [app_router.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_router.tsx#:~:text=AppLeaveHandler), [application_leave.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_leave.tsx#:~:text=AppLeaveHandler), [application_leave.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_leave.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [application_service.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/application_service.tsx#:~:text=AppLeaveHandler), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=AppLeaveHandler) | 8.8.0 | +| @kbn/core-application-browser-internal | | [app_container.tsx](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx#:~:text=onAppLeave), [application_service.mock.ts](https://github.com/elastic/kibana/tree/main/packages/core/application/core-application-browser-mocks/src/application_service.mock.ts#:~:text=onAppLeave), [mocks.ts](https://github.com/elastic/kibana/tree/main/src/core/public/mocks.ts#:~:text=onAppLeave) | 8.8.0 | | @kbn/core-http-browser-internal | | [http_fetch_error.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=req), [http_fetch_error.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=req) | 8.8.0 Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, @@ -78,8 +83,19 @@ so TS and code-reference navigation might not highlight them. | Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, so TS and code-reference navigation might not highlight them. | -| @kbn/core-saved-objects-migration-server-internal | | [document_migrator.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts#:~:text=warning), [migration_logger.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts#:~:text=warning) | 8.8.0 | -| @kbn/core-apps-browser-internal | | [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.test.ts#:~:text=process), [ops_metrics_collector.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.ts#:~:text=process), [get_ops_metrics_log.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.ts#:~:text=process), [get_ops_metrics_log.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.test.ts#:~:text=process)+ 5 more | 8.8.0 | +| @kbn/core-http-browser-internal | | [http_fetch_error.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=req), [http_fetch_error.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=req) | 8.8.0 + +Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, +so TS and code-reference navigation might not highlight them. | +| @kbn/core-http-browser-internal | | [http_fetch_error.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=res), [http_fetch_error.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=res) | 8.8.0 + +Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, +so TS and code-reference navigation might not highlight them. | +| @kbn/core-plugins-server-internal | | [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin.ts#:~:text=AsyncPlugin), [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin.ts#:~:text=AsyncPlugin), [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin.ts#:~:text=AsyncPlugin), [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server-internal/src/plugin.ts#:~:text=AsyncPlugin), [types.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server/src/types.ts#:~:text=AsyncPlugin), [index.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server/src/index.ts#:~:text=AsyncPlugin), [index.ts](https://github.com/elastic/kibana/tree/main/packages/core/plugins/core-plugins-server/index.ts#:~:text=AsyncPlugin), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/server/index.ts#:~:text=AsyncPlugin) | 8.8.0 | +| @kbn/core-saved-objects-migration-server-internal | | [document_migrator.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts#:~:text=warning), [migration_logger.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts#:~:text=warning), [document_migrator.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts#:~:text=warning), [migration_logger.ts](https://github.com/elastic/kibana/tree/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts#:~:text=warning) | 8.8.0 | +| @kbn/core-apps-browser-internal | | [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.test.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process), [load_status.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts#:~:text=process)+ 20 more | 8.8.0 | +| @kbn/core-lifecycle-browser | | [core_start.ts](https://github.com/elastic/kibana/tree/main/packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts#:~:text=InjectedMetadataStart), [core_start.ts](https://github.com/elastic/kibana/tree/main/packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts#:~:text=InjectedMetadataStart) | 8.8.0 | +| @kbn/core-lifecycle-browser | | [core_setup.ts](https://github.com/elastic/kibana/tree/main/packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts#:~:text=InjectedMetadataSetup), [core_setup.ts](https://github.com/elastic/kibana/tree/main/packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts#:~:text=InjectedMetadataSetup) | 8.8.0 | @@ -90,7 +106,8 @@ so TS and code-reference navigation might not highlight them. | | dashboard | | [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/application/top_nav/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/application/top_nav/save_modal.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) | 8.8.0 | | dashboard | | [clone_panel_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#:~:text=SavedObject), [clone_panel_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#:~:text=SavedObject), [clone_panel_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#:~:text=SavedObject) | 8.8.0 | | dashboard | | [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/types.ts#:~:text=onAppLeave), [plugin.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/plugin.tsx#:~:text=onAppLeave) | 8.8.0 | -| dashboard | | [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning), [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning) | 8.8.0 | +| dashboard | | [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning), [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning), [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning), [migrations_730.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts#:~:text=warning) | 8.8.0 | +| dashboard | | [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/types.ts#:~:text=onAppLeave), [plugin.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/plugin.tsx#:~:text=onAppLeave) | 8.8.0 | @@ -98,7 +115,7 @@ so TS and code-reference navigation might not highlight them. | | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| kibanaUsageCollection | | [ops_stats_collector.ts](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts#:~:text=process) | 8.8.0 | +| kibanaUsageCollection | | [ops_stats_collector.ts](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts#:~:text=process), [ops_stats_collector.ts](https://github.com/elastic/kibana/tree/main/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts#:~:text=process) | 8.8.0 | @@ -121,6 +138,11 @@ so TS and code-reference navigation might not highlight them. | Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, so TS and code-reference navigation might not highlight them. | +| ml | | [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/app.tsx#:~:text=onAppLeave) | 8.8.0 | +| ml | | [errors.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/common/util/errors/errors.test.ts#:~:text=req), [errors.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/common/util/errors/errors.test.ts#:~:text=req) | 8.8.0 + +Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, +so TS and code-reference navigation might not highlight them. | @@ -130,13 +152,13 @@ so TS and code-reference navigation might not highlight them. | | --------|-------|-----------|-----------| | spaces | | [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), [app_authorization.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/app_authorization.ts#:~:text=getKibanaFeatures), [privileges.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.ts#:~:text=getKibanaFeatures), [authorization_service.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/authorization_service.tsx#:~:text=getKibanaFeatures), [app_authorization.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/app_authorization.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures)+ 18 more | 8.8.0 | | spaces | | [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), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/plugin.ts#:~:text=license%24) | 8.8.0 | -| security | | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | +| security | | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | | security | | [disable_ui_capabilities.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts#:~:text=requiredRoles) | 8.8.0 This is relied on by the reporting feature, and should be removed once reporting migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/issues/19914 | -| security | | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | -| security | | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | +| security | | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | +| security | | [elasticsearch_role.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [role_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/lib/role_utils.ts#:~:text=disabled), [primary_feature_privilege.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts#:~:text=disabled), [elasticsearch_role.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts#:~:text=disabled), [kibana_features.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts#:~:text=disabled), [put.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled), [put_payload.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts#:~:text=disabled) | 8.8.0 | | security | | [disable_ui_capabilities.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts#:~:text=requiredRoles) | 8.8.0 This is relied on by the reporting feature, and should be removed once reporting @@ -147,6 +169,8 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | security | | [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode) | 8.8.0 | | security | | [logout_app.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/authentication/logout/logout_app.test.ts#:~:text=appBasePath) | 8.8.0 | | security | | [logout_app.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/authentication/logout/logout_app.test.ts#:~:text=onAppLeave) | 8.8.0 | +| security | | [logout_app.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/authentication/logout/logout_app.test.ts#:~:text=appBasePath) | 8.8.0 | +| security | | [logout_app.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/authentication/logout/logout_app.test.ts#:~:text=onAppLeave) | 8.8.0 | @@ -168,6 +192,8 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | securitySolution | | [query.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/query.ts#:~:text=license%24) | 8.8.0 | | securitySolution | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/index.tsx#:~:text=onAppLeave), [plugin.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/plugin.tsx#:~:text=onAppLeave) | 8.8.0 | | securitySolution | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx#:~:text=AppLeaveHandler), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/types.ts#:~:text=AppLeaveHandler), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/types.ts#:~:text=AppLeaveHandler), [routes.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/routes.tsx#:~:text=AppLeaveHandler), [routes.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/routes.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [use_timeline_save_prompt.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts#:~:text=AppLeaveHandler)+ 1 more | 8.8.0 | +| securitySolution | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx#:~:text=AppLeaveHandler), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/types.ts#:~:text=AppLeaveHandler), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/types.ts#:~:text=AppLeaveHandler), [routes.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/routes.tsx#:~:text=AppLeaveHandler), [routes.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/routes.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/app.tsx#:~:text=AppLeaveHandler), [use_timeline_save_prompt.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts#:~:text=AppLeaveHandler)+ 1 more | 8.8.0 | +| securitySolution | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/app/index.tsx#:~:text=onAppLeave), [plugin.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/plugin.tsx#:~:text=onAppLeave) | 8.8.0 | @@ -184,7 +210,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| monitoring | | [bulk_uploader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts#:~:text=process) | 8.8.0 | +| monitoring | | [bulk_uploader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts#:~:text=process), [bulk_uploader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts#:~:text=process) | 8.8.0 | @@ -193,4 +219,6 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| | lens | | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [mounter.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/mounter.tsx#:~:text=onAppLeave), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/index.tsx#:~:text=onAppLeave) | 8.8.0 | -| management | | [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/management/public/application.tsx#:~:text=appBasePath) | 8.8.0 | \ No newline at end of file +| lens | | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [mounter.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/app_plugin/mounter.tsx#:~:text=onAppLeave), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/index.tsx#:~:text=onAppLeave) | 8.8.0 | +| management | | [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/management/public/application.tsx#:~:text=appBasePath) | 8.8.0 | +| management | | [application.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/management/public/application.tsx#:~:text=appBasePath) | 8.8.0 | \ No newline at end of file diff --git a/api_docs/dev_tools.devdocs.json b/api_docs/dev_tools.devdocs.json index ee4eeea5dc27a..f91298e51f8e0 100644 --- a/api_docs/dev_tools.devdocs.json +++ b/api_docs/dev_tools.devdocs.json @@ -18,7 +18,13 @@ "text": "DevToolsPlugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "<", { "pluginId": "devTools", @@ -42,7 +48,13 @@ "description": [], "signature": [ "(coreSetup: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ", { urlForwarding }: { urlForwarding: { forwardApp: (legacyAppId: string, newAppId: string, rewritePath?: ((legacyPath: string) => string) | undefined) => void; }; }) => { register: (devToolArgs: ", "CreateDevToolArgs", ") => ", @@ -61,7 +73,13 @@ "label": "coreSetup", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/dev_tools/public/plugin.ts", diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 38245384d2d9d..1f356827d1124 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: 2022-10-25 +date: 2022-11-07 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 334c593cbc3c7..8b1891318d766 100644 --- a/api_docs/discover.devdocs.json +++ b/api_docs/discover.devdocs.json @@ -141,7 +141,7 @@ "section": "def-public.SavedSearch", "text": "SavedSearch" }, - ") => Promise" + ") => Promise" ], "path": "src/plugins/saved_search/public/services/saved_searches/saved_searches_utils.ts", "deprecated": false, @@ -256,7 +256,13 @@ "text": "DiscoverAppLocatorParams" }, " extends ", - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/discover/public/locator.ts", "deprecated": false, @@ -389,7 +395,13 @@ "\nOptionally set the time range in the time picker." ], "signature": [ - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined" ], "path": "src/plugins/discover/public/locator.ts", @@ -415,7 +427,13 @@ "text": "RefreshInterval" }, " & ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") | undefined" ], "path": "src/plugins/discover/public/locator.ts", @@ -432,7 +450,13 @@ "\nOptionally apply filters." ], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined" ], "path": "src/plugins/discover/public/locator.ts", @@ -449,9 +473,21 @@ "\nOptionally set a query." ], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined" ], "path": "src/plugins/discover/public/locator.ts", @@ -957,7 +993,13 @@ "text": "SerializedSearchSourceFields" }, "; serialize: () => { searchSourceJSON: string; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }; toExpressionAst: ({ asDatatable }?: ExpressionAstOptions) => ", { "pluginId": "expressions", @@ -1307,7 +1349,13 @@ "label": "query", "description": [], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined" ], "path": "src/plugins/discover/public/embeddable/types.ts", @@ -1322,7 +1370,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined" ], "path": "src/plugins/discover/public/embeddable/types.ts", diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index da039fd0aa0e6..6b4e1d4c10fab 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] --- import discoverObj from './discover.devdocs.json'; diff --git a/api_docs/discover_enhanced.devdocs.json b/api_docs/discover_enhanced.devdocs.json index 314300166d7f6..eef9ad2018752 100644 --- a/api_docs/discover_enhanced.devdocs.json +++ b/api_docs/discover_enhanced.devdocs.json @@ -18,7 +18,13 @@ "text": "DiscoverEnhancedPlugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "" ], "path": "x-pack/plugins/discover_enhanced/public/plugin.ts", @@ -103,7 +115,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", { "pluginId": "discoverEnhanced", @@ -134,7 +152,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", { "pluginId": "discoverEnhanced", @@ -183,7 +207,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", plugins: ", { "pluginId": "discoverEnhanced", @@ -206,7 +236,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "x-pack/plugins/discover_enhanced/public/plugin.ts", "deprecated": false, diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 8da680c5e9871..6dd3b349ec759 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/embeddable.devdocs.json b/api_docs/embeddable.devdocs.json index 735d70ccffc5a..359f01ac6cc60 100644 --- a/api_docs/embeddable.devdocs.json +++ b/api_docs/embeddable.devdocs.json @@ -215,7 +215,13 @@ "label": "overlays", "description": [], "signature": [ - "OverlayStart" + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + } ], "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts", "deprecated": false, @@ -230,7 +236,13 @@ "label": "notifications", "description": [], "signature": [ - "NotificationsStart" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + } ], "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts", "deprecated": false, @@ -260,7 +272,13 @@ "label": "theme", "description": [], "signature": [ - "ThemeServiceStart" + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + } ], "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts", "deprecated": false, @@ -293,7 +311,7 @@ "label": "getDisplayName", "description": [], "signature": [ - "() => string" + "() => any" ], "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts", "deprecated": false, @@ -502,7 +520,13 @@ "label": "toasts", "description": [], "signature": [ - "IToasts" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } ], "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", "deprecated": false, @@ -2096,7 +2120,13 @@ "label": "application", "description": [], "signature": [ - "ApplicationStart" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationStart", + "text": "ApplicationStart" + } ], "path": "src/plugins/embeddable/public/lib/actions/edit_panel_action.ts", "deprecated": false, @@ -2151,7 +2181,7 @@ "label": "getDisplayName", "description": [], "signature": [ - "({ embeddable }: ActionContext) => string" + "({ embeddable }: ActionContext) => any" ], "path": "src/plugins/embeddable/public/lib/actions/edit_panel_action.ts", "deprecated": false, @@ -3805,7 +3835,13 @@ "description": [], "signature": [ "(appId: string, options?: ", - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined) => Promise" ], "path": "src/plugins/embeddable/public/lib/state_transfer/embeddable_state_transfer.ts", @@ -3838,7 +3874,13 @@ "description": [], "signature": [ "ReadonlyMap | undefined" ], "path": "src/plugins/embeddable/public/lib/state_transfer/embeddable_state_transfer.ts", @@ -4583,7 +4625,13 @@ "text": "IEmbeddable" }, ", T = ", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">(def: ", { "pluginId": "embeddable", @@ -5630,13 +5678,37 @@ "text": "EmbeddableOutput" }, ", any>, unknown>>; overlays: ", - "OverlayStart", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + }, "; notifications: ", - "NotificationsStart", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + }, "; SavedObjectFinder: React.ComponentType; showCreateNewMenu?: boolean | undefined; reportUiCounter?: ((appName: string, type: string, eventNames: string | string[], count?: number | undefined) => void) | undefined; theme: ", - "ThemeServiceStart", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + }, "; }) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx", "deprecated": false, @@ -5846,7 +5918,13 @@ "label": "overlays", "description": [], "signature": [ - "OverlayStart" + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + } ], "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx", "deprecated": false, @@ -5860,7 +5938,13 @@ "label": "notifications", "description": [], "signature": [ - "NotificationsStart" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + } ], "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx", "deprecated": false, @@ -5916,7 +6000,13 @@ "label": "theme", "description": [], "signature": [ - "ThemeServiceStart" + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + } ], "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx", "deprecated": false, @@ -7739,7 +7829,13 @@ ], "signature": [ "() => Promise<", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]>" ], "path": "src/plugins/embeddable/public/lib/filterable_embeddable/types.ts", @@ -7759,9 +7855,21 @@ ], "signature": [ "() => Promise<", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined>" ], "path": "src/plugins/embeddable/public/lib/filterable_embeddable/types.ts", @@ -9719,9 +9827,21 @@ "text": "ViewMode" }, " | undefined; title?: string | undefined; id: string; lastReloadRequestTime?: number | undefined; hidePanelTitles?: boolean | undefined; enhancements?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; disabledActions?: string[] | undefined; disableTriggers?: boolean | undefined; searchSessionId?: string | undefined; syncColors?: boolean | undefined; syncCursor?: boolean | undefined; syncTooltips?: boolean | undefined; executionContext?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined; }" ], "path": "src/plugins/embeddable/common/types.ts", @@ -9926,10 +10046,13 @@ { "parentPluginId": "embeddable", "id": "def-public.contextMenuTrigger.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/embeddable/public/lib/triggers/triggers.ts", "deprecated": false, "trackAdoption": false @@ -9937,10 +10060,13 @@ { "parentPluginId": "embeddable", "id": "def-public.contextMenuTrigger.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/embeddable/public/lib/triggers/triggers.ts", "deprecated": false, "trackAdoption": false @@ -9973,10 +10099,13 @@ { "parentPluginId": "embeddable", "id": "def-public.panelBadgeTrigger.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/embeddable/public/lib/triggers/triggers.ts", "deprecated": false, "trackAdoption": false @@ -9984,10 +10113,13 @@ { "parentPluginId": "embeddable", "id": "def-public.panelBadgeTrigger.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/embeddable/public/lib/triggers/triggers.ts", "deprecated": false, "trackAdoption": false @@ -10020,10 +10152,13 @@ { "parentPluginId": "embeddable", "id": "def-public.panelNotificationTrigger.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/embeddable/public/lib/triggers/triggers.ts", "deprecated": false, "trackAdoption": false @@ -10031,10 +10166,13 @@ { "parentPluginId": "embeddable", "id": "def-public.panelNotificationTrigger.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/embeddable/public/lib/triggers/triggers.ts", "deprecated": false, "trackAdoption": false @@ -10173,7 +10311,13 @@ "text": "EnhancementRegistryDefinition" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => void" ], "path": "src/plugins/embeddable/public/plugin.tsx", @@ -10196,7 +10340,13 @@ "text": "EnhancementRegistryDefinition" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/embeddable/public/plugin.tsx", @@ -10871,7 +11021,13 @@ "text": "EnhancementRegistryDefinition" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => void" ], "path": "src/plugins/embeddable/server/plugin.ts", @@ -10894,7 +11050,13 @@ "text": "EnhancementRegistryDefinition" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/embeddable/server/plugin.ts", @@ -11060,7 +11222,13 @@ "text": "PersistableState" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> & { isContainerType: boolean; }" ], "path": "src/plugins/embeddable/common/types.ts", @@ -11102,7 +11270,13 @@ "text": "PersistableState" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/embeddable/common/types.ts", @@ -11297,9 +11471,21 @@ "text": "ViewMode" }, " | undefined; title?: string | undefined; id: string; lastReloadRequestTime?: number | undefined; hidePanelTitles?: boolean | undefined; enhancements?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; disabledActions?: string[] | undefined; disableTriggers?: boolean | undefined; searchSessionId?: string | undefined; syncColors?: boolean | undefined; syncCursor?: boolean | undefined; syncTooltips?: boolean | undefined; executionContext?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined; }" ], "path": "src/plugins/embeddable/common/types.ts", diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index f26eb0f78e6dd..3ae3167fe171f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 510 | 0 | 410 | 4 | +| 510 | 6 | 410 | 4 | ## Client diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index ae973890d6970..bd886fcc1596f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] --- import embeddableEnhancedObj from './embeddable_enhanced.devdocs.json'; diff --git a/api_docs/encrypted_saved_objects.devdocs.json b/api_docs/encrypted_saved_objects.devdocs.json index b4f1b14017924..544fee0f50554 100644 --- a/api_docs/encrypted_saved_objects.devdocs.json +++ b/api_docs/encrypted_saved_objects.devdocs.json @@ -207,11 +207,29 @@ "description": [], "signature": [ "(encryptedDoc: ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, " | ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, ") => encryptedDoc is ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, "" ], "path": "x-pack/plugins/encrypted_saved_objects/server/create_migration.ts", @@ -227,9 +245,21 @@ "label": "encryptedDoc", "description": [], "signature": [ - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, " | ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, "" ], "path": "x-pack/plugins/encrypted_saved_objects/server/create_migration.ts", @@ -247,11 +277,29 @@ "description": [], "signature": [ "(doc: ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, ", context: ", - "SavedObjectMigrationContext", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationContext", + "text": "SavedObjectMigrationContext" + }, ") => ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, "" ], "path": "x-pack/plugins/encrypted_saved_objects/server/create_migration.ts", @@ -267,12 +315,17 @@ "label": "doc", "description": [], "signature": [ - "SavedObjectDoc", - " & { references?: ", - "SavedObjectReference", + "SavedObjectDoc & { references?: ", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false }, @@ -284,9 +337,15 @@ "label": "context", "description": [], "signature": [ - "SavedObjectMigrationContext" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationContext", + "text": "SavedObjectMigrationContext" + } ], - "path": "node_modules/@types/kbn__core-saved-objects-server/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", "deprecated": false, "trackAdoption": false } @@ -371,9 +430,21 @@ "description": [], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts", @@ -418,7 +489,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], "path": "x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts", @@ -440,11 +517,29 @@ ], "signature": [ "(findOptions: ", - "SavedObjectsCreatePointInTimeFinderOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + }, ", dependencies?: ", - "SavedObjectsCreatePointInTimeFinderDependencies", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, " | undefined) => Promise<", - "ISavedObjectsPointInTimeFinder", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsPointInTimeFinder", + "text": "ISavedObjectsPointInTimeFinder" + }, ">" ], "path": "x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts", @@ -461,7 +556,13 @@ "matches interface of corresponding argument of Saved Objects API `createPointInTimeFinder` {@link SavedObjectsCreatePointInTimeFinderOptions }" ], "signature": [ - "SavedObjectsCreatePointInTimeFinderOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + } ], "path": "x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts", "deprecated": false, @@ -478,7 +579,13 @@ "matches interface of corresponding argument of Saved Objects API `createPointInTimeFinder` {@link SavedObjectsCreatePointInTimeFinderDependencies }" ], "signature": [ - "SavedObjectsCreatePointInTimeFinderDependencies", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, " | undefined" ], "path": "x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts", @@ -711,11 +818,29 @@ "description": [], "signature": [ "(encryptedDoc: ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, " | ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, ") => encryptedDoc is ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, "" ], "path": "x-pack/plugins/encrypted_saved_objects/server/create_migration.ts", @@ -731,9 +856,21 @@ "label": "encryptedDoc", "description": [], "signature": [ - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, " | ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, "" ], "path": "x-pack/plugins/encrypted_saved_objects/server/create_migration.ts", diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 11f51b7d54aed..ee92d04b6f5ab 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] --- import encryptedSavedObjectsObj from './encrypted_saved_objects.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Platform Security](https://github.com/orgs/elastic/teams/kibana-securit | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 51 | 0 | 42 | 0 | +| 51 | 0 | 44 | 0 | ## Server diff --git a/api_docs/enterprise_search.devdocs.json b/api_docs/enterprise_search.devdocs.json index b42b4016faf40..0e47e5a6c851c 100644 --- a/api_docs/enterprise_search.devdocs.json +++ b/api_docs/enterprise_search.devdocs.json @@ -92,12 +92,12 @@ { "parentPluginId": "enterpriseSearch", "id": "def-server.CONNECTORS_VERSION", - "type": "string", + "type": "number", "tags": [], "label": "CONNECTORS_VERSION", "description": [], "signature": [ - "\"1\"" + "1" ], "path": "x-pack/plugins/enterprise_search/server/index.ts", "deprecated": false, @@ -144,21 +144,69 @@ "label": "configSchema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ accessCheckTimeout: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; accessCheckTimeoutWarning: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; customHeaders: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, " | undefined>; host: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; ssl: ", - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ certificateAuthorities: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; verificationMode: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "<\"none\" | \"full\" | \"certificate\">; }>; }>" ], "path": "x-pack/plugins/enterprise_search/server/index.ts", diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index fdbb8cdaa8ed7..fb5a69171585b 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; diff --git a/api_docs/es_ui_shared.devdocs.json b/api_docs/es_ui_shared.devdocs.json index 45e839be39c55..486bc8199b5a2 100644 --- a/api_docs/es_ui_shared.devdocs.json +++ b/api_docs/es_ui_shared.devdocs.json @@ -561,7 +561,13 @@ "description": [], "signature": [ "(httpClient: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, ", { path, method, body, query, asSystemRequest }: ", { "pluginId": "esUiShared", @@ -592,7 +598,13 @@ "label": "httpClient", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "src/plugins/es_ui_shared/public/request/send_request.ts", "deprecated": false, @@ -651,7 +663,13 @@ "description": [], "signature": [ "(httpClient: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, ", { path, method, query, body, pollIntervalMs, initialData, deserializer }: ", { "pluginId": "esUiShared", @@ -682,7 +700,13 @@ "label": "httpClient", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "src/plugins/es_ui_shared/public/request/use_request.ts", "deprecated": false, @@ -1304,7 +1328,13 @@ "label": "query", "description": [], "signature": [ - "HttpFetchQuery", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchQuery", + "text": "HttpFetchQuery" + }, " | undefined" ], "path": "src/plugins/es_ui_shared/public/request/send_request.ts", @@ -1794,7 +1824,13 @@ ], "signature": [ "({ error, response, handleCustomError, }: EsErrorHandlerParams) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "" ], "path": "src/plugins/es_ui_shared/__packages_do_not_import__/errors/handle_es_error.ts", diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index 36c4e9e40163f..3626d28759e7c 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/event_annotation.devdocs.json b/api_docs/event_annotation.devdocs.json index 0bf1025c1dd96..ffce75ed34ebc 100644 --- a/api_docs/event_annotation.devdocs.json +++ b/api_docs/event_annotation.devdocs.json @@ -443,7 +443,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/event_annotation/common/event_annotation_group/index.ts", @@ -1028,10 +1034,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualPointEventAnnotation.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1103,10 +1112,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualPointEventAnnotation.args.id.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1141,10 +1153,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualPointEventAnnotation.args.time.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1179,10 +1194,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualPointEventAnnotation.args.label.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1217,10 +1235,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualPointEventAnnotation.args.color.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1269,10 +1290,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualPointEventAnnotation.args.lineStyle.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1307,10 +1331,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualPointEventAnnotation.args.lineWidth.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1345,10 +1372,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualPointEventAnnotation.args.icon.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1411,10 +1441,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualPointEventAnnotation.args.textVisibility.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1449,10 +1482,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualPointEventAnnotation.args.isHidden.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1593,10 +1629,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualRangeEventAnnotation.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1668,10 +1707,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualRangeEventAnnotation.args.id.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1706,10 +1748,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualRangeEventAnnotation.args.time.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1744,10 +1789,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualRangeEventAnnotation.args.endTime.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1848,10 +1896,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualRangeEventAnnotation.args.label.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1886,10 +1937,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualRangeEventAnnotation.args.color.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -1924,10 +1978,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.manualRangeEventAnnotation.args.isHidden.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2048,10 +2105,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2123,10 +2183,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.id.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2161,10 +2224,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.filter.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2213,10 +2279,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.extraFields.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2251,10 +2320,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.timeField.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2289,10 +2361,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.label.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2327,10 +2402,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.color.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2379,10 +2457,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.lineStyle.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2417,10 +2498,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.lineWidth.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2455,10 +2539,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.icon.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2521,10 +2608,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.textVisibility.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2559,10 +2649,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.textField.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2597,10 +2690,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.isHidden.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false @@ -2635,10 +2731,13 @@ { "parentPluginId": "eventAnnotation", "id": "def-common.queryPointEventAnnotation.args.ignoreGlobalFilters.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/event_annotation/common/query_point_event_annotation/index.ts", "deprecated": false, "trackAdoption": false diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index 931b4be683eae..4e8d5a3a063c1 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -8,20 +8,20 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotation plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] --- import eventAnnotationObj from './event_annotation.devdocs.json'; The Event Annotation service contains expressions for event annotations -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](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 | |-------------------|-----------|------------------------|-----------------| -| 174 | 0 | 174 | 3 | +| 174 | 31 | 174 | 3 | ## Client diff --git a/api_docs/event_log.devdocs.json b/api_docs/event_log.devdocs.json index 6018838914f57..67c59c6e92b2d 100644 --- a/api_docs/event_log.devdocs.json +++ b/api_docs/event_log.devdocs.json @@ -655,6 +655,48 @@ ], "returnComment": [] }, + { + "parentPluginId": "eventLog", + "id": "def-server.ClusterClientAdapter.queryEventsWithAuthFilter", + "type": "Function", + "tags": [], + "label": "queryEventsWithAuthFilter", + "description": [], + "signature": [ + "(queryOptions: ", + "FindEventsOptionsWithAuthFilter", + ") => Promise<", + { + "pluginId": "eventLog", + "scope": "server", + "docId": "kibEventLogPluginApi", + "section": "def-server.QueryEventsBySavedObjectResult", + "text": "QueryEventsBySavedObjectResult" + }, + ">" + ], + "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "eventLog", + "id": "def-server.ClusterClientAdapter.queryEventsWithAuthFilter.$1", + "type": "CompoundType", + "tags": [], + "label": "queryOptions", + "description": [], + "signature": [ + "FindEventsOptionsWithAuthFilter" + ], + "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "eventLog", "id": "def-server.ClusterClientAdapter.aggregateEventsBySavedObjects", @@ -961,6 +1003,124 @@ ], "returnComment": [] }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter", + "type": "Function", + "tags": [], + "label": "findEventsWithAuthFilter", + "description": [], + "signature": [ + "(type: string, ids: string[], authFilter: ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.KueryNode", + "text": "KueryNode" + }, + ", namespace: string | undefined, options?: Partial<", + "FindOptionsType", + "> | undefined) => Promise<", + { + "pluginId": "eventLog", + "scope": "server", + "docId": "kibEventLogPluginApi", + "section": "def-server.QueryEventsBySavedObjectResult", + "text": "QueryEventsBySavedObjectResult" + }, + ">" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter.$1", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter.$2", + "type": "Array", + "tags": [], + "label": "ids", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter.$3", + "type": "Object", + "tags": [], + "label": "authFilter", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.KueryNode", + "text": "KueryNode" + } + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter.$4", + "type": "string", + "tags": [], + "label": "namespace", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter.$5", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "Partial<", + "FindOptionsType", + "> | undefined" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, { "parentPluginId": "eventLog", "id": "def-server.IEventLogClient.aggregateEventsBySavedObjectIds", @@ -1059,10 +1219,16 @@ "description": [], "signature": [ "(type: string, authFilter: ", - "KueryNode", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.KueryNode", + "text": "KueryNode" + }, ", options?: Partial<", "AggregateOptionsType", - "> | undefined) => Promise<", + "> | undefined, namespaces?: (string | undefined)[] | undefined) => Promise<", { "pluginId": "eventLog", "scope": "server", @@ -1099,7 +1265,13 @@ "label": "authFilter", "description": [], "signature": [ - "KueryNode" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.KueryNode", + "text": "KueryNode" + } ], "path": "x-pack/plugins/event_log/server/types.ts", "deprecated": false, @@ -1122,6 +1294,21 @@ "deprecated": false, "trackAdoption": false, "isRequired": false + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.aggregateEventsWithAuthFilter.$4", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "(string | undefined)[] | undefined" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false } ], "returnComment": [] @@ -1312,7 +1499,7 @@ "label": "data", "description": [], "signature": [ - "(Readonly<{ error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined)[]" + "(Readonly<{ error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; reason?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; kind?: string | undefined; hash?: string | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined)[]" ], "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", "deprecated": false, @@ -1332,7 +1519,7 @@ "label": "IEvent", "description": [], "signature": [ - "DeepPartial | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}>>> | undefined" + "DeepPartial | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; reason?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; kind?: string | undefined; hash?: string | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}>>> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, @@ -1347,7 +1534,7 @@ "label": "IValidatedEvent", "description": [], "signature": [ - "Readonly<{ error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined" + "Readonly<{ error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; reason?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; kind?: string | undefined; hash?: string | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, @@ -1670,7 +1857,13 @@ "description": [], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", { "pluginId": "eventLog", @@ -1692,7 +1885,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/event_log/server/types.ts", diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 8198f4414a455..d087a2c0b7524 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 106 | 0 | 106 | 10 | +| 115 | 0 | 115 | 11 | ## Server diff --git a/api_docs/expression_error.devdocs.json b/api_docs/expression_error.devdocs.json index 22e172552744a..e7816c0a58eb7 100644 --- a/api_docs/expression_error.devdocs.json +++ b/api_docs/expression_error.devdocs.json @@ -12,7 +12,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => () => ", { "pluginId": "expressions", @@ -35,7 +41,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/expression_error/public/expression_renderers/debug_renderer.tsx", @@ -56,7 +68,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => () => ", { "pluginId": "expressions", @@ -81,7 +99,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/expression_error/public/expression_renderers/error_renderer.tsx", @@ -104,7 +128,13 @@ "(theme$?: ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">) => () => ", { "pluginId": "expressions", @@ -129,7 +159,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/expression_error/public/expression_renderers/debug_renderer.tsx", @@ -152,7 +188,13 @@ "(theme$?: ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">) => () => ", { "pluginId": "expressions", @@ -179,7 +221,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/expression_error/public/expression_renderers/error_renderer.tsx", diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index 8df865e80d5f2..0ac8ce0761202 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] --- import expressionErrorObj from './expression_error.devdocs.json'; diff --git a/api_docs/expression_gauge.devdocs.json b/api_docs/expression_gauge.devdocs.json index 7869c0eedcb1c..0caa768a67009 100644 --- a/api_docs/expression_gauge.devdocs.json +++ b/api_docs/expression_gauge.devdocs.json @@ -106,7 +106,13 @@ "text": "Accessors" }, " | undefined, paletteParams?: ", - "CustomPaletteParams", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, " | undefined, isRespectRanges?: boolean | undefined) => number" ], "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", @@ -165,7 +171,13 @@ "label": "paletteParams", "description": [], "signature": [ - "CustomPaletteParams", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, " | undefined" ], "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", @@ -217,7 +229,13 @@ "text": "Accessors" }, " | undefined, paletteParams?: ", - "CustomPaletteParams", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, " | undefined, isRespectRanges?: boolean | undefined) => any" ], "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", @@ -276,7 +294,13 @@ "label": "paletteParams", "description": [], "signature": [ - "CustomPaletteParams", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, " | undefined" ], "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", @@ -536,7 +560,13 @@ "; colorMode: ", "GaugeColorMode", "; palette?: ", - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", { "pluginId": "charts", @@ -772,9 +802,21 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", - "CustomPaletteParams", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, "> | undefined" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", @@ -883,7 +925,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined) => ", { "pluginId": "fieldFormats", @@ -914,7 +962,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_renderers.ts", @@ -950,7 +1004,13 @@ "; colorMode: ", "GaugeColorMode", "; palette?: ", - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", { "pluginId": "charts", @@ -1030,7 +1090,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", @@ -1079,7 +1145,13 @@ "; chartsThemeService: ", "Theme", "; paletteService: ", - "PaletteRegistry", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteRegistry", + "text": "PaletteRegistry" + }, "; renderComplete: () => void; uiState: ", { "pluginId": "visualizations", diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index 3fa2e68cd897b..1b3d8d6baa8a2 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionGauge plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] --- import expressionGaugeObj from './expression_gauge.devdocs.json'; Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/expression_heatmap.devdocs.json b/api_docs/expression_heatmap.devdocs.json index 101973f84ca4d..492d3070eedde 100644 --- a/api_docs/expression_heatmap.devdocs.json +++ b/api_docs/expression_heatmap.devdocs.json @@ -28,7 +28,13 @@ "description": [], "signature": [ "() => ", - "HeatmapExpressionFunctionDefinition" + { + "pluginId": "expressionHeatmap", + "scope": "common", + "docId": "kibExpressionHeatmapPluginApi", + "section": "def-common.HeatmapExpressionFunctionDefinition", + "text": "HeatmapExpressionFunctionDefinition" + } ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts", "deprecated": false, @@ -214,7 +220,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", { "pluginId": "charts", @@ -458,6 +470,20 @@ "path": "src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "expressionHeatmap", + "id": "def-common.HeatmapExpressionProps.canNavigateToLens", + "type": "CompoundType", + "tags": [], + "label": "canNavigateToLens", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -497,7 +523,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined) => ", { "pluginId": "fieldFormats", @@ -528,7 +560,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined" ], "path": "src/plugins/chart_expressions/expression_heatmap/common/types/expression_renderers.ts", @@ -538,6 +576,84 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "expressionHeatmap", + "id": "def-common.HeatmapExpressionFunctionDefinition", + "type": "Type", + "tags": [], + "label": "HeatmapExpressionFunctionDefinition", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"heatmap\", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.Datatable", + "text": "Datatable" + }, + ", ", + { + "pluginId": "expressionHeatmap", + "scope": "common", + "docId": "kibExpressionHeatmapPluginApi", + "section": "def-common.HeatmapArguments", + "text": "HeatmapArguments" + }, + ", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueRender", + "text": "ExpressionValueRender" + }, + "<", + { + "pluginId": "expressionHeatmap", + "scope": "common", + "docId": "kibExpressionHeatmapPluginApi", + "section": "def-common.HeatmapExpressionProps", + "text": "HeatmapExpressionProps" + }, + ">, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, + ">>" + ], + "path": "src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "expressionHeatmap", "id": "def-common.HeatmapGridConfigResult", @@ -554,6 +670,62 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "expressionHeatmap", + "id": "def-common.HeatmapGridExpressionFunctionDefinition", + "type": "Type", + "tags": [], + "label": "HeatmapGridExpressionFunctionDefinition", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"heatmap_grid\", null, ", + "HeatmapGridConfig", + ", ", + { + "pluginId": "expressionHeatmap", + "scope": "common", + "docId": "kibExpressionHeatmapPluginApi", + "section": "def-common.HeatmapGridConfigResult", + "text": "HeatmapGridConfigResult" + }, + ", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, + ">>" + ], + "path": "src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "expressionHeatmap", "id": "def-common.HeatmapLegendConfigResult", @@ -570,6 +742,62 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "expressionHeatmap", + "id": "def-common.HeatmapLegendExpressionFunctionDefinition", + "type": "Type", + "tags": [], + "label": "HeatmapLegendExpressionFunctionDefinition", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"heatmap_legend\", null, ", + "HeatmapLegendConfig", + ", ", + { + "pluginId": "expressionHeatmap", + "scope": "common", + "docId": "kibExpressionHeatmapPluginApi", + "section": "def-common.HeatmapLegendConfigResult", + "text": "HeatmapLegendConfigResult" + }, + ", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, + ">>" + ], + "path": "src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "expressionHeatmap", "id": "def-common.HeatmapRenderProps", @@ -622,7 +850,13 @@ "text": "Datatable" }, "; column: number; range: number[]; timeFieldName?: string | undefined; }) => void; paletteService: ", - "PaletteRegistry", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteRegistry", + "text": "PaletteRegistry" + }, "; uiState: ", { "pluginId": "visualizations", @@ -789,10 +1023,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapGridConfig.args.strokeWidth.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_grid.ts", "deprecated": false, "trackAdoption": false @@ -841,10 +1078,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapGridConfig.args.strokeColor.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_grid.ts", "deprecated": false, "trackAdoption": false @@ -895,10 +1135,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapGridConfig.args.isCellLabelVisible.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_grid.ts", "deprecated": false, "trackAdoption": false @@ -935,10 +1178,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapGridConfig.args.isYAxisLabelVisible.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_grid.ts", "deprecated": false, "trackAdoption": false @@ -973,10 +1219,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapGridConfig.args.isYAxisTitleVisible.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_grid.ts", "deprecated": false, "trackAdoption": false @@ -1011,10 +1260,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapGridConfig.args.yTitle.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_grid.ts", "deprecated": false, "trackAdoption": false @@ -1065,10 +1317,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapGridConfig.args.isXAxisLabelVisible.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_grid.ts", "deprecated": false, "trackAdoption": false @@ -1103,10 +1358,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapGridConfig.args.isXAxisTitleVisible.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_grid.ts", "deprecated": false, "trackAdoption": false @@ -1141,10 +1399,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapGridConfig.args.xTitle.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_grid.ts", "deprecated": false, "trackAdoption": false @@ -1336,10 +1597,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapLegendConfig.args.isVisible.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts", "deprecated": false, "trackAdoption": false @@ -1402,10 +1666,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapLegendConfig.args.position.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts", "deprecated": false, "trackAdoption": false @@ -1454,10 +1721,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapLegendConfig.args.maxLines.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts", "deprecated": false, "trackAdoption": false @@ -1506,10 +1776,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapLegendConfig.args.shouldTruncate.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts", "deprecated": false, "trackAdoption": false @@ -1564,10 +1837,13 @@ { "parentPluginId": "expressionHeatmap", "id": "def-common.heatmapLegendConfig.args.legendSize.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts", "deprecated": false, "trackAdoption": false diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index e3f5eb4750b51..e762ef6997998 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -8,20 +8,20 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionHeatmap plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](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 | |-------------------|-----------|------------------------|-----------------| -| 107 | 0 | 103 | 3 | +| 111 | 14 | 107 | 2 | ## Common diff --git a/api_docs/expression_image.devdocs.json b/api_docs/expression_image.devdocs.json index e3cac954d378b..afa9495151e3f 100644 --- a/api_docs/expression_image.devdocs.json +++ b/api_docs/expression_image.devdocs.json @@ -14,7 +14,13 @@ "(theme$?: ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">) => () => ", { "pluginId": "expressions", @@ -47,7 +53,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/expression_image/public/expression_renderers/image_renderer.tsx", @@ -68,7 +80,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => () => ", { "pluginId": "expressions", @@ -99,7 +117,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/expression_image/public/expression_renderers/image_renderer.tsx", @@ -383,7 +407,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expression_image/common/types/expression_functions.ts", diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 60b93f5bf1254..e3367658a68e6 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] --- import expressionImageObj from './expression_image.devdocs.json'; diff --git a/api_docs/expression_legacy_metric_vis.devdocs.json b/api_docs/expression_legacy_metric_vis.devdocs.json index e1dc4542035a7..7f330c19bfbde 100644 --- a/api_docs/expression_legacy_metric_vis.devdocs.json +++ b/api_docs/expression_legacy_metric_vis.devdocs.json @@ -114,6 +114,21 @@ "deprecated": false, "trackAdoption": false, "children": [ + { + "parentPluginId": "expressionLegacyMetricVis", + "id": "def-common.MetricArguments.autoScaleMetricAlignment", + "type": "CompoundType", + "tags": [], + "label": "autoScaleMetricAlignment", + "description": [], + "signature": [ + "MetricAlignment", + " | undefined" + ], + "path": "src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "expressionLegacyMetricVis", "id": "def-common.MetricArguments.percentageMode", @@ -158,7 +173,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", { "pluginId": "charts", @@ -407,6 +428,21 @@ "deprecated": false, "trackAdoption": false, "children": [ + { + "parentPluginId": "expressionLegacyMetricVis", + "id": "def-common.MetricVisParam.autoScaleMetricAlignment", + "type": "CompoundType", + "tags": [], + "label": "autoScaleMetricAlignment", + "description": [], + "signature": [ + "MetricAlignment", + " | undefined" + ], + "path": "src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_renderers.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "expressionLegacyMetricVis", "id": "def-common.MetricVisParam.percentageMode", @@ -837,7 +873,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_functions.ts", diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index bf161b0e552b0..72a3d934b5972 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -8,20 +8,20 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionLegacyMetricVis plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] --- import expressionLegacyMetricVisObj from './expression_legacy_metric_vis.devdocs.json'; Adds a `metric` renderer and function to the expression plugin. The renderer will display the `legacy metric` chart. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](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 | |-------------------|-----------|------------------------|-----------------| -| 49 | 0 | 49 | 1 | +| 51 | 0 | 51 | 2 | ## Common diff --git a/api_docs/expression_metric.devdocs.json b/api_docs/expression_metric.devdocs.json index 8734065695431..8b7be7c3410f7 100644 --- a/api_docs/expression_metric.devdocs.json +++ b/api_docs/expression_metric.devdocs.json @@ -14,7 +14,13 @@ "(theme$?: ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">) => () => ", { "pluginId": "expressions", @@ -47,7 +53,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/expression_metric/public/expression_renderers/metric_renderer.tsx", @@ -68,7 +80,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => () => ", { "pluginId": "expressions", @@ -99,7 +117,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/expression_metric/public/expression_renderers/metric_renderer.tsx", @@ -168,7 +192,7 @@ "label": "metricFunction", "description": [], "signature": [ - "() => { name: \"metric\"; aliases: never[]; type: \"render\"; inputTypes: (\"number\" | \"null\" | \"string\")[]; help: string; args: { label: { types: \"string\"[]; aliases: string[]; help: string; default: string; }; labelFont: { types: \"style\"[]; help: string; default: string; }; metricFont: { types: \"style\"[]; help: string; default: string; }; metricFormat: { types: \"string\"[]; aliases: string[]; help: string; }; }; fn: (input: ", + "() => { name: \"metric\"; aliases: never[]; type: \"render\"; inputTypes: (\"number\" | \"null\" | \"string\")[]; help: any; args: { label: { types: \"string\"[]; aliases: string[]; help: any; default: string; }; labelFont: { types: \"style\"[]; help: any; default: string; }; metricFont: { types: \"style\"[]; help: any; default: string; }; metricFormat: { types: \"string\"[]; aliases: string[]; help: any; }; }; fn: (input: ", { "pluginId": "expressionMetric", "scope": "common", @@ -506,7 +530,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expression_metric/common/types/expression_functions.ts", diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index 75fab4a1e4ff3..96b54d79dbe35 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: 2022-10-25 +date: 2022-11-07 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 4f715f2618c97..5d837dadafaf1 100644 --- a/api_docs/expression_metric_vis.devdocs.json +++ b/api_docs/expression_metric_vis.devdocs.json @@ -470,7 +470,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", { "pluginId": "charts", @@ -1037,7 +1043,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", @@ -1074,6 +1086,64 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.TrendlineExpressionFunctionDefinition", + "type": "Type", + "tags": [], + "label": "TrendlineExpressionFunctionDefinition", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"metricTrendline\", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.Datatable", + "text": "Datatable" + }, + ", ", + "TrendlineArguments", + ", ", + "TrendlineResult", + ", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, + ">>" + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 26a880dc63746..4245b3066784e 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -8,20 +8,20 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetricVis plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; Adds a `metric` renderer and function to the expression plugin. The renderer will display the `metric` chart. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](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 | |-------------------|-----------|------------------------|-----------------| -| 62 | 0 | 62 | 1 | +| 63 | 0 | 63 | 2 | ## Client diff --git a/api_docs/expression_partition_vis.devdocs.json b/api_docs/expression_partition_vis.devdocs.json index 83045ce60af28..f9a606bdebd30 100644 --- a/api_docs/expression_partition_vis.devdocs.json +++ b/api_docs/expression_partition_vis.devdocs.json @@ -141,7 +141,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/partition_labels_function.ts", @@ -264,7 +270,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; }" ], "path": "src/plugins/chart_expressions/expression_partition_vis/common/types/expression_renderers.ts", @@ -641,7 +653,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }>" ], "path": "src/plugins/chart_expressions/expression_partition_vis/common/types/expression_renderers.ts", @@ -1157,7 +1175,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/chart_expressions/expression_partition_vis/common/types/expression_functions.ts", @@ -1195,6 +1219,70 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "expressionPartitionVis", + "id": "def-common.PartitionLabelsExpressionFunctionDefinition", + "type": "Type", + "tags": [], + "label": "PartitionLabelsExpressionFunctionDefinition", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"partitionLabels\", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.Datatable", + "text": "Datatable" + }, + " | null, ", + "PartitionLabelsArguments", + ", ", + { + "pluginId": "expressionPartitionVis", + "scope": "common", + "docId": "kibExpressionPartitionVisPluginApi", + "section": "def-common.ExpressionValuePartitionLabels", + "text": "ExpressionValuePartitionLabels" + }, + ", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, + ">>" + ], + "path": "src/plugins/chart_expressions/expression_partition_vis/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "expressionPartitionVis", "id": "def-common.PIE_VIS_EXPRESSION_NAME", @@ -1268,7 +1356,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/chart_expressions/expression_partition_vis/common/types/expression_functions.ts", @@ -1379,7 +1473,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/chart_expressions/expression_partition_vis/common/types/expression_functions.ts", @@ -1460,7 +1560,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/chart_expressions/expression_partition_vis/common/types/expression_functions.ts", diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index 15bc59f1a1989..29c09611cea31 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -8,20 +8,20 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionPartitionVis plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] --- import expressionPartitionVisObj from './expression_partition_vis.devdocs.json'; Expression Partition Visualization plugin adds a `partitionVis` renderer and `pieVis`, `mosaicVis`, `treemapVis`, `waffleVis` functions to the expression plugin. The renderer will display the `pie`, `waffle`, `treemap` and `mosaic` charts. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](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 | |-------------------|-----------|------------------------|-----------------| -| 70 | 0 | 70 | 2 | +| 71 | 0 | 71 | 2 | ## Client diff --git a/api_docs/expression_repeat_image.devdocs.json b/api_docs/expression_repeat_image.devdocs.json index af42a7dd870ba..5107ef860b69e 100644 --- a/api_docs/expression_repeat_image.devdocs.json +++ b/api_docs/expression_repeat_image.devdocs.json @@ -14,7 +14,13 @@ "(theme$?: ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">) => () => ", { "pluginId": "expressions", @@ -47,7 +53,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx", @@ -68,7 +80,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => () => ", { "pluginId": "expressions", @@ -99,7 +117,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx", @@ -168,7 +192,7 @@ "label": "repeatImageFunction", "description": [], "signature": [ - "() => { name: \"repeatImage\"; aliases: never[]; type: \"render\"; inputTypes: \"number\"[]; help: string; args: { emptyImage: { types: (\"null\" | \"string\")[]; help: string; default: null; }; image: { types: (\"null\" | \"string\")[]; help: string; default: null; }; max: { types: (\"number\" | \"null\")[]; help: string; default: number; }; size: { types: \"number\"[]; default: number; help: string; }; }; fn: (count: number, args: Arguments) => Promise<{ type: \"render\"; as: string; value: { image: string | null; emptyImage: string | null; size: number; max: number | null; count: number; }; }>; }" + "() => { name: \"repeatImage\"; aliases: never[]; type: \"render\"; inputTypes: \"number\"[]; help: any; args: { emptyImage: { types: (\"null\" | \"string\")[]; help: any; default: null; }; image: { types: (\"null\" | \"string\")[]; help: any; default: null; }; max: { types: (\"number\" | \"null\")[]; help: any; default: number; }; size: { types: \"number\"[]; default: number; help: any; }; }; fn: (count: number, args: Arguments) => Promise<{ type: \"render\"; as: string; value: { image: string | null; emptyImage: string | null; size: number; max: number | null; count: number; }; }>; }" ], "path": "src/plugins/expression_repeat_image/common/expression_functions/repeat_image_function.ts", "deprecated": false, @@ -430,7 +454,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expression_repeat_image/common/types/expression_functions.ts", diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index eddb856850910..beaa3a5555565 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: 2022-10-25 +date: 2022-11-07 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 83f7f39feed9c..4d85254014050 100644 --- a/api_docs/expression_reveal_image.devdocs.json +++ b/api_docs/expression_reveal_image.devdocs.json @@ -14,7 +14,13 @@ "(theme$?: ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">) => () => ", { "pluginId": "expressions", @@ -41,7 +47,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx", @@ -62,7 +74,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => () => ", { "pluginId": "expressions", @@ -87,7 +105,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx", @@ -156,7 +180,7 @@ "label": "revealImageFunction", "description": [], "signature": [ - "() => { name: \"revealImage\"; aliases: never[]; type: \"render\"; inputTypes: \"number\"[]; help: string; args: { image: { types: (\"null\" | \"string\")[]; help: string; default: null; }; emptyImage: { types: (\"null\" | \"string\")[]; help: string; default: null; }; origin: { types: \"string\"[]; help: string; default: string; options: ", + "() => { name: \"revealImage\"; aliases: never[]; type: \"render\"; inputTypes: \"number\"[]; help: any; args: { image: { types: (\"null\" | \"string\")[]; help: any; default: null; }; emptyImage: { types: (\"null\" | \"string\")[]; help: any; default: null; }; origin: { types: \"string\"[]; help: any; default: string; options: ", "Origin", "[]; }; }; fn: (percent: number, args: Arguments) => Promise<{ type: \"render\"; as: string; value: { image: string; emptyImage: string; origin: ", "Origin", diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index f9199358565d6..2a15ef5c96c58 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: 2022-10-25 +date: 2022-11-07 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 fb7c05ab9b562..fe1c74fde2073 100644 --- a/api_docs/expression_shape.devdocs.json +++ b/api_docs/expression_shape.devdocs.json @@ -38,7 +38,13 @@ "(theme$?: ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">) => () => ", { "pluginId": "expressions", @@ -71,7 +77,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/expression_shape/public/expression_renderers/progress_renderer.tsx", @@ -94,7 +106,13 @@ "(theme$?: ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">) => () => ", { "pluginId": "expressions", @@ -127,7 +145,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx", @@ -276,7 +300,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => () => ", { "pluginId": "expressions", @@ -307,7 +337,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/expression_shape/public/expression_renderers/progress_renderer.tsx", @@ -328,7 +364,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => () => ", { "pluginId": "expressions", @@ -359,7 +401,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx", @@ -1502,7 +1550,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expression_shape/common/types/expression_functions.ts", @@ -1553,7 +1607,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expression_shape/common/types/expression_functions.ts", @@ -2494,7 +2554,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expression_shape/common/types/expression_functions.ts", @@ -2545,7 +2611,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expression_shape/common/types/expression_functions.ts", diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index b2107badf98ef..6b2aae03a1bb0 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: 2022-10-25 +date: 2022-11-07 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 585c38b73fa7f..b2af131323092 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionTagcloud plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/expression_x_y.devdocs.json b/api_docs/expression_x_y.devdocs.json index 1ed51d6360c13..34724030ea4a9 100644 --- a/api_docs/expression_x_y.devdocs.json +++ b/api_docs/expression_x_y.devdocs.json @@ -769,7 +769,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }>" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", @@ -2252,7 +2258,13 @@ "text": "DataLayerArgs" }, ", \"palette\"> & { type: \"dataLayer\"; layerType: \"data\"; palette: ", - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }>; table: ", { "pluginId": "expressions", @@ -2286,7 +2298,13 @@ "text": "DataLayerArgs" }, ", \"palette\"> & { type: \"dataLayer\"; layerType: \"data\"; palette: ", - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }>; table: ", { "pluginId": "expressions", @@ -2328,7 +2346,13 @@ "Omit<", "ExtendedDataLayerArgs", ", \"palette\"> & { type: \"extendedDataLayer\"; layerType: \"data\"; palette: ", - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }>; table: ", { "pluginId": "expressions", diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index 904c6304b38a6..22390fe78b940 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionXY plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/expressions.devdocs.json b/api_docs/expressions.devdocs.json index fdfba4c5796c5..ac65def6fbf5a 100644 --- a/api_docs/expressions.devdocs.json +++ b/api_docs/expressions.devdocs.json @@ -128,7 +128,13 @@ "text": "ExecutionContext" }, "" ], "path": "src/plugins/expressions/common/execution/execution.ts", @@ -259,7 +265,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "src/plugins/expressions/common/execution/execution.ts", @@ -1043,7 +1055,13 @@ "description": [], "signature": [ " = Record>(logger?: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined, state?: ", { "pluginId": "expressions", @@ -1074,7 +1092,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -1220,7 +1244,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -1797,7 +1827,13 @@ "text": "ExpressionAstExpression" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "expressions", @@ -1840,7 +1876,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -1876,7 +1918,13 @@ "text": "ExpressionAstExpression" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -2008,7 +2056,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">) => ", { "pluginId": "expressions", @@ -2038,7 +2092,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -2359,7 +2419,13 @@ "text": "ExpressionAstArgument" }, "[]>; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/expressions/common/expression_functions/expression_function.ts", @@ -2408,7 +2474,13 @@ "text": "ExpressionAstArgument" }, "[]>, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => Record Promise" ], "path": "src/plugins/expressions/public/render.ts", @@ -3761,7 +3845,13 @@ "label": "value", "description": [], "signature": [ - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/expressions/public/render.ts", "deprecated": false, @@ -3883,7 +3973,13 @@ "text": "ExpressionsPublicPlugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "<", { "pluginId": "expressions", @@ -3928,7 +4024,13 @@ "label": "initializerContext", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "" ], "path": "src/plugins/expressions/public/plugin.ts", @@ -3948,7 +4050,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => ", { "pluginId": "expressions", @@ -3970,7 +4078,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/expressions/public/plugin.ts", @@ -3990,7 +4104,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ") => ", { "pluginId": "expressions", @@ -4012,7 +4132,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expressions/public/plugin.ts", "deprecated": false, @@ -4918,7 +5044,13 @@ "text": "ExpressionAstExpression" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -4972,7 +5104,13 @@ "text": "ExpressionAstExpression" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "expressions", @@ -5019,7 +5157,13 @@ "array of saved object references" ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -5076,7 +5220,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">) => ", { "pluginId": "expressions", @@ -5106,7 +5256,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -5325,7 +5481,13 @@ ], "signature": [ "((value: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ") => unknown) | undefined" ], "path": "src/plugins/expressions/common/expression_types/expression_type.ts", @@ -5341,7 +5503,13 @@ "description": [], "signature": [ "((serialized: unknown[]) => ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ") | undefined" ], "path": "src/plugins/expressions/common/expression_types/expression_type.ts", @@ -7011,7 +7179,13 @@ ], "signature": [ "(() => ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") | undefined" ], "path": "src/plugins/expressions/common/execution/types.ts", @@ -7085,7 +7259,13 @@ ], "signature": [ "() => ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/expressions/common/execution/types.ts", @@ -7288,7 +7468,13 @@ "description": [], "signature": [ "Omit<", - "Ast", + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.Ast", + "text": "Ast" + }, ", \"chain\"> & { chain: ", { "pluginId": "expressions", @@ -8140,9 +8326,21 @@ "text": "KnownTypeToString" }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited> | ", { "pluginId": "expressions", @@ -8397,7 +8595,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -8452,7 +8656,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -8491,7 +8701,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -8530,7 +8746,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -8569,7 +8791,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -8632,7 +8860,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -8695,7 +8929,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -8758,7 +8998,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -8821,7 +9067,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -9849,7 +10101,13 @@ "text": "ExpressionAstExpression" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -9897,7 +10155,13 @@ "text": "ExpressionAstExpression" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "expressions", @@ -9940,7 +10204,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -10370,7 +10640,13 @@ "label": "searchContext", "description": [], "signature": [ - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined" ], "path": "src/plugins/expressions/public/types/index.ts", @@ -10632,7 +10908,13 @@ "label": "executionContext", "description": [], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/expressions/public/types/index.ts", @@ -11006,7 +11288,13 @@ "description": [], "signature": [ "() => ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/expressions/common/expression_renderers/types.ts", @@ -11514,7 +11802,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -11710,7 +12004,13 @@ "description": [], "signature": [ "Omit<", - "Ast", + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.Ast", + "text": "Ast" + }, ", \"chain\"> & { chain: ", { "pluginId": "expressions", @@ -11735,7 +12035,13 @@ "description": [], "signature": [ "Omit<", - "AstFunction", + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.AstFunction", + "text": "AstFunction" + }, ", \"arguments\"> & { arguments: Record ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends string ? \"string\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends boolean ? \"boolean\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends number ? \"number\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends null ? \"null\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends { type: string; } ? ({ type: string; } & (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited))[\"type\"] : never" ], "path": "src/plugins/expressions/common/types/common.ts", @@ -13198,7 +13588,13 @@ "text": "ExecutionContext" }, "" ], "path": "src/plugins/expressions/common/execution/execution.ts", @@ -13329,7 +13725,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "src/plugins/expressions/common/execution/execution.ts", @@ -13894,7 +14296,13 @@ "description": [], "signature": [ " = Record>(logger?: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined, state?: ", { "pluginId": "expressions", @@ -13925,7 +14333,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -14071,7 +14485,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -14648,7 +15068,13 @@ "text": "ExpressionAstExpression" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "expressions", @@ -14691,7 +15117,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -14727,7 +15159,13 @@ "text": "ExpressionAstExpression" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -14859,7 +15297,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">) => ", { "pluginId": "expressions", @@ -14889,7 +15333,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -15210,7 +15660,13 @@ "text": "ExpressionAstArgument" }, "[]>; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/expressions/common/expression_functions/expression_function.ts", @@ -15259,7 +15715,13 @@ "text": "ExpressionAstArgument" }, "[]>, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => Record unknown) | undefined" ], "path": "src/plugins/expressions/common/expression_types/expression_type.ts", @@ -16458,7 +16932,13 @@ "description": [], "signature": [ "((serialized: unknown[]) => ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ") | undefined" ], "path": "src/plugins/expressions/common/expression_types/expression_type.ts", @@ -18046,7 +18526,13 @@ ], "signature": [ "(() => ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") | undefined" ], "path": "src/plugins/expressions/common/execution/types.ts", @@ -18120,7 +18606,13 @@ ], "signature": [ "() => ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/expressions/common/execution/types.ts", @@ -18323,7 +18815,13 @@ "description": [], "signature": [ "Omit<", - "Ast", + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.Ast", + "text": "Ast" + }, ", \"chain\"> & { chain: ", { "pluginId": "expressions", @@ -19144,9 +19642,21 @@ "text": "KnownTypeToString" }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited> | ", { "pluginId": "expressions", @@ -19401,7 +19911,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -19456,7 +19972,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -19495,7 +20017,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -19534,7 +20062,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -19573,7 +20107,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -19636,7 +20176,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -19699,7 +20245,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -19762,7 +20314,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -19825,7 +20383,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -20722,7 +21286,13 @@ "description": [], "signature": [ "() => ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/expressions/common/expression_renderers/types.ts", @@ -21094,7 +21664,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -21290,7 +21866,13 @@ "description": [], "signature": [ "Omit<", - "Ast", + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.Ast", + "text": "Ast" + }, ", \"chain\"> & { chain: ", { "pluginId": "expressions", @@ -21315,7 +21897,13 @@ "description": [], "signature": [ "Omit<", - "AstFunction", + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.AstFunction", + "text": "AstFunction" + }, ", \"arguments\"> & { arguments: Record ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends string ? \"string\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends boolean ? \"boolean\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends number ? \"number\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends null ? \"null\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends { type: string; } ? ({ type: string; } & (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited))[\"type\"] : never" ], "path": "src/plugins/expressions/common/types/common.ts", @@ -22037,7 +22709,13 @@ "text": "ExecutionContext" }, "" ], "path": "src/plugins/expressions/common/execution/execution.ts", @@ -22168,7 +22846,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "src/plugins/expressions/common/execution/execution.ts", @@ -22952,7 +23636,13 @@ "description": [], "signature": [ " = Record>(logger?: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined, state?: ", { "pluginId": "expressions", @@ -22983,7 +23673,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -23129,7 +23825,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -23706,7 +24408,13 @@ "text": "ExpressionAstExpression" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "expressions", @@ -23749,7 +24457,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -23785,7 +24499,13 @@ "text": "ExpressionAstExpression" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -23917,7 +24637,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">) => ", { "pluginId": "expressions", @@ -23947,7 +24673,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">" ], "path": "src/plugins/expressions/common/executor/executor.ts", @@ -24268,7 +25000,13 @@ "text": "ExpressionAstArgument" }, "[]>; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/expressions/common/expression_functions/expression_function.ts", @@ -24317,7 +25055,13 @@ "text": "ExpressionAstArgument" }, "[]>, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => Record ", { "pluginId": "expressions", @@ -26239,7 +27001,13 @@ "array of saved object references" ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -26296,7 +27064,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">) => ", { "pluginId": "expressions", @@ -26326,7 +27100,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -26545,7 +27325,13 @@ ], "signature": [ "((value: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ") => unknown) | undefined" ], "path": "src/plugins/expressions/common/expression_types/expression_type.ts", @@ -26561,7 +27347,13 @@ "description": [], "signature": [ "((serialized: unknown[]) => ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ") | undefined" ], "path": "src/plugins/expressions/common/expression_types/expression_type.ts", @@ -28070,7 +28862,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/expressions/common/util/test_utils.ts", @@ -29412,7 +30210,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined" ], "path": "src/plugins/expressions/common/expression_types/specs/datatable.ts", @@ -29445,7 +30249,13 @@ "\nany extra parameters for the source that produced this column" ], "signature": [ - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined" ], "path": "src/plugins/expressions/common/expression_types/specs/datatable.ts", @@ -29737,7 +30547,13 @@ ], "signature": [ "(() => ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") | undefined" ], "path": "src/plugins/expressions/common/execution/types.ts", @@ -29811,7 +30627,13 @@ ], "signature": [ "() => ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/expressions/common/execution/types.ts", @@ -30258,7 +31080,13 @@ "description": [], "signature": [ "Omit<", - "Ast", + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.Ast", + "text": "Ast" + }, ", \"chain\"> & { chain: ", { "pluginId": "expressions", @@ -31320,7 +32148,13 @@ "label": "searchContext", "description": [], "signature": [ - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -31367,7 +32201,13 @@ "\nMakes a `KibanaRequest` object available to expression functions. Useful for\nfunctions which are running on the server and need to perform operations that\nare scoped to a specific user." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, " | undefined" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -31459,7 +32299,13 @@ "label": "executionContext", "description": [], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -31479,6 +32325,42 @@ "path": "src/plugins/expressions/common/service/expressions_services.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "expressions", + "id": "def-common.ExpressionExecutionParams.partial", + "type": "CompoundType", + "tags": [ + "default" + ], + "label": "partial", + "description": [ + "\nToggles the partial results support." + ], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/expressions/common/service/expressions_services.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "expressions", + "id": "def-common.ExpressionExecutionParams.throttle", + "type": "number", + "tags": [ + "deafult" + ], + "label": "throttle", + "description": [ + "\nThrottling of partial results in milliseconds. 0 is disabling the throttling." + ], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/expressions/common/service/expressions_services.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -31602,9 +32484,21 @@ "text": "KnownTypeToString" }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited> | ", { "pluginId": "expressions", @@ -31859,7 +32753,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -31914,7 +32814,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -31953,7 +32859,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -31992,7 +32904,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -32031,7 +32949,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -32094,7 +33018,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -32157,7 +33087,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -32220,7 +33156,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -32283,7 +33225,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -32575,7 +33523,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -33523,7 +34477,13 @@ "text": "ExpressionAstExpression" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -33571,7 +34531,13 @@ "text": "ExpressionAstExpression" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "expressions", @@ -33614,7 +34580,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", @@ -34560,7 +35532,13 @@ "description": [], "signature": [ "() => ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "src/plugins/expressions/common/expression_renderers/types.ts", @@ -35325,7 +36303,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/types.ts", @@ -35573,7 +36557,13 @@ "description": [], "signature": [ "Omit<", - "Ast", + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.Ast", + "text": "Ast" + }, ", \"chain\"> & { chain: ", { "pluginId": "expressions", @@ -35598,7 +36588,13 @@ "description": [], "signature": [ "Omit<", - "AstFunction", + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.AstFunction", + "text": "AstFunction" + }, ", \"arguments\"> & { arguments: Record>" ], "path": "src/plugins/expressions/common/expression_functions/specs/clog.ts", @@ -35770,7 +36772,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/specs/cumulative_sum.ts", @@ -35834,7 +36842,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/specs/derivative.ts", @@ -35890,7 +36904,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", @@ -35954,7 +36974,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/specs/moving_average.ts", @@ -36018,7 +37044,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/specs/overall_metric.ts", @@ -36058,7 +37090,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/specs/theme.ts", @@ -36114,7 +37152,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/specs/ui_setting.ts", @@ -36154,7 +37198,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/specs/var.ts", @@ -36194,7 +37244,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/expressions/common/expression_functions/specs/var_set.ts", @@ -36311,7 +37367,13 @@ "text": "ErrorLike" }, "; info?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; }" ], "path": "src/plugins/expressions/common/expression_types/specs/error.ts", @@ -36484,7 +37546,13 @@ "text": "ErrorLike" }, "; info?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; }" ], "path": "src/plugins/expressions/common/expression_types/specs/error.ts", @@ -36540,7 +37608,7 @@ "section": "def-common.MathArguments", "text": "MathArguments" }, - " & { id: string; name?: string | undefined; copyMetaFrom?: string | null | undefined; }" + " & { id: string; name?: string | undefined; castColumns?: string[] | undefined; copyMetaFrom?: string | null | undefined; }" ], "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", "deprecated": false, @@ -36820,29 +37888,101 @@ ], "signature": [ "(T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends string ? \"string\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends boolean ? \"boolean\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends number ? \"number\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends null ? \"null\" : (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited) extends { type: string; } ? ({ type: string; } & (T extends ", - "ObservableLike", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.ObservableLike", + "text": "ObservableLike" + }, " ? ", - "UnwrapObservable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.UnwrapObservable", + "text": "UnwrapObservable" + }, " : Awaited))[\"type\"] : never" ], "path": "src/plugins/expressions/common/types/common.ts", @@ -37358,10 +38498,13 @@ { "parentPluginId": "expressions", "id": "def-common.createTable.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/create_table.ts", "deprecated": false, "trackAdoption": false @@ -37405,10 +38548,13 @@ { "parentPluginId": "expressions", "id": "def-common.createTable.args.ids.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/create_table.ts", "deprecated": false, "trackAdoption": false @@ -37471,10 +38617,13 @@ { "parentPluginId": "expressions", "id": "def-common.createTable.args.names.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/create_table.ts", "deprecated": false, "trackAdoption": false @@ -37537,10 +38686,13 @@ { "parentPluginId": "expressions", "id": "def-common.createTable.args.rowCount.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/create_table.ts", "deprecated": false, "trackAdoption": false @@ -37704,10 +38856,13 @@ { "parentPluginId": "expressions", "id": "def-common.cumulativeSum.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/cumulative_sum.ts", "deprecated": false, "trackAdoption": false @@ -37737,10 +38892,13 @@ { "parentPluginId": "expressions", "id": "def-common.cumulativeSum.args.by.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/cumulative_sum.ts", "deprecated": false, "trackAdoption": false @@ -37803,10 +38961,13 @@ { "parentPluginId": "expressions", "id": "def-common.cumulativeSum.args.inputColumnId.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/cumulative_sum.ts", "deprecated": false, "trackAdoption": false @@ -37855,10 +39016,13 @@ { "parentPluginId": "expressions", "id": "def-common.cumulativeSum.args.outputColumnId.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/cumulative_sum.ts", "deprecated": false, "trackAdoption": false @@ -37907,10 +39071,13 @@ { "parentPluginId": "expressions", "id": "def-common.cumulativeSum.args.outputColumnName.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/cumulative_sum.ts", "deprecated": false, "trackAdoption": false @@ -38518,10 +39685,13 @@ { "parentPluginId": "expressions", "id": "def-common.derivative.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/derivative.ts", "deprecated": false, "trackAdoption": false @@ -38551,10 +39721,13 @@ { "parentPluginId": "expressions", "id": "def-common.derivative.args.by.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/derivative.ts", "deprecated": false, "trackAdoption": false @@ -38617,10 +39790,13 @@ { "parentPluginId": "expressions", "id": "def-common.derivative.args.inputColumnId.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/derivative.ts", "deprecated": false, "trackAdoption": false @@ -38669,10 +39845,13 @@ { "parentPluginId": "expressions", "id": "def-common.derivative.args.outputColumnId.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/derivative.ts", "deprecated": false, "trackAdoption": false @@ -38721,10 +39900,13 @@ { "parentPluginId": "expressions", "id": "def-common.derivative.args.outputColumnName.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/derivative.ts", "deprecated": false, "trackAdoption": false @@ -39305,10 +40487,13 @@ { "parentPluginId": "expressions", "id": "def-common.font.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", "deprecated": false, "trackAdoption": false @@ -39363,10 +40548,13 @@ { "parentPluginId": "expressions", "id": "def-common.font.args.align.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", "deprecated": false, "trackAdoption": false @@ -39433,10 +40621,13 @@ { "parentPluginId": "expressions", "id": "def-common.font.args.color.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", "deprecated": false, "trackAdoption": false @@ -39482,10 +40673,13 @@ { "parentPluginId": "expressions", "id": "def-common.font.args.family.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", "deprecated": false, "trackAdoption": false @@ -39531,10 +40725,13 @@ { "parentPluginId": "expressions", "id": "def-common.font.args.italic.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", "deprecated": false, "trackAdoption": false @@ -39608,10 +40805,13 @@ { "parentPluginId": "expressions", "id": "def-common.font.args.lHeight.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", "deprecated": false, "trackAdoption": false @@ -39657,10 +40857,13 @@ { "parentPluginId": "expressions", "id": "def-common.font.args.size.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", "deprecated": false, "trackAdoption": false @@ -39706,10 +40909,13 @@ { "parentPluginId": "expressions", "id": "def-common.font.args.sizeUnit.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", "deprecated": false, "trackAdoption": false @@ -39769,10 +40975,13 @@ { "parentPluginId": "expressions", "id": "def-common.font.args.underline.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", "deprecated": false, "trackAdoption": false @@ -39832,10 +41041,13 @@ { "parentPluginId": "expressions", "id": "def-common.font.args.weight.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/font.ts", "deprecated": false, "trackAdoption": false @@ -40214,10 +41426,13 @@ { "parentPluginId": "expressions", "id": "def-common.mapColumn.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/map_column.ts", "deprecated": false, "trackAdoption": false @@ -40261,10 +41476,13 @@ { "parentPluginId": "expressions", "id": "def-common.mapColumn.args.id.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/map_column.ts", "deprecated": false, "trackAdoption": false @@ -40341,10 +41559,13 @@ { "parentPluginId": "expressions", "id": "def-common.mapColumn.args.name.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/map_column.ts", "deprecated": false, "trackAdoption": false @@ -40421,10 +41642,13 @@ { "parentPluginId": "expressions", "id": "def-common.mapColumn.args.expression.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/map_column.ts", "deprecated": false, "trackAdoption": false @@ -40473,10 +41697,13 @@ { "parentPluginId": "expressions", "id": "def-common.mapColumn.args.copyMetaFrom.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/map_column.ts", "deprecated": false, "trackAdoption": false @@ -40675,10 +41902,13 @@ { "parentPluginId": "expressions", "id": "def-common.math.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/math.ts", "deprecated": false, "trackAdoption": false @@ -40736,10 +41966,13 @@ { "parentPluginId": "expressions", "id": "def-common.math.args.expression.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/math.ts", "deprecated": false, "trackAdoption": false @@ -40788,10 +42021,13 @@ { "parentPluginId": "expressions", "id": "def-common.math.args.onError.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/math.ts", "deprecated": false, "trackAdoption": false @@ -40934,10 +42170,13 @@ { "parentPluginId": "expressions", "id": "def-common.mathColumn.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", "deprecated": false, "trackAdoption": false @@ -40995,10 +42234,13 @@ { "parentPluginId": "expressions", "id": "def-common.mathColumn.args.id.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", "deprecated": false, "trackAdoption": false @@ -41061,10 +42303,13 @@ { "parentPluginId": "expressions", "id": "def-common.mathColumn.args.name.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", "deprecated": false, "trackAdoption": false @@ -41085,6 +42330,75 @@ } ] }, + { + "parentPluginId": "expressions", + "id": "def-common.mathColumn.args.castColumns", + "type": "Object", + "tags": [], + "label": "castColumns", + "description": [], + "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "expressions", + "id": "def-common.mathColumn.args.castColumns.types", + "type": "Array", + "tags": [], + "label": "types", + "description": [], + "signature": [ + "\"string\"[]" + ], + "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "expressions", + "id": "def-common.mathColumn.args.castColumns.multi", + "type": "boolean", + "tags": [], + "label": "multi", + "description": [], + "signature": [ + "true" + ], + "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "expressions", + "id": "def-common.mathColumn.args.castColumns.help", + "type": "Any", + "tags": [], + "label": "help", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "expressions", + "id": "def-common.mathColumn.args.castColumns.required", + "type": "boolean", + "tags": [], + "label": "required", + "description": [], + "signature": [ + "false" + ], + "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, { "parentPluginId": "expressions", "id": "def-common.mathColumn.args.copyMetaFrom", @@ -41113,10 +42427,13 @@ { "parentPluginId": "expressions", "id": "def-common.mathColumn.args.copyMetaFrom.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", "deprecated": false, "trackAdoption": false @@ -41194,7 +42511,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => Promise<", { "pluginId": "expressions", @@ -41275,7 +42598,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/expressions/common/expression_functions/specs/math_column.ts", @@ -41347,10 +42676,13 @@ { "parentPluginId": "expressions", "id": "def-common.movingAverage.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/moving_average.ts", "deprecated": false, "trackAdoption": false @@ -41380,10 +42712,13 @@ { "parentPluginId": "expressions", "id": "def-common.movingAverage.args.by.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/moving_average.ts", "deprecated": false, "trackAdoption": false @@ -41446,10 +42781,13 @@ { "parentPluginId": "expressions", "id": "def-common.movingAverage.args.inputColumnId.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/moving_average.ts", "deprecated": false, "trackAdoption": false @@ -41498,10 +42836,13 @@ { "parentPluginId": "expressions", "id": "def-common.movingAverage.args.outputColumnId.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/moving_average.ts", "deprecated": false, "trackAdoption": false @@ -41550,10 +42891,13 @@ { "parentPluginId": "expressions", "id": "def-common.movingAverage.args.outputColumnName.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/moving_average.ts", "deprecated": false, "trackAdoption": false @@ -41602,10 +42946,13 @@ { "parentPluginId": "expressions", "id": "def-common.movingAverage.args.window.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/moving_average.ts", "deprecated": false, "trackAdoption": false @@ -42361,10 +43708,13 @@ { "parentPluginId": "expressions", "id": "def-common.overallMetric.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/overall_metric.ts", "deprecated": false, "trackAdoption": false @@ -42394,10 +43744,13 @@ { "parentPluginId": "expressions", "id": "def-common.overallMetric.args.by.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/overall_metric.ts", "deprecated": false, "trackAdoption": false @@ -42460,10 +43813,13 @@ { "parentPluginId": "expressions", "id": "def-common.overallMetric.args.metric.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/overall_metric.ts", "deprecated": false, "trackAdoption": false @@ -42512,10 +43868,13 @@ { "parentPluginId": "expressions", "id": "def-common.overallMetric.args.inputColumnId.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/overall_metric.ts", "deprecated": false, "trackAdoption": false @@ -42564,10 +43923,13 @@ { "parentPluginId": "expressions", "id": "def-common.overallMetric.args.outputColumnId.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/overall_metric.ts", "deprecated": false, "trackAdoption": false @@ -42616,10 +43978,13 @@ { "parentPluginId": "expressions", "id": "def-common.overallMetric.args.outputColumnName.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/overall_metric.ts", "deprecated": false, "trackAdoption": false @@ -43880,10 +45245,13 @@ { "parentPluginId": "expressions", "id": "def-common.theme.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/theme.ts", "deprecated": false, "trackAdoption": false @@ -43941,10 +45309,13 @@ { "parentPluginId": "expressions", "id": "def-common.theme.args.variable.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/theme.ts", "deprecated": false, "trackAdoption": false @@ -43993,10 +45364,13 @@ { "parentPluginId": "expressions", "id": "def-common.theme.args.default.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/theme.ts", "deprecated": false, "trackAdoption": false @@ -44030,7 +45404,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => any" ], "path": "src/plugins/expressions/common/expression_functions/specs/theme.ts", @@ -44091,7 +45471,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/expressions/common/expression_functions/specs/theme.ts", @@ -44419,10 +45805,13 @@ { "parentPluginId": "expressions", "id": "def-common.variable.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/var.ts", "deprecated": false, "trackAdoption": false @@ -44494,10 +45883,13 @@ { "parentPluginId": "expressions", "id": "def-common.variable.args.name.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/var.ts", "deprecated": false, "trackAdoption": false @@ -44531,7 +45923,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => unknown" ], "path": "src/plugins/expressions/common/expression_functions/specs/var.ts", @@ -44592,7 +45990,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/expressions/common/expression_functions/specs/var.ts", @@ -44634,10 +46038,13 @@ { "parentPluginId": "expressions", "id": "def-common.variableSet.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/var_set.ts", "deprecated": false, "trackAdoption": false @@ -44723,10 +46130,13 @@ { "parentPluginId": "expressions", "id": "def-common.variableSet.args.name.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/var_set.ts", "deprecated": false, "trackAdoption": false @@ -44775,10 +46185,13 @@ { "parentPluginId": "expressions", "id": "def-common.variableSet.args.value.help", - "type": "string", + "type": "Any", "tags": [], "label": "help", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/expressions/common/expression_functions/specs/var_set.ts", "deprecated": false, "trackAdoption": false @@ -44812,7 +46225,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => unknown" ], "path": "src/plugins/expressions/common/expression_functions/specs/var_set.ts", @@ -44873,7 +46292,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/expressions/common/expression_functions/specs/var_set.ts", diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index d45c4de592f8d..3ecdb4b661c40 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2191 | 17 | 1734 | 5 | +| 2198 | 74 | 1739 | 5 | ## Client diff --git a/api_docs/features.devdocs.json b/api_docs/features.devdocs.json index cbbe75fe20fa4..0305784bbed93 100644 --- a/api_docs/features.devdocs.json +++ b/api_docs/features.devdocs.json @@ -56,7 +56,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; requireAllSpaces?: boolean | undefined; privilegesTooltip?: string | undefined; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -352,14 +352,14 @@ "plugin": "security", "path": "x-pack/plugins/security/server/lib/role_utils.ts" }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/plugin.ts" }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts" + }, { "plugin": "security", "path": "x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts" @@ -372,6 +372,10 @@ "plugin": "security", "path": "x-pack/plugins/security/server/routes/authorization/roles/put.test.ts" }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts" + }, { "plugin": "security", "path": "x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts" @@ -562,7 +566,13 @@ "\nThe category for this feature.\nThis will be used to organize the list of features for display within the\nSpaces and Roles management screens." ], "signature": [ - "AppCategory" + { + "pluginId": "@kbn/core-application-common", + "scope": "common", + "docId": "kibKbnCoreApplicationCommonPluginApi", + "section": "def-common.AppCategory", + "text": "AppCategory" + } ], "path": "x-pack/plugins/features/common/kibana_feature.ts", "deprecated": false, @@ -817,6 +827,38 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "features", + "id": "def-public.SubFeatureConfig.requireAllSpaces", + "type": "CompoundType", + "tags": [], + "label": "requireAllSpaces", + "description": [ + "\nWhether or not this privilege should only be granted to `All Spaces *`. Should be used for features that do not\nsupport Spaces. Defaults to `false`." + ], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/features/common/sub_feature.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "features", + "id": "def-public.SubFeatureConfig.privilegesTooltip", + "type": "string", + "tags": [], + "label": "privilegesTooltip", + "description": [ + "\nOptional message to display on the Role Management screen when configuring permissions for this feature." + ], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/features/common/sub_feature.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "features", "id": "def-public.SubFeatureConfig.privilegeGroups", @@ -1017,11 +1059,29 @@ "description": [], "signature": [ "Readonly<{ id: string; management?: Readonly<{ [x: string]: ", - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, "; }> | undefined; catalogue?: ", - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, " | undefined; privileges: ", - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, "<", { "pluginId": "features", @@ -1059,7 +1119,13 @@ "label": "catalogue", "description": [], "signature": [ - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, " | undefined" ], "path": "x-pack/plugins/features/common/elasticsearch_feature.ts", @@ -1075,7 +1141,13 @@ "description": [], "signature": [ "Readonly<{ [x: string]: ", - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, "; }> | undefined" ], "path": "x-pack/plugins/features/common/elasticsearch_feature.ts", @@ -1090,7 +1162,13 @@ "label": "privileges", "description": [], "signature": [ - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, "<", { "pluginId": "features", @@ -1185,7 +1263,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; requireAllSpaces?: boolean | undefined; privilegesTooltip?: string | undefined; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -1660,14 +1738,14 @@ "plugin": "security", "path": "x-pack/plugins/security/server/lib/role_utils.ts" }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/plugin.ts" }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts" + }, { "plugin": "security", "path": "x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts" @@ -1680,6 +1758,10 @@ "plugin": "security", "path": "x-pack/plugins/security/server/routes/authorization/roles/put.test.ts" }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts" + }, { "plugin": "security", "path": "x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts" @@ -1870,7 +1952,13 @@ "\nThe category for this feature.\nThis will be used to organize the list of features for display within the\nSpaces and Roles management screens." ], "signature": [ - "AppCategory" + { + "pluginId": "@kbn/core-application-common", + "scope": "common", + "docId": "kibKbnCoreApplicationCommonPluginApi", + "section": "def-common.AppCategory", + "text": "AppCategory" + } ], "path": "x-pack/plugins/features/common/kibana_feature.ts", "deprecated": false, @@ -2395,7 +2483,13 @@ "description": [], "signature": [ "() => ", - "Capabilities" + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + } ], "path": "x-pack/plugins/features/server/plugin.ts", "deprecated": false, @@ -2700,11 +2794,29 @@ "description": [], "signature": [ "Readonly<{ id: string; management?: Readonly<{ [x: string]: ", - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, "; }> | undefined; catalogue?: ", - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, " | undefined; privileges: ", - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, "<", { "pluginId": "features", @@ -2742,7 +2854,13 @@ "label": "catalogue", "description": [], "signature": [ - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, " | undefined" ], "path": "x-pack/plugins/features/common/elasticsearch_feature.ts", @@ -2758,7 +2876,13 @@ "description": [], "signature": [ "Readonly<{ [x: string]: ", - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, "; }> | undefined" ], "path": "x-pack/plugins/features/common/elasticsearch_feature.ts", @@ -2773,7 +2897,13 @@ "label": "privileges", "description": [], "signature": [ - "RecursiveReadonlyArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonlyArray", + "text": "RecursiveReadonlyArray" + }, "<", { "pluginId": "features", @@ -2868,7 +2998,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; requireAllSpaces?: boolean | undefined; disabled?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; push?: readonly string[] | undefined; create?: readonly string[] | undefined; read?: readonly string[] | undefined; update?: readonly string[] | undefined; delete?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; requireAllSpaces?: boolean | undefined; privilegesTooltip?: string | undefined; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -3118,7 +3248,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "Readonly<{ name: string; requireAllSpaces?: boolean | undefined; privilegesTooltip?: string | undefined; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -3169,6 +3299,17 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "features", + "id": "def-common.SubFeature.requireAllSpaces", + "type": "boolean", + "tags": [], + "label": "requireAllSpaces", + "description": [], + "path": "x-pack/plugins/features/common/sub_feature.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "features", "id": "def-common.SubFeature.toRaw", @@ -3177,7 +3318,7 @@ "label": "toRaw", "description": [], "signature": [ - "() => { name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "() => { name: string; requireAllSpaces?: boolean | undefined; privilegesTooltip?: string | undefined; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -3454,14 +3595,14 @@ "plugin": "security", "path": "x-pack/plugins/security/server/lib/role_utils.ts" }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/plugin.ts" }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts" + }, { "plugin": "security", "path": "x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts" @@ -3474,6 +3615,10 @@ "plugin": "security", "path": "x-pack/plugins/security/server/routes/authorization/roles/put.test.ts" }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts" + }, { "plugin": "security", "path": "x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts" @@ -3664,7 +3809,13 @@ "\nThe category for this feature.\nThis will be used to organize the list of features for display within the\nSpaces and Roles management screens." ], "signature": [ - "AppCategory" + { + "pluginId": "@kbn/core-application-common", + "scope": "common", + "docId": "kibKbnCoreApplicationCommonPluginApi", + "section": "def-common.AppCategory", + "text": "AppCategory" + } ], "path": "x-pack/plugins/features/common/kibana_feature.ts", "deprecated": false, @@ -3919,6 +4070,38 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "features", + "id": "def-common.SubFeatureConfig.requireAllSpaces", + "type": "CompoundType", + "tags": [], + "label": "requireAllSpaces", + "description": [ + "\nWhether or not this privilege should only be granted to `All Spaces *`. Should be used for features that do not\nsupport Spaces. Defaults to `false`." + ], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/features/common/sub_feature.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "features", + "id": "def-common.SubFeatureConfig.privilegesTooltip", + "type": "string", + "tags": [], + "label": "privilegesTooltip", + "description": [ + "\nOptional message to display on the Role Management screen when configuring permissions for this feature." + ], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/features/common/sub_feature.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "features", "id": "def-common.SubFeatureConfig.privilegeGroups", diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 36a30ac629632..9669a4dd7dc83 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] --- import featuresObj from './features.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 222 | 0 | 95 | 2 | +| 227 | 0 | 96 | 2 | ## Client diff --git a/api_docs/field_formats.devdocs.json b/api_docs/field_formats.devdocs.json index e072b2ca996b4..ee79971c21c0d 100644 --- a/api_docs/field_formats.devdocs.json +++ b/api_docs/field_formats.devdocs.json @@ -53,10 +53,13 @@ { "parentPluginId": "fieldFormats", "id": "def-public.DateFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/public/lib/converters/date.ts", "deprecated": false, "trackAdoption": false @@ -69,7 +72,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/public/lib/converters/date.ts", "deprecated": false, @@ -84,9 +93,21 @@ "description": [], "signature": [ "() => { pattern: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; timezone: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; }" ], "path": "src/plugins/field_formats/public/lib/converters/date.ts", @@ -175,10 +196,13 @@ { "parentPluginId": "fieldFormats", "id": "def-public.DateNanosFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/date_nanos_shared.ts", "deprecated": false, "trackAdoption": false @@ -191,7 +215,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/converters/date_nanos_shared.ts", "deprecated": false, @@ -242,11 +272,29 @@ "description": [], "signature": [ "() => { pattern: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; fallbackPattern: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; timezone: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; }" ], "path": "src/plugins/field_formats/common/converters/date_nanos_shared.ts", @@ -406,10 +454,13 @@ { "parentPluginId": "fieldFormats", "id": "def-server.DateFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/server/lib/converters/date_server.ts", "deprecated": false, "trackAdoption": false @@ -422,7 +473,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/server/lib/converters/date_server.ts", "deprecated": false, @@ -451,7 +508,13 @@ "description": [], "signature": [ "(", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " & ", { "pluginId": "fieldFormats", @@ -483,7 +546,13 @@ "text": "FieldFormatsGetConfigFn" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "> | undefined" ], "path": "src/plugins/field_formats/server/lib/converters/date_server.ts", @@ -503,9 +572,21 @@ "description": [], "signature": [ "() => { pattern: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; timezone: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; }" ], "path": "src/plugins/field_formats/server/lib/converters/date_server.ts", @@ -753,7 +834,13 @@ ], "signature": [ "(uiSettings: ", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.IUiSettingsClient", + "text": "IUiSettingsClient" + }, ") => Promise<", { "pluginId": "fieldFormats", @@ -778,7 +865,13 @@ "- {@link IUiSettingsClient }" ], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "src/plugins/field_formats/server/types.ts", "deprecated": false, @@ -846,10 +939,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.BoolFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/boolean.ts", "deprecated": false, "trackAdoption": false @@ -862,7 +958,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "[]" ], "path": "src/plugins/field_formats/common/converters/boolean.ts", @@ -979,10 +1081,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.BytesFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/bytes.ts", "deprecated": false, "trackAdoption": false @@ -1010,10 +1115,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.BytesFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/bytes.ts", "deprecated": false, "trackAdoption": false @@ -1083,10 +1191,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.ColorFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/color.tsx", "deprecated": false, "trackAdoption": false @@ -1099,7 +1210,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "[]" ], "path": "src/plugins/field_formats/common/converters/color.tsx", @@ -1270,10 +1387,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.DurationFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/duration.ts", "deprecated": false, "trackAdoption": false @@ -1286,7 +1406,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/converters/duration.ts", "deprecated": false, @@ -1300,7 +1426,7 @@ "label": "inputFormats", "description": [], "signature": [ - "{ text: string; kind: string; }[]" + "{ text: any; kind: string; }[]" ], "path": "src/plugins/field_formats/common/converters/duration.ts", "deprecated": false, @@ -1314,7 +1440,7 @@ "label": "outputFormats", "description": [], "signature": [ - "({ text: string; method: string; shortText?: undefined; } | { text: string; shortText: string; method: string; })[]" + "({ text: any; method: string; shortText?: undefined; } | { text: any; shortText: any; method: string; })[]" ], "path": "src/plugins/field_formats/common/converters/duration.ts", "deprecated": false, @@ -1604,7 +1730,13 @@ "label": "_params", "description": [], "signature": [ - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " & ", { "pluginId": "fieldFormats", @@ -1634,7 +1766,13 @@ "text": "FieldFormatsGetConfigFn" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "> | undefined" ], "path": "src/plugins/field_formats/common/field_format.ts", @@ -1663,7 +1801,13 @@ "label": "_params", "description": [], "signature": [ - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " & ", { "pluginId": "fieldFormats", @@ -1694,7 +1838,13 @@ "text": "FieldFormatsGetConfigFn" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "> | undefined" ], "path": "src/plugins/field_formats/common/field_format.ts", @@ -1892,7 +2042,13 @@ ], "signature": [ "() => ", - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/field_formats/common/field_format.ts", "deprecated": false, @@ -1955,7 +2111,13 @@ ], "signature": [ "() => ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " & ", { "pluginId": "fieldFormats", @@ -1984,7 +2146,13 @@ ], "signature": [ "() => { id: string; params: (", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " & ", { "pluginId": "fieldFormats", @@ -2192,7 +2360,13 @@ "text": "FieldFormatsGetConfigFn" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "> | undefined" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2216,7 +2390,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined) => ", { "pluginId": "fieldFormats", @@ -2246,7 +2426,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2274,7 +2460,13 @@ "text": "FieldFormatsGetConfigFn" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">, metaParamsOptions?: ", { "pluginId": "fieldFormats", @@ -2313,7 +2505,13 @@ "text": "FieldFormatsGetConfigFn" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2380,9 +2578,21 @@ ], "signature": [ "(fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", { "pluginId": "fieldFormats", @@ -2406,7 +2616,13 @@ "- the field type" ], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -2423,7 +2639,13 @@ "- Array of ES data types" ], "signature": [ - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2533,9 +2755,21 @@ ], "signature": [ "(fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", { "pluginId": "fieldFormats", @@ -2558,7 +2792,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -2575,7 +2815,13 @@ "- Array of ES data types" ], "signature": [ - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2599,9 +2845,21 @@ ], "signature": [ "(esTypes: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, " | undefined" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2618,7 +2876,13 @@ "- Array of ES data types" ], "signature": [ - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2642,13 +2906,37 @@ ], "signature": [ "(fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, " | ", - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -2662,7 +2950,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -2677,7 +2971,13 @@ "label": "esTypes", "description": [], "signature": [ - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2701,7 +3001,13 @@ ], "signature": [ "(formatId: string, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -2738,7 +3044,13 @@ "label": "params", "description": [], "signature": [ - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -2761,11 +3073,29 @@ ], "signature": [ "(fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -2787,7 +3117,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -2802,7 +3138,13 @@ "label": "esTypes", "description": [], "signature": [ - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2818,7 +3160,13 @@ "label": "params", "description": [], "signature": [ - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -2841,9 +3189,21 @@ ], "signature": [ "(fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => string" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2858,7 +3218,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -2873,7 +3239,13 @@ "label": "esTypes", "description": [], "signature": [ - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -2897,7 +3269,13 @@ ], "signature": [ "(fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ") => ", { "pluginId": "fieldFormats", @@ -2920,7 +3298,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -2943,11 +3327,29 @@ ], "signature": [ "(fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -2969,7 +3371,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -2984,7 +3392,13 @@ "label": "esTypes", "description": [], "signature": [ - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined" ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", @@ -3000,7 +3414,13 @@ "label": "params", "description": [], "signature": [ - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/field_formats/common/field_formats_registry.ts", "deprecated": false, @@ -3193,10 +3613,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.GeoPointFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/geo_point.ts", "deprecated": false, "trackAdoption": false @@ -3209,7 +3632,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "[]" ], "path": "src/plugins/field_formats/common/converters/geo_point.ts", @@ -3224,7 +3653,7 @@ "label": "transformOptions", "description": [], "signature": [ - "{ kind: string; text: string; }[]" + "{ kind: string; text: any; }[]" ], "path": "src/plugins/field_formats/common/converters/geo_point.ts", "deprecated": false, @@ -3367,7 +3796,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/converters/histogram.ts", "deprecated": false, @@ -3376,10 +3811,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.HistogramFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/histogram.ts", "deprecated": false, "trackAdoption": false @@ -3407,10 +3845,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.HistogramFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/histogram.ts", "deprecated": false, "trackAdoption": false @@ -3558,10 +3999,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.IpFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/ip.ts", "deprecated": false, "trackAdoption": false @@ -3574,7 +4018,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/converters/ip.ts", "deprecated": false, @@ -3660,10 +4110,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.NumberFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/number.ts", "deprecated": false, "trackAdoption": false @@ -3691,10 +4144,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.NumberFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/number.ts", "deprecated": false, "trackAdoption": false @@ -3758,10 +4214,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.PercentFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/percent.ts", "deprecated": false, "trackAdoption": false @@ -3789,10 +4248,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.PercentFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/percent.ts", "deprecated": false, "trackAdoption": false @@ -3817,7 +4279,13 @@ "description": [], "signature": [ "() => { pattern: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "; fractional: boolean; }" ], "path": "src/plugins/field_formats/common/converters/percent.ts", @@ -3912,10 +4380,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.RelativeDateFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/relative_date.ts", "deprecated": false, "trackAdoption": false @@ -3928,7 +4399,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/converters/relative_date.ts", "deprecated": false, @@ -4020,10 +4497,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.StaticLookupFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/static_lookup.ts", "deprecated": false, "trackAdoption": false @@ -4036,7 +4516,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "[]" ], "path": "src/plugins/field_formats/common/converters/static_lookup.ts", @@ -4145,10 +4631,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.StringFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/string.ts", "deprecated": false, "trackAdoption": false @@ -4161,7 +4650,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "[]" ], "path": "src/plugins/field_formats/common/converters/string.ts", @@ -4176,7 +4671,7 @@ "label": "transformOptions", "description": [], "signature": [ - "({ kind: boolean; text: string; } | { kind: string; text: string; })[]" + "({ kind: boolean; text: any; } | { kind: string; text: any; })[]" ], "path": "src/plugins/field_formats/common/converters/string.ts", "deprecated": false, @@ -4214,7 +4709,7 @@ "section": "def-common.TextContextTypeOptions", "text": "TextContextTypeOptions" }, - " | undefined) => string" + " | undefined) => any" ], "path": "src/plugins/field_formats/common/converters/string.ts", "deprecated": false, @@ -4376,10 +4871,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.TruncateFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/truncate.ts", "deprecated": false, "trackAdoption": false @@ -4392,7 +4890,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "src/plugins/field_formats/common/converters/truncate.ts", "deprecated": false, @@ -4484,10 +4988,13 @@ { "parentPluginId": "fieldFormats", "id": "def-common.UrlFormat.title", - "type": "string", + "type": "Any", "tags": [], "label": "title", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/field_formats/common/converters/url.ts", "deprecated": false, "trackAdoption": false @@ -4500,7 +5007,13 @@ "label": "fieldType", "description": [], "signature": [ - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "[]" ], "path": "src/plugins/field_formats/common/converters/url.ts", @@ -4515,7 +5028,7 @@ "label": "urlTypes", "description": [], "signature": [ - "{ kind: string; text: string; }[]" + "{ kind: string; text: any; }[]" ], "path": "src/plugins/field_formats/common/converters/url.ts", "deprecated": false, @@ -4543,7 +5056,13 @@ "label": "params", "description": [], "signature": [ - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " & ", { "pluginId": "fieldFormats", @@ -5024,7 +5543,13 @@ "description": [], "signature": [ "{ id: string; params: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "; es?: boolean | undefined; }" ], "path": "src/plugins/field_formats/common/types.ts", @@ -5093,7 +5618,13 @@ ], "signature": [ "(new (params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined, getConfig?: ", { "pluginId": "fieldFormats", @@ -5103,7 +5634,13 @@ "text": "FieldFormatsGetConfigFn" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, "> | undefined) => ", { "pluginId": "fieldFormats", @@ -5129,7 +5666,13 @@ "\nParams provided when creating a formatter.\nParams are vary per formatter\n\nTODO: support strict typing for params depending on format type\nhttps://github.com/elastic/kibana/issues/108158" ], "signature": [ - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " & P" ], "path": "src/plugins/field_formats/common/types.ts", @@ -5214,9 +5757,21 @@ "text": "FormatFactory" }, "; getDefaultConfig: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", { "pluginId": "fieldFormats", @@ -5242,9 +5797,21 @@ "text": "FieldFormatInstanceType" }, " | undefined; getDefaultType: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", { "pluginId": "fieldFormats", @@ -5254,19 +5821,61 @@ "text": "FieldFormatInstanceType" }, " | undefined; getTypeNameByEsTypes: (esTypes: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, " | undefined; getDefaultTypeName: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, " | ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "; getInstance: (formatId: string, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -5276,11 +5885,29 @@ "text": "FieldFormat" }, "; getDefaultInstancePlain: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -5290,11 +5917,29 @@ "text": "FieldFormat" }, "; getDefaultInstanceCacheResolver: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => string; getByFieldType: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ") => ", { "pluginId": "fieldFormats", @@ -5304,11 +5949,29 @@ "text": "FieldFormatInstanceType" }, "[]; getDefaultInstance: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -5518,7 +6181,13 @@ "text": "FieldFormatsGetConfigFn" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">, metaParamsOptions?: ", { "pluginId": "fieldFormats", @@ -5552,9 +6221,21 @@ "text": "FieldFormatInstanceType" }, "[]) => void; getDefaultConfig: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", { "pluginId": "fieldFormats", @@ -5580,9 +6261,21 @@ "text": "FieldFormatInstanceType" }, " | undefined; getDefaultType: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", { "pluginId": "fieldFormats", @@ -5592,19 +6285,61 @@ "text": "FieldFormatInstanceType" }, " | undefined; getTypeNameByEsTypes: (esTypes: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, " | undefined; getDefaultTypeName: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, " | ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, "; getInstance: (formatId: string, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -5614,11 +6349,29 @@ "text": "FieldFormat" }, "; getDefaultInstancePlain: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", @@ -5628,11 +6381,29 @@ "text": "FieldFormat" }, "; getDefaultInstanceCacheResolver: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined) => string; getByFieldType: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ") => ", { "pluginId": "fieldFormats", @@ -5642,11 +6413,29 @@ "text": "FieldFormatInstanceType" }, "[]; getDefaultInstance: (fieldType: ", - "KBN_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, ", esTypes?: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, "[] | undefined, params?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ") => ", { "pluginId": "fieldFormats", diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 1e32b5a52ee8d..d1dc915034891 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 288 | 5 | 249 | 3 | +| 288 | 26 | 249 | 3 | ## Client diff --git a/api_docs/file_upload.devdocs.json b/api_docs/file_upload.devdocs.json index afba8b7312153..f25468cc2ce79 100644 --- a/api_docs/file_upload.devdocs.json +++ b/api_docs/file_upload.devdocs.json @@ -242,9 +242,21 @@ "label": "geoFieldType", "description": [], "signature": [ - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".GEO_POINT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".GEO_SHAPE" ], "path": "x-pack/plugins/file_upload/public/lazy_load_bundle/index.ts", @@ -604,71 +616,269 @@ "description": [], "signature": [ "{ properties: { [fieldName: string]: { type: ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".STRING | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".TEXT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".MATCH_ONLY_TEXT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".KEYWORD | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".VERSION | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".BOOLEAN | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".OBJECT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".DATE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".DATE_NANOS | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".DATE_RANGE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".GEO_POINT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".GEO_SHAPE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".FLOAT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".HALF_FLOAT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".SCALED_FLOAT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".DOUBLE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".INTEGER | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".LONG | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".SHORT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".UNSIGNED_LONG | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".AGGREGATE_METRIC_DOUBLE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".FLOAT_RANGE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".DOUBLE_RANGE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".INTEGER_RANGE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".LONG_RANGE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".NESTED | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".BYTE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".IP | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".IP_RANGE | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".ATTACHMENT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".TOKEN_COUNT | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".MURMUR3 | ", - "ES_FIELD_TYPES", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, ".HISTOGRAM; format?: string | undefined; }; }; }" ], "path": "x-pack/plugins/file_upload/common/types.ts", diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index f556da2c06bd3..9f7f7a3883b9f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.devdocs.json b/api_docs/files.devdocs.json index dcabddd455d1a..55601ee2dbb95 100644 --- a/api_docs/files.devdocs.json +++ b/api_docs/files.devdocs.json @@ -21,7 +21,7 @@ }, ") => JSX.Element" ], - "path": "x-pack/plugins/files/public/components/file_picker/index.tsx", + "path": "src/plugins/files/public/components/file_picker/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -42,7 +42,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/components/file_picker/index.tsx", + "path": "src/plugins/files/public/components/file_picker/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -61,7 +61,7 @@ "signature": [ "({ client, children }: React.PropsWithChildren) => JSX.Element" ], - "path": "x-pack/plugins/files/public/components/context.tsx", + "path": "src/plugins/files/public/components/context.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -75,7 +75,7 @@ "signature": [ "React.PropsWithChildren" ], - "path": "x-pack/plugins/files/public/components/context.tsx", + "path": "src/plugins/files/public/components/context.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -106,7 +106,7 @@ }, " & React.RefAttributes>" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -146,7 +146,7 @@ }, ") => JSX.Element" ], - "path": "x-pack/plugins/files/public/components/upload_file/index.tsx", + "path": "src/plugins/files/public/components/upload_file/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -167,7 +167,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/components/upload_file/index.tsx", + "path": "src/plugins/files/public/components/upload_file/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -197,7 +197,7 @@ }, " extends GlobalEndpoints" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -221,7 +221,7 @@ }, "; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -238,7 +238,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -256,7 +256,7 @@ "signature": [ "(args: Readonly<{} & { id: string; }> & { abortSignal?: AbortSignal | undefined; } & { kind: string; }) => Promise<{ ok: true; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -273,7 +273,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -299,7 +299,7 @@ }, "; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -316,7 +316,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -342,7 +342,7 @@ }, "[]; total: number; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -359,7 +359,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -385,7 +385,7 @@ }, "; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -402,7 +402,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -420,7 +420,7 @@ "signature": [ "(args: Readonly<{} & { id: string; }> & Readonly<{ selfDestructOnAbort?: boolean | undefined; } & {}> & { body: unknown; kind: string; abortSignal?: AbortSignal | undefined; contentType?: string | undefined; }) => Promise<{ ok: true; size: number; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -436,7 +436,7 @@ "signature": [ "Readonly<{} & { id: string; }> & Readonly<{ selfDestructOnAbort?: boolean | undefined; } & {}> & { body: unknown; kind: string; abortSignal?: AbortSignal | undefined; contentType?: string | undefined; }" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -456,7 +456,7 @@ "signature": [ "(args: Readonly<{ fileName?: string | undefined; } & { id: string; }> & { abortSignal?: AbortSignal | undefined; } & { kind: string; }) => Promise" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -473,7 +473,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -499,7 +499,7 @@ }, ", \"id\" | \"fileKind\">) => string" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -523,7 +523,7 @@ }, ", \"id\" | \"fileKind\">" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -553,7 +553,7 @@ }, ">" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -570,7 +570,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -588,7 +588,7 @@ "signature": [ "(args: Readonly<{} & { id: string; }> & { abortSignal?: AbortSignal | undefined; } & { kind: string; }) => Promise<{ ok: true; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -605,7 +605,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -631,7 +631,7 @@ }, "; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -648,7 +648,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -674,7 +674,7 @@ }, "[]; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -691,7 +691,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -709,7 +709,7 @@ "description": [ "\nA factory for creating a {@link ScopedFilesClient}" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -733,7 +733,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -759,7 +759,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -775,7 +775,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -803,7 +803,7 @@ }, " extends React.ImgHTMLAttributes" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -814,7 +814,7 @@ "tags": [], "label": "src", "description": [], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false }, @@ -825,7 +825,7 @@ "tags": [], "label": "alt", "description": [], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false }, @@ -848,7 +848,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false }, @@ -864,7 +864,7 @@ "signature": [ "\"m\" | \"s\" | \"l\" | \"xl\" | \"original\" | \"fullWidth\" | undefined" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false }, @@ -880,7 +880,7 @@ "signature": [ "React.HTMLAttributes | undefined" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false }, @@ -896,29 +896,11 @@ "signature": [ "(() => void) | undefined" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false, "children": [], "returnComment": [] - }, - { - "parentPluginId": "files", - "id": "def-public.Props.lazy", - "type": "CompoundType", - "tags": [ - "default" - ], - "label": "lazy", - "description": [ - "\nAs an optimisation images are only loaded when they are visible.\nThis setting overrides this behavior and loads an image as soon as the\ncomponent mounts.\n" - ], - "signature": [ - "boolean | undefined" - ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", - "deprecated": false, - "trackAdoption": false } ], "initialIsOpen": false @@ -942,7 +924,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -958,7 +940,7 @@ "signature": [ "Kind" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -976,7 +958,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -992,7 +974,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1008,7 +990,7 @@ "signature": [ "Record | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1024,7 +1006,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1042,7 +1024,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1058,7 +1040,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1074,7 +1056,7 @@ "signature": [ "(files: UploadedFile[]) => void" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1088,7 +1070,7 @@ "signature": [ "UploadedFile[]" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1108,7 +1090,7 @@ "signature": [ "((e: Error) => void) | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1122,7 +1104,7 @@ "signature": [ "Error" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1130,6 +1112,42 @@ ], "returnComment": [] }, + { + "parentPluginId": "files", + "id": "def-public.Props.onUploadStart", + "type": "Function", + "tags": [], + "label": "onUploadStart", + "description": [ + "\nWill be called whenever an upload starts" + ], + "signature": [ + "(() => void) | undefined" + ], + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "files", + "id": "def-public.Props.onUploadEnd", + "type": "Function", + "tags": [], + "label": "onUploadEnd", + "description": [ + "\nWill be called when attempt ends, in error otherwise" + ], + "signature": [ + "(() => void) | undefined" + ], + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "files", "id": "def-public.Props.compressed", @@ -1145,7 +1163,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1163,7 +1181,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false } @@ -1187,7 +1205,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1203,7 +1221,7 @@ "signature": [ "Kind" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false }, @@ -1219,7 +1237,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -1237,7 +1255,7 @@ "signature": [ "(fileIds: string[]) => void" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1251,7 +1269,44 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "files", + "id": "def-public.Props.onUpload", + "type": "Function", + "tags": [], + "label": "onUpload", + "description": [ + "\nWhen a user has succesfully uploaded some files this callback will be called" + ], + "signature": [ + "((done: ", + "DoneNotification", + "[]) => void) | undefined" + ], + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "files", + "id": "def-public.Props.onUpload.$1", + "type": "Array", + "tags": [], + "label": "done", + "description": [], + "signature": [ + "DoneNotification", + "[]" + ], + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1271,7 +1326,25 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "files", + "id": "def-public.Props.multiple", + "type": "CompoundType", + "tags": [ + "default" + ], + "label": "multiple", + "description": [ + "\nWhether you can select one or more files\n" + ], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false } @@ -1363,7 +1436,7 @@ }, "[]; total: number; }; }" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1450,7 +1523,7 @@ "section": "def-common.FilesMetrics", "text": "FilesMetrics" }, - ">; publicDownload: (arg: Omit & Readonly<{} & { token: string; }> & { abortSignal?: AbortSignal | undefined; }, \"kind\">) => Promise; find: (arg: Omit | undefined; kind?: string | string[] | undefined; extension?: string | string[] | undefined; } & {}> & Readonly<{ page?: number | undefined; perPage?: number | undefined; } & {}> & { abortSignal?: AbortSignal | undefined; }, \"kind\">) => Promise<{ files: ", + ">; publicDownload: (arg: Omit & Readonly<{} & { token: string; }> & { abortSignal?: AbortSignal | undefined; }, \"kind\">) => Promise; find: (arg: Omit | undefined; extension?: string | string[] | undefined; kind?: string | string[] | undefined; } & {}> & Readonly<{ page?: number | undefined; perPage?: number | undefined; } & {}> & { abortSignal?: AbortSignal | undefined; }, \"kind\">) => Promise<{ files: ", { "pluginId": "files", "scope": "common", @@ -1460,7 +1533,7 @@ }, "[]; total: number; }>; }" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1476,7 +1549,7 @@ "description": [ "\nPublic setup-phase contract" ], - "path": "x-pack/plugins/files/public/plugin.ts", + "path": "src/plugins/files/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1500,7 +1573,7 @@ "text": "FilesClientFactory" } ], - "path": "x-pack/plugins/files/public/plugin.ts", + "path": "src/plugins/files/public/plugin.ts", "deprecated": false, "trackAdoption": true, "references": [] @@ -1525,7 +1598,7 @@ }, ") => void" ], - "path": "x-pack/plugins/files/public/plugin.ts", + "path": "src/plugins/files/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1547,7 +1620,7 @@ "text": "FileKind" } ], - "path": "x-pack/plugins/files/public/plugin.ts", + "path": "src/plugins/files/public/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1577,7 +1650,7 @@ }, "; }" ], - "path": "x-pack/plugins/files/public/plugin.ts", + "path": "src/plugins/files/public/plugin.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "start", @@ -1616,7 +1689,7 @@ "text": "FileClient" } ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1638,7 +1711,7 @@ "text": "CreateEsFileClientArgs" } ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1658,7 +1731,7 @@ "description": [ "\nArguments to create an ES file client." ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1671,7 +1744,7 @@ "description": [ "\nThe name of the ES index that will store file metadata." ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false }, @@ -1684,7 +1757,7 @@ "description": [ "\nThe name of the ES index that will store file contents." ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false }, @@ -2886,7 +2959,7 @@ "default", "; }" ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false }, @@ -2902,7 +2975,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false }, @@ -2916,9 +2989,15 @@ "\nA logger for debuggin purposes" ], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false } @@ -2944,7 +3023,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2957,7 +3036,7 @@ "description": [ "\nFile name" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -2970,7 +3049,7 @@ "description": [ "\nFile kind, must correspond to a registered {@link FileKind}." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -2986,7 +3065,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -3002,7 +3081,7 @@ "signature": [ "Meta | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -3018,7 +3097,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false } @@ -3034,7 +3113,7 @@ "description": [ "\nArguments for a creating a file share" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3050,7 +3129,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false }, @@ -3068,7 +3147,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false }, @@ -3091,7 +3170,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false } @@ -3105,7 +3184,7 @@ "tags": [], "label": "DeleteArg", "description": [], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3120,7 +3199,7 @@ "description": [ "\nUnique ID of file metadata to delete\n" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -3136,7 +3215,7 @@ "description": [ "\nArguments to delete a file." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3149,7 +3228,7 @@ "description": [ "\nFile ID." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -3162,7 +3241,7 @@ "description": [ "\nFile kind, must correspond to a registered {@link FileKind}." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false } @@ -3178,7 +3257,7 @@ "description": [ "\nDelete file shares for file arguments." ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3191,7 +3270,7 @@ "description": [ "\nThe file id to delete the shares for." ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false } @@ -3207,7 +3286,7 @@ "description": [ "\nWraps the {@link FileMetadataClient} and {@link BlobStorageClient} client\nto provide basic file CRUD functionality.\n\nFor now this is just a shallow type of the implementation for export purposes." ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3220,7 +3299,7 @@ "description": [ "See {@link FileMetadata.FileKind}." ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -3246,7 +3325,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3262,7 +3341,7 @@ "signature": [ "CreateArgs" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3298,7 +3377,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3320,7 +3399,7 @@ "text": "GetArg" } ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3348,7 +3427,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3364,7 +3443,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3388,7 +3467,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3416,7 +3495,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3438,7 +3517,7 @@ "text": "DeleteArgs" } ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3474,7 +3553,7 @@ }, "[]; total: number; }>" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3497,7 +3576,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -3529,7 +3608,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3545,7 +3624,7 @@ "signature": [ "ShareArgs" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3567,7 +3646,7 @@ "signature": [ "(args: IdArg) => Promise" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -3584,7 +3663,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -3620,7 +3699,7 @@ }, "[]; }>" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -3643,7 +3722,7 @@ "text": "ListArgs" } ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -3671,7 +3750,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3684,7 +3763,7 @@ "description": [ "\nUnique ID of a file, used to locate a file." ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false }, @@ -3716,7 +3795,7 @@ }, " & { FileKind: string; Meta?: M | undefined; }" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -3732,7 +3811,7 @@ "description": [ "\nAn abstraction of storage implementation of file object's (i.e., metadata)" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3764,7 +3843,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3787,7 +3866,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3823,7 +3902,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3845,7 +3924,7 @@ "text": "GetArg" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3881,7 +3960,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3904,7 +3983,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3932,7 +4011,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3954,7 +4033,7 @@ "text": "DeleteArg" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3990,7 +4069,7 @@ }, "[]; }>" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4013,7 +4092,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -4049,7 +4128,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4071,7 +4150,7 @@ "text": "GetUsageMetricsArgs" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4091,7 +4170,7 @@ "description": [ "\nA simple interface for getting an instance of {@link FileServiceStart}" ], - "path": "x-pack/plugins/files/server/file_service/file_service_factory.ts", + "path": "src/plugins/files/server/file_service/file_service_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4106,7 +4185,13 @@ ], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", { "pluginId": "files", @@ -4116,7 +4201,7 @@ "text": "FileServiceStart" } ], - "path": "x-pack/plugins/files/server/file_service/file_service_factory.ts", + "path": "src/plugins/files/server/file_service/file_service_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4130,10 +4215,16 @@ "- the Kibana request to scope the service to" ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "x-pack/plugins/files/server/file_service/file_service_factory.ts", + "path": "src/plugins/files/server/file_service/file_service_factory.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4162,7 +4253,7 @@ "text": "FileServiceStart" } ], - "path": "x-pack/plugins/files/server/file_service/file_service_factory.ts", + "path": "src/plugins/files/server/file_service/file_service_factory.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4180,7 +4271,7 @@ "description": [ "\nPublic file service interface." ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4212,7 +4303,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4235,7 +4326,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4263,7 +4354,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4285,7 +4376,7 @@ "text": "UpdateFileArgs" } ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4313,7 +4404,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4335,7 +4426,7 @@ "text": "DeleteFileArgs" } ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4371,7 +4462,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4393,7 +4484,7 @@ "text": "GetByIdArgs" } ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4429,7 +4520,7 @@ }, "[]; total: number; }>" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4451,7 +4542,7 @@ "text": "FindFileArgs" } ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4479,7 +4570,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4496,7 +4587,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -4530,7 +4621,7 @@ }, "[]; }>" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4553,7 +4644,7 @@ "text": "ListArgs" } ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -4587,7 +4678,7 @@ }, " & { id: string; }>" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4610,7 +4701,7 @@ "text": "UpdateArgs" } ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -4628,7 +4719,7 @@ "signature": [ "(args: IdArg) => Promise" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4645,7 +4736,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -4671,7 +4762,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4697,7 +4788,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4713,7 +4804,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4733,7 +4824,7 @@ "description": [ "\nWe only expose functionality here that do not require you to have a {@link File}\ninstance loaded." ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4757,7 +4848,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4773,7 +4864,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4809,7 +4900,7 @@ }, "[]; }>" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4831,7 +4922,7 @@ "text": "ListArgs" } ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4867,7 +4958,7 @@ }, " & { id: string; }>" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4889,7 +4980,7 @@ "text": "UpdateArgs" } ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4909,7 +5000,7 @@ "signature": [ "(args: IdArg) => Promise" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4925,7 +5016,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4960,7 +5051,7 @@ "text": "Pagination" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4976,7 +5067,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -5011,7 +5102,7 @@ "text": "Pagination" } ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5027,7 +5118,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5043,7 +5134,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5059,7 +5150,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5075,7 +5166,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5091,7 +5182,7 @@ "signature": [ "Record | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false } @@ -5107,7 +5198,7 @@ "description": [ "\nGet a file" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5120,7 +5211,7 @@ "description": [ "\nUnique ID of file metadata" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -5136,7 +5227,7 @@ "description": [ "\nArguments to get a file by ID." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5149,7 +5240,7 @@ "description": [ "\nFile ID." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5162,7 +5253,7 @@ "description": [ "\nFile kind, must correspond to a registered {@link FileKind}." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false } @@ -5178,7 +5269,7 @@ "description": [ "\nArgs to get usage metrics" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5194,7 +5285,7 @@ "signature": [ "{ capacity: number; }" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -5227,7 +5318,7 @@ "text": "Pagination" } ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5243,7 +5334,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false } @@ -5269,7 +5360,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5282,7 +5373,7 @@ "description": [ "\nA unique file ID." ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false }, @@ -5306,7 +5397,7 @@ }, " | undefined; FileKind?: string | undefined; Meta?: M | undefined; }" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -5322,7 +5413,7 @@ "description": [ "\nUpdate file share arguments." ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5335,7 +5426,7 @@ "description": [ "\nThe file share ID." ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false }, @@ -5351,7 +5442,7 @@ "signature": [ "{ name?: string | undefined; }" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false } @@ -5367,7 +5458,7 @@ "description": [ "\nArguments to update a file" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5380,7 +5471,7 @@ "description": [ "\nFile ID." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5393,7 +5484,7 @@ "description": [ "\nFile kind, must correspond to a registered {@link FileKind}." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5409,7 +5500,7 @@ "signature": [ "{ name: string; meta: unknown; alt: string | undefined; }" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false } @@ -5431,7 +5522,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5448,7 +5539,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5464,7 +5555,7 @@ "description": [ "\nFiles plugin setup contract" ], - "path": "x-pack/plugins/files/server/types.ts", + "path": "src/plugins/files/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5490,7 +5581,7 @@ }, ") => void" ], - "path": "x-pack/plugins/files/server/types.ts", + "path": "src/plugins/files/server/types.ts", "deprecated": false, "trackAdoption": true, "references": [], @@ -5513,7 +5604,7 @@ "text": "FileKind" } ], - "path": "x-pack/plugins/files/server/types.ts", + "path": "src/plugins/files/server/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5534,7 +5625,7 @@ "description": [ "\nFiles plugin start contract" ], - "path": "x-pack/plugins/files/server/types.ts", + "path": "src/plugins/files/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5558,7 +5649,7 @@ "text": "FileServiceFactory" } ], - "path": "x-pack/plugins/files/server/types.ts", + "path": "src/plugins/files/server/types.ts", "deprecated": false, "trackAdoption": true, "references": [] @@ -5581,7 +5672,7 @@ "description": [ "\nDefines all the settings for supported blob stores.\n\nKey names map to unique blob store implementations and so must not be changed\nwithout a migration" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5597,7 +5688,7 @@ "signature": [ "{ index: string; } | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -5623,7 +5714,7 @@ }, "" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5636,7 +5727,7 @@ "description": [ "\nThe file ID" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5659,7 +5750,7 @@ }, "" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5691,7 +5782,7 @@ }, ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5715,7 +5806,7 @@ }, ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5747,7 +5838,7 @@ }, ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5763,7 +5854,7 @@ "signature": [ "Readable" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5781,7 +5872,7 @@ "Observable", " | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -5803,7 +5894,7 @@ "Readable", ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -5823,7 +5914,7 @@ "signature": [ "() => Promise" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -5859,7 +5950,7 @@ }, ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5882,7 +5973,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -5910,7 +6001,7 @@ }, "[]>" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -5936,7 +6027,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5958,7 +6049,7 @@ "text": "FileUnshareOptions" } ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5986,7 +6077,7 @@ }, "" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -6004,7 +6095,7 @@ "description": [ "\nSet of metadata captured for every image uploaded via the file services'\npublic components." ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6020,7 +6111,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6033,7 +6124,7 @@ "description": [ "\nWidth, in px, of the original image" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6046,7 +6137,7 @@ "description": [ "\nHeight, in px, of the original image" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6072,7 +6163,7 @@ }, "" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6085,7 +6176,7 @@ "description": [ "\nUnique file ID." ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6098,7 +6189,7 @@ "description": [ "\nISO string of when this file was created" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6111,7 +6202,7 @@ "description": [ "\nISO string of when the file was updated" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6126,7 +6217,7 @@ "description": [ "\nFile name.\n" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6142,7 +6233,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6158,7 +6249,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6176,7 +6267,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6192,7 +6283,7 @@ "signature": [ "Meta | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6208,7 +6299,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6223,7 +6314,7 @@ "description": [ "\nA unique kind that governs various aspects of the file. A consumer of the\nfiles service must register a file kind and link their files to a specific\nkind.\n" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6239,7 +6330,7 @@ "signature": [ "\"AWAITING_UPLOAD\" | \"UPLOADING\" | \"READY\" | \"UPLOAD_ERROR\" | \"DELETED\"" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6257,7 +6348,7 @@ "description": [ "\nA descriptor of meta values associated with a set or \"kind\" of files.\n" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6270,7 +6361,7 @@ "description": [ "\nUnique file kind ID" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6288,7 +6379,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6306,7 +6397,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6329,7 +6420,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6347,7 +6438,7 @@ "signature": [ "{ create?: HttpEndpointDefinition | undefined; update?: HttpEndpointDefinition | undefined; delete?: HttpEndpointDefinition | undefined; getById?: HttpEndpointDefinition | undefined; list?: HttpEndpointDefinition | undefined; download?: HttpEndpointDefinition | undefined; share?: HttpEndpointDefinition | undefined; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6363,7 +6454,7 @@ "description": [ "\nAttributes of a file that represent a serialised version of the file." ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6376,7 +6467,7 @@ "description": [ "\nUnique ID share instance" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6389,7 +6480,7 @@ "description": [ "\nISO timestamp the share was created" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6402,7 +6493,7 @@ "description": [ "\nUnix timestamp (in milliseconds) of when this share expires" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6418,7 +6509,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6431,7 +6522,7 @@ "description": [ "\nThe ID of the file this share is linked to" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6447,7 +6538,7 @@ "description": [ "\nArguments to pass to share a file" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6463,7 +6554,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6481,7 +6572,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6497,7 +6588,7 @@ "description": [ "\nA collection of generally useful metrics about files." ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6513,7 +6604,7 @@ "signature": [ "{ esFixedSizeIndex: { capacity: number; used: number; available: number; }; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6529,7 +6620,7 @@ "signature": [ "{ AWAITING_UPLOAD: number; UPLOADING: number; READY: number; UPLOAD_ERROR: number; DELETED: number; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6545,7 +6636,7 @@ "signature": [ "{ [x: string]: number; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6561,7 +6652,7 @@ "description": [ "\nArguments for unsharing a file" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6574,7 +6665,7 @@ "description": [ "\nSpecify the share instance to remove" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6590,7 +6681,7 @@ "description": [ "\nValues for paginating through results." ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6606,7 +6697,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6622,7 +6713,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6660,7 +6751,7 @@ }, " | undefined; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6677,7 +6768,7 @@ "signature": [ "\"esFixedSizeIndex\"" ], - "path": "x-pack/plugins/files/common/constants.ts", + "path": "src/plugins/files/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6694,7 +6785,7 @@ "signature": [ "\"file\"" ], - "path": "x-pack/plugins/files/common/constants.ts", + "path": "src/plugins/files/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6711,7 +6802,7 @@ "signature": [ "\"none\" | \"br\" | \"gzip\" | \"deflate\"" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6744,7 +6835,7 @@ }, " & { FileKind: string; Meta?: Meta | undefined; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6759,7 +6850,13 @@ "\nAn {@link SavedObject} containing a file object (i.e., metadata only)." ], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "files", @@ -6770,7 +6867,7 @@ }, ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6787,7 +6884,7 @@ "signature": [ "{ created: string; token: string; name?: string | undefined; valid_until: number; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6813,7 +6910,7 @@ }, " & { token: string; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6830,7 +6927,7 @@ "signature": [ "\"AWAITING_UPLOAD\" | \"UPLOADING\" | \"READY\" | \"UPLOAD_ERROR\" | \"DELETED\"" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6847,7 +6944,7 @@ "signature": [ "\"files\"" ], - "path": "x-pack/plugins/files/common/constants.ts", + "path": "src/plugins/files/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6864,7 +6961,7 @@ "signature": [ "\"files\"" ], - "path": "x-pack/plugins/files/common/constants.ts", + "path": "src/plugins/files/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6881,7 +6978,7 @@ "signature": [ "{ name: string; meta: Meta | undefined; alt: string | undefined; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6898,7 +6995,7 @@ "signature": [ "{ name?: string | undefined; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/files.mdx b/api_docs/files.mdx index 05b84037a1023..e30e2dee5450d 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'files'] --- import filesObj from './files.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/tea | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 272 | 0 | 18 | 2 | +| 276 | 0 | 19 | 3 | ## Client diff --git a/api_docs/fleet.devdocs.json b/api_docs/fleet.devdocs.json index f9525660b4ded..2feb3907e35dd 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -209,7 +209,13 @@ ], "signature": [ "[appId: string, options?: ", - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined] | undefined" ], "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", @@ -307,7 +313,13 @@ ], "signature": [ "[appId: string, options?: ", - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined] | undefined" ], "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", @@ -341,7 +353,13 @@ ], "signature": [ "[appId: string, options?: ", - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined] | undefined" ], "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", @@ -359,7 +377,13 @@ ], "signature": [ "[appId: string, options?: ", - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined] | undefined" ], "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", @@ -3549,6 +3573,52 @@ "tags": [], "label": "settings_edit_fleet_server_hosts", "description": [], + "signature": [ + "({ itemId }: ", + { + "pluginId": "fleet", + "scope": "public", + "docId": "kibFleetPluginApi", + "section": "def-public.DynamicPagePathValues", + "text": "DynamicPagePathValues" + }, + ") => [string, string]" + ], + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-public.pagePathGetters.settings_edit_fleet_server_hosts.$1", + "type": "Object", + "tags": [], + "label": "{ itemId }", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "public", + "docId": "kibFleetPluginApi", + "section": "def-public.DynamicPagePathValues", + "text": "DynamicPagePathValues" + } + ], + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-public.pagePathGetters.settings_create_fleet_server_hosts", + "type": "Function", + "tags": [], + "label": "settings_create_fleet_server_hosts", + "description": [], "signature": [ "() => [string, string]" ], @@ -4200,7 +4270,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", id: string, withPackagePolicies?: boolean) => Promise<", { "pluginId": "fleet", @@ -4224,7 +4300,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/agent_policy.ts", "deprecated": false, @@ -4263,7 +4345,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", options: Readonly<{ page?: number | undefined; perPage?: number | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | undefined; kuery?: any; showUpgradeable?: boolean | undefined; } & {}> & { withPackagePolicies?: boolean | undefined; }) => Promise<{ items: ", { "pluginId": "fleet", @@ -4287,7 +4375,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/agent_policy.ts", "deprecated": false, @@ -4318,7 +4412,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", id: string, options?: { standalone: boolean; } | undefined) => Promise<", { "pluginId": "fleet", @@ -4342,7 +4442,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/agent_policy.ts", "deprecated": false, @@ -4384,7 +4490,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", ids: string[], options?: { fields?: string[] | undefined; withPackagePolicies?: boolean | undefined; ignoreMissing?: boolean | undefined; }) => Promise<", { "pluginId": "fleet", @@ -4408,7 +4520,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/agent_policy.ts", "deprecated": false, @@ -4471,7 +4589,13 @@ ], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", { "pluginId": "fleet", @@ -4493,7 +4617,13 @@ "label": "req", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/fleet/server/services/agents/agent_service.ts", @@ -4857,7 +4987,13 @@ "description": [], "signature": [ "(savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", pkgName: string, datasetPath: string) => Promise" ], "path": "x-pack/plugins/fleet/server/services/index.ts", @@ -4872,7 +5008,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/index.ts", "deprecated": false, @@ -5229,7 +5371,9 @@ "label": "fetchFindLatestPackage", "description": [], "signature": [ - "(packageName: string) => Promise<", + "(packageName: string, options?: ", + "FetchFindLatestPackageOptions", + " | undefined) => Promise<", { "pluginId": "fleet", "scope": "common", @@ -5265,6 +5409,22 @@ "deprecated": false, "trackAdoption": false, "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackageClient.fetchFindLatestPackage.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "FetchFindLatestPackageOptions", + " | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false } ], "returnComment": [] @@ -5416,9 +5576,21 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", esClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", packagePolicy: ", { "pluginId": "fleet", @@ -5465,7 +5637,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -5480,7 +5658,13 @@ "label": "esClient", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -5673,9 +5857,21 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", esClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", packagePolicies: ", "NewPackagePolicyWithId", "[], options?: { user?: ", @@ -5708,7 +5904,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -5723,7 +5925,13 @@ "label": "esClient", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -5820,9 +6028,21 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", esClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", packagePolicyUpdates: (", { "pluginId": "fleet", @@ -5861,7 +6081,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -5876,7 +6102,13 @@ "label": "esClient", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -5981,7 +6213,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", id: string) => Promise<", { "pluginId": "fleet", @@ -6004,7 +6242,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6038,7 +6282,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", agentPolicyId: string) => Promise<", { "pluginId": "fleet", @@ -6061,7 +6311,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6095,7 +6351,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", ids: string[], options?: { ignoreMissing?: boolean | undefined; } | undefined) => Promise<", { "pluginId": "fleet", @@ -6118,7 +6380,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6179,7 +6447,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", options: ", { "pluginId": "fleet", @@ -6218,7 +6492,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6258,7 +6538,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", options: ", { "pluginId": "fleet", @@ -6289,7 +6575,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6329,9 +6621,21 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", esClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", id: string, packagePolicyUpdate: ", { "pluginId": "fleet", @@ -6370,7 +6674,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6385,7 +6695,13 @@ "label": "esClient", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6517,9 +6833,21 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", esClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", ids: string[], options?: { user?: ", { "pluginId": "security", @@ -6550,7 +6878,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6565,7 +6899,13 @@ "label": "esClient", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6661,9 +7001,21 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", esClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", ids: string[], options?: { user?: ", { "pluginId": "security", @@ -6702,7 +7054,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6717,7 +7075,13 @@ "label": "esClient", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6822,7 +7186,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", id: string, packagePolicy?: ", { "pluginId": "fleet", @@ -6853,7 +7223,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6924,7 +7300,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", newPolicy: ", { "pluginId": "fleet", @@ -6955,7 +7337,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -6995,9 +7383,21 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", pkgName: string, logger?: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined) => Promise<", { "pluginId": "fleet", @@ -7020,7 +7420,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -7050,7 +7456,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | undefined" ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", @@ -7094,9 +7506,21 @@ "text": "NewPackagePolicy" }, ", context: ", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ", request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise" ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", @@ -7261,7 +7697,13 @@ "description": [], "signature": [ "(soClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", id: string) => Promise<{ packagePolicy: ", { "pluginId": "fleet", @@ -7294,7 +7736,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -7342,7 +7790,13 @@ "description": [], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", { "pluginId": "fleet", @@ -7364,7 +7818,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", @@ -7471,9 +7931,21 @@ "text": "NewPackagePolicy" }, ", context: ", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ", request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise<", { "pluginId": "fleet", @@ -7517,7 +7989,13 @@ "label": "context", "description": [], "signature": [ - "RequestHandlerContext" + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + } ], "path": "x-pack/plugins/fleet/server/types/extensions.ts", "deprecated": false, @@ -7531,7 +8009,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/fleet/server/types/extensions.ts", @@ -7609,9 +8093,21 @@ "text": "PackagePolicy" }, ", context: ", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ", request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise<", { "pluginId": "fleet", @@ -7655,7 +8151,13 @@ "label": "context", "description": [], "signature": [ - "RequestHandlerContext" + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + } ], "path": "x-pack/plugins/fleet/server/types/extensions.ts", "deprecated": false, @@ -7669,7 +8171,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/fleet/server/types/extensions.ts", @@ -7696,9 +8204,21 @@ "text": "UpdatePackagePolicy" }, ", context: ", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ", request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise<", { "pluginId": "fleet", @@ -7742,7 +8262,13 @@ "label": "context", "description": [], "signature": [ - "RequestHandlerContext" + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + } ], "path": "x-pack/plugins/fleet/server/types/extensions.ts", "deprecated": false, @@ -7756,7 +8282,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/fleet/server/types/extensions.ts", @@ -7824,7 +8356,13 @@ "description": [], "signature": [ "{ fromRequest(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "): Promise<", { "pluginId": "fleet", @@ -10734,7 +11272,13 @@ "text": "Installation" }, " extends ", - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "x-pack/plugins/fleet/common/types/models/epm.ts", "deprecated": false, @@ -11154,7 +11698,13 @@ "text": "ListWithKuery" }, " extends ", - "HttpFetchQuery" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchQuery", + "text": "HttpFetchQuery" + } ], "path": "x-pack/plugins/fleet/common/types/rest_spec/common.ts", "deprecated": false, @@ -11434,6 +11984,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "fleet", + "id": "def-common.NewAgentPolicy.fleet_server_host_id", + "type": "CompoundType", + "tags": [], + "label": "fleet_server_host_id", + "description": [], + "signature": [ + "string | null | undefined" + ], + "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "fleet", "id": "def-common.NewAgentPolicy.schema_version", @@ -13216,6 +13780,20 @@ "path": "x-pack/plugins/fleet/common/types/models/epm.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "fleet", + "id": "def-common.RegistryElasticsearch.source_mode", + "type": "CompoundType", + "tags": [], + "label": "source_mode", + "description": [], + "signature": [ + "\"default\" | \"synthetic\" | undefined" + ], + "path": "x-pack/plugins/fleet/common/types/models/epm.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -14312,7 +14890,13 @@ "description": [], "signature": [ "Pick<", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, ", \"id\"> & { type: ", { "pluginId": "fleet", @@ -14690,7 +15274,13 @@ "description": [], "signature": [ "T & { status: \"installed\"; savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "fleet", @@ -14730,7 +15320,13 @@ "description": [], "signature": [ "T & { status: \"installing\"; savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "fleet", @@ -14815,7 +15411,13 @@ "description": [], "signature": [ "Pick<", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, ", \"id\"> & { type: ", { "pluginId": "fleet", @@ -15030,7 +15632,13 @@ "description": [], "signature": [ "Pick<", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, ", \"id\"> & { type: \"epm-packages-assets\"; }" ], "path": "x-pack/plugins/fleet/common/types/models/epm.ts", diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 17fbfc6069a27..6fde040eb5c63 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Fleet](https://github.com/orgs/elastic/teams/fleet) for questions regar | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 996 | 3 | 893 | 17 | +| 1001 | 3 | 898 | 18 | ## Client diff --git a/api_docs/global_search.devdocs.json b/api_docs/global_search.devdocs.json index 6dfe6c66b672b..7d96b4bfad1da 100644 --- a/api_docs/global_search.devdocs.json +++ b/api_docs/global_search.devdocs.json @@ -317,7 +317,13 @@ ], "signature": [ "Record | undefined" ], "path": "x-pack/plugins/global_search/common/types.ts", @@ -650,15 +656,39 @@ "description": [], "signature": [ "{ savedObjects: { client: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, "; typeRegistry: ", - "ISavedObjectTypeRegistry", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + }, "; }; uiSettings: { client: ", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.IUiSettingsClient", + "text": "IUiSettingsClient" + }, "; }; capabilities: ", "Observable", "<", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, ">; }" ], "path": "x-pack/plugins/global_search/server/types.ts", @@ -835,7 +865,13 @@ ], "signature": [ "Record | undefined" ], "path": "x-pack/plugins/global_search/common/types.ts", @@ -1171,13 +1207,25 @@ "text": "GlobalSearchFindOptions" }, ", request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", "Observable", "<", "GlobalSearchBatchedResults", ">; getSearchableTypes: (request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise; }" ], "path": "x-pack/plugins/global_search/server/types.ts", diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 4298e3995a682..55571154be0b9 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] --- import globalSearchObj from './global_search.devdocs.json'; diff --git a/api_docs/guided_onboarding.devdocs.json b/api_docs/guided_onboarding.devdocs.json index 2fcc0495ff8d7..486baff36f0f2 100644 --- a/api_docs/guided_onboarding.devdocs.json +++ b/api_docs/guided_onboarding.devdocs.json @@ -24,7 +24,13 @@ "description": [], "signature": [ "(httpClient: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, ") => void" ], "path": "src/plugins/guided_onboarding/public/types.ts", @@ -39,7 +45,13 @@ "label": "httpClient", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "src/plugins/guided_onboarding/public/types.ts", "deprecated": false, @@ -60,7 +72,13 @@ "() => ", "Observable", "<", - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, " | undefined>" ], "path": "src/plugins/guided_onboarding/public/types.ts", @@ -78,7 +96,13 @@ "description": [], "signature": [ "() => Promise<{ state: ", - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, "[]; } | undefined>" ], "path": "src/plugins/guided_onboarding/public/types.ts", @@ -96,9 +120,21 @@ "description": [], "signature": [ "(newState: ", - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, ", panelState: boolean) => Promise<{ state: ", - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, "; } | undefined>" ], "path": "src/plugins/guided_onboarding/public/types.ts", @@ -113,7 +149,13 @@ "label": "newState", "description": [], "signature": [ - "GuideState" + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + } ], "path": "src/plugins/guided_onboarding/public/types.ts", "deprecated": false, @@ -147,11 +189,29 @@ "description": [], "signature": [ "(guideId: ", - "GuideId", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideId", + "text": "GuideId" + }, ", guide?: ", - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, " | undefined) => Promise<{ state: ", - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, "; } | undefined>" ], "path": "src/plugins/guided_onboarding/public/types.ts", @@ -166,7 +226,13 @@ "label": "guideId", "description": [], "signature": [ - "GuideId" + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideId", + "text": "GuideId" + } ], "path": "src/plugins/guided_onboarding/public/types.ts", "deprecated": false, @@ -181,7 +247,13 @@ "label": "guide", "description": [], "signature": [ - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, " | undefined" ], "path": "src/plugins/guided_onboarding/public/types.ts", @@ -201,9 +273,21 @@ "description": [], "signature": [ "(guideId: ", - "GuideId", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideId", + "text": "GuideId" + }, ") => Promise<{ state: ", - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, "; } | undefined>" ], "path": "src/plugins/guided_onboarding/public/types.ts", @@ -218,7 +302,13 @@ "label": "guideId", "description": [], "signature": [ - "GuideId" + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideId", + "text": "GuideId" + } ], "path": "src/plugins/guided_onboarding/public/types.ts", "deprecated": false, @@ -237,9 +327,21 @@ "description": [], "signature": [ "(guideId: ", - "GuideId", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideId", + "text": "GuideId" + }, ", stepId: ", - "GuideStepIds", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideStepIds", + "text": "GuideStepIds" + }, ") => ", "Observable", "" @@ -256,7 +358,13 @@ "label": "guideId", "description": [], "signature": [ - "GuideId" + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideId", + "text": "GuideId" + } ], "path": "src/plugins/guided_onboarding/public/types.ts", "deprecated": false, @@ -271,7 +379,13 @@ "label": "stepId", "description": [], "signature": [ - "GuideStepIds" + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideStepIds", + "text": "GuideStepIds" + } ], "path": "src/plugins/guided_onboarding/public/types.ts", "deprecated": false, @@ -290,11 +404,29 @@ "description": [], "signature": [ "(guideId: ", - "GuideId", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideId", + "text": "GuideId" + }, ", stepId: ", - "GuideStepIds", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideStepIds", + "text": "GuideStepIds" + }, ") => Promise<{ state: ", - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, "; } | undefined>" ], "path": "src/plugins/guided_onboarding/public/types.ts", @@ -309,7 +441,13 @@ "label": "guideId", "description": [], "signature": [ - "GuideId" + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideId", + "text": "GuideId" + } ], "path": "src/plugins/guided_onboarding/public/types.ts", "deprecated": false, @@ -324,7 +462,13 @@ "label": "stepId", "description": [], "signature": [ - "GuideStepIds" + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideStepIds", + "text": "GuideStepIds" + } ], "path": "src/plugins/guided_onboarding/public/types.ts", "deprecated": false, @@ -343,11 +487,29 @@ "description": [], "signature": [ "(guideId: ", - "GuideId", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideId", + "text": "GuideId" + }, ", stepId: ", - "GuideStepIds", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideStepIds", + "text": "GuideStepIds" + }, ") => Promise<{ state: ", - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, "; } | undefined>" ], "path": "src/plugins/guided_onboarding/public/types.ts", @@ -362,7 +524,13 @@ "label": "guideId", "description": [], "signature": [ - "GuideId" + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideId", + "text": "GuideId" + } ], "path": "src/plugins/guided_onboarding/public/types.ts", "deprecated": false, @@ -377,7 +545,13 @@ "label": "stepId", "description": [], "signature": [ - "GuideStepIds" + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideStepIds", + "text": "GuideStepIds" + } ], "path": "src/plugins/guided_onboarding/public/types.ts", "deprecated": false, @@ -430,7 +604,13 @@ "description": [], "signature": [ "(integration?: string | undefined) => Promise<{ state: ", - "GuideState", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideState", + "text": "GuideState" + }, "; } | undefined>" ], "path": "src/plugins/guided_onboarding/public/types.ts", @@ -529,6 +709,20 @@ "path": "src/plugins/guided_onboarding/public/constants/guides_config/index.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "guidedOnboarding", + "id": "def-public.guidesConfig.testGuide", + "type": "Object", + "tags": [], + "label": "testGuide", + "description": [], + "signature": [ + "GuideConfig" + ], + "path": "src/plugins/guided_onboarding/public/constants/guides_config/index.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/guided_onboarding.mdx b/api_docs/guided_onboarding.mdx index 83cd38c62e176..38917c6001630 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'guidedOnboarding'] --- import guidedOnboardingObj from './guided_onboarding.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Journey Onboarding](https://github.com/orgs/elastic/teams/platform-onbo | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 36 | 0 | 36 | 1 | +| 37 | 0 | 37 | 1 | ## Client diff --git a/api_docs/home.devdocs.json b/api_docs/home.devdocs.json index a18ea6d544131..c68b5eda160a9 100644 --- a/api_docs/home.devdocs.json +++ b/api_docs/home.devdocs.json @@ -54,7 +54,13 @@ "description": [], "signature": [ "({ capabilities }: { capabilities: ", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, "; }) => void" ], "path": "src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.ts", @@ -80,7 +86,13 @@ "label": "capabilities", "description": [], "signature": [ - "Capabilities" + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + } ], "path": "src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.ts", "deprecated": false, @@ -189,7 +201,7 @@ "\nConvert instruction variant id into display text.\n" ], "signature": [ - "(id: \"ESC\" | \"OSX\" | \"DEB\" | \"RPM\" | \"DOCKER\" | \"WINDOWS\" | \"NODE\" | \"DJANGO\" | \"FLASK\" | \"RAILS\" | \"RACK\" | \"JS\" | \"GO\" | \"JAVA\" | \"DOTNET\" | \"LINUX\" | \"PHP\" | \"FLEET\" | \"OPEN_TELEMETRY\") => string" + "(id: \"ESC\" | \"OSX\" | \"DEB\" | \"RPM\" | \"DOCKER\" | \"WINDOWS\" | \"NODE\" | \"DJANGO\" | \"FLASK\" | \"RAILS\" | \"RACK\" | \"JS\" | \"GO\" | \"JAVA\" | \"DOTNET\" | \"LINUX\" | \"PHP\" | \"FLEET\" | \"OPEN_TELEMETRY\") => any" ], "path": "src/plugins/home/common/instruction_variant.ts", "deprecated": false, @@ -1733,9 +1745,21 @@ "description": [], "signature": [ "{ getSampleDatasets: () => ", - "Writable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Writable", + "text": "Writable" + }, "[]; previewImagePath: string; overviewDashboard: string; defaultIndex: string; dataIndices: Readonly<{} & { id: string; fields: Record; timeFields: string[]; dataPath: string; currentTimeMarker: string; preserveDayOfWeekTimeOfDay: boolean; }>[]; }>>[]; addSavedObjectsToSampleDataset: (id: string, savedObjects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]) => void; addAppLinksToSampleDataset: (id: string, appLinks: ", { "pluginId": "home", @@ -1768,7 +1792,13 @@ "description": [], "signature": [ "() => ", - "Writable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Writable", + "text": "Writable" + }, "[]; previewImagePath: string; overviewDashboard: string; defaultIndex: string; dataIndices: Readonly<{} & { id: string; fields: Record; timeFields: string[]; dataPath: string; currentTimeMarker: string; preserveDayOfWeekTimeOfDay: boolean; }>[]; }>>" ], "path": "src/plugins/home/server/services/sample_data/lib/sample_dataset_registry_types.ts", @@ -2155,9 +2185,21 @@ "description": [], "signature": [ "{ getSampleDatasets: () => ", - "Writable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Writable", + "text": "Writable" + }, "[]; previewImagePath: string; overviewDashboard: string; defaultIndex: string; dataIndices: Readonly<{} & { id: string; fields: Record; timeFields: string[]; dataPath: string; currentTimeMarker: string; preserveDayOfWeekTimeOfDay: boolean; }>[]; }>>[]; addSavedObjectsToSampleDataset: (id: string, savedObjects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]) => void; addAppLinksToSampleDataset: (id: string, appLinks: ", { "pluginId": "home", diff --git a/api_docs/home.mdx b/api_docs/home.mdx index 5d8b8f0b78edb..68586449fd32d 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] --- import homeObj from './home.devdocs.json'; diff --git a/api_docs/index_lifecycle_management.devdocs.json b/api_docs/index_lifecycle_management.devdocs.json index da2d945350c0b..3cc512a363c4e 100644 --- a/api_docs/index_lifecycle_management.devdocs.json +++ b/api_docs/index_lifecycle_management.devdocs.json @@ -20,7 +20,13 @@ "text": "IlmLocatorParams" }, " extends ", - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "x-pack/plugins/index_lifecycle_management/public/locator.ts", "deprecated": false, diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index 204cdf74b1b2c..7f4631937d0c6 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] --- import indexLifecycleManagementObj from './index_lifecycle_management.devdocs.json'; diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index 2ef045c32473b..60894c7b8f480 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/infra.devdocs.json b/api_docs/infra.devdocs.json index 8982b332b7913..ffbfd58ed53de 100644 --- a/api_docs/infra.devdocs.json +++ b/api_docs/infra.devdocs.json @@ -653,7 +653,13 @@ "description": [], "signature": [ "(savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", sourceId?: string | undefined) => Promise" ], "path": "x-pack/plugins/infra/server/types.ts", @@ -668,7 +674,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/infra/server/types.ts", "deprecated": false, diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index fa47edf9c37ea..4a5bc9d4f4716 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/inspector.devdocs.json b/api_docs/inspector.devdocs.json index 6c57aa5bc39d8..db6ceeae34643 100644 --- a/api_docs/inspector.devdocs.json +++ b/api_docs/inspector.devdocs.json @@ -18,7 +18,13 @@ "text": "InspectorPublicPlugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "<", { "pluginId": "inspector", @@ -78,7 +84,13 @@ "label": "initializerContext", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "" ], "path": "src/plugins/inspector/public/plugin.tsx", @@ -98,7 +110,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => { registerView: (view: ", { "pluginId": "inspector", @@ -123,7 +141,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/inspector/public/plugin.tsx", @@ -143,7 +167,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", startDeps: ", "InspectorPluginStartDeps", ") => { isAvailable: (adapters?: ", @@ -171,7 +201,13 @@ "text": "InspectorOptions" }, " | undefined) => ", - "OverlayRef", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + }, "; }" ], "path": "src/plugins/inspector/public/plugin.tsx", @@ -186,7 +222,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/inspector/public/plugin.tsx", "deprecated": false, @@ -1298,7 +1340,13 @@ "label": "InspectorSession", "description": [], "signature": [ - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], "path": "src/plugins/inspector/public/types.ts", "deprecated": false, @@ -1477,7 +1525,13 @@ "text": "InspectorOptions" }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], "path": "src/plugins/inspector/public/plugin.tsx", "deprecated": false, diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 0ccf060216d30..fc2139ccd2a37 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index e9c1c38afe944..097a2b936c26e 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index 4bcf24806e13e..9a914ebf7e7ef 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ace plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] --- import kbnAceObj from './kbn_ace.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index 930763851a05f..fe23ea7cc7900 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_utils.devdocs.json b/api_docs/kbn_aiops_utils.devdocs.json index 9a6e5f07f153e..ce298e173b372 100644 --- a/api_docs/kbn_aiops_utils.devdocs.json +++ b/api_docs/kbn_aiops_utils.devdocs.json @@ -187,9 +187,21 @@ ], "signature": [ "(headers: ", - "Headers", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.Headers", + "text": "Headers" + }, ", logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, ", compressOverride: boolean | undefined, flushFix: boolean | undefined) => StreamFactoryReturnType" ], "path": "x-pack/packages/ml/aiops_utils/src/stream_factory.ts", @@ -206,7 +218,13 @@ "- Request headers." ], "signature": [ - "Headers" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.Headers", + "text": "Headers" + } ], "path": "x-pack/packages/ml/aiops_utils/src/stream_factory.ts", "deprecated": false, @@ -223,7 +241,13 @@ "- Kibana logger." ], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/packages/ml/aiops_utils/src/stream_factory.ts", "deprecated": false, @@ -281,9 +305,21 @@ ], "signature": [ "(headers: ", - "Headers", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.Headers", + "text": "Headers" + }, ", logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, ", compressOverride: boolean, flushFix: boolean) => StreamFactoryReturnType" ], "path": "x-pack/packages/ml/aiops_utils/src/stream_factory.ts", @@ -300,7 +336,13 @@ "- Request headers." ], "signature": [ - "Headers" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.Headers", + "text": "Headers" + } ], "path": "x-pack/packages/ml/aiops_utils/src/stream_factory.ts", "deprecated": false, @@ -317,7 +359,13 @@ "- Kibana logger." ], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/packages/ml/aiops_utils/src/stream_factory.ts", "deprecated": false, diff --git a/api_docs/kbn_aiops_utils.mdx b/api_docs/kbn_aiops_utils.mdx index 8a6ae11008635..37f3c0eeb3502 100644 --- a/api_docs/kbn_aiops_utils.mdx +++ b/api_docs/kbn_aiops_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-utils title: "@kbn/aiops-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-utils plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-utils'] --- import kbnAiopsUtilsObj from './kbn_aiops_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts.mdx b/api_docs/kbn_alerts.mdx index 498373b27fc1f..602047dd19fcb 100644 --- a/api_docs/kbn_alerts.mdx +++ b/api_docs/kbn_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts title: "@kbn/alerts" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts'] --- import kbnAlertsObj from './kbn_alerts.devdocs.json'; diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index e612d5e9f2686..ae61806b82135 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_client.devdocs.json b/api_docs/kbn_analytics_client.devdocs.json index f4bf073a712a2..fb7abdc803b1d 100644 --- a/api_docs/kbn_analytics_client.devdocs.json +++ b/api_docs/kbn_analytics_client.devdocs.json @@ -131,7 +131,13 @@ "\nApplication-provided logger." ], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, @@ -595,7 +601,228 @@ "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": true, - "references": [], + "references": [ + { + "plugin": "@kbn/ebt-tools", + "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "core", + "path": "src/core/server/server.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/analytics/analytics_service.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/fleet_usage_sender.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/analytics_service.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-mocks", + "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-mocks", + "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/analytics.stub.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/analytics/analytics_service.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/analytics/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts" + } + ], "children": [ { "parentPluginId": "@kbn/analytics-client", @@ -868,7 +1095,228 @@ "path": "packages/analytics/client/src/analytics_client/types.ts", "deprecated": false, "trackAdoption": true, - "references": [], + "references": [ + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.ts" + }, + { + "plugin": "@kbn/core-elasticsearch-server-internal", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.ts" + }, + { + "plugin": "@kbn/core-environment-server-internal", + "path": "packages/core/environment/core-environment-server-internal/src/environment_service.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" + }, + { + "plugin": "licensing", + "path": "x-pack/plugins/licensing/common/register_analytics_context_provider.ts" + }, + { + "plugin": "cloud", + "path": "x-pack/plugins/cloud/common/register_cloud_deployment_id_analytics_context.ts" + }, + { + "plugin": "telemetry", + "path": "src/plugins/telemetry/server/plugin.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.ts" + }, + { + "plugin": "telemetry", + "path": "src/plugins/telemetry/public/plugin.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-mocks", + "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/analytics_service.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/analytics_service.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/analytics/register_user_context.test.ts" + }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.test.ts" + }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-analytics-server-mocks", + "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts" + }, + { + "plugin": "@kbn/core-elasticsearch-server-internal", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/status_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.ts" + }, + { + "plugin": "@kbn/core-analytics-server-internal", + "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.ts" + } + ], "children": [ { "parentPluginId": "@kbn/analytics-client", diff --git a/api_docs/kbn_analytics_client.mdx b/api_docs/kbn_analytics_client.mdx index c0939902748df..544b344f05ccb 100644 --- a/api_docs/kbn_analytics_client.mdx +++ b/api_docs/kbn_analytics_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-client title: "@kbn/analytics-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-client plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-client'] --- import kbnAnalyticsClientObj from './kbn_analytics_client.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.devdocs.json b/api_docs/kbn_analytics_shippers_elastic_v3_browser.devdocs.json index b73733babcf66..2e1927862ade1 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.devdocs.json +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.devdocs.json @@ -36,7 +36,13 @@ "text": "ElasticV3BrowserShipper" }, " implements ", - "IShipper" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.IShipper", + "text": "IShipper" + } ], "path": "packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.ts", "deprecated": false, @@ -67,7 +73,13 @@ "signature": [ "Subject", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">" ], "path": "packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.ts", @@ -100,7 +112,13 @@ "{@link ElasticV3ShipperOptions }" ], "signature": [ - "ElasticV3ShipperOptions" + { + "pluginId": "@kbn/analytics-shippers-elastic-v3-common", + "scope": "common", + "docId": "kibKbnAnalyticsShippersElasticV3CommonPluginApi", + "section": "def-common.ElasticV3ShipperOptions", + "text": "ElasticV3ShipperOptions" + } ], "path": "packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.ts", "deprecated": false, @@ -117,7 +135,13 @@ "{@link AnalyticsClientInitContext }" ], "signature": [ - "AnalyticsClientInitContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.AnalyticsClientInitContext", + "text": "AnalyticsClientInitContext" + } ], "path": "packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.ts", "deprecated": false, @@ -138,7 +162,13 @@ ], "signature": [ "(newContext: ", - "EventContext", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + }, ") => void" ], "path": "packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.ts", @@ -155,7 +185,13 @@ "The full new context to set {@link EventContext }" ], "signature": [ - "EventContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + } ], "path": "packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.ts", "deprecated": false, @@ -212,7 +248,13 @@ ], "signature": [ "(events: ", - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]) => void" ], "path": "packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.ts", @@ -229,7 +271,13 @@ "batched events {@link Event }" ], "signature": [ - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]" ], "path": "packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.ts", @@ -273,10 +321,7 @@ "description": [ "\nOptions for the Elastic V3 shipper" ], - "signature": [ - "ElasticV3ShipperOptions" - ], - "path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts", + "path": "packages/analytics/shippers/elastic_v3/common/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -289,7 +334,7 @@ "description": [ "\nThe name of the channel to stream all the events to." ], - "path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts", + "path": "packages/analytics/shippers/elastic_v3/common/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -302,7 +347,7 @@ "description": [ "\nThe product's version." ], - "path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts", + "path": "packages/analytics/shippers/elastic_v3/common/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -318,7 +363,7 @@ "signature": [ "\"staging\" | \"production\" | undefined" ], - "path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts", + "path": "packages/analytics/shippers/elastic_v3/common/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -334,7 +379,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts", + "path": "packages/analytics/shippers/elastic_v3/common/src/types.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx index 0da232131bd66..217704c19bff5 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-browser title: "@kbn/analytics-shippers-elastic-v3-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-browser plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-browser'] --- import kbnAnalyticsShippersElasticV3BrowserObj from './kbn_analytics_shippers_elastic_v3_browser.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.devdocs.json b/api_docs/kbn_analytics_shippers_elastic_v3_common.devdocs.json index f0bc3a04cff0e..2e718139d6717 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.devdocs.json +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.devdocs.json @@ -234,11 +234,29 @@ "(telemetryCounter$: ", "Subject", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">, source: string) => (events: ", - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[], { type, code, error, }?: { type?: ", - "TelemetryCounterType", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounterType", + "text": "TelemetryCounterType" + }, " | undefined; code?: string | undefined; error?: Error | undefined; }) => void" ], "path": "packages/analytics/shippers/elastic_v3/common/src/report_telemetry_counters.ts", @@ -257,7 +275,13 @@ "signature": [ "Subject", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">" ], "path": "packages/analytics/shippers/elastic_v3/common/src/report_telemetry_counters.ts", @@ -297,7 +321,13 @@ ], "signature": [ "(events: ", - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]) => string" ], "path": "packages/analytics/shippers/elastic_v3/common/src/events_to_ndjson.ts", @@ -314,7 +344,13 @@ "An array of events {@link Event }" ], "signature": [ - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]" ], "path": "packages/analytics/shippers/elastic_v3/common/src/events_to_ndjson.ts", diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx index 9e54c4ecc9f24..6fba206906f7a 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-common title: "@kbn/analytics-shippers-elastic-v3-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-common plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-common'] --- import kbnAnalyticsShippersElasticV3CommonObj from './kbn_analytics_shippers_elastic_v3_common.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.devdocs.json b/api_docs/kbn_analytics_shippers_elastic_v3_server.devdocs.json index a5b5e11e33d65..9a0eb5bc0ac7d 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.devdocs.json +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.devdocs.json @@ -28,7 +28,13 @@ "text": "ElasticV3ServerShipper" }, " implements ", - "IShipper" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.IShipper", + "text": "IShipper" + } ], "path": "packages/analytics/shippers/elastic_v3/server/src/server_shipper.ts", "deprecated": false, @@ -59,7 +65,13 @@ "signature": [ "Subject", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">" ], "path": "packages/analytics/shippers/elastic_v3/server/src/server_shipper.ts", @@ -92,7 +104,13 @@ "{@link ElasticV3ShipperOptions }" ], "signature": [ - "ElasticV3ShipperOptions" + { + "pluginId": "@kbn/analytics-shippers-elastic-v3-common", + "scope": "common", + "docId": "kibKbnAnalyticsShippersElasticV3CommonPluginApi", + "section": "def-common.ElasticV3ShipperOptions", + "text": "ElasticV3ShipperOptions" + } ], "path": "packages/analytics/shippers/elastic_v3/server/src/server_shipper.ts", "deprecated": false, @@ -109,7 +127,13 @@ "{@link AnalyticsClientInitContext }" ], "signature": [ - "AnalyticsClientInitContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.AnalyticsClientInitContext", + "text": "AnalyticsClientInitContext" + } ], "path": "packages/analytics/shippers/elastic_v3/server/src/server_shipper.ts", "deprecated": false, @@ -130,7 +154,13 @@ ], "signature": [ "(newContext: ", - "EventContext", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + }, ") => void" ], "path": "packages/analytics/shippers/elastic_v3/server/src/server_shipper.ts", @@ -147,7 +177,13 @@ "The full new context to set {@link EventContext }" ], "signature": [ - "EventContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + } ], "path": "packages/analytics/shippers/elastic_v3/server/src/server_shipper.ts", "deprecated": false, @@ -204,7 +240,13 @@ ], "signature": [ "(events: ", - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]) => void" ], "path": "packages/analytics/shippers/elastic_v3/server/src/server_shipper.ts", @@ -221,7 +263,13 @@ "batched events {@link Event }" ], "signature": [ - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]" ], "path": "packages/analytics/shippers/elastic_v3/server/src/server_shipper.ts", @@ -265,10 +313,7 @@ "description": [ "\nOptions for the Elastic V3 shipper" ], - "signature": [ - "ElasticV3ShipperOptions" - ], - "path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts", + "path": "packages/analytics/shippers/elastic_v3/common/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -281,7 +326,7 @@ "description": [ "\nThe name of the channel to stream all the events to." ], - "path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts", + "path": "packages/analytics/shippers/elastic_v3/common/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -294,7 +339,7 @@ "description": [ "\nThe product's version." ], - "path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts", + "path": "packages/analytics/shippers/elastic_v3/common/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -310,7 +355,7 @@ "signature": [ "\"staging\" | \"production\" | undefined" ], - "path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts", + "path": "packages/analytics/shippers/elastic_v3/common/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -326,7 +371,7 @@ "signature": [ "boolean | undefined" ], - "path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts", + "path": "packages/analytics/shippers/elastic_v3/common/src/types.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx index f1f68e6e12c9a..cbd64d954bf0d 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-server title: "@kbn/analytics-shippers-elastic-v3-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-server plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-server'] --- import kbnAnalyticsShippersElasticV3ServerObj from './kbn_analytics_shippers_elastic_v3_server.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_fullstory.devdocs.json b/api_docs/kbn_analytics_shippers_fullstory.devdocs.json index 3ddce3a3b1119..476a7042823ac 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.devdocs.json +++ b/api_docs/kbn_analytics_shippers_fullstory.devdocs.json @@ -36,7 +36,13 @@ "text": "FullStoryShipper" }, " implements ", - "IShipper" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.IShipper", + "text": "IShipper" + } ], "path": "packages/analytics/shippers/fullstory/src/fullstory_shipper.ts", "deprecated": false, @@ -104,7 +110,13 @@ "{@link AnalyticsClientInitContext }" ], "signature": [ - "AnalyticsClientInitContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.AnalyticsClientInitContext", + "text": "AnalyticsClientInitContext" + } ], "path": "packages/analytics/shippers/fullstory/src/fullstory_shipper.ts", "deprecated": false, @@ -125,7 +137,13 @@ ], "signature": [ "(newContext: ", - "EventContext", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + }, ") => void" ], "path": "packages/analytics/shippers/fullstory/src/fullstory_shipper.ts", @@ -142,7 +160,13 @@ "The full new context to set {@link EventContext }" ], "signature": [ - "EventContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + } ], "path": "packages/analytics/shippers/fullstory/src/fullstory_shipper.ts", "deprecated": false, @@ -199,7 +223,13 @@ ], "signature": [ "(events: ", - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]) => void" ], "path": "packages/analytics/shippers/fullstory/src/fullstory_shipper.ts", @@ -216,7 +246,13 @@ "batched events {@link Event }" ], "signature": [ - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]" ], "path": "packages/analytics/shippers/fullstory/src/fullstory_shipper.ts", diff --git a/api_docs/kbn_analytics_shippers_fullstory.mdx b/api_docs/kbn_analytics_shippers_fullstory.mdx index 94eaab7649126..f8ecc04b0ace3 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.mdx +++ b/api_docs/kbn_analytics_shippers_fullstory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-fullstory title: "@kbn/analytics-shippers-fullstory" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-fullstory plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-fullstory'] --- import kbnAnalyticsShippersFullstoryObj from './kbn_analytics_shippers_fullstory.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_gainsight.devdocs.json b/api_docs/kbn_analytics_shippers_gainsight.devdocs.json index 00e50bd404a3d..624830a0a10b5 100644 --- a/api_docs/kbn_analytics_shippers_gainsight.devdocs.json +++ b/api_docs/kbn_analytics_shippers_gainsight.devdocs.json @@ -36,7 +36,13 @@ "text": "GainsightShipper" }, " implements ", - "IShipper" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.IShipper", + "text": "IShipper" + } ], "path": "packages/analytics/shippers/gainsight/src/gainsight_shipper.ts", "deprecated": false, @@ -104,7 +110,13 @@ "{@link AnalyticsClientInitContext }" ], "signature": [ - "AnalyticsClientInitContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.AnalyticsClientInitContext", + "text": "AnalyticsClientInitContext" + } ], "path": "packages/analytics/shippers/gainsight/src/gainsight_shipper.ts", "deprecated": false, @@ -125,7 +137,13 @@ ], "signature": [ "(newContext: ", - "EventContext", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + }, ") => void" ], "path": "packages/analytics/shippers/gainsight/src/gainsight_shipper.ts", @@ -142,7 +160,13 @@ "The full new context to set {@link EventContext }" ], "signature": [ - "EventContext" + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventContext", + "text": "EventContext" + } ], "path": "packages/analytics/shippers/gainsight/src/gainsight_shipper.ts", "deprecated": false, @@ -199,7 +223,13 @@ ], "signature": [ "(events: ", - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]) => void" ], "path": "packages/analytics/shippers/gainsight/src/gainsight_shipper.ts", @@ -216,7 +246,13 @@ "batched events {@link Event }" ], "signature": [ - "Event", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.Event", + "text": "Event" + }, ">[]" ], "path": "packages/analytics/shippers/gainsight/src/gainsight_shipper.ts", diff --git a/api_docs/kbn_analytics_shippers_gainsight.mdx b/api_docs/kbn_analytics_shippers_gainsight.mdx index 167098286c130..24f64b85feb3c 100644 --- a/api_docs/kbn_analytics_shippers_gainsight.mdx +++ b/api_docs/kbn_analytics_shippers_gainsight.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-gainsight title: "@kbn/analytics-shippers-gainsight" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-gainsight plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-gainsight'] --- import kbnAnalyticsShippersGainsightObj from './kbn_analytics_shippers_gainsight.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.devdocs.json b/api_docs/kbn_apm_config_loader.devdocs.json index 9319d14c16b1a..6b39978e0e142 100644 --- a/api_docs/kbn_apm_config_loader.devdocs.json +++ b/api_docs/kbn_apm_config_loader.devdocs.json @@ -274,7 +274,62 @@ "interfaces": [], "enums": [], "misc": [], - "objects": [] + "objects": [ + { + "parentPluginId": "@kbn/apm-config-loader", + "id": "def-server.apmConfigSchema", + "type": "Object", + "tags": [], + "label": "apmConfigSchema", + "description": [], + "signature": [ + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, + "<{ active: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "; serverUrl: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "; secretToken: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "; globalLabels: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, + "<{}>; }>" + ], + "path": "packages/kbn-apm-config-loader/src/apm_config.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ] }, "common": { "classes": [], diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index 221ad0e89d1b0..f78739c36c12b 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] --- import kbnApmConfigLoaderObj from './kbn_apm_config_loader.devdocs.json'; @@ -21,10 +21,13 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 16 | 0 | 16 | 0 | +| 17 | 0 | 17 | 0 | ## Server +### Objects + + ### Functions diff --git a/api_docs/kbn_apm_synthtrace.devdocs.json b/api_docs/kbn_apm_synthtrace.devdocs.json index 394028d4c885e..5202c4cf00aea 100644 --- a/api_docs/kbn_apm_synthtrace.devdocs.json +++ b/api_docs/kbn_apm_synthtrace.devdocs.json @@ -732,6 +732,54 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/apm-synthtrace", + "id": "def-server.dedot", + "type": "Function", + "tags": [], + "label": "dedot", + "description": [], + "signature": [ + "(source: Record, target: Record) => Record" + ], + "path": "packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/apm-synthtrace", + "id": "def-server.dedot.$1", + "type": "Object", + "tags": [], + "label": "source", + "description": [], + "signature": [ + "Record" + ], + "path": "packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/apm-synthtrace", + "id": "def-server.dedot.$2", + "type": "Object", + "tags": [], + "label": "target", + "description": [], + "signature": [ + "Record" + ], + "path": "packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.observer", @@ -1022,7 +1070,7 @@ "section": "def-server.ApmException", "text": "ApmException" }, - "[]; 'error.grouping_name': string; 'error.grouping_key': string; 'host.name': string; 'host.hostname': string; 'http.request.method': string; 'http.response.status_code': number; 'kubernetes.pod.uid': string; 'kubernetes.pod.name': string; 'metricset.name': string; observer: ", + "[]; 'error.grouping_name': string; 'error.grouping_key': string; 'host.name': string; 'host.architecture': string; 'host.hostname': string; 'http.request.method': string; 'http.response.status_code': number; 'kubernetes.pod.uid': string; 'kubernetes.pod.name': string; 'metricset.name': string; observer: ", "Observer", "; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.version': string; 'service.environment': string; 'service.node.name': string; 'service.runtime.name': string; 'service.runtime.version': string; 'service.framework.name': string; 'service.target.name': string; 'service.target.type': string; 'span.action': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.resource': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; 'span.links': { trace: { id: string; }; span: { id: string; }; }[]; 'cloud.provider': string; 'cloud.project.name': string; 'cloud.service.name': string; 'cloud.availability_zone': string; 'cloud.machine.type': string; 'cloud.region': string; 'host.os.platform': string; 'faas.id': string; 'faas.name': string; 'faas.coldstart': boolean; 'faas.execution': string; 'faas.trigger.type': string; 'faas.trigger.request_id': string; }> & Partial<{ 'system.process.memory.size': number; 'system.memory.actual.free': number; 'system.memory.total': number; 'system.cpu.total.norm.pct': number; 'system.process.memory.rss.bytes': number; 'system.process.cpu.total.norm.pct': number; 'jvm.memory.heap.used': number; 'jvm.memory.non_heap.used': number; 'jvm.thread.count': number; 'faas.billed_duration': number; 'faas.timeout': number; 'faas.coldstart_duration': number; 'faas.duration': number; }>" ], @@ -1052,29 +1100,15 @@ "label": "service", "description": [], "signature": [ - "({ name, environment, agentName, }: { name: string; environment: string; agentName: string; }) => ", - "Service" + "{ (name: string, environment: string, agentName: string): ", + "Service", + "; (options: { name: string; environment: string; agentName: string; }): ", + "Service", + "; }" ], "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/apm-synthtrace", - "id": "def-server.apm.service.$1", - "type": "Object", - "tags": [], - "label": "__0", - "description": [], - "signature": [ - "{ name: string; environment: string; agentName: string; }" - ], - "path": "packages/kbn-apm-synthtrace/src/lib/apm/service.ts", - "deprecated": false, - "trackAdoption": false - } - ] + "trackAdoption": false }, { "parentPluginId": "@kbn/apm-synthtrace", @@ -1132,7 +1166,7 @@ "section": "def-server.ApmException", "text": "ApmException" }, - "[] | undefined; 'error.grouping_name'?: string | undefined; 'error.grouping_key'?: string | undefined; 'host.name'?: string | undefined; 'host.hostname'?: string | undefined; 'http.request.method'?: string | undefined; 'http.response.status_code'?: number | undefined; 'kubernetes.pod.uid'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; observer?: ", + "[] | undefined; 'error.grouping_name'?: string | undefined; 'error.grouping_key'?: string | undefined; 'host.name'?: string | undefined; 'host.architecture'?: string | undefined; 'host.hostname'?: string | undefined; 'http.request.method'?: string | undefined; 'http.response.status_code'?: number | undefined; 'kubernetes.pod.uid'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; observer?: ", "Observer", " | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.version'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'service.runtime.name'?: string | undefined; 'service.runtime.version'?: string | undefined; 'service.framework.name'?: string | undefined; 'service.target.name'?: string | undefined; 'service.target.type'?: string | undefined; 'span.action'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.resource'?: string | undefined; 'span.destination.service.response_time.sum.us'?: number | undefined; 'span.destination.service.response_time.count'?: number | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; 'span.links'?: { trace: { id: string; }; span: { id: string; }; }[] | undefined; 'cloud.provider'?: string | undefined; 'cloud.project.name'?: string | undefined; 'cloud.service.name'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.machine.type'?: string | undefined; 'cloud.region'?: string | undefined; 'host.os.platform'?: string | undefined; 'faas.id'?: string | undefined; 'faas.name'?: string | undefined; 'faas.coldstart'?: boolean | undefined; 'faas.execution'?: string | undefined; 'faas.trigger.type'?: string | undefined; 'faas.trigger.request_id'?: string | undefined; 'system.process.memory.size'?: number | undefined; 'system.memory.actual.free'?: number | undefined; 'system.memory.total'?: number | undefined; 'system.cpu.total.norm.pct'?: number | undefined; 'system.process.memory.rss.bytes'?: number | undefined; 'system.process.cpu.total.norm.pct'?: number | undefined; 'jvm.memory.heap.used'?: number | undefined; 'jvm.memory.non_heap.used'?: number | undefined; 'jvm.thread.count'?: number | undefined; 'faas.billed_duration'?: number | undefined; 'faas.timeout'?: number | undefined; 'faas.coldstart_duration'?: number | undefined; 'faas.duration'?: number | undefined; }[]" ], @@ -1188,7 +1222,7 @@ "section": "def-server.ApmException", "text": "ApmException" }, - "[] | undefined; 'error.grouping_name'?: string | undefined; 'error.grouping_key'?: string | undefined; 'host.name'?: string | undefined; 'host.hostname'?: string | undefined; 'http.request.method'?: string | undefined; 'http.response.status_code'?: number | undefined; 'kubernetes.pod.uid'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; observer?: ", + "[] | undefined; 'error.grouping_name'?: string | undefined; 'error.grouping_key'?: string | undefined; 'host.name'?: string | undefined; 'host.architecture'?: string | undefined; 'host.hostname'?: string | undefined; 'http.request.method'?: string | undefined; 'http.response.status_code'?: number | undefined; 'kubernetes.pod.uid'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; observer?: ", "Observer", " | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.duration.histogram'?: { values: number[]; counts: number[]; } | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.version'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'service.runtime.name'?: string | undefined; 'service.runtime.version'?: string | undefined; 'service.framework.name'?: string | undefined; 'service.target.name'?: string | undefined; 'service.target.type'?: string | undefined; 'span.action'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.resource'?: string | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; 'span.links'?: { trace: { id: string; }; span: { id: string; }; }[] | undefined; 'cloud.provider'?: string | undefined; 'cloud.project.name'?: string | undefined; 'cloud.service.name'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.machine.type'?: string | undefined; 'cloud.region'?: string | undefined; 'host.os.platform'?: string | undefined; 'faas.id'?: string | undefined; 'faas.name'?: string | undefined; 'faas.coldstart'?: boolean | undefined; 'faas.execution'?: string | undefined; 'faas.trigger.type'?: string | undefined; 'faas.trigger.request_id'?: string | undefined; 'system.process.memory.size'?: number | undefined; 'system.memory.actual.free'?: number | undefined; 'system.memory.total'?: number | undefined; 'system.cpu.total.norm.pct'?: number | undefined; 'system.process.memory.rss.bytes'?: number | undefined; 'system.process.cpu.total.norm.pct'?: number | undefined; 'jvm.memory.heap.used'?: number | undefined; 'jvm.memory.non_heap.used'?: number | undefined; 'jvm.thread.count'?: number | undefined; 'faas.billed_duration'?: number | undefined; 'faas.timeout'?: number | undefined; 'faas.coldstart_duration'?: number | undefined; 'faas.duration'?: number | undefined; }[]" ], @@ -1371,7 +1405,7 @@ "label": "serverlessFunction", "description": [], "signature": [ - "({ functionName, serviceName, environment, agentName, }: { functionName: string; environment: string; agentName: string; serviceName?: string | undefined; }) => ", + "({ functionName, serviceName, environment, agentName, architecture, }: { functionName: string; environment: string; agentName: string; serviceName?: string | undefined; architecture?: string | undefined; }) => ", "ServerlessFunction" ], "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", @@ -1387,7 +1421,7 @@ "label": "__0", "description": [], "signature": [ - "{ functionName: string; environment: string; agentName: string; serviceName?: string | undefined; }" + "{ functionName: string; environment: string; agentName: string; serviceName?: string | undefined; architecture?: string | undefined; }" ], "path": "packages/kbn-apm-synthtrace/src/lib/apm/serverless_function.ts", "deprecated": false, diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx index 55cd0d93ba713..6018dbecd0463 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] --- import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 74 | 0 | 74 | 13 | +| 76 | 0 | 76 | 13 | ## Server diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index 195537336c476..1f8a4c3fa16de 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index 3c0f55faa1182..04034dce6d726 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_cases_components.devdocs.json b/api_docs/kbn_cases_components.devdocs.json index 77285328875af..098fcecdffa0d 100644 --- a/api_docs/kbn_cases_components.devdocs.json +++ b/api_docs/kbn_cases_components.devdocs.json @@ -27,7 +27,7 @@ "label": "getStatusConfiguration", "description": [], "signature": [ - "() => { open: { color: string; label: string; icon: \"folderOpen\"; }; \"in-progress\": { color: string; label: string; icon: \"folderExclamation\"; }; closed: { color: string; label: string; icon: \"folderCheck\"; }; }" + "() => { open: { color: string; label: any; icon: \"folderOpen\"; }; \"in-progress\": { color: string; label: any; icon: \"folderExclamation\"; }; closed: { color: string; label: any; icon: \"folderCheck\"; }; }" ], "path": "packages/kbn-cases-components/src/status/config.ts", "deprecated": false, diff --git a/api_docs/kbn_cases_components.mdx b/api_docs/kbn_cases_components.mdx index 224c0dbbbbd72..c43775f35c195 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index d8f469942e50c..fb69b16966998 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_ci_stats_core.devdocs.json index c7f7a7630b0d7..2f0ac23f7ca6c 100644 --- a/api_docs/kbn_ci_stats_core.devdocs.json +++ b/api_docs/kbn_ci_stats_core.devdocs.json @@ -20,7 +20,13 @@ "description": [], "signature": [ "(log: ", - "SomeDevLog", + { + "pluginId": "@kbn/some-dev-log", + "scope": "server", + "docId": "kibKbnSomeDevLogPluginApi", + "section": "def-server.SomeDevLog", + "text": "SomeDevLog" + }, ") => ", { "pluginId": "@kbn/ci-stats-core", @@ -43,7 +49,13 @@ "label": "log", "description": [], "signature": [ - "SomeDevLog" + { + "pluginId": "@kbn/some-dev-log", + "scope": "server", + "docId": "kibKbnSomeDevLogPluginApi", + "section": "def-server.SomeDevLog", + "text": "SomeDevLog" + } ], "path": "packages/kbn-ci-stats-core/src/ci_stats_config.ts", "deprecated": false, diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index 06d0b062db8a4..50930fb8c1c7e 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: 2022-10-25 +date: 2022-11-07 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 455ffa4b37590..dcb0faeb15d8a 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_ci_stats_reporter.devdocs.json index 18389c93d07ca..d43b7a22add37 100644 --- a/api_docs/kbn_ci_stats_reporter.devdocs.json +++ b/api_docs/kbn_ci_stats_reporter.devdocs.json @@ -34,7 +34,13 @@ ], "signature": [ "(log: ", - "SomeDevLog", + { + "pluginId": "@kbn/some-dev-log", + "scope": "server", + "docId": "kibKbnSomeDevLogPluginApi", + "section": "def-server.SomeDevLog", + "text": "SomeDevLog" + }, ") => ", { "pluginId": "@kbn/ci-stats-reporter", @@ -56,7 +62,13 @@ "label": "log", "description": [], "signature": [ - "SomeDevLog" + { + "pluginId": "@kbn/some-dev-log", + "scope": "server", + "docId": "kibKbnSomeDevLogPluginApi", + "section": "def-server.SomeDevLog", + "text": "SomeDevLog" + } ], "path": "packages/kbn-ci-stats-reporter/src/ci_stats_reporter.ts", "deprecated": false, @@ -88,7 +100,13 @@ "label": "config", "description": [], "signature": [ - "Config", + { + "pluginId": "@kbn/ci-stats-core", + "scope": "server", + "docId": "kibKbnCiStatsCorePluginApi", + "section": "def-server.Config", + "text": "Config" + }, " | undefined" ], "path": "packages/kbn-ci-stats-reporter/src/ci_stats_reporter.ts", @@ -104,7 +122,13 @@ "label": "log", "description": [], "signature": [ - "SomeDevLog" + { + "pluginId": "@kbn/some-dev-log", + "scope": "server", + "docId": "kibKbnSomeDevLogPluginApi", + "section": "def-server.SomeDevLog", + "text": "SomeDevLog" + } ], "path": "packages/kbn-ci-stats-reporter/src/ci_stats_reporter.ts", "deprecated": false, @@ -373,7 +397,13 @@ "description": [], "signature": [ "(log: ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, ", group: string) => (startTime: number, id: string, meta: Record) => Promise" ], "path": "packages/kbn-ci-stats-reporter/src/report_time.ts", @@ -388,7 +418,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-ci-stats-reporter/src/report_time.ts", "deprecated": false, @@ -510,7 +546,13 @@ "Arbitrary key-value pairs which can be used for additional filtering/reporting" ], "signature": [ - "CiStatsMetadata", + { + "pluginId": "@kbn/ci-stats-core", + "scope": "server", + "docId": "kibKbnCiStatsCorePluginApi", + "section": "def-server.CiStatsMetadata", + "text": "CiStatsMetadata" + }, " | undefined" ], "path": "packages/kbn-ci-stats-reporter/src/ci_stats_reporter.ts", @@ -670,7 +712,13 @@ "\nArbitrary metadata associated with this group. We currently look for a ciGroup metadata property for highlighting that when appropriate" ], "signature": [ - "CiStatsMetadata" + { + "pluginId": "@kbn/ci-stats-core", + "scope": "server", + "docId": "kibKbnCiStatsCorePluginApi", + "section": "def-server.CiStatsMetadata", + "text": "CiStatsMetadata" + } ], "path": "packages/kbn-ci-stats-reporter/src/ci_stats_test_group_types.ts", "deprecated": false, @@ -916,7 +964,13 @@ "hash of key-value pairs which will be stored with the timing for additional filtering and reporting" ], "signature": [ - "CiStatsMetadata", + { + "pluginId": "@kbn/ci-stats-core", + "scope": "server", + "docId": "kibKbnCiStatsCorePluginApi", + "section": "def-server.CiStatsMetadata", + "text": "CiStatsMetadata" + }, " | undefined" ], "path": "packages/kbn-ci-stats-reporter/src/ci_stats_reporter.ts", @@ -949,7 +1003,13 @@ "Default metadata to add to each metric" ], "signature": [ - "CiStatsMetadata", + { + "pluginId": "@kbn/ci-stats-core", + "scope": "server", + "docId": "kibKbnCiStatsCorePluginApi", + "section": "def-server.CiStatsMetadata", + "text": "CiStatsMetadata" + }, " | undefined" ], "path": "packages/kbn-ci-stats-reporter/src/ci_stats_reporter.ts", diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index fd60744b830e9..addd5d0cf2576 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: 2022-10-25 +date: 2022-11-07 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 7dca18a6fe21a..bc6d743581b14 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_coloring.devdocs.json b/api_docs/kbn_coloring.devdocs.json index 8c6054e41c806..bfddcf39dfed9 100644 --- a/api_docs/kbn_coloring.devdocs.json +++ b/api_docs/kbn_coloring.devdocs.json @@ -1242,7 +1242,13 @@ ], "signature": [ "(state?: T | undefined) => ", - "Ast" + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.Ast", + "text": "Ast" + } ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index ae2e9ae19ea50..78928b43fc2c1 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] --- import kbnColoringObj from './kbn_coloring.devdocs.json'; diff --git a/api_docs/kbn_config.devdocs.json b/api_docs/kbn_config.devdocs.json index ed22f3e9d58ac..bc31f6ba45c46 100644 --- a/api_docs/kbn_config.devdocs.json +++ b/api_docs/kbn_config.devdocs.json @@ -282,7 +282,13 @@ "Allow direct access to the doc links from the deprecation handler" ], "signature": [ - "DocLinks" + { + "pluginId": "@kbn/doc-links", + "scope": "common", + "docId": "kibKbnDocLinksPluginApi", + "section": "def-common.DocLinks", + "text": "DocLinks" + } ], "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index f2f3845f6d49a..3bfee8af14ea5 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] --- import kbnConfigObj from './kbn_config.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 73 | 0 | 44 | 1 | +| 73 | 0 | 44 | 8 | ## Server diff --git a/api_docs/kbn_config_mocks.devdocs.json b/api_docs/kbn_config_mocks.devdocs.json index 5b6e0a9435c89..5e1b5d32aa4b4 100644 --- a/api_docs/kbn_config_mocks.devdocs.json +++ b/api_docs/kbn_config_mocks.devdocs.json @@ -24,7 +24,13 @@ " | undefined; packageInfo?: ", "RawPackageInfo", " | undefined; }) => ", - "Env" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.Env", + "text": "Env" + } ], "path": "packages/kbn-config-mocks/src/env.mock.ts", "deprecated": false, @@ -187,7 +193,13 @@ "label": "ConfigDeprecationContextMock", "description": [], "signature": [ - "ConfigDeprecationContext" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationContext", + "text": "ConfigDeprecationContext" + } ], "path": "packages/kbn-config-mocks/src/deprecations.mock.ts", "deprecated": false, @@ -203,11 +215,29 @@ "description": [], "signature": [ "{ has: jest.MockInstance; get: jest.MockInstance; set: jest.MockInstance; getFlattenedPaths: jest.MockInstance; toRaw: jest.MockInstance, []>; } & ", "Config" ], @@ -231,27 +261,81 @@ "<", "Config", ">, []>; setSchema: jest.MockInstance]>; addDeprecationProvider: jest.MockInstance; getHandledDeprecatedConfigs: jest.MockInstance<[string, ", - "DeprecatedConfigDetails", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.DeprecatedConfigDetails", + "text": "DeprecatedConfigDetails" + }, "[]][], []>; atPath: jest.MockInstance<", "Observable", ", [path: ", - "ConfigPath", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigPath", + "text": "ConfigPath" + }, "]>; atPathSync: jest.MockInstance; isEnabledAtPath: jest.MockInstance, [path: ", - "ConfigPath", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigPath", + "text": "ConfigPath" + }, "]>; getUnusedPaths: jest.MockInstance, []>; getUsedPaths: jest.MockInstance, []>; getDeprecatedConfigPath$: jest.MockInstance<", "Observable", "<", - "ChangedDeprecatedPaths", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ChangedDeprecatedPaths", + "text": "ChangedDeprecatedPaths" + }, ">, []>; } & ", "IConfigService" ], @@ -271,7 +355,13 @@ "{ stop: jest.MockInstance; getConfig$: jest.MockInstance<", "Observable", ">, []>; loadConfig: jest.MockInstance; reloadConfig: jest.MockInstance; } & ", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", "RawConfigService", ">" @@ -303,7 +393,13 @@ "description": [], "signature": [ "() => ", - "ConfigDeprecationContext" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationContext", + "text": "ConfigDeprecationContext" + } ], "path": "packages/kbn-config-mocks/src/deprecations.mock.ts", "deprecated": false, diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index cdd0371e93c1f..f74637ae7f94d 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] --- import kbnConfigMocksObj from './kbn_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_config_schema.devdocs.json b/api_docs/kbn_config_schema.devdocs.json index dffe21fe32845..6f14501525b6d 100644 --- a/api_docs/kbn_config_schema.devdocs.json +++ b/api_docs/kbn_config_schema.devdocs.json @@ -463,9 +463,6 @@ "label": "rightOperand", "description": [], "signature": [ - "A | ", - "Reference", - " | ", { "pluginId": "@kbn/config-schema", "scope": "server", @@ -473,7 +470,9 @@ "section": "def-server.Type", "text": "Type" }, - "" + " | A | ", + "Reference", + "" ], "path": "packages/kbn-config-schema/src/types/conditional_type.ts", "deprecated": false, diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index 71b7600aaebba..6ffcc6de3bc2f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list.devdocs.json b/api_docs/kbn_content_management_table_list.devdocs.json index 967aae50206d2..6a8205e1d4d94 100644 --- a/api_docs/kbn_content_management_table_list.devdocs.json +++ b/api_docs/kbn_content_management_table_list.devdocs.json @@ -73,7 +73,13 @@ ], "signature": [ "({ children, ...services }: React.PropsWithChildren<", - "TableListViewKibanaDependencies", + { + "pluginId": "@kbn/content-management-table-list", + "scope": "common", + "docId": "kibKbnContentManagementTableListPluginApi", + "section": "def-common.TableListViewKibanaDependencies", + "text": "TableListViewKibanaDependencies" + }, ">) => JSX.Element" ], "path": "packages/content-management/table_list/src/services.tsx", @@ -89,7 +95,13 @@ "description": [], "signature": [ "React.PropsWithChildren<", - "TableListViewKibanaDependencies", + { + "pluginId": "@kbn/content-management-table-list", + "scope": "common", + "docId": "kibKbnContentManagementTableListPluginApi", + "section": "def-common.TableListViewKibanaDependencies", + "text": "TableListViewKibanaDependencies" + }, ">" ], "path": "packages/content-management/table_list/src/services.tsx", @@ -142,6 +154,144 @@ } ], "interfaces": [ + { + "parentPluginId": "@kbn/content-management-table-list", + "id": "def-common.TableListViewKibanaDependencies", + "type": "Interface", + "tags": [], + "label": "TableListViewKibanaDependencies", + "description": [ + "\nKibana-specific service types." + ], + "path": "packages/content-management/table_list/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-table-list", + "id": "def-common.TableListViewKibanaDependencies.core", + "type": "Object", + "tags": [], + "label": "core", + "description": [ + "CoreStart contract" + ], + "signature": [ + "{ application: { capabilities: { advancedSettings?: { save: boolean; } | undefined; }; getUrlForApp: (app: string, options: { path: string; }) => string; currentAppId$: ", + "Observable", + "; navigateToUrl: (url: string) => void | Promise; }; notifications: { toasts: { addDanger: (notifyArgs: { title: MountPoint; text?: string | undefined; }) => void; }; }; }" + ], + "path": "packages/content-management/table_list/src/services.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/content-management-table-list", + "id": "def-common.TableListViewKibanaDependencies.toMountPoint", + "type": "Function", + "tags": [], + "label": "toMountPoint", + "description": [ + "\nHandler from the '@kbn/kibana-react-plugin/public' Plugin\n\n```\nimport { toMountPoint } from '@kbn/kibana-react-plugin/public';\n```" + ], + "signature": [ + "(node: React.ReactNode, options?: { theme$: ", + "Observable", + "<{ readonly darkMode: boolean; }>; } | undefined) => MountPoint" + ], + "path": "packages/content-management/table_list/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-table-list", + "id": "def-common.TableListViewKibanaDependencies.toMountPoint.$1", + "type": "CompoundType", + "tags": [], + "label": "node", + "description": [], + "signature": [ + "React.ReactNode" + ], + "path": "packages/content-management/table_list/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + }, + { + "parentPluginId": "@kbn/content-management-table-list", + "id": "def-common.TableListViewKibanaDependencies.toMountPoint.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "packages/content-management/table_list/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-table-list", + "id": "def-common.TableListViewKibanaDependencies.toMountPoint.$2.theme$", + "type": "Object", + "tags": [], + "label": "theme$", + "description": [], + "signature": [ + "Observable", + "<{ readonly darkMode: boolean; }>" + ], + "path": "packages/content-management/table_list/src/services.tsx", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/content-management-table-list", + "id": "def-common.TableListViewKibanaDependencies.savedObjectsTagging", + "type": "Object", + "tags": [], + "label": "savedObjectsTagging", + "description": [ + "\nThe public API from the savedObjectsTaggingOss plugin.\nIt is returned by calling `getTaggingApi()` from the SavedObjectTaggingOssPluginStart\n\n```js\nconst savedObjectsTagging = savedObjectsTaggingOss?.getTaggingApi()\n```" + ], + "signature": [ + "{ ui: { components: { TagList: React.FC<{ object: { references: ", + "SavedObjectsReference", + "[]; }; onClick?: ((tag: { name: string; description: string; color: string; }) => void) | undefined; }>; }; parseSearchQuery: (query: string, options?: { useName?: boolean | undefined; tagField?: string | undefined; } | undefined) => { searchTerm: string; tagReferences: ", + "SavedObjectsFindOptionsReference", + "[]; valid: boolean; }; getSearchBarFilter: (options?: { useName?: boolean | undefined; tagField?: string | undefined; } | undefined) => ", + "SearchFilterConfig", + "; getTagIdsFromReferences: (references: ", + "SavedObjectsReference", + "[]) => string[]; }; } | undefined" + ], + "path": "packages/content-management/table_list/src/services.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/content-management-table-list", + "id": "def-common.TableListViewKibanaDependencies.FormattedRelative", + "type": "Object", + "tags": [], + "label": "FormattedRelative", + "description": [ + "The component from the @kbn/i18n-react package" + ], + "signature": [ + "typeof ReactIntl.FormattedRelative" + ], + "path": "packages/content-management/table_list/src/services.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/content-management-table-list", "id": "def-common.UserContentCommonSchema", diff --git a/api_docs/kbn_content_management_table_list.mdx b/api_docs/kbn_content_management_table_list.mdx index 34b7c959f958a..ce6804e5cb9c0 100644 --- a/api_docs/kbn_content_management_table_list.mdx +++ b/api_docs/kbn_content_management_table_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list title: "@kbn/content-management-table-list" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list'] --- import kbnContentManagementTableListObj from './kbn_content_management_table_list.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 12 | 0 | 10 | 4 | +| 20 | 0 | 13 | 4 | ## Common diff --git a/api_docs/kbn_core_analytics_browser.devdocs.json b/api_docs/kbn_core_analytics_browser.devdocs.json index df9feddd3b17a..b0ced1c35a7de 100644 --- a/api_docs/kbn_core_analytics_browser.devdocs.json +++ b/api_docs/kbn_core_analytics_browser.devdocs.json @@ -33,21 +33,63 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], "path": "packages/core/analytics/core-analytics-browser/src/types.ts", @@ -66,11 +108,23 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; }" ], "path": "packages/core/analytics/core-analytics-browser/src/types.ts", diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index bbab9a9d112e4..d2082f6a76321 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_analytics_browser_internal.devdocs.json index 13176eda7ae3f..7852bf8e4b033 100644 --- a/api_docs/kbn_core_analytics_browser_internal.devdocs.json +++ b/api_docs/kbn_core_analytics_browser_internal.devdocs.json @@ -72,7 +72,13 @@ "({ injectedMetadata }: ", "AnalyticsServiceSetupDeps", ") => ", - "AnalyticsServiceSetup" + { + "pluginId": "@kbn/core-analytics-browser", + "scope": "common", + "docId": "kibKbnCoreAnalyticsBrowserPluginApi", + "section": "def-common.AnalyticsServiceSetup", + "text": "AnalyticsServiceSetup" + } ], "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts", "deprecated": false, @@ -105,7 +111,13 @@ "description": [], "signature": [ "() => ", - "AnalyticsServiceStart" + { + "pluginId": "@kbn/core-analytics-browser", + "scope": "common", + "docId": "kibKbnCoreAnalyticsBrowserPluginApi", + "section": "def-common.AnalyticsServiceStart", + "text": "AnalyticsServiceStart" + } ], "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts", "deprecated": false, diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index 3234655c413fb..ee1e641d2799b 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_analytics_browser_mocks.devdocs.json index edc408199dbc2..0b945559a93af 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_analytics_browser_mocks.devdocs.json @@ -59,7 +59,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "AnalyticsServiceSetup", + { + "pluginId": "@kbn/core-analytics-browser", + "scope": "common", + "docId": "kibKbnCoreAnalyticsBrowserPluginApi", + "section": "def-common.AnalyticsServiceSetup", + "text": "AnalyticsServiceSetup" + }, ">" ], "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts", @@ -77,7 +83,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "AnalyticsServiceStart", + { + "pluginId": "@kbn/core-analytics-browser", + "scope": "common", + "docId": "kibKbnCoreAnalyticsBrowserPluginApi", + "section": "def-common.AnalyticsServiceStart", + "text": "AnalyticsServiceStart" + }, ">" ], "path": "packages/core/analytics/core-analytics-browser-mocks/src/analytics_service.mock.ts", diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index b31cd3c9d3ed5..8c1f489bdbb59 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: 2022-10-25 +date: 2022-11-07 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 a675d4ad90684..f254ded72092f 100644 --- a/api_docs/kbn_core_analytics_server.devdocs.json +++ b/api_docs/kbn_core_analytics_server.devdocs.json @@ -25,21 +25,63 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], "path": "packages/core/analytics/core-analytics-server/src/contracts.ts", @@ -58,21 +100,63 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], "path": "packages/core/analytics/core-analytics-server/src/contracts.ts", @@ -91,11 +175,23 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; }" ], "path": "packages/core/analytics/core-analytics-server/src/contracts.ts", diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 162c8e6cbfdcf..33e9d06586afa 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_analytics_server_internal.devdocs.json index 5f04684c1b169..01e3743f2f806 100644 --- a/api_docs/kbn_core_analytics_server_internal.devdocs.json +++ b/api_docs/kbn_core_analytics_server_internal.devdocs.json @@ -62,7 +62,13 @@ "description": [], "signature": [ "() => ", - "AnalyticsServicePreboot" + { + "pluginId": "@kbn/core-analytics-server", + "scope": "server", + "docId": "kibKbnCoreAnalyticsServerPluginApi", + "section": "def-server.AnalyticsServicePreboot", + "text": "AnalyticsServicePreboot" + } ], "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts", "deprecated": false, @@ -79,7 +85,13 @@ "description": [], "signature": [ "() => ", - "AnalyticsServiceSetup" + { + "pluginId": "@kbn/core-analytics-server", + "scope": "server", + "docId": "kibKbnCoreAnalyticsServerPluginApi", + "section": "def-server.AnalyticsServiceSetup", + "text": "AnalyticsServiceSetup" + } ], "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts", "deprecated": false, @@ -96,7 +108,13 @@ "description": [], "signature": [ "() => ", - "AnalyticsServiceStart" + { + "pluginId": "@kbn/core-analytics-server", + "scope": "server", + "docId": "kibKbnCoreAnalyticsServerPluginApi", + "section": "def-server.AnalyticsServiceStart", + "text": "AnalyticsServiceStart" + } ], "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts", "deprecated": false, diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index ccbf96dddc7f3..d863be000893c 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_analytics_server_mocks.devdocs.json index beb0ce1c497dd..3b88c66575047 100644 --- a/api_docs/kbn_core_analytics_server_mocks.devdocs.json +++ b/api_docs/kbn_core_analytics_server_mocks.devdocs.json @@ -51,7 +51,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "AnalyticsServicePreboot", + { + "pluginId": "@kbn/core-analytics-server", + "scope": "server", + "docId": "kibKbnCoreAnalyticsServerPluginApi", + "section": "def-server.AnalyticsServicePreboot", + "text": "AnalyticsServicePreboot" + }, ">" ], "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts", @@ -69,7 +75,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "AnalyticsServiceSetup", + { + "pluginId": "@kbn/core-analytics-server", + "scope": "server", + "docId": "kibKbnCoreAnalyticsServerPluginApi", + "section": "def-server.AnalyticsServiceSetup", + "text": "AnalyticsServiceSetup" + }, ">" ], "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts", @@ -87,7 +99,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "AnalyticsServiceStart", + { + "pluginId": "@kbn/core-analytics-server", + "scope": "server", + "docId": "kibKbnCoreAnalyticsServerPluginApi", + "section": "def-server.AnalyticsServiceStart", + "text": "AnalyticsServiceStart" + }, ">" ], "path": "packages/core/analytics/core-analytics-server-mocks/src/analytics_service.mock.ts", diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index 6259c2591140a..02247b1df29ef 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: 2022-10-25 +date: 2022-11-07 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 afc8071835d8f..e837ffdee30dd 100644 --- a/api_docs/kbn_core_application_browser.devdocs.json +++ b/api_docs/kbn_core_application_browser.devdocs.json @@ -84,7 +84,13 @@ "\nThe category definition of the product\nSee {@link AppCategory}\nSee DEFAULT_APP_CATEGORIES for more reference" ], "signature": [ - "AppCategory", + { + "pluginId": "@kbn/core-application-common", + "scope": "common", + "docId": "kibKbnCoreApplicationCommonPluginApi", + "section": "def-common.AppCategory", + "text": "AppCategory" + }, " | undefined" ], "path": "packages/core/application/core-application-browser/src/application.ts", @@ -205,7 +211,13 @@ ], "signature": [ "Partial<", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, "> | undefined" ], "path": "packages/core/application/core-application-browser/src/application.ts", @@ -1153,7 +1165,36 @@ "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, - "references": [] + "references": [ + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/ui/app_container.tsx" + }, + { + "plugin": "@kbn/core-application-browser-mocks", + "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts" + }, + { + "plugin": "management", + "path": "src/plugins/management/public/application.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/integrations/index.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/logout/logout_app.test.ts" + }, + { + "plugin": "kibanaOverview", + "path": "src/plugins/kibana_overview/public/application.tsx" + }, + { + "plugin": "core", + "path": "src/core/public/mocks.ts" + } + ] }, { "parentPluginId": "@kbn/core-application-browser", @@ -1181,7 +1222,84 @@ "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, - "references": [], + "references": [ + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/ui/app_container.tsx" + }, + { + "plugin": "@kbn/core-application-browser-mocks", + "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/visualize_app/app.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/visualize_app/index.tsx" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/plugin.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/mounter.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/render_app.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/map_page.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/app.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/plugin.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/logout/logout_app.test.ts" + }, + { + "plugin": "core", + "path": "src/core/public/mocks.ts" + } + ], "children": [ { "parentPluginId": "@kbn/core-application-browser", @@ -1218,7 +1336,13 @@ ], "signature": [ "(menuMount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined) => void" ], "path": "packages/core/application/core-application-browser/src/app_mount.ts", @@ -1233,7 +1357,13 @@ "label": "menuMount", "description": [], "signature": [ - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined" ], "path": "packages/core/application/core-application-browser/src/app_mount.ts", @@ -1256,7 +1386,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "packages/core/application/core-application-browser/src/app_mount.ts", @@ -1817,7 +1953,92 @@ "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, - "references": [], + "references": [ + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/ui/app_container.tsx" + }, + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/ui/app_container.tsx" + }, + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/ui/app_router.tsx" + }, + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/ui/app_router.tsx" + }, + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/application_leave.tsx" + }, + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/application_leave.tsx" + }, + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/application_service.tsx" + }, + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/application_service.tsx" + }, + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/application_service.tsx" + }, + { + "plugin": "core", + "path": "src/core/public/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/routes.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/routes.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/app.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/app.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/app/app.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts" + } + ], "returnComment": [], "children": [ { diff --git a/api_docs/kbn_core_application_browser.mdx b/api_docs/kbn_core_application_browser.mdx index 1b89ddf0c711c..114e0cc629a51 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_application_browser_internal.devdocs.json index afa55347fdb2d..ff0417c778b24 100644 --- a/api_docs/kbn_core_application_browser_internal.devdocs.json +++ b/api_docs/kbn_core_application_browser_internal.devdocs.json @@ -76,9 +76,21 @@ "description": [], "signature": [ "(app: ", - "App", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.App", + "text": "App" + }, ") => ", - "PublicAppInfo" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.PublicAppInfo", + "text": "PublicAppInfo" + } ], "path": "packages/core/application/core-application-browser-internal/src/utils/get_app_info.ts", "deprecated": false, @@ -92,7 +104,13 @@ "label": "app", "description": [], "signature": [ - "App", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.App", + "text": "App" + }, "" ], "path": "packages/core/application/core-application-browser-internal/src/utils/get_app_info.ts", @@ -115,9 +133,21 @@ ], "signature": [ "(url: string, basePath: ", - "IBasePath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IBasePath", + "text": "IBasePath" + }, ", apps: Map>, currentUrl?: string) => ", "ParsedAppUrl", " | undefined" @@ -149,7 +179,13 @@ "label": "basePath", "description": [], "signature": [ - "IBasePath" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IBasePath", + "text": "IBasePath" + } ], "path": "packages/core/application/core-application-browser-internal/src/utils/parse_app_url.ts", "deprecated": false, @@ -165,7 +201,13 @@ "description": [], "signature": [ "Map>" ], "path": "packages/core/application/core-application-browser-internal/src/utils/parse_app_url.ts", diff --git a/api_docs/kbn_core_application_browser_internal.mdx b/api_docs/kbn_core_application_browser_internal.mdx index 274075d7f5487..06180848e5a0e 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-internal'] --- import kbnCoreApplicationBrowserInternalObj from './kbn_core_application_browser_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 18 | 0 | 15 | 1 | +| 18 | 0 | 15 | 3 | ## Common diff --git a/api_docs/kbn_core_application_browser_mocks.devdocs.json b/api_docs/kbn_core_application_browser_mocks.devdocs.json index 179ed3831178b..986386f0a924e 100644 --- a/api_docs/kbn_core_application_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_application_browser_mocks.devdocs.json @@ -31,7 +31,13 @@ "description": [], "signature": [ "{ createSubHistory: jest.MockInstance<", - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, ", [basePath: string]>; createHref: jest.MockInstance, options?: { prependBasePath?: boolean | undefined; } | undefined]>; length: number; action: ", @@ -51,7 +57,13 @@ ", [listener: ", "LocationListener", "]>; } & ", - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, "" ], "path": "packages/core/application/core-application-browser-mocks/src/scoped_history.mock.ts", @@ -97,7 +109,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ApplicationSetup", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationSetup", + "text": "ApplicationSetup" + }, ">" ], "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts", @@ -115,7 +133,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ApplicationStart", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationStart", + "text": "ApplicationStart" + }, ">" ], "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts", @@ -169,9 +193,21 @@ "description": [], "signature": [ "(parts?: Partial<", - "AppMountParameters", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppMountParameters", + "text": "AppMountParameters" + }, ">) => ", - "AppMountParameters", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppMountParameters", + "text": "AppMountParameters" + }, "" ], "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts", @@ -188,15 +224,39 @@ "description": [], "signature": [ "{ element?: HTMLElement | undefined; history?: ", - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, " | undefined; appBasePath?: string | undefined; onAppLeave?: ((handler: ", - "AppLeaveHandler", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppLeaveHandler", + "text": "AppLeaveHandler" + }, ") => void) | undefined; setHeaderActionMenu?: ((menuMount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined) => void) | undefined; theme$?: ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, "> | undefined; }" ], "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts", diff --git a/api_docs/kbn_core_application_browser_mocks.mdx b/api_docs/kbn_core_application_browser_mocks.mdx index c5ec5b29757e5..e4bf8513f2933 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: 2022-10-25 +date: 2022-11-07 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 41dfc5c057d40..d4ed381cf3858 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_apps_browser_internal.devdocs.json index 5cea64788f899..d8938c10403b5 100644 --- a/api_docs/kbn_core_apps_browser_internal.devdocs.json +++ b/api_docs/kbn_core_apps_browser_internal.devdocs.json @@ -208,7 +208,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "packages/core/apps/core-apps-browser-internal/src/core_app.ts", "deprecated": false, @@ -236,7 +242,13 @@ "label": "notifications", "description": [], "signature": [ - "NotificationsSetup" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsSetup", + "text": "NotificationsSetup" + } ], "path": "packages/core/apps/core-apps-browser-internal/src/core_app.ts", "deprecated": false, @@ -278,7 +290,13 @@ "label": "docLinks", "description": [], "signature": [ - "DocLinksStart" + { + "pluginId": "@kbn/core-doc-links-browser", + "scope": "common", + "docId": "kibKbnCoreDocLinksBrowserPluginApi", + "section": "def-common.DocLinksStart", + "text": "DocLinksStart" + } ], "path": "packages/core/apps/core-apps-browser-internal/src/core_app.ts", "deprecated": false, @@ -292,7 +310,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "packages/core/apps/core-apps-browser-internal/src/core_app.ts", "deprecated": false, @@ -306,7 +330,13 @@ "label": "notifications", "description": [], "signature": [ - "NotificationsStart" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + } ], "path": "packages/core/apps/core-apps-browser-internal/src/core_app.ts", "deprecated": false, @@ -320,7 +350,13 @@ "label": "uiSettings", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "packages/core/apps/core-apps-browser-internal/src/core_app.ts", "deprecated": false, diff --git a/api_docs/kbn_core_apps_browser_internal.mdx b/api_docs/kbn_core_apps_browser_internal.mdx index 36edfe6ccecff..ddf7bbe7c92e9 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: 2022-10-25 +date: 2022-11-07 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 81cb83586818e..2af8f954ad15b 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_apps_server_internal.devdocs.json new file mode 100644 index 0000000000000..20c8639b26b2b --- /dev/null +++ b/api_docs/kbn_core_apps_server_internal.devdocs.json @@ -0,0 +1,165 @@ +{ + "id": "@kbn/core-apps-server-internal", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/core-apps-server-internal", + "id": "def-server.registerRouteForBundle", + "type": "Function", + "tags": [], + "label": "registerRouteForBundle", + "description": [], + "signature": [ + "(router: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, + "<", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandlerContextBase", + "text": "RequestHandlerContextBase" + }, + ">, {\n publicPath,\n routePath,\n bundlesPath,\n fileHashCache,\n isDist,\n }: { publicPath: string; routePath: string; bundlesPath: string; fileHashCache: ", + "FileHashCache", + "; isDist: boolean; }) => void" + ], + "path": "packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-apps-server-internal", + "id": "def-server.registerRouteForBundle.$1", + "type": "Object", + "tags": [], + "label": "router", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, + "<", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandlerContextBase", + "text": "RequestHandlerContextBase" + }, + ">" + ], + "path": "packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-apps-server-internal", + "id": "def-server.registerRouteForBundle.$2", + "type": "Object", + "tags": [], + "label": "{\n publicPath,\n routePath,\n bundlesPath,\n fileHashCache,\n isDist,\n }", + "description": [], + "path": "packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-apps-server-internal", + "id": "def-server.registerRouteForBundle.$2.publicPath", + "type": "string", + "tags": [], + "label": "publicPath", + "description": [], + "path": "packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-apps-server-internal", + "id": "def-server.registerRouteForBundle.$2.routePath", + "type": "string", + "tags": [], + "label": "routePath", + "description": [], + "path": "packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-apps-server-internal", + "id": "def-server.registerRouteForBundle.$2.bundlesPath", + "type": "string", + "tags": [], + "label": "bundlesPath", + "description": [], + "path": "packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-apps-server-internal", + "id": "def-server.registerRouteForBundle.$2.fileHashCache", + "type": "Object", + "tags": [], + "label": "fileHashCache", + "description": [], + "signature": [ + "FileHashCache" + ], + "path": "packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-apps-server-internal", + "id": "def-server.registerRouteForBundle.$2.isDist", + "type": "boolean", + "tags": [], + "label": "isDist", + "description": [], + "path": "packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "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_core_apps_server_internal.mdx b/api_docs/kbn_core_apps_server_internal.mdx new file mode 100644 index 0000000000000..1ff54379b0907 --- /dev/null +++ b/api_docs/kbn_core_apps_server_internal.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: kibKbnCoreAppsServerInternalPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-server-internal'] +--- +import kbnCoreAppsServerInternalObj from './kbn_core_apps_server_internal.devdocs.json'; + + + +Contact Kibana Core for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 8 | 0 | 8 | 1 | + +## Server + +### Functions + + diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index a41603ae3aeca..5e7901544e931 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: 2022-10-25 +date: 2022-11-07 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 3bd018069c91e..59774c7695efc 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: 2022-10-25 +date: 2022-11-07 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 bec7d0d6b15e2..b2e57234f8dc1 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] --- import kbnCoreBaseServerInternalObj from './kbn_core_base_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 7 | 0 | 7 | 0 | +| 7 | 0 | 7 | 2 | ## Server diff --git a/api_docs/kbn_core_base_server_mocks.devdocs.json b/api_docs/kbn_core_base_server_mocks.devdocs.json index 5b94ef7a6f470..49538fe9953d9 100644 --- a/api_docs/kbn_core_base_server_mocks.devdocs.json +++ b/api_docs/kbn_core_base_server_mocks.devdocs.json @@ -35,13 +35,31 @@ "description": [], "signature": [ "({ env, logger, configService, }?: { env?: ", - "Env", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.Env", + "text": "Env" + }, " | undefined; logger?: jest.Mocked<", - "LoggerFactory", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + }, "> | undefined; configService?: jest.Mocked<", "IConfigService", "> | undefined; }) => ", - "DeeplyMockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.DeeplyMockedKeys", + "text": "DeeplyMockedKeys" + }, "<", "CoreContext", ">" @@ -60,9 +78,21 @@ "description": [], "signature": [ "{ env?: ", - "Env", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.Env", + "text": "Env" + }, " | undefined; logger?: jest.Mocked<", - "LoggerFactory", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + }, "> | undefined; configService?: jest.Mocked<", "IConfigService", "> | undefined; }" diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index ad2b0b4a84cda..29af31cb94fe7 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_capabilities_browser_mocks.devdocs.json index f5d505c8100d2..8deb9635d33e0 100644 --- a/api_docs/kbn_core_capabilities_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_capabilities_browser_mocks.devdocs.json @@ -43,7 +43,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", "CapabilitiesService", ">>" diff --git a/api_docs/kbn_core_capabilities_browser_mocks.mdx b/api_docs/kbn_core_capabilities_browser_mocks.mdx index 9f5fb1c9f3129..e906436dfea62 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: 2022-10-25 +date: 2022-11-07 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 b439f9c55d08d..25e3a6a14cb2f 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_capabilities_server.devdocs.json index 7847b60af1bcf..cd7bd72d9c4bd 100644 --- a/api_docs/kbn_core_capabilities_server.devdocs.json +++ b/api_docs/kbn_core_capabilities_server.devdocs.json @@ -148,7 +148,13 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", options?: ", { "pluginId": "@kbn/core-capabilities-server", @@ -158,7 +164,13 @@ "text": "ResolveCapabilitiesOptions" }, " | undefined) => Promise<", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, ">" ], "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", @@ -173,7 +185,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/capabilities/core-capabilities-server/src/contracts.ts", @@ -252,7 +270,13 @@ ], "signature": [ "() => Partial<", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, ">" ], "path": "packages/core/capabilities/core-capabilities-server/src/capabilities.ts", @@ -273,13 +297,37 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", uiCapabilities: ", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, ", useDefaultCapabilities: boolean) => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, ">" ], "path": "packages/core/capabilities/core-capabilities-server/src/capabilities.ts", @@ -295,7 +343,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/capabilities/core-capabilities-server/src/capabilities.ts", @@ -310,7 +364,13 @@ "label": "uiCapabilities", "description": [], "signature": [ - "Capabilities" + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + } ], "path": "packages/core/capabilities/core-capabilities-server/src/capabilities.ts", "deprecated": false, diff --git a/api_docs/kbn_core_capabilities_server.mdx b/api_docs/kbn_core_capabilities_server.mdx index 4da9c4e3875b8..560bc1b249dc4 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_capabilities_server_mocks.devdocs.json index 63e7462ee78f0..c4cb6a1ee8a16 100644 --- a/api_docs/kbn_core_capabilities_server_mocks.devdocs.json +++ b/api_docs/kbn_core_capabilities_server_mocks.devdocs.json @@ -22,15 +22,23 @@ "label": "CapabilitiesServiceContract", "description": [], "signature": [ - "{ setup: (setupDeps: ", - "SetupDeps", - ") => ", - "CapabilitiesSetup", + "{ setup: (setupDeps: SetupDeps) => ", + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesSetup", + "text": "CapabilitiesSetup" + }, "; start: () => ", - "CapabilitiesStart", - "; preboot: (prebootDeps: ", - "PrebootSetupDeps", - ") => void; }" + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesStart", + "text": "CapabilitiesStart" + }, + "; preboot: (prebootDeps: PrebootSetupDeps) => void; }" ], "path": "packages/core/capabilities/core-capabilities-server-mocks/src/capabilities_service.mock.ts", "deprecated": false, @@ -83,7 +91,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "CapabilitiesSetup", + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesSetup", + "text": "CapabilitiesSetup" + }, ">" ], "path": "packages/core/capabilities/core-capabilities-server-mocks/src/capabilities_service.mock.ts", @@ -101,7 +115,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "CapabilitiesStart", + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesStart", + "text": "CapabilitiesStart" + }, ">" ], "path": "packages/core/capabilities/core-capabilities-server-mocks/src/capabilities_service.mock.ts", @@ -119,7 +139,13 @@ "description": [], "signature": [ "() => ", - "Capabilities" + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + } ], "path": "packages/core/capabilities/core-capabilities-server-mocks/src/capabilities_service.mock.ts", "deprecated": false, diff --git a/api_docs/kbn_core_capabilities_server_mocks.mdx b/api_docs/kbn_core_capabilities_server_mocks.mdx index 0c58763010fd0..dafda867acc52 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser.devdocs.json b/api_docs/kbn_core_chrome_browser.devdocs.json index fb399e5080e6f..11d74117c8415 100644 --- a/api_docs/kbn_core_chrome_browser.devdocs.json +++ b/api_docs/kbn_core_chrome_browser.devdocs.json @@ -91,7 +91,13 @@ "description": [], "signature": [ "(element: HTMLDivElement) => ", - "UnmountCallback" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.UnmountCallback", + "text": "UnmountCallback" + } ], "path": "packages/core/chrome/core-chrome-browser/src/breadcrumb.ts", "deprecated": false, @@ -108,7 +114,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false } @@ -187,6 +193,50 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/core-chrome-browser", + "id": "def-common.ChromeGlobalHelpExtensionMenuLink", + "type": "Interface", + "tags": [], + "label": "ChromeGlobalHelpExtensionMenuLink", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeGlobalHelpExtensionMenuLink", + "text": "ChromeGlobalHelpExtensionMenuLink" + }, + " extends ", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeHelpExtensionMenuCustomLink", + "text": "ChromeHelpExtensionMenuCustomLink" + } + ], + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-chrome-browser", + "id": "def-common.ChromeGlobalHelpExtensionMenuLink.priority", + "type": "number", + "tags": [], + "label": "priority", + "description": [ + "\nHighest priority items are listed at the top of the list of links." + ], + "path": "packages/core/chrome/core-chrome-browser/src/help_extension.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/core-chrome-browser", "id": "def-common.ChromeHelpExtension", @@ -639,7 +689,13 @@ "description": [], "signature": [ "(element: HTMLElement) => ", - "UnmountCallback" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.UnmountCallback", + "text": "UnmountCallback" + } ], "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, @@ -656,7 +712,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false } @@ -920,7 +976,13 @@ "\nThe category the app lives in" ], "signature": [ - "AppCategory", + { + "pluginId": "@kbn/core-application-common", + "scope": "common", + "docId": "kibKbnCoreApplicationCommonPluginApi", + "section": "def-common.AppCategory", + "text": "AppCategory" + }, " | undefined" ], "path": "packages/core/chrome/core-chrome-browser/src/nav_links.ts", @@ -1882,6 +1944,82 @@ ], "returnComment": [] }, + { + "parentPluginId": "@kbn/core-chrome-browser", + "id": "def-common.ChromeStart.getGlobalHelpExtensionMenuLinks$", + "type": "Function", + "tags": [], + "label": "getGlobalHelpExtensionMenuLinks$", + "description": [ + "\nGet the list of the registered global help extension menu links" + ], + "signature": [ + "() => ", + "Observable", + "<", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeGlobalHelpExtensionMenuLink", + "text": "ChromeGlobalHelpExtensionMenuLink" + }, + "[]>" + ], + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-chrome-browser", + "id": "def-common.ChromeStart.registerGlobalHelpExtensionMenuLink", + "type": "Function", + "tags": [], + "label": "registerGlobalHelpExtensionMenuLink", + "description": [ + "\nAppend a global help extension menu link" + ], + "signature": [ + "(globalHelpExtensionMenuLink: ", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeGlobalHelpExtensionMenuLink", + "text": "ChromeGlobalHelpExtensionMenuLink" + }, + ") => void" + ], + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-chrome-browser", + "id": "def-common.ChromeStart.registerGlobalHelpExtensionMenuLink.$1", + "type": "Object", + "tags": [], + "label": "globalHelpExtensionMenuLink", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeGlobalHelpExtensionMenuLink", + "text": "ChromeGlobalHelpExtensionMenuLink" + } + ], + "path": "packages/core/chrome/core-chrome-browser/src/contracts.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "@kbn/core-chrome-browser", "id": "def-common.ChromeStart.getHelpExtension$", @@ -1889,7 +2027,7 @@ "tags": [], "label": "getHelpExtension$", "description": [ - "\nGet an observable of the current custom help conttent" + "\nGet an observable of the current custom help content" ], "signature": [ "() => ", @@ -2107,7 +2245,13 @@ "description": [], "signature": [ "(element: HTMLDivElement) => ", - "UnmountCallback" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.UnmountCallback", + "text": "UnmountCallback" + } ], "path": "packages/core/chrome/core-chrome-browser/src/types.ts", "deprecated": false, @@ -2124,7 +2268,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_core_chrome_browser.mdx b/api_docs/kbn_core_chrome_browser.mdx index 7bdf58691ef6a..31ab64e930f93 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser'] --- import kbnCoreChromeBrowserObj from './kbn_core_chrome_browser.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 114 | 0 | 41 | 0 | +| 119 | 0 | 46 | 0 | ## Common diff --git a/api_docs/kbn_core_chrome_browser_mocks.devdocs.json b/api_docs/kbn_core_chrome_browser_mocks.devdocs.json index 7da9613ba0ea2..42c9aacfa3dc9 100644 --- a/api_docs/kbn_core_chrome_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_chrome_browser_mocks.devdocs.json @@ -59,7 +59,13 @@ "description": [], "signature": [ "() => ", - "DeeplyMockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.DeeplyMockedKeys", + "text": "DeeplyMockedKeys" + }, "<", "InternalChromeStart", ">" diff --git a/api_docs/kbn_core_chrome_browser_mocks.mdx b/api_docs/kbn_core_chrome_browser_mocks.mdx index 877e13fd53568..d3b05b783487b 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_config_server_internal.devdocs.json index 79979fc457172..65ff20ef0238d 100644 --- a/api_docs/kbn_core_config_server_internal.devdocs.json +++ b/api_docs/kbn_core_config_server_internal.devdocs.json @@ -20,7 +20,13 @@ "description": [], "signature": [ "() => ", - "ConfigDeprecation", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + }, "[]" ], "path": "packages/core/config/core-config-server-internal/src/deprecation/core_deprecations.ts", diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 2c86c9f09e1c3..0ab7b1168ab36 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: 2022-10-25 +date: 2022-11-07 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_deprecations_browser.devdocs.json b/api_docs/kbn_core_deprecations_browser.devdocs.json index 857c2acbb4e33..4b90c819784f0 100644 --- a/api_docs/kbn_core_deprecations_browser.devdocs.json +++ b/api_docs/kbn_core_deprecations_browser.devdocs.json @@ -44,7 +44,13 @@ ], "signature": [ "() => Promise<", - "DomainDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + }, "[]>" ], "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", @@ -64,7 +70,13 @@ ], "signature": [ "(domainId: string) => Promise<", - "DomainDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + }, "[]>" ], "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", @@ -100,7 +112,13 @@ ], "signature": [ "(details: ", - "DomainDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + }, ") => boolean" ], "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", @@ -115,7 +133,13 @@ "label": "details", "description": [], "signature": [ - "DomainDeprecationDetails" + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + } ], "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", "deprecated": false, @@ -136,7 +160,13 @@ ], "signature": [ "(details: ", - "DomainDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + }, ") => Promise<", { "pluginId": "@kbn/core-deprecations-browser", @@ -159,7 +189,13 @@ "label": "details", "description": [], "signature": [ - "DomainDeprecationDetails" + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + } ], "path": "packages/core/deprecations/core-deprecations-browser/src/contracts.ts", "deprecated": false, diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index 2f6d7e1704309..0082c7aee1a6d 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_deprecations_browser_internal.devdocs.json index 8eac54406790d..57e6318b3165c 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.devdocs.json +++ b/api_docs/kbn_core_deprecations_browser_internal.devdocs.json @@ -36,7 +36,13 @@ " implements ", "CoreService", "" ], "path": "packages/core/deprecations/core-deprecations-browser-internal/src/deprecations_service.ts", @@ -68,9 +74,21 @@ "description": [], "signature": [ "({ http }: { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => ", - "DeprecationsServiceStart" + { + "pluginId": "@kbn/core-deprecations-browser", + "scope": "common", + "docId": "kibKbnCoreDeprecationsBrowserPluginApi", + "section": "def-common.DeprecationsServiceStart", + "text": "DeprecationsServiceStart" + } ], "path": "packages/core/deprecations/core-deprecations-browser-internal/src/deprecations_service.ts", "deprecated": false, @@ -95,7 +113,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "packages/core/deprecations/core-deprecations-browser-internal/src/deprecations_service.ts", "deprecated": false, diff --git a/api_docs/kbn_core_deprecations_browser_internal.mdx b/api_docs/kbn_core_deprecations_browser_internal.mdx index bc13e2aa40d82..a498783d33cea 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_deprecations_browser_mocks.devdocs.json index bf48fad3e7b9e..897d016b3527d 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_deprecations_browser_mocks.devdocs.json @@ -43,9 +43,21 @@ "description": [], "signature": [ "() => jest.Mocked<", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", - "DeprecationsService", + { + "pluginId": "@kbn/core-deprecations-browser-internal", + "scope": "common", + "docId": "kibKbnCoreDeprecationsBrowserInternalPluginApi", + "section": "def-common.DeprecationsService", + "text": "DeprecationsService" + }, ">>" ], "path": "packages/core/deprecations/core-deprecations-browser-mocks/src/deprecations_service.mock.ts", @@ -79,7 +91,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "DeprecationsServiceStart", + { + "pluginId": "@kbn/core-deprecations-browser", + "scope": "common", + "docId": "kibKbnCoreDeprecationsBrowserPluginApi", + "section": "def-common.DeprecationsServiceStart", + "text": "DeprecationsServiceStart" + }, ">" ], "path": "packages/core/deprecations/core-deprecations-browser-mocks/src/deprecations_service.mock.ts", diff --git a/api_docs/kbn_core_deprecations_browser_mocks.mdx b/api_docs/kbn_core_deprecations_browser_mocks.mdx index af385e60f6383..72eca197489d8 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: 2022-10-25 +date: 2022-11-07 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 e4f5aa2ff2696..dcf5985688a67 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_deprecations_server.devdocs.json index 514993fac9207..dbf0a0be1088a 100644 --- a/api_docs/kbn_core_deprecations_server.devdocs.json +++ b/api_docs/kbn_core_deprecations_server.devdocs.json @@ -87,7 +87,13 @@ "description": [], "signature": [ "() => Promise<", - "DomainDeprecationDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DomainDeprecationDetails", + "text": "DomainDeprecationDetails" + }, "[]>" ], "path": "packages/core/deprecations/core-deprecations-server/src/request_handler_context.ts", @@ -216,7 +222,13 @@ "label": "esClient", "description": [], "signature": [ - "IScopedClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + } ], "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, @@ -230,7 +242,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, @@ -267,9 +285,21 @@ "text": "GetDeprecationsContext" }, ") => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "<", - "DeprecationsDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DeprecationsDetails", + "text": "DeprecationsDetails" + }, "[]>" ], "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", diff --git a/api_docs/kbn_core_deprecations_server.mdx b/api_docs/kbn_core_deprecations_server.mdx index 010a4909b6f3e..e303efa93b4b3 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_deprecations_server_internal.devdocs.json index c59b077897a1d..438b29f186d86 100644 --- a/api_docs/kbn_core_deprecations_server_internal.devdocs.json +++ b/api_docs/kbn_core_deprecations_server_internal.devdocs.json @@ -34,11 +34,29 @@ ], "signature": [ "(esClient: ", - "IScopedClusterClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + }, ", savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", - "DeprecationsClient" + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationsClient", + "text": "DeprecationsClient" + } ], "path": "packages/core/deprecations/core-deprecations-server-internal/src/deprecations_service.ts", "deprecated": false, @@ -52,7 +70,13 @@ "label": "esClient", "description": [], "signature": [ - "IScopedClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + } ], "path": "packages/core/deprecations/core-deprecations-server-internal/src/deprecations_service.ts", "deprecated": false, @@ -67,7 +91,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/deprecations/core-deprecations-server-internal/src/deprecations_service.ts", "deprecated": false, diff --git a/api_docs/kbn_core_deprecations_server_internal.mdx b/api_docs/kbn_core_deprecations_server_internal.mdx index 8bb8f8513ff04..e311ee4ebdfbd 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_deprecations_server_mocks.devdocs.json index 464b9f5476a54..69467b4a093d4 100644 --- a/api_docs/kbn_core_deprecations_server_mocks.devdocs.json +++ b/api_docs/kbn_core_deprecations_server_mocks.devdocs.json @@ -51,7 +51,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "DeprecationRegistryProvider", + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationRegistryProvider", + "text": "DeprecationRegistryProvider" + }, ">" ], "path": "packages/core/deprecations/core-deprecations-server-mocks/src/deprecations_service.mock.ts", @@ -69,7 +75,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "DeprecationsServiceSetup", + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationsServiceSetup", + "text": "DeprecationsServiceSetup" + }, ">" ], "path": "packages/core/deprecations/core-deprecations-server-mocks/src/deprecations_service.mock.ts", @@ -87,7 +99,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "InternalDeprecationsServiceStart", + { + "pluginId": "@kbn/core-deprecations-server-internal", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerInternalPluginApi", + "section": "def-server.InternalDeprecationsServiceStart", + "text": "InternalDeprecationsServiceStart" + }, ">" ], "path": "packages/core/deprecations/core-deprecations-server-mocks/src/deprecations_service.mock.ts", @@ -105,7 +123,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "DeprecationsClient", + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationsClient", + "text": "DeprecationsClient" + }, ">" ], "path": "packages/core/deprecations/core-deprecations-server-mocks/src/deprecations_service.mock.ts", diff --git a/api_docs/kbn_core_deprecations_server_mocks.mdx b/api_docs/kbn_core_deprecations_server_mocks.mdx index 6c6bf36cd9759..3777da1f0ef93 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_doc_links_browser.devdocs.json index f8270d3ce9f28..8710e5edbcf19 100644 --- a/api_docs/kbn_core_doc_links_browser.devdocs.json +++ b/api_docs/kbn_core_doc_links_browser.devdocs.json @@ -61,7 +61,13 @@ "label": "links", "description": [], "signature": [ - "DocLinks" + { + "pluginId": "@kbn/doc-links", + "scope": "common", + "docId": "kibKbnDocLinksPluginApi", + "section": "def-common.DocLinks", + "text": "DocLinks" + } ], "path": "packages/core/doc-links/core-doc-links-browser/src/types.ts", "deprecated": false, diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index 56815ba6aecf3..e64d791ed9a2c 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_doc_links_browser_mocks.devdocs.json index 321ece3f9c64b..cb8eebb761298 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_doc_links_browser_mocks.devdocs.json @@ -75,7 +75,13 @@ "description": [], "signature": [ "() => ", - "DocLinksStart" + { + "pluginId": "@kbn/core-doc-links-browser", + "scope": "common", + "docId": "kibKbnCoreDocLinksBrowserPluginApi", + "section": "def-common.DocLinksStart", + "text": "DocLinksStart" + } ], "path": "packages/core/doc-links/core-doc-links-browser-mocks/src/doc_links_service.mock.ts", "deprecated": false, diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index 91d5c6d38c2d0..1abfc77c8e9b8 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_doc_links_server.devdocs.json index d48c2855292a6..c820d0c60c68d 100644 --- a/api_docs/kbn_core_doc_links_server.devdocs.json +++ b/api_docs/kbn_core_doc_links_server.devdocs.json @@ -59,7 +59,13 @@ "A record of all registered doc links" ], "signature": [ - "DocLinks" + { + "pluginId": "@kbn/doc-links", + "scope": "common", + "docId": "kibKbnDocLinksPluginApi", + "section": "def-common.DocLinks", + "text": "DocLinks" + } ], "path": "packages/core/doc-links/core-doc-links-server/src/types.ts", "deprecated": false, diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index 7cdbc1ce23553..9b8e1e1e1afba 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_doc_links_server_mocks.devdocs.json index 1172ff722d041..bd82f1fed2249 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.devdocs.json +++ b/api_docs/kbn_core_doc_links_server_mocks.devdocs.json @@ -51,7 +51,13 @@ "description": [], "signature": [ "() => ", - "DocLinksServiceSetup" + { + "pluginId": "@kbn/core-doc-links-server", + "scope": "server", + "docId": "kibKbnCoreDocLinksServerPluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + } ], "path": "packages/core/doc-links/core-doc-links-server-mocks/src/doc_links_service.mock.ts", "deprecated": false, @@ -68,7 +74,13 @@ "description": [], "signature": [ "() => ", - "DocLinksServiceSetup" + { + "pluginId": "@kbn/core-doc-links-server", + "scope": "server", + "docId": "kibKbnCoreDocLinksServerPluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + } ], "path": "packages/core/doc-links/core-doc-links-server-mocks/src/doc_links_service.mock.ts", "deprecated": false, diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index 0ea7db975e3db..f64ed3f38792a 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_elasticsearch_client_server_internal.devdocs.json index aa5dd46285c2f..66472dd2f1a85 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_internal.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_client_server_internal.devdocs.json @@ -20,9 +20,21 @@ "description": [], "signature": [ "(config: ", - "ElasticsearchClientConfig", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClientConfig", + "text": "ElasticsearchClientConfig" + }, ", { logger, type, scoped, getExecutionContext, agentFactoryProvider, kibanaVersion, }: { logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, "; type: string; scoped?: boolean | undefined; getExecutionContext?: (() => string | undefined) | undefined; agentFactoryProvider: ", "AgentFactoryProvider", "; kibanaVersion: string; }) => ", @@ -40,7 +52,13 @@ "label": "config", "description": [], "signature": [ - "ElasticsearchClientConfig" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClientConfig", + "text": "ElasticsearchClientConfig" + } ], "path": "packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/configure_client.ts", "deprecated": false, @@ -66,7 +84,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/configure_client.ts", "deprecated": false, @@ -241,7 +265,13 @@ "description": [], "signature": [ "() => Set<", - "NetworkAgent", + { + "pluginId": "@kbn/core-elasticsearch-client-server-internal", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerInternalPluginApi", + "section": "def-server.NetworkAgent", + "text": "NetworkAgent" + }, ">" ], "path": "packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/agent_manager.ts", @@ -255,7 +285,25 @@ } ], "enums": [], - "misc": [], + "misc": [ + { + "parentPluginId": "@kbn/core-elasticsearch-client-server-internal", + "id": "def-server.NetworkAgent", + "type": "Type", + "tags": [], + "label": "NetworkAgent", + "description": [], + "signature": [ + "Agent", + " | ", + "Agent" + ], + "path": "packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/agent_manager.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], "objects": [] }, "common": { diff --git a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx index 0499573b55bff..4b397bf396785 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 15 | 0 | 13 | 2 | +| 16 | 0 | 14 | 1 | ## Server @@ -31,3 +31,6 @@ Contact Kibana Core for questions regarding this plugin. ### Interfaces +### Consts, variables and types + + diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json b/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json index 570636f16f3a8..f90b564cccdfe 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json @@ -20,9 +20,21 @@ "description": [], "signature": [ "(agents?: Set<", - "NetworkAgent", + { + "pluginId": "@kbn/core-elasticsearch-client-server-internal", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerInternalPluginApi", + "section": "def-server.NetworkAgent", + "text": "NetworkAgent" + }, ">) => ", - "AgentStore" + { + "pluginId": "@kbn/core-elasticsearch-client-server-internal", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerInternalPluginApi", + "section": "def-server.AgentStore", + "text": "AgentStore" + } ], "path": "packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/agent_manager.mocks.ts", "deprecated": false, @@ -37,7 +49,13 @@ "description": [], "signature": [ "Set<", - "NetworkAgent", + { + "pluginId": "@kbn/core-elasticsearch-client-server-internal", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerInternalPluginApi", + "section": "def-server.NetworkAgent", + "text": "NetworkAgent" + }, ">" ], "path": "packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/agent_manager.mocks.ts", @@ -1317,7 +1335,13 @@ "<", "default", ">; } & ", - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/mocks.ts", "deprecated": false, @@ -2418,7 +2442,13 @@ "<", "default", ">; } & ", - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/mocks.ts", "deprecated": false, @@ -3473,7 +3503,13 @@ "<", "default", ">; } & ", - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/mocks.ts", "deprecated": false, @@ -3494,13 +3530,37 @@ "description": [], "signature": [ "{ close: jest.MockInstance, []>; readonly asInternalUser: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, "; asScoped: jest.MockInstance<", - "IScopedClusterClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + }, ", [request: ", - "ScopeableRequest", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ScopeableRequest", + "text": "ScopeableRequest" + }, "]>; } & ", - "ICustomClusterClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ICustomClusterClient", + "text": "ICustomClusterClient" + }, " & ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -4595,7 +4655,13 @@ "<", "default", ">; } & ", - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/mocks.ts", "deprecated": false, diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index cadb71fe47454..e62a7127b25f4 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.devdocs.json b/api_docs/kbn_core_elasticsearch_server.devdocs.json index 3644958164e4d..f390e83c1cbe0 100644 --- a/api_docs/kbn_core_elasticsearch_server.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_server.devdocs.json @@ -641,7 +641,28 @@ "path": "packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts", "deprecated": true, "trackAdoption": false, - "references": [] + "references": [ + { + "plugin": "@kbn/core-elasticsearch-server-internal", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" + }, + { + "plugin": "console", + "path": "src/plugins/console/server/plugin.ts" + }, + { + "plugin": "@kbn/core-elasticsearch-server-internal", + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts" + } + ] } ], "initialIsOpen": false @@ -5010,7 +5031,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts", @@ -6405,7 +6432,13 @@ "\n A user credentials container.\nIt accommodates the necessary auth credentials to impersonate the current user.\n" ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, " | ", { "pluginId": "@kbn/core-elasticsearch-server", @@ -6447,7 +6480,13 @@ "text": "UnauthorizedErrorHandlerToolkit" }, ") => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "<", { "pluginId": "@kbn/core-elasticsearch-server", diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index ac7303c668aa2..978a44cd568ac 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json b/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json index 476751b714f15..1c02a6fb26dad 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json @@ -20,7 +20,13 @@ "description": [], "signature": [ "({ client, }: { client: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, "; }) => Promise" ], "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_scripting_enabled.ts", @@ -1405,6 +1411,55 @@ } ], "interfaces": [ + { + "parentPluginId": "@kbn/core-elasticsearch-server-internal", + "id": "def-server.ClusterInfo", + "type": "Interface", + "tags": [ + "private" + ], + "label": "ClusterInfo", + "description": [], + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/get_cluster_info.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-elasticsearch-server-internal", + "id": "def-server.ClusterInfo.cluster_name", + "type": "string", + "tags": [], + "label": "cluster_name", + "description": [], + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/get_cluster_info.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-elasticsearch-server-internal", + "id": "def-server.ClusterInfo.cluster_uuid", + "type": "string", + "tags": [], + "label": "cluster_uuid", + "description": [], + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/get_cluster_info.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-elasticsearch-server-internal", + "id": "def-server.ClusterInfo.cluster_version", + "type": "string", + "tags": [], + "label": "cluster_version", + "description": [], + "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/get_cluster_info.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/core-elasticsearch-server-internal", "id": "def-server.NodeInfo", @@ -2827,7 +2882,13 @@ "label": "log", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts", "deprecated": false, @@ -2899,77 +2960,293 @@ "\nValidation schema for elasticsearch service config. It can be reused when plugins allow users\nto specify a local elasticsearch config." ], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ sniffOnStart: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; sniffInterval: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; sniffOnConnectionFault: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; hosts: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; maxSockets: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; maxIdleSockets: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; idleSocketTimeout: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; compression: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; username: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; password: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; serviceAccountToken: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; requestHeadersWhitelist: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; customHeaders: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, ">; shardTimeout: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; requestTimeout: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; pingTimeout: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; logQueries: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; ssl: ", - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ verificationMode: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "<\"none\" | \"full\" | \"certificate\">; certificateAuthorities: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; certificate: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; key: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; keyPassphrase: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; keystore: ", - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ path: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; password: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>; truststore: ", - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ path: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; password: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>; alwaysPresentCertificate: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>; apiVersion: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; healthCheck: ", - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ delay: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>; ignoreVersionMismatch: ", - "ConditionalType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ConditionalType", + "text": "ConditionalType" + }, "; skipStartupConnectionCheck: ", - "ConditionalType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ConditionalType", + "text": "ConditionalType" + }, "; }>" ], "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_config.ts", diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index e4a016ceef1ea..51cb9c19b4105 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-internal'] --- import kbnCoreElasticsearchServerInternalObj from './kbn_core_elasticsearch_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 33 | 0 | 29 | 0 | +| 37 | 0 | 33 | 3 | ## Server diff --git a/api_docs/kbn_core_elasticsearch_server_mocks.devdocs.json b/api_docs/kbn_core_elasticsearch_server_mocks.devdocs.json index 9ac1cdcb19f0f..61f670f9761de 100644 --- a/api_docs/kbn_core_elasticsearch_server_mocks.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_server_mocks.devdocs.json @@ -31,7 +31,13 @@ "label": "client", "description": [], "signature": [ - "ClusterClientMock" + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.ClusterClientMock", + "text": "ClusterClientMock" + } ], "path": "packages/core/elasticsearch/core-elasticsearch-server-mocks/src/elasticsearch_service.mock.ts", "deprecated": false, @@ -46,13 +52,37 @@ "description": [], "signature": [ "jest.MockInstance<", - "CustomClusterClientMock", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.CustomClusterClientMock", + "text": "CustomClusterClientMock" + }, ", [type: string, config?: Partial<", - "ElasticsearchClientConfig", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClientConfig", + "text": "ElasticsearchClientConfig" + }, "> | undefined]> & ((type: string, config?: Partial<", - "ElasticsearchClientConfig", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClientConfig", + "text": "ElasticsearchClientConfig" + }, "> | undefined) => ", - "CustomClusterClientMock", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.CustomClusterClientMock", + "text": "CustomClusterClientMock" + }, ")" ], "path": "packages/core/elasticsearch/core-elasticsearch-server-mocks/src/elasticsearch_service.mock.ts", @@ -80,7 +110,13 @@ "description": [], "signature": [ "Partial<", - "ElasticsearchClientConfig", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClientConfig", + "text": "ElasticsearchClientConfig" + }, "> | undefined" ], "path": "packages/core/elasticsearch/core-elasticsearch-server-mocks/src/elasticsearch_service.mock.ts", @@ -104,9 +140,21 @@ "description": [], "signature": [ "{ setUnauthorizedErrorHandler: jest.MockInstance; } & Omit<", - "ElasticsearchServiceSetup", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchServiceSetup", + "text": "ElasticsearchServiceSetup" + }, ", \"legacy\"> & { legacy: { config$: ", "BehaviorSubject", "<", diff --git a/api_docs/kbn_core_elasticsearch_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_server_mocks.mdx index f52013e2a7f4b..40d4f72feeec6 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_environment_server_internal.devdocs.json index bd313a9c15630..f9601c5c6904c 100644 --- a/api_docs/kbn_core_environment_server_internal.devdocs.json +++ b/api_docs/kbn_core_environment_server_internal.devdocs.json @@ -61,11 +61,29 @@ "label": "schema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ file: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; exclusive: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>" ], "path": "packages/core/environment/core-environment-server-internal/src/pid_config.ts", diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index c34f1f7f0f848..3c012d27a739b 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] --- import kbnCoreEnvironmentServerInternalObj from './kbn_core_environment_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 4 | 0 | 4 | 0 | +| 4 | 0 | 4 | 1 | ## Server diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index 9672d657864ec..3a2249258eabb 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_execution_context_browser.devdocs.json index 46b9544979b59..99b7ade70d8e4 100644 --- a/api_docs/kbn_core_execution_context_browser.devdocs.json +++ b/api_docs/kbn_core_execution_context_browser.devdocs.json @@ -45,7 +45,13 @@ "signature": [ "Observable", "<", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, ">" ], "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", @@ -63,7 +69,13 @@ ], "signature": [ "(c$: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, ") => void" ], "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", @@ -78,7 +90,13 @@ "label": "c$", "description": [], "signature": [ - "KibanaExecutionContext" + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + } ], "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, @@ -99,7 +117,13 @@ ], "signature": [ "() => ", - "KibanaExecutionContext" + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + } ], "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, @@ -155,9 +179,21 @@ ], "signature": [ "(context?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined) => ", - "KibanaExecutionContext" + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + } ], "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", "deprecated": false, @@ -171,7 +207,13 @@ "label": "context", "description": [], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "packages/core/execution-context/core-execution-context-browser/src/types.ts", diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index ef680a3f3045c..7c35dee2006a8 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_execution_context_browser_internal.devdocs.json index d0c12ae15f804..2c9ffd14622cb 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.devdocs.json +++ b/api_docs/kbn_core_execution_context_browser_internal.devdocs.json @@ -49,7 +49,13 @@ "description": [], "signature": [ "{ readonly type?: string | undefined; readonly name?: string | undefined; readonly page?: string | undefined; readonly id?: string | undefined; readonly description?: string | undefined; readonly url?: string | undefined; readonly meta?: { [key: string]: string | number | boolean | undefined; } | undefined; readonly child?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined; }" ], "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_container.ts", @@ -79,7 +85,13 @@ "description": [], "signature": [ "Readonly<", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, ">" ], "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_container.ts", @@ -115,7 +127,13 @@ "description": [], "signature": [ "() => Readonly<", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, ">" ], "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_container.ts", diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index de9e9493bdd22..964f788017165 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] --- import kbnCoreExecutionContextBrowserInternalObj from './kbn_core_execution_context_browser_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 6 | 0 | 6 | 1 | +| 6 | 0 | 6 | 2 | ## Common diff --git a/api_docs/kbn_core_execution_context_browser_mocks.devdocs.json b/api_docs/kbn_core_execution_context_browser_mocks.devdocs.json index 814bebffd8678..97296da62f1cd 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_execution_context_browser_mocks.devdocs.json @@ -43,7 +43,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", "ExecutionContextService", ">>" @@ -63,7 +69,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, ">" ], "path": "packages/core/execution-context/core-execution-context-browser-mocks/src/execution_context_service.mock.ts", @@ -81,7 +93,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, ">" ], "path": "packages/core/execution-context/core-execution-context-browser-mocks/src/execution_context_service.mock.ts", @@ -99,7 +117,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, ">" ], "path": "packages/core/execution-context/core-execution-context-browser-mocks/src/execution_context_service.mock.ts", @@ -117,7 +141,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, ">" ], "path": "packages/core/execution-context/core-execution-context-browser-mocks/src/execution_context_service.mock.ts", diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index 9cf3bcaa439e2..0c1005d888c44 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: 2022-10-25 +date: 2022-11-07 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 959c562c02eb1..d9f95859abbd9 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_execution_context_server.devdocs.json index c4c6bf5de2603..07ce068738ebf 100644 --- a/api_docs/kbn_core_execution_context_server.devdocs.json +++ b/api_docs/kbn_core_execution_context_server.devdocs.json @@ -34,7 +34,13 @@ ], "signature": [ "(context: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined, fn: (...args: any[]) => R) => R" ], "path": "packages/core/execution-context/core-execution-context-server/src/contracts.ts", @@ -49,7 +55,13 @@ "label": "context", "description": [], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "packages/core/execution-context/core-execution-context-server/src/contracts.ts", @@ -131,7 +143,13 @@ "description": [], "signature": [ "() => Readonly<", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, ">" ], "path": "packages/core/execution-context/core-execution-context-server/src/types.ts", diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index b99b2027b46b6..2fc810d446f94 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_execution_context_server_internal.devdocs.json index e63a3cff21fc7..a673d3df13e53 100644 --- a/api_docs/kbn_core_execution_context_server_internal.devdocs.json +++ b/api_docs/kbn_core_execution_context_server_internal.devdocs.json @@ -158,9 +158,21 @@ "label": "schema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ enabled: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>" ], "path": "packages/core/execution-context/core-execution-context-server-internal/src/execution_context_config.ts", diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index 72c5ecd82b4d7..8d57b58561098 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_execution_context_server_mocks.devdocs.json index c3ec9e75b044d..14140199a25e0 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.devdocs.json +++ b/api_docs/kbn_core_execution_context_server_mocks.devdocs.json @@ -71,7 +71,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-server", + "scope": "server", + "docId": "kibKbnCoreExecutionContextServerPluginApi", + "section": "def-server.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, ">" ], "path": "packages/core/execution-context/core-execution-context-server-mocks/src/execution_context_service.mock.ts", @@ -89,7 +95,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-server", + "scope": "server", + "docId": "kibKbnCoreExecutionContextServerPluginApi", + "section": "def-server.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, ">" ], "path": "packages/core/execution-context/core-execution-context-server-mocks/src/execution_context_service.mock.ts", diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index ea82ee20975a2..3dc7f7a5e6e69 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: 2022-10-25 +date: 2022-11-07 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 58c5359e1032e..2c113828295f0 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_fatal_errors_browser_mocks.devdocs.json index 0ec842a04eb15..671d22018f6e4 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.devdocs.json @@ -59,7 +59,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "FatalErrorsSetup", + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + }, ">" ], "path": "packages/core/fatal-errors/core-fatal-errors-browser-mocks/src/fatal_errors_service.mock.ts", @@ -77,7 +83,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "FatalErrorsSetup", + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + }, ">" ], "path": "packages/core/fatal-errors/core-fatal-errors-browser-mocks/src/fatal_errors_service.mock.ts", diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index fd247bbeded0a..ebad23a3fd37d 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] --- import kbnCoreFatalErrorsBrowserMocksObj from './kbn_core_fatal_errors_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser.devdocs.json b/api_docs/kbn_core_http_browser.devdocs.json index de4c55002551d..7e3c52f8f463f 100644 --- a/api_docs/kbn_core_http_browser.devdocs.json +++ b/api_docs/kbn_core_http_browser.devdocs.json @@ -201,7 +201,13 @@ "label": "context", "description": [], "signature": [ - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "packages/core/http/core-http-browser/src/types.ts", @@ -427,7 +433,13 @@ "text": "IHttpInterceptController" }, ") => void | ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, " void | ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, " void | ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "<", { "pluginId": "@kbn/core-http-browser", @@ -701,7 +725,13 @@ "text": "IHttpInterceptController" }, ") => void | ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "<", { "pluginId": "@kbn/core-http-browser", @@ -804,7 +834,13 @@ "text": "HttpHeadersInit" }, " | undefined; readonly asSystemRequest?: boolean | undefined; readonly asResponse?: boolean | undefined; readonly context?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined; readonly body?: BodyInit | null | undefined; readonly cache?: RequestCache | undefined; readonly credentials?: RequestCredentials | undefined; readonly integrity?: string | undefined; readonly keepalive?: boolean | undefined; readonly method?: string | undefined; readonly mode?: RequestMode | undefined; readonly redirect?: RequestRedirect | undefined; readonly referrer?: string | undefined; readonly referrerPolicy?: ReferrerPolicy | undefined; readonly signal?: AbortSignal | null | undefined; readonly window?: null | undefined; }" ], "path": "packages/core/http/core-http-browser/src/types.ts", @@ -1175,7 +1211,13 @@ "text": "HttpHeadersInit" }, " | undefined; readonly asSystemRequest?: boolean | undefined; readonly asResponse?: boolean | undefined; readonly context?: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined; readonly body?: BodyInit | null | undefined; readonly cache?: RequestCache | undefined; readonly credentials?: RequestCredentials | undefined; readonly integrity?: string | undefined; readonly keepalive?: boolean | undefined; readonly method?: string | undefined; readonly mode?: RequestMode | undefined; readonly redirect?: RequestRedirect | undefined; readonly referrer?: string | undefined; readonly referrerPolicy?: ReferrerPolicy | undefined; readonly signal?: AbortSignal | null | undefined; readonly window?: null | undefined; }" ], "path": "packages/core/http/core-http-browser/src/types.ts", @@ -1973,7 +2015,24 @@ "deprecated": true, "removeBy": "8.8.0\n\nNote to maintainers: when looking at usages, mind that typical use could be inside a `catch` block,\nso TS and code-reference navigation might not highlight them.", "trackAdoption": false, - "references": [] + "references": [ + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/util/errors/errors.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/util/errors/errors.test.ts" + }, + { + "plugin": "@kbn/core-http-browser-internal", + "path": "packages/core/http/core-http-browser-internal/src/http_fetch_error.ts" + }, + { + "plugin": "@kbn/core-http-browser-internal", + "path": "packages/core/http/core-http-browser-internal/src/http_fetch_error.ts" + } + ] }, { "parentPluginId": "@kbn/core-http-browser", @@ -1991,7 +2050,16 @@ "deprecated": true, "removeBy": "8.8.0\n\nNote to maintainers: when looking at usages, mind that typical use could be inside a `catch` block,\nso TS and code-reference navigation might not highlight them.", "trackAdoption": false, - "references": [] + "references": [ + { + "plugin": "@kbn/core-http-browser-internal", + "path": "packages/core/http/core-http-browser-internal/src/http_fetch_error.ts" + }, + { + "plugin": "@kbn/core-http-browser-internal", + "path": "packages/core/http/core-http-browser-internal/src/http_fetch_error.ts" + } + ] }, { "parentPluginId": "@kbn/core-http-browser", diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index f05fb90e3797d..aadf4e77d64ba 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_http_browser_internal.devdocs.json index cc07977158fa0..1bc1f355c68f9 100644 --- a/api_docs/kbn_core_http_browser_internal.devdocs.json +++ b/api_docs/kbn_core_http_browser_internal.devdocs.json @@ -34,7 +34,13 @@ "text": "BasePath" }, " implements ", - "IBasePath" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IBasePath", + "text": "IBasePath" + } ], "path": "packages/core/http/core-http-browser-internal/src/base_path.ts", "deprecated": false, diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index 36e0fa773c3f8..0dc53605ffe7a 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] --- import kbnCoreHttpBrowserInternalObj from './kbn_core_http_browser_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 10 | 0 | 10 | 0 | +| 10 | 0 | 10 | 1 | ## Common diff --git a/api_docs/kbn_core_http_browser_mocks.devdocs.json b/api_docs/kbn_core_http_browser_mocks.devdocs.json index 0bd3fb7f7197f..0dd35b3a0b406 100644 --- a/api_docs/kbn_core_http_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_http_browser_mocks.devdocs.json @@ -28,7 +28,13 @@ "description": [], "signature": [ "(message: string, name: string, request: Request, response: Response | undefined, body: TResponseBody | undefined) => ", - "IHttpFetchError", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpFetchError", + "text": "IHttpFetchError" + }, "" ], "path": "packages/core/http/core-http-browser-mocks/src/fetch_error.mock.ts", @@ -127,39 +133,129 @@ "description": [], "signature": [ "{ basePath: ", - "IBasePath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IBasePath", + "text": "IBasePath" + }, "; anonymousPaths: ", - "IAnonymousPaths", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IAnonymousPaths", + "text": "IAnonymousPaths" + }, "; externalUrl: ", - "IExternalUrl", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IExternalUrl", + "text": "IExternalUrl" + }, "; intercept: jest.MockInstance<() => void, [interceptor: ", - "HttpInterceptor", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpInterceptor", + "text": "HttpInterceptor" + }, "]>; fetch: jest.MockInstance, [options: ", - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, "]>; delete: jest.MockInstance, [options: ", - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, "]>; get: jest.MockInstance, [options: ", - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, "]>; head: jest.MockInstance, [options: ", - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, "]>; options: jest.MockInstance, [options: ", - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, "]>; patch: jest.MockInstance, [options: ", - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, "]>; post: jest.MockInstance, [options: ", - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, "]>; put: jest.MockInstance, [options: ", - "HttpFetchOptionsWithPath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpFetchOptionsWithPath", + "text": "HttpFetchOptionsWithPath" + }, "]>; addLoadingCountSource: jest.MockInstance]>; getLoadingCount$: jest.MockInstance<", "Observable", ", []>; } & ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, " & { basePath: ", - "BasePath", + { + "pluginId": "@kbn/core-http-browser-internal", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserInternalPluginApi", + "section": "def-common.BasePath", + "text": "BasePath" + }, "; anonymousPaths: jest.Mocked<", - "IAnonymousPaths", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IAnonymousPaths", + "text": "IAnonymousPaths" + }, ">; }" ], "path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts", @@ -189,7 +285,13 @@ "description": [], "signature": [ "({ basePath }?: { basePath?: string | undefined; }) => jest.Mocked<", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", "HttpService", ">>" @@ -300,7 +402,13 @@ "description": [], "signature": [ "({ publicBaseUrl, serverBasePath, }?: { publicBaseUrl?: string | undefined; serverBasePath?: string | undefined; }) => jest.Mocked<", - "IBasePath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IBasePath", + "text": "IBasePath" + }, ">" ], "path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts", diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index 04a41071e68a1..9e04e2b04ba4f 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: 2022-10-25 +date: 2022-11-07 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 b64dfba67a50b..9e61440b0c271 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_http_context_server_mocks.devdocs.json index 94f515060dfb9..1c09edc8d986e 100644 --- a/api_docs/kbn_core_http_context_server_mocks.devdocs.json +++ b/api_docs/kbn_core_http_context_server_mocks.devdocs.json @@ -23,25 +23,85 @@ "description": [], "signature": [ "{ registerContext: jest.MockInstance<", - "IContextContainer", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IContextContainer", + "text": "IContextContainer" + }, ", [pluginOpaqueId: symbol, contextName: \"resolve\", provider: ", - "IContextProvider", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IContextProvider", + "text": "IContextProvider" + }, "<", - "RequestHandlerContextBase", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandlerContextBase", + "text": "RequestHandlerContextBase" + }, ", \"resolve\">]>; createHandler: jest.MockInstance<(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ") => Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">, [pluginOpaqueId: symbol, handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, "]>; } & ", - "IContextContainer" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IContextContainer", + "text": "IContextContainer" + } ], "path": "packages/core/http/core-http-context-server-mocks/src/context_container.mock.ts", "deprecated": false, diff --git a/api_docs/kbn_core_http_context_server_mocks.mdx b/api_docs/kbn_core_http_context_server_mocks.mdx index 5c149b02fd618..4bdcb1fe68bb8 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_http_request_handler_context_server.devdocs.json index ebf6567c0a8b4..bc823ae2e23be 100644 --- a/api_docs/kbn_core_http_request_handler_context_server.devdocs.json +++ b/api_docs/kbn_core_http_request_handler_context_server.devdocs.json @@ -33,7 +33,13 @@ "label": "savedObjects", "description": [], "signature": [ - "SavedObjectsRequestHandlerContext" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRequestHandlerContext", + "text": "SavedObjectsRequestHandlerContext" + } ], "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, @@ -47,7 +53,13 @@ "label": "elasticsearch", "description": [], "signature": [ - "ElasticsearchRequestHandlerContext" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchRequestHandlerContext", + "text": "ElasticsearchRequestHandlerContext" + } ], "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, @@ -61,7 +73,13 @@ "label": "uiSettings", "description": [], "signature": [ - "UiSettingsRequestHandlerContext" + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.UiSettingsRequestHandlerContext", + "text": "UiSettingsRequestHandlerContext" + } ], "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, @@ -75,7 +93,13 @@ "label": "deprecations", "description": [], "signature": [ - "DeprecationsRequestHandlerContext" + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationsRequestHandlerContext", + "text": "DeprecationsRequestHandlerContext" + } ], "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, @@ -134,7 +158,13 @@ "text": "PrebootRequestHandlerContext" }, " extends ", - "RequestHandlerContextBase" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandlerContextBase", + "text": "RequestHandlerContextBase" + } ], "path": "packages/core/http/core-http-request-handler-context-server/src/preboot_request_handler_context.ts", "deprecated": false, @@ -184,7 +214,13 @@ "label": "client", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "packages/core/http/core-http-request-handler-context-server/src/preboot_request_handler_context.ts", "deprecated": false, @@ -211,7 +247,13 @@ "text": "RequestHandlerContext" }, " extends ", - "RequestHandlerContextBase" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandlerContextBase", + "text": "RequestHandlerContextBase" + } ], "path": "packages/core/http/core-http-request-handler-context-server/src/request_handler_context.ts", "deprecated": false, 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 cff4933ab544e..af5734cf254de 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_http_resources_server.devdocs.json index bc5b87b070efc..7e6561fb56e57 100644 --- a/api_docs/kbn_core_http_resources_server.devdocs.json +++ b/api_docs/kbn_core_http_resources_server.devdocs.json @@ -36,11 +36,29 @@ ], "signature": [ "(route: ", - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, ", handler: ", { "pluginId": "@kbn/core-http-resources-server", @@ -63,7 +81,13 @@ "label": "route", "description": [], "signature": [ - "RouteConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfig", + "text": "RouteConfig" + }, "" ], "path": "packages/core/http/core-http-resources-server/src/types.ts", @@ -122,7 +146,13 @@ "\nHTTP Headers with additional information about response." ], "signature": [ - "ResponseHeaders", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseHeaders", + "text": "ResponseHeaders" + }, " | undefined" ], "path": "packages/core/http/core-http-resources-server/src/types.ts", @@ -164,7 +194,13 @@ "text": "HttpResourcesRenderOptions" }, " | undefined) => Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], "path": "packages/core/http/core-http-resources-server/src/types.ts", @@ -215,7 +251,13 @@ "text": "HttpResourcesRenderOptions" }, " | undefined) => Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], "path": "packages/core/http/core-http-resources-server/src/types.ts", @@ -258,9 +300,21 @@ ], "signature": [ "(options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "" ], "path": "packages/core/http/core-http-resources-server/src/types.ts", @@ -275,7 +329,13 @@ "label": "options", "description": [], "signature": [ - "HttpResponseOptions" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + } ], "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, @@ -296,9 +356,21 @@ ], "signature": [ "(options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "" ], "path": "packages/core/http/core-http-resources-server/src/types.ts", @@ -313,7 +385,13 @@ "label": "options", "description": [], "signature": [ - "HttpResponseOptions" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + } ], "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, @@ -334,9 +412,21 @@ ], "signature": [ "(options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "" ], "path": "packages/core/http/core-http-resources-server/src/types.ts", @@ -351,7 +441,13 @@ "label": "options", "description": [], "signature": [ - "HttpResponseOptions" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + } ], "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, @@ -378,21 +474,63 @@ ], "signature": [ "(context: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaSuccessResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaSuccessResponseFactory", + "text": "KibanaSuccessResponseFactory" + }, " & ", - "KibanaRedirectionResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRedirectionResponseFactory", + "text": "KibanaRedirectionResponseFactory" + }, " & ", - "KibanaErrorResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaErrorResponseFactory", + "text": "KibanaErrorResponseFactory" + }, " & { custom | Error | ", "Stream", " | Buffer | { message: string | Error; attributes?: ", - "ResponseErrorAttributes", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, " | undefined; } | undefined>(options: ", - "CustomHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, "): ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "; } & ", { "pluginId": "@kbn/core-http-resources-server", @@ -402,9 +540,21 @@ "text": "HttpResourcesServiceToolkit" }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], "path": "packages/core/http/core-http-resources-server/src/types.ts", @@ -424,7 +574,7 @@ "signature": [ "Context" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -438,10 +588,16 @@ "{@link KibanaRequest } - object containing information about requested resource,\nsuch as path, method, headers, parameters, query, body, etc." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false }, @@ -457,7 +613,7 @@ "signature": [ "ResponseFactory" ], - "path": "node_modules/@types/kbn__core-http-server/index.d.ts", + "path": "packages/core/http/core-http-server/src/router/request_handler.ts", "deprecated": false, "trackAdoption": false } @@ -474,7 +630,13 @@ "\nHTTP Resources response parameters" ], "signature": [ - "HttpResponseOptions" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + } ], "path": "packages/core/http/core-http-resources-server/src/types.ts", "deprecated": false, diff --git a/api_docs/kbn_core_http_resources_server.mdx b/api_docs/kbn_core_http_resources_server.mdx index 311adf9c79872..cc507994591b7 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_http_resources_server_internal.devdocs.json index fae7163d58b82..4fe3811d674d6 100644 --- a/api_docs/kbn_core_http_resources_server_internal.devdocs.json +++ b/api_docs/kbn_core_http_resources_server_internal.devdocs.json @@ -78,11 +78,29 @@ "(deps: ", "PrebootDeps", ") => { createRegistrar: (router: ", - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, "<", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ">) => ", - "HttpResources", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResources", + "text": "HttpResources" + }, "; }" ], "path": "packages/core/http/core-http-resources-server-internal/src/http_resources_service.ts", @@ -118,11 +136,29 @@ "(deps: ", "SetupDeps", ") => { createRegistrar: (router: ", - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, "<", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ">) => ", - "HttpResources", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResources", + "text": "HttpResources" + }, "; }" ], "path": "packages/core/http/core-http-resources-server-internal/src/http_resources_service.ts", diff --git a/api_docs/kbn_core_http_resources_server_internal.mdx b/api_docs/kbn_core_http_resources_server_internal.mdx index 737fc39ad50ac..85ab872e84ded 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_http_resources_server_mocks.devdocs.json index edc6ab2842489..4c38ef17466c9 100644 --- a/api_docs/kbn_core_http_resources_server_mocks.devdocs.json +++ b/api_docs/kbn_core_http_resources_server_mocks.devdocs.json @@ -23,25 +23,73 @@ "description": [], "signature": [ "{ setup: jest.MockInstance<{ createRegistrar: (router: ", - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, "<", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ">) => ", - "HttpResources", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResources", + "text": "HttpResources" + }, "; }, [deps: ", "SetupDeps", "]>; start: jest.MockInstance; stop: jest.MockInstance; preboot: jest.MockInstance<{ createRegistrar: (router: ", - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, "<", - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, ">) => ", - "HttpResources", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResources", + "text": "HttpResources" + }, "; }, [deps: ", "PrebootDeps", "]>; } & ", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", - "HttpResourcesService", + { + "pluginId": "@kbn/core-http-resources-server-internal", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerInternalPluginApi", + "section": "def-server.HttpResourcesService", + "text": "HttpResourcesService" + }, ">" ], "path": "packages/core/http/core-http-resources-server-mocks/src/http_resources_server.mock.ts", @@ -94,7 +142,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "HttpResources", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResources", + "text": "HttpResources" + }, ">" ], "path": "packages/core/http/core-http-resources-server-mocks/src/http_resources_server.mock.ts", @@ -112,7 +166,13 @@ "description": [], "signature": [ "() => { createRegistrar: jest.Mock, []>; }" ], "path": "packages/core/http/core-http-resources-server-mocks/src/http_resources_server.mock.ts", @@ -130,7 +190,13 @@ "description": [], "signature": [ "() => { createRegistrar: jest.Mock, []>; }" ], "path": "packages/core/http/core-http-resources-server-mocks/src/http_resources_server.mock.ts", @@ -148,149 +214,557 @@ "description": [], "signature": [ "() => { renderCoreApp: jest.MockInstance>, [options?: ", - "HttpResourcesRenderOptions", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesRenderOptions", + "text": "HttpResourcesRenderOptions" + }, " | undefined]> & ((options?: ", - "HttpResourcesRenderOptions", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesRenderOptions", + "text": "HttpResourcesRenderOptions" + }, " | undefined) => Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">); renderAnonymousCoreApp: jest.MockInstance>, [options?: ", - "HttpResourcesRenderOptions", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesRenderOptions", + "text": "HttpResourcesRenderOptions" + }, " | undefined]> & ((options?: ", - "HttpResourcesRenderOptions", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResourcesRenderOptions", + "text": "HttpResourcesRenderOptions" + }, " | undefined) => Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">); renderHtml: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, "]> & ((options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); renderJs: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, "]> & ((options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); renderCss: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, "]> & ((options: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); ok: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options?: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, " | undefined]> & ((options?: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, " | undefined) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); accepted: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options?: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, " | undefined]> & ((options?: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, " | undefined) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); noContent: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options?: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, " | undefined]> & ((options?: ", - "HttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, " | undefined) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); redirected: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options: ", - "RedirectResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RedirectResponseOptions", + "text": "RedirectResponseOptions" + }, "]> & ((options: ", - "RedirectResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RedirectResponseOptions", + "text": "RedirectResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); badRequest: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options?: ", - "ErrorHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, " | undefined]> & ((options?: ", - "ErrorHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, " | undefined) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); unauthorized: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options?: ", - "ErrorHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, " | undefined]> & ((options?: ", - "ErrorHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, " | undefined) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); forbidden: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options?: ", - "ErrorHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, " | undefined]> & ((options?: ", - "ErrorHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, " | undefined) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); notFound: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options?: ", - "ErrorHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, " | undefined]> & ((options?: ", - "ErrorHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, " | undefined) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); conflict: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options?: ", - "ErrorHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, " | undefined]> & ((options?: ", - "ErrorHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, " | undefined) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); customError: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options: ", - "CustomHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, "<", "Stream", " | Buffer | ", - "ResponseError", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseError", + "text": "ResponseError" + }, ">]> & ((options: ", - "CustomHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, "<", "Stream", " | Buffer | ", - "ResponseError", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseError", + "text": "ResponseError" + }, ">) => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); custom: jest.MockInstance<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ", [options: ", - "CustomHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, " | Error | ", "Stream", " | Buffer | { message: string | Error; attributes?: ", - "ResponseErrorAttributes", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, " | undefined; } | undefined>]> & ( | Error | ", "Stream", " | Buffer | { message: string | Error; attributes?: ", - "ResponseErrorAttributes", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, " | undefined; } | undefined>(options: ", - "CustomHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "); }" ], "path": "packages/core/http/core-http-resources-server-mocks/src/http_resources_server.mock.ts", diff --git a/api_docs/kbn_core_http_resources_server_mocks.mdx b/api_docs/kbn_core_http_resources_server_mocks.mdx index 62dc0ab9ab148..7cb0397fef0af 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_http_router_server_internal.devdocs.json index 4ff063af1f90d..c8660a33d0e99 100644 --- a/api_docs/kbn_core_http_router_server_internal.devdocs.json +++ b/api_docs/kbn_core_http_router_server_internal.devdocs.json @@ -157,9 +157,21 @@ "description": [], "signature": [ "(headers: ", - "Headers", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.Headers", + "text": "Headers" + }, ", fieldsToKeep: string[], fieldsToExclude: string[]) => ", - "Headers" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.Headers", + "text": "Headers" + } ], "path": "packages/core/http/core-http-router-server-internal/src/headers.ts", "deprecated": false, @@ -173,7 +185,13 @@ "label": "headers", "description": [], "signature": [ - "Headers" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.Headers", + "text": "Headers" + } ], "path": "packages/core/http/core-http-router-server-internal/src/headers.ts", "deprecated": false, @@ -256,7 +274,13 @@ "description": [], "signature": [ "(method: ", - "RouteMethod", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteMethod", + "text": "RouteMethod" + }, ") => boolean" ], "path": "packages/core/http/core-http-router-server-internal/src/route.ts", @@ -271,7 +295,13 @@ "label": "method", "description": [], "signature": [ - "RouteMethod" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteMethod", + "text": "RouteMethod" + } ], "path": "packages/core/http/core-http-router-server-internal/src/route.ts", "deprecated": false, @@ -351,9 +381,21 @@ " | Error | ", "Stream", " | Buffer | { message: string | Error; attributes?: ", - "ResponseErrorAttributes", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, " | undefined; } | undefined>(options: ", - "CustomHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, ") => ", "KibanaResponse", "" @@ -370,7 +412,13 @@ "label": "options", "description": [], "signature": [ - "CustomHttpResponseOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, "" ], "path": "packages/core/http/core-http-router-server-internal/src/response.ts", diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index f805622642026..23eef170c5fb7 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_http_router_server_mocks.devdocs.json index 1dfa09a953f90..30d2905d9bce4 100644 --- a/api_docs/kbn_core_http_router_server_mocks.devdocs.json +++ b/api_docs/kbn_core_http_router_server_mocks.devdocs.json @@ -23,55 +23,205 @@ "description": [], "signature": [ "{ routerPath: string; get: jest.MockInstance, handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, "]>; post: jest.MockInstance, handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, "]>; put: jest.MockInstance, handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, "]>; patch: jest.MockInstance, handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, "]>; delete: jest.MockInstance, handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, "]>; handleLegacyErrors: jest.MockInstance<", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, ", [handler: ", - "RequestHandler", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, "]>; getRoutes: jest.MockInstance<", - "RouterRoute", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouterRoute", + "text": "RouterRoute" + }, "[], []>; } & ", - "IRouter", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IRouter", + "text": "IRouter" + }, "" ], "path": "packages/core/http/core-http-router-server-mocks/src/router.mock.ts", @@ -141,7 +291,13 @@ "

({ path, headers, params, body, query, method, socket, routeTags, routeAuthRequired, validation, kibanaRouteOptions, kibanaRequestState, auth, }?: ", "RequestFixtureOptions", ") => ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/http/core-http-router-server-mocks/src/router.mock.ts", @@ -175,7 +331,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ">" ], "path": "packages/core/http/core-http-router-server-mocks/src/router.mock.ts", diff --git a/api_docs/kbn_core_http_router_server_mocks.mdx b/api_docs/kbn_core_http_router_server_mocks.mdx index bd5a34cd3906f..5bf882092b64a 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: 2022-10-25 +date: 2022-11-07 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 2fdd0ff9d2a33..67d50befff8cf 100644 --- a/api_docs/kbn_core_http_server.devdocs.json +++ b/api_docs/kbn_core_http_server.devdocs.json @@ -28,7 +28,13 @@ "text": "RouteValidationError" }, " extends ", - "SchemaTypeError" + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.SchemaTypeError", + "text": "SchemaTypeError" + } ], "path": "packages/core/http/core-http-server/src/router/route_validator.ts", "deprecated": false, @@ -2322,7 +2328,13 @@ "\nA set of policies describing which external urls are allowed." ], "signature": [ - "IExternalUrlPolicy", + { + "pluginId": "@kbn/core-http-common", + "scope": "common", + "docId": "kibKbnCoreHttpCommonPluginApi", + "section": "def-common.IExternalUrlPolicy", + "text": "IExternalUrlPolicy" + }, "[]" ], "path": "packages/core/http/core-http-server/src/external_url.ts", @@ -4229,9 +4241,21 @@ ], "signature": [ "{ readonly path: string; readonly method: ", - "RecursiveReadonly", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonly", + "text": "RecursiveReadonly" + }, "; readonly options: ", - "RecursiveReadonly", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonly", + "text": "RecursiveReadonly" + }, "<", { "pluginId": "@kbn/core-http-server", @@ -5571,7 +5595,13 @@ ], "signature": [ ">(parts: T[]) => Promise<", - "AwaitedProperties", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.AwaitedProperties", + "text": "AwaitedProperties" + }, ">>" ], "path": "packages/core/http/core-http-server/src/router/request_handler_context.ts", @@ -6689,14 +6719,6 @@ "text": "AuthToolkit" }, ") => ", - { - "pluginId": "@kbn/core-http-server", - "scope": "server", - "docId": "kibKbnCoreHttpServerPluginApi", - "section": "def-server.AuthResult", - "text": "AuthResult" - }, - " | ", { "pluginId": "@kbn/core-http-server", "scope": "server", @@ -6704,7 +6726,7 @@ "section": "def-server.IKibanaResponse", "text": "IKibanaResponse" }, - " | Promise<", + " | ", { "pluginId": "@kbn/core-http-server", "scope": "server", @@ -6712,7 +6734,7 @@ "section": "def-server.AuthResult", "text": "AuthResult" }, - " | ", + " | Promise<", { "pluginId": "@kbn/core-http-server", "scope": "server", @@ -6720,7 +6742,15 @@ "section": "def-server.IKibanaResponse", "text": "IKibanaResponse" }, - ">" + " | ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthResult", + "text": "AuthResult" + }, + ">" ], "path": "packages/core/http/core-http-server/src/lifecycle/auth.ts", "deprecated": false, @@ -7143,7 +7173,13 @@ "text": "KibanaResponseFactory" }, ") => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, ">" ], "path": "packages/core/http/core-http-server/src/router/context_provider.ts", @@ -7639,14 +7675,6 @@ "text": "OnPreAuthToolkit" }, ") => ", - { - "pluginId": "@kbn/core-http-server", - "scope": "server", - "docId": "kibKbnCoreHttpServerPluginApi", - "section": "def-server.OnPreAuthNextResult", - "text": "OnPreAuthNextResult" - }, - " | ", { "pluginId": "@kbn/core-http-server", "scope": "server", @@ -7654,7 +7682,7 @@ "section": "def-server.IKibanaResponse", "text": "IKibanaResponse" }, - " | Promise<", + " | ", { "pluginId": "@kbn/core-http-server", "scope": "server", @@ -7662,7 +7690,7 @@ "section": "def-server.OnPreAuthNextResult", "text": "OnPreAuthNextResult" }, - " | ", + " | Promise<", { "pluginId": "@kbn/core-http-server", "scope": "server", @@ -7670,7 +7698,15 @@ "section": "def-server.IKibanaResponse", "text": "IKibanaResponse" }, - ">" + " | ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreAuthNextResult", + "text": "OnPreAuthNextResult" + }, + ">" ], "path": "packages/core/http/core-http-server/src/lifecycle/on_pre_auth.ts", "deprecated": false, @@ -8745,9 +8781,21 @@ "\nAllowed property validation options: either @kbn/config-schema validations or custom validation functions\n\nSee {@link RouteValidationFunction} for custom validation.\n" ], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, " | ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, " | ", { "pluginId": "@kbn/core-http-server", diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index 99f868cb457cf..9273a8a6f9819 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.devdocs.json b/api_docs/kbn_core_http_server_internal.devdocs.json index d7eec9a8625a8..d4c9428b8a5da 100644 --- a/api_docs/kbn_core_http_server_internal.devdocs.json +++ b/api_docs/kbn_core_http_server_internal.devdocs.json @@ -28,7 +28,13 @@ "text": "CspConfig" }, " implements ", - "ICspConfig" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ICspConfig", + "text": "ICspConfig" + } ], "path": "packages/core/http/core-http-server-internal/src/csp/csp_config.ts", "deprecated": false, @@ -133,7 +139,13 @@ "text": "ExternalUrlConfig" }, " implements ", - "IExternalUrlConfig" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IExternalUrlConfig", + "text": "IExternalUrlConfig" + } ], "path": "packages/core/http/core-http-server-internal/src/external_url/external_url_config.ts", "deprecated": false, @@ -167,7 +179,13 @@ "label": "policy", "description": [], "signature": [ - "IExternalUrlPolicy", + { + "pluginId": "@kbn/core-http-common", + "scope": "common", + "docId": "kibKbnCoreHttpCommonPluginApi", + "section": "def-common.IExternalUrlPolicy", + "text": "IExternalUrlPolicy" + }, "[]" ], "path": "packages/core/http/core-http-server-internal/src/external_url/external_url_config.ts", @@ -193,7 +211,13 @@ "text": "HttpConfig" }, " implements ", - "IHttpConfig" + { + "pluginId": "@kbn/server-http-tools", + "scope": "server", + "docId": "kibKbnServerHttpToolsPluginApi", + "section": "def-server.IHttpConfig", + "text": "IHttpConfig" + } ], "path": "packages/core/http/core-http-server-internal/src/http_config.ts", "deprecated": false, @@ -315,7 +339,13 @@ "label": "maxPayload", "description": [], "signature": [ - "ByteSizeValue" + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + } ], "path": "packages/core/http/core-http-server-internal/src/http_config.ts", "deprecated": false, @@ -368,7 +398,13 @@ "label": "ssl", "description": [], "signature": [ - "SslConfig" + { + "pluginId": "@kbn/server-http-tools", + "scope": "server", + "docId": "kibKbnServerHttpToolsPluginApi", + "section": "def-server.SslConfig", + "text": "SslConfig" + } ], "path": "packages/core/http/core-http-server-internal/src/http_config.ts", "deprecated": false, @@ -396,7 +432,13 @@ "label": "csp", "description": [], "signature": [ - "ICspConfig" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ICspConfig", + "text": "ICspConfig" + } ], "path": "packages/core/http/core-http-server-internal/src/http_config.ts", "deprecated": false, @@ -410,7 +452,13 @@ "label": "externalUrl", "description": [], "signature": [ - "IExternalUrlConfig" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IExternalUrlConfig", + "text": "IExternalUrlConfig" + } ], "path": "packages/core/http/core-http-server-internal/src/http_config.ts", "deprecated": false, @@ -494,7 +542,13 @@ "label": "logger", "description": [], "signature": [ - "LoggerFactory" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + } ], "path": "packages/core/http/core-http-server-internal/src/http_server.ts", "deprecated": false, @@ -665,13 +719,31 @@ ], "signature": [ "(log: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, ", server: ", "Server", ", cookieOptions: ", - "SessionStorageCookieOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageCookieOptions", + "text": "SessionStorageCookieOptions" + }, ", basePath: string | undefined) => Promise<", - "SessionStorageFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageFactory", + "text": "SessionStorageFactory" + }, ">" ], "path": "packages/core/http/core-http-server-internal/src/cookie_session_storage.ts", @@ -686,7 +758,13 @@ "label": "log", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "packages/core/http/core-http-server-internal/src/cookie_session_storage.ts", "deprecated": false, @@ -720,7 +798,13 @@ "- cookies configuration" ], "signature": [ - "SessionStorageCookieOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageCookieOptions", + "text": "SessionStorageCookieOptions" + }, "" ], "path": "packages/core/http/core-http-server-internal/src/cookie_session_storage.ts", @@ -760,7 +844,13 @@ "description": [], "signature": [ "{ readonly uuid?: string | undefined; readonly basePath?: string | undefined; readonly publicBaseUrl?: string | undefined; readonly name: string; readonly host: string; readonly compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; readonly ssl: Readonly<{ key?: string | undefined; certificateAuthorities?: string | string[] | undefined; certificate?: string | undefined; keyPassphrase?: string | undefined; redirectHttpFromPort?: number | undefined; } & { enabled: boolean; keystore: Readonly<{ path?: string | undefined; password?: string | undefined; } & {}>; truststore: Readonly<{ path?: string | undefined; password?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"optional\" | \"none\" | \"required\"; }>; readonly port: number; readonly cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; readonly autoListen: boolean; readonly shutdownTimeout: moment.Duration; readonly securityResponseHeaders: Readonly<{} & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; disableEmbedding: boolean; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; }>; readonly customResponseHeaders: Record; readonly maxPayload: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, "; readonly rewriteBasePath: boolean; readonly keepaliveTimeout: number; readonly socketTimeout: number; readonly xsrf: Readonly<{} & { disableProtection: boolean; allowlist: string[]; }>; readonly requestId: Readonly<{} & { allowFromAnyIp: boolean; ipAllowlist: string[]; }>; }" ], "path": "packages/core/http/core-http-server-internal/src/http_config.ts", @@ -802,37 +892,133 @@ "label": "schema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ disableUnsafeEval: ", - "ConditionalType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ConditionalType", + "text": "ConditionalType" + }, "; script_src: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; worker_src: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; style_src: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; connect_src: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; default_src: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; font_src: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; frame_src: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; img_src: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; frame_ancestors: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; report_uri: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; report_to: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; strict: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; warnLegacyBrowsers: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; disableEmbedding: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>" ], "path": "packages/core/http/core-http-server-internal/src/csp/config.ts", @@ -872,11 +1058,29 @@ "label": "schema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ policy: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "<", - "IExternalUrlPolicy", + { + "pluginId": "@kbn/core-http-common", + "scope": "common", + "docId": "kibKbnCoreHttpCommonPluginApi", + "section": "def-common.IExternalUrlPolicy", + "text": "IExternalUrlPolicy" + }, "[]>; }>" ], "path": "packages/core/http/core-http-server-internal/src/external_url/config.ts", diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 18bf384a95ac1..c3a97bd0b9783 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 54 | 0 | 48 | 2 | +| 54 | 0 | 48 | 6 | ## Server diff --git a/api_docs/kbn_core_http_server_mocks.devdocs.json b/api_docs/kbn_core_http_server_mocks.devdocs.json index 262d3311c6d1a..7479525ab94e6 100644 --- a/api_docs/kbn_core_http_server_mocks.devdocs.json +++ b/api_docs/kbn_core_http_server_mocks.devdocs.json @@ -102,17 +102,53 @@ "description": [], "signature": [ "{ registerRoutes: jest.MockInstance) => void]>; basePath: ", - "IBasePath", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IBasePath", + "text": "IBasePath" + }, "; getServerInfo: jest.MockInstance<", - "HttpServerInfo", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServerInfo", + "text": "HttpServerInfo" + }, ", []>; } & ", - "HttpServicePreboot", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServicePreboot", + "text": "HttpServicePreboot" + }, "<", - "RequestHandlerContextBase", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RequestHandlerContextBase", + "text": "RequestHandlerContextBase" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", @@ -129,31 +165,109 @@ "description": [], "signature": [ "{ csp: ", - "ICspConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ICspConfig", + "text": "ICspConfig" + }, "; registerRouteHandlerContext: jest.MockInstance<", - "IContextContainer", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IContextContainer", + "text": "IContextContainer" + }, ", [contextName: Exclude, provider: ", - "IContextProvider", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IContextProvider", + "text": "IContextProvider" + }, ">]>; getServerInfo: jest.MockInstance<", - "HttpServerInfo", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServerInfo", + "text": "HttpServerInfo" + }, ", []>; createCookieSessionStorageFactory: jest.MockInstance>, [cookieOptions: ", - "SessionStorageCookieOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageCookieOptions", + "text": "SessionStorageCookieOptions" + }, "]>; registerOnPreRouting: jest.MockInstance; registerOnPreAuth: jest.MockInstance; registerAuth: jest.MockInstance; registerOnPostAuth: jest.MockInstance; registerOnPreResponse: jest.MockInstance; } & Omit<", - "HttpServiceSetup", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServiceSetup", + "text": "HttpServiceSetup" + }, ", \"createRouter\" | \"basePath\"> & { basePath: BasePathMocked; createRouter: jest.MockedFunction<() => ", - "RouterMock", + { + "pluginId": "@kbn/core-http-router-server-mocks", + "scope": "server", + "docId": "kibKbnCoreHttpRouterServerMocksPluginApi", + "section": "def-server.RouterMock", + "text": "RouterMock" + }, ">; }" ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", @@ -170,13 +284,37 @@ "description": [], "signature": [ "{ basePath: ", - "IBasePath", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IBasePath", + "text": "IBasePath" + }, "; auth: ", - "HttpAuth", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpAuth", + "text": "HttpAuth" + }, "; getServerInfo: jest.MockInstance<", - "HttpServerInfo", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServerInfo", + "text": "HttpServerInfo" + }, ", []>; } & ", - "HttpServiceStart", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServiceStart", + "text": "HttpServiceStart" + }, " & { basePath: BasePathMocked; }" ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", @@ -193,23 +331,71 @@ "description": [], "signature": [ "{ auth: ", - "HttpAuth", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpAuth", + "text": "HttpAuth" + }, "; server: ", "Server", "; externalUrl: ", - "ExternalUrlConfig", + { + "pluginId": "@kbn/core-http-server-internal", + "scope": "server", + "docId": "kibKbnCoreHttpServerInternalPluginApi", + "section": "def-server.ExternalUrlConfig", + "text": "ExternalUrlConfig" + }, "; csp: ", - "ICspConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ICspConfig", + "text": "ICspConfig" + }, "; registerStaticDir: jest.MockInstance; registerRouteHandlerContext: jest.MockInstance]>; getServerInfo: jest.MockInstance<", - "HttpServerInfo", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServerInfo", + "text": "HttpServerInfo" + }, ", []>; registerRoutes: jest.MockInstance) => void]>; } & Omit<", "InternalHttpServicePreboot", ", \"basePath\"> & { basePath: BasePathMocked; }" @@ -230,43 +416,151 @@ "{ server: ", "Server", "; externalUrl: ", - "ExternalUrlConfig", + { + "pluginId": "@kbn/core-http-server-internal", + "scope": "server", + "docId": "kibKbnCoreHttpServerInternalPluginApi", + "section": "def-server.ExternalUrlConfig", + "text": "ExternalUrlConfig" + }, "; csp: ", - "ICspConfig", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.ICspConfig", + "text": "ICspConfig" + }, "; registerStaticDir: jest.MockInstance; registerRouteHandlerContext: jest.MockInstance]>; getServerInfo: jest.MockInstance<", - "HttpServerInfo", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServerInfo", + "text": "HttpServerInfo" + }, ", []>; createCookieSessionStorageFactory: jest.MockInstance>, [cookieOptions: ", - "SessionStorageCookieOptions", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageCookieOptions", + "text": "SessionStorageCookieOptions" + }, "]>; registerOnPreRouting: jest.MockInstance; registerOnPreAuth: jest.MockInstance; registerAuth: jest.MockInstance; registerOnPostAuth: jest.MockInstance; registerOnPreResponse: jest.MockInstance; registerRouterAfterListening: jest.MockInstance]>; registerPrebootRoutes: jest.MockInstance) => void]>; } & Omit<", "InternalHttpServiceSetup", - ", \"createRouter\" | \"basePath\" | \"auth\" | \"authRequestHeaders\"> & { auth: AuthMocked; basePath: BasePathMocked; createRouter: jest.MockedFunction<(path: string) => ", - "RouterMock", + ", \"createRouter\" | \"auth\" | \"basePath\" | \"authRequestHeaders\"> & { auth: AuthMocked; basePath: BasePathMocked; createRouter: jest.MockedFunction<(path: string) => ", + { + "pluginId": "@kbn/core-http-router-server-mocks", + "scope": "server", + "docId": "kibKbnCoreHttpRouterServerMocksPluginApi", + "section": "def-server.RouterMock", + "text": "RouterMock" + }, ">; authRequestHeaders: jest.Mocked<", - "IAuthHeadersStorage", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IAuthHeadersStorage", + "text": "IAuthHeadersStorage" + }, ">; }" ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", @@ -283,11 +577,29 @@ "description": [], "signature": [ "{ isListening: jest.MockInstance; basePath: ", - "IBasePath", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IBasePath", + "text": "IBasePath" + }, "; auth: ", - "HttpAuth", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpAuth", + "text": "HttpAuth" + }, "; getServerInfo: jest.MockInstance<", - "HttpServerInfo", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServerInfo", + "text": "HttpServerInfo" + }, ", []>; } & ", "InternalHttpServiceStart", " & { basePath: BasePathMocked; }" @@ -320,8 +632,14 @@ "signature": [ "

({ path, headers, params, body, query, method, socket, routeTags, routeAuthRequired, validation, kibanaRouteOptions, kibanaRequestState, auth, }?: ", "RequestFixtureOptions", - " | undefined) => ", - "KibanaRequest", + ") => ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/http/core-http-server-mocks/src/http_server.mocks.ts", @@ -338,9 +656,9 @@ "description": [], "signature": [ "RequestFixtureOptions", - " | undefined" + "" ], - "path": "node_modules/@types/kbn__core-http-router-server-mocks/index.d.ts", + "path": "packages/core/http/core-http-router-server-mocks/src/router.mock.ts", "deprecated": false, "trackAdoption": false } @@ -355,10 +673,16 @@ "description": [], "signature": [ "(customization?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "Request", - "> | undefined) => ", + ">) => ", "Request" ], "path": "packages/core/http/core-http-server-mocks/src/http_server.mocks.ts", @@ -374,12 +698,433 @@ "label": "customization", "description": [], "signature": [ - "DeepPartialObject", + "{ app?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "RequestApplicationState", + "> | undefined; readonly auth?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "RequestAuth", + "> | undefined; events?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "RequestEvents", + "> | undefined; readonly headers?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", + "Util", + ".Dictionary> | undefined; readonly info?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "RequestInfo", + "> | undefined; readonly logs?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialArray", + "text": "DeepPartialArray" + }, + "<", + "RequestLog", + "> | undefined; readonly method?: ", + "Util", + ".HTTP_METHODS_PARTIAL_LOWERCASE | undefined; readonly mime?: string | undefined; readonly orig?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "RequestOrig", + "> | undefined; readonly params?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "Util", + ".Dictionary> | undefined; readonly paramsArray?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialArray", + "text": "DeepPartialArray" + }, + " | undefined; readonly path?: string | undefined; readonly payload?: string | object | ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "Readable", + "> | ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + " | undefined; plugins?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "PluginsStates", + "> | undefined; readonly pre?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "Util", + ".Dictionary> | undefined; response?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "Boom", + "> | ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "ResponseObject", + "> | undefined; readonly preResponses?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "Util", + ".Dictionary> | undefined; readonly query?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "RequestQuery", + "> | undefined; readonly raw?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<{ req: ", + "IncomingMessage", + "; res: ", + "ServerResponse", + "; }> | undefined; readonly route?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "RequestRoute", + "> | undefined; server?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "Server", + "> | undefined; readonly state?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "Util", + ".Dictionary> | undefined; readonly url?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<", + "URL", + "> | undefined; active?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<() => boolean> | undefined; generateResponse?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<(source: string | object | null, options?: { variety?: string | undefined; prepare?: ((response: ", + "ResponseObject", + ") => Promise<", + "ResponseObject", + ">) | undefined; marshal?: ((response: ", + "ResponseObject", + ") => Promise<", + "ResponseValue", + ">) | undefined; close?: ((response: ", + "ResponseObject", + ") => void) | undefined; } | undefined) => ", + "ResponseObject", + "> | undefined; log?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<(tags: string | string[], data?: string | object | (() => string | object) | undefined) => void> | undefined; setMethod?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<(method: ", + "Util", + ".HTTP_METHODS_PARTIAL) => void> | undefined; setUrl?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<(url: string | ", + "URL", + ", stripTrailingSlash?: boolean | undefined) => void> | undefined; cookieAuth?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<{ set(session: object): void; set(key: string, value: string | object): void; clear(key?: string | undefined): void; ttl(milliseconds: number): void; }> | undefined; registerEvent?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<(events: ", + "Event", + " | ", + "Event", + "[]) => void> | undefined; registerPodium?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<(podiums: ", + "node_modules/@hapi/podium/lib/index", + " | ", + "node_modules/@hapi/podium/lib/index", + "[]) => void> | undefined; emit?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<(criteria: string | ", + "EmitCriteria", + ", data?: any) => Promise> | undefined; on?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<{ (criteria: string | ", + "CriteriaObject", + ", listener: ", + "Listener", + ", context?: Tcontext | undefined): ", + "Request", + "; (criteria: string | ", + "CriteriaObject", + ", listener: ", + "Listener", + ", context?: Tcontext | undefined): ", + "Request", + "; }> | undefined; addListener?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<{ (criteria: string | ", + "CriteriaObject", + ", listener: ", + "Listener", + ", context?: Tcontext | undefined): ", + "Request", + "; (criteria: string | ", + "CriteriaObject", + ", listener: ", + "Listener", + ", context?: Tcontext | undefined): ", "Request", - "> | undefined" + "; }> | undefined; once?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<{ (criteria: string | Omit<", + "CriteriaObject", + ", \"count\">, listener: ", + "Listener", + ", context?: Tcontext | undefined): ", + "Request", + "; (criteria: string | Omit<", + "CriteriaObject", + ", \"count\">, listener: ", + "Listener", + ", context?: Tcontext | undefined): ", + "Request", + "; (criteria: string | Omit<", + "CriteriaObject", + ", \"count\">): Promise; (criteria: string | Omit<", + "CriteriaObject", + ", \"count\">): Promise; }> | undefined; removeListener?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<(name: string, listener: ", + "Listener", + ") => ", + "Request", + "> | undefined; removeAllListeners?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<(name: string) => ", + "Request", + "> | undefined; hasListeners?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, + "<(name: string) => boolean> | undefined; }" ], - "path": "node_modules/@types/kbn__hapi-mocks/index.d.ts", + "path": "packages/kbn-hapi-mocks/src/request.ts", "deprecated": false, "trackAdoption": false } @@ -394,7 +1139,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/http_server.mocks.ts", @@ -412,7 +1163,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "LifecycleResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.LifecycleResponseFactory", + "text": "LifecycleResponseFactory" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/http_server.mocks.ts", @@ -600,9 +1357,21 @@ "description": [], "signature": [ "() => ", { "pluginId": "@kbn/core-http-server-mocks", @@ -674,7 +1443,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "OnPreAuthToolkit", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreAuthToolkit", + "text": "OnPreAuthToolkit" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", @@ -692,7 +1467,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "OnPostAuthToolkit", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPostAuthToolkit", + "text": "OnPostAuthToolkit" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", @@ -710,7 +1491,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "OnPreResponseToolkit", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreResponseToolkit", + "text": "OnPreResponseToolkit" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", @@ -728,7 +1515,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "OnPreRoutingToolkit", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.OnPreRoutingToolkit", + "text": "OnPreRoutingToolkit" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", @@ -746,7 +1539,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "AuthToolkit", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.AuthToolkit", + "text": "AuthToolkit" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", @@ -764,7 +1563,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "IAuthHeadersStorage", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IAuthHeadersStorage", + "text": "IAuthHeadersStorage" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", @@ -781,8 +1586,14 @@ "label": "createRouter", "description": [], "signature": [ - "({ routerPath }?: { routerPath?: string | undefined; } | undefined) => ", - "RouterMock" + "({ routerPath }?: { routerPath?: string | undefined; }) => ", + { + "pluginId": "@kbn/core-http-router-server-mocks", + "scope": "server", + "docId": "kibKbnCoreHttpRouterServerMocksPluginApi", + "section": "def-server.RouterMock", + "text": "RouterMock" + } ], "path": "packages/core/http/core-http-server-mocks/src/http_service.mock.ts", "deprecated": false, @@ -797,9 +1608,9 @@ "label": "__0", "description": [], "signature": [ - "{ routerPath?: string | undefined; } | undefined" + "{ routerPath?: string | undefined; }" ], - "path": "node_modules/@types/kbn__core-http-router-server-mocks/index.d.ts", + "path": "packages/core/http/core-http-router-server-mocks/src/router.mock.ts", "deprecated": false, "trackAdoption": false } @@ -828,7 +1639,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "SessionStorage", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorage", + "text": "SessionStorage" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/cookie_session_storage.mocks.ts", @@ -846,7 +1663,13 @@ "description": [], "signature": [ "() => DeepMocked<", - "SessionStorageFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.SessionStorageFactory", + "text": "SessionStorageFactory" + }, ">" ], "path": "packages/core/http/core-http-server-mocks/src/cookie_session_storage.mocks.ts", diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index c79757fdbe987..4be9fd37499f0 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-mocks'] --- import kbnCoreHttpServerMocksObj from './kbn_core_http_server_mocks.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 41 | 0 | 37 | 0 | +| 41 | 0 | 40 | 0 | ## Server diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index 7e0e711a696b3..a9f7f4dcb3e7b 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_i18n_browser_mocks.devdocs.json index 0ec0cea1ba1ec..183e0f3819aaf 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_i18n_browser_mocks.devdocs.json @@ -59,7 +59,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "I18nStart", + { + "pluginId": "@kbn/core-i18n-browser", + "scope": "common", + "docId": "kibKbnCoreI18nBrowserPluginApi", + "section": "def-common.I18nStart", + "text": "I18nStart" + }, ">" ], "path": "packages/core/i18n/core-i18n-browser-mocks/src/i18n_service.mock.ts", diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index ddd88228d0261..0d61474062534 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: 2022-10-25 +date: 2022-11-07 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 b927a0dcd9e9c..0c29333858080 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_i18n_server_internal.devdocs.json index 6e782c213c8dd..a2e781dc92059 100644 --- a/api_docs/kbn_core_i18n_server_internal.devdocs.json +++ b/api_docs/kbn_core_i18n_server_internal.devdocs.json @@ -98,7 +98,13 @@ "({ pluginPaths, http }: ", "SetupDeps", ") => Promise<", - "I18nServiceSetup", + { + "pluginId": "@kbn/core-i18n-server", + "scope": "common", + "docId": "kibKbnCoreI18nServerPluginApi", + "section": "def-common.I18nServiceSetup", + "text": "I18nServiceSetup" + }, ">" ], "path": "packages/core/i18n/core-i18n-server-internal/src/i18n_service.ts", diff --git a/api_docs/kbn_core_i18n_server_internal.mdx b/api_docs/kbn_core_i18n_server_internal.mdx index 9b8efb08b0089..e223861898087 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_i18n_server_mocks.devdocs.json index 33f7ded52d484..2fb15942eb4ec 100644 --- a/api_docs/kbn_core_i18n_server_mocks.devdocs.json +++ b/api_docs/kbn_core_i18n_server_mocks.devdocs.json @@ -59,7 +59,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "I18nServiceSetup", + { + "pluginId": "@kbn/core-i18n-server", + "scope": "common", + "docId": "kibKbnCoreI18nServerPluginApi", + "section": "def-common.I18nServiceSetup", + "text": "I18nServiceSetup" + }, ">" ], "path": "packages/core/i18n/core-i18n-server-mocks/src/i18n_service.mock.ts", diff --git a/api_docs/kbn_core_i18n_server_mocks.mdx b/api_docs/kbn_core_i18n_server_mocks.mdx index 51d5f464d4238..2609125bba6da 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_injected_metadata_browser.devdocs.json index 03b1d0caa4b7f..1d4823c2427e7 100644 --- a/api_docs/kbn_core_injected_metadata_browser.devdocs.json +++ b/api_docs/kbn_core_injected_metadata_browser.devdocs.json @@ -35,7 +35,16 @@ "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, - "references": [], + "references": [ + { + "plugin": "@kbn/core-lifecycle-browser", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts" + }, + { + "plugin": "@kbn/core-lifecycle-browser", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts" + } + ], "children": [ { "parentPluginId": "@kbn/core-injected-metadata-browser", @@ -102,7 +111,16 @@ "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, - "references": [], + "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" + } + ], "children": [ { "parentPluginId": "@kbn/core-injected-metadata-browser", diff --git a/api_docs/kbn_core_injected_metadata_browser.mdx b/api_docs/kbn_core_injected_metadata_browser.mdx index c8f3f7f8ccbbb..3db33b7dcda39 100644 --- a/api_docs/kbn_core_injected_metadata_browser.mdx +++ b/api_docs/kbn_core_injected_metadata_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser title: "@kbn/core-injected-metadata-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser'] --- import kbnCoreInjectedMetadataBrowserObj from './kbn_core_injected_metadata_browser.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 2a72210a9f78a..476cc218c9b2c 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_integrations_browser_internal.devdocs.json index 65b33e341b140..f4e19a59acdf1 100644 --- a/api_docs/kbn_core_integrations_browser_internal.devdocs.json +++ b/api_docs/kbn_core_integrations_browser_internal.devdocs.json @@ -39,7 +39,13 @@ "label": "uiSettings", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "packages/core/integrations/core-integrations-browser-internal/src/integrations_service.ts", "deprecated": false, diff --git a/api_docs/kbn_core_integrations_browser_internal.mdx b/api_docs/kbn_core_integrations_browser_internal.mdx index b29c40831215c..e8e5d18089cfb 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_integrations_browser_mocks.devdocs.json index b2fc0d81a14ec..8cfbd08b46584 100644 --- a/api_docs/kbn_core_integrations_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_integrations_browser_mocks.devdocs.json @@ -31,7 +31,13 @@ "description": [], "signature": [ "{ setup: () => Promise; start: ({ uiSettings }: ", - "IntegrationsServiceSetupDeps", + { + "pluginId": "@kbn/core-integrations-browser-internal", + "scope": "common", + "docId": "kibKbnCoreIntegrationsBrowserInternalPluginApi", + "section": "def-common.IntegrationsServiceSetupDeps", + "text": "IntegrationsServiceSetupDeps" + }, ") => Promise; stop: () => Promise; }" ], "path": "packages/core/integrations/core-integrations-browser-mocks/src/integrations_service.mock.ts", @@ -48,7 +54,13 @@ "description": [], "signature": [ "{ setup: jest.MockInstance, []>; start: jest.MockInstance, [", - "IntegrationsServiceSetupDeps", + { + "pluginId": "@kbn/core-integrations-browser-internal", + "scope": "common", + "docId": "kibKbnCoreIntegrationsBrowserInternalPluginApi", + "section": "def-common.IntegrationsServiceSetupDeps", + "text": "IntegrationsServiceSetupDeps" + }, "]>; stop: jest.MockInstance, []>; } & ", { "pluginId": "@kbn/core-integrations-browser-mocks", diff --git a/api_docs/kbn_core_integrations_browser_mocks.mdx b/api_docs/kbn_core_integrations_browser_mocks.mdx index e49e6da514326..3d00e8f170f08 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_lifecycle_browser.devdocs.json index 28d9250e42e6d..aec95c7c6a5f4 100644 --- a/api_docs/kbn_core_lifecycle_browser.devdocs.json +++ b/api_docs/kbn_core_lifecycle_browser.devdocs.json @@ -54,21 +54,63 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", @@ -85,7 +127,13 @@ "{@link ApplicationSetup}" ], "signature": [ - "ApplicationSetup" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationSetup", + "text": "ApplicationSetup" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, @@ -101,7 +149,13 @@ "{@link FatalErrorsSetup}" ], "signature": [ - "FatalErrorsSetup" + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, @@ -117,7 +171,13 @@ "{@link HttpSetup}" ], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, @@ -133,7 +193,13 @@ "{@link NotificationsSetup}" ], "signature": [ - "NotificationsSetup" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsSetup", + "text": "NotificationsSetup" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, @@ -149,7 +215,13 @@ "{@link IUiSettingsClient}" ], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, @@ -165,7 +237,13 @@ "{@link ExecutionContextSetup}" ], "signature": [ - "ExecutionContextSetup" + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, @@ -181,7 +259,13 @@ "{@link InjectedMetadataSetup}" ], "signature": [ - "InjectedMetadataSetup" + { + "pluginId": "@kbn/core-injected-metadata-browser", + "scope": "common", + "docId": "kibKbnCoreInjectedMetadataBrowserPluginApi", + "section": "def-common.InjectedMetadataSetup", + "text": "InjectedMetadataSetup" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, @@ -197,7 +281,13 @@ "{@link ThemeServiceSetup}" ], "signature": [ - "ThemeServiceSetup" + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceSetup", + "text": "ThemeServiceSetup" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_setup.ts", "deprecated": false, @@ -256,11 +346,23 @@ ], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; }" ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", @@ -277,7 +379,13 @@ "{@link ApplicationStart}" ], "signature": [ - "ApplicationStart" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationStart", + "text": "ApplicationStart" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -293,7 +401,13 @@ "{@link ChromeStart}" ], "signature": [ - "ChromeStart" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeStart", + "text": "ChromeStart" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -309,7 +423,13 @@ "{@link DocLinksStart}" ], "signature": [ - "DocLinksStart" + { + "pluginId": "@kbn/core-doc-links-browser", + "scope": "common", + "docId": "kibKbnCoreDocLinksBrowserPluginApi", + "section": "def-common.DocLinksStart", + "text": "DocLinksStart" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -325,7 +445,13 @@ "{@link ExecutionContextStart}" ], "signature": [ - "ExecutionContextSetup" + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -341,7 +467,13 @@ "{@link HttpStart}" ], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -357,7 +489,13 @@ "{@link SavedObjectsStart}" ], "signature": [ - "SavedObjectsStart" + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -373,7 +511,13 @@ "{@link I18nStart}" ], "signature": [ - "I18nStart" + { + "pluginId": "@kbn/core-i18n-browser", + "scope": "common", + "docId": "kibKbnCoreI18nBrowserPluginApi", + "section": "def-common.I18nStart", + "text": "I18nStart" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -389,7 +533,13 @@ "{@link NotificationsStart}" ], "signature": [ - "NotificationsStart" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -405,7 +555,13 @@ "{@link OverlayStart}" ], "signature": [ - "OverlayStart" + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -421,7 +577,13 @@ "{@link IUiSettingsClient}" ], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -437,7 +599,13 @@ "{@link FatalErrorsStart}" ], "signature": [ - "FatalErrorsSetup" + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -453,7 +621,13 @@ "{@link DeprecationsServiceStart}" ], "signature": [ - "DeprecationsServiceStart" + { + "pluginId": "@kbn/core-deprecations-browser", + "scope": "common", + "docId": "kibKbnCoreDeprecationsBrowserPluginApi", + "section": "def-common.DeprecationsServiceStart", + "text": "DeprecationsServiceStart" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -469,7 +643,13 @@ "{@link ThemeServiceStart}" ], "signature": [ - "ThemeServiceStart" + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, @@ -485,7 +665,13 @@ "{@link InjectedMetadataStart}" ], "signature": [ - "InjectedMetadataStart" + { + "pluginId": "@kbn/core-injected-metadata-browser", + "scope": "common", + "docId": "kibKbnCoreInjectedMetadataBrowserPluginApi", + "section": "def-common.InjectedMetadataStart", + "text": "InjectedMetadataStart" + } ], "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts", "deprecated": false, diff --git a/api_docs/kbn_core_lifecycle_browser.mdx b/api_docs/kbn_core_lifecycle_browser.mdx index a583e80285fe9..b8d99edd1ccc0 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_lifecycle_browser_mocks.devdocs.json index dddb527723421..02bd77f9b7a66 100644 --- a/api_docs/kbn_core_lifecycle_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_lifecycle_browser_mocks.devdocs.json @@ -43,57 +43,207 @@ "description": [], "signature": [ "({ basePath, pluginStartDeps, pluginStartContract, }?: { basePath?: string | undefined; pluginStartDeps?: object | undefined; pluginStartContract?: any; }) => { analytics: jest.Mocked<", - "AnalyticsServiceSetup", + { + "pluginId": "@kbn/core-analytics-browser", + "scope": "common", + "docId": "kibKbnCoreAnalyticsBrowserPluginApi", + "section": "def-common.AnalyticsServiceSetup", + "text": "AnalyticsServiceSetup" + }, ">; application: jest.Mocked<", - "ApplicationSetup", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationSetup", + "text": "ApplicationSetup" + }, ">; docLinks: jest.Mock; executionContext: jest.Mocked<", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, ">; fatalErrors: jest.Mocked<", - "FatalErrorsSetup", + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + }, ">; getStartServices: jest.Mock; application: jest.Mocked<", - "ApplicationStart", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationStart", + "text": "ApplicationStart" + }, ">; chrome: ", - "DeeplyMockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.DeeplyMockedKeys", + "text": "DeeplyMockedKeys" + }, "<", "InternalChromeStart", ">; docLinks: ", - "DocLinksStart", + { + "pluginId": "@kbn/core-doc-links-browser", + "scope": "common", + "docId": "kibKbnCoreDocLinksBrowserPluginApi", + "section": "def-common.DocLinksStart", + "text": "DocLinksStart" + }, "; executionContext: jest.Mocked<", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, ">; http: ", - "HttpSetupMock", + { + "pluginId": "@kbn/core-http-browser-mocks", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserMocksPluginApi", + "section": "def-common.HttpSetupMock", + "text": "HttpSetupMock" + }, "; i18n: jest.Mocked<", - "I18nStart", + { + "pluginId": "@kbn/core-i18n-browser", + "scope": "common", + "docId": "kibKbnCoreI18nBrowserPluginApi", + "section": "def-common.I18nStart", + "text": "I18nStart" + }, ">; notifications: ", - "MockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.MockedKeys", + "text": "MockedKeys" + }, "<", - "NotificationsStart", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + }, ">; overlays: ", - "DeeplyMockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.DeeplyMockedKeys", + "text": "DeeplyMockedKeys" + }, "<", - "OverlayStart", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + }, ">; uiSettings: jest.Mocked<", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + }, ">; savedObjects: jest.Mocked<", - "SavedObjectsStart", + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + }, ">; deprecations: jest.Mocked<", - "DeprecationsServiceStart", + { + "pluginId": "@kbn/core-deprecations-browser", + "scope": "common", + "docId": "kibKbnCoreDeprecationsBrowserPluginApi", + "section": "def-common.DeprecationsServiceStart", + "text": "DeprecationsServiceStart" + }, ">; theme: jest.Mocked<", - "ThemeServiceStart", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + }, ">; injectedMetadata: { getInjectedVar: jest.MockInstance & ((name: string, defaultValue?: any) => unknown); }; fatalErrors: jest.Mocked<", - "FatalErrorsSetup", + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + }, ">; }, any, any]>, []>; http: ", - "HttpSetupMock", + { + "pluginId": "@kbn/core-http-browser-mocks", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserMocksPluginApi", + "section": "def-common.HttpSetupMock", + "text": "HttpSetupMock" + }, "; notifications: ", - "MockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.MockedKeys", + "text": "MockedKeys" + }, "<", - "NotificationsSetup", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsSetup", + "text": "NotificationsSetup" + }, ">; uiSettings: jest.Mocked<", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + }, ">; deprecations: undefined; injectedMetadata: { getInjectedVar: jest.MockInstance & ((name: string, defaultValue?: any) => unknown); }; theme: jest.Mocked<", - "ThemeServiceSetup", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceSetup", + "text": "ThemeServiceSetup" + }, ">; }" ], "path": "packages/core/lifecycle/core-lifecycle-browser-mocks/src/index.ts", @@ -126,39 +276,135 @@ "description": [], "signature": [ "({ basePath }?: { basePath?: string | undefined; }) => { analytics: jest.Mocked<", - "AnalyticsServiceStart", + { + "pluginId": "@kbn/core-analytics-browser", + "scope": "common", + "docId": "kibKbnCoreAnalyticsBrowserPluginApi", + "section": "def-common.AnalyticsServiceStart", + "text": "AnalyticsServiceStart" + }, ">; application: jest.Mocked<", - "ApplicationStart", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationStart", + "text": "ApplicationStart" + }, ">; chrome: ", - "DeeplyMockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.DeeplyMockedKeys", + "text": "DeeplyMockedKeys" + }, "<", "InternalChromeStart", ">; docLinks: ", - "DocLinksStart", + { + "pluginId": "@kbn/core-doc-links-browser", + "scope": "common", + "docId": "kibKbnCoreDocLinksBrowserPluginApi", + "section": "def-common.DocLinksStart", + "text": "DocLinksStart" + }, "; executionContext: jest.Mocked<", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, ">; http: ", - "HttpSetupMock", + { + "pluginId": "@kbn/core-http-browser-mocks", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserMocksPluginApi", + "section": "def-common.HttpSetupMock", + "text": "HttpSetupMock" + }, "; i18n: jest.Mocked<", - "I18nStart", + { + "pluginId": "@kbn/core-i18n-browser", + "scope": "common", + "docId": "kibKbnCoreI18nBrowserPluginApi", + "section": "def-common.I18nStart", + "text": "I18nStart" + }, ">; notifications: ", - "MockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.MockedKeys", + "text": "MockedKeys" + }, "<", - "NotificationsStart", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + }, ">; overlays: ", - "DeeplyMockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.DeeplyMockedKeys", + "text": "DeeplyMockedKeys" + }, "<", - "OverlayStart", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + }, ">; uiSettings: jest.Mocked<", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + }, ">; savedObjects: jest.Mocked<", - "SavedObjectsStart", + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + }, ">; deprecations: jest.Mocked<", - "DeprecationsServiceStart", + { + "pluginId": "@kbn/core-deprecations-browser", + "scope": "common", + "docId": "kibKbnCoreDeprecationsBrowserPluginApi", + "section": "def-common.DeprecationsServiceStart", + "text": "DeprecationsServiceStart" + }, ">; theme: jest.Mocked<", - "ThemeServiceStart", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + }, ">; injectedMetadata: { getInjectedVar: jest.MockInstance & ((name: string, defaultValue?: any) => unknown); }; fatalErrors: jest.Mocked<", - "FatalErrorsSetup", + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + }, ">; }" ], "path": "packages/core/lifecycle/core-lifecycle-browser-mocks/src/index.ts", diff --git a/api_docs/kbn_core_lifecycle_browser_mocks.mdx b/api_docs/kbn_core_lifecycle_browser_mocks.mdx index b70219d28445c..cbf1948e01f40 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_lifecycle_server.devdocs.json new file mode 100644 index 0000000000000..0f8b4df0b7133 --- /dev/null +++ b/api_docs/kbn_core_lifecycle_server.devdocs.json @@ -0,0 +1,854 @@ +{ + "id": "@kbn/core-lifecycle-server", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [ + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CorePreboot", + "type": "Interface", + "tags": [], + "label": "CorePreboot", + "description": [ + "\nContext passed to the `setup` method of `preboot` plugins." + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CorePreboot.analytics", + "type": "Object", + "tags": [], + "label": "analytics", + "description": [ + "{@link AnalyticsServicePreboot}" + ], + "signature": [ + "{ optIn: (optInConfig: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, + ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", + "Observable", + "<", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, + ">; registerEventType: (eventTypeOps: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, + ") => void; registerShipper: (Shipper: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, + ", shipperConfig: ShipperConfig, opts?: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, + " | undefined) => void; registerContextProvider: (contextProviderOpts: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, + ") => void; removeContextProvider: (contextProviderName: string) => void; }" + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CorePreboot.elasticsearch", + "type": "Object", + "tags": [], + "label": "elasticsearch", + "description": [ + "{@link ElasticsearchServicePreboot}" + ], + "signature": [ + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchServicePreboot", + "text": "ElasticsearchServicePreboot" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CorePreboot.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [ + "{@link HttpServicePreboot}" + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServicePreboot", + "text": "HttpServicePreboot" + }, + "<", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, + ">" + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CorePreboot.preboot", + "type": "Object", + "tags": [], + "label": "preboot", + "description": [ + "{@link PrebootServicePreboot}" + ], + "signature": [ + { + "pluginId": "@kbn/core-preboot-server", + "scope": "server", + "docId": "kibKbnCorePrebootServerPluginApi", + "section": "def-server.PrebootServicePreboot", + "text": "PrebootServicePreboot" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup", + "type": "Interface", + "tags": [], + "label": "CoreSetup", + "description": [ + "\nContext passed to the `setup` method of `standard` plugins.\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + "" + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.analytics", + "type": "Object", + "tags": [], + "label": "analytics", + "description": [ + "{@link AnalyticsServiceSetup}" + ], + "signature": [ + "{ optIn: (optInConfig: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, + ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", + "Observable", + "<", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, + ">; registerEventType: (eventTypeOps: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, + ") => void; registerShipper: (Shipper: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, + ", shipperConfig: ShipperConfig, opts?: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, + " | undefined) => void; registerContextProvider: (contextProviderOpts: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, + ") => void; removeContextProvider: (contextProviderName: string) => void; }" + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.capabilities", + "type": "Object", + "tags": [], + "label": "capabilities", + "description": [ + "{@link CapabilitiesSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesSetup", + "text": "CapabilitiesSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.docLinks", + "type": "Object", + "tags": [], + "label": "docLinks", + "description": [ + "{@link DocLinksServiceSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-doc-links-server", + "scope": "server", + "docId": "kibKbnCoreDocLinksServerPluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.elasticsearch", + "type": "Object", + "tags": [], + "label": "elasticsearch", + "description": [ + "{@link ElasticsearchServiceSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchServiceSetup", + "text": "ElasticsearchServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.executionContext", + "type": "Object", + "tags": [], + "label": "executionContext", + "description": [ + "{@link ExecutionContextSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-execution-context-server", + "scope": "server", + "docId": "kibKbnCoreExecutionContextServerPluginApi", + "section": "def-server.ExecutionContextSetup", + "text": "ExecutionContextSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.http", + "type": "CompoundType", + "tags": [], + "label": "http", + "description": [ + "{@link HttpServiceSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServiceSetup", + "text": "HttpServiceSetup" + }, + "<", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, + "> & { resources: ", + { + "pluginId": "@kbn/core-http-resources-server", + "scope": "server", + "docId": "kibKbnCoreHttpResourcesServerPluginApi", + "section": "def-server.HttpResources", + "text": "HttpResources" + }, + "; }" + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.i18n", + "type": "Object", + "tags": [], + "label": "i18n", + "description": [ + "{@link I18nServiceSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-i18n-server", + "scope": "common", + "docId": "kibKbnCoreI18nServerPluginApi", + "section": "def-common.I18nServiceSetup", + "text": "I18nServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.logging", + "type": "Object", + "tags": [], + "label": "logging", + "description": [ + "{@link LoggingServiceSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.LoggingServiceSetup", + "text": "LoggingServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.metrics", + "type": "Object", + "tags": [], + "label": "metrics", + "description": [ + "{@link MetricsServiceSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.savedObjects", + "type": "Object", + "tags": [], + "label": "savedObjects", + "description": [ + "{@link SavedObjectsServiceSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceSetup", + "text": "SavedObjectsServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.status", + "type": "Object", + "tags": [], + "label": "status", + "description": [ + "{@link StatusServiceSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-status-server", + "scope": "server", + "docId": "kibKbnCoreStatusServerPluginApi", + "section": "def-server.StatusServiceSetup", + "text": "StatusServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.uiSettings", + "type": "Object", + "tags": [], + "label": "uiSettings", + "description": [ + "{@link UiSettingsServiceSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.UiSettingsServiceSetup", + "text": "UiSettingsServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.deprecations", + "type": "Object", + "tags": [], + "label": "deprecations", + "description": [ + "{@link DeprecationsServiceSetup}" + ], + "signature": [ + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationsServiceSetup", + "text": "DeprecationsServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreSetup.getStartServices", + "type": "Function", + "tags": [], + "label": "getStartServices", + "description": [ + "{@link StartServicesAccessor}" + ], + "signature": [ + "() => Promise<[", + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + }, + ", TPluginsStart, TStart]>" + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreStart", + "type": "Interface", + "tags": [], + "label": "CoreStart", + "description": [ + "\nContext passed to the plugins `start` method.\n" + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreStart.analytics", + "type": "Object", + "tags": [], + "label": "analytics", + "description": [ + "{@link AnalyticsServiceStart}" + ], + "signature": [ + "{ optIn: (optInConfig: ", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, + ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", + "Observable", + "<", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, + ">; }" + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreStart.capabilities", + "type": "Object", + "tags": [], + "label": "capabilities", + "description": [ + "{@link CapabilitiesStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesStart", + "text": "CapabilitiesStart" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreStart.docLinks", + "type": "Object", + "tags": [], + "label": "docLinks", + "description": [ + "{@link DocLinksServiceStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-doc-links-server", + "scope": "server", + "docId": "kibKbnCoreDocLinksServerPluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreStart.elasticsearch", + "type": "Object", + "tags": [], + "label": "elasticsearch", + "description": [ + "{@link ElasticsearchServiceStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchServiceStart", + "text": "ElasticsearchServiceStart" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreStart.executionContext", + "type": "Object", + "tags": [], + "label": "executionContext", + "description": [ + "{@link ExecutionContextStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-execution-context-server", + "scope": "server", + "docId": "kibKbnCoreExecutionContextServerPluginApi", + "section": "def-server.ExecutionContextSetup", + "text": "ExecutionContextSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreStart.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [ + "{@link HttpServiceStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.HttpServiceStart", + "text": "HttpServiceStart" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreStart.metrics", + "type": "Object", + "tags": [], + "label": "metrics", + "description": [ + "{@link MetricsServiceStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreStart.savedObjects", + "type": "Object", + "tags": [], + "label": "savedObjects", + "description": [ + "{@link SavedObjectsServiceStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceStart", + "text": "SavedObjectsServiceStart" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.CoreStart.uiSettings", + "type": "Object", + "tags": [], + "label": "uiSettings", + "description": [ + "{@link UiSettingsServiceStart}" + ], + "signature": [ + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.UiSettingsServiceStart", + "text": "UiSettingsServiceStart" + } + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_start.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/core-lifecycle-server", + "id": "def-server.StartServicesAccessor", + "type": "Type", + "tags": [], + "label": "StartServicesAccessor", + "description": [ + "\nAllows plugins to get access to APIs available in start inside async handlers.\nPromise will not resolve until Core and plugin dependencies have completed `start`.\nThis should only be used inside handlers registered during `setup` that will only be executed\nafter `start` lifecycle.\n" + ], + "signature": [ + "() => Promise<[", + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + }, + ", TPluginsStart, TStart]>" + ], + "path": "packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [], + "initialIsOpen": false + } + ], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_lifecycle_server.mdx b/api_docs/kbn_core_lifecycle_server.mdx new file mode 100644 index 0000000000000..f5c483c590690 --- /dev/null +++ b/api_docs/kbn_core_lifecycle_server.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCoreLifecycleServerPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server'] +--- +import kbnCoreLifecycleServerObj from './kbn_core_lifecycle_server.devdocs.json'; + + + +Contact Kibana Core for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 31 | 0 | 0 | 0 | + +## Server + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_core_lifecycle_server_mocks.devdocs.json b/api_docs/kbn_core_lifecycle_server_mocks.devdocs.json new file mode 100644 index 0000000000000..f66f441281b15 --- /dev/null +++ b/api_docs/kbn_core_lifecycle_server_mocks.devdocs.json @@ -0,0 +1,391 @@ +{ + "id": "@kbn/core-lifecycle-server-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [ + { + "parentPluginId": "@kbn/core-lifecycle-server-mocks", + "id": "def-server.coreInternalLifecycleMock", + "type": "Object", + "tags": [], + "label": "coreInternalLifecycleMock", + "description": [], + "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-lifecycle-server-mocks", + "id": "def-server.coreInternalLifecycleMock.createInternalPreboot", + "type": "Function", + "tags": [], + "label": "createInternalPreboot", + "description": [], + "signature": [ + "() => { analytics: jest.Mocked<", + { + "pluginId": "@kbn/core-analytics-server", + "scope": "server", + "docId": "kibKbnCoreAnalyticsServerPluginApi", + "section": "def-server.AnalyticsServicePreboot", + "text": "AnalyticsServicePreboot" + }, + ">; context: jest.Mocked<", + "InternalContextSetup", + ">; elasticsearch: MockedElasticSearchServicePreboot; http: ", + { + "pluginId": "@kbn/core-http-server-mocks", + "scope": "server", + "docId": "kibKbnCoreHttpServerMocksPluginApi", + "section": "def-server.InternalHttpServicePrebootMock", + "text": "InternalHttpServicePrebootMock" + }, + "; httpResources: { createRegistrar: jest.Mock, []>; }; uiSettings: jest.Mocked<", + "InternalUiSettingsServicePreboot", + ">; logging: jest.Mocked<", + "InternalLoggingServicePreboot", + ">; preboot: ", + { + "pluginId": "@kbn/core-preboot-server-mocks", + "scope": "server", + "docId": "kibKbnCorePrebootServerMocksPluginApi", + "section": "def-server.InternalPrebootServicePrebootMock", + "text": "InternalPrebootServicePrebootMock" + }, + "; }" + ], + "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-lifecycle-server-mocks", + "id": "def-server.coreInternalLifecycleMock.createInternalSetup", + "type": "Function", + "tags": [], + "label": "createInternalSetup", + "description": [], + "signature": [ + "() => { analytics: jest.Mocked<", + { + "pluginId": "@kbn/core-analytics-server", + "scope": "server", + "docId": "kibKbnCoreAnalyticsServerPluginApi", + "section": "def-server.AnalyticsServiceSetup", + "text": "AnalyticsServiceSetup" + }, + ">; capabilities: jest.Mocked<", + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesSetup", + "text": "CapabilitiesSetup" + }, + ">; context: jest.Mocked<", + "InternalContextSetup", + ">; docLinks: ", + { + "pluginId": "@kbn/core-doc-links-server", + "scope": "server", + "docId": "kibKbnCoreDocLinksServerPluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + }, + "; elasticsearch: MockedInternalElasticSearchServiceSetup; http: ", + { + "pluginId": "@kbn/core-http-server-mocks", + "scope": "server", + "docId": "kibKbnCoreHttpServerMocksPluginApi", + "section": "def-server.InternalHttpServiceSetupMock", + "text": "InternalHttpServiceSetupMock" + }, + "; savedObjects: jest.Mocked<", + "InternalSavedObjectsServiceSetup", + ">; status: jest.Mocked<", + "InternalStatusServiceSetup", + ">; environment: jest.Mocked<", + "InternalEnvironmentServicePreboot", + ">; i18n: jest.Mocked<", + { + "pluginId": "@kbn/core-i18n-server", + "scope": "common", + "docId": "kibKbnCoreI18nServerPluginApi", + "section": "def-common.I18nServiceSetup", + "text": "I18nServiceSetup" + }, + ">; httpResources: { createRegistrar: jest.Mock, []>; }; rendering: jest.Mocked<", + "InternalRenderingServiceSetup", + ">; uiSettings: jest.Mocked<", + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.UiSettingsServiceSetup", + "text": "UiSettingsServiceSetup" + }, + ">; logging: jest.Mocked<", + "InternalLoggingServicePreboot", + ">; metrics: jest.Mocked<", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + }, + ">; deprecations: jest.Mocked<", + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationRegistryProvider", + "text": "DeprecationRegistryProvider" + }, + ">; executionContext: jest.Mocked<", + "IExecutionContext", + ">; coreUsageData: jest.Mocked<", + "InternalCoreUsageDataSetup", + ">; }" + ], + "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-lifecycle-server-mocks", + "id": "def-server.coreInternalLifecycleMock.createInternalStart", + "type": "Function", + "tags": [], + "label": "createInternalStart", + "description": [], + "signature": [ + "() => { analytics: jest.Mocked<", + { + "pluginId": "@kbn/core-analytics-server", + "scope": "server", + "docId": "kibKbnCoreAnalyticsServerPluginApi", + "section": "def-server.AnalyticsServiceStart", + "text": "AnalyticsServiceStart" + }, + ">; capabilities: jest.Mocked<", + { + "pluginId": "@kbn/core-capabilities-server", + "scope": "server", + "docId": "kibKbnCoreCapabilitiesServerPluginApi", + "section": "def-server.CapabilitiesStart", + "text": "CapabilitiesStart" + }, + ">; docLinks: ", + { + "pluginId": "@kbn/core-doc-links-server", + "scope": "server", + "docId": "kibKbnCoreDocLinksServerPluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + }, + "; elasticsearch: ", + { + "pluginId": "@kbn/core-elasticsearch-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerMocksPluginApi", + "section": "def-server.MockedElasticSearchServiceStart", + "text": "MockedElasticSearchServiceStart" + }, + "; http: ", + { + "pluginId": "@kbn/core-http-server-mocks", + "scope": "server", + "docId": "kibKbnCoreHttpServerMocksPluginApi", + "section": "def-server.InternalHttpServiceStartMock", + "text": "InternalHttpServiceStartMock" + }, + "; metrics: jest.Mocked<", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + }, + ">; savedObjects: jest.Mocked<", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceStart", + "text": "SavedObjectsServiceStart" + }, + ">; uiSettings: jest.Mocked<", + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.UiSettingsServiceStart", + "text": "UiSettingsServiceStart" + }, + ">; coreUsageData: jest.Mocked<", + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreUsageDataStart", + "text": "CoreUsageDataStart" + }, + ">; executionContext: jest.Mocked<", + "IExecutionContext", + ">; deprecations: jest.Mocked<", + { + "pluginId": "@kbn/core-deprecations-server-internal", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerInternalPluginApi", + "section": "def-server.InternalDeprecationsServiceStart", + "text": "InternalDeprecationsServiceStart" + }, + ">; }" + ], + "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-lifecycle-server-mocks", + "id": "def-server.coreLifecycleMock", + "type": "Object", + "tags": [], + "label": "coreLifecycleMock", + "description": [], + "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-lifecycle-server-mocks", + "id": "def-server.coreLifecycleMock.createPreboot", + "type": "Function", + "tags": [], + "label": "createPreboot", + "description": [], + "signature": [ + "() => CorePrebootMockType" + ], + "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-lifecycle-server-mocks", + "id": "def-server.coreLifecycleMock.createCoreSetup", + "type": "Function", + "tags": [], + "label": "createCoreSetup", + "description": [], + "signature": [ + "({ pluginStartDeps, pluginStartContract, }?: { pluginStartDeps?: object | undefined; pluginStartContract?: any; }) => CoreSetupMockType" + ], + "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/core-lifecycle-server-mocks", + "id": "def-server.coreLifecycleMock.createCoreSetup.$1", + "type": "Object", + "tags": [], + "label": "__0", + "description": [], + "signature": [ + "{ pluginStartDeps?: object | undefined; pluginStartContract?: any; }" + ], + "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/core_setup.mock.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "@kbn/core-lifecycle-server-mocks", + "id": "def-server.coreLifecycleMock.createCoreStart", + "type": "Function", + "tags": [], + "label": "createCoreStart", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.MockedKeys", + "text": "MockedKeys" + }, + "<", + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + }, + ">" + ], + "path": "packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + } + ], + "initialIsOpen": false + } + ] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_lifecycle_server_mocks.mdx b/api_docs/kbn_core_lifecycle_server_mocks.mdx new file mode 100644 index 0000000000000..57ff7bbd74809 --- /dev/null +++ b/api_docs/kbn_core_lifecycle_server_mocks.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: kibKbnCoreLifecycleServerMocksPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server-mocks'] +--- +import kbnCoreLifecycleServerMocksObj from './kbn_core_lifecycle_server_mocks.devdocs.json'; + + + +Contact Kibana Core for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 9 | 0 | 9 | 0 | + +## Server + +### Objects + + diff --git a/api_docs/kbn_core_logging_browser_mocks.devdocs.json b/api_docs/kbn_core_logging_browser_mocks.devdocs.json new file mode 100644 index 0000000000000..5c129ba055dc4 --- /dev/null +++ b/api_docs/kbn_core_logging_browser_mocks.devdocs.json @@ -0,0 +1,98 @@ +{ + "id": "@kbn/core-logging-browser-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [ + { + "parentPluginId": "@kbn/core-logging-browser-mocks", + "id": "def-common.loggingSystemMock", + "type": "Object", + "tags": [], + "label": "loggingSystemMock", + "description": [], + "path": "packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-browser-mocks", + "id": "def-common.loggingSystemMock.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [], + "signature": [ + "() => jest.Mocked<", + "IBrowserLoggingSystem", + ">" + ], + "path": "packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-logging-browser-mocks", + "id": "def-common.loggingSystemMock.createLogger", + "type": "Function", + "tags": [], + "label": "createLogger", + "description": [], + "signature": [ + "(context?: string[]) => ", + { + "pluginId": "@kbn/logging-mocks", + "scope": "server", + "docId": "kibKbnLoggingMocksPluginApi", + "section": "def-server.MockedLogger", + "text": "MockedLogger" + } + ], + "path": "packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/core-logging-browser-mocks", + "id": "def-common.loggingSystemMock.createLogger.$1", + "type": "Array", + "tags": [], + "label": "context", + "description": [], + "signature": [ + "string[]" + ], + "path": "packages/kbn-logging-mocks/src/logger.mock.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_logging_browser_mocks.mdx b/api_docs/kbn_core_logging_browser_mocks.mdx new file mode 100644 index 0000000000000..de0567361cfe9 --- /dev/null +++ b/api_docs/kbn_core_logging_browser_mocks.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: kibKbnCoreLoggingBrowserMocksPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-browser-mocks'] +--- +import kbnCoreLoggingBrowserMocksObj from './kbn_core_logging_browser_mocks.devdocs.json'; + + + +Contact Kibana Core for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 4 | 0 | 4 | 0 | + +## Common + +### Objects + + diff --git a/api_docs/kbn_core_logging_common_internal.devdocs.json b/api_docs/kbn_core_logging_common_internal.devdocs.json new file mode 100644 index 0000000000000..74dbf77a108bd --- /dev/null +++ b/api_docs/kbn_core_logging_common_internal.devdocs.json @@ -0,0 +1,637 @@ +{ + "id": "@kbn/core-logging-common-internal", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.getLoggerContext", + "type": "Function", + "tags": [], + "label": "getLoggerContext", + "description": [ + "\nHelper method that joins separate string context parts into single context string.\nIn case joined context is an empty string, `root` context name is returned." + ], + "signature": [ + "(contextParts: string[]) => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.getLoggerContext.$1", + "type": "Array", + "tags": [], + "label": "contextParts", + "description": [ + "List of the context parts (e.g. ['parent', 'child']." + ], + "signature": [ + "string[]" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [ + "Joined context string (e.g. 'parent.child')." + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.getParentLoggerContext", + "type": "Function", + "tags": [], + "label": "getParentLoggerContext", + "description": [ + "\nHelper method that returns parent context for the specified one." + ], + "signature": [ + "(context: string) => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.getParentLoggerContext.$1", + "type": "string", + "tags": [], + "label": "context", + "description": [ + "Context to find parent for." + ], + "signature": [ + "string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [ + "Name of the parent context or `root` if the context is the top level one." + ], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion", + "type": "Interface", + "tags": [], + "label": "Conversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ", highlight: boolean) => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.convert.$2", + "type": "boolean", + "tags": [], + "label": "highlight", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.validate", + "type": "Function", + "tags": [], + "label": "validate", + "description": [], + "signature": [ + "((input: string) => void) | undefined" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.validate.$1", + "type": "string", + "tags": [], + "label": "input", + "description": [], + "signature": [ + "string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.CONTEXT_SEPARATOR", + "type": "string", + "tags": [], + "label": "CONTEXT_SEPARATOR", + "description": [ + "\nSeparator string that used within nested context name (eg. plugins.pid)." + ], + "signature": [ + "\".\"" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DEFAULT_APPENDER_NAME", + "type": "string", + "tags": [], + "label": "DEFAULT_APPENDER_NAME", + "description": [ + "\nName of the appender that is always presented and used by `root` logger by default." + ], + "signature": [ + "\"default\"" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.ROOT_CONTEXT_NAME", + "type": "string", + "tags": [], + "label": "ROOT_CONTEXT_NAME", + "description": [ + "\nName of the `root` context that always exists and sits at the top of logger hierarchy." + ], + "signature": [ + "\"root\"" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion", + "type": "Object", + "tags": [], + "label": "DateConversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ", highlight: boolean, ...matched: any[]) => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.convert.$2", + "type": "boolean", + "tags": [], + "label": "highlight", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.convert.$3", + "type": "Array", + "tags": [], + "label": "matched", + "description": [], + "signature": [ + "any[]" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.validate", + "type": "Function", + "tags": [], + "label": "validate", + "description": [], + "signature": [ + "(rawString: string) => void" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.validate.$1", + "type": "string", + "tags": [], + "label": "rawString", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LevelConversion", + "type": "Object", + "tags": [], + "label": "LevelConversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LevelConversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LevelConversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ") => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LevelConversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LoggerConversion", + "type": "Object", + "tags": [], + "label": "LoggerConversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LoggerConversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LoggerConversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ") => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LoggerConversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MessageConversion", + "type": "Object", + "tags": [], + "label": "MessageConversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MessageConversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MessageConversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ") => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MessageConversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MetaConversion", + "type": "Object", + "tags": [], + "label": "MetaConversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MetaConversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MetaConversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ") => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MetaConversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_logging_common_internal.mdx b/api_docs/kbn_core_logging_common_internal.mdx new file mode 100644 index 0000000000000..48d4009a40f64 --- /dev/null +++ b/api_docs/kbn_core_logging_common_internal.mdx @@ -0,0 +1,39 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCoreLoggingCommonInternalPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-common-internal'] +--- +import kbnCoreLoggingCommonInternalObj from './kbn_core_logging_common_internal.devdocs.json'; + + + +Contact Kibana Core for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 38 | 0 | 31 | 0 | + +## Common + +### Objects + + +### Functions + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_core_logging_server.devdocs.json b/api_docs/kbn_core_logging_server.devdocs.json index 8a5748a6993ce..650c3a9d2d2c8 100644 --- a/api_docs/kbn_core_logging_server.devdocs.json +++ b/api_docs/kbn_core_logging_server.devdocs.json @@ -730,16 +730,16 @@ "pluginId": "@kbn/core-logging-server", "scope": "server", "docId": "kibKbnCoreLoggingServerPluginApi", - "section": "def-server.SizeLimitTriggeringPolicyConfig", - "text": "SizeLimitTriggeringPolicyConfig" + "section": "def-server.TimeIntervalTriggeringPolicyConfig", + "text": "TimeIntervalTriggeringPolicyConfig" }, " | ", { "pluginId": "@kbn/core-logging-server", "scope": "server", "docId": "kibKbnCoreLoggingServerPluginApi", - "section": "def-server.TimeIntervalTriggeringPolicyConfig", - "text": "TimeIntervalTriggeringPolicyConfig" + "section": "def-server.SizeLimitTriggeringPolicyConfig", + "text": "SizeLimitTriggeringPolicyConfig" } ], "path": "packages/core/logging/core-logging-server/src/appenders/rolling_file.ts", @@ -806,7 +806,13 @@ "\nThe minimum size the file must have to roll over." ], "signature": [ - "ByteSizeValue" + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + } ], "path": "packages/core/logging/core-logging-server/src/appenders/rolling_file.ts", "deprecated": false, @@ -1009,16 +1015,16 @@ "pluginId": "@kbn/core-logging-server", "scope": "server", "docId": "kibKbnCoreLoggingServerPluginApi", - "section": "def-server.SizeLimitTriggeringPolicyConfig", - "text": "SizeLimitTriggeringPolicyConfig" + "section": "def-server.TimeIntervalTriggeringPolicyConfig", + "text": "TimeIntervalTriggeringPolicyConfig" }, " | ", { "pluginId": "@kbn/core-logging-server", "scope": "server", "docId": "kibKbnCoreLoggingServerPluginApi", - "section": "def-server.TimeIntervalTriggeringPolicyConfig", - "text": "TimeIntervalTriggeringPolicyConfig" + "section": "def-server.SizeLimitTriggeringPolicyConfig", + "text": "SizeLimitTriggeringPolicyConfig" } ], "path": "packages/core/logging/core-logging-server/src/appenders/rolling_file.ts", diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index 0da05bb4264e5..64d3b3f5e5295 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_logging_server_internal.devdocs.json index 97a1788e84dcb..b5bebc50d5c9d 100644 --- a/api_docs/kbn_core_logging_server_internal.devdocs.json +++ b/api_docs/kbn_core_logging_server_internal.devdocs.json @@ -120,11 +120,29 @@ "\nConfig schema for validting the shape of the `appenders` key in in {@link LoggerContextConfigType} or\n{@link LoggingConfigType}.\n" ], "signature": [ - "Type", - " | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; }> | Readonly<{} & { type: \"file\"; layout: Readonly<{} & { type: \"json\"; }> | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; fileName: string; }> | Readonly<{} & { type: \"rewrite\"; policy: Readonly<{} & { type: \"meta\"; mode: \"update\" | \"remove\"; properties: Readonly<{ value?: string | number | boolean | null | undefined; } & { path: string; }>[]; }>; appenders: string[]; }> | Readonly<{} & { type: \"rolling-file\"; strategy: ", - "NumericRollingStrategyConfig", - "; layout: Readonly<{} & { type: \"json\"; }> | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; fileName: string; policy: Readonly<{} & { type: \"size-limit\"; size: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + " | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; }> | Readonly<{} & { type: \"file\"; fileName: string; layout: Readonly<{} & { type: \"json\"; }> | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; }> | Readonly<{} & { type: \"rewrite\"; policy: Readonly<{} & { type: \"meta\"; mode: \"update\" | \"remove\"; properties: Readonly<{ value?: string | number | boolean | null | undefined; } & { path: string; }>[]; }>; appenders: string[]; }> | Readonly<{} & { type: \"rolling-file\"; strategy: ", + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.NumericRollingStrategyConfig", + "text": "NumericRollingStrategyConfig" + }, + "; fileName: string; layout: Readonly<{} & { type: \"json\"; }> | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; policy: Readonly<{} & { type: \"size-limit\"; size: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, "; }> | Readonly<{} & { type: \"time-interval\"; interval: moment.Duration; modulate: boolean; }>; }>>" ], "path": "packages/core/logging/core-logging-server-internal/src/appenders/appenders.ts", @@ -142,13 +160,37 @@ "\nConfig schema for validating the inputs to the {@link LoggingServiceStart.configure} API.\nSee {@link LoggerContextConfigType}.\n" ], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ appenders: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, ">; loggers: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "[]>; }>" ], "path": "packages/core/logging/core-logging-server-internal/src/logging_config.ts", @@ -166,13 +208,37 @@ "\nConfig schema for validating the `loggers` key in {@link LoggerContextConfigType} or {@link LoggingConfigType}.\n" ], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ appenders: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; name: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; level: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "<\"error\" | \"all\" | \"info\" | \"debug\" | \"off\" | \"warn\" | \"trace\" | \"fatal\">; }>" ], "path": "packages/core/logging/core-logging-server-internal/src/logging_config.ts", diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index 676c5fd5dd38d..ecc6a692d6809 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] --- import kbnCoreLoggingServerInternalObj from './kbn_core_logging_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 9 | 0 | 5 | 1 | +| 9 | 0 | 5 | 2 | ## Server diff --git a/api_docs/kbn_core_logging_server_mocks.devdocs.json b/api_docs/kbn_core_logging_server_mocks.devdocs.json index 389ee2b4f09ba..1a40b0e111102 100644 --- a/api_docs/kbn_core_logging_server_mocks.devdocs.json +++ b/api_docs/kbn_core_logging_server_mocks.devdocs.json @@ -51,7 +51,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "LoggingServiceSetup", + { + "pluginId": "@kbn/core-logging-server", + "scope": "server", + "docId": "kibKbnCoreLoggingServerPluginApi", + "section": "def-server.LoggingServiceSetup", + "text": "LoggingServiceSetup" + }, ">" ], "path": "packages/core/logging/core-logging-server-mocks/src/logging_service.mock.ts", @@ -137,21 +143,63 @@ "description": [], "signature": [ "(loggerFactory: ", - "LoggerFactory", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + }, ") => { debug: [message: string, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; error: [errorOrMessage: string | Error, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; fatal: [errorOrMessage: string | Error, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; info: [message: string, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; log: [record: ", "LogRecord", "][]; trace: [message: string, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; warn: [errorOrMessage: string | Error, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; }" ], "path": "packages/core/logging/core-logging-server-mocks/src/logging_system.mock.ts", @@ -167,7 +215,13 @@ "label": "loggerFactory", "description": [], "signature": [ - "LoggerFactory" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + } ], "path": "packages/core/logging/core-logging-server-mocks/src/logging_system.mock.ts", "deprecated": false, @@ -184,7 +238,13 @@ "description": [], "signature": [ "(loggerFactory: ", - "LoggerFactory", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + }, ") => void" ], "path": "packages/core/logging/core-logging-server-mocks/src/logging_system.mock.ts", @@ -200,7 +260,13 @@ "label": "loggerFactory", "description": [], "signature": [ - "LoggerFactory" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + } ], "path": "packages/core/logging/core-logging-server-mocks/src/logging_system.mock.ts", "deprecated": false, @@ -216,8 +282,14 @@ "label": "createLogger", "description": [], "signature": [ - "(context?: string[] | undefined) => ", - "MockedLogger" + "(context?: string[]) => ", + { + "pluginId": "@kbn/logging-mocks", + "scope": "server", + "docId": "kibKbnLoggingMocksPluginApi", + "section": "def-server.MockedLogger", + "text": "MockedLogger" + } ], "path": "packages/core/logging/core-logging-server-mocks/src/logging_system.mock.ts", "deprecated": false, @@ -232,9 +304,9 @@ "label": "context", "description": [], "signature": [ - "string[] | undefined" + "string[]" ], - "path": "node_modules/@types/kbn__logging-mocks/index.d.ts", + "path": "packages/kbn-logging-mocks/src/logger.mock.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 6d66c79810f73..d14df38239585 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] --- import kbnCoreLoggingServerMocksObj from './kbn_core_logging_server_mocks.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 13 | 0 | 12 | 0 | +| 13 | 0 | 13 | 0 | ## Server diff --git a/api_docs/kbn_core_metrics_collectors_server_internal.devdocs.json b/api_docs/kbn_core_metrics_collectors_server_internal.devdocs.json index 8713e12e2a39f..b42a3b8909832 100644 --- a/api_docs/kbn_core_metrics_collectors_server_internal.devdocs.json +++ b/api_docs/kbn_core_metrics_collectors_server_internal.devdocs.json @@ -26,9 +26,21 @@ "text": "ElasticsearchClientsMetricsCollector" }, " implements ", - "MetricsCollector", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsCollector", + "text": "MetricsCollector" + }, "<", - "ElasticsearchClientsMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.ElasticsearchClientsMetrics", + "text": "ElasticsearchClientsMetrics" + }, ">" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/elasticsearch_client.ts", @@ -57,7 +69,13 @@ "label": "agentStore", "description": [], "signature": [ - "AgentStore" + { + "pluginId": "@kbn/core-elasticsearch-client-server-internal", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerInternalPluginApi", + "section": "def-server.AgentStore", + "text": "AgentStore" + } ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/elasticsearch_client.ts", "deprecated": false, @@ -76,7 +94,13 @@ "description": [], "signature": [ "() => Promise<", - "ElasticsearchClientsMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.ElasticsearchClientsMetrics", + "text": "ElasticsearchClientsMetrics" + }, ">" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/elasticsearch_client.ts", @@ -120,9 +144,21 @@ "text": "EventLoopDelaysMonitor" }, " implements ", - "IEventLoopDelaysMonitor", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.IEventLoopDelaysMonitor", + "text": "IEventLoopDelaysMonitor" + }, "<", - "IntervalHistogram", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.IntervalHistogram", + "text": "IntervalHistogram" + }, ">" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/event_loop_delays_monitor.ts", @@ -158,7 +194,13 @@ ], "signature": [ "() => ", - "IntervalHistogram" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.IntervalHistogram", + "text": "IntervalHistogram" + } ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/event_loop_delays_monitor.ts", "deprecated": false, @@ -221,9 +263,21 @@ "text": "OsMetricsCollector" }, " implements ", - "MetricsCollector", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsCollector", + "text": "MetricsCollector" + }, "<", - "OpsOsMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsOsMetrics", + "text": "OpsOsMetrics" + }, ">" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/os.ts", @@ -277,7 +331,13 @@ "description": [], "signature": [ "() => Promise<", - "OpsOsMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsOsMetrics", + "text": "OpsOsMetrics" + }, ">" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/os.ts", @@ -321,9 +381,21 @@ "text": "ProcessMetricsCollector" }, " implements ", - "MetricsCollector", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsCollector", + "text": "MetricsCollector" + }, "<", - "OpsProcessMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsProcessMetrics", + "text": "OpsProcessMetrics" + }, "[]>" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/process.ts", @@ -339,9 +411,21 @@ "description": [], "signature": [ "(processes: ", - "OpsProcessMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsProcessMetrics", + "text": "OpsProcessMetrics" + }, "[]) => ", - "OpsProcessMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsProcessMetrics", + "text": "OpsProcessMetrics" + }, " | undefined" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/process.ts", @@ -356,7 +440,13 @@ "label": "processes", "description": [], "signature": [ - "OpsProcessMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsProcessMetrics", + "text": "OpsProcessMetrics" + }, "[]" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/process.ts", @@ -376,7 +466,13 @@ "description": [], "signature": [ "() => ", - "OpsProcessMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsProcessMetrics", + "text": "OpsProcessMetrics" + }, "[]" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/process.ts", @@ -420,9 +516,21 @@ "text": "ServerMetricsCollector" }, " implements ", - "MetricsCollector", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsCollector", + "text": "MetricsCollector" + }, "<", - "OpsServerMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsServerMetrics", + "text": "OpsServerMetrics" + }, ">" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/server.ts", @@ -470,7 +578,13 @@ "description": [], "signature": [ "() => Promise<", - "OpsServerMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsServerMetrics", + "text": "OpsServerMetrics" + }, ">" ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/server.ts", @@ -520,7 +634,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "packages/core/metrics/core-metrics-collectors-server-internal/src/os.ts", "deprecated": false, diff --git a/api_docs/kbn_core_metrics_collectors_server_internal.mdx b/api_docs/kbn_core_metrics_collectors_server_internal.mdx index 9a3851599fef6..2fc1cbb8526ef 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_metrics_collectors_server_mocks.devdocs.json index 500a21e68dfe3..ab924ea08f2eb 100644 --- a/api_docs/kbn_core_metrics_collectors_server_mocks.devdocs.json +++ b/api_docs/kbn_core_metrics_collectors_server_mocks.devdocs.json @@ -20,7 +20,13 @@ "description": [], "signature": [ "() => ", - "OpsProcessMetrics" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsProcessMetrics", + "text": "OpsProcessMetrics" + } ], "path": "packages/core/metrics/core-metrics-collectors-server-mocks/src/process.mocks.ts", "deprecated": false, @@ -54,7 +60,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "MetricsCollector", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsCollector", + "text": "MetricsCollector" + }, ">" ], "path": "packages/core/metrics/core-metrics-collectors-server-mocks/src/mocks.ts", @@ -72,7 +84,13 @@ "description": [], "signature": [ "() => ", - "OpsProcessMetrics" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsProcessMetrics", + "text": "OpsProcessMetrics" + } ], "path": "packages/core/metrics/core-metrics-collectors-server-mocks/src/mocks.ts", "deprecated": false, @@ -103,7 +121,13 @@ "description": [], "signature": [ "(collectReturnValue?: any) => jest.Mocked<", - "MetricsCollector", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsCollector", + "text": "MetricsCollector" + }, ">" ], "path": "packages/core/metrics/core-metrics-collectors-server-mocks/src/collector.mock.ts", @@ -150,9 +174,21 @@ "description": [], "signature": [ "(overwrites?: Partial<", - "IntervalHistogram", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.IntervalHistogram", + "text": "IntervalHistogram" + }, ">) => ", - "IntervalHistogram" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.IntervalHistogram", + "text": "IntervalHistogram" + } ], "path": "packages/core/metrics/core-metrics-collectors-server-mocks/src/event_loop_delays_monitor.mocks.ts", "deprecated": false, @@ -184,7 +220,13 @@ "description": [], "signature": [ "() => ", - "EventLoopDelaysMonitor" + { + "pluginId": "@kbn/core-metrics-collectors-server-internal", + "scope": "server", + "docId": "kibKbnCoreMetricsCollectorsServerInternalPluginApi", + "section": "def-server.EventLoopDelaysMonitor", + "text": "EventLoopDelaysMonitor" + } ], "path": "packages/core/metrics/core-metrics-collectors-server-mocks/src/event_loop_delays_monitor.mocks.ts", "deprecated": false, diff --git a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx index 0e3d2b3fca484..a55e5c48c22cd 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_metrics_server.devdocs.json index 6413560fea457..a020eebc5db95 100644 --- a/api_docs/kbn_core_metrics_server.devdocs.json +++ b/api_docs/kbn_core_metrics_server.devdocs.json @@ -395,7 +395,13 @@ ], "signature": [ "() => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "" ], "path": "packages/core/metrics/core-metrics-server/src/collectors.ts", @@ -557,7 +563,76 @@ "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, - "references": [] + "references": [ + { + "plugin": "@kbn/core-apps-browser-internal", + "path": "packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts" + }, + { + "plugin": "@kbn/core-apps-browser-internal", + "path": "packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts" + }, + { + "plugin": "@kbn/core-apps-browser-internal", + "path": "packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts" + }, + { + "plugin": "@kbn/core-apps-browser-internal", + "path": "packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts" + }, + { + "plugin": "@kbn/core-apps-browser-internal", + "path": "packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts" + }, + { + "plugin": "@kbn/core-apps-browser-internal", + "path": "packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts" + }, + { + "plugin": "@kbn/core-metrics-server-internal", + "path": "packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.ts" + }, + { + "plugin": "@kbn/core-metrics-server-internal", + "path": "packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.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.ts" + }, + { + "plugin": "@kbn/core-usage-data-server-internal", + "path": "packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts" + }, + { + "plugin": "@kbn/core-usage-data-server-internal", + "path": "packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts" + }, + { + "plugin": "@kbn/core-usage-data-server-internal", + "path": "packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts" + }, + { + "plugin": "monitoring", + "path": "x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts" + }, + { + "plugin": "kibanaUsageCollection", + "path": "src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts" + }, + { + "plugin": "@kbn/core-metrics-server-internal", + "path": "packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.test.ts" + }, + { + "plugin": "@kbn/core-apps-browser-internal", + "path": "packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.test.ts" + } + ] }, { "parentPluginId": "@kbn/core-metrics-server", diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index 1415b14a8cf92..ee0d6ee54c28b 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_metrics_server_internal.devdocs.json index 0920f42e9bf88..8813632cb753b 100644 --- a/api_docs/kbn_core_metrics_server_internal.devdocs.json +++ b/api_docs/kbn_core_metrics_server_internal.devdocs.json @@ -91,15 +91,45 @@ "label": "schema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ interval: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; cGroupOverrides: ", - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ cpuPath: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; cpuAcctPath: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>; }>" ], "path": "packages/core/metrics/core-metrics-server-internal/src/ops_config.ts", diff --git a/api_docs/kbn_core_metrics_server_internal.mdx b/api_docs/kbn_core_metrics_server_internal.mdx index b63aec7277b8d..e9162d698c9a4 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_metrics_server_mocks.devdocs.json index 9e06f6bcaef02..637b44897f560 100644 --- a/api_docs/kbn_core_metrics_server_mocks.devdocs.json +++ b/api_docs/kbn_core_metrics_server_mocks.devdocs.json @@ -51,7 +51,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "MetricsServiceSetup", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + }, ">" ], "path": "packages/core/metrics/core-metrics-server-mocks/src/metrics_service.mock.ts", @@ -69,7 +75,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "MetricsServiceSetup", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + }, ">" ], "path": "packages/core/metrics/core-metrics-server-mocks/src/metrics_service.mock.ts", @@ -87,7 +99,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "MetricsServiceSetup", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + }, ">" ], "path": "packages/core/metrics/core-metrics-server-mocks/src/metrics_service.mock.ts", @@ -105,7 +123,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "MetricsServiceSetup", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + }, ">" ], "path": "packages/core/metrics/core-metrics-server-mocks/src/metrics_service.mock.ts", @@ -123,7 +147,13 @@ "description": [], "signature": [ "() => ", - "EventLoopDelaysMonitor" + { + "pluginId": "@kbn/core-metrics-collectors-server-internal", + "scope": "server", + "docId": "kibKbnCoreMetricsCollectorsServerInternalPluginApi", + "section": "def-server.EventLoopDelaysMonitor", + "text": "EventLoopDelaysMonitor" + } ], "path": "packages/core/metrics/core-metrics-server-mocks/src/metrics_service.mock.ts", "deprecated": false, diff --git a/api_docs/kbn_core_metrics_server_mocks.mdx b/api_docs/kbn_core_metrics_server_mocks.mdx index f39dbb3bb78ad..abebbb29a0581 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: 2022-10-25 +date: 2022-11-07 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 b2d6689f0e496..dd9ddf9a50d5e 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: 2022-10-25 +date: 2022-11-07 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 e828adcd26088..90a80a97ea621 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_node_server_internal.devdocs.json index 813dd30908201..619eb67ae097d 100644 --- a/api_docs/kbn_core_node_server_internal.devdocs.json +++ b/api_docs/kbn_core_node_server_internal.devdocs.json @@ -11,7 +11,72 @@ "server": { "classes": [], "functions": [], - "interfaces": [], + "interfaces": [ + { + "parentPluginId": "@kbn/core-node-server-internal", + "id": "def-server.InternalNodeServiceStart", + "type": "Interface", + "tags": [], + "label": "InternalNodeServiceStart", + "description": [], + "path": "packages/core/node/core-node-server-internal/src/node_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-node-server-internal", + "id": "def-server.InternalNodeServiceStart.roles", + "type": "Object", + "tags": [], + "label": "roles", + "description": [ + "\nThe Kibana process can take on specialised roles via the `node.roles` config.\n\nThe roles can be used by plugins to adjust their behavior based\non the way the Kibana process has been configured." + ], + "signature": [ + { + "pluginId": "@kbn/core-node-server", + "scope": "server", + "docId": "kibKbnCoreNodeServerPluginApi", + "section": "def-server.NodeRoles", + "text": "NodeRoles" + } + ], + "path": "packages/core/node/core-node-server-internal/src/node_service.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-node-server-internal", + "id": "def-server.PrebootDeps", + "type": "Interface", + "tags": [], + "label": "PrebootDeps", + "description": [], + "path": "packages/core/node/core-node-server-internal/src/node_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-node-server-internal", + "id": "def-server.PrebootDeps.loggingSystem", + "type": "Object", + "tags": [], + "label": "loggingSystem", + "description": [], + "signature": [ + "ILoggingSystem" + ], + "path": "packages/core/node/core-node-server-internal/src/node_service.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], "enums": [], "misc": [], "objects": [ @@ -48,9 +113,21 @@ "label": "schema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ roles: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "<\"*\"[] | (\"ui\" | \"background_tasks\")[]>; }>" ], "path": "packages/core/node/core-node-server-internal/src/node_config.ts", diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index 8cef396b70f5a..8b37a2804b6ab 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] --- import kbnCoreNodeServerInternalObj from './kbn_core_node_server_internal.devdocs.json'; @@ -21,10 +21,13 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3 | 0 | 3 | 0 | +| 7 | 0 | 6 | 1 | ## Server ### Objects +### Interfaces + + diff --git a/api_docs/kbn_core_node_server_mocks.devdocs.json b/api_docs/kbn_core_node_server_mocks.devdocs.json index 1a763a4509417..58ff508cc61cd 100644 --- a/api_docs/kbn_core_node_server_mocks.devdocs.json +++ b/api_docs/kbn_core_node_server_mocks.devdocs.json @@ -59,6 +59,45 @@ "trackAdoption": false, "returnComment": [], "children": [] + }, + { + "parentPluginId": "@kbn/core-node-server-mocks", + "id": "def-server.nodeServiceMock.createInternalStartContract", + "type": "Function", + "tags": [], + "label": "createInternalStartContract", + "description": [], + "signature": [ + "({ ui, backgroundTasks, }?: { ui: boolean; backgroundTasks: boolean; }) => jest.Mocked<", + { + "pluginId": "@kbn/core-node-server-internal", + "scope": "server", + "docId": "kibKbnCoreNodeServerInternalPluginApi", + "section": "def-server.InternalNodeServiceStart", + "text": "InternalNodeServiceStart" + }, + ">" + ], + "path": "packages/core/node/core-node-server-mocks/src/node_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/core-node-server-mocks", + "id": "def-server.nodeServiceMock.createInternalStartContract.$1", + "type": "Object", + "tags": [], + "label": "__0", + "description": [], + "signature": [ + "{ ui: boolean; backgroundTasks: boolean; }" + ], + "path": "packages/core/node/core-node-server-mocks/src/node_service.mock.ts", + "deprecated": false, + "trackAdoption": false + } + ] } ], "initialIsOpen": false diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index e9a5a15b4a83e..c6b967a12f32f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] --- import kbnCoreNodeServerMocksObj from './kbn_core_node_server_mocks.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3 | 0 | 3 | 0 | +| 5 | 0 | 5 | 0 | ## Server diff --git a/api_docs/kbn_core_notifications_browser.devdocs.json b/api_docs/kbn_core_notifications_browser.devdocs.json index c9bcfa0a110d8..fdd20afaf2828 100644 --- a/api_docs/kbn_core_notifications_browser.devdocs.json +++ b/api_docs/kbn_core_notifications_browser.devdocs.json @@ -682,9 +682,21 @@ "Pick<", "Toast", ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\" | \"css\"> & { title?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; text?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; } & { id: string; }" ], "path": "packages/core/notifications/core-notifications-browser/src/types.ts", @@ -729,9 +741,21 @@ "Pick<", "Toast", ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\" | \"css\"> & { title?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; text?: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined; }" ], "path": "packages/core/notifications/core-notifications-browser/src/types.ts", diff --git a/api_docs/kbn_core_notifications_browser.mdx b/api_docs/kbn_core_notifications_browser.mdx index 0f5709318ce7f..beaa4adcb2913 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_notifications_browser_internal.devdocs.json index 0a1c85f066b80..a76ecdf8d28c0 100644 --- a/api_docs/kbn_core_notifications_browser_internal.devdocs.json +++ b/api_docs/kbn_core_notifications_browser_internal.devdocs.json @@ -56,7 +56,13 @@ "({ uiSettings }: ", "SetupDeps", ") => ", - "NotificationsSetup" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsSetup", + "text": "NotificationsSetup" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/notifications_service.ts", "deprecated": false, @@ -91,7 +97,13 @@ "({ i18n: i18nDep, overlays, theme, targetDomElement, }: ", "StartDeps", ") => ", - "NotificationsStart" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/notifications_service.ts", "deprecated": false, @@ -152,7 +164,13 @@ "text": "ToastsApi" }, " implements ", - "IToasts" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -191,7 +209,13 @@ "label": "uiSettings", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -215,7 +239,13 @@ "() => ", "Observable", "<", - "Toast", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + }, "[]>" ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", @@ -235,9 +265,21 @@ ], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ") => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -253,7 +295,13 @@ "- a {@link ToastInput }" ], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -276,7 +324,13 @@ ], "signature": [ "(toastOrId: string | ", - "Toast", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + }, ") => void" ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", @@ -294,7 +348,13 @@ ], "signature": [ "string | ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -315,11 +375,29 @@ ], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: ", - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -335,7 +413,13 @@ "- a {@link ToastInput }" ], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -352,7 +436,13 @@ "- a {@link ToastOptions }" ], "signature": [ - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined" ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", @@ -376,11 +466,29 @@ ], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: ", - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -396,7 +504,13 @@ "- a {@link ToastInput }" ], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -413,7 +527,13 @@ "- a {@link ToastOptions }" ], "signature": [ - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined" ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", @@ -437,11 +557,29 @@ ], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: ", - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -457,7 +595,13 @@ "- a {@link ToastInput }" ], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -474,7 +618,13 @@ "- a {@link ToastOptions }" ], "signature": [ - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined" ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", @@ -498,11 +648,29 @@ ], "signature": [ "(toastOrTitle: ", - "ToastInput", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + }, ", options?: ", - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined) => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -518,7 +686,13 @@ "- a {@link ToastInput }" ], "signature": [ - "ToastInput" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastInput", + "text": "ToastInput" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -535,7 +709,13 @@ "- a {@link ToastOptions }" ], "signature": [ - "ToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ToastOptions", + "text": "ToastOptions" + }, " | undefined" ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", @@ -559,9 +739,21 @@ ], "signature": [ "(error: Error, options: ", - "ErrorToastOptions", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + }, ") => ", - "Toast" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.Toast", + "text": "Toast" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -594,7 +786,13 @@ "- {@link ErrorToastOptions }" ], "signature": [ - "ErrorToastOptions" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.ErrorToastOptions", + "text": "ErrorToastOptions" + } ], "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx", "deprecated": false, @@ -625,11 +823,23 @@ "{ setup: ({ uiSettings }: ", "SetupDeps", ") => ", - "NotificationsSetup", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsSetup", + "text": "NotificationsSetup" + }, "; start: ({ i18n: i18nDep, overlays, theme, targetDomElement, }: ", "StartDeps", ") => ", - "NotificationsStart", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + }, "; stop: () => void; }" ], "path": "packages/core/notifications/core-notifications-browser-internal/src/notifications_service.ts", diff --git a/api_docs/kbn_core_notifications_browser_internal.mdx b/api_docs/kbn_core_notifications_browser_internal.mdx index 57b2aeba26822..97c9bf9001123 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_notifications_browser_mocks.devdocs.json index fcf364d484832..c0a98863dbbfc 100644 --- a/api_docs/kbn_core_notifications_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_notifications_browser_mocks.devdocs.json @@ -35,7 +35,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "NotificationsServiceContract", + { + "pluginId": "@kbn/core-notifications-browser-internal", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserInternalPluginApi", + "section": "def-common.NotificationsServiceContract", + "text": "NotificationsServiceContract" + }, ">" ], "path": "packages/core/notifications/core-notifications-browser-mocks/src/notifications_service.mock.ts", @@ -53,9 +59,21 @@ "description": [], "signature": [ "() => ", - "MockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.MockedKeys", + "text": "MockedKeys" + }, "<", - "NotificationsSetup", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsSetup", + "text": "NotificationsSetup" + }, ">" ], "path": "packages/core/notifications/core-notifications-browser-mocks/src/notifications_service.mock.ts", @@ -73,9 +91,21 @@ "description": [], "signature": [ "() => ", - "MockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.MockedKeys", + "text": "MockedKeys" + }, "<", - "NotificationsStart", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + }, ">" ], "path": "packages/core/notifications/core-notifications-browser-mocks/src/notifications_service.mock.ts", diff --git a/api_docs/kbn_core_notifications_browser_mocks.mdx b/api_docs/kbn_core_notifications_browser_mocks.mdx index bb99c045648cb..ae3047f6f271b 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_overlays_browser.devdocs.json index 96e3daf337c5a..00e0537ab6d02 100644 --- a/api_docs/kbn_core_overlays_browser.devdocs.json +++ b/api_docs/kbn_core_overlays_browser.devdocs.json @@ -42,7 +42,13 @@ ], "signature": [ "(mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", priority?: number | undefined) => string" ], "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", @@ -59,7 +65,13 @@ "{@link MountPoint }" ], "signature": [ - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", @@ -138,7 +150,13 @@ ], "signature": [ "(id: string | undefined, mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", priority?: number | undefined) => string" ], "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", @@ -172,7 +190,13 @@ "{@link MountPoint }" ], "signature": [ - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], "path": "packages/core/overlays/core-overlays-browser/src/banners.ts", @@ -384,7 +408,13 @@ ], "signature": [ "((flyout: ", - "OverlayRef", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + }, ") => void) | undefined" ], "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", @@ -399,7 +429,13 @@ "label": "flyout", "description": [], "signature": [ - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, @@ -438,7 +474,13 @@ ], "signature": [ "(mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", { "pluginId": "@kbn/core-overlays-browser", @@ -448,7 +490,13 @@ "text": "OverlayFlyoutOpenOptions" }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, @@ -464,7 +512,13 @@ "{@link MountPoint } - Mounts the children inside a flyout panel" ], "signature": [ - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", @@ -741,7 +795,13 @@ ], "signature": [ "(mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", { "pluginId": "@kbn/core-overlays-browser", @@ -751,7 +811,13 @@ "text": "OverlayModalOpenOptions" }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, @@ -767,7 +833,13 @@ "{@link MountPoint } - Mounts the children inside the modal" ], "signature": [ - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", @@ -813,7 +885,13 @@ ], "signature": [ "(message: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", { "pluginId": "@kbn/core-overlays-browser", @@ -839,7 +917,13 @@ ], "signature": [ "string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", @@ -921,7 +1005,13 @@ ], "signature": [ "(mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", { "pluginId": "@kbn/core-overlays-browser", @@ -931,7 +1021,13 @@ "text": "OverlayFlyoutOpenOptions" }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], "path": "packages/core/overlays/core-overlays-browser/src/overlays.ts", "deprecated": false, @@ -947,7 +1043,13 @@ "description": [], "signature": [ "(element: HTMLElement) => ", - "UnmountCallback" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.UnmountCallback", + "text": "UnmountCallback" + } ], "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false, @@ -964,7 +1066,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false } @@ -1004,7 +1106,13 @@ ], "signature": [ "(mount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", { "pluginId": "@kbn/core-overlays-browser", @@ -1014,7 +1122,13 @@ "text": "OverlayModalOpenOptions" }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], "path": "packages/core/overlays/core-overlays-browser/src/overlays.ts", "deprecated": false, @@ -1030,7 +1144,13 @@ "description": [], "signature": [ "(element: HTMLElement) => ", - "UnmountCallback" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.UnmountCallback", + "text": "UnmountCallback" + } ], "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", "deprecated": false, @@ -1047,7 +1167,7 @@ "signature": [ "T" ], - "path": "node_modules/@types/kbn__core-mount-utils-browser/index.d.ts", + "path": "packages/core/mount-utils/core-mount-utils-browser/src/mount_point.ts", "deprecated": false, "trackAdoption": false } @@ -1087,7 +1207,13 @@ ], "signature": [ "(message: string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, ", options?: ", { "pluginId": "@kbn/core-overlays-browser", @@ -1112,7 +1238,13 @@ "description": [], "signature": [ "string | ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], "path": "packages/core/overlays/core-overlays-browser/src/modal.ts", diff --git a/api_docs/kbn_core_overlays_browser.mdx b/api_docs/kbn_core_overlays_browser.mdx index d5f0fbadaca84..35318d00398ed 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser'] --- import kbnCoreOverlaysBrowserObj from './kbn_core_overlays_browser.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 63 | 0 | 35 | 0 | +| 63 | 0 | 37 | 0 | ## Common diff --git a/api_docs/kbn_core_overlays_browser_internal.devdocs.json b/api_docs/kbn_core_overlays_browser_internal.devdocs.json index dc445a5b23b20..109e99fce2e52 100644 --- a/api_docs/kbn_core_overlays_browser_internal.devdocs.json +++ b/api_docs/kbn_core_overlays_browser_internal.devdocs.json @@ -36,7 +36,13 @@ "text": "InternalOverlayBannersStart" }, " extends ", - "OverlayBannersStart" + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayBannersStart", + "text": "OverlayBannersStart" + } ], "path": "packages/core/overlays/core-overlays-browser-internal/src/banners/banners_service.tsx", "deprecated": false, diff --git a/api_docs/kbn_core_overlays_browser_internal.mdx b/api_docs/kbn_core_overlays_browser_internal.mdx index 04c3b267d276b..9ea44c8e0160e 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-internal'] --- import kbnCoreOverlaysBrowserInternalObj from './kbn_core_overlays_browser_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1 | 0 | 1 | 0 | +| 1 | 0 | 1 | 1 | ## Common diff --git a/api_docs/kbn_core_overlays_browser_mocks.devdocs.json b/api_docs/kbn_core_overlays_browser_mocks.devdocs.json index f85faeed0734c..9843f80b312ec 100644 --- a/api_docs/kbn_core_overlays_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_overlays_browser_mocks.devdocs.json @@ -35,7 +35,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", "OverlayService", ">>" @@ -55,9 +61,21 @@ "description": [], "signature": [ "() => ", - "DeeplyMockedKeys", + { + "pluginId": "@kbn/utility-types-jest", + "scope": "server", + "docId": "kibKbnUtilityTypesJestPluginApi", + "section": "def-server.DeeplyMockedKeys", + "text": "DeeplyMockedKeys" + }, "<", - "OverlayStart", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + }, ">" ], "path": "packages/core/overlays/core-overlays-browser-mocks/src/overlay_service.mock.ts", diff --git a/api_docs/kbn_core_overlays_browser_mocks.mdx b/api_docs/kbn_core_overlays_browser_mocks.mdx index 9d99952c7e017..93f4104ec0024 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_plugins_browser.devdocs.json index 6f6473053dc30..1ce9836dbdde5 100644 --- a/api_docs/kbn_core_plugins_browser.devdocs.json +++ b/api_docs/kbn_core_plugins_browser.devdocs.json @@ -52,7 +52,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ", plugins: TPluginsSetup) => TSetup" ], "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", @@ -67,7 +73,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", @@ -102,7 +114,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", plugins: TPluginsStart) => TStart" ], "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", @@ -117,7 +135,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "packages/core/plugins/core-plugins-browser/src/plugin.ts", "deprecated": false, @@ -209,15 +233,47 @@ "description": [], "signature": [ "{ mode: Readonly<", - "EnvironmentMode", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.EnvironmentMode", + "text": "EnvironmentMode" + }, ">; packageInfo: Readonly<", - "PackageInfo", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + }, ">; }" ], "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/core-plugins-browser", + "id": "def-common.PluginInitializerContext.logger", + "type": "Object", + "tags": [], + "label": "logger", + "description": [], + "signature": [ + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + } + ], + "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/core-plugins-browser", "id": "def-common.PluginInitializerContext.config", diff --git a/api_docs/kbn_core_plugins_browser.mdx b/api_docs/kbn_core_plugins_browser.mdx index 05dacbbef9b84..8af23b7976048 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser'] --- import kbnCorePluginsBrowserObj from './kbn_core_plugins_browser.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 14 | 0 | 10 | 0 | +| 15 | 0 | 11 | 0 | ## Common diff --git a/api_docs/kbn_core_plugins_browser_mocks.devdocs.json b/api_docs/kbn_core_plugins_browser_mocks.devdocs.json index 7f22d9fda85ce..5671c40bc1f8c 100644 --- a/api_docs/kbn_core_plugins_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_plugins_browser_mocks.devdocs.json @@ -93,7 +93,13 @@ "description": [], "signature": [ "(config?: unknown) => ", - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "" ], "path": "packages/core/plugins/core-plugins-browser-mocks/src/plugins_service.mock.ts", diff --git a/api_docs/kbn_core_plugins_browser_mocks.mdx b/api_docs/kbn_core_plugins_browser_mocks.mdx index e6893cec31677..51fe2008e3e48 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser-mocks'] --- import kbnCorePluginsBrowserMocksObj from './kbn_core_plugins_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server.devdocs.json b/api_docs/kbn_core_plugins_server.devdocs.json new file mode 100644 index 0000000000000..9dc1958b3cbe7 --- /dev/null +++ b/api_docs/kbn_core_plugins_server.devdocs.json @@ -0,0 +1,1303 @@ +{ + "id": "@kbn/core-plugins-server", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.AsyncPlugin", + "type": "Interface", + "tags": [ + "deprecated" + ], + "label": "AsyncPlugin", + "description": [ + "\nA plugin with asynchronous lifecycle methods.\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.AsyncPlugin", + "text": "AsyncPlugin" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": true, + "removeBy": "8.8.0", + "trackAdoption": false, + "references": [ + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/plugin.ts" + }, + { + "plugin": "core", + "path": "src/core/server/index.ts" + } + ], + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.AsyncPlugin.setup", + "type": "Function", + "tags": [], + "label": "setup", + "description": [], + "signature": [ + "(core: ", + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + ", plugins: TPluginsSetup) => TSetup | Promise" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.AsyncPlugin.setup.$1", + "type": "Object", + "tags": [], + "label": "core", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.AsyncPlugin.setup.$2", + "type": "Uncategorized", + "tags": [], + "label": "plugins", + "description": [], + "signature": [ + "TPluginsSetup" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.AsyncPlugin.start", + "type": "Function", + "tags": [], + "label": "start", + "description": [], + "signature": [ + "(core: ", + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + }, + ", plugins: TPluginsStart) => TStart | Promise" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.AsyncPlugin.start.$1", + "type": "Object", + "tags": [], + "label": "core", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + } + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.AsyncPlugin.start.$2", + "type": "Uncategorized", + "tags": [], + "label": "plugins", + "description": [], + "signature": [ + "TPluginsStart" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.AsyncPlugin.stop", + "type": "Function", + "tags": [], + "label": "stop", + "description": [], + "signature": [ + "(() => void) | undefined" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.Plugin", + "type": "Interface", + "tags": [], + "label": "Plugin", + "description": [ + "\nThe interface that should be returned by a `PluginInitializer` for a `standard` plugin.\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.Plugin", + "text": "Plugin" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.Plugin.setup", + "type": "Function", + "tags": [], + "label": "setup", + "description": [], + "signature": [ + "(core: ", + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + ", plugins: TPluginsSetup) => TSetup" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.Plugin.setup.$1", + "type": "Object", + "tags": [], + "label": "core", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.Plugin.setup.$2", + "type": "Uncategorized", + "tags": [], + "label": "plugins", + "description": [], + "signature": [ + "TPluginsSetup" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.Plugin.start", + "type": "Function", + "tags": [], + "label": "start", + "description": [], + "signature": [ + "(core: ", + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + }, + ", plugins: TPluginsStart) => TStart" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.Plugin.start.$1", + "type": "Object", + "tags": [], + "label": "core", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + } + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.Plugin.start.$2", + "type": "Uncategorized", + "tags": [], + "label": "plugins", + "description": [], + "signature": [ + "TPluginsStart" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.Plugin.stop", + "type": "Function", + "tags": [], + "label": "stop", + "description": [], + "signature": [ + "(() => void) | undefined" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginConfigDescriptor", + "type": "Interface", + "tags": [], + "label": "PluginConfigDescriptor", + "description": [ + "\nDescribes a plugin configuration properties.\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.PluginConfigDescriptor", + "text": "PluginConfigDescriptor" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginConfigDescriptor.deprecations", + "type": "Function", + "tags": [], + "label": "deprecations", + "description": [ + "\nProvider for the {@link ConfigDeprecation} to apply to the plugin configuration." + ], + "signature": [ + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationProvider", + "text": "ConfigDeprecationProvider" + }, + " | undefined" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginConfigDescriptor.exposeToBrowser", + "type": "Object", + "tags": [], + "label": "exposeToBrowser", + "description": [ + "\nList of configuration properties that will be available on the client-side plugin." + ], + "signature": [ + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.ExposedToBrowserDescriptor", + "text": "ExposedToBrowserDescriptor" + }, + " | undefined" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginConfigDescriptor.schema", + "type": "Object", + "tags": [], + "label": "schema", + "description": [ + "\nSchema to use to validate the plugin configuration.\n\n{@link PluginConfigSchema}" + ], + "signature": [ + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginConfigDescriptor.exposeToUsage", + "type": "Object", + "tags": [], + "label": "exposeToUsage", + "description": [ + "\nExpose non-default configs to usage collection to be sent via telemetry.\nset a config to `true` to report the actual changed config value.\nset a config to `false` to report the changed config value as [redacted].\n\nAll changed configs except booleans and numbers will be reported\nas [redacted] unless otherwise specified.\n\n{@link MakeUsageFromSchema}" + ], + "signature": [ + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.MakeUsageFromSchema", + "text": "MakeUsageFromSchema" + }, + " | undefined" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginInitializerContext", + "type": "Interface", + "tags": [], + "label": "PluginInitializerContext", + "description": [ + "\nContext that's available to plugins during initialization stage.\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.PluginInitializerContext", + "text": "PluginInitializerContext" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginInitializerContext.opaqueId", + "type": "Uncategorized", + "tags": [], + "label": "opaqueId", + "description": [], + "signature": [ + "symbol" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginInitializerContext.env", + "type": "Object", + "tags": [], + "label": "env", + "description": [], + "signature": [ + "{ mode: ", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.EnvironmentMode", + "text": "EnvironmentMode" + }, + "; packageInfo: Readonly<", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + }, + ">; instanceUuid: string; configs: readonly string[]; }" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginInitializerContext.node", + "type": "Object", + "tags": [], + "label": "node", + "description": [ + "\nAccess the configuration for this particular Kibana node.\nCan be used to determine which `roles` the current process was started with.\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-node-server", + "scope": "server", + "docId": "kibKbnCoreNodeServerPluginApi", + "section": "def-server.NodeInfo", + "text": "NodeInfo" + } + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginInitializerContext.logger", + "type": "Object", + "tags": [], + "label": "logger", + "description": [ + "\n{@link LoggerFactory | logger factory} instance already bound to the plugin's logging context\n" + ], + "signature": [ + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + } + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginInitializerContext.config", + "type": "Object", + "tags": [], + "label": "config", + "description": [ + "\nAccessors for the plugin's configuration" + ], + "signature": [ + "{ legacy: { globalConfig$: ", + "Observable", + " moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; isLessThan: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; isEqualTo: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: ", + "ByteSizeValueUnit", + " | undefined) => string; }>; }>; }>>; get: () => Readonly<{ elasticsearch: Readonly<{ readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; isLessThan: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; isEqualTo: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: ", + "ByteSizeValueUnit", + " | undefined) => string; }>; }>; }>; }; create: () => ", + "Observable", + "; get: () => T; }" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest", + "type": "Interface", + "tags": [], + "label": "PluginManifest", + "description": [ + "\nDescribes the set of required and optional properties plugin can define in its\nmandatory JSON manifest file.\n" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.id", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "\nIdentifier of the plugin. Must be a string in camelCase. Part of a plugin public contract.\nOther plugins leverage it to access plugin API, navigate to the plugin, etc." + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.version", + "type": "string", + "tags": [], + "label": "version", + "description": [ + "\nVersion of the plugin." + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.kibanaVersion", + "type": "string", + "tags": [], + "label": "kibanaVersion", + "description": [ + "\nThe version of Kibana the plugin is compatible with, defaults to \"version\"." + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.type", + "type": "Enum", + "tags": [], + "label": "type", + "description": [ + "\nType of the plugin, defaults to `standard`." + ], + "signature": [ + { + "pluginId": "@kbn/core-base-common", + "scope": "server", + "docId": "kibKbnCoreBaseCommonPluginApi", + "section": "def-server.PluginType", + "text": "PluginType" + } + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.configPath", + "type": "CompoundType", + "tags": [], + "label": "configPath", + "description": [ + "\nRoot {@link ConfigPath | configuration path} used by the plugin, defaults\nto \"id\" in snake_case format.\n" + ], + "signature": [ + "string | string[]" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.requiredPlugins", + "type": "Object", + "tags": [], + "label": "requiredPlugins", + "description": [ + "\nAn optional list of the other plugins that **must be** installed and enabled\nfor this plugin to function properly." + ], + "signature": [ + "readonly string[]" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.requiredBundles", + "type": "Object", + "tags": [], + "label": "requiredBundles", + "description": [ + "\nList of plugin ids that this plugin's UI code imports modules from that are\nnot in `requiredPlugins`.\n" + ], + "signature": [ + "readonly string[]" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.optionalPlugins", + "type": "Object", + "tags": [], + "label": "optionalPlugins", + "description": [ + "\nAn optional list of the other plugins that if installed and enabled **may be**\nleveraged by this plugin for some additional functionality but otherwise are\nnot required for this plugin to work properly." + ], + "signature": [ + "readonly string[]" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.ui", + "type": "boolean", + "tags": [], + "label": "ui", + "description": [ + "\nSpecifies whether plugin includes some client/browser specific functionality\nthat should be included into client bundle via `public/ui_plugin.js` file." + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.server", + "type": "boolean", + "tags": [], + "label": "server", + "description": [ + "\nSpecifies whether plugin includes some server-side specific functionality." + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.extraPublicDirs", + "type": "Array", + "tags": [ + "deprecated" + ], + "label": "extraPublicDirs", + "description": [ + "\nSpecifies directory names that can be imported by other ui-plugins built\nusing the same instance of the @kbn/optimizer. A temporary measure we plan\nto replace with better mechanisms for sharing static code between plugins" + ], + "signature": [ + "string[] | undefined" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": true, + "trackAdoption": false, + "references": [ + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + }, + { + "plugin": "@kbn/core-plugins-server-internal", + "path": "packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts" + } + ] + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.serviceFolders", + "type": "Object", + "tags": [], + "label": "serviceFolders", + "description": [ + "\nOnly used for the automatically generated API documentation. Specifying service\nfolders will cause your plugin API reference to be broken up into sub sections." + ], + "signature": [ + "readonly string[] | undefined" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.owner", + "type": "Object", + "tags": [], + "label": "owner", + "description": [], + "signature": [ + "{ readonly name: string; readonly githubTeam?: string | undefined; }" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.description", + "type": "string", + "tags": [], + "label": "description", + "description": [ + "\nTODO: make required once all plugins specify this.\nA brief description of what this plugin does and any capabilities it provides." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginManifest.enabledOnAnonymousPages", + "type": "CompoundType", + "tags": [], + "label": "enabledOnAnonymousPages", + "description": [ + "\nSpecifies whether this plugin - and its required dependencies - will be enabled for anonymous pages (login page, status page when\nconfigured, etc.) Default is false." + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PrebootPlugin", + "type": "Interface", + "tags": [], + "label": "PrebootPlugin", + "description": [ + "\nThe interface that should be returned by a `PluginInitializer` for a `preboot` plugin.\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.PrebootPlugin", + "text": "PrebootPlugin" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PrebootPlugin.setup", + "type": "Function", + "tags": [], + "label": "setup", + "description": [], + "signature": [ + "(core: ", + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CorePreboot", + "text": "CorePreboot" + }, + ", plugins: TPluginsSetup) => TSetup" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PrebootPlugin.setup.$1", + "type": "Object", + "tags": [], + "label": "core", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CorePreboot", + "text": "CorePreboot" + } + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PrebootPlugin.setup.$2", + "type": "Uncategorized", + "tags": [], + "label": "plugins", + "description": [], + "signature": [ + "TPluginsSetup" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PrebootPlugin.stop", + "type": "Function", + "tags": [], + "label": "stop", + "description": [], + "signature": [ + "(() => void) | undefined" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.ExposedToBrowserDescriptor", + "type": "Type", + "tags": [], + "label": "ExposedToBrowserDescriptor", + "description": [ + "\nType defining the list of configuration properties that will be exposed on the client-side\nObject properties can either be fully exposed\n" + ], + "signature": [ + "{ [Key in keyof T]?: (T[Key] extends Maybe ? boolean : T[Key] extends Maybe ? boolean | ", + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.ExposedToBrowserDescriptor", + "text": "ExposedToBrowserDescriptor" + }, + " : boolean) | undefined; }" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.MakeUsageFromSchema", + "type": "Type", + "tags": [], + "label": "MakeUsageFromSchema", + "description": [ + "\nList of configuration values that will be exposed to usage collection.\nIf parent node or actual config path is set to `true` then the actual value\nof these configs will be reoprted.\nIf parent node or actual config path is set to `false` then the config\nwill be reported as [redacted].\n" + ], + "signature": [ + "{ [Key in keyof T]?: (T[Key] extends Maybe ? false : T[Key] extends Maybe ? boolean : T[Key] extends Maybe ? boolean | ", + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.MakeUsageFromSchema", + "text": "MakeUsageFromSchema" + }, + " : boolean) | undefined; }" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginConfigSchema", + "type": "Type", + "tags": [], + "label": "PluginConfigSchema", + "description": [ + "\nDedicated type for plugin configuration schema.\n" + ], + "signature": [ + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginInitializer", + "type": "Type", + "tags": [], + "label": "PluginInitializer", + "description": [ + "\nThe `plugin` export at the root of a plugin's `server` directory should conform\nto this interface.\n" + ], + "signature": [ + "(core: ", + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.PluginInitializerContext", + "text": "PluginInitializerContext" + }, + ") => ", + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.Plugin", + "text": "Plugin" + }, + " | ", + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.PrebootPlugin", + "text": "PrebootPlugin" + }, + " | ", + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.AsyncPlugin", + "text": "AsyncPlugin" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.PluginInitializer.$1", + "type": "Object", + "tags": [], + "label": "core", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-plugins-server", + "scope": "server", + "docId": "kibKbnCorePluginsServerPluginApi", + "section": "def-server.PluginInitializerContext", + "text": "PluginInitializerContext" + }, + "" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.SharedGlobalConfig", + "type": "Type", + "tags": [], + "label": "SharedGlobalConfig", + "description": [], + "signature": [ + "{ readonly elasticsearch: Readonly<{ readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: moment.unitOfTime.DurationConstructor | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; format: moment.Format; }>; }>; readonly path: Readonly<{ readonly data: string; }>; readonly savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; isLessThan: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; isEqualTo: (other: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, + ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: ", + "ByteSizeValueUnit", + " | undefined) => string; }>; }>; }" + ], + "path": "packages/core/plugins/core-plugins-server/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.SharedGlobalConfigKeys", + "type": "Object", + "tags": [], + "label": "SharedGlobalConfigKeys", + "description": [], + "path": "packages/core/plugins/core-plugins-server/src/shared_global_config.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.SharedGlobalConfigKeys.elasticsearch", + "type": "Object", + "tags": [], + "label": "elasticsearch", + "description": [ + "// We can add more if really needed" + ], + "signature": [ + "readonly [\"shardTimeout\", \"requestTimeout\", \"pingTimeout\"]" + ], + "path": "packages/core/plugins/core-plugins-server/src/shared_global_config.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.SharedGlobalConfigKeys.path", + "type": "Object", + "tags": [], + "label": "path", + "description": [], + "signature": [ + "readonly [\"data\"]" + ], + "path": "packages/core/plugins/core-plugins-server/src/shared_global_config.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-plugins-server", + "id": "def-server.SharedGlobalConfigKeys.savedObjects", + "type": "Object", + "tags": [], + "label": "savedObjects", + "description": [], + "signature": [ + "readonly [\"maxImportPayloadBytes\"]" + ], + "path": "packages/core/plugins/core-plugins-server/src/shared_global_config.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_plugins_server.mdx b/api_docs/kbn_core_plugins_server.mdx new file mode 100644 index 0000000000000..4895feb78fb93 --- /dev/null +++ b/api_docs/kbn_core_plugins_server.mdx @@ -0,0 +1,36 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCorePluginsServerPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server'] +--- +import kbnCorePluginsServerObj from './kbn_core_plugins_server.devdocs.json'; + + + +Contact Kibana Core for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 58 | 0 | 26 | 0 | + +## Server + +### Objects + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_core_plugins_server_mocks.devdocs.json b/api_docs/kbn_core_plugins_server_mocks.devdocs.json new file mode 100644 index 0000000000000..e7e11c0504caa --- /dev/null +++ b/api_docs/kbn_core_plugins_server_mocks.devdocs.json @@ -0,0 +1,107 @@ +{ + "id": "@kbn/core-plugins-server-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [ + { + "parentPluginId": "@kbn/core-plugins-server-mocks", + "id": "def-server.pluginServiceMock", + "type": "Object", + "tags": [], + "label": "pluginServiceMock", + "description": [], + "path": "packages/core/plugins/core-plugins-server-mocks/src/plugins_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-plugins-server-mocks", + "id": "def-server.pluginServiceMock.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [], + "signature": [ + "() => PluginsServiceMock" + ], + "path": "packages/core/plugins/core-plugins-server-mocks/src/plugins_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-plugins-server-mocks", + "id": "def-server.pluginServiceMock.createSetupContract", + "type": "Function", + "tags": [], + "label": "createSetupContract", + "description": [], + "signature": [ + "() => ", + "PluginsServiceSetup" + ], + "path": "packages/core/plugins/core-plugins-server-mocks/src/plugins_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-plugins-server-mocks", + "id": "def-server.pluginServiceMock.createStartContract", + "type": "Function", + "tags": [], + "label": "createStartContract", + "description": [], + "signature": [ + "() => { contracts: Map; }" + ], + "path": "packages/core/plugins/core-plugins-server-mocks/src/plugins_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-plugins-server-mocks", + "id": "def-server.pluginServiceMock.createUiPlugins", + "type": "Function", + "tags": [], + "label": "createUiPlugins", + "description": [], + "signature": [ + "() => { browserConfigs: Map; internal: Map; public: Map; }" + ], + "path": "packages/core/plugins/core-plugins-server-mocks/src/plugins_service.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + } + ], + "initialIsOpen": false + } + ] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_plugins_server_mocks.mdx b/api_docs/kbn_core_plugins_server_mocks.mdx new file mode 100644 index 0000000000000..88b7c77a3913e --- /dev/null +++ b/api_docs/kbn_core_plugins_server_mocks.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: kibKbnCorePluginsServerMocksPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server-mocks'] +--- +import kbnCorePluginsServerMocksObj from './kbn_core_plugins_server_mocks.devdocs.json'; + + + +Contact Kibana Core for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 5 | 0 | 5 | 0 | + +## Server + +### Objects + + diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index aa6f7b411df15..9a4320a2413f0 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_preboot_server_mocks.devdocs.json index dc65fa2926d2f..efd10a267bbb8 100644 --- a/api_docs/kbn_core_preboot_server_mocks.devdocs.json +++ b/api_docs/kbn_core_preboot_server_mocks.devdocs.json @@ -39,7 +39,13 @@ "description": [], "signature": [ "{ readonly isSetupOnHold: jest.MockInstance; readonly holdSetupUntilResolved: jest.MockInstance]>; } & ", - "PrebootServicePreboot" + { + "pluginId": "@kbn/core-preboot-server", + "scope": "server", + "docId": "kibKbnCorePrebootServerPluginApi", + "section": "def-server.PrebootServicePreboot", + "text": "PrebootServicePreboot" + } ], "path": "packages/core/preboot/core-preboot-server-mocks/src/preboot_service.mock.ts", "deprecated": false, diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index 6bd0c8018cf40..e1a3672dd9226 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] --- import kbnCorePrebootServerMocksObj from './kbn_core_preboot_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_browser_mocks.mdx b/api_docs/kbn_core_rendering_browser_mocks.mdx index 8e928b38d3ca8..96ba927151204 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: 2022-10-25 +date: 2022-11-07 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 5785f1a688416..18b79f2043ec7 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-internal'] --- import kbnCoreRenderingServerInternalObj from './kbn_core_rendering_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2 | 0 | 2 | 0 | +| 2 | 0 | 2 | 1 | ## Server diff --git a/api_docs/kbn_core_rendering_server_mocks.mdx b/api_docs/kbn_core_rendering_server_mocks.mdx index 6aecd30d2f93d..cd0b7d5e00cbf 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: 2022-10-25 +date: 2022-11-07 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_saved_objects_api_browser.devdocs.json b/api_docs/kbn_core_saved_objects_api_browser.devdocs.json index 06e843f3cd6f5..94f6b814699f3 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_browser.devdocs.json @@ -363,7 +363,13 @@ "label": "error", "description": [], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_delete.ts", @@ -497,7 +503,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts", @@ -814,7 +826,13 @@ ], "signature": [ "(objects: ", - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[], options?: ", { "pluginId": "@kbn/core-saved-objects-api-browser", @@ -847,7 +865,13 @@ "- an array of objects containing id, type" ], "signature": [ - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", @@ -1020,7 +1044,13 @@ ], "signature": [ "(objects: ", - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]) => Promise<", { "pluginId": "@kbn/core-saved-objects-api-browser", @@ -1045,7 +1075,13 @@ "- an array ids, or an array of objects containing id and optionally type" ], "signature": [ - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", @@ -1132,7 +1168,13 @@ ], "signature": [ "(objects: ", - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]) => Promise<", { "pluginId": "@kbn/core-saved-objects-api-browser", @@ -1157,7 +1199,13 @@ "- an array of objects containing id, type" ], "signature": [ - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/saved_objects_client.ts", @@ -1392,7 +1440,13 @@ "{@inheritDoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts", @@ -1423,7 +1477,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts", @@ -1637,7 +1697,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/update.ts", @@ -1728,7 +1794,13 @@ "label": "migrationVersion", "description": [], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", @@ -1757,7 +1829,13 @@ "label": "error", "description": [], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", @@ -1772,7 +1850,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts", @@ -1991,13 +2075,37 @@ "{ type: string | string[]; filter?: any; search?: string | undefined; fields?: string[] | undefined; aggs?: Record | undefined; page?: number | undefined; perPage?: number | undefined; sortField?: string | undefined; searchFields?: string[] | undefined; hasReference?: ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined; hasReferenceOperator?: \"AND\" | \"OR\" | undefined; hasNoReference?: ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined; hasNoReferenceOperator?: \"AND\" | \"OR\" | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; namespaces?: string[] | undefined; preference?: string | undefined; }" ], "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/find.ts", diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index bc8b99be1a1ab..6758b2bf59ded 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: 2022-10-25 +date: 2022-11-07 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 cae43e5b22b0d..9f0fd0f2b409c 100644 --- a/api_docs/kbn_core_saved_objects_api_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_server.devdocs.json @@ -118,7 +118,13 @@ "text": "SavedObjectsCreateOptions" }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", @@ -879,7 +885,13 @@ "text": "SavedObjectsBaseOptions" }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", @@ -1554,7 +1566,13 @@ "text": "SavedObjectsIncrementCounterOptions" }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", @@ -2147,7 +2165,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", @@ -2164,7 +2188,13 @@ "{@inheritDoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_create.ts", @@ -2421,7 +2451,13 @@ "Reason the object could not be deleted (success is false)" ], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/bulk_delete.ts", @@ -2617,7 +2653,13 @@ "label": "saved_objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/base.ts", @@ -2882,7 +2924,13 @@ "description": [], "signature": [ "{ id: string; type: string; error: ", - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, "; }[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/check_conflicts.ts", @@ -2924,7 +2972,13 @@ "text": "SavedObjectsCreateOptions" }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", @@ -3490,7 +3544,13 @@ "text": "SavedObjectsBaseOptions" }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", @@ -4703,7 +4763,13 @@ "{@inheritDoc SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", @@ -4734,7 +4800,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/create.ts", @@ -5538,7 +5610,13 @@ "text": "SavedObjectsFindResult" }, " extends ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts", @@ -5674,7 +5752,13 @@ "{@link SavedObjectsMigrationVersion}" ], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/increment_counter.ts", @@ -5979,7 +6063,13 @@ "\nThe saved object that was found." ], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/resolve.ts", @@ -6237,7 +6327,13 @@ "Included if there was an error updating this object's spaces" ], "signature": [ - "SavedObjectError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectError", + "text": "SavedObjectError" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update_objects_spaces.ts", @@ -6303,7 +6399,13 @@ "{@inheritdoc SavedObjectReference}" ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", @@ -6386,7 +6488,13 @@ "text": "SavedObjectsUpdateResponse" }, " extends Omit<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ", \"attributes\" | \"references\">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", @@ -6415,7 +6523,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server/src/apis/update.ts", diff --git a/api_docs/kbn_core_saved_objects_api_server.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index aef4200a17976..51e27ae852177 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: 2022-10-25 +date: 2022-11-07 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_internal.devdocs.json b/api_docs/kbn_core_saved_objects_api_server_internal.devdocs.json index 79c17d6086eef..18ce6c3676d88 100644 --- a/api_docs/kbn_core_saved_objects_api_server_internal.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_server_internal.devdocs.json @@ -26,7 +26,13 @@ "text": "SavedObjectsRepository" }, " implements ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -43,9 +49,21 @@ ], "signature": [ "(type: string, attributes: T, options?: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -90,7 +108,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCreateOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -111,11 +135,29 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "[], options?: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, ") => Promise<", - "SavedObjectsBulkResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -130,7 +172,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkCreateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -146,7 +194,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCreateOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -167,11 +221,29 @@ ], "signature": [ "(objects?: ", - "SavedObjectsCheckConflictsObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsObject", + "text": "SavedObjectsCheckConflictsObject" + }, "[], options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, ") => Promise<", - "SavedObjectsCheckConflictsResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsResponse", + "text": "SavedObjectsCheckConflictsResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -186,7 +258,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsCheckConflictsObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCheckConflictsObject", + "text": "SavedObjectsCheckConflictsObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -202,7 +280,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -223,7 +307,13 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + }, ") => Promise<{}>" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -268,7 +358,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsDeleteOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -289,11 +385,29 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkDeleteObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteObject", + "text": "SavedObjectsBulkDeleteObject" + }, "[], options?: ", - "SavedObjectsBulkDeleteOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + }, ") => Promise<", - "SavedObjectsBulkDeleteResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteResponse", + "text": "SavedObjectsBulkDeleteResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -308,7 +422,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkDeleteObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteObject", + "text": "SavedObjectsBulkDeleteObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -324,7 +444,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBulkDeleteOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteOptions", + "text": "SavedObjectsBulkDeleteOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -345,7 +471,13 @@ ], "signature": [ "(namespace: string, options?: ", - "SavedObjectsDeleteByNamespaceOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteByNamespaceOptions", + "text": "SavedObjectsDeleteByNamespaceOptions" + }, ") => Promise" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -375,7 +507,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsDeleteByNamespaceOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsDeleteByNamespaceOptions", + "text": "SavedObjectsDeleteByNamespaceOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -396,9 +534,21 @@ ], "signature": [ "(options: ", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ") => Promise<", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -413,7 +563,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsFindOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -434,11 +590,29 @@ ], "signature": [ "(objects?: ", - "SavedObjectsBulkGetObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkGetObject", + "text": "SavedObjectsBulkGetObject" + }, "[], options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, ") => Promise<", - "SavedObjectsBulkResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -453,7 +627,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkGetObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkGetObject", + "text": "SavedObjectsBulkGetObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -469,7 +649,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -490,11 +676,29 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkResolveObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveObject", + "text": "SavedObjectsBulkResolveObject" + }, "[], options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, ") => Promise<", - "SavedObjectsBulkResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveResponse", + "text": "SavedObjectsBulkResolveResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -509,7 +713,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkResolveObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkResolveObject", + "text": "SavedObjectsBulkResolveObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -525,7 +735,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -546,9 +762,21 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, ") => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -593,7 +821,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -614,9 +848,21 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, ") => Promise<", - "SavedObjectsResolveResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsResolveResponse", + "text": "SavedObjectsResolveResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -661,7 +907,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -682,9 +934,21 @@ ], "signature": [ "(type: string, id: string, attributes: Partial, options?: ", - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, ") => Promise<", - "SavedObjectsUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -744,7 +1008,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -766,11 +1036,29 @@ ], "signature": [ "(objects: ", - "SavedObjectsCollectMultiNamespaceReferencesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesObject", + "text": "SavedObjectsCollectMultiNamespaceReferencesObject" + }, "[], options?: ", - "SavedObjectsCollectMultiNamespaceReferencesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesOptions", + "text": "SavedObjectsCollectMultiNamespaceReferencesOptions" + }, " | undefined) => Promise<", - "SavedObjectsCollectMultiNamespaceReferencesResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesResponse", + "text": "SavedObjectsCollectMultiNamespaceReferencesResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -785,7 +1073,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesObject", + "text": "SavedObjectsCollectMultiNamespaceReferencesObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -801,7 +1095,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsCollectMultiNamespaceReferencesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesOptions", + "text": "SavedObjectsCollectMultiNamespaceReferencesOptions" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -823,11 +1123,29 @@ ], "signature": [ "(objects: ", - "SavedObjectsUpdateObjectsSpacesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesObject", + "text": "SavedObjectsUpdateObjectsSpacesObject" + }, "[], spacesToAdd: string[], spacesToRemove: string[], options?: ", - "SavedObjectsUpdateObjectsSpacesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesOptions", + "text": "SavedObjectsUpdateObjectsSpacesOptions" + }, " | undefined) => Promise<", - "SavedObjectsUpdateObjectsSpacesResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesResponse", + "text": "SavedObjectsUpdateObjectsSpacesResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -842,7 +1160,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsUpdateObjectsSpacesObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesObject", + "text": "SavedObjectsUpdateObjectsSpacesObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -888,7 +1212,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsUpdateObjectsSpacesOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesOptions", + "text": "SavedObjectsUpdateObjectsSpacesOptions" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -910,11 +1240,29 @@ ], "signature": [ "(objects: ", - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "[], options?: ", - "SavedObjectsBulkUpdateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateOptions", + "text": "SavedObjectsBulkUpdateOptions" + }, ") => Promise<", - "SavedObjectsBulkUpdateResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateResponse", + "text": "SavedObjectsBulkUpdateResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -929,7 +1277,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObjectsBulkUpdateObject", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -945,7 +1299,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBulkUpdateOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkUpdateOptions", + "text": "SavedObjectsBulkUpdateOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -966,9 +1326,21 @@ ], "signature": [ "(type: string, id: string, options?: ", - "SavedObjectsRemoveReferencesToOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToOptions", + "text": "SavedObjectsRemoveReferencesToOptions" + }, ") => Promise<", - "SavedObjectsRemoveReferencesToResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToResponse", + "text": "SavedObjectsRemoveReferencesToResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -1013,7 +1385,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsRemoveReferencesToOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToOptions", + "text": "SavedObjectsRemoveReferencesToOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -1034,11 +1412,29 @@ ], "signature": [ "(type: string, id: string, counterFields: (string | ", - "SavedObjectsIncrementCounterField", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterField", + "text": "SavedObjectsIncrementCounterField" + }, ")[], options?: ", - "SavedObjectsIncrementCounterOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterOptions", + "text": "SavedObjectsIncrementCounterOptions" + }, " | undefined) => Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -1084,7 +1480,13 @@ "description": [], "signature": [ "(string | ", - "SavedObjectsIncrementCounterField", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterField", + "text": "SavedObjectsIncrementCounterField" + }, ")[]" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -1100,7 +1502,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsIncrementCounterOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsIncrementCounterOptions", + "text": "SavedObjectsIncrementCounterOptions" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -1122,9 +1530,21 @@ ], "signature": [ "(type: string | string[], { keepAlive, preference }?: ", - "SavedObjectsOpenPointInTimeOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeOptions", + "text": "SavedObjectsOpenPointInTimeOptions" + }, ") => Promise<", - "SavedObjectsOpenPointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeResponse", + "text": "SavedObjectsOpenPointInTimeResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -1154,7 +1574,13 @@ "label": "{ keepAlive = '5m', preference }", "description": [], "signature": [ - "SavedObjectsOpenPointInTimeOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeOptions", + "text": "SavedObjectsOpenPointInTimeOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -1175,9 +1601,21 @@ ], "signature": [ "(id: string, options?: ", - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined) => Promise<", - "SavedObjectsClosePointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClosePointInTimeResponse", + "text": "SavedObjectsClosePointInTimeResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -1207,7 +1645,13 @@ "label": "options", "description": [], "signature": [ - "SavedObjectsBaseOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -1229,11 +1673,29 @@ ], "signature": [ "(findOptions: ", - "SavedObjectsCreatePointInTimeFinderOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + }, ", dependencies?: ", - "SavedObjectsCreatePointInTimeFinderDependencies", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, " | undefined) => ", - "ISavedObjectsPointInTimeFinder", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsPointInTimeFinder", + "text": "ISavedObjectsPointInTimeFinder" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", @@ -1248,7 +1710,13 @@ "label": "findOptions", "description": [], "signature": [ - "SavedObjectsCreatePointInTimeFinderOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", "deprecated": false, @@ -1263,7 +1731,13 @@ "label": "dependencies", "description": [], "signature": [ - "SavedObjectsCreatePointInTimeFinderDependencies", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.ts", diff --git a/api_docs/kbn_core_saved_objects_api_server_internal.mdx b/api_docs/kbn_core_saved_objects_api_server_internal.mdx index 4cb67c84a5a56..d2b04439c2158 100644 --- a/api_docs/kbn_core_saved_objects_api_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-internal title: "@kbn/core-saved-objects-api-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-internal plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-internal'] --- import kbnCoreSavedObjectsApiServerInternalObj from './kbn_core_saved_objects_api_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 71 | 0 | 51 | 0 | +| 71 | 0 | 51 | 1 | ## Server diff --git a/api_docs/kbn_core_saved_objects_api_server_mocks.devdocs.json b/api_docs/kbn_core_saved_objects_api_server_mocks.devdocs.json index 84cd863028166..0b9fbecf6d4ef 100644 --- a/api_docs/kbn_core_saved_objects_api_server_mocks.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_server_mocks.devdocs.json @@ -35,7 +35,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-mocks/src/saved_objects_client.mock.ts", @@ -99,7 +105,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ISavedObjectsRepository", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-api-server-mocks/src/repository.mock.ts", 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 56921271693fe..704def6831a67 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_saved_objects_base_server_internal.devdocs.json index 00845df5afb5d..d0b90ce8141cc 100644 --- a/api_docs/kbn_core_saved_objects_base_server_internal.devdocs.json +++ b/api_docs/kbn_core_saved_objects_base_server_internal.devdocs.json @@ -52,7 +52,13 @@ "description": [], "signature": [ "{ readonly discardUnknownObjects?: string | undefined; readonly discardCorruptObjects?: string | undefined; readonly pollInterval: number; readonly skip: boolean; readonly batchSize: number; readonly maxBatchSizeBytes: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, "; readonly scrollDuration: string; readonly retryAttempts: number; }" ], "path": "packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_config.ts", @@ -82,7 +88,13 @@ "description": [], "signature": [ "Readonly<{} & { maxImportPayloadBytes: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, "; maxImportExportSize: number; }>" ], "path": "packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_config.ts", @@ -99,7 +111,13 @@ "description": [], "signature": [ "Readonly<{ discardUnknownObjects?: string | undefined; discardCorruptObjects?: string | undefined; } & { pollInterval: number; skip: boolean; batchSize: number; maxBatchSizeBytes: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, "; scrollDuration: string; retryAttempts: number; }>" ], "path": "packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_config.ts", @@ -338,11 +356,23 @@ "description": [], "signature": [ "(mappings: ", - "SavedObjectsFieldMapping", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsFieldMapping", + "text": "SavedObjectsFieldMapping" + }, " | ", "IndexMapping", ", path: string | string[]) => ", - "SavedObjectsFieldMapping", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsFieldMapping", + "text": "SavedObjectsFieldMapping" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_property.ts", @@ -357,7 +387,13 @@ "label": "mappings", "description": [], "signature": [ - "SavedObjectsFieldMapping", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsFieldMapping", + "text": "SavedObjectsFieldMapping" + }, " | ", "IndexMapping" ], @@ -398,7 +434,13 @@ "(mapping: ", "IndexMapping", ") => ", - "SavedObjectsMappingProperties" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsMappingProperties", + "text": "SavedObjectsMappingProperties" + } ], "path": "packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_root_properties.ts", "deprecated": false, @@ -434,7 +476,13 @@ "(mappings: ", "IndexMapping", ") => ", - "SavedObjectsMappingProperties" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsMappingProperties", + "text": "SavedObjectsMappingProperties" + } ], "path": "packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_root_properties_objects.ts", "deprecated": false, @@ -509,7 +557,13 @@ "description": [], "signature": [ "{ readonly maxImportPayloadBytes: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, "; readonly maxImportExportSize: number; }" ], "path": "packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_config.ts", @@ -526,7 +580,13 @@ "description": [], "signature": [ "{ readonly discardUnknownObjects?: string | undefined; readonly discardCorruptObjects?: string | undefined; readonly pollInterval: number; readonly skip: boolean; readonly batchSize: number; readonly maxBatchSizeBytes: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, "; readonly scrollDuration: string; readonly retryAttempts: number; }" ], "path": "packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_config.ts", @@ -566,13 +626,37 @@ "label": "schema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ maxImportPayloadBytes: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "<", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, ">; maxImportExportSize: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>" ], "path": "packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_config.ts", @@ -612,25 +696,85 @@ "label": "schema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ batchSize: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; maxBatchSizeBytes: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "<", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, ">; discardUnknownObjects: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; discardCorruptObjects: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; scrollDuration: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; pollInterval: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; skip: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; retryAttempts: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>" ], "path": "packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_config.ts", 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 ab1e5ed664f76..6debb5b1224fb 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-internal'] --- import kbnCoreSavedObjectsBaseServerInternalObj from './kbn_core_saved_objects_base_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 37 | 0 | 31 | 1 | +| 37 | 0 | 31 | 6 | ## Server diff --git a/api_docs/kbn_core_saved_objects_base_server_mocks.devdocs.json b/api_docs/kbn_core_saved_objects_base_server_mocks.devdocs.json index 738df680f7054..764ca03709e88 100644 --- a/api_docs/kbn_core_saved_objects_base_server_mocks.devdocs.json +++ b/api_docs/kbn_core_saved_objects_base_server_mocks.devdocs.json @@ -35,7 +35,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ISavedObjectsSerializer", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsSerializer", + "text": "ISavedObjectsSerializer" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-base-server-mocks/src/serializer.mock.ts", @@ -67,7 +73,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ISavedObjectTypeRegistry", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + }, " & Pick<", "SavedObjectTypeRegistry", ", \"registerType\">>" 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 8fe7f7121f77a..2cc0e8318918f 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: 2022-10-25 +date: 2022-11-07 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 d8cda029f89a8..0211987b25cf8 100644 --- a/api_docs/kbn_core_saved_objects_browser.devdocs.json +++ b/api_docs/kbn_core_saved_objects_browser.devdocs.json @@ -41,7 +41,13 @@ "{@link SavedObjectsClientContract}" ], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-browser/src/contracts.ts", "deprecated": false, diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index 8438fa6c4e1be..b7f7464c668a1 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: 2022-10-25 +date: 2022-11-07 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 85d598600e037..1158ef8e8e0ca 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.devdocs.json +++ b/api_docs/kbn_core_saved_objects_browser_internal.devdocs.json @@ -36,7 +36,13 @@ " implements ", "CoreService", "" ], "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_service.ts", @@ -68,9 +74,21 @@ "description": [], "signature": [ "({ http }: { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise<", - "SavedObjectsStart", + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_service.ts", @@ -96,7 +114,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_service.ts", "deprecated": false, diff --git a/api_docs/kbn_core_saved_objects_browser_internal.mdx b/api_docs/kbn_core_saved_objects_browser_internal.mdx index 9a720870eb797..f4a2084047f1b 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_saved_objects_browser_mocks.devdocs.json index a76112903241c..b2742a4480855 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_saved_objects_browser_mocks.devdocs.json @@ -59,7 +59,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "SavedObjectsStart", + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts", @@ -91,11 +97,29 @@ "description": [], "signature": [ "(client: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ") => jest.Mocked<", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts", @@ -110,7 +134,13 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts", "deprecated": false, @@ -125,7 +155,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts", diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.mdx b/api_docs/kbn_core_saved_objects_browser_mocks.mdx index e801344422ab7..7abf36d207851 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: 2022-10-25 +date: 2022-11-07 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 4a004f5e967eb..23f18d9d755b5 100644 --- a/api_docs/kbn_core_saved_objects_common.devdocs.json +++ b/api_docs/kbn_core_saved_objects_common.devdocs.json @@ -263,7 +263,628 @@ "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects.ts", "deprecated": true, "trackAdoption": false, - "references": [], + "references": [ + { + "plugin": "core", + "path": "src/core/public/index.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/create_source.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/create_source.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/find_object_by_title.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/find_object_by_title.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts" + }, + { + "plugin": "embeddable", + "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx" + }, + { + "plugin": "embeddable", + "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx" + }, + { + "plugin": "embeddable", + "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx" + }, + { + "plugin": "embeddable", + "path": "src/plugins/embeddable/public/lib/embeddables/default_embeddable_factory_provider.ts" + }, + { + "plugin": "embeddable", + "path": "src/plugins/embeddable/public/lib/embeddables/default_embeddable_factory_provider.ts" + }, + { + "plugin": "embeddable", + "path": "src/plugins/embeddable/public/types.ts" + }, + { + "plugin": "embeddable", + "path": "src/plugins/embeddable/public/types.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/common/types/models/epm.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/common/types/models/epm.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/common/types/models/settings.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/common/types/models/settings.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/dashboard_saved_object/lib/load_dashboard_state_from_saved_object.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/dashboard_saved_object/lib/load_dashboard_state_from_saved_object.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_find_saved_object.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_find_saved_object.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_create_saved_object.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_get_saved_object.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_get_saved_object.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_update_saved_object.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/saved_view/saved_view.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/saved_view/saved_view.tsx" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/shareable_runtime/types.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/shareable_runtime/types.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.test.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.test.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.test.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.test.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.test.ts" + }, + { + "plugin": "core", + "path": "src/core/server/index.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/actions_client.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/actions_client.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/actions_client.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/actions_client.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/actions_client.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/actions_client.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/actions_client.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/types.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/types.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/types.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/types.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/types.ts" + }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/types.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/common/rule.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/common/rule.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/common/rule.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/common/rule.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/common/rule.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/common/rule.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/types.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/types.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/types.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/types.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/types.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/types.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/types.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/rules_client.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/rules_client.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/custom_elements/find.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/custom_elements/find.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/find.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/find.ts" + }, + { + "plugin": "enterpriseSearch", + "path": "x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts" + }, + { + "plugin": "enterpriseSearch", + "path": "x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts" + }, + { + "plugin": "enterpriseSearch", + "path": "x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" + }, + { + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/task_store.test.ts" + }, + { + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/task_store.test.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/migrations/migrate_extract_panel_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/migrations/migrate_extract_panel_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/usage/dashboard_telemetry_collection_task.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/usage/dashboard_telemetry.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/usage/dashboard_telemetry.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/usage/find_by_value_embeddables.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/usage/find_by_value_embeddables.ts" + }, + { + "plugin": "savedSearch", + "path": "src/plugins/saved_search/server/saved_objects/search_migrations.ts" + }, + { + "plugin": "savedSearch", + "path": "src/plugins/saved_search/server/saved_objects/search_migrations.ts" + }, + { + "plugin": "core", + "path": "src/core/types/index.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/modules.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/modules.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/common/types.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/common/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/common/persistable_state/dashboard_saved_object_references.ts" + }, + { + "plugin": "core", + "path": "src/core/server/types.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/saved_objects/migrations/7.11/index.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/saved_objects/migrations/7.11/index.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/saved_objects/migrations/7.15/index.ts" + }, + { + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/saved_objects/migrations/7.15/index.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/dashboard_saved_object/lib/save_dashboard_state_to_saved_object.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/dashboard_saved_object/lib/save_dashboard_state_to_saved_object.ts" + }, + { + "plugin": "@kbn/core-saved-objects-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/collect_references_deep.test.ts" + }, + { + "plugin": "@kbn/core-saved-objects-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/collect_references_deep.test.ts" + } + ], "children": [ { "parentPluginId": "@kbn/core-saved-objects-common", @@ -1044,7 +1665,16 @@ "path": "packages/core/saved-objects/core-saved-objects-common/src/saved_objects_imports.ts", "deprecated": true, "trackAdoption": false, - "references": [] + "references": [ + { + "plugin": "spaces", + "path": "x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx" + }, + { + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/lib/resolve_import_errors.ts" + } + ] }, { "parentPluginId": "@kbn/core-saved-objects-common", diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index d0e947abfc063..c2d59cf0f11d7 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_saved_objects_import_export_server_internal.devdocs.json index fd2846eec2566..82eee4c2e14fb 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_internal.devdocs.json +++ b/api_docs/kbn_core_saved_objects_import_export_server_internal.devdocs.json @@ -141,7 +141,13 @@ "description": [], "signature": [ "(objects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]) => ", { "pluginId": "@kbn/core-saved-objects-import-export-server-internal", @@ -163,7 +169,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", @@ -185,7 +197,13 @@ ], "signature": [ "(objects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[], cause: Error) => ", { "pluginId": "@kbn/core-saved-objects-import-export-server-internal", @@ -207,7 +225,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/errors.ts", @@ -463,7 +487,13 @@ "description": [], "signature": [ "(objects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]) => ", { "pluginId": "@kbn/core-saved-objects-import-export-server-internal", @@ -485,7 +515,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts", 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 88bbe5fdb850d..7c963a2d5e82b 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_saved_objects_import_export_server_mocks.devdocs.json index 344f2d6e58526..1b61975574e79 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_mocks.devdocs.json +++ b/api_docs/kbn_core_saved_objects_import_export_server_mocks.devdocs.json @@ -35,7 +35,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ISavedObjectsExporter", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsExporter", + "text": "ISavedObjectsExporter" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-import-export-server-mocks/src/saved_objects_exporter.mock.ts", @@ -67,7 +73,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ISavedObjectsImporter", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsImporter", + "text": "ISavedObjectsImporter" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-import-export-server-mocks/src/saved_objects_importer.mock.ts", 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 b9f8481677baa..228cf64edb8c3 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-mocks'] --- import kbnCoreSavedObjectsImportExportServerMocksObj from './kbn_core_saved_objects_import_export_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_internal.devdocs.json b/api_docs/kbn_core_saved_objects_migration_server_internal.devdocs.json index 529f203e49b32..e041d67290f46 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_internal.devdocs.json +++ b/api_docs/kbn_core_saved_objects_migration_server_internal.devdocs.json @@ -66,7 +66,7 @@ "id": "def-server.KibanaMigrator.Unnamed.$1", "type": "Object", "tags": [], - "label": "{\n client,\n typeRegistry,\n kibanaIndex,\n soMigrationsConfig,\n kibanaVersion,\n logger,\n docLinks,\n }", + "label": "{\n client,\n typeRegistry,\n kibanaIndex,\n soMigrationsConfig,\n kibanaVersion,\n logger,\n docLinks,\n waitForMigrationCompletion,\n }", "description": [], "signature": [ { @@ -193,9 +193,21 @@ "description": [], "signature": [ "(doc: ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, ") => ", - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts", @@ -210,7 +222,13 @@ "label": "doc", "description": [], "signature": [ - "SavedObjectUnsanitizedDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectUnsanitizedDoc", + "text": "SavedObjectUnsanitizedDoc" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts", @@ -297,7 +315,13 @@ ], "signature": [ "(typeDefinitions: ", - "SavedObjectsMappingProperties", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsMappingProperties", + "text": "SavedObjectsMappingProperties" + }, " | ", "SavedObjectsTypeMappingDefinitions", ") => ", @@ -317,7 +341,13 @@ "- the type definitions to build mapping from." ], "signature": [ - "SavedObjectsMappingProperties", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsMappingProperties", + "text": "SavedObjectsMappingProperties" + }, " | ", "SavedObjectsTypeMappingDefinitions" ], @@ -833,7 +863,13 @@ ], "signature": [ "(types: ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "[]) => ", "SavedObjectsTypeMappingDefinitions" ], @@ -849,7 +885,13 @@ "label": "types", "description": [], "signature": [ - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts", @@ -913,7 +955,13 @@ ], "signature": [ "(client: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", index: string) => ", "TaskEither", "<", @@ -940,7 +988,13 @@ "label": "client", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/actions/pickup_updated_mappings.ts", "deprecated": false, @@ -1143,7 +1197,13 @@ ], "signature": [ "(client: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", options: ", "SearchForOutdatedDocumentsOptions", ") => ", @@ -1166,7 +1226,13 @@ "label": "client", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/actions/search_for_outdated_documents.ts", "deprecated": false, @@ -1699,7 +1765,13 @@ "label": "processedDocs", "description": [], "signature": [ - "SavedObjectsRawDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDoc", + "text": "SavedObjectsRawDoc" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migrate_raw_docs.ts", @@ -1728,7 +1800,13 @@ "label": "processedDocs", "description": [], "signature": [ - "SavedObjectsRawDoc", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsRawDoc", + "text": "SavedObjectsRawDoc" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migrate_raw_docs.ts", @@ -2957,7 +3035,13 @@ "label": "typeRegistry", "description": [], "signature": [ - "ISavedObjectTypeRegistry" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + } ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts", "deprecated": false, @@ -2972,7 +3056,13 @@ "description": [], "signature": [ "{ readonly discardUnknownObjects?: string | undefined; readonly discardCorruptObjects?: string | undefined; readonly pollInterval: number; readonly skip: boolean; readonly batchSize: number; readonly maxBatchSizeBytes: ", - "ByteSizeValue", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + }, "; readonly scrollDuration: string; readonly retryAttempts: number; }" ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts", @@ -3009,7 +3099,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts", "deprecated": false, @@ -3023,11 +3119,28 @@ "label": "docLinks", "description": [], "signature": [ - "DocLinksServiceSetup" + { + "pluginId": "@kbn/core-doc-links-server", + "scope": "server", + "docId": "kibKbnCoreDocLinksServerPluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + } ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-saved-objects-migration-server-internal", + "id": "def-server.KibanaMigratorOptions.waitForMigrationCompletion", + "type": "boolean", + "tags": [], + "label": "waitForMigrationCompletion", + "description": [], + "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false 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 1d7afa9cb74d4..e82242308a035 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-internal'] --- import kbnCoreSavedObjectsMigrationServerInternalObj from './kbn_core_saved_objects_migration_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 100 | 0 | 74 | 43 | +| 101 | 0 | 75 | 43 | ## Server diff --git a/api_docs/kbn_core_saved_objects_migration_server_mocks.devdocs.json b/api_docs/kbn_core_saved_objects_migration_server_mocks.devdocs.json index 04a8bf037c755..0f43ff1b8f315 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_mocks.devdocs.json +++ b/api_docs/kbn_core_saved_objects_migration_server_mocks.devdocs.json @@ -20,7 +20,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "SavedObjectsMigrationLogger", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsMigrationLogger", + "text": "SavedObjectsMigrationLogger" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-mocks/src/migration.mocks.ts", @@ -123,7 +129,13 @@ "description": [], "signature": [ "({ migrationVersion, convertToMultiNamespaceTypeVersion, isSingleNamespaceType, }?: { migrationVersion?: string | undefined; convertToMultiNamespaceTypeVersion?: string | undefined; isSingleNamespaceType?: boolean | undefined; }) => jest.Mocked<", - "SavedObjectMigrationContext", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationContext", + "text": "SavedObjectMigrationContext" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-mocks/src/migration.mocks.ts", @@ -170,7 +182,13 @@ "description": [], "signature": [ "({ types, }?: { types: ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "[]; }) => jest.Mocked<", "IKibanaMigrator", ">" @@ -189,7 +207,13 @@ "description": [], "signature": [ "{ types: ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "[]; }" ], "path": "packages/core/saved-objects/core-saved-objects-migration-server-mocks/src/kibana_migrator.mock.ts", 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 a1c9666518adb..545b2c0461ba7 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: 2022-10-25 +date: 2022-11-07 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 29e8376dafd9b..859645e5e7cb8 100644 --- a/api_docs/kbn_core_saved_objects_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_server.devdocs.json @@ -166,7 +166,13 @@ "text": "SavedObjectsImportOptions" }, ") => Promise<", - "SavedObjectsImportResponse", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportResponse", + "text": "SavedObjectsImportResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", @@ -218,7 +224,13 @@ "text": "SavedObjectsResolveImportErrorsOptions" }, ") => Promise<", - "SavedObjectsImportResponse", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportResponse", + "text": "SavedObjectsImportResponse" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", @@ -1033,7 +1045,13 @@ "The http request initiating the export." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", @@ -1290,7 +1308,13 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, @@ -1324,7 +1348,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", @@ -1374,7 +1404,13 @@ "optional array of objects to export." ], "signature": [ - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", @@ -1440,7 +1476,13 @@ "optional array of references to search object for." ], "signature": [ - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", @@ -1571,7 +1613,13 @@ "missing references details" ], "signature": [ - "SavedObjectTypeIdTuple", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectTypeIdTuple", + "text": "SavedObjectTypeIdTuple" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", @@ -1640,7 +1688,13 @@ "\nThe request that initiated the export request. Can be used to create scoped\nservices or client inside the {@link SavedObjectsExportTransform | transformation}" ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", @@ -1673,7 +1727,13 @@ "\nAn optional list of warnings to display in the UI when the import succeeds." ], "signature": [ - "SavedObjectsImportWarning", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportWarning", + "text": "SavedObjectsImportWarning" + }, "[] | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", @@ -1901,7 +1961,28 @@ "deprecated": true, "removeBy": "8.8.0", "trackAdoption": false, - "references": [], + "references": [ + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/migrations/migrate_to_730/migrations_730.ts" + }, + { + "plugin": "@kbn/core-saved-objects-migration-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts" + }, + { + "plugin": "@kbn/core-saved-objects-migration-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts" + } + ], "children": [ { "parentPluginId": "@kbn/core-saved-objects-server", @@ -1962,9 +2043,21 @@ "description": [], "signature": [ "(msg: string, meta: Meta) => void" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", @@ -2172,7 +2265,13 @@ "label": "migrationVersion", "description": [], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", @@ -2215,7 +2314,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", @@ -2277,9 +2382,21 @@ ], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", includedHiddenTypes?: string[] | undefined) => ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, @@ -2293,7 +2410,13 @@ "label": "req", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", @@ -2332,7 +2455,13 @@ ], "signature": [ "(includedHiddenTypes?: string[] | undefined) => ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, @@ -2382,7 +2511,13 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, @@ -2425,7 +2560,13 @@ "text": "SavedObjectsClientProviderOptions" }, " | undefined) => ", - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, @@ -2465,7 +2606,13 @@ "description": [], "signature": [ "(client: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", { "pluginId": "@kbn/core-saved-objects-server", @@ -2487,7 +2634,13 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, @@ -2506,7 +2659,13 @@ "description": [], "signature": [ "(client: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", { "pluginId": "@kbn/core-saved-objects-server", @@ -2528,7 +2687,13 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/request_handler_context.ts", "deprecated": false, @@ -2580,7 +2745,13 @@ "saved object import references to retry" ], "signature": [ - "SavedObjectsImportRetry", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportRetry", + "text": "SavedObjectsImportRetry" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", @@ -2852,7 +3023,13 @@ ], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", options?: ", { "pluginId": "@kbn/core-saved-objects-server", @@ -2862,7 +3039,13 @@ "text": "SavedObjectsClientProviderOptions" }, " | undefined) => ", - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, @@ -2876,7 +3059,13 @@ "label": "req", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", @@ -2920,9 +3109,21 @@ ], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", includedHiddenTypes?: string[] | undefined) => ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, @@ -2938,7 +3139,13 @@ "- The request to create the scoped repository from." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", @@ -2977,7 +3184,13 @@ ], "signature": [ "(includedHiddenTypes?: string[] | undefined) => ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, @@ -3039,7 +3252,13 @@ ], "signature": [ "(client: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", { "pluginId": "@kbn/core-saved-objects-server", @@ -3061,7 +3280,13 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, @@ -3082,7 +3307,13 @@ ], "signature": [ "(client: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", { "pluginId": "@kbn/core-saved-objects-server", @@ -3104,7 +3335,13 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/contracts.ts", "deprecated": false, @@ -3530,7 +3767,13 @@ ], "signature": [ "((savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ") => string) | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", @@ -3545,7 +3788,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", @@ -3567,7 +3816,13 @@ ], "signature": [ "((savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ") => string) | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", @@ -3582,7 +3837,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", @@ -3604,7 +3865,13 @@ ], "signature": [ "((savedObject: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ") => { path: string; uiCapabilitiesPath: string; }) | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", @@ -3619,7 +3886,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", @@ -3806,7 +4079,13 @@ "label": "CreatedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, " & { destinationId?: string | undefined; }" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", @@ -3864,7 +4143,13 @@ "description": [], "signature": [ "SavedObjectDoc & { references?: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined; }" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/migration.ts", @@ -3905,7 +4190,13 @@ ], "signature": [ "SavedObjectDoc & { references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", @@ -3924,9 +4215,21 @@ ], "signature": [ "({ request, includedHiddenTypes, }: { request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "; includedHiddenTypes?: string[] | undefined; }) => ", - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, @@ -3942,7 +4245,13 @@ "description": [], "signature": [ "{ request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "; includedHiddenTypes?: string[] | undefined; }" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", @@ -4026,7 +4335,13 @@ "text": "SavedObjectsClientWrapperOptions" }, ") => ", - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/saved-objects/core-saved-objects-server/src/client_factory.ts", "deprecated": false, @@ -4065,7 +4380,13 @@ "description": [], "signature": [ "(obj: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ") => boolean" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", @@ -4081,7 +4402,13 @@ "label": "obj", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_management.ts", @@ -4110,11 +4437,29 @@ "text": "SavedObjectsExportTransformContext" }, ", objects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]) => ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[] | Promise<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]>" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", @@ -4150,7 +4495,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/export.ts", @@ -4191,7 +4542,13 @@ ], "signature": [ "(objects: ", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]) => ", { "pluginId": "@kbn/core-saved-objects-server", @@ -4223,7 +4580,13 @@ "label": "objects", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "[]" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/import.ts", @@ -4243,7 +4606,13 @@ "\nAllows for validating properties using @kbn/config-schema validations.\n" ], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/validation.ts", @@ -4264,9 +4633,21 @@ ], "signature": [ "(toolkit: { readonlyEsClient: Pick<", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", \"search\">; }) => ", - "MaybePromise", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.MaybePromise", + "text": "MaybePromise" + }, "<", "QueryDslQueryContainer", ">" @@ -4285,7 +4666,13 @@ "description": [], "signature": [ "{ readonlyEsClient: Pick<", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", \"search\">; }" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts", @@ -4306,7 +4693,13 @@ ], "signature": [ "SavedObjectDoc & { references?: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined; }" ], "path": "packages/core/saved-objects/core-saved-objects-server/src/serialization.ts", diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index dfd50e0069d8a..8ffc1b93baad9 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_saved_objects_server_internal.devdocs.json index 5d601613ed4a7..7449f9750e918 100644 --- a/api_docs/kbn_core_saved_objects_server_internal.devdocs.json +++ b/api_docs/kbn_core_saved_objects_server_internal.devdocs.json @@ -30,7 +30,13 @@ "<", "InternalSavedObjectsServiceSetup", ", ", - "SavedObjectsServiceStart", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceStart", + "text": "SavedObjectsServiceStart" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.ts", @@ -113,10 +119,16 @@ "label": "start", "description": [], "signature": [ - "({ elasticsearch, pluginsInitialized, docLinks, }: ", + "({ elasticsearch, pluginsInitialized, docLinks, node, }: ", "SavedObjectsStartDeps", ") => Promise<", - "SavedObjectsServiceStart", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceStart", + "text": "SavedObjectsServiceStart" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.ts", @@ -128,7 +140,7 @@ "id": "def-server.SavedObjectsService.start.$1", "type": "Object", "tags": [], - "label": "{\n elasticsearch,\n pluginsInitialized = true,\n docLinks,\n }", + "label": "{\n elasticsearch,\n pluginsInitialized = true,\n docLinks,\n node,\n }", "description": [], "signature": [ "SavedObjectsStartDeps" @@ -775,7 +787,13 @@ ", { kibanaVersion, coreUsageData, logger, }: { kibanaVersion: string; coreUsageData: ", "InternalCoreUsageDataSetup", "; logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, "; }) => void" ], "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/export.ts", @@ -841,7 +859,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/export.ts", "deprecated": false, @@ -866,7 +890,13 @@ ", { maxImportPayloadBytes, coreUsageData, logger, }: { maxImportPayloadBytes: number; coreUsageData: ", "InternalCoreUsageDataSetup", "; logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, "; }) => void" ], "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/import.ts", @@ -932,7 +962,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/import.ts", "deprecated": false, @@ -1160,7 +1196,13 @@ "label": "InternalSavedObjectsServiceStart", "description": [], "signature": [ - "SavedObjectsServiceStart" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceStart", + "text": "SavedObjectsServiceStart" + } ], "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.ts", "deprecated": false, diff --git a/api_docs/kbn_core_saved_objects_server_internal.mdx b/api_docs/kbn_core_saved_objects_server_internal.mdx index 22a7b1895b3fd..b4a498f21ee01 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_saved_objects_server_mocks.devdocs.json index 75554244f43ff..31a6f16b36edd 100644 --- a/api_docs/kbn_core_saved_objects_server_mocks.devdocs.json +++ b/api_docs/kbn_core_saved_objects_server_mocks.devdocs.json @@ -69,7 +69,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "SavedObjectsServiceSetup", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceSetup", + "text": "SavedObjectsServiceSetup" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server-mocks/src/saved_objects_service.mock.ts", @@ -87,9 +93,21 @@ "description": [], "signature": [ "(typeRegistry?: jest.Mocked<", - "ISavedObjectTypeRegistry", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + }, "> | undefined) => jest.Mocked<", - "SavedObjectsServiceStart", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceStart", + "text": "SavedObjectsServiceStart" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server-mocks/src/saved_objects_service.mock.ts", @@ -106,7 +124,13 @@ "description": [], "signature": [ "jest.Mocked<", - "ISavedObjectTypeRegistry", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + }, "> | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-server-mocks/src/saved_objects_service.mock.ts", @@ -124,9 +148,21 @@ "description": [], "signature": [ "(typeRegistry?: jest.Mocked<", - "ISavedObjectTypeRegistry", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + }, "> | undefined) => jest.Mocked<", - "SavedObjectsServiceStart", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceStart", + "text": "SavedObjectsServiceStart" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server-mocks/src/saved_objects_service.mock.ts", @@ -143,7 +179,13 @@ "description": [], "signature": [ "jest.Mocked<", - "ISavedObjectTypeRegistry", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + }, "> | undefined" ], "path": "packages/core/saved-objects/core-saved-objects-server-mocks/src/saved_objects_service.mock.ts", @@ -160,8 +202,14 @@ "label": "createMigrationContext", "description": [], "signature": [ - "({ migrationVersion, convertToMultiNamespaceTypeVersion, isSingleNamespaceType, }?: { migrationVersion?: string | undefined; convertToMultiNamespaceTypeVersion?: string | undefined; isSingleNamespaceType?: boolean | undefined; } | undefined) => jest.Mocked<", - "SavedObjectMigrationContext", + "({ migrationVersion, convertToMultiNamespaceTypeVersion, isSingleNamespaceType, }?: { migrationVersion?: string | undefined; convertToMultiNamespaceTypeVersion?: string | undefined; isSingleNamespaceType?: boolean | undefined; }) => jest.Mocked<", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationContext", + "text": "SavedObjectMigrationContext" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server-mocks/src/saved_objects_service.mock.ts", @@ -177,9 +225,9 @@ "label": "__0", "description": [], "signature": [ - "{ migrationVersion?: string | undefined; convertToMultiNamespaceTypeVersion?: string | undefined; isSingleNamespaceType?: boolean | undefined; } | undefined" + "{ migrationVersion?: string | undefined; convertToMultiNamespaceTypeVersion?: string | undefined; isSingleNamespaceType?: boolean | undefined; }" ], - "path": "node_modules/@types/kbn__core-saved-objects-migration-server-mocks/index.d.ts", + "path": "packages/core/saved-objects/core-saved-objects-migration-server-mocks/src/migration.mocks.ts", "deprecated": false, "trackAdoption": false } @@ -194,7 +242,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ISavedObjectTypeRegistry", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + }, " & Pick<", "SavedObjectTypeRegistry", ", \"registerType\">>" @@ -214,7 +268,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ISavedObjectsExporter", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsExporter", + "text": "ISavedObjectsExporter" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server-mocks/src/saved_objects_service.mock.ts", @@ -232,7 +292,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ISavedObjectsImporter", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsImporter", + "text": "ISavedObjectsImporter" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server-mocks/src/saved_objects_service.mock.ts", @@ -250,7 +316,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ISavedObjectsSerializer", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsSerializer", + "text": "ISavedObjectsSerializer" + }, ">" ], "path": "packages/core/saved-objects/core-saved-objects-server-mocks/src/saved_objects_service.mock.ts", diff --git a/api_docs/kbn_core_saved_objects_server_mocks.mdx b/api_docs/kbn_core_saved_objects_server_mocks.mdx index 51425bcc150ff..4d0b439a0f0d3 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-mocks'] --- import kbnCoreSavedObjectsServerMocksObj from './kbn_core_saved_objects_server_mocks.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 14 | 0 | 13 | 0 | +| 14 | 0 | 14 | 0 | ## Server diff --git a/api_docs/kbn_core_saved_objects_utils_server.devdocs.json b/api_docs/kbn_core_saved_objects_utils_server.devdocs.json index b8c138a99687f..6873e44f20a7f 100644 --- a/api_docs/kbn_core_saved_objects_utils_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_utils_server.devdocs.json @@ -1601,9 +1601,21 @@ ], "signature": [ "({ page, perPage, }: ", - "SavedObjectsFindOptions", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, ") => ", - "SavedObjectsFindResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, "" ], "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", @@ -1618,7 +1630,13 @@ "label": "{\n page = FIND_DEFAULT_PAGE,\n perPage = FIND_DEFAULT_PER_PAGE,\n }", "description": [], "signature": [ - "SavedObjectsFindOptions" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + } ], "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts", "deprecated": false, @@ -1772,11 +1790,29 @@ ], "signature": [ "(map1: ", - "SavedObjectMigrationMap", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + }, ", map2: ", - "SavedObjectMigrationMap", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + }, ") => ", - "SavedObjectMigrationMap" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + } ], "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.ts", "deprecated": false, @@ -1790,7 +1826,13 @@ "label": "map1", "description": [], "signature": [ - "SavedObjectMigrationMap" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + } ], "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.ts", "deprecated": false, @@ -1805,7 +1847,13 @@ "label": "map2", "description": [], "signature": [ - "SavedObjectMigrationMap" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectMigrationMap", + "text": "SavedObjectMigrationMap" + } ], "path": "packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.ts", "deprecated": false, diff --git a/api_docs/kbn_core_saved_objects_utils_server.mdx b/api_docs/kbn_core_saved_objects_utils_server.mdx index 7938ab6338fc3..2dc0fa03577b8 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-utils-server'] --- import kbnCoreSavedObjectsUtilsServerObj from './kbn_core_saved_objects_utils_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_common.mdx b/api_docs/kbn_core_status_common.mdx index 9fea7d66efb4e..24cddd027fd26 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common'] --- import kbnCoreStatusCommonObj from './kbn_core_status_common.devdocs.json'; diff --git a/api_docs/kbn_core_status_common_internal.devdocs.json b/api_docs/kbn_core_status_common_internal.devdocs.json index eba46bfede8b3..f321466729eaa 100644 --- a/api_docs/kbn_core_status_common_internal.devdocs.json +++ b/api_docs/kbn_core_status_common_internal.devdocs.json @@ -180,7 +180,13 @@ "text": "StatusInfoServiceStatus" }, " extends Omit<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ", \"level\">" ], "path": "packages/core/status/core-status-common-internal/src/status.ts", @@ -286,7 +292,13 @@ "description": [], "signature": [ "Omit<", - "OpsMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsMetrics", + "text": "OpsMetrics" + }, ", \"collected_at\"> & { last_updated: string; collection_interval_in_millis: number; requests: { status_codes: Record; }; }" ], "path": "packages/core/status/core-status-common-internal/src/status.ts", @@ -308,7 +320,13 @@ "description": [], "signature": [ "Omit<", - "OpsMetrics", + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.OpsMetrics", + "text": "OpsMetrics" + }, ", \"collected_at\"> & { last_updated: string; collection_interval_in_millis: number; requests: { status_codes: Record; }; }" ], "path": "packages/core/status/core-status-common-internal/src/status.ts", diff --git a/api_docs/kbn_core_status_common_internal.mdx b/api_docs/kbn_core_status_common_internal.mdx index 1ba438eba1288..aea58f6d7cbc7 100644 --- a/api_docs/kbn_core_status_common_internal.mdx +++ b/api_docs/kbn_core_status_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common-internal title: "@kbn/core-status-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common-internal plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common-internal'] --- import kbnCoreStatusCommonInternalObj from './kbn_core_status_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server.devdocs.json b/api_docs/kbn_core_status_server.devdocs.json index 5ec5b6bbeb967..5e5049083b67d 100644 --- a/api_docs/kbn_core_status_server.devdocs.json +++ b/api_docs/kbn_core_status_server.devdocs.json @@ -21,10 +21,7 @@ "description": [ "\nStatus of core services.\n" ], - "signature": [ - "CoreStatus" - ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/core_status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -36,10 +33,16 @@ "label": "elasticsearch", "description": [], "signature": [ - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, "" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/core_status.ts", "deprecated": false, "trackAdoption": false }, @@ -51,10 +54,16 @@ "label": "savedObjects", "description": [], "signature": [ - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, "" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/core_status.ts", "deprecated": false, "trackAdoption": false } @@ -71,10 +80,16 @@ "\nThe current status of a service at a point in time.\n" ], "signature": [ - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, "" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -90,7 +105,7 @@ "signature": [ "Readonly<{ toString: () => \"available\"; valueOf: () => 0; toJSON: () => \"available\"; }> | Readonly<{ toString: () => \"degraded\"; valueOf: () => 1; toJSON: () => \"degraded\"; }> | Readonly<{ toString: () => \"unavailable\"; valueOf: () => 2; toJSON: () => \"unavailable\"; }> | Readonly<{ toString: () => \"critical\"; valueOf: () => 3; toJSON: () => \"critical\"; }>" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false }, @@ -103,7 +118,7 @@ "description": [ "\nA high-level summary of the service status." ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false }, @@ -119,7 +134,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false }, @@ -135,7 +150,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false }, @@ -151,7 +166,7 @@ "signature": [ "Meta | undefined" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false } @@ -183,7 +198,13 @@ "signature": [ "Observable", "<", - "CoreStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.CoreStatus", + "text": "CoreStatus" + }, ">" ], "path": "packages/core/status/core-status-server/src/contracts.ts", @@ -202,7 +223,13 @@ "signature": [ "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">" ], "path": "packages/core/status/core-status-server/src/contracts.ts", @@ -222,7 +249,13 @@ "(status$: ", "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">) => void" ], "path": "packages/core/status/core-status-server/src/contracts.ts", @@ -239,7 +272,13 @@ "signature": [ "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">" ], "path": "packages/core/status/core-status-server/src/contracts.ts", @@ -262,7 +301,13 @@ "signature": [ "Observable", ">>" ], "path": "packages/core/status/core-status-server/src/contracts.ts", @@ -281,7 +326,13 @@ "signature": [ "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">" ], "path": "packages/core/status/core-status-server/src/contracts.ts", @@ -324,7 +375,7 @@ "signature": [ "Readonly<{ toString: () => \"available\"; valueOf: () => 0; toJSON: () => \"available\"; }> | Readonly<{ toString: () => \"degraded\"; valueOf: () => 1; toJSON: () => \"degraded\"; }> | Readonly<{ toString: () => \"unavailable\"; valueOf: () => 2; toJSON: () => \"unavailable\"; }> | Readonly<{ toString: () => \"critical\"; valueOf: () => 3; toJSON: () => \"critical\"; }>" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -341,7 +392,7 @@ "signature": [ "\"degraded\" | \"unavailable\" | \"available\" | \"critical\"" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -360,7 +411,7 @@ "signature": [ "{ readonly available: Readonly<{ toString: () => \"available\"; valueOf: () => 0; toJSON: () => \"available\"; }>; readonly degraded: Readonly<{ toString: () => \"degraded\"; valueOf: () => 1; toJSON: () => \"degraded\"; }>; readonly unavailable: Readonly<{ toString: () => \"unavailable\"; valueOf: () => 2; toJSON: () => \"unavailable\"; }>; readonly critical: Readonly<{ toString: () => \"critical\"; valueOf: () => 3; toJSON: () => \"critical\"; }>; }" ], - "path": "node_modules/@types/kbn__core-status-common/index.d.ts", + "path": "packages/core/status/core-status-common/src/service_status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_core_status_server.mdx b/api_docs/kbn_core_status_server.mdx index f8d74d837a1e6..7415d890c9d13 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server'] --- import kbnCoreStatusServerObj from './kbn_core_status_server.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 20 | 0 | 1 | 0 | +| 20 | 0 | 3 | 0 | ## Server diff --git a/api_docs/kbn_core_status_server_internal.devdocs.json b/api_docs/kbn_core_status_server_internal.devdocs.json index d24cd2e143830..7d2d74b08ced9 100644 --- a/api_docs/kbn_core_status_server_internal.devdocs.json +++ b/api_docs/kbn_core_status_server_internal.devdocs.json @@ -86,27 +86,63 @@ ") => Promise<{ core$: ", "Observable", "<", - "CoreStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.CoreStatus", + "text": "CoreStatus" + }, ">; coreOverall$: ", "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">; overall$: ", "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">; plugins: { set: (plugin: string, status$: ", "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">) => void; getDependenciesStatus$: (plugin: string) => ", "Observable", ">>; getDerivedStatus$: (plugin: string) => ", "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, ">; }; isStatusPageAnonymous: () => boolean; }>" ], "path": "packages/core/status/core-status-server-internal/src/status_service.ts", @@ -229,21 +265,63 @@ "description": [], "signature": [ "{ optIn: (optInConfig: ", - "OptInConfig", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.OptInConfig", + "text": "OptInConfig" + }, ") => void; reportEvent: (eventType: string, eventData: EventTypeData) => void; readonly telemetryCounter$: ", "Observable", "<", - "TelemetryCounter", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.TelemetryCounter", + "text": "TelemetryCounter" + }, ">; registerEventType: (eventTypeOps: ", - "EventTypeOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.EventTypeOpts", + "text": "EventTypeOpts" + }, ") => void; registerShipper: (Shipper: ", - "ShipperClassConstructor", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ShipperClassConstructor", + "text": "ShipperClassConstructor" + }, ", shipperConfig: ShipperConfig, opts?: ", - "RegisterShipperOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.RegisterShipperOpts", + "text": "RegisterShipperOpts" + }, " | undefined) => void; registerContextProvider: (contextProviderOpts: ", - "ContextProviderOpts", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.ContextProviderOpts", + "text": "ContextProviderOpts" + }, ") => void; removeContextProvider: (contextProviderName: string) => void; }" ], "path": "packages/core/status/core-status-server-internal/src/status_service.ts", @@ -261,7 +339,13 @@ "{ status$: ", "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, "<", "ElasticsearchStatusMeta", ">>; }" @@ -320,7 +404,13 @@ "label": "metrics", "description": [], "signature": [ - "MetricsServiceSetup" + { + "pluginId": "@kbn/core-metrics-server", + "scope": "server", + "docId": "kibKbnCoreMetricsServerPluginApi", + "section": "def-server.MetricsServiceSetup", + "text": "MetricsServiceSetup" + } ], "path": "packages/core/status/core-status-server-internal/src/status_service.ts", "deprecated": false, @@ -337,9 +427,21 @@ "{ status$: ", "Observable", "<", - "ServiceStatus", + { + "pluginId": "@kbn/core-status-common", + "scope": "common", + "docId": "kibKbnCoreStatusCommonPluginApi", + "section": "def-common.ServiceStatus", + "text": "ServiceStatus" + }, "<", - "SavedObjectStatusMeta", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectStatusMeta", + "text": "SavedObjectStatusMeta" + }, ">>; }" ], "path": "packages/core/status/core-status-server-internal/src/status_service.ts", @@ -355,7 +457,13 @@ "description": [], "signature": [ "{ incrementUsageCounter: ", - "CoreIncrementUsageCounter", + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreIncrementUsageCounter", + "text": "CoreIncrementUsageCounter" + }, "; }" ], "path": "packages/core/status/core-status-server-internal/src/status_service.ts", @@ -415,9 +523,21 @@ "label": "schema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ allowAnonymous: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>" ], "path": "packages/core/status/core-status-server-internal/src/status_config.ts", diff --git a/api_docs/kbn_core_status_server_internal.mdx b/api_docs/kbn_core_status_server_internal.mdx index f0d7760a84ea2..e67ad9d6652ae 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_status_server_mocks.devdocs.json index 85f331d9e7e27..707d54a031b14 100644 --- a/api_docs/kbn_core_status_server_mocks.devdocs.json +++ b/api_docs/kbn_core_status_server_mocks.devdocs.json @@ -51,7 +51,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "StatusServiceSetup", + { + "pluginId": "@kbn/core-status-server", + "scope": "server", + "docId": "kibKbnCoreStatusServerPluginApi", + "section": "def-server.StatusServiceSetup", + "text": "StatusServiceSetup" + }, ">" ], "path": "packages/core/status/core-status-server-mocks/src/status_service.mock.ts", diff --git a/api_docs/kbn_core_status_server_mocks.mdx b/api_docs/kbn_core_status_server_mocks.mdx index 8ff12b4bf4031..09f37d611b280 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_test_helpers_deprecations_getters.devdocs.json index 625a82429f672..c3a8a7ab202c1 100644 --- a/api_docs/kbn_core_test_helpers_deprecations_getters.devdocs.json +++ b/api_docs/kbn_core_test_helpers_deprecations_getters.devdocs.json @@ -20,7 +20,13 @@ "description": [], "signature": [ "({ provider, settings, path, }: { provider: ", - "ConfigDeprecationProvider", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationProvider", + "text": "ConfigDeprecationProvider" + }, "; settings?: Record | undefined; path: string; }) => { messages: string[]; levels: string[]; migrated: Record; }" ], "path": "packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts", @@ -47,9 +53,21 @@ "description": [], "signature": [ "(factory: ", - "ConfigDeprecationFactory", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationFactory", + "text": "ConfigDeprecationFactory" + }, ") => ", - "ConfigDeprecation", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + }, "[]" ], "path": "packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts", @@ -65,9 +83,15 @@ "label": "factory", "description": [], "signature": [ - "ConfigDeprecationFactory" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationFactory", + "text": "ConfigDeprecationFactory" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false } @@ -113,7 +137,13 @@ "description": [], "signature": [ "({ provider, settings, }: { provider: ", - "ConfigDeprecationProvider", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationProvider", + "text": "ConfigDeprecationProvider" + }, "; settings?: Record | undefined; }) => { messages: string[]; levels: string[]; migrated: Record; }" ], "path": "packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts", @@ -140,9 +170,21 @@ "description": [], "signature": [ "(factory: ", - "ConfigDeprecationFactory", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationFactory", + "text": "ConfigDeprecationFactory" + }, ") => ", - "ConfigDeprecation", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + }, "[]" ], "path": "packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts", @@ -158,9 +200,15 @@ "label": "factory", "description": [], "signature": [ - "ConfigDeprecationFactory" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationFactory", + "text": "ConfigDeprecationFactory" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx index 5308f2fcbfbef..2ac2e33c9a256 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-deprecations-getters'] --- import kbnCoreTestHelpersDeprecationsGettersObj from './kbn_core_test_helpers_deprecations_getters.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 11 | 0 | 9 | 0 | +| 11 | 0 | 11 | 0 | ## Server diff --git a/api_docs/kbn_core_test_helpers_http_setup_browser.devdocs.json b/api_docs/kbn_core_test_helpers_http_setup_browser.devdocs.json index f368f3a1b89b0..2b85357c8f13d 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.devdocs.json +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.devdocs.json @@ -40,9 +40,21 @@ "; injectedMetadata: jest.Mocked<", "InternalInjectedMetadataSetup", ">; fatalErrors: jest.Mocked<", - "FatalErrorsSetup", + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + }, ">; http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }" ], "path": "packages/core/test-helpers/core-test-helpers-http-setup-browser/src/http_test_setup.ts", @@ -89,7 +101,13 @@ "(injectedMetadata: jest.Mocked<", "InternalInjectedMetadataSetup", ">, fatalErrors: jest.Mocked<", - "FatalErrorsSetup", + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + }, ">) => void" ], "path": "packages/core/test-helpers/core-test-helpers-http-setup-browser/src/http_test_setup.ts", @@ -129,9 +147,21 @@ "{ add: jest.MockInstance; get$: jest.MockInstance<", "Observable", "<", - "FatalErrorInfo", + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorInfo", + "text": "FatalErrorInfo" + }, ">, []>; } & ", - "FatalErrorsSetup" + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + } ], "path": "packages/core/test-helpers/core-test-helpers-http-setup-browser/src/http_test_setup.ts", "deprecated": false, 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 356a6fbe78bb5..092a840166a65 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: 2022-10-25 +date: 2022-11-07 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_so_type_serializer.devdocs.json b/api_docs/kbn_core_test_helpers_so_type_serializer.devdocs.json index 10df0d4e5d2de..642eda6c66314 100644 --- a/api_docs/kbn_core_test_helpers_so_type_serializer.devdocs.json +++ b/api_docs/kbn_core_test_helpers_so_type_serializer.devdocs.json @@ -22,7 +22,13 @@ ], "signature": [ "(soType: ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, ") => ", { "pluginId": "@kbn/core-test-helpers-so-type-serializer", @@ -44,7 +50,13 @@ "label": "soType", "description": [], "signature": [ - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "" ], "path": "packages/core/test-helpers/core-test-helpers-so-type-serializer/src/extract_migration_info.ts", @@ -65,7 +77,13 @@ "description": [], "signature": [ "(soType: ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, ") => string" ], "path": "packages/core/test-helpers/core-test-helpers-so-type-serializer/src/get_migration_hash.ts", @@ -80,7 +98,13 @@ "label": "soType", "description": [], "signature": [ - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "" ], "path": "packages/core/test-helpers/core-test-helpers-so-type-serializer/src/get_migration_hash.ts", 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 10a811b69d2a9..1cc5362bfca06 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_test_helpers_test_utils.devdocs.json index acb9b9ecd3d2c..a8444a39cb0f8 100644 --- a/api_docs/kbn_core_test_helpers_test_utils.devdocs.json +++ b/api_docs/kbn_core_test_helpers_test_utils.devdocs.json @@ -20,7 +20,13 @@ "description": [], "signature": [ "(name: string) => ", - "SavedObjectsType", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsType", + "text": "SavedObjectsType" + }, "" ], "path": "packages/core/test-helpers/core-test-helpers-test-utils/src/create_exportable_type.ts", @@ -59,23 +65,71 @@ "; httpSetup: ", "InternalHttpServiceSetup", "; handlerContext: { savedObjects: { client: jest.Mocked<", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ">; typeRegistry: jest.Mocked<", - "ISavedObjectTypeRegistry", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectTypeRegistry", + "text": "ISavedObjectTypeRegistry" + }, " & Pick<", "SavedObjectTypeRegistry", ", \"registerType\">>; getClient: () => jest.Mocked<", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ">; getExporter: () => jest.Mocked<", - "ISavedObjectsExporter", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsExporter", + "text": "ISavedObjectsExporter" + }, ">; getImporter: () => jest.Mocked<", - "ISavedObjectsImporter", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsImporter", + "text": "ISavedObjectsImporter" + }, ">; }; elasticsearch: { client: ", - "ScopedClusterClientMock", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.ScopedClusterClientMock", + "text": "ScopedClusterClientMock" + }, "; }; uiSettings: { client: jest.Mocked<", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.IUiSettingsClient", + "text": "IUiSettingsClient" + }, ">; }; deprecations: { client: jest.Mocked<", - "DeprecationsClient", + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.DeprecationsClient", + "text": "DeprecationsClient" + }, ">; }; }; }>" ], "path": "packages/core/test-helpers/core-test-helpers-test-utils/src/setup_server.ts", diff --git a/api_docs/kbn_core_test_helpers_test_utils.mdx b/api_docs/kbn_core_test_helpers_test_utils.mdx index fbe12213a11fa..a12d430878358 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: 2022-10-25 +date: 2022-11-07 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 b7752345297c4..3881a8f55c091 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: 2022-10-25 +date: 2022-11-07 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_internal.mdx b/api_docs/kbn_core_theme_browser_internal.mdx index 6bce0e96a9d97..fc0a59dbd3d67 100644 --- a/api_docs/kbn_core_theme_browser_internal.mdx +++ b/api_docs/kbn_core_theme_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-internal title: "@kbn/core-theme-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-internal plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-internal'] --- import kbnCoreThemeBrowserInternalObj from './kbn_core_theme_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_mocks.devdocs.json b/api_docs/kbn_core_theme_browser_mocks.devdocs.json index 888d4b04303a2..016a004c920b2 100644 --- a/api_docs/kbn_core_theme_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_theme_browser_mocks.devdocs.json @@ -59,7 +59,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ThemeServiceSetup", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceSetup", + "text": "ThemeServiceSetup" + }, ">" ], "path": "packages/core/theme/core-theme-browser-mocks/src/theme_service.mock.ts", @@ -77,7 +83,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "ThemeServiceStart", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + }, ">" ], "path": "packages/core/theme/core-theme-browser-mocks/src/theme_service.mock.ts", @@ -95,7 +107,13 @@ "description": [], "signature": [ "() => ", - "CoreTheme" + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + } ], "path": "packages/core/theme/core-theme-browser-mocks/src/theme_service.mock.ts", "deprecated": false, @@ -114,7 +132,13 @@ "() => ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "packages/core/theme/core-theme-browser-mocks/src/theme_service.mock.ts", diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index f0fbac738ed99..9a50b8d1c3948 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] --- import kbnCoreThemeBrowserMocksObj from './kbn_core_theme_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser.devdocs.json b/api_docs/kbn_core_ui_settings_browser.devdocs.json index 8a46c32c24978..312846b09f5e5 100644 --- a/api_docs/kbn_core_ui_settings_browser.devdocs.json +++ b/api_docs/kbn_core_ui_settings_browser.devdocs.json @@ -144,9 +144,21 @@ ], "signature": [ "() => Readonly>>" ], "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", @@ -437,9 +449,21 @@ "description": [], "signature": [ "[key: string]: ", - "PublicUiSettingsParams", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.PublicUiSettingsParams", + "text": "PublicUiSettingsParams" + }, " & ", - "UserProvidedValues", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UserProvidedValues", + "text": "UserProvidedValues" + }, "" ], "path": "packages/core/ui-settings/core-ui-settings-browser/src/types.ts", diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index 8aae5f3a219dc..1ac7f7306f407 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_ui_settings_browser_internal.devdocs.json index 3d089bf821f4f..93f9f2cc2eb55 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.devdocs.json +++ b/api_docs/kbn_core_ui_settings_browser_internal.devdocs.json @@ -34,7 +34,13 @@ "text": "UiSettingsClient" }, " implements ", - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "packages/core/ui-settings/core-ui-settings-browser-internal/src/ui_settings_client.ts", "deprecated": false, @@ -81,9 +87,21 @@ "description": [], "signature": [ "() => Record>" ], "path": "packages/core/ui-settings/core-ui-settings-browser-internal/src/ui_settings_client.ts", diff --git a/api_docs/kbn_core_ui_settings_browser_internal.mdx b/api_docs/kbn_core_ui_settings_browser_internal.mdx index ee733af4f8c2b..a776f10e633c5 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_ui_settings_browser_mocks.devdocs.json index 13108950725c0..36d284b3d050c 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_ui_settings_browser_mocks.devdocs.json @@ -59,7 +59,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + }, ">" ], "path": "packages/core/ui-settings/core-ui-settings-browser-mocks/src/ui_settings_service.mock.ts", @@ -77,7 +83,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + }, ">" ], "path": "packages/core/ui-settings/core-ui-settings-browser-mocks/src/ui_settings_service.mock.ts", diff --git a/api_docs/kbn_core_ui_settings_browser_mocks.mdx b/api_docs/kbn_core_ui_settings_browser_mocks.mdx index 86e45bb6eda70..bd9ffaff8429e 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.devdocs.json b/api_docs/kbn_core_ui_settings_common.devdocs.json index 6967cb7263b52..9a3b58162141f 100644 --- a/api_docs/kbn_core_ui_settings_common.devdocs.json +++ b/api_docs/kbn_core_ui_settings_common.devdocs.json @@ -299,7 +299,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", @@ -323,7 +329,24 @@ "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": true, "trackAdoption": false, - "references": [] + "references": [ + { + "plugin": "advancedSettings", + "path": "src/plugins/advanced_settings/public/management_app/lib/to_editable_config.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/server/ui_settings.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/server/ui_settings.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/server/ui_settings.ts" + } + ] } ], "initialIsOpen": false diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index d20a360cf655d..4426ec417d5b8 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_ui_settings_server.devdocs.json index f2b6ff763a4a7..c1bb08ade2aca 100644 --- a/api_docs/kbn_core_ui_settings_server.devdocs.json +++ b/api_docs/kbn_core_ui_settings_server.devdocs.json @@ -36,7 +36,13 @@ ], "signature": [ "() => Readonly>" ], "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", @@ -108,7 +114,13 @@ ], "signature": [ "() => Promise>>" ], "path": "packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts", @@ -397,7 +409,13 @@ ], "signature": [ "(settings: Record>) => void" ], "path": "packages/core/ui-settings/core-ui-settings-server/src/contracts.ts", @@ -413,7 +431,13 @@ "description": [], "signature": [ "Record>" ], "path": "packages/core/ui-settings/core-ui-settings-server/src/contracts.ts", @@ -449,7 +473,13 @@ ], "signature": [ "(savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ") => ", { "pluginId": "@kbn/core-ui-settings-server", @@ -471,7 +501,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/ui-settings/core-ui-settings-server/src/contracts.ts", "deprecated": false, diff --git a/api_docs/kbn_core_ui_settings_server.mdx b/api_docs/kbn_core_ui_settings_server.mdx index 222ba821dce2f..08acc69fcd445 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_ui_settings_server_internal.devdocs.json index 2edb18eb582d6..81c6e14698d39 100644 --- a/api_docs/kbn_core_ui_settings_server_internal.devdocs.json +++ b/api_docs/kbn_core_ui_settings_server_internal.devdocs.json @@ -321,7 +321,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/ui_settings_client.ts", "deprecated": false, @@ -350,7 +356,13 @@ "description": [], "signature": [ "Record> | undefined" ], "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/ui_settings_client.ts", @@ -365,7 +377,13 @@ "label": "log", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/ui_settings_client.ts", "deprecated": false, @@ -408,9 +426,21 @@ "label": "schema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ overrides: ", - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{}>; }>" ], "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/ui_settings_config.ts", @@ -426,9 +456,21 @@ "description": [], "signature": [ "(factory: ", - "ConfigDeprecationFactory", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationFactory", + "text": "ConfigDeprecationFactory" + }, ") => ", - "ConfigDeprecation", + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecation", + "text": "ConfigDeprecation" + }, "[]" ], "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/ui_settings_config.ts", @@ -444,9 +486,15 @@ "label": "factory", "description": [], "signature": [ - "ConfigDeprecationFactory" + { + "pluginId": "@kbn/config", + "scope": "server", + "docId": "kibKbnConfigPluginApi", + "section": "def-server.ConfigDeprecationFactory", + "text": "ConfigDeprecationFactory" + } ], - "path": "node_modules/@types/kbn__config/index.d.ts", + "path": "packages/kbn-config/src/deprecation/types.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_core_ui_settings_server_internal.mdx b/api_docs/kbn_core_ui_settings_server_internal.mdx index 2b0de5459cc6f..6b44e6d911875 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-internal'] --- import kbnCoreUiSettingsServerInternalObj from './kbn_core_ui_settings_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 28 | 1 | 27 | 1 | +| 28 | 1 | 28 | 2 | ## Server diff --git a/api_docs/kbn_core_ui_settings_server_mocks.devdocs.json b/api_docs/kbn_core_ui_settings_server_mocks.devdocs.json index 96ed28f3b1379..b16f1b9bd37e8 100644 --- a/api_docs/kbn_core_ui_settings_server_mocks.devdocs.json +++ b/api_docs/kbn_core_ui_settings_server_mocks.devdocs.json @@ -53,7 +53,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "UiSettingsServiceSetup", + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.UiSettingsServiceSetup", + "text": "UiSettingsServiceSetup" + }, ">" ], "path": "packages/core/ui-settings/core-ui-settings-server-mocks/src/ui_settings_service.mock.ts", @@ -71,7 +77,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "UiSettingsServiceStart", + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.UiSettingsServiceStart", + "text": "UiSettingsServiceStart" + }, ">" ], "path": "packages/core/ui-settings/core-ui-settings-server-mocks/src/ui_settings_service.mock.ts", @@ -89,7 +101,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.IUiSettingsClient", + "text": "IUiSettingsClient" + }, ">" ], "path": "packages/core/ui-settings/core-ui-settings-server-mocks/src/ui_settings_service.mock.ts", diff --git a/api_docs/kbn_core_ui_settings_server_mocks.mdx b/api_docs/kbn_core_ui_settings_server_mocks.mdx index 50600bcf64e04..4080bb9344ff1 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: 2022-10-25 +date: 2022-11-07 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 6f2009e53efd2..78b3a0a2b648a 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_usage_data_server_internal.devdocs.json index 9673e8514d67a..793e3c65b04dc 100644 --- a/api_docs/kbn_core_usage_data_server_internal.devdocs.json +++ b/api_docs/kbn_core_usage_data_server_internal.devdocs.json @@ -30,7 +30,13 @@ "<", "InternalCoreUsageDataSetup", ", ", - "CoreUsageDataStart", + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreUsageDataStart", + "text": "CoreUsageDataStart" + }, ">" ], "path": "packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts", @@ -115,9 +121,21 @@ "({ savedObjects, elasticsearch, exposedConfigsToUsage }: ", "StartDeps", ") => { getCoreUsageData: () => Promise<", - "CoreUsageData", + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreUsageData", + "text": "CoreUsageData" + }, ">; getConfigsUsageData: () => Promise<", - "ConfigUsageData", + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.ConfigUsageData", + "text": "ConfigUsageData" + }, ">; }" ], "path": "packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts", diff --git a/api_docs/kbn_core_usage_data_server_internal.mdx b/api_docs/kbn_core_usage_data_server_internal.mdx index 030bd72752622..66a6f1ce67549 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_core_usage_data_server_mocks.devdocs.json index 0f3cc66101f7f..e134ee465bb94 100644 --- a/api_docs/kbn_core_usage_data_server_mocks.devdocs.json +++ b/api_docs/kbn_core_usage_data_server_mocks.devdocs.json @@ -35,9 +35,21 @@ "description": [], "signature": [ "() => jest.Mocked<", - "PublicMethodsOf", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicMethodsOf", + "text": "PublicMethodsOf" + }, "<", - "CoreUsageDataService", + { + "pluginId": "@kbn/core-usage-data-server-internal", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerInternalPluginApi", + "section": "def-server.CoreUsageDataService", + "text": "CoreUsageDataService" + }, ">>" ], "path": "packages/core/usage-data/core-usage-data-server-mocks/src/core_usage_data_service.mock.ts", @@ -74,7 +86,13 @@ "description": [], "signature": [ "{ getUsageStats: jest.MockInstance, []>; incrementSavedObjectsBulkCreate: jest.MockInstance, [options: ", "BaseIncrementOptions", "]>; incrementSavedObjectsBulkGet: jest.MockInstance, [options: ", @@ -125,7 +143,13 @@ "description": [], "signature": [ "() => jest.Mocked<", - "CoreUsageDataStart", + { + "pluginId": "@kbn/core-usage-data-server", + "scope": "server", + "docId": "kibKbnCoreUsageDataServerPluginApi", + "section": "def-server.CoreUsageDataStart", + "text": "CoreUsageDataStart" + }, ">" ], "path": "packages/core/usage-data/core-usage-data-server-mocks/src/core_usage_data_service.mock.ts", diff --git a/api_docs/kbn_core_usage_data_server_mocks.mdx b/api_docs/kbn_core_usage_data_server_mocks.mdx index 7bfb3657f332f..eeb402fb0c854 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: 2022-10-25 +date: 2022-11-07 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_crypto.mdx b/api_docs/kbn_crypto.mdx index 70733fc6323c7..e9d941d588fad 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: 2022-10-25 +date: 2022-11-07 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 2265f542a2a21..1396338737723 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index ec8346d8c9cac..d417fdc136849 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] --- import kbnDatemathObj from './kbn_datemath.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index ffd87d191394f..046c1c5b8bf41 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] --- import kbnDevCliErrorsObj from './kbn_dev_cli_errors.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_runner.devdocs.json b/api_docs/kbn_dev_cli_runner.devdocs.json index 7744755b64732..f0831b9d0d9c3 100644 --- a/api_docs/kbn_dev_cli_runner.devdocs.json +++ b/api_docs/kbn_dev_cli_runner.devdocs.json @@ -1336,7 +1336,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-dev-cli-runner/src/run.ts", "deprecated": false, @@ -1370,7 +1376,13 @@ "label": "procRunner", "description": [], "signature": [ - "ProcRunner" + { + "pluginId": "@kbn/dev-proc-runner", + "scope": "server", + "docId": "kibKbnDevProcRunnerPluginApi", + "section": "def-server.ProcRunner", + "text": "ProcRunner" + } ], "path": "packages/kbn-dev-cli-runner/src/run.ts", "deprecated": false, diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index 92fdd8cfdb11f..344d81f3268e2 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_dev_proc_runner.devdocs.json index 614ee960a9726..61867527c7ab5 100644 --- a/api_docs/kbn_dev_proc_runner.devdocs.json +++ b/api_docs/kbn_dev_proc_runner.devdocs.json @@ -47,7 +47,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-dev-proc-runner/src/proc_runner.ts", "deprecated": false, @@ -229,7 +235,13 @@ ], "signature": [ "(log: ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, ", fn: (procs: ", { "pluginId": "@kbn/dev-proc-runner", @@ -252,7 +264,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-dev-proc-runner/src/with_proc_runner.ts", "deprecated": false, diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index db8024bc9d65b..d796c3cbc55a5 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: 2022-10-25 +date: 2022-11-07 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 797835d7989c0..404231bce9d6c 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.devdocs.json b/api_docs/kbn_doc_links.devdocs.json index a12b3ae2f8792..59846f75e673f 100644 --- a/api_docs/kbn_doc_links.devdocs.json +++ b/api_docs/kbn_doc_links.devdocs.json @@ -160,7 +160,7 @@ "label": "apm", "description": [], "signature": [ - "{ readonly kibanaSettings: string; readonly supportedServiceMaps: string; readonly customLinks: string; readonly droppedTransactionSpans: string; readonly upgrading: string; readonly metaData: string; readonly overview: string; readonly tailSamplingPolicies: string; readonly elasticAgent: string; }" + "{ readonly kibanaSettings: string; readonly supportedServiceMaps: string; readonly customLinks: string; readonly droppedTransactionSpans: string; readonly upgrading: string; readonly metaData: string; readonly overview: string; readonly tailSamplingPolicies: string; readonly elasticAgent: string; readonly storageExplorer: string; readonly spanCompression: string; readonly transactionSampling: string; readonly indexLifecycleManagement: string; }" ], "path": "packages/kbn-doc-links/src/types.ts", "deprecated": false, diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index 7ffc904db03f2..ccbc5ff8381cd 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: 2022-10-25 +date: 2022-11-07 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 f939d98888dae..aa3dada4db121 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.devdocs.json b/api_docs/kbn_ebt_tools.devdocs.json index f488bb68fdf86..61d6c5217507e 100644 --- a/api_docs/kbn_ebt_tools.devdocs.json +++ b/api_docs/kbn_ebt_tools.devdocs.json @@ -32,7 +32,13 @@ ], "signature": [ "(analytics: Pick<", - "AnalyticsClient", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.IAnalyticsClient", + "text": "IAnalyticsClient" + }, ", \"registerEventType\">) => void" ], "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts", @@ -50,7 +56,13 @@ ], "signature": [ "Pick<", - "AnalyticsClient", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.IAnalyticsClient", + "text": "IAnalyticsClient" + }, ", \"registerEventType\">" ], "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts", @@ -73,7 +85,13 @@ ], "signature": [ "(analytics: Pick<", - "AnalyticsClient", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.IAnalyticsClient", + "text": "IAnalyticsClient" + }, ", \"reportEvent\">, eventData: ", { "pluginId": "@kbn/ebt-tools", @@ -99,7 +117,13 @@ ], "signature": [ "Pick<", - "AnalyticsClient", + { + "pluginId": "@kbn/analytics-client", + "scope": "common", + "docId": "kibKbnAnalyticsClientPluginApi", + "section": "def-common.IAnalyticsClient", + "text": "IAnalyticsClient" + }, ", \"reportEvent\">" ], "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts", @@ -114,7 +138,7 @@ "tags": [], "label": "eventData", "description": [ - "The data to send, conforming the structure of a {@link MetricEvent }." + "The data to send, conforming the structure of a {@link PerformanceMetricEvent }." ], "signature": [ { diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index ba5965a75fcc0..dc19ebe4475c1 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_es.devdocs.json b/api_docs/kbn_es.devdocs.json new file mode 100644 index 0000000000000..5ff9763c6c396 --- /dev/null +++ b/api_docs/kbn_es.devdocs.json @@ -0,0 +1,96 @@ +{ + "id": "@kbn/es", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/es", + "id": "def-server.run", + "type": "Function", + "tags": [], + "label": "run", + "description": [], + "signature": [ + "(defaults?: {}) => Promise" + ], + "path": "packages/kbn-es/src/cli.js", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/es", + "id": "def-server.run.$1", + "type": "Object", + "tags": [], + "label": "defaults", + "description": [], + "signature": [ + "{}" + ], + "path": "packages/kbn-es/src/cli.js", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/es", + "id": "def-server.SYSTEM_INDICES_SUPERUSER", + "type": "string", + "tags": [], + "label": "SYSTEM_INDICES_SUPERUSER", + "description": [], + "path": "packages/kbn-es/src/utils/native_realm.js", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/es", + "id": "def-server.Cluster", + "type": "Object", + "tags": [], + "label": "Cluster", + "description": [], + "signature": [ + "typeof ", + { + "pluginId": "@kbn/es", + "scope": "server", + "docId": "kibKbnEsPluginApi", + "section": "def-server.Cluster", + "text": "Cluster" + } + ], + "path": "packages/kbn-es/src/cluster.js", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx new file mode 100644 index 0000000000000..62ec1137120e3 --- /dev/null +++ b/api_docs/kbn_es.mdx @@ -0,0 +1,36 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnEsPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es'] +--- +import kbnEsObj from './kbn_es.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 4 | 0 | 4 | 0 | + +## Server + +### Objects + + +### Functions + + +### Consts, variables and types + + diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index ce09dbcd5efc1..8c0b1b35ebf5a 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: 2022-10-25 +date: 2022-11-07 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 e0b0502022dd5..379a99bc8b382 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] --- import kbnEsErrorsObj from './kbn_es_errors.devdocs.json'; diff --git a/api_docs/kbn_es_query.devdocs.json b/api_docs/kbn_es_query.devdocs.json index fafb95160c5b2..0b894c5ecbcba 100644 --- a/api_docs/kbn_es_query.devdocs.json +++ b/api_docs/kbn_es_query.devdocs.json @@ -115,7 +115,13 @@ ], "signature": [ "(filters: ", - "FilterItem", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterItem", + "text": "FilterItem" + }, "[]) => ", "CombinedFilter" ], @@ -133,7 +139,13 @@ "An array of CombinedFilterItem" ], "signature": [ - "FilterItem", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterItem", + "text": "FilterItem" + }, "[]" ], "path": "packages/kbn-es-query/src/filters/build_filters/combined_filter.ts", @@ -627,7 +639,13 @@ "text": "FILTERS" }, ", negate: boolean, disabled: boolean, params: ", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ", alias: string | null, store: ", { "pluginId": "@kbn/es-query", @@ -754,7 +772,13 @@ "label": "params", "description": [], "signature": [ - "Serializable" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + } ], "path": "packages/kbn-es-query/src/filters/build_filters/build_filters.ts", "deprecated": false, @@ -1657,7 +1681,13 @@ "(query: ", "QueryDslQueryContainer", ", queryStringOptions: string | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ", dateFormatTZ: string | undefined) => ", "QueryDslQueryContainer" ], @@ -1693,7 +1723,13 @@ ], "signature": [ "string | ", - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "packages/kbn-es-query/src/es_query/decorate_query.ts", "deprecated": false, @@ -4467,7 +4503,13 @@ "text": "EsQueryFiltersConfig" }, " & { allowLeadingWildcards?: boolean | undefined; queryStringOptions?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; }" ], "path": "packages/kbn-es-query/src/es_query/build_es_query.ts", @@ -4519,32 +4561,32 @@ "pluginId": "@kbn/es-query", "scope": "common", "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.ExistsFilter", - "text": "ExistsFilter" + "section": "def-common.RangeFilter", + "text": "RangeFilter" }, " | ", { "pluginId": "@kbn/es-query", "scope": "common", "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.PhraseFilter", - "text": "PhraseFilter" + "section": "def-common.PhrasesFilter", + "text": "PhrasesFilter" }, " | ", { "pluginId": "@kbn/es-query", "scope": "common", "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.PhrasesFilter", - "text": "PhrasesFilter" + "section": "def-common.ExistsFilter", + "text": "ExistsFilter" }, " | ", { "pluginId": "@kbn/es-query", "scope": "common", "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.RangeFilter", - "text": "RangeFilter" + "section": "def-common.PhraseFilter", + "text": "PhraseFilter" }, " | ", { @@ -4591,6 +4633,38 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/es-query", + "id": "def-common.FilterItem", + "type": "Type", + "tags": [], + "label": "FilterItem", + "description": [ + "\nEach item in an COMBINED filter may represent either one filter (to be ORed) or an array of filters (ANDed together before\nbecoming part of the OR clause)." + ], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + " | ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterItem", + "text": "FilterItem" + }, + "[]" + ], + "path": "packages/kbn-es-query/src/filters/build_filters/combined_filter.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/es-query", "id": "def-common.FilterMeta", diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index 2525f0d411df4..321b5c106d82f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 226 | 1 | 170 | 14 | +| 227 | 1 | 170 | 13 | ## Common diff --git a/api_docs/kbn_es_types.mdx b/api_docs/kbn_es_types.mdx index 881d5c5e06cd2..022caff0307f6 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-types'] --- import kbnEsTypesObj from './kbn_es_types.devdocs.json'; diff --git a/api_docs/kbn_eslint_plugin_imports.devdocs.json b/api_docs/kbn_eslint_plugin_imports.devdocs.json index 14ca36177b2ea..f42861e188de4 100644 --- a/api_docs/kbn_eslint_plugin_imports.devdocs.json +++ b/api_docs/kbn_eslint_plugin_imports.devdocs.json @@ -24,7 +24,13 @@ "(context: ", "Rule", ".RuleContext) => ", - "ImportResolver" + { + "pluginId": "@kbn/import-resolver", + "scope": "server", + "docId": "kibKbnImportResolverPluginApi", + "section": "def-server.ImportResolver", + "text": "ImportResolver" + } ], "path": "packages/kbn-eslint-plugin-imports/src/get_import_resolver.ts", "deprecated": false, diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index e4e4b3092a0d7..49e9c64f7bc49 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index 8d27a38047739..e4bb900d031a6 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index 5305014c72b76..83cf17efb1581 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] --- import kbnFindUsedNodeModulesObj from './kbn_find_used_node_modules.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_services.devdocs.json b/api_docs/kbn_ftr_common_functional_services.devdocs.json index bdd65a77687ad..736101b2bc5f6 100644 --- a/api_docs/kbn_ftr_common_functional_services.devdocs.json +++ b/api_docs/kbn_ftr_common_functional_services.devdocs.json @@ -310,10 +310,129 @@ "tags": [], "label": "EsArchiver", "description": [], + "path": "packages/kbn-ftr-common-functional-services/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/ftr-common-functional-services", + "id": "def-server.FtrProviderContext", + "type": "Type", + "tags": [], + "label": "FtrProviderContext", + "description": [], "signature": [ - "EsArchiver" + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.GenericFtrProviderContext", + "text": "GenericFtrProviderContext" + }, + "<{ es: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => ", + "default", + "; kibanaServer: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => ", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.KbnClient", + "text": "KbnClient" + }, + "; esArchiver: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => ", + { + "pluginId": "@kbn/es-archiver", + "scope": "server", + "docId": "kibKbnEsArchiverPluginApi", + "section": "def-server.EsArchiver", + "text": "EsArchiver" + }, + "; retry: typeof ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.RetryService", + "text": "RetryService" + }, + "; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => ", + "default", + "; kibanaServer: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => ", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.KbnClient", + "text": "KbnClient" + }, + "; esArchiver: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => ", + { + "pluginId": "@kbn/es-archiver", + "scope": "server", + "docId": "kibKbnEsArchiverPluginApi", + "section": "def-server.EsArchiver", + "text": "EsArchiver" + }, + "; retry: typeof ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.RetryService", + "text": "RetryService" + }, + "; }>, ProvidedTypeMap<{}>>" ], - "path": "packages/kbn-ftr-common-functional-services/index.ts", + "path": "packages/kbn-ftr-common-functional-services/services/ftr_provider_context.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -326,7 +445,13 @@ "label": "KibanaServer", "description": [], "signature": [ - "KbnClient" + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.KbnClient", + "text": "KbnClient" + } ], "path": "packages/kbn-ftr-common-functional-services/index.ts", "deprecated": false, @@ -355,7 +480,13 @@ "description": [], "signature": [ "({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", "default" ], @@ -372,19 +503,55 @@ "label": "__0", "description": [], "signature": [ - "GenericFtrProviderContext", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.GenericFtrProviderContext", + "text": "GenericFtrProviderContext" + }, "<{ es: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", "default", "; kibanaServer: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "KbnClient", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.KbnClient", + "text": "KbnClient" + }, "; esArchiver: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "EsArchiver", + { + "pluginId": "@kbn/es-archiver", + "scope": "server", + "docId": "kibKbnEsArchiverPluginApi", + "section": "def-server.EsArchiver", + "text": "EsArchiver" + }, "; retry: typeof ", { "pluginId": "@kbn/ftr-common-functional-services", @@ -393,20 +560,48 @@ "section": "def-server.RetryService", "text": "RetryService" }, - "; }, {}, ", - "ProvidedTypeMap", - "<{ es: ({ getService }: ", - "FtrProviderContext", + "; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", "default", "; kibanaServer: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "KbnClient", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.KbnClient", + "text": "KbnClient" + }, "; esArchiver: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "EsArchiver", + { + "pluginId": "@kbn/es-archiver", + "scope": "server", + "docId": "kibKbnEsArchiverPluginApi", + "section": "def-server.EsArchiver", + "text": "EsArchiver" + }, "; retry: typeof ", { "pluginId": "@kbn/ftr-common-functional-services", @@ -415,9 +610,7 @@ "section": "def-server.RetryService", "text": "RetryService" }, - "; }>, ", - "ProvidedTypeMap", - "<{}>>" + "; }>, ProvidedTypeMap<{}>>" ], "path": "packages/kbn-ftr-common-functional-services/services/es.ts", "deprecated": false, @@ -434,9 +627,21 @@ "description": [], "signature": [ "({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "KbnClient" + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.KbnClient", + "text": "KbnClient" + } ], "path": "packages/kbn-ftr-common-functional-services/services/all.ts", "deprecated": false, @@ -451,19 +656,55 @@ "label": "__0", "description": [], "signature": [ - "GenericFtrProviderContext", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.GenericFtrProviderContext", + "text": "GenericFtrProviderContext" + }, "<{ es: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", "default", "; kibanaServer: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "KbnClient", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.KbnClient", + "text": "KbnClient" + }, "; esArchiver: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "EsArchiver", + { + "pluginId": "@kbn/es-archiver", + "scope": "server", + "docId": "kibKbnEsArchiverPluginApi", + "section": "def-server.EsArchiver", + "text": "EsArchiver" + }, "; retry: typeof ", { "pluginId": "@kbn/ftr-common-functional-services", @@ -472,20 +713,48 @@ "section": "def-server.RetryService", "text": "RetryService" }, - "; }, {}, ", - "ProvidedTypeMap", - "<{ es: ({ getService }: ", - "FtrProviderContext", + "; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", "default", "; kibanaServer: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "KbnClient", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.KbnClient", + "text": "KbnClient" + }, "; esArchiver: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "EsArchiver", + { + "pluginId": "@kbn/es-archiver", + "scope": "server", + "docId": "kibKbnEsArchiverPluginApi", + "section": "def-server.EsArchiver", + "text": "EsArchiver" + }, "; retry: typeof ", { "pluginId": "@kbn/ftr-common-functional-services", @@ -494,9 +763,7 @@ "section": "def-server.RetryService", "text": "RetryService" }, - "; }>, ", - "ProvidedTypeMap", - "<{}>>" + "; }>, ProvidedTypeMap<{}>>" ], "path": "packages/kbn-ftr-common-functional-services/services/kibana_server/kibana_server.ts", "deprecated": false, @@ -513,9 +780,21 @@ "description": [], "signature": [ "({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "EsArchiver" + { + "pluginId": "@kbn/es-archiver", + "scope": "server", + "docId": "kibKbnEsArchiverPluginApi", + "section": "def-server.EsArchiver", + "text": "EsArchiver" + } ], "path": "packages/kbn-ftr-common-functional-services/services/all.ts", "deprecated": false, @@ -530,19 +809,55 @@ "label": "__0", "description": [], "signature": [ - "GenericFtrProviderContext", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.GenericFtrProviderContext", + "text": "GenericFtrProviderContext" + }, "<{ es: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", "default", "; kibanaServer: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "KbnClient", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.KbnClient", + "text": "KbnClient" + }, "; esArchiver: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "EsArchiver", + { + "pluginId": "@kbn/es-archiver", + "scope": "server", + "docId": "kibKbnEsArchiverPluginApi", + "section": "def-server.EsArchiver", + "text": "EsArchiver" + }, "; retry: typeof ", { "pluginId": "@kbn/ftr-common-functional-services", @@ -551,20 +866,48 @@ "section": "def-server.RetryService", "text": "RetryService" }, - "; }, {}, ", - "ProvidedTypeMap", - "<{ es: ({ getService }: ", - "FtrProviderContext", + "; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", "default", "; kibanaServer: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "KbnClient", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.KbnClient", + "text": "KbnClient" + }, "; esArchiver: ({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => ", - "EsArchiver", + { + "pluginId": "@kbn/es-archiver", + "scope": "server", + "docId": "kibKbnEsArchiverPluginApi", + "section": "def-server.EsArchiver", + "text": "EsArchiver" + }, "; retry: typeof ", { "pluginId": "@kbn/ftr-common-functional-services", @@ -573,9 +916,7 @@ "section": "def-server.RetryService", "text": "RetryService" }, - "; }>, ", - "ProvidedTypeMap", - "<{}>>" + "; }>, ProvidedTypeMap<{}>>" ], "path": "packages/kbn-ftr-common-functional-services/services/es_archiver.ts", "deprecated": false, diff --git a/api_docs/kbn_ftr_common_functional_services.mdx b/api_docs/kbn_ftr_common_functional_services.mdx index 3890e5602da1a..75f65f0eae208 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-services'] --- import kbnFtrCommonFunctionalServicesObj from './kbn_ftr_common_functional_services.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 28 | 0 | 28 | 2 | +| 29 | 0 | 29 | 1 | ## Server diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index e369d2555111e..4a33b6b931033 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] --- import kbnGenerateObj from './kbn_generate.devdocs.json'; diff --git a/api_docs/kbn_get_repo_files.mdx b/api_docs/kbn_get_repo_files.mdx index ecb9a6679ca54..440d044660bea 100644 --- a/api_docs/kbn_get_repo_files.mdx +++ b/api_docs/kbn_get_repo_files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-get-repo-files title: "@kbn/get-repo-files" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/get-repo-files plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/get-repo-files'] --- import kbnGetRepoFilesObj from './kbn_get_repo_files.devdocs.json'; diff --git a/api_docs/kbn_guided_onboarding.devdocs.json b/api_docs/kbn_guided_onboarding.devdocs.json index 01294a25e7450..5e713efb8ace7 100644 --- a/api_docs/kbn_guided_onboarding.devdocs.json +++ b/api_docs/kbn_guided_onboarding.devdocs.json @@ -63,7 +63,13 @@ "description": [], "signature": [ "({ navigateToApp, isDarkTheme, addBasePath, }: { navigateToApp: (appId: string, options?: ", - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined) => Promise; isDarkTheme: boolean; addBasePath: (url: string) => string; }) => JSX.Element" ], "path": "packages/kbn-guided-onboarding/src/components/landing_page/observability_link_card.tsx", @@ -90,7 +96,13 @@ "description": [], "signature": [ "(appId: string, options?: ", - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined) => Promise" ], "path": "packages/kbn-guided-onboarding/src/components/landing_page/observability_link_card.tsx", @@ -120,7 +132,13 @@ "label": "options", "description": [], "signature": [ - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined" ], "path": "packages/kbn-guided-onboarding/src/components/landing_page/observability_link_card.tsx", @@ -201,7 +219,7 @@ "label": "guideId", "description": [], "signature": [ - "\"search\" | \"security\" | \"observability\"" + "\"search\" | \"security\" | \"observability\" | \"testGuide\"" ], "path": "packages/kbn-guided-onboarding/src/types.ts", "deprecated": false, @@ -243,7 +261,13 @@ "label": "steps", "description": [], "signature": [ - "GuideStep", + { + "pluginId": "@kbn/guided-onboarding", + "scope": "common", + "docId": "kibKbnGuidedOnboardingPluginApi", + "section": "def-common.GuideStep", + "text": "GuideStep" + }, "[]" ], "path": "packages/kbn-guided-onboarding/src/types.ts", @@ -252,6 +276,48 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/guided-onboarding", + "id": "def-common.GuideStep", + "type": "Interface", + "tags": [], + "label": "GuideStep", + "description": [], + "path": "packages/kbn-guided-onboarding/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/guided-onboarding", + "id": "def-common.GuideStep.id", + "type": "CompoundType", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "\"add_data\" | \"view_dashboard\" | \"tour_observability\" | \"rules\" | \"alertsCases\" | \"search_experience\" | \"step1\" | \"step2\" | \"step3\"" + ], + "path": "packages/kbn-guided-onboarding/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/guided-onboarding", + "id": "def-common.GuideStep.status", + "type": "CompoundType", + "tags": [], + "label": "status", + "description": [], + "signature": [ + "\"complete\" | \"active\" | \"inactive\" | \"in_progress\" | \"ready_to_complete\"" + ], + "path": "packages/kbn-guided-onboarding/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false } ], "enums": [], @@ -264,7 +330,56 @@ "label": "GuideId", "description": [], "signature": [ - "\"search\" | \"security\" | \"observability\"" + "\"search\" | \"security\" | \"observability\" | \"testGuide\"" + ], + "path": "packages/kbn-guided-onboarding/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/guided-onboarding", + "id": "def-common.GuideStatus", + "type": "Type", + "tags": [], + "label": "GuideStatus", + "description": [ + "\nAllowed states for a guide:\n not_started: Guide has not been started\n in_progress: At least one step in the guide has been started\n ready_to_complete: All steps have been completed, but the \"Continue using Elastic\" button has not been clicked\n complete: All steps and the guide have been completed" + ], + "signature": [ + "\"complete\" | \"not_started\" | \"in_progress\" | \"ready_to_complete\"" + ], + "path": "packages/kbn-guided-onboarding/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/guided-onboarding", + "id": "def-common.GuideStepIds", + "type": "Type", + "tags": [], + "label": "GuideStepIds", + "description": [], + "signature": [ + "\"add_data\" | \"view_dashboard\" | \"tour_observability\" | \"rules\" | \"alertsCases\" | \"search_experience\" | \"step1\" | \"step2\" | \"step3\"" + ], + "path": "packages/kbn-guided-onboarding/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/guided-onboarding", + "id": "def-common.StepStatus", + "type": "Type", + "tags": [], + "label": "StepStatus", + "description": [ + "\nAllowed states for each step in a guide:\n inactive: Step has not started\n active: Step is ready to start (i.e., the guide has been started)\n in_progress: Step has been started and is in progress\n ready_to_complete: Step can be manually completed\n complete: Step has been completed" + ], + "signature": [ + "\"complete\" | \"active\" | \"inactive\" | \"in_progress\" | \"ready_to_complete\"" ], "path": "packages/kbn-guided-onboarding/src/types.ts", "deprecated": false, diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index da17ae4a2498a..6eef4cd70774a 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/guided-onboarding'] --- import kbnGuidedOnboardingObj from './kbn_guided_onboarding.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 17 | 0 | 17 | 2 | +| 23 | 0 | 21 | 1 | ## Common diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index d58614328550e..ca451803b5380 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] --- import kbnHandlebarsObj from './kbn_handlebars.devdocs.json'; diff --git a/api_docs/kbn_hapi_mocks.devdocs.json b/api_docs/kbn_hapi_mocks.devdocs.json index 37376eff5726b..6f8dc695e075a 100644 --- a/api_docs/kbn_hapi_mocks.devdocs.json +++ b/api_docs/kbn_hapi_mocks.devdocs.json @@ -35,7 +35,13 @@ "description": [], "signature": [ "(customization?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "Request", ">) => ", @@ -55,97 +61,241 @@ "description": [], "signature": [ "{ app?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "RequestApplicationState", "> | undefined; readonly auth?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "RequestAuth", "> | undefined; events?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "RequestEvents", "> | undefined; readonly headers?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "Util", ".Dictionary> | undefined; readonly info?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "RequestInfo", "> | undefined; readonly logs?: ", - "DeepPartialArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialArray", + "text": "DeepPartialArray" + }, "<", "RequestLog", "> | undefined; readonly method?: ", "Util", ".HTTP_METHODS_PARTIAL_LOWERCASE | undefined; readonly mime?: string | undefined; readonly orig?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "RequestOrig", "> | undefined; readonly params?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "Util", ".Dictionary> | undefined; readonly paramsArray?: ", - "DeepPartialArray", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialArray", + "text": "DeepPartialArray" + }, " | undefined; readonly path?: string | undefined; readonly payload?: string | object | ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "Readable", "> | ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, " | undefined; plugins?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "PluginsStates", "> | undefined; readonly pre?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "Util", ".Dictionary> | undefined; response?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "Boom", "> | ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "ResponseObject", "> | undefined; readonly preResponses?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "Util", ".Dictionary> | undefined; readonly query?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "RequestQuery", "> | undefined; readonly raw?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<{ req: ", "IncomingMessage", "; res: ", "ServerResponse", "; }> | undefined; readonly route?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "RequestRoute", "> | undefined; server?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "Server", "> | undefined; readonly state?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "Util", ".Dictionary> | undefined; readonly url?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", "URL", "> | undefined; active?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<() => boolean> | undefined; generateResponse?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<(source: string | object | null, options?: { variety?: string | undefined; prepare?: ((response: ", "ResponseObject", ") => Promise<", @@ -159,35 +309,83 @@ ") => void) | undefined; } | undefined) => ", "ResponseObject", "> | undefined; log?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<(tags: string | string[], data?: string | object | (() => string | object) | undefined) => void> | undefined; setMethod?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<(method: ", "Util", ".HTTP_METHODS_PARTIAL) => void> | undefined; setUrl?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<(url: string | ", "URL", ", stripTrailingSlash?: boolean | undefined) => void> | undefined; cookieAuth?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<{ set(session: object): void; set(key: string, value: string | object): void; clear(key?: string | undefined): void; ttl(milliseconds: number): void; }> | undefined; registerEvent?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<(events: ", "Event", " | ", "Event", "[]) => void> | undefined; registerPodium?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<(podiums: ", "node_modules/@hapi/podium/lib/index", " | ", "node_modules/@hapi/podium/lib/index", "[]) => void> | undefined; emit?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<(criteria: string | ", "EmitCriteria", ", data?: any) => Promise> | undefined; on?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<{ (criteria: string | ", @@ -205,7 +403,13 @@ ", context?: Tcontext | undefined): ", "Request", "; }> | undefined; addListener?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<{ (criteria: string | ", @@ -223,7 +427,13 @@ ", context?: Tcontext | undefined): ", "Request", "; }> | undefined; once?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<{ (criteria: string | Omit<", @@ -245,17 +455,35 @@ ", \"count\">): Promise; (criteria: string | Omit<", "CriteriaObject", ", \"count\">): Promise; }> | undefined; removeListener?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<(name: string, listener: ", "Listener", ") => ", "Request", "> | undefined; removeAllListeners?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<(name: string) => ", "Request", "> | undefined; hasListeners?: ", - "DeepPartialObject", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.DeepPartialObject", + "text": "DeepPartialObject" + }, "<(name: string) => boolean> | undefined; }" ], "path": "packages/kbn-hapi-mocks/src/request.ts", diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index 1040ec7db227b..300c2e52a498e 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] --- import kbnHapiMocksObj from './kbn_hapi_mocks.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_card.mdx b/api_docs/kbn_home_sample_data_card.mdx index 2d31773beaaa0..744a54abe522b 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: 2022-10-25 +date: 2022-11-07 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 3239fffc035bf..bac6e97225289 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: 2022-10-25 +date: 2022-11-07 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 957110288ffe5..dcf0881731046 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] --- import kbnI18nObj from './kbn_i18n.devdocs.json'; diff --git a/api_docs/kbn_i18n_react.devdocs.json b/api_docs/kbn_i18n_react.devdocs.json new file mode 100644 index 0000000000000..a10b9c7098be2 --- /dev/null +++ b/api_docs/kbn_i18n_react.devdocs.json @@ -0,0 +1,953 @@ +{ + "id": "@kbn/i18n-react", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedDate", + "type": "Class", + "tags": [], + "label": "FormattedDate", + "description": [], + "signature": [ + "ReactIntl.FormattedDate extends React.Component" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedHTMLMessage", + "type": "Class", + "tags": [], + "label": "FormattedHTMLMessage", + "description": [], + "signature": [ + "ReactIntl.FormattedHTMLMessage extends React.Component" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedMessage", + "type": "Class", + "tags": [], + "label": "FormattedMessage", + "description": [], + "signature": [ + "ReactIntl.FormattedMessage extends React.Component" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedNumber", + "type": "Class", + "tags": [], + "label": "FormattedNumber", + "description": [], + "signature": [ + "ReactIntl.FormattedNumber extends React.Component" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedPlural", + "type": "Class", + "tags": [], + "label": "FormattedPlural", + "description": [], + "signature": [ + "ReactIntl.FormattedPlural extends React.Component" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedRelative", + "type": "Class", + "tags": [], + "label": "FormattedRelative", + "description": [], + "signature": [ + "ReactIntl.FormattedRelative extends React.Component" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedTime", + "type": "Class", + "tags": [], + "label": "FormattedTime", + "description": [], + "signature": [ + "ReactIntl.FormattedTime extends React.Component" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.IntlProvider", + "type": "Class", + "tags": [], + "label": "IntlProvider", + "description": [], + "signature": [ + "ReactIntl.IntlProvider extends React.Component" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.IntlProvider.getChildContext", + "type": "Function", + "tags": [], + "label": "getChildContext", + "description": [], + "signature": [ + "() => { intl: ReactIntl.InjectedIntl; }" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.I18nProvider", + "type": "Function", + "tags": [], + "label": "I18nProvider", + "description": [ + "\nThe library uses the provider pattern to scope an i18n context to a tree\nof components. This component is used to setup the i18n context for a tree.\nIntlProvider should wrap react app's root component (inside each react render method)." + ], + "signature": [ + "({ children }: { children?: React.ReactNode; }) => JSX.Element" + ], + "path": "packages/kbn-i18n-react/src/provider.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.I18nProvider.$1", + "type": "Object", + "tags": [], + "label": "{ children }", + "description": [], + "signature": [ + "{ children?: React.ReactNode; }" + ], + "path": "packages/kbn-i18n-react/src/provider.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.injectIntl", + "type": "Function", + "tags": [], + "label": "injectIntl", + "description": [], + "signature": [ + "(component: React.ComponentType

, options: ReactIntl.InjectIntlConfig | undefined) => React.ComponentClass>, any> & { WrappedComponent: React.ComponentType

; }" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.injectIntl.$1", + "type": "CompoundType", + "tags": [], + "label": "component", + "description": [], + "signature": [ + "React.ComponentType

" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.injectIntl.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "ReactIntl.InjectIntlConfig | undefined" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.intlShape", + "type": "Function", + "tags": [], + "label": "intlShape", + "description": [], + "signature": [ + "ReactIntl.IntlShape" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.intlShape.$1", + "type": "Uncategorized", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "object" + ], + "path": "node_modules/@types/react/node_modules/@types/prop-types/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.intlShape.$2", + "type": "string", + "tags": [], + "label": "propName", + "description": [], + "path": "node_modules/@types/react/node_modules/@types/prop-types/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.intlShape.$3", + "type": "string", + "tags": [], + "label": "componentName", + "description": [], + "path": "node_modules/@types/react/node_modules/@types/prop-types/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.intlShape.$4", + "type": "string", + "tags": [], + "label": "location", + "description": [], + "path": "node_modules/@types/react/node_modules/@types/prop-types/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.intlShape.$5", + "type": "string", + "tags": [], + "label": "propFullName", + "description": [], + "path": "node_modules/@types/react/node_modules/@types/prop-types/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl", + "type": "Interface", + "tags": [], + "label": "InjectedIntl", + "description": [], + "signature": [ + "ReactIntl.InjectedIntl" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatDate", + "type": "Function", + "tags": [], + "label": "formatDate", + "description": [], + "signature": [ + "(value: ReactIntl.DateSource, options?: ReactIntl.IntlComponent.DateTimeFormatProps | undefined) => string" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatDate.$1", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "ReactIntl.DateSource" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatDate.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "ReactIntl.IntlComponent.DateTimeFormatProps | undefined" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatTime", + "type": "Function", + "tags": [], + "label": "formatTime", + "description": [], + "signature": [ + "(value: ReactIntl.DateSource, options?: ReactIntl.IntlComponent.DateTimeFormatProps | undefined) => string" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatTime.$1", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "ReactIntl.DateSource" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatTime.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "ReactIntl.IntlComponent.DateTimeFormatProps | undefined" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatRelative", + "type": "Function", + "tags": [], + "label": "formatRelative", + "description": [], + "signature": [ + "(value: ReactIntl.DateSource, options?: (ReactIntl.FormattedRelative.PropsBase & { now?: any; }) | undefined) => string" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatRelative.$1", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "ReactIntl.DateSource" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatRelative.$2", + "type": "CompoundType", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "(ReactIntl.FormattedRelative.PropsBase & { now?: any; }) | undefined" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatNumber", + "type": "Function", + "tags": [], + "label": "formatNumber", + "description": [], + "signature": [ + "(value: number, options?: ReactIntl.FormattedNumber.PropsBase | undefined) => string" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatNumber.$1", + "type": "number", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "number" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatNumber.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "ReactIntl.FormattedNumber.PropsBase | undefined" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatPlural", + "type": "Function", + "tags": [], + "label": "formatPlural", + "description": [], + "signature": [ + "(value: number, options?: ReactIntl.FormattedPlural.Base | undefined) => keyof ReactIntl.FormattedPlural.PropsBase" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatPlural.$1", + "type": "number", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "number" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatPlural.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "ReactIntl.FormattedPlural.Base | undefined" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatMessage", + "type": "Function", + "tags": [], + "label": "formatMessage", + "description": [], + "signature": [ + "(messageDescriptor: ReactIntl.FormattedMessage.MessageDescriptor, values?: { [key: string]: ReactIntl.MessageValue; } | undefined) => string" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatMessage.$1", + "type": "Object", + "tags": [], + "label": "messageDescriptor", + "description": [], + "signature": [ + "ReactIntl.FormattedMessage.MessageDescriptor" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatMessage.$2", + "type": "Object", + "tags": [], + "label": "values", + "description": [], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatMessage.$2.Unnamed", + "type": "IndexSignature", + "tags": [], + "label": "[key: string]: MessageValue", + "description": [], + "signature": [ + "[key: string]: ReactIntl.MessageValue" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatHTMLMessage", + "type": "Function", + "tags": [], + "label": "formatHTMLMessage", + "description": [], + "signature": [ + "(messageDescriptor: ReactIntl.FormattedMessage.MessageDescriptor, values?: { [key: string]: ReactIntl.MessageValue; } | undefined) => string" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatHTMLMessage.$1", + "type": "Object", + "tags": [], + "label": "messageDescriptor", + "description": [], + "signature": [ + "ReactIntl.FormattedMessage.MessageDescriptor" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatHTMLMessage.$2", + "type": "Object", + "tags": [], + "label": "values", + "description": [], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formatHTMLMessage.$2.Unnamed", + "type": "IndexSignature", + "tags": [], + "label": "[key: string]: MessageValue", + "description": [], + "signature": [ + "[key: string]: ReactIntl.MessageValue" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.locale", + "type": "string", + "tags": [], + "label": "locale", + "description": [], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.formats", + "type": "Any", + "tags": [], + "label": "formats", + "description": [], + "signature": [ + "any" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.messages", + "type": "Object", + "tags": [], + "label": "messages", + "description": [], + "signature": [ + "{ [id: string]: string; }" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.defaultLocale", + "type": "string", + "tags": [], + "label": "defaultLocale", + "description": [], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.defaultFormats", + "type": "Any", + "tags": [], + "label": "defaultFormats", + "description": [], + "signature": [ + "any" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.now", + "type": "Function", + "tags": [], + "label": "now", + "description": [], + "signature": [ + "() => number" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.onError", + "type": "Function", + "tags": [], + "label": "onError", + "description": [], + "signature": [ + "(error: string) => void" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntl.onError.$1", + "type": "string", + "tags": [], + "label": "error", + "description": [], + "signature": [ + "string" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntlProps", + "type": "Interface", + "tags": [], + "label": "InjectedIntlProps", + "description": [], + "signature": [ + "ReactIntl.InjectedIntlProps" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.InjectedIntlProps.intl", + "type": "Object", + "tags": [], + "label": "intl", + "description": [], + "signature": [ + "ReactIntl.InjectedIntl" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [ + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedDate", + "type": "Object", + "tags": [], + "label": "FormattedDate", + "description": [], + "signature": [ + "typeof ReactIntl.FormattedDate" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedMessage", + "type": "Object", + "tags": [], + "label": "FormattedMessage", + "description": [], + "signature": [ + "typeof ReactIntl.FormattedMessage" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedNumber", + "type": "Object", + "tags": [], + "label": "FormattedNumber", + "description": [], + "signature": [ + "typeof ReactIntl.FormattedNumber" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedPlural", + "type": "Object", + "tags": [], + "label": "FormattedPlural", + "description": [], + "signature": [ + "typeof ReactIntl.FormattedPlural" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedRelative", + "type": "Object", + "tags": [], + "label": "FormattedRelative", + "description": [], + "signature": [ + "typeof ReactIntl.FormattedRelative" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.FormattedTime", + "type": "Object", + "tags": [], + "label": "FormattedTime", + "description": [], + "signature": [ + "typeof ReactIntl.FormattedTime" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/i18n-react", + "id": "def-common.IntlProvider", + "type": "Object", + "tags": [], + "label": "IntlProvider", + "description": [], + "signature": [ + "typeof ReactIntl.IntlProvider" + ], + "path": "node_modules/@types/react-intl/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_i18n_react.mdx b/api_docs/kbn_i18n_react.mdx new file mode 100644 index 0000000000000..ef4d7ef4d95f4 --- /dev/null +++ b/api_docs/kbn_i18n_react.mdx @@ -0,0 +1,39 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnI18nReactPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n-react'] +--- +import kbnI18nReactObj from './kbn_i18n_react.devdocs.json'; + + + +Contact Kibana Core for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 61 | 0 | 1 | 0 | + +## Common + +### Objects + + +### Functions + + +### Classes + + +### Interfaces + + diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 0380a399cd775..609e63503ad4d 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_interpreter.devdocs.json b/api_docs/kbn_interpreter.devdocs.json index 4122a34219731..6da1bcc3242c3 100644 --- a/api_docs/kbn_interpreter.devdocs.json +++ b/api_docs/kbn_interpreter.devdocs.json @@ -236,6 +236,126 @@ } ], "functions": [ + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.addRegistries", + "type": "Function", + "tags": [], + "label": "addRegistries", + "description": [ + "\nAdd a new set of registries to an existing set of registries.\n" + ], + "signature": [ + "(registries: any, newRegistries: any) => any" + ], + "path": "packages/kbn-interpreter/src/common/registries.js", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.addRegistries.$1", + "type": "Any", + "tags": [], + "label": "registries", + "description": [ + "- The existing set of registries" + ], + "signature": [ + "any" + ], + "path": "packages/kbn-interpreter/src/common/registries.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.addRegistries.$2", + "type": "Any", + "tags": [], + "label": "newRegistries", + "description": [ + "- The new set of registries" + ], + "signature": [ + "any" + ], + "path": "packages/kbn-interpreter/src/common/registries.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.castProvider", + "type": "Function", + "tags": [], + "label": "castProvider", + "description": [], + "signature": [ + "(types: any) => (node: any, toTypeNames: any) => any" + ], + "path": "packages/kbn-interpreter/src/common/lib/cast.js", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.castProvider.$1", + "type": "Any", + "tags": [], + "label": "types", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-interpreter/src/common/lib/cast.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.Fn", + "type": "Function", + "tags": [], + "label": "Fn", + "description": [], + "signature": [ + "(config: any) => void" + ], + "path": "packages/kbn-interpreter/src/common/lib/fn.js", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.Fn.$1", + "type": "Any", + "tags": [], + "label": "config", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-interpreter/src/common/lib/fn.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/interpreter", "id": "def-common.fromExpression", @@ -291,6 +411,56 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.getByAlias", + "type": "Function", + "tags": [], + "label": "getByAlias", + "description": [ + "\nThis is used for looking up function/argument definitions. It looks through\nthe given object/array for a case-insensitive match, which could be either the\n`name` itself, or something under the `aliases` property." + ], + "signature": [ + "(specs: any, name: any) => any" + ], + "path": "packages/kbn-interpreter/src/common/lib/get_by_alias.js", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.getByAlias.$1", + "type": "Any", + "tags": [], + "label": "specs", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-interpreter/src/common/lib/get_by_alias.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.getByAlias.$2", + "type": "Any", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-interpreter/src/common/lib/get_by_alias.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/interpreter", "id": "def-common.getType", @@ -390,6 +560,97 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.register", + "type": "Function", + "tags": [], + "label": "register", + "description": [ + "\nRegister a set of interpreter specs (functions, types, renderers, etc)\n" + ], + "signature": [ + "(registries: any, specs: any) => any" + ], + "path": "packages/kbn-interpreter/src/common/registries.js", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.register.$1", + "type": "Any", + "tags": [], + "label": "registries", + "description": [ + "- The set of registries" + ], + "signature": [ + "any" + ], + "path": "packages/kbn-interpreter/src/common/registries.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.register.$2", + "type": "Any", + "tags": [], + "label": "specs", + "description": [ + "- The specs to be regsitered (e.g. { types: [], browserFunctions: [] })" + ], + "signature": [ + "any" + ], + "path": "packages/kbn-interpreter/src/common/registries.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.registryFactory", + "type": "Function", + "tags": [], + "label": "registryFactory", + "description": [ + "\nA convenience function for exposing registries and register in a plugin-friendly way\nas a global in the browser, and as server.plugins.interpreter.register | registries\non the server.\n" + ], + "signature": [ + "(registries: any) => { registries(): any; register(specs: any): any; }" + ], + "path": "packages/kbn-interpreter/src/common/registries.js", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/interpreter", + "id": "def-common.registryFactory.$1", + "type": "Any", + "tags": [], + "label": "registries", + "description": [ + "- The registries to wrap." + ], + "signature": [ + "any" + ], + "path": "packages/kbn-interpreter/src/common/registries.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/interpreter", "id": "def-common.safeElementFromExpression", diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index 2406a0e382f6e..f08117a71c5a8 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; @@ -21,7 +21,7 @@ Contact App Services for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 35 | 4 | 35 | 0 | +| 50 | 13 | 41 | 0 | ## Common diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index 5f170cdd04715..9ccd0fa8c3992 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] --- import kbnIoTsUtilsObj from './kbn_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index fde2dcb60dc53..1d3b5f5c5ed3c 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_journeys.devdocs.json b/api_docs/kbn_journeys.devdocs.json index 601334a03f8e8..42ac65b7eead4 100644 --- a/api_docs/kbn_journeys.devdocs.json +++ b/api_docs/kbn_journeys.devdocs.json @@ -48,7 +48,13 @@ "text": "Journey" }, ") => ", - "FtrConfigProvider" + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.FtrConfigProvider", + "text": "FtrConfigProvider" + } ], "path": "packages/kbn-journeys/journey/journey.ts", "deprecated": false, @@ -262,7 +268,13 @@ ], "signature": [ "({ getService }: ", - "FtrProviderContext", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + }, ") => void" ], "path": "packages/kbn-journeys/journey/journey.ts", @@ -277,7 +289,13 @@ "label": "{ getService }", "description": [], "signature": [ - "FtrProviderContext" + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "server", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-server.FtrProviderContext", + "text": "FtrProviderContext" + } ], "path": "packages/kbn-journeys/journey/journey.ts", "deprecated": false, diff --git a/api_docs/kbn_journeys.mdx b/api_docs/kbn_journeys.mdx index 85587805fc4d0..65ac84d993c8e 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/journeys'] --- import kbnJourneysObj from './kbn_journeys.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index 77fcb7c94195c..7650b31ee2832 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-schema'] --- import kbnKibanaManifestSchemaObj from './kbn_kibana_manifest_schema.devdocs.json'; diff --git a/api_docs/kbn_language_documentation_popover.mdx b/api_docs/kbn_language_documentation_popover.mdx index c037eb35a57a6..1ffc41056e934 100644 --- a/api_docs/kbn_language_documentation_popover.mdx +++ b/api_docs/kbn_language_documentation_popover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-language-documentation-popover title: "@kbn/language-documentation-popover" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/language-documentation-popover plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/language-documentation-popover'] --- import kbnLanguageDocumentationPopoverObj from './kbn_language_documentation_popover.devdocs.json'; diff --git a/api_docs/kbn_logging.devdocs.json b/api_docs/kbn_logging.devdocs.json index ae5f4c09df969..c4b55ec411dce 100644 --- a/api_docs/kbn_logging.devdocs.json +++ b/api_docs/kbn_logging.devdocs.json @@ -439,6 +439,44 @@ ], "returnComment": [] }, + { + "parentPluginId": "@kbn/logging", + "id": "def-server.Logger.isLevelEnabled", + "type": "Function", + "tags": [], + "label": "isLevelEnabled", + "description": [ + "\nChecks if given level is currently enabled for this logger.\nCan be used to wrap expensive logging operations into conditional blocks\n" + ], + "signature": [ + "(level: ", + "LogLevelId", + ") => boolean" + ], + "path": "packages/kbn-logging/src/logger.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/logging", + "id": "def-server.Logger.isLevelEnabled.$1", + "type": "CompoundType", + "tags": [], + "label": "level", + "description": [ + "The log level to check for." + ], + "signature": [ + "LogLevelId" + ], + "path": "packages/kbn-logging/src/logger.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "@kbn/logging", "id": "def-server.Logger.get", diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index a8e7e11cba0ac..91916cd4be7c8 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 30 | 0 | 5 | 37 | +| 32 | 0 | 5 | 39 | ## Server diff --git a/api_docs/kbn_logging_mocks.devdocs.json b/api_docs/kbn_logging_mocks.devdocs.json index fdd0f4b0a5b4d..c479b9353e59a 100644 --- a/api_docs/kbn_logging_mocks.devdocs.json +++ b/api_docs/kbn_logging_mocks.devdocs.json @@ -23,23 +23,73 @@ "description": [], "signature": [ "{ trace: jest.MockInstance; debug: jest.MockInstance; info: jest.MockInstance; warn: jest.MockInstance; error: jest.MockInstance; fatal: jest.MockInstance; log: jest.MockInstance; isLevelEnabled: jest.MockInstance; get: jest.MockInstance<", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, ", string[]>; } & ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " & { context: string[]; }" ], "path": "packages/kbn-logging-mocks/src/logger.mock.ts", @@ -130,23 +180,73 @@ "description": [], "signature": [ "{ trace: jest.MockInstance; debug: jest.MockInstance; info: jest.MockInstance; warn: jest.MockInstance; error: jest.MockInstance; fatal: jest.MockInstance; log: jest.MockInstance; isLevelEnabled: jest.MockInstance; get: jest.MockInstance<", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, ", string[]>; } & ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " & { context: string[]; }" ], "path": "packages/kbn-logging-mocks/src/logger.mock.ts", @@ -172,19 +272,55 @@ "text": "MockedLogger" }, ") => { debug: [message: string, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; error: [errorOrMessage: string | Error, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; fatal: [errorOrMessage: string | Error, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; info: [message: string, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; log: [record: ", "LogRecord", "][]; trace: [message: string, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; warn: [errorOrMessage: string | Error, meta?: ", - "LogMeta", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + }, " | undefined][]; }" ], "path": "packages/kbn-logging-mocks/src/logger.mock.ts", @@ -201,23 +337,73 @@ "description": [], "signature": [ "{ trace: jest.MockInstance; debug: jest.MockInstance; info: jest.MockInstance; warn: jest.MockInstance; error: jest.MockInstance; fatal: jest.MockInstance; log: jest.MockInstance; isLevelEnabled: jest.MockInstance; get: jest.MockInstance<", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, ", string[]>; } & ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " & { context: string[]; }" ], "path": "packages/kbn-logging-mocks/src/logger.mock.ts", diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index 50e5a40635291..52fedb1a9be37 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index 35e73b03dd323..78b58a4a65caa 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-vscode-config'] --- import kbnManagedVscodeConfigObj from './kbn_managed_vscode_config.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index e84c326379ae0..51ff0e3f27f92 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] --- import kbnMapboxGlObj from './kbn_mapbox_gl.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.devdocs.json b/api_docs/kbn_ml_agg_utils.devdocs.json index 6c021a7a5bc78..709185e8d6a49 100644 --- a/api_docs/kbn_ml_agg_utils.devdocs.json +++ b/api_docs/kbn_ml_agg_utils.devdocs.json @@ -74,7 +74,13 @@ ], "signature": [ "(client: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", indexPattern: string, query: ", "QueryDslQueryContainer", ", fields: ", @@ -87,7 +93,7 @@ }, "[], samplerShardSize: number, runtimeMappings?: ", "MappingRuntimeFields", - " | undefined) => Promise<", + " | undefined, abortSignal?: AbortSignal | undefined) => Promise<", { "pluginId": "@kbn/ml-agg-utils", "scope": "server", @@ -109,7 +115,13 @@ "label": "client", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", "deprecated": false, @@ -198,6 +210,21 @@ "deprecated": false, "trackAdoption": false, "isRequired": false + }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.fetchAggIntervals.$7", + "type": "Object", + "tags": [], + "label": "abortSignal", + "description": [], + "signature": [ + "AbortSignal | undefined" + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false } ], "returnComment": [], @@ -214,7 +241,13 @@ ], "signature": [ "(client: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", indexPattern: string, query: any, fields: ", { "pluginId": "@kbn/ml-agg-utils", @@ -225,8 +258,14 @@ }, ", samplerShardSize: number, runtimeMappings?: ", "MappingRuntimeFields", - " | undefined) => Promise<(", - "NumericChartData", + " | undefined, abortSignal?: AbortSignal | undefined) => Promise<(", + { + "pluginId": "@kbn/ml-agg-utils", + "scope": "server", + "docId": "kibKbnMlAggUtilsPluginApi", + "section": "def-server.NumericChartData", + "text": "NumericChartData" + }, " | OrdinalChartData | UnsupportedChartData)[]>" ], "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", @@ -243,7 +282,13 @@ "Elasticsearch Client" ], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", "deprecated": false, @@ -341,6 +386,21 @@ "deprecated": false, "trackAdoption": false, "isRequired": false + }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.fetchHistogramsForFields.$7", + "type": "Object", + "tags": [], + "label": "abortSignal", + "description": [], + "signature": [ + "AbortSignal | undefined" + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false } ], "returnComment": [ @@ -514,7 +574,13 @@ "text": "ChangePoint" }, " extends ", - "FieldValuePair" + { + "pluginId": "@kbn/ml-agg-utils", + "scope": "server", + "docId": "kibKbnMlAggUtilsPluginApi", + "section": "def-server.FieldValuePair", + "text": "FieldValuePair" + } ], "path": "x-pack/packages/ml/agg_utils/src/types.ts", "deprecated": false, @@ -777,7 +843,13 @@ "text": "ChangePointHistogram" }, " extends ", - "FieldValuePair" + { + "pluginId": "@kbn/ml-agg-utils", + "scope": "server", + "docId": "kibKbnMlAggUtilsPluginApi", + "section": "def-server.FieldValuePair", + "text": "FieldValuePair" + } ], "path": "x-pack/packages/ml/agg_utils/src/types.ts", "deprecated": false, @@ -867,6 +939,47 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.FieldValuePair", + "type": "Interface", + "tags": [], + "label": "FieldValuePair", + "description": [ + "\nField/value pair definition." + ], + "path": "x-pack/packages/ml/agg_utils/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.FieldValuePair.fieldName", + "type": "string", + "tags": [], + "label": "fieldName", + "description": [], + "path": "x-pack/packages/ml/agg_utils/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.FieldValuePair.fieldValue", + "type": "CompoundType", + "tags": [], + "label": "fieldValue", + "description": [], + "signature": [ + "string | number" + ], + "path": "x-pack/packages/ml/agg_utils/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/ml-agg-utils", "id": "def-server.HistogramField", @@ -899,7 +1012,13 @@ "label": "type", "description": [], "signature": [ - "KBN_FIELD_TYPES" + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } ], "path": "x-pack/packages/ml/agg_utils/src/types.ts", "deprecated": false, @@ -955,6 +1074,86 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.NumericChartData", + "type": "Interface", + "tags": [], + "label": "NumericChartData", + "description": [ + "\nInterface to describe the data structure returned for numeric based charts." + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.NumericChartData.data", + "type": "Array", + "tags": [], + "label": "data", + "description": [], + "signature": [ + "NumericDataItem[]" + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.NumericChartData.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.NumericChartData.interval", + "type": "number", + "tags": [], + "label": "interval", + "description": [], + "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.NumericChartData.stats", + "type": "Object", + "tags": [], + "label": "stats", + "description": [], + "signature": [ + "[number, number]" + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.NumericChartData.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"numeric\"" + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/ml-agg-utils", "id": "def-server.NumericColumnStats", @@ -1003,6 +1202,68 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.NumericHistogramField", + "type": "Interface", + "tags": [], + "label": "NumericHistogramField", + "description": [ + "\nNumeric based histogram field interface, limited to `date` and `number`." + ], + "signature": [ + { + "pluginId": "@kbn/ml-agg-utils", + "scope": "server", + "docId": "kibKbnMlAggUtilsPluginApi", + "section": "def-server.NumericHistogramField", + "text": "NumericHistogramField" + }, + " extends ", + { + "pluginId": "@kbn/ml-agg-utils", + "scope": "server", + "docId": "kibKbnMlAggUtilsPluginApi", + "section": "def-server.HistogramField", + "text": "HistogramField" + } + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-server.NumericHistogramField.type", + "type": "CompoundType", + "tags": [], + "label": "type", + "description": [], + "signature": [ + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, + ".DATE | ", + { + "pluginId": "@kbn/field-types", + "scope": "common", + "docId": "kibKbnFieldTypesPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, + ".NUMBER" + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false } ], "enums": [], @@ -1018,7 +1279,13 @@ ], "signature": [ "(", - "NumericHistogramField", + { + "pluginId": "@kbn/ml-agg-utils", + "scope": "server", + "docId": "kibKbnMlAggUtilsPluginApi", + "section": "def-server.NumericHistogramField", + "text": "NumericHistogramField" + }, " | NumericHistogramFieldWithColumnStats | OrdinalHistogramField | UnsupportedHistogramField)[]" ], "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index 514f5d0224235..f31bc70c929ba 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact Machine Learning UI for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 64 | 2 | 44 | 3 | +| 77 | 2 | 54 | 0 | ## Server diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index 0e13cded4d10e..4ee5d1a1250b8 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: 2022-10-25 +date: 2022-11-07 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_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index 447c4fe55fa29..8bbccf04e4a37 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] --- import kbnMlStringHashObj from './kbn_ml_string_hash.devdocs.json'; diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index 747b0372a7b9d..847fd9fb16614 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_optimizer.devdocs.json b/api_docs/kbn_optimizer.devdocs.json index 0eb4cd95ddadd..5d285a63ef574 100644 --- a/api_docs/kbn_optimizer.devdocs.json +++ b/api_docs/kbn_optimizer.devdocs.json @@ -342,7 +342,13 @@ "description": [], "signature": [ "(log: ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, ") => ", "MonoTypeOperatorFunction", "<", @@ -367,7 +373,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-optimizer/src/log_optimizer_progress.ts", "deprecated": false, @@ -387,7 +399,13 @@ "description": [], "signature": [ "(log: ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, ", config: ", { "pluginId": "@kbn/optimizer", @@ -426,7 +444,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-optimizer/src/log_optimizer_state.ts", "deprecated": false, @@ -518,7 +542,13 @@ "description": [], "signature": [ "(log: ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, ", config: ", { "pluginId": "@kbn/optimizer", @@ -557,7 +587,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-optimizer/src/report_optimizer_timings.ts", "deprecated": false, @@ -783,7 +819,13 @@ "description": [], "signature": [ "(log: ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, ", config: ", { "pluginId": "@kbn/optimizer", @@ -806,7 +848,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-optimizer/src/limits.ts", "deprecated": false, diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index 35f8a0d7bd223..3489ae86320ef 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: 2022-10-25 +date: 2022-11-07 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 1f5f3347cf82b..e0cacc5344c45 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] --- import kbnOptimizerWebpackHelpersObj from './kbn_optimizer_webpack_helpers.devdocs.json'; diff --git a/api_docs/kbn_osquery_io_ts_types.mdx b/api_docs/kbn_osquery_io_ts_types.mdx index ec4bcda7cb2e3..471701a0b5742 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/osquery-io-ts-types'] --- import kbnOsqueryIoTsTypesObj from './kbn_osquery_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index cc8cd64c1cb68..1b9737809f889 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] --- import kbnPerformanceTestingDatasetExtractorObj from './kbn_performance_testing_dataset_extractor.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index 403160feced5b..f66dc7c706682 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: 2022-10-25 +date: 2022-11-07 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 9a0282723d003..15bea953c1ac9 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index e1565bda96154..6e20418559a07 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_repo_source_classifier.devdocs.json b/api_docs/kbn_repo_source_classifier.devdocs.json index ed76a94aa46a9..a23c140d773d2 100644 --- a/api_docs/kbn_repo_source_classifier.devdocs.json +++ b/api_docs/kbn_repo_source_classifier.devdocs.json @@ -43,7 +43,13 @@ "label": "resolver", "description": [], "signature": [ - "ImportResolver" + { + "pluginId": "@kbn/import-resolver", + "scope": "server", + "docId": "kibKbnImportResolverPluginApi", + "section": "def-server.ImportResolver", + "text": "ImportResolver" + } ], "path": "packages/kbn-repo-source-classifier/src/repo_source_classifier.ts", "deprecated": false, diff --git a/api_docs/kbn_repo_source_classifier.mdx b/api_docs/kbn_repo_source_classifier.mdx index fb0fd0854d7c9..fa3208406d901 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-source-classifier'] --- import kbnRepoSourceClassifierObj from './kbn_repo_source_classifier.devdocs.json'; diff --git a/api_docs/kbn_rule_data_utils.devdocs.json b/api_docs/kbn_rule_data_utils.devdocs.json index bde52540e8d2c..1071f55b81cca 100644 --- a/api_docs/kbn_rule_data_utils.devdocs.json +++ b/api_docs/kbn_rule_data_utils.devdocs.json @@ -28,7 +28,13 @@ "description": [], "signature": [ "(params?: GetEsQueryConfigParamType | undefined) => ", - "EsQueryConfig" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.EsQueryConfig", + "text": "EsQueryConfig" + } ], "path": "packages/kbn-rule-data-utils/src/alerts_as_data_rbac.ts", "deprecated": false, @@ -844,6 +850,156 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_FRAMEWORK", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_FRAMEWORK", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.framework\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TACTIC_ID", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TACTIC_ID", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.tactic.id\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TACTIC_NAME", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TACTIC_NAME", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.tactic.name\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TACTIC_REFERENCE", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TACTIC_REFERENCE", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.tactic.reference\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_ID", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_ID", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.id\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_NAME", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_NAME", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.name\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_REFERENCE", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_REFERENCE", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.reference\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.subtechnique.id\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.subtechnique.name\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.subtechnique.reference\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/rule-data-utils", "id": "def-common.ALERT_TIME_RANGE", @@ -1092,7 +1248,7 @@ "label": "TechnicalRuleDataFieldName", "description": [], "signature": [ - "\"tags\" | \"kibana\" | \"@timestamp\" | \"kibana.alert.rule.rule_type_id\" | \"kibana.alert.rule.consumer\" | \"event.action\" | \"kibana.alert.rule.execution.uuid\" | \"kibana.alert.rule.parameters\" | \"kibana.alert.rule.producer\" | \"kibana.space_ids\" | \"kibana.alert.uuid\" | \"kibana.alert.instance.id\" | \"kibana.alert.start\" | \"kibana.alert.time_range\" | \"kibana.alert.end\" | \"kibana.alert.duration.us\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.version\" | \"ecs.version\" | \"kibana.alert.risk_score\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.system_status\" | \"kibana.alert.action_group\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"kibana.alert.rule.category\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.created_at\" | \"kibana.alert.rule.created_by\" | \"kibana.alert.rule.description\" | \"kibana.alert.rule.enabled\" | \"kibana.alert.rule.from\" | \"kibana.alert.rule.interval\" | \"kibana.alert.rule.license\" | \"kibana.alert.rule.name\" | \"kibana.alert.rule.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.tags\" | \"kibana.alert.rule.to\" | \"kibana.alert.rule.type\" | \"kibana.alert.rule.updated_at\" | \"kibana.alert.rule.updated_by\" | \"kibana.alert.rule.version\" | \"event.kind\" | \"event.module\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.building_block_type\" | \"kibana.alert.rule.exceptions_list\" | \"kibana.alert.rule.namespace\" | \"kibana.alert\" | \"kibana.alert.rule\"" + "\"tags\" | \"kibana\" | \"@timestamp\" | \"kibana.alert.rule.rule_type_id\" | \"kibana.alert.rule.consumer\" | \"event.action\" | \"kibana.alert.rule.execution.uuid\" | \"kibana.alert\" | \"kibana.alert.rule\" | \"kibana.alert.rule.parameters\" | \"kibana.alert.rule.producer\" | \"kibana.space_ids\" | \"kibana.alert.uuid\" | \"kibana.alert.instance.id\" | \"kibana.alert.start\" | \"kibana.alert.time_range\" | \"kibana.alert.end\" | \"kibana.alert.duration.us\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.version\" | \"ecs.version\" | \"kibana.alert.risk_score\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.system_status\" | \"kibana.alert.action_group\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"kibana.alert.rule.category\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.created_at\" | \"kibana.alert.rule.created_by\" | \"kibana.alert.rule.description\" | \"kibana.alert.rule.enabled\" | \"kibana.alert.rule.from\" | \"kibana.alert.rule.interval\" | \"kibana.alert.rule.license\" | \"kibana.alert.rule.name\" | \"kibana.alert.rule.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.tags\" | \"kibana.alert.rule.to\" | \"kibana.alert.rule.type\" | \"kibana.alert.rule.updated_at\" | \"kibana.alert.rule.updated_by\" | \"kibana.alert.rule.version\" | \"event.kind\" | \"event.module\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.building_block_type\" | \"kibana.alert.rule.exceptions_list\" | \"kibana.alert.rule.namespace\" | \"kibana.alert.rule.threat.framework\" | \"kibana.alert.rule.threat.tactic.id\" | \"kibana.alert.rule.threat.tactic.name\" | \"kibana.alert.rule.threat.tactic.reference\" | \"kibana.alert.rule.threat.technique.id\" | \"kibana.alert.rule.threat.technique.name\" | \"kibana.alert.rule.threat.technique.reference\" | \"kibana.alert.rule.threat.technique.subtechnique.id\" | \"kibana.alert.rule.threat.technique.subtechnique.name\" | \"kibana.alert.rule.threat.technique.subtechnique.reference\"" ], "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", "deprecated": false, diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index 60b276fad7485..760becf8c6db9 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] --- import kbnRuleDataUtilsObj from './kbn_rule_data_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 75 | 0 | 72 | 0 | +| 85 | 0 | 82 | 0 | ## Common diff --git a/api_docs/kbn_securitysolution_autocomplete.devdocs.json b/api_docs/kbn_securitysolution_autocomplete.devdocs.json index 7623b6034551c..5f57ad28f5f73 100644 --- a/api_docs/kbn_securitysolution_autocomplete.devdocs.json +++ b/api_docs/kbn_securitysolution_autocomplete.devdocs.json @@ -208,7 +208,13 @@ ], "signature": [ "(param: string | undefined, field: ", - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined, isRequired: boolean, touched: boolean) => string | null | undefined" ], "path": "packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.ts", @@ -238,7 +244,13 @@ "label": "field", "description": [], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined" ], "path": "packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.ts", @@ -336,7 +348,13 @@ "text": "AutocompleteListsData" }, ", field?: (", - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " & { esTypes?: string[] | undefined; }) | undefined) => ", { "pluginId": "@kbn/securitysolution-autocomplete", @@ -384,7 +402,13 @@ ], "signature": [ "(", - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " & { esTypes?: string[] | undefined; }) | undefined" ], "path": "packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts", @@ -521,9 +545,21 @@ ], "signature": [ "(field: ", - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined) => ", - "OperatorOption", + { + "pluginId": "@kbn/securitysolution-list-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionListUtilsPluginApi", + "section": "def-common.OperatorOption", + "text": "OperatorOption" + }, "[]" ], "path": "packages/kbn-securitysolution-autocomplete/src/get_operators/index.ts", @@ -540,7 +576,13 @@ "DataViewFieldBase selected field" ], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined" ], "path": "packages/kbn-securitysolution-autocomplete/src/get_operators/index.ts", @@ -629,7 +671,13 @@ ], "signature": [ "(param: string | undefined, field: ", - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined, isRequired: boolean, touched: boolean) => string | undefined" ], "path": "packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts", @@ -663,7 +711,13 @@ "the selected field" ], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined" ], "path": "packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts", @@ -916,7 +970,13 @@ "label": "indexPattern", "description": [], "signature": [ - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, " | undefined" ], "path": "packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts", @@ -931,7 +991,13 @@ "label": "operatorType", "description": [], "signature": [ - "ListOperatorTypeEnum" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + } ], "path": "packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts", "deprecated": false, @@ -956,7 +1022,13 @@ "label": "selectedField", "description": [], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined" ], "path": "packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts", diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index cc317aa7c6177..be5765664a9f9 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] --- import kbnSecuritysolutionAutocompleteObj from './kbn_securitysolution_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 0a12259158109..a59553a0e4d68 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_exception_list_components.devdocs.json b/api_docs/kbn_securitysolution_exception_list_components.devdocs.json index ed2e9262906b9..c68daa8df8836 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.devdocs.json +++ b/api_docs/kbn_securitysolution_exception_list_components.devdocs.json @@ -510,7 +510,7 @@ "label": "item", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/index.tsx", "deprecated": false, @@ -577,7 +577,7 @@ "label": "item", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx", "deprecated": false, @@ -623,7 +623,7 @@ "label": "formattedDateComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" + "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"br\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx", "deprecated": false, @@ -637,7 +637,7 @@ "label": "securityLinkAnchorComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" + "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"br\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx", "deprecated": false, @@ -693,7 +693,7 @@ "label": "exceptionItem", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -707,7 +707,13 @@ "label": "listType", "description": [], "signature": [ - "ExceptionListTypeEnum" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ExceptionListTypeEnum", + "text": "ExceptionListTypeEnum" + } ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -770,7 +776,7 @@ "label": "securityLinkAnchorComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" + "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"br\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -784,7 +790,7 @@ "label": "formattedDateComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" + "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"br\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -878,7 +884,7 @@ "label": "onEditException", "description": [], "signature": [ - "(item: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => void" + "(item: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => void" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -892,7 +898,7 @@ "label": "item", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -1241,13 +1247,13 @@ }, { "parentPluginId": "@kbn/securitysolution-exception-list-components", - "id": "def-common.Rule.exception_lists", + "id": "def-common.Rule.exception_list", "type": "Array", "tags": [], - "label": "exception_lists", + "label": "exception_list", "description": [], "signature": [ - "{ id: string; list_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; namespace_type: \"single\" | \"agnostic\"; }[]" + "{ id: string; list_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; namespace_type: \"single\" | \"agnostic\"; }[] | undefined" ], "path": "packages/kbn-securitysolution-exception-list-components/src/types/index.ts", "deprecated": false, diff --git a/api_docs/kbn_securitysolution_exception_list_components.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index 3965f87b59964..39d566e32b0d1 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: 2022-10-25 +date: 2022-11-07 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 c5559011b9b1e..e0e7c5117f2af 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: 2022-10-25 +date: 2022-11-07 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 6395418ad396f..df1c4058df6f0 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json index 02fc5d323345b..05b6435e461e1 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json +++ b/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json @@ -27,7 +27,7 @@ "label": "updateExceptionListItemValidate", "description": [], "signature": [ - "(schema: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" + "(schema: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -41,7 +41,7 @@ "label": "schema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -60,7 +60,7 @@ "label": "validateComments", "description": [], "signature": [ - "(item: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" + "(item: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -74,7 +74,7 @@ "label": "item", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -162,7 +162,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false, @@ -697,7 +697,7 @@ "label": "exceptions", "description": [], "signature": [ - "(({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; })[]" + "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false, @@ -744,7 +744,13 @@ "description": [], "signature": [ "(arg: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, ") => void" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", @@ -759,7 +765,13 @@ "label": "arg", "description": [], "signature": [ - "Filter" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + } ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false, @@ -855,7 +867,13 @@ "description": [], "signature": [ "(arg: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, ") => void" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", @@ -870,7 +888,13 @@ "label": "arg", "description": [], "signature": [ - "Filter" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + } ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false, @@ -1104,9 +1128,21 @@ "description": [], "signature": [ "{ $state?: { store: ", - "FilterStateStore", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterStateStore", + "text": "FilterStateStore" + }, "; } | undefined; meta: ", - "FilterMeta", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterMeta", + "text": "FilterMeta" + }, "; query?: Record | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", @@ -1525,7 +1561,7 @@ "label": "exceptions", "description": [], "signature": [ - "(({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; })[]" + "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false, @@ -1747,7 +1783,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false, @@ -1845,7 +1881,7 @@ "label": "exceptions", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false, @@ -2475,7 +2511,7 @@ "label": "CreateEndpointListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"os_types\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"os_types\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.ts", "deprecated": false, @@ -2505,7 +2541,7 @@ "label": "CreateExceptionListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts", "deprecated": false, @@ -2520,7 +2556,7 @@ "label": "CreateExceptionListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts", "deprecated": false, @@ -2625,7 +2661,7 @@ "label": "CreateRuleExceptionListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; list_id?: undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; list_id?: undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.ts", "deprecated": false, @@ -2640,7 +2676,7 @@ "label": "CreateRuleExceptionListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; list_id: undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; list_id: undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.ts", "deprecated": false, @@ -2955,7 +2991,7 @@ "label": "EntriesArray", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts", "deprecated": false, @@ -2970,7 +3006,7 @@ "label": "EntriesArrayOrUndefined", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[] | undefined" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[] | undefined" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts", "deprecated": false, @@ -3105,7 +3141,7 @@ "label": "ExceptionListItemSchema", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.ts", "deprecated": false, @@ -3465,7 +3501,7 @@ "label": "FoundExceptionListItemSchema", "description": [], "signature": [ - "{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }" + "{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.ts", "deprecated": false, @@ -3540,7 +3576,7 @@ "label": "GetExceptionFilterSchema", "description": [], "signature": [ - "({ exception_list_ids: { exception_list_id: string; namespace_type: \"single\" | \"agnostic\"; }[]; type: \"exception_list_ids\"; } | { exceptions: (({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; })[]; type: \"exception_items\"; }) & { alias?: string | undefined; chunk_size?: number | undefined; exclude_exceptions?: boolean | undefined; }" + "({ exception_list_ids: { exception_list_id: string; namespace_type: \"single\" | \"agnostic\"; }[]; type: \"exception_list_ids\"; } | { exceptions: ({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]; type: \"exception_items\"; }) & { alias?: string | undefined; chunk_size?: number | undefined; exclude_exceptions?: boolean | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/get_exception_filter_schema/index.ts", "deprecated": false, @@ -3660,7 +3696,7 @@ "label": "ImportExceptionListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts", "deprecated": false, @@ -3675,7 +3711,7 @@ "label": "ImportExceptionListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts", "deprecated": false, @@ -4230,7 +4266,7 @@ "label": "NonEmptyEntriesArray", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts", "deprecated": false, @@ -4245,7 +4281,7 @@ "label": "NonEmptyEntriesArrayDecoded", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts", "deprecated": false, @@ -4935,7 +4971,7 @@ "label": "UpdateEndpointListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts", "deprecated": false, @@ -4950,7 +4986,7 @@ "label": "UpdateEndpointListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts", "deprecated": false, @@ -4965,7 +5001,7 @@ "label": "UpdateExceptionListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts", "deprecated": false, @@ -4980,7 +5016,7 @@ "label": "UpdateExceptionListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"namespace_type\" | \"os_types\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"namespace_type\" | \"os_types\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts", "deprecated": false, @@ -5535,7 +5571,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; list_id: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], unknown>; list_id: ", "Type", "; name: ", "StringC", @@ -5703,7 +5739,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], unknown>; name: ", "StringC", "; type: ", "KeyofC", @@ -7110,7 +7146,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; list_id: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], unknown>; list_id: ", "Type", "; name: ", "StringC", @@ -7392,9 +7428,21 @@ "<{ filter: ", "StringC", "; page: ", - "StringToPositiveNumberC", + { + "pluginId": "@kbn/securitysolution-io-ts-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsTypesPluginApi", + "section": "def-common.StringToPositiveNumberC", + "text": "StringToPositiveNumberC" + }, "; per_page: ", - "StringToPositiveNumberC", + { + "pluginId": "@kbn/securitysolution-io-ts-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsTypesPluginApi", + "section": "def-common.StringToPositiveNumberC", + "text": "StringToPositiveNumberC" + }, "; sort_field: ", "StringC", "; sort_order: ", @@ -7430,9 +7478,21 @@ "; namespace_type: ", "Type", "<(\"single\" | \"agnostic\")[], string | null | undefined, unknown>; page: ", - "StringToPositiveNumberC", + { + "pluginId": "@kbn/securitysolution-io-ts-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsTypesPluginApi", + "section": "def-common.StringToPositiveNumberC", + "text": "StringToPositiveNumberC" + }, "; per_page: ", - "StringToPositiveNumberC", + { + "pluginId": "@kbn/securitysolution-io-ts-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsTypesPluginApi", + "section": "def-common.StringToPositiveNumberC", + "text": "StringToPositiveNumberC" + }, "; search: ", "StringC", "; sort_field: ", @@ -7462,9 +7522,21 @@ "; namespace_type: ", "Type", "<(\"single\" | \"agnostic\")[], string | null | undefined, unknown>; page: ", - "StringToPositiveNumberC", + { + "pluginId": "@kbn/securitysolution-io-ts-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsTypesPluginApi", + "section": "def-common.StringToPositiveNumberC", + "text": "StringToPositiveNumberC" + }, "; per_page: ", - "StringToPositiveNumberC", + { + "pluginId": "@kbn/securitysolution-io-ts-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsTypesPluginApi", + "section": "def-common.StringToPositiveNumberC", + "text": "StringToPositiveNumberC" + }, "; sort_field: ", "StringC", "; sort_order: ", @@ -7500,9 +7572,21 @@ "; filter: ", "StringC", "; page: ", - "StringToPositiveNumberC", + { + "pluginId": "@kbn/securitysolution-io-ts-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsTypesPluginApi", + "section": "def-common.StringToPositiveNumberC", + "text": "StringToPositiveNumberC" + }, "; per_page: ", - "StringToPositiveNumberC", + { + "pluginId": "@kbn/securitysolution-io-ts-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsTypesPluginApi", + "section": "def-common.StringToPositiveNumberC", + "text": "StringToPositiveNumberC" + }, "; sort_field: ", "StringC", "; sort_order: ", @@ -7530,9 +7614,21 @@ "; filter: ", "StringC", "; page: ", - "StringToPositiveNumberC", + { + "pluginId": "@kbn/securitysolution-io-ts-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsTypesPluginApi", + "section": "def-common.StringToPositiveNumberC", + "text": "StringToPositiveNumberC" + }, "; per_page: ", - "StringToPositiveNumberC", + { + "pluginId": "@kbn/securitysolution-io-ts-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsTypesPluginApi", + "section": "def-common.StringToPositiveNumberC", + "text": "StringToPositiveNumberC" + }, "; sort_field: ", "StringC", "; sort_order: ", @@ -8319,7 +8415,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; list_id: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], unknown>; list_id: ", "Type", "; name: ", "StringC", @@ -8606,7 +8702,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; item_id: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], unknown>; item_id: ", "Type", "; list_id: ", "Type", @@ -9646,7 +9742,7 @@ ], "signature": [ "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>" + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], unknown>" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts", "deprecated": false, @@ -10656,7 +10752,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], unknown>; name: ", "StringC", "; type: ", "KeyofC", @@ -10710,7 +10806,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[], unknown>; name: ", "StringC", "; type: ", "KeyofC", diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index e4a1cf4434d20..731cd0dd073a3 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_securitysolution_io_ts_types.devdocs.json index ef934492d28ef..8a14e911325af 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.devdocs.json +++ b/api_docs/kbn_securitysolution_io_ts_types.devdocs.json @@ -514,7 +514,7 @@ "label": "ImportQuerySchema", "description": [], "signature": [ - "{ overwrite?: boolean | undefined; overwrite_exceptions?: boolean | undefined; }" + "{ overwrite?: boolean | undefined; overwrite_exceptions?: boolean | undefined; as_new_list?: boolean | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts", "deprecated": false, @@ -529,7 +529,7 @@ "label": "ImportQuerySchemaDecoded", "description": [], "signature": [ - "Omit<{ overwrite?: boolean | undefined; overwrite_exceptions?: boolean | undefined; }, \"overwrite\" | \"overwrite_exceptions\"> & { overwrite: boolean; overwrite_exceptions: boolean; }" + "Omit<{ overwrite?: boolean | undefined; overwrite_exceptions?: boolean | undefined; as_new_list?: boolean | undefined; }, \"overwrite\" | \"overwrite_exceptions\" | \"as_new_list\"> & { overwrite: boolean; overwrite_exceptions: boolean; as_new_list: boolean; }" ], "path": "packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts", "deprecated": false, @@ -912,6 +912,8 @@ "Type", "; overwrite_exceptions: ", "Type", + "; as_new_list: ", + "Type", "; }>>" ], "path": "packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts", diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index c4161d87e1b2b..e4500eb7915f5 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: 2022-10-25 +date: 2022-11-07 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 b64737ba39937..31902b1bc857e 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_securitysolution_list_api.devdocs.json index 00e1b747be030..4d4136d67c60d 100644 --- a/api_docs/kbn_securitysolution_list_api.devdocs.json +++ b/api_docs/kbn_securitysolution_list_api.devdocs.json @@ -28,7 +28,13 @@ "description": [], "signature": [ "({ http, signal, }: ", - "AddEndpointExceptionListProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.AddEndpointExceptionListProps", + "text": "AddEndpointExceptionListProps" + }, ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; updated_at: string; updated_by: string; version: number; } | {}>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", @@ -43,7 +49,13 @@ "label": "{\n http,\n signal,\n}", "description": [], "signature": [ - "AddEndpointExceptionListProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.AddEndpointExceptionListProps", + "text": "AddEndpointExceptionListProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -63,8 +75,14 @@ "description": [], "signature": [ "({ http, listItem, signal, }: ", - "AddExceptionListItemProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.AddExceptionListItemProps", + "text": "AddExceptionListItemProps" + }, + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -78,7 +96,13 @@ "label": "{\n http,\n listItem,\n signal,\n}", "description": [], "signature": [ - "AddExceptionListItemProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.AddExceptionListItemProps", + "text": "AddExceptionListItemProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -98,7 +122,13 @@ "description": [], "signature": [ "({ http, list, signal, }: ", - "AddExceptionListProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.AddExceptionListProps", + "text": "AddExceptionListProps" + }, ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", @@ -113,7 +143,13 @@ "label": "{\n http,\n list,\n signal,\n}", "description": [], "signature": [ - "AddExceptionListProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.AddExceptionListProps", + "text": "AddExceptionListProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -180,7 +216,13 @@ "description": [], "signature": [ "({ http, id, namespaceType, signal, }: ", - "ApiCallByIdProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallByIdProps", + "text": "ApiCallByIdProps" + }, ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", @@ -195,7 +237,13 @@ "label": "{\n http,\n id,\n namespaceType,\n signal,\n}", "description": [], "signature": [ - "ApiCallByIdProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallByIdProps", + "text": "ApiCallByIdProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -215,8 +263,14 @@ "description": [], "signature": [ "({ http, id, namespaceType, signal, }: ", - "ApiCallByIdProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallByIdProps", + "text": "ApiCallByIdProps" + }, + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -230,7 +284,13 @@ "label": "{\n http,\n id,\n namespaceType,\n signal,\n}", "description": [], "signature": [ - "ApiCallByIdProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallByIdProps", + "text": "ApiCallByIdProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -301,7 +361,13 @@ ], "signature": [ "({ http, id, listId, namespaceType, signal, }: ", - "ExportExceptionListProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ExportExceptionListProps", + "text": "ExportExceptionListProps" + }, ") => Promise" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", @@ -316,7 +382,13 @@ "label": "{\n http,\n id,\n listId,\n namespaceType,\n signal,\n}", "description": [], "signature": [ - "ExportExceptionListProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ExportExceptionListProps", + "text": "ExportExceptionListProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -383,7 +455,13 @@ "description": [], "signature": [ "({ http, id, namespaceType, signal, }: ", - "ApiCallByIdProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallByIdProps", + "text": "ApiCallByIdProps" + }, ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", @@ -398,7 +476,13 @@ "label": "{\n http,\n id,\n namespaceType,\n signal,\n}", "description": [], "signature": [ - "ApiCallByIdProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallByIdProps", + "text": "ApiCallByIdProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -418,8 +502,14 @@ "description": [], "signature": [ "({ http, id, namespaceType, signal, }: ", - "ApiCallByIdProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallByIdProps", + "text": "ApiCallByIdProps" + }, + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -433,7 +523,13 @@ "label": "{\n http,\n id,\n namespaceType,\n signal,\n}", "description": [], "signature": [ - "ApiCallByIdProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallByIdProps", + "text": "ApiCallByIdProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -453,8 +549,14 @@ "description": [], "signature": [ "({ filter, http, listIds, namespaceTypes, pagination, search, signal, }: ", - "ApiCallByListIdProps", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }>" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallByListIdProps", + "text": "ApiCallByListIdProps" + }, + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -468,7 +570,13 @@ "label": "{\n filter,\n http,\n listIds,\n namespaceTypes,\n pagination,\n search,\n signal,\n}", "description": [], "signature": [ - "ApiCallByListIdProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallByListIdProps", + "text": "ApiCallByListIdProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -488,7 +596,13 @@ "description": [], "signature": [ "({ filters, http, namespaceTypes, pagination, signal, }: ", - "ApiCallFetchExceptionListsProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallFetchExceptionListsProps", + "text": "ApiCallFetchExceptionListsProps" + }, ") => Promise<{ data: { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", @@ -503,7 +617,13 @@ "label": "{\n filters,\n http,\n namespaceTypes,\n pagination,\n signal,\n}", "description": [], "signature": [ - "ApiCallFetchExceptionListsProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallFetchExceptionListsProps", + "text": "ApiCallFetchExceptionListsProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -621,9 +741,21 @@ ], "signature": [ "({ alias, chunkSize, exceptionListIds, excludeExceptions, http, signal, }: ", - "GetExceptionFilterFromExceptionListIdsProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.GetExceptionFilterFromExceptionListIdsProps", + "text": "GetExceptionFilterFromExceptionListIdsProps" + }, ") => Promise<", - "ExceptionFilterResponse", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ExceptionFilterResponse", + "text": "ExceptionFilterResponse" + }, ">" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", @@ -638,7 +770,13 @@ "label": "{\n alias,\n chunkSize,\n exceptionListIds,\n excludeExceptions,\n http,\n signal,\n}", "description": [], "signature": [ - "GetExceptionFilterFromExceptionListIdsProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.GetExceptionFilterFromExceptionListIdsProps", + "text": "GetExceptionFilterFromExceptionListIdsProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -662,9 +800,21 @@ ], "signature": [ "({ exceptions, alias, excludeExceptions, http, chunkSize, signal, }: ", - "GetExceptionFilterFromExceptionsProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.GetExceptionFilterFromExceptionsProps", + "text": "GetExceptionFilterFromExceptionsProps" + }, ") => Promise<", - "ExceptionFilterResponse", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ExceptionFilterResponse", + "text": "ExceptionFilterResponse" + }, ">" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", @@ -679,7 +829,13 @@ "label": "{\n exceptions,\n alias,\n excludeExceptions,\n http,\n chunkSize,\n signal,\n}", "description": [], "signature": [ - "GetExceptionFilterFromExceptionsProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.GetExceptionFilterFromExceptionsProps", + "text": "GetExceptionFilterFromExceptionsProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -909,8 +1065,14 @@ "description": [], "signature": [ "({ http, listItem, signal, }: ", - "UpdateExceptionListItemProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.UpdateExceptionListItemProps", + "text": "UpdateExceptionListItemProps" + }, + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -924,7 +1086,13 @@ "label": "{\n http,\n listItem,\n signal,\n}", "description": [], "signature": [ - "UpdateExceptionListItemProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.UpdateExceptionListItemProps", + "text": "UpdateExceptionListItemProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -944,7 +1112,13 @@ "description": [], "signature": [ "({ http, list, signal, }: ", - "UpdateExceptionListProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.UpdateExceptionListProps", + "text": "UpdateExceptionListProps" + }, ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", @@ -959,7 +1133,13 @@ "label": "{\n http,\n list,\n signal,\n}", "description": [], "signature": [ - "UpdateExceptionListProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.UpdateExceptionListProps", + "text": "UpdateExceptionListProps" + } ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index 37e83e636efbf..f4eaee73e9d3b 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: 2022-10-25 +date: 2022-11-07 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 1733463d4a55a..f61f3a58c1694 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_securitysolution_list_hooks.devdocs.json index 0584759561cde..67eade2f7b66f 100644 --- a/api_docs/kbn_securitysolution_list_hooks.devdocs.json +++ b/api_docs/kbn_securitysolution_list_hooks.devdocs.json @@ -29,7 +29,7 @@ "\nThis adds an id to the incoming exception item entries as ReactJS prefers to have\nan id added to them for use as a stable id. Later if we decide to change the data\nmodel to have id's within the array then this code should be removed. If not, then\nthis code should stay as an adapter for ReactJS.\n\nThis does break the type system slightly as we are lying a bit to the type system as we return\nthe same exceptionItem as we have previously but are augmenting the arrays with an id which TypeScript\ndoesn't mind us doing here. However, downstream you will notice that you have an id when the type\ndoes not indicate it. In that case use (ExceptionItem & { id: string }) temporarily if you're using the id. If you're not,\nyou can ignore the id and just use the normal TypeScript with ReactJS.\n" ], "signature": [ - "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -45,7 +45,7 @@ "The exceptionItem to add an id to the threat matches." ], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -68,7 +68,7 @@ "\nThis removes an id from the exceptionItem entries as ReactJS prefers to have\nan id added to them for use as a stable id. Later if we decide to change the data\nmodel to have id's within the array then this code should be removed. If not, then\nthis code should stay as an adapter for ReactJS.\n" ], "signature": [ - "(exceptionItem: T) => T" + "(exceptionItem: T) => T" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -107,7 +107,7 @@ "\nTransforms the output of rules to compensate for technical debt or UI concerns such as\nReactJS preferences for having ids within arrays if the data is not modeled that way.\n\nIf you add a new transform of the input called \"myNewTransform\" do it\nin the form of:\nflow(addIdToExceptionItemEntries, myNewTransform)(exceptionItem)\n" ], "signature": [ - "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -123,7 +123,7 @@ "The exceptionItem to transform the output of" ], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -144,7 +144,7 @@ "label": "transformNewItemOutput", "description": [], "signature": [ - "(exceptionItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "(exceptionItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -158,7 +158,7 @@ "label": "exceptionItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -179,7 +179,7 @@ "\nTransforms the output of exception items to compensate for technical debt or UI concerns such as\nReactJS preferences for having ids within arrays if the data is not modeled that way.\n\nIf you add a new transform of the output called \"myNewTransform\" do it\nin the form of:\nflow(removeIdFromExceptionItemsEntries, myNewTransform)(exceptionItem)\n" ], "signature": [ - "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" + "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -195,7 +195,7 @@ "The exceptionItem to transform the output of" ], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -257,11 +257,29 @@ "description": [], "signature": [ "() => ", - "Task", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.Task", + "text": "Task" + }, "<[args: ", - "OptionalSignalArgs", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.OptionalSignalArgs", + "text": "OptionalSignalArgs" + }, "<", - "ApiParams", + { + "pluginId": "@kbn/securitysolution-list-api", + "scope": "common", + "docId": "kibKbnSecuritysolutionListApiPluginApi", + "section": "def-common.ApiParams", + "text": "ApiParams" + }, ">], { acknowledged: boolean; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.ts", @@ -327,11 +345,29 @@ "description": [], "signature": [ "() => ", - "Task", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.Task", + "text": "Task" + }, "<[args: ", - "OptionalSignalArgs", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.OptionalSignalArgs", + "text": "OptionalSignalArgs" + }, "<", - "DeleteListParams", + { + "pluginId": "@kbn/securitysolution-list-api", + "scope": "common", + "docId": "kibKbnSecuritysolutionListApiPluginApi", + "section": "def-common.DeleteListParams", + "text": "DeleteListParams" + }, ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.ts", @@ -352,7 +388,13 @@ ], "signature": [ "({ errorMessage, http, initialPagination, filterOptions, namespaceTypes, notifications, hideLists, }: ", - "UseExceptionListsProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.UseExceptionListsProps", + "text": "UseExceptionListsProps" + }, ") => ", { "pluginId": "@kbn/securitysolution-list-hooks", @@ -374,7 +416,13 @@ "label": "{\n errorMessage,\n http,\n initialPagination = DEFAULT_PAGINATION,\n filterOptions = {},\n namespaceTypes,\n notifications,\n hideLists = [],\n}", "description": [], "signature": [ - "UseExceptionListsProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.UseExceptionListsProps", + "text": "UseExceptionListsProps" + } ], "path": "packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts", "deprecated": false, @@ -394,11 +442,29 @@ "description": [], "signature": [ "() => ", - "Task", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.Task", + "text": "Task" + }, "<[args: ", - "OptionalSignalArgs", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.OptionalSignalArgs", + "text": "OptionalSignalArgs" + }, "<", - "ExportListParams", + { + "pluginId": "@kbn/securitysolution-list-api", + "scope": "common", + "docId": "kibKbnSecuritysolutionListApiPluginApi", + "section": "def-common.ExportListParams", + "text": "ExportListParams" + }, ">], Blob>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_export_list/index.ts", @@ -417,11 +483,29 @@ "description": [], "signature": [ "() => ", - "Task", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.Task", + "text": "Task" + }, "<[args: ", - "OptionalSignalArgs", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.OptionalSignalArgs", + "text": "OptionalSignalArgs" + }, "<", - "FindListsParams", + { + "pluginId": "@kbn/securitysolution-list-api", + "scope": "common", + "docId": "kibKbnSecuritysolutionListApiPluginApi", + "section": "def-common.FindListsParams", + "text": "FindListsParams" + }, ">], { cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.ts", @@ -440,11 +524,29 @@ "description": [], "signature": [ "() => ", - "Task", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.Task", + "text": "Task" + }, "<[args: ", - "OptionalSignalArgs", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.OptionalSignalArgs", + "text": "OptionalSignalArgs" + }, "<", - "FindListsParams", + { + "pluginId": "@kbn/securitysolution-list-api", + "scope": "common", + "docId": "kibKbnSecuritysolutionListApiPluginApi", + "section": "def-common.FindListsParams", + "text": "FindListsParams" + }, ">], { largeLists: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; updated_at: string; updated_by: string; version: number; }[]; smallLists: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; updated_at: string; updated_by: string; version: number; }[]; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_find_lists_by_size/index.ts", @@ -463,11 +565,29 @@ "description": [], "signature": [ "() => ", - "Task", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.Task", + "text": "Task" + }, "<[args: ", - "OptionalSignalArgs", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.OptionalSignalArgs", + "text": "OptionalSignalArgs" + }, "<", - "ImportListParams", + { + "pluginId": "@kbn/securitysolution-list-api", + "scope": "common", + "docId": "kibKbnSecuritysolutionListApiPluginApi", + "section": "def-common.ImportListParams", + "text": "ImportListParams" + }, ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_import_list/index.ts", @@ -488,7 +608,13 @@ ], "signature": [ "({ http, onError, }: ", - "PersistHookProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.PersistHookProps", + "text": "PersistHookProps" + }, ") => ", { "pluginId": "@kbn/securitysolution-list-hooks", @@ -510,7 +636,13 @@ "label": "{\n http,\n onError,\n}", "description": [], "signature": [ - "PersistHookProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.PersistHookProps", + "text": "PersistHookProps" + } ], "path": "packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts", "deprecated": false, @@ -532,7 +664,13 @@ ], "signature": [ "({ http, onError, }: ", - "PersistHookProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.PersistHookProps", + "text": "PersistHookProps" + }, ") => ", { "pluginId": "@kbn/securitysolution-list-hooks", @@ -554,7 +692,13 @@ "label": "{\n http,\n onError,\n}", "description": [], "signature": [ - "PersistHookProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.PersistHookProps", + "text": "PersistHookProps" + } ], "path": "packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.ts", "deprecated": false, @@ -574,11 +718,29 @@ "description": [], "signature": [ "() => ", - "Task", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.Task", + "text": "Task" + }, "<[args: ", - "OptionalSignalArgs", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.OptionalSignalArgs", + "text": "OptionalSignalArgs" + }, "<", - "ApiParams", + { + "pluginId": "@kbn/securitysolution-list-api", + "scope": "common", + "docId": "kibKbnSecuritysolutionListApiPluginApi", + "section": "def-common.ApiParams", + "text": "ApiParams" + }, ">], { list_index: boolean; list_item_index: boolean; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.ts", @@ -597,11 +759,29 @@ "description": [], "signature": [ "() => ", - "Task", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.Task", + "text": "Task" + }, "<[args: ", - "OptionalSignalArgs", + { + "pluginId": "@kbn/securitysolution-hook-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionHookUtilsPluginApi", + "section": "def-common.OptionalSignalArgs", + "text": "OptionalSignalArgs" + }, "<", - "ApiParams", + { + "pluginId": "@kbn/securitysolution-list-api", + "scope": "common", + "docId": "kibKbnSecuritysolutionListApiPluginApi", + "section": "def-common.ApiParams", + "text": "ApiParams" + }, ">], unknown>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_read_list_privileges/index.ts", @@ -632,7 +812,7 @@ "label": "addExceptionListItem", "description": [], "signature": [ - "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -657,7 +837,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -676,7 +856,7 @@ "label": "updateExceptionListItem", "description": [], "signature": [ - "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -701,7 +881,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -721,7 +901,13 @@ "description": [], "signature": [ "(arg: ", - "ApiCallMemoProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallMemoProps", + "text": "ApiCallMemoProps" + }, ") => Promise" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", @@ -736,7 +922,13 @@ "label": "arg", "description": [], "signature": [ - "ApiCallMemoProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallMemoProps", + "text": "ApiCallMemoProps" + } ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -755,7 +947,13 @@ "description": [], "signature": [ "(arg: ", - "ApiCallMemoProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallMemoProps", + "text": "ApiCallMemoProps" + }, ") => Promise" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", @@ -770,7 +968,13 @@ "label": "arg", "description": [], "signature": [ - "ApiCallMemoProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallMemoProps", + "text": "ApiCallMemoProps" + } ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -789,8 +993,14 @@ "description": [], "signature": [ "(arg: ", - "ApiCallMemoProps", - " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => void; }) => Promise" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallMemoProps", + "text": "ApiCallMemoProps" + }, + " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => void; }) => Promise" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -804,8 +1014,14 @@ "label": "arg", "description": [], "signature": [ - "ApiCallMemoProps", - " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => void; }" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallMemoProps", + "text": "ApiCallMemoProps" + }, + " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => void; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -824,7 +1040,13 @@ "description": [], "signature": [ "(arg: ", - "ApiCallMemoProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallMemoProps", + "text": "ApiCallMemoProps" + }, " & { onSuccess: (arg: { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; updated_at: string; updated_by: string; version: number; }) => void; }) => Promise" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", @@ -839,7 +1061,13 @@ "label": "arg", "description": [], "signature": [ - "ApiCallMemoProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallMemoProps", + "text": "ApiCallMemoProps" + }, " & { onSuccess: (arg: { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; updated_at: string; updated_by: string; version: number; }) => void; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", @@ -859,7 +1087,13 @@ "description": [], "signature": [ "(arg: ", - "ApiCallFindListsItemsMemoProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallFindListsItemsMemoProps", + "text": "ApiCallFindListsItemsMemoProps" + }, ") => Promise" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", @@ -874,7 +1108,13 @@ "label": "arg", "description": [], "signature": [ - "ApiCallFindListsItemsMemoProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallFindListsItemsMemoProps", + "text": "ApiCallFindListsItemsMemoProps" + } ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -893,7 +1133,13 @@ "description": [], "signature": [ "(arg: ", - "ApiCallGetExceptionFilterFromIdsMemoProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallGetExceptionFilterFromIdsMemoProps", + "text": "ApiCallGetExceptionFilterFromIdsMemoProps" + }, ") => Promise" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", @@ -908,7 +1154,13 @@ "label": "arg", "description": [], "signature": [ - "ApiCallGetExceptionFilterFromIdsMemoProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallGetExceptionFilterFromIdsMemoProps", + "text": "ApiCallGetExceptionFilterFromIdsMemoProps" + } ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -927,7 +1179,13 @@ "description": [], "signature": [ "(arg: ", - "ApiCallGetExceptionFilterFromExceptionsMemoProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallGetExceptionFilterFromExceptionsMemoProps", + "text": "ApiCallGetExceptionFilterFromExceptionsMemoProps" + }, ") => Promise" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", @@ -942,7 +1200,13 @@ "label": "arg", "description": [], "signature": [ - "ApiCallGetExceptionFilterFromExceptionsMemoProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiCallGetExceptionFilterFromExceptionsMemoProps", + "text": "ApiCallGetExceptionFilterFromExceptionsMemoProps" + } ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -961,7 +1225,13 @@ "description": [], "signature": [ "(arg: ", - "ApiListExportProps", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiListExportProps", + "text": "ApiListExportProps" + }, ") => Promise" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", @@ -976,7 +1246,13 @@ "label": "arg", "description": [], "signature": [ - "ApiListExportProps" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ApiListExportProps", + "text": "ApiListExportProps" + } ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -1054,9 +1330,21 @@ "description": [], "signature": [ "[loading: boolean, exceptionLists: { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; updated_at: string; updated_by: string; version: number; }[], pagination: ", - "Pagination", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.Pagination", + "text": "Pagination" + }, ", setPagination: React.Dispatch>, fetchLists: ", { "pluginId": "@kbn/securitysolution-list-hooks", @@ -1080,7 +1368,7 @@ "label": "ReturnPersistExceptionItem", "description": [], "signature": [ - "[PersistReturnExceptionItem, React.Dispatch<({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | null>]" + "[PersistReturnExceptionItem, React.Dispatch<({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | null>]" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts", "deprecated": false, @@ -1096,7 +1384,13 @@ "description": [], "signature": [ "[PersistReturnExceptionList, React.Dispatch<", - "AddExceptionList", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.AddExceptionList", + "text": "AddExceptionList" + }, " | null>]" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.ts", diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index 74300dfa8df69..7b4e0dcd064c1 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_securitysolution_list_utils.devdocs.json index becdd346daef2..51f091c7f6d84 100644 --- a/api_docs/kbn_securitysolution_list_utils.devdocs.json +++ b/api_docs/kbn_securitysolution_list_utils.devdocs.json @@ -27,7 +27,7 @@ "label": "addIdToEntries", "description": [], "signature": [ - "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]) => ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]) => ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -41,7 +41,7 @@ "label": "entries", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -167,9 +167,21 @@ ], "signature": [ "({ fields, selectedField, }: { fields: ", - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, "[]; selectedField: string | undefined; }) => ", - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", @@ -195,7 +207,13 @@ "label": "fields", "description": [], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, "[]" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", @@ -367,7 +385,13 @@ "text": "FormattedBuilderEntry" }, ", newField: ", - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, ") => { index: number; updatedEntry: ", { "pluginId": "@kbn/securitysolution-list-utils", @@ -415,7 +439,13 @@ "- newly selected field" ], "signature": [ - "DataViewFieldBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + } ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -982,7 +1012,13 @@ ], "signature": [ "(patterns: ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, ", item: ", { "pluginId": "@kbn/securitysolution-list-utils", @@ -992,11 +1028,29 @@ "text": "FormattedBuilderEntry" }, ", type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\", preFilter?: ((i: ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, ", t: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\", o?: (\"windows\" | \"linux\" | \"macos\")[] | undefined) => ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, ") | undefined, osTypes?: (\"windows\" | \"linux\" | \"macos\")[] | undefined) => ", - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -1012,7 +1066,13 @@ "DataViewBase containing available fields on rule index" ], "signature": [ - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -1066,9 +1126,21 @@ "description": [], "signature": [ "((i: ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, ", t: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\", o?: (\"windows\" | \"linux\" | \"macos\")[] | undefined) => ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, ") | undefined" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", @@ -1153,7 +1225,13 @@ ], "signature": [ "(indexPattern: ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, ", entries: ", { "pluginId": "@kbn/securitysolution-list-utils", @@ -1162,7 +1240,7 @@ "section": "def-common.BuilderEntry", "text": "BuilderEntry" }, - "[], allowCustomFieldOptions: boolean, parent?: { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | undefined, parentIndex?: number | undefined) => ", + "[], allowCustomFieldOptions: boolean, parent?: { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | undefined, parentIndex?: number | undefined) => ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", @@ -1184,7 +1262,13 @@ "label": "indexPattern", "description": [], "signature": [ - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -1242,7 +1326,7 @@ "nested entries hold copy of their parent for use in various logic" ], "signature": [ - "{ entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | undefined" + "{ entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | undefined" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -1281,7 +1365,13 @@ ], "signature": [ "(indexPattern: ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, ", item: ", { "pluginId": "@kbn/securitysolution-list-utils", @@ -1290,7 +1380,7 @@ "section": "def-common.BuilderEntry", "text": "BuilderEntry" }, - ", itemIndex: number, parent: { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | undefined, parentIndex: number | undefined, allowCustomFieldOptions: boolean) => ", + ", itemIndex: number, parent: { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | undefined, parentIndex: number | undefined, allowCustomFieldOptions: boolean) => ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", @@ -1311,7 +1401,13 @@ "label": "indexPattern", "description": [], "signature": [ - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -1368,7 +1464,7 @@ "nested entries hold copy of their parent for use in various logic" ], "signature": [ - "{ entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | undefined" + "{ entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | undefined" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -1422,7 +1518,13 @@ "description": [], "signature": [ "(filters: ", - "ExceptionListFilter", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ExceptionListFilter", + "text": "ExceptionListFilter" + }, ", namespaceTypes: ", { "pluginId": "@kbn/securitysolution-list-utils", @@ -1445,7 +1547,13 @@ "label": "filters", "description": [], "signature": [ - "ExceptionListFilter" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ExceptionListFilter", + "text": "ExceptionListFilter" + } ], "path": "packages/kbn-securitysolution-list-utils/src/get_general_filters/index.ts", "deprecated": false, @@ -1487,7 +1595,13 @@ "description": [], "signature": [ "({ lists, showDetection, showEndpoint, }: { lists: ", - "ExceptionListIdentifiers", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ExceptionListIdentifiers", + "text": "ExceptionListIdentifiers" + }, "[]; showDetection: boolean; showEndpoint: boolean; }) => { ids: string[]; namespaces: (\"single\" | \"agnostic\")[]; }" ], "path": "packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.ts", @@ -1513,7 +1627,13 @@ "label": "lists", "description": [], "signature": [ - "ExceptionListIdentifiers", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ExceptionListIdentifiers", + "text": "ExceptionListIdentifiers" + }, "[]" ], "path": "packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.ts", @@ -1748,7 +1868,13 @@ "text": "BuilderEntry" }, ") => ", - "ListOperatorTypeEnum" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + } ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -1982,7 +2108,7 @@ "label": "hasLargeValueList", "description": [], "signature": [ - "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]) => boolean" + "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]) => boolean" ], "path": "packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts", "deprecated": false, @@ -1996,7 +2122,7 @@ "label": "entries", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts", "deprecated": false, @@ -2023,7 +2149,7 @@ "section": "def-common.BuilderEntry", "text": "BuilderEntry" }, - ") => item is { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; }" + ") => item is { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; }" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -2100,7 +2226,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + } ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", "deprecated": false, @@ -2114,11 +2246,29 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".MATCH | ", - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".MATCH_ANY | ", - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".WILDCARD" ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", @@ -2186,7 +2336,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + } ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", "deprecated": false, @@ -2200,7 +2356,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".LIST" ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", @@ -2268,7 +2430,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".NESTED" ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", @@ -2322,7 +2490,13 @@ "label": "field", "description": [], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined" ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", @@ -2418,7 +2592,13 @@ "label": "correspondingKeywordField", "description": [], "signature": [ - "DataViewFieldBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewFieldBase", + "text": "DataViewFieldBase" + }, " | undefined" ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", @@ -2447,7 +2627,13 @@ "label": "filters", "description": [], "signature": [ - "ExceptionListFilter" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ExceptionListFilter", + "text": "ExceptionListFilter" + } ], "path": "packages/kbn-securitysolution-list-utils/src/get_filters/index.ts", "deprecated": false, @@ -2525,7 +2711,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + } ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", "deprecated": false, @@ -2539,7 +2731,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum" + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + } ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", "deprecated": false, @@ -2627,7 +2825,7 @@ "label": "BuilderEntryNested", "description": [], "signature": [ - "Omit<{ entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; }, \"entries\"> & { id?: string | undefined; entries: (({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } & { id?: string | undefined; }) | ({ field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } & { id?: string | undefined; }) | ({ field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } & { id?: string | undefined; }) | ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } & { id?: string | undefined; }))[]; }" + "Omit<{ entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; }, \"entries\"> & { id?: string | undefined; entries: (({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } & { id?: string | undefined; }) | ({ field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } & { id?: string | undefined; }) | ({ field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } & { id?: string | undefined; }) | ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } & { id?: string | undefined; }))[]; }" ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", "deprecated": false, @@ -2642,7 +2840,7 @@ "label": "CreateExceptionListItemBuilderSchema", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"meta\" | \"entries\" | \"list_id\" | \"namespace_type\"> & { meta: { temporaryUuid: string; }; entries: ", + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"meta\" | \"entries\" | \"list_id\" | \"namespace_type\"> & { meta: { temporaryUuid: string; }; entries: ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", @@ -2768,7 +2966,7 @@ "label": "ExceptionListItemBuilderSchema", "description": [], "signature": [ - "Omit<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }, \"entries\"> & { entries: ", + "Omit<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }, \"entries\"> & { entries: ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", @@ -2835,7 +3033,7 @@ "label": "ExceptionsBuilderReturnExceptionItem", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; list_id?: undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; list_id?: undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" ], "path": "packages/kbn-securitysolution-list-utils/src/types/index.ts", "deprecated": false, @@ -2873,10 +3071,13 @@ { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.doesNotExistOperator.message", - "type": "string", + "type": "Any", "tags": [], "label": "message", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", "deprecated": false, "trackAdoption": false @@ -2889,7 +3090,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + }, ".EXCLUDED" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -2904,7 +3111,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".EXISTS" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -2939,10 +3152,13 @@ { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.doesNotMatchOperator.message", - "type": "string", + "type": "Any", "tags": [], "label": "message", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", "deprecated": false, "trackAdoption": false @@ -2955,7 +3171,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + }, ".EXCLUDED" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -2970,7 +3192,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".WILDCARD" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3005,10 +3233,13 @@ { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.existsOperator.message", - "type": "string", + "type": "Any", "tags": [], "label": "message", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", "deprecated": false, "trackAdoption": false @@ -3021,7 +3252,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + }, ".INCLUDED" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3036,7 +3273,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".EXISTS" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3071,10 +3314,13 @@ { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.isInListOperator.message", - "type": "string", + "type": "Any", "tags": [], "label": "message", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", "deprecated": false, "trackAdoption": false @@ -3087,7 +3333,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + }, ".INCLUDED" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3102,7 +3354,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".LIST" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3137,10 +3395,13 @@ { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.isNotInListOperator.message", - "type": "string", + "type": "Any", "tags": [], "label": "message", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", "deprecated": false, "trackAdoption": false @@ -3153,7 +3414,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + }, ".EXCLUDED" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3168,7 +3435,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".LIST" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3203,10 +3476,13 @@ { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.isNotOneOfOperator.message", - "type": "string", + "type": "Any", "tags": [], "label": "message", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", "deprecated": false, "trackAdoption": false @@ -3219,7 +3495,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + }, ".EXCLUDED" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3234,7 +3516,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".MATCH_ANY" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3269,10 +3557,13 @@ { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.isNotOperator.message", - "type": "string", + "type": "Any", "tags": [], "label": "message", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", "deprecated": false, "trackAdoption": false @@ -3285,7 +3576,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + }, ".EXCLUDED" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3300,7 +3597,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".MATCH" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3335,10 +3638,13 @@ { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.isOneOfOperator.message", - "type": "string", + "type": "Any", "tags": [], "label": "message", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", "deprecated": false, "trackAdoption": false @@ -3351,7 +3657,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + }, ".INCLUDED" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3366,7 +3678,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".MATCH_ANY" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3401,10 +3719,13 @@ { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.isOperator.message", - "type": "string", + "type": "Any", "tags": [], "label": "message", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", "deprecated": false, "trackAdoption": false @@ -3417,7 +3738,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + }, ".INCLUDED" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3432,7 +3759,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".MATCH" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3467,10 +3800,13 @@ { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.matchesOperator.message", - "type": "string", + "type": "Any", "tags": [], "label": "message", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", "deprecated": false, "trackAdoption": false @@ -3483,7 +3819,13 @@ "label": "operator", "description": [], "signature": [ - "ListOperatorEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorEnum", + "text": "ListOperatorEnum" + }, ".INCLUDED" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", @@ -3498,7 +3840,13 @@ "label": "type", "description": [], "signature": [ - "ListOperatorTypeEnum", + { + "pluginId": "@kbn/securitysolution-io-ts-list-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsListTypesPluginApi", + "section": "def-common.ListOperatorTypeEnum", + "text": "ListOperatorTypeEnum" + }, ".WILDCARD" ], "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index 3ec6c5a5530b6..227fe8d450f1d 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] --- import kbnSecuritysolutionListUtilsObj from './kbn_securitysolution_list_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 194 | 0 | 150 | 0 | +| 194 | 10 | 150 | 0 | ## Common diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index 59882a0487cee..51c12bb75fb6f 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: 2022-10-25 +date: 2022-11-07 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 e1dbd2cdcfa4c..1263babe5463e 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_securitysolution_utils.devdocs.json index 9c1fb4cd9da93..2e011adcd1bcf 100644 --- a/api_docs/kbn_securitysolution_utils.devdocs.json +++ b/api_docs/kbn_securitysolution_utils.devdocs.json @@ -520,10 +520,13 @@ { "parentPluginId": "@kbn/securitysolution-utils", "id": "def-common.FILENAME_WILDCARD_WARNING", - "type": "string", + "type": "Any", "tags": [], "label": "FILENAME_WILDCARD_WARNING", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-utils/src/path_validations/index.ts", "deprecated": false, "trackAdoption": false, @@ -532,10 +535,13 @@ { "parentPluginId": "@kbn/securitysolution-utils", "id": "def-common.FILEPATH_WARNING", - "type": "string", + "type": "Any", "tags": [], "label": "FILEPATH_WARNING", "description": [], + "signature": [ + "any" + ], "path": "packages/kbn-securitysolution-utils/src/path_validations/index.ts", "deprecated": false, "trackAdoption": false, diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index 6ddf58d969696..c51c4f1d68c97 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 31 | 0 | 29 | 0 | +| 31 | 2 | 29 | 0 | ## Common diff --git a/api_docs/kbn_server_http_tools.devdocs.json b/api_docs/kbn_server_http_tools.devdocs.json index ac1861e2e8fe1..e980e1105d08a 100644 --- a/api_docs/kbn_server_http_tools.devdocs.json +++ b/api_docs/kbn_server_http_tools.devdocs.json @@ -578,7 +578,13 @@ "label": "maxPayload", "description": [], "signature": [ - "ByteSizeValue" + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ByteSizeValue", + "text": "ByteSizeValue" + } ], "path": "packages/kbn-server-http-tools/src/types.ts", "deprecated": false, @@ -814,37 +820,133 @@ "label": "sslSchema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ certificate: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; certificateAuthorities: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; cipherSuites: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; enabled: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; key: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; keyPassphrase: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; keystore: ", - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ path: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; password: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>; truststore: ", - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{ path: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; password: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; }>; redirectHttpFromPort: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; supportedProtocols: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "; clientAuthentication: ", - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "<\"optional\" | \"none\" | \"required\">; }>" ], "path": "packages/kbn-server-http-tools/src/ssl/ssl_config.ts", diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index 9f5809200ac42..109e78d9a52e4 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.devdocs.json b/api_docs/kbn_server_route_repository.devdocs.json index 9599b078d7468..c97218a86a7ab 100644 --- a/api_docs/kbn_server_route_repository.devdocs.json +++ b/api_docs/kbn_server_route_repository.devdocs.json @@ -515,7 +515,13 @@ "// `body` can be null, but `validate` expects non-nullable types\n// if any validation is defined. Not having validation currently\n// means we don't get the payload. See\n// https://github.com/elastic/kibana/issues/50179" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, " | null>" ], "path": "packages/kbn-server-route-repository/src/route_validation_object.ts", @@ -530,7 +536,13 @@ "label": "params", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{}>" ], "path": "packages/kbn-server-route-repository/src/route_validation_object.ts", @@ -545,7 +557,13 @@ "label": "query", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{}>" ], "path": "packages/kbn-server-route-repository/src/route_validation_object.ts", diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index 742cc439e05f2..091c3bf938529 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index 3f34410c6560e..599232b98632c 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_avatar_solution.devdocs.json new file mode 100644 index 0000000000000..ff876f8b54549 --- /dev/null +++ b/api_docs/kbn_shared_ux_avatar_solution.devdocs.json @@ -0,0 +1,95 @@ +{ + "id": "@kbn/shared-ux-avatar-solution", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-avatar-solution", + "id": "def-common.KibanaSolutionAvatar", + "type": "Function", + "tags": [], + "label": "KibanaSolutionAvatar", + "description": [ + "\nApplies extra styling to a typical EuiAvatar.\nThe `name` value will be appended to 'logo' to configure the `iconType` unless `iconType` is provided." + ], + "signature": [ + "(props: ", + { + "pluginId": "@kbn/shared-ux-avatar-solution", + "scope": "common", + "docId": "kibKbnSharedUxAvatarSolutionPluginApi", + "section": "def-common.KibanaSolutionAvatarProps", + "text": "KibanaSolutionAvatarProps" + }, + ") => JSX.Element" + ], + "path": "packages/shared-ux/avatar/solution/src/solution_avatar.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-avatar-solution", + "id": "def-common.KibanaSolutionAvatar.$1", + "type": "CompoundType", + "tags": [], + "label": "props", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-avatar-solution", + "scope": "common", + "docId": "kibKbnSharedUxAvatarSolutionPluginApi", + "section": "def-common.KibanaSolutionAvatarProps", + "text": "KibanaSolutionAvatarProps" + } + ], + "path": "packages/shared-ux/avatar/solution/src/solution_avatar.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-avatar-solution", + "id": "def-common.KibanaSolutionAvatarProps", + "type": "Type", + "tags": [], + "label": "KibanaSolutionAvatarProps", + "description": [], + "signature": [ + "KnownSolutionProps", + " | ", + "IconTypeProps" + ], + "path": "packages/shared-ux/avatar/solution/src/solution_avatar.tsx", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_avatar_solution.mdx b/api_docs/kbn_shared_ux_avatar_solution.mdx new file mode 100644 index 0000000000000..e38ef79fcace8 --- /dev/null +++ b/api_docs/kbn_shared_ux_avatar_solution.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnSharedUxAvatarSolutionPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-solution'] +--- +import kbnSharedUxAvatarSolutionObj from './kbn_shared_ux_avatar_solution.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 3 | 0 | 2 | 2 | + +## Common + +### Functions + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx b/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx index b0b96a695dc07..4d8074f96c9a2 100644 --- a/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx +++ b/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-user-profile-components title: "@kbn/shared-ux-avatar-user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-user-profile-components plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-user-profile-components'] --- import kbnSharedUxAvatarUserProfileComponentsObj from './kbn_shared_ux_avatar_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen.devdocs.json b/api_docs/kbn_shared_ux_button_exit_full_screen.devdocs.json new file mode 100644 index 0000000000000..e048a09926e16 --- /dev/null +++ b/api_docs/kbn_shared_ux_button_exit_full_screen.devdocs.json @@ -0,0 +1,180 @@ +{ + "id": "@kbn/shared-ux-button-exit-full-screen", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-button-exit-full-screen", + "id": "def-common.ExitFullScreenButton", + "type": "Function", + "tags": [], + "label": "ExitFullScreenButton", + "description": [ + "\nA presentational component that renders a button designed to exit \"full screen\" mode." + ], + "signature": [ + "({ onClick, className }: ", + "ExitFullScreenButtonComponentProps", + ") => JSX.Element" + ], + "path": "packages/shared-ux/button/exit_full_screen/impl/src/exit_full_screen_button.component.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-button-exit-full-screen", + "id": "def-common.ExitFullScreenButton.$1", + "type": "Object", + "tags": [], + "label": "{ onClick, className }", + "description": [], + "signature": [ + "ExitFullScreenButtonComponentProps" + ], + "path": "packages/shared-ux/button/exit_full_screen/impl/src/exit_full_screen_button.component.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-button-exit-full-screen", + "id": "def-common.ExitFullScreenButton", + "type": "Function", + "tags": [], + "label": "ExitFullScreenButton", + "description": [ + "\nA service-enabled component that provides Kibana-specific functionality to the `ExitFullScreenButton`\npure component." + ], + "signature": [ + "({ onExit, toggleChrome }: ", + "ExitFullScreenButtonProps", + ") => JSX.Element" + ], + "path": "packages/shared-ux/button/exit_full_screen/impl/src/exit_full_screen_button.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-button-exit-full-screen", + "id": "def-common.ExitFullScreenButton.$1", + "type": "Object", + "tags": [], + "label": "{ onExit = () => {}, toggleChrome = true }", + "description": [], + "signature": [ + "ExitFullScreenButtonProps" + ], + "path": "packages/shared-ux/button/exit_full_screen/impl/src/exit_full_screen_button.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-button-exit-full-screen", + "id": "def-common.ExitFullScreenButtonKibanaProvider", + "type": "Function", + "tags": [], + "label": "ExitFullScreenButtonKibanaProvider", + "description": [ + "\nKibana-specific Provider that maps to known dependency types." + ], + "signature": [ + "({ children, ...services }: React.PropsWithChildren<", + "KibanaDependencies", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/button/exit_full_screen/impl/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-button-exit-full-screen", + "id": "def-common.ExitFullScreenButtonKibanaProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...services\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "KibanaDependencies", + ">" + ], + "path": "packages/shared-ux/button/exit_full_screen/impl/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-button-exit-full-screen", + "id": "def-common.ExitFullScreenButtonProvider", + "type": "Function", + "tags": [], + "label": "ExitFullScreenButtonProvider", + "description": [ + "\nAbstract external service Provider." + ], + "signature": [ + "({ children, ...services }: React.PropsWithChildren<", + "Services", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/button/exit_full_screen/impl/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-button-exit-full-screen", + "id": "def-common.ExitFullScreenButtonProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...services\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "Services", + ">" + ], + "path": "packages/shared-ux/button/exit_full_screen/impl/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx new file mode 100644 index 0000000000000..1c2063ca4bf00 --- /dev/null +++ b/api_docs/kbn_shared_ux_button_exit_full_screen.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: kibKbnSharedUxButtonExitFullScreenPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen'] +--- +import kbnSharedUxButtonExitFullScreenObj from './kbn_shared_ux_button_exit_full_screen.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 8 | 0 | 4 | 0 | + +## Common + +### Functions + + diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json index 6ecc8d46df1b2..827ece1bdc932 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json @@ -36,7 +36,13 @@ "text": "StorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "ExitFullScreenButtonProps", ", ", diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx index d1fae19cb6fe8..065a7bc5ea308 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen-mocks title: "@kbn/shared-ux-button-exit-full-screen-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen-mocks plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen-mocks'] --- import kbnSharedUxButtonExitFullScreenMocksObj from './kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index e0abd3d4fac70..8cb575b277c6f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data.devdocs.json b/api_docs/kbn_shared_ux_card_no_data.devdocs.json index c1e08d1b9a31f..320d34a4bc9b4 100644 --- a/api_docs/kbn_shared_ux_card_no_data.devdocs.json +++ b/api_docs/kbn_shared_ux_card_no_data.devdocs.json @@ -150,7 +150,7 @@ "EuiCardProps", ", \"description\" | \"onClick\" | \"isDisabled\" | \"button\" | \"layout\">> & { button?: React.ReactNode; onClick?: React.MouseEventHandler | undefined; description?: React.ReactNode; category?: string | undefined; canAccessFleet?: boolean | undefined; }" ], - "path": "node_modules/@kbn/shared-ux-card-no-data-types/index.d.ts", + "path": "packages/shared-ux/card/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -169,7 +169,7 @@ " & ", "RedirectAppLinksKibanaDependencies" ], - "path": "node_modules/@kbn/shared-ux-card-no-data-types/index.d.ts", + "path": "packages/shared-ux/card/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -344,7 +344,7 @@ "EuiCardSelectProps", " | undefined; }" ], - "path": "node_modules/@kbn/shared-ux-card-no-data-types/index.d.ts", + "path": "packages/shared-ux/card/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -363,7 +363,7 @@ " & ", "RedirectAppLinksServices" ], - "path": "node_modules/@kbn/shared-ux-card-no-data-types/index.d.ts", + "path": "packages/shared-ux/card/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index 830a6eb0ade89..1e52e6e6e8dd1 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json index c83e2d8f0e1aa..1aa83630b7156 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json @@ -36,7 +36,13 @@ "text": "StorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "NoDataCardProps", ", ", @@ -308,7 +314,13 @@ "label": "dependencies", "description": [], "signature": [ - "RedirectAppLinksStorybookMock", + { + "pluginId": "@kbn/shared-ux-link-redirect-app-mocks", + "scope": "common", + "docId": "kibKbnSharedUxLinkRedirectAppMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, "[]" ], "path": "packages/shared-ux/card/no_data/mocks/src/storybook.ts", 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 248d2004953e9..94bdc46f10f8d 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: 2022-10-25 +date: 2022-11-07 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_link_redirect_app.devdocs.json b/api_docs/kbn_shared_ux_link_redirect_app.devdocs.json new file mode 100644 index 0000000000000..f5d80dfd2a233 --- /dev/null +++ b/api_docs/kbn_shared_ux_link_redirect_app.devdocs.json @@ -0,0 +1,334 @@ +{ + "id": "@kbn/shared-ux-link-redirect-app", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinks", + "type": "Function", + "tags": [], + "label": "RedirectAppLinks", + "description": [ + "\nA service-enabled component that provides Kibana-specific functionality to the `RedirectAppLinks`\npure component.\n" + ], + "signature": [ + "({ className, children }: React.PropsWithChildren<{ className?: string | undefined; }>) => JSX.Element" + ], + "path": "packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.container.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinks.$1", + "type": "CompoundType", + "tags": [], + "label": "{ className, children }", + "description": [], + "signature": [ + "React.PropsWithChildren<{ className?: string | undefined; }>" + ], + "path": "packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.container.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinks", + "type": "Function", + "tags": [], + "label": "RedirectAppLinks", + "description": [ + "\nUtility component that will intercept click events on children anchor (``) elements to call\n`navigateToUrl` with the link's href. This will trigger SPA friendly navigation when the link points\nto a valid Kibana app.\n" + ], + "signature": [ + "({ children, navigateToUrl, currentAppId, className, }: React.PropsWithChildren<", + "RedirectAppLinksComponentProps", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.component.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinks.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n navigateToUrl,\n currentAppId,\n className,\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "RedirectAppLinksComponentProps", + ">" + ], + "path": "packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.component.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinks", + "type": "Function", + "tags": [], + "label": "RedirectAppLinks", + "description": [ + "\nThis component composes `RedirectAppLinksContainer` with either `RedirectAppLinksProvider` or\n`RedirectAppLinksKibanaProvider` based on the services provided, creating a single component\nwith which consumers can wrap their components or solutions." + ], + "signature": [ + "({ children, className, ...props }: React.PropsWithChildren<", + "RedirectAppLinksProps", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinks.$1", + "type": "CompoundType", + "tags": [], + "label": "{ children, className, ...props }", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "RedirectAppLinksProps", + ">" + ], + "path": "packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksKibanaProvider", + "type": "Function", + "tags": [], + "label": "RedirectAppLinksKibanaProvider", + "description": [ + "\nKibana-specific contextual services Provider." + ], + "signature": [ + "({ children, coreStart, }: React.PropsWithChildren<", + "RedirectAppLinksKibanaDependencies", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/link/redirect_app/impl/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksKibanaProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n coreStart,\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "RedirectAppLinksKibanaDependencies", + ">" + ], + "path": "packages/shared-ux/link/redirect_app/impl/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksProvider", + "type": "Function", + "tags": [], + "label": "RedirectAppLinksProvider", + "description": [ + "\nContextual services Provider." + ], + "signature": [ + "({ children, ...services }: React.PropsWithChildren<", + "RedirectAppLinksServices", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/link/redirect_app/impl/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...services\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "RedirectAppLinksServices", + ">" + ], + "path": "packages/shared-ux/link/redirect_app/impl/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksKibanaDependencies", + "type": "Interface", + "tags": [], + "label": "RedirectAppLinksKibanaDependencies", + "description": [ + "\nKibana-specific contextual services to be adapted for this component." + ], + "path": "packages/shared-ux/link/redirect_app/types/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksKibanaDependencies.coreStart", + "type": "Object", + "tags": [], + "label": "coreStart", + "description": [], + "signature": [ + "{ application: { currentAppId$: ", + "Observable", + "; navigateToUrl: ", + "NavigateToUrl", + "; }; }" + ], + "path": "packages/shared-ux/link/redirect_app/types/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksServices", + "type": "Interface", + "tags": [], + "label": "RedirectAppLinksServices", + "description": [ + "\nContextual services for this component." + ], + "path": "packages/shared-ux/link/redirect_app/types/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksServices.navigateToUrl", + "type": "Function", + "tags": [], + "label": "navigateToUrl", + "description": [], + "signature": [ + "(url: string) => void | Promise" + ], + "path": "packages/shared-ux/link/redirect_app/types/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksServices.navigateToUrl.$1", + "type": "string", + "tags": [], + "label": "url", + "description": [], + "path": "packages/shared-ux/link/redirect_app/types/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksServices.currentAppId", + "type": "string", + "tags": [], + "label": "currentAppId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/shared-ux/link/redirect_app/types/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app", + "id": "def-common.RedirectAppLinksProps", + "type": "Type", + "tags": [], + "label": "RedirectAppLinksProps", + "description": [ + "Props for the `RedirectAppLinks` component." + ], + "signature": [ + "{ className?: string | undefined; } & (", + "RedirectAppLinksKibanaDependencies", + " | ", + "RedirectAppLinksServices", + ")" + ], + "path": "packages/shared-ux/link/redirect_app/types/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_link_redirect_app.mdx b/api_docs/kbn_shared_ux_link_redirect_app.mdx new file mode 100644 index 0000000000000..54497b6dca669 --- /dev/null +++ b/api_docs/kbn_shared_ux_link_redirect_app.mdx @@ -0,0 +1,36 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnSharedUxLinkRedirectAppPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app'] +--- +import kbnSharedUxLinkRedirectAppObj from './kbn_shared_ux_link_redirect_app.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 17 | 0 | 9 | 0 | + +## Common + +### Functions + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json b/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json index 1d6ac7215b19c..3506fc8c049f8 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json @@ -34,7 +34,13 @@ "text": "StorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "RedirectAppLinksProps", ", {}, {}, {}>" 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 3c55946545e62..69a11bd77e847 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: 2022-10-25 +date: 2022-11-07 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 8dcfea6717864..204ead08892a0 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_markdown_mocks.devdocs.json index e9841a0b50e0e..0f5ffb13f1421 100644 --- a/api_docs/kbn_shared_ux_markdown_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_markdown_mocks.devdocs.json @@ -36,7 +36,13 @@ "text": "MarkdownStorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "MarkdownProps", ", {}, PropArguments, {}>" diff --git a/api_docs/kbn_shared_ux_markdown_mocks.mdx b/api_docs/kbn_shared_ux_markdown_mocks.mdx index e84ba879c741e..3680738a5fd54 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json index b53cb7d2758d5..40ba0e9b06f06 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json @@ -182,7 +182,7 @@ "description": [ "\nProps for the `AnalyticsNoDataPage` component." ], - "path": "node_modules/@kbn/shared-ux-page-analytics-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/analytics_no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -198,7 +198,7 @@ "signature": [ "(dataView: unknown) => void" ], - "path": "node_modules/@kbn/shared-ux-page-analytics-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/analytics_no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -212,7 +212,7 @@ "signature": [ "unknown" ], - "path": "node_modules/@kbn/shared-ux-page-analytics-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/analytics_no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -246,7 +246,7 @@ " & ", "RedirectAppLinksKibanaDependencies" ], - "path": "node_modules/@kbn/shared-ux-page-analytics-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/analytics_no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -271,7 +271,7 @@ " & ", "NoDataViewsPromptServices" ], - "path": "node_modules/@kbn/shared-ux-page-analytics-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/analytics_no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false 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 a650a7ca792c1..de5cfc882c97a 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] --- import kbnSharedUxPageAnalyticsNoDataObj from './kbn_shared_ux_page_analytics_no_data.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 13 | 0 | 4 | 1 | +| 13 | 0 | 5 | 1 | ## Common diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json index c8af9498f67a4..ee58f4094a5e3 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json @@ -34,7 +34,13 @@ "text": "StorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "AnalyticsNoDataPageProps", ", ", @@ -113,7 +119,13 @@ "label": "dependencies", "description": [], "signature": [ - "KibanaNoDataPageStorybookMock", + { + "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, "[]" ], "path": "packages/shared-ux/page/analytics_no_data/mocks/src/storybook.ts", @@ -220,17 +232,37 @@ "label": "Params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, "<{}, ServiceArguments> & ", - "ArgumentParams", - "<", - "PropArguments", - ", ", - "ServiceArguments", - "> & ", - "NoDataCardStorybookParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, + " & ", + { + "pluginId": "@kbn/shared-ux-card-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, " & ", - "NoDataViewsPromptStorybookParams" + { + "pluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPromptNoDataViewsMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } ], "path": "packages/shared-ux/page/analytics_no_data/mocks/src/storybook.ts", "deprecated": false, 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 6c37828d4cc2e..2f8b658bc6d40 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json index a6210ec3c8c1a..965a9d9b55e54 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json @@ -156,7 +156,7 @@ " & ", "RedirectAppLinksKibanaDependencies" ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/kibana_no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -179,7 +179,7 @@ " & ", "NoDataViewsPromptServices" ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/kibana_no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false 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 660e4aa491a81..46053d0c943a0 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json index fa5d1c414395f..6baad57602555 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json @@ -34,7 +34,13 @@ "text": "StorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "KibanaNoDataPageProps", ", ", @@ -250,9 +256,21 @@ "description": [], "signature": [ "(", - "NoDataViewsPromptStorybookMock", + { + "pluginId": "@kbn/shared-ux-card-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, " | ", - "NoDataCardStorybookMock", + { + "pluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPromptNoDataViewsMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, ")[]" ], "path": "packages/shared-ux/page/kibana_no_data/mocks/src/storybook.ts", @@ -407,11 +425,29 @@ "label": "Params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " & ", - "NoDataCardStorybookParams", + { + "pluginId": "@kbn/shared-ux-card-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, " & ", - "NoDataViewsPromptStorybookParams" + { + "pluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPromptNoDataViewsMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } ], "path": "packages/shared-ux/page/kibana_no_data/mocks/src/storybook.ts", "deprecated": false, 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 b2591c5fa6518..05956ef439457 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_template.devdocs.json index cd08253e10ed9..42d13b89e4e8d 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template.devdocs.json +++ b/api_docs/kbn_shared_ux_page_kibana_template.devdocs.json @@ -165,7 +165,7 @@ " & ", "RedirectAppLinksKibanaDependencies" ], - "path": "node_modules/@kbn/shared-ux-page-kibana-template-types/index.d.ts", + "path": "packages/shared-ux/page/kibana_template/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -190,7 +190,13 @@ ".MinHeight | undefined; offset?: number | undefined; mainProps?: (", "CommonProps", " & React.HTMLAttributes) | undefined; } & { isEmptyState?: boolean | undefined; solutionNav?: ", - "SolutionNavProps", + { + "pluginId": "@kbn/shared-ux-page-solution-nav", + "scope": "common", + "docId": "kibKbnSharedUxPageSolutionNavPluginApi", + "section": "def-common.SolutionNavProps", + "text": "SolutionNavProps" + }, " | undefined; noDataConfig?: ", "NoDataPageProps", " | undefined; pageHeader?: ", @@ -199,7 +205,7 @@ "EuiPageSidebarProps", " | undefined; }" ], - "path": "node_modules/@kbn/shared-ux-page-kibana-template-types/index.d.ts", + "path": "packages/shared-ux/page/kibana_template/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -216,7 +222,7 @@ " & ", "RedirectAppLinksServices" ], - "path": "node_modules/@kbn/shared-ux-page-kibana-template-types/index.d.ts", + "path": "packages/shared-ux/page/kibana_template/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -231,7 +237,7 @@ "signature": [ "NoDataPageProps" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "path": "packages/shared-ux/page/no_data_config/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_shared_ux_page_kibana_template.mdx b/api_docs/kbn_shared_ux_page_kibana_template.mdx index 9485665753b8f..4e848cb53ed27 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template'] --- import kbnSharedUxPageKibanaTemplateObj from './kbn_shared_ux_page_kibana_template.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 11 | 0 | 2 | 0 | +| 11 | 0 | 6 | 0 | ## Server diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_template_mocks.devdocs.json index ff42bbf98fb39..b52d94020e0b7 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.devdocs.json @@ -34,7 +34,13 @@ "text": "StorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "KibanaPageTemplateProps", ", ", @@ -106,7 +112,13 @@ "label": "dependencies", "description": [], "signature": [ - "NoDataConfigPageStorybookMock", + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.NoDataConfigPageStorybookMock", + "text": "NoDataConfigPageStorybookMock" + }, "[]" ], "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", @@ -227,7 +239,13 @@ "text": "StorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "KibanaPageTemplateProps", ", ", @@ -287,7 +305,13 @@ "label": "dependencies", "description": [], "signature": [ - "NoDataConfigPageStorybookMock", + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.NoDataConfigPageStorybookMock", + "text": "NoDataConfigPageStorybookMock" + }, "[]" ], "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", @@ -408,7 +432,13 @@ "text": "StorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "KibanaPageTemplateProps", ", ", @@ -468,7 +498,13 @@ "label": "dependencies", "description": [], "signature": [ - "NoDataConfigPageStorybookMock", + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.NoDataConfigPageStorybookMock", + "text": "NoDataConfigPageStorybookMock" + }, "[]" ], "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", @@ -589,7 +625,13 @@ "text": "StorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "KibanaPageTemplateProps", ", ", @@ -801,17 +843,37 @@ "label": "Params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " & ", - "ArgumentParams", - "<", - "PropArguments", - ", {}> & ", - "ArgumentParams", - "<", - "PropArguments", - ", {}> & ", - "NoDataCardStorybookParams" + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, + " & ", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, + " & ", + { + "pluginId": "@kbn/shared-ux-card-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } ], "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", "deprecated": false, @@ -826,19 +888,39 @@ "label": "Params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, "<", "NoDataConfigArguments", ", {}> & ", - "ArgumentParams", - "<", - "PropArguments", - ", {}> & ", - "ArgumentParams", - "<", - "PropArguments", - ", {}> & ", - "NoDataCardStorybookParams" + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, + " & ", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, + " & ", + { + "pluginId": "@kbn/shared-ux-card-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } ], "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", "deprecated": false, @@ -853,19 +935,39 @@ "label": "Params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, "<", "SolutionNavArguments", ", {}> & ", - "ArgumentParams", - "<", - "PropArguments", - ", {}> & ", - "ArgumentParams", - "<", - "PropArguments", - ", {}> & ", - "NoDataCardStorybookParams" + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, + " & ", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, + " & ", + { + "pluginId": "@kbn/shared-ux-card-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } ], "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", "deprecated": false, @@ -880,17 +982,37 @@ "label": "Params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " & ", - "ArgumentParams", - "<", - "PropArguments", - ", {}> & ", - "ArgumentParams", - "<", - "PropArguments", - ", {}> & ", - "NoDataCardStorybookParams" + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, + " & ", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, + " & ", + { + "pluginId": "@kbn/shared-ux-card-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } ], "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", "deprecated": false, 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 bb567608bcb83..9a979a0d1b30c 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_page_no_data.devdocs.json index da8d66fbcfe79..e6f62668e8f73 100644 --- a/api_docs/kbn_shared_ux_page_no_data.devdocs.json +++ b/api_docs/kbn_shared_ux_page_no_data.devdocs.json @@ -148,7 +148,7 @@ ",", "ActionCardProps" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -161,7 +161,7 @@ "description": [ "\nSingle name for the current solution, used to auto-generate the title, logo, description, and button label" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false }, @@ -174,7 +174,7 @@ "description": [ "\nRequired to set the docs link for the whole solution" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false }, @@ -190,7 +190,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false }, @@ -206,7 +206,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false } @@ -230,7 +230,7 @@ " & ", "RedirectAppLinksKibanaDependencies" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -249,7 +249,7 @@ " & ", "RedirectAppLinksServices" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "path": "packages/shared-ux/page/no_data/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_shared_ux_page_no_data.mdx b/api_docs/kbn_shared_ux_page_no_data.mdx index 12d47a7c0e8bc..830df0734b918 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data'] --- import kbnSharedUxPageNoDataObj from './kbn_shared_ux_page_no_data.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 13 | 0 | 4 | 0 | +| 13 | 0 | 5 | 0 | ## Common diff --git a/api_docs/kbn_shared_ux_page_no_data_config.devdocs.json b/api_docs/kbn_shared_ux_page_no_data_config.devdocs.json index 2736dcfb19759..07e83e6991e88 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config.devdocs.json +++ b/api_docs/kbn_shared_ux_page_no_data_config.devdocs.json @@ -140,9 +140,7 @@ "label": "NoDataConfigPageWithSolutionNavBar", "description": [], "signature": [ - "{ (props: ", - "Props", - "<", + "{ (props: Props<", "_EuiPageOuterProps", " & Omit<", "_EuiPageInnerProps", @@ -176,10 +174,16 @@ "P & Pick<", "KibanaPageTemplateProps", ", \"pageSideBar\" | \"pageSideBarProps\"> & { children?: React.ReactNode; } & { solutionNav: ", - "SolutionNavProps", + { + "pluginId": "@kbn/shared-ux-page-solution-nav", + "scope": "common", + "docId": "kibKbnSharedUxPageSolutionNavPluginApi", + "section": "def-common.SolutionNavProps", + "text": "SolutionNavProps" + }, "; }" ], - "path": "node_modules/@types/kbn__shared-ux-page-solution-nav/index.d.ts", + "path": "packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx", "deprecated": false, "trackAdoption": false } @@ -202,7 +206,7 @@ " & ", "RedirectAppLinksKibanaDependencies" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "path": "packages/shared-ux/page/no_data_config/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -232,7 +236,7 @@ "EuiPageSidebarProps", " | undefined; }" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "path": "packages/shared-ux/page/no_data_config/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -249,7 +253,7 @@ " & ", "RedirectAppLinksServices" ], - "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "path": "packages/shared-ux/page/no_data_config/types/index.d.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false 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 57d27b4c6fc34..05a47e9f7c4c4 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config'] --- import kbnSharedUxPageNoDataConfigObj from './kbn_shared_ux_page_no_data_config.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 11 | 0 | 5 | 0 | +| 11 | 0 | 9 | 0 | ## Common diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_no_data_config_mocks.devdocs.json index beaad7773c82b..d30a00b6d1dcd 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.devdocs.json @@ -34,7 +34,13 @@ "text": "NoDataConfigPageStorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "NoDataConfigPageProps", ", ", @@ -248,7 +254,13 @@ "label": "dependencies", "description": [], "signature": [ - "NoDataPageStorybookMock", + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.NoDataPageStorybookMock", + "text": "NoDataPageStorybookMock" + }, "[]" ], "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", @@ -385,13 +397,29 @@ "label": "Params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " & ", - "ArgumentParams", - "<", - "PropArguments", - ", {}> & ", - "NoDataCardStorybookParams" + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, + " & ", + { + "pluginId": "@kbn/shared-ux-card-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } ], "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", "deprecated": false, 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 f68c69ac5b8d9..75853258ef839 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_page_no_data_mocks.devdocs.json index 09a4c4fcda6af..eec36e151d26c 100644 --- a/api_docs/kbn_shared_ux_page_no_data_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.devdocs.json @@ -34,7 +34,13 @@ "text": "NoDataPageStorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "NoDataPageProps", ", ", @@ -248,7 +254,13 @@ "label": "dependencies", "description": [], "signature": [ - "NoDataCardStorybookMock", + { + "pluginId": "@kbn/shared-ux-card-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, "[]" ], "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", @@ -445,9 +457,21 @@ "label": "Params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " & ", - "NoDataCardStorybookParams" + { + "pluginId": "@kbn/shared-ux-card-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } ], "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", "deprecated": false, 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 d84975cfabd6c..b059a83410861 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: 2022-10-25 +date: 2022-11-07 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 c4f9865bdcf6c..8f6654c99976e 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json index 78f03a3e5bfd8..7d8d9d6a01b9b 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json @@ -180,7 +180,7 @@ "tags": [], "label": "NoDataViewsPromptComponentProps", "description": [], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -193,7 +193,7 @@ "description": [ "True if the user has permission to create a data view, false otherwise." ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false }, @@ -209,7 +209,7 @@ "signature": [ "(() => void) | undefined" ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -227,7 +227,7 @@ "signature": [ "string | undefined" ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false }, @@ -243,7 +243,7 @@ "signature": [ "\"warning\" | \"subdued\" | \"primary\" | \"accent\" | \"success\" | \"danger\" | \"transparent\" | \"plain\" | undefined" ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false } @@ -259,7 +259,7 @@ "description": [ "\nKibana-specific service types." ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -273,7 +273,7 @@ "signature": [ "{ docLinks: { links: { indexPatterns: { introduction: string; }; }; }; }" ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false }, @@ -289,7 +289,7 @@ "DataViewEditorOptions", ") => () => void; }" ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false } @@ -303,7 +303,7 @@ "tags": [], "label": "NoDataViewsPromptProps", "description": [], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -319,7 +319,7 @@ "signature": [ "(dataView: unknown) => void" ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -333,7 +333,7 @@ "signature": [ "unknown" ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -353,7 +353,7 @@ "description": [ "\nAbstract external services for this component." ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -366,7 +366,7 @@ "description": [ "True if the user has permission to create a new Data View, false otherwise." ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false }, @@ -384,7 +384,7 @@ "DataViewEditorOptions", ") => () => void" ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -398,7 +398,7 @@ "signature": [ "DataViewEditorOptions" ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -415,7 +415,7 @@ "description": [ "A link to information about Data Views in Kibana" ], - "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", + "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, "trackAdoption": false } 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 de091d050d0b1..f5dcfde0881ca 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] --- import kbnSharedUxPromptNoDataViewsObj from './kbn_shared_ux_prompt_no_data_views.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 24 | 0 | 4 | 0 | +| 24 | 0 | 10 | 0 | ## Common diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json index 6e741eeb458f3..3abb027d373c5 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json @@ -34,7 +34,13 @@ "text": "StorybookMock" }, " extends ", - "AbstractStorybookMock", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.AbstractStorybookMock", + "text": "AbstractStorybookMock" + }, "<", "NoDataViewsPromptProps", ", ", 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 9c5fd565d1934..55fe241da43ba 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: 2022-10-25 +date: 2022-11-07 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_router.mdx b/api_docs/kbn_shared_ux_router.mdx index 29bbc868d7108..9c56da5c008ef 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: 2022-10-25 +date: 2022-11-07 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 e6e11c1428f15..25e8aabcbd103 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: 2022-10-25 +date: 2022-11-07 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 f6bc6a8760f65..b35af3d4dddd6 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_shared_ux_storybook_mock.devdocs.json index 10d6ff9a9a534..4736b2493fd6e 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.devdocs.json +++ b/api_docs/kbn_shared_ux_storybook_mock.devdocs.json @@ -183,7 +183,13 @@ ], "signature": [ "(arg: keyof PropArguments | keyof ServiceArguments, params?: ", - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " | undefined) => any" ], "path": "packages/shared-ux/storybook/mock/src/mocks.ts", @@ -213,7 +219,13 @@ "label": "params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " | undefined" ], "path": "packages/shared-ux/storybook/mock/src/mocks.ts", @@ -235,7 +247,13 @@ ], "signature": [ "(params?: ", - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " | undefined) => Props" ], "path": "packages/shared-ux/storybook/mock/src/mocks.ts", @@ -250,7 +268,13 @@ "label": "params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " | undefined" ], "path": "packages/shared-ux/storybook/mock/src/mocks.ts", @@ -272,7 +296,13 @@ ], "signature": [ "(params?: ", - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " | undefined) => Services" ], "path": "packages/shared-ux/storybook/mock/src/mocks.ts", @@ -287,7 +317,13 @@ "label": "params", "description": [], "signature": [ - "ArgumentParams", + { + "pluginId": "@kbn/shared-ux-storybook-mock", + "scope": "common", + "docId": "kibKbnSharedUxStorybookMockPluginApi", + "section": "def-common.ArgumentParams", + "text": "ArgumentParams" + }, " | undefined" ], "path": "packages/shared-ux/storybook/mock/src/mocks.ts", @@ -305,7 +341,25 @@ "functions": [], "interfaces": [], "enums": [], - "misc": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-storybook-mock", + "id": "def-common.ArgumentParams", + "type": "Type", + "tags": [], + "label": "ArgumentParams", + "description": [ + "\nType that expresses the arguments available to a story based on the\nprops and services the component consumes." + ], + "signature": [ + "{ [P in keyof PropArguments | keyof ServiceArguments]: any; }" + ], + "path": "packages/shared-ux/storybook/mock/src/mocks.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_storybook_mock.mdx b/api_docs/kbn_shared_ux_storybook_mock.mdx index 79a277f3c4d5f..cf2961344f256 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-mock'] --- import kbnSharedUxStorybookMockObj from './kbn_shared_ux_storybook_mock.devdocs.json'; @@ -21,10 +21,13 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 14 | 0 | 4 | 1 | +| 15 | 0 | 4 | 0 | ## Common ### Classes +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index e9dd81e1b999c..478711ffe1a5a 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] --- import kbnSharedUxUtilityObj from './kbn_shared_ux_utility.devdocs.json'; diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index 30b1af925cb49..7e5fd15c85947 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: 2022-10-25 +date: 2022-11-07 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_package_json.mdx b/api_docs/kbn_sort_package_json.mdx index 552050e6a93bd..6d5bb1e0f2ca1 100644 --- a/api_docs/kbn_sort_package_json.mdx +++ b/api_docs/kbn_sort_package_json.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sort-package-json title: "@kbn/sort-package-json" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sort-package-json plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-package-json'] --- import kbnSortPackageJsonObj from './kbn_sort_package_json.devdocs.json'; diff --git a/api_docs/kbn_std.devdocs.json b/api_docs/kbn_std.devdocs.json index c8636b80ef3b5..730a237d2c47b 100644 --- a/api_docs/kbn_std.devdocs.json +++ b/api_docs/kbn_std.devdocs.json @@ -412,7 +412,13 @@ ], "signature": [ "(object: T) => ", - "RecursiveReadonly", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.RecursiveReadonly", + "text": "RecursiveReadonly" + }, "" ], "path": "packages/kbn-std/src/deep_freeze.ts", diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index 47285c7067612..fb4984e62f84c 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: 2022-10-25 +date: 2022-11-07 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 899aa1a5665ff..f0681448aab1c 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: 2022-10-25 +date: 2022-11-07 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 a9c17de3616f3..45bb898ae32e5 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index 29483e055b9dd..b1b2ca983c04a 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; diff --git a/api_docs/kbn_test.devdocs.json b/api_docs/kbn_test.devdocs.json index db22fd28c89fe..c8dd06291eab2 100644 --- a/api_docs/kbn_test.devdocs.json +++ b/api_docs/kbn_test.devdocs.json @@ -259,7 +259,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-test/src/functional_test_runner/lib/docker_servers/docker_servers_service.ts", "deprecated": false, @@ -601,7 +607,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-test/src/functional_test_runner/functional_test_runner.ts", "deprecated": false, @@ -1375,7 +1387,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-test/src/functional_test_runner/lib/lifecycle.ts", "deprecated": false, @@ -2168,7 +2186,13 @@ "description": [], "signature": [ "(log: ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, ", esVersion: ", { "pluginId": "@kbn/test", @@ -2199,7 +2223,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-test/src/functional_test_runner/lib/config/config_loading.ts", "deprecated": false, @@ -2388,7 +2418,13 @@ ], "signature": [ "(log: ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, ", options: { configs: string[]; esVersion: ", { "pluginId": "@kbn/test", @@ -2411,7 +2447,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-test/src/functional_tests/run_tests/run_tests.ts", "deprecated": false, @@ -2462,6 +2504,54 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/test", + "id": "def-server.setupJUnitReportGeneration", + "type": "Function", + "tags": [], + "label": "setupJUnitReportGeneration", + "description": [], + "signature": [ + "(runner: any, options: {}) => void" + ], + "path": "packages/kbn-test/src/mocha/junit_report_generation.js", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/test", + "id": "def-server.setupJUnitReportGeneration.$1", + "type": "Any", + "tags": [], + "label": "runner", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-test/src/mocha/junit_report_generation.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/test", + "id": "def-server.setupJUnitReportGeneration.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "{}" + ], + "path": "packages/kbn-test/src/mocha/junit_report_generation.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/test", "id": "def-server.startServers", @@ -2471,7 +2561,13 @@ "description": [], "signature": [ "(log: ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, ", options: { config: string; esFrom: \"source\" | \"snapshot\" | undefined; esVersion: ", { "pluginId": "@kbn/test", @@ -2494,7 +2590,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-test/src/functional_tests/start_servers/start_servers.ts", "deprecated": false, @@ -2762,7 +2864,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-test/src/es/test_es_cluster.ts", "deprecated": false, @@ -3212,7 +3320,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-test/src/functional_test_runner/public_types.ts", "deprecated": false, @@ -3419,7 +3533,13 @@ "text": "Config" }, "; (serviceName: \"log\"): ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, "; (serviceName: \"lifecycle\"): ", { "pluginId": "@kbn/test", @@ -3487,7 +3607,13 @@ "text": "Config" }, "; (serviceName: \"log\"): ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, "; (serviceName: \"lifecycle\"): ", { "pluginId": "@kbn/test", @@ -3555,7 +3681,13 @@ "text": "Config" }, "; (serviceName: \"log\"): ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, "; (serviceName: \"lifecycle\"): ", { "pluginId": "@kbn/test", @@ -3623,7 +3755,13 @@ "text": "Config" }, "; (serviceName: \"log\"): ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, "; (serviceName: \"lifecycle\"): ", { "pluginId": "@kbn/test", @@ -3691,7 +3829,13 @@ "text": "Config" }, "; (serviceName: \"log\"): ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, "; (serviceName: \"lifecycle\"): ", { "pluginId": "@kbn/test", @@ -3759,7 +3903,13 @@ "text": "Config" }, "; (serviceName: \"log\"): ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, "; (serviceName: \"lifecycle\"): ", { "pluginId": "@kbn/test", @@ -3827,7 +3977,13 @@ "text": "Config" }, "; (serviceName: \"log\"): ", - "ToolingLog", + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, "; (serviceName: \"lifecycle\"): ", { "pluginId": "@kbn/test", @@ -4179,7 +4335,13 @@ "label": "log", "description": [], "signature": [ - "ToolingLog" + { + "pluginId": "@kbn/tooling-log", + "scope": "server", + "docId": "kibKbnToolingLogPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } ], "path": "packages/kbn-test/src/kbn_client/kbn_client.ts", "deprecated": false, @@ -4788,13 +4950,10 @@ { "parentPluginId": "@kbn/test", "id": "def-server.systemIndicesSuperuser.username", - "type": "Any", + "type": "string", "tags": [], "label": "username", "description": [], - "signature": [ - "any" - ], "path": "packages/kbn-test/src/kbn/users.ts", "deprecated": false, "trackAdoption": false diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 7ce67ac6c1d48..5a324dc51a626 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; @@ -21,7 +21,7 @@ Contact Operations for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 261 | 4 | 217 | 11 | +| 264 | 4 | 220 | 11 | ## Server diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 1c18f3ac574de..35d0028e7f6e8 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: 2022-10-25 +date: 2022-11-07 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 7e6bd9b5a1e48..eaa909c7985ba 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-subj-selector'] --- import kbnTestSubjSelectorObj from './kbn_test_subj_selector.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.devdocs.json b/api_docs/kbn_tooling_log.devdocs.json index 6323eacf6604a..22807adbce52d 100644 --- a/api_docs/kbn_tooling_log.devdocs.json +++ b/api_docs/kbn_tooling_log.devdocs.json @@ -26,7 +26,13 @@ "text": "ToolingLog" }, " implements ", - "SomeDevLog" + { + "pluginId": "@kbn/some-dev-log", + "scope": "server", + "docId": "kibKbnSomeDevLogPluginApi", + "section": "def-server.SomeDevLog", + "text": "SomeDevLog" + } ], "path": "packages/kbn-tooling-log/src/tooling_log.ts", "deprecated": false, diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 0edc5d92f4e59..20a9ac9f513f7 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_type_summarizer.devdocs.json b/api_docs/kbn_type_summarizer.devdocs.json index 40ba2fe956d4d..3e70eac82db20 100644 --- a/api_docs/kbn_type_summarizer.devdocs.json +++ b/api_docs/kbn_type_summarizer.devdocs.json @@ -22,7 +22,13 @@ ], "signature": [ "(log: ", - "Logger", + { + "pluginId": "@kbn/type-summarizer-core", + "scope": "server", + "docId": "kibKbnTypeSummarizerCorePluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, ", options: ", { "pluginId": "@kbn/type-summarizer", @@ -47,7 +53,13 @@ "label": "log", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/type-summarizer-core", + "scope": "server", + "docId": "kibKbnTypeSummarizerCorePluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "packages/kbn-type-summarizer/src/summarize_package.ts", "deprecated": false, diff --git a/api_docs/kbn_type_summarizer.mdx b/api_docs/kbn_type_summarizer.mdx index 764a969b54594..a4c2477c65514 100644 --- a/api_docs/kbn_type_summarizer.mdx +++ b/api_docs/kbn_type_summarizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer title: "@kbn/type-summarizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/type-summarizer plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer'] --- import kbnTypeSummarizerObj from './kbn_type_summarizer.devdocs.json'; diff --git a/api_docs/kbn_type_summarizer_core.mdx b/api_docs/kbn_type_summarizer_core.mdx index 6964f368a1461..47eaeb0ee57e2 100644 --- a/api_docs/kbn_type_summarizer_core.mdx +++ b/api_docs/kbn_type_summarizer_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer-core title: "@kbn/type-summarizer-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/type-summarizer-core plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer-core'] --- import kbnTypeSummarizerCoreObj from './kbn_type_summarizer_core.devdocs.json'; diff --git a/api_docs/kbn_typed_react_router_config.devdocs.json b/api_docs/kbn_typed_react_router_config.devdocs.json index b6c4b0eb31605..f4cc199ac6dbf 100644 --- a/api_docs/kbn_typed_react_router_config.devdocs.json +++ b/api_docs/kbn_typed_react_router_config.devdocs.json @@ -690,7 +690,7 @@ "label": "element", "description": [], "signature": [ - "React.ReactElement" + "React.ReactElement>" ], "path": "packages/kbn-typed-react-router-config/src/types/index.ts", "deprecated": false, diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index b3017501cd787..f43e1ec2a88dd 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: 2022-10-25 +date: 2022-11-07 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_shared_deps_src.devdocs.json b/api_docs/kbn_ui_shared_deps_src.devdocs.json new file mode 100644 index 0000000000000..95594baac9f58 --- /dev/null +++ b/api_docs/kbn_ui_shared_deps_src.devdocs.json @@ -0,0 +1,543 @@ +{ + "id": "@kbn/ui-shared-deps-src", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.cssDistFilename", + "type": "string", + "tags": [], + "label": "cssDistFilename", + "description": [ + "\nFilename of the main bundle file in the distributable directory" + ], + "signature": [ + "\"kbn-ui-shared-deps-src.css\"" + ], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.distDir", + "type": "string", + "tags": [], + "label": "distDir", + "description": [ + "\nAbsolute path to the distributable directory" + ], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.jsFilename", + "type": "string", + "tags": [], + "label": "jsFilename", + "description": [ + "\nFilename of the main bundle file in the distributable directory" + ], + "signature": [ + "\"kbn-ui-shared-deps-src.js\"" + ], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals", + "type": "Object", + "tags": [], + "label": "externals", + "description": [ + "\nExternals mapping inteded to be used in a webpack config" + ], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.kbnuitheme", + "type": "string", + "tags": [], + "label": "'@kbn/ui-theme'", + "description": [ + "/**\n * stateful deps\n */" + ], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.kbni18n", + "type": "string", + "tags": [], + "label": "'@kbn/i18n'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.kbni18nreact", + "type": "string", + "tags": [], + "label": "'@kbn/i18n-react'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.emotioncache", + "type": "string", + "tags": [], + "label": "'@emotion/cache'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.emotionreact", + "type": "string", + "tags": [], + "label": "'@emotion/react'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.jquery", + "type": "string", + "tags": [], + "label": "jquery", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.moment", + "type": "string", + "tags": [], + "label": "moment", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.momenttimezone", + "type": "string", + "tags": [], + "label": "'moment-timezone'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.react", + "type": "string", + "tags": [], + "label": "react", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.reactdom", + "type": "string", + "tags": [], + "label": "'react-dom'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.reactdomserver", + "type": "string", + "tags": [], + "label": "'react-dom/server'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.reactrouter", + "type": "string", + "tags": [], + "label": "'react-router'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.reactrouterdom", + "type": "string", + "tags": [], + "label": "'react-router-dom'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.styledcomponents", + "type": "string", + "tags": [], + "label": "'styled-components'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.kbnmonaco", + "type": "string", + "tags": [], + "label": "'@kbn/monaco'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.monacoeditoresmvseditoreditor.api", + "type": "string", + "tags": [], + "label": "'monaco-editor/esm/vs/editor/editor.api'", + "description": [ + "// this is how plugins/consumers from npm load monaco" + ], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.rxjs", + "type": "string", + "tags": [], + "label": "rxjs", + "description": [ + "/**\n * big deps which are locked to a single version\n */" + ], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.rxjsoperators", + "type": "string", + "tags": [], + "label": "'rxjs/operators'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.numeral", + "type": "string", + "tags": [], + "label": "numeral", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.elasticnumeral", + "type": "string", + "tags": [], + "label": "'@elastic/numeral'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.elasticcharts", + "type": "string", + "tags": [], + "label": "'@elastic/charts'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.kbndatemath", + "type": "string", + "tags": [], + "label": "'@kbn/datemath'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.elasticeui", + "type": "string", + "tags": [], + "label": "'@elastic/eui'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.elasticeuilibservices", + "type": "string", + "tags": [], + "label": "'@elastic/eui/lib/services'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.elasticeuilibservicesformat", + "type": "string", + "tags": [], + "label": "'@elastic/eui/lib/services/format'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.elasticeuidisteui_charts_theme", + "type": "string", + "tags": [], + "label": "'@elastic/eui/dist/eui_charts_theme'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.reactbeautifuldnd", + "type": "string", + "tags": [], + "label": "'react-beautiful-dnd'", + "description": [ + "// transient dep of eui" + ], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.lodash", + "type": "string", + "tags": [], + "label": "lodash", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.lodashfp", + "type": "string", + "tags": [], + "label": "'lodash/fp'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.fflate", + "type": "string", + "tags": [], + "label": "fflate", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.tslib", + "type": "string", + "tags": [], + "label": "tslib", + "description": [ + "/**\n * runtime deps which don't need to be copied across all bundles\n */" + ], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.kbnanalytics", + "type": "string", + "tags": [], + "label": "'@kbn/analytics'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.kbnesquery", + "type": "string", + "tags": [], + "label": "'@kbn/es-query'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.kbnstd", + "type": "string", + "tags": [], + "label": "'@kbn/std'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.kbnsaferlodashset", + "type": "string", + "tags": [], + "label": "'@kbn/safer-lodash-set'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.risonnode", + "type": "string", + "tags": [], + "label": "'rison-node'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.history", + "type": "string", + "tags": [], + "label": "history", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.classnames", + "type": "string", + "tags": [], + "label": "classnames", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.tanstackreactquery", + "type": "string", + "tags": [], + "label": "'@tanstack/react-query'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.tanstackreactquerydevtools", + "type": "string", + "tags": [], + "label": "'@tanstack/react-query-devtools'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_ui_shared_deps_src.mdx b/api_docs/kbn_ui_shared_deps_src.mdx new file mode 100644 index 0000000000000..1ad62c44de2fa --- /dev/null +++ b/api_docs/kbn_ui_shared_deps_src.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnUiSharedDepsSrcPluginApi +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: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-shared-deps-src'] +--- +import kbnUiSharedDepsSrcObj from './kbn_ui_shared_deps_src.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 44 | 0 | 35 | 0 | + +## Server + +### Objects + + +### Consts, variables and types + + diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index 9be8498892de8..9c202960ee32f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_user_profile_components.mdx b/api_docs/kbn_user_profile_components.mdx index a78215759deb6..f3ecc9094eaed 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: 2022-10-25 +date: 2022-11-07 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.devdocs.json b/api_docs/kbn_utility_types.devdocs.json index 1188303de0182..bd2863aa5599c 100644 --- a/api_docs/kbn_utility_types.devdocs.json +++ b/api_docs/kbn_utility_types.devdocs.json @@ -456,16 +456,16 @@ "pluginId": "@kbn/utility-types", "scope": "server", "docId": "kibKbnUtilityTypesPluginApi", - "section": "def-server.JsonArray", - "text": "JsonArray" + "section": "def-server.JsonObject", + "text": "JsonObject" }, " | ", { "pluginId": "@kbn/utility-types", "scope": "server", "docId": "kibKbnUtilityTypesPluginApi", - "section": "def-server.JsonObject", - "text": "JsonObject" + "section": "def-server.JsonArray", + "text": "JsonArray" }, " | null" ], diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index 8569c6d217fd0..2e113dcf6cb64 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: 2022-10-25 +date: 2022-11-07 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 0979bb2faf3d4..415cf206f4a8f 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: 2022-10-25 +date: 2022-11-07 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 631388b71d539..f98f7aa2e7bcf 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.devdocs.json b/api_docs/kbn_yarn_lock_validator.devdocs.json index 91771e7709cd2..856739993086c 100644 --- a/api_docs/kbn_yarn_lock_validator.devdocs.json +++ b/api_docs/kbn_yarn_lock_validator.devdocs.json @@ -49,7 +49,13 @@ ], "signature": [ "(log: ", - "SomeDevLog", + { + "pluginId": "@kbn/some-dev-log", + "scope": "server", + "docId": "kibKbnSomeDevLogPluginApi", + "section": "def-server.SomeDevLog", + "text": "SomeDevLog" + }, ", yarnLock: ", { "pluginId": "@kbn/yarn-lock-validator", @@ -72,7 +78,13 @@ "label": "log", "description": [], "signature": [ - "SomeDevLog" + { + "pluginId": "@kbn/some-dev-log", + "scope": "server", + "docId": "kibKbnSomeDevLogPluginApi", + "section": "def-server.SomeDevLog", + "text": "SomeDevLog" + } ], "path": "packages/kbn-yarn-lock-validator/src/validate_yarn_lock.ts", "deprecated": false, diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index 8e776d28e3254..3c934b452490d 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index d6861ce5e4b2c..03bc9924cd163 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: 2022-10-25 +date: 2022-11-07 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 2bb478cb6e99c..d53aecf80c373 100644 --- a/api_docs/kibana_react.devdocs.json +++ b/api_docs/kibana_react.devdocs.json @@ -279,7 +279,13 @@ "description": [], "signature": [ ">(services: Services) => ", { "pluginId": "kibanaReact", @@ -322,7 +328,13 @@ "description": [], "signature": [ "(services: Partial<", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ">) => ", { "pluginId": "kibanaReact", @@ -345,7 +357,13 @@ "description": [], "signature": [ "Partial<", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ">" ], "path": "src/plugins/kibana_react/public/notifications/create_notifications.tsx", @@ -366,7 +384,13 @@ "description": [], "signature": [ "(services: Partial<", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ">) => ", { "pluginId": "kibanaReact", @@ -389,7 +413,13 @@ "description": [], "signature": [ "Partial<", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ">" ], "path": "src/plugins/kibana_react/public/overlays/create_react_overlays.tsx", @@ -522,6 +552,34 @@ "deprecated": true, "trackAdoption": false, "references": [ + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/tutorial_directory.js" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/tutorial_directory.js" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/tutorial_directory.js" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/tutorial/tutorial.js" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/tutorial/tutorial.js" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/tutorial/tutorial.js" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/tutorial/tutorial.js" + }, { "plugin": "spaces", "path": "x-pack/plugins/spaces/public/space_selector/space_selector.tsx" @@ -945,7 +1003,13 @@ "description": [], "signature": [ "(history: ", - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, " | ", "History", ", to: string | LocationObject, onClickCallback?: Function | undefined) => { href: string; onClick: (event: React.MouseEvent) => void; }" @@ -962,7 +1026,13 @@ "label": "history", "description": [], "signature": [ - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, " | ", "History", "" @@ -1015,7 +1085,13 @@ "description": [], "signature": [ "(history: ", - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, " | ", "History", ", to: string | LocationObject, onClickCallback?: Function | undefined) => (event: React.MouseEvent) => void" @@ -1032,7 +1108,13 @@ "label": "history", "description": [], "signature": [ - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, " | ", "History", "" @@ -1139,6 +1221,38 @@ "deprecated": true, "trackAdoption": false, "references": [ + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/add_data/add_data.tsx" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/add_data/add_data.tsx" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/add_data/add_data.tsx" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/manage_data/manage_data.tsx" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/manage_data/manage_data.tsx" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/manage_data/manage_data.tsx" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/manage_data/manage_data.tsx" + }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/manage_data/manage_data.tsx" + }, { "plugin": "home", "path": "src/plugins/home/public/application/application.tsx" @@ -1434,38 +1548,6 @@ { "plugin": "kibanaOverview", "path": "src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx" - }, - { - "plugin": "home", - "path": "src/plugins/home/public/application/components/add_data/add_data.tsx" - }, - { - "plugin": "home", - "path": "src/plugins/home/public/application/components/add_data/add_data.tsx" - }, - { - "plugin": "home", - "path": "src/plugins/home/public/application/components/add_data/add_data.tsx" - }, - { - "plugin": "home", - "path": "src/plugins/home/public/application/components/manage_data/manage_data.tsx" - }, - { - "plugin": "home", - "path": "src/plugins/home/public/application/components/manage_data/manage_data.tsx" - }, - { - "plugin": "home", - "path": "src/plugins/home/public/application/components/manage_data/manage_data.tsx" - }, - { - "plugin": "home", - "path": "src/plugins/home/public/application/components/manage_data/manage_data.tsx" - }, - { - "plugin": "home", - "path": "src/plugins/home/public/application/components/manage_data/manage_data.tsx" } ], "children": [ @@ -1544,7 +1626,13 @@ "text": "ToMountPointOptions" }, ") => ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, "" ], "path": "src/plugins/kibana_react/public/util/to_mount_point.tsx", @@ -1767,9 +1855,21 @@ ], "signature": [ "(executionContext: ", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, " | undefined, context: ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, ") => void" ], "path": "src/plugins/kibana_react/public/use_execution_context/use_execution_context.ts", @@ -1784,7 +1884,13 @@ "label": "executionContext", "description": [], "signature": [ - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, " | undefined" ], "path": "src/plugins/kibana_react/public/use_execution_context/use_execution_context.ts", @@ -1800,7 +1906,13 @@ "label": "context", "description": [], "signature": [ - "KibanaExecutionContext" + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + } ], "path": "src/plugins/kibana_react/public/use_execution_context/use_execution_context.ts", "deprecated": false, @@ -1828,7 +1940,13 @@ "text": "KibanaReactContextValue" }, " & Extra>" ], "path": "src/plugins/kibana_react/public/context/context.tsx", @@ -1990,7 +2108,13 @@ "(node: React.ReactNode, theme$: ", "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">) => React.ReactElement>" ], "path": "src/plugins/kibana_react/public/theme/wrap_with_theme.tsx", @@ -2022,7 +2146,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/kibana_react/public/theme/wrap_with_theme.tsx", @@ -2071,7 +2201,13 @@ "label": "chrome", "description": [], "signature": [ - "ChromeStart" + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeStart", + "text": "ChromeStart" + } ], "path": "src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx", "deprecated": false, @@ -2386,9 +2522,21 @@ "description": [], "signature": [ "(node: React.ReactNode, options?: ", - "OverlayFlyoutOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayFlyoutOpenOptions", + "text": "OverlayFlyoutOpenOptions" + }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], "path": "src/plugins/kibana_react/public/overlays/types.ts", "deprecated": false, @@ -2417,7 +2565,13 @@ "label": "options", "description": [], "signature": [ - "OverlayFlyoutOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayFlyoutOpenOptions", + "text": "OverlayFlyoutOpenOptions" + }, " | undefined" ], "path": "src/plugins/kibana_react/public/overlays/types.ts", @@ -2437,9 +2591,21 @@ "description": [], "signature": [ "(node: React.ReactNode, options?: ", - "OverlayModalOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayModalOpenOptions", + "text": "OverlayModalOpenOptions" + }, " | undefined) => ", - "OverlayRef" + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + } ], "path": "src/plugins/kibana_react/public/overlays/types.ts", "deprecated": false, @@ -2468,7 +2634,13 @@ "label": "options", "description": [], "signature": [ - "OverlayModalOpenOptions", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayModalOpenOptions", + "text": "OverlayModalOpenOptions" + }, " | undefined" ], "path": "src/plugins/kibana_react/public/overlays/types.ts", @@ -2709,7 +2881,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, "> | undefined" ], "path": "src/plugins/kibana_react/public/util/to_mount_point.tsx", @@ -3037,35 +3215,125 @@ "description": [], "signature": [ "{ analytics?: ", - "AnalyticsServiceStart", + { + "pluginId": "@kbn/core-analytics-browser", + "scope": "common", + "docId": "kibKbnCoreAnalyticsBrowserPluginApi", + "section": "def-common.AnalyticsServiceStart", + "text": "AnalyticsServiceStart" + }, " | undefined; application?: ", - "ApplicationStart", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationStart", + "text": "ApplicationStart" + }, " | undefined; chrome?: ", - "ChromeStart", + { + "pluginId": "@kbn/core-chrome-browser", + "scope": "common", + "docId": "kibKbnCoreChromeBrowserPluginApi", + "section": "def-common.ChromeStart", + "text": "ChromeStart" + }, " | undefined; docLinks?: ", - "DocLinksStart", + { + "pluginId": "@kbn/core-doc-links-browser", + "scope": "common", + "docId": "kibKbnCoreDocLinksBrowserPluginApi", + "section": "def-common.DocLinksStart", + "text": "DocLinksStart" + }, " | undefined; executionContext?: ", - "ExecutionContextSetup", + { + "pluginId": "@kbn/core-execution-context-browser", + "scope": "common", + "docId": "kibKbnCoreExecutionContextBrowserPluginApi", + "section": "def-common.ExecutionContextSetup", + "text": "ExecutionContextSetup" + }, " | undefined; http?: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, " | undefined; savedObjects?: ", - "SavedObjectsStart", + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + }, " | undefined; i18n?: ", - "I18nStart", + { + "pluginId": "@kbn/core-i18n-browser", + "scope": "common", + "docId": "kibKbnCoreI18nBrowserPluginApi", + "section": "def-common.I18nStart", + "text": "I18nStart" + }, " | undefined; notifications?: ", - "NotificationsStart", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + }, " | undefined; overlays?: ", - "OverlayStart", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + }, " | undefined; uiSettings?: ", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + }, " | undefined; fatalErrors?: ", - "FatalErrorsSetup", + { + "pluginId": "@kbn/core-fatal-errors-browser", + "scope": "common", + "docId": "kibKbnCoreFatalErrorsBrowserPluginApi", + "section": "def-common.FatalErrorsSetup", + "text": "FatalErrorsSetup" + }, " | undefined; deprecations?: ", - "DeprecationsServiceStart", + { + "pluginId": "@kbn/core-deprecations-browser", + "scope": "common", + "docId": "kibKbnCoreDeprecationsBrowserPluginApi", + "section": "def-common.DeprecationsServiceStart", + "text": "DeprecationsServiceStart" + }, " | undefined; theme?: ", - "ThemeServiceStart", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + }, " | undefined; injectedMetadata?: ", - "InjectedMetadataStart", + { + "pluginId": "@kbn/core-injected-metadata-browser", + "scope": "common", + "docId": "kibKbnCoreInjectedMetadataBrowserPluginApi", + "section": "def-common.InjectedMetadataStart", + "text": "InjectedMetadataStart" + }, " | undefined; }" ], "path": "src/plugins/kibana_react/public/context/types.ts", @@ -3166,10 +3434,13 @@ { "parentPluginId": "kibanaReact", "id": "def-public.NO_DATA_RECOMMENDED", - "type": "string", + "type": "Any", "tags": [], "label": "NO_DATA_RECOMMENDED", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.tsx", "deprecated": false, "trackAdoption": false, @@ -3329,7 +3600,13 @@ "text": "KibanaReactContextValue" }, ">>" ], "path": "src/plugins/kibana_react/public/context/context.tsx", diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index 9cd7b80a16842..66619215c7640 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] --- import kibanaReactObj from './kibana_react.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 184 | 0 | 151 | 5 | +| 184 | 1 | 151 | 5 | ## Client diff --git a/api_docs/kibana_utils.devdocs.json b/api_docs/kibana_utils.devdocs.json index be9527781185b..6731244a7c301 100644 --- a/api_docs/kibana_utils.devdocs.json +++ b/api_docs/kibana_utils.devdocs.json @@ -1956,9 +1956,21 @@ "; }[]; storageKey: string; navLinkUpdater$: ", "BehaviorSubject", "<", - "AppUpdater", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUpdater", + "text": "AppUpdater" + }, ">; toastNotifications: ", - "IToasts", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + }, "; history?: ", "History", " | undefined; getHistory?: (() => ", @@ -2050,7 +2062,13 @@ "signature": [ "BehaviorSubject", "<", - "AppUpdater", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUpdater", + "text": "AppUpdater" + }, ">" ], "path": "src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.ts", @@ -2067,7 +2085,13 @@ "\nToast notifications service to show toasts in error cases." ], "signature": [ - "IToasts" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } ], "path": "src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.ts", "deprecated": false, @@ -2362,7 +2386,13 @@ ], "signature": [ "(accessor: ", - "StartServicesAccessor", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.StartServicesAccessor", + "text": "StartServicesAccessor" + }, ") => ", { "pluginId": "kibanaUtils", @@ -2372,7 +2402,13 @@ "text": "StartServicesGetter" }, "" ], "path": "src/plugins/kibana_utils/public/core/create_start_service_getter.ts", @@ -2389,7 +2425,13 @@ "Asynchronous start service accessor provided by platform." ], "signature": [ - "StartServicesAccessor", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.StartServicesAccessor", + "text": "StartServicesAccessor" + }, "" ], "path": "src/plugins/kibana_utils/public/core/create_start_service_getter.ts", @@ -3353,11 +3395,29 @@ "({\n history,\n navigateToApp,\n basePath,\n mapping,\n toastNotifications,\n onBeforeRedirect,\n theme,\n}: { history: ", "History", "; navigateToApp: (appId: string, options?: ", - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined) => Promise; basePath: ", - "IBasePath", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IBasePath", + "text": "IBasePath" + }, "; mapping: string | Mapping; toastNotifications: ", - "IToasts", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + }, "; onBeforeRedirect?: ((error: ", { "pluginId": "kibanaUtils", @@ -3367,7 +3427,13 @@ "text": "SavedObjectNotFound" }, ") => void) | undefined; theme: ", - "ThemeServiceStart", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + }, "; }) => (error: ", { "pluginId": "kibanaUtils", @@ -3417,7 +3483,13 @@ "description": [], "signature": [ "(appId: string, options?: ", - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined) => Promise" ], "path": "src/plugins/kibana_utils/public/history/redirect_when_missing.tsx", @@ -3432,7 +3504,7 @@ "tags": [], "label": "appId", "description": [], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false }, @@ -3444,10 +3516,16 @@ "label": "options", "description": [], "signature": [ - "NavigateToAppOptions", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.NavigateToAppOptions", + "text": "NavigateToAppOptions" + }, " | undefined" ], - "path": "node_modules/@types/kbn__core-application-browser/index.d.ts", + "path": "packages/core/application/core-application-browser/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -3461,7 +3539,13 @@ "label": "basePath", "description": [], "signature": [ - "IBasePath" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IBasePath", + "text": "IBasePath" + } ], "path": "src/plugins/kibana_utils/public/history/redirect_when_missing.tsx", "deprecated": false, @@ -3493,7 +3577,13 @@ "\nToast notifications service to show toasts in error cases." ], "signature": [ - "IToasts" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } ], "path": "src/plugins/kibana_utils/public/history/redirect_when_missing.tsx", "deprecated": false, @@ -3555,7 +3645,13 @@ "label": "theme", "description": [], "signature": [ - "ThemeServiceStart" + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.ThemeServiceStart", + "text": "ThemeServiceStart" + } ], "path": "src/plugins/kibana_utils/public/history/redirect_when_missing.tsx", "deprecated": false, @@ -4266,7 +4362,13 @@ ], "signature": [ "(toasts: ", - "IToasts", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + }, ") => { onGetError: (error: Error) => void; onSetError: (error: Error) => void; }" ], "path": "src/plugins/kibana_utils/public/state_management/url/errors.ts", @@ -4281,7 +4383,13 @@ "label": "toasts", "description": [], "signature": [ - "IToasts" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } ], "path": "src/plugins/kibana_utils/public/state_management/url/errors.ts", "deprecated": false, @@ -6381,9 +6489,21 @@ "description": [], "signature": [ "{ [K in keyof T]: ReturnType<", - "Ensure", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Ensure", + "text": "Ensure" + }, "<", - "Ensure", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Ensure", + "text": "Ensure" + }, " StartServices" ], "path": "src/plugins/kibana_utils/public/core/create_start_service_getter.ts", @@ -7489,7 +7621,13 @@ ], "signature": [ "(res: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ", err: ", { "pluginId": "kibanaUtils", @@ -7499,7 +7637,13 @@ "text": "KbnServerError" }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, "" ], "path": "src/plugins/kibana_utils/server/report_server_error.ts", @@ -7516,7 +7660,13 @@ "Formats a `KbnServerError` into a server error response" ], "signature": [ - "KibanaResponseFactory" + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + } ], "path": "src/plugins/kibana_utils/server/report_server_error.ts", "deprecated": false, @@ -9200,7 +9350,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">) => S" ], "path": "src/plugins/kibana_utils/common/persistable_state/migrate_to_latest.ts", @@ -9244,7 +9400,13 @@ "text": "VersionedState" }, "<", - "Serializable", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Serializable", + "text": "Serializable" + }, ">" ], "path": "src/plugins/kibana_utils/common/persistable_state/migrate_to_latest.ts", @@ -9781,7 +9943,13 @@ ], "signature": [ "(state: P, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => P" ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", @@ -9815,7 +9983,13 @@ "List of saved object references." ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", @@ -9839,7 +10013,13 @@ ], "signature": [ "(state: P) => { state: P; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", @@ -9988,7 +10168,13 @@ ], "signature": [ "(state: P, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => P" ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", @@ -10022,7 +10208,13 @@ "List of saved object references." ], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", @@ -10046,7 +10238,13 @@ ], "signature": [ "(state: P) => { state: P; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", @@ -11081,9 +11279,21 @@ "description": [], "signature": [ "{ telemetry?: ((state: P, stats: Record) => Record) | undefined; inject?: ((state: P, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => P) | undefined; extract?: ((state: P) => { state: P; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }) | undefined; migrations?: ", { "pluginId": "kibanaUtils", @@ -11118,9 +11328,21 @@ ], "signature": [ "(state: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ", version: string) => ", - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", "deprecated": false, @@ -11135,7 +11357,13 @@ "label": "state", "description": [], "signature": [ - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", "deprecated": false, @@ -11204,9 +11432,21 @@ "description": [], "signature": [ "{ [K in keyof T]: ReturnType<", - "Ensure", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Ensure", + "text": "Ensure" + }, "<", - "Ensure", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.Ensure", + "text": "Ensure" + }, " ", - "KibanaExecutionContext", + { + "pluginId": "@kbn/core-execution-context-common", + "scope": "common", + "docId": "kibKbnCoreExecutionContextCommonPluginApi", + "section": "def-common.KibanaExecutionContext", + "text": "KibanaExecutionContext" + }, " | undefined" ], "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx", @@ -642,7 +648,13 @@ ], "signature": [ "() => Promise<", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]>" ], "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx", @@ -664,7 +676,13 @@ ], "signature": [ "() => Promise<", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined>" ], "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx", @@ -1365,7 +1383,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }>" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", @@ -1564,11 +1588,29 @@ "text": "Datatable" }, "> | undefined, timeRange?: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined) => { error: string; } | Record<\"disabled\" | \"enabled\", { kuery: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "[][]; lucene: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "[][]; }>" ], "path": "x-pack/plugins/lens/public/types.ts", @@ -1606,7 +1648,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined" ], "path": "x-pack/plugins/lens/public/types.ts", @@ -2182,7 +2230,15 @@ ], "signature": [ "(id: string, column: { formula: string; label?: string | undefined; filter?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, + " | undefined; reducedTimeRange?: string | undefined; timeScale?: ", + "TimeScaleUnit", " | undefined; format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; }, layer: ", { "pluginId": "lens", @@ -2274,7 +2330,42 @@ "label": "filter", "description": [], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, + " | undefined" + ], + "path": "x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "lens", + "id": "def-public.FormulaPublicApi.insertOrReplaceFormulaColumn.$2.reducedTimeRange", + "type": "string", + "tags": [], + "label": "reducedTimeRange", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "lens", + "id": "def-public.FormulaPublicApi.insertOrReplaceFormulaColumn.$2.timeScale", + "type": "CompoundType", + "tags": [], + "label": "timeScale", + "description": [], + "signature": [ + "TimeScaleUnit", " | undefined" ], "path": "x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.ts", @@ -2463,6 +2554,20 @@ "deprecated": false, "trackAdoption": false, "children": [ + { + "parentPluginId": "lens", + "id": "def-public.LegacyMetricState.autoScaleMetricAlignment", + "type": "CompoundType", + "tags": [], + "label": "autoScaleMetricAlignment", + "description": [], + "signature": [ + "\"left\" | \"right\" | \"center\" | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "lens", "id": "def-public.LegacyMetricState.layerId", @@ -2531,9 +2636,21 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", - "CustomPaletteParams", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, "> | undefined" ], "path": "x-pack/plugins/lens/common/types.ts", @@ -3449,7 +3566,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }> | undefined" ], "path": "x-pack/plugins/lens/common/types.ts", @@ -3978,7 +4101,13 @@ "label": "mainPalette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }> | undefined" ], "path": "x-pack/plugins/lens/public/types.ts", @@ -4261,7 +4390,13 @@ ], "signature": [ "(addNewLayer: () => string, state?: T | undefined, mainPalette?: ", - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }> | undefined) => T" ], "path": "x-pack/plugins/lens/public/types.ts", @@ -4306,7 +4441,13 @@ "label": "mainPalette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }> | undefined" ], "path": "x-pack/plugins/lens/public/types.ts", @@ -4407,7 +4548,13 @@ "description": [], "signature": [ "((state: T) => ", - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }> | undefined) | undefined" ], "path": "x-pack/plugins/lens/public/types.ts", @@ -4595,7 +4742,13 @@ ], "signature": [ "((state: T) => { state: P; savedObjectReferences: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }) | undefined" ], "path": "x-pack/plugins/lens/public/types.ts", @@ -4631,7 +4784,13 @@ ], "signature": [ "((state: P, references?: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined, initialContext?: ", { "pluginId": "uiActions", @@ -4679,7 +4838,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined" ], "path": "x-pack/plugins/lens/public/types.ts", @@ -6168,7 +6333,13 @@ "text": "DatasourcePublicAPI" }, ">>, attributes?: Partial<{ title: string; description: string; }> | undefined, datasourceExpressionsByLayers?: Record | undefined) => string | ", { "pluginId": "expressions", @@ -6245,7 +6416,13 @@ "description": [], "signature": [ "Record | undefined" ], "path": "x-pack/plugins/lens/public/types.ts", @@ -6275,7 +6452,13 @@ "text": "DatasourcePublicAPI" }, ">>, datasourceExpressionsByLayers?: Record | undefined) => string | ", { "pluginId": "expressions", @@ -6337,7 +6520,13 @@ "description": [], "signature": [ "Record | undefined" ], "path": "x-pack/plugins/lens/public/types.ts", @@ -7636,7 +7825,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }> | undefined" ], "path": "x-pack/plugins/lens/public/visualizations/xy/types.ts", @@ -8593,7 +8788,13 @@ "text": "DataLayerArgs" }, ", \"palette\"> & { type: \"dataLayer\"; layerType: \"data\"; palette: ", - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }>; table: ", { "pluginId": "expressions", @@ -8670,7 +8871,7 @@ "section": "def-public.Action", "text": "Action" }, - "[] | undefined; }" + "[] | undefined; showInspector?: boolean | undefined; }" ], "path": "x-pack/plugins/lens/public/embeddable/embeddable_component.tsx", "deprecated": false, @@ -8771,6 +8972,7 @@ "label": "HeatmapVisualizationState", "description": [], "signature": [ + "Omit<", { "pluginId": "expressionHeatmap", "scope": "common", @@ -8778,7 +8980,7 @@ "section": "def-common.HeatmapArguments", "text": "HeatmapArguments" }, - " & { layerId: string; layerType: ", + ", \"palette\"> & { layerId: string; layerType: ", { "pluginId": "lens", "scope": "common", @@ -8873,9 +9075,21 @@ "description": [], "signature": [ "{ description?: string | undefined; title: string; state: { datasourceStates: Record; visualization: unknown; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; globalPalette?: { activePaletteId: string; state?: unknown; } | undefined; filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; adHocDataViews?: Record | undefined; internalReferences?: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[] | undefined; }; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; visualizationType: string | null; }" ], "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx", @@ -9465,9 +9691,9 @@ }, " implements ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, @@ -9511,9 +9737,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -9572,9 +9798,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -9627,9 +9853,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, @@ -9656,9 +9882,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } @@ -9783,7 +10009,13 @@ "description": [], "signature": [ "{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record>; }>; }; }; visualization: VisualizationState; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; filters: ", { "pluginId": "lens", @@ -9878,9 +10110,21 @@ "text": "OperationTypePost712" }, "; }>; }>; }; }; visualization: VisualizationState; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; }" ], "path": "x-pack/plugins/lens/server/migrations/types.ts", @@ -9967,9 +10211,21 @@ "text": "OperationTypePre712" }, "; }>; }>; }; }; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; visualization: VisualizationState; filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; }" ], "path": "x-pack/plugins/lens/server/migrations/types.ts", @@ -10433,9 +10689,21 @@ "text": "OperationTypePost712" }, "; }>; }>; }; }; visualization: unknown; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; }, \"datasourceStates\"> & { datasourceStates: { indexpattern: Omit<{ currentIndexPatternId: string; layers: Record; }>; }; }; visualization: unknown; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; }, \"datasourceStates\"> & { datasourceStates: { indexpattern: Omit<{ currentIndexPatternId: string; layers: Record, \"filters\" | \"state\"> & { filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; state: Omit<{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record>; }>; }; }; visualization: VisualizationState; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; filters: ", { "pluginId": "lens", @@ -10586,9 +10878,21 @@ "text": "LensDocShape715" }, ", \"filters\" | \"state\"> & { filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; state: Omit<{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record>; }>; }; }; visualization: VisualizationState; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; filters: ", { "pluginId": "lens", @@ -10629,9 +10933,21 @@ "text": "LensDocShape715" }, ", \"filters\" | \"state\"> & { filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; state: Omit<{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record>; }>; }; }; visualization: VisualizationState; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; filters: ", { "pluginId": "lens", @@ -10672,9 +10988,21 @@ "text": "LensDocShape715" }, ", \"filters\" | \"state\"> & { filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; state: Omit<{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record>; }>; }; }; visualization: VisualizationState; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; filters: ", { "pluginId": "lens", @@ -10715,7 +11043,13 @@ "text": "LensDocShape850" }, ", \"state\"> & { state: Omit>; }>; }; }; visualization: VisualizationState; query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "; filters: ", { "pluginId": "lens", @@ -10778,13 +11112,37 @@ "description": [], "signature": [ "{ columns: { palette?: ", - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", - "CustomPaletteParams", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, "> | undefined; colorMode?: \"none\" | \"text\" | \"cell\" | undefined; }[]; } | { palette?: ", - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", - "CustomPaletteParams", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, "> | undefined; }" ], "path": "x-pack/plugins/lens/server/migrations/types.ts", @@ -11178,10 +11536,10 @@ }, { "parentPluginId": "lens", - "id": "def-common.ExistingFields", + "id": "def-common.LegacyMetricState", "type": "Interface", "tags": [], - "label": "ExistingFields", + "label": "LegacyMetricState", "description": [], "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false, @@ -11189,43 +11547,18 @@ "children": [ { "parentPluginId": "lens", - "id": "def-common.ExistingFields.indexPatternTitle", - "type": "string", - "tags": [], - "label": "indexPatternTitle", - "description": [], - "path": "x-pack/plugins/lens/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "lens", - "id": "def-common.ExistingFields.existingFieldNames", - "type": "Array", + "id": "def-common.LegacyMetricState.autoScaleMetricAlignment", + "type": "CompoundType", "tags": [], - "label": "existingFieldNames", + "label": "autoScaleMetricAlignment", "description": [], "signature": [ - "string[]" + "\"left\" | \"right\" | \"center\" | undefined" ], "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "lens", - "id": "def-common.LegacyMetricState", - "type": "Interface", - "tags": [], - "label": "LegacyMetricState", - "description": [], - "path": "x-pack/plugins/lens/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "lens", "id": "def-common.LegacyMetricState.layerId", @@ -11294,9 +11627,21 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", - "CustomPaletteParams", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, "> | undefined" ], "path": "x-pack/plugins/lens/common/types.ts", @@ -11364,7 +11709,13 @@ "text": "PersistableFilter" }, " extends ", - "Filter" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + } ], "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false, @@ -11409,7 +11760,13 @@ "text": "PersistableFilterMeta" }, " extends ", - "FilterMeta" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.FilterMeta", + "text": "FilterMeta" + } ], "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false, @@ -11486,7 +11843,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }> | undefined" ], "path": "x-pack/plugins/lens/common/types.ts", @@ -11853,7 +12216,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined) => ", { "pluginId": "fieldFormats", @@ -11884,7 +12253,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined" ], "path": "x-pack/plugins/lens/common/types.ts", diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index c7cdf0864febb..d7a8b9f74a104 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -8,20 +8,20 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github description: API docs for the lens plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](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 | |-------------------|-----------|------------------------|-----------------| -| 674 | 0 | 581 | 47 | +| 675 | 0 | 582 | 48 | ## Client diff --git a/api_docs/license_api_guard.devdocs.json b/api_docs/license_api_guard.devdocs.json index 03acec45780d4..2b91cf1351314 100644 --- a/api_docs/license_api_guard.devdocs.json +++ b/api_docs/license_api_guard.devdocs.json @@ -94,7 +94,13 @@ "description": [], "signature": [ "(handler: ", { "pluginId": "core", @@ -104,15 +110,45 @@ "text": "RequestHandler" }, ") => (ctx: Context, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", response: ", - "KibanaResponseFactory", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaResponseFactory", + "text": "KibanaResponseFactory" + }, ") => ", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, " | Promise<", - "IKibanaResponse", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, ">" ], "path": "x-pack/plugins/license_api_guard/server/license.ts", @@ -135,7 +171,13 @@ "text": "RequestHandler" }, "" ], "path": "x-pack/plugins/license_api_guard/server/license.ts", diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 4bbf39933b472..cf5621d127b73 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: 2022-10-25 +date: 2022-11-07 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 b31f55700f7be..f6ca182413099 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] --- import licenseManagementObj from './license_management.devdocs.json'; diff --git a/api_docs/licensing.devdocs.json b/api_docs/licensing.devdocs.json index df3ae7c6518ff..682c8d781850b 100644 --- a/api_docs/licensing.devdocs.json +++ b/api_docs/licensing.devdocs.json @@ -975,7 +975,13 @@ "text": "RequestHandler" }, ") => ", { "pluginId": "core", @@ -985,7 +991,13 @@ "text": "RequestHandler" }, "" ], "path": "x-pack/plugins/licensing/server/wrap_route_with_license_check.ts", @@ -1029,7 +1041,13 @@ "text": "RequestHandler" }, "" ], "path": "x-pack/plugins/licensing/server/wrap_route_with_license_check.ts", @@ -2328,7 +2346,13 @@ ], "signature": [ "(clusterClient: ", - "IClusterClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IClusterClient", + "text": "IClusterClient" + }, ", pollingFrequency: number) => { license$: ", "Observable", "<", @@ -2349,7 +2373,13 @@ "label": "clusterClient", "description": [], "signature": [ - "IClusterClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.IClusterClient", + "text": "IClusterClient" + } ], "path": "x-pack/plugins/licensing/server/types.ts", "deprecated": false, diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index ef8104ccbd7f9..75ec8cb0eef6f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/lists.devdocs.json b/api_docs/lists.devdocs.json index 6410ac3562395..ea176fe9e1bf9 100644 --- a/api_docs/lists.devdocs.json +++ b/api_docs/lists.devdocs.json @@ -18,7 +18,13 @@ "text": "Plugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "<", { "pluginId": "lists", @@ -67,7 +73,13 @@ "label": "initializerContext", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "" ], "path": "x-pack/plugins/lists/public/plugin.ts", @@ -87,7 +99,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", "StartPlugins", ", ", @@ -121,7 +139,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", "StartPlugins", ", ", @@ -166,7 +190,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", plugins: ", "StartPlugins", ") => ", @@ -190,7 +220,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "x-pack/plugins/lists/public/plugin.ts", "deprecated": false, @@ -288,7 +324,13 @@ "label": "exceptionItems", "description": [], "signature": [ - "ExceptionsBuilderReturnExceptionItem", + { + "pluginId": "@kbn/securitysolution-list-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionListUtilsPluginApi", + "section": "def-common.ExceptionsBuilderReturnExceptionItem", + "text": "ExceptionsBuilderReturnExceptionItem" + }, "[]" ], "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", @@ -303,7 +345,7 @@ "label": "exceptionsToDelete", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" ], "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", "deprecated": false, @@ -580,7 +622,7 @@ "signature": [ "({ itemId, id, namespaceType, }: ", "GetExceptionListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -658,7 +700,7 @@ "signature": [ "({ comments, description, entries, itemId, meta, name, osTypes, tags, type, }: ", "CreateEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -696,7 +738,7 @@ "signature": [ "({ _version, comments, description, entries, id, itemId, meta, name, osTypes, tags, type, }: ", "UpdateEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -734,7 +776,7 @@ "signature": [ "({ itemId, id, }: ", "GetEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -892,7 +934,7 @@ "section": "def-server.CreateExceptionListItemOptions", "text": "CreateExceptionListItemOptions" }, - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -942,7 +984,7 @@ "section": "def-server.UpdateExceptionListItemOptions", "text": "UpdateExceptionListItemOptions" }, - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -986,7 +1028,7 @@ "signature": [ "({ id, itemId, namespaceType, }: ", "DeleteExceptionListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1060,7 +1102,7 @@ "signature": [ "({ id, itemId, }: ", "DeleteEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1096,7 +1138,7 @@ "signature": [ "({ listId, filter, perPage, pit, page, search, searchAfter, sortField, sortOrder, namespaceType, }: ", "FindExceptionListItemOptions", - ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1134,7 +1176,7 @@ "signature": [ "({ listId, filter, perPage, pit, page, search, searchAfter, sortField, sortOrder, namespaceType, }: ", "FindExceptionListsItemOptions", - ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1172,7 +1214,7 @@ "signature": [ "({ perPage, pit, page, searchAfter, sortField, sortOrder, valueListId, }: ", "FindValueListExceptionListsItems", - ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1248,7 +1290,7 @@ "signature": [ "({ filter, perPage, page, pit, search, searchAfter, sortField, sortOrder, }: ", "FindEndpointListItemOptions", - ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1330,7 +1372,7 @@ "\nImport exception lists parent containers and items as stream" ], "signature": [ - "({ exceptionsToImport, maxExceptionsImportSize, overwrite, }: ", + "({ exceptionsToImport, maxExceptionsImportSize, overwrite, generateNewListId, }: ", "ImportExceptionListAndItemsOptions", ") => Promise<{ errors: ({ error: { status_code: number; message: string; }; } & { id?: string | undefined; list_id?: string | undefined; item_id?: string | undefined; })[]; success: boolean; success_count: number; success_exception_lists: boolean; success_count_exception_lists: number; success_exception_list_items: boolean; success_count_exception_list_items: number; }>" ], @@ -1343,7 +1385,7 @@ "id": "def-server.ExceptionListClient.importExceptionListAndItems.$1", "type": "Object", "tags": [], - "label": "{\n exceptionsToImport,\n maxExceptionsImportSize,\n overwrite,\n }", + "label": "{\n exceptionsToImport,\n maxExceptionsImportSize,\n overwrite,\n generateNewListId,\n }", "description": [], "signature": [ "ImportExceptionListAndItemsOptions" @@ -1409,7 +1451,13 @@ "({ namespaceType, options, }: ", "OpenPointInTimeOptions", ") => Promise<", - "SavedObjectsOpenPointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeResponse", + "text": "SavedObjectsOpenPointInTimeResponse" + }, ">" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", @@ -1449,7 +1497,13 @@ "({ pit, }: ", "ClosePointInTimeOptions", ") => Promise<", - "SavedObjectsClosePointInTimeResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClosePointInTimeResponse", + "text": "SavedObjectsClosePointInTimeResponse" + }, ">" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", @@ -2905,7 +2959,7 @@ "an array with the exception list item entries" ], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", "deprecated": false, @@ -3217,7 +3271,7 @@ "item exception entries logic" ], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"byte\" | \"float\" | \"half_float\" | \"integer\" | \"double_range\" | \"float_range\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", "deprecated": false, @@ -3805,7 +3859,13 @@ "description": [], "signature": [ "(savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", user: string, enableServerExtensionPoints?: boolean | undefined) => ", { "pluginId": "lists", @@ -3828,7 +3888,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/lists/server/types.ts", "deprecated": false, @@ -3870,7 +3936,13 @@ "description": [], "signature": [ "(esClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ", spaceId: string, user: string) => ", { "pluginId": "lists", diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index 32695ef58dabc..1c89d4594a571 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/management.devdocs.json b/api_docs/management.devdocs.json index 300c38c0b2dcd..92bdbd0a808d1 100644 --- a/api_docs/management.devdocs.json +++ b/api_docs/management.devdocs.json @@ -552,7 +552,13 @@ "label": "history", "description": [], "signature": [ - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, "" ], "path": "src/plugins/management/public/types.ts", @@ -569,7 +575,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/management/public/types.ts", diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 12f1093d614da..77f6dc753a6c1 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github description: API docs for the management plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] --- import managementObj from './management.devdocs.json'; -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/maps.devdocs.json b/api_docs/maps.devdocs.json index 2350f3b292bc0..11393b4a0aebd 100644 --- a/api_docs/maps.devdocs.json +++ b/api_docs/maps.devdocs.json @@ -494,7 +494,13 @@ "description": [], "signature": [ "() => Promise<", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]>" ], "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", @@ -512,7 +518,13 @@ "description": [], "signature": [ "() => Promise<", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined>" ], "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", @@ -827,7 +839,13 @@ "description": [], "signature": [ "() => ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", @@ -1125,7 +1143,13 @@ "description": [], "signature": [ "(filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[], actionId?: string) => Promise" ], "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", @@ -1140,7 +1164,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", @@ -1404,7 +1434,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx", @@ -1419,7 +1455,13 @@ "label": "query", "description": [], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined" ], "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx", @@ -1435,9 +1477,21 @@ "description": [], "signature": [ "{ query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined; filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; } | undefined" ], "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx", @@ -1452,7 +1506,13 @@ "label": "sourceQuery", "description": [], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined" ], "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx", @@ -1507,7 +1567,13 @@ "label": "joinKeyFilter", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, " | undefined" ], "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx", @@ -1627,7 +1693,13 @@ "description": [], "signature": [ "((filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[], actionId: string) => Promise) | null" ], "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx", @@ -2321,6 +2393,69 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "maps", + "id": "def-public.IRasterSource.hasLegendDetails", + "type": "Function", + "tags": [], + "label": "hasLegendDetails", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "x-pack/plugins/maps/public/classes/sources/raster_source/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "maps", + "id": "def-public.IRasterSource.renderLegendDetails", + "type": "Function", + "tags": [], + "label": "renderLegendDetails", + "description": [], + "signature": [ + "(dataRequest: ", + { + "pluginId": "maps", + "scope": "public", + "docId": "kibMapsPluginApi", + "section": "def-public.DataRequest", + "text": "DataRequest" + }, + " | undefined) => React.ReactElement> | null" + ], + "path": "x-pack/plugins/maps/public/classes/sources/raster_source/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "maps", + "id": "def-public.IRasterSource.renderLegendDetails.$1", + "type": "Object", + "tags": [], + "label": "dataRequest", + "description": [], + "signature": [ + { + "pluginId": "maps", + "scope": "public", + "docId": "kibMapsPluginApi", + "section": "def-public.DataRequest", + "text": "DataRequest" + }, + " | undefined" + ], + "path": "x-pack/plugins/maps/public/classes/sources/raster_source/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] } ], "initialIsOpen": false @@ -2484,7 +2619,13 @@ "description": [], "signature": [ "() => Promise<", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]>" ], "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts", @@ -3329,7 +3470,13 @@ "description": [], "signature": [ "((filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[], actionId: string) => Promise) | null" ], "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts", @@ -4392,7 +4539,13 @@ " & { id: string; indexPatternId: string; geoField?: string | undefined; applyGlobalQuery: boolean; applyGlobalTime: boolean; applyForceRefresh: boolean; } & { metrics: ", "AggDescriptor", "[]; } & { term: string; whereQuery?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined; size?: number | undefined; type: ", { "pluginId": "maps", @@ -4469,7 +4622,13 @@ " | null; type?: string | undefined; visible?: boolean | undefined; style?: ", "StyleDescriptor", " | null | undefined; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined; includeInFitToBounds?: boolean | undefined; parent?: string | undefined; }" ], "path": "x-pack/plugins/maps/common/descriptor_types/layer_descriptor_types.ts", @@ -4626,7 +4785,13 @@ "signature": [ "DataFilters", " & { applyGlobalQuery: boolean; applyGlobalTime: boolean; applyForceRefresh: boolean; fieldNames: string[]; geogridPrecision?: number | undefined; timesliceMaskField?: string | undefined; sourceQuery?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined; sourceMeta: object | null; isForceRefresh: boolean; isFeatureEditorOpenForLayer: boolean; }" ], "path": "x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts", diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 7593f6f13b58e..bba9f31907f88 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; @@ -21,7 +21,7 @@ Contact [GIS](https://github.com/orgs/elastic/teams/kibana-gis) for questions re | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 263 | 0 | 262 | 26 | +| 266 | 0 | 265 | 26 | ## Client diff --git a/api_docs/maps_ems.devdocs.json b/api_docs/maps_ems.devdocs.json index ef117f9582be4..f04f373af459e 100644 --- a/api_docs/maps_ems.devdocs.json +++ b/api_docs/maps_ems.devdocs.json @@ -434,9 +434,9 @@ }, " implements ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, @@ -463,9 +463,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, @@ -498,9 +498,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, @@ -524,9 +524,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -553,9 +553,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index ac31ad27cec25..5b9f2d0d14fca 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/ml.devdocs.json b/api_docs/ml.devdocs.json index e407bdfa53682..ec4fd079d786e 100644 --- a/api_docs/ml.devdocs.json +++ b/api_docs/ml.devdocs.json @@ -3135,9 +3135,21 @@ " & ", "ResultsServiceProvider", " & { alertingServiceProvider(savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, ", request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "): { preview: (args_0: Readonly<{} & { timeRange: string; alertParams: Readonly<{} & { severity: number; jobSelection: Readonly<{} & { groupIds: string[]; jobIds: string[]; }>; resultType: \"bucket\" | \"record\" | \"influencer\"; includeInterim: boolean; lookbackInterval: string | null; topNBuckets: number | null; }>; sampleSize: number; }>) => Promise; execute: (params: Readonly<{} & { severity: number; jobSelection: Readonly<{} & { groupIds: string[]; jobIds: string[]; }>; resultType: \"bucket\" | \"record\" | \"influencer\"; includeInterim: boolean; lookbackInterval: string | null; topNBuckets: number | null; }>) => Promise<{ context: ", "AnomalyDetectionAlertContext", "; name: string; isHealthy: boolean; } | undefined>; }; } & ", diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index a50776d2a8229..3b7700937048a 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; diff --git a/api_docs/monitoring.devdocs.json b/api_docs/monitoring.devdocs.json index 64ac00cd99ad1..cf4b2efaf9269 100644 --- a/api_docs/monitoring.devdocs.json +++ b/api_docs/monitoring.devdocs.json @@ -64,7 +64,13 @@ "description": [], "signature": [ "(esClient: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ") => void" ], "path": "x-pack/plugins/monitoring/server/types.ts", @@ -79,7 +85,13 @@ "label": "esClient", "description": [], "signature": [ - "ElasticsearchClient" + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "path": "x-pack/plugins/monitoring/server/types.ts", "deprecated": false, @@ -212,7 +224,71 @@ }, "common": { "classes": [], - "functions": [], + "functions": [ + { + "parentPluginId": "monitoring", + "id": "def-common.formatTimestampToDuration", + "type": "Function", + "tags": [], + "label": "formatTimestampToDuration", + "description": [], + "signature": [ + "(timestamp: any, calculationFlag: any, initialTime: any) => string" + ], + "path": "x-pack/plugins/monitoring/common/format_timestamp_to_duration.js", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "monitoring", + "id": "def-common.formatTimestampToDuration.$1", + "type": "Any", + "tags": [], + "label": "timestamp", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/monitoring/common/format_timestamp_to_duration.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "monitoring", + "id": "def-common.formatTimestampToDuration.$2", + "type": "Any", + "tags": [], + "label": "calculationFlag", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/monitoring/common/format_timestamp_to_duration.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "monitoring", + "id": "def-common.formatTimestampToDuration.$3", + "type": "Any", + "tags": [], + "label": "initialTime", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/monitoring/common/format_timestamp_to_duration.js", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], "interfaces": [], "enums": [], "misc": [], diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index cf12fa46ed6b4..fa74c8bd8e54f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] --- import monitoringObj from './monitoring.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitorin | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 11 | 0 | 9 | 1 | +| 15 | 3 | 13 | 1 | ## Server @@ -34,3 +34,8 @@ Contact [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitorin ### Consts, variables and types +## Common + +### Functions + + diff --git a/api_docs/monitoring_collection.devdocs.json b/api_docs/monitoring_collection.devdocs.json index 5d88c99099b56..bafd6078f836f 100644 --- a/api_docs/monitoring_collection.devdocs.json +++ b/api_docs/monitoring_collection.devdocs.json @@ -109,7 +109,13 @@ "description": [], "signature": [ "T & ", - "JsonObject" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonObject", + "text": "JsonObject" + } ], "path": "x-pack/plugins/monitoring_collection/server/plugin.ts", "deprecated": false, diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index e3aa933417662..41a8e7f94abb2 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] --- import monitoringCollectionObj from './monitoring_collection.devdocs.json'; diff --git a/api_docs/navigation.devdocs.json b/api_docs/navigation.devdocs.json index 2787dba184164..c58b1904429f4 100644 --- a/api_docs/navigation.devdocs.json +++ b/api_docs/navigation.devdocs.json @@ -18,7 +18,13 @@ "text": "NavigationPublicPlugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "<", { "pluginId": "navigation", @@ -63,7 +69,13 @@ "label": "initializerContext", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "" ], "path": "src/plugins/navigation/public/plugin.ts", @@ -83,7 +95,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ") => ", { "pluginId": "navigation", @@ -105,7 +123,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "src/plugins/navigation/public/plugin.ts", @@ -125,7 +149,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", { unifiedSearch }: ", "NavigationPluginStartDependencies", ") => ", @@ -149,7 +179,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/navigation/public/plugin.ts", "deprecated": false, @@ -673,7 +709,13 @@ "text": "UnifiedSearchPublicPluginStart" }, " | undefined; className?: string | undefined; visible?: boolean | undefined; setMenuMountPoint?: ((menuMount: ", - "MountPoint", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.MountPoint", + "text": "MountPoint" + }, " | undefined) => void) | undefined; }" ], "path": "src/plugins/navigation/public/top_nav_menu/top_nav_menu.tsx", @@ -759,7 +801,13 @@ "text": "TopNavMenuProps" }, "<", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, ">) => React.ReactElement>; AggregateQueryTopNavMenu: (props: ", { "pluginId": "navigation", @@ -769,7 +817,13 @@ "text": "TopNavMenuProps" }, "<", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, ">) => React.ReactElement>; }" ], "path": "src/plugins/navigation/public/types.ts", diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index 9ee59b29bb14e..263fe35941f02 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: 2022-10-25 +date: 2022-11-07 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 21d8ec2530ee4..de0af17106fe5 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] --- import newsfeedObj from './newsfeed.devdocs.json'; diff --git a/api_docs/notifications.devdocs.json b/api_docs/notifications.devdocs.json new file mode 100644 index 0000000000000..f7508b16dcdba --- /dev/null +++ b/api_docs/notifications.devdocs.json @@ -0,0 +1,59 @@ +{ + "id": "notifications", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [], + "start": { + "parentPluginId": "notifications", + "id": "def-server.NotificationsPluginStart", + "type": "Type", + "tags": [], + "label": "NotificationsPluginStart", + "description": [], + "signature": [ + "EmailServiceStart" + ], + "path": "x-pack/plugins/notifications/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "lifecycle": "start", + "initialIsOpen": true + } + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "notifications", + "id": "def-common.PLUGIN_ID", + "type": "string", + "tags": [], + "label": "PLUGIN_ID", + "description": [], + "signature": [ + "\"notifications\"" + ], + "path": "x-pack/plugins/notifications/common/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/notifications.mdx b/api_docs/notifications.mdx new file mode 100644 index 0000000000000..0a581931868d9 --- /dev/null +++ b/api_docs/notifications.mdx @@ -0,0 +1,35 @@ +--- +#### +#### This 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: kibNotificationsPluginApi +slug: /kibana-dev-docs/api/notifications +title: "notifications" +image: https://source.unsplash.com/400x175/?github +description: API docs for the notifications plugin +date: 2022-11-07 +tags: ['contributor', 'dev', 'apidocs', 'kibana', 'notifications'] +--- +import notificationsObj from './notifications.devdocs.json'; + + + +Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 2 | 0 | 2 | 1 | + +## Server + +### Start + + +## Common + +### Consts, variables and types + + diff --git a/api_docs/observability.devdocs.json b/api_docs/observability.devdocs.json index 17f675ec05965..ef4ea7a445c96 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -129,7 +129,7 @@ "label": "reportType", "description": [], "signature": [ - "\"data-distribution\" | \"kpi-over-time\" | \"core-web-vitals\" | \"device-data-distribution\" | \"single-metric\"" + "\"heatmap\" | \"data-distribution\" | \"kpi-over-time\" | \"core-web-vitals\" | \"device-data-distribution\" | \"single-metric\"" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", "deprecated": false, @@ -762,6 +762,41 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "observability", + "id": "def-public.LoadWhenInView", + "type": "Function", + "tags": [], + "label": "LoadWhenInView", + "description": [], + "signature": [ + "(props: ", + "LoadWhenInViewProps", + ") => JSX.Element" + ], + "path": "x-pack/plugins/observability/public/components/shared/index.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observability", + "id": "def-public.LoadWhenInView.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "LoadWhenInViewProps" + ], + "path": "x-pack/plugins/observability/public/components/shared/index.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "observability", "id": "def-public.NavigationWarningPromptProvider", @@ -1244,7 +1279,13 @@ "text": "IInspectorInfo" }, " | undefined; name: string; }) => { data: ", - "ESSearchResponse", + { + "pluginId": "@kbn/es-types", + "scope": "server", + "docId": "kibKbnEsTypesPluginApi", + "section": "def-server.ESSearchResponse", + "text": "ESSearchResponse" + }, "; loading: boolean | undefined; }" ], "path": "x-pack/plugins/observability/public/hooks/use_es_search.ts", @@ -2300,7 +2341,7 @@ "label": "reportType", "description": [], "signature": [ - "\"data-distribution\" | \"kpi-over-time\" | \"core-web-vitals\" | \"device-data-distribution\" | \"single-metric\"" + "\"heatmap\" | \"data-distribution\" | \"kpi-over-time\" | \"core-web-vitals\" | \"device-data-distribution\" | \"single-metric\"" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, @@ -3772,6 +3813,26 @@ "path": "x-pack/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-public.ObservabilityPublicPluginsStart.unifiedSearch", + "type": "Object", + "tags": [], + "label": "unifiedSearch", + "description": [], + "signature": [ + { + "pluginId": "unifiedSearch", + "scope": "public", + "docId": "kibUnifiedSearchPluginApi", + "section": "def-public.UnifiedSearchPublicPluginStart", + "text": "UnifiedSearchPublicPluginStart" + } + ], + "path": "x-pack/plugins/observability/public/plugin.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -3817,7 +3878,7 @@ "Maybe", ", { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: ", "Maybe", - ", denominator: number | undefined, fallbackResult?: string) => string; }; }) => { reason: string; link: string; }" + ", denominator: number | undefined, fallbackResult?: any) => any; }; }) => { reason: string; link: string; }" ], "path": "x-pack/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, @@ -3836,7 +3897,7 @@ "Maybe", ", { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: ", "Maybe", - ", denominator: number | undefined, fallbackResult?: string) => string; }; }" + ", denominator: number | undefined, fallbackResult?: any) => any; }; }" ], "path": "x-pack/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, @@ -4028,9 +4089,21 @@ "description": [], "signature": [ "(", - "ExistsFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ExistsFilter", + "text": "ExistsFilter" + }, " | ", - "PhraseFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.PhraseFilter", + "text": "PhraseFilter" + }, " | ", { "pluginId": "lens", @@ -4054,9 +4127,21 @@ "description": [], "signature": [ "(string | { field: string; nested?: string | undefined; singleSelection?: boolean | undefined; filters?: (", - "ExistsFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ExistsFilter", + "text": "ExistsFilter" + }, " | ", - "PhraseFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.PhraseFilter", + "text": "PhraseFilter" + }, " | ", { "pluginId": "lens", @@ -4136,7 +4221,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }> | undefined" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", @@ -4930,10 +5021,7 @@ "tags": [], "label": "METRIC_TYPE", "description": [], - "signature": [ - "METRIC_TYPE" - ], - "path": "node_modules/@types/kbn__analytics/index.d.ts", + "path": "packages/kbn-analytics/src/metrics/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5138,21 +5226,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "observability", - "id": "def-public.enableServiceGroups", - "type": "string", - "tags": [], - "label": "enableServiceGroups", - "description": [], - "signature": [ - "\"observability:enableServiceGroups\"" - ], - "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "observability", "id": "def-public.ENVIRONMENT_ALL", @@ -5347,7 +5420,7 @@ "Maybe", ", { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: ", "Maybe", - ", denominator: number | undefined, fallbackResult?: string) => string; }; }) => { reason: string; link: string; }" + ", denominator: number | undefined, fallbackResult?: any) => any; }; }) => { reason: string; link: string; }" ], "path": "x-pack/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, @@ -5366,7 +5439,7 @@ "Maybe", ", { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: ", "Maybe", - ", denominator: number | undefined, fallbackResult?: string) => string; }; }" + ", denominator: number | undefined, fallbackResult?: any) => any; }; }" ], "path": "x-pack/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, @@ -5831,9 +5904,21 @@ " | undefined; runtime?: ", "MappingRuntimeFields", " | undefined; }; client: ", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, "; logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, "; }) => Promise" ], "path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts", @@ -7103,7 +7188,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts", "deprecated": false, @@ -7136,7 +7227,13 @@ "text": "RequestStatus" }, "; esResponse: any; kibanaRequest: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "; operationName: string; startTime: number; }) => ", { "pluginId": "inspector", @@ -7232,7 +7329,13 @@ "label": "kibanaRequest", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/observability/common/utils/get_inspect_response.ts", @@ -7375,7 +7478,7 @@ "label": "termQuery", "description": [], "signature": [ - "(field: T, value: string | number | boolean | null | undefined) => ", + "(field: T, value: string | number | boolean | null | undefined, opts: TermQueryOpts) => ", "QueryDslQueryContainer", "[]" ], @@ -7412,6 +7515,21 @@ "deprecated": false, "trackAdoption": false, "isRequired": false + }, + { + "parentPluginId": "observability", + "id": "def-server.termQuery.$3", + "type": "Object", + "tags": [], + "label": "opts", + "description": [], + "signature": [ + "TermQueryOpts" + ], + "path": "x-pack/plugins/observability/server/utils/queries.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true } ], "returnComment": [], @@ -7551,17 +7669,17 @@ "signature": [ "{ start: () => Promise<", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, ">; setup: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -7619,7 +7737,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/observability/server/routes/types.ts", @@ -7634,7 +7758,13 @@ "label": "context", "description": [], "signature": [ - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, " & { licensing: Promise<", { "pluginId": "licensing", @@ -7652,7 +7782,13 @@ "text": "AlertingApiRequestHandlerContext" }, ">; core: Promise<", - "CoreRequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.CoreRequestHandlerContext", + "text": "CoreRequestHandlerContext" + }, ">; }" ], "path": "x-pack/plugins/observability/server/routes/types.ts", @@ -7667,7 +7803,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/plugins/observability/server/routes/types.ts", "deprecated": false, @@ -7688,9 +7830,21 @@ "description": [], "signature": [ "{ [x: string]: ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, ">; }" ], "path": "x-pack/plugins/observability/server/routes/types.ts", @@ -7741,7 +7895,13 @@ "description": [], "signature": [ "{ \"DELETE /api/observability/slos/{id}\"?: ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"DELETE /api/observability/slos/{id}\", ", "TypeC", "<{ path: ", @@ -7765,7 +7925,13 @@ "text": "ObservabilityRouteCreateOptions" }, "> | undefined; \"GET /api/observability/slos/{id}\"?: ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /api/observability/slos/{id}\", ", "TypeC", "<{ path: ", @@ -7789,7 +7955,13 @@ "text": "ObservabilityRouteCreateOptions" }, "> | undefined; \"PUT /api/observability/slos/{id}\"?: ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"PUT /api/observability/slos/{id}\", ", "TypeC", "<{ path: ", @@ -7953,7 +8125,13 @@ "text": "ObservabilityRouteCreateOptions" }, "> | undefined; \"POST /api/observability/slos\"?: ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /api/observability/slos\", ", "TypeC", "<{ body: ", @@ -8113,7 +8291,13 @@ "text": "ObservabilityRouteCreateOptions" }, "> | undefined; \"GET /api/observability/rules/alerts/dynamic_index_pattern\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /api/observability/rules/alerts/dynamic_index_pattern\", ", "TypeC", "<{ query: ", @@ -8141,7 +8325,13 @@ "text": "ObservabilityRouteCreateOptions" }, ">; }[TEndpoint] extends ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, " ? TReturnType : never" @@ -8175,7 +8365,13 @@ "description": [], "signature": [ "{ \"DELETE /api/observability/slos/{id}\"?: ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"DELETE /api/observability/slos/{id}\", ", "TypeC", "<{ path: ", @@ -8199,7 +8395,13 @@ "text": "ObservabilityRouteCreateOptions" }, "> | undefined; \"GET /api/observability/slos/{id}\"?: ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /api/observability/slos/{id}\", ", "TypeC", "<{ path: ", @@ -8223,7 +8425,13 @@ "text": "ObservabilityRouteCreateOptions" }, "> | undefined; \"PUT /api/observability/slos/{id}\"?: ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"PUT /api/observability/slos/{id}\", ", "TypeC", "<{ path: ", @@ -8387,7 +8595,13 @@ "text": "ObservabilityRouteCreateOptions" }, "> | undefined; \"POST /api/observability/slos\"?: ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"POST /api/observability/slos\", ", "TypeC", "<{ body: ", @@ -8547,7 +8761,13 @@ "text": "ObservabilityRouteCreateOptions" }, "> | undefined; \"GET /api/observability/rules/alerts/dynamic_index_pattern\": ", - "ServerRoute", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, "<\"GET /api/observability/rules/alerts/dynamic_index_pattern\", ", "TypeC", "<{ query: ", @@ -8645,10 +8865,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.enableNewSyntheticsView.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -8670,10 +8893,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.enableNewSyntheticsView.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -8686,7 +8912,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -8737,10 +8969,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.enableInspectEsQueries.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -8762,10 +8997,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.enableInspectEsQueries.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -8778,7 +9016,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -8829,10 +9073,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.maxSuggestions.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -8851,10 +9098,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.maxSuggestions.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -8867,7 +9117,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -8904,10 +9160,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.enableComparisonByDefault.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -8929,10 +9188,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.enableComparisonByDefault.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -8945,7 +9207,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -8996,10 +9264,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.defaultApmServiceEnvironment.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9007,10 +9278,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.defaultApmServiceEnvironment.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9034,7 +9308,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -9071,10 +9351,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmProgressiveLoading.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9082,10 +9365,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmProgressiveLoading.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9118,7 +9404,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "<", { "pluginId": "observability", @@ -9196,10 +9488,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmProgressiveLoading.optionLabels.ProgressiveLoadingQuality.off", - "type": "string", + "type": "Any", "tags": [], "label": "[ProgressiveLoadingQuality.off]", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9207,10 +9502,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmProgressiveLoading.optionLabels.ProgressiveLoadingQuality.low", - "type": "string", + "type": "Any", "tags": [], "label": "[ProgressiveLoadingQuality.low]", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9218,10 +9516,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmProgressiveLoading.optionLabels.ProgressiveLoadingQuality.medium", - "type": "string", + "type": "Any", "tags": [], "label": "[ProgressiveLoadingQuality.medium]", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9229,10 +9530,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmProgressiveLoading.optionLabels.ProgressiveLoadingQuality.high", - "type": "string", + "type": "Any", "tags": [], "label": "[ProgressiveLoadingQuality.high]", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9257,10 +9561,10 @@ }, { "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceGroups", + "id": "def-server.uiSettings.enableServiceMetrics", "type": "Object", "tags": [], - "label": "[enableServiceGroups]", + "label": "[enableServiceMetrics]", "description": [], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, @@ -9268,7 +9572,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceGroups.category", + "id": "def-server.uiSettings.enableServiceMetrics.category", "type": "Array", "tags": [], "label": "category", @@ -9282,18 +9586,21 @@ }, { "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceGroups.name", - "type": "string", + "id": "def-server.uiSettings.enableServiceMetrics.name", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceGroups.value", + "id": "def-server.uiSettings.enableServiceMetrics.value", "type": "boolean", "tags": [], "label": "value", @@ -9307,24 +9614,33 @@ }, { "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceGroups.description", - "type": "string", + "id": "def-server.uiSettings.enableServiceMetrics.description", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceGroups.schema", + "id": "def-server.uiSettings.enableServiceMetrics.schema", "type": "Object", "tags": [], "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -9333,7 +9649,7 @@ }, { "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceGroups.requiresPageReload", + "id": "def-server.uiSettings.enableServiceMetrics.requiresPageReload", "type": "boolean", "tags": [], "label": "requiresPageReload", @@ -9347,7 +9663,7 @@ }, { "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceGroups.showInLabs", + "id": "def-server.uiSettings.enableServiceMetrics.showInLabs", "type": "boolean", "tags": [], "label": "showInLabs", @@ -9363,113 +9679,7 @@ }, { "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceMetrics", - "type": "Object", - "tags": [], - "label": "[enableServiceMetrics]", - "description": [], - "path": "x-pack/plugins/observability/server/ui_settings.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceMetrics.category", - "type": "Array", - "tags": [], - "label": "category", - "description": [], - "signature": [ - "string[]" - ], - "path": "x-pack/plugins/observability/server/ui_settings.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceMetrics.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "x-pack/plugins/observability/server/ui_settings.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceMetrics.value", - "type": "boolean", - "tags": [], - "label": "value", - "description": [], - "signature": [ - "false" - ], - "path": "x-pack/plugins/observability/server/ui_settings.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceMetrics.description", - "type": "string", - "tags": [], - "label": "description", - "description": [], - "path": "x-pack/plugins/observability/server/ui_settings.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceMetrics.schema", - "type": "Object", - "tags": [], - "label": "schema", - "description": [], - "signature": [ - "Type", - "" - ], - "path": "x-pack/plugins/observability/server/ui_settings.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceMetrics.requiresPageReload", - "type": "boolean", - "tags": [], - "label": "requiresPageReload", - "description": [], - "signature": [ - "true" - ], - "path": "x-pack/plugins/observability/server/ui_settings.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "observability", - "id": "def-server.uiSettings.enableServiceMetrics.showInLabs", - "type": "boolean", - "tags": [], - "label": "showInLabs", - "description": [], - "signature": [ - "true" - ], - "path": "x-pack/plugins/observability/server/ui_settings.ts", - "deprecated": false, - "trackAdoption": false - } - ] - }, - { - "parentPluginId": "observability", - "id": "def-server.uiSettings.apmServiceInventoryOptimizedSorting", + "id": "def-server.uiSettings.apmServiceInventoryOptimizedSorting", "type": "Object", "tags": [], "label": "[apmServiceInventoryOptimizedSorting]", @@ -9495,10 +9705,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmServiceInventoryOptimizedSorting.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9506,10 +9719,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmServiceInventoryOptimizedSorting.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9522,7 +9738,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -9615,10 +9837,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmServiceGroupMaxNumberOfServices.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9637,10 +9862,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmServiceGroupMaxNumberOfServices.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9653,7 +9881,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -9690,10 +9924,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmTraceExplorerTab.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9701,10 +9938,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmTraceExplorerTab.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9717,7 +9957,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -9810,10 +10056,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmOperationsTab.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9821,10 +10070,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmOperationsTab.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9837,7 +10089,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -9930,10 +10188,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmLabsButton.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9941,10 +10202,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.apmLabsButton.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -9957,7 +10221,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -10036,10 +10306,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.enableInfrastructureHostsView.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -10061,10 +10334,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.enableInfrastructureHostsView.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -10077,7 +10353,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -10114,10 +10396,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.enableAwsLambdaMetrics.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -10125,10 +10410,13 @@ { "parentPluginId": "observability", "id": "def-server.uiSettings.enableAwsLambdaMetrics.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false @@ -10141,7 +10429,13 @@ "label": "schema", "description": [], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/observability/server/ui_settings.ts", @@ -10205,6 +10499,328 @@ "trackAdoption": false } ] + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor", + "type": "Object", + "tags": [], + "label": "[apmAWSLambdaPriceFactor]", + "description": [], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.category", + "type": "Array", + "tags": [], + "label": "category", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.name", + "type": "Any", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"json\"" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.value", + "type": "string", + "tags": [], + "label": "value", + "description": [], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.description", + "type": "Any", + "tags": [], + "label": "description", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.schema", + "type": "Object", + "tags": [], + "label": "schema", + "description": [], + "signature": [ + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, + "<{ arm: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "; x86_64: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "; }>" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaRequestCostPerMillion", + "type": "Object", + "tags": [], + "label": "[apmAWSLambdaRequestCostPerMillion]", + "description": [], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaRequestCostPerMillion.category", + "type": "Array", + "tags": [], + "label": "category", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaRequestCostPerMillion.name", + "type": "Any", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaRequestCostPerMillion.value", + "type": "number", + "tags": [], + "label": "value", + "description": [], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaRequestCostPerMillion.schema", + "type": "Object", + "tags": [], + "label": "schema", + "description": [], + "signature": [ + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.enableCriticalPath", + "type": "Object", + "tags": [], + "label": "[enableCriticalPath]", + "description": [], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.enableCriticalPath.category", + "type": "Array", + "tags": [], + "label": "category", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.enableCriticalPath.name", + "type": "Any", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.enableCriticalPath.description", + "type": "Any", + "tags": [], + "label": "description", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.enableCriticalPath.schema", + "type": "Object", + "tags": [], + "label": "schema", + "description": [], + "signature": [ + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.enableCriticalPath.value", + "type": "boolean", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "false" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.enableCriticalPath.requiresPageReload", + "type": "boolean", + "tags": [], + "label": "requiresPageReload", + "description": [], + "signature": [ + "true" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.enableCriticalPath.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"boolean\"" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.enableCriticalPath.showInLabs", + "type": "boolean", + "tags": [], + "label": "showInLabs", + "description": [], + "signature": [ + "true" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + } + ] } ], "initialIsOpen": false @@ -10218,8 +10834,14 @@ "label": "ObservabilityPluginSetup", "description": [], "signature": [ - "{ getScopedAnnotationsClient: (requestContext: ", - "RequestHandlerContext", + "{ getAlertDetailsConfig(): Readonly<{} & { apm: Readonly<{} & { enabled: boolean; }>; metrics: Readonly<{} & { enabled: boolean; }>; logs: Readonly<{} & { enabled: boolean; }>; uptime: Readonly<{} & { enabled: boolean; }>; }>; getScopedAnnotationsClient: (requestContext: ", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, " & { licensing: Promise<", { "pluginId": "licensing", @@ -10229,7 +10851,13 @@ "text": "LicensingApiRequestHandlerContext" }, ">; }, request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise<{ readonly index: string; create: (createParams: { annotation: { type: string; }; '@timestamp': string; message: string; } & { tags?: string[] | undefined; service?: { name?: string | undefined; environment?: string | undefined; version?: string | undefined; } | undefined; }) => Promise<{ _id: string; _index: string; _source: ", "Annotation", "; }>; getById: (getByIdParams: { id: string; }) => Promise<", @@ -10386,6 +11014,36 @@ } ], "misc": [ + { + "parentPluginId": "observability", + "id": "def-common.apmAWSLambdaPriceFactor", + "type": "string", + "tags": [], + "label": "apmAWSLambdaPriceFactor", + "description": [], + "signature": [ + "\"observability:apmAWSLambdaPriceFactor\"" + ], + "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "observability", + "id": "def-common.apmAWSLambdaRequestCostPerMillion", + "type": "string", + "tags": [], + "label": "apmAWSLambdaRequestCostPerMillion", + "description": [], + "signature": [ + "\"observability:apmAWSLambdaRequestCostPerMillion\"" + ], + "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "observability", "id": "def-common.apmLabsButton", @@ -10534,7 +11192,7 @@ "signature": [ "(numerator: ", "Maybe", - ", denominator: number | undefined, fallbackResult?: string) => string" + ", denominator: number | undefined, fallbackResult?: any) => any" ], "path": "x-pack/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, @@ -10572,10 +11230,13 @@ { "parentPluginId": "observability", "id": "def-common.AsPercent.$3", - "type": "string", + "type": "Any", "tags": [], "label": "fallbackResult", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false @@ -10660,13 +11321,13 @@ }, { "parentPluginId": "observability", - "id": "def-common.enableInfrastructureHostsView", + "id": "def-common.enableCriticalPath", "type": "string", "tags": [], - "label": "enableInfrastructureHostsView", + "label": "enableCriticalPath", "description": [], "signature": [ - "\"observability:enableInfrastructureHostsView\"" + "\"observability:apmEnableCriticalPath\"" ], "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, @@ -10675,13 +11336,13 @@ }, { "parentPluginId": "observability", - "id": "def-common.enableInspectEsQueries", + "id": "def-common.enableInfrastructureHostsView", "type": "string", "tags": [], - "label": "enableInspectEsQueries", + "label": "enableInfrastructureHostsView", "description": [], "signature": [ - "\"observability:enableInspectEsQueries\"" + "\"observability:enableInfrastructureHostsView\"" ], "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, @@ -10690,13 +11351,13 @@ }, { "parentPluginId": "observability", - "id": "def-common.enableNewSyntheticsView", + "id": "def-common.enableInspectEsQueries", "type": "string", "tags": [], - "label": "enableNewSyntheticsView", + "label": "enableInspectEsQueries", "description": [], "signature": [ - "\"observability:enableNewSyntheticsView\"" + "\"observability:enableInspectEsQueries\"" ], "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, @@ -10705,13 +11366,13 @@ }, { "parentPluginId": "observability", - "id": "def-common.enableServiceGroups", + "id": "def-common.enableNewSyntheticsView", "type": "string", "tags": [], - "label": "enableServiceGroups", + "label": "enableNewSyntheticsView", "description": [], "signature": [ - "\"observability:enableServiceGroups\"" + "\"observability:enableNewSyntheticsView\"" ], "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index a711fde1e932e..7180c3001a8f6 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Observability UI](https://github.com/orgs/elastic/teams/observability-u | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 540 | 2 | 536 | 31 | +| 558 | 40 | 555 | 32 | ## Client diff --git a/api_docs/osquery.devdocs.json b/api_docs/osquery.devdocs.json index 635153c4153e9..2b441fc69b891 100644 --- a/api_docs/osquery.devdocs.json +++ b/api_docs/osquery.devdocs.json @@ -42,7 +42,9 @@ "signature": [ "((props: ", "OsqueryActionProps", - ") => JSX.Element) | undefined" + " & { ecsData?: ", + "AlertEcsData", + " | undefined; }) => JSX.Element) | undefined" ], "path": "x-pack/plugins/osquery/public/types.ts", "deprecated": false, diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index 806bbf96dc01f..e6b9ad08c68cc 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] --- import osqueryObj from './osquery.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Security asset management](https://github.com/orgs/elastic/teams/securi | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 21 | 0 | 21 | 3 | +| 21 | 0 | 21 | 4 | ## Client diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index 3668c19af7342..10ea43f935f28 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -15,28 +15,28 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 497 | 412 | 38 | +| 508 | 426 | 38 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 32671 | 179 | 21959 | 1033 | +| 33254 | 515 | 23582 | 1106 | ## Plugin Directory | Plugin name           | Maintaining team | Description | API Cnt | Any Cnt | Missing
comments | Missing
exports | |--------------|----------------|-----------|--------------|----------|---------------|--------| -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 214 | 0 | 209 | 23 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 225 | 8 | 220 | 24 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 36 | 1 | 32 | 2 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | AIOps plugin maintained by ML team. | 9 | 0 | 0 | 2 | -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 382 | 0 | 373 | 24 | -| | [APM UI](https://github.com/orgs/elastic/teams/apm-ui) | The user interface for Elastic APM | 38 | 0 | 38 | 53 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 379 | 0 | 370 | 26 | +| | [APM UI](https://github.com/orgs/elastic/teams/apm-ui) | The user interface for Elastic APM | 41 | 0 | 41 | 58 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back. | 81 | 1 | 72 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 | -| | [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 87 | 0 | 70 | 28 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 264 | 2 | 249 | 9 | +| | [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 87 | 0 | 71 | 28 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 264 | 16 | 249 | 9 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 39 | 0 | 11 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | Chat available on Elastic Cloud deployments for quicker assistance. | 1 | 0 | 0 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/@elastic/kibana-core) | Provides the necessary APIs to implement A/B testing scenarios, fetching the variations in configuration and reporting back metrics to track conversion rates of the experiments. | 12 | 0 | 0 | 0 | @@ -45,53 +45,53 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | cloudLinks | [Kibana Core](https://github.com/orgs/elastic/teams/@kibana-core) | Adds the links to the Elastic Cloud console | 0 | 0 | 0 | 0 | | | [Cloud Security Posture](https://github.com/orgs/elastic/teams/cloud-posture-security) | The cloud security posture plugin | 18 | 0 | 2 | 3 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 | -| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Controls Plugin contains embeddable components intended to create a simple query interface for end users, and a powerful editing suite that allows dashboard authors to build controls | 229 | 0 | 220 | 7 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2697 | 0 | 23 | 0 | +| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Controls Plugin contains embeddable components intended to create a simple query interface for end users, and a powerful editing suite that allows dashboard authors to build controls | 237 | 0 | 228 | 7 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2704 | 17 | 1202 | 0 | | crossClusterReplication | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 107 | 0 | 88 | 1 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 121 | 0 | 114 | 3 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 52 | 0 | 51 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3251 | 33 | 2523 | 24 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3261 | 119 | 2553 | 27 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | This plugin provides the ability to create data views via a modal flyout inside Kibana apps | 16 | 0 | 7 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Reusable data view field editor across Kibana | 60 | 0 | 30 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data view management app | 2 | 0 | 2 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 1021 | 0 | 229 | 2 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 1021 | 0 | 228 | 2 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 28 | 3 | 24 | 1 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 10 | 0 | 8 | 2 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 97 | 0 | 80 | 4 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 35 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 510 | 0 | 410 | 4 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 510 | 6 | 410 | 4 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends embeddable plugin with more functionality | 14 | 0 | 14 | 0 | -| | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 51 | 0 | 42 | 0 | +| | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 51 | 0 | 44 | 0 | | | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 9 | 0 | 9 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 114 | 3 | 110 | 5 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | The Event Annotation service contains expressions for event annotations | 174 | 0 | 174 | 3 | -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 106 | 0 | 106 | 10 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | The Event Annotation service contains expressions for event annotations | 174 | 31 | 174 | 3 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 115 | 0 | 115 | 11 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'error' renderer to expressions | 17 | 0 | 15 | 2 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. | 58 | 0 | 58 | 2 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. | 107 | 0 | 103 | 3 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. | 58 | 0 | 58 | 2 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. | 111 | 14 | 107 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'image' function and renderer to expressions | 26 | 0 | 26 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Adds a `metric` renderer and function to the expression plugin. The renderer will display the `legacy metric` chart. | 49 | 0 | 49 | 1 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Adds a `metric` renderer and function to the expression plugin. The renderer will display the `legacy metric` chart. | 51 | 0 | 51 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'metric' function and renderer to expressions | 32 | 0 | 27 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Adds a `metric` renderer and function to the expression plugin. The renderer will display the `metric` chart. | 62 | 0 | 62 | 1 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Partition Visualization plugin adds a `partitionVis` renderer and `pieVis`, `mosaicVis`, `treemapVis`, `waffleVis` functions to the expression plugin. The renderer will display the `pie`, `waffle`, `treemap` and `mosaic` charts. | 70 | 0 | 70 | 2 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Adds a `metric` renderer and function to the expression plugin. The renderer will display the `metric` chart. | 63 | 0 | 63 | 2 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression Partition Visualization plugin adds a `partitionVis` renderer and `pieVis`, `mosaicVis`, `treemapVis`, `waffleVis` functions to the expression plugin. The renderer will display the `pie`, `waffle`, `treemap` and `mosaic` charts. | 71 | 0 | 71 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'repeatImage' function and renderer to expressions | 32 | 0 | 32 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'revealImage' function and renderer to expressions | 14 | 0 | 14 | 3 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'shape' function and renderer to expressions | 148 | 0 | 146 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart. | 7 | 0 | 7 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart. | 159 | 0 | 149 | 9 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds expression runtime to Kibana | 2191 | 17 | 1734 | 5 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 222 | 0 | 95 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 288 | 5 | 249 | 3 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart. | 7 | 0 | 7 | 0 | +| | [Vis Editors](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. | 159 | 0 | 149 | 9 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds expression runtime to Kibana | 2198 | 74 | 1739 | 5 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 227 | 0 | 96 | 2 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 288 | 26 | 249 | 3 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | 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. | 62 | 0 | 62 | 2 | -| | [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/team:AppServicesUx) | File upload, download, sharing, and serving over HTTP implementation in Kibana. | 272 | 0 | 18 | 2 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 996 | 3 | 893 | 17 | +| | [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/team:AppServicesUx) | File upload, download, sharing, and serving over HTTP implementation in Kibana. | 276 | 0 | 19 | 3 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1001 | 3 | 898 | 18 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 68 | 0 | 14 | 5 | | globalSearchBar | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | globalSearchProviders | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | graph | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 0 | 0 | 0 | 0 | | grokdebugger | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | -| | [Journey Onboarding](https://github.com/orgs/elastic/teams/platform-onboarding) | Guided onboarding framework | 36 | 0 | 36 | 1 | +| | [Journey Onboarding](https://github.com/orgs/elastic/teams/platform-onboarding) | Guided onboarding framework | 37 | 0 | 37 | 1 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 143 | 0 | 104 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 4 | 0 | 4 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 177 | 0 | 172 | 3 | @@ -101,33 +101,34 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 123 | 2 | 96 | 4 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides UI and APIs for the interactive setup mode. | 28 | 0 | 18 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 6 | 0 | 6 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 184 | 0 | 151 | 5 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 184 | 1 | 151 | 5 | | kibanaUsageCollection | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 0 | 0 | 0 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 615 | 3 | 418 | 9 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 615 | 3 | 420 | 9 | | | [Security Team](https://github.com/orgs/elastic/teams/security-team) | - | 3 | 0 | 3 | 1 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 674 | 0 | 581 | 47 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 675 | 0 | 582 | 48 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 8 | 0 | 8 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 3 | 0 | 3 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 117 | 0 | 42 | 10 | | | [Security detections response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 204 | 0 | 92 | 50 | | logstash | [Logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 41 | 0 | 41 | 6 | -| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 263 | 0 | 262 | 26 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 41 | 0 | 41 | 6 | +| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 266 | 0 | 265 | 26 | | | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 67 | 0 | 67 | 0 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 254 | 9 | 78 | 39 | -| | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 11 | 0 | 9 | 1 | +| | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 15 | 3 | 13 | 1 | | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 34 | 0 | 34 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | -| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 540 | 2 | 536 | 31 | -| | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 21 | 0 | 21 | 3 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 2 | 0 | 2 | 1 | +| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 558 | 40 | 555 | 32 | +| | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 21 | 0 | 21 | 4 | | painlessLab | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | -| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 243 | 2 | 187 | 12 | -| | [profiling](https://github.com/orgs/elastic/teams/profiling-ui) | - | 14 | 1 | 14 | 0 | +| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 243 | 8 | 187 | 12 | +| | [profiling](https://github.com/orgs/elastic/teams/profiling-ui) | - | 14 | 2 | 14 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 4 | 0 | 4 | 0 | | | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Reporting Services enables applications to feature reports that the user can automate with Watcher and download later. | 36 | 0 | 16 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 21 | 0 | 21 | 0 | -| | [RAC](https://github.com/orgs/elastic/teams/rac) | - | 230 | 0 | 202 | 10 | +| | [RAC](https://github.com/orgs/elastic/teams/rac) | - | 232 | 0 | 204 | 10 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 24 | 0 | 19 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 193 | 2 | 152 | 5 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 16 | 0 | 16 | 0 | @@ -156,31 +157,31 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 457 | 1 | 348 | 32 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the transforms features provided by Elastic. Transforms enable you to convert existing Elasticsearch indices into summarized indices, which provide opportunities for new insights and analytics. | 4 | 0 | 4 | 1 | | translations | [Kibana Localization](https://github.com/orgs/elastic/teams/kibana-localization) | - | 0 | 0 | 0 | 0 | -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 518 | 1 | 489 | 49 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds UI Actions service to Kibana | 133 | 0 | 92 | 11 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 518 | 11 | 489 | 49 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds UI Actions service to Kibana | 133 | 2 | 92 | 11 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends UI Actions plugin with more functionality | 206 | 0 | 142 | 9 | -| | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Contains functionality for the field list which can be integrated into apps | 122 | 0 | 117 | 2 | +| | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Contains functionality for the field list which can be integrated into apps | 192 | 0 | 187 | 4 | | | [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. | 56 | 0 | 29 | 0 | | | [Unified Search](https://github.com/orgs/elastic/teams/kibana-app-services) | Contains all the key functionality of Kibana's unified search experience.Contains all the key functionality of Kibana's unified search experience. | 131 | 2 | 104 | 18 | | upgradeAssistant | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | urlDrilldown | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds drilldown implementations to Kibana | 0 | 0 | 0 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 12 | 0 | 12 | 0 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 12 | 0 | 12 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 58 | 0 | 15 | 1 | | | [Uptime](https://github.com/orgs/elastic/teams/uptime) | - | 2 | 0 | 2 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | The default editor used in most aggregation-based visualizations. | 59 | 0 | 52 | 3 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | 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 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | 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 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | The default editor used in most aggregation-based visualizations. | 59 | 0 | 52 | 3 | +| | [Vis Editors](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 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the heatmap implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy heatmap charts library advanced setting. | 3 | 0 | 3 | 2 | | visTypeMarkdown | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds a markdown visualization type | 0 | 0 | 0 | 0 | -| visTypeMetric | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the Metric aggregation-based visualization. | 0 | 0 | 0 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the pie 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. | 12 | 0 | 12 | 1 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the datatable aggregation-based visualization. | 12 | 0 | 12 | 0 | -| visTypeTagcloud | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the tagcloud visualization. It is based on elastic-charts wordcloud. | 0 | 0 | 0 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the timelion visualization. Also contains the backend for both timelion app and timelion visualization. | 2 | 0 | 2 | 2 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the TSVB visualization. TSVB has its one editor, works with index patterns and index strings and contains 6 types of charts: timeseries, topN, table. markdown, metric and gauge. | 10 | 1 | 10 | 3 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the vega visualization. Is the elastic version of vega and vega-lite libraries. | 2 | 0 | 2 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and heatmap charts. We want to replace them with elastic-charts. | 26 | 0 | 25 | 1 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | 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. | 53 | 0 | 50 | 5 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 759 | 12 | 729 | 18 | +| visTypeMetric | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Registers the Metric aggregation-based visualization. | 0 | 0 | 0 | 0 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the pie 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. | 12 | 0 | 12 | 1 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Registers the datatable aggregation-based visualization. | 12 | 0 | 12 | 0 | +| visTypeTagcloud | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Registers the tagcloud visualization. It is based on elastic-charts wordcloud. | 0 | 0 | 0 | 0 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Registers the timelion visualization. Also contains the backend for both timelion app and timelion visualization. | 2 | 0 | 2 | 2 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Registers the TSVB visualization. TSVB has its one editor, works with index patterns and index strings and contains 6 types of charts: timeseries, topN, table. markdown, metric and gauge. | 10 | 1 | 10 | 3 | +| | [Vis Editors](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 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and heatmap charts. We want to replace them with elastic-charts. | 26 | 0 | 25 | 1 | +| | [Vis Editors](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. | 53 | 0 | 50 | 5 | +| | [Vis Editors](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. | 796 | 12 | 766 | 18 | | watcher | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | ## Package Directory @@ -198,8 +199,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 18 | 0 | 0 | 0 | | | Kibana Core | - | 20 | 0 | 0 | 0 | | | Kibana Core | - | 17 | 0 | 2 | 0 | -| | [Owner missing] | - | 16 | 0 | 16 | 0 | -| | [Owner missing] | Elastic APM trace data generator | 74 | 0 | 74 | 13 | +| | [Owner missing] | - | 17 | 0 | 17 | 0 | +| | [Owner missing] | Elastic APM trace data generator | 76 | 0 | 76 | 13 | | | [Owner missing] | - | 11 | 0 | 11 | 0 | | | [Owner missing] | - | 10 | 0 | 10 | 0 | | | [Owner missing] | - | 4 | 0 | 3 | 0 | @@ -209,10 +210,10 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | - | 62 | 0 | 17 | 1 | | | [Owner missing] | - | 2 | 0 | 2 | 0 | | | [Owner missing] | - | 106 | 0 | 80 | 1 | -| | Kibana Core | - | 73 | 0 | 44 | 1 | +| | Kibana Core | - | 73 | 0 | 44 | 8 | | | Kibana Core | - | 24 | 0 | 24 | 0 | | | Kibana Core | - | 129 | 3 | 127 | 17 | -| | [Owner missing] | - | 12 | 0 | 10 | 4 | +| | [Owner missing] | - | 20 | 0 | 13 | 4 | | | Kibana Core | - | 2 | 0 | 0 | 0 | | | Kibana Core | - | 7 | 0 | 7 | 1 | | | Kibana Core | - | 4 | 0 | 4 | 0 | @@ -220,20 +221,21 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 7 | 0 | 7 | 0 | | | Kibana Core | - | 5 | 0 | 5 | 0 | | | Kibana Core | - | 103 | 0 | 27 | 0 | -| | Kibana Core | - | 18 | 0 | 15 | 1 | +| | Kibana Core | - | 18 | 0 | 15 | 3 | | | Kibana Core | - | 12 | 0 | 12 | 0 | | | Kibana Core | - | 8 | 0 | 1 | 0 | | | Kibana Core | - | 20 | 0 | 19 | 0 | | | Kibana Core | - | 2 | 0 | 2 | 0 | +| | Kibana Core | - | 8 | 0 | 8 | 1 | | | Kibana Core | - | 3 | 0 | 3 | 0 | | | Kibana Core | - | 12 | 0 | 3 | 0 | -| | Kibana Core | - | 7 | 0 | 7 | 0 | +| | Kibana Core | - | 7 | 0 | 7 | 2 | | | Kibana Core | - | 3 | 0 | 3 | 0 | | | Kibana Core | - | 3 | 0 | 3 | 0 | | | Kibana Core | - | 5 | 0 | 0 | 0 | | | Kibana Core | - | 16 | 0 | 7 | 0 | | | Kibana Core | - | 6 | 0 | 6 | 0 | -| | Kibana Core | - | 114 | 0 | 41 | 0 | +| | Kibana Core | - | 119 | 0 | 46 | 0 | | | Kibana Core | - | 3 | 0 | 3 | 0 | | | Kibana Core | - | 4 | 0 | 4 | 0 | | | Kibana Core | - | 9 | 0 | 3 | 0 | @@ -247,15 +249,15 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 4 | 0 | 4 | 0 | | | Kibana Core | - | 5 | 0 | 2 | 0 | | | Kibana Core | - | 4 | 0 | 4 | 0 | -| | Kibana Core | - | 15 | 0 | 13 | 2 | +| | Kibana Core | - | 16 | 0 | 14 | 1 | | | Kibana Core | - | 38 | 1 | 34 | 0 | | | Kibana Core | - | 103 | 0 | 53 | 0 | -| | Kibana Core | - | 33 | 0 | 29 | 0 | +| | Kibana Core | - | 37 | 0 | 33 | 3 | | | Kibana Core | - | 15 | 1 | 15 | 0 | -| | Kibana Core | - | 4 | 0 | 4 | 0 | +| | Kibana Core | - | 4 | 0 | 4 | 1 | | | Kibana Core | - | 4 | 0 | 4 | 0 | | | Kibana Core | - | 10 | 0 | 2 | 1 | -| | Kibana Core | - | 6 | 0 | 6 | 1 | +| | Kibana Core | - | 6 | 0 | 6 | 2 | | | Kibana Core | - | 6 | 0 | 6 | 0 | | | Kibana Core | - | 1 | 0 | 1 | 0 | | | Kibana Core | - | 9 | 0 | 8 | 0 | @@ -264,7 +266,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 9 | 0 | 2 | 0 | | | Kibana Core | - | 4 | 0 | 4 | 0 | | | Kibana Core | - | 111 | 4 | 37 | 0 | -| | Kibana Core | - | 10 | 0 | 10 | 0 | +| | Kibana Core | - | 10 | 0 | 10 | 1 | | | Kibana Core | - | 16 | 0 | 16 | 0 | | | Kibana Core | - | 4 | 0 | 0 | 0 | | | Kibana Core | - | 10 | 1 | 10 | 0 | @@ -275,8 +277,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 25 | 5 | 25 | 1 | | | Kibana Core | - | 7 | 0 | 7 | 1 | | | Kibana Core | - | 392 | 1 | 154 | 0 | -| | Kibana Core | - | 54 | 0 | 48 | 2 | -| | Kibana Core | - | 41 | 0 | 37 | 0 | +| | Kibana Core | - | 54 | 0 | 48 | 6 | +| | Kibana Core | - | 41 | 0 | 40 | 0 | | | Kibana Core | - | 4 | 0 | 2 | 0 | | | Kibana Core | - | 3 | 0 | 3 | 0 | | | Kibana Core | - | 3 | 0 | 1 | 0 | @@ -288,9 +290,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 4 | 0 | 4 | 0 | | | Kibana Core | - | 28 | 0 | 0 | 0 | | | Kibana Core | - | 5 | 0 | 5 | 0 | +| | Kibana Core | - | 31 | 0 | 0 | 0 | +| | Kibana Core | - | 9 | 0 | 9 | 0 | +| | Kibana Core | - | 4 | 0 | 4 | 0 | +| | Kibana Core | - | 38 | 0 | 31 | 0 | | | Kibana Core | - | 56 | 0 | 30 | 0 | -| | Kibana Core | - | 9 | 0 | 5 | 1 | -| | Kibana Core | - | 13 | 0 | 12 | 0 | +| | Kibana Core | - | 9 | 0 | 5 | 2 | +| | Kibana Core | - | 13 | 0 | 13 | 0 | | | Kibana Core | - | 29 | 0 | 25 | 0 | | | Kibana Core | - | 11 | 1 | 11 | 0 | | | Kibana Core | - | 62 | 0 | 8 | 0 | @@ -298,26 +304,28 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 19 | 0 | 19 | 0 | | | Kibana Core | - | 6 | 0 | 0 | 0 | | | Kibana Core | - | 5 | 0 | 0 | 0 | -| | Kibana Core | - | 3 | 0 | 3 | 0 | -| | Kibana Core | - | 3 | 0 | 3 | 0 | +| | Kibana Core | - | 7 | 0 | 6 | 1 | +| | Kibana Core | - | 5 | 0 | 5 | 0 | | | Kibana Core | - | 35 | 4 | 23 | 0 | | | Kibana Core | - | 32 | 0 | 11 | 2 | | | Kibana Core | - | 4 | 0 | 4 | 0 | -| | Kibana Core | - | 63 | 0 | 35 | 0 | -| | Kibana Core | - | 1 | 0 | 1 | 0 | +| | Kibana Core | - | 63 | 0 | 37 | 0 | +| | Kibana Core | - | 1 | 0 | 1 | 1 | | | Kibana Core | - | 3 | 0 | 3 | 0 | -| | Kibana Core | - | 14 | 0 | 10 | 0 | +| | Kibana Core | - | 15 | 0 | 11 | 0 | | | Kibana Core | - | 6 | 0 | 6 | 0 | +| | Kibana Core | - | 58 | 0 | 26 | 0 | +| | Kibana Core | - | 5 | 0 | 5 | 0 | | | Kibana Core | - | 5 | 0 | 0 | 0 | | | Kibana Core | - | 6 | 0 | 6 | 0 | | | Kibana Core | - | 2 | 0 | 2 | 0 | -| | Kibana Core | - | 2 | 0 | 2 | 0 | +| | Kibana Core | - | 2 | 0 | 2 | 1 | | | Kibana Core | - | 4 | 0 | 4 | 1 | | | Kibana Core | - | 107 | 1 | 76 | 0 | | | Kibana Core | - | 310 | 1 | 137 | 0 | -| | Kibana Core | - | 71 | 0 | 51 | 0 | +| | Kibana Core | - | 71 | 0 | 51 | 1 | | | Kibana Core | - | 6 | 0 | 6 | 0 | -| | Kibana Core | - | 37 | 0 | 31 | 1 | +| | Kibana Core | - | 37 | 0 | 31 | 6 | | | Kibana Core | - | 4 | 0 | 4 | 0 | | | Kibana Core | - | 2 | 0 | 1 | 0 | | | Kibana Core | - | 6 | 0 | 6 | 0 | @@ -325,18 +333,18 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 83 | 0 | 41 | 0 | | | Kibana Core | - | 25 | 0 | 23 | 0 | | | Kibana Core | - | 4 | 0 | 4 | 0 | -| | Kibana Core | - | 100 | 0 | 74 | 43 | +| | Kibana Core | - | 101 | 0 | 75 | 43 | | | Kibana Core | - | 12 | 0 | 12 | 0 | | | Kibana Core | - | 226 | 0 | 83 | 0 | | | Kibana Core | - | 69 | 0 | 69 | 4 | -| | Kibana Core | - | 14 | 0 | 13 | 0 | +| | Kibana Core | - | 14 | 0 | 14 | 0 | | | Kibana Core | - | 99 | 1 | 86 | 0 | | | Kibana Core | - | 12 | 0 | 2 | 0 | | | Kibana Core | - | 19 | 0 | 18 | 0 | -| | Kibana Core | - | 20 | 0 | 1 | 0 | +| | Kibana Core | - | 20 | 0 | 3 | 0 | | | Kibana Core | - | 22 | 0 | 22 | 1 | | | Kibana Core | - | 4 | 0 | 4 | 0 | -| | Kibana Core | - | 11 | 0 | 9 | 0 | +| | Kibana Core | - | 11 | 0 | 11 | 0 | | | Kibana Core | - | 5 | 0 | 5 | 0 | | | Kibana Core | - | 13 | 0 | 12 | 0 | | | [Owner missing] | - | 4 | 0 | 4 | 0 | @@ -348,7 +356,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 4 | 0 | 4 | 0 | | | Kibana Core | - | 23 | 0 | 3 | 0 | | | Kibana Core | - | 27 | 1 | 13 | 0 | -| | Kibana Core | - | 28 | 1 | 27 | 1 | +| | Kibana Core | - | 28 | 1 | 28 | 2 | | | Kibana Core | - | 6 | 0 | 6 | 0 | | | Kibana Core | - | 153 | 0 | 142 | 0 | | | Kibana Core | - | 8 | 0 | 8 | 2 | @@ -363,34 +371,36 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | - | 67 | 0 | 67 | 2 | | | [Owner missing] | - | 1 | 0 | 1 | 0 | | | [Owner missing] | - | 19 | 0 | 11 | 0 | +| | [Owner missing] | - | 4 | 0 | 4 | 0 | | | [Owner missing] | - | 27 | 0 | 14 | 1 | | | Kibana Core | - | 7 | 0 | 3 | 0 | -| | [Owner missing] | - | 226 | 1 | 170 | 14 | +| | [Owner missing] | - | 227 | 1 | 170 | 13 | | | Kibana Core | - | 11 | 0 | 11 | 0 | | | [Owner missing] | - | 2 | 0 | 1 | 0 | | | [Owner missing] | - | 20 | 0 | 16 | 0 | | | [Owner missing] | - | 2 | 0 | 0 | 0 | -| | [Owner missing] | - | 28 | 0 | 28 | 2 | +| | [Owner missing] | - | 29 | 0 | 29 | 1 | | | [Owner missing] | - | 1 | 0 | 0 | 0 | | | [Owner missing] | - | 3 | 0 | 0 | 0 | -| | [Owner missing] | - | 17 | 0 | 17 | 2 | +| | [Owner missing] | - | 23 | 0 | 21 | 1 | | | [Owner missing] | - | 6 | 0 | 0 | 0 | | | [Owner missing] | - | 3 | 0 | 3 | 0 | | | [Owner missing] | - | 32 | 0 | 22 | 0 | | | [Owner missing] | - | 8 | 0 | 2 | 2 | | | Kibana Core | - | 51 | 0 | 48 | 0 | +| | Kibana Core | - | 61 | 0 | 1 | 0 | | | [Owner missing] | - | 43 | 0 | 36 | 0 | -| | App Services | - | 35 | 4 | 35 | 0 | +| | App Services | - | 50 | 13 | 41 | 0 | | | [Owner missing] | - | 20 | 0 | 20 | 2 | | | [Owner missing] | - | 13 | 0 | 13 | 0 | | | [Owner missing] | - | 64 | 0 | 59 | 5 | | | [Owner missing] | - | 96 | 0 | 95 | 0 | | | [Owner missing] | - | 7 | 0 | 5 | 0 | -| | Kibana Core | - | 30 | 0 | 5 | 37 | +| | Kibana Core | - | 32 | 0 | 5 | 39 | | | Kibana Core | - | 8 | 0 | 8 | 0 | | | [Owner missing] | - | 6 | 0 | 1 | 1 | | | [Owner missing] | - | 534 | 1 | 1 | 0 | -| | Machine Learning UI | This package includes utility functions related to creating elasticsearch aggregation queries, data manipulation and verification. | 64 | 2 | 44 | 3 | +| | Machine Learning UI | This package includes utility functions related to creating elasticsearch aggregation queries, data manipulation and verification. | 77 | 2 | 54 | 0 | | | Machine Learning UI | A type guard to check record like object structures. | 3 | 0 | 2 | 0 | | | Machine Learning UI | Creates a deterministic number based hash out of a string. | 2 | 0 | 1 | 0 | | | [Owner missing] | - | 55 | 0 | 55 | 2 | @@ -402,7 +412,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | Just some helpers for kibana plugin devs. | 1 | 0 | 1 | 0 | | | [Owner missing] | - | 21 | 0 | 10 | 0 | | | [Owner missing] | - | 6 | 0 | 6 | 1 | -| | [Owner missing] | - | 75 | 0 | 72 | 0 | +| | [Owner missing] | - | 85 | 0 | 82 | 0 | | | [Owner missing] | Security Solution auto complete | 56 | 1 | 41 | 1 | | | [Owner missing] | security solution elastic search utilities to use across plugins such lists, security_solution, cases, etc... | 67 | 0 | 61 | 1 | | | [Owner missing] | - | 89 | 0 | 78 | 1 | @@ -414,38 +424,41 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | security solution list REST API | 67 | 0 | 64 | 0 | | | [Owner missing] | security solution list constants to use across plugins such lists, security_solution, cases, etc... | 33 | 0 | 17 | 0 | | | [Owner missing] | Security solution list ReactJS hooks | 58 | 0 | 47 | 0 | -| | [Owner missing] | security solution list utilities | 194 | 0 | 150 | 0 | +| | [Owner missing] | security solution list utilities | 194 | 10 | 150 | 0 | | | [Owner missing] | security solution rule utilities to use across plugins | 26 | 0 | 23 | 0 | | | [Owner missing] | security solution t-grid packages will allow sharing components between timelines and security_solution plugin until we transfer all functionality to timelines plugin | 120 | 0 | 116 | 0 | -| | [Owner missing] | security solution utilities to use across plugins such lists, security_solution, cases, etc... | 31 | 0 | 29 | 0 | +| | [Owner missing] | security solution utilities to use across plugins such lists, security_solution, cases, etc... | 31 | 2 | 29 | 0 | | | Kibana Core | - | 53 | 0 | 50 | 1 | | | [Owner missing] | - | 25 | 0 | 24 | 1 | | | [Owner missing] | - | 2 | 0 | 0 | 0 | +| | [Owner missing] | - | 3 | 0 | 2 | 2 | | | [Owner missing] | - | 40 | 0 | 3 | 0 | +| | [Owner missing] | - | 8 | 0 | 4 | 0 | | | [Owner missing] | - | 13 | 0 | 9 | 0 | | | [Owner missing] | - | 25 | 0 | 8 | 0 | | | [Owner missing] | - | 10 | 0 | 4 | 0 | | | [Owner missing] | - | 32 | 0 | 28 | 0 | +| | [Owner missing] | - | 17 | 0 | 9 | 0 | | | [Owner missing] | - | 10 | 0 | 9 | 0 | | | [Owner missing] | - | 2 | 0 | 2 | 1 | | | [Owner missing] | - | 32 | 0 | 31 | 0 | -| | [Owner missing] | - | 13 | 0 | 4 | 1 | +| | [Owner missing] | - | 13 | 0 | 5 | 1 | | | [Owner missing] | - | 12 | 0 | 12 | 0 | | | [Owner missing] | - | 8 | 0 | 3 | 0 | | | [Owner missing] | - | 25 | 0 | 24 | 0 | -| | [Owner missing] | - | 11 | 0 | 2 | 0 | +| | [Owner missing] | - | 11 | 0 | 6 | 0 | | | [Owner missing] | - | 43 | 5 | 43 | 2 | -| | [Owner missing] | - | 13 | 0 | 4 | 0 | -| | [Owner missing] | - | 11 | 0 | 5 | 0 | +| | [Owner missing] | - | 13 | 0 | 5 | 0 | +| | [Owner missing] | - | 11 | 0 | 9 | 0 | | | [Owner missing] | - | 24 | 0 | 24 | 0 | | | [Owner missing] | - | 27 | 0 | 26 | 0 | | | [Owner missing] | - | 5 | 0 | 3 | 0 | -| | [Owner missing] | - | 24 | 0 | 4 | 0 | +| | [Owner missing] | - | 24 | 0 | 10 | 0 | | | [Owner missing] | - | 17 | 0 | 16 | 0 | | | [Owner missing] | - | 2 | 0 | 1 | 0 | | | [Owner missing] | - | 1 | 0 | 1 | 0 | | | [Owner missing] | - | 2 | 0 | 0 | 0 | -| | [Owner missing] | - | 14 | 0 | 4 | 1 | +| | [Owner missing] | - | 15 | 0 | 4 | 0 | | | [Owner missing] | - | 9 | 0 | 3 | 0 | | | [Owner missing] | - | 20 | 0 | 12 | 0 | | | [Owner missing] | - | 2 | 0 | 2 | 0 | @@ -453,13 +466,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | - | 4 | 0 | 2 | 0 | | | Operations | - | 41 | 2 | 21 | 0 | | | Kibana Core | - | 2 | 0 | 2 | 0 | -| | Operations | - | 261 | 4 | 217 | 11 | +| | Operations | - | 264 | 4 | 220 | 11 | | | [Owner missing] | - | 135 | 5 | 103 | 2 | | | [Owner missing] | - | 2 | 0 | 1 | 0 | | | [Owner missing] | - | 72 | 0 | 55 | 0 | | | [Owner missing] | - | 8 | 0 | 2 | 0 | | | [Owner missing] | - | 113 | 1 | 65 | 0 | | | [Owner missing] | - | 83 | 0 | 83 | 1 | +| | [Owner missing] | - | 44 | 0 | 35 | 0 | | | [Owner missing] | - | 7 | 0 | 6 | 0 | | | [Owner missing] | - | 55 | 0 | 5 | 0 | | | [Owner missing] | - | 34 | 0 | 14 | 1 | diff --git a/api_docs/presentation_util.devdocs.json b/api_docs/presentation_util.devdocs.json index 7a250188fd990..7c02ccf9c73ee 100644 --- a/api_docs/presentation_util.devdocs.json +++ b/api_docs/presentation_util.devdocs.json @@ -676,7 +676,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">) => any" ], "path": "src/plugins/presentation_util/common/lib/test_helpers/function_wrapper.ts", @@ -2026,7 +2032,13 @@ "label": "coreStart", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/presentation_util/public/services/create/factory.ts", "deprecated": false, @@ -2056,7 +2068,13 @@ "signature": [ "BehaviorSubject", "<", - "AppUpdater", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.AppUpdater", + "text": "AppUpdater" + }, "> | undefined" ], "path": "src/plugins/presentation_util/public/services/create/factory.ts", @@ -2071,7 +2089,13 @@ "label": "initContext", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, " | undefined" ], "path": "src/plugins/presentation_util/public/services/create/factory.ts", @@ -2179,7 +2203,13 @@ "description": [], "signature": [ "(query: string, fields: string[]) => Promise<", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "<", "PartialDashboardAttributes", ">[]>" @@ -2230,7 +2260,13 @@ "description": [], "signature": [ "(title: string) => Promise<", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "<", "PartialDashboardAttributes", ">[]>" @@ -3332,7 +3368,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "src/plugins/presentation_util/common/lib/utils/default_theme.ts", @@ -4179,10 +4221,13 @@ { "parentPluginId": "presentationUtil", "id": "def-common.projects.DEFER_BELOW_FOLD.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/presentation_util/common/labs.ts", "deprecated": false, "trackAdoption": false @@ -4190,10 +4235,13 @@ { "parentPluginId": "presentationUtil", "id": "def-common.projects.DEFER_BELOW_FOLD.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/presentation_util/common/labs.ts", "deprecated": false, "trackAdoption": false @@ -4284,10 +4332,13 @@ { "parentPluginId": "presentationUtil", "id": "def-common.projects.DASHBOARD_CONTROLS.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/presentation_util/common/labs.ts", "deprecated": false, "trackAdoption": false @@ -4295,10 +4346,13 @@ { "parentPluginId": "presentationUtil", "id": "def-common.projects.DASHBOARD_CONTROLS.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/presentation_util/common/labs.ts", "deprecated": false, "trackAdoption": false @@ -4389,10 +4443,13 @@ { "parentPluginId": "presentationUtil", "id": "def-common.projects.BY_VALUE_EMBEDDABLE.name", - "type": "string", + "type": "Any", "tags": [], "label": "name", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/presentation_util/common/labs.ts", "deprecated": false, "trackAdoption": false @@ -4400,10 +4457,13 @@ { "parentPluginId": "presentationUtil", "id": "def-common.projects.BY_VALUE_EMBEDDABLE.description", - "type": "string", + "type": "Any", "tags": [], "label": "description", "description": [], + "signature": [ + "any" + ], "path": "src/plugins/presentation_util/common/labs.ts", "deprecated": false, "trackAdoption": false diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index ca086cdb2e5d5..53a5cf54892ba 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-prese | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 243 | 2 | 187 | 12 | +| 243 | 8 | 187 | 12 | ## Client diff --git a/api_docs/profiling.devdocs.json b/api_docs/profiling.devdocs.json index 59280e0c4a8ac..16ea80bbd39ff 100644 --- a/api_docs/profiling.devdocs.json +++ b/api_docs/profiling.devdocs.json @@ -197,10 +197,13 @@ { "parentPluginId": "profiling", "id": "def-common.NOT_AVAILABLE_LABEL", - "type": "string", + "type": "Any", "tags": [], "label": "NOT_AVAILABLE_LABEL", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/profiling/common/index.ts", "deprecated": false, "trackAdoption": false, diff --git a/api_docs/profiling.mdx b/api_docs/profiling.mdx index 71a0d463ce06c..60ca8c080bccd 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profiling'] --- import profilingObj from './profiling.devdocs.json'; @@ -21,7 +21,7 @@ Contact [profiling](https://github.com/orgs/elastic/teams/profiling-ui) for ques | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 14 | 1 | 14 | 0 | +| 14 | 2 | 14 | 0 | ## Server diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index cce9bd68dd9bb..fd7e76f70abb0 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] --- import remoteClustersObj from './remote_clusters.devdocs.json'; diff --git a/api_docs/reporting.devdocs.json b/api_docs/reporting.devdocs.json index 73904f6beaab9..a2e41bd90be70 100644 --- a/api_docs/reporting.devdocs.json +++ b/api_docs/reporting.devdocs.json @@ -613,7 +613,13 @@ "text": "LocatorParams" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">[]; }" ], "path": "x-pack/plugins/reporting/common/types/base.ts", @@ -676,7 +682,13 @@ "text": "LocatorParams" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">[]; }" ], "path": "x-pack/plugins/reporting/common/types/export_types/printable_pdf_v2.ts", diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index 1601ba2ad849a..4358bf445fbde 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: 2022-10-25 +date: 2022-11-07 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 88e87b7bdd146..8dbdec42c18c5 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.devdocs.json b/api_docs/rule_registry.devdocs.json index 868760ba33262..a1478914784c1 100644 --- a/api_docs/rule_registry.devdocs.json +++ b/api_docs/rule_registry.devdocs.json @@ -1091,7 +1091,13 @@ "description": [], "signature": [ "(featureId: ", - "AlertConsumers", + { + "pluginId": "@kbn/rule-data-utils", + "scope": "common", + "docId": "kibKbnRuleDataUtilsPluginApi", + "section": "def-common.AlertConsumers", + "text": "AlertConsumers" + }, ", dataset: ", { "pluginId": "ruleRegistry", @@ -1116,7 +1122,13 @@ "label": "featureId", "description": [], "signature": [ - "AlertConsumers" + { + "pluginId": "@kbn/rule-data-utils", + "scope": "common", + "docId": "kibKbnRuleDataUtilsPluginApi", + "section": "def-common.AlertConsumers", + "text": "AlertConsumers" + } ], "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/rule_data_plugin_service.ts", "deprecated": false, @@ -1397,9 +1409,21 @@ "description": [], "signature": [ "(logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, ", ruleDataClient: ", - "PublicContract", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicContract", + "text": "PublicContract" + }, "<", { "pluginId": "ruleRegistry", @@ -1458,7 +1482,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts", "deprecated": false, @@ -1473,7 +1503,13 @@ "label": "ruleDataClient", "description": [], "signature": [ - "PublicContract", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.PublicContract", + "text": "PublicContract" + }, "<", { "pluginId": "ruleRegistry", @@ -1502,7 +1538,13 @@ "description": [], "signature": [ "({ logger, ruleDataClient }: { logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, "; ruleDataClient: ", { "pluginId": "ruleRegistry", @@ -1568,7 +1610,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type_factory.ts", "deprecated": false, @@ -1617,7 +1665,13 @@ "text": "IRuleDataClient" }, "; logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, "; }) => ; injectReferences: (params: TParams, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => TParams; } | undefined; isExportable: boolean; defaultScheduleInterval?: string | undefined; ruleTaskTimeout?: string | undefined; doesSetRecoveryContext?: boolean | undefined; }" ], "path": "x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_wrapper.ts", @@ -1733,7 +1793,13 @@ "text": "IRuleDataClient" }, "; logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, "; }" ], "path": "x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_wrapper.ts", @@ -1786,7 +1852,13 @@ "label": "outcome", "description": [], "signature": [ - "EcsEventOutcome", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.EcsEventOutcome", + "text": "EcsEventOutcome" + }, " | undefined" ], "path": "x-pack/plugins/rule_registry/server/alert_data_client/audit_events.ts", @@ -2320,7 +2392,13 @@ "(request: TSearchRequest) => Promise<", - "ESSearchResponse", + { + "pluginId": "@kbn/es-types", + "scope": "server", + "docId": "kibKbnEsTypesPluginApi", + "section": "def-server.ESSearchResponse", + "text": "ESSearchResponse" + }, "> & OutputOf>>, TSearchRequest, { restTotalHitsAsInt: false; }>>" ], "path": "x-pack/plugins/rule_registry/server/rule_data_client/types.ts", @@ -2660,7 +2738,13 @@ ], "signature": [ "(featureId: ", - "AlertConsumers", + { + "pluginId": "@kbn/rule-data-utils", + "scope": "common", + "docId": "kibKbnRuleDataUtilsPluginApi", + "section": "def-common.AlertConsumers", + "text": "AlertConsumers" + }, ", dataset: ", { "pluginId": "ruleRegistry", @@ -2685,7 +2769,13 @@ "label": "featureId", "description": [], "signature": [ - "AlertConsumers" + { + "pluginId": "@kbn/rule-data-utils", + "scope": "common", + "docId": "kibKbnRuleDataUtilsPluginApi", + "section": "def-common.AlertConsumers", + "text": "AlertConsumers" + } ], "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/rule_data_plugin_service.ts", "deprecated": false, @@ -2874,7 +2964,7 @@ "label": "getAlertStartedDate", "description": [], "signature": [ - "(alertId: string) => string | null" + "(alertInstanceId: string) => string | null" ], "path": "x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts", "deprecated": false, @@ -2885,7 +2975,39 @@ "id": "def-server.LifecycleAlertServices.getAlertStartedDate.$1", "type": "string", "tags": [], - "label": "alertId", + "label": "alertInstanceId", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.LifecycleAlertServices.getAlertUuid", + "type": "Function", + "tags": [], + "label": "getAlertUuid", + "description": [], + "signature": [ + "(alertInstanceId: string) => string | null" + ], + "path": "x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "ruleRegistry", + "id": "def-server.LifecycleAlertServices.getAlertUuid.$1", + "type": "string", + "tags": [], + "label": "alertInstanceId", "description": [], "signature": [ "string" @@ -3216,7 +3338,13 @@ "label": "logger", "description": [], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "x-pack/plugins/rule_registry/server/rule_data_client/rule_data_client.ts", "deprecated": false, @@ -3297,7 +3425,13 @@ "text": "IRuleDataClient" }, "; logger: ", - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, "; }) => | ", "Right", "<", - "ElasticsearchClient", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, ">" ], "path": "x-pack/plugins/rule_registry/server/rule_data_client/rule_data_client.ts", @@ -3884,7 +4030,13 @@ "description": [], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise<", { "pluginId": "ruleRegistry", @@ -3907,7 +4059,13 @@ "label": "req", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/rule_registry/server/plugin.ts", @@ -4148,7 +4306,13 @@ "label": "subType", "description": [], "signature": [ - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined" ], "path": "x-pack/plugins/rule_registry/common/types.ts", @@ -4298,7 +4462,13 @@ "text": "IEsSearchRequest" }, " & { featureIds: ", - "AlertConsumers", + { + "pluginId": "@kbn/rule-data-utils", + "scope": "common", + "docId": "kibKbnRuleDataUtilsPluginApi", + "section": "def-common.AlertConsumers", + "text": "AlertConsumers" + }, "[]; fields?: ", "QueryDslFieldAndFormat", "[] | undefined; query?: Pick<", diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 1ba9e57626212..907f519cb3058 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; @@ -21,7 +21,7 @@ Contact [RAC](https://github.com/orgs/elastic/teams/rac) for questions regarding | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 230 | 0 | 202 | 10 | +| 232 | 0 | 204 | 10 | ## Server diff --git a/api_docs/runtime_fields.devdocs.json b/api_docs/runtime_fields.devdocs.json index d88ed8f52aef0..58b3e44189559 100644 --- a/api_docs/runtime_fields.devdocs.json +++ b/api_docs/runtime_fields.devdocs.json @@ -264,7 +264,13 @@ "\nThe docLinks start service from core" ], "signature": [ - "DocLinksStart" + { + "pluginId": "@kbn/core-doc-links-browser", + "scope": "common", + "docId": "kibKbnCoreDocLinksBrowserPluginApi", + "section": "def-common.DocLinksStart", + "text": "DocLinksStart" + } ], "path": "x-pack/plugins/runtime_fields/public/components/runtime_field_editor_flyout_content/runtime_field_editor_flyout_content.tsx", "deprecated": false, diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index cba8d6a5fe6fc..222f97cf8ecd5 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: 2022-10-25 +date: 2022-11-07 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 71d53634b7540..7a9b1f2ca10c1 100644 --- a/api_docs/saved_objects.devdocs.json +++ b/api_docs/saved_objects.devdocs.json @@ -784,7 +784,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">, \"id\" | \"title\" | \"getDisplayName\" | \"lastSavedTitle\" | \"copyOnSave\" | \"getEsType\">, isTitleDuplicateConfirmed: boolean, onTitleDuplicate: (() => void) | undefined, services: Pick<", "SavedObjectKibanaServices", ", \"savedObjectsClient\" | \"overlays\">) => Promise" @@ -810,7 +816,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">, \"id\" | \"title\" | \"getDisplayName\" | \"lastSavedTitle\" | \"copyOnSave\" | \"getEsType\">" ], "path": "src/plugins/saved_objects/public/saved_object/helpers/check_for_duplicate_title.ts", @@ -878,9 +890,21 @@ "description": [], "signature": [ "(savedObject: ", - "SavedObjectsStart", + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + }, ", uiSettings: ", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + }, ") => (props: ", "SavedObjectFinderProps", ") => JSX.Element" @@ -897,7 +921,13 @@ "label": "savedObject", "description": [], "signature": [ - "SavedObjectsStart" + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + } ], "path": "src/plugins/saved_objects/public/finder/saved_object_finder.tsx", "deprecated": false, @@ -912,7 +942,13 @@ "label": "uiSettings", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "src/plugins/saved_objects/public/finder/saved_object_finder.tsx", "deprecated": false, @@ -1027,17 +1063,53 @@ ], "signature": [ "(source: ", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ", savedObject: { getEsType(): string; title: string; displayName: string; }, options: ", - "SavedObjectsCreateOptions", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, ", services: { savedObjectsClient: ", - "SavedObjectsClientContract", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, "; overlays: ", - "OverlayStart", + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + }, "; }) => Promise<", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">>" ], "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts", @@ -1054,7 +1126,13 @@ "- serialized version of this object what will be indexed into elasticsearch." ], "signature": [ - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts", "deprecated": false, @@ -1122,7 +1200,13 @@ "- options to pass to the saved object create method" ], "signature": [ - "SavedObjectsCreateOptions" + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts", "deprecated": false, @@ -1148,7 +1232,13 @@ "label": "savedObjectsClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts", "deprecated": false, @@ -1162,7 +1252,13 @@ "label": "overlays", "description": [], "signature": [ - "OverlayStart" + { + "pluginId": "@kbn/core-overlays-browser", + "scope": "common", + "docId": "kibKbnCoreOverlaysBrowserPluginApi", + "section": "def-common.OverlayStart", + "text": "OverlayStart" + } ], "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts", "deprecated": false, @@ -1580,9 +1676,21 @@ "description": [], "signature": [ "() => { attributes: ", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/saved_objects/public/types.ts", @@ -2034,7 +2142,13 @@ "label": "unresolvedIndexPatternReference", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, " | undefined" ], "path": "src/plugins/saved_objects/public/types.ts", @@ -2072,7 +2186,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">) => Promise<", { "pluginId": "savedObjects", @@ -2082,7 +2202,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">>) | undefined" ], "path": "src/plugins/saved_objects/public/types.ts", @@ -2105,7 +2231,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">" ], "path": "src/plugins/saved_objects/public/types.ts", @@ -2183,9 +2315,21 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">>(object: T, references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => void) | undefined" ], "path": "src/plugins/saved_objects/public/types.ts", @@ -2215,7 +2359,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/saved_objects/public/types.ts", @@ -2627,7 +2777,13 @@ "description": [], "signature": [ "(savedObject: ", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ") => ", "IconType" ], @@ -2643,7 +2799,13 @@ "label": "savedObject", "description": [], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "" ], "path": "src/plugins/saved_objects/public/finder/saved_object_finder.tsx", @@ -2663,7 +2825,13 @@ "description": [], "signature": [ "((savedObject: ", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ") => string) | undefined" ], "path": "src/plugins/saved_objects/public/finder/saved_object_finder.tsx", @@ -2678,7 +2846,13 @@ "label": "savedObject", "description": [], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "" ], "path": "src/plugins/saved_objects/public/finder/saved_object_finder.tsx", @@ -2698,7 +2872,13 @@ "description": [], "signature": [ "((savedObject: ", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ") => boolean) | undefined" ], "path": "src/plugins/saved_objects/public/finder/saved_object_finder.tsx", @@ -2713,7 +2893,13 @@ "label": "savedObject", "description": [], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "" ], "path": "src/plugins/saved_objects/public/finder/saved_object_finder.tsx", @@ -2733,7 +2919,13 @@ "description": [], "signature": [ "((savedObject: ", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ") => string) | undefined" ], "path": "src/plugins/saved_objects/public/finder/saved_object_finder.tsx", @@ -2748,7 +2940,13 @@ "label": "savedObject", "description": [], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "" ], "path": "src/plugins/saved_objects/public/finder/saved_object_finder.tsx", @@ -3026,9 +3224,21 @@ "description": [], "signature": [ "{ savedObjects: ", - "SavedObjectsStart", + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + }, "; uiSettings: ", - "IUiSettingsClient", + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + }, "; } & ", "SavedObjectFinderProps" ], @@ -3086,7 +3296,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">" ], "path": "src/plugins/saved_objects/public/plugin.ts", diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 4aab589645a9c..12267553ac95f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.devdocs.json b/api_docs/saved_objects_finder.devdocs.json index 1ab97efddadfb..71986e0c6d66f 100644 --- a/api_docs/saved_objects_finder.devdocs.json +++ b/api_docs/saved_objects_finder.devdocs.json @@ -104,7 +104,13 @@ "description": [], "signature": [ "(savedObject: ", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ") => ", "IconType" ], @@ -120,7 +126,13 @@ "label": "savedObject", "description": [], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "" ], "path": "src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx", @@ -140,7 +152,13 @@ "description": [], "signature": [ "((savedObject: ", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ") => string) | undefined" ], "path": "src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx", @@ -155,7 +173,13 @@ "label": "savedObject", "description": [], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "" ], "path": "src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx", @@ -175,7 +199,13 @@ "description": [], "signature": [ "((savedObject: ", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ") => boolean) | undefined" ], "path": "src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx", @@ -190,7 +220,13 @@ "label": "savedObject", "description": [], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "" ], "path": "src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx", @@ -210,7 +246,13 @@ "description": [], "signature": [ "((savedObject: ", - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, ") => string) | undefined" ], "path": "src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx", @@ -225,7 +267,13 @@ "label": "savedObject", "description": [], "signature": [ - "SimpleSavedObject", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SimpleSavedObject", + "text": "SimpleSavedObject" + }, "" ], "path": "src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx", diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index aec499b35e4cb..5997fb88ab90f 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsFinder'] --- import savedObjectsFinderObj from './saved_objects_finder.devdocs.json'; diff --git a/api_docs/saved_objects_management.devdocs.json b/api_docs/saved_objects_management.devdocs.json index 1f64f3bea1abe..d08548c27a8ee 100644 --- a/api_docs/saved_objects_management.devdocs.json +++ b/api_docs/saved_objects_management.devdocs.json @@ -466,7 +466,13 @@ "description": [], "signature": [ "(response: ", - "SavedObjectsImportResponse", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportResponse", + "text": "SavedObjectsImportResponse" + }, ") => ", { "pluginId": "savedObjectsManagement", @@ -488,7 +494,13 @@ "label": "response", "description": [], "signature": [ - "SavedObjectsImportResponse" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportResponse", + "text": "SavedObjectsImportResponse" + } ], "path": "src/plugins/saved_objects_management/public/lib/process_import_response.ts", "deprecated": false, @@ -534,15 +546,45 @@ "label": "error", "description": [], "signature": [ - "SavedObjectsImportConflictError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportConflictError", + "text": "SavedObjectsImportConflictError" + }, " | ", - "SavedObjectsImportAmbiguousConflictError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportAmbiguousConflictError", + "text": "SavedObjectsImportAmbiguousConflictError" + }, " | ", - "SavedObjectsImportUnsupportedTypeError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportUnsupportedTypeError", + "text": "SavedObjectsImportUnsupportedTypeError" + }, " | ", - "SavedObjectsImportMissingReferencesError", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportMissingReferencesError", + "text": "SavedObjectsImportMissingReferencesError" + }, " | ", - "SavedObjectsImportUnknownError" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportUnknownError", + "text": "SavedObjectsImportUnknownError" + } ], "path": "src/plugins/saved_objects_management/public/lib/process_import_response.ts", "deprecated": false, @@ -591,7 +633,13 @@ "label": "successfulImports", "description": [], "signature": [ - "SavedObjectsImportSuccess", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportSuccess", + "text": "SavedObjectsImportSuccess" + }, "[]" ], "path": "src/plugins/saved_objects_management/public/lib/process_import_response.ts", @@ -645,7 +693,13 @@ "label": "importWarnings", "description": [], "signature": [ - "SavedObjectsImportWarning", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportWarning", + "text": "SavedObjectsImportWarning" + }, "[]" ], "path": "src/plugins/saved_objects_management/public/lib/process_import_response.ts", @@ -793,7 +847,13 @@ "label": "namespaceType", "description": [], "signature": [ - "SavedObjectsNamespaceType", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsNamespaceType", + "text": "SavedObjectsNamespaceType" + }, " | undefined" ], "path": "src/plugins/saved_objects_management/common/types.ts", @@ -1169,7 +1229,13 @@ "description": [], "signature": [ "{ icon: string; title: string; namespaceType: ", - "SavedObjectsNamespaceType", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsNamespaceType", + "text": "SavedObjectsNamespaceType" + }, "; hiddenType: boolean; }" ], "path": "src/plugins/saved_objects_management/public/services/types/record.ts", @@ -1184,7 +1250,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/saved_objects_management/public/services/types/record.ts", @@ -1221,7 +1293,13 @@ "\nA {@link SavedObject | saved object} enhanced with meta properties used by the client-side plugin." ], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, " & { meta: ", { "pluginId": "savedObjectsManagement", @@ -1606,7 +1684,13 @@ "text": "SavedObjectsTaggingApi" }, " | undefined; }) => ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[] | undefined" ], "path": "src/plugins/saved_objects_management/public/plugin.ts", @@ -1724,7 +1808,13 @@ "label": "namespaceType", "description": [], "signature": [ - "SavedObjectsNamespaceType", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsNamespaceType", + "text": "SavedObjectsNamespaceType" + }, " | undefined" ], "path": "src/plugins/saved_objects_management/common/types.ts", @@ -1761,7 +1851,13 @@ "\nA {@link SavedObject | saved object} enhanced with meta properties used by the client-side plugin." ], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, " & { meta: ", { "pluginId": "savedObjectsManagement", @@ -2067,7 +2163,13 @@ "label": "namespaceType", "description": [], "signature": [ - "SavedObjectsNamespaceType", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsNamespaceType", + "text": "SavedObjectsNamespaceType" + }, " | undefined" ], "path": "src/plugins/saved_objects_management/common/types.ts", @@ -2191,7 +2293,13 @@ "\nA {@link SavedObject | saved object} enhanced with meta properties used by the client-side plugin." ], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, " & { meta: ", { "pluginId": "savedObjectsManagement", diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index f5b9728277aee..8b14ea419802e 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.devdocs.json b/api_docs/saved_objects_tagging.devdocs.json index b1c84029894fa..c96f8e416e0cd 100644 --- a/api_docs/saved_objects_tagging.devdocs.json +++ b/api_docs/saved_objects_tagging.devdocs.json @@ -112,7 +112,13 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/saved_objects_tagging/server/types.ts", "deprecated": false, @@ -140,7 +146,13 @@ "label": "client", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "x-pack/plugins/saved_objects_tagging/server/types.ts", "deprecated": false, @@ -595,7 +607,13 @@ "description": [], "signature": [ "(capabilities: ", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, ") => ", { "pluginId": "savedObjectsTagging", @@ -617,7 +635,13 @@ "label": "capabilities", "description": [], "signature": [ - "Capabilities" + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + } ], "path": "x-pack/plugins/saved_objects_tagging/common/capabilities.ts", "deprecated": false, @@ -1341,7 +1365,13 @@ "label": "TagSavedObject", "description": [], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "savedObjectsTaggingOss", diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 3a10b3cf465bc..cd8a7e4482eb4 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] --- import savedObjectsTaggingObj from './saved_objects_tagging.devdocs.json'; diff --git a/api_docs/saved_objects_tagging_oss.devdocs.json b/api_docs/saved_objects_tagging_oss.devdocs.json index 9642ba9390627..c5608a187385f 100644 --- a/api_docs/saved_objects_tagging_oss.devdocs.json +++ b/api_docs/saved_objects_tagging_oss.devdocs.json @@ -182,7 +182,13 @@ "label": "tagReferences", "description": [], "signature": [ - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, "[]" ], "path": "src/plugins/saved_objects_tagging_oss/public/api.ts", @@ -471,7 +477,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">) => object is ", { "pluginId": "savedObjectsTaggingOss", @@ -501,7 +513,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">" ], "path": "src/plugins/saved_objects_tagging_oss/public/api.ts", @@ -583,7 +601,13 @@ " | undefined) => ", "EuiTableFieldDataColumnType", "<", - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, ">" ], "path": "src/plugins/saved_objects_tagging_oss/public/api.ts", @@ -626,7 +650,13 @@ ], "signature": [ "(tagName: string) => ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, " | undefined" ], "path": "src/plugins/saved_objects_tagging_oss/public/api.ts", @@ -737,9 +767,21 @@ ], "signature": [ "(references: (", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, ")[]) => string[]" ], "path": "src/plugins/saved_objects_tagging_oss/public/api.ts", @@ -755,9 +797,21 @@ "description": [], "signature": [ "(", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, " | ", - "SavedObjectsFindOptionsReference", + { + "pluginId": "@kbn/core-saved-objects-api-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsApiBrowserPluginApi", + "section": "def-common.SavedObjectsFindOptionsReference", + "text": "SavedObjectsFindOptionsReference" + }, ")[]" ], "path": "src/plugins/saved_objects_tagging_oss/public/api.ts", @@ -813,9 +867,21 @@ ], "signature": [ "(references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[], newTagIds: string[]) => ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/saved_objects_tagging_oss/public/api.ts", @@ -830,7 +896,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/saved_objects_tagging_oss/public/api.ts", @@ -1086,7 +1158,13 @@ ], "signature": [ "{ references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }" ], "path": "src/plugins/saved_objects_tagging_oss/public/api.ts", @@ -1230,7 +1308,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">) => object is ", { "pluginId": "savedObjectsTaggingOss", @@ -1261,7 +1345,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, ">" ], "path": "src/plugins/saved_objects_tagging_oss/public/api.ts", @@ -1287,7 +1377,13 @@ "text": "SavedObject" }, "<", - "SavedObjectAttributes", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + }, "> & { getTags(): string[]; setTags(tags: string[]): void; }" ], "path": "src/plugins/saved_objects_tagging_oss/public/decorator/types.ts", diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index 3a57068b40de1..26bc6a3f6a496 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.devdocs.json b/api_docs/saved_search.devdocs.json index 8e6b2e5503d3c..d2e4074736003 100644 --- a/api_docs/saved_search.devdocs.json +++ b/api_docs/saved_search.devdocs.json @@ -141,7 +141,7 @@ "section": "def-public.SavedSearch", "text": "SavedSearch" }, - ") => Promise" + ") => Promise" ], "path": "src/plugins/saved_search/public/services/saved_searches/saved_searches_utils.ts", "deprecated": false, @@ -517,7 +517,13 @@ "text": "SerializedSearchSourceFields" }, "; serialize: () => { searchSourceJSON: string; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }; toExpressionAst: ({ asDatatable }?: ExpressionAstOptions) => ", { "pluginId": "expressions", diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index d6d5f61f71f05..03f2a5000a28c 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedSearch'] --- import savedSearchObj from './saved_search.devdocs.json'; diff --git a/api_docs/screenshot_mode.devdocs.json b/api_docs/screenshot_mode.devdocs.json index ab834dfc733bc..db7b35d90a2a6 100644 --- a/api_docs/screenshot_mode.devdocs.json +++ b/api_docs/screenshot_mode.devdocs.json @@ -139,7 +139,13 @@ "label": "ScreenshotModeRequestHandlerContext", "description": [], "signature": [ - "RequestHandlerContext", + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, " & { screenshotMode: Promise<{ isScreenshot: boolean; }>; }" ], "path": "src/plugins/screenshot_mode/server/types.ts", @@ -274,7 +280,13 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => boolean" ], "path": "src/plugins/screenshot_mode/server/types.ts", @@ -289,7 +301,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "src/plugins/screenshot_mode/server/types.ts", diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 84708e421c3d8..593bfd91130b2 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] --- import screenshotModeObj from './screenshot_mode.devdocs.json'; diff --git a/api_docs/screenshotting.devdocs.json b/api_docs/screenshotting.devdocs.json index 86da8b6cb1a3a..4f98923fc0a73 100644 --- a/api_docs/screenshotting.devdocs.json +++ b/api_docs/screenshotting.devdocs.json @@ -19,9 +19,21 @@ "{ id?: Id | undefined; dimensions?: { width: number; height: number; } | undefined; selectors?: Partial<", "LayoutSelectorDictionary", "> | undefined; zoom?: number | undefined; } extends ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " ? ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " & { id?: Id | undefined; dimensions?: { width: number; height: number; } | undefined; selectors?: Partial<", "LayoutSelectorDictionary", "> | undefined; zoom?: number | undefined; } : never" @@ -492,9 +504,21 @@ "{ id?: Id | undefined; dimensions?: { width: number; height: number; } | undefined; selectors?: Partial<", "LayoutSelectorDictionary", "> | undefined; zoom?: number | undefined; } extends ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " ? ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " & { id?: Id | undefined; dimensions?: { width: number; height: number; } | undefined; selectors?: Partial<", "LayoutSelectorDictionary", "> | undefined; zoom?: number | undefined; } : never" diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index 20c41d9d0ead0..874b5161eb46b 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/security.devdocs.json b/api_docs/security.devdocs.json index 331e2d40aeb93..cb96880b175ef 100644 --- a/api_docs/security.devdocs.json +++ b/api_docs/security.devdocs.json @@ -1227,7 +1227,13 @@ "text": "AuditEvent" }, " extends ", - "LogMeta" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LogMeta", + "text": "LogMeta" + } ], "path": "x-pack/plugins/security/server/audit/audit_events.ts", "deprecated": false, @@ -1359,7 +1365,13 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", { "pluginId": "security", @@ -1381,7 +1393,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/security/server/audit/audit_service.ts", @@ -1580,7 +1598,13 @@ "description": [], "signature": [ "{ create: (request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", createParams: ", { "pluginId": "security", @@ -1598,7 +1622,13 @@ "text": "CreateAPIKeyResult" }, " | null>; areAPIKeysEnabled: () => Promise; invalidate: (request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", params: ", { "pluginId": "security", @@ -1616,7 +1646,13 @@ "text": "InvalidateAPIKeyResult" }, " | null>; grantAsInternalUser: (request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", createParams: ", { "pluginId": "security", @@ -1664,7 +1700,13 @@ "description": [], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", { "pluginId": "security", @@ -1687,7 +1729,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/security/server/authentication/authentication_service.ts", @@ -2051,7 +2099,13 @@ "\nUser request instance to get user profile for." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/security/server/user_profile/user_profile_service.ts", @@ -2537,7 +2591,13 @@ "description": [], "signature": [ "{ getCurrentUser: (request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", { "pluginId": "security", @@ -3353,7 +3413,13 @@ "label": "context", "description": [], "signature": [ - "GetDeprecationsContext" + { + "pluginId": "@kbn/core-deprecations-server", + "scope": "server", + "docId": "kibKbnCoreDeprecationsServerPluginApi", + "section": "def-server.GetDeprecationsContext", + "text": "GetDeprecationsContext" + } ], "path": "x-pack/plugins/security/common/model/deprecations.ts", "deprecated": false, @@ -3413,7 +3479,13 @@ "label": "errors", "description": [], "signature": [ - "DeprecationsDetails", + { + "pluginId": "@kbn/core-deprecations-common", + "scope": "common", + "docId": "kibKbnCoreDeprecationsCommonPluginApi", + "section": "def-common.DeprecationsDetails", + "text": "DeprecationsDetails" + }, "[] | undefined" ], "path": "x-pack/plugins/security/common/model/deprecations.ts", diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 592b19eaa34a6..3e36520a60583 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; diff --git a/api_docs/security_solution.devdocs.json b/api_docs/security_solution.devdocs.json index db510724f2984..7b70697e0be38 100644 --- a/api_docs/security_solution.devdocs.json +++ b/api_docs/security_solution.devdocs.json @@ -18,7 +18,13 @@ "text": "Plugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "<", { "pluginId": "securitySolution", @@ -58,7 +64,7 @@ "label": "experimentalFeatures", "description": [], "signature": [ - "{ readonly tGridEnabled: boolean; readonly tGridEventRenderedViewEnabled: boolean; readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly disableIsolationUIPendingStatuses: boolean; readonly pendingActionResponsesWithAck: boolean; readonly policyListEnabled: boolean; readonly policyResponseInFleetEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly responseActionsConsoleEnabled: boolean; readonly insightsRelatedAlertsByProcessAncestry: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionsEnabled: boolean; readonly endpointRbacEnabled: boolean; }" + "{ readonly tGridEnabled: boolean; readonly tGridEventRenderedViewEnabled: boolean; readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly disableIsolationUIPendingStatuses: boolean; readonly pendingActionResponsesWithAck: boolean; readonly policyListEnabled: boolean; readonly policyResponseInFleetEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly responseActionsConsoleEnabled: boolean; readonly insightsRelatedAlertsByProcessAncestry: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionsEnabled: boolean; readonly endpointRbacEnabled: boolean; readonly endpointRbacV1Enabled: boolean; readonly guidedOnboarding: boolean; readonly alertDetailsPageEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/public/plugin.tsx", "deprecated": false, @@ -86,7 +92,13 @@ "label": "initializerContext", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "" ], "path": "x-pack/plugins/security_solution/public/plugin.tsx", @@ -106,7 +118,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", "StartPluginsDependencies", ", ", @@ -134,7 +152,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", "StartPluginsDependencies", ", ", @@ -173,7 +197,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", plugins: ", "StartPlugins", ") => {}" @@ -190,7 +220,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "x-pack/plugins/security_solution/public/plugin.tsx", "deprecated": false, @@ -242,7 +278,13 @@ ], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", plugins: ", "StartPlugins", ") => Promise" @@ -259,7 +301,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "x-pack/plugins/security_solution/public/plugin.tsx", "deprecated": false, @@ -1147,7 +1195,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined" ], "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/model.ts", @@ -1391,9 +1445,9 @@ }, " implements ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, @@ -1446,9 +1500,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, @@ -1530,9 +1584,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, @@ -1560,9 +1614,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } @@ -1631,7 +1685,13 @@ "label": "core", "description": [], "signature": [ - "CoreRequestHandlerContext" + { + "pluginId": "@kbn/core-http-request-handler-context-server", + "scope": "server", + "docId": "kibKbnCoreHttpRequestHandlerContextServerPluginApi", + "section": "def-server.CoreRequestHandlerContext", + "text": "CoreRequestHandlerContext" + } ], "path": "x-pack/plugins/security_solution/server/types.ts", "deprecated": false, @@ -1779,7 +1839,13 @@ "description": [], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise<", { "pluginId": "ruleRegistry", @@ -1802,7 +1868,13 @@ "label": "req", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/security_solution/server/types.ts", @@ -1863,7 +1935,13 @@ "description": [], "signature": [ "(req: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", "EndpointScopedFleetServicesInterface" ], @@ -1879,7 +1957,13 @@ "label": "req", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/security_solution/server/types.ts", @@ -1918,7 +2002,7 @@ "label": "ConfigType", "description": [], "signature": [ - "Readonly<{} & { signalsIndex: string; maxRuleImportExportSize: number; maxRuleImportPayloadBytes: number; maxTimelineImportExportSize: number; maxTimelineImportPayloadBytes: number; alertMergeStrategy: \"allFields\" | \"missingFields\" | \"noFields\"; alertIgnoreFields: string[]; enableExperimental: string[]; packagerTaskInterval: string; prebuiltRulesFromFileSystem: boolean; prebuiltRulesFromSavedObjects: boolean; }> & { experimentalFeatures: Readonly<{ tGridEnabled: boolean; tGridEventRenderedViewEnabled: boolean; excludePoliciesInFilterEnabled: boolean; kubernetesEnabled: boolean; disableIsolationUIPendingStatuses: boolean; pendingActionResponsesWithAck: boolean; policyListEnabled: boolean; policyResponseInFleetEnabled: boolean; previewTelemetryUrlEnabled: boolean; responseActionsConsoleEnabled: boolean; insightsRelatedAlertsByProcessAncestry: boolean; extendedRuleExecutionLoggingEnabled: boolean; socTrendsEnabled: boolean; responseActionsEnabled: boolean; endpointRbacEnabled: boolean; }>; }" + "Readonly<{} & { signalsIndex: string; maxRuleImportExportSize: number; maxRuleImportPayloadBytes: number; maxTimelineImportExportSize: number; maxTimelineImportPayloadBytes: number; alertMergeStrategy: \"allFields\" | \"missingFields\" | \"noFields\"; alertIgnoreFields: string[]; enableExperimental: string[]; packagerTaskInterval: string; prebuiltRulesFromFileSystem: boolean; prebuiltRulesFromSavedObjects: boolean; }> & { experimentalFeatures: Readonly<{ tGridEnabled: boolean; tGridEventRenderedViewEnabled: boolean; excludePoliciesInFilterEnabled: boolean; kubernetesEnabled: boolean; disableIsolationUIPendingStatuses: boolean; pendingActionResponsesWithAck: boolean; policyListEnabled: boolean; policyResponseInFleetEnabled: boolean; previewTelemetryUrlEnabled: boolean; responseActionsConsoleEnabled: boolean; insightsRelatedAlertsByProcessAncestry: boolean; extendedRuleExecutionLoggingEnabled: boolean; socTrendsEnabled: boolean; responseActionsEnabled: boolean; endpointRbacEnabled: boolean; endpointRbacV1Enabled: boolean; guidedOnboarding: boolean; alertDetailsPageEnabled: boolean; }>; }" ], "path": "x-pack/plugins/security_solution/server/config.ts", "deprecated": false, diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index 4e5ff0dadf522..52bdbbff4b3b3 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index f45383da8ab4b..fb274644a970c 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: 2022-10-25 +date: 2022-11-07 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 67996465a603c..457aabea0bb79 100644 --- a/api_docs/share.devdocs.json +++ b/api_docs/share.devdocs.json @@ -137,7 +137,13 @@ "description": [], "signature": [ "

(locator: ", { "pluginId": "share", @@ -908,7 +914,13 @@ "description": [], "signature": [ "((anonymousUserCapabilities: ", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, ") => boolean) | undefined" ], "path": "src/plugins/share/public/types.ts", @@ -923,7 +935,13 @@ "label": "anonymousUserCapabilities", "description": [], "signature": [ - "Capabilities" + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + } ], "path": "src/plugins/share/public/types.ts", "deprecated": false, @@ -1322,7 +1340,13 @@ "; navigate(options: ", "RedirectOptions", "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">): void; setAnonymousAccessServiceProvider: (provider: () => ", { "pluginId": "share", @@ -1366,7 +1390,13 @@ "; navigate(options: ", "RedirectOptions", "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">): void; }" ], "path": "src/plugins/share/public/plugin.ts", @@ -1495,7 +1525,13 @@ "description": [], "signature": [ "

(locator: ", { "pluginId": "share", @@ -1636,7 +1672,13 @@ ], "signature": [ "() => Promise<", - "Capabilities", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, ">" ], "path": "src/plugins/share/common/anonymous_access/types.ts", diff --git a/api_docs/share.mdx b/api_docs/share.mdx index 4b5d3116ae1f2..62a8717598815 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index 381ded84be657..0224df7a71aa4 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] --- import snapshotRestoreObj from './snapshot_restore.devdocs.json'; diff --git a/api_docs/spaces.devdocs.json b/api_docs/spaces.devdocs.json index bc49c06d1cd7f..a3bdd9ae6a2d1 100644 --- a/api_docs/spaces.devdocs.json +++ b/api_docs/spaces.devdocs.json @@ -35,7 +35,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/spaces/public/spaces_manager/spaces_manager.ts", "deprecated": false, @@ -613,7 +619,13 @@ "description": [], "signature": [ "(objects: SavedObjectTarget[]) => Promise<", - "SavedObjectsCollectMultiNamespaceReferencesResponse", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesResponse", + "text": "SavedObjectsCollectMultiNamespaceReferencesResponse" + }, ">" ], "path": "x-pack/plugins/spaces/public/spaces_manager/spaces_manager.ts", @@ -902,7 +914,13 @@ "description": [], "signature": [ "[spaceId: string]: ", - "SavedObjectsImportResponse" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsImportResponse", + "text": "SavedObjectsImportResponse" + } ], "path": "x-pack/plugins/spaces/public/copy_saved_objects_to_space/types.ts", "deprecated": false, @@ -2140,7 +2158,13 @@ ], "signature": [ ">() => ", { "pluginId": "spaces", @@ -3364,7 +3388,13 @@ ], "signature": [ "(id: string) => ", - "ISavedObjectsPointInTimeFinder", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsPointInTimeFinder", + "text": "ISavedObjectsPointInTimeFinder" + }, "" ], "path": "x-pack/plugins/spaces/server/spaces_client/spaces_client.ts", @@ -3700,7 +3730,13 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => string" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", @@ -3717,7 +3753,13 @@ "the request." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", @@ -3827,7 +3869,13 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => ", { "pluginId": "spaces", @@ -3851,7 +3899,13 @@ "the request." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", @@ -3873,7 +3927,13 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => string" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", @@ -3890,7 +3950,13 @@ "the request." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", @@ -3912,7 +3978,13 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => boolean" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", @@ -3929,7 +4001,13 @@ "the request." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", @@ -3951,7 +4029,13 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ") => Promise<", { "pluginId": "spaces", @@ -3976,7 +4060,13 @@ "the request." ], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", @@ -4095,11 +4185,29 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", savedObjectsStart: ", - "SavedObjectsServiceStart", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceStart", + "text": "SavedObjectsServiceStart" + }, ") => ", - "ISavedObjectsRepository" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } ], "path": "x-pack/plugins/spaces/server/spaces_client/spaces_client_service.ts", "deprecated": false, @@ -4114,7 +4222,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/spaces/server/spaces_client/spaces_client_service.ts", @@ -4129,7 +4243,13 @@ "label": "savedObjectsStart", "description": [], "signature": [ - "SavedObjectsServiceStart" + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.SavedObjectsServiceStart", + "text": "SavedObjectsServiceStart" + } ], "path": "x-pack/plugins/spaces/server/spaces_client/spaces_client_service.ts", "deprecated": false, @@ -4151,7 +4271,13 @@ ], "signature": [ "(request: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", baseClient: ", { "pluginId": "spaces", @@ -4182,7 +4308,13 @@ "label": "request", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "x-pack/plugins/spaces/server/spaces_client/spaces_client_service.ts", diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index 3082e647ec073..306f40a050b9d 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] --- import spacesObj from './spaces.devdocs.json'; diff --git a/api_docs/stack_alerts.devdocs.json b/api_docs/stack_alerts.devdocs.json index 9614f1ebea57d..3487776da8cd7 100644 --- a/api_docs/stack_alerts.devdocs.json +++ b/api_docs/stack_alerts.devdocs.json @@ -24,7 +24,7 @@ "signature": [ "\".index-threshold\"" ], - "path": "x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type.ts", + "path": "x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -78,7 +78,13 @@ "label": "configSchema", "description": [], "signature": [ - "ObjectType", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, "<{}>" ], "path": "x-pack/plugins/stack_alerts/common/config.ts", diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index 895b95cabf174..b53c25bd5798b 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: 2022-10-25 +date: 2022-11-07 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 092dc001056d1..96fccae5396b2 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackConnectors'] --- import stackConnectorsObj from './stack_connectors.devdocs.json'; diff --git a/api_docs/task_manager.devdocs.json b/api_docs/task_manager.devdocs.json index 41d8c4273d8de..d9497789ba816 100644 --- a/api_docs/task_manager.devdocs.json +++ b/api_docs/task_manager.devdocs.json @@ -27,9 +27,9 @@ }, " implements ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, @@ -78,9 +78,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, @@ -104,9 +104,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -140,9 +140,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -200,9 +200,9 @@ "signature": [ "({ savedObjects, elasticsearch, executionContext, }: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, @@ -228,9 +228,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } @@ -1534,7 +1534,15 @@ "TaskScheduling", ", \"schedule\" | \"runSoon\" | \"ephemeralRunNow\" | \"ensureScheduled\" | \"bulkUpdateSchedules\" | \"bulkEnable\" | \"bulkDisable\" | \"bulkSchedule\"> & Pick<", "TaskStore", - ", \"get\" | \"aggregate\" | \"fetch\" | \"remove\"> & { removeIfExists: (id: string) => Promise; } & { supportsEphemeralTasks: () => boolean; }" + ", \"get\" | \"aggregate\" | \"fetch\" | \"remove\"> & { removeIfExists: (id: string) => Promise; } & { bulkRemoveIfExist: (ids: string[]) => Promise<", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsBulkDeleteResponse", + "text": "SavedObjectsBulkDeleteResponse" + }, + " | undefined>; } & { supportsEphemeralTasks: () => boolean; getRegisteredTypes: () => string[]; }" ], "path": "x-pack/plugins/task_manager/server/plugin.ts", "deprecated": false, diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 843204fcaf20d..f1ccf87c8a607 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.devdocs.json'; diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index e6edb2ed36b3d..934a6746ca3b1 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.devdocs.json b/api_docs/telemetry_collection_manager.devdocs.json index b54d4ad1f0e44..3767cd1d23e4f 100644 --- a/api_docs/telemetry_collection_manager.devdocs.json +++ b/api_docs/telemetry_collection_manager.devdocs.json @@ -1276,7 +1276,13 @@ "label": "soClient", "description": [], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "src/plugins/telemetry_collection_manager/server/types.ts", "deprecated": false, @@ -1315,7 +1321,13 @@ "label": "logger", "description": [], "signature": [ - "Logger", + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + }, " | Console" ], "path": "src/plugins/telemetry_collection_manager/server/types.ts", diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index 7632ff82b879d..8c69601b4e2dc 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] --- import telemetryCollectionManagerObj from './telemetry_collection_manager.devdocs.json'; diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index c6a6c1d91453d..97a9200ab6cf8 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionXpack plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] --- import telemetryCollectionXpackObj from './telemetry_collection_xpack.devdocs.json'; diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index 7370b16670876..b88f1b7f20630 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: 2022-10-25 +date: 2022-11-07 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 d5d35c60068c4..537c8c1268807 100644 --- a/api_docs/threat_intelligence.devdocs.json +++ b/api_docs/threat_intelligence.devdocs.json @@ -284,7 +284,13 @@ "description": [], "signature": [ "() => ", - "Query" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + } ], "path": "x-pack/plugins/threat_intelligence/public/types.ts", "deprecated": false, @@ -301,7 +307,13 @@ "description": [], "signature": [ "() => ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "x-pack/plugins/threat_intelligence/public/types.ts", @@ -319,7 +331,13 @@ "description": [], "signature": [ "() => ", - "TimeRange" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } ], "path": "x-pack/plugins/threat_intelligence/public/types.ts", "deprecated": false, diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index 683cd251430b3..1bde1d750553a 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: 2022-10-25 +date: 2022-11-07 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 5d590998cb26b..52b1527b4a539 100644 --- a/api_docs/timelines.devdocs.json +++ b/api_docs/timelines.devdocs.json @@ -305,7 +305,13 @@ "description": [], "signature": [ "(kueryExpression: string, indexPattern: ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, ") => ", "QueryDslQueryContainer" ], @@ -336,7 +342,13 @@ "label": "indexPattern", "description": [], "signature": [ - "DataViewBase" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + } ], "path": "x-pack/plugins/timelines/public/components/utils/keury/index.ts", "deprecated": false, @@ -356,7 +368,13 @@ "description": [], "signature": [ "(kueryExpression: string, indexPattern?: ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, " | undefined) => string" ], "path": "x-pack/plugins/timelines/public/components/utils/keury/index.ts", @@ -386,7 +404,13 @@ "label": "indexPattern", "description": [], "signature": [ - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, " | undefined" ], "path": "x-pack/plugins/timelines/public/components/utils/keury/index.ts", @@ -407,13 +431,37 @@ "description": [], "signature": [ "({ config, indexPattern, queries, filters, }: { config: ", - "EsQueryConfig", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.EsQueryConfig", + "text": "EsQueryConfig" + }, "; indexPattern: ", - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, " | undefined; queries: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "[]; filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]; }) => [string, undefined] | [undefined, Error]" ], "path": "x-pack/plugins/timelines/public/components/utils/keury/index.ts", @@ -439,11 +487,29 @@ "label": "config", "description": [], "signature": [ - "KueryQueryOptions", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.KueryQueryOptions", + "text": "KueryQueryOptions" + }, " & ", - "EsQueryFiltersConfig", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.EsQueryFiltersConfig", + "text": "EsQueryFiltersConfig" + }, " & { allowLeadingWildcards?: boolean | undefined; queryStringOptions?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; }" ], "path": "x-pack/plugins/timelines/public/components/utils/keury/index.ts", @@ -458,7 +524,13 @@ "label": "indexPattern", "description": [], "signature": [ - "DataViewBase", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.DataViewBase", + "text": "DataViewBase" + }, " | undefined" ], "path": "x-pack/plugins/timelines/public/components/utils/keury/index.ts", @@ -473,7 +545,13 @@ "label": "queries", "description": [], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, "[]" ], "path": "x-pack/plugins/timelines/public/components/utils/keury/index.ts", @@ -488,7 +566,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "x-pack/plugins/timelines/public/components/utils/keury/index.ts", @@ -2763,7 +2847,13 @@ "text": "ColumnHeaderType" }, "; description?: string | null | undefined; esTypes?: string[] | undefined; example?: string | number | null | undefined; format?: string | undefined; linkField?: string | undefined; placeholder?: string | undefined; subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; type?: string | undefined; })[]" ], "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", @@ -2828,7 +2918,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined" ], "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", @@ -3221,9 +3317,21 @@ "text": "ColumnHeaderType" }, "; description?: string | null | undefined; esTypes?: string[] | undefined; example?: string | number | null | undefined; format?: string | undefined; linkField?: string | undefined; placeholder?: string | undefined; subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; type?: string | undefined; })[]; readonly title?: string | undefined; readonly filters?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; readonly dataViewId: string | null; readonly sort: ", "SortColumnTable", "[]; readonly defaultColumns: (Pick<", @@ -3241,7 +3349,13 @@ "text": "ColumnHeaderType" }, "; description?: string | null | undefined; esTypes?: string[] | undefined; example?: string | number | null | undefined; format?: string | undefined; linkField?: string | undefined; placeholder?: string | undefined; subType?: ", - "IFieldSubType", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubType", + "text": "IFieldSubType" + }, " | undefined; type?: string | undefined; })[]; readonly isLoading: boolean; readonly queryFields: string[]; readonly showCheckboxes: boolean; readonly deletedEventIds: string[]; readonly expandedDetail: Partial>; readonly graphEventId?: string | undefined; readonly indexNames: string[]; readonly isSelectAllChecked: boolean; readonly itemsPerPage: number; readonly itemsPerPageOptions: number[]; readonly loadingEventIds: string[]; readonly selectedEventIds: Record" ], "path": "x-pack/plugins/triggers_actions_ui/public/plugin.ts", @@ -97,7 +109,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, ", plugins: PluginsSetup) => ", { "pluginId": "triggersActionsUi", @@ -119,7 +137,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/public/plugin.ts", @@ -378,7 +402,13 @@ "description": [], "signature": [ "({\n ids,\n http,\n}: { ids: string[]; http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise<{ successes: string[]; errors: string[]; }>" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/delete.ts", @@ -418,7 +448,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/delete.ts", "deprecated": false, @@ -439,7 +475,13 @@ "description": [], "signature": [ "({ id, http }: { id: string; http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/disable.ts", @@ -476,7 +518,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/disable.ts", "deprecated": false, @@ -531,7 +579,13 @@ "description": [], "signature": [ "({ id, http }: { id: string; http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/enable.ts", @@ -568,7 +622,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/enable.ts", "deprecated": false, @@ -623,7 +683,13 @@ "description": [], "signature": [ "(http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, ", indexes: string[]) => Promise<{ name: string; type: string; normalizedType: string; searchable: boolean; aggregatable: boolean; }[]>" ], "path": "x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts", @@ -638,7 +704,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts", "deprecated": false, @@ -673,7 +745,13 @@ "description": [], "signature": [ "(http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, ", pattern: string) => Promise<", "IOption", "[]>" @@ -690,7 +768,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts", "deprecated": false, @@ -784,7 +868,7 @@ "section": "def-public.TIME_UNITS", "text": "TIME_UNITS" }, - ", timeValue: string) => string" + ", timeValue: string) => any" ], "path": "x-pack/plugins/triggers_actions_ui/public/common/lib/get_time_unit_label.ts", "deprecated": false, @@ -1011,10 +1095,16 @@ "label": "loadActionErrorLog", "description": [], "signature": [ - "({ id, http, dateStart, dateEnd, runId, message, perPage, page, sort, }: ", + "({ id, http, dateStart, dateEnd, runId, message, perPage, page, sort, namespace, withAuth, }: ", "LoadActionErrorLogProps", " & { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise<", { "pluginId": "alerting", @@ -1034,12 +1124,18 @@ "id": "def-public.loadActionErrorLog.$1", "type": "CompoundType", "tags": [], - "label": "{\n id,\n http,\n dateStart,\n dateEnd,\n runId,\n message,\n perPage = 10,\n page = 0,\n sort,\n}", + "label": "{\n id,\n http,\n dateStart,\n dateEnd,\n runId,\n message,\n perPage = 10,\n page = 0,\n sort,\n namespace,\n withAuth = false,\n}", "description": [], "signature": [ "LoadActionErrorLogProps", " & { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.ts", @@ -1060,7 +1156,13 @@ "description": [], "signature": [ "({\n http,\n featureId,\n}: { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; featureId?: string | undefined; }) => Promise<", { "pluginId": "actions", @@ -1094,7 +1196,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api/connector_types.ts", "deprecated": false, @@ -1129,7 +1237,13 @@ "description": [], "signature": [ "({ http }: { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise<", { "pluginId": "triggersActionsUi", @@ -1163,7 +1277,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api/connectors.ts", "deprecated": false, @@ -1186,7 +1306,13 @@ "({ id, http, dateStart, dateEnd, outcomeFilter, message, perPage, page, sort, }: ", "LoadExecutionLogAggregationsProps", " & { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise<", { "pluginId": "alerting", @@ -1211,7 +1337,13 @@ "signature": [ "LoadExecutionLogAggregationsProps", " & { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts", @@ -1232,7 +1364,13 @@ "description": [], "signature": [ "({\n http,\n ruleId,\n}: { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; ruleId: string; }) => Promise<", { "pluginId": "triggersActionsUi", @@ -1274,7 +1412,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_rule.ts", "deprecated": false, @@ -1394,7 +1538,13 @@ "description": [], "signature": [ "({\n http,\n ruleId,\n numberOfExecutions,\n}: { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; ruleId: string; numberOfExecutions?: number | undefined; }) => Promise<", { "pluginId": "alerting", @@ -1428,7 +1578,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_summary.ts", "deprecated": false, @@ -1474,7 +1630,13 @@ "description": [], "signature": [ "({ http }: { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise<", "RuleTagsAggregations", ">" @@ -1502,7 +1664,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts", "deprecated": false, @@ -1523,7 +1691,13 @@ "description": [], "signature": [ "({ http }: { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise<", { "pluginId": "triggersActionsUi", @@ -1557,7 +1731,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_types.ts", "deprecated": false, @@ -1611,7 +1791,13 @@ "description": [], "signature": [ "({ id, http }: { id: string; http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute.ts", @@ -1648,7 +1834,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute.ts", "deprecated": false, @@ -1769,7 +1961,13 @@ "({\n id,\n snoozeSchedule,\n http,\n}: { id: string; snoozeSchedule: ", "SnoozeSchedule", "; http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/snooze.ts", @@ -1820,7 +2018,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/snooze.ts", "deprecated": false, @@ -2036,7 +2240,13 @@ "description": [], "signature": [ "({ id, http }: { id: string; http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; }) => Promise" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute.ts", @@ -2073,7 +2283,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute.ts", "deprecated": false, @@ -2094,7 +2310,13 @@ "description": [], "signature": [ "({\n id,\n http,\n scheduleIds,\n}: { id: string; http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; scheduleIds?: string[] | undefined; }) => Promise" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unsnooze.ts", @@ -2131,7 +2353,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unsnooze.ts", "deprecated": false, @@ -2166,7 +2394,13 @@ "description": [], "signature": [ "({\n http,\n connector,\n id,\n}: { http: ", - "HttpSetup", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, "; connector: Pick<", "ActionConnectorWithoutId", ", Record>, \"name\" | \"config\" | \"secrets\">; id: string; }) => Promise<", @@ -2202,7 +2436,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api/update.ts", "deprecated": false, @@ -2317,7 +2557,13 @@ "text": "KibanaReactContextValue" }, " & ", { "pluginId": "triggersActionsUi", @@ -2530,7 +2776,13 @@ "description": [], "signature": [ "(key: string, value: ", - "SavedObjectAttribute", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttribute", + "text": "SavedObjectAttribute" + }, ", index: number) => void" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", @@ -2560,7 +2812,13 @@ "label": "value", "description": [], "signature": [ - "SavedObjectAttribute" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttribute", + "text": "SavedObjectAttribute" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false, @@ -3141,7 +3399,7 @@ "description": [], "signature": [ "BasicFields", - " & { tags?: string[] | undefined; kibana?: string[] | undefined; \"@timestamp\"?: string[] | undefined; \"kibana.alert.rule.rule_type_id\"?: string[] | undefined; \"kibana.alert.rule.consumer\"?: string[] | undefined; \"event.action\"?: string[] | undefined; \"kibana.alert.rule.execution.uuid\"?: string[] | undefined; \"kibana.alert.rule.parameters\"?: string[] | undefined; \"kibana.alert.rule.producer\"?: string[] | undefined; \"kibana.space_ids\"?: string[] | undefined; \"kibana.alert.uuid\"?: string[] | undefined; \"kibana.alert.instance.id\"?: string[] | undefined; \"kibana.alert.start\"?: string[] | undefined; \"kibana.alert.time_range\"?: string[] | undefined; \"kibana.alert.end\"?: string[] | undefined; \"kibana.alert.duration.us\"?: string[] | undefined; \"kibana.alert.severity\"?: string[] | undefined; \"kibana.alert.status\"?: string[] | undefined; \"kibana.version\"?: string[] | undefined; \"ecs.version\"?: string[] | undefined; \"kibana.alert.risk_score\"?: string[] | undefined; \"kibana.alert.workflow_status\"?: string[] | undefined; \"kibana.alert.workflow_user\"?: string[] | undefined; \"kibana.alert.workflow_reason\"?: string[] | undefined; \"kibana.alert.system_status\"?: string[] | undefined; \"kibana.alert.action_group\"?: string[] | undefined; \"kibana.alert.reason\"?: string[] | undefined; \"kibana.alert.rule.author\"?: string[] | undefined; \"kibana.alert.rule.category\"?: string[] | undefined; \"kibana.alert.rule.uuid\"?: string[] | undefined; \"kibana.alert.rule.created_at\"?: string[] | undefined; \"kibana.alert.rule.created_by\"?: string[] | undefined; \"kibana.alert.rule.description\"?: string[] | undefined; \"kibana.alert.rule.enabled\"?: string[] | undefined; \"kibana.alert.rule.from\"?: string[] | undefined; \"kibana.alert.rule.interval\"?: string[] | undefined; \"kibana.alert.rule.license\"?: string[] | undefined; \"kibana.alert.rule.name\"?: string[] | undefined; \"kibana.alert.rule.note\"?: string[] | undefined; \"kibana.alert.rule.references\"?: string[] | undefined; \"kibana.alert.rule.rule_id\"?: string[] | undefined; \"kibana.alert.rule.rule_name_override\"?: string[] | undefined; \"kibana.alert.rule.tags\"?: string[] | undefined; \"kibana.alert.rule.to\"?: string[] | undefined; \"kibana.alert.rule.type\"?: string[] | undefined; \"kibana.alert.rule.updated_at\"?: string[] | undefined; \"kibana.alert.rule.updated_by\"?: string[] | undefined; \"kibana.alert.rule.version\"?: string[] | undefined; \"event.kind\"?: string[] | undefined; \"event.module\"?: string[] | undefined; \"kibana.alert.evaluation.threshold\"?: string[] | undefined; \"kibana.alert.evaluation.value\"?: string[] | undefined; \"kibana.alert.building_block_type\"?: string[] | undefined; \"kibana.alert.rule.exceptions_list\"?: string[] | undefined; \"kibana.alert.rule.namespace\"?: string[] | undefined; \"kibana.alert\"?: string[] | undefined; \"kibana.alert.rule\"?: string[] | undefined; } & { [x: string]: unknown[]; }" + " & { tags?: string[] | undefined; kibana?: string[] | undefined; \"@timestamp\"?: string[] | undefined; \"kibana.alert.rule.rule_type_id\"?: string[] | undefined; \"kibana.alert.rule.consumer\"?: string[] | undefined; \"event.action\"?: string[] | undefined; \"kibana.alert.rule.execution.uuid\"?: string[] | undefined; \"kibana.alert\"?: string[] | undefined; \"kibana.alert.rule\"?: string[] | undefined; \"kibana.alert.rule.parameters\"?: string[] | undefined; \"kibana.alert.rule.producer\"?: string[] | undefined; \"kibana.space_ids\"?: string[] | undefined; \"kibana.alert.uuid\"?: string[] | undefined; \"kibana.alert.instance.id\"?: string[] | undefined; \"kibana.alert.start\"?: string[] | undefined; \"kibana.alert.time_range\"?: string[] | undefined; \"kibana.alert.end\"?: string[] | undefined; \"kibana.alert.duration.us\"?: string[] | undefined; \"kibana.alert.severity\"?: string[] | undefined; \"kibana.alert.status\"?: string[] | undefined; \"kibana.version\"?: string[] | undefined; \"ecs.version\"?: string[] | undefined; \"kibana.alert.risk_score\"?: string[] | undefined; \"kibana.alert.workflow_status\"?: string[] | undefined; \"kibana.alert.workflow_user\"?: string[] | undefined; \"kibana.alert.workflow_reason\"?: string[] | undefined; \"kibana.alert.system_status\"?: string[] | undefined; \"kibana.alert.action_group\"?: string[] | undefined; \"kibana.alert.reason\"?: string[] | undefined; \"kibana.alert.rule.author\"?: string[] | undefined; \"kibana.alert.rule.category\"?: string[] | undefined; \"kibana.alert.rule.uuid\"?: string[] | undefined; \"kibana.alert.rule.created_at\"?: string[] | undefined; \"kibana.alert.rule.created_by\"?: string[] | undefined; \"kibana.alert.rule.description\"?: string[] | undefined; \"kibana.alert.rule.enabled\"?: string[] | undefined; \"kibana.alert.rule.from\"?: string[] | undefined; \"kibana.alert.rule.interval\"?: string[] | undefined; \"kibana.alert.rule.license\"?: string[] | undefined; \"kibana.alert.rule.name\"?: string[] | undefined; \"kibana.alert.rule.note\"?: string[] | undefined; \"kibana.alert.rule.references\"?: string[] | undefined; \"kibana.alert.rule.rule_id\"?: string[] | undefined; \"kibana.alert.rule.rule_name_override\"?: string[] | undefined; \"kibana.alert.rule.tags\"?: string[] | undefined; \"kibana.alert.rule.to\"?: string[] | undefined; \"kibana.alert.rule.type\"?: string[] | undefined; \"kibana.alert.rule.updated_at\"?: string[] | undefined; \"kibana.alert.rule.updated_by\"?: string[] | undefined; \"kibana.alert.rule.version\"?: string[] | undefined; \"event.kind\"?: string[] | undefined; \"event.module\"?: string[] | undefined; \"kibana.alert.evaluation.threshold\"?: string[] | undefined; \"kibana.alert.evaluation.value\"?: string[] | undefined; \"kibana.alert.building_block_type\"?: string[] | undefined; \"kibana.alert.rule.exceptions_list\"?: string[] | undefined; \"kibana.alert.rule.namespace\"?: string[] | undefined; \"kibana.alert.rule.threat.framework\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.id\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.name\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.reference\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.id\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.name\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.reference\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.id\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.name\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.reference\"?: string[] | undefined; } & { [x: string]: unknown[]; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false, @@ -4250,7 +4508,13 @@ "label": "params", "description": [], "signature": [ - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "x-pack/plugins/alerting/common/rule.ts", "deprecated": false, @@ -4874,7 +5138,13 @@ "description": [], "signature": [ "string | ((docLinks: ", - "DocLinksStart", + { + "pluginId": "@kbn/core-doc-links-browser", + "scope": "common", + "docId": "kibKbnCoreDocLinksBrowserPluginApi", + "section": "def-common.DocLinksStart", + "text": "DocLinksStart" + }, ") => string) | null" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", @@ -5373,7 +5643,13 @@ "text": "TriggersAndActionsUiServices" }, " extends ", - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/application/app.tsx", "deprecated": false, @@ -5719,7 +5995,13 @@ "label": "history", "description": [], "signature": [ - "ScopedHistory", + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ScopedHistory", + "text": "ScopedHistory" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/app.tsx", @@ -5771,7 +6053,13 @@ "signature": [ "Observable", "<", - "CoreTheme", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "common", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-common.CoreTheme", + "text": "CoreTheme" + }, ">" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/app.tsx", @@ -6102,10 +6390,13 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.connectorDeprecatedMessage", - "type": "string", + "type": "Any", "tags": [], "label": "connectorDeprecatedMessage", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/triggers_actions_ui/public/common/connectors_selection.tsx", "deprecated": false, "trackAdoption": false, @@ -6135,10 +6426,13 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.deprecatedMessage", - "type": "string", + "type": "Any", "tags": [], "label": "deprecatedMessage", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/triggers_actions_ui/public/common/connectors_selection.tsx", "deprecated": false, "trackAdoption": false, @@ -6699,10 +6993,13 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.builtInComparators.COMPARATORS.GREATER_THAN.text", - "type": "string", + "type": "Any", "tags": [], "label": "text", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/triggers_actions_ui/public/common/constants/comparators.ts", "deprecated": false, "trackAdoption": false @@ -6754,10 +7051,13 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.builtInComparators.COMPARATORS.GREATER_THAN_OR_EQUALS.text", - "type": "string", + "type": "Any", "tags": [], "label": "text", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/triggers_actions_ui/public/common/constants/comparators.ts", "deprecated": false, "trackAdoption": false @@ -6809,10 +7109,13 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.builtInComparators.COMPARATORS.LESS_THAN.text", - "type": "string", + "type": "Any", "tags": [], "label": "text", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/triggers_actions_ui/public/common/constants/comparators.ts", "deprecated": false, "trackAdoption": false @@ -6864,10 +7167,13 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.builtInComparators.COMPARATORS.LESS_THAN_OR_EQUALS.text", - "type": "string", + "type": "Any", "tags": [], "label": "text", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/triggers_actions_ui/public/common/constants/comparators.ts", "deprecated": false, "trackAdoption": false @@ -6919,10 +7225,13 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.builtInComparators.COMPARATORS.BETWEEN.text", - "type": "string", + "type": "Any", "tags": [], "label": "text", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/triggers_actions_ui/public/common/constants/comparators.ts", "deprecated": false, "trackAdoption": false @@ -6988,10 +7297,13 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.builtInGroupByTypes.all.text", - "type": "string", + "type": "Any", "tags": [], "label": "text", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/triggers_actions_ui/public/common/constants/group_by_types.ts", "deprecated": false, "trackAdoption": false @@ -7051,10 +7363,13 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.builtInGroupByTypes.top.text", - "type": "string", + "type": "Any", "tags": [], "label": "text", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/triggers_actions_ui/public/common/constants/group_by_types.ts", "deprecated": false, "trackAdoption": false @@ -7117,10 +7432,13 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.firstFieldOption.text", - "type": "string", + "type": "Any", "tags": [], "label": "text", "description": [], + "signature": [ + "any" + ], "path": "x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts", "deprecated": false, "trackAdoption": false @@ -8268,7 +8586,13 @@ "// name of the indices to search" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts", @@ -8285,7 +8609,13 @@ "// field in index used for date/time" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts", @@ -8302,7 +8632,13 @@ "// aggregation type" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts", @@ -8319,7 +8655,13 @@ "// aggregation field" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts", @@ -8336,7 +8678,13 @@ "// how to group" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts", @@ -8353,7 +8701,13 @@ "// field to group on (for groupBy: top)" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts", @@ -8370,7 +8724,13 @@ "// filter field" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts", @@ -8387,7 +8747,13 @@ "// limit on number of groups returned" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts", @@ -8404,7 +8770,13 @@ "// size of time window for date range aggregations" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts", @@ -8421,7 +8793,13 @@ "// units of time window for date range aggregations" ], "signature": [ - "Type", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, "" ], "path": "x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts", diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index 252ab38f8c885..7753c86f7dc3e 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 518 | 1 | 489 | 49 | +| 518 | 11 | 489 | 49 | ## Client diff --git a/api_docs/ui_actions.devdocs.json b/api_docs/ui_actions.devdocs.json index d224e96cb9e8a..6b4184d529883 100644 --- a/api_docs/ui_actions.devdocs.json +++ b/api_docs/ui_actions.devdocs.json @@ -2141,7 +2141,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">> | undefined; runtimeFieldMap?: Record ", { "pluginId": "uiActionsEnhanced", @@ -1051,7 +1063,13 @@ "label": "references", "description": [], "signature": [ - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]" ], "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", @@ -1081,7 +1099,13 @@ "text": "AdvancedUiActionsPublicPlugin" }, " implements ", - "Plugin", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.Plugin", + "text": "Plugin" + }, "<", { "pluginId": "uiActionsEnhanced", @@ -1145,7 +1169,13 @@ "label": "initializerContext", "description": [], "signature": [ - "PluginInitializerContext", + { + "pluginId": "@kbn/core-plugins-browser", + "scope": "common", + "docId": "kibKbnCorePluginsBrowserPluginApi", + "section": "def-common.PluginInitializerContext", + "text": "PluginInitializerContext" + }, "" ], "path": "src/plugins/ui_actions_enhanced/public/plugin.ts", @@ -1165,7 +1195,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", "StartDependencies", ", unknown>, { embeddable, uiActions, licensing }: SetupDependencies) => ", @@ -1189,7 +1225,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<", "StartDependencies", ", unknown>" @@ -1226,7 +1268,13 @@ "description": [], "signature": [ "(core: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ", { uiActions, licensing }: ", "StartDependencies", ") => ", @@ -1250,7 +1298,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/ui_actions_enhanced/public/plugin.ts", "deprecated": false, @@ -1628,7 +1682,13 @@ "text": "SerializedAction" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">, triggers: string[]) => Promise" ], "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/dynamic_action_manager.ts", @@ -1653,7 +1713,13 @@ "text": "SerializedAction" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/dynamic_action_manager.ts", @@ -1700,7 +1766,13 @@ "text": "SerializedAction" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">, triggers: string[]) => Promise" ], "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/dynamic_action_manager.ts", @@ -1742,7 +1814,13 @@ "text": "SerializedAction" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/dynamic_action_manager.ts", @@ -1932,7 +2010,13 @@ "text": "SerializedAction" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">; }[]>" ], "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/dynamic_action_storage.ts", @@ -3264,7 +3348,13 @@ "text": "ActionFactory" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ", object, ", { "pluginId": "uiActionsEnhanced", @@ -3417,7 +3507,13 @@ "label": "BaseActionConfig", "description": [], "signature": [ - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/ui_actions_enhanced/common/types.ts", "deprecated": false, @@ -3496,7 +3592,13 @@ "text": "SerializedAction" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">; }" ], "path": "src/plugins/ui_actions_enhanced/common/types.ts", @@ -3657,9 +3759,9 @@ }, " implements ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, @@ -3733,9 +3835,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -3770,9 +3872,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -4001,7 +4103,13 @@ "label": "BaseActionConfig", "description": [], "signature": [ - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/ui_actions_enhanced/common/types.ts", "deprecated": false, @@ -4065,7 +4173,13 @@ "text": "SerializedAction" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">; }" ], "path": "src/plugins/ui_actions_enhanced/common/types.ts", @@ -4184,7 +4298,13 @@ "label": "BaseActionConfig", "description": [], "signature": [ - "SerializableRecord" + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/ui_actions_enhanced/common/types.ts", "deprecated": false, @@ -4248,7 +4368,13 @@ "text": "SerializedAction" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">; }" ], "path": "src/plugins/ui_actions_enhanced/common/types.ts", diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 2bfb0f9c70e8d..cb292b5ac63f8 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] --- import uiActionsEnhancedObj from './ui_actions_enhanced.devdocs.json'; diff --git a/api_docs/unified_field_list.devdocs.json b/api_docs/unified_field_list.devdocs.json index ac91e0235c30c..2434cfac2a6d7 100644 --- a/api_docs/unified_field_list.devdocs.json +++ b/api_docs/unified_field_list.devdocs.json @@ -3,6 +3,63 @@ "client": { "classes": [], "functions": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGrouped", + "type": "Function", + "tags": [], + "label": "FieldListGrouped", + "description": [], + "signature": [ + "(props: ", + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.FieldListGroupedProps", + "text": "FieldListGroupedProps" + }, + ") => JSX.Element" + ], + "path": "src/plugins/unified_field_list/public/components/field_list/index.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGrouped.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.FieldListGroupedProps", + "text": "FieldListGroupedProps" + }, + "" + ], + "path": "src/plugins/unified_field_list/public/components/field_list/index.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "unifiedFieldList", "id": "def-public.FieldPopover", @@ -427,9 +484,9 @@ "label": "loadFieldExisting", "description": [], "signature": [ - "({\n data,\n dslQuery,\n fromDate,\n toDate,\n timeFieldName,\n dataViewsService,\n uiSettingsClient,\n dataView,\n}: FetchFieldExistenceParams) => Promise<{ indexPatternTitle: string; existingFieldNames: string[]; }>" + "(params: FetchFieldExistenceParams) => Promise<{ existingFieldNames: string[]; indexPatternTitle: string; }>" ], - "path": "src/plugins/unified_field_list/public/services/field_existing/load_field_existing.ts", + "path": "src/plugins/unified_field_list/public/services/field_existing/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -438,12 +495,12 @@ "id": "def-public.loadFieldExisting.$1", "type": "Object", "tags": [], - "label": "{\n data,\n dslQuery,\n fromDate,\n toDate,\n timeFieldName,\n dataViewsService,\n uiSettingsClient,\n dataView,\n}", + "label": "params", "description": [], "signature": [ "FetchFieldExistenceParams" ], - "path": "src/plugins/unified_field_list/public/services/field_existing/load_field_existing.ts", + "path": "src/plugins/unified_field_list/public/services/field_existing/index.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -487,6 +544,23 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.resetExistingFieldsCache", + "type": "Function", + "tags": [], + "label": "resetExistingFieldsCache", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "unifiedFieldList", "id": "def-public.triggerVisualizeActions", @@ -648,7 +722,13 @@ "text": "DataView" }, " | undefined, query: ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined) => void" ], "path": "src/plugins/unified_field_list/public/components/field_visualize_button/visualize_trigger_utils.ts", @@ -736,7 +816,13 @@ "label": "query", "description": [], "signature": [ - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined" ], "path": "src/plugins/unified_field_list/public/components/field_visualize_button/visualize_trigger_utils.ts", @@ -747,6 +833,141 @@ ], "returnComment": [], "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.useExistingFieldsFetcher", + "type": "Function", + "tags": [], + "label": "useExistingFieldsFetcher", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.ExistingFieldsFetcherParams", + "text": "ExistingFieldsFetcherParams" + }, + ") => ", + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.ExistingFieldsFetcher", + "text": "ExistingFieldsFetcher" + } + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.useExistingFieldsFetcher.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.ExistingFieldsFetcherParams", + "text": "ExistingFieldsFetcherParams" + } + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.useExistingFieldsReader", + "type": "Function", + "tags": [], + "label": "useExistingFieldsReader", + "description": [], + "signature": [ + "() => { hasFieldData: (dataViewId: string, fieldName: string) => boolean; getFieldsExistenceStatus: (dataViewId: string) => ", + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.ExistenceFetchStatus", + "text": "ExistenceFetchStatus" + }, + "; isFieldsExistenceInfoUnavailable: (dataViewId: string) => boolean; }" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.useGroupedFields", + "type": "Function", + "tags": [], + "label": "useGroupedFields", + "description": [], + "signature": [ + "({\n dataViewId,\n allFields,\n services,\n fieldsExistenceReader,\n onOverrideFieldGroupDetails,\n onSupportedFieldFilter,\n onSelectedFieldFilter,\n onFilterField,\n}: ", + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.GroupedFieldsParams", + "text": "GroupedFieldsParams" + }, + ") => ", + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.GroupedFieldsResult", + "text": "GroupedFieldsResult" + }, + "" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.useGroupedFields.$1", + "type": "Object", + "tags": [], + "label": "{\n dataViewId,\n allFields,\n services,\n fieldsExistenceReader,\n onOverrideFieldGroupDetails,\n onSupportedFieldFilter,\n onSelectedFieldFilter,\n onFilterField,\n}", + "description": [], + "signature": [ + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.GroupedFieldsParams", + "text": "GroupedFieldsParams" + }, + "" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false } ], "interfaces": [ @@ -784,105 +1005,681 @@ }, { "parentPluginId": "unifiedFieldList", - "id": "def-public.FieldPopoverHeaderProps", + "id": "def-public.ExistingFieldsFetcher", "type": "Interface", "tags": [], - "label": "FieldPopoverHeaderProps", + "label": "ExistingFieldsFetcher", "description": [], - "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "unifiedFieldList", - "id": "def-public.FieldPopoverHeaderProps.field", - "type": "Object", + "id": "def-public.ExistingFieldsFetcher.refetchFieldsExistenceInfo", + "type": "Function", "tags": [], - "label": "field", + "label": "refetchFieldsExistenceInfo", "description": [], "signature": [ + "(dataViewId?: string | undefined) => Promise" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewField", - "text": "DataViewField" + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsFetcher.refetchFieldsExistenceInfo.$1", + "type": "string", + "tags": [], + "label": "dataViewId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false } ], - "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", - "deprecated": false, - "trackAdoption": false + "returnComment": [] }, { "parentPluginId": "unifiedFieldList", - "id": "def-public.FieldPopoverHeaderProps.closePopover", - "type": "Function", + "id": "def-public.ExistingFieldsFetcher.isProcessing", + "type": "boolean", "tags": [], - "label": "closePopover", + "label": "isProcessing", "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [] - }, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsFetcherParams", + "type": "Interface", + "tags": [], + "label": "ExistingFieldsFetcherParams", + "description": [], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "unifiedFieldList", - "id": "def-public.FieldPopoverHeaderProps.buttonAddFieldToWorkspaceProps", - "type": "Object", + "id": "def-public.ExistingFieldsFetcherParams.dataViews", + "type": "Array", "tags": [], - "label": "buttonAddFieldToWorkspaceProps", + "label": "dataViews", "description": [], "signature": [ - "Partial<", - "EuiButtonIconProps", - "> | undefined" + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + "[]" ], - "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "unifiedFieldList", - "id": "def-public.FieldPopoverHeaderProps.buttonAddFilterProps", - "type": "Object", + "id": "def-public.ExistingFieldsFetcherParams.fromDate", + "type": "string", "tags": [], - "label": "buttonAddFilterProps", + "label": "fromDate", "description": [], - "signature": [ - "Partial<", - "EuiButtonIconProps", - "> | undefined" - ], - "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "unifiedFieldList", - "id": "def-public.FieldPopoverHeaderProps.buttonEditFieldProps", - "type": "Object", + "id": "def-public.ExistingFieldsFetcherParams.toDate", + "type": "string", "tags": [], - "label": "buttonEditFieldProps", + "label": "toDate", "description": [], - "signature": [ - "Partial<", - "EuiButtonIconProps", - "> | undefined" - ], - "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "unifiedFieldList", - "id": "def-public.FieldPopoverHeaderProps.buttonDeleteFieldProps", - "type": "Object", + "id": "def-public.ExistingFieldsFetcherParams.query", + "type": "CompoundType", "tags": [], - "label": "buttonDeleteFieldProps", + "label": "query", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, + " | ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + } + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsFetcherParams.filters", + "type": "Array", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsFetcherParams.services", + "type": "Object", + "tags": [], + "label": "services", + "description": [], + "signature": [ + "{ core: Pick<", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, + ", \"uiSettings\">; data: ", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataPluginApi", + "section": "def-public.DataPublicPluginStart", + "text": "DataPublicPluginStart" + }, + "; dataViews: ", + { + "pluginId": "dataViews", + "scope": "public", + "docId": "kibDataViewsPluginApi", + "section": "def-public.DataViewsServicePublic", + "text": "DataViewsServicePublic" + }, + "; }" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsFetcherParams.onNoData", + "type": "Function", + "tags": [], + "label": "onNoData", + "description": [], + "signature": [ + "((dataViewId: string) => unknown) | undefined" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsFetcherParams.onNoData.$1", + "type": "string", + "tags": [], + "label": "dataViewId", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsInfo", + "type": "Interface", + "tags": [], + "label": "ExistingFieldsInfo", + "description": [], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsInfo.fetchStatus", + "type": "Enum", + "tags": [], + "label": "fetchStatus", + "description": [], + "signature": [ + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.ExistenceFetchStatus", + "text": "ExistenceFetchStatus" + } + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsInfo.existingFieldsByFieldNameMap", + "type": "Object", + "tags": [], + "label": "existingFieldsByFieldNameMap", + "description": [], + "signature": [ + "{ [x: string]: boolean; }" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsInfo.numberOfFetches", + "type": "number", + "tags": [], + "label": "numberOfFetches", + "description": [], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsInfo.hasDataViewRestrictions", + "type": "CompoundType", + "tags": [], + "label": "hasDataViewRestrictions", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsReader", + "type": "Interface", + "tags": [], + "label": "ExistingFieldsReader", + "description": [], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsReader.hasFieldData", + "type": "Function", + "tags": [], + "label": "hasFieldData", + "description": [], + "signature": [ + "(dataViewId: string, fieldName: string) => boolean" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsReader.hasFieldData.$1", + "type": "string", + "tags": [], + "label": "dataViewId", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsReader.hasFieldData.$2", + "type": "string", + "tags": [], + "label": "fieldName", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsReader.getFieldsExistenceStatus", + "type": "Function", + "tags": [], + "label": "getFieldsExistenceStatus", + "description": [], + "signature": [ + "(dataViewId: string) => ", + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.ExistenceFetchStatus", + "text": "ExistenceFetchStatus" + } + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsReader.getFieldsExistenceStatus.$1", + "type": "string", + "tags": [], + "label": "dataViewId", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsReader.isFieldsExistenceInfoUnavailable", + "type": "Function", + "tags": [], + "label": "isFieldsExistenceInfoUnavailable", + "description": [], + "signature": [ + "(dataViewId: string) => boolean" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistingFieldsReader.isFieldsExistenceInfoUnavailable.$1", + "type": "string", + "tags": [], + "label": "dataViewId", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_existing_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGroupedProps", + "type": "Interface", + "tags": [], + "label": "FieldListGroupedProps", + "description": [], + "signature": [ + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.FieldListGroupedProps", + "text": "FieldListGroupedProps" + }, + "" + ], + "path": "src/plugins/unified_field_list/public/components/field_list/field_list_grouped.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGroupedProps.fieldGroups", + "type": "Object", + "tags": [], + "label": "fieldGroups", + "description": [], + "signature": [ + "{ SpecialFields?: ", + "FieldsGroup", + " | undefined; SelectedFields?: ", + "FieldsGroup", + " | undefined; AvailableFields?: ", + "FieldsGroup", + " | undefined; EmptyFields?: ", + "FieldsGroup", + " | undefined; MetaFields?: ", + "FieldsGroup", + " | undefined; }" + ], + "path": "src/plugins/unified_field_list/public/components/field_list/field_list_grouped.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGroupedProps.fieldsExistenceStatus", + "type": "Enum", + "tags": [], + "label": "fieldsExistenceStatus", + "description": [], + "signature": [ + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.ExistenceFetchStatus", + "text": "ExistenceFetchStatus" + } + ], + "path": "src/plugins/unified_field_list/public/components/field_list/field_list_grouped.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGroupedProps.fieldsExistInIndex", + "type": "boolean", + "tags": [], + "label": "fieldsExistInIndex", + "description": [], + "path": "src/plugins/unified_field_list/public/components/field_list/field_list_grouped.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGroupedProps.renderFieldItem", + "type": "Function", + "tags": [], + "label": "renderFieldItem", + "description": [], + "signature": [ + "(params: { field: T; hideDetails?: boolean | undefined; itemIndex: number; groupIndex: number; }) => JSX.Element" + ], + "path": "src/plugins/unified_field_list/public/components/field_list/field_list_grouped.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGroupedProps.renderFieldItem.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "{ field: T; hideDetails?: boolean | undefined; itemIndex: number; groupIndex: number; }" + ], + "path": "src/plugins/unified_field_list/public/components/field_list/fields_accordion.tsx", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGroupedProps.screenReaderDescriptionForSearchInputId", + "type": "string", + "tags": [], + "label": "screenReaderDescriptionForSearchInputId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/unified_field_list/public/components/field_list/field_list_grouped.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGroupedProps.datatestsubj", + "type": "string", + "tags": [], + "label": "'data-test-subj'", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/unified_field_list/public/components/field_list/field_list_grouped.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldPopoverHeaderProps", + "type": "Interface", + "tags": [], + "label": "FieldPopoverHeaderProps", + "description": [], + "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldPopoverHeaderProps.field", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + } + ], + "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldPopoverHeaderProps.closePopover", + "type": "Function", + "tags": [], + "label": "closePopover", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldPopoverHeaderProps.buttonAddFieldToWorkspaceProps", + "type": "Object", + "tags": [], + "label": "buttonAddFieldToWorkspaceProps", + "description": [], + "signature": [ + "Partial<", + "EuiButtonIconProps", + "> | undefined" + ], + "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldPopoverHeaderProps.buttonAddFilterProps", + "type": "Object", + "tags": [], + "label": "buttonAddFilterProps", + "description": [], + "signature": [ + "Partial<", + "EuiButtonIconProps", + "> | undefined" + ], + "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldPopoverHeaderProps.buttonEditFieldProps", + "type": "Object", + "tags": [], + "label": "buttonEditFieldProps", + "description": [], + "signature": [ + "Partial<", + "EuiButtonIconProps", + "> | undefined" + ], + "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover_header.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldPopoverHeaderProps.buttonDeleteFieldProps", + "type": "Object", + "tags": [], + "label": "buttonDeleteFieldProps", "description": [], "signature": [ "Partial<", @@ -1077,9 +1874,134 @@ ], "path": "src/plugins/unified_field_list/public/components/field_popover/field_popover.tsx", "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupDetails", + "type": "Interface", + "tags": [], + "label": "FieldsGroupDetails", + "description": [], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupDetails.showInAccordion", + "type": "boolean", + "tags": [], + "label": "showInAccordion", + "description": [], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupDetails.isInitiallyOpen", + "type": "boolean", + "tags": [], + "label": "isInitiallyOpen", + "description": [], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupDetails.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupDetails.helpText", + "type": "string", + "tags": [], + "label": "helpText", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupDetails.isAffectedByGlobalFilter", + "type": "boolean", + "tags": [], + "label": "isAffectedByGlobalFilter", + "description": [], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupDetails.isAffectedByTimeFilter", + "type": "boolean", + "tags": [], + "label": "isAffectedByTimeFilter", + "description": [], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupDetails.hideDetails", + "type": "CompoundType", + "tags": [], + "label": "hideDetails", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupDetails.defaultNoFieldsMessage", + "type": "string", + "tags": [], + "label": "defaultNoFieldsMessage", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupDetails.hideIfEmpty", + "type": "CompoundType", + "tags": [], + "label": "hideIfEmpty", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -1123,9 +2045,21 @@ "label": "query", "description": [], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + } ], "path": "src/plugins/unified_field_list/public/components/field_stats/field_stats.tsx", "deprecated": false, @@ -1139,7 +2073,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/unified_field_list/public/components/field_stats/field_stats.tsx", @@ -1245,7 +2185,7 @@ "label": "overrideMissingContent", "description": [], "signature": [ - "((params: { element: JSX.Element; noDataFound?: boolean | undefined; }) => JSX.Element | null) | undefined" + "((params: { element: JSX.Element; reason: \"no-data\" | \"unsupported\"; }) => JSX.Element | null) | undefined" ], "path": "src/plugins/unified_field_list/public/components/field_stats/field_stats.tsx", "deprecated": false, @@ -1278,13 +2218,13 @@ }, { "parentPluginId": "unifiedFieldList", - "id": "def-public.FieldStatsProps.overrideMissingContent.$1.noDataFound", + "id": "def-public.FieldStatsProps.overrideMissingContent.$1.reason", "type": "CompoundType", "tags": [], - "label": "noDataFound", + "label": "reason", "description": [], "signature": [ - "boolean | undefined" + "\"no-data\" | \"unsupported\"" ], "path": "src/plugins/unified_field_list/public/components/field_stats/field_stats.tsx", "deprecated": false, @@ -1500,7 +2440,13 @@ "label": "uiSettings", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "src/plugins/unified_field_list/public/components/field_stats/field_stats.tsx", "deprecated": false, @@ -1886,6 +2832,299 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams", + "type": "Interface", + "tags": [], + "label": "GroupedFieldsParams", + "description": [], + "signature": [ + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.GroupedFieldsParams", + "text": "GroupedFieldsParams" + }, + "" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.dataViewId", + "type": "CompoundType", + "tags": [], + "label": "dataViewId", + "description": [], + "signature": [ + "string | null" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.allFields", + "type": "Array", + "tags": [], + "label": "allFields", + "description": [], + "signature": [ + "T[]" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.services", + "type": "Object", + "tags": [], + "label": "services", + "description": [], + "signature": [ + "{ dataViews: ", + { + "pluginId": "dataViews", + "scope": "public", + "docId": "kibDataViewsPluginApi", + "section": "def-public.DataViewsServicePublic", + "text": "DataViewsServicePublic" + }, + "; }" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.fieldsExistenceReader", + "type": "Object", + "tags": [], + "label": "fieldsExistenceReader", + "description": [], + "signature": [ + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.ExistingFieldsReader", + "text": "ExistingFieldsReader" + }, + " | undefined" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.onOverrideFieldGroupDetails", + "type": "Function", + "tags": [], + "label": "onOverrideFieldGroupDetails", + "description": [], + "signature": [ + "((groupName: ", + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.FieldsGroupNames", + "text": "FieldsGroupNames" + }, + ") => Partial<", + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.FieldsGroupDetails", + "text": "FieldsGroupDetails" + }, + "> | null | undefined) | undefined" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.onOverrideFieldGroupDetails.$1", + "type": "Enum", + "tags": [], + "label": "groupName", + "description": [], + "signature": [ + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.FieldsGroupNames", + "text": "FieldsGroupNames" + } + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.onSupportedFieldFilter", + "type": "Function", + "tags": [], + "label": "onSupportedFieldFilter", + "description": [], + "signature": [ + "((field: T) => boolean) | undefined" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.onSupportedFieldFilter.$1", + "type": "Uncategorized", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "T" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.onSelectedFieldFilter", + "type": "Function", + "tags": [], + "label": "onSelectedFieldFilter", + "description": [], + "signature": [ + "((field: T) => boolean) | undefined" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.onSelectedFieldFilter.$1", + "type": "Uncategorized", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "T" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.onFilterField", + "type": "Function", + "tags": [], + "label": "onFilterField", + "description": [], + "signature": [ + "((field: T) => boolean) | undefined" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsParams.onFilterField.$1", + "type": "Uncategorized", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "T" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsResult", + "type": "Interface", + "tags": [], + "label": "GroupedFieldsResult", + "description": [], + "signature": [ + { + "pluginId": "unifiedFieldList", + "scope": "public", + "docId": "kibUnifiedFieldListPluginApi", + "section": "def-public.GroupedFieldsResult", + "text": "GroupedFieldsResult" + }, + "" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.GroupedFieldsResult.fieldGroups", + "type": "Object", + "tags": [], + "label": "fieldGroups", + "description": [], + "signature": [ + "{ SpecialFields?: ", + "FieldsGroup", + " | undefined; SelectedFields?: ", + "FieldsGroup", + " | undefined; AvailableFields?: ", + "FieldsGroup", + " | undefined; EmptyFields?: ", + "FieldsGroup", + " | undefined; MetaFields?: ", + "FieldsGroup", + " | undefined; }" + ], + "path": "src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "unifiedFieldList", "id": "def-public.NumberStatsResult", @@ -2030,7 +3269,32 @@ "initialIsOpen": false } ], - "enums": [], + "enums": [ + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.ExistenceFetchStatus", + "type": "Enum", + "tags": [], + "label": "ExistenceFetchStatus", + "description": [], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldsGroupNames", + "type": "Enum", + "tags": [], + "label": "FieldsGroupNames", + "description": [], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], "misc": [ { "parentPluginId": "unifiedFieldList", @@ -2107,6 +3371,31 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "unifiedFieldList", + "id": "def-public.FieldListGroups", + "type": "Type", + "tags": [], + "label": "FieldListGroups", + "description": [], + "signature": [ + "{ SpecialFields?: ", + "FieldsGroup", + " | undefined; SelectedFields?: ", + "FieldsGroup", + " | undefined; AvailableFields?: ", + "FieldsGroup", + " | undefined; EmptyFields?: ", + "FieldsGroup", + " | undefined; MetaFields?: ", + "FieldsGroup", + " | undefined; }" + ], + "path": "src/plugins/unified_field_list/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "unifiedFieldList", "id": "def-public.FieldPopoverVisualizeProps", diff --git a/api_docs/unified_field_list.mdx b/api_docs/unified_field_list.mdx index 7df784517d3e4..71b16e20c842c 100644 --- a/api_docs/unified_field_list.mdx +++ b/api_docs/unified_field_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedFieldList title: "unifiedFieldList" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedFieldList plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedFieldList'] --- import unifiedFieldListObj from './unified_field_list.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-disco | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 122 | 0 | 117 | 2 | +| 192 | 0 | 187 | 4 | ## Client @@ -37,6 +37,9 @@ Contact [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-disco ### Interfaces +### Enums + + ### Consts, variables and types diff --git a/api_docs/unified_histogram.devdocs.json b/api_docs/unified_histogram.devdocs.json index ae17302e9ef1e..5ea1d379e5aea 100644 --- a/api_docs/unified_histogram.devdocs.json +++ b/api_docs/unified_histogram.devdocs.json @@ -1004,7 +1004,13 @@ "label": "uiSettings", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "src/plugins/unified_histogram/public/types.ts", "deprecated": false, diff --git a/api_docs/unified_histogram.mdx b/api_docs/unified_histogram.mdx index e79c1a6d367e7..c6b8cef372c0b 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: 2022-10-25 +date: 2022-11-07 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 ea8e01217ba92..76b9b00cf8f5a 100644 --- a/api_docs/unified_search.devdocs.json +++ b/api_docs/unified_search.devdocs.json @@ -270,11 +270,29 @@ "description": [], "signature": [ "(props: Omit<", { "pluginId": "unifiedSearch", @@ -299,9 +317,21 @@ "description": [], "signature": [ "{ query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | QT | undefined; dataTestSubj?: string | undefined; filters?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; savedQuery?: ", { "pluginId": "data", @@ -328,16 +358,40 @@ "section": "def-public.TimeHistoryContract", "text": "TimeHistoryContract" }, - " | undefined; customSubmitButton?: React.ReactNode; screenTitle?: string | undefined; showQueryInput?: boolean | undefined; showFilterBar?: boolean | undefined; showDatePicker?: boolean | undefined; showAutoRefreshOnly?: boolean | undefined; hiddenFilterPanelOptions?: ", + " | undefined; customSubmitButton?: React.ReactNode; screenTitle?: string | undefined; showQueryMenu?: boolean | undefined; showQueryInput?: boolean | undefined; showFilterBar?: boolean | undefined; showDatePicker?: boolean | undefined; showAutoRefreshOnly?: boolean | undefined; hiddenFilterPanelOptions?: ", "FilterPanelOption", "[] | undefined; isRefreshPaused?: boolean | undefined; dateRangeFrom?: string | undefined; dateRangeTo?: string | undefined; showSaveQuery?: boolean | undefined; onQueryChange?: ((payload: { dateRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | QT | undefined; }) => void) | undefined; onQuerySubmit?: ((payload: { dateRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | QT | undefined; }, isUpdate?: boolean | undefined) => void) | undefined; onSaved?: ((savedQuery: ", { "pluginId": "data", @@ -355,7 +409,13 @@ "text": "SavedQuery" }, ") => void) | undefined; onClearSavedQuery?: (() => void) | undefined; onRefresh?: ((payload: { dateRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; }) => void) | undefined; indicateNoData?: boolean | undefined; isClearable?: boolean | undefined; nonKqlMode?: \"text\" | \"lucene\" | undefined; displayStyle?: \"inPage\" | \"detached\" | undefined; fillSubmitButton?: boolean | undefined; dataViewPickerComponentProps?: ", { "pluginId": "unifiedSearch", @@ -369,7 +429,13 @@ ") => void) | undefined; showSubmitButton?: boolean | undefined; submitButtonStyle?: \"auto\" | \"full\" | \"iconOnly\" | undefined; suggestionsSize?: ", "SuggestionsListSize", " | undefined; isScreenshotMode?: boolean | undefined; onFiltersUpdated?: ((filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]) => void) | undefined; onRefreshChange?: ((options: { isPaused: boolean; refreshInterval: number; }) => void) | undefined; }" ], "path": "src/plugins/unified_search/public/search_bar/index.tsx", @@ -400,7 +466,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/unified_search/public/actions/apply_filter_action.ts", @@ -820,7 +892,13 @@ "Array of filters that will be rendered as filter pills" ], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/unified_search/public/filter_bar/filter_item/filter_items.tsx", @@ -854,7 +932,13 @@ ], "signature": [ "((filters: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]) => void) | undefined" ], "path": "src/plugins/unified_search/public/filter_bar/filter_item/filter_items.tsx", @@ -869,7 +953,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/unified_search/public/filter_bar/filter_item/filter_items.tsx", @@ -971,7 +1061,13 @@ "text": "IUnifiedSearchPluginServices" }, " extends Partial<", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ">" ], "path": "src/plugins/unified_search/public/types.ts", @@ -1021,7 +1117,13 @@ "label": "uiSettings", "description": [], "signature": [ - "IUiSettingsClient" + { + "pluginId": "@kbn/core-ui-settings-browser", + "scope": "common", + "docId": "kibKbnCoreUiSettingsBrowserPluginApi", + "section": "def-common.IUiSettingsClient", + "text": "IUiSettingsClient" + } ], "path": "src/plugins/unified_search/public/types.ts", "deprecated": false, @@ -1035,7 +1137,13 @@ "label": "savedObjects", "description": [], "signature": [ - "SavedObjectsStart" + { + "pluginId": "@kbn/core-saved-objects-browser", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsBrowserPluginApi", + "section": "def-common.SavedObjectsStart", + "text": "SavedObjectsStart" + } ], "path": "src/plugins/unified_search/public/types.ts", "deprecated": false, @@ -1049,7 +1157,13 @@ "label": "notifications", "description": [], "signature": [ - "NotificationsStart" + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + } ], "path": "src/plugins/unified_search/public/types.ts", "deprecated": false, @@ -1063,7 +1177,13 @@ "label": "application", "description": [], "signature": [ - "ApplicationStart" + { + "pluginId": "@kbn/core-application-browser", + "scope": "common", + "docId": "kibKbnCoreApplicationBrowserPluginApi", + "section": "def-common.ApplicationStart", + "text": "ApplicationStart" + } ], "path": "src/plugins/unified_search/public/types.ts", "deprecated": false, @@ -1077,7 +1197,13 @@ "label": "http", "description": [], "signature": [ - "HttpSetup" + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], "path": "src/plugins/unified_search/public/types.ts", "deprecated": false, @@ -1112,7 +1238,13 @@ "label": "docLinks", "description": [], "signature": [ - "DocLinksStart" + { + "pluginId": "@kbn/core-doc-links-browser", + "scope": "common", + "docId": "kibKbnCoreDocLinksBrowserPluginApi", + "section": "def-common.DocLinksStart", + "text": "DocLinksStart" + } ], "path": "src/plugins/unified_search/public/types.ts", "deprecated": false, @@ -1395,7 +1527,13 @@ "description": [], "signature": [ "((query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, ") => void) | undefined" ], "path": "src/plugins/unified_search/public/query_string_input/query_string_input.tsx", @@ -1410,7 +1548,13 @@ "label": "query", "description": [], "signature": [ - "Query" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + } ], "path": "src/plugins/unified_search/public/query_string_input/query_string_input.tsx", "deprecated": false, @@ -1461,7 +1605,13 @@ "description": [], "signature": [ "((query: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, ") => void) | undefined" ], "path": "src/plugins/unified_search/public/query_string_input/query_string_input.tsx", @@ -1476,7 +1626,13 @@ "label": "query", "description": [], "signature": [ - "Query" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + } ], "path": "src/plugins/unified_search/public/query_string_input/query_string_input.tsx", "deprecated": false, @@ -1905,9 +2061,9 @@ }, " implements ", { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.Plugin", "text": "Plugin" }, @@ -1948,9 +2104,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-plugins-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCorePluginsServerPluginApi", "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, @@ -1974,9 +2130,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -2007,9 +2163,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreSetup", "text": "CoreSetup" }, @@ -2058,9 +2214,9 @@ "signature": [ "(core: ", { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" }, @@ -2081,9 +2237,9 @@ "description": [], "signature": [ { - "pluginId": "core", + "pluginId": "@kbn/core-lifecycle-server", "scope": "server", - "docId": "kibCorePluginApi", + "docId": "kibKbnCoreLifecycleServerPluginApi", "section": "def-server.CoreStart", "text": "CoreStart" } diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index 412a8fcded594..d61a8afd4b8a8 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] --- import unifiedSearchObj from './unified_search.devdocs.json'; diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index ce677b719e0de..ba579fa95afa2 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.devdocs.json'; diff --git a/api_docs/url_forwarding.devdocs.json b/api_docs/url_forwarding.devdocs.json index 803087f7baf66..e5214ed502a2f 100644 --- a/api_docs/url_forwarding.devdocs.json +++ b/api_docs/url_forwarding.devdocs.json @@ -22,7 +22,13 @@ "description": [], "signature": [ "(core: ", - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<{}, { navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", { "pluginId": "urlForwarding", @@ -45,7 +51,13 @@ "label": "core", "description": [], "signature": [ - "CoreSetup", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreSetup", + "text": "CoreSetup" + }, "<{}, { navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", { "pluginId": "urlForwarding", @@ -73,7 +85,13 @@ "description": [], "signature": [ "({ application, http: { basePath } }: ", - "CoreStart", + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + }, ") => { navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", { "pluginId": "urlForwarding", @@ -96,7 +114,13 @@ "label": "{ application, http: { basePath } }", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/url_forwarding/public/plugin.ts", "deprecated": false, diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index 389c2112f5370..b809862590123 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github description: API docs for the urlForwarding plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/usage_collection.devdocs.json b/api_docs/usage_collection.devdocs.json index c7453333a13fd..bee493bb1fa8f 100644 --- a/api_docs/usage_collection.devdocs.json +++ b/api_docs/usage_collection.devdocs.json @@ -1547,7 +1547,13 @@ "\nRequest-scoped Saved Objects client" ], "signature": [ - "SavedObjectsClientContract" + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } ], "path": "src/plugins/usage_collection/server/collector/types.ts", "deprecated": false, @@ -1589,7 +1595,13 @@ "Logger" ], "signature": [ - "Logger" + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } ], "path": "src/plugins/usage_collection/server/collector/types.ts", "deprecated": false, @@ -1894,7 +1906,7 @@ "signature": [ "\"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"short\" | \"byte\" | \"float\" | \"integer\"" ], - "path": "node_modules/@types/kbn__analytics-client/index.d.ts", + "path": "packages/analytics/client/src/schema/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1906,7 +1918,7 @@ "tags": [], "label": "CollectorFetchMethod", "description": [ - "\nThe fetch method has the context of the Collector itself\n(this has access to all the properties of the collector like the logger)\nand the the first parameter is {@link CollectorFetchContext}." + "\nThe fetch method has the context of the Collector itself\n(this has access to all the properties of the collector like the logger)\nand the first parameter is {@link CollectorFetchContext}." ], "signature": [ "(this: ", @@ -2085,7 +2097,13 @@ "\nThe structure of the SavedObjects of type \"usage-counters\"" ], "signature": [ - "SavedObject", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObject", + "text": "SavedObject" + }, "<", { "pluginId": "usageCollection", diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 312a5be4a7976..ef5fecf836994 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: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index b84b7d7047872..5a45414757099 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index 5d88263723e81..aa8ddf7d5f9be 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the visDefaultEditor plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.devdocs.json'; The default editor used in most aggregation-based visualizations. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index 519a613103e82..44fcd8dccdc1d 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeGauge plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] --- import visTypeGaugeObj from './vis_type_gauge.devdocs.json'; 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. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index 1fd3c29d65a7e..aa3f8b19f713d 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeHeatmap plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] --- import visTypeHeatmapObj from './vis_type_heatmap.devdocs.json'; 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. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_pie.devdocs.json b/api_docs/vis_type_pie.devdocs.json index b2bd3921dcfcb..dbc657689af05 100644 --- a/api_docs/vis_type_pie.devdocs.json +++ b/api_docs/vis_type_pie.devdocs.json @@ -95,7 +95,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; }" ], "path": "src/plugins/vis_types/pie/public/types/types.ts", diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index 7986a2253f552..ce9a2a26715e5 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypePie plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] --- import visTypePieObj from './vis_type_pie.devdocs.json'; Contains the pie 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. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index c7432e566dede..2fb327ef1e769 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTable plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] --- import visTypeTableObj from './vis_type_table.devdocs.json'; Registers the datatable aggregation-based visualization. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index d6effa9d63185..f9f1316e3645d 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimelion plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] --- import visTypeTimelionObj from './vis_type_timelion.devdocs.json'; Registers the timelion visualization. Also contains the backend for both timelion app and timelion visualization. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_timeseries.devdocs.json b/api_docs/vis_type_timeseries.devdocs.json index eb681813a0ef0..e6e809524ee15 100644 --- a/api_docs/vis_type_timeseries.devdocs.json +++ b/api_docs/vis_type_timeseries.devdocs.json @@ -134,7 +134,13 @@ "text": "DataRequestHandlerContext" }, ", fakeRequest: ", - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, ", options: any) => Promise<", "TimeseriesVisData", ">" @@ -172,7 +178,13 @@ "label": "fakeRequest", "description": [], "signature": [ - "KibanaRequest", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, "" ], "path": "src/plugins/vis_types/timeseries/server/plugin.ts", diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index 3d47ee7ff0dfa..b8987215fa144 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimeseries plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] --- import visTypeTimeseriesObj from './vis_type_timeseries.devdocs.json'; Registers the TSVB visualization. TSVB has its one editor, works with index patterns and index strings and contains 6 types of charts: timeseries, topN, table. markdown, metric and gauge. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index d0447b0e254e3..e1a0f8a69a8ad 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVega plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] --- import visTypeVegaObj from './vis_type_vega.devdocs.json'; Registers the vega visualization. Is the elastic version of vega and vega-lite libraries. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index 8c4105f7fca02..d85bc1b536d39 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVislib plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] --- import visTypeVislibObj from './vis_type_vislib.devdocs.json'; Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and heatmap charts. We want to replace them with elastic-charts. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_xy.devdocs.json b/api_docs/vis_type_xy.devdocs.json index e9d569dcbde48..a5f6c00f3d34a 100644 --- a/api_docs/vis_type_xy.devdocs.json +++ b/api_docs/vis_type_xy.devdocs.json @@ -11,7 +11,7 @@ "label": "getPositions", "description": [], "signature": [ - "() => ({ text: string; value: \"top\"; } | { text: string; value: \"left\"; } | { text: string; value: \"right\"; } | { text: string; value: \"bottom\"; })[]" + "() => ({ text: any; value: \"top\"; } | { text: any; value: \"left\"; } | { text: any; value: \"right\"; } | { text: any; value: \"bottom\"; })[]" ], "path": "src/plugins/vis_types/xy/public/editor/positions.ts", "deprecated": false, @@ -28,7 +28,7 @@ "label": "getScaleTypes", "description": [], "signature": [ - "() => { text: string; value: ", + "() => { text: any; value: ", { "pluginId": "visTypeXy", "scope": "public", diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index fc0bcc1922de2..042c1c69ecf1b 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeXy plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; 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. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/visualizations.devdocs.json b/api_docs/visualizations.devdocs.json index b4c5d22ea35e2..4a853779ad631 100644 --- a/api_docs/visualizations.devdocs.json +++ b/api_docs/visualizations.devdocs.json @@ -1574,7 +1574,13 @@ ], "signature": [ "() => Promise<", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]>" ], "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", @@ -1596,9 +1602,21 @@ ], "signature": [ "() => Promise<", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined>" ], "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", @@ -1642,7 +1660,13 @@ "description": [], "signature": [ "() => ", - "OverlayRef", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + }, " | undefined" ], "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", @@ -1813,53 +1837,6 @@ ], "returnComment": [] }, - { - "parentPluginId": "visualizations", - "id": "def-public.VisualizeEmbeddable.catchError", - "type": "Function", - "tags": [], - "label": "catchError", - "description": [], - "signature": [ - "(error: string | ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ErrorLike", - "text": "ErrorLike" - }, - ") => JSX.Element" - ], - "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "visualizations", - "id": "def-public.VisualizeEmbeddable.catchError.$1", - "type": "CompoundType", - "tags": [], - "label": "error", - "description": [], - "signature": [ - "string | ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ErrorLike", - "text": "ErrorLike" - } - ], - "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, { "parentPluginId": "visualizations", "id": "def-public.VisualizeEmbeddable.destroy", @@ -2218,9 +2195,21 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; source?: string | undefined; sourceParams?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; }; id: string; name: string; }[]; type: \"datatable\"; meta?: ", "DatatableMeta", " | undefined; rows: ", @@ -2316,7 +2305,13 @@ "text": "SavedVisState" }, "<", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">" ], "path": "src/plugins/visualizations/public/legacy/vis_update_state.d.ts", @@ -2514,7 +2509,13 @@ "label": "core", "description": [], "signature": [ - "CoreStart" + { + "pluginId": "@kbn/core-lifecycle-browser", + "scope": "common", + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-common.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/visualizations/public/visualize_app/types.ts", "deprecated": false, @@ -2548,7 +2549,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]" ], "path": "src/plugins/visualizations/public/visualize_app/types.ts", @@ -2577,7 +2584,13 @@ "label": "query", "description": [], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined" ], "path": "src/plugins/visualizations/public/visualize_app/types.ts", @@ -2733,7 +2746,13 @@ "label": "migrationVersion", "description": [], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], "path": "src/plugins/visualizations/public/types.ts", @@ -3460,7 +3479,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }[]" ], "path": "src/plugins/visualizations/common/types.ts", @@ -3476,11 +3501,29 @@ "description": [], "signature": [ "{ type?: string | undefined; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined; filter?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; sort?: ", { "pluginId": "data", @@ -3490,9 +3533,21 @@ "text": "EsQuerySortValue" }, "[] | undefined; highlight?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; highlightAll?: boolean | undefined; trackTotalHits?: number | boolean | undefined; aggs?: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }[] | undefined; from?: number | undefined; size?: number | undefined; source?: boolean | ", "Fields", " | undefined; version?: boolean | undefined; fields?: ", @@ -4015,7 +4070,13 @@ "label": "migrationVersion", "description": [], "signature": [ - "SavedObjectsMigrationVersion", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectsMigrationVersion", + "text": "SavedObjectsMigrationVersion" + }, " | undefined" ], "path": "src/plugins/visualizations/public/types.ts", @@ -4112,9 +4173,21 @@ ">; getFetch$: () => ", "Observable", "; getTime: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; getAbsoluteTime: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; setTime: (time: ", "InputTimeRange", ") => void; getRefreshInterval: () => ", @@ -4142,11 +4215,29 @@ "text": "DataView" }, ", timeRange?: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, " | ", - "ScriptedRangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ScriptedRangeFilter", + "text": "ScriptedRangeFilter" + }, " | ", "MatchAllRangeFilter", " | undefined; createRelativeFilter: (indexPattern: ", @@ -4158,11 +4249,29 @@ "text": "DataView" }, ", timeRange?: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined) => ", - "RangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, " | ", - "ScriptedRangeFilter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.ScriptedRangeFilter", + "text": "ScriptedRangeFilter" + }, " | ", "MatchAllRangeFilter", " | undefined; getBounds: () => ", @@ -4174,7 +4283,13 @@ "text": "TimeRangeBounds" }, "; calculateBounds: (timeRange: ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, ") => ", { "pluginId": "data", @@ -4192,7 +4307,13 @@ "text": "TimeRangeBounds" }, " | undefined; enableTimeRangeSelector: () => void; disableTimeRangeSelector: () => void; enableAutoRefreshSelector: () => void; disableAutoRefreshSelector: () => void; getTimeDefaults: () => ", - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, "; getRefreshIntervalDefaults: () => ", { "pluginId": "data", @@ -5642,7 +5763,13 @@ "label": "query", "description": [], "signature": [ - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | undefined" ], "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", @@ -5657,7 +5784,13 @@ "label": "filters", "description": [], "signature": [ - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined" ], "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", @@ -5672,7 +5805,13 @@ "label": "timeRange", "description": [], "signature": [ - "TimeRange", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, " | undefined" ], "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", @@ -5866,7 +6005,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">; }" ], "path": "src/plugins/visualizations/common/expression_functions/xy_dimension.ts", @@ -5913,7 +6058,13 @@ "description": [], "signature": [ "{ title: string; type: string; params: TVisParams; aggs: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }[]; }" ], "path": "src/plugins/visualizations/common/types.ts", @@ -6136,9 +6287,21 @@ "text": "ContainerOutput" }, "> | undefined; getQuery: () => Promise<", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined>; updateInput: (changes: Partial<", { "pluginId": "visualizations", @@ -6164,7 +6327,13 @@ "text": "VisParams" }, ">; getFilters: () => Promise<", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[]>; getInspectorAdapters: () => ", { "pluginId": "inspector", @@ -6174,7 +6343,13 @@ "text": "Adapters" }, " | undefined; openInspector: () => ", - "OverlayRef", + { + "pluginId": "@kbn/core-mount-utils-browser", + "scope": "common", + "docId": "kibKbnCoreMountUtilsBrowserPluginApi", + "section": "def-common.OverlayRef", + "text": "OverlayRef" + }, " | undefined; transferCustomizationsToUiState: () => void; hasInspector: () => boolean; onContainerLoading: () => void; onContainerData: () => void; onContainerRender: () => void; onContainerError: (error: ", { "pluginId": "expressions", @@ -6183,15 +6358,7 @@ "section": "def-public.ExpressionRenderError", "text": "ExpressionRenderError" }, - ") => void; catchError: (error: string | ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ErrorLike", - "text": "ErrorLike" - }, - ") => JSX.Element; reload: () => Promise; supportedTriggers: () => string[]; inputIsRefType: (input: ", + ") => void; reload: () => Promise; supportedTriggers: () => string[]; inputIsRefType: (input: ", { "pluginId": "visualizations", "scope": "public", @@ -6205,7 +6372,15 @@ "VisualizeByValueInput", ">; getInputAsRefType: () => Promise<", "VisualizeByReferenceInput", - ">; readonly runtimeId: number; readonly isContainer: boolean; readonly deferEmbeddableLoad: boolean; fatalError?: Error | undefined; refreshInputFromParent: () => void; getIsContainer: () => this is ", + ">; readonly runtimeId: number; readonly isContainer: boolean; readonly deferEmbeddableLoad: boolean; catchError?: ((error: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ErrorLike", + "text": "ErrorLike" + }, + ", domNode: Element | HTMLElement) => any) | undefined; fatalError?: Error | undefined; refreshInputFromParent: () => void; getIsContainer: () => this is ", { "pluginId": "embeddable", "scope": "public", @@ -6355,7 +6530,13 @@ "text": "EmbeddableStateWithType" }, ", references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]) => ", { "pluginId": "embeddable", @@ -6381,7 +6562,13 @@ "text": "EmbeddableStateWithType" }, "; references: ", - "SavedObjectReference", + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectReference", + "text": "SavedObjectReference" + }, "[]; }; create: (input: ", { "pluginId": "visualizations", @@ -6448,7 +6635,7 @@ }, " | ", "DisabledLabEmbeddable", - " | undefined>; isEditable: () => Promise; getDisplayName: () => string; createFromSavedObject: (savedObjectId: string, input: Partial<", + " | undefined>; isEditable: () => Promise; getDisplayName: () => any; createFromSavedObject: (savedObjectId: string, input: Partial<", { "pluginId": "visualizations", "scope": "public", @@ -7221,7 +7408,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined) => { id?: string | undefined; params?: Record | undefined; } | undefined" ], "path": "src/plugins/visualizations/common/utils/accessors.ts", @@ -7288,7 +7481,13 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined" ], "path": "src/plugins/visualizations/common/utils/accessors.ts", @@ -7544,7 +7743,7 @@ "label": "isFieldValid", "description": [], "signature": [ - "(field: ", + "(visType: string, field: ", { "pluginId": "dataViews", "scope": "common", @@ -7570,6 +7769,21 @@ { "parentPluginId": "visualizations", "id": "def-common.isFieldValid.$1", + "type": "string", + "tags": [], + "label": "visType", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/utils.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-common.isFieldValid.$2", "type": "Object", "tags": [], "label": "field", @@ -7591,7 +7805,7 @@ }, { "parentPluginId": "visualizations", - "id": "def-common.isFieldValid.$2", + "id": "def-common.isFieldValid.$3", "type": "CompoundType", "tags": [], "label": "aggregation", @@ -7698,9 +7912,21 @@ "text": "SerializedFieldFormat" }, "<{}, ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, "> | undefined; source?: string | undefined; sourceParams?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; }; id: string; name: string; }[]; type: \"datatable\"; meta?: ", "DatatableMeta", " | undefined; rows: ", @@ -7828,7 +8054,13 @@ "text": "Adapters" }, ", ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, ">>" ], "path": "src/plugins/visualizations/common/expression_functions/range.ts", @@ -7926,56 +8158,13 @@ "description": [], "signature": [ "() => ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"visdimension\", ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - }, - ", ", - { - "pluginId": "visualizations", - "scope": "common", - "docId": "kibVisualizationsPluginApi", - "section": "def-common.Arguments", - "text": "Arguments" - }, - ", ", { "pluginId": "visualizations", "scope": "common", "docId": "kibVisualizationsPluginApi", - "section": "def-common.ExpressionValueVisDimension", - "text": "ExpressionValueVisDimension" - }, - ", ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExecutionContext", - "text": "ExecutionContext" - }, - "<", - { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.Adapters", - "text": "Adapters" - }, - ", ", - "SerializableRecord", - ">>" + "section": "def-common.ExpressionFunctionVisDimension", + "text": "ExpressionFunctionVisDimension" + } ], "path": "src/plugins/visualizations/common/expression_functions/vis_dimension.ts", "deprecated": false, @@ -8472,23 +8661,52 @@ "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "visualizations", - "id": "def-common.ColumnWithReferences", - "type": "Interface", - "tags": [], - "label": "ColumnWithReferences", - "description": [], - "signature": [ + }, { - "pluginId": "visualizations", - "scope": "common", - "docId": "kibVisualizationsPluginApi", - "section": "def-common.ColumnWithReferences", + "parentPluginId": "visualizations", + "id": "def-common.ColumnState.palette", + "type": "Object", + "tags": [], + "label": "palette", + "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, + "<", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, + "> | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.ColumnWithReferences", + "type": "Interface", + "tags": [], + "label": "ColumnWithReferences", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ColumnWithReferences", "text": "ColumnWithReferences" }, " extends ", @@ -8663,7 +8881,13 @@ "description": [], "signature": [ "{ type: \"kibana_query\"; } & ", - "Query" + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + } ], "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, @@ -9031,91 +9255,601 @@ }, { "parentPluginId": "visualizations", - "id": "def-common.GenericSchemaConfig.label", - "type": "string", + "id": "def-common.GenericSchemaConfig.label", + "type": "string", + "tags": [], + "label": "label", + "description": [], + "path": "src/plugins/visualizations/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.GenericSchemaConfig.format", + "type": "Object", + "tags": [], + "label": "format", + "description": [], + "signature": [ + "{ id?: string | undefined; params?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, + " | undefined; }" + ], + "path": "src/plugins/visualizations/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.GenericSchemaConfig.params", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "SchemaConfigParams" + ], + "path": "src/plugins/visualizations/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.GenericSchemaConfig.aggType", + "type": "Uncategorized", + "tags": [], + "label": "aggType", + "description": [], + "signature": [ + "Agg" + ], + "path": "src/plugins/visualizations/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.GenericSchemaConfig.aggId", + "type": "string", + "tags": [], + "label": "aggId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.GenericSchemaConfig.aggParams", + "type": "Uncategorized", + "tags": [], + "label": "aggParams", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggParamsMapping", + "text": "AggParamsMapping" + }, + "[Agg] | undefined" + ], + "path": "src/plugins/visualizations/common/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments", + "type": "Interface", + "tags": [], + "label": "HeatmapArguments", + "description": [], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.percentageMode", + "type": "CompoundType", + "tags": [], + "label": "percentageMode", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.lastRangeIsRightOpen", + "type": "CompoundType", + "tags": [], + "label": "lastRangeIsRightOpen", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.showTooltip", + "type": "CompoundType", + "tags": [], + "label": "showTooltip", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.highlightInHover", + "type": "CompoundType", + "tags": [], + "label": "highlightInHover", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.palette", + "type": "Object", + "tags": [], + "label": "palette", + "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, + "<", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, + "> | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.xAccessor", + "type": "CompoundType", + "tags": [], + "label": "xAccessor", + "description": [], + "signature": [ + "string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + " | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.yAccessor", + "type": "CompoundType", + "tags": [], + "label": "yAccessor", + "description": [], + "signature": [ + "string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + " | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.valueAccessor", + "type": "CompoundType", + "tags": [], + "label": "valueAccessor", + "description": [], + "signature": [ + "string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + " | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.splitRowAccessor", + "type": "CompoundType", + "tags": [], + "label": "splitRowAccessor", + "description": [], + "signature": [ + "string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + " | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.splitColumnAccessor", + "type": "CompoundType", + "tags": [], + "label": "splitColumnAccessor", + "description": [], + "signature": [ + "string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + " | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.legend", + "type": "Object", + "tags": [], + "label": "legend", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.HeatmapLegendConfig", + "text": "HeatmapLegendConfig" + } + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.gridConfig", + "type": "Object", + "tags": [], + "label": "gridConfig", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.HeatmapGridConfig", + "text": "HeatmapGridConfig" + } + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapArguments.ariaLabel", + "type": "string", + "tags": [], + "label": "ariaLabel", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig", + "type": "Interface", + "tags": [], + "label": "HeatmapGridConfig", + "description": [], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig.strokeWidth", + "type": "number", + "tags": [], + "label": "strokeWidth", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig.strokeColor", + "type": "string", + "tags": [], + "label": "strokeColor", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig.isCellLabelVisible", + "type": "boolean", + "tags": [], + "label": "isCellLabelVisible", + "description": [], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig.isYAxisLabelVisible", + "type": "boolean", + "tags": [], + "label": "isYAxisLabelVisible", + "description": [], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig.isYAxisTitleVisible", + "type": "boolean", + "tags": [], + "label": "isYAxisTitleVisible", + "description": [], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig.yTitle", + "type": "string", + "tags": [], + "label": "yTitle", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig.isXAxisLabelVisible", + "type": "boolean", + "tags": [], + "label": "isXAxisLabelVisible", + "description": [], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig.isXAxisTitleVisible", + "type": "boolean", + "tags": [], + "label": "isXAxisTitleVisible", + "description": [], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig.xTitle", + "type": "string", + "tags": [], + "label": "xTitle", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapGridConfig.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"heatmap_grid\"" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapLegendConfig", + "type": "Interface", + "tags": [], + "label": "HeatmapLegendConfig", + "description": [], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapLegendConfig.isVisible", + "type": "boolean", "tags": [], - "label": "label", + "label": "isVisible", "description": [], - "path": "src/plugins/visualizations/common/types.ts", + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "visualizations", - "id": "def-common.GenericSchemaConfig.format", - "type": "Object", + "id": "def-common.HeatmapLegendConfig.position", + "type": "CompoundType", "tags": [], - "label": "format", + "label": "position", "description": [], "signature": [ - "{ id?: string | undefined; params?: ", - "SerializableRecord", - " | undefined; }" + "\"top\" | \"bottom\" | \"left\" | \"right\"" ], - "path": "src/plugins/visualizations/common/types.ts", + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "visualizations", - "id": "def-common.GenericSchemaConfig.params", - "type": "Object", + "id": "def-common.HeatmapLegendConfig.maxLines", + "type": "number", "tags": [], - "label": "params", + "label": "maxLines", "description": [], "signature": [ - "SchemaConfigParams" + "number | undefined" ], - "path": "src/plugins/visualizations/common/types.ts", + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "visualizations", - "id": "def-common.GenericSchemaConfig.aggType", - "type": "Uncategorized", + "id": "def-common.HeatmapLegendConfig.shouldTruncate", + "type": "CompoundType", "tags": [], - "label": "aggType", + "label": "shouldTruncate", "description": [], "signature": [ - "Agg" + "boolean | undefined" ], - "path": "src/plugins/visualizations/common/types.ts", + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "visualizations", - "id": "def-common.GenericSchemaConfig.aggId", - "type": "string", + "id": "def-common.HeatmapLegendConfig.legendSize", + "type": "CompoundType", "tags": [], - "label": "aggId", + "label": "legendSize", "description": [], "signature": [ - "string | undefined" + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.LegendSize", + "text": "LegendSize" + }, + " | undefined" ], - "path": "src/plugins/visualizations/common/types.ts", + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "visualizations", - "id": "def-common.GenericSchemaConfig.aggParams", - "type": "Uncategorized", + "id": "def-common.HeatmapLegendConfig.type", + "type": "string", "tags": [], - "label": "aggParams", + "label": "type", "description": [], "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggParamsMapping", - "text": "AggParamsMapping" - }, - "[Agg] | undefined" + "\"heatmap_legend\"" ], - "path": "src/plugins/visualizations/common/types.ts", + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, "trackAdoption": false } @@ -9639,9 +10373,21 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<", - "CustomPaletteParams", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, "> | undefined" ], "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", @@ -10238,7 +10984,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }> | undefined" ], "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", @@ -10449,7 +11201,7 @@ "label": "ranges", "description": [], "signature": [ - "Range[]" + "Range[] | undefined" ], "path": "src/plugins/visualizations/common/convert_to_lens/types/params.ts", "deprecated": false, @@ -10642,7 +11394,13 @@ "description": [], "signature": [ "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }[]" ], "path": "src/plugins/visualizations/common/types.ts", @@ -10658,11 +11416,29 @@ "description": [], "signature": [ "{ type?: string | undefined; query?: ", - "Query", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, " | ", - "AggregateQuery", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, " | undefined; filter?: ", - "Filter", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, "[] | undefined; sort?: ", { "pluginId": "data", @@ -10672,9 +11448,21 @@ "text": "EsQuerySortValue" }, "[] | undefined; highlight?: ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; highlightAll?: boolean | undefined; trackTotalHits?: number | boolean | undefined; aggs?: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }[] | undefined; from?: number | undefined; size?: number | undefined; source?: boolean | ", "Fields", " | undefined; version?: boolean | undefined; fields?: ", @@ -11254,7 +12042,13 @@ "text": "VisualizationSavedObjectAttributes" }, " extends ", - "SavedObjectAttributes" + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttributes", + "text": "SavedObjectAttributes" + } ], "path": "src/plugins/visualizations/common/types.ts", "deprecated": false, @@ -11976,7 +12770,13 @@ "label": "palette", "description": [], "signature": [ - "PaletteOutput", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, "<{ [key: string]: unknown; }> | undefined" ], "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", @@ -12619,6 +13419,21 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "visualizations", + "id": "def-common.ChartShapes", + "type": "Type", + "tags": [], + "label": "ChartShapes", + "description": [], + "signature": [ + "\"heatmap\"" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "visualizations", "id": "def-common.CollapseFunction", @@ -12739,6 +13554,14 @@ "docId": "kibVisualizationsPluginApi", "section": "def-common.GaugeVisConfiguration", "text": "GaugeVisConfiguration" + }, + " | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.HeatmapConfiguration", + "text": "HeatmapConfiguration" } ], "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", @@ -13032,6 +13855,76 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "visualizations", + "id": "def-common.ExpressionFunctionVisDimension", + "type": "Type", + "tags": [], + "label": "ExpressionFunctionVisDimension", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"visdimension\", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.Datatable", + "text": "Datatable" + }, + ", ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.Arguments", + "text": "Arguments" + }, + ", ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + ", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, + ">>" + ], + "path": "src/plugins/visualizations/common/expression_functions/vis_dimension.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "visualizations", "id": "def-common.ExpressionValueVisDimension", @@ -13235,6 +14128,74 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapConfiguration", + "type": "Type", + "tags": [], + "label": "HeatmapConfiguration", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.HeatmapArguments", + "text": "HeatmapArguments" + }, + " & { layerId: string; layerType: ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.LayerType", + "text": "LayerType" + }, + "; valueAccessor?: string | undefined; xAccessor?: string | undefined; yAccessor?: string | undefined; shape: \"heatmap\"; } & { palette?: ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.Palette", + "text": "Palette" + }, + " | undefined; }" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.HeatmapLayerState", + "type": "Type", + "tags": [], + "label": "HeatmapLayerState", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.HeatmapArguments", + "text": "HeatmapArguments" + }, + " & { layerId: string; layerType: ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.LayerType", + "text": "LayerType" + }, + "; valueAccessor?: string | undefined; xAccessor?: string | undefined; yAccessor?: string | undefined; shape: \"heatmap\"; }" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "visualizations", "id": "def-common.LastValueColumn", @@ -13553,6 +14514,36 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "visualizations", + "id": "def-common.Palette", + "type": "Type", + "tags": [], + "label": "Palette", + "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, + "<", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, + "> & { accessor: string; }" + ], + "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "visualizations", "id": "def-common.PartitionChartType", @@ -13740,7 +14731,13 @@ "description": [], "signature": [ "{ title: string; type: string; params: TVisParams; aggs: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + }, " | undefined; schema?: string | undefined; }[]; }" ], "path": "src/plugins/visualizations/common/types.ts", diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 075aa9e609598..ba031459437ce 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -8,20 +8,20 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github description: API docs for the visualizations plugin -date: 2022-10-25 +date: 2022-11-07 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. -Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. +Contact [Vis Editors](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 | |-------------------|-----------|------------------------|-----------------| -| 759 | 12 | 729 | 18 | +| 796 | 12 | 766 | 18 | ## Client diff --git a/dev_docs/key_concepts/building_blocks.mdx b/dev_docs/key_concepts/building_blocks.mdx index 5a7b79b93debf..29cf2df7a764f 100644 --- a/dev_docs/key_concepts/building_blocks.mdx +++ b/dev_docs/key_concepts/building_blocks.mdx @@ -52,7 +52,7 @@ The Dashboard Embeddable is one of the highest-level UI components you can add t Check out the Lens Embeddable if you wish to show users visualizations based on Elasticsearch data without worrying about query building and chart rendering. It's built on top of the , and integrates with and . Using the same configuration, it's also possible to link to a prefilled Lens editor, allowing the user to drill deeper and explore their data. -**Github labels**: `Team:VisEditors`, `Feature:Lens` +**Github labels**: `Team:Visualizations`, `Feature:Lens` ### Map Embeddable diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index feb87de90c2e6..1a9a610733f54 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -176,6 +176,10 @@ for use in their own application. |Index pattern fields formatters +|{kib-repo}blob/{branch}/src/plugins/files/README.md[files] +|File upload, download, sharing, and serving over HTTP implementation in Kibana. + + |{kib-repo}blob/{branch}/src/plugins/guided_onboarding/README.md[guidedOnboarding] |This plugin contains the code for the Guided Onboarding project. Guided onboarding consists of guides for Solutions (Enterprise Search, Observability, Security) that can be completed as a checklist of steps. The guides help users to ingest their data and to navigate to the correct Solutions pages. @@ -491,10 +495,6 @@ activities. |The features plugin enhance Kibana with a per-feature privilege system. -|{kib-repo}blob/{branch}/x-pack/plugins/files/README.md[files] -|File upload, download, sharing, and serving over HTTP implementation in Kibana. - - |{kib-repo}blob/{branch}/x-pack/plugins/file_upload[fileUpload] |WARNING: Missing README. @@ -589,6 +589,10 @@ Elastic. |This plugin allows for other plugins to add data to Kibana stack monitoring documents. +|{kib-repo}blob/{branch}/x-pack/plugins/notifications/README.md[notifications] +|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/README.md[observability] |This plugin provides shared components and services for use across observability solutions, as well as the observability landing page UI. diff --git a/docs/index-custom-title-page.html b/docs/index-custom-title-page.html new file mode 100644 index 0000000000000..f605cfce3dee9 --- /dev/null +++ b/docs/index-custom-title-page.html @@ -0,0 +1,251 @@ + + +
+ +
+
+

+

Bring your data to life

+

+ Kibana is a user interface that lets you visualize your Elasticsearch data and navigate the Elastic Stack. + Take this tutorial for the basics of visualizing data. +

+

+ + + +

+

+ What's new + Release notes + How-to videos +

+
+
+ +
+
+ +

Explore by use case

+ + + +

Get to know Kibana

+ + + + + +
+
+

+ + Manage and secure +

+
+ +
+ +
+
+

+ + Install and upgrade +

+
+ +
+ +
+
+

+ + Tools, APIs, and Dev docs +

+
+ +
+ + +

View all Elastic docs

diff --git a/docs/index-extra-title-page.html b/docs/index-extra-title-page.html deleted file mode 100644 index ced2737984fa5..0000000000000 --- a/docs/index-extra-title-page.html +++ /dev/null @@ -1,153 +0,0 @@ -
-

- From creating beautiful visualizations to managing the Elastic Stack, learn how Kibana helps you - get the most of your data. -

-

- What's new - Release notes - How-to videos -

- - - - - - - - - - - - - - - - - - -

New to Kibana?

Popular topics

- - - -

Analyze your data

Manage all things Stack

- - - -
- -

All topics

-
diff --git a/docs/maps/search.asciidoc b/docs/maps/search.asciidoc index aa747611bdbaa..8575d9fda01ed 100644 --- a/docs/maps/search.asciidoc +++ b/docs/maps/search.asciidoc @@ -107,7 +107,7 @@ You can create spatial filters in two ways: Spatial filters have the following properties: * *Geometry label* enables you to provide a meaningful name for your spatial filter. -* *Spatial relation* determines the {ref}/query-dsl-geo-shape-query.html#_spatial_relations[spatial relation operator] to use at search time. +* *Spatial relation* determines the {ref}/query-dsl-geo-shape-query.html#geo-shape-spatial-relations[spatial relation operator] to use at search time. * *Action* specifies whether to apply the filter to the current view or to a drilldown action. Only available when the map is a panel in a {kibana-ref}/dashboard.html[dashboard] with {kibana-ref}/drilldowns.html[drilldowns]. [role="screenshot"] diff --git a/docs/osquery/images/live-query-check-results.png b/docs/osquery/images/live-query-check-results.png index 6b84a3bf9f7ca..f52a96a3d64f6 100644 Binary files a/docs/osquery/images/live-query-check-results.png and b/docs/osquery/images/live-query-check-results.png differ diff --git a/docs/osquery/osquery.asciidoc b/docs/osquery/osquery.asciidoc index e854904b6baf4..c4781affd744d 100644 --- a/docs/osquery/osquery.asciidoc +++ b/docs/osquery/osquery.asciidoc @@ -43,7 +43,7 @@ then view the results. and you'll get suggestions for agents by name, ID, platform, and policy. . Specify the query or pack to run: ** *Query*: Select a saved query or enter a new one in the text box. After you enter the query, you can expand the **Advanced** section to view or set <> included in the results from the live query. Mapping ECS fields is optional. -** *Pack*: Select from query packs that have been loaded and activated. After you select a pack, all of the queries in the pack are displayed. +** *Pack*: Select from available query packs. After you select a pack, all of the queries in the pack are displayed. + TIP: Refer to <> to learn about using and managing Elastic prebuilt packs. + @@ -173,13 +173,14 @@ For information about the prebuilt packs that are available, refer to <>. [role="exclude",id="ml-sync"] == Sync machine learning objects API -This page has been deleted. Refer to <>. \ No newline at end of file +This page has been deleted. Refer to <>. + +[role="exclude",id="managing-alerts-and-actions"] +== Alerts and Actions + +This page has been deleted. Refer to <>. \ No newline at end of file diff --git a/examples/bfetch_explorer/tsconfig.json b/examples/bfetch_explorer/tsconfig.json index fe909968bd8e2..42e691f7ad155 100644 --- a/examples/bfetch_explorer/tsconfig.json +++ b/examples/bfetch_explorer/tsconfig.json @@ -11,7 +11,7 @@ "../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../developer_examples/tsconfig.json" }, { "path": "../../src/plugins/bfetch/tsconfig.json" }, diff --git a/examples/dashboard_embeddable_examples/tsconfig.json b/examples/dashboard_embeddable_examples/tsconfig.json index f17d3ae29f8e7..f35247900bc7c 100644 --- a/examples/dashboard_embeddable_examples/tsconfig.json +++ b/examples/dashboard_embeddable_examples/tsconfig.json @@ -11,7 +11,7 @@ "../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/dashboard/tsconfig.json" }, { "path": "../../src/plugins/embeddable/tsconfig.json" }, diff --git a/examples/data_view_field_editor_example/tsconfig.json b/examples/data_view_field_editor_example/tsconfig.json index 40f566047a302..51e599fd0eff5 100644 --- a/examples/data_view_field_editor_example/tsconfig.json +++ b/examples/data_view_field_editor_example/tsconfig.json @@ -10,7 +10,7 @@ "../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../src/plugins/data/tsconfig.json" }, diff --git a/examples/developer_examples/tsconfig.json b/examples/developer_examples/tsconfig.json index 23b24a38d1aef..0f3d8e259cb56 100644 --- a/examples/developer_examples/tsconfig.json +++ b/examples/developer_examples/tsconfig.json @@ -11,7 +11,7 @@ "../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" } ] } diff --git a/examples/embeddable_examples/tsconfig.json b/examples/embeddable_examples/tsconfig.json index 34c7c8e04467e..f32e7eb0850d3 100644 --- a/examples/embeddable_examples/tsconfig.json +++ b/examples/embeddable_examples/tsconfig.json @@ -12,7 +12,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../src/plugins/kibana_react/tsconfig.json" }, diff --git a/examples/embeddable_explorer/tsconfig.json b/examples/embeddable_explorer/tsconfig.json index e5b19e2c1457a..b0c9c5dd74e20 100644 --- a/examples/embeddable_explorer/tsconfig.json +++ b/examples/embeddable_explorer/tsconfig.json @@ -11,7 +11,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/embeddable/tsconfig.json" }, { "path": "../../src/plugins/ui_actions/tsconfig.json" }, diff --git a/examples/expressions_explorer/tsconfig.json b/examples/expressions_explorer/tsconfig.json index f3451b496caa0..0386f5e7188fa 100644 --- a/examples/expressions_explorer/tsconfig.json +++ b/examples/expressions_explorer/tsconfig.json @@ -10,7 +10,7 @@ "../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../src/plugins/expressions/tsconfig.json" }, diff --git a/examples/field_formats_example/tsconfig.json b/examples/field_formats_example/tsconfig.json index 66b059df68943..66e9d7db028c7 100644 --- a/examples/field_formats_example/tsconfig.json +++ b/examples/field_formats_example/tsconfig.json @@ -13,7 +13,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../developer_examples/tsconfig.json" }, { "path": "../../src/plugins/field_formats/tsconfig.json" }, diff --git a/x-pack/examples/files_example/.i18nrc.json b/examples/files_example/.i18nrc.json similarity index 100% rename from x-pack/examples/files_example/.i18nrc.json rename to examples/files_example/.i18nrc.json diff --git a/x-pack/examples/files_example/README.md b/examples/files_example/README.md similarity index 100% rename from x-pack/examples/files_example/README.md rename to examples/files_example/README.md diff --git a/examples/files_example/common/index.ts b/examples/files_example/common/index.ts new file mode 100644 index 0000000000000..566edb64b4240 --- /dev/null +++ b/examples/files_example/common/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { FileKind, FileImageMetadata } from '@kbn/files-plugin/common'; + +export const PLUGIN_ID = 'filesExample'; +export const PLUGIN_NAME = 'Files example'; + +const httpTags = { + tags: [`access:${PLUGIN_ID}`], +}; + +export const exampleFileKind: FileKind = { + id: PLUGIN_ID, + allowedMimeTypes: ['image/png'], + http: { + create: httpTags, + delete: httpTags, + download: httpTags, + getById: httpTags, + list: httpTags, + share: httpTags, + update: httpTags, + }, +}; + +export type MyImageMetadata = FileImageMetadata; diff --git a/x-pack/examples/files_example/kibana.json b/examples/files_example/kibana.json similarity index 100% rename from x-pack/examples/files_example/kibana.json rename to examples/files_example/kibana.json diff --git a/x-pack/examples/files_example/public/application.tsx b/examples/files_example/public/application.tsx similarity index 84% rename from x-pack/examples/files_example/public/application.tsx rename to examples/files_example/public/application.tsx index 0bad6975c6da0..0795ec3a77420 100644 --- a/x-pack/examples/files_example/public/application.tsx +++ b/examples/files_example/public/application.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/examples/files_example/public/components/app.tsx b/examples/files_example/public/components/app.tsx similarity index 92% rename from x-pack/examples/files_example/public/components/app.tsx rename to examples/files_example/public/components/app.tsx index d3dfbdeb71874..1f77ca9566cbc 100644 --- a/x-pack/examples/files_example/public/components/app.tsx +++ b/examples/files_example/public/components/app.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { useState } from 'react'; @@ -36,8 +37,10 @@ interface FilesExampleAppDeps { type ListResponse = FilesClientResponses['list']; export const FilesExampleApp = ({ files, notifications }: FilesExampleAppDeps) => { - const { data, isLoading, error, refetch } = useQuery(['files'], () => - files.example.list() + const { data, isLoading, error, refetch } = useQuery( + ['files'], + () => files.example.list(), + { refetchOnWindowFocus: false } ); const [showUploadModal, setShowUploadModal] = useState(false); const [showFilePickerModal, setShowFilePickerModal] = useState(false); @@ -167,6 +170,11 @@ export const FilesExampleApp = ({ files, notifications }: FilesExampleAppDeps) = {showFilePickerModal && ( setShowFilePickerModal(false)} + onUpload={() => { + notifications.toasts.addSuccess({ + title: 'Uploaded files', + }); + }} onDone={(ids) => { notifications.toasts.addSuccess({ title: 'Selected files!', diff --git a/x-pack/examples/files_example/public/components/confirm_button.tsx b/examples/files_example/public/components/confirm_button.tsx similarity index 85% rename from x-pack/examples/files_example/public/components/confirm_button.tsx rename to examples/files_example/public/components/confirm_button.tsx index 05e64243bb374..b60f84b3369d0 100644 --- a/x-pack/examples/files_example/public/components/confirm_button.tsx +++ b/examples/files_example/public/components/confirm_button.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { useState, FunctionComponent } from 'react'; diff --git a/x-pack/examples/files_example/public/components/details_flyout.tsx b/examples/files_example/public/components/details_flyout.tsx similarity index 94% rename from x-pack/examples/files_example/public/components/details_flyout.tsx rename to examples/files_example/public/components/details_flyout.tsx index a417752d1a666..0303095a11a09 100644 --- a/x-pack/examples/files_example/public/components/details_flyout.tsx +++ b/examples/files_example/public/components/details_flyout.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import moment from 'moment'; import type { FunctionComponent } from 'react'; import React from 'react'; diff --git a/examples/files_example/public/components/file_picker.tsx b/examples/files_example/public/components/file_picker.tsx new file mode 100644 index 0000000000000..220ca917b78b6 --- /dev/null +++ b/examples/files_example/public/components/file_picker.tsx @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import type { FunctionComponent } from 'react'; + +import { exampleFileKind } from '../../common'; + +import { FilePicker } from '../imports'; + +interface Props { + onClose: () => void; + onUpload: (ids: string[]) => void; + onDone: (ids: string[]) => void; +} + +export const MyFilePicker: FunctionComponent = ({ onClose, onDone, onUpload }) => { + return ( + onUpload(n.map(({ id }) => id))} + pageSize={50} + multiple + /> + ); +}; diff --git a/x-pack/examples/files_example/public/components/modal.tsx b/examples/files_example/public/components/modal.tsx similarity index 84% rename from x-pack/examples/files_example/public/components/modal.tsx rename to examples/files_example/public/components/modal.tsx index d8289257617cf..a314e5bd8ea4e 100644 --- a/x-pack/examples/files_example/public/components/modal.tsx +++ b/examples/files_example/public/components/modal.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FunctionComponent } from 'react'; diff --git a/examples/files_example/public/imports.ts b/examples/files_example/public/imports.ts new file mode 100644 index 0000000000000..f21a30a390e60 --- /dev/null +++ b/examples/files_example/public/imports.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { + type FilesClient, + type FilesSetup, + type FilesStart, + UploadFile, + FilesContext, + type ScopedFilesClient, + FilePicker, + Image, +} from '@kbn/files-plugin/public'; + +export type { DeveloperExamplesSetup } from '@kbn/developer-examples-plugin/public'; diff --git a/examples/files_example/public/index.ts b/examples/files_example/public/index.ts new file mode 100644 index 0000000000000..e3128e6064517 --- /dev/null +++ b/examples/files_example/public/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FilesExamplePlugin } from './plugin'; + +// This exports static code and TypeScript types, +// as well as, Kibana Platform `plugin()` initializer. +export function plugin() { + return new FilesExamplePlugin(); +} diff --git a/examples/files_example/public/plugin.ts b/examples/files_example/public/plugin.ts new file mode 100644 index 0000000000000..ba0b1dfd54378 --- /dev/null +++ b/examples/files_example/public/plugin.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AppNavLinkStatus } from '@kbn/core-application-browser'; +import { AppMountParameters, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +import { PLUGIN_ID, PLUGIN_NAME, exampleFileKind, MyImageMetadata } from '../common'; +import { FilesExamplePluginsStart, FilesExamplePluginsSetup } from './types'; + +export class FilesExamplePlugin + implements Plugin +{ + public setup( + core: CoreSetup, + { files, developerExamples }: FilesExamplePluginsSetup + ) { + files.registerFileKind(exampleFileKind); + + developerExamples.register({ + appId: PLUGIN_ID, + title: PLUGIN_NAME, + description: 'Example plugin for the files plugin', + }); + + core.application.register({ + id: PLUGIN_ID, + title: PLUGIN_NAME, + navLinkStatus: AppNavLinkStatus.hidden, + async mount(params: AppMountParameters) { + // Load application bundle + const { renderApp } = await import('./application'); + // Get start services as specified in kibana.json + const [coreStart, deps] = await core.getStartServices(); + // Render the application + return renderApp( + coreStart, + { + files: { + unscoped: deps.files.filesClientFactory.asUnscoped(), + example: deps.files.filesClientFactory.asScoped(exampleFileKind.id), + }, + }, + params + ); + }, + }); + + // Return methods that should be available to other plugins + return {}; + } + + public start(core: CoreStart) { + return {}; + } + + public stop() {} +} diff --git a/examples/files_example/public/types.ts b/examples/files_example/public/types.ts new file mode 100644 index 0000000000000..4ca9eb148872f --- /dev/null +++ b/examples/files_example/public/types.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { MyImageMetadata } from '../common'; +import type { + FilesSetup, + FilesStart, + ScopedFilesClient, + FilesClient, + DeveloperExamplesSetup, +} from './imports'; + +export interface FilesExamplePluginsSetup { + files: FilesSetup; + developerExamples: DeveloperExamplesSetup; +} + +export interface FilesExamplePluginsStart { + files: FilesStart; +} + +export interface FileClients { + unscoped: FilesClient; + // Example file kind + example: ScopedFilesClient; +} + +export interface AppPluginStartDependencies { + files: FileClients; +} diff --git a/examples/files_example/server/index.ts b/examples/files_example/server/index.ts new file mode 100644 index 0000000000000..d7edefbe1876d --- /dev/null +++ b/examples/files_example/server/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginInitializerContext } from '@kbn/core/server'; +import { FilesExamplePlugin } from './plugin'; + +// This exports static code and TypeScript types, +// as well as, Kibana Platform `plugin()` initializer. + +export function plugin(initializerContext: PluginInitializerContext) { + return new FilesExamplePlugin(initializerContext); +} diff --git a/examples/files_example/server/plugin.ts b/examples/files_example/server/plugin.ts new file mode 100644 index 0000000000000..5ab9571a64207 --- /dev/null +++ b/examples/files_example/server/plugin.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '@kbn/core/server'; +import { exampleFileKind } from '../common'; +import type { FilesExamplePluginsSetup, FilesExamplePluginsStart } from './types'; + +export class FilesExamplePlugin + implements Plugin +{ + private readonly logger: Logger; + + constructor(initializerContext: PluginInitializerContext) { + this.logger = initializerContext.logger.get(); + } + + public setup(core: CoreSetup, { files }: FilesExamplePluginsSetup) { + this.logger.debug('filesExample: Setup'); + + files.registerFileKind(exampleFileKind); + + return {}; + } + + public start(core: CoreStart) { + this.logger.debug('filesExample: Started'); + return {}; + } + + public stop() {} +} diff --git a/examples/files_example/server/types.ts b/examples/files_example/server/types.ts new file mode 100644 index 0000000000000..7f12e7fd94a1c --- /dev/null +++ b/examples/files_example/server/types.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { FilesSetup, FilesStart } from '@kbn/files-plugin/server'; + +export interface FilesExamplePluginsSetup { + files: FilesSetup; +} + +export interface FilesExamplePluginsStart { + files: FilesStart; +} diff --git a/examples/files_example/tsconfig.json b/examples/files_example/tsconfig.json new file mode 100644 index 0000000000000..2ce0ddb8f7d66 --- /dev/null +++ b/examples/files_example/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "index.ts", + "common/**/*", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../typings/**/*" + ], + "exclude": [], + "kbn_references": [ + { "path": "../../src/core/tsconfig.json" }, + { "path": "../developer_examples/tsconfig.json" }, + { "path": "../../src/plugins/files/tsconfig.json" }, + ] +} diff --git a/examples/guided_onboarding_example/public/components/app.tsx b/examples/guided_onboarding_example/public/components/app.tsx index a5252920c27fa..ae55f3d3811dc 100755 --- a/examples/guided_onboarding_example/public/components/app.tsx +++ b/examples/guided_onboarding_example/public/components/app.tsx @@ -59,7 +59,7 @@ export const GuidedOnboardingExampleApp = (props: GuidedOnboardingExampleAppDeps - + diff --git a/examples/guided_onboarding_example/public/components/main.tsx b/examples/guided_onboarding_example/public/components/main.tsx index a65fd2324d34b..d3636470ec64e 100644 --- a/examples/guided_onboarding_example/public/components/main.tsx +++ b/examples/guided_onboarding_example/public/components/main.tsx @@ -216,7 +216,8 @@ export const Main = (props: MainProps) => { )} {(guideState?.isActive === true || guideState?.status === 'in_progress' || - guideState?.status === 'ready_to_complete') && ( + guideState?.status === 'ready_to_complete' || + guideState?.status === 'not_started') && ( { { value: 'observability', text: 'observability' }, { value: 'security', text: 'security' }, { value: 'search', text: 'search' }, + { value: 'testGuide', text: 'test guide' }, ]} value={selectedGuide} onChange={(e) => { @@ -294,7 +296,7 @@ export const Main = (props: MainProps) => {

@@ -316,6 +318,14 @@ export const Main = (props: MainProps) => { /> + + history.push('stepThree')}> + + + diff --git a/examples/guided_onboarding_example/public/components/step_one.tsx b/examples/guided_onboarding_example/public/components/step_one.tsx index 3441b4d8e5d99..fd5cb132b6b91 100644 --- a/examples/guided_onboarding_example/public/components/step_one.tsx +++ b/examples/guided_onboarding_example/public/components/step_one.tsx @@ -32,7 +32,7 @@ export const StepOne = ({ guidedOnboarding }: GuidedOnboardingExampleAppDeps) => const [isTourStepOpen, setIsTourStepOpen] = useState(false); const isTourActive = useObservable( - guidedOnboardingApi!.isGuideStepActive$('search', 'add_data'), + guidedOnboardingApi!.isGuideStepActive$('testGuide', 'step1'), false ); useEffect(() => { @@ -45,7 +45,7 @@ export const StepOne = ({ guidedOnboarding }: GuidedOnboardingExampleAppDeps) =>

@@ -56,7 +56,7 @@ export const StepOne = ({ guidedOnboarding }: GuidedOnboardingExampleAppDeps) =>

@@ -72,12 +72,12 @@ export const StepOne = ({ guidedOnboarding }: GuidedOnboardingExampleAppDeps) => onFinish={() => setIsTourStepOpen(false)} step={1} stepsTotal={1} - title="Step Add data" + title="Step 1" anchorPosition="rightUp" > { - await guidedOnboardingApi?.completeGuideStep('search', 'add_data'); + await guidedOnboardingApi?.completeGuideStep('testGuide', 'step1'); }} > Complete step 1 diff --git a/examples/guided_onboarding_example/public/components/step_three.tsx b/examples/guided_onboarding_example/public/components/step_three.tsx index ffe9d87993611..eefb38165beed 100644 --- a/examples/guided_onboarding_example/public/components/step_three.tsx +++ b/examples/guided_onboarding_example/public/components/step_three.tsx @@ -30,7 +30,7 @@ export const StepThree = (props: StepThreeProps) => { useEffect(() => { const subscription = guidedOnboardingApi - ?.isGuideStepActive$('search', 'search_experience') + ?.isGuideStepActive$('testGuide', 'step3') .subscribe((isStepActive) => { setIsTourStepOpen(isStepActive); }); @@ -53,9 +53,17 @@ export const StepThree = (props: StepThreeProps) => {

+

+

+

@@ -73,12 +81,12 @@ export const StepThree = (props: StepThreeProps) => { }} step={1} stepsTotal={1} - title="Step Build search experience" + title="Step 3" anchorPosition="rightUp" > { - await guidedOnboardingApi?.completeGuideStep('search', 'search_experience'); + await guidedOnboardingApi?.completeGuideStep('testGuide', 'step3'); }} > Complete step 3 diff --git a/examples/guided_onboarding_example/public/components/step_two.tsx b/examples/guided_onboarding_example/public/components/step_two.tsx index 07f4fd7e63e0c..89c0c37e46e4a 100644 --- a/examples/guided_onboarding_example/public/components/step_two.tsx +++ b/examples/guided_onboarding_example/public/components/step_two.tsx @@ -6,37 +6,17 @@ * Side Public License, v 1. */ -import React, { useEffect, useState } from 'react'; +import React from 'react'; -import { EuiButton, EuiSpacer, EuiText, EuiTitle, EuiTourStep } from '@elastic/eui'; +import { EuiText, EuiTitle } from '@elastic/eui'; -import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public/types'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContentHeader_Deprecated as EuiPageContentHeader, EuiPageContentBody_Deprecated as EuiPageContentBody, } from '@elastic/eui'; -interface StepTwoProps { - guidedOnboarding: GuidedOnboardingPluginStart; -} - -export const StepTwo = (props: StepTwoProps) => { - const { - guidedOnboarding: { guidedOnboardingApi }, - } = props; - - const [isTourStepOpen, setIsTourStepOpen] = useState(false); - - useEffect(() => { - const subscription = guidedOnboardingApi - ?.isGuideStepActive$('search', 'browse_docs') - .subscribe((isStepActive) => { - setIsTourStepOpen(isStepActive); - }); - return () => subscription?.unsubscribe(); - }, [guidedOnboardingApi]); - +export const StepTwo = () => { return ( <> @@ -54,36 +34,11 @@ export const StepTwo = (props: StepTwoProps) => {

- - -

Click this button to complete step 2.

- - } - isStepOpen={isTourStepOpen} - minWidth={300} - onFinish={() => { - setIsTourStepOpen(false); - }} - step={1} - stepsTotal={1} - title="Step Browse documents" - anchorPosition="rightUp" - > - { - await guidedOnboardingApi?.completeGuideStep('search', 'browse_docs'); - }} - > - Complete step 2 - -
); diff --git a/examples/guided_onboarding_example/tsconfig.json b/examples/guided_onboarding_example/tsconfig.json index 177f63fa7a449..579818d8cbf76 100644 --- a/examples/guided_onboarding_example/tsconfig.json +++ b/examples/guided_onboarding_example/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "__jest__/**/*", @@ -13,7 +12,7 @@ "server/**/*", "../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, diff --git a/examples/hello_world/tsconfig.json b/examples/hello_world/tsconfig.json index b494fba903415..f074171954048 100644 --- a/examples/hello_world/tsconfig.json +++ b/examples/hello_world/tsconfig.json @@ -12,7 +12,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../developer_examples/tsconfig.json" } ] diff --git a/examples/locator_examples/tsconfig.json b/examples/locator_examples/tsconfig.json index 5010ad5a5fe0f..43d13f87d005f 100644 --- a/examples/locator_examples/tsconfig.json +++ b/examples/locator_examples/tsconfig.json @@ -11,7 +11,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/share/tsconfig.json" }, ] diff --git a/examples/locator_explorer/tsconfig.json b/examples/locator_explorer/tsconfig.json index 2fa75fc163fdd..c609c50849cb4 100644 --- a/examples/locator_explorer/tsconfig.json +++ b/examples/locator_explorer/tsconfig.json @@ -11,7 +11,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/share/tsconfig.json" }, { "path": "../locator_examples/tsconfig.json" }, diff --git a/examples/partial_results_example/public/app/app.tsx b/examples/partial_results_example/public/app/app.tsx index 8988b631a8e94..5f72fb356195a 100644 --- a/examples/partial_results_example/public/app/app.tsx +++ b/examples/partial_results_example/public/app/app.tsx @@ -37,7 +37,7 @@ export function App() { useEffect(() => { const subscription = expressions - ?.execute(expression, null) + ?.execute(expression, null, { partial: true }) .getData() .pipe(pluck('result')) .subscribe((value) => setDatatable(value as Datatable)); diff --git a/examples/partial_results_example/tsconfig.json b/examples/partial_results_example/tsconfig.json index 911cd4a36ed46..ba03cbc836189 100644 --- a/examples/partial_results_example/tsconfig.json +++ b/examples/partial_results_example/tsconfig.json @@ -11,7 +11,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../developer_examples/tsconfig.json" }, { "path": "../../src/plugins/expressions/tsconfig.json" }, diff --git a/examples/preboot_example/tsconfig.json b/examples/preboot_example/tsconfig.json index e5b5eda0c6478..270d718917518 100644 --- a/examples/preboot_example/tsconfig.json +++ b/examples/preboot_example/tsconfig.json @@ -4,8 +4,7 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["public/**/*", "server/**/*"], - "references": [{ "path": "../../src/core/tsconfig.json" }] + "kbn_references": [{ "path": "../../src/core/tsconfig.json" }] } diff --git a/examples/response_stream/tsconfig.json b/examples/response_stream/tsconfig.json index 9641610c54283..162ecac0dca93 100644 --- a/examples/response_stream/tsconfig.json +++ b/examples/response_stream/tsconfig.json @@ -12,7 +12,7 @@ "../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../developer_examples/tsconfig.json" }, { "path": "../../src/plugins/data/tsconfig.json" }, diff --git a/examples/routing_example/tsconfig.json b/examples/routing_example/tsconfig.json index e47bf1c9bedb8..b3962d53fa4f3 100644 --- a/examples/routing_example/tsconfig.json +++ b/examples/routing_example/tsconfig.json @@ -12,7 +12,7 @@ "../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../developer_examples/tsconfig.json" }, ] diff --git a/examples/screenshot_mode_example/tsconfig.json b/examples/screenshot_mode_example/tsconfig.json index ef35abc699c66..5fc60b67ef569 100644 --- a/examples/screenshot_mode_example/tsconfig.json +++ b/examples/screenshot_mode_example/tsconfig.json @@ -12,7 +12,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/navigation/tsconfig.json" }, { "path": "../../src/plugins/screenshot_mode/tsconfig.json" }, diff --git a/examples/search_examples/tsconfig.json b/examples/search_examples/tsconfig.json index 3086b9651984c..ef6c3e9c307e2 100644 --- a/examples/search_examples/tsconfig.json +++ b/examples/search_examples/tsconfig.json @@ -12,7 +12,7 @@ "../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/data/tsconfig.json" }, { "path": "../../src/plugins/data_views/tsconfig.json" }, diff --git a/examples/share_examples/tsconfig.json b/examples/share_examples/tsconfig.json index 5010ad5a5fe0f..43d13f87d005f 100644 --- a/examples/share_examples/tsconfig.json +++ b/examples/share_examples/tsconfig.json @@ -11,7 +11,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/share/tsconfig.json" }, ] diff --git a/examples/state_containers_examples/tsconfig.json b/examples/state_containers_examples/tsconfig.json index 40b66f9fc9c7b..09652684fecfa 100644 --- a/examples/state_containers_examples/tsconfig.json +++ b/examples/state_containers_examples/tsconfig.json @@ -12,7 +12,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../src/plugins/kibana_react/tsconfig.json" }, diff --git a/examples/ui_action_examples/tsconfig.json b/examples/ui_action_examples/tsconfig.json index 41d91ac4b9be6..3a141670cb3fe 100644 --- a/examples/ui_action_examples/tsconfig.json +++ b/examples/ui_action_examples/tsconfig.json @@ -11,7 +11,7 @@ "../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../src/plugins/ui_actions/tsconfig.json" }, ] diff --git a/examples/ui_actions_explorer/tsconfig.json b/examples/ui_actions_explorer/tsconfig.json index 6debf7c0c650a..cfa13411c270d 100644 --- a/examples/ui_actions_explorer/tsconfig.json +++ b/examples/ui_actions_explorer/tsconfig.json @@ -10,7 +10,7 @@ "../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../src/plugins/ui_actions/tsconfig.json" }, diff --git a/examples/user_profile_examples/tsconfig.json b/examples/user_profile_examples/tsconfig.json index da98fc26aa8f2..f1d9145a39c1b 100644 --- a/examples/user_profile_examples/tsconfig.json +++ b/examples/user_profile_examples/tsconfig.json @@ -11,7 +11,7 @@ "../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../src/core/tsconfig.json" }, { "path": "../../x-pack/plugins/security/tsconfig.json" }, { "path": "../developer_examples/tsconfig.json" } diff --git a/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs b/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs index 25930ed2a20a1..e00316aac3e77 100644 --- a/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs +++ b/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs @@ -12,6 +12,7 @@ import { haveNodeModulesBeenManuallyDeleted, removeYarnIntegrityFileIfExists } f import { setupRemoteCache } from './setup_remote_cache.mjs'; import { regenerateSyntheticPackageMap } from './regenerate_synthetic_package_map.mjs'; import { sortPackageJson } from './sort_package_json.mjs'; +import { REPO_ROOT } from '../../lib/paths.mjs'; import { pluginDiscovery } from './plugins.mjs'; import { regenerateBaseTsconfig } from './regenerate_base_tsconfig.mjs'; @@ -99,7 +100,8 @@ export const command = { await sortPackageJson(); }); await time('regenerate tsconfig.base.json', async () => { - await regenerateBaseTsconfig(plugins); + const { discoverBazelPackages } = await import('@kbn/bazel-packages'); + await regenerateBaseTsconfig(await discoverBazelPackages(REPO_ROOT), plugins); }); if (validate) { diff --git a/kbn_pm/src/commands/bootstrap/regenerate_base_tsconfig.mjs b/kbn_pm/src/commands/bootstrap/regenerate_base_tsconfig.mjs index 3cf71531614a5..e7fc7fd2be48e 100644 --- a/kbn_pm/src/commands/bootstrap/regenerate_base_tsconfig.mjs +++ b/kbn_pm/src/commands/bootstrap/regenerate_base_tsconfig.mjs @@ -14,13 +14,27 @@ import { convertPluginIdToPackageId } from './plugins.mjs'; import { normalizePath } from './normalize_path.mjs'; /** + * @param {import('@kbn/bazel-packages').BazelPackage[]} packages * @param {import('@kbn/plugin-discovery').KibanaPlatformPlugin[]} plugins */ -export async function regenerateBaseTsconfig(plugins) { +export async function regenerateBaseTsconfig(packages, plugins) { const tsconfigPath = Path.resolve(REPO_ROOT, 'tsconfig.base.json'); const lines = (await Fsp.readFile(tsconfigPath, 'utf-8')).split('\n'); - const packageMap = plugins + const packagesMap = packages + .slice() + .sort((a, b) => a.normalizedRepoRelativeDir.localeCompare(b.normalizedRepoRelativeDir)) + .flatMap((p) => { + if (!p.pkg) { + return []; + } + + const id = p.pkg.name; + const path = p.normalizedRepoRelativeDir; + return [` "${id}": ["${path}"],`, ` "${id}/*": ["${path}/*"],`]; + }); + + const pluginsMap = plugins .slice() .sort((a, b) => a.manifestPath.localeCompare(b.manifestPath)) .flatMap((p) => { @@ -32,8 +46,15 @@ export async function regenerateBaseTsconfig(plugins) { const start = lines.findIndex((l) => l.trim() === '// START AUTOMATED PACKAGE LISTING'); const end = lines.findIndex((l) => l.trim() === '// END AUTOMATED PACKAGE LISTING'); - await Fsp.writeFile( - tsconfigPath, - [...lines.slice(0, start + 1), ...packageMap, ...lines.slice(end)].join('\n') - ); + const current = await Fsp.readFile(tsconfigPath, 'utf8'); + const updated = [ + ...lines.slice(0, start + 1), + ...packagesMap, + ...pluginsMap, + ...lines.slice(end), + ].join('\n'); + + if (updated !== current) { + await Fsp.writeFile(tsconfigPath, updated); + } } diff --git a/kbn_pm/src/commands/projects.js b/kbn_pm/src/commands/projects.js new file mode 100644 index 0000000000000..8ebd3be073d07 --- /dev/null +++ b/kbn_pm/src/commands/projects.js @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +const { PROJECTS } = require('../../../src/dev/typescript/projects'); +module.exports = { PROJECTS }; diff --git a/kbn_pm/src/commands/test_command.mjs b/kbn_pm/src/commands/test_command.mjs index e425c5b94698d..f585536ea5d40 100644 --- a/kbn_pm/src/commands/test_command.mjs +++ b/kbn_pm/src/commands/test_command.mjs @@ -6,10 +6,267 @@ * Side Public License, v 1. */ +import Fs from 'fs'; +import Path from 'path'; + +import { REPO_ROOT } from '../lib/paths.mjs'; +import { pluginDiscovery } from './bootstrap/plugins.mjs'; + +const RULE_DEPS = /([\s\n]deps\s*=\s*)((?:\w+(?: \+ )?)?(?:\[[^\]]*\])?)(\s*,|\s*\))/; + +/** + * @param {string} text + * @param {number} index + */ +function findStartOfLine(text, index) { + let cursor = index; + while (cursor > 0) { + if (text[cursor - 1] === '\n') { + return cursor; + } + cursor -= 1; + } + + return cursor; +} + +/** + * @param {string} starlark + * @param {string} name + */ +function findBazelRule(starlark, name) { + const match = starlark.match(new RegExp(`name\\s*=\\s*${name}`)); + if (typeof match?.index !== 'number') { + throw new Error(`unable to find rule named [${name}]`); + } + + const openParen = starlark.slice(0, match.index).lastIndexOf('('); + if (openParen === -1) { + throw new Error(`unable to find opening paren for rule [${name}] [index=${match.index}]`); + } + + const start = findStartOfLine(starlark, openParen); + const end = starlark.indexOf(')', start); + if (end === -1) { + throw new Error(`unable to find closing parent for rule [${name}] [start=${start}]`); + } + + const type = starlark.slice(start, starlark.indexOf('(', start)).trim(); + + // add 1 so that the "end" chunk starts after the closing ) + return { start, end: end + 1, type }; +} + +/** + * @param {string} starlark + * @param {string} name + */ +function removeBazelRule(starlark, name) { + const pos = findBazelRule(starlark, name); + + let end = pos.end; + + // slurp up all the newlines directly after the closing ) + while (starlark[end] === '\n') { + end += 1; + } + + return starlark.slice(0, pos.start) + starlark.slice(end); +} + +/** + * @param {string} starlark + * @param {string} dep + * @returns + */ +function addDep(starlark, dep) { + const depsMatch = starlark.match(RULE_DEPS); + + if (typeof depsMatch?.index !== 'number') { + return starlark.replace(/,?[\s\n]*\)[\s\n]*$/, '') + `,\n deps = [${dep}],\n)`; + } + + const [, head, value, tail] = depsMatch; + + return ( + starlark.slice(0, depsMatch.index) + + head + + (() => { + const multiline = value.includes('\n'); + const existingArray = value.indexOf(']'); + if (existingArray === -1) { + return value + ` + [${dep}]`; + } + + const valHead = value.slice(0, existingArray).replace(/,?\s*$/, ','); + const valTail = value.slice(existingArray); + + return `${valHead}${multiline ? '\n ' : ' '}${dep}${multiline ? ',\n' : ''}${valTail}`; + })() + + tail + + starlark.slice(depsMatch.index + depsMatch[0].length) + ); +} + +/** + * @param {string} starlark + * @param {string} name + * @param {string} newName + * @param {(rule: string) => string} mod + */ +function duplicateRule(starlark, name, newName, mod) { + const origPos = findBazelRule(starlark, name); + + const orig = starlark.slice(origPos.start, origPos.end); + + const withName = orig.replace( + /^(\s*)name\s*=\s*.*$/m, + (match, head) => `${head}name = ${newName}${match.endsWith(',') ? ',' : ''}` + ); + + return starlark.slice(0, origPos.end) + `\n\n${mod(withName)}` + starlark.slice(origPos.end); +} + /** @type {import('../lib/command').Command} */ export const command = { name: '_test', async run({ log }) { - log.success('empty'); + const updates = { pkgJson: 0, buildBazel: 0, tsconfig: 0, tsconfigRefs: 0 }; + + await import('../../../src/setup_node_env/index' + '.js'); + const { PROJECTS } = await import('./projects' + '.js'); + const { discoverBazelPackages } = await import('@kbn/bazel-packages'); + const pkgs = await discoverBazelPackages(REPO_ROOT); + const plugins = await pluginDiscovery(); + + // update package.json files to point to their target_types dir + const relTypes = './target_types/index.d.ts'; + for (const pkg of pkgs) { + if (!pkg.hasBuildTypesRule()) { + log.warning(`not defining "types" for ${pkg.manifest.id} because it doesn't build types`); + continue; + } + + const dir = Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir); + const pkgJsonPath = Path.resolve(dir, 'package.json'); + + const pkgJson = Fs.readFileSync(pkgJsonPath, 'utf8'); + const parsed = JSON.parse(pkgJson); + + if (parsed.types === relTypes) { + continue; + } + + Fs.writeFileSync( + pkgJsonPath, + JSON.stringify( + { + ...parsed, + types: relTypes, + }, + null, + 2 + ) + (pkgJson.endsWith('\n') ? '\n' : '') + ); + + updates.pkgJson += 1; + } + log.success(`updated ${updates.pkgJson} package.json files`); + + // update BUILD.bazel files to not rely on type_summarizer + for (const pkg of pkgs) { + if (!pkg.hasBuildTypesRule()) { + continue; + } + + const starlark = pkg.buildBazelContent; + if (typeof starlark !== 'string') { + throw new Error('missing buildBazelContent'); + } + + const npmTypes = findBazelRule(starlark, '"npm_module_types"'); + + if (npmTypes.type === 'alias') { + log.info(`ignoring npm_module_types rule which is an alias in ${pkg.manifest.id}`); + continue; + } + + // remove rules for old npm_module_types + const withoutOldTypes = removeBazelRule(starlark, '"npm_module_types"'); + + // duplicate js_library rule and name npm_module_types rule which adds the ':tsc_types' dep + const withTypesJsLib = duplicateRule( + withoutOldTypes, + 'PKG_DIRNAME', + '"npm_module_types"', + (newRule) => addDep(newRule, '":tsc_types"') + ); + + const withBuildTypesWrapper = + removeBazelRule(withTypesJsLib, '"build_types"').trimEnd() + + ` + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) +`; + + Fs.writeFileSync( + Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir, 'BUILD.bazel'), + withBuildTypesWrapper + ); + + updates.buildBazel += 1; + } + log.success(`updated ${updates.buildBazel} BUILD.bazel files`); + + // stop enabling declaration source maps in tsconfig + for (const pkg of [...pkgs, ...plugins]) { + const dir = + 'normalizedRepoRelativeDir' in pkg + ? Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir) + : pkg.directory; + + let changed; + + const tsconfigPath = Path.resolve(dir, 'tsconfig.json'); + if (Fs.existsSync(tsconfigPath)) { + const current = Fs.readFileSync(tsconfigPath, 'utf8'); + const next = current.replace(/\n\s*"declarationMap"\s*:.+\n/m, '\n'); + + if (current !== next) { + changed = true; + Fs.writeFileSync(tsconfigPath, next); + } + } + + const buildBazelPath = Path.resolve(dir, 'BUILD.bazel'); + if (Fs.existsSync(buildBazelPath)) { + const current = Fs.readFileSync(buildBazelPath, 'utf8'); + const next = current.replace(/\n.*\bdeclaration_map\b.*\n/, '\n'); + if (current !== next) { + changed = true; + Fs.writeFileSync(buildBazelPath, next); + } + } + + if (changed) { + updates.tsconfig += 1; + } + } + log.success(`dropped declarationMap from ${updates.tsconfig} tsconfig.json files`); + + // rename "references" in plugin tsconfig.json files to "kbn_references" + for (const project of PROJECTS) { + const tsconfigJson = Fs.readFileSync(project.tsConfigPath, 'utf8'); + const updated = tsconfigJson.replace('"references"', '"kbn_references"'); + if (updated !== tsconfigJson) { + Fs.writeFileSync(project.tsConfigPath, updated); + updates.tsconfigRefs += 1; + } + } + log.success(`updated tsconfig references key in ${updates.tsconfigRefs} tsconfig.json files`); }, }; diff --git a/kbn_pm/tsconfig.json b/kbn_pm/tsconfig.json index 06582d6dbd655..f8ef60867aca2 100644 --- a/kbn_pm/tsconfig.json +++ b/kbn_pm/tsconfig.json @@ -2,9 +2,7 @@ "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "target", - "allowJs": true, "checkJs": true, - "composite": false, "target": "ES2022", "module": "ESNext" }, diff --git a/nav-kibana-dev.docnav.json b/nav-kibana-dev.docnav.json index 14e27632c33f4..8b49d43be942a 100644 --- a/nav-kibana-dev.docnav.json +++ b/nav-kibana-dev.docnav.json @@ -106,6 +106,10 @@ }, { "id": "kibDevDocsEmbeddables" + }, + { + "id": "kibCloudExperimentsPlugin", + "label": "A/B testing on Elastic Cloud" } ] }, diff --git a/package.json b/package.json index 909f468342b82..3be3cc131c27c 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "bazel": "bazel", "build": "node scripts/build --all-platforms", "build:apidocs": "node scripts/build_api_docs", - "build:types": "rm -rf ./target/types && tsc --p tsconfig.types.json", "checkLicenses": "node scripts/check_licenses --dev", "cover:functional:merge": "nyc report --temp-dir target/kibana-coverage/functional --report-dir target/coverage/report/functional --reporter=json-summary", "cover:report": "nyc report --temp-dir target/kibana-coverage/functional --report-dir target/coverage/report --reporter=lcov && open ./target/coverage/report/lcov-report/index.html", @@ -73,6 +72,7 @@ "yarn": "^1.22.19" }, "resolutions": { + "**/@tanstack/match-sorter-utils": "8.1.1", "**/@types/node": "16.11.41", "**/chokidar": "^3.5.3", "**/deepmerge": "^4.2.2", @@ -93,7 +93,6 @@ "**/typescript": "4.6.3", "**/use-composed-ref": "^1.3.0", "**/use-latest": "^1.2.1", - "@tanstack/query-core": "^4.2.1", "globby/fast-glob": "^3.2.11", "puppeteer/node-fetch": "^2.6.7" }, @@ -162,6 +161,7 @@ "@kbn/core-application-common": "link:bazel-bin/packages/core/application/core-application-common", "@kbn/core-apps-browser-internal": "link:bazel-bin/packages/core/apps/core-apps-browser-internal", "@kbn/core-apps-browser-mocks": "link:bazel-bin/packages/core/apps/core-apps-browser-mocks", + "@kbn/core-apps-server-internal": "link:bazel-bin/packages/core/apps/core-apps-server-internal", "@kbn/core-base-browser-internal": "link:bazel-bin/packages/core/base/core-base-browser-internal", "@kbn/core-base-browser-mocks": "link:bazel-bin/packages/core/base/core-base-browser-mocks", "@kbn/core-base-common": "link:bazel-bin/packages/core/base/core-base-common", @@ -241,6 +241,12 @@ "@kbn/core-lifecycle-browser": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser", "@kbn/core-lifecycle-browser-internal": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser-internal", "@kbn/core-lifecycle-browser-mocks": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser-mocks", + "@kbn/core-lifecycle-server": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server", + "@kbn/core-lifecycle-server-internal": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server-internal", + "@kbn/core-lifecycle-server-mocks": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server-mocks", + "@kbn/core-logging-browser-internal": "link:bazel-bin/packages/core/logging/core-logging-browser-internal", + "@kbn/core-logging-browser-mocks": "link:bazel-bin/packages/core/logging/core-logging-browser-mocks", + "@kbn/core-logging-common-internal": "link:bazel-bin/packages/core/logging/core-logging-common-internal", "@kbn/core-logging-server": "link:bazel-bin/packages/core/logging/core-logging-server", "@kbn/core-logging-server-internal": "link:bazel-bin/packages/core/logging/core-logging-server-internal", "@kbn/core-logging-server-mocks": "link:bazel-bin/packages/core/logging/core-logging-server-mocks", @@ -264,6 +270,9 @@ "@kbn/core-plugins-browser": "link:bazel-bin/packages/core/plugins/core-plugins-browser", "@kbn/core-plugins-browser-internal": "link:bazel-bin/packages/core/plugins/core-plugins-browser-internal", "@kbn/core-plugins-browser-mocks": "link:bazel-bin/packages/core/plugins/core-plugins-browser-mocks", + "@kbn/core-plugins-server": "link:bazel-bin/packages/core/plugins/core-plugins-server", + "@kbn/core-plugins-server-internal": "link:bazel-bin/packages/core/plugins/core-plugins-server-internal", + "@kbn/core-plugins-server-mocks": "link:bazel-bin/packages/core/plugins/core-plugins-server-mocks", "@kbn/core-preboot-server": "link:bazel-bin/packages/core/preboot/core-preboot-server", "@kbn/core-preboot-server-internal": "link:bazel-bin/packages/core/preboot/core-preboot-server-internal", "@kbn/core-preboot-server-mocks": "link:bazel-bin/packages/core/preboot/core-preboot-server-mocks", @@ -431,8 +440,8 @@ "@opentelemetry/semantic-conventions": "^1.4.0", "@reduxjs/toolkit": "1.7.2", "@slack/webhook": "^5.0.4", - "@tanstack/react-query": "^4.2.1", - "@tanstack/react-query-devtools": "^4.2.1", + "@tanstack/react-query": "^4.13.4", + "@tanstack/react-query-devtools": "^4.13.4", "@turf/along": "6.0.1", "@turf/area": "6.0.1", "@turf/bbox": "6.0.1", @@ -450,6 +459,7 @@ "adm-zip": "^0.5.9", "antlr4ts": "^0.5.0-alpha.3", "archiver": "^5.3.1", + "async": "^3.2.3", "axios": "^0.27.2", "base64-js": "^1.3.1", "bitmap-sdf": "^1.0.3", @@ -467,9 +477,8 @@ "commander": "^4.1.1", "compare-versions": "3.5.1", "constate": "^3.3.2", - "content-disposition": "^0.5.4", "copy-to-clipboard": "^3.0.8", - "core-js": "^3.25.5", + "core-js": "^3.26.0", "cronstrue": "^1.51.0", "cuid": "^2.1.8", "cytoscape": "^3.10.0", @@ -509,8 +518,8 @@ "he": "^1.2.0", "history": "^4.9.0", "hjson": "3.2.1", - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^5.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", "i18n-iso-countries": "^4.3.1", "icalendar": "0.7.1", "immer": "^9.0.15", @@ -554,7 +563,7 @@ "moment": "^2.29.4", "moment-duration-format": "^2.3.2", "moment-timezone": "^0.5.34", - "monaco-editor": "^0.22.3", + "monaco-editor": "^0.24.0", "mustache": "^2.3.2", "node-fetch": "^2.6.7", "node-forge": "^1.3.1", @@ -593,7 +602,7 @@ "react-fast-compare": "^2.0.4", "react-focus-on": "^3.6.0", "react-grid-layout": "^1.3.4", - "react-hook-form": "^7.37.0", + "react-hook-form": "^7.38.0", "react-intl": "^2.8.0", "react-is": "^17.0.2", "react-markdown": "^6.0.3", @@ -666,7 +675,7 @@ "vinyl": "^2.2.0", "whatwg-fetch": "^3.0.0", "xml2js": "^0.4.22", - "xterm": "^4.18.0", + "xterm": "^5.0.0", "yauzl": "^2.10.0", "yazl": "^2.5.1" }, @@ -698,16 +707,15 @@ "@cypress/snapshot": "^2.1.7", "@cypress/webpack-preprocessor": "^5.12.2", "@elastic/eslint-plugin-eui": "0.0.2", - "@elastic/github-checks-reporter": "0.0.20b3", - "@elastic/makelogs": "^6.0.0", - "@elastic/synthetics": "^1.0.0-beta.22", + "@elastic/makelogs": "^6.1.1", + "@elastic/synthetics": "^1.0.0-beta.23", "@emotion/babel-preset-css-prop": "^11.10.0", "@emotion/jest": "^11.10.0", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@istanbuljs/schema": "^0.1.2", - "@jest/console": "^26.6.2", - "@jest/reporters": "^26.6.2", - "@jest/types": "^26", + "@jest/console": "^27.5.1", + "@jest/reporters": "^27.5.1", + "@jest/types": "^27", "@kbn/ambient-storybook-types": "link:bazel-bin/packages/kbn-ambient-storybook-types", "@kbn/ambient-ui-types": "link:bazel-bin/packages/kbn-ambient-ui-types", "@kbn/apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace", @@ -790,13 +798,14 @@ "@storybook/react-docgen-typescript-plugin": "^1.0.1", "@storybook/testing-react": "^1.3.0", "@storybook/theming": "^6.5.12", - "@testing-library/dom": "^8.12.0", - "@testing-library/jest-dom": "^5.16.3", + "@testing-library/dom": "^8.17.1", + "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^12.1.5", - "@testing-library/react-hooks": "^7.0.2", + "@testing-library/react-hooks": "^8.0.1", "@testing-library/user-event": "^13.5.0", "@types/apidoc": "^0.22.3", "@types/archiver": "^5.3.1", + "@types/async": "^3.2.3", "@types/babel__core": "^7.1.19", "@types/babel__generator": "^7.6.4", "@types/babel__helper-plugin-utils": "^7.10.0", @@ -843,10 +852,9 @@ "@types/history": "^4.7.9", "@types/hjson": "^2.4.2", "@types/http-proxy": "^1.17.4", - "@types/http-proxy-agent": "^2.0.2", "@types/inquirer": "^7.3.1", "@types/intl-relativeformat": "^2.1.0", - "@types/jest": "^26.0.22", + "@types/jest": "^27.4.1", "@types/jest-axe": "^3.5.3", "@types/joi": "^17.2.3", "@types/jquery": "^3.3.31", @@ -858,340 +866,6 @@ "@types/json-stable-stringify": "^1.0.32", "@types/json5": "^0.0.30", "@types/jsonwebtoken": "^8.5.6", - "@types/kbn__ace": "link:bazel-bin/packages/kbn-ace/npm_module_types", - "@types/kbn__aiops-components": "link:bazel-bin/x-pack/packages/ml/aiops_components/npm_module_types", - "@types/kbn__aiops-utils": "link:bazel-bin/x-pack/packages/ml/aiops_utils/npm_module_types", - "@types/kbn__alerts": "link:bazel-bin/packages/kbn-alerts/npm_module_types", - "@types/kbn__analytics": "link:bazel-bin/packages/kbn-analytics/npm_module_types", - "@types/kbn__analytics-client": "link:bazel-bin/packages/analytics/client/npm_module_types", - "@types/kbn__analytics-shippers-elastic-v3-browser": "link:bazel-bin/packages/analytics/shippers/elastic_v3/browser/npm_module_types", - "@types/kbn__analytics-shippers-elastic-v3-common": "link:bazel-bin/packages/analytics/shippers/elastic_v3/common/npm_module_types", - "@types/kbn__analytics-shippers-elastic-v3-server": "link:bazel-bin/packages/analytics/shippers/elastic_v3/server/npm_module_types", - "@types/kbn__analytics-shippers-fullstory": "link:bazel-bin/packages/analytics/shippers/fullstory/npm_module_types", - "@types/kbn__analytics-shippers-gainsight": "link:bazel-bin/packages/analytics/shippers/gainsight/npm_module_types", - "@types/kbn__apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader/npm_module_types", - "@types/kbn__apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace/npm_module_types", - "@types/kbn__apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module_types", - "@types/kbn__axe-config": "link:bazel-bin/packages/kbn-axe-config/npm_module_types", - "@types/kbn__bazel-packages": "link:bazel-bin/packages/kbn-bazel-packages/npm_module_types", - "@types/kbn__bazel-runner": "link:bazel-bin/packages/kbn-bazel-runner/npm_module_types", - "@types/kbn__cases-components": "link:bazel-bin/packages/kbn-cases-components/npm_module_types", - "@types/kbn__chart-icons": "link:bazel-bin/packages/kbn-chart-icons/npm_module_types", - "@types/kbn__ci-stats-core": "link:bazel-bin/packages/kbn-ci-stats-core/npm_module_types", - "@types/kbn__ci-stats-performance-metrics": "link:bazel-bin/packages/kbn-ci-stats-performance-metrics/npm_module_types", - "@types/kbn__ci-stats-reporter": "link:bazel-bin/packages/kbn-ci-stats-reporter/npm_module_types", - "@types/kbn__cli-dev-mode": "link:bazel-bin/packages/kbn-cli-dev-mode/npm_module_types", - "@types/kbn__coloring": "link:bazel-bin/packages/kbn-coloring/npm_module_types", - "@types/kbn__config": "link:bazel-bin/packages/kbn-config/npm_module_types", - "@types/kbn__config-mocks": "link:bazel-bin/packages/kbn-config-mocks/npm_module_types", - "@types/kbn__config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module_types", - "@types/kbn__content-management-table-list": "link:bazel-bin/packages/content-management/table_list/npm_module_types", - "@types/kbn__core-analytics-browser": "link:bazel-bin/packages/core/analytics/core-analytics-browser/npm_module_types", - "@types/kbn__core-analytics-browser-internal": "link:bazel-bin/packages/core/analytics/core-analytics-browser-internal/npm_module_types", - "@types/kbn__core-analytics-browser-mocks": "link:bazel-bin/packages/core/analytics/core-analytics-browser-mocks/npm_module_types", - "@types/kbn__core-analytics-server": "link:bazel-bin/packages/core/analytics/core-analytics-server/npm_module_types", - "@types/kbn__core-analytics-server-internal": "link:bazel-bin/packages/core/analytics/core-analytics-server-internal/npm_module_types", - "@types/kbn__core-analytics-server-mocks": "link:bazel-bin/packages/core/analytics/core-analytics-server-mocks/npm_module_types", - "@types/kbn__core-application-browser": "link:bazel-bin/packages/core/application/core-application-browser/npm_module_types", - "@types/kbn__core-application-browser-internal": "link:bazel-bin/packages/core/application/core-application-browser-internal/npm_module_types", - "@types/kbn__core-application-browser-mocks": "link:bazel-bin/packages/core/application/core-application-browser-mocks/npm_module_types", - "@types/kbn__core-application-common": "link:bazel-bin/packages/core/application/core-application-common/npm_module_types", - "@types/kbn__core-apps-browser-internal": "link:bazel-bin/packages/core/apps/core-apps-browser-internal/npm_module_types", - "@types/kbn__core-apps-browser-mocks": "link:bazel-bin/packages/core/apps/core-apps-browser-mocks/npm_module_types", - "@types/kbn__core-base-browser": "link:bazel-bin/packages/core/base/core-base-browser/npm_module_types", - "@types/kbn__core-base-browser-internal": "link:bazel-bin/packages/core/base/core-base-browser-internal/npm_module_types", - "@types/kbn__core-base-browser-mocks": "link:bazel-bin/packages/core/base/core-base-browser-mocks/npm_module_types", - "@types/kbn__core-base-common": "link:bazel-bin/packages/core/base/core-base-common/npm_module_types", - "@types/kbn__core-base-common-internal": "link:bazel-bin/packages/core/base/core-base-common-internal/npm_module_types", - "@types/kbn__core-base-server": "link:bazel-bin/packages/core/base/core-base-server/npm_module_types", - "@types/kbn__core-base-server-internal": "link:bazel-bin/packages/core/base/core-base-server-internal/npm_module_types", - "@types/kbn__core-base-server-mocks": "link:bazel-bin/packages/core/base/core-base-server-mocks/npm_module_types", - "@types/kbn__core-capabilities-browser-internal": "link:bazel-bin/packages/core/capabilities/core-capabilities-browser-internal/npm_module_types", - "@types/kbn__core-capabilities-browser-mocks": "link:bazel-bin/packages/core/capabilities/core-capabilities-browser-mocks/npm_module_types", - "@types/kbn__core-capabilities-common": "link:bazel-bin/packages/core/capabilities/core-capabilities-common/npm_module_types", - "@types/kbn__core-capabilities-server": "link:bazel-bin/packages/core/capabilities/core-capabilities-server/npm_module_types", - "@types/kbn__core-capabilities-server-internal": "link:bazel-bin/packages/core/capabilities/core-capabilities-server-internal/npm_module_types", - "@types/kbn__core-capabilities-server-mocks": "link:bazel-bin/packages/core/capabilities/core-capabilities-server-mocks/npm_module_types", - "@types/kbn__core-chrome-browser": "link:bazel-bin/packages/core/chrome/core-chrome-browser/npm_module_types", - "@types/kbn__core-chrome-browser-internal": "link:bazel-bin/packages/core/chrome/core-chrome-browser-internal/npm_module_types", - "@types/kbn__core-chrome-browser-mocks": "link:bazel-bin/packages/core/chrome/core-chrome-browser-mocks/npm_module_types", - "@types/kbn__core-common-internal-base": "link:bazel-bin/packages/core/common/internal-base/npm_module_types", - "@types/kbn__core-config-server-internal": "link:bazel-bin/packages/core/config/core-config-server-internal/npm_module_types", - "@types/kbn__core-config-server-mocks": "link:bazel-bin/packages/core/config/core-config-server-mocks/npm_module_types", - "@types/kbn__core-deprecations-browser": "link:bazel-bin/packages/core/deprecations/core-deprecations-browser/npm_module_types", - "@types/kbn__core-deprecations-browser-internal": "link:bazel-bin/packages/core/deprecations/core-deprecations-browser-internal/npm_module_types", - "@types/kbn__core-deprecations-browser-mocks": "link:bazel-bin/packages/core/deprecations/core-deprecations-browser-mocks/npm_module_types", - "@types/kbn__core-deprecations-common": "link:bazel-bin/packages/core/deprecations/core-deprecations-common/npm_module_types", - "@types/kbn__core-deprecations-server": "link:bazel-bin/packages/core/deprecations/core-deprecations-server/npm_module_types", - "@types/kbn__core-deprecations-server-internal": "link:bazel-bin/packages/core/deprecations/core-deprecations-server-internal/npm_module_types", - "@types/kbn__core-deprecations-server-mocks": "link:bazel-bin/packages/core/deprecations/core-deprecations-server-mocks/npm_module_types", - "@types/kbn__core-doc-links-browser": "link:bazel-bin/packages/core/doc-links/core-doc-links-browser/npm_module_types", - "@types/kbn__core-doc-links-browser-internal": "link:bazel-bin/packages/core/doc-links/core-doc-links-browser-internal/npm_module_types", - "@types/kbn__core-doc-links-browser-mocks": "link:bazel-bin/packages/core/doc-links/core-doc-links-browser-mocks/npm_module_types", - "@types/kbn__core-doc-links-server": "link:bazel-bin/packages/core/doc-links/core-doc-links-server/npm_module_types", - "@types/kbn__core-doc-links-server-internal": "link:bazel-bin/packages/core/doc-links/core-doc-links-server-internal/npm_module_types", - "@types/kbn__core-doc-links-server-mocks": "link:bazel-bin/packages/core/doc-links/core-doc-links-server-mocks/npm_module_types", - "@types/kbn__core-elasticsearch-client-server": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server/npm_module_types", - "@types/kbn__core-elasticsearch-client-server-internal": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-internal/npm_module_types", - "@types/kbn__core-elasticsearch-client-server-mocks": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/npm_module_types", - "@types/kbn__core-elasticsearch-server": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server/npm_module_types", - "@types/kbn__core-elasticsearch-server-internal": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-internal/npm_module_types", - "@types/kbn__core-elasticsearch-server-mocks": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-mocks/npm_module_types", - "@types/kbn__core-environment-server-internal": "link:bazel-bin/packages/core/environment/core-environment-server-internal/npm_module_types", - "@types/kbn__core-environment-server-mocks": "link:bazel-bin/packages/core/environment/core-environment-server-mocks/npm_module_types", - "@types/kbn__core-execution-context-browser": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser/npm_module_types", - "@types/kbn__core-execution-context-browser-internal": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser-internal/npm_module_types", - "@types/kbn__core-execution-context-browser-mocks": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser-mocks/npm_module_types", - "@types/kbn__core-execution-context-common": "link:bazel-bin/packages/core/execution-context/core-execution-context-common/npm_module_types", - "@types/kbn__core-execution-context-server": "link:bazel-bin/packages/core/execution-context/core-execution-context-server/npm_module_types", - "@types/kbn__core-execution-context-server-internal": "link:bazel-bin/packages/core/execution-context/core-execution-context-server-internal/npm_module_types", - "@types/kbn__core-execution-context-server-mocks": "link:bazel-bin/packages/core/execution-context/core-execution-context-server-mocks/npm_module_types", - "@types/kbn__core-fatal-errors-browser": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser/npm_module_types", - "@types/kbn__core-fatal-errors-browser-internal": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-internal/npm_module_types", - "@types/kbn__core-fatal-errors-browser-mocks": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-mocks/npm_module_types", - "@types/kbn__core-http-browser": "link:bazel-bin/packages/core/http/core-http-browser/npm_module_types", - "@types/kbn__core-http-browser-internal": "link:bazel-bin/packages/core/http/core-http-browser-internal/npm_module_types", - "@types/kbn__core-http-browser-mocks": "link:bazel-bin/packages/core/http/core-http-browser-mocks/npm_module_types", - "@types/kbn__core-http-common": "link:bazel-bin/packages/core/http/core-http-common/npm_module_types", - "@types/kbn__core-http-context-server-internal": "link:bazel-bin/packages/core/http/core-http-context-server-internal/npm_module_types", - "@types/kbn__core-http-context-server-mocks": "link:bazel-bin/packages/core/http/core-http-context-server-mocks/npm_module_types", - "@types/kbn__core-http-request-handler-context-server": "link:bazel-bin/packages/core/http/core-http-request-handler-context-server/npm_module_types", - "@types/kbn__core-http-request-handler-context-server-internal": "link:bazel-bin/packages/core/http/core-http-request-handler-context-server-internal/npm_module_types", - "@types/kbn__core-http-resources-server": "link:bazel-bin/packages/core/http/core-http-resources-server/npm_module_types", - "@types/kbn__core-http-resources-server-internal": "link:bazel-bin/packages/core/http/core-http-resources-server-internal/npm_module_types", - "@types/kbn__core-http-resources-server-mocks": "link:bazel-bin/packages/core/http/core-http-resources-server-mocks/npm_module_types", - "@types/kbn__core-http-router-server-internal": "link:bazel-bin/packages/core/http/core-http-router-server-internal/npm_module_types", - "@types/kbn__core-http-router-server-mocks": "link:bazel-bin/packages/core/http/core-http-router-server-mocks/npm_module_types", - "@types/kbn__core-http-server": "link:bazel-bin/packages/core/http/core-http-server/npm_module_types", - "@types/kbn__core-http-server-internal": "link:bazel-bin/packages/core/http/core-http-server-internal/npm_module_types", - "@types/kbn__core-http-server-mocks": "link:bazel-bin/packages/core/http/core-http-server-mocks/npm_module_types", - "@types/kbn__core-i18n-browser": "link:bazel-bin/packages/core/i18n/core-i18n-browser/npm_module_types", - "@types/kbn__core-i18n-browser-internal": "link:bazel-bin/packages/core/i18n/core-i18n-browser-internal/npm_module_types", - "@types/kbn__core-i18n-browser-mocks": "link:bazel-bin/packages/core/i18n/core-i18n-browser-mocks/npm_module_types", - "@types/kbn__core-i18n-server": "link:bazel-bin/packages/core/i18n/core-i18n-server/npm_module_types", - "@types/kbn__core-i18n-server-internal": "link:bazel-bin/packages/core/i18n/core-i18n-server-internal/npm_module_types", - "@types/kbn__core-i18n-server-mocks": "link:bazel-bin/packages/core/i18n/core-i18n-server-mocks/npm_module_types", - "@types/kbn__core-injected-metadata-browser": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser/npm_module_types", - "@types/kbn__core-injected-metadata-browser-internal": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-internal/npm_module_types", - "@types/kbn__core-injected-metadata-browser-mocks": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-mocks/npm_module_types", - "@types/kbn__core-injected-metadata-common-internal": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-common-internal/npm_module_types", - "@types/kbn__core-integrations-browser-internal": "link:bazel-bin/packages/core/integrations/core-integrations-browser-internal/npm_module_types", - "@types/kbn__core-integrations-browser-mocks": "link:bazel-bin/packages/core/integrations/core-integrations-browser-mocks/npm_module_types", - "@types/kbn__core-lifecycle-browser": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser/npm_module_types", - "@types/kbn__core-lifecycle-browser-internal": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser-internal/npm_module_types", - "@types/kbn__core-lifecycle-browser-mocks": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser-mocks/npm_module_types", - "@types/kbn__core-logging-server": "link:bazel-bin/packages/core/logging/core-logging-server/npm_module_types", - "@types/kbn__core-logging-server-internal": "link:bazel-bin/packages/core/logging/core-logging-server-internal/npm_module_types", - "@types/kbn__core-logging-server-mocks": "link:bazel-bin/packages/core/logging/core-logging-server-mocks/npm_module_types", - "@types/kbn__core-metrics-collectors-server-internal": "link:bazel-bin/packages/core/metrics/core-metrics-collectors-server-internal/npm_module_types", - "@types/kbn__core-metrics-collectors-server-mocks": "link:bazel-bin/packages/core/metrics/core-metrics-collectors-server-mocks/npm_module_types", - "@types/kbn__core-metrics-server": "link:bazel-bin/packages/core/metrics/core-metrics-server/npm_module_types", - "@types/kbn__core-metrics-server-internal": "link:bazel-bin/packages/core/metrics/core-metrics-server-internal/npm_module_types", - "@types/kbn__core-metrics-server-mocks": "link:bazel-bin/packages/core/metrics/core-metrics-server-mocks/npm_module_types", - "@types/kbn__core-mount-utils-browser": "link:bazel-bin/packages/core/mount-utils/core-mount-utils-browser/npm_module_types", - "@types/kbn__core-mount-utils-browser-internal": "link:bazel-bin/packages/core/mount-utils/core-mount-utils-browser-internal/npm_module_types", - "@types/kbn__core-node-server": "link:bazel-bin/packages/core/node/core-node-server/npm_module_types", - "@types/kbn__core-node-server-internal": "link:bazel-bin/packages/core/node/core-node-server-internal/npm_module_types", - "@types/kbn__core-node-server-mocks": "link:bazel-bin/packages/core/node/core-node-server-mocks/npm_module_types", - "@types/kbn__core-notifications-browser": "link:bazel-bin/packages/core/notifications/core-notifications-browser/npm_module_types", - "@types/kbn__core-notifications-browser-internal": "link:bazel-bin/packages/core/notifications/core-notifications-browser-internal/npm_module_types", - "@types/kbn__core-notifications-browser-mocks": "link:bazel-bin/packages/core/notifications/core-notifications-browser-mocks/npm_module_types", - "@types/kbn__core-overlays-browser": "link:bazel-bin/packages/core/overlays/core-overlays-browser/npm_module_types", - "@types/kbn__core-overlays-browser-internal": "link:bazel-bin/packages/core/overlays/core-overlays-browser-internal/npm_module_types", - "@types/kbn__core-overlays-browser-mocks": "link:bazel-bin/packages/core/overlays/core-overlays-browser-mocks/npm_module_types", - "@types/kbn__core-plugins-base-server-internal": "link:bazel-bin/packages/core/plugins/core-plugins-base-server-internal/npm_module_types", - "@types/kbn__core-plugins-browser": "link:bazel-bin/packages/core/plugins/core-plugins-browser/npm_module_types", - "@types/kbn__core-plugins-browser-internal": "link:bazel-bin/packages/core/plugins/core-plugins-browser-internal/npm_module_types", - "@types/kbn__core-plugins-browser-mocks": "link:bazel-bin/packages/core/plugins/core-plugins-browser-mocks/npm_module_types", - "@types/kbn__core-preboot-server": "link:bazel-bin/packages/core/preboot/core-preboot-server/npm_module_types", - "@types/kbn__core-preboot-server-internal": "link:bazel-bin/packages/core/preboot/core-preboot-server-internal/npm_module_types", - "@types/kbn__core-preboot-server-mocks": "link:bazel-bin/packages/core/preboot/core-preboot-server-mocks/npm_module_types", - "@types/kbn__core-public-internal-base": "link:bazel-bin/packages/core/public/internal-base/npm_module_types", - "@types/kbn__core-rendering-browser-internal": "link:bazel-bin/packages/core/rendering/core-rendering-browser-internal/npm_module_types", - "@types/kbn__core-rendering-browser-mocks": "link:bazel-bin/packages/core/rendering/core-rendering-browser-mocks/npm_module_types", - "@types/kbn__core-rendering-server-internal": "link:bazel-bin/packages/core/rendering/core-rendering-server-internal/npm_module_types", - "@types/kbn__core-rendering-server-mocks": "link:bazel-bin/packages/core/rendering/core-rendering-server-mocks/npm_module_types", - "@types/kbn__core-root-browser-internal": "link:bazel-bin/packages/core/root/core-root-browser-internal/npm_module_types", - "@types/kbn__core-saved-objects-api-browser": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-browser/npm_module_types", - "@types/kbn__core-saved-objects-api-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server/npm_module_types", - "@types/kbn__core-saved-objects-api-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server-internal/npm_module_types", - "@types/kbn__core-saved-objects-api-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server-mocks/npm_module_types", - "@types/kbn__core-saved-objects-base-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-internal/npm_module_types", - "@types/kbn__core-saved-objects-base-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-mocks/npm_module_types", - "@types/kbn__core-saved-objects-browser": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser/npm_module_types", - "@types/kbn__core-saved-objects-browser-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-internal/npm_module_types", - "@types/kbn__core-saved-objects-browser-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-mocks/npm_module_types", - "@types/kbn__core-saved-objects-common": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-common/npm_module_types", - "@types/kbn__core-saved-objects-import-export-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-import-export-server-internal/npm_module_types", - "@types/kbn__core-saved-objects-import-export-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/npm_module_types", - "@types/kbn__core-saved-objects-migration-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-migration-server-internal/npm_module_types", - "@types/kbn__core-saved-objects-migration-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-migration-server-mocks/npm_module_types", - "@types/kbn__core-saved-objects-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server/npm_module_types", - "@types/kbn__core-saved-objects-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server-internal/npm_module_types", - "@types/kbn__core-saved-objects-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server-mocks/npm_module_types", - "@types/kbn__core-saved-objects-utils-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-utils-server/npm_module_types", - "@types/kbn__core-server-internal-base": "link:bazel-bin/packages/core/server/internal-base/npm_module_types", - "@types/kbn__core-status-common": "link:bazel-bin/packages/core/status/core-status-common/npm_module_types", - "@types/kbn__core-status-common-internal": "link:bazel-bin/packages/core/status/core-status-common-internal/npm_module_types", - "@types/kbn__core-status-server": "link:bazel-bin/packages/core/status/core-status-server/npm_module_types", - "@types/kbn__core-status-server-internal": "link:bazel-bin/packages/core/status/core-status-server-internal/npm_module_types", - "@types/kbn__core-status-server-mocks": "link:bazel-bin/packages/core/status/core-status-server-mocks/npm_module_types", - "@types/kbn__core-test-helpers-deprecations-getters": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-deprecations-getters/npm_module_types", - "@types/kbn__core-test-helpers-http-setup-browser": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-http-setup-browser/npm_module_types", - "@types/kbn__core-test-helpers-so-type-serializer": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-so-type-serializer/npm_module_types", - "@types/kbn__core-test-helpers-test-utils": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-test-utils/npm_module_types", - "@types/kbn__core-theme-browser": "link:bazel-bin/packages/core/theme/core-theme-browser/npm_module_types", - "@types/kbn__core-theme-browser-internal": "link:bazel-bin/packages/core/theme/core-theme-browser-internal/npm_module_types", - "@types/kbn__core-theme-browser-mocks": "link:bazel-bin/packages/core/theme/core-theme-browser-mocks/npm_module_types", - "@types/kbn__core-ui-settings-browser": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser/npm_module_types", - "@types/kbn__core-ui-settings-browser-internal": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser-internal/npm_module_types", - "@types/kbn__core-ui-settings-browser-mocks": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser-mocks/npm_module_types", - "@types/kbn__core-ui-settings-common": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-common/npm_module_types", - "@types/kbn__core-ui-settings-server": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-server/npm_module_types", - "@types/kbn__core-ui-settings-server-internal": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-server-internal/npm_module_types", - "@types/kbn__core-ui-settings-server-mocks": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-server-mocks/npm_module_types", - "@types/kbn__core-usage-data-base-server-internal": "link:bazel-bin/packages/core/usage-data/core-usage-data-base-server-internal/npm_module_types", - "@types/kbn__core-usage-data-server": "link:bazel-bin/packages/core/usage-data/core-usage-data-server/npm_module_types", - "@types/kbn__core-usage-data-server-internal": "link:bazel-bin/packages/core/usage-data/core-usage-data-server-internal/npm_module_types", - "@types/kbn__core-usage-data-server-mocks": "link:bazel-bin/packages/core/usage-data/core-usage-data-server-mocks/npm_module_types", - "@types/kbn__crypto": "link:bazel-bin/packages/kbn-crypto/npm_module_types", - "@types/kbn__crypto-browser": "link:bazel-bin/packages/kbn-crypto-browser/npm_module_types", - "@types/kbn__datemath": "link:bazel-bin/packages/kbn-datemath/npm_module_types", - "@types/kbn__dev-cli-errors": "link:bazel-bin/packages/kbn-dev-cli-errors/npm_module_types", - "@types/kbn__dev-cli-runner": "link:bazel-bin/packages/kbn-dev-cli-runner/npm_module_types", - "@types/kbn__dev-proc-runner": "link:bazel-bin/packages/kbn-dev-proc-runner/npm_module_types", - "@types/kbn__dev-utils": "link:bazel-bin/packages/kbn-dev-utils/npm_module_types", - "@types/kbn__doc-links": "link:bazel-bin/packages/kbn-doc-links/npm_module_types", - "@types/kbn__docs-utils": "link:bazel-bin/packages/kbn-docs-utils/npm_module_types", - "@types/kbn__ebt-tools": "link:bazel-bin/packages/kbn-ebt-tools/npm_module_types", - "@types/kbn__es-archiver": "link:bazel-bin/packages/kbn-es-archiver/npm_module_types", - "@types/kbn__es-errors": "link:bazel-bin/packages/kbn-es-errors/npm_module_types", - "@types/kbn__es-query": "link:bazel-bin/packages/kbn-es-query/npm_module_types", - "@types/kbn__es-types": "link:bazel-bin/packages/kbn-es-types/npm_module_types", - "@types/kbn__eslint-plugin-disable": "link:bazel-bin/packages/kbn-eslint-plugin-disable/npm_module_types", - "@types/kbn__eslint-plugin-imports": "link:bazel-bin/packages/kbn-eslint-plugin-imports/npm_module_types", - "@types/kbn__failed-test-reporter-cli": "link:bazel-bin/packages/kbn-failed-test-reporter-cli/npm_module_types", - "@types/kbn__field-types": "link:bazel-bin/packages/kbn-field-types/npm_module_types", - "@types/kbn__find-used-node-modules": "link:bazel-bin/packages/kbn-find-used-node-modules/npm_module_types", - "@types/kbn__ftr-common-functional-services": "link:bazel-bin/packages/kbn-ftr-common-functional-services/npm_module_types", - "@types/kbn__ftr-screenshot-filename": "link:bazel-bin/packages/kbn-ftr-screenshot-filename/npm_module_types", - "@types/kbn__generate": "link:bazel-bin/packages/kbn-generate/npm_module_types", - "@types/kbn__get-repo-files": "link:bazel-bin/packages/kbn-get-repo-files/npm_module_types", - "@types/kbn__guided-onboarding": "link:bazel-bin/packages/kbn-guided-onboarding/npm_module_types", - "@types/kbn__handlebars": "link:bazel-bin/packages/kbn-handlebars/npm_module_types", - "@types/kbn__hapi-mocks": "link:bazel-bin/packages/kbn-hapi-mocks/npm_module_types", - "@types/kbn__home-sample-data-card": "link:bazel-bin/packages/home/sample_data_card/npm_module_types", - "@types/kbn__home-sample-data-tab": "link:bazel-bin/packages/home/sample_data_tab/npm_module_types", - "@types/kbn__home-sample-data-types": "link:bazel-bin/packages/home/sample_data_types/npm_module_types", - "@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types", - "@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types", - "@types/kbn__import-resolver": "link:bazel-bin/packages/kbn-import-resolver/npm_module_types", - "@types/kbn__interpreter": "link:bazel-bin/packages/kbn-interpreter/npm_module_types", - "@types/kbn__io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils/npm_module_types", - "@types/kbn__jest-serializers": "link:bazel-bin/packages/kbn-jest-serializers/npm_module_types", - "@types/kbn__journeys": "link:bazel-bin/packages/kbn-journeys/npm_module_types", - "@types/kbn__kbn-ci-stats-performance-metrics": "link:bazel-bin/packages/kbn-kbn-ci-stats-performance-metrics/npm_module_types", - "@types/kbn__kibana-manifest-schema": "link:bazel-bin/packages/kbn-kibana-manifest-schema/npm_module_types", - "@types/kbn__language-documentation-popover": "link:bazel-bin/packages/kbn-language-documentation-popover/npm_module_types", - "@types/kbn__logging": "link:bazel-bin/packages/kbn-logging/npm_module_types", - "@types/kbn__logging-mocks": "link:bazel-bin/packages/kbn-logging-mocks/npm_module_types", - "@types/kbn__managed-vscode-config": "link:bazel-bin/packages/kbn-managed-vscode-config/npm_module_types", - "@types/kbn__managed-vscode-config-cli": "link:bazel-bin/packages/kbn-managed-vscode-config-cli/npm_module_types", - "@types/kbn__mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl/npm_module_types", - "@types/kbn__ml-agg-utils": "link:bazel-bin/x-pack/packages/ml/agg_utils/npm_module_types", - "@types/kbn__ml-is-populated-object": "link:bazel-bin/x-pack/packages/ml/is_populated_object/npm_module_types", - "@types/kbn__ml-string-hash": "link:bazel-bin/x-pack/packages/ml/string_hash/npm_module_types", - "@types/kbn__monaco": "link:bazel-bin/packages/kbn-monaco/npm_module_types", - "@types/kbn__optimizer": "link:bazel-bin/packages/kbn-optimizer/npm_module_types", - "@types/kbn__optimizer-webpack-helpers": "link:bazel-bin/packages/kbn-optimizer-webpack-helpers/npm_module_types", - "@types/kbn__osquery-io-ts-types": "link:bazel-bin/packages/kbn-osquery-io-ts-types/npm_module_types", - "@types/kbn__performance-testing-dataset-extractor": "link:bazel-bin/packages/kbn-performance-testing-dataset-extractor/npm_module_types", - "@types/kbn__plugin-discovery": "link:bazel-bin/packages/kbn-plugin-discovery/npm_module_types", - "@types/kbn__plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator/npm_module_types", - "@types/kbn__plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers/npm_module_types", - "@types/kbn__react-field": "link:bazel-bin/packages/kbn-react-field/npm_module_types", - "@types/kbn__repo-source-classifier": "link:bazel-bin/packages/kbn-repo-source-classifier/npm_module_types", - "@types/kbn__repo-source-classifier-cli": "link:bazel-bin/packages/kbn-repo-source-classifier-cli/npm_module_types", - "@types/kbn__rule-data-utils": "link:bazel-bin/packages/kbn-rule-data-utils/npm_module_types", - "@types/kbn__securitysolution-autocomplete": "link:bazel-bin/packages/kbn-securitysolution-autocomplete/npm_module_types", - "@types/kbn__securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils/npm_module_types", - "@types/kbn__securitysolution-exception-list-components": "link:bazel-bin/packages/kbn-securitysolution-exception-list-components/npm_module_types", - "@types/kbn__securitysolution-hook-utils": "link:bazel-bin/packages/kbn-securitysolution-hook-utils/npm_module_types", - "@types/kbn__securitysolution-io-ts-alerting-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-alerting-types/npm_module_types", - "@types/kbn__securitysolution-io-ts-list-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types/npm_module_types", - "@types/kbn__securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types/npm_module_types", - "@types/kbn__securitysolution-io-ts-utils": "link:bazel-bin/packages/kbn-securitysolution-io-ts-utils/npm_module_types", - "@types/kbn__securitysolution-list-api": "link:bazel-bin/packages/kbn-securitysolution-list-api/npm_module_types", - "@types/kbn__securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants/npm_module_types", - "@types/kbn__securitysolution-list-hooks": "link:bazel-bin/packages/kbn-securitysolution-list-hooks/npm_module_types", - "@types/kbn__securitysolution-list-utils": "link:bazel-bin/packages/kbn-securitysolution-list-utils/npm_module_types", - "@types/kbn__securitysolution-rules": "link:bazel-bin/packages/kbn-securitysolution-rules/npm_module_types", - "@types/kbn__securitysolution-t-grid": "link:bazel-bin/packages/kbn-securitysolution-t-grid/npm_module_types", - "@types/kbn__securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils/npm_module_types", - "@types/kbn__server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools/npm_module_types", - "@types/kbn__server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository/npm_module_types", - "@types/kbn__shared-svg": "link:bazel-bin/packages/kbn-shared-svg/npm_module_types", - "@types/kbn__shared-ux-avatar-solution": "link:bazel-bin/packages/shared-ux/avatar/solution/npm_module_types", - "@types/kbn__shared-ux-avatar-user-profile-components": "link:bazel-bin/packages/shared-ux/avatar/user_profile/impl/npm_module_types", - "@types/kbn__shared-ux-button-exit-full-screen": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/impl/npm_module_types", - "@types/kbn__shared-ux-button-exit-full-screen-mocks": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/mocks/npm_module_types", - "@types/kbn__shared-ux-button-exit-full-screen-types": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/types/npm_module_types", - "@types/kbn__shared-ux-button-toolbar": "link:bazel-bin/packages/shared-ux/button_toolbar/npm_module_types", - "@types/kbn__shared-ux-card-no-data": "link:bazel-bin/packages/shared-ux/card/no_data/impl/npm_module_types", - "@types/kbn__shared-ux-card-no-data-mocks": "link:bazel-bin/packages/shared-ux/card/no_data/mocks/npm_module_types", - "@types/kbn__shared-ux-card-no-data-types": "link:bazel-bin/packages/shared-ux/card/no_data/types/npm_module_types", - "@types/kbn__shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app/impl/npm_module_types", - "@types/kbn__shared-ux-link-redirect-app-mocks": "link:bazel-bin/packages/shared-ux/link/redirect_app/mocks/npm_module_types", - "@types/kbn__shared-ux-link-redirect-app-types": "link:bazel-bin/packages/shared-ux/link/redirect_app/types/npm_module_types", - "@types/kbn__shared-ux-markdown": "link:bazel-bin/packages/shared-ux/markdown/impl/npm_module_types", - "@types/kbn__shared-ux-markdown-mocks": "link:bazel-bin/packages/shared-ux/markdown/mocks/npm_module_types", - "@types/kbn__shared-ux-markdown-types": "link:bazel-bin/packages/shared-ux/markdown/types/npm_module_types", - "@types/kbn__shared-ux-page-analytics-no-data": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/impl/npm_module_types", - "@types/kbn__shared-ux-page-analytics-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/mocks/npm_module_types", - "@types/kbn__shared-ux-page-analytics-no-data-types": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/types/npm_module_types", - "@types/kbn__shared-ux-page-kibana-no-data": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/impl/npm_module_types", - "@types/kbn__shared-ux-page-kibana-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/mocks/npm_module_types", - "@types/kbn__shared-ux-page-kibana-no-data-types": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/types/npm_module_types", - "@types/kbn__shared-ux-page-kibana-template": "link:bazel-bin/packages/shared-ux/page/kibana_template/impl/npm_module_types", - "@types/kbn__shared-ux-page-kibana-template-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_template/mocks/npm_module_types", - "@types/kbn__shared-ux-page-kibana-template-types": "link:bazel-bin/packages/shared-ux/page/kibana_template/types/npm_module_types", - "@types/kbn__shared-ux-page-no-data": "link:bazel-bin/packages/shared-ux/page/no_data/impl/npm_module_types", - "@types/kbn__shared-ux-page-no-data-config": "link:bazel-bin/packages/shared-ux/page/no_data_config/impl/npm_module_types", - "@types/kbn__shared-ux-page-no-data-config-mocks": "link:bazel-bin/packages/shared-ux/page/no_data_config/mocks/npm_module_types", - "@types/kbn__shared-ux-page-no-data-config-types": "link:bazel-bin/packages/shared-ux/page/no_data_config/types/npm_module_types", - "@types/kbn__shared-ux-page-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/no_data/mocks/npm_module_types", - "@types/kbn__shared-ux-page-no-data-types": "link:bazel-bin/packages/shared-ux/page/no_data/types/npm_module_types", - "@types/kbn__shared-ux-page-solution-nav": "link:bazel-bin/packages/shared-ux/page/solution_nav/npm_module_types", - "@types/kbn__shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/impl/npm_module_types", - "@types/kbn__shared-ux-prompt-no-data-views-mocks": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/mocks/npm_module_types", - "@types/kbn__shared-ux-prompt-no-data-views-types": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/types/npm_module_types", - "@types/kbn__shared-ux-router-mocks": "link:bazel-bin/packages/shared-ux/router/mocks/npm_module_types", - "@types/kbn__shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services/npm_module_types", - "@types/kbn__shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook/npm_module_types", - "@types/kbn__shared-ux-storybook-mock": "link:bazel-bin/packages/shared-ux/storybook/mock/npm_module_types", - "@types/kbn__shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility/npm_module_types", - "@types/kbn__some-dev-log": "link:bazel-bin/packages/kbn-some-dev-log/npm_module_types", - "@types/kbn__sort-package-json": "link:bazel-bin/packages/kbn-sort-package-json/npm_module_types", - "@types/kbn__std": "link:bazel-bin/packages/kbn-std/npm_module_types", - "@types/kbn__stdio-dev-helpers": "link:bazel-bin/packages/kbn-stdio-dev-helpers/npm_module_types", - "@types/kbn__storybook": "link:bazel-bin/packages/kbn-storybook/npm_module_types", - "@types/kbn__telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools/npm_module_types", - "@types/kbn__test": "link:bazel-bin/packages/kbn-test/npm_module_types", - "@types/kbn__test-jest-helpers": "link:bazel-bin/packages/kbn-test-jest-helpers/npm_module_types", - "@types/kbn__test-subj-selector": "link:bazel-bin/packages/kbn-test-subj-selector/npm_module_types", - "@types/kbn__tooling-log": "link:bazel-bin/packages/kbn-tooling-log/npm_module_types", - "@types/kbn__type-summarizer": "link:bazel-bin/packages/kbn-type-summarizer/npm_module_types", - "@types/kbn__type-summarizer-cli": "link:bazel-bin/packages/kbn-type-summarizer-cli/npm_module_types", - "@types/kbn__type-summarizer-core": "link:bazel-bin/packages/kbn-type-summarizer-core/npm_module_types", - "@types/kbn__typed-react-router-config": "link:bazel-bin/packages/kbn-typed-react-router-config/npm_module_types", - "@types/kbn__ui-shared-deps-npm": "link:bazel-bin/packages/kbn-ui-shared-deps-npm/npm_module_types", - "@types/kbn__ui-shared-deps-src": "link:bazel-bin/packages/kbn-ui-shared-deps-src/npm_module_types", - "@types/kbn__ui-theme": "link:bazel-bin/packages/kbn-ui-theme/npm_module_types", - "@types/kbn__user-profile-components": "link:bazel-bin/packages/kbn-user-profile-components/npm_module_types", - "@types/kbn__utility-types": "link:bazel-bin/packages/kbn-utility-types/npm_module_types", - "@types/kbn__utility-types-jest": "link:bazel-bin/packages/kbn-utility-types-jest/npm_module_types", - "@types/kbn__utils": "link:bazel-bin/packages/kbn-utils/npm_module_types", - "@types/kbn__yarn-lock-validator": "link:bazel-bin/packages/kbn-yarn-lock-validator/npm_module_types", "@types/license-checker": "15.0.0", "@types/listr": "^0.14.0", "@types/loader-utils": "^1.1.3", @@ -1297,7 +971,7 @@ "argsplit": "^1.0.5", "autoprefixer": "^10.4.7", "axe-core": "^4.0.2", - "babel-jest": "^26.6.3", + "babel-jest": "^27.5.1", "babel-loader": "^8.2.5", "babel-plugin-add-module-exports": "^1.0.4", "babel-plugin-istanbul": "^6.1.1", @@ -1308,7 +982,7 @@ "callsites": "^3.1.0", "chance": "1.0.18", "chokidar": "^3.5.3", - "chromedriver": "^105.0.1", + "chromedriver": "^107.0.0", "clean-webpack-plugin": "^3.0.0", "compression-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^6.0.2", @@ -1317,13 +991,13 @@ "cssnano": "^5.1.12", "cssnano-preset-default": "^5.2.12", "csstype": "^3.0.2", - "cypress": "^10.9.0", + "cypress": "^10.10.0", "cypress-axe": "^1.0.0", "cypress-file-upload": "^5.0.8", "cypress-multi-reporters": "^1.6.1", "cypress-pipe": "^2.0.0", "cypress-react-selector": "^3.0.0", - "cypress-real-events": "^1.7.1", + "cypress-real-events": "^1.7.2", "cypress-recurse": "^1.23.0", "debug": "^2.6.9", "delete-empty": "^2.0.0", @@ -1332,7 +1006,7 @@ "dpdm": "3.5.0", "ejs": "^3.1.8", "enzyme": "^3.11.0", - "enzyme-to-json": "^3.6.1", + "enzyme-to-json": "^3.6.2", "eslint": "^7.32.0", "eslint-config-prettier": "^8.5.0", "eslint-module-utils": "^2.6.2", @@ -1370,21 +1044,21 @@ "html-loader": "^1.3.2", "http-proxy": "^1.18.1", "is-path-inside": "^3.0.2", - "jest": "^26.6.3", + "jest": "^27.5.1", "jest-axe": "^5.0.0", - "jest-canvas-mock": "^2.3.1", - "jest-circus": "^26.6.3", - "jest-cli": "^26.6.3", - "jest-config": "^26", - "jest-diff": "^26.6.2", - "jest-environment-jsdom": "^26.6.2", - "jest-mock": "^26.6.2", + "jest-canvas-mock": "^2.4.0", + "jest-cli": "^27.5.1", + "jest-config": "^27.5.1", + "jest-diff": "^27.5.1", + "jest-environment-jsdom": "^27.5.1", + "jest-matcher-utils": "^27.5.1", + "jest-mock": "^27.5.1", "jest-raw-loader": "^1.0.1", - "jest-runtime": "^26", + "jest-runtime": "^27.5.1", "jest-silent-reporter": "^0.5.0", - "jest-snapshot": "^26.6.2", - "jest-specific-snapshot": "^4.0.0", - "jest-styled-components": "^7.0.3", + "jest-snapshot": "^27.5.1", + "jest-specific-snapshot": "^5.0.0", + "jest-styled-components": "7.0.3", "jsdom": "^16.4.0", "json-schema-typed": "^8.0.1", "json5": "^1.0.1", @@ -1415,7 +1089,7 @@ "pirates": "^4.0.1", "piscina": "^3.2.0", "pixelmatch": "^5.3.0", - "playwright": "^1.17.1", + "playwright": "^1.26.0", "pngjs": "^3.4.0", "postcss": "^8.4.14", "postcss-loader": "^4.2.0", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index b68c27b27f3dd..81aec2ac8a1ba 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -28,6 +28,7 @@ filegroup( "//packages/core/application/core-application-common:build", "//packages/core/apps/core-apps-browser-internal:build", "//packages/core/apps/core-apps-browser-mocks:build", + "//packages/core/apps/core-apps-server-internal:build", "//packages/core/base/core-base-browser-internal:build", "//packages/core/base/core-base-browser-mocks:build", "//packages/core/base/core-base-common:build", @@ -105,6 +106,12 @@ filegroup( "//packages/core/lifecycle/core-lifecycle-browser:build", "//packages/core/lifecycle/core-lifecycle-browser-internal:build", "//packages/core/lifecycle/core-lifecycle-browser-mocks:build", + "//packages/core/lifecycle/core-lifecycle-server:build", + "//packages/core/lifecycle/core-lifecycle-server-internal:build", + "//packages/core/lifecycle/core-lifecycle-server-mocks:build", + "//packages/core/logging/core-logging-browser-internal:build", + "//packages/core/logging/core-logging-browser-mocks:build", + "//packages/core/logging/core-logging-common-internal:build", "//packages/core/logging/core-logging-server:build", "//packages/core/logging/core-logging-server-internal:build", "//packages/core/logging/core-logging-server-mocks:build", @@ -128,6 +135,9 @@ filegroup( "//packages/core/plugins/core-plugins-browser:build", "//packages/core/plugins/core-plugins-browser-internal:build", "//packages/core/plugins/core-plugins-browser-mocks:build", + "//packages/core/plugins/core-plugins-server:build", + "//packages/core/plugins/core-plugins-server-internal:build", + "//packages/core/plugins/core-plugins-server-mocks:build", "//packages/core/preboot/core-preboot-server:build", "//packages/core/preboot/core-preboot-server-internal:build", "//packages/core/preboot/core-preboot-server-mocks:build", @@ -377,6 +387,7 @@ filegroup( "//packages/core/application/core-application-common:build_types", "//packages/core/apps/core-apps-browser-internal:build_types", "//packages/core/apps/core-apps-browser-mocks:build_types", + "//packages/core/apps/core-apps-server-internal:build_types", "//packages/core/base/core-base-browser-internal:build_types", "//packages/core/base/core-base-browser-mocks:build_types", "//packages/core/base/core-base-common:build_types", @@ -454,6 +465,12 @@ filegroup( "//packages/core/lifecycle/core-lifecycle-browser:build_types", "//packages/core/lifecycle/core-lifecycle-browser-internal:build_types", "//packages/core/lifecycle/core-lifecycle-browser-mocks:build_types", + "//packages/core/lifecycle/core-lifecycle-server:build_types", + "//packages/core/lifecycle/core-lifecycle-server-internal:build_types", + "//packages/core/lifecycle/core-lifecycle-server-mocks:build_types", + "//packages/core/logging/core-logging-browser-internal:build_types", + "//packages/core/logging/core-logging-browser-mocks:build_types", + "//packages/core/logging/core-logging-common-internal:build_types", "//packages/core/logging/core-logging-server:build_types", "//packages/core/logging/core-logging-server-internal:build_types", "//packages/core/logging/core-logging-server-mocks:build_types", @@ -477,6 +494,9 @@ filegroup( "//packages/core/plugins/core-plugins-browser:build_types", "//packages/core/plugins/core-plugins-browser-internal:build_types", "//packages/core/plugins/core-plugins-browser-mocks:build_types", + "//packages/core/plugins/core-plugins-server:build_types", + "//packages/core/plugins/core-plugins-server-internal:build_types", + "//packages/core/plugins/core-plugins-server-mocks:build_types", "//packages/core/preboot/core-preboot-server:build_types", "//packages/core/preboot/core-preboot-server-internal:build_types", "//packages/core/preboot/core-preboot-server-mocks:build_types", @@ -678,13 +698,18 @@ filegroup( ], ) -# Grouping target to call all underlying packages build -# targets so we can build them all at once -# It will auto build all declared code packages and types packages +# Grouping target to call all underlying packages js builds filegroup( name = "build", srcs = [ - ":build_pkg_code", + ":build_pkg_code" + ], +) + +# Grouping target to call all underlying packages ts builds +filegroup( + name = "build_types", + srcs = [ ":build_pkg_types" ], ) diff --git a/packages/analytics/client/BUILD.bazel b/packages/analytics/client/BUILD.bazel index d7372b3508d4a..cc9cf69242b8c 100644 --- a/packages/analytics/client/BUILD.bazel +++ b/packages/analytics/client/BUILD.bazel @@ -98,7 +98,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -112,6 +111,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -123,17 +130,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/analytics/client/package.json b/packages/analytics/client/package.json index 6f4f7ed05b540..247d642adf6d1 100644 --- a/packages/analytics/client/package.json +++ b/packages/analytics/client/package.json @@ -5,5 +5,6 @@ "browser": "./target_web/index.js", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/analytics/client/src/analytics_client/analytics_client.test.ts b/packages/analytics/client/src/analytics_client/analytics_client.test.ts index a53489e312083..601f94aa1e243 100644 --- a/packages/analytics/client/src/analytics_client/analytics_client.test.ts +++ b/packages/analytics/client/src/analytics_client/analytics_client.test.ts @@ -21,7 +21,7 @@ describe('AnalyticsClient', () => { let logger: MockedLogger; beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); logger = loggerMock.create(); analyticsClient = new AnalyticsClient({ logger, diff --git a/packages/analytics/client/tsconfig.json b/packages/analytics/client/tsconfig.json index eb3dd2cba2ce8..cc7ee1b2ebd68 100644 --- a/packages/analytics/client/tsconfig.json +++ b/packages/analytics/client/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/analytics/shippers/elastic_v3/browser/BUILD.bazel b/packages/analytics/shippers/elastic_v3/browser/BUILD.bazel index 940f32a52fcdc..790079da9d8ff 100644 --- a/packages/analytics/shippers/elastic_v3/browser/BUILD.bazel +++ b/packages/analytics/shippers/elastic_v3/browser/BUILD.bazel @@ -97,7 +97,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -111,6 +110,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -122,17 +129,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/analytics/shippers/elastic_v3/browser/package.json b/packages/analytics/shippers/elastic_v3/browser/package.json index 90a73a6b3dfdd..59c2e7e9fa5bd 100644 --- a/packages/analytics/shippers/elastic_v3/browser/package.json +++ b/packages/analytics/shippers/elastic_v3/browser/package.json @@ -5,5 +5,6 @@ "browser": "./target_web/index.js", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.test.ts b/packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.test.ts index fae3121372193..47728a99a511a 100644 --- a/packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.test.ts +++ b/packages/analytics/shippers/elastic_v3/browser/src/browser_shipper.test.ts @@ -33,7 +33,7 @@ describe('ElasticV3BrowserShipper', () => { let fetchMock: jest.Mock; beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); fetchMock = jest.fn().mockResolvedValue({ status: 200, diff --git a/packages/analytics/shippers/elastic_v3/browser/tsconfig.json b/packages/analytics/shippers/elastic_v3/browser/tsconfig.json index 73bd8629597a9..6d893e10d8cc9 100644 --- a/packages/analytics/shippers/elastic_v3/browser/tsconfig.json +++ b/packages/analytics/shippers/elastic_v3/browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/analytics/shippers/elastic_v3/common/BUILD.bazel b/packages/analytics/shippers/elastic_v3/common/BUILD.bazel index 21603c1d08cf0..bb38300b97302 100644 --- a/packages/analytics/shippers/elastic_v3/common/BUILD.bazel +++ b/packages/analytics/shippers/elastic_v3/common/BUILD.bazel @@ -93,7 +93,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -107,6 +106,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -118,17 +125,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/analytics/shippers/elastic_v3/common/package.json b/packages/analytics/shippers/elastic_v3/common/package.json index 2313d1d491090..9e9c8f3054097 100644 --- a/packages/analytics/shippers/elastic_v3/common/package.json +++ b/packages/analytics/shippers/elastic_v3/common/package.json @@ -5,5 +5,6 @@ "browser": "./target_web/index.js", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/analytics/shippers/elastic_v3/common/tsconfig.json b/packages/analytics/shippers/elastic_v3/common/tsconfig.json index 73bd8629597a9..6d893e10d8cc9 100644 --- a/packages/analytics/shippers/elastic_v3/common/tsconfig.json +++ b/packages/analytics/shippers/elastic_v3/common/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/analytics/shippers/elastic_v3/server/BUILD.bazel b/packages/analytics/shippers/elastic_v3/server/BUILD.bazel index 8f69ca7bb4e0a..8f78c9a9c1a71 100644 --- a/packages/analytics/shippers/elastic_v3/server/BUILD.bazel +++ b/packages/analytics/shippers/elastic_v3/server/BUILD.bazel @@ -92,7 +92,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -106,6 +105,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -117,17 +124,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/analytics/shippers/elastic_v3/server/package.json b/packages/analytics/shippers/elastic_v3/server/package.json index 846beb3cf2a3d..9b05193e3aec0 100644 --- a/packages/analytics/shippers/elastic_v3/server/package.json +++ b/packages/analytics/shippers/elastic_v3/server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/analytics/shippers/elastic_v3/server/src/server_shipper.test.ts b/packages/analytics/shippers/elastic_v3/server/src/server_shipper.test.ts index 03356f7428da7..091be6cb96e83 100644 --- a/packages/analytics/shippers/elastic_v3/server/src/server_shipper.test.ts +++ b/packages/analytics/shippers/elastic_v3/server/src/server_shipper.test.ts @@ -40,7 +40,7 @@ describe('ElasticV3ServerShipper', () => { const setLastBatchSent = (ms: number) => (shipper['lastBatchSent'] = ms); beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); shipper = new ElasticV3ServerShipper( { version: '1.2.3', channelName: 'test-channel', debug: true }, diff --git a/packages/analytics/shippers/elastic_v3/server/tsconfig.json b/packages/analytics/shippers/elastic_v3/server/tsconfig.json index 73bd8629597a9..6d893e10d8cc9 100644 --- a/packages/analytics/shippers/elastic_v3/server/tsconfig.json +++ b/packages/analytics/shippers/elastic_v3/server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/analytics/shippers/fullstory/BUILD.bazel b/packages/analytics/shippers/fullstory/BUILD.bazel index a8fe8a579376d..b949d085e5d80 100644 --- a/packages/analytics/shippers/fullstory/BUILD.bazel +++ b/packages/analytics/shippers/fullstory/BUILD.bazel @@ -94,7 +94,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -108,6 +107,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -119,17 +126,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/analytics/shippers/fullstory/package.json b/packages/analytics/shippers/fullstory/package.json index 8ad45e29d2060..8b8f09163ceb7 100644 --- a/packages/analytics/shippers/fullstory/package.json +++ b/packages/analytics/shippers/fullstory/package.json @@ -5,5 +5,6 @@ "browser": "./target_web/index.js", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/analytics/shippers/fullstory/tsconfig.json b/packages/analytics/shippers/fullstory/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/analytics/shippers/fullstory/tsconfig.json +++ b/packages/analytics/shippers/fullstory/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/analytics/shippers/gainsight/BUILD.bazel b/packages/analytics/shippers/gainsight/BUILD.bazel index acc516408a52c..12a1890e8add5 100644 --- a/packages/analytics/shippers/gainsight/BUILD.bazel +++ b/packages/analytics/shippers/gainsight/BUILD.bazel @@ -94,7 +94,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -108,6 +107,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -119,17 +126,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/analytics/shippers/gainsight/package.json b/packages/analytics/shippers/gainsight/package.json index 8edfc5f262a7a..bd15dac62c115 100644 --- a/packages/analytics/shippers/gainsight/package.json +++ b/packages/analytics/shippers/gainsight/package.json @@ -5,5 +5,6 @@ "browser": "./target_web/index.js", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/analytics/shippers/gainsight/tsconfig.json b/packages/analytics/shippers/gainsight/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/analytics/shippers/gainsight/tsconfig.json +++ b/packages/analytics/shippers/gainsight/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/content-management/table_list/BUILD.bazel b/packages/content-management/table_list/BUILD.bazel index 170ce00558045..0c55131524a78 100644 --- a/packages/content-management/table_list/BUILD.bazel +++ b/packages/content-management/table_list/BUILD.bazel @@ -121,7 +121,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -135,6 +134,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -146,17 +153,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/content-management/table_list/index.ts b/packages/content-management/table_list/index.ts index c6550a12da30a..532b35450d541 100644 --- a/packages/content-management/table_list/index.ts +++ b/packages/content-management/table_list/index.ts @@ -9,3 +9,4 @@ export { TableListView, TableListViewProvider, TableListViewKibanaProvider } from './src'; export type { UserContentCommonSchema } from './src'; +export type { TableListViewKibanaDependencies } from './src/services'; diff --git a/packages/content-management/table_list/package.json b/packages/content-management/table_list/package.json index f4cc8ba690d20..2df98754b0224 100644 --- a/packages/content-management/table_list/package.json +++ b/packages/content-management/table_list/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/content-management/table_list/src/table_list_view.test.tsx b/packages/content-management/table_list/src/table_list_view.test.tsx index 8e5aff4ae0dbe..01b1a3b215ea1 100644 --- a/packages/content-management/table_list/src/table_list_view.test.tsx +++ b/packages/content-management/table_list/src/table_list_view.test.tsx @@ -49,7 +49,7 @@ const requiredProps: TableListViewProps = { describe('TableListView', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/packages/content-management/table_list/tsconfig.json b/packages/content-management/table_list/tsconfig.json index df09013c1e96f..695a24957687b 100644 --- a/packages/content-management/table_list/tsconfig.json +++ b/packages/content-management/table_list/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/analytics/core-analytics-browser-internal/BUILD.bazel b/packages/core/analytics/core-analytics-browser-internal/BUILD.bazel index d7603c98604bf..3413eaf4fdda1 100644 --- a/packages/core/analytics/core-analytics-browser-internal/BUILD.bazel +++ b/packages/core/analytics/core-analytics-browser-internal/BUILD.bazel @@ -87,7 +87,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -101,6 +100,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -112,17 +119,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/analytics/core-analytics-browser-internal/package.json b/packages/core/analytics/core-analytics-browser-internal/package.json index a556bd85f8e49..f40589e37d198 100644 --- a/packages/core/analytics/core-analytics-browser-internal/package.json +++ b/packages/core/analytics/core-analytics-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts b/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts index d3514cb80edf3..177a01393a3e2 100644 --- a/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts +++ b/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts @@ -12,6 +12,18 @@ import { injectedMetadataServiceMock } from '@kbn/core-injected-metadata-browser import { analyticsClientMock } from './analytics_service.test.mocks'; import { AnalyticsService } from './analytics_service'; +function findRegisteredContextProviderByName(contextProviderName: string) { + return analyticsClientMock.registerContextProvider.mock.calls.find( + ([{ name }]) => name === contextProviderName + )!; +} + +function findRegisteredEventTypeByName(eventTypeName: string) { + return analyticsClientMock.registerEventType.mock.calls.find( + ([{ eventType }]) => eventType === eventTypeName + )!; +} + describe('AnalyticsService', () => { let analyticsService: AnalyticsService; beforeEach(() => { @@ -19,34 +31,39 @@ describe('AnalyticsService', () => { analyticsService = new AnalyticsService(coreContextMock.create()); }); test('should register some context providers on creation', async () => { - expect(analyticsClientMock.registerContextProvider).toHaveBeenCalledTimes(3); - expect( - await firstValueFrom(analyticsClientMock.registerContextProvider.mock.calls[0][0].context$) - ).toMatchInlineSnapshot(` - Object { - "branch": "branch", - "buildNum": 100, - "buildSha": "buildSha", - "isDev": true, - "isDistributable": false, - "version": "version", - } - `); + expect(analyticsClientMock.registerContextProvider).toHaveBeenCalledTimes(4); + expect(await firstValueFrom(findRegisteredContextProviderByName('build info')[0].context$)) + .toMatchInlineSnapshot(` + Object { + "branch": "branch", + "buildNum": 100, + "buildSha": "buildSha", + "isDev": true, + "isDistributable": false, + "version": "version", + } + `); expect( - await firstValueFrom(analyticsClientMock.registerContextProvider.mock.calls[1][0].context$) + await firstValueFrom(findRegisteredContextProviderByName('session-id')[0].context$) ).toEqual({ session_id: expect.any(String) }); expect( - await firstValueFrom(analyticsClientMock.registerContextProvider.mock.calls[2][0].context$) + await firstValueFrom(findRegisteredContextProviderByName('browser info')[0].context$) ).toEqual({ preferred_language: 'en-US', preferred_languages: ['en-US', 'en'], user_agent: expect.any(String), }); + expect( + await firstValueFrom(findRegisteredContextProviderByName('viewport_size')[0].context$) + ).toEqual({ + viewport_width: 1024, + viewport_height: 768, + }); }); test('should register the `performance_metric` and `click` event types on creation', () => { - expect(analyticsClientMock.registerEventType).toHaveBeenCalledTimes(2); - expect(analyticsClientMock.registerEventType.mock.calls[0]).toMatchInlineSnapshot(` + expect(analyticsClientMock.registerEventType).toHaveBeenCalledTimes(3); + expect(findRegisteredEventTypeByName('performance_metric')).toMatchInlineSnapshot(` Array [ Object { "eventType": "performance_metric", @@ -144,7 +161,7 @@ describe('AnalyticsService', () => { }, ] `); - expect(analyticsClientMock.registerEventType.mock.calls[1]).toMatchInlineSnapshot(` + expect(findRegisteredEventTypeByName('click')).toMatchInlineSnapshot(` Array [ Object { "eventType": "click", @@ -162,6 +179,27 @@ describe('AnalyticsService', () => { }, ] `); + expect(findRegisteredEventTypeByName('viewport_resize')).toMatchInlineSnapshot(` + Array [ + Object { + "eventType": "viewport_resize", + "schema": Object { + "viewport_height": Object { + "_meta": Object { + "description": "The value seen as the CSS viewport @media (height)", + }, + "type": "long", + }, + "viewport_width": Object { + "_meta": Object { + "description": "The value seen as the CSS viewport @media (width)", + }, + "type": "long", + }, + }, + }, + ] + `); }); test('setup should expose all the register APIs, reportEvent and opt-in', () => { @@ -181,7 +219,7 @@ describe('AnalyticsService', () => { const injectedMetadata = injectedMetadataServiceMock.createSetupContract(); analyticsService.setup({ injectedMetadata }); expect( - await firstValueFrom(analyticsClientMock.registerContextProvider.mock.calls[3][0].context$) + await firstValueFrom(findRegisteredContextProviderByName('elasticsearch info')[0].context$) ).toMatchInlineSnapshot(`undefined`); }); @@ -194,14 +232,14 @@ describe('AnalyticsService', () => { }); analyticsService.setup({ injectedMetadata }); expect( - await firstValueFrom(analyticsClientMock.registerContextProvider.mock.calls[3][0].context$) + await firstValueFrom(findRegisteredContextProviderByName('elasticsearch info')[0].context$) ).toMatchInlineSnapshot(` - Object { - "cluster_name": "cluster_name", - "cluster_uuid": "cluster_uuid", - "cluster_version": "version", - } - `); + Object { + "cluster_name": "cluster_name", + "cluster_uuid": "cluster_uuid", + "cluster_version": "version", + } + `); }); test('setup should expose only the APIs report and opt-in', () => { diff --git a/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts b/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts index 938b0b043bc29..0dcd49bd69fcc 100644 --- a/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts +++ b/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { of } from 'rxjs'; +import { of, Subscription } from 'rxjs'; import type { AnalyticsClient } from '@kbn/analytics-client'; import { createAnalytics } from '@kbn/analytics-client'; import { registerPerformanceMetricEventType } from '@kbn/ebt-tools'; @@ -16,6 +16,7 @@ import type { AnalyticsServiceSetup, AnalyticsServiceStart } from '@kbn/core-ana import { trackClicks } from './track_clicks'; import { getSessionId } from './get_session_id'; import { createLogger } from './logger'; +import { trackViewportSize } from './track_viewport_size'; /** @internal */ export interface AnalyticsServiceSetupDeps { @@ -24,6 +25,7 @@ export interface AnalyticsServiceSetupDeps { export class AnalyticsService { private readonly analyticsClient: AnalyticsClient; + private readonly subscriptionsHandler = new Subscription(); constructor(core: CoreContext) { this.analyticsClient = createAnalytics({ @@ -41,7 +43,8 @@ export class AnalyticsService { // and can benefit other consumers of the client. this.registerSessionIdContext(); this.registerBrowserInfoAnalyticsContext(); - trackClicks(this.analyticsClient, core.env.mode.dev); + this.subscriptionsHandler.add(trackClicks(this.analyticsClient, core.env.mode.dev)); + this.subscriptionsHandler.add(trackViewportSize(this.analyticsClient)); } public setup({ injectedMetadata }: AnalyticsServiceSetupDeps): AnalyticsServiceSetup { @@ -67,6 +70,7 @@ export class AnalyticsService { } public stop() { + this.subscriptionsHandler.unsubscribe(); this.analyticsClient.shutdown(); } diff --git a/packages/core/analytics/core-analytics-browser-internal/src/logger.ts b/packages/core/analytics/core-analytics-browser-internal/src/logger.ts index 869fdbbd9fd85..ff403a7d46d2c 100644 --- a/packages/core/analytics/core-analytics-browser-internal/src/logger.ts +++ b/packages/core/analytics/core-analytics-browser-internal/src/logger.ts @@ -30,6 +30,7 @@ export function createLogger(isDev: boolean): Logger { trace: (...args) => (isDev ? console.trace(...args) : void 0), // eslint-disable-next-line no-console log: (...args) => (isDev ? console.log(...args) : void 0), + isLevelEnabled: () => true, get: () => logger, }; diff --git a/packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts b/packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts new file mode 100644 index 0000000000000..f99d6681e5ad8 --- /dev/null +++ b/packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.test.ts @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { firstValueFrom, take, type Subscription, toArray } from 'rxjs'; +import { analyticsClientMock } from './analytics_service.test.mocks'; +import { trackViewportSize } from './track_viewport_size'; + +describe('trackViewportSize', () => { + const addEventListenerSpy = jest.spyOn(window, 'addEventListener'); + let subscription: Subscription | undefined; + + afterEach(() => { + subscription?.unsubscribe(); + jest.resetAllMocks(); + }); + + test('registers the analytics event type, the context provider, and a listener to the "resize" events', () => { + subscription = trackViewportSize(analyticsClientMock); + + expect(analyticsClientMock.registerContextProvider).toHaveBeenCalledTimes(1); + expect(analyticsClientMock.registerContextProvider).toHaveBeenCalledWith( + expect.objectContaining({ + name: 'viewport_size', + }) + ); + + expect(analyticsClientMock.registerEventType).toHaveBeenCalledTimes(1); + expect(analyticsClientMock.registerEventType).toHaveBeenCalledWith( + expect.objectContaining({ + eventType: 'viewport_resize', + }) + ); + expect(addEventListenerSpy).toHaveBeenCalledTimes(1); + expect(addEventListenerSpy).toHaveBeenCalledWith('resize', expect.any(Function), undefined); + }); + + test('emits a context update before the resize occurs', async () => { + subscription = trackViewportSize(analyticsClientMock); + + const { context$ } = analyticsClientMock.registerContextProvider.mock.calls[0][0]; + await expect(firstValueFrom(context$.pipe(take(1)))).resolves.toStrictEqual({ + viewport_width: 1024, + viewport_height: 768, + }); + }); + + test('reports an analytics event when a resize event occurs', async () => { + subscription = trackViewportSize(analyticsClientMock); + + const { context$ } = analyticsClientMock.registerContextProvider.mock.calls[0][0]; + + // window.resizeTo(100, 100) wouldn't trigger the event in Jest, so we need to call the listener straight away. + // eslint-disable-next-line dot-notation + window['innerWidth'] = 100; + // eslint-disable-next-line dot-notation + window['innerHeight'] = 100; + + expect(addEventListenerSpy).toHaveBeenCalledTimes(1); + (addEventListenerSpy.mock.calls[0][1] as Function)(); + + await expect(firstValueFrom(context$.pipe(take(2), toArray()))).resolves.toStrictEqual([ + { viewport_width: 1024, viewport_height: 768 }, + { viewport_width: 100, viewport_height: 100 }, + ]); + + expect(analyticsClientMock.reportEvent).toHaveBeenCalledTimes(1); + expect(analyticsClientMock.reportEvent).toHaveBeenCalledWith('viewport_resize', { + viewport_width: 100, + viewport_height: 100, + }); + }); +}); diff --git a/packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts b/packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts new file mode 100644 index 0000000000000..17fab459f2e8f --- /dev/null +++ b/packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts @@ -0,0 +1,68 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { debounceTime, fromEvent, map, merge, of, shareReplay } from 'rxjs'; +import type { AnalyticsClient, RootSchema } from '@kbn/analytics-client'; + +export interface ViewportSize { + viewport_width: number; + viewport_height: number; +} + +const schema: RootSchema = { + viewport_width: { + type: 'long', + _meta: { description: 'The value seen as the CSS viewport @media (width)' }, + }, + viewport_height: { + type: 'long', + _meta: { description: 'The value seen as the CSS viewport @media (height)' }, + }, +}; + +/** + * Get the @media (width) and @media (height) in the format of {@link ViewportSize} + */ +function getViewportSize(): ViewportSize { + // Explanation of the math below: https://stackoverflow.com/questions/1248081/how-to-get-the-browser-viewport-dimensions + return { + viewport_width: Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0), + viewport_height: Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0), + }; +} + +/** + * Registers the event type "viewport_size" in the analytics client, and the context provider with the same name. + * Then it listens to all the "resize" events in the UI and reports their size as {@link ViewportSize} + * @param analytics + */ +export function trackViewportSize(analytics: AnalyticsClient) { + // window or document? + // According to MDN, it only emits on `window`: https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event + const resize$ = fromEvent(window, 'resize').pipe( + debounceTime(200), + map(() => getViewportSize()), + shareReplay(1) + ); + + analytics.registerEventType({ + eventType: 'viewport_resize', + schema, + }); + + analytics.registerContextProvider({ + name: 'viewport_size', + schema, + context$: merge( + of(getViewportSize()), // Emits an initial value so initial events' context is also populated + resize$ + ), + }); + + return resize$.subscribe((event) => analytics.reportEvent('viewport_resize', event)); +} diff --git a/packages/core/analytics/core-analytics-browser-internal/tsconfig.json b/packages/core/analytics/core-analytics-browser-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/analytics/core-analytics-browser-internal/tsconfig.json +++ b/packages/core/analytics/core-analytics-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/analytics/core-analytics-browser-mocks/BUILD.bazel b/packages/core/analytics/core-analytics-browser-mocks/BUILD.bazel index d831336371e2d..d80d2a8feae21 100644 --- a/packages/core/analytics/core-analytics-browser-mocks/BUILD.bazel +++ b/packages/core/analytics/core-analytics-browser-mocks/BUILD.bazel @@ -73,7 +73,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -87,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/analytics/core-analytics-browser-mocks/package.json b/packages/core/analytics/core-analytics-browser-mocks/package.json index 56e1fd2076796..b8dd2d03bad66 100644 --- a/packages/core/analytics/core-analytics-browser-mocks/package.json +++ b/packages/core/analytics/core-analytics-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/analytics/core-analytics-browser-mocks/tsconfig.json b/packages/core/analytics/core-analytics-browser-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/analytics/core-analytics-browser-mocks/tsconfig.json +++ b/packages/core/analytics/core-analytics-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/analytics/core-analytics-browser/BUILD.bazel b/packages/core/analytics/core-analytics-browser/BUILD.bazel index 2027a6f952490..2dbf3c4791bba 100644 --- a/packages/core/analytics/core-analytics-browser/BUILD.bazel +++ b/packages/core/analytics/core-analytics-browser/BUILD.bazel @@ -72,7 +72,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -86,6 +85,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +104,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/analytics/core-analytics-browser/package.json b/packages/core/analytics/core-analytics-browser/package.json index c448c49689233..4ef1d65780abb 100644 --- a/packages/core/analytics/core-analytics-browser/package.json +++ b/packages/core/analytics/core-analytics-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/analytics/core-analytics-browser/tsconfig.json b/packages/core/analytics/core-analytics-browser/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/analytics/core-analytics-browser/tsconfig.json +++ b/packages/core/analytics/core-analytics-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/analytics/core-analytics-server-internal/BUILD.bazel b/packages/core/analytics/core-analytics-server-internal/BUILD.bazel index c763e9dfe62ba..1a507d0a065ce 100644 --- a/packages/core/analytics/core-analytics-server-internal/BUILD.bazel +++ b/packages/core/analytics/core-analytics-server-internal/BUILD.bazel @@ -71,7 +71,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -85,6 +84,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -96,17 +103,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/analytics/core-analytics-server-internal/package.json b/packages/core/analytics/core-analytics-server-internal/package.json index a80f7ed586a9d..742c092fa58f4 100644 --- a/packages/core/analytics/core-analytics-server-internal/package.json +++ b/packages/core/analytics/core-analytics-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/analytics/core-analytics-server-internal/tsconfig.json b/packages/core/analytics/core-analytics-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/analytics/core-analytics-server-internal/tsconfig.json +++ b/packages/core/analytics/core-analytics-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/analytics/core-analytics-server-mocks/BUILD.bazel b/packages/core/analytics/core-analytics-server-mocks/BUILD.bazel index bfa67397b62f3..cfcf0175d52db 100644 --- a/packages/core/analytics/core-analytics-server-mocks/BUILD.bazel +++ b/packages/core/analytics/core-analytics-server-mocks/BUILD.bazel @@ -67,7 +67,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -81,6 +80,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -92,17 +99,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/analytics/core-analytics-server-mocks/package.json b/packages/core/analytics/core-analytics-server-mocks/package.json index be11f7741aa83..864715f795249 100644 --- a/packages/core/analytics/core-analytics-server-mocks/package.json +++ b/packages/core/analytics/core-analytics-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/analytics/core-analytics-server-mocks/tsconfig.json b/packages/core/analytics/core-analytics-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/analytics/core-analytics-server-mocks/tsconfig.json +++ b/packages/core/analytics/core-analytics-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/analytics/core-analytics-server/BUILD.bazel b/packages/core/analytics/core-analytics-server/BUILD.bazel index afa70041d300c..7cb5e329e0ffe 100644 --- a/packages/core/analytics/core-analytics-server/BUILD.bazel +++ b/packages/core/analytics/core-analytics-server/BUILD.bazel @@ -64,7 +64,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -78,6 +77,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -89,17 +96,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/analytics/core-analytics-server/package.json b/packages/core/analytics/core-analytics-server/package.json index 40581cbaee9b4..0b5d1fce5638e 100644 --- a/packages/core/analytics/core-analytics-server/package.json +++ b/packages/core/analytics/core-analytics-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/analytics/core-analytics-server/tsconfig.json b/packages/core/analytics/core-analytics-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/analytics/core-analytics-server/tsconfig.json +++ b/packages/core/analytics/core-analytics-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/application/core-application-browser-internal/BUILD.bazel b/packages/core/application/core-application-browser-internal/BUILD.bazel index 4467da2ddc9ed..3232dfc677aff 100644 --- a/packages/core/application/core-application-browser-internal/BUILD.bazel +++ b/packages/core/application/core-application-browser-internal/BUILD.bazel @@ -108,7 +108,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -123,6 +122,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -134,17 +141,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/application/core-application-browser-internal/package.json b/packages/core/application/core-application-browser-internal/package.json index 66df230cd02d6..4ded58a99f55c 100644 --- a/packages/core/application/core-application-browser-internal/package.json +++ b/packages/core/application/core-application-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/application/core-application-browser-internal/tsconfig.json b/packages/core/application/core-application-browser-internal/tsconfig.json index fdd506125afb6..c561d9f220124 100644 --- a/packages/core/application/core-application-browser-internal/tsconfig.json +++ b/packages/core/application/core-application-browser-internal/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/application/core-application-browser-mocks/BUILD.bazel b/packages/core/application/core-application-browser-mocks/BUILD.bazel index 64080aad293c6..979cc8d11021b 100644 --- a/packages/core/application/core-application-browser-mocks/BUILD.bazel +++ b/packages/core/application/core-application-browser-mocks/BUILD.bazel @@ -81,7 +81,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -96,6 +95,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -107,17 +114,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/application/core-application-browser-mocks/package.json b/packages/core/application/core-application-browser-mocks/package.json index 2b769204903c4..925c02bcbb09d 100644 --- a/packages/core/application/core-application-browser-mocks/package.json +++ b/packages/core/application/core-application-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/application/core-application-browser-mocks/tsconfig.json b/packages/core/application/core-application-browser-mocks/tsconfig.json index a4f1ce7985a55..37f8e83d0d7a6 100644 --- a/packages/core/application/core-application-browser-mocks/tsconfig.json +++ b/packages/core/application/core-application-browser-mocks/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/application/core-application-browser/BUILD.bazel b/packages/core/application/core-application-browser/BUILD.bazel index 44dba5ffcdd94..b2e1184ef03ed 100644 --- a/packages/core/application/core-application-browser/BUILD.bazel +++ b/packages/core/application/core-application-browser/BUILD.bazel @@ -80,7 +80,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -95,6 +94,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -106,17 +113,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/application/core-application-browser/package.json b/packages/core/application/core-application-browser/package.json index 012c3410a9be1..3626396a9eff3 100644 --- a/packages/core/application/core-application-browser/package.json +++ b/packages/core/application/core-application-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/application/core-application-browser/tsconfig.json b/packages/core/application/core-application-browser/tsconfig.json index d06f069b513d1..48df8f2957246 100644 --- a/packages/core/application/core-application-browser/tsconfig.json +++ b/packages/core/application/core-application-browser/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/application/core-application-common/BUILD.bazel b/packages/core/application/core-application-common/BUILD.bazel index f14d7331b6bfb..43edda698fa09 100644 --- a/packages/core/application/core-application-common/BUILD.bazel +++ b/packages/core/application/core-application-common/BUILD.bazel @@ -75,7 +75,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/application/core-application-common/package.json b/packages/core/application/core-application-common/package.json index e1d006502592c..22b9a3e452f17 100644 --- a/packages/core/application/core-application-common/package.json +++ b/packages/core/application/core-application-common/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/application/core-application-common/tsconfig.json b/packages/core/application/core-application-common/tsconfig.json index d06f069b513d1..48df8f2957246 100644 --- a/packages/core/application/core-application-common/tsconfig.json +++ b/packages/core/application/core-application-common/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/apps/core-apps-browser-internal/BUILD.bazel b/packages/core/apps/core-apps-browser-internal/BUILD.bazel index 4ca5c1a1cf2af..941b011104ba9 100644 --- a/packages/core/apps/core-apps-browser-internal/BUILD.bazel +++ b/packages/core/apps/core-apps-browser-internal/BUILD.bazel @@ -96,7 +96,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -110,6 +109,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -121,17 +128,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/apps/core-apps-browser-internal/package.json b/packages/core/apps/core-apps-browser-internal/package.json index 58262f9a7aaeb..04029a6f91fbc 100644 --- a/packages/core/apps/core-apps-browser-internal/package.json +++ b/packages/core/apps/core-apps-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/apps/core-apps-browser-internal/tsconfig.json b/packages/core/apps/core-apps-browser-internal/tsconfig.json index 2249e2ee93761..37f8e83d0d7a6 100644 --- a/packages/core/apps/core-apps-browser-internal/tsconfig.json +++ b/packages/core/apps/core-apps-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/apps/core-apps-browser-mocks/BUILD.bazel b/packages/core/apps/core-apps-browser-mocks/BUILD.bazel index 42c29b72766b9..65ce563a97d97 100644 --- a/packages/core/apps/core-apps-browser-mocks/BUILD.bazel +++ b/packages/core/apps/core-apps-browser-mocks/BUILD.bazel @@ -74,7 +74,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -88,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/apps/core-apps-browser-mocks/package.json b/packages/core/apps/core-apps-browser-mocks/package.json index 486f6445a8b24..690d50dc3a1cf 100644 --- a/packages/core/apps/core-apps-browser-mocks/package.json +++ b/packages/core/apps/core-apps-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/apps/core-apps-browser-mocks/tsconfig.json b/packages/core/apps/core-apps-browser-mocks/tsconfig.json index 26b4c7aca3a67..741519055e986 100644 --- a/packages/core/apps/core-apps-browser-mocks/tsconfig.json +++ b/packages/core/apps/core-apps-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/apps/core-apps-server-internal/BUILD.bazel b/packages/core/apps/core-apps-server-internal/BUILD.bazel new file mode 100644 index 0000000000000..94f52482c27d4 --- /dev/null +++ b/packages/core/apps/core-apps-server-internal/BUILD.bazel @@ -0,0 +1,141 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-apps-server-internal" +PKG_REQUIRE_NAME = "@kbn/core-apps-server-internal" + +SOURCE_FILES = glob( + [ + "**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +ASSETS = glob(["assets/**/*"]) + +filegroup( + name = "assets", + srcs = ASSETS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", + ":assets" +] + +RUNTIME_DEPS = [ + "@npm//elastic-apm-node", + "@npm//lru-cache", + "@npm//mime-types", + "//packages/kbn-config", + "//packages/kbn-config-schema", + "//packages/kbn-utils", + "//packages/kbn-logging", + "//packages/kbn-ui-shared-deps-npm", + "//packages/kbn-ui-shared-deps-src", + "//packages/core/base/core-base-server-internal", + "//packages/core/lifecycle/core-lifecycle-server-internal", + "//packages/core/plugins/core-plugins-base-server-internal", +] + +TYPES_DEPS = [ + "@npm//elastic-apm-node", + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/lru-cache", + "@npm//@types/mime-types", + "//packages/kbn-config:npm_module_types", + "//packages/kbn-config-schema:npm_module_types", + "//packages/kbn-ui-shared-deps-npm:npm_module_types", + "//packages/kbn-ui-shared-deps-src:npm_module_types", + "//packages/kbn-utils:npm_module_types", + "//packages/kbn-logging:npm_module_types", + "//packages/core/base/core-base-server-internal:npm_module_types", + "//packages/core/http/core-http-resources-server:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", + "//packages/core/lifecycle/core-lifecycle-server-internal:npm_module_types", + "//packages/core/plugins/core-plugins-base-server-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + additional_args = [ + "--copy-files", + "--quiet" + ], +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/apps/core-apps-server-internal/README.md b/packages/core/apps/core-apps-server-internal/README.md new file mode 100644 index 0000000000000..979146f37207c --- /dev/null +++ b/packages/core/apps/core-apps-server-internal/README.md @@ -0,0 +1,3 @@ +# @kbn/core-apps-server-internal + +This package contains the internal types and implementation of Core's server-side `coreApps` service. diff --git a/src/core/server/core_app/assets/favicons/favicon.distribution.ico b/packages/core/apps/core-apps-server-internal/assets/favicons/favicon.distribution.ico similarity index 100% rename from src/core/server/core_app/assets/favicons/favicon.distribution.ico rename to packages/core/apps/core-apps-server-internal/assets/favicons/favicon.distribution.ico diff --git a/src/core/server/core_app/assets/favicons/favicon.distribution.png b/packages/core/apps/core-apps-server-internal/assets/favicons/favicon.distribution.png similarity index 100% rename from src/core/server/core_app/assets/favicons/favicon.distribution.png rename to packages/core/apps/core-apps-server-internal/assets/favicons/favicon.distribution.png diff --git a/src/core/server/core_app/assets/favicons/favicon.distribution.svg b/packages/core/apps/core-apps-server-internal/assets/favicons/favicon.distribution.svg similarity index 100% rename from src/core/server/core_app/assets/favicons/favicon.distribution.svg rename to packages/core/apps/core-apps-server-internal/assets/favicons/favicon.distribution.svg diff --git a/src/core/server/core_app/assets/favicons/favicon.ico b/packages/core/apps/core-apps-server-internal/assets/favicons/favicon.ico similarity index 100% rename from src/core/server/core_app/assets/favicons/favicon.ico rename to packages/core/apps/core-apps-server-internal/assets/favicons/favicon.ico diff --git a/src/core/server/core_app/assets/favicons/favicon.png b/packages/core/apps/core-apps-server-internal/assets/favicons/favicon.png similarity index 100% rename from src/core/server/core_app/assets/favicons/favicon.png rename to packages/core/apps/core-apps-server-internal/assets/favicons/favicon.png diff --git a/src/core/server/core_app/assets/favicons/favicon.svg b/packages/core/apps/core-apps-server-internal/assets/favicons/favicon.svg similarity index 100% rename from src/core/server/core_app/assets/favicons/favicon.svg rename to packages/core/apps/core-apps-server-internal/assets/favicons/favicon.svg diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Black.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Black.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Black.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Black.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Black.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Black.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Black.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Black.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-BlackItalic.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-BlackItalic.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-BlackItalic.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-BlackItalic.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-BlackItalic.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-BlackItalic.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-BlackItalic.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-BlackItalic.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Bold.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Bold.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Bold.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Bold.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Bold.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Bold.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Bold.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Bold.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-BoldItalic.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-BoldItalic.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-BoldItalic.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-BoldItalic.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-BoldItalic.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-BoldItalic.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-BoldItalic.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-BoldItalic.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-ExtraBold.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraBold.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-ExtraBold.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraBold.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-ExtraBold.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraBold.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-ExtraBold.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraBold.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-ExtraBoldItalic.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraBoldItalic.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-ExtraBoldItalic.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraBoldItalic.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-ExtraBoldItalic.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraBoldItalic.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-ExtraBoldItalic.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraBoldItalic.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-ExtraLight.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraLight.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-ExtraLight.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraLight.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-ExtraLight.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraLight.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-ExtraLight.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraLight.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-ExtraLightItalic.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraLightItalic.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-ExtraLightItalic.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraLightItalic.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-ExtraLightItalic.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraLightItalic.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-ExtraLightItalic.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ExtraLightItalic.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Italic.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Italic.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Italic.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Italic.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Italic.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Italic.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Italic.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Italic.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Light.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Light.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Light.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Light.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Light.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Light.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Light.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Light.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-LightItalic.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-LightItalic.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-LightItalic.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-LightItalic.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-LightItalic.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-LightItalic.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-LightItalic.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-LightItalic.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Medium.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Medium.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Medium.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Medium.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Medium.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Medium.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Medium.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Medium.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-MediumItalic.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-MediumItalic.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-MediumItalic.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-MediumItalic.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-MediumItalic.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-MediumItalic.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-MediumItalic.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-MediumItalic.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Regular.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Regular.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Regular.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Regular.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Regular.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Regular.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Regular.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Regular.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-SemiBold.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-SemiBold.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-SemiBold.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-SemiBold.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-SemiBold.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-SemiBold.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-SemiBold.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-SemiBold.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-SemiBoldItalic.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-SemiBoldItalic.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-SemiBoldItalic.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-SemiBoldItalic.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-SemiBoldItalic.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-SemiBoldItalic.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-SemiBoldItalic.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-SemiBoldItalic.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Thin.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Thin.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Thin.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Thin.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-Thin.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Thin.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-Thin.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-Thin.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-ThinItalic.woff b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ThinItalic.woff similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-ThinItalic.woff rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ThinItalic.woff diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-ThinItalic.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ThinItalic.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-ThinItalic.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-ThinItalic.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-italic.var.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-italic.var.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-italic.var.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-italic.var.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter-roman.var.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-roman.var.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter-roman.var.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter-roman.var.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/Inter.var.woff2 b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter.var.woff2 similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/Inter.var.woff2 rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/Inter.var.woff2 diff --git a/src/core/server/core_app/assets/fonts/inter/LICENSE.txt b/packages/core/apps/core-apps-server-internal/assets/fonts/inter/LICENSE.txt similarity index 100% rename from src/core/server/core_app/assets/fonts/inter/LICENSE.txt rename to packages/core/apps/core-apps-server-internal/assets/fonts/inter/LICENSE.txt diff --git a/src/core/server/core_app/assets/fonts/readme.md b/packages/core/apps/core-apps-server-internal/assets/fonts/readme.md similarity index 100% rename from src/core/server/core_app/assets/fonts/readme.md rename to packages/core/apps/core-apps-server-internal/assets/fonts/readme.md diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/LICENSE.txt b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/LICENSE.txt similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/LICENSE.txt rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/LICENSE.txt diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Bold.ttf b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Bold.ttf similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Bold.ttf rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Bold.ttf diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-BoldItalic.ttf b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-BoldItalic.ttf similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-BoldItalic.ttf rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-BoldItalic.ttf diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Italic.ttf b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Italic.ttf similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Italic.ttf rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Italic.ttf diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Light.ttf b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Light.ttf similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Light.ttf rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Light.ttf diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-LightItalic.ttf b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-LightItalic.ttf similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-LightItalic.ttf rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-LightItalic.ttf diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Medium.ttf b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Medium.ttf similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Medium.ttf rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Medium.ttf diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-MediumItalic.ttf b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-MediumItalic.ttf similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-MediumItalic.ttf rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-MediumItalic.ttf diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Regular.ttf b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Regular.ttf similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Regular.ttf rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Regular.ttf diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Thin.ttf b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Thin.ttf similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-Thin.ttf rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-Thin.ttf diff --git a/src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-ThinItalic.ttf b/packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-ThinItalic.ttf similarity index 100% rename from src/core/server/core_app/assets/fonts/roboto_mono/RobotoMono-ThinItalic.ttf rename to packages/core/apps/core-apps-server-internal/assets/fonts/roboto_mono/RobotoMono-ThinItalic.ttf diff --git a/src/core/server/core_app/assets/legacy_dark_theme.css b/packages/core/apps/core-apps-server-internal/assets/legacy_dark_theme.css similarity index 100% rename from src/core/server/core_app/assets/legacy_dark_theme.css rename to packages/core/apps/core-apps-server-internal/assets/legacy_dark_theme.css diff --git a/src/core/server/core_app/assets/legacy_dark_theme.min.css b/packages/core/apps/core-apps-server-internal/assets/legacy_dark_theme.min.css similarity index 100% rename from src/core/server/core_app/assets/legacy_dark_theme.min.css rename to packages/core/apps/core-apps-server-internal/assets/legacy_dark_theme.min.css diff --git a/src/core/server/core_app/assets/legacy_light_theme.css b/packages/core/apps/core-apps-server-internal/assets/legacy_light_theme.css similarity index 100% rename from src/core/server/core_app/assets/legacy_light_theme.css rename to packages/core/apps/core-apps-server-internal/assets/legacy_light_theme.css diff --git a/src/core/server/core_app/assets/legacy_light_theme.min.css b/packages/core/apps/core-apps-server-internal/assets/legacy_light_theme.min.css similarity index 100% rename from src/core/server/core_app/assets/legacy_light_theme.min.css rename to packages/core/apps/core-apps-server-internal/assets/legacy_light_theme.min.css diff --git a/packages/core/apps/core-apps-server-internal/index.ts b/packages/core/apps/core-apps-server-internal/index.ts new file mode 100644 index 0000000000000..7a28e9f9d2f87 --- /dev/null +++ b/packages/core/apps/core-apps-server-internal/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { CoreAppsService } from './src'; +export type { + InternalCoreAppsServiceRequestHandlerContext, + InternalCoreAppsServiceRouter, +} from './src'; +// only used by integration tests +export { FileHashCache, registerRouteForBundle } from './src'; diff --git a/packages/core/apps/core-apps-server-internal/jest.config.js b/packages/core/apps/core-apps-server-internal/jest.config.js new file mode 100644 index 0000000000000..d52363b8a2c1e --- /dev/null +++ b/packages/core/apps/core-apps-server-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/apps/core-apps-server-internal'], +}; diff --git a/packages/core/apps/core-apps-server-internal/kibana.jsonc b/packages/core/apps/core-apps-server-internal/kibana.jsonc new file mode 100644 index 0000000000000..976f82a69e7c9 --- /dev/null +++ b/packages/core/apps/core-apps-server-internal/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-apps-server-internal", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/apps/core-apps-server-internal/package.json b/packages/core/apps/core-apps-server-internal/package.json new file mode 100644 index 0000000000000..04c52e856bf2a --- /dev/null +++ b/packages/core/apps/core-apps-server-internal/package.json @@ -0,0 +1,9 @@ +{ + "name": "@kbn/core-apps-server-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/src/core/server/core_app/bundle_routes/bundle_route.test.mocks.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/bundle_route.test.mocks.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/bundle_route.test.mocks.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/bundle_route.test.mocks.ts diff --git a/src/core/server/core_app/bundle_routes/bundle_route.test.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/bundle_route.test.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/bundle_route.test.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/bundle_route.test.ts diff --git a/src/core/server/core_app/bundle_routes/bundles_route.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/bundles_route.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts diff --git a/src/core/server/core_app/bundle_routes/dynamic_asset_response.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/dynamic_asset_response.ts similarity index 98% rename from src/core/server/core_app/bundle_routes/dynamic_asset_response.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/dynamic_asset_response.ts index 5287ff483f7ab..219beced6ca65 100644 --- a/src/core/server/core_app/bundle_routes/dynamic_asset_response.ts +++ b/packages/core/apps/core-apps-server-internal/src/bundle_routes/dynamic_asset_response.ts @@ -13,7 +13,7 @@ import agent from 'elastic-apm-node'; import type { RequestHandler } from '@kbn/core-http-server'; import { fstat, close } from './fs'; -import { IFileHashCache } from './file_hash_cache'; +import type { IFileHashCache } from './file_hash_cache'; import { getFileHash } from './file_hash'; import { selectCompressedFile } from './select_compressed_file'; diff --git a/src/core/server/core_app/bundle_routes/file_hash.test.mocks.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash.test.mocks.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/file_hash.test.mocks.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash.test.mocks.ts diff --git a/src/core/server/core_app/bundle_routes/file_hash.test.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash.test.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/file_hash.test.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash.test.ts diff --git a/src/core/server/core_app/bundle_routes/file_hash.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash.ts similarity index 94% rename from src/core/server/core_app/bundle_routes/file_hash.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash.ts index e309873254999..da3c85edb377e 100644 --- a/src/core/server/core_app/bundle_routes/file_hash.ts +++ b/packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash.ts @@ -8,7 +8,7 @@ import type { Stats } from 'fs'; import { generateFileHash, getFileCacheKey } from './utils'; -import { IFileHashCache } from './file_hash_cache'; +import type { IFileHashCache } from './file_hash_cache'; /** * Get the hash of a file via a file descriptor diff --git a/src/core/server/core_app/bundle_routes/file_hash_cache.test.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash_cache.test.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/file_hash_cache.test.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash_cache.test.ts diff --git a/src/core/server/core_app/bundle_routes/file_hash_cache.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash_cache.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/file_hash_cache.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/file_hash_cache.ts diff --git a/src/core/server/core_app/bundle_routes/fs.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/fs.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/fs.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/fs.ts diff --git a/packages/core/apps/core-apps-server-internal/src/bundle_routes/index.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/index.ts new file mode 100644 index 0000000000000..1877d85f83409 --- /dev/null +++ b/packages/core/apps/core-apps-server-internal/src/bundle_routes/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { registerBundleRoutes } from './register_bundle_routes'; +export { type IFileHashCache, FileHashCache } from './file_hash_cache'; +export { registerRouteForBundle } from './bundles_route'; diff --git a/src/core/server/core_app/bundle_routes/register_bundle_routes.test.mocks.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.mocks.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/register_bundle_routes.test.mocks.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.mocks.ts diff --git a/src/core/server/core_app/bundle_routes/register_bundle_routes.test.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.ts similarity index 98% rename from src/core/server/core_app/bundle_routes/register_bundle_routes.test.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.ts index f816a85404f7a..6ec5603137340 100644 --- a/src/core/server/core_app/bundle_routes/register_bundle_routes.test.ts +++ b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.ts @@ -8,7 +8,7 @@ import { registerRouteForBundleMock } from './register_bundle_routes.test.mocks'; -import { PackageInfo } from '@kbn/config'; +import type { PackageInfo } from '@kbn/config'; import { httpServiceMock } from '@kbn/core-http-server-mocks'; import type { InternalPluginInfo, UiPlugins } from '@kbn/core-plugins-base-server-internal'; import { registerBundleRoutes } from './register_bundle_routes'; diff --git a/src/core/server/core_app/bundle_routes/register_bundle_routes.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.ts similarity index 94% rename from src/core/server/core_app/bundle_routes/register_bundle_routes.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.ts index 4adb50fdc96ca..d0b5094edf94c 100644 --- a/src/core/server/core_app/bundle_routes/register_bundle_routes.ts +++ b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.ts @@ -7,10 +7,10 @@ */ import { join } from 'path'; -import { PackageInfo } from '@kbn/config'; +import type { PackageInfo } from '@kbn/config'; import { fromRoot } from '@kbn/utils'; import UiSharedDepsNpm from '@kbn/ui-shared-deps-npm'; -import * as UiSharedDepsSrc from '@kbn/ui-shared-deps-src'; +import { distDir as UiSharedDepsSrcDistDir } from '@kbn/ui-shared-deps-src'; import type { IRouter } from '@kbn/core-http-server'; import type { UiPlugins } from '@kbn/core-plugins-base-server-internal'; import { FileHashCache } from './file_hash_cache'; @@ -53,7 +53,7 @@ export function registerBundleRoutes({ registerRouteForBundle(router, { publicPath: `${serverBasePath}/${buildNum}/bundles/kbn-ui-shared-deps-src/`, routePath: `/${buildNum}/bundles/kbn-ui-shared-deps-src/`, - bundlesPath: UiSharedDepsSrc.distDir, + bundlesPath: UiSharedDepsSrcDistDir, fileHashCache, isDist, }); diff --git a/src/core/server/core_app/bundle_routes/select_compressed_file.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/select_compressed_file.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/select_compressed_file.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/select_compressed_file.ts diff --git a/src/core/server/core_app/bundle_routes/utils.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/utils.ts similarity index 100% rename from src/core/server/core_app/bundle_routes/utils.ts rename to packages/core/apps/core-apps-server-internal/src/bundle_routes/utils.ts diff --git a/src/core/server/core_app/core_app.test.mocks.ts b/packages/core/apps/core-apps-server-internal/src/core_app.test.mocks.ts similarity index 100% rename from src/core/server/core_app/core_app.test.mocks.ts rename to packages/core/apps/core-apps-server-internal/src/core_app.test.mocks.ts diff --git a/src/core/server/core_app/core_app.test.ts b/packages/core/apps/core-apps-server-internal/src/core_app.test.ts similarity index 90% rename from src/core/server/core_app/core_app.test.ts rename to packages/core/apps/core-apps-server-internal/src/core_app.test.ts index 1ea3eeef29a09..13122b4b09eb7 100644 --- a/src/core/server/core_app/core_app.test.ts +++ b/packages/core/apps/core-apps-server-internal/src/core_app.test.ts @@ -11,11 +11,12 @@ import { registerBundleRoutesMock } from './core_app.test.mocks'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; import { mockRouter } from '@kbn/core-http-router-server-mocks'; import type { UiPlugins } from '@kbn/core-plugins-base-server-internal'; -import { coreMock, httpServerMock } from '../mocks'; +import { httpServerMock } from '@kbn/core-http-server-mocks'; import { httpResourcesMock } from '@kbn/core-http-resources-server-mocks'; -import { PluginType } from '../plugins'; -import { CoreApp } from './core_app'; -import { RequestHandlerContext } from '..'; +import { PluginType } from '@kbn/core-base-common'; +import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; +import { coreInternalLifecycleMock } from '@kbn/core-lifecycle-server-mocks'; +import { CoreAppsService } from './core_app'; const emptyPlugins = (): UiPlugins => ({ internal: new Map(), @@ -25,16 +26,17 @@ const emptyPlugins = (): UiPlugins => ({ describe('CoreApp', () => { let coreContext: ReturnType; - let coreApp: CoreApp; - let internalCorePreboot: ReturnType; + let coreApp: CoreAppsService; + let internalCorePreboot: ReturnType; let prebootHTTPResourcesRegistrar: ReturnType; - let internalCoreSetup: ReturnType; + let internalCoreSetup: ReturnType; let httpResourcesRegistrar: ReturnType; beforeEach(() => { coreContext = mockCoreContext.create(); - internalCorePreboot = coreMock.createInternalPreboot(); + internalCorePreboot = coreInternalLifecycleMock.createInternalPreboot(); + internalCorePreboot.http.registerRoutes.mockImplementation((path, callback) => callback(mockRouter.create()) ); @@ -43,10 +45,11 @@ describe('CoreApp', () => { prebootHTTPResourcesRegistrar ); - internalCoreSetup = coreMock.createInternalSetup(); + internalCoreSetup = coreInternalLifecycleMock.createInternalSetup(); + httpResourcesRegistrar = httpResourcesMock.createRegistrar(); internalCoreSetup.httpResources.createRegistrar.mockReturnValue(httpResourcesRegistrar); - coreApp = new CoreApp(coreContext); + coreApp = new CoreAppsService(coreContext); }); afterEach(() => { diff --git a/src/core/server/core_app/core_app.ts b/packages/core/apps/core-apps-server-internal/src/core_app.ts similarity index 91% rename from src/core/server/core_app/core_app.ts rename to packages/core/apps/core-apps-server-internal/src/core_app.ts index f0940f6abad50..3e094fab889a6 100644 --- a/src/core/server/core_app/core_app.ts +++ b/packages/core/apps/core-apps-server-internal/src/core_app.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import Path from 'path'; import { stringify } from 'querystring'; import { Env } from '@kbn/config'; import { schema } from '@kbn/config-schema'; @@ -22,9 +21,9 @@ import type { } from '@kbn/core-http-server'; import type { UiPlugins } from '@kbn/core-plugins-base-server-internal'; import type { HttpResources, HttpResourcesServiceToolkit } from '@kbn/core-http-resources-server'; -import { InternalCorePreboot, InternalCoreSetup } from '../internal_types'; +import type { InternalCorePreboot, InternalCoreSetup } from '@kbn/core-lifecycle-server-internal'; import { registerBundleRoutes } from './bundle_routes'; -import type { InternalCoreAppRequestHandlerContext } from './internal_types'; +import type { InternalCoreAppsServiceRequestHandlerContext } from './internal_types'; /** @internal */ interface CommonRoutesParams { @@ -39,7 +38,7 @@ interface CommonRoutesParams { } /** @internal */ -export class CoreApp { +export class CoreAppsService { private readonly logger: Logger; private readonly env: Env; @@ -91,7 +90,7 @@ export class CoreApp { private registerDefaultRoutes(coreSetup: InternalCoreSetup, uiPlugins: UiPlugins) { const httpSetup = coreSetup.http; - const router = httpSetup.createRouter(''); + const router = httpSetup.createRouter(''); const resources = coreSetup.httpResources.createRegistrar(router); router.get({ path: '/', validate: false }, async (context, req, res) => { @@ -202,8 +201,13 @@ export class CoreApp { }); } + // After the package is built and bootstrap extracts files to bazel-bin, + // assets are exposed at the root of the package and in the package's node_modules dir private registerStaticDirs(core: InternalCoreSetup | InternalCorePreboot) { - core.http.registerStaticDir('/ui/{path*}', Path.resolve(__dirname, './assets')); + core.http.registerStaticDir( + '/ui/{path*}', + fromRoot('node_modules/@kbn/core-apps-server-internal/assets') + ); core.http.registerStaticDir( '/node_modules/@kbn/ui-framework/dist/{path*}', diff --git a/packages/core/apps/core-apps-server-internal/src/index.ts b/packages/core/apps/core-apps-server-internal/src/index.ts new file mode 100644 index 0000000000000..d2eca9036f40e --- /dev/null +++ b/packages/core/apps/core-apps-server-internal/src/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { CoreAppsService } from './core_app'; +export type { + InternalCoreAppsServiceRequestHandlerContext, + InternalCoreAppsServiceRouter, +} from './internal_types'; +// only used by integration tests +export { registerRouteForBundle, FileHashCache } from './bundle_routes'; diff --git a/packages/core/apps/core-apps-server-internal/src/internal_types.ts b/packages/core/apps/core-apps-server-internal/src/internal_types.ts new file mode 100644 index 0000000000000..f294c80664ae4 --- /dev/null +++ b/packages/core/apps/core-apps-server-internal/src/internal_types.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { IRouter, RequestHandlerContextBase } from '@kbn/core-http-server'; +import type { UiSettingsRequestHandlerContext } from '@kbn/core-ui-settings-server'; + +/** + * Request handler context used by core's coreApp routes. + * @internal + */ +export interface InternalCoreAppsServiceRequestHandlerContext extends RequestHandlerContextBase { + core: Promise<{ + uiSettings: UiSettingsRequestHandlerContext; + }>; +} + +/** + * Router bound to the {@link InternalCoreAppsServiceRequestHandlerContext}. + * Used by core's coreApp routes. + * @internal + */ +export type InternalCoreAppsServiceRouter = IRouter; diff --git a/packages/core/apps/core-apps-server-internal/tsconfig.json b/packages/core/apps/core-apps-server-internal/tsconfig.json new file mode 100644 index 0000000000000..ff48529c6f303 --- /dev/null +++ b/packages/core/apps/core-apps-server-internal/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/base/core-base-browser-internal/BUILD.bazel b/packages/core/base/core-base-browser-internal/BUILD.bazel index ed4516e12a0bc..02e0c85678632 100644 --- a/packages/core/base/core-base-browser-internal/BUILD.bazel +++ b/packages/core/base/core-base-browser-internal/BUILD.bazel @@ -76,7 +76,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/base/core-base-browser-internal/package.json b/packages/core/base/core-base-browser-internal/package.json index 9bdf9735ff417..dc3cbe0f4fd5f 100644 --- a/packages/core/base/core-base-browser-internal/package.json +++ b/packages/core/base/core-base-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/base/core-base-browser-internal/src/core_context.ts b/packages/core/base/core-base-browser-internal/src/core_context.ts index cf981dd752453..c5cd4303f5b3d 100644 --- a/packages/core/base/core-base-browser-internal/src/core_context.ts +++ b/packages/core/base/core-base-browser-internal/src/core_context.ts @@ -7,11 +7,13 @@ */ import type { EnvironmentMode, PackageInfo } from '@kbn/config'; +import type { LoggerFactory } from '@kbn/logging'; import type { CoreId } from '@kbn/core-base-common-internal'; /** @internal */ export interface CoreContext { coreId: CoreId; + logger: LoggerFactory; env: { mode: Readonly; packageInfo: Readonly; diff --git a/packages/core/base/core-base-browser-internal/tsconfig.json b/packages/core/base/core-base-browser-internal/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/base/core-base-browser-internal/tsconfig.json +++ b/packages/core/base/core-base-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/base/core-base-browser-mocks/BUILD.bazel b/packages/core/base/core-base-browser-mocks/BUILD.bazel index 498b89a92fca3..4eefc60344077 100644 --- a/packages/core/base/core-base-browser-mocks/BUILD.bazel +++ b/packages/core/base/core-base-browser-mocks/BUILD.bazel @@ -35,12 +35,14 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ + "//packages/kbn-logging-mocks", ] TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", - "//packages/core/base/core-base-browser-internal:npm_module_types", + "//packages/kbn-logging-mocks:npm_module_types", + "//packages/core/base/core-base-browser-internal:npm_module_types", ] jsts_transpiler( @@ -71,7 +73,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -85,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -96,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/base/core-base-browser-mocks/package.json b/packages/core/base/core-base-browser-mocks/package.json index e3b87c084e5dc..b0e8f7612cbc0 100644 --- a/packages/core/base/core-base-browser-mocks/package.json +++ b/packages/core/base/core-base-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/base/core-base-browser-mocks/src/core_context.mock.ts b/packages/core/base/core-base-browser-mocks/src/core_context.mock.ts index e43efe1246ffa..e871621b909ef 100644 --- a/packages/core/base/core-base-browser-mocks/src/core_context.mock.ts +++ b/packages/core/base/core-base-browser-mocks/src/core_context.mock.ts @@ -6,11 +6,13 @@ * Side Public License, v 1. */ +import { loggerMock } from '@kbn/logging-mocks'; import type { CoreContext } from '@kbn/core-base-browser-internal'; function createCoreContext({ production = false }: { production?: boolean } = {}): CoreContext { return { coreId: Symbol('core context mock'), + logger: loggerMock.create(), env: { mode: { dev: !production, diff --git a/packages/core/base/core-base-browser-mocks/tsconfig.json b/packages/core/base/core-base-browser-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/base/core-base-browser-mocks/tsconfig.json +++ b/packages/core/base/core-base-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/base/core-base-common-internal/BUILD.bazel b/packages/core/base/core-base-common-internal/BUILD.bazel index 7b787813b3122..06e7daca4fa3e 100644 --- a/packages/core/base/core-base-common-internal/BUILD.bazel +++ b/packages/core/base/core-base-common-internal/BUILD.bazel @@ -73,7 +73,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -87,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/base/core-base-common-internal/package.json b/packages/core/base/core-base-common-internal/package.json index 2d8f6269c4d90..ea555dbf17a7d 100644 --- a/packages/core/base/core-base-common-internal/package.json +++ b/packages/core/base/core-base-common-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/base/core-base-common-internal/tsconfig.json b/packages/core/base/core-base-common-internal/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/base/core-base-common-internal/tsconfig.json +++ b/packages/core/base/core-base-common-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/base/core-base-common/BUILD.bazel b/packages/core/base/core-base-common/BUILD.bazel index 6015135dd1f4c..4a5b48d3aaeb3 100644 --- a/packages/core/base/core-base-common/BUILD.bazel +++ b/packages/core/base/core-base-common/BUILD.bazel @@ -66,7 +66,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -80,6 +79,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -91,17 +98,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/base/core-base-common/package.json b/packages/core/base/core-base-common/package.json index 13c95c7081a6a..6eb5ea8f82bc7 100644 --- a/packages/core/base/core-base-common/package.json +++ b/packages/core/base/core-base-common/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/base/core-base-common/tsconfig.json b/packages/core/base/core-base-common/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/base/core-base-common/tsconfig.json +++ b/packages/core/base/core-base-common/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/base/core-base-server-internal/BUILD.bazel b/packages/core/base/core-base-server-internal/BUILD.bazel index eef5afa8dd2cf..b30d20874ae1c 100644 --- a/packages/core/base/core-base-server-internal/BUILD.bazel +++ b/packages/core/base/core-base-server-internal/BUILD.bazel @@ -68,7 +68,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -82,6 +81,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -93,17 +100,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/base/core-base-server-internal/package.json b/packages/core/base/core-base-server-internal/package.json index 783acf08a9d47..88348d974ae7a 100644 --- a/packages/core/base/core-base-server-internal/package.json +++ b/packages/core/base/core-base-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/base/core-base-server-internal/tsconfig.json b/packages/core/base/core-base-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/base/core-base-server-internal/tsconfig.json +++ b/packages/core/base/core-base-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/base/core-base-server-mocks/BUILD.bazel b/packages/core/base/core-base-server-mocks/BUILD.bazel index 4c56b292cbb8a..164c71eade849 100644 --- a/packages/core/base/core-base-server-mocks/BUILD.bazel +++ b/packages/core/base/core-base-server-mocks/BUILD.bazel @@ -73,7 +73,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -87,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/base/core-base-server-mocks/package.json b/packages/core/base/core-base-server-mocks/package.json index 688dfb4329d73..99b8d1823c036 100644 --- a/packages/core/base/core-base-server-mocks/package.json +++ b/packages/core/base/core-base-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/base/core-base-server-mocks/tsconfig.json b/packages/core/base/core-base-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/base/core-base-server-mocks/tsconfig.json +++ b/packages/core/base/core-base-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/capabilities/core-capabilities-browser-internal/BUILD.bazel b/packages/core/capabilities/core-capabilities-browser-internal/BUILD.bazel index ca6da26fa9b1e..ae1ae63ce7275 100644 --- a/packages/core/capabilities/core-capabilities-browser-internal/BUILD.bazel +++ b/packages/core/capabilities/core-capabilities-browser-internal/BUILD.bazel @@ -79,7 +79,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -94,6 +93,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -105,17 +112,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/capabilities/core-capabilities-browser-internal/package.json b/packages/core/capabilities/core-capabilities-browser-internal/package.json index b452a083ec728..db46291953708 100644 --- a/packages/core/capabilities/core-capabilities-browser-internal/package.json +++ b/packages/core/capabilities/core-capabilities-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/capabilities/core-capabilities-browser-internal/tsconfig.json b/packages/core/capabilities/core-capabilities-browser-internal/tsconfig.json index d06f069b513d1..48df8f2957246 100644 --- a/packages/core/capabilities/core-capabilities-browser-internal/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-browser-internal/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/capabilities/core-capabilities-browser-mocks/BUILD.bazel b/packages/core/capabilities/core-capabilities-browser-mocks/BUILD.bazel index 8e99e65253b21..bed02693f0b20 100644 --- a/packages/core/capabilities/core-capabilities-browser-mocks/BUILD.bazel +++ b/packages/core/capabilities/core-capabilities-browser-mocks/BUILD.bazel @@ -75,7 +75,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/capabilities/core-capabilities-browser-mocks/package.json b/packages/core/capabilities/core-capabilities-browser-mocks/package.json index 0c13a2a43193e..c278de75213cd 100644 --- a/packages/core/capabilities/core-capabilities-browser-mocks/package.json +++ b/packages/core/capabilities/core-capabilities-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/capabilities/core-capabilities-browser-mocks/tsconfig.json b/packages/core/capabilities/core-capabilities-browser-mocks/tsconfig.json index d06f069b513d1..48df8f2957246 100644 --- a/packages/core/capabilities/core-capabilities-browser-mocks/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-browser-mocks/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/capabilities/core-capabilities-common/BUILD.bazel b/packages/core/capabilities/core-capabilities-common/BUILD.bazel index c77771433993f..1cb1470f2c4e7 100644 --- a/packages/core/capabilities/core-capabilities-common/BUILD.bazel +++ b/packages/core/capabilities/core-capabilities-common/BUILD.bazel @@ -71,7 +71,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -85,6 +84,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -96,17 +103,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/capabilities/core-capabilities-common/package.json b/packages/core/capabilities/core-capabilities-common/package.json index 9a28f18149cd8..c0454d5a5e73e 100644 --- a/packages/core/capabilities/core-capabilities-common/package.json +++ b/packages/core/capabilities/core-capabilities-common/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/capabilities/core-capabilities-common/tsconfig.json b/packages/core/capabilities/core-capabilities-common/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/capabilities/core-capabilities-common/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-common/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/capabilities/core-capabilities-server-internal/BUILD.bazel b/packages/core/capabilities/core-capabilities-server-internal/BUILD.bazel index 17b31dd7d1b33..e4c5b10b28e0f 100644 --- a/packages/core/capabilities/core-capabilities-server-internal/BUILD.bazel +++ b/packages/core/capabilities/core-capabilities-server-internal/BUILD.bazel @@ -79,7 +79,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -93,6 +92,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -104,17 +111,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/capabilities/core-capabilities-server-internal/package.json b/packages/core/capabilities/core-capabilities-server-internal/package.json index 6a51e2dbeb65e..c5d445c4ae520 100644 --- a/packages/core/capabilities/core-capabilities-server-internal/package.json +++ b/packages/core/capabilities/core-capabilities-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/capabilities/core-capabilities-server-internal/tsconfig.json b/packages/core/capabilities/core-capabilities-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/capabilities/core-capabilities-server-internal/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/capabilities/core-capabilities-server-mocks/BUILD.bazel b/packages/core/capabilities/core-capabilities-server-mocks/BUILD.bazel index f98190c9edfa4..1666555ef5f37 100644 --- a/packages/core/capabilities/core-capabilities-server-mocks/BUILD.bazel +++ b/packages/core/capabilities/core-capabilities-server-mocks/BUILD.bazel @@ -66,7 +66,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -80,6 +79,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -91,17 +98,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/capabilities/core-capabilities-server-mocks/package.json b/packages/core/capabilities/core-capabilities-server-mocks/package.json index 77b26c96f6e73..0c82d3de94e53 100644 --- a/packages/core/capabilities/core-capabilities-server-mocks/package.json +++ b/packages/core/capabilities/core-capabilities-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/capabilities/core-capabilities-server-mocks/tsconfig.json b/packages/core/capabilities/core-capabilities-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/capabilities/core-capabilities-server-mocks/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/capabilities/core-capabilities-server/BUILD.bazel b/packages/core/capabilities/core-capabilities-server/BUILD.bazel index 072e0683d329e..f52df2ffaec03 100644 --- a/packages/core/capabilities/core-capabilities-server/BUILD.bazel +++ b/packages/core/capabilities/core-capabilities-server/BUILD.bazel @@ -66,7 +66,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -80,6 +79,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -91,17 +98,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/capabilities/core-capabilities-server/package.json b/packages/core/capabilities/core-capabilities-server/package.json index 74a347c2077ba..013a8a5e8fa38 100644 --- a/packages/core/capabilities/core-capabilities-server/package.json +++ b/packages/core/capabilities/core-capabilities-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/capabilities/core-capabilities-server/tsconfig.json b/packages/core/capabilities/core-capabilities-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/capabilities/core-capabilities-server/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/chrome/core-chrome-browser-internal/BUILD.bazel b/packages/core/chrome/core-chrome-browser-internal/BUILD.bazel index 9bedba788e958..7399951064bff 100644 --- a/packages/core/chrome/core-chrome-browser-internal/BUILD.bazel +++ b/packages/core/chrome/core-chrome-browser-internal/BUILD.bazel @@ -44,7 +44,7 @@ RUNTIME_DEPS = [ "@npm//classnames", "@npm//react-use", "@npm//@elastic/eui", - "//packages/kbn-i18n:npm_module_types", + "//packages/kbn-i18n", "//packages/kbn-i18n-react", "//packages/core/mount-utils/core-mount-utils-browser-internal", ] @@ -103,7 +103,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -117,6 +116,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -128,17 +135,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/chrome/core-chrome-browser-internal/package.json b/packages/core/chrome/core-chrome-browser-internal/package.json index b5005295ddbaa..121dce5d9fe60 100644 --- a/packages/core/chrome/core-chrome-browser-internal/package.json +++ b/packages/core/chrome/core-chrome-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx b/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx index 3c4b42cddfae7..f039fb7c24740 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx @@ -23,6 +23,7 @@ import type { ChromeBadge, ChromeBreadcrumb, ChromeBreadcrumbsAppendExtension, + ChromeGlobalHelpExtensionMenuLink, ChromeHelpExtension, ChromeUserBanner, } from '@kbn/core-chrome-browser'; @@ -103,6 +104,9 @@ export class ChromeService { }: StartDeps): Promise { this.initVisibility(application); + const globalHelpExtensionMenuLinks$ = new BehaviorSubject( + [] + ); const helpExtension$ = new BehaviorSubject(undefined); const breadcrumbs$ = new BehaviorSubject([]); const breadcrumbsAppendExtension$ = new BehaviorSubject< @@ -213,6 +217,7 @@ export class ChromeService { customNavLink$={customNavLink$.pipe(takeUntil(this.stop$))} kibanaDocLink={docLinks.links.kibana.guide} forceAppSwitcherNavigation$={navLinks.getForceAppSwitcherNavigation$()} + globalHelpExtensionMenuLinks$={globalHelpExtensionMenuLinks$} helpExtension$={helpExtension$.pipe(takeUntil(this.stop$))} helpSupportUrl$={helpSupportUrl$.pipe(takeUntil(this.stop$))} homeHref={http.basePath.prepend('/app/home')} @@ -253,6 +258,17 @@ export class ChromeService { breadcrumbsAppendExtension$.next(breadcrumbsAppendExtension); }, + getGlobalHelpExtensionMenuLinks$: () => globalHelpExtensionMenuLinks$.asObservable(), + + registerGlobalHelpExtensionMenuLink: ( + globalHelpExtensionMenuLink: ChromeGlobalHelpExtensionMenuLink + ) => { + globalHelpExtensionMenuLinks$.next([ + ...globalHelpExtensionMenuLinks$.value, + globalHelpExtensionMenuLink, + ]); + }, + getHelpExtension$: () => helpExtension$.pipe(takeUntil(this.stop$)), setHelpExtension: (helpExtension?: ChromeHelpExtension) => { diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header.test.tsx b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header.test.tsx index 58ac26174f205..02fcce82d2c80 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header.test.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header.test.tsx @@ -33,6 +33,7 @@ function mockProps() { customNavLink$: new BehaviorSubject(undefined), recentlyAccessed$: new BehaviorSubject([]), forceAppSwitcherNavigation$: new BehaviorSubject(false), + globalHelpExtensionMenuLinks$: new BehaviorSubject([]), helpExtension$: new BehaviorSubject(undefined), helpSupportUrl$: new BehaviorSubject(''), navControlsLeft$: new BehaviorSubject([]), diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header.tsx b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header.tsx index 5ff0989f16485..cfc79f2779a24 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header.tsx @@ -32,6 +32,7 @@ import type { ChromeRecentlyAccessedHistoryItem, ChromeBreadcrumbsAppendExtension, ChromeHelpExtension, + ChromeGlobalHelpExtensionMenuLink, ChromeUserBanner, } from '@kbn/core-chrome-browser'; import { LoadingIndicator } from '../loading_indicator'; @@ -60,6 +61,7 @@ export interface HeaderProps { navLinks$: Observable; recentlyAccessed$: Observable; forceAppSwitcherNavigation$: Observable; + globalHelpExtensionMenuLinks$: Observable; helpExtension$: Observable; helpSupportUrl$: Observable; navControlsLeft$: Observable; @@ -80,6 +82,7 @@ export function Header({ onIsLockedUpdate, homeHref, breadcrumbsAppendExtension$, + globalHelpExtensionMenuLinks$, ...observables }: HeaderProps) { const isVisible = useObservable(observables.isVisible$, false); @@ -145,6 +148,7 @@ export function Header({ , { + test('it only renders the default content', () => { + const application = applicationServiceMock.createInternalStartContract(); + const helpExtension$ = new BehaviorSubject(undefined); + const helpSupportUrl$ = new BehaviorSubject(''); + + const component = mountWithIntl( + + ); + + expect(component.find('EuiButtonEmpty').length).toBe(1); // only the toggle view on/off button + component.find('EuiButtonEmpty').simulate('click'); + + // 4 default links + the toggle button + expect(component.find('EuiButtonEmpty').length).toBe(5); + }); + + test('it renders the global custom content + the default content', () => { + const application = applicationServiceMock.createInternalStartContract(); + const helpExtension$ = new BehaviorSubject(undefined); + const helpSupportUrl$ = new BehaviorSubject(''); + + const component = mountWithIntl( + + ); + + expect(component.find('EuiButtonEmpty').length).toBe(1); // only the toggle view on/off button + component.find('EuiButtonEmpty').simulate('click'); + + // 2 custom global link + 4 default links + the toggle button + expect(component.find('EuiButtonEmpty').length).toBe(7); + + expect(component.find('[data-test-subj="my-test-custom-link"]').exists()).toBeTruthy(); + + // The first global component is the second button (first is the toggle button) + expect(component.find('EuiButtonEmpty').at(1).prop('data-test-subj')).toBe( + 'my-test-custom-link' + ); + }); +}); diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header_help_menu.tsx b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header_help_menu.tsx index 4e797df335543..f938608091ba6 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header_help_menu.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header_help_menu.tsx @@ -25,13 +25,17 @@ import { } from '@elastic/eui'; import type { InternalApplicationStart } from '@kbn/core-application-browser-internal'; -import type { ChromeHelpExtension } from '@kbn/core-chrome-browser'; +import type { + ChromeHelpExtension, + ChromeGlobalHelpExtensionMenuLink, +} from '@kbn/core-chrome-browser'; import { GITHUB_CREATE_ISSUE_LINK, KIBANA_FEEDBACK_LINK } from '../../constants'; import { HeaderExtension } from './header_extension'; import { isModifiedOrPrevented } from './nav_link'; interface Props { navigateToUrl: InternalApplicationStart['navigateToUrl']; + globalHelpExtensionMenuLinks$: Observable; helpExtension$: Observable; helpSupportUrl$: Observable; kibanaVersion: string; @@ -42,6 +46,7 @@ interface State { isOpen: boolean; helpExtension?: ChromeHelpExtension; helpSupportUrl: string; + globalHelpExtensionMenuLinks: ChromeGlobalHelpExtensionMenuLink[]; } export class HeaderHelpMenu extends Component { @@ -54,17 +59,20 @@ export class HeaderHelpMenu extends Component { isOpen: false, helpExtension: undefined, helpSupportUrl: '', + globalHelpExtensionMenuLinks: [], }; } public componentDidMount() { this.subscription = combineLatest( this.props.helpExtension$, - this.props.helpSupportUrl$ - ).subscribe(([helpExtension, helpSupportUrl]) => { + this.props.helpSupportUrl$, + this.props.globalHelpExtensionMenuLinks$ + ).subscribe(([helpExtension, helpSupportUrl, globalHelpExtensionMenuLinks]) => { this.setState({ helpExtension, helpSupportUrl, + globalHelpExtensionMenuLinks, }); }); } @@ -80,6 +88,7 @@ export class HeaderHelpMenu extends Component { const { kibanaVersion } = this.props; const defaultContent = this.renderDefaultContent(); + const globalCustomContent = this.renderGlobalCustomContent(); const customContent = this.renderCustomContent(); const button = ( @@ -126,8 +135,9 @@ export class HeaderHelpMenu extends Component {
+ {globalCustomContent} {defaultContent} - {defaultContent && customContent && } + {(defaultContent || customContent) && } {customContent}
@@ -183,6 +193,22 @@ export class HeaderHelpMenu extends Component { ); } + private renderGlobalCustomContent() { + const { navigateToUrl } = this.props; + const { globalHelpExtensionMenuLinks } = this.state; + + return globalHelpExtensionMenuLinks + .sort((a, b) => b.priority - a.priority) + .map((link, index) => { + const { linkType, content: text, href, ...rest } = link; + return createCustomLink(index, text, true, { + href, + onClick: this.createOnClickHandler(href, navigateToUrl), + ...rest, + }); + }); + } + private renderCustomContent() { const { helpExtension } = this.state; if (!helpExtension) { diff --git a/packages/core/chrome/core-chrome-browser-internal/tsconfig.json b/packages/core/chrome/core-chrome-browser-internal/tsconfig.json index 9f2708fb14528..c561d9f220124 100644 --- a/packages/core/chrome/core-chrome-browser-internal/tsconfig.json +++ b/packages/core/chrome/core-chrome-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/chrome/core-chrome-browser-mocks/BUILD.bazel b/packages/core/chrome/core-chrome-browser-mocks/BUILD.bazel index fc64579bbe4fd..4a45606503f67 100644 --- a/packages/core/chrome/core-chrome-browser-mocks/BUILD.bazel +++ b/packages/core/chrome/core-chrome-browser-mocks/BUILD.bazel @@ -78,7 +78,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -92,6 +91,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -103,17 +110,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/chrome/core-chrome-browser-mocks/package.json b/packages/core/chrome/core-chrome-browser-mocks/package.json index 30dff70a53dfe..bd5b73194a52f 100644 --- a/packages/core/chrome/core-chrome-browser-mocks/package.json +++ b/packages/core/chrome/core-chrome-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/chrome/core-chrome-browser-mocks/src/chrome_service.mock.ts b/packages/core/chrome/core-chrome-browser-mocks/src/chrome_service.mock.ts index fc2a48f1329d4..2f5c4deb1f38d 100644 --- a/packages/core/chrome/core-chrome-browser-mocks/src/chrome_service.mock.ts +++ b/packages/core/chrome/core-chrome-browser-mocks/src/chrome_service.mock.ts @@ -50,6 +50,8 @@ const createStartContractMock = () => { setBreadcrumbs: jest.fn(), getBreadcrumbsAppendExtension$: jest.fn(), setBreadcrumbsAppendExtension: jest.fn(), + getGlobalHelpExtensionMenuLinks$: jest.fn(), + registerGlobalHelpExtensionMenuLink: jest.fn(), getHelpExtension$: jest.fn(), setHelpExtension: jest.fn(), setHelpSupportUrl: jest.fn(), @@ -66,6 +68,7 @@ const createStartContractMock = () => { startContract.getBreadcrumbs$.mockReturnValue(new BehaviorSubject([{} as ChromeBreadcrumb])); startContract.getBreadcrumbsAppendExtension$.mockReturnValue(new BehaviorSubject(undefined)); startContract.getCustomNavLink$.mockReturnValue(new BehaviorSubject(undefined)); + startContract.getGlobalHelpExtensionMenuLinks$.mockReturnValue(new BehaviorSubject([])); startContract.getHelpExtension$.mockReturnValue(new BehaviorSubject(undefined)); startContract.getIsNavDrawerLocked$.mockReturnValue(new BehaviorSubject(false)); startContract.getBodyClasses$.mockReturnValue(new BehaviorSubject([])); diff --git a/packages/core/chrome/core-chrome-browser-mocks/tsconfig.json b/packages/core/chrome/core-chrome-browser-mocks/tsconfig.json index 26b4c7aca3a67..741519055e986 100644 --- a/packages/core/chrome/core-chrome-browser-mocks/tsconfig.json +++ b/packages/core/chrome/core-chrome-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/chrome/core-chrome-browser/BUILD.bazel b/packages/core/chrome/core-chrome-browser/BUILD.bazel index f3cede656b502..00e46c7614988 100644 --- a/packages/core/chrome/core-chrome-browser/BUILD.bazel +++ b/packages/core/chrome/core-chrome-browser/BUILD.bazel @@ -77,7 +77,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -91,6 +90,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -102,17 +109,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/chrome/core-chrome-browser/index.ts b/packages/core/chrome/core-chrome-browser/index.ts index 16f0134afb7bb..3fbef34126a4a 100644 --- a/packages/core/chrome/core-chrome-browser/index.ts +++ b/packages/core/chrome/core-chrome-browser/index.ts @@ -23,6 +23,7 @@ export type { ChromeHelpExtensionMenuDocumentationLink, ChromeHelpExtensionMenuDiscussLink, ChromeHelpExtensionMenuCustomLink, + ChromeGlobalHelpExtensionMenuLink, ChromeDocTitle, ChromeStart, ChromeRecentlyAccessed, diff --git a/packages/core/chrome/core-chrome-browser/package.json b/packages/core/chrome/core-chrome-browser/package.json index d17be5c1a6710..42854ddcca13c 100644 --- a/packages/core/chrome/core-chrome-browser/package.json +++ b/packages/core/chrome/core-chrome-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/chrome/core-chrome-browser/src/contracts.ts b/packages/core/chrome/core-chrome-browser/src/contracts.ts index e3a4f09c2cbb7..a81d9c3c6338f 100644 --- a/packages/core/chrome/core-chrome-browser/src/contracts.ts +++ b/packages/core/chrome/core-chrome-browser/src/contracts.ts @@ -14,6 +14,7 @@ import type { ChromeNavControls } from './nav_controls'; import type { ChromeHelpExtension } from './help_extension'; import type { ChromeBreadcrumb, ChromeBreadcrumbsAppendExtension } from './breadcrumb'; import type { ChromeBadge, ChromeUserBanner } from './types'; +import { ChromeGlobalHelpExtensionMenuLink } from './help_extension'; /** * ChromeStart allows plugins to customize the global chrome header UI and @@ -106,7 +107,19 @@ export interface ChromeStart { setCustomNavLink(newCustomNavLink?: Partial): void; /** - * Get an observable of the current custom help conttent + * Get the list of the registered global help extension menu links + */ + getGlobalHelpExtensionMenuLinks$(): Observable; + + /** + * Append a global help extension menu link + */ + registerGlobalHelpExtensionMenuLink( + globalHelpExtensionMenuLink: ChromeGlobalHelpExtensionMenuLink + ): void; + + /** + * Get an observable of the current custom help content */ getHelpExtension$(): Observable; diff --git a/packages/core/chrome/core-chrome-browser/src/help_extension.ts b/packages/core/chrome/core-chrome-browser/src/help_extension.ts index 3acebd168f49a..f682a166ca29c 100644 --- a/packages/core/chrome/core-chrome-browser/src/help_extension.ts +++ b/packages/core/chrome/core-chrome-browser/src/help_extension.ts @@ -94,6 +94,14 @@ export interface ChromeHelpExtensionMenuCustomLink extends ChromeHelpExtensionLi content: React.ReactNode; } +/** @public */ +export interface ChromeGlobalHelpExtensionMenuLink extends ChromeHelpExtensionMenuCustomLink { + /** + * Highest priority items are listed at the top of the list of links. + */ + priority: number; +} + /** @public */ export type ChromeHelpExtensionMenuLink = | ChromeHelpExtensionMenuGitHubLink diff --git a/packages/core/chrome/core-chrome-browser/src/index.ts b/packages/core/chrome/core-chrome-browser/src/index.ts index 8414de3193c41..716af097fded7 100644 --- a/packages/core/chrome/core-chrome-browser/src/index.ts +++ b/packages/core/chrome/core-chrome-browser/src/index.ts @@ -18,6 +18,7 @@ export type { ChromeHelpExtensionMenuDiscussLink, ChromeHelpExtensionMenuDocumentationLink, ChromeHelpExtensionMenuGitHubLink, + ChromeGlobalHelpExtensionMenuLink, } from './help_extension'; export type { ChromeNavControls, ChromeNavControl } from './nav_controls'; export type { ChromeNavLinks, ChromeNavLink } from './nav_links'; diff --git a/packages/core/chrome/core-chrome-browser/tsconfig.json b/packages/core/chrome/core-chrome-browser/tsconfig.json index 26b4c7aca3a67..741519055e986 100644 --- a/packages/core/chrome/core-chrome-browser/tsconfig.json +++ b/packages/core/chrome/core-chrome-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/config/core-config-server-internal/BUILD.bazel b/packages/core/config/core-config-server-internal/BUILD.bazel index 058a195cf3809..2b4ef85f0484c 100644 --- a/packages/core/config/core-config-server-internal/BUILD.bazel +++ b/packages/core/config/core-config-server-internal/BUILD.bazel @@ -73,7 +73,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -87,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/config/core-config-server-internal/package.json b/packages/core/config/core-config-server-internal/package.json index 51cf128309957..504824cb9613f 100644 --- a/packages/core/config/core-config-server-internal/package.json +++ b/packages/core/config/core-config-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/config/core-config-server-internal/tsconfig.json b/packages/core/config/core-config-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/config/core-config-server-internal/tsconfig.json +++ b/packages/core/config/core-config-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/deprecations/core-deprecations-browser-internal/BUILD.bazel b/packages/core/deprecations/core-deprecations-browser-internal/BUILD.bazel index 7b93e6218ab14..799d368a5a66b 100644 --- a/packages/core/deprecations/core-deprecations-browser-internal/BUILD.bazel +++ b/packages/core/deprecations/core-deprecations-browser-internal/BUILD.bazel @@ -80,7 +80,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -94,6 +93,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -105,17 +112,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/deprecations/core-deprecations-browser-internal/package.json b/packages/core/deprecations/core-deprecations-browser-internal/package.json index 3c84e32ba713d..5778e7fa149a5 100644 --- a/packages/core/deprecations/core-deprecations-browser-internal/package.json +++ b/packages/core/deprecations/core-deprecations-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/deprecations/core-deprecations-browser-internal/tsconfig.json b/packages/core/deprecations/core-deprecations-browser-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/deprecations/core-deprecations-browser-internal/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/deprecations/core-deprecations-browser-mocks/BUILD.bazel b/packages/core/deprecations/core-deprecations-browser-mocks/BUILD.bazel index e94e6997e6693..bea9231acf84e 100644 --- a/packages/core/deprecations/core-deprecations-browser-mocks/BUILD.bazel +++ b/packages/core/deprecations/core-deprecations-browser-mocks/BUILD.bazel @@ -75,7 +75,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -89,6 +88,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -100,17 +107,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/deprecations/core-deprecations-browser-mocks/package.json b/packages/core/deprecations/core-deprecations-browser-mocks/package.json index c079cca114440..cd9f1986ad146 100644 --- a/packages/core/deprecations/core-deprecations-browser-mocks/package.json +++ b/packages/core/deprecations/core-deprecations-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/deprecations/core-deprecations-browser-mocks/tsconfig.json b/packages/core/deprecations/core-deprecations-browser-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/deprecations/core-deprecations-browser-mocks/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/deprecations/core-deprecations-browser/BUILD.bazel b/packages/core/deprecations/core-deprecations-browser/BUILD.bazel index 2e6c813bf7841..98367818f6162 100644 --- a/packages/core/deprecations/core-deprecations-browser/BUILD.bazel +++ b/packages/core/deprecations/core-deprecations-browser/BUILD.bazel @@ -73,7 +73,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -87,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/deprecations/core-deprecations-browser/package.json b/packages/core/deprecations/core-deprecations-browser/package.json index 451ebf492334b..410b55d4d1751 100644 --- a/packages/core/deprecations/core-deprecations-browser/package.json +++ b/packages/core/deprecations/core-deprecations-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/deprecations/core-deprecations-browser/tsconfig.json b/packages/core/deprecations/core-deprecations-browser/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/deprecations/core-deprecations-browser/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/deprecations/core-deprecations-common/BUILD.bazel b/packages/core/deprecations/core-deprecations-common/BUILD.bazel index 9ba96b5eb6e3f..0a21fa19ef491 100644 --- a/packages/core/deprecations/core-deprecations-common/BUILD.bazel +++ b/packages/core/deprecations/core-deprecations-common/BUILD.bazel @@ -72,7 +72,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -86,6 +85,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +104,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/deprecations/core-deprecations-common/package.json b/packages/core/deprecations/core-deprecations-common/package.json index 377b27999d62f..511e4a942f32e 100644 --- a/packages/core/deprecations/core-deprecations-common/package.json +++ b/packages/core/deprecations/core-deprecations-common/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/deprecations/core-deprecations-common/tsconfig.json b/packages/core/deprecations/core-deprecations-common/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/deprecations/core-deprecations-common/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-common/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/deprecations/core-deprecations-server-internal/BUILD.bazel b/packages/core/deprecations/core-deprecations-server-internal/BUILD.bazel index fc13f6b731d67..336bda22def79 100644 --- a/packages/core/deprecations/core-deprecations-server-internal/BUILD.bazel +++ b/packages/core/deprecations/core-deprecations-server-internal/BUILD.bazel @@ -84,7 +84,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -98,6 +97,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -109,17 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/deprecations/core-deprecations-server-internal/package.json b/packages/core/deprecations/core-deprecations-server-internal/package.json index f8ace4c54ccdb..4dca63aa16619 100644 --- a/packages/core/deprecations/core-deprecations-server-internal/package.json +++ b/packages/core/deprecations/core-deprecations-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/deprecations/core-deprecations-server-internal/tsconfig.json b/packages/core/deprecations/core-deprecations-server-internal/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/deprecations/core-deprecations-server-internal/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/deprecations/core-deprecations-server-mocks/BUILD.bazel b/packages/core/deprecations/core-deprecations-server-mocks/BUILD.bazel index ba5e204595d9d..ab178fad79f1f 100644 --- a/packages/core/deprecations/core-deprecations-server-mocks/BUILD.bazel +++ b/packages/core/deprecations/core-deprecations-server-mocks/BUILD.bazel @@ -65,7 +65,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -79,6 +78,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -90,17 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/deprecations/core-deprecations-server-mocks/package.json b/packages/core/deprecations/core-deprecations-server-mocks/package.json index f1cc7299b3a2f..15318700c494f 100644 --- a/packages/core/deprecations/core-deprecations-server-mocks/package.json +++ b/packages/core/deprecations/core-deprecations-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/deprecations/core-deprecations-server-mocks/tsconfig.json b/packages/core/deprecations/core-deprecations-server-mocks/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/deprecations/core-deprecations-server-mocks/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/deprecations/core-deprecations-server/BUILD.bazel b/packages/core/deprecations/core-deprecations-server/BUILD.bazel index 4038dda7b56ad..27f711ff83b43 100644 --- a/packages/core/deprecations/core-deprecations-server/BUILD.bazel +++ b/packages/core/deprecations/core-deprecations-server/BUILD.bazel @@ -68,7 +68,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -83,6 +82,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -94,17 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/deprecations/core-deprecations-server/package.json b/packages/core/deprecations/core-deprecations-server/package.json index ebd6fb9aeeef9..68882ca7ba6dd 100644 --- a/packages/core/deprecations/core-deprecations-server/package.json +++ b/packages/core/deprecations/core-deprecations-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/deprecations/core-deprecations-server/tsconfig.json b/packages/core/deprecations/core-deprecations-server/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/deprecations/core-deprecations-server/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-server/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/doc-links/core-doc-links-browser-internal/BUILD.bazel b/packages/core/doc-links/core-doc-links-browser-internal/BUILD.bazel index db16ffd0f13e5..b0a8cea7da17d 100644 --- a/packages/core/doc-links/core-doc-links-browser-internal/BUILD.bazel +++ b/packages/core/doc-links/core-doc-links-browser-internal/BUILD.bazel @@ -75,7 +75,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -89,6 +88,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -100,17 +107,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/doc-links/core-doc-links-browser-internal/package.json b/packages/core/doc-links/core-doc-links-browser-internal/package.json index 3c8b135788782..00bfad1514cc1 100644 --- a/packages/core/doc-links/core-doc-links-browser-internal/package.json +++ b/packages/core/doc-links/core-doc-links-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/doc-links/core-doc-links-browser-internal/tsconfig.json b/packages/core/doc-links/core-doc-links-browser-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/doc-links/core-doc-links-browser-internal/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/doc-links/core-doc-links-browser-mocks/BUILD.bazel b/packages/core/doc-links/core-doc-links-browser-mocks/BUILD.bazel index 337b138428c3b..67d4cf29a1e48 100644 --- a/packages/core/doc-links/core-doc-links-browser-mocks/BUILD.bazel +++ b/packages/core/doc-links/core-doc-links-browser-mocks/BUILD.bazel @@ -76,7 +76,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/doc-links/core-doc-links-browser-mocks/package.json b/packages/core/doc-links/core-doc-links-browser-mocks/package.json index 52a9c13781c46..d2085b6c99089 100644 --- a/packages/core/doc-links/core-doc-links-browser-mocks/package.json +++ b/packages/core/doc-links/core-doc-links-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/doc-links/core-doc-links-browser-mocks/tsconfig.json b/packages/core/doc-links/core-doc-links-browser-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/doc-links/core-doc-links-browser-mocks/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/doc-links/core-doc-links-browser/BUILD.bazel b/packages/core/doc-links/core-doc-links-browser/BUILD.bazel index e44b71fef345d..564858b40c5a7 100644 --- a/packages/core/doc-links/core-doc-links-browser/BUILD.bazel +++ b/packages/core/doc-links/core-doc-links-browser/BUILD.bazel @@ -72,7 +72,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -86,6 +85,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +104,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/doc-links/core-doc-links-browser/package.json b/packages/core/doc-links/core-doc-links-browser/package.json index 253f8a00b8fd9..91d8b643949d2 100644 --- a/packages/core/doc-links/core-doc-links-browser/package.json +++ b/packages/core/doc-links/core-doc-links-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/doc-links/core-doc-links-browser/tsconfig.json b/packages/core/doc-links/core-doc-links-browser/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/doc-links/core-doc-links-browser/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/doc-links/core-doc-links-server-internal/BUILD.bazel b/packages/core/doc-links/core-doc-links-server-internal/BUILD.bazel index d30ea5cdb8f59..911d177dd40ba 100644 --- a/packages/core/doc-links/core-doc-links-server-internal/BUILD.bazel +++ b/packages/core/doc-links/core-doc-links-server-internal/BUILD.bazel @@ -68,7 +68,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -82,6 +81,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -93,17 +100,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/doc-links/core-doc-links-server-internal/package.json b/packages/core/doc-links/core-doc-links-server-internal/package.json index 79ac0d187e905..1c5ee24849e21 100644 --- a/packages/core/doc-links/core-doc-links-server-internal/package.json +++ b/packages/core/doc-links/core-doc-links-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/doc-links/core-doc-links-server-internal/tsconfig.json b/packages/core/doc-links/core-doc-links-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/doc-links/core-doc-links-server-internal/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/doc-links/core-doc-links-server-mocks/BUILD.bazel b/packages/core/doc-links/core-doc-links-server-mocks/BUILD.bazel index f4db53e9cfea1..546564f9f581b 100644 --- a/packages/core/doc-links/core-doc-links-server-mocks/BUILD.bazel +++ b/packages/core/doc-links/core-doc-links-server-mocks/BUILD.bazel @@ -68,7 +68,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -82,6 +81,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -93,17 +100,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/doc-links/core-doc-links-server-mocks/package.json b/packages/core/doc-links/core-doc-links-server-mocks/package.json index 59078c9ab887c..7d15b2ecb0a7d 100644 --- a/packages/core/doc-links/core-doc-links-server-mocks/package.json +++ b/packages/core/doc-links/core-doc-links-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/doc-links/core-doc-links-server-mocks/tsconfig.json b/packages/core/doc-links/core-doc-links-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/doc-links/core-doc-links-server-mocks/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/doc-links/core-doc-links-server/BUILD.bazel b/packages/core/doc-links/core-doc-links-server/BUILD.bazel index 34f62b3377ee5..b670b86f3b41f 100644 --- a/packages/core/doc-links/core-doc-links-server/BUILD.bazel +++ b/packages/core/doc-links/core-doc-links-server/BUILD.bazel @@ -64,7 +64,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -78,6 +77,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -89,17 +96,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/doc-links/core-doc-links-server/package.json b/packages/core/doc-links/core-doc-links-server/package.json index 7b6f3c6e77e6c..98e82071c1afb 100644 --- a/packages/core/doc-links/core-doc-links-server/package.json +++ b/packages/core/doc-links/core-doc-links-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/doc-links/core-doc-links-server/tsconfig.json b/packages/core/doc-links/core-doc-links-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/doc-links/core-doc-links-server/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel index 8c8c4d4a5a482..af435dff173a7 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel @@ -82,7 +82,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -96,6 +95,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -107,17 +114,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/index.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/index.ts index 6f1f276c7d089..84ae0392ce1d6 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/index.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/index.ts @@ -9,7 +9,7 @@ export { ScopedClusterClient } from './src/scoped_cluster_client'; export { ClusterClient } from './src/cluster_client'; export { configureClient } from './src/configure_client'; -export { type AgentStore, AgentManager } from './src/agent_manager'; +export { type AgentStore, AgentManager, type NetworkAgent } from './src/agent_manager'; export { getRequestDebugMeta, getErrorMessage } from './src/log_query_and_deprecation'; export { PRODUCT_RESPONSE_HEADER, diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json index 230b7c0645780..26a5453f7deb8 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel index 24e35e71cc654..903df3a4bf668 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel @@ -67,7 +67,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -81,6 +80,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -92,17 +99,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json index 97675bc749230..2e40a2411c6f5 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel index 0609c66baced3..a609d040b08f3 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel @@ -101,7 +101,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -115,6 +114,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -126,17 +133,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/index.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/index.ts index 7538a0804768e..48b54addb7d95 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-internal/index.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/index.ts @@ -29,3 +29,4 @@ export { export { CoreElasticsearchRouteHandlerContext } from './src/elasticsearch_route_handler_context'; export { retryCallCluster, migrationRetryCallCluster } from './src/retry_call_cluster'; export { isInlineScriptingEnabled } from './src/is_scripting_enabled'; +export type { ClusterInfo } from './src/get_cluster_info'; diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json b/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json index f1c98d0af1bf4..7da243a2ddd91 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel index 41de319850636..bfc62c14edd0b 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel @@ -70,7 +70,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -84,6 +83,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -95,17 +102,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json b/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json index dcf8a6db03748..4bfdb9ae43502 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel index 5797b6cf23bf9..b21a8c7febbb4 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel +++ b/packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel @@ -68,7 +68,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -82,6 +81,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -93,17 +100,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/elasticsearch/core-elasticsearch-server/package.json b/packages/core/elasticsearch/core-elasticsearch-server/package.json index 08ab13b7c7dda..3c922fc3fff6d 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server/package.json +++ b/packages/core/elasticsearch/core-elasticsearch-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json +++ b/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/environment/core-environment-server-internal/BUILD.bazel b/packages/core/environment/core-environment-server-internal/BUILD.bazel index ce2fe36681310..02787bec3ad60 100644 --- a/packages/core/environment/core-environment-server-internal/BUILD.bazel +++ b/packages/core/environment/core-environment-server-internal/BUILD.bazel @@ -90,6 +90,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +109,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/environment/core-environment-server-internal/package.json b/packages/core/environment/core-environment-server-internal/package.json index e66035563796f..4be8f11e12fc6 100644 --- a/packages/core/environment/core-environment-server-internal/package.json +++ b/packages/core/environment/core-environment-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/environment/core-environment-server-internal/tsconfig.json b/packages/core/environment/core-environment-server-internal/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/environment/core-environment-server-internal/tsconfig.json +++ b/packages/core/environment/core-environment-server-internal/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/environment/core-environment-server-mocks/BUILD.bazel b/packages/core/environment/core-environment-server-mocks/BUILD.bazel index 89cfa56844a40..99bb5420b5685 100644 --- a/packages/core/environment/core-environment-server-mocks/BUILD.bazel +++ b/packages/core/environment/core-environment-server-mocks/BUILD.bazel @@ -77,6 +77,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -88,17 +96,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/environment/core-environment-server-mocks/package.json b/packages/core/environment/core-environment-server-mocks/package.json index ea167991009e8..c8de3e7c69acf 100644 --- a/packages/core/environment/core-environment-server-mocks/package.json +++ b/packages/core/environment/core-environment-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/environment/core-environment-server-mocks/tsconfig.json b/packages/core/environment/core-environment-server-mocks/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/environment/core-environment-server-mocks/tsconfig.json +++ b/packages/core/environment/core-environment-server-mocks/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/execution-context/core-execution-context-browser-internal/BUILD.bazel b/packages/core/execution-context/core-execution-context-browser-internal/BUILD.bazel index 6a4a658fd4333..5dafaa8a707cf 100644 --- a/packages/core/execution-context/core-execution-context-browser-internal/BUILD.bazel +++ b/packages/core/execution-context/core-execution-context-browser-internal/BUILD.bazel @@ -91,6 +91,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -102,17 +110,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/execution-context/core-execution-context-browser-internal/package.json b/packages/core/execution-context/core-execution-context-browser-internal/package.json index 75caa4626bafb..448610f80f573 100644 --- a/packages/core/execution-context/core-execution-context-browser-internal/package.json +++ b/packages/core/execution-context/core-execution-context-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/execution-context/core-execution-context-browser-internal/tsconfig.json b/packages/core/execution-context/core-execution-context-browser-internal/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/execution-context/core-execution-context-browser-internal/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-browser-internal/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/execution-context/core-execution-context-browser-mocks/BUILD.bazel b/packages/core/execution-context/core-execution-context-browser-mocks/BUILD.bazel index fdc055a9e9593..f47b874438a3a 100644 --- a/packages/core/execution-context/core-execution-context-browser-mocks/BUILD.bazel +++ b/packages/core/execution-context/core-execution-context-browser-mocks/BUILD.bazel @@ -87,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/execution-context/core-execution-context-browser-mocks/package.json b/packages/core/execution-context/core-execution-context-browser-mocks/package.json index 7551413f36cd8..e6e278b62aec6 100644 --- a/packages/core/execution-context/core-execution-context-browser-mocks/package.json +++ b/packages/core/execution-context/core-execution-context-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/execution-context/core-execution-context-browser-mocks/tsconfig.json b/packages/core/execution-context/core-execution-context-browser-mocks/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/execution-context/core-execution-context-browser-mocks/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-browser-mocks/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/execution-context/core-execution-context-browser/BUILD.bazel b/packages/core/execution-context/core-execution-context-browser/BUILD.bazel index 9f029affa559a..bd66cba6f7716 100644 --- a/packages/core/execution-context/core-execution-context-browser/BUILD.bazel +++ b/packages/core/execution-context/core-execution-context-browser/BUILD.bazel @@ -86,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/execution-context/core-execution-context-browser/package.json b/packages/core/execution-context/core-execution-context-browser/package.json index 03061d5e07777..fe065da833ba4 100644 --- a/packages/core/execution-context/core-execution-context-browser/package.json +++ b/packages/core/execution-context/core-execution-context-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/execution-context/core-execution-context-browser/tsconfig.json b/packages/core/execution-context/core-execution-context-browser/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/execution-context/core-execution-context-browser/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-browser/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/execution-context/core-execution-context-common/BUILD.bazel b/packages/core/execution-context/core-execution-context-common/BUILD.bazel index fc9e586791b13..2346a268246e5 100644 --- a/packages/core/execution-context/core-execution-context-common/BUILD.bazel +++ b/packages/core/execution-context/core-execution-context-common/BUILD.bazel @@ -84,6 +84,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -95,17 +103,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/execution-context/core-execution-context-common/package.json b/packages/core/execution-context/core-execution-context-common/package.json index 21667c5d6240a..8811373e38431 100644 --- a/packages/core/execution-context/core-execution-context-common/package.json +++ b/packages/core/execution-context/core-execution-context-common/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/execution-context/core-execution-context-common/tsconfig.json b/packages/core/execution-context/core-execution-context-common/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/execution-context/core-execution-context-common/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-common/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/execution-context/core-execution-context-server-internal/BUILD.bazel b/packages/core/execution-context/core-execution-context-server-internal/BUILD.bazel index 8a3f5dec58259..bc44df8b75205 100644 --- a/packages/core/execution-context/core-execution-context-server-internal/BUILD.bazel +++ b/packages/core/execution-context/core-execution-context-server-internal/BUILD.bazel @@ -87,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/execution-context/core-execution-context-server-internal/package.json b/packages/core/execution-context/core-execution-context-server-internal/package.json index 4620f30b6f1f8..40e2e6b7d1a2d 100644 --- a/packages/core/execution-context/core-execution-context-server-internal/package.json +++ b/packages/core/execution-context/core-execution-context-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/execution-context/core-execution-context-server-internal/tsconfig.json b/packages/core/execution-context/core-execution-context-server-internal/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/execution-context/core-execution-context-server-internal/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-server-internal/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/execution-context/core-execution-context-server-mocks/BUILD.bazel b/packages/core/execution-context/core-execution-context-server-mocks/BUILD.bazel index 5727d8b9246c7..4f20c479b8de3 100644 --- a/packages/core/execution-context/core-execution-context-server-mocks/BUILD.bazel +++ b/packages/core/execution-context/core-execution-context-server-mocks/BUILD.bazel @@ -78,6 +78,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -89,17 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/execution-context/core-execution-context-server-mocks/package.json b/packages/core/execution-context/core-execution-context-server-mocks/package.json index ecbc92ed92b99..398a5984a4568 100644 --- a/packages/core/execution-context/core-execution-context-server-mocks/package.json +++ b/packages/core/execution-context/core-execution-context-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/execution-context/core-execution-context-server-mocks/tsconfig.json b/packages/core/execution-context/core-execution-context-server-mocks/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/execution-context/core-execution-context-server-mocks/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-server-mocks/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/execution-context/core-execution-context-server/BUILD.bazel b/packages/core/execution-context/core-execution-context-server/BUILD.bazel index e5c7efe6299e2..8b50d3351a8cd 100644 --- a/packages/core/execution-context/core-execution-context-server/BUILD.bazel +++ b/packages/core/execution-context/core-execution-context-server/BUILD.bazel @@ -78,6 +78,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -89,17 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/execution-context/core-execution-context-server/package.json b/packages/core/execution-context/core-execution-context-server/package.json index 7e5c747f2f727..898c44da57f1c 100644 --- a/packages/core/execution-context/core-execution-context-server/package.json +++ b/packages/core/execution-context/core-execution-context-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/execution-context/core-execution-context-server/tsconfig.json b/packages/core/execution-context/core-execution-context-server/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/execution-context/core-execution-context-server/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-server/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-internal/BUILD.bazel b/packages/core/fatal-errors/core-fatal-errors-browser-internal/BUILD.bazel index ff30db81b45b5..bd1cf9b240027 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-internal/BUILD.bazel +++ b/packages/core/fatal-errors/core-fatal-errors-browser-internal/BUILD.bazel @@ -93,7 +93,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -107,6 +106,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -118,17 +125,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-internal/package.json b/packages/core/fatal-errors/core-fatal-errors-browser-internal/package.json index 55ac81c5f63c1..327573f65a502 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-internal/package.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-internal/tsconfig.json b/packages/core/fatal-errors/core-fatal-errors-browser-internal/tsconfig.json index 9f2708fb14528..c561d9f220124 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-internal/tsconfig.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/BUILD.bazel b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/BUILD.bazel index 3bf9c96969ff0..cc6407d5d9e3e 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/BUILD.bazel +++ b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/BUILD.bazel @@ -76,7 +76,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/package.json b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/package.json index 667ceae5bd237..edc9e1832b147 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/package.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/tsconfig.json b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/tsconfig.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/fatal-errors/core-fatal-errors-browser/BUILD.bazel b/packages/core/fatal-errors/core-fatal-errors-browser/BUILD.bazel index ba78e8d4f7f44..680205ac2db28 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser/BUILD.bazel +++ b/packages/core/fatal-errors/core-fatal-errors-browser/BUILD.bazel @@ -74,7 +74,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -88,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/fatal-errors/core-fatal-errors-browser/package.json b/packages/core/fatal-errors/core-fatal-errors-browser/package.json index ad27ac3cfab68..880780bb73c05 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser/package.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/fatal-errors/core-fatal-errors-browser/tsconfig.json b/packages/core/fatal-errors/core-fatal-errors-browser/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser/tsconfig.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/http/core-http-browser-internal/BUILD.bazel b/packages/core/http/core-http-browser-internal/BUILD.bazel index 80395aa4d3621..5f46ac65c2c24 100644 --- a/packages/core/http/core-http-browser-internal/BUILD.bazel +++ b/packages/core/http/core-http-browser-internal/BUILD.bazel @@ -99,6 +99,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -110,17 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-browser-internal/package.json b/packages/core/http/core-http-browser-internal/package.json index 10d7af546754e..f61b71cc8d6ea 100644 --- a/packages/core/http/core-http-browser-internal/package.json +++ b/packages/core/http/core-http-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-browser-internal/tsconfig.json b/packages/core/http/core-http-browser-internal/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/http/core-http-browser-internal/tsconfig.json +++ b/packages/core/http/core-http-browser-internal/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-browser-mocks/BUILD.bazel b/packages/core/http/core-http-browser-mocks/BUILD.bazel index d10b9058c2571..f951d30645a75 100644 --- a/packages/core/http/core-http-browser-mocks/BUILD.bazel +++ b/packages/core/http/core-http-browser-mocks/BUILD.bazel @@ -88,6 +88,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +107,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-browser-mocks/package.json b/packages/core/http/core-http-browser-mocks/package.json index 960705248b954..85d397fcb3018 100644 --- a/packages/core/http/core-http-browser-mocks/package.json +++ b/packages/core/http/core-http-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-browser-mocks/tsconfig.json b/packages/core/http/core-http-browser-mocks/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/http/core-http-browser-mocks/tsconfig.json +++ b/packages/core/http/core-http-browser-mocks/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-browser/BUILD.bazel b/packages/core/http/core-http-browser/BUILD.bazel index 6e29983fac19a..f0566749a6206 100644 --- a/packages/core/http/core-http-browser/BUILD.bazel +++ b/packages/core/http/core-http-browser/BUILD.bazel @@ -86,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-browser/package.json b/packages/core/http/core-http-browser/package.json index 78ed7967b8713..6124448731b9d 100644 --- a/packages/core/http/core-http-browser/package.json +++ b/packages/core/http/core-http-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-browser/tsconfig.json b/packages/core/http/core-http-browser/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/http/core-http-browser/tsconfig.json +++ b/packages/core/http/core-http-browser/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-common/BUILD.bazel b/packages/core/http/core-http-common/BUILD.bazel index 8dae5135dd38c..4852f4c69dcba 100644 --- a/packages/core/http/core-http-common/BUILD.bazel +++ b/packages/core/http/core-http-common/BUILD.bazel @@ -84,6 +84,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -95,17 +103,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-common/package.json b/packages/core/http/core-http-common/package.json index 3ec2d1e626b4b..42a7a24c829e7 100644 --- a/packages/core/http/core-http-common/package.json +++ b/packages/core/http/core-http-common/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-common/tsconfig.json b/packages/core/http/core-http-common/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/http/core-http-common/tsconfig.json +++ b/packages/core/http/core-http-common/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-context-server-internal/BUILD.bazel b/packages/core/http/core-http-context-server-internal/BUILD.bazel index 199941679d710..93229dd4f2eee 100644 --- a/packages/core/http/core-http-context-server-internal/BUILD.bazel +++ b/packages/core/http/core-http-context-server-internal/BUILD.bazel @@ -71,7 +71,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -85,6 +84,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -96,17 +103,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-context-server-internal/package.json b/packages/core/http/core-http-context-server-internal/package.json index 4c236c6ea30ce..3c43287f81311 100644 --- a/packages/core/http/core-http-context-server-internal/package.json +++ b/packages/core/http/core-http-context-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-context-server-internal/tsconfig.json b/packages/core/http/core-http-context-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/http/core-http-context-server-internal/tsconfig.json +++ b/packages/core/http/core-http-context-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-context-server-mocks/BUILD.bazel b/packages/core/http/core-http-context-server-mocks/BUILD.bazel index 127468271b0f1..e6deb74b09ab9 100644 --- a/packages/core/http/core-http-context-server-mocks/BUILD.bazel +++ b/packages/core/http/core-http-context-server-mocks/BUILD.bazel @@ -65,7 +65,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -79,6 +78,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -90,17 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-context-server-mocks/package.json b/packages/core/http/core-http-context-server-mocks/package.json index aff7cd8429cac..a45376bd7c46f 100644 --- a/packages/core/http/core-http-context-server-mocks/package.json +++ b/packages/core/http/core-http-context-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-context-server-mocks/tsconfig.json b/packages/core/http/core-http-context-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/http/core-http-context-server-mocks/tsconfig.json +++ b/packages/core/http/core-http-context-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-request-handler-context-server-internal/BUILD.bazel b/packages/core/http/core-http-request-handler-context-server-internal/BUILD.bazel index 82040b5fb1ad8..af501978f3246 100644 --- a/packages/core/http/core-http-request-handler-context-server-internal/BUILD.bazel +++ b/packages/core/http/core-http-request-handler-context-server-internal/BUILD.bazel @@ -75,7 +75,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -89,6 +88,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -100,17 +107,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-request-handler-context-server-internal/package.json b/packages/core/http/core-http-request-handler-context-server-internal/package.json index 672bb6ce72715..15efa6e69096b 100644 --- a/packages/core/http/core-http-request-handler-context-server-internal/package.json +++ b/packages/core/http/core-http-request-handler-context-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-request-handler-context-server-internal/tsconfig.json b/packages/core/http/core-http-request-handler-context-server-internal/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/http/core-http-request-handler-context-server-internal/tsconfig.json +++ b/packages/core/http/core-http-request-handler-context-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-request-handler-context-server/BUILD.bazel b/packages/core/http/core-http-request-handler-context-server/BUILD.bazel index 45c5ebc08776f..6ca6411dbfbd1 100644 --- a/packages/core/http/core-http-request-handler-context-server/BUILD.bazel +++ b/packages/core/http/core-http-request-handler-context-server/BUILD.bazel @@ -69,7 +69,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -83,6 +82,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -94,17 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-request-handler-context-server/package.json b/packages/core/http/core-http-request-handler-context-server/package.json index da85fc826828d..665e4f309631a 100644 --- a/packages/core/http/core-http-request-handler-context-server/package.json +++ b/packages/core/http/core-http-request-handler-context-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-request-handler-context-server/tsconfig.json b/packages/core/http/core-http-request-handler-context-server/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/http/core-http-request-handler-context-server/tsconfig.json +++ b/packages/core/http/core-http-request-handler-context-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-resources-server-internal/BUILD.bazel b/packages/core/http/core-http-resources-server-internal/BUILD.bazel index 8c286485efafb..3c299b5442ebc 100644 --- a/packages/core/http/core-http-resources-server-internal/BUILD.bazel +++ b/packages/core/http/core-http-resources-server-internal/BUILD.bazel @@ -74,7 +74,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -88,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-resources-server-internal/package.json b/packages/core/http/core-http-resources-server-internal/package.json index 71e4a44a35504..70144170ed0b0 100644 --- a/packages/core/http/core-http-resources-server-internal/package.json +++ b/packages/core/http/core-http-resources-server-internal/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-resources-server-internal/src/get_apm_config.ts b/packages/core/http/core-http-resources-server-internal/src/get_apm_config.ts index 881efe261d79f..82b4f04410a65 100644 --- a/packages/core/http/core-http-resources-server-internal/src/get_apm_config.ts +++ b/packages/core/http/core-http-resources-server-internal/src/get_apm_config.ts @@ -23,8 +23,10 @@ export const getApmConfig = (requestPath: string) => { return null; } + // Cleanup RUM unsupported attrbiutes from base apm config. + const { contextPropagationOnly, logUncaughtExceptions, ...restOfConfig } = baseConfig; const config: Record = { - ...baseConfig, + ...restOfConfig, pageLoadTransactionName: requestPath, }; diff --git a/packages/core/http/core-http-resources-server-internal/tsconfig.json b/packages/core/http/core-http-resources-server-internal/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/http/core-http-resources-server-internal/tsconfig.json +++ b/packages/core/http/core-http-resources-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-resources-server-mocks/BUILD.bazel b/packages/core/http/core-http-resources-server-mocks/BUILD.bazel index 81eefd0db2ee2..5060511ec65ee 100644 --- a/packages/core/http/core-http-resources-server-mocks/BUILD.bazel +++ b/packages/core/http/core-http-resources-server-mocks/BUILD.bazel @@ -69,7 +69,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -83,6 +82,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -94,17 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-resources-server-mocks/package.json b/packages/core/http/core-http-resources-server-mocks/package.json index 47247cd2abaf5..7a264c389f642 100644 --- a/packages/core/http/core-http-resources-server-mocks/package.json +++ b/packages/core/http/core-http-resources-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-resources-server-mocks/tsconfig.json b/packages/core/http/core-http-resources-server-mocks/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/http/core-http-resources-server-mocks/tsconfig.json +++ b/packages/core/http/core-http-resources-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-resources-server/BUILD.bazel b/packages/core/http/core-http-resources-server/BUILD.bazel index 16583b6801b4a..a17973e8d5e64 100644 --- a/packages/core/http/core-http-resources-server/BUILD.bazel +++ b/packages/core/http/core-http-resources-server/BUILD.bazel @@ -66,7 +66,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -80,6 +79,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -91,17 +98,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-resources-server/package.json b/packages/core/http/core-http-resources-server/package.json index 156bc4c8948b4..ecf7f2691ae9f 100644 --- a/packages/core/http/core-http-resources-server/package.json +++ b/packages/core/http/core-http-resources-server/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-resources-server/tsconfig.json b/packages/core/http/core-http-resources-server/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/http/core-http-resources-server/tsconfig.json +++ b/packages/core/http/core-http-resources-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-router-server-internal/BUILD.bazel b/packages/core/http/core-http-router-server-internal/BUILD.bazel index 5938665d14a73..511f84695274d 100644 --- a/packages/core/http/core-http-router-server-internal/BUILD.bazel +++ b/packages/core/http/core-http-router-server-internal/BUILD.bazel @@ -80,7 +80,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -94,6 +93,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -105,17 +112,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-router-server-internal/package.json b/packages/core/http/core-http-router-server-internal/package.json index 12e3cf1498f36..6bf05d2b0d2c3 100644 --- a/packages/core/http/core-http-router-server-internal/package.json +++ b/packages/core/http/core-http-router-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-router-server-internal/tsconfig.json b/packages/core/http/core-http-router-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/http/core-http-router-server-internal/tsconfig.json +++ b/packages/core/http/core-http-router-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-router-server-mocks/BUILD.bazel b/packages/core/http/core-http-router-server-mocks/BUILD.bazel index e178c6eb061d1..867785d471708 100644 --- a/packages/core/http/core-http-router-server-mocks/BUILD.bazel +++ b/packages/core/http/core-http-router-server-mocks/BUILD.bazel @@ -71,7 +71,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -85,6 +84,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -96,17 +103,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-router-server-mocks/package.json b/packages/core/http/core-http-router-server-mocks/package.json index 05055e151a0e1..578109fa9e5b0 100644 --- a/packages/core/http/core-http-router-server-mocks/package.json +++ b/packages/core/http/core-http-router-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-router-server-mocks/tsconfig.json b/packages/core/http/core-http-router-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/http/core-http-router-server-mocks/tsconfig.json +++ b/packages/core/http/core-http-router-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-server-internal/BUILD.bazel b/packages/core/http/core-http-server-internal/BUILD.bazel index 214bb5833b7a9..a5457aca25e03 100644 --- a/packages/core/http/core-http-server-internal/BUILD.bazel +++ b/packages/core/http/core-http-server-internal/BUILD.bazel @@ -114,7 +114,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -128,6 +127,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -139,17 +146,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-server-internal/package.json b/packages/core/http/core-http-server-internal/package.json index bf2e87b07d228..10e06bebc4846 100644 --- a/packages/core/http/core-http-server-internal/package.json +++ b/packages/core/http/core-http-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-server-internal/tsconfig.json b/packages/core/http/core-http-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/http/core-http-server-internal/tsconfig.json +++ b/packages/core/http/core-http-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-server-mocks/BUILD.bazel b/packages/core/http/core-http-server-mocks/BUILD.bazel index 3031a90cce2b8..e5f898bd4f632 100644 --- a/packages/core/http/core-http-server-mocks/BUILD.bazel +++ b/packages/core/http/core-http-server-mocks/BUILD.bazel @@ -84,7 +84,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -98,6 +97,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -109,17 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-server-mocks/package.json b/packages/core/http/core-http-server-mocks/package.json index 2efeb0f8db9d3..e1d3718cfc708 100644 --- a/packages/core/http/core-http-server-mocks/package.json +++ b/packages/core/http/core-http-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-server-mocks/tsconfig.json b/packages/core/http/core-http-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/http/core-http-server-mocks/tsconfig.json +++ b/packages/core/http/core-http-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/http/core-http-server/BUILD.bazel b/packages/core/http/core-http-server/BUILD.bazel index b3d2f9ab4109c..128d466207ed6 100644 --- a/packages/core/http/core-http-server/BUILD.bazel +++ b/packages/core/http/core-http-server/BUILD.bazel @@ -85,6 +85,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -96,17 +104,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/http/core-http-server/package.json b/packages/core/http/core-http-server/package.json index e56981c661222..17ad2086c6034 100644 --- a/packages/core/http/core-http-server/package.json +++ b/packages/core/http/core-http-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/http/core-http-server/tsconfig.json b/packages/core/http/core-http-server/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/http/core-http-server/tsconfig.json +++ b/packages/core/http/core-http-server/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/i18n/core-i18n-browser-internal/BUILD.bazel b/packages/core/i18n/core-i18n-browser-internal/BUILD.bazel index b0c5e3eedff9e..fbfe5f0d565a0 100644 --- a/packages/core/i18n/core-i18n-browser-internal/BUILD.bazel +++ b/packages/core/i18n/core-i18n-browser-internal/BUILD.bazel @@ -77,7 +77,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -91,6 +90,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -102,17 +109,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/i18n/core-i18n-browser-internal/package.json b/packages/core/i18n/core-i18n-browser-internal/package.json index 4feb5bab3251f..b2a27795b4663 100644 --- a/packages/core/i18n/core-i18n-browser-internal/package.json +++ b/packages/core/i18n/core-i18n-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/i18n/core-i18n-browser-internal/tsconfig.json b/packages/core/i18n/core-i18n-browser-internal/tsconfig.json index 26b4c7aca3a67..741519055e986 100644 --- a/packages/core/i18n/core-i18n-browser-internal/tsconfig.json +++ b/packages/core/i18n/core-i18n-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/i18n/core-i18n-browser-mocks/BUILD.bazel b/packages/core/i18n/core-i18n-browser-mocks/BUILD.bazel index b4824a3afb15c..024b03ca186e6 100644 --- a/packages/core/i18n/core-i18n-browser-mocks/BUILD.bazel +++ b/packages/core/i18n/core-i18n-browser-mocks/BUILD.bazel @@ -76,7 +76,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/i18n/core-i18n-browser-mocks/package.json b/packages/core/i18n/core-i18n-browser-mocks/package.json index ef738f9292f52..b04b9ab71bc6b 100644 --- a/packages/core/i18n/core-i18n-browser-mocks/package.json +++ b/packages/core/i18n/core-i18n-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/i18n/core-i18n-browser-mocks/tsconfig.json b/packages/core/i18n/core-i18n-browser-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/i18n/core-i18n-browser-mocks/tsconfig.json +++ b/packages/core/i18n/core-i18n-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/i18n/core-i18n-browser/BUILD.bazel b/packages/core/i18n/core-i18n-browser/BUILD.bazel index 704a1bcba3fbe..be675f43567fb 100644 --- a/packages/core/i18n/core-i18n-browser/BUILD.bazel +++ b/packages/core/i18n/core-i18n-browser/BUILD.bazel @@ -73,7 +73,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -87,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/i18n/core-i18n-browser/package.json b/packages/core/i18n/core-i18n-browser/package.json index 651e5a0ab57a9..cb97be2e54d99 100644 --- a/packages/core/i18n/core-i18n-browser/package.json +++ b/packages/core/i18n/core-i18n-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/i18n/core-i18n-browser/tsconfig.json b/packages/core/i18n/core-i18n-browser/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/i18n/core-i18n-browser/tsconfig.json +++ b/packages/core/i18n/core-i18n-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/i18n/core-i18n-server-internal/BUILD.bazel b/packages/core/i18n/core-i18n-server-internal/BUILD.bazel index b315f479c4889..d1885f2ff09c1 100644 --- a/packages/core/i18n/core-i18n-server-internal/BUILD.bazel +++ b/packages/core/i18n/core-i18n-server-internal/BUILD.bazel @@ -88,7 +88,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -103,6 +102,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -114,17 +121,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/i18n/core-i18n-server-internal/package.json b/packages/core/i18n/core-i18n-server-internal/package.json index a3510ea753b03..eeee098fa9348 100644 --- a/packages/core/i18n/core-i18n-server-internal/package.json +++ b/packages/core/i18n/core-i18n-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/i18n/core-i18n-server-internal/tsconfig.json b/packages/core/i18n/core-i18n-server-internal/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/i18n/core-i18n-server-internal/tsconfig.json +++ b/packages/core/i18n/core-i18n-server-internal/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/i18n/core-i18n-server-mocks/BUILD.bazel b/packages/core/i18n/core-i18n-server-mocks/BUILD.bazel index d324c377b6adf..0468c8d6b8628 100644 --- a/packages/core/i18n/core-i18n-server-mocks/BUILD.bazel +++ b/packages/core/i18n/core-i18n-server-mocks/BUILD.bazel @@ -74,7 +74,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -88,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/i18n/core-i18n-server-mocks/package.json b/packages/core/i18n/core-i18n-server-mocks/package.json index 92368578109cb..e53b59962a3bf 100644 --- a/packages/core/i18n/core-i18n-server-mocks/package.json +++ b/packages/core/i18n/core-i18n-server-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/i18n/core-i18n-server-mocks/tsconfig.json b/packages/core/i18n/core-i18n-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/i18n/core-i18n-server-mocks/tsconfig.json +++ b/packages/core/i18n/core-i18n-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/i18n/core-i18n-server/BUILD.bazel b/packages/core/i18n/core-i18n-server/BUILD.bazel index c3b9d8fec6241..ac40679dcbefb 100644 --- a/packages/core/i18n/core-i18n-server/BUILD.bazel +++ b/packages/core/i18n/core-i18n-server/BUILD.bazel @@ -64,7 +64,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -79,6 +78,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -90,17 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/i18n/core-i18n-server/package.json b/packages/core/i18n/core-i18n-server/package.json index d2e327af8f3c4..6e4c172f54200 100644 --- a/packages/core/i18n/core-i18n-server/package.json +++ b/packages/core/i18n/core-i18n-server/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/i18n/core-i18n-server/tsconfig.json b/packages/core/i18n/core-i18n-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/i18n/core-i18n-server/tsconfig.json +++ b/packages/core/i18n/core-i18n-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel index 3ace9f8f44058..619d355c908fc 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel +++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel @@ -78,7 +78,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -92,6 +91,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -103,17 +110,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json b/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json index 19a13df15cbdc..107773154a0b5 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json +++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json +++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel index 88a4c0b92767d..f4c3fbdec9a1c 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel +++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel @@ -72,7 +72,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -86,6 +85,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +104,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json index 090b9a9aba665..4c96174666f69 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json +++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json +++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/injected-metadata/core-injected-metadata-browser/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-browser/BUILD.bazel index a02b406b4be9f..ba69e107cf1f8 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser/BUILD.bazel +++ b/packages/core/injected-metadata/core-injected-metadata-browser/BUILD.bazel @@ -92,7 +92,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -106,6 +105,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -117,17 +124,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/injected-metadata/core-injected-metadata-browser/package.json b/packages/core/injected-metadata/core-injected-metadata-browser/package.json index 6bc4611c157ac..c3e89f1bad632 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser/package.json +++ b/packages/core/injected-metadata/core-injected-metadata-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/injected-metadata/core-injected-metadata-browser/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-browser/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser/tsconfig.json +++ b/packages/core/injected-metadata/core-injected-metadata-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel index f03dfb7944e14..0540de01bc9c4 100644 --- a/packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel +++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel @@ -76,7 +76,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json b/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json index 2859de4a935a6..7f4052847f183 100644 --- a/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json +++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json +++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/integrations/core-integrations-browser-internal/BUILD.bazel b/packages/core/integrations/core-integrations-browser-internal/BUILD.bazel index 73df7f69b705a..f7ac69215dd0c 100644 --- a/packages/core/integrations/core-integrations-browser-internal/BUILD.bazel +++ b/packages/core/integrations/core-integrations-browser-internal/BUILD.bazel @@ -84,7 +84,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -98,6 +97,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -109,17 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/integrations/core-integrations-browser-internal/package.json b/packages/core/integrations/core-integrations-browser-internal/package.json index 1ab0addd1add6..a4e0066c114a0 100644 --- a/packages/core/integrations/core-integrations-browser-internal/package.json +++ b/packages/core/integrations/core-integrations-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/integrations/core-integrations-browser-internal/tsconfig.json b/packages/core/integrations/core-integrations-browser-internal/tsconfig.json index 4abe25d2969e6..e1805086a07a5 100644 --- a/packages/core/integrations/core-integrations-browser-internal/tsconfig.json +++ b/packages/core/integrations/core-integrations-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/integrations/core-integrations-browser-mocks/BUILD.bazel b/packages/core/integrations/core-integrations-browser-mocks/BUILD.bazel index bbfc2771fd1e7..ce47f36d5853e 100644 --- a/packages/core/integrations/core-integrations-browser-mocks/BUILD.bazel +++ b/packages/core/integrations/core-integrations-browser-mocks/BUILD.bazel @@ -72,7 +72,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -86,6 +85,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +104,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/integrations/core-integrations-browser-mocks/package.json b/packages/core/integrations/core-integrations-browser-mocks/package.json index a2c706786a127..eea3536fe806a 100644 --- a/packages/core/integrations/core-integrations-browser-mocks/package.json +++ b/packages/core/integrations/core-integrations-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/integrations/core-integrations-browser-mocks/tsconfig.json b/packages/core/integrations/core-integrations-browser-mocks/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/integrations/core-integrations-browser-mocks/tsconfig.json +++ b/packages/core/integrations/core-integrations-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/lifecycle/core-lifecycle-browser-internal/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-browser-internal/BUILD.bazel index 3f1aa3eb50c42..9cbc08c356faf 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-internal/BUILD.bazel +++ b/packages/core/lifecycle/core-lifecycle-browser-internal/BUILD.bazel @@ -75,7 +75,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -89,6 +88,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -100,17 +107,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/lifecycle/core-lifecycle-browser-internal/package.json b/packages/core/lifecycle/core-lifecycle-browser-internal/package.json index 738d3fed2bb51..c78d95efa4f5a 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-internal/package.json +++ b/packages/core/lifecycle/core-lifecycle-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/lifecycle/core-lifecycle-browser-internal/tsconfig.json b/packages/core/lifecycle/core-lifecycle-browser-internal/tsconfig.json index 62f956eb463d9..61706db827bc4 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-internal/tsconfig.json +++ b/packages/core/lifecycle/core-lifecycle-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/lifecycle/core-lifecycle-browser-mocks/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-browser-mocks/BUILD.bazel index eaf6de1d6576b..bdd2bacdad713 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-mocks/BUILD.bazel +++ b/packages/core/lifecycle/core-lifecycle-browser-mocks/BUILD.bazel @@ -101,7 +101,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -115,6 +114,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -126,17 +133,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/lifecycle/core-lifecycle-browser-mocks/package.json b/packages/core/lifecycle/core-lifecycle-browser-mocks/package.json index fd1224d4d078e..2017564049aa9 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-mocks/package.json +++ b/packages/core/lifecycle/core-lifecycle-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/lifecycle/core-lifecycle-browser-mocks/tsconfig.json b/packages/core/lifecycle/core-lifecycle-browser-mocks/tsconfig.json index 4283cbe1b760b..47ad657279cbb 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-mocks/tsconfig.json +++ b/packages/core/lifecycle/core-lifecycle-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/lifecycle/core-lifecycle-browser/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-browser/BUILD.bazel index d32c12c107283..2a7a1775395a1 100644 --- a/packages/core/lifecycle/core-lifecycle-browser/BUILD.bazel +++ b/packages/core/lifecycle/core-lifecycle-browser/BUILD.bazel @@ -87,7 +87,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -101,6 +100,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -112,17 +119,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/lifecycle/core-lifecycle-browser/package.json b/packages/core/lifecycle/core-lifecycle-browser/package.json index 0e14a56f8bf15..72eae4ae4d40e 100644 --- a/packages/core/lifecycle/core-lifecycle-browser/package.json +++ b/packages/core/lifecycle/core-lifecycle-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/lifecycle/core-lifecycle-browser/tsconfig.json b/packages/core/lifecycle/core-lifecycle-browser/tsconfig.json index ae5054c1cd726..48df8f2957246 100644 --- a/packages/core/lifecycle/core-lifecycle-browser/tsconfig.json +++ b/packages/core/lifecycle/core-lifecycle-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-server-internal/BUILD.bazel new file mode 100644 index 0000000000000..650127f655d2a --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/BUILD.bazel @@ -0,0 +1,123 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-lifecycle-server-internal" +PKG_REQUIRE_NAME = "@kbn/core-lifecycle-server-internal" + +SOURCE_FILES = glob( + [ + "**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "//packages/core/logging/core-logging-server-internal:npm_module_types", + "//packages/core/analytics/core-analytics-server:npm_module_types", + "//packages/core/preboot/core-preboot-server-internal:npm_module_types", + "//packages/core/http/core-http-context-server-internal:npm_module_types", + "//packages/core/http/core-http-server-internal:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", + "//packages/core/ui-settings/core-ui-settings-server-internal:npm_module_types", + "//packages/core/http/core-http-resources-server-internal:npm_module_types", + "//packages/core/capabilities/core-capabilities-server:npm_module_types", + "//packages/core/doc-links/core-doc-links-server:npm_module_types", + "//packages/core/i18n/core-i18n-server:npm_module_types", + "//packages/core/environment/core-environment-server-internal:npm_module_types", + "//packages/core/execution-context/core-execution-context-server-internal:npm_module_types", + "//packages/core/deprecations/core-deprecations-server-internal:npm_module_types", + "//packages/core/metrics/core-metrics-server-internal:npm_module_types", + "//packages/core/rendering/core-rendering-server-internal:npm_module_types", + "//packages/core/saved-objects/core-saved-objects-server-internal:npm_module_types", + "//packages/core/status/core-status-server-internal:npm_module_types", + "//packages/core/usage-data/core-usage-data-base-server-internal:npm_module_types", + "//packages/core/usage-data/core-usage-data-server:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/README.md b/packages/core/lifecycle/core-lifecycle-server-internal/README.md new file mode 100644 index 0000000000000..b2eecd8ad21ad --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/README.md @@ -0,0 +1,7 @@ +# @kbn/core-lifecycle-server-internal + + +This package contains the internal types for core's server-side lifecycle contracts: +- `InternalCorePreboot` +- `InternalCoreSetup` +- `InternalCoreStart` diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/index.ts b/packages/core/lifecycle/core-lifecycle-server-internal/index.ts new file mode 100644 index 0000000000000..6c3a41be1b49d --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { InternalCorePreboot, InternalCoreSetup, InternalCoreStart } from './src'; diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/jest.config.js b/packages/core/lifecycle/core-lifecycle-server-internal/jest.config.js new file mode 100644 index 0000000000000..039817196b1fe --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/lifecycle/core-lifecycle-server-internal'], +}; diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/kibana.jsonc b/packages/core/lifecycle/core-lifecycle-server-internal/kibana.jsonc new file mode 100644 index 0000000000000..7f8fa2fc8f6ad --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-lifecycle-server-internal", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/package.json b/packages/core/lifecycle/core-lifecycle-server-internal/package.json new file mode 100644 index 0000000000000..6b02fc1feea5e --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/package.json @@ -0,0 +1,9 @@ +{ + "name": "@kbn/core-lifecycle-server-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/src/index.ts b/packages/core/lifecycle/core-lifecycle-server-internal/src/index.ts new file mode 100644 index 0000000000000..617706c7d53f9 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/src/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { InternalCorePreboot } from './internal_core_preboot'; +export type { InternalCoreSetup } from './internal_core_setup'; +export type { InternalCoreStart } from './internal_core_start'; diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/src/internal_core_preboot.ts b/packages/core/lifecycle/core-lifecycle-server-internal/src/internal_core_preboot.ts new file mode 100644 index 0000000000000..18f4c605c1b16 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/src/internal_core_preboot.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import type { InternalLoggingServicePreboot } from '@kbn/core-logging-server-internal'; +import type { AnalyticsServicePreboot } from '@kbn/core-analytics-server'; +import type { InternalPrebootServicePreboot } from '@kbn/core-preboot-server-internal'; +import type { InternalContextPreboot } from '@kbn/core-http-context-server-internal'; +import type { InternalHttpServicePreboot } from '@kbn/core-http-server-internal'; +import type { InternalElasticsearchServicePreboot } from '@kbn/core-elasticsearch-server-internal'; +import type { InternalUiSettingsServicePreboot } from '@kbn/core-ui-settings-server-internal'; +import type { InternalHttpResourcesPreboot } from '@kbn/core-http-resources-server-internal'; + +/** @internal */ +export interface InternalCorePreboot { + analytics: AnalyticsServicePreboot; + context: InternalContextPreboot; + http: InternalHttpServicePreboot; + elasticsearch: InternalElasticsearchServicePreboot; + uiSettings: InternalUiSettingsServicePreboot; + httpResources: InternalHttpResourcesPreboot; + logging: InternalLoggingServicePreboot; + preboot: InternalPrebootServicePreboot; +} diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/src/internal_core_setup.ts b/packages/core/lifecycle/core-lifecycle-server-internal/src/internal_core_setup.ts new file mode 100644 index 0000000000000..5e706cd5f5b0c --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/src/internal_core_setup.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { AnalyticsServiceSetup } from '@kbn/core-analytics-server'; +import type { CapabilitiesSetup } from '@kbn/core-capabilities-server'; +import type { DocLinksServiceSetup } from '@kbn/core-doc-links-server'; +import type { I18nServiceSetup } from '@kbn/core-i18n-server'; +import type { InternalElasticsearchServiceSetup } from '@kbn/core-elasticsearch-server-internal'; +import type { InternalEnvironmentServiceSetup } from '@kbn/core-environment-server-internal'; +import type { InternalExecutionContextSetup } from '@kbn/core-execution-context-server-internal'; +import type { InternalContextSetup } from '@kbn/core-http-context-server-internal'; +import type { InternalDeprecationsServiceSetup } from '@kbn/core-deprecations-server-internal'; +import type { InternalHttpResourcesSetup } from '@kbn/core-http-resources-server-internal'; +import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; +import type { InternalLoggingServiceSetup } from '@kbn/core-logging-server-internal'; +import type { InternalMetricsServiceSetup } from '@kbn/core-metrics-server-internal'; +import type { InternalRenderingServiceSetup } from '@kbn/core-rendering-server-internal'; +import type { InternalSavedObjectsServiceSetup } from '@kbn/core-saved-objects-server-internal'; +import type { InternalStatusServiceSetup } from '@kbn/core-status-server-internal'; +import type { InternalUiSettingsServiceSetup } from '@kbn/core-ui-settings-server-internal'; +import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal'; + +/** @internal */ +export interface InternalCoreSetup { + analytics: AnalyticsServiceSetup; + capabilities: CapabilitiesSetup; + context: InternalContextSetup; + docLinks: DocLinksServiceSetup; + http: InternalHttpServiceSetup; + elasticsearch: InternalElasticsearchServiceSetup; + executionContext: InternalExecutionContextSetup; + i18n: I18nServiceSetup; + savedObjects: InternalSavedObjectsServiceSetup; + status: InternalStatusServiceSetup; + uiSettings: InternalUiSettingsServiceSetup; + environment: InternalEnvironmentServiceSetup; + rendering: InternalRenderingServiceSetup; + httpResources: InternalHttpResourcesSetup; + logging: InternalLoggingServiceSetup; + metrics: InternalMetricsServiceSetup; + deprecations: InternalDeprecationsServiceSetup; + coreUsageData: InternalCoreUsageDataSetup; +} diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/src/internal_core_start.ts b/packages/core/lifecycle/core-lifecycle-server-internal/src/internal_core_start.ts new file mode 100644 index 0000000000000..e4d777d137b70 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/src/internal_core_start.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { AnalyticsServiceStart } from '@kbn/core-analytics-server'; +import type { CapabilitiesStart } from '@kbn/core-capabilities-server'; +import type { InternalDeprecationsServiceStart } from '@kbn/core-deprecations-server-internal'; +import type { DocLinksServiceStart } from '@kbn/core-doc-links-server'; +import type { InternalElasticsearchServiceStart } from '@kbn/core-elasticsearch-server-internal'; +import type { InternalExecutionContextStart } from '@kbn/core-execution-context-server-internal'; +import type { InternalHttpServiceStart } from '@kbn/core-http-server-internal'; +import type { InternalMetricsServiceStart } from '@kbn/core-metrics-server-internal'; +import type { InternalSavedObjectsServiceStart } from '@kbn/core-saved-objects-server-internal'; +import type { InternalUiSettingsServiceStart } from '@kbn/core-ui-settings-server-internal'; +import type { CoreUsageDataStart } from '@kbn/core-usage-data-server'; + +/** + * @internal + */ +export interface InternalCoreStart { + analytics: AnalyticsServiceStart; + capabilities: CapabilitiesStart; + elasticsearch: InternalElasticsearchServiceStart; + docLinks: DocLinksServiceStart; + http: InternalHttpServiceStart; + metrics: InternalMetricsServiceStart; + savedObjects: InternalSavedObjectsServiceStart; + uiSettings: InternalUiSettingsServiceStart; + coreUsageData: CoreUsageDataStart; + executionContext: InternalExecutionContextStart; + deprecations: InternalDeprecationsServiceStart; +} diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/tsconfig.json b/packages/core/lifecycle/core-lifecycle-server-internal/tsconfig.json new file mode 100644 index 0000000000000..4582562d6c9bb --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-internal/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-server-mocks/BUILD.bazel new file mode 100644 index 0000000000000..8edde25e3ea13 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/BUILD.bazel @@ -0,0 +1,141 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-lifecycle-server-mocks" +PKG_REQUIRE_NAME = "@kbn/core-lifecycle-server-mocks" + +SOURCE_FILES = glob( + [ + "**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "//packages/core/analytics/core-analytics-server-mocks", + "//packages/core/capabilities/core-capabilities-server-mocks", + "//packages/core/doc-links/core-doc-links-server-mocks", + "//packages/core/deprecations/core-deprecations-server-mocks", + "//packages/core/elasticsearch/core-elasticsearch-server-mocks", + "//packages/core/environment/core-environment-server-mocks", + "//packages/core/execution-context/core-execution-context-server-mocks", + "//packages/core/http/core-http-context-server-mocks", + "//packages/core/http/core-http-server-mocks", + "//packages/core/http/core-http-resources-server-mocks", + "//packages/core/i18n/core-i18n-server-mocks", + "//packages/core/lifecycle/core-lifecycle-server", + "//packages/core/metrics/core-metrics-server-mocks", + "//packages/core/preboot/core-preboot-server-mocks", + "//packages/core/rendering/core-rendering-server-mocks", + "//packages/core/saved-objects/core-saved-objects-server-mocks", + "//packages/core/status/core-status-server-mocks", + "//packages/core/ui-settings/core-ui-settings-server-mocks", + "//packages/core/usage-data/core-usage-data-server-mocks", + +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "//packages/kbn-utility-types-jest:npm_module_types", + "//packages/core/analytics/core-analytics-server-mocks:npm_module_types", + "//packages/core/capabilities/core-capabilities-server-mocks:npm_module_types", + "//packages/core/doc-links/core-doc-links-server-mocks:npm_module_types", + "//packages/core/deprecations/core-deprecations-server-mocks:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-server-mocks:npm_module_types", + "//packages/core/environment/core-environment-server-mocks:npm_module_types", + "//packages/core/execution-context/core-execution-context-server-mocks:npm_module_types", + "//packages/core/http/core-http-context-server-mocks:npm_module_types", + "//packages/core/http/core-http-server-mocks:npm_module_types", + "//packages/core/http/core-http-resources-server-mocks:npm_module_types", + "//packages/core/i18n/core-i18n-server-mocks:npm_module_types", + "//packages/core/lifecycle/core-lifecycle-server:npm_module_types", + "//packages/core/metrics/core-metrics-server-mocks:npm_module_types", + "//packages/core/preboot/core-preboot-server-mocks:npm_module_types", + "//packages/core/rendering/core-rendering-server-mocks:npm_module_types", + "//packages/core/saved-objects/core-saved-objects-server-mocks:npm_module_types", + "//packages/core/status/core-status-server-mocks:npm_module_types", + "//packages/core/ui-settings/core-ui-settings-server-mocks:npm_module_types", + "//packages/core/usage-data/core-usage-data-server-mocks:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/README.md b/packages/core/lifecycle/core-lifecycle-server-mocks/README.md new file mode 100644 index 0000000000000..6603c268f3d94 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/README.md @@ -0,0 +1,5 @@ +# @kbn/core-lifecycle-server-mocks + +This package contains the mocks for core's server-side lifecycle contracts: +- `coreLifecycleMock` +- `coreInternalLifecycleMock` diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/index.ts b/packages/core/lifecycle/core-lifecycle-server-mocks/index.ts new file mode 100644 index 0000000000000..e17f4db9de973 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { coreLifecycleMock, coreInternalLifecycleMock } from './src'; diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/jest.config.js b/packages/core/lifecycle/core-lifecycle-server-mocks/jest.config.js new file mode 100644 index 0000000000000..3db7ab516cd56 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/lifecycle/core-lifecycle-server-mocks'], +}; diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/kibana.jsonc b/packages/core/lifecycle/core-lifecycle-server-mocks/kibana.jsonc new file mode 100644 index 0000000000000..ea9bbadfd57e9 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-lifecycle-server-mocks", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/package.json b/packages/core/lifecycle/core-lifecycle-server-mocks/package.json new file mode 100644 index 0000000000000..532c072107303 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/package.json @@ -0,0 +1,9 @@ +{ + "name": "@kbn/core-lifecycle-server-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/src/core_preboot.mock.ts b/packages/core/lifecycle/core-lifecycle-server-mocks/src/core_preboot.mock.ts new file mode 100644 index 0000000000000..43446f824faed --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/src/core_preboot.mock.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { analyticsServiceMock } from '@kbn/core-analytics-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; +import { prebootServiceMock } from '@kbn/core-preboot-server-mocks'; +import type { MockedKeys } from '@kbn/utility-types-jest'; +import type { CorePreboot } from '@kbn/core-lifecycle-server'; + +type CorePrebootMockType = MockedKeys & { + elasticsearch: ReturnType; +}; + +export function createCorePrebootMock() { + const mock: CorePrebootMockType = { + analytics: analyticsServiceMock.createAnalyticsServicePreboot(), + elasticsearch: elasticsearchServiceMock.createPreboot(), + http: httpServiceMock.createPrebootContract() as CorePrebootMockType['http'], + preboot: prebootServiceMock.createPrebootContract(), + }; + + return mock; +} diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/src/core_setup.mock.ts b/packages/core/lifecycle/core-lifecycle-server-mocks/src/core_setup.mock.ts new file mode 100644 index 0000000000000..0c4e25e846cab --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/src/core_setup.mock.ts @@ -0,0 +1,73 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; +import { httpResourcesMock } from '@kbn/core-http-resources-server-mocks'; +import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; +import type { CoreSetup, StartServicesAccessor } from '@kbn/core-lifecycle-server'; +import type { MockedKeys } from '@kbn/utility-types-jest'; +import { analyticsServiceMock } from '@kbn/core-analytics-server-mocks'; +import { capabilitiesServiceMock } from '@kbn/core-capabilities-server-mocks'; +import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; +import { i18nServiceMock } from '@kbn/core-i18n-server-mocks'; +import { savedObjectsServiceMock } from '@kbn/core-saved-objects-server-mocks'; +import { statusServiceMock } from '@kbn/core-status-server-mocks'; +import { loggingServiceMock } from '@kbn/core-logging-server-mocks'; +import { metricsServiceMock } from '@kbn/core-metrics-server-mocks'; +import { deprecationsServiceMock } from '@kbn/core-deprecations-server-mocks'; +import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; +import { coreUsageDataServiceMock } from '@kbn/core-usage-data-server-mocks'; +import { createCoreStartMock } from './core_start.mock'; + +type CoreSetupMockType = MockedKeys & { + elasticsearch: ReturnType; + getStartServices: jest.MockedFunction>; +}; + +export function createCoreSetupMock({ + pluginStartDeps = {}, + pluginStartContract, +}: { + pluginStartDeps?: object; + pluginStartContract?: any; +} = {}) { + const httpMock: jest.Mocked = { + ...httpServiceMock.createSetupContract(), + resources: httpResourcesMock.createRegistrar(), + }; + + const uiSettingsMock = { + register: uiSettingsServiceMock.createSetupContract().register, + }; + + const mock: CoreSetupMockType = { + analytics: analyticsServiceMock.createAnalyticsServiceSetup(), + capabilities: capabilitiesServiceMock.createSetupContract(), + docLinks: docLinksServiceMock.createSetupContract(), + elasticsearch: elasticsearchServiceMock.createSetup(), + http: httpMock, + i18n: i18nServiceMock.createSetupContract(), + savedObjects: savedObjectsServiceMock.createInternalSetupContract(), + status: statusServiceMock.createSetupContract(), + uiSettings: uiSettingsMock, + logging: loggingServiceMock.createSetupContract(), + metrics: metricsServiceMock.createSetupContract(), + deprecations: deprecationsServiceMock.createSetupContract(), + executionContext: executionContextServiceMock.createInternalSetupContract(), + coreUsageData: { + registerUsageCounter: coreUsageDataServiceMock.createSetupContract().registerUsageCounter, + }, + getStartServices: jest + .fn, object, any]>, []>() + .mockResolvedValue([createCoreStartMock(), pluginStartDeps, pluginStartContract]), + }; + + return mock; +} diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/src/core_start.mock.ts b/packages/core/lifecycle/core-lifecycle-server-mocks/src/core_start.mock.ts new file mode 100644 index 0000000000000..763a9c403eb39 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/src/core_start.mock.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { analyticsServiceMock } from '@kbn/core-analytics-server-mocks'; +import { capabilitiesServiceMock } from '@kbn/core-capabilities-server-mocks'; +import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; +import type { CoreStart } from '@kbn/core-lifecycle-server'; +import { metricsServiceMock } from '@kbn/core-metrics-server-mocks'; +import { savedObjectsServiceMock } from '@kbn/core-saved-objects-server-mocks'; +import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; +import { coreUsageDataServiceMock } from '@kbn/core-usage-data-server-mocks'; +import type { MockedKeys } from '@kbn/utility-types-jest'; + +export function createCoreStartMock() { + const mock: MockedKeys = { + analytics: analyticsServiceMock.createAnalyticsServiceStart(), + capabilities: capabilitiesServiceMock.createStartContract(), + docLinks: docLinksServiceMock.createStartContract(), + elasticsearch: elasticsearchServiceMock.createStart(), + http: httpServiceMock.createStartContract(), + metrics: metricsServiceMock.createStartContract(), + savedObjects: savedObjectsServiceMock.createStartContract(), + uiSettings: uiSettingsServiceMock.createStartContract(), + coreUsageData: coreUsageDataServiceMock.createStartContract(), + executionContext: executionContextServiceMock.createInternalStartContract(), + }; + + return mock; +} diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts b/packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts new file mode 100644 index 0000000000000..66f9c1d818351 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/src/index.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createCorePrebootMock } from './core_preboot.mock'; +import { createCoreSetupMock } from './core_setup.mock'; +import { createCoreStartMock } from './core_start.mock'; + +import { createInternalCorePrebootMock } from './internal_core_preboot.mock'; +import { createInternalCoreSetupMock } from './internal_core_setup.mock'; +import { createInternalCoreStartMock } from './internal_core_start.mock'; + +export const coreLifecycleMock = { + createPreboot: createCorePrebootMock, + createCoreSetup: createCoreSetupMock, + createCoreStart: createCoreStartMock, +}; + +export const coreInternalLifecycleMock = { + createInternalPreboot: createInternalCorePrebootMock, + createInternalSetup: createInternalCoreSetupMock, + createInternalStart: createInternalCoreStartMock, +}; diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/src/internal_core_preboot.mock.ts b/packages/core/lifecycle/core-lifecycle-server-mocks/src/internal_core_preboot.mock.ts new file mode 100644 index 0000000000000..08c6d269f1e38 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/src/internal_core_preboot.mock.ts @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { analyticsServiceMock } from '@kbn/core-analytics-server-mocks'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import { httpResourcesMock } from '@kbn/core-http-resources-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; +import { loggingServiceMock } from '@kbn/core-logging-server-mocks'; +import { prebootServiceMock } from '@kbn/core-preboot-server-mocks'; +import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; + +export function createInternalCorePrebootMock() { + const prebootDeps = { + analytics: analyticsServiceMock.createAnalyticsServicePreboot(), + context: contextServiceMock.createPrebootContract(), + elasticsearch: elasticsearchServiceMock.createInternalPreboot(), + http: httpServiceMock.createInternalPrebootContract(), + httpResources: httpResourcesMock.createPrebootContract(), + uiSettings: uiSettingsServiceMock.createPrebootContract(), + logging: loggingServiceMock.createInternalPrebootContract(), + preboot: prebootServiceMock.createInternalPrebootContract(), + }; + return prebootDeps; +} diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/src/internal_core_setup.mock.ts b/packages/core/lifecycle/core-lifecycle-server-mocks/src/internal_core_setup.mock.ts new file mode 100644 index 0000000000000..cddb9a49dab3c --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/src/internal_core_setup.mock.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { analyticsServiceMock } from '@kbn/core-analytics-server-mocks'; +import { capabilitiesServiceMock } from '@kbn/core-capabilities-server-mocks'; +import { deprecationsServiceMock } from '@kbn/core-deprecations-server-mocks'; +import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { environmentServiceMock } from '@kbn/core-environment-server-mocks'; +import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import { httpResourcesMock } from '@kbn/core-http-resources-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; +import { i18nServiceMock } from '@kbn/core-i18n-server-mocks'; +import { loggingServiceMock } from '@kbn/core-logging-server-mocks'; +import { metricsServiceMock } from '@kbn/core-metrics-server-mocks'; +import { renderingServiceMock } from '@kbn/core-rendering-server-mocks'; +import { savedObjectsServiceMock } from '@kbn/core-saved-objects-server-mocks'; +import { statusServiceMock } from '@kbn/core-status-server-mocks'; +import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; +import { coreUsageDataServiceMock } from '@kbn/core-usage-data-server-mocks'; + +export function createInternalCoreSetupMock() { + const setupDeps = { + analytics: analyticsServiceMock.createAnalyticsServiceSetup(), + capabilities: capabilitiesServiceMock.createSetupContract(), + context: contextServiceMock.createSetupContract(), + docLinks: docLinksServiceMock.createSetupContract(), + elasticsearch: elasticsearchServiceMock.createInternalSetup(), + http: httpServiceMock.createInternalSetupContract(), + savedObjects: savedObjectsServiceMock.createInternalSetupContract(), + status: statusServiceMock.createInternalSetupContract(), + environment: environmentServiceMock.createSetupContract(), + i18n: i18nServiceMock.createSetupContract(), + httpResources: httpResourcesMock.createSetupContract(), + rendering: renderingServiceMock.createSetupContract(), + uiSettings: uiSettingsServiceMock.createSetupContract(), + logging: loggingServiceMock.createInternalSetupContract(), + metrics: metricsServiceMock.createInternalSetupContract(), + deprecations: deprecationsServiceMock.createInternalSetupContract(), + executionContext: executionContextServiceMock.createInternalSetupContract(), + coreUsageData: coreUsageDataServiceMock.createSetupContract(), + }; + return setupDeps; +} diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/src/internal_core_start.mock.ts b/packages/core/lifecycle/core-lifecycle-server-mocks/src/internal_core_start.mock.ts new file mode 100644 index 0000000000000..6283fa3ce6a88 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/src/internal_core_start.mock.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { analyticsServiceMock } from '@kbn/core-analytics-server-mocks'; +import { capabilitiesServiceMock } from '@kbn/core-capabilities-server-mocks'; +import { deprecationsServiceMock } from '@kbn/core-deprecations-server-mocks'; +import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; +import { metricsServiceMock } from '@kbn/core-metrics-server-mocks'; +import { savedObjectsServiceMock } from '@kbn/core-saved-objects-server-mocks'; +import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; +import { coreUsageDataServiceMock } from '@kbn/core-usage-data-server-mocks'; + +export function createInternalCoreStartMock() { + const startDeps = { + analytics: analyticsServiceMock.createAnalyticsServiceStart(), + capabilities: capabilitiesServiceMock.createStartContract(), + docLinks: docLinksServiceMock.createStartContract(), + elasticsearch: elasticsearchServiceMock.createInternalStart(), + http: httpServiceMock.createInternalStartContract(), + metrics: metricsServiceMock.createInternalStartContract(), + savedObjects: savedObjectsServiceMock.createInternalStartContract(), + uiSettings: uiSettingsServiceMock.createStartContract(), + coreUsageData: coreUsageDataServiceMock.createStartContract(), + executionContext: executionContextServiceMock.createInternalStartContract(), + deprecations: deprecationsServiceMock.createInternalStartContract(), + }; + return startDeps; +} diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/tsconfig.json b/packages/core/lifecycle/core-lifecycle-server-mocks/tsconfig.json new file mode 100644 index 0000000000000..4582562d6c9bb --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/lifecycle/core-lifecycle-server/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-server/BUILD.bazel new file mode 100644 index 0000000000000..ad8be070d8fa0 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/BUILD.bazel @@ -0,0 +1,120 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-lifecycle-server" +PKG_REQUIRE_NAME = "@kbn/core-lifecycle-server" + +SOURCE_FILES = glob( + [ + "**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "//packages/core/analytics/core-analytics-server:npm_module_types", + "//packages/core/capabilities/core-capabilities-server:npm_module_types", + "//packages/core/deprecations/core-deprecations-server:npm_module_types", + "//packages/core/doc-links/core-doc-links-server:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", + "//packages/core/execution-context/core-execution-context-server:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", + "//packages/core/http/core-http-request-handler-context-server:npm_module_types", + "//packages/core/http/core-http-resources-server:npm_module_types", + "//packages/core/i18n/core-i18n-server:npm_module_types", + "//packages/core/logging/core-logging-server:npm_module_types", + "//packages/core/metrics/core-metrics-server:npm_module_types", + "//packages/core/preboot/core-preboot-server:npm_module_types", + "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", + "//packages/core/status/core-status-server:npm_module_types", + "//packages/core/ui-settings/core-ui-settings-server:npm_module_types", + "//packages/core/usage-data/core-usage-data-server:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/lifecycle/core-lifecycle-server/README.md b/packages/core/lifecycle/core-lifecycle-server/README.md new file mode 100644 index 0000000000000..5d06aa257f81f --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/README.md @@ -0,0 +1,7 @@ +# @kbn/core-lifecycle-server + +This package contains the public types for core's server-side lifecycle contracts and services accessor: +- `CorePreboot` +- `CoreSetup` +- `CoreStart` +- `StartServicesAccessor` diff --git a/packages/core/lifecycle/core-lifecycle-server/index.ts b/packages/core/lifecycle/core-lifecycle-server/index.ts new file mode 100644 index 0000000000000..5e8b379724036 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { CorePreboot, CoreSetup, CoreStart, StartServicesAccessor } from './src'; diff --git a/packages/core/lifecycle/core-lifecycle-server/jest.config.js b/packages/core/lifecycle/core-lifecycle-server/jest.config.js new file mode 100644 index 0000000000000..3d48a32bd7610 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/lifecycle/core-lifecycle-server'], +}; diff --git a/packages/core/lifecycle/core-lifecycle-server/kibana.jsonc b/packages/core/lifecycle/core-lifecycle-server/kibana.jsonc new file mode 100644 index 0000000000000..867db6cc2dab0 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-lifecycle-server", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/lifecycle/core-lifecycle-server/package.json b/packages/core/lifecycle/core-lifecycle-server/package.json new file mode 100644 index 0000000000000..e594d4972e6c8 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/package.json @@ -0,0 +1,9 @@ +{ + "name": "@kbn/core-lifecycle-server", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts b/packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts new file mode 100644 index 0000000000000..893854149d7d2 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/src/core_preboot.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { AnalyticsServicePreboot } from '@kbn/core-analytics-server'; +import type { HttpServicePreboot } from '@kbn/core-http-server'; +import type { PrebootServicePreboot } from '@kbn/core-preboot-server'; +import type { ElasticsearchServicePreboot } from '@kbn/core-elasticsearch-server'; +import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; + +/** + * Context passed to the `setup` method of `preboot` plugins. + * @public + */ +export interface CorePreboot { + /** {@link AnalyticsServicePreboot} */ + analytics: AnalyticsServicePreboot; + /** {@link ElasticsearchServicePreboot} */ + elasticsearch: ElasticsearchServicePreboot; + /** {@link HttpServicePreboot} */ + http: HttpServicePreboot; + /** {@link PrebootServicePreboot} */ + preboot: PrebootServicePreboot; +} diff --git a/packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts b/packages/core/lifecycle/core-lifecycle-server/src/core_setup.ts new file mode 100644 index 0000000000000..1565e11b13777 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/src/core_setup.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AnalyticsServiceSetup } from '@kbn/core-analytics-server'; +import { CapabilitiesSetup } from '@kbn/core-capabilities-server'; +import { DeprecationsServiceSetup } from '@kbn/core-deprecations-server'; +import { DocLinksServiceSetup } from '@kbn/core-doc-links-server'; +import { ElasticsearchServiceSetup } from '@kbn/core-elasticsearch-server'; +import { ExecutionContextSetup } from '@kbn/core-execution-context-server'; +import { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; +import { HttpResources } from '@kbn/core-http-resources-server'; +import { HttpServiceSetup } from '@kbn/core-http-server'; +import { I18nServiceSetup } from '@kbn/core-i18n-server'; +import { LoggingServiceSetup } from '@kbn/core-logging-server'; +import { MetricsServiceSetup } from '@kbn/core-metrics-server'; +import { SavedObjectsServiceSetup } from '@kbn/core-saved-objects-server'; +import { StatusServiceSetup } from '@kbn/core-status-server'; +import { UiSettingsServiceSetup } from '@kbn/core-ui-settings-server'; +import { CoreUsageDataSetup } from '@kbn/core-usage-data-server'; +import { CoreStart } from './core_start'; + +/** + * Context passed to the `setup` method of `standard` plugins. + * + * @typeParam TPluginsStart - the type of the consuming plugin's start dependencies. Should be the same + * as the consuming {@link Plugin}'s `TPluginsStart` type. Used by `getStartServices`. + * @typeParam TStart - the type of the consuming plugin's start contract. Should be the same as the + * consuming {@link Plugin}'s `TStart` type. Used by `getStartServices`. + * @public + */ +export interface CoreSetup { + /** {@link AnalyticsServiceSetup} */ + analytics: AnalyticsServiceSetup; + /** {@link CapabilitiesSetup} */ + capabilities: CapabilitiesSetup; + /** {@link DocLinksServiceSetup} */ + docLinks: DocLinksServiceSetup; + /** {@link ElasticsearchServiceSetup} */ + elasticsearch: ElasticsearchServiceSetup; + /** {@link ExecutionContextSetup} */ + executionContext: ExecutionContextSetup; + /** {@link HttpServiceSetup} */ + http: HttpServiceSetup & { + /** {@link HttpResources} */ + resources: HttpResources; + }; + /** {@link I18nServiceSetup} */ + i18n: I18nServiceSetup; + /** {@link LoggingServiceSetup} */ + logging: LoggingServiceSetup; + /** {@link MetricsServiceSetup} */ + metrics: MetricsServiceSetup; + /** {@link SavedObjectsServiceSetup} */ + savedObjects: SavedObjectsServiceSetup; + /** {@link StatusServiceSetup} */ + status: StatusServiceSetup; + /** {@link UiSettingsServiceSetup} */ + uiSettings: UiSettingsServiceSetup; + /** {@link DeprecationsServiceSetup} */ + deprecations: DeprecationsServiceSetup; + /** {@link StartServicesAccessor} */ + getStartServices: StartServicesAccessor; + /** @internal {@link CoreUsageDataSetup} */ + coreUsageData: CoreUsageDataSetup; +} + +/** + * Allows plugins to get access to APIs available in start inside async handlers. + * Promise will not resolve until Core and plugin dependencies have completed `start`. + * This should only be used inside handlers registered during `setup` that will only be executed + * after `start` lifecycle. + * + * @public + */ +export type StartServicesAccessor< + TPluginsStart extends object = object, + TStart = unknown +> = () => Promise<[CoreStart, TPluginsStart, TStart]>; diff --git a/packages/core/lifecycle/core-lifecycle-server/src/core_start.ts b/packages/core/lifecycle/core-lifecycle-server/src/core_start.ts new file mode 100644 index 0000000000000..53c989154af08 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/src/core_start.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AnalyticsServiceStart } from '@kbn/core-analytics-server'; +import { CapabilitiesStart } from '@kbn/core-capabilities-server'; +import { DocLinksServiceStart } from '@kbn/core-doc-links-server'; +import { ElasticsearchServiceStart } from '@kbn/core-elasticsearch-server'; +import { ExecutionContextStart } from '@kbn/core-execution-context-server'; +import { HttpServiceStart } from '@kbn/core-http-server'; +import { MetricsServiceStart } from '@kbn/core-metrics-server'; +import { SavedObjectsServiceStart } from '@kbn/core-saved-objects-server'; +import { UiSettingsServiceStart } from '@kbn/core-ui-settings-server'; +import { CoreUsageDataStart } from '@kbn/core-usage-data-server'; + +/** + * Context passed to the plugins `start` method. + * + * @public + */ +export interface CoreStart { + /** {@link AnalyticsServiceStart} */ + analytics: AnalyticsServiceStart; + /** {@link CapabilitiesStart} */ + capabilities: CapabilitiesStart; + /** {@link DocLinksServiceStart} */ + docLinks: DocLinksServiceStart; + /** {@link ElasticsearchServiceStart} */ + elasticsearch: ElasticsearchServiceStart; + /** {@link ExecutionContextStart} */ + executionContext: ExecutionContextStart; + /** {@link HttpServiceStart} */ + http: HttpServiceStart; + /** {@link MetricsServiceStart} */ + metrics: MetricsServiceStart; + /** {@link SavedObjectsServiceStart} */ + savedObjects: SavedObjectsServiceStart; + /** {@link UiSettingsServiceStart} */ + uiSettings: UiSettingsServiceStart; + /** @internal {@link CoreUsageDataStart} */ + coreUsageData: CoreUsageDataStart; +} diff --git a/packages/core/lifecycle/core-lifecycle-server/src/index.ts b/packages/core/lifecycle/core-lifecycle-server/src/index.ts new file mode 100644 index 0000000000000..37f4a6c60fd14 --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/src/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +export type { CorePreboot } from './core_preboot'; +export type { CoreSetup, StartServicesAccessor } from './core_setup'; +export type { CoreStart } from './core_start'; diff --git a/packages/core/lifecycle/core-lifecycle-server/tsconfig.json b/packages/core/lifecycle/core-lifecycle-server/tsconfig.json new file mode 100644 index 0000000000000..4582562d6c9bb --- /dev/null +++ b/packages/core/lifecycle/core-lifecycle-server/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/logging/core-logging-browser-internal/BUILD.bazel b/packages/core/logging/core-logging-browser-internal/BUILD.bazel new file mode 100644 index 0000000000000..b707b68279e4b --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/BUILD.bazel @@ -0,0 +1,114 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-logging-browser-internal" +PKG_REQUIRE_NAME = "@kbn/core-logging-browser-internal" + +SOURCE_FILES = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "//packages/core/logging/core-logging-common-internal", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "//packages/kbn-logging:npm_module_types", + "//packages/core/logging/core-logging-common-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/logging/core-logging-browser-internal/README.md b/packages/core/logging/core-logging-browser-internal/README.md new file mode 100644 index 0000000000000..7888115e20cbe --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/README.md @@ -0,0 +1,3 @@ +# @kbn/core-logging-browser-internal + +This package contains the internal types and implementation for Core's browser-side logging service. diff --git a/packages/core/logging/core-logging-browser-internal/index.ts b/packages/core/logging/core-logging-browser-internal/index.ts new file mode 100644 index 0000000000000..f757b7f6ce38e --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { BaseLogger, BrowserLoggingSystem, type IBrowserLoggingSystem } from './src'; diff --git a/packages/core/logging/core-logging-browser-internal/jest.config.js b/packages/core/logging/core-logging-browser-internal/jest.config.js new file mode 100644 index 0000000000000..aec2a0f4d8e2d --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/packages/core/logging/core-logging-browser-internal'], +}; diff --git a/packages/core/logging/core-logging-browser-internal/kibana.jsonc b/packages/core/logging/core-logging-browser-internal/kibana.jsonc new file mode 100644 index 0000000000000..6d60078e34da8 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-logging-browser-internal", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/logging/core-logging-browser-internal/package.json b/packages/core/logging/core-logging-browser-internal/package.json new file mode 100644 index 0000000000000..56cf9d28f32b2 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/package.json @@ -0,0 +1,10 @@ +{ + "name": "@kbn/core-logging-browser-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.test.ts b/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.test.ts new file mode 100644 index 0000000000000..8b8900be8e035 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogRecord, LogLevel } from '@kbn/logging'; +import { ConsoleAppender } from './console_appender'; + +test('`append()` correctly formats records and pushes them to console.', () => { + jest.spyOn(global.console, 'log').mockImplementation(() => { + // noop + }); + + const records: LogRecord[] = [ + { + context: 'context-1', + level: LogLevel.All, + message: 'message-1', + timestamp: new Date(), + pid: 5355, + }, + { + context: 'context-2', + level: LogLevel.Trace, + message: 'message-2', + timestamp: new Date(), + pid: 5355, + }, + { + context: 'context-3', + error: new Error('Error'), + level: LogLevel.Fatal, + message: 'message-3', + timestamp: new Date(), + pid: 5355, + }, + ]; + + const appender = new ConsoleAppender({ + format(record) { + return `mock-${JSON.stringify(record)}`; + }, + }); + + for (const record of records) { + appender.append(record); + // eslint-disable-next-line no-console + expect(console.log).toHaveBeenCalledWith(`mock-${JSON.stringify(record)}`); + } + + // eslint-disable-next-line no-console + expect(console.log).toHaveBeenCalledTimes(records.length); +}); diff --git a/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.ts b/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.ts new file mode 100644 index 0000000000000..4d35f3150b421 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { Layout, LogRecord, DisposableAppender } from '@kbn/logging'; + +/** + * + * Appender that formats all the `LogRecord` instances it receives and logs them via built-in `console`. + * @internal + */ +export class ConsoleAppender implements DisposableAppender { + /** + * Creates ConsoleAppender instance. + * @param layout Instance of `Layout` sub-class responsible for `LogRecord` formatting. + */ + constructor(private readonly layout: Layout) {} + + /** + * Formats specified `record` and logs it via built-in `console`. + * @param record `LogRecord` instance to be logged. + */ + public append(record: LogRecord) { + // eslint-disable-next-line no-console + console.log(this.layout.format(record)); + } + + /** + * Disposes `ConsoleAppender`. + */ + public dispose() { + // noop + } +} diff --git a/packages/core/logging/core-logging-browser-internal/src/appenders/index.ts b/packages/core/logging/core-logging-browser-internal/src/appenders/index.ts new file mode 100644 index 0000000000000..070f5fb429c87 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/appenders/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { ConsoleAppender } from './console_appender'; diff --git a/packages/core/logging/core-logging-browser-internal/src/index.ts b/packages/core/logging/core-logging-browser-internal/src/index.ts new file mode 100644 index 0000000000000..618d4dd8a7ef4 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { BaseLogger } from './logger'; +export { BrowserLoggingSystem, type IBrowserLoggingSystem } from './logging_system'; diff --git a/packages/core/logging/core-logging-browser-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap b/packages/core/logging/core-logging-browser-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap new file mode 100644 index 0000000000000..d3f9309a4773c --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`\`format()\` correctly formats record with custom pattern. 1`] = `"mock-Some error stack-context-1-Some error stack"`; + +exports[`\`format()\` correctly formats record with custom pattern. 2`] = `"mock-message-2-context-2-message-2"`; + +exports[`\`format()\` correctly formats record with custom pattern. 3`] = `"mock-message-3-context-3-message-3"`; + +exports[`\`format()\` correctly formats record with custom pattern. 4`] = `"mock-message-4-context-4-message-4"`; + +exports[`\`format()\` correctly formats record with custom pattern. 5`] = `"mock-message-5-context-5-message-5"`; + +exports[`\`format()\` correctly formats record with custom pattern. 6`] = `"mock-message-6-context-6-message-6"`; + +exports[`\`format()\` correctly formats record with full pattern. 1`] = `"[2012-02-01T09:30:22.011-05:00][FATAL][context-1] Some error stack"`; + +exports[`\`format()\` correctly formats record with full pattern. 2`] = `"[2012-02-01T09:30:22.011-05:00][ERROR][context-2] message-2"`; + +exports[`\`format()\` correctly formats record with full pattern. 3`] = `"[2012-02-01T09:30:22.011-05:00][WARN ][context-3] message-3"`; + +exports[`\`format()\` correctly formats record with full pattern. 4`] = `"[2012-02-01T09:30:22.011-05:00][DEBUG][context-4] message-4"`; + +exports[`\`format()\` correctly formats record with full pattern. 5`] = `"[2012-02-01T09:30:22.011-05:00][INFO ][context-5] message-5"`; + +exports[`\`format()\` correctly formats record with full pattern. 6`] = `"[2012-02-01T09:30:22.011-05:00][TRACE][context-6] message-6"`; + +exports[`allows specifying the PID in custom pattern 1`] = `"%pid-context-1-Some error stack"`; + +exports[`allows specifying the PID in custom pattern 2`] = `"%pid-context-2-message-2"`; + +exports[`allows specifying the PID in custom pattern 3`] = `"%pid-context-3-message-3"`; + +exports[`allows specifying the PID in custom pattern 4`] = `"%pid-context-4-message-4"`; + +exports[`allows specifying the PID in custom pattern 5`] = `"%pid-context-5-message-5"`; + +exports[`allows specifying the PID in custom pattern 6`] = `"%pid-context-6-message-6"`; diff --git a/packages/core/logging/core-logging-browser-internal/src/layouts/index.ts b/packages/core/logging/core-logging-browser-internal/src/layouts/index.ts new file mode 100644 index 0000000000000..75591053d34d7 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/layouts/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { PatternLayout } from './pattern_layout'; diff --git a/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.test.ts b/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.test.ts new file mode 100644 index 0000000000000..eb0961960b17f --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.test.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import stripAnsi from 'strip-ansi'; +import hasAnsi from 'has-ansi'; +import { LogLevel, LogRecord } from '@kbn/logging'; +import { PatternLayout } from './pattern_layout'; + +const stripAnsiSnapshotSerializer: jest.SnapshotSerializerPlugin = { + serialize(value: string) { + return stripAnsi(value); + }, + + test(value: any) { + return typeof value === 'string' && hasAnsi(value); + }, +}; + +const timestamp = new Date(Date.UTC(2012, 1, 1, 14, 30, 22, 11)); +const records: LogRecord[] = [ + { + context: 'context-1', + error: { + message: 'Some error message', + name: 'Some error name', + stack: 'Some error stack', + }, + level: LogLevel.Fatal, + message: 'message-1', + timestamp, + pid: 5355, + }, + { + context: 'context-2', + level: LogLevel.Error, + message: 'message-2', + timestamp, + pid: 5355, + }, + { + context: 'context-3', + level: LogLevel.Warn, + message: 'message-3', + timestamp, + pid: 5355, + }, + { + context: 'context-4', + level: LogLevel.Debug, + message: 'message-4', + timestamp, + pid: 5355, + }, + { + context: 'context-5', + level: LogLevel.Info, + message: 'message-5', + timestamp, + pid: 5355, + }, + { + context: 'context-6', + level: LogLevel.Trace, + message: 'message-6', + timestamp, + pid: 5355, + }, +]; + +expect.addSnapshotSerializer(stripAnsiSnapshotSerializer); + +test('`format()` correctly formats record with full pattern.', () => { + const layout = new PatternLayout(); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` correctly formats record with custom pattern.', () => { + const layout = new PatternLayout('mock-%message-%logger-%message'); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` correctly formats record with meta data.', () => { + const layout = new PatternLayout('[%date][%level][%logger]%meta %message'); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + meta: { + // @ts-expect-error not valid ECS field + from: 'v7', + to: 'v8', + }, + }) + ).toBe( + '[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta]{"from":"v7","to":"v8"} message-meta' + ); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + meta: {}, + }) + ).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta]{} message-meta'); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + }) + ).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta] message-meta'); +}); + +test('allows specifying the PID in custom pattern', () => { + const layout = new PatternLayout('%pid-%logger-%message'); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` allows specifying pattern with meta.', () => { + const layout = new PatternLayout('%logger-%meta-%message'); + const record = { + context: 'context', + level: LogLevel.Debug, + message: 'message', + timestamp, + pid: 5355, + meta: { + from: 'v7', + to: 'v8', + }, + }; + // @ts-expect-error not valid ECS field + expect(layout.format(record)).toBe('context-{"from":"v7","to":"v8"}-message'); +}); + +describe('format', () => { + describe('timestamp', () => { + const record = { + context: 'context', + level: LogLevel.Debug, + message: 'message', + timestamp, + pid: 5355, + }; + it('uses ISO8601_TZ as default', () => { + const layout = new PatternLayout(); + + expect(layout.format(record)).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context] message'); + }); + + describe('supports specifying a predefined format', () => { + it('ISO8601', () => { + const layout = new PatternLayout('[%date{ISO8601}][%logger]'); + + expect(layout.format(record)).toBe('[2012-02-01T14:30:22.011Z][context]'); + }); + + it('ISO8601_TZ', () => { + const layout = new PatternLayout('[%date{ISO8601_TZ}][%logger]'); + + expect(layout.format(record)).toBe('[2012-02-01T09:30:22.011-05:00][context]'); + }); + + it('ABSOLUTE', () => { + const layout = new PatternLayout('[%date{ABSOLUTE}][%logger]'); + + expect(layout.format(record)).toBe('[09:30:22.011][context]'); + }); + + it('UNIX', () => { + const layout = new PatternLayout('[%date{UNIX}][%logger]'); + + expect(layout.format(record)).toBe('[1328106622][context]'); + }); + + it('UNIX_MILLIS', () => { + const layout = new PatternLayout('[%date{UNIX_MILLIS}][%logger]'); + + expect(layout.format(record)).toBe('[1328106622011][context]'); + }); + }); + + describe('supports specifying a predefined format and timezone', () => { + it('ISO8601', () => { + const layout = new PatternLayout('[%date{ISO8601}{America/Los_Angeles}][%logger]'); + + expect(layout.format(record)).toBe('[2012-02-01T14:30:22.011Z][context]'); + }); + + it('ISO8601_TZ', () => { + const layout = new PatternLayout('[%date{ISO8601_TZ}{America/Los_Angeles}][%logger]'); + + expect(layout.format(record)).toBe('[2012-02-01T06:30:22.011-08:00][context]'); + }); + + it('ABSOLUTE', () => { + const layout = new PatternLayout('[%date{ABSOLUTE}{America/Los_Angeles}][%logger]'); + + expect(layout.format(record)).toBe('[06:30:22.011][context]'); + }); + + it('UNIX', () => { + const layout = new PatternLayout('[%date{UNIX}{America/Los_Angeles}][%logger]'); + + expect(layout.format(record)).toBe('[1328106622][context]'); + }); + + it('UNIX_MILLIS', () => { + const layout = new PatternLayout('[%date{UNIX_MILLIS}{America/Los_Angeles}][%logger]'); + + expect(layout.format(record)).toBe('[1328106622011][context]'); + }); + }); + it('formats several conversions patterns correctly', () => { + const layout = new PatternLayout( + '[%date{ABSOLUTE}{America/Los_Angeles}][%logger][%date{UNIX}]' + ); + + expect(layout.format(record)).toBe('[06:30:22.011][context][1328106622]'); + }); + }); +}); diff --git a/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.ts b/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.ts new file mode 100644 index 0000000000000..0efdf33afabb4 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + PatternLayout as BasePatternLayout, + type Conversion, + LoggerConversion, + LevelConversion, + MetaConversion, + MessageConversion, + DateConversion, +} from '@kbn/core-logging-common-internal'; + +const DEFAULT_PATTERN = `[%date][%level][%logger] %message`; + +const conversions: Conversion[] = [ + LoggerConversion, + MessageConversion, + LevelConversion, + MetaConversion, + DateConversion, +]; + +/** + * Layout that formats `LogRecord` using the `pattern` string with optional + * color highlighting (eg. to make log messages easier to read in the terminal). + * @internal + */ +export class PatternLayout extends BasePatternLayout { + constructor(pattern: string = DEFAULT_PATTERN) { + super({ + pattern, + highlight: false, + conversions, + }); + } +} diff --git a/packages/core/logging/core-logging-browser-internal/src/logger.test.ts b/packages/core/logging/core-logging-browser-internal/src/logger.test.ts new file mode 100644 index 0000000000000..7c9606264602a --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/logger.test.ts @@ -0,0 +1,431 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogLevel, Appender } from '@kbn/logging'; +import { getLoggerContext } from '@kbn/core-logging-common-internal'; +import { BaseLogger, BROWSER_PID } from './logger'; + +const context = getLoggerContext(['context', 'parent', 'child']); +let appenderMocks: Appender[]; +let logger: BaseLogger; +const factory = { + get: jest.fn().mockImplementation(() => logger), +}; + +const timestamp = new Date(2012, 1, 1); +beforeEach(() => { + jest.spyOn(global, 'Date').mockImplementation(() => timestamp); + + appenderMocks = [{ append: jest.fn() }, { append: jest.fn() }]; + logger = new BaseLogger(context, LogLevel.All, appenderMocks, factory); +}); + +afterEach(() => { + jest.resetAllMocks(); + jest.restoreAllMocks(); +}); + +test('`trace()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.trace('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Trace, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.trace('message-2', { trace: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Trace, + message: 'message-2', + meta: { trace: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`debug()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.debug('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Debug, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.debug('message-2', { debug: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Debug, + message: 'message-2', + meta: { debug: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`info()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.info('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Info, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.info('message-2', { info: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Info, + message: 'message-2', + meta: { info: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`warn()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.warn('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Warn, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + const error = new Error('message-2'); + logger.warn(error); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error, + level: LogLevel.Warn, + message: 'message-2', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.warn('message-3', { warn: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Warn, + message: 'message-3', + meta: { warn: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`error()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.error('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Error, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + const error = new Error('message-2'); + logger.error(error); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error, + level: LogLevel.Error, + message: 'message-2', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.error('message-3', { error: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Error, + message: 'message-3', + meta: { error: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`fatal()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.fatal('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Fatal, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + const error = new Error('message-2'); + logger.fatal(error); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error, + level: LogLevel.Fatal, + message: 'message-2', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.fatal('message-3', { fatal: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Fatal, + message: 'message-3', + meta: { fatal: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`log()` just passes the record to all appenders.', () => { + const record = { + context, + level: LogLevel.Info, + message: 'message-1', + timestamp, + pid: 5355, + }; + + logger.log(record); + + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(record); + } +}); + +test('`get()` calls the logger factory with proper context and return the result', () => { + logger.get('sub', 'context'); + expect(factory.get).toHaveBeenCalledTimes(1); + expect(factory.get).toHaveBeenCalledWith(context, 'sub', 'context'); + + factory.get.mockClear(); + factory.get.mockImplementation(() => 'some-logger'); + + const childLogger = logger.get('other', 'sub'); + expect(factory.get).toHaveBeenCalledTimes(1); + expect(factory.get).toHaveBeenCalledWith(context, 'other', 'sub'); + expect(childLogger).toEqual('some-logger'); +}); + +test('logger with `Off` level does not pass any records to appenders.', () => { + const turnedOffLogger = new BaseLogger(context, LogLevel.Off, appenderMocks, factory); + turnedOffLogger.trace('trace-message'); + turnedOffLogger.debug('debug-message'); + turnedOffLogger.info('info-message'); + turnedOffLogger.warn('warn-message'); + turnedOffLogger.error('error-message'); + turnedOffLogger.fatal('fatal-message'); + + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).not.toHaveBeenCalled(); + } +}); + +test('logger with `All` level passes all records to appenders.', () => { + const catchAllLogger = new BaseLogger(context, LogLevel.All, appenderMocks, factory); + + catchAllLogger.trace('trace-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Trace, + message: 'trace-message', + timestamp, + pid: BROWSER_PID, + }); + } + + catchAllLogger.debug('debug-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Debug, + message: 'debug-message', + timestamp, + pid: BROWSER_PID, + }); + } + + catchAllLogger.info('info-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Info, + message: 'info-message', + timestamp, + pid: BROWSER_PID, + }); + } + + catchAllLogger.warn('warn-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(4); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Warn, + message: 'warn-message', + timestamp, + pid: BROWSER_PID, + }); + } + + catchAllLogger.error('error-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(5); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Error, + message: 'error-message', + timestamp, + pid: BROWSER_PID, + }); + } + + catchAllLogger.fatal('fatal-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(6); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Fatal, + message: 'fatal-message', + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('passes log record to appenders only if log level is supported.', () => { + const warnLogger = new BaseLogger(context, LogLevel.Warn, appenderMocks, factory); + + warnLogger.trace('trace-message'); + warnLogger.debug('debug-message'); + warnLogger.info('info-message'); + + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).not.toHaveBeenCalled(); + } + + warnLogger.warn('warn-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Warn, + message: 'warn-message', + timestamp, + pid: BROWSER_PID, + }); + } + + warnLogger.error('error-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Error, + message: 'error-message', + timestamp, + pid: BROWSER_PID, + }); + } + + warnLogger.fatal('fatal-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Fatal, + message: 'fatal-message', + timestamp, + pid: BROWSER_PID, + }); + } +}); diff --git a/packages/core/logging/core-logging-browser-internal/src/logger.ts b/packages/core/logging/core-logging-browser-internal/src/logger.ts new file mode 100644 index 0000000000000..31c3c9f4eccb5 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/logger.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogLevel, LogRecord, LogMeta } from '@kbn/logging'; +import { AbstractLogger } from '@kbn/core-logging-common-internal'; + +function isError(x: any): x is Error { + return x instanceof Error; +} + +export const BROWSER_PID = -1; + +/** @internal */ +export class BaseLogger extends AbstractLogger { + protected createLogRecord( + level: LogLevel, + errorOrMessage: string | Error, + meta?: Meta + ): LogRecord { + if (isError(errorOrMessage)) { + return { + context: this.context, + error: errorOrMessage, + level, + message: errorOrMessage.message, + meta, + timestamp: new Date(), + pid: BROWSER_PID, + }; + } + + return { + context: this.context, + level, + message: errorOrMessage, + meta, + timestamp: new Date(), + pid: BROWSER_PID, + }; + } +} diff --git a/packages/core/logging/core-logging-browser-internal/src/logging_system.test.ts b/packages/core/logging/core-logging-browser-internal/src/logging_system.test.ts new file mode 100644 index 0000000000000..61b32002e7ae5 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/logging_system.test.ts @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { BrowserLoggingSystem } from './logging_system'; + +describe('', () => { + const timestamp = new Date(Date.UTC(2012, 1, 1, 14, 33, 22, 11)); + + let mockConsoleLog: jest.SpyInstance; + let loggingSystem: BrowserLoggingSystem; + + beforeEach(() => { + mockConsoleLog = jest.spyOn(global.console, 'log').mockReturnValue(undefined); + jest.spyOn(global, 'Date').mockImplementation(() => timestamp); + loggingSystem = new BrowserLoggingSystem({ logLevel: 'warn' }); + }); + + afterEach(() => { + mockConsoleLog.mockReset(); + }); + + describe('#get', () => { + it('returns the same logger for same context', () => { + const loggerA = loggingSystem.get('same.logger'); + const loggerB = loggingSystem.get('same.logger'); + expect(loggerA).toBe(loggerB); + }); + + it('returns different loggers for different contexts', () => { + const loggerA = loggingSystem.get('some.logger'); + const loggerB = loggingSystem.get('another.logger'); + expect(loggerA).not.toBe(loggerB); + }); + }); + + describe('logger configuration', () => { + it('properly configure the logger to use the correct context and pattern', () => { + const logger = loggingSystem.get('foo.bar'); + logger.warn('some message'); + + expect(mockConsoleLog.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "[2012-02-01T09:33:22.011-05:00][WARN ][foo.bar] some message", + ] + `); + }); + + it('properly configure the logger to use the correct level', () => { + const logger = loggingSystem.get('foo.bar'); + logger.trace('some trace message'); + logger.debug('some debug message'); + logger.info('some info message'); + logger.warn('some warn message'); + logger.error('some error message'); + logger.fatal('some fatal message'); + + expect(mockConsoleLog.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + "[2012-02-01T04:33:22.011-05:00][WARN ][foo.bar] some warn message", + ], + Array [ + "[2012-01-31T23:33:22.011-05:00][ERROR][foo.bar] some error message", + ], + Array [ + "[2012-01-31T18:33:22.011-05:00][FATAL][foo.bar] some fatal message", + ], + ] + `); + }); + }); +}); diff --git a/packages/core/logging/core-logging-browser-internal/src/logging_system.ts b/packages/core/logging/core-logging-browser-internal/src/logging_system.ts new file mode 100644 index 0000000000000..50f7c449996ba --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/logging_system.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogLevel, Logger, LoggerFactory, LogLevelId, DisposableAppender } from '@kbn/logging'; +import { getLoggerContext } from '@kbn/core-logging-common-internal'; +import type { LoggerConfigType } from './types'; +import { BaseLogger } from './logger'; +import { PatternLayout } from './layouts'; +import { ConsoleAppender } from './appenders'; + +export interface BrowserLoggingConfig { + logLevel: LogLevelId; +} + +const CONSOLE_APPENDER_ID = 'console'; + +/** + * @internal + */ +export interface IBrowserLoggingSystem extends LoggerFactory { + asLoggerFactory(): LoggerFactory; +} + +/** + * @internal + */ +export class BrowserLoggingSystem implements IBrowserLoggingSystem { + private readonly loggers: Map = new Map(); + private readonly appenders: Map = new Map(); + + constructor(private readonly loggingConfig: BrowserLoggingConfig) { + this.setupSystem(loggingConfig); + } + + public get(...contextParts: string[]): Logger { + const context = getLoggerContext(contextParts); + if (!this.loggers.has(context)) { + this.loggers.set(context, this.createLogger(context)); + } + return this.loggers.get(context)!; + } + + private createLogger(context: string) { + const { level, appenders } = this.getLoggerConfigByContext(context); + const loggerLevel = LogLevel.fromId(level); + const loggerAppenders = appenders.map((appenderKey) => this.appenders.get(appenderKey)!); + return new BaseLogger(context, loggerLevel, loggerAppenders, this.asLoggerFactory()); + } + + private getLoggerConfigByContext(context: string): LoggerConfigType { + return { + level: this.loggingConfig.logLevel, + appenders: [CONSOLE_APPENDER_ID], + name: context, + }; + } + + private setupSystem(loggingConfig: BrowserLoggingConfig) { + const consoleAppender = new ConsoleAppender(new PatternLayout()); + this.appenders.set(CONSOLE_APPENDER_ID, consoleAppender); + } + + /** + * Safe wrapper that allows passing logging service as immutable LoggerFactory. + */ + public asLoggerFactory(): LoggerFactory { + return { get: (...contextParts: string[]) => this.get(...contextParts) }; + } +} diff --git a/packages/core/logging/core-logging-browser-internal/src/types.ts b/packages/core/logging/core-logging-browser-internal/src/types.ts new file mode 100644 index 0000000000000..29ef977f2f28f --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/types.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogLevelId } from '@kbn/logging'; + +/** + * Describes the configuration of a given logger. + * + * @public + */ +export interface LoggerConfigType { + appenders: string[]; + name: string; + level: LogLevelId; +} diff --git a/packages/core/logging/core-logging-browser-internal/tsconfig.json b/packages/core/logging/core-logging-browser-internal/tsconfig.json new file mode 100644 index 0000000000000..fbd1249f66205 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "types": [ + "jest", + "node", + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/logging/core-logging-browser-mocks/BUILD.bazel b/packages/core/logging/core-logging-browser-mocks/BUILD.bazel new file mode 100644 index 0000000000000..a5e2c1ac54b19 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/BUILD.bazel @@ -0,0 +1,115 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-logging-browser-mocks" +PKG_REQUIRE_NAME = "@kbn/core-logging-browser-mocks" + +SOURCE_FILES = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/*.config.js", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//react", + "//packages/kbn-logging-mocks", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/react", + "//packages/kbn-logging-mocks:npm_module_types", + "//packages/core/logging/core-logging-browser-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/logging/core-logging-browser-mocks/README.md b/packages/core/logging/core-logging-browser-mocks/README.md new file mode 100644 index 0000000000000..eeb456fe2379c --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/core-logging-browser-mocks + +This package contains the mocks for Core's browser-side logging service. diff --git a/packages/core/logging/core-logging-browser-mocks/index.ts b/packages/core/logging/core-logging-browser-mocks/index.ts new file mode 100644 index 0000000000000..a8b4c9ff1a2fa --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { loggingSystemMock } from './src'; diff --git a/packages/core/logging/core-logging-browser-mocks/jest.config.js b/packages/core/logging/core-logging-browser-mocks/jest.config.js new file mode 100644 index 0000000000000..47449390afd03 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/packages/core/logging/core-logging-browser-mocks'], +}; diff --git a/packages/core/logging/core-logging-browser-mocks/kibana.jsonc b/packages/core/logging/core-logging-browser-mocks/kibana.jsonc new file mode 100644 index 0000000000000..377320816c652 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-logging-browser-mocks", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/logging/core-logging-browser-mocks/package.json b/packages/core/logging/core-logging-browser-mocks/package.json new file mode 100644 index 0000000000000..8ab9610e35470 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/package.json @@ -0,0 +1,10 @@ +{ + "name": "@kbn/core-logging-browser-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/logging/core-logging-browser-mocks/src/index.ts b/packages/core/logging/core-logging-browser-mocks/src/index.ts new file mode 100644 index 0000000000000..07ff934f94dfa --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { loggingSystemMock } from './logging_system.mock'; diff --git a/packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts b/packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts new file mode 100644 index 0000000000000..333b2cbb7bb8a --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { loggerMock, MockedLogger } from '@kbn/logging-mocks'; +import type { IBrowserLoggingSystem } from '@kbn/core-logging-browser-internal'; + +const createLoggingSystemMock = () => { + const mockLog: MockedLogger = loggerMock.create(); + + mockLog.get.mockImplementation((...context) => ({ + ...mockLog, + context, + })); + + const mocked: jest.Mocked = { + get: jest.fn(), + asLoggerFactory: jest.fn(), + }; + + mocked.get.mockImplementation((...context) => ({ + ...mockLog, + context, + })); + mocked.asLoggerFactory.mockImplementation(() => mocked); + + return mocked; +}; + +export const loggingSystemMock = { + create: createLoggingSystemMock, + createLogger: loggerMock.create, +}; diff --git a/packages/core/logging/core-logging-browser-mocks/tsconfig.json b/packages/core/logging/core-logging-browser-mocks/tsconfig.json new file mode 100644 index 0000000000000..37f8e83d0d7a6 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ] +} diff --git a/packages/core/logging/core-logging-common-internal/BUILD.bazel b/packages/core/logging/core-logging-common-internal/BUILD.bazel new file mode 100644 index 0000000000000..3c392281b23a6 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/BUILD.bazel @@ -0,0 +1,116 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-logging-common-internal" +PKG_REQUIRE_NAME = "@kbn/core-logging-common-internal" + +SOURCE_FILES = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//lodash", + "@npm//moment-timezone", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/moment-timezone", + "@npm//lodash", + "//packages/kbn-logging:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/logging/core-logging-common-internal/README.md b/packages/core/logging/core-logging-common-internal/README.md new file mode 100644 index 0000000000000..9358b0009781b --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/README.md @@ -0,0 +1,3 @@ +# @kbn/core-logging-common-internal + +This package contains common types and the base implementation for the browser and server-side logging systems. diff --git a/packages/core/logging/core-logging-common-internal/index.ts b/packages/core/logging/core-logging-common-internal/index.ts new file mode 100644 index 0000000000000..24d5e93316789 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/index.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { + PatternLayout, + DateConversion, + LoggerConversion, + MessageConversion, + LevelConversion, + MetaConversion, + type Conversion, + AbstractLogger, + type CreateLogRecordFn, + getLoggerContext, + getParentLoggerContext, + CONTEXT_SEPARATOR, + ROOT_CONTEXT_NAME, + DEFAULT_APPENDER_NAME, +} from './src'; diff --git a/packages/core/logging/core-logging-common-internal/jest.config.js b/packages/core/logging/core-logging-common-internal/jest.config.js new file mode 100644 index 0000000000000..3a077c47c301b --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/packages/core/logging/core-logging-common-internal'], +}; diff --git a/packages/core/logging/core-logging-common-internal/kibana.jsonc b/packages/core/logging/core-logging-common-internal/kibana.jsonc new file mode 100644 index 0000000000000..353df47ee9dd0 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-logging-common-internal", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/logging/core-logging-common-internal/package.json b/packages/core/logging/core-logging-common-internal/package.json new file mode 100644 index 0000000000000..3c0aff6df7b0b --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/package.json @@ -0,0 +1,10 @@ +{ + "name": "@kbn/core-logging-common-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/logging/core-logging-common-internal/src/index.ts b/packages/core/logging/core-logging-common-internal/src/index.ts new file mode 100644 index 0000000000000..cf74f46eb6d65 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/index.ts @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { + PatternLayout, + DateConversion, + LoggerConversion, + MessageConversion, + LevelConversion, + MetaConversion, + type Conversion, +} from './layouts'; +export { AbstractLogger, type CreateLogRecordFn } from './logger'; +export { + getLoggerContext, + getParentLoggerContext, + CONTEXT_SEPARATOR, + ROOT_CONTEXT_NAME, + DEFAULT_APPENDER_NAME, +} from './logger_context'; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap b/packages/core/logging/core-logging-common-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap new file mode 100644 index 0000000000000..d3f9309a4773c --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`\`format()\` correctly formats record with custom pattern. 1`] = `"mock-Some error stack-context-1-Some error stack"`; + +exports[`\`format()\` correctly formats record with custom pattern. 2`] = `"mock-message-2-context-2-message-2"`; + +exports[`\`format()\` correctly formats record with custom pattern. 3`] = `"mock-message-3-context-3-message-3"`; + +exports[`\`format()\` correctly formats record with custom pattern. 4`] = `"mock-message-4-context-4-message-4"`; + +exports[`\`format()\` correctly formats record with custom pattern. 5`] = `"mock-message-5-context-5-message-5"`; + +exports[`\`format()\` correctly formats record with custom pattern. 6`] = `"mock-message-6-context-6-message-6"`; + +exports[`\`format()\` correctly formats record with full pattern. 1`] = `"[2012-02-01T09:30:22.011-05:00][FATAL][context-1] Some error stack"`; + +exports[`\`format()\` correctly formats record with full pattern. 2`] = `"[2012-02-01T09:30:22.011-05:00][ERROR][context-2] message-2"`; + +exports[`\`format()\` correctly formats record with full pattern. 3`] = `"[2012-02-01T09:30:22.011-05:00][WARN ][context-3] message-3"`; + +exports[`\`format()\` correctly formats record with full pattern. 4`] = `"[2012-02-01T09:30:22.011-05:00][DEBUG][context-4] message-4"`; + +exports[`\`format()\` correctly formats record with full pattern. 5`] = `"[2012-02-01T09:30:22.011-05:00][INFO ][context-5] message-5"`; + +exports[`\`format()\` correctly formats record with full pattern. 6`] = `"[2012-02-01T09:30:22.011-05:00][TRACE][context-6] message-6"`; + +exports[`allows specifying the PID in custom pattern 1`] = `"%pid-context-1-Some error stack"`; + +exports[`allows specifying the PID in custom pattern 2`] = `"%pid-context-2-message-2"`; + +exports[`allows specifying the PID in custom pattern 3`] = `"%pid-context-3-message-3"`; + +exports[`allows specifying the PID in custom pattern 4`] = `"%pid-context-4-message-4"`; + +exports[`allows specifying the PID in custom pattern 5`] = `"%pid-context-5-message-5"`; + +exports[`allows specifying the PID in custom pattern 6`] = `"%pid-context-6-message-6"`; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts new file mode 100644 index 0000000000000..024d3d26befb3 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import moment from 'moment-timezone'; +import { last } from 'lodash'; +import { LogRecord } from '@kbn/logging'; +import { Conversion } from './types'; + +const dateRegExp = /%date({(?[^}]+)})?({(?[^}]+)})?/g; + +const formats = { + ISO8601: 'ISO8601', + ISO8601_TZ: 'ISO8601_TZ', + ABSOLUTE: 'ABSOLUTE', + UNIX: 'UNIX', + UNIX_MILLIS: 'UNIX_MILLIS', +}; + +function formatDate( + date: Date, + dateFormat: string = formats.ISO8601_TZ, + timezone?: string +): string { + const momentDate = moment(date); + momentDate.tz(timezone ?? moment.tz.guess()); + + switch (dateFormat) { + case formats.ISO8601: + return momentDate.toISOString(); + case formats.ISO8601_TZ: + return momentDate.format('YYYY-MM-DDTHH:mm:ss.SSSZ'); + case formats.ABSOLUTE: + return momentDate.format('HH:mm:ss.SSS'); + case formats.UNIX: + return momentDate.format('X'); + case formats.UNIX_MILLIS: + return momentDate.format('x'); + default: + throw new Error(`Unknown format: ${dateFormat}`); + } +} + +function validateDateFormat(input: string) { + if (!Reflect.has(formats, input)) { + throw new Error( + `Date format expected one of ${Reflect.ownKeys(formats).join(', ')}, but given: ${input}` + ); + } +} + +function validateTimezone(timezone: string) { + if (moment.tz.zone(timezone)) return; + throw new Error(`Unknown timezone: ${timezone}`); +} + +function validate(rawString: string) { + for (const matched of rawString.matchAll(dateRegExp)) { + const { format, timezone } = matched.groups!; + + if (format) { + validateDateFormat(format); + } + if (timezone) { + validateTimezone(timezone); + } + } +} + +export const DateConversion: Conversion = { + pattern: dateRegExp, + convert(record: LogRecord, highlight: boolean, ...matched: any[]) { + const groups: Record = last(matched); + const { format, timezone } = groups; + + return formatDate(record.timestamp, format, timezone); + }, + validate, +}; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/conversions/index.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/index.ts new file mode 100644 index 0000000000000..3f0abcdb8f478 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { Conversion } from './types'; +export { LoggerConversion } from './logger'; +export { LevelConversion } from './level'; +export { MessageConversion } from './message'; +export { MetaConversion } from './meta'; +export { DateConversion } from './date'; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts new file mode 100644 index 0000000000000..19bd60c3a1996 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogRecord } from '@kbn/logging'; +import { Conversion } from './types'; + +export const LevelConversion: Conversion = { + pattern: /%level/g, + convert(record: LogRecord) { + const message = record.level.id.toUpperCase().padEnd(5); + return message; + }, +}; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts new file mode 100644 index 0000000000000..f7ddb98646119 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogRecord } from '@kbn/logging'; +import { Conversion } from './types'; + +export const LoggerConversion: Conversion = { + pattern: /%logger/g, + convert(record: LogRecord) { + const message = record.context; + return message; + }, +}; diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/message.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts similarity index 94% rename from packages/core/logging/core-logging-server-internal/src/layouts/conversions/message.ts rename to packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts index 009eee4d33eae..97fc4c60101ce 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/message.ts +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts @@ -7,7 +7,7 @@ */ import { LogRecord } from '@kbn/logging'; -import { Conversion } from './type'; +import { Conversion } from './types'; export const MessageConversion: Conversion = { pattern: /%message/g, diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/meta.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts similarity index 93% rename from packages/core/logging/core-logging-server-internal/src/layouts/conversions/meta.ts rename to packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts index abeb13136f13a..49bd79729da5a 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/meta.ts +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts @@ -7,7 +7,7 @@ */ import { LogRecord } from '@kbn/logging'; -import { Conversion } from './type'; +import { Conversion } from './types'; export const MetaConversion: Conversion = { pattern: /%meta/g, diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/type.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts similarity index 100% rename from packages/core/logging/core-logging-server-internal/src/layouts/conversions/type.ts rename to packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/index.ts b/packages/core/logging/core-logging-common-internal/src/layouts/index.ts new file mode 100644 index 0000000000000..0d89459d9de9f --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { PatternLayout } from './pattern_layout'; +export { + DateConversion, + LoggerConversion, + MessageConversion, + LevelConversion, + MetaConversion, + type Conversion, +} from './conversions'; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.test.ts b/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.test.ts new file mode 100644 index 0000000000000..b810321f83639 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.test.ts @@ -0,0 +1,256 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import stripAnsi from 'strip-ansi'; +import hasAnsi from 'has-ansi'; +import { LogLevel, LogRecord } from '@kbn/logging'; +import { PatternLayout } from './pattern_layout'; + +const stripAnsiSnapshotSerializer: jest.SnapshotSerializerPlugin = { + serialize(value: string) { + return stripAnsi(value); + }, + + test(value: any) { + return typeof value === 'string' && hasAnsi(value); + }, +}; + +const timestamp = new Date(Date.UTC(2012, 1, 1, 14, 30, 22, 11)); +const records: LogRecord[] = [ + { + context: 'context-1', + error: { + message: 'Some error message', + name: 'Some error name', + stack: 'Some error stack', + }, + level: LogLevel.Fatal, + message: 'message-1', + timestamp, + pid: 5355, + }, + { + context: 'context-2', + level: LogLevel.Error, + message: 'message-2', + timestamp, + pid: 5355, + }, + { + context: 'context-3', + level: LogLevel.Warn, + message: 'message-3', + timestamp, + pid: 5355, + }, + { + context: 'context-4', + level: LogLevel.Debug, + message: 'message-4', + timestamp, + pid: 5355, + }, + { + context: 'context-5', + level: LogLevel.Info, + message: 'message-5', + timestamp, + pid: 5355, + }, + { + context: 'context-6', + level: LogLevel.Trace, + message: 'message-6', + timestamp, + pid: 5355, + }, +]; + +expect.addSnapshotSerializer(stripAnsiSnapshotSerializer); + +test('`format()` correctly formats record with full pattern.', () => { + const layout = new PatternLayout(); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` correctly formats record with custom pattern.', () => { + const layout = new PatternLayout({ pattern: 'mock-%message-%logger-%message' }); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` correctly formats record with meta data.', () => { + const layout = new PatternLayout({ pattern: '[%date][%level][%logger]%meta %message' }); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + meta: { + // @ts-expect-error not valid ECS field + from: 'v7', + to: 'v8', + }, + }) + ).toBe( + '[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta]{"from":"v7","to":"v8"} message-meta' + ); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + meta: {}, + }) + ).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta]{} message-meta'); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + }) + ).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta] message-meta'); +}); + +test('allows specifying the PID in custom pattern', () => { + const layout = new PatternLayout({ pattern: '%pid-%logger-%message' }); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` allows specifying pattern with meta.', () => { + const layout = new PatternLayout({ pattern: '%logger-%meta-%message' }); + const record = { + context: 'context', + level: LogLevel.Debug, + message: 'message', + timestamp, + pid: 5355, + meta: { + from: 'v7', + to: 'v8', + }, + }; + // @ts-expect-error not valid ECS field + expect(layout.format(record)).toBe('context-{"from":"v7","to":"v8"}-message'); +}); + +describe('format', () => { + describe('timestamp', () => { + const record = { + context: 'context', + level: LogLevel.Debug, + message: 'message', + timestamp, + pid: 5355, + }; + it('uses ISO8601_TZ as default', () => { + const layout = new PatternLayout(); + + expect(layout.format(record)).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context] message'); + }); + + describe('supports specifying a predefined format', () => { + it('ISO8601', () => { + const layout = new PatternLayout({ pattern: '[%date{ISO8601}][%logger]' }); + + expect(layout.format(record)).toBe('[2012-02-01T14:30:22.011Z][context]'); + }); + + it('ISO8601_TZ', () => { + const layout = new PatternLayout({ pattern: '[%date{ISO8601_TZ}][%logger]' }); + + expect(layout.format(record)).toBe('[2012-02-01T09:30:22.011-05:00][context]'); + }); + + it('ABSOLUTE', () => { + const layout = new PatternLayout({ pattern: '[%date{ABSOLUTE}][%logger]' }); + + expect(layout.format(record)).toBe('[09:30:22.011][context]'); + }); + + it('UNIX', () => { + const layout = new PatternLayout({ pattern: '[%date{UNIX}][%logger]' }); + + expect(layout.format(record)).toBe('[1328106622][context]'); + }); + + it('UNIX_MILLIS', () => { + const layout = new PatternLayout({ pattern: '[%date{UNIX_MILLIS}][%logger]' }); + + expect(layout.format(record)).toBe('[1328106622011][context]'); + }); + }); + + describe('supports specifying a predefined format and timezone', () => { + it('ISO8601', () => { + const layout = new PatternLayout({ + pattern: '[%date{ISO8601}{America/Los_Angeles}][%logger]', + }); + + expect(layout.format(record)).toBe('[2012-02-01T14:30:22.011Z][context]'); + }); + + it('ISO8601_TZ', () => { + const layout = new PatternLayout({ + pattern: '[%date{ISO8601_TZ}{America/Los_Angeles}][%logger]', + }); + + expect(layout.format(record)).toBe('[2012-02-01T06:30:22.011-08:00][context]'); + }); + + it('ABSOLUTE', () => { + const layout = new PatternLayout({ + pattern: '[%date{ABSOLUTE}{America/Los_Angeles}][%logger]', + }); + + expect(layout.format(record)).toBe('[06:30:22.011][context]'); + }); + + it('UNIX', () => { + const layout = new PatternLayout({ + pattern: '[%date{UNIX}{America/Los_Angeles}][%logger]', + }); + + expect(layout.format(record)).toBe('[1328106622][context]'); + }); + + it('UNIX_MILLIS', () => { + const layout = new PatternLayout({ + pattern: '[%date{UNIX_MILLIS}{America/Los_Angeles}][%logger]', + }); + + expect(layout.format(record)).toBe('[1328106622011][context]'); + }); + }); + it('formats several conversions patterns correctly', () => { + const layout = new PatternLayout({ + pattern: '[%date{ABSOLUTE}{America/Los_Angeles}][%logger][%date{UNIX}]', + }); + + expect(layout.format(record)).toBe('[06:30:22.011][context][1328106622]'); + }); + }); +}); diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.ts b/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.ts new file mode 100644 index 0000000000000..13a9b35fd41bb --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.ts @@ -0,0 +1,73 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { LogRecord, Layout } from '@kbn/logging'; +import { + Conversion, + LoggerConversion, + LevelConversion, + MetaConversion, + MessageConversion, + DateConversion, +} from './conversions'; + +/** + * Default pattern used by PatternLayout if it's not overridden in the configuration. + */ +const DEFAULT_PATTERN = `[%date][%level][%logger] %message`; + +const DEFAULT_CONVERSIONS: Conversion[] = [ + LoggerConversion, + MessageConversion, + LevelConversion, + MetaConversion, + DateConversion, +]; + +export interface PatternLayoutOptions { + pattern?: string; + highlight?: boolean; + conversions?: Conversion[]; +} + +/** + * Layout that formats `LogRecord` using the `pattern` string with optional + * color highlighting (eg. to make log messages easier to read in the terminal). + * @internal + */ +export class PatternLayout implements Layout { + private readonly pattern: string; + private readonly highlight: boolean; + private readonly conversions: Conversion[]; + + constructor({ + pattern = DEFAULT_PATTERN, + highlight = false, + conversions = DEFAULT_CONVERSIONS, + }: PatternLayoutOptions = {}) { + this.pattern = pattern; + this.highlight = highlight; + this.conversions = conversions; + } + + /** + * Formats `LogRecord` into a string based on the specified `pattern` and `highlighting` options. + * @param record Instance of `LogRecord` to format into string. + */ + public format(record: LogRecord): string { + let recordString = this.pattern; + for (const conversion of this.conversions) { + recordString = recordString.replace( + conversion.pattern, + conversion.convert.bind(null, record, this.highlight) + ); + } + + return recordString; + } +} diff --git a/packages/core/logging/core-logging-common-internal/src/logger.test.ts b/packages/core/logging/core-logging-common-internal/src/logger.test.ts new file mode 100644 index 0000000000000..adf4275a7d6cd --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/logger.test.ts @@ -0,0 +1,241 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Appender, LogLevel, LogMeta, LogRecord } from '@kbn/logging'; +import { getLoggerContext } from '@kbn/core-logging-common-internal'; +import { AbstractLogger, CreateLogRecordFn } from './logger'; + +describe('AbstractLogger', () => { + const context = getLoggerContext(['context', 'parent', 'child']); + const factory = { + get: jest.fn().mockImplementation(() => logger), + }; + + let appenderMocks: Appender[]; + + const createLogRecordSpy: jest.MockedFunction = jest.fn(); + + class TestLogger extends AbstractLogger { + createLogRecord( + level: LogLevel, + errorOrMessage: string | Error, + meta?: Meta + ) { + return createLogRecordSpy(level, errorOrMessage, meta); + } + } + + let logger: TestLogger; + + beforeEach(() => { + appenderMocks = [{ append: jest.fn() }, { append: jest.fn() }]; + logger = new TestLogger(context, LogLevel.All, appenderMocks, factory); + + createLogRecordSpy.mockImplementation((level, message, meta) => { + return { + level, + message, + meta, + } as LogRecord; + }); + }); + + afterEach(() => { + createLogRecordSpy.mockReset(); + }); + + describe('#trace', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.trace('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Trace, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Trace } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.trace('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#debug', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.debug('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Debug, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Debug } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.debug('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#info', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.info('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Info, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Info } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.info('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#warn', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.warn('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Warn, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Warn } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.warn('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#error', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.error('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Error, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Error } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.error('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#fatal', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.fatal('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Fatal, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Fatal } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.fatal('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#get', () => { + it('calls the logger factory with proper context and return the result', () => { + logger.get('sub', 'context'); + expect(factory.get).toHaveBeenCalledTimes(1); + expect(factory.get).toHaveBeenCalledWith(context, 'sub', 'context'); + + factory.get.mockClear(); + factory.get.mockImplementation(() => 'some-logger'); + + const childLogger = logger.get('other', 'sub'); + expect(factory.get).toHaveBeenCalledTimes(1); + expect(factory.get).toHaveBeenCalledWith(context, 'other', 'sub'); + expect(childLogger).toEqual('some-logger'); + }); + }); + + describe('log level', () => { + it('does not calls appenders for records with unsupported levels', () => { + logger = new TestLogger(context, LogLevel.Warn, appenderMocks, factory); + + logger.trace('some trace message'); + logger.debug('some debug message'); + logger.info('some info message'); + logger.warn('some warn message'); + logger.error('some error message'); + logger.fatal('some fatal message'); + + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith( + expect.objectContaining({ + level: LogLevel.Warn, + }) + ); + expect(appenderMock.append).toHaveBeenCalledWith( + expect.objectContaining({ + level: LogLevel.Error, + }) + ); + expect(appenderMock.append).toHaveBeenCalledWith( + expect.objectContaining({ + level: LogLevel.Fatal, + }) + ); + } + }); + }); + + describe('isLevelEnabled', () => { + const orderedLogLevels = [ + LogLevel.Fatal, + LogLevel.Error, + LogLevel.Warn, + LogLevel.Info, + LogLevel.Debug, + LogLevel.Trace, + LogLevel.All, + ]; + + for (const logLevel of orderedLogLevels) { + it(`returns the correct value for a '${logLevel.id}' level logger`, () => { + const levelLogger = new TestLogger(context, logLevel, appenderMocks, factory); + for (const level of orderedLogLevels) { + const levelEnabled = logLevel.supports(level); + expect(levelLogger.isLevelEnabled(level.id)).toEqual(levelEnabled); + } + }); + } + }); +}); diff --git a/packages/core/logging/core-logging-common-internal/src/logger.ts b/packages/core/logging/core-logging-common-internal/src/logger.ts new file mode 100644 index 0000000000000..69d00ed57f39f --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/logger.ts @@ -0,0 +1,86 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + Appender, + LogLevel, + LogRecord, + LoggerFactory, + LogMeta, + Logger, + LogLevelId, +} from '@kbn/logging'; + +/** + * @internal + */ +export type CreateLogRecordFn = ( + level: LogLevel, + errorOrMessage: string | Error, + meta?: Meta +) => LogRecord; + +/** + * A basic, abstract logger implementation that delegates the create of log records to the child's createLogRecord function. + * @internal + */ +export abstract class AbstractLogger implements Logger { + constructor( + protected readonly context: string, + protected readonly level: LogLevel, + protected readonly appenders: Appender[], + protected readonly factory: LoggerFactory + ) {} + + protected abstract createLogRecord( + level: LogLevel, + errorOrMessage: string | Error, + meta?: Meta + ): LogRecord; + + public trace(message: string, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Trace, message, meta)); + } + + public debug(message: string, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Debug, message, meta)); + } + + public info(message: string, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Info, message, meta)); + } + + public warn(errorOrMessage: string | Error, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Warn, errorOrMessage, meta)); + } + + public error(errorOrMessage: string | Error, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Error, errorOrMessage, meta)); + } + + public fatal(errorOrMessage: string | Error, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Fatal, errorOrMessage, meta)); + } + + public isLevelEnabled(levelId: LogLevelId): boolean { + return this.level.supports(LogLevel.fromId(levelId)); + } + + public log(record: LogRecord) { + if (!this.level.supports(record.level)) { + return; + } + for (const appender of this.appenders) { + appender.append(record); + } + } + + public get(...childContextPaths: string[]): Logger { + return this.factory.get(...[this.context, ...childContextPaths]); + } +} diff --git a/packages/core/logging/core-logging-common-internal/src/logger_context.test.ts b/packages/core/logging/core-logging-common-internal/src/logger_context.test.ts new file mode 100644 index 0000000000000..664b9840fd077 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/logger_context.test.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getLoggerContext, getParentLoggerContext } from './logger_context'; + +describe('getLoggerContext', () => { + it('returns correct joined context name.', () => { + expect(getLoggerContext(['a', 'b', 'c'])).toEqual('a.b.c'); + expect(getLoggerContext(['a', 'b'])).toEqual('a.b'); + expect(getLoggerContext(['a'])).toEqual('a'); + expect(getLoggerContext([])).toEqual('root'); + }); +}); + +describe('getParentLoggerContext', () => { + it('returns correct parent context name.', () => { + expect(getParentLoggerContext('a.b.c')).toEqual('a.b'); + expect(getParentLoggerContext('a.b')).toEqual('a'); + expect(getParentLoggerContext('a')).toEqual('root'); + }); +}); diff --git a/packages/core/logging/core-logging-common-internal/src/logger_context.ts b/packages/core/logging/core-logging-common-internal/src/logger_context.ts new file mode 100644 index 0000000000000..d62a3fd5bea8a --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/logger_context.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/** + * Separator string that used within nested context name (eg. plugins.pid). + */ +export const CONTEXT_SEPARATOR = '.'; + +/** + * Name of the `root` context that always exists and sits at the top of logger hierarchy. + */ +export const ROOT_CONTEXT_NAME = 'root'; + +/** + * Name of the appender that is always presented and used by `root` logger by default. + */ +export const DEFAULT_APPENDER_NAME = 'default'; + +/** + * Helper method that joins separate string context parts into single context string. + * In case joined context is an empty string, `root` context name is returned. + * @param contextParts List of the context parts (e.g. ['parent', 'child']. + * @returns {string} Joined context string (e.g. 'parent.child'). + */ +export const getLoggerContext = (contextParts: string[]): string => { + return contextParts.join(CONTEXT_SEPARATOR) || ROOT_CONTEXT_NAME; +}; + +/** + * Helper method that returns parent context for the specified one. + * @param context Context to find parent for. + * @returns Name of the parent context or `root` if the context is the top level one. + */ +export const getParentLoggerContext = (context: string): string => { + const lastIndexOfSeparator = context.lastIndexOf(CONTEXT_SEPARATOR); + if (lastIndexOfSeparator === -1) { + return ROOT_CONTEXT_NAME; + } + + return context.slice(0, lastIndexOfSeparator); +}; diff --git a/packages/core/logging/core-logging-common-internal/tsconfig.json b/packages/core/logging/core-logging-common-internal/tsconfig.json new file mode 100644 index 0000000000000..fbd1249f66205 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "types": [ + "jest", + "node", + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/logging/core-logging-server-internal/BUILD.bazel b/packages/core/logging/core-logging-server-internal/BUILD.bazel index fbc3cc6626eec..1fc923fb7cae6 100644 --- a/packages/core/logging/core-logging-server-internal/BUILD.bazel +++ b/packages/core/logging/core-logging-server-internal/BUILD.bazel @@ -37,10 +37,12 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "@npm//lodash", "@npm//moment-timezone", + "@npm//chalk", "@npm//elastic-apm-node", "//packages/kbn-safer-lodash-set", "//packages/kbn-config-schema", "//packages/kbn-std", + "//packages/core/logging/core-logging-common-internal", ] TYPES_DEPS = [ @@ -50,10 +52,12 @@ TYPES_DEPS = [ "@npm//rxjs", "@npm//@types/moment-timezone", "@npm//elastic-apm-node", + "@npm//chalk", "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-logging:npm_module_types", "//packages/kbn-config-schema:npm_module_types", "//packages/core/base/core-base-server-internal:npm_module_types", + "//packages/core/logging/core-logging-common-internal:npm_module_types", "//packages/core/logging/core-logging-server:npm_module_types", ] @@ -78,7 +82,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -92,6 +95,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -103,17 +114,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/logging/core-logging-server-internal/package.json b/packages/core/logging/core-logging-server-internal/package.json index 60dd5b9afb1dd..df0984f8e6cab 100644 --- a/packages/core/logging/core-logging-server-internal/package.json +++ b/packages/core/logging/core-logging-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/logging/core-logging-server-internal/src/appenders/console/console_appender.ts b/packages/core/logging/core-logging-server-internal/src/appenders/console/console_appender.ts index b1fe6943c704f..0602ea81289af 100644 --- a/packages/core/logging/core-logging-server-internal/src/appenders/console/console_appender.ts +++ b/packages/core/logging/core-logging-server-internal/src/appenders/console/console_appender.ts @@ -7,7 +7,7 @@ */ import { schema } from '@kbn/config-schema'; -import { Layout, LogRecord, DisposableAppender } from '@kbn/logging'; +import type { Layout, LogRecord, DisposableAppender } from '@kbn/logging'; import { Layouts } from '../../layouts/layouts'; const { literal, object } = schema; diff --git a/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.test.ts b/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.test.ts index 3c12e479cc834..86d4df2d1d709 100644 --- a/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.test.ts +++ b/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.test.ts @@ -124,7 +124,7 @@ describe('MetaRewritePolicy', () => { "error": Object {}, "tags": Array [ "0", - undefined, + , ], } `); diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/date.ts b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/date.ts deleted file mode 100644 index 66aad5b42354a..0000000000000 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/date.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import moment from 'moment-timezone'; -import { last } from 'lodash'; -import { LogRecord } from '@kbn/logging'; - -import { Conversion } from './type'; - -const dateRegExp = /%date({(?[^}]+)})?({(?[^}]+)})?/g; - -const formats = { - ISO8601: 'ISO8601', - ISO8601_TZ: 'ISO8601_TZ', - ABSOLUTE: 'ABSOLUTE', - UNIX: 'UNIX', - UNIX_MILLIS: 'UNIX_MILLIS', -}; - -function formatDate( - date: Date, - dateFormat: string = formats.ISO8601_TZ, - timezone?: string -): string { - const momentDate = moment(date); - momentDate.tz(timezone ?? moment.tz.guess()); - - switch (dateFormat) { - case formats.ISO8601: - return momentDate.toISOString(); - case formats.ISO8601_TZ: - return momentDate.format('YYYY-MM-DDTHH:mm:ss.SSSZ'); - case formats.ABSOLUTE: - return momentDate.format('HH:mm:ss.SSS'); - case formats.UNIX: - return momentDate.format('X'); - case formats.UNIX_MILLIS: - return momentDate.format('x'); - default: - throw new Error(`Unknown format: ${dateFormat}`); - } -} - -function validateDateFormat(input: string) { - if (!Reflect.has(formats, input)) { - throw new Error( - `Date format expected one of ${Reflect.ownKeys(formats).join(', ')}, but given: ${input}` - ); - } -} - -function validateTimezone(timezone: string) { - if (moment.tz.zone(timezone)) return; - throw new Error(`Unknown timezone: ${timezone}`); -} - -function validate(rawString: string) { - for (const matched of rawString.matchAll(dateRegExp)) { - const { format, timezone } = matched.groups!; - - if (format) { - validateDateFormat(format); - } - if (timezone) { - validateTimezone(timezone); - } - } -} - -export const DateConversion: Conversion = { - pattern: dateRegExp, - convert(record: LogRecord, highlight: boolean, ...matched: any[]) { - const groups: Record = last(matched); - const { format, timezone } = groups; - - return formatDate(record.timestamp, format, timezone); - }, - validate, -}; diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/index.ts b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/index.ts index 9203fdd02278c..dad8fd42c5c05 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/index.ts +++ b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/index.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -export type { Conversion } from './type'; - -export { LoggerConversion } from './logger'; -export { LevelConversion } from './level'; -export { MessageConversion } from './message'; -export { MetaConversion } from './meta'; export { PidConversion } from './pid'; -export { DateConversion } from './date'; +export { LevelConversion } from './level'; +export { LoggerConversion } from './logger'; +export { + DateConversion, + MessageConversion, + MetaConversion, +} from '@kbn/core-logging-common-internal'; diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/level.ts b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/level.ts index 17e45555aa873..38ae927b790a0 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/level.ts +++ b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/level.ts @@ -8,8 +8,7 @@ import chalk from 'chalk'; import { LogRecord, LogLevel } from '@kbn/logging'; - -import { Conversion } from './type'; +import type { Conversion } from '@kbn/core-logging-common-internal'; const LEVEL_COLORS = new Map([ [LogLevel.Fatal, chalk.red], diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/logger.ts b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/logger.ts index 1cb6f06b4e2c6..71be5e6d06365 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/logger.ts +++ b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/logger.ts @@ -8,8 +8,7 @@ import chalk from 'chalk'; import { LogRecord } from '@kbn/logging'; - -import { Conversion } from './type'; +import type { Conversion } from '@kbn/core-logging-common-internal'; export const LoggerConversion: Conversion = { pattern: /%logger/g, diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/pid.ts b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/pid.ts index cc43f4e874adc..0d6237554b778 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/pid.ts +++ b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/pid.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { LogRecord } from '@kbn/logging'; -import { Conversion } from './type'; +import type { LogRecord } from '@kbn/logging'; +import type { Conversion } from '@kbn/core-logging-common-internal'; export const PidConversion: Conversion = { pattern: /%pid/g, diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/pattern_layout.ts b/packages/core/logging/core-logging-server-internal/src/layouts/pattern_layout.ts index 8206537ef7de7..58ddf5fd684f8 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/pattern_layout.ts +++ b/packages/core/logging/core-logging-server-internal/src/layouts/pattern_layout.ts @@ -7,10 +7,11 @@ */ import { schema } from '@kbn/config-schema'; -import { LogRecord, Layout } from '@kbn/logging'; - import { - Conversion, + PatternLayout as BasePatternLayout, + type Conversion, +} from '@kbn/core-logging-common-internal'; +import { LoggerConversion, LevelConversion, MetaConversion, @@ -19,9 +20,6 @@ import { DateConversion, } from './conversions'; -/** - * Default pattern used by PatternLayout if it's not overridden in the configuration. - */ const DEFAULT_PATTERN = `[%date][%level][%logger] %message`; export const patternSchema = schema.string({ @@ -50,23 +48,14 @@ const conversions: Conversion[] = [ * color highlighting (eg. to make log messages easier to read in the terminal). * @internal */ -export class PatternLayout implements Layout { +export class PatternLayout extends BasePatternLayout { public static configSchema = patternLayoutSchema; - constructor(private readonly pattern = DEFAULT_PATTERN, private readonly highlight = false) {} - - /** - * Formats `LogRecord` into a string based on the specified `pattern` and `highlighting` options. - * @param record Instance of `LogRecord` to format into string. - */ - public format(record: LogRecord): string { - let recordString = this.pattern; - for (const conversion of conversions) { - recordString = recordString.replace( - conversion.pattern, - conversion.convert.bind(null, record, this.highlight) - ); - } - return recordString; + constructor(pattern: string = DEFAULT_PATTERN, highlight: boolean = false) { + super({ + pattern, + highlight, + conversions, + }); } } diff --git a/packages/core/logging/core-logging-server-internal/src/logger.test.ts b/packages/core/logging/core-logging-server-internal/src/logger.test.ts index c57ce2563ca3d..5c90118d7b1bb 100644 --- a/packages/core/logging/core-logging-server-internal/src/logger.test.ts +++ b/packages/core/logging/core-logging-server-internal/src/logger.test.ts @@ -429,3 +429,25 @@ test('passes log record to appenders only if log level is supported.', () => { }); } }); + +describe('isLevelEnabled', () => { + const orderedLogLevels = [ + LogLevel.Fatal, + LogLevel.Error, + LogLevel.Warn, + LogLevel.Info, + LogLevel.Debug, + LogLevel.Trace, + LogLevel.All, + ]; + + for (const logLevel of orderedLogLevels) { + it(`returns the correct value for a '${logLevel.id}' level logger`, () => { + const levelLogger = new BaseLogger(context, logLevel, appenderMocks, factory); + for (const level of orderedLogLevels) { + const levelEnabled = logLevel.supports(level); + expect(levelLogger.isLevelEnabled(level.id)).toEqual(levelEnabled); + } + }); + } +}); diff --git a/packages/core/logging/core-logging-server-internal/src/logger.ts b/packages/core/logging/core-logging-server-internal/src/logger.ts index 2c9283da54897..23718ca278a2e 100644 --- a/packages/core/logging/core-logging-server-internal/src/logger.ts +++ b/packages/core/logging/core-logging-server-internal/src/logger.ts @@ -6,60 +6,16 @@ * Side Public License, v 1. */ import apmAgent from 'elastic-apm-node'; -import { Appender, LogLevel, LogRecord, LoggerFactory, LogMeta, Logger } from '@kbn/logging'; +import { LogLevel, LogRecord, LogMeta } from '@kbn/logging'; +import { AbstractLogger } from '@kbn/core-logging-common-internal'; function isError(x: any): x is Error { return x instanceof Error; } /** @internal */ -export class BaseLogger implements Logger { - constructor( - private readonly context: string, - private readonly level: LogLevel, - private readonly appenders: Appender[], - private readonly factory: LoggerFactory - ) {} - - public trace(message: string, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Trace, message, meta)); - } - - public debug(message: string, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Debug, message, meta)); - } - - public info(message: string, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Info, message, meta)); - } - - public warn(errorOrMessage: string | Error, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Warn, errorOrMessage, meta)); - } - - public error(errorOrMessage: string | Error, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Error, errorOrMessage, meta)); - } - - public fatal(errorOrMessage: string | Error, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Fatal, errorOrMessage, meta)); - } - - public log(record: LogRecord) { - if (!this.level.supports(record.level)) { - return; - } - - for (const appender of this.appenders) { - appender.append(record); - } - } - - public get(...childContextPaths: string[]): Logger { - return this.factory.get(...[this.context, ...childContextPaths]); - } - - private createLogRecord( +export class BaseLogger extends AbstractLogger { + protected createLogRecord( level: LogLevel, errorOrMessage: string | Error, meta?: Meta diff --git a/packages/core/logging/core-logging-server-internal/src/logger_adapter.test.ts b/packages/core/logging/core-logging-server-internal/src/logger_adapter.test.ts index 28f747ef3fcf6..5c6a64e7c10f4 100644 --- a/packages/core/logging/core-logging-server-internal/src/logger_adapter.test.ts +++ b/packages/core/logging/core-logging-server-internal/src/logger_adapter.test.ts @@ -7,11 +7,11 @@ */ import type { Logger } from '@kbn/logging'; -import { loggerMock } from '@kbn/logging-mocks'; +import { loggerMock, type MockedLogger } from '@kbn/logging-mocks'; import { LoggerAdapter } from './logger_adapter'; describe('LoggerAdapter', () => { - let internalLogger: Logger; + let internalLogger: MockedLogger; beforeEach(() => { internalLogger = loggerMock.create(); @@ -47,6 +47,11 @@ describe('LoggerAdapter', () => { adapter.get('context'); expect(internalLogger.get).toHaveBeenCalledTimes(1); expect(internalLogger.get).toHaveBeenCalledWith('context'); + + internalLogger.isLevelEnabled.mockReturnValue(false); + expect(adapter.isLevelEnabled('info')).toEqual(false); + expect(internalLogger.isLevelEnabled).toHaveBeenCalledTimes(1); + expect(internalLogger.isLevelEnabled).toHaveBeenCalledWith('info'); }); test('forwards all method calls to new internal logger if it is updated.', () => { @@ -57,7 +62,7 @@ describe('LoggerAdapter', () => { adapter.trace('trace-message'); expect(internalLogger.trace).toHaveBeenCalledTimes(1); expect(internalLogger.trace).toHaveBeenCalledWith('trace-message', undefined); - (internalLogger.trace as jest.Mock<() => void>).mockReset(); + internalLogger.trace.mockReset(); adapter.updateLogger(newInternalLogger); adapter.trace('trace-message'); diff --git a/packages/core/logging/core-logging-server-internal/src/logger_adapter.ts b/packages/core/logging/core-logging-server-internal/src/logger_adapter.ts index 5439fe0205796..13ce292936e6c 100644 --- a/packages/core/logging/core-logging-server-internal/src/logger_adapter.ts +++ b/packages/core/logging/core-logging-server-internal/src/logger_adapter.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { LogRecord, Logger, LogMeta } from '@kbn/logging'; +import { LogRecord, Logger, LogMeta, LogLevelId } from '@kbn/logging'; import { GlobalContext, mergeGlobalContext } from './global_context'; /** @internal */ @@ -65,6 +65,10 @@ export class LoggerAdapter implements Logger { this.logger.log({ ...record, meta: mergeGlobalContext(this.globalContext, record.meta) }); } + public isLevelEnabled(level: LogLevelId): boolean { + return this.logger.isLevelEnabled(level); + } + public get(...contextParts: string[]): Logger { return this.logger.get(...contextParts); } diff --git a/packages/core/logging/core-logging-server-internal/src/logging_config.ts b/packages/core/logging/core-logging-server-internal/src/logging_config.ts index 4d79c593fb6f2..00eb1450f0abe 100644 --- a/packages/core/logging/core-logging-server-internal/src/logging_config.ts +++ b/packages/core/logging/core-logging-server-internal/src/logging_config.ts @@ -7,6 +7,12 @@ */ import { schema, TypeOf } from '@kbn/config-schema'; +import { + ROOT_CONTEXT_NAME, + DEFAULT_APPENDER_NAME, + getLoggerContext, + getParentLoggerContext, +} from '@kbn/core-logging-common-internal'; import type { AppenderConfigType, LoggerConfigType } from '@kbn/core-logging-server'; import { Appenders } from './appenders/appenders'; @@ -14,21 +20,6 @@ import { Appenders } from './appenders/appenders'; // (otherwise it assumes an array of A|B instead of a tuple [A,B]) const toTuple = (a: A, b: B): [A, B] => [a, b]; -/** - * Separator string that used within nested context name (eg. plugins.pid). - */ -const CONTEXT_SEPARATOR = '.'; - -/** - * Name of the `root` context that always exists and sits at the top of logger hierarchy. - */ -const ROOT_CONTEXT_NAME = 'root'; - -/** - * Name of the appender that is always presented and used by `root` logger by default. - */ -const DEFAULT_APPENDER_NAME = 'default'; - const levelSchema = schema.oneOf( [ schema.literal('all'), @@ -109,7 +100,7 @@ export class LoggingConfig { * @returns {string} Joined context string (e.g. 'parent.child'). */ public static getLoggerContext(contextParts: string[]) { - return contextParts.join(CONTEXT_SEPARATOR) || ROOT_CONTEXT_NAME; + return getLoggerContext(contextParts); } /** @@ -118,12 +109,7 @@ export class LoggingConfig { * @returns Name of the parent context or `root` if the context is the top level one. */ public static getParentLoggerContext(context: string) { - const lastIndexOfSeparator = context.lastIndexOf(CONTEXT_SEPARATOR); - if (lastIndexOfSeparator === -1) { - return ROOT_CONTEXT_NAME; - } - - return context.slice(0, lastIndexOfSeparator); + return getParentLoggerContext(context); } /** diff --git a/packages/core/logging/core-logging-server-internal/tsconfig.json b/packages/core/logging/core-logging-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/logging/core-logging-server-internal/tsconfig.json +++ b/packages/core/logging/core-logging-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/logging/core-logging-server-mocks/BUILD.bazel b/packages/core/logging/core-logging-server-mocks/BUILD.bazel index 8a6ccc81559c2..c81d459fe3982 100644 --- a/packages/core/logging/core-logging-server-mocks/BUILD.bazel +++ b/packages/core/logging/core-logging-server-mocks/BUILD.bazel @@ -68,7 +68,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -82,6 +81,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -93,17 +100,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/logging/core-logging-server-mocks/package.json b/packages/core/logging/core-logging-server-mocks/package.json index 97f6f4002f58e..d028f9469f534 100644 --- a/packages/core/logging/core-logging-server-mocks/package.json +++ b/packages/core/logging/core-logging-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/logging/core-logging-server-mocks/tsconfig.json b/packages/core/logging/core-logging-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/logging/core-logging-server-mocks/tsconfig.json +++ b/packages/core/logging/core-logging-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/logging/core-logging-server/BUILD.bazel b/packages/core/logging/core-logging-server/BUILD.bazel index c575f538904de..fff34ff183480 100644 --- a/packages/core/logging/core-logging-server/BUILD.bazel +++ b/packages/core/logging/core-logging-server/BUILD.bazel @@ -67,7 +67,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -81,6 +80,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -92,17 +99,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/logging/core-logging-server/package.json b/packages/core/logging/core-logging-server/package.json index c3cbc4dab845e..924cbc152d03d 100644 --- a/packages/core/logging/core-logging-server/package.json +++ b/packages/core/logging/core-logging-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/logging/core-logging-server/tsconfig.json b/packages/core/logging/core-logging-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/logging/core-logging-server/tsconfig.json +++ b/packages/core/logging/core-logging-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/metrics/core-metrics-collectors-server-internal/BUILD.bazel b/packages/core/metrics/core-metrics-collectors-server-internal/BUILD.bazel index 9761bcbf1cefb..16a97c7e54995 100644 --- a/packages/core/metrics/core-metrics-collectors-server-internal/BUILD.bazel +++ b/packages/core/metrics/core-metrics-collectors-server-internal/BUILD.bazel @@ -76,7 +76,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/metrics/core-metrics-collectors-server-internal/package.json b/packages/core/metrics/core-metrics-collectors-server-internal/package.json index 1955c52a1e1c1..d9df7f7c232db 100644 --- a/packages/core/metrics/core-metrics-collectors-server-internal/package.json +++ b/packages/core/metrics/core-metrics-collectors-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/metrics/core-metrics-collectors-server-internal/tsconfig.json b/packages/core/metrics/core-metrics-collectors-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/metrics/core-metrics-collectors-server-internal/tsconfig.json +++ b/packages/core/metrics/core-metrics-collectors-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/metrics/core-metrics-collectors-server-mocks/BUILD.bazel b/packages/core/metrics/core-metrics-collectors-server-mocks/BUILD.bazel index c9a692ca29fbe..9b7f70aed3743 100644 --- a/packages/core/metrics/core-metrics-collectors-server-mocks/BUILD.bazel +++ b/packages/core/metrics/core-metrics-collectors-server-mocks/BUILD.bazel @@ -67,7 +67,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -81,6 +80,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -92,17 +99,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/metrics/core-metrics-collectors-server-mocks/package.json b/packages/core/metrics/core-metrics-collectors-server-mocks/package.json index 03bd1c83684aa..344b8978cd02e 100644 --- a/packages/core/metrics/core-metrics-collectors-server-mocks/package.json +++ b/packages/core/metrics/core-metrics-collectors-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/metrics/core-metrics-collectors-server-mocks/tsconfig.json b/packages/core/metrics/core-metrics-collectors-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/metrics/core-metrics-collectors-server-mocks/tsconfig.json +++ b/packages/core/metrics/core-metrics-collectors-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/metrics/core-metrics-server-internal/BUILD.bazel b/packages/core/metrics/core-metrics-server-internal/BUILD.bazel index 0a7f393ec0b31..aceafc4e3ca86 100644 --- a/packages/core/metrics/core-metrics-server-internal/BUILD.bazel +++ b/packages/core/metrics/core-metrics-server-internal/BUILD.bazel @@ -86,7 +86,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -100,6 +99,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -111,17 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/metrics/core-metrics-server-internal/package.json b/packages/core/metrics/core-metrics-server-internal/package.json index 7579aea46091b..f6d827b4edc36 100644 --- a/packages/core/metrics/core-metrics-server-internal/package.json +++ b/packages/core/metrics/core-metrics-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/metrics/core-metrics-server-internal/src/metrics_service.test.ts b/packages/core/metrics/core-metrics-server-internal/src/metrics_service.test.ts index 351e2aca43f56..b17cb6c3195ae 100644 --- a/packages/core/metrics/core-metrics-server-internal/src/metrics_service.test.ts +++ b/packages/core/metrics/core-metrics-server-internal/src/metrics_service.test.ts @@ -30,7 +30,7 @@ describe('MetricsService', () => { let metricsService: MetricsService; beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const configService = configServiceMock.create({ atPath: { interval: moment.duration(testInterval) }, diff --git a/packages/core/metrics/core-metrics-server-internal/tsconfig.json b/packages/core/metrics/core-metrics-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/metrics/core-metrics-server-internal/tsconfig.json +++ b/packages/core/metrics/core-metrics-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/metrics/core-metrics-server-mocks/BUILD.bazel b/packages/core/metrics/core-metrics-server-mocks/BUILD.bazel index a442484a1f83f..afd9c1a6d6bc9 100644 --- a/packages/core/metrics/core-metrics-server-mocks/BUILD.bazel +++ b/packages/core/metrics/core-metrics-server-mocks/BUILD.bazel @@ -69,7 +69,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -83,6 +82,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -94,17 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/metrics/core-metrics-server-mocks/package.json b/packages/core/metrics/core-metrics-server-mocks/package.json index b5eb0fab3002d..f6eb0962aaba7 100644 --- a/packages/core/metrics/core-metrics-server-mocks/package.json +++ b/packages/core/metrics/core-metrics-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/metrics/core-metrics-server-mocks/tsconfig.json b/packages/core/metrics/core-metrics-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/metrics/core-metrics-server-mocks/tsconfig.json +++ b/packages/core/metrics/core-metrics-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/metrics/core-metrics-server/BUILD.bazel b/packages/core/metrics/core-metrics-server/BUILD.bazel index 7abd9909f1a7a..d0d2f3218b408 100644 --- a/packages/core/metrics/core-metrics-server/BUILD.bazel +++ b/packages/core/metrics/core-metrics-server/BUILD.bazel @@ -65,7 +65,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -79,6 +78,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -90,17 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/metrics/core-metrics-server/package.json b/packages/core/metrics/core-metrics-server/package.json index fbb56452c9a32..62890dfc756ce 100644 --- a/packages/core/metrics/core-metrics-server/package.json +++ b/packages/core/metrics/core-metrics-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/metrics/core-metrics-server/tsconfig.json b/packages/core/metrics/core-metrics-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/metrics/core-metrics-server/tsconfig.json +++ b/packages/core/metrics/core-metrics-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/mount-utils/core-mount-utils-browser-internal/BUILD.bazel b/packages/core/mount-utils/core-mount-utils-browser-internal/BUILD.bazel index d08deae72386f..56ff089165622 100644 --- a/packages/core/mount-utils/core-mount-utils-browser-internal/BUILD.bazel +++ b/packages/core/mount-utils/core-mount-utils-browser-internal/BUILD.bazel @@ -84,7 +84,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -98,6 +97,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -109,17 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/mount-utils/core-mount-utils-browser-internal/package.json b/packages/core/mount-utils/core-mount-utils-browser-internal/package.json index 073345848d8e2..560e995b68ad1 100644 --- a/packages/core/mount-utils/core-mount-utils-browser-internal/package.json +++ b/packages/core/mount-utils/core-mount-utils-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/mount-utils/core-mount-utils-browser-internal/tsconfig.json b/packages/core/mount-utils/core-mount-utils-browser-internal/tsconfig.json index 9f2708fb14528..c561d9f220124 100644 --- a/packages/core/mount-utils/core-mount-utils-browser-internal/tsconfig.json +++ b/packages/core/mount-utils/core-mount-utils-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/mount-utils/core-mount-utils-browser/BUILD.bazel b/packages/core/mount-utils/core-mount-utils-browser/BUILD.bazel index 18d6b52114c91..ee91849586b48 100644 --- a/packages/core/mount-utils/core-mount-utils-browser/BUILD.bazel +++ b/packages/core/mount-utils/core-mount-utils-browser/BUILD.bazel @@ -73,7 +73,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -87,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/mount-utils/core-mount-utils-browser/package.json b/packages/core/mount-utils/core-mount-utils-browser/package.json index b07256c1a50ce..07c43e9ef9e0f 100644 --- a/packages/core/mount-utils/core-mount-utils-browser/package.json +++ b/packages/core/mount-utils/core-mount-utils-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/mount-utils/core-mount-utils-browser/tsconfig.json b/packages/core/mount-utils/core-mount-utils-browser/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/mount-utils/core-mount-utils-browser/tsconfig.json +++ b/packages/core/mount-utils/core-mount-utils-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/node/core-node-server-internal/BUILD.bazel b/packages/core/node/core-node-server-internal/BUILD.bazel index 756f977074570..a7f8ae678685b 100644 --- a/packages/core/node/core-node-server-internal/BUILD.bazel +++ b/packages/core/node/core-node-server-internal/BUILD.bazel @@ -86,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/node/core-node-server-internal/index.ts b/packages/core/node/core-node-server-internal/index.ts index 9fa1dabc8ceeb..4868d9995f209 100644 --- a/packages/core/node/core-node-server-internal/index.ts +++ b/packages/core/node/core-node-server-internal/index.ts @@ -8,5 +8,5 @@ export { nodeConfig } from './src/node_config'; -export { NodeService } from './src/node_service'; -export type { InternalNodeServicePreboot } from './src/node_service'; +export { NodeService, type PrebootDeps } from './src/node_service'; +export type { InternalNodeServicePreboot, InternalNodeServiceStart } from './src/node_service'; diff --git a/packages/core/node/core-node-server-internal/package.json b/packages/core/node/core-node-server-internal/package.json index 47b4c05c3b50a..7d114d9377587 100644 --- a/packages/core/node/core-node-server-internal/package.json +++ b/packages/core/node/core-node-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/node/core-node-server-internal/src/node_service.test.ts b/packages/core/node/core-node-server-internal/src/node_service.test.ts index a707e8ec1aed8..f25737ded31bb 100644 --- a/packages/core/node/core-node-server-internal/src/node_service.test.ts +++ b/packages/core/node/core-node-server-internal/src/node_service.test.ts @@ -117,4 +117,62 @@ describe('NodeService', () => { }); }); }); + describe('#start()', () => { + it('returns default roles values when wildcard is provided', async () => { + configService = getMockedConfigService({ roles: ['*'] }); + coreContext = mockCoreContext.create({ logger, configService }); + + service = new NodeService(coreContext); + await service.preboot({ loggingSystem: logger }); + const { roles } = service.start(); + + expect(roles.backgroundTasks).toBe(true); + expect(roles.ui).toBe(true); + }); + + it('returns correct roles when node is configured to `background_tasks`', async () => { + configService = getMockedConfigService({ roles: ['background_tasks'] }); + coreContext = mockCoreContext.create({ logger, configService }); + + service = new NodeService(coreContext); + await service.preboot({ loggingSystem: logger }); + const { roles } = service.start(); + + expect(roles.backgroundTasks).toBe(true); + expect(roles.ui).toBe(false); + }); + + it('returns correct roles when node is configured to `ui`', async () => { + configService = getMockedConfigService({ roles: ['ui'] }); + coreContext = mockCoreContext.create({ logger, configService }); + + service = new NodeService(coreContext); + await service.preboot({ loggingSystem: logger }); + const { roles } = service.start(); + + expect(roles.backgroundTasks).toBe(false); + expect(roles.ui).toBe(true); + }); + + it('returns correct roles when node is configured to both `background_tasks` and `ui`', async () => { + configService = getMockedConfigService({ roles: ['background_tasks', 'ui'] }); + coreContext = mockCoreContext.create({ logger, configService }); + + service = new NodeService(coreContext); + await service.preboot({ loggingSystem: logger }); + const { roles } = service.start(); + + expect(roles.backgroundTasks).toBe(true); + expect(roles.ui).toBe(true); + }); + it('throws if preboot has not been run', () => { + configService = getMockedConfigService({ roles: ['background_tasks', 'ui'] }); + coreContext = mockCoreContext.create({ logger, configService }); + + service = new NodeService(coreContext); + expect(() => service.start()).toThrowErrorMatchingInlineSnapshot( + `"NodeService#start() can only be called after NodeService#preboot()"` + ); + }); + }); }); diff --git a/packages/core/node/core-node-server-internal/src/node_service.ts b/packages/core/node/core-node-server-internal/src/node_service.ts index 7d3ab67364224..b5c5c0a8b4c17 100644 --- a/packages/core/node/core-node-server-internal/src/node_service.ts +++ b/packages/core/node/core-node-server-internal/src/node_service.ts @@ -28,12 +28,25 @@ const containsWildcard = (roles: string[]) => roles.includes(NODE_WILDCARD_CHAR) */ export interface InternalNodeServicePreboot { /** - * Retrieve the Kibana instance uuid. + * The Kibana process can take on specialised roles via the `node.roles` config. + * + * The roles can be used by plugins to adjust their behavior based + * on the way the Kibana process has been configured. */ roles: NodeRoles; } -interface PrebootDeps { +export interface InternalNodeServiceStart { + /** + * The Kibana process can take on specialised roles via the `node.roles` config. + * + * The roles can be used by plugins to adjust their behavior based + * on the way the Kibana process has been configured. + */ + roles: NodeRoles; +} + +export interface PrebootDeps { loggingSystem: ILoggingSystem; } @@ -41,6 +54,7 @@ interface PrebootDeps { export class NodeService { private readonly configService: IConfigService; private readonly log: Logger; + private roles?: NodeRoles; constructor(core: CoreContext) { this.configService = core.configService; @@ -52,13 +66,22 @@ export class NodeService { loggingSystem.setGlobalContext({ service: { node: { roles } } }); this.log.info(`Kibana process configured with roles: [${roles.join(', ')}]`); + this.roles = NODE_ACCEPTED_ROLES.reduce((acc, curr) => { + return { ...acc, [camelCase(curr)]: roles.includes(curr) }; + }, {} as NodeRoles); + return { - roles: NODE_ACCEPTED_ROLES.reduce((acc, curr) => { - return { ...acc, [camelCase(curr)]: roles.includes(curr) }; - }, {} as NodeRoles), + roles: this.roles, }; } + public start(): InternalNodeServiceStart { + if (this.roles == null) { + throw new Error('NodeService#start() can only be called after NodeService#preboot()'); + } + return { roles: this.roles }; + } + public stop() { // nothing to do here yet } diff --git a/packages/core/node/core-node-server-internal/tsconfig.json b/packages/core/node/core-node-server-internal/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/node/core-node-server-internal/tsconfig.json +++ b/packages/core/node/core-node-server-internal/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/node/core-node-server-mocks/BUILD.bazel b/packages/core/node/core-node-server-mocks/BUILD.bazel index a57bfcd99fc29..c1e2d83989b11 100644 --- a/packages/core/node/core-node-server-mocks/BUILD.bazel +++ b/packages/core/node/core-node-server-mocks/BUILD.bazel @@ -77,6 +77,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -88,17 +96,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/node/core-node-server-mocks/package.json b/packages/core/node/core-node-server-mocks/package.json index 8be7afe931b6d..103ca0f3dce9b 100644 --- a/packages/core/node/core-node-server-mocks/package.json +++ b/packages/core/node/core-node-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/node/core-node-server-mocks/src/node_service.mock.ts b/packages/core/node/core-node-server-mocks/src/node_service.mock.ts index 6ece68ebd1b8f..ff354b663c231 100644 --- a/packages/core/node/core-node-server-mocks/src/node_service.mock.ts +++ b/packages/core/node/core-node-server-mocks/src/node_service.mock.ts @@ -7,7 +7,11 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import type { NodeService, InternalNodeServicePreboot } from '@kbn/core-node-server-internal'; +import type { + NodeService, + InternalNodeServicePreboot, + InternalNodeServiceStart, +} from '@kbn/core-node-server-internal'; const createInternalPrebootContractMock = () => { const prebootContract: jest.Mocked = { @@ -19,17 +23,38 @@ const createInternalPrebootContractMock = () => { return prebootContract; }; +const createInternalStartContractMock = ( + { + ui, + backgroundTasks, + }: { + ui: boolean; + backgroundTasks: boolean; + } = { ui: true, backgroundTasks: true } +) => { + const startContract: jest.Mocked = { + roles: { + backgroundTasks, + ui, + }, + }; + return startContract; +}; + type NodeServiceContract = PublicMethodsOf; const createMock = () => { const mocked: jest.Mocked = { preboot: jest.fn(), + start: jest.fn(), stop: jest.fn(), }; mocked.preboot.mockResolvedValue(createInternalPrebootContractMock()); + mocked.start.mockReturnValue(createInternalStartContractMock()); return mocked; }; export const nodeServiceMock = { create: createMock, createInternalPrebootContract: createInternalPrebootContractMock, + createInternalStartContract: createInternalStartContractMock, }; diff --git a/packages/core/node/core-node-server-mocks/tsconfig.json b/packages/core/node/core-node-server-mocks/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/node/core-node-server-mocks/tsconfig.json +++ b/packages/core/node/core-node-server-mocks/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/node/core-node-server/BUILD.bazel b/packages/core/node/core-node-server/BUILD.bazel index 29508960a2d05..5be2d208a1bfe 100644 --- a/packages/core/node/core-node-server/BUILD.bazel +++ b/packages/core/node/core-node-server/BUILD.bazel @@ -76,6 +76,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -87,17 +95,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/node/core-node-server/package.json b/packages/core/node/core-node-server/package.json index c1d8321a642a1..d303dbbe08b41 100644 --- a/packages/core/node/core-node-server/package.json +++ b/packages/core/node/core-node-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/node/core-node-server/tsconfig.json b/packages/core/node/core-node-server/tsconfig.json index af8fdef592c43..ef521586433c9 100644 --- a/packages/core/node/core-node-server/tsconfig.json +++ b/packages/core/node/core-node-server/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/notifications/core-notifications-browser-internal/BUILD.bazel b/packages/core/notifications/core-notifications-browser-internal/BUILD.bazel index ee21319d18cef..59a85f07f2e4b 100644 --- a/packages/core/notifications/core-notifications-browser-internal/BUILD.bazel +++ b/packages/core/notifications/core-notifications-browser-internal/BUILD.bazel @@ -100,7 +100,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -114,6 +113,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -125,17 +132,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/notifications/core-notifications-browser-internal/package.json b/packages/core/notifications/core-notifications-browser-internal/package.json index b45295f607634..116a9d21f6012 100644 --- a/packages/core/notifications/core-notifications-browser-internal/package.json +++ b/packages/core/notifications/core-notifications-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/notifications/core-notifications-browser-internal/tsconfig.json b/packages/core/notifications/core-notifications-browser-internal/tsconfig.json index 4abe25d2969e6..e1805086a07a5 100644 --- a/packages/core/notifications/core-notifications-browser-internal/tsconfig.json +++ b/packages/core/notifications/core-notifications-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/notifications/core-notifications-browser-mocks/BUILD.bazel b/packages/core/notifications/core-notifications-browser-mocks/BUILD.bazel index 58f69c8ac5260..b1eedb89fb2c1 100644 --- a/packages/core/notifications/core-notifications-browser-mocks/BUILD.bazel +++ b/packages/core/notifications/core-notifications-browser-mocks/BUILD.bazel @@ -68,7 +68,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -82,6 +81,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -93,17 +100,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/notifications/core-notifications-browser-mocks/package.json b/packages/core/notifications/core-notifications-browser-mocks/package.json index c38d419c5124c..cb403f57dfc47 100644 --- a/packages/core/notifications/core-notifications-browser-mocks/package.json +++ b/packages/core/notifications/core-notifications-browser-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/notifications/core-notifications-browser-mocks/tsconfig.json b/packages/core/notifications/core-notifications-browser-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/notifications/core-notifications-browser-mocks/tsconfig.json +++ b/packages/core/notifications/core-notifications-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/notifications/core-notifications-browser/BUILD.bazel b/packages/core/notifications/core-notifications-browser/BUILD.bazel index 2a6899e0e8bb1..1e96205532362 100644 --- a/packages/core/notifications/core-notifications-browser/BUILD.bazel +++ b/packages/core/notifications/core-notifications-browser/BUILD.bazel @@ -74,7 +74,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -88,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/notifications/core-notifications-browser/package.json b/packages/core/notifications/core-notifications-browser/package.json index 891373d673de8..9274f6230e315 100644 --- a/packages/core/notifications/core-notifications-browser/package.json +++ b/packages/core/notifications/core-notifications-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/notifications/core-notifications-browser/tsconfig.json b/packages/core/notifications/core-notifications-browser/tsconfig.json index fc8aa85fbac2b..3faa31fe437a8 100644 --- a/packages/core/notifications/core-notifications-browser/tsconfig.json +++ b/packages/core/notifications/core-notifications-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/overlays/core-overlays-browser-internal/BUILD.bazel b/packages/core/overlays/core-overlays-browser-internal/BUILD.bazel index b1332ccef15bf..b605c45b504d2 100644 --- a/packages/core/overlays/core-overlays-browser-internal/BUILD.bazel +++ b/packages/core/overlays/core-overlays-browser-internal/BUILD.bazel @@ -90,7 +90,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -104,6 +103,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -115,17 +122,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/overlays/core-overlays-browser-internal/package.json b/packages/core/overlays/core-overlays-browser-internal/package.json index 9281db3f4663f..0e2232e3f1cef 100644 --- a/packages/core/overlays/core-overlays-browser-internal/package.json +++ b/packages/core/overlays/core-overlays-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.test.ts b/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.test.ts index 378de1611a746..1936211774231 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.test.ts +++ b/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.test.ts @@ -56,7 +56,7 @@ describe('OverlayBannersService', () => { }); it('dismisses banner after timeout', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); startService('testing banner!'); expect(banners.remove).not.toHaveBeenCalled(); diff --git a/packages/core/overlays/core-overlays-browser-internal/tsconfig.json b/packages/core/overlays/core-overlays-browser-internal/tsconfig.json index 4abe25d2969e6..e1805086a07a5 100644 --- a/packages/core/overlays/core-overlays-browser-internal/tsconfig.json +++ b/packages/core/overlays/core-overlays-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/overlays/core-overlays-browser-mocks/BUILD.bazel b/packages/core/overlays/core-overlays-browser-mocks/BUILD.bazel index 3ebf281c48c1e..f376cb502121a 100644 --- a/packages/core/overlays/core-overlays-browser-mocks/BUILD.bazel +++ b/packages/core/overlays/core-overlays-browser-mocks/BUILD.bazel @@ -67,7 +67,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -81,6 +80,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -92,17 +99,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/overlays/core-overlays-browser-mocks/package.json b/packages/core/overlays/core-overlays-browser-mocks/package.json index 0822dac0cd36c..336f714766496 100644 --- a/packages/core/overlays/core-overlays-browser-mocks/package.json +++ b/packages/core/overlays/core-overlays-browser-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/overlays/core-overlays-browser-mocks/tsconfig.json b/packages/core/overlays/core-overlays-browser-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/overlays/core-overlays-browser-mocks/tsconfig.json +++ b/packages/core/overlays/core-overlays-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/overlays/core-overlays-browser/BUILD.bazel b/packages/core/overlays/core-overlays-browser/BUILD.bazel index 4870d44be2f88..c77d2fe12d6be 100644 --- a/packages/core/overlays/core-overlays-browser/BUILD.bazel +++ b/packages/core/overlays/core-overlays-browser/BUILD.bazel @@ -74,7 +74,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -88,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/overlays/core-overlays-browser/package.json b/packages/core/overlays/core-overlays-browser/package.json index 56644fa250e67..02c1fee3083c0 100644 --- a/packages/core/overlays/core-overlays-browser/package.json +++ b/packages/core/overlays/core-overlays-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/overlays/core-overlays-browser/tsconfig.json b/packages/core/overlays/core-overlays-browser/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/overlays/core-overlays-browser/tsconfig.json +++ b/packages/core/overlays/core-overlays-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/plugins/core-plugins-base-server-internal/BUILD.bazel b/packages/core/plugins/core-plugins-base-server-internal/BUILD.bazel index 7e4d73b638a75..3a88e9ead9844 100644 --- a/packages/core/plugins/core-plugins-base-server-internal/BUILD.bazel +++ b/packages/core/plugins/core-plugins-base-server-internal/BUILD.bazel @@ -66,7 +66,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -80,6 +79,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -91,17 +98,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/plugins/core-plugins-base-server-internal/package.json b/packages/core/plugins/core-plugins-base-server-internal/package.json index 6af3453f1a29b..d11839515ba61 100644 --- a/packages/core/plugins/core-plugins-base-server-internal/package.json +++ b/packages/core/plugins/core-plugins-base-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/plugins/core-plugins-base-server-internal/tsconfig.json b/packages/core/plugins/core-plugins-base-server-internal/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/plugins/core-plugins-base-server-internal/tsconfig.json +++ b/packages/core/plugins/core-plugins-base-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/plugins/core-plugins-browser-internal/BUILD.bazel b/packages/core/plugins/core-plugins-browser-internal/BUILD.bazel index 734d78cce2298..b1ce21eaff312 100644 --- a/packages/core/plugins/core-plugins-browser-internal/BUILD.bazel +++ b/packages/core/plugins/core-plugins-browser-internal/BUILD.bazel @@ -84,7 +84,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -98,6 +97,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -109,17 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/plugins/core-plugins-browser-internal/package.json b/packages/core/plugins/core-plugins-browser-internal/package.json index 0820932cb2f9a..c8679403e28c4 100644 --- a/packages/core/plugins/core-plugins-browser-internal/package.json +++ b/packages/core/plugins/core-plugins-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.test.ts b/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.test.ts new file mode 100644 index 0000000000000..1b1bea2279b60 --- /dev/null +++ b/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.test.ts @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { DiscoveredPlugin, PluginOpaqueId, PluginType } from '@kbn/core-base-common'; +import { type MockedLogger, loggerMock } from '@kbn/logging-mocks'; +import type { PluginInitializerContext } from '@kbn/core-plugins-browser'; +import { coreContextMock } from '@kbn/core-base-browser-mocks'; +import { createPluginInitializerContext } from './plugin_context'; + +const createPluginManifest = (pluginName: string): DiscoveredPlugin => { + return { + id: pluginName, + configPath: [pluginName], + type: PluginType.standard, + requiredPlugins: [], + optionalPlugins: [], + requiredBundles: [], + }; +}; + +const testPluginId = 'testPluginId'; + +describe('createPluginInitializerContext', () => { + let pluginId: PluginOpaqueId; + let pluginManifest: DiscoveredPlugin; + let pluginConfig: Record; + let coreContext: ReturnType; + let logger: MockedLogger; + let initContext: PluginInitializerContext; + + beforeEach(() => { + pluginId = Symbol(testPluginId); + pluginManifest = createPluginManifest(testPluginId); + pluginConfig = {}; + coreContext = coreContextMock.create(); + logger = coreContext.logger as MockedLogger; + + initContext = createPluginInitializerContext( + coreContext, + pluginId, + pluginManifest, + pluginConfig + ); + }); + + describe('logger.get', () => { + it('calls the underlying logger factory with the correct parameters', () => { + initContext.logger.get('service.sub'); + expect(logger.get).toHaveBeenCalledTimes(1); + expect(logger.get).toHaveBeenCalledWith('plugins', testPluginId, 'service.sub'); + }); + + it('returns the logger from the underlying factory', () => { + const underlyingLogger = loggerMock.create(); + logger.get.mockReturnValue(underlyingLogger); + expect(initContext.logger.get('anything')).toEqual(underlyingLogger); + }); + }); +}); diff --git a/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.ts b/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.ts index 41643b0e0250c..351dd581b5f83 100644 --- a/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.ts +++ b/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.ts @@ -35,6 +35,11 @@ export function createPluginInitializerContext( return { opaqueId, env: coreContext.env, + logger: { + get(...contextParts) { + return coreContext.logger.get('plugins', pluginManifest.id, ...contextParts); + }, + }, config: { get() { return pluginConfig as unknown as T; diff --git a/packages/core/plugins/core-plugins-browser-internal/src/test_helpers/mocks.ts b/packages/core/plugins/core-plugins-browser-internal/src/test_helpers/mocks.ts index fcd4e80c02def..7c013b17ec4cf 100644 --- a/packages/core/plugins/core-plugins-browser-internal/src/test_helpers/mocks.ts +++ b/packages/core/plugins/core-plugins-browser-internal/src/test_helpers/mocks.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { loggerMock } from '@kbn/logging-mocks'; import type { PluginInitializerContext } from '@kbn/core-plugins-browser'; export const createPluginInitializerContextMock = (config: unknown = {}) => { @@ -25,6 +26,7 @@ export const createPluginInitializerContextMock = (config: unknown = {}) => { dist: false, }, }, + logger: loggerMock.create(), config: { get: () => config as T, }, diff --git a/packages/core/plugins/core-plugins-browser-internal/tsconfig.json b/packages/core/plugins/core-plugins-browser-internal/tsconfig.json index 4283cbe1b760b..47ad657279cbb 100644 --- a/packages/core/plugins/core-plugins-browser-internal/tsconfig.json +++ b/packages/core/plugins/core-plugins-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel b/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel index 0d334ef02a291..dbe94e7ba9649 100644 --- a/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel +++ b/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel @@ -36,12 +36,14 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ + "//packages/kbn-logging-mocks", ] TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", "//packages/kbn-utility-types:npm_module_types", + "//packages/kbn-logging-mocks:npm_module_types", "//packages/core/plugins/core-plugins-browser-internal:npm_module_types", ] @@ -73,7 +75,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -87,6 +88,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +107,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/plugins/core-plugins-browser-mocks/package.json b/packages/core/plugins/core-plugins-browser-mocks/package.json index 98090f042ab02..b8cb7ed38fc34 100644 --- a/packages/core/plugins/core-plugins-browser-mocks/package.json +++ b/packages/core/plugins/core-plugins-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/plugins/core-plugins-browser-mocks/src/plugins_service.mock.ts b/packages/core/plugins/core-plugins-browser-mocks/src/plugins_service.mock.ts index c1539e7873683..75ec4e4570688 100644 --- a/packages/core/plugins/core-plugins-browser-mocks/src/plugins_service.mock.ts +++ b/packages/core/plugins/core-plugins-browser-mocks/src/plugins_service.mock.ts @@ -7,6 +7,7 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; +import { loggerMock } from '@kbn/logging-mocks'; import type { PluginInitializerContext } from '@kbn/core-plugins-browser'; import type { PluginsService, PluginsServiceSetup } from '@kbn/core-plugins-browser-internal'; @@ -43,6 +44,7 @@ const createPluginInitializerContextMock = (config: unknown = {}) => { dist: false, }, }, + logger: loggerMock.create(), config: { get: () => config as T, }, diff --git a/packages/core/plugins/core-plugins-browser-mocks/tsconfig.json b/packages/core/plugins/core-plugins-browser-mocks/tsconfig.json index 4283cbe1b760b..47ad657279cbb 100644 --- a/packages/core/plugins/core-plugins-browser-mocks/tsconfig.json +++ b/packages/core/plugins/core-plugins-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/plugins/core-plugins-browser/BUILD.bazel b/packages/core/plugins/core-plugins-browser/BUILD.bazel index fca01ef98d105..b56de1b3a8391 100644 --- a/packages/core/plugins/core-plugins-browser/BUILD.bazel +++ b/packages/core/plugins/core-plugins-browser/BUILD.bazel @@ -75,7 +75,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -89,6 +88,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -100,17 +107,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/plugins/core-plugins-browser/package.json b/packages/core/plugins/core-plugins-browser/package.json index f03af035d2235..20337d05ec8fc 100644 --- a/packages/core/plugins/core-plugins-browser/package.json +++ b/packages/core/plugins/core-plugins-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts b/packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts index 14aaaff31e946..c33abbfc386f9 100644 --- a/packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts +++ b/packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts @@ -7,6 +7,7 @@ */ import type { PluginOpaqueId } from '@kbn/core-base-common'; +import type { LoggerFactory } from '@kbn/logging'; import type { PackageInfo, EnvironmentMode } from '@kbn/config'; import type { Plugin } from './plugin'; @@ -37,6 +38,7 @@ export interface PluginInitializerContext mode: Readonly; packageInfo: Readonly; }; + readonly logger: LoggerFactory; readonly config: { get: () => T; }; diff --git a/packages/core/plugins/core-plugins-browser/tsconfig.json b/packages/core/plugins/core-plugins-browser/tsconfig.json index 4283cbe1b760b..47ad657279cbb 100644 --- a/packages/core/plugins/core-plugins-browser/tsconfig.json +++ b/packages/core/plugins/core-plugins-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/plugins/core-plugins-server-internal/BUILD.bazel b/packages/core/plugins/core-plugins-server-internal/BUILD.bazel new file mode 100644 index 0000000000000..480a21f44eed0 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/BUILD.bazel @@ -0,0 +1,153 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-plugins-server-internal" +PKG_REQUIRE_NAME = "@kbn/core-plugins-server-internal" + +SOURCE_FILES = glob( + [ + "**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//moment", + "@npm//rxjs", + "@npm//semver", + "@npm//type-detect", + "@npm//lodash", + "//packages/kbn-std", + "//packages/kbn-config", + "//packages/kbn-config-schema", + "//packages/kbn-logging", + "//packages/kbn-utils", + "//packages/core/base/core-base-common", + "//packages/core/base/core-base-server-internal", + "//packages/core/lifecycle/core-lifecycle-server-internal", + "//packages/core/elasticsearch/core-elasticsearch-server-internal", + "//packages/core/node/core-node-server", + "//packages/core/saved-objects/core-saved-objects-base-server-internal", + # test dependencies + "@npm//mock-fs", + "//packages/kbn-config-mocks", + "//packages/core/base/core-base-server-mocks", + "//packages/core/lifecycle/core-lifecycle-server-mocks", + "//packages/core/logging/core-logging-server-mocks", + "//packages/core/node/core-node-server-mocks", + "//packages/core/plugins/core-plugins-server", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//moment", + "@npm//rxjs", + "@npm//semver", + "@npm//type-detect", + "@npm//lodash", + "//packages/kbn-std:npm_module_types", + "//packages/kbn-config:npm_module_types", + "//packages/kbn-config-schema:npm_module_types", + "//packages/kbn-logging:npm_module_types", + "//packages/kbn-utils:npm_module_types", + "//packages/core/base/core-base-common:npm_module_types", + "//packages/core/base/core-base-server-internal:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", + "//packages/core/node/core-node-server:npm_module_types", + "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", + "//packages/core/http/core-http-request-handler-context-server:npm_module_types", + "//packages/core/lifecycle/core-lifecycle-server:npm_module_types", + "//packages/core/lifecycle/core-lifecycle-server-internal:npm_module_types", + "//packages/core/plugins/core-plugins-server:npm_module_types", + # test dependencies' mocks + "@npm//mock-fs", + "//packages/kbn-config-mocks:npm_module_types", + "//packages/core/base/core-base-server-mocks:npm_module_types", + "//packages/core/lifecycle/core-lifecycle-server-mocks:npm_module_types", + "//packages/core/logging/core-logging-server-mocks:npm_module_types", + "//packages/core/node/core-node-server-mocks:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/plugins/core-plugins-server-internal/README.md b/packages/core/plugins/core-plugins-server-internal/README.md new file mode 100644 index 0000000000000..7ca4a5600877f --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/README.md @@ -0,0 +1,3 @@ +# @kbn/core-plugins-server-internal + +This package contains the internal types and implementation for Core's server-side `plugins` service. diff --git a/packages/core/plugins/core-plugins-server-internal/index.ts b/packages/core/plugins/core-plugins-server-internal/index.ts new file mode 100644 index 0000000000000..072ffda4b4421 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { PluginsService, PluginWrapper, config, isNewPlatformPlugin } from './src'; +export type { + PluginsServiceSetup, + PluginsServiceStart, + DiscoveredPlugins, + PluginDependencies, +} from './src'; diff --git a/packages/core/plugins/core-plugins-server-internal/jest.config.js b/packages/core/plugins/core-plugins-server-internal/jest.config.js new file mode 100644 index 0000000000000..08315583a6f6d --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/plugins/core-plugins-server-internal'], +}; diff --git a/packages/core/plugins/core-plugins-server-internal/kibana.jsonc b/packages/core/plugins/core-plugins-server-internal/kibana.jsonc new file mode 100644 index 0000000000000..2354b5ea2054e --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-plugins-server-internal", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/plugins/core-plugins-server-internal/package.json b/packages/core/plugins/core-plugins-server-internal/package.json new file mode 100644 index 0000000000000..fef5ddbf7b61d --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/package.json @@ -0,0 +1,9 @@ +{ + "name": "@kbn/core-plugins-server-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/src/core/server/plugins/create_browser_config.test.ts b/packages/core/plugins/core-plugins-server-internal/src/create_browser_config.test.ts similarity index 98% rename from src/core/server/plugins/create_browser_config.test.ts rename to packages/core/plugins/core-plugins-server-internal/src/create_browser_config.test.ts index ca0366b7477fa..11f55d1bc1edb 100644 --- a/src/core/server/plugins/create_browser_config.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/create_browser_config.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { PluginConfigDescriptor } from './types'; +import type { PluginConfigDescriptor } from '@kbn/core-plugins-server'; import { createBrowserConfig } from './create_browser_config'; import { schema, TypeOf } from '@kbn/config-schema'; diff --git a/src/core/server/plugins/create_browser_config.ts b/packages/core/plugins/core-plugins-server-internal/src/create_browser_config.ts similarity index 98% rename from src/core/server/plugins/create_browser_config.ts rename to packages/core/plugins/core-plugins-server-internal/src/create_browser_config.ts index 0bf812d2e5cce..05844839934b2 100644 --- a/src/core/server/plugins/create_browser_config.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/create_browser_config.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { ExposedToBrowserDescriptor, PluginConfigDescriptor } from './types'; +import { ExposedToBrowserDescriptor, PluginConfigDescriptor } from '@kbn/core-plugins-server'; export const createBrowserConfig = ( config: T, diff --git a/src/core/server/plugins/discovery/index.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/index.ts similarity index 100% rename from src/core/server/plugins/discovery/index.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/index.ts diff --git a/src/core/server/plugins/discovery/is_camel_case.test.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/is_camel_case.test.ts similarity index 100% rename from src/core/server/plugins/discovery/is_camel_case.test.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/is_camel_case.test.ts diff --git a/src/core/server/plugins/discovery/is_camel_case.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/is_camel_case.ts similarity index 100% rename from src/core/server/plugins/discovery/is_camel_case.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/is_camel_case.ts diff --git a/src/core/server/plugins/discovery/plugin_discovery_error.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_discovery_error.ts similarity index 100% rename from src/core/server/plugins/discovery/plugin_discovery_error.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_discovery_error.ts diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.test.mocks.ts similarity index 100% rename from src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.test.mocks.ts diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.test.ts similarity index 100% rename from src/core/server/plugins/discovery/plugin_manifest_parser.test.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.test.ts diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts similarity index 99% rename from src/core/server/plugins/discovery/plugin_manifest_parser.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts index 0a54899856ac1..5402b9218620d 100644 --- a/src/core/server/plugins/discovery/plugin_manifest_parser.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugin_manifest_parser.ts @@ -13,7 +13,7 @@ import { promisify } from 'util'; import { snakeCase } from 'lodash'; import { isConfigPath, PackageInfo } from '@kbn/config'; import { PluginType } from '@kbn/core-base-common'; -import { PluginManifest } from '../types'; +import { PluginManifest } from '@kbn/core-plugins-server'; import { PluginDiscoveryError } from './plugin_discovery_error'; import { isCamelCase } from './is_camel_case'; diff --git a/src/core/server/plugins/discovery/plugins_discovery.test.mocks.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.test.mocks.ts similarity index 100% rename from src/core/server/plugins/discovery/plugins_discovery.test.mocks.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.test.mocks.ts diff --git a/src/core/server/plugins/discovery/plugins_discovery.test.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.test.ts similarity index 99% rename from src/core/server/plugins/discovery/plugins_discovery.test.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.test.ts index 03c86fb46b5eb..8c1c50e8a612c 100644 --- a/src/core/server/plugins/discovery/plugins_discovery.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.test.ts @@ -22,7 +22,7 @@ import type { NodeInfo } from '@kbn/core-node-server'; import { PluginsConfig, PluginsConfigType, config } from '../plugins_config'; import type { InstanceInfo } from '../plugin_context'; import { discover } from './plugins_discovery'; -import { PluginType } from '../types'; +import { PluginType } from '@kbn/core-base-common'; const KIBANA_ROOT = process.cwd(); diff --git a/src/core/server/plugins/discovery/plugins_discovery.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.ts similarity index 100% rename from src/core/server/plugins/discovery/plugins_discovery.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.ts diff --git a/src/core/server/plugins/discovery/scan_plugin_search_paths.test.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/scan_plugin_search_paths.test.ts similarity index 100% rename from src/core/server/plugins/discovery/scan_plugin_search_paths.test.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/scan_plugin_search_paths.test.ts diff --git a/src/core/server/plugins/discovery/scan_plugin_search_paths.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/scan_plugin_search_paths.ts similarity index 100% rename from src/core/server/plugins/discovery/scan_plugin_search_paths.ts rename to packages/core/plugins/core-plugins-server-internal/src/discovery/scan_plugin_search_paths.ts diff --git a/packages/core/plugins/core-plugins-server-internal/src/index.ts b/packages/core/plugins/core-plugins-server-internal/src/index.ts new file mode 100644 index 0000000000000..3eb852b641fcd --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/src/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { PluginsService } from './plugins_service'; +export type { + PluginsServiceSetup, + PluginsServiceStart, + DiscoveredPlugins, +} from './plugins_service'; +export { config } from './plugins_config'; +/** @internal */ +export { isNewPlatformPlugin } from './discovery'; +export type { PluginDependencies } from './types'; +export { PluginWrapper } from './plugin'; diff --git a/packages/core/plugins/core-plugins-server-internal/src/legacy_config.test.ts b/packages/core/plugins/core-plugins-server-internal/src/legacy_config.test.ts new file mode 100644 index 0000000000000..2bd50db020d0e --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/src/legacy_config.test.ts @@ -0,0 +1,52 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { take } from 'rxjs/operators'; +import { getGlobalConfig, getGlobalConfig$ } from './legacy_config'; +import { duration } from 'moment'; +import { fromRoot } from '@kbn/utils'; +import { ByteSizeValue } from '@kbn/config-schema'; +import { createCoreContextConfigServiceMock } from './test_helpers'; + +describe('Legacy config', () => { + describe('getGlobalConfig', () => { + it('should return the global config', async () => { + const configService = createCoreContextConfigServiceMock(); + await configService.validate(); + + const legacyConfig = getGlobalConfig(configService); + + expect(legacyConfig).toStrictEqual({ + elasticsearch: { + shardTimeout: duration(30, 's'), + requestTimeout: duration(30, 's'), + pingTimeout: duration(30, 's'), + }, + path: { data: fromRoot('data') }, + savedObjects: { maxImportPayloadBytes: new ByteSizeValue(26214400) }, + }); + }); + }); + + describe('getGlobalConfig$', () => { + it('should return an observable for the global config', async () => { + const configService = createCoreContextConfigServiceMock(); + + const legacyConfig = await getGlobalConfig$(configService).pipe(take(1)).toPromise(); + + expect(legacyConfig).toStrictEqual({ + elasticsearch: { + shardTimeout: duration(30, 's'), + requestTimeout: duration(30, 's'), + pingTimeout: duration(30, 's'), + }, + path: { data: fromRoot('data') }, + savedObjects: { maxImportPayloadBytes: new ByteSizeValue(26214400) }, + }); + }); + }); +}); diff --git a/src/core/server/plugins/legacy_config.ts b/packages/core/plugins/core-plugins-server-internal/src/legacy_config.ts similarity index 96% rename from src/core/server/plugins/legacy_config.ts rename to packages/core/plugins/core-plugins-server-internal/src/legacy_config.ts index de86345c5b7ba..46e792d6b226d 100644 --- a/src/core/server/plugins/legacy_config.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/legacy_config.ts @@ -20,7 +20,7 @@ import { type SavedObjectsConfigType, savedObjectsConfig, } from '@kbn/core-saved-objects-base-server-internal'; -import { SharedGlobalConfig, SharedGlobalConfigKeys } from './types'; +import { SharedGlobalConfig, SharedGlobalConfigKeys } from '@kbn/core-plugins-server'; const createGlobalConfig = ({ elasticsearch, diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugin.test.ts b/packages/core/plugins/core-plugins-server-internal/src/plugin.test.ts new file mode 100644 index 0000000000000..008b8eaf6665a --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/src/plugin.test.ts @@ -0,0 +1,580 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { join } from 'path'; +import { BehaviorSubject } from 'rxjs'; +import { REPO_ROOT } from '@kbn/utils'; +import { schema } from '@kbn/config-schema'; +import { Env } from '@kbn/config'; + +import { configServiceMock, getEnvOptions } from '@kbn/config-mocks'; +import type { CoreContext } from '@kbn/core-base-server-internal'; +import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; +import type { NodeInfo } from '@kbn/core-node-server'; +import { nodeServiceMock } from '@kbn/core-node-server-mocks'; +import type { PluginManifest } from '@kbn/core-plugins-server'; +import { PluginWrapper } from './plugin'; +import { PluginType } from '@kbn/core-base-common'; +import { coreInternalLifecycleMock } from '@kbn/core-lifecycle-server-mocks'; + +import { + createPluginInitializerContext, + createPluginSetupContext, + InstanceInfo, +} from './plugin_context'; + +const mockPluginInitializer = jest.fn(); +const logger = loggingSystemMock.create(); +jest.doMock( + join('plugin-with-initializer-path', 'server'), + () => ({ plugin: mockPluginInitializer }), + { virtual: true } +); +jest.doMock(join('plugin-without-initializer-path', 'server'), () => ({}), { + virtual: true, +}); +jest.doMock(join('plugin-with-wrong-initializer-path', 'server'), () => ({ plugin: {} }), { + virtual: true, +}); + +const OSS_PLUGIN_PATH_POSIX = '/kibana/src/plugins/ossPlugin'; +const OSS_PLUGIN_PATH_WINDOWS = 'C:\\kibana\\src\\plugins\\ossPlugin'; +const XPACK_PLUGIN_PATH_POSIX = '/kibana/x-pack/plugins/xPackPlugin'; +const XPACK_PLUGIN_PATH_WINDOWS = 'C:\\kibana\\x-pack\\plugins\\xPackPlugin'; + +function createPluginManifest(manifestProps: Partial = {}): PluginManifest { + return { + id: 'some-plugin-id', + version: 'some-version', + configPath: 'path', + kibanaVersion: '7.0.0', + type: PluginType.standard, + requiredPlugins: ['some-required-dep'], + optionalPlugins: ['some-optional-dep'], + requiredBundles: [], + server: true, + ui: true, + owner: { name: 'Core' }, + ...manifestProps, + }; +} + +const configService = configServiceMock.create(); +configService.atPath.mockReturnValue(new BehaviorSubject({ initialize: true })); + +let coreId: symbol; +let env: Env; +let coreContext: CoreContext; +let instanceInfo: InstanceInfo; +let nodeInfo: NodeInfo; + +const setupDeps = coreInternalLifecycleMock.createInternalSetup(); + +beforeEach(() => { + coreId = Symbol('core'); + env = Env.createDefault(REPO_ROOT, getEnvOptions()); + instanceInfo = { + uuid: 'instance-uuid', + }; + nodeInfo = nodeServiceMock.createInternalPrebootContract(); + + coreContext = { coreId, env, logger, configService: configService as any }; +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +test('`constructor` correctly initializes plugin instance', () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'some-plugin-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + expect(plugin.name).toBe('some-plugin-id'); + expect(plugin.configPath).toBe('path'); + expect(plugin.path).toBe('some-plugin-path'); + expect(plugin.source).toBe('external'); // see below for test cases for non-external sources (OSS and X-Pack) + expect(plugin.requiredPlugins).toEqual(['some-required-dep']); + expect(plugin.optionalPlugins).toEqual(['some-optional-dep']); +}); + +describe('`constructor` correctly sets non-external source', () => { + function createPlugin(path: string) { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + return new PluginWrapper({ + path, + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + } + + test('for OSS plugin in POSIX', () => { + const plugin = createPlugin(OSS_PLUGIN_PATH_POSIX); + expect(plugin.source).toBe('oss'); + }); + + test('for OSS plugin in Windows', () => { + const plugin = createPlugin(OSS_PLUGIN_PATH_WINDOWS); + expect(plugin.source).toBe('oss'); + }); + + test('for X-Pack plugin in POSIX', () => { + const plugin = createPlugin(XPACK_PLUGIN_PATH_POSIX); + expect(plugin.source).toBe('x-pack'); + }); + + test('for X-Pack plugin in Windows', () => { + const plugin = createPlugin(XPACK_PLUGIN_PATH_WINDOWS); + expect(plugin.source).toBe('x-pack'); + }); +}); + +test('`setup` fails if `plugin` initializer is not exported', () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-without-initializer-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + expect(() => + plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}) + ).toThrowErrorMatchingInlineSnapshot( + `"Plugin \\"some-plugin-id\\" does not export \\"plugin\\" definition (plugin-without-initializer-path)."` + ); +}); + +test('`setup` fails if plugin initializer is not a function', () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-wrong-initializer-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + expect(() => + plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}) + ).toThrowErrorMatchingInlineSnapshot( + `"Definition of plugin \\"some-plugin-id\\" should be a function (plugin-with-wrong-initializer-path)."` + ); +}); + +test('`setup` fails if initializer does not return object', () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-initializer-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + mockPluginInitializer.mockReturnValue(null); + + expect(() => + plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}) + ).toThrowErrorMatchingInlineSnapshot( + `"Initializer for plugin \\"some-plugin-id\\" is expected to return plugin instance, but returned \\"null\\"."` + ); +}); + +test('`setup` fails if object returned from initializer does not define `setup` function', () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-initializer-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + const mockPluginInstance = { run: jest.fn() }; + mockPluginInitializer.mockReturnValue(mockPluginInstance); + + expect(() => + plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}) + ).toThrowErrorMatchingInlineSnapshot( + `"Instance of plugin \\"some-plugin-id\\" does not define \\"setup\\" function."` + ); +}); + +test('`setup` initializes plugin and calls appropriate lifecycle hook', async () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const initializerContext = createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }); + const plugin = new PluginWrapper({ + path: 'plugin-with-initializer-path', + manifest, + opaqueId, + initializerContext, + }); + + const mockPluginInstance = { setup: jest.fn().mockResolvedValue({ contract: 'yes' }) }; + mockPluginInitializer.mockReturnValue(mockPluginInstance); + + const setupContext = createPluginSetupContext(coreContext, setupDeps, plugin); + const setupDependencies = { 'some-required-dep': { contract: 'no' } }; + await expect(plugin.setup(setupContext, setupDependencies)).resolves.toEqual({ contract: 'yes' }); + + expect(mockPluginInitializer).toHaveBeenCalledTimes(1); + expect(mockPluginInitializer).toHaveBeenCalledWith(initializerContext); + + expect(mockPluginInstance.setup).toHaveBeenCalledTimes(1); + expect(mockPluginInstance.setup).toHaveBeenCalledWith(setupContext, setupDependencies); +}); + +test('`start` fails if setup is not called first', () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'some-plugin-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + expect(() => plugin.start({} as any, {} as any)).toThrowErrorMatchingInlineSnapshot( + `"Plugin \\"some-plugin-id\\" can't be started since it isn't set up."` + ); +}); + +test('`start` fails invoked for the `preboot` plugin', async () => { + const manifest = createPluginManifest({ type: PluginType.preboot }); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-initializer-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + const mockPluginInstance = { setup: jest.fn() }; + mockPluginInitializer.mockReturnValue(mockPluginInstance); + + await plugin.setup({} as any, {} as any); + + expect(() => plugin.start({} as any, {} as any)).toThrowErrorMatchingInlineSnapshot( + `"Plugin \\"some-plugin-id\\" is a preboot plugin and cannot be started."` + ); +}); + +test('`start` calls plugin.start with context and dependencies', async () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-initializer-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + const context = { any: 'thing' } as any; + const deps = { otherDep: 'value' }; + + const pluginStartContract = { contract: 'start-contract' }; + const mockPluginInstance = { + setup: jest.fn(), + start: jest.fn().mockResolvedValue(pluginStartContract), + }; + mockPluginInitializer.mockReturnValue(mockPluginInstance); + + await plugin.setup({} as any, {} as any); + + const startContract = await plugin.start(context, deps); + + expect(startContract).toBe(pluginStartContract); + expect(mockPluginInstance.start).toHaveBeenCalledWith(context, deps); +}); + +test("`start` resolves `startDependencies` Promise after plugin's start", async () => { + expect.assertions(2); + + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-initializer-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + const startContext = { any: 'thing' } as any; + const pluginDeps = { someDep: 'value' }; + const pluginStartContract = { + someApi: () => 'foo', + }; + + let startDependenciesResolved = false; + + const mockPluginInstance = { + setup: jest.fn(), + start: async () => { + // delay to ensure startDependencies is not resolved until after the plugin instance's start resolves. + await new Promise((resolve) => setTimeout(resolve, 10)); + expect(startDependenciesResolved).toBe(false); + return pluginStartContract; + }, + }; + mockPluginInitializer.mockReturnValue(mockPluginInstance); + + await plugin.setup({} as any, {} as any); + + const startDependenciesCheck = plugin.startDependencies.then((resolvedStartDeps) => { + startDependenciesResolved = true; + expect(resolvedStartDeps).toEqual([startContext, pluginDeps, pluginStartContract]); + }); + + await plugin.start(startContext, pluginDeps); + await startDependenciesCheck; +}); + +test('`stop` fails if plugin is not set up', async () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-initializer-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + const mockPluginInstance = { setup: jest.fn(), stop: jest.fn() }; + mockPluginInitializer.mockReturnValue(mockPluginInstance); + + await expect(plugin.stop()).rejects.toMatchInlineSnapshot( + `[Error: Plugin "some-plugin-id" can't be stopped since it isn't set up.]` + ); + expect(mockPluginInstance.stop).not.toHaveBeenCalled(); +}); + +test('`stop` does nothing if plugin does not define `stop` function', async () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-initializer-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + mockPluginInitializer.mockReturnValue({ setup: jest.fn() }); + await plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}); + + await expect(plugin.stop()).resolves.toBeUndefined(); +}); + +test('`stop` calls `stop` defined by the plugin instance', async () => { + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-initializer-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + const mockPluginInstance = { setup: jest.fn(), stop: jest.fn() }; + mockPluginInitializer.mockReturnValue(mockPluginInstance); + await plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}); + + await expect(plugin.stop()).resolves.toBeUndefined(); + expect(mockPluginInstance.stop).toHaveBeenCalledTimes(1); +}); + +describe('#getConfigSchema()', () => { + it('reads config schema from plugin', () => { + const pluginSchema = schema.any(); + const configDescriptor = { + schema: pluginSchema, + }; + jest.doMock( + join('plugin-with-schema', 'server'), + () => ({ + config: configDescriptor, + }), + { virtual: true } + ); + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-schema', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + + expect(plugin.getConfigDescriptor()).toBe(configDescriptor); + }); + + it('returns null if config definition not specified', () => { + jest.doMock(join('plugin-with-no-definition', 'server'), () => ({}), { virtual: true }); + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-no-definition', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + expect(plugin.getConfigDescriptor()).toBe(null); + }); + + it('returns null for plugins without a server part', () => { + const manifest = createPluginManifest({ server: false }); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-with-no-definition', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + expect(plugin.getConfigDescriptor()).toBe(null); + }); + + it('throws if plugin contains invalid schema', () => { + jest.doMock( + join('plugin-invalid-schema', 'server'), + () => ({ + config: { + schema: { + validate: () => null, + }, + }, + }), + { virtual: true } + ); + const manifest = createPluginManifest(); + const opaqueId = Symbol(); + const plugin = new PluginWrapper({ + path: 'plugin-invalid-schema', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }), + }); + expect(() => plugin.getConfigDescriptor()).toThrowErrorMatchingInlineSnapshot( + `"Configuration schema expected to be an instance of Type"` + ); + }); +}); diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugin.ts b/packages/core/plugins/core-plugins-server-internal/src/plugin.ts new file mode 100644 index 0000000000000..5446e983676c0 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/src/plugin.ts @@ -0,0 +1,217 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { join } from 'path'; +import typeDetect from 'type-detect'; +import { firstValueFrom, Subject } from 'rxjs'; +import { isPromise } from '@kbn/std'; +import { isConfigSchema } from '@kbn/config-schema'; +import type { Logger } from '@kbn/logging'; +import { type PluginOpaqueId, PluginType } from '@kbn/core-base-common'; +import type { + AsyncPlugin, + Plugin, + PluginConfigDescriptor, + PluginInitializer, + PluginInitializerContext, + PluginManifest, + PrebootPlugin, +} from '@kbn/core-plugins-server'; +import type { CorePreboot, CoreSetup, CoreStart } from '@kbn/core-lifecycle-server'; + +const OSS_PATH_REGEX = /[\/|\\]src[\/|\\]plugins[\/|\\]/; // Matches src/plugins directory on POSIX and Windows +const XPACK_PATH_REGEX = /[\/|\\]x-pack[\/|\\]plugins[\/|\\]/; // Matches x-pack/plugins directory on POSIX and Windows + +/** + * Lightweight wrapper around discovered plugin that is responsible for instantiating + * plugin and dispatching proper context and dependencies into plugin's lifecycle hooks. + * + * @internal + */ +export class PluginWrapper< + TSetup = unknown, + TStart = unknown, + TPluginsSetup extends object = object, + TPluginsStart extends object = object +> { + public readonly path: string; + public readonly source: 'oss' | 'x-pack' | 'external'; + public readonly manifest: PluginManifest; + public readonly opaqueId: PluginOpaqueId; + public readonly name: PluginManifest['id']; + public readonly configPath: PluginManifest['configPath']; + public readonly requiredPlugins: PluginManifest['requiredPlugins']; + public readonly optionalPlugins: PluginManifest['optionalPlugins']; + public readonly requiredBundles: PluginManifest['requiredBundles']; + public readonly includesServerPlugin: PluginManifest['server']; + public readonly includesUiPlugin: PluginManifest['ui']; + + private readonly log: Logger; + private readonly initializerContext: PluginInitializerContext; + + private instance?: + | Plugin + | PrebootPlugin + | AsyncPlugin; + + private readonly startDependencies$ = new Subject<[CoreStart, TPluginsStart, TStart]>(); + public readonly startDependencies = firstValueFrom(this.startDependencies$); + + constructor( + public readonly params: { + readonly path: string; + readonly manifest: PluginManifest; + readonly opaqueId: PluginOpaqueId; + readonly initializerContext: PluginInitializerContext; + } + ) { + this.path = params.path; + this.source = getPluginSource(params.path); + this.manifest = params.manifest; + this.opaqueId = params.opaqueId; + this.initializerContext = params.initializerContext; + this.log = params.initializerContext.logger.get(); + this.name = params.manifest.id; + this.configPath = params.manifest.configPath; + this.requiredPlugins = params.manifest.requiredPlugins; + this.optionalPlugins = params.manifest.optionalPlugins; + this.requiredBundles = params.manifest.requiredBundles; + this.includesServerPlugin = params.manifest.server; + this.includesUiPlugin = params.manifest.ui; + } + + /** + * Instantiates plugin and calls `setup` function exposed by the plugin initializer. + * @param setupContext Context that consists of various core services tailored specifically + * for the `setup` lifecycle event. + * @param plugins The dictionary where the key is the dependency name and the value + * is the contract returned by the dependency's `setup` function. + */ + public setup( + setupContext: CoreSetup | CorePreboot, + plugins: TPluginsSetup + ): TSetup | Promise { + this.instance = this.createPluginInstance(); + + if (this.isPrebootPluginInstance(this.instance)) { + return this.instance.setup(setupContext as CorePreboot, plugins); + } + + return this.instance.setup(setupContext as CoreSetup, plugins); + } + + /** + * Calls `start` function exposed by the initialized plugin. + * @param startContext Context that consists of various core services tailored specifically + * for the `start` lifecycle event. + * @param plugins The dictionary where the key is the dependency name and the value + * is the contract returned by the dependency's `start` function. + */ + public start(startContext: CoreStart, plugins: TPluginsStart): TStart | Promise { + if (this.instance === undefined) { + throw new Error(`Plugin "${this.name}" can't be started since it isn't set up.`); + } + + if (this.isPrebootPluginInstance(this.instance)) { + throw new Error(`Plugin "${this.name}" is a preboot plugin and cannot be started.`); + } + + const startContract = this.instance.start(startContext, plugins); + if (isPromise(startContract)) { + return startContract.then((resolvedContract) => { + this.startDependencies$.next([startContext, plugins, resolvedContract]); + return resolvedContract; + }); + } else { + this.startDependencies$.next([startContext, plugins, startContract]); + return startContract; + } + } + + /** + * Calls optional `stop` function exposed by the plugin initializer. + */ + public async stop() { + if (this.instance === undefined) { + throw new Error(`Plugin "${this.name}" can't be stopped since it isn't set up.`); + } + + if (typeof this.instance.stop === 'function') { + await this.instance.stop(); + } + + this.instance = undefined; + } + + public getConfigDescriptor(): PluginConfigDescriptor | null { + if (!this.manifest.server) { + return null; + } + const pluginPathServer = join(this.path, 'server'); + // eslint-disable-next-line @typescript-eslint/no-var-requires + const pluginDefinition = require(pluginPathServer); + + if (!('config' in pluginDefinition)) { + this.log.debug(`"${pluginPathServer}" does not export "config".`); + return null; + } + + const configDescriptor = pluginDefinition.config; + if (!isConfigSchema(configDescriptor.schema)) { + throw new Error('Configuration schema expected to be an instance of Type'); + } + return configDescriptor; + } + + private createPluginInstance() { + this.log.debug('Initializing plugin'); + + // eslint-disable-next-line @typescript-eslint/no-var-requires + const pluginDefinition = require(join(this.path, 'server')); + if (!('plugin' in pluginDefinition)) { + throw new Error(`Plugin "${this.name}" does not export "plugin" definition (${this.path}).`); + } + + const { plugin: initializer } = pluginDefinition as { + plugin: PluginInitializer; + }; + if (!initializer || typeof initializer !== 'function') { + throw new Error(`Definition of plugin "${this.name}" should be a function (${this.path}).`); + } + + const instance = initializer(this.initializerContext); + if (!instance || typeof instance !== 'object') { + throw new Error( + `Initializer for plugin "${ + this.manifest.id + }" is expected to return plugin instance, but returned "${typeDetect(instance)}".` + ); + } + + if (typeof instance.setup !== 'function') { + throw new Error(`Instance of plugin "${this.name}" does not define "setup" function.`); + } + + return instance; + } + + private isPrebootPluginInstance( + instance: PluginWrapper['instance'] + ): instance is PrebootPlugin { + return this.manifest.type === PluginType.preboot; + } +} + +function getPluginSource(path: string): 'oss' | 'x-pack' | 'external' { + if (OSS_PATH_REGEX.test(path)) { + return 'oss'; + } else if (XPACK_PATH_REGEX.test(path)) { + return 'x-pack'; + } + return 'external'; +} diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugin_context.test.ts b/packages/core/plugins/core-plugins-server-internal/src/plugin_context.test.ts new file mode 100644 index 0000000000000..978bf62222f07 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/src/plugin_context.test.ts @@ -0,0 +1,252 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { duration } from 'moment'; +import { first } from 'rxjs/operators'; +import { REPO_ROOT, fromRoot } from '@kbn/utils'; +import { rawConfigServiceMock, getEnvOptions, configServiceMock } from '@kbn/config-mocks'; +import type { CoreContext } from '@kbn/core-base-server-internal'; +import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; +import type { NodeInfo } from '@kbn/core-node-server'; +import { nodeServiceMock } from '@kbn/core-node-server-mocks'; +import { + createPluginInitializerContext, + createPluginPrebootSetupContext, + InstanceInfo, +} from './plugin_context'; + +import { PluginType } from '@kbn/core-base-common'; +import { PluginManifest } from '@kbn/core-plugins-server'; +import { schema, ByteSizeValue } from '@kbn/config-schema'; +import { ConfigService, Env } from '@kbn/config'; +import { PluginWrapper } from './plugin'; + +import { coreInternalLifecycleMock } from '@kbn/core-lifecycle-server-mocks'; +import { mockCoreContext } from '@kbn/core-base-server-mocks'; +import { createCoreContextConfigServiceMock } from './test_helpers'; + +function createPluginManifest(manifestProps: Partial = {}): PluginManifest { + return { + id: 'some-plugin-id', + version: 'some-version', + configPath: 'path', + kibanaVersion: '7.0.0', + type: PluginType.standard, + requiredPlugins: ['some-required-dep'], + requiredBundles: [], + optionalPlugins: ['some-optional-dep'], + server: true, + ui: true, + owner: { + name: 'Core', + githubTeam: 'kibana-core', + }, + ...manifestProps, + }; +} + +describe('createPluginInitializerContext', () => { + let logger: ReturnType; + let coreId: symbol; + let opaqueId: symbol; + let env: Env; + let coreContext: CoreContext; + let instanceInfo: InstanceInfo; + let nodeInfo: NodeInfo; + + beforeEach(async () => { + logger = loggingSystemMock.create(); + coreId = Symbol('core'); + opaqueId = Symbol(); + instanceInfo = { + uuid: 'instance-uuid', + }; + nodeInfo = nodeServiceMock.createInternalPrebootContract(); + env = Env.createDefault(REPO_ROOT, getEnvOptions()); + coreContext = mockCoreContext.create({ + env, + logger, + configService: configServiceMock.create(), + }); + }); + + describe('context.config', () => { + it('config.get() should return the plugin config synchronously', async () => { + const config$ = rawConfigServiceMock.create({ + rawConfig: { + plugin: { + foo: 'bar', + answer: 42, + }, + }, + }); + + const configService = new ConfigService(config$, env, logger); + configService.setSchema( + 'plugin', + schema.object({ + foo: schema.string(), + answer: schema.number(), + }) + ); + await configService.validate(); + + coreContext = { coreId, env, logger, configService }; + + const manifest = createPluginManifest({ + configPath: 'plugin', + }); + + const pluginInitializerContext = createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }); + + expect(pluginInitializerContext.config.get()).toEqual({ + foo: 'bar', + answer: 42, + }); + }); + + it('config.globalConfig$ should be an observable for the global config', async () => { + const configService = createCoreContextConfigServiceMock(); + + coreContext = { coreId, env, logger, configService }; + + const manifest = createPluginManifest(); + + const pluginInitializerContext = createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }); + + expect(pluginInitializerContext.config.legacy.globalConfig$).toBeDefined(); + + const configObject = await pluginInitializerContext.config.legacy.globalConfig$ + .pipe(first()) + .toPromise(); + expect(configObject).toStrictEqual({ + elasticsearch: { + shardTimeout: duration(30, 's'), + requestTimeout: duration(30, 's'), + pingTimeout: duration(30, 's'), + }, + path: { data: fromRoot('data') }, + savedObjects: { maxImportPayloadBytes: new ByteSizeValue(26214400) }, + }); + }); + }); + + describe('context.env', () => { + it('should expose the correct instance uuid', () => { + const manifest = createPluginManifest(); + instanceInfo = { + uuid: 'kibana-uuid', + }; + const pluginInitializerContext = createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo, + nodeInfo, + }); + expect(pluginInitializerContext.env.instanceUuid).toBe('kibana-uuid'); + }); + + it('should expose paths to the config files', () => { + coreContext = { + ...coreContext, + env: Env.createDefault( + REPO_ROOT, + getEnvOptions({ + configs: ['/home/kibana/config/kibana.yml', '/home/kibana/config/kibana.dev.yml'], + }) + ), + }; + const pluginInitializerContext = createPluginInitializerContext({ + coreContext, + opaqueId, + manifest: createPluginManifest(), + instanceInfo, + nodeInfo, + }); + expect(pluginInitializerContext.env.configs).toEqual([ + '/home/kibana/config/kibana.yml', + '/home/kibana/config/kibana.dev.yml', + ]); + }); + }); + + describe('context.node', () => { + it('should expose the correct node roles', () => { + const pluginInitializerContext = createPluginInitializerContext({ + coreContext, + opaqueId, + manifest: createPluginManifest(), + instanceInfo, + nodeInfo: { roles: { backgroundTasks: false, ui: true } }, + }); + expect(pluginInitializerContext.node.roles.backgroundTasks).toBe(false); + expect(pluginInitializerContext.node.roles.ui).toBe(true); + }); + }); +}); + +describe('createPluginPrebootSetupContext', () => { + let coreContext: CoreContext; + let opaqueId: symbol; + let nodeInfo: NodeInfo; + + beforeEach(async () => { + opaqueId = Symbol(); + coreContext = { + coreId: Symbol('core'), + env: Env.createDefault(REPO_ROOT, getEnvOptions()), + logger: loggingSystemMock.create(), + configService: configServiceMock.create(), + }; + nodeInfo = nodeServiceMock.createInternalPrebootContract(); + }); + + it('`holdSetupUntilResolved` captures plugin.name', () => { + const manifest = createPluginManifest(); + const plugin = new PluginWrapper({ + path: 'some-path', + manifest, + opaqueId, + initializerContext: createPluginInitializerContext({ + coreContext, + opaqueId, + manifest, + instanceInfo: { + uuid: 'instance-uuid', + }, + nodeInfo, + }), + }); + + const corePreboot = coreInternalLifecycleMock.createInternalPreboot(); + const prebootSetupContext = createPluginPrebootSetupContext(coreContext, corePreboot, plugin); + + const holdSetupPromise = Promise.resolve(undefined); + prebootSetupContext.preboot.holdSetupUntilResolved('some-reason', holdSetupPromise); + + expect(corePreboot.preboot.holdSetupUntilResolved).toHaveBeenCalledTimes(1); + expect(corePreboot.preboot.holdSetupUntilResolved).toHaveBeenCalledWith( + 'some-plugin-id', + 'some-reason', + holdSetupPromise + ); + }); +}); diff --git a/src/core/server/plugins/plugin_context.ts b/packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts similarity index 97% rename from src/core/server/plugins/plugin_context.ts rename to packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts index 97b165617b68e..d1bec41373c9d 100644 --- a/src/core/server/plugins/plugin_context.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts @@ -11,16 +11,16 @@ import type { CoreContext } from '@kbn/core-base-server-internal'; import type { PluginOpaqueId } from '@kbn/core-base-common'; import type { NodeInfo } from '@kbn/core-node-server'; import type { IRouter, IContextProvider } from '@kbn/core-http-server'; -import type { RequestHandlerContext } from '..'; +import { PluginInitializerContext, PluginManifest } from '@kbn/core-plugins-server'; +import { CorePreboot, CoreSetup, CoreStart } from '@kbn/core-lifecycle-server'; +import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; import { PluginWrapper } from './plugin'; import { PluginsServicePrebootSetupDeps, PluginsServiceSetupDeps, PluginsServiceStartDeps, } from './plugins_service'; -import { PluginInitializerContext, PluginManifest } from './types'; import { getGlobalConfig, getGlobalConfig$ } from './legacy_config'; -import { CorePreboot, CoreSetup, CoreStart } from '..'; /** @internal */ export interface InstanceInfo { diff --git a/src/core/server/plugins/plugins_config.test.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_config.test.ts similarity index 100% rename from src/core/server/plugins/plugins_config.test.ts rename to packages/core/plugins/core-plugins-server-internal/src/plugins_config.test.ts diff --git a/src/core/server/plugins/plugins_config.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_config.ts similarity index 100% rename from src/core/server/plugins/plugins_config.ts rename to packages/core/plugins/core-plugins-server-internal/src/plugins_config.ts diff --git a/src/core/server/plugins/plugins_service.test.mocks.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.mocks.ts similarity index 100% rename from src/core/server/plugins/plugins_service.test.mocks.ts rename to packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.mocks.ts diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.ts new file mode 100644 index 0000000000000..4664db6e710c7 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.ts @@ -0,0 +1,1387 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { mockDiscover, mockPackage } from './plugins_service.test.mocks'; + +import { resolve, join } from 'path'; +import { BehaviorSubject, from } from 'rxjs'; +import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; +import { REPO_ROOT } from '@kbn/utils'; +import { schema } from '@kbn/config-schema'; +import { ConfigPath, ConfigService, Env } from '@kbn/config'; + +import { rawConfigServiceMock, getEnvOptions } from '@kbn/config-mocks'; +import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; +import { environmentServiceMock } from '@kbn/core-environment-server-mocks'; +import { nodeServiceMock } from '@kbn/core-node-server-mocks'; +import { coreInternalLifecycleMock } from '@kbn/core-lifecycle-server-mocks'; +import { PluginDiscoveryError } from './discovery'; +import { PluginWrapper } from './plugin'; +import { PluginsService } from './plugins_service'; +import { PluginsSystem } from './plugins_system'; +import { config } from './plugins_config'; +import { take } from 'rxjs/operators'; +import type { PluginConfigDescriptor } from '@kbn/core-plugins-server'; +import { DiscoveredPlugin, PluginType } from '@kbn/core-base-common'; + +const MockPluginsSystem: jest.Mock> = PluginsSystem as any; + +let pluginsService: PluginsService; +let config$: BehaviorSubject>; +let configService: ConfigService; +let coreId: symbol; +let env: Env; +let prebootMockPluginSystem: jest.Mocked>; +let standardMockPluginSystem: jest.Mocked>; +let environmentPreboot: ReturnType; +let nodePreboot: ReturnType; + +const prebootDeps = coreInternalLifecycleMock.createInternalPreboot(); +const setupDeps = coreInternalLifecycleMock.createInternalSetup(); +const startDeps = coreInternalLifecycleMock.createInternalStart(); +const logger = loggingSystemMock.create(); + +expect.addSnapshotSerializer(createAbsolutePathSerializer()); + +['path-1', 'path-2', 'path-3', 'path-4', 'path-5', 'path-6', 'path-7', 'path-8'].forEach((path) => { + [PluginType.preboot, PluginType.standard].forEach((type) => { + jest.doMock(join(`${path}-${type}`, 'server'), () => ({}), { + virtual: true, + }); + }); +}); + +const OSS_PLUGIN_PATH = '/kibana/src/plugins/ossPlugin'; +const XPACK_PLUGIN_PATH = '/kibana/x-pack/plugins/xPackPlugin'; +const EXTERNAL_PLUGIN_PATH = '/kibana/plugins/externalPlugin'; +[OSS_PLUGIN_PATH, XPACK_PLUGIN_PATH, EXTERNAL_PLUGIN_PATH].forEach((path) => { + jest.doMock(join(path, 'server'), () => ({}), { + virtual: true, + }); +}); + +const createPlugin = ( + id: string, + { + path = id, + disabled = false, + version = 'some-version', + type = PluginType.standard, + requiredPlugins = [], + requiredBundles = [], + optionalPlugins = [], + kibanaVersion = '7.0.0', + configPath = [path], + server = true, + ui = true, + }: { + path?: string; + disabled?: boolean; + version?: string; + type?: PluginType; + requiredPlugins?: string[]; + requiredBundles?: string[]; + optionalPlugins?: string[]; + kibanaVersion?: string; + configPath?: ConfigPath; + server?: boolean; + ui?: boolean; + } +): PluginWrapper => { + return new PluginWrapper({ + path, + manifest: { + id, + version, + configPath: disabled ? configPath.concat('-disabled') : configPath, + kibanaVersion, + type, + requiredPlugins, + requiredBundles, + optionalPlugins, + server, + owner: { + name: 'Core', + githubTeam: 'kibana-core', + }, + ui, + }, + opaqueId: Symbol(id), + initializerContext: { logger } as any, + }); +}; + +async function testSetup() { + mockPackage.raw = { + branch: 'feature-v1', + version: 'v1', + build: { + distributable: true, + number: 100, + sha: 'feature-v1-build-sha', + }, + }; + + coreId = Symbol('core'); + env = Env.createDefault(REPO_ROOT, getEnvOptions()); + + config$ = new BehaviorSubject>({ plugins: { initialize: true } }); + const rawConfigService = rawConfigServiceMock.create({ rawConfig$: config$ }); + configService = new ConfigService(rawConfigService, env, logger); + await configService.setSchema(config.path, config.schema); + pluginsService = new PluginsService({ coreId, env, logger, configService }); + + [prebootMockPluginSystem, standardMockPluginSystem] = MockPluginsSystem.mock.instances as any; + prebootMockPluginSystem.uiPlugins.mockReturnValue(new Map()); + prebootMockPluginSystem.getPlugins.mockReturnValue([]); + standardMockPluginSystem.uiPlugins.mockReturnValue(new Map()); + standardMockPluginSystem.getPlugins.mockReturnValue([]); + + environmentPreboot = environmentServiceMock.createPrebootContract(); + nodePreboot = nodeServiceMock.createInternalPrebootContract(); +} + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('PluginsService', () => { + beforeEach(async () => { + await testSetup(); + }); + + describe('#discover()', () => { + it('throws if plugin has an invalid manifest', async () => { + mockDiscover.mockReturnValue({ + error$: from([PluginDiscoveryError.invalidManifest('path-1', new Error('Invalid JSON'))]), + plugin$: from([]), + }); + + await expect(pluginsService.discover({ environment: environmentPreboot, node: nodePreboot })) + .rejects.toMatchInlineSnapshot(` + [Error: Failed to initialize plugins: + Invalid JSON (invalid-manifest, path-1)] + `); + expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` + Array [ + Array [ + [Error: Invalid JSON (invalid-manifest, path-1)], + ], + ] + `); + }); + + it('throws if plugin required Kibana version is incompatible with the current version', async () => { + mockDiscover.mockReturnValue({ + error$: from([ + PluginDiscoveryError.incompatibleVersion('path-3', new Error('Incompatible version')), + ]), + plugin$: from([]), + }); + + await expect(pluginsService.discover({ environment: environmentPreboot, node: nodePreboot })) + .rejects.toMatchInlineSnapshot(` + [Error: Failed to initialize plugins: + Incompatible version (incompatible-version, path-3)] + `); + expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` + Array [ + Array [ + [Error: Incompatible version (incompatible-version, path-3)], + ], + ] + `); + }); + + it('throws if discovered plugins with conflicting names', async () => { + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([ + createPlugin('conflicting-id', { + path: 'path-4-standard', + version: 'some-version', + configPath: 'path', + requiredPlugins: ['some-required-plugin', 'some-required-plugin-2'], + optionalPlugins: ['some-optional-plugin'], + }), + createPlugin('conflicting-id', { + path: 'path-4-standard', + version: 'some-version', + configPath: 'path', + requiredPlugins: ['some-required-plugin', 'some-required-plugin-2'], + optionalPlugins: ['some-optional-plugin'], + }), + ]), + }); + + await expect( + pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }) + ).rejects.toMatchInlineSnapshot( + `[Error: Plugin with id "conflicting-id" is already registered!]` + ); + + expect(prebootMockPluginSystem.addPlugin).not.toHaveBeenCalled(); + expect(prebootMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); + expect(standardMockPluginSystem.addPlugin).not.toHaveBeenCalled(); + expect(standardMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); + }); + + it('throws if discovered standard and preboot plugins with conflicting names', async () => { + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([ + createPlugin('conflicting-id', { + type: PluginType.preboot, + path: 'path-4-preboot', + version: 'some-version', + configPath: 'path', + requiredPlugins: ['some-required-plugin', 'some-required-plugin-2'], + optionalPlugins: ['some-optional-plugin'], + }), + createPlugin('conflicting-id', { + path: 'path-4-standard', + version: 'some-version', + configPath: 'path', + requiredPlugins: ['some-required-plugin', 'some-required-plugin-2'], + optionalPlugins: ['some-optional-plugin'], + }), + ]), + }); + + await expect( + pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }) + ).rejects.toMatchInlineSnapshot( + `[Error: Plugin with id "conflicting-id" is already registered!]` + ); + + expect(prebootMockPluginSystem.addPlugin).not.toHaveBeenCalled(); + expect(prebootMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); + expect(standardMockPluginSystem.addPlugin).not.toHaveBeenCalled(); + expect(standardMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); + }); + + describe('X-Pack dependencies', () => { + function mockDiscoveryResults(params: { sourcePluginPath: string; dependencyType: string }) { + const { sourcePluginPath, dependencyType } = params; + // Each plugin's source is derived from its path; the PluginWrapper test suite contains more detailed test cases around the paths (for both POSIX and Windows) + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([ + createPlugin('sourcePlugin', { + path: sourcePluginPath, + version: 'some-version', + configPath: 'path', + requiredPlugins: dependencyType === 'requiredPlugin' ? ['xPackPlugin'] : [], + requiredBundles: dependencyType === 'requiredBundle' ? ['xPackPlugin'] : undefined, + optionalPlugins: dependencyType === 'optionalPlugin' ? ['xPackPlugin'] : [], + }), + createPlugin('xPackPlugin', { + path: XPACK_PLUGIN_PATH, + version: 'some-version', + configPath: 'path', + requiredPlugins: [], + optionalPlugins: [], + }), + ]), + }); + } + + async function expectError() { + await expect( + pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }) + ).rejects.toThrow( + `X-Pack plugin or bundle with id "xPackPlugin" is required by OSS plugin "sourcePlugin", which is prohibited. Consider making this an optional dependency instead.` + ); + expect(standardMockPluginSystem.addPlugin).not.toHaveBeenCalled(); + } + + async function expectSuccess() { + await expect( + pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }) + ).resolves.toEqual(expect.anything()); + expect(standardMockPluginSystem.addPlugin).toHaveBeenCalled(); + } + + it('throws if an OSS plugin requires an X-Pack plugin or bundle', async () => { + for (const dependencyType of ['requiredPlugin', 'requiredBundle']) { + mockDiscoveryResults({ sourcePluginPath: OSS_PLUGIN_PATH, dependencyType }); + await expectError(); + } + }); + + it('does not throw if an OSS plugin has an optional dependency on an X-Pack plugin', async () => { + mockDiscoveryResults({ + sourcePluginPath: OSS_PLUGIN_PATH, + dependencyType: 'optionalPlugin', + }); + await expectSuccess(); + }); + + it('does not throw if an X-Pack plugin depends on an X-Pack plugin or bundle', async () => { + for (const dependencyType of ['requiredPlugin', 'requiredBundle', 'optionalPlugin']) { + mockDiscoveryResults({ sourcePluginPath: XPACK_PLUGIN_PATH, dependencyType }); + await expectSuccess(); + } + }); + + it('does not throw if an external plugin depends on an X-Pack plugin or bundle', async () => { + for (const dependencyType of ['requiredPlugin', 'requiredBundle', 'optionalPlugin']) { + mockDiscoveryResults({ sourcePluginPath: EXTERNAL_PLUGIN_PATH, dependencyType }); + await expectSuccess(); + } + }); + }); + + it('properly detects plugins that should be disabled.', async () => { + jest + .spyOn(configService, 'isEnabledAtPath') + .mockImplementation((path) => Promise.resolve(!path.includes('disabled'))); + + prebootMockPluginSystem.setupPlugins.mockResolvedValue(new Map()); + standardMockPluginSystem.setupPlugins.mockResolvedValue(new Map()); + + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([ + createPlugin('explicitly-disabled-plugin-preboot', { + type: PluginType.preboot, + disabled: true, + path: 'path-1-preboot', + configPath: 'path-1-preboot', + }), + createPlugin('explicitly-disabled-plugin-standard', { + disabled: true, + path: 'path-1-standard', + configPath: 'path-1-standard', + }), + createPlugin('plugin-with-missing-required-deps-preboot', { + type: PluginType.preboot, + path: 'path-2-preboot', + configPath: 'path-2-preboot', + requiredPlugins: ['missing-plugin-preboot'], + }), + createPlugin('plugin-with-missing-required-deps-standard', { + path: 'path-2-standard', + configPath: 'path-2-standard', + requiredPlugins: ['missing-plugin-standard'], + }), + createPlugin('plugin-with-disabled-transitive-dep-preboot', { + type: PluginType.preboot, + path: 'path-3-preboot', + configPath: 'path-3-preboot', + requiredPlugins: ['another-explicitly-disabled-plugin-preboot'], + }), + createPlugin('plugin-with-disabled-transitive-dep-standard', { + path: 'path-3-standard', + configPath: 'path-3-standard', + requiredPlugins: ['another-explicitly-disabled-plugin-standard'], + }), + createPlugin('another-explicitly-disabled-plugin-preboot', { + type: PluginType.preboot, + disabled: true, + path: 'path-4-preboot', + configPath: 'path-4-disabled-preboot', + }), + createPlugin('another-explicitly-disabled-plugin-standard', { + disabled: true, + path: 'path-4-standard', + configPath: 'path-4-disabled-standard', + }), + createPlugin('plugin-with-disabled-optional-dep-preboot', { + type: PluginType.preboot, + path: 'path-5-preboot', + configPath: 'path-5-preboot', + optionalPlugins: ['explicitly-disabled-plugin-preboot'], + }), + createPlugin('plugin-with-disabled-optional-dep-standard', { + path: 'path-5-standard', + configPath: 'path-5-standard', + optionalPlugins: ['explicitly-disabled-plugin-standard'], + }), + createPlugin('plugin-with-missing-optional-dep-preboot', { + type: PluginType.preboot, + path: 'path-6-preboot', + configPath: 'path-6-preboot', + optionalPlugins: ['missing-plugin-preboot'], + }), + createPlugin('plugin-with-missing-optional-dep-standard', { + path: 'path-6-standard', + configPath: 'path-6-standard', + optionalPlugins: ['missing-plugin-standard'], + }), + createPlugin('plugin-with-disabled-nested-transitive-dep-preboot', { + type: PluginType.preboot, + path: 'path-7-preboot', + configPath: 'path-7-preboot', + requiredPlugins: ['plugin-with-disabled-transitive-dep-preboot'], + }), + createPlugin('plugin-with-disabled-nested-transitive-dep-standard', { + path: 'path-7-standard', + configPath: 'path-7-standard', + requiredPlugins: ['plugin-with-disabled-transitive-dep-standard'], + }), + createPlugin('plugin-with-missing-nested-dep-preboot', { + type: PluginType.preboot, + path: 'path-8-preboot', + configPath: 'path-8-preboot', + requiredPlugins: ['plugin-with-missing-required-deps-preboot'], + }), + createPlugin('plugin-with-missing-nested-dep-standard', { + path: 'path-8-standard', + configPath: 'path-8-standard', + requiredPlugins: ['plugin-with-missing-required-deps-standard'], + }), + ]), + }); + + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + await pluginsService.preboot(prebootDeps); + const setup = await pluginsService.setup(setupDeps); + + expect(setup.contracts).toBeInstanceOf(Map); + + expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledTimes(2); + expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledTimes(2); + + expect(prebootMockPluginSystem.setupPlugins).toHaveBeenCalledTimes(1); + expect(standardMockPluginSystem.setupPlugins).toHaveBeenCalledTimes(1); + + expect(prebootMockPluginSystem.setupPlugins).toHaveBeenCalledWith(prebootDeps); + expect(standardMockPluginSystem.setupPlugins).toHaveBeenCalledWith(setupDeps); + + expect(loggingSystemMock.collect(logger).info).toMatchInlineSnapshot(` + Array [ + Array [ + "Plugin \\"explicitly-disabled-plugin-preboot\\" is disabled.", + ], + Array [ + "Plugin \\"explicitly-disabled-plugin-standard\\" is disabled.", + ], + Array [ + "Plugin \\"plugin-with-missing-required-deps-preboot\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [missing-plugin-preboot]", + ], + Array [ + "Plugin \\"plugin-with-missing-required-deps-standard\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [missing-plugin-standard]", + ], + Array [ + "Plugin \\"plugin-with-disabled-transitive-dep-preboot\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [another-explicitly-disabled-plugin-preboot]", + ], + Array [ + "Plugin \\"plugin-with-disabled-transitive-dep-standard\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [another-explicitly-disabled-plugin-standard]", + ], + Array [ + "Plugin \\"another-explicitly-disabled-plugin-preboot\\" is disabled.", + ], + Array [ + "Plugin \\"another-explicitly-disabled-plugin-standard\\" is disabled.", + ], + Array [ + "Plugin \\"plugin-with-disabled-nested-transitive-dep-preboot\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [plugin-with-disabled-transitive-dep-preboot]", + ], + Array [ + "Plugin \\"plugin-with-disabled-nested-transitive-dep-standard\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [plugin-with-disabled-transitive-dep-standard]", + ], + Array [ + "Plugin \\"plugin-with-missing-nested-dep-preboot\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [plugin-with-missing-required-deps-preboot]", + ], + Array [ + "Plugin \\"plugin-with-missing-nested-dep-standard\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [plugin-with-missing-required-deps-standard]", + ], + ] + `); + }); + + it('does not throw in case of mutual plugin dependencies', async () => { + const prebootPlugins = [ + createPlugin('first-plugin-preboot', { + type: PluginType.preboot, + path: 'path-1-preboot', + requiredPlugins: ['second-plugin-preboot'], + }), + createPlugin('second-plugin-preboot', { + type: PluginType.preboot, + path: 'path-2-preboot', + requiredPlugins: ['first-plugin-preboot'], + }), + ]; + const standardPlugins = [ + createPlugin('first-plugin-standard', { + path: 'path-1-standard', + requiredPlugins: ['second-plugin-standard'], + }), + createPlugin('second-plugin-standard', { + path: 'path-2-standard', + requiredPlugins: ['first-plugin-standard'], + }), + ]; + + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([...prebootPlugins, ...standardPlugins]), + }); + + const { preboot, standard } = await pluginsService.discover({ + environment: environmentPreboot, + node: nodePreboot, + }); + expect(mockDiscover).toHaveBeenCalledTimes(1); + + expect(preboot.pluginTree).toBeUndefined(); + for (const plugin of prebootPlugins) { + expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); + } + + expect(standard.pluginTree).toBeUndefined(); + for (const plugin of standardPlugins) { + expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); + } + }); + + it('does not throw in case of mutual plugin dependencies between preboot and standard plugins', async () => { + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([ + createPlugin('first-plugin-preboot', { + type: PluginType.preboot, + path: 'path-1-preboot', + requiredPlugins: ['second-plugin-standard'], + }), + createPlugin('first-plugin-standard', { + path: 'path-1-standard', + requiredPlugins: ['second-plugin-preboot'], + }), + createPlugin('second-plugin-preboot', { + type: PluginType.preboot, + path: 'path-2-preboot', + requiredPlugins: ['first-plugin-standard'], + }), + createPlugin('second-plugin-standard', { + path: 'path-2-standard', + requiredPlugins: ['first-plugin-preboot'], + }), + ]), + }); + + const { preboot, standard } = await pluginsService.discover({ + environment: environmentPreboot, + node: nodePreboot, + }); + expect(preboot.pluginTree).toBeUndefined(); + expect(standard.pluginTree).toBeUndefined(); + + expect(mockDiscover).toHaveBeenCalledTimes(1); + expect(prebootMockPluginSystem.addPlugin).not.toHaveBeenCalled(); + expect(standardMockPluginSystem.addPlugin).not.toHaveBeenCalled(); + }); + + it('does not throw in case of cyclic plugin dependencies', async () => { + const prebootPlugins = [ + createPlugin('first-plugin-preboot', { + type: PluginType.preboot, + path: 'path-1-preboot', + requiredPlugins: ['second-plugin-preboot'], + }), + createPlugin('second-plugin-preboot', { + type: PluginType.preboot, + path: 'path-2-preboot', + requiredPlugins: ['third-plugin-preboot', 'last-plugin-preboot'], + }), + createPlugin('third-plugin-preboot', { + type: PluginType.preboot, + path: 'path-3-preboot', + requiredPlugins: ['last-plugin-preboot', 'first-plugin-preboot'], + }), + createPlugin('last-plugin-preboot', { + type: PluginType.preboot, + path: 'path-4-preboot', + requiredPlugins: ['first-plugin-preboot'], + }), + createPlugin('missing-deps-plugin-preboot', { + type: PluginType.preboot, + path: 'path-5-preboot', + requiredPlugins: ['not-a-plugin-preboot'], + }), + ]; + + const standardPlugins = [ + createPlugin('first-plugin-standard', { + path: 'path-1-standard', + requiredPlugins: ['second-plugin-standard'], + }), + createPlugin('second-plugin-standard', { + path: 'path-2-standard', + requiredPlugins: ['third-plugin-standard', 'last-plugin-standard'], + }), + createPlugin('third-plugin-standard', { + path: 'path-3-standard', + requiredPlugins: ['last-plugin-standard', 'first-plugin-standard'], + }), + createPlugin('last-plugin-standard', { + path: 'path-4-standard', + requiredPlugins: ['first-plugin-standard'], + }), + createPlugin('missing-deps-plugin-standard', { + path: 'path-5-standard', + requiredPlugins: ['not-a-plugin-standard'], + }), + ]; + + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([...prebootPlugins, ...standardPlugins]), + }); + + const { standard, preboot } = await pluginsService.discover({ + environment: environmentPreboot, + node: nodePreboot, + }); + expect(mockDiscover).toHaveBeenCalledTimes(1); + + expect(preboot.pluginTree).toBeUndefined(); + expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledTimes(4); + for (const plugin of prebootPlugins) { + if (plugin.name.startsWith('missing-deps')) { + expect(prebootMockPluginSystem.addPlugin).not.toHaveBeenCalledWith(plugin); + } else { + expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); + } + } + + expect(standard.pluginTree).toBeUndefined(); + expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledTimes(4); + for (const plugin of standardPlugins) { + if (plugin.name.startsWith('missing-deps')) { + expect(standardMockPluginSystem.addPlugin).not.toHaveBeenCalledWith(plugin); + } else { + expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); + } + } + }); + + it('properly invokes plugin discovery and ignores non-critical errors.', async () => { + const prebootPlugins = [ + createPlugin('some-id-preboot', { + type: PluginType.preboot, + path: 'path-1-preboot', + configPath: 'path-preboot', + requiredPlugins: ['some-other-id-preboot'], + optionalPlugins: ['missing-optional-dep'], + }), + createPlugin('some-other-id-preboot', { + type: PluginType.preboot, + path: 'path-2-preboot', + version: 'some-other-version', + configPath: ['plugin-other-preboot', 'path'], + }), + ]; + + const standardPlugins = [ + createPlugin('some-id-standard', { + type: PluginType.standard, + path: 'path-1-standard', + configPath: 'path-standard', + requiredPlugins: ['some-other-id-standard'], + optionalPlugins: ['missing-optional-dep'], + }), + createPlugin('some-other-id-standard', { + type: PluginType.standard, + path: 'path-2-standard', + version: 'some-other-version', + configPath: ['plugin-other-standard', 'path'], + }), + ]; + + mockDiscover.mockReturnValue({ + error$: from([ + PluginDiscoveryError.missingManifest('path-2', new Error('No manifest')), + PluginDiscoveryError.invalidSearchPath('dir-1', new Error('No dir')), + PluginDiscoveryError.invalidPluginPath('path4-1', new Error('No path')), + ]), + plugin$: from([...prebootPlugins, ...standardPlugins]), + }); + + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledTimes(2); + for (const plugin of prebootPlugins) { + expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); + } + + expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledTimes(2); + for (const plugin of standardPlugins) { + expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); + } + + expect(mockDiscover).toHaveBeenCalledTimes(1); + expect(mockDiscover).toHaveBeenCalledWith({ + config: { + additionalPluginPaths: [], + initialize: true, + pluginSearchPaths: [ + resolve(process.cwd(), 'src', 'plugins'), + resolve(process.cwd(), 'x-pack', 'plugins'), + resolve(process.cwd(), 'plugins'), + resolve(process.cwd(), '..', 'kibana-extra'), + ], + }, + coreContext: { coreId, env, logger, configService }, + instanceInfo: { uuid: 'uuid' }, + nodeInfo: { roles: { backgroundTasks: true, ui: true } }, + }); + + const logs = loggingSystemMock.collect(logger); + expect(logs.info).toHaveLength(0); + expect(logs.error).toHaveLength(0); + }); + + it('registers plugin config schema in config service', async () => { + const configSchema = schema.string(); + jest.spyOn(configService, 'setSchema').mockImplementation(() => Promise.resolve()); + jest.doMock( + join('path-with-schema-preboot', 'server'), + () => ({ config: { schema: configSchema } }), + { virtual: true } + ); + jest.doMock( + join('path-with-schema-standard', 'server'), + () => ({ config: { schema: configSchema } }), + { virtual: true } + ); + + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([ + createPlugin('some-id-preboot', { + type: PluginType.preboot, + path: 'path-with-schema-preboot', + configPath: 'path-preboot', + }), + createPlugin('some-id-standard', { + path: 'path-with-schema-standard', + configPath: 'path-standard', + }), + ]), + }); + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + expect(configService.setSchema).toBeCalledWith('path-preboot', configSchema); + expect(configService.setSchema).toBeCalledWith('path-standard', configSchema); + }); + + it('registers plugin config deprecation provider in config service', async () => { + const configSchema = schema.string(); + jest.spyOn(configService, 'setSchema').mockImplementation(() => Promise.resolve()); + jest.spyOn(configService, 'addDeprecationProvider'); + + const prebootDeprecationProvider = () => []; + jest.doMock( + join('path-with-provider-preboot', 'server'), + () => ({ config: { schema: configSchema, deprecations: prebootDeprecationProvider } }), + { virtual: true } + ); + + const standardDeprecationProvider = () => []; + jest.doMock( + join('path-with-provider-standard', 'server'), + () => ({ config: { schema: configSchema, deprecations: standardDeprecationProvider } }), + { virtual: true } + ); + + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([ + createPlugin('some-id-preboot', { + type: PluginType.preboot, + path: 'path-with-provider-preboot', + configPath: 'config-path-preboot', + }), + createPlugin('some-id-standard', { + path: 'path-with-provider-standard', + configPath: 'config-path-standard', + }), + ]), + }); + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + expect(configService.addDeprecationProvider).toBeCalledWith( + 'config-path-preboot', + prebootDeprecationProvider + ); + expect(configService.addDeprecationProvider).toBeCalledWith( + 'config-path-standard', + standardDeprecationProvider + ); + }); + + it('returns the paths of the plugins', async () => { + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([]), + }); + + prebootMockPluginSystem.getPlugins.mockImplementation(() => [ + createPlugin('A-preboot', { + type: PluginType.preboot, + path: '/plugin-A-path-preboot', + configPath: 'pathA-preboot', + }), + createPlugin('B-preboot', { + type: PluginType.preboot, + path: '/plugin-B-path-preboot', + configPath: 'pathB-preboot', + }), + ]); + + standardMockPluginSystem.getPlugins.mockImplementation(() => [ + createPlugin('A-standard', { + path: '/plugin-A-path-standard', + configPath: 'pathA-standard', + }), + createPlugin('B-standard', { + path: '/plugin-B-path-standard', + configPath: 'pathB-standard', + }), + ]); + + const { preboot, standard } = await pluginsService.discover({ + environment: environmentPreboot, + node: nodePreboot, + }); + + expect(preboot.pluginPaths).toEqual(['/plugin-A-path-preboot', '/plugin-B-path-preboot']); + expect(standard.pluginPaths).toEqual(['/plugin-A-path-standard', '/plugin-B-path-standard']); + }); + + it('populates pluginConfigUsageDescriptors with plugins exposeToUsage property', async () => { + const pluginsWithExposeUsage = [ + createPlugin('plugin-with-expose-usage-preboot', { + type: PluginType.preboot, + path: 'plugin-with-expose-usage-preboot', + configPath: 'pathA-preboot', + }), + createPlugin('plugin-with-expose-usage-standard', { + path: 'plugin-with-expose-usage-standard', + configPath: 'pathA-standard', + }), + ]; + for (const plugin of pluginsWithExposeUsage) { + jest.doMock( + join(plugin.path, 'server'), + () => ({ + config: { + exposeToUsage: { test: true, nested: { prop: true } }, + schema: schema.maybe(schema.any()), + }, + }), + { virtual: true } + ); + } + + const pluginsWithArrayConfigPath = [ + createPlugin('plugin-with-array-configPath-preboot', { + type: PluginType.preboot, + path: 'plugin-with-array-configPath-preboot', + version: 'some-other-version', + configPath: ['plugin-preboot', 'pathB'], + }), + createPlugin('plugin-with-array-configPath-standard', { + path: 'plugin-with-array-configPath-standard', + version: 'some-other-version', + configPath: ['plugin-standard', 'pathB'], + }), + ]; + for (const plugin of pluginsWithArrayConfigPath) { + jest.doMock( + join(plugin.path, 'server'), + () => ({ + config: { + exposeToUsage: { test: true }, + schema: schema.maybe(schema.any()), + }, + }), + { virtual: true } + ); + } + + const pluginsWithoutExpose = [ + createPlugin('plugin-without-expose-preboot', { + type: PluginType.preboot, + path: 'plugin-without-expose-preboot', + configPath: 'pathC-preboot', + }), + createPlugin('plugin-without-expose-standard', { + path: 'plugin-without-expose-standard', + configPath: 'pathC-standard', + }), + ]; + for (const plugin of pluginsWithoutExpose) { + jest.doMock( + join(plugin.path, 'server'), + () => ({ + config: { + schema: schema.maybe(schema.any()), + }, + }), + { virtual: true } + ); + } + + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([ + ...pluginsWithExposeUsage, + ...pluginsWithArrayConfigPath, + ...pluginsWithoutExpose, + ]), + }); + + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + + // eslint-disable-next-line dot-notation + expect(pluginsService['pluginConfigUsageDescriptors']).toMatchInlineSnapshot(` + Map { + "pathA-preboot" => Object { + "nested.prop": true, + "test": true, + }, + "pathA-standard" => Object { + "nested.prop": true, + "test": true, + }, + "plugin-preboot.pathB" => Object { + "test": true, + }, + "plugin-standard.pathB" => Object { + "test": true, + }, + } + `); + }); + }); + + describe('#generateUiPluginsConfigs()', () => { + const pluginToDiscoveredEntry = (plugin: PluginWrapper): [string, DiscoveredPlugin] => [ + plugin.name, + { + id: plugin.name, + type: plugin.manifest.type, + configPath: plugin.manifest.configPath, + requiredPlugins: [], + requiredBundles: [], + optionalPlugins: [], + }, + ]; + + it('properly generates client configs for plugins according to `exposeToBrowser`', async () => { + const prebootPlugin = createPlugin('plugin-with-expose-preboot', { + type: PluginType.preboot, + path: 'plugin-with-expose-preboot', + configPath: 'path-preboot', + }); + const standardPlugin = createPlugin('plugin-with-expose-standard', { + path: 'plugin-with-expose-standard', + configPath: 'path-standard', + }); + for (const plugin of [prebootPlugin, standardPlugin]) { + jest.doMock( + join(plugin.path, 'server'), + () => ({ + config: { + exposeToBrowser: { + sharedProp: true, + }, + schema: schema.object({ + serverProp: schema.string({ + defaultValue: `serverProp default value ${plugin.name}`, + }), + sharedProp: schema.string({ + defaultValue: `sharedProp default value ${plugin.name}`, + }), + }), + }, + }), + { virtual: true } + ); + } + + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([prebootPlugin, standardPlugin]), + }); + prebootMockPluginSystem.uiPlugins.mockReturnValue( + new Map([pluginToDiscoveredEntry(prebootPlugin)]) + ); + standardMockPluginSystem.uiPlugins.mockReturnValue( + new Map([pluginToDiscoveredEntry(standardPlugin)]) + ); + + const { preboot, standard } = await pluginsService.discover({ + environment: environmentPreboot, + node: nodePreboot, + }); + + const prebootUIConfig$ = preboot.uiPlugins.browserConfigs.get('plugin-with-expose-preboot')!; + await expect(prebootUIConfig$.pipe(take(1)).toPromise()).resolves.toEqual({ + browserConfig: { sharedProp: 'sharedProp default value plugin-with-expose-preboot' }, + exposedConfigKeys: { sharedProp: 'string' }, + }); + + const standardUIConfig$ = standard.uiPlugins.browserConfigs.get( + 'plugin-with-expose-standard' + )!; + await expect(standardUIConfig$.pipe(take(1)).toPromise()).resolves.toEqual({ + browserConfig: { sharedProp: 'sharedProp default value plugin-with-expose-standard' }, + exposedConfigKeys: { sharedProp: 'string' }, + }); + }); + + it('does not generate config for plugins not exposing to client', async () => { + const prebootPlugin = createPlugin('plugin-without-expose-preboot', { + type: PluginType.preboot, + path: 'plugin-without-expose-preboot', + configPath: 'path-preboot', + }); + const standardPlugin = createPlugin('plugin-without-expose-standard', { + path: 'plugin-without-expose-standard', + configPath: 'path-standard', + }); + for (const plugin of [prebootPlugin, standardPlugin]) { + jest.doMock( + join(plugin.path, 'server'), + () => ({ + config: { + schema: schema.object({ + serverProp: schema.string({ defaultValue: 'serverProp default value' }), + }), + }, + }), + { virtual: true } + ); + } + + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([prebootPlugin, standardPlugin]), + }); + prebootMockPluginSystem.uiPlugins.mockReturnValue( + new Map([pluginToDiscoveredEntry(prebootPlugin)]) + ); + standardMockPluginSystem.uiPlugins.mockReturnValue( + new Map([pluginToDiscoveredEntry(standardPlugin)]) + ); + + const { preboot, standard } = await pluginsService.discover({ + environment: environmentPreboot, + node: nodePreboot, + }); + expect(preboot.uiPlugins.browserConfigs.size).toBe(0); + expect(standard.uiPlugins.browserConfigs.size).toBe(0); + }); + }); + + test('"root" deprecations from one plugin should be applied before accessing other plugins config', async () => { + const pluginA = createPlugin('plugin-1-deprecations', { + type: PluginType.standard, + path: 'plugin-1-deprecations', + version: 'version-1', + }); + + const pluginB = createPlugin('plugin-2-deprecations', { + type: PluginType.standard, + path: 'plugin-2-deprecations', + version: 'version-2', + }); + + jest.doMock( + join(pluginA.path, 'server'), + () => ({ + config: { + schema: schema.object({ + enabled: schema.maybe(schema.boolean({ defaultValue: true })), + }), + }, + }), + { virtual: true } + ); + + jest.doMock( + join(pluginB.path, 'server'), + (): { config: PluginConfigDescriptor } => ({ + config: { + schema: schema.object({ + enabled: schema.maybe(schema.boolean({ defaultValue: true })), + renamed: schema.string(), // Mandatory string to make sure that the field is actually renamed by deprecations + }), + deprecations: ({ renameFromRoot }) => [ + renameFromRoot('plugin-1-deprecations.toBeRenamed', 'plugin-2-deprecations.renamed', { + level: 'critical', + }), + ], + }, + }), + { virtual: true } + ); + + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([pluginA, pluginB]), + }); + + config$.next({ + 'plugin-1-deprecations': { + toBeRenamed: 'renamed', + }, + }); + + await expect( + pluginsService.discover({ + environment: environmentPreboot, + node: nodePreboot, + }) + ).resolves.not.toThrow(); // If the rename is not applied, it'll fail + }); + + describe('plugin initialization', () => { + beforeEach(() => { + const prebootPlugins = [ + createPlugin('plugin-1-preboot', { + type: PluginType.preboot, + path: 'path-1-preboot', + version: 'version-1', + }), + createPlugin('plugin-2-preboot', { + type: PluginType.preboot, + path: 'path-2-preboot', + version: 'version-2', + }), + ]; + const standardPlugins = [ + createPlugin('plugin-1-standard', { + path: 'path-1-standard', + version: 'version-1', + }), + createPlugin('plugin-2-standard', { + path: 'path-2-standard', + version: 'version-2', + }), + ]; + + for (const plugin of [...prebootPlugins, ...standardPlugins]) { + jest.doMock( + join(plugin.path, 'server'), + () => ({ + config: { + schema: schema.object({ + enabled: schema.maybe(schema.boolean({ defaultValue: true })), + }), + }, + }), + { virtual: true } + ); + } + + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([...prebootPlugins, ...standardPlugins]), + }); + + prebootMockPluginSystem.uiPlugins.mockReturnValue(new Map()); + standardMockPluginSystem.uiPlugins.mockReturnValue(new Map()); + }); + + it('`uiPlugins.internal` contains internal properties for plugins', async () => { + config$.next({ + plugins: { initialize: true }, + plugin1_preboot: { enabled: false }, + plugin1_standard: { enabled: false }, + }); + const { preboot, standard } = await pluginsService.discover({ + environment: environmentPreboot, + node: nodePreboot, + }); + expect(preboot.uiPlugins.internal).toMatchInlineSnapshot(` + Map { + "plugin-1-preboot" => Object { + "publicAssetsDir": /path-1-preboot/public/assets, + "publicTargetDir": /path-1-preboot/target/public, + "requiredBundles": Array [], + "version": "version-1", + }, + "plugin-2-preboot" => Object { + "publicAssetsDir": /path-2-preboot/public/assets, + "publicTargetDir": /path-2-preboot/target/public, + "requiredBundles": Array [], + "version": "version-2", + }, + } + `); + expect(standard.uiPlugins.internal).toMatchInlineSnapshot(` + Map { + "plugin-1-standard" => Object { + "publicAssetsDir": /path-1-standard/public/assets, + "publicTargetDir": /path-1-standard/target/public, + "requiredBundles": Array [], + "version": "version-1", + }, + "plugin-2-standard" => Object { + "publicAssetsDir": /path-2-standard/public/assets, + "publicTargetDir": /path-2-standard/target/public, + "requiredBundles": Array [], + "version": "version-2", + }, + } + `); + }); + + it('`uiPlugins.internal` includes disabled plugins', async () => { + config$.next({ + plugins: { initialize: true }, + plugin1_preboot: { enabled: false }, + plugin1_standard: { enabled: false }, + }); + const { preboot, standard } = await pluginsService.discover({ + environment: environmentPreboot, + node: nodePreboot, + }); + expect([...preboot.uiPlugins.internal.keys()].sort()).toMatchInlineSnapshot(` + Array [ + "plugin-1-preboot", + "plugin-2-preboot", + ] + `); + expect([...standard.uiPlugins.internal.keys()].sort()).toMatchInlineSnapshot(` + Array [ + "plugin-1-standard", + "plugin-2-standard", + ] + `); + }); + + it('#preboot does initialize `preboot` plugins if plugins.initialize is true', async () => { + config$.next({ plugins: { initialize: true } }); + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + await pluginsService.preboot(prebootDeps); + + expect(prebootMockPluginSystem.setupPlugins).toHaveBeenCalledTimes(1); + expect(prebootMockPluginSystem.setupPlugins).toHaveBeenCalledWith(prebootDeps); + expect(standardMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); + }); + + it('#preboot does not initialize `preboot` plugins if plugins.initialize is false', async () => { + config$.next({ plugins: { initialize: false } }); + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + await pluginsService.preboot(prebootDeps); + + expect(prebootMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); + expect(standardMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); + }); + + it('#setup does initialize `standard` plugins if plugins.initialize is true', async () => { + config$.next({ plugins: { initialize: true } }); + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + await pluginsService.preboot(prebootDeps); + + const { initialized } = await pluginsService.setup(setupDeps); + expect(standardMockPluginSystem.setupPlugins).toHaveBeenCalledTimes(1); + expect(standardMockPluginSystem.setupPlugins).toHaveBeenCalledWith(setupDeps); + expect(initialized).toBe(true); + }); + + it('#setup does not initialize `standard` plugins if plugins.initialize is false', async () => { + config$.next({ plugins: { initialize: false } }); + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + await pluginsService.preboot(prebootDeps); + const { initialized } = await pluginsService.setup(setupDeps); + expect(standardMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); + expect(prebootMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); + expect(initialized).toBe(false); + }); + }); + + describe('#getExposedPluginConfigsToUsage', () => { + it('returns pluginConfigUsageDescriptors', () => { + // eslint-disable-next-line dot-notation + pluginsService['pluginConfigUsageDescriptors'].set('test', { enabled: true }); + expect(pluginsService.getExposedPluginConfigsToUsage()).toMatchInlineSnapshot(` + Map { + "test" => Object { + "enabled": true, + }, + } + `); + }); + }); + + describe('#start()', () => { + beforeEach(() => { + mockDiscover.mockReturnValue({ + error$: from([]), + plugin$: from([ + createPlugin('plugin-1-preboot', { type: PluginType.preboot, path: 'path-1-preboot' }), + createPlugin('plugin-1-standard', { path: 'path-1-standard' }), + ]), + }); + }); + + it('does not try to stop `preboot` plugins and start `standard` ones if plugins.initialize is `false`', async () => { + config$.next({ plugins: { initialize: false } }); + + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + await pluginsService.preboot(prebootDeps); + await pluginsService.setup(setupDeps); + + const { contracts } = await pluginsService.start(startDeps); + expect(contracts).toBeInstanceOf(Map); + expect(contracts.size).toBe(0); + + expect(prebootMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); + expect(standardMockPluginSystem.startPlugins).not.toHaveBeenCalled(); + }); + + it('stops `preboot` plugins and starts `standard` ones', async () => { + await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); + await pluginsService.preboot(prebootDeps); + await pluginsService.setup(setupDeps); + + expect(prebootMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); + expect(standardMockPluginSystem.startPlugins).not.toHaveBeenCalled(); + + await pluginsService.start(startDeps); + + expect(prebootMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); + expect(standardMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); + + expect(standardMockPluginSystem.startPlugins).toHaveBeenCalledTimes(1); + expect(standardMockPluginSystem.startPlugins).toHaveBeenCalledWith(startDeps); + expect(prebootMockPluginSystem.startPlugins).not.toHaveBeenCalled(); + }); + }); + + describe('#stop()', () => { + it('`stop` stops plugins system', async () => { + await pluginsService.stop(); + expect(standardMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); + expect(prebootMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); + }); + + it('`stop` does not try to stop preboot plugins system if it was stopped during `start`.', async () => { + await pluginsService.preboot(prebootDeps); + await pluginsService.setup(setupDeps); + + expect(prebootMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); + expect(standardMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); + + await pluginsService.start(startDeps); + + expect(prebootMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); + expect(standardMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); + + await pluginsService.stop(); + + expect(prebootMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); + expect(standardMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); + }); + }); +}); diff --git a/src/core/server/plugins/plugins_service.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_service.ts similarity index 97% rename from src/core/server/plugins/plugins_service.ts rename to packages/core/plugins/core-plugins-server-internal/src/plugins_service.ts index 3305ff0a06b43..556cd8331b454 100644 --- a/src/core/server/plugins/plugins_service.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugins_service.ts @@ -14,17 +14,24 @@ import { getFlattenedObject } from '@kbn/std'; import { Logger } from '@kbn/logging'; import type { IConfigService } from '@kbn/config'; import type { CoreContext, CoreService } from '@kbn/core-base-server-internal'; -import type { PluginName } from '@kbn/core-base-common'; +import { type PluginName, PluginType } from '@kbn/core-base-common'; import type { InternalEnvironmentServicePreboot } from '@kbn/core-environment-server-internal'; import type { InternalNodeServicePreboot } from '@kbn/core-node-server-internal'; import type { InternalPluginInfo, UiPlugins } from '@kbn/core-plugins-base-server-internal'; +import { + InternalCorePreboot, + InternalCoreSetup, + InternalCoreStart, +} from '@kbn/core-lifecycle-server-internal'; +import { PluginConfigDescriptor } from '@kbn/core-plugins-server'; +import type { DiscoveredPlugin } from '@kbn/core-base-common'; import { discover, PluginDiscoveryError, PluginDiscoveryErrorType } from './discovery'; import { PluginWrapper } from './plugin'; -import { DiscoveredPlugin, PluginConfigDescriptor, PluginDependencies, PluginType } from './types'; + +import type { PluginDependencies } from './types'; import { PluginsConfig, PluginsConfigType } from './plugins_config'; import { PluginsSystem } from './plugins_system'; import { createBrowserConfig } from './create_browser_config'; -import { InternalCorePreboot, InternalCoreSetup, InternalCoreStart } from '../internal_types'; /** @internal */ export type DiscoveredPlugins = { diff --git a/src/core/server/plugins/plugins_system.test.mocks.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_system.test.mocks.ts similarity index 100% rename from src/core/server/plugins/plugins_system.test.mocks.ts rename to packages/core/plugins/core-plugins-server-internal/src/plugins_system.test.mocks.ts diff --git a/src/core/server/plugins/plugins_system.test.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_system.test.ts similarity index 98% rename from src/core/server/plugins/plugins_system.test.ts rename to packages/core/plugins/core-plugins-server-internal/src/plugins_system.test.ts index 0d55db06c091e..4010d548a6219 100644 --- a/src/core/server/plugins/plugins_system.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugins_system.test.ts @@ -15,7 +15,7 @@ import { import { BehaviorSubject } from 'rxjs'; import { REPO_ROOT } from '@kbn/utils'; -import type { PluginName } from '@kbn/core-base-common'; +import { type PluginName, PluginType } from '@kbn/core-base-common'; import type { CoreContext } from '@kbn/core-base-server-internal'; import { Logger } from '@kbn/logging'; import { Env } from '@kbn/config'; @@ -23,9 +23,8 @@ import { configServiceMock, getEnvOptions } from '@kbn/config-mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { PluginWrapper } from './plugin'; -import { PluginType } from './types'; import { PluginsSystem } from './plugins_system'; -import { coreMock } from '../mocks'; +import { coreInternalLifecycleMock } from '@kbn/core-lifecycle-server-mocks'; function createPlugin( id: string, @@ -63,9 +62,9 @@ function createPlugin( }); } -const prebootDeps = coreMock.createInternalPreboot(); -const setupDeps = coreMock.createInternalSetup(); -const startDeps = coreMock.createInternalStart(); +const prebootDeps = coreInternalLifecycleMock.createInternalPreboot(); +const setupDeps = coreInternalLifecycleMock.createInternalSetup(); +const startDeps = coreInternalLifecycleMock.createInternalStart(); let pluginsSystem: PluginsSystem; let configService: ReturnType; @@ -552,7 +551,7 @@ test('`startPlugins` only starts plugins that were setup', async () => { describe('setup', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { jest.useRealTimers(); @@ -589,7 +588,7 @@ describe('setup', () => { describe('start', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { jest.useRealTimers(); @@ -748,7 +747,7 @@ describe('asynchronous plugins', () => { describe('stop', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/core/server/plugins/plugins_system.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_system.ts similarity index 97% rename from src/core/server/plugins/plugins_system.ts rename to packages/core/plugins/core-plugins-server-internal/src/plugins_system.ts index 57db8e7c70f49..d7c4df71dd4fc 100644 --- a/src/core/server/plugins/plugins_system.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugins_system.ts @@ -7,17 +7,18 @@ */ import { withTimeout, isPromise } from '@kbn/std'; -import type { PluginName } from '@kbn/core-base-common'; +import type { DiscoveredPlugin, PluginName } from '@kbn/core-base-common'; import type { CoreContext } from '@kbn/core-base-server-internal'; -import { Logger } from '@kbn/logging'; -import { PluginWrapper } from './plugin'; -import { DiscoveredPlugin, PluginDependencies, PluginType } from './types'; +import type { Logger } from '@kbn/logging'; +import { PluginType } from '@kbn/core-base-common'; +import type { PluginWrapper } from './plugin'; +import { type PluginDependencies } from './types'; import { createPluginPrebootSetupContext, createPluginSetupContext, createPluginStartContext, } from './plugin_context'; -import { +import type { PluginsServicePrebootSetupDeps, PluginsServiceSetupDeps, PluginsServiceStartDeps, diff --git a/packages/core/plugins/core-plugins-server-internal/src/test_helpers/create_core_context_config_service.mock.ts b/packages/core/plugins/core-plugins-server-internal/src/test_helpers/create_core_context_config_service.mock.ts new file mode 100644 index 0000000000000..399d45398eefb --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/src/test_helpers/create_core_context_config_service.mock.ts @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { IConfigService } from '@kbn/config'; +import { configServiceMock } from '@kbn/config-mocks'; +import { ByteSizeValue } from '@kbn/config-schema'; +import { fromRoot } from '@kbn/utils'; +import { duration } from 'moment'; +import { from } from 'rxjs'; + +export const createCoreContextConfigServiceMock = (): IConfigService => { + const configService = configServiceMock.create(); + const getPathConfig = (path: string | string[]) => { + switch (path) { + case 'elasticsearch': + return { + shardTimeout: duration(30, 's'), + requestTimeout: duration(30, 's'), + pingTimeout: duration(30, 's'), + someOtherProps: 'unused', + }; + case 'path': + return { data: fromRoot('data'), someOtherProps: 'unused' }; + case 'savedObjects': + return { maxImportPayloadBytes: new ByteSizeValue(26214400), someOtherProps: 'unused' }; + default: + return {}; + } + }; + configService.atPath.mockImplementation((path) => { + return from([getPathConfig(path)]); + }); + configService.atPathSync.mockImplementation((path) => { + return getPathConfig(path); + }); + + return configService; +}; diff --git a/packages/core/plugins/core-plugins-server-internal/src/test_helpers/index.ts b/packages/core/plugins/core-plugins-server-internal/src/test_helpers/index.ts new file mode 100644 index 0000000000000..86ffb0ec8f407 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/src/test_helpers/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { createCoreContextConfigServiceMock } from './create_core_context_config_service.mock'; diff --git a/src/core/server/plugins/types.test.ts b/packages/core/plugins/core-plugins-server-internal/src/types.test.ts similarity index 96% rename from src/core/server/plugins/types.test.ts rename to packages/core/plugins/core-plugins-server-internal/src/types.test.ts index 4a0e6052a9901..ea1537bf0649e 100644 --- a/src/core/server/plugins/types.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/types.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { ExposedToBrowserDescriptor } from './types'; +import type { ExposedToBrowserDescriptor } from '@kbn/core-plugins-server'; describe('ExposedToBrowserDescriptor', () => { interface ConfigType { diff --git a/packages/core/plugins/core-plugins-server-internal/src/types.ts b/packages/core/plugins/core-plugins-server-internal/src/types.ts new file mode 100644 index 0000000000000..def1a27a4c26f --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/src/types.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { PluginName, PluginOpaqueId } from '@kbn/core-base-common'; + +/** @internal */ +export interface PluginDependencies { + asNames: ReadonlyMap; + asOpaqueIds: ReadonlyMap; +} diff --git a/packages/core/plugins/core-plugins-server-internal/tsconfig.json b/packages/core/plugins/core-plugins-server-internal/tsconfig.json new file mode 100644 index 0000000000000..4582562d6c9bb --- /dev/null +++ b/packages/core/plugins/core-plugins-server-internal/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/plugins/core-plugins-server-mocks/BUILD.bazel b/packages/core/plugins/core-plugins-server-mocks/BUILD.bazel new file mode 100644 index 0000000000000..18c5beb51fb46 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-mocks/BUILD.bazel @@ -0,0 +1,104 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-plugins-server-mocks" +PKG_REQUIRE_NAME = "@kbn/core-plugins-server-mocks" + +SOURCE_FILES = glob( + [ + "**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "//packages/core/plugins/core-plugins-server-internal", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "//packages/kbn-utility-types:npm_module_types", + "//packages/core/plugins/core-plugins-server-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/plugins/core-plugins-server-mocks/README.md b/packages/core/plugins/core-plugins-server-mocks/README.md new file mode 100644 index 0000000000000..2ec4d6313919f --- /dev/null +++ b/packages/core/plugins/core-plugins-server-mocks/README.md @@ -0,0 +1,4 @@ +# @kbn/core-plugins-server-mocks + +This package contains mocks for Core's server-side `plugins` service. +- `pluginsServiceMock` diff --git a/packages/core/plugins/core-plugins-server-mocks/index.ts b/packages/core/plugins/core-plugins-server-mocks/index.ts new file mode 100644 index 0000000000000..ebf3e8864ef33 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-mocks/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { pluginServiceMock } from './src'; diff --git a/packages/core/plugins/core-plugins-server-mocks/jest.config.js b/packages/core/plugins/core-plugins-server-mocks/jest.config.js new file mode 100644 index 0000000000000..f7924be975ac9 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-mocks/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/plugins/core-plugins-server-mocks'], +}; diff --git a/packages/core/plugins/core-plugins-server-mocks/kibana.jsonc b/packages/core/plugins/core-plugins-server-mocks/kibana.jsonc new file mode 100644 index 0000000000000..4a1b2c0bd2258 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-mocks/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-plugins-server-mocks", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/plugins/core-plugins-server-mocks/package.json b/packages/core/plugins/core-plugins-server-mocks/package.json new file mode 100644 index 0000000000000..2ac79f595e267 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-mocks/package.json @@ -0,0 +1,9 @@ +{ + "name": "@kbn/core-plugins-server-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/plugins/core-plugins-server-mocks/src/index.ts b/packages/core/plugins/core-plugins-server-mocks/src/index.ts new file mode 100644 index 0000000000000..30b3d50c22b74 --- /dev/null +++ b/packages/core/plugins/core-plugins-server-mocks/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { pluginServiceMock } from './plugins_service.mock'; diff --git a/src/core/server/plugins/plugins_service.mock.ts b/packages/core/plugins/core-plugins-server-mocks/src/plugins_service.mock.ts similarity index 93% rename from src/core/server/plugins/plugins_service.mock.ts rename to packages/core/plugins/core-plugins-server-mocks/src/plugins_service.mock.ts index ee7b35a412e80..58c43a4c30eda 100644 --- a/src/core/server/plugins/plugins_service.mock.ts +++ b/packages/core/plugins/core-plugins-server-mocks/src/plugins_service.mock.ts @@ -7,7 +7,7 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import type { PluginsService, PluginsServiceSetup } from './plugins_service'; +import { PluginsService, type PluginsServiceSetup } from '@kbn/core-plugins-server-internal'; type PluginsServiceMock = jest.Mocked>; diff --git a/packages/core/plugins/core-plugins-server-mocks/tsconfig.json b/packages/core/plugins/core-plugins-server-mocks/tsconfig.json new file mode 100644 index 0000000000000..4582562d6c9bb --- /dev/null +++ b/packages/core/plugins/core-plugins-server-mocks/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/plugins/core-plugins-server/BUILD.bazel b/packages/core/plugins/core-plugins-server/BUILD.bazel new file mode 100644 index 0000000000000..1204629766db4 --- /dev/null +++ b/packages/core/plugins/core-plugins-server/BUILD.bazel @@ -0,0 +1,117 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-plugins-server" +PKG_REQUIRE_NAME = "@kbn/core-plugins-server" + +SOURCE_FILES = glob( + [ + "**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//rxjs", + "//packages/kbn-config-schema", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//rxjs", + "//packages/kbn-config:npm_module_types", + "//packages/kbn-config-schema:npm_module_types", + "//packages/kbn-utility-types:npm_module_types", + "//packages/kbn-utils:npm_module_types", + "//packages/kbn-logging:npm_module_types", + "//packages/core/base/core-base-common:npm_module_types", + "//packages/core/node/core-node-server:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", + "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", + "//packages/core/lifecycle/core-lifecycle-server:npm_module_types", + +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/plugins/core-plugins-server/README.md b/packages/core/plugins/core-plugins-server/README.md new file mode 100644 index 0000000000000..1add32cc3e1d4 --- /dev/null +++ b/packages/core/plugins/core-plugins-server/README.md @@ -0,0 +1,3 @@ +# @kbn/core-plugins-server + +This package contains the public types for core's server-side plugins service. diff --git a/packages/core/plugins/core-plugins-server/index.ts b/packages/core/plugins/core-plugins-server/index.ts new file mode 100644 index 0000000000000..47aa0d04ac87c --- /dev/null +++ b/packages/core/plugins/core-plugins-server/index.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { + PrebootPlugin, + Plugin, + AsyncPlugin, + PluginConfigDescriptor, + PluginConfigSchema, + PluginInitializer, + PluginInitializerContext, + PluginManifest, + SharedGlobalConfig, + MakeUsageFromSchema, + ExposedToBrowserDescriptor, +} from './src'; + +export { SharedGlobalConfigKeys } from './src'; diff --git a/packages/core/plugins/core-plugins-server/jest.config.js b/packages/core/plugins/core-plugins-server/jest.config.js new file mode 100644 index 0000000000000..f03056c0495e2 --- /dev/null +++ b/packages/core/plugins/core-plugins-server/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/plugins/core-plugins-server'], +}; diff --git a/packages/core/plugins/core-plugins-server/kibana.jsonc b/packages/core/plugins/core-plugins-server/kibana.jsonc new file mode 100644 index 0000000000000..708281a40646b --- /dev/null +++ b/packages/core/plugins/core-plugins-server/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-plugins-server", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/plugins/core-plugins-server/package.json b/packages/core/plugins/core-plugins-server/package.json new file mode 100644 index 0000000000000..72e1521adb935 --- /dev/null +++ b/packages/core/plugins/core-plugins-server/package.json @@ -0,0 +1,9 @@ +{ + "name": "@kbn/core-plugins-server", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/plugins/core-plugins-server/src/index.ts b/packages/core/plugins/core-plugins-server/src/index.ts new file mode 100644 index 0000000000000..94ad27dedbf12 --- /dev/null +++ b/packages/core/plugins/core-plugins-server/src/index.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { + PrebootPlugin, + Plugin, + AsyncPlugin, + PluginConfigDescriptor, + PluginConfigSchema, + PluginInitializer, + PluginInitializerContext, + PluginManifest, + SharedGlobalConfig, + MakeUsageFromSchema, + ExposedToBrowserDescriptor, +} from './types'; + +export { SharedGlobalConfigKeys } from './shared_global_config'; diff --git a/packages/core/plugins/core-plugins-server/src/shared_global_config.ts b/packages/core/plugins/core-plugins-server/src/shared_global_config.ts new file mode 100644 index 0000000000000..6329b2576ab21 --- /dev/null +++ b/packages/core/plugins/core-plugins-server/src/shared_global_config.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export const SharedGlobalConfigKeys = { + // We can add more if really needed + elasticsearch: ['shardTimeout', 'requestTimeout', 'pingTimeout'] as const, + path: ['data'] as const, + savedObjects: ['maxImportPayloadBytes'] as const, +}; diff --git a/packages/core/plugins/core-plugins-server/src/types.ts b/packages/core/plugins/core-plugins-server/src/types.ts new file mode 100644 index 0000000000000..46773971d35ef --- /dev/null +++ b/packages/core/plugins/core-plugins-server/src/types.ts @@ -0,0 +1,452 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Observable } from 'rxjs'; +import { Type } from '@kbn/config-schema'; +import type { RecursiveReadonly } from '@kbn/utility-types'; +import type { PathConfigType } from '@kbn/utils'; +import type { LoggerFactory } from '@kbn/logging'; +import type { + ConfigPath, + EnvironmentMode, + PackageInfo, + ConfigDeprecationProvider, +} from '@kbn/config'; +import type { PluginName, PluginOpaqueId, PluginType } from '@kbn/core-base-common'; +import type { NodeInfo } from '@kbn/core-node-server'; +import type { ElasticsearchConfigType } from '@kbn/core-elasticsearch-server-internal'; +import type { SavedObjectsConfigType } from '@kbn/core-saved-objects-base-server-internal'; +import type { CorePreboot, CoreSetup, CoreStart } from '@kbn/core-lifecycle-server'; +import { SharedGlobalConfigKeys } from './shared_global_config'; +type Maybe = T | undefined; + +/** + * Dedicated type for plugin configuration schema. + * + * @public + */ +export type PluginConfigSchema = Type; + +/** + * Type defining the list of configuration properties that will be exposed on the client-side + * Object properties can either be fully exposed + * + * @public + */ +export type ExposedToBrowserDescriptor = { + [Key in keyof T]?: T[Key] extends Maybe + ? // handles arrays as primitive values + boolean + : T[Key] extends Maybe + ? // can be nested for objects + ExposedToBrowserDescriptor | boolean + : // primitives + boolean; +}; + +/** + * Describes a plugin configuration properties. + * + * @example + * ```typescript + * // my_plugin/server/index.ts + * import { schema, TypeOf } from '@kbn/config-schema'; + * import { PluginConfigDescriptor } from '@kbn/core/server'; + * + * const configSchema = schema.object({ + * secret: schema.string({ defaultValue: 'Only on server' }), + * uiProp: schema.string({ defaultValue: 'Accessible from client' }), + * }); + * + * type ConfigType = TypeOf; + * + * export const config: PluginConfigDescriptor = { + * exposeToBrowser: { + * uiProp: true, + * }, + * schema: configSchema, + * deprecations: ({ rename, unused }) => [ + * rename('securityKey', 'secret'), + * unused('deprecatedProperty'), + * ], + * }; + * ``` + * + * @public + */ +export interface PluginConfigDescriptor { + /** + * Provider for the {@link ConfigDeprecation} to apply to the plugin configuration. + */ + deprecations?: ConfigDeprecationProvider; + /** + * List of configuration properties that will be available on the client-side plugin. + */ + exposeToBrowser?: ExposedToBrowserDescriptor; + /** + * Schema to use to validate the plugin configuration. + * + * {@link PluginConfigSchema} + */ + schema: PluginConfigSchema; + /** + * Expose non-default configs to usage collection to be sent via telemetry. + * set a config to `true` to report the actual changed config value. + * set a config to `false` to report the changed config value as [redacted]. + * + * All changed configs except booleans and numbers will be reported + * as [redacted] unless otherwise specified. + * + * {@link MakeUsageFromSchema} + */ + exposeToUsage?: MakeUsageFromSchema; +} + +/** + * List of configuration values that will be exposed to usage collection. + * If parent node or actual config path is set to `true` then the actual value + * of these configs will be reoprted. + * If parent node or actual config path is set to `false` then the config + * will be reported as [redacted]. + * + * @public + */ +export type MakeUsageFromSchema = { + [Key in keyof T]?: T[Key] extends Maybe + ? // arrays of objects are always redacted + false + : T[Key] extends Maybe + ? boolean + : T[Key] extends Maybe + ? MakeUsageFromSchema | boolean + : boolean; +}; + +/** + * Describes the set of required and optional properties plugin can define in its + * mandatory JSON manifest file. + * + * @remarks + * Should never be used in code outside of Core but is exported for + * documentation purposes. + * + * @public + */ +export interface PluginManifest { + /** + * Identifier of the plugin. Must be a string in camelCase. Part of a plugin public contract. + * Other plugins leverage it to access plugin API, navigate to the plugin, etc. + */ + readonly id: PluginName; + + /** + * Version of the plugin. + */ + readonly version: string; + + /** + * The version of Kibana the plugin is compatible with, defaults to "version". + */ + readonly kibanaVersion: string; + + /** + * Type of the plugin, defaults to `standard`. + */ + readonly type: PluginType; + + /** + * Root {@link ConfigPath | configuration path} used by the plugin, defaults + * to "id" in snake_case format. + * + * @example + * id: myPlugin + * configPath: my_plugin + */ + readonly configPath: ConfigPath; + + /** + * An optional list of the other plugins that **must be** installed and enabled + * for this plugin to function properly. + */ + readonly requiredPlugins: readonly PluginName[]; + + /** + * List of plugin ids that this plugin's UI code imports modules from that are + * not in `requiredPlugins`. + * + * @remarks + * The plugins listed here will be loaded in the browser, even if the plugin is + * disabled. Required by `@kbn/optimizer` to support cross-plugin imports. + * "core" and plugins already listed in `requiredPlugins` do not need to be + * duplicated here. + */ + readonly requiredBundles: readonly string[]; + + /** + * An optional list of the other plugins that if installed and enabled **may be** + * leveraged by this plugin for some additional functionality but otherwise are + * not required for this plugin to work properly. + */ + readonly optionalPlugins: readonly PluginName[]; + + /** + * Specifies whether plugin includes some client/browser specific functionality + * that should be included into client bundle via `public/ui_plugin.js` file. + */ + readonly ui: boolean; + + /** + * Specifies whether plugin includes some server-side specific functionality. + */ + readonly server: boolean; + + /** + * Specifies directory names that can be imported by other ui-plugins built + * using the same instance of the @kbn/optimizer. A temporary measure we plan + * to replace with better mechanisms for sharing static code between plugins + * @deprecated To be deleted when https://github.com/elastic/kibana/issues/101948 is done. + */ + readonly extraPublicDirs?: string[]; + + /** + * Only used for the automatically generated API documentation. Specifying service + * folders will cause your plugin API reference to be broken up into sub sections. + */ + readonly serviceFolders?: readonly string[]; + + readonly owner: { + /** + * The name of the team that currently owns this plugin. + */ + readonly name: string; + /** + * All internal plugins should have a github team specified. GitHub teams can be viewed here: + * https://github.com/orgs/elastic/teams + */ + readonly githubTeam?: string; + }; + + /** + * TODO: make required once all plugins specify this. + * A brief description of what this plugin does and any capabilities it provides. + */ + readonly description?: string; + + /** + * Specifies whether this plugin - and its required dependencies - will be enabled for anonymous pages (login page, status page when + * configured, etc.) Default is false. + */ + readonly enabledOnAnonymousPages?: boolean; +} + +/** + * The interface that should be returned by a `PluginInitializer` for a `preboot` plugin. + * + * @public + */ +export interface PrebootPlugin { + setup(core: CorePreboot, plugins: TPluginsSetup): TSetup; + + stop?(): void; +} + +/** + * The interface that should be returned by a `PluginInitializer` for a `standard` plugin. + * + * @public + */ +export interface Plugin< + TSetup = void, + TStart = void, + TPluginsSetup extends object = object, + TPluginsStart extends object = object +> { + setup(core: CoreSetup, plugins: TPluginsSetup): TSetup; + + start(core: CoreStart, plugins: TPluginsStart): TStart; + + stop?(): void; +} + +/** + * A plugin with asynchronous lifecycle methods. + * + * @deprecated Asynchronous lifecycles are deprecated, and should be migrated to sync {@link Plugin | plugin} + * @removeBy 8.8.0 + * @public + */ +export interface AsyncPlugin< + TSetup = void, + TStart = void, + TPluginsSetup extends object = object, + TPluginsStart extends object = object +> { + setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | Promise; + + start(core: CoreStart, plugins: TPluginsStart): TStart | Promise; + + stop?(): void; +} + +/** + * @public + */ +export type SharedGlobalConfig = RecursiveReadonly<{ + elasticsearch: Pick; + path: Pick; + savedObjects: Pick; +}>; + +/** + * Context that's available to plugins during initialization stage. + * + * @public + */ +export interface PluginInitializerContext { + opaqueId: PluginOpaqueId; + env: { + mode: EnvironmentMode; + packageInfo: Readonly; + instanceUuid: string; + configs: readonly string[]; + }; + /** + * Access the configuration for this particular Kibana node. + * Can be used to determine which `roles` the current process was started with. + * + * @example + * ```typescript + * // plugins/my-plugin/server/plugin.ts + * + * export class MyPlugin implements Plugin { + * constructor(private readonly initContext: PluginInitializerContext) { + * this.initContext = initContext; + * } + * setup() { + * if (this.initContext.node.roles.backgroundTasks) { + * // run background tasks + * } else if (this.initContext.node.roles.ui) { + * // register http routes, etc + * } + * } + * } + * ``` + */ + node: NodeInfo; + /** + * {@link LoggerFactory | logger factory} instance already bound to the plugin's logging context + * + * @example + * ```typescript + * // plugins/my-plugin/server/plugin.ts + * // "id: myPlugin" in `plugins/my-plugin/kibana.yaml` + * + * export class MyPlugin implements Plugin { + * constructor(private readonly initContext: PluginInitializerContext) { + * this.logger = initContext.logger.get(); + * // `logger` context: `plugins.myPlugin` + * this.mySubLogger = initContext.logger.get('sub'); // or this.logger.get('sub'); + * // `mySubLogger` context: `plugins.myPlugin.sub` + * } + * } + * ``` + */ + logger: LoggerFactory; + /** + * Accessors for the plugin's configuration + */ + config: { + /** + * Provide access to Kibana legacy configuration values. + * + * @remarks Naming not final here, it may be renamed in a near future + * @deprecated Accessing configuration values outside of the plugin's config scope is highly discouraged. + * Can be removed when https://github.com/elastic/kibana/issues/119862 is done. + */ + legacy: { + globalConfig$: Observable; + get: () => SharedGlobalConfig; + }; + /** + * Return an observable of the plugin's configuration + * + * @example + * ```typescript + * // plugins/my-plugin/server/plugin.ts + * + * export class MyPlugin implements Plugin { + * constructor(private readonly initContext: PluginInitializerContext) {} + * setup(core) { + * this.configSub = this.initContext.config.create().subscribe((config) => { + * this.myService.reconfigure(config); + * }); + * } + * stop() { + * this.configSub.unsubscribe(); + * } + * ``` + * + * @example + * ```typescript + * // plugins/my-plugin/server/plugin.ts + * + * export class MyPlugin implements Plugin { + * constructor(private readonly initContext: PluginInitializerContext) {} + * async setup(core) { + * this.config = await this.initContext.config.create().pipe(take(1)).toPromise(); + * } + * stop() { + * this.configSub.unsubscribe(); + * } + * ``` + * + * @remarks The underlying observable has a replay effect, meaning that awaiting for the first emission + * will be resolved at next tick, without risks to delay any asynchronous code's workflow. + */ + create: () => Observable; + /** + * Return the current value of the plugin's configuration synchronously. + * + * @example + * ```typescript + * // plugins/my-plugin/server/plugin.ts + * + * export class MyPlugin implements Plugin { + * constructor(private readonly initContext: PluginInitializerContext) {} + * setup(core) { + * const config = this.initContext.config.get(); + * // do something with the config + * } + * } + * ``` + * + * @remarks This should only be used when synchronous access is an absolute necessity, such + * as during the plugin's setup or start lifecycle. For all other usages, + * {@link create} should be used instead. + */ + get: () => T; + }; +} + +/** + * The `plugin` export at the root of a plugin's `server` directory should conform + * to this interface. + * + * @public + */ +export type PluginInitializer< + TSetup, + TStart, + TPluginsSetup extends object = object, + TPluginsStart extends object = object +> = ( + core: PluginInitializerContext +) => + | Plugin + | PrebootPlugin + | AsyncPlugin; diff --git a/packages/core/plugins/core-plugins-server/tsconfig.json b/packages/core/plugins/core-plugins-server/tsconfig.json new file mode 100644 index 0000000000000..4582562d6c9bb --- /dev/null +++ b/packages/core/plugins/core-plugins-server/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/preboot/core-preboot-server-internal/BUILD.bazel b/packages/core/preboot/core-preboot-server-internal/BUILD.bazel index a165a573fc524..5f6d76b008d5f 100644 --- a/packages/core/preboot/core-preboot-server-internal/BUILD.bazel +++ b/packages/core/preboot/core-preboot-server-internal/BUILD.bazel @@ -77,7 +77,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -91,6 +90,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -102,17 +109,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/preboot/core-preboot-server-internal/package.json b/packages/core/preboot/core-preboot-server-internal/package.json index a038ae305d586..f768ed11d3533 100644 --- a/packages/core/preboot/core-preboot-server-internal/package.json +++ b/packages/core/preboot/core-preboot-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/preboot/core-preboot-server-internal/tsconfig.json b/packages/core/preboot/core-preboot-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/preboot/core-preboot-server-internal/tsconfig.json +++ b/packages/core/preboot/core-preboot-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel b/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel index 53f7ebd9e6c1e..2decb5b2d8f2f 100644 --- a/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel +++ b/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel @@ -67,7 +67,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -81,6 +80,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -92,17 +99,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/preboot/core-preboot-server-mocks/package.json b/packages/core/preboot/core-preboot-server-mocks/package.json index 1f40513429607..150053877e939 100644 --- a/packages/core/preboot/core-preboot-server-mocks/package.json +++ b/packages/core/preboot/core-preboot-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/preboot/core-preboot-server-mocks/tsconfig.json b/packages/core/preboot/core-preboot-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/preboot/core-preboot-server-mocks/tsconfig.json +++ b/packages/core/preboot/core-preboot-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/preboot/core-preboot-server/BUILD.bazel b/packages/core/preboot/core-preboot-server/BUILD.bazel index 16cea9dc173ef..6bd1af7108de3 100644 --- a/packages/core/preboot/core-preboot-server/BUILD.bazel +++ b/packages/core/preboot/core-preboot-server/BUILD.bazel @@ -63,7 +63,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -77,6 +76,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -88,17 +95,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/preboot/core-preboot-server/package.json b/packages/core/preboot/core-preboot-server/package.json index b5afd04887380..b658189601696 100644 --- a/packages/core/preboot/core-preboot-server/package.json +++ b/packages/core/preboot/core-preboot-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/preboot/core-preboot-server/tsconfig.json b/packages/core/preboot/core-preboot-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/preboot/core-preboot-server/tsconfig.json +++ b/packages/core/preboot/core-preboot-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/rendering/core-rendering-browser-internal/BUILD.bazel b/packages/core/rendering/core-rendering-browser-internal/BUILD.bazel index e9f1ff1b1e19d..c0fb214bfb960 100644 --- a/packages/core/rendering/core-rendering-browser-internal/BUILD.bazel +++ b/packages/core/rendering/core-rendering-browser-internal/BUILD.bazel @@ -97,7 +97,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -111,6 +110,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -122,17 +129,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/rendering/core-rendering-browser-internal/package.json b/packages/core/rendering/core-rendering-browser-internal/package.json index 78cf06e44c4dc..1ccaccf9621ee 100644 --- a/packages/core/rendering/core-rendering-browser-internal/package.json +++ b/packages/core/rendering/core-rendering-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/rendering/core-rendering-browser-internal/tsconfig.json b/packages/core/rendering/core-rendering-browser-internal/tsconfig.json index 2249e2ee93761..37f8e83d0d7a6 100644 --- a/packages/core/rendering/core-rendering-browser-internal/tsconfig.json +++ b/packages/core/rendering/core-rendering-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/rendering/core-rendering-browser-mocks/BUILD.bazel b/packages/core/rendering/core-rendering-browser-mocks/BUILD.bazel index 7493624fa2e65..d2cdb9c78c286 100644 --- a/packages/core/rendering/core-rendering-browser-mocks/BUILD.bazel +++ b/packages/core/rendering/core-rendering-browser-mocks/BUILD.bazel @@ -73,7 +73,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -87,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/rendering/core-rendering-browser-mocks/package.json b/packages/core/rendering/core-rendering-browser-mocks/package.json index 525a131a56f61..b9cef0d400733 100644 --- a/packages/core/rendering/core-rendering-browser-mocks/package.json +++ b/packages/core/rendering/core-rendering-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/rendering/core-rendering-browser-mocks/tsconfig.json b/packages/core/rendering/core-rendering-browser-mocks/tsconfig.json index 26b4c7aca3a67..741519055e986 100644 --- a/packages/core/rendering/core-rendering-browser-mocks/tsconfig.json +++ b/packages/core/rendering/core-rendering-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/rendering/core-rendering-server-internal/BUILD.bazel b/packages/core/rendering/core-rendering-server-internal/BUILD.bazel index b02ff09264699..9b9c41de78663 100644 --- a/packages/core/rendering/core-rendering-server-internal/BUILD.bazel +++ b/packages/core/rendering/core-rendering-server-internal/BUILD.bazel @@ -86,7 +86,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -100,6 +99,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -111,17 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/rendering/core-rendering-server-internal/package.json b/packages/core/rendering/core-rendering-server-internal/package.json index ef29d29e9fa2f..b41efec088ad2 100644 --- a/packages/core/rendering/core-rendering-server-internal/package.json +++ b/packages/core/rendering/core-rendering-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/rendering/core-rendering-server-internal/tsconfig.json b/packages/core/rendering/core-rendering-server-internal/tsconfig.json index 73c8a6666ff7e..2279a16c99adf 100644 --- a/packages/core/rendering/core-rendering-server-internal/tsconfig.json +++ b/packages/core/rendering/core-rendering-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/rendering/core-rendering-server-mocks/BUILD.bazel b/packages/core/rendering/core-rendering-server-mocks/BUILD.bazel index 9ec36da1a1f67..7f960ef9e8067 100644 --- a/packages/core/rendering/core-rendering-server-mocks/BUILD.bazel +++ b/packages/core/rendering/core-rendering-server-mocks/BUILD.bazel @@ -65,7 +65,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -79,6 +78,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -90,17 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/rendering/core-rendering-server-mocks/package.json b/packages/core/rendering/core-rendering-server-mocks/package.json index 572e1d5530587..e729d1c022bc7 100644 --- a/packages/core/rendering/core-rendering-server-mocks/package.json +++ b/packages/core/rendering/core-rendering-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/rendering/core-rendering-server-mocks/tsconfig.json b/packages/core/rendering/core-rendering-server-mocks/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/rendering/core-rendering-server-mocks/tsconfig.json +++ b/packages/core/rendering/core-rendering-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/root/core-root-browser-internal/BUILD.bazel b/packages/core/root/core-root-browser-internal/BUILD.bazel index d0d5e786d7867..05f41123181e3 100644 --- a/packages/core/root/core-root-browser-internal/BUILD.bazel +++ b/packages/core/root/core-root-browser-internal/BUILD.bazel @@ -44,6 +44,7 @@ RUNTIME_DEPS = [ "//packages/kbn-i18n", "//packages/kbn-ebt-tools", "//packages/core/application/core-application-browser-internal", + "//packages/core/logging/core-logging-browser-internal", "//packages/core/injected-metadata/core-injected-metadata-browser-internal", "//packages/core/doc-links/core-doc-links-browser-internal", "//packages/core/theme/core-theme-browser-internal", @@ -76,6 +77,7 @@ TYPES_DEPS = [ "//packages/core/execution-context/core-execution-context-browser:npm_module_types", "//packages/core/application/core-application-browser-internal:npm_module_types", "//packages/core/base/core-base-browser-internal:npm_module_types", + "//packages/core/logging/core-logging-browser-internal:npm_module_types", "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", "//packages/core/doc-links/core-doc-links-browser-internal:npm_module_types", "//packages/core/theme/core-theme-browser-internal:npm_module_types", @@ -131,7 +133,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -145,6 +146,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -156,17 +165,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/root/core-root-browser-internal/package.json b/packages/core/root/core-root-browser-internal/package.json index 30a34c02fc4eb..d010180d2747d 100644 --- a/packages/core/root/core-root-browser-internal/package.json +++ b/packages/core/root/core-root-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/root/core-root-browser-internal/src/core_system.test.mocks.ts b/packages/core/root/core-root-browser-internal/src/core_system.test.mocks.ts index 69560623e1636..36cdcb4ae7520 100644 --- a/packages/core/root/core-root-browser-internal/src/core_system.test.mocks.ts +++ b/packages/core/root/core-root-browser-internal/src/core_system.test.mocks.ts @@ -22,6 +22,7 @@ import { uiSettingsServiceMock } from '@kbn/core-ui-settings-browser-mocks'; import { renderingServiceMock } from '@kbn/core-rendering-browser-mocks'; import { integrationsServiceMock } from '@kbn/core-integrations-browser-mocks'; import { coreAppsMock } from '@kbn/core-apps-browser-mocks'; +import { loggingSystemMock } from '@kbn/core-logging-browser-mocks'; export const analyticsServiceStartMock = analyticsServiceMock.createAnalyticsServiceStart(); export const MockAnalyticsService = analyticsServiceMock.create(); @@ -137,3 +138,9 @@ export const ThemeServiceConstructor = jest.fn().mockImplementation(() => MockTh jest.doMock('@kbn/core-theme-browser-internal', () => ({ ThemeService: ThemeServiceConstructor, })); + +export const MockLoggingSystem = loggingSystemMock.create(); +export const LoggingSystemConstructor = jest.fn().mockImplementation(() => MockLoggingSystem); +jest.doMock('@kbn/core-logging-browser-internal', () => ({ + BrowserLoggingSystem: LoggingSystemConstructor, +})); diff --git a/packages/core/root/core-root-browser-internal/src/core_system.test.ts b/packages/core/root/core-root-browser-internal/src/core_system.test.ts index 8e2e980e5ea94..cb9618ce6034c 100644 --- a/packages/core/root/core-root-browser-internal/src/core_system.test.ts +++ b/packages/core/root/core-root-browser-internal/src/core_system.test.ts @@ -38,8 +38,10 @@ import { MockAnalyticsService, analyticsServiceStartMock, fetchOptionalMemoryInfoMock, + MockLoggingSystem, + LoggingSystemConstructor, } from './core_system.test.mocks'; - +import type { EnvironmentMode } from '@kbn/config'; import { CoreSystem } from './core_system'; import { KIBANA_LOADED_EVENT, @@ -136,6 +138,7 @@ describe('constructor', () => { expect(CoreAppConstructor).toHaveBeenCalledTimes(1); expect(ThemeServiceConstructor).toHaveBeenCalledTimes(1); expect(AnalyticsServiceConstructor).toHaveBeenCalledTimes(1); + expect(LoggingSystemConstructor).toHaveBeenCalledTimes(1); }); it('passes injectedMetadata param to InjectedMetadataService', () => { @@ -180,6 +183,47 @@ describe('constructor', () => { stopCoreSystem(); expect(coreSystem.stop).toHaveBeenCalled(); }); + + describe('logging system', () => { + it('instantiate the logging system with the correct level when in dev mode', () => { + const envMode: EnvironmentMode = { + name: 'development', + dev: true, + prod: false, + }; + const injectedMetadata = { env: { mode: envMode } } as any; + + createCoreSystem({ + injectedMetadata, + }); + + expect(LoggingSystemConstructor).toHaveBeenCalledTimes(1); + expect(LoggingSystemConstructor).toHaveBeenCalledWith({ + logLevel: 'all', + }); + }); + it('instantiate the logging system with the correct level when in production mode', () => { + const envMode: EnvironmentMode = { + name: 'production', + dev: false, + prod: true, + }; + const injectedMetadata = { env: { mode: envMode } } as any; + + createCoreSystem({ + injectedMetadata, + }); + + expect(LoggingSystemConstructor).toHaveBeenCalledTimes(1); + expect(LoggingSystemConstructor).toHaveBeenCalledWith({ + logLevel: 'warn', + }); + }); + it('retrieves the logger factory from the logging system', () => { + createCoreSystem({}); + expect(MockLoggingSystem.asLoggerFactory).toHaveBeenCalledTimes(1); + }); + }); }); describe('#setup()', () => { diff --git a/packages/core/root/core-root-browser-internal/src/core_system.ts b/packages/core/root/core-root-browser-internal/src/core_system.ts index b3eae041b785d..eb61e0547279d 100644 --- a/packages/core/root/core-root-browser-internal/src/core_system.ts +++ b/packages/core/root/core-root-browser-internal/src/core_system.ts @@ -7,11 +7,13 @@ */ import { filter, firstValueFrom } from 'rxjs'; +import type { LogLevelId } from '@kbn/logging'; import type { CoreContext } from '@kbn/core-base-browser-internal'; import { InjectedMetadataService, type InjectedMetadataParams, } from '@kbn/core-injected-metadata-browser-internal'; +import { BrowserLoggingSystem } from '@kbn/core-logging-browser-internal'; import { DocLinksService } from '@kbn/core-doc-links-browser-internal'; import { ThemeService } from '@kbn/core-theme-browser-internal'; import type { AnalyticsServiceSetup, AnalyticsServiceStart } from '@kbn/core-analytics-browser'; @@ -78,6 +80,7 @@ interface ExtendedNavigator { * @internal */ export class CoreSystem { + private readonly loggingSystem: BrowserLoggingSystem; private readonly analytics: AnalyticsService; private readonly fatalErrors: FatalErrorsService; private readonly injectedMetadata: InjectedMetadataService; @@ -106,20 +109,24 @@ export class CoreSystem { this.rootDomElement = rootDomElement; - this.i18n = new I18nService(); + const logLevel: LogLevelId = injectedMetadata.env.mode.dev ? 'all' : 'warn'; + this.loggingSystem = new BrowserLoggingSystem({ logLevel }); this.injectedMetadata = new InjectedMetadataService({ injectedMetadata, }); - this.coreContext = { coreId: Symbol('core'), env: injectedMetadata.env }; + this.coreContext = { + coreId: Symbol('core'), + env: injectedMetadata.env, + logger: this.loggingSystem.asLoggerFactory(), + }; + this.i18n = new I18nService(); this.analytics = new AnalyticsService(this.coreContext); - this.fatalErrors = new FatalErrorsService(rootDomElement, () => { // Stop Core before rendering any fatal errors into the DOM this.stop(); }); - this.theme = new ThemeService(); this.notifications = new NotificationsService(); this.http = new HttpService(); @@ -136,7 +143,6 @@ export class CoreSystem { this.integrations = new IntegrationsService(); this.deprecations = new DeprecationsService(); this.executionContext = new ExecutionContextService(); - this.plugins = new PluginsService(this.coreContext, injectedMetadata.uiPlugins); this.coreApp = new CoreAppsService(this.coreContext); diff --git a/packages/core/root/core-root-browser-internal/tsconfig.json b/packages/core/root/core-root-browser-internal/tsconfig.json index 4283cbe1b760b..47ad657279cbb 100644 --- a/packages/core/root/core-root-browser-internal/tsconfig.json +++ b/packages/core/root/core-root-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/saved-objects/core-saved-objects-api-browser/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-api-browser/BUILD.bazel index 3e66402ebc4a3..c5335b58bdd18 100644 --- a/packages/core/saved-objects/core-saved-objects-api-browser/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-api-browser/BUILD.bazel @@ -74,7 +74,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -88,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-api-browser/package.json b/packages/core/saved-objects/core-saved-objects-api-browser/package.json index e6894b4b21767..af4889e4c3418 100644 --- a/packages/core/saved-objects/core-saved-objects-api-browser/package.json +++ b/packages/core/saved-objects/core-saved-objects-api-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-api-browser/tsconfig.json b/packages/core/saved-objects/core-saved-objects-api-browser/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/saved-objects/core-saved-objects-api-browser/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-api-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-api-server-internal/BUILD.bazel index 93f8baadd9fee..c35025c728e59 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/BUILD.bazel @@ -90,7 +90,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -105,6 +104,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -116,17 +123,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-api-server-internal/package.json index e7f962034bc41..99461f483c868 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-api-server-internal/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-api-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-api-server-mocks/BUILD.bazel index f3bb20f392461..c746f77a7473e 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-mocks/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-api-server-mocks/BUILD.bazel @@ -68,7 +68,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -83,6 +82,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -94,17 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-api-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-api-server-mocks/package.json index 59726267976f3..344dee3e9e712 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-api-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-api-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-api-server-mocks/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-api-server-mocks/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-api-server/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-api-server/BUILD.bazel index dc47211c43300..80a40011e1a99 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-api-server/BUILD.bazel @@ -65,7 +65,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -79,6 +78,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -90,17 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-api-server/package.json b/packages/core/saved-objects/core-saved-objects-api-server/package.json index 6335368dfd7f3..006b28669cf72 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server/package.json +++ b/packages/core/saved-objects/core-saved-objects-api-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-api-server/tsconfig.json b/packages/core/saved-objects/core-saved-objects-api-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-api-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel index c962d39d8f3e0..99fc132ed18ec 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel @@ -76,7 +76,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json index 6192262ab0084..d630f04e66318 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel index c4e1b5727b1b9..c5ef952013257 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel @@ -64,7 +64,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -78,6 +77,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -89,17 +96,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json index e6120310e30e7..3ff49367166fc 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel index 33d1373bef26a..0228c86c6d99f 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel @@ -83,7 +83,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -97,6 +96,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -108,17 +115,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/package.json b/packages/core/saved-objects/core-saved-objects-browser-internal/package.json index dcb18eba421c5..1117da4a27c9d 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-browser-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-browser-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-browser-mocks/BUILD.bazel index 60418c4f8551d..0bea85871440b 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-mocks/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-browser-mocks/BUILD.bazel @@ -74,7 +74,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -88,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-browser-mocks/package.json b/packages/core/saved-objects/core-saved-objects-browser-mocks/package.json index d05e22ddfda3f..bba43d5d36aee 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-browser-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-browser-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-browser/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-browser/BUILD.bazel index e34140928c202..e540033110900 100644 --- a/packages/core/saved-objects/core-saved-objects-browser/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-browser/BUILD.bazel @@ -72,7 +72,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -86,6 +85,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +104,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-browser/package.json b/packages/core/saved-objects/core-saved-objects-browser/package.json index 6494337430596..76019a9aaab85 100644 --- a/packages/core/saved-objects/core-saved-objects-browser/package.json +++ b/packages/core/saved-objects/core-saved-objects-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-browser/tsconfig.json b/packages/core/saved-objects/core-saved-objects-browser/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/saved-objects/core-saved-objects-browser/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-common/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-common/BUILD.bazel index cf86db22a2fed..18376aa9960ea 100644 --- a/packages/core/saved-objects/core-saved-objects-common/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-common/BUILD.bazel @@ -72,7 +72,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -86,6 +85,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +104,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-common/package.json b/packages/core/saved-objects/core-saved-objects-common/package.json index b2af72692eda1..11849bd364a11 100644 --- a/packages/core/saved-objects/core-saved-objects-common/package.json +++ b/packages/core/saved-objects/core-saved-objects-common/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-common/tsconfig.json b/packages/core/saved-objects/core-saved-objects-common/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/saved-objects/core-saved-objects-common/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-common/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/BUILD.bazel index 6f44087cd02f4..1004b8bdc0061 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/BUILD.bazel @@ -78,7 +78,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -93,6 +92,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -104,17 +111,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/package.json index 666eda215a5d7..83b06bcce8d24 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/BUILD.bazel index 1eba980837e31..4189affe70b4c 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/BUILD.bazel @@ -64,7 +64,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -79,6 +78,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -90,17 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/package.json index e043ddc547020..e6117d0a4df34 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-migration-server-internal/BUILD.bazel index cb6e6dde51a28..e582bb0811880 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/BUILD.bazel @@ -92,7 +92,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -107,6 +106,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -118,17 +125,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-migration-server-internal/package.json index d6f11a4e41824..1759e06b65948 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/README.md b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/README.md index 12d3b2d490583..52e79edcf8b7d 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/README.md +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/README.md @@ -167,14 +167,19 @@ the same version could have plugins enabled at any time that would introduce new transforms or mappings. → `OUTDATED_DOCUMENTS_SEARCH` -3. If the `.kibana` alias exists we’re migrating from either a v1 or v2 index +3. If `waitForMigrations` was set we're running on a background-tasks node and +we should not participate in the migration but instead wait for the ui node(s) +to complete the migration. + → `WAIT_FOR_MIGRATION_COMPLETION` + +4. If the `.kibana` alias exists we’re migrating from either a v1 or v2 index and the migration source index is the index the `.kibana` alias points to. → `WAIT_FOR_YELLOW_SOURCE` -4. If `.kibana` is a concrete index, we’re migrating from a legacy index +5. If `.kibana` is a concrete index, we’re migrating from a legacy index → `LEGACY_SET_WRITE_BLOCK` -5. If there are no `.kibana` indices, this is a fresh deployment. Initialize a +6. If there are no `.kibana` indices, this is a fresh deployment. Initialize a new saved objects index → `CREATE_NEW_TARGET` @@ -259,6 +264,15 @@ new `.kibana` alias that points to `.kibana_pre6.5.0_001`. `index_not_found_exception` another instance has already completed this step. → `SET_SOURCE_WRITE_BLOCK` +## WAIT_FOR_MIGRATION_COMPLETION +### Next action +`fetchIndices` +### New control state +1. If the ui node finished the migration + → `DONE` +2. Otherwise wait 2s and check again + → WAIT_FOR_MIGRATION_COMPLETION + ## WAIT_FOR_YELLOW_SOURCE ### Next action `waitForIndexStatus` (status='yellow') @@ -417,6 +431,13 @@ update the mappings and then use an update_by_query to ensure that all fields ar ## UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK ### Next action +`waitForPickupUpdatedMappingsTask` + +### New control state + → `MARK_VERSION_INDEX_READY` + +## MARK_VERSION_INDEX_READY +### Next action `updateAliases` Atomically apply the `versionIndexReadyActions` using the _alias actions API. By performing the following actions we guarantee that if multiple versions of Kibana started the upgrade in parallel, only one version will succeed. diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/__snapshots__/migrations_state_action_machine.test.ts.snap b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/__snapshots__/migrations_state_action_machine.test.ts.snap index 39ff3c4c5700a..4e19c9bf62690 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/__snapshots__/migrations_state_action_machine.test.ts.snap +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/__snapshots__/migrations_state_action_machine.test.ts.snap @@ -178,6 +178,7 @@ Object { "transformedDocBatches": Array [], "versionAlias": ".my-so-index_7.11.0", "versionIndex": ".my-so-index_7.11.0_001", + "waitForMigrationCompletion": false, }, }, }, @@ -362,6 +363,7 @@ Object { "transformedDocBatches": Array [], "versionAlias": ".my-so-index_7.11.0", "versionIndex": ".my-so-index_7.11.0_001", + "waitForMigrationCompletion": false, }, }, }, @@ -550,6 +552,7 @@ Object { "transformedDocBatches": Array [], "versionAlias": ".my-so-index_7.11.0", "versionIndex": ".my-so-index_7.11.0_001", + "waitForMigrationCompletion": false, }, }, }, @@ -742,6 +745,7 @@ Object { "transformedDocBatches": Array [], "versionAlias": ".my-so-index_7.11.0", "versionIndex": ".my-so-index_7.11.0_001", + "waitForMigrationCompletion": false, }, }, }, @@ -971,6 +975,7 @@ Object { ], "versionAlias": ".my-so-index_7.11.0", "versionIndex": ".my-so-index_7.11.0_001", + "waitForMigrationCompletion": false, }, }, }, @@ -1166,6 +1171,7 @@ Object { ], "versionAlias": ".my-so-index_7.11.0", "versionIndex": ".my-so-index_7.11.0_001", + "waitForMigrationCompletion": false, }, }, }, diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/initial_state.test.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/initial_state.test.ts index d1c19aa7d212e..35d22e69f724e 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/initial_state.test.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/initial_state.test.ts @@ -40,6 +40,7 @@ describe('createInitialState', () => { expect( createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: true, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, @@ -216,10 +217,32 @@ describe('createInitialState', () => { }, "versionAlias": ".kibana_task_manager_8.1.0", "versionIndex": ".kibana_task_manager_8.1.0_001", + "waitForMigrationCompletion": true, } `); }); + it('creates the initial state for the model with waitForMigrationCompletion false,', () => { + expect( + createInitialState({ + kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, + targetMappings: { + dynamic: 'strict', + properties: { my_type: { properties: { title: { type: 'text' } } } }, + }, + migrationVersionPerType: {}, + indexPrefix: '.kibana_task_manager', + migrationsConfig, + typeRegistry, + docLinks, + logger: mockLogger.get(), + }) + ).toMatchObject({ + waitForMigrationCompletion: false, + }); + }); + it('returns state with the correct `knownTypes`', () => { typeRegistry.registerType({ name: 'foo', @@ -236,6 +259,7 @@ describe('createInitialState', () => { const initialState = createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, @@ -263,6 +287,7 @@ describe('createInitialState', () => { const initialState = createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, @@ -282,6 +307,7 @@ describe('createInitialState', () => { const preMigrationScript = "ctx._id = ctx._source.type + ':' + ctx._id"; const initialState = createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, @@ -305,6 +331,7 @@ describe('createInitialState', () => { Option.isNone( createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, @@ -324,6 +351,7 @@ describe('createInitialState', () => { expect( createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, @@ -378,6 +406,7 @@ describe('createInitialState', () => { const logger = mockLogger.get(); const initialState = createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, @@ -398,6 +427,7 @@ describe('createInitialState', () => { const logger = mockLogger.get(); const initialState = createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, @@ -423,6 +453,7 @@ describe('createInitialState', () => { it('initializes the `discardUnknownObjects` flag to true if the value provided in the config matches the current kibana version', () => { const initialState = createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, @@ -445,6 +476,7 @@ describe('createInitialState', () => { const logger = mockLogger.get(); const initialState = createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, @@ -470,6 +502,7 @@ describe('createInitialState', () => { it('initializes the `discardCorruptObjects` flag to true if the value provided in the config matches the current kibana version', () => { const initialState = createInitialState({ kibanaVersion: '8.1.0', + waitForMigrationCompletion: false, targetMappings: { dynamic: 'strict', properties: { my_type: { properties: { title: { type: 'text' } } } }, diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/initial_state.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/initial_state.ts index 1843227934bcd..72eae8e188094 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/initial_state.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/initial_state.ts @@ -23,6 +23,7 @@ import { excludeUnusedTypesQuery } from './core'; */ export const createInitialState = ({ kibanaVersion, + waitForMigrationCompletion, targetMappings, preMigrationScript, migrationVersionPerType, @@ -33,6 +34,7 @@ export const createInitialState = ({ logger, }: { kibanaVersion: string; + waitForMigrationCompletion: boolean; targetMappings: IndexMapping; preMigrationScript?: string; migrationVersionPerType: SavedObjectsMigrationVersion; @@ -95,6 +97,7 @@ export const createInitialState = ({ return { controlState: 'INIT', + waitForMigrationCompletion, indexPrefix, legacyIndex: indexPrefix, currentAlias: indexPrefix, diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.test.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.test.ts index 5d1cb32eca6d2..dc5addb1624b8 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.test.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.test.ts @@ -253,6 +253,7 @@ const mockOptions = () => { const options: MockedOptions = { logger: loggingSystemMock.create().get(), kibanaVersion: '8.2.3', + waitForMigrationCompletion: false, typeRegistry: createRegistry([ { name: 'testtype', diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts index 1d8d766d8ac88..837c2a47bea58 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts @@ -45,6 +45,7 @@ export interface KibanaMigratorOptions { kibanaVersion: string; logger: Logger; docLinks: DocLinksServiceStart; + waitForMigrationCompletion: boolean; } /** @@ -65,7 +66,7 @@ export class KibanaMigrator implements IKibanaMigrator { private readonly activeMappings: IndexMapping; private readonly soMigrationsConfig: SavedObjectsMigrationConfigType; private readonly docLinks: DocLinksServiceStart; - + private readonly waitForMigrationCompletion: boolean; public readonly kibanaVersion: string; /** @@ -79,6 +80,7 @@ export class KibanaMigrator implements IKibanaMigrator { kibanaVersion, logger, docLinks, + waitForMigrationCompletion, }: KibanaMigratorOptions) { this.client = client; this.kibanaIndex = kibanaIndex; @@ -93,6 +95,7 @@ export class KibanaMigrator implements IKibanaMigrator { typeRegistry, log: this.log, }); + this.waitForMigrationCompletion = waitForMigrationCompletion; // Building the active mappings (and associated md5sums) is an expensive // operation so we cache the result this.activeMappings = buildActiveMappings(this.mappingProperties); @@ -148,6 +151,7 @@ export class KibanaMigrator implements IKibanaMigrator { return runResilientMigrator({ client: this.client, kibanaVersion: this.kibanaVersion, + waitForMigrationCompletion: this.waitForMigrationCompletion, targetMappings: buildActiveMappings(indexMap[index].typeMappings), logger: this.log, preMigrationScript: indexMap[index].script, diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/migrations_state_action_machine.test.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/migrations_state_action_machine.test.ts index 55b0a53d8f807..255a26275b6e8 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/migrations_state_action_machine.test.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/migrations_state_action_machine.test.ts @@ -39,6 +39,7 @@ describe('migrationsStateActionMachine', () => { const initialState = createInitialState({ kibanaVersion: '7.11.0', + waitForMigrationCompletion: false, targetMappings: { properties: {} }, migrationVersionPerType: {}, indexPrefix: '.my-so-index', diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/helpers.test.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/helpers.test.ts index b9756d46237ed..c364e053c1ff6 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/helpers.test.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/helpers.test.ts @@ -12,6 +12,7 @@ import { addMustClausesToBoolQuery, addMustNotClausesToBoolQuery, getAliases, + versionMigrationCompleted, } from './helpers'; describe('addExcludedTypesToBoolQuery', () => { @@ -230,3 +231,39 @@ describe('getAliases', () => { `); }); }); + +describe('versionMigrationCompleted', () => { + it('returns true if the current and version alias points to the same index', () => { + expect( + versionMigrationCompleted('.current-alias', '.version-alias', { + '.current-alias': 'myindex', + '.version-alias': 'myindex', + }) + ).toBe(true); + }); + it('returns false if the current and version alias does not point to the same index', () => { + expect( + versionMigrationCompleted('.current-alias', '.version-alias', { + '.current-alias': 'myindex', + '.version-alias': 'anotherindex', + }) + ).toBe(false); + }); + it('returns false if the current alias does not exist', () => { + expect( + versionMigrationCompleted('.current-alias', '.version-alias', { + '.version-alias': 'myindex', + }) + ).toBe(false); + }); + it('returns false if the version alias does not exist', () => { + expect( + versionMigrationCompleted('.current-alias', '.version-alias', { + '.current-alias': 'myindex', + }) + ).toBe(false); + }); + it('returns false if neither the version or current alias exists', () => { + expect(versionMigrationCompleted('.current-alias', '.version-alias', {})).toBe(false); + }); +}); diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/helpers.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/helpers.ts index 5f84dc01af008..f7377401c16bf 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/helpers.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/helpers.ts @@ -68,6 +68,19 @@ export function mergeMigrationMappingPropertyHashes( }; } +/** + * If `.kibana` and the version specific aliases both exists and + * are pointing to the same index. This version's migration has already + * been completed. + */ +export function versionMigrationCompleted( + currentAlias: string, + versionAlias: string, + aliases: Record +): boolean { + return aliases[currentAlias] != null && aliases[currentAlias] === aliases[versionAlias]; +} + export function indexBelongsToLaterVersion(indexName: string, kibanaVersion: string): boolean { const version = valid(indexVersion(indexName)); return version != null ? gt(version, kibanaVersion) : false; @@ -157,16 +170,17 @@ export function getAliases( indices: FetchIndexResponse ): Either.Either< { type: 'multiple_indices_per_alias'; alias: string; indices: string[] }, - Record + Record > { - const aliases = {} as Record; + const aliases = {} as Record; for (const index of Object.getOwnPropertyNames(indices)) { for (const alias of Object.getOwnPropertyNames(indices[index].aliases || {})) { - if (aliases[alias] != null) { + const secondIndexThisAliasPointsTo = aliases[alias]; + if (secondIndexThisAliasPointsTo != null) { return Either.left({ type: 'multiple_indices_per_alias', alias, - indices: [aliases[alias], index], + indices: [secondIndexThisAliasPointsTo, index], }); } aliases[alias] = index; diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/model.test.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/model.test.ts index 67b7e40dc5aff..cb446b952e5ec 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/model.test.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/model.test.ts @@ -102,6 +102,7 @@ describe('migrations v2 model', () => { routingAllocationDisabled: 'routingAllocationDisabled', clusterShardLimitExceeded: 'clusterShardLimitExceeded', }, + waitForMigrationCompletion: false, }; describe('exponential retry delays for retryable_es_client_error', () => { @@ -222,13 +223,14 @@ describe('migrations v2 model', () => { }); describe('INIT', () => { - const initState: State = { + const initBaseState: State = { ...baseState, controlState: 'INIT', currentAlias: '.kibana', versionAlias: '.kibana_7.11.0', versionIndex: '.kibana_7.11.0_001', }; + const mappingsWithUnknownType = { properties: { disabled_saved_object_type: { @@ -244,110 +246,560 @@ describe('migrations v2 model', () => { }, } as const; - test('INIT -> OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT if .kibana is already pointing to the target index', () => { - const res: ResponseType<'INIT'> = Either.right({ - '.kibana_7.11.0_001': { - aliases: { - '.kibana': {}, - '.kibana_7.11.0': {}, + describe('if waitForMigrationCompletion=true', () => { + const initState = Object.assign({}, initBaseState, { + waitForMigrationCompletion: true, + }); + test('INIT -> OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT if .kibana is already pointing to the target index', () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_7.11.0_001': { + aliases: { + '.kibana': {}, + '.kibana_7.11.0': {}, + }, + mappings: mappingsWithUnknownType, + settings: {}, }, - mappings: mappingsWithUnknownType, - settings: {}, - }, + }); + const newState = model(initState, res); + + expect(newState.controlState).toEqual('OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT'); + // This snapshot asserts that we merge the + // migrationMappingPropertyHashes of the existing index, but we leave + // the mappings for the disabled_saved_object_type untouched. There + // might be another Kibana instance that knows about this type and + // needs these mappings in place. + expect(newState.targetIndexMappings).toMatchInlineSnapshot(` + Object { + "_meta": Object { + "migrationMappingPropertyHashes": Object { + "disabled_saved_object_type": "7997cf5a56cc02bdc9c93361bde732b0", + "new_saved_object_type": "4a11183eee21e6fbad864f7a30b39ad0", + }, + }, + "properties": Object { + "new_saved_object_type": Object { + "properties": Object { + "value": Object { + "type": "text", + }, + }, + }, + }, + } + `); + expect(newState.retryCount).toEqual(0); + expect(newState.retryDelay).toEqual(0); }); - const newState = model(initState, res); + test('INIT -> INIT when cluster routing allocation is incompatible', () => { + const res: ResponseType<'INIT'> = Either.left({ + type: 'incompatible_cluster_routing_allocation', + }); + const newState = model(initState, res) as FatalState; - expect(newState.controlState).toEqual('OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT'); - // This snapshot asserts that we merge the - // migrationMappingPropertyHashes of the existing index, but we leave - // the mappings for the disabled_saved_object_type untouched. There - // might be another Kibana instance that knows about this type and - // needs these mappings in place. - expect(newState.targetIndexMappings).toMatchInlineSnapshot(` - Object { - "_meta": Object { - "migrationMappingPropertyHashes": Object { - "disabled_saved_object_type": "7997cf5a56cc02bdc9c93361bde732b0", - "new_saved_object_type": "4a11183eee21e6fbad864f7a30b39ad0", + expect(newState.controlState).toEqual('INIT'); + expect(newState.retryCount).toEqual(1); + expect(newState.retryDelay).toEqual(2000); + expect(newState.logs[0]).toMatchInlineSnapshot(` + Object { + "level": "error", + "message": "Action failed with '[incompatible_cluster_routing_allocation] Incompatible Elasticsearch cluster settings detected. Remove the persistent and transient Elasticsearch cluster setting 'cluster.routing.allocation.enable' or set it to a value of 'all' to allow migrations to proceed. Refer to routingAllocationDisabled for more information on how to resolve the issue.'. Retrying attempt 1 in 2 seconds.", + } + `); + }); + test("INIT -> FATAL when .kibana points to newer version's index", () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_7.12.0_001': { + aliases: { + '.kibana': {}, + '.kibana_7.12.0': {}, }, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, }, - "properties": Object { - "new_saved_object_type": Object { - "properties": Object { - "value": Object { - "type": "text", + '.kibana_7.11.0_001': { + aliases: { '.kibana_7.11.0': {} }, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, + }, + }); + const newState = model(initState, res) as FatalState; + + expect(newState.controlState).toEqual('FATAL'); + expect(newState.reason).toMatchInlineSnapshot( + `"The .kibana alias is pointing to a newer version of Kibana: v7.12.0"` + ); + }); + test('INIT -> FATAL when .kibana points to multiple indices', () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_7.12.0_001': { + aliases: { + '.kibana': {}, + '.kibana_7.12.0': {}, + }, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, + }, + '.kibana_7.11.0_001': { + aliases: { '.kibana': {}, '.kibana_7.11.0': {} }, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, + }, + }); + const newState = model(initState, res) as FatalState; + + expect(newState.controlState).toEqual('FATAL'); + expect(newState.reason).toMatchInlineSnapshot( + `"The .kibana alias is pointing to multiple indices: .kibana_7.12.0_001,.kibana_7.11.0_001."` + ); + }); + test('INIT -> WAIT_FOR_MIGRATION_COMPLETION when .kibana points to an index with an invalid version', () => { + // If users tamper with our index version naming scheme we can no + // longer accurately detect a newer version. Older Kibana versions + // will have indices like `.kibana_10` and users might choose an + // invalid name when restoring from a snapshot. So we try to be + // lenient and assume it's an older index and perform a migration. + // If the tampered index belonged to a newer version the migration + // will fail when we start transforming documents. + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_7.invalid.0_001': { + aliases: { + '.kibana': {}, + '.kibana_7.12.0': {}, + }, + mappings: mappingsWithUnknownType, + settings: {}, + }, + '.kibana_7.11.0_001': { + aliases: { '.kibana_7.11.0': {} }, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, + }, + }); + const newState = model(initState, res) as WaitForYellowSourceState; + + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toBe(2000); + }); + test('INIT -> WAIT_FOR_MIGRATION_COMPLETION when migrating from a v2 migrations index (>= 7.11.0)', () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_7.11.0_001': { + aliases: { '.kibana': {}, '.kibana_7.11.0': {} }, + mappings: mappingsWithUnknownType, + settings: {}, + }, + '.kibana_3': { + aliases: {}, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, + }, + }); + const newState = model( + { + ...initState, + ...{ + kibanaVersion: '7.12.0', + versionAlias: '.kibana_7.12.0', + versionIndex: '.kibana_7.12.0_001', + }, + }, + res + ) as WaitForYellowSourceState; + + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); + }); + test('INIT -> WAIT_FOR_MIGRATION_COMPLETION when migrating from a v1 migrations index (>= 6.5 < 7.11.0)', () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_3': { + aliases: { + '.kibana': {}, + }, + mappings: mappingsWithUnknownType, + settings: {}, + }, + }); + const newState = model(initState, res) as WaitForYellowSourceState; + + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); + }); + test('INIT -> WAIT_FOR_MIGRATION_COMPLETION when migrating from a legacy index (>= 6.0.0 < 6.5)', () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana': { + aliases: {}, + mappings: mappingsWithUnknownType, + settings: {}, + }, + }); + const newState = model(initState, res); + + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); + }); + test('INIT -> WAIT_FOR_MIGRATION_COMPLETION when migrating from a custom kibana.index name (>= 6.5 < 7.11.0)', () => { + const res: ResponseType<'INIT'> = Either.right({ + 'my-saved-objects_3': { + aliases: { + 'my-saved-objects': {}, + }, + mappings: mappingsWithUnknownType, + settings: {}, + }, + }); + const newState = model( + { + ...initState, + controlState: 'INIT', + currentAlias: 'my-saved-objects', + versionAlias: 'my-saved-objects_7.11.0', + versionIndex: 'my-saved-objects_7.11.0_001', + }, + res + ) as WaitForYellowSourceState; + + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); + }); + test('INIT -> WAIT_FOR_MIGRATION_COMPLETION when migrating from a custom kibana.index v2 migrations index (>= 7.11.0)', () => { + const res: ResponseType<'INIT'> = Either.right({ + 'my-saved-objects_7.11.0': { + aliases: { + 'my-saved-objects': {}, + }, + mappings: mappingsWithUnknownType, + settings: {}, + }, + }); + const newState = model( + { + ...initState, + controlState: 'INIT', + kibanaVersion: '7.12.0', + currentAlias: 'my-saved-objects', + versionAlias: 'my-saved-objects_7.12.0', + versionIndex: 'my-saved-objects_7.12.0_001', + }, + res + ) as WaitForYellowSourceState; + + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); + }); + test('INIT -> WAIT_FOR_MIGRATION_COMPLETION when no indices/aliases exist', () => { + const res: ResponseType<'INIT'> = Either.right({}); + const newState = model(initState, res); + + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); + }); + }); + describe('if waitForMigrationCompletion=false', () => { + const initState = Object.assign({}, initBaseState, { + waitForMigrationCompletion: false, + }); + test('INIT -> OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT if .kibana is already pointing to the target index', () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_7.11.0_001': { + aliases: { + '.kibana': {}, + '.kibana_7.11.0': {}, + }, + mappings: mappingsWithUnknownType, + settings: {}, + }, + }); + const newState = model(initState, res); + + expect(newState.controlState).toEqual('OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT'); + // This snapshot asserts that we merge the + // migrationMappingPropertyHashes of the existing index, but we leave + // the mappings for the disabled_saved_object_type untouched. There + // might be another Kibana instance that knows about this type and + // needs these mappings in place. + expect(newState.targetIndexMappings).toMatchInlineSnapshot(` + Object { + "_meta": Object { + "migrationMappingPropertyHashes": Object { + "disabled_saved_object_type": "7997cf5a56cc02bdc9c93361bde732b0", + "new_saved_object_type": "4a11183eee21e6fbad864f7a30b39ad0", + }, + }, + "properties": Object { + "new_saved_object_type": Object { + "properties": Object { + "value": Object { + "type": "text", + }, }, }, }, + } + `); + expect(newState.retryCount).toEqual(0); + expect(newState.retryDelay).toEqual(0); + }); + test('INIT -> INIT when cluster routing allocation is incompatible', () => { + const res: ResponseType<'INIT'> = Either.left({ + type: 'incompatible_cluster_routing_allocation', + }); + const newState = model(initState, res) as FatalState; + + expect(newState.controlState).toEqual('INIT'); + expect(newState.retryCount).toEqual(1); + expect(newState.retryDelay).toEqual(2000); + expect(newState.logs[0]).toMatchInlineSnapshot(` + Object { + "level": "error", + "message": "Action failed with '[incompatible_cluster_routing_allocation] Incompatible Elasticsearch cluster settings detected. Remove the persistent and transient Elasticsearch cluster setting 'cluster.routing.allocation.enable' or set it to a value of 'all' to allow migrations to proceed. Refer to routingAllocationDisabled for more information on how to resolve the issue.'. Retrying attempt 1 in 2 seconds.", + } + `); + }); + test("INIT -> FATAL when .kibana points to newer version's index", () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_7.12.0_001': { + aliases: { + '.kibana': {}, + '.kibana_7.12.0': {}, + }, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, }, - } - `); - expect(newState.retryCount).toEqual(0); - expect(newState.retryDelay).toEqual(0); - }); - test('INIT -> INIT when cluster routing allocation is incompatible', () => { - const res: ResponseType<'INIT'> = Either.left({ - type: 'incompatible_cluster_routing_allocation', + '.kibana_7.11.0_001': { + aliases: { '.kibana_7.11.0': {} }, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, + }, + }); + const newState = model(initState, res) as FatalState; + + expect(newState.controlState).toEqual('FATAL'); + expect(newState.reason).toMatchInlineSnapshot( + `"The .kibana alias is pointing to a newer version of Kibana: v7.12.0"` + ); + }); + test('INIT -> FATAL when .kibana points to multiple indices', () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_7.12.0_001': { + aliases: { + '.kibana': {}, + '.kibana_7.12.0': {}, + }, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, + }, + '.kibana_7.11.0_001': { + aliases: { '.kibana': {}, '.kibana_7.11.0': {} }, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, + }, + }); + const newState = model(initState, res) as FatalState; + + expect(newState.controlState).toEqual('FATAL'); + expect(newState.reason).toMatchInlineSnapshot( + `"The .kibana alias is pointing to multiple indices: .kibana_7.12.0_001,.kibana_7.11.0_001."` + ); + }); + test('INIT -> WAIT_FOR_YELLOW_SOURCE when .kibana points to an index with an invalid version', () => { + // If users tamper with our index version naming scheme we can no + // longer accurately detect a newer version. Older Kibana versions + // will have indices like `.kibana_10` and users might choose an + // invalid name when restoring from a snapshot. So we try to be + // lenient and assume it's an older index and perform a migration. + // If the tampered index belonged to a newer version the migration + // will fail when we start transforming documents. + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_7.invalid.0_001': { + aliases: { + '.kibana': {}, + '.kibana_7.12.0': {}, + }, + mappings: mappingsWithUnknownType, + settings: {}, + }, + '.kibana_7.11.0_001': { + aliases: { '.kibana_7.11.0': {} }, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, + }, + }); + const newState = model(initState, res) as WaitForYellowSourceState; + + expect(newState.controlState).toBe('WAIT_FOR_YELLOW_SOURCE'); + expect(newState.sourceIndex.value).toBe('.kibana_7.invalid.0_001'); }); - const newState = model(initState, res) as FatalState; - expect(newState.controlState).toEqual('INIT'); - expect(newState.retryCount).toEqual(1); - expect(newState.retryDelay).toEqual(2000); - expect(newState.logs[0]).toMatchInlineSnapshot(` - Object { - "level": "error", - "message": "Action failed with '[incompatible_cluster_routing_allocation] Incompatible Elasticsearch cluster settings detected. Remove the persistent and transient Elasticsearch cluster setting 'cluster.routing.allocation.enable' or set it to a value of 'all' to allow migrations to proceed. Refer to routingAllocationDisabled for more information on how to resolve the issue.'. Retrying attempt 1 in 2 seconds.", - } - `); - }); - test("INIT -> FATAL when .kibana points to newer version's index", () => { - const res: ResponseType<'INIT'> = Either.right({ - '.kibana_7.12.0_001': { - aliases: { - '.kibana': {}, - '.kibana_7.12.0': {}, + test('INIT -> WAIT_FOR_YELLOW_SOURCE when migrating from a v2 migrations index (>= 7.11.0)', () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_7.11.0_001': { + aliases: { '.kibana': {}, '.kibana_7.11.0': {} }, + mappings: mappingsWithUnknownType, + settings: {}, }, - mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, - settings: {}, - }, - '.kibana_7.11.0_001': { - aliases: { '.kibana_7.11.0': {} }, - mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, - settings: {}, - }, + '.kibana_3': { + aliases: {}, + mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, + settings: {}, + }, + }); + const newState = model( + { + ...initState, + ...{ + kibanaVersion: '7.12.0', + versionAlias: '.kibana_7.12.0', + versionIndex: '.kibana_7.12.0_001', + }, + }, + res + ) as WaitForYellowSourceState; + + expect(newState.controlState).toBe('WAIT_FOR_YELLOW_SOURCE'); + expect(newState.sourceIndex.value).toBe('.kibana_7.11.0_001'); + expect(newState.retryCount).toEqual(0); + expect(newState.retryDelay).toEqual(0); }); - const newState = model(initState, res) as FatalState; - expect(newState.controlState).toEqual('FATAL'); - expect(newState.reason).toMatchInlineSnapshot( - `"The .kibana alias is pointing to a newer version of Kibana: v7.12.0"` - ); - }); - test('INIT -> FATAL when .kibana points to multiple indices', () => { - const res: ResponseType<'INIT'> = Either.right({ - '.kibana_7.12.0_001': { - aliases: { - '.kibana': {}, - '.kibana_7.12.0': {}, + test('INIT -> WAIT_FOR_YELLOW_SOURCE when migrating from a v1 migrations index (>= 6.5 < 7.11.0)', () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana_3': { + aliases: { + '.kibana': {}, + }, + mappings: mappingsWithUnknownType, + settings: {}, }, - mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, - settings: {}, - }, - '.kibana_7.11.0_001': { - aliases: { '.kibana': {}, '.kibana_7.11.0': {} }, - mappings: { properties: {}, _meta: { migrationMappingPropertyHashes: {} } }, - settings: {}, - }, + }); + const newState = model(initState, res) as WaitForYellowSourceState; + + expect(newState.controlState).toBe('WAIT_FOR_YELLOW_SOURCE'); + expect(newState.sourceIndex.value).toBe('.kibana_3'); + expect(newState.retryCount).toEqual(0); + expect(newState.retryDelay).toEqual(0); }); - const newState = model(initState, res) as FatalState; + test('INIT -> LEGACY_SET_WRITE_BLOCK when migrating from a legacy index (>= 6.0.0 < 6.5)', () => { + const res: ResponseType<'INIT'> = Either.right({ + '.kibana': { + aliases: {}, + mappings: mappingsWithUnknownType, + settings: {}, + }, + }); + const newState = model(initState, res); - expect(newState.controlState).toEqual('FATAL'); - expect(newState.reason).toMatchInlineSnapshot( - `"The .kibana alias is pointing to multiple indices: .kibana_7.12.0_001,.kibana_7.11.0_001."` - ); + expect(newState).toMatchObject({ + controlState: 'LEGACY_SET_WRITE_BLOCK', + sourceIndex: Option.some('.kibana_pre6.5.0_001'), + targetIndex: '.kibana_7.11.0_001', + }); + // This snapshot asserts that we disable the unknown saved object + // type. Because it's mappings are disabled, we also don't copy the + // `_meta.migrationMappingPropertyHashes` for the disabled type. + expect(newState.targetIndexMappings).toMatchInlineSnapshot(` + Object { + "_meta": Object { + "migrationMappingPropertyHashes": Object { + "new_saved_object_type": "4a11183eee21e6fbad864f7a30b39ad0", + }, + }, + "properties": Object { + "disabled_saved_object_type": Object { + "dynamic": false, + "properties": Object {}, + }, + "new_saved_object_type": Object { + "properties": Object { + "value": Object { + "type": "text", + }, + }, + }, + }, + } + `); + expect(newState.retryCount).toEqual(0); + expect(newState.retryDelay).toEqual(0); + }); + test('INIT -> WAIT_FOR_YELLOW_SOURCE when migrating from a custom kibana.index name (>= 6.5 < 7.11.0)', () => { + const res: ResponseType<'INIT'> = Either.right({ + 'my-saved-objects_3': { + aliases: { + 'my-saved-objects': {}, + }, + mappings: mappingsWithUnknownType, + settings: {}, + }, + }); + const newState = model( + { + ...baseState, + controlState: 'INIT', + currentAlias: 'my-saved-objects', + versionAlias: 'my-saved-objects_7.11.0', + versionIndex: 'my-saved-objects_7.11.0_001', + }, + res + ) as WaitForYellowSourceState; + + expect(newState.controlState).toBe('WAIT_FOR_YELLOW_SOURCE'); + expect(newState.sourceIndex.value).toBe('my-saved-objects_3'); + expect(newState.retryCount).toEqual(0); + expect(newState.retryDelay).toEqual(0); + }); + test('INIT -> WAIT_FOR_YELLOW_SOURCE when migrating from a custom kibana.index v2 migrations index (>= 7.11.0)', () => { + const res: ResponseType<'INIT'> = Either.right({ + 'my-saved-objects_7.11.0': { + aliases: { + 'my-saved-objects': {}, + }, + mappings: mappingsWithUnknownType, + settings: {}, + }, + }); + const newState = model( + { + ...baseState, + controlState: 'INIT', + kibanaVersion: '7.12.0', + currentAlias: 'my-saved-objects', + versionAlias: 'my-saved-objects_7.12.0', + versionIndex: 'my-saved-objects_7.12.0_001', + }, + res + ) as WaitForYellowSourceState; + + expect(newState.controlState).toBe('WAIT_FOR_YELLOW_SOURCE'); + expect(newState.sourceIndex.value).toBe('my-saved-objects_7.11.0'); + + expect(newState.retryCount).toEqual(0); + expect(newState.retryDelay).toEqual(0); + }); + test('INIT -> CREATE_NEW_TARGET when no indices/aliases exist', () => { + const res: ResponseType<'INIT'> = Either.right({}); + const newState = model(initState, res); + + expect(newState).toMatchObject({ + controlState: 'CREATE_NEW_TARGET', + sourceIndex: Option.none, + targetIndex: '.kibana_7.11.0_001', + }); + expect(newState.retryCount).toEqual(0); + expect(newState.retryDelay).toEqual(0); + }); }); - test('INIT -> WAIT_FOR_YELLOW_SOURCE when .kibana points to an index with an invalid version', () => { + }); + + describe('WAIT_FOR_MIGRATION_COMPLETION', () => { + const waitForMState: State = { + ...baseState, + controlState: 'WAIT_FOR_MIGRATION_COMPLETION', + currentAlias: '.kibana', + versionAlias: '.kibana_7.11.0', + versionIndex: '.kibana_7.11.0_001', + }; + + test('WAIT_FOR_MIGRATION_COMPLETION -> WAIT_FOR_MIGRATION_COMPLETION when .kibana points to an index with an invalid version', () => { // If users tamper with our index version naming scheme we can no // longer accurately detect a newer version. Older Kibana versions // will have indices like `.kibana_10` and users might choose an @@ -355,13 +807,13 @@ describe('migrations v2 model', () => { // lenient and assume it's an older index and perform a migration. // If the tampered index belonged to a newer version the migration // will fail when we start transforming documents. - const res: ResponseType<'INIT'> = Either.right({ + const res: ResponseType<'WAIT_FOR_MIGRATION_COMPLETION'> = Either.right({ '.kibana_7.invalid.0_001': { aliases: { '.kibana': {}, '.kibana_7.12.0': {}, }, - mappings: mappingsWithUnknownType, + mappings: { properties: {} }, settings: {}, }, '.kibana_7.11.0_001': { @@ -370,17 +822,16 @@ describe('migrations v2 model', () => { settings: {}, }, }); - const newState = model(initState, res) as WaitForYellowSourceState; + const newState = model(waitForMState, res) as WaitForYellowSourceState; - expect(newState.controlState).toBe('WAIT_FOR_YELLOW_SOURCE'); - expect(newState.sourceIndex.value).toBe('.kibana_7.invalid.0_001'); + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toBe(2000); }); - - test('INIT -> WAIT_FOR_YELLOW_SOURCE when migrating from a v2 migrations index (>= 7.11.0)', () => { - const res: ResponseType<'INIT'> = Either.right({ + test('WAIT_FOR_MIGRATION_COMPLETION -> WAIT_FOR_MIGRATION_COMPLETION when migrating from a v2 migrations index (>= 7.11.0)', () => { + const res: ResponseType<'WAIT_FOR_MIGRATION_COMPLETION'> = Either.right({ '.kibana_7.11.0_001': { aliases: { '.kibana': {}, '.kibana_7.11.0': {} }, - mappings: mappingsWithUnknownType, + mappings: { properties: {} }, settings: {}, }, '.kibana_3': { @@ -391,7 +842,7 @@ describe('migrations v2 model', () => { }); const newState = model( { - ...initState, + ...waitForMState, ...{ kibanaVersion: '7.12.0', versionAlias: '.kibana_7.12.0', @@ -401,86 +852,50 @@ describe('migrations v2 model', () => { res ) as WaitForYellowSourceState; - expect(newState.controlState).toBe('WAIT_FOR_YELLOW_SOURCE'); - expect(newState.sourceIndex.value).toBe('.kibana_7.11.0_001'); - expect(newState.retryCount).toEqual(0); - expect(newState.retryDelay).toEqual(0); + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); }); - - test('INIT -> WAIT_FOR_YELLOW_SOURCE when migrating from a v1 migrations index (>= 6.5 < 7.11.0)', () => { - const res: ResponseType<'INIT'> = Either.right({ + test('WAIT_FOR_MIGRATION_COMPLETION -> WAIT_FOR_MIGRATION_COMPLETION when migrating from a v1 migrations index (>= 6.5 < 7.11.0)', () => { + const res: ResponseType<'WAIT_FOR_MIGRATION_COMPLETION'> = Either.right({ '.kibana_3': { aliases: { '.kibana': {}, }, - mappings: mappingsWithUnknownType, + mappings: { properties: {} }, settings: {}, }, }); - const newState = model(initState, res) as WaitForYellowSourceState; + const newState = model(waitForMState, res) as WaitForYellowSourceState; - expect(newState.controlState).toBe('WAIT_FOR_YELLOW_SOURCE'); - expect(newState.sourceIndex.value).toBe('.kibana_3'); - expect(newState.retryCount).toEqual(0); - expect(newState.retryDelay).toEqual(0); + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); }); - test('INIT -> LEGACY_SET_WRITE_BLOCK when migrating from a legacy index (>= 6.0.0 < 6.5)', () => { - const res: ResponseType<'INIT'> = Either.right({ + test('WAIT_FOR_MIGRATION_COMPLETION -> WAIT_FOR_MIGRATION_COMPLETION when migrating from a legacy index (>= 6.0.0 < 6.5)', () => { + const res: ResponseType<'WAIT_FOR_MIGRATION_COMPLETION'> = Either.right({ '.kibana': { aliases: {}, - mappings: mappingsWithUnknownType, + mappings: { properties: {} }, settings: {}, }, }); - const newState = model(initState, res); + const newState = model(waitForMState, res); - expect(newState).toMatchObject({ - controlState: 'LEGACY_SET_WRITE_BLOCK', - sourceIndex: Option.some('.kibana_pre6.5.0_001'), - targetIndex: '.kibana_7.11.0_001', - }); - // This snapshot asserts that we disable the unknown saved object - // type. Because it's mappings are disabled, we also don't copy the - // `_meta.migrationMappingPropertyHashes` for the disabled type. - expect(newState.targetIndexMappings).toMatchInlineSnapshot(` - Object { - "_meta": Object { - "migrationMappingPropertyHashes": Object { - "new_saved_object_type": "4a11183eee21e6fbad864f7a30b39ad0", - }, - }, - "properties": Object { - "disabled_saved_object_type": Object { - "dynamic": false, - "properties": Object {}, - }, - "new_saved_object_type": Object { - "properties": Object { - "value": Object { - "type": "text", - }, - }, - }, - }, - } - `); - expect(newState.retryCount).toEqual(0); - expect(newState.retryDelay).toEqual(0); + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); }); - test('INIT -> WAIT_FOR_YELLOW_SOURCE when migrating from a custom kibana.index name (>= 6.5 < 7.11.0)', () => { - const res: ResponseType<'INIT'> = Either.right({ + test('WAIT_FOR_MIGRATION_COMPLETION -> WAIT_FOR_MIGRATION_COMPLETION when migrating from a custom kibana.index name (>= 6.5 < 7.11.0)', () => { + const res: ResponseType<'WAIT_FOR_MIGRATION_COMPLETION'> = Either.right({ 'my-saved-objects_3': { aliases: { 'my-saved-objects': {}, }, - mappings: mappingsWithUnknownType, + mappings: { properties: {} }, settings: {}, }, }); const newState = model( { - ...baseState, - controlState: 'INIT', + ...waitForMState, currentAlias: 'my-saved-objects', versionAlias: 'my-saved-objects_7.11.0', versionIndex: 'my-saved-objects_7.11.0_001', @@ -488,25 +903,22 @@ describe('migrations v2 model', () => { res ) as WaitForYellowSourceState; - expect(newState.controlState).toBe('WAIT_FOR_YELLOW_SOURCE'); - expect(newState.sourceIndex.value).toBe('my-saved-objects_3'); - expect(newState.retryCount).toEqual(0); - expect(newState.retryDelay).toEqual(0); + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); }); - test('INIT -> WAIT_FOR_YELLOW_SOURCE when migrating from a custom kibana.index v2 migrations index (>= 7.11.0)', () => { - const res: ResponseType<'INIT'> = Either.right({ + test('WAIT_FOR_MIGRATION_COMPLETION -> WAIT_FOR_MIGRATION_COMPLETION when migrating from a custom kibana.index v2 migrations index (>= 7.11.0)', () => { + const res: ResponseType<'WAIT_FOR_MIGRATION_COMPLETION'> = Either.right({ 'my-saved-objects_7.11.0': { aliases: { 'my-saved-objects': {}, }, - mappings: mappingsWithUnknownType, + mappings: { properties: {} }, settings: {}, }, }); const newState = model( { - ...baseState, - controlState: 'INIT', + ...waitForMState, kibanaVersion: '7.12.0', currentAlias: 'my-saved-objects', versionAlias: 'my-saved-objects_7.12.0', @@ -515,23 +927,31 @@ describe('migrations v2 model', () => { res ) as WaitForYellowSourceState; - expect(newState.controlState).toBe('WAIT_FOR_YELLOW_SOURCE'); - expect(newState.sourceIndex.value).toBe('my-saved-objects_7.11.0'); + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); + }); + test('WAIT_FOR_MIGRATION_COMPLETION -> WAIT_FOR_MIGRATION_COMPLETION when no indices/aliases exist', () => { + const res: ResponseType<'WAIT_FOR_MIGRATION_COMPLETION'> = Either.right({}); + const newState = model(waitForMState, res); - expect(newState.retryCount).toEqual(0); - expect(newState.retryDelay).toEqual(0); + expect(newState.controlState).toBe('WAIT_FOR_MIGRATION_COMPLETION'); + expect(newState.retryDelay).toEqual(2000); }); - test('INIT -> CREATE_NEW_TARGET when no indices/aliases exist', () => { - const res: ResponseType<'INIT'> = Either.right({}); - const newState = model(initState, res); - expect(newState).toMatchObject({ - controlState: 'CREATE_NEW_TARGET', - sourceIndex: Option.none, - targetIndex: '.kibana_7.11.0_001', + it('WAIT_FOR_MIGRATION_COMPLETION -> DONE when another instance finished the migration', () => { + const res: ResponseType<'WAIT_FOR_MIGRATION_COMPLETION'> = Either.right({ + '.kibana_7.11.0_001': { + aliases: { + '.kibana': {}, + '.kibana_7.11.0': {}, + }, + mappings: { properties: {} }, + settings: {}, + }, }); - expect(newState.retryCount).toEqual(0); - expect(newState.retryDelay).toEqual(0); + const newState = model(waitForMState, res); + + expect(newState.controlState).toEqual('DONE'); }); }); diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/model.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/model.ts index 8eca6d12c4f0a..2ff0a99d6966f 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/model.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/model/model.ts @@ -38,6 +38,7 @@ import { mergeMigrationMappingPropertyHashes, throwBadControlState, throwBadResponse, + versionMigrationCompleted, } from './helpers'; import { createBatches } from './create_batches'; import type { MigrationLog } from '../types'; @@ -98,12 +99,8 @@ export const model = (currentState: State, resW: ResponseType): const aliases = aliasesRes.right; if ( - // `.kibana` and the version specific aliases both exists and - // are pointing to the same index. This version's migration has already - // been completed. - aliases[stateP.currentAlias] != null && - aliases[stateP.versionAlias] != null && - aliases[stateP.currentAlias] === aliases[stateP.versionAlias] + // This version's migration has already been completed. + versionMigrationCompleted(stateP.currentAlias, stateP.versionAlias, aliases) ) { return { ...stateP, @@ -117,7 +114,7 @@ export const model = (currentState: State, resW: ResponseType): targetIndex: `${stateP.indexPrefix}_${stateP.kibanaVersion}_001`, targetIndexMappings: mergeMigrationMappingPropertyHashes( stateP.targetIndexMappings, - indices[aliases[stateP.currentAlias]].mappings + indices[aliases[stateP.currentAlias]!].mappings ), versionIndexReadyActions: Option.none, }; @@ -125,7 +122,7 @@ export const model = (currentState: State, resW: ResponseType): // `.kibana` is pointing to an index that belongs to a later // version of Kibana .e.g. a 7.11.0 instance found the `.kibana` alias // pointing to `.kibana_7.12.0_001` - indexBelongsToLaterVersion(aliases[stateP.currentAlias], stateP.kibanaVersion) + indexBelongsToLaterVersion(aliases[stateP.currentAlias]!, stateP.kibanaVersion) ) { return { ...stateP, @@ -136,12 +133,29 @@ export const model = (currentState: State, resW: ResponseType): aliases[stateP.currentAlias] )}`, }; + } else if ( + // Don't actively participate in this migration but wait for another instance to complete it + stateP.waitForMigrationCompletion === true + ) { + return { + ...stateP, + controlState: 'WAIT_FOR_MIGRATION_COMPLETION', + // Wait for 2s before checking again if the migration has completed + retryDelay: 2000, + logs: [ + ...stateP.logs, + { + level: 'info', + message: `Migration required. Waiting until another Kibana instance completes the migration.`, + }, + ], + }; } else if ( // If the `.kibana` alias exists aliases[stateP.currentAlias] != null ) { // The source index is the index the `.kibana` alias points to - const source = aliases[stateP.currentAlias]; + const source = aliases[stateP.currentAlias]!; return { ...stateP, controlState: 'WAIT_FOR_YELLOW_SOURCE', @@ -219,6 +233,47 @@ export const model = (currentState: State, resW: ResponseType): } else { return throwBadResponse(stateP, res); } + } else if (stateP.controlState === 'WAIT_FOR_MIGRATION_COMPLETION') { + const res = resW as ExcludeRetryableEsError>; + const indices = res.right; + const aliasesRes = getAliases(indices); + if ( + // If this version's migration has already been completed we can proceed + Either.isRight(aliasesRes) && + versionMigrationCompleted(stateP.currentAlias, stateP.versionAlias, aliasesRes.right) + ) { + return { + ...stateP, + // Proceed to 'DONE' and start serving traffic. + // Because WAIT_FOR_MIGRATION_COMPLETION can only be used by + // background-task nodes on Cloud, we can be confident that this node + // has exactly the same plugins enabled as the node that finished the + // migration. So we won't need to transform any old documents or update + // the mappings. + controlState: 'DONE', + // Source is a none because we didn't do any migration from a source + // index + sourceIndex: Option.none, + targetIndex: `${stateP.indexPrefix}_${stateP.kibanaVersion}_001`, + versionIndexReadyActions: Option.none, + }; + } else { + // When getAliases returns a left 'multiple_indices_per_alias' error or + // the migration is not yet up to date just continue waiting + return { + ...stateP, + controlState: 'WAIT_FOR_MIGRATION_COMPLETION', + // Wait for 2s before checking again if the migration has completed + retryDelay: 2000, + logs: [ + ...stateP.logs, + { + level: 'info', + message: `Migration required. Waiting until another Kibana instance completes the migration.`, + }, + ], + }; + } } else if (stateP.controlState === 'LEGACY_SET_WRITE_BLOCK') { const res = resW as ExcludeRetryableEsError>; // If the write block is successfully in place @@ -938,16 +993,22 @@ export const model = (currentState: State, resW: ResponseType): throwBadResponse(stateP, res.left); } } - } else if (stateP.controlState === 'UPDATE_TARGET_MAPPINGS') { + } else if (stateP.controlState === 'OUTDATED_DOCUMENTS_SEARCH_CLOSE_PIT') { const res = resW as ExcludeRetryableEsError>; if (Either.isRight(res)) { + const { pitId, hasTransformedDocs, ...state } = stateP; + if (hasTransformedDocs) { + return { + ...state, + controlState: 'OUTDATED_DOCUMENTS_REFRESH', + }; + } return { - ...stateP, - controlState: 'UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK', - updateTargetMappingsTaskId: res.right.taskId, + ...state, + controlState: 'UPDATE_TARGET_MAPPINGS', }; } else { - throwBadResponse(stateP, res as never); + throwBadResponse(stateP, res); } } else if (stateP.controlState === 'OUTDATED_DOCUMENTS_REFRESH') { const res = resW as ExcludeRetryableEsError>; @@ -959,22 +1020,16 @@ export const model = (currentState: State, resW: ResponseType): } else { throwBadResponse(stateP, res); } - } else if (stateP.controlState === 'OUTDATED_DOCUMENTS_SEARCH_CLOSE_PIT') { + } else if (stateP.controlState === 'UPDATE_TARGET_MAPPINGS') { const res = resW as ExcludeRetryableEsError>; if (Either.isRight(res)) { - const { pitId, hasTransformedDocs, ...state } = stateP; - if (hasTransformedDocs) { - return { - ...state, - controlState: 'OUTDATED_DOCUMENTS_REFRESH', - }; - } return { - ...state, - controlState: 'UPDATE_TARGET_MAPPINGS', + ...stateP, + controlState: 'UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK', + updateTargetMappingsTaskId: res.right.taskId, }; } else { - throwBadResponse(stateP, res); + throwBadResponse(stateP, res as never); } } else if (stateP.controlState === 'UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK') { const res = resW as ExcludeRetryableEsError>; diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/next.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/next.ts index 9ac29a3a849ba..a82cf88145996 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/next.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/next.ts @@ -40,6 +40,7 @@ import type { OutdatedDocumentsRefresh, CheckUnknownDocumentsState, CalculateExcludeFiltersState, + WaitForMigrationCompletionState, } from './state'; import type { TransformRawDocs } from './types'; import * as Actions from './actions'; @@ -60,6 +61,8 @@ export const nextActionMap = (client: ElasticsearchClient, transformRawDocs: Tra return { INIT: (state: InitState) => Actions.initAction({ client, indices: [state.currentAlias, state.versionAlias] }), + WAIT_FOR_MIGRATION_COMPLETION: (state: WaitForMigrationCompletionState) => + Actions.fetchIndices({ client, indices: [state.currentAlias, state.versionAlias] }), WAIT_FOR_YELLOW_SOURCE: (state: WaitForYellowSourceState) => Actions.waitForIndexStatus({ client, index: state.sourceIndex.value, status: 'yellow' }), CHECK_UNKNOWN_DOCUMENTS: (state: CheckUnknownDocumentsState) => diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/run_resilient_migrator.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/run_resilient_migrator.ts index 47fe92ad82c54..b94a94a715056 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/run_resilient_migrator.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/run_resilient_migrator.ts @@ -44,6 +44,7 @@ export const MIGRATION_CLIENT_OPTIONS = { maxRetries: 0, requestTimeout: 120_000 export async function runResilientMigrator({ client, kibanaVersion, + waitForMigrationCompletion, targetMappings, logger, preMigrationScript, @@ -56,6 +57,7 @@ export async function runResilientMigrator({ }: { client: ElasticsearchClient; kibanaVersion: string; + waitForMigrationCompletion: boolean; targetMappings: IndexMapping; preMigrationScript?: string; logger: Logger; @@ -68,6 +70,7 @@ export async function runResilientMigrator({ }): Promise { const initialState = createInitialState({ kibanaVersion, + waitForMigrationCompletion, targetMappings, preMigrationScript, migrationVersionPerType, diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/state.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/state.ts index eb8d2e2fbb05b..33ad01be2335b 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/state.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/state.ts @@ -149,12 +149,18 @@ export interface BaseState extends ControlState { * DocLinks for savedObjects. to reference online documentation */ readonly migrationDocLinks: DocLinks['kibanaUpgradeSavedObjects']; + readonly waitForMigrationCompletion: boolean; } export interface InitState extends BaseState { readonly controlState: 'INIT'; } +export interface WaitForMigrationCompletionState extends BaseState { + /** Wait until another instance completes the migration */ + readonly controlState: 'WAIT_FOR_MIGRATION_COMPLETION'; +} + export interface PostInitState extends BaseState { /** * The source index is the index from which the migration reads. If the @@ -430,6 +436,7 @@ export interface LegacyDeleteState extends LegacyBaseState { export type State = Readonly< | FatalState | InitState + | WaitForMigrationCompletionState | DoneState | WaitForYellowSourceState | CheckUnknownDocumentsState diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-migration-server-internal/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/BUILD.bazel index 1bb04039073b2..9dbf4e0b79d68 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/BUILD.bazel @@ -69,7 +69,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -84,6 +83,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -95,17 +102,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/package.json index 2a4723650d990..ac9a5a8191858 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-server-internal/BUILD.bazel index d071fd819314d..7bcee948e25ea 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-server-internal/BUILD.bazel @@ -67,6 +67,7 @@ TYPES_DEPS = [ "//packages/core/saved-objects/core-saved-objects-import-export-server-internal:npm_module_types", "//packages/core/usage-data/core-usage-data-base-server-internal:npm_module_types", "//packages/core/deprecations/core-deprecations-server:npm_module_types", + "//packages/core/node/core-node-server:npm_module_types", ] jsts_transpiler( @@ -90,7 +91,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -105,6 +105,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -116,17 +124,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-server-internal/package.json index cd52a32958cc9..1d0e563c9440a 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.test.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.test.ts index e906f119a6575..61978d3915a1a 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.test.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.test.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ +import { setImmediate } from 'timers/promises'; import { join } from 'path'; import loadJsonFile from 'load-json-file'; -import { setImmediate } from 'timers/promises'; import { clientProviderInstanceMock, @@ -23,6 +23,7 @@ import { ByteSizeValue } from '@kbn/config-schema'; import { REPO_ROOT } from '@kbn/utils'; import { getEnvOptions } from '@kbn/config-mocks'; import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; +import { nodeServiceMock } from '@kbn/core-node-server-mocks'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; import { httpServiceMock, httpServerMock } from '@kbn/core-http-server-mocks'; import type { SavedObjectsClientFactoryProvider } from '@kbn/core-saved-objects-server'; @@ -84,6 +85,7 @@ describe('SavedObjectsService', () => { pluginsInitialized, elasticsearch: elasticsearchServiceMock.createInternalStart(), docLinks: docLinksServiceMock.createStartContract(), + node: nodeServiceMock.createInternalStartContract(), }; }; @@ -285,6 +287,81 @@ describe('SavedObjectsService', () => { expect(KibanaMigratorMock).toHaveBeenCalledWith(expect.objectContaining({ kibanaVersion })); }); + it('calls KibanaMigrator with waitForMigrationCompletion=false for the default ui+background tasks role', async () => { + const pkg = loadJsonFile.sync(join(REPO_ROOT, 'package.json')) as RawPackageInfo; + const kibanaVersion = pkg.version; + + const coreContext = createCoreContext({ + env: Env.createDefault(REPO_ROOT, getEnvOptions(), { + ...pkg, + version: `${kibanaVersion}-beta1`, // test behavior when release has a version qualifier + }), + }); + + const soService = new SavedObjectsService(coreContext); + await soService.setup(createSetupDeps()); + const startDeps = createStartDeps(); + startDeps.node = nodeServiceMock.createInternalStartContract({ + ui: true, + backgroundTasks: true, + }); + await soService.start(startDeps); + + expect(KibanaMigratorMock).toHaveBeenCalledWith( + expect.objectContaining({ waitForMigrationCompletion: false }) + ); + }); + + it('calls KibanaMigrator with waitForMigrationCompletion=false for the ui only role', async () => { + const pkg = loadJsonFile.sync(join(REPO_ROOT, 'package.json')) as RawPackageInfo; + const kibanaVersion = pkg.version; + + const coreContext = createCoreContext({ + env: Env.createDefault(REPO_ROOT, getEnvOptions(), { + ...pkg, + version: `${kibanaVersion}-beta1`, // test behavior when release has a version qualifier + }), + }); + + const soService = new SavedObjectsService(coreContext); + await soService.setup(createSetupDeps()); + const startDeps = createStartDeps(); + startDeps.node = nodeServiceMock.createInternalStartContract({ + ui: true, + backgroundTasks: false, + }); + await soService.start(startDeps); + + expect(KibanaMigratorMock).toHaveBeenCalledWith( + expect.objectContaining({ waitForMigrationCompletion: false }) + ); + }); + + it('calls KibanaMigrator with waitForMigrationCompletion=true for the background tasks only role', async () => { + const pkg = loadJsonFile.sync(join(REPO_ROOT, 'package.json')) as RawPackageInfo; + const kibanaVersion = pkg.version; + + const coreContext = createCoreContext({ + env: Env.createDefault(REPO_ROOT, getEnvOptions(), { + ...pkg, + version: `${kibanaVersion}-beta1`, // test behavior when release has a version qualifier + }), + }); + + const soService = new SavedObjectsService(coreContext); + await soService.setup(createSetupDeps()); + const startDeps = createStartDeps(); + startDeps.node = nodeServiceMock.createInternalStartContract({ + ui: false, + backgroundTasks: true, + }); + await soService.start(startDeps); + + expect(KibanaMigratorMock).toHaveBeenCalledWith( + expect.objectContaining({ waitForMigrationCompletion: true }) + ); + }); + it('waits for all es nodes to be compatible before running migrations', async () => { expect.assertions(2); const coreContext = createCoreContext({ skipMigration: false }); diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.ts index 8036a997d0d51..9f052ff61614c 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.ts @@ -48,6 +48,7 @@ import { } from '@kbn/core-saved-objects-import-export-server-internal'; import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal'; import type { DeprecationRegistryProvider } from '@kbn/core-deprecations-server'; +import type { NodeInfo } from '@kbn/core-node-server'; import { registerRoutes } from './routes'; import { calculateStatus$ } from './status'; import { registerCoreObjectTypes } from './object_types'; @@ -85,6 +86,7 @@ export interface SavedObjectsStartDeps { elasticsearch: InternalElasticsearchServiceStart; pluginsInitialized?: boolean; docLinks: DocLinksServiceStart; + node: NodeInfo; } export class SavedObjectsService @@ -185,6 +187,7 @@ export class SavedObjectsService elasticsearch, pluginsInitialized = true, docLinks, + node, }: SavedObjectsStartDeps): Promise { if (!this.setupDeps || !this.config) { throw new Error('#setup() needs to be run first'); @@ -194,10 +197,12 @@ export class SavedObjectsService const client = elasticsearch.client; + const waitForMigrationCompletion = node.roles.backgroundTasks && !node.roles.ui; const migrator = this.createMigrator( this.config.migration, elasticsearch.client.asInternalUser, - docLinks + docLinks, + waitForMigrationCompletion ); this.migrator$.next(migrator); @@ -313,7 +318,8 @@ export class SavedObjectsService private createMigrator( soMigrationsConfig: SavedObjectsMigrationConfigType, client: ElasticsearchClient, - docLinks: DocLinksServiceStart + docLinks: DocLinksServiceStart, + waitForMigrationCompletion: boolean ): IKibanaMigrator { return new KibanaMigrator({ typeRegistry: this.typeRegistry, @@ -323,6 +329,7 @@ export class SavedObjectsService kibanaIndex, client, docLinks, + waitForMigrationCompletion, }); } diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-server-internal/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-server-internal/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-server-mocks/BUILD.bazel index 717a2bfa6087e..83fc281ab340d 100644 --- a/packages/core/saved-objects/core-saved-objects-server-mocks/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-server-mocks/BUILD.bazel @@ -78,7 +78,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -93,6 +92,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -104,17 +111,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-server-mocks/package.json index 1bbda68c5d8e4..9057e65e2b314 100644 --- a/packages/core/saved-objects/core-saved-objects-server-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-server-mocks/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/saved-objects/core-saved-objects-server-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-server-mocks/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-server/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-server/BUILD.bazel index 2237defc1b11d..98b1470fee9d7 100644 --- a/packages/core/saved-objects/core-saved-objects-server/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-server/BUILD.bazel @@ -71,7 +71,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -85,6 +84,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -96,17 +103,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-server/package.json b/packages/core/saved-objects/core-saved-objects-server/package.json index 566ccc3ad49cb..1cfa72bf9cee7 100644 --- a/packages/core/saved-objects/core-saved-objects-server/package.json +++ b/packages/core/saved-objects/core-saved-objects-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-server/tsconfig.json b/packages/core/saved-objects/core-saved-objects-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/saved-objects/core-saved-objects-server/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel index 9dca62c268a06..ae246f3976c45 100644 --- a/packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel @@ -71,7 +71,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -85,6 +84,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -96,17 +103,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/package.json b/packages/core/saved-objects/core-saved-objects-utils-server/package.json index eb223e7f49ebb..28293054578d7 100644 --- a/packages/core/saved-objects/core-saved-objects-utils-server/package.json +++ b/packages/core/saved-objects/core-saved-objects-utils-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json b/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/status/core-status-common-internal/BUILD.bazel b/packages/core/status/core-status-common-internal/BUILD.bazel index db1d2ac2b6278..10c02ceed52f5 100644 --- a/packages/core/status/core-status-common-internal/BUILD.bazel +++ b/packages/core/status/core-status-common-internal/BUILD.bazel @@ -74,7 +74,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -88,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/status/core-status-common-internal/package.json b/packages/core/status/core-status-common-internal/package.json index 7d101cfc7c766..7d5bbf52425a2 100644 --- a/packages/core/status/core-status-common-internal/package.json +++ b/packages/core/status/core-status-common-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/status/core-status-common-internal/tsconfig.json b/packages/core/status/core-status-common-internal/tsconfig.json index 26b4c7aca3a67..741519055e986 100644 --- a/packages/core/status/core-status-common-internal/tsconfig.json +++ b/packages/core/status/core-status-common-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/status/core-status-common/BUILD.bazel b/packages/core/status/core-status-common/BUILD.bazel index f13519217c685..a488a5999df06 100644 --- a/packages/core/status/core-status-common/BUILD.bazel +++ b/packages/core/status/core-status-common/BUILD.bazel @@ -75,7 +75,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -89,6 +88,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -100,17 +107,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/status/core-status-common/package.json b/packages/core/status/core-status-common/package.json index 19a21ce0125ec..0c32405177b40 100644 --- a/packages/core/status/core-status-common/package.json +++ b/packages/core/status/core-status-common/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/status/core-status-common/tsconfig.json b/packages/core/status/core-status-common/tsconfig.json index 26b4c7aca3a67..741519055e986 100644 --- a/packages/core/status/core-status-common/tsconfig.json +++ b/packages/core/status/core-status-common/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/status/core-status-server-internal/BUILD.bazel b/packages/core/status/core-status-server-internal/BUILD.bazel index 7b199378c4881..2e15439eee3d8 100644 --- a/packages/core/status/core-status-server-internal/BUILD.bazel +++ b/packages/core/status/core-status-server-internal/BUILD.bazel @@ -93,7 +93,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -107,6 +106,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -118,17 +125,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/status/core-status-server-internal/package.json b/packages/core/status/core-status-server-internal/package.json index 495d8c56d3815..0c20231606015 100644 --- a/packages/core/status/core-status-server-internal/package.json +++ b/packages/core/status/core-status-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/status/core-status-server-internal/tsconfig.json b/packages/core/status/core-status-server-internal/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/status/core-status-server-internal/tsconfig.json +++ b/packages/core/status/core-status-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/status/core-status-server-mocks/BUILD.bazel b/packages/core/status/core-status-server-mocks/BUILD.bazel index 54472c706546b..ba64513644814 100644 --- a/packages/core/status/core-status-server-mocks/BUILD.bazel +++ b/packages/core/status/core-status-server-mocks/BUILD.bazel @@ -69,7 +69,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -83,6 +82,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -94,17 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/status/core-status-server-mocks/package.json b/packages/core/status/core-status-server-mocks/package.json index 406cc5eae71aa..666843aad8947 100644 --- a/packages/core/status/core-status-server-mocks/package.json +++ b/packages/core/status/core-status-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/status/core-status-server-mocks/tsconfig.json b/packages/core/status/core-status-server-mocks/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/status/core-status-server-mocks/tsconfig.json +++ b/packages/core/status/core-status-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/status/core-status-server/BUILD.bazel b/packages/core/status/core-status-server/BUILD.bazel index e48b21c23dc2f..d9cf0a216956d 100644 --- a/packages/core/status/core-status-server/BUILD.bazel +++ b/packages/core/status/core-status-server/BUILD.bazel @@ -67,7 +67,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -81,6 +80,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -92,17 +99,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/status/core-status-server/package.json b/packages/core/status/core-status-server/package.json index 93dd8920d03a7..95e42e16f8096 100644 --- a/packages/core/status/core-status-server/package.json +++ b/packages/core/status/core-status-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/status/core-status-server/tsconfig.json b/packages/core/status/core-status-server/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/status/core-status-server/tsconfig.json +++ b/packages/core/status/core-status-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel index 141c97a65972c..72af0cdf54522 100644 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel +++ b/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel @@ -69,7 +69,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -83,6 +82,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -94,17 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/package.json b/packages/core/test-helpers/core-test-helpers-deprecations-getters/package.json index 6a1a7f90ea344..37bfe7ddbf750 100644 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/package.json +++ b/packages/core/test-helpers/core-test-helpers-deprecations-getters/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/tsconfig.json b/packages/core/test-helpers/core-test-helpers-deprecations-getters/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/tsconfig.json +++ b/packages/core/test-helpers/core-test-helpers-deprecations-getters/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/test-helpers/core-test-helpers-http-setup-browser/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-http-setup-browser/BUILD.bazel index bc700b4287d21..4161d62c3a056 100644 --- a/packages/core/test-helpers/core-test-helpers-http-setup-browser/BUILD.bazel +++ b/packages/core/test-helpers/core-test-helpers-http-setup-browser/BUILD.bazel @@ -79,7 +79,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -93,6 +92,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -104,17 +111,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/test-helpers/core-test-helpers-http-setup-browser/package.json b/packages/core/test-helpers/core-test-helpers-http-setup-browser/package.json index 608f8b82af43d..813f6050c044c 100644 --- a/packages/core/test-helpers/core-test-helpers-http-setup-browser/package.json +++ b/packages/core/test-helpers/core-test-helpers-http-setup-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/test-helpers/core-test-helpers-http-setup-browser/tsconfig.json b/packages/core/test-helpers/core-test-helpers-http-setup-browser/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/test-helpers/core-test-helpers-http-setup-browser/tsconfig.json +++ b/packages/core/test-helpers/core-test-helpers-http-setup-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/test-helpers/core-test-helpers-so-type-serializer/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-so-type-serializer/BUILD.bazel index 714250a907fb4..4f9f25dd77077 100644 --- a/packages/core/test-helpers/core-test-helpers-so-type-serializer/BUILD.bazel +++ b/packages/core/test-helpers/core-test-helpers-so-type-serializer/BUILD.bazel @@ -70,7 +70,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -84,6 +83,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -95,17 +102,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/test-helpers/core-test-helpers-so-type-serializer/package.json b/packages/core/test-helpers/core-test-helpers-so-type-serializer/package.json index 95de844e70ed9..2c0288ec01238 100644 --- a/packages/core/test-helpers/core-test-helpers-so-type-serializer/package.json +++ b/packages/core/test-helpers/core-test-helpers-so-type-serializer/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/test-helpers/core-test-helpers-so-type-serializer/tsconfig.json b/packages/core/test-helpers/core-test-helpers-so-type-serializer/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/test-helpers/core-test-helpers-so-type-serializer/tsconfig.json +++ b/packages/core/test-helpers/core-test-helpers-so-type-serializer/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/test-helpers/core-test-helpers-test-utils/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-test-utils/BUILD.bazel index 9338058a06c7c..19fda628add70 100644 --- a/packages/core/test-helpers/core-test-helpers-test-utils/BUILD.bazel +++ b/packages/core/test-helpers/core-test-helpers-test-utils/BUILD.bazel @@ -85,7 +85,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -99,6 +98,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -110,17 +117,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/test-helpers/core-test-helpers-test-utils/package.json b/packages/core/test-helpers/core-test-helpers-test-utils/package.json index cae81416edded..e812501e0ff73 100644 --- a/packages/core/test-helpers/core-test-helpers-test-utils/package.json +++ b/packages/core/test-helpers/core-test-helpers-test-utils/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/test-helpers/core-test-helpers-test-utils/tsconfig.json b/packages/core/test-helpers/core-test-helpers-test-utils/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/test-helpers/core-test-helpers-test-utils/tsconfig.json +++ b/packages/core/test-helpers/core-test-helpers-test-utils/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/theme/core-theme-browser-internal/BUILD.bazel b/packages/core/theme/core-theme-browser-internal/BUILD.bazel index d129c3774a1fe..c149e0b9e0695 100644 --- a/packages/core/theme/core-theme-browser-internal/BUILD.bazel +++ b/packages/core/theme/core-theme-browser-internal/BUILD.bazel @@ -86,7 +86,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -100,6 +99,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -111,17 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/theme/core-theme-browser-internal/package.json b/packages/core/theme/core-theme-browser-internal/package.json index bca678f03158a..9a5bf644a384e 100644 --- a/packages/core/theme/core-theme-browser-internal/package.json +++ b/packages/core/theme/core-theme-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/theme/core-theme-browser-internal/tsconfig.json b/packages/core/theme/core-theme-browser-internal/tsconfig.json index 9f2708fb14528..c561d9f220124 100644 --- a/packages/core/theme/core-theme-browser-internal/tsconfig.json +++ b/packages/core/theme/core-theme-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/theme/core-theme-browser-mocks/BUILD.bazel b/packages/core/theme/core-theme-browser-mocks/BUILD.bazel index aeb99fe3ad442..d67987e887b02 100644 --- a/packages/core/theme/core-theme-browser-mocks/BUILD.bazel +++ b/packages/core/theme/core-theme-browser-mocks/BUILD.bazel @@ -76,7 +76,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/theme/core-theme-browser-mocks/package.json b/packages/core/theme/core-theme-browser-mocks/package.json index afe7068bec5ca..d90fe901d7969 100644 --- a/packages/core/theme/core-theme-browser-mocks/package.json +++ b/packages/core/theme/core-theme-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/theme/core-theme-browser-mocks/tsconfig.json b/packages/core/theme/core-theme-browser-mocks/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/core/theme/core-theme-browser-mocks/tsconfig.json +++ b/packages/core/theme/core-theme-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/theme/core-theme-browser/BUILD.bazel b/packages/core/theme/core-theme-browser/BUILD.bazel index d8ddc008526f2..bf1b34b975a3a 100644 --- a/packages/core/theme/core-theme-browser/BUILD.bazel +++ b/packages/core/theme/core-theme-browser/BUILD.bazel @@ -72,7 +72,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -86,6 +85,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -97,17 +104,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/theme/core-theme-browser/package.json b/packages/core/theme/core-theme-browser/package.json index dff1d13070158..4f21a8f07883e 100644 --- a/packages/core/theme/core-theme-browser/package.json +++ b/packages/core/theme/core-theme-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/theme/core-theme-browser/tsconfig.json b/packages/core/theme/core-theme-browser/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/theme/core-theme-browser/tsconfig.json +++ b/packages/core/theme/core-theme-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/ui-settings/core-ui-settings-browser-internal/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-browser-internal/BUILD.bazel index 183cb5bd02c37..8407c14febccf 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-internal/BUILD.bazel +++ b/packages/core/ui-settings/core-ui-settings-browser-internal/BUILD.bazel @@ -79,7 +79,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -93,6 +92,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -104,17 +111,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/ui-settings/core-ui-settings-browser-internal/package.json b/packages/core/ui-settings/core-ui-settings-browser-internal/package.json index 5e2b66bbc89bd..496fc4fb73861 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-internal/package.json +++ b/packages/core/ui-settings/core-ui-settings-browser-internal/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/ui-settings/core-ui-settings-browser-internal/tsconfig.json b/packages/core/ui-settings/core-ui-settings-browser-internal/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-internal/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-browser-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/ui-settings/core-ui-settings-browser-mocks/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-browser-mocks/BUILD.bazel index d4cc743003475..944128daf6dc4 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-mocks/BUILD.bazel +++ b/packages/core/ui-settings/core-ui-settings-browser-mocks/BUILD.bazel @@ -76,7 +76,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -90,6 +89,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -101,17 +108,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/ui-settings/core-ui-settings-browser-mocks/package.json b/packages/core/ui-settings/core-ui-settings-browser-mocks/package.json index 574769c8fcca5..9f3010fa6d923 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-mocks/package.json +++ b/packages/core/ui-settings/core-ui-settings-browser-mocks/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/ui-settings/core-ui-settings-browser-mocks/tsconfig.json b/packages/core/ui-settings/core-ui-settings-browser-mocks/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-mocks/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-browser-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/ui-settings/core-ui-settings-browser/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-browser/BUILD.bazel index 16de7303b7d5c..0b46af92d86e3 100644 --- a/packages/core/ui-settings/core-ui-settings-browser/BUILD.bazel +++ b/packages/core/ui-settings/core-ui-settings-browser/BUILD.bazel @@ -74,7 +74,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -88,6 +87,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -99,17 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/ui-settings/core-ui-settings-browser/package.json b/packages/core/ui-settings/core-ui-settings-browser/package.json index a98b162fd60e7..0d4798f84d103 100644 --- a/packages/core/ui-settings/core-ui-settings-browser/package.json +++ b/packages/core/ui-settings/core-ui-settings-browser/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/ui-settings/core-ui-settings-browser/tsconfig.json b/packages/core/ui-settings/core-ui-settings-browser/tsconfig.json index fc8aa85fbac2b..3faa31fe437a8 100644 --- a/packages/core/ui-settings/core-ui-settings-browser/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-browser/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/core/ui-settings/core-ui-settings-common/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-common/BUILD.bazel index 5a5789757febe..c88e3142602d3 100644 --- a/packages/core/ui-settings/core-ui-settings-common/BUILD.bazel +++ b/packages/core/ui-settings/core-ui-settings-common/BUILD.bazel @@ -73,7 +73,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -87,6 +86,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -98,17 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/ui-settings/core-ui-settings-common/package.json b/packages/core/ui-settings/core-ui-settings-common/package.json index b5ce3280dd343..12da969fe70f7 100644 --- a/packages/core/ui-settings/core-ui-settings-common/package.json +++ b/packages/core/ui-settings/core-ui-settings-common/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/ui-settings/core-ui-settings-common/tsconfig.json b/packages/core/ui-settings/core-ui-settings-common/tsconfig.json index 49e920b0a461a..ef521586433c9 100644 --- a/packages/core/ui-settings/core-ui-settings-common/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-common/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-server-internal/BUILD.bazel index ae77747b313e3..c20eb3dc87c95 100644 --- a/packages/core/ui-settings/core-ui-settings-server-internal/BUILD.bazel +++ b/packages/core/ui-settings/core-ui-settings-server-internal/BUILD.bazel @@ -88,7 +88,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -102,6 +101,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -113,17 +120,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/package.json b/packages/core/ui-settings/core-ui-settings-server-internal/package.json index 519392b438efb..04b1646e4a86a 100644 --- a/packages/core/ui-settings/core-ui-settings-server-internal/package.json +++ b/packages/core/ui-settings/core-ui-settings-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/src/cache.test.ts b/packages/core/ui-settings/core-ui-settings-server-internal/src/cache.test.ts index f4829d33dd714..06a91ce079e60 100644 --- a/packages/core/ui-settings/core-ui-settings-server-internal/src/cache.test.ts +++ b/packages/core/ui-settings/core-ui-settings-server-internal/src/cache.test.ts @@ -10,7 +10,7 @@ import { Cache } from './cache'; describe('Cache', () => { beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterEach(() => { diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/src/ui_settings_client.test.ts b/packages/core/ui-settings/core-ui-settings-server-internal/src/ui_settings_client.test.ts index 0467897d2fde6..87a43026b6149 100644 --- a/packages/core/ui-settings/core-ui-settings-server-internal/src/ui_settings_client.test.ts +++ b/packages/core/ui-settings/core-ui-settings-server-internal/src/ui_settings_client.test.ts @@ -707,7 +707,7 @@ describe('ui settings', () => { describe('caching', () => { describe('read operations cache user config', () => { beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterEach(() => { diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/tsconfig.json b/packages/core/ui-settings/core-ui-settings-server-internal/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/ui-settings/core-ui-settings-server-internal/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/ui-settings/core-ui-settings-server-mocks/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-server-mocks/BUILD.bazel index 332b7e19f9cf3..8b016335d66e4 100644 --- a/packages/core/ui-settings/core-ui-settings-server-mocks/BUILD.bazel +++ b/packages/core/ui-settings/core-ui-settings-server-mocks/BUILD.bazel @@ -66,7 +66,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -80,6 +79,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -91,17 +98,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/ui-settings/core-ui-settings-server-mocks/package.json b/packages/core/ui-settings/core-ui-settings-server-mocks/package.json index 1984eb8ec5d61..c22f7b69954bf 100644 --- a/packages/core/ui-settings/core-ui-settings-server-mocks/package.json +++ b/packages/core/ui-settings/core-ui-settings-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/ui-settings/core-ui-settings-server-mocks/tsconfig.json b/packages/core/ui-settings/core-ui-settings-server-mocks/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/ui-settings/core-ui-settings-server-mocks/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/ui-settings/core-ui-settings-server/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-server/BUILD.bazel index c28f92633e949..0cf8fb2d3119b 100644 --- a/packages/core/ui-settings/core-ui-settings-server/BUILD.bazel +++ b/packages/core/ui-settings/core-ui-settings-server/BUILD.bazel @@ -66,7 +66,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -80,6 +79,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -91,17 +98,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/ui-settings/core-ui-settings-server/package.json b/packages/core/ui-settings/core-ui-settings-server/package.json index 930339f0db50a..4f4e046e69801 100644 --- a/packages/core/ui-settings/core-ui-settings-server/package.json +++ b/packages/core/ui-settings/core-ui-settings-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/ui-settings/core-ui-settings-server/tsconfig.json b/packages/core/ui-settings/core-ui-settings-server/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/ui-settings/core-ui-settings-server/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-server/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/usage-data/core-usage-data-base-server-internal/BUILD.bazel b/packages/core/usage-data/core-usage-data-base-server-internal/BUILD.bazel index 62219c02bc49e..d2412fae38af9 100644 --- a/packages/core/usage-data/core-usage-data-base-server-internal/BUILD.bazel +++ b/packages/core/usage-data/core-usage-data-base-server-internal/BUILD.bazel @@ -67,7 +67,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -82,6 +81,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -93,17 +100,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/usage-data/core-usage-data-base-server-internal/package.json b/packages/core/usage-data/core-usage-data-base-server-internal/package.json index 837a01d45b384..3bac6ca65b835 100644 --- a/packages/core/usage-data/core-usage-data-base-server-internal/package.json +++ b/packages/core/usage-data/core-usage-data-base-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/usage-data/core-usage-data-base-server-internal/tsconfig.json b/packages/core/usage-data/core-usage-data-base-server-internal/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/usage-data/core-usage-data-base-server-internal/tsconfig.json +++ b/packages/core/usage-data/core-usage-data-base-server-internal/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/usage-data/core-usage-data-server-internal/BUILD.bazel b/packages/core/usage-data/core-usage-data-server-internal/BUILD.bazel index e8ffc9ba8ff47..c677b2c16ecee 100644 --- a/packages/core/usage-data/core-usage-data-server-internal/BUILD.bazel +++ b/packages/core/usage-data/core-usage-data-server-internal/BUILD.bazel @@ -89,7 +89,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -103,6 +102,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -114,17 +121,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/usage-data/core-usage-data-server-internal/package.json b/packages/core/usage-data/core-usage-data-server-internal/package.json index ed9ef4ee6838f..3138c86ae3baa 100644 --- a/packages/core/usage-data/core-usage-data-server-internal/package.json +++ b/packages/core/usage-data/core-usage-data-server-internal/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/usage-data/core-usage-data-server-internal/tsconfig.json b/packages/core/usage-data/core-usage-data-server-internal/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/usage-data/core-usage-data-server-internal/tsconfig.json +++ b/packages/core/usage-data/core-usage-data-server-internal/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/usage-data/core-usage-data-server-mocks/BUILD.bazel b/packages/core/usage-data/core-usage-data-server-mocks/BUILD.bazel index d6c5c460ae9af..d75bd1efb5724 100644 --- a/packages/core/usage-data/core-usage-data-server-mocks/BUILD.bazel +++ b/packages/core/usage-data/core-usage-data-server-mocks/BUILD.bazel @@ -69,7 +69,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -83,6 +82,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -94,17 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/usage-data/core-usage-data-server-mocks/package.json b/packages/core/usage-data/core-usage-data-server-mocks/package.json index 508797d341cff..90dca09cf1471 100644 --- a/packages/core/usage-data/core-usage-data-server-mocks/package.json +++ b/packages/core/usage-data/core-usage-data-server-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/usage-data/core-usage-data-server-mocks/tsconfig.json b/packages/core/usage-data/core-usage-data-server-mocks/tsconfig.json index 71bb40fe57f3f..4582562d6c9bb 100644 --- a/packages/core/usage-data/core-usage-data-server-mocks/tsconfig.json +++ b/packages/core/usage-data/core-usage-data-server-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/core/usage-data/core-usage-data-server/BUILD.bazel b/packages/core/usage-data/core-usage-data-server/BUILD.bazel index 1e349174279ef..2133607f6aa8c 100644 --- a/packages/core/usage-data/core-usage-data-server/BUILD.bazel +++ b/packages/core/usage-data/core-usage-data-server/BUILD.bazel @@ -64,7 +64,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -79,6 +78,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -90,17 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/core/usage-data/core-usage-data-server/package.json b/packages/core/usage-data/core-usage-data-server/package.json index e271128d733c7..5f6f8f77a93a8 100644 --- a/packages/core/usage-data/core-usage-data-server/package.json +++ b/packages/core/usage-data/core-usage-data-server/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/core/usage-data/core-usage-data-server/tsconfig.json b/packages/core/usage-data/core-usage-data-server/tsconfig.json index ff8b3da96b4db..4582562d6c9bb 100644 --- a/packages/core/usage-data/core-usage-data-server/tsconfig.json +++ b/packages/core/usage-data/core-usage-data-server/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/home/sample_data_card/BUILD.bazel b/packages/home/sample_data_card/BUILD.bazel index 0bdc2557abd6d..6697c6c0cefb4 100644 --- a/packages/home/sample_data_card/BUILD.bazel +++ b/packages/home/sample_data_card/BUILD.bazel @@ -126,6 +126,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -137,17 +145,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/home/sample_data_card/package.json b/packages/home/sample_data_card/package.json index 6eb1711b5052e..35d0f1b22ef39 100644 --- a/packages/home/sample_data_card/package.json +++ b/packages/home/sample_data_card/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/home/sample_data_card/tsconfig.json b/packages/home/sample_data_card/tsconfig.json index 9fdd594692a28..158e1387bb883 100644 --- a/packages/home/sample_data_card/tsconfig.json +++ b/packages/home/sample_data_card/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/home/sample_data_tab/BUILD.bazel b/packages/home/sample_data_tab/BUILD.bazel index 97cef4c460d1a..54e0ea0c82c6f 100644 --- a/packages/home/sample_data_tab/BUILD.bazel +++ b/packages/home/sample_data_tab/BUILD.bazel @@ -107,7 +107,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -121,6 +120,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -132,17 +139,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/home/sample_data_tab/package.json b/packages/home/sample_data_tab/package.json index 15c15f137361a..beb7a99f8aa6c 100644 --- a/packages/home/sample_data_tab/package.json +++ b/packages/home/sample_data_tab/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/home/sample_data_tab/tsconfig.json b/packages/home/sample_data_tab/tsconfig.json index eea57a49d44d4..158e1387bb883 100644 --- a/packages/home/sample_data_tab/tsconfig.json +++ b/packages/home/sample_data_tab/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/home/sample_data_types/tsconfig.json b/packages/home/sample_data_types/tsconfig.json index 6f94a41f6eb89..2ff5d03a149c7 100644 --- a/packages/home/sample_data_types/tsconfig.json +++ b/packages/home/sample_data_types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/kbn-ace/BUILD.bazel b/packages/kbn-ace/BUILD.bazel index 91900928a6bca..87b2e9f57354d 100644 --- a/packages/kbn-ace/BUILD.bazel +++ b/packages/kbn-ace/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-ace" +PKG_DIRNAME = "kbn-ace" PKG_REQUIRE_NAME = "@kbn/ace" SOURCE_FILES = glob( @@ -90,25 +90,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -119,19 +124,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ace/package.json b/packages/kbn-ace/package.json index ce8e83e0686ef..da9587a86cb16 100644 --- a/packages/kbn-ace/package.json +++ b/packages/kbn-ace/package.json @@ -4,5 +4,6 @@ "private": true, "browser": "./target_web/index.js", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-ace/tsconfig.json b/packages/kbn-ace/tsconfig.json index 42de0516bfae6..1cf2f1e9ac9a0 100644 --- a/packages/kbn-ace/tsconfig.json +++ b/packages/kbn-ace/tsconfig.json @@ -1,10 +1,10 @@ { "extends": "../../tsconfig.bazel.json", "compilerOptions": { + "allowJs": false, "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "stripInternal": true, "types": ["node"] }, diff --git a/packages/kbn-alerts/BUILD.bazel b/packages/kbn-alerts/BUILD.bazel index 86a23118abfe0..74f684fc6d458 100644 --- a/packages/kbn-alerts/BUILD.bazel +++ b/packages/kbn-alerts/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-alerts" +PKG_DIRNAME = "kbn-alerts" PKG_REQUIRE_NAME = "@kbn/alerts" SOURCE_FILES = glob( @@ -82,25 +82,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -111,19 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-alerts/package.json b/packages/kbn-alerts/package.json index 13b60ad9fa072..cc4285cfc50a8 100644 --- a/packages/kbn-alerts/package.json +++ b/packages/kbn-alerts/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-alerts/tsconfig.json b/packages/kbn-alerts/tsconfig.json index ac9ae0ffc0247..fccc6563c0e73 100644 --- a/packages/kbn-alerts/tsconfig.json +++ b/packages/kbn-alerts/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": ["jest", "node"] diff --git a/packages/kbn-ambient-storybook-types/tsconfig.json b/packages/kbn-ambient-storybook-types/tsconfig.json index 68ffb14bbba9b..c0217a1c1a013 100644 --- a/packages/kbn-ambient-storybook-types/tsconfig.json +++ b/packages/kbn-ambient-storybook-types/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": "src", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/kbn-ambient-ui-types/tsconfig.json b/packages/kbn-ambient-ui-types/tsconfig.json index ad9af24958c59..6904725bb1b26 100644 --- a/packages/kbn-ambient-ui-types/tsconfig.json +++ b/packages/kbn-ambient-ui-types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "@types/react", ] diff --git a/packages/kbn-analytics/BUILD.bazel b/packages/kbn-analytics/BUILD.bazel index 4c9065c836068..d9add8b38c069 100644 --- a/packages/kbn-analytics/BUILD.bazel +++ b/packages/kbn-analytics/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-analytics" +PKG_DIRNAME = "kbn-analytics" PKG_REQUIRE_NAME = "@kbn/analytics" SOURCE_FILES = glob( @@ -85,25 +85,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -114,19 +119,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-analytics/package.json b/packages/kbn-analytics/package.json index afe101b731cc3..57216d4e563db 100644 --- a/packages/kbn-analytics/package.json +++ b/packages/kbn-analytics/package.json @@ -6,5 +6,6 @@ "main": "target_node/index.js", "browser": "target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-analytics/tsconfig.json b/packages/kbn-analytics/tsconfig.json index bbc85272398c5..c1b62ffb7d142 100644 --- a/packages/kbn-analytics/tsconfig.json +++ b/packages/kbn-analytics/tsconfig.json @@ -2,11 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "isolatedModules": true, - "outDir": "./target_types", - "stripInternal": true, + "outDir": "target_types", "types": [ "node" ] diff --git a/packages/kbn-apm-config-loader/BUILD.bazel b/packages/kbn-apm-config-loader/BUILD.bazel index 8d83162d204bc..fd51d0719bac6 100644 --- a/packages/kbn-apm-config-loader/BUILD.bazel +++ b/packages/kbn-apm-config-loader/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-apm-config-loader" +PKG_DIRNAME = "kbn-apm-config-loader" PKG_REQUIRE_NAME = "@kbn/apm-config-loader" SOURCE_FILES = glob( @@ -75,25 +75,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -104,19 +109,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-apm-config-loader/index.ts b/packages/kbn-apm-config-loader/index.ts index e2027b2e12c7c..24f46c01b4b3f 100644 --- a/packages/kbn-apm-config-loader/index.ts +++ b/packages/kbn-apm-config-loader/index.ts @@ -10,3 +10,4 @@ export { getConfiguration } from './src/config_loader'; export { initApm } from './src/init_apm'; export { shouldInstrumentClient } from './src/rum_agent_configuration'; export type { ApmConfiguration } from './src/config'; +export { apmConfigSchema } from './src/apm_config'; diff --git a/packages/kbn-apm-config-loader/package.json b/packages/kbn-apm-config-loader/package.json index d973d54f41065..30d7f3780f83e 100644 --- a/packages/kbn-apm-config-loader/package.json +++ b/packages/kbn-apm-config-loader/package.json @@ -3,5 +3,6 @@ "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-apm-config-loader/src/apm_config.ts b/packages/kbn-apm-config-loader/src/apm_config.ts new file mode 100644 index 0000000000000..2127d612d583b --- /dev/null +++ b/packages/kbn-apm-config-loader/src/apm_config.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; + +export const apmConfigSchema = schema.object( + { + active: schema.maybe(schema.boolean()), + serverUrl: schema.maybe(schema.uri()), + secretToken: schema.maybe(schema.string()), + globalLabels: schema.object({}, { unknowns: 'allow' }), + }, + { unknowns: 'allow' } +); diff --git a/packages/kbn-apm-config-loader/tsconfig.json b/packages/kbn-apm-config-loader/tsconfig.json index e6381fc4edf9f..57c1dd1c94e0f 100644 --- a/packages/kbn-apm-config-loader/tsconfig.json +++ b/packages/kbn-apm-config-loader/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": false, + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-apm-synthtrace/BUILD.bazel b/packages/kbn-apm-synthtrace/BUILD.bazel index 2f87b86044915..2e7b4ac1f4562 100644 --- a/packages/kbn-apm-synthtrace/BUILD.bazel +++ b/packages/kbn-apm-synthtrace/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-apm-synthtrace" +PKG_DIRNAME = "kbn-apm-synthtrace" PKG_REQUIRE_NAME = "@kbn/apm-synthtrace" SOURCE_FILES = glob( @@ -61,6 +61,7 @@ TYPES_DEPS = [ "@npm//p-limit", "@npm//@types/node-fetch", "@npm//@types/semver", + "@npm//@types/yargs", ] jsts_transpiler( @@ -84,7 +85,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -92,18 +92,24 @@ ts_project( ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -114,19 +120,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-apm-synthtrace/index.ts b/packages/kbn-apm-synthtrace/index.ts index 170c5ed6206c1..1ff59bdd7d16a 100644 --- a/packages/kbn-apm-synthtrace/index.ts +++ b/packages/kbn-apm-synthtrace/index.ts @@ -8,6 +8,7 @@ export { timerange } from './src/lib/timerange'; export { apm } from './src/lib/apm'; +export { dedot } from './src/lib/utils/dedot'; export { stackMonitoring } from './src/lib/stack_monitoring'; export { observer } from './src/lib/agent_config'; export { cleanWriteTargets } from './src/lib/utils/clean_write_targets'; diff --git a/packages/kbn-apm-synthtrace/package.json b/packages/kbn-apm-synthtrace/package.json index 17d4c9b10b75b..935eb518639db 100644 --- a/packages/kbn-apm-synthtrace/package.json +++ b/packages/kbn-apm-synthtrace/package.json @@ -7,5 +7,6 @@ "synthtrace": "./bin/synthtrace" }, "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-apm-synthtrace/src/lib/apm/apm_error.ts b/packages/kbn-apm-synthtrace/src/lib/apm/apm_error.ts index 334c0f296851d..216397f1e1b40 100644 --- a/packages/kbn-apm-synthtrace/src/lib/apm/apm_error.ts +++ b/packages/kbn-apm-synthtrace/src/lib/apm/apm_error.ts @@ -27,4 +27,10 @@ export class ApmError extends Serializable { ); return [data]; } + + timestamp(value: number) { + const ret = super.timestamp(value); + this.fields['timestamp.us'] = value * 1000; + return ret; + } } diff --git a/packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts b/packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts index 07379b2a3002d..e9b89fa4739d0 100644 --- a/packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts +++ b/packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts @@ -57,6 +57,7 @@ export type ApmFields = Fields & 'error.grouping_name': string; 'error.grouping_key': string; 'host.name': string; + 'host.architecture': string; 'host.hostname': string; 'http.request.method': string; 'http.response.status_code': number; diff --git a/packages/kbn-apm-synthtrace/src/lib/apm/base_span.ts b/packages/kbn-apm-synthtrace/src/lib/apm/base_span.ts index 0cfe5940405a2..b74604c39c242 100644 --- a/packages/kbn-apm-synthtrace/src/lib/apm/base_span.ts +++ b/packages/kbn-apm-synthtrace/src/lib/apm/base_span.ts @@ -88,4 +88,10 @@ export class BaseSpan extends Serializable { }); return this; } + + override timestamp(timestamp: number) { + const ret = super.timestamp(timestamp); + this.fields['timestamp.us'] = timestamp * 1000; + return ret; + } } diff --git a/packages/kbn-apm-synthtrace/src/lib/apm/instance.ts b/packages/kbn-apm-synthtrace/src/lib/apm/instance.ts index f69e54b3e300b..9a7fff73b64a7 100644 --- a/packages/kbn-apm-synthtrace/src/lib/apm/instance.ts +++ b/packages/kbn-apm-synthtrace/src/lib/apm/instance.ts @@ -20,24 +20,49 @@ export type SpanParams = { } & ApmFields; export class Instance extends Entity { - transaction({ - transactionName, - transactionType = 'request', - }: { - transactionName: string; - transactionType?: string; - }) { + transaction( + ...options: + | [{ transactionName: string; transactionType?: string }] + | [string] + | [string, string] + ) { + let transactionName: string; + let transactionType: string | undefined; + if (options.length === 2) { + transactionName = options[0]; + transactionType = options[1]; + } else if (typeof options[0] === 'string') { + transactionName = options[0]; + } else { + transactionName = options[0].transactionName; + transactionType = options[0].transactionType; + } + return new Transaction({ ...this.fields, 'transaction.name': transactionName, - 'transaction.type': transactionType, + 'transaction.type': transactionType || 'request', }); } - span({ spanName, spanType, spanSubtype, ...apmFields }: SpanParams) { + span(...options: [string, string] | [string, string, string] | [SpanParams]) { + let spanName: string; + let spanType: string; + let spanSubtype: string; + let fields: ApmFields; + + if (options.length === 3 || options.length === 2) { + spanName = options[0]; + spanType = options[1]; + spanSubtype = options[2] || 'unknown'; + fields = {}; + } else { + ({ spanName, spanType, spanSubtype = 'unknown', ...fields } = options[0]); + } + return new Span({ ...this.fields, - ...apmFields, + ...fields, 'span.name': spanName, 'span.type': spanType, 'span.subtype': spanSubtype, diff --git a/packages/kbn-apm-synthtrace/src/lib/apm/serverless.ts b/packages/kbn-apm-synthtrace/src/lib/apm/serverless.ts index b67586c18a074..f2eb47685bf39 100644 --- a/packages/kbn-apm-synthtrace/src/lib/apm/serverless.ts +++ b/packages/kbn-apm-synthtrace/src/lib/apm/serverless.ts @@ -33,7 +33,6 @@ export class Serverless extends BaseSpan { ...fields, 'metricset.name': 'app', 'faas.execution': faasExection, - 'faas.id': fields['service.name'], }); } diff --git a/packages/kbn-apm-synthtrace/src/lib/apm/serverless_function.ts b/packages/kbn-apm-synthtrace/src/lib/apm/serverless_function.ts index e10bb23b1f933..433acf42ba6ba 100644 --- a/packages/kbn-apm-synthtrace/src/lib/apm/serverless_function.ts +++ b/packages/kbn-apm-synthtrace/src/lib/apm/serverless_function.ts @@ -7,7 +7,6 @@ */ import { Entity } from '../entity'; -import { generateShortId } from '../utils/generate_id'; import { ApmFields } from './apm_fields'; import { ServerlessInstance } from './serverless_instance'; @@ -27,13 +26,15 @@ export function serverlessFunction({ serviceName, environment, agentName, + architecture = 'arm', }: { functionName: string; environment: string; agentName: string; serviceName?: string; + architecture?: string; }) { - const faasId = `arn:aws:lambda:us-west-2:${generateShortId()}:function:${functionName}`; + const faasId = `arn:aws:lambda:us-west-2:001:function:${functionName}`; return new ServerlessFunction({ 'service.name': serviceName || faasId, 'faas.id': faasId, @@ -41,5 +42,6 @@ export function serverlessFunction({ 'service.environment': environment, 'agent.name': agentName, 'service.runtime.name': 'AWS_lambda', + 'host.architecture': architecture, }); } diff --git a/packages/kbn-apm-synthtrace/src/lib/apm/service.ts b/packages/kbn-apm-synthtrace/src/lib/apm/service.ts index 0939535a87135..1925c0cdcfd13 100644 --- a/packages/kbn-apm-synthtrace/src/lib/apm/service.ts +++ b/packages/kbn-apm-synthtrace/src/lib/apm/service.ts @@ -20,17 +20,18 @@ export class Service extends Entity { } } -export function service({ - name, - environment, - agentName, -}: { - name: string; - environment: string; - agentName: string; -}) { +export function service(name: string, environment: string, agentName: string): Service; + +export function service(options: { name: string; environment: string; agentName: string }): Service; + +export function service( + ...args: [{ name: string; environment: string; agentName: string }] | [string, string, string] +) { + const [serviceName, environment, agentName] = + args.length === 1 ? [args[0].name, args[0].environment, args[0].agentName] : args; + return new Service({ - 'service.name': name, + 'service.name': serviceName, 'service.environment': environment, 'agent.name': agentName, }); diff --git a/packages/kbn-apm-synthtrace/src/lib/stream_processor.ts b/packages/kbn-apm-synthtrace/src/lib/stream_processor.ts index 0d7d0ff5dfa51..84f0dbb0a62bf 100644 --- a/packages/kbn-apm-synthtrace/src/lib/stream_processor.ts +++ b/packages/kbn-apm-synthtrace/src/lib/stream_processor.ts @@ -187,10 +187,7 @@ export class StreamProcessor { document['service.node.name'] = document['service.node.name'] || document['container.id'] || document['host.name']; document['ecs.version'] = '1.4'; - // TODO this non standard field should not be enriched here - if (document['processor.event'] !== 'metric') { - document['timestamp.us'] = document['@timestamp']! * 1000; - } + return document; } diff --git a/packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts b/packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts index 4f38a7025f3b5..5d0f57fb5840b 100644 --- a/packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts +++ b/packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts @@ -13,4 +13,5 @@ export function dedot(source: Record, target: Record) const val = source[key as keyof typeof source]; set(target, key, val); } + return target; } diff --git a/packages/kbn-apm-synthtrace/src/scenarios/distributed_trace.ts b/packages/kbn-apm-synthtrace/src/scenarios/distributed_trace.ts index 7834011afa69a..319534f821719 100644 --- a/packages/kbn-apm-synthtrace/src/scenarios/distributed_trace.ts +++ b/packages/kbn-apm-synthtrace/src/scenarios/distributed_trace.ts @@ -23,61 +23,61 @@ const scenario: Scenario = async (runOptions: RunOptions) => { const transactionName = '240rpm/75% 1000ms'; const successfulTimestamps = range.interval('1s').rate(3); - const opbeansRum = apm - .service({ name: 'opbeans-rum', environment: ENVIRONMENT, agentName: 'rum-js' }) + const synthRum = apm + .service({ name: 'synth-rum', environment: ENVIRONMENT, agentName: 'rum-js' }) .instance('my-instance'); - const opbeansNode = apm - .service({ name: 'opbeans-node', environment: ENVIRONMENT, agentName: 'nodejs' }) + const synthNode = apm + .service({ name: 'synth-node', environment: ENVIRONMENT, agentName: 'nodejs' }) .instance('my-instance'); - const opbeansGo = apm - .service({ name: 'opbeans-go', environment: ENVIRONMENT, agentName: 'go' }) + const synthGo = apm + .service({ name: 'synth-go', environment: ENVIRONMENT, agentName: 'go' }) .instance('my-instance'); const traces = successfulTimestamps.generator((timestamp) => { - // opbeans-rum - return opbeansRum + // synth-rum + return synthRum .transaction({ transactionName }) .duration(400) .timestamp(timestamp) .children( - // opbeans-rum -> opbeans-node - opbeansRum + // synth-rum -> synth-node + synthRum .span( httpExitSpan({ spanName: 'GET /api/products/top', - destinationUrl: 'http://opbeans-node:3000', + destinationUrl: 'http://synth-node:3000', }) ) .duration(300) .timestamp(timestamp) .children( - // opbeans-node - opbeansNode - .transaction({ transactionName: 'Initial transaction in opbeans-node' }) + // synth-node + synthNode + .transaction({ transactionName: 'Initial transaction in synth-node' }) .duration(300) .timestamp(timestamp) .children( - opbeansNode - // opbeans-node -> opbeans-go + synthNode + // synth-node -> synth-go .span( httpExitSpan({ - spanName: 'GET opbeans-go:3000', - destinationUrl: 'http://opbeans-go:3000', + spanName: 'GET synth-go:3000', + destinationUrl: 'http://synth-go:3000', }) ) .timestamp(timestamp) .duration(400) .children( - // opbeans-go - opbeansGo + // synth-go + synthGo - .transaction({ transactionName: 'Initial transaction in opbeans-go' }) + .transaction({ transactionName: 'Initial transaction in synth-go' }) .timestamp(timestamp) .duration(200) .children( - opbeansGo + synthGo .span({ spanName: 'custom_operation', spanType: 'custom' }) .timestamp(timestamp) .duration(100) diff --git a/packages/kbn-apm-synthtrace/src/scenarios/distributed_trace_long.ts b/packages/kbn-apm-synthtrace/src/scenarios/distributed_trace_long.ts index 32542ee2c1d49..a55710c6478ef 100644 --- a/packages/kbn-apm-synthtrace/src/scenarios/distributed_trace_long.ts +++ b/packages/kbn-apm-synthtrace/src/scenarios/distributed_trace_long.ts @@ -24,48 +24,48 @@ const scenario: Scenario = async (runOptions: RunOptions) => { const traceDuration = 1100; const rootTransactionName = `${ratePerMinute}rpm / ${traceDuration}ms`; - const opbeansRum = apm - .service({ name: 'opbeans-rum', environment: ENVIRONMENT, agentName: 'rum-js' }) + const synthRum = apm + .service({ name: 'synth-rum', environment: ENVIRONMENT, agentName: 'rum-js' }) .instance('my-instance'); - const opbeansNode = apm - .service({ name: 'opbeans-node', environment: ENVIRONMENT, agentName: 'nodejs' }) + const synthNode = apm + .service({ name: 'synth-node', environment: ENVIRONMENT, agentName: 'nodejs' }) .instance('my-instance'); - const opbeansGo = apm - .service({ name: 'opbeans-go', environment: ENVIRONMENT, agentName: 'go' }) + const synthGo = apm + .service({ name: 'synth-go', environment: ENVIRONMENT, agentName: 'go' }) .instance('my-instance'); - const opbeansDotnet = apm - .service({ name: 'opbeans-dotnet', environment: ENVIRONMENT, agentName: 'dotnet' }) + const synthDotnet = apm + .service({ name: 'synth-dotnet', environment: ENVIRONMENT, agentName: 'dotnet' }) .instance('my-instance'); - const opbeansJava = apm - .service({ name: 'opbeans-java', environment: ENVIRONMENT, agentName: 'java' }) + const synthJava = apm + .service({ name: 'synth-java', environment: ENVIRONMENT, agentName: 'java' }) .instance('my-instance'); const traces = timerange(from, to) .ratePerMinute(ratePerMinute) .generator((timestamp) => { return new DistributedTrace({ - serviceInstance: opbeansRum, + serviceInstance: synthRum, transactionName: rootTransactionName, timestamp, children: (_) => { _.service({ repeat: 10, - serviceInstance: opbeansNode, + serviceInstance: synthNode, transactionName: 'GET /nodejs/products', latency: 100, children: (_) => { _.service({ - serviceInstance: opbeansGo, + serviceInstance: synthGo, transactionName: 'GET /go', children: (_) => { _.service({ repeat: 20, - serviceInstance: opbeansJava, + serviceInstance: synthJava, transactionName: 'GET /java', children: (_) => { _.external({ @@ -84,19 +84,19 @@ const scenario: Scenario = async (runOptions: RunOptions) => { }); _.service({ - serviceInstance: opbeansNode, + serviceInstance: synthNode, transactionName: 'GET /nodejs/users', latency: 100, repeat: 10, children: (_) => { _.service({ - serviceInstance: opbeansGo, + serviceInstance: synthGo, transactionName: 'GET /go/security', latency: 50, children: (_) => { _.service({ repeat: 10, - serviceInstance: opbeansDotnet, + serviceInstance: synthDotnet, transactionName: 'GET /dotnet/cases/4', latency: 50, children: (_) => diff --git a/packages/kbn-apm-synthtrace/src/scenarios/simple_trace.ts b/packages/kbn-apm-synthtrace/src/scenarios/simple_trace.ts index 8f3c84564787c..c125196999a92 100644 --- a/packages/kbn-apm-synthtrace/src/scenarios/simple_trace.ts +++ b/packages/kbn-apm-synthtrace/src/scenarios/simple_trace.ts @@ -32,7 +32,7 @@ const scenario: Scenario = async (runOptions: RunOptions) => { const instances = [...Array(numServices).keys()].map((index) => apm - .service({ name: `opbeans-go-${index}`, environment: ENVIRONMENT, agentName: 'go' }) + .service({ name: `synth-go-${index}`, environment: ENVIRONMENT, agentName: 'go' }) .instance('instance') ); const instanceSpans = (instance: Instance) => { diff --git a/packages/kbn-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts b/packages/kbn-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts index afafcc0c49665..edb20c4768ee5 100644 --- a/packages/kbn-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts +++ b/packages/kbn-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts @@ -59,9 +59,6 @@ describe('output apm events to elasticsearch', () => { "name": "instance-a", }, }, - "timestamp": Object { - "us": 1609455600000000, - }, } `); }); diff --git a/packages/kbn-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts index a278997ecdf73..a14ae076e8186 100644 --- a/packages/kbn-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts +++ b/packages/kbn-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts @@ -84,6 +84,7 @@ describe('simple trace', () => { 'service.environment': 'production', 'service.name': 'opbeans-java', 'service.node.name': 'instance-1', + 'timestamp.us': 1609459200000000, 'trace.id': '00000000000000000000000000000241', 'transaction.duration.us': 1000000, 'transaction.id': '0000000000000240', @@ -113,6 +114,7 @@ describe('simple trace', () => { 'span.name': 'GET apm-*/_search', 'span.subtype': 'elasticsearch', 'span.type': 'db', + 'timestamp.us': 1609459200050000, 'trace.id': '00000000000000000000000000000301', 'transaction.id': '0000000000000300', }); diff --git a/packages/kbn-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap b/packages/kbn-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap index 1a5fca39e9fd9..8b3306d2d3a4b 100644 --- a/packages/kbn-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap +++ b/packages/kbn-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap @@ -13,6 +13,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459200000000, "trace.id": "00000000000000000000000000000001", "transaction.duration.us": 1000000, "transaction.id": "0000000000000000", @@ -37,6 +38,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459200050000, "trace.id": "00000000000000000000000000000001", "transaction.id": "0000000000000000", }, @@ -51,6 +53,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459260000000, "trace.id": "00000000000000000000000000000005", "transaction.duration.us": 1000000, "transaction.id": "0000000000000004", @@ -75,6 +78,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459260050000, "trace.id": "00000000000000000000000000000005", "transaction.id": "0000000000000004", }, @@ -89,6 +93,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459320000000, "trace.id": "00000000000000000000000000000009", "transaction.duration.us": 1000000, "transaction.id": "0000000000000008", @@ -113,6 +118,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459320050000, "trace.id": "00000000000000000000000000000009", "transaction.id": "0000000000000008", }, @@ -127,6 +133,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459380000000, "trace.id": "00000000000000000000000000000013", "transaction.duration.us": 1000000, "transaction.id": "0000000000000012", @@ -151,6 +158,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459380050000, "trace.id": "00000000000000000000000000000013", "transaction.id": "0000000000000012", }, @@ -165,6 +173,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459440000000, "trace.id": "00000000000000000000000000000017", "transaction.duration.us": 1000000, "transaction.id": "0000000000000016", @@ -189,6 +198,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459440050000, "trace.id": "00000000000000000000000000000017", "transaction.id": "0000000000000016", }, @@ -203,6 +213,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459500000000, "trace.id": "00000000000000000000000000000021", "transaction.duration.us": 1000000, "transaction.id": "0000000000000020", @@ -227,6 +238,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459500050000, "trace.id": "00000000000000000000000000000021", "transaction.id": "0000000000000020", }, @@ -241,6 +253,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459560000000, "trace.id": "00000000000000000000000000000025", "transaction.duration.us": 1000000, "transaction.id": "0000000000000024", @@ -265,6 +278,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459560050000, "trace.id": "00000000000000000000000000000025", "transaction.id": "0000000000000024", }, @@ -279,6 +293,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459620000000, "trace.id": "00000000000000000000000000000029", "transaction.duration.us": 1000000, "transaction.id": "0000000000000028", @@ -303,6 +318,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459620050000, "trace.id": "00000000000000000000000000000029", "transaction.id": "0000000000000028", }, @@ -317,6 +333,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459680000000, "trace.id": "00000000000000000000000000000033", "transaction.duration.us": 1000000, "transaction.id": "0000000000000032", @@ -341,6 +358,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459680050000, "trace.id": "00000000000000000000000000000033", "transaction.id": "0000000000000032", }, @@ -355,6 +373,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459740000000, "trace.id": "00000000000000000000000000000037", "transaction.duration.us": 1000000, "transaction.id": "0000000000000036", @@ -379,6 +398,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459740050000, "trace.id": "00000000000000000000000000000037", "transaction.id": "0000000000000036", }, @@ -393,6 +413,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459800000000, "trace.id": "00000000000000000000000000000041", "transaction.duration.us": 1000000, "transaction.id": "0000000000000040", @@ -417,6 +438,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459800050000, "trace.id": "00000000000000000000000000000041", "transaction.id": "0000000000000040", }, @@ -431,6 +453,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459860000000, "trace.id": "00000000000000000000000000000045", "transaction.duration.us": 1000000, "transaction.id": "0000000000000044", @@ -455,6 +478,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459860050000, "trace.id": "00000000000000000000000000000045", "transaction.id": "0000000000000044", }, @@ -469,6 +493,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459920000000, "trace.id": "00000000000000000000000000000049", "transaction.duration.us": 1000000, "transaction.id": "0000000000000048", @@ -493,6 +518,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459920050000, "trace.id": "00000000000000000000000000000049", "transaction.id": "0000000000000048", }, @@ -507,6 +533,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609459980000000, "trace.id": "00000000000000000000000000000053", "transaction.duration.us": 1000000, "transaction.id": "0000000000000052", @@ -531,6 +558,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609459980050000, "trace.id": "00000000000000000000000000000053", "transaction.id": "0000000000000052", }, @@ -545,6 +573,7 @@ Array [ "service.environment": "production", "service.name": "opbeans-java", "service.node.name": "instance-1", + "timestamp.us": 1609460040000000, "trace.id": "00000000000000000000000000000057", "transaction.duration.us": 1000000, "transaction.id": "0000000000000056", @@ -569,6 +598,7 @@ Array [ "span.name": "GET apm-*/_search", "span.subtype": "elasticsearch", "span.type": "db", + "timestamp.us": 1609460040050000, "trace.id": "00000000000000000000000000000057", "transaction.id": "0000000000000056", }, diff --git a/packages/kbn-apm-synthtrace/tsconfig.json b/packages/kbn-apm-synthtrace/tsconfig.json index 66a3e0d12e411..cc3e7412412df 100644 --- a/packages/kbn-apm-synthtrace/tsconfig.json +++ b/packages/kbn-apm-synthtrace/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": ["node", "jest"] diff --git a/packages/kbn-apm-utils/BUILD.bazel b/packages/kbn-apm-utils/BUILD.bazel index ab3004dc47d36..5f685b859613a 100644 --- a/packages/kbn-apm-utils/BUILD.bazel +++ b/packages/kbn-apm-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-apm-utils" +PKG_DIRNAME = "kbn-apm-utils" PKG_REQUIRE_NAME = "@kbn/apm-utils" SOURCE_FILES = glob( @@ -65,25 +65,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -94,19 +99,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-apm-utils/package.json b/packages/kbn-apm-utils/package.json index c57753bc83e50..7e31210e1d19d 100644 --- a/packages/kbn-apm-utils/package.json +++ b/packages/kbn-apm-utils/package.json @@ -3,5 +3,6 @@ "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-apm-utils/tsconfig.json b/packages/kbn-apm-utils/tsconfig.json index e82293883bbb4..b4316f3d2faac 100644 --- a/packages/kbn-apm-utils/tsconfig.json +++ b/packages/kbn-apm-utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-axe-config/BUILD.bazel b/packages/kbn-axe-config/BUILD.bazel index 8bf795bffdc6f..b565aea2e8c04 100644 --- a/packages/kbn-axe-config/BUILD.bazel +++ b/packages/kbn-axe-config/BUILD.bazel @@ -91,7 +91,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -105,6 +104,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -116,17 +123,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-axe-config/package.json b/packages/kbn-axe-config/package.json index 62dd325c3ca2f..77c6d2b4c31c4 100644 --- a/packages/kbn-axe-config/package.json +++ b/packages/kbn-axe-config/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-axe-config/tsconfig.json b/packages/kbn-axe-config/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-axe-config/tsconfig.json +++ b/packages/kbn-axe-config/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-babel-plugin-synthetic-packages/BUILD.bazel b/packages/kbn-babel-plugin-synthetic-packages/BUILD.bazel index da588dab2ce42..a1e6891f23ec5 100644 --- a/packages/kbn-babel-plugin-synthetic-packages/BUILD.bazel +++ b/packages/kbn-babel-plugin-synthetic-packages/BUILD.bazel @@ -44,9 +44,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_DIRNAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-babel-preset/BUILD.bazel b/packages/kbn-babel-preset/BUILD.bazel index 54dc3bafd8ac8..7b4090ceac48e 100644 --- a/packages/kbn-babel-preset/BUILD.bazel +++ b/packages/kbn-babel-preset/BUILD.bazel @@ -1,7 +1,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "pkg_npm") -PKG_BASE_NAME = "kbn-babel-preset" +PKG_DIRNAME = "kbn-babel-preset" PKG_REQUIRE_NAME = "@kbn/babel-preset" SOURCE_FILES = glob([ @@ -43,7 +43,7 @@ RUNTIME_DEPS = [ ] js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [ ":srcs", ], @@ -54,9 +54,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-babel-preset/node_preset.js b/packages/kbn-babel-preset/node_preset.js index 31cebf7e1715a..dfbca5a364f59 100644 --- a/packages/kbn-babel-preset/node_preset.js +++ b/packages/kbn-babel-preset/node_preset.js @@ -31,7 +31,7 @@ module.exports = (_, options = {}) => { // Because of that we should use for that value the same version we install // in the package.json in order to have the same polyfills between the environment // and the tests - corejs: '3.25.5', + corejs: '3.26.0', bugfixes: true, ...(options['@babel/preset-env'] || {}), diff --git a/packages/kbn-babel-preset/webpack_preset.js b/packages/kbn-babel-preset/webpack_preset.js index 171b00911db17..d7359345bf22e 100644 --- a/packages/kbn-babel-preset/webpack_preset.js +++ b/packages/kbn-babel-preset/webpack_preset.js @@ -18,7 +18,7 @@ module.exports = (_, options = {}) => { modules: false, // Please read the explanation for this // in node_preset.js - corejs: '3.25.5', + corejs: '3.26.0', bugfixes: true, }, ], diff --git a/packages/kbn-bazel-packages/BUILD.bazel b/packages/kbn-bazel-packages/BUILD.bazel index 71d6384a3cff4..83804b96e50be 100644 --- a/packages/kbn-bazel-packages/BUILD.bazel +++ b/packages/kbn-bazel-packages/BUILD.bazel @@ -86,7 +86,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, allow_js = True, emit_declaration_only = True, out_dir = "target_types", @@ -101,6 +100,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -112,17 +119,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-bazel-packages/package.json b/packages/kbn-bazel-packages/package.json index fabf8b6cbbc14..32e4cdd4df279 100644 --- a/packages/kbn-bazel-packages/package.json +++ b/packages/kbn-bazel-packages/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-bazel-packages/tsconfig.json b/packages/kbn-bazel-packages/tsconfig.json index 613c256ed2831..b58cd70b2c650 100644 --- a/packages/kbn-bazel-packages/tsconfig.json +++ b/packages/kbn-bazel-packages/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "allowJs": true, "checkJs": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-bazel-runner/BUILD.bazel b/packages/kbn-bazel-runner/BUILD.bazel index 994ad432c69d0..6d5f2efd9defd 100644 --- a/packages/kbn-bazel-runner/BUILD.bazel +++ b/packages/kbn-bazel-runner/BUILD.bazel @@ -94,7 +94,6 @@ ts_project( deps = TYPES_DEPS, allow_js = True, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -108,6 +107,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -119,17 +126,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-bazel-runner/package.json b/packages/kbn-bazel-runner/package.json index 540dfbac4a037..bf34fa74f8a69 100644 --- a/packages/kbn-bazel-runner/package.json +++ b/packages/kbn-bazel-runner/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-bazel-runner/src/bazel_runner.js b/packages/kbn-bazel-runner/src/bazel_runner.js index 78d91e7ae4799..cc9f2d7c43686 100644 --- a/packages/kbn-bazel-runner/src/bazel_runner.js +++ b/packages/kbn-bazel-runner/src/bazel_runner.js @@ -20,8 +20,18 @@ async function printLines(stream, prefix) { crlfDelay: Infinity, }); + // A validation between the previous logged line and the new one to log was introduced + // as the last line of the Bazel task when ran with progress enabled was being logged + // twice after parsing the log output with the logic we have here. + // The original output when letting Bazel taking care of it on its own doesn't include the repeated line + // so this check logic is useful until we get rid of Bazel. + let prevLine = null; for await (const line of int) { + if (prevLine === line) { + continue; + } console.log(prefix ? `${prefix} ${line}` : line); + prevLine = line; } } diff --git a/packages/kbn-bazel-runner/tsconfig.json b/packages/kbn-bazel-runner/tsconfig.json index d8daff6265139..6065463237d14 100644 --- a/packages/kbn-bazel-runner/tsconfig.json +++ b/packages/kbn-bazel-runner/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "allowJs": true, "checkJs": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-cases-components/BUILD.bazel b/packages/kbn-cases-components/BUILD.bazel index ef6db08ca7540..742948f37f0f7 100644 --- a/packages/kbn-cases-components/BUILD.bazel +++ b/packages/kbn-cases-components/BUILD.bazel @@ -84,7 +84,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -98,6 +97,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -109,17 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-cases-components/package.json b/packages/kbn-cases-components/package.json index eeb816ca5538b..09d1d72ea8366 100644 --- a/packages/kbn-cases-components/package.json +++ b/packages/kbn-cases-components/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-cases-components/tsconfig.json b/packages/kbn-cases-components/tsconfig.json index 171db889bdd36..f48d8e4a548bf 100644 --- a/packages/kbn-cases-components/tsconfig.json +++ b/packages/kbn-cases-components/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/kbn-chart-icons/BUILD.bazel b/packages/kbn-chart-icons/BUILD.bazel index 84de85a505094..d1ef991c0befd 100644 --- a/packages/kbn-chart-icons/BUILD.bazel +++ b/packages/kbn-chart-icons/BUILD.bazel @@ -103,7 +103,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -117,6 +116,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -128,17 +135,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-chart-icons/kibana.jsonc b/packages/kbn-chart-icons/kibana.jsonc index 1d1de945c95de..47e7394190fa7 100644 --- a/packages/kbn-chart-icons/kibana.jsonc +++ b/packages/kbn-chart-icons/kibana.jsonc @@ -1,7 +1,7 @@ { "type": "shared-common", "id": "@kbn/chart-icons", - "owner": "@elastic/kibana-vis-editors", + "owner": "@elastic/kibana-visualizations", "runtimeDeps": [], "typeDeps": [] } diff --git a/packages/kbn-chart-icons/package.json b/packages/kbn-chart-icons/package.json index c1f5912c1269e..901cc41588b06 100644 --- a/packages/kbn-chart-icons/package.json +++ b/packages/kbn-chart-icons/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-chart-icons/tsconfig.json b/packages/kbn-chart-icons/tsconfig.json index f3c863a9cd6f4..aed4b0c3763dc 100644 --- a/packages/kbn-chart-icons/tsconfig.json +++ b/packages/kbn-chart-icons/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-ci-stats-core/BUILD.bazel b/packages/kbn-ci-stats-core/BUILD.bazel index 83f567539da4e..6d68336effc27 100644 --- a/packages/kbn-ci-stats-core/BUILD.bazel +++ b/packages/kbn-ci-stats-core/BUILD.bazel @@ -86,7 +86,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -100,6 +99,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -111,17 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ci-stats-core/package.json b/packages/kbn-ci-stats-core/package.json index fc56e2e3213ea..eb271889023a3 100644 --- a/packages/kbn-ci-stats-core/package.json +++ b/packages/kbn-ci-stats-core/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-ci-stats-core/tsconfig.json b/packages/kbn-ci-stats-core/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-ci-stats-core/tsconfig.json +++ b/packages/kbn-ci-stats-core/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-ci-stats-performance-metrics/BUILD.bazel b/packages/kbn-ci-stats-performance-metrics/BUILD.bazel index 98c676c8db5c6..3b3340c0e6cb3 100644 --- a/packages/kbn-ci-stats-performance-metrics/BUILD.bazel +++ b/packages/kbn-ci-stats-performance-metrics/BUILD.bazel @@ -93,7 +93,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -107,6 +106,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -118,17 +125,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ci-stats-performance-metrics/package.json b/packages/kbn-ci-stats-performance-metrics/package.json index 0801174ab4a02..6d12a45cc4dbe 100644 --- a/packages/kbn-ci-stats-performance-metrics/package.json +++ b/packages/kbn-ci-stats-performance-metrics/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-ci-stats-performance-metrics/tsconfig.json b/packages/kbn-ci-stats-performance-metrics/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-ci-stats-performance-metrics/tsconfig.json +++ b/packages/kbn-ci-stats-performance-metrics/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-ci-stats-reporter/BUILD.bazel b/packages/kbn-ci-stats-reporter/BUILD.bazel index d2f1e85e58556..1a43bc14012ed 100644 --- a/packages/kbn-ci-stats-reporter/BUILD.bazel +++ b/packages/kbn-ci-stats-reporter/BUILD.bazel @@ -92,7 +92,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -106,6 +105,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -117,17 +124,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ci-stats-reporter/package.json b/packages/kbn-ci-stats-reporter/package.json index 1393c08cddac4..b16ac7db77dcf 100644 --- a/packages/kbn-ci-stats-reporter/package.json +++ b/packages/kbn-ci-stats-reporter/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-ci-stats-reporter/tsconfig.json b/packages/kbn-ci-stats-reporter/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-ci-stats-reporter/tsconfig.json +++ b/packages/kbn-ci-stats-reporter/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-cli-dev-mode/BUILD.bazel b/packages/kbn-cli-dev-mode/BUILD.bazel index 9b03aaa956b54..399ee78330c6a 100644 --- a/packages/kbn-cli-dev-mode/BUILD.bazel +++ b/packages/kbn-cli-dev-mode/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-cli-dev-mode" +PKG_DIRNAME = "kbn-cli-dev-mode" PKG_REQUIRE_NAME = "@kbn/cli-dev-mode" SOURCE_FILES = glob( @@ -103,25 +103,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -132,19 +137,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-cli-dev-mode/package.json b/packages/kbn-cli-dev-mode/package.json index 6113b1deef073..f799551d83adc 100644 --- a/packages/kbn-cli-dev-mode/package.json +++ b/packages/kbn-cli-dev-mode/package.json @@ -3,5 +3,6 @@ "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-cli-dev-mode/src/log_adapter.ts b/packages/kbn-cli-dev-mode/src/log_adapter.ts index 65161fcc56e0e..58260939a6dae 100644 --- a/packages/kbn-cli-dev-mode/src/log_adapter.ts +++ b/packages/kbn-cli-dev-mode/src/log_adapter.ts @@ -22,6 +22,7 @@ export const convertToLogger = (cliLog: Log): Logger => { error: (msgOrError) => cliLog.bad('error', getErrorMessage(msgOrError)), fatal: (msgOrError) => cliLog.bad('fatal', getErrorMessage(msgOrError)), log: (record) => cliLog.write(record.message), + isLevelEnabled: () => true, get: () => adapter, }; return adapter; diff --git a/packages/kbn-cli-dev-mode/tsconfig.json b/packages/kbn-cli-dev-mode/tsconfig.json index ed2c3cb774aff..60a261148e76b 100644 --- a/packages/kbn-cli-dev-mode/tsconfig.json +++ b/packages/kbn-cli-dev-mode/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-coloring/BUILD.bazel b/packages/kbn-coloring/BUILD.bazel index 60b34fcaacb17..80a1f90ce918a 100644 --- a/packages/kbn-coloring/BUILD.bazel +++ b/packages/kbn-coloring/BUILD.bazel @@ -116,7 +116,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -130,6 +129,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -141,17 +148,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-coloring/kibana.jsonc b/packages/kbn-coloring/kibana.jsonc index 0b1ff8a449286..410698f345809 100644 --- a/packages/kbn-coloring/kibana.jsonc +++ b/packages/kbn-coloring/kibana.jsonc @@ -1,7 +1,7 @@ { "type": "shared-common", "id": "@kbn/coloring", - "owner": "@elastic/kibana-vis-editors", + "owner": "@elastic/kibana-visualizations", "runtimeDeps": [], "typeDeps": [] } diff --git a/packages/kbn-coloring/package.json b/packages/kbn-coloring/package.json index c1b5d5337756d..df816c6e892b8 100644 --- a/packages/kbn-coloring/package.json +++ b/packages/kbn-coloring/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-coloring/src/shared_components/coloring/palette_configuration.test.tsx b/packages/kbn-coloring/src/shared_components/coloring/palette_configuration.test.tsx index 696baceffb540..f7f8367d9ed7b 100644 --- a/packages/kbn-coloring/src/shared_components/coloring/palette_configuration.test.tsx +++ b/packages/kbn-coloring/src/shared_components/coloring/palette_configuration.test.tsx @@ -61,7 +61,7 @@ describe('palette panel', () => { dataBounds: { min: 0, max: 100 }, }; - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); function changePaletteIn(instance: ReactWrapper, newPaletteName: string) { diff --git a/packages/kbn-coloring/tsconfig.json b/packages/kbn-coloring/tsconfig.json index 3bb2dd2715fcb..e0b5f2c053305 100644 --- a/packages/kbn-coloring/tsconfig.json +++ b/packages/kbn-coloring/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/kbn-config-mocks/BUILD.bazel b/packages/kbn-config-mocks/BUILD.bazel index 391dc55607766..5389233b8419b 100644 --- a/packages/kbn-config-mocks/BUILD.bazel +++ b/packages/kbn-config-mocks/BUILD.bazel @@ -69,7 +69,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -83,6 +82,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -94,17 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-config-mocks/package.json b/packages/kbn-config-mocks/package.json index da209eec5fadf..c2bbafd095dbe 100644 --- a/packages/kbn-config-mocks/package.json +++ b/packages/kbn-config-mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-config-mocks/tsconfig.json b/packages/kbn-config-mocks/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-config-mocks/tsconfig.json +++ b/packages/kbn-config-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-config-schema/BUILD.bazel b/packages/kbn-config-schema/BUILD.bazel index aebd34efa2f08..f90c8c44c6a35 100644 --- a/packages/kbn-config-schema/BUILD.bazel +++ b/packages/kbn-config-schema/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-config-schema" +PKG_DIRNAME = "kbn-config-schema" PKG_REQUIRE_NAME = "@kbn/config-schema" SOURCE_FILES = glob( @@ -75,25 +75,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -104,19 +109,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-config-schema/package.json b/packages/kbn-config-schema/package.json index 9f1b42f200385..4b58a5c559651 100644 --- a/packages/kbn-config-schema/package.json +++ b/packages/kbn-config-schema/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", "author": "Kibana Core", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-config-schema/tsconfig.json b/packages/kbn-config-schema/tsconfig.json index 3de05fab09789..569d575c72bcb 100644 --- a/packages/kbn-config-schema/tsconfig.json +++ b/packages/kbn-config-schema/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "stripInternal": true, diff --git a/packages/kbn-config/BUILD.bazel b/packages/kbn-config/BUILD.bazel index eef3d336b57dd..69436dbcb4f6f 100644 --- a/packages/kbn-config/BUILD.bazel +++ b/packages/kbn-config/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-config" +PKG_DIRNAME = "kbn-config" PKG_REQUIRE_NAME = "@kbn/config" SOURCE_FILES = glob( @@ -94,25 +94,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -123,19 +128,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-config/package.json b/packages/kbn-config/package.json index 836e12b41c243..11fabd92af291 100644 --- a/packages/kbn-config/package.json +++ b/packages/kbn-config/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-config/tsconfig.json b/packages/kbn-config/tsconfig.json index e6381fc4edf9f..57c1dd1c94e0f 100644 --- a/packages/kbn-config/tsconfig.json +++ b/packages/kbn-config/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": false, + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-crypto-browser/BUILD.bazel b/packages/kbn-crypto-browser/BUILD.bazel index 41b70fbc2b623..bf3b4e43ef362 100644 --- a/packages/kbn-crypto-browser/BUILD.bazel +++ b/packages/kbn-crypto-browser/BUILD.bazel @@ -84,6 +84,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -95,17 +103,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-crypto-browser/package.json b/packages/kbn-crypto-browser/package.json index 42bf708c93cdf..98bedc14e7b0b 100644 --- a/packages/kbn-crypto-browser/package.json +++ b/packages/kbn-crypto-browser/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-crypto-browser/tsconfig.json b/packages/kbn-crypto-browser/tsconfig.json index 118bd3fb10818..57c1dd1c94e0f 100644 --- a/packages/kbn-crypto-browser/tsconfig.json +++ b/packages/kbn-crypto-browser/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-crypto/BUILD.bazel b/packages/kbn-crypto/BUILD.bazel index 4dade7bba6ca2..fb3bcbcfbd060 100644 --- a/packages/kbn-crypto/BUILD.bazel +++ b/packages/kbn-crypto/BUILD.bazel @@ -3,7 +3,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-crypto" +PKG_DIRNAME = "kbn-crypto" PKG_REQUIRE_NAME = "@kbn/crypto" SOURCE_FILES = glob( @@ -72,25 +72,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -101,19 +106,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-crypto/package.json b/packages/kbn-crypto/package.json index 96bf21906ed4a..8fa6cd3c232fa 100644 --- a/packages/kbn-crypto/package.json +++ b/packages/kbn-crypto/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js" + "main": "./target_node/index.js", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-crypto/tsconfig.json b/packages/kbn-crypto/tsconfig.json index 5177725e200ca..f40f9a4ee1cfb 100644 --- a/packages/kbn-crypto/tsconfig.json +++ b/packages/kbn-crypto/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-datemath/BUILD.bazel b/packages/kbn-datemath/BUILD.bazel index ae4e19b9b7c8c..4e33d59d71823 100644 --- a/packages/kbn-datemath/BUILD.bazel +++ b/packages/kbn-datemath/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "ts_project", "pkg_npm", "pkg_npm_types") -PKG_BASE_NAME = "kbn-datemath" +PKG_DIRNAME = "kbn-datemath" PKG_REQUIRE_NAME = "@kbn/datemath" SOURCE_FILES = glob( @@ -64,25 +64,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig" ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -93,19 +98,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-datemath/package.json b/packages/kbn-datemath/package.json index 0bd726afb721e..933620644ddd6 100644 --- a/packages/kbn-datemath/package.json +++ b/packages/kbn-datemath/package.json @@ -6,5 +6,6 @@ "main": "./target_node/index.js", "peerDependencies": { "moment": "^2.24.0" - } + }, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-datemath/tsconfig.json b/packages/kbn-datemath/tsconfig.json index e82293883bbb4..b4316f3d2faac 100644 --- a/packages/kbn-datemath/tsconfig.json +++ b/packages/kbn-datemath/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-dev-cli-errors/BUILD.bazel b/packages/kbn-dev-cli-errors/BUILD.bazel index 21d04e63b1ec6..07b095254a0a7 100644 --- a/packages/kbn-dev-cli-errors/BUILD.bazel +++ b/packages/kbn-dev-cli-errors/BUILD.bazel @@ -83,7 +83,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -97,6 +96,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -108,17 +115,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-dev-cli-errors/package.json b/packages/kbn-dev-cli-errors/package.json index e4757b7ad9b38..a40c9a3bccacc 100644 --- a/packages/kbn-dev-cli-errors/package.json +++ b/packages/kbn-dev-cli-errors/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-dev-cli-errors/tsconfig.json b/packages/kbn-dev-cli-errors/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-dev-cli-errors/tsconfig.json +++ b/packages/kbn-dev-cli-errors/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-dev-cli-runner/BUILD.bazel b/packages/kbn-dev-cli-runner/BUILD.bazel index b1ddeb1dcaf95..65036f7070977 100644 --- a/packages/kbn-dev-cli-runner/BUILD.bazel +++ b/packages/kbn-dev-cli-runner/BUILD.bazel @@ -106,7 +106,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -120,6 +119,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -131,17 +138,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-dev-cli-runner/package.json b/packages/kbn-dev-cli-runner/package.json index 12670190159af..94e1769933ce0 100644 --- a/packages/kbn-dev-cli-runner/package.json +++ b/packages/kbn-dev-cli-runner/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-dev-cli-runner/src/run_with_commands.test.ts b/packages/kbn-dev-cli-runner/src/run_with_commands.test.ts index 329e858b08f5e..150765f1d9b6a 100644 --- a/packages/kbn-dev-cli-runner/src/run_with_commands.test.ts +++ b/packages/kbn-dev-cli-runner/src/run_with_commands.test.ts @@ -8,6 +8,7 @@ import { ToolingLog, ToolingLogCollectingWriter } from '@kbn/tooling-log'; import { ProcRunner } from '@kbn/dev-proc-runner'; +jest.mock('./metrics'); import { FlagsReader } from './flags_reader'; import { RunWithCommands } from './run_with_commands'; @@ -48,7 +49,7 @@ it('extends the context using extendContext()', async () => { flagsReader: expect.any(FlagsReader), addCleanupTask: expect.any(Function), procRunner: expect.any(ProcRunner), - statsMeta: expect.any(Map), + statsMeta: undefined, extraContext: true, }); diff --git a/packages/kbn-dev-cli-runner/tsconfig.json b/packages/kbn-dev-cli-runner/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-dev-cli-runner/tsconfig.json +++ b/packages/kbn-dev-cli-runner/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-dev-proc-runner/BUILD.bazel b/packages/kbn-dev-proc-runner/BUILD.bazel index e32831d604d2e..a2a344f41c35a 100644 --- a/packages/kbn-dev-proc-runner/BUILD.bazel +++ b/packages/kbn-dev-proc-runner/BUILD.bazel @@ -99,7 +99,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -113,6 +112,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -124,17 +131,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-dev-proc-runner/package.json b/packages/kbn-dev-proc-runner/package.json index 38907397d2c52..bdc3c1793cf31 100644 --- a/packages/kbn-dev-proc-runner/package.json +++ b/packages/kbn-dev-proc-runner/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-dev-proc-runner/tsconfig.json b/packages/kbn-dev-proc-runner/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-dev-proc-runner/tsconfig.json +++ b/packages/kbn-dev-proc-runner/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-dev-utils/BUILD.bazel b/packages/kbn-dev-utils/BUILD.bazel index 42543650a1051..acdd6d9d4f557 100644 --- a/packages/kbn-dev-utils/BUILD.bazel +++ b/packages/kbn-dev-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-dev-utils" +PKG_DIRNAME = "kbn-dev-utils" PKG_REQUIRE_NAME = "@kbn/dev-utils" SOURCE_FILES = glob( @@ -146,25 +146,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -175,19 +180,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index 1316319286a96..b7c8416c7b1a9 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js" + "main": "./target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-dev-utils/src/diff_strings.ts b/packages/kbn-dev-utils/src/diff_strings.ts index 11b7e574c7560..03ca506fd4c90 100644 --- a/packages/kbn-dev-utils/src/diff_strings.ts +++ b/packages/kbn-dev-utils/src/diff_strings.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import jestDiff from 'jest-diff'; +import { diff as jestDiff } from 'jest-diff'; import stripAnsi from 'strip-ansi'; import Chalk from 'chalk'; diff --git a/packages/kbn-dev-utils/tsconfig.json b/packages/kbn-dev-utils/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-dev-utils/tsconfig.json +++ b/packages/kbn-dev-utils/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-doc-links/BUILD.bazel b/packages/kbn-doc-links/BUILD.bazel index c4849085c0ae2..af0668f181897 100644 --- a/packages/kbn-doc-links/BUILD.bazel +++ b/packages/kbn-doc-links/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-doc-links" +PKG_DIRNAME = "kbn-doc-links" PKG_REQUIRE_NAME = "@kbn/doc-links" SOURCE_FILES = glob( @@ -75,25 +75,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -104,19 +109,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-doc-links/package.json b/packages/kbn-doc-links/package.json index e4212ed989d9a..f041cf1b37dd4 100644 --- a/packages/kbn-doc-links/package.json +++ b/packages/kbn-doc-links/package.json @@ -4,5 +4,6 @@ "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index 8783f21a1af9f..796e46ecbf6e5 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -50,6 +50,10 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { overview: `${APM_DOCS}guide/${DOC_LINK_VERSION}/apm-overview.html`, tailSamplingPolicies: `${APM_DOCS}guide/${DOC_LINK_VERSION}/configure-tail-based-sampling.html`, elasticAgent: `${APM_DOCS}guide/${DOC_LINK_VERSION}/upgrade-to-apm-integration.html`, + storageExplorer: `${KIBANA_DOCS}storage-explorer.html`, + spanCompression: `${APM_DOCS}guide/${DOC_LINK_VERSION}/span-compression.html`, + transactionSampling: `${APM_DOCS}guide/${DOC_LINK_VERSION}/sampling.html`, + indexLifecycleManagement: `${APM_DOCS}guide/${DOC_LINK_VERSION}/ilm-how-to.html`, }, canvas: { guide: `${KIBANA_DOCS}canvas.html`, diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index 443de50276691..7affe129b8173 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -35,6 +35,10 @@ export interface DocLinks { readonly overview: string; readonly tailSamplingPolicies: string; readonly elasticAgent: string; + readonly storageExplorer: string; + readonly spanCompression: string; + readonly transactionSampling: string; + readonly indexLifecycleManagement: string; }; readonly canvas: { readonly guide: string; diff --git a/packages/kbn-doc-links/tsconfig.json b/packages/kbn-doc-links/tsconfig.json index ac7a28f2db4a9..60a261148e76b 100644 --- a/packages/kbn-doc-links/tsconfig.json +++ b/packages/kbn-doc-links/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": false, + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-docs-utils/BUILD.bazel b/packages/kbn-docs-utils/BUILD.bazel index 33687685100e1..6add8283f9648 100644 --- a/packages/kbn-docs-utils/BUILD.bazel +++ b/packages/kbn-docs-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-docs-utils" +PKG_DIRNAME = "kbn-docs-utils" PKG_REQUIRE_NAME = "@kbn/docs-utils" SOURCE_FILES = glob( @@ -79,25 +79,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -108,19 +113,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-docs-utils/package.json b/packages/kbn-docs-utils/package.json index d75a79ed44b22..7f0c60985ad62 100644 --- a/packages/kbn-docs-utils/package.json +++ b/packages/kbn-docs-utils/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", "private": "true", - "main": "target_node/index.js" + "main": "target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-docs-utils/tsconfig.json b/packages/kbn-docs-utils/tsconfig.json index beba7f7a9cc21..884ead81c781f 100644 --- a/packages/kbn-docs-utils/tsconfig.json +++ b/packages/kbn-docs-utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-ebt-tools/BUILD.bazel b/packages/kbn-ebt-tools/BUILD.bazel index ca3591e936703..07908d50346e8 100644 --- a/packages/kbn-ebt-tools/BUILD.bazel +++ b/packages/kbn-ebt-tools/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-ebt-tools" +PKG_DIRNAME = "kbn-ebt-tools" PKG_REQUIRE_NAME = "@kbn/ebt-tools" SOURCE_FILES = glob( @@ -65,14 +65,21 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], package_name = PKG_REQUIRE_NAME, @@ -81,9 +88,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -94,19 +99,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ebt-tools/package.json b/packages/kbn-ebt-tools/package.json index 5e5136966b5f9..c3c73a542d016 100644 --- a/packages/kbn-ebt-tools/package.json +++ b/packages/kbn-ebt-tools/package.json @@ -4,5 +4,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts b/packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts index ed971118687c3..f9aecd2bd7ec9 100644 --- a/packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts +++ b/packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts @@ -28,7 +28,7 @@ export function registerPerformanceMetricEventType( /** * Report a `performance_metric` event type. * @param analytics The {@link AnalyticsClient} to report the events. - * @param eventData The data to send, conforming the structure of a {@link MetricEvent}. + * @param eventData The data to send, conforming the structure of a {@link PerformanceMetricEvent}. */ export function reportPerformanceMetricEvent( analytics: Pick, diff --git a/packages/kbn-ebt-tools/src/performance_metric_events/index.ts b/packages/kbn-ebt-tools/src/performance_metric_events/index.ts index 0002b082754dd..d081f6f331d98 100644 --- a/packages/kbn-ebt-tools/src/performance_metric_events/index.ts +++ b/packages/kbn-ebt-tools/src/performance_metric_events/index.ts @@ -5,8 +5,5 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -export type { PerformanceMetricEvent as MetricEvent } from './schema'; -export { - registerPerformanceMetricEventType as registerPerformanceMetricEventType, - reportPerformanceMetricEvent, -} from './helpers'; +export type { PerformanceMetricEvent } from './schema'; +export { registerPerformanceMetricEventType, reportPerformanceMetricEvent } from './helpers'; diff --git a/packages/kbn-ebt-tools/tsconfig.json b/packages/kbn-ebt-tools/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-ebt-tools/tsconfig.json +++ b/packages/kbn-ebt-tools/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-es-archiver/BUILD.bazel b/packages/kbn-es-archiver/BUILD.bazel index 7b0f9f0346630..8358212331445 100644 --- a/packages/kbn-es-archiver/BUILD.bazel +++ b/packages/kbn-es-archiver/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-es-archiver" +PKG_DIRNAME = "kbn-es-archiver" PKG_REQUIRE_NAME = "@kbn/es-archiver" SOURCE_FILES = glob( @@ -87,25 +87,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -116,19 +121,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-es-archiver/package.json b/packages/kbn-es-archiver/package.json index ddd55875664e3..5fd04d0f1b693 100644 --- a/packages/kbn-es-archiver/package.json +++ b/packages/kbn-es-archiver/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", "private": "true", - "main": "target_node/index.js" + "main": "target_node/index.js", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-es-archiver/tsconfig.json b/packages/kbn-es-archiver/tsconfig.json index 1f9eaf542f1cc..57c1dd1c94e0f 100644 --- a/packages/kbn-es-archiver/tsconfig.json +++ b/packages/kbn-es-archiver/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-es-errors/BUILD.bazel b/packages/kbn-es-errors/BUILD.bazel index 94ae9c962267e..0da72c1c13103 100644 --- a/packages/kbn-es-errors/BUILD.bazel +++ b/packages/kbn-es-errors/BUILD.bazel @@ -79,6 +79,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -90,17 +98,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-es-errors/package.json b/packages/kbn-es-errors/package.json index f47e1020bd140..91cd12e91b809 100644 --- a/packages/kbn-es-errors/package.json +++ b/packages/kbn-es-errors/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-es-errors/tsconfig.json b/packages/kbn-es-errors/tsconfig.json index 118bd3fb10818..57c1dd1c94e0f 100644 --- a/packages/kbn-es-errors/tsconfig.json +++ b/packages/kbn-es-errors/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-es-query/BUILD.bazel b/packages/kbn-es-query/BUILD.bazel index 2a7c445c32aac..db68c064b560b 100644 --- a/packages/kbn-es-query/BUILD.bazel +++ b/packages/kbn-es-query/BUILD.bazel @@ -3,7 +3,7 @@ load("@npm//peggy:index.bzl", "peggy") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-es-query" +PKG_DIRNAME = "kbn-es-query" PKG_REQUIRE_NAME = "@kbn/es-query" SOURCE_FILES = glob( @@ -102,25 +102,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [":grammar"], deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES + [":grammar"], + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -131,19 +136,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-es-query/index.ts b/packages/kbn-es-query/index.ts index 43c660544bc90..4ea965ea4b7a8 100644 --- a/packages/kbn-es-query/index.ts +++ b/packages/kbn-es-query/index.ts @@ -22,6 +22,7 @@ export type { ExistsFilter, FieldFilter, Filter, + FilterItem, FilterCompareOptions, FilterMeta, LatLon, diff --git a/packages/kbn-es-query/package.json b/packages/kbn-es-query/package.json index b317ce4ca4c95..026ceae873e39 100644 --- a/packages/kbn-es-query/package.json +++ b/packages/kbn-es-query/package.json @@ -4,5 +4,6 @@ "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-es-query/tsconfig.json b/packages/kbn-es-query/tsconfig.json index b8c5f137f874b..292157c18591a 100644 --- a/packages/kbn-es-query/tsconfig.json +++ b/packages/kbn-es-query/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-es-types/BUILD.bazel b/packages/kbn-es-types/BUILD.bazel index 99ebf0cc1e688..77db3b126b120 100644 --- a/packages/kbn-es-types/BUILD.bazel +++ b/packages/kbn-es-types/BUILD.bazel @@ -66,7 +66,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -80,6 +79,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -91,17 +98,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-es-types/package.json b/packages/kbn-es-types/package.json index b0119ee1d53b2..1e5c960975672 100644 --- a/packages/kbn-es-types/package.json +++ b/packages/kbn-es-types/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-es-types/tsconfig.json b/packages/kbn-es-types/tsconfig.json index 81935b1385550..292157c18591a 100644 --- a/packages/kbn-es-types/tsconfig.json +++ b/packages/kbn-es-types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-es/BUILD.bazel b/packages/kbn-es/BUILD.bazel index 23ddda10f36e5..2aeaee4071d53 100644 --- a/packages/kbn-es/BUILD.bazel +++ b/packages/kbn-es/BUILD.bazel @@ -1,7 +1,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm") -PKG_BASE_NAME = "kbn-es" +PKG_DIRNAME = "kbn-es" PKG_REQUIRE_NAME = "@kbn/es" SOURCE_FILES = glob( @@ -57,7 +57,7 @@ jsts_transpiler( ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, @@ -66,9 +66,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-es/tsconfig.json b/packages/kbn-es/tsconfig.json index bfa142ccc520c..a47c95fc504e8 100644 --- a/packages/kbn-es/tsconfig.json +++ b/packages/kbn-es/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "outDir": "target/types" + "outDir": "target_types" }, "include": [ "**/*.ts", diff --git a/packages/kbn-eslint-config/BUILD.bazel b/packages/kbn-eslint-config/BUILD.bazel index 73f834f7d5f63..708136256498d 100644 --- a/packages/kbn-eslint-config/BUILD.bazel +++ b/packages/kbn-eslint-config/BUILD.bazel @@ -1,7 +1,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "pkg_npm") -PKG_BASE_NAME = "kbn-eslint-config" +PKG_DIRNAME = "kbn-eslint-config" PKG_REQUIRE_NAME = "@kbn/eslint-config" SOURCE_FILES = glob([ @@ -34,7 +34,7 @@ RUNTIME_DEPS = [ ] js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [ ":srcs", ], @@ -45,9 +45,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-eslint-plugin-disable/BUILD.bazel b/packages/kbn-eslint-plugin-disable/BUILD.bazel index c51c46e13dc2e..9fb19d53e2c18 100644 --- a/packages/kbn-eslint-plugin-disable/BUILD.bazel +++ b/packages/kbn-eslint-plugin-disable/BUILD.bazel @@ -86,7 +86,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -100,6 +99,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -111,17 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-eslint-plugin-disable/package.json b/packages/kbn-eslint-plugin-disable/package.json index f7dc82db82217..aab648cd1d4a1 100644 --- a/packages/kbn-eslint-plugin-disable/package.json +++ b/packages/kbn-eslint-plugin-disable/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-eslint-plugin-disable/tsconfig.json b/packages/kbn-eslint-plugin-disable/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-eslint-plugin-disable/tsconfig.json +++ b/packages/kbn-eslint-plugin-disable/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-eslint-plugin-eslint/BUILD.bazel b/packages/kbn-eslint-plugin-eslint/BUILD.bazel index c043c4e468db9..0bb2ff549c9f9 100644 --- a/packages/kbn-eslint-plugin-eslint/BUILD.bazel +++ b/packages/kbn-eslint-plugin-eslint/BUILD.bazel @@ -1,7 +1,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "pkg_npm") -PKG_BASE_NAME = "kbn-eslint-plugin-eslint" +PKG_DIRNAME = "kbn-eslint-plugin-eslint" PKG_REQUIRE_NAME = "@kbn/eslint-plugin-eslint" SOURCE_FILES = glob( @@ -46,7 +46,7 @@ RUNTIME_DEPS = [ ] js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [ ":srcs", ], @@ -57,9 +57,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-eslint-plugin-imports/BUILD.bazel b/packages/kbn-eslint-plugin-imports/BUILD.bazel index 06608d0a653cd..dab195054dda2 100644 --- a/packages/kbn-eslint-plugin-imports/BUILD.bazel +++ b/packages/kbn-eslint-plugin-imports/BUILD.bazel @@ -98,7 +98,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -112,6 +111,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -123,17 +130,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-eslint-plugin-imports/package.json b/packages/kbn-eslint-plugin-imports/package.json index 28f0c3ca199cf..bf29c788f4134 100644 --- a/packages/kbn-eslint-plugin-imports/package.json +++ b/packages/kbn-eslint-plugin-imports/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-eslint-plugin-imports/tsconfig.json b/packages/kbn-eslint-plugin-imports/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-eslint-plugin-imports/tsconfig.json +++ b/packages/kbn-eslint-plugin-imports/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-expect/BUILD.bazel b/packages/kbn-expect/BUILD.bazel index 415b402a3d05c..70ed34ad091ce 100644 --- a/packages/kbn-expect/BUILD.bazel +++ b/packages/kbn-expect/BUILD.bazel @@ -1,7 +1,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "pkg_npm") -PKG_BASE_NAME = "kbn-expect" +PKG_DIRNAME = "kbn-expect" PKG_REQUIRE_NAME = "@kbn/expect" SOURCE_FILES = glob([ @@ -22,7 +22,7 @@ NPM_MODULE_EXTRA_FILES = [ ] js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [ ":srcs", ], @@ -32,9 +32,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-failed-test-reporter-cli/BUILD.bazel b/packages/kbn-failed-test-reporter-cli/BUILD.bazel index a3ae8903169a3..18f84214fd460 100644 --- a/packages/kbn-failed-test-reporter-cli/BUILD.bazel +++ b/packages/kbn-failed-test-reporter-cli/BUILD.bazel @@ -85,7 +85,8 @@ jsts_transpiler( srcs = SRCS, build_pkg_name = package_name(), additional_args = [ - "--copy-files" + "--copy-files", + "--quiet" ], ) @@ -104,7 +105,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -118,6 +118,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -129,17 +137,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-failed-test-reporter-cli/package.json b/packages/kbn-failed-test-reporter-cli/package.json index daf9a58cd77d7..1aec5a4e73a09 100644 --- a/packages/kbn-failed-test-reporter-cli/package.json +++ b/packages/kbn-failed-test-reporter-cli/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-failed-test-reporter-cli/tsconfig.json b/packages/kbn-failed-test-reporter-cli/tsconfig.json index 81935b1385550..292157c18591a 100644 --- a/packages/kbn-failed-test-reporter-cli/tsconfig.json +++ b/packages/kbn-failed-test-reporter-cli/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-field-types/BUILD.bazel b/packages/kbn-field-types/BUILD.bazel index 1d5ca19241bba..c6186d28953da 100644 --- a/packages/kbn-field-types/BUILD.bazel +++ b/packages/kbn-field-types/BUILD.bazel @@ -3,7 +3,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library",) load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-field-types" +PKG_DIRNAME = "kbn-field-types" PKG_REQUIRE_NAME = "@kbn/field-types" SOURCE_FILES = glob( @@ -80,25 +80,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -109,19 +114,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-field-types/package.json b/packages/kbn-field-types/package.json index 14b842526d9bc..5e8205f07c8ec 100644 --- a/packages/kbn-field-types/package.json +++ b/packages/kbn-field-types/package.json @@ -4,5 +4,6 @@ "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", - "main": "./target_node/index.js" + "main": "./target_node/index.js", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-field-types/tsconfig.json b/packages/kbn-field-types/tsconfig.json index 0ea3964c901c8..1cc4616a7ee49 100644 --- a/packages/kbn-field-types/tsconfig.json +++ b/packages/kbn-field-types/tsconfig.json @@ -1,9 +1,8 @@ { "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "outDir": "./target_types", + "outDir": "target_types", "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "types": [ "jest", diff --git a/packages/kbn-find-used-node-modules/BUILD.bazel b/packages/kbn-find-used-node-modules/BUILD.bazel index 1af4e9354558f..f8ae0bb461b1a 100644 --- a/packages/kbn-find-used-node-modules/BUILD.bazel +++ b/packages/kbn-find-used-node-modules/BUILD.bazel @@ -91,7 +91,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -105,6 +104,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -116,17 +123,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-find-used-node-modules/package.json b/packages/kbn-find-used-node-modules/package.json index 138a77f3ed286..2d5c10aab3372 100644 --- a/packages/kbn-find-used-node-modules/package.json +++ b/packages/kbn-find-used-node-modules/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-find-used-node-modules/tsconfig.json b/packages/kbn-find-used-node-modules/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-find-used-node-modules/tsconfig.json +++ b/packages/kbn-find-used-node-modules/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-flot-charts/BUILD.bazel b/packages/kbn-flot-charts/BUILD.bazel index d819fa05c7d16..ec2655bc2bbf1 100644 --- a/packages/kbn-flot-charts/BUILD.bazel +++ b/packages/kbn-flot-charts/BUILD.bazel @@ -1,7 +1,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "pkg_npm") -PKG_BASE_NAME = "kbn-flot-charts" +PKG_DIRNAME = "kbn-flot-charts" PKG_REQUIRE_NAME = "@kbn/flot-charts" SOURCE_FILES = glob([ @@ -26,7 +26,7 @@ RUNTIME_DEPS = [ ] js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [ ":srcs", ], @@ -37,9 +37,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-ftr-common-functional-services/BUILD.bazel b/packages/kbn-ftr-common-functional-services/BUILD.bazel index 8085c75af4af1..37e6f35ae2405 100644 --- a/packages/kbn-ftr-common-functional-services/BUILD.bazel +++ b/packages/kbn-ftr-common-functional-services/BUILD.bazel @@ -86,7 +86,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -100,6 +99,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -111,17 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ftr-common-functional-services/index.ts b/packages/kbn-ftr-common-functional-services/index.ts index 950a860f7553f..8bad5e67102fd 100644 --- a/packages/kbn-ftr-common-functional-services/index.ts +++ b/packages/kbn-ftr-common-functional-services/index.ts @@ -19,3 +19,5 @@ export type EsArchiver = ProvidedType; import { EsProvider } from './services/es'; export type Es = ProvidedType; + +export type { FtrProviderContext } from './services/ftr_provider_context'; diff --git a/packages/kbn-ftr-common-functional-services/package.json b/packages/kbn-ftr-common-functional-services/package.json index 642a5a39c7141..0de1d379fff8a 100644 --- a/packages/kbn-ftr-common-functional-services/package.json +++ b/packages/kbn-ftr-common-functional-services/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-ftr-common-functional-services/tsconfig.json b/packages/kbn-ftr-common-functional-services/tsconfig.json index 81935b1385550..292157c18591a 100644 --- a/packages/kbn-ftr-common-functional-services/tsconfig.json +++ b/packages/kbn-ftr-common-functional-services/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-ftr-screenshot-filename/BUILD.bazel b/packages/kbn-ftr-screenshot-filename/BUILD.bazel index 5cbd3e2c87ac7..5ac795bfe2e03 100644 --- a/packages/kbn-ftr-screenshot-filename/BUILD.bazel +++ b/packages/kbn-ftr-screenshot-filename/BUILD.bazel @@ -84,7 +84,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -98,6 +97,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -109,17 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ftr-screenshot-filename/package.json b/packages/kbn-ftr-screenshot-filename/package.json index 8e3a9b1e57db4..060e1ca7018b2 100644 --- a/packages/kbn-ftr-screenshot-filename/package.json +++ b/packages/kbn-ftr-screenshot-filename/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-ftr-screenshot-filename/tsconfig.json b/packages/kbn-ftr-screenshot-filename/tsconfig.json index 81935b1385550..292157c18591a 100644 --- a/packages/kbn-ftr-screenshot-filename/tsconfig.json +++ b/packages/kbn-ftr-screenshot-filename/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-generate/BUILD.bazel b/packages/kbn-generate/BUILD.bazel index 098291d8a0877..3a470bc08ffb8 100644 --- a/packages/kbn-generate/BUILD.bazel +++ b/packages/kbn-generate/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-generate" +PKG_DIRNAME = "kbn-generate" PKG_REQUIRE_NAME = "@kbn/generate" SOURCE_FILES = glob( @@ -78,25 +78,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -107,19 +112,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-generate/package.json b/packages/kbn-generate/package.json index 8413023c99a2d..bd92463816cad 100644 --- a/packages/kbn-generate/package.json +++ b/packages/kbn-generate/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js" + "main": "./target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-generate/src/commands/package_command.ts b/packages/kbn-generate/src/commands/package_command.ts index ecfd2eb5f3d21..4d09ab45c9728 100644 --- a/packages/kbn-generate/src/commands/package_command.ts +++ b/packages/kbn-generate/src/commands/package_command.ts @@ -68,7 +68,6 @@ ${BAZEL_PACKAGE_DIRS.map((dir) => ` ./${dir}/*\n`).join throw createFlagError(`package id must start with @kbn/ and have no spaces`); } - const typePkgName = `@types/${pkgId.slice(1).replace('/', '__')}`; const web = !!flags.web; const dev = !!flags.dev; @@ -184,12 +183,6 @@ ${BAZEL_PACKAGE_DIRS.map((dir) => ` ./${dir}/*\n`).join addDeps[pkgId] = `link:bazel-bin/${normalizedRepoRelativeDir}`; delete removeDeps[pkgId]; - // for @types packages always remove from deps and add to devDeps - packageJson.devDependencies[ - typePkgName - ] = `link:bazel-bin/${normalizedRepoRelativeDir}/npm_module_types`; - delete packageJson.dependencies[typePkgName]; - await Fsp.writeFile(packageJsonPath, sortPackageJson(JSON.stringify(packageJson))); log.info('Updated package.json file'); diff --git a/packages/kbn-generate/templates/package/BUILD.bazel.ejs b/packages/kbn-generate/templates/package/BUILD.bazel.ejs index cb1d250f468e9..92a407eea682c 100644 --- a/packages/kbn-generate/templates/package/BUILD.bazel.ejs +++ b/packages/kbn-generate/templates/package/BUILD.bazel.ejs @@ -99,7 +99,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -113,6 +112,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + <%- pkg.web ? '[":target_node", ":target_web", ":tsc_types"]' : '[":target_node", ":tsc_types"]' %>, + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -124,15 +131,6 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - filegroup( name = "build_types", srcs = [":npm_module_types"], diff --git a/packages/kbn-generate/templates/package/package.json.ejs b/packages/kbn-generate/templates/package/package.json.ejs index 44f53c0a1324c..7ab4cb3dfc20f 100644 --- a/packages/kbn-generate/templates/package/package.json.ejs +++ b/packages/kbn-generate/templates/package/package.json.ejs @@ -3,7 +3,8 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js" + "main": "./target_node/index.js", + "types": "./target_types/index.d.ts" <%_ if (pkg.web) { %>, "browser": "./target_web/index.js" <%_ } %> diff --git a/packages/kbn-generate/templates/package/tsconfig.json.ejs b/packages/kbn-generate/templates/package/tsconfig.json.ejs index d32cb46b253df..2b1e544d34239 100644 --- a/packages/kbn-generate/templates/package/tsconfig.json.ejs +++ b/packages/kbn-generate/templates/package/tsconfig.json.ejs @@ -2,10 +2,8 @@ "extends": "<%- relativePathTo("tsconfig.bazel.json") %>", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ <%_ if (pkg.web) { _%> "jest", diff --git a/packages/kbn-generate/templates/packages_BUILD.bazel.ejs b/packages/kbn-generate/templates/packages_BUILD.bazel.ejs index 43dd306d3cbb7..2656c97ad40e5 100644 --- a/packages/kbn-generate/templates/packages_BUILD.bazel.ejs +++ b/packages/kbn-generate/templates/packages_BUILD.bazel.ejs @@ -25,13 +25,18 @@ filegroup( ], ) -# Grouping target to call all underlying packages build -# targets so we can build them all at once -# It will auto build all declared code packages and types packages +# Grouping target to call all underlying packages js builds filegroup( name = "build", srcs = [ - ":build_pkg_code", + ":build_pkg_code" + ], +) + +# Grouping target to call all underlying packages ts builds +filegroup( + name = "build_types", + srcs = [ ":build_pkg_types" ], ) diff --git a/packages/kbn-generate/tsconfig.json b/packages/kbn-generate/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-generate/tsconfig.json +++ b/packages/kbn-generate/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-get-repo-files/BUILD.bazel b/packages/kbn-get-repo-files/BUILD.bazel index 7285008285038..215dc3efda888 100644 --- a/packages/kbn-get-repo-files/BUILD.bazel +++ b/packages/kbn-get-repo-files/BUILD.bazel @@ -85,7 +85,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -99,6 +98,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -110,17 +117,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-get-repo-files/package.json b/packages/kbn-get-repo-files/package.json index 21aa7c24d2b82..10613d821446b 100644 --- a/packages/kbn-get-repo-files/package.json +++ b/packages/kbn-get-repo-files/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-get-repo-files/tsconfig.json b/packages/kbn-get-repo-files/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-get-repo-files/tsconfig.json +++ b/packages/kbn-get-repo-files/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-guided-onboarding/BUILD.bazel b/packages/kbn-guided-onboarding/BUILD.bazel index b36e63daa8221..9e3bde78c5d23 100644 --- a/packages/kbn-guided-onboarding/BUILD.bazel +++ b/packages/kbn-guided-onboarding/BUILD.bazel @@ -111,7 +111,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -125,6 +124,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -136,17 +143,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-guided-onboarding/index.ts b/packages/kbn-guided-onboarding/index.ts index 2bb4e91906cfd..b22a8a2057c16 100644 --- a/packages/kbn-guided-onboarding/index.ts +++ b/packages/kbn-guided-onboarding/index.ts @@ -6,6 +6,13 @@ * Side Public License, v 1. */ -export type { GuideState, GuideId } from './src/types'; +export type { + GuideState, + GuideId, + GuideStepIds, + StepStatus, + GuideStep, + GuideStatus, +} from './src/types'; export { GuideCard, ObservabilityLinkCard } from './src/components/landing_page'; export type { UseCase } from './src/components/landing_page'; diff --git a/packages/kbn-guided-onboarding/package.json b/packages/kbn-guided-onboarding/package.json index 5838833e14277..f0f92c8a130e4 100644 --- a/packages/kbn-guided-onboarding/package.json +++ b/packages/kbn-guided-onboarding/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-guided-onboarding/src/components/landing_page/__snapshots__/guide_card_footer.test.tsx.snap b/packages/kbn-guided-onboarding/src/components/landing_page/__snapshots__/guide_card_footer.test.tsx.snap index 9b18465e91be9..cbb21df42a054 100644 --- a/packages/kbn-guided-onboarding/src/components/landing_page/__snapshots__/guide_card_footer.test.tsx.snap +++ b/packages/kbn-guided-onboarding/src/components/landing_page/__snapshots__/guide_card_footer.test.tsx.snap @@ -44,6 +44,19 @@ exports[`guide card footer snapshots should render the footer when the guide is
diff --git a/packages/kbn-guided-onboarding/src/components/landing_page/use_case_card.tsx b/packages/kbn-guided-onboarding/src/components/landing_page/use_case_card.tsx index ef9373996297c..574b9b18bf2b3 100644 --- a/packages/kbn-guided-onboarding/src/components/landing_page/use_case_card.tsx +++ b/packages/kbn-guided-onboarding/src/components/landing_page/use_case_card.tsx @@ -9,7 +9,6 @@ import React, { ReactNode } from 'react'; import { EuiCard, EuiText, EuiImage } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { GuideId } from '../../types'; type UseCaseConstants = { [key in UseCase]: { @@ -53,7 +52,7 @@ const constants: UseCaseConstants = { export type UseCase = 'search' | 'observability' | 'security'; export interface UseCaseCardProps { - useCase: GuideId; + useCase: UseCase; title: string; description: string; footer: ReactNode; @@ -84,18 +83,13 @@ export const UseCaseCard = ({ ); - const descriptionElement = ( - -

{description}

-
- ); + return ( } title={titleElement} - description={descriptionElement} + description={description} footer={footer} betaBadgeProps={{ label: constants[useCase].betaBadgeLabel, diff --git a/packages/kbn-guided-onboarding/src/types.ts b/packages/kbn-guided-onboarding/src/types.ts index 9a307464cefb8..251ef7e8e744b 100644 --- a/packages/kbn-guided-onboarding/src/types.ts +++ b/packages/kbn-guided-onboarding/src/types.ts @@ -6,13 +6,14 @@ * Side Public License, v 1. */ -export type GuideId = 'observability' | 'security' | 'search'; +export type GuideId = 'observability' | 'security' | 'search' | 'testGuide'; -export type ObservabilityStepIds = 'add_data' | 'view_dashboard' | 'tour_observability'; -export type SecurityStepIds = 'add_data' | 'rules' | 'alertsCases'; -export type SearchStepIds = 'add_data' | 'browse_docs' | 'search_experience'; +type ObservabilityStepIds = 'add_data' | 'view_dashboard' | 'tour_observability'; +type SecurityStepIds = 'add_data' | 'rules' | 'alertsCases'; +type SearchStepIds = 'add_data' | 'search_experience'; +type TestGuideIds = 'step1' | 'step2' | 'step3'; -export type GuideStepIds = ObservabilityStepIds | SecurityStepIds | SearchStepIds; +export type GuideStepIds = ObservabilityStepIds | SecurityStepIds | SearchStepIds | TestGuideIds; export interface GuideState { guideId: GuideId; diff --git a/packages/kbn-guided-onboarding/tsconfig.json b/packages/kbn-guided-onboarding/tsconfig.json index a88e5af86e42a..16588a28c9bfb 100644 --- a/packages/kbn-guided-onboarding/tsconfig.json +++ b/packages/kbn-guided-onboarding/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/kbn-handlebars/BUILD.bazel b/packages/kbn-handlebars/BUILD.bazel index 4e3d283a0be8e..2588bbe7857c0 100644 --- a/packages/kbn-handlebars/BUILD.bazel +++ b/packages/kbn-handlebars/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-handlebars" +PKG_DIRNAME = "kbn-handlebars" PKG_REQUIRE_NAME = "@kbn/handlebars" TYPES_PKG_REQUIRE_NAME = "@types/kbn__handlebars" @@ -77,25 +77,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -106,19 +111,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-handlebars/tsconfig.json b/packages/kbn-handlebars/tsconfig.json index 1f9eaf542f1cc..57c1dd1c94e0f 100644 --- a/packages/kbn-handlebars/tsconfig.json +++ b/packages/kbn-handlebars/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-hapi-mocks/BUILD.bazel b/packages/kbn-hapi-mocks/BUILD.bazel index c5d50341a89cb..120a4fc0b0d9a 100644 --- a/packages/kbn-hapi-mocks/BUILD.bazel +++ b/packages/kbn-hapi-mocks/BUILD.bazel @@ -69,7 +69,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -83,6 +82,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -94,17 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-hapi-mocks/package.json b/packages/kbn-hapi-mocks/package.json index 9de2e541c5891..67968be611826 100644 --- a/packages/kbn-hapi-mocks/package.json +++ b/packages/kbn-hapi-mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-hapi-mocks/tsconfig.json b/packages/kbn-hapi-mocks/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-hapi-mocks/tsconfig.json +++ b/packages/kbn-hapi-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-i18n-react/BUILD.bazel b/packages/kbn-i18n-react/BUILD.bazel index efba43ef1cf34..644507b4a45b5 100644 --- a/packages/kbn-i18n-react/BUILD.bazel +++ b/packages/kbn-i18n-react/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-i18n-react" +PKG_DIRNAME = "kbn-i18n-react" PKG_REQUIRE_NAME = "@kbn/i18n-react" SOURCE_FILES = glob( @@ -82,25 +82,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -111,19 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-i18n-react/package.json b/packages/kbn-i18n-react/package.json index 4ea48c4745e3b..d0f23a32a555e 100644 --- a/packages/kbn-i18n-react/package.json +++ b/packages/kbn-i18n-react/package.json @@ -5,5 +5,6 @@ "version": "1.0.0", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-i18n-react/tsconfig.json b/packages/kbn-i18n-react/tsconfig.json index 5fb46504402a6..14bb804696bbd 100644 --- a/packages/kbn-i18n-react/tsconfig.json +++ b/packages/kbn-i18n-react/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-i18n/BUILD.bazel b/packages/kbn-i18n/BUILD.bazel index 90079be18cab2..1cf9837ec074b 100644 --- a/packages/kbn-i18n/BUILD.bazel +++ b/packages/kbn-i18n/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-i18n" +PKG_DIRNAME = "kbn-i18n" PKG_REQUIRE_NAME = "@kbn/i18n" SOURCE_FILES = glob( @@ -82,25 +82,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -111,19 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index 18f34463cc164..26a8aeb99dc34 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -5,5 +5,6 @@ "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", "author": "Kibana Core", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-i18n/tsconfig.json b/packages/kbn-i18n/tsconfig.json index d73cd8d4e6abf..90a2bc53a9b1c 100644 --- a/packages/kbn-i18n/tsconfig.json +++ b/packages/kbn-i18n/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-import-resolver/BUILD.bazel b/packages/kbn-import-resolver/BUILD.bazel index eeed5518da97a..c32b02f8ba821 100644 --- a/packages/kbn-import-resolver/BUILD.bazel +++ b/packages/kbn-import-resolver/BUILD.bazel @@ -95,7 +95,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -109,6 +108,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -120,17 +127,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-import-resolver/package.json b/packages/kbn-import-resolver/package.json index a809d48bc2410..bb114bbc01752 100644 --- a/packages/kbn-import-resolver/package.json +++ b/packages/kbn-import-resolver/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-import-resolver/tsconfig.json b/packages/kbn-import-resolver/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-import-resolver/tsconfig.json +++ b/packages/kbn-import-resolver/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-interpreter/BUILD.bazel b/packages/kbn-interpreter/BUILD.bazel index d711715d519c8..d20c34f71461d 100644 --- a/packages/kbn-interpreter/BUILD.bazel +++ b/packages/kbn-interpreter/BUILD.bazel @@ -3,7 +3,7 @@ load("@npm//peggy:index.bzl", "peggy") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-interpreter" +PKG_DIRNAME = "kbn-interpreter" PKG_REQUIRE_NAME = "@kbn/interpreter" SOURCE_FILES = glob( @@ -94,25 +94,30 @@ ts_project( deps = TYPES_DEPS, allow_js = True, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [":grammar"], deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES + [":grammar"], + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -123,19 +128,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-interpreter/package.json b/packages/kbn-interpreter/package.json index ca1f35c02874b..8f0f37663e004 100644 --- a/packages/kbn-interpreter/package.json +++ b/packages/kbn-interpreter/package.json @@ -5,5 +5,6 @@ "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-interpreter/tsconfig.json b/packages/kbn-interpreter/tsconfig.json index 929d49761b904..57eff16f422bb 100644 --- a/packages/kbn-interpreter/tsconfig.json +++ b/packages/kbn-interpreter/tsconfig.json @@ -1,12 +1,9 @@ { "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "allowJs": true, "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": true, + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-io-ts-utils/BUILD.bazel b/packages/kbn-io-ts-utils/BUILD.bazel index 48641035223e5..dd1b7b1d9250f 100644 --- a/packages/kbn-io-ts-utils/BUILD.bazel +++ b/packages/kbn-io-ts-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-io-ts-utils" +PKG_DIRNAME = "kbn-io-ts-utils" PKG_REQUIRE_NAME = "@kbn/io-ts-utils" SOURCE_FILES = glob( @@ -81,25 +81,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -110,19 +115,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-io-ts-utils/package.json b/packages/kbn-io-ts-utils/package.json index 806f3c46cf337..65fd13e605336 100644 --- a/packages/kbn-io-ts-utils/package.json +++ b/packages/kbn-io-ts-utils/package.json @@ -4,5 +4,6 @@ "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-io-ts-utils/tsconfig.json b/packages/kbn-io-ts-utils/tsconfig.json index e6381fc4edf9f..57c1dd1c94e0f 100644 --- a/packages/kbn-io-ts-utils/tsconfig.json +++ b/packages/kbn-io-ts-utils/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": false, + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-jest-serializers/BUILD.bazel b/packages/kbn-jest-serializers/BUILD.bazel index ce394cd8848a7..edfae6d725f9a 100644 --- a/packages/kbn-jest-serializers/BUILD.bazel +++ b/packages/kbn-jest-serializers/BUILD.bazel @@ -87,7 +87,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -101,6 +100,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -112,17 +119,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-jest-serializers/package.json b/packages/kbn-jest-serializers/package.json index 1f6642f0557fd..8c3ac00c0fd43 100644 --- a/packages/kbn-jest-serializers/package.json +++ b/packages/kbn-jest-serializers/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-jest-serializers/tsconfig.json b/packages/kbn-jest-serializers/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-jest-serializers/tsconfig.json +++ b/packages/kbn-jest-serializers/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-journeys/BUILD.bazel b/packages/kbn-journeys/BUILD.bazel index cfadfb4b8b4b7..b6c6f0ed2fbf2 100644 --- a/packages/kbn-journeys/BUILD.bazel +++ b/packages/kbn-journeys/BUILD.bazel @@ -93,7 +93,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -107,6 +106,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -118,17 +125,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-journeys/journey/journey_ftr_config.ts b/packages/kbn-journeys/journey/journey_ftr_config.ts index b0d8e33ad01c0..49c45482cdfeb 100644 --- a/packages/kbn-journeys/journey/journey_ftr_config.ts +++ b/packages/kbn-journeys/journey/journey_ftr_config.ts @@ -117,6 +117,9 @@ export function makeFtrConfigProvider( journeyName: config.getName(), ftrConfig: config.getRepoRelPath(), performancePhase: process.env.TEST_PERFORMANCE_PHASE, + branch: process.env.BUILDKITE_BRANCH, + gitRev: process.env.BUILDKITE_COMMIT, + ciBuildName: process.env.BUILDKITE_PIPELINE_SLUG, }) .flatMap(([key, value]) => (value == null ? [] : `${key}=${value}`)) .join(','), diff --git a/packages/kbn-journeys/journey/journey_ftr_harness.ts b/packages/kbn-journeys/journey/journey_ftr_harness.ts index c8e876ce2873e..7b9d8cc0266fc 100644 --- a/packages/kbn-journeys/journey/journey_ftr_harness.ts +++ b/packages/kbn-journeys/journey/journey_ftr_harness.ts @@ -118,7 +118,6 @@ export class JourneyFtrHarness { private async onSetup() { await Promise.all([ - this.setupApm(), this.setupBrowserAndPage(), asyncForEach(this.journeyConfig.getEsArchives(), async (esArchive) => { await this.esArchiver.load(esArchive); @@ -127,6 +126,10 @@ export class JourneyFtrHarness { await this.kibanaServer.importExport.load(kbnArchive); }), ]); + + // It is important that we start the APM transaction after we open the browser and all the test data is loaded + // so that the scalability data extractor can focus on just the APM data produced by Kibana running under test. + await this.setupApm(); } private async tearDownBrowserAndPage() { @@ -181,9 +184,12 @@ export class JourneyFtrHarness { } private async onTeardown() { + await this.tearDownBrowserAndPage(); + // It is important that we complete the APM transaction after we close the browser and before we start + // unloading the test data so that the scalability data extractor can focus on just the APM data produced + // by Kibana running under test. + await this.teardownApm(); await Promise.all([ - this.tearDownBrowserAndPage(), - this.teardownApm(), asyncForEach(this.journeyConfig.getEsArchives(), async (esArchive) => { await this.esArchiver.unload(esArchive); }), diff --git a/packages/kbn-journeys/journey/journey_screenshots.ts b/packages/kbn-journeys/journey/journey_screenshots.ts index adf1021fa163d..955d00ca4c372 100644 --- a/packages/kbn-journeys/journey/journey_screenshots.ts +++ b/packages/kbn-journeys/journey/journey_screenshots.ts @@ -92,7 +92,7 @@ export class JourneyScreenshots { await this.lock(async () => { const filename = FtrScreenshotFilename.create(`${step.index}-${step.name}-failure`); const fullscreenFilename = FtrScreenshotFilename.create( - `${step.index}-${step.name}-failure-fullscreen` + `${step.index}-${step.name.replace(/\s/g, '-')}-failure-fullscreen` ); this.#manifest.steps.push({ type: 'failure', @@ -113,7 +113,7 @@ export class JourneyScreenshots { await this.lock(async () => { const filename = FtrScreenshotFilename.create(`${step.index}-${step.name}`); const fullscreenFilename = FtrScreenshotFilename.create( - `${step.index}-${step.name}-fullscreen` + `${step.index}-${step.name.replace(/\s/g, '-')}-fullscreen` ); this.#manifest.steps.push({ type: 'success', diff --git a/packages/kbn-journeys/package.json b/packages/kbn-journeys/package.json index 06920a5ebd241..728e8e8bdebd7 100644 --- a/packages/kbn-journeys/package.json +++ b/packages/kbn-journeys/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-journeys/tsconfig.json b/packages/kbn-journeys/tsconfig.json index f4d18db9ffafa..d625ae13bf409 100644 --- a/packages/kbn-journeys/tsconfig.json +++ b/packages/kbn-journeys/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "mocha", "node" diff --git a/packages/kbn-kibana-manifest-schema/BUILD.bazel b/packages/kbn-kibana-manifest-schema/BUILD.bazel index 7c471f7197be9..c0a8ff97d7fe8 100644 --- a/packages/kbn-kibana-manifest-schema/BUILD.bazel +++ b/packages/kbn-kibana-manifest-schema/BUILD.bazel @@ -87,7 +87,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -101,6 +100,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -112,17 +119,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-kibana-manifest-schema/package.json b/packages/kbn-kibana-manifest-schema/package.json index 3bcb493067c9b..127b9fc74fad9 100644 --- a/packages/kbn-kibana-manifest-schema/package.json +++ b/packages/kbn-kibana-manifest-schema/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-kibana-manifest-schema/tsconfig.json b/packages/kbn-kibana-manifest-schema/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-kibana-manifest-schema/tsconfig.json +++ b/packages/kbn-kibana-manifest-schema/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-language-documentation-popover/BUILD.bazel b/packages/kbn-language-documentation-popover/BUILD.bazel index d596368bd91ee..86a6a03388a4a 100644 --- a/packages/kbn-language-documentation-popover/BUILD.bazel +++ b/packages/kbn-language-documentation-popover/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-language-documentation-popover" +PKG_DIRNAME = "kbn-language-documentation-popover" PKG_REQUIRE_NAME = "@kbn/language-documentation-popover" SOURCE_FILES = glob( @@ -94,25 +94,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_webpack"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_webpack", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -123,19 +128,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-language-documentation-popover/kibana.jsonc b/packages/kbn-language-documentation-popover/kibana.jsonc index 1c03d32e93d67..45b3f21296bd4 100644 --- a/packages/kbn-language-documentation-popover/kibana.jsonc +++ b/packages/kbn-language-documentation-popover/kibana.jsonc @@ -1,7 +1,7 @@ { "type": "shared-common", "id": "@kbn/language-documentation-popover", - "owner": "@elastic/kibana-vis-editors", + "owner": "@elastic/kibana-visualizations", "runtimeDeps": [], "typeDeps": [] } diff --git a/packages/kbn-language-documentation-popover/package.json b/packages/kbn-language-documentation-popover/package.json index 4c3b01d1e78b5..a710551dd0553 100644 --- a/packages/kbn-language-documentation-popover/package.json +++ b/packages/kbn-language-documentation-popover/package.json @@ -4,5 +4,6 @@ "browser": "./target_webpack/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-language-documentation-popover/tsconfig.json b/packages/kbn-language-documentation-popover/tsconfig.json index 283570b9ee68b..ab59ea0429ac2 100644 --- a/packages/kbn-language-documentation-popover/tsconfig.json +++ b/packages/kbn-language-documentation-popover/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node", diff --git a/packages/kbn-logging-mocks/BUILD.bazel b/packages/kbn-logging-mocks/BUILD.bazel index 1af99a6a62954..10dcbe3f69505 100644 --- a/packages/kbn-logging-mocks/BUILD.bazel +++ b/packages/kbn-logging-mocks/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-logging-mocks" +PKG_DIRNAME = "kbn-logging-mocks" PKG_REQUIRE_NAME = "@kbn/logging-mocks" SOURCE_FILES = glob( @@ -65,25 +65,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -94,19 +99,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-logging-mocks/package.json b/packages/kbn-logging-mocks/package.json index 38e1b1eb403bd..30bd2b81ce507 100644 --- a/packages/kbn-logging-mocks/package.json +++ b/packages/kbn-logging-mocks/package.json @@ -4,5 +4,6 @@ "private": true, "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js" + "main": "./target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-logging-mocks/src/logger.mock.ts b/packages/kbn-logging-mocks/src/logger.mock.ts index b5f1f409ee457..dd3303dda9410 100644 --- a/packages/kbn-logging-mocks/src/logger.mock.ts +++ b/packages/kbn-logging-mocks/src/logger.mock.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Logger } from '@kbn/logging'; +import type { Logger } from '@kbn/logging'; export type MockedLogger = jest.Mocked & { context: string[] }; @@ -21,11 +21,13 @@ const createLoggerMock = (context: string[] = []) => { trace: jest.fn(), warn: jest.fn(), get: jest.fn(), + isLevelEnabled: jest.fn(), }; mockLog.get.mockImplementation((...ctx) => ({ ctx, ...mockLog, })); + mockLog.isLevelEnabled.mockReturnValue(true); return mockLog; }; diff --git a/packages/kbn-logging-mocks/tsconfig.json b/packages/kbn-logging-mocks/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-logging-mocks/tsconfig.json +++ b/packages/kbn-logging-mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-logging/BUILD.bazel b/packages/kbn-logging/BUILD.bazel index 4d7668cc09650..2bc2c6d05eb0e 100644 --- a/packages/kbn-logging/BUILD.bazel +++ b/packages/kbn-logging/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-logging" +PKG_DIRNAME = "kbn-logging" PKG_REQUIRE_NAME = "@kbn/logging" SOURCE_FILES = glob( @@ -67,25 +67,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -96,19 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-logging/index.ts b/packages/kbn-logging/index.ts index 868e995a6c498..1f0e992f08a7a 100644 --- a/packages/kbn-logging/index.ts +++ b/packages/kbn-logging/index.ts @@ -14,4 +14,11 @@ export type { LogMeta } from './src/log_meta'; export type { LoggerFactory } from './src/logger_factory'; export type { Layout } from './src/layout'; export type { Appender, DisposableAppender } from './src/appenders'; -export type { Ecs, EcsEventCategory, EcsEventKind, EcsEventOutcome, EcsEventType } from './src/ecs'; +export type { + Ecs, + EcsEvent, + EcsEventCategory, + EcsEventKind, + EcsEventOutcome, + EcsEventType, +} from './src/ecs'; diff --git a/packages/kbn-logging/package.json b/packages/kbn-logging/package.json index 7b3b64b44d947..837a9aab94981 100644 --- a/packages/kbn-logging/package.json +++ b/packages/kbn-logging/package.json @@ -4,5 +4,6 @@ "private": true, "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js" + "main": "./target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-logging/src/ecs/index.ts b/packages/kbn-logging/src/ecs/index.ts index 693e16c73a434..2e472185708ec 100644 --- a/packages/kbn-logging/src/ecs/index.ts +++ b/packages/kbn-logging/src/ecs/index.ts @@ -45,7 +45,13 @@ import { EcsUser } from './user'; import { EcsUserAgent } from './user_agent'; import { EcsVulnerability } from './vulnerability'; -export type { EcsEventCategory, EcsEventKind, EcsEventOutcome, EcsEventType } from './event'; +export type { + EcsEvent, + EcsEventCategory, + EcsEventKind, + EcsEventOutcome, + EcsEventType, +} from './event'; interface EcsField { /** diff --git a/packages/kbn-logging/src/logger.ts b/packages/kbn-logging/src/logger.ts index fda3cf45b9d79..bd31d4c42f805 100644 --- a/packages/kbn-logging/src/logger.ts +++ b/packages/kbn-logging/src/logger.ts @@ -6,8 +6,9 @@ * Side Public License, v 1. */ -import { LogMeta } from './log_meta'; -import { LogRecord } from './log_record'; +import type { LogMeta } from './log_meta'; +import type { LogRecord } from './log_record'; +import type { LogLevelId } from './log_level'; /** * Logger exposes all the necessary methods to log any type of information and @@ -64,6 +65,22 @@ export interface Logger { /** @internal */ log(record: LogRecord): void; + /** + * Checks if given level is currently enabled for this logger. + * Can be used to wrap expensive logging operations into conditional blocks + * + * @example + * ```ts + * if(logger.isLevelEnabled('info')) { + * const meta = await someExpensiveOperation(); + * logger.info('some message', meta); + * } + * ``` + * + * @param level The log level to check for. + */ + isLevelEnabled(level: LogLevelId): boolean; + /** * Returns a new {@link Logger} instance extending the current logger context. * diff --git a/packages/kbn-logging/tsconfig.json b/packages/kbn-logging/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-logging/tsconfig.json +++ b/packages/kbn-logging/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-managed-vscode-config-cli/BUILD.bazel b/packages/kbn-managed-vscode-config-cli/BUILD.bazel index f403baed4049d..a6ebbf057fc99 100644 --- a/packages/kbn-managed-vscode-config-cli/BUILD.bazel +++ b/packages/kbn-managed-vscode-config-cli/BUILD.bazel @@ -87,7 +87,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -101,6 +100,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -112,17 +119,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-managed-vscode-config-cli/package.json b/packages/kbn-managed-vscode-config-cli/package.json index ba4086c773eee..ad22c98077e23 100644 --- a/packages/kbn-managed-vscode-config-cli/package.json +++ b/packages/kbn-managed-vscode-config-cli/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-managed-vscode-config-cli/tsconfig.json b/packages/kbn-managed-vscode-config-cli/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-managed-vscode-config-cli/tsconfig.json +++ b/packages/kbn-managed-vscode-config-cli/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-managed-vscode-config/BUILD.bazel b/packages/kbn-managed-vscode-config/BUILD.bazel index a31f34509fec8..1225a95d6c3ff 100644 --- a/packages/kbn-managed-vscode-config/BUILD.bazel +++ b/packages/kbn-managed-vscode-config/BUILD.bazel @@ -89,7 +89,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -103,6 +102,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -114,17 +121,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-managed-vscode-config/package.json b/packages/kbn-managed-vscode-config/package.json index cc337813a7300..9e260b8a64a58 100644 --- a/packages/kbn-managed-vscode-config/package.json +++ b/packages/kbn-managed-vscode-config/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-managed-vscode-config/tsconfig.json b/packages/kbn-managed-vscode-config/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-managed-vscode-config/tsconfig.json +++ b/packages/kbn-managed-vscode-config/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-mapbox-gl/BUILD.bazel b/packages/kbn-mapbox-gl/BUILD.bazel index a55f5f77897d7..d72e79f8f5397 100644 --- a/packages/kbn-mapbox-gl/BUILD.bazel +++ b/packages/kbn-mapbox-gl/BUILD.bazel @@ -3,7 +3,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-mapbox-gl" +PKG_DIRNAME = "kbn-mapbox-gl" PKG_REQUIRE_NAME = "@kbn/mapbox-gl" SOURCE_FILES = glob( @@ -77,25 +77,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -106,19 +111,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-mapbox-gl/package.json b/packages/kbn-mapbox-gl/package.json index f0a5c7eabdfcb..e21ea665ef26f 100644 --- a/packages/kbn-mapbox-gl/package.json +++ b/packages/kbn-mapbox-gl/package.json @@ -4,5 +4,6 @@ "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", - "main": "./target_node/index.js" + "main": "./target_node/index.js", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-mapbox-gl/tsconfig.json b/packages/kbn-mapbox-gl/tsconfig.json index 1700b44fb54eb..6a59fac1e0248 100644 --- a/packages/kbn-mapbox-gl/tsconfig.json +++ b/packages/kbn-mapbox-gl/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [] diff --git a/packages/kbn-monaco/BUILD.bazel b/packages/kbn-monaco/BUILD.bazel index 2ed705e1c81c3..5648c71f6a281 100644 --- a/packages/kbn-monaco/BUILD.bazel +++ b/packages/kbn-monaco/BUILD.bazel @@ -3,7 +3,7 @@ load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-monaco" +PKG_DIRNAME = "kbn-monaco" PKG_REQUIRE_NAME = "@kbn/monaco" SOURCE_FILES = glob( @@ -106,25 +106,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web", ":target_workers"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":target_workers", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -135,19 +140,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-monaco/package.json b/packages/kbn-monaco/package.json index 7761c5a923fdc..71c9cbb7fb62d 100644 --- a/packages/kbn-monaco/package.json +++ b/packages/kbn-monaco/package.json @@ -7,5 +7,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "scripts": { "build:antlr4ts": "../../node_modules/antlr4ts-cli/antlr4ts ./src/painless/antlr/painless_lexer.g4 ./src/painless/antlr/painless_parser.g4 && node ./scripts/fix_generated_antlr.js" - } + }, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-monaco/src/helpers.ts b/packages/kbn-monaco/src/helpers.ts index 25040bc1a55f1..defdd00d6fdc1 100644 --- a/packages/kbn-monaco/src/helpers.ts +++ b/packages/kbn-monaco/src/helpers.ts @@ -12,10 +12,12 @@ function registerLanguage(language: LangModuleType) { const { ID, lexerRules, languageConfiguration } = language; monaco.languages.register({ id: ID }); - monaco.languages.setMonarchTokensProvider(ID, lexerRules); - if (languageConfiguration) { - monaco.languages.setLanguageConfiguration(ID, languageConfiguration); - } + monaco.languages.onLanguage(ID, () => { + monaco.languages.setMonarchTokensProvider(ID, lexerRules); + if (languageConfiguration) { + monaco.languages.setLanguageConfiguration(ID, languageConfiguration); + } + }); } export { registerLanguage }; diff --git a/packages/kbn-monaco/src/monaco_imports.ts b/packages/kbn-monaco/src/monaco_imports.ts index 6a08c25b6347a..07a24c8c8bd2e 100644 --- a/packages/kbn-monaco/src/monaco_imports.ts +++ b/packages/kbn-monaco/src/monaco_imports.ts @@ -23,6 +23,7 @@ import 'monaco-editor/esm/vs/editor/contrib/hover/hover.js'; // Needed for hover import 'monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.js'; // Needed for signature import 'monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.js'; // Needed for brackets matching highlight +import 'monaco-editor/esm/vs/language/json/monaco.contribution.js'; import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js'; // Needed for basic javascript support import 'monaco-editor/esm/vs/basic-languages/xml/xml.contribution.js'; // Needed for basic xml support diff --git a/packages/kbn-monaco/src/painless/diagnostics_adapter.test.ts b/packages/kbn-monaco/src/painless/diagnostics_adapter.test.ts index 5d00ad726d031..7af335ed46987 100644 --- a/packages/kbn-monaco/src/painless/diagnostics_adapter.test.ts +++ b/packages/kbn-monaco/src/painless/diagnostics_adapter.test.ts @@ -24,9 +24,8 @@ const getMockWorker = async () => { } as any; }; -function flushPromises() { - return new Promise((resolve) => setImmediate(resolve)); -} +const flushPromises = () => + new Promise((resolve) => jest.requireActual('timers').setImmediate(resolve)); describe('Painless DiagnosticAdapter', () => { let diagnosticAdapter: DiagnosticsAdapter; @@ -35,7 +34,7 @@ describe('Painless DiagnosticAdapter', () => { let validation: LangValidation; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/packages/kbn-monaco/src/register_globals.ts b/packages/kbn-monaco/src/register_globals.ts index 54fc26cbf76dd..8a69b05b9425f 100644 --- a/packages/kbn-monaco/src/register_globals.ts +++ b/packages/kbn-monaco/src/register_globals.ts @@ -12,11 +12,9 @@ import { EsqlLang } from './esql'; import { monaco } from './monaco_imports'; import { registerLanguage } from './helpers'; -// @ts-ignore +import jsonWorkerSrc from '!!raw-loader!../../target_workers/json.editor.worker.js'; import xJsonWorkerSrc from '!!raw-loader!../../target_workers/xjson.editor.worker.js'; -// @ts-ignore import defaultWorkerSrc from '!!raw-loader!../../target_workers/default.editor.worker.js'; -// @ts-ignore import painlessWorkerSrc from '!!raw-loader!../../target_workers/painless.editor.worker.js'; /** @@ -32,6 +30,7 @@ registerLanguage(EsqlLang); const mapLanguageIdToWorker: { [key: string]: any } = { [XJsonLang.ID]: xJsonWorkerSrc, [PainlessLang.ID]: painlessWorkerSrc, + [monaco.languages.json.jsonDefaults.languageId]: jsonWorkerSrc, }; // @ts-ignore diff --git a/packages/kbn-monaco/src/worker.d.ts b/packages/kbn-monaco/src/worker.d.ts new file mode 100644 index 0000000000000..6544070c684d8 --- /dev/null +++ b/packages/kbn-monaco/src/worker.d.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +declare module '!!raw-loader!*.editor.worker.js' { + const contents: string; + + // eslint-disable-next-line import/no-default-export + export default contents; +} diff --git a/packages/kbn-monaco/src/xjson/language.ts b/packages/kbn-monaco/src/xjson/language.ts index 017ae0a8c590b..6ec9b1149c707 100644 --- a/packages/kbn-monaco/src/xjson/language.ts +++ b/packages/kbn-monaco/src/xjson/language.ts @@ -12,16 +12,12 @@ import { monaco } from '../monaco_imports'; import { WorkerProxyService } from './worker_proxy_service'; import { ID } from './constants'; -const wps = new WorkerProxyService(); +const OWNER = 'XJSON_GRAMMAR_CHECKER'; monaco.languages.onLanguage(ID, async () => { - return wps.setup(); -}); - -const OWNER = 'XJSON_GRAMMAR_CHECKER'; + const wps = new WorkerProxyService(); -export const registerGrammarChecker = () => { - const allDisposables: monaco.IDisposable[] = []; + wps.setup(); const updateAnnotations = async (model: monaco.editor.IModel): Promise => { if (model.isDisposed()) { @@ -50,21 +46,20 @@ export const registerGrammarChecker = () => { }; const onModelAdd = (model: monaco.editor.IModel) => { - if (model.getModeId() === ID) { - allDisposables.push( - model.onDidChangeContent(async () => { - updateAnnotations(model); - }) - ); + if (model.getModeId() !== ID) { + return; + } + const { dispose } = model.onDidChangeContent(async () => { updateAnnotations(model); - } - }; - allDisposables.push(monaco.editor.onDidCreateModel(onModelAdd)); - return () => { - wps.stop(); - allDisposables.forEach((d) => d.dispose()); + }); + + model.onWillDispose(() => { + dispose(); + }); + + updateAnnotations(model); }; -}; -registerGrammarChecker(); + monaco.editor.onDidCreateModel(onModelAdd); +}); diff --git a/packages/kbn-monaco/tsconfig.json b/packages/kbn-monaco/tsconfig.json index 7787b024c1375..abba6736b0c28 100644 --- a/packages/kbn-monaco/tsconfig.json +++ b/packages/kbn-monaco/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-monaco/webpack.config.js b/packages/kbn-monaco/webpack.config.js index d35c60b155475..8c6f82cdb21f5 100644 --- a/packages/kbn-monaco/webpack.config.js +++ b/packages/kbn-monaco/webpack.config.js @@ -8,43 +8,43 @@ const path = require('path'); -const createLangWorkerConfig = (lang) => { - const entry = - lang === 'default' - ? 'monaco-editor/esm/vs/editor/editor.worker.js' - : path.resolve(__dirname, 'src', lang, 'worker', `${lang}.worker.ts`); +const getWorkerEntry = (language) => { + switch (language) { + case 'default': + return 'monaco-editor/esm/vs/editor/editor.worker.js'; + case 'json': + return 'monaco-editor/esm/vs/language/json/json.worker.js'; + default: + return path.resolve(__dirname, 'src', language, 'worker', `${language}.worker.ts`); + } +}; - return { - mode: 'production', - entry, - output: { - path: path.resolve(__dirname, 'target_workers'), - filename: `${lang}.editor.worker.js`, - }, - resolve: { - extensions: ['.js', '.ts', '.tsx'], - }, - stats: 'errors-only', - module: { - rules: [ - { - test: /\.(js|ts)$/, - exclude: /node_modules/, - use: { - loader: 'babel-loader', - options: { - babelrc: false, - presets: [require.resolve('@kbn/babel-preset/webpack_preset')], - }, +const getWorkerConfig = (language) => ({ + mode: 'production', + entry: getWorkerEntry(language), + output: { + path: path.resolve(__dirname, 'target_workers'), + filename: `${language}.editor.worker.js`, + }, + resolve: { + extensions: ['.js', '.ts', '.tsx'], + }, + stats: 'errors-only', + module: { + rules: [ + { + test: /\.(js|ts)$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader', + options: { + babelrc: false, + presets: [require.resolve('@kbn/babel-preset/webpack_preset')], }, }, - ], - }, - }; -}; + }, + ], + }, +}); -module.exports = [ - createLangWorkerConfig('xjson'), - createLangWorkerConfig('painless'), - createLangWorkerConfig('default'), -]; +module.exports = ['default', 'json', 'painless', 'xjson'].map(getWorkerConfig); diff --git a/packages/kbn-optimizer-webpack-helpers/BUILD.bazel b/packages/kbn-optimizer-webpack-helpers/BUILD.bazel index 1819a7190e422..e0a5d2fda7e2e 100644 --- a/packages/kbn-optimizer-webpack-helpers/BUILD.bazel +++ b/packages/kbn-optimizer-webpack-helpers/BUILD.bazel @@ -84,7 +84,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -98,6 +97,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -109,17 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-optimizer-webpack-helpers/package.json b/packages/kbn-optimizer-webpack-helpers/package.json index a37b5ba48ee48..52f873cc9ee80 100644 --- a/packages/kbn-optimizer-webpack-helpers/package.json +++ b/packages/kbn-optimizer-webpack-helpers/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-optimizer-webpack-helpers/tsconfig.json b/packages/kbn-optimizer-webpack-helpers/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-optimizer-webpack-helpers/tsconfig.json +++ b/packages/kbn-optimizer-webpack-helpers/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-optimizer/BUILD.bazel b/packages/kbn-optimizer/BUILD.bazel index 0701fa141dd9a..4906af1ad6f6c 100644 --- a/packages/kbn-optimizer/BUILD.bazel +++ b/packages/kbn-optimizer/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-optimizer" +PKG_DIRNAME = "kbn-optimizer" PKG_REQUIRE_NAME = "@kbn/optimizer" SOURCE_FILES = glob( @@ -126,25 +126,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -155,19 +160,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 49b1d6b8cc736..50b5b9e3e782a 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -27,7 +27,7 @@ pageLoadAssetSize: dataViewEditor: 12000 dataViewFieldEditor: 27000 dataViewManagement: 5000 - dataViews: 46532 + dataViews: 46600 dataVisualizer: 27530 devTools: 38637 discover: 99999 diff --git a/packages/kbn-optimizer/package.json b/packages/kbn-optimizer/package.json index a7d8a50927634..488e1b5dbfde8 100644 --- a/packages/kbn-optimizer/package.json +++ b/packages/kbn-optimizer/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js" + "main": "./target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-optimizer/src/common/rxjs_helpers.test.ts b/packages/kbn-optimizer/src/common/rxjs_helpers.test.ts index 694a606883957..c280890f2dff3 100644 --- a/packages/kbn-optimizer/src/common/rxjs_helpers.test.ts +++ b/packages/kbn-optimizer/src/common/rxjs_helpers.test.ts @@ -11,7 +11,7 @@ import { fakeSchedulers } from 'rxjs-marbles/jest'; import { pipeClosure, debounceTimeBuffer, maybeMap, maybe } from './rxjs_helpers'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); describe('pipeClosure()', () => { it('calls closure on each subscription to setup unique state', async () => { @@ -70,7 +70,7 @@ describe('maybeMap()', () => { describe('debounceTimeBuffer()', () => { beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterEach(() => { diff --git a/packages/kbn-optimizer/src/integration_tests/watch_bundles_for_changes.test.ts b/packages/kbn-optimizer/src/integration_tests/watch_bundles_for_changes.test.ts index 91a2f7324806a..08f6cdc61bce3 100644 --- a/packages/kbn-optimizer/src/integration_tests/watch_bundles_for_changes.test.ts +++ b/packages/kbn-optimizer/src/integration_tests/watch_bundles_for_changes.test.ts @@ -58,7 +58,7 @@ const bundleCacheEvent$ = Rx.from(BUNDLES).pipe( ); beforeEach(async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterEach(async () => { diff --git a/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts b/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts index 2710ba8a54210..6aa11a3f7020f 100644 --- a/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts +++ b/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts @@ -41,6 +41,7 @@ import * as babel from '@babel/core'; import { addHook } from 'pirates'; import { REPO_ROOT, UPSTREAM_BRANCH } from '@kbn/utils'; import sourceMapSupport from 'source-map-support'; +import { readHashOfPackageMap } from '@kbn/synthetic-package-map'; import { Cache } from './cache'; @@ -83,6 +84,7 @@ function getBabelOptions(path: string) { */ function determineCachePrefix() { const json = JSON.stringify({ + synthPkgMapHash: readHashOfPackageMap(), babelVersion: babel.version, // get a config for a fake js, ts, and tsx file to make sure we // capture conditional config portions based on the file extension @@ -135,7 +137,7 @@ export function registerNodeAutoTranspilation() { const cache = new Cache({ pathRoot: REPO_ROOT, - dir: Path.resolve(REPO_ROOT, 'data/node_auto_transpilation_cache_v3', UPSTREAM_BRANCH), + dir: Path.resolve(REPO_ROOT, 'data/node_auto_transpilation_cache_v4', UPSTREAM_BRANCH), prefix: determineCachePrefix(), log: process.env.DEBUG_NODE_TRANSPILER_CACHE ? Fs.createWriteStream(Path.resolve(REPO_ROOT, 'node_auto_transpilation_cache.log'), { diff --git a/packages/kbn-optimizer/src/optimizer/observe_worker.ts b/packages/kbn-optimizer/src/optimizer/observe_worker.ts index 338f64a63b3d7..b73e441671eaf 100644 --- a/packages/kbn-optimizer/src/optimizer/observe_worker.ts +++ b/packages/kbn-optimizer/src/optimizer/observe_worker.ts @@ -74,7 +74,6 @@ function usingWorkerProc( ...(inspectFlag && config.inspectWorkers ? [`${inspectFlag}=${inspectPortCounter++}`] : []), - ...(config.maxWorkerCount <= 3 ? ['--max-old-space-size=2048'] : []), ], buffer: false, stderr: 'pipe', diff --git a/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.test.ts b/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.test.ts index 1cfc1b184d87a..d22ba95282002 100644 --- a/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.test.ts +++ b/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.test.ts @@ -23,7 +23,7 @@ jest.mock('@kbn/synthetic-package-map', () => { jest.mock('../common/hashes', () => { return { Hashes: class MockHashes { - static ofFiles = jest.fn(() => { + static ofFiles: any = jest.fn(() => { return new MockHashes(); }); diff --git a/packages/kbn-optimizer/tsconfig.json b/packages/kbn-optimizer/tsconfig.json index ea94fe47d50fc..93c0f5ba2a57f 100644 --- a/packages/kbn-optimizer/tsconfig.json +++ b/packages/kbn-optimizer/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-osquery-io-ts-types/BUILD.bazel b/packages/kbn-osquery-io-ts-types/BUILD.bazel index 0d5ed0c6fe99c..80390c1de4b0a 100644 --- a/packages/kbn-osquery-io-ts-types/BUILD.bazel +++ b/packages/kbn-osquery-io-ts-types/BUILD.bazel @@ -86,7 +86,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -100,6 +99,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -111,17 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-osquery-io-ts-types/package.json b/packages/kbn-osquery-io-ts-types/package.json index 18fcced429c59..49b11c73a039a 100644 --- a/packages/kbn-osquery-io-ts-types/package.json +++ b/packages/kbn-osquery-io-ts-types/package.json @@ -5,5 +5,6 @@ "description": "io ts utilities and types to be shared with plugins from the osquery project", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-osquery-io-ts-types/tsconfig.json b/packages/kbn-osquery-io-ts-types/tsconfig.json index 606fa32e5a836..292157c18591a 100644 --- a/packages/kbn-osquery-io-ts-types/tsconfig.json +++ b/packages/kbn-osquery-io-ts-types/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-performance-testing-dataset-extractor/BUILD.bazel b/packages/kbn-performance-testing-dataset-extractor/BUILD.bazel index 53782e9cfbd08..2b088b0cfdc4a 100644 --- a/packages/kbn-performance-testing-dataset-extractor/BUILD.bazel +++ b/packages/kbn-performance-testing-dataset-extractor/BUILD.bazel @@ -94,7 +94,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -108,6 +107,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -119,17 +126,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-performance-testing-dataset-extractor/package.json b/packages/kbn-performance-testing-dataset-extractor/package.json index 12073ed76f3ea..f4da970da1525 100644 --- a/packages/kbn-performance-testing-dataset-extractor/package.json +++ b/packages/kbn-performance-testing-dataset-extractor/package.json @@ -4,5 +4,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-performance-testing-dataset-extractor/tsconfig.json b/packages/kbn-performance-testing-dataset-extractor/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-performance-testing-dataset-extractor/tsconfig.json +++ b/packages/kbn-performance-testing-dataset-extractor/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-plugin-discovery/BUILD.bazel b/packages/kbn-plugin-discovery/BUILD.bazel index d6e9f09d23e1f..cdfcc23545c83 100644 --- a/packages/kbn-plugin-discovery/BUILD.bazel +++ b/packages/kbn-plugin-discovery/BUILD.bazel @@ -84,7 +84,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, allow_js = True, emit_declaration_only = True, out_dir = "target_types", @@ -99,6 +98,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -110,17 +117,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-plugin-discovery/index.js b/packages/kbn-plugin-discovery/index.js index 7b47cc94052a4..a88ae4dc8d0d6 100644 --- a/packages/kbn-plugin-discovery/index.js +++ b/packages/kbn-plugin-discovery/index.js @@ -6,6 +6,8 @@ * Side Public License, v 1. */ +/** @typedef {import('./src/types').KibanaPlatformPlugin} KibanaPlatformPlugin */ + const { parseKibanaPlatformPlugin } = require('./src/parse_kibana_platform_plugin'); const { getPluginSearchPaths } = require('./src/plugin_search_paths'); const { diff --git a/packages/kbn-plugin-discovery/package.json b/packages/kbn-plugin-discovery/package.json index 7758cd5773215..ff8f17b0fa2ce 100644 --- a/packages/kbn-plugin-discovery/package.json +++ b/packages/kbn-plugin-discovery/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-plugin-discovery/src/plugin_search_paths.js b/packages/kbn-plugin-discovery/src/plugin_search_paths.js index 6012f42a38ee1..b82e85a005c77 100644 --- a/packages/kbn-plugin-discovery/src/plugin_search_paths.js +++ b/packages/kbn-plugin-discovery/src/plugin_search_paths.js @@ -26,6 +26,7 @@ function getPluginSearchPaths({ rootDir, oss, examples, testPlugins }) { resolve(rootDir, 'test/plugin_functional/plugins'), resolve(rootDir, 'test/interpreter_functional/plugins'), resolve(rootDir, 'test/common/fixtures/plugins'), + resolve(rootDir, 'test/server_integration/__fixtures__/plugins'), ] : []), ...(testPlugins && !oss diff --git a/packages/kbn-plugin-discovery/tsconfig.json b/packages/kbn-plugin-discovery/tsconfig.json index aeada1a0d0272..e5578a8b0eeac 100644 --- a/packages/kbn-plugin-discovery/tsconfig.json +++ b/packages/kbn-plugin-discovery/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, - "allowJs": true, "checkJs": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-plugin-generator/BUILD.bazel b/packages/kbn-plugin-generator/BUILD.bazel index 587cd546d50fb..82a7c0f250ce3 100644 --- a/packages/kbn-plugin-generator/BUILD.bazel +++ b/packages/kbn-plugin-generator/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-plugin-generator" +PKG_DIRNAME = "kbn-plugin-generator" PKG_REQUIRE_NAME = "@kbn/plugin-generator" SOURCE_FILES = glob( @@ -95,25 +95,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -124,19 +129,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-plugin-generator/package.json b/packages/kbn-plugin-generator/package.json index 28b7e849ab3c1..add2a70f0e5be 100644 --- a/packages/kbn-plugin-generator/package.json +++ b/packages/kbn-plugin-generator/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "target_node/index.js" + "main": "target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-plugin-generator/tsconfig.json b/packages/kbn-plugin-generator/tsconfig.json index 9331b2056d687..70567fe331a27 100644 --- a/packages/kbn-plugin-generator/tsconfig.json +++ b/packages/kbn-plugin-generator/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "target": "ES2019", diff --git a/packages/kbn-plugin-helpers/BUILD.bazel b/packages/kbn-plugin-helpers/BUILD.bazel index 32f8f0a3720db..482b5bdf8b4d5 100644 --- a/packages/kbn-plugin-helpers/BUILD.bazel +++ b/packages/kbn-plugin-helpers/BUILD.bazel @@ -3,7 +3,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-plugin-helpers" +PKG_DIRNAME = "kbn-plugin-helpers" PKG_REQUIRE_NAME = "@kbn/plugin-helpers" SOURCE_FILES = glob( @@ -88,25 +88,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -117,19 +122,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-plugin-helpers/package.json b/packages/kbn-plugin-helpers/package.json index 206b3e77b39af..dc12d7ddb6b64 100644 --- a/packages/kbn-plugin-helpers/package.json +++ b/packages/kbn-plugin-helpers/package.json @@ -7,5 +7,6 @@ "main": "target_node/index.js", "bin": { "plugin-helpers": "bin/plugin-helpers.js" - } + }, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-plugin-helpers/tsconfig.json b/packages/kbn-plugin-helpers/tsconfig.json index d64baa32906cb..11089e8846334 100644 --- a/packages/kbn-plugin-helpers/tsconfig.json +++ b/packages/kbn-plugin-helpers/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "target": "ES2018", diff --git a/packages/kbn-react-field/BUILD.bazel b/packages/kbn-react-field/BUILD.bazel index ccc12245d323f..0437d78106355 100644 --- a/packages/kbn-react-field/BUILD.bazel +++ b/packages/kbn-react-field/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-react-field" +PKG_DIRNAME = "kbn-react-field" PKG_REQUIRE_NAME = "@kbn/react-field" SOURCE_FILES = glob( @@ -51,8 +51,8 @@ TYPES_DEPS = [ "@npm//@elastic/eui", "@npm//@types/classnames", "@npm//@types/jest", - "@npm//@types/prop-types", "@npm//@types/node", + "@npm//@types/prop-types", "@npm//@types/react", ] @@ -92,25 +92,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_webpack"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_webpack", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -121,19 +126,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-react-field/package.json b/packages/kbn-react-field/package.json index 832284b06ccfe..aae5d673b5fbd 100644 --- a/packages/kbn-react-field/package.json +++ b/packages/kbn-react-field/package.json @@ -4,5 +4,6 @@ "browser": "./target_webpack/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-react-field/tsconfig.json b/packages/kbn-react-field/tsconfig.json index 283570b9ee68b..ab59ea0429ac2 100644 --- a/packages/kbn-react-field/tsconfig.json +++ b/packages/kbn-react-field/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node", diff --git a/packages/kbn-repo-source-classifier-cli/BUILD.bazel b/packages/kbn-repo-source-classifier-cli/BUILD.bazel index d787c21c1291f..6706dc9aa2c13 100644 --- a/packages/kbn-repo-source-classifier-cli/BUILD.bazel +++ b/packages/kbn-repo-source-classifier-cli/BUILD.bazel @@ -95,7 +95,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -109,6 +108,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -120,17 +127,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-repo-source-classifier-cli/package.json b/packages/kbn-repo-source-classifier-cli/package.json index a8e0cea71bef6..490014811b834 100644 --- a/packages/kbn-repo-source-classifier-cli/package.json +++ b/packages/kbn-repo-source-classifier-cli/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-repo-source-classifier-cli/tsconfig.json b/packages/kbn-repo-source-classifier-cli/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-repo-source-classifier-cli/tsconfig.json +++ b/packages/kbn-repo-source-classifier-cli/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-repo-source-classifier/BUILD.bazel b/packages/kbn-repo-source-classifier/BUILD.bazel index 46ed3890b17f8..b143ea3f93121 100644 --- a/packages/kbn-repo-source-classifier/BUILD.bazel +++ b/packages/kbn-repo-source-classifier/BUILD.bazel @@ -86,7 +86,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -100,6 +99,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -111,17 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-repo-source-classifier/package.json b/packages/kbn-repo-source-classifier/package.json index a6f81d992b285..bda6886d162dd 100644 --- a/packages/kbn-repo-source-classifier/package.json +++ b/packages/kbn-repo-source-classifier/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-repo-source-classifier/tsconfig.json b/packages/kbn-repo-source-classifier/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-repo-source-classifier/tsconfig.json +++ b/packages/kbn-repo-source-classifier/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-rule-data-utils/BUILD.bazel b/packages/kbn-rule-data-utils/BUILD.bazel index 61146f0b5de31..fe77bd4443fe9 100644 --- a/packages/kbn-rule-data-utils/BUILD.bazel +++ b/packages/kbn-rule-data-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-rule-data-utils" +PKG_DIRNAME = "kbn-rule-data-utils" PKG_REQUIRE_NAME = "@kbn/rule-data-utils" SOURCE_FILES = glob( @@ -79,25 +79,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -108,19 +113,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-rule-data-utils/kibana.jsonc b/packages/kbn-rule-data-utils/kibana.jsonc index 0fe42f6cb6e3d..654155c883971 100644 --- a/packages/kbn-rule-data-utils/kibana.jsonc +++ b/packages/kbn-rule-data-utils/kibana.jsonc @@ -1,7 +1,11 @@ { "type": "shared-common", "id": "@kbn/rule-data-utils", - "owner": "@elastic/apm-ui", + "owner": [ + "@elastic/security-detections-response", + "@elastic/actionable-observability", + "@elastic/response-ops" + ], "runtimeDeps": [], "typeDeps": [] } diff --git a/packages/kbn-rule-data-utils/package.json b/packages/kbn-rule-data-utils/package.json index d11f65e294a48..9613e173d6f4a 100644 --- a/packages/kbn-rule-data-utils/package.json +++ b/packages/kbn-rule-data-utils/package.json @@ -4,5 +4,6 @@ "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-rule-data-utils/src/technical_field_names.ts b/packages/kbn-rule-data-utils/src/technical_field_names.ts index 672c25d4e8fab..0e61cba7511ac 100644 --- a/packages/kbn-rule-data-utils/src/technical_field_names.ts +++ b/packages/kbn-rule-data-utils/src/technical_field_names.ts @@ -12,6 +12,7 @@ const KIBANA_NAMESPACE = 'kibana' as const; const ALERT_NAMESPACE = `${KIBANA_NAMESPACE}.alert` as const; const ALERT_RULE_NAMESPACE = `${ALERT_NAMESPACE}.rule` as const; +const ALERT_RULE_THREAT_NAMESPACE = `${ALERT_RULE_NAMESPACE}.threat` as const; const ECS_VERSION = 'ecs.version' as const; const EVENT_ACTION = 'event.action' as const; @@ -68,6 +69,23 @@ const ALERT_RULE_TYPE_ID = `${ALERT_RULE_NAMESPACE}.rule_type_id` as const; const ALERT_RULE_UPDATED_AT = `${ALERT_RULE_NAMESPACE}.updated_at` as const; const ALERT_RULE_UPDATED_BY = `${ALERT_RULE_NAMESPACE}.updated_by` as const; const ALERT_RULE_VERSION = `${ALERT_RULE_NAMESPACE}.version` as const; + +// Fields pertaining to the threat tactic associated with the rule +const ALERT_THREAT_FRAMEWORK = `${ALERT_RULE_THREAT_NAMESPACE}.framework` as const; +const ALERT_THREAT_TACTIC_ID = `${ALERT_RULE_THREAT_NAMESPACE}.tactic.id` as const; +const ALERT_THREAT_TACTIC_NAME = `${ALERT_RULE_THREAT_NAMESPACE}.tactic.name` as const; +const ALERT_THREAT_TACTIC_REFERENCE = `${ALERT_RULE_THREAT_NAMESPACE}.tactic.reference` as const; +const ALERT_THREAT_TECHNIQUE_ID = `${ALERT_RULE_THREAT_NAMESPACE}.technique.id` as const; +const ALERT_THREAT_TECHNIQUE_NAME = `${ALERT_RULE_THREAT_NAMESPACE}.technique.name` as const; +const ALERT_THREAT_TECHNIQUE_REFERENCE = + `${ALERT_RULE_THREAT_NAMESPACE}.technique.reference` as const; +const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID = + `${ALERT_RULE_THREAT_NAMESPACE}.technique.subtechnique.id` as const; +const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME = + `${ALERT_RULE_THREAT_NAMESPACE}.technique.subtechnique.name` as const; +const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE = + `${ALERT_RULE_THREAT_NAMESPACE}.technique.subtechnique.reference` as const; + // the feature instantiating a rule type. // Rule created in stack --> alerts // Rule created in siem --> siem @@ -137,6 +155,16 @@ const fields = { ALERT_WORKFLOW_USER, ALERT_RULE_UUID, ALERT_RULE_CATEGORY, + ALERT_THREAT_FRAMEWORK, + ALERT_THREAT_TACTIC_ID, + ALERT_THREAT_TACTIC_NAME, + ALERT_THREAT_TACTIC_REFERENCE, + ALERT_THREAT_TECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_REFERENCE, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE, SPACE_IDS, VERSION, }; @@ -195,6 +223,16 @@ export { KIBANA_NAMESPACE, ALERT_RULE_UUID, ALERT_RULE_CATEGORY, + ALERT_THREAT_FRAMEWORK, + ALERT_THREAT_TACTIC_ID, + ALERT_THREAT_TACTIC_NAME, + ALERT_THREAT_TACTIC_REFERENCE, + ALERT_THREAT_TECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_REFERENCE, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE, TAGS, TIMESTAMP, SPACE_IDS, diff --git a/packages/kbn-rule-data-utils/tsconfig.json b/packages/kbn-rule-data-utils/tsconfig.json index dee08b30aa7a1..57c1dd1c94e0f 100644 --- a/packages/kbn-rule-data-utils/tsconfig.json +++ b/packages/kbn-rule-data-utils/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, - "outDir": "./target_types", - "stripInternal": false, + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-safer-lodash-set/BUILD.bazel b/packages/kbn-safer-lodash-set/BUILD.bazel index 893719c822859..3a5d07ab38904 100644 --- a/packages/kbn-safer-lodash-set/BUILD.bazel +++ b/packages/kbn-safer-lodash-set/BUILD.bazel @@ -1,6 +1,6 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") -PKG_BASE_NAME = "kbn-safer-lodash-set" +PKG_DIRNAME = "kbn-safer-lodash-set" PKG_REQUIRE_NAME = "@kbn/safer-lodash-set" SOURCE_FILES = glob( @@ -40,7 +40,7 @@ DEPS = [ ] js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [ ":srcs", ], @@ -51,9 +51,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -66,7 +64,7 @@ filegroup( alias( name = "npm_module_types", - actual = PKG_BASE_NAME, + actual = PKG_DIRNAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-safer-lodash-set/package.json b/packages/kbn-safer-lodash-set/package.json index f850b5fe0fc48..8d1b80bdfb082 100644 --- a/packages/kbn-safer-lodash-set/package.json +++ b/packages/kbn-safer-lodash-set/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "description": "A safer version of the lodash set and setWith functions", "main": "index.js", - "types": "index.d.ts", + "types": "./target_types/index.d.ts", "scripts": { "lint": "../../node_modules/.bin/dependency-check --missing ../../package.json ./packages/kbn-safer-lodash-set/set.js ./packages/kbn-safer-lodash-set/setWith.js ./packages/kbn-safer-lodash-set/fp/*.js", "test": "npm run lint && ../../node_modules/.bin/tape test/*.js && npm run test:types", diff --git a/packages/kbn-securitysolution-autocomplete/BUILD.bazel b/packages/kbn-securitysolution-autocomplete/BUILD.bazel index d09b4cf04c70a..8309ff7f0ef47 100644 --- a/packages/kbn-securitysolution-autocomplete/BUILD.bazel +++ b/packages/kbn-securitysolution-autocomplete/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-autocomplete" +PKG_DIRNAME = "kbn-securitysolution-autocomplete" PKG_REQUIRE_NAME = "@kbn/securitysolution-autocomplete" SOURCE_FILES = glob( @@ -102,25 +102,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -131,20 +136,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) - diff --git a/packages/kbn-securitysolution-autocomplete/package.json b/packages/kbn-securitysolution-autocomplete/package.json index 53ab4b7e9dccc..91b92d5aa4b3a 100644 --- a/packages/kbn-securitysolution-autocomplete/package.json +++ b/packages/kbn-securitysolution-autocomplete/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-autocomplete/tsconfig.json b/packages/kbn-securitysolution-autocomplete/tsconfig.json index 488da46adb0d7..2b02a63db1d05 100644 --- a/packages/kbn-securitysolution-autocomplete/tsconfig.json +++ b/packages/kbn-securitysolution-autocomplete/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": ["jest", "node"] diff --git a/packages/kbn-securitysolution-es-utils/BUILD.bazel b/packages/kbn-securitysolution-es-utils/BUILD.bazel index 6eb3a84e83fce..c4ff9faedce27 100644 --- a/packages/kbn-securitysolution-es-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-es-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-es-utils" +PKG_DIRNAME = "kbn-securitysolution-es-utils" PKG_REQUIRE_NAME = "@kbn/securitysolution-es-utils" SOURCE_FILES = glob( @@ -73,25 +73,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ], + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -102,19 +107,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-es-utils/package.json b/packages/kbn-securitysolution-es-utils/package.json index 57ed8cf46c5b8..d4cc8d25a36ff 100644 --- a/packages/kbn-securitysolution-es-utils/package.json +++ b/packages/kbn-securitysolution-es-utils/package.json @@ -4,5 +4,6 @@ "description": "security solution elastic search utilities to use across plugins such lists, security_solution, cases, etc...", "license": "SSPL-1.0 OR Elastic License 2.0", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-es-utils/tsconfig.json b/packages/kbn-securitysolution-es-utils/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-es-utils/tsconfig.json +++ b/packages/kbn-securitysolution-es-utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-exception-list-components/BUILD.bazel b/packages/kbn-securitysolution-exception-list-components/BUILD.bazel index 6436793fa5f30..36379eea91840 100644 --- a/packages/kbn-securitysolution-exception-list-components/BUILD.bazel +++ b/packages/kbn-securitysolution-exception-list-components/BUILD.bazel @@ -93,7 +93,8 @@ jsts_transpiler( srcs = SRCS, build_pkg_name = package_name(), additional_args = [ - "--copy-files" + "--copy-files", + "--quiet" ], ) @@ -103,7 +104,8 @@ jsts_transpiler( build_pkg_name = package_name(), web = True, additional_args = [ - "--copy-files" + "--copy-files", + "--quiet" ], ) @@ -122,7 +124,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -136,6 +137,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -147,17 +156,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-exception-list-components/package.json b/packages/kbn-securitysolution-exception-list-components/package.json index 263863d725c1e..b0acf0d547f8e 100644 --- a/packages/kbn-securitysolution-exception-list-components/package.json +++ b/packages/kbn-securitysolution-exception-list-components/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap index 5c0dba4573e06..27df7b34bf313 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap @@ -1,5 +1,66 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`ExceptionItemCardComments should not render comments when the length is falsy 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+ , + "container":
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + exports[`ExceptionItemCardComments should render comments panel closed 1`] = ` Object { "asFragment": [Function], diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/comments.test.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/comments.test.tsx index 64b2d1c9e3a83..9f81c19349f93 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/comments.test.tsx +++ b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/comments.test.tsx @@ -13,6 +13,15 @@ import * as i18n from '../translations'; const comments = mockGetFormattedComments(); describe('ExceptionItemCardComments', () => { + it('should not render comments when the length is falsy', () => { + const wrapper = render( + + ); + expect(wrapper).toMatchSnapshot(); + + expect(wrapper.queryByTestId('ExceptionItemCardCommentsContainer')).not.toBeInTheDocument(); + }); + it('should render comments panel closed', () => { const wrapper = render( ( ({ comments, dataTestSubj }) => { + if (!comments.length) return null; return ( { item={getExceptionListItemSchemaMock()} rules={[ { - exception_lists: [ + exception_list: [ { id: '123', list_id: 'i_exist', @@ -98,7 +98,7 @@ describe('ExceptionItemCardMetaInfo', () => { rule_id: 'rule-2', }, { - exception_lists: [ + exception_list: [ { id: '123', list_id: 'i_exist', diff --git a/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap index dd808cfd1889c..2e8afcea7cc3e 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap @@ -1,5 +1,201 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`HeaderMenu should render button icon disabled 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+
+
+ +
+
+
+
+
+
+ +
+ , + "container":
+
+
+
+ +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + exports[`HeaderMenu should render button icon with default settings 1`] = ` Object { "asFragment": [Function], diff --git a/packages/kbn-securitysolution-exception-list-components/src/header_menu/header_menu.test.tsx b/packages/kbn-securitysolution-exception-list-components/src/header_menu/header_menu.test.tsx index b07079c721ff7..8b5775264e230 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/header_menu/header_menu.test.tsx +++ b/packages/kbn-securitysolution-exception-list-components/src/header_menu/header_menu.test.tsx @@ -8,7 +8,7 @@ import { fireEvent, render } from '@testing-library/react'; import React from 'react'; import { HeaderMenu } from '.'; -import { actions } from '../mocks/header.mock'; +import { actions, actionsWithDisabledDelete } from '../mocks/header.mock'; import { getSecurityLinkAction } from '../mocks/security_link_component.mock'; describe('HeaderMenu', () => { @@ -21,6 +21,16 @@ describe('HeaderMenu', () => { expect(wrapper.queryByTestId('EmptyButton')).not.toBeInTheDocument(); expect(wrapper.queryByTestId('MenuPanel')).not.toBeInTheDocument(); }); + it('should render button icon disabled', () => { + const wrapper = render( + + ); + + fireEvent.click(wrapper.getByTestId('ButtonIcon')); + expect(wrapper).toMatchSnapshot(); + expect(wrapper.getByTestId('ActionItemdelete')).toBeDisabled(); + expect(wrapper.getByTestId('ActionItemedit')).toBeEnabled(); + }); it('should render empty button icon with different icon settings', () => { const wrapper = render( diff --git a/packages/kbn-securitysolution-exception-list-components/src/header_menu/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/header_menu/index.tsx index 43154a865a436..ba6f3c7beff5d 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/header_menu/index.tsx +++ b/packages/kbn-securitysolution-exception-list-components/src/header_menu/index.tsx @@ -24,6 +24,7 @@ interface Action { key: string; icon: string; label: string | boolean; + disabled?: boolean; onClick: () => void; } interface HeaderMenuComponentProps { @@ -63,6 +64,7 @@ const HeaderMenuComponent: FC = ({ data-test-subj={`${dataTestSubj || ''}ActionItem${action.key}`} key={action.key} icon={action.icon} + disabled={action.disabled} layoutAlign="center" onClick={() => { onClosePopover(); diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap index 98f026e4ce947..c3146235b9ab3 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap @@ -58,26 +58,34 @@ Object { class="euiTitle emotion-euiTitle-l" >
- - List Name - - + data-test-subj="TitleText" + > + List Name + +
+
+ +
- - List description - - + css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)." + data-test-subj="DescriptionText" + > + List description + +
+
+ +
-
-
-
- -
-
-
+ Linked to 0 rules +
+
+ +
+
+ , + "container":
+
+
+
+ +
+
+
+

+
+
+ + List Name + +
+
+ +
+
+

+
+
+

+

+
+
+ + Add a description + +
+
+ +
+
+
+
+ List ID + : +
+
+ List_Id +
+
+
+

+
+
+
+
+
+
+
+ + Linked to 0 rules + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`ExceptionListHeader should render the List Header with name, default description and disabled actions because of the ReadOnly mode 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+
+
+ +
+
+
+

+
+
+ + List Name + +
+

- - Add a description - - + css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)." + data-test-subj="DescriptionText" + > + Add a description + +
+
-
-
-
- -
-
-
+ Linked to 0 rules +
+ data-test-subj="TitleText" + > + List Name + +
+
- - Add a description - - + css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)." + data-test-subj="DescriptionText" + > + Add a description + +
+
-
-
-
- -
-
-
+ Linked to 0 rules +
-
-
-
+ Linked to 0 rules +
+
+
+ +
, "container":
- - List Name - + + List Name + +
+
- - Add a description - + + Add a description + +
+
-
-
-
- -
-
-
+ Linked to 0 rules +
+
+
+
+
+
+ +
+
+
+
+
+
+ , + "container":
+
+
+ + Linked to 0 rules + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`MenuItems should render all menu actions enabled 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+
+ + Linked to 0 rules + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+ , + "container":
+
+
+ + Linked to 0 rules + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`MenuItems should render delete action disabled 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+ , + "container":
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + exports[`MenuItems should render linkedRules, manageRules and menuActions 1`] = ` Object { "asFragment": [Function], diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/index.tsx index 1e13a8ac3d0f2..bd043af4b1550 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/index.tsx +++ b/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/index.tsx @@ -5,10 +5,10 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiTextColor } from '@elastic/eui'; import React, { FC, useMemo } from 'react'; import { HeaderMenu } from '../../header_menu'; -import { headerMenuCss } from '../list_header.styles'; +import { headerMenuCss, noLinkedRulesCss } from '../list_header.styles'; import * as i18n from '../../translations'; import { Rule } from '../../types'; import { generateLinkedRulesMenuItems } from '../../generate_linked_rules_menu_item'; @@ -16,6 +16,7 @@ interface MenuItemsProps { isReadonly: boolean; dataTestSubj?: string; linkedRules: Rule[]; + canUserEditList?: boolean; securityLinkAnchorComponent: React.ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common onExportList: () => void; onDeleteList: () => void; @@ -27,6 +28,7 @@ const MenuItemsComponent: FC = ({ linkedRules, securityLinkAnchorComponent, isReadonly, + canUserEditList = true, onExportList, onDeleteList, onManageRules, @@ -51,17 +53,23 @@ const MenuItemsComponent: FC = ({ gutterSize="l" > - + {linkedRules.length ? ( + + ) : ( + + {i18n.EXCEPTION_LIST_HEADER_LINKED_RULES(linkedRules.length)} + + )} @@ -95,6 +103,7 @@ const MenuItemsComponent: FC = ({ onClick: () => { if (typeof onDeleteList === 'function') onDeleteList(); }, + disabled: !canUserEditList, }, ]} disableActions={isReadonly} diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/menu_items.test.tsx b/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/menu_items.test.tsx index 95d03a5b4678e..470b2402550b6 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/menu_items.test.tsx +++ b/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/menu_items.test.tsx @@ -32,6 +32,53 @@ describe('MenuItems', () => { expect(wrapper.getByTestId('ManageRulesButton')).toBeInTheDocument(); expect(wrapper.getByTestId('MenuActionsButtonIcon')).toBeInTheDocument(); }); + it('should not render linkedRules HeaderMenu component, instead should render a text', () => { + const wrapper = render( + + ); + expect(wrapper).toMatchSnapshot(); + expect(wrapper.queryByTestId('LinkedRulesMenuItems')).not.toBeInTheDocument(); + expect(wrapper.getByTestId('noLinkedRules')).toBeInTheDocument(); + }); + it('should render all menu actions enabled', () => { + const wrapper = render( + + ); + fireEvent.click(wrapper.getByTestId('MenuActionsButtonIcon')); + expect(wrapper).toMatchSnapshot(); + expect(wrapper.getByTestId('MenuActionsActionItem1')).toBeEnabled(); + expect(wrapper.getByTestId('MenuActionsActionItem2')).toBeEnabled(); + }); + it('should render delete action disabled', () => { + const wrapper = render( + + ); + fireEvent.click(wrapper.getByTestId('MenuActionsButtonIcon')); + expect(wrapper).toMatchSnapshot(); + expect(wrapper.getByTestId('MenuActionsActionItem2')).toBeDisabled(); + }); it('should call onManageRules', () => { const wrapper = render( { - setIsModalVisible(false); setListDetails(newListDetails); if (typeof onEditListDetails === 'function') onEditListDetails(newListDetails); + setTimeout(() => { + setIsModalVisible(false); + }, 200); }; const onCancel = () => { setIsModalVisible(false); diff --git a/packages/kbn-securitysolution-exception-list-components/src/mocks/header.mock.ts b/packages/kbn-securitysolution-exception-list-components/src/mocks/header.mock.ts index 55e3199e0a99e..addd022a27b2e 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/mocks/header.mock.ts +++ b/packages/kbn-securitysolution-exception-list-components/src/mocks/header.mock.ts @@ -21,3 +21,18 @@ export const actions = [ onClick: handleDelete, }, ]; +export const actionsWithDisabledDelete = [ + { + key: 'edit', + icon: 'pencil', + label: 'Edit detection exception', + onClick: handleEdit, + }, + { + key: 'delete', + icon: 'trash', + disabled: true, + label: 'Delete detection exception', + onClick: handleDelete, + }, +]; diff --git a/packages/kbn-securitysolution-exception-list-components/src/mocks/rule_references.mock.ts b/packages/kbn-securitysolution-exception-list-components/src/mocks/rule_references.mock.ts index d2a5e0ab0a756..8c2921debf246 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/mocks/rule_references.mock.ts +++ b/packages/kbn-securitysolution-exception-list-components/src/mocks/rule_references.mock.ts @@ -10,7 +10,7 @@ import { Rule, RuleReference } from '../types'; export const rules: Rule[] = [ { - exception_lists: [ + exception_list: [ { id: '123', list_id: 'i_exist', diff --git a/packages/kbn-securitysolution-exception-list-components/src/mocks/security_link_component.mock.tsx b/packages/kbn-securitysolution-exception-list-components/src/mocks/security_link_component.mock.tsx index db0a64affc182..27334c636fdff 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/mocks/security_link_component.mock.tsx +++ b/packages/kbn-securitysolution-exception-list-components/src/mocks/security_link_component.mock.tsx @@ -26,7 +26,7 @@ export const getSecurityLinkAction = (dataTestSubj: string) => linkedRules: [ ...rules, { - exception_lists: [], + exception_list: [], id: '2a2b3c', name: 'Simple Rule Query 2', rule_id: 'rule-2', diff --git a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/__snapshots__/text_with_edit.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/__snapshots__/text_with_edit.test.tsx.snap index 4543f84553ae6..6d67ff422ae7f 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/__snapshots__/text_with_edit.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/__snapshots__/text_with_edit.test.tsx.snap @@ -6,25 +6,39 @@ Object { "baseElement":
- - Test - + + Test + +
+
, "container":
- - Test - + + Test + +
+
, "debug": [Function], @@ -87,13 +101,53 @@ Object { "baseElement":
+
+ + Test + +
+
+ +
+
+
+ , + "container":
+
+
Test +
+
- , - "container":
-
- - Test - - -
, "debug": [Function], "findAllByAltText": [Function], diff --git a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/index.tsx index 5b56b27053396..8d0da29b2ea4e 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/index.tsx +++ b/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/index.tsx @@ -7,10 +7,9 @@ */ import React, { FC } from 'react'; -import { EuiButtonIcon } from '@elastic/eui'; +import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { Interpolation, Theme } from '@emotion/react'; -import { textWithEditContainerCss } from '../list_header/list_header.styles'; - +import { textWithEditContainerCss, editIconCss } from './text_with_edit.styles'; interface TextWithEditProps { isReadonly: boolean; dataTestSubj?: string; @@ -27,19 +26,23 @@ const TextWithEditComponent: FC = ({ textCss, }) => { return ( -
- - {text} - - {isReadonly ? null : ( - (typeof onEdit === 'function' ? onEdit() : null)} - /> - )} -
+ + + + {text} + + + + {isReadonly ? null : ( + (typeof onEdit === 'function' ? onEdit() : null)} + /> + )} + + ); }; TextWithEditComponent.displayName = 'TextWithEditComponent'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.styles.ts b/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.styles.ts new file mode 100644 index 0000000000000..1aed7932695d9 --- /dev/null +++ b/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.styles.ts @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; + +export const textWithEditContainerCss = css` + display: flex; + width: fit-content; + align-items: baseline; + padding-bottom: ${euiThemeVars.euiSizeS}; + h1 { + margin-bottom: 0; + } +`; +export const editIconCss = css` + button { + margin-left: -${euiThemeVars.euiSizeM}; + } +`; diff --git a/packages/kbn-securitysolution-exception-list-components/src/translations.ts b/packages/kbn-securitysolution-exception-list-components/src/translations.ts index c5740958abcf4..38cb15f4b742e 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/translations.ts +++ b/packages/kbn-securitysolution-exception-list-components/src/translations.ts @@ -140,3 +140,10 @@ export const EXCEPTION_LIST_HEADER_DESCRIPTION_TEXTBOX = i18n.translate( defaultMessage: 'Description', } ); + +export const LIST_NAME_REQUIRED_ERROR = i18n.translate( + 'exceptionList-components.exception_list_header_description_textboxexceptionList-components.exception_list_header_name_required_eror', + { + defaultMessage: 'List name cannot be empty', + } +); diff --git a/packages/kbn-securitysolution-exception-list-components/src/types/index.ts b/packages/kbn-securitysolution-exception-list-components/src/types/index.ts index d799879916dee..ba35f0753cc68 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/types/index.ts +++ b/packages/kbn-securitysolution-exception-list-components/src/types/index.ts @@ -60,7 +60,7 @@ export interface Rule { name: string; id: string; rule_id: string; - exception_lists: ListArray; + exception_list?: ListArray; } export interface RuleReference { diff --git a/packages/kbn-securitysolution-exception-list-components/tsconfig.json b/packages/kbn-securitysolution-exception-list-components/tsconfig.json index 412652e0a8f9d..e1a84c71fdfd1 100644 --- a/packages/kbn-securitysolution-exception-list-components/tsconfig.json +++ b/packages/kbn-securitysolution-exception-list-components/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/kbn-securitysolution-hook-utils/BUILD.bazel b/packages/kbn-securitysolution-hook-utils/BUILD.bazel index 6959bfcc69534..f2886137fedd5 100644 --- a/packages/kbn-securitysolution-hook-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-hook-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-hook-utils" +PKG_DIRNAME = "kbn-securitysolution-hook-utils" PKG_REQUIRE_NAME = "@kbn/securitysolution-hook-utils" SOURCE_FILES = glob( @@ -80,25 +80,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ], + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -109,19 +114,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-hook-utils/package.json b/packages/kbn-securitysolution-hook-utils/package.json index fb2576a324223..e676b6494a01b 100644 --- a/packages/kbn-securitysolution-hook-utils/package.json +++ b/packages/kbn-securitysolution-hook-utils/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-hook-utils/tsconfig.json b/packages/kbn-securitysolution-hook-utils/tsconfig.json index 2d7301e4f7985..b1621b0cd4477 100644 --- a/packages/kbn-securitysolution-hook-utils/tsconfig.json +++ b/packages/kbn-securitysolution-hook-utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": ["jest", "node"] diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel index 7ddd3ab480bfc..51ab304ca82a2 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-io-ts-alerting-types" +PKG_DIRNAME = "kbn-securitysolution-io-ts-alerting-types" PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-alerting-types" SOURCE_FILES = glob( @@ -83,25 +83,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -112,19 +117,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/package.json b/packages/kbn-securitysolution-io-ts-alerting-types/package.json index d5dd5516cd9f6..bcfacbe9c5146 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/package.json +++ b/packages/kbn-securitysolution-io-ts-alerting-types/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel index 7a4388b65053e..28b36936420f0 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-io-ts-list-types" +PKG_DIRNAME = "kbn-securitysolution-io-ts-list-types" PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-list-types" SOURCE_FILES = glob( @@ -84,25 +84,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -113,19 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-list-types/package.json b/packages/kbn-securitysolution-io-ts-list-types/package.json index ff4611f469906..20dd5d2e37ad0 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/package.json +++ b/packages/kbn-securitysolution-io-ts-list-types/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel index 85f5a05ed6c44..4b102f68e2a4e 100644 --- a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-io-ts-types" +PKG_DIRNAME = "kbn-securitysolution-io-ts-types" PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-types" SOURCE_FILES = glob( @@ -81,25 +81,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -110,19 +115,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-types/package.json b/packages/kbn-securitysolution-io-ts-types/package.json index 76e405c227053..e02a79f16a098 100644 --- a/packages/kbn-securitysolution-io-ts-types/package.json +++ b/packages/kbn-securitysolution-io-ts-types/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.test.ts index 31a3eed8b7fbf..d2f84b4ee3708 100644 --- a/packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.test.ts +++ b/packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.test.ts @@ -13,6 +13,7 @@ import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts describe('importQuerySchema', () => { test('it should validate proper schema', () => { const payload: ImportQuerySchema = { + as_new_list: false, overwrite: true, overwrite_exceptions: true, }; @@ -26,6 +27,7 @@ describe('importQuerySchema', () => { test('it should NOT validate a non boolean value for "overwrite"', () => { const payload: Omit & { overwrite: string } = { + as_new_list: false, overwrite: 'wrong', overwrite_exceptions: true, }; @@ -43,6 +45,7 @@ describe('importQuerySchema', () => { const payload: Omit & { overwrite_exceptions: string; } = { + as_new_list: false, overwrite: true, overwrite_exceptions: 'wrong', }; diff --git a/packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts b/packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts index f84f16fddabdb..ca0e35c4aa176 100644 --- a/packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts +++ b/packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts @@ -14,14 +14,16 @@ export const importQuerySchema = t.exact( t.partial({ overwrite: DefaultStringBooleanFalse, overwrite_exceptions: DefaultStringBooleanFalse, + as_new_list: DefaultStringBooleanFalse, }) ); export type ImportQuerySchema = t.TypeOf; export type ImportQuerySchemaDecoded = Omit< ImportQuerySchema, - 'overwrite' | 'overwrite_exceptions' + 'overwrite' | 'overwrite_exceptions' | 'as_new_list' > & { overwrite: boolean; overwrite_exceptions: boolean; + as_new_list: boolean; }; diff --git a/packages/kbn-securitysolution-io-ts-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-types/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-io-ts-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-types/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel index 6e8d4de3ccfde..9ec44f8d52546 100644 --- a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-io-ts-utils" +PKG_DIRNAME = "kbn-securitysolution-io-ts-utils" PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-utils" SOURCE_FILES = glob( @@ -84,25 +84,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -113,19 +118,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-utils/package.json b/packages/kbn-securitysolution-io-ts-utils/package.json index bf8c1230a4f55..8ae2eff526ac9 100644 --- a/packages/kbn-securitysolution-io-ts-utils/package.json +++ b/packages/kbn-securitysolution-io-ts-utils/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-io-ts-utils/tsconfig.json b/packages/kbn-securitysolution-io-ts-utils/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-io-ts-utils/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-list-api/BUILD.bazel b/packages/kbn-securitysolution-list-api/BUILD.bazel index 9819e867e3194..05254f32c2c7e 100644 --- a/packages/kbn-securitysolution-list-api/BUILD.bazel +++ b/packages/kbn-securitysolution-list-api/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-list-api" +PKG_DIRNAME = "kbn-securitysolution-list-api" PKG_REQUIRE_NAME = "@kbn/securitysolution-list-api" SOURCE_FILES = glob( @@ -83,25 +83,30 @@ ts_project( deps = TYPES_DEPS, args = ["--pretty"], declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ], + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -112,19 +117,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-list-api/package.json b/packages/kbn-securitysolution-list-api/package.json index d243f71127c1f..01156ef460a99 100644 --- a/packages/kbn-securitysolution-list-api/package.json +++ b/packages/kbn-securitysolution-list-api/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-list-api/tsconfig.json b/packages/kbn-securitysolution-list-api/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-list-api/tsconfig.json +++ b/packages/kbn-securitysolution-list-api/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-list-constants/BUILD.bazel b/packages/kbn-securitysolution-list-constants/BUILD.bazel index 5d4a6c2ffb117..ba79dbeb420fb 100644 --- a/packages/kbn-securitysolution-list-constants/BUILD.bazel +++ b/packages/kbn-securitysolution-list-constants/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-list-constants" +PKG_DIRNAME = "kbn-securitysolution-list-constants" PKG_REQUIRE_NAME = "@kbn/securitysolution-list-constants" SOURCE_FILES = glob( @@ -71,25 +71,30 @@ ts_project( deps = TYPES_DEPS, args = ["--pretty"], declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ], + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -100,19 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-list-constants/package.json b/packages/kbn-securitysolution-list-constants/package.json index 8900265c30cd2..2b8be64d94547 100644 --- a/packages/kbn-securitysolution-list-constants/package.json +++ b/packages/kbn-securitysolution-list-constants/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-list-constants/tsconfig.json b/packages/kbn-securitysolution-list-constants/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-list-constants/tsconfig.json +++ b/packages/kbn-securitysolution-list-constants/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-list-hooks/BUILD.bazel b/packages/kbn-securitysolution-list-hooks/BUILD.bazel index 93a3d0c683dd5..e1cbefa4ab0c6 100644 --- a/packages/kbn-securitysolution-list-hooks/BUILD.bazel +++ b/packages/kbn-securitysolution-list-hooks/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-list-hooks" +PKG_DIRNAME = "kbn-securitysolution-list-hooks" PKG_REQUIRE_NAME = "@kbn/securitysolution-list-hooks" SOURCE_FILES = glob( @@ -90,25 +90,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ], + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -119,19 +124,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-list-hooks/package.json b/packages/kbn-securitysolution-list-hooks/package.json index d6d6077332903..75d0ec81e656c 100644 --- a/packages/kbn-securitysolution-list-hooks/package.json +++ b/packages/kbn-securitysolution-list-hooks/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-list-hooks/tsconfig.json b/packages/kbn-securitysolution-list-hooks/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-list-hooks/tsconfig.json +++ b/packages/kbn-securitysolution-list-hooks/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-list-utils/BUILD.bazel b/packages/kbn-securitysolution-list-utils/BUILD.bazel index d1d1a9a3e326a..20a6074aee9c9 100644 --- a/packages/kbn-securitysolution-list-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-list-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-list-utils" +PKG_DIRNAME = "kbn-securitysolution-list-utils" PKG_REQUIRE_NAME = "@kbn/securitysolution-list-utils" SOURCE_FILES = glob( @@ -90,14 +90,13 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, @@ -105,11 +104,18 @@ js_library( ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], + +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ], + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -120,19 +126,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-list-utils/package.json b/packages/kbn-securitysolution-list-utils/package.json index 27724ead26b2e..548f68c1f0ebb 100644 --- a/packages/kbn-securitysolution-list-utils/package.json +++ b/packages/kbn-securitysolution-list-utils/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-list-utils/tsconfig.json b/packages/kbn-securitysolution-list-utils/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-list-utils/tsconfig.json +++ b/packages/kbn-securitysolution-list-utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-rules/BUILD.bazel b/packages/kbn-securitysolution-rules/BUILD.bazel index e1da8501dffa1..7519e7bae1dd4 100644 --- a/packages/kbn-securitysolution-rules/BUILD.bazel +++ b/packages/kbn-securitysolution-rules/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-rules" +PKG_DIRNAME = "kbn-securitysolution-rules" PKG_REQUIRE_NAME = "@kbn/securitysolution-rules" SOURCE_FILES = glob( @@ -78,25 +78,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ], + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -107,19 +112,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-rules/package.json b/packages/kbn-securitysolution-rules/package.json index da061b244e7a0..5e41733300a35 100644 --- a/packages/kbn-securitysolution-rules/package.json +++ b/packages/kbn-securitysolution-rules/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-rules/tsconfig.json b/packages/kbn-securitysolution-rules/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-rules/tsconfig.json +++ b/packages/kbn-securitysolution-rules/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-t-grid/BUILD.bazel b/packages/kbn-securitysolution-t-grid/BUILD.bazel index 39c1aff010f88..219d8e85a6642 100644 --- a/packages/kbn-securitysolution-t-grid/BUILD.bazel +++ b/packages/kbn-securitysolution-t-grid/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-t-grid" +PKG_DIRNAME = "kbn-securitysolution-t-grid" PKG_REQUIRE_NAME = "@kbn/securitysolution-t-grid" SOURCE_FILES = glob( @@ -79,25 +79,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ], + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -108,19 +113,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-t-grid/package.json b/packages/kbn-securitysolution-t-grid/package.json index accf7b4d61731..95c525df9b152 100644 --- a/packages/kbn-securitysolution-t-grid/package.json +++ b/packages/kbn-securitysolution-t-grid/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-t-grid/tsconfig.json b/packages/kbn-securitysolution-t-grid/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-t-grid/tsconfig.json +++ b/packages/kbn-securitysolution-t-grid/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-securitysolution-utils/BUILD.bazel b/packages/kbn-securitysolution-utils/BUILD.bazel index a76553e2fb2c5..1144c136e74a2 100644 --- a/packages/kbn-securitysolution-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-securitysolution-utils" +PKG_DIRNAME = "kbn-securitysolution-utils" PKG_REQUIRE_NAME = "@kbn/securitysolution-utils" SOURCE_FILES = glob( @@ -78,25 +78,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ], + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -107,19 +112,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-utils/package.json b/packages/kbn-securitysolution-utils/package.json index e43d2570f730f..2c77139c326dd 100644 --- a/packages/kbn-securitysolution-utils/package.json +++ b/packages/kbn-securitysolution-utils/package.json @@ -5,5 +5,6 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-securitysolution-utils/tsconfig.json b/packages/kbn-securitysolution-utils/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-securitysolution-utils/tsconfig.json +++ b/packages/kbn-securitysolution-utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-server-http-tools/BUILD.bazel b/packages/kbn-server-http-tools/BUILD.bazel index 5c73a34ffe5e7..bd69d4046d67f 100644 --- a/packages/kbn-server-http-tools/BUILD.bazel +++ b/packages/kbn-server-http-tools/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-server-http-tools" +PKG_DIRNAME = "kbn-server-http-tools" PKG_REQUIRE_NAME = "@kbn/server-http-tools" SOURCE_FILES = glob( @@ -82,25 +82,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -111,19 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-server-http-tools/package.json b/packages/kbn-server-http-tools/package.json index 277bfbbf4ef97..b0abbd436e938 100644 --- a/packages/kbn-server-http-tools/package.json +++ b/packages/kbn-server-http-tools/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-server-http-tools/tsconfig.json b/packages/kbn-server-http-tools/tsconfig.json index f338a6db6548d..57c1dd1c94e0f 100644 --- a/packages/kbn-server-http-tools/tsconfig.json +++ b/packages/kbn-server-http-tools/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target/types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-server-route-repository/BUILD.bazel b/packages/kbn-server-route-repository/BUILD.bazel index cbe6172e32e40..19360a1da0f80 100644 --- a/packages/kbn-server-route-repository/BUILD.bazel +++ b/packages/kbn-server-route-repository/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-server-route-repository" +PKG_DIRNAME = "kbn-server-route-repository" PKG_REQUIRE_NAME = "@kbn/server-route-repository" SOURCE_FILES = glob( @@ -89,25 +89,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -118,20 +123,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) - diff --git a/packages/kbn-server-route-repository/package.json b/packages/kbn-server-route-repository/package.json index 1491f24c54dc1..04ca169ad0ab3 100644 --- a/packages/kbn-server-route-repository/package.json +++ b/packages/kbn-server-route-repository/package.json @@ -4,5 +4,6 @@ "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-server-route-repository/tsconfig.json b/packages/kbn-server-route-repository/tsconfig.json index 843407053b4ab..a1cd5336c6255 100644 --- a/packages/kbn-server-route-repository/tsconfig.json +++ b/packages/kbn-server-route-repository/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": false, + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-shared-svg/BUILD.bazel b/packages/kbn-shared-svg/BUILD.bazel index 82b755751dc41..79262ef0b54b1 100644 --- a/packages/kbn-shared-svg/BUILD.bazel +++ b/packages/kbn-shared-svg/BUILD.bazel @@ -94,7 +94,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -108,6 +107,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -119,17 +126,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-shared-svg/package.json b/packages/kbn-shared-svg/package.json index 9939ae3d9f8e2..d28953d0d843a 100644 --- a/packages/kbn-shared-svg/package.json +++ b/packages/kbn-shared-svg/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-shared-svg/tsconfig.json b/packages/kbn-shared-svg/tsconfig.json index 423bb95cf1cd7..df76c43764ad6 100644 --- a/packages/kbn-shared-svg/tsconfig.json +++ b/packages/kbn-shared-svg/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/kbn-shared-ux-utility/BUILD.bazel b/packages/kbn-shared-ux-utility/BUILD.bazel index 2449a3011b456..d19df36a5ea49 100644 --- a/packages/kbn-shared-ux-utility/BUILD.bazel +++ b/packages/kbn-shared-ux-utility/BUILD.bazel @@ -99,7 +99,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -113,6 +112,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -124,17 +131,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-shared-ux-utility/package.json b/packages/kbn-shared-ux-utility/package.json index dca0f7758ddbc..6bf6571104b45 100644 --- a/packages/kbn-shared-ux-utility/package.json +++ b/packages/kbn-shared-ux-utility/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-shared-ux-utility/tsconfig.json b/packages/kbn-shared-ux-utility/tsconfig.json index be6b0161bf248..4990376ba9063 100644 --- a/packages/kbn-shared-ux-utility/tsconfig.json +++ b/packages/kbn-shared-ux-utility/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/kbn-some-dev-log/BUILD.bazel b/packages/kbn-some-dev-log/BUILD.bazel index cb06fc26d6be4..02ba30b3d1dba 100644 --- a/packages/kbn-some-dev-log/BUILD.bazel +++ b/packages/kbn-some-dev-log/BUILD.bazel @@ -83,7 +83,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -97,6 +96,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -108,17 +115,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-some-dev-log/package.json b/packages/kbn-some-dev-log/package.json index 9b01a43a03c00..2dccc54aa1e35 100644 --- a/packages/kbn-some-dev-log/package.json +++ b/packages/kbn-some-dev-log/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-some-dev-log/tsconfig.json b/packages/kbn-some-dev-log/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-some-dev-log/tsconfig.json +++ b/packages/kbn-some-dev-log/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-sort-package-json/BUILD.bazel b/packages/kbn-sort-package-json/BUILD.bazel index 95edbe3935617..9014d4cc2ada5 100644 --- a/packages/kbn-sort-package-json/BUILD.bazel +++ b/packages/kbn-sort-package-json/BUILD.bazel @@ -85,7 +85,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -99,6 +98,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -110,17 +117,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-sort-package-json/package.json b/packages/kbn-sort-package-json/package.json index 922124b1bdd73..316213bcac017 100644 --- a/packages/kbn-sort-package-json/package.json +++ b/packages/kbn-sort-package-json/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-sort-package-json/tsconfig.json b/packages/kbn-sort-package-json/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-sort-package-json/tsconfig.json +++ b/packages/kbn-sort-package-json/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-spec-to-console/BUILD.bazel b/packages/kbn-spec-to-console/BUILD.bazel index ee046c6194f7f..9d41b5762d470 100644 --- a/packages/kbn-spec-to-console/BUILD.bazel +++ b/packages/kbn-spec-to-console/BUILD.bazel @@ -1,7 +1,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "pkg_npm") -PKG_BASE_NAME = "kbn-spec-to-console" +PKG_DIRNAME = "kbn-spec-to-console" PKG_REQUIRE_NAME = "@kbn/spec-to-console" SOURCE_FILES = glob( @@ -33,7 +33,7 @@ RUNTIME_DEPS = [ ] js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [ ":srcs", ], @@ -44,9 +44,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-std/BUILD.bazel b/packages/kbn-std/BUILD.bazel index fb59d13596ab7..b5b198ffd873d 100644 --- a/packages/kbn-std/BUILD.bazel +++ b/packages/kbn-std/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-std" +PKG_DIRNAME = "kbn-std" PKG_REQUIRE_NAME = "@kbn/std" SOURCE_FILES = glob( @@ -76,25 +76,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -105,19 +110,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-std/package.json b/packages/kbn-std/package.json index 68f59742310d1..b338657ccea3c 100644 --- a/packages/kbn-std/package.json +++ b/packages/kbn-std/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-std/tsconfig.json b/packages/kbn-std/tsconfig.json index ecf2b68de7b6f..292157c18591a 100644 --- a/packages/kbn-std/tsconfig.json +++ b/packages/kbn-std/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": true, + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-stdio-dev-helpers/BUILD.bazel b/packages/kbn-stdio-dev-helpers/BUILD.bazel index cb4dd154463d6..fee92d0b182d8 100644 --- a/packages/kbn-stdio-dev-helpers/BUILD.bazel +++ b/packages/kbn-stdio-dev-helpers/BUILD.bazel @@ -87,7 +87,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -101,6 +100,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -112,17 +119,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-stdio-dev-helpers/package.json b/packages/kbn-stdio-dev-helpers/package.json index ac14acd56e729..6d0237b0d0f68 100644 --- a/packages/kbn-stdio-dev-helpers/package.json +++ b/packages/kbn-stdio-dev-helpers/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-stdio-dev-helpers/tsconfig.json b/packages/kbn-stdio-dev-helpers/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-stdio-dev-helpers/tsconfig.json +++ b/packages/kbn-stdio-dev-helpers/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-storybook/BUILD.bazel b/packages/kbn-storybook/BUILD.bazel index c85352b8ac914..aed873551d328 100644 --- a/packages/kbn-storybook/BUILD.bazel +++ b/packages/kbn-storybook/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-storybook" +PKG_DIRNAME = "kbn-storybook" PKG_REQUIRE_NAME = "@kbn/storybook" SOURCE_FILES = glob( @@ -108,25 +108,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -137,20 +142,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) - diff --git a/packages/kbn-storybook/package.json b/packages/kbn-storybook/package.json index 162152c7f1922..59f6a1a58e3a8 100644 --- a/packages/kbn-storybook/package.json +++ b/packages/kbn-storybook/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js" + "main": "./target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-storybook/tsconfig.json b/packages/kbn-storybook/tsconfig.json index 78e504491d999..3621ceb664a10 100644 --- a/packages/kbn-storybook/tsconfig.json +++ b/packages/kbn-storybook/tsconfig.json @@ -2,9 +2,7 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, "outDir": "target_types", "skipLibCheck": true, "target": "es2015", diff --git a/packages/kbn-synthetic-package-map/tsconfig.json b/packages/kbn-synthetic-package-map/tsconfig.json index 7e53dd39bce02..75177b5488a9b 100644 --- a/packages/kbn-synthetic-package-map/tsconfig.json +++ b/packages/kbn-synthetic-package-map/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "node" ] diff --git a/packages/kbn-telemetry-tools/BUILD.bazel b/packages/kbn-telemetry-tools/BUILD.bazel index b234f2dd6ea45..7b55705968e78 100644 --- a/packages/kbn-telemetry-tools/BUILD.bazel +++ b/packages/kbn-telemetry-tools/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-telemetry-tools" +PKG_DIRNAME = "kbn-telemetry-tools" PKG_REQUIRE_NAME = "@kbn/telemetry-tools" SOURCE_FILES = glob( @@ -82,25 +82,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -111,19 +116,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-telemetry-tools/package.json b/packages/kbn-telemetry-tools/package.json index 649ff72a56956..9381f23de133f 100644 --- a/packages/kbn-telemetry-tools/package.json +++ b/packages/kbn-telemetry-tools/package.json @@ -4,5 +4,6 @@ "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", "main": "./target_node/index.js", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-telemetry-tools/src/tools/__fixture__/mock_schema_with_descriptions.json b/packages/kbn-telemetry-tools/src/tools/__fixture__/mock_schema_with_descriptions.json index 77321327b3894..c7750f3fd0c39 100644 --- a/packages/kbn-telemetry-tools/src/tools/__fixture__/mock_schema_with_descriptions.json +++ b/packages/kbn-telemetry-tools/src/tools/__fixture__/mock_schema_with_descriptions.json @@ -50,7 +50,11 @@ } } }, - "my_str_array": { "type": "array", "items": { "type": "keyword" } } + "my_str_array": { "type": "array", "items": { "type": "keyword" } }, + "my_pass_through": { + "type": "pass_through", + "_meta": { "description": "Don't know what goes here. Simply passing it through."} + } } } } diff --git a/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_working_collector_with_description.ts b/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_working_collector_with_description.ts index a2f9379eec7ac..840cd7bb9595b 100644 --- a/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_working_collector_with_description.ts +++ b/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_working_collector_with_description.ts @@ -56,6 +56,10 @@ export const parsedCollectorWithDescription: ParsedUsageCollection = [ }, }, my_str_array: { type: 'array', items: { type: 'keyword' } }, + my_pass_through: { + type: 'pass_through', + _meta: { description: "Don't know what goes here. Simply passing it through." }, + }, }, }, fetch: { @@ -103,6 +107,10 @@ export const parsedCollectorWithDescription: ParsedUsageCollection = [ type: 'StringKeyword', }, }, + my_pass_through: { + kind: SyntaxKind.UnknownKeyword, + type: 'UnknownKeyword', + }, }, }, }, diff --git a/packages/kbn-telemetry-tools/src/tools/manage_schema.ts b/packages/kbn-telemetry-tools/src/tools/manage_schema.ts index cf7dfa6cf79d1..e66e72b00903f 100644 --- a/packages/kbn-telemetry-tools/src/tools/manage_schema.ts +++ b/packages/kbn-telemetry-tools/src/tools/manage_schema.ts @@ -10,7 +10,13 @@ import { ParsedUsageCollection } from './ts_parser'; export type AllowedSchemaNumberTypes = 'long' | 'integer' | 'short' | 'byte' | 'double' | 'float'; -export type AllowedSchemaTypes = AllowedSchemaNumberTypes | 'keyword' | 'text' | 'boolean' | 'date'; +export type AllowedSchemaTypes = + | AllowedSchemaNumberTypes + | 'keyword' + | 'text' + | 'boolean' + | 'date' + | 'pass_through'; export function compatibleSchemaTypes(type: AllowedSchemaTypes | 'array') { switch (type) { @@ -29,6 +35,8 @@ export function compatibleSchemaTypes(type: AllowedSchemaTypes | 'array') { return 'number'; case 'array': return 'array'; + case 'pass_through': + return 'unknown'; default: throw new Error(`Unknown schema type ${type}`); } diff --git a/packages/kbn-telemetry-tools/src/tools/serializer.test.ts b/packages/kbn-telemetry-tools/src/tools/serializer.test.ts index 5661db270186c..acb4d24cbd8ff 100644 --- a/packages/kbn-telemetry-tools/src/tools/serializer.test.ts +++ b/packages/kbn-telemetry-tools/src/tools/serializer.test.ts @@ -167,4 +167,13 @@ describe('getDescriptor', () => { prop5: { kind: ts.SyntaxKind.FirstLiteralToken, type: 'FirstLiteralToken' }, }); }); + + it('serializes RecordStringUnknown', () => { + const usageInterface = usageInterfaces.get('RecordStringUnknown')!; + const descriptor = getDescriptor(usageInterface, tsProgram); + expect(descriptor).toEqual({ + kind: ts.SyntaxKind.UnknownKeyword, + type: 'UnknownKeyword', + }); + }); }); diff --git a/packages/kbn-telemetry-tools/src/tools/serializer.ts b/packages/kbn-telemetry-tools/src/tools/serializer.ts index 31fad9a5dadb2..e6756f597b747 100644 --- a/packages/kbn-telemetry-tools/src/tools/serializer.ts +++ b/packages/kbn-telemetry-tools/src/tools/serializer.ts @@ -62,6 +62,8 @@ export function kindToDescriptorName(kind: number) { case ts.SyntaxKind.NumberKeyword: case ts.SyntaxKind.NumericLiteral: return 'number'; + case ts.SyntaxKind.UnknownKeyword: + return 'unknown'; default: throw new Error(`Unknown kind ${kind}`); } @@ -219,6 +221,15 @@ export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor | // Support `Record` if (symbolName === 'Record') { + // Special use case `Record` + if ( + node.typeArguments![0].kind === ts.SyntaxKind.StringKeyword && + node.typeArguments![1].kind === ts.SyntaxKind.UnknownKeyword + ) { + const kind = node.typeArguments![1].kind; + return { kind, type: ts.SyntaxKind[kind] as keyof typeof ts.SyntaxKind }; + } + const descriptor = getDescriptor(node.typeArguments![1], program); if (node.typeArguments![0].kind === ts.SyntaxKind.StringKeyword) { return { '@@INDEX@@': descriptor }; diff --git a/packages/kbn-telemetry-tools/tsconfig.json b/packages/kbn-telemetry-tools/tsconfig.json index eb400d5ce0de6..59c205335d6ab 100644 --- a/packages/kbn-telemetry-tools/tsconfig.json +++ b/packages/kbn-telemetry-tools/tsconfig.json @@ -2,10 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "isolatedModules": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-test-jest-helpers/BUILD.bazel b/packages/kbn-test-jest-helpers/BUILD.bazel index d31f9184cf2ac..847d0c25e73af 100644 --- a/packages/kbn-test-jest-helpers/BUILD.bazel +++ b/packages/kbn-test-jest-helpers/BUILD.bazel @@ -3,7 +3,7 @@ load("@npm//@babel/cli:index.bzl", "babel") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-test-jest-helpers" +PKG_DIRNAME = "kbn-test-jest-helpers" PKG_REQUIRE_NAME = "@kbn/test-jest-helpers" SOURCE_FILES = glob( @@ -141,25 +141,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -170,19 +175,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-test-jest-helpers/package.json b/packages/kbn-test-jest-helpers/package.json index fa5851895c6d0..646b0baa96a13 100644 --- a/packages/kbn-test-jest-helpers/package.json +++ b/packages/kbn-test-jest-helpers/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node" + "main": "./target_node", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-test-jest-helpers/tsconfig.json b/packages/kbn-test-jest-helpers/tsconfig.json index 8755357502305..2b02a63db1d05 100644 --- a/packages/kbn-test-jest-helpers/tsconfig.json +++ b/packages/kbn-test-jest-helpers/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": true, + "outDir": "target_types", "types": ["jest", "node"] }, "include": [ diff --git a/packages/kbn-test-subj-selector/BUILD.bazel b/packages/kbn-test-subj-selector/BUILD.bazel index a92554c948230..57afbf86c1bc9 100644 --- a/packages/kbn-test-subj-selector/BUILD.bazel +++ b/packages/kbn-test-subj-selector/BUILD.bazel @@ -83,7 +83,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -97,6 +96,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -108,17 +115,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-test-subj-selector/package.json b/packages/kbn-test-subj-selector/package.json index 6c8d040735d50..1cb9f52b9e027 100644 --- a/packages/kbn-test-subj-selector/package.json +++ b/packages/kbn-test-subj-selector/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-test-subj-selector/tsconfig.json b/packages/kbn-test-subj-selector/tsconfig.json index 81935b1385550..292157c18591a 100644 --- a/packages/kbn-test-subj-selector/tsconfig.json +++ b/packages/kbn-test-subj-selector/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-test/BUILD.bazel b/packages/kbn-test/BUILD.bazel index 1deca3a0f6d07..c16e3e223fe4d 100644 --- a/packages/kbn-test/BUILD.bazel +++ b/packages/kbn-test/BUILD.bazel @@ -3,7 +3,7 @@ load("@npm//@babel/cli:index.bzl", "babel") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-test" +PKG_DIRNAME = "kbn-test" PKG_REQUIRE_NAME = "@kbn/test" SOURCE_FILES = glob( @@ -163,25 +163,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -192,19 +197,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-test/jest-preset.js b/packages/kbn-test/jest-preset.js index 3cb0ce86602cd..c13dbb5149f43 100644 --- a/packages/kbn-test/jest-preset.js +++ b/packages/kbn-test/jest-preset.js @@ -113,9 +113,6 @@ module.exports = { `integration_tests/`, ], - // This option allows use of a custom test runner - testRunner: 'jest-circus/runner', - // A map from regular expressions to paths to transformers transform: { '^.+\\.(js|tsx?)$': '/node_modules/@kbn/test/target_node/src/jest/babel_transform.js', diff --git a/packages/kbn-test/package.json b/packages/kbn-test/package.json index de6ba54c26800..dff56ec9b524c 100644 --- a/packages/kbn-test/package.json +++ b/packages/kbn-test/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node" + "main": "./target_node", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js b/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js index 62104cebf9cba..a0db7db6f0017 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js @@ -38,7 +38,12 @@ function allTestsAreSkipped(suite) { return childrenSkipped; } -export function decorateMochaUi(log, lifecycle, context, { rootTags }) { +/** + * @param {import('../lifecycle').Lifecycle} lifecycle + * @param {any} context + * @param {{ rootTags?: string[] }} options + */ +export function decorateMochaUi(lifecycle, context, { rootTags }) { // incremented at the start of each suite, decremented after // so that in each non-suite call we can know if we are within // a suite, or that when a suite is defined it is within a suite diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/load_tests.ts b/packages/kbn-test/src/functional_test_runner/lib/mocha/load_tests.ts index 32f61caf1b3c7..f226d37c41ee1 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/load_tests.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/load_tests.ts @@ -17,7 +17,6 @@ import type { ProviderCollection } from '../providers'; import { loadTracer } from '../load_tracer'; import { decorateSnapshotUi } from '../snapshots/decorate_snapshot_ui'; -// @ts-expect-error not js yet import { decorateMochaUi } from './decorate_mocha_ui'; type TestProvider = (ctx: GenericFtrProviderContext) => void; @@ -48,9 +47,6 @@ export const loadTests = ({ updateBaselines, updateSnapshots, }: Options) => { - const dockerServers = config.get('dockerServers'); - const isDockerGroup = dockerServers && Object.keys(dockerServers).length; - const ctx: GenericFtrProviderContext = { loadTestFile, getService: providers.getService as any, @@ -80,8 +76,7 @@ export const loadTests = ({ function withMocha(debugPath: string, fn: () => void) { // mocha.suite hocus-pocus comes from: https://git.io/vDnXO - const context = decorateMochaUi(log, lifecycle, global, { - isDockerGroup, + const context = decorateMochaUi(lifecycle, global, { rootTags: config.get('rootTags'), }); mocha.suite.emit('pre-require', context, debugPath, mocha); diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts b/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts index 10c51517aec94..ae42945b6bfdb 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts @@ -19,9 +19,7 @@ import { Config } from '../config'; import { ProviderCollection } from '../providers'; import { EsVersion } from '../es_version'; -// @ts-expect-error not ts yet import { MochaReporterProvider } from './reporter'; -// @ts-expect-error not ts yet import { validateCiGroupTags } from './validate_ci_group_tags'; interface Options { diff --git a/packages/kbn-test/src/functional_test_runner/lib/snapshots/decorate_snapshot_ui.ts b/packages/kbn-test/src/functional_test_runner/lib/snapshots/decorate_snapshot_ui.ts index 02e96f62e2488..b7efb33bcd506 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/snapshots/decorate_snapshot_ui.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/snapshots/decorate_snapshot_ui.ts @@ -13,8 +13,6 @@ import { addSerializer, } from 'jest-snapshot'; import path from 'path'; -import prettier from 'prettier'; -import babelTraverse from '@babel/traverse'; import { once } from 'lodash'; import { Lifecycle } from '../lifecycle'; import { Suite, Test } from '../../fake_mocha_types'; @@ -161,8 +159,8 @@ function getSnapshotState(file: string, updateSnapshot: SnapshotUpdateState) { path.join(dirname + `/__snapshots__/` + filename.replace(path.extname(filename), '.snap')), { updateSnapshot, - getPrettier: () => prettier, - getBabelTraverse: () => babelTraverse, + prettierPath: require.resolve('prettier'), + snapshotFormat: { escapeString: true, printBasicPrototype: true }, } ); diff --git a/packages/kbn-test/src/jest/babel_transform.js b/packages/kbn-test/src/jest/babel_transform.js index 8b25b635bbb13..f2fbbfe00b603 100644 --- a/packages/kbn-test/src/jest/babel_transform.js +++ b/packages/kbn-test/src/jest/babel_transform.js @@ -8,7 +8,7 @@ const babelJest = require('babel-jest'); -module.exports = babelJest.createTransformer({ +module.exports = babelJest.default.createTransformer({ presets: [ [ require.resolve('@kbn/babel-preset/node_preset'), diff --git a/packages/kbn-test/src/jest/configs/get_all_jest_paths.ts b/packages/kbn-test/src/jest/configs/get_all_jest_paths.ts index 336e28bd16fd5..ca071f33507bf 100644 --- a/packages/kbn-test/src/jest/configs/get_all_jest_paths.ts +++ b/packages/kbn-test/src/jest/configs/get_all_jest_paths.ts @@ -11,7 +11,6 @@ import Path from 'path'; import minimatch from 'minimatch'; import { getRepoFiles } from '@kbn/get-repo-files'; -// @ts-expect-error jest-preset is necessarily a JS file import { testMatch } from '../../../jest-preset'; const UNIT_CONFIG_NAME = 'jest.config.js'; diff --git a/packages/kbn-test/src/jest/configs/get_tests_for_config_paths.ts b/packages/kbn-test/src/jest/configs/get_tests_for_config_paths.ts index 9d0105977a12e..10474413ba297 100644 --- a/packages/kbn-test/src/jest/configs/get_tests_for_config_paths.ts +++ b/packages/kbn-test/src/jest/configs/get_tests_for_config_paths.ts @@ -7,8 +7,8 @@ */ import { readConfig } from 'jest-config'; -import { createContext } from 'jest-runtime'; import { SearchSource } from 'jest'; +import Runtime from 'jest-runtime'; import { asyncMapWithLimit } from '@kbn/std'; const EMPTY_ARGV = { @@ -34,7 +34,7 @@ export async function getTestsForConfigPaths( return await asyncMapWithLimit(configPaths, 60, async (path) => { const config = await readConfig(EMPTY_ARGV, path); const searchSource = new SearchSource( - await createContext(config.projectConfig, { + await Runtime.createContext(config.projectConfig, { maxWorkers: 1, watchman: false, watch: false, diff --git a/packages/kbn-test/src/jest/junit_reporter.ts b/packages/kbn-test/src/jest/junit_reporter.ts index eb5828120a57b..6a1ce9d51ded9 100644 --- a/packages/kbn-test/src/jest/junit_reporter.ts +++ b/packages/kbn-test/src/jest/junit_reporter.ts @@ -60,8 +60,9 @@ export default class JestJUnitReporter extends BaseReporter { ); const msToIso = (ms: number | null | undefined) => - ms ? new Date(ms).toISOString().slice(0, -5) : undefined; - const msToSec = (ms: number | null | undefined) => (ms ? (ms / 1000).toFixed(3) : undefined); + typeof ms === 'number' ? new Date(ms).toISOString().slice(0, -5) : undefined; + const msToSec = (ms: number | null | undefined) => + typeof ms === 'number' ? (ms / 1000).toFixed(3) : undefined; root.att({ name: 'jest', diff --git a/packages/kbn-test/src/jest/run.ts b/packages/kbn-test/src/jest/run.ts index daf4706cebdba..8efcafbec6c87 100644 --- a/packages/kbn-test/src/jest/run.ts +++ b/packages/kbn-test/src/jest/run.ts @@ -20,31 +20,18 @@ import { resolve, relative, sep as osSep } from 'path'; import { existsSync } from 'fs'; import { run } from 'jest'; -import { buildArgv } from 'jest-cli/build/cli'; import { ToolingLog } from '@kbn/tooling-log'; import { getTimeReporter } from '@kbn/ci-stats-reporter'; import { REPO_ROOT } from '@kbn/utils'; import { map } from 'lodash'; +import getopts from 'getopts'; // yarn test:jest src/core/server/saved_objects // yarn test:jest src/core/public/core_system.test.ts // :kibana/src/core/server/saved_objects yarn test:jest -// Patch node 16 types to be compatible with jest 26 -// https://github.com/facebook/jest/issues/11640#issuecomment-893867514 -/* eslint-disable @typescript-eslint/no-namespace,@typescript-eslint/no-empty-interface,no-console */ -declare global { - namespace NodeJS { - interface Global {} - interface InspectOptions {} - - interface ConsoleConstructor extends console.ConsoleConstructor {} - } -} -/* eslint-enable */ - export function runJest(configName = 'jest.config.js') { - const argv = buildArgv(process.argv); + const argv = getopts(process.argv.slice(2)); const devConfigName = 'jest.config.dev.js'; const log = new ToolingLog({ @@ -60,7 +47,7 @@ export function runJest(configName = 'jest.config.js') { const cwd: string = process.env.INIT_CWD || process.cwd(); if (!argv.config) { - testFiles = argv._.splice(2).map((p) => resolve(cwd, p.toString())); + testFiles = argv._.map((p) => resolve(cwd, p.toString())); const commonTestFiles = commonBasePath(testFiles); const testFilesProvided = testFiles.length > 0; diff --git a/packages/kbn-test/src/jest/setup/setup_test.js b/packages/kbn-test/src/jest/setup/setup_test.js index a3eb15a2d2634..b0038daf196c9 100644 --- a/packages/kbn-test/src/jest/setup/setup_test.js +++ b/packages/kbn-test/src/jest/setup/setup_test.js @@ -13,3 +13,9 @@ import 'jest-styled-components'; import '@testing-library/jest-dom'; + +/** + * Removed in Jest 27/jsdom, used in some transitive dependencies + */ +global.setImmediate = require('core-js/stable/set-immediate'); +global.clearImmediate = require('core-js/stable/clear-immediate'); diff --git a/packages/kbn-test/src/kbn/kbn_test_config.ts b/packages/kbn-test/src/kbn/kbn_test_config.ts index ad2af4c2ff81c..01a7edbc861df 100644 --- a/packages/kbn-test/src/kbn/kbn_test_config.ts +++ b/packages/kbn-test/src/kbn/kbn_test_config.ts @@ -9,7 +9,7 @@ import url from 'url'; import { kibanaTestUser } from './users'; -interface UrlParts { +export interface UrlParts { protocol?: string; hostname?: string; port?: number; diff --git a/packages/kbn-test/tsconfig.json b/packages/kbn-test/tsconfig.json index a8c39f0affd7a..282d23e8bcb12 100644 --- a/packages/kbn-test/tsconfig.json +++ b/packages/kbn-test/tsconfig.json @@ -2,9 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "stripInternal": true, "types": ["jest", "node"] }, diff --git a/packages/kbn-timelion-grammar/BUILD.bazel b/packages/kbn-timelion-grammar/BUILD.bazel index c906223c2253b..3c7ea13cadf64 100644 --- a/packages/kbn-timelion-grammar/BUILD.bazel +++ b/packages/kbn-timelion-grammar/BUILD.bazel @@ -2,7 +2,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("@npm//peggy:index.bzl", "peggy") load("//src/dev/bazel:index.bzl", "pkg_npm") -PKG_BASE_NAME = "kbn-timelion-grammar" +PKG_DIRNAME = "kbn-timelion-grammar" PKG_REQUIRE_NAME = "@kbn/timelion-grammar" NPM_MODULE_EXTRA_FILES = [ @@ -23,7 +23,7 @@ peggy( ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [ ":grammar" ], @@ -33,9 +33,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-timelion-grammar/kibana.jsonc b/packages/kbn-timelion-grammar/kibana.jsonc index 211d8483089c2..ec0f5079abb80 100644 --- a/packages/kbn-timelion-grammar/kibana.jsonc +++ b/packages/kbn-timelion-grammar/kibana.jsonc @@ -1,7 +1,7 @@ { "type": "shared-common", "id": "@kbn/timelion-grammar", - "owner": "@elastic/kibana-vis-editors", + "owner": "@elastic/kibana-visualizations", "runtimeDeps": [], "typeDeps": [] } diff --git a/packages/kbn-tinymath/BUILD.bazel b/packages/kbn-tinymath/BUILD.bazel index ffbd74da2d02e..b8ee25a4973b8 100644 --- a/packages/kbn-tinymath/BUILD.bazel +++ b/packages/kbn-tinymath/BUILD.bazel @@ -2,7 +2,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("@npm//peggy:index.bzl", "peggy") load("//src/dev/bazel:index.bzl", "pkg_npm") -PKG_BASE_NAME = "kbn-tinymath" +PKG_DIRNAME = "kbn-tinymath" PKG_REQUIRE_NAME = "@kbn/tinymath" SOURCE_FILES = glob( @@ -45,7 +45,7 @@ peggy( ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [ ":srcs", ":grammar" @@ -57,9 +57,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-tinymath/kibana.jsonc b/packages/kbn-tinymath/kibana.jsonc index 6ebf2ac0c00ea..3a26322d2394b 100644 --- a/packages/kbn-tinymath/kibana.jsonc +++ b/packages/kbn-tinymath/kibana.jsonc @@ -1,7 +1,7 @@ { "type": "shared-common", "id": "@kbn/tinymath", - "owner": "@elastic/kibana-vis-editors", + "owner": "@elastic/kibana-visualizations", "runtimeDeps": [], "typeDeps": [] } diff --git a/packages/kbn-tooling-log/BUILD.bazel b/packages/kbn-tooling-log/BUILD.bazel index 1ae1e37deaf3d..a61c6039312ae 100644 --- a/packages/kbn-tooling-log/BUILD.bazel +++ b/packages/kbn-tooling-log/BUILD.bazel @@ -89,7 +89,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -103,6 +102,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -114,17 +121,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-tooling-log/package.json b/packages/kbn-tooling-log/package.json index 5af0ae2aca79a..45bdc79a120d8 100644 --- a/packages/kbn-tooling-log/package.json +++ b/packages/kbn-tooling-log/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-tooling-log/tsconfig.json b/packages/kbn-tooling-log/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-tooling-log/tsconfig.json +++ b/packages/kbn-tooling-log/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-type-summarizer-cli/BUILD.bazel b/packages/kbn-type-summarizer-cli/BUILD.bazel index 07d6d932210f8..441fa393e5e44 100644 --- a/packages/kbn-type-summarizer-cli/BUILD.bazel +++ b/packages/kbn-type-summarizer-cli/BUILD.bazel @@ -88,7 +88,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -102,6 +101,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + directory_file_path( name = "bazel-cli-path", directory = ":target_node", @@ -126,17 +133,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-type-summarizer-cli/package.json b/packages/kbn-type-summarizer-cli/package.json index 8b71981054f11..2b013abe15705 100644 --- a/packages/kbn-type-summarizer-cli/package.json +++ b/packages/kbn-type-summarizer-cli/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-type-summarizer-cli/tsconfig.json b/packages/kbn-type-summarizer-cli/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-type-summarizer-cli/tsconfig.json +++ b/packages/kbn-type-summarizer-cli/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-type-summarizer-core/BUILD.bazel b/packages/kbn-type-summarizer-core/BUILD.bazel index 89ab644f23d0b..b63a38b44d088 100644 --- a/packages/kbn-type-summarizer-core/BUILD.bazel +++ b/packages/kbn-type-summarizer-core/BUILD.bazel @@ -94,7 +94,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -108,6 +107,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -119,17 +126,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-type-summarizer-core/package.json b/packages/kbn-type-summarizer-core/package.json index 1ad7560b3571c..cae83a800eb3b 100644 --- a/packages/kbn-type-summarizer-core/package.json +++ b/packages/kbn-type-summarizer-core/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-type-summarizer-core/tsconfig.json b/packages/kbn-type-summarizer-core/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-type-summarizer-core/tsconfig.json +++ b/packages/kbn-type-summarizer-core/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-type-summarizer/BUILD.bazel b/packages/kbn-type-summarizer/BUILD.bazel index 11dc9632c502e..b1f73bec487ea 100644 --- a/packages/kbn-type-summarizer/BUILD.bazel +++ b/packages/kbn-type-summarizer/BUILD.bazel @@ -96,7 +96,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -110,6 +109,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -121,17 +128,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-type-summarizer/package.json b/packages/kbn-type-summarizer/package.json index 9ea19f6497219..4442ef893a931 100644 --- a/packages/kbn-type-summarizer/package.json +++ b/packages/kbn-type-summarizer/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-type-summarizer/tsconfig.json b/packages/kbn-type-summarizer/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-type-summarizer/tsconfig.json +++ b/packages/kbn-type-summarizer/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/kbn-typed-react-router-config/BUILD.bazel b/packages/kbn-typed-react-router-config/BUILD.bazel index c14f2b66b9870..841e2b287d7af 100644 --- a/packages/kbn-typed-react-router-config/BUILD.bazel +++ b/packages/kbn-typed-react-router-config/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-typed-react-router-config" +PKG_DIRNAME = "kbn-typed-react-router-config" PKG_REQUIRE_NAME = "@kbn/typed-react-router-config" SOURCE_FILES = glob( @@ -93,25 +93,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -122,19 +127,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-typed-react-router-config/package.json b/packages/kbn-typed-react-router-config/package.json index 0f45f63f4ab2d..d200aeef52311 100644 --- a/packages/kbn-typed-react-router-config/package.json +++ b/packages/kbn-typed-react-router-config/package.json @@ -4,5 +4,6 @@ "browser": "target_web/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-typed-react-router-config/tsconfig.json b/packages/kbn-typed-react-router-config/tsconfig.json index e915172b9f504..4c1b75ae89f88 100644 --- a/packages/kbn-typed-react-router-config/tsconfig.json +++ b/packages/kbn-typed-react-router-config/tsconfig.json @@ -2,11 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "isolatedModules": true, - "outDir": "./target_types", - "stripInternal": true, + "outDir": "target_types", "types": [ "node", "jest" diff --git a/packages/kbn-ui-framework/BUILD.bazel b/packages/kbn-ui-framework/BUILD.bazel index f38e10eafeec7..2e801955a8524 100644 --- a/packages/kbn-ui-framework/BUILD.bazel +++ b/packages/kbn-ui-framework/BUILD.bazel @@ -1,7 +1,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "pkg_npm") -PKG_BASE_NAME = "kbn-ui-framework" +PKG_DIRNAME = "kbn-ui-framework" PKG_REQUIRE_NAME = "@kbn/ui-framework" SOURCE_FILES = glob([ @@ -23,7 +23,7 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [] js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES + [ ":srcs", ], @@ -34,9 +34,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( diff --git a/packages/kbn-ui-shared-deps-npm/BUILD.bazel b/packages/kbn-ui-shared-deps-npm/BUILD.bazel index c20613e128e49..fe0e97913fa49 100644 --- a/packages/kbn-ui-shared-deps-npm/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-npm/BUILD.bazel @@ -3,12 +3,11 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-ui-shared-deps-npm" +PKG_DIRNAME = "kbn-ui-shared-deps-npm" PKG_REQUIRE_NAME = "@kbn/ui-shared-deps-npm" SOURCE_FILES = glob( [ - "**/*.ts", "**/*.js", ], exclude = [ @@ -44,6 +43,8 @@ RUNTIME_DEPS = [ "@npm//@elastic/numeral", "@npm//@emotion/cache", "@npm//@emotion/react", + "@npm//@tanstack/react-query", + "@npm//@tanstack/react-query-devtools", "@npm//babel-loader", "@npm//core-js", "@npm//css-loader", @@ -129,7 +130,6 @@ ts_project( deps = TYPES_DEPS, allow_js = True, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -154,18 +154,24 @@ webpack( ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":shared_built_assets"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":shared_built_assets", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -176,19 +182,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ui-shared-deps-npm/index.d.ts b/packages/kbn-ui-shared-deps-npm/index.d.ts new file mode 100644 index 0000000000000..0541240af8e0a --- /dev/null +++ b/packages/kbn-ui-shared-deps-npm/index.d.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +// NOTE, this types for this package are actually based on the index.js +// file, but this file is here so that when loading the source you don't +// have to set `allowJs` for your project + +export type ThemeVersion = 'v8'; +export const distDir: string; +export const dllManifestPath: string; +export const dllFilename: string; +export const publicPathLoader: string; +export function lightCssDistFilename(themeVersion: ThemeVersion): string; +export function darkCssDistFilename(themeVersion: ThemeVersion): string; diff --git a/packages/kbn-ui-shared-deps-npm/package.json b/packages/kbn-ui-shared-deps-npm/package.json index 78568254e30ea..aaefa7f714ceb 100644 --- a/packages/kbn-ui-shared-deps-npm/package.json +++ b/packages/kbn-ui-shared-deps-npm/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "target_node/index.js" + "main": "target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-ui-shared-deps-npm/tsconfig.json b/packages/kbn-ui-shared-deps-npm/tsconfig.json index b0034d2ce15f3..e142364eaa188 100644 --- a/packages/kbn-ui-shared-deps-npm/tsconfig.json +++ b/packages/kbn-ui-shared-deps-npm/tsconfig.json @@ -1,11 +1,9 @@ { "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "allowJs": true, "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "node", ] diff --git a/packages/kbn-ui-shared-deps-npm/webpack.config.js b/packages/kbn-ui-shared-deps-npm/webpack.config.js index 8f6c2dad5c94f..68396a15e371d 100644 --- a/packages/kbn-ui-shared-deps-npm/webpack.config.js +++ b/packages/kbn-ui-shared-deps-npm/webpack.config.js @@ -82,6 +82,8 @@ module.exports = (_, argv) => { '@elastic/eui/dist/eui_theme_dark.json', '@elastic/numeral', '@emotion/react', + '@tanstack/react-query', + '@tanstack/react-query-devtools', 'classnames', 'fflate', 'history', diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index 4979792e00ee5..97006c36eb285 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -3,7 +3,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-ui-shared-deps-src" +PKG_DIRNAME = "kbn-ui-shared-deps-src" PKG_REQUIRE_NAME = "@kbn/ui-shared-deps-src" SOURCE_FILES = glob( @@ -42,6 +42,7 @@ RUNTIME_DEPS = [ "//packages/kbn-analytics", "//packages/kbn-babel-preset", "//packages/kbn-datemath", + "//packages/kbn-es-query", "//packages/kbn-flot-charts", "//packages/kbn-i18n", "//packages/kbn-i18n-react", @@ -86,7 +87,6 @@ ts_project( deps = TYPES_DEPS, allow_js = True, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -111,18 +111,24 @@ webpack( ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":shared_built_assets"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":shared_built_assets", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -133,19 +139,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ui-shared-deps-src/package.json b/packages/kbn-ui-shared-deps-src/package.json index e45e8d5496988..3290d7e60032f 100644 --- a/packages/kbn-ui-shared-deps-src/package.json +++ b/packages/kbn-ui-shared-deps-src/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "target_node/index.js" + "main": "target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-ui-shared-deps-src/src/definitions.js b/packages/kbn-ui-shared-deps-src/src/definitions.js index 069b7d82f9078..96826b0616761 100644 --- a/packages/kbn-ui-shared-deps-src/src/definitions.js +++ b/packages/kbn-ui-shared-deps-src/src/definitions.js @@ -74,11 +74,14 @@ const externals = { */ tslib: '__kbnSharedDeps__.TsLib', '@kbn/analytics': '__kbnSharedDeps__.KbnAnalytics', + '@kbn/es-query': '__kbnSharedDeps__.KbnEsQuery', '@kbn/std': '__kbnSharedDeps__.KbnStd', '@kbn/safer-lodash-set': '__kbnSharedDeps__.SaferLodashSet', 'rison-node': '__kbnSharedDeps__.RisonNode', history: '__kbnSharedDeps__.History', classnames: '__kbnSharedDeps__.Classnames', + '@tanstack/react-query': '__kbnSharedDeps__.ReactQuery', + '@tanstack/react-query-devtools': '__kbnSharedDeps__.ReactQueryDevtools', }; module.exports = { distDir, jsFilename, cssDistFilename, externals }; diff --git a/packages/kbn-ui-shared-deps-src/src/entry.js b/packages/kbn-ui-shared-deps-src/src/entry.js index 233872bacff58..c7c8f5e95342e 100644 --- a/packages/kbn-ui-shared-deps-src/src/entry.js +++ b/packages/kbn-ui-shared-deps-src/src/entry.js @@ -54,8 +54,11 @@ export const Fflate = { unzlibSync, strFromU8 }; // runtime deps which don't need to be copied across all bundles export const TsLib = require('tslib'); export const KbnAnalytics = require('@kbn/analytics'); +export const KbnEsQuery = require('@kbn/es-query'); export const KbnStd = require('@kbn/std'); export const SaferLodashSet = require('@kbn/safer-lodash-set'); export const RisonNode = require('rison-node'); export const History = require('history'); export const Classnames = require('classnames'); +export const ReactQuery = require('@tanstack/react-query'); +export const ReactQueryDevtools = require('@tanstack/react-query-devtools'); diff --git a/packages/kbn-ui-shared-deps-src/tsconfig.json b/packages/kbn-ui-shared-deps-src/tsconfig.json index b0034d2ce15f3..e142364eaa188 100644 --- a/packages/kbn-ui-shared-deps-src/tsconfig.json +++ b/packages/kbn-ui-shared-deps-src/tsconfig.json @@ -1,11 +1,9 @@ { "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "allowJs": true, "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", + "outDir": "target_types", "types": [ "node", ] diff --git a/packages/kbn-ui-theme/BUILD.bazel b/packages/kbn-ui-theme/BUILD.bazel index a004975293a0b..4e17de1eb6ab7 100644 --- a/packages/kbn-ui-theme/BUILD.bazel +++ b/packages/kbn-ui-theme/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-ui-theme" +PKG_DIRNAME = "kbn-ui-theme" PKG_REQUIRE_NAME = "@kbn/ui-theme" SOURCE_FILES = glob( @@ -73,25 +73,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -102,19 +107,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ui-theme/package.json b/packages/kbn-ui-theme/package.json index 40fd88b77e7b5..1577f211eae88 100644 --- a/packages/kbn-ui-theme/package.json +++ b/packages/kbn-ui-theme/package.json @@ -4,5 +4,6 @@ "private": true, "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-ui-theme/tsconfig.json b/packages/kbn-ui-theme/tsconfig.json index d5a96f0f9690a..7eae44ef23245 100644 --- a/packages/kbn-ui-theme/tsconfig.json +++ b/packages/kbn-ui-theme/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": true, + "outDir": "target_types", "types": ["node"] }, "include": [ diff --git a/packages/kbn-user-profile-components/BUILD.bazel b/packages/kbn-user-profile-components/BUILD.bazel index fff27d0f68c34..d8d88de063f0e 100644 --- a/packages/kbn-user-profile-components/BUILD.bazel +++ b/packages/kbn-user-profile-components/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-user-profile-components" +PKG_DIRNAME = "kbn-user-profile-components" PKG_REQUIRE_NAME = "@kbn/user-profile-components" SOURCE_FILES = glob( @@ -80,25 +80,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -109,19 +114,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-user-profile-components/tsconfig.json b/packages/kbn-user-profile-components/tsconfig.json index 25f14da15b543..b9cc115dd1264 100644 --- a/packages/kbn-user-profile-components/tsconfig.json +++ b/packages/kbn-user-profile-components/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": true, + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-utility-types-jest/BUILD.bazel b/packages/kbn-utility-types-jest/BUILD.bazel index 3b8985767b244..eaf186c40a3fa 100644 --- a/packages/kbn-utility-types-jest/BUILD.bazel +++ b/packages/kbn-utility-types-jest/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-utility-types-jest" +PKG_DIRNAME = "kbn-utility-types-jest" PKG_REQUIRE_NAME = "@kbn/utility-types-jest" SOURCE_FILES = glob( @@ -63,25 +63,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -92,19 +97,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-utility-types-jest/package.json b/packages/kbn-utility-types-jest/package.json index b409e49384fc7..e057306d4bbdb 100644 --- a/packages/kbn-utility-types-jest/package.json +++ b/packages/kbn-utility-types-jest/package.json @@ -3,5 +3,6 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "target_node/index.js" + "main": "target_node/index.js", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-utility-types-jest/tsconfig.json b/packages/kbn-utility-types-jest/tsconfig.json index ecf2b68de7b6f..292157c18591a 100644 --- a/packages/kbn-utility-types-jest/tsconfig.json +++ b/packages/kbn-utility-types-jest/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": true, + "outDir": "target_types", "types": [ "jest", "node" diff --git a/packages/kbn-utility-types/BUILD.bazel b/packages/kbn-utility-types/BUILD.bazel index ad463d9342580..87a665c2a6b44 100644 --- a/packages/kbn-utility-types/BUILD.bazel +++ b/packages/kbn-utility-types/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-utility-types" +PKG_DIRNAME = "kbn-utility-types" PKG_REQUIRE_NAME = "@kbn/utility-types" SOURCE_FILES = glob( @@ -67,25 +67,30 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -96,19 +101,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-utility-types/package.json b/packages/kbn-utility-types/package.json index fa899c332dee9..fa0eb82dde2ef 100644 --- a/packages/kbn-utility-types/package.json +++ b/packages/kbn-utility-types/package.json @@ -6,5 +6,6 @@ "main": "target_node/index.js", "scripts": { "test": "../../node_modules/.bin/tsd src/tsd_tests" - } + }, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-utility-types/tsconfig.json b/packages/kbn-utility-types/tsconfig.json index d0ba699cae05a..57347ee107af5 100644 --- a/packages/kbn-utility-types/tsconfig.json +++ b/packages/kbn-utility-types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./target_types", - "stripInternal": true, + "outDir": "target_types", "types": [ "node" ] diff --git a/packages/kbn-utils/BUILD.bazel b/packages/kbn-utils/BUILD.bazel index b488b66303910..b66307a04b533 100644 --- a/packages/kbn-utils/BUILD.bazel +++ b/packages/kbn-utils/BUILD.bazel @@ -2,7 +2,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "kbn-utils" +PKG_DIRNAME = "kbn-utils" PKG_REQUIRE_NAME = "@kbn/utils" SOURCE_FILES = glob( @@ -71,14 +71,21 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", ) js_library( - name = PKG_BASE_NAME, + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", srcs = NPM_MODULE_EXTRA_FILES, deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], package_name = PKG_REQUIRE_NAME, @@ -87,9 +94,7 @@ js_library( pkg_npm( name = "npm_module", - deps = [ - ":%s" % PKG_BASE_NAME, - ] + deps = [":" + PKG_DIRNAME], ) filegroup( @@ -100,19 +105,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [ - ":npm_module_types", - ], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-utils/package.json b/packages/kbn-utils/package.json index 596f0548202de..40a60b179667f 100644 --- a/packages/kbn-utils/package.json +++ b/packages/kbn-utils/package.json @@ -3,5 +3,6 @@ "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true + "private": true, + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/kbn-utils/tsconfig.json b/packages/kbn-utils/tsconfig.json index 687c3a7ad6df7..57c1dd1c94e0f 100644 --- a/packages/kbn-utils/tsconfig.json +++ b/packages/kbn-utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "types": [ diff --git a/packages/kbn-yarn-lock-validator/BUILD.bazel b/packages/kbn-yarn-lock-validator/BUILD.bazel index e648a6a01d958..3fb3f48203758 100644 --- a/packages/kbn-yarn-lock-validator/BUILD.bazel +++ b/packages/kbn-yarn-lock-validator/BUILD.bazel @@ -88,7 +88,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -102,6 +101,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -113,17 +120,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-yarn-lock-validator/package.json b/packages/kbn-yarn-lock-validator/package.json index 4d024fb6aded5..01f9de41f960e 100644 --- a/packages/kbn-yarn-lock-validator/package.json +++ b/packages/kbn-yarn-lock-validator/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/kbn-yarn-lock-validator/tsconfig.json b/packages/kbn-yarn-lock-validator/tsconfig.json index d27353840efba..57c1dd1c94e0f 100644 --- a/packages/kbn-yarn-lock-validator/tsconfig.json +++ b/packages/kbn-yarn-lock-validator/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node" diff --git a/packages/shared-ux/avatar/solution/BUILD.bazel b/packages/shared-ux/avatar/solution/BUILD.bazel index 300cb116146aa..d8d9b159db6e7 100644 --- a/packages/shared-ux/avatar/solution/BUILD.bazel +++ b/packages/shared-ux/avatar/solution/BUILD.bazel @@ -114,7 +114,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -128,6 +127,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -139,17 +146,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/avatar/solution/package.json b/packages/shared-ux/avatar/solution/package.json index b0ec8ec947b09..ab91c7c422572 100644 --- a/packages/shared-ux/avatar/solution/package.json +++ b/packages/shared-ux/avatar/solution/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/avatar/solution/tsconfig.json b/packages/shared-ux/avatar/solution/tsconfig.json index a9a0b1253496a..5cb7bca42f195 100644 --- a/packages/shared-ux/avatar/solution/tsconfig.json +++ b/packages/shared-ux/avatar/solution/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/avatar/user_profile/impl/BUILD.bazel b/packages/shared-ux/avatar/user_profile/impl/BUILD.bazel index 447bd41d39788..53beaf2faea93 100644 --- a/packages/shared-ux/avatar/user_profile/impl/BUILD.bazel +++ b/packages/shared-ux/avatar/user_profile/impl/BUILD.bazel @@ -95,7 +95,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -109,6 +108,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -120,17 +127,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/avatar/user_profile/impl/package.json b/packages/shared-ux/avatar/user_profile/impl/package.json index 4621591d690cb..7169836ff1879 100644 --- a/packages/shared-ux/avatar/user_profile/impl/package.json +++ b/packages/shared-ux/avatar/user_profile/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/avatar/user_profile/impl/tsconfig.json b/packages/shared-ux/avatar/user_profile/impl/tsconfig.json index 5f12c69172930..d68e5f7ddeffa 100644 --- a/packages/shared-ux/avatar/user_profile/impl/tsconfig.json +++ b/packages/shared-ux/avatar/user_profile/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/button/exit_full_screen/impl/BUILD.bazel b/packages/shared-ux/button/exit_full_screen/impl/BUILD.bazel index cb06b3e77b75b..b16786012c828 100644 --- a/packages/shared-ux/button/exit_full_screen/impl/BUILD.bazel +++ b/packages/shared-ux/button/exit_full_screen/impl/BUILD.bazel @@ -121,7 +121,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -135,6 +134,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -146,17 +153,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/button/exit_full_screen/impl/package.json b/packages/shared-ux/button/exit_full_screen/impl/package.json index 33cd7d782fd5c..bc56bbeebf40e 100644 --- a/packages/shared-ux/button/exit_full_screen/impl/package.json +++ b/packages/shared-ux/button/exit_full_screen/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/button/exit_full_screen/impl/tsconfig.json b/packages/shared-ux/button/exit_full_screen/impl/tsconfig.json index 428214e7cb241..10624c45bc7cb 100644 --- a/packages/shared-ux/button/exit_full_screen/impl/tsconfig.json +++ b/packages/shared-ux/button/exit_full_screen/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel b/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel index 0accd2fac6a40..995904da1deeb 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel +++ b/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel @@ -97,7 +97,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -111,6 +110,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -122,17 +129,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/button/exit_full_screen/mocks/package.json b/packages/shared-ux/button/exit_full_screen/mocks/package.json index 1ce5731e7bee3..ff766d8e9de14 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/package.json +++ b/packages/shared-ux/button/exit_full_screen/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json b/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json index d0c94b11c5748..a00de7fc73226 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json +++ b/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/button/exit_full_screen/types/tsconfig.json b/packages/shared-ux/button/exit_full_screen/types/tsconfig.json index 7a4adfcdbecff..b863eab85b68e 100644 --- a/packages/shared-ux/button/exit_full_screen/types/tsconfig.json +++ b/packages/shared-ux/button/exit_full_screen/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/shared-ux/button_toolbar/BUILD.bazel b/packages/shared-ux/button_toolbar/BUILD.bazel index b0c98951c4695..e0fcde158bdf8 100644 --- a/packages/shared-ux/button_toolbar/BUILD.bazel +++ b/packages/shared-ux/button_toolbar/BUILD.bazel @@ -106,7 +106,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -120,6 +119,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -131,17 +138,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/button_toolbar/package.json b/packages/shared-ux/button_toolbar/package.json index c9a4569ee2e02..d74cca7bf9bec 100644 --- a/packages/shared-ux/button_toolbar/package.json +++ b/packages/shared-ux/button_toolbar/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/button_toolbar/tsconfig.json b/packages/shared-ux/button_toolbar/tsconfig.json index eea57a49d44d4..158e1387bb883 100644 --- a/packages/shared-ux/button_toolbar/tsconfig.json +++ b/packages/shared-ux/button_toolbar/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/card/no_data/impl/BUILD.bazel b/packages/shared-ux/card/no_data/impl/BUILD.bazel index 394f328ccdcc9..38d138d551c83 100644 --- a/packages/shared-ux/card/no_data/impl/BUILD.bazel +++ b/packages/shared-ux/card/no_data/impl/BUILD.bazel @@ -111,7 +111,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -125,6 +124,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -136,17 +143,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/card/no_data/impl/package.json b/packages/shared-ux/card/no_data/impl/package.json index a1d3efd5a6985..42a1bc7007e0b 100644 --- a/packages/shared-ux/card/no_data/impl/package.json +++ b/packages/shared-ux/card/no_data/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/card/no_data/impl/tsconfig.json b/packages/shared-ux/card/no_data/impl/tsconfig.json index 8d29e93670483..5735aa5eceaa8 100644 --- a/packages/shared-ux/card/no_data/impl/tsconfig.json +++ b/packages/shared-ux/card/no_data/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/card/no_data/mocks/BUILD.bazel b/packages/shared-ux/card/no_data/mocks/BUILD.bazel index 1ca316ad280d2..6f08805292436 100644 --- a/packages/shared-ux/card/no_data/mocks/BUILD.bazel +++ b/packages/shared-ux/card/no_data/mocks/BUILD.bazel @@ -103,7 +103,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -117,6 +116,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -128,17 +135,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/card/no_data/mocks/package.json b/packages/shared-ux/card/no_data/mocks/package.json index 10380b879954c..06737fb83c6c1 100644 --- a/packages/shared-ux/card/no_data/mocks/package.json +++ b/packages/shared-ux/card/no_data/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/card/no_data/mocks/tsconfig.json b/packages/shared-ux/card/no_data/mocks/tsconfig.json index 6a7af9bb371d5..4703a8ebf5e35 100644 --- a/packages/shared-ux/card/no_data/mocks/tsconfig.json +++ b/packages/shared-ux/card/no_data/mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/card/no_data/types/tsconfig.json b/packages/shared-ux/card/no_data/types/tsconfig.json index 7a4adfcdbecff..b863eab85b68e 100644 --- a/packages/shared-ux/card/no_data/types/tsconfig.json +++ b/packages/shared-ux/card/no_data/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/shared-ux/link/redirect_app/impl/BUILD.bazel b/packages/shared-ux/link/redirect_app/impl/BUILD.bazel index 35d4970100a40..484b5b5a2c7f5 100644 --- a/packages/shared-ux/link/redirect_app/impl/BUILD.bazel +++ b/packages/shared-ux/link/redirect_app/impl/BUILD.bazel @@ -108,7 +108,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -122,6 +121,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -133,17 +140,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/link/redirect_app/impl/package.json b/packages/shared-ux/link/redirect_app/impl/package.json index 6deb187dcec2a..5dae14bdd878e 100644 --- a/packages/shared-ux/link/redirect_app/impl/package.json +++ b/packages/shared-ux/link/redirect_app/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/link/redirect_app/impl/tsconfig.json b/packages/shared-ux/link/redirect_app/impl/tsconfig.json index 7a819812f065f..e5cd0acc7e3fb 100644 --- a/packages/shared-ux/link/redirect_app/impl/tsconfig.json +++ b/packages/shared-ux/link/redirect_app/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel b/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel index 5f1d2f9575e0a..b300fc7892218 100644 --- a/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel +++ b/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel @@ -99,7 +99,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -113,6 +112,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -124,17 +131,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/link/redirect_app/mocks/package.json b/packages/shared-ux/link/redirect_app/mocks/package.json index adf441fb3d134..539bfd8f88c0a 100644 --- a/packages/shared-ux/link/redirect_app/mocks/package.json +++ b/packages/shared-ux/link/redirect_app/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/link/redirect_app/mocks/tsconfig.json b/packages/shared-ux/link/redirect_app/mocks/tsconfig.json index d0c94b11c5748..a00de7fc73226 100644 --- a/packages/shared-ux/link/redirect_app/mocks/tsconfig.json +++ b/packages/shared-ux/link/redirect_app/mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/link/redirect_app/types/tsconfig.json b/packages/shared-ux/link/redirect_app/types/tsconfig.json index 8ecd8e9fc1eff..f566d00dd2704 100644 --- a/packages/shared-ux/link/redirect_app/types/tsconfig.json +++ b/packages/shared-ux/link/redirect_app/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "rxjs", "@types/react", diff --git a/packages/shared-ux/markdown/impl/BUILD.bazel b/packages/shared-ux/markdown/impl/BUILD.bazel index 838edc4628ebc..bb19abe42c476 100644 --- a/packages/shared-ux/markdown/impl/BUILD.bazel +++ b/packages/shared-ux/markdown/impl/BUILD.bazel @@ -106,7 +106,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -120,6 +119,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -131,17 +138,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/markdown/impl/package.json b/packages/shared-ux/markdown/impl/package.json index c6b80b3561d70..55541e9fb54bf 100644 --- a/packages/shared-ux/markdown/impl/package.json +++ b/packages/shared-ux/markdown/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/markdown/impl/tsconfig.json b/packages/shared-ux/markdown/impl/tsconfig.json index 80903485ee0cb..60680c404dcdc 100644 --- a/packages/shared-ux/markdown/impl/tsconfig.json +++ b/packages/shared-ux/markdown/impl/tsconfig.json @@ -2,14 +2,12 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", - "react", + "react", "@kbn/ambient-ui-types", ] }, diff --git a/packages/shared-ux/markdown/mocks/BUILD.bazel b/packages/shared-ux/markdown/mocks/BUILD.bazel index 0317b8948db24..c6ad9fd3c8e74 100644 --- a/packages/shared-ux/markdown/mocks/BUILD.bazel +++ b/packages/shared-ux/markdown/mocks/BUILD.bazel @@ -101,7 +101,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -115,6 +114,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -126,17 +133,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/markdown/mocks/package.json b/packages/shared-ux/markdown/mocks/package.json index 9c1d37d8d0bb3..68a15def6151f 100644 --- a/packages/shared-ux/markdown/mocks/package.json +++ b/packages/shared-ux/markdown/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/markdown/mocks/tsconfig.json b/packages/shared-ux/markdown/mocks/tsconfig.json index a7a0cf8d2dbb0..c8559330de310 100644 --- a/packages/shared-ux/markdown/mocks/tsconfig.json +++ b/packages/shared-ux/markdown/mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "node", "react" diff --git a/packages/shared-ux/markdown/types/package.json b/packages/shared-ux/markdown/types/package.json index 72969eaf198ea..a3b0f4553f0d5 100644 --- a/packages/shared-ux/markdown/types/package.json +++ b/packages/shared-ux/markdown/types/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/markdown/types/tsconfig.json b/packages/shared-ux/markdown/types/tsconfig.json index f63e4827cac34..3cffae3f70336 100644 --- a/packages/shared-ux/markdown/types/tsconfig.json +++ b/packages/shared-ux/markdown/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "rxjs", "@types/react", diff --git a/packages/shared-ux/page/analytics_no_data/impl/BUILD.bazel b/packages/shared-ux/page/analytics_no_data/impl/BUILD.bazel index 12b7d8110bdda..eba6e6ed2ed19 100644 --- a/packages/shared-ux/page/analytics_no_data/impl/BUILD.bazel +++ b/packages/shared-ux/page/analytics_no_data/impl/BUILD.bazel @@ -105,7 +105,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -119,6 +118,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -130,17 +137,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/analytics_no_data/impl/package.json b/packages/shared-ux/page/analytics_no_data/impl/package.json index e9977444fb94e..af1f2d6860a6f 100644 --- a/packages/shared-ux/page/analytics_no_data/impl/package.json +++ b/packages/shared-ux/page/analytics_no_data/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/page/analytics_no_data/impl/tsconfig.json b/packages/shared-ux/page/analytics_no_data/impl/tsconfig.json index 2f623301513cd..7c5977f8a0840 100644 --- a/packages/shared-ux/page/analytics_no_data/impl/tsconfig.json +++ b/packages/shared-ux/page/analytics_no_data/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel b/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel index d032c29103ade..d5f264c1a3a8c 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel +++ b/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel @@ -97,7 +97,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -111,6 +110,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -122,17 +129,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/analytics_no_data/mocks/package.json b/packages/shared-ux/page/analytics_no_data/mocks/package.json index 6fc9704e831f1..cc2fb0317a86b 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/package.json +++ b/packages/shared-ux/page/analytics_no_data/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json b/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json index 6a7af9bb371d5..4703a8ebf5e35 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json +++ b/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/page/analytics_no_data/types/tsconfig.json b/packages/shared-ux/page/analytics_no_data/types/tsconfig.json index 7a4adfcdbecff..b863eab85b68e 100644 --- a/packages/shared-ux/page/analytics_no_data/types/tsconfig.json +++ b/packages/shared-ux/page/analytics_no_data/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel b/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel index a70bfd65de9ad..31e3910483812 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel +++ b/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel @@ -113,7 +113,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -127,6 +126,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -138,17 +145,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/kibana_no_data/impl/package.json b/packages/shared-ux/page/kibana_no_data/impl/package.json index e495957ad7541..d929610c0b7a6 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/package.json +++ b/packages/shared-ux/page/kibana_no_data/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/page/kibana_no_data/impl/tsconfig.json b/packages/shared-ux/page/kibana_no_data/impl/tsconfig.json index 7b961b47dff81..1f377c27d0e2d 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/tsconfig.json +++ b/packages/shared-ux/page/kibana_no_data/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel b/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel index 51990b9e217f8..4bc5c5b663b7a 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel +++ b/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel @@ -100,7 +100,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -114,6 +113,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -125,17 +132,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/kibana_no_data/mocks/package.json b/packages/shared-ux/page/kibana_no_data/mocks/package.json index f134da02e430f..b5aba9769ed95 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/package.json +++ b/packages/shared-ux/page/kibana_no_data/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json b/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json index d0c94b11c5748..a00de7fc73226 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json +++ b/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/page/kibana_no_data/types/tsconfig.json b/packages/shared-ux/page/kibana_no_data/types/tsconfig.json index 7a4adfcdbecff..b863eab85b68e 100644 --- a/packages/shared-ux/page/kibana_no_data/types/tsconfig.json +++ b/packages/shared-ux/page/kibana_no_data/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/shared-ux/page/kibana_template/impl/BUILD.bazel b/packages/shared-ux/page/kibana_template/impl/BUILD.bazel index 3c745c3855f12..e58fb156edc58 100644 --- a/packages/shared-ux/page/kibana_template/impl/BUILD.bazel +++ b/packages/shared-ux/page/kibana_template/impl/BUILD.bazel @@ -101,7 +101,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -115,6 +114,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -126,17 +133,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/kibana_template/impl/package.json b/packages/shared-ux/page/kibana_template/impl/package.json index a089481047999..111538a3dd75b 100644 --- a/packages/shared-ux/page/kibana_template/impl/package.json +++ b/packages/shared-ux/page/kibana_template/impl/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_template/impl/tsconfig.json b/packages/shared-ux/page/kibana_template/impl/tsconfig.json index 71b05517f1b82..cf7982b9ab1e6 100644 --- a/packages/shared-ux/page/kibana_template/impl/tsconfig.json +++ b/packages/shared-ux/page/kibana_template/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel b/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel index 675fdae1fdb17..c2ec3013e01a8 100644 --- a/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel +++ b/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel @@ -99,7 +99,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -113,6 +112,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -124,17 +131,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/kibana_template/mocks/package.json b/packages/shared-ux/page/kibana_template/mocks/package.json index c6dc7b5671d7e..4541001003f30 100644 --- a/packages/shared-ux/page/kibana_template/mocks/package.json +++ b/packages/shared-ux/page/kibana_template/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_template/mocks/tsconfig.json b/packages/shared-ux/page/kibana_template/mocks/tsconfig.json index 7d7c02e190762..4c2618f5b3a19 100644 --- a/packages/shared-ux/page/kibana_template/mocks/tsconfig.json +++ b/packages/shared-ux/page/kibana_template/mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/page/kibana_template/types/tsconfig.json b/packages/shared-ux/page/kibana_template/types/tsconfig.json index 7a4adfcdbecff..b863eab85b68e 100644 --- a/packages/shared-ux/page/kibana_template/types/tsconfig.json +++ b/packages/shared-ux/page/kibana_template/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/shared-ux/page/no_data/impl/BUILD.bazel b/packages/shared-ux/page/no_data/impl/BUILD.bazel index 9907ecbdbe646..040968fa52553 100644 --- a/packages/shared-ux/page/no_data/impl/BUILD.bazel +++ b/packages/shared-ux/page/no_data/impl/BUILD.bazel @@ -109,7 +109,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -123,6 +122,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -134,17 +141,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/no_data/impl/package.json b/packages/shared-ux/page/no_data/impl/package.json index 1f09f616a765f..61a823cc5e7ab 100644 --- a/packages/shared-ux/page/no_data/impl/package.json +++ b/packages/shared-ux/page/no_data/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/page/no_data/impl/tsconfig.json b/packages/shared-ux/page/no_data/impl/tsconfig.json index 0627b1f2462fa..ce5320536e563 100644 --- a/packages/shared-ux/page/no_data/impl/tsconfig.json +++ b/packages/shared-ux/page/no_data/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/page/no_data/mocks/BUILD.bazel b/packages/shared-ux/page/no_data/mocks/BUILD.bazel index 3435be28aaefd..de980573ac7fa 100644 --- a/packages/shared-ux/page/no_data/mocks/BUILD.bazel +++ b/packages/shared-ux/page/no_data/mocks/BUILD.bazel @@ -97,7 +97,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -111,6 +110,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -122,17 +129,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/no_data/mocks/package.json b/packages/shared-ux/page/no_data/mocks/package.json index d6051a988cdc4..f3b8c22a03da0 100644 --- a/packages/shared-ux/page/no_data/mocks/package.json +++ b/packages/shared-ux/page/no_data/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/page/no_data/mocks/tsconfig.json b/packages/shared-ux/page/no_data/mocks/tsconfig.json index 6a7af9bb371d5..4703a8ebf5e35 100644 --- a/packages/shared-ux/page/no_data/mocks/tsconfig.json +++ b/packages/shared-ux/page/no_data/mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/page/no_data/types/tsconfig.json b/packages/shared-ux/page/no_data/types/tsconfig.json index 7a4adfcdbecff..b863eab85b68e 100644 --- a/packages/shared-ux/page/no_data/types/tsconfig.json +++ b/packages/shared-ux/page/no_data/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/shared-ux/page/no_data_config/impl/BUILD.bazel b/packages/shared-ux/page/no_data_config/impl/BUILD.bazel index d0063830aeb33..2aee71ee7367a 100644 --- a/packages/shared-ux/page/no_data_config/impl/BUILD.bazel +++ b/packages/shared-ux/page/no_data_config/impl/BUILD.bazel @@ -103,7 +103,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -117,6 +116,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -128,17 +135,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/no_data_config/impl/package.json b/packages/shared-ux/page/no_data_config/impl/package.json index 216bba70b5d50..a30692bf98701 100644 --- a/packages/shared-ux/page/no_data_config/impl/package.json +++ b/packages/shared-ux/page/no_data_config/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/page/no_data_config/impl/tsconfig.json b/packages/shared-ux/page/no_data_config/impl/tsconfig.json index 2f623301513cd..7c5977f8a0840 100644 --- a/packages/shared-ux/page/no_data_config/impl/tsconfig.json +++ b/packages/shared-ux/page/no_data_config/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel b/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel index fa48d2d6135e3..3906ada90b43e 100644 --- a/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel +++ b/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel @@ -96,7 +96,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -110,6 +109,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -121,17 +128,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/no_data_config/mocks/package.json b/packages/shared-ux/page/no_data_config/mocks/package.json index 32245715f2b1b..4277f81e3dcfe 100644 --- a/packages/shared-ux/page/no_data_config/mocks/package.json +++ b/packages/shared-ux/page/no_data_config/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/page/no_data_config/mocks/tsconfig.json b/packages/shared-ux/page/no_data_config/mocks/tsconfig.json index 6a7af9bb371d5..4703a8ebf5e35 100644 --- a/packages/shared-ux/page/no_data_config/mocks/tsconfig.json +++ b/packages/shared-ux/page/no_data_config/mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/page/no_data_config/types/tsconfig.json b/packages/shared-ux/page/no_data_config/types/tsconfig.json index 7a4adfcdbecff..b863eab85b68e 100644 --- a/packages/shared-ux/page/no_data_config/types/tsconfig.json +++ b/packages/shared-ux/page/no_data_config/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/shared-ux/page/solution_nav/BUILD.bazel b/packages/shared-ux/page/solution_nav/BUILD.bazel index 0b6b0a8258029..9dc4115016d65 100644 --- a/packages/shared-ux/page/solution_nav/BUILD.bazel +++ b/packages/shared-ux/page/solution_nav/BUILD.bazel @@ -126,6 +126,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -137,17 +145,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/solution_nav/package.json b/packages/shared-ux/page/solution_nav/package.json index f57abed80f231..3f07febd136ff 100644 --- a/packages/shared-ux/page/solution_nav/package.json +++ b/packages/shared-ux/page/solution_nav/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/page/solution_nav/src/__snapshots__/with_solution_nav.test.tsx.snap b/packages/shared-ux/page/solution_nav/src/__snapshots__/with_solution_nav.test.tsx.snap index 749d0a13ad8d7..d31d61c4b8129 100644 --- a/packages/shared-ux/page/solution_nav/src/__snapshots__/with_solution_nav.test.tsx.snap +++ b/packages/shared-ux/page/solution_nav/src/__snapshots__/with_solution_nav.test.tsx.snap @@ -52,20 +52,7 @@ exports[`WithSolutionNav renders wrapped component 1`] = ` } pageSideBarProps={ Object { - "className": "kbnStickyMenu", - "css": Object { - "map": undefined, - "name": "sx7fqw", - "next": undefined, - "styles": " - flex: 0 1 0%; - overflow: hidden; - @media screen and (prefers-reduced-motion: no-preference) { - transition: min-width 150ms cubic-bezier(.694, .0482, .335, 1); - } - ", - "toString": [Function], - }, + "className": "css-c34ez9", "minWidth": undefined, "paddingSize": "none", } @@ -125,20 +112,7 @@ exports[`WithSolutionNav with children 1`] = ` } pageSideBarProps={ Object { - "className": "kbnStickyMenu", - "css": Object { - "map": undefined, - "name": "sx7fqw", - "next": undefined, - "styles": " - flex: 0 1 0%; - overflow: hidden; - @media screen and (prefers-reduced-motion: no-preference) { - transition: min-width 150ms cubic-bezier(.694, .0482, .335, 1); - } - ", - "toString": [Function], - }, + "className": "css-c34ez9", "minWidth": undefined, "paddingSize": "none", } diff --git a/packages/shared-ux/page/solution_nav/src/with_solution_nav.styles.ts b/packages/shared-ux/page/solution_nav/src/with_solution_nav.styles.ts index 906f1fdd8e293..628b27ffba993 100644 --- a/packages/shared-ux/page/solution_nav/src/with_solution_nav.styles.ts +++ b/packages/shared-ux/page/solution_nav/src/with_solution_nav.styles.ts @@ -6,12 +6,12 @@ * Side Public License, v 1. */ -import { css } from '@emotion/react'; +import { css } from '@emotion/css'; import { euiCanAnimate, EuiThemeComputed } from '@elastic/eui'; export const WithSolutionNavStyles = (euiTheme: EuiThemeComputed<{}>) => { return css` - flex: 0 1 0%; + flex: 0 1 0; overflow: hidden; ${euiCanAnimate} { transition: min-width ${euiTheme.animation.fast} ${euiTheme.animation.resistance}; diff --git a/packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx b/packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx index 0c3f0359c1f6e..d35834e7cdd9d 100644 --- a/packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx +++ b/packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx @@ -8,7 +8,6 @@ import React, { ComponentType, ReactNode, useState } from 'react'; import classNames from 'classnames'; -import { SerializedStyles } from '@emotion/serialize'; import { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template-types'; import { useIsWithinBreakpoints, useEuiTheme, useIsWithinMinBreakpoint } from '@elastic/eui'; import { SolutionNav, SolutionNavProps } from './solution_nav'; @@ -37,7 +36,6 @@ export const withSolutionNav =

(WrappedComponent: Compo const [isSideNavOpenOnDesktop, setisSideNavOpenOnDesktop] = useState( !JSON.parse(String(localStorage.getItem(SOLUTION_NAV_COLLAPSED_KEY))) ); - const { solutionNav, children, ...propagatedProps } = props; const { euiTheme } = useEuiTheme(); @@ -53,11 +51,11 @@ export const withSolutionNav =

(WrappedComponent: Compo isMediumBreakpoint || (canBeCollapsed && isLargerBreakpoint && !isSideNavOpenOnDesktop); const withSolutionNavStyles = WithSolutionNavStyles(euiTheme); const sideBarClasses = classNames( - 'kbnStickyMenu', { 'kbnSolutionNav__sidebar--shrink': isSidebarShrunk, }, - props.pageSideBarProps?.className + props.pageSideBarProps?.className, + withSolutionNavStyles ); const pageSideBar = ( @@ -68,12 +66,11 @@ export const withSolutionNav =

(WrappedComponent: Compo /> ); - const pageSideBarProps: TemplateProps['pageSideBarProps'] & { css: SerializedStyles } = { + const pageSideBarProps: TemplateProps['pageSideBarProps'] = { paddingSize: 'none' as 'none', ...props.pageSideBarProps, minWidth: isSidebarShrunk ? euiTheme.size.xxl : undefined, className: sideBarClasses, - css: withSolutionNavStyles, }; return ( diff --git a/packages/shared-ux/page/solution_nav/tsconfig.json b/packages/shared-ux/page/solution_nav/tsconfig.json index 21b85ae51cd13..5cb7bca42f195 100644 --- a/packages/shared-ux/page/solution_nav/tsconfig.json +++ b/packages/shared-ux/page/solution_nav/tsconfig.json @@ -4,7 +4,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/prompt/no_data_views/impl/BUILD.bazel b/packages/shared-ux/prompt/no_data_views/impl/BUILD.bazel index 6d326673bc90c..8d0d5f0733756 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/BUILD.bazel +++ b/packages/shared-ux/prompt/no_data_views/impl/BUILD.bazel @@ -117,7 +117,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -131,6 +130,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -142,17 +149,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/prompt/no_data_views/impl/package.json b/packages/shared-ux/prompt/no_data_views/impl/package.json index 79070e1242994..2be74fd5f5670 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/package.json +++ b/packages/shared-ux/prompt/no_data_views/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/prompt/no_data_views/impl/tsconfig.json b/packages/shared-ux/prompt/no_data_views/impl/tsconfig.json index 1ea41c1013592..5893035fdd770 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/tsconfig.json +++ b/packages/shared-ux/prompt/no_data_views/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel b/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel index 6d5bed4906a79..c30e7a9c03cf9 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel +++ b/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel @@ -97,7 +97,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -111,6 +110,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -122,17 +129,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/prompt/no_data_views/mocks/package.json b/packages/shared-ux/prompt/no_data_views/mocks/package.json index 2478bd3e76dd4..4485a0918cda7 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/package.json +++ b/packages/shared-ux/prompt/no_data_views/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json b/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json index d0c94b11c5748..a00de7fc73226 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json +++ b/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/prompt/no_data_views/types/tsconfig.json b/packages/shared-ux/prompt/no_data_views/types/tsconfig.json index 7a4adfcdbecff..b863eab85b68e 100644 --- a/packages/shared-ux/prompt/no_data_views/types/tsconfig.json +++ b/packages/shared-ux/prompt/no_data_views/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/shared-ux/router/impl/BUILD.bazel b/packages/shared-ux/router/impl/BUILD.bazel index bc9b0aaac6d38..a008a5d15df59 100644 --- a/packages/shared-ux/router/impl/BUILD.bazel +++ b/packages/shared-ux/router/impl/BUILD.bazel @@ -99,7 +99,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -113,6 +112,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -124,17 +131,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/router/impl/package.json b/packages/shared-ux/router/impl/package.json index 3faa6ac609ebc..6c80fa334caa4 100644 --- a/packages/shared-ux/router/impl/package.json +++ b/packages/shared-ux/router/impl/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/router/impl/tsconfig.json b/packages/shared-ux/router/impl/tsconfig.json index 764f1f42f52f9..475b363297f65 100644 --- a/packages/shared-ux/router/impl/tsconfig.json +++ b/packages/shared-ux/router/impl/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/router/mocks/BUILD.bazel b/packages/shared-ux/router/mocks/BUILD.bazel index 248dd93ce803b..6a7e263075e8a 100644 --- a/packages/shared-ux/router/mocks/BUILD.bazel +++ b/packages/shared-ux/router/mocks/BUILD.bazel @@ -93,7 +93,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = ".", @@ -108,6 +107,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -119,17 +126,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/router/mocks/package.json b/packages/shared-ux/router/mocks/package.json index d089a5d01f106..a4dcbf97cb778 100644 --- a/packages/shared-ux/router/mocks/package.json +++ b/packages/shared-ux/router/mocks/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/packages/shared-ux/router/mocks/tsconfig.json b/packages/shared-ux/router/mocks/tsconfig.json index a4f1ce7985a55..37f8e83d0d7a6 100644 --- a/packages/shared-ux/router/mocks/tsconfig.json +++ b/packages/shared-ux/router/mocks/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": ".", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/router/types/tsconfig.json b/packages/shared-ux/router/types/tsconfig.json index 1a57218f76493..9b572c50a398e 100644 --- a/packages/shared-ux/router/types/tsconfig.json +++ b/packages/shared-ux/router/types/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [] }, "include": [ diff --git a/packages/shared-ux/storybook/config/BUILD.bazel b/packages/shared-ux/storybook/config/BUILD.bazel index 32e5b6cb440c7..9451199caf5c9 100644 --- a/packages/shared-ux/storybook/config/BUILD.bazel +++ b/packages/shared-ux/storybook/config/BUILD.bazel @@ -62,12 +62,12 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//jest-mock", "//packages/kbn-storybook:npm_module_types", "//packages/kbn-ambient-ui-types:npm_module_types", "//packages/kbn-ambient-storybook-types:npm_module_types", "@npm//@types/node", "@npm//@types/jest", + "@npm//jest-mock", "@npm//@storybook/react", "@npm//@storybook/addon-actions", ] @@ -100,7 +100,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -114,6 +113,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -125,17 +132,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/storybook/config/package.json b/packages/shared-ux/storybook/config/package.json index ee7206b2d87df..bcf7b626d7a26 100644 --- a/packages/shared-ux/storybook/config/package.json +++ b/packages/shared-ux/storybook/config/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/storybook/config/tsconfig.json b/packages/shared-ux/storybook/config/tsconfig.json index d3feada0ae0fc..8beb0a5da38ab 100644 --- a/packages/shared-ux/storybook/config/tsconfig.json +++ b/packages/shared-ux/storybook/config/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/packages/shared-ux/storybook/mock/BUILD.bazel b/packages/shared-ux/storybook/mock/BUILD.bazel index feff755d4828c..2b59617938208 100644 --- a/packages/shared-ux/storybook/mock/BUILD.bazel +++ b/packages/shared-ux/storybook/mock/BUILD.bazel @@ -94,7 +94,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -108,6 +107,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -119,17 +126,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/storybook/mock/index.ts b/packages/shared-ux/storybook/mock/index.ts index 2d60e15d952c5..5252bace4ad5f 100644 --- a/packages/shared-ux/storybook/mock/index.ts +++ b/packages/shared-ux/storybook/mock/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { AbstractStorybookMock } from './src/mocks'; +export { AbstractStorybookMock, type ArgumentParams } from './src/mocks'; diff --git a/packages/shared-ux/storybook/mock/package.json b/packages/shared-ux/storybook/mock/package.json index 0baee9437cac0..83429ee8a3249 100644 --- a/packages/shared-ux/storybook/mock/package.json +++ b/packages/shared-ux/storybook/mock/package.json @@ -4,5 +4,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } \ No newline at end of file diff --git a/packages/shared-ux/storybook/mock/tsconfig.json b/packages/shared-ux/storybook/mock/tsconfig.json index ca626e2c05d8c..3cdea36de9eac 100644 --- a/packages/shared-ux/storybook/mock/tsconfig.json +++ b/packages/shared-ux/storybook/mock/tsconfig.json @@ -2,10 +2,8 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "stripInternal": false, "types": [ "jest", "node", diff --git a/renovate.json b/renovate.json index bdaf373932fa1..9c0f4150b9c80 100644 --- a/renovate.json +++ b/renovate.json @@ -25,9 +25,9 @@ { "groupName": "@elastic/charts", "matchPackageNames": ["@elastic/charts"], - "reviewers": ["team:datavis", "markov00", "nickofthyme"], + "reviewers": ["team:visualizations", "markov00", "nickofthyme"], "matchBaseBranches": ["main"], - "labels": ["release_note:skip", "backport:skip", "Team:DataVis"], + "labels": ["release_note:skip", "backport:skip", "Team:Visualizations"], "draftPR": true, "enabled": true, "assignAutomerge": true, @@ -97,9 +97,9 @@ { "groupName": "vega related modules", "matchPackageNames": ["vega", "vega-lite", "vega-schema-url-parser", "vega-tooltip"], - "reviewers": ["team:kibana-vis-editors"], + "reviewers": ["team:kibana-visualizations"], "matchBaseBranches": ["main"], - "labels": ["Feature:Vega", "Team:VisEditors"], + "labels": ["Feature:Vega", "Team:Visualizations"], "enabled": true }, { diff --git a/scripts/archive_migration_functions.sh b/scripts/archive_migration_functions.sh index 7dcba01175731..36c7f61abdba1 100755 --- a/scripts/archive_migration_functions.sh +++ b/scripts/archive_migration_functions.sh @@ -1,13 +1,30 @@ -standard_list="url,index-pattern,query,graph-workspace,tag,visualization,canvas-element,canvas-workpad,dashboard,search,lens,map,cases,uptime-dynamic-settings,osquery-saved-query,osquery-pack,infrastructure-ui-source,metrics-explorer-view,inventory-view,infrastructure-monitoring-log-view,apm-indices" +#!/bin/bash + +# ??? Should we migrate +# x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space +# ### Yes, it needs migration +# ### Saved Object type(s) that we care about: +# index-pattern +# ### Test file(s) that use it: +# x-pack/test/api_integration/apis/security_solution/timeline_migrations.ts +# ### Config(s) that govern the test file(s): +# x-pack/test/api_integration/config.ts +# The other types it contains: +# config +# index-pattern +# siem-ui-timeline +# siem-ui-timeline-note +# siem-ui-timeline-pinned-event +# space -orig_archive="x-pack/test/functional/es_archives/banners/multispace" -new_archive="x-pack/test/functional/fixtures/kbn_archiver/banners/multi_space" +standard_list="url,index-pattern,query,graph-workspace,tag,visualization,canvas-element,canvas-workpad,dashboard,search,lens,map,cases,uptime-dynamic-settings,osquery-saved-query,osquery-pack,infrastructure-ui-source,metrics-explorer-view,inventory-view,infrastructure-monitoring-log-view,apm-indices" -# newArchives=("x-pack/test/functional/fixtures/kbn_archiver/dashboard/session_in_space") +orig_archive="x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space" +new_archive="x-pack/test/functional/fixtures/kbn_archiver/security_solution/timelines/7.15.0_space" -# testFiles=("x-pack/test/functional/apps/discover/preserve_url.ts") +testFiles=("x-pack/test/api_integration/apis/security_solution/timeline_migrations.ts") -test_config="x-pack/test/banners_functional/config.ts" +test_config="x-pack/test/api_integration/config.ts" list_stragglers() { diff --git a/scripts/build_ts_refs.js b/scripts/build_ts_refs.js deleted file mode 100644 index a4ee6ec491ef1..0000000000000 --- a/scripts/build_ts_refs.js +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -require('../src/setup_node_env'); -require('../src/dev/typescript').runBuildRefsCli(); diff --git a/scripts/convert_ts_projects.js b/scripts/convert_ts_projects.js deleted file mode 100644 index 65053db0d0bd1..0000000000000 --- a/scripts/convert_ts_projects.js +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -require('../src/setup_node_env'); -require('../src/dev/typescript/convert_all_to_composite'); diff --git a/src/cli_keystore/get_keystore.js b/src/cli/keystore/get_keystore.js similarity index 95% rename from src/cli_keystore/get_keystore.js rename to src/cli/keystore/get_keystore.js index 11e957ffe9847..d713f422cc68a 100644 --- a/src/cli_keystore/get_keystore.js +++ b/src/cli/keystore/get_keystore.js @@ -9,7 +9,7 @@ import { existsSync } from 'fs'; import { join } from 'path'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../logger'; import { getConfigDirectory, getDataPath } from '@kbn/utils'; export function getKeystore() { diff --git a/src/cli_keystore/get_keystore.test.js b/src/cli/keystore/get_keystore.test.js similarity index 96% rename from src/cli_keystore/get_keystore.test.js rename to src/cli/keystore/get_keystore.test.js index 6c7c4397c172f..b24164935fe49 100644 --- a/src/cli_keystore/get_keystore.test.js +++ b/src/cli/keystore/get_keystore.test.js @@ -7,7 +7,7 @@ */ import { getKeystore } from './get_keystore'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../logger'; import fs from 'fs'; import sinon from 'sinon'; diff --git a/src/cli/keystore/read_keystore.js b/src/cli/keystore/read_keystore.js index a4f007690a661..96f5d38f65d69 100644 --- a/src/cli/keystore/read_keystore.js +++ b/src/cli/keystore/read_keystore.js @@ -9,7 +9,7 @@ import { set } from '@kbn/safer-lodash-set'; import { Keystore } from '.'; -import { getKeystore } from '../../cli_keystore/get_keystore'; +import { getKeystore } from './get_keystore'; export function readKeystore(keystorePath = getKeystore()) { const keystore = new Keystore(keystorePath); diff --git a/src/cli_plugin/lib/logger.js b/src/cli/logger.js similarity index 85% rename from src/cli_plugin/lib/logger.js rename to src/cli/logger.js index d34b8561cc7a9..0379765c61179 100644 --- a/src/cli_plugin/lib/logger.js +++ b/src/cli/logger.js @@ -10,13 +10,20 @@ * Logs messages and errors */ export class Logger { + /** + * @param {{silent?: boolean; quiet?: boolean;}} settings + */ constructor(settings = {}) { this.previousLineEnded = true; this.silent = !!settings.silent; this.quiet = !!settings.quiet; } - log(data, sameLine) { + /** + * @param {string} data + * @param {boolean} sameLine + */ + log(data, sameLine = false) { if (this.silent || this.quiet) return; if (!sameLine && !this.previousLineEnded) { @@ -34,6 +41,9 @@ export class Logger { this.previousLineEnded = !sameLine; } + /** + * @param {string} data + */ error(data) { if (this.silent) return; diff --git a/src/cli_plugin/lib/logger.test.js b/src/cli/logger.test.js similarity index 100% rename from src/cli_plugin/lib/logger.test.js rename to src/cli/logger.test.js diff --git a/src/cli/tsconfig.json b/src/cli/tsconfig.json new file mode 100644 index 0000000000000..b3a8ab5220b94 --- /dev/null +++ b/src/cli/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true + }, + "include": [ + "keystore/**/*", + "serve/**/*", + "*.js", + ], + "kbn_references": [ + { "path": "../core/tsconfig.json" }, + { "path": "../setup_node_env/tsconfig.json" }, + ] +} diff --git a/src/cli_encryption_keys/generate.js b/src/cli_encryption_keys/generate.js index e3058da157c0d..1f1eae3f28185 100644 --- a/src/cli_encryption_keys/generate.js +++ b/src/cli_encryption_keys/generate.js @@ -9,7 +9,7 @@ import { safeDump } from 'js-yaml'; import { isEmpty } from 'lodash'; import { interactive } from './interactive'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; export async function generate(encryptionConfig, command) { const logger = new Logger(); diff --git a/src/cli_encryption_keys/generate.test.js b/src/cli_encryption_keys/generate.test.js index 422c2bf8e2044..1db27264a052c 100644 --- a/src/cli_encryption_keys/generate.test.js +++ b/src/cli_encryption_keys/generate.test.js @@ -9,7 +9,7 @@ import { EncryptionConfig } from './encryption_config'; import { generate } from './generate'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; describe('encryption key generation', () => { const encryptionConfig = new EncryptionConfig(); diff --git a/src/cli_encryption_keys/interactive.test.js b/src/cli_encryption_keys/interactive.test.js index 79309e3ace64f..69cf499ff144e 100644 --- a/src/cli_encryption_keys/interactive.test.js +++ b/src/cli_encryption_keys/interactive.test.js @@ -9,7 +9,7 @@ import { EncryptionConfig } from './encryption_config'; import { generate } from './generate'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; import * as prompt from '../cli_keystore/utils/prompt'; import fs from 'fs'; import crypto from 'crypto'; diff --git a/src/cli_encryption_keys/tsconfig.json b/src/cli_encryption_keys/tsconfig.json new file mode 100644 index 0000000000000..6b6661d24f9c6 --- /dev/null +++ b/src/cli_encryption_keys/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "*.js", + ], + "kbn_references": [ + { "path": "../cli/tsconfig.json" }, + { "path": "../cli_keystore/tsconfig.json" }, + ] +} diff --git a/src/cli_keystore/add.js b/src/cli_keystore/add.js index e584772298fe8..96778665ac912 100644 --- a/src/cli_keystore/add.js +++ b/src/cli_keystore/add.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; import { confirm, question } from './utils'; // import from path since add.test.js mocks 'fs' required for @kbn/utils import { createPromiseFromStreams, createConcatStream } from '@kbn/utils/target_node/src/streams'; diff --git a/src/cli_keystore/add.test.js b/src/cli_keystore/add.test.js index c9c4f4bf90da9..2114690207aa0 100644 --- a/src/cli_keystore/add.test.js +++ b/src/cli_keystore/add.test.js @@ -30,7 +30,7 @@ import { PassThrough } from 'stream'; import { Keystore } from '../cli/keystore'; import { add } from './add'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; import * as prompt from './utils/prompt'; describe('Kibana keystore', () => { diff --git a/src/cli_keystore/cli_keystore.js b/src/cli_keystore/cli_keystore.js index 9f44e5d56e9d2..0db5d0f33337d 100644 --- a/src/cli_keystore/cli_keystore.js +++ b/src/cli_keystore/cli_keystore.js @@ -10,13 +10,13 @@ import _ from 'lodash'; import { kibanaPackageJson as pkg } from '@kbn/utils'; import Command from '../cli/command'; +import { getKeystore } from '../cli/keystore/get_keystore'; import { Keystore } from '../cli/keystore'; import { createCli } from './create'; import { listCli } from './list'; import { addCli } from './add'; import { removeCli } from './remove'; -import { getKeystore } from './get_keystore'; const argv = process.argv.slice(); const program = new Command('bin/kibana-keystore'); diff --git a/src/cli_keystore/create.js b/src/cli_keystore/create.js index f229576972e11..7e0c1ee23c820 100644 --- a/src/cli_keystore/create.js +++ b/src/cli_keystore/create.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; import { confirm } from './utils'; export async function create(keystore, command, options) { diff --git a/src/cli_keystore/create.test.js b/src/cli_keystore/create.test.js index 0e3328f660fb4..2c5dcf6db8449 100644 --- a/src/cli_keystore/create.test.js +++ b/src/cli_keystore/create.test.js @@ -29,7 +29,7 @@ import sinon from 'sinon'; import { Keystore } from '../cli/keystore'; import { create } from './create'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; import * as prompt from './utils/prompt'; describe('Kibana keystore', () => { diff --git a/src/cli_keystore/list.js b/src/cli_keystore/list.js index 21d5534ad2d5a..5e136b0fe0647 100644 --- a/src/cli_keystore/list.js +++ b/src/cli_keystore/list.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; export function list(keystore, command, options = {}) { const logger = new Logger(options); diff --git a/src/cli_keystore/list.test.js b/src/cli_keystore/list.test.js index 01bac0c4454d9..43497a4e4c0ac 100644 --- a/src/cli_keystore/list.test.js +++ b/src/cli_keystore/list.test.js @@ -27,7 +27,7 @@ jest.mock('fs', () => ({ import sinon from 'sinon'; import { Keystore } from '../cli/keystore'; import { list } from './list'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; describe('Kibana keystore', () => { describe('list', () => { diff --git a/src/cli_keystore/tsconfig.json b/src/cli_keystore/tsconfig.json new file mode 100644 index 0000000000000..8cd8e6f3f232c --- /dev/null +++ b/src/cli_keystore/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "keystore/**/*", + "utils/**/*", + "*.js", + ], + "kbn_references": [ + { "path": "../setup_node_env/tsconfig.json" }, + { "path": "../cli/tsconfig.json" }, + { "path": "../cli_plugin/tsconfig.json" }, + ] +} diff --git a/src/cli_plugin/install/cleanup.test.js b/src/cli_plugin/install/cleanup.test.js index 4b7ad0763f551..3144594dbd947 100644 --- a/src/cli_plugin/install/cleanup.test.js +++ b/src/cli_plugin/install/cleanup.test.js @@ -11,7 +11,7 @@ import fs from 'fs'; import del from 'del'; import { cleanPrevious, cleanArtifacts } from './cleanup'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; describe('kibana cli', function () { describe('plugin installer', function () { diff --git a/src/cli_plugin/install/download.test.js b/src/cli_plugin/install/download.test.js index a0b5a2e1ad8e4..5ebc4ad099fa6 100644 --- a/src/cli_plugin/install/download.test.js +++ b/src/cli_plugin/install/download.test.js @@ -15,7 +15,7 @@ import nock from 'nock'; import globby from 'globby'; import del from 'del'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { UnsupportedProtocolError } from '../lib/errors'; import { download, _downloadSingle, _getFilePath, _checkFilePathDeprecation } from './download'; diff --git a/src/cli_plugin/install/index.js b/src/cli_plugin/install/index.js index dbad6bc8ba19c..cdf0218de3c9b 100644 --- a/src/cli_plugin/install/index.js +++ b/src/cli_plugin/install/index.js @@ -8,7 +8,7 @@ import { getConfigPath, kibanaPackageJson as pkg } from '@kbn/utils'; import { install } from './install'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { parse, parseMilliseconds } from './settings'; import { logWarnings } from '../lib/log_warnings'; diff --git a/src/cli_plugin/install/kibana.test.js b/src/cli_plugin/install/kibana.test.js index 6e044afcc7d00..7218f63a29e36 100644 --- a/src/cli_plugin/install/kibana.test.js +++ b/src/cli_plugin/install/kibana.test.js @@ -13,7 +13,7 @@ import sinon from 'sinon'; import del from 'del'; import { existingInstall, assertVersion } from './kibana'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; jest.spyOn(fs, 'statSync'); diff --git a/src/cli_plugin/install/pack.test.js b/src/cli_plugin/install/pack.test.js index cbb8438770f50..38542a7dad3d1 100644 --- a/src/cli_plugin/install/pack.test.js +++ b/src/cli_plugin/install/pack.test.js @@ -13,7 +13,7 @@ import sinon from 'sinon'; import globby from 'globby'; import del from 'del'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { extract, getPackData } from './pack'; import { _downloadSingle } from './download'; diff --git a/src/cli_plugin/install/progress.test.js b/src/cli_plugin/install/progress.test.js index 3eb583ddb7b9c..a2642648ad7b1 100644 --- a/src/cli_plugin/install/progress.test.js +++ b/src/cli_plugin/install/progress.test.js @@ -9,7 +9,7 @@ import sinon from 'sinon'; import { Progress } from './progress'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; describe('kibana cli', function () { describe('plugin installer', function () { diff --git a/src/cli_plugin/lib/logger.d.ts b/src/cli_plugin/lib/logger.d.ts deleted file mode 100644 index dae3255839677..0000000000000 --- a/src/cli_plugin/lib/logger.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -interface LoggerOptions { - silent?: boolean; - quiet?: boolean; -} - -export declare class Logger { - constructor(settings?: LoggerOptions); - - log(data: string, sameLine?: boolean): void; - - error(data: string): void; -} diff --git a/src/cli_plugin/list/index.js b/src/cli_plugin/list/index.js index 02d1ed19f8445..131582598c3ed 100644 --- a/src/cli_plugin/list/index.js +++ b/src/cli_plugin/list/index.js @@ -8,7 +8,7 @@ import { fromRoot } from '@kbn/utils'; import { list } from './list'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { logWarnings } from '../lib/log_warnings'; function processCommand() { diff --git a/src/cli_plugin/remove/index.js b/src/cli_plugin/remove/index.js index 3f571e605028f..0f94b9db391e2 100644 --- a/src/cli_plugin/remove/index.js +++ b/src/cli_plugin/remove/index.js @@ -8,7 +8,7 @@ import { getConfigPath } from '@kbn/utils'; import { remove } from './remove'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { parse } from './settings'; import { logWarnings } from '../lib/log_warnings'; diff --git a/src/cli_plugin/remove/remove.test.js b/src/cli_plugin/remove/remove.test.js index 29309b7391b03..c975ab6b46be9 100644 --- a/src/cli_plugin/remove/remove.test.js +++ b/src/cli_plugin/remove/remove.test.js @@ -13,7 +13,7 @@ import sinon from 'sinon'; import globby from 'globby'; import del from 'del'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { remove } from './remove'; describe('kibana cli', function () { diff --git a/src/cli_plugin/tsconfig.json b/src/cli_plugin/tsconfig.json new file mode 100644 index 0000000000000..611a8c05d8a43 --- /dev/null +++ b/src/cli_plugin/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "install/**/*", + "lib/**/*", + "list/**/*", + "remove/**/*", + "*.js", + ], + "kbn_references": [ + { "path": "../cli/tsconfig.json" }, + ] +} diff --git a/src/cli_setup/cli_setup.ts b/src/cli_setup/cli_setup.ts index 241c0dc13157f..b13e94551db5b 100644 --- a/src/cli_setup/cli_setup.ts +++ b/src/cli_setup/cli_setup.ts @@ -24,7 +24,7 @@ import { kibanaConfigWriter, elasticsearch, } from './utils'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; const program = new Command('bin/kibana-setup'); diff --git a/src/cli_setup/tsconfig.json b/src/cli_setup/tsconfig.json new file mode 100644 index 0000000000000..c59d1c32ee822 --- /dev/null +++ b/src/cli_setup/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "*.js", + "*.ts" + ], + "kbn_references": [ + { "path": "../cli/tsconfig.json" }, + { "path": "../plugins/interactive_setup/tsconfig.json" }, + ] +} diff --git a/src/cli_setup/utils.ts b/src/cli_setup/utils.ts index 47b8199f16ea0..33efb2ff802b8 100644 --- a/src/cli_setup/utils.ts +++ b/src/cli_setup/utils.ts @@ -29,6 +29,7 @@ const logger: Logger = { fatal: noop, log: noop, get: () => logger, + isLevelEnabled: () => true, }; export const kibanaConfigWriter = new KibanaConfigWriter(getConfigPath(), getDataPath(), logger); diff --git a/src/cli_verification_code/tsconfig.json b/src/cli_verification_code/tsconfig.json new file mode 100644 index 0000000000000..ba74b96a36b68 --- /dev/null +++ b/src/cli_verification_code/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "*.js", + ], + "kbn_references": [ + { "path": "../cli/tsconfig.json" }, + ] +} diff --git a/src/core/public/mocks.ts b/src/core/public/mocks.ts index 790b8ccf028cf..c4f04ec3c3312 100644 --- a/src/core/public/mocks.ts +++ b/src/core/public/mocks.ts @@ -32,6 +32,7 @@ export { } from '@kbn/core-saved-objects-browser-mocks'; export { applicationServiceMock, scopedHistoryMock } from '@kbn/core-application-browser-mocks'; export { deprecationsServiceMock } from '@kbn/core-deprecations-browser-mocks'; +export { loggingSystemMock } from '@kbn/core-logging-browser-mocks'; function createStorageMock() { const storageMock: jest.Mocked = { diff --git a/src/core/server/core_app/bundle_routes/index.ts b/src/core/server/core_app/bundle_routes/index.ts deleted file mode 100644 index 5b2374a74356a..0000000000000 --- a/src/core/server/core_app/bundle_routes/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export { registerBundleRoutes } from './register_bundle_routes'; diff --git a/src/core/server/core_app/index.ts b/src/core/server/core_app/index.ts deleted file mode 100644 index e2846537bda65..0000000000000 --- a/src/core/server/core_app/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export { CoreApp } from './core_app'; diff --git a/src/core/server/core_app/internal_types.ts b/src/core/server/core_app/internal_types.ts deleted file mode 100644 index 49e73a67a11a8..0000000000000 --- a/src/core/server/core_app/internal_types.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import type { IRouter, RequestHandlerContextBase } from '@kbn/core-http-server'; -import type { UiSettingsRequestHandlerContext } from '@kbn/core-ui-settings-server'; - -/** - * Request handler context used by core's coreApp routes. - * @internal - */ -export interface InternalCoreAppRequestHandlerContext extends RequestHandlerContextBase { - core: Promise<{ - uiSettings: UiSettingsRequestHandlerContext; - }>; -} - -/** - * Router bound to the {@link InternalCoreAppRequestHandlerContext}. - * Used by core's coreApp routes. - * @internal - */ -export type InternalCoreAppRouter = IRouter; diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 6232a17eb6111..df770c8529ab8 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -29,14 +29,8 @@ */ import { Type } from '@kbn/config-schema'; -import type { DocLinksServiceStart, DocLinksServiceSetup } from '@kbn/core-doc-links-server'; -import type { AppenderConfigType, LoggingServiceSetup } from '@kbn/core-logging-server'; +import type { AppenderConfigType } from '@kbn/core-logging-server'; import { appendersSchema } from '@kbn/core-logging-server-internal'; -import type { - AnalyticsServiceSetup, - AnalyticsServiceStart, - AnalyticsServicePreboot, -} from '@kbn/core-analytics-server'; import type { ExecutionContextSetup, ExecutionContextStart, @@ -46,31 +40,13 @@ import type { RequestHandler, KibanaResponseFactory, RouteMethod, - HttpServicePreboot, HttpServiceSetup, - HttpServiceStart, } from '@kbn/core-http-server'; -import type { PrebootServicePreboot } from '@kbn/core-preboot-server'; -import type { MetricsServiceSetup, MetricsServiceStart } from '@kbn/core-metrics-server'; -import { - ElasticsearchServiceSetup, - ElasticsearchServiceStart, - ElasticsearchServicePreboot, -} from '@kbn/core-elasticsearch-server'; import { configSchema as elasticsearchConfigSchema } from '@kbn/core-elasticsearch-server-internal'; import type { CapabilitiesSetup, CapabilitiesStart } from '@kbn/core-capabilities-server'; -import type { - SavedObjectsServiceSetup, - SavedObjectsServiceStart, -} from '@kbn/core-saved-objects-server'; -import type { DeprecationsServiceSetup } from '@kbn/core-deprecations-server'; -import type { CoreUsageDataStart, CoreUsageDataSetup } from '@kbn/core-usage-data-server'; -import type { I18nServiceSetup } from '@kbn/core-i18n-server'; -import type { StatusServiceSetup } from '@kbn/core-status-server'; -import type { UiSettingsServiceSetup, UiSettingsServiceStart } from '@kbn/core-ui-settings-server'; import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; import type { HttpResources } from '@kbn/core-http-resources-server'; -import { PluginsServiceSetup, PluginsServiceStart } from './plugins'; +import type { PluginsServiceSetup, PluginsServiceStart } from '@kbn/core-plugins-server-internal'; export type { PluginOpaqueId } from '@kbn/core-base-common'; export type { @@ -254,7 +230,6 @@ export type { NodeInfo, NodeRoles } from '@kbn/core-node-server'; export { PluginType } from '@kbn/core-base-common'; export type { - DiscoveredPlugin, PrebootPlugin, Plugin, AsyncPlugin, @@ -263,11 +238,12 @@ export type { PluginInitializer, PluginInitializerContext, PluginManifest, - PluginName, SharedGlobalConfig, MakeUsageFromSchema, ExposedToBrowserDescriptor, -} from './plugins'; +} from '@kbn/core-plugins-server'; + +export type { PluginName, DiscoveredPlugin } from '@kbn/core-base-common'; export type { SavedObject, @@ -467,106 +443,12 @@ export type { PrebootCoreRequestHandlerContext, } from '@kbn/core-http-request-handler-context-server'; -/** - * Context passed to the `setup` method of `preboot` plugins. - * @public - */ -export interface CorePreboot { - /** {@link AnalyticsServicePreboot} */ - analytics: AnalyticsServicePreboot; - /** {@link ElasticsearchServicePreboot} */ - elasticsearch: ElasticsearchServicePreboot; - /** {@link HttpServicePreboot} */ - http: HttpServicePreboot; - /** {@link PrebootServicePreboot} */ - preboot: PrebootServicePreboot; -} - -/** - * Context passed to the `setup` method of `standard` plugins. - * - * @typeParam TPluginsStart - the type of the consuming plugin's start dependencies. Should be the same - * as the consuming {@link Plugin}'s `TPluginsStart` type. Used by `getStartServices`. - * @typeParam TStart - the type of the consuming plugin's start contract. Should be the same as the - * consuming {@link Plugin}'s `TStart` type. Used by `getStartServices`. - * @public - */ -export interface CoreSetup { - /** {@link AnalyticsServiceSetup} */ - analytics: AnalyticsServiceSetup; - /** {@link CapabilitiesSetup} */ - capabilities: CapabilitiesSetup; - /** {@link DocLinksServiceSetup} */ - docLinks: DocLinksServiceSetup; - /** {@link ElasticsearchServiceSetup} */ - elasticsearch: ElasticsearchServiceSetup; - /** {@link ExecutionContextSetup} */ - executionContext: ExecutionContextSetup; - /** {@link HttpServiceSetup} */ - http: HttpServiceSetup & { - /** {@link HttpResources} */ - resources: HttpResources; - }; - /** {@link I18nServiceSetup} */ - i18n: I18nServiceSetup; - /** {@link LoggingServiceSetup} */ - logging: LoggingServiceSetup; - /** {@link MetricsServiceSetup} */ - metrics: MetricsServiceSetup; - /** {@link SavedObjectsServiceSetup} */ - savedObjects: SavedObjectsServiceSetup; - /** {@link StatusServiceSetup} */ - status: StatusServiceSetup; - /** {@link UiSettingsServiceSetup} */ - uiSettings: UiSettingsServiceSetup; - /** {@link DeprecationsServiceSetup} */ - deprecations: DeprecationsServiceSetup; - /** {@link StartServicesAccessor} */ - getStartServices: StartServicesAccessor; - /** @internal {@link CoreUsageDataSetup} */ - coreUsageData: CoreUsageDataSetup; -} - -/** - * Allows plugins to get access to APIs available in start inside async handlers. - * Promise will not resolve until Core and plugin dependencies have completed `start`. - * This should only be used inside handlers registered during `setup` that will only be executed - * after `start` lifecycle. - * - * @public - */ -export type StartServicesAccessor< - TPluginsStart extends object = object, - TStart = unknown -> = () => Promise<[CoreStart, TPluginsStart, TStart]>; - -/** - * Context passed to the plugins `start` method. - * - * @public - */ -export interface CoreStart { - /** {@link AnalyticsServiceStart} */ - analytics: AnalyticsServiceStart; - /** {@link CapabilitiesStart} */ - capabilities: CapabilitiesStart; - /** {@link DocLinksServiceStart} */ - docLinks: DocLinksServiceStart; - /** {@link ElasticsearchServiceStart} */ - elasticsearch: ElasticsearchServiceStart; - /** {@link ExecutionContextStart} */ - executionContext: ExecutionContextStart; - /** {@link HttpServiceStart} */ - http: HttpServiceStart; - /** {@link MetricsServiceStart} */ - metrics: MetricsServiceStart; - /** {@link SavedObjectsServiceStart} */ - savedObjects: SavedObjectsServiceStart; - /** {@link UiSettingsServiceStart} */ - uiSettings: UiSettingsServiceStart; - /** @internal {@link CoreUsageDataStart} */ - coreUsageData: CoreUsageDataStart; -} +export type { + CorePreboot, + CoreSetup, + CoreStart, + StartServicesAccessor, +} from '@kbn/core-lifecycle-server'; export type { CapabilitiesSetup, diff --git a/src/core/server/integration_tests/core_app/bundle_routes.test.ts b/src/core/server/integration_tests/core_app/bundle_routes.test.ts index b3b02cef691d9..af3782b015912 100644 --- a/src/core/server/integration_tests/core_app/bundle_routes.test.ts +++ b/src/core/server/integration_tests/core_app/bundle_routes.test.ts @@ -15,8 +15,7 @@ import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; import type { IRouter } from '@kbn/core-http-server'; import { HttpService } from '@kbn/core-http-server-internal'; import { createHttpServer } from '@kbn/core-http-server-mocks'; -import { registerRouteForBundle } from '../../core_app/bundle_routes/bundles_route'; -import { FileHashCache } from '../../core_app/bundle_routes/file_hash_cache'; +import { registerRouteForBundle, FileHashCache } from '@kbn/core-apps-server-internal'; const buildNum = 1234; const fooPluginFixture = resolve(__dirname, './__fixtures__/plugin/foo'); diff --git a/src/core/server/integration_tests/logging/logging.test.ts b/src/core/server/integration_tests/logging/logging.test.ts index a56449550b3cb..09323239a0ce3 100644 --- a/src/core/server/integration_tests/logging/logging.test.ts +++ b/src/core/server/integration_tests/logging/logging.test.ts @@ -8,7 +8,7 @@ import type { LoggerContextConfigInput } from '@kbn/core-logging-server'; import * as kbnTestServer from '../../../test_helpers/kbn_server'; -import { InternalCoreSetup } from '../../internal_types'; +import { InternalCoreSetup } from '@kbn/core-lifecycle-server-internal'; import { Subject } from 'rxjs'; function createRoot() { diff --git a/src/core/server/integration_tests/plugins/jest.integration.config.js b/src/core/server/integration_tests/plugins/jest.integration.config.js deleted file mode 100644 index 55bbf66147bb8..0000000000000 --- a/src/core/server/integration_tests/plugins/jest.integration.config.js +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/plugins'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/plugins/plugins_service.test.mocks.ts b/src/core/server/integration_tests/plugins/plugins_service.test.mocks.ts deleted file mode 100644 index d20d3bc094ac4..0000000000000 --- a/src/core/server/integration_tests/plugins/plugins_service.test.mocks.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export const mockPackage = { - raw: { __dirname: '/tmp' } as any, -}; - -jest.doMock('load-json-file', () => ({ - sync: () => mockPackage.raw, -})); - -export const mockDiscover = jest.fn(); -jest.mock('../../plugins/discovery/plugins_discovery', () => ({ discover: mockDiscover })); diff --git a/src/core/server/integration_tests/plugins/plugins_service.test.ts b/src/core/server/integration_tests/plugins/plugins_service.test.ts deleted file mode 100644 index 2d51b63921bad..0000000000000 --- a/src/core/server/integration_tests/plugins/plugins_service.test.ts +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -// must be before mocks imports to avoid conflicting with `REPO_ROOT` accessor. -import { REPO_ROOT } from '@kbn/utils'; -import { mockPackage, mockDiscover } from './plugins_service.test.mocks'; - -import { join } from 'path'; - -import { ConfigPath, ConfigService, Env } from '@kbn/config'; -import { getEnvOptions, rawConfigServiceMock } from '@kbn/config-mocks'; -import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { environmentServiceMock } from '@kbn/core-environment-server-mocks'; -import { nodeServiceMock } from '@kbn/core-node-server-mocks'; -import { PluginsService } from '../../plugins/plugins_service'; -import { BehaviorSubject, from } from 'rxjs'; -import { config } from '../../plugins/plugins_config'; -import { coreMock } from '../../mocks'; -import { AsyncPlugin, PluginType } from '../../plugins/types'; -import { PluginWrapper } from '../../plugins/plugin'; - -describe('PluginsService', () => { - const logger = loggingSystemMock.create(); - const environmentPreboot = environmentServiceMock.createPrebootContract(); - const nodePreboot = nodeServiceMock.createInternalPrebootContract(); - let pluginsService: PluginsService; - - const createPlugin = ( - id: string, - { - path = id, - disabled = false, - version = 'some-version', - requiredPlugins = [], - requiredBundles = [], - optionalPlugins = [], - kibanaVersion = '7.0.0', - type = PluginType.standard, - configPath = [path], - server = true, - ui = true, - owner = { name: 'foo' }, - }: { - path?: string; - disabled?: boolean; - version?: string; - requiredPlugins?: string[]; - requiredBundles?: string[]; - optionalPlugins?: string[]; - kibanaVersion?: string; - type?: PluginType; - configPath?: ConfigPath; - server?: boolean; - ui?: boolean; - owner?: { name: string }; - } - ): PluginWrapper => { - return new PluginWrapper({ - path, - manifest: { - id, - version, - configPath: `${configPath}${disabled ? '-disabled' : ''}`, - kibanaVersion, - type, - requiredPlugins, - requiredBundles, - optionalPlugins, - server, - ui, - owner, - }, - opaqueId: Symbol(id), - initializerContext: { logger } as any, - }); - }; - - beforeEach(async () => { - mockPackage.raw = { - branch: 'feature-v1', - version: 'v1', - build: { - distributable: true, - number: 100, - sha: 'feature-v1-build-sha', - }, - }; - - const env = Env.createDefault(REPO_ROOT, getEnvOptions()); - const config$ = new BehaviorSubject>({ - plugins: { - initialize: true, - }, - }); - const rawConfigService = rawConfigServiceMock.create({ rawConfig$: config$ }); - const configService = new ConfigService(rawConfigService, env, logger); - await configService.setSchema(config.path, config.schema); - - pluginsService = new PluginsService({ - coreId: Symbol('core'), - env, - logger, - configService, - }); - }); - - it("properly resolves `getStartServices` in plugin's lifecycle", async () => { - expect.assertions(6); - - const pluginPath = 'plugin-path'; - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([ - createPlugin('plugin-id', { - path: pluginPath, - configPath: 'path', - }), - ]), - }); - - let startDependenciesResolved = false; - let contextFromStart: any = null; - let contextFromStartService: any = null; - - const pluginStartContract = { - someApi: () => 'foo', - }; - - const pluginInitializer = () => - ({ - setup: async (coreSetup, deps) => { - coreSetup.getStartServices().then(([core, plugins, pluginStart]) => { - startDependenciesResolved = true; - contextFromStartService = { core, plugins, pluginStart }; - }); - }, - start: async (core, plugins) => { - contextFromStart = { core, plugins }; - await new Promise((resolve) => setTimeout(resolve, 10)); - expect(startDependenciesResolved).toBe(false); - return pluginStartContract; - }, - } as AsyncPlugin); - - jest.doMock( - join(pluginPath, 'server'), - () => ({ - plugin: pluginInitializer, - }), - { - virtual: true, - } - ); - - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - - const prebootDeps = coreMock.createInternalPreboot(); - await pluginsService.preboot(prebootDeps); - - const setupDeps = coreMock.createInternalSetup(); - await pluginsService.setup(setupDeps); - - expect(startDependenciesResolved).toBe(false); - - const startDeps = coreMock.createInternalStart(); - await pluginsService.start(startDeps); - - expect(startDependenciesResolved).toBe(true); - expect(contextFromStart!.core).toEqual(contextFromStartService!.core); - expect(contextFromStart!.plugins).toEqual(contextFromStartService!.plugins); - expect(contextFromStartService!.pluginStart).toEqual(pluginStartContract); - }); -}); diff --git a/src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts b/src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts index 530a4b92ead6a..225faf5e2c275 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts @@ -13,7 +13,7 @@ import { Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; -import { InternalCoreStart } from '../../../internal_types'; +import type { InternalCoreStart } from '@kbn/core-lifecycle-server-internal'; import { Root } from '../../../root'; const kibanaVersion = Env.createDefault(REPO_ROOT, getEnvOptions()).packageInfo.version; diff --git a/src/core/server/integration_tests/saved_objects/migrations/actions/es_errors.test.ts b/src/core/server/integration_tests/saved_objects/migrations/actions/es_errors.test.ts index 749be45b35cb7..164fdb19819db 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/actions/es_errors.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/actions/es_errors.test.ts @@ -7,7 +7,7 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { ElasticsearchClient } from '../../../..'; -import { InternalCoreStart } from '../../../../internal_types'; +import { InternalCoreStart } from '@kbn/core-lifecycle-server-internal'; import * as kbnTestServer from '../../../../../test_helpers/kbn_server'; import { Root } from '../../../../root'; import { diff --git a/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts b/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts index 7dce76528a5a0..3026e2eec4d83 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts @@ -85,7 +85,7 @@ describe('checking migration metadata changes on all registered SO types', () => "event_loop_delays_daily": "d2ed39cf669577d90921c176499908b4943fb7bd", "exception-list": "fe8cc004fd2742177cdb9300f4a67689463faf9c", "exception-list-agnostic": "49fae8fcd1967cc4be45ba2a2c66c4afbc1e341b", - "file": "280f28bd48b3ad1f1a9f84c6c0ae6dd5ed1179da", + "file": "05c14a75e5e20b12ca514a1d7de231f420facf2c", "file-upload-usage-collection-telemetry": "8478924cf0057bd90df737155b364f98d05420a5", "fileShare": "3f88784b041bb8728a7f40763a08981828799a75", "fleet-fleet-server-host": "f00ca963f1bee868806319789cdc33f1f53a97e2", @@ -95,11 +95,11 @@ describe('checking migration metadata changes on all registered SO types', () => "index-pattern": "48e77ca393c254e93256f11a7cdc0232dd754c08", "infrastructure-monitoring-log-view": "e2c78c1076bd35e57d7c5fa1b410e5c126d12327", "infrastructure-ui-source": "7c8dbbc0a608911f1b683a944f4a65383f6153ed", - "ingest-agent-policies": "5d728f483dc3b14dcfa6bbad95c2024d2da68890", + "ingest-agent-policies": "9170cdad95d887c036b87adf0ff38a3f12800c05", "ingest-download-sources": "1e69dabd6db5e320fe08c5bda8f35f29bafc6b54", "ingest-outputs": "29b867bf7bfd28b1e17c84697dce5c6d078f9705", "ingest-package-policies": "e8707a8c7821ea085e67c2d213e24efa56307393", - "ingest_manager_settings": "bb71f20e36a9ac3a2e46d9345e2caa96e7bf8c22", + "ingest_manager_settings": "6f36714825cc15ea8d7cda06fde7851611a532b4", "inventory-view": "bc2bd1e7ec7c186159447ab228d269f22bd39056", "kql-telemetry": "29544cd7d3b767c5399878efae6bd724d24c03fd", "legacy-url-alias": "7172dfd54f2e0c89fe263fd7095519b2d826a930", @@ -130,7 +130,7 @@ describe('checking migration metadata changes on all registered SO types', () => "siem-ui-timeline-pinned-event": "e2697b38751506c7fce6e8b7207a830483dc4283", "space": "c4a0acce1bd4b9cce85154f2a350624a53111c59", "spaces-usage-stats": "922d3235bbf519e3fb3b260e27248b1df8249b79", - "synthetics-monitor": "7bebb6511c70359386f9e20c982db86259c7915c", + "synthetics-monitor": "0c62bf304aebd2134b20627519713819da896eb1", "synthetics-privates-locations": "dd00385f4a27ef062c3e57312eeb3799872fa4af", "tag": "39413f4578cc2128c9a0fda97d0acd1c8862c47a", "task": "ef53d0f070bd54957b8fe22fae3b1ff208913f76", diff --git a/src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts b/src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts index b18d20deaa0e6..3663297058b0c 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts @@ -16,7 +16,7 @@ import { getEnvOptions } from '@kbn/config-mocks'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { SavedObjectsRawDoc } from '@kbn/core-saved-objects-server'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; -import { InternalCoreStart } from '../../../internal_types'; +import { InternalCoreStart } from '@kbn/core-lifecycle-server-internal'; import { Root } from '../../../root'; const kibanaVersion = Env.createDefault(REPO_ROOT, getEnvOptions()).packageInfo.version; diff --git a/src/core/server/integration_tests/saved_objects/migrations/migration_from_same_v1.test.ts b/src/core/server/integration_tests/saved_objects/migrations/migration_from_same_v1.test.ts index f7c0cced08f0f..97369305591a6 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/migration_from_same_v1.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/migration_from_same_v1.test.ts @@ -16,7 +16,7 @@ import { getEnvOptions } from '@kbn/config-mocks'; import type { SavedObjectsRawDoc } from '@kbn/core-saved-objects-server'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; -import { InternalCoreStart } from '../../../internal_types'; +import { InternalCoreStart } from '@kbn/core-lifecycle-server-internal'; import { Root } from '../../../root'; const kibanaVersion = Env.createDefault(REPO_ROOT, getEnvOptions()).packageInfo.version; diff --git a/src/core/server/integration_tests/saved_objects/migrations/wait_for_migration_completion.test.ts b/src/core/server/integration_tests/saved_objects/migrations/wait_for_migration_completion.test.ts new file mode 100644 index 0000000000000..4b5197d7f69e8 --- /dev/null +++ b/src/core/server/integration_tests/saved_objects/migrations/wait_for_migration_completion.test.ts @@ -0,0 +1,154 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; +import fs from 'fs/promises'; +import JSON5 from 'json5'; +import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { retryAsync } from '@kbn/core-saved-objects-migration-server-mocks'; +import * as kbnTestServer from '../../../../test_helpers/kbn_server'; +import { Root } from '../../../root'; + +const logFilePath = Path.join(__dirname, 'wait_for_migration_completion.log'); + +async function removeLogFile() { + // ignore errors if it doesn't exist + await fs.unlink(logFilePath).catch(() => void 0); +} + +describe('migration with waitForCompletion=true', () => { + let esServer: kbnTestServer.TestElasticsearchUtils; + let root: Root; + + beforeAll(async () => { + await removeLogFile(); + }); + + afterAll(async () => { + if (root) { + await root.shutdown(); + } + if (esServer) { + await esServer.stop(); + } + + await new Promise((resolve) => setTimeout(resolve, 10000)); + }); + + it('waits for another instance to complete the migration', async () => { + const { startES } = kbnTestServer.createTestServers({ + adjustTimeout: (t: number) => jest.setTimeout(t), + settings: { + es: { + license: 'basic', + }, + }, + }); + + root = createRoot(); + + esServer = await startES(); + await root.preboot(); + await root.setup(); + + root.start(); + const esClient = esServer.es.getClient(); + + await retryAsync( + async () => { + const logFileContent = await fs.readFile(logFilePath, 'utf-8'); + const records = logFileContent + .split('\n') + .filter(Boolean) + .map((str) => JSON5.parse(str)) as any[]; + + expect( + records.find((rec) => + rec.message.startsWith( + `[.kibana] Migration required. Waiting until another Kibana instance completes the migration.` + ) + ) + ).toBeDefined(); + + expect( + records.find((rec) => + rec.message.startsWith(`[.kibana] INIT -> WAIT_FOR_MIGRATION_COMPLETION`) + ) + ).toBeDefined(); + + expect( + records.find((rec) => + rec.message.startsWith( + `[.kibana] WAIT_FOR_MIGRATION_COMPLETION -> WAIT_FOR_MIGRATION_COMPLETION` + ) + ) + ).toBeDefined(); + }, + { retryAttempts: 100, retryDelayMs: 200 } + ); + + const aliases: Record = { '.kibana': {} }; + aliases[`.kibana_${pkg.version}`] = {}; + await esClient.indices.create({ index: `.kibana_${pkg.version}_001`, aliases }); + + await retryAsync( + async () => { + const logFileContent = await fs.readFile(logFilePath, 'utf-8'); + const records = logFileContent + .split('\n') + .filter(Boolean) + .map((str) => JSON5.parse(str)) as any[]; + + expect( + records.find((rec) => + rec.message.startsWith(`[.kibana] WAIT_FOR_MIGRATION_COMPLETION -> DONE`) + ) + ).toBeDefined(); + + expect( + records.find((rec) => rec.message.startsWith(`[.kibana] Migration completed`)) + ).toBeDefined(); + }, + { retryAttempts: 100, retryDelayMs: 200 } + ); + }); +}); + +function createRoot() { + return kbnTestServer.createRootWithCorePlugins( + { + migrations: { + skip: false, + }, + node: { + roles: ['background_tasks'], + }, + logging: { + appenders: { + file: { + type: 'file', + fileName: logFilePath, + layout: { + type: 'json', + }, + }, + }, + loggers: [ + { + name: 'root', + level: 'info', + appenders: ['file'], + }, + ], + }, + }, + { + oss: true, + } + ); +} diff --git a/src/core/server/integration_tests/saved_objects/service/lib/repository.test.ts b/src/core/server/integration_tests/saved_objects/service/lib/repository.test.ts index a8d77abd65baf..d8107b5162f2e 100644 --- a/src/core/server/integration_tests/saved_objects/service/lib/repository.test.ts +++ b/src/core/server/integration_tests/saved_objects/service/lib/repository.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { InternalCoreStart } from '../../../../internal_types'; +import { InternalCoreStart } from '@kbn/core-lifecycle-server-internal'; import * as kbnTestServer from '../../../../../test_helpers/kbn_server'; import { Root } from '../../../../root'; diff --git a/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts index f0fdc609d8915..6325d80e9588f 100644 --- a/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts +++ b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts @@ -11,7 +11,7 @@ import h2o2 from '@hapi/h2o2'; import { URL } from 'url'; import type { SavedObject } from '@kbn/core-saved-objects-common'; import type { ISavedObjectsRepository } from '@kbn/core-saved-objects-api-server'; -import { InternalCoreSetup, InternalCoreStart } from '../../../../internal_types'; +import type { InternalCoreSetup, InternalCoreStart } from '@kbn/core-lifecycle-server-internal'; import { Root } from '../../../../root'; import * as kbnTestServer from '../../../../../test_helpers/kbn_server'; import { diff --git a/src/core/server/integration_tests/saved_objects/validation/validator.test.ts b/src/core/server/integration_tests/saved_objects/validation/validator.test.ts index 008bebdc5731f..1157bd6c7499b 100644 --- a/src/core/server/integration_tests/saved_objects/validation/validator.test.ts +++ b/src/core/server/integration_tests/saved_objects/validation/validator.test.ts @@ -15,7 +15,7 @@ import { REPO_ROOT } from '@kbn/utils'; import type { ISavedObjectsRepository } from '@kbn/core-saved-objects-api-server'; import type { SavedObjectsType } from '@kbn/core-saved-objects-server'; import { getEnvOptions } from '@kbn/config-mocks'; -import { InternalCoreSetup, InternalCoreStart } from '../../../internal_types'; +import type { InternalCoreSetup, InternalCoreStart } from '@kbn/core-lifecycle-server-internal'; import { Root } from '../../../root'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; diff --git a/src/core/server/internal_types.ts b/src/core/server/internal_types.ts deleted file mode 100644 index c66fdf9a968d2..0000000000000 --- a/src/core/server/internal_types.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import type { DocLinksServiceStart, DocLinksServiceSetup } from '@kbn/core-doc-links-server'; -import { - InternalLoggingServicePreboot, - InternalLoggingServiceSetup, -} from '@kbn/core-logging-server-internal'; -import type { - AnalyticsServicePreboot, - AnalyticsServiceSetup, - AnalyticsServiceStart, -} from '@kbn/core-analytics-server'; -import type { InternalEnvironmentServiceSetup } from '@kbn/core-environment-server-internal'; -import type { - InternalExecutionContextSetup, - InternalExecutionContextStart, -} from '@kbn/core-execution-context-server-internal'; -import type { InternalPrebootServicePreboot } from '@kbn/core-preboot-server-internal'; -import type { - InternalContextPreboot, - InternalContextSetup, -} from '@kbn/core-http-context-server-internal'; -import type { - InternalHttpServicePreboot, - InternalHttpServiceSetup, - InternalHttpServiceStart, -} from '@kbn/core-http-server-internal'; -import type { - InternalMetricsServiceSetup, - InternalMetricsServiceStart, -} from '@kbn/core-metrics-server-internal'; -import { - InternalElasticsearchServicePreboot, - InternalElasticsearchServiceSetup, - InternalElasticsearchServiceStart, -} from '@kbn/core-elasticsearch-server-internal'; -import type { CapabilitiesSetup, CapabilitiesStart } from '@kbn/core-capabilities-server'; -import { - InternalSavedObjectsServiceSetup, - InternalSavedObjectsServiceStart, -} from '@kbn/core-saved-objects-server-internal'; -import { - InternalDeprecationsServiceSetup, - InternalDeprecationsServiceStart, -} from '@kbn/core-deprecations-server-internal'; -import type { CoreUsageDataStart } from '@kbn/core-usage-data-server'; -import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal'; -import type { I18nServiceSetup } from '@kbn/core-i18n-server'; -import type { InternalStatusServiceSetup } from '@kbn/core-status-server-internal'; -import type { - InternalUiSettingsServicePreboot, - InternalUiSettingsServiceSetup, - InternalUiSettingsServiceStart, -} from '@kbn/core-ui-settings-server-internal'; -import type { InternalRenderingServiceSetup } from '@kbn/core-rendering-server-internal'; -import type { - InternalHttpResourcesPreboot, - InternalHttpResourcesSetup, -} from '@kbn/core-http-resources-server-internal'; - -/** @internal */ -export interface InternalCorePreboot { - analytics: AnalyticsServicePreboot; - context: InternalContextPreboot; - http: InternalHttpServicePreboot; - elasticsearch: InternalElasticsearchServicePreboot; - uiSettings: InternalUiSettingsServicePreboot; - httpResources: InternalHttpResourcesPreboot; - logging: InternalLoggingServicePreboot; - preboot: InternalPrebootServicePreboot; -} - -/** @internal */ -export interface InternalCoreSetup { - analytics: AnalyticsServiceSetup; - capabilities: CapabilitiesSetup; - context: InternalContextSetup; - docLinks: DocLinksServiceSetup; - http: InternalHttpServiceSetup; - elasticsearch: InternalElasticsearchServiceSetup; - executionContext: InternalExecutionContextSetup; - i18n: I18nServiceSetup; - savedObjects: InternalSavedObjectsServiceSetup; - status: InternalStatusServiceSetup; - uiSettings: InternalUiSettingsServiceSetup; - environment: InternalEnvironmentServiceSetup; - rendering: InternalRenderingServiceSetup; - httpResources: InternalHttpResourcesSetup; - logging: InternalLoggingServiceSetup; - metrics: InternalMetricsServiceSetup; - deprecations: InternalDeprecationsServiceSetup; - coreUsageData: InternalCoreUsageDataSetup; -} - -/** - * @internal - */ -export interface InternalCoreStart { - analytics: AnalyticsServiceStart; - capabilities: CapabilitiesStart; - elasticsearch: InternalElasticsearchServiceStart; - docLinks: DocLinksServiceStart; - http: InternalHttpServiceStart; - metrics: InternalMetricsServiceStart; - savedObjects: InternalSavedObjectsServiceStart; - uiSettings: InternalUiSettingsServiceStart; - coreUsageData: CoreUsageDataStart; - executionContext: InternalExecutionContextStart; - deprecations: InternalDeprecationsServiceStart; -} diff --git a/src/core/server/mocks.ts b/src/core/server/mocks.ts index 356fd4deb44d6..028465ebfb8ac 100644 --- a/src/core/server/mocks.ts +++ b/src/core/server/mocks.ts @@ -10,38 +10,16 @@ import { of } from 'rxjs'; import { duration } from 'moment'; import { ByteSizeValue } from '@kbn/config-schema'; import { isPromise } from '@kbn/std'; -import type { MockedKeys } from '@kbn/utility-types-jest'; -import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; -import { loggingSystemMock, loggingServiceMock } from '@kbn/core-logging-server-mocks'; -import { analyticsServiceMock } from '@kbn/core-analytics-server-mocks'; -import { environmentServiceMock } from '@kbn/core-environment-server-mocks'; +import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { nodeServiceMock } from '@kbn/core-node-server-mocks'; -import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { prebootServiceMock } from '@kbn/core-preboot-server-mocks'; -import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; -import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; -import { metricsServiceMock } from '@kbn/core-metrics-server-mocks'; -import { capabilitiesServiceMock } from '@kbn/core-capabilities-server-mocks'; import { typeRegistryMock as savedObjectsTypeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { savedObjectsServiceMock } from '@kbn/core-saved-objects-server-mocks'; import { savedObjectsClientMock } from '@kbn/core-saved-objects-api-server-mocks'; import { deprecationsServiceMock } from '@kbn/core-deprecations-server-mocks'; -import { coreUsageDataServiceMock } from '@kbn/core-usage-data-server-mocks'; -import { i18nServiceMock } from '@kbn/core-i18n-server-mocks'; -import { statusServiceMock } from '@kbn/core-status-server-mocks'; import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; -import { renderingServiceMock } from '@kbn/core-rendering-server-mocks'; -import { httpResourcesMock } from '@kbn/core-http-resources-server-mocks'; -import type { - PluginInitializerContext, - CoreSetup, - CoreStart, - StartServicesAccessor, - CorePreboot, - RequestHandlerContext, -} from '.'; -import { SharedGlobalConfig } from './plugins'; +import { coreLifecycleMock, coreInternalLifecycleMock } from '@kbn/core-lifecycle-server-mocks'; +import type { SharedGlobalConfig, PluginInitializerContext } from '@kbn/core-plugins-server'; export { configServiceMock, configDeprecationsMock } from '@kbn/config-mocks'; export { loggingSystemMock } from '@kbn/core-logging-server-mocks'; @@ -132,139 +110,6 @@ function pluginInitializerContextMock(config: T = {} as T) { return mock; } -type CorePrebootMockType = MockedKeys & { - elasticsearch: ReturnType; -}; - -function createCorePrebootMock() { - const mock: CorePrebootMockType = { - analytics: analyticsServiceMock.createAnalyticsServicePreboot(), - elasticsearch: elasticsearchServiceMock.createPreboot(), - http: httpServiceMock.createPrebootContract() as CorePrebootMockType['http'], - preboot: prebootServiceMock.createPrebootContract(), - }; - - return mock; -} - -type CoreSetupMockType = MockedKeys & { - elasticsearch: ReturnType; - getStartServices: jest.MockedFunction>; -}; - -function createCoreSetupMock({ - pluginStartDeps = {}, - pluginStartContract, -}: { - pluginStartDeps?: object; - pluginStartContract?: any; -} = {}) { - const httpMock: jest.Mocked = { - ...httpServiceMock.createSetupContract(), - resources: httpResourcesMock.createRegistrar(), - }; - - const uiSettingsMock = { - register: uiSettingsServiceMock.createSetupContract().register, - }; - - const mock: CoreSetupMockType = { - analytics: analyticsServiceMock.createAnalyticsServiceSetup(), - capabilities: capabilitiesServiceMock.createSetupContract(), - docLinks: docLinksServiceMock.createSetupContract(), - elasticsearch: elasticsearchServiceMock.createSetup(), - http: httpMock, - i18n: i18nServiceMock.createSetupContract(), - savedObjects: savedObjectsServiceMock.createInternalSetupContract(), - status: statusServiceMock.createSetupContract(), - uiSettings: uiSettingsMock, - logging: loggingServiceMock.createSetupContract(), - metrics: metricsServiceMock.createSetupContract(), - deprecations: deprecationsServiceMock.createSetupContract(), - executionContext: executionContextServiceMock.createInternalSetupContract(), - coreUsageData: { - registerUsageCounter: coreUsageDataServiceMock.createSetupContract().registerUsageCounter, - }, - getStartServices: jest - .fn, object, any]>, []>() - .mockResolvedValue([createCoreStartMock(), pluginStartDeps, pluginStartContract]), - }; - - return mock; -} - -function createCoreStartMock() { - const mock: MockedKeys = { - analytics: analyticsServiceMock.createAnalyticsServiceStart(), - capabilities: capabilitiesServiceMock.createStartContract(), - docLinks: docLinksServiceMock.createStartContract(), - elasticsearch: elasticsearchServiceMock.createStart(), - http: httpServiceMock.createStartContract(), - metrics: metricsServiceMock.createStartContract(), - savedObjects: savedObjectsServiceMock.createStartContract(), - uiSettings: uiSettingsServiceMock.createStartContract(), - coreUsageData: coreUsageDataServiceMock.createStartContract(), - executionContext: executionContextServiceMock.createInternalStartContract(), - }; - - return mock; -} - -function createInternalCorePrebootMock() { - const prebootDeps = { - analytics: analyticsServiceMock.createAnalyticsServicePreboot(), - context: contextServiceMock.createPrebootContract(), - elasticsearch: elasticsearchServiceMock.createInternalPreboot(), - http: httpServiceMock.createInternalPrebootContract(), - httpResources: httpResourcesMock.createPrebootContract(), - uiSettings: uiSettingsServiceMock.createPrebootContract(), - logging: loggingServiceMock.createInternalPrebootContract(), - preboot: prebootServiceMock.createInternalPrebootContract(), - }; - return prebootDeps; -} - -function createInternalCoreSetupMock() { - const setupDeps = { - analytics: analyticsServiceMock.createAnalyticsServiceSetup(), - capabilities: capabilitiesServiceMock.createSetupContract(), - context: contextServiceMock.createSetupContract(), - docLinks: docLinksServiceMock.createSetupContract(), - elasticsearch: elasticsearchServiceMock.createInternalSetup(), - http: httpServiceMock.createInternalSetupContract(), - savedObjects: savedObjectsServiceMock.createInternalSetupContract(), - status: statusServiceMock.createInternalSetupContract(), - environment: environmentServiceMock.createSetupContract(), - i18n: i18nServiceMock.createSetupContract(), - httpResources: httpResourcesMock.createSetupContract(), - rendering: renderingServiceMock.createSetupContract(), - uiSettings: uiSettingsServiceMock.createSetupContract(), - logging: loggingServiceMock.createInternalSetupContract(), - metrics: metricsServiceMock.createInternalSetupContract(), - deprecations: deprecationsServiceMock.createInternalSetupContract(), - executionContext: executionContextServiceMock.createInternalSetupContract(), - coreUsageData: coreUsageDataServiceMock.createSetupContract(), - }; - return setupDeps; -} - -function createInternalCoreStartMock() { - const startDeps = { - analytics: analyticsServiceMock.createAnalyticsServiceStart(), - capabilities: capabilitiesServiceMock.createStartContract(), - docLinks: docLinksServiceMock.createStartContract(), - elasticsearch: elasticsearchServiceMock.createInternalStart(), - http: httpServiceMock.createInternalStartContract(), - metrics: metricsServiceMock.createInternalStartContract(), - savedObjects: savedObjectsServiceMock.createInternalStartContract(), - uiSettings: uiSettingsServiceMock.createStartContract(), - coreUsageData: coreUsageDataServiceMock.createStartContract(), - executionContext: executionContextServiceMock.createInternalStartContract(), - deprecations: deprecationsServiceMock.createInternalStartContract(), - }; - return startDeps; -} - function createCoreRequestHandlerContextMock() { return { savedObjects: { @@ -321,12 +166,12 @@ const createCustomRequestHandlerContextMock = (contextParts: T): CustomReques }; export const coreMock = { - createPreboot: createCorePrebootMock, - createSetup: createCoreSetupMock, - createStart: createCoreStartMock, - createInternalPreboot: createInternalCorePrebootMock, - createInternalSetup: createInternalCoreSetupMock, - createInternalStart: createInternalCoreStartMock, + createPreboot: coreLifecycleMock.createPreboot, + createSetup: coreLifecycleMock.createCoreSetup, + createStart: coreLifecycleMock.createCoreStart, + createInternalPreboot: coreInternalLifecycleMock.createInternalPreboot, + createInternalSetup: coreInternalLifecycleMock.createInternalSetup, + createInternalStart: coreInternalLifecycleMock.createInternalStart, createPluginInitializerContext: pluginInitializerContextMock, createRequestHandlerContext: createCoreRequestHandlerContextMock, createCustomRequestHandlerContext: createCustomRequestHandlerContextMock, diff --git a/src/core/server/plugins/index.ts b/src/core/server/plugins/index.ts deleted file mode 100644 index 2111d467ef3c2..0000000000000 --- a/src/core/server/plugins/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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export { PluginsService } from './plugins_service'; -export type { - PluginsServiceSetup, - PluginsServiceStart, - DiscoveredPlugins, -} from './plugins_service'; -export { config } from './plugins_config'; -/** @internal */ -export { isNewPlatformPlugin } from './discovery'; -export * from './types'; diff --git a/src/core/server/plugins/legacy_config.test.ts b/src/core/server/plugins/legacy_config.test.ts deleted file mode 100644 index ca7a2d8a5454e..0000000000000 --- a/src/core/server/plugins/legacy_config.test.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { take } from 'rxjs/operators'; -import { ConfigService, Env } from '@kbn/config'; -import { getEnvOptions, rawConfigServiceMock } from '@kbn/config-mocks'; -import { getGlobalConfig, getGlobalConfig$ } from './legacy_config'; -import { REPO_ROOT } from '@kbn/utils'; -import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { duration } from 'moment'; -import { fromRoot } from '@kbn/utils'; -import { ByteSizeValue } from '@kbn/config-schema'; -import { Server } from '../server'; - -describe('Legacy config', () => { - let env: Env; - let logger: ReturnType; - - beforeEach(() => { - env = Env.createDefault(REPO_ROOT, getEnvOptions()); - logger = loggingSystemMock.create(); - }); - - const createConfigService = (rawConfig: Record = {}): ConfigService => { - const rawConfigService = rawConfigServiceMock.create({ rawConfig }); - const server = new Server(rawConfigService, env, logger); - server.setupCoreConfig(); - return server.configService; - }; - - describe('getGlobalConfig', () => { - it('should return the global config', async () => { - const configService = createConfigService(); - await configService.validate(); - - const legacyConfig = getGlobalConfig(configService); - - expect(legacyConfig).toStrictEqual({ - elasticsearch: { - shardTimeout: duration(30, 's'), - requestTimeout: duration(30, 's'), - pingTimeout: duration(30, 's'), - }, - path: { data: fromRoot('data') }, - savedObjects: { maxImportPayloadBytes: new ByteSizeValue(26214400) }, - }); - }); - }); - - describe('getGlobalConfig$', () => { - it('should return an observable for the global config', async () => { - const configService = createConfigService(); - - const legacyConfig = await getGlobalConfig$(configService).pipe(take(1)).toPromise(); - - expect(legacyConfig).toStrictEqual({ - elasticsearch: { - shardTimeout: duration(30, 's'), - requestTimeout: duration(30, 's'), - pingTimeout: duration(30, 's'), - }, - path: { data: fromRoot('data') }, - savedObjects: { maxImportPayloadBytes: new ByteSizeValue(26214400) }, - }); - }); - }); -}); diff --git a/src/core/server/plugins/plugin.test.ts b/src/core/server/plugins/plugin.test.ts deleted file mode 100644 index 538c9539b2a68..0000000000000 --- a/src/core/server/plugins/plugin.test.ts +++ /dev/null @@ -1,579 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { join } from 'path'; -import { BehaviorSubject } from 'rxjs'; -import { REPO_ROOT } from '@kbn/utils'; -import { schema } from '@kbn/config-schema'; -import { Env } from '@kbn/config'; - -import { configServiceMock, getEnvOptions } from '@kbn/config-mocks'; -import type { CoreContext } from '@kbn/core-base-server-internal'; -import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import type { NodeInfo } from '@kbn/core-node-server'; -import { nodeServiceMock } from '@kbn/core-node-server-mocks'; -import { coreMock } from '../mocks'; - -import { PluginWrapper } from './plugin'; -import { PluginManifest, PluginType } from './types'; -import { - createPluginInitializerContext, - createPluginSetupContext, - InstanceInfo, -} from './plugin_context'; - -const mockPluginInitializer = jest.fn(); -const logger = loggingSystemMock.create(); -jest.doMock( - join('plugin-with-initializer-path', 'server'), - () => ({ plugin: mockPluginInitializer }), - { virtual: true } -); -jest.doMock(join('plugin-without-initializer-path', 'server'), () => ({}), { - virtual: true, -}); -jest.doMock(join('plugin-with-wrong-initializer-path', 'server'), () => ({ plugin: {} }), { - virtual: true, -}); - -const OSS_PLUGIN_PATH_POSIX = '/kibana/src/plugins/ossPlugin'; -const OSS_PLUGIN_PATH_WINDOWS = 'C:\\kibana\\src\\plugins\\ossPlugin'; -const XPACK_PLUGIN_PATH_POSIX = '/kibana/x-pack/plugins/xPackPlugin'; -const XPACK_PLUGIN_PATH_WINDOWS = 'C:\\kibana\\x-pack\\plugins\\xPackPlugin'; - -function createPluginManifest(manifestProps: Partial = {}): PluginManifest { - return { - id: 'some-plugin-id', - version: 'some-version', - configPath: 'path', - kibanaVersion: '7.0.0', - type: PluginType.standard, - requiredPlugins: ['some-required-dep'], - optionalPlugins: ['some-optional-dep'], - requiredBundles: [], - server: true, - ui: true, - owner: { name: 'Core' }, - ...manifestProps, - }; -} - -const configService = configServiceMock.create(); -configService.atPath.mockReturnValue(new BehaviorSubject({ initialize: true })); - -let coreId: symbol; -let env: Env; -let coreContext: CoreContext; -let instanceInfo: InstanceInfo; -let nodeInfo: NodeInfo; - -const setupDeps = coreMock.createInternalSetup(); - -beforeEach(() => { - coreId = Symbol('core'); - env = Env.createDefault(REPO_ROOT, getEnvOptions()); - instanceInfo = { - uuid: 'instance-uuid', - }; - nodeInfo = nodeServiceMock.createInternalPrebootContract(); - - coreContext = { coreId, env, logger, configService: configService as any }; -}); - -afterEach(() => { - jest.clearAllMocks(); -}); - -test('`constructor` correctly initializes plugin instance', () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'some-plugin-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - expect(plugin.name).toBe('some-plugin-id'); - expect(plugin.configPath).toBe('path'); - expect(plugin.path).toBe('some-plugin-path'); - expect(plugin.source).toBe('external'); // see below for test cases for non-external sources (OSS and X-Pack) - expect(plugin.requiredPlugins).toEqual(['some-required-dep']); - expect(plugin.optionalPlugins).toEqual(['some-optional-dep']); -}); - -describe('`constructor` correctly sets non-external source', () => { - function createPlugin(path: string) { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - return new PluginWrapper({ - path, - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - } - - test('for OSS plugin in POSIX', () => { - const plugin = createPlugin(OSS_PLUGIN_PATH_POSIX); - expect(plugin.source).toBe('oss'); - }); - - test('for OSS plugin in Windows', () => { - const plugin = createPlugin(OSS_PLUGIN_PATH_WINDOWS); - expect(plugin.source).toBe('oss'); - }); - - test('for X-Pack plugin in POSIX', () => { - const plugin = createPlugin(XPACK_PLUGIN_PATH_POSIX); - expect(plugin.source).toBe('x-pack'); - }); - - test('for X-Pack plugin in Windows', () => { - const plugin = createPlugin(XPACK_PLUGIN_PATH_WINDOWS); - expect(plugin.source).toBe('x-pack'); - }); -}); - -test('`setup` fails if `plugin` initializer is not exported', () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-without-initializer-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - expect(() => - plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}) - ).toThrowErrorMatchingInlineSnapshot( - `"Plugin \\"some-plugin-id\\" does not export \\"plugin\\" definition (plugin-without-initializer-path)."` - ); -}); - -test('`setup` fails if plugin initializer is not a function', () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-wrong-initializer-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - expect(() => - plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}) - ).toThrowErrorMatchingInlineSnapshot( - `"Definition of plugin \\"some-plugin-id\\" should be a function (plugin-with-wrong-initializer-path)."` - ); -}); - -test('`setup` fails if initializer does not return object', () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-initializer-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - mockPluginInitializer.mockReturnValue(null); - - expect(() => - plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}) - ).toThrowErrorMatchingInlineSnapshot( - `"Initializer for plugin \\"some-plugin-id\\" is expected to return plugin instance, but returned \\"null\\"."` - ); -}); - -test('`setup` fails if object returned from initializer does not define `setup` function', () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-initializer-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - const mockPluginInstance = { run: jest.fn() }; - mockPluginInitializer.mockReturnValue(mockPluginInstance); - - expect(() => - plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}) - ).toThrowErrorMatchingInlineSnapshot( - `"Instance of plugin \\"some-plugin-id\\" does not define \\"setup\\" function."` - ); -}); - -test('`setup` initializes plugin and calls appropriate lifecycle hook', async () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const initializerContext = createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }); - const plugin = new PluginWrapper({ - path: 'plugin-with-initializer-path', - manifest, - opaqueId, - initializerContext, - }); - - const mockPluginInstance = { setup: jest.fn().mockResolvedValue({ contract: 'yes' }) }; - mockPluginInitializer.mockReturnValue(mockPluginInstance); - - const setupContext = createPluginSetupContext(coreContext, setupDeps, plugin); - const setupDependencies = { 'some-required-dep': { contract: 'no' } }; - await expect(plugin.setup(setupContext, setupDependencies)).resolves.toEqual({ contract: 'yes' }); - - expect(mockPluginInitializer).toHaveBeenCalledTimes(1); - expect(mockPluginInitializer).toHaveBeenCalledWith(initializerContext); - - expect(mockPluginInstance.setup).toHaveBeenCalledTimes(1); - expect(mockPluginInstance.setup).toHaveBeenCalledWith(setupContext, setupDependencies); -}); - -test('`start` fails if setup is not called first', () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'some-plugin-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - expect(() => plugin.start({} as any, {} as any)).toThrowErrorMatchingInlineSnapshot( - `"Plugin \\"some-plugin-id\\" can't be started since it isn't set up."` - ); -}); - -test('`start` fails invoked for the `preboot` plugin', async () => { - const manifest = createPluginManifest({ type: PluginType.preboot }); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-initializer-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - const mockPluginInstance = { setup: jest.fn() }; - mockPluginInitializer.mockReturnValue(mockPluginInstance); - - await plugin.setup({} as any, {} as any); - - expect(() => plugin.start({} as any, {} as any)).toThrowErrorMatchingInlineSnapshot( - `"Plugin \\"some-plugin-id\\" is a preboot plugin and cannot be started."` - ); -}); - -test('`start` calls plugin.start with context and dependencies', async () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-initializer-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - const context = { any: 'thing' } as any; - const deps = { otherDep: 'value' }; - - const pluginStartContract = { contract: 'start-contract' }; - const mockPluginInstance = { - setup: jest.fn(), - start: jest.fn().mockResolvedValue(pluginStartContract), - }; - mockPluginInitializer.mockReturnValue(mockPluginInstance); - - await plugin.setup({} as any, {} as any); - - const startContract = await plugin.start(context, deps); - - expect(startContract).toBe(pluginStartContract); - expect(mockPluginInstance.start).toHaveBeenCalledWith(context, deps); -}); - -test("`start` resolves `startDependencies` Promise after plugin's start", async () => { - expect.assertions(2); - - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-initializer-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - const startContext = { any: 'thing' } as any; - const pluginDeps = { someDep: 'value' }; - const pluginStartContract = { - someApi: () => 'foo', - }; - - let startDependenciesResolved = false; - - const mockPluginInstance = { - setup: jest.fn(), - start: async () => { - // delay to ensure startDependencies is not resolved until after the plugin instance's start resolves. - await new Promise((resolve) => setTimeout(resolve, 10)); - expect(startDependenciesResolved).toBe(false); - return pluginStartContract; - }, - }; - mockPluginInitializer.mockReturnValue(mockPluginInstance); - - await plugin.setup({} as any, {} as any); - - const startDependenciesCheck = plugin.startDependencies.then((resolvedStartDeps) => { - startDependenciesResolved = true; - expect(resolvedStartDeps).toEqual([startContext, pluginDeps, pluginStartContract]); - }); - - await plugin.start(startContext, pluginDeps); - await startDependenciesCheck; -}); - -test('`stop` fails if plugin is not set up', async () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-initializer-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - const mockPluginInstance = { setup: jest.fn(), stop: jest.fn() }; - mockPluginInitializer.mockReturnValue(mockPluginInstance); - - await expect(plugin.stop()).rejects.toMatchInlineSnapshot( - `[Error: Plugin "some-plugin-id" can't be stopped since it isn't set up.]` - ); - expect(mockPluginInstance.stop).not.toHaveBeenCalled(); -}); - -test('`stop` does nothing if plugin does not define `stop` function', async () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-initializer-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - mockPluginInitializer.mockReturnValue({ setup: jest.fn() }); - await plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}); - - await expect(plugin.stop()).resolves.toBeUndefined(); -}); - -test('`stop` calls `stop` defined by the plugin instance', async () => { - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-initializer-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - const mockPluginInstance = { setup: jest.fn(), stop: jest.fn() }; - mockPluginInitializer.mockReturnValue(mockPluginInstance); - await plugin.setup(createPluginSetupContext(coreContext, setupDeps, plugin), {}); - - await expect(plugin.stop()).resolves.toBeUndefined(); - expect(mockPluginInstance.stop).toHaveBeenCalledTimes(1); -}); - -describe('#getConfigSchema()', () => { - it('reads config schema from plugin', () => { - const pluginSchema = schema.any(); - const configDescriptor = { - schema: pluginSchema, - }; - jest.doMock( - join('plugin-with-schema', 'server'), - () => ({ - config: configDescriptor, - }), - { virtual: true } - ); - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-schema', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - - expect(plugin.getConfigDescriptor()).toBe(configDescriptor); - }); - - it('returns null if config definition not specified', () => { - jest.doMock(join('plugin-with-no-definition', 'server'), () => ({}), { virtual: true }); - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-no-definition', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - expect(plugin.getConfigDescriptor()).toBe(null); - }); - - it('returns null for plugins without a server part', () => { - const manifest = createPluginManifest({ server: false }); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-with-no-definition', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - expect(plugin.getConfigDescriptor()).toBe(null); - }); - - it('throws if plugin contains invalid schema', () => { - jest.doMock( - join('plugin-invalid-schema', 'server'), - () => ({ - config: { - schema: { - validate: () => null, - }, - }, - }), - { virtual: true } - ); - const manifest = createPluginManifest(); - const opaqueId = Symbol(); - const plugin = new PluginWrapper({ - path: 'plugin-invalid-schema', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }), - }); - expect(() => plugin.getConfigDescriptor()).toThrowErrorMatchingInlineSnapshot( - `"Configuration schema expected to be an instance of Type"` - ); - }); -}); diff --git a/src/core/server/plugins/plugin.ts b/src/core/server/plugins/plugin.ts deleted file mode 100644 index 9ddab175d313a..0000000000000 --- a/src/core/server/plugins/plugin.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { join } from 'path'; -import typeDetect from 'type-detect'; -import { firstValueFrom, Subject } from 'rxjs'; -import { isPromise } from '@kbn/std'; -import { isConfigSchema } from '@kbn/config-schema'; -import type { Logger } from '@kbn/logging'; -import { PluginType } from '@kbn/core-base-common'; -import { - AsyncPlugin, - Plugin, - PluginConfigDescriptor, - PluginInitializer, - PluginInitializerContext, - PluginManifest, - PluginOpaqueId, - PrebootPlugin, -} from './types'; -import { CorePreboot, CoreSetup, CoreStart } from '..'; - -const OSS_PATH_REGEX = /[\/|\\]src[\/|\\]plugins[\/|\\]/; // Matches src/plugins directory on POSIX and Windows -const XPACK_PATH_REGEX = /[\/|\\]x-pack[\/|\\]plugins[\/|\\]/; // Matches x-pack/plugins directory on POSIX and Windows - -/** - * Lightweight wrapper around discovered plugin that is responsible for instantiating - * plugin and dispatching proper context and dependencies into plugin's lifecycle hooks. - * - * @internal - */ -export class PluginWrapper< - TSetup = unknown, - TStart = unknown, - TPluginsSetup extends object = object, - TPluginsStart extends object = object -> { - public readonly path: string; - public readonly source: 'oss' | 'x-pack' | 'external'; - public readonly manifest: PluginManifest; - public readonly opaqueId: PluginOpaqueId; - public readonly name: PluginManifest['id']; - public readonly configPath: PluginManifest['configPath']; - public readonly requiredPlugins: PluginManifest['requiredPlugins']; - public readonly optionalPlugins: PluginManifest['optionalPlugins']; - public readonly requiredBundles: PluginManifest['requiredBundles']; - public readonly includesServerPlugin: PluginManifest['server']; - public readonly includesUiPlugin: PluginManifest['ui']; - - private readonly log: Logger; - private readonly initializerContext: PluginInitializerContext; - - private instance?: - | Plugin - | PrebootPlugin - | AsyncPlugin; - - private readonly startDependencies$ = new Subject<[CoreStart, TPluginsStart, TStart]>(); - public readonly startDependencies = firstValueFrom(this.startDependencies$); - - constructor( - public readonly params: { - readonly path: string; - readonly manifest: PluginManifest; - readonly opaqueId: PluginOpaqueId; - readonly initializerContext: PluginInitializerContext; - } - ) { - this.path = params.path; - this.source = getPluginSource(params.path); - this.manifest = params.manifest; - this.opaqueId = params.opaqueId; - this.initializerContext = params.initializerContext; - this.log = params.initializerContext.logger.get(); - this.name = params.manifest.id; - this.configPath = params.manifest.configPath; - this.requiredPlugins = params.manifest.requiredPlugins; - this.optionalPlugins = params.manifest.optionalPlugins; - this.requiredBundles = params.manifest.requiredBundles; - this.includesServerPlugin = params.manifest.server; - this.includesUiPlugin = params.manifest.ui; - } - - /** - * Instantiates plugin and calls `setup` function exposed by the plugin initializer. - * @param setupContext Context that consists of various core services tailored specifically - * for the `setup` lifecycle event. - * @param plugins The dictionary where the key is the dependency name and the value - * is the contract returned by the dependency's `setup` function. - */ - public setup( - setupContext: CoreSetup | CorePreboot, - plugins: TPluginsSetup - ): TSetup | Promise { - this.instance = this.createPluginInstance(); - - if (this.isPrebootPluginInstance(this.instance)) { - return this.instance.setup(setupContext as CorePreboot, plugins); - } - - return this.instance.setup(setupContext as CoreSetup, plugins); - } - - /** - * Calls `start` function exposed by the initialized plugin. - * @param startContext Context that consists of various core services tailored specifically - * for the `start` lifecycle event. - * @param plugins The dictionary where the key is the dependency name and the value - * is the contract returned by the dependency's `start` function. - */ - public start(startContext: CoreStart, plugins: TPluginsStart): TStart | Promise { - if (this.instance === undefined) { - throw new Error(`Plugin "${this.name}" can't be started since it isn't set up.`); - } - - if (this.isPrebootPluginInstance(this.instance)) { - throw new Error(`Plugin "${this.name}" is a preboot plugin and cannot be started.`); - } - - const startContract = this.instance.start(startContext, plugins); - if (isPromise(startContract)) { - return startContract.then((resolvedContract) => { - this.startDependencies$.next([startContext, plugins, resolvedContract]); - return resolvedContract; - }); - } else { - this.startDependencies$.next([startContext, plugins, startContract]); - return startContract; - } - } - - /** - * Calls optional `stop` function exposed by the plugin initializer. - */ - public async stop() { - if (this.instance === undefined) { - throw new Error(`Plugin "${this.name}" can't be stopped since it isn't set up.`); - } - - if (typeof this.instance.stop === 'function') { - await this.instance.stop(); - } - - this.instance = undefined; - } - - public getConfigDescriptor(): PluginConfigDescriptor | null { - if (!this.manifest.server) { - return null; - } - const pluginPathServer = join(this.path, 'server'); - // eslint-disable-next-line @typescript-eslint/no-var-requires - const pluginDefinition = require(pluginPathServer); - - if (!('config' in pluginDefinition)) { - this.log.debug(`"${pluginPathServer}" does not export "config".`); - return null; - } - - const configDescriptor = pluginDefinition.config; - if (!isConfigSchema(configDescriptor.schema)) { - throw new Error('Configuration schema expected to be an instance of Type'); - } - return configDescriptor; - } - - private createPluginInstance() { - this.log.debug('Initializing plugin'); - - // eslint-disable-next-line @typescript-eslint/no-var-requires - const pluginDefinition = require(join(this.path, 'server')); - if (!('plugin' in pluginDefinition)) { - throw new Error(`Plugin "${this.name}" does not export "plugin" definition (${this.path}).`); - } - - const { plugin: initializer } = pluginDefinition as { - plugin: PluginInitializer; - }; - if (!initializer || typeof initializer !== 'function') { - throw new Error(`Definition of plugin "${this.name}" should be a function (${this.path}).`); - } - - const instance = initializer(this.initializerContext); - if (!instance || typeof instance !== 'object') { - throw new Error( - `Initializer for plugin "${ - this.manifest.id - }" is expected to return plugin instance, but returned "${typeDetect(instance)}".` - ); - } - - if (typeof instance.setup !== 'function') { - throw new Error(`Instance of plugin "${this.name}" does not define "setup" function.`); - } - - return instance; - } - - private isPrebootPluginInstance( - instance: PluginWrapper['instance'] - ): instance is PrebootPlugin { - return this.manifest.type === PluginType.preboot; - } -} - -function getPluginSource(path: string): 'oss' | 'x-pack' | 'external' { - if (OSS_PATH_REGEX.test(path)) { - return 'oss'; - } else if (XPACK_PATH_REGEX.test(path)) { - return 'x-pack'; - } - return 'external'; -} diff --git a/src/core/server/plugins/plugin_context.test.ts b/src/core/server/plugins/plugin_context.test.ts deleted file mode 100644 index 803c5ded6a545..0000000000000 --- a/src/core/server/plugins/plugin_context.test.ts +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { duration } from 'moment'; -import { first } from 'rxjs/operators'; -import { REPO_ROOT } from '@kbn/utils'; -import { fromRoot } from '@kbn/utils'; -import { rawConfigServiceMock, getEnvOptions, configServiceMock } from '@kbn/config-mocks'; -import type { CoreContext } from '@kbn/core-base-server-internal'; -import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import type { NodeInfo } from '@kbn/core-node-server'; -import { nodeServiceMock } from '@kbn/core-node-server-mocks'; -import { - createPluginInitializerContext, - createPluginPrebootSetupContext, - InstanceInfo, -} from './plugin_context'; - -import { PluginManifest, PluginType } from './types'; -import { Server } from '../server'; -import { schema, ByteSizeValue } from '@kbn/config-schema'; -import { ConfigService, Env } from '@kbn/config'; -import { PluginWrapper } from './plugin'; -import { coreMock } from '../mocks'; - -function createPluginManifest(manifestProps: Partial = {}): PluginManifest { - return { - id: 'some-plugin-id', - version: 'some-version', - configPath: 'path', - kibanaVersion: '7.0.0', - type: PluginType.standard, - requiredPlugins: ['some-required-dep'], - requiredBundles: [], - optionalPlugins: ['some-optional-dep'], - server: true, - ui: true, - owner: { - name: 'Core', - githubTeam: 'kibana-core', - }, - ...manifestProps, - }; -} - -describe('createPluginInitializerContext', () => { - let logger: ReturnType; - let coreId: symbol; - let opaqueId: symbol; - let env: Env; - let coreContext: CoreContext; - let server: Server; - let instanceInfo: InstanceInfo; - let nodeInfo: NodeInfo; - - beforeEach(async () => { - logger = loggingSystemMock.create(); - coreId = Symbol('core'); - opaqueId = Symbol(); - instanceInfo = { - uuid: 'instance-uuid', - }; - nodeInfo = nodeServiceMock.createInternalPrebootContract(); - env = Env.createDefault(REPO_ROOT, getEnvOptions()); - const config$ = rawConfigServiceMock.create({ rawConfig: {} }); - server = new Server(config$, env, logger); - server.setupCoreConfig(); - coreContext = { coreId, env, logger, configService: server.configService }; - }); - - describe('context.config', () => { - it('config.get() should return the plugin config synchronously', async () => { - const config$ = rawConfigServiceMock.create({ - rawConfig: { - plugin: { - foo: 'bar', - answer: 42, - }, - }, - }); - - const configService = new ConfigService(config$, env, logger); - configService.setSchema( - 'plugin', - schema.object({ - foo: schema.string(), - answer: schema.number(), - }) - ); - await configService.validate(); - - coreContext = { coreId, env, logger, configService }; - - const manifest = createPluginManifest({ - configPath: 'plugin', - }); - - const pluginInitializerContext = createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }); - - expect(pluginInitializerContext.config.get()).toEqual({ - foo: 'bar', - answer: 42, - }); - }); - - it('config.globalConfig$ should be an observable for the global config', async () => { - const manifest = createPluginManifest(); - const pluginInitializerContext = createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }); - - expect(pluginInitializerContext.config.legacy.globalConfig$).toBeDefined(); - - const configObject = await pluginInitializerContext.config.legacy.globalConfig$ - .pipe(first()) - .toPromise(); - expect(configObject).toStrictEqual({ - elasticsearch: { - shardTimeout: duration(30, 's'), - requestTimeout: duration(30, 's'), - pingTimeout: duration(30, 's'), - }, - path: { data: fromRoot('data') }, - savedObjects: { maxImportPayloadBytes: new ByteSizeValue(26214400) }, - }); - }); - }); - - describe('context.env', () => { - it('should expose the correct instance uuid', () => { - const manifest = createPluginManifest(); - instanceInfo = { - uuid: 'kibana-uuid', - }; - const pluginInitializerContext = createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo, - nodeInfo, - }); - expect(pluginInitializerContext.env.instanceUuid).toBe('kibana-uuid'); - }); - - it('should expose paths to the config files', () => { - coreContext = { - ...coreContext, - env: Env.createDefault( - REPO_ROOT, - getEnvOptions({ - configs: ['/home/kibana/config/kibana.yml', '/home/kibana/config/kibana.dev.yml'], - }) - ), - }; - const pluginInitializerContext = createPluginInitializerContext({ - coreContext, - opaqueId, - manifest: createPluginManifest(), - instanceInfo, - nodeInfo, - }); - expect(pluginInitializerContext.env.configs).toEqual([ - '/home/kibana/config/kibana.yml', - '/home/kibana/config/kibana.dev.yml', - ]); - }); - }); - - describe('context.node', () => { - it('should expose the correct node roles', () => { - const pluginInitializerContext = createPluginInitializerContext({ - coreContext, - opaqueId, - manifest: createPluginManifest(), - instanceInfo, - nodeInfo: { roles: { backgroundTasks: false, ui: true } }, - }); - expect(pluginInitializerContext.node.roles.backgroundTasks).toBe(false); - expect(pluginInitializerContext.node.roles.ui).toBe(true); - }); - }); -}); - -describe('createPluginPrebootSetupContext', () => { - let coreContext: CoreContext; - let opaqueId: symbol; - let nodeInfo: NodeInfo; - - beforeEach(async () => { - opaqueId = Symbol(); - coreContext = { - coreId: Symbol('core'), - env: Env.createDefault(REPO_ROOT, getEnvOptions()), - logger: loggingSystemMock.create(), - configService: configServiceMock.create(), - }; - nodeInfo = nodeServiceMock.createInternalPrebootContract(); - }); - - it('`holdSetupUntilResolved` captures plugin.name', () => { - const manifest = createPluginManifest(); - const plugin = new PluginWrapper({ - path: 'some-path', - manifest, - opaqueId, - initializerContext: createPluginInitializerContext({ - coreContext, - opaqueId, - manifest, - instanceInfo: { - uuid: 'instance-uuid', - }, - nodeInfo, - }), - }); - - const corePreboot = coreMock.createInternalPreboot(); - const prebootSetupContext = createPluginPrebootSetupContext(coreContext, corePreboot, plugin); - - const holdSetupPromise = Promise.resolve(undefined); - prebootSetupContext.preboot.holdSetupUntilResolved('some-reason', holdSetupPromise); - - expect(corePreboot.preboot.holdSetupUntilResolved).toHaveBeenCalledTimes(1); - expect(corePreboot.preboot.holdSetupUntilResolved).toHaveBeenCalledWith( - 'some-plugin-id', - 'some-reason', - holdSetupPromise - ); - }); -}); diff --git a/src/core/server/plugins/plugins_service.test.ts b/src/core/server/plugins/plugins_service.test.ts deleted file mode 100644 index 9e234b871d647..0000000000000 --- a/src/core/server/plugins/plugins_service.test.ts +++ /dev/null @@ -1,1386 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { mockDiscover, mockPackage } from './plugins_service.test.mocks'; - -import { resolve, join } from 'path'; -import { BehaviorSubject, from } from 'rxjs'; -import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; -import { REPO_ROOT } from '@kbn/utils'; -import { schema } from '@kbn/config-schema'; -import { ConfigPath, ConfigService, Env } from '@kbn/config'; - -import { rawConfigServiceMock, getEnvOptions } from '@kbn/config-mocks'; -import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { environmentServiceMock } from '@kbn/core-environment-server-mocks'; -import { nodeServiceMock } from '@kbn/core-node-server-mocks'; -import { coreMock } from '../mocks'; -import { PluginDiscoveryError } from './discovery'; -import { PluginWrapper } from './plugin'; -import { PluginsService } from './plugins_service'; -import { PluginsSystem } from './plugins_system'; -import { config } from './plugins_config'; -import { take } from 'rxjs/operators'; -import { DiscoveredPlugin, PluginConfigDescriptor, PluginType } from './types'; - -const MockPluginsSystem: jest.Mock> = PluginsSystem as any; - -let pluginsService: PluginsService; -let config$: BehaviorSubject>; -let configService: ConfigService; -let coreId: symbol; -let env: Env; -let prebootMockPluginSystem: jest.Mocked>; -let standardMockPluginSystem: jest.Mocked>; -let environmentPreboot: ReturnType; -let nodePreboot: ReturnType; - -const prebootDeps = coreMock.createInternalPreboot(); -const setupDeps = coreMock.createInternalSetup(); -const startDeps = coreMock.createInternalStart(); -const logger = loggingSystemMock.create(); - -expect.addSnapshotSerializer(createAbsolutePathSerializer()); - -['path-1', 'path-2', 'path-3', 'path-4', 'path-5', 'path-6', 'path-7', 'path-8'].forEach((path) => { - [PluginType.preboot, PluginType.standard].forEach((type) => { - jest.doMock(join(`${path}-${type}`, 'server'), () => ({}), { - virtual: true, - }); - }); -}); - -const OSS_PLUGIN_PATH = '/kibana/src/plugins/ossPlugin'; -const XPACK_PLUGIN_PATH = '/kibana/x-pack/plugins/xPackPlugin'; -const EXTERNAL_PLUGIN_PATH = '/kibana/plugins/externalPlugin'; -[OSS_PLUGIN_PATH, XPACK_PLUGIN_PATH, EXTERNAL_PLUGIN_PATH].forEach((path) => { - jest.doMock(join(path, 'server'), () => ({}), { - virtual: true, - }); -}); - -const createPlugin = ( - id: string, - { - path = id, - disabled = false, - version = 'some-version', - type = PluginType.standard, - requiredPlugins = [], - requiredBundles = [], - optionalPlugins = [], - kibanaVersion = '7.0.0', - configPath = [path], - server = true, - ui = true, - }: { - path?: string; - disabled?: boolean; - version?: string; - type?: PluginType; - requiredPlugins?: string[]; - requiredBundles?: string[]; - optionalPlugins?: string[]; - kibanaVersion?: string; - configPath?: ConfigPath; - server?: boolean; - ui?: boolean; - } -): PluginWrapper => { - return new PluginWrapper({ - path, - manifest: { - id, - version, - configPath: disabled ? configPath.concat('-disabled') : configPath, - kibanaVersion, - type, - requiredPlugins, - requiredBundles, - optionalPlugins, - server, - owner: { - name: 'Core', - githubTeam: 'kibana-core', - }, - ui, - }, - opaqueId: Symbol(id), - initializerContext: { logger } as any, - }); -}; - -async function testSetup() { - mockPackage.raw = { - branch: 'feature-v1', - version: 'v1', - build: { - distributable: true, - number: 100, - sha: 'feature-v1-build-sha', - }, - }; - - coreId = Symbol('core'); - env = Env.createDefault(REPO_ROOT, getEnvOptions()); - - config$ = new BehaviorSubject>({ plugins: { initialize: true } }); - const rawConfigService = rawConfigServiceMock.create({ rawConfig$: config$ }); - configService = new ConfigService(rawConfigService, env, logger); - await configService.setSchema(config.path, config.schema); - pluginsService = new PluginsService({ coreId, env, logger, configService }); - - [prebootMockPluginSystem, standardMockPluginSystem] = MockPluginsSystem.mock.instances as any; - prebootMockPluginSystem.uiPlugins.mockReturnValue(new Map()); - prebootMockPluginSystem.getPlugins.mockReturnValue([]); - standardMockPluginSystem.uiPlugins.mockReturnValue(new Map()); - standardMockPluginSystem.getPlugins.mockReturnValue([]); - - environmentPreboot = environmentServiceMock.createPrebootContract(); - nodePreboot = nodeServiceMock.createInternalPrebootContract(); -} - -afterEach(() => { - jest.clearAllMocks(); -}); - -describe('PluginsService', () => { - beforeEach(async () => { - await testSetup(); - }); - - describe('#discover()', () => { - it('throws if plugin has an invalid manifest', async () => { - mockDiscover.mockReturnValue({ - error$: from([PluginDiscoveryError.invalidManifest('path-1', new Error('Invalid JSON'))]), - plugin$: from([]), - }); - - await expect(pluginsService.discover({ environment: environmentPreboot, node: nodePreboot })) - .rejects.toMatchInlineSnapshot(` - [Error: Failed to initialize plugins: - Invalid JSON (invalid-manifest, path-1)] - `); - expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` - Array [ - Array [ - [Error: Invalid JSON (invalid-manifest, path-1)], - ], - ] - `); - }); - - it('throws if plugin required Kibana version is incompatible with the current version', async () => { - mockDiscover.mockReturnValue({ - error$: from([ - PluginDiscoveryError.incompatibleVersion('path-3', new Error('Incompatible version')), - ]), - plugin$: from([]), - }); - - await expect(pluginsService.discover({ environment: environmentPreboot, node: nodePreboot })) - .rejects.toMatchInlineSnapshot(` - [Error: Failed to initialize plugins: - Incompatible version (incompatible-version, path-3)] - `); - expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` - Array [ - Array [ - [Error: Incompatible version (incompatible-version, path-3)], - ], - ] - `); - }); - - it('throws if discovered plugins with conflicting names', async () => { - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([ - createPlugin('conflicting-id', { - path: 'path-4-standard', - version: 'some-version', - configPath: 'path', - requiredPlugins: ['some-required-plugin', 'some-required-plugin-2'], - optionalPlugins: ['some-optional-plugin'], - }), - createPlugin('conflicting-id', { - path: 'path-4-standard', - version: 'some-version', - configPath: 'path', - requiredPlugins: ['some-required-plugin', 'some-required-plugin-2'], - optionalPlugins: ['some-optional-plugin'], - }), - ]), - }); - - await expect( - pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }) - ).rejects.toMatchInlineSnapshot( - `[Error: Plugin with id "conflicting-id" is already registered!]` - ); - - expect(prebootMockPluginSystem.addPlugin).not.toHaveBeenCalled(); - expect(prebootMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); - expect(standardMockPluginSystem.addPlugin).not.toHaveBeenCalled(); - expect(standardMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); - }); - - it('throws if discovered standard and preboot plugins with conflicting names', async () => { - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([ - createPlugin('conflicting-id', { - type: PluginType.preboot, - path: 'path-4-preboot', - version: 'some-version', - configPath: 'path', - requiredPlugins: ['some-required-plugin', 'some-required-plugin-2'], - optionalPlugins: ['some-optional-plugin'], - }), - createPlugin('conflicting-id', { - path: 'path-4-standard', - version: 'some-version', - configPath: 'path', - requiredPlugins: ['some-required-plugin', 'some-required-plugin-2'], - optionalPlugins: ['some-optional-plugin'], - }), - ]), - }); - - await expect( - pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }) - ).rejects.toMatchInlineSnapshot( - `[Error: Plugin with id "conflicting-id" is already registered!]` - ); - - expect(prebootMockPluginSystem.addPlugin).not.toHaveBeenCalled(); - expect(prebootMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); - expect(standardMockPluginSystem.addPlugin).not.toHaveBeenCalled(); - expect(standardMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); - }); - - describe('X-Pack dependencies', () => { - function mockDiscoveryResults(params: { sourcePluginPath: string; dependencyType: string }) { - const { sourcePluginPath, dependencyType } = params; - // Each plugin's source is derived from its path; the PluginWrapper test suite contains more detailed test cases around the paths (for both POSIX and Windows) - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([ - createPlugin('sourcePlugin', { - path: sourcePluginPath, - version: 'some-version', - configPath: 'path', - requiredPlugins: dependencyType === 'requiredPlugin' ? ['xPackPlugin'] : [], - requiredBundles: dependencyType === 'requiredBundle' ? ['xPackPlugin'] : undefined, - optionalPlugins: dependencyType === 'optionalPlugin' ? ['xPackPlugin'] : [], - }), - createPlugin('xPackPlugin', { - path: XPACK_PLUGIN_PATH, - version: 'some-version', - configPath: 'path', - requiredPlugins: [], - optionalPlugins: [], - }), - ]), - }); - } - - async function expectError() { - await expect( - pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }) - ).rejects.toThrow( - `X-Pack plugin or bundle with id "xPackPlugin" is required by OSS plugin "sourcePlugin", which is prohibited. Consider making this an optional dependency instead.` - ); - expect(standardMockPluginSystem.addPlugin).not.toHaveBeenCalled(); - } - - async function expectSuccess() { - await expect( - pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }) - ).resolves.toEqual(expect.anything()); - expect(standardMockPluginSystem.addPlugin).toHaveBeenCalled(); - } - - it('throws if an OSS plugin requires an X-Pack plugin or bundle', async () => { - for (const dependencyType of ['requiredPlugin', 'requiredBundle']) { - mockDiscoveryResults({ sourcePluginPath: OSS_PLUGIN_PATH, dependencyType }); - await expectError(); - } - }); - - it('does not throw if an OSS plugin has an optional dependency on an X-Pack plugin', async () => { - mockDiscoveryResults({ - sourcePluginPath: OSS_PLUGIN_PATH, - dependencyType: 'optionalPlugin', - }); - await expectSuccess(); - }); - - it('does not throw if an X-Pack plugin depends on an X-Pack plugin or bundle', async () => { - for (const dependencyType of ['requiredPlugin', 'requiredBundle', 'optionalPlugin']) { - mockDiscoveryResults({ sourcePluginPath: XPACK_PLUGIN_PATH, dependencyType }); - await expectSuccess(); - } - }); - - it('does not throw if an external plugin depends on an X-Pack plugin or bundle', async () => { - for (const dependencyType of ['requiredPlugin', 'requiredBundle', 'optionalPlugin']) { - mockDiscoveryResults({ sourcePluginPath: EXTERNAL_PLUGIN_PATH, dependencyType }); - await expectSuccess(); - } - }); - }); - - it('properly detects plugins that should be disabled.', async () => { - jest - .spyOn(configService, 'isEnabledAtPath') - .mockImplementation((path) => Promise.resolve(!path.includes('disabled'))); - - prebootMockPluginSystem.setupPlugins.mockResolvedValue(new Map()); - standardMockPluginSystem.setupPlugins.mockResolvedValue(new Map()); - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([ - createPlugin('explicitly-disabled-plugin-preboot', { - type: PluginType.preboot, - disabled: true, - path: 'path-1-preboot', - configPath: 'path-1-preboot', - }), - createPlugin('explicitly-disabled-plugin-standard', { - disabled: true, - path: 'path-1-standard', - configPath: 'path-1-standard', - }), - createPlugin('plugin-with-missing-required-deps-preboot', { - type: PluginType.preboot, - path: 'path-2-preboot', - configPath: 'path-2-preboot', - requiredPlugins: ['missing-plugin-preboot'], - }), - createPlugin('plugin-with-missing-required-deps-standard', { - path: 'path-2-standard', - configPath: 'path-2-standard', - requiredPlugins: ['missing-plugin-standard'], - }), - createPlugin('plugin-with-disabled-transitive-dep-preboot', { - type: PluginType.preboot, - path: 'path-3-preboot', - configPath: 'path-3-preboot', - requiredPlugins: ['another-explicitly-disabled-plugin-preboot'], - }), - createPlugin('plugin-with-disabled-transitive-dep-standard', { - path: 'path-3-standard', - configPath: 'path-3-standard', - requiredPlugins: ['another-explicitly-disabled-plugin-standard'], - }), - createPlugin('another-explicitly-disabled-plugin-preboot', { - type: PluginType.preboot, - disabled: true, - path: 'path-4-preboot', - configPath: 'path-4-disabled-preboot', - }), - createPlugin('another-explicitly-disabled-plugin-standard', { - disabled: true, - path: 'path-4-standard', - configPath: 'path-4-disabled-standard', - }), - createPlugin('plugin-with-disabled-optional-dep-preboot', { - type: PluginType.preboot, - path: 'path-5-preboot', - configPath: 'path-5-preboot', - optionalPlugins: ['explicitly-disabled-plugin-preboot'], - }), - createPlugin('plugin-with-disabled-optional-dep-standard', { - path: 'path-5-standard', - configPath: 'path-5-standard', - optionalPlugins: ['explicitly-disabled-plugin-standard'], - }), - createPlugin('plugin-with-missing-optional-dep-preboot', { - type: PluginType.preboot, - path: 'path-6-preboot', - configPath: 'path-6-preboot', - optionalPlugins: ['missing-plugin-preboot'], - }), - createPlugin('plugin-with-missing-optional-dep-standard', { - path: 'path-6-standard', - configPath: 'path-6-standard', - optionalPlugins: ['missing-plugin-standard'], - }), - createPlugin('plugin-with-disabled-nested-transitive-dep-preboot', { - type: PluginType.preboot, - path: 'path-7-preboot', - configPath: 'path-7-preboot', - requiredPlugins: ['plugin-with-disabled-transitive-dep-preboot'], - }), - createPlugin('plugin-with-disabled-nested-transitive-dep-standard', { - path: 'path-7-standard', - configPath: 'path-7-standard', - requiredPlugins: ['plugin-with-disabled-transitive-dep-standard'], - }), - createPlugin('plugin-with-missing-nested-dep-preboot', { - type: PluginType.preboot, - path: 'path-8-preboot', - configPath: 'path-8-preboot', - requiredPlugins: ['plugin-with-missing-required-deps-preboot'], - }), - createPlugin('plugin-with-missing-nested-dep-standard', { - path: 'path-8-standard', - configPath: 'path-8-standard', - requiredPlugins: ['plugin-with-missing-required-deps-standard'], - }), - ]), - }); - - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - await pluginsService.preboot(prebootDeps); - const setup = await pluginsService.setup(setupDeps); - - expect(setup.contracts).toBeInstanceOf(Map); - - expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledTimes(2); - expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledTimes(2); - - expect(prebootMockPluginSystem.setupPlugins).toHaveBeenCalledTimes(1); - expect(standardMockPluginSystem.setupPlugins).toHaveBeenCalledTimes(1); - - expect(prebootMockPluginSystem.setupPlugins).toHaveBeenCalledWith(prebootDeps); - expect(standardMockPluginSystem.setupPlugins).toHaveBeenCalledWith(setupDeps); - - expect(loggingSystemMock.collect(logger).info).toMatchInlineSnapshot(` - Array [ - Array [ - "Plugin \\"explicitly-disabled-plugin-preboot\\" is disabled.", - ], - Array [ - "Plugin \\"explicitly-disabled-plugin-standard\\" is disabled.", - ], - Array [ - "Plugin \\"plugin-with-missing-required-deps-preboot\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [missing-plugin-preboot]", - ], - Array [ - "Plugin \\"plugin-with-missing-required-deps-standard\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [missing-plugin-standard]", - ], - Array [ - "Plugin \\"plugin-with-disabled-transitive-dep-preboot\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [another-explicitly-disabled-plugin-preboot]", - ], - Array [ - "Plugin \\"plugin-with-disabled-transitive-dep-standard\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [another-explicitly-disabled-plugin-standard]", - ], - Array [ - "Plugin \\"another-explicitly-disabled-plugin-preboot\\" is disabled.", - ], - Array [ - "Plugin \\"another-explicitly-disabled-plugin-standard\\" is disabled.", - ], - Array [ - "Plugin \\"plugin-with-disabled-nested-transitive-dep-preboot\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [plugin-with-disabled-transitive-dep-preboot]", - ], - Array [ - "Plugin \\"plugin-with-disabled-nested-transitive-dep-standard\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [plugin-with-disabled-transitive-dep-standard]", - ], - Array [ - "Plugin \\"plugin-with-missing-nested-dep-preboot\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [plugin-with-missing-required-deps-preboot]", - ], - Array [ - "Plugin \\"plugin-with-missing-nested-dep-standard\\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [plugin-with-missing-required-deps-standard]", - ], - ] - `); - }); - - it('does not throw in case of mutual plugin dependencies', async () => { - const prebootPlugins = [ - createPlugin('first-plugin-preboot', { - type: PluginType.preboot, - path: 'path-1-preboot', - requiredPlugins: ['second-plugin-preboot'], - }), - createPlugin('second-plugin-preboot', { - type: PluginType.preboot, - path: 'path-2-preboot', - requiredPlugins: ['first-plugin-preboot'], - }), - ]; - const standardPlugins = [ - createPlugin('first-plugin-standard', { - path: 'path-1-standard', - requiredPlugins: ['second-plugin-standard'], - }), - createPlugin('second-plugin-standard', { - path: 'path-2-standard', - requiredPlugins: ['first-plugin-standard'], - }), - ]; - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([...prebootPlugins, ...standardPlugins]), - }); - - const { preboot, standard } = await pluginsService.discover({ - environment: environmentPreboot, - node: nodePreboot, - }); - expect(mockDiscover).toHaveBeenCalledTimes(1); - - expect(preboot.pluginTree).toBeUndefined(); - for (const plugin of prebootPlugins) { - expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); - } - - expect(standard.pluginTree).toBeUndefined(); - for (const plugin of standardPlugins) { - expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); - } - }); - - it('does not throw in case of mutual plugin dependencies between preboot and standard plugins', async () => { - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([ - createPlugin('first-plugin-preboot', { - type: PluginType.preboot, - path: 'path-1-preboot', - requiredPlugins: ['second-plugin-standard'], - }), - createPlugin('first-plugin-standard', { - path: 'path-1-standard', - requiredPlugins: ['second-plugin-preboot'], - }), - createPlugin('second-plugin-preboot', { - type: PluginType.preboot, - path: 'path-2-preboot', - requiredPlugins: ['first-plugin-standard'], - }), - createPlugin('second-plugin-standard', { - path: 'path-2-standard', - requiredPlugins: ['first-plugin-preboot'], - }), - ]), - }); - - const { preboot, standard } = await pluginsService.discover({ - environment: environmentPreboot, - node: nodePreboot, - }); - expect(preboot.pluginTree).toBeUndefined(); - expect(standard.pluginTree).toBeUndefined(); - - expect(mockDiscover).toHaveBeenCalledTimes(1); - expect(prebootMockPluginSystem.addPlugin).not.toHaveBeenCalled(); - expect(standardMockPluginSystem.addPlugin).not.toHaveBeenCalled(); - }); - - it('does not throw in case of cyclic plugin dependencies', async () => { - const prebootPlugins = [ - createPlugin('first-plugin-preboot', { - type: PluginType.preboot, - path: 'path-1-preboot', - requiredPlugins: ['second-plugin-preboot'], - }), - createPlugin('second-plugin-preboot', { - type: PluginType.preboot, - path: 'path-2-preboot', - requiredPlugins: ['third-plugin-preboot', 'last-plugin-preboot'], - }), - createPlugin('third-plugin-preboot', { - type: PluginType.preboot, - path: 'path-3-preboot', - requiredPlugins: ['last-plugin-preboot', 'first-plugin-preboot'], - }), - createPlugin('last-plugin-preboot', { - type: PluginType.preboot, - path: 'path-4-preboot', - requiredPlugins: ['first-plugin-preboot'], - }), - createPlugin('missing-deps-plugin-preboot', { - type: PluginType.preboot, - path: 'path-5-preboot', - requiredPlugins: ['not-a-plugin-preboot'], - }), - ]; - - const standardPlugins = [ - createPlugin('first-plugin-standard', { - path: 'path-1-standard', - requiredPlugins: ['second-plugin-standard'], - }), - createPlugin('second-plugin-standard', { - path: 'path-2-standard', - requiredPlugins: ['third-plugin-standard', 'last-plugin-standard'], - }), - createPlugin('third-plugin-standard', { - path: 'path-3-standard', - requiredPlugins: ['last-plugin-standard', 'first-plugin-standard'], - }), - createPlugin('last-plugin-standard', { - path: 'path-4-standard', - requiredPlugins: ['first-plugin-standard'], - }), - createPlugin('missing-deps-plugin-standard', { - path: 'path-5-standard', - requiredPlugins: ['not-a-plugin-standard'], - }), - ]; - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([...prebootPlugins, ...standardPlugins]), - }); - - const { standard, preboot } = await pluginsService.discover({ - environment: environmentPreboot, - node: nodePreboot, - }); - expect(mockDiscover).toHaveBeenCalledTimes(1); - - expect(preboot.pluginTree).toBeUndefined(); - expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledTimes(4); - for (const plugin of prebootPlugins) { - if (plugin.name.startsWith('missing-deps')) { - expect(prebootMockPluginSystem.addPlugin).not.toHaveBeenCalledWith(plugin); - } else { - expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); - } - } - - expect(standard.pluginTree).toBeUndefined(); - expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledTimes(4); - for (const plugin of standardPlugins) { - if (plugin.name.startsWith('missing-deps')) { - expect(standardMockPluginSystem.addPlugin).not.toHaveBeenCalledWith(plugin); - } else { - expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); - } - } - }); - - it('properly invokes plugin discovery and ignores non-critical errors.', async () => { - const prebootPlugins = [ - createPlugin('some-id-preboot', { - type: PluginType.preboot, - path: 'path-1-preboot', - configPath: 'path-preboot', - requiredPlugins: ['some-other-id-preboot'], - optionalPlugins: ['missing-optional-dep'], - }), - createPlugin('some-other-id-preboot', { - type: PluginType.preboot, - path: 'path-2-preboot', - version: 'some-other-version', - configPath: ['plugin-other-preboot', 'path'], - }), - ]; - - const standardPlugins = [ - createPlugin('some-id-standard', { - type: PluginType.standard, - path: 'path-1-standard', - configPath: 'path-standard', - requiredPlugins: ['some-other-id-standard'], - optionalPlugins: ['missing-optional-dep'], - }), - createPlugin('some-other-id-standard', { - type: PluginType.standard, - path: 'path-2-standard', - version: 'some-other-version', - configPath: ['plugin-other-standard', 'path'], - }), - ]; - - mockDiscover.mockReturnValue({ - error$: from([ - PluginDiscoveryError.missingManifest('path-2', new Error('No manifest')), - PluginDiscoveryError.invalidSearchPath('dir-1', new Error('No dir')), - PluginDiscoveryError.invalidPluginPath('path4-1', new Error('No path')), - ]), - plugin$: from([...prebootPlugins, ...standardPlugins]), - }); - - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledTimes(2); - for (const plugin of prebootPlugins) { - expect(prebootMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); - } - - expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledTimes(2); - for (const plugin of standardPlugins) { - expect(standardMockPluginSystem.addPlugin).toHaveBeenCalledWith(plugin); - } - - expect(mockDiscover).toHaveBeenCalledTimes(1); - expect(mockDiscover).toHaveBeenCalledWith({ - config: { - additionalPluginPaths: [], - initialize: true, - pluginSearchPaths: [ - resolve(process.cwd(), 'src', 'plugins'), - resolve(process.cwd(), 'x-pack', 'plugins'), - resolve(process.cwd(), 'plugins'), - resolve(process.cwd(), '..', 'kibana-extra'), - ], - }, - coreContext: { coreId, env, logger, configService }, - instanceInfo: { uuid: 'uuid' }, - nodeInfo: { roles: { backgroundTasks: true, ui: true } }, - }); - - const logs = loggingSystemMock.collect(logger); - expect(logs.info).toHaveLength(0); - expect(logs.error).toHaveLength(0); - }); - - it('registers plugin config schema in config service', async () => { - const configSchema = schema.string(); - jest.spyOn(configService, 'setSchema').mockImplementation(() => Promise.resolve()); - jest.doMock( - join('path-with-schema-preboot', 'server'), - () => ({ config: { schema: configSchema } }), - { virtual: true } - ); - jest.doMock( - join('path-with-schema-standard', 'server'), - () => ({ config: { schema: configSchema } }), - { virtual: true } - ); - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([ - createPlugin('some-id-preboot', { - type: PluginType.preboot, - path: 'path-with-schema-preboot', - configPath: 'path-preboot', - }), - createPlugin('some-id-standard', { - path: 'path-with-schema-standard', - configPath: 'path-standard', - }), - ]), - }); - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - expect(configService.setSchema).toBeCalledWith('path-preboot', configSchema); - expect(configService.setSchema).toBeCalledWith('path-standard', configSchema); - }); - - it('registers plugin config deprecation provider in config service', async () => { - const configSchema = schema.string(); - jest.spyOn(configService, 'setSchema').mockImplementation(() => Promise.resolve()); - jest.spyOn(configService, 'addDeprecationProvider'); - - const prebootDeprecationProvider = () => []; - jest.doMock( - join('path-with-provider-preboot', 'server'), - () => ({ config: { schema: configSchema, deprecations: prebootDeprecationProvider } }), - { virtual: true } - ); - - const standardDeprecationProvider = () => []; - jest.doMock( - join('path-with-provider-standard', 'server'), - () => ({ config: { schema: configSchema, deprecations: standardDeprecationProvider } }), - { virtual: true } - ); - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([ - createPlugin('some-id-preboot', { - type: PluginType.preboot, - path: 'path-with-provider-preboot', - configPath: 'config-path-preboot', - }), - createPlugin('some-id-standard', { - path: 'path-with-provider-standard', - configPath: 'config-path-standard', - }), - ]), - }); - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - expect(configService.addDeprecationProvider).toBeCalledWith( - 'config-path-preboot', - prebootDeprecationProvider - ); - expect(configService.addDeprecationProvider).toBeCalledWith( - 'config-path-standard', - standardDeprecationProvider - ); - }); - - it('returns the paths of the plugins', async () => { - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([]), - }); - - prebootMockPluginSystem.getPlugins.mockImplementation(() => [ - createPlugin('A-preboot', { - type: PluginType.preboot, - path: '/plugin-A-path-preboot', - configPath: 'pathA-preboot', - }), - createPlugin('B-preboot', { - type: PluginType.preboot, - path: '/plugin-B-path-preboot', - configPath: 'pathB-preboot', - }), - ]); - - standardMockPluginSystem.getPlugins.mockImplementation(() => [ - createPlugin('A-standard', { - path: '/plugin-A-path-standard', - configPath: 'pathA-standard', - }), - createPlugin('B-standard', { - path: '/plugin-B-path-standard', - configPath: 'pathB-standard', - }), - ]); - - const { preboot, standard } = await pluginsService.discover({ - environment: environmentPreboot, - node: nodePreboot, - }); - - expect(preboot.pluginPaths).toEqual(['/plugin-A-path-preboot', '/plugin-B-path-preboot']); - expect(standard.pluginPaths).toEqual(['/plugin-A-path-standard', '/plugin-B-path-standard']); - }); - - it('populates pluginConfigUsageDescriptors with plugins exposeToUsage property', async () => { - const pluginsWithExposeUsage = [ - createPlugin('plugin-with-expose-usage-preboot', { - type: PluginType.preboot, - path: 'plugin-with-expose-usage-preboot', - configPath: 'pathA-preboot', - }), - createPlugin('plugin-with-expose-usage-standard', { - path: 'plugin-with-expose-usage-standard', - configPath: 'pathA-standard', - }), - ]; - for (const plugin of pluginsWithExposeUsage) { - jest.doMock( - join(plugin.path, 'server'), - () => ({ - config: { - exposeToUsage: { test: true, nested: { prop: true } }, - schema: schema.maybe(schema.any()), - }, - }), - { virtual: true } - ); - } - - const pluginsWithArrayConfigPath = [ - createPlugin('plugin-with-array-configPath-preboot', { - type: PluginType.preboot, - path: 'plugin-with-array-configPath-preboot', - version: 'some-other-version', - configPath: ['plugin-preboot', 'pathB'], - }), - createPlugin('plugin-with-array-configPath-standard', { - path: 'plugin-with-array-configPath-standard', - version: 'some-other-version', - configPath: ['plugin-standard', 'pathB'], - }), - ]; - for (const plugin of pluginsWithArrayConfigPath) { - jest.doMock( - join(plugin.path, 'server'), - () => ({ - config: { - exposeToUsage: { test: true }, - schema: schema.maybe(schema.any()), - }, - }), - { virtual: true } - ); - } - - const pluginsWithoutExpose = [ - createPlugin('plugin-without-expose-preboot', { - type: PluginType.preboot, - path: 'plugin-without-expose-preboot', - configPath: 'pathC-preboot', - }), - createPlugin('plugin-without-expose-standard', { - path: 'plugin-without-expose-standard', - configPath: 'pathC-standard', - }), - ]; - for (const plugin of pluginsWithoutExpose) { - jest.doMock( - join(plugin.path, 'server'), - () => ({ - config: { - schema: schema.maybe(schema.any()), - }, - }), - { virtual: true } - ); - } - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([ - ...pluginsWithExposeUsage, - ...pluginsWithArrayConfigPath, - ...pluginsWithoutExpose, - ]), - }); - - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - - // eslint-disable-next-line dot-notation - expect(pluginsService['pluginConfigUsageDescriptors']).toMatchInlineSnapshot(` - Map { - "pathA-preboot" => Object { - "nested.prop": true, - "test": true, - }, - "pathA-standard" => Object { - "nested.prop": true, - "test": true, - }, - "plugin-preboot.pathB" => Object { - "test": true, - }, - "plugin-standard.pathB" => Object { - "test": true, - }, - } - `); - }); - }); - - describe('#generateUiPluginsConfigs()', () => { - const pluginToDiscoveredEntry = (plugin: PluginWrapper): [string, DiscoveredPlugin] => [ - plugin.name, - { - id: plugin.name, - type: plugin.manifest.type, - configPath: plugin.manifest.configPath, - requiredPlugins: [], - requiredBundles: [], - optionalPlugins: [], - }, - ]; - - it('properly generates client configs for plugins according to `exposeToBrowser`', async () => { - const prebootPlugin = createPlugin('plugin-with-expose-preboot', { - type: PluginType.preboot, - path: 'plugin-with-expose-preboot', - configPath: 'path-preboot', - }); - const standardPlugin = createPlugin('plugin-with-expose-standard', { - path: 'plugin-with-expose-standard', - configPath: 'path-standard', - }); - for (const plugin of [prebootPlugin, standardPlugin]) { - jest.doMock( - join(plugin.path, 'server'), - () => ({ - config: { - exposeToBrowser: { - sharedProp: true, - }, - schema: schema.object({ - serverProp: schema.string({ - defaultValue: `serverProp default value ${plugin.name}`, - }), - sharedProp: schema.string({ - defaultValue: `sharedProp default value ${plugin.name}`, - }), - }), - }, - }), - { virtual: true } - ); - } - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([prebootPlugin, standardPlugin]), - }); - prebootMockPluginSystem.uiPlugins.mockReturnValue( - new Map([pluginToDiscoveredEntry(prebootPlugin)]) - ); - standardMockPluginSystem.uiPlugins.mockReturnValue( - new Map([pluginToDiscoveredEntry(standardPlugin)]) - ); - - const { preboot, standard } = await pluginsService.discover({ - environment: environmentPreboot, - node: nodePreboot, - }); - - const prebootUIConfig$ = preboot.uiPlugins.browserConfigs.get('plugin-with-expose-preboot')!; - await expect(prebootUIConfig$.pipe(take(1)).toPromise()).resolves.toEqual({ - browserConfig: { sharedProp: 'sharedProp default value plugin-with-expose-preboot' }, - exposedConfigKeys: { sharedProp: 'string' }, - }); - - const standardUIConfig$ = standard.uiPlugins.browserConfigs.get( - 'plugin-with-expose-standard' - )!; - await expect(standardUIConfig$.pipe(take(1)).toPromise()).resolves.toEqual({ - browserConfig: { sharedProp: 'sharedProp default value plugin-with-expose-standard' }, - exposedConfigKeys: { sharedProp: 'string' }, - }); - }); - - it('does not generate config for plugins not exposing to client', async () => { - const prebootPlugin = createPlugin('plugin-without-expose-preboot', { - type: PluginType.preboot, - path: 'plugin-without-expose-preboot', - configPath: 'path-preboot', - }); - const standardPlugin = createPlugin('plugin-without-expose-standard', { - path: 'plugin-without-expose-standard', - configPath: 'path-standard', - }); - for (const plugin of [prebootPlugin, standardPlugin]) { - jest.doMock( - join(plugin.path, 'server'), - () => ({ - config: { - schema: schema.object({ - serverProp: schema.string({ defaultValue: 'serverProp default value' }), - }), - }, - }), - { virtual: true } - ); - } - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([prebootPlugin, standardPlugin]), - }); - prebootMockPluginSystem.uiPlugins.mockReturnValue( - new Map([pluginToDiscoveredEntry(prebootPlugin)]) - ); - standardMockPluginSystem.uiPlugins.mockReturnValue( - new Map([pluginToDiscoveredEntry(standardPlugin)]) - ); - - const { preboot, standard } = await pluginsService.discover({ - environment: environmentPreboot, - node: nodePreboot, - }); - expect(preboot.uiPlugins.browserConfigs.size).toBe(0); - expect(standard.uiPlugins.browserConfigs.size).toBe(0); - }); - }); - - test('"root" deprecations from one plugin should be applied before accessing other plugins config', async () => { - const pluginA = createPlugin('plugin-1-deprecations', { - type: PluginType.standard, - path: 'plugin-1-deprecations', - version: 'version-1', - }); - - const pluginB = createPlugin('plugin-2-deprecations', { - type: PluginType.standard, - path: 'plugin-2-deprecations', - version: 'version-2', - }); - - jest.doMock( - join(pluginA.path, 'server'), - () => ({ - config: { - schema: schema.object({ - enabled: schema.maybe(schema.boolean({ defaultValue: true })), - }), - }, - }), - { virtual: true } - ); - - jest.doMock( - join(pluginB.path, 'server'), - (): { config: PluginConfigDescriptor } => ({ - config: { - schema: schema.object({ - enabled: schema.maybe(schema.boolean({ defaultValue: true })), - renamed: schema.string(), // Mandatory string to make sure that the field is actually renamed by deprecations - }), - deprecations: ({ renameFromRoot }) => [ - renameFromRoot('plugin-1-deprecations.toBeRenamed', 'plugin-2-deprecations.renamed', { - level: 'critical', - }), - ], - }, - }), - { virtual: true } - ); - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([pluginA, pluginB]), - }); - - config$.next({ - 'plugin-1-deprecations': { - toBeRenamed: 'renamed', - }, - }); - - await expect( - pluginsService.discover({ - environment: environmentPreboot, - node: nodePreboot, - }) - ).resolves.not.toThrow(); // If the rename is not applied, it'll fail - }); - - describe('plugin initialization', () => { - beforeEach(() => { - const prebootPlugins = [ - createPlugin('plugin-1-preboot', { - type: PluginType.preboot, - path: 'path-1-preboot', - version: 'version-1', - }), - createPlugin('plugin-2-preboot', { - type: PluginType.preboot, - path: 'path-2-preboot', - version: 'version-2', - }), - ]; - const standardPlugins = [ - createPlugin('plugin-1-standard', { - path: 'path-1-standard', - version: 'version-1', - }), - createPlugin('plugin-2-standard', { - path: 'path-2-standard', - version: 'version-2', - }), - ]; - - for (const plugin of [...prebootPlugins, ...standardPlugins]) { - jest.doMock( - join(plugin.path, 'server'), - () => ({ - config: { - schema: schema.object({ - enabled: schema.maybe(schema.boolean({ defaultValue: true })), - }), - }, - }), - { virtual: true } - ); - } - - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([...prebootPlugins, ...standardPlugins]), - }); - - prebootMockPluginSystem.uiPlugins.mockReturnValue(new Map()); - standardMockPluginSystem.uiPlugins.mockReturnValue(new Map()); - }); - - it('`uiPlugins.internal` contains internal properties for plugins', async () => { - config$.next({ - plugins: { initialize: true }, - plugin1_preboot: { enabled: false }, - plugin1_standard: { enabled: false }, - }); - const { preboot, standard } = await pluginsService.discover({ - environment: environmentPreboot, - node: nodePreboot, - }); - expect(preboot.uiPlugins.internal).toMatchInlineSnapshot(` - Map { - "plugin-1-preboot" => Object { - "publicAssetsDir": /path-1-preboot/public/assets, - "publicTargetDir": /path-1-preboot/target/public, - "requiredBundles": Array [], - "version": "version-1", - }, - "plugin-2-preboot" => Object { - "publicAssetsDir": /path-2-preboot/public/assets, - "publicTargetDir": /path-2-preboot/target/public, - "requiredBundles": Array [], - "version": "version-2", - }, - } - `); - expect(standard.uiPlugins.internal).toMatchInlineSnapshot(` - Map { - "plugin-1-standard" => Object { - "publicAssetsDir": /path-1-standard/public/assets, - "publicTargetDir": /path-1-standard/target/public, - "requiredBundles": Array [], - "version": "version-1", - }, - "plugin-2-standard" => Object { - "publicAssetsDir": /path-2-standard/public/assets, - "publicTargetDir": /path-2-standard/target/public, - "requiredBundles": Array [], - "version": "version-2", - }, - } - `); - }); - - it('`uiPlugins.internal` includes disabled plugins', async () => { - config$.next({ - plugins: { initialize: true }, - plugin1_preboot: { enabled: false }, - plugin1_standard: { enabled: false }, - }); - const { preboot, standard } = await pluginsService.discover({ - environment: environmentPreboot, - node: nodePreboot, - }); - expect([...preboot.uiPlugins.internal.keys()].sort()).toMatchInlineSnapshot(` - Array [ - "plugin-1-preboot", - "plugin-2-preboot", - ] - `); - expect([...standard.uiPlugins.internal.keys()].sort()).toMatchInlineSnapshot(` - Array [ - "plugin-1-standard", - "plugin-2-standard", - ] - `); - }); - - it('#preboot does initialize `preboot` plugins if plugins.initialize is true', async () => { - config$.next({ plugins: { initialize: true } }); - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - await pluginsService.preboot(prebootDeps); - - expect(prebootMockPluginSystem.setupPlugins).toHaveBeenCalledTimes(1); - expect(prebootMockPluginSystem.setupPlugins).toHaveBeenCalledWith(prebootDeps); - expect(standardMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); - }); - - it('#preboot does not initialize `preboot` plugins if plugins.initialize is false', async () => { - config$.next({ plugins: { initialize: false } }); - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - await pluginsService.preboot(prebootDeps); - - expect(prebootMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); - expect(standardMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); - }); - - it('#setup does initialize `standard` plugins if plugins.initialize is true', async () => { - config$.next({ plugins: { initialize: true } }); - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - await pluginsService.preboot(prebootDeps); - - const { initialized } = await pluginsService.setup(setupDeps); - expect(standardMockPluginSystem.setupPlugins).toHaveBeenCalledTimes(1); - expect(standardMockPluginSystem.setupPlugins).toHaveBeenCalledWith(setupDeps); - expect(initialized).toBe(true); - }); - - it('#setup does not initialize `standard` plugins if plugins.initialize is false', async () => { - config$.next({ plugins: { initialize: false } }); - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - await pluginsService.preboot(prebootDeps); - const { initialized } = await pluginsService.setup(setupDeps); - expect(standardMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); - expect(prebootMockPluginSystem.setupPlugins).not.toHaveBeenCalled(); - expect(initialized).toBe(false); - }); - }); - - describe('#getExposedPluginConfigsToUsage', () => { - it('returns pluginConfigUsageDescriptors', () => { - // eslint-disable-next-line dot-notation - pluginsService['pluginConfigUsageDescriptors'].set('test', { enabled: true }); - expect(pluginsService.getExposedPluginConfigsToUsage()).toMatchInlineSnapshot(` - Map { - "test" => Object { - "enabled": true, - }, - } - `); - }); - }); - - describe('#start()', () => { - beforeEach(() => { - mockDiscover.mockReturnValue({ - error$: from([]), - plugin$: from([ - createPlugin('plugin-1-preboot', { type: PluginType.preboot, path: 'path-1-preboot' }), - createPlugin('plugin-1-standard', { path: 'path-1-standard' }), - ]), - }); - }); - - it('does not try to stop `preboot` plugins and start `standard` ones if plugins.initialize is `false`', async () => { - config$.next({ plugins: { initialize: false } }); - - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - await pluginsService.preboot(prebootDeps); - await pluginsService.setup(setupDeps); - - const { contracts } = await pluginsService.start(startDeps); - expect(contracts).toBeInstanceOf(Map); - expect(contracts.size).toBe(0); - - expect(prebootMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); - expect(standardMockPluginSystem.startPlugins).not.toHaveBeenCalled(); - }); - - it('stops `preboot` plugins and starts `standard` ones', async () => { - await pluginsService.discover({ environment: environmentPreboot, node: nodePreboot }); - await pluginsService.preboot(prebootDeps); - await pluginsService.setup(setupDeps); - - expect(prebootMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); - expect(standardMockPluginSystem.startPlugins).not.toHaveBeenCalled(); - - await pluginsService.start(startDeps); - - expect(prebootMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); - expect(standardMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); - - expect(standardMockPluginSystem.startPlugins).toHaveBeenCalledTimes(1); - expect(standardMockPluginSystem.startPlugins).toHaveBeenCalledWith(startDeps); - expect(prebootMockPluginSystem.startPlugins).not.toHaveBeenCalled(); - }); - }); - - describe('#stop()', () => { - it('`stop` stops plugins system', async () => { - await pluginsService.stop(); - expect(standardMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); - expect(prebootMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); - }); - - it('`stop` does not try to stop preboot plugins system if it was stopped during `start`.', async () => { - await pluginsService.preboot(prebootDeps); - await pluginsService.setup(setupDeps); - - expect(prebootMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); - expect(standardMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); - - await pluginsService.start(startDeps); - - expect(prebootMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); - expect(standardMockPluginSystem.stopPlugins).not.toHaveBeenCalled(); - - await pluginsService.stop(); - - expect(prebootMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); - expect(standardMockPluginSystem.stopPlugins).toHaveBeenCalledTimes(1); - }); - }); -}); diff --git a/src/core/server/plugins/types.ts b/src/core/server/plugins/types.ts deleted file mode 100644 index 699631bc4411e..0000000000000 --- a/src/core/server/plugins/types.ts +++ /dev/null @@ -1,469 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Observable } from 'rxjs'; -import { Type } from '@kbn/config-schema'; -import { RecursiveReadonly } from '@kbn/utility-types'; -import { PathConfigType } from '@kbn/utils'; -import { LoggerFactory } from '@kbn/logging'; -import type { - ConfigPath, - EnvironmentMode, - PackageInfo, - ConfigDeprecationProvider, -} from '@kbn/config'; -import type { PluginName, PluginOpaqueId, PluginType } from '@kbn/core-base-common'; -import type { NodeInfo } from '@kbn/core-node-server'; -import type { ElasticsearchConfigType } from '@kbn/core-elasticsearch-server-internal'; -import type { SavedObjectsConfigType } from '@kbn/core-saved-objects-base-server-internal'; -import { CorePreboot, CoreSetup, CoreStart } from '..'; - -type Maybe = T | undefined; - -// re-exporting for now to avoid adapting all imports, will be removed later on in the migration process -export type { PluginName, PluginOpaqueId, DiscoveredPlugin } from '@kbn/core-base-common'; -export { PluginType } from '@kbn/core-base-common'; - -/** - * Dedicated type for plugin configuration schema. - * - * @public - */ -export type PluginConfigSchema = Type; - -/** - * Type defining the list of configuration properties that will be exposed on the client-side - * Object properties can either be fully exposed - * - * @public - */ -export type ExposedToBrowserDescriptor = { - [Key in keyof T]?: T[Key] extends Maybe - ? // handles arrays as primitive values - boolean - : T[Key] extends Maybe - ? // can be nested for objects - ExposedToBrowserDescriptor | boolean - : // primitives - boolean; -}; - -/** - * Describes a plugin configuration properties. - * - * @example - * ```typescript - * // my_plugin/server/index.ts - * import { schema, TypeOf } from '@kbn/config-schema'; - * import { PluginConfigDescriptor } from '@kbn/core/server'; - * - * const configSchema = schema.object({ - * secret: schema.string({ defaultValue: 'Only on server' }), - * uiProp: schema.string({ defaultValue: 'Accessible from client' }), - * }); - * - * type ConfigType = TypeOf; - * - * export const config: PluginConfigDescriptor = { - * exposeToBrowser: { - * uiProp: true, - * }, - * schema: configSchema, - * deprecations: ({ rename, unused }) => [ - * rename('securityKey', 'secret'), - * unused('deprecatedProperty'), - * ], - * }; - * ``` - * - * @public - */ -export interface PluginConfigDescriptor { - /** - * Provider for the {@link ConfigDeprecation} to apply to the plugin configuration. - */ - deprecations?: ConfigDeprecationProvider; - /** - * List of configuration properties that will be available on the client-side plugin. - */ - exposeToBrowser?: ExposedToBrowserDescriptor; - /** - * Schema to use to validate the plugin configuration. - * - * {@link PluginConfigSchema} - */ - schema: PluginConfigSchema; - /** - * Expose non-default configs to usage collection to be sent via telemetry. - * set a config to `true` to report the actual changed config value. - * set a config to `false` to report the changed config value as [redacted]. - * - * All changed configs except booleans and numbers will be reported - * as [redacted] unless otherwise specified. - * - * {@link MakeUsageFromSchema} - */ - exposeToUsage?: MakeUsageFromSchema; -} - -/** - * List of configuration values that will be exposed to usage collection. - * If parent node or actual config path is set to `true` then the actual value - * of these configs will be reoprted. - * If parent node or actual config path is set to `false` then the config - * will be reported as [redacted]. - * - * @public - */ -export type MakeUsageFromSchema = { - [Key in keyof T]?: T[Key] extends Maybe - ? // arrays of objects are always redacted - false - : T[Key] extends Maybe - ? boolean - : T[Key] extends Maybe - ? MakeUsageFromSchema | boolean - : boolean; -}; - -/** @internal */ -export interface PluginDependencies { - asNames: ReadonlyMap; - asOpaqueIds: ReadonlyMap; -} - -/** - * Describes the set of required and optional properties plugin can define in its - * mandatory JSON manifest file. - * - * @remarks - * Should never be used in code outside of Core but is exported for - * documentation purposes. - * - * @public - */ -export interface PluginManifest { - /** - * Identifier of the plugin. Must be a string in camelCase. Part of a plugin public contract. - * Other plugins leverage it to access plugin API, navigate to the plugin, etc. - */ - readonly id: PluginName; - - /** - * Version of the plugin. - */ - readonly version: string; - - /** - * The version of Kibana the plugin is compatible with, defaults to "version". - */ - readonly kibanaVersion: string; - - /** - * Type of the plugin, defaults to `standard`. - */ - readonly type: PluginType; - - /** - * Root {@link ConfigPath | configuration path} used by the plugin, defaults - * to "id" in snake_case format. - * - * @example - * id: myPlugin - * configPath: my_plugin - */ - readonly configPath: ConfigPath; - - /** - * An optional list of the other plugins that **must be** installed and enabled - * for this plugin to function properly. - */ - readonly requiredPlugins: readonly PluginName[]; - - /** - * List of plugin ids that this plugin's UI code imports modules from that are - * not in `requiredPlugins`. - * - * @remarks - * The plugins listed here will be loaded in the browser, even if the plugin is - * disabled. Required by `@kbn/optimizer` to support cross-plugin imports. - * "core" and plugins already listed in `requiredPlugins` do not need to be - * duplicated here. - */ - readonly requiredBundles: readonly string[]; - - /** - * An optional list of the other plugins that if installed and enabled **may be** - * leveraged by this plugin for some additional functionality but otherwise are - * not required for this plugin to work properly. - */ - readonly optionalPlugins: readonly PluginName[]; - - /** - * Specifies whether plugin includes some client/browser specific functionality - * that should be included into client bundle via `public/ui_plugin.js` file. - */ - readonly ui: boolean; - - /** - * Specifies whether plugin includes some server-side specific functionality. - */ - readonly server: boolean; - - /** - * Specifies directory names that can be imported by other ui-plugins built - * using the same instance of the @kbn/optimizer. A temporary measure we plan - * to replace with better mechanisms for sharing static code between plugins - * @deprecated To be deleted when https://github.com/elastic/kibana/issues/101948 is done. - */ - readonly extraPublicDirs?: string[]; - - /** - * Only used for the automatically generated API documentation. Specifying service - * folders will cause your plugin API reference to be broken up into sub sections. - */ - readonly serviceFolders?: readonly string[]; - - readonly owner: { - /** - * The name of the team that currently owns this plugin. - */ - readonly name: string; - /** - * All internal plugins should have a github team specified. GitHub teams can be viewed here: - * https://github.com/orgs/elastic/teams - */ - readonly githubTeam?: string; - }; - - /** - * TODO: make required once all plugins specify this. - * A brief description of what this plugin does and any capabilities it provides. - */ - readonly description?: string; - - /** - * Specifies whether this plugin - and its required dependencies - will be enabled for anonymous pages (login page, status page when - * configured, etc.) Default is false. - */ - readonly enabledOnAnonymousPages?: boolean; -} - -/** - * The interface that should be returned by a `PluginInitializer` for a `preboot` plugin. - * - * @public - */ -export interface PrebootPlugin { - setup(core: CorePreboot, plugins: TPluginsSetup): TSetup; - - stop?(): void; -} - -/** - * The interface that should be returned by a `PluginInitializer` for a `standard` plugin. - * - * @public - */ -export interface Plugin< - TSetup = void, - TStart = void, - TPluginsSetup extends object = object, - TPluginsStart extends object = object -> { - setup(core: CoreSetup, plugins: TPluginsSetup): TSetup; - - start(core: CoreStart, plugins: TPluginsStart): TStart; - - stop?(): void; -} - -/** - * A plugin with asynchronous lifecycle methods. - * - * @deprecated Asynchronous lifecycles are deprecated, and should be migrated to sync {@link Plugin | plugin} - * @removeBy 8.8.0 - * @public - */ -export interface AsyncPlugin< - TSetup = void, - TStart = void, - TPluginsSetup extends object = object, - TPluginsStart extends object = object -> { - setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | Promise; - - start(core: CoreStart, plugins: TPluginsStart): TStart | Promise; - - stop?(): void; -} - -export const SharedGlobalConfigKeys = { - // We can add more if really needed - elasticsearch: ['shardTimeout', 'requestTimeout', 'pingTimeout'] as const, - path: ['data'] as const, - savedObjects: ['maxImportPayloadBytes'] as const, -}; - -/** - * @public - */ -export type SharedGlobalConfig = RecursiveReadonly<{ - elasticsearch: Pick; - path: Pick; - savedObjects: Pick; -}>; - -/** - * Context that's available to plugins during initialization stage. - * - * @public - */ -export interface PluginInitializerContext { - opaqueId: PluginOpaqueId; - env: { - mode: EnvironmentMode; - packageInfo: Readonly; - instanceUuid: string; - configs: readonly string[]; - }; - /** - * Access the configuration for this particular Kibana node. - * Can be used to determine which `roles` the current process was started with. - * - * @example - * ```typescript - * // plugins/my-plugin/server/plugin.ts - * - * export class MyPlugin implements Plugin { - * constructor(private readonly initContext: PluginInitializerContext) { - * this.initContext = initContext; - * } - * setup() { - * if (this.initContext.node.roles.backgroundTasks) { - * // run background tasks - * } else if (this.initContext.node.roles.ui) { - * // register http routes, etc - * } - * } - * } - * ``` - */ - node: NodeInfo; - /** - * {@link LoggerFactory | logger factory} instance already bound to the plugin's logging context - * - * @example - * ```typescript - * // plugins/my-plugin/server/plugin.ts - * // "id: myPlugin" in `plugins/my-plugin/kibana.yaml` - * - * export class MyPlugin implements Plugin { - * constructor(private readonly initContext: PluginInitializerContext) { - * this.logger = initContext.logger.get(); - * // `logger` context: `plugins.myPlugin` - * this.mySubLogger = initContext.logger.get('sub'); // or this.logger.get('sub'); - * // `mySubLogger` context: `plugins.myPlugin.sub` - * } - * } - * ``` - */ - logger: LoggerFactory; - /** - * Accessors for the plugin's configuration - */ - config: { - /** - * Provide access to Kibana legacy configuration values. - * - * @remarks Naming not final here, it may be renamed in a near future - * @deprecated Accessing configuration values outside of the plugin's config scope is highly discouraged. - * Can be removed when https://github.com/elastic/kibana/issues/119862 is done. - */ - legacy: { - globalConfig$: Observable; - get: () => SharedGlobalConfig; - }; - /** - * Return an observable of the plugin's configuration - * - * @example - * ```typescript - * // plugins/my-plugin/server/plugin.ts - * - * export class MyPlugin implements Plugin { - * constructor(private readonly initContext: PluginInitializerContext) {} - * setup(core) { - * this.configSub = this.initContext.config.create().subscribe((config) => { - * this.myService.reconfigure(config); - * }); - * } - * stop() { - * this.configSub.unsubscribe(); - * } - * ``` - * - * @example - * ```typescript - * // plugins/my-plugin/server/plugin.ts - * - * export class MyPlugin implements Plugin { - * constructor(private readonly initContext: PluginInitializerContext) {} - * async setup(core) { - * this.config = await this.initContext.config.create().pipe(take(1)).toPromise(); - * } - * stop() { - * this.configSub.unsubscribe(); - * } - * ``` - * - * @remarks The underlying observable has a replay effect, meaning that awaiting for the first emission - * will be resolved at next tick, without risks to delay any asynchronous code's workflow. - */ - create: () => Observable; - /** - * Return the current value of the plugin's configuration synchronously. - * - * @example - * ```typescript - * // plugins/my-plugin/server/plugin.ts - * - * export class MyPlugin implements Plugin { - * constructor(private readonly initContext: PluginInitializerContext) {} - * setup(core) { - * const config = this.initContext.config.get(); - * // do something with the config - * } - * } - * ``` - * - * @remarks This should only be used when synchronous access is an absolute necessity, such - * as during the plugin's setup or start lifecycle. For all other usages, - * {@link create} should be used instead. - */ - get: () => T; - }; -} - -/** - * The `plugin` export at the root of a plugin's `server` directory should conform - * to this interface. - * - * @public - */ -export type PluginInitializer< - TSetup, - TStart, - TPluginsSetup extends object = object, - TPluginsStart extends object = object -> = ( - core: PluginInitializerContext -) => - | Plugin - | PrebootPlugin - | AsyncPlugin; diff --git a/src/core/server/root/elastic_config.ts b/src/core/server/root/elastic_config.ts new file mode 100644 index 0000000000000..84b2ce394962a --- /dev/null +++ b/src/core/server/root/elastic_config.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; +import { apmConfigSchema } from '@kbn/apm-config-loader'; +import type { ServiceConfigDescriptor } from '@kbn/core-base-server-internal'; + +const elasticConfig = schema.object({ + apm: apmConfigSchema, +}); + +export type ElasticConfigType = TypeOf; + +export const elasticApmConfig: ServiceConfigDescriptor = { + path: 'elastic', + schema: elasticConfig, +}; diff --git a/src/core/server/root/index.ts b/src/core/server/root/index.ts index 2f3bcce039849..e4a129188ea6b 100644 --- a/src/core/server/root/index.ts +++ b/src/core/server/root/index.ts @@ -7,10 +7,20 @@ */ import { ConnectableObservable, Subscription } from 'rxjs'; -import { first, publishReplay, switchMap, concatMap, tap } from 'rxjs/operators'; +import { + first, + publishReplay, + switchMap, + concatMap, + tap, + distinctUntilChanged, +} from 'rxjs/operators'; import type { Logger, LoggerFactory } from '@kbn/logging'; import { Env, RawConfigurationProvider } from '@kbn/config'; import { LoggingConfigType, LoggingSystem } from '@kbn/core-logging-server-internal'; +import apm from 'elastic-apm-node'; +import { isEqual } from 'lodash'; +import type { ElasticConfigType } from './elastic_config'; import { Server } from '../server'; /** @@ -22,6 +32,7 @@ export class Root { private readonly loggingSystem: LoggingSystem; private readonly server: Server; private loggingConfigSubscription?: Subscription; + private apmConfigSubscription?: Subscription; constructor( rawConfigProvider: RawConfigurationProvider, @@ -37,7 +48,9 @@ export class Root { public async preboot() { try { this.server.setupCoreConfig(); + this.setupApmLabelSync(); await this.setupLogging(); + this.log.debug('prebooting root'); return await this.server.preboot(); } catch (e) { @@ -85,6 +98,10 @@ export class Root { this.loggingConfigSubscription.unsubscribe(); this.loggingConfigSubscription = undefined; } + if (this.apmConfigSubscription !== undefined) { + this.apmConfigSubscription.unsubscribe(); + this.apmConfigSubscription = undefined; + } await this.loggingSystem.stop(); if (this.onShutdown !== undefined) { @@ -92,6 +109,23 @@ export class Root { } } + private setupApmLabelSync() { + const { configService } = this.server; + + // Update APM labels on config change + this.apmConfigSubscription = configService + .getConfig$() + .pipe( + switchMap(() => configService.atPath('elastic')), + distinctUntilChanged(isEqual), + tap((elasticConfig) => { + const labels = elasticConfig.apm?.globalLabels || {}; + apm.addLabels(labels); + }) + ) + .subscribe(); + } + private async setupLogging() { const { configService } = this.server; // Stream that maps config updates to logger updates, including update failures. diff --git a/src/core/server/server.test.mocks.ts b/src/core/server/server.test.mocks.ts index 3e1d5c0e3a28f..01f856f6b3a89 100644 --- a/src/core/server/server.test.mocks.ts +++ b/src/core/server/server.test.mocks.ts @@ -13,10 +13,10 @@ jest.doMock('@kbn/core-http-server-internal', () => ({ HttpService: jest.fn(() => mockHttpService), })); -import { pluginServiceMock } from './plugins/plugins_service.mock'; +import { pluginServiceMock } from '@kbn/core-plugins-server-mocks'; export const mockPluginsService = pluginServiceMock.create(); -jest.doMock('./plugins/plugins_service', () => ({ +jest.doMock('@kbn/core-plugins-server-internal', () => ({ PluginsService: jest.fn(() => mockPluginsService), })); diff --git a/src/core/server/server.ts b/src/core/server/server.ts index 0949b9ee65f8a..2b5c2ed5beb09 100644 --- a/src/core/server/server.ts +++ b/src/core/server/server.ts @@ -69,10 +69,18 @@ import type { import { RenderingService } from '@kbn/core-rendering-server-internal'; import { HttpResourcesService } from '@kbn/core-http-resources-server-internal'; -import { CoreApp } from './core_app'; -import { PluginsService, config as pluginsConfig } from './plugins'; -import { InternalCorePreboot, InternalCoreSetup, InternalCoreStart } from './internal_types'; -import { DiscoveredPlugins } from './plugins'; +import { + InternalCorePreboot, + InternalCoreSetup, + InternalCoreStart, +} from '@kbn/core-lifecycle-server-internal'; +import { + DiscoveredPlugins, + PluginsService, + config as pluginsConfig, +} from '@kbn/core-plugins-server-internal'; +import { CoreAppsService } from '@kbn/core-apps-server-internal'; +import { elasticApmConfig } from './root/elastic_config'; const coreId = Symbol('core'); const rootConfigPath = ''; @@ -110,7 +118,7 @@ export class Server { private readonly httpResources: HttpResourcesService; private readonly status: StatusService; private readonly logging: LoggingService; - private readonly coreApp: CoreApp; + private readonly coreApp: CoreAppsService; private readonly coreUsageData: CoreUsageDataService; private readonly i18n: I18nService; private readonly deprecations: DeprecationsService; @@ -153,7 +161,7 @@ export class Server { this.node = new NodeService(core); this.metrics = new MetricsService(core); this.status = new StatusService(core); - this.coreApp = new CoreApp(core); + this.coreApp = new CoreAppsService(core); this.httpResources = new HttpResourcesService(core); this.logging = new LoggingService(core); this.coreUsageData = new CoreUsageDataService(core); @@ -376,6 +384,7 @@ export class Server { elasticsearch: elasticsearchStart, pluginsInitialized: this.#pluginsInitialized, docLinks: docLinkStart, + node: await this.node.start(), }); await this.resolveSavedObjectsStartPromise!(savedObjectsStart); @@ -450,6 +459,7 @@ export class Server { cspConfig, deprecationConfig, elasticsearchConfig, + elasticApmConfig, executionContextConfig, externalUrlConfig, httpConfig, diff --git a/src/core/test_helpers/kbn_server.ts b/src/core/test_helpers/kbn_server.ts index faa45c52d84b8..64c32c47ca2a9 100644 --- a/src/core/test_helpers/kbn_server.ts +++ b/src/core/test_helpers/kbn_server.ts @@ -21,7 +21,7 @@ import { } from '@kbn/test'; import { CliArgs, Env } from '@kbn/config'; -import { InternalCoreSetup, InternalCoreStart } from '../server/internal_types'; +import type { InternalCoreSetup, InternalCoreStart } from '@kbn/core-lifecycle-server-internal'; import { Root } from '../server/root'; export type HttpMethod = 'delete' | 'get' | 'head' | 'post' | 'put' | 'patch'; diff --git a/src/dev/build/build_distributables.ts b/src/dev/build/build_distributables.ts index 40a1afa51add6..ae8953dd25bb0 100644 --- a/src/dev/build/build_distributables.ts +++ b/src/dev/build/build_distributables.ts @@ -64,10 +64,11 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions if (options.createGenericFolders) { await run(Tasks.CopySource); await run(Tasks.CopyBinScripts); - await run(Tasks.ReplaceFavicon); + await run(Tasks.CreateEmptyDirsAndFiles); await run(Tasks.CreateReadme); await run(Tasks.BuildBazelPackages); + await run(Tasks.ReplaceFavicon); if (options.buildCanvasShareableRuntime) { await run(Tasks.BuildCanvasShareableRuntime); } diff --git a/src/dev/build/tasks/copy_source_task.ts b/src/dev/build/tasks/copy_source_task.ts index 27426f25b90f8..536b59e663a3d 100644 --- a/src/dev/build/tasks/copy_source_task.ts +++ b/src/dev/build/tasks/copy_source_task.ts @@ -33,7 +33,6 @@ export const CopySource: Task = { '!src/**/mocks.{js,ts}', '!src/cli*/dev.js', '!src/plugins/telemetry/schema/**', - '!src/core/server/core_app/assets/favicons/favicon.distribution.{ico,png,svg}', '!src/setup_node_env/index.js', '!x-pack/plugins/telemetry_collection_xpack/schema/**', diff --git a/src/dev/build/tasks/index.ts b/src/dev/build/tasks/index.ts index 51d501e78e052..3fb7002061fb4 100644 --- a/src/dev/build/tasks/index.ts +++ b/src/dev/build/tasks/index.ts @@ -36,5 +36,4 @@ export * from './verify_env_task'; export * from './write_sha_sums_task'; export * from './fetch_agent_versions_list'; -// @ts-expect-error this module can't be TS because it ends up pulling x-pack into Kibana export { InstallChromium } from './install_chromium'; diff --git a/src/dev/build/tasks/replace_favicon.ts b/src/dev/build/tasks/replace_favicon.ts index 0d1602f324a2a..0c9c3afa1f96d 100644 --- a/src/dev/build/tasks/replace_favicon.ts +++ b/src/dev/build/tasks/replace_favicon.ts @@ -13,18 +13,24 @@ export const ReplaceFavicon: Task = { async run(config, log, build) { await copy( - config.resolveFromRepo('src/core/server/core_app/assets/favicons/favicon.distribution.ico'), - build.resolvePath('src/core/server/core_app/assets/favicons/favicon.ico') + config.resolveFromRepo( + 'packages/core/apps/core-apps-server-internal/assets/favicons/favicon.distribution.ico' + ), + build.resolvePath('packages/core/apps/core-apps-server-internal/assets/favicons/favicon.ico') ); await copy( - config.resolveFromRepo('src/core/server/core_app/assets/favicons/favicon.distribution.png'), - build.resolvePath('src/core/server/core_app/assets/favicons/favicon.png') + config.resolveFromRepo( + 'packages/core/apps/core-apps-server-internal/assets/favicons/favicon.distribution.png' + ), + build.resolvePath('packages/core/apps/core-apps-server-internal/assets/favicons/favicon.png') ); await copy( - config.resolveFromRepo('src/core/server/core_app/assets/favicons/favicon.distribution.svg'), - build.resolvePath('src/core/server/core_app/assets/favicons/favicon.svg') + config.resolveFromRepo( + 'packages/core/apps/core-apps-server-internal/assets/favicons/favicon.distribution.svg' + ), + build.resolvePath('packages/core/apps/core-apps-server-internal/assets/favicons/favicon.svg') ); }, }; diff --git a/src/dev/ci_setup/load_env_keys.sh b/src/dev/ci_setup/load_env_keys.sh index 5f7a6c26bab21..62d29db232eae 100644 --- a/src/dev/ci_setup/load_env_keys.sh +++ b/src/dev/ci_setup/load_env_keys.sh @@ -34,9 +34,6 @@ else PERCY_TOKEN=$(retry 5 vault read -field=value secret/kibana-issues/dev/percy) export PERCY_TOKEN - KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key) - export KIBANA_BUILDBUDDY_CI_API_KEY - # remove vault related secrets unset VAULT_ROLE_ID VAULT_SECRET_ID VAULT_TOKEN VAULT_ADDR fi diff --git a/src/dev/ci_setup/setup.sh b/src/dev/ci_setup/setup.sh index 18f11fa7f16e4..aeb0ba75a9052 100755 --- a/src/dev/ci_setup/setup.sh +++ b/src/dev/ci_setup/setup.sh @@ -16,15 +16,6 @@ echo " -- TEST_ES_SNAPSHOT_VERSION='$TEST_ES_SNAPSHOT_VERSION'" echo " -- installing node.js dependencies" yarn kbn bootstrap --verbose -### -### upload ts-refs-cache artifacts as quickly as possible so they are available for download -### -if [[ "$BUILD_TS_REFS_CACHE_CAPTURE" == "true" ]]; then - cd "$KIBANA_DIR/target/ts_refs_cache" - gsutil cp "*.zip" 'gs://kibana-ci-ts-refs-cache/' - cd "$KIBANA_DIR" -fi - ### ### Download es snapshots ### diff --git a/src/dev/ci_setup/setup_env.sh b/src/dev/ci_setup/setup_env.sh index 4bbc7235e5cb5..146878464feed 100644 --- a/src/dev/ci_setup/setup_env.sh +++ b/src/dev/ci_setup/setup_env.sh @@ -148,20 +148,6 @@ if [[ "$ghprbPullId" && "$ghprbGhRepository" == 'elastic/kibana' ]] ; then export CHECKS_REPORTER_ACTIVE=true fi -### -### Implements github-checks-reporter kill switch when scripts are called from the command line -### $@ - all arguments -### -function checks-reporter-with-killswitch() { - if [ "$CHECKS_REPORTER_ACTIVE" == "true" ] ; then - yarn run github-checks-reporter "$@" - else - arguments=("$@"); - "${arguments[@]:1}"; - fi -} - -export -f checks-reporter-with-killswitch source "$KIBANA_DIR/src/dev/ci_setup/load_env_keys.sh" diff --git a/src/dev/file.ts b/src/dev/file.ts index 16d64d8c0c218..f1560956aef5e 100644 --- a/src/dev/file.ts +++ b/src/dev/file.ts @@ -9,7 +9,7 @@ import { dirname, extname, join, relative, resolve, sep, basename } from 'path'; export class File { - private path: string; + public readonly path: string; private relativePath: string; private ext: string; diff --git a/src/dev/i18n/config.ts b/src/dev/i18n/config.ts index 6953d163885d7..f03db42ce916e 100644 --- a/src/dev/i18n/config.ts +++ b/src/dev/i18n/config.ts @@ -19,7 +19,7 @@ export interface I18nConfig { } export async function checkConfigNamespacePrefix(configPath: string) { - const { prefix, paths } = JSON.parse(await readFileAsync(resolve(configPath))); + const { prefix, paths } = JSON.parse(await readFileAsync(resolve(configPath), 'utf8')); for (const [namespace] of Object.entries(paths)) { if (prefix && prefix !== namespace.split('.')[0]) { throw new Error(`namespace ${namespace} must be prefixed with ${prefix} in ${configPath}`); @@ -35,7 +35,7 @@ export async function assignConfigFromPath( paths: {}, exclude: [], translations: [], - ...JSON.parse(await readFileAsync(resolve(configPath))), + ...JSON.parse(await readFileAsync(resolve(configPath), 'utf8')), }; for (const [namespace, namespacePaths] of Object.entries(additionalConfig.paths)) { diff --git a/src/dev/i18n/extract_default_translations.js b/src/dev/i18n/extract_default_translations.js index c52e14ca222d1..54f251c0c096f 100644 --- a/src/dev/i18n/extract_default_translations.js +++ b/src/dev/i18n/extract_default_translations.js @@ -70,45 +70,38 @@ export async function matchEntriesWithExctractors(inputPath, options = {}) { absolute, }); - const codeEntries = entries.reduce((paths, entry) => { - const resolvedPath = path.resolve(inputPath, entry); - paths.push(resolvedPath); - - return paths; - }, []); - - return [[codeEntries, extractCodeMessages]]; + return { + entries: entries.map((entry) => path.resolve(inputPath, entry)), + extractFunction: extractCodeMessages, + }; } export async function extractMessagesFromPathToMap(inputPath, targetMap, config, reporter) { - const categorizedEntries = await matchEntriesWithExctractors(inputPath); - return Promise.all( - categorizedEntries.map(async ([entries, extractFunction]) => { - const files = await Promise.all( - filterEntries(entries, config.exclude).map(async (entry) => { - return { - name: entry, - content: await readFileAsync(entry), - }; - }) - ); - - for (const { name, content } of files) { - const reporterWithContext = reporter.withContext({ name }); - - try { - for (const [id, value] of extractFunction(content, reporterWithContext)) { - validateMessageNamespace(id, name, config.paths, reporterWithContext); - addMessageToMap(targetMap, id, value, reporterWithContext); - } - } catch (error) { - if (!isFailError(error)) { - throw error; - } - - reporterWithContext.report(error); - } - } + const { entries, extractFunction } = await matchEntriesWithExctractors(inputPath); + + const files = await Promise.all( + filterEntries(entries, config.exclude).map(async (entry) => { + return { + name: entry, + content: await readFileAsync(entry), + }; }) ); + + for (const { name, content } of files) { + const reporterWithContext = reporter.withContext({ name }); + + try { + for (const [id, value] of extractFunction(content, reporterWithContext)) { + validateMessageNamespace(id, name, config.paths, reporterWithContext); + addMessageToMap(targetMap, id, value, reporterWithContext); + } + } catch (error) { + if (!isFailError(error)) { + throw error; + } + + reporterWithContext.report(error); + } + } } diff --git a/src/dev/i18n/tasks/extract_untracked_translations.ts b/src/dev/i18n/tasks/extract_untracked_translations.ts index 2ef27d581ab70..e2ea89661d519 100644 --- a/src/dev/i18n/tasks/extract_untracked_translations.ts +++ b/src/dev/i18n/tasks/extract_untracked_translations.ts @@ -7,13 +7,9 @@ */ import { createFailError } from '@kbn/dev-cli-errors'; -import { - I18nConfig, - matchEntriesWithExctractors, - normalizePath, - readFileAsync, - ErrorReporter, -} from '..'; +import { matchEntriesWithExctractors } from '../extract_default_translations'; +import { I18nConfig } from '../config'; +import { normalizePath, readFileAsync, ErrorReporter } from '../utils'; function filterEntries(entries: string[], exclude: string[]) { return entries.filter((entry: string) => @@ -45,35 +41,33 @@ export async function extractUntrackedMessagesTask({ '**/dist/**', ]); for (const inputPath of inputPaths) { - const categorizedEntries = await matchEntriesWithExctractors(inputPath, { + const { entries, extractFunction } = await matchEntriesWithExctractors(inputPath, { additionalIgnore: ignore, mark: true, absolute: true, }); - for (const [entries, extractFunction] of categorizedEntries) { - const files = await Promise.all( - filterEntries(entries, config.exclude) - .filter((entry) => { - const normalizedEntry = normalizePath(entry); - return !availablePaths.some( - (availablePath) => - normalizedEntry.startsWith(`${normalizePath(availablePath)}/`) || - normalizePath(availablePath) === normalizedEntry - ); - }) - .map(async (entry: any) => ({ - name: entry, - content: await readFileAsync(entry), - })) - ); + const files = await Promise.all( + filterEntries(entries, config.exclude) + .filter((entry) => { + const normalizedEntry = normalizePath(entry); + return !availablePaths.some( + (availablePath) => + normalizedEntry.startsWith(`${normalizePath(availablePath)}/`) || + normalizePath(availablePath) === normalizedEntry + ); + }) + .map(async (entry: any) => ({ + name: entry, + content: await readFileAsync(entry), + })) + ); - for (const { name, content } of files) { - const reporterWithContext = reporter.withContext({ name }); - for (const [id] of extractFunction(content, reporterWithContext)) { - const errorMessage = `Untracked file contains i18n label (${id}).`; - reporterWithContext.report(createFailError(errorMessage)); - } + for (const { name, content } of files) { + const reporterWithContext = reporter.withContext({ name }); + for (const [id] of extractFunction(content, reporterWithContext)) { + const errorMessage = `Untracked file contains i18n label (${id}).`; + reporterWithContext.report(createFailError(errorMessage)); } } } diff --git a/src/dev/i18n/utils/index.ts b/src/dev/i18n/utils/index.ts index f350999ba47cf..d5fd98c6baed4 100644 --- a/src/dev/i18n/utils/index.ts +++ b/src/dev/i18n/utils/index.ts @@ -17,7 +17,6 @@ export { difference, isPropertyWithKey, isI18nTranslateFunction, - node, formatJSString, formatHTMLString, traverseNodes, @@ -30,7 +29,7 @@ export { extractValuesKeysFromNode, arrayify, // classes - ErrorReporter, // @ts-ignore + ErrorReporter, } from './utils'; export { verifyICUMessage } from './verify_icu_message'; diff --git a/src/dev/notice/generate_build_notice_text.js b/src/dev/notice/generate_build_notice_text.js index 17f20d02b891c..6bbec86bf3c24 100644 --- a/src/dev/notice/generate_build_notice_text.js +++ b/src/dev/notice/generate_build_notice_text.js @@ -19,7 +19,6 @@ import { generateNodeNoticeText } from './generate_node_notice_text'; * getInstalledPackages() in ../packages * @property {string} options.nodeDir The directory containing the version of node.js * that will ship with Kibana - * @return {undefined} */ export async function generateBuildNoticeText(options = {}) { const { packages, nodeDir, nodeVersion, noticeFromSource } = options; diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index f79c53e115149..2cfa9b0299c3f 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -31,7 +31,7 @@ export const IGNORE_FILE_GLOBS = [ '**/.*', '**/__mocks__/**/*', 'x-pack/docs/**/*', - 'src/core/server/core_app/assets/fonts/**/*', + 'packages/core/apps/core-apps-server-internal/assets/fonts/**/*', 'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/**/*', 'packages/kbn-utility-types/test-d/**/*', '**/Jenkinsfile*', diff --git a/src/dev/run_check_file_casing.ts b/src/dev/run_check_file_casing.ts index 9cc28ec8de91c..3dff1c1731098 100644 --- a/src/dev/run_check_file_casing.ts +++ b/src/dev/run_check_file_casing.ts @@ -11,7 +11,6 @@ import globby from 'globby'; import { REPO_ROOT } from '@kbn/utils'; import { run } from '@kbn/dev-cli-runner'; import { File } from './file'; -// @ts-expect-error precommit hooks aren't migrated to TypeScript yet. import { checkFileCasing } from './precommit_hook/check_file_casing'; run(async ({ log }) => { diff --git a/src/dev/run_i18n_check.ts b/src/dev/run_i18n_check.ts index 220eef24f3808..2d04e7c9ca3a5 100644 --- a/src/dev/run_i18n_check.ts +++ b/src/dev/run_i18n_check.ts @@ -132,7 +132,7 @@ run( reportTime(runStartTime, 'total', { success: true, }); - } catch (error: Error | ErrorReporter) { + } catch (error) { process.exitCode = 1; if (error instanceof ErrorReporter) { error.errors.forEach((e: string | Error) => log.error(e)); diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 85999d75b8997..7ad2c16224d62 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -33,7 +33,7 @@ export const storybookAliases = { expression_reveal_image: 'src/plugins/expression_reveal_image/.storybook', expression_shape: 'src/plugins/expression_shape/.storybook', expression_tagcloud: 'src/plugins/chart_expressions/expression_tagcloud/.storybook', - files: 'x-pack/plugins/files/.storybook', + files: 'src/plugins/files/.storybook', fleet: 'x-pack/plugins/fleet/.storybook', home: 'src/plugins/home/.storybook', infra: 'x-pack/plugins/infra/.storybook', diff --git a/src/dev/tsconfig.json b/src/dev/tsconfig.json new file mode 100644 index 0000000000000..5976c86154dad --- /dev/null +++ b/src/dev/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "**/*.js", + "**/*.ts", + ], + "exclude": [ + "target/types/**/*" + ], + "kbn_references": [ + { "path": "../core/tsconfig.json" }, + { "path": "../../tsconfig.json" }, + { "path": "../../x-pack/plugins/screenshotting/tsconfig.json" }, + ] +} diff --git a/src/dev/typescript/build_ts_refs.ts b/src/dev/typescript/build_ts_refs.ts deleted file mode 100644 index b01251e99b27b..0000000000000 --- a/src/dev/typescript/build_ts_refs.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; - -import { ProcRunner } from '@kbn/dev-proc-runner'; -import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; - -import { ROOT_REFS_CONFIG_PATH } from './root_refs_config'; -import { Project } from './project'; - -export async function buildTsRefs({ - log, - procRunner, - verbose, - project, -}: { - log: ToolingLog; - procRunner: ProcRunner; - verbose?: boolean; - project?: Project; -}): Promise<{ failed: boolean }> { - const relative = Path.relative(REPO_ROOT, project ? project.tsConfigPath : ROOT_REFS_CONFIG_PATH); - log.info(`Building TypeScript projects refs for ${relative}...`); - - try { - await procRunner.run('tsc', { - cmd: Path.relative(REPO_ROOT, require.resolve('typescript/bin/tsc')), - args: ['-b', relative, '--pretty', ...(verbose ? ['--verbose'] : [])], - cwd: REPO_ROOT, - wait: true, - }); - return { failed: false }; - } catch (error) { - return { failed: true }; - } -} diff --git a/src/dev/typescript/build_ts_refs_cli.ts b/src/dev/typescript/build_ts_refs_cli.ts deleted file mode 100644 index 22b616faf6fb4..0000000000000 --- a/src/dev/typescript/build_ts_refs_cli.ts +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; - -import { run } from '@kbn/dev-cli-runner'; -import { createFlagError } from '@kbn/dev-cli-errors'; -import { REPO_ROOT } from '@kbn/utils'; -import del from 'del'; - -import { RefOutputCache } from './ref_output_cache'; -import { buildTsRefs } from './build_ts_refs'; -import { updateRootRefsConfig, ROOT_REFS_CONFIG_PATH } from './root_refs_config'; -import { Project } from './project'; -import { PROJECT_CACHE } from './projects'; -import { concurrentMap } from './concurrent_map'; - -const CACHE_WORKING_DIR = Path.resolve(REPO_ROOT, 'data/ts_refs_output_cache'); - -const TS_ERROR_REF = /\sTS\d{1,6}:\s/; - -const isTypeFailure = (error: any) => - error.exitCode > 0 && - error.stderr === '' && - typeof error.stdout === 'string' && - TS_ERROR_REF.test(error.stdout); - -export async function runBuildRefsCli() { - run( - async ({ log, flags, procRunner, statsMeta }) => { - const enabled = process.env.BUILD_TS_REFS_DISABLE !== 'true' || !!flags.force; - statsMeta.set('buildTsRefsEnabled', enabled); - - if (!enabled) { - log.info( - 'Building ts refs is disabled because the BUILD_TS_REFS_DISABLE environment variable is set to "true". Pass `--force` to run the build anyway.' - ); - return; - } - - const projectFilter = flags.project; - if (projectFilter && typeof projectFilter !== 'string') { - throw createFlagError('expected --project to be a string'); - } - - // if the tsconfig.refs.json file is not self-managed then make sure it has - // a reference to every composite project in the repo - await updateRootRefsConfig(log); - - const rootProject = Project.load( - projectFilter ? projectFilter : ROOT_REFS_CONFIG_PATH, - {}, - { - skipConfigValidation: true, - } - ); - // load all the projects referenced from the root project deeply, so we know all - // the ts projects we are going to be cleaning or populating with caches - const projects = rootProject.getProjectsDeep(PROJECT_CACHE); - - const cacheEnabled = process.env.BUILD_TS_REFS_CACHE_ENABLE !== 'false' && !!flags.cache; - const doCapture = process.env.BUILD_TS_REFS_CACHE_CAPTURE === 'true'; - const doClean = !!flags.clean || doCapture; - const doInitCache = cacheEnabled && !doCapture; - - if (doCapture && projectFilter) { - throw createFlagError('--project can not be combined with cache capture'); - } - - statsMeta.set('buildTsRefsEnabled', enabled); - statsMeta.set('buildTsRefsCacheEnabled', cacheEnabled); - statsMeta.set('buildTsRefsDoCapture', doCapture); - statsMeta.set('buildTsRefsDoClean', doClean); - statsMeta.set('buildTsRefsDoInitCache', doInitCache); - - if (doClean) { - log.info('deleting', projects.outDirs.length, 'ts output directories'); - await concurrentMap(100, projects.outDirs, (outDir) => del(outDir)); - } - - let outputCache; - if (cacheEnabled) { - outputCache = await RefOutputCache.create({ - log, - projects, - repoRoot: REPO_ROOT, - workingDir: CACHE_WORKING_DIR, - upstreamUrl: 'https://github.com/elastic/kibana.git', - }); - } - - if (outputCache && doInitCache) { - await outputCache.initCaches(); - } - - try { - await buildTsRefs({ - log, - procRunner, - verbose: !!flags.verbose, - project: rootProject, - }); - log.success('ts refs build successfully'); - } catch (error) { - const typeFailure = isTypeFailure(error); - - if (flags['ignore-type-failures'] && typeFailure) { - log.warning( - 'tsc reported type errors but we are ignoring them for now, to see them please run `node scripts/type_check` or `node scripts/build_ts_refs` without the `--ignore-type-failures` flag.' - ); - } else { - throw error; - } - } - - if (outputCache && doCapture) { - await outputCache.captureCache(Path.resolve(REPO_ROOT, 'target/ts_refs_cache')); - } - - if (outputCache) { - await outputCache.cleanup(); - } - }, - { - description: 'Build TypeScript project references', - flags: { - boolean: ['clean', 'force', 'cache', 'ignore-type-failures'], - string: ['project'], - default: { - cache: true, - }, - help: ` - --project Only build the TS Refs for a specific project - --force Run the build even if the BUILD_TS_REFS_DISABLE is set to "true" - --clean Delete outDirs for each ts project before building - --no-cache Disable fetching/extracting outDir caches based on the mergeBase with upstream - --ignore-type-failures If tsc reports type errors, ignore them and just log a small warning - `, - }, - } - ); -} diff --git a/src/dev/typescript/concurrent_map.ts b/src/dev/typescript/concurrent_map.ts deleted file mode 100644 index ad7231687faad..0000000000000 --- a/src/dev/typescript/concurrent_map.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import * as Rx from 'rxjs'; -import { mergeMap, toArray, map } from 'rxjs/operators'; - -export async function concurrentMap( - concurrency: number, - arr: T[], - fn: (item: T, i: number) => Promise -): Promise { - if (!arr.length) { - return []; - } - - return await Rx.lastValueFrom( - Rx.from(arr).pipe( - // execute items in parallel based on concurrency - mergeMap(async (item, index) => ({ index, result: await fn(item, index) }), concurrency), - // collect the results into an array - toArray(), - // sort items back into order and return array of just results - map((list) => list.sort((a, b) => a.index - b.index).map(({ result }) => result)) - ) - ); -} diff --git a/src/dev/typescript/convert_all_to_composite.ts b/src/dev/typescript/convert_all_to_composite.ts deleted file mode 100644 index f3c2bcdd0b535..0000000000000 --- a/src/dev/typescript/convert_all_to_composite.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { run } from '@kbn/dev-cli-runner'; - -import { PROJECTS } from './projects'; - -run(async ({ log }) => { - for (const project of PROJECTS) { - if (!project.config.compilerOptions?.composite) { - log.info(project.tsConfigPath); - } - } -}); diff --git a/src/dev/typescript/get_ts_project_for_absolute_path.ts b/src/dev/typescript/get_ts_project_for_absolute_path.ts deleted file mode 100644 index 1d64a71a1d5d6..0000000000000 --- a/src/dev/typescript/get_ts_project_for_absolute_path.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { relative, resolve } from 'path'; -import { REPO_ROOT } from '@kbn/utils'; -import { File } from '../file'; -import { Project } from './project'; -import { PROJECTS } from './projects'; - -/** - * Finds the `tsconfig.json` Project object for a specific path by looking through - * Project instances defined in `src/dev/typescript/projects.ts`. If there isn't exactly one project - * that includes the path an error is thrown with, hopefully, a helpful error - * message that aims to help developers know how to fix the situation and ensure - * that each TypeScript file maps to only a single `tsconfig.json` file. - * - * @param path Absolute path to a .ts file - */ -export function getTsProjectForAbsolutePath(path: string): Project { - const relPath = relative(REPO_ROOT, path); - const file = new File(resolve(REPO_ROOT, path)); - const projects = PROJECTS.filter((p) => p.isAbsolutePathSelected(path)); - - if (!projects.length) { - throw new Error( - `Unable to find tsconfig.json file selecting "${relPath}". Ensure one exists and it is listed in "src/dev/typescript/projects.ts"` - ); - } - - if (projects.length !== 1 && !file.isTypescriptAmbient()) { - const configPaths = projects.map((p) => `"${relative(REPO_ROOT, p.tsConfigPath)}"`); - - const pathsMsg = `${configPaths.slice(0, -1).join(', ')} or ${ - configPaths[configPaths.length - 1] - }`; - - throw new Error( - `"${relPath}" is selected by multiple tsconfig.json files. This probably means the includes/excludes in ${pathsMsg} are too broad and include the code from multiple projects.` - ); - } - - return projects[0]; -} diff --git a/src/dev/typescript/index.ts b/src/dev/typescript/index.ts index d9ccc3975b4eb..c390ecc60f018 100644 --- a/src/dev/typescript/index.ts +++ b/src/dev/typescript/index.ts @@ -7,6 +7,4 @@ */ export { Project } from './project'; -export { getTsProjectForAbsolutePath } from './get_ts_project_for_absolute_path'; export { runTypeCheckCli } from './run_type_check_cli'; -export * from './build_ts_refs_cli'; diff --git a/src/dev/typescript/project.ts b/src/dev/typescript/project.ts index baeaf39ec288d..32245e26c69ec 100644 --- a/src/dev/typescript/project.ts +++ b/src/dev/typescript/project.ts @@ -12,7 +12,6 @@ import { IMinimatch, Minimatch } from 'minimatch'; import { REPO_ROOT } from '@kbn/utils'; import { parseTsConfig } from './ts_configfile'; -import { ProjectSet } from './project_set'; function makeMatchers(directory: string, patterns: string[]) { return patterns.map( @@ -109,6 +108,8 @@ export class Project { return project; } + public readonly typeCheckConfigPath: string; + constructor( public readonly tsConfigPath: string, public readonly directory: string, @@ -121,7 +122,9 @@ export class Project { private readonly includePatterns?: string[], private readonly exclude?: IMinimatch[], private readonly excludePatterns?: string[] - ) {} + ) { + this.typeCheckConfigPath = Path.resolve(this.directory, 'tsconfig.type_check.json'); + } public getIncludePatterns(): string[] { return this.includePatterns @@ -146,11 +149,6 @@ export class Project { return testMatchers(this.getExclude(), path) ? false : testMatchers(this.getInclude(), path); } - public isCompositeProject(): boolean { - const own = this.config.compilerOptions?.composite; - return !!(own === undefined ? this.baseProject?.isCompositeProject() : own); - } - public getOutDir(): string | undefined { if (this.config.compilerOptions?.outDir) { return Path.resolve(this.directory, this.config.compilerOptions.outDir); @@ -171,21 +169,6 @@ export class Project { return this.baseProject ? this.baseProject.getRefdPaths() : []; } - public getProjectsDeep(cache?: Map) { - const projects = new Set(); - const queue = new Set([this.tsConfigPath]); - - for (const path of queue) { - const project = Project.load(path, {}, { skipConfigValidation: true, cache }); - projects.add(project); - for (const refPath of project.getRefdPaths()) { - queue.add(refPath); - } - } - - return new ProjectSet(projects); - } - public getConfigPaths(): string[] { return this.baseProject ? [this.tsConfigPath, ...this.baseProject.getConfigPaths()] diff --git a/src/dev/typescript/project_set.ts b/src/dev/typescript/project_set.ts deleted file mode 100644 index 4ef3693cf6d02..0000000000000 --- a/src/dev/typescript/project_set.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Project } from './project'; - -export class ProjectSet { - public readonly outDirs: string[]; - private readonly projects: Project[]; - - constructor(projects: Iterable) { - this.projects = [...projects]; - this.outDirs = this.projects - .map((p) => p.getOutDir()) - .filter((p): p is string => typeof p === 'string'); - } - - filterByPaths(paths: string[]) { - return new ProjectSet( - this.projects.filter((p) => - paths.some((f) => p.isAbsolutePathSelected(f) || p.getConfigPaths().includes(f)) - ) - ); - } -} diff --git a/src/dev/typescript/projects.ts b/src/dev/typescript/projects.ts index f57854b83550d..7afb1e4649cb9 100644 --- a/src/dev/typescript/projects.ts +++ b/src/dev/typescript/projects.ts @@ -31,8 +31,13 @@ export const PROJECTS = [ createProject('test/tsconfig.json', { name: 'kibana/test' }), createProject('x-pack/test/tsconfig.json', { name: 'x-pack/test' }), createProject('x-pack/performance/tsconfig.json', { name: 'x-pack/performance' }), - createProject('src/core/tsconfig.json'), - createProject('.buildkite/tsconfig.json'), + ...findProjects(['src/*/tsconfig.json']), + createProject('.buildkite/tsconfig.json', { + // this directory has additionally dependencies which scripts/type_check can't guarantee + // are present or up-to-date, and users likely won't know how to manage either, so the + // type check is explicitly disabled in this project for now + disableTypeCheck: true, + }), createProject('kbn_pm/tsconfig.json'), createProject('x-pack/plugins/drilldowns/url_drilldown/tsconfig.json', { @@ -89,14 +94,15 @@ export const PROJECTS = [ 'src/plugins/*/tsconfig.json', 'src/plugins/chart_expressions/*/tsconfig.json', 'src/plugins/vis_types/*/tsconfig.json', - 'x-pack/plugins/*/tsconfig.json', - 'x-pack/plugins/cloud_integrations/*/tsconfig.json', 'examples/*/tsconfig.json', - 'x-pack/examples/*/tsconfig.json', + 'test/*/plugins/*/tsconfig.json', 'test/analytics/fixtures/plugins/*/tsconfig.json', - 'test/plugin_functional/plugins/*/tsconfig.json', - 'test/interpreter_functional/plugins/*/tsconfig.json', 'test/server_integration/__fixtures__/plugins/*/tsconfig.json', + 'test/interactive_setup_api_integration/fixtures/*/tsconfig.json', + 'x-pack/plugins/*/tsconfig.json', + 'x-pack/plugins/cloud_integrations/*/tsconfig.json', + 'x-pack/examples/*/tsconfig.json', + 'x-pack/test/*/plugins/*/tsconfig.json', ...BAZEL_PACKAGE_DIRS.map((dir) => `${dir}/*/tsconfig.json`), ]), ]; diff --git a/src/dev/typescript/ref_output_cache/README.md b/src/dev/typescript/ref_output_cache/README.md deleted file mode 100644 index 41506a118dcb9..0000000000000 --- a/src/dev/typescript/ref_output_cache/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# `node scripts/build_ts_refs` output cache - -This module implements the logic for caching the output of building the ts refs and extracting those caches into the source repo to speed up the execution of this script. We've implemented this as a stop-gap solution while we migrate to Bazel which will handle caching the types produced by the -scripts independently and speed things up incredibly, but in the meantime we need something to fix the 10 minute bootstrap times we're seeing. - -How it works: - - 1. traverse the TS projects referenced from `tsconfig.refs.json` and collect their `compilerOptions.outDir` setting. - 2. determine the `upstreamBranch` by reading the `branch` property out of `package.json` - 3. fetch the latest changes from `https://github.com/elastic/kibana.git` for that branch - 4. determine the merge base between `HEAD` and the latest ref from the `upstreamBranch` - 5. check in the `data/ts_refs_output_cache/archives` dir (where we keep the 10 most recent downloads) and at `https://ts-refs-cache.kibana.dev/{sha}.zip` for the cache of the merge base commit, and up to 5 commits before that in the log, stopping once we find one that is available locally or was downloaded. - 6. check for the `.ts-ref-cache-merge-base` file in each `outDir`, which records the `mergeBase` that was used to initialize that `outDir`, if the file exists and matches the `sha` that we plan to use for our cache then exclude that `outDir` from getting initialized with the cache data - 7. for each `outDir` that either hasn't been initialized with cache data or was initialized with cache data from another merge base, delete the `outDir` and replace it with the copy stored in the downloaded cache - 1. if there isn't a cached version of that `outDir` replace it with an empty directory - 8. write the current `mergeBase` to the `.ts-ref-cache-merge-base` file in each `outDir` - 9. run `tsc`, which will only build things which have changed since the cache was created \ No newline at end of file diff --git a/src/dev/typescript/ref_output_cache/archives.ts b/src/dev/typescript/ref_output_cache/archives.ts deleted file mode 100644 index 882315b919031..0000000000000 --- a/src/dev/typescript/ref_output_cache/archives.ts +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Fs from 'fs/promises'; -import { createWriteStream } from 'fs'; -import Path from 'path'; -import { promisify } from 'util'; -import { pipeline } from 'stream'; - -import { ToolingLog } from '@kbn/tooling-log'; -import Axios from 'axios'; -import del from 'del'; - -// https://github.com/axios/axios/tree/ffea03453f77a8176c51554d5f6c3c6829294649/lib/adapters -// @ts-expect-error untyped internal module used to prevent axios from using xhr adapter in tests -import AxiosHttpAdapter from 'axios/lib/adapters/http'; - -interface Archive { - sha: string; - path: string; - time: number; -} - -const asyncPipeline = promisify(pipeline); - -async function getCacheNames(cacheDir: string) { - try { - return await Fs.readdir(cacheDir); - } catch (error) { - if (error.code === 'ENOENT') { - return []; - } - - throw error; - } -} - -export class Archives { - static async create(log: ToolingLog, workingDir: string) { - const dir = Path.resolve(workingDir, 'archives'); - const bySha = new Map(); - - for (const name of await getCacheNames(dir)) { - const path = Path.resolve(dir, name); - - if (!name.endsWith('.zip')) { - log.debug('deleting unexpected file in archives dir', path); - await Fs.unlink(path); - continue; - } - - const sha = name.replace('.zip', ''); - log.verbose('identified archive for', sha); - const s = await Fs.stat(path); - const time = Math.max(s.atimeMs, s.mtimeMs); - bySha.set(sha, { - path, - time, - sha, - }); - } - - return new Archives(log, workingDir, bySha); - } - - protected constructor( - private readonly log: ToolingLog, - private readonly workDir: string, - private readonly bySha: Map - ) {} - - size() { - return this.bySha.size; - } - - get(sha: string) { - return this.bySha.get(sha); - } - - async delete(sha: string) { - const archive = this.get(sha); - if (archive) { - await Fs.unlink(archive.path); - this.bySha.delete(sha); - } - } - - *[Symbol.iterator]() { - yield* this.bySha.values(); - } - - /** - * Attempt to download the cache for a given sha, adding it to this.bySha - * and returning true if successful, logging and returning false otherwise. - * - * @param sha the commit sha we should try to download the cache for - */ - async attemptToDownload(sha: string) { - if (this.bySha.has(sha)) { - return true; - } - - const url = `https://ts-refs-cache.kibana.dev/${sha}.zip`; - this.log.debug('attempting to download cache for', sha, 'from', url); - - const filename = `${sha}.zip`; - const target = Path.resolve(this.workDir, 'archives', `${filename}`); - const tmpTarget = `${target}.tmp`; - - try { - const resp = await Axios.request({ - url, - responseType: 'stream', - adapter: AxiosHttpAdapter, - }); - - await Fs.mkdir(Path.dirname(target), { recursive: true }); - await asyncPipeline(resp.data, createWriteStream(tmpTarget)); - this.log.debug('download complete, renaming tmp'); - - await Fs.rename(tmpTarget, target); - this.bySha.set(sha, { - sha, - path: target, - time: Date.now(), - }); - - this.log.debug('download of cache for', sha, 'complete'); - return true; - } catch (error) { - await del(tmpTarget, { force: true }); - - if (!error.response) { - this.log.debug(`failed to download cache, ignoring error:`, error.message); - return false; - } - - if (error.response.status === 404) { - return false; - } - - this.log.debug(`failed to download cache,`, error.response.status, 'response'); - } - } - - /** - * Iterate through a list of shas, which represent commits - * on our upstreamBranch, and look for caches which are - * already downloaded, or try to download them. If the cache - * for that commit is not available for any reason the next - * sha will be tried. - * - * If we reach the end of the list without any caches being - * available undefined is returned. - * - * @param shas shas for commits to try and find caches for - */ - async getFirstAvailable(shas: string[]): Promise { - if (!shas.length) { - throw new Error('no possible shas to pick archive from'); - } - - for (const sha of shas) { - let archive = this.bySha.get(sha); - - // if we don't have one locally try to download one - if (!archive && (await this.attemptToDownload(sha))) { - archive = this.bySha.get(sha); - } - - // if we found the archive return it - if (archive) { - return archive; - } - - this.log.debug('no archive available for', sha); - } - - return undefined; - } -} diff --git a/src/dev/typescript/ref_output_cache/index.ts b/src/dev/typescript/ref_output_cache/index.ts deleted file mode 100644 index 8d55a31a1771c..0000000000000 --- a/src/dev/typescript/ref_output_cache/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export * from './ref_output_cache'; diff --git a/src/dev/typescript/ref_output_cache/integration_tests/__fixtures__/archives/1234.zip b/src/dev/typescript/ref_output_cache/integration_tests/__fixtures__/archives/1234.zip deleted file mode 100644 index 07c14c13488b5..0000000000000 Binary files a/src/dev/typescript/ref_output_cache/integration_tests/__fixtures__/archives/1234.zip and /dev/null differ diff --git a/src/dev/typescript/ref_output_cache/integration_tests/__fixtures__/archives/5678.zip b/src/dev/typescript/ref_output_cache/integration_tests/__fixtures__/archives/5678.zip deleted file mode 100644 index 9a30ffff55e0d..0000000000000 Binary files a/src/dev/typescript/ref_output_cache/integration_tests/__fixtures__/archives/5678.zip and /dev/null differ diff --git a/src/dev/typescript/ref_output_cache/integration_tests/archives.test.ts b/src/dev/typescript/ref_output_cache/integration_tests/archives.test.ts deleted file mode 100644 index b7dc6d28b78ee..0000000000000 --- a/src/dev/typescript/ref_output_cache/integration_tests/archives.test.ts +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Fs from 'fs'; -import { Readable } from 'stream'; - -import del from 'del'; -import cpy from 'cpy'; -import { ToolingLog, ToolingLogCollectingWriter } from '@kbn/tooling-log'; -import { - createAbsolutePathSerializer, - createRecursiveSerializer, - createStripAnsiSerializer, -} from '@kbn/jest-serializers'; - -expect.addSnapshotSerializer(createAbsolutePathSerializer()); -expect.addSnapshotSerializer(createStripAnsiSerializer()); -expect.addSnapshotSerializer( - createRecursiveSerializer( - (v) => typeof v === 'object' && v && typeof v.time === 'number', - (v) => ({ ...v, time: '' }) - ) -); - -jest.mock('axios', () => { - return { - request: jest.fn(), - }; -}); -const mockRequest: jest.Mock = jest.requireMock('axios').request; - -import { Archives } from '../archives'; - -const FIXTURE = Path.resolve(__dirname, '__fixtures__'); -const TMP = Path.resolve(__dirname, '__tmp__'); - -beforeAll(() => del(TMP, { force: true })); -beforeEach(() => cpy('.', TMP, { cwd: FIXTURE, parents: true })); -afterEach(async () => { - await del(TMP, { force: true }); - jest.resetAllMocks(); -}); - -const readArchiveDir = () => - Fs.readdirSync(Path.resolve(TMP, 'archives')).sort((a, b) => a.localeCompare(b)); - -const log = new ToolingLog(); -const logWriter = new ToolingLogCollectingWriter(); -log.setWriters([logWriter]); -afterEach(() => (logWriter.messages.length = 0)); - -it('deletes invalid files', async () => { - const path = Path.resolve(TMP, 'archives/foo.txt'); - Fs.writeFileSync(path, 'hello'); - const archives = await Archives.create(log, TMP); - - expect(archives.size()).toBe(2); - expect(Fs.existsSync(path)).toBe(false); -}); - -it('exposes archives by sha', async () => { - const archives = await Archives.create(log, TMP); - expect(archives.get('1234')).toMatchInlineSnapshot(` - Object { - "path": /src/dev/typescript/ref_output_cache/integration_tests/__tmp__/archives/1234.zip, - "sha": "1234", - "time": "", - } - `); - expect(archives.get('5678')).toMatchInlineSnapshot(` - Object { - "path": /src/dev/typescript/ref_output_cache/integration_tests/__tmp__/archives/5678.zip, - "sha": "5678", - "time": "", - } - `); - expect(archives.get('foo')).toMatchInlineSnapshot(`undefined`); -}); - -it('deletes archives', async () => { - const archives = await Archives.create(log, TMP); - expect(archives.size()).toBe(2); - await archives.delete('1234'); - expect(archives.size()).toBe(1); - expect(readArchiveDir()).toMatchInlineSnapshot(` - Array [ - "5678.zip", - ] - `); -}); - -it('returns false when attempting to download for sha without cache', async () => { - const archives = await Archives.create(log, TMP); - - mockRequest.mockImplementation(() => { - throw new Error('404!'); - }); - - await expect(archives.attemptToDownload('foobar')).resolves.toBe(false); -}); - -it('returns true when able to download an archive for a sha', async () => { - const archives = await Archives.create(log, TMP); - - mockRequest.mockImplementation(() => { - return { - data: Readable.from('foobar zip contents'), - }; - }); - - expect(archives.size()).toBe(2); - await expect(archives.attemptToDownload('foobar')).resolves.toBe(true); - expect(archives.size()).toBe(3); - expect(readArchiveDir()).toMatchInlineSnapshot(` - Array [ - "1234.zip", - "5678.zip", - "foobar.zip", - ] - `); - expect(Fs.readFileSync(Path.resolve(TMP, 'archives/foobar.zip'), 'utf-8')).toBe( - 'foobar zip contents' - ); -}); - -it('returns true if attempting to download a cache which is already downloaded', async () => { - const archives = await Archives.create(log, TMP); - - mockRequest.mockImplementation(() => { - throw new Error(`it shouldn't try to download anything`); - }); - - expect(archives.size()).toBe(2); - await expect(archives.attemptToDownload('1234')).resolves.toBe(true); - expect(archives.size()).toBe(2); - expect(readArchiveDir()).toMatchInlineSnapshot(` - Array [ - "1234.zip", - "5678.zip", - ] - `); -}); - -it('returns false and deletes the zip if the download fails part way', async () => { - const archives = await Archives.create(log, TMP); - - mockRequest.mockImplementation(() => { - let readCounter = 0; - return { - data: new Readable({ - read() { - readCounter++; - if (readCounter === 1) { - this.push('foo'); - } else { - this.emit('error', new Error('something went wrong')); - } - }, - }), - }; - }); - - await expect(archives.attemptToDownload('foo')).resolves.toBe(false); - expect(archives.size()).toBe(2); - expect(readArchiveDir()).toMatchInlineSnapshot(` - Array [ - "1234.zip", - "5678.zip", - ] - `); -}); - -it('resolves to first sha if it is available locally', async () => { - const archives = await Archives.create(log, TMP); - - expect(await archives.getFirstAvailable(['1234', '5678'])).toHaveProperty('sha', '1234'); - expect(await archives.getFirstAvailable(['5678', '1234'])).toHaveProperty('sha', '5678'); -}); - -it('resolves to first local sha when it tried to reach network and gets errors', async () => { - const archives = await Archives.create(log, TMP); - - mockRequest.mockImplementation(() => { - throw new Error('no network available'); - }); - - expect(await archives.getFirstAvailable(['foo', 'bar', '1234'])).toHaveProperty('sha', '1234'); - expect(mockRequest).toHaveBeenCalledTimes(2); - expect(logWriter.messages).toMatchInlineSnapshot(` - Array [ - " sill identified archive for 1234", - " sill identified archive for 5678", - " debg attempting to download cache for foo from https://ts-refs-cache.kibana.dev/foo.zip", - " debg failed to download cache, ignoring error: no network available", - " debg no archive available for foo", - " debg attempting to download cache for bar from https://ts-refs-cache.kibana.dev/bar.zip", - " debg failed to download cache, ignoring error: no network available", - " debg no archive available for bar", - ] - `); -}); - -it('resolves to first remote that downloads successfully', async () => { - const archives = await Archives.create(log, TMP); - - mockRequest.mockImplementation((params) => { - if (params.url === `https://ts-refs-cache.kibana.dev/bar.zip`) { - return { - data: Readable.from('bar cache data'), - }; - } - - throw new Error('no network available'); - }); - - const archive = await archives.getFirstAvailable(['foo', 'bar', '1234']); - expect(archive).toHaveProperty('sha', 'bar'); - expect(mockRequest).toHaveBeenCalledTimes(2); - expect(logWriter.messages).toMatchInlineSnapshot(` - Array [ - " sill identified archive for 1234", - " sill identified archive for 5678", - " debg attempting to download cache for foo from https://ts-refs-cache.kibana.dev/foo.zip", - " debg failed to download cache, ignoring error: no network available", - " debg no archive available for foo", - " debg attempting to download cache for bar from https://ts-refs-cache.kibana.dev/bar.zip", - " debg download complete, renaming tmp", - " debg download of cache for bar complete", - ] - `); - - expect(Fs.readFileSync(archive!.path, 'utf-8')).toBe('bar cache data'); -}); diff --git a/src/dev/typescript/ref_output_cache/integration_tests/ref_output_cache.test.ts b/src/dev/typescript/ref_output_cache/integration_tests/ref_output_cache.test.ts deleted file mode 100644 index a44d309cb9ddd..0000000000000 --- a/src/dev/typescript/ref_output_cache/integration_tests/ref_output_cache.test.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Fs from 'fs'; - -import del from 'del'; -import cpy from 'cpy'; -import globby from 'globby'; -import normalize from 'normalize-path'; -import { ToolingLog, ToolingLogCollectingWriter } from '@kbn/tooling-log'; -import { createAbsolutePathSerializer, createStripAnsiSerializer } from '@kbn/jest-serializers'; - -import { RefOutputCache, OUTDIR_MERGE_BASE_FILENAME } from '../ref_output_cache'; -import { Archives } from '../archives'; -import type { RepoInfo } from '../repo_info'; -import { Project } from '../../project'; -import { ProjectSet } from '../../project_set'; - -jest.mock('../repo_info'); -const { RepoInfo: MockRepoInfo } = jest.requireMock('../repo_info'); - -jest.mock('axios'); -const { request: mockRequest } = jest.requireMock('axios'); - -expect.addSnapshotSerializer(createAbsolutePathSerializer()); -expect.addSnapshotSerializer(createStripAnsiSerializer()); - -const FIXTURE = Path.resolve(__dirname, '__fixtures__'); -const TMP = Path.resolve(__dirname, '__tmp__'); -const repo: jest.Mocked = new MockRepoInfo(); -const log = new ToolingLog(); -const logWriter = new ToolingLogCollectingWriter(); -log.setWriters([logWriter]); - -beforeAll(() => del(TMP, { force: true })); -beforeEach(() => cpy('.', TMP, { cwd: FIXTURE, parents: true })); -afterEach(async () => { - await del(TMP, { force: true }); - jest.resetAllMocks(); - logWriter.messages.length = 0; -}); - -function makeMockProject(path: string) { - Fs.mkdirSync(Path.resolve(path, 'target/test-types'), { recursive: true }); - Fs.writeFileSync( - Path.resolve(path, 'tsconfig.json'), - JSON.stringify({ - compilerOptions: { - outDir: './target/test-types', - }, - include: ['**/*'], - exclude: ['test/target/**/*'], - }) - ); - - return Project.load(Path.resolve(path, 'tsconfig.json')); -} - -it('creates and extracts caches, ingoring dirs with matching merge-base file, placing merge-base files, and overriding modified time for updated inputs', async () => { - // setup repo mock - const HEAD = 'abcdefg'; - repo.getHeadSha.mockResolvedValue(HEAD); - repo.getRelative.mockImplementation((path) => Path.relative(TMP, path)); - repo.getRecentShasFrom.mockResolvedValue(['5678', '1234']); - repo.getFilesChangesSinceSha.mockResolvedValue([]); - - // create two fake outDirs - const projects = new ProjectSet([ - makeMockProject(Path.resolve(TMP, 'test1')), - makeMockProject(Path.resolve(TMP, 'test2')), - ]); - - // init an archives instance using tmp - const archives = await Archives.create(log, TMP); - - // init the RefOutputCache with our mock data - const refOutputCache = new RefOutputCache(log, repo, archives, projects, HEAD); - - // create the new cache right in the archives dir - await refOutputCache.captureCache(Path.resolve(TMP)); - const cachePath = Path.resolve(TMP, `${HEAD}.zip`); - - // check that the cache was created and stored in the archives - if (!Fs.existsSync(cachePath)) { - throw new Error('zip was not created as expected'); - } - - mockRequest.mockImplementation((params: any) => { - if (params.url.endsWith(`${HEAD}.zip`)) { - return { - data: Fs.createReadStream(cachePath), - }; - } - - throw new Error(`unexpected url: ${params.url}`); - }); - - // modify the files in the outDirs so we can see which ones are restored from the cache - for (const dir of projects.outDirs) { - Fs.writeFileSync(Path.resolve(dir, 'no-cleared.txt'), 'not cleared by cache init'); - } - - // add the mergeBase to test1 outDir so that it is not cleared - Fs.writeFileSync(Path.resolve(projects.outDirs[0], OUTDIR_MERGE_BASE_FILENAME), HEAD); - - // rebuild the outDir from the refOutputCache - await refOutputCache.initCaches(); - - // verify that "test1" outdir is untouched and that "test2" is cleared out - const files = Object.fromEntries( - globby - .sync( - projects.outDirs.map((p) => normalize(p)), - { dot: true } - ) - .map((path) => [Path.relative(TMP, path), Fs.readFileSync(path, 'utf-8')]) - ); - - expect(files).toMatchInlineSnapshot(` - Object { - "test1/target/test-types/.ts-ref-cache-merge-base": "abcdefg", - "test1/target/test-types/no-cleared.txt": "not cleared by cache init", - "test2/target/test-types/.ts-ref-cache-merge-base": "abcdefg", - } - `); - expect(logWriter.messages).toMatchInlineSnapshot(` - Array [ - " sill identified archive for 1234", - " sill identified archive for 5678", - " debg writing ts-ref cache to abcdefg.zip", - " succ wrote archive to abcdefg.zip", - " debg attempting to download cache for abcdefg from https://ts-refs-cache.kibana.dev/abcdefg.zip", - " debg download complete, renaming tmp", - " debg download of cache for abcdefg complete", - " debg extracting archives/abcdefg.zip to rebuild caches in 1 outDirs", - " debg [test2/target/test-types] clearing outDir and replacing with cache", - ] - `); -}); - -it('cleans up oldest archives when there are more than 10', async () => { - for (let i = 0; i < 100; i++) { - const time = i * 10_000; - const path = Path.resolve(TMP, `archives/${time}.zip`); - Fs.writeFileSync(path, ''); - Fs.utimesSync(path, time, time); - } - - const archives = await Archives.create(log, TMP); - const cache = new RefOutputCache(log, repo, archives, new ProjectSet([]), '1234'); - expect(cache.archives.size()).toBe(102); - await cache.cleanup(); - expect(cache.archives.size()).toBe(10); - expect(Fs.readdirSync(Path.resolve(TMP, 'archives')).sort((a, b) => a.localeCompare(b))) - .toMatchInlineSnapshot(` - Array [ - "1234.zip", - "5678.zip", - "920000.zip", - "930000.zip", - "940000.zip", - "950000.zip", - "960000.zip", - "970000.zip", - "980000.zip", - "990000.zip", - ] - `); -}); diff --git a/src/dev/typescript/ref_output_cache/ref_output_cache.ts b/src/dev/typescript/ref_output_cache/ref_output_cache.ts deleted file mode 100644 index 80d2a6052000b..0000000000000 --- a/src/dev/typescript/ref_output_cache/ref_output_cache.ts +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Fs from 'fs/promises'; - -import { extract } from '@kbn/dev-utils'; -import { ToolingLog } from '@kbn/tooling-log'; -import { kibanaPackageJson } from '@kbn/utils'; -import del from 'del'; -import tempy from 'tempy'; - -import { Archives } from './archives'; -import { zip } from './zip'; -import { concurrentMap } from '../concurrent_map'; -import { RepoInfo } from './repo_info'; -import { ProjectSet } from '../project_set'; - -export const OUTDIR_MERGE_BASE_FILENAME = '.ts-ref-cache-merge-base'; - -export async function matchMergeBase(outDir: string, sha: string) { - try { - const existing = await Fs.readFile(Path.resolve(outDir, OUTDIR_MERGE_BASE_FILENAME), 'utf8'); - return existing === sha; - } catch (error) { - if (error.code === 'ENOENT') { - return false; - } - - throw error; - } -} - -export async function isDir(path: string) { - try { - return (await Fs.stat(path)).isDirectory(); - } catch (error) { - if (error.code === 'ENOENT') { - return false; - } - - throw error; - } -} - -export class RefOutputCache { - static async create(options: { - log: ToolingLog; - workingDir: string; - projects: ProjectSet; - repoRoot: string; - upstreamUrl: string; - }) { - const repoInfo = new RepoInfo(options.log, options.repoRoot, options.upstreamUrl); - const archives = await Archives.create(options.log, options.workingDir); - - const upstreamBranch: string = kibanaPackageJson.branch; - const mergeBase = await repoInfo.getMergeBase('HEAD', upstreamBranch); - - return new RefOutputCache(options.log, repoInfo, archives, options.projects, mergeBase); - } - - constructor( - private readonly log: ToolingLog, - private readonly repo: RepoInfo, - public readonly archives: Archives, - private readonly projects: ProjectSet, - private readonly mergeBase: string - ) {} - - /** - * Find the most recent cache/archive of the outDirs and replace the outDirs - * on disk with the files in the cache if the outDir has an outdated merge-base - * written to the directory. - */ - async initCaches() { - const outdatedOutDirs = ( - await concurrentMap(100, this.projects.outDirs, async (outDir) => ({ - path: outDir, - outdated: !(await matchMergeBase(outDir, this.mergeBase)), - })) - ) - .filter((o) => o.outdated) - .map((o) => o.path); - - if (!outdatedOutDirs.length) { - this.log.debug('all outDirs have a recent cache'); - return; - } - - const archive = - this.archives.get(this.mergeBase) ?? - (await this.archives.getFirstAvailable([ - this.mergeBase, - ...(await this.repo.getRecentShasFrom(this.mergeBase, 5)), - ])); - - if (!archive) { - return; - } - - const changedFiles = await this.repo.getFilesChangesSinceSha(archive.sha); - const outDirsForcingExtraCacheCheck = this.projects.filterByPaths(changedFiles).outDirs; - - const tmpDir = tempy.directory(); - this.log.debug( - 'extracting', - this.repo.getRelative(archive.path), - 'to rebuild caches in', - outdatedOutDirs.length, - 'outDirs' - ); - await extract({ - archivePath: archive.path, - targetDir: tmpDir, - }); - - const cacheNames = await Fs.readdir(tmpDir); - const beginningOfTime = new Date(0); - - await concurrentMap(50, outdatedOutDirs, async (outDir) => { - const relative = this.repo.getRelative(outDir); - const cacheName = `${relative.split(Path.sep).join('__')}.zip`; - - if (!cacheNames.includes(cacheName)) { - this.log.debug(`[${relative}] not in cache`); - await Fs.mkdir(outDir, { recursive: true }); - await Fs.writeFile(Path.resolve(outDir, OUTDIR_MERGE_BASE_FILENAME), archive.sha); - return; - } - - if (await matchMergeBase(outDir, archive.sha)) { - this.log.debug(`[${relative}] keeping outdir, created from selected sha`); - return; - } - - const setModifiedTimes = outDirsForcingExtraCacheCheck.includes(outDir) - ? beginningOfTime - : undefined; - - if (setModifiedTimes) { - this.log.debug(`[${relative}] replacing outDir with cache (forcing revalidation)`); - } else { - this.log.debug(`[${relative}] clearing outDir and replacing with cache`); - } - - await del(outDir); - await extract({ - archivePath: Path.resolve(tmpDir, cacheName), - targetDir: outDir, - setModifiedTimes, - }); - await Fs.writeFile(Path.resolve(outDir, OUTDIR_MERGE_BASE_FILENAME), this.mergeBase); - }); - } - - /** - * Iterate through the outDirs, zip them up, and then zip up those zips - * into a single file which we can upload/download/extract just a portion - * of the archive. - * - * @param outputDir directory that the {HEAD}.zip file should be written to - */ - async captureCache(outputDir: string) { - const tmpDir = tempy.directory(); - const currentSha = await this.repo.getHeadSha(); - const outputPath = Path.resolve(outputDir, `${currentSha}.zip`); - const relativeOutputPath = this.repo.getRelative(outputPath); - - this.log.debug('writing ts-ref cache to', relativeOutputPath); - - const subZips: Array<[string, string]> = []; - - await Promise.all( - this.projects.outDirs.map(async (absolute) => { - const relative = this.repo.getRelative(absolute); - const subZipName = `${relative.split(Path.sep).join('__')}.zip`; - const subZipPath = Path.resolve(tmpDir, subZipName); - await zip([[absolute, '/']], [], subZipPath); - subZips.push([subZipPath, subZipName]); - }) - ); - - await zip([], subZips, outputPath); - await del(tmpDir, { force: true }); - this.log.success('wrote archive to', relativeOutputPath); - } - - /** - * Cleanup the downloaded cache files, keeping the 10 newest files. Each file - * is about 25-30MB, so 10 downloads is a a decent amount of disk space for - * caches but we could potentially increase this number in the future if we like - */ - async cleanup() { - // sort archives by time desc - const archives = [...this.archives].sort((a, b) => b.time - a.time); - - // delete the 11th+ archive - for (const { sha } of archives.slice(10)) { - await this.archives.delete(sha); - } - } -} diff --git a/src/dev/typescript/ref_output_cache/repo_info.ts b/src/dev/typescript/ref_output_cache/repo_info.ts deleted file mode 100644 index ab6470e5b1401..0000000000000 --- a/src/dev/typescript/ref_output_cache/repo_info.ts +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; - -import execa from 'execa'; -import { ToolingLog } from '@kbn/tooling-log'; - -export class RepoInfo { - constructor( - private readonly log: ToolingLog, - private readonly dir: string, - private readonly upstreamUrl: string - ) {} - - async getRecentShasFrom(sha: string, size: number) { - return (await this.git(['log', '--pretty=%P', `-n`, `${size}`, sha])) - .split('\n') - .map((l) => l.trim()) - .filter(Boolean); - } - - async getMergeBase(ref: string, upstreamBranch: string) { - this.log.info('ensuring we have the latest changelog from upstream', upstreamBranch); - await this.git(['fetch', this.upstreamUrl, upstreamBranch]); - - this.log.info('determining merge base with upstream'); - - const mergeBase = await this.git(['merge-base', ref, 'FETCH_HEAD']); - this.log.info('merge base with', upstreamBranch, 'is', mergeBase); - - return mergeBase; - } - - async getHeadSha() { - return await this.git(['rev-parse', 'HEAD']); - } - - getRelative(path: string) { - return Path.relative(this.dir, path); - } - - private async git(args: string[]) { - const proc = await execa('git', args, { - cwd: this.dir, - }); - - return proc.stdout.trim(); - } - - async getFilesChangesSinceSha(sha: string) { - this.log.debug('determining files changes since sha', sha); - - const proc = await execa('git', ['diff', '--name-only', sha], { - cwd: this.dir, - }); - const files = proc.stdout - .trim() - .split('\n') - .map((p) => Path.resolve(this.dir, p)); - - this.log.verbose('found the following changes compared to', sha, `\n - ${files.join('\n - ')}`); - - return files; - } -} diff --git a/src/dev/typescript/ref_output_cache/zip.ts b/src/dev/typescript/ref_output_cache/zip.ts deleted file mode 100644 index 6b0ee053367de..0000000000000 --- a/src/dev/typescript/ref_output_cache/zip.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Fs from 'fs/promises'; -import { createWriteStream } from 'fs'; -import Path from 'path'; -import { pipeline } from 'stream'; -import { promisify } from 'util'; - -import archiver from 'archiver'; - -const asyncPipeline = promisify(pipeline); - -export async function zip( - dirs: Array<[string, string]>, - files: Array<[string, string]>, - outputPath: string -) { - const archive = archiver('zip', { - zlib: { - level: 9, - }, - }); - - for (const [absolute, relative] of dirs) { - archive.directory(absolute, relative); - } - - for (const [absolute, relative] of files) { - archive.file(absolute, { - name: relative, - }); - } - - // ensure output dir exists - await Fs.mkdir(Path.dirname(outputPath), { recursive: true }); - - // await the promise from the pipeline and archive.finalize() - await Promise.all([asyncPipeline(archive, createWriteStream(outputPath)), archive.finalize()]); -} diff --git a/src/dev/typescript/root_refs_config.ts b/src/dev/typescript/root_refs_config.ts index dc06a53988ab4..ebbc1574d85c5 100644 --- a/src/dev/typescript/root_refs_config.ts +++ b/src/dev/typescript/root_refs_config.ts @@ -7,11 +7,13 @@ */ import Path from 'path'; -import Fs from 'fs/promises'; +import Fsp from 'fs/promises'; import dedent from 'dedent'; import { ToolingLog } from '@kbn/tooling-log'; import { REPO_ROOT } from '@kbn/utils'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { BazelPackage } from '@kbn/bazel-packages'; import normalize from 'normalize-path'; import { PROJECTS } from './projects'; @@ -21,7 +23,7 @@ export const REF_CONFIG_PATHS = [ROOT_REFS_CONFIG_PATH]; async function isRootRefsConfigSelfManaged() { try { - const currentRefsFile = await Fs.readFile(ROOT_REFS_CONFIG_PATH, 'utf-8'); + const currentRefsFile = await Fsp.readFile(ROOT_REFS_CONFIG_PATH, 'utf-8'); return currentRefsFile.trim().startsWith('// SELF MANAGED'); } catch (error) { if (error.code === 'ENOENT') { @@ -34,9 +36,7 @@ async function isRootRefsConfigSelfManaged() { function generateTsConfig(refs: string[]) { return dedent` - // This file is automatically updated when you run \`node scripts/build_ts_refs\`. If you start this - // file with the text "// SELF MANAGED" then you can comment out any projects that you like and only - // build types for specific projects and their dependencies + // This file is automatically updated when you run \`node scripts/build_ts_refs\`. { "include": [], "references": [ @@ -46,18 +46,28 @@ ${refs.map((p) => ` { "path": ${JSON.stringify(p)} },`).join('\n')} `; } -export async function updateRootRefsConfig(log: ToolingLog) { +export async function updateRootRefsConfig(log: ToolingLog, bazelPackages: BazelPackage[]) { if (await isRootRefsConfigSelfManaged()) { - log.warning( - 'tsconfig.refs.json starts with "// SELF MANAGED" so not updating to include all projects' + throw createFailError( + `tsconfig.refs.json starts with "// SELF MANAGED" but we removed this functinality because of some complexity it caused with TS performance upgrades and we were pretty sure that nobody was using it. Please reach out to operations to discuss options <3` ); - return; } - const refs = PROJECTS.filter((p) => p.isCompositeProject()) - .map((p) => `./${normalize(Path.relative(REPO_ROOT, p.tsConfigPath))}`) - .sort((a, b) => a.localeCompare(b)); + const bazelPackageDirs = new Set( + bazelPackages.map((p) => Path.resolve(REPO_ROOT, p.normalizedRepoRelativeDir)) + ); + const refs = PROJECTS.flatMap((p) => { + if (p.disableTypeCheck || bazelPackageDirs.has(p.directory)) { + return []; + } + + return `./${normalize(Path.relative(REPO_ROOT, p.typeCheckConfigPath))}`; + }).sort((a, b) => a.localeCompare(b)); log.debug('updating', ROOT_REFS_CONFIG_PATH); - await Fs.writeFile(ROOT_REFS_CONFIG_PATH, generateTsConfig(refs) + '\n'); + await Fsp.writeFile(ROOT_REFS_CONFIG_PATH, generateTsConfig(refs) + '\n'); +} + +export async function cleanupRootRefsConfig() { + await Fsp.unlink(ROOT_REFS_CONFIG_PATH); } diff --git a/src/dev/typescript/run_check_ts_projects_cli.ts b/src/dev/typescript/run_check_ts_projects_cli.ts index 1f5284f11c8cd..9156c52a23d01 100644 --- a/src/dev/typescript/run_check_ts_projects_cli.ts +++ b/src/dev/typescript/run_check_ts_projects_cli.ts @@ -6,59 +6,105 @@ * Side Public License, v 1. */ -import { resolve, relative } from 'path'; - -import execa from 'execa'; +import Path from 'path'; import { run } from '@kbn/dev-cli-runner'; -import { REPO_ROOT } from '@kbn/utils'; +import { asyncMapWithLimit } from '@kbn/std'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { getRepoFiles } from '@kbn/get-repo-files'; +import globby from 'globby'; import { File } from '../file'; import { PROJECTS } from './projects'; +import type { Project } from './project'; + +class Stats { + counts = { + files: new Map(), + ignored: new Map(), + gitMatched: new Map(), + }; + + incr(proj: Project, metric: 'files' | 'ignored' | 'gitMatched', delta = 1) { + const cur = this.counts[metric].get(proj); + this.counts[metric].set(proj, (cur ?? 0) + delta); + } +} export async function runCheckTsProjectsCli() { run( async ({ log }) => { - const { stdout: files } = await execa('git', ['ls-tree', '--name-only', '-r', 'HEAD'], { - cwd: REPO_ROOT, + const stats = new Stats(); + let failed = false; + + const pathsAndProjects = await asyncMapWithLimit(PROJECTS, 5, async (proj) => { + const paths = await globby(proj.getIncludePatterns(), { + ignore: proj.getExcludePatterns(), + cwd: proj.directory, + onlyFiles: true, + absolute: true, + }); + stats.incr(proj, 'files', paths.length); + return { + proj, + paths, + }; }); - const isNotInTsProject: File[] = []; - const isInMultipleTsProjects: string[] = []; + const isInMultipleTsProjects = new Map>(); + const pathsToProject = new Map(); + for (const { proj, paths } of pathsAndProjects) { + for (const path of paths) { + if (!pathsToProject.has(path)) { + pathsToProject.set(path, proj); + continue; + } - for (const lineRaw of files.split('\n')) { - const line = lineRaw.trim(); + if (path.endsWith('.d.ts')) { + stats.incr(proj, 'ignored'); + continue; + } - if (!line) { - continue; + isInMultipleTsProjects.set( + path, + new Set([...(isInMultipleTsProjects.get(path) ?? []), proj]) + ); } + } + + if (isInMultipleTsProjects.size) { + failed = true; + const details = Array.from(isInMultipleTsProjects) + .map( + ([path, projects]) => + ` - ${Path.relative(process.cwd(), path)}:\n${Array.from(projects) + .map((p) => ` - ${Path.relative(process.cwd(), p.tsConfigPath)}`) + .join('\n')}` + ) + .join('\n'); + + log.error( + `The following files belong to multiple tsconfig.json files listed in src/dev/typescript/projects.ts\n${details}` + ); + } - const file = new File(resolve(REPO_ROOT, line)); + const isNotInTsProject: File[] = []; + for (const { abs } of await getRepoFiles()) { + const file = new File(abs); if (!file.isTypescript() || file.isFixture()) { continue; } - log.verbose('Checking %s', file.getAbsolutePath()); - - const projects = PROJECTS.filter((p) => p.isAbsolutePathSelected(file.getAbsolutePath())); - if (projects.length === 0) { + const proj = pathsToProject.get(file.getAbsolutePath()); + if (proj === undefined) { isNotInTsProject.push(file); + } else { + stats.incr(proj, 'gitMatched'); } - if (projects.length > 1 && !file.isTypescriptAmbient()) { - isInMultipleTsProjects.push( - ` - ${file.getRelativePath()}:\n${projects - .map((p) => ` - ${relative(process.cwd(), p.tsConfigPath)}`) - .join('\n')}` - ); - } - } - - if (!isNotInTsProject.length && !isInMultipleTsProjects.length) { - log.success('All ts files belong to a single ts project'); - return; } if (isNotInTsProject.length) { + failed = true; log.error( `The following files do not belong to a tsconfig.json file, or that tsconfig.json file is not listed in src/dev/typescript/projects.ts\n${isNotInTsProject .map((file) => ` - ${file.getRelativePath()}`) @@ -66,14 +112,20 @@ export async function runCheckTsProjectsCli() { ); } - if (isInMultipleTsProjects.length) { - const details = isInMultipleTsProjects.join('\n'); - log.error( - `The following files belong to multiple tsconfig.json files listed in src/dev/typescript/projects.ts\n${details}` - ); + for (const [metric, counts] of Object.entries(stats.counts)) { + log.verbose('metric:', metric); + for (const [proj, count] of Array.from(counts).sort((a, b) => + a[0].name.localeCompare(b[0].name) + )) { + log.verbose(' ', proj.name, count); + } } - process.exit(1); + if (failed) { + throw createFailError('see above errors'); + } else { + log.success('All ts files belong to a single ts project'); + } }, { description: diff --git a/src/dev/typescript/run_type_check_cli.ts b/src/dev/typescript/run_type_check_cli.ts index 2c09c18203933..65704cd82574f 100644 --- a/src/dev/typescript/run_type_check_cli.ts +++ b/src/dev/typescript/run_type_check_cli.ts @@ -7,106 +7,228 @@ */ import Path from 'path'; -import Os from 'os'; +import Fs from 'fs'; +import Fsp from 'fs/promises'; -import * as Rx from 'rxjs'; -import { mergeMap, reduce } from 'rxjs/operators'; -import execa from 'execa'; import { run } from '@kbn/dev-cli-runner'; import { createFailError } from '@kbn/dev-cli-errors'; +import { REPO_ROOT } from '@kbn/utils'; +import { Jsonc } from '@kbn/bazel-packages'; +import { runBazel } from '@kbn/bazel-runner'; +import { asyncForEachWithLimit } from '@kbn/std'; +import { BazelPackage, discoverBazelPackages } from '@kbn/bazel-packages'; import { PROJECTS } from './projects'; -import { buildTsRefs } from './build_ts_refs'; -import { updateRootRefsConfig } from './root_refs_config'; +import { Project } from './project'; +import { + updateRootRefsConfig, + cleanupRootRefsConfig, + ROOT_REFS_CONFIG_PATH, +} from './root_refs_config'; + +function rel(from: string, to: string) { + const relative = Path.relative(from, to); + return relative.startsWith('.') ? relative : `./${relative}`; +} + +function isValidRefs(refs: unknown): refs is Array<{ path: string }> { + return ( + Array.isArray(refs) && + refs.every( + (r) => typeof r === 'object' && r !== null && 'path' in r && typeof r.path === 'string' + ) + ); +} + +function parseTsconfig(path: string) { + const jsonc = Fs.readFileSync(path, 'utf8'); + const parsed = Jsonc.parse(jsonc) as Record; + if (typeof parsed !== 'object' || parsed === null) { + throw createFailError(`expected JSON at ${path} to parse into an object`); + } + + return parsed; +} + +function toTypeCheckConfigPath(path: string) { + return path.endsWith('tsconfig.base.json') + ? path.replace(/\/tsconfig\.base\.json$/, '/tsconfig.base.type_check.json') + : path.replace(/\/tsconfig\.json$/, '/tsconfig.type_check.json'); +} + +function createTypeCheckConfigs(projects: Project[], bazelPackages: BazelPackage[]) { + const created = new Set(); + const bazelPackageIds = new Set(bazelPackages.map((p) => p.manifest.id)); + + // write root tsconfig.type_check.json + const baseTypeCheckConfigPath = Path.resolve(REPO_ROOT, 'tsconfig.base.type_check.json'); + const baseConfigPath = Path.resolve(REPO_ROOT, 'tsconfig.base.json'); + const baseStat = Fs.statSync(baseConfigPath); + const basePaths = parseTsconfig(baseConfigPath).compilerOptions.paths; + if (typeof basePaths !== 'object' || basePaths === null) { + throw createFailError(`expected root compilerOptions.paths to be an object`); + } + Fs.writeFileSync( + baseTypeCheckConfigPath, + JSON.stringify( + { + extends: './tsconfig.base.json', + compilerOptions: { + paths: Object.fromEntries( + Object.entries(basePaths).flatMap(([key, value]) => { + if (key.endsWith('/*') && bazelPackageIds.has(key.slice(0, -2))) { + return []; + } + + if (bazelPackageIds.has(key)) { + return []; + } + + return [[key, value]]; + }) + ), + }, + }, + null, + 2 + ) + ); + Fs.utimesSync(baseTypeCheckConfigPath, baseStat.atime, baseStat.mtime); + created.add(baseTypeCheckConfigPath); + + // write tsconfig.type_check.json files for each project that is not the root + const queue = new Set(projects.map((p) => p.tsConfigPath)); + for (const path of queue) { + const tsconfigStat = Fs.statSync(path); + const parsed = parseTsconfig(path); + + const dir = Path.dirname(path); + const typeCheckConfigPath = Path.resolve(dir, 'tsconfig.type_check.json'); + const refs = parsed.kbn_references ?? []; + if (!isValidRefs(refs)) { + throw new Error(`expected valid TS refs in ${path}`); + } + + const typeCheckConfig = { + ...parsed, + extends: parsed.extends + ? toTypeCheckConfigPath(parsed.extends) + : rel(dir, baseTypeCheckConfigPath), + compilerOptions: { + ...parsed.compilerOptions, + composite: true, + incremental: true, + rootDir: '.', + paths: undefined, + }, + kbn_references: undefined, + references: refs.map((ref) => ({ + path: toTypeCheckConfigPath(ref.path), + })), + }; + + Fs.writeFileSync(typeCheckConfigPath, JSON.stringify(typeCheckConfig, null, 2)); + Fs.utimesSync(typeCheckConfigPath, tsconfigStat.atime, tsconfigStat.mtime); + + created.add(typeCheckConfigPath); + + // add all the referenced config files to the queue if they're not already in it + for (const ref of refs) { + queue.add(Path.resolve(dir, ref.path)); + } + } + + return created; +} export async function runTypeCheckCli() { run( - async ({ log, flags, procRunner }) => { + async ({ log, flagsReader, procRunner }) => { + if (flagsReader.boolean('clean-cache')) { + await asyncForEachWithLimit(PROJECTS, 10, async (proj) => { + await Fsp.rm(Path.resolve(proj.directory, 'target/types'), { + force: true, + recursive: true, + }); + }); + log.warning('Deleted all typescript caches'); + } + + await runBazel(['build', '//packages:build_types', '--show_result=1'], { + cwd: REPO_ROOT, + logPrefix: '\x1b[94m[bazel]\x1b[39m', + onErrorExit(code: any, output: any) { + throw createFailError( + `The bazel command that was running exited with code [${code}] and output: ${output}` + ); + }, + }); + + const bazelPackages = await discoverBazelPackages(REPO_ROOT); + // if the tsconfig.refs.json file is not self-managed then make sure it has // a reference to every composite project in the repo - await updateRootRefsConfig(log); + await updateRootRefsConfig(log, bazelPackages); - const projectFilter = - flags.project && typeof flags.project === 'string' - ? Path.resolve(flags.project) - : undefined; + const projectFilter = flagsReader.path('project'); const projects = PROJECTS.filter((p) => { return !p.disableTypeCheck && (!projectFilter || p.tsConfigPath === projectFilter); }); - if (projects.length > 1 || projects[0].isCompositeProject()) { - const { failed } = await buildTsRefs({ - log, - procRunner, - verbose: !!flags.verbose, - project: projects.length === 1 ? projects[0] : undefined, + const created = createTypeCheckConfigs(projects, bazelPackages); + + let pluginBuildResult; + try { + log.info(`Building TypeScript projects to check types...`); + + const relative = Path.relative( + REPO_ROOT, + projects.length === 1 ? projects[0].typeCheckConfigPath : ROOT_REFS_CONFIG_PATH + ); + + await procRunner.run('tsc', { + cmd: Path.relative(REPO_ROOT, require.resolve('typescript/bin/tsc')), + args: [ + '-b', + relative, + '--pretty', + ...(flagsReader.boolean('verbose') ? ['--verbose'] : []), + ], + cwd: REPO_ROOT, + wait: true, }); - if (failed) { - throw createFailError('Unable to build TS project refs'); - } + + pluginBuildResult = { failed: false }; + } catch (error) { + pluginBuildResult = { failed: true }; } - if (!projects.length) { - if (projectFilter) { - throw createFailError(`Unable to find project at ${flags.project}`); - } else { - throw createFailError(`Unable to find projects to type-check`); - } + // cleanup + if (flagsReader.boolean('cleanup')) { + await cleanupRootRefsConfig(); + + await asyncForEachWithLimit(created, 40, async (path) => { + await Fsp.unlink(path); + }); + + await asyncForEachWithLimit(bazelPackages, 40, async (pkg) => { + const targetTypesPaths = Path.resolve( + REPO_ROOT, + 'bazel-bin', + pkg.normalizedRepoRelativeDir, + 'target_type' + ); + + await Fsp.rm(targetTypesPaths, { + force: true, + recursive: true, + }); + }); } - const concurrencyArg = - typeof flags.concurrency === 'string' && parseInt(flags.concurrency, 10); - const concurrency = - concurrencyArg && concurrencyArg > 0 - ? concurrencyArg - : Math.min(4, Math.round((Os.cpus() || []).length / 2) || 1) || 1; - - log.info('running type check in', projects.length, 'projects'); - - const tscArgs = [ - ...['--emitDeclarationOnly', 'false'], - '--noEmit', - '--pretty', - ...(flags['skip-lib-check'] - ? ['--skipLibCheck', flags['skip-lib-check'] as string] - : ['--skipLibCheck', 'false']), - ]; - - const failureCount = await Rx.lastValueFrom( - Rx.from(projects).pipe( - mergeMap(async (p) => { - const relativePath = Path.relative(process.cwd(), p.tsConfigPath); - - const result = await execa( - process.execPath, - [ - '--max-old-space-size=5120', - require.resolve('typescript/bin/tsc'), - ...['--project', p.tsConfigPath], - ...tscArgs, - ], - { - reject: false, - all: true, - } - ); - - if (result.failed) { - log.error(`Type check failed in ${relativePath}:`); - log.error(result.all ?? ' - tsc produced no output - '); - return 1; - } else { - log.success(relativePath); - return 0; - } - }, concurrency), - reduce((acc, f) => acc + f, 0) - ) - ); - - if (failureCount > 0) { - throw createFailError(`${failureCount} type checks failed`); + if (pluginBuildResult.failed) { + throw createFailError('Unable to build TS project refs'); } }, { @@ -121,13 +243,16 @@ export async function runTypeCheckCli() { node scripts/type_check --project packages/kbn-pm/tsconfig.json `, flags: { - string: ['project', 'concurrency'], - boolean: ['skip-lib-check'], + string: ['project'], + boolean: ['clean-cache', 'cleanup'], + default: { + cleanup: true, + }, help: ` - --concurrency Number of projects to check in parallel. Defaults to 50% of available CPUs, up to 4. --project [path] Path to a tsconfig.json file determines the project to check - --skip-lib-check Skip type checking of all declaration files (*.d.ts). Default is false --help Show this message + --clean-cache Delete any existing TypeScript caches before running type check + --no-cleanup Pass to avoid deleting the temporary tsconfig files written to disk `, }, } diff --git a/src/fixtures/telemetry_collectors/constants.ts b/src/fixtures/telemetry_collectors/constants.ts index 8a669f9654ac4..c24588e36620f 100644 --- a/src/fixtures/telemetry_collectors/constants.ts +++ b/src/fixtures/telemetry_collectors/constants.ts @@ -63,6 +63,7 @@ export interface MappedTypes { export type RecordWithKnownProps = Record; export type RecordWithKnownAllProps = Record; +export type RecordStringUnknown = Record; export type IndexedAccessType = Pick; export type OmitIndexedAccessType = Omit; diff --git a/src/fixtures/telemetry_collectors/working_collector_with_description.ts b/src/fixtures/telemetry_collectors/working_collector_with_description.ts index c382a63ccd6fa..b1b5c8b66ba6a 100644 --- a/src/fixtures/telemetry_collectors/working_collector_with_description.ts +++ b/src/fixtures/telemetry_collectors/working_collector_with_description.ts @@ -24,6 +24,7 @@ interface Usage { my_index_signature_prop?: { [key: string]: number; }; + my_pass_through?: Record; } const SOME_NUMBER: number = 123; @@ -52,6 +53,9 @@ export const myCollector = makeUsageCollector({ }, ], my_str_array: ['hello', 'world'], + my_pass_through: { + some: 'key', + }, }; } catch (err) { return { @@ -94,5 +98,9 @@ export const myCollector = makeUsageCollector({ max: { type: 'long' }, min: { type: 'long' }, }, + my_pass_through: { + type: 'pass_through', + _meta: { description: "Don't know what goes here. Simply passing it through." }, + }, }, }); diff --git a/src/fixtures/tsconfig.json b/src/fixtures/tsconfig.json new file mode 100644 index 0000000000000..bd36efa965333 --- /dev/null +++ b/src/fixtures/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "telemetry_collectors/**/*", + ], + "kbn_references": [ + { "path": "../core/tsconfig.json" }, + { "path": "../plugins/usage_collection/tsconfig.json" }, + ] +} diff --git a/src/plugins/advanced_settings/tsconfig.json b/src/plugins/advanced_settings/tsconfig.json index 5bf4ce3d6248b..921db12b89863 100644 --- a/src/plugins/advanced_settings/tsconfig.json +++ b/src/plugins/advanced_settings/tsconfig.json @@ -4,13 +4,12 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", "server/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../management/tsconfig.json" }, { "path": "../home/tsconfig.json" }, diff --git a/src/plugins/bfetch/common/buffer/tests/timed_item_buffer.test.ts b/src/plugins/bfetch/common/buffer/tests/timed_item_buffer.test.ts index 22d3fb2a44689..377ae064a439c 100644 --- a/src/plugins/bfetch/common/buffer/tests/timed_item_buffer.test.ts +++ b/src/plugins/bfetch/common/buffer/tests/timed_item_buffer.test.ts @@ -9,7 +9,7 @@ import { TimedItemBuffer } from '../timed_item_buffer'; import { runItemBufferTests } from './run_item_buffer_tests'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); beforeEach(() => { jest.clearAllTimers(); diff --git a/src/plugins/bfetch/public/batching/create_streaming_batched_function.test.ts b/src/plugins/bfetch/public/batching/create_streaming_batched_function.test.ts index 14fccf09d83b0..d3aaaf256f2eb 100644 --- a/src/plugins/bfetch/public/batching/create_streaming_batched_function.test.ts +++ b/src/plugins/bfetch/public/batching/create_streaming_batched_function.test.ts @@ -11,7 +11,8 @@ import { fetchStreaming as fetchStreamingReal } from '../streaming/fetch_streami import { AbortError, defer, of } from '@kbn/kibana-utils-plugin/public'; import { Subject } from 'rxjs'; -const flushPromises = () => new Promise((resolve) => setImmediate(resolve)); +const flushPromises = () => + new Promise((resolve) => jest.requireActual('timers').setImmediate(resolve)); const getPromiseState = (promise: Promise): Promise<'resolved' | 'rejected' | 'pending'> => Promise.race<'resolved' | 'rejected' | 'pending'>([ @@ -50,7 +51,7 @@ const setup = () => { describe('createStreamingBatchedFunction()', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/bfetch/tsconfig.json b/src/plugins/bfetch/tsconfig.json index 8fceb7d815ee9..829b781e8bd2c 100644 --- a/src/plugins/bfetch/tsconfig.json +++ b/src/plugins/bfetch/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*", "index.ts"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, ] diff --git a/src/plugins/chart_expressions/expression_gauge/kibana.json b/src/plugins/chart_expressions/expression_gauge/kibana.json index 9e5d4da5d7ec6..1de64537db116 100755 --- a/src/plugins/chart_expressions/expression_gauge/kibana.json +++ b/src/plugins/chart_expressions/expression_gauge/kibana.json @@ -4,7 +4,7 @@ "kibanaVersion": "kibana", "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart.", "server": true, diff --git a/src/plugins/chart_expressions/expression_gauge/tsconfig.json b/src/plugins/chart_expressions/expression_gauge/tsconfig.json index fb6f5e2ec90b8..3ab82197cb9f8 100644 --- a/src/plugins/chart_expressions/expression_gauge/tsconfig.json +++ b/src/plugins/chart_expressions/expression_gauge/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../tsconfig.json" }, { "path": "../../../core/tsconfig.json" }, { "path": "../../expressions/tsconfig.json" }, diff --git a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap index 96b70e33021f4..1b644ef0a4938 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap +++ b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap @@ -77,6 +77,7 @@ Object { "xAccessor": "col-1-2", "yAccessor": undefined, }, + "canNavigateToLens": false, "data": Object { "columns": Array [ Object { diff --git a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts index 548d4ec0ab49e..f0c309de19236 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts @@ -232,6 +232,7 @@ export const heatmapFunction = (): HeatmapExpressionFunctionDefinition => ({ }, syncTooltips: handlers?.isSyncTooltipsEnabled?.() ?? false, syncCursor: handlers?.isSyncCursorEnabled?.() ?? true, + canNavigateToLens: Boolean(handlers?.variables?.canNavigateToLens), }, }; }, diff --git a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts index 79a356ddad934..9aa489a031eeb 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts @@ -7,17 +7,11 @@ */ import { Position } from '@elastic/charts'; import { i18n } from '@kbn/i18n'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; import { DEFAULT_LEGEND_SIZE, LegendSize } from '@kbn/visualizations-plugin/common/constants'; import { EXPRESSION_HEATMAP_LEGEND_NAME } from '../constants'; -import { HeatmapLegendConfig, HeatmapLegendConfigResult } from '../types'; +import { HeatmapLegendExpressionFunctionDefinition } from '../types'; -export const heatmapLegendConfig: ExpressionFunctionDefinition< - typeof EXPRESSION_HEATMAP_LEGEND_NAME, - null, - HeatmapLegendConfig, - HeatmapLegendConfigResult -> = { +export const heatmapLegendConfig: HeatmapLegendExpressionFunctionDefinition = { name: EXPRESSION_HEATMAP_LEGEND_NAME, aliases: [], type: EXPRESSION_HEATMAP_LEGEND_NAME, diff --git a/src/plugins/chart_expressions/expression_heatmap/common/index.ts b/src/plugins/chart_expressions/expression_heatmap/common/index.ts index 484dee11c300b..1fa096cc6fe8a 100755 --- a/src/plugins/chart_expressions/expression_heatmap/common/index.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/index.ts @@ -18,6 +18,9 @@ export type { HeatmapLegendConfigResult, HeatmapGridConfigResult, HeatmapArguments, + HeatmapExpressionFunctionDefinition, + HeatmapLegendExpressionFunctionDefinition, + HeatmapGridExpressionFunctionDefinition, } from './types'; export { heatmapFunction, heatmapLegendConfig, heatmapGridConfig } from './expression_functions'; diff --git a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts index 5aa1507f30b03..2537d4c7f5105 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts @@ -94,6 +94,7 @@ export interface HeatmapExpressionProps { args: HeatmapArguments; syncTooltips: boolean; syncCursor: boolean; + canNavigateToLens?: boolean; } export interface HeatmapRender { @@ -108,3 +109,17 @@ export type HeatmapExpressionFunctionDefinition = ExpressionFunctionDefinition< HeatmapArguments, ExpressionValueRender >; + +export type HeatmapLegendExpressionFunctionDefinition = ExpressionFunctionDefinition< + typeof EXPRESSION_HEATMAP_LEGEND_NAME, + null, + HeatmapLegendConfig, + HeatmapLegendConfigResult +>; + +export type HeatmapGridExpressionFunctionDefinition = ExpressionFunctionDefinition< + typeof EXPRESSION_HEATMAP_GRID_NAME, + null, + HeatmapGridConfig, + HeatmapGridConfigResult +>; diff --git a/src/plugins/chart_expressions/expression_heatmap/kibana.json b/src/plugins/chart_expressions/expression_heatmap/kibana.json index 3608144a8617c..d0c6acc2a23e5 100755 --- a/src/plugins/chart_expressions/expression_heatmap/kibana.json +++ b/src/plugins/chart_expressions/expression_heatmap/kibana.json @@ -4,7 +4,7 @@ "kibanaVersion": "kibana", "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart.", "server": true, diff --git a/src/plugins/chart_expressions/expression_heatmap/public/expression_renderers/heatmap_renderer.tsx b/src/plugins/chart_expressions/expression_heatmap/public/expression_renderers/heatmap_renderer.tsx index 4b813fb93416f..b14ee1382deb2 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/expression_renderers/heatmap_renderer.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/expression_renderers/heatmap_renderer.tsx @@ -61,9 +61,14 @@ export const heatmapRenderer: ( const visualizationType = extractVisualizationType(executionContext); if (containerType && visualizationType) { - plugins.usageCollection?.reportUiCounter(containerType, METRIC_TYPE.COUNT, [ + const events = [ `render_${visualizationType}_${EXPRESSION_HEATMAP_NAME}`, - ]); + config.canNavigateToLens + ? `render_${visualizationType}_${EXPRESSION_HEATMAP_NAME}_convertable` + : undefined, + ].filter((event): event is string => Boolean(event)); + + plugins.usageCollection?.reportUiCounter(containerType, METRIC_TYPE.COUNT, events); } handlers.done(); diff --git a/src/plugins/chart_expressions/expression_heatmap/tsconfig.json b/src/plugins/chart_expressions/expression_heatmap/tsconfig.json index fb6f5e2ec90b8..3ab82197cb9f8 100644 --- a/src/plugins/chart_expressions/expression_heatmap/tsconfig.json +++ b/src/plugins/chart_expressions/expression_heatmap/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../tsconfig.json" }, { "path": "../../../core/tsconfig.json" }, { "path": "../../expressions/tsconfig.json" }, diff --git a/src/plugins/chart_expressions/expression_legacy_metric/common/expression_functions/metric_vis_function.ts b/src/plugins/chart_expressions/expression_legacy_metric/common/expression_functions/metric_vis_function.ts index a7d655107fc2d..77f061e7a0cea 100644 --- a/src/plugins/chart_expressions/expression_legacy_metric/common/expression_functions/metric_vis_function.ts +++ b/src/plugins/chart_expressions/expression_legacy_metric/common/expression_functions/metric_vis_function.ts @@ -45,6 +45,13 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({ defaultMessage: 'Metric visualization', }), args: { + autoScaleMetricAlignment: { + types: ['string'], + help: i18n.translate('expressionLegacyMetricVis.function.autoScaleMetricAlignment.help', { + defaultMessage: 'Metric alignment after scaled', + }), + required: false, + }, percentageMode: { types: ['boolean'], default: false, @@ -177,6 +184,9 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({ visType, visConfig: { metric: { + ...(args.autoScaleMetricAlignment + ? { autoScaleMetricAlignment: args.autoScaleMetricAlignment } + : {}), palette: args.palette?.params, percentageMode: args.percentageMode, metricColorMode: args.colorMode, diff --git a/src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_functions.ts index f0a63b012dc0a..746915f213271 100644 --- a/src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_functions.ts @@ -15,10 +15,11 @@ import { } from '@kbn/expressions-plugin/common'; import { ExpressionValueVisDimension } from '@kbn/visualizations-plugin/common'; import { ColorMode, CustomPaletteState } from '@kbn/charts-plugin/common'; -import { VisParams, visType, LabelPositionType } from './expression_renderers'; +import { VisParams, visType, LabelPositionType, MetricAlignment } from './expression_renderers'; import { EXPRESSION_METRIC_NAME } from '../constants'; export interface MetricArguments { + autoScaleMetricAlignment?: MetricAlignment; percentageMode: boolean; colorMode: ColorMode; showLabels: boolean; diff --git a/src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_renderers.ts b/src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_renderers.ts index 8c370480a7be9..9341e267575bd 100644 --- a/src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_renderers.ts +++ b/src/plugins/chart_expressions/expression_legacy_metric/common/types/expression_renderers.ts @@ -29,7 +29,10 @@ export type LabelPositionType = $Values; export type MetricStyle = Style & Pick; export type LabelsConfig = Labels & { style: Style; position: LabelPositionType }; + +export type MetricAlignment = 'left' | 'center' | 'right'; export interface MetricVisParam { + autoScaleMetricAlignment?: MetricAlignment; percentageMode: boolean; percentageFormatPattern?: string; metricColorMode: ColorMode; diff --git a/src/plugins/chart_expressions/expression_legacy_metric/kibana.json b/src/plugins/chart_expressions/expression_legacy_metric/kibana.json index 5027ff2625d0b..d3badb13dd0bb 100755 --- a/src/plugins/chart_expressions/expression_legacy_metric/kibana.json +++ b/src/plugins/chart_expressions/expression_legacy_metric/kibana.json @@ -4,7 +4,7 @@ "kibanaVersion": "kibana", "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Adds a `metric` renderer and function to the expression plugin. The renderer will display the `legacy metric` chart.", "server": true, diff --git a/src/plugins/chart_expressions/expression_legacy_metric/public/components/__snapshots__/with_auto_scale.test.tsx.snap b/src/plugins/chart_expressions/expression_legacy_metric/public/components/__snapshots__/with_auto_scale.test.tsx.snap index 4acbab635ba47..37b8587d6b6af 100644 --- a/src/plugins/chart_expressions/expression_legacy_metric/public/components/__snapshots__/with_auto_scale.test.tsx.snap +++ b/src/plugins/chart_expressions/expression_legacy_metric/public/components/__snapshots__/with_auto_scale.test.tsx.snap @@ -29,3 +29,4 @@ exports[`AutoScale withAutoScale renders 1`] = ` `; + diff --git a/src/plugins/chart_expressions/expression_legacy_metric/public/components/metric_component.tsx b/src/plugins/chart_expressions/expression_legacy_metric/public/components/metric_component.tsx index 2bebcda46bbe5..5dd9ef4d277aa 100644 --- a/src/plugins/chart_expressions/expression_legacy_metric/public/components/metric_component.tsx +++ b/src/plugins/chart_expressions/expression_legacy_metric/public/components/metric_component.tsx @@ -143,6 +143,12 @@ class MetricVisComponent extends Component { minHeight: '100%', minWidth: '100%', }, + ...(this.props.visParams.metric?.autoScaleMetricAlignment + ? { + autoScaleMetricAlignment: + this.props.visParams.metric?.autoScaleMetricAlignment, + } + : {}), } : undefined } diff --git a/src/plugins/chart_expressions/expression_legacy_metric/public/components/with_auto_scale.tsx b/src/plugins/chart_expressions/expression_legacy_metric/public/components/with_auto_scale.tsx index 3343385dff40e..2f67094fdc4ed 100644 --- a/src/plugins/chart_expressions/expression_legacy_metric/public/components/with_auto_scale.tsx +++ b/src/plugins/chart_expressions/expression_legacy_metric/public/components/with_auto_scale.tsx @@ -20,6 +20,7 @@ import { useResizeObserver } from '@elastic/eui'; import { autoScaleWrapperStyle } from './with_auto_scale.styles'; interface AutoScaleParams { + autoScaleMetricAlignment?: 'left' | 'center' | 'right'; minScale?: number; containerStyles: CSSProperties; } @@ -83,7 +84,6 @@ export function withAutoScale(WrappedComponent: ComponentType) { const parentRef = useRef(null); const childrenRef = useRef(null); const parentDimensions = useResizeObserver(parentRef.current); - const scaleFn = useMemo( () => throttle(() => { @@ -120,6 +120,16 @@ export function withAutoScale(WrappedComponent: ComponentType) { ref={childrenRef} style={{ transform: `scale(${scale || 0})`, + ...(parentDimensions.width && + scale && + autoScaleParams?.autoScaleMetricAlignment && + autoScaleParams?.autoScaleMetricAlignment !== 'center' + ? { + position: 'relative', + [autoScaleParams.autoScaleMetricAlignment]: + (1 - scale) * parentDimensions.width * scale * -1, // The difference of width after scaled + } + : {}), }} > diff --git a/src/plugins/chart_expressions/expression_legacy_metric/tsconfig.json b/src/plugins/chart_expressions/expression_legacy_metric/tsconfig.json index 230318aa0e04d..900bc4c8da266 100644 --- a/src/plugins/chart_expressions/expression_legacy_metric/tsconfig.json +++ b/src/plugins/chart_expressions/expression_legacy_metric/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../tsconfig.json" }, { "path": "../../../core/tsconfig.json" }, { "path": "../../expressions/tsconfig.json" }, diff --git a/src/plugins/chart_expressions/expression_metric/common/index.ts b/src/plugins/chart_expressions/expression_metric/common/index.ts index 163c153efa9ee..ae8f3b9fae7a2 100755 --- a/src/plugins/chart_expressions/expression_metric/common/index.ts +++ b/src/plugins/chart_expressions/expression_metric/common/index.ts @@ -14,6 +14,7 @@ export type { MetricInput, MetricVisRenderConfig, MetricVisExpressionFunctionDefinition, + TrendlineExpressionFunctionDefinition, DimensionsVisParam, MetricVisParam, VisParams, diff --git a/src/plugins/chart_expressions/expression_metric/kibana.json b/src/plugins/chart_expressions/expression_metric/kibana.json index 5c09ef3b6c365..ed3ef2173f200 100755 --- a/src/plugins/chart_expressions/expression_metric/kibana.json +++ b/src/plugins/chart_expressions/expression_metric/kibana.json @@ -4,7 +4,7 @@ "kibanaVersion": "kibana", "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Adds a `metric` renderer and function to the expression plugin. The renderer will display the `metric` chart.", "server": true, diff --git a/src/plugins/chart_expressions/expression_metric/tsconfig.json b/src/plugins/chart_expressions/expression_metric/tsconfig.json index fb6f5e2ec90b8..3ab82197cb9f8 100644 --- a/src/plugins/chart_expressions/expression_metric/tsconfig.json +++ b/src/plugins/chart_expressions/expression_metric/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../tsconfig.json" }, { "path": "../../../core/tsconfig.json" }, { "path": "../../expressions/tsconfig.json" }, diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/index.ts b/src/plugins/chart_expressions/expression_partition_vis/common/index.ts index 559d597caf90c..d51838b334a09 100755 --- a/src/plugins/chart_expressions/expression_partition_vis/common/index.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/common/index.ts @@ -31,6 +31,7 @@ export type { TreemapVisExpressionFunctionDefinition, MosaicVisExpressionFunctionDefinition, WaffleVisExpressionFunctionDefinition, + PartitionLabelsExpressionFunctionDefinition, } from './types/expression_functions'; export type { diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_partition_vis/common/types/expression_functions.ts index fe5910990d62a..30c5aba33ebf1 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/common/types/expression_functions.ts @@ -18,6 +18,7 @@ import { TREEMAP_VIS_EXPRESSION_NAME, MOSAIC_VIS_EXPRESSION_NAME, WAFFLE_VIS_EXPRESSION_NAME, + PARTITION_LABELS_FUNCTION, } from '../constants'; import { RenderValue, @@ -91,3 +92,10 @@ export enum ChartTypes { MOSAIC = 'mosaic', WAFFLE = 'waffle', } + +export type PartitionLabelsExpressionFunctionDefinition = ExpressionFunctionDefinition< + typeof PARTITION_LABELS_FUNCTION, + Datatable | null, + PartitionLabelsArguments, + ExpressionValuePartitionLabels +>; diff --git a/src/plugins/chart_expressions/expression_partition_vis/kibana.json b/src/plugins/chart_expressions/expression_partition_vis/kibana.json index e4819f822148d..17d6e40aaf1b0 100755 --- a/src/plugins/chart_expressions/expression_partition_vis/kibana.json +++ b/src/plugins/chart_expressions/expression_partition_vis/kibana.json @@ -4,7 +4,7 @@ "kibanaVersion": "kibana", "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Expression Partition Visualization plugin adds a `partitionVis` renderer and `pieVis`, `mosaicVis`, `treemapVis`, `waffleVis` functions to the expression plugin. The renderer will display the `pie`, `waffle`, `treemap` and `mosaic` charts.", "server": true, diff --git a/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json b/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json index 54434f0d30c21..c899eae805aff 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json +++ b/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../tsconfig.json" }, { "path": "../../../core/tsconfig.json" }, { "path": "../../expressions/tsconfig.json" }, diff --git a/src/plugins/chart_expressions/expression_tagcloud/kibana.json b/src/plugins/chart_expressions/expression_tagcloud/kibana.json index 20ed1ec360969..b90c1f6e71c7a 100755 --- a/src/plugins/chart_expressions/expression_tagcloud/kibana.json +++ b/src/plugins/chart_expressions/expression_tagcloud/kibana.json @@ -9,7 +9,7 @@ "optionalPlugins": ["usageCollection"], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart." } diff --git a/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json b/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json index 30d2da20d4bdd..70951dc9e2c08 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json +++ b/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../tsconfig.json" }, { "path": "../../../core/tsconfig.json" }, { "path": "../../presentation_util/tsconfig.json" }, diff --git a/src/plugins/chart_expressions/expression_xy/kibana.json b/src/plugins/chart_expressions/expression_xy/kibana.json index eebc9f1382b85..5c37e14072ed5 100755 --- a/src/plugins/chart_expressions/expression_xy/kibana.json +++ b/src/plugins/chart_expressions/expression_xy/kibana.json @@ -4,7 +4,7 @@ "kibanaVersion": "kibana", "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart.", "server": true, 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 c03cb9a664f1a..d57dc86b36ba1 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 @@ -275,8 +275,10 @@ export function XYChart({ [uiState] ); + // Exclude the reference layers from the cursor update + const cursorSyncLayers = filteredLayers.filter(isDataLayer); const handleCursorUpdate = useActiveCursor(chartsActiveCursorService, chartRef, { - datatables: filteredLayers.map(({ table }) => table), + datatables: cursorSyncLayers.map(({ table }) => table), }); const onRenderChange = useCallback( diff --git a/src/plugins/chart_expressions/expression_xy/tsconfig.json b/src/plugins/chart_expressions/expression_xy/tsconfig.json index cb45e437ccd39..62d9861684ccf 100644 --- a/src/plugins/chart_expressions/expression_xy/tsconfig.json +++ b/src/plugins/chart_expressions/expression_xy/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../tsconfig.json" }, { "path": "../../charts/tsconfig.json" }, { "path": "../../../core/tsconfig.json" }, diff --git a/src/plugins/chart_expressions/tsconfig.json b/src/plugins/chart_expressions/tsconfig.json index caa1608e4cefb..6890928b48d6c 100644 --- a/src/plugins/chart_expressions/tsconfig.json +++ b/src/plugins/chart_expressions/tsconfig.json @@ -10,7 +10,7 @@ "include": [ "common/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, ] } diff --git a/src/plugins/charts/kibana.json b/src/plugins/charts/kibana.json index a3e0da41056d7..db8143b15f330 100644 --- a/src/plugins/charts/kibana.json +++ b/src/plugins/charts/kibana.json @@ -7,6 +7,6 @@ "requiredPlugins": ["expressions"], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" } } diff --git a/src/plugins/charts/tsconfig.json b/src/plugins/charts/tsconfig.json index fc05a26068654..881263657efbc 100644 --- a/src/plugins/charts/tsconfig.json +++ b/src/plugins/charts/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../expressions/tsconfig.json" }, { "path": "../embeddable/tsconfig.json" } diff --git a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx index ed8c87b5df147..10636f452004d 100644 --- a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx +++ b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx @@ -115,7 +115,9 @@ function EditorUI({ initialTextValue, setEditorInstance }: EditorProps) { const loadBufferFromRemote = (url: string) => { const coreEditor = editor.getCoreEditor(); - if (/^https?:\/\//.test(url)) { + // Normalize and encode the URL to avoid issues with spaces and other special characters. + const encodedUrl = new URL(url).toString(); + if (/^https?:\/\//.test(encodedUrl)) { const loadFrom: Record = { url, // Having dataType here is required as it doesn't allow jQuery to `eval` content diff --git a/src/plugins/console/tsconfig.json b/src/plugins/console/tsconfig.json index 1597ce812edc5..cc44f6119f2de 100644 --- a/src/plugins/console/tsconfig.json +++ b/src/plugins/console/tsconfig.json @@ -4,10 +4,14 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../dev_tools/tsconfig.json" }, { "path": "../es_ui_shared/tsconfig.json" }, diff --git a/src/plugins/controls/common/control_group/control_group_panel_diff_system.ts b/src/plugins/controls/common/control_group/control_group_panel_diff_system.ts new file mode 100644 index 0000000000000..dbe9c992460b3 --- /dev/null +++ b/src/plugins/controls/common/control_group/control_group_panel_diff_system.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import deepEqual from 'fast-deep-equal'; +import { omit, isEqual } from 'lodash'; +import { OptionsListEmbeddableInput, OPTIONS_LIST_CONTROL } from '../options_list/types'; + +import { ControlPanelState } from './types'; + +interface DiffSystem { + getPanelIsEqual: (initialInput: ControlPanelState, newInput: ControlPanelState) => boolean; +} + +export const genericControlPanelDiffSystem: DiffSystem = { + getPanelIsEqual: (initialInput, newInput) => { + return deepEqual(initialInput, newInput); + }, +}; + +export const ControlPanelDiffSystems: { + [key: string]: DiffSystem; +} = { + [OPTIONS_LIST_CONTROL]: { + getPanelIsEqual: (initialInput, newInput) => { + if (!deepEqual(omit(initialInput, 'explicitInput'), omit(newInput, 'explicitInput'))) { + return false; + } + + const { + exclude: excludeA, + hideExists: hideExistsA, + hideExclude: hideExcludeA, + selectedOptions: selectedA, + singleSelect: singleSelectA, + existsSelected: existsSelectedA, + runPastTimeout: runPastTimeoutA, + ...inputA + }: Partial = initialInput.explicitInput; + const { + exclude: excludeB, + hideExists: hideExistsB, + hideExclude: hideExcludeB, + selectedOptions: selectedB, + singleSelect: singleSelectB, + existsSelected: existsSelectedB, + runPastTimeout: runPastTimeoutB, + ...inputB + }: Partial = newInput.explicitInput; + + return ( + Boolean(excludeA) === Boolean(excludeB) && + Boolean(hideExistsA) === Boolean(hideExistsB) && + Boolean(hideExcludeA) === Boolean(hideExcludeB) && + Boolean(singleSelectA) === Boolean(singleSelectB) && + Boolean(existsSelectedA) === Boolean(existsSelectedB) && + Boolean(runPastTimeoutA) === Boolean(runPastTimeoutB) && + isEqual(selectedA ?? [], selectedB ?? []) && + deepEqual(inputA, inputB) + ); + }, + }, +}; diff --git a/src/plugins/controls/common/control_group/control_group_persistence.ts b/src/plugins/controls/common/control_group/control_group_persistence.ts index 16c06297b6fde..1dbe096307c50 100644 --- a/src/plugins/controls/common/control_group/control_group_persistence.ts +++ b/src/plugins/controls/common/control_group/control_group_persistence.ts @@ -9,7 +9,7 @@ import { SerializableRecord } from '@kbn/utility-types'; import deepEqual from 'fast-deep-equal'; -import { pick } from 'lodash'; +import { pick, omit, xor } from 'lodash'; import { ControlGroupInput } from '..'; import { DEFAULT_CONTROL_GROW, @@ -17,6 +17,10 @@ import { DEFAULT_CONTROL_WIDTH, } from './control_group_constants'; import { PersistableControlGroupInput, RawControlGroupAttributes } from './types'; +import { + ControlPanelDiffSystems, + genericControlPanelDiffSystem, +} from './control_group_panel_diff_system'; const safeJSONParse = (jsonString?: string): OutType | undefined => { if (!jsonString && typeof jsonString !== 'string') return; @@ -54,10 +58,40 @@ export const persistableControlGroupInputIsEqual = ( ...defaultInput, ...pick(b, ['panels', 'chainingSystem', 'controlStyle', 'ignoreParentSettings']), }; - if (deepEqual(inputA, inputB)) return true; + + if ( + getPanelsAreEqual(inputA.panels, inputB.panels) && + deepEqual(omit(inputA, 'panels'), omit(inputB, 'panels')) + ) + return true; + return false; }; +const getPanelsAreEqual = ( + originalPanels: PersistableControlGroupInput['panels'], + newPanels: PersistableControlGroupInput['panels'] +) => { + const originalPanelIds = Object.keys(originalPanels); + const newPanelIds = Object.keys(newPanels); + const panelIdDiff = xor(originalPanelIds, newPanelIds); + if (panelIdDiff.length > 0) { + return false; + } + + for (const panelId of newPanelIds) { + const newPanelType = newPanels[panelId].type; + const panelIsEqual = ControlPanelDiffSystems[newPanelType] + ? ControlPanelDiffSystems[newPanelType].getPanelIsEqual( + originalPanels[panelId], + newPanels[panelId] + ) + : genericControlPanelDiffSystem.getPanelIsEqual(originalPanels[panelId], newPanels[panelId]); + if (!panelIsEqual) return false; + } + return true; +}; + export const controlGroupInputToRawControlGroupAttributes = ( controlGroupInput: Omit ): RawControlGroupAttributes => { diff --git a/src/plugins/controls/common/options_list/mocks.tsx b/src/plugins/controls/common/options_list/mocks.tsx index 09f6d9caa33b4..c6d15ec9fcdb6 100644 --- a/src/plugins/controls/common/options_list/mocks.tsx +++ b/src/plugins/controls/common/options_list/mocks.tsx @@ -6,10 +6,12 @@ * Side Public License, v 1. */ -import { ReduxEmbeddableContext } from '@kbn/presentation-util-plugin/public/redux_embeddables/types'; -import { ControlOutput } from '../../public/types'; +import { createReduxEmbeddableTools } from '@kbn/presentation-util-plugin/public/redux_embeddables/create_redux_embeddable_tools'; + +import { OptionsListEmbeddable, OptionsListEmbeddableFactory } from '../../public'; import { OptionsListComponentState, OptionsListReduxState } from '../../public/options_list/types'; import { optionsListReducers } from '../../public/options_list/options_list_reducers'; +import { ControlFactory, ControlOutput } from '../../public/types'; import { OptionsListEmbeddableInput } from './types'; const mockOptionsListComponentState = { @@ -28,33 +30,34 @@ const mockOptionsListEmbeddableInput = { selectedOptions: [], runPastTimeout: false, singleSelect: false, + allowExclude: false, + exclude: false, } as OptionsListEmbeddableInput; const mockOptionsListOutput = { loading: false, } as ControlOutput; -export const mockOptionsListContext = ( +export const mockOptionsListReduxEmbeddableTools = async ( partialState?: Partial -): ReduxEmbeddableContext => { - const mockReduxState = { - componentState: { +) => { + const optionsListFactoryStub = new OptionsListEmbeddableFactory(); + const optionsListControlFactory = optionsListFactoryStub as unknown as ControlFactory; + optionsListControlFactory.getDefaultInput = () => ({}); + const mockEmbeddable = (await optionsListControlFactory.create({ + ...mockOptionsListEmbeddableInput, + ...partialState?.explicitInput, + })) as OptionsListEmbeddable; + mockEmbeddable.getOutput = jest.fn().mockReturnValue(mockOptionsListOutput); + + const mockReduxEmbeddableTools = createReduxEmbeddableTools({ + embeddable: mockEmbeddable, + reducers: optionsListReducers, + initialComponentState: { ...mockOptionsListComponentState, ...partialState?.componentState, }, - explicitInput: { - ...mockOptionsListEmbeddableInput, - ...partialState?.explicitInput, - }, - output: { - ...mockOptionsListOutput, - ...partialState?.output, - }, - } as OptionsListReduxState; + }); - return { - actions: {}, - useEmbeddableDispatch: () => {}, - useEmbeddableSelector: (selector: any) => selector(mockReduxState), - } as unknown as ReduxEmbeddableContext; + return mockReduxEmbeddableTools; }; diff --git a/src/plugins/controls/common/options_list/types.ts b/src/plugins/controls/common/options_list/types.ts index 25db6c50349c4..5a0080039e21a 100644 --- a/src/plugins/controls/common/options_list/types.ts +++ b/src/plugins/controls/common/options_list/types.ts @@ -15,8 +15,12 @@ export const OPTIONS_LIST_CONTROL = 'optionsListControl'; export interface OptionsListEmbeddableInput extends DataControlInput { selectedOptions?: string[]; + existsSelected?: boolean; runPastTimeout?: boolean; singleSelect?: boolean; + hideExclude?: boolean; + hideExists?: boolean; + exclude?: boolean; } export type OptionsListField = FieldSpec & { diff --git a/src/plugins/controls/public/options_list/components/options_list.scss b/src/plugins/controls/public/options_list/components/options_list.scss index 53ad3990cd371..928a10f3651b8 100644 --- a/src/plugins/controls/public/options_list/components/options_list.scss +++ b/src/plugins/controls/public/options_list/components/options_list.scss @@ -35,6 +35,16 @@ font-weight: 300; } +.optionsList__existsFilter { + font-style: italic; +} + +.optionsList__negateLabel { + font-weight: bold; + font-size: $euiSizeM; + color: $euiColorDanger; +} + .optionsList__ignoredBadge { margin-left: $euiSizeS; } diff --git a/src/plugins/controls/public/options_list/components/options_list_control.test.tsx b/src/plugins/controls/public/options_list/components/options_list_control.test.tsx new file mode 100644 index 0000000000000..a4d5028f0f7be --- /dev/null +++ b/src/plugins/controls/public/options_list/components/options_list_control.test.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { mountWithIntl } from '@kbn/test-jest-helpers'; +import { findTestSubject } from '@elastic/eui/lib/test'; + +import { OptionsListComponentState, OptionsListReduxState } from '../types'; +import { ControlOutput, OptionsListEmbeddableInput } from '../..'; +import { mockOptionsListReduxEmbeddableTools } from '../../../common/mocks'; +import { OptionsListControl } from './options_list_control'; +import { BehaviorSubject } from 'rxjs'; + +describe('Options list control', () => { + const defaultProps = { + typeaheadSubject: new BehaviorSubject(''), + }; + + interface MountOptions { + componentState: Partial; + explicitInput: Partial; + output: Partial; + } + + async function mountComponent(options?: Partial) { + const mockReduxEmbeddableTools = await mockOptionsListReduxEmbeddableTools({ + componentState: options?.componentState ?? {}, + explicitInput: options?.explicitInput ?? {}, + output: options?.output ?? {}, + } as Partial); + + return mountWithIntl( + + + + ); + } + + test('if exclude = false and existsSelected = true, then the option should read "Exists"', async () => { + const control = await mountComponent({ + explicitInput: { id: 'testExists', exclude: false, existsSelected: true }, + }); + const existsOption = findTestSubject(control, 'optionsList-control-testExists'); + expect(existsOption.text()).toBe('Exists'); + }); + + test('if exclude = true and existsSelected = true, then the option should read "Does not exist"', async () => { + const control = await mountComponent({ + explicitInput: { id: 'testDoesNotExist', exclude: true, existsSelected: true }, + }); + const existsOption = findTestSubject(control, 'optionsList-control-testDoesNotExist'); + expect(existsOption.text()).toBe('DOES NOT Exist'); + }); +}); diff --git a/src/plugins/controls/public/options_list/components/options_list_control.tsx b/src/plugins/controls/public/options_list/components/options_list_control.tsx index 7eb8fe783cc0b..1f19382ab506b 100644 --- a/src/plugins/controls/public/options_list/components/options_list_control.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_control.tsx @@ -40,8 +40,10 @@ export const OptionsListControl = ({ typeaheadSubject }: { typeaheadSubject: Sub const validSelections = select((state) => state.componentState.validSelections); const selectedOptions = select((state) => state.explicitInput.selectedOptions); + const existsSelected = select((state) => state.explicitInput.existsSelected); const controlStyle = select((state) => state.explicitInput.controlStyle); const singleSelect = select((state) => state.explicitInput.singleSelect); + const exclude = select((state) => state.explicitInput.exclude); const id = select((state) => state.explicitInput.id); const loading = select((state) => state.output.loading); @@ -75,18 +77,35 @@ export const OptionsListControl = ({ typeaheadSubject }: { typeaheadSubject: Sub validSelectionsCount: validSelections?.length, selectionDisplayNode: ( <> - {validSelections && ( - {validSelections?.join(OptionsListStrings.control.getSeparator())} + {exclude && ( + <> + + {existsSelected + ? OptionsListStrings.control.getExcludeExists() + : OptionsListStrings.control.getNegate()} + {' '} + )} - {invalidSelections && ( - - {invalidSelections.join(OptionsListStrings.control.getSeparator())} + {existsSelected ? ( + + {OptionsListStrings.controlAndPopover.getExists(+Boolean(exclude))} + ) : ( + <> + {validSelections && ( + {validSelections?.join(OptionsListStrings.control.getSeparator())} + )} + {invalidSelections && ( + + {invalidSelections.join(OptionsListStrings.control.getSeparator())} + + )} + )} ), }; - }, [validSelections, invalidSelections]); + }, [exclude, existsSelected, validSelections, invalidSelections]); const button = (
@@ -103,7 +122,9 @@ export const OptionsListControl = ({ typeaheadSubject }: { typeaheadSubject: Sub numActiveFilters={validSelectionsCount} hasActiveFilters={Boolean(validSelectionsCount)} > - {hasSelections ? selectionDisplayNode : OptionsListStrings.control.getPlaceholder()} + {hasSelections || existsSelected + ? selectionDisplayNode + : OptionsListStrings.control.getPlaceholder()}
); @@ -124,6 +145,7 @@ export const OptionsListControl = ({ typeaheadSubject }: { typeaheadSubject: Sub className="optionsList__popoverOverride" closePopover={() => setIsPopoverOpen(false)} anchorClassName="optionsList__anchorOverride" + aria-labelledby={`control-popover-${id}`} > diff --git a/src/plugins/controls/public/options_list/components/options_list_editor_options.tsx b/src/plugins/controls/public/options_list/components/options_list_editor_options.tsx index 0cd96232b714e..d19c907a09f4b 100644 --- a/src/plugins/controls/public/options_list/components/options_list_editor_options.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_editor_options.tsx @@ -8,14 +8,28 @@ import React, { useState } from 'react'; -import { EuiFormRow, EuiSwitch } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiIconTip, + EuiSwitch, + EuiSwitchEvent, +} from '@elastic/eui'; +import { css } from '@emotion/react'; import { OptionsListStrings } from './options_list_strings'; import { ControlEditorProps, OptionsListEmbeddableInput } from '../..'; - interface OptionsListEditorState { singleSelect?: boolean; runPastTimeout?: boolean; + hideExclude?: boolean; + hideExists?: boolean; +} + +interface SwitchProps { + checked: boolean; + onChange: (event: EuiSwitchEvent) => void; } export const OptionsListEditorOptions = ({ @@ -25,8 +39,34 @@ export const OptionsListEditorOptions = ({ const [state, setState] = useState({ singleSelect: initialInput?.singleSelect, runPastTimeout: initialInput?.runPastTimeout, + hideExclude: initialInput?.hideExclude, + hideExists: initialInput?.hideExists, }); + const SwitchWithTooltip = ({ + switchProps, + label, + tooltip, + }: { + switchProps: SwitchProps; + label: string; + tooltip: string; + }) => ( + + + + + + + + + ); + return ( <> @@ -41,11 +81,39 @@ export const OptionsListEditorOptions = ({ { - onChange({ runPastTimeout: !state.runPastTimeout }); - setState((s) => ({ ...s, runPastTimeout: !s.runPastTimeout })); + onChange({ hideExclude: !state.hideExclude }); + setState((s) => ({ ...s, hideExclude: !s.hideExclude })); + if (initialInput?.exclude) onChange({ exclude: false }); + }} + /> + + + { + onChange({ hideExists: !state.hideExists }); + setState((s) => ({ ...s, hideExists: !s.hideExists })); + if (initialInput?.existsSelected) onChange({ existsSelected: false }); + }, + }} + /> + + + { + onChange({ runPastTimeout: !state.runPastTimeout }); + setState((s) => ({ ...s, runPastTimeout: !s.runPastTimeout })); + }, }} /> diff --git a/src/plugins/controls/public/options_list/components/options_list_popover.test.tsx b/src/plugins/controls/public/options_list/components/options_list_popover.test.tsx index f30d9a785ffec..1ee6de1c45763 100644 --- a/src/plugins/controls/public/options_list/components/options_list_popover.test.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_popover.test.tsx @@ -11,12 +11,11 @@ import { ReactWrapper } from 'enzyme'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { EmbeddableReduxContext } from '@kbn/presentation-util-plugin/public/redux_embeddables/use_redux_embeddable_context'; import { OptionsListPopover, OptionsListPopoverProps } from './options_list_popover'; import { OptionsListComponentState, OptionsListReduxState } from '../types'; import { ControlOutput, OptionsListEmbeddableInput } from '../..'; -import { mockOptionsListContext } from '../../../common/mocks'; +import { mockOptionsListReduxEmbeddableTools } from '../../../common/mocks'; describe('Options list popover', () => { const defaultProps = { @@ -31,18 +30,18 @@ describe('Options list popover', () => { popoverProps: Partial; } - function mountComponent(options?: Partial) { + async function mountComponent(options?: Partial) { const compProps = { ...defaultProps, ...(options?.popoverProps ?? {}) }; - const context = mockOptionsListContext({ + const mockReduxEmbeddableTools = await mockOptionsListReduxEmbeddableTools({ componentState: options?.componentState ?? {}, explicitInput: options?.explicitInput ?? {}, output: options?.output ?? {}, } as Partial); return mountWithIntl( - + - + ); } @@ -54,19 +53,19 @@ describe('Options list popover', () => { showOnlySelectedButton.simulate('click'); }; - test('available options list width responds to container size', () => { - let popover = mountComponent({ popoverProps: { width: 301 } }); + test('available options list width responds to container size', async () => { + let popover = await mountComponent({ popoverProps: { width: 301 } }); let availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); expect(availableOptionsDiv.getDOMNode().getAttribute('style')).toBe('width: 301px;'); // the div cannot be smaller than 301 pixels wide - popover = mountComponent({ popoverProps: { width: 300 } }); + popover = await mountComponent({ popoverProps: { width: 300 } }); availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); expect(availableOptionsDiv.getDOMNode().getAttribute('style')).toBe(null); }); - test('no available options', () => { - const popover = mountComponent({ componentState: { availableOptions: [] } }); + test('no available options', async () => { + const popover = await mountComponent({ componentState: { availableOptions: [] } }); const availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); const noOptionsDiv = findTestSubject( availableOptionsDiv, @@ -75,8 +74,8 @@ describe('Options list popover', () => { expect(noOptionsDiv.exists()).toBeTruthy(); }); - test('display error message when the show only selected toggle is true but there are no selections', () => { - const popover = mountComponent(); + test('display error message when the show only selected toggle is true but there are no selections', async () => { + const popover = await mountComponent(); clickShowOnlySelections(popover); const availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); const noSelectionsDiv = findTestSubject( @@ -86,15 +85,88 @@ describe('Options list popover', () => { expect(noSelectionsDiv.exists()).toBeTruthy(); }); - test('show only selected options', () => { + test('show only selected options', async () => { const selections = ['woof', 'bark']; - const popover = mountComponent({ + const popover = await mountComponent({ explicitInput: { selectedOptions: selections }, }); clickShowOnlySelections(popover); + const availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); + availableOptionsDiv + .childAt(0) + .children() + .forEach((child, i) => { + expect(child.text()).toBe(selections[i]); + }); + }); + + test('should default to exclude = false', async () => { + const popover = await mountComponent(); + const includeButton = findTestSubject(popover, 'optionsList__includeResults'); + const excludeButton = findTestSubject(popover, 'optionsList__excludeResults'); + expect(includeButton.prop('checked')).toBe(true); + expect(excludeButton.prop('checked')).toBeFalsy(); + }); + + test('if exclude = true, select appropriate button in button group', async () => { + const popover = await mountComponent({ + explicitInput: { exclude: true }, + }); + const includeButton = findTestSubject(popover, 'optionsList__includeResults'); + const excludeButton = findTestSubject(popover, 'optionsList__excludeResults'); + expect(includeButton.prop('checked')).toBeFalsy(); + expect(excludeButton.prop('checked')).toBe(true); + }); + + test('clicking another option unselects "Exists"', async () => { + const popover = await mountComponent({ + explicitInput: { existsSelected: true }, + }); + const woofOption = findTestSubject(popover, 'optionsList-control-selection-woof'); + woofOption.simulate('click'); + const availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); availableOptionsDiv.children().forEach((child, i) => { - expect(child.text()).toBe(selections[i]); + if (child.text() === 'woof') expect(child.prop('checked')).toBe('on'); + else expect(child.prop('checked')).toBeFalsy(); }); }); + + test('clicking "Exists" unselects all other selections', async () => { + const selections = ['woof', 'bark']; + const popover = await mountComponent({ + explicitInput: { existsSelected: false, selectedOptions: selections }, + }); + const existsOption = findTestSubject(popover, 'optionsList-control-selection-exists'); + let availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); + availableOptionsDiv.children().forEach((child, i) => { + if (selections.includes(child.text())) expect(child.prop('checked')).toBe('on'); + else expect(child.prop('checked')).toBeFalsy(); + }); + + existsOption.simulate('click'); + availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); + availableOptionsDiv.children().forEach((child, i) => { + if (child.text() === 'Exists (*)') expect(child.prop('checked')).toBe('on'); + else expect(child.prop('checked')).toBeFalsy(); + }); + }); + + test('if existsSelected = false and no suggestions, then "Exists" does not show up', async () => { + const popover = await mountComponent({ + componentState: { availableOptions: [] }, + explicitInput: { existsSelected: false }, + }); + const existsOption = findTestSubject(popover, 'optionsList-control-selection-exists'); + expect(existsOption.exists()).toBeFalsy(); + }); + + test('if existsSelected = true, "Exists" is the only option when "Show only selected options" is toggled', async () => { + const popover = await mountComponent({ + explicitInput: { existsSelected: true }, + }); + clickShowOnlySelections(popover); + const availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); + expect(availableOptionsDiv.children().at(0).text()).toBe('Exists'); + }); }); diff --git a/src/plugins/controls/public/options_list/components/options_list_popover.tsx b/src/plugins/controls/public/options_list/components/options_list_popover.tsx index 8863a3d1978a3..bc1e62fccfda7 100644 --- a/src/plugins/controls/public/options_list/components/options_list_popover.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_popover.tsx @@ -6,28 +6,19 @@ * Side Public License, v 1. */ -import React, { useMemo, useState } from 'react'; +import React, { useState } from 'react'; import { isEmpty } from 'lodash'; -import { - EuiFilterSelectItem, - EuiPopoverTitle, - EuiFieldSearch, - EuiButtonIcon, - EuiFlexGroup, - EuiFlexItem, - EuiFormRow, - EuiToolTip, - EuiSpacer, - EuiBadge, - EuiIcon, - EuiTitle, -} from '@elastic/eui'; +import { EuiPopoverTitle } from '@elastic/eui'; import { useReduxEmbeddableContext } from '@kbn/presentation-util-plugin/public'; -import { optionsListReducers } from '../options_list_reducers'; import { OptionsListReduxState } from '../types'; import { OptionsListStrings } from './options_list_strings'; +import { optionsListReducers } from '../options_list_reducers'; +import { OptionsListPopoverFooter } from './options_list_popover_footer'; +import { OptionsListPopoverActionBar } from './options_list_popover_action_bar'; +import { OptionsListPopoverSuggestions } from './options_list_popover_suggestions'; +import { OptionsListPopoverInvalidSelections } from './options_list_popover_invalid_selections'; export interface OptionsListPopoverProps { width: number; @@ -36,218 +27,49 @@ export interface OptionsListPopoverProps { export const OptionsListPopover = ({ width, updateSearchString }: OptionsListPopoverProps) => { // Redux embeddable container Context - const { - useEmbeddableDispatch, - useEmbeddableSelector: select, - actions: { selectOption, deselectOption, clearSelections, replaceSelection }, - } = useReduxEmbeddableContext(); - - const dispatch = useEmbeddableDispatch(); + const { useEmbeddableSelector: select } = useReduxEmbeddableContext< + OptionsListReduxState, + typeof optionsListReducers + >(); // Select current state from Redux using multiple selectors to avoid rerenders. const invalidSelections = select((state) => state.componentState.invalidSelections); - const totalCardinality = select((state) => state.componentState.totalCardinality); const availableOptions = select((state) => state.componentState.availableOptions); - const searchString = select((state) => state.componentState.searchString); const field = select((state) => state.componentState.field); - const selectedOptions = select((state) => state.explicitInput.selectedOptions); - const singleSelect = select((state) => state.explicitInput.singleSelect); + const hideExclude = select((state) => state.explicitInput.hideExclude); + const fieldName = select((state) => state.explicitInput.fieldName); const title = select((state) => state.explicitInput.title); - - const loading = select((state) => state.output.loading); - - // track selectedOptions and invalidSelections in sets for more efficient lookup - const selectedOptionsSet = useMemo(() => new Set(selectedOptions), [selectedOptions]); - const invalidSelectionsSet = useMemo( - () => new Set(invalidSelections), - [invalidSelections] - ); + const id = select((state) => state.explicitInput.id); const [showOnlySelected, setShowOnlySelected] = useState(false); return ( - <> + {title} {field?.type !== 'boolean' && ( -
- - - - updateSearchString(event.target.value)} - value={searchString.value} - data-test-subj="optionsList-control-search-input" - placeholder={ - totalCardinality - ? OptionsListStrings.popover.getTotalCardinalityPlaceholder(totalCardinality) - : undefined - } - /> - - - {invalidSelections && invalidSelections.length > 0 && ( - - - {invalidSelections.length} - - - )} - - - - dispatch(clearSelections({}))} - /> - - - - - setShowOnlySelected(!showOnlySelected)} - /> - - - - -
+ )}
300 ? width : undefined }} - className="optionsList__items" + className="optionsList __items" data-option-count={availableOptions?.length ?? 0} data-test-subj={`optionsList-control-available-options`} > - {!showOnlySelected && ( - <> - {availableOptions?.map((availableOption, index) => ( - { - if (singleSelect) { - dispatch(replaceSelection(availableOption)); - return; - } - if (selectedOptionsSet.has(availableOption)) { - dispatch(deselectOption(availableOption)); - return; - } - dispatch(selectOption(availableOption)); - }} - > - {`${availableOption}`} - - ))} - - {!loading && (!availableOptions || availableOptions.length === 0) && ( -
-
- - -

{OptionsListStrings.popover.getEmptyMessage()}

-
-
- )} - - {!isEmpty(invalidSelections) && ( - <> - - - - - <> - {invalidSelections?.map((ignoredSelection, index) => ( - dispatch(deselectOption(ignoredSelection))} - > - {`${ignoredSelection}`} - - ))} - - - )} - - )} - {showOnlySelected && ( - <> - {selectedOptions && - selectedOptions.map((availableOption, index) => ( - dispatch(deselectOption(availableOption))} - className={ - invalidSelectionsSet.has(availableOption) - ? 'optionsList__selectionInvalid' - : undefined - } - > - {`${availableOption}`} - - ))} - {(!selectedOptions || selectedOptions.length === 0) && ( -
-
- - -

{OptionsListStrings.popover.getSelectionsEmptyMessage()}

-
-
- )} - + + {!showOnlySelected && invalidSelections && !isEmpty(invalidSelections) && ( + )}
- + {!hideExclude && } +
); }; diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_action_bar.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_action_bar.tsx new file mode 100644 index 0000000000000..ad8e2eec26e43 --- /dev/null +++ b/src/plugins/controls/public/options_list/components/options_list_popover_action_bar.tsx @@ -0,0 +1,130 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { + EuiFieldSearch, + EuiButtonIcon, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiToolTip, + EuiBadge, +} from '@elastic/eui'; +import { useReduxEmbeddableContext } from '@kbn/presentation-util-plugin/public'; + +import { OptionsListReduxState } from '../types'; +import { OptionsListStrings } from './options_list_strings'; +import { optionsListReducers } from '../options_list_reducers'; + +interface OptionsListPopoverProps { + showOnlySelected: boolean; + setShowOnlySelected: (value: boolean) => void; + updateSearchString: (newSearchString: string) => void; +} + +export const OptionsListPopoverActionBar = ({ + showOnlySelected, + setShowOnlySelected, + updateSearchString, +}: OptionsListPopoverProps) => { + // Redux embeddable container Context + const { + useEmbeddableDispatch, + useEmbeddableSelector: select, + actions: { clearSelections }, + } = useReduxEmbeddableContext(); + const dispatch = useEmbeddableDispatch(); + + // Select current state from Redux using multiple selectors to avoid rerenders. + const invalidSelections = select((state) => state.componentState.invalidSelections); + const totalCardinality = select((state) => state.componentState.totalCardinality); + const searchString = select((state) => state.componentState.searchString); + + return ( +
+ + + + updateSearchString(event.target.value)} + value={searchString.value} + data-test-subj="optionsList-control-search-input" + placeholder={ + totalCardinality + ? OptionsListStrings.popover.getTotalCardinalityPlaceholder(totalCardinality) + : undefined + } + autoFocus={true} + /> + + + {(invalidSelections?.length ?? 0) > 0 && ( + + + {invalidSelections?.length} + + + )} + + + + dispatch(clearSelections({}))} + /> + + + + + setShowOnlySelected(!showOnlySelected)} + /> + + + + +
+ ); +}; diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_footer.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_footer.tsx new file mode 100644 index 0000000000000..8a51a33a31ba0 --- /dev/null +++ b/src/plugins/controls/public/options_list/components/options_list_popover_footer.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiPopoverFooter, EuiButtonGroup, useEuiBackgroundColor } from '@elastic/eui'; +import { css } from '@emotion/react'; +import { useReduxEmbeddableContext } from '@kbn/presentation-util-plugin/public'; + +import { OptionsListReduxState } from '../types'; +import { OptionsListStrings } from './options_list_strings'; +import { optionsListReducers } from '../options_list_reducers'; + +const aggregationToggleButtons = [ + { + id: 'optionsList__includeResults', + label: OptionsListStrings.popover.getIncludeLabel(), + }, + { + id: 'optionsList__excludeResults', + label: OptionsListStrings.popover.getExcludeLabel(), + }, +]; + +export const OptionsListPopoverFooter = () => { + // Redux embeddable container Context + const { + useEmbeddableDispatch, + useEmbeddableSelector: select, + actions: { setExclude }, + } = useReduxEmbeddableContext(); + const dispatch = useEmbeddableDispatch(); + + // Select current state from Redux using multiple selectors to avoid rerenders. + const exclude = select((state) => state.explicitInput.exclude); + + return ( + <> + + dispatch(setExclude(optionId === 'optionsList__excludeResults'))} + buttonSize="compressed" + data-test-subj="optionsList__includeExcludeButtonGroup" + /> + + + ); +}; diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_invalid_selections.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_invalid_selections.tsx new file mode 100644 index 0000000000000..1a6ec2176dd42 --- /dev/null +++ b/src/plugins/controls/public/options_list/components/options_list_popover_invalid_selections.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { EuiFilterSelectItem, EuiSpacer, EuiTitle } from '@elastic/eui'; +import { useReduxEmbeddableContext } from '@kbn/presentation-util-plugin/public'; + +import { OptionsListReduxState } from '../types'; +import { OptionsListStrings } from './options_list_strings'; +import { optionsListReducers } from '../options_list_reducers'; + +export const OptionsListPopoverInvalidSelections = () => { + // Redux embeddable container Context + const { + useEmbeddableDispatch, + useEmbeddableSelector: select, + actions: { deselectOption }, + } = useReduxEmbeddableContext(); + const dispatch = useEmbeddableDispatch(); + + // Select current state from Redux using multiple selectors to avoid rerenders. + const invalidSelections = select((state) => state.componentState.invalidSelections); + + return ( + <> + + + + + {invalidSelections?.map((ignoredSelection, index) => ( + dispatch(deselectOption(ignoredSelection))} + > + {`${ignoredSelection}`} + + ))} + + ); +}; diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx new file mode 100644 index 0000000000000..5ca609d6ac64d --- /dev/null +++ b/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx @@ -0,0 +1,123 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useMemo } from 'react'; + +import { EuiFilterSelectItem, EuiSpacer, EuiIcon } from '@elastic/eui'; +import { useReduxEmbeddableContext } from '@kbn/presentation-util-plugin/public'; + +import { OptionsListReduxState } from '../types'; +import { OptionsListStrings } from './options_list_strings'; +import { optionsListReducers } from '../options_list_reducers'; + +interface OptionsListPopoverSuggestionsProps { + showOnlySelected: boolean; +} + +export const OptionsListPopoverSuggestions = ({ + showOnlySelected, +}: OptionsListPopoverSuggestionsProps) => { + // Redux embeddable container Context + const { + useEmbeddableDispatch, + useEmbeddableSelector: select, + actions: { replaceSelection, deselectOption, selectOption, selectExists }, + } = useReduxEmbeddableContext(); + const dispatch = useEmbeddableDispatch(); + + // Select current state from Redux using multiple selectors to avoid rerenders. + const invalidSelections = select((state) => state.componentState.invalidSelections); + const availableOptions = select((state) => state.componentState.availableOptions); + + const selectedOptions = select((state) => state.explicitInput.selectedOptions); + const existsSelected = select((state) => state.explicitInput.existsSelected); + const singleSelect = select((state) => state.explicitInput.singleSelect); + const hideExists = select((state) => state.explicitInput.hideExists); + + const loading = select((state) => state.output.loading); + + // track selectedOptions and invalidSelections in sets for more efficient lookup + const selectedOptionsSet = useMemo(() => new Set(selectedOptions), [selectedOptions]); + const invalidSelectionsSet = useMemo( + () => new Set(invalidSelections), + [invalidSelections] + ); + const suggestions = showOnlySelected ? selectedOptions : availableOptions; + + if ( + !loading && + (!suggestions || suggestions.length === 0) && + !(showOnlySelected && existsSelected) + ) { + return ( +
+
+ + +

+ {showOnlySelected + ? OptionsListStrings.popover.getSelectionsEmptyMessage() + : OptionsListStrings.popover.getEmptyMessage()} +

+
+
+ ); + } + + return ( + <> + {!hideExists && !(showOnlySelected && !existsSelected) && ( + { + dispatch(selectExists(!Boolean(existsSelected))); + }} + className="optionsList__existsFilter" + > + {OptionsListStrings.controlAndPopover.getExists()} + + )} + {suggestions?.map((suggestion, index) => ( + { + if (showOnlySelected) { + dispatch(deselectOption(suggestion)); + return; + } + if (singleSelect) { + dispatch(replaceSelection(suggestion)); + return; + } + if (selectedOptionsSet.has(suggestion)) { + dispatch(deselectOption(suggestion)); + return; + } + dispatch(selectOption(suggestion)); + }} + className={ + showOnlySelected && invalidSelectionsSet.has(suggestion) + ? 'optionsList__selectionInvalid' + : undefined + } + > + {`${suggestion}`} + + ))} + + ); +}; diff --git a/src/plugins/controls/public/options_list/components/options_list_strings.ts b/src/plugins/controls/public/options_list/components/options_list_strings.ts index 8e3d55ae6b764..5db1ddeae21b0 100644 --- a/src/plugins/controls/public/options_list/components/options_list_strings.ts +++ b/src/plugins/controls/public/options_list/components/options_list_strings.ts @@ -18,6 +18,14 @@ export const OptionsListStrings = { i18n.translate('controls.optionsList.control.placeholder', { defaultMessage: 'Any', }), + getNegate: () => + i18n.translate('controls.optionsList.control.negate', { + defaultMessage: 'NOT', + }), + getExcludeExists: () => + i18n.translate('controls.optionsList.control.excludeExists', { + defaultMessage: 'DOES NOT', + }), }, editor: { getAllowMultiselectTitle: () => @@ -26,10 +34,32 @@ export const OptionsListStrings = { }), getRunPastTimeoutTitle: () => i18n.translate('controls.optionsList.editor.runPastTimeout', { - defaultMessage: 'Run past timeout', + defaultMessage: 'Ignore timeout for results', + }), + getRunPastTimeoutTooltip: () => + i18n.translate('controls.optionsList.editor.runPastTimeout.tooltip', { + defaultMessage: + 'Wait to display results until the list is complete. This setting is useful for large data sets, but the results might take longer to populate.', + }), + getHideExcludeTitle: () => + i18n.translate('controls.optionsList.editor.hideExclude', { + defaultMessage: 'Allow selections to be excluded', + }), + getHideExistsQueryTitle: () => + i18n.translate('controls.optionsList.editor.hideExistsQuery', { + defaultMessage: 'Allow exists query', + }), + getHideExistsQueryTooltip: () => + i18n.translate('controls.optionsList.editor.hideExistsQueryTooltip', { + defaultMessage: 'Returns the documents that contain an indexed value for the field.', }), }, popover: { + getAriaLabel: (fieldName: string) => + i18n.translate('controls.optionsList.popover.ariaLabel', { + defaultMessage: 'Popover for {fieldName} control', + values: { fieldName }, + }), getLoadingMessage: () => i18n.translate('controls.optionsList.popover.loading', { defaultMessage: 'Loading options', @@ -86,5 +116,24 @@ export const OptionsListStrings = { '{selectedOptions} selected {selectedOptions, plural, one {option} other {options}} {selectedOptions, plural, one {is} other {are}} ignored because {selectedOptions, plural, one {it is} other {they are}} no longer in the data.', values: { selectedOptions }, }), + getIncludeLabel: () => + i18n.translate('controls.optionsList.popover.includeLabel', { + defaultMessage: 'Include', + }), + getExcludeLabel: () => + i18n.translate('controls.optionsList.popover.excludeLabel', { + defaultMessage: 'Exclude', + }), + getIncludeExcludeLegend: () => + i18n.translate('controls.optionsList.popover.excludeOptionsLegend', { + defaultMessage: 'Include or exclude selections', + }), + }, + controlAndPopover: { + getExists: (negate: number = +false) => + i18n.translate('controls.optionsList.controlAndPopover.exists', { + defaultMessage: '{negate, plural, one {Exist} other {Exists}}', + values: { negate }, + }), }, }; diff --git a/src/plugins/controls/public/options_list/embeddable/options_list_embeddable.tsx b/src/plugins/controls/public/options_list/embeddable/options_list_embeddable.tsx index 292e7cb6b0597..76256bd1a75b9 100644 --- a/src/plugins/controls/public/options_list/embeddable/options_list_embeddable.tsx +++ b/src/plugins/controls/public/options_list/embeddable/options_list_embeddable.tsx @@ -21,6 +21,7 @@ import { buildPhraseFilter, buildPhrasesFilter, COMPARE_ALL_OPTIONS, + buildExistsFilter, } from '@kbn/es-query'; import { ReduxEmbeddableTools, ReduxEmbeddablePackage } from '@kbn/presentation-util-plugin/public'; import { DataView } from '@kbn/data-views-plugin/public'; @@ -128,10 +129,12 @@ export class OptionsListEmbeddable extends Embeddable ({ validate: !Boolean(newInput.ignoreParentSettings?.ignoreValidations), lastReloadRequestTime: newInput.lastReloadRequestTime, + existsSelected: newInput.existsSelected, dataViewId: newInput.dataViewId, fieldName: newInput.fieldName, timeRange: newInput.timeRange, timeslice: newInput.timeslice, + exclude: newInput.exclude, filters: newInput.filters, query: newInput.query, })), @@ -153,7 +156,14 @@ export class OptionsListEmbeddable extends Embeddable isEqual(a.selectedOptions, b.selectedOptions))) + .pipe( + distinctUntilChanged( + (a, b) => + a.exclude === b.exclude && + a.existsSelected === b.existsSelected && + isEqual(a.selectedOptions, b.selectedOptions) + ) + ) .subscribe(async ({ selectedOptions: newSelectedOptions }) => { const { actions: { @@ -261,7 +271,7 @@ export class OptionsListEmbeddable extends Embeddable { const { getState } = this.reduxEmbeddableTools; const { validSelections } = getState().componentState ?? {}; + const { existsSelected } = getState().explicitInput ?? {}; + const { exclude } = this.getInput(); - if (!validSelections || isEmpty(validSelections)) { + if ((!validSelections || isEmpty(validSelections)) && !existsSelected) { return []; } const { dataView, field } = await this.getCurrentDataViewAndField(); if (!dataView || !field) return; - let newFilter: Filter; - if (validSelections.length === 1) { - newFilter = buildPhraseFilter(field, validSelections[0], dataView); - } else { - newFilter = buildPhrasesFilter(field, validSelections, dataView); + let newFilter: Filter | undefined; + if (existsSelected) { + newFilter = buildExistsFilter(field, dataView); + } else if (validSelections) { + if (validSelections.length === 1) { + newFilter = buildPhraseFilter(field, validSelections[0], dataView); + } else { + newFilter = buildPhrasesFilter(field, validSelections, dataView); + } } + if (!newFilter) return []; newFilter.meta.key = field?.name; + if (exclude) newFilter.meta.negate = true; return [newFilter]; }; diff --git a/src/plugins/controls/public/options_list/options_list_reducers.ts b/src/plugins/controls/public/options_list/options_list_reducers.ts index 2a0c69126c135..731ae4c8eb507 100644 --- a/src/plugins/controls/public/options_list/options_list_reducers.ts +++ b/src/plugins/controls/public/options_list/options_list_reducers.ts @@ -51,8 +51,17 @@ export const optionsListReducers = { state.componentState.searchString.valid = getIpRangeQuery(action.payload).validSearch; } }, + selectExists: (state: WritableDraft, action: PayloadAction) => { + if (action.payload) { + state.explicitInput.existsSelected = true; + state.explicitInput.selectedOptions = []; + } else { + state.explicitInput.existsSelected = false; + } + }, selectOption: (state: WritableDraft, action: PayloadAction) => { if (!state.explicitInput.selectedOptions) state.explicitInput.selectedOptions = []; + if (state.explicitInput.existsSelected) state.explicitInput.existsSelected = false; state.explicitInput.selectedOptions?.push(action.payload); }, replaceSelection: ( @@ -62,8 +71,12 @@ export const optionsListReducers = { state.explicitInput.selectedOptions = [action.payload]; }, clearSelections: (state: WritableDraft) => { + if (state.explicitInput.existsSelected) state.explicitInput.existsSelected = false; if (state.explicitInput.selectedOptions) state.explicitInput.selectedOptions = []; }, + setExclude: (state: WritableDraft, action: PayloadAction) => { + state.explicitInput.exclude = action.payload; + }, clearValidAndInvalidSelections: (state: WritableDraft) => { state.componentState.invalidSelections = []; state.componentState.validSelections = []; diff --git a/src/plugins/controls/public/services/options_list/options_list_service.ts b/src/plugins/controls/public/services/options_list/options_list_service.ts index a537e7534a3b8..27867b5724cec 100644 --- a/src/plugins/controls/public/services/options_list/options_list_service.ts +++ b/src/plugins/controls/public/services/options_list/options_list_service.ts @@ -82,6 +82,7 @@ class OptionsListService implements ControlsOptionsListService { const timeFilter = timeRange ? timeService.createFilter(dataView, timeRange) : undefined; const filtersToUse = [...(filters ?? []), ...(timeFilter ? [timeFilter] : [])]; const esFilters = [buildEsQuery(dataView, query ?? [], filtersToUse ?? [])]; + return { ...passThroughProps, filters: esFilters, diff --git a/src/plugins/controls/server/options_list/options_list_queries.ts b/src/plugins/controls/server/options_list/options_list_queries.ts index d1fa89bbc9358..4a381aeac64c1 100644 --- a/src/plugins/controls/server/options_list/options_list_queries.ts +++ b/src/plugins/controls/server/options_list/options_list_queries.ts @@ -27,11 +27,13 @@ interface EsBucket { */ export const getValidationAggregationBuilder: () => OptionsListAggregationBuilder = () => ({ buildAggregation: ({ selectedOptions, fieldName }: OptionsListRequestBody) => { - const selectedOptionsFilters = selectedOptions?.reduce((acc, currentOption) => { - acc[currentOption] = { match: { [fieldName]: currentOption } }; - return acc; - }, {} as { [key: string]: { match: { [key: string]: string } } }); - + let selectedOptionsFilters; + if (selectedOptions) { + selectedOptionsFilters = selectedOptions.reduce((acc, currentOption) => { + acc[currentOption] = { match: { [fieldName]: currentOption } }; + return acc; + }, {} as { [key: string]: { match: { [key: string]: string } } }); + } return selectedOptionsFilters && !isEmpty(selectedOptionsFilters) ? { filters: { @@ -44,6 +46,7 @@ export const getValidationAggregationBuilder: () => OptionsListAggregationBuilde const rawInvalidSuggestions = get(rawEsResult, 'aggregations.validation.buckets') as { [key: string]: { doc_count: number }; }; + return rawInvalidSuggestions && !isEmpty(rawInvalidSuggestions) ? Object.entries(rawInvalidSuggestions) ?.filter(([, value]) => value?.doc_count === 0) diff --git a/src/plugins/controls/server/options_list/options_list_suggestions_route.ts b/src/plugins/controls/server/options_list/options_list_suggestions_route.ts index c9af30bb07b82..fe2218c3f7135 100644 --- a/src/plugins/controls/server/options_list/options_list_suggestions_route.ts +++ b/src/plugins/controls/server/options_list/options_list_suggestions_route.ts @@ -107,7 +107,6 @@ export const setupOptionsListSuggestionsRoute = ( validation: builtValidationAggregation, } : {}; - const body: SearchRequest['body'] = { size: 0, ...timeoutSettings, @@ -138,7 +137,6 @@ export const setupOptionsListSuggestionsRoute = ( const totalCardinality = get(rawEsResult, 'aggregations.unique_terms.value'); const suggestions = suggestionBuilder.parse(rawEsResult); const invalidSelections = validationBuilder.parse(rawEsResult); - return { suggestions, totalCardinality, diff --git a/src/plugins/controls/tsconfig.json b/src/plugins/controls/tsconfig.json index 5a17afc931340..75fa7069996ac 100644 --- a/src/plugins/controls/tsconfig.json +++ b/src/plugins/controls/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "extraPublicDirs": ["common"], "include": [ @@ -16,7 +15,7 @@ "../../../typings/**/*", "./jest_setup.ts" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../saved_objects/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, diff --git a/src/plugins/custom_integrations/common/language_integrations.ts b/src/plugins/custom_integrations/common/language_integrations.ts index 9ba914c02fd0d..8a24295096b40 100644 --- a/src/plugins/custom_integrations/common/language_integrations.ts +++ b/src/plugins/custom_integrations/common/language_integrations.ts @@ -37,9 +37,9 @@ export const languageIntegrations: LanguageIntegration[] = [ description: i18n.translate('customIntegrations.languageclients.JavascriptDescription', { defaultMessage: 'Index data to Elasticsearch with the JavaScript client.', }), - docUrlTemplate: `${ELASTICSEARCH_CLIENT_URL}/javascript-api/{branch}/introduction.html`, + docUrlTemplate: '', integrationsAppUrl: `/app/integrations/language_clients/javascript/overview`, - exportLanguageUiComponent: false, + exportLanguageUiComponent: true, }, { id: 'ruby', diff --git a/src/plugins/custom_integrations/public/components/fleet_integration/elasticsearch_js/elasticsearch_js_readme.tsx b/src/plugins/custom_integrations/public/components/fleet_integration/elasticsearch_js/elasticsearch_js_readme.tsx new file mode 100644 index 0000000000000..0202782efe436 --- /dev/null +++ b/src/plugins/custom_integrations/public/components/fleet_integration/elasticsearch_js/elasticsearch_js_readme.tsx @@ -0,0 +1,204 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useState } from 'react'; + +// eslint-disable-next-line @kbn/eslint/module_migration +import styled from 'styled-components'; +import cuid from 'cuid'; + +import { + EuiButton, + EuiCode, + EuiCodeBlock, + EuiFlexGroup, + EuiFlexItem, + EuiPage, + EuiPageBody, + EuiPageHeader, + EuiPageSection, + EuiSpacer, + EuiText, + EuiTitle, + EuiPanel, + EuiImage, +} from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { euiThemeVars } from '@kbn/ui-theme'; +import icon from '../../../assets/language_clients/nodejs.svg'; + +const CenterColumn = styled(EuiFlexItem)` + max-width: 740px; +`; + +const FixedHeader = styled.div` + width: 100%; + height: 196px; + border-bottom: 1px solid ${euiThemeVars.euiColorLightShade}; +`; + +const IconPanel = styled(EuiPanel)` + padding: ${(props) => props.theme.eui.euiSizeXL}; + width: ${(props) => + parseFloat(props.theme.eui.euiSize) * 6 + parseFloat(props.theme.eui.euiSizeXL) * 2}px; + svg, + img { + height: ${(props) => parseFloat(props.theme.eui.euiSize) * 6}px; + width: ${(props) => parseFloat(props.theme.eui.euiSize) * 6}px; + } + .euiFlexItem { + height: ${(props) => parseFloat(props.theme.eui.euiSize) * 6}px; + justify-content: center; + } +`; + +const TopFlexGroup = styled(EuiFlexGroup)` + max-width: 1150px; + margin-left: auto; + margin-right: auto; + padding: calc(${euiThemeVars.euiSizeXL} * 2) ${euiThemeVars.euiSizeM} 0 ${euiThemeVars.euiSizeM}; +`; + +export const ElasticsearchJsClientReadme = () => { + const [apiKey, setApiKey] = useState(null); + + return ( + <> + + + + + + + + + +

+ +

+
+
+
+
+ + + + + + + + + + } + /> + + + + +

+ +

+
+ + + + + {`# Grab the Elasticsearch JavaScript client from NPM and install it in your project \n`} + {`$ npm install @elastic/elasticsearch@`} + +
+ + + +

+ +

+
+ + + + + + + + + + setApiKey(cuid())} disabled={!!apiKey}> + Generate API key + + + + {apiKey && ( + + + {apiKey} + + + )} + +
+ + + +

+ +

+
+ + + index.js, + }} + /> + + + + + + {` +// Import the client +const { Client } = require('@elastic/elasticsearch'); + +// Instantiate the client with an API key +const client = new Client({ + auth: { apiKey: '${apiKey || 'YOUR_API_KEY'}' } +}) + + `} + +
+
+
+
+
+ + ); +}; diff --git a/src/plugins/custom_integrations/public/components/fleet_integration/sample/sample_client_readme.tsx b/src/plugins/custom_integrations/public/components/fleet_integration/sample/sample_client_readme.tsx index c2ca0d62da689..7b932ca9c99f7 100644 --- a/src/plugins/custom_integrations/public/components/fleet_integration/sample/sample_client_readme.tsx +++ b/src/plugins/custom_integrations/public/components/fleet_integration/sample/sample_client_readme.tsx @@ -81,7 +81,7 @@ export const SampleClientReadme = () => {

diff --git a/src/plugins/custom_integrations/public/plugin.tsx b/src/plugins/custom_integrations/public/plugin.tsx index 827d31ce3749d..e1e10f327075c 100755 --- a/src/plugins/custom_integrations/public/plugin.tsx +++ b/src/plugins/custom_integrations/public/plugin.tsx @@ -23,6 +23,7 @@ import { import { CustomIntegrationsServicesProvider } from './services'; import { servicesFactory } from './services/kibana'; import { SampleClientReadme } from './components/fleet_integration/sample/sample_client_readme'; +import { ElasticsearchJsClientReadme } from './components/fleet_integration/elasticsearch_js/elasticsearch_js_readme'; export class CustomIntegrationsPlugin implements Plugin @@ -46,7 +47,10 @@ export class CustomIntegrationsPlugin ): CustomIntegrationsStart { const services = servicesFactory({ coreStart, startPlugins }); - const languageClientsUiComponents = { sample: SampleClientReadme }; + const languageClientsUiComponents = { + sample: SampleClientReadme, + javascript: ElasticsearchJsClientReadme, + }; const ContextProvider: React.FC = ({ children }) => ( diff --git a/src/plugins/custom_integrations/server/plugin.test.ts b/src/plugins/custom_integrations/server/plugin.test.ts index 0bfc014ed5cdd..324522a383d83 100644 --- a/src/plugins/custom_integrations/server/plugin.test.ts +++ b/src/plugins/custom_integrations/server/plugin.test.ts @@ -37,8 +37,7 @@ describe('CustomIntegrationsPlugin', () => { description: 'Index data to Elasticsearch with the JavaScript client.', type: 'ui_link', shipper: 'language_clients', - uiInternalPath: - 'https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/branch/introduction.html', + uiInternalPath: '/app/integrations/language_clients/javascript/overview', isBeta: false, icons: [{ type: 'svg', src: undefined }], categories: ['elastic_stack', 'custom', 'language_client'], @@ -150,7 +149,7 @@ describe('CustomIntegrationsPlugin', () => { uiExternalLink: 'https://serverlessrepo.aws.amazon.com/applications/eu-central-1/267093732750/elastic-serverless-forwarder', isBeta: false, - icons: [{ type: 'svg' }], + icons: [{ type: 'svg', src: undefined }], categories: ['aws', 'custom'], }, ]); diff --git a/src/plugins/custom_integrations/tsconfig.json b/src/plugins/custom_integrations/tsconfig.json index 4637688572bb1..0fee0d2156ce9 100644 --- a/src/plugins/custom_integrations/tsconfig.json +++ b/src/plugins/custom_integrations/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "../../../typings/**/*", @@ -13,7 +12,7 @@ "server/**/*", "storybook/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" } ] diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx index b6c3d2055d88c..7ad4b64324507 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx @@ -46,7 +46,7 @@ beforeEach(() => { application = applicationServiceMock.createStartContract(); }); -test('DashboardContainer initializes embeddables', async (done) => { +test('DashboardContainer initializes embeddables', (done) => { const initialInput = getSampleDashboardInput({ panels: { '123': getSampleDashboardPanel({ @@ -96,7 +96,7 @@ test('DashboardContainer.addNewEmbeddable', async () => { expect(embeddableInContainer.id).toBe(embeddable.id); }); -test('DashboardContainer.replacePanel', async (done) => { +test('DashboardContainer.replacePanel', (done) => { const ID = '123'; const initialInput = getSampleDashboardInput({ panels: { @@ -139,7 +139,7 @@ test('DashboardContainer.replacePanel', async (done) => { }); }); -test('Container view mode change propagates to existing children', async (done) => { +test('Container view mode change propagates to existing children', async () => { const initialInput = getSampleDashboardInput({ panels: { '123': getSampleDashboardPanel({ @@ -154,7 +154,6 @@ test('Container view mode change propagates to existing children', async (done) expect(embeddable.getInput().viewMode).toBe(ViewMode.VIEW); container.updateInput({ viewMode: ViewMode.EDIT }); expect(embeddable.getInput().viewMode).toBe(ViewMode.EDIT); - done(); }); test('Container view mode change propagates to new children', async () => { diff --git a/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx b/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx index 41e8b900d360f..6972a521026b4 100644 --- a/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx @@ -139,7 +139,7 @@ test.skip('DashboardGrid renders expanded panel', () => { }); // unhandled promise rejection: https://github.com/elastic/kibana/issues/112699 -test.skip('DashboardGrid unmount unsubscribes', async (done) => { +test.skip('DashboardGrid unmount unsubscribes', (done) => { const { props } = prepare(); const component = mountWithIntl( diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx index 27c86a8ff6c09..a7bad078b56eb 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx @@ -160,7 +160,7 @@ test.skip('renders exit full screen button when in full screen mode and empty sc }); // unhandled promise rejection: https://github.com/elastic/kibana/issues/112699 -test.skip('DashboardViewport unmount unsubscribes', async (done) => { +test.skip('DashboardViewport unmount unsubscribes', (done) => { const { props } = getProps(); const component = mount( diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts index 850c6f575904c..6095598ae3788 100644 --- a/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts +++ b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts @@ -13,6 +13,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import { BehaviorSubject, combineLatest, Observable, Subject } from 'rxjs'; import { ViewMode } from '@kbn/embeddable-plugin/public'; +import type { DataView } from '@kbn/data-plugin/common'; import type { IKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; import { @@ -225,7 +226,14 @@ export const useDashboardAppState = ({ dashboardContainer.controlGroup?.setRelevantDataViewId(newDataViewIds[0]); } // fetch all data views. These should be cached locally at this time so we will not need to query ES. - const allDataViews = await Promise.all(newDataViewIds.map((id) => dataViews.get(id))); + const responses = await Promise.allSettled(newDataViewIds.map((id) => dataViews.get(id))); + // Keep only fullfilled ones as each panel will handle the rejected ones already on their own + const allDataViews = responses + .filter( + (response): response is PromiseFulfilledResult => + response.status === 'fulfilled' + ) + .map(({ value }) => value); dashboardContainer.setAllDataViews(allDataViews); setDashboardAppState((s) => ({ ...s, dataViews: allDataViews })); }, diff --git a/src/plugins/dashboard/public/application/lib/help_menu_util.ts b/src/plugins/dashboard/public/application/lib/help_menu_util.ts index 9407fa31f545a..d93b2593386ba 100644 --- a/src/plugins/dashboard/public/application/lib/help_menu_util.ts +++ b/src/plugins/dashboard/public/application/lib/help_menu_util.ts @@ -12,9 +12,8 @@ import { pluginServices } from '../../services/plugin_services'; export function addHelpMenuToAppChrome() { const { chrome: { setHelpExtension }, - documentationLinks: { kibanaGuideDocLink }, + documentationLinks: { dashboardDocLink }, } = pluginServices.getServices(); - setHelpExtension({ appName: i18n.translate('dashboard.helpMenu.appName', { defaultMessage: 'Dashboards', @@ -22,7 +21,7 @@ export function addHelpMenuToAppChrome() { links: [ { linkType: 'documentation', - href: `${kibanaGuideDocLink}`, + href: `${dashboardDocLink}`, }, ], }); diff --git a/src/plugins/dashboard/public/services/documentation_links/documentation_links.stub.ts b/src/plugins/dashboard/public/services/documentation_links/documentation_links.stub.ts index 3fab07396b4ff..dfdd74bfe4184 100644 --- a/src/plugins/dashboard/public/services/documentation_links/documentation_links.stub.ts +++ b/src/plugins/dashboard/public/services/documentation_links/documentation_links.stub.ts @@ -18,5 +18,6 @@ export const documentationLinksServiceFactory: DocumentationLinksServiceFactory return { indexPatternsDocLink: corePluginMock.docLinks.links.indexPatterns.introduction, kibanaGuideDocLink: corePluginMock.docLinks.links.kibana.guide, + dashboardDocLink: corePluginMock.docLinks.links.dashboard.guide, }; }; diff --git a/src/plugins/dashboard/public/services/documentation_links/documentation_links_service.ts b/src/plugins/dashboard/public/services/documentation_links/documentation_links_service.ts index fe00d376675f6..eb65f639d57fe 100644 --- a/src/plugins/dashboard/public/services/documentation_links/documentation_links_service.ts +++ b/src/plugins/dashboard/public/services/documentation_links/documentation_links_service.ts @@ -21,14 +21,16 @@ export const documentationLinksServiceFactory: DocumentationLinksServiceFactory const { docLinks: { links: { - kibana: { guide }, + kibana, indexPatterns: { introduction }, + dashboard, }, }, } = coreStart; return { indexPatternsDocLink: introduction, - kibanaGuideDocLink: guide, + kibanaGuideDocLink: kibana.guide, + dashboardDocLink: dashboard.guide, }; }; diff --git a/src/plugins/dashboard/public/services/documentation_links/types.ts b/src/plugins/dashboard/public/services/documentation_links/types.ts index ee7e520471651..d47fbee6ed772 100644 --- a/src/plugins/dashboard/public/services/documentation_links/types.ts +++ b/src/plugins/dashboard/public/services/documentation_links/types.ts @@ -11,4 +11,5 @@ import { CoreStart } from '@kbn/core/public'; export interface DashboardDocumentationLinksService { indexPatternsDocLink: CoreStart['docLinks']['links']['indexPatterns']['introduction']; kibanaGuideDocLink: CoreStart['docLinks']['links']['kibana']['guide']; + dashboardDocLink: CoreStart['docLinks']['links']['dashboard']['guide']; } diff --git a/src/plugins/dashboard/tsconfig.json b/src/plugins/dashboard/tsconfig.json index 862bed9d667a0..96a2757909c12 100644 --- a/src/plugins/dashboard/tsconfig.json +++ b/src/plugins/dashboard/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, - "include": ["*.ts", ".storybook/**/*", "common/**/*", "public/**/*", "server/**/*"], - "references": [ + "include": ["*.ts", ".storybook/**/*.ts", "common/**/*", "public/**/*", "server/**/*"], + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../inspector/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, diff --git a/src/plugins/data/common/search/aggs/buckets/terms.ts b/src/plugins/data/common/search/aggs/buckets/terms.ts index 8314d2cd532de..7c2b6ad062a55 100644 --- a/src/plugins/data/common/search/aggs/buckets/terms.ts +++ b/src/plugins/data/common/search/aggs/buckets/terms.ts @@ -79,9 +79,13 @@ export const getTermsBucketAgg = () => id: 'terms', params: { id: format.id, + ...(format.params + ? { + params: format.params, + } + : {}), otherBucketLabel: agg.params.otherBucketLabel, missingBucketLabel: agg.params.missingBucketLabel, - ...format.params, }, }; }, diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index fa545d7648df1..f7542ef170965 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -169,6 +169,7 @@ export type { IEsError, Reason, WaitUntilNextSessionCompletesOptions, + SearchResponseWarning, } from './search'; export { @@ -270,6 +271,9 @@ export type { GlobalQueryStateFromUrl, } from './query'; +export type { ShardFailureRequest } from './shard_failure_modal'; +export { ShardFailureOpenModalButton } from './shard_failure_modal'; + export type { AggsStart } from './search/aggs'; export { getTime } from '../common'; diff --git a/src/plugins/data/public/query/filter_manager/lib/generate_mapping_chain.test.ts b/src/plugins/data/public/query/filter_manager/lib/generate_mapping_chain.test.ts index 7c86581b42a6b..e0cd902836df6 100644 --- a/src/plugins/data/public/query/filter_manager/lib/generate_mapping_chain.test.ts +++ b/src/plugins/data/public/query/filter_manager/lib/generate_mapping_chain.test.ts @@ -86,7 +86,7 @@ describe('filter manager utilities', () => { expect(result).toEqual({ key: 'test', value: 'example' }); }); - test('should throw an error if no functions match', async (done) => { + test('should throw an error if no functions match', async () => { const filter = buildEmptyFilter(true); mapping.throws(filter); @@ -98,7 +98,6 @@ describe('filter manager utilities', () => { } catch (err) { expect(err).toBeInstanceOf(Error); expect(err.message).toBe('No mappings have been found for filter.'); - done(); } }); }); diff --git a/src/plugins/data/public/query/filter_manager/lib/map_filter.test.ts b/src/plugins/data/public/query/filter_manager/lib/map_filter.test.ts index ff9c6d47660fd..e0bc31787df0f 100644 --- a/src/plugins/data/public/query/filter_manager/lib/map_filter.test.ts +++ b/src/plugins/data/public/query/filter_manager/lib/map_filter.test.ts @@ -54,7 +54,7 @@ describe('filter manager utilities', () => { expect(after.meta).toHaveProperty('negate', false); }); - test('should finish with a catch', async (done) => { + test('should finish with a catch', async () => { const before: any = { meta: { index: 'logstash-*' } }; try { @@ -62,8 +62,6 @@ describe('filter manager utilities', () => { } catch (e) { expect(e).toBeInstanceOf(Error); expect(e.message).toBe('No mappings have been found for filter.'); - - done(); } }); }); diff --git a/src/plugins/data/public/query/filter_manager/lib/mappers/map_exists.test.ts b/src/plugins/data/public/query/filter_manager/lib/mappers/map_exists.test.ts index 0e642b3f99dcc..b46f5b4c488e3 100644 --- a/src/plugins/data/public/query/filter_manager/lib/mappers/map_exists.test.ts +++ b/src/plugins/data/public/query/filter_manager/lib/mappers/map_exists.test.ts @@ -29,14 +29,13 @@ describe('filter manager utilities', () => { expect(result).toHaveProperty('value', 'exists'); }); - test('should return undefined for none matching', async (done) => { + test('should return undefined for none matching', async () => { const filter = buildEmptyFilter(true); try { mapQueryString(filter); } catch (e) { expect(e).toBe(filter); - done(); } }); }); diff --git a/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrase.test.ts b/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrase.test.ts index 88e819bb7f9a7..93d5547f1b9e6 100644 --- a/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrase.test.ts +++ b/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrase.test.ts @@ -23,7 +23,7 @@ describe('filter manager utilities', () => { expect(result).toHaveProperty('key', '_type'); }); - test('should return undefined for none matching', async (done) => { + test('should return undefined for none matching', async () => { const filter = { meta: { index: 'logstash-*' }, query: { query_string: { query: 'foo:bar' } }, @@ -33,7 +33,6 @@ describe('filter manager utilities', () => { mapPhrase(filter); } catch (e) { expect(e).toBe(filter); - done(); } }); }); diff --git a/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrases.test.ts b/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrases.test.ts index 4a219e23aff09..6c69f0ff948d9 100644 --- a/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrases.test.ts +++ b/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrases.test.ts @@ -29,7 +29,7 @@ describe('filter manager utilities', () => { expect(result).toHaveProperty('value', ['hello', 1, 'world']); }); - test('should return undefined for none matching', async (done) => { + test('should return undefined for none matching', (done) => { const filter = { meta: { index: 'logstash-*' }, query: { query_string: { query: 'foo:bar' } }, diff --git a/src/plugins/data/public/query/filter_manager/lib/mappers/map_query_string.test.ts b/src/plugins/data/public/query/filter_manager/lib/mappers/map_query_string.test.ts index f54cea3164919..df5347c33e6a0 100644 --- a/src/plugins/data/public/query/filter_manager/lib/mappers/map_query_string.test.ts +++ b/src/plugins/data/public/query/filter_manager/lib/mappers/map_query_string.test.ts @@ -19,14 +19,13 @@ describe('filter manager utilities', () => { expect(result).toHaveProperty('value', 'foo:bar'); }); - test('should return undefined for none matching', async (done) => { + test('should return undefined for none matching', async () => { const filter = buildEmptyFilter(true); try { mapQueryString(filter as Filter); } catch (e) { expect(e).toBe(filter); - done(); } }); }); diff --git a/src/plugins/data/public/query/filter_manager/lib/mappers/map_range.test.ts b/src/plugins/data/public/query/filter_manager/lib/mappers/map_range.test.ts index 065e3da189999..82c701a510dfa 100644 --- a/src/plugins/data/public/query/filter_manager/lib/mappers/map_range.test.ts +++ b/src/plugins/data/public/query/filter_manager/lib/mappers/map_range.test.ts @@ -22,7 +22,7 @@ describe('filter manager utilities', () => { expect(result).toHaveProperty('value', { gt: 1024, lt: 2048 }); }); - test('should return undefined for none matching', async (done) => { + test('should return undefined for none matching', async () => { const filter = { meta: { index: 'logstash-*' }, query: { query_string: { query: 'foo:bar' } }, @@ -32,8 +32,6 @@ describe('filter manager utilities', () => { mapRange(filter); } catch (e) { expect(e).toBe(filter); - - done(); } }); }); diff --git a/src/plugins/data/public/query/filter_manager/lib/mappers/map_spatial_filter.test.ts b/src/plugins/data/public/query/filter_manager/lib/mappers/map_spatial_filter.test.ts index 9065ccfa17856..67dd343dd33c4 100644 --- a/src/plugins/data/public/query/filter_manager/lib/mappers/map_spatial_filter.test.ts +++ b/src/plugins/data/public/query/filter_manager/lib/mappers/map_spatial_filter.test.ts @@ -109,7 +109,7 @@ describe('mapSpatialFilter()', () => { expect(result).toHaveProperty('type', FILTERS.SPATIAL_FILTER); }); - test('should return undefined for none matching', async (done) => { + test('should return undefined for none matching', async () => { const filter = { meta: { key: 'location', @@ -124,8 +124,6 @@ describe('mapSpatialFilter()', () => { mapSpatialFilter(filter); } catch (e) { expect(e).toBe(filter); - - done(); } }); }); diff --git a/src/plugins/data/public/query/timefilter/lib/auto_refresh_loop.test.ts b/src/plugins/data/public/query/timefilter/lib/auto_refresh_loop.test.ts index 3c8b316c3b878..fc30a120c445f 100644 --- a/src/plugins/data/public/query/timefilter/lib/auto_refresh_loop.test.ts +++ b/src/plugins/data/public/query/timefilter/lib/auto_refresh_loop.test.ts @@ -8,7 +8,7 @@ import { createAutoRefreshLoop, AutoRefreshDoneFn } from './auto_refresh_loop'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); test('triggers refresh with interval', () => { const { loop$, start, stop } = createAutoRefreshLoop(); diff --git a/src/plugins/data/public/query/timefilter/timefilter.test.ts b/src/plugins/data/public/query/timefilter/timefilter.test.ts index 0152076c7b8a6..7ba6f07835f7b 100644 --- a/src/plugins/data/public/query/timefilter/timefilter.test.ts +++ b/src/plugins/data/public/query/timefilter/timefilter.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); import sinon from 'sinon'; import moment from 'moment'; diff --git a/src/plugins/data/public/search/fetch/handle_warnings.test.ts b/src/plugins/data/public/search/fetch/handle_warnings.test.ts index 0d644d8dc0811..55564645665ce 100644 --- a/src/plugins/data/public/search/fetch/handle_warnings.test.ts +++ b/src/plugins/data/public/search/fetch/handle_warnings.test.ts @@ -13,6 +13,7 @@ import { setNotifications } from '../../services'; import { SearchResponseWarning } from '../types'; import { filterWarnings, handleWarnings } from './handle_warnings'; import * as extract from './extract_warnings'; +import { SearchRequest } from '../../../common'; jest.mock('@kbn/i18n', () => { return { @@ -152,6 +153,8 @@ describe('Filtering and showing warnings', () => { describe('filterWarnings', () => { const callback = jest.fn(); + const request = {} as SearchRequest; + const response = {} as estypes.SearchResponse; beforeEach(() => { callback.mockImplementation(() => { @@ -161,19 +164,19 @@ describe('Filtering and showing warnings', () => { it('filters out all', () => { callback.mockImplementation(() => true); - expect(filterWarnings(warnings, callback)).toEqual([]); + expect(filterWarnings(warnings, callback, request, response, 'id')).toEqual([]); }); it('filters out some', () => { callback.mockImplementation( (warning: SearchResponseWarning) => warning.reason?.type !== 'generic_shard_failure' ); - expect(filterWarnings(warnings, callback)).toEqual([warnings[2]]); + expect(filterWarnings(warnings, callback, request, response, 'id')).toEqual([warnings[2]]); }); it('filters out none', () => { callback.mockImplementation(() => false); - expect(filterWarnings(warnings, callback)).toEqual(warnings); + expect(filterWarnings(warnings, callback, request, response, 'id')).toEqual(warnings); }); }); }); diff --git a/src/plugins/data/public/search/fetch/handle_warnings.tsx b/src/plugins/data/public/search/fetch/handle_warnings.tsx index 1720ea1f76c0c..3e1353ee2f9a7 100644 --- a/src/plugins/data/public/search/fetch/handle_warnings.tsx +++ b/src/plugins/data/public/search/fetch/handle_warnings.tsx @@ -8,7 +8,7 @@ import { estypes } from '@elastic/elasticsearch'; import { debounce } from 'lodash'; -import { EuiSpacer } from '@elastic/eui'; +import { EuiSpacer, EuiTextAlign } from '@elastic/eui'; import { ThemeServiceStart } from '@kbn/core/public'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import React from 'react'; @@ -57,19 +57,23 @@ export function handleWarnings({ theme, callback, sessionId = '', + requestId, }: { request: SearchRequest; response: estypes.SearchResponse; theme: ThemeServiceStart; callback?: WarningHandlerCallback; sessionId?: string; + requestId?: string; }) { const warnings = extractWarnings(response); if (warnings.length === 0) { return; } - const internal = callback ? filterWarnings(warnings, callback) : warnings; + const internal = callback + ? filterWarnings(warnings, callback, request, response, requestId) + : warnings; if (internal.length === 0) { return; } @@ -95,12 +99,16 @@ export function handleWarnings({ <> {warning.text} - + + ({ + request: request as ShardFailureRequest, + response, + })} + /> + , { theme$: theme.theme$ } ); @@ -116,12 +124,22 @@ export function handleWarnings({ /** * @internal */ -export function filterWarnings(warnings: SearchResponseWarning[], cb: WarningHandlerCallback) { +export function filterWarnings( + warnings: SearchResponseWarning[], + cb: WarningHandlerCallback, + request: SearchRequest, + response: estypes.SearchResponse, + requestId: string | undefined +) { const unfiltered: SearchResponseWarning[] = []; // use the consumer's callback as a filter to receive warnings to handle on our side warnings.forEach((warning) => { - const consumerHandled = cb?.(warning); + const consumerHandled = cb?.(warning, { + requestId, + request, + response, + }); if (!consumerHandled) { unfiltered.push(warning); } diff --git a/src/plugins/data/public/search/index.ts b/src/plugins/data/public/search/index.ts index 72d2a25b15ea2..6cf303d424042 100644 --- a/src/plugins/data/public/search/index.ts +++ b/src/plugins/data/public/search/index.ts @@ -9,6 +9,7 @@ export * from './expressions'; export type { + SearchResponseWarning, ISearchSetup, ISearchStart, ISearchStartSearchSource, diff --git a/src/plugins/data/public/search/search_interceptor/search_abort_controller.test.ts b/src/plugins/data/public/search/search_interceptor/search_abort_controller.test.ts index 5d9d8a9903325..82d917216f306 100644 --- a/src/plugins/data/public/search/search_interceptor/search_abort_controller.test.ts +++ b/src/plugins/data/public/search/search_interceptor/search_abort_controller.test.ts @@ -10,7 +10,7 @@ import { SearchAbortController } from './search_abort_controller'; const timeTravel = (msToRun = 0) => { jest.advanceTimersByTime(msToRun); - return new Promise((resolve) => setImmediate(resolve)); + return new Promise((resolve) => jest.requireActual('timers').setImmediate(resolve)); }; describe('search abort controller', () => { @@ -75,7 +75,7 @@ describe('search abort controller', () => { describe('timeout abort', () => { beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterEach(() => { diff --git a/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts b/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts index 35bbecfdb5c4d..73ce6672064aa 100644 --- a/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts +++ b/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts @@ -41,8 +41,10 @@ let mockCoreSetup: MockedKeys; let bfetchSetup: jest.Mocked; let fetchMock: jest.Mock; -const flushPromises = () => new Promise((resolve) => setImmediate(resolve)); -jest.useFakeTimers(); +const flushPromises = () => + new Promise((resolve) => jest.requireActual('timers').setImmediate(resolve)); + +jest.useFakeTimers('legacy'); const timeTravel = async (msToRun = 0) => { await flushPromises(); @@ -1531,7 +1533,7 @@ describe('SearchInterceptor', () => { await flushPromises(); }); - test('Immediately aborts if passed an aborted abort signal', async (done) => { + test('Immediately aborts if passed an aborted abort signal', async () => { const abort = new AbortController(); const mockRequest: IEsSearchRequest = { params: {}, @@ -1542,7 +1544,6 @@ describe('SearchInterceptor', () => { error.mockImplementation((e) => { expect(e).toBeInstanceOf(AbortError); expect(fetchMock).not.toBeCalled(); - done(); }); response.subscribe({ error }); diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index dbba423c8ea88..c4a135b64ca94 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -241,11 +241,13 @@ export class SearchService implements Plugin { onResponse: (request, response, options) => { if (!options.disableShardFailureWarning) { const { rawResponse } = response; + handleWarnings({ request: request.body, response: rawResponse, theme, sessionId: options.sessionId, + requestId: request.id, }); } return response; @@ -286,12 +288,12 @@ export class SearchService implements Plugin { if (!rawResponse) { return; } - handleWarnings({ request: request.json as SearchRequest, response: rawResponse, theme, callback, + requestId: request.id, }); }); }, diff --git a/src/plugins/data/public/search/session/session_helpers.test.ts b/src/plugins/data/public/search/session/session_helpers.test.ts index bc092a4f6ac3f..8d33d58b55acc 100644 --- a/src/plugins/data/public/search/session/session_helpers.test.ts +++ b/src/plugins/data/public/search/session/session_helpers.test.ts @@ -65,7 +65,7 @@ beforeEach(() => { describe('waitUntilNextSessionCompletes$', () => { beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterEach(() => { jest.useRealTimers(); diff --git a/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.test.tsx b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.test.tsx index 9f29e2866fb61..1174142db213f 100644 --- a/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.test.tsx +++ b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.test.tsx @@ -226,7 +226,7 @@ describe('Completed inactivity', () => { describe('tour steps', () => { describe('loading state', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx index ac554af701d04..be398ba7294fc 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx @@ -152,7 +152,7 @@ describe('Background Search Session Management Table', () => { // FLAKY: https://github.com/elastic/kibana/issues/88928 describe.skip('fetching sessions data', () => { test('re-fetches data', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); sessionsClient.find = jest.fn(); mockConfig = { ...mockConfig, diff --git a/src/plugins/data/public/search/types.ts b/src/plugins/data/public/search/types.ts index 4e3753018adb9..d1fde7bd4d7e6 100644 --- a/src/plugins/data/public/search/types.ts +++ b/src/plugins/data/public/search/types.ts @@ -11,7 +11,7 @@ import type { PackageInfo } from '@kbn/core/server'; import { DataViewsContract } from '@kbn/data-views-plugin/common'; import { RequestAdapter } from '@kbn/inspector-plugin/public'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import { ISearchGeneric, ISearchStartSearchSource } from '../../common/search'; +import { ISearchGeneric, ISearchStartSearchSource, SearchRequest } from '../../common/search'; import { AggsSetup, AggsSetupDependencies, AggsStart, AggsStartDependencies } from './aggs'; import { SearchUsageCollector } from './collectors'; import { ISessionsClient, ISessionService } from './session'; @@ -159,4 +159,11 @@ export type SearchResponseWarning = * function to prevent the search service from showing warning notifications by default. * @public */ -export type WarningHandlerCallback = (warnings: SearchResponseWarning) => boolean | undefined; +export type WarningHandlerCallback = ( + warnings: SearchResponseWarning, + meta: { + request: SearchRequest; + response: estypes.SearchResponse; + requestId: string | undefined; + } +) => boolean | undefined; diff --git a/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.test.tsx b/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.test.tsx index 6893ae0126e84..00f0315e69275 100644 --- a/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.test.tsx +++ b/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.test.tsx @@ -21,8 +21,10 @@ describe('ShardFailureOpenModalButton', () => { it('triggers the openModal function when "Show details" button is clicked', () => { const component = mountWithIntl( ({ + request: shardFailureRequest, + response: shardFailureResponse, + })} theme={theme} title="test" /> diff --git a/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.tsx b/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.tsx index 63547b1391e5b..b3862690eef01 100644 --- a/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.tsx +++ b/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.tsx @@ -6,33 +6,41 @@ * Side Public License, v 1. */ -import React from 'react'; +import React, { useCallback } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiButton, EuiTextAlign } from '@elastic/eui'; +import { EuiLink, EuiButton, EuiButtonProps } from '@elastic/eui'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { ThemeServiceStart } from '@kbn/core/public'; +import type { ThemeServiceStart } from '@kbn/core/public'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import { getOverlays } from '../services'; import { ShardFailureModal } from './shard_failure_modal'; -import { ShardFailureRequest } from './shard_failure_types'; +import type { ShardFailureRequest } from './shard_failure_types'; // @internal export interface ShardFailureOpenModalButtonProps { - request: ShardFailureRequest; - response: estypes.SearchResponse; theme: ThemeServiceStart; title: string; + size?: EuiButtonProps['size']; + color?: EuiButtonProps['color']; + getRequestMeta: () => { + request: ShardFailureRequest; + response: estypes.SearchResponse; + }; + isButtonEmpty?: boolean; } // Needed for React.lazy // eslint-disable-next-line import/no-default-export export default function ShardFailureOpenModalButton({ - request, - response, + getRequestMeta, theme, title, + size = 's', + color = 'warning', + isButtonEmpty = false, }: ShardFailureOpenModalButtonProps) { - function onClick() { + const onClick = useCallback(() => { + const { request, response } = getRequestMeta(); const modal = getOverlays().openModal( toMountPoint( - - - - + + + ); } diff --git a/src/plugins/data/server/lib/get_request_aborted_signal.test.ts b/src/plugins/data/server/lib/get_request_aborted_signal.test.ts index 3a94d020de4da..eb0c590c9c7bc 100644 --- a/src/plugins/data/server/lib/get_request_aborted_signal.test.ts +++ b/src/plugins/data/server/lib/get_request_aborted_signal.test.ts @@ -10,7 +10,7 @@ import { Subject } from 'rxjs'; import { getRequestAbortedSignal } from './get_request_aborted_signal'; describe('abortableRequestHandler', () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); it('should call abort if disconnected', () => { const abortedSubject = new Subject(); diff --git a/src/plugins/data/server/search/strategies/es_search/es_search_strategy.test.ts b/src/plugins/data/server/search/strategies/es_search/es_search_strategy.test.ts index d8413703808c7..15a6a4df7eed8 100644 --- a/src/plugins/data/server/search/strategies/es_search/es_search_strategy.test.ts +++ b/src/plugins/data/server/search/strategies/es_search/es_search_strategy.test.ts @@ -58,7 +58,7 @@ describe('ES search strategy', () => { expect(typeof esSearch.search).toBe('function'); }); - it('calls the API caller with the params with defaults', async (done) => { + it('calls the API caller with the params with defaults', async () => { const params = { index: 'logstash-*' }; await esSearchStrategyProvider(mockConfig$, mockLogger) @@ -70,11 +70,10 @@ describe('ES search strategy', () => { ignore_unavailable: true, track_total_hits: true, }); - done(); }); }); - it('calls the API caller with overridden defaults', async (done) => { + it('calls the API caller with overridden defaults', async () => { const params = { index: 'logstash-*', ignore_unavailable: false, timeout: '1000ms' }; await esSearchStrategyProvider(mockConfig$, mockLogger) @@ -85,11 +84,10 @@ describe('ES search strategy', () => { ...params, track_total_hits: true, }); - done(); }); }); - it('has all response parameters', async (done) => + it('has all response parameters', async () => await esSearchStrategyProvider(mockConfig$, mockLogger) .search( { @@ -103,7 +101,6 @@ describe('ES search strategy', () => { expect(data.isPartial).toBe(false); expect(data).toHaveProperty('loaded'); expect(data).toHaveProperty('rawResponse'); - done(); })); it('calls the client with transport options', async () => { @@ -137,7 +134,7 @@ describe('ES search strategy', () => { expect(esClient.search.mock.calls[0][1]).toEqual({ signal: expect.any(AbortSignal) }); }); - it('throws normalized error if ResponseError is thrown', async (done) => { + it('throws normalized error if ResponseError is thrown', async () => { const params = { index: 'logstash-*', ignore_unavailable: false, timeout: '1000ms' }; const errResponse = new errors.ResponseError({ body: indexNotFoundException, @@ -157,11 +154,10 @@ describe('ES search strategy', () => { expect(e.statusCode).toBe(404); expect(e.message).toBe(errResponse.message); expect(e.errBody).toBe(indexNotFoundException); - done(); } }); - it('throws normalized error if ElasticsearchClientError is thrown', async (done) => { + it('throws normalized error if ElasticsearchClientError is thrown', async () => { const params = { index: 'logstash-*', ignore_unavailable: false, timeout: '1000ms' }; const errResponse = new errors.ElasticsearchClientError('This is a general ESClient error'); @@ -175,11 +171,10 @@ describe('ES search strategy', () => { expect(e.statusCode).toBe(500); expect(e.message).toBe(errResponse.message); expect(e.errBody).toBe(undefined); - done(); } }); - it('throws normalized error if ESClient throws unknown error', async (done) => { + it('throws normalized error if ESClient throws unknown error', async () => { const params = { index: 'logstash-*', ignore_unavailable: false, timeout: '1000ms' }; const errResponse = new Error('ESClient error'); @@ -193,11 +188,10 @@ describe('ES search strategy', () => { expect(e.statusCode).toBe(500); expect(e.message).toBe(errResponse.message); expect(e.errBody).toBe(undefined); - done(); } }); - it('throws KbnServerError for unknown index type', async (done) => { + it('throws KbnServerError for unknown index type', async () => { const params = { index: 'logstash-*', ignore_unavailable: false, timeout: '1000ms' }; try { @@ -210,7 +204,6 @@ describe('ES search strategy', () => { expect(e.message).toBe('Unsupported index pattern type banana'); expect(e.statusCode).toBe(400); expect(e.errBody).toBe(undefined); - done(); } }); }); diff --git a/src/plugins/data/server/ui_settings.ts b/src/plugins/data/server/ui_settings.ts index a1ac225ba4b38..8d666590b3d30 100644 --- a/src/plugins/data/server/ui_settings.ts +++ b/src/plugins/data/server/ui_settings.ts @@ -346,8 +346,18 @@ export function getUiSettings( "to": "now" }`, type: 'json', - description: i18n.translate('data.advancedSettings.timepicker.timeDefaultsText', { - defaultMessage: 'The timefilter selection to use when Kibana is started without one', + description: i18n.translate('data.advancedSettings.timepicker.timeDefaultsDescription', { + defaultMessage: + 'The timefilter selection to use when Kibana is started without one. Must be an object containing "from" and "to" (see {acceptedFormatsLink}).', + values: { + acceptedFormatsLink: + `` + + i18n.translate('data.advancedSettings.timepicker.quickRanges.acceptedFormatsLinkText', { + defaultMessage: 'accepted formats', + }) + + '', + }, }), requiresPageReload: true, schema: schema.object({ diff --git a/src/plugins/data/tsconfig.json b/src/plugins/data/tsconfig.json index 2e9c05992cc9d..415ec0795359b 100644 --- a/src/plugins/data/tsconfig.json +++ b/src/plugins/data/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -16,7 +15,7 @@ "public/**/*.json", "../../../typings/index.d.ts" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../bfetch/tsconfig.json" }, { "path": "../ui_actions/tsconfig.json" }, diff --git a/src/plugins/data_view_editor/tsconfig.json b/src/plugins/data_view_editor/tsconfig.json index 2b7cdc53a6a3a..6a0f779db2f9c 100644 --- a/src/plugins/data_view_editor/tsconfig.json +++ b/src/plugins/data_view_editor/tsconfig.json @@ -1,16 +1,14 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, { "path": "../data_views/tsconfig.json" }, diff --git a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.test.tsx b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.test.tsx index 50dce25679252..825402fd00a24 100644 --- a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.test.tsx +++ b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.test.tsx @@ -65,7 +65,7 @@ describe('', () => { }; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.test.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.test.ts index 51cd024f0b53e..094c38e0eb715 100644 --- a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.test.ts +++ b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.test.ts @@ -18,7 +18,7 @@ describe('', () => { const { httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.test.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.test.ts index 8659e12909763..66cf2bab43d3d 100644 --- a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.test.ts +++ b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.test.ts @@ -27,7 +27,7 @@ describe('Field editor Preview panel', () => { const { server, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/data_view_field_editor/tsconfig.json b/src/plugins/data_view_field_editor/tsconfig.json index 2d1f603a1183d..c4f3c835bff02 100644 --- a/src/plugins/data_view_field_editor/tsconfig.json +++ b/src/plugins/data_view_field_editor/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "../../../typings/**/*", @@ -13,7 +12,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, { "path": "../data_views/tsconfig.json" }, diff --git a/src/plugins/data_view_management/tsconfig.json b/src/plugins/data_view_management/tsconfig.json index 374cea271ed90..9d2b60cc69543 100644 --- a/src/plugins/data_view_management/tsconfig.json +++ b/src/plugins/data_view_management/tsconfig.json @@ -4,13 +4,12 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, { "path": "../management/tsconfig.json" }, diff --git a/src/plugins/data_views/common/data_views/data_views.test.ts b/src/plugins/data_views/common/data_views/data_views.test.ts index 64e9ee483ef3b..9962243e94293 100644 --- a/src/plugins/data_views/common/data_views/data_views.test.ts +++ b/src/plugins/data_views/common/data_views/data_views.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { defaults } from 'lodash'; +import { defaults, get, set } from 'lodash'; import { DataViewsService, DataView } from '.'; import { fieldFormatsMock } from '@kbn/field-formats-plugin/common/mocks'; @@ -31,6 +31,10 @@ function setDocsourcePayload(id: string | null, providedPayload: any) { object = defaults(providedPayload || {}, stubbedSavedObjectIndexPattern(id)); } +function doWithTimeout(fn: () => T, timeout: number = 0): Promise { + return new Promise((resolve) => setTimeout(() => resolve(fn()), timeout)); +} + const savedObject = { id: 'id', version: 'version', @@ -151,10 +155,45 @@ describe('IndexPatterns', () => { test('does cache ad-hoc data views', async () => { const id = '1'; - const dataView = await indexPatterns.create({ id }); - const gettedDataView = await indexPatterns.get(id); - expect(dataView).toBe(gettedDataView); + const createFromSpecOriginal = get(indexPatterns, 'createFromSpec'); + let mockedCreateFromSpec: jest.Mock; + + set( + indexPatterns, + 'createFromSpec', + (mockedCreateFromSpec = jest + .fn() + .mockImplementation((spec: DataViewSpec, skipFetchFields = false, displayErrors = true) => + doWithTimeout( + () => createFromSpecOriginal.call(indexPatterns, spec, skipFetchFields, displayErrors), + 1000 + ) + )) + ); + + // run creating in parallel + await Promise.all([ + indexPatterns.create({ id }), + indexPatterns.create({ id }), + indexPatterns.create({ id }), + doWithTimeout(() => indexPatterns.create({ id }), 1), + doWithTimeout(() => indexPatterns.create({ id }), 10), + + doWithTimeout(() => indexPatterns.get(id), 10), + doWithTimeout(() => indexPatterns.get(id), 40), + ]).then((results) => + results.forEach((value) => { + expect(value.id).toBe(id); + }) + ); + + // tests after promise was resolved + expect((await indexPatterns.get(id)).id).toBe(id); + expect((await indexPatterns.create({ id })).id).toBe(id); + + expect(mockedCreateFromSpec).toHaveBeenCalledTimes(1); + expect(mockedCreateFromSpec).toHaveBeenCalledWith({ id: '1' }, false, true); }); test('allowNoIndex flag preserves existing fields when index is missing', async () => { diff --git a/src/plugins/data_views/common/data_views/data_views.ts b/src/plugins/data_views/common/data_views/data_views.ts index 60dd372dd7b8f..7bc8b3cee7826 100644 --- a/src/plugins/data_views/common/data_views/data_views.ts +++ b/src/plugins/data_views/common/data_views/data_views.ts @@ -7,7 +7,7 @@ */ import { i18n } from '@kbn/i18n'; -import { PublicMethodsOf } from '@kbn/utility-types'; +import type { PublicMethodsOf } from '@kbn/utility-types'; import { castEsToKbnFieldTypeName } from '@kbn/field-types'; import { FieldFormatsStartCommon, FORMATS_UI_SETTINGS } from '@kbn/field-formats-plugin/common'; import { SavedObjectNotFound } from '@kbn/kibana-utils-plugin/common'; @@ -823,7 +823,7 @@ export class DataViewsService { ? JSON.parse(savedObject.attributes.fieldFormatMap) : {}; - const indexPattern = await this.create(spec, true, displayErrors); + const indexPattern = await this.createFromSpec(spec, true, displayErrors); indexPattern.matchedIndices = indices; indexPattern.resetOriginalSavedObjectBody(); return indexPattern; @@ -898,7 +898,7 @@ export class DataViewsService { * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. * @returns DataView */ - async create( + private async createFromSpec( { id, name, title, ...restOfSpec }: DataViewSpec, skipFetchFields = false, displayErrors = true @@ -913,7 +913,7 @@ export class DataViewsService { ...restOfSpec, }; - const indexPattern = new DataView({ + const dataView = new DataView({ spec, fieldFormats: this.fieldFormats, shortDotsEnable, @@ -921,12 +921,38 @@ export class DataViewsService { }); if (!skipFetchFields) { - await this.refreshFields(indexPattern, displayErrors); + await this.refreshFields(dataView, displayErrors); } - this.dataViewCache.set(indexPattern.id!, Promise.resolve(indexPattern)); + return dataView; + } - return indexPattern; + /** + * Create data view instance. + * @param spec data view spec + * @param skipFetchFields if true, will not fetch fields + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + * @returns DataView + */ + async create( + spec: DataViewSpec, + skipFetchFields = false, + displayErrors = true + ): Promise { + const doCreate = () => this.createFromSpec(spec, skipFetchFields, displayErrors); + + if (spec.id) { + const cachedDataView = this.dataViewCache.get(spec.id); + + if (cachedDataView) { + return cachedDataView; + } + + return this.dataViewCache.set(spec.id, doCreate()); + } + + const dataView = await doCreate(); + return this.dataViewCache.set(dataView.id!, Promise.resolve(dataView)); } /** @@ -943,7 +969,7 @@ export class DataViewsService { skipFetchFields = false, displayErrors = true ) { - const indexPattern = await this.create(spec, skipFetchFields, displayErrors); + const indexPattern = await this.createFromSpec(spec, skipFetchFields, displayErrors); const createdIndexPattern = await this.createSavedObject(indexPattern, override, displayErrors); await this.setDefault(createdIndexPattern.id!); return createdIndexPattern!; diff --git a/src/plugins/data_views/tsconfig.json b/src/plugins/data_views/tsconfig.json index f5c80ce30cce0..5ac2028373852 100644 --- a/src/plugins/data_views/tsconfig.json +++ b/src/plugins/data_views/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -15,7 +14,7 @@ "public/**/*.json", "server/**/*.json" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../usage_collection/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, diff --git a/src/plugins/dev_tools/tsconfig.json b/src/plugins/dev_tools/tsconfig.json index df16711f6ea50..d7addc6650756 100644 --- a/src/plugins/dev_tools/tsconfig.json +++ b/src/plugins/dev_tools/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["public/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../url_forwarding/tsconfig.json" }, { "path": "../../../src/plugins/management/tsconfig.json" } diff --git a/src/plugins/discover/public/__mocks__/services.ts b/src/plugins/discover/public/__mocks__/services.ts index 97de63d231a46..eaae356c03c1a 100644 --- a/src/plugins/discover/public/__mocks__/services.ts +++ b/src/plugins/discover/public/__mocks__/services.ts @@ -126,4 +126,11 @@ export const discoverServiceMock = { savedObjectsTagging: {}, dataViews: dataViewsMock, timefilter: { createFilter: jest.fn() }, + locator: { + useUrl: jest.fn(() => ''), + navigate: jest.fn(), + getUrl: jest.fn(() => Promise.resolve('')), + }, + contextLocator: { getRedirectUrl: jest.fn(() => '') }, + singleDocLocator: { getRedirectUrl: jest.fn(() => '') }, } as unknown as DiscoverServices; diff --git a/src/plugins/discover/public/application/context/context_app.test.tsx b/src/plugins/discover/public/application/context/context_app.test.tsx index 5b5fa21f12483..5b05195227290 100644 --- a/src/plugins/discover/public/application/context/context_app.test.tsx +++ b/src/plugins/discover/public/application/context/context_app.test.tsx @@ -22,6 +22,7 @@ import { themeServiceMock } from '@kbn/core/public/mocks'; import { LocalStorageMock } from '../../__mocks__/local_storage_mock'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; +import type { HistoryLocationState } from '../../build_services'; const mockFilterManager = createFilterManagerMock(); const mockNavigationPlugin = { @@ -64,11 +65,20 @@ describe('ContextApp test', () => { filterManager: mockFilterManager, uiSettings: uiSettingsMock, storage: new LocalStorageMock({}), + chrome: { setBreadcrumbs: jest.fn() }, + locator: { + useUrl: jest.fn(() => ''), + navigate: jest.fn(), + getUrl: jest.fn(() => Promise.resolve('mock-url')), + }, + contextLocator: { getRedirectUrl: jest.fn(() => '') }, + singleDocLocator: { getRedirectUrl: jest.fn(() => '') }, } as unknown as DiscoverServices; const defaultProps = { dataView: dataViewMock, anchorId: 'mocked_anchor_id', + locationState: {} as HistoryLocationState, }; const topNavProps = { diff --git a/src/plugins/discover/public/application/context/context_app.tsx b/src/plugins/discover/public/application/context/context_app.tsx index 3146e634c4575..7fc2d60fe1040 100644 --- a/src/plugins/discover/public/application/context/context_app.tsx +++ b/src/plugins/discover/public/application/context/context_app.tsx @@ -33,34 +33,61 @@ import { ContextAppContent } from './context_app_content'; import { SurrDocType } from './services/context'; import { DocViewFilterFn } from '../../services/doc_views/doc_views_types'; import { useDiscoverServices } from '../../hooks/use_discover_services'; +import { getRootBreadcrumbs } from '../../utils/breadcrumbs'; const ContextAppContentMemoized = memo(ContextAppContent); export interface ContextAppProps { dataView: DataView; anchorId: string; + referrer?: string; } -export const ContextApp = ({ dataView, anchorId }: ContextAppProps) => { +export const ContextApp = ({ dataView, anchorId, referrer }: ContextAppProps) => { const services = useDiscoverServices(); - const { uiSettings, capabilities, dataViews, navigation, filterManager, core } = services; + const { locator, uiSettings, capabilities, dataViews, navigation, filterManager, core } = + services; const isLegacy = useMemo(() => uiSettings.get(DOC_TABLE_LEGACY), [uiSettings]); const useNewFieldsApi = useMemo(() => !uiSettings.get(SEARCH_FIELDS_FROM_SOURCE), [uiSettings]); - useExecutionContext(core.executionContext, { - type: 'application', - page: 'context', - id: dataView.id || '', - }); - /** * Context app state */ - const { appState, globalState, setAppState } = useContextAppState({ services, dataView }); + const { appState, globalState, stateContainer } = useContextAppState({ + services, + dataView, + }); const prevAppState = useRef(); const prevGlobalState = useRef({ filters: [] }); + const { columns, onAddColumn, onRemoveColumn, onSetColumns } = useColumns({ + capabilities, + config: uiSettings, + dataView, + dataViews, + state: appState, + useNewFieldsApi, + setAppState: stateContainer.setAppState, + }); + + useEffect(() => { + services.chrome.setBreadcrumbs([ + ...getRootBreadcrumbs(referrer), + { + text: i18n.translate('discover.context.breadcrumb', { + defaultMessage: 'Surrounding documents', + }), + }, + ]); + }, [locator, referrer, services.chrome]); + + useExecutionContext(core.executionContext, { + type: 'application', + page: 'context', + id: dataView.id || '', + }); + /** * Context fetched state */ @@ -71,6 +98,7 @@ export const ContextApp = ({ dataView, anchorId }: ContextAppProps) => { appState, useNewFieldsApi, }); + /** * Reset state when anchor changes */ @@ -110,15 +138,6 @@ export const ContextApp = ({ dataView, anchorId }: ContextAppProps) => { fetchedState.anchor.id, ]); - const { columns, onAddColumn, onRemoveColumn, onSetColumns } = useColumns({ - capabilities, - config: uiSettings, - dataView, - dataViews, - state: appState, - useNewFieldsApi, - setAppState, - }); const rows = useMemo( () => [ ...(fetchedState.predecessors || []), @@ -201,7 +220,7 @@ export const ContextApp = ({ dataView, anchorId }: ContextAppProps) => { onSetColumns={onSetColumns} predecessorCount={appState.predecessorCount} successorCount={appState.successorCount} - setAppState={setAppState} + setAppState={stateContainer.setAppState} addFilter={addFilter as DocViewFilterFn} rows={rows} predecessors={fetchedState.predecessors} @@ -209,7 +228,6 @@ export const ContextApp = ({ dataView, anchorId }: ContextAppProps) => { anchorStatus={fetchedState.anchorStatus.value} predecessorsStatus={fetchedState.predecessorsStatus.value} successorsStatus={fetchedState.successorsStatus.value} - onFieldEdited={fetchAllRows} /> diff --git a/src/plugins/discover/public/application/context/context_app_content.tsx b/src/plugins/discover/public/application/context/context_app_content.tsx index 7471f15092c3b..4a24363525998 100644 --- a/src/plugins/discover/public/application/context/context_app_content.tsx +++ b/src/plugins/discover/public/application/context/context_app_content.tsx @@ -42,7 +42,6 @@ export interface ContextAppContentProps { isLegacy: boolean; setAppState: (newState: Partial) => void; addFilter: DocViewFilterFn; - onFieldEdited: () => void; } const controlColumnIds = ['openDetails']; @@ -73,7 +72,6 @@ export function ContextAppContent({ isLegacy, setAppState, addFilter, - onFieldEdited, }: ContextAppContentProps) { const { uiSettings: config } = useDiscoverServices(); @@ -162,7 +160,6 @@ export function ContextAppContent({ onAddColumn={onAddColumn} onRemoveColumn={onRemoveColumn} onSetColumns={onSetColumns} - onFieldEdited={onFieldEdited} /> )} diff --git a/src/plugins/discover/public/application/context/context_app_route.tsx b/src/plugins/discover/public/application/context/context_app_route.tsx index e256f026cd336..b1e8e39cb3e71 100644 --- a/src/plugins/discover/public/application/context/context_app_route.tsx +++ b/src/plugins/discover/public/application/context/context_app_route.tsx @@ -5,17 +5,16 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import React, { useEffect } from 'react'; +import React, { useEffect, useMemo } from 'react'; import { useParams } from 'react-router-dom'; -import { i18n } from '@kbn/i18n'; import { EuiEmptyPrompt } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; +import type { ScopedHistory } from '@kbn/core/public'; import { ContextApp } from './context_app'; -import { getRootBreadcrumbs } from '../../utils/breadcrumbs'; import { LoadingIndicator } from '../../components/common/loading_indicator'; +import { getScopedHistory } from '../../kibana_services'; import { useDataView } from '../../hooks/use_data_view'; -import { useMainRouteBreadcrumb } from '../../hooks/use_navigation_props'; -import { useDiscoverServices } from '../../hooks/use_discover_services'; +import type { ContextHistoryLocationState } from './services/locator'; export interface ContextUrlParams { dataViewId: string; @@ -23,26 +22,34 @@ export interface ContextUrlParams { } export function ContextAppRoute() { - const services = useDiscoverServices(); - const { chrome } = services; - - const { dataViewId, id } = useParams(); - const anchorId = decodeURIComponent(id); - const usedDataViewId = decodeURIComponent(dataViewId); - const breadcrumb = useMainRouteBreadcrumb(); + const locationState = useMemo( + () => getScopedHistory().location.state as ContextHistoryLocationState | undefined, + [] + ); + /** + * Updates history state when gets undefined. + * Should be removed once url state will be deleted from context page. + */ useEffect(() => { - chrome.setBreadcrumbs([ - ...getRootBreadcrumbs(breadcrumb), - { - text: i18n.translate('discover.context.breadcrumb', { - defaultMessage: 'Surrounding documents', - }), - }, - ]); - }, [chrome, breadcrumb]); + const scopedHistory = getScopedHistory() as ScopedHistory< + ContextHistoryLocationState | undefined + >; + const unlisten = scopedHistory.listen((location) => { + const currentState = location.state; + if (!currentState?.referrer && locationState) { + const newLocation = { ...location, state: { ...currentState, ...locationState } }; + scopedHistory.replace(newLocation); + } + }); + return () => unlisten(); + }, [locationState]); + + const { dataViewId: encodedDataViewId, id } = useParams(); + const dataViewId = decodeURIComponent(encodedDataViewId); + const anchorId = decodeURIComponent(id); - const { dataView, error } = useDataView(services.dataViews, usedDataViewId); + const { dataView, error } = useDataView({ index: locationState?.dataViewSpec || dataViewId }); if (error) { return ( @@ -70,5 +77,5 @@ export function ContextAppRoute() { return ; } - return ; + return ; } diff --git a/src/plugins/discover/public/application/context/hooks/use_context_app_state.ts b/src/plugins/discover/public/application/context/hooks/use_context_app_state.ts index db6ba390f67a7..ac3a0879d5379 100644 --- a/src/plugins/discover/public/application/context/hooks/use_context_app_state.ts +++ b/src/plugins/discover/public/application/context/hooks/use_context_app_state.ts @@ -67,6 +67,6 @@ export function useContextAppState({ return { appState, globalState, - setAppState: stateContainer.setAppState, + stateContainer, }; } diff --git a/src/plugins/discover/public/application/context/services/locator.test.ts b/src/plugins/discover/public/application/context/services/locator.test.ts new file mode 100644 index 0000000000000..da545e3fc3b56 --- /dev/null +++ b/src/plugins/discover/public/application/context/services/locator.test.ts @@ -0,0 +1,103 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getStatesFromKbnUrl } from '@kbn/kibana-utils-plugin/public'; +import { DiscoverContextAppLocatorDefinition } from './locator'; + +const dataViewId: string = 'c367b774-a4c2-11ea-bb37-0242ac130002'; + +interface SetupParams { + useHash?: boolean; +} + +const setup = async ({ useHash = false }: SetupParams = {}) => { + const locator = new DiscoverContextAppLocatorDefinition({ useHash }); + return { locator }; +}; + +const appStateParams = { + columns: ['mock-column'], + filters: [ + { + meta: { + disabled: false, + negate: false, + type: 'phrase', + key: 'mock-key', + value: 'mock-value', + params: { query: 'mock-value' }, + index: dataViewId, + }, + query: { match_phrase: { 'mock-key': 'mock-value' } }, + }, + ], +}; + +describe('Discover context url generator', () => { + test('can create basic link to context', async () => { + const { locator } = await setup(); + const { app, path } = await locator.getLocation({ + index: dataViewId, + rowId: 'mock-row-id', + referrer: 'mock-referrer', + }); + const { _a, _g } = getStatesFromKbnUrl(path, ['_a', '_g']); + + expect(app).toBe('discover'); + expect(_a).toEqual({}); + expect(_g).toEqual({}); + }); + + test('should fill history state for context view', async () => { + const { locator } = await setup(); + + const { path, state } = await locator.getLocation({ + index: dataViewId, + rowId: 'mock-row-id', + ...appStateParams, + referrer: 'mock-referrer', + }); + + const { _a, _g } = getStatesFromKbnUrl(path, ['_a', '_g']); + expect(path).toMatchInlineSnapshot( + `"#/context/c367b774-a4c2-11ea-bb37-0242ac130002/mock-row-id?_g=(filters:!())&_a=(columns:!(mock-column),filters:!((meta:(disabled:!f,index:c367b774-a4c2-11ea-bb37-0242ac130002,key:mock-key,negate:!f,params:(query:mock-value),type:phrase,value:mock-value),query:(match_phrase:(mock-key:mock-value)))))"` + ); + expect(state).toEqual({ referrer: 'mock-referrer' }); + expect(_a).toEqual(appStateParams); + expect(_g).toEqual({ filters: [] }); + }); + + test('when useHash set to false, sets data view ID in the generated URL', async () => { + const { locator } = await setup(); + const { path } = await locator.getLocation({ + index: dataViewId, + rowId: 'mock-row-id', + ...appStateParams, + referrer: 'mock-referrer', + }); + + expect(path.indexOf(dataViewId) > -1).toBe(true); + expect(path).toMatchInlineSnapshot( + `"#/context/c367b774-a4c2-11ea-bb37-0242ac130002/mock-row-id?_g=(filters:!())&_a=(columns:!(mock-column),filters:!((meta:(disabled:!f,index:c367b774-a4c2-11ea-bb37-0242ac130002,key:mock-key,negate:!f,params:(query:mock-value),type:phrase,value:mock-value),query:(match_phrase:(mock-key:mock-value)))))"` + ); + }); + + test('when useHash set to true, does not set data view ID in the generated URL', async () => { + const { locator } = await setup({ useHash: true }); + const { path } = await locator.getLocation({ + index: dataViewId, + rowId: 'mock-row-id', + ...appStateParams, + referrer: 'mock-referrer', + }); + + expect(path).toMatchInlineSnapshot( + `"#/context/c367b774-a4c2-11ea-bb37-0242ac130002/mock-row-id?_g=h@3a04046&_a=h@9ad8c77"` + ); + }); +}); diff --git a/src/plugins/discover/public/application/context/services/locator.ts b/src/plugins/discover/public/application/context/services/locator.ts new file mode 100644 index 0000000000000..29bb01e1af58a --- /dev/null +++ b/src/plugins/discover/public/application/context/services/locator.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SerializableRecord } from '@kbn/utility-types'; +import type { Filter } from '@kbn/es-query'; +import type { GlobalQueryStateFromUrl } from '@kbn/data-plugin/public'; +import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public'; +import { setStateToKbnUrl } from '@kbn/kibana-utils-plugin/public'; +import type { DataViewSpec } from '@kbn/data-views-plugin/public'; +export const DISCOVER_CONTEXT_APP_LOCATOR = 'DISCOVER_CONTEXT_APP_LOCATOR'; + +export interface DiscoverContextAppLocatorParams extends SerializableRecord { + index: string | DataViewSpec; // spec in case of adhoc data view + rowId: string; + columns?: string[]; + filters?: Filter[]; + referrer: string; // discover main view url +} + +export type DiscoverContextAppLocator = LocatorPublic; + +export interface DiscoverContextAppLocatorDependencies { + useHash: boolean; +} + +export interface ContextHistoryLocationState { + referrer: string; + dataViewSpec?: DataViewSpec; +} + +export class DiscoverContextAppLocatorDefinition + implements LocatorDefinition +{ + public readonly id = DISCOVER_CONTEXT_APP_LOCATOR; + + constructor(protected readonly deps: DiscoverContextAppLocatorDependencies) {} + + public readonly getLocation = async (params: DiscoverContextAppLocatorParams) => { + const useHash = this.deps.useHash; + const { index, rowId, columns, filters, referrer } = params; + + const appState: { filters?: Filter[]; columns?: string[] } = {}; + const queryState: GlobalQueryStateFromUrl = {}; + + const { isFilterPinned } = await import('@kbn/es-query'); + if (filters && filters.length) appState.filters = filters?.filter((f) => !isFilterPinned(f)); + if (columns) appState.columns = columns; + + if (filters && filters.length) queryState.filters = filters?.filter((f) => isFilterPinned(f)); + + let dataViewId; + const state: ContextHistoryLocationState = { referrer }; + if (typeof index === 'object') { + state.dataViewSpec = index; + dataViewId = index.id!; + } else { + dataViewId = index; + } + + let path = `#/context/${dataViewId}/${rowId}`; + path = setStateToKbnUrl('_g', queryState, { useHash }, path); + path = setStateToKbnUrl('_a', appState, { useHash }, path); + + return { + app: 'discover', + path, + state, + }; + }; +} diff --git a/src/plugins/discover/public/application/context/utils/replace_context_location.ts b/src/plugins/discover/public/application/context/utils/replace_context_location.ts new file mode 100644 index 0000000000000..21e18ea76e016 --- /dev/null +++ b/src/plugins/discover/public/application/context/utils/replace_context_location.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { DiscoverContextAppLocator, DiscoverContextAppLocatorParams } from '../services/locator'; + +export const replaceContextLocation = ( + contextLocator: DiscoverContextAppLocator, + params: DiscoverContextAppLocatorParams +) => contextLocator.navigate(params, { replace: true }); diff --git a/src/plugins/discover/public/application/discover_router.tsx b/src/plugins/discover/public/application/discover_router.tsx index 1fe847d17beb7..9cac8a4f1f50a 100644 --- a/src/plugins/discover/public/application/discover_router.tsx +++ b/src/plugins/discover/public/application/discover_router.tsx @@ -17,14 +17,8 @@ import { DiscoverMainRoute } from './main'; import { NotFoundRoute } from './not_found'; import { DiscoverServices } from '../build_services'; import { ViewAlertRoute } from './view_alert'; -import { HistoryLocationState } from '../locator'; -export const discoverRouter = ( - services: DiscoverServices, - history: History, - isDev: boolean, - historyLocationState?: HistoryLocationState -) => ( +export const discoverRouter = (services: DiscoverServices, history: History, isDev: boolean) => ( @@ -45,10 +39,10 @@ export const discoverRouter = ( - + - + diff --git a/src/plugins/discover/public/application/doc/components/doc.test.tsx b/src/plugins/discover/public/application/doc/components/doc.test.tsx index a2faa7778c275..1a808bb05db7f 100644 --- a/src/plugins/discover/public/application/doc/components/doc.test.tsx +++ b/src/plugins/discover/public/application/doc/components/doc.test.tsx @@ -57,6 +57,7 @@ async function mountDoc(update = false) { id: '1', index: 'index1', dataView: dataViewMock, + referrer: 'mock-referrer', } as DocProps; let comp!: ReactWrapper; const services = { @@ -82,6 +83,8 @@ async function mountDoc(update = false) { } }, }, + locator: { getUrl: jest.fn(() => Promise.resolve('mock-url')) }, + chrome: { setBreadcrumbs: jest.fn() }, }; await act(async () => { comp = mountWithIntl( diff --git a/src/plugins/discover/public/application/doc/components/doc.tsx b/src/plugins/discover/public/application/doc/components/doc.tsx index 8ec6133b73328..c55a200ee47e5 100644 --- a/src/plugins/discover/public/application/doc/components/doc.tsx +++ b/src/plugins/discover/public/application/doc/components/doc.tsx @@ -17,6 +17,7 @@ import { } from '@elastic/eui'; import type { DataView } from '@kbn/data-views-plugin/public'; import { i18n } from '@kbn/i18n'; +import { getRootBreadcrumbs } from '../../../utils/breadcrumbs'; import { DocViewer } from '../../../services/doc_views/components/doc_viewer'; import { ElasticRequestState } from '../types'; import { useEsDocSearch } from '../../../hooks/use_es_doc_search'; @@ -39,12 +40,16 @@ export interface DocProps { * If set, will always request source, regardless of the global `fieldsFromSource` setting */ requestSource?: boolean; + /** + * Discover main view url + */ + referrer?: string; } export function Doc(props: DocProps) { const { dataView } = props; const [reqState, hit] = useEsDocSearch(props); - const { docLinks } = useDiscoverServices(); + const { locator, chrome, docLinks } = useDiscoverServices(); const indexExistsLink = docLinks.links.apis.indexExists; const singleDocTitle = useRef(null); @@ -52,6 +57,13 @@ export function Doc(props: DocProps) { singleDocTitle.current?.focus(); }, []); + useEffect(() => { + chrome.setBreadcrumbs([ + ...getRootBreadcrumbs(props.referrer), + { text: `${props.index}#${props.id}` }, + ]); + }, [chrome, props.referrer, props.index, props.id, dataView, locator]); + return (

{ + const locator = new DiscoverSingleDocLocatorDefinition(); + return { locator }; +}; + +describe('Discover single doc url generator', () => { + test('should create init single doc page', async () => { + const { locator } = setup(); + const { app, path, state } = await locator.getLocation({ + index: dataViewId, + rowId: 'mock-row-id', + rowIndex: 'mock-row-index', + referrer: 'mock-referrer', + }); + + expect(app).toBe('discover'); + expect(state).toEqual({ referrer: 'mock-referrer' }); + expect(path).toMatchInlineSnapshot( + `"#/doc/c367b774-a4c2-11ea-bb37-0242ac130002/mock-row-index?id=mock-row-id"` + ); + }); +}); diff --git a/src/plugins/discover/public/application/doc/locator.ts b/src/plugins/discover/public/application/doc/locator.ts new file mode 100644 index 0000000000000..f3ee0c2942070 --- /dev/null +++ b/src/plugins/discover/public/application/doc/locator.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SerializableRecord } from '@kbn/utility-types'; +import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public'; +import { DataViewSpec } from '@kbn/data-views-plugin/public'; + +export const DISCOVER_SINGLE_DOC_LOCATOR = 'DISCOVER_SINGLE_DOC_LOCATOR'; + +export interface DiscoverSingleDocLocatorParams extends SerializableRecord { + index: string | DataViewSpec; // spec in case of adhoc data view + rowId: string; + rowIndex: string; + referrer: string; // discover main view url +} + +export type DiscoverSingleDocLocator = LocatorPublic; + +export interface DocHistoryLocationState { + referrer: string; + dataViewSpec?: DataViewSpec; +} + +export class DiscoverSingleDocLocatorDefinition + implements LocatorDefinition +{ + public readonly id = DISCOVER_SINGLE_DOC_LOCATOR; + + constructor() {} + + public readonly getLocation = async (params: DiscoverSingleDocLocatorParams) => { + const { index, rowId, rowIndex, referrer } = params; + + let dataViewId; + const state: DocHistoryLocationState = { referrer }; + if (typeof index === 'object') { + state.dataViewSpec = index; + dataViewId = index.id!; + } else { + dataViewId = index; + } + + const path = `#/doc/${dataViewId}/${rowIndex}?id=${rowId}`; + + return { + app: 'discover', + path, + state, + }; + }; +} diff --git a/src/plugins/discover/public/application/doc/single_doc_route.tsx b/src/plugins/discover/public/application/doc/single_doc_route.tsx index 99474923b8c9a..07edc52c40687 100644 --- a/src/plugins/discover/public/application/doc/single_doc_route.tsx +++ b/src/plugins/discover/public/application/doc/single_doc_route.tsx @@ -5,37 +5,37 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import React, { useEffect } from 'react'; -import { useParams } from 'react-router-dom'; +import React, { useEffect, useMemo } from 'react'; +import { useLocation, useParams } from 'react-router-dom'; import { EuiEmptyPrompt } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { useExecutionContext } from '@kbn/kibana-react-plugin/public'; -import { getRootBreadcrumbs } from '../../utils/breadcrumbs'; +import { i18n } from '@kbn/i18n'; import { LoadingIndicator } from '../../components/common/loading_indicator'; -import { useDataView } from '../../hooks/use_data_view'; -import { withQueryParams } from '../../utils/with_query_params'; -import { useMainRouteBreadcrumb } from '../../hooks/use_navigation_props'; import { Doc } from './components/doc'; import { useDiscoverServices } from '../../hooks/use_discover_services'; - -export interface SingleDocRouteProps { - /** - * Document id - */ - id: string; -} +import { getScopedHistory } from '../../kibana_services'; +import { DiscoverError } from '../../components/common/error_alert'; +import { useDataView } from '../../hooks/use_data_view'; +import { DocHistoryLocationState } from './locator'; export interface DocUrlParams { dataViewId: string; index: string; } -const SingleDoc = ({ id }: SingleDocRouteProps) => { - const services = useDiscoverServices(); - const { chrome, timefilter, core } = services; - +export const SingleDocRoute = () => { + const { timefilter, core } = useDiscoverServices(); + const { search } = useLocation(); const { dataViewId, index } = useParams(); - const breadcrumb = useMainRouteBreadcrumb(); + + const query = useMemo(() => new URLSearchParams(search), [search]); + const id = query.get('id'); + + const locationState = useMemo( + () => getScopedHistory().location.state as DocHistoryLocationState | undefined, + [] + ); useExecutionContext(core.executionContext, { type: 'application', @@ -43,21 +43,14 @@ const SingleDoc = ({ id }: SingleDocRouteProps) => { id: dataViewId, }); - useEffect(() => { - chrome.setBreadcrumbs([ - ...getRootBreadcrumbs(breadcrumb), - { - text: `${index}#${id}`, - }, - ]); - }, [chrome, index, id, breadcrumb]); - useEffect(() => { timefilter.disableAutoRefreshSelector(); timefilter.disableTimeRangeSelector(); - }); + }, [timefilter]); - const { dataView, error } = useDataView(services.dataViews, dataViewId); + const { dataView, error } = useDataView({ + index: locationState?.dataViewSpec || decodeURIComponent(dataViewId), + }); if (error) { return ( @@ -85,11 +78,23 @@ const SingleDoc = ({ id }: SingleDocRouteProps) => { return ; } + if (!id) { + return ( + + ); + } + return (
- +
); }; - -export const SingleDocRoute = withQueryParams(SingleDoc, ['id']); diff --git a/src/plugins/discover/public/application/index.tsx b/src/plugins/discover/public/application/index.tsx index 2542a639be71f..5ae2ed76923b5 100644 --- a/src/plugins/discover/public/application/index.tsx +++ b/src/plugins/discover/public/application/index.tsx @@ -9,14 +9,8 @@ import { i18n } from '@kbn/i18n'; import { toMountPoint, wrapWithTheme } from '@kbn/kibana-react-plugin/public'; import { discoverRouter } from './discover_router'; import { DiscoverServices } from '../build_services'; -import { HistoryLocationState } from '../locator'; -export const renderApp = ( - element: HTMLElement, - services: DiscoverServices, - isDev: boolean, - historyLocationState?: HistoryLocationState -) => { +export const renderApp = (element: HTMLElement, services: DiscoverServices, isDev: boolean) => { const { history: getHistory, capabilities, chrome, data, core } = services; const history = getHistory(); @@ -32,7 +26,7 @@ export const renderApp = ( }); } const unmount = toMountPoint( - wrapWithTheme(discoverRouter(services, history, isDev, historyLocationState), core.theme.theme$) + wrapWithTheme(discoverRouter(services, history, isDev), core.theme.theme$) )(element); return () => { diff --git a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx index 2aacf598e58c4..1ebde4c4a6aac 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx @@ -215,6 +215,7 @@ function DiscoverDocumentsComponent({ rowsPerPageState={state.rowsPerPage} onUpdateRowsPerPage={onUpdateRowsPerPage} onFieldEdited={onFieldEdited} + savedSearchId={savedSearch.id} /> diff --git a/src/plugins/discover/public/application/main/discover_main_route.test.tsx b/src/plugins/discover/public/application/main/discover_main_route.test.tsx index aead62c038e47..7ee1c7e4b134f 100644 --- a/src/plugins/discover/public/application/main/discover_main_route.test.tsx +++ b/src/plugins/discover/public/application/main/discover_main_route.test.tsx @@ -8,13 +8,13 @@ import React from 'react'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import { waitFor } from '@testing-library/react'; -import { setHeaderActionMenuMounter } from '../../kibana_services'; +import { setHeaderActionMenuMounter, setScopedHistory } from '../../kibana_services'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { discoverServiceMock } from '../../__mocks__/services'; import { DiscoverMainRoute } from './discover_main_route'; import { MemoryRouter } from 'react-router-dom'; import { dataViewMock } from '../../__mocks__/data_view'; -import { SavedObject } from '@kbn/core/public'; +import { SavedObject, ScopedHistory } from '@kbn/core/public'; import { DataViewSavedObjectAttrs } from '@kbn/data-views-plugin/common'; import { DiscoverMainApp } from './discover_main_app'; import { SearchSource } from '@kbn/data-plugin/common'; @@ -26,6 +26,8 @@ jest.mock('./discover_main_app', () => { }; }); +setScopedHistory({ location: {} } as ScopedHistory); + describe('DiscoverMainRoute', () => { test('renders the main app when hasESData=true & hasUserDataView=true ', async () => { const component = mountComponent(true, true); 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 4d3dccaa68001..e6b2ca1d197bb 100644 --- a/src/plugins/discover/public/application/main/discover_main_route.tsx +++ b/src/plugins/discover/public/application/main/discover_main_route.tsx @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import React, { useEffect, useState, memo, useCallback } from 'react'; +import React, { useEffect, useState, memo, useCallback, useMemo } from 'react'; import { useParams, useHistory } from 'react-router-dom'; import { DataViewListItem } from '@kbn/data-plugin/public'; import { DataViewSavedObjectConflictError } from '@kbn/data-views-plugin/public'; @@ -27,9 +27,9 @@ import { getRootBreadcrumbs, getSavedSearchBreadcrumbs } from '../../utils/bread import { LoadingIndicator } from '../../components/common/loading_indicator'; import { DiscoverError } from '../../components/common/error_alert'; import { useDiscoverServices } from '../../hooks/use_discover_services'; -import { getUrlTracker } from '../../kibana_services'; +import { getScopedHistory, getUrlTracker } from '../../kibana_services'; import { restoreStateFromSavedSearch } from '../../services/saved_searches/restore_from_saved_search'; -import { HistoryLocationState } from '../../locator'; +import { MainHistoryLocationState } from '../../locator'; const DiscoverMainAppMemoized = memo(DiscoverMainApp); @@ -39,7 +39,6 @@ interface DiscoverLandingParams { interface Props { isDev: boolean; - historyLocationState?: HistoryLocationState; } export function DiscoverMainRoute(props: Props) { @@ -64,6 +63,14 @@ export function DiscoverMainRoute(props: Props) { const [showNoDataPage, setShowNoDataPage] = useState(false); const { id } = useParams(); + /** + * Get location state of scoped history only on initial load + */ + const historyLocationState = useMemo( + () => getScopedHistory().location.state as MainHistoryLocationState | undefined, + [] + ); + useExecutionContext(core.executionContext, { type: 'application', page: 'app', @@ -99,7 +106,7 @@ export function DiscoverMainRoute(props: Props) { data.dataViews, config, index, - props.historyLocationState?.dataViewSpec + historyLocationState?.dataViewSpec ); const ipList = ip.list; @@ -117,7 +124,7 @@ export function DiscoverMainRoute(props: Props) { data.dataViews, history, isDev, - props.historyLocationState?.dataViewSpec, + historyLocationState?.dataViewSpec, toastNotifications, services, ] diff --git a/src/plugins/discover/public/application/main/utils/get_fetch_observeable.test.ts b/src/plugins/discover/public/application/main/utils/get_fetch_observeable.test.ts index e39642ac2bce2..0d0f1f0802bff 100644 --- a/src/plugins/discover/public/application/main/utils/get_fetch_observeable.test.ts +++ b/src/plugins/discover/public/application/main/utils/get_fetch_observeable.test.ts @@ -51,7 +51,7 @@ describe('getFetchObservable', () => { jest.useRealTimers(); }); - test('refetch$.next should trigger fetch$.next', async (done) => { + test('refetch$.next should trigger fetch$.next', (done) => { const searchSessionManagerMock = createSearchSessionMock(); const main$ = new BehaviorSubject({ fetchStatus: FetchStatus.UNINITIALIZED }); @@ -75,7 +75,7 @@ describe('getFetchObservable', () => { test( 'getAutoRefreshFetch$ should trigger fetch$.next', fakeSchedulers((advance) => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const searchSessionManagerMock = createSearchSessionMock(); const autoRefreshFetch$ = new Subject(); diff --git a/src/plugins/discover/public/build_services.ts b/src/plugins/discover/public/build_services.ts index 86675ae54441a..8271e7681f7da 100644 --- a/src/plugins/discover/public/build_services.ts +++ b/src/plugins/discover/public/build_services.ts @@ -49,6 +49,8 @@ import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/ import { DiscoverAppLocator } from './locator'; import { getHistory } from './kibana_services'; import { DiscoverStartPlugins } from './plugin'; +import { DiscoverContextAppLocator } from './application/context/services/locator'; +import { DiscoverSingleDocLocator } from './application/doc/locator'; export interface HistoryLocationState { referrer: string; @@ -85,6 +87,8 @@ export interface DiscoverServices { spaces?: SpacesApi; triggersActionsUi: TriggersAndActionsUIPublicPluginStart; locator: DiscoverAppLocator; + contextLocator: DiscoverContextAppLocator; + singleDocLocator: DiscoverSingleDocLocator; expressions: ExpressionsStart; charts: ChartsPluginStart; savedObjectsManagement: SavedObjectsManagementPluginStart; @@ -96,7 +100,9 @@ export const buildServices = memoize(function ( core: CoreStart, plugins: DiscoverStartPlugins, context: PluginInitializerContext, - locator: DiscoverAppLocator + locator: DiscoverAppLocator, + contextLocator: DiscoverContextAppLocator, + singleDocLocator: DiscoverSingleDocLocator ): DiscoverServices { const { usageCollection } = plugins; const storage = new Storage(localStorage); @@ -134,6 +140,8 @@ export const buildServices = memoize(function ( dataViewEditor: plugins.dataViewEditor, triggersActionsUi: plugins.triggersActionsUi, locator, + contextLocator, + singleDocLocator, expressions: plugins.expressions, charts: plugins.charts, savedObjectsTagging: plugins.savedObjectsTaggingOss?.getTaggingApi(), diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid.tsx index 2da63f982e305..c732f06a05dd7 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid.tsx @@ -24,6 +24,7 @@ import { } from '@elastic/eui'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { SortOrder } from '@kbn/saved-search-plugin/public'; +import { Filter } from '@kbn/es-query'; import { DocViewFilterFn } from '../../services/doc_views/doc_views_types'; import { getSchemaDetectors } from './discover_grid_schema'; import { DiscoverGridFlyout } from './discover_grid_flyout'; @@ -178,6 +179,14 @@ export interface DiscoverGridProps { * Callback to execute on edit runtime field */ onFieldEdited?: () => void; + /** + * Filters applied by saved search embeddable + */ + filters?: Filter[]; + /** + * Saved search id used for links to single doc and surrounding docs in the flyout + */ + savedSearchId?: string; } export const EuiDataGridMemoized = React.memo(EuiDataGrid); @@ -191,6 +200,8 @@ export const DiscoverGrid = ({ isLoading, expandedDoc, onAddColumn, + filters, + savedSearchId, onFilter, onRemoveColumn, onResize, @@ -621,6 +632,8 @@ export const DiscoverGrid = ({ hits={displayedRows} // if default columns are used, dont make them part of the URL - the context state handling will take care to restore them columns={defaultColumns ? [] : displayedColumns} + filters={filters} + savedSearchId={savedSearchId} onFilter={onFilter} onRemoveColumn={onRemoveColumn} onAddColumn={onAddColumn} diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.test.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.test.tsx index 193a1667d2bb9..bdda6d80436c8 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.test.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.test.tsx @@ -21,11 +21,22 @@ import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { DataTableRecord, EsHitRecord } from '../../types'; import { buildDataTableRecord } from '../../utils/build_data_record'; +import { act } from 'react-dom/test-utils'; +import { ReactWrapper } from 'enzyme'; + +const waitNextTick = () => new Promise((resolve) => setTimeout(resolve, 0)); + +const waitNextUpdate = async (component: ReactWrapper) => { + await act(async () => { + await waitNextTick(); + }); + component.update(); +}; describe('Discover flyout', function () { setDocViewsRegistry(new DocViewsRegistry()); - const mountComponent = ({ + const mountComponent = async ({ dataView, hits, hitIndex, @@ -39,6 +50,13 @@ describe('Discover flyout', function () { filterManager: createFilterManagerMock(), addBasePath: (path: string) => `/base${path}`, history: () => ({ location: {} }), + locator: { + useUrl: jest.fn(() => ''), + navigate: jest.fn(), + getUrl: jest.fn(() => Promise.resolve('mock-referrer')), + }, + contextLocator: { getRedirectUrl: jest.fn(() => 'mock-context-redirect-url') }, + singleDocLocator: { getRedirectUrl: jest.fn(() => 'mock-doc-redirect-url') }, } as unknown as DiscoverServices; const hit = buildDataTableRecord( @@ -67,42 +85,39 @@ describe('Discover flyout', function () { ); const component = mountWithIntl(); + await waitNextUpdate(component); return { component, props }; }; it('should be rendered correctly using an data view without timefield', async () => { - const { component, props } = mountComponent({}); + const { component, props } = await mountComponent({}); const url = findTestSubject(component, 'docTableRowAction').prop('href'); - expect(url).toMatchInlineSnapshot(`"/base/app/discover#/doc/the-data-view-id/i?id=1"`); + expect(url).toMatchInlineSnapshot(`"mock-doc-redirect-url"`); findTestSubject(component, 'euiFlyoutCloseButton').simulate('click'); expect(props.onClose).toHaveBeenCalled(); }); it('should be rendered correctly using an data view with timefield', async () => { - const { component, props } = mountComponent({ dataView: dataViewWithTimefieldMock }); + const { component, props } = await mountComponent({ dataView: dataViewWithTimefieldMock }); const actions = findTestSubject(component, 'docTableRowAction'); expect(actions.length).toBe(2); - expect(actions.first().prop('href')).toMatchInlineSnapshot( - `"/base/app/discover#/doc/index-pattern-with-timefield-id/i?id=1"` - ); - expect(actions.last().prop('href')).toMatchInlineSnapshot( - `"/base/app/discover#/context/index-pattern-with-timefield-id/1?_g=(filters:!())&_a=(columns:!(date),filters:!())"` - ); + expect(actions.first().prop('href')).toMatchInlineSnapshot(`"mock-doc-redirect-url"`); + expect(actions.last().prop('href')).toMatchInlineSnapshot(`"mock-context-redirect-url"`); findTestSubject(component, 'euiFlyoutCloseButton').simulate('click'); expect(props.onClose).toHaveBeenCalled(); }); it('displays document navigation when there is more than 1 doc available', async () => { - const { component } = mountComponent({ dataView: dataViewWithTimefieldMock }); + const { component } = await mountComponent({ dataView: dataViewWithTimefieldMock }); const docNav = findTestSubject(component, 'dscDocNavigation'); expect(docNav.length).toBeTruthy(); }); it('displays no document navigation when there are 0 docs available', async () => { - const { component } = mountComponent({ hits: [] }); + const { component } = await mountComponent({ hits: [] }); const docNav = findTestSubject(component, 'dscDocNavigation'); expect(docNav.length).toBeFalsy(); }); @@ -125,14 +140,14 @@ describe('Discover flyout', function () { _source: { date: '2020-20-01T12:12:12.124', name: 'test2', extension: 'jpg' }, }, ].map((hit) => buildDataTableRecord(hit, dataViewMock)); - const { component } = mountComponent({ hits }); + const { component } = await mountComponent({ hits }); const docNav = findTestSubject(component, 'dscDocNavigation'); expect(docNav.length).toBeFalsy(); }); it('allows you to navigate to the next doc, if expanded doc is the first', async () => { // scenario: you've expanded a doc, and in the next request different docs where fetched - const { component, props } = mountComponent({}); + const { component, props } = await mountComponent({}); findTestSubject(component, 'pagination-button-next').simulate('click'); // we selected 1, so we'd expect 2 expect(props.setExpandedDoc.mock.calls[0][0].raw._id).toBe('2'); @@ -140,28 +155,28 @@ describe('Discover flyout', function () { it('doesnt allow you to navigate to the previous doc, if expanded doc is the first', async () => { // scenario: you've expanded a doc, and in the next request differed docs where fetched - const { component, props } = mountComponent({}); + const { component, props } = await mountComponent({}); findTestSubject(component, 'pagination-button-previous').simulate('click'); expect(props.setExpandedDoc).toHaveBeenCalledTimes(0); }); it('doesnt allow you to navigate to the next doc, if expanded doc is the last', async () => { // scenario: you've expanded a doc, and in the next request differed docs where fetched - const { component, props } = mountComponent({ hitIndex: esHits.length - 1 }); + const { component, props } = await mountComponent({ hitIndex: esHits.length - 1 }); findTestSubject(component, 'pagination-button-next').simulate('click'); expect(props.setExpandedDoc).toHaveBeenCalledTimes(0); }); it('allows you to navigate to the previous doc, if expanded doc is the last', async () => { // scenario: you've expanded a doc, and in the next request differed docs where fetched - const { component, props } = mountComponent({ hitIndex: esHits.length - 1 }); + const { component, props } = await mountComponent({ hitIndex: esHits.length - 1 }); findTestSubject(component, 'pagination-button-previous').simulate('click'); expect(props.setExpandedDoc).toHaveBeenCalledTimes(1); expect(props.setExpandedDoc.mock.calls[0][0].raw._id).toBe('4'); }); - it('allows navigating with arrow keys through documents', () => { - const { component, props } = mountComponent({}); + it('allows navigating with arrow keys through documents', async () => { + const { component, props } = await mountComponent({}); findTestSubject(component, 'docTableDetailsFlyout').simulate('keydown', { key: 'ArrowRight' }); expect(props.setExpandedDoc).toHaveBeenCalledWith(expect.objectContaining({ id: 'i::2::' })); component.setProps({ ...props, hit: props.hits[1] }); @@ -169,8 +184,8 @@ describe('Discover flyout', function () { expect(props.setExpandedDoc).toHaveBeenCalledWith(expect.objectContaining({ id: 'i::1::' })); }); - it('should not navigate with keypresses when already at the border of documents', () => { - const { component, props } = mountComponent({}); + it('should not navigate with keypresses when already at the border of documents', async () => { + const { component, props } = await mountComponent({}); findTestSubject(component, 'docTableDetailsFlyout').simulate('keydown', { key: 'ArrowLeft' }); expect(props.setExpandedDoc).not.toHaveBeenCalled(); component.setProps({ ...props, hit: props.hits[props.hits.length - 1] }); diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.tsx index fb701eda3f19f..dd541a9cc4de8 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.tsx @@ -25,6 +25,7 @@ import { EuiHideFor, keys, } from '@elastic/eui'; +import { Filter } from '@kbn/es-query'; import { DocViewer } from '../../services/doc_views/components/doc_viewer/doc_viewer'; import { DocViewFilterFn } from '../../services/doc_views/doc_views_types'; import { useNavigationProps } from '../../hooks/use_navigation_props'; @@ -32,6 +33,8 @@ import { useDiscoverServices } from '../../hooks/use_discover_services'; import type { DataTableRecord } from '../../types'; export interface DiscoverGridFlyoutProps { + savedSearchId?: string; + filters?: Filter[]; columns: string[]; hit: DataTableRecord; hits?: DataTableRecord[]; @@ -56,6 +59,8 @@ export function DiscoverGridFlyout({ hits, dataView, columns, + savedSearchId, + filters, onFilter, onClose, onRemoveColumn, @@ -95,14 +100,9 @@ export function DiscoverGridFlyout({ [activePage, setPage] ); - const { singleDocProps, surrDocsProps } = useNavigationProps({ - dataViewId: dataView.id!, - rowIndex: hit.raw._index, - rowId: hit.raw._id, - filterManager: services.filterManager, - addBasePath: services.addBasePath, - columns, - }); + const { singleDocHref, contextViewHref, onOpenSingleDoc, onOpenContextView } = useNavigationProps( + { dataView, rowIndex: hit.raw._index, rowId: hit.raw._id, columns, filters, savedSearchId } + ); return ( @@ -140,13 +140,15 @@ export function DiscoverGridFlyout({ + {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} {i18n.translate('discover.grid.tableRow.viewSingleDocumentLinkTextSimple', { defaultMessage: 'Single document', @@ -156,12 +158,14 @@ export function DiscoverGridFlyout({ {dataView.isTimeBased() && dataView.id && ( + {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} {i18n.translate( diff --git a/src/plugins/discover/public/components/doc_table/components/table_row.tsx b/src/plugins/discover/public/components/doc_table/components/table_row.tsx index ecccc92f5030f..c08154f1ce5db 100644 --- a/src/plugins/discover/public/components/doc_table/components/table_row.tsx +++ b/src/plugins/discover/public/components/doc_table/components/table_row.tsx @@ -11,11 +11,11 @@ import classNames from 'classnames'; import { i18n } from '@kbn/i18n'; import { EuiButtonEmpty, EuiIcon } from '@elastic/eui'; import { DataView } from '@kbn/data-views-plugin/public'; +import { Filter } from '@kbn/es-query'; import { formatFieldValue } from '../../../utils/format_value'; import { DocViewer } from '../../../services/doc_views/components/doc_viewer'; import { TableCell } from './table_row/table_cell'; import { formatRow, formatTopLevelObject } from '../utils/row_formatter'; -import { useNavigationProps } from '../../../hooks/use_navigation_props'; import { DocViewFilterFn } from '../../../services/doc_views/doc_views_types'; import { DataTableRecord, EsHitRecord } from '../../../types'; import { TableRowDetails } from './table_row_details'; @@ -29,6 +29,8 @@ export type DocTableRow = EsHitRecord & { export interface TableRowProps { columns: string[]; filter: DocViewFilterFn; + filters?: Filter[]; + savedSearchId?: string; row: DataTableRecord; dataView: DataView; useNewFieldsApi: boolean; @@ -38,8 +40,10 @@ export interface TableRowProps { } export const TableRow = ({ + filters, columns, filter, + savedSearchId, row, dataView, useNewFieldsApi, @@ -47,7 +51,7 @@ export const TableRow = ({ onAddColumn, onRemoveColumn, }: TableRowProps) => { - const { uiSettings, filterManager, fieldFormats, addBasePath } = useDiscoverServices(); + const { uiSettings, fieldFormats } = useDiscoverServices(); const [maxEntries, hideTimeColumn] = useMemo( () => [ uiSettings.get(MAX_DOC_FIELDS_DISPLAYED), @@ -98,15 +102,6 @@ export const TableRow = ({ [filter, dataView.fields, row.flattened] ); - const { singleDocProps, surrDocsProps } = useNavigationProps({ - dataViewId: dataView.id!, - rowIndex: row.raw._index, - rowId: row.raw._id, - filterManager, - addBasePath, - columns, - }); - const rowCells = [ - - - + rowIndex={row.raw._index} + rowId={row.raw._id} + columns={columns} + filters={filters} + savedSearchId={savedSearchId} + > + + + )} ); diff --git a/src/plugins/discover/public/components/doc_table/components/table_row_details.tsx b/src/plugins/discover/public/components/doc_table/components/table_row_details.tsx index 89c29c4846fc4..08ebd3072b17e 100644 --- a/src/plugins/discover/public/components/doc_table/components/table_row_details.tsx +++ b/src/plugins/discover/public/components/doc_table/components/table_row_details.tsx @@ -7,29 +7,45 @@ */ import React from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLink, EuiTitle } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiButtonEmpty, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { DiscoverNavigationProps } from '../../../hooks/use_navigation_props'; +import type { DataView } from '@kbn/data-views-plugin/public'; +import type { Filter } from '@kbn/es-query'; +import { useNavigationProps } from '../../../hooks/use_navigation_props'; + interface TableRowDetailsProps { - open: boolean; + children: JSX.Element; colLength: number; + rowIndex: string; + rowId: string; + columns: string[]; isTimeBased: boolean; - singleDocProps: DiscoverNavigationProps; - surrDocsProps: DiscoverNavigationProps; - children: JSX.Element; + dataView: DataView; + filters?: Filter[]; + savedSearchId?: string; } export const TableRowDetails = ({ - open, colLength, isTimeBased, - singleDocProps, - surrDocsProps, children, + dataView, + rowIndex, + rowId, + columns, + filters, + savedSearchId, }: TableRowDetailsProps) => { - if (!open) { - return null; - } + const { singleDocHref, contextViewHref, onOpenSingleDoc, onOpenContextView } = useNavigationProps( + { + dataView, + rowIndex, + rowId, + columns, + filters, + savedSearchId, + } + ); return ( @@ -55,21 +71,39 @@ export const TableRowDetails = ({ {isTimeBased && ( - + /* eslint-disable-next-line @elastic/eui/href-or-on-click */ + - + )} - + {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} + - + diff --git a/src/plugins/discover/public/components/doc_table/create_doc_table_embeddable.tsx b/src/plugins/discover/public/components/doc_table/create_doc_table_embeddable.tsx index dbfe99d37bbd2..c6312a5515076 100644 --- a/src/plugins/discover/public/components/doc_table/create_doc_table_embeddable.tsx +++ b/src/plugins/discover/public/components/doc_table/create_doc_table_embeddable.tsx @@ -25,6 +25,7 @@ export function DiscoverDocTableEmbeddable(renderProps: DocTableEmbeddableProps) onMoveColumn={renderProps.onMoveColumn} onRemoveColumn={renderProps.onRemoveColumn} sort={renderProps.sort} + filters={renderProps.filters} onFilter={renderProps.onFilter} useNewFieldsApi={renderProps.useNewFieldsApi} searchDescription={renderProps.searchDescription} diff --git a/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx b/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx index 23f8b3e2e888b..fa4753587d758 100644 --- a/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx +++ b/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx @@ -11,6 +11,7 @@ import { EuiIcon, EuiSpacer, EuiText } from '@elastic/eui'; import type { DataView, DataViewField } from '@kbn/data-views-plugin/public'; import type { SortOrder } from '@kbn/saved-search-plugin/public'; import { FormattedMessage } from '@kbn/i18n-react'; +import { Filter } from '@kbn/es-query'; import { TableHeader } from './components/table_header/table_header'; import { SHOW_MULTIFIELDS } from '../../../common'; import { TableRow } from './components/table_row'; @@ -56,6 +57,14 @@ export interface DocTableProps { * Loading state */ isLoading: boolean; + /** + * Filters applied by embeddalbe + */ + filters?: Filter[]; + /** + * Saved search id + */ + savedSearchId?: string; /** * Filter callback */ @@ -100,6 +109,8 @@ export const DocTableWrapper = forwardRef( { render, columns, + filters, + savedSearchId, rows, dataView, onSort, @@ -161,6 +172,8 @@ export const DocTableWrapper = forwardRef( )); }, - [columns, onFilter, dataView, useNewFieldsApi, fieldsToShow, onAddColumn, onRemoveColumn] + [ + columns, + filters, + savedSearchId, + onFilter, + dataView, + useNewFieldsApi, + fieldsToShow, + onAddColumn, + onRemoveColumn, + ] ); return ( diff --git a/src/plugins/discover/public/embeddable/saved_search_embeddable.test.ts b/src/plugins/discover/public/embeddable/saved_search_embeddable.test.ts index 28a4bb185ea76..10be9bb3e3c66 100644 --- a/src/plugins/discover/public/embeddable/saved_search_embeddable.test.ts +++ b/src/plugins/discover/public/embeddable/saved_search_embeddable.test.ts @@ -16,8 +16,11 @@ import { discoverServiceMock } from '../__mocks__/services'; import { SavedSearchEmbeddable, SearchEmbeddableConfig } from './saved_search_embeddable'; import { render } from 'react-dom'; import { createSearchSourceMock } from '@kbn/data-plugin/public/mocks'; -import { throwError } from 'rxjs'; +import { of, throwError } from 'rxjs'; import { ReactWrapper } from 'enzyme'; +import { SHOW_FIELD_STATISTICS } from '../../common'; +import { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; +import { VIEW_MODE } from '../components/view_mode_toggle'; import { SavedSearchEmbeddableComponent } from './saved_search_embeddable_component'; let discoverComponent: ReactWrapper; @@ -38,13 +41,17 @@ describe('saved search embeddable', () => { let mountpoint: HTMLDivElement; let filterManagerMock: jest.Mocked; let servicesMock: jest.Mocked; + let executeTriggerActions: jest.Mock; + let showFieldStatisticsMockValue: boolean = false; + let viewModeMockValue: VIEW_MODE = VIEW_MODE.DOCUMENT_LEVEL; const createEmbeddable = (searchMock?: jest.Mock) => { const savedSearchMock = { id: 'mock-id', sort: [['message', 'asc']] as Array<[string, string]>, searchSource: createSearchSourceMock({ index: dataViewMock }, undefined, searchMock), + viewMode: viewModeMockValue, }; const url = getSavedSearchUrl(savedSearchMock.id); @@ -87,28 +94,27 @@ describe('saved search embeddable', () => { beforeEach(() => { mountpoint = document.createElement('div'); filterManagerMock = createFilterManagerMock(); + + showFieldStatisticsMockValue = false; + viewModeMockValue = VIEW_MODE.DOCUMENT_LEVEL; + servicesMock = discoverServiceMock as unknown as jest.Mocked; + + (servicesMock.uiSettings as unknown as jest.Mocked).get.mockImplementation( + (key: string) => { + if (key === SHOW_FIELD_STATISTICS) return showFieldStatisticsMockValue; + } + ); }); afterEach(() => { mountpoint.remove(); - }); - - it('should render saved search embeddable two times initially', async () => { - const { embeddable } = createEmbeddable(); - embeddable.updateOutput = jest.fn(); - - embeddable.render(mountpoint); - expect(render).toHaveBeenCalledTimes(1); - - // wait for data fetching - await waitOneTick(); - expect(render).toHaveBeenCalledTimes(2); + jest.resetAllMocks(); }); it('should update input correctly', async () => { const { embeddable } = createEmbeddable(); - embeddable.updateOutput = jest.fn(); + jest.spyOn(embeddable, 'updateOutput'); embeddable.render(mountpoint); await waitOneTick(); @@ -146,10 +152,101 @@ describe('saved search embeddable', () => { expect(executeTriggerActions).toHaveBeenCalled(); }); + it('should render saved search embeddable when successfully loading data', async () => { + // mock return data + const search = jest.fn().mockReturnValue( + of({ + rawResponse: { hits: { hits: [{ id: 1 }], total: 1 } }, + isPartial: false, + isRunning: false, + }) + ); + const { embeddable } = createEmbeddable(search); + jest.spyOn(embeddable, 'updateOutput'); + + // check that loading state + const loadingOutput = embeddable.getOutput(); + expect(loadingOutput.loading).toBe(true); + expect(loadingOutput.rendered).toBe(false); + expect(loadingOutput.error).toBe(undefined); + + embeddable.render(mountpoint); + expect(render).toHaveBeenCalledTimes(1); + + // wait for data fetching + await waitOneTick(); + expect(render).toHaveBeenCalledTimes(2); + + // check that loading state + const loadedOutput = embeddable.getOutput(); + expect(loadedOutput.loading).toBe(false); + expect(loadedOutput.rendered).toBe(true); + expect(loadedOutput.error).toBe(undefined); + }); + + it('should render saved search embeddable when empty data is returned', async () => { + // mock return data + const search = jest.fn().mockReturnValue( + of({ + rawResponse: { hits: { hits: [], total: 0 } }, + isPartial: false, + isRunning: false, + }) + ); + const { embeddable } = createEmbeddable(search); + jest.spyOn(embeddable, 'updateOutput'); + + // check that loading state + const loadingOutput = embeddable.getOutput(); + expect(loadingOutput.loading).toBe(true); + expect(loadingOutput.rendered).toBe(false); + expect(loadingOutput.error).toBe(undefined); + + embeddable.render(mountpoint); + expect(render).toHaveBeenCalledTimes(1); + + // wait for data fetching + await waitOneTick(); + expect(render).toHaveBeenCalledTimes(2); + + // check that loading state + const loadedOutput = embeddable.getOutput(); + expect(loadedOutput.loading).toBe(false); + expect(loadedOutput.rendered).toBe(true); + expect(loadedOutput.error).toBe(undefined); + }); + + it('should render in AGGREGATED_LEVEL view mode', async () => { + showFieldStatisticsMockValue = true; + viewModeMockValue = VIEW_MODE.AGGREGATED_LEVEL; + + const { embeddable } = createEmbeddable(); + jest.spyOn(embeddable, 'updateOutput'); + + // check that loading state + const loadingOutput = embeddable.getOutput(); + expect(loadingOutput.loading).toBe(true); + expect(loadingOutput.rendered).toBe(false); + expect(loadingOutput.error).toBe(undefined); + + embeddable.render(mountpoint); + expect(render).toHaveBeenCalledTimes(1); + + // wait for data fetching + await waitOneTick(); + expect(render).toHaveBeenCalledTimes(2); + + // check that loading state + const loadedOutput = embeddable.getOutput(); + expect(loadedOutput.loading).toBe(false); + expect(loadedOutput.rendered).toBe(true); + expect(loadedOutput.error).toBe(undefined); + }); + it('should emit error output in case of fetch error', async () => { const search = jest.fn().mockReturnValue(throwError(new Error('Fetch error'))); const { embeddable } = createEmbeddable(search); - embeddable.updateOutput = jest.fn(); + jest.spyOn(embeddable, 'updateOutput'); embeddable.render(mountpoint); // wait for data fetching @@ -158,5 +255,10 @@ describe('saved search embeddable', () => { expect((embeddable.updateOutput as jest.Mock).mock.calls[1][0].error.message).toBe( 'Fetch error' ); + // check that loading state + const loadedOutput = embeddable.getOutput(); + expect(loadedOutput.loading).toBe(false); + expect(loadedOutput.rendered).toBe(true); + expect(loadedOutput.error).not.toBe(undefined); }); }); diff --git a/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx b/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx index ffdead82d1dae..92fe7a1de5206 100644 --- a/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx +++ b/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx @@ -63,6 +63,8 @@ import { fetchSql } from '../application/main/utils/fetch_sql'; export type SearchProps = Partial & Partial & { + savedSearchId?: string; + filters?: Filter[]; settings?: DiscoverGridSettings; description?: string; sharedItemTitle?: string; @@ -302,6 +304,8 @@ export class SavedSearchEmbeddable const props: SearchProps = { columns: this.savedSearch.columns, + savedSearchId: this.savedSearch.id, + filters: this.savedSearch.searchSource.getField('filter') as Filter[], dataView, isLoading: false, sort, @@ -450,6 +454,8 @@ export class SavedSearchEmbeddable searchProps.sharedItemTitle = this.panelTitle; searchProps.rowHeightState = this.input.rowHeight || this.savedSearch.rowHeight; searchProps.rowsPerPageState = this.input.rowsPerPage || this.savedSearch.rowsPerPage; + searchProps.filters = this.savedSearch.searchSource.getField('filter') as Filter[]; + searchProps.savedSearchId = this.savedSearch.id; if (forceFetch || isFetchRequired) { this.filtersSearchSource.setField('filter', this.input.filters); this.filtersSearchSource.setField('query', this.input.query); @@ -479,6 +485,7 @@ export class SavedSearchEmbeddable if (!this.searchProps) { throw new Error('Search props not defined'); } + super.render(domNode as HTMLElement); this.node = domNode; @@ -515,6 +522,10 @@ export class SavedSearchEmbeddable , domNode ); + this.updateOutput({ + ...this.getOutput(), + rendered: true, + }); return; } const useLegacyTable = this.services.uiSettings.get(DOC_TABLE_LEGACY); @@ -534,12 +545,23 @@ export class SavedSearchEmbeddable , domNode ); - } - this.updateOutput({ - ...this.getOutput(), - rendered: true, - }); + const hasError = this.getOutput().error !== undefined; + + if (this.searchProps!.isLoading === false && props.searchProps.rows !== undefined) { + this.renderComplete.dispatchComplete(); + this.updateOutput({ + ...this.getOutput(), + rendered: true, + }); + } else if (hasError) { + this.renderComplete.dispatchError(); + this.updateOutput({ + ...this.getOutput(), + rendered: true, + }); + } + } } private async load(searchProps: SearchProps, forceFetch = false) { diff --git a/src/plugins/discover/public/hooks/use_data_view.test.tsx b/src/plugins/discover/public/hooks/use_data_view.test.tsx index 8ea48d314759c..11e10289ec3f9 100644 --- a/src/plugins/discover/public/hooks/use_data_view.test.tsx +++ b/src/plugins/discover/public/hooks/use_data_view.test.tsx @@ -5,27 +5,68 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { useDataView } from './use_data_view'; -import { dataViewMock } from '../__mocks__/data_view'; -import { dataViewsMock } from '../__mocks__/data_views'; + +import React from 'react'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { renderHook } from '@testing-library/react-hooks'; +import { useDataView } from './use_data_view'; -describe('Use data view', () => { - test('returning a valid data view', async () => { - const { result, waitForNextUpdate } = renderHook(() => - useDataView(dataViewsMock, 'the-data-view-id') - ); - await waitForNextUpdate(); - expect(result.current.dataView).toBe(dataViewMock); - expect(result.current.error).toBe(undefined); +const adhocDataView = { + id: '2', + title: 'test2', + fields: [], +}; + +const dataViews = [ + { + id: '1', + title: 'test', + fields: [], + }, + adhocDataView, +]; + +const mockServices = { + dataViews: { + get: jest.fn((dataViewId: string) => + Promise.resolve(dataViews.find(({ id }) => id === dataViewId)) + ), + create: jest.fn((spec) => Promise.resolve(spec)), + }, +}; + +const render = async ({ dataViewId }: { dataViewId: string }) => { + const hookResult = renderHook(() => useDataView({ index: dataViewId }), { + wrapper: ({ children }) => ( + {children} + ), }); + await hookResult.waitForNextUpdate(); - test('returning an error', async () => { - const { result, waitForNextUpdate } = renderHook(() => - useDataView(dataViewsMock, 'invalid-data-view-id') + return hookResult; +}; + +describe('useDataView', () => { + it('should load save data view', async () => { + const { result } = await render({ dataViewId: '1' }); + expect(mockServices.dataViews.get).toHaveBeenCalledWith('1'); + expect(result.current.dataView).toEqual(dataViews[0]); + }); + + it('should throw an error on saved data view load ', async () => { + mockServices.dataViews.get.mockImplementationOnce(() => + Promise.reject(new Error('can not load')) ); - await waitForNextUpdate(); - expect(result.current.dataView).toBe(undefined); - expect(result.current.error).toBeTruthy(); + + const { result } = await render({ dataViewId: '1' }); + expect(result.current.error!.message).toEqual('can not load'); + }); + + it('should get adhoc data view from cache', async () => { + const { result } = await render({ dataViewId: '2' }); + + expect(mockServices.dataViews.get).toHaveBeenCalledWith(adhocDataView.id); + expect(mockServices.dataViews.create).toBeCalledTimes(0); + expect(result.current.dataView).toEqual(adhocDataView); }); }); diff --git a/src/plugins/discover/public/hooks/use_data_view.tsx b/src/plugins/discover/public/hooks/use_data_view.tsx index f218f3468de2f..254bdb9a6bde4 100644 --- a/src/plugins/discover/public/hooks/use_data_view.tsx +++ b/src/plugins/discover/public/hooks/use_data_view.tsx @@ -6,22 +6,18 @@ * Side Public License, v 1. */ import { useEffect, useState } from 'react'; -import { DataView, DataViewsContract } from '@kbn/data-views-plugin/public'; +import type { DataView, DataViewSpec } from '@kbn/data-views-plugin/public'; +import { useDiscoverServices } from './use_discover_services'; -export const useDataView = (dataViews: DataViewsContract, dataViewId: string) => { - const [dataView, setDataView] = useState(undefined); - const [error, setError] = useState(); +export const useDataView = ({ index }: { index: string | DataViewSpec }) => { + const { dataViews } = useDiscoverServices(); + const [dataView, setDataView] = useState(); + const [error, setError] = useState(); useEffect(() => { - async function loadDataView() { - try { - const item = await dataViews.get(dataViewId); - setDataView(item); - } catch (e) { - setError(e); - } - } - loadDataView(); - }, [dataViewId, dataViews]); + const promise = typeof index === 'object' ? dataViews.create(index) : dataViews.get(index); + promise.then(setDataView).catch(setError); + }, [dataViews, index]); + return { dataView, error }; }; diff --git a/src/plugins/discover/public/hooks/use_navigation_props.test.tsx b/src/plugins/discover/public/hooks/use_navigation_props.test.tsx index 322dc6407df8b..99074e78f4c81 100644 --- a/src/plugins/discover/public/hooks/use_navigation_props.test.tsx +++ b/src/plugins/discover/public/hooks/use_navigation_props.test.tsx @@ -6,90 +6,99 @@ * Side Public License, v 1. */ -import React, { ReactElement } from 'react'; +import React, { MouseEvent } from 'react'; import { renderHook } from '@testing-library/react-hooks'; -import { createFilterManagerMock } from '@kbn/data-plugin/public/query/filter_manager/filter_manager.mock'; -import { getContextHash, useNavigationProps, UseNavigationProps } from './use_navigation_props'; -import { Router } from 'react-router-dom'; -import { createMemoryHistory } from 'history'; +import { useNavigationProps } from './use_navigation_props'; +import type { DataView } from '@kbn/data-views-plugin/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { MemoryRouter } from 'react-router-dom'; -const filterManager = createFilterManagerMock(); -const defaultProps = { - dataViewId: 'ff959d40-b880-11e8-a6d9-e546fe2bba5f', - rowIndex: 'kibana_sample_data_ecommerce', - rowId: 'QmsYdX0BQ6gV8MTfoPYE', - columns: ['customer_first_name', 'products.manufacturer'], - filterManager, - addBasePath: jest.fn(), -} as UseNavigationProps; -const basePathPrefix = 'localhost:5601/xqj'; - -const getSearch = () => { - return `?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now)) - &_a=(columns:!(${defaultProps.columns.join()}),filters:!(),index:${defaultProps.dataViewId} - ,interval:auto,query:(language:kuery,query:''),sort:!(!(order_date,desc)))`; -}; - -const getSingeDocRoute = () => { - return `/doc/${defaultProps.dataViewId}/${defaultProps.rowIndex}`; +const mockServices = { + singleDocLocator: { getRedirectUrl: jest.fn(() => 'mock-doc-redirect-url'), navigate: jest.fn() }, + contextLocator: { + getRedirectUrl: jest.fn(() => 'mock-context-redirect-url'), + navigate: jest.fn(), + }, + locator: { + getUrl: jest.fn(() => Promise.resolve('mock-referrer')), + useUrl: jest.fn(() => 'mock-referrer'), + }, + filterManager: { + getAppFilters: jest.fn(() => []), + getGlobalFilters: jest.fn(() => []), + }, + data: { + query: { + queryString: { getQuery: jest.fn(() => ({ query: 'response:200', language: 'kuery' })) }, + timefilter: { timefilter: { getTime: jest.fn(() => ({ from: 'now-15m', to: 'now' })) } }, + }, + }, }; -const getContextRoute = () => { - return `/context/${defaultProps.dataViewId}/${defaultProps.rowId}`; -}; +const dataViewMock = { + id: '1', + title: 'test', + fields: [], + isPersisted: () => false, + toSpec: () => ({ + id: '1', + title: 'test', + fields: [], + }), +} as unknown as DataView; -const render = (withRouter = true, props?: Partial) => { - const history = createMemoryHistory({ - initialEntries: ['/' + getSearch()], - }); - const wrapper = ({ children }: { children: ReactElement }) => ( - history }}> - {withRouter ? {children} : children} - +const render = async () => { + const renderResult = renderHook( + () => + useNavigationProps({ + dataView: dataViewMock, + rowIndex: 'mock-index', + rowId: 'mock-id', + columns: ['mock-column'], + }), + { + wrapper: ({ children }) => ( + + {children} + + ), + } ); - return { - result: renderHook(() => useNavigationProps({ ...defaultProps, ...props }), { wrapper }).result, - history, - }; + await renderResult.waitForNextUpdate(); + return renderResult; }; describe('useNavigationProps', () => { - test('should provide valid breadcrumb for single doc page from main view', () => { - const { result, history } = render(); - - // @ts-expect-error - result.current.singleDocProps.onClick(); - expect(history.location.pathname).toEqual(getSingeDocRoute()); - expect(history.location.search).toEqual( - `?id=${defaultProps.rowId}&breadcrumb=${encodeURIComponent(`#/${getSearch()}`)}` - ); - }); + it('should call context and single doc callbacks with correct params', async () => { + const { result } = await render(); + const commonParams = { + index: { + id: '1', + title: 'test', + fields: [], + }, + rowId: 'mock-id', + referrer: 'mock-referrer', + }; - test('should provide valid breadcrumb for context page from main view', () => { - const { result, history } = render(); + await result.current.onOpenContextView({ preventDefault: jest.fn() } as unknown as MouseEvent); + expect(mockServices.contextLocator.navigate.mock.calls[0][0]).toEqual({ + ...commonParams, + columns: ['mock-column'], + filters: [], + }); - // @ts-expect-error - result.current.surrDocsProps.onClick(); - expect(history.location.pathname).toEqual(getContextRoute()); - expect(history.location.search).toEqual( - `?${getContextHash(defaultProps.columns, filterManager)}&breadcrumb=${encodeURIComponent( - `#/${getSearch()}` - )}` - ); + await result.current.onOpenSingleDoc({ preventDefault: jest.fn() } as unknown as MouseEvent); + expect(mockServices.singleDocLocator.navigate.mock.calls[0][0]).toEqual({ + ...commonParams, + rowIndex: 'mock-index', + }); }); - test('should create valid links to the context and single doc pages from embeddable', () => { - const { result } = render(false, { addBasePath: (val: string) => `${basePathPrefix}${val}` }); + test('should create valid links to the context and single doc pages', async () => { + const { result } = await render(); - expect(result.current.singleDocProps.href!).toEqual( - `${basePathPrefix}/app/discover#${getSingeDocRoute()}?id=${defaultProps.rowId}` - ); - expect(result.current.surrDocsProps.href!).toEqual( - `${basePathPrefix}/app/discover#${getContextRoute()}?${getContextHash( - defaultProps.columns, - filterManager - )}` - ); + expect(result.current.singleDocHref).toMatchInlineSnapshot(`"mock-doc-redirect-url"`); + expect(result.current.contextViewHref).toMatchInlineSnapshot(`"mock-context-redirect-url"`); }); }); diff --git a/src/plugins/discover/public/hooks/use_navigation_props.tsx b/src/plugins/discover/public/hooks/use_navigation_props.tsx index cf839bda7c1a4..eab1bfb2937c2 100644 --- a/src/plugins/discover/public/hooks/use_navigation_props.tsx +++ b/src/plugins/discover/public/hooks/use_navigation_props.tsx @@ -6,146 +6,178 @@ * Side Public License, v 1. */ -import { MouseEventHandler, useMemo } from 'react'; -import { useHistory, matchPath } from 'react-router-dom'; -import type { Location } from 'history'; -import { stringify } from 'query-string'; -import rison from 'rison-node'; -import { disableFilter } from '@kbn/es-query'; -import { FilterManager } from '@kbn/data-plugin/public'; -import { url } from '@kbn/kibana-utils-plugin/common'; +import { useCallback, useEffect, useMemo, useState, MouseEventHandler, MouseEvent } from 'react'; +import { AggregateQuery, Query, TimeRange, Filter, disableFilter } from '@kbn/es-query'; +import type { DataView } from '@kbn/data-views-plugin/public'; +import { useHistory } from 'react-router-dom'; +import { DataPublicPluginStart, FilterManager } from '@kbn/data-plugin/public'; import { useDiscoverServices } from './use_discover_services'; -export type DiscoverNavigationProps = { onClick: () => void } | { href: string }; - export interface UseNavigationProps { - dataViewId: string; + dataView: DataView; rowIndex: string; rowId: string; columns: string[]; - filterManager: FilterManager; - addBasePath: (url: string) => string; + savedSearchId?: string; + // provided by embeddable only + filters?: Filter[]; } -export const getContextHash = (columns: string[], filterManager: FilterManager) => { - const globalFilters = filterManager.getGlobalFilters(); - const appFilters = filterManager.getAppFilters(); - - return stringify( - url.encodeQuery({ - _g: rison.encode({ - filters: globalFilters || [], - }), - _a: rison.encode({ - columns, - filters: (appFilters || []).map(disableFilter), - }), - }), - { encode: false, sort: false } - ); -}; - -/** - * When it's context route, breadcrumb link should point to the main discover page anyway. - * Otherwise, we are on main page and should create breadcrumb link from it. - * Current history object should be used in callback, since url state might be changed - * after expanded document opened. - */ +const getStateParams = ({ + isEmbeddableView, + columns, + filters, + filterManager, + data, + savedSearchId, +}: { + isEmbeddableView: boolean; + columns: string[]; + savedSearchId?: string; + filters?: Filter[]; + filterManager: FilterManager; + data: DataPublicPluginStart; +}) => { + let appliedFilters: Filter[] = []; + let query: Query | AggregateQuery | undefined; + let timeRange: TimeRange | undefined; + if (!isEmbeddableView) { + // applied from discover main and context app + appliedFilters = [...filterManager.getGlobalFilters(), ...filterManager.getAppFilters()]; + query = data.query.queryString.getQuery(); + timeRange = data.query.timefilter.timefilter.getTime(); + } else if (isEmbeddableView && filters?.length) { + // applied from saved search embeddable + appliedFilters = filters; + } -const getCurrentBreadcrumbs = ( - isContextRoute: boolean, - currentLocation: Location, - prevBreadcrumb?: string -) => { - return isContextRoute ? prevBreadcrumb : '#' + currentLocation.pathname + currentLocation.search; + return { + columns, + query, + timeRange, + filters: appliedFilters, + savedSearchId, + }; }; -const getCurrentBreadcrumb = (search: string | undefined) => - new URLSearchParams(search).get('breadcrumb') || undefined; - -export const useMainRouteBreadcrumb = () => { - const history = useHistory(); - return useMemo(() => getCurrentBreadcrumb(history.location.search), [history.location.search]); -}; +const isModifiedEvent = (event: MouseEvent) => + !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); export const useNavigationProps = ({ - dataViewId, + dataView, rowIndex, rowId, columns, - filterManager, - addBasePath, + savedSearchId, + filters, }: UseNavigationProps) => { - const history = useHistory(); - const currentLocation = useDiscoverServices().history().location; - - const prevBreadcrumb = useMemo( - () => getCurrentBreadcrumb(history?.location?.search), - [history?.location?.search] + const isEmbeddableView = !useHistory(); + const services = useDiscoverServices(); + const [singleDocHref, setSingleDocHref] = useState(''); + const [contextViewHref, setContextViewHref] = useState(''); + + const index = useMemo( + () => (dataView.isPersisted() ? dataView.id! : dataView.toSpec(false)), + [dataView] ); - const singleDocHref = addBasePath( - `/app/discover#/doc/${dataViewId}/${rowIndex}?id=${encodeURIComponent(rowId)}` + const buildParams = useCallback( + () => + getStateParams({ + isEmbeddableView, + columns, + filters, + filterManager: services.filterManager, + data: services.data, + savedSearchId, + }), + [columns, filters, isEmbeddableView, savedSearchId, services.data, services.filterManager] ); - const contextSearchHash = getContextHash(columns, filterManager); - - const surDocsHref = addBasePath( - `/app/discover#/context/${encodeURIComponent(dataViewId)}/${encodeURIComponent( - rowId - )}?${contextSearchHash}` + useEffect(() => { + const dataViewId = typeof index === 'object' ? index.id : index; + services.locator + .getUrl({ dataViewId, ...buildParams() }) + .then((referrer) => { + return services.singleDocLocator.getRedirectUrl({ index, rowIndex, rowId, referrer }); + }) + .then(setSingleDocHref); + }, [ + index, + rowIndex, + rowId, + services.singleDocLocator, + setSingleDocHref, + services.locator, + buildParams, + ]); + + useEffect(() => { + const params = buildParams(); + const dataViewId = typeof index === 'object' ? index.id : index; + services.locator + .getUrl({ dataViewId, ...params }) + .then((referrer) => + services.contextLocator.getRedirectUrl({ + index, + rowId, + columns: params.columns, + filters: params.filters?.map(disableFilter), + referrer, + }) + ) + .then(setContextViewHref); + }, [ + index, + rowIndex, + rowId, + setContextViewHref, + buildParams, + services.contextLocator, + services.locator, + ]); + + const onOpenSingleDoc: MouseEventHandler = useCallback( + (event) => { + if (isModifiedEvent(event)) { + return; + } + event.preventDefault(); + const dataViewId = typeof index === 'object' ? index.id : index; + services.locator + .getUrl({ dataViewId, ...buildParams() }) + .then((referrer) => + services.singleDocLocator.navigate({ index, rowIndex, rowId, referrer }) + ); + }, + [buildParams, index, rowId, rowIndex, services.locator, services.singleDocLocator] ); - /** - * When history can be accessed via hooks, - * it's used by discover main or context route. - */ - if (!!history) { - const isContextRoute = matchPath(history.location.pathname, { - path: '/context/:dataViewId/:id', - exact: true, - }); - const currentBreadcrumb = encodeURIComponent( - getCurrentBreadcrumbs(!!isContextRoute, currentLocation, prevBreadcrumb) ?? '' - ); - - const onOpenSingleDoc: MouseEventHandler = (event) => { - event?.preventDefault?.(); - - history.push({ - pathname: `/doc/${dataViewId}/${rowIndex}`, - search: `?id=${encodeURIComponent(rowId)}&breadcrumb=${currentBreadcrumb}`, - }); - }; - - const onOpenSurrDocs: MouseEventHandler = (event) => { - event?.preventDefault?.(); - - history.push({ - pathname: `/context/${encodeURIComponent(dataViewId)}/${encodeURIComponent(String(rowId))}`, - search: `?${contextSearchHash}&breadcrumb=${currentBreadcrumb}`, - }); - }; - - return { - singleDocProps: { - onClick: onOpenSingleDoc, - href: `${singleDocHref}&breadcrumb=${currentBreadcrumb}`, - }, - surrDocsProps: { - onClick: onOpenSurrDocs, - href: `${surDocsHref}&breadcrumb=${currentBreadcrumb}`, - }, - }; - } + const onOpenContextView: MouseEventHandler = useCallback( + (event) => { + const params = buildParams(); + if (isModifiedEvent(event)) { + return; + } + event.preventDefault(); + const dataViewId = typeof index === 'object' ? index.id : index; + services.locator.getUrl({ dataViewId, ...params }).then((referrer) => + services.contextLocator.navigate({ + index, + rowId, + columns: params.columns, + filters: params.filters?.map(disableFilter), + referrer, + }) + ); + }, + [buildParams, index, rowId, services.contextLocator, services.locator] + ); - // for embeddable absolute href should be kept return { - singleDocProps: { - href: singleDocHref, - }, - surrDocsProps: { - href: surDocsHref, - }, + singleDocHref, + contextViewHref, + onOpenSingleDoc, + onOpenContextView, }; }; diff --git a/src/plugins/discover/public/index.ts b/src/plugins/discover/public/index.ts index b516161d0e97b..451bf3303216e 100644 --- a/src/plugins/discover/public/index.ts +++ b/src/plugins/discover/public/index.ts @@ -23,13 +23,13 @@ export type { DiscoverAppLocator, DiscoverAppLocatorParams } from './locator'; // re-export types and static functions to give other plugins time to migrate away export { - SavedSearch, + type SavedSearch, getSavedSearch, getSavedSearchFullPathUrl, getSavedSearchUrl, getSavedSearchUrlConflictMessage, throwErrorOnSavedSearchUrlConflict, VIEW_MODE, - DiscoverGridSettings, - DiscoverGridSettingsColumn, + type DiscoverGridSettings, + type DiscoverGridSettingsColumn, } from '@kbn/saved-search-plugin/public'; diff --git a/src/plugins/discover/public/locator.ts b/src/plugins/discover/public/locator.ts index eb8d1039f27c5..e59c61c98412c 100644 --- a/src/plugins/discover/public/locator.ts +++ b/src/plugins/discover/public/locator.ts @@ -99,7 +99,10 @@ export interface DiscoverAppLocatorDependencies { useHash: boolean; } -export interface HistoryLocationState { +/** + * Location state of scoped history (history instance of Kibana Platform application service) + */ +export interface MainHistoryLocationState { dataViewSpec?: DataViewSpec; } @@ -157,7 +160,7 @@ export class DiscoverAppLocatorDefinition implements LocatorDefinition import('./services/doc_views/components/doc_viewer_table/legacy') @@ -199,15 +207,23 @@ export class DiscoverPlugin private docViewsRegistry: DocViewsRegistry | null = null; private stopUrlTracking: (() => void) | undefined = undefined; private locator?: DiscoverAppLocator; + private contextLocator?: DiscoverContextAppLocator; + private singleDocLocator?: DiscoverSingleDocLocator; setup(core: CoreSetup, plugins: DiscoverSetupPlugins) { const baseUrl = core.http.basePath.prepend('/app/discover'); const isDev = this.initializerContext.env.mode.dev; if (plugins.share) { + const useHash = core.uiSettings.get('state:storeInSessionStorage'); this.locator = plugins.share.url.locators.create( - new DiscoverAppLocatorDefinition({ - useHash: core.uiSettings.get('state:storeInSessionStorage'), - }) + new DiscoverAppLocatorDefinition({ useHash }) + ); + + this.contextLocator = plugins.share.url.locators.create( + new DiscoverContextAppLocatorDefinition({ useHash }) + ); + this.singleDocLocator = plugins.share.url.locators.create( + new DiscoverSingleDocLocatorDefinition() ); } @@ -288,9 +304,6 @@ export class DiscoverPlugin setHeaderActionMenuMounter(params.setHeaderActionMenu); syncHistoryLocations(); appMounted(); - const historyLocationState = params.history.location.state as - | HistoryLocationState - | undefined; // dispatch synthetic hash change event to update hash history objects // this is necessary because hash updates triggered by using popState won't trigger this event naturally. @@ -302,7 +315,9 @@ export class DiscoverPlugin coreStart, discoverStartPlugins, this.initializerContext, - this.locator! + this.locator!, + this.contextLocator!, + this.singleDocLocator! ); // make sure the data view list is up to date @@ -312,7 +327,7 @@ export class DiscoverPlugin // FIXME: Temporarily hide overflow-y in Discover app when Field Stats table is shown // due to EUI bug https://github.com/elastic/eui/pull/5152 params.element.classList.add('dscAppWrapper'); - const unmount = renderApp(params.element, services, isDev, historyLocationState); + const unmount = renderApp(params.element, services, isDev); return () => { unlistenParentHistory(); unmount(); @@ -393,7 +408,14 @@ export class DiscoverPlugin const getDiscoverServices = async () => { const [coreStart, discoverStartPlugins] = await core.getStartServices(); - return buildServices(coreStart, discoverStartPlugins, this.initializerContext, this.locator!); + return buildServices( + coreStart, + discoverStartPlugins, + this.initializerContext, + this.locator!, + this.contextLocator!, + this.singleDocLocator! + ); }; const factory = new SearchEmbeddableFactory(getStartServices, getDiscoverServices); diff --git a/src/plugins/discover/public/utils/with_query_params.test.tsx b/src/plugins/discover/public/utils/with_query_params.test.tsx deleted file mode 100644 index e23688c0031c7..0000000000000 --- a/src/plugins/discover/public/utils/with_query_params.test.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { ReactElement } from 'react'; -import { Router } from 'react-router-dom'; -import { createMemoryHistory } from 'history'; -import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { withQueryParams } from './with_query_params'; - -const mountComponent = (children: ReactElement, query = '') => { - const history = createMemoryHistory({ - initialEntries: ['/' + query], - }); - return mountWithIntl({children}); -}; - -describe('withQueryParams', () => { - it('should display error message, when query does not contain required parameters', () => { - const Component = withQueryParams(() =>
, ['id', 'query']); - const component = mountComponent(); - - expect(component.html()).toContain('Cannot load this page'); - expect(component.html()).toContain('URL query string is missing id, query.'); - }); - - it('should not display error message, when query contain required parameters', () => { - const Component = withQueryParams(() =>
, ['id', 'query']); - const component = mountComponent(, '?id=one&query=another'); - - expect(component.html()).not.toContain('URL query string is missing id, query.'); - }); -}); diff --git a/src/plugins/discover/public/utils/with_query_params.tsx b/src/plugins/discover/public/utils/with_query_params.tsx deleted file mode 100644 index 159ba6740cf64..0000000000000 --- a/src/plugins/discover/public/utils/with_query_params.tsx +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { useMemo } from 'react'; -import { i18n } from '@kbn/i18n'; -import { useLocation } from 'react-router-dom'; -import { DiscoverError } from '../components/common/error_alert'; - -export function withQueryParams(Component: React.ComponentType, requiredParams: string[]) { - return () => { - const { search } = useLocation(); - const query = useMemo(() => new URLSearchParams(search), [search]); - - const missingParamNames = useMemo( - () => requiredParams.filter((currentParamName) => !query.get(currentParamName)), - [query] - ); - - if (missingParamNames.length !== 0) { - const missingParamsList = missingParamNames.join(', '); - const errorMessage = i18n.translate('discover.discoverError.missingQueryParamsError', { - defaultMessage: 'URL query string is missing {missingParamsList}.', - values: { missingParamsList }, - }); - - return ; - } - - const queryProps = Object.fromEntries( - requiredParams.map((current) => [[current], query.get(current)]) - ); - return ; - }; -} diff --git a/src/plugins/discover/tsconfig.json b/src/plugins/discover/tsconfig.json index 93488793f8237..4239fdfe2ea8d 100644 --- a/src/plugins/discover/tsconfig.json +++ b/src/plugins/discover/tsconfig.json @@ -4,10 +4,14 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": ["common/**/*", "public/**/*", "server/**/*", "../../../typings/**/*", ".storybook/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../charts/tsconfig.json" }, { "path": "../saved_search/tsconfig.json" }, diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable.test.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable.test.tsx index de0bcf3f8654c..079a31089d707 100644 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable.test.tsx +++ b/src/plugins/embeddable/public/lib/embeddables/embeddable.test.tsx @@ -43,7 +43,7 @@ class OutputTestEmbeddable extends Embeddable { reload() {} } -test('Embeddable calls input subscribers when changed', async (done) => { +test('Embeddable calls input subscribers when changed', (done) => { const hello = new ContactCardEmbeddable( { id: '123', firstName: 'Brienne', lastName: 'Tarth' }, { execAction: (() => null) as any } diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable_error_handler.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable_error_handler.tsx new file mode 100644 index 0000000000000..a0ebfdbcbdc86 --- /dev/null +++ b/src/plugins/embeddable/public/lib/embeddables/embeddable_error_handler.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { isFunction } from 'lodash'; +import React, { ReactNode, useEffect, useRef, useState } from 'react'; +import { isPromise } from '@kbn/std'; +import type { MaybePromise } from '@kbn/utility-types'; +import type { ErrorLike } from '@kbn/expressions-plugin/common'; +import type { EmbeddableInput, EmbeddableOutput, IEmbeddable } from './i_embeddable'; + +type IReactEmbeddable = IEmbeddable>; + +interface EmbeddableErrorHandlerProps { + children: IReactEmbeddable['catchError']; + embeddable?: IReactEmbeddable; + error: ErrorLike | string; +} + +export function EmbeddableErrorHandler({ + children, + embeddable, + error, +}: EmbeddableErrorHandlerProps) { + const [node, setNode] = useState(); + const ref = useRef(null); + + useEffect(() => { + if (!ref.current) { + return; + } + + const handler = embeddable?.catchError?.bind(embeddable) ?? children; + if (!handler) { + return; + } + + const renderedNode = handler( + typeof error === 'string' ? { message: error, name: '' } : error, + ref.current + ); + if (isFunction(renderedNode)) { + return renderedNode; + } + if (isPromise(renderedNode)) { + renderedNode.then(setNode); + } else { + setNode(renderedNode); + } + }, [children, embeddable, error]); + + return
{node}
; +} diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable_root.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable_root.tsx index bfaefe09b5e6b..f94bb99ada83c 100644 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable_root.tsx +++ b/src/plugins/embeddable/public/lib/embeddables/embeddable_root.tsx @@ -12,6 +12,7 @@ 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>; @@ -91,7 +92,11 @@ export class EmbeddableRoot extends React.Component {
{this.state.node}
{this.props.loading && } - {this.props.error && {this.props.error}} + {this.props.error && ( + + {({ message }) => {message}} + + )}
); } diff --git a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx index 8dff4ecee8976..1ccaf61064a8a 100644 --- a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx +++ b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx @@ -6,9 +6,8 @@ * Side Public License, v 1. */ -import { EuiEmptyPrompt } from '@elastic/eui'; import React, { ReactNode } from 'react'; -import { Markdown } from '@kbn/kibana-react-plugin/public'; +import { EmbeddablePanelError } from '../panel/embeddable_panel_error'; import { Embeddable } from './embeddable'; import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from './i_embeddable'; import { IContainer } from '../containers'; @@ -33,20 +32,8 @@ export class ErrorEmbeddable extends Embeddable - ); - - return ( -
- -
- ); + const error = typeof this.error === 'string' ? { message: this.error, name: '' } : this.error; + + return ; } } diff --git a/src/plugins/embeddable/public/lib/embeddables/index.ts b/src/plugins/embeddable/public/lib/embeddables/index.ts index 0c1048af9182c..9f88e6b3053b5 100644 --- a/src/plugins/embeddable/public/lib/embeddables/index.ts +++ b/src/plugins/embeddable/public/lib/embeddables/index.ts @@ -9,6 +9,7 @@ export type { EmbeddableOutput, EmbeddableInput, IEmbeddable } from './i_embeddable'; export { isEmbeddable } from './is_embeddable'; export { Embeddable } from './embeddable'; +export { EmbeddableErrorHandler } from './embeddable_error_handler'; export * from './embeddable_factory'; export * from './embeddable_factory_definition'; export * from './default_embeddable_factory_provider'; diff --git a/src/plugins/embeddable/public/lib/panel/_embeddable_panel.scss b/src/plugins/embeddable/public/lib/panel/_embeddable_panel.scss index 3044a3896fa35..789b9f7227a3c 100644 --- a/src/plugins/embeddable/public/lib/panel/_embeddable_panel.scss +++ b/src/plugins/embeddable/public/lib/panel/_embeddable_panel.scss @@ -29,13 +29,6 @@ .embPanel__content--fullWidth { width: 100%; } - - .embPanel__content--error { - &:hover { - box-shadow: none; - transform: none; - } - } } // HEADER @@ -165,11 +158,12 @@ } .embPanel__error { - text-align: center; - justify-content: center; - flex-direction: column; - overflow: auto; - padding: $euiSizeS; + padding: $euiSizeL; + + & > * { + max-height: 100%; + overflow: auto; + } } .embPanel__label { diff --git a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx index 8f096020ae60e..d482354ca509e 100644 --- a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx @@ -57,7 +57,7 @@ setup.registerEmbeddableFactory(embeddableReactFactory.type, embeddableReactFact const start = doStart(); const getEmbeddableFactory = start.getEmbeddableFactory; -test('HelloWorldContainer initializes embeddables', async (done) => { +test('HelloWorldContainer initializes embeddables', (done) => { const container = new HelloWorldContainer( { id: '123', diff --git a/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx index f5b072a591225..cf014c2af98b6 100644 --- a/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx +++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx @@ -6,7 +6,13 @@ * Side Public License, v 1. */ -import { EuiContextMenuPanelDescriptor, EuiPanel, htmlIdGenerator } from '@elastic/eui'; +import { + EuiContextMenuPanelDescriptor, + EuiFlexGroup, + EuiFlexItem, + EuiPanel, + htmlIdGenerator, +} from '@elastic/eui'; import classNames from 'classnames'; import React, { ReactNode } from 'react'; import { Subscription } from 'rxjs'; @@ -27,11 +33,11 @@ import { contextMenuTrigger, } from '../triggers'; import { - IEmbeddable, - EmbeddableOutput, - EmbeddableError, + EmbeddableErrorHandler, EmbeddableInput, -} from '../embeddables/i_embeddable'; + EmbeddableOutput, + IEmbeddable, +} from '../embeddables'; import { ViewMode } from '../types'; import { EmbeddablePanelError } from './embeddable_panel_error'; @@ -105,7 +111,7 @@ interface State { badges: Array>; notifications: Array>; loading?: boolean; - error?: EmbeddableError; + error?: Error; destroyError?(): void; node?: ReactNode; } @@ -301,11 +307,24 @@ export class EmbeddablePanel extends React.Component { /> )} {this.state.error && ( - + + + + {(error) => ( + + )} + + + )}
{this.state.node} diff --git a/src/plugins/embeddable/public/lib/panel/embeddable_panel_error.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel_error.tsx index 69af8e7220e62..4aba5ed105154 100644 --- a/src/plugins/embeddable/public/lib/panel/embeddable_panel_error.tsx +++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel_error.tsx @@ -6,16 +6,15 @@ * Side Public License, v 1. */ -import { isFunction } from 'lodash'; -import React, { ReactNode, useEffect, useMemo, useRef, useState } from 'react'; -import { EuiPanel } from '@elastic/eui'; +import React, { ReactNode, useEffect, useMemo, useState } from 'react'; +import { EuiButtonEmpty, EuiEmptyPrompt, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { isPromise } from '@kbn/std'; +import { Markdown } from '@kbn/kibana-react-plugin/public'; import type { MaybePromise } from '@kbn/utility-types'; import { ErrorLike } from '@kbn/expressions-plugin/common'; import { distinctUntilChanged, merge, of, switchMap } from 'rxjs'; import { EditPanelAction } from '../actions'; -import { EmbeddableInput, EmbeddableOutput, ErrorEmbeddable, IEmbeddable } from '../embeddables'; +import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from '../embeddables'; interface EmbeddablePanelErrorProps { editPanelAction?: EditPanelAction; @@ -29,27 +28,25 @@ export function EmbeddablePanelError({ error, }: EmbeddablePanelErrorProps) { const [isEditable, setEditable] = useState(false); - const [node, setNode] = useState(); - const ref = useRef(null); const handleErrorClick = useMemo( () => (isEditable ? () => editPanelAction?.execute({ embeddable }) : undefined), [editPanelAction, embeddable, isEditable] ); - const title = embeddable.getTitle(); - const actionDisplayName = useMemo( + const label = useMemo( () => editPanelAction?.getDisplayName({ embeddable }), [editPanelAction, embeddable] ); + const title = useMemo(() => embeddable.getTitle(), [embeddable]); const ariaLabel = useMemo( () => !title - ? actionDisplayName + ? label : i18n.translate('embeddableApi.panel.editPanel.displayName', { defaultMessage: 'Edit {value}', values: { value: title }, }), - [title, actionDisplayName] + [label, title] ); useEffect(() => { @@ -62,42 +59,29 @@ export function EmbeddablePanelError({ return () => subscription.unsubscribe(); }, [editPanelAction, embeddable]); - useEffect(() => { - if (!ref.current) { - return; - } - - if (!embeddable.catchError) { - const errorEmbeddable = new ErrorEmbeddable(error, { id: embeddable.id }); - setNode(errorEmbeddable.render()); - - return () => errorEmbeddable.destroy(); - } - - const renderedNode = embeddable.catchError(error, ref.current); - if (isFunction(renderedNode)) { - return renderedNode; - } - if (isPromise(renderedNode)) { - renderedNode.then(setNode); - } else { - setNode(renderedNode); - } - }, [embeddable, error]); return ( - - {node} - + + + + } + data-test-subj="embeddableStackError" + iconType="alert" + iconColor="danger" + layout="vertical" + actions={ + isEditable && ( + + {label} + + ) + } + /> ); } diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts index 983f9ceedf369..58f15c326be77 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts @@ -53,7 +53,7 @@ beforeEach(async () => { } }); -test('Updates the embeddable title when given', async (done) => { +test('Updates the embeddable title when given', async () => { const getUserData = () => Promise.resolve({ title: 'What is up?' }); const customizePanelAction = new CustomizePanelTitleAction(getUserData); expect(embeddable.getInput().title).toBeUndefined(); @@ -66,11 +66,10 @@ test('Updates the embeddable title when given', async (done) => { // Recreating the container should preserve the custom title. const containerClone = createHelloWorldContainer(container.getInput()); // Need to wait for the container to tell us the embeddable has been loaded. - const subscription = containerClone.getOutput$().subscribe(() => { + const subscription = await containerClone.getOutput$().subscribe(() => { if (containerClone.getOutput().embeddableLoaded[embeddable.id]) { expect(embeddable.getInput().title).toBe('What is up?'); subscription.unsubscribe(); - done(); } }); }); diff --git a/src/plugins/embeddable/public/tests/container.test.ts b/src/plugins/embeddable/public/tests/container.test.ts index 8b487d9f02f78..c6088e95069cb 100644 --- a/src/plugins/embeddable/public/tests/container.test.ts +++ b/src/plugins/embeddable/public/tests/container.test.ts @@ -128,7 +128,7 @@ describe('container initialization', () => { expect(embeddable.id).toBe('123'); }; - it('initializes embeddables', async (done) => { + it('initializes embeddables', async () => { const { container } = await createHelloWorldContainerAndEmbeddable({ id: 'hello', panels, @@ -137,10 +137,9 @@ describe('container initialization', () => { expectEmbeddableLoaded(container, '123'); expectEmbeddableLoaded(container, '456'); expectEmbeddableLoaded(container, '789'); - done(); }); - it('initializes embeddables once and only once with multiple input updates', async (done) => { + it('initializes embeddables once and only once with multiple input updates', async () => { const { container, contactCardCreateSpy } = await createHelloWorldContainerAndEmbeddable({ id: 'hello', panels, @@ -148,10 +147,9 @@ describe('container initialization', () => { container.updateInput({ lastReloadRequestTime: 1 }); container.updateInput({ lastReloadRequestTime: 2 }); expect(contactCardCreateSpy).toHaveBeenCalledTimes(4); - done(); }); - it('initializes embeddables in order', async (done) => { + it('initializes embeddables in order', async () => { const childIdInitializeOrder = ['456', '123', '789']; const { contactCardCreateSpy } = await createHelloWorldContainerAndEmbeddable( { @@ -170,10 +168,9 @@ describe('container initialization', () => { expect.anything() // parent passed into create method ); } - done(); }); - it('initializes embeddables in order with partial order arg', async (done) => { + it('initializes embeddables in order with partial order arg', async () => { const childIdInitializeOrder = ['789', 'idontexist']; const { contactCardCreateSpy } = await createHelloWorldContainerAndEmbeddable( { @@ -193,10 +190,9 @@ describe('container initialization', () => { expect.anything() // parent passed into create method ); } - done(); }); - it('initializes embeddables in order, awaiting each', async (done) => { + it('initializes embeddables in order, awaiting each', async () => { const childIdInitializeOrder = ['456', '123', '789']; const { container, contactCardCreateSpy } = await createHelloWorldContainerAndEmbeddable( { @@ -220,7 +216,6 @@ describe('container initialization', () => { ); expect(untilEmbeddableLoadedMock).toHaveBeenCalledWith(orderedId); } - done(); }); }); @@ -244,7 +239,7 @@ test('Container.addNewEmbeddable', async () => { expect(embeddableInContainer.id).toBe(embeddable.id); }); -test('Container.removeEmbeddable removes and cleans up', async (done) => { +test('Container.removeEmbeddable removes and cleans up', async () => { const { start, testPanel } = await createHelloWorldContainerAndEmbeddable(); const container = new HelloWorldContainer( @@ -288,12 +283,10 @@ test('Container.removeEmbeddable removes and cleans up', async (done) => { expect(container.getInput().panels[embeddable.id]).toBeUndefined(); if (isErrorEmbeddable(embeddable)) { expect(false).toBe(true); - done(); } expect(() => embeddable.updateInput({ nameTitle: 'Sir' })).toThrowError(); expect(container.getOutput().embeddableLoaded[embeddable.id]).toBeUndefined(); - done(); }); container.removeEmbeddable(embeddable.id); @@ -403,7 +396,7 @@ test('Container view mode change propagates to children', async () => { expect(embeddable.getInput().viewMode).toBe(ViewMode.EDIT); }); -test(`Container updates its state when a child's input is updated`, async (done) => { +test(`Container updates its state when a child's input is updated`, async () => { const { container, embeddable, start, coreStart, uiActions } = await createHelloWorldContainerAndEmbeddable( { id: 'hello', panels: {}, viewMode: ViewMode.VIEW }, @@ -450,7 +443,6 @@ test(`Container updates its state when a child's input is updated`, async (done) childClone.getInput().nameTitle === 'Dr.' ) { cloneSubscription.unsubscribe(); - done(); } }); } @@ -487,7 +479,7 @@ test(`Derived container state passed to children`, async () => { subscription.unsubscribe(); }); -test(`Can subscribe to children embeddable updates`, async (done) => { +test(`Can subscribe to children embeddable updates`, async () => { const { embeddable } = await createHelloWorldContainerAndEmbeddable( { id: 'hello container', @@ -504,13 +496,12 @@ test(`Can subscribe to children embeddable updates`, async (done) => { const subscription = embeddable.getInput$().subscribe((input: ContactCardEmbeddableInput) => { if (input.nameTitle === 'Dr.') { subscription.unsubscribe(); - done(); } }); embeddable.updateInput({ nameTitle: 'Dr.' }); }); -test('Test nested reactions', async (done) => { +test('Test nested reactions', async () => { const { container, embeddable } = await createHelloWorldContainerAndEmbeddable( { id: 'hello', panels: {}, viewMode: ViewMode.VIEW }, { @@ -533,7 +524,6 @@ test('Test nested reactions', async (done) => { ) { containerSubscription.unsubscribe(); embeddableSubscription.unsubscribe(); - done(); } }); @@ -578,7 +568,7 @@ test('Explicit embeddable input mapped to undefined will default to inherited', ]); }); -test('Explicit embeddable input mapped to undefined with no inherited value will get passed to embeddable', async (done) => { +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< @@ -601,7 +591,6 @@ test('Explicit embeddable input mapped to undefined with no inherited value will .subscribe(() => { if (embeddable.getInput().filters === undefined) { subscription.unsubscribe(); - done(); } }); @@ -666,7 +655,7 @@ test('Panel added to input state', async () => { expect(container.getOutput().embeddableLoaded[embeddable2.id]).toBe(true); }); -test('Container changes made directly after adding a new embeddable are propagated', async (done) => { +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); @@ -710,7 +699,6 @@ test('Container changes made directly after adding a new embeddable are propagat const embeddable = container.getChild(embeddableId); if (embeddable.getInput().viewMode === ViewMode.VIEW) { subscription.unsubscribe(); - done(); } } } @@ -724,7 +712,7 @@ test('Container changes made directly after adding a new embeddable are propagat 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 (done) => { +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: { @@ -740,12 +728,11 @@ test('container stores ErrorEmbeddables when a factory for a child cannot be fou if (container.getOutput().embeddableLoaded['123']) { const child = container.getChild('123'); expect(child.type).toBe(ERROR_EMBEDDABLE_TYPE); - done(); } }); }); -test('container stores ErrorEmbeddables when a saved object cannot be found', async (done) => { +test('container stores ErrorEmbeddables when a saved object cannot be found', async () => { const { container } = await createHelloWorldContainerAndEmbeddable({ id: 'hello', panels: { @@ -761,12 +748,11 @@ test('container stores ErrorEmbeddables when a saved object cannot be found', as if (container.getOutput().embeddableLoaded['123']) { const child = container.getChild('123'); expect(child.type).toBe(ERROR_EMBEDDABLE_TYPE); - done(); } }); }); -test('ErrorEmbeddables get updated when parent does', async (done) => { +test('ErrorEmbeddables get updated when parent does', async () => { const { container } = await createHelloWorldContainerAndEmbeddable({ id: 'hello', panels: { @@ -787,7 +773,6 @@ test('ErrorEmbeddables get updated when parent does', async (done) => { container.updateInput({ viewMode: ViewMode.VIEW }); expect(embeddable.getInput().viewMode).toBe(ViewMode.VIEW); - done(); } }); }); @@ -831,7 +816,7 @@ test('untilEmbeddableLoaded() throws an error if there is no such child panel in expect((error as Error).message).toMatchInlineSnapshot(`"Panel not found"`); }); -test('untilEmbeddableLoaded() resolves if child is loaded in the container', async (done) => { +test('untilEmbeddableLoaded() resolves if child is loaded in the container', async () => { const { setup, doStart, coreStart, uiActions } = testPlugin( coreMock.createSetup(), coreMock.createStart() @@ -866,10 +851,9 @@ test('untilEmbeddableLoaded() resolves if child is loaded in the container', asy const child = await container.untilEmbeddableLoaded('123'); expect(child).toBeDefined(); expect(child.type).toBe(HELLO_WORLD_EMBEDDABLE); - done(); }); -test('untilEmbeddableLoaded resolves with undefined if child is subsequently removed', async (done) => { +test('untilEmbeddableLoaded resolves with undefined if child is subsequently removed', async () => { const { doStart, setup, coreStart, uiActions } = testPlugin( coreMock.createSetup(), coreMock.createStart() @@ -907,13 +891,12 @@ test('untilEmbeddableLoaded resolves with undefined if child is subsequently rem container.untilEmbeddableLoaded('123').then((embed) => { expect(embed).toBeUndefined(); - done(); }); container.updateInput({ panels: {} }); }); -test('adding a panel then subsequently removing it before its loaded removes the panel', async (done) => { +test('adding a panel then subsequently removing it before its loaded removes the panel', (done) => { const { doStart, coreStart, uiActions, setup } = testPlugin( coreMock.createSetup(), coreMock.createStart() diff --git a/src/plugins/embeddable/public/tests/explicit_input.test.ts b/src/plugins/embeddable/public/tests/explicit_input.test.ts index d9a7b72ada15a..4ed4c12a80390 100644 --- a/src/plugins/embeddable/public/tests/explicit_input.test.ts +++ b/src/plugins/embeddable/public/tests/explicit_input.test.ts @@ -68,7 +68,7 @@ test('Explicit embeddable input mapped to undefined will default to inherited', ]); }); -test('Explicit embeddable input mapped to undefined with no inherited value will get passed to embeddable', async (done) => { +test('Explicit embeddable input mapped to undefined with no inherited value will get passed to embeddable', async () => { const testPanel = createEmbeddablePanelMock({ getActions: uiActions.getTriggerCompatibleActions, getEmbeddableFactory: start.getEmbeddableFactory, @@ -95,13 +95,12 @@ test('Explicit embeddable input mapped to undefined with no inherited value will expect(container.getInputForChild(embeddable.id).filters).toEqual([]); - const subscription = embeddable + const subscription = await embeddable .getInput$() .pipe(skip(1)) .subscribe(() => { if (embeddable.getInput().filters === undefined) { subscription.unsubscribe(); - done(); } }); diff --git a/src/plugins/embeddable/tsconfig.json b/src/plugins/embeddable/tsconfig.json index e1edfc039f360..6943f5fdc5471 100644 --- a/src/plugins/embeddable/tsconfig.json +++ b/src/plugins/embeddable/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ ".storybook/**/*", @@ -12,7 +11,7 @@ "public/**/*", "server/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../inspector/tsconfig.json" }, { "path": "../saved_objects/tsconfig.json" }, diff --git a/src/plugins/es_ui_shared/public/request/use_request.test.helpers.tsx b/src/plugins/es_ui_shared/public/request/use_request.test.helpers.tsx index db694a29b793e..b75b645846eed 100644 --- a/src/plugins/es_ui_shared/public/request/use_request.test.helpers.tsx +++ b/src/plugins/es_ui_shared/public/request/use_request.test.helpers.tsx @@ -49,7 +49,7 @@ const errorWithBodyResponse = { body: errorValue }; export const createUseRequestHelpers = (): UseRequestHelpers => { // The behavior we're testing involves state changes over time, so we need finer control over // timing. - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const flushPromiseJobQueue = async () => { // See https://stackoverflow.com/questions/52177631/jest-timer-and-promise-dont-work-well-settimeout-and-async-function diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_array.test.tsx b/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_array.test.tsx index 8e9bdd35ffb7e..7a2d61c55d6c4 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_array.test.tsx +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_array.test.tsx @@ -18,7 +18,7 @@ import { UseArray } from './use_array'; describe('', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.test.tsx b/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.test.tsx index 36fd16209f5d4..6ea28fc601869 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.test.tsx +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.test.tsx @@ -19,7 +19,7 @@ import { UseField } from './use_field'; describe('', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_multi_fields.test.tsx b/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_multi_fields.test.tsx index 94c36613c44ba..09b0c898fc0dc 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_multi_fields.test.tsx +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_multi_fields.test.tsx @@ -15,7 +15,7 @@ import { UseMultiFields } from './use_multi_fields'; describe('', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.test.tsx b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.test.tsx index 71aafa6376884..4a3b5c99b978c 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.test.tsx +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.test.tsx @@ -17,7 +17,7 @@ import { FieldHook, FieldValidateResponse, VALIDATION_TYPES, FieldConfig } from describe('useField() hook', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.test.tsx b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.test.tsx index 9f57432b5d6a1..740dbf5ee5e75 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.test.tsx +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.test.tsx @@ -40,7 +40,7 @@ const onFormHook = (_form: FormHook) => { describe('useForm() hook', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/es_ui_shared/tsconfig.json b/src/plugins/es_ui_shared/tsconfig.json index 430ec5b85e4f7..5cb4f3ddfffa7 100644 --- a/src/plugins/es_ui_shared/tsconfig.json +++ b/src/plugins/es_ui_shared/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "__packages_do_not_import__/**/*", @@ -15,7 +14,7 @@ "../../../typings/**/*", ".storybook/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data_views/tsconfig.json" } ] diff --git a/src/plugins/event_annotation/kibana.json b/src/plugins/event_annotation/kibana.json index d981af8ab165b..deccb699617ba 100644 --- a/src/plugins/event_annotation/kibana.json +++ b/src/plugins/event_annotation/kibana.json @@ -13,6 +13,6 @@ ], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" } } \ No newline at end of file diff --git a/src/plugins/event_annotation/tsconfig.json b/src/plugins/event_annotation/tsconfig.json index 31f9c45e1e85b..21d8b73900569 100644 --- a/src/plugins/event_annotation/tsconfig.json +++ b/src/plugins/event_annotation/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", "server/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, diff --git a/src/plugins/expression_error/tsconfig.json b/src/plugins/expression_error/tsconfig.json index 111ff58935a35..419685fe65a31 100644 --- a/src/plugins/expression_error/tsconfig.json +++ b/src/plugins/expression_error/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../presentation_util/tsconfig.json" }, { "path": "../expressions/tsconfig.json" }, diff --git a/src/plugins/expression_image/tsconfig.json b/src/plugins/expression_image/tsconfig.json index 9a7175a8d767b..f77c026619110 100644 --- a/src/plugins/expression_image/tsconfig.json +++ b/src/plugins/expression_image/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -13,7 +12,7 @@ "server/**/*", "__fixtures__/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../presentation_util/tsconfig.json" }, { "path": "../expressions/tsconfig.json" }, diff --git a/src/plugins/expression_metric/tsconfig.json b/src/plugins/expression_metric/tsconfig.json index 9a7175a8d767b..f77c026619110 100644 --- a/src/plugins/expression_metric/tsconfig.json +++ b/src/plugins/expression_metric/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -13,7 +12,7 @@ "server/**/*", "__fixtures__/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../presentation_util/tsconfig.json" }, { "path": "../expressions/tsconfig.json" }, diff --git a/src/plugins/expression_repeat_image/tsconfig.json b/src/plugins/expression_repeat_image/tsconfig.json index 111ff58935a35..419685fe65a31 100644 --- a/src/plugins/expression_repeat_image/tsconfig.json +++ b/src/plugins/expression_repeat_image/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../presentation_util/tsconfig.json" }, { "path": "../expressions/tsconfig.json" }, diff --git a/src/plugins/expression_reveal_image/tsconfig.json b/src/plugins/expression_reveal_image/tsconfig.json index 111ff58935a35..419685fe65a31 100644 --- a/src/plugins/expression_reveal_image/tsconfig.json +++ b/src/plugins/expression_reveal_image/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../presentation_util/tsconfig.json" }, { "path": "../expressions/tsconfig.json" }, diff --git a/src/plugins/expression_shape/tsconfig.json b/src/plugins/expression_shape/tsconfig.json index 9a7175a8d767b..f77c026619110 100644 --- a/src/plugins/expression_shape/tsconfig.json +++ b/src/plugins/expression_shape/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -13,7 +12,7 @@ "server/**/*", "__fixtures__/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../presentation_util/tsconfig.json" }, { "path": "../expressions/tsconfig.json" }, diff --git a/src/plugins/expressions/common/execution/execution.abortion.test.ts b/src/plugins/expressions/common/execution/execution.abortion.test.ts index 1664dd86870a8..71dca4f60c721 100644 --- a/src/plugins/expressions/common/execution/execution.abortion.test.ts +++ b/src/plugins/expressions/common/execution/execution.abortion.test.ts @@ -13,7 +13,7 @@ import { parseExpression } from '../ast'; import { createUnitTestExecutor } from '../test_helpers'; import { ExpressionFunctionDefinition } from '../expression_functions'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); beforeEach(() => { jest.clearAllTimers(); @@ -82,7 +82,7 @@ describe('Execution abortion tests', () => { expect(result).toBe(null); - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); test('nested expressions are aborted when parent aborted', async () => { @@ -151,6 +151,6 @@ describe('Execution abortion tests', () => { expect(aborted).toHaveBeenCalledTimes(1); expect(completed).toHaveBeenCalledTimes(0); - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); }); diff --git a/src/plugins/expressions/common/execution/execution.test.ts b/src/plugins/expressions/common/execution/execution.test.ts index 2d452b0a640ad..b3c3cf8ec92f0 100644 --- a/src/plugins/expressions/common/execution/execution.test.ts +++ b/src/plugins/expressions/common/execution/execution.test.ts @@ -387,7 +387,7 @@ describe('Execution', () => { }); test('result is undefined until execution completes', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const execution = createExecution('sleep 10'); expect(execution.state.get().result).toBe(undefined); execution.start(null).subscribe(jest.fn()); @@ -404,7 +404,7 @@ describe('Execution', () => { jest.useRealTimers(); }); - test('handles functions returning observables', () => { + test('handles partial results when functions return observables', () => { testScheduler.run(({ cold, expectObservable }) => { const arg = cold(' -a-b-c|', { a: 1, b: 2, c: 3 }); const expected = ' -a-b-c|'; @@ -417,7 +417,7 @@ describe('Execution', () => { const executor = createUnitTestExecutor(); executor.registerFunction(observable); - const result = executor.run('observable', null, {}); + const result = executor.run('observable', null, { partial: true }); expectObservable(result).toBe(expected, { a: { result: 1, partial: true }, @@ -426,6 +426,68 @@ describe('Execution', () => { }); }); }); + + test('ignores partial results by default', () => { + testScheduler.run(({ cold, expectObservable, flush }) => { + const a = 1; + const b = 2; + const c = 3; + const arg = cold(' -a-b-c|', { a, b, c }); + const expected = ' ------(c|)'; + const spyFn = jest.fn((value) => value); + const executor = createUnitTestExecutor(); + executor.registerFunction({ + name: 'observable', + args: {}, + help: '', + fn: () => arg, + }); + executor.registerFunction({ + name: 'spy', + args: {}, + help: '', + fn: (input) => spyFn(input), + }); + + const result = executor.run('observable | spy', null); + + expectObservable(result).toBe(expected, { + c: { result: c, partial: false }, + }); + + flush(); + + expect(spyFn).toHaveBeenCalledTimes(1); + expect(spyFn).toHaveBeenCalledWith(c); + }); + }); + + it('throttles partial results', async () => { + testScheduler.run(({ cold, expectObservable }) => { + const a = 1; + const b = 2; + const c = 3; + const d = 4; + const observable = cold('a 5ms b 5ms c 10ms (d|)', { a, b, c, d }); + const expected = ' a 19ms c 2ms (d|)'; + + const executor = createUnitTestExecutor(); + executor.registerFunction({ + name: 'observable', + args: {}, + help: '', + fn: () => observable, + }); + + const result = executor.run('observable', null, { partial: true, throttle: 20 }); + + expectObservable(result).toBe(expected, { + a: expect.objectContaining({ result: a }), + c: expect.objectContaining({ result: c }), + d: expect.objectContaining({ result: d }), + }); + }); + }); }); describe('when function throws', () => { @@ -525,7 +587,7 @@ describe('Execution', () => { fn: (value) => spyFn(value), }); - const result = executor.run('observable | flaky | spy', null, {}); + const result = executor.run('observable | flaky | spy', null, { partial: true }); expectObservable(result).toBe('abc|', { a: { partial: true, result: a }, @@ -561,7 +623,7 @@ describe('Execution', () => { }); test('execution state is "pending" while execution is in progress', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const execution = createExecution('sleep 20'); execution.start(null); jest.advanceTimersByTime(5); @@ -659,7 +721,7 @@ describe('Execution', () => { const executor = createUnitTestExecutor(); executor.registerFunction(observable); - const result = executor.run('add val={observable}', 1, {}); + const result = executor.run('add val={observable}', 1, { partial: true }); expectObservable(result).toBe(expected, { a: { partial: true, result: { type: 'num', value: 2 } }, @@ -705,7 +767,11 @@ describe('Execution', () => { executor.registerFunction(observable2); executor.registerFunction(max); - const result = executor.run('max val1={observable1} val2={observable2}', {}); + const result = executor.run( + 'max val1={observable1} val2={observable2}', + {}, + { partial: true } + ); expectObservable(result).toBe(expected, { a: { partial: true, result: { type: 'num', value: 1 } }, @@ -730,7 +796,7 @@ describe('Execution', () => { const executor = createUnitTestExecutor(); executor.registerFunction(observable); - const result = executor.run('add val={observable}', 1, {}); + const result = executor.run('add val={observable}', 1, { partial: true }); expectObservable(result).toBe(expected, { a: expect.objectContaining({ result: { type: 'num', value: 2 } }), @@ -788,7 +854,7 @@ describe('Execution', () => { fn: (input, args) => spyFn(input, args), }); - const result = executor.run('spy arg={observable | flaky}', null, {}); + const result = executor.run('spy arg={observable | flaky}', null, { partial: true }); expectObservable(result).toBe('abcd|', { a: { partial: true, result: a }, @@ -818,6 +884,47 @@ describe('Execution', () => { expect(spyFn).toHaveBeenNthCalledWith(2, null, { arg: d }); }); }); + + test('supports opting out of partial results in sub-expression', async () => { + testScheduler.run(({ cold, expectObservable, flush }) => { + const a = 1; + const b = 2; + const c = 3; + const observable$ = cold('abc|', { a, b, c }); + const expected = ' ---(c|)'; + const spyFn = jest.fn((input, { arg }) => arg); + + const executor = createUnitTestExecutor(); + executor.registerFunction({ + name: 'observable', + args: {}, + help: '', + fn: () => observable$, + }); + executor.registerFunction({ + name: 'spy', + args: { + arg: { + help: '', + types: ['number'], + }, + }, + help: '', + fn: (input, args) => spyFn(input, args), + }); + + const result = executor.run('spy arg={observable}', null); + + expectObservable(result).toBe(expected, { + c: { partial: false, result: c }, + }); + + flush(); + + expect(spyFn).toHaveBeenCalledTimes(1); + expect(spyFn).toHaveBeenCalledWith(null, { arg: c }); + }); + }); }); describe('when arguments are missing', () => { diff --git a/src/plugins/expressions/common/execution/execution.ts b/src/plugins/expressions/common/execution/execution.ts index 8edf6d3227c02..d8932f234e39a 100644 --- a/src/plugins/expressions/common/execution/execution.ts +++ b/src/plugins/expressions/common/execution/execution.ts @@ -10,16 +10,21 @@ import { i18n } from '@kbn/i18n'; import type { Logger } from '@kbn/logging'; import { isPromise } from '@kbn/std'; import { ObservableLike, UnwrapObservable } from '@kbn/utility-types'; -import { keys, last, mapValues, reduce, zipObject } from 'lodash'; +import { keys, last as lastOf, mapValues, reduce, zipObject } from 'lodash'; import { combineLatest, defer, from, + identity, isObservable, + last, of, + takeWhile, throwError, + timer, Observable, ReplaySubject, + Subscription, } from 'rxjs'; import { catchError, finalize, map, pluck, shareReplay, switchMap, tap } from 'rxjs/operators'; import { now, AbortError } from '@kbn/kibana-utils-plugin/common'; @@ -99,6 +104,61 @@ function markPartial() { }); } +/** + * RxJS' `throttle` operator does not emit the last value immediately when the source observable is completed. + * Instead, it waits for the next throttle period to emit that. + * It might cause delays until we get the final value, even though it is already there. + * @see https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/throttle.ts#L121 + */ +function throttle(timeout: number) { + return (source: Observable): Observable => + new Observable((subscriber) => { + let latest: T | undefined; + let hasValue = false; + + const emit = () => { + if (hasValue) { + subscriber.next(latest); + hasValue = false; + latest = undefined; + } + }; + + let throttled: Subscription | undefined; + const timer$ = timer(0, timeout).pipe( + takeWhile(() => hasValue), + finalize(() => { + subscriber.remove(throttled!); + throttled = undefined; + }) + ); + + subscriber.add( + source.subscribe({ + next: (value) => { + latest = value; + hasValue = true; + + if (!throttled) { + throttled = timer$.subscribe(emit); + subscriber.add(throttled); + } + }, + error: (error) => subscriber.error(error), + complete: () => { + emit(); + subscriber.complete(); + }, + }) + ); + + subscriber.add(() => { + hasValue = false; + latest = undefined; + }); + }); +} + function takeUntilAborted(signal: AbortSignal) { return (source: Observable) => new Observable((subscriber) => { @@ -235,7 +295,10 @@ export class Execution< switchMap((input) => this.invokeChain(this.state.get().ast.chain, input).pipe( takeUntilAborted(this.abortController.signal), - markPartial() + markPartial(), + this.execution.params.partial && this.execution.params.throttle + ? throttle(this.execution.params.throttle) + : identity ) ), catchError((error) => { @@ -303,89 +366,85 @@ export class Execution< return of(input as ChainOutput); } - return of(input).pipe( - switchMap((currentInput) => { - const { function: fnName, arguments: fnArgs } = head; - const fn = getByAlias(this.state.get().functions, fnName, this.execution.params.namespace); - - if (!fn) { - throw createError({ - name: 'fn not found', - message: i18n.translate('expressions.execution.functionNotFound', { - defaultMessage: `Function {fnName} could not be found.`, - values: { - fnName, - }, - }), - }); - } + return defer(() => { + const { function: fnName, arguments: fnArgs } = head; + const fn = getByAlias(this.state.get().functions, fnName, this.execution.params.namespace); - if (fn.disabled) { - throw createError({ - name: 'fn is disabled', - message: i18n.translate('expressions.execution.functionDisabled', { - defaultMessage: `Function {fnName} is disabled.`, - values: { - fnName, - }, - }), - }); - } + if (!fn) { + throw createError({ + name: 'fn not found', + message: i18n.translate('expressions.execution.functionNotFound', { + defaultMessage: `Function {fnName} could not be found.`, + values: { + fnName, + }, + }), + }); + } - if (fn.deprecated) { - this.logger?.warn(`Function '${fnName}' is deprecated`); - } + if (fn.disabled) { + throw createError({ + name: 'fn is disabled', + message: i18n.translate('expressions.execution.functionDisabled', { + defaultMessage: `Function {fnName} is disabled.`, + values: { + fnName, + }, + }), + }); + } - if (this.execution.params.debug) { - head.debug = { - args: {}, - duration: 0, - fn: fn.name, - input: currentInput, - success: true, - }; - } + if (fn.deprecated) { + this.logger?.warn(`Function '${fnName}' is deprecated`); + } - const timeStart = this.execution.params.debug ? now() : 0; - - // `resolveArgs` returns an object because the arguments themselves might - // actually have `then` or `subscribe` methods which would be treated as a `Promise` - // or an `Observable` accordingly. - return this.resolveArgs(fn, currentInput, fnArgs).pipe( - switchMap((resolvedArgs) => { - const args$ = isExpressionValueError(resolvedArgs) - ? throwError(resolvedArgs.error) - : of(resolvedArgs); - - return args$.pipe( - tap((args) => this.execution.params.debug && Object.assign(head.debug, { args })), - switchMap((args) => this.invokeFunction(fn, currentInput, args)), - switchMap((output) => - getType(output) === 'error' ? throwError(output) : of(output) - ), - tap((output) => this.execution.params.debug && Object.assign(head.debug, { output })), - switchMap((output) => this.invokeChain(tail, output)), - catchError((rawError) => { - const error = createError(rawError); - error.error.message = `[${fnName}] > ${error.error.message}`; - - if (this.execution.params.debug) { - Object.assign(head.debug, { error, rawError, success: false }); - } - - return of(error); - }) - ); - }), - finalize(() => { - if (this.execution.params.debug) { - Object.assign(head.debug, { duration: now() - timeStart }); - } - }) - ); - }), - catchError((error) => of(error)) - ); + if (this.execution.params.debug) { + head.debug = { + input, + args: {}, + duration: 0, + fn: fn.name, + success: true, + }; + } + + const timeStart = this.execution.params.debug ? now() : 0; + + // `resolveArgs` returns an object because the arguments themselves might + // actually have `then` or `subscribe` methods which would be treated as a `Promise` + // or an `Observable` accordingly. + return this.resolveArgs(fn, input, fnArgs).pipe( + switchMap((resolvedArgs) => { + const args$ = isExpressionValueError(resolvedArgs) + ? throwError(resolvedArgs.error) + : of(resolvedArgs); + + return args$.pipe( + tap((args) => this.execution.params.debug && Object.assign(head.debug, { args })), + switchMap((args) => this.invokeFunction(fn, input, args)), + this.execution.params.partial ? identity : last(), + switchMap((output) => (getType(output) === 'error' ? throwError(output) : of(output))), + tap((output) => this.execution.params.debug && Object.assign(head.debug, { output })), + switchMap((output) => this.invokeChain(tail, output)), + catchError((rawError) => { + const error = createError(rawError); + error.error.message = `[${fnName}] > ${error.error.message}`; + + if (this.execution.params.debug) { + Object.assign(head.debug, { error, rawError, success: false }); + } + + return of(error); + }) + ); + }), + finalize(() => { + if (this.execution.params.debug) { + Object.assign(head.debug, { duration: now() - timeStart }); + } + }) + ); + }).pipe(catchError((error) => of(error))); } invokeFunction( @@ -581,7 +640,7 @@ export class Execution< // function which would be treated as a promise zipObject(argNames, values as unknown[][]), // Just return the last unless the argument definition allows multiple - (argValues, argName) => (argDefs[argName].multi ? argValues : last(argValues)) + (argValues, argName) => (argDefs[argName].multi ? argValues : lastOf(argValues)) ) ) ); diff --git a/src/plugins/expressions/common/execution/execution_contract.test.ts b/src/plugins/expressions/common/execution/execution_contract.test.ts index 6b0fa0d0db592..6934720d2d70c 100644 --- a/src/plugins/expressions/common/execution/execution_contract.test.ts +++ b/src/plugins/expressions/common/execution/execution_contract.test.ts @@ -141,7 +141,7 @@ describe('ExecutionContract', () => { const executor = createUnitTestExecutor(); executor.registerFunction(observable); - const execution = executor.createExecution('observable'); + const execution = executor.createExecution('observable', { partial: true }); execution.start(null); await execution.result.pipe(first()).toPromise(); diff --git a/src/plugins/expressions/common/expression_functions/specs/math_column.ts b/src/plugins/expressions/common/expression_functions/specs/math_column.ts index b513ef5d27409..e056bc6b876e1 100644 --- a/src/plugins/expressions/common/expression_functions/specs/math_column.ts +++ b/src/plugins/expressions/common/expression_functions/specs/math_column.ts @@ -14,6 +14,7 @@ import { Datatable, DatatableColumn, DatatableColumnType, getType } from '../../ export type MathColumnArguments = MathArguments & { id: string; name?: string; + castColumns?: string[]; copyMetaFrom?: string | null; }; @@ -52,6 +53,14 @@ export const mathColumn: ExpressionFunctionDefinition< }), required: true, }, + castColumns: { + types: ['string'], + multi: true, + help: i18n.translate('expressions.functions.mathColumn.args.castColumnsHelpText', { + defaultMessage: 'The ids of columns to cast to numbers before applying the formula', + }), + required: false, + }, copyMetaFrom: { types: ['string', 'null'], help: i18n.translate('expressions.functions.mathColumn.args.copyMetaFromHelpText', { @@ -77,11 +86,31 @@ export const mathColumn: ExpressionFunctionDefinition< const newRows = await Promise.all( input.rows.map(async (row) => { + let preparedRow = row; + if (args.castColumns) { + preparedRow = { ...row }; + args.castColumns.forEach((columnId) => { + switch (typeof row[columnId]) { + case 'string': + const parsedAsDate = Number(new Date(preparedRow[columnId])); + if (!isNaN(parsedAsDate)) { + preparedRow[columnId] = parsedAsDate; + return; + } else { + preparedRow[columnId] = Number(preparedRow[columnId]); + return; + } + case 'boolean': + preparedRow[columnId] = Number(preparedRow[columnId]); + return; + } + }); + } const result = await math.fn( { ...input, columns: input.columns, - rows: [row], + rows: [preparedRow], }, { expression: args.expression, diff --git a/src/plugins/expressions/common/service/expressions_services.ts b/src/plugins/expressions/common/service/expressions_services.ts index 097b0823a98f0..0480e4966c01f 100644 --- a/src/plugins/expressions/common/service/expressions_services.ts +++ b/src/plugins/expressions/common/service/expressions_services.ts @@ -161,6 +161,18 @@ export interface ExpressionExecutionParams { executionContext?: KibanaExecutionContext; namespace?: string; + + /** + * Toggles the partial results support. + * @default false + */ + partial?: boolean; + + /** + * Throttling of partial results in milliseconds. 0 is disabling the throttling. + * @deafult 0 + */ + throttle?: number; } /** diff --git a/src/plugins/expressions/public/loader.ts b/src/plugins/expressions/public/loader.ts index 5b1ae822e1a2c..e2b9d8ab22fb7 100644 --- a/src/plugins/expressions/public/loader.ts +++ b/src/plugins/expressions/public/loader.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { BehaviorSubject, Observable, Subject, Subscription, identity, timer } from 'rxjs'; -import { delay, filter, finalize, map, shareReplay, takeWhile } from 'rxjs/operators'; +import { BehaviorSubject, Observable, Subject, Subscription } from 'rxjs'; +import { delay, filter, map, shareReplay } from 'rxjs/operators'; import { defaults } from 'lodash'; import { SerializableRecord, UnwrapObservable } from '@kbn/utility-types'; import { Adapters } from '@kbn/inspector-plugin/public'; @@ -20,61 +20,6 @@ import { getExpressionsService } from './services'; type Data = unknown; -/** - * RxJS' `throttle` operator does not emit the last value immediately when the source observable is completed. - * Instead, it waits for the next throttle period to emit that. - * It might cause delays until we get the final value, even though it is already there. - * @see https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/throttle.ts#L121 - */ -function throttle(timeout: number) { - return (source: Observable): Observable => - new Observable((subscriber) => { - let latest: T | undefined; - let hasValue = false; - - const emit = () => { - if (hasValue) { - subscriber.next(latest); - hasValue = false; - latest = undefined; - } - }; - - let throttled: Subscription | undefined; - const timer$ = timer(0, timeout).pipe( - takeWhile(() => hasValue), - finalize(() => { - subscriber.remove(throttled!); - throttled = undefined; - }) - ); - - subscriber.add( - source.subscribe({ - next: (value) => { - latest = value; - hasValue = true; - - if (!throttled) { - throttled = timer$.subscribe(emit); - subscriber.add(throttled); - } - }, - error: (error) => subscriber.error(error), - complete: () => { - emit(); - subscriber.complete(); - }, - }) - ); - - subscriber.add(() => { - hasValue = false; - latest = undefined; - }); - }); -} - export class ExpressionLoader { data$: ReturnType; update$: ExpressionRenderHandler['update$']; @@ -203,14 +148,13 @@ export class ExpressionLoader { syncCursor: params?.syncCursor, syncTooltips: params.syncTooltips, executionContext: params.executionContext, + partial: params.partial, + throttle: params.throttle, }); this.subscription = this.execution .getData() - .pipe( - delay(0), // delaying until the next tick since we execute the expression in the constructor - filter(({ partial }) => params.partial || !partial), - params.partial && params.throttle ? throttle(params.throttle) : identity - ) + // delaying until the next tick since we execute the expression in the constructor + .pipe(delay(0)) .subscribe((value) => this.dataSubject.next(value)); }; diff --git a/src/plugins/expressions/public/plugin.ts b/src/plugins/expressions/public/plugin.ts index d71a1457381ff..134b0a7c511ac 100644 --- a/src/plugins/expressions/public/plugin.ts +++ b/src/plugins/expressions/public/plugin.ts @@ -42,6 +42,7 @@ export class ExpressionsPublicPlugin implements Plugin true, }; private readonly expressions: ExpressionsService = new ExpressionsService({ diff --git a/src/plugins/expressions/tsconfig.json b/src/plugins/expressions/tsconfig.json index 7bfed50cba0f1..890274c1b3911 100644 --- a/src/plugins/expressions/tsconfig.json +++ b/src/plugins/expressions/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*", "./index.ts"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, { "path": "../inspector/tsconfig.json" }, diff --git a/src/plugins/field_formats/tsconfig.json b/src/plugins/field_formats/tsconfig.json index 9fb87bc5dd970..4838076f81cd3 100644 --- a/src/plugins/field_formats/tsconfig.json +++ b/src/plugins/field_formats/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -14,5 +13,5 @@ "common/**/*.json", "public/**/*.json" ], - "references": [{ "path": "../../core/tsconfig.json" }] + "kbn_references": [{ "path": "../../core/tsconfig.json" }] } diff --git a/x-pack/plugins/files/.i18nrc.json b/src/plugins/files/.i18nrc.json similarity index 100% rename from x-pack/plugins/files/.i18nrc.json rename to src/plugins/files/.i18nrc.json diff --git a/src/plugins/files/.storybook/main.ts b/src/plugins/files/.storybook/main.ts new file mode 100644 index 0000000000000..f9d5b3ea3eddc --- /dev/null +++ b/src/plugins/files/.storybook/main.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { defaultConfig } from '@kbn/storybook'; + +module.exports = { + ...defaultConfig, + stories: ['../**/*.stories.tsx'], + reactOptions: { + strictMode: true, + }, +}; diff --git a/src/plugins/files/.storybook/manager.ts b/src/plugins/files/.storybook/manager.ts new file mode 100644 index 0000000000000..d49eea1784792 --- /dev/null +++ b/src/plugins/files/.storybook/manager.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +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 React Storybook', + brandUrl: 'https://github.com/elastic/kibana/tree/main/src/plugins/files', + }), + showPanel: true.valueOf, + selectedPanel: PANEL_ID, +}); diff --git a/x-pack/plugins/files/README.md b/src/plugins/files/README.md similarity index 100% rename from x-pack/plugins/files/README.md rename to src/plugins/files/README.md diff --git a/src/plugins/files/common/api_routes.ts b/src/plugins/files/common/api_routes.ts new file mode 100644 index 0000000000000..7d95d24be9ec0 --- /dev/null +++ b/src/plugins/files/common/api_routes.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { TypeOf, Type } from '@kbn/config-schema'; +import { PLUGIN_ID } from './constants'; + +export const API_BASE_PATH = `/api/${PLUGIN_ID}`; + +export const FILES_API_BASE_PATH = `${API_BASE_PATH}/files`; + +export const FILES_SHARE_API_BASE_PATH = `${API_BASE_PATH}/shares`; + +export const FILES_PUBLIC_API_BASE_PATH = `${API_BASE_PATH}/public`; + +export interface EndpointInputs< + P extends Type = Type, + Q extends Type = Type, + B extends Type = Type +> { + params?: P; + query?: Q; + body?: B; +} + +export interface CreateRouteDefinition { + inputs: { + params: TypeOf>; + query: TypeOf>; + body: TypeOf>; + }; + output: R; +} + +export type AnyEndpoint = CreateRouteDefinition; + +/** + * Abstract type definition for API route inputs and outputs. + * + * These definitions should be shared between the public and server + * as the single source of truth. + */ +export interface HttpApiInterfaceEntryDefinition< + P = unknown, + Q = unknown, + B = unknown, + R = unknown +> { + inputs: { + params: P; + query: Q; + body: B; + }; + output: R; +} + +export type { Endpoint as CreateFileKindHttpEndpoint } from '../server/routes/file_kind/create'; +export type { Endpoint as DeleteFileKindHttpEndpoint } from '../server/routes/file_kind/delete'; +export type { Endpoint as DownloadFileKindHttpEndpoint } from '../server/routes/file_kind/download'; +export type { Endpoint as GetByIdFileKindHttpEndpoint } from '../server/routes/file_kind/get_by_id'; +export type { Endpoint as ListFileKindHttpEndpoint } from '../server/routes/file_kind/list'; +export type { Endpoint as UpdateFileKindHttpEndpoint } from '../server/routes/file_kind/update'; +export type { Endpoint as UploadFileKindHttpEndpoint } from '../server/routes/file_kind/upload'; +export type { Endpoint as FindFilesHttpEndpoint } from '../server/routes/find'; +export type { Endpoint as FilesMetricsHttpEndpoint } from '../server/routes/metrics'; +export type { Endpoint as FileShareHttpEndpoint } from '../server/routes/file_kind/share/share'; +export type { Endpoint as FileUnshareHttpEndpoint } from '../server/routes/file_kind/share/unshare'; +export type { Endpoint as FileGetShareHttpEndpoint } from '../server/routes/file_kind/share/get'; +export type { Endpoint as FileListSharesHttpEndpoint } from '../server/routes/file_kind/share/list'; +export type { Endpoint as FilePublicDownloadHttpEndpoint } from '../server/routes/public_facing/download'; diff --git a/src/plugins/files/common/constants.ts b/src/plugins/files/common/constants.ts new file mode 100644 index 0000000000000..19f0736eeaf47 --- /dev/null +++ b/src/plugins/files/common/constants.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/** + * The files plugin ID + */ +export const PLUGIN_ID = 'files' as const; +/** + * The files plugin name + */ +export const PLUGIN_NAME = 'files' as const; + +/** + * Unique type name of the file saved object + */ +export const FILE_SO_TYPE = 'file'; +/** + * Unique type name of the public file saved object + */ +export const FILE_SHARE_SO_TYPE = 'fileShare'; + +/** + * The name of the fixed size ES-backed blob store + */ +export const ES_FIXED_SIZE_INDEX_BLOB_STORE = 'esFixedSizeIndex' as const; + +export const FILES_MANAGE_PRIVILEGE = 'files:manageFiles' as const; diff --git a/src/plugins/files/common/file_kinds_registry/index.ts b/src/plugins/files/common/file_kinds_registry/index.ts new file mode 100644 index 0000000000000..afed906bd0aa3 --- /dev/null +++ b/src/plugins/files/common/file_kinds_registry/index.ts @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createGetterSetter } from '@kbn/kibana-utils-plugin/common'; +import assert from 'assert'; +import { FileKind } from '..'; + +export interface FileKindsRegistry { + /** + * Register a new file kind. + */ + register(fileKind: FileKind): void; + + /** + * Gets a {@link FileKind} or throws. + */ + get(id: string): FileKind; + + /** + * Return all registered {@link FileKind}s. + */ + getAll(): FileKind[]; +} + +/** + * @internal + */ +export class FileKindsRegistryImpl implements FileKindsRegistry { + constructor(private readonly onRegister?: (fileKind: FileKind) => void) {} + + private readonly fileKinds = new Map(); + + register(fileKind: FileKind) { + if (this.fileKinds.get(fileKind.id)) { + throw new Error(`File kind "${fileKind.id}" already registered.`); + } + + if (fileKind.id !== encodeURIComponent(fileKind.id)) { + throw new Error( + `File kind id "${fileKind.id}" is not a valid file kind ID. Choose an ID that does not need to be URI encoded.` + ); + } + + this.fileKinds.set(fileKind.id, fileKind); + this.onRegister?.(fileKind); + } + + get(id: string): FileKind { + const fileKind = this.fileKinds.get(id); + assert(fileKind, `File kind with id "${id}" not found.`); + return fileKind; + } + + getAll(): FileKind[] { + return Array.from(this.fileKinds.values()); + } +} + +export const [getFileKindsRegistry, setFileKindsRegistry] = + createGetterSetter('fileKindsRegistry'); diff --git a/src/plugins/files/common/index.ts b/src/plugins/files/common/index.ts new file mode 100755 index 0000000000000..ece05d00a8bd3 --- /dev/null +++ b/src/plugins/files/common/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { FILE_SO_TYPE, PLUGIN_ID, PLUGIN_NAME, ES_FIXED_SIZE_INDEX_BLOB_STORE } from './constants'; + +export type { + File, + FileKind, + FileJSON, + FileShare, + FileStatus, + Pagination, + FileMetadata, + FilesMetrics, + FileShareJSON, + FileCompression, + FileSavedObject, + BaseFileMetadata, + FileShareOptions, + FileImageMetadata, + FileUnshareOptions, + BlobStorageSettings, + UpdatableFileMetadata, + FileShareJSONWithToken, + UpdatableFileShareMetadata, +} from './types'; diff --git a/src/plugins/files/common/types.ts b/src/plugins/files/common/types.ts new file mode 100644 index 0000000000000..247340c583ea6 --- /dev/null +++ b/src/plugins/files/common/types.ts @@ -0,0 +1,580 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SavedObject } from '@kbn/core/server'; +import type { Observable } from 'rxjs'; +import type { Readable } from 'stream'; +import type { ES_FIXED_SIZE_INDEX_BLOB_STORE } from './constants'; + +/** + * Values for paginating through results. + */ +export interface Pagination { + /** + * Page of results. + */ + page?: number; + /** + * Number of results per page. + */ + perPage?: number; +} + +/** + * Status of a file. + * + * AWAITING_UPLOAD - A file object has been created but does not have any contents. + * UPLOADING - File contents are being uploaded. + * READY - File contents have been uploaded and are ready for to be downloaded. + * UPLOAD_ERROR - An attempt was made to upload file contents but failed. + * DELETED - The file contents have been or are being deleted. + */ +export type FileStatus = 'AWAITING_UPLOAD' | 'UPLOADING' | 'READY' | 'UPLOAD_ERROR' | 'DELETED'; + +/** + * Supported file compression algorithms + */ +export type FileCompression = 'br' | 'gzip' | 'deflate' | 'none'; + +/** + * File metadata fields are defined per the ECS specification: + * + * https://www.elastic.co/guide/en/ecs/current/ecs-file.html + * + * Custom fields are named according to the custom field convention: "CustomFieldName". + */ +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +export type BaseFileMetadata = { + /** + * Name of the file + * + * @note This field is recommended since it will provide a better UX + */ + name?: string; + + /** + * MIME type of the file contents + */ + mime_type?: string; + + /** + * ISO string representing the file creation date + */ + created?: string; + /** + * Size of the file + */ + size?: number; + /** + * Hash of the file's contents + */ + hash?: { + /** + * UTF-8 string representing MD5 hash + */ + md5?: string; + /** + * UTF-8 string representing sha1 hash + */ + sha1?: string; + /** + * UTF-8 string representing sha256 hash + */ + sha256?: string; + /** + * UTF-8 string representing sha384 hash + */ + sha384?: string; + /** + * UTF-8 string representing sha512 hash + */ + sha512?: string; + /** + * UTF-8 string representing shadeep hash + */ + ssdeep?: string; + /** + * UTF-8 string representing tlsh hash + */ + tlsh?: string; + [hashName: string]: string | undefined; + }; + + /** + * Data about the user that created the file + */ + user?: { + /** + * The human-friendly user name of the owner of the file + * + * @note this field cannot be used to uniquely ID a user. See {@link BaseFileMetadata['user']['id']}. + */ + name?: string; + /** + * The unique ID of the user who created the file, taken from the user profile + * ID. + * + * See https://www.elastic.co/guide/en/elasticsearch/reference/master/user-profile.html. + */ + id?: string; + }; + + /** + * The file extension, for example "jpg", "png", "svg" and so forth + */ + extension?: string; + + /** + * Alternate text that can be used used to describe the contents of the file + * in human-friendly language + */ + Alt?: string; + + /** + * ISO string representing when the file was last updated + */ + Updated?: string; + + /** + * The file's current status + */ + Status?: FileStatus; + + /** + * The maximum number of bytes per file chunk + */ + ChunkSize?: number; + + /** + * Compression algorithm used to transform chunks before they were stored. + */ + Compression?: FileCompression; +}; + +/** + * Extra metadata on a file object specific to Kibana implementation. + */ +export type FileMetadata = Required< + Pick +> & + BaseFileMetadata & { + /** + * Unique identifier of the kind of file. Kibana applications can register + * these at runtime. + */ + FileKind: string; + + /** + * User-defined metadata. + */ + Meta?: Meta; + }; + +/** + * Attributes of a file that represent a serialised version of the file. + */ +export interface FileJSON { + /** + * Unique file ID. + */ + id: string; + /** + * ISO string of when this file was created + */ + created: FileMetadata['created']; + /** + * ISO string of when the file was updated + */ + updated: FileMetadata['Updated']; + /** + * File name. + * + * @note Does not have to be unique. + */ + name: FileMetadata['name']; + /** + * MIME type of the file's contents. + */ + mimeType: FileMetadata['mime_type']; + /** + * The size, in bytes, of the file content. + */ + size: FileMetadata['size']; + /** + * The file extension (dot suffix). + * + * @note this value can be derived from MIME type but is stored for search + * convenience. + */ + extension: FileMetadata['extension']; + + /** + * A consumer defined set of attributes. + * + * Consumers of the file service can add their own tags and identifiers to + * a file using the "meta" object. + */ + meta: FileMetadata['Meta']; + /** + * Use this text to describe the file contents for display and accessibility. + */ + alt: FileMetadata['Alt']; + /** + * A unique kind that governs various aspects of the file. A consumer of the + * files service must register a file kind and link their files to a specific + * kind. + * + * @note This enables stricter access controls to CRUD and other functionality + * exposed by the files service. + */ + fileKind: FileMetadata['FileKind']; + /** + * The current status of the file. + * + * See {@link FileStatus} for more details. + */ + status: FileMetadata['Status']; + /** + * User data associated with this file + */ + user?: FileMetadata['user']; +} + +/** + * An {@link SavedObject} containing a file object (i.e., metadata only). + */ +export type FileSavedObject = SavedObject>; + +/** + * The set of file metadata that can be updated. + */ +export type UpdatableFileMetadata = Pick, 'meta' | 'alt' | 'name'>; + +/** + * Data stored with a file share object + */ +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +export type FileShare = { + /** + * ISO timestamp of when the file share was created. + */ + created: string; + + /** + * Secret token used to access the associated file. + */ + token: string; + + /** + * Human friendly name for this share token. + */ + name?: string; + + /** + * The unix timestamp (in milliseconds) this file share will expire. + * + * TODO: in future we could add a special value like "forever", but this should + * not be the default. + */ + valid_until: number; +}; + +/** + * Attributes of a file that represent a serialised version of the file. + */ +export interface FileShareJSON { + /** + * Unique ID share instance + */ + id: string; + /** + * ISO timestamp the share was created + */ + created: FileShare['created']; + /** + * Unix timestamp (in milliseconds) of when this share expires + */ + validUntil: FileShare['valid_until']; + /** + * A user-friendly name for the file share + */ + name?: FileShare['name']; + /** + * The ID of the file this share is linked to + */ + fileId: string; +} + +/** + * A version of the file share with a token included. + * + * @note This should only be shown when the file share is first created + */ +export type FileShareJSONWithToken = FileShareJSON & { + /** + * Secret token that can be used to access files + */ + token: string; +}; + +/** + * Set of attributes that can be updated in a file share. + */ +export type UpdatableFileShareMetadata = Pick; + +/** + * Arguments to pass to share a file + */ +export interface FileShareOptions { + /** + * Optional name for the file share, should be human-friendly. + */ + name?: string; + /** + * Unix timestamp (in milliseconds) when the file share will expire. + * + * @note default is 30 days + */ + validUntil?: number; +} +/** + * Arguments for unsharing a file + */ +export interface FileUnshareOptions { + /** + * Specify the share instance to remove + */ + shareId: string; +} + +/** + * A class with set of properties and behaviors of the "smart" file object and adds + * behaviours for interacting with files on top of the pure data. + */ +export interface File { + /** + * The file ID + */ + id: string; + + /** + * File metadata in camelCase form. + */ + data: FileJSON; + /** + * Update a file object's metadatathat can be updated. + * + * @param attr - The of attributes to update. + */ + update(attr: Partial>): Promise>; + + /** + * Stream file content to storage. + * + * @param content - The content to stream to storage. + * @param abort$ - An observable that can be used to abort the upload at any time. + */ + uploadContent(content: Readable, abort$?: Observable): Promise>; + + /** + * Stream file content from storage. + */ + downloadContent(): Promise; + + /** + * Delete a file. + * + * @note This will delete the file metadata, contents and any other objects + * related to the file owned by files. + */ + delete(): Promise; + + /** + * Generate a secure token that can be used to access a file's content. + * + * @note This makes a file available for public download. Any agent with the + * token will bypass normal authz and authn checks. + * + * @param opts - Share file options. + */ + share(opts?: FileShareOptions): Promise; + + /** + * List all current {@link FileShareJSON} objects that have been created for + * a file. + */ + listShares(): Promise; + + /** + * Remove a {@link FileShareJSON} object therefore ceasing to share a file's + * content. + * + * @param opts - Unshare file options + */ + unshare(opts: FileUnshareOptions): Promise; + + /** + * Get a JSON representation of the file. Convenient for serialisation. + */ + toJSON(): FileJSON; +} + +/** + * Defines all the settings for supported blob stores. + * + * Key names map to unique blob store implementations and so must not be changed + * without a migration + */ +export interface BlobStorageSettings { + /** + * Single index that supports up to 50GB of blobs + */ + [ES_FIXED_SIZE_INDEX_BLOB_STORE]?: { + index: string; + }; + // Other blob store settings will go here once available +} + +interface HttpEndpointDefinition { + /** + * Specify the tags for this endpoint. + * + * @example + * // This will enable access control to this endpoint for users that can access "myApp" only. + * { tags: ['access:myApp'] } + * + */ + tags: string[]; +} + +/** + * A descriptor of meta values associated with a set or "kind" of files. + * + * @note In order to use the file service consumers must register a {@link FileKind} + * in the {@link FileKindsRegistry}. + */ +export interface FileKind { + /** + * Unique file kind ID + */ + id: string; + /** + * Maximum size, in bytes, a file of this kind can be. + * + * @default 4MiB + */ + maxSizeBytes?: number; + + /** + * The MIME type of the file content. + * + * @default accept all mime types + */ + allowedMimeTypes?: string[]; + + /** + * Blob store specific settings that enable configuration of storage + * details. + */ + blobStoreSettings?: BlobStorageSettings; + + /** + * Specify which HTTP routes to create for the file kind. + * + * You can always create your own HTTP routes for working with files but + * this interface allows you to expose basic CRUD operations, upload, download + * and sharing of files over a RESTful-like interface. + * + * @note The public {@link FileClient} uses these endpoints. + */ + http: { + /** + * Expose file creation (and upload) over HTTP. + */ + create?: HttpEndpointDefinition; + /** + * Expose file updates over HTTP. + */ + update?: HttpEndpointDefinition; + /** + * Expose file deletion over HTTP. + */ + delete?: HttpEndpointDefinition; + /** + * Expose "get by ID" functionality over HTTP. + */ + getById?: HttpEndpointDefinition; + /** + * Expose the ability to list all files of this kind over HTTP. + */ + list?: HttpEndpointDefinition; + /** + * Expose the ability to download a file's contents over HTTP. + */ + download?: HttpEndpointDefinition; + /** + * Expose file share functionality over HTTP. + */ + share?: HttpEndpointDefinition; + }; +} + +/** + * A collection of generally useful metrics about files. + */ +export interface FilesMetrics { + /** + * Metrics about all storage media. + */ + storage: { + /** + * The ES fixed size blob store. + */ + [ES_FIXED_SIZE_INDEX_BLOB_STORE]: { + /** + * The total size in bytes that can be used in this storage medium + */ + capacity: number; + /** + * Bytes currently used + */ + used: number; + /** + * Bytes currently available + */ + available: number; + }; + }; + /** + * A count of all files grouped by status + */ + countByStatus: Record; + /** + * A count of all files grouped by extension + */ + countByExtension: Record; +} + +/** + * Set of metadata captured for every image uploaded via the file services' + * public components. + */ +export interface FileImageMetadata { + /** + * The blurhash that can be displayed while the image is loading + */ + blurhash?: string; + /** + * Width, in px, of the original image + */ + width: number; + /** + * Height, in px, of the original image + */ + height: number; +} diff --git a/x-pack/plugins/files/docs/tutorial.mdx b/src/plugins/files/docs/tutorial.mdx similarity index 99% rename from x-pack/plugins/files/docs/tutorial.mdx rename to src/plugins/files/docs/tutorial.mdx index b3bfed56dd865..deef2de26045d 100644 --- a/x-pack/plugins/files/docs/tutorial.mdx +++ b/src/plugins/files/docs/tutorial.mdx @@ -53,7 +53,7 @@ Consumers of the file service are able to decide what metadata they want to asso ### How to set up files for your plugin -All setup examples are based on the [`filesExample` plugin](https://github.com/elastic/kibana/blob/d431e87f7ff43833bff085e5bb5b2ab603bfa05d/x-pack/examples/files_example/README.md). +All setup examples are based on the [`filesExample` plugin](https://github.com/elastic/kibana/blob/d431e87f7ff43833bff085e5bb5b2ab603bfa05d/examples/files_example/README.md). First add the `files` plugin as a required dependency in your `kibana.json`: diff --git a/src/plugins/files/jest.config.js b/src/plugins/files/jest.config.js new file mode 100644 index 0000000000000..96e2f529c9ace --- /dev/null +++ b/src/plugins/files/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/src/plugins/files'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/files', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/files/{common,public,server}/**/*.{js,ts,tsx}'], +}; diff --git a/src/plugins/files/jest.integration.config.js b/src/plugins/files/jest.integration.config.js new file mode 100644 index 0000000000000..f0fa0a8ccef45 --- /dev/null +++ b/src/plugins/files/jest.integration.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_integration', + rootDir: '../../..', + roots: ['/src/plugins/files'], +}; diff --git a/src/plugins/files/kibana.json b/src/plugins/files/kibana.json new file mode 100755 index 0000000000000..47637d78fa0de --- /dev/null +++ b/src/plugins/files/kibana.json @@ -0,0 +1,14 @@ +{ + "id": "files", + "version": "1.0.0", + "kibanaVersion": "kibana", + "owner": { + "name": "@elastic/kibana-app-services", + "githubTeam": "team:AppServicesUx" + }, + "description": "File upload, download, sharing, and serving over HTTP implementation in Kibana.", + "server": true, + "ui": true, + "requiredBundles": ["kibanaUtils"], + "optionalPlugins": ["security", "usageCollection"] +} diff --git a/src/plugins/files/public/components/context.tsx b/src/plugins/files/public/components/context.tsx new file mode 100644 index 0000000000000..fbf73999b625f --- /dev/null +++ b/src/plugins/files/public/components/context.tsx @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { createContext, useContext, type FunctionComponent } from 'react'; +import { FileKindsRegistry, getFileKindsRegistry } from '../../common/file_kinds_registry'; +import type { FilesClient } from '../types'; + +export interface FilesContextValue { + registry: FileKindsRegistry; + /** + * A files client that will be used process uploads. + */ + client: FilesClient; +} + +const FilesContextObject = createContext(null as unknown as FilesContextValue); + +export const useFilesContext = () => { + const ctx = useContext(FilesContextObject); + if (!ctx) { + throw new Error('FilesContext is not found!'); + } + return ctx; +}; + +interface ContextProps { + /** + * A files client that will be used process uploads. + */ + client: FilesClient; +} +export const FilesContext: FunctionComponent = ({ client, children }) => { + return ( + + {children} + + ); +}; diff --git a/src/plugins/files/public/components/file_picker/components/clear_filter_button.tsx b/src/plugins/files/public/components/file_picker/components/clear_filter_button.tsx new file mode 100644 index 0000000000000..c8a373f70cd55 --- /dev/null +++ b/src/plugins/files/public/components/file_picker/components/clear_filter_button.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import type { FunctionComponent } from 'react'; +import useObservable from 'react-use/lib/useObservable'; +import { EuiLink } from '@elastic/eui'; +import { css } from '@emotion/react'; +import { useFilePickerContext } from '../context'; + +import { i18nTexts } from '../i18n_texts'; +import { useBehaviorSubject } from '../../use_behavior_subject'; + +interface Props { + onClick: () => void; +} + +export const ClearFilterButton: FunctionComponent = ({ onClick }) => { + const { state } = useFilePickerContext(); + const isUploading = useBehaviorSubject(state.isUploading$); + const query = useObservable(state.queryDebounced$); + if (!query) { + return null; + } + return ( +
+ + {i18nTexts.clearFilterButton} + +
+ ); +}; diff --git a/src/plugins/files/public/components/file_picker/components/empty_prompt.tsx b/src/plugins/files/public/components/file_picker/components/empty_prompt.tsx new file mode 100644 index 0000000000000..84b52281805ad --- /dev/null +++ b/src/plugins/files/public/components/file_picker/components/empty_prompt.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiEmptyPrompt } from '@elastic/eui'; +import type { FunctionComponent } from 'react'; +import { UploadFile } from '../../upload_file'; +import { useFilePickerContext } from '../context'; +import { i18nTexts } from '../i18n_texts'; + +interface Props { + kind: string; + multiple: boolean; +} + +export const EmptyPrompt: FunctionComponent = ({ kind, multiple }) => { + const { state } = useFilePickerContext(); + return ( + {i18nTexts.emptyStatePrompt}

} + titleSize="s" + actions={[ + // TODO: We can remove this once the entire modal is an upload area + { + state.selectFile(file.map(({ id }) => id)); + state.retry(); + }} + />, + ]} + /> + ); +}; diff --git a/x-pack/plugins/files/public/components/file_picker/components/error_content.tsx b/src/plugins/files/public/components/file_picker/components/error_content.tsx similarity index 84% rename from x-pack/plugins/files/public/components/file_picker/components/error_content.tsx rename to src/plugins/files/public/components/file_picker/components/error_content.tsx index c2925c793fe63..d37b2ffdc2f46 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/error_content.tsx +++ b/src/plugins/files/public/components/file_picker/components/error_content.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/file_card.scss b/src/plugins/files/public/components/file_picker/components/file_card.scss similarity index 100% rename from x-pack/plugins/files/public/components/file_picker/components/file_card.scss rename to src/plugins/files/public/components/file_picker/components/file_card.scss diff --git a/x-pack/plugins/files/public/components/file_picker/components/file_card.tsx b/src/plugins/files/public/components/file_picker/components/file_card.tsx similarity index 84% rename from x-pack/plugins/files/public/components/file_picker/components/file_card.tsx rename to src/plugins/files/public/components/file_picker/components/file_card.tsx index 4c290b1b114e7..398634bc352d6 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/file_card.tsx +++ b/src/plugins/files/public/components/file_picker/components/file_card.tsx @@ -1,11 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import React from 'react'; +import React, { useMemo } from 'react'; import type { FunctionComponent } from 'react'; import numeral from '@elastic/numeral'; import useObservable from 'react-use/lib/useObservable'; @@ -26,8 +27,8 @@ export const FileCard: FunctionComponent = ({ file }) => { const { kind, state, client } = useFilePickerContext(); const { euiTheme } = useEuiTheme(); const displayImage = isImage({ type: file.mimeType }); - - const isSelected = useObservable(state.watchFileSelected$(file.id), false); + const isSelected$ = useMemo(() => state.watchFileSelected$(file.id), [file.id, state]); + const isSelected = useObservable(isSelected$, false); const imageHeight = `calc(${euiTheme.size.xxxl} * 2)`; return ( @@ -58,11 +59,6 @@ export const FileCard: FunctionComponent = ({ file }) => { `} meta={file.meta as FileImageMetadata} src={client.getDownloadHref({ id: file.id, fileKind: kind })} - // There is an issue where the intersection observer does not fire reliably. - // I'm not sure if this is becuause of the image being in a modal - // The result is that the image does not always get loaded. - // TODO: Investigate this behaviour further - lazy={false} /> ) : (
= ({ kind, onDone, onUpload, multiple }) => { + const { state } = useFilePickerContext(); + const onUploadStart = useCallback(() => state.setIsUploading(true), [state]); + const onUploadEnd = useCallback(() => state.setIsUploading(false), [state]); + return ( + +
+
+ { + state.selectFile(n.map(({ id }) => id)); + state.resetFilters(); + onUpload?.(n); + }} + onUploadStart={onUploadStart} + onUploadEnd={onUploadEnd} + kind={kind} + initialPromptText={i18nTexts.uploadFilePlaceholderText} + multiple={multiple} + compressed + /> +
+
+ +
+
+ +
+
+
+ ); +}; diff --git a/src/plugins/files/public/components/file_picker/components/pagination.tsx b/src/plugins/files/public/components/file_picker/components/pagination.tsx new file mode 100644 index 0000000000000..3384edcab16c2 --- /dev/null +++ b/src/plugins/files/public/components/file_picker/components/pagination.tsx @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import type { FunctionComponent } from 'react'; +import { EuiPagination } from '@elastic/eui'; +import useObservable from 'react-use/lib/useObservable'; +import { useFilePickerContext } from '../context'; +import { useBehaviorSubject } from '../../use_behavior_subject'; + +export const Pagination: FunctionComponent = () => { + const { state } = useFilePickerContext(); + const page = useBehaviorSubject(state.currentPage$); + const files = useObservable(state.files$, []); + const pageCount = useBehaviorSubject(state.totalPages$); + const isUploading = useBehaviorSubject(state.isUploading$); + if (files.length === 0) { + return null; + } + return ( + {} : state.setPage} + pageCount={pageCount} + activePage={page} + /> + ); +}; diff --git a/x-pack/plugins/files/public/components/file_picker/components/search_field.tsx b/src/plugins/files/public/components/file_picker/components/search_field.tsx similarity index 75% rename from x-pack/plugins/files/public/components/file_picker/components/search_field.tsx rename to src/plugins/files/public/components/file_picker/components/search_field.tsx index 0235b03dd3fc1..e1feb83800abc 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/search_field.tsx +++ b/src/plugins/files/public/components/file_picker/components/search_field.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FunctionComponent } from 'react'; @@ -17,10 +18,11 @@ export const SearchField: FunctionComponent = () => { const query = useBehaviorSubject(state.query$); const isLoading = useBehaviorSubject(state.isLoading$); const hasFiles = useBehaviorSubject(state.hasFiles$); + const isUploading = useBehaviorSubject(state.isUploading$); return ( = ({ onClick }) => { const { state } = useFilePickerContext(); + const isUploading = useBehaviorSubject(state.isUploading$); const selectedFiles = useBehaviorSubject(state.selectedFileIds$); return ( onClick(selectedFiles)} > {selectedFiles.length > 1 diff --git a/src/plugins/files/public/components/file_picker/components/title.tsx b/src/plugins/files/public/components/file_picker/components/title.tsx new file mode 100644 index 0000000000000..98ce9b0bc93d1 --- /dev/null +++ b/src/plugins/files/public/components/file_picker/components/title.tsx @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import type { FunctionComponent } from 'react'; +import { EuiTitle } from '@elastic/eui'; +import { i18nTexts } from '../i18n_texts'; + +interface Props { + multiple: boolean; +} + +export const Title: FunctionComponent = ({ multiple }) => ( + +

{multiple ? i18nTexts.titleMultiple : i18nTexts.title}

+
+); diff --git a/src/plugins/files/public/components/file_picker/context.tsx b/src/plugins/files/public/components/file_picker/context.tsx new file mode 100644 index 0000000000000..c17fe601e487a --- /dev/null +++ b/src/plugins/files/public/components/file_picker/context.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { createContext, useContext, useMemo, useEffect } from 'react'; +import type { FunctionComponent } from 'react'; +import { useFilesContext, FilesContextValue } from '../context'; +import { FilePickerState, createFilePickerState } from './file_picker_state'; + +interface FilePickerContextValue extends FilesContextValue { + state: FilePickerState; + kind: string; +} + +const FilePickerCtx = createContext( + null as unknown as FilePickerContextValue +); + +interface FilePickerContextProps { + kind: string; + pageSize: number; + multiple: boolean; +} +export const FilePickerContext: FunctionComponent = ({ + kind, + pageSize, + multiple, + children, +}) => { + const filesContext = useFilesContext(); + const { client } = filesContext; + const state = useMemo( + () => createFilePickerState({ pageSize, client, kind, selectMultiple: multiple }), + [pageSize, client, kind, multiple] + ); + useEffect(() => state.dispose, [state]); + return ( + + {children} + + ); +}; + +export const useFilePickerContext = (): FilePickerContextValue => { + const ctx = useContext(FilePickerCtx); + if (!ctx) throw new Error('FilePickerContext not found!'); + return ctx; +}; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.scss b/src/plugins/files/public/components/file_picker/file_picker.scss similarity index 100% rename from x-pack/plugins/files/public/components/file_picker/file_picker.scss rename to src/plugins/files/public/components/file_picker/file_picker.scss diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.stories.tsx b/src/plugins/files/public/components/file_picker/file_picker.stories.tsx similarity index 84% rename from x-pack/plugins/files/public/components/file_picker/file_picker.stories.tsx rename to src/plugins/files/public/components/file_picker/file_picker.stories.tsx index 9d40b112b4060..2492c366f5d0d 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker.stories.tsx +++ b/src/plugins/files/public/components/file_picker/file_picker.stories.tsx @@ -1,13 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import { ComponentMeta, ComponentStory } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import type { FileJSON } from '../../../common'; +import type { FileJSON, FileImageMetadata } from '../../../common'; import { FilesClient, FilesClientResponses } from '../../types'; import { register } from '../stories_shared'; import { base64dLogo } from '../image/image.constants.stories'; @@ -25,6 +27,7 @@ const defaultProps: FilePickerProps = { kind, onDone: action('done!'), onClose: action('close!'), + multiple: true, }; export default { @@ -56,7 +59,7 @@ export const Empty = Template.bind({}); const d = new Date(); let id = 0; -function createFileJSON(file?: Partial): FileJSON { +function createFileJSON(file?: Partial>): FileJSON { return { alt: '', created: d.toISOString(), @@ -196,3 +199,25 @@ TryFilter.decorators = [ ); }, ]; + +export const SingleSelect = Template.bind({}); +SingleSelect.decorators = [ + (Story) => ( + `data:image/png;base64,${base64dLogo}`, + list: async (): Promise => ({ + files: [createFileJSON(), createFileJSON(), createFileJSON()], + total: 1, + }), + } as unknown as FilesClient + } + > + + + ), +]; +SingleSelect.args = { + multiple: undefined, +}; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.test.tsx b/src/plugins/files/public/components/file_picker/file_picker.test.tsx similarity index 86% rename from x-pack/plugins/files/public/components/file_picker/file_picker.test.tsx rename to src/plugins/files/public/components/file_picker/file_picker.test.tsx index 14b621050a0ef..055eea0f4d5ab 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker.test.tsx +++ b/src/plugins/files/public/components/file_picker/file_picker.test.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import { EuiButtonEmpty } from '@elastic/eui'; import { act } from 'react-dom/test-utils'; @@ -28,7 +30,7 @@ describe('FilePicker', () => { async function initTestBed(props?: Partial) { const createTestBed = registerTestBed((p: Props) => ( - + )); @@ -50,6 +52,7 @@ describe('FilePicker', () => { selectButton: `${baseTestSubj}.selectButton`, loadingSpinner: `${baseTestSubj}.loadingSpinner`, fileGrid: `${baseTestSubj}.fileGrid`, + paginationControls: `${baseTestSubj}.paginationControls`, }; return { @@ -126,4 +129,10 @@ describe('FilePicker', () => { expect(onDone).toHaveBeenCalledTimes(1); expect(onDone).toHaveBeenNthCalledWith(1, ['a', 'b']); }); + it('hides pagination if there are no files', async () => { + client.list.mockImplementation(() => Promise.resolve({ files: [] as FileJSON[], total: 2 })); + const { actions, testSubjects, exists } = await initTestBed(); + await actions.waitUntilLoaded(); + expect(exists(testSubjects.paginationControls)).toBe(false); + }); }); diff --git a/src/plugins/files/public/components/file_picker/file_picker.tsx b/src/plugins/files/public/components/file_picker/file_picker.tsx new file mode 100644 index 0000000000000..94616a67a85cb --- /dev/null +++ b/src/plugins/files/public/components/file_picker/file_picker.tsx @@ -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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import type { FunctionComponent } from 'react'; +import useObservable from 'react-use/lib/useObservable'; +import { + EuiModal, + EuiModalBody, + EuiModalHeader, + EuiLoadingSpinner, + EuiSpacer, + EuiFlexGroup, +} from '@elastic/eui'; + +import type { DoneNotification } from '../upload_file'; +import { useBehaviorSubject } from '../use_behavior_subject'; +import { useFilePickerContext, FilePickerContext } from './context'; + +import { Title } from './components/title'; +import { ErrorContent } from './components/error_content'; +import { EmptyPrompt } from './components/empty_prompt'; +import { FileGrid } from './components/file_grid'; +import { SearchField } from './components/search_field'; +import { ModalFooter } from './components/modal_footer'; + +import './file_picker.scss'; +import { ClearFilterButton } from './components/clear_filter_button'; + +export interface Props { + /** + * The file kind that was passed to the registry. + */ + kind: Kind; + /** + * Will be called when the modal is closed + */ + onClose: () => void; + /** + * Will be called after a user has a selected a set of files + */ + onDone: (fileIds: string[]) => void; + /** + * When a user has succesfully uploaded some files this callback will be called + */ + onUpload?: (done: DoneNotification[]) => void; + /** + * The number of results to show per page. + */ + pageSize?: number; + /** + * Whether you can select one or more files + * + * @default false + */ + multiple?: boolean; +} + +type InnerProps = Required>; + +const Component: FunctionComponent = ({ onClose, onDone, onUpload, multiple }) => { + const { state, kind } = useFilePickerContext(); + + const hasFiles = useBehaviorSubject(state.hasFiles$); + const hasQuery = useBehaviorSubject(state.hasQuery$); + const isLoading = useBehaviorSubject(state.isLoading$); + const error = useBehaviorSubject(state.loadingError$); + + useObservable(state.files$); + + const renderFooter = () => ( + + ); + + return ( + + + + <SearchField /> + </EuiModalHeader> + {isLoading ? ( + <> + <EuiModalBody> + <EuiFlexGroup justifyContent="center" alignItems="center" gutterSize="none"> + <EuiLoadingSpinner data-test-subj="loadingSpinner" size="xl" /> + </EuiFlexGroup> + </EuiModalBody> + {renderFooter()} + </> + ) : Boolean(error) ? ( + <EuiModalBody> + <ErrorContent error={error as Error} /> + </EuiModalBody> + ) : !hasFiles && !hasQuery ? ( + <EuiModalBody> + <EmptyPrompt multiple={multiple} kind={kind} /> + </EuiModalBody> + ) : ( + <> + <EuiModalBody> + <FileGrid /> + <EuiSpacer /> + <ClearFilterButton onClick={() => state.setQuery(undefined)} /> + </EuiModalBody> + {renderFooter()} + </> + )} + </EuiModal> + ); +}; + +export const FilePicker: FunctionComponent<Props> = ({ + pageSize = 20, + kind, + multiple = false, + onUpload = () => {}, + ...rest +}) => ( + <FilePickerContext pageSize={pageSize} kind={kind} multiple={multiple}> + <Component {...rest} {...{ pageSize, kind, multiple, onUpload }} /> + </FilePickerContext> +); + +/* eslint-disable import/no-default-export */ +export default FilePicker; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker_state.test.ts b/src/plugins/files/public/components/file_picker/file_picker_state.test.ts similarity index 81% rename from x-pack/plugins/files/public/components/file_picker/file_picker_state.test.ts rename to src/plugins/files/public/components/file_picker/file_picker_state.test.ts index 79eb5cbfa529d..62881fa042a84 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker_state.test.ts +++ b/src/plugins/files/public/components/file_picker/file_picker_state.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ jest.mock('rxjs', () => { @@ -31,6 +32,7 @@ describe('FilePickerState', () => { client: filesClient, pageSize: 20, kind: 'test', + selectMultiple: true, }); }); it('starts off empty', () => { @@ -168,4 +170,32 @@ describe('FilePickerState', () => { expectObservable(filePickerState.loadingError$).toBe('a-b---c-', {}); }); }); + it('does not allow fetching files while an upload is in progress', () => { + getTestScheduler().run(({ expectObservable, cold }) => { + const files = [] as FileJSON[]; + filesClient.list.mockImplementation(() => of({ files }) as any); + const uploadInput = '---a|'; + const queryInput = ' -----a|'; + const upload$ = cold(uploadInput).pipe(tap(() => filePickerState.setIsUploading(true))); + const query$ = cold(queryInput).pipe(tap((q) => filePickerState.setQuery(q))); + expectObservable(merge(upload$, query$)).toBe('---a-a|'); + expectObservable(filePickerState.files$).toBe('a------', { a: [] }); + }); + }); + describe('single selection', () => { + beforeEach(() => { + filePickerState = createFilePickerState({ + client: filesClient, + pageSize: 20, + kind: 'test', + selectMultiple: false, + }); + }); + it('allows only one file to be selected', () => { + filePickerState.selectFile('a'); + expect(filePickerState.getSelectedFileIds()).toEqual(['a']); + filePickerState.selectFile(['b', 'a', 'c']); + expect(filePickerState.getSelectedFileIds()).toEqual(['b']); + }); + }); }); diff --git a/src/plugins/files/public/components/file_picker/file_picker_state.ts b/src/plugins/files/public/components/file_picker/file_picker_state.ts new file mode 100644 index 0000000000000..a47268585a420 --- /dev/null +++ b/src/plugins/files/public/components/file_picker/file_picker_state.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + map, + tap, + from, + EMPTY, + switchMap, + catchError, + Observable, + shareReplay, + debounceTime, + Subscription, + combineLatest, + BehaviorSubject, + distinctUntilChanged, +} from 'rxjs'; +import type { FileJSON } from '../../../common'; +import type { FilesClient } from '../../types'; + +function naivelyFuzzify(query: string): string { + return query.includes('*') ? query : `*${query}*`; +} + +export class FilePickerState { + /** + * Files the user has selected + */ + public readonly selectedFileIds$ = new BehaviorSubject<string[]>([]); + + public readonly isLoading$ = new BehaviorSubject<boolean>(true); + public readonly loadingError$ = new BehaviorSubject<undefined | Error>(undefined); + public readonly hasFiles$ = new BehaviorSubject<boolean>(false); + public readonly hasQuery$ = new BehaviorSubject<boolean>(false); + public readonly query$ = new BehaviorSubject<undefined | string>(undefined); + public readonly queryDebounced$ = this.query$.pipe(debounceTime(100)); + public readonly currentPage$ = new BehaviorSubject<number>(0); + public readonly totalPages$ = new BehaviorSubject<undefined | number>(undefined); + public readonly isUploading$ = new BehaviorSubject<boolean>(false); + + /** + * This is how we keep a deduplicated list of file ids representing files a user + * has selected + */ + private readonly fileSet = new Set<string>(); + private readonly retry$ = new BehaviorSubject<void>(undefined); + private readonly subscriptions: Subscription[] = []; + private readonly internalIsLoading$ = new BehaviorSubject<boolean>(true); + + constructor( + private readonly client: FilesClient, + private readonly kind: string, + public readonly pageSize: number, + private selectMultiple: boolean + ) { + this.subscriptions = [ + this.query$ + .pipe( + map((query) => Boolean(query)), + distinctUntilChanged() + ) + .subscribe(this.hasQuery$), + this.internalIsLoading$.pipe(distinctUntilChanged()).subscribe(this.isLoading$), + ]; + } + + private readonly requests$ = combineLatest([ + this.currentPage$.pipe(distinctUntilChanged()), + this.query$.pipe(distinctUntilChanged()), + this.retry$, + ]).pipe( + tap(() => this.setIsLoading(true)), // set loading state as early as possible + debounceTime(100) + ); + + /** + * File objects we have loaded on the front end, stored here so that it can + * easily be passed to all relevant UI. + * + * @note This is not explicitly kept in sync with the selected files! + * @note This is not explicitly kept in sync with the selected files! + */ + public readonly files$ = this.requests$.pipe( + switchMap(([page, query]) => this.sendRequest(page, query)), + tap(({ total }) => this.updateTotalPages({ total })), + tap(({ total }) => this.hasFiles$.next(Boolean(total))), + map(({ files }) => files), + shareReplay() + ); + + private updateTotalPages = ({ total }: { total: number }): void => { + this.totalPages$.next(Math.ceil(total / this.pageSize)); + }; + + private sendNextSelectedFiles() { + this.selectedFileIds$.next(this.getSelectedFileIds()); + } + + private setIsLoading(value: boolean) { + this.internalIsLoading$.next(value); + } + + /** + * If multiple selection is not configured, this will take the first file id + * if an array of file ids was provided. + */ + public selectFile = (fileId: string | string[]): void => { + const fileIds = Array.isArray(fileId) ? fileId : [fileId]; + if (!this.selectMultiple) { + this.fileSet.clear(); + this.fileSet.add(fileIds[0]); + } else { + for (const id of fileIds) this.fileSet.add(id); + } + this.sendNextSelectedFiles(); + }; + + private abort: undefined | (() => void) = undefined; + private sendRequest = ( + page: number, + query: undefined | string + ): Observable<{ files: FileJSON[]; total: number }> => { + if (this.isUploading$.getValue()) return EMPTY; + if (this.abort) this.abort(); + this.setIsLoading(true); + this.loadingError$.next(undefined); + + const abortController = new AbortController(); + this.abort = () => { + try { + abortController.abort(); + } catch (e) { + // ignore + } + }; + + const request$ = from( + this.client.list({ + kind: this.kind, + name: query ? [naivelyFuzzify(query)] : undefined, + page: page + 1, + status: ['READY'], + perPage: this.pageSize, + abortSignal: abortController.signal, + }) + ).pipe( + catchError((e) => { + if (e.name !== 'AbortError') { + this.setIsLoading(false); + this.loadingError$.next(e); + } else { + // If the request was aborted, we assume another request is now in progress + } + return EMPTY; + }), + tap(() => { + this.setIsLoading(false); + this.abort = undefined; + }), + shareReplay() + ); + + request$.subscribe(); + + return request$; + }; + + public retry = (): void => { + this.retry$.next(); + }; + + public resetFilters = (): void => { + this.setQuery(undefined); + this.setPage(0); + this.retry(); + }; + + public hasFilesSelected = (): boolean => { + return this.fileSet.size > 0; + }; + + public unselectFile = (fileId: string): void => { + if (this.fileSet.delete(fileId)) this.sendNextSelectedFiles(); + }; + + public isFileIdSelected = (fileId: string): boolean => { + return this.fileSet.has(fileId); + }; + + public getSelectedFileIds = (): string[] => { + return Array.from(this.fileSet); + }; + + public setQuery = (query: undefined | string): void => { + if (query) this.query$.next(query); + else this.query$.next(undefined); + this.currentPage$.next(0); + }; + + public setPage = (page: number): void => { + this.currentPage$.next(page); + }; + + public setIsUploading = (value: boolean): void => { + this.isUploading$.next(value); + }; + + public dispose = (): void => { + for (const sub of this.subscriptions) sub.unsubscribe(); + }; + + watchFileSelected$ = (id: string): Observable<boolean> => { + return this.selectedFileIds$.pipe( + map(() => this.fileSet.has(id)), + distinctUntilChanged() + ); + }; +} + +interface CreateFilePickerArgs { + client: FilesClient; + kind: string; + pageSize: number; + selectMultiple: boolean; +} +export const createFilePickerState = ({ + pageSize, + client, + kind, + selectMultiple, +}: CreateFilePickerArgs): FilePickerState => { + return new FilePickerState(client, kind, pageSize, selectMultiple); +}; diff --git a/src/plugins/files/public/components/file_picker/i18n_texts.ts b/src/plugins/files/public/components/file_picker/i18n_texts.ts new file mode 100644 index 0000000000000..9bc4b4642cd68 --- /dev/null +++ b/src/plugins/files/public/components/file_picker/i18n_texts.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; + +export const i18nTexts = { + title: i18n.translate('files.filePicker.title', { + defaultMessage: 'Select a file', + }), + titleMultiple: i18n.translate('files.filePicker.titleMultiple', { + defaultMessage: 'Select files', + }), + loadingFilesErrorTitle: i18n.translate('files.filePicker.error.loadingTitle', { + defaultMessage: 'Could not load files', + }), + retryButtonLabel: i18n.translate('files.filePicker.error.retryButtonLabel', { + defaultMessage: 'Retry', + }), + emptyStatePrompt: i18n.translate('files.filePicker.emptyStatePromptTitle', { + defaultMessage: 'Upload your first file', + }), + selectFileLabel: i18n.translate('files.filePicker.selectFileButtonLable', { + defaultMessage: 'Select file', + }), + selectFilesLabel: (nrOfFiles: number) => + i18n.translate('files.filePicker.selectFilesButtonLable', { + defaultMessage: 'Select {nrOfFiles} files', + values: { nrOfFiles }, + }), + searchFieldPlaceholder: i18n.translate('files.filePicker.searchFieldPlaceholder', { + defaultMessage: 'my-file-*', + }), + emptyFileGridPrompt: i18n.translate('files.filePicker.emptyGridPrompt', { + defaultMessage: 'No files match your filter', + }), + loadMoreButtonLabel: i18n.translate('files.filePicker.loadMoreButtonLabel', { + defaultMessage: 'Load more', + }), + clearFilterButton: i18n.translate('files.filePicker.clearFilterButtonLabel', { + defaultMessage: 'Clear filter', + }), + uploadFilePlaceholderText: i18n.translate('files.filePicker.uploadFilePlaceholderText', { + defaultMessage: 'Drag and drop to upload new files', + }), +}; diff --git a/src/plugins/files/public/components/file_picker/index.tsx b/src/plugins/files/public/components/file_picker/index.tsx new file mode 100644 index 0000000000000..9ec6b9f778035 --- /dev/null +++ b/src/plugins/files/public/components/file_picker/index.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { lazy, Suspense } from 'react'; +import { EuiLoadingSpinner } from '@elastic/eui'; +import type { Props } from './file_picker'; + +export type { Props as FilePickerProps }; + +const FilePickerContainer = lazy(() => import('./file_picker')); + +export const FilePicker = (props: Props) => ( + <Suspense fallback={<EuiLoadingSpinner size="xl" />}> + <FilePickerContainer {...props} /> + </Suspense> +); diff --git a/x-pack/plugins/files/public/components/image/components/blurhash.tsx b/src/plugins/files/public/components/image/components/blurhash.tsx similarity index 89% rename from x-pack/plugins/files/public/components/image/components/blurhash.tsx rename to src/plugins/files/public/components/image/components/blurhash.tsx index 62dfb8b1f075d..7a931e91ddaea 100644 --- a/x-pack/plugins/files/public/components/image/components/blurhash.tsx +++ b/src/plugins/files/public/components/image/components/blurhash.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { decode } from 'blurhash'; import React, { useRef, useEffect } from 'react'; import type { FunctionComponent } from 'react'; diff --git a/src/plugins/files/public/components/image/components/img.tsx b/src/plugins/files/public/components/image/components/img.tsx new file mode 100644 index 0000000000000..855d4547058a5 --- /dev/null +++ b/src/plugins/files/public/components/image/components/img.tsx @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import type { ImgHTMLAttributes, MutableRefObject } from 'react'; +import type { EuiImageSize } from '@elastic/eui/src/components/image/image_types'; +import { useEuiTheme } from '@elastic/eui'; +import { css } from '@emotion/react'; +import { sizes } from '../styles'; + +export interface Props extends ImgHTMLAttributes<HTMLImageElement> { + size?: EuiImageSize; + hidden: boolean; + observerRef: (el: null | HTMLImageElement) => void; +} + +export const Img = React.forwardRef<HTMLImageElement, Props>( + ({ observerRef, src, size, hidden, ...rest }, ref) => { + const { euiTheme } = useEuiTheme(); + const styles = [ + css` + transition: opacity ${euiTheme.animation.extraFast}; + `, + hidden + ? css` + visibility: hidden; + ` + : undefined, + !src + ? css` + position: absolute; // ensure that empty img tag occupies full container + top: 0; + right: 0; + bottom: 0; + left: 0; + ` + : undefined, + size ? sizes[size] : undefined, + ]; + return ( + <img + alt="" + css={styles} + {...rest} + src={src} + ref={(element) => { + observerRef(element); + if (ref) { + if (typeof ref === 'function') ref(element); + else (ref as MutableRefObject<HTMLImageElement | null>).current = element; + } + }} + /> + ); + } +); diff --git a/src/plugins/files/public/components/image/components/index.ts b/src/plugins/files/public/components/image/components/index.ts new file mode 100644 index 0000000000000..bae3c92eab517 --- /dev/null +++ b/src/plugins/files/public/components/image/components/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { Img } from './img'; +export type { Props as ImgProps } from './img'; +export { Blurhash } from './blurhash'; diff --git a/x-pack/plugins/files/public/components/image/image.constants.stories.tsx b/src/plugins/files/public/components/image/image.constants.stories.tsx similarity index 97% rename from x-pack/plugins/files/public/components/image/image.constants.stories.tsx rename to src/plugins/files/public/components/image/image.constants.stories.tsx index cc5ff23cd2810..b9b3a5c3831cb 100644 --- a/x-pack/plugins/files/public/components/image/image.constants.stories.tsx +++ b/src/plugins/files/public/components/image/image.constants.stories.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export function getImageData(): Blob { diff --git a/x-pack/plugins/files/public/components/image/image.stories.tsx b/src/plugins/files/public/components/image/image.stories.tsx similarity index 92% rename from x-pack/plugins/files/public/components/image/image.stories.tsx rename to src/plugins/files/public/components/image/image.stories.tsx index ff8825485f9cb..d26a74470bdca 100644 --- a/x-pack/plugins/files/public/components/image/image.stories.tsx +++ b/src/plugins/files/public/components/image/image.stories.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import { ComponentStory, ComponentMeta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/x-pack/plugins/files/public/components/image/image.tsx b/src/plugins/files/public/components/image/image.tsx similarity index 78% rename from x-pack/plugins/files/public/components/image/image.tsx rename to src/plugins/files/public/components/image/image.tsx index b83739d180c94..e2cb78d910e3d 100644 --- a/x-pack/plugins/files/public/components/image/image.tsx +++ b/src/plugins/files/public/components/image/image.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React, { HTMLAttributes } from 'react'; import { type ImgHTMLAttributes, useState, useEffect } from 'react'; import { css } from '@emotion/react'; @@ -32,15 +34,6 @@ export interface Props extends ImgHTMLAttributes<HTMLImageElement> { * Emits when the image first becomes visible */ onFirstVisible?: () => void; - - /** - * As an optimisation images are only loaded when they are visible. - * This setting overrides this behavior and loads an image as soon as the - * component mounts. - * - * @default true - */ - lazy?: boolean; } /** @@ -55,33 +48,18 @@ export interface Props extends ImgHTMLAttributes<HTMLImageElement> { */ export const Image = React.forwardRef<HTMLImageElement, Props>( ( - { - src, - alt, - onFirstVisible, - onLoad, - onError, - meta, - wrapperProps, - size = 'original', - lazy = true, - ...rest - }, + { src, alt, onFirstVisible, onLoad, onError, meta, wrapperProps, size = 'original', ...rest }, ref ) => { const [isLoaded, setIsLoaded] = useState<boolean>(false); const [blurDelayExpired, setBlurDelayExpired] = useState(false); const { isVisible, ref: observerRef } = useViewportObserver({ onFirstVisible }); - const loadImage = lazy ? isVisible : true; - useEffect(() => { - let unmounted = false; const id = window.setTimeout(() => { - if (!unmounted) setBlurDelayExpired(true); + setBlurDelayExpired(true); }, 200); return () => { - unmounted = true; window.clearTimeout(id); }; }, []); @@ -112,9 +90,9 @@ export const Image = React.forwardRef<HTMLImageElement, Props>( observerRef={observerRef} ref={ref} size={size} - hidden={!loadImage} - src={loadImage ? src : undefined} + src={isVisible ? src : undefined} alt={alt} + hidden={!isLoaded} onLoad={(ev) => { setIsLoaded(true); onLoad?.(ev); diff --git a/src/plugins/files/public/components/image/index.ts b/src/plugins/files/public/components/image/index.ts new file mode 100644 index 0000000000000..2e7825acc1260 --- /dev/null +++ b/src/plugins/files/public/components/image/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { Image } from './image'; +export type { Props as ImageProps } from './image'; diff --git a/src/plugins/files/public/components/image/styles.ts b/src/plugins/files/public/components/image/styles.ts new file mode 100644 index 0000000000000..d69580bcb51a5 --- /dev/null +++ b/src/plugins/files/public/components/image/styles.ts @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { css } from '@emotion/react'; + +// Values taken from @elastic/eui/src/components/image +export const sizes = { + s: css` + width: 100px; + `, + m: css` + width: 200px; + `, + l: css` + width: 360px; + `, + xl: css` + width: 600px; + `, + original: css` + width: auto; + `, + fullWidth: css` + width: 100%; + `, +}; diff --git a/x-pack/plugins/files/public/components/image/use_viewport_observer.ts b/src/plugins/files/public/components/image/use_viewport_observer.ts similarity index 85% rename from x-pack/plugins/files/public/components/image/use_viewport_observer.ts rename to src/plugins/files/public/components/image/use_viewport_observer.ts index c1951b4448de8..6e43cc9d124f6 100644 --- a/x-pack/plugins/files/public/components/image/use_viewport_observer.ts +++ b/src/plugins/files/public/components/image/use_viewport_observer.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { useCallback, useEffect, useRef, useState } from 'react'; diff --git a/x-pack/plugins/files/public/components/image/viewport_observer.test.ts b/src/plugins/files/public/components/image/viewport_observer.test.ts similarity index 92% rename from x-pack/plugins/files/public/components/image/viewport_observer.test.ts rename to src/plugins/files/public/components/image/viewport_observer.test.ts index 5e5ebd3d42029..f5dafb25fc724 100644 --- a/x-pack/plugins/files/public/components/image/viewport_observer.test.ts +++ b/src/plugins/files/public/components/image/viewport_observer.test.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { TestScheduler } from 'rxjs/testing'; import { ViewportObserver } from './viewport_observer'; diff --git a/x-pack/plugins/files/public/components/image/viewport_observer.ts b/src/plugins/files/public/components/image/viewport_observer.ts similarity index 89% rename from x-pack/plugins/files/public/components/image/viewport_observer.ts rename to src/plugins/files/public/components/image/viewport_observer.ts index c0efe3d095594..165af5aecb98c 100644 --- a/x-pack/plugins/files/public/components/image/viewport_observer.ts +++ b/src/plugins/files/public/components/image/viewport_observer.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { once } from 'lodash'; import { Observable, ReplaySubject } from 'rxjs'; import { take } from 'rxjs/operators'; diff --git a/src/plugins/files/public/components/index.ts b/src/plugins/files/public/components/index.ts new file mode 100644 index 0000000000000..e4470d4a58be7 --- /dev/null +++ b/src/plugins/files/public/components/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { Image, type ImageProps } from './image'; +export { UploadFile, type UploadFileProps } from './upload_file'; +export { FilePicker, type FilePickerProps } from './file_picker'; +export { FilesContext } from './context'; diff --git a/x-pack/plugins/files/public/components/stories_shared.ts b/src/plugins/files/public/components/stories_shared.ts similarity index 77% rename from x-pack/plugins/files/public/components/stories_shared.ts rename to src/plugins/files/public/components/stories_shared.ts index a82ec3295b1d0..f20058ea0f58e 100644 --- a/x-pack/plugins/files/public/components/stories_shared.ts +++ b/src/plugins/files/public/components/stories_shared.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { FileKind } from '../../common'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/cancel_button.tsx b/src/plugins/files/public/components/upload_file/components/cancel_button.tsx similarity index 86% rename from x-pack/plugins/files/public/components/upload_file/components/cancel_button.tsx rename to src/plugins/files/public/components/upload_file/components/cancel_button.tsx index b71a6221f3b2d..4bf6aead09120 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/cancel_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/cancel_button.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiButton, EuiButtonIcon } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/clear_button.tsx b/src/plugins/files/public/components/upload_file/components/clear_button.tsx similarity index 76% rename from x-pack/plugins/files/public/components/upload_file/components/clear_button.tsx rename to src/plugins/files/public/components/upload_file/components/clear_button.tsx index 929fe0dcc65b0..09733a9c58769 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/clear_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/clear_button.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiButtonEmpty } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/control_button.tsx b/src/plugins/files/public/components/upload_file/components/control_button.tsx similarity index 86% rename from x-pack/plugins/files/public/components/upload_file/components/control_button.tsx rename to src/plugins/files/public/components/upload_file/components/control_button.tsx index 351cf2c39edd1..c52d72545e04e 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/control_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/control_button.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FunctionComponent } from 'react'; diff --git a/src/plugins/files/public/components/upload_file/components/index.ts b/src/plugins/files/public/components/upload_file/components/index.ts new file mode 100644 index 0000000000000..427af9af2cc48 --- /dev/null +++ b/src/plugins/files/public/components/upload_file/components/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { ControlButton } from './control_button'; +export { ClearButton } from './clear_button'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/retry_button.tsx b/src/plugins/files/public/components/upload_file/components/retry_button.tsx similarity index 81% rename from x-pack/plugins/files/public/components/upload_file/components/retry_button.tsx rename to src/plugins/files/public/components/upload_file/components/retry_button.tsx index 355495aa25c17..273515331b3c9 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/retry_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/retry_button.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { EuiButton } from '@elastic/eui'; import type { FunctionComponent } from 'react'; import React from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/upload_button.tsx b/src/plugins/files/public/components/upload_file/components/upload_button.tsx similarity index 87% rename from x-pack/plugins/files/public/components/upload_file/components/upload_button.tsx rename to src/plugins/files/public/components/upload_file/components/upload_button.tsx index ff6320ab0b95a..2bd024ad2e1ad 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/upload_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/upload_button.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiButton } from '@elastic/eui'; diff --git a/src/plugins/files/public/components/upload_file/context.ts b/src/plugins/files/public/components/upload_file/context.ts new file mode 100644 index 0000000000000..187639cb3dda0 --- /dev/null +++ b/src/plugins/files/public/components/upload_file/context.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import type { UploadState } from './upload_state'; + +export const context = React.createContext<UploadState | null>(null); +export const useUploadState = () => React.useContext(context)!; diff --git a/src/plugins/files/public/components/upload_file/i18n_texts.ts b/src/plugins/files/public/components/upload_file/i18n_texts.ts new file mode 100644 index 0000000000000..19ac5b3e0a67d --- /dev/null +++ b/src/plugins/files/public/components/upload_file/i18n_texts.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; + +export const i18nTexts = { + defaultPickerLabel: i18n.translate('files.uploadFile.defaultFilePickerLabel', { + defaultMessage: 'Upload a file', + }), + upload: i18n.translate('files.uploadFile.uploadButtonLabel', { + defaultMessage: 'Upload', + }), + uploading: i18n.translate('files.uploadFile.uploadingButtonLabel', { + defaultMessage: 'Uploading', + }), + uploadComplete: i18n.translate('files.uploadFile.uploadCompleteButtonLabel', { + defaultMessage: 'Upload complete', + }), + retry: i18n.translate('files.uploadFile.retryButtonLabel', { + defaultMessage: 'Retry', + }), + clear: i18n.translate('files.uploadFile.clearButtonLabel', { + defaultMessage: 'Clear', + }), + cancel: i18n.translate('files.uploadFile.cancelButtonLabel', { + defaultMessage: 'Cancel', + }), + uploadDone: i18n.translate('files.uploadFile.uploadDoneToolTipContent', { + defaultMessage: 'Your file was successfully uploaded!', + }), + fileTooLarge: (expectedSize: string) => + i18n.translate('files.uploadFile.fileTooLargeErrorMessage', { + defaultMessage: + 'File is too large. Maximum size is {expectedSize, plural, one {# byte} other {# bytes} }.', + values: { expectedSize }, + }), +}; diff --git a/src/plugins/files/public/components/upload_file/index.tsx b/src/plugins/files/public/components/upload_file/index.tsx new file mode 100644 index 0000000000000..83aae0a111b43 --- /dev/null +++ b/src/plugins/files/public/components/upload_file/index.tsx @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { lazy, Suspense } from 'react'; +import { EuiLoadingSpinner } from '@elastic/eui'; +import type { Props } from './upload_file'; + +export type { DoneNotification } from './upload_state'; +export type { Props as UploadFileProps }; + +const UploadFileContainer = lazy(() => import('./upload_file')); + +export const UploadFile = (props: Props) => ( + <Suspense fallback={<EuiLoadingSpinner size="xl" />}> + <UploadFileContainer {...props} /> + </Suspense> +); diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.component.tsx b/src/plugins/files/public/components/upload_file/upload_file.component.tsx similarity index 95% rename from x-pack/plugins/files/public/components/upload_file/upload_file.component.tsx rename to src/plugins/files/public/components/upload_file/upload_file.component.tsx index 8c81ae3fdcb21..92e3cb85cb398 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.component.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.component.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.stories.tsx b/src/plugins/files/public/components/upload_file/upload_file.stories.tsx similarity index 95% rename from x-pack/plugins/files/public/components/upload_file/upload_file.stories.tsx rename to src/plugins/files/public/components/upload_file/upload_file.stories.tsx index 635400223fc17..2a07b8b8f5db5 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.stories.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.stories.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import { ComponentMeta, ComponentStory } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.test.tsx b/src/plugins/files/public/components/upload_file/upload_file.test.tsx similarity index 97% rename from x-pack/plugins/files/public/components/upload_file/upload_file.test.tsx rename to src/plugins/files/public/components/upload_file/upload_file.test.tsx index 7682b085eb060..a8230094ccd78 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.test.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.test.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.tsx b/src/plugins/files/public/components/upload_file/upload_file.tsx similarity index 87% rename from x-pack/plugins/files/public/components/upload_file/upload_file.tsx rename to src/plugins/files/public/components/upload_file/upload_file.tsx index d0ca3577b27a0..0d468c2991150 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiFilePicker } from '@elastic/eui'; @@ -76,6 +77,16 @@ export interface Props<Kind extends string = string> { */ onError?: (e: Error) => void; + /** + * Will be called whenever an upload starts + */ + onUploadStart?: () => void; + + /** + * Will be called when attempt ends, in error otherwise + */ + onUploadEnd?: () => void; + /** * Whether to display the component in it's compact form. * @@ -105,6 +116,8 @@ export const UploadFile = <Kind extends string = string>({ onError, fullWidth, allowClear, + onUploadEnd, + onUploadStart, compressed = false, kind: kindId, multiple = false, @@ -136,9 +149,12 @@ export const UploadFile = <Kind extends string = string>({ }), uploadState.done$.subscribe((n) => n && onDone(n)), uploadState.error$.subscribe((e) => e && onError?.(e)), + uploadState.uploading$.subscribe((uploading) => + uploading ? onUploadStart?.() : onUploadEnd?.() + ), ]; return () => subs.forEach((sub) => sub.unsubscribe()); - }, [uploadState, onDone, onError]); + }, [uploadState, onDone, onError, onUploadStart, onUploadEnd]); useEffect(() => uploadState.dispose, [uploadState]); diff --git a/x-pack/plugins/files/public/components/upload_file/upload_state.test.ts b/src/plugins/files/public/components/upload_file/upload_state.test.ts similarity index 97% rename from x-pack/plugins/files/public/components/upload_file/upload_state.test.ts rename to src/plugins/files/public/components/upload_file/upload_state.test.ts index a834103a2c9cb..7a73009c35c49 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_state.test.ts +++ b/src/plugins/files/public/components/upload_file/upload_state.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { DeeplyMockedKeys } from '@kbn/utility-types-jest'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_state.ts b/src/plugins/files/public/components/upload_file/upload_state.ts similarity index 96% rename from x-pack/plugins/files/public/components/upload_file/upload_state.ts rename to src/plugins/files/public/components/upload_file/upload_state.ts index 13c4cc020b05a..d9331c18868ac 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_state.ts +++ b/src/plugins/files/public/components/upload_file/upload_state.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { @@ -43,7 +44,7 @@ interface FileState { type Upload = SimpleStateSubject<FileState>; -interface DoneNotification { +export interface DoneNotification { id: string; kind: string; } diff --git a/src/plugins/files/public/components/upload_file/util/index.ts b/src/plugins/files/public/components/upload_file/util/index.ts new file mode 100644 index 0000000000000..18bdee6fcffe0 --- /dev/null +++ b/src/plugins/files/public/components/upload_file/util/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { SimpleStateSubject, createStateSubject } from './simple_state_subject'; + +export { parseFileName } from './parse_file_name'; diff --git a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.test.ts b/src/plugins/files/public/components/upload_file/util/parse_file_name.test.ts similarity index 82% rename from x-pack/plugins/files/public/components/upload_file/util/parse_file_name.test.ts rename to src/plugins/files/public/components/upload_file/util/parse_file_name.test.ts index bfe27b50a9f43..76d342a70cf7e 100644 --- a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.test.ts +++ b/src/plugins/files/public/components/upload_file/util/parse_file_name.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { parseFileName } from './parse_file_name'; diff --git a/src/plugins/files/public/components/upload_file/util/parse_file_name.ts b/src/plugins/files/public/components/upload_file/util/parse_file_name.ts new file mode 100644 index 0000000000000..aaa7b9a759f7b --- /dev/null +++ b/src/plugins/files/public/components/upload_file/util/parse_file_name.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +interface Result { + name: string; +} + +export function parseFileName(fileName: string): Result { + const withoutExt = fileName.substring(0, fileName.lastIndexOf('.')) || fileName; + return { + name: withoutExt + .trim() + .slice(0, 256) + .replace(/[^a-z0-9\s]/gi, '_'), // replace invalid chars + }; +} diff --git a/x-pack/plugins/files/public/components/upload_file/util/simple_state_subject.ts b/src/plugins/files/public/components/upload_file/util/simple_state_subject.ts similarity index 78% rename from x-pack/plugins/files/public/components/upload_file/util/simple_state_subject.ts rename to src/plugins/files/public/components/upload_file/util/simple_state_subject.ts index a55259b4962ed..b5cc19a9ea3ee 100644 --- a/x-pack/plugins/files/public/components/upload_file/util/simple_state_subject.ts +++ b/src/plugins/files/public/components/upload_file/util/simple_state_subject.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { merge } from 'lodash'; diff --git a/src/plugins/files/public/components/use_behavior_subject.ts b/src/plugins/files/public/components/use_behavior_subject.ts new file mode 100644 index 0000000000000..441a14667df18 --- /dev/null +++ b/src/plugins/files/public/components/use_behavior_subject.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { BehaviorSubject } from 'rxjs'; +import useObservable from 'react-use/lib/useObservable'; + +export function useBehaviorSubject<T>(o$: BehaviorSubject<T>) { + return useObservable(o$, o$.getValue()); +} diff --git a/x-pack/plugins/files/public/components/util/image_metadata.test.ts b/src/plugins/files/public/components/util/image_metadata.test.ts similarity index 86% rename from x-pack/plugins/files/public/components/util/image_metadata.test.ts rename to src/plugins/files/public/components/util/image_metadata.test.ts index 16980aee00296..de4cba5c82dc9 100644 --- a/x-pack/plugins/files/public/components/util/image_metadata.test.ts +++ b/src/plugins/files/public/components/util/image_metadata.test.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { fitToBox } from './image_metadata'; describe('util', () => { describe('fitToBox', () => { diff --git a/x-pack/plugins/files/public/components/util/image_metadata.ts b/src/plugins/files/public/components/util/image_metadata.ts similarity index 92% rename from x-pack/plugins/files/public/components/util/image_metadata.ts rename to src/plugins/files/public/components/util/image_metadata.ts index 9c6e74f4c0101..75a42efed585c 100644 --- a/x-pack/plugins/files/public/components/util/image_metadata.ts +++ b/src/plugins/files/public/components/util/image_metadata.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import * as bh from 'blurhash'; diff --git a/src/plugins/files/public/components/util/index.ts b/src/plugins/files/public/components/util/index.ts new file mode 100644 index 0000000000000..5c25ffd636a5c --- /dev/null +++ b/src/plugins/files/public/components/util/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { getImageMetadata, isImage, fitToBox } from './image_metadata'; +export type { ImageMetadataFactory } from './image_metadata'; diff --git a/x-pack/plugins/files/public/files_client/files_client.test.ts b/src/plugins/files/public/files_client/files_client.test.ts similarity index 89% rename from x-pack/plugins/files/public/files_client/files_client.test.ts rename to src/plugins/files/public/files_client/files_client.test.ts index 63bed16c07ead..caef61d231110 100644 --- a/x-pack/plugins/files/public/files_client/files_client.test.ts +++ b/src/plugins/files/public/files_client/files_client.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { apiRoutes } from './files_client'; diff --git a/x-pack/plugins/files/public/files_client/files_client.ts b/src/plugins/files/public/files_client/files_client.ts similarity index 96% rename from x-pack/plugins/files/public/files_client/files_client.ts rename to src/plugins/files/public/files_client/files_client.ts index f92b2c91d2796..86a2c1c92957c 100644 --- a/x-pack/plugins/files/public/files_client/files_client.ts +++ b/src/plugins/files/public/files_client/files_client.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { HttpStart } from '@kbn/core/public'; diff --git a/src/plugins/files/public/files_client/index.ts b/src/plugins/files/public/files_client/index.ts new file mode 100644 index 0000000000000..cc493c053e61d --- /dev/null +++ b/src/plugins/files/public/files_client/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { createFilesClient } from './files_client'; diff --git a/src/plugins/files/public/index.ts b/src/plugins/files/public/index.ts new file mode 100644 index 0000000000000..5822efb655735 --- /dev/null +++ b/src/plugins/files/public/index.ts @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FilesPlugin } from './plugin'; +export type { FilesSetup, FilesStart } from './plugin'; +export type { + FilesClient, + ScopedFilesClient, + FilesClientFactory, + FilesClientResponses, +} from './types'; +export { + FilesContext, + Image, + type ImageProps, + UploadFile, + type UploadFileProps, + FilePicker, + type FilePickerProps, +} from './components'; + +export function plugin() { + return new FilesPlugin(); +} diff --git a/src/plugins/files/public/mocks.ts b/src/plugins/files/public/mocks.ts new file mode 100644 index 0000000000000..c19843f3f098d --- /dev/null +++ b/src/plugins/files/public/mocks.ts @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; +import type { FilesClient } from './types'; + +// TODO: Remove this once we have access to the shared file client mock +export const createMockFilesClient = (): DeeplyMockedKeys<FilesClient> => ({ + create: jest.fn(), + delete: jest.fn(), + download: jest.fn(), + find: jest.fn(), + getById: jest.fn(), + getDownloadHref: jest.fn(), + getMetrics: jest.fn(), + getShare: jest.fn(), + list: jest.fn(), + listShares: jest.fn(), + publicDownload: jest.fn(), + share: jest.fn(), + unshare: jest.fn(), + update: jest.fn(), + upload: jest.fn(), +}); diff --git a/src/plugins/files/public/plugin.ts b/src/plugins/files/public/plugin.ts new file mode 100644 index 0000000000000..a91b565d2a540 --- /dev/null +++ b/src/plugins/files/public/plugin.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +import { + getFileKindsRegistry, + setFileKindsRegistry, + FileKindsRegistryImpl, +} from '../common/file_kinds_registry'; +import type { FilesClient, FilesClientFactory } from './types'; +import { createFilesClient } from './files_client'; +import { FileKind } from '../common'; +import { ScopedFilesClient } from '.'; + +/** + * Public setup-phase contract + */ +export interface FilesSetup { + /** + * A factory for creating an {@link FilesClient} instance. This requires a + * registered {@link FileKind}. + * + * @track-adoption + */ + filesClientFactory: FilesClientFactory; + + /** + * Register a {@link FileKind} which allows for specifying details about the files + * that will be uploaded. + * + * @param {FileKind} fileKind - the file kind to register + */ + registerFileKind(fileKind: FileKind): void; +} + +export type FilesStart = Pick<FilesSetup, 'filesClientFactory'>; + +/** + * Bringing files to Kibana + */ +export class FilesPlugin implements Plugin<FilesSetup, FilesStart> { + private filesClientFactory: undefined | FilesClientFactory; + + constructor() { + setFileKindsRegistry(new FileKindsRegistryImpl()); + } + + setup(core: CoreSetup): FilesSetup { + this.filesClientFactory = { + asScoped<M = unknown>(fileKind: string) { + return createFilesClient({ fileKind, http: core.http }) as ScopedFilesClient<M>; + }, + asUnscoped<M>() { + return createFilesClient({ http: core.http }) as FilesClient<M>; + }, + }; + return { + filesClientFactory: this.filesClientFactory, + registerFileKind: (fileKind: FileKind) => { + getFileKindsRegistry().register(fileKind); + }, + }; + } + + start(core: CoreStart): FilesStart { + return { + filesClientFactory: this.filesClientFactory!, + }; + } +} diff --git a/src/plugins/files/public/types.ts b/src/plugins/files/public/types.ts new file mode 100644 index 0000000000000..eb5d28a02f6d4 --- /dev/null +++ b/src/plugins/files/public/types.ts @@ -0,0 +1,187 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FileJSON } from '../common'; +import type { + FindFilesHttpEndpoint, + FileShareHttpEndpoint, + FileUnshareHttpEndpoint, + FileGetShareHttpEndpoint, + FilesMetricsHttpEndpoint, + ListFileKindHttpEndpoint, + CreateFileKindHttpEndpoint, + FileListSharesHttpEndpoint, + UpdateFileKindHttpEndpoint, + UploadFileKindHttpEndpoint, + DeleteFileKindHttpEndpoint, + GetByIdFileKindHttpEndpoint, + DownloadFileKindHttpEndpoint, + FilePublicDownloadHttpEndpoint, + HttpApiInterfaceEntryDefinition, +} from '../common/api_routes'; + +type UnscopedClientMethodFrom<E extends HttpApiInterfaceEntryDefinition> = ( + args: E['inputs']['body'] & + E['inputs']['params'] & + E['inputs']['query'] & { abortSignal?: AbortSignal } +) => Promise<E['output']>; + +/** + * @param args - Input to the endpoint which includes body, params and query of the RESTful endpoint. + */ +type ClientMethodFrom<E extends HttpApiInterfaceEntryDefinition, ExtraArgs extends {} = {}> = ( + args: Parameters<UnscopedClientMethodFrom<E>>[0] & { kind: string } & ExtraArgs +) => Promise<E['output']>; + +interface GlobalEndpoints { + /** + * Get metrics of file system, like storage usage. + * + * @param args - Get metrics arguments + */ + getMetrics: () => Promise<FilesMetricsHttpEndpoint['output']>; + /** + * Download a file, bypassing regular security by way of a + * secret share token. + * + * @param args - Get public download arguments. + */ + publicDownload: UnscopedClientMethodFrom<FilePublicDownloadHttpEndpoint>; + /** + * Find a set of files given some filters. + * + * @param args - File filters + */ + find: UnscopedClientMethodFrom<FindFilesHttpEndpoint>; +} + +/** + * A client that can be used to manage a specific {@link FileKind}. + */ +export interface FilesClient<M = unknown> extends GlobalEndpoints { + /** + * Create a new file object with the provided metadata. + * + * @param args - create file args + */ + create: ClientMethodFrom<CreateFileKindHttpEndpoint<M>>; + /** + * Delete a file object and all associated share and content objects. + * + * @param args - delete file args + */ + delete: ClientMethodFrom<DeleteFileKindHttpEndpoint>; + /** + * Get a file object by ID. + * + * @param args - get file by ID args + */ + getById: ClientMethodFrom<GetByIdFileKindHttpEndpoint<M>>; + /** + * List all file objects, of a given {@link FileKind}. + * + * @param args - list files args + */ + list: ClientMethodFrom<ListFileKindHttpEndpoint<M>>; + /** + * Update a set of of metadata values of the file object. + * + * @param args - update file args + */ + update: ClientMethodFrom<UpdateFileKindHttpEndpoint<M>>; + /** + * Stream the contents of the file to Kibana server for storage. + * + * @param args - upload file args + */ + upload: ( + args: UploadFileKindHttpEndpoint['inputs']['params'] & + UploadFileKindHttpEndpoint['inputs']['query'] & { + /** + * Should be blob or ReadableStream of some kind. + */ + body: unknown; + kind: string; + abortSignal?: AbortSignal; + contentType?: string; + } + ) => Promise<UploadFileKindHttpEndpoint['output']>; + /** + * Stream a download of the file object's content. + * + * @param args - download file args + */ + download: ClientMethodFrom<DownloadFileKindHttpEndpoint>; + /** + * Get a string for downloading a file that can be passed to a button element's + * href for download. + * + * @param args - get download URL args + */ + getDownloadHref: (args: Pick<FileJSON, 'id' | 'fileKind'>) => string; + /** + * Share a file by creating a new file share instance. + * + * @note This returns the secret token that can be used + * to access a file via the public download enpoint. + * + * @param args - File share arguments + */ + share: ClientMethodFrom<FileShareHttpEndpoint>; + /** + * Delete a file share instance. + * + * @param args - File unshare arguments + */ + unshare: ClientMethodFrom<FileUnshareHttpEndpoint>; + /** + * Get a file share instance. + * + * @param args - Get file share arguments + */ + getShare: ClientMethodFrom<FileGetShareHttpEndpoint>; + /** + * List all file shares. Optionally scoping to a specific + * file. + * + * @param args - Get file share arguments + */ + listShares: ClientMethodFrom<FileListSharesHttpEndpoint>; +} + +export type FilesClientResponses<M = unknown> = { + [K in keyof FilesClient]: Awaited<ReturnType<FilesClient<M>[K]>>; +}; + +/** + * A files client that is scoped to a specific {@link FileKind}. + * + * More convenient if you want to re-use the same client for the same file kind + * and not specify the kind every time. + */ +export type ScopedFilesClient<M = unknown> = { + [K in keyof FilesClient]: K extends 'list' + ? (arg?: Omit<Parameters<FilesClient<M>[K]>[0], 'kind'>) => ReturnType<FilesClient<M>[K]> + : (arg: Omit<Parameters<FilesClient<M>[K]>[0], 'kind'>) => ReturnType<FilesClient<M>[K]>; +}; + +/** + * A factory for creating a {@link ScopedFilesClient} + */ +export interface FilesClientFactory { + /** + * Create a files client. + */ + asUnscoped<M = unknown>(): FilesClient<M>; + /** + * Create a {@link ScopedFileClient} for a given {@link FileKind}. + * + * @param fileKind - The {@link FileKind} to create a client for. + */ + asScoped<M = unknown>(fileKind: string): ScopedFilesClient<M>; +} diff --git a/x-pack/plugins/files/server/audit_events.ts b/src/plugins/files/server/audit_events.ts similarity index 79% rename from x-pack/plugins/files/server/audit_events.ts rename to src/plugins/files/server/audit_events.ts index ab5d33a65b764..aea5b6b199fd9 100644 --- a/x-pack/plugins/files/server/audit_events.ts +++ b/src/plugins/files/server/audit_events.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EcsEventOutcome } from '@kbn/logging'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/README.md b/src/plugins/files/server/blob_storage_service/adapters/README.md similarity index 100% rename from x-pack/plugins/files/server/blob_storage_service/adapters/README.md rename to src/plugins/files/server/blob_storage_service/adapters/README.md diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts similarity index 98% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts index 56f61e83e47f9..48410081da3ff 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { Logger } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts similarity index 98% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts index 746c66798b5e8..b4b34b5cca83f 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import cuid from 'cuid'; diff --git a/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts new file mode 100644 index 0000000000000..e3a21c52f3f07 --- /dev/null +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { + ContentStream, + getReadableContentStream, + getWritableContentStream, +} from './content_stream'; + +export type { + ContentStreamArgs, + ContentStreamEncoding, + ContentStreamParameters, + ReadableContentStream, + WritableContentStream, +} from './content_stream'; diff --git a/src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts new file mode 100644 index 0000000000000..bc2cbe0870d59 --- /dev/null +++ b/src/plugins/files/server/blob_storage_service/adapters/es/es.test.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Readable } from 'stream'; +import { promisify } from 'util'; +import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; +import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; +import { Semaphore } from '@kbn/std'; + +import { ElasticsearchBlobStorageClient } from './es'; + +const setImmediate = promisify(global.setImmediate); + +describe('ElasticsearchBlobStorageClient', () => { + let esClient: ElasticsearchClient; + let blobStoreClient: ElasticsearchBlobStorageClient; + let semaphore: Semaphore; + + beforeEach(() => { + semaphore = new Semaphore(1); + esClient = elasticsearchServiceMock.createElasticsearchClient(); + blobStoreClient = new ElasticsearchBlobStorageClient( + esClient, + undefined, + undefined, + loggingSystemMock.createLogger(), + semaphore + ); + }); + + test('limits max concurrent uploads', async () => { + const acquireSpy = jest.spyOn(semaphore, 'acquire'); + (esClient.index as jest.Mock).mockImplementation(() => { + return new Promise((res, rej) => setTimeout(() => rej('failed'), 100)); + }); + const [p1, p2, ...rest] = [ + blobStoreClient.upload(Readable.from(['test'])).catch(() => {}), + blobStoreClient.upload(Readable.from(['test'])).catch(() => {}), + blobStoreClient.upload(Readable.from(['test'])).catch(() => {}), + blobStoreClient.upload(Readable.from(['test'])).catch(() => {}), + ]; + await setImmediate(); + expect(acquireSpy).toHaveBeenCalledTimes(4); + await p1; + expect(esClient.index).toHaveBeenCalledTimes(1); + await p2; + expect(esClient.index).toHaveBeenCalledTimes(2); + await Promise.all(rest); + expect(esClient.index).toHaveBeenCalledTimes(4); + }); +}); diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.ts b/src/plugins/files/server/blob_storage_service/adapters/es/es.ts similarity index 96% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/es.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/es.ts index 96421a06e95c5..2bf582e18d321 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/es.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import assert from 'assert'; diff --git a/src/plugins/files/server/blob_storage_service/adapters/es/index.ts b/src/plugins/files/server/blob_storage_service/adapters/es/index.ts new file mode 100644 index 0000000000000..c0c37cd4c2878 --- /dev/null +++ b/src/plugins/files/server/blob_storage_service/adapters/es/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { ElasticsearchBlobStorageClient, MAX_BLOB_STORE_SIZE_BYTES } from './es'; diff --git a/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts new file mode 100644 index 0000000000000..8e5b7d63218e6 --- /dev/null +++ b/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts @@ -0,0 +1,164 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import sinon from 'sinon'; +import { ElasticsearchClient } from '@kbn/core/server'; +import { Readable } from 'stream'; +import { + createTestServers, + TestElasticsearchUtils, + TestKibanaUtils, +} from '@kbn/core/test_helpers/kbn_server'; + +import { ElasticsearchBlobStorageClient, BLOB_STORAGE_SYSTEM_INDEX_NAME } from '../es'; + +describe('Elasticsearch blob storage', () => { + let manageES: TestElasticsearchUtils; + let manageKbn: TestKibanaUtils; + let esBlobStorage: ElasticsearchBlobStorageClient; + let esClient: ElasticsearchClient; + const sandbox = sinon.createSandbox(); + + beforeAll(async () => { + ElasticsearchBlobStorageClient.configureConcurrentUpload(Infinity); + const { startES, startKibana } = createTestServers({ adjustTimeout: jest.setTimeout }); + manageES = await startES(); + manageKbn = await startKibana(); + esClient = manageKbn.coreStart.elasticsearch.client.asInternalUser; + }); + + afterAll(async () => { + await manageKbn.root.shutdown(); + await manageKbn.stop(); + await manageES.stop(); + }); + + const createEsBlobStorage = ({ chunkSize }: { chunkSize?: string } = {}) => + new ElasticsearchBlobStorageClient( + esClient, + undefined, + chunkSize, + manageKbn.root.logger.get('es-blob-test') + ); + + beforeEach(() => { + esBlobStorage = createEsBlobStorage(); + sandbox.spy(esClient, 'get'); + }); + + afterEach(async () => { + await esClient.indices.delete({ index: BLOB_STORAGE_SYSTEM_INDEX_NAME }); + sandbox.restore(); + }); + + it('sets up a new blob storage index after first write', async () => { + expect(await esClient.indices.exists({ index: BLOB_STORAGE_SYSTEM_INDEX_NAME })).toBe(false); + await esBlobStorage.upload(Readable.from(['upload this'])); + expect(await esClient.indices.exists({ index: BLOB_STORAGE_SYSTEM_INDEX_NAME })).toBe(true); + }); + + it('uploads and retrieves file content of known size', async () => { + const { id, size } = await esBlobStorage.upload(Readable.from(['upload this'])); + const rs = await esBlobStorage.download({ id, size }); + const chunks: string[] = []; + for await (const chunk of rs) { + chunks.push(chunk); + } + expect(chunks.join('')).toBe('upload this'); + expect((esClient.get as sinon.SinonSpy).calledOnce).toBe(true); + }); + + /** + * Test a case where, if, for whatever reason, the file size is unknown we should + * still be able to download the file. + */ + it('uploads and retrieves file content of unknown size', async () => { + const { id } = await esBlobStorage.upload(Readable.from(['upload this'])); + const rs = await esBlobStorage.download({ id }); + const chunks: string[] = []; + for await (const chunk of rs) { + chunks.push(chunk); + } + expect(chunks.join('')).toBe('upload this'); + // Called once because we should have found 'last: true' + expect((esClient.get as sinon.SinonSpy).calledOnce).toBe(true); + expect((esClient.get as sinon.SinonSpy).args[0]).toEqual([ + { + id: id + '.0', + index: BLOB_STORAGE_SYSTEM_INDEX_NAME, + _source_includes: ['data', 'last'], + }, + { + headers: { accept: 'application/cbor' }, + asStream: true, + }, + ]); + }); + + it('uploads and downloads a file of many chunks', async () => { + const fileString = Buffer.alloc(36 * 1028, 'a'); + esBlobStorage = createEsBlobStorage({ chunkSize: '1024B' }); + const { id } = await esBlobStorage.upload(Readable.from([fileString])); + expect(await getAllDocCount()).toMatchObject({ count: 37 }); + const rs = await esBlobStorage.download({ id }); + const chunks: string[] = []; + for await (const chunk of rs) { + chunks.push(chunk); + } + expect(chunks.join('')).toBe(fileString.toString('utf-8')); + }); + + const getAllDocCount = async () => { + await esClient.indices.refresh({ index: BLOB_STORAGE_SYSTEM_INDEX_NAME }); + return esClient.count({ + index: BLOB_STORAGE_SYSTEM_INDEX_NAME, + query: { match_all: {} }, + }); + }; + + it('uploads and removes file content', async () => { + const { id } = await esBlobStorage.upload(Readable.from(['upload this'])); + expect(await getAllDocCount()).toMatchObject({ count: 1 }); + await esBlobStorage.delete(id); + expect(await getAllDocCount()).toMatchObject({ count: 0 }); + }); + + it('chunks files and then deletes all chunks when cleaning up', async () => { + const oneMiB = 1024 * 1024; + const fileString = Buffer.alloc(31 * oneMiB, 'a'); + const fileString2 = Buffer.alloc(8 * oneMiB, 'b'); + + esBlobStorage = createEsBlobStorage(); + const { id } = await esBlobStorage.upload(Readable.from([fileString])); + const { id: id2 } = await esBlobStorage.upload(Readable.from([fileString2])); + expect(await getAllDocCount()).toMatchObject({ count: 10 }); + await esBlobStorage.delete(id); + expect(await getAllDocCount()).toMatchObject({ count: 2 }); + // Now we check that the other file is still intact + const rs = await esBlobStorage.download({ id: id2 }); + const chunks: Buffer[] = []; + for await (const chunk of rs) { + chunks.push(chunk); + } + const resultString = chunks.join(''); + expect(resultString).toBe(fileString2.toString('utf-8')); + }); + + it('stores chunks at exactly max chunk size', async () => { + esBlobStorage = createEsBlobStorage({ chunkSize: '1024B' }); + const fileBuffer = Buffer.alloc(2048, 'a'); + const { id } = await esBlobStorage.upload(Readable.from([fileBuffer])); + expect(await getAllDocCount()).toMatchObject({ count: 2 }); + const rs = await esBlobStorage.download({ id }); + const chunks: Buffer[] = []; + for await (const chunk of rs) { + chunks.push(chunk); + } + expect(chunks.join('')).toEqual(fileBuffer.toString('utf-8')); + }); +}); diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/mappings.ts b/src/plugins/files/server/blob_storage_service/adapters/es/mappings.ts similarity index 86% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/mappings.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/mappings.ts index dbcd57a06ba18..6f7f99d818193 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/mappings.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/mappings.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { diff --git a/src/plugins/files/server/blob_storage_service/adapters/index.ts b/src/plugins/files/server/blob_storage_service/adapters/index.ts new file mode 100644 index 0000000000000..c0c37cd4c2878 --- /dev/null +++ b/src/plugins/files/server/blob_storage_service/adapters/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { ElasticsearchBlobStorageClient, MAX_BLOB_STORE_SIZE_BYTES } from './es'; diff --git a/x-pack/plugins/files/server/blob_storage_service/blob_storage_service.ts b/src/plugins/files/server/blob_storage_service/blob_storage_service.ts similarity index 88% rename from x-pack/plugins/files/server/blob_storage_service/blob_storage_service.ts rename to src/plugins/files/server/blob_storage_service/blob_storage_service.ts index ecd2c6e3d3dad..0cc4ba81997b8 100644 --- a/x-pack/plugins/files/server/blob_storage_service/blob_storage_service.ts +++ b/src/plugins/files/server/blob_storage_service/blob_storage_service.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { BlobStorageSettings, ES_FIXED_SIZE_INDEX_BLOB_STORE } from '../../common'; import { BlobStorageClient } from './types'; diff --git a/src/plugins/files/server/blob_storage_service/index.ts b/src/plugins/files/server/blob_storage_service/index.ts new file mode 100644 index 0000000000000..4b1d0ec29a2dc --- /dev/null +++ b/src/plugins/files/server/blob_storage_service/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { BlobStorageService } from './blob_storage_service'; +export { ElasticsearchBlobStorageClient } from './adapters'; +export type { BlobStorageClient, UploadOptions } from './types'; diff --git a/src/plugins/files/server/blob_storage_service/types.ts b/src/plugins/files/server/blob_storage_service/types.ts new file mode 100644 index 0000000000000..7ced9ec9df708 --- /dev/null +++ b/src/plugins/files/server/blob_storage_service/types.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { JsonValue } from '@kbn/utility-types'; +import type { Readable, Transform } from 'stream'; + +export type BlobAttribute = [key: string, value: JsonValue]; + +export interface UploadOptions { + /** + * Optionally provide any transforms to run on the readable source stream + * as it is being uploaded. + */ + transforms?: Transform[]; + + /** + * The ID to use to derive blob IDs. + * + * If "mycoolid" is provided. The blob IDs will look like: + * "mycoolid.0" + * "mycoolid.1" + * "mycoolid.2" + * + * And so on. + */ + id?: string; +} + +/** + * An interface that must be implemented by any blob storage adapter. + * + * @note + * The blob storage target must be fully managed by Kibana through this interface + * to avoid corrupting stored data. + * + * @note + * File IDs are stored in Kibana Saved Objects as references to a file. + * + * @internal + */ +export interface BlobStorageClient { + /** + * Upload a new file. + * + * Generates a random file ID and returns it upon successfully uploading a + * file. The file size can be used when downloading the file later. + * + * @param content - The readable stream to upload. + * @param opts - Optional options to use when uploading the file. + */ + upload(content: Readable, opts?: UploadOptions): Promise<{ id: string; size: number }>; + + /** + * Download a file. + * + * Given an ID, and optional file size, retrieve the file contents as a readable + * stream. + * + * @param args - Arguments to download a file + */ + download(args: { id: string; size?: number }): Promise<Readable>; + + /** + * Delete a file given a unique ID. + * + * @param id - The ID of the file to delete. + */ + delete(id: string): Promise<void>; +} diff --git a/src/plugins/files/server/feature.ts b/src/plugins/files/server/feature.ts new file mode 100644 index 0000000000000..81ba7978e49f6 --- /dev/null +++ b/src/plugins/files/server/feature.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { DEFAULT_APP_CATEGORIES } from '@kbn/core-application-common'; +import { KibanaFeatureConfig } from '@kbn/features-plugin/common'; +import { i18n } from '@kbn/i18n'; +import { PLUGIN_ID } from '../common'; +import { FILES_MANAGE_PRIVILEGE } from '../common/constants'; +import { hiddenTypes } from './saved_objects'; + +// TODO: This should be registered once we have a management section for files content +export const filesFeature: KibanaFeatureConfig = { + id: PLUGIN_ID, + name: i18n.translate('files.featureRegistry.filesFeatureName', { + defaultMessage: 'Files', + }), + minimumLicense: 'basic', + order: 10000, + category: DEFAULT_APP_CATEGORIES.management, + app: [PLUGIN_ID], + privilegesTooltip: i18n.translate('files.featureRegistry.filesPrivilegesTooltip', { + defaultMessage: 'Provide access to files across all apps', + }), + privileges: { + all: { + app: [PLUGIN_ID], + savedObject: { + all: hiddenTypes, + read: hiddenTypes, + }, + ui: [], + api: [FILES_MANAGE_PRIVILEGE], + }, + read: { + app: [PLUGIN_ID], + savedObject: { + all: hiddenTypes, + read: hiddenTypes, + }, + ui: [], + }, + }, +}; diff --git a/src/plugins/files/server/file/errors.ts b/src/plugins/files/server/file/errors.ts new file mode 100644 index 0000000000000..db504adf79d27 --- /dev/null +++ b/src/plugins/files/server/file/errors.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/* eslint-disable max-classes-per-file */ + +class FileError extends Error { + constructor(message?: string) { + super(message); + Error.captureStackTrace(this); + } +} + +export class ContentAlreadyUploadedError extends FileError {} +export class NoDownloadAvailableError extends FileError {} +export class UploadInProgressError extends FileError {} +export class AlreadyDeletedError extends FileError {} +export class AbortedUploadError extends FileError {} diff --git a/x-pack/plugins/files/server/file/file.test.ts b/src/plugins/files/server/file/file.test.ts similarity index 95% rename from x-pack/plugins/files/server/file/file.test.ts rename to src/plugins/files/server/file/file.test.ts index b2e9167c685b3..b42a360682cf9 100644 --- a/x-pack/plugins/files/server/file/file.test.ts +++ b/src/plugins/files/server/file/file.test.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { of } from 'rxjs'; import type { ElasticsearchClient, ISavedObjectsRepository } from '@kbn/core/server'; import { createSandbox } from 'sinon'; diff --git a/src/plugins/files/server/file/file.ts b/src/plugins/files/server/file/file.ts new file mode 100644 index 0000000000000..d8f246d864882 --- /dev/null +++ b/src/plugins/files/server/file/file.ts @@ -0,0 +1,174 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Logger } from '@kbn/core/server'; +import { Readable } from 'stream'; +import { + map, + from, + race, + defer, + NEVER, + mergeMap, + catchError, + Observable, + lastValueFrom, +} from 'rxjs'; +import type { FileShareJSON, FileShareJSONWithToken } from '../../common/types'; +import type { File as IFile, UpdatableFileMetadata, FileJSON } from '../../common'; +import { fileAttributesReducer, Action } from './file_attributes_reducer'; +import type { FileClientImpl } from '../file_client/file_client'; +import { + AbortedUploadError, + AlreadyDeletedError, + UploadInProgressError, + NoDownloadAvailableError, + ContentAlreadyUploadedError, +} from './errors'; + +/** + * Scopes file actions to an ID and set of attributes. + * + * Also exposes the upload and download functionality. + */ +export class File<M = unknown> implements IFile { + constructor( + public readonly id: string, + private metadata: FileJSON<M>, + private readonly fileClient: FileClientImpl, + private readonly logger: Logger + ) {} + + private async updateFileState(action: Action): Promise<void> { + const metadata = fileAttributesReducer(this.data, action); + await this.fileClient.internalUpdate(this.id, metadata); + this.data = metadata as FileJSON<M>; + } + + private isReady(): boolean { + return this.data.status === 'READY'; + } + + private isDeleted(): boolean { + return this.data.status === 'DELETED'; + } + + private uploadInProgress(): boolean { + return this.data.status === 'UPLOADING'; + } + + public async update(attrs: Partial<UpdatableFileMetadata>): Promise<IFile<M>> { + await this.updateFileState({ + action: 'updateFile', + payload: attrs, + }); + return this; + } + + private upload(content: Readable): Observable<{ size: number }> { + return defer(() => this.fileClient.upload(this.id, content)); + } + + public async uploadContent( + content: Readable, + abort$: Observable<unknown> = NEVER + ): Promise<IFile<M>> { + if (this.uploadInProgress()) { + throw new UploadInProgressError('Upload already in progress.'); + } + if (this.isReady()) { + throw new ContentAlreadyUploadedError('Already uploaded file content.'); + } + this.logger.debug(`Uploading file [id = ${this.id}][name = ${this.data.name}].`); + + await lastValueFrom( + from(this.updateFileState({ action: 'uploading' })).pipe( + mergeMap(() => + race( + this.upload(content), + abort$.pipe( + map(() => { + throw new AbortedUploadError(`Aborted upload of ${this.id}!`); + }) + ) + ) + ), + mergeMap(({ size }) => { + return this.updateFileState({ action: 'uploaded', payload: { size } }); + }), + catchError(async (e) => { + try { + await this.updateFileState({ action: 'uploadError' }); + } catch (updateError) { + this.logger.error( + `Could not update file ${this.id} after upload error (${e.message}). Update failed with: ${updateError.message}. This file may be in an inconsistent state.` + ); + } + this.fileClient.deleteContent(this.id).catch(() => {}); + throw e; + }) + ) + ); + + return this; + } + + public downloadContent(): Promise<Readable> { + const { size } = this.data; + if (!this.isReady()) { + throw new NoDownloadAvailableError('This file content is not available for download.'); + } + // We pass through this file ID to retrieve blob content. + return this.fileClient.download({ id: this.id, size }); + } + + public async delete(): Promise<void> { + if (this.uploadInProgress()) { + throw new UploadInProgressError('Cannot delete file while upload in progress'); + } + if (this.isDeleted()) { + throw new AlreadyDeletedError('File has already been deleted'); + } + await this.updateFileState({ + action: 'delete', + }); + await this.fileClient.delete({ id: this.id, hasContent: this.isReady() }); + } + + public async share({ + name, + validUntil, + }: { + name: string; + validUntil?: number; + }): Promise<FileShareJSONWithToken> { + return this.fileClient.share({ name, validUntil, file: this }); + } + + async listShares(): Promise<FileShareJSON[]> { + const { shares } = await this.fileClient.listShares({ + fileId: this.id, + }); + return shares; + } + + async unshare(opts: { shareId: string }): Promise<void> { + await this.fileClient.unshare({ id: opts.shareId }); + } + + public toJSON(): FileJSON<M> { + return this.data; + } + + public get data(): FileJSON<M> { + return this.metadata; + } + private set data(v: FileJSON<M>) { + this.metadata = v; + } +} diff --git a/x-pack/plugins/files/server/file/file_attributes_reducer.ts b/src/plugins/files/server/file/file_attributes_reducer.ts similarity index 86% rename from x-pack/plugins/files/server/file/file_attributes_reducer.ts rename to src/plugins/files/server/file/file_attributes_reducer.ts index fdb2768408af5..1a035c32e1243 100644 --- a/x-pack/plugins/files/server/file/file_attributes_reducer.ts +++ b/src/plugins/files/server/file/file_attributes_reducer.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { FileJSON, UpdatableFileMetadata } from '../../common'; export type Action = diff --git a/src/plugins/files/server/file/index.ts b/src/plugins/files/server/file/index.ts new file mode 100644 index 0000000000000..3aa6709356642 --- /dev/null +++ b/src/plugins/files/server/file/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as fileErrors from './errors'; + +export { File } from './file'; +export { toJSON } from './to_json'; +export { fileAttributesReducer } from './file_attributes_reducer'; +export type { Action } from './file_attributes_reducer'; +export { fileErrors }; diff --git a/x-pack/plugins/files/server/file/to_json.ts b/src/plugins/files/server/file/to_json.ts similarity index 75% rename from x-pack/plugins/files/server/file/to_json.ts rename to src/plugins/files/server/file/to_json.ts index 98096940fe75f..2d01655c3a4e0 100644 --- a/x-pack/plugins/files/server/file/to_json.ts +++ b/src/plugins/files/server/file/to_json.ts @@ -1,25 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { pickBy } from 'lodash'; import type { FileMetadata, FileJSON } from '../../common/types'; -export function serializeJSON<M = unknown>(attrs: Partial<FileJSON>): Partial<FileMetadata> { - const { name, mimeType, size, created, updated, fileKind, status, alt, extension, meta } = attrs; +export function serializeJSON<M = unknown>(attrs: Partial<FileJSON>): Partial<FileMetadata<M>> { + const { name, mimeType, size, created, updated, fileKind, status, alt, extension, meta, user } = + attrs; return pickBy( { name, mime_type: mimeType, size, + user, created, extension, Alt: alt, Status: status, - Meta: meta as M, + Meta: meta, Updated: updated, FileKind: fileKind, }, @@ -27,11 +30,12 @@ export function serializeJSON<M = unknown>(attrs: Partial<FileJSON>): Partial<Fi ); } -export function toJSON<M = unknown>(id: string, attrs: FileMetadata): FileJSON<M> { +export function toJSON<M = unknown>(id: string, attrs: FileMetadata<M>): FileJSON<M> { const { name, mime_type: mimeType, size, + user, created, Updated, FileKind, @@ -43,6 +47,7 @@ export function toJSON<M = unknown>(id: string, attrs: FileMetadata): FileJSON<M return pickBy<FileJSON<M>>( { id, + user, name, mimeType, size, @@ -50,7 +55,7 @@ export function toJSON<M = unknown>(id: string, attrs: FileMetadata): FileJSON<M extension, alt: Alt, status: Status, - meta: Meta as M, + meta: Meta, updated: Updated, fileKind: FileKind, }, diff --git a/x-pack/plugins/files/server/file_client/create_es_file_client.ts b/src/plugins/files/server/file_client/create_es_file_client.ts similarity index 90% rename from x-pack/plugins/files/server/file_client/create_es_file_client.ts rename to src/plugins/files/server/file_client/create_es_file_client.ts index 9f453a6a25bfc..1fb14b1fdfbba 100644 --- a/x-pack/plugins/files/server/file_client/create_es_file_client.ts +++ b/src/plugins/files/server/file_client/create_es_file_client.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { Logger, ElasticsearchClient } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/file_client/file_client.ts b/src/plugins/files/server/file_client/file_client.ts similarity index 97% rename from x-pack/plugins/files/server/file_client/file_client.ts rename to src/plugins/files/server/file_client/file_client.ts index 6954ac9c635d7..4e49bc1e1d69c 100644 --- a/x-pack/plugins/files/server/file_client/file_client.ts +++ b/src/plugins/files/server/file_client/file_client.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import moment from 'moment'; import { Readable } from 'stream'; import mimeType from 'mime'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts similarity index 95% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts index dcfe39e112075..8e78c471dde2b 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { once } from 'lodash'; diff --git a/src/plugins/files/server/file_client/file_metadata_client/adapters/index.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/index.ts new file mode 100644 index 0000000000000..965cbe0fa1907 --- /dev/null +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { SavedObjectsFileMetadataClient } from './saved_objects'; +export { EsIndexFilesMetadataClient } from './es_index'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts similarity index 91% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts index e5c49b8f12b9d..14e757fae691a 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { pipe, forEach } from 'lodash/fp'; import { escapeKuery, KueryNode, nodeBuilder, nodeTypes } from '@kbn/es-query'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts similarity index 95% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts index b1a43a05bfb7b..f0f547bb4704f 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { reduce } from 'lodash'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts b/src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts similarity index 93% rename from x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts rename to src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts index 5136fc9744d51..2738d75d8222c 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { ES_FIXED_SIZE_INDEX_BLOB_STORE } from '../../../common/constants'; diff --git a/src/plugins/files/server/file_client/file_metadata_client/index.ts b/src/plugins/files/server/file_client/file_metadata_client/index.ts new file mode 100644 index 0000000000000..97948a5ebee35 --- /dev/null +++ b/src/plugins/files/server/file_client/file_metadata_client/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { + FileMetadataClient, + FileDescriptor, + DeleteArg as DeleteMetedataArg, + FindArg as FindMetadataArg, + GetArg as GetMetadataArg, + GetUsageMetricsArgs, + UpdateArgs as UpdateMetadataArg, +} from './file_metadata_client'; +export { SavedObjectsFileMetadataClient, EsIndexFilesMetadataClient } from './adapters'; diff --git a/src/plugins/files/server/file_client/index.ts b/src/plugins/files/server/file_client/index.ts new file mode 100644 index 0000000000000..f034f67ec9c68 --- /dev/null +++ b/src/plugins/files/server/file_client/index.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { EsIndexFilesMetadataClient, SavedObjectsFileMetadataClient } from './file_metadata_client'; +export type { + FileMetadataClient, + DeleteMetedataArg, + FileDescriptor, + FindMetadataArg, + GetMetadataArg, + GetUsageMetricsArgs, + UpdateMetadataArg, +} from './file_metadata_client'; +export { FileClientImpl } from './file_client'; +export type { FileClient } from './types'; +export { createEsFileClient } from './create_es_file_client'; +export type { CreateEsFileClientArgs } from './create_es_file_client'; +export { + AlreadyDeletedError, + ContentAlreadyUploadedError, + NoDownloadAvailableError, + UploadInProgressError, +} from '../file/errors'; diff --git a/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts b/src/plugins/files/server/file_client/integration_tests/es_file_client.test.ts similarity index 96% rename from x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts rename to src/plugins/files/server/file_client/integration_tests/es_file_client.test.ts index 0ae1b9c7d29f8..c9d78cb33ac17 100644 --- a/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts +++ b/src/plugins/files/server/file_client/integration_tests/es_file_client.test.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { Readable } from 'stream'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { TestEnvironmentUtils, setupIntegrationEnvironment } from '../../test_utils'; diff --git a/src/plugins/files/server/file_client/stream_transforms/index.ts b/src/plugins/files/server/file_client/stream_transforms/index.ts new file mode 100644 index 0000000000000..a89ef117795a9 --- /dev/null +++ b/src/plugins/files/server/file_client/stream_transforms/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { enforceMaxByteSizeTransform } from './max_byte_size_transform'; diff --git a/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts new file mode 100644 index 0000000000000..8c846f9bde101 --- /dev/null +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export class MaxByteSizeExceededError extends Error { + constructor(expectedSize: number) { + super(`Maximum of ${expectedSize} bytes exceeded`); + Error.captureStackTrace(this); + } +} diff --git a/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts new file mode 100644 index 0000000000000..a89ef117795a9 --- /dev/null +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { enforceMaxByteSizeTransform } from './max_byte_size_transform'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts similarity index 87% rename from x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts rename to src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts index 9697624edb471..0b9ca5fe8a455 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Readable, Writable, pipeline } from 'stream'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts similarity index 79% rename from x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts rename to src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts index c2634bcbf8fe2..a94f9858a996c 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Transform } from 'stream'; diff --git a/src/plugins/files/server/file_client/types.ts b/src/plugins/files/server/file_client/types.ts new file mode 100644 index 0000000000000..c3a47567be0ab --- /dev/null +++ b/src/plugins/files/server/file_client/types.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { File, FileShareJSONWithToken, UpdatableFileMetadata } from '../../common/types'; +import { CreateFileArgs } from '../file_service'; +import { FileShareServiceStart } from '../file_share_service'; +import { FileMetadataClient } from './file_metadata_client'; + +export type P1<F extends (...args: any[]) => any> = Parameters<F>[0]; + +export interface DeleteArgs { + /** ID of the file to delete */ + id: string; + /** + * If `true`, the file will be deleted from the blob storage. + * + * @default true + */ + hasContent?: boolean; +} + +/** + * Args to create a file + */ +export interface CreateArgs<Meta = unknown> { + /** + * Unique file ID + */ + id?: string; + /** + * The file's metadata + */ + metadata: Omit<CreateFileArgs<Meta>, 'fileKind'>; +} + +/** + * File share args + */ +export interface ShareArgs { + /** + * Name of the file share + */ + name?: string; + /** + * Unix timestamp (in milliseconds) when the file share will expire + */ + validUntil?: number; + /** + * The file to share + */ + file: File; +} + +/** + * Wraps the {@link FileMetadataClient} and {@link BlobStorageClient} client + * to provide basic file CRUD functionality. + * + * For now this is just a shallow type of the implementation for export purposes. + */ +export interface FileClient { + /** See {@link FileMetadata.FileKind}. */ + fileKind: string; + + /** + * See {@link FileMetadataClient.create}. + * + * @param arg - Arg to create a file. + * */ + create<M = unknown>(arg: CreateArgs<M>): Promise<File<M>>; + + /** + * See {@link FileMetadataClient.get} + * + * @param arg - Argument to get a file + */ + get<M = unknown>(arg: P1<FileMetadataClient['get']>): Promise<File<M>>; + + /** + * {@link FileMetadataClient.update} + * + * @param id - File id + * @param metadata - new file metadata + */ + update<M = unknown>(id: string, metadata: UpdatableFileMetadata<M>): Promise<void>; + + /** + * Delete a file. + * @param arg - Argument to delete a file + */ + delete(arg: DeleteArgs): Promise<void>; + + /** + * See {@link FileMetadataClient.find}. + * + * @param arg - Argument to find files + */ + find: (arg?: P1<FileMetadataClient['find']>) => Promise<{ files: File[]; total: number }>; + + /** + * Create a file share instance for this file. + * + * @note this will only work for files that are share capable. + * + * @param args - Arguments to create a file share + */ + share(args: ShareArgs): Promise<FileShareJSONWithToken>; + /** + * Create a file share instance for this file. + * + * @note this will only work for files that are share capable. + * + * @param args - Arguments to remove a file share + */ + unshare: FileShareServiceStart['delete']; + /** + * Create a file share instance for this file. + * + * @note this will only work for files that are share capable. + * + * @param arg - Arguments to remove a file share + */ + listShares: FileShareServiceStart['list']; +} diff --git a/src/plugins/files/server/file_client/utils.ts b/src/plugins/files/server/file_client/utils.ts new file mode 100644 index 0000000000000..88e0901680f0c --- /dev/null +++ b/src/plugins/files/server/file_client/utils.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { FileMetadata } from '../../common'; + +export function createDefaultFileAttributes(): Pick< + FileMetadata, + 'created' | 'Updated' | 'Status' +> { + const dateString = new Date().toISOString(); + return { + created: dateString, + Status: 'AWAITING_UPLOAD', + Updated: dateString, + }; +} diff --git a/src/plugins/files/server/file_service/errors.ts b/src/plugins/files/server/file_service/errors.ts new file mode 100644 index 0000000000000..67bd93e0c782d --- /dev/null +++ b/src/plugins/files/server/file_service/errors.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export class FileNotFoundError extends Error { + constructor(message: string) { + super(message); + Error.captureStackTrace(this); + } +} diff --git a/x-pack/plugins/files/server/file_service/file_action_types.ts b/src/plugins/files/server/file_service/file_action_types.ts similarity index 83% rename from x-pack/plugins/files/server/file_service/file_action_types.ts rename to src/plugins/files/server/file_service/file_action_types.ts index f0242cb523d40..58aaef579f14b 100644 --- a/x-pack/plugins/files/server/file_service/file_action_types.ts +++ b/src/plugins/files/server/file_service/file_action_types.ts @@ -1,11 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import type { Pagination, UpdatableFileMetadata } from '../../common/types'; +import type { FileMetadata, Pagination, UpdatableFileMetadata } from '../../common/types'; /** * Arguments to create a new file. @@ -31,6 +32,10 @@ export interface CreateFileArgs<Meta = unknown> { * The MIME type of the file. */ mime?: string; + /** + * User data associated with this file + */ + user?: FileMetadata['user']; } /** diff --git a/x-pack/plugins/files/server/file_service/file_service.ts b/src/plugins/files/server/file_service/file_service.ts similarity index 92% rename from x-pack/plugins/files/server/file_service/file_service.ts rename to src/plugins/files/server/file_service/file_service.ts index e48b0a6ea38ca..9dc1b0769cedf 100644 --- a/x-pack/plugins/files/server/file_service/file_service.ts +++ b/src/plugins/files/server/file_service/file_service.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FilesMetrics, File, FileJSON } from '../../common'; diff --git a/x-pack/plugins/files/server/file_service/file_service_factory.ts b/src/plugins/files/server/file_service/file_service_factory.ts similarity index 96% rename from x-pack/plugins/files/server/file_service/file_service_factory.ts rename to src/plugins/files/server/file_service/file_service_factory.ts index 393777c9a9abf..50ceafb6fc249 100644 --- a/x-pack/plugins/files/server/file_service/file_service_factory.ts +++ b/src/plugins/files/server/file_service/file_service_factory.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { diff --git a/src/plugins/files/server/file_service/index.ts b/src/plugins/files/server/file_service/index.ts new file mode 100644 index 0000000000000..5d332a51d3a52 --- /dev/null +++ b/src/plugins/files/server/file_service/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { FileServiceFactoryImpl as FileServiceFactory } from './file_service_factory'; +export type { + CreateFileArgs, + DeleteFileArgs, + FindFileArgs, + GetByIdArgs, + UpdateFileArgs, +} from './file_action_types'; +export type { FileServiceStart } from './file_service'; +export * as errors from './errors'; diff --git a/x-pack/plugins/files/server/file_service/internal_file_service.ts b/src/plugins/files/server/file_service/internal_file_service.ts similarity index 95% rename from x-pack/plugins/files/server/file_service/internal_file_service.ts rename to src/plugins/files/server/file_service/internal_file_service.ts index 7768237e9fd50..7f6922a3842db 100644 --- a/x-pack/plugins/files/server/file_service/internal_file_service.ts +++ b/src/plugins/files/server/file_service/internal_file_service.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Logger, SavedObjectsErrorHelpers } from '@kbn/core/server'; diff --git a/src/plugins/files/server/file_share_service/errors.ts b/src/plugins/files/server/file_share_service/errors.ts new file mode 100644 index 0000000000000..193b30e6e1881 --- /dev/null +++ b/src/plugins/files/server/file_share_service/errors.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/* eslint-disable max-classes-per-file */ + +abstract class FileShareError extends Error { + constructor(message: string) { + super(message); + Error.captureStackTrace(this); + } +} + +export class ExpiryDateInThePastError extends FileShareError {} +export class FileShareNotFoundError extends FileShareError {} +export class FileShareTokenInvalidError extends FileShareError {} diff --git a/src/plugins/files/server/file_share_service/generate_share_token.test.ts b/src/plugins/files/server/file_share_service/generate_share_token.test.ts new file mode 100644 index 0000000000000..53122395f6685 --- /dev/null +++ b/src/plugins/files/server/file_share_service/generate_share_token.test.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { generateShareToken } from './generate_share_token'; + +describe('generateShareToken', () => { + it('should contain only expected chars of a given length', () => { + for (let i = 0; i < 50; i++) { + expect(generateShareToken()).toMatch(/^[a-zA-O0-9]{40}$/); + } + }); +}); diff --git a/x-pack/plugins/files/server/file_share_service/generate_share_token.ts b/src/plugins/files/server/file_share_service/generate_share_token.ts similarity index 82% rename from x-pack/plugins/files/server/file_share_service/generate_share_token.ts rename to src/plugins/files/server/file_share_service/generate_share_token.ts index ef779db49223a..d20bf8bd97391 100644 --- a/x-pack/plugins/files/server/file_share_service/generate_share_token.ts +++ b/src/plugins/files/server/file_share_service/generate_share_token.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import crypto from 'crypto'; diff --git a/src/plugins/files/server/file_share_service/index.ts b/src/plugins/files/server/file_share_service/index.ts new file mode 100644 index 0000000000000..d4f2f1eba9df6 --- /dev/null +++ b/src/plugins/files/server/file_share_service/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { InternalFileShareService } from './internal_file_share_service'; +export type { + CreateShareArgs, + DeleteArgs as DeleteShareArgs, + DeleteForFileArgs as DeleteSharesForFileArgs, + GetArgs as GetShareArgs, + ListArgs as ListSharesArgs, + UpdateArgs as UpdateShareArgs, +} from './internal_file_share_service'; +export type { FileShareServiceStart } from './types'; diff --git a/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts b/src/plugins/files/server/file_share_service/internal_file_share_service.ts similarity index 97% rename from x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts rename to src/plugins/files/server/file_share_service/internal_file_share_service.ts index 4d5bd95bf4b28..beef345cc8510 100644 --- a/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts +++ b/src/plugins/files/server/file_share_service/internal_file_share_service.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import moment from 'moment'; import { SavedObjectsClientContract, diff --git a/src/plugins/files/server/file_share_service/types.ts b/src/plugins/files/server/file_share_service/types.ts new file mode 100644 index 0000000000000..9e353172eb7aa --- /dev/null +++ b/src/plugins/files/server/file_share_service/types.ts @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { FileShareJSON, FileShare } from '../../common/types'; +import type { GetArgs, UpdateArgs, DeleteArgs, ListArgs } from './internal_file_share_service'; + +/** + * We only expose functionality here that do not require you to have a {@link File} + * instance loaded. + */ +export interface FileShareServiceStart { + /** + * Get a share instance + * + * @param {GetArgs} arg - the arguments to get the share instance + */ + get(arg: GetArgs): Promise<FileShareJSON>; + + /** + * List share objects + * + * @param {ListArgs} arg - the arguments to list share objects + */ + list(arg: ListArgs): Promise<{ shares: FileShareJSON[] }>; + + /** + * Update a share instance. + * + * @param {UpdateArgs} args - the arguments to update a share instance + */ + update(args: UpdateArgs): Promise<FileShare & { id: string }>; + + /** + * Delete a share instance. + * + * @param {DeleteArgs} args - the arguments to delete a share instance + */ + delete(args: DeleteArgs): Promise<void>; +} diff --git a/src/plugins/files/server/index.ts b/src/plugins/files/server/index.ts new file mode 100755 index 0000000000000..5fb3a1e7f6c8e --- /dev/null +++ b/src/plugins/files/server/index.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { PluginInitializerContext } from '@kbn/core/server'; +import { FilesPlugin } from './plugin'; + +export type { + FileClient, + FileDescriptor, + GetMetadataArg, + FindMetadataArg, + UpdateMetadataArg, + DeleteMetedataArg, + FileMetadataClient, + GetUsageMetricsArgs, + CreateEsFileClientArgs, +} from './file_client'; +export { createEsFileClient } from './file_client'; + +export type { FilesSetup, FilesStart } from './types'; +export type { + FileShareServiceStart, + CreateShareArgs, + DeleteShareArgs, + DeleteSharesForFileArgs, + GetShareArgs, + ListSharesArgs, + UpdateShareArgs, +} from './file_share_service'; +export type { + GetByIdArgs, + FindFileArgs, + CreateFileArgs, + DeleteFileArgs, + UpdateFileArgs, + FileServiceStart, +} from './file_service'; +export type { FileServiceFactory } from './file_service/file_service_factory'; + +export function plugin(initializerContext: PluginInitializerContext) { + return new FilesPlugin(initializerContext); +} diff --git a/x-pack/plugins/files/server/integration_tests/README.md b/src/plugins/files/server/integration_tests/README.md similarity index 100% rename from x-pack/plugins/files/server/integration_tests/README.md rename to src/plugins/files/server/integration_tests/README.md diff --git a/x-pack/plugins/files/server/integration_tests/file_service.test.ts b/src/plugins/files/server/integration_tests/file_service.test.ts similarity index 98% rename from x-pack/plugins/files/server/integration_tests/file_service.test.ts rename to src/plugins/files/server/integration_tests/file_service.test.ts index 9ea208ca29855..30c3ecd5d9e4d 100644 --- a/x-pack/plugins/files/server/integration_tests/file_service.test.ts +++ b/src/plugins/files/server/integration_tests/file_service.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { CoreStart, ElasticsearchClient } from '@kbn/core/server'; @@ -37,7 +38,6 @@ describe('FileService', () => { let fileService: FileServiceStart; let blobStorageService: BlobStorageService; let esClient: ElasticsearchClient; - let coreSetup: Awaited<ReturnType<typeof kbnRoot.setup>>; let coreStart: CoreStart; let fileServiceFactory: FileServiceFactory; let security: ReturnType<typeof securityMock.createSetup>; @@ -48,8 +48,7 @@ describe('FileService', () => { manageES = await startES(); kbnRoot = createRootWithCorePlugins(); await kbnRoot.preboot(); - coreSetup = await kbnRoot.setup(); - FileServiceFactory.setup(coreSetup.savedObjects); + await kbnRoot.setup(); coreStart = await kbnRoot.start(); setFileKindsRegistry(new FileKindsRegistryImpl()); const fileKindsRegistry = getFileKindsRegistry(); diff --git a/src/plugins/files/server/mocks.ts b/src/plugins/files/server/mocks.ts new file mode 100644 index 0000000000000..60f0b5c38ee8d --- /dev/null +++ b/src/plugins/files/server/mocks.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { KibanaRequest } from '@kbn/core/server'; +import { DeeplyMockedKeys } from '@kbn/utility-types-jest'; +import * as stream from 'stream'; +import { File } from '../common'; +import { FileClient, FileServiceFactory, FileServiceStart } from '.'; + +export const createFileServiceMock = (): DeeplyMockedKeys<FileServiceStart> => ({ + create: jest.fn(), + delete: jest.fn(), + deleteShareObject: jest.fn(), + find: jest.fn(), + getById: jest.fn(), + getByToken: jest.fn(), + getShareObject: jest.fn(), + getUsageMetrics: jest.fn(), + listShareObjects: jest.fn(), + update: jest.fn(), + updateShareObject: jest.fn(), +}); + +export const createFileServiceFactoryMock = (): DeeplyMockedKeys<FileServiceFactory> => ({ + asInternal: jest.fn(createFileServiceMock), + asScoped: jest.fn((_: KibanaRequest) => createFileServiceMock()), +}); + +export const createFileMock = (): DeeplyMockedKeys<File> => { + const fileMock: DeeplyMockedKeys<File> = { + id: '123', + data: { + id: '123', + created: '2022-10-10T14:57:30.682Z', + updated: '2022-10-19T14:43:20.112Z', + name: 'test.txt', + mimeType: 'text/plain', + size: 1234, + extension: '.txt', + meta: {}, + alt: undefined, + fileKind: 'none', + status: 'READY', + }, + update: jest.fn(), + uploadContent: jest.fn(), + downloadContent: jest.fn().mockResolvedValue(new stream.Readable()), + delete: jest.fn(), + share: jest.fn(), + listShares: jest.fn(), + unshare: jest.fn(), + toJSON: jest.fn(), + }; + + fileMock.update.mockResolvedValue(fileMock); + fileMock.uploadContent.mockResolvedValue(fileMock); + + return fileMock; +}; + +export const createFileClientMock = (): DeeplyMockedKeys<FileClient> => { + const fileMock = createFileMock(); + + return { + fileKind: 'none', + create: jest.fn().mockResolvedValue(fileMock), + get: jest.fn().mockResolvedValue(fileMock), + update: jest.fn(), + delete: jest.fn(), + find: jest.fn().mockResolvedValue({ files: [fileMock], total: 1 }), + share: jest.fn(), + unshare: jest.fn(), + listShares: jest.fn().mockResolvedValue({ shares: [] }), + }; +}; diff --git a/src/plugins/files/server/plugin.ts b/src/plugins/files/server/plugin.ts new file mode 100755 index 0000000000000..7edd42985b616 --- /dev/null +++ b/src/plugins/files/server/plugin.ts @@ -0,0 +1,113 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { + PluginInitializerContext, + CoreSetup, + Plugin, + Logger, + CoreStart, +} from '@kbn/core/server'; + +import { PLUGIN_ID } from '../common/constants'; +import { + setFileKindsRegistry, + getFileKindsRegistry, + FileKindsRegistryImpl, +} from '../common/file_kinds_registry'; + +import { BlobStorageService } from './blob_storage_service'; +import { FileServiceFactory } from './file_service'; +import type { + FilesPluginSetupDependencies, + FilesPluginStartDependencies, + FilesSetup, + FilesStart, +} from './types'; + +import type { FilesRequestHandlerContext, FilesRouter } from './routes/types'; +import { registerRoutes, registerFileKindRoutes } from './routes'; +import { Counters, registerUsageCollector } from './usage'; + +export class FilesPlugin implements Plugin<FilesSetup, FilesStart, FilesPluginSetupDependencies> { + private readonly logger: Logger; + private fileServiceFactory: undefined | FileServiceFactory; + private securitySetup: FilesPluginSetupDependencies['security']; + private securityStart: FilesPluginStartDependencies['security']; + + constructor(initializerContext: PluginInitializerContext) { + this.logger = initializerContext.logger.get(); + } + + public setup( + core: CoreSetup, + { security, usageCollection }: FilesPluginSetupDependencies + ): FilesSetup { + const usageCounter = usageCollection?.createUsageCounter(PLUGIN_ID); + FileServiceFactory.setup(core.savedObjects, usageCounter); + this.securitySetup = security; + + core.http.registerRouteHandlerContext<FilesRequestHandlerContext, typeof PLUGIN_ID>( + PLUGIN_ID, + async (ctx, req) => { + return { + security: this.securityStart, + fileService: { + asCurrentUser: () => this.fileServiceFactory!.asScoped(req), + asInternalUser: () => this.fileServiceFactory!.asInternal(), + logger: this.logger.get('files-routes'), + usageCounter: usageCounter + ? (counter: Counters) => usageCounter.incrementCounter({ counterName: counter }) + : undefined, + }, + }; + } + ); + + const router: FilesRouter = core.http.createRouter(); + registerRoutes(router); + setFileKindsRegistry( + new FileKindsRegistryImpl((fk) => { + registerFileKindRoutes(router, fk); + }) + ); + registerUsageCollector({ + usageCollection, + getFileService: () => this.fileServiceFactory?.asInternal(), + }); + + return { + registerFileKind(fileKind) { + getFileKindsRegistry().register(fileKind); + }, + }; + } + + public start(coreStart: CoreStart, { security }: FilesPluginStartDependencies): FilesStart { + const { savedObjects } = coreStart; + this.securityStart = security; + const esClient = coreStart.elasticsearch.client.asInternalUser; + const blobStorageService = new BlobStorageService( + esClient, + this.logger.get('blob-storage-service') + ); + this.fileServiceFactory = new FileServiceFactory( + savedObjects, + blobStorageService, + this.securitySetup, + getFileKindsRegistry(), + this.logger.get('files-service') + ); + + return { + fileServiceFactory: this.fileServiceFactory, + }; + } + + public stop() {} +} diff --git a/src/plugins/files/server/routes/api_routes.ts b/src/plugins/files/server/routes/api_routes.ts new file mode 100644 index 0000000000000..1c0df1808f22b --- /dev/null +++ b/src/plugins/files/server/routes/api_routes.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + FILES_API_BASE_PATH, + FILES_SHARE_API_BASE_PATH, + FILES_PUBLIC_API_BASE_PATH, + API_BASE_PATH, +} from '../../common/api_routes'; + +export * from '../../common/api_routes'; + +export const FILES_API_ROUTES = { + find: `${API_BASE_PATH}/find`, + metrics: `${API_BASE_PATH}/metrics`, + public: { + download: `${FILES_PUBLIC_API_BASE_PATH}/blob/{fileName?}`, + }, + fileKind: { + getCreateFileRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}`, + getUploadRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}/{id}/blob`, + getDownloadRoute: (fileKind: string) => + `${FILES_API_BASE_PATH}/${fileKind}/{id}/blob/{fileName?}`, + getUpdateRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}/{id}`, + getDeleteRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}/{id}`, + getListRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}/list`, + getByIdRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}/{id}`, + getShareRoute: (fileKind: string) => `${FILES_SHARE_API_BASE_PATH}/${fileKind}/{fileId}`, + getUnshareRoute: (fileKind: string) => `${FILES_SHARE_API_BASE_PATH}/${fileKind}/{id}`, + getGetShareRoute: (fileKind: string) => `${FILES_SHARE_API_BASE_PATH}/${fileKind}/{id}`, + getListShareRoute: (fileKind: string) => `${FILES_SHARE_API_BASE_PATH}/${fileKind}`, + }, +}; diff --git a/x-pack/plugins/files/server/routes/common.test.ts b/src/plugins/files/server/routes/common.test.ts similarity index 91% rename from x-pack/plugins/files/server/routes/common.test.ts rename to src/plugins/files/server/routes/common.test.ts index 1f9292e3ff07a..3b10adb5226f9 100644 --- a/x-pack/plugins/files/server/routes/common.test.ts +++ b/src/plugins/files/server/routes/common.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { File } from '../file'; diff --git a/src/plugins/files/server/routes/common.ts b/src/plugins/files/server/routes/common.ts new file mode 100644 index 0000000000000..aba84ee6487ec --- /dev/null +++ b/src/plugins/files/server/routes/common.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import mime from 'mime'; +import type { ResponseHeaders } from '@kbn/core/server'; +import type { File } from '../../common/types'; + +interface Args { + file: File; + fileName?: string; +} + +export function getDownloadHeadersForFile({ file, fileName }: Args): ResponseHeaders { + return { + 'content-type': + (fileName && mime.getType(fileName)) ?? file.data.mimeType ?? 'application/octet-stream', + // Note, this name can be overridden by the client if set via a "download" attribute on the HTML tag. + 'content-disposition': `attachment; filename="${fileName || getDownloadedFileName(file)}"`, + 'cache-control': 'max-age=31536000, immutable', + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options + 'x-content-type-options': 'nosniff', + }; +} + +export function getDownloadedFileName(file: File): string { + // When creating a file we also calculate the extension so the `file.extension` + // check is not really necessary except for type checking. + if (file.data.mimeType && file.data.extension) { + return `${file.data.name}.${file.data.extension}`; + } + return file.data.name; +} diff --git a/x-pack/plugins/files/server/routes/common_schemas.ts b/src/plugins/files/server/routes/common_schemas.ts similarity index 78% rename from x-pack/plugins/files/server/routes/common_schemas.ts rename to src/plugins/files/server/routes/common_schemas.ts index 6f9b6a5d651a0..3f99f1cca8059 100644 --- a/x-pack/plugins/files/server/routes/common_schemas.ts +++ b/src/plugins/files/server/routes/common_schemas.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; @@ -42,4 +43,7 @@ export const fileAlt = schema.maybe( }) ); +export const page = schema.number({ min: 1, defaultValue: 1 }); +export const pageSize = schema.number({ min: 1, defaultValue: 100 }); + export const fileMeta = schema.maybe(schema.object({}, { unknowns: 'allow' })); diff --git a/src/plugins/files/server/routes/file_kind/create.ts b/src/plugins/files/server/routes/file_kind/create.ts new file mode 100644 index 0000000000000..d654b2c8c1c44 --- /dev/null +++ b/src/plugins/files/server/routes/file_kind/create.ts @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; +import type { FileJSON, FileKind } from '../../../common/types'; +import { CreateRouteDefinition, FILES_API_ROUTES } from '../api_routes'; +import type { FileKindRouter } from './types'; +import * as commonSchemas from '../common_schemas'; +import { CreateHandler } from './types'; + +export const method = 'post' as const; + +const rt = { + body: schema.object({ + name: commonSchemas.fileName, + alt: commonSchemas.fileAlt, + meta: commonSchemas.fileMeta, + mimeType: schema.maybe(schema.string()), + }), +}; + +export type Endpoint<M = unknown> = CreateRouteDefinition<typeof rt, { file: FileJSON<M> }>; + +export const handler: CreateHandler<Endpoint> = async ({ fileKind, files }, req, res) => { + const { fileService, security } = await files; + const { + body: { name, alt, meta, mimeType }, + } = req; + const user = security?.authc.getCurrentUser(req); + const file = await fileService.asCurrentUser().create({ + fileKind, + name, + alt, + meta, + user: user ? { name: user.username, id: user.profile_uid } : undefined, + mime: mimeType, + }); + const body: Endpoint['output'] = { + file: file.toJSON(), + }; + return res.ok({ body }); +}; + +export function register(fileKindRouter: FileKindRouter, fileKind: FileKind) { + if (fileKind.http.create) { + fileKindRouter[method]( + { + path: FILES_API_ROUTES.fileKind.getCreateFileRoute(fileKind.id), + validate: { + ...rt, + }, + options: { + tags: fileKind.http.create.tags, + }, + }, + handler + ); + } +} diff --git a/x-pack/plugins/files/server/routes/file_kind/delete.ts b/src/plugins/files/server/routes/file_kind/delete.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/delete.ts rename to src/plugins/files/server/routes/file_kind/delete.ts index ec23525f2686a..da7bb7bade214 100644 --- a/x-pack/plugins/files/server/routes/file_kind/delete.ts +++ b/src/plugins/files/server/routes/file_kind/delete.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/src/plugins/files/server/routes/file_kind/download.ts b/src/plugins/files/server/routes/file_kind/download.ts new file mode 100644 index 0000000000000..4776d37485c93 --- /dev/null +++ b/src/plugins/files/server/routes/file_kind/download.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; +import { Readable } from 'stream'; + +import type { FileKind } from '../../../common/types'; +import { fileNameWithExt } from '../common_schemas'; +import { fileErrors } from '../../file'; +import { getDownloadHeadersForFile } from '../common'; +import { getById } from './helpers'; +import type { CreateHandler, FileKindRouter } from './types'; +import { CreateRouteDefinition, FILES_API_ROUTES } from '../api_routes'; + +export const method = 'get' as const; + +const rt = { + params: schema.object({ + id: schema.string(), + fileName: schema.maybe(fileNameWithExt), + }), +}; + +export type Endpoint = CreateRouteDefinition<typeof rt, any>; + +type Response = Readable; + +export const handler: CreateHandler<Endpoint> = async ({ files, fileKind }, req, res) => { + const { fileService } = await files; + const { + params: { id, fileName }, + } = req; + const { error, result: file } = await getById(fileService.asCurrentUser(), id, fileKind); + if (error) return error; + try { + const body: Response = await file.downloadContent(); + return res.ok({ + body, + headers: getDownloadHeadersForFile({ file, fileName }), + }); + } catch (e) { + if (e instanceof fileErrors.NoDownloadAvailableError) { + return res.notFound({ body: { message: e.message } }); + } + throw e; + } +}; + +export function register(fileKindRouter: FileKindRouter, fileKind: FileKind) { + if (fileKind.http.download) { + fileKindRouter[method]( + { + path: FILES_API_ROUTES.fileKind.getDownloadRoute(fileKind.id), + validate: { ...rt }, + options: { + tags: fileKind.http.download.tags, + }, + }, + handler + ); + } +} diff --git a/x-pack/plugins/files/server/routes/file_kind/enhance_router.ts b/src/plugins/files/server/routes/file_kind/enhance_router.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/enhance_router.ts rename to src/plugins/files/server/routes/file_kind/enhance_router.ts index b2a4f58fb8fd1..87be1c4e08ea0 100644 --- a/x-pack/plugins/files/server/routes/file_kind/enhance_router.ts +++ b/src/plugins/files/server/routes/file_kind/enhance_router.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { RequestHandler, RouteMethod, RouteRegistrar } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/routes/file_kind/get_by_id.ts b/src/plugins/files/server/routes/file_kind/get_by_id.ts similarity index 88% rename from x-pack/plugins/files/server/routes/file_kind/get_by_id.ts rename to src/plugins/files/server/routes/file_kind/get_by_id.ts index 4d86e05564fdf..914d1e70b77d4 100644 --- a/x-pack/plugins/files/server/routes/file_kind/get_by_id.ts +++ b/src/plugins/files/server/routes/file_kind/get_by_id.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/helpers.ts b/src/plugins/files/server/routes/file_kind/helpers.ts similarity index 85% rename from x-pack/plugins/files/server/routes/file_kind/helpers.ts rename to src/plugins/files/server/routes/file_kind/helpers.ts index 12006fb87837b..4ec6afccebd75 100644 --- a/x-pack/plugins/files/server/routes/file_kind/helpers.ts +++ b/src/plugins/files/server/routes/file_kind/helpers.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { IKibanaResponse, kibanaResponseFactory } from '@kbn/core/server'; diff --git a/src/plugins/files/server/routes/file_kind/index.ts b/src/plugins/files/server/routes/file_kind/index.ts new file mode 100644 index 0000000000000..40649656790c3 --- /dev/null +++ b/src/plugins/files/server/routes/file_kind/index.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FileKind } from '../../../common/types'; + +import { FilesRouter } from '../types'; + +import { enhanceRouter } from './enhance_router'; + +import * as create from './create'; +import * as upload from './upload'; +import * as update from './update'; +import * as deleteEndpoint from './delete'; +import * as list from './list'; +import * as download from './download'; +import * as getById from './get_by_id'; +import * as share from './share/share'; +import * as unshare from './share/unshare'; +import * as listShare from './share/list'; +import * as getShare from './share/get'; + +/** + * Register a single file kind's routes + */ +export function registerFileKindRoutes(router: FilesRouter, fileKind: FileKind) { + const fileKindRouter = enhanceRouter({ router, fileKind: fileKind.id }); + [ + create, + upload, + update, + deleteEndpoint, + list, + download, + getById, + share, + unshare, + getShare, + listShare, + ].forEach((route) => { + route.register(fileKindRouter, fileKind); + }); +} diff --git a/x-pack/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts b/src/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts rename to src/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts index 6acd1e3317344..c53783e28602d 100644 --- a/x-pack/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts +++ b/src/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { UpdatableFileMetadata } from '../../../../common/types'; @@ -39,6 +40,9 @@ describe('File kind HTTP API', () => { mimeType: 'image/png', extension: 'png', meta: {}, + user: { + name: expect.any(String), + }, alt: 'a picture of my dog', }); }); @@ -80,7 +84,7 @@ describe('File kind HTTP API', () => { } = await request.get(root, `/api/files/files/${fileKind}/${id}`).expect(200); expect(file.name).toBe('acoolfilename'); - const updatedFileAttrs: UpdatableFileMetadata = { + const updatedFileAttrs: UpdatableFileMetadata<{ something: string }> = { name: 'anothercoolfilename', alt: 'a picture of my cat', meta: { @@ -88,20 +92,24 @@ describe('File kind HTTP API', () => { }, }; - const { - body: { file: updatedFile }, - } = await request - .patch(root, `/api/files/files/${fileKind}/${id}`) - .send(updatedFileAttrs) - .expect(200); + { + const { + body: { file: updatedFile }, + } = await request + .patch(root, `/api/files/files/${fileKind}/${id}`) + .send(updatedFileAttrs) + .expect(200); - expect(updatedFile).toEqual(expect.objectContaining(updatedFileAttrs)); + expect(updatedFile).toMatchObject(updatedFileAttrs); + } - const { - body: { file: file2 }, - } = await request.get(root, `/api/files/files/${fileKind}/${id}`).expect(200); + { + const { + body: { file: updatedFile }, + } = await request.get(root, `/api/files/files/${fileKind}/${id}`).expect(200); - expect(file2).toEqual(expect.objectContaining(updatedFileAttrs)); + expect(updatedFile).toMatchObject(updatedFileAttrs); + } }); test('list current files', async () => { diff --git a/src/plugins/files/server/routes/file_kind/list.ts b/src/plugins/files/server/routes/file_kind/list.ts new file mode 100644 index 0000000000000..54d8e98fc24f6 --- /dev/null +++ b/src/plugins/files/server/routes/file_kind/list.ts @@ -0,0 +1,71 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; +import type { FileJSON, FileKind } from '../../../common/types'; +import { CreateRouteDefinition, FILES_API_ROUTES } from '../api_routes'; +import * as cs from '../common_schemas'; +import type { CreateHandler, FileKindRouter } from './types'; +import { + stringOrArrayOfStrings, + nameStringOrArrayOfNameStrings, + toArrayOrUndefined, +} from '../find'; + +export const method = 'post' as const; + +const rt = { + body: schema.object({ + status: schema.maybe(stringOrArrayOfStrings), + extension: schema.maybe(stringOrArrayOfStrings), + name: schema.maybe(nameStringOrArrayOfNameStrings), + meta: schema.maybe(schema.object({}, { unknowns: 'allow' })), + }), + query: schema.object({ + page: schema.maybe(cs.page), + perPage: schema.maybe(cs.pageSize), + }), +}; + +export type Endpoint<M = unknown> = CreateRouteDefinition< + typeof rt, + { files: Array<FileJSON<M>>; total: number } +>; + +export const handler: CreateHandler<Endpoint> = async ({ files, fileKind }, req, res) => { + const { + body: { name, status, extension, meta }, + query: { page, perPage }, + } = req; + const { fileService } = await files; + const body: Endpoint['output'] = await fileService.asCurrentUser().find({ + kind: [fileKind], + name: toArrayOrUndefined(name), + status: toArrayOrUndefined(status), + extension: toArrayOrUndefined(extension), + page, + perPage, + meta, + }); + return res.ok({ body }); +}; + +export function register(fileKindRouter: FileKindRouter, fileKind: FileKind) { + if (fileKind.http.list) { + fileKindRouter[method]( + { + path: FILES_API_ROUTES.fileKind.getListRoute(fileKind.id), + validate: { ...rt }, + options: { + tags: fileKind.http.list.tags, + }, + }, + handler + ); + } +} diff --git a/x-pack/plugins/files/server/routes/file_kind/share/get.ts b/src/plugins/files/server/routes/file_kind/share/get.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/share/get.ts rename to src/plugins/files/server/routes/file_kind/share/get.ts index b39e7c2ccbc92..07e00d4ad800b 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/get.ts +++ b/src/plugins/files/server/routes/file_kind/share/get.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import { FileShareNotFoundError } from '../../../file_share_service/errors'; diff --git a/src/plugins/files/server/routes/file_kind/share/list.ts b/src/plugins/files/server/routes/file_kind/share/list.ts new file mode 100644 index 0000000000000..470102cb815f0 --- /dev/null +++ b/src/plugins/files/server/routes/file_kind/share/list.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; + +import { CreateRouteDefinition, FILES_API_ROUTES } from '../../api_routes'; +import type { FileKind, FileShareJSON } from '../../../../common/types'; +import { CreateHandler, FileKindRouter } from '../types'; +import * as cs from '../../common_schemas'; + +export const method = 'get' as const; + +const rt = { + query: schema.object({ + page: schema.maybe(cs.page), + perPage: schema.maybe(cs.pageSize), + forFileId: schema.maybe(schema.string()), + }), +}; + +export type Endpoint = CreateRouteDefinition<typeof rt, { shares: FileShareJSON[] }>; + +export const handler: CreateHandler<Endpoint> = async ({ files }, req, res) => { + const { fileService } = await files; + const { + query: { forFileId, page, perPage }, + } = req; + + const result = await fileService + .asCurrentUser() + .listShareObjects({ fileId: forFileId, page, perPage }); + + const body: Endpoint['output'] = result; + return res.ok({ + body, + }); +}; + +export function register(fileKindRouter: FileKindRouter, fileKind: FileKind) { + if (fileKind.http.share) { + fileKindRouter[method]( + { + path: FILES_API_ROUTES.fileKind.getListShareRoute(fileKind.id), + validate: { ...rt }, + options: { + tags: fileKind.http.share.tags, + }, + }, + handler + ); + } +} diff --git a/x-pack/plugins/files/server/routes/file_kind/share/share.ts b/src/plugins/files/server/routes/file_kind/share/share.ts similarity index 92% rename from x-pack/plugins/files/server/routes/file_kind/share/share.ts rename to src/plugins/files/server/routes/file_kind/share/share.ts index f4c8f660e080b..3d3c5adb53e70 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/share.ts +++ b/src/plugins/files/server/routes/file_kind/share/share.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import { ExpiryDateInThePastError } from '../../../file_share_service/errors'; import { CreateHandler, FileKindRouter } from '../types'; diff --git a/x-pack/plugins/files/server/routes/file_kind/share/unshare.ts b/src/plugins/files/server/routes/file_kind/share/unshare.ts similarity index 88% rename from x-pack/plugins/files/server/routes/file_kind/share/unshare.ts rename to src/plugins/files/server/routes/file_kind/share/unshare.ts index 49e59898433b1..a41f5db8a5970 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/unshare.ts +++ b/src/plugins/files/server/routes/file_kind/share/unshare.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import { CreateRouteDefinition, FILES_API_ROUTES } from '../../api_routes'; diff --git a/src/plugins/files/server/routes/file_kind/types.ts b/src/plugins/files/server/routes/file_kind/types.ts new file mode 100644 index 0000000000000..c82b097d7472c --- /dev/null +++ b/src/plugins/files/server/routes/file_kind/types.ts @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { IRouter, RequestHandler } from '@kbn/core/server'; +import { AnyEndpoint } from '../api_routes'; +import type { FilesRequestHandlerContext } from '../types'; + +export type FileKindRouter = IRouter<FileKindsRequestHandlerContext>; + +export interface FileKindsRequestHandlerContext extends FilesRequestHandlerContext { + fileKind: string; +} + +export type FileKindsRequestHandler<P = unknown, Q = unknown, B = unknown> = RequestHandler< + P, + Q, + B, + FileKindsRequestHandlerContext +>; + +export type CreateHandler<E extends AnyEndpoint> = FileKindsRequestHandler< + E['inputs']['params'], + E['inputs']['query'], + E['inputs']['body'] +>; diff --git a/x-pack/plugins/files/server/routes/file_kind/update.ts b/src/plugins/files/server/routes/file_kind/update.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/update.ts rename to src/plugins/files/server/routes/file_kind/update.ts index 9621fc56c311c..048e846322c5b 100644 --- a/x-pack/plugins/files/server/routes/file_kind/update.ts +++ b/src/plugins/files/server/routes/file_kind/update.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/upload.test.ts b/src/plugins/files/server/routes/file_kind/upload.test.ts similarity index 93% rename from x-pack/plugins/files/server/routes/file_kind/upload.test.ts rename to src/plugins/files/server/routes/file_kind/upload.test.ts index 59a906f5ea988..49a207ea80345 100644 --- a/x-pack/plugins/files/server/routes/file_kind/upload.test.ts +++ b/src/plugins/files/server/routes/file_kind/upload.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Readable } from 'stream'; diff --git a/x-pack/plugins/files/server/routes/file_kind/upload.ts b/src/plugins/files/server/routes/file_kind/upload.ts similarity index 94% rename from x-pack/plugins/files/server/routes/file_kind/upload.ts rename to src/plugins/files/server/routes/file_kind/upload.ts index 10c230de469b9..88ef492ba11fb 100644 --- a/x-pack/plugins/files/server/routes/file_kind/upload.ts +++ b/src/plugins/files/server/routes/file_kind/upload.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/find.ts b/src/plugins/files/server/routes/find.ts similarity index 79% rename from x-pack/plugins/files/server/routes/find.ts rename to src/plugins/files/server/routes/find.ts index 4f5a6da46b455..4ad1deaceb076 100644 --- a/x-pack/plugins/files/server/routes/find.ts +++ b/src/plugins/files/server/routes/find.ts @@ -1,13 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import type { CreateHandler, FilesRouter } from './types'; import { FileJSON } from '../../common'; +import { FILES_MANAGE_PRIVILEGE } from '../../common/constants'; import { FILES_API_ROUTES, CreateRouteDefinition } from './api_routes'; +import { page, pageSize } from './common_schemas'; const method = 'post' as const; @@ -31,8 +35,8 @@ const rt = { meta: schema.maybe(schema.object({}, { unknowns: 'allow' })), }), query: schema.object({ - page: schema.maybe(schema.number()), - perPage: schema.maybe(schema.number({ defaultValue: 100 })), + page: schema.maybe(page), + perPage: schema.maybe(pageSize), }), }; @@ -63,16 +67,14 @@ const handler: CreateHandler<Endpoint> = async ({ files }, req, res) => { }); }; -// TODO: Find out whether we want to add stricter access controls to this route. -// Currently this is giving read-access to all files which bypasses the -// security we set up on a per route level for the "getById" and "list" endpoints. -// Alternatively, we can remove the access controls on the "file kind" endpoints -// or remove them entirely. export function register(router: FilesRouter) { router[method]( { path: FILES_API_ROUTES.find, validate: { ...rt }, + options: { + tags: [`access:${FILES_MANAGE_PRIVILEGE}`], + }, }, handler ); diff --git a/src/plugins/files/server/routes/index.ts b/src/plugins/files/server/routes/index.ts new file mode 100644 index 0000000000000..69565ebc8492e --- /dev/null +++ b/src/plugins/files/server/routes/index.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FilesRouter } from './types'; + +import * as find from './find'; +import * as metrics from './metrics'; +import * as publicDownload from './public_facing/download'; + +export { registerFileKindRoutes } from './file_kind'; + +export function registerRoutes(router: FilesRouter) { + [find, metrics, publicDownload].forEach((endpoint) => { + endpoint.register(router); + }); +} diff --git a/x-pack/plugins/files/server/routes/integration_tests/routes.test.ts b/src/plugins/files/server/routes/integration_tests/routes.test.ts similarity index 97% rename from x-pack/plugins/files/server/routes/integration_tests/routes.test.ts rename to src/plugins/files/server/routes/integration_tests/routes.test.ts index a01f377a0364b..b7cfb34e0638d 100644 --- a/x-pack/plugins/files/server/routes/integration_tests/routes.test.ts +++ b/src/plugins/files/server/routes/integration_tests/routes.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { CreateFileKindHttpEndpoint } from '../../../common/api_routes'; diff --git a/src/plugins/files/server/routes/metrics.ts b/src/plugins/files/server/routes/metrics.ts new file mode 100644 index 0000000000000..6e3a63b7b67c6 --- /dev/null +++ b/src/plugins/files/server/routes/metrics.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FILES_MANAGE_PRIVILEGE } from '../../common/constants'; +import type { FilesRouter } from './types'; + +import { FilesMetrics } from '../../common'; +import { CreateRouteDefinition, FILES_API_ROUTES } from './api_routes'; +import type { FilesRequestHandler } from './types'; + +const method = 'get' as const; + +export type Endpoint = CreateRouteDefinition<{}, FilesMetrics>; + +const handler: FilesRequestHandler = async ({ files }, req, res) => { + const { fileService } = await files; + const body: Endpoint['output'] = await fileService.asCurrentUser().getUsageMetrics(); + return res.ok({ + body, + }); +}; + +export function register(router: FilesRouter) { + router[method]( + { + path: FILES_API_ROUTES.metrics, + validate: {}, + options: { + tags: [`access:${FILES_MANAGE_PRIVILEGE}`], + }, + }, + handler + ); +} diff --git a/src/plugins/files/server/routes/public_facing/download.ts b/src/plugins/files/server/routes/public_facing/download.ts new file mode 100644 index 0000000000000..1635f9a7d39fd --- /dev/null +++ b/src/plugins/files/server/routes/public_facing/download.ts @@ -0,0 +1,79 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; +import { Readable } from 'stream'; +import { NoDownloadAvailableError } from '../../file/errors'; +import { FileNotFoundError } from '../../file_service/errors'; +import { + FileShareNotFoundError, + FileShareTokenInvalidError, +} from '../../file_share_service/errors'; +import type { FilesRouter } from '../types'; +import { CreateRouteDefinition, FILES_API_ROUTES } from '../api_routes'; +import { getDownloadHeadersForFile } from '../common'; +import { fileNameWithExt } from '../common_schemas'; +import { CreateHandler } from '../types'; + +const method = 'get' as const; + +const rt = { + query: schema.object({ + token: schema.string(), + }), + params: schema.object({ + fileName: schema.maybe(fileNameWithExt), + }), +}; + +export type Endpoint = CreateRouteDefinition<typeof rt, any>; + +const handler: CreateHandler<Endpoint> = async ({ files }, req, res) => { + const { fileService } = await files; + const { + query: { token }, + params: { fileName }, + } = req; + + try { + const file = await fileService.asInternalUser().getByToken(token); + const body: Readable = await file.downloadContent(); + return res.ok({ + body, + headers: getDownloadHeadersForFile({ file, fileName }), + }); + } catch (e) { + if ( + e instanceof FileNotFoundError || + e instanceof FileShareNotFoundError || + e instanceof FileShareTokenInvalidError + ) { + return res.badRequest({ body: { message: 'Invalid token' } }); + } + if (e instanceof NoDownloadAvailableError) { + return res.badRequest({ + body: { message: 'No download available. Try uploading content to the file first.' }, + }); + } + + throw e; + } +}; + +export function register(router: FilesRouter) { + router[method]( + { + path: FILES_API_ROUTES.public.download, + validate: { ...rt }, + options: { + authRequired: false, + }, + }, + handler + ); +} diff --git a/x-pack/plugins/files/server/routes/test_utils.ts b/src/plugins/files/server/routes/test_utils.ts similarity index 82% rename from x-pack/plugins/files/server/routes/test_utils.ts rename to src/plugins/files/server/routes/test_utils.ts index 3ec4233fbcbf4..58f00ddbab0fc 100644 --- a/x-pack/plugins/files/server/routes/test_utils.ts +++ b/src/plugins/files/server/routes/test_utils.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { loggingSystemMock } from '@kbn/core/server/mocks'; diff --git a/src/plugins/files/server/routes/types.ts b/src/plugins/files/server/routes/types.ts new file mode 100644 index 0000000000000..1c803c71b78c0 --- /dev/null +++ b/src/plugins/files/server/routes/types.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { + RequestHandlerContext, + IRouter, + RequestHandler, + RouteMethod, + KibanaResponseFactory, + IKibanaResponse, + Logger, +} from '@kbn/core/server'; +import type { SecurityPluginStart } from '@kbn/security-plugin/server'; +import type { FileServiceStart } from '../file_service'; +import { Counters } from '../usage'; +import { AnyEndpoint } from './api_routes'; + +export interface FilesRequestHandlerContext extends RequestHandlerContext { + files: Promise<{ + security?: SecurityPluginStart; + fileService: { + asCurrentUser: () => FileServiceStart; + asInternalUser: () => FileServiceStart; + logger: Logger; + usageCounter?: (counter: Counters) => void; + }; + }>; +} + +export type FilesRouter = IRouter<FilesRequestHandlerContext>; + +export type FilesRequestHandler< + P = unknown, + Q = unknown, + B = unknown, + Method extends RouteMethod = any +> = RequestHandler<P, Q, B, FilesRequestHandlerContext, Method, KibanaResponseFactory>; + +export type AsyncResponse<T> = Promise<IKibanaResponse<T>>; + +export type CreateHandler<E extends AnyEndpoint> = FilesRequestHandler< + E['inputs']['params'], + E['inputs']['query'], + E['inputs']['body'] +>; diff --git a/src/plugins/files/server/saved_objects/file.ts b/src/plugins/files/server/saved_objects/file.ts new file mode 100644 index 0000000000000..c4259e6d679c3 --- /dev/null +++ b/src/plugins/files/server/saved_objects/file.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { SavedObjectsType, SavedObjectsFieldMapping } from '@kbn/core/server'; +import { FILE_SO_TYPE } from '../../common'; +import type { FileMetadata } from '../../common'; + +type Properties = Record< + keyof Omit<FileMetadata, 'Alt' | 'Compression' | 'ChunkSize' | 'hash'>, + SavedObjectsFieldMapping +>; + +const properties: Properties = { + created: { + type: 'date', + }, + Updated: { + type: 'date', + }, + name: { + type: 'text', + }, + user: { + type: 'flattened', + }, + Status: { + type: 'keyword', + }, + mime_type: { + type: 'keyword', + }, + extension: { + type: 'keyword', + }, + size: { + type: 'long', + }, + Meta: { + type: 'flattened', + }, + FileKind: { + type: 'keyword', + }, +}; + +export const fileObjectType: SavedObjectsType<FileMetadata> = { + name: FILE_SO_TYPE, + hidden: true, + namespaceType: 'agnostic', + management: { + importableAndExportable: false, + }, + mappings: { + dynamic: false, + properties, + }, +}; diff --git a/x-pack/plugins/files/server/saved_objects/file_share.ts b/src/plugins/files/server/saved_objects/file_share.ts similarity index 84% rename from x-pack/plugins/files/server/saved_objects/file_share.ts rename to src/plugins/files/server/saved_objects/file_share.ts index e71253582b381..244a027e7f73c 100644 --- a/x-pack/plugins/files/server/saved_objects/file_share.ts +++ b/src/plugins/files/server/saved_objects/file_share.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { SavedObjectsFieldMapping, SavedObjectsType } from '@kbn/core/server'; diff --git a/src/plugins/files/server/saved_objects/index.ts b/src/plugins/files/server/saved_objects/index.ts new file mode 100644 index 0000000000000..c8c03781db99d --- /dev/null +++ b/src/plugins/files/server/saved_objects/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { fileObjectType } from './file'; +import { fileShareObjectType } from './file_share'; + +export const hiddenTypes = [fileObjectType.name, fileShareObjectType.name]; +export { fileObjectType, fileShareObjectType }; diff --git a/src/plugins/files/server/test_utils/index.ts b/src/plugins/files/server/test_utils/index.ts new file mode 100644 index 0000000000000..5e5b871cece12 --- /dev/null +++ b/src/plugins/files/server/test_utils/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { setupIntegrationEnvironment } from './setup_integration_environment'; +export type { TestEnvironmentUtils } from './setup_integration_environment'; diff --git a/x-pack/plugins/files/server/test_utils/setup_integration_environment.ts b/src/plugins/files/server/test_utils/setup_integration_environment.ts similarity index 92% rename from x-pack/plugins/files/server/test_utils/setup_integration_environment.ts rename to src/plugins/files/server/test_utils/setup_integration_environment.ts index 1c31649d1e8f2..e0c01ca8f0a6d 100644 --- a/x-pack/plugins/files/server/test_utils/setup_integration_environment.ts +++ b/src/plugins/files/server/test_utils/setup_integration_environment.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { defaults } from 'lodash'; @@ -20,11 +21,6 @@ export type TestEnvironmentUtils = Awaited<ReturnType<typeof setupIntegrationEnv export async function setupIntegrationEnvironment() { const fileKind: string = 'test-file-kind'; const testIndex = '.kibana-test-files'; - const testConfig = { - xpack: { - reporting: { enabled: false }, - }, - }; /** * Functionality to create files easily @@ -85,7 +81,7 @@ export async function setupIntegrationEnvironment() { */ const manageES = await startES(); - const root = createRootWithCorePlugins(testConfig, { oss: false }); + const root = createRootWithCorePlugins({}, { oss: false }); await root.preboot(); await root.setup(); diff --git a/src/plugins/files/server/types.ts b/src/plugins/files/server/types.ts new file mode 100644 index 0000000000000..25f6861d451d5 --- /dev/null +++ b/src/plugins/files/server/types.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import { FileKind } from '../common'; +import { FileServiceFactory } from './file_service/file_service_factory'; + +/** + * Files plugin setup contract + */ +export interface FilesSetup { + /** + * Register a {@link FileKind} which allows for specifying details about the files + * that will be uploaded. + * + * @param {FileKind} fileKind - the file kind to register + * + * @track-adoption + */ + registerFileKind(fileKind: FileKind): void; +} + +export interface FilesPluginSetupDependencies { + security?: SecurityPluginSetup; + usageCollection?: UsageCollectionSetup; +} + +export interface FilesPluginStartDependencies { + security?: SecurityPluginStart; +} + +/** + * Files plugin start contract + */ +export interface FilesStart { + /** + * Create an instance of {@link FileServiceStart}. + * + * @track-adoption + */ + fileServiceFactory: FileServiceFactory; +} diff --git a/x-pack/plugins/files/server/usage/counters.ts b/src/plugins/files/server/usage/counters.ts similarity index 84% rename from x-pack/plugins/files/server/usage/counters.ts rename to src/plugins/files/server/usage/counters.ts index 65287fe1cea26..22e6d4c62ce4b 100644 --- a/x-pack/plugins/files/server/usage/counters.ts +++ b/src/plugins/files/server/usage/counters.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export function getCounters(fileKind: string) { diff --git a/src/plugins/files/server/usage/index.ts b/src/plugins/files/server/usage/index.ts new file mode 100644 index 0000000000000..ea6cf7c35aa5d --- /dev/null +++ b/src/plugins/files/server/usage/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { registerUsageCollector } from './register_usage_collector'; +export type { Counters } from './counters'; +export { getCounters } from './counters'; diff --git a/x-pack/plugins/files/server/usage/integration_tests/usage.test.ts b/src/plugins/files/server/usage/integration_tests/usage.test.ts similarity index 91% rename from x-pack/plugins/files/server/usage/integration_tests/usage.test.ts rename to src/plugins/files/server/usage/integration_tests/usage.test.ts index 3e04dfcac0be1..0bccb869c822e 100644 --- a/x-pack/plugins/files/server/usage/integration_tests/usage.test.ts +++ b/src/plugins/files/server/usage/integration_tests/usage.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { setupIntegrationEnvironment, TestEnvironmentUtils } from '../../test_utils'; diff --git a/x-pack/plugins/files/server/usage/register_usage_collector.ts b/src/plugins/files/server/usage/register_usage_collector.ts similarity index 85% rename from x-pack/plugins/files/server/usage/register_usage_collector.ts rename to src/plugins/files/server/usage/register_usage_collector.ts index 7bbe8ff994365..35b6822cda70c 100644 --- a/x-pack/plugins/files/server/usage/register_usage_collector.ts +++ b/src/plugins/files/server/usage/register_usage_collector.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import type { FileServiceStart } from '../file_service'; import { filesSchema, FileKindUsageSchema } from './schema'; diff --git a/x-pack/plugins/files/server/usage/schema.ts b/src/plugins/files/server/usage/schema.ts similarity index 89% rename from x-pack/plugins/files/server/usage/schema.ts rename to src/plugins/files/server/usage/schema.ts index 9ee655ddcb18f..770a19e47424d 100644 --- a/x-pack/plugins/files/server/usage/schema.ts +++ b/src/plugins/files/server/usage/schema.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { MakeSchemaFrom } from '@kbn/usage-collection-plugin/server'; diff --git a/src/plugins/files/tsconfig.json b/src/plugins/files/tsconfig.json new file mode 100644 index 0000000000000..7b677de51dab0 --- /dev/null +++ b/src/plugins/files/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": ["common/**/*", "public/**/*", "server/**/*", ".storybook/**/*"], + "kbn_references": [ + { "path": "../../core/tsconfig.json" }, + { "path": "../usage_collection/tsconfig.json" }, + { "path": "../../../x-pack/plugins/security/tsconfig.json" }, + ] +} diff --git a/src/plugins/guided_onboarding/kibana.json b/src/plugins/guided_onboarding/kibana.json index 22a54e8dd3278..a7c1c3d217c1b 100755 --- a/src/plugins/guided_onboarding/kibana.json +++ b/src/plugins/guided_onboarding/kibana.json @@ -10,5 +10,5 @@ "server": true, "ui": true, "requiredBundles": ["kibanaReact"], - "optionalPlugins": [] + "optionalPlugins": ["cloud"] } diff --git a/src/plugins/guided_onboarding/public/components/guide_panel.styles.ts b/src/plugins/guided_onboarding/public/components/guide_panel.styles.ts index 1ba565c9caee0..f3c0d05458282 100644 --- a/src/plugins/guided_onboarding/public/components/guide_panel.styles.ts +++ b/src/plugins/guided_onboarding/public/components/guide_panel.styles.ts @@ -27,21 +27,27 @@ export const getGuidePanelStyles = (euiTheme: EuiThemeComputed) => ({ height: auto; animation: euiModal 350ms cubic-bezier(0.34, 1.61, 0.7, 1); box-shadow: none; - "@media only screen and (max-width: 574px)": { - right: 25px; - width: 100%; - }, + @media (max-width: ${euiTheme.breakpoint.s}px) { + right: 25px !important; + } `, flyoutBody: css` .euiFlyoutBody__overflowContent { width: 480px; padding-top: 10px; + @media (max-width: ${euiTheme.breakpoint.s}px) { + width: 100%; + } } `, flyoutFooter: css` border-radius: 0 0 6px 6px; - background: ${euiTheme.colors.ghost}; + background: transparent; padding: 24px 30px; `, + flyoutFooterLink: css` + color: ${euiTheme.colors.darkShade}; + font-weight: 400; + `, }, }); diff --git a/src/plugins/guided_onboarding/public/components/guide_panel.test.tsx b/src/plugins/guided_onboarding/public/components/guide_panel.test.tsx index 83a030b385994..da1931120d371 100644 --- a/src/plugins/guided_onboarding/public/components/guide_panel.test.tsx +++ b/src/plugins/guided_onboarding/public/components/guide_panel.test.tsx @@ -21,50 +21,50 @@ import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; const applicationMock = applicationServiceMock.createStartContract(); -const mockActiveSearchGuideState: GuideState = { - guideId: 'search', +const mockActiveTestGuideState: GuideState = { + guideId: 'testGuide', isActive: true, status: 'in_progress', steps: [ { - id: 'add_data', + id: 'step1', status: 'active', }, { - id: 'browse_docs', + id: 'step2', status: 'inactive', }, { - id: 'search_experience', + id: 'step3', status: 'inactive', }, ], }; -const mockInProgressSearchGuideState: GuideState = { - ...mockActiveSearchGuideState, +const mockInProgressTestGuideState: GuideState = { + ...mockActiveTestGuideState, steps: [ { - id: mockActiveSearchGuideState.steps[0].id, + ...mockActiveTestGuideState.steps[0], status: 'in_progress', }, - mockActiveSearchGuideState.steps[1], - mockActiveSearchGuideState.steps[2], + mockActiveTestGuideState.steps[1], + mockActiveTestGuideState.steps[2], ], }; -const mockReadyToCompleteSearchGuideState: GuideState = { - ...mockActiveSearchGuideState, +const mockReadyToCompleteTestGuideState: GuideState = { + ...mockActiveTestGuideState, steps: [ { - id: mockActiveSearchGuideState.steps[0].id, + ...mockActiveTestGuideState.steps[0], status: 'complete', }, { - id: mockActiveSearchGuideState.steps[1].id, + ...mockActiveTestGuideState.steps[1], status: 'ready_to_complete', }, - mockActiveSearchGuideState.steps[2], + mockActiveTestGuideState.steps[2], ], }; @@ -109,10 +109,21 @@ describe('Guided setup', () => { }); describe('Button component', () => { - // TODO check for the correct button behavior once https://github.com/elastic/kibana/issues/141129 is implemented - test.skip('should be disabled in there is no active guide', async () => { + test('should be hidden in there is no guide state', async () => { const { exists } = testBed; - expect(exists('disabledGuideButton')).toBe(true); + expect(exists('guideButton')).toBe(false); + expect(exists('guidePanel')).toBe(false); + }); + + test('should be hidden if the guide is not active', async () => { + const { component, exists } = testBed; + + await updateComponentWithState( + component, + { ...mockActiveTestGuideState, isActive: false }, + true + ); + expect(exists('guideButton')).toBe(false); expect(exists('guidePanel')).toBe(false); }); @@ -120,10 +131,9 @@ describe('Guided setup', () => { test('should be enabled if there is an active guide', async () => { const { exists, component, find } = testBed; - // Enable the "search" guide - await updateComponentWithState(component, mockActiveSearchGuideState, true); + // Enable the "test" guide + await updateComponentWithState(component, mockActiveTestGuideState, true); - expect(exists('disabledGuideButton')).toBe(false); expect(exists('guideButton')).toBe(true); expect(find('guideButton').text()).toEqual('Setup guide'); }); @@ -131,7 +141,7 @@ describe('Guided setup', () => { test('should show the step number in the button label if a step is active', async () => { const { component, find } = testBed; - await updateComponentWithState(component, mockInProgressSearchGuideState, true); + await updateComponentWithState(component, mockInProgressTestGuideState, true); expect(find('guideButton').text()).toEqual('Setup guide: step 1'); }); @@ -139,7 +149,7 @@ describe('Guided setup', () => { test('shows the step number in the button label if a step is ready to complete', async () => { const { component, find } = testBed; - await updateComponentWithState(component, mockReadyToCompleteSearchGuideState, true); + await updateComponentWithState(component, mockReadyToCompleteTestGuideState, true); expect(find('guideButton').text()).toEqual('Setup guide: step 2'); }); @@ -147,7 +157,7 @@ describe('Guided setup', () => { test('shows the manual completion popover if a step is ready to complete', async () => { const { component, exists } = testBed; - await updateComponentWithState(component, mockReadyToCompleteSearchGuideState, false); + await updateComponentWithState(component, mockReadyToCompleteTestGuideState, false); expect(exists('manualCompletionPopover')).toBe(true); }); @@ -155,7 +165,7 @@ describe('Guided setup', () => { test('shows no manual completion popover if a step is in progress', async () => { const { component, exists } = testBed; - await updateComponentWithState(component, mockInProgressSearchGuideState, false); + await updateComponentWithState(component, mockInProgressTestGuideState, false); expect(exists('manualCompletionPopoverPanel')).toBe(false); }); @@ -165,29 +175,29 @@ describe('Guided setup', () => { test('should be enabled if a guide is activated', async () => { const { exists, component, find } = testBed; - await updateComponentWithState(component, mockActiveSearchGuideState, true); + await updateComponentWithState(component, mockActiveTestGuideState, true); expect(exists('guidePanel')).toBe(true); expect(exists('guideProgress')).toBe(false); - expect(find('guidePanelStep').length).toEqual(guidesConfig.search.steps.length); + expect(find('guidePanelStep').length).toEqual(guidesConfig.testGuide.steps.length); }); test('should show the progress bar if the first step has been completed', async () => { const { component, exists } = testBed; - const mockCompleteSearchGuideState: GuideState = { - ...mockActiveSearchGuideState, + const mockCompleteTestGuideState: GuideState = { + ...mockActiveTestGuideState, steps: [ { - id: mockActiveSearchGuideState.steps[0].id, + ...mockActiveTestGuideState.steps[0], status: 'complete', }, - mockActiveSearchGuideState.steps[1], - mockActiveSearchGuideState.steps[2], + mockActiveTestGuideState.steps[1], + mockActiveTestGuideState.steps[2], ], }; - await updateComponentWithState(component, mockCompleteSearchGuideState, true); + await updateComponentWithState(component, mockCompleteTestGuideState, true); expect(exists('guidePanel')).toBe(true); expect(exists('guideProgress')).toBe(true); @@ -197,20 +207,20 @@ describe('Guided setup', () => { const { component, exists, find } = testBed; const readyToCompleteGuideState: GuideState = { - guideId: 'search', + guideId: 'testGuide', status: 'ready_to_complete', isActive: true, steps: [ { - id: 'add_data', + id: 'step1', status: 'complete', }, { - id: 'browse_docs', + id: 'step2', status: 'complete', }, { - id: 'search_experience', + id: 'step3', status: 'complete', }, ], @@ -220,17 +230,23 @@ describe('Guided setup', () => { expect(find('guideTitle').text()).toContain('Well done'); expect(find('guideDescription').text()).toContain( - `You've completed the Elastic Enterprise Search guide` + `You've completed the Elastic Testing example guide` ); - expect(exists('useElasticButton')).toBe(true); + expect(exists('onboarding--completeGuideButton--testGuide')).toBe(true); }); describe('Steps', () => { - const clickActiveStepButton = async () => { + const clickStepButton = async ({ + telemetryGuideId, + stepNumber, + }: { + telemetryGuideId: string; + stepNumber: number; + }) => { const { component, find } = testBed; await act(async () => { - find('activeStepButton').simulate('click'); + find(`onboarding--stepButton--${telemetryGuideId}--step${stepNumber}`).simulate('click'); }); component.update(); @@ -239,11 +255,11 @@ describe('Guided setup', () => { test('can start a step if step has not been started', async () => { const { component, find, exists } = testBed; - await updateComponentWithState(component, mockActiveSearchGuideState, true); + await updateComponentWithState(component, mockActiveTestGuideState, true); - expect(find('activeStepButton').text()).toEqual('Start'); + expect(find('onboarding--stepButton--testGuide--step1').text()).toEqual('Start'); - await clickActiveStepButton(); + await clickStepButton({ telemetryGuideId: 'testGuide', stepNumber: 1 }); expect(exists('guidePanel')).toBe(false); }); @@ -251,11 +267,11 @@ describe('Guided setup', () => { test('can continue a step if step is in progress', async () => { const { component, find, exists } = testBed; - await updateComponentWithState(component, mockInProgressSearchGuideState, true); + await updateComponentWithState(component, mockInProgressTestGuideState, true); - expect(find('activeStepButton').text()).toEqual('Continue'); + expect(find('onboarding--stepButton--testGuide--step1').text()).toEqual('Continue'); - await clickActiveStepButton(); + await clickStepButton({ telemetryGuideId: 'testGuide', stepNumber: 1 }); expect(exists('guidePanel')).toBe(false); }); @@ -263,36 +279,36 @@ describe('Guided setup', () => { test('can mark a step "done" if step is ready to complete', async () => { const { component, find, exists } = testBed; - await updateComponentWithState(component, mockReadyToCompleteSearchGuideState, true); + await updateComponentWithState(component, mockReadyToCompleteTestGuideState, true); - expect(find('activeStepButton').text()).toEqual('Mark done'); + expect(find('onboarding--stepButton--testGuide--step2').text()).toEqual('Mark done'); - await clickActiveStepButton(); + await clickStepButton({ telemetryGuideId: 'testGuide', stepNumber: 2 }); // The guide panel should remain open after marking a step done expect(exists('guidePanel')).toBe(true); - // Dependent on the Search guide config, which expects another step to start - expect(find('activeStepButton').text()).toEqual('Start'); + // Dependent on the Search guide config, which expects step 3 to start + expect(find('onboarding--stepButton--testGuide--step3').text()).toEqual('Start'); }); test('should render the step description as a paragraph if it is only one sentence', async () => { const { component, find } = testBed; const mockSingleSentenceStepDescriptionGuideState: GuideState = { - guideId: 'observability', + guideId: 'testGuide', isActive: true, status: 'in_progress', steps: [ { - id: 'add_data', + id: 'step1', status: 'complete', }, { - id: 'view_dashboard', + id: 'step2', status: 'complete', }, { - id: 'tour_observability', + id: 'step3', status: 'in_progress', }, ], @@ -307,23 +323,21 @@ describe('Guided setup', () => { expect( find('guidePanelStepDescription') .last() - .containsMatchingElement( - <p>{guidesConfig.observability.steps[2].descriptionList[0]}</p> - ) + .containsMatchingElement(<p>{guidesConfig.testGuide.steps[2].description}</p>) ).toBe(true); }); test('should render the step description as an unordered list if it is more than one sentence', async () => { const { component, find } = testBed; - await updateComponentWithState(component, mockActiveSearchGuideState, true); + await updateComponentWithState(component, mockActiveTestGuideState, true); expect( find('guidePanelStepDescription') .first() .containsMatchingElement( <ul> - {guidesConfig.search.steps[0].descriptionList.map((description, i) => ( + {guidesConfig.testGuide.steps[0].descriptionList?.map((description, i) => ( <li key={i}>{description}</li> ))} </ul> @@ -337,8 +351,8 @@ describe('Guided setup', () => { const { component, find, exists } = testBed; await act(async () => { - // Enable the "search" guide - await apiService.updateGuideState(mockActiveSearchGuideState, true); + // Enable the "test" guide + await apiService.updateGuideState(mockActiveTestGuideState, true); }); component.update(); @@ -349,19 +363,19 @@ describe('Guided setup', () => { component.update(); - expect(exists('quitGuideModal')).toBe(true); + expect(exists('onboarding--quitGuideModal')).toBe(true); }); test('quit a guide', async () => { const { component, find, exists } = testBed; await act(async () => { - find('confirmModalConfirmButton').simulate('click'); + find('onboarding--quitGuideButton--testGuide').simulate('click'); }); component.update(); - expect(exists('quitGuideModal')).toBe(false); + expect(exists('onboarding--quitGuideModal')).toBe(false); // TODO check for the correct button behavior once https://github.com/elastic/kibana/issues/141129 is implemented }); @@ -370,12 +384,12 @@ describe('Guided setup', () => { const { component, find, exists } = testBed; await act(async () => { - find('confirmModalCancelButton').simulate('click'); + find('onboarding--cancelQuitGuideButton--testGuide').simulate('click'); }); component.update(); - expect(exists('quitGuideModal')).toBe(false); + expect(exists('onboarding--quitGuideModal')).toBe(false); expect(exists('guideButton')).toBe(true); }); }); diff --git a/src/plugins/guided_onboarding/public/components/guide_panel.tsx b/src/plugins/guided_onboarding/public/components/guide_panel.tsx index ed021bc39c0ec..c81844bc0dbbf 100644 --- a/src/plugins/guided_onboarding/public/components/guide_panel.tsx +++ b/src/plugins/guided_onboarding/public/components/guide_panel.tsx @@ -27,11 +27,11 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; import { ApplicationStart } from '@kbn/core/public'; import type { GuideState, GuideStep as GuideStepStatus } from '@kbn/guided-onboarding'; +import { GuideId } from '@kbn/guided-onboarding'; import type { GuideConfig, StepConfig } from '../types'; import type { ApiService } from '../services/api'; @@ -59,6 +59,20 @@ const getProgress = (state?: GuideState): number => { return 0; }; +// Temporarily provide a different guide ID for telemetry purposes +// Should not be necessary once https://github.com/elastic/kibana/issues/144452 is addressed +const getTelemetryGuideId = (guideId: GuideId) => { + switch (guideId) { + case 'security': + return 'siem'; + case 'observability': + return 'kubernetes'; + case 'search': + default: + return guideId; + } +}; + export const GuidePanel = ({ api, application }: GuidePanelProps) => { const { euiTheme } = useEuiTheme(); const [isGuideOpen, setIsGuideOpen] = useState(false); @@ -140,13 +154,14 @@ export const GuidePanel = ({ api, application }: GuidePanelProps) => { // TODO handle loading, error state // https://github.com/elastic/kibana/issues/139799, https://github.com/elastic/kibana/issues/139798 - if (!guideConfig) { + if (!guideConfig || !guideState || !guideState.isActive) { // TODO button show/hide logic https://github.com/elastic/kibana/issues/141129 return null; } const stepsCompleted = getProgress(guideState); const isGuideReadyToComplete = guideState?.status === 'ready_to_complete'; + const telemetryGuideId = getTelemetryGuideId(guideState.guideId); return ( <> @@ -266,6 +281,7 @@ export const GuidePanel = ({ api, application }: GuidePanelProps) => { stepNumber={index + 1} handleButtonClick={() => handleStepButtonClick(stepState, step)} key={accordionId} + telemetryGuideId={telemetryGuideId} /> ); } @@ -277,7 +293,8 @@ export const GuidePanel = ({ api, application }: GuidePanelProps) => { <EuiButton onClick={() => completeGuide(guideConfig.completedGuideRedirectLocation)} fill - data-test-subj="useElasticButton" + // data-test-subj used for FS tracking and testing + data-test-subj={`onboarding--completeGuideButton--${telemetryGuideId}`} > {i18n.translate('guidedOnboarding.dropdownPanel.elasticButtonLabel', { defaultMessage: 'Continue using Elastic', @@ -290,64 +307,75 @@ export const GuidePanel = ({ api, application }: GuidePanelProps) => { </EuiFlyoutBody> <EuiFlyoutFooter css={styles.flyoutOverrides.flyoutFooter}> - <EuiFlexGroup direction="column" alignItems="center" gutterSize="xs"> - <EuiFlexItem> - <EuiButtonEmpty onClick={openQuitGuideModal} data-test-subj="quitGuideButton"> - {i18n.translate('guidedOnboarding.dropdownPanel.footer.exitGuideButtonLabel', { - defaultMessage: 'Quit setup guide', + <EuiFlexGroup + alignItems="center" + justifyContent="center" + gutterSize="xs" + responsive={false} + > + <EuiFlexItem grow={false}> + <EuiButtonEmpty + iconType="questionInCircle" + iconSide="right" + href="https://cloud.elastic.co/support " + target="_blank" + css={styles.flyoutOverrides.flyoutFooterLink} + iconSize="m" + > + {i18n.translate('guidedOnboarding.dropdownPanel.footer.support', { + defaultMessage: 'Need help?', })} </EuiButtonEmpty> </EuiFlexItem> - - <EuiFlexItem> - <EuiText color="subdued" textAlign="center"> - <FormattedMessage - id="guidedOnboarding.dropdownPanel.footer.feedbackDescription" - defaultMessage="How's onboarding? We’d love your {feedbackLink}" - values={{ - feedbackLink: ( - <EuiLink - href="https://www.elastic.co/kibana/feedback" - target="_blank" - external - > - {i18n.translate('guidedOnboarding.dropdownPanel.footer.feedbackLabel', { - defaultMessage: 'feedback', - })} - </EuiLink> - ), - }} - /> + <EuiFlexItem grow={false}> + <EuiText size="xs" color={euiTheme.colors.disabled}> + | </EuiText> </EuiFlexItem> - - <EuiFlexItem> - <EuiText color="subdued" textAlign="center"> - <FormattedMessage - id="guidedOnboarding.dropdownPanel.footer.supportDescription" - defaultMessage="Other questions? We're {helpLink}" - values={{ - helpLink: ( - <EuiLink href="https://cloud.elastic.co/support " target="_blank" external> - {i18n.translate( - 'guidedOnboarding.dropdownPanel.footer.helpTextDescription', - { - defaultMessage: 'here to help', - } - )} - </EuiLink> - ), - }} - /> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + iconType="faceHappy" + iconSide="right" + href="https://www.elastic.co/kibana/feedback" + target="_blank" + css={styles.flyoutOverrides.flyoutFooterLink} + iconSize="s" + > + {i18n.translate('guidedOnboarding.dropdownPanel.footer.feedback', { + defaultMessage: 'Give feedback', + })} + </EuiButtonEmpty> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText size="xs" color={euiTheme.colors.disabled}> + | </EuiText> </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + iconType="exit" + iconSide="right" + onClick={openQuitGuideModal} + data-test-subj="quitGuideButton" + css={styles.flyoutOverrides.flyoutFooterLink} + iconSize="s" + > + {i18n.translate('guidedOnboarding.dropdownPanel.footer.exitGuideButtonLabel', { + defaultMessage: 'Quit guide', + })} + </EuiButtonEmpty> + </EuiFlexItem> </EuiFlexGroup> </EuiFlyoutFooter> </EuiFlyout> )} {isQuitGuideModalOpen && ( - <QuitGuideModal closeModal={closeQuitGuideModal} currentGuide={guideState!} /> + <QuitGuideModal + closeModal={closeQuitGuideModal} + currentGuide={guideState!} + telemetryGuideId={telemetryGuideId} + /> )} </> ); 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 14b8f7826bb1b..24106851dc6e2 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 @@ -29,4 +29,13 @@ export const getGuidePanelStepStyles = (euiTheme: EuiThemeComputed, stepStatus: color: ${euiTheme.colors.title}; } `, + description: css` + p { + margin-left: 32px; + margin-block-end: 0; + } + ul { + padding-left: 28px; + } + `, }); diff --git a/src/plugins/guided_onboarding/public/components/guide_panel_step.tsx b/src/plugins/guided_onboarding/public/components/guide_panel_step.tsx index 32ebd14dee806..eb153efca9102 100644 --- a/src/plugins/guided_onboarding/public/components/guide_panel_step.tsx +++ b/src/plugins/guided_onboarding/public/components/guide_panel_step.tsx @@ -31,6 +31,7 @@ interface GuideStepProps { stepConfig: StepConfig; stepNumber: number; handleButtonClick: () => void; + telemetryGuideId: string; } export const GuideStep = ({ @@ -39,6 +40,7 @@ export const GuideStep = ({ stepNumber, stepConfig, handleButtonClick, + telemetryGuideId, }: GuideStepProps) => { const { euiTheme } = useEuiTheme(); const styles = getGuidePanelStepStyles(euiTheme, stepStatus); @@ -93,10 +95,9 @@ export const GuideStep = ({ > <> <EuiSpacer size="s" /> - <EuiText size="s" data-test-subj="guidePanelStepDescription"> - {stepConfig.descriptionList.length === 1 ? ( - <p>{stepConfig.descriptionList[0]}</p> // If there is only one description, render it as a paragraph - ) : ( + <EuiText size="s" data-test-subj="guidePanelStepDescription" css={styles.description}> + {stepConfig.description && <p>{stepConfig.description}</p>} + {stepConfig.descriptionList && ( <ul> {stepConfig.descriptionList.map((description, index) => { return <li key={`description-${index}`}>{description}</li>; @@ -112,7 +113,8 @@ export const GuideStep = ({ <EuiButton onClick={() => handleButtonClick()} fill - data-test-subj="activeStepButton" + // data-test-subj used for FS tracking and tests + data-test-subj={`onboarding--stepButton--${telemetryGuideId}--step${stepNumber}`} > {getStepButtonLabel()} </EuiButton> 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 171750cd83db5..7325ffb6114d1 100644 --- a/src/plugins/guided_onboarding/public/components/quit_guide_modal.tsx +++ b/src/plugins/guided_onboarding/public/components/quit_guide_modal.tsx @@ -7,7 +7,16 @@ */ import React, { useState } from 'react'; -import { EuiText, EuiConfirmModal } from '@elastic/eui'; +import { + EuiText, + EuiButton, + EuiButtonEmpty, + EuiModal, + EuiModalBody, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import type { GuideState } from '@kbn/guided-onboarding'; import { apiService } from '../services/api'; @@ -15,9 +24,14 @@ import { apiService } from '../services/api'; interface QuitGuideModalProps { closeModal: () => void; currentGuide: GuideState; + telemetryGuideId: string; } -export const QuitGuideModal = ({ closeModal, currentGuide }: QuitGuideModalProps) => { +export const QuitGuideModal = ({ + closeModal, + currentGuide, + telemetryGuideId, +}: QuitGuideModalProps) => { const [isDeleting, setIsDeleting] = useState<boolean>(false); const deleteGuide = async () => { @@ -27,32 +41,52 @@ export const QuitGuideModal = ({ closeModal, currentGuide }: QuitGuideModalProps }; return ( - <EuiConfirmModal - maxWidth={448} - title={i18n.translate('guidedOnboarding.quitGuideModal.modalTitle', { - defaultMessage: 'Quit this guide?', - })} - onCancel={closeModal} - onConfirm={deleteGuide} - cancelButtonText={i18n.translate('guidedOnboarding.quitGuideModal.cancelButtonLabel', { - defaultMessage: 'Cancel', - })} - confirmButtonText={i18n.translate('guidedOnboarding.quitGuideModal.quitButtonLabel', { - defaultMessage: 'Quit guide', - })} + <EuiModal aria-label="quitGuideModal" - buttonColor="warning" - isLoading={isDeleting} - data-test-subj="quitGuideModal" + data-test-subj="onboarding--quitGuideModal" + maxWidth={448} + onClose={closeModal} > - <EuiText> - <p> - {i18n.translate('guidedOnboarding.quitGuideModal.modalDescription', { - defaultMessage: - 'You can restart anytime by opening the Setup guide from the Help menu.', + <EuiModalHeader> + <EuiModalHeaderTitle> + {i18n.translate('guidedOnboarding.quitGuideModal.modalTitle', { + defaultMessage: 'Quit this guide?', + })} + </EuiModalHeaderTitle> + </EuiModalHeader> + <EuiModalBody> + <EuiText> + <p> + {i18n.translate('guidedOnboarding.quitGuideModal.modalDescription', { + defaultMessage: + 'You can restart anytime by opening the Setup guide from the Help menu.', + })} + </p> + </EuiText> + </EuiModalBody> + <EuiModalFooter> + <EuiButtonEmpty + data-test-subj={`onboarding--cancelQuitGuideButton--${telemetryGuideId}`} + onClick={closeModal} + > + {i18n.translate('guidedOnboarding.quitGuideModal.cancelButtonLabel', { + defaultMessage: 'Cancel', + })} + </EuiButtonEmpty> + + <EuiButton + // Used for FS tracking and tests + data-test-subj={`onboarding--quitGuideButton--${telemetryGuideId}`} + onClick={deleteGuide} + isLoading={isDeleting} + fill + color="warning" + > + {i18n.translate('guidedOnboarding.quitGuideModal.quitButtonLabel', { + defaultMessage: 'Quit guide', })} - </p> - </EuiText> - </EuiConfirmModal> + </EuiButton> + </EuiModalFooter> + </EuiModal> ); }; diff --git a/src/plugins/guided_onboarding/public/constants/guides_config/index.ts b/src/plugins/guided_onboarding/public/constants/guides_config/index.ts index 9ce81cf9d4698..e2ab4f7e7747f 100644 --- a/src/plugins/guided_onboarding/public/constants/guides_config/index.ts +++ b/src/plugins/guided_onboarding/public/constants/guides_config/index.ts @@ -10,9 +10,11 @@ import type { GuidesConfig } from '../../types'; import { securityConfig } from './security'; import { observabilityConfig } from './observability'; import { searchConfig } from './search'; +import { testGuideConfig } from './test_guide'; export const guidesConfig: GuidesConfig = { security: securityConfig, observability: observabilityConfig, search: searchConfig, + testGuide: testGuideConfig, }; diff --git a/src/plugins/guided_onboarding/public/constants/guides_config/observability.ts b/src/plugins/guided_onboarding/public/constants/guides_config/observability.ts deleted file mode 100644 index 76ee412dbd382..0000000000000 --- a/src/plugins/guided_onboarding/public/constants/guides_config/observability.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { i18n } from '@kbn/i18n'; - -import type { GuideConfig } from '../../types'; - -export const observabilityConfig: GuideConfig = { - title: i18n.translate('guidedOnboarding.observabilityGuide.title', { - defaultMessage: 'Observe my Kubernetes infrastructure', - }), - description: i18n.translate('guidedOnboarding.observabilityGuide.description', { - defaultMessage: `We'll help you quickly gain visibility into your Kubernetes environment using Elastic's out-of-the-box integration. Gain deep insights from your logs, metrics, and traces, and proactively detect issues and take action to resolve issues.`, - }), - guideName: 'Kubernetes', - docs: { - text: i18n.translate('guidedOnboarding.observabilityGuide.documentationLink', { - defaultMessage: 'Kubernetes documentation', - }), - url: 'https://docs.elastic.co/en/integrations/kubernetes', - }, - steps: [ - { - id: 'add_data', - title: i18n.translate('guidedOnboarding.observabilityGuide.addDataStep.title', { - defaultMessage: 'Add data', - }), - integration: 'kubernetes', - descriptionList: [ - i18n.translate('guidedOnboarding.observabilityGuide.addDataStep.description', { - defaultMessage: 'Start by adding your data by setting up the Kubernetes integration.', - }), - ], - location: { - appID: 'integrations', - path: '/detail/kubernetes/overview', - }, - }, - { - id: 'view_dashboard', - title: i18n.translate('guidedOnboarding.observabilityGuide.viewDashboardStep.title', { - defaultMessage: 'Explore Kubernetes metrics', - }), - descriptionList: [ - i18n.translate('guidedOnboarding.observabilityGuide.viewDashboardStep.description', { - defaultMessage: 'Stream, visualize, and analyze your Kubernetes infrastructure metrics.', - }), - ], - location: { - appID: 'dashboards', - path: '#/view/kubernetes-e0195ce0-bcaf-11ec-b64f-7dd6e8e82013', - }, - manualCompletion: { - title: i18n.translate( - 'guidedOnboarding.observabilityGuide.viewDashboardStep.manualCompletionPopoverTitle', - { - defaultMessage: 'Explore the pre-built Kubernetes dashboards', - } - ), - description: i18n.translate( - 'guidedOnboarding.observabilityGuide.viewDashboardStep.manualCompletionPopoverDescription', - { - defaultMessage: `Take your time to explore out-of-the-box dashboards that are included with the Kubernetes integration. When you're ready, you can access the next step of the guide in the button above.`, - } - ), - readyToCompleteOnNavigation: true, - }, - }, - { - id: 'tour_observability', - title: i18n.translate('guidedOnboarding.observabilityGuide.tourObservabilityStep.title', { - defaultMessage: 'Tour Elastic Observability', - }), - descriptionList: [ - i18n.translate('guidedOnboarding.observabilityGuide.tourObservabilityStep.description', { - defaultMessage: - 'Get familiar with the rest of Elastic Observability and explore even more integrations.', - }), - ], - location: { - appID: 'observability', - path: '/overview', - }, - }, - ], -}; diff --git a/src/plugins/guided_onboarding/public/constants/guides_config/observability.tsx b/src/plugins/guided_onboarding/public/constants/guides_config/observability.tsx new file mode 100644 index 0000000000000..4dacb14d57c2d --- /dev/null +++ b/src/plugins/guided_onboarding/public/constants/guides_config/observability.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import { EuiLink } from '@elastic/eui'; +import type { GuideConfig } from '../../types'; + +export const observabilityConfig: GuideConfig = { + title: i18n.translate('guidedOnboarding.observabilityGuide.title', { + defaultMessage: 'Observe my Kubernetes infrastructure', + }), + description: i18n.translate('guidedOnboarding.observabilityGuide.description', { + defaultMessage: `We'll help you quickly get visibility into your Kubernetes environment with our Elastic integration. Gain deep insights from your logs, metrics, and traces to proactively detect issues and take action to resolve them.`, + }), + guideName: 'Kubernetes', + docs: { + text: i18n.translate('guidedOnboarding.observabilityGuide.documentationLink', { + defaultMessage: 'Learn more', + }), + url: 'https://docs.elastic.co/en/integrations/kubernetes', + }, + steps: [ + { + id: 'add_data', + title: i18n.translate('guidedOnboarding.observabilityGuide.addDataStep.title', { + defaultMessage: 'Add and verify your data', + }), + integration: 'kubernetes', + descriptionList: [ + <FormattedMessage + id="guidedOnboarding.observabilityGuide.addDataStep.descriptionList.item1" + defaultMessage="Deploy {kubeStateMetricsLink} service to your Kubernetes." + values={{ + kubeStateMetricsLink: ( + <EuiLink + external + target="_blank" + href="https://github.com/kubernetes/kube-state-metrics" + > + kube-state-metrics + </EuiLink> + ), + }} + />, + i18n.translate('guidedOnboarding.observabilityGuide.addDataStep.descriptionList.item2', { + defaultMessage: 'Add the Elastic Kubernetes integration.', + }), + ], + location: { + appID: 'integrations', + path: '/detail/kubernetes/overview', + }, + }, + { + id: 'view_dashboard', + title: i18n.translate('guidedOnboarding.observabilityGuide.viewDashboardStep.title', { + defaultMessage: 'Explore Kubernetes metrics', + }), + description: i18n.translate( + 'guidedOnboarding.observabilityGuide.viewDashboardStep.description', + { + defaultMessage: 'Stream, visualize, and analyze your Kubernetes infrastructure metrics.', + } + ), + location: { + appID: 'dashboards', + path: '#/view/kubernetes-f4dc26db-1b53-4ea2-a78b-1bfab8ea267c', + }, + manualCompletion: { + title: i18n.translate( + 'guidedOnboarding.observabilityGuide.viewDashboardStep.manualCompletionPopoverTitle', + { + defaultMessage: 'Explore Kubernetes dashboards', + } + ), + description: i18n.translate( + 'guidedOnboarding.observabilityGuide.viewDashboardStep.manualCompletionPopoverDescription', + { + defaultMessage: `Take your time to explore these pre-built dashboards included with the Kubernetes integration. When you’re ready, click the Setup guide button to continue.`, + } + ), + readyToCompleteOnNavigation: true, + }, + }, + { + id: 'tour_observability', + title: i18n.translate('guidedOnboarding.observabilityGuide.tourObservabilityStep.title', { + defaultMessage: 'Tour Elastic Observability', + }), + description: i18n.translate( + 'guidedOnboarding.observabilityGuide.tourObservabilityStep.description', + { + defaultMessage: + 'Get familiar with the rest of Elastic Observability and explore even more integrations.', + } + ), + location: { + appID: 'observability', + path: '/overview', + }, + }, + ], +}; diff --git a/src/plugins/guided_onboarding/public/constants/guides_config/search.ts b/src/plugins/guided_onboarding/public/constants/guides_config/search.ts index f1a8de389ea19..f074d0924fdea 100644 --- a/src/plugins/guided_onboarding/public/constants/guides_config/search.ts +++ b/src/plugins/guided_onboarding/public/constants/guides_config/search.ts @@ -6,60 +6,59 @@ * Side Public License, v 1. */ +import { i18n } from '@kbn/i18n'; import type { GuideConfig } from '../../types'; export const searchConfig: GuideConfig = { - title: 'Search my data', - description: `We'll help you build world-class search experiences with your data, using Elastic's out-of-the-box web crawler, connectors, and our robust APIs. Gain deep insights from the built-in search analytics and use that data to inform changes to relevance.`, + title: i18n.translate('guidedOnboarding.searchGuide.title', { + defaultMessage: 'Search my data', + }), + description: i18n.translate('guidedOnboarding.searchGuide.description', { + defaultMessage: `Build custom search experiences with your data using Elastic’s out-of-the-box web crawler, connectors, and robust APIs. Gain deep insights from the built-in search analytics to curate results and optimize relevance.`, + }), guideName: 'Enterprise Search', - docs: { - text: 'Enterprise Search 101 Documentation', - url: 'example.com', - }, steps: [ { id: 'add_data', - title: 'Add data', + title: i18n.translate('guidedOnboarding.searchGuide.addDataStep.title', { + defaultMessage: 'Add data', + }), descriptionList: [ - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', - 'Nullam ligula enim, malesuada a finibus vel, cursus sed risus.', - 'Vivamus pretium, elit dictum lacinia aliquet, libero nibh dictum enim, a rhoncus leo magna in sapien.', + i18n.translate('guidedOnboarding.searchGuide.addDataStep.description1', { + defaultMessage: 'Select an ingestion method.', + }), + i18n.translate('guidedOnboarding.searchGuide.addDataStep.description2', { + defaultMessage: 'Create a new Elasticsearch index.', + }), + i18n.translate('guidedOnboarding.searchGuide.addDataStep.description3', { + defaultMessage: 'Configure your ingestion settings.', + }), ], location: { appID: 'enterpriseSearch', path: '', }, }, - { - id: 'browse_docs', - title: 'Browse your documents', - descriptionList: [ - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', - 'Nullam ligula enim, malesuada a finibus vel, cursus sed risus.', - 'Vivamus pretium, elit dictum lacinia aliquet, libero nibh dictum enim, a rhoncus leo magna in sapien.', - ], - location: { - appID: 'guidedOnboardingExample', - path: 'stepTwo', - }, - manualCompletion: { - title: 'Manual completion step title', - description: - 'Mark the step complete by opening the panel and clicking the button "Mark done"', - readyToCompleteOnNavigation: true, - }, - }, { id: 'search_experience', - title: 'Build a search experience', + title: i18n.translate('guidedOnboarding.searchGuide.searchExperienceStep.title', { + defaultMessage: 'Build a search experience', + }), descriptionList: [ - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', - 'Nullam ligula enim, malesuada a finibus vel, cursus sed risus.', - 'Vivamus pretium, elit dictum lacinia aliquet, libero nibh dictum enim, a rhoncus leo magna in sapien.', + i18n.translate('guidedOnboarding.searchGuide.searchExperienceStep.descriptionList.item1', { + defaultMessage: 'Learn more about Elastic’s Search UI framework.', + }), + i18n.translate('guidedOnboarding.searchGuide.searchExperienceStep.descriptionList.item2', { + defaultMessage: 'Try the Search UI tutorial for Elasticsearch.', + }), + i18n.translate('guidedOnboarding.searchGuide.searchExperienceStep.descriptionList.item3', { + defaultMessage: + 'Build a world-class search experience for your customers, employees, or users.', + }), ], location: { - appID: 'guidedOnboardingExample', - path: 'stepThree', + appID: 'enterpriseSearch', + path: '/search_experiences', }, }, ], diff --git a/src/plugins/guided_onboarding/public/constants/guides_config/security.ts b/src/plugins/guided_onboarding/public/constants/guides_config/security.ts index d2f9b352b9d81..3930ab66220f0 100644 --- a/src/plugins/guided_onboarding/public/constants/guides_config/security.ts +++ b/src/plugins/guided_onboarding/public/constants/guides_config/security.ts @@ -6,25 +6,34 @@ * Side Public License, v 1. */ +import { i18n } from '@kbn/i18n'; import type { GuideConfig } from '../../types'; export const securityConfig: GuideConfig = { - title: 'Get started with SIEM', + title: i18n.translate('guidedOnboarding.securityGuide.title', { + defaultMessage: 'Elastic Security guided setup', + }), guideName: 'Security', completedGuideRedirectLocation: { appID: 'security', path: '/app/security/dashboards', }, - description: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ligula enim, malesuada a finibus vel, cursus sed risus. Vivamus pretium, elit dictum lacinia aliquet, libero nibh dictum enim, a rhoncus leo magna in sapien.', + description: i18n.translate('guidedOnboarding.securityGuide.description', { + defaultMessage: `We'll help you get set up quickly, using Elastic's out-of-the-box integrations.`, + }), steps: [ { id: 'add_data', - title: 'Add and view your data', + title: i18n.translate('guidedOnboarding.securityGuide.addDataStep.title', { + defaultMessage: 'Add data with Elastic Defend', + }), descriptionList: [ - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', - 'Nullam ligula enim, malesuada a finibus vel, cursus sed risus.', - 'Vivamus pretium, elit dictum lacinia aliquet, libero nibh dictum enim, a rhoncus leo magna in sapien.', + i18n.translate('guidedOnboarding.securityGuide.addDataStep.description1', { + defaultMessage: 'Select the Elastic Defend integration to add your data.', + }), + i18n.translate('guidedOnboarding.securityGuide.addDataStep.description2', { + defaultMessage: 'Make sure your data looks good.', + }), ], integration: 'endpoint', location: { @@ -34,16 +43,27 @@ export const securityConfig: GuideConfig = { }, { id: 'rules', - title: 'Turn on rules', + title: i18n.translate('guidedOnboarding.securityGuide.rulesStep.title', { + defaultMessage: 'Turn on rules', + }), descriptionList: [ - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', - 'Nullam ligula enim, malesuada a finibus vel, cursus sed risus.', - 'Vivamus pretium, elit dictum lacinia aliquet, libero nibh dictum enim, a rhoncus leo magna in sapien.', + i18n.translate('guidedOnboarding.securityGuide.rulesStep.description1', { + defaultMessage: 'Load the prebuilt rules.', + }), + i18n.translate('guidedOnboarding.securityGuide.rulesStep.description2', { + defaultMessage: 'Select the rules that you want.', + }), ], manualCompletion: { - title: 'Manual completion step title', - description: - 'Mark the step complete by opening the panel and clicking the button "Mark done"', + title: i18n.translate('guidedOnboarding.securityGuide.rulesStep.manualCompletion.title', { + defaultMessage: 'Continue with the tour', + }), + description: i18n.translate( + 'guidedOnboarding.securityGuide.rulesStep.manualCompletion.description', + { + defaultMessage: 'After you’ve enabled the rules you want, click here to continue.', + } + ), }, location: { appID: 'securitySolutionUI', @@ -52,11 +72,16 @@ export const securityConfig: GuideConfig = { }, { id: 'alertsCases', - title: 'Alerts and cases', + title: i18n.translate('guidedOnboarding.securityGuide.alertsStep.title', { + defaultMessage: 'Manage alerts and cases', + }), descriptionList: [ - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', - 'Nullam ligula enim, malesuada a finibus vel, cursus sed risus.', - 'Vivamus pretium, elit dictum lacinia aliquet, libero nibh dictum enim, a rhoncus leo magna in sapien.', + i18n.translate('guidedOnboarding.securityGuide.alertsStep.description1', { + defaultMessage: 'View and triage alerts.', + }), + i18n.translate('guidedOnboarding.securityGuide.alertsStep.description2', { + defaultMessage: 'Create a case.', + }), ], location: { appID: 'securitySolutionUI', diff --git a/src/plugins/guided_onboarding/public/constants/guides_config/test_guide.ts b/src/plugins/guided_onboarding/public/constants/guides_config/test_guide.ts new file mode 100644 index 0000000000000..fead791d02ed1 --- /dev/null +++ b/src/plugins/guided_onboarding/public/constants/guides_config/test_guide.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { GuideConfig } from '../../types'; + +export const testGuideConfig: GuideConfig = { + title: 'Test guide for development', + description: `This guide is used to test the guided onboarding UI while in development and to run automated tests for the API and UI components.`, + guideName: 'Testing example', + docs: { + text: 'Testing example docs', + url: 'example.com', + }, + steps: [ + { + id: 'step1', + title: 'Step 1 (completed via an API request)', + descriptionList: [ + `This step is directly completed by clicking the button that uses the API function 'completeGuideStep`, + 'Navigate to /guidedOnboardingExample/stepOne to complete the step.', + ], + location: { + appID: 'guidedOnboardingExample', + path: 'stepOne', + }, + integration: 'testIntegration', + }, + { + id: 'step2', + title: 'Step 2 (manual completion after navigation)', + descriptionList: [ + 'This step is set to ready_to_complete on page navigation.', + 'After that click the popover on the guide button in the header and mark the step done', + ], + location: { + appID: 'guidedOnboardingExample', + path: 'stepTwo', + }, + manualCompletion: { + title: 'Manual completion step title', + description: + 'Mark the step complete by opening the panel and clicking the button "Mark done"', + readyToCompleteOnNavigation: true, + }, + }, + { + id: 'step3', + title: 'Step 3 (manual completion after click)', + description: + 'This step is completed by clicking a button on the page and then clicking the popover on the guide button in the header and marking the step done', + manualCompletion: { + title: 'Manual completion step title', + description: + 'Mark the step complete by opening the panel and clicking the button "Mark done"', + }, + location: { + appID: 'guidedOnboardingExample', + path: 'stepThree', + }, + }, + ], +}; diff --git a/src/plugins/guided_onboarding/public/plugin.tsx b/src/plugins/guided_onboarding/public/plugin.tsx index 5d18eab0ad223..4cf5fa9749a07 100755 --- a/src/plugins/guided_onboarding/public/plugin.tsx +++ b/src/plugins/guided_onboarding/public/plugin.tsx @@ -13,7 +13,11 @@ import { I18nProvider } from '@kbn/i18n-react'; import { CoreSetup, CoreStart, Plugin, CoreTheme, ApplicationStart } from '@kbn/core/public'; import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; -import type { GuidedOnboardingPluginSetup, GuidedOnboardingPluginStart } from './types'; +import type { + AppPluginStartDependencies, + GuidedOnboardingPluginSetup, + GuidedOnboardingPluginStart, +} from './types'; import { GuidePanel } from './components'; import { ApiService, apiService } from './services/api'; @@ -25,22 +29,28 @@ export class GuidedOnboardingPlugin return {}; } - public start(core: CoreStart): GuidedOnboardingPluginStart { + public start( + core: CoreStart, + { cloud }: AppPluginStartDependencies + ): GuidedOnboardingPluginStart { const { chrome, http, theme, application } = core; // Initialize services apiService.setup(http); - chrome.navControls.registerExtension({ - order: 1000, - mount: (target) => - this.mount({ - targetDomElement: target, - theme$: theme.theme$, - api: apiService, - application, - }), - }); + // Guided onboarding UI is only available on cloud + if (cloud?.isCloudEnabled) { + chrome.navControls.registerExtension({ + order: 1000, + mount: (target) => + this.mount({ + targetDomElement: target, + theme$: theme.theme$, + api: apiService, + application, + }), + }); + } // Return methods that should be available to other plugins return { diff --git a/src/plugins/guided_onboarding/public/services/api.mocks.ts b/src/plugins/guided_onboarding/public/services/api.mocks.ts index 21bb257cad68f..47b7f6c9900e0 100644 --- a/src/plugins/guided_onboarding/public/services/api.mocks.ts +++ b/src/plugins/guided_onboarding/public/services/api.mocks.ts @@ -6,84 +6,96 @@ * Side Public License, v 1. */ -import type { GuideState } from '@kbn/guided-onboarding'; +import type { GuideState, GuideId, GuideStepIds } from '@kbn/guided-onboarding'; -export const searchAddDataActiveState: GuideState = { - guideId: 'search', +export const testGuide: GuideId = 'testGuide'; +export const testGuideFirstStep: GuideStepIds = 'step1'; +export const testGuideManualCompletionStep = 'step2'; +export const testGuideLastStep: GuideStepIds = 'step3'; +export const testIntegration = 'testIntegration'; +export const wrongIntegration = 'notTestIntegration'; + +export const testGuideStep1ActiveState: GuideState = { + guideId: 'testGuide', isActive: true, status: 'in_progress', steps: [ { - id: 'add_data', + id: 'step1', status: 'active', }, { - id: 'browse_docs', + id: 'step2', status: 'inactive', }, { - id: 'search_experience', + id: 'step3', status: 'inactive', }, ], }; -export const securityAddDataInProgressState: GuideState = { - guideId: 'security', - status: 'in_progress', - isActive: true, +export const testGuideStep1InProgressState: GuideState = { + ...testGuideStep1ActiveState, steps: [ { - id: 'add_data', - status: 'in_progress', + id: testGuideStep1ActiveState.steps[0].id, + status: 'in_progress', // update the first step status }, + testGuideStep1ActiveState.steps[1], + testGuideStep1ActiveState.steps[2], + ], +}; + +export const testGuideStep2ActiveState: GuideState = { + ...testGuideStep1ActiveState, + steps: [ { - id: 'rules', - status: 'inactive', + ...testGuideStep1ActiveState.steps[0], + status: 'complete', }, { - id: 'alertsCases', - status: 'inactive', + id: testGuideStep1ActiveState.steps[1].id, + status: 'active', }, + testGuideStep1ActiveState.steps[2], ], }; -export const securityRulesActiveState: GuideState = { - guideId: 'security', - isActive: true, - status: 'in_progress', +export const testGuideStep2InProgressState: GuideState = { + ...testGuideStep1ActiveState, steps: [ { - id: 'add_data', + ...testGuideStep1ActiveState.steps[0], status: 'complete', }, { - id: 'rules', - status: 'active', - }, - { - id: 'alertsCases', - status: 'inactive', + id: testGuideStep1ActiveState.steps[1].id, + status: 'in_progress', }, + testGuideStep1ActiveState.steps[2], ], }; -export const noGuideActiveState: GuideState = { - guideId: 'security', - status: 'in_progress', - isActive: false, +export const readyToCompleteGuideState: GuideState = { + ...testGuideStep1ActiveState, steps: [ { - id: 'add_data', - status: 'in_progress', + ...testGuideStep1ActiveState.steps[0], + status: 'complete', }, { - id: 'rules', - status: 'inactive', + ...testGuideStep1ActiveState.steps[1], + status: 'complete', }, { - id: 'alertsCases', - status: 'inactive', + ...testGuideStep1ActiveState.steps[2], + status: 'complete', }, ], }; + +export const testGuideNotActiveState: GuideState = { + ...testGuideStep1ActiveState, + isActive: false, +}; diff --git a/src/plugins/guided_onboarding/public/services/api.test.ts b/src/plugins/guided_onboarding/public/services/api.test.ts index 3503b68e5466c..24ade7de1a849 100644 --- a/src/plugins/guided_onboarding/public/services/api.test.ts +++ b/src/plugins/guided_onboarding/public/services/api.test.ts @@ -11,39 +11,41 @@ import { httpServiceMock } from '@kbn/core/public/mocks'; import type { GuideState } from '@kbn/guided-onboarding'; import { firstValueFrom, Subscription } from 'rxjs'; +import { GuideStatus } from '@kbn/guided-onboarding'; import { API_BASE_PATH } from '../../common/constants'; -import { guidesConfig } from '../constants/guides_config'; import { ApiService } from './api'; import { - noGuideActiveState, - searchAddDataActiveState, - securityAddDataInProgressState, - securityRulesActiveState, + testGuide, + testGuideFirstStep, + testGuideManualCompletionStep, + testGuideStep1ActiveState, + testGuideStep1InProgressState, + testGuideStep2ActiveState, + testGuideNotActiveState, + testIntegration, + wrongIntegration, + testGuideStep2InProgressState, + readyToCompleteGuideState, } from './api.mocks'; -const searchGuide = 'search'; -const firstStep = guidesConfig[searchGuide].steps[0].id; -const endpointIntegration = 'endpoint'; -const kubernetesIntegration = 'kubernetes'; - describe('GuidedOnboarding ApiService', () => { let httpClient: jest.Mocked<HttpSetup>; let apiService: ApiService; let subscription: Subscription; + let anotherSubscription: Subscription; beforeEach(() => { httpClient = httpServiceMock.createStartContract({ basePath: '/base/path' }); httpClient.get.mockResolvedValue({ - state: [securityAddDataInProgressState], + state: [testGuideStep1ActiveState], }); apiService = new ApiService(); apiService.setup(httpClient); }); afterEach(() => { - if (subscription) { - subscription.unsubscribe(); - } + subscription?.unsubscribe(); + anotherSubscription?.unsubscribe(); jest.restoreAllMocks(); }); @@ -53,14 +55,72 @@ describe('GuidedOnboarding ApiService', () => { expect(httpClient.get).toHaveBeenCalledTimes(1); expect(httpClient.get).toHaveBeenCalledWith(`${API_BASE_PATH}/state`, { query: { active: true }, + signal: new AbortController().signal, + }); + }); + + it(`doesn't send multiple requests when there are several subscriptions`, () => { + subscription = apiService.fetchActiveGuideState$().subscribe(); + anotherSubscription = apiService.fetchActiveGuideState$().subscribe(); + expect(httpClient.get).toHaveBeenCalledTimes(1); + }); + + it(`re-sends the request if the previous one failed`, async () => { + httpClient.get.mockRejectedValueOnce(new Error('request failed')); + subscription = apiService.fetchActiveGuideState$().subscribe(); + // wait until the request fails + await new Promise((resolve) => process.nextTick(resolve)); + anotherSubscription = apiService.fetchActiveGuideState$().subscribe(); + expect(httpClient.get).toHaveBeenCalledTimes(2); + }); + + it(`re-sends the request if there is no guide state and there is another subscription`, async () => { + httpClient.get.mockResolvedValueOnce({ + state: [], + }); + subscription = apiService.fetchActiveGuideState$().subscribe(); + // wait until the request completes + await new Promise((resolve) => process.nextTick(resolve)); + anotherSubscription = apiService.fetchActiveGuideState$().subscribe(); + expect(httpClient.get).toHaveBeenCalledTimes(2); + }); + + it(`doesn't send multiple requests in a loop when there is no state`, async () => { + httpClient.get.mockResolvedValueOnce({ + state: [], + }); + subscription = apiService.fetchActiveGuideState$().subscribe(); + // wait until the request completes + await new Promise((resolve) => process.nextTick(resolve)); + expect(httpClient.get).toHaveBeenCalledTimes(1); + }); + + it(`re-sends the request if the subscription was unsubscribed before the request completed`, async () => { + httpClient.get.mockImplementationOnce(() => { + return new Promise((resolve) => setTimeout(resolve)); + }); + // subscribe and immediately unsubscribe + apiService.fetchActiveGuideState$().subscribe().unsubscribe(); + anotherSubscription = apiService.fetchActiveGuideState$().subscribe(); + expect(httpClient.get).toHaveBeenCalledTimes(2); + }); + + it(`the second subscription gets the state broadcast to it`, (done) => { + // first subscription + apiService.fetchActiveGuideState$().subscribe(); + // second subscription + anotherSubscription = apiService.fetchActiveGuideState$().subscribe((state) => { + if (state) { + done(); + } }); }); it('broadcasts the updated state', async () => { - await apiService.activateGuide(searchGuide, searchAddDataActiveState); + await apiService.activateGuide(testGuide, testGuideStep1ActiveState); const state = await firstValueFrom(apiService.fetchActiveGuideState$()); - expect(state).toEqual(searchAddDataActiveState); + expect(state).toEqual(testGuideStep1ActiveState); }); }); @@ -74,12 +134,12 @@ describe('GuidedOnboarding ApiService', () => { describe('deactivateGuide', () => { it('deactivates an existing guide', async () => { - await apiService.deactivateGuide(searchAddDataActiveState); + await apiService.deactivateGuide(testGuideStep1ActiveState); expect(httpClient.put).toHaveBeenCalledTimes(1); expect(httpClient.put).toHaveBeenCalledWith(`${API_BASE_PATH}/state`, { body: JSON.stringify({ - ...searchAddDataActiveState, + ...testGuideStep1ActiveState, isActive: false, }), }); @@ -88,42 +148,33 @@ describe('GuidedOnboarding ApiService', () => { describe('updateGuideState', () => { it('sends a request to the put API', async () => { - const updatedState: GuideState = { - ...searchAddDataActiveState, - steps: [ - { - id: searchAddDataActiveState.steps[0].id, - status: 'in_progress', // update the first step status - }, - searchAddDataActiveState.steps[1], - searchAddDataActiveState.steps[2], - ], - }; + const updatedState: GuideState = testGuideStep1InProgressState; await apiService.updateGuideState(updatedState, false); expect(httpClient.put).toHaveBeenCalledTimes(1); expect(httpClient.put).toHaveBeenCalledWith(`${API_BASE_PATH}/state`, { body: JSON.stringify(updatedState), }); }); + + it('the completed state is being broadcast after the update', async () => { + const completedState = { + ...readyToCompleteGuideState, + isActive: false, + status: 'complete' as GuideStatus, + }; + await apiService.updateGuideState(completedState, false); + const state = await firstValueFrom(apiService.fetchActiveGuideState$()); + expect(state).toMatchObject(completedState); + }); }); describe('isGuideStepActive$', () => { - it('returns true if the step has been started', async (done) => { - const updatedState: GuideState = { - ...searchAddDataActiveState, - steps: [ - { - id: searchAddDataActiveState.steps[0].id, - status: 'in_progress', - }, - searchAddDataActiveState.steps[1], - searchAddDataActiveState.steps[2], - ], - }; - await apiService.updateGuideState(updatedState, false); + it('returns true if the step has been started', (done) => { + const updatedState: GuideState = testGuideStep1InProgressState; + apiService.updateGuideState(updatedState, false); subscription = apiService - .isGuideStepActive$(searchGuide, firstStep) + .isGuideStepActive$(testGuide, testGuideFirstStep) .subscribe((isStepActive) => { if (isStepActive) { done(); @@ -131,10 +182,9 @@ describe('GuidedOnboarding ApiService', () => { }); }); - it('returns false if the step is not been started', async (done) => { - await apiService.updateGuideState(searchAddDataActiveState, false); + it('returns false if the step is not been started', (done) => { subscription = apiService - .isGuideStepActive$(searchGuide, firstStep) + .isGuideStepActive$(testGuide, testGuideFirstStep) .subscribe((isStepActive) => { if (!isStepActive) { done(); @@ -145,67 +195,37 @@ describe('GuidedOnboarding ApiService', () => { describe('activateGuide', () => { it('activates a new guide', async () => { - await apiService.activateGuide(searchGuide); + // update the mock to no active guides + httpClient.get.mockResolvedValue({ + state: [], + }); + apiService.setup(httpClient); + + await apiService.activateGuide(testGuide); expect(httpClient.put).toHaveBeenCalledTimes(1); expect(httpClient.put).toHaveBeenCalledWith(`${API_BASE_PATH}/state`, { - body: JSON.stringify({ - isActive: true, - status: 'not_started', - steps: [ - { - id: 'add_data', - status: 'active', - }, - { - id: 'browse_docs', - status: 'inactive', - }, - { - id: 'search_experience', - status: 'inactive', - }, - ], - guideId: searchGuide, - }), + body: JSON.stringify({ ...testGuideStep1ActiveState, status: 'not_started' }), }); }); it('reactivates a guide that has already been started', async () => { - await apiService.activateGuide(searchGuide, searchAddDataActiveState); + await apiService.activateGuide(testGuide, testGuideStep1ActiveState); expect(httpClient.put).toHaveBeenCalledTimes(1); expect(httpClient.put).toHaveBeenCalledWith(`${API_BASE_PATH}/state`, { - body: JSON.stringify(searchAddDataActiveState), + body: JSON.stringify(testGuideStep1ActiveState), }); }); }); describe('completeGuide', () => { - const readyToCompleteGuideState: GuideState = { - ...searchAddDataActiveState, - steps: [ - { - id: 'add_data', - status: 'complete', - }, - { - id: 'browse_docs', - status: 'complete', - }, - { - id: 'search_experience', - status: 'complete', - }, - ], - }; - beforeEach(async () => { await apiService.updateGuideState(readyToCompleteGuideState, false); }); it('updates the selected guide and marks it as complete', async () => { - await apiService.completeGuide(searchGuide); + await apiService.completeGuide(testGuide); expect(httpClient.put).toHaveBeenCalledWith(`${API_BASE_PATH}/state`, { body: JSON.stringify({ @@ -223,51 +243,39 @@ describe('GuidedOnboarding ApiService', () => { it('returns undefined if the selected guide has uncompleted steps', async () => { const incompleteGuideState: GuideState = { - ...searchAddDataActiveState, + ...testGuideStep1ActiveState, steps: [ { - id: 'add_data', + ...testGuideStep1ActiveState.steps[0], status: 'complete', }, { - id: 'browse_docs', + ...testGuideStep1ActiveState.steps[1], status: 'complete', }, { - id: 'search_experience', + ...testGuideStep1ActiveState.steps[2], status: 'in_progress', }, ], }; await apiService.updateGuideState(incompleteGuideState, false); - const completedState = await apiService.completeGuide(searchGuide); + const completedState = await apiService.completeGuide(testGuide); expect(completedState).not.toBeDefined(); }); }); describe('startGuideStep', () => { beforeEach(async () => { - await apiService.updateGuideState(searchAddDataActiveState, false); + await apiService.updateGuideState(testGuideStep1ActiveState, false); }); it('updates the selected step and marks it as in_progress', async () => { - await apiService.startGuideStep(searchGuide, firstStep); + await apiService.startGuideStep(testGuide, testGuideFirstStep); expect(httpClient.put).toHaveBeenCalledWith(`${API_BASE_PATH}/state`, { - body: JSON.stringify({ - ...searchAddDataActiveState, - isActive: true, - status: 'in_progress', - steps: [ - { - id: searchAddDataActiveState.steps[0].id, - status: 'in_progress', - }, - searchAddDataActiveState.steps[1], - searchAddDataActiveState.steps[2], - ], - }), + body: JSON.stringify(testGuideStep1InProgressState), }); }); @@ -279,76 +287,35 @@ describe('GuidedOnboarding ApiService', () => { describe('completeGuideStep', () => { it(`completes the step when it's in progress`, async () => { - const updatedState: GuideState = { - ...searchAddDataActiveState, - steps: [ - { - id: searchAddDataActiveState.steps[0].id, - status: 'in_progress', // Mark a step as in_progress in order to test the "completeGuideStep" behavior - }, - searchAddDataActiveState.steps[1], - searchAddDataActiveState.steps[2], - ], - }; - await apiService.updateGuideState(updatedState, false); + await apiService.updateGuideState(testGuideStep1InProgressState, false); - await apiService.completeGuideStep(searchGuide, firstStep); + await apiService.completeGuideStep(testGuide, testGuideFirstStep); // Once on update, once on complete expect(httpClient.put).toHaveBeenCalledTimes(2); // Verify the completed step now has a "complete" status, and the subsequent step is "active" expect(httpClient.put).toHaveBeenLastCalledWith(`${API_BASE_PATH}/state`, { - body: JSON.stringify({ - ...updatedState, - steps: [ - { - id: searchAddDataActiveState.steps[0].id, - status: 'complete', - }, - { - id: searchAddDataActiveState.steps[1].id, - status: 'active', - }, - searchAddDataActiveState.steps[2], - ], - }), + body: JSON.stringify({ ...testGuideStep2ActiveState }), }); }); it(`marks the step as 'ready_to_complete' if it's configured for manual completion`, async () => { - const securityRulesInProgressState = { - ...securityRulesActiveState, - steps: [ - securityRulesActiveState.steps[0], - { - id: securityRulesActiveState.steps[1].id, - status: 'in_progress', - }, - securityRulesActiveState.steps[2], - ], - }; httpClient.get.mockResolvedValue({ - state: [securityRulesInProgressState], + state: [testGuideStep2InProgressState], }); apiService.setup(httpClient); - await apiService.completeGuideStep('security', 'rules'); + await apiService.completeGuideStep(testGuide, testGuideManualCompletionStep); expect(httpClient.put).toHaveBeenCalledTimes(1); // Verify the completed step now has a "ready_to_complete" status, and the subsequent step is "inactive" expect(httpClient.put).toHaveBeenLastCalledWith(`${API_BASE_PATH}/state`, { body: JSON.stringify({ - ...securityRulesInProgressState, + ...testGuideStep2InProgressState, steps: [ - securityRulesInProgressState.steps[0], - { - id: securityRulesInProgressState.steps[1].id, - status: 'ready_to_complete', - }, - { - id: securityRulesInProgressState.steps[2].id, - status: 'inactive', - }, + testGuideStep2InProgressState.steps[0], + { ...testGuideStep2InProgressState.steps[1], status: 'ready_to_complete' }, + testGuideStep2InProgressState.steps[2], ], }), }); @@ -360,24 +327,20 @@ describe('GuidedOnboarding ApiService', () => { }); it('does nothing if the step is not in progress', async () => { - httpClient.get.mockResolvedValue({ - state: [searchAddDataActiveState], - }); - apiService.setup(httpClient); - - await apiService.completeGuideStep(searchGuide, firstStep); + // by default the state set in beforeEach is test guide, step 1 active + await apiService.completeGuideStep(testGuide, testGuideFirstStep); expect(httpClient.put).toHaveBeenCalledTimes(0); }); }); describe('isGuidedOnboardingActiveForIntegration$', () => { - it('returns true if the integration is part of the active step', async (done) => { + it('returns true if the integration is part of the active step', (done) => { httpClient.get.mockResolvedValue({ - state: [securityAddDataInProgressState], + state: [testGuideStep1InProgressState], }); apiService.setup(httpClient); subscription = apiService - .isGuidedOnboardingActiveForIntegration$(endpointIntegration) + .isGuidedOnboardingActiveForIntegration$(testIntegration) .subscribe((isIntegrationInGuideStep) => { if (isIntegrationInGuideStep) { done(); @@ -385,13 +348,13 @@ describe('GuidedOnboarding ApiService', () => { }); }); - it('returns false if another integration is part of the active step', async (done) => { + it('returns false if the current step has a different integration', (done) => { httpClient.get.mockResolvedValue({ - state: [securityAddDataInProgressState], + state: [testGuideStep1InProgressState], }); apiService.setup(httpClient); subscription = apiService - .isGuidedOnboardingActiveForIntegration$(kubernetesIntegration) + .isGuidedOnboardingActiveForIntegration$(wrongIntegration) .subscribe((isIntegrationInGuideStep) => { if (!isIntegrationInGuideStep) { done(); @@ -399,13 +362,13 @@ describe('GuidedOnboarding ApiService', () => { }); }); - it('returns false if no guide is active', async (done) => { + it('returns false if no guide is active', (done) => { httpClient.get.mockResolvedValue({ - state: [noGuideActiveState], + state: [testGuideNotActiveState], }); apiService.setup(httpClient); subscription = apiService - .isGuidedOnboardingActiveForIntegration$(endpointIntegration) + .isGuidedOnboardingActiveForIntegration$(testIntegration) .subscribe((isIntegrationInGuideStep) => { if (!isIntegrationInGuideStep) { done(); @@ -417,35 +380,35 @@ describe('GuidedOnboarding ApiService', () => { describe('completeGuidedOnboardingForIntegration', () => { it(`completes the step if it's active for the integration`, async () => { httpClient.get.mockResolvedValue({ - state: [securityAddDataInProgressState], + state: [testGuideStep1InProgressState], }); apiService.setup(httpClient); - await apiService.completeGuidedOnboardingForIntegration(endpointIntegration); + await apiService.completeGuidedOnboardingForIntegration(testIntegration); expect(httpClient.put).toHaveBeenCalledTimes(1); // this assertion depends on the guides config expect(httpClient.put).toHaveBeenCalledWith(`${API_BASE_PATH}/state`, { - body: JSON.stringify(securityRulesActiveState), + body: JSON.stringify(testGuideStep2ActiveState), }); }); it(`does nothing if the step has a different integration`, async () => { httpClient.get.mockResolvedValue({ - state: [securityAddDataInProgressState], + state: [testGuideStep1InProgressState], }); apiService.setup(httpClient); - await apiService.completeGuidedOnboardingForIntegration(kubernetesIntegration); + await apiService.completeGuidedOnboardingForIntegration(wrongIntegration); expect(httpClient.put).not.toHaveBeenCalled(); }); it(`does nothing if no guide is active`, async () => { httpClient.get.mockResolvedValue({ - state: [noGuideActiveState], + state: [testGuideNotActiveState], }); apiService.setup(httpClient); - await apiService.completeGuidedOnboardingForIntegration(endpointIntegration); + await apiService.completeGuidedOnboardingForIntegration(testIntegration); expect(httpClient.put).not.toHaveBeenCalled(); }); }); diff --git a/src/plugins/guided_onboarding/public/services/api.ts b/src/plugins/guided_onboarding/public/services/api.ts index 688e72fa83243..89790024cdde7 100644 --- a/src/plugins/guided_onboarding/public/services/api.ts +++ b/src/plugins/guided_onboarding/public/services/api.ts @@ -7,7 +7,7 @@ */ import { HttpSetup } from '@kbn/core/public'; -import { BehaviorSubject, map, from, concatMap, of, Observable, firstValueFrom } from 'rxjs'; +import { BehaviorSubject, map, concatMap, of, Observable, firstValueFrom } from 'rxjs'; import type { GuideState, GuideId, GuideStep, GuideStepIds } from '@kbn/guided-onboarding'; import { GuidedOnboardingApi } from '../types'; @@ -26,6 +26,7 @@ import { API_BASE_PATH } from '../../common/constants'; export class ApiService implements GuidedOnboardingApi { private client: HttpSetup | undefined; private onboardingGuideState$!: BehaviorSubject<GuideState | undefined>; + private isGuideStateLoading: boolean | undefined; public isGuidePanelOpen$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); public setup(httpClient: HttpSetup): void { @@ -33,30 +34,46 @@ export class ApiService implements GuidedOnboardingApi { this.onboardingGuideState$ = new BehaviorSubject<GuideState | undefined>(undefined); } + private createGetStateObservable(): Observable<GuideState | undefined> { + return new Observable<GuideState | undefined>((observer) => { + const controller = new AbortController(); + const signal = controller.signal; + this.isGuideStateLoading = true; + this.client!.get<{ state: GuideState[] }>(`${API_BASE_PATH}/state`, { + query: { + active: true, + }, + signal, + }) + .then((response) => { + this.isGuideStateLoading = false; + // There should only be 1 active guide + const hasState = response.state.length === 1; + if (hasState) { + this.onboardingGuideState$.next(response.state[0]); + } + observer.complete(); + }) + .catch((error) => { + this.isGuideStateLoading = false; + observer.error(error); + }); + return () => { + this.isGuideStateLoading = false; + controller.abort(); + }; + }); + } + /** * An Observable with the active guide state. * Initially the state is fetched from the backend. * Subsequently, the observable is updated automatically, when the state changes. */ public fetchActiveGuideState$(): Observable<GuideState | undefined> { - // TODO add error handling if this.client has not been initialized or request fails return this.onboardingGuideState$.pipe( concatMap((state) => - state === undefined - ? from( - this.client!.get<{ state: GuideState[] }>(`${API_BASE_PATH}/state`, { - query: { - active: true, - }, - }) - ).pipe( - map((response) => { - // There should only be 1 active guide - const hasState = response.state.length === 1; - return hasState ? response.state[0] : undefined; - }) - ) - : of(state) + !state && !this.isGuideStateLoading ? this.createGetStateObservable() : of(state) ) ); } @@ -83,7 +100,7 @@ export class ApiService implements GuidedOnboardingApi { /** * Updates the SO with the updated guide state and refreshes the observables * This is largely used internally and for tests - * @param {GuideState} guideState the updated guide state + * @param {GuideState} newState the updated guide state * @param {boolean} panelState boolean to determine whether the dropdown panel should open or not * @return {Promise} a promise with the updated guide state */ @@ -99,8 +116,8 @@ export class ApiService implements GuidedOnboardingApi { const response = await this.client.put<{ state: GuideState }>(`${API_BASE_PATH}/state`, { body: JSON.stringify(newState), }); - // If the guide has been deactivated, we return undefined - this.onboardingGuideState$.next(newState.isActive ? newState : undefined); + // broadcast the newState + this.onboardingGuideState$.next(newState); this.isGuidePanelOpen$.next(panelState); return response; } catch (error) { @@ -147,10 +164,10 @@ export class ApiService implements GuidedOnboardingApi { }); const updatedGuide: GuideState = { + guideId, isActive: true, status: 'not_started', steps: updatedSteps, - guideId, }; return await this.updateGuideState(updatedGuide, true); diff --git a/src/plugins/guided_onboarding/public/services/helpers.test.ts b/src/plugins/guided_onboarding/public/services/helpers.test.ts index 9dc7519a02019..82720c4f9d223 100644 --- a/src/plugins/guided_onboarding/public/services/helpers.test.ts +++ b/src/plugins/guided_onboarding/public/services/helpers.test.ts @@ -6,51 +6,50 @@ * Side Public License, v 1. */ -import { guidesConfig } from '../constants/guides_config'; import { isIntegrationInGuideStep, isLastStep } from './helpers'; import { - noGuideActiveState, - securityAddDataInProgressState, - securityRulesActiveState, + testGuide, + testGuideFirstStep, + testGuideLastStep, + testGuideNotActiveState, + testGuideStep1InProgressState, + testGuideStep2InProgressState, + testIntegration, + wrongIntegration, } from './api.mocks'; -const searchGuide = 'search'; -const firstStep = guidesConfig[searchGuide].steps[0].id; -const lastStep = guidesConfig[searchGuide].steps[guidesConfig[searchGuide].steps.length - 1].id; - describe('GuidedOnboarding ApiService helpers', () => { - // this test suite depends on the guides config describe('isLastStepActive', () => { it('returns true if the passed params are for the last step', () => { - const result = isLastStep(searchGuide, lastStep); + const result = isLastStep(testGuide, testGuideLastStep); expect(result).toBe(true); }); it('returns false if the passed params are not for the last step', () => { - const result = isLastStep(searchGuide, firstStep); + const result = isLastStep(testGuide, testGuideFirstStep); expect(result).toBe(false); }); }); describe('isIntegrationInGuideStep', () => { it('return true if the integration is defined in the guide step config', () => { - const result = isIntegrationInGuideStep(securityAddDataInProgressState, 'endpoint'); + const result = isIntegrationInGuideStep(testGuideStep1InProgressState, testIntegration); expect(result).toBe(true); }); it('returns false if a different integration is defined in the guide step', () => { - const result = isIntegrationInGuideStep(securityAddDataInProgressState, 'kubernetes'); + const result = isIntegrationInGuideStep(testGuideStep1InProgressState, wrongIntegration); expect(result).toBe(false); }); it('returns false if no integration is defined in the guide step', () => { - const result = isIntegrationInGuideStep(securityRulesActiveState, 'endpoint'); + const result = isIntegrationInGuideStep(testGuideStep2InProgressState, testIntegration); expect(result).toBe(false); }); it('returns false if no guide is active', () => { - const result = isIntegrationInGuideStep(noGuideActiveState, 'endpoint'); + const result = isIntegrationInGuideStep(testGuideNotActiveState, testIntegration); expect(result).toBe(false); }); it('returns false if no integration passed', () => { - const result = isIntegrationInGuideStep(securityAddDataInProgressState); + const result = isIntegrationInGuideStep(testGuideStep1InProgressState); expect(result).toBe(false); }); }); diff --git a/src/plugins/guided_onboarding/public/types.ts b/src/plugins/guided_onboarding/public/types.ts index a6536e3caf114..92da97e7e7b96 100755 --- a/src/plugins/guided_onboarding/public/types.ts +++ b/src/plugins/guided_onboarding/public/types.ts @@ -6,9 +6,11 @@ * Side Public License, v 1. */ +import React from 'react'; import { Observable } from 'rxjs'; import { HttpSetup } from '@kbn/core/public'; import type { GuideState, GuideId, GuideStepIds, StepStatus } from '@kbn/guided-onboarding'; +import type { CloudStart } from '@kbn/cloud-plugin/public'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface GuidedOnboardingPluginSetup {} @@ -17,6 +19,10 @@ export interface GuidedOnboardingPluginStart { guidedOnboardingApi?: GuidedOnboardingApi; } +export interface AppPluginStartDependencies { + cloud?: CloudStart; +} + export interface GuidedOnboardingApi { setup: (httpClient: HttpSetup) => void; fetchActiveGuideState$: () => Observable<GuideState | undefined>; @@ -49,7 +55,10 @@ export interface GuidedOnboardingApi { export interface StepConfig { id: GuideStepIds; title: string; - descriptionList: string[]; + // description is displayed as a single paragraph, can be combined with description list + description?: string; + // description list is displayed as an unordered list, can be combined with description + descriptionList?: Array<string | React.ReactNode>; location?: { appID: string; path: string; diff --git a/src/plugins/guided_onboarding/tsconfig.json b/src/plugins/guided_onboarding/tsconfig.json index 4a024443419ad..4833767f0d6ec 100644 --- a/src/plugins/guided_onboarding/tsconfig.json +++ b/src/plugins/guided_onboarding/tsconfig.json @@ -4,16 +4,16 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, + { "path": "../../../x-pack/plugins/cloud/tsconfig.json" }, ] } diff --git a/src/plugins/home/public/application/components/__snapshots__/home.test.tsx.snap b/src/plugins/home/public/application/components/__snapshots__/home.test.tsx.snap index 3cc05cb41c6f9..53df35833013f 100644 --- a/src/plugins/home/public/application/components/__snapshots__/home.test.tsx.snap +++ b/src/plugins/home/public/application/components/__snapshots__/home.test.tsx.snap @@ -28,8 +28,10 @@ exports[`home change home route should render a link to change the default route "integrations": true, }, }, + "navigateToUrl": [MockFunction], } } + isCloudEnabled={false} isDarkMode={false} /> <ManageData @@ -41,6 +43,7 @@ exports[`home change home route should render a link to change the default route "integrations": true, }, }, + "navigateToUrl": [MockFunction], } } features={Array []} @@ -82,8 +85,10 @@ exports[`home directories should not render directory entry when showOnHomePage "integrations": true, }, }, + "navigateToUrl": [MockFunction], } } + isCloudEnabled={false} isDarkMode={false} /> <ManageData @@ -95,6 +100,7 @@ exports[`home directories should not render directory entry when showOnHomePage "integrations": true, }, }, + "navigateToUrl": [MockFunction], } } features={Array []} @@ -136,8 +142,10 @@ exports[`home directories should render ADMIN directory entry in "Manage your da "integrations": true, }, }, + "navigateToUrl": [MockFunction], } } + isCloudEnabled={false} isDarkMode={false} /> <ManageData @@ -149,6 +157,7 @@ exports[`home directories should render ADMIN directory entry in "Manage your da "integrations": true, }, }, + "navigateToUrl": [MockFunction], } } features={ @@ -237,8 +246,10 @@ exports[`home directories should render solutions in the "solution section" 1`] "integrations": true, }, }, + "navigateToUrl": [MockFunction], } } + isCloudEnabled={false} isDarkMode={false} /> <ManageData @@ -250,6 +261,7 @@ exports[`home directories should render solutions in the "solution section" 1`] "integrations": true, }, }, + "navigateToUrl": [MockFunction], } } features={Array []} @@ -291,8 +303,22 @@ exports[`home isNewKibanaInstance should safely handle exceptions 1`] = ` "integrations": true, }, }, + "navigateToUrl": [MockFunction] { + "calls": Array [ + Array [ + "./home#/getting_started", + ], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, } } + isCloudEnabled={false} isDarkMode={false} /> <ManageData @@ -304,6 +330,19 @@ exports[`home isNewKibanaInstance should safely handle exceptions 1`] = ` "integrations": true, }, }, + "navigateToUrl": [MockFunction] { + "calls": Array [ + Array [ + "./home#/getting_started", + ], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, } } features={Array []} @@ -345,8 +384,22 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when t "integrations": true, }, }, + "navigateToUrl": [MockFunction] { + "calls": Array [ + Array [ + "./home#/getting_started", + ], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, } } + isCloudEnabled={false} isDarkMode={false} /> <ManageData @@ -358,6 +411,19 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when t "integrations": true, }, }, + "navigateToUrl": [MockFunction] { + "calls": Array [ + Array [ + "./home#/getting_started", + ], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, } } features={Array []} @@ -406,8 +472,10 @@ exports[`home should render home component 1`] = ` "integrations": true, }, }, + "navigateToUrl": [MockFunction], } } + isCloudEnabled={false} isDarkMode={false} /> <ManageData @@ -419,6 +487,7 @@ exports[`home should render home component 1`] = ` "integrations": true, }, }, + "navigateToUrl": [MockFunction], } } features={Array []} diff --git a/src/plugins/home/public/application/components/add_data/__snapshots__/add_data.test.tsx.snap b/src/plugins/home/public/application/components/add_data/__snapshots__/add_data.test.tsx.snap index 58f9581a1ec91..994574890e7a8 100644 --- a/src/plugins/home/public/application/components/add_data/__snapshots__/add_data.test.tsx.snap +++ b/src/plugins/home/public/application/components/add_data/__snapshots__/add_data.test.tsx.snap @@ -28,7 +28,7 @@ exports[`AddData render 1`] = ` <EuiText> <p> <FormattedMessage - defaultMessage="To start working with your data, use one of our many ingest options. Collect data from an app or service, or upload a file. If you're not ready to use your own data, add a sample data set." + defaultMessage="To start working with your data, use one of our many ingest options. Collect data from an app or service, or upload a file. If you're not ready to use your own data, play with a sample data set." id="home.addData.text" values={Object {}} /> @@ -37,8 +37,6 @@ exports[`AddData render 1`] = ` <EuiSpacer /> <EuiFlexGroup gutterSize="m" - responsive={false} - wrap={true} > <EuiFlexItem grow={false} @@ -57,6 +55,7 @@ exports[`AddData render 1`] = ` <EuiButton data-test-subj="homeAddData" fill={true} + fullWidth={true} href="/app/integrations/browse" iconType="plusInCircle" onClick={[Function]} diff --git a/src/plugins/home/public/application/components/add_data/add_data.test.tsx b/src/plugins/home/public/application/components/add_data/add_data.test.tsx index 92a43fc081172..da413344fcbc6 100644 --- a/src/plugins/home/public/application/components/add_data/add_data.test.tsx +++ b/src/plugins/home/public/application/components/add_data/add_data.test.tsx @@ -40,6 +40,7 @@ describe('AddData', () => { addBasePath={addBasePathMock} application={applicationStartMock} isDarkMode={false} + isCloudEnabled={false} /> ); expect(component).toMatchSnapshot(); diff --git a/src/plugins/home/public/application/components/add_data/add_data.tsx b/src/plugins/home/public/application/components/add_data/add_data.tsx index 27f98a85ff4e8..a3cdbd9241020 100644 --- a/src/plugins/home/public/application/components/add_data/add_data.tsx +++ b/src/plugins/home/public/application/components/add_data/add_data.tsx @@ -29,9 +29,10 @@ interface Props { addBasePath: (path: string) => string; application: ApplicationStart; isDarkMode: boolean; + isCloudEnabled: boolean; } -export const AddData: FC<Props> = ({ addBasePath, application, isDarkMode }) => { +export const AddData: FC<Props> = ({ addBasePath, application, isDarkMode, isCloudEnabled }) => { const { trackUiMetric } = getServices(); const canAccessIntegrations = application.capabilities.navLinks.integrations; if (canAccessIntegrations) { @@ -59,26 +60,47 @@ export const AddData: FC<Props> = ({ addBasePath, application, isDarkMode }) => <p> <FormattedMessage id="home.addData.text" - defaultMessage="To start working with your data, use one of our many ingest options. Collect data from an app or service, or upload a file. If you're not ready to use your own data, add a sample data set." + defaultMessage="To start working with your data, use one of our many ingest options. Collect data from an app or service, or upload a file. If you're not ready to use your own data, play with a sample data set." /> </p> </EuiText> <EuiSpacer /> - <EuiFlexGroup gutterSize="m" responsive={false} wrap> + <EuiFlexGroup gutterSize="m"> + {isCloudEnabled && ( + <EuiFlexItem grow={false}> + {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} + <EuiButton + data-test-subj="guidedOnboardingLink" + fill + href={addBasePath('#/getting_started')} + onClick={(event: MouseEvent) => { + trackUiMetric(METRIC_TYPE.CLICK, 'guided_onboarding_link'); + }} + > + <FormattedMessage + id="home.addData.guidedOnboardingLinkLabel" + defaultMessage="Launch setup guide" + /> + </EuiButton> + </EuiFlexItem> + )} <EuiFlexItem grow={false}> <RedirectAppLinks application={application}> {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} <EuiButton data-test-subj="homeAddData" - fill + // on self managed this button is primary + // on Cloud this button is secondary, because there is a "guided onboarding" button + fill={!isCloudEnabled} href={addBasePath('/app/integrations/browse')} iconType="plusInCircle" onClick={(event: MouseEvent) => { trackUiMetric(METRIC_TYPE.CLICK, 'home_tutorial_directory'); createAppNavigationHandler('/app/integrations/browse')(event); }} + fullWidth > <FormattedMessage id="home.addData.addDataButtonLabel" diff --git a/src/plugins/home/public/application/components/guided_onboarding/__snapshots__/getting_started.test.tsx.snap b/src/plugins/home/public/application/components/guided_onboarding/__snapshots__/getting_started.test.tsx.snap index 1cca5beaea251..685e36e46810c 100644 --- a/src/plugins/home/public/application/components/guided_onboarding/__snapshots__/getting_started.test.tsx.snap +++ b/src/plugins/home/public/application/components/guided_onboarding/__snapshots__/getting_started.test.tsx.snap @@ -52,7 +52,9 @@ exports[`getting started should render getting started component 1`] = ` columns={4} gutterSize="l" > - <EuiFlexItem> + <EuiFlexItem + key="guideCard-search" + > <GuideCard activateGuide={[Function]} addBasePath={[MockFunction]} @@ -61,7 +63,9 @@ exports[`getting started should render getting started component 1`] = ` useCase="search" /> </EuiFlexItem> - <EuiFlexItem> + <EuiFlexItem + key="guideCard-observability" + > <GuideCard activateGuide={[Function]} addBasePath={[MockFunction]} @@ -70,14 +74,18 @@ exports[`getting started should render getting started component 1`] = ` useCase="observability" /> </EuiFlexItem> - <EuiFlexItem> + <EuiFlexItem + key="linkCard-observabilityLink" + > <ObservabilityLinkCard addBasePath={[MockFunction]} isDarkTheme={false} navigateToApp={[MockFunction]} /> </EuiFlexItem> - <EuiFlexItem> + <EuiFlexItem + key="guideCard-security" + > <GuideCard activateGuide={[Function]} addBasePath={[MockFunction]} @@ -94,7 +102,7 @@ exports[`getting started should render getting started component 1`] = ` className="eui-textCenter" > <EuiLink - data-test-subj="onboarding--skipUseCaseTourLink" + data-test-subj="onboarding--skipGuideLink" onClick={[Function]} > I’d like to do something else (skip) diff --git a/src/plugins/home/public/application/components/guided_onboarding/getting_started.test.tsx b/src/plugins/home/public/application/components/guided_onboarding/getting_started.test.tsx index 8b2ca1de830a0..624e56b85538e 100644 --- a/src/plugins/home/public/application/components/guided_onboarding/getting_started.test.tsx +++ b/src/plugins/home/public/application/components/guided_onboarding/getting_started.test.tsx @@ -17,11 +17,13 @@ jest.mock('../../kibana_services', () => { const { chromeServiceMock, applicationServiceMock } = jest.requireActual('@kbn/core/public/mocks'); const { uiSettingsServiceMock } = jest.requireActual('@kbn/core-ui-settings-browser-mocks'); + const { cloudMock } = jest.requireActual('@kbn/cloud-plugin/public/mocks'); const uiSettingsMock = uiSettingsServiceMock.createSetupContract(); uiSettingsMock.get.mockReturnValue(false); return { getServices: () => ({ + cloud: cloudMock.createSetup(), chrome: chromeServiceMock.createStartContract(), application: applicationServiceMock.createStartContract(), trackUiMetric: jest.fn(), @@ -56,7 +58,7 @@ describe('getting started', () => { test('skip button should disable home welcome screen', async () => { const component = mountWithIntl(<GettingStarted />); - const skipButton = findTestSubject(component, 'onboarding--skipUseCaseTourLink'); + const skipButton = findTestSubject(component, 'onboarding--skipGuideLink'); skipButton.simulate('click'); expect(localStorage.getItem(KEY_ENABLE_WELCOME)).toBe('false'); diff --git a/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx b/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx index e63676ca3ca72..eb7f05ef7161a 100644 --- a/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx +++ b/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx @@ -21,6 +21,7 @@ import { } from '@elastic/eui'; import { css } from '@emotion/react'; +import { useHistory } from 'react-router-dom'; import { METRIC_TYPE } from '@kbn/analytics'; import { i18n } from '@kbn/i18n'; import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; @@ -45,9 +46,10 @@ const skipText = i18n.translate('home.guidedOnboarding.gettingStarted.skip.butto }); export const GettingStarted = () => { - const { application, trackUiMetric, chrome, guidedOnboardingService, http, uiSettings } = + const { application, trackUiMetric, chrome, guidedOnboardingService, http, uiSettings, cloud } = getServices(); const [guidesState, setGuidesState] = useState<GuideState[]>([]); + const history = useHistory(); useEffect(() => { chrome.setBreadcrumbs([ @@ -76,6 +78,12 @@ export const GettingStarted = () => { fetchGuidesState(); }, [fetchGuidesState]); + useEffect(() => { + if (cloud?.isCloudEnabled === false) { + return history.push('/'); + } + }, [cloud, history]); + const onSkip = () => { trackUiMetric(METRIC_TYPE.CLICK, 'guided_onboarding__skipped'); // disable welcome screen on the home page @@ -92,6 +100,7 @@ export const GettingStarted = () => { await guidedOnboardingService?.activateGuide(useCase as GuideId, guideState); // TODO error handling https://github.com/elastic/kibana/issues/139798 }; + return ( <KibanaPageTemplate panelled={false} grow> <EuiPageTemplate.Section alignment="center"> @@ -109,7 +118,7 @@ export const GettingStarted = () => { {['search', 'observability', 'observabilityLink', 'security'].map((useCase) => { if (useCase === 'observabilityLink') { return ( - <EuiFlexItem> + <EuiFlexItem key={`linkCard-${useCase}`}> <ObservabilityLinkCard navigateToApp={application.navigateToApp} isDarkTheme={isDarkTheme} @@ -119,7 +128,7 @@ export const GettingStarted = () => { ); } return ( - <EuiFlexItem> + <EuiFlexItem key={`guideCard-${useCase}`}> <GuideCard useCase={useCase as UseCase} guides={guidesState} @@ -136,7 +145,7 @@ export const GettingStarted = () => { <EuiSpacer /> <div className="eui-textCenter"> {/* data-test-subj used for FS tracking */} - <EuiLink onClick={onSkip} data-test-subj="onboarding--skipUseCaseTourLink"> + <EuiLink onClick={onSkip} data-test-subj="onboarding--skipGuideLink"> {skipText} </EuiLink> </div> diff --git a/src/plugins/home/public/application/components/home.test.tsx b/src/plugins/home/public/application/components/home.test.tsx index 578afe8de6b86..806ceed7d7591 100644 --- a/src/plugins/home/public/application/components/home.test.tsx +++ b/src/plugins/home/public/application/components/home.test.tsx @@ -14,6 +14,7 @@ import { Home } from './home'; import { Welcome } from './welcome'; let mockHasIntegrationsPermission = true; +const mockNavigateToUrl = jest.fn(); jest.mock('../kibana_services', () => ({ getServices: () => ({ getBasePath: () => 'path', @@ -23,6 +24,7 @@ jest.mock('../kibana_services', () => ({ setBreadcrumbs: () => {}, }, application: { + navigateToUrl: mockNavigateToUrl, capabilities: { navLinks: { integrations: mockHasIntegrationsPermission, @@ -59,6 +61,7 @@ describe('home', () => { return `base_path/${url}`; }, hasUserDataView: jest.fn(async () => true), + isCloudEnabled: false, }; }); @@ -230,6 +233,16 @@ describe('home', () => { expect(component.find(Welcome).exists()).toBe(false); }); + + test('should redirect to guided onboarding on Cloud instead of welcome screen', async () => { + const isCloudEnabled = true; + const hasUserDataView = jest.fn(async () => false); + + const component = await renderHome({ isCloudEnabled, hasUserDataView }); + + expect(component.find(Welcome).exists()).toBe(false); + expect(mockNavigateToUrl).toHaveBeenCalledTimes(1); + }); }); describe('isNewKibanaInstance', () => { diff --git a/src/plugins/home/public/application/components/home.tsx b/src/plugins/home/public/application/components/home.tsx index f6b579213d420..707ea99ad8af4 100644 --- a/src/plugins/home/public/application/components/home.tsx +++ b/src/plugins/home/public/application/components/home.tsx @@ -33,6 +33,7 @@ export interface HomeProps { localStorage: Storage; urlBasePath: string; hasUserDataView: () => Promise<boolean>; + isCloudEnabled: boolean; } interface State { @@ -126,7 +127,7 @@ export class Home extends Component<HomeProps, State> { } private renderNormal() { - const { addBasePath, solutions } = this.props; + const { addBasePath, solutions, isCloudEnabled } = this.props; const { application, trackUiMetric } = getServices(); const isDarkMode = getServices().uiSettings?.get('theme:darkMode') || false; const devTools = this.findDirectoryById('console'); @@ -148,7 +149,12 @@ export class Home extends Component<HomeProps, State> { > <SolutionsSection addBasePath={addBasePath} solutions={solutions} /> - <AddData addBasePath={addBasePath} application={application} isDarkMode={isDarkMode} /> + <AddData + addBasePath={addBasePath} + application={application} + isDarkMode={isDarkMode} + isCloudEnabled={isCloudEnabled} + /> <ManageData addBasePath={addBasePath} @@ -182,12 +188,18 @@ export class Home extends Component<HomeProps, State> { public render() { const { isLoading, isWelcomeEnabled, isNewKibanaInstance } = this.state; + const { isCloudEnabled } = this.props; + const { application } = getServices(); if (isWelcomeEnabled) { if (isLoading) { return this.renderLoading(); } if (isNewKibanaInstance) { + if (isCloudEnabled) { + application.navigateToUrl('./home#/getting_started'); + return; + } return this.renderWelcome(); } } diff --git a/src/plugins/home/public/application/components/home_app.js b/src/plugins/home/public/application/components/home_app.js index af7b1dec48669..a6cdfec3b62e9 100644 --- a/src/plugins/home/public/application/components/home_app.js +++ b/src/plugins/home/public/application/components/home_app.js @@ -79,6 +79,7 @@ export function HomeApp({ directories, solutions }) { localStorage={localStorage} urlBasePath={getBasePath()} hasUserDataView={() => dataViewsService.hasUserDataView()} + isCloudEnabled={isCloudEnabled} /> </Route> <Redirect to="/" /> diff --git a/src/plugins/home/public/application/components/manage_data/manage_data.tsx b/src/plugins/home/public/application/components/manage_data/manage_data.tsx index 9b93d3149c342..9ea508a9b871e 100644 --- a/src/plugins/home/public/application/components/manage_data/manage_data.tsx +++ b/src/plugins/home/public/application/components/manage_data/manage_data.tsx @@ -15,7 +15,6 @@ import { ApplicationStart } from '@kbn/core/public'; import { RedirectAppLinks } from '@kbn/kibana-react-plugin/public'; import { FeatureCatalogueEntry } from '../../../services'; import { createAppNavigationHandler } from '../app_navigation_handler'; -// @ts-expect-error untyped component import { Synopsis } from '../synopsis'; import { getServices } from '../../kibana_services'; diff --git a/src/plugins/home/public/application/components/sample_data/index.tsx b/src/plugins/home/public/application/components/sample_data/index.tsx index 8ce7a32b66e08..316ba615ce818 100644 --- a/src/plugins/home/public/application/components/sample_data/index.tsx +++ b/src/plugins/home/public/application/components/sample_data/index.tsx @@ -45,7 +45,7 @@ export function SampleDataCard({ urlBasePath, onDecline, onConfirm }: Props) { description={ <FormattedMessage id="home.letsStartDescription" - defaultMessage="Add data to your cluster from any source, then analyze and visualize it in real time. Use our solutions to add search anywhere, observe your ecosystem, and protect against security threats." + defaultMessage="Add data to your cluster from any source, then analyze and visualize it in real time. Use our solutions to add search anywhere, observe your ecosystem, and defend against security threats." /> } footer={ diff --git a/src/plugins/home/public/application/kibana_services.ts b/src/plugins/home/public/application/kibana_services.ts index b622cf862f315..af0a94b232fe6 100644 --- a/src/plugins/home/public/application/kibana_services.ts +++ b/src/plugins/home/public/application/kibana_services.ts @@ -21,6 +21,7 @@ import { UrlForwardingStart } from '@kbn/url-forwarding-plugin/public'; import { DataViewsContract } from '@kbn/data-views-plugin/public'; import { SharePluginSetup } from '@kbn/share-plugin/public'; import { GuidedOnboardingApi } from '@kbn/guided-onboarding-plugin/public'; +import { CloudSetup } from '@kbn/cloud-plugin/public'; import { TutorialService } from '../services/tutorials'; import { AddDataService } from '../services/add_data'; import { FeatureCatalogueRegistry } from '../services/feature_catalogue'; @@ -51,6 +52,7 @@ export interface HomeKibanaServices { addDataService: AddDataService; welcomeService: WelcomeService; guidedOnboardingService?: GuidedOnboardingApi; + cloud?: CloudSetup; } let services: HomeKibanaServices | null = null; diff --git a/src/plugins/home/public/plugin.ts b/src/plugins/home/public/plugin.ts index c85f920fca6e1..b7270058aae6c 100644 --- a/src/plugins/home/public/plugin.ts +++ b/src/plugins/home/public/plugin.ts @@ -105,6 +105,7 @@ export class HomePublicPlugin featureCatalogue: this.featuresCatalogueRegistry, welcomeService: this.welcomeService, guidedOnboardingService: guidedOnboarding.guidedOnboardingApi, + cloud, }); coreStart.chrome.docTitle.change( i18n.translate('home.pageTitle', { defaultMessage: 'Home' }) diff --git a/src/plugins/home/tsconfig.json b/src/plugins/home/tsconfig.json index af12fb12f3381..b7c8c94e30b8b 100644 --- a/src/plugins/home/tsconfig.json +++ b/src/plugins/home/tsconfig.json @@ -4,11 +4,10 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": ["common/**/*", "public/**/*", "server/**/*", "config.ts", ".storybook/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data_views/tsconfig.json" }, { "path": "../custom_integrations/tsconfig.json" }, diff --git a/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap b/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap index eab52795fefaa..f8e7048f7a9d6 100644 --- a/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap +++ b/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap @@ -1,53 +1,61 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`disableMsg 1`] = ` -<FormRow - controlIndex={0} - disableMsg="control is disabled to test rendering when disabled" - id="mock-list-control" - label="list control" +<EuiThemeProvider + colorMode="light" > - <EuiFieldText - aria-label="Select..." - disabled={true} - placeholder="Select..." - /> -</FormRow> + <FormRow + controlIndex={0} + disableMsg="control is disabled to test rendering when disabled" + id="mock-list-control" + label="list control" + > + <EuiFieldText + aria-label="Select..." + disabled={true} + placeholder="Select..." + /> + </FormRow> +</EuiThemeProvider> `; exports[`renders ListControl 1`] = ` -<FormRow - controlIndex={0} - id="mock-list-control" - label="list control" +<EuiThemeProvider + colorMode="light" > - <EuiComboBox - async={false} - compressed={false} - data-test-subj="listControlSelect0" - fullWidth={false} - inputRef={[Function]} - isClearable={true} - isLoading={false} - onChange={[Function]} - options={ - Array [ - Object { - "data-test-subj": "option_choice1", - "label": "choice1 + formatting", - "value": "choice1", - }, - Object { - "data-test-subj": "option_choice2", - "label": "choice2 + formatting", - "value": "choice2", - }, - ] - } - placeholder="Select..." - selectedOptions={Array []} - singleSelection={false} - sortMatchesBy="none" - /> -</FormRow> + <FormRow + controlIndex={0} + id="mock-list-control" + label="list control" + > + <EuiComboBox + async={false} + compressed={false} + data-test-subj="listControlSelect0" + fullWidth={false} + inputRef={[Function]} + isClearable={true} + isLoading={false} + onChange={[Function]} + options={ + Array [ + Object { + "data-test-subj": "option_choice1", + "label": "choice1 + formatting", + "value": "choice1", + }, + Object { + "data-test-subj": "option_choice2", + "label": "choice2 + formatting", + "value": "choice2", + }, + ] + } + placeholder="Select..." + selectedOptions={Array []} + singleSelection={false} + sortMatchesBy="none" + /> + </FormRow> +</EuiThemeProvider> `; diff --git a/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx b/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx index faeae649021df..3331f0eb012d5 100644 --- a/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx +++ b/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx @@ -39,6 +39,7 @@ interface InputControlVisProps { hasChanges: () => boolean; hasValues: () => boolean; refreshControl: (controlIndex: number, query: any) => Promise<void>; + isDarkMode?: boolean; } export class InputControlVis extends Component<InputControlVisProps> { @@ -83,6 +84,7 @@ export class InputControlVis extends Component<InputControlVisProps> { fetchOptions={(query) => { this.props.refreshControl(index, query); }} + isDarkMode={this.props.isDarkMode} /> ); } else if (isRangeControl(control)) { diff --git a/src/plugins/input_control_vis/public/components/vis/list_control.tsx b/src/plugins/input_control_vis/public/components/vis/list_control.tsx index 6ffc342bede2a..729f095392744 100644 --- a/src/plugins/input_control_vis/public/components/vis/list_control.tsx +++ b/src/plugins/input_control_vis/public/components/vis/list_control.tsx @@ -10,7 +10,7 @@ import React, { PureComponent } from 'react'; import _ from 'lodash'; import { injectI18n, InjectedIntlProps } from '@kbn/i18n-react'; -import { EuiFieldText, EuiComboBox } from '@elastic/eui'; +import { EuiFieldText, EuiComboBox, EuiThemeProvider } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormRow } from './form_row'; @@ -31,6 +31,7 @@ export type ListControlUiProps = InjectedIntlProps & { controlIndex: number; stageFilter: (controlIndex: number, value: any) => void; fetchOptions?: (searchValue: string) => void; + isDarkMode?: boolean; }; class ListControlUi extends PureComponent<ListControlUiProps, ListControlUiState> { @@ -164,15 +165,17 @@ class ListControlUi extends PureComponent<ListControlUiProps, ListControlUiState ); return ( - <FormRow - id={this.props.id} - label={this.props.label} - warningMsg={this.props.partialResults ? partialResultsWarningMessage : undefined} - controlIndex={this.props.controlIndex} - disableMsg={this.props.disableMsg} - > - {this.renderControl()} - </FormRow> + <EuiThemeProvider colorMode={this.props.isDarkMode ? 'dark' : 'light'}> + <FormRow + id={this.props.id} + label={this.props.label} + warningMsg={this.props.partialResults ? partialResultsWarningMessage : undefined} + controlIndex={this.props.controlIndex} + disableMsg={this.props.disableMsg} + > + {this.renderControl()} + </FormRow> + </EuiThemeProvider> ); } } diff --git a/src/plugins/input_control_vis/public/vis_controller.tsx b/src/plugins/input_control_vis/public/vis_controller.tsx index 8916f311bf912..e13b29d41a6e9 100644 --- a/src/plugins/input_control_vis/public/vis_controller.tsx +++ b/src/plugins/input_control_vis/public/vis_controller.tsx @@ -42,6 +42,7 @@ export const createInputControlVisController = ( updateSubsciption: any; timeFilterSubscription: Subscription; visParams?: InputControlVisParams; + isDarkMode?: boolean; constructor() { this.controls = []; @@ -59,6 +60,8 @@ export const createInputControlVisController = ( isLoaded = false; } }); + + this.isDarkMode = deps.core.uiSettings.get('theme:darkMode'); } async render(visParams: InputControlVisParams) { @@ -100,6 +103,7 @@ export const createInputControlVisController = ( hasChanges={this.hasChanges} hasValues={this.hasValues} refreshControl={this.refreshControl} + isDarkMode={this.isDarkMode} /> </VisualizationContainer> </I18nContext>, diff --git a/src/plugins/input_control_vis/tsconfig.json b/src/plugins/input_control_vis/tsconfig.json index 1840efb32bbcf..0fd1cae17a21d 100644 --- a/src/plugins/input_control_vis/tsconfig.json +++ b/src/plugins/input_control_vis/tsconfig.json @@ -4,13 +4,12 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../kibana_react/tsconfig.json" }, { "path": "../data/tsconfig.json"}, { "path": "../data_views/tsconfig.json"}, diff --git a/src/plugins/inspector/tsconfig.json b/src/plugins/inspector/tsconfig.json index fd82c73d087cc..5ccf9c81aee71 100644 --- a/src/plugins/inspector/tsconfig.json +++ b/src/plugins/inspector/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "index.ts"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, { "path": "../share/tsconfig.json" } diff --git a/src/plugins/interactive_setup/server/elasticsearch_service.test.ts b/src/plugins/interactive_setup/server/elasticsearch_service.test.ts index 717c6bf56481a..bfc3f1b2daba5 100644 --- a/src/plugins/interactive_setup/server/elasticsearch_service.test.ts +++ b/src/plugins/interactive_setup/server/elasticsearch_service.test.ts @@ -86,7 +86,7 @@ describe('ElasticsearchService', () => { }); describe('#connectionStatus$', () => { - beforeEach(() => jest.useFakeTimers()); + beforeEach(() => jest.useFakeTimers('legacy')); afterEach(() => jest.useRealTimers()); it('does not repeat ping request if have multiple subscriptions', async () => { diff --git a/src/plugins/interactive_setup/tsconfig.json b/src/plugins/interactive_setup/tsconfig.json index 6ebeff836f69b..d3b0e79241850 100644 --- a/src/plugins/interactive_setup/tsconfig.json +++ b/src/plugins/interactive_setup/tsconfig.json @@ -4,8 +4,7 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [{ "path": "../../core/tsconfig.json" }] + "kbn_references": [{ "path": "../../core/tsconfig.json" }] } diff --git a/src/plugins/kibana_overview/public/components/add_data/add_data.tsx b/src/plugins/kibana_overview/public/components/add_data/add_data.tsx index 172fd7864a0b9..6720f87c31175 100644 --- a/src/plugins/kibana_overview/public/components/add_data/add_data.tsx +++ b/src/plugins/kibana_overview/public/components/add_data/add_data.tsx @@ -13,7 +13,6 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from '@kbn/core/public'; import { RedirectAppLinks, useKibana } from '@kbn/kibana-react-plugin/public'; import { FeatureCatalogueEntry } from '@kbn/home-plugin/public'; -// @ts-expect-error untyped component import { Synopsis } from '../synopsis'; import { METRIC_TYPE, trackUiMetric } from '../../lib/ui_metric'; diff --git a/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx b/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx index 376af562221c7..9d3d6476db9c5 100644 --- a/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx +++ b/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx @@ -13,7 +13,6 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from '@kbn/core/public'; import { RedirectAppLinks, useKibana } from '@kbn/kibana-react-plugin/public'; import { FeatureCatalogueEntry } from '@kbn/home-plugin/public'; -// @ts-expect-error untyped component import { Synopsis } from '../synopsis'; import { METRIC_TYPE, trackUiMetric } from '../../lib/ui_metric'; diff --git a/src/plugins/kibana_overview/tsconfig.json b/src/plugins/kibana_overview/tsconfig.json index ffa89f25316a9..98d5602cbd1a0 100644 --- a/src/plugins/kibana_overview/tsconfig.json +++ b/src/plugins/kibana_overview/tsconfig.json @@ -4,13 +4,12 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", "common/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../../plugins/navigation/tsconfig.json" }, { "path": "../../plugins/data/tsconfig.json" }, diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.stories.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.stories.tsx index c85e03c433d67..b6edbbd1da976 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.stories.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.stories.tsx @@ -238,4 +238,39 @@ storiesOf('CodeEditor', module) text: 'Hover dialog example can be triggered by hovering over a word', }, } + ) + .add( + 'json support', + () => ( + <div> + <CodeEditor + languageId="json" + editorDidMount={(editor) => { + monacoEditor.languages.json.jsonDefaults.setDiagnosticsOptions({ + validate: true, + schemas: [ + { + uri: editor.getModel()?.uri.toString() ?? '', + fileMatch: ['*'], + schema: { + type: 'object', + properties: { + version: { + enum: ['v1', 'v2'], + }, + }, + }, + }, + ], + }); + }} + height={250} + value="{}" + onChange={action('onChange')} + /> + </div> + ), + { + info: { text: 'JSON language support' }, + } ); diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx index 97a8d8a849083..6d9b4f4ce384f 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx @@ -34,23 +34,36 @@ const simpleLogLang: monaco.languages.IMonarchLanguage = { }, }; -monaco.languages.register({ id: 'loglang' }); -monaco.languages.setMonarchTokensProvider('loglang', simpleLogLang); - const logs = ` [Sun Mar 7 20:54:27 2004] [notice] [client xx.xx.xx.xx] This is a notice! [Sun Mar 7 20:58:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed [Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome `; -class ResizeObserver { - observe() {} - unobserve() {} - disconnect() {} -} - describe('<CodeEditor />', () => { - window.ResizeObserver = ResizeObserver; + beforeAll(() => { + Object.defineProperty(window, 'matchMedia', { + writable: true, + value: jest.fn().mockImplementation((query) => ({ + matches: false, + media: query, + onchange: null, + addListener: jest.fn(), // deprecated + removeListener: jest.fn(), // deprecated + addEventListener: jest.fn(), + removeEventListener: jest.fn(), + dispatchEvent: jest.fn(), + })), + }); + window.ResizeObserver = class ResizeObserver { + observe() {} + unobserve() {} + disconnect() {} + }; + + monaco.languages.register({ id: 'loglang' }); + monaco.languages.setMonarchTokensProvider('loglang', simpleLogLang); + }); test('is rendered', () => { const component = mountWithIntl( diff --git a/src/plugins/kibana_react/public/index.ts b/src/plugins/kibana_react/public/index.ts index 3311f42bff55d..0d01bd9e0dcd2 100644 --- a/src/plugins/kibana_react/public/index.ts +++ b/src/plugins/kibana_react/public/index.ts @@ -72,6 +72,7 @@ export { ValidatedDualRange } from './validated_range'; export type { ToastInput, KibanaReactNotifications } from './notifications'; export { createNotifications } from './notifications'; +/** @deprecated use `Markdown` from `@kbn/shared-ux-markdown` */ export { Markdown, MarkdownSimple } from './markdown'; export { reactToUiComponent, uiToReactComponent } from './adapters'; diff --git a/src/plugins/kibana_react/public/markdown/index.tsx b/src/plugins/kibana_react/public/markdown/index.tsx index 99da8a3c8898c..d0c72d8db8d76 100644 --- a/src/plugins/kibana_react/public/markdown/index.tsx +++ b/src/plugins/kibana_react/public/markdown/index.tsx @@ -17,6 +17,7 @@ const Fallback = () => ( </EuiDelayRender> ); +/** @deprecated use `Markdown` from `@kbn/shared-ux-markdown` */ const LazyMarkdownSimple = React.lazy(() => import('./markdown_simple')); export const MarkdownSimple = (props: MarkdownSimpleProps) => ( <React.Suspense fallback={<Fallback />}> @@ -24,6 +25,7 @@ export const MarkdownSimple = (props: MarkdownSimpleProps) => ( </React.Suspense> ); +/** @deprecated use `Markdown` from `@kbn/shared-ux-markdown` */ const LazyMarkdown = React.lazy(() => import('./markdown')); export const Markdown = (props: MarkdownProps) => ( <React.Suspense fallback={<Fallback />}> diff --git a/src/plugins/kibana_react/tsconfig.json b/src/plugins/kibana_react/tsconfig.json index 43b51a45e08c4..3469a30024b54 100644 --- a/src/plugins/kibana_react/tsconfig.json +++ b/src/plugins/kibana_react/tsconfig.json @@ -4,8 +4,7 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [".storybook/**/*", "common/**/*", "public/**/*", "../../../typings/**/*"], - "references": [{ "path": "../kibana_utils/tsconfig.json" }] + "kbn_references": [{ "path": "../kibana_utils/tsconfig.json" }] } diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts index 4b393a7a1c249..c105b3dd387f0 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts @@ -139,6 +139,7 @@ export const applicationUsageSchema = { elasticsearch: commonSchema, appSearch: commonSchema, workplaceSearch: commonSchema, + searchExperiences: commonSchema, graph: commonSchema, logs: commonSchema, metrics: commonSchema, diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts index 41df488839358..0aa6830adf867 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts @@ -442,6 +442,14 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, }, + 'observability:apmAWSLambdaPriceFactor': { + type: 'text', + _meta: { description: 'Non-default value of setting.' }, + }, + 'observability:apmAWSLambdaRequestCostPerMillion': { + type: 'integer', + _meta: { description: 'Non-default value of setting.' }, + }, 'banners:placement': { type: 'keyword', _meta: { description: 'Non-default value of setting.' }, @@ -546,6 +554,10 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, }, + 'observability:apmEnableCriticalPath': { + type: 'boolean', + _meta: { description: 'Non-default value of setting.' }, + }, 'observability:enableInfrastructureHostsView': { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts index 2bd59dc69084f..88220ed367886 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts @@ -43,6 +43,8 @@ export interface UsageStats { 'observability:enableComparisonByDefault': boolean; 'observability:enableServiceGroups': boolean; 'observability:apmEnableServiceMetrics': boolean; + 'observability:apmAWSLambdaPriceFactor': string; + 'observability:apmAWSLambdaRequestCostPerMillion': number; 'observability:enableInfrastructureHostsView': boolean; 'visualize:enableLabs': boolean; 'visualization:heatmap:maxBuckets': number; @@ -147,6 +149,7 @@ export interface UsageStats { 'observability:apmServiceGroupMaxNumberOfServices': number; 'observability:apmServiceInventoryOptimizedSorting': boolean; 'observability:apmTraceExplorerTab': boolean; + 'observability:apmEnableCriticalPath': boolean; 'securitySolution:enableGroupedNav': boolean; 'securitySolution:showRelatedIntegrations': boolean; 'visualization:visualize:legacyGaugeChartsLibrary': boolean; diff --git a/src/plugins/kibana_usage_collection/tsconfig.json b/src/plugins/kibana_usage_collection/tsconfig.json index d03ceb4bf3aac..2ad8ff44a3128 100644 --- a/src/plugins/kibana_usage_collection/tsconfig.json +++ b/src/plugins/kibana_usage_collection/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -13,7 +12,7 @@ "server/**/**/*", "../../../typings/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../../plugins/usage_collection/tsconfig.json" }, { "path": "../../plugins/telemetry/tsconfig.json" }, diff --git a/src/plugins/kibana_utils/common/abort_utils.test.ts b/src/plugins/kibana_utils/common/abort_utils.test.ts index 0d34a7852fb44..a528f3e48476e 100644 --- a/src/plugins/kibana_utils/common/abort_utils.test.ts +++ b/src/plugins/kibana_utils/common/abort_utils.test.ts @@ -8,9 +8,10 @@ import { AbortError, abortSignalToPromise } from './abort_utils'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); -const flushPromises = () => new Promise((resolve) => setImmediate(resolve)); +const flushPromises = () => + new Promise((resolve) => jest.requireActual('timers').setImmediate(resolve)); describe('AbortUtils', () => { describe('AbortError', () => { diff --git a/src/plugins/kibana_utils/public/storage/hashed_item_store/hashed_item_store.test.ts b/src/plugins/kibana_utils/public/storage/hashed_item_store/hashed_item_store.test.ts index 20cc81bc3b75b..5148d1ad6c03f 100644 --- a/src/plugins/kibana_utils/public/storage/hashed_item_store/hashed_item_store.test.ts +++ b/src/plugins/kibana_utils/public/storage/hashed_item_store/hashed_item_store.test.ts @@ -109,7 +109,7 @@ describe('hashedItemStore', () => { beforeEach(() => { // Control time. - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); sessionStorage = new StubBrowserStorage(); hashedItemStore = new HashedItemStore(sessionStorage); @@ -199,7 +199,7 @@ describe('hashedItemStore', () => { beforeEach(() => { // Control time. - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); sessionStorage = new StubBrowserStorage(); hashedItemStore = new HashedItemStore(sessionStorage); @@ -350,7 +350,7 @@ describe('hashedItemStore', () => { beforeEach(() => { // Control time. - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); sessionStorage = new StubBrowserStorage(); hashedItemStore = new HashedItemStore(sessionStorage); }); diff --git a/src/plugins/kibana_utils/tsconfig.json b/src/plugins/kibana_utils/tsconfig.json index 0fba68be6aa57..1b5d5491ff28a 100644 --- a/src/plugins/kibana_utils/tsconfig.json +++ b/src/plugins/kibana_utils/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -14,5 +13,5 @@ "index.ts", "../../../typings/**/*" ], - "references": [{ "path": "../../core/tsconfig.json" }] + "kbn_references": [{ "path": "../../core/tsconfig.json" }] } diff --git a/src/plugins/management/kibana.json b/src/plugins/management/kibana.json index bf285cbbeadd3..c3659ce2232fa 100644 --- a/src/plugins/management/kibana.json +++ b/src/plugins/management/kibana.json @@ -7,6 +7,6 @@ "requiredBundles": ["kibanaReact", "kibanaUtils"], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" } } diff --git a/src/plugins/management/tsconfig.json b/src/plugins/management/tsconfig.json index beef79c9affd0..27031a7f93243 100644 --- a/src/plugins/management/tsconfig.json +++ b/src/plugins/management/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "server/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../home/tsconfig.json"}, { "path": "../kibana_react/tsconfig.json"}, diff --git a/src/plugins/maps_ems/tsconfig.json b/src/plugins/maps_ems/tsconfig.json index e8f3d380639f9..0060910ae4e0a 100644 --- a/src/plugins/maps_ems/tsconfig.json +++ b/src/plugins/maps_ems/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*", "./config.ts"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../../../x-pack/plugins/licensing/tsconfig.json" } ] diff --git a/src/plugins/navigation/tsconfig.json b/src/plugins/navigation/tsconfig.json index ca9acf96f4190..5586a0d795ebd 100644 --- a/src/plugins/navigation/tsconfig.json +++ b/src/plugins/navigation/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["public/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, { "path": "../data/tsconfig.json" }, diff --git a/src/plugins/newsfeed/public/plugin.test.ts b/src/plugins/newsfeed/public/plugin.test.ts index a082b81dc84be..2ab54026a4cfb 100644 --- a/src/plugins/newsfeed/public/plugin.test.ts +++ b/src/plugins/newsfeed/public/plugin.test.ts @@ -16,7 +16,7 @@ describe('Newsfeed plugin', () => { let plugin: NewsfeedPublicPlugin; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/src/plugins/newsfeed/tsconfig.json b/src/plugins/newsfeed/tsconfig.json index e1558370fdd04..051ecbe4f202c 100644 --- a/src/plugins/newsfeed/tsconfig.json +++ b/src/plugins/newsfeed/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["public/**/*", "server/**/*", "common/*", "../../../typings/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json"}, { "path": "../screenshot_mode/tsconfig.json" } diff --git a/src/plugins/presentation_util/public/components/expression_input/language.ts b/src/plugins/presentation_util/public/components/expression_input/language.ts index 03b868af42aaa..8f50ae97fa83d 100644 --- a/src/plugins/presentation_util/public/components/expression_input/language.ts +++ b/src/plugins/presentation_util/public/components/expression_input/language.ts @@ -115,6 +115,8 @@ const expressionsLanguage: ExpressionsLanguage = { export function registerExpressionsLanguage(functions: ExpressionFunction[]) { expressionsLanguage.keywords = functions.map((fn) => fn.name); expressionsLanguage.deprecated = functions.filter((fn) => fn.deprecated).map((fn) => fn.name); - monaco.languages.register({ id: EXPRESSIONS_LANGUAGE_ID }); - monaco.languages.setMonarchTokensProvider(EXPRESSIONS_LANGUAGE_ID, expressionsLanguage); + monaco.languages.onLanguage(EXPRESSIONS_LANGUAGE_ID, () => { + monaco.languages.register({ id: EXPRESSIONS_LANGUAGE_ID }); + monaco.languages.setMonarchTokensProvider(EXPRESSIONS_LANGUAGE_ID, expressionsLanguage); + }); } diff --git a/src/plugins/presentation_util/tsconfig.json b/src/plugins/presentation_util/tsconfig.json index 38f2cf3c14a12..a4bc9c05f4a9a 100644 --- a/src/plugins/presentation_util/tsconfig.json +++ b/src/plugins/presentation_util/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "extraPublicDirs": ["common"], "include": [ @@ -15,7 +14,7 @@ "storybook/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../saved_objects/tsconfig.json" }, { "path": "../embeddable/tsconfig.json" }, diff --git a/src/plugins/saved_objects/tsconfig.json b/src/plugins/saved_objects/tsconfig.json index b8761ab81fa78..fbc175869da2e 100644 --- a/src/plugins/saved_objects/tsconfig.json +++ b/src/plugins/saved_objects/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, diff --git a/src/plugins/saved_objects_finder/tsconfig.json b/src/plugins/saved_objects_finder/tsconfig.json index 547ab2cc357f7..197d86c7b1435 100644 --- a/src/plugins/saved_objects_finder/tsconfig.json +++ b/src/plugins/saved_objects_finder/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../saved_objects_management/tsconfig.json" } ] diff --git a/src/plugins/saved_objects_management/tsconfig.json b/src/plugins/saved_objects_management/tsconfig.json index 58483e144aab8..c6c8e80f82341 100644 --- a/src/plugins/saved_objects_management/tsconfig.json +++ b/src/plugins/saved_objects_management/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, { "path": "../home/tsconfig.json" }, diff --git a/src/plugins/saved_objects_tagging_oss/tsconfig.json b/src/plugins/saved_objects_tagging_oss/tsconfig.json index 5a3f642a9d6ea..1126b3175a76e 100644 --- a/src/plugins/saved_objects_tagging_oss/tsconfig.json +++ b/src/plugins/saved_objects_tagging_oss/tsconfig.json @@ -4,13 +4,12 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../saved_objects/tsconfig.json" }, ] diff --git a/src/plugins/saved_search/tsconfig.json b/src/plugins/saved_search/tsconfig.json index 288f30441b922..785abeea70a3e 100644 --- a/src/plugins/saved_search/tsconfig.json +++ b/src/plugins/saved_search/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "server/**/*", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, diff --git a/src/plugins/screenshot_mode/tsconfig.json b/src/plugins/screenshot_mode/tsconfig.json index 832972ae0baa0..5762571bd5bbd 100644 --- a/src/plugins/screenshot_mode/tsconfig.json +++ b/src/plugins/screenshot_mode/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", "server/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, ] } diff --git a/src/plugins/share/tsconfig.json b/src/plugins/share/tsconfig.json index 2633d840895d6..80ef97d5006cc 100644 --- a/src/plugins/share/tsconfig.json +++ b/src/plugins/share/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" } diff --git a/src/plugins/telemetry/README.md b/src/plugins/telemetry/README.md index df0070effe754..6b57eeda9dc80 100644 --- a/src/plugins/telemetry/README.md +++ b/src/plugins/telemetry/README.md @@ -51,14 +51,14 @@ To use the exposed plugin start and setup contracts: import { TelemetryPluginsStart } from '../telemetry/server`; -interface MyPlyginStartDeps { +interface MyPluginStartDeps { telemetry?: TelemetryPluginsStart; } class MyPlugin { public async start( core: CoreStart, - { telemetry }: MyPlyginStartDeps + { telemetry }: MyPluginStartDeps ) { const isOptedIn = await telemetry?.getIsOptedIn(); ... diff --git a/src/plugins/telemetry/common/constants.ts b/src/plugins/telemetry/common/constants.ts index 4987dc0b512ab..6ec7bebd642b9 100644 --- a/src/plugins/telemetry/common/constants.ts +++ b/src/plugins/telemetry/common/constants.ts @@ -12,6 +12,12 @@ */ export const REPORT_INTERVAL_MS = 86400000; +/** + * The buffer time, in milliseconds, to consider the {@link REPORT_INTERVAL_MS} as expired. + * Currently, 2 minutes. + */ +export const REPORT_INTERVAL_BUFFER_MS = 120000; + /** * How often we poll for the opt-in status. * Currently, 10 seconds. diff --git a/src/plugins/telemetry/common/is_report_interval_expired.test.ts b/src/plugins/telemetry/common/is_report_interval_expired.test.ts index 68c252a959c0e..81ea513098773 100644 --- a/src/plugins/telemetry/common/is_report_interval_expired.test.ts +++ b/src/plugins/telemetry/common/is_report_interval_expired.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPORT_INTERVAL_MS } from './constants'; +import { REPORT_INTERVAL_BUFFER_MS, REPORT_INTERVAL_MS } from './constants'; import { isReportIntervalExpired } from './is_report_interval_expired'; describe('isReportIntervalExpired', () => { @@ -54,7 +54,9 @@ describe('isReportIntervalExpired', () => { }); test('false when close but not yet', () => { - expect(isReportIntervalExpired(Date.now() - REPORT_INTERVAL_MS + 1000)).toBe(false); + expect( + isReportIntervalExpired(Date.now() - REPORT_INTERVAL_MS + REPORT_INTERVAL_BUFFER_MS + 1000) + ).toBe(false); }); test('false when date in the future', () => { diff --git a/src/plugins/telemetry/common/is_report_interval_expired.ts b/src/plugins/telemetry/common/is_report_interval_expired.ts index d91916c12c449..ee379ddbf0abb 100644 --- a/src/plugins/telemetry/common/is_report_interval_expired.ts +++ b/src/plugins/telemetry/common/is_report_interval_expired.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPORT_INTERVAL_MS } from './constants'; +import { REPORT_INTERVAL_BUFFER_MS, REPORT_INTERVAL_MS } from './constants'; /** * The report is considered expired if: @@ -15,5 +15,9 @@ import { REPORT_INTERVAL_MS } from './constants'; * @returns `true` if the report interval is considered expired */ export function isReportIntervalExpired(lastReportAt: number | undefined) { - return !lastReportAt || isNaN(lastReportAt) || Date.now() - lastReportAt > REPORT_INTERVAL_MS; + return ( + !lastReportAt || + isNaN(lastReportAt) || + Date.now() - lastReportAt > REPORT_INTERVAL_MS - REPORT_INTERVAL_BUFFER_MS + ); } diff --git a/src/plugins/telemetry/public/services/telemetry_sender.test.ts b/src/plugins/telemetry/public/services/telemetry_sender.test.ts index 7f986af97331d..b68ab85f0340f 100644 --- a/src/plugins/telemetry/public/services/telemetry_sender.test.ts +++ b/src/plugins/telemetry/public/services/telemetry_sender.test.ts @@ -246,7 +246,7 @@ describe('TelemetrySender', () => { beforeEach(() => { window.fetch = mockFetch = jest.fn(); - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); consoleWarnMock = jest.spyOn(global.console, 'warn').mockImplementation(() => {}); }); @@ -380,7 +380,7 @@ describe('TelemetrySender', () => { }); describe('getRetryDelay', () => { - beforeEach(() => jest.useFakeTimers()); + beforeEach(() => jest.useFakeTimers('legacy')); afterAll(() => jest.useRealTimers()); it('sets a minimum retry delay of 60 seconds', () => { @@ -399,7 +399,7 @@ describe('TelemetrySender', () => { }); describe('startChecking', () => { - beforeEach(() => jest.useFakeTimers()); + beforeEach(() => jest.useFakeTimers('legacy')); afterAll(() => jest.useRealTimers()); it('calls sendIfDue every 60000 ms', () => { diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index 1a97586dffa62..ddf1ba3df941a 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -2622,6 +2622,137 @@ } } }, + "searchExperiences": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "Always `main`" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 90 days" + } + }, + "views": { + "type": "array", + "items": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "The application view being tracked" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application sub view since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application sub view is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 90 days" + } + } + } + } + } + } + }, "graph": { "properties": { "appId": { @@ -7783,6 +7914,83 @@ } } }, + "files": { + "properties": { + "countByExtension": { + "type": "array", + "items": { + "properties": { + "extension": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + } + }, + "countByStatus": { + "properties": { + "AWAITING_UPLOAD": { + "type": "long", + "_meta": { + "description": "Number of files awaiting upload" + } + }, + "DELETED": { + "type": "long", + "_meta": { + "description": "Number of files that are marked as deleted" + } + }, + "READY": { + "type": "long", + "_meta": { + "description": "Number of files that are ready for download" + } + }, + "UPLOADING": { + "type": "long", + "_meta": { + "description": "Number of files that are currently uploading" + } + }, + "UPLOAD_ERROR": { + "type": "long", + "_meta": { + "description": "Number of files that failed to upload" + } + } + } + }, + "storage": { + "properties": { + "esFixedSizeIndex": { + "properties": { + "capacity": { + "type": "long", + "_meta": { + "description": "Capacity of the fixed size index" + } + }, + "available": { + "type": "long", + "_meta": { + "description": "Available storage in bytes" + } + }, + "used": { + "type": "long", + "_meta": { + "description": "Used storage in bytes" + } + } + } + } + } + } + } + }, "index-patterns": { "properties": { "indexPatternsCount": { @@ -8708,6 +8916,18 @@ "description": "Non-default value of setting." } }, + "observability:apmAWSLambdaPriceFactor": { + "type": "text", + "_meta": { + "description": "Non-default value of setting." + } + }, + "observability:apmAWSLambdaRequestCostPerMillion": { + "type": "integer", + "_meta": { + "description": "Non-default value of setting." + } + }, "banners:placement": { "type": "keyword", "_meta": { @@ -8864,6 +9084,12 @@ "description": "Non-default value of setting." } }, + "observability:apmEnableCriticalPath": { + "type": "boolean", + "_meta": { + "description": "Non-default value of setting." + } + }, "observability:enableInfrastructureHostsView": { "type": "boolean", "_meta": { diff --git a/src/plugins/telemetry/server/fetcher.test.mock.ts b/src/plugins/telemetry/server/fetcher.test.mock.ts new file mode 100644 index 0000000000000..7a77b6452fc09 --- /dev/null +++ b/src/plugins/telemetry/server/fetcher.test.mock.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export const fetchMock = jest.fn(); + +jest.doMock('node-fetch', () => fetchMock); + +export const getNextAttemptDateMock = jest.fn(); + +jest.doMock('./get_next_attempt_date', () => ({ getNextAttemptDate: getNextAttemptDateMock })); diff --git a/src/plugins/telemetry/server/fetcher.test.ts b/src/plugins/telemetry/server/fetcher.test.ts index 0bbaaefde4416..1a6a9d8d0f0c8 100644 --- a/src/plugins/telemetry/server/fetcher.test.ts +++ b/src/plugins/telemetry/server/fetcher.test.ts @@ -7,14 +7,29 @@ */ /* eslint-disable dot-notation */ -import { FetcherTask } from './fetcher'; +import { fakeSchedulers } from 'rxjs-marbles/jest'; import { coreMock } from '@kbn/core/server/mocks'; import { telemetryCollectionManagerPluginMock, Setup, } from '@kbn/telemetry-collection-manager-plugin/server/mocks'; +jest.mock('rxjs', () => { + const RxJs = jest.requireActual('rxjs'); + return { + ...RxJs, + // Redefining timer as a merge of timer and interval because `fakeSchedulers` fails to advance on the intervals + timer: (dueTime: number, interval: number) => + RxJs.merge(RxJs.timer(dueTime), RxJs.interval(interval)), + }; +}); + +import { fetchMock, getNextAttemptDateMock } from './fetcher.test.mock'; +import { FetcherTask } from './fetcher'; + describe('FetcherTask', () => { + beforeEach(() => jest.useFakeTimers('legacy')); + describe('sendIfDue', () => { let getCurrentConfigs: jest.Mock; let shouldSendReport: jest.Mock; @@ -95,4 +110,199 @@ describe('FetcherTask', () => { expect(updateReportFailure).toBeCalledTimes(0); }); }); + + describe('Validate connectivity', () => { + let fetcherTask: FetcherTask; + let getCurrentConfigs: jest.Mock; + let updateReportFailure: jest.Mock; + + beforeEach(() => { + getCurrentConfigs = jest.fn(); + updateReportFailure = jest.fn(); + fetcherTask = new FetcherTask(coreMock.createPluginInitializerContext({})); + Object.assign(fetcherTask, { getCurrentConfigs, updateReportFailure }); + }); + + afterEach(() => { + fetchMock.mockReset(); + }); + + test( + 'Validates connectivity and sets as online when the OPTIONS request succeeds', + fakeSchedulers(async (advance) => { + expect(fetcherTask['isOnline$'].value).toBe(false); + getCurrentConfigs.mockResolvedValue({ + telemetryOptIn: true, + telemetrySendUsageFrom: 'server', + failureCount: 0, + telemetryUrl: 'test-url', + }); + fetchMock.mockResolvedValue({}); + const subscription = fetcherTask['validateConnectivity'](); + advance(5 * 60 * 1000); + await new Promise((resolve) => process.nextTick(resolve)); // Wait for the promise to fulfill + expect(getCurrentConfigs).toHaveBeenCalledTimes(1); + expect(fetchMock).toHaveBeenCalledTimes(1); + expect(fetchMock).toHaveBeenCalledWith('test-url', { method: 'options' }); + expect(fetcherTask['isOnline$'].value).toBe(true); + subscription.unsubscribe(); + }) + ); + + test( + 'Skips validation when already set as online', + fakeSchedulers(async (advance) => { + fetcherTask['isOnline$'].next(true); + const subscription = fetcherTask['validateConnectivity'](); + advance(5 * 60 * 1000); + await new Promise((resolve) => process.nextTick(resolve)); // Wait for the promise to fulfill + expect(getCurrentConfigs).toHaveBeenCalledTimes(0); + expect(fetchMock).toHaveBeenCalledTimes(0); + expect(fetcherTask['isOnline$'].value).toBe(true); + subscription.unsubscribe(); + }) + ); + + test( + 'Retries on errors', + fakeSchedulers(async (advance) => { + expect(fetcherTask['isOnline$'].value).toBe(false); + getCurrentConfigs.mockResolvedValue({ + telemetryOptIn: true, + telemetrySendUsageFrom: 'server', + failureCount: 0, + telemetryUrl: 'test-url', + }); + fetchMock.mockRejectedValue(new Error('Something went terribly wrong')); + const subscription = fetcherTask['validateConnectivity'](); + advance(5 * 60 * 1000); + await new Promise((resolve) => process.nextTick(resolve)); // Wait for the promise to fulfill + expect(getCurrentConfigs).toHaveBeenCalledTimes(1); + expect(fetchMock).toHaveBeenCalledTimes(1); + expect(updateReportFailure).toHaveBeenCalledTimes(1); + expect(fetcherTask['isOnline$'].value).toBe(false); + + // Try again after 12 hours + fetchMock.mockResolvedValue({}); + advance(12 * 60 * 60 * 1000); + await new Promise((resolve) => process.nextTick(resolve)); // Wait for the promise to fulfill + expect(getCurrentConfigs).toHaveBeenCalledTimes(2); + expect(fetchMock).toHaveBeenCalledTimes(2); + expect(updateReportFailure).toHaveBeenCalledTimes(1); + expect(fetcherTask['isOnline$'].value).toBe(true); + + subscription.unsubscribe(); + }) + ); + + test( + 'Should not retry if it hit the max number of failures for this version', + fakeSchedulers(async (advance) => { + expect(fetcherTask['isOnline$'].value).toBe(false); + getCurrentConfigs.mockResolvedValue({ + telemetryOptIn: true, + telemetrySendUsageFrom: 'server', + failureCount: 3, + failureVersion: 'version', + currentVersion: 'version', + telemetryUrl: 'test-url', + }); + const subscription = fetcherTask['validateConnectivity'](); + advance(5 * 60 * 1000); + await new Promise((resolve) => process.nextTick(resolve)); // Wait for the promise to fulfill + expect(getCurrentConfigs).toHaveBeenCalledTimes(1); + expect(fetchMock).toHaveBeenCalledTimes(0); + expect(fetcherTask['isOnline$'].value).toBe(false); + + subscription.unsubscribe(); + }) + ); + + test( + 'Should retry if it hit the max number of failures for a different version', + fakeSchedulers(async (advance) => { + expect(fetcherTask['isOnline$'].value).toBe(false); + getCurrentConfigs.mockResolvedValue({ + telemetryOptIn: true, + telemetrySendUsageFrom: 'server', + failureCount: 3, + failureVersion: 'version', + currentVersion: 'another_version', + telemetryUrl: 'test-url', + }); + const subscription = fetcherTask['validateConnectivity'](); + advance(5 * 60 * 1000); + await new Promise((resolve) => process.nextTick(resolve)); // Wait for the promise to fulfill + expect(getCurrentConfigs).toHaveBeenCalledTimes(1); + expect(fetchMock).toHaveBeenCalledTimes(1); + expect(fetcherTask['isOnline$'].value).toBe(true); + + subscription.unsubscribe(); + }) + ); + }); + + describe('startSendIfDueSubscription', () => { + let fetcherTask: FetcherTask; + let sendIfDue: jest.Mock; + + beforeEach(() => { + sendIfDue = jest.fn().mockResolvedValue({}); + fetcherTask = new FetcherTask(coreMock.createPluginInitializerContext({})); + Object.assign(fetcherTask, { sendIfDue }); + }); + + afterEach(() => { + getNextAttemptDateMock.mockReset(); + }); + + test('Tries to send telemetry when it is online', () => { + const subscription = fetcherTask['startSendIfDueSubscription'](); + fetcherTask['isOnline$'].next(true); + expect(sendIfDue).toHaveBeenCalledTimes(1); + subscription.unsubscribe(); + }); + + test('Does not send telemetry when it is offline', () => { + const subscription = fetcherTask['startSendIfDueSubscription'](); + fetcherTask['isOnline$'].next(false); + expect(sendIfDue).toHaveBeenCalledTimes(0); + subscription.unsubscribe(); + }); + + test( + 'Sends telemetry when the next attempt date kicks in', + fakeSchedulers((advance) => { + fetcherTask['isOnline$'].next(true); + const subscription = fetcherTask['startSendIfDueSubscription'](); + const lastReported = Date.now(); + getNextAttemptDateMock.mockReturnValue(new Date(lastReported + 1000)); + fetcherTask['lastReported$'].next(lastReported); + advance(1000); + expect(sendIfDue).toHaveBeenCalledTimes(1); + subscription.unsubscribe(); + }) + ); + + test( + 'Keeps retrying every 1 minute after the next attempt date until a new emission of lastReported occurs', + fakeSchedulers(async (advance) => { + fetcherTask['isOnline$'].next(true); + const subscription = fetcherTask['startSendIfDueSubscription'](); + const lastReported = Date.now(); + getNextAttemptDateMock.mockReturnValue(new Date(lastReported + 1000)); + fetcherTask['lastReported$'].next(lastReported); + advance(1000); + await new Promise((resolve) => process.nextTick(resolve)); + expect(sendIfDue).toHaveBeenCalledTimes(1); + advance(60 * 1000); + await new Promise((resolve) => process.nextTick(resolve)); + expect(sendIfDue).toHaveBeenCalledTimes(2); + advance(60 * 1000); + await new Promise((resolve) => process.nextTick(resolve)); + expect(sendIfDue).toHaveBeenCalledTimes(3); + subscription.unsubscribe(); + }) + ); + }); }); diff --git a/src/plugins/telemetry/server/fetcher.ts b/src/plugins/telemetry/server/fetcher.ts index 29c3dd44e1984..210e0a37d6c1c 100644 --- a/src/plugins/telemetry/server/fetcher.ts +++ b/src/plugins/telemetry/server/fetcher.ts @@ -6,7 +6,19 @@ * Side Public License, v 1. */ -import { firstValueFrom, Observable, Subscription, timer } from 'rxjs'; +import { + BehaviorSubject, + exhaustMap, + filter, + firstValueFrom, + merge, + mergeMap, + Observable, + skip, + Subscription, + takeUntil, + timer, +} from 'rxjs'; import fetch from 'node-fetch'; import type { TelemetryCollectionManagerPluginStart } from '@kbn/telemetry-collection-manager-plugin/server'; import { @@ -16,6 +28,7 @@ import { SavedObjectsClient, CoreStart, } from '@kbn/core/server'; +import { getNextAttemptDate } from './get_next_attempt_date'; import { getTelemetryChannelEndpoint, getTelemetryOptIn, @@ -42,15 +55,19 @@ interface TelemetryConfig { lastReported: number | undefined; } +const SECOND = 1000; +const MINUTE = 60 * SECOND; +const HOUR = 60 * MINUTE; + export class FetcherTask { - private readonly initialCheckDelayMs = 60 * 1000 * 5; - private readonly checkIntervalMs = 60 * 1000 * 60 * 12; + private readonly initialCheckDelayMs = 5 * MINUTE; + private readonly connectivityCheckIntervalMs = 12 * HOUR; private readonly config$: Observable<TelemetryConfigType>; private readonly currentKibanaVersion: string; private readonly logger: Logger; - private intervalId?: Subscription; - private lastReported?: number; - private isSending = false; + private readonly subscriptions = new Subscription(); + private readonly isOnline$ = new BehaviorSubject<boolean>(false); // Let's initially assume we are not online + private readonly lastReported$ = new BehaviorSubject<number>(0); private internalRepository?: SavedObjectsClientContract; private telemetryCollectionManager?: TelemetryCollectionManagerPluginStart; @@ -64,22 +81,74 @@ export class FetcherTask { this.internalRepository = new SavedObjectsClient(savedObjects.createInternalRepository()); this.telemetryCollectionManager = telemetryCollectionManager; - this.intervalId = timer(this.initialCheckDelayMs, this.checkIntervalMs).subscribe(() => - this.sendIfDue() - ); + this.subscriptions.add(this.validateConnectivity()); + this.subscriptions.add(this.startSendIfDueSubscription()); } public stop() { - if (this.intervalId) { - this.intervalId.unsubscribe(); - } + this.subscriptions.unsubscribe(); } - private async sendIfDue() { - if (this.isSending) { - return; - } + /** + * Periodically validates the connectivity from the server to our remote telemetry URL. + * OPTIONS is less intrusive as it does not contain any payload and is used here to check if the endpoint is reachable. + */ + private validateConnectivity(): Subscription { + return timer(this.initialCheckDelayMs, this.connectivityCheckIntervalMs) + .pipe( + // Skip any further processing if already online + filter(() => !this.isOnline$.value), + // Fetch current state and configs + exhaustMap(async () => await this.getCurrentConfigs()), + // Skip if opted-out, or should only send from the browser + filter( + ({ telemetryOptIn, telemetrySendUsageFrom }) => + telemetryOptIn === true && telemetrySendUsageFrom === 'server' + ), + // Skip if already failed three times for this version + filter( + ({ failureCount, failureVersion, currentVersion }) => + !(failureCount > 2 && failureVersion === currentVersion) + ), + exhaustMap(async ({ telemetryUrl, failureCount }) => { + try { + await fetch(telemetryUrl, { method: 'options' }); + this.isOnline$.next(true); + } catch (err) { + this.logger.error(`Cannot reach the remote telemetry endpoint ${telemetryUrl}`); + await this.updateReportFailure({ failureCount }); + } + }) + ) + .subscribe(); + } + private startSendIfDueSubscription() { + return merge( + // Attempt to send telemetry... + // ... whenever connectivity changes + this.isOnline$, + // ... when lastReported$ has a new value... + this.lastReported$.pipe( + filter(Boolean), + mergeMap((lastReported) => + // ... set a timer of 24h from there (+ a random seed to avoid concurrent emissions from multiple Kibana instances). + // Emitting again every 1 minute after the next attempt date in case we reach a deadlock in further checks (like Kibana is not healthy at the moment of sending). + timer(getNextAttemptDate(lastReported), MINUTE).pipe( + // Cancel this observable if lastReported$ emits again + takeUntil(this.lastReported$.pipe(skip(1))) + ) + ) + ) + ) + .pipe( + filter(() => this.isOnline$.value), + exhaustMap(() => this.sendIfDue()) + ) + .subscribe(); + } + + private async sendIfDue() { // Skip this run if Kibana is not in a healthy state to fetch telemetry. if (!(await this.telemetryCollectionManager?.shouldGetTelemetry())) { return; @@ -99,13 +168,11 @@ export class FetcherTask { } let clusters: EncryptedTelemetryPayload = []; - this.isSending = true; try { clusters = await this.fetchTelemetry(); } catch (err) { this.logger.warn(`Error fetching usage. (${err})`); - this.isSending = false; return; } @@ -119,7 +186,6 @@ export class FetcherTask { this.logger.warn(`Error sending telemetry usage data. (${err})`); } - this.isSending = false; } private async getCurrentConfigs(): Promise<TelemetryConfig> { @@ -137,6 +203,13 @@ export class FetcherTask { telemetrySavedObject, }); + const lastReported = telemetrySavedObject ? telemetrySavedObject.lastReported : void 0; + + // If the lastReported value in the SO is more recent than the in-memory one, refresh the memory (another instance or the browser may have reported it) + if (lastReported && lastReported > this.lastReported$.value) { + this.lastReported$.next(lastReported); + } + return { telemetryOptIn: getTelemetryOptIn({ currentKibanaVersion, @@ -152,15 +225,15 @@ export class FetcherTask { failureCount, failureVersion, currentVersion: currentKibanaVersion, - lastReported: telemetrySavedObject ? telemetrySavedObject.lastReported : void 0, + lastReported, }; } private async updateLastReported() { - this.lastReported = Date.now(); + this.lastReported$.next(Date.now()); updateTelemetrySavedObject(this.internalRepository!, { reportFailureCount: 0, - lastReported: this.lastReported, + lastReported: this.lastReported$.value, }).catch((err) => { err.message = `Failed to update the telemetry saved object: ${err.message}`; this.logger.debug(err); @@ -168,6 +241,7 @@ export class FetcherTask { } private async updateReportFailure({ failureCount }: { failureCount: number }) { + this.isOnline$.next(false); updateTelemetrySavedObject(this.internalRepository!, { reportFailureCount: failureCount + 1, reportFailureVersion: this.currentKibanaVersion, @@ -180,19 +254,15 @@ export class FetcherTask { private shouldSendReport({ telemetryOptIn, telemetrySendUsageFrom, - failureCount, - failureVersion, - currentVersion, lastReported, }: TelemetryConfig) { - if (failureCount > 2 && failureVersion === currentVersion) { - return false; - } - if (telemetryOptIn && telemetrySendUsageFrom === 'server') { // Check both: in-memory and SO-driven value. // This will avoid the server retrying over and over when it has issues with storing the state in the SO. - if (isReportIntervalExpired(this.lastReported) && isReportIntervalExpired(lastReported)) { + if ( + isReportIntervalExpired(this.lastReported$.value) && + isReportIntervalExpired(lastReported) + ) { return true; } } @@ -210,13 +280,6 @@ export class FetcherTask { payload: EncryptedTelemetryPayload ): Promise<void> { this.logger.debug(`Sending usage stats.`); - /** - * send OPTIONS before sending usage data. - * OPTIONS is less intrusive as it does not contain any payload and is used here to check if the endpoint is reachable. - */ - await fetch(telemetryUrl, { - method: 'options', - }); await Promise.all( payload.map(async ({ clusterUuid, stats }) => { diff --git a/src/plugins/telemetry/server/get_next_attempt_date.test.ts b/src/plugins/telemetry/server/get_next_attempt_date.test.ts new file mode 100644 index 0000000000000..63efcd7796654 --- /dev/null +++ b/src/plugins/telemetry/server/get_next_attempt_date.test.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import crypto from 'crypto'; +import { getNextAttemptDate } from './get_next_attempt_date'; + +describe('getNextAttemptDate', () => { + // The casting is needed because `randomInt` has multiple call signatures and typescript is taking the callback one. + const randomIntSpy = jest.spyOn(crypto, 'randomInt') as unknown as jest.SpyInstance< + number, + [min: number, max: number] + >; + + afterEach(() => { + randomIntSpy.mockReset(); + }); + + test('returns the date + 24h + random seed (2 minutes)', () => { + randomIntSpy.mockReturnValue(120); + + expect(getNextAttemptDate(new Date('2022-10-27T12:00:00Z').getTime())).toStrictEqual( + new Date('2022-10-28T12:02:00Z') + ); + }); + + test('returns the start of the next day if the random addition stays in the same day', () => { + randomIntSpy.mockReturnValue(120); + randomIntSpy.mockReturnValueOnce(-120); + expect(getNextAttemptDate(new Date('2022-10-27T00:01:00Z').getTime())).toStrictEqual( + new Date('2022-10-28T00:03:00Z') + ); + expect(randomIntSpy).toHaveBeenCalledTimes(2); + }); + + test('returns the end of the next day minus 1 minute if the random addition goes to the following day', () => { + randomIntSpy.mockReturnValue(-120); + randomIntSpy.mockReturnValueOnce(120); + expect(getNextAttemptDate(new Date('2022-10-27T23:58:30Z').getTime())).toStrictEqual( + new Date('2022-10-28T23:56:30Z') + ); + expect(randomIntSpy).toHaveBeenCalledTimes(2); + }); +}); diff --git a/src/plugins/telemetry/server/get_next_attempt_date.ts b/src/plugins/telemetry/server/get_next_attempt_date.ts new file mode 100644 index 0000000000000..507491ef5450e --- /dev/null +++ b/src/plugins/telemetry/server/get_next_attempt_date.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { randomInt } from 'crypto'; +import moment from 'moment'; +import { REPORT_INTERVAL_BUFFER_MS, REPORT_INTERVAL_MS } from '../common/constants'; + +const REPORT_INTERVAL_BUFFER_S = REPORT_INTERVAL_BUFFER_MS / 1000; + +/** + * Returns the next attempt to send telemetry + * @param fromMs The last attempt in ms from epoch + */ +export function getNextAttemptDate(fromMs: number): Date { + const lastAttempt = moment(fromMs).utcOffset(0); + const endOfLastAttemptDay = lastAttempt.clone().endOf('day'); + const dayPlusReportInterval = lastAttempt.clone().add(REPORT_INTERVAL_MS, 'milliseconds'); + const endOfNextDay = dayPlusReportInterval.clone().endOf('day'); + const nextAttemptDate = dayPlusReportInterval + .clone() + .add(randomInt(-REPORT_INTERVAL_BUFFER_S, REPORT_INTERVAL_BUFFER_S), 'seconds'); + + // Edge case: If the random seed makes the next attempt to be in the same day of the last attempt, generate it again + if (nextAttemptDate.isBefore(endOfLastAttemptDay)) { + return getNextAttemptDate(fromMs); + } + + // Edge case: If the random seed goes to the following day, generate it again + if (nextAttemptDate.isAfter(endOfNextDay)) { + return getNextAttemptDate(fromMs); + } + + return nextAttemptDate.toDate(); +} diff --git a/src/plugins/telemetry/tsconfig.json b/src/plugins/telemetry/tsconfig.json index 052d484447e42..7fc00b85008c4 100644 --- a/src/plugins/telemetry/tsconfig.json +++ b/src/plugins/telemetry/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -15,7 +14,7 @@ "schema/oss_plugins.json", "schema/oss_root.json", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../../plugins/home/tsconfig.json" }, { "path": "../../plugins/kibana_react/tsconfig.json" }, diff --git a/src/plugins/telemetry_collection_manager/tsconfig.json b/src/plugins/telemetry_collection_manager/tsconfig.json index adfe3bba07963..cd505b02a02f5 100644 --- a/src/plugins/telemetry_collection_manager/tsconfig.json +++ b/src/plugins/telemetry_collection_manager/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ "server/**/*", "common/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../../plugins/usage_collection/tsconfig.json" } ] diff --git a/src/plugins/telemetry_management_section/tsconfig.json b/src/plugins/telemetry_management_section/tsconfig.json index 1e2b2e57d51c8..6ced5687dd321 100644 --- a/src/plugins/telemetry_management_section/tsconfig.json +++ b/src/plugins/telemetry_management_section/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ "public/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, { "path": "../usage_collection/tsconfig.json" }, diff --git a/src/plugins/ui_actions/public/tests/execute_trigger_actions.test.ts b/src/plugins/ui_actions/public/tests/execute_trigger_actions.test.ts index 3c87857591e69..b303f8b4c3a19 100644 --- a/src/plugins/ui_actions/public/tests/execute_trigger_actions.test.ts +++ b/src/plugins/ui_actions/public/tests/execute_trigger_actions.test.ts @@ -44,7 +44,7 @@ const reset = () => { executeFn.mockReset(); openContextMenuSpy.mockReset(); - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }; beforeEach(reset); diff --git a/src/plugins/ui_actions/tsconfig.json b/src/plugins/ui_actions/tsconfig.json index 2fa166bae01bc..2bd694005d435 100644 --- a/src/plugins/ui_actions/tsconfig.json +++ b/src/plugins/ui_actions/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["public/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../expressions/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, diff --git a/src/plugins/ui_actions_enhanced/tsconfig.json b/src/plugins/ui_actions_enhanced/tsconfig.json index d9d9474f0bd72..c0d3e64038dc4 100644 --- a/src/plugins/ui_actions_enhanced/tsconfig.json +++ b/src/plugins/ui_actions_enhanced/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", @@ -12,7 +11,7 @@ "common/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, { "path": "../embeddable/tsconfig.json" }, diff --git a/src/plugins/unified_field_list/README.md b/src/plugins/unified_field_list/README.md index 9030a32a3bdca..23edffd5101dc 100755 --- a/src/plugins/unified_field_list/README.md +++ b/src/plugins/unified_field_list/README.md @@ -6,6 +6,8 @@ This Kibana plugin contains components and services for field list UI (as in fie ## Components +* `<FieldListGrouped .../>` - renders a fields list which is split in sections (Selected, Special, Available, Empty, Meta fields). It accepts already grouped fields, please use `useGroupedFields` hook for it. + * `<FieldStats .../>` - loads and renders stats (Top values, Distribution) for a data view field. * `<FieldVisualizeButton .../>` - renders a button to open this field in Lens. @@ -13,7 +15,7 @@ This Kibana plugin contains components and services for field list UI (as in fie * `<FieldPopover .../>` - a popover container component for a field. * `<FieldPopoverHeader .../>` - this header component included a field name and common actions. -* + * `<FieldPopoverVisualize .../>` - renders Visualize action in the popover footer. These components can be combined and customized as the following: @@ -59,6 +61,47 @@ These components can be combined and customized as the following: * `loadFieldExisting(...)` - returns the loaded existing fields (can also work with Ad-hoc data views) +## Hooks + +* `useExistingFieldsFetcher(...)` - this hook is responsible for fetching fields existence info for specified data views. It can be used higher in components tree than `useExistingFieldsReader` hook. + +* `useExistingFieldsReader(...)` - you can call this hook to read fields existence info which was fetched by `useExistingFieldsFetcher` hook. Using multiple "reader" hooks from different children components is supported. So you would need only one "fetcher" and as many "reader" hooks as necessary. + +* `useGroupedFields(...)` - this hook groups fields list into sections of Selected, Special, Available, Empty, Meta fields. + +An example of using hooks together with `<FieldListGrouped .../>`: + +``` +const { refetchFieldsExistenceInfo, isProcessing } = useExistingFieldsFetcher({ + dataViews, + query, + filters, + fromDate, + toDate, + ... +}); +const fieldsExistenceReader = useExistingFieldsReader() +const { fieldGroups } = useGroupedFields({ + dataViewId: currentDataViewId, + allFields, + fieldsExistenceReader, + ... +}); + +// and now we can render a field list +<FieldListGrouped + fieldGroups={fieldGroups} + fieldsExistenceStatus={fieldsExistenceReader.getFieldsExistenceStatus(currentDataViewId)} + fieldsExistInIndex={!!allFields.length} + renderFieldItem={renderFieldItem} + screenReaderDescriptionForSearchInputId={fieldSearchDescriptionId} +/> + +// or check whether a field contains data +const { hasFieldData } = useExistingFieldsReader(); +const hasData = hasFieldData(currentDataViewId, fieldName) // return a boolean +``` + ## Server APIs * `/api/unified_field_list/field_stats` - returns the loaded field stats (except for Ad-hoc data views) diff --git a/src/plugins/unified_field_list/public/components/field_list/field_list_grouped.scss b/src/plugins/unified_field_list/public/components/field_list/field_list_grouped.scss new file mode 100644 index 0000000000000..cd4b9ba2f6e22 --- /dev/null +++ b/src/plugins/unified_field_list/public/components/field_list/field_list_grouped.scss @@ -0,0 +1,20 @@ +/** + * 1. Don't cut off the shadow of the field items + */ + +.unifiedFieldList__fieldListGrouped { + @include euiOverflowShadow; + @include euiScrollBar; + margin-left: -$euiSize; /* 1 */ + position: relative; + flex-grow: 1; + overflow: auto; +} + +.unifiedFieldList__fieldListGrouped__container { + padding-top: $euiSizeS; + position: absolute; + top: 0; + left: $euiSize; /* 1 */ + right: $euiSizeXS; /* 1 */ +} diff --git a/src/plugins/unified_field_list/public/components/field_list/field_list_grouped.test.tsx b/src/plugins/unified_field_list/public/components/field_list/field_list_grouped.test.tsx new file mode 100644 index 0000000000000..59cd7e56ff390 --- /dev/null +++ b/src/plugins/unified_field_list/public/components/field_list/field_list_grouped.test.tsx @@ -0,0 +1,413 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { act } from 'react-dom/test-utils'; +import { stubLogstashDataView as dataView } from '@kbn/data-views-plugin/common/data_view.stub'; +import { EuiText, EuiLoadingSpinner } from '@elastic/eui'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; +import { DataViewField } from '@kbn/data-views-plugin/common'; +import { ReactWrapper } from 'enzyme'; +import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; +import FieldListGrouped, { type FieldListGroupedProps } from './field_list_grouped'; +import { ExistenceFetchStatus } from '../../types'; +import { FieldsAccordion } from './fields_accordion'; +import { NoFieldsCallout } from './no_fields_callout'; +import { useGroupedFields, type GroupedFieldsParams } from '../../hooks/use_grouped_fields'; + +describe('UnifiedFieldList <FieldListGrouped /> + useGroupedFields()', () => { + let defaultProps: FieldListGroupedProps<DataViewField>; + let mockedServices: GroupedFieldsParams<DataViewField>['services']; + const allFields = dataView.fields; + // 5 times more fields. Added fields will be treated as empty as they are not a part of the data view. + const manyFields = [...new Array(5)].flatMap((_, index) => + allFields.map((field) => { + return new DataViewField({ ...field.toSpec(), name: `${field.name}${index || ''}` }); + }) + ); + + beforeEach(() => { + const dataViews = dataViewPluginMocks.createStartContract(); + mockedServices = { + dataViews, + }; + + dataViews.get.mockImplementation(async (id: string) => { + return dataView; + }); + + defaultProps = { + fieldGroups: {}, + fieldsExistenceStatus: ExistenceFetchStatus.succeeded, + fieldsExistInIndex: true, + screenReaderDescriptionForSearchInputId: 'testId', + renderFieldItem: jest.fn(({ field, itemIndex, groupIndex }) => ( + <EuiText + data-test-subj="testFieldItem" + data-name={`${field.name}-${groupIndex}-${itemIndex}`} + > + {field.name} + </EuiText> + )), + }; + }); + + interface WrapperProps { + listProps: Omit<FieldListGroupedProps<DataViewField>, 'fieldGroups'>; + hookParams: Omit<GroupedFieldsParams<DataViewField>, 'services'>; + } + + async function mountGroupedList({ listProps, hookParams }: WrapperProps): Promise<ReactWrapper> { + const Wrapper: React.FC<WrapperProps> = (props) => { + const { fieldGroups } = useGroupedFields({ + ...props.hookParams, + services: mockedServices, + }); + + return <FieldListGrouped {...props.listProps} fieldGroups={fieldGroups} />; + }; + + let wrapper: ReactWrapper; + await act(async () => { + wrapper = await mountWithIntl(<Wrapper hookParams={hookParams} listProps={listProps} />); + // wait for lazy modules if any + await new Promise((resolve) => setTimeout(resolve, 0)); + await wrapper.update(); + }); + + return wrapper!; + } + + it('renders correctly in empty state', () => { + const wrapper = mountWithIntl( + <FieldListGrouped + {...defaultProps} + fieldGroups={{}} + fieldsExistenceStatus={ExistenceFetchStatus.unknown} + /> + ); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe(''); + }); + + it('renders correctly in loading state', async () => { + const wrapper = await mountGroupedList({ + listProps: { + ...defaultProps, + fieldsExistenceStatus: ExistenceFetchStatus.unknown, + }, + hookParams: { + dataViewId: dataView.id!, + allFields, + }, + }); + + expect(wrapper.find(FieldListGrouped).prop('fieldsExistenceStatus')).toBe( + ExistenceFetchStatus.unknown + ); + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe(''); + expect(wrapper.find(FieldsAccordion)).toHaveLength(3); + expect(wrapper.find(EuiLoadingSpinner)).toHaveLength(3); + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('hasLoaded')) + ).toStrictEqual([false, false, false]); + expect(wrapper.find(NoFieldsCallout)).toHaveLength(0); + + await act(async () => { + await wrapper.setProps({ + listProps: { + ...defaultProps, + fieldsExistenceStatus: ExistenceFetchStatus.succeeded, + }, + }); + await wrapper.update(); + }); + + expect(wrapper.find(FieldListGrouped).prop('fieldsExistenceStatus')).toBe( + ExistenceFetchStatus.succeeded + ); + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('25 available fields. 0 empty fields. 3 meta fields.'); + expect(wrapper.find(FieldsAccordion)).toHaveLength(3); + expect(wrapper.find(EuiLoadingSpinner)).toHaveLength(0); + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('hasLoaded')) + ).toStrictEqual([true, true, true]); + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('paginatedFields').length) + ).toStrictEqual([25, 0, 0]); + expect(wrapper.find(NoFieldsCallout)).toHaveLength(1); + }); + + it('renders correctly in failed state', async () => { + const wrapper = await mountGroupedList({ + listProps: { + ...defaultProps, + fieldsExistenceStatus: ExistenceFetchStatus.failed, + }, + hookParams: { + dataViewId: dataView.id!, + allFields, + }, + }); + + expect(wrapper.find(FieldListGrouped).prop('fieldsExistenceStatus')).toBe( + ExistenceFetchStatus.failed + ); + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('25 available fields. 0 empty fields. 3 meta fields.'); + expect(wrapper.find(FieldsAccordion)).toHaveLength(3); + expect(wrapper.find(EuiLoadingSpinner)).toHaveLength(0); + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('hasLoaded')) + ).toStrictEqual([true, true, true]); + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('showExistenceFetchError')) + ).toStrictEqual([true, true, true]); + }); + + it('renders correctly in no fields state', async () => { + const wrapper = await mountGroupedList({ + listProps: { + ...defaultProps, + fieldsExistInIndex: false, + fieldsExistenceStatus: ExistenceFetchStatus.failed, + }, + hookParams: { + dataViewId: dataView.id!, + allFields: [], + }, + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('0 available fields. 0 empty fields. 0 meta fields.'); + expect(wrapper.find(FieldsAccordion)).toHaveLength(3); + expect(wrapper.find(EuiLoadingSpinner)).toHaveLength(0); + expect( + wrapper.find(NoFieldsCallout).map((callout) => callout.prop('fieldsExistInIndex')) + ).toStrictEqual([false, false, false]); + }); + + it('renders correctly for text-based queries (no data view)', async () => { + const wrapper = await mountGroupedList({ + listProps: { + ...defaultProps, + fieldsExistenceStatus: ExistenceFetchStatus.succeeded, + }, + hookParams: { + dataViewId: null, + allFields, + onSelectedFieldFilter: (field) => field.name === 'bytes', + }, + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('1 selected field. 28 available fields.'); + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('paginatedFields').length) + ).toStrictEqual([1, 28]); + }); + + it('renders correctly when Meta gets open', async () => { + const wrapper = await mountGroupedList({ + listProps: { + ...defaultProps, + fieldsExistenceStatus: ExistenceFetchStatus.succeeded, + }, + hookParams: { + dataViewId: dataView.id!, + allFields, + }, + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('25 available fields. 0 empty fields. 3 meta fields.'); + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('paginatedFields').length) + ).toStrictEqual([25, 0, 0]); + + await act(async () => { + await wrapper + .find('[data-test-subj="fieldListGroupedMetaFields"]') + .find('button') + .first() + .simulate('click'); + await wrapper.update(); + }); + + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('paginatedFields').length) + ).toStrictEqual([25, 0, 3]); + }); + + it('renders correctly when paginated', async () => { + const wrapper = await mountGroupedList({ + listProps: { + ...defaultProps, + fieldsExistenceStatus: ExistenceFetchStatus.succeeded, + }, + hookParams: { + dataViewId: dataView.id!, + allFields: manyFields, + }, + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('25 available fields. 112 empty fields. 3 meta fields.'); + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('paginatedFields').length) + ).toStrictEqual([25, 0, 0]); + + await act(async () => { + await wrapper + .find('[data-test-subj="fieldListGroupedEmptyFields"]') + .find('button') + .first() + .simulate('click'); + await wrapper.update(); + }); + + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('paginatedFields').length) + ).toStrictEqual([25, 50, 0]); + + await act(async () => { + await wrapper + .find('[data-test-subj="fieldListGroupedMetaFields"]') + .find('button') + .first() + .simulate('click'); + await wrapper.update(); + }); + + expect( + wrapper.find(FieldsAccordion).map((accordion) => accordion.prop('paginatedFields').length) + ).toStrictEqual([25, 88, 0]); + }); + + it('renders correctly when filtered', async () => { + const hookParams = { + dataViewId: dataView.id!, + allFields: manyFields, + }; + const wrapper = await mountGroupedList({ + listProps: { + ...defaultProps, + fieldsExistenceStatus: ExistenceFetchStatus.succeeded, + }, + hookParams, + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('25 available fields. 112 empty fields. 3 meta fields.'); + + await act(async () => { + await wrapper.setProps({ + hookParams: { + ...hookParams, + onFilterField: (field: DataViewField) => field.name.startsWith('@'), + }, + }); + await wrapper.update(); + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('2 available fields. 8 empty fields. 0 meta fields.'); + + await act(async () => { + await wrapper.setProps({ + hookParams: { + ...hookParams, + onFilterField: (field: DataViewField) => field.name.startsWith('_'), + }, + }); + await wrapper.update(); + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('0 available fields. 12 empty fields. 3 meta fields.'); + }); + + it('renders correctly when non-supported fields are filtered out', async () => { + const hookParams = { + dataViewId: dataView.id!, + allFields: manyFields, + }; + const wrapper = await mountGroupedList({ + listProps: { + ...defaultProps, + fieldsExistenceStatus: ExistenceFetchStatus.succeeded, + }, + hookParams, + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('25 available fields. 112 empty fields. 3 meta fields.'); + + await act(async () => { + await wrapper.setProps({ + hookParams: { + ...hookParams, + onSupportedFieldFilter: (field: DataViewField) => field.aggregatable, + }, + }); + await wrapper.update(); + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('23 available fields. 104 empty fields. 3 meta fields.'); + }); + + it('renders correctly when selected fields are present', async () => { + const hookParams = { + dataViewId: dataView.id!, + allFields: manyFields, + }; + const wrapper = await mountGroupedList({ + listProps: { + ...defaultProps, + fieldsExistenceStatus: ExistenceFetchStatus.succeeded, + }, + hookParams, + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('25 available fields. 112 empty fields. 3 meta fields.'); + + await act(async () => { + await wrapper.setProps({ + hookParams: { + ...hookParams, + onSelectedFieldFilter: (field: DataViewField) => + ['@timestamp', 'bytes'].includes(field.name), + }, + }); + await wrapper.update(); + }); + + expect( + wrapper.find(`#${defaultProps.screenReaderDescriptionForSearchInputId}`).first().text() + ).toBe('2 selected fields. 25 available fields. 112 empty fields. 3 meta fields.'); + }); +}); diff --git a/src/plugins/unified_field_list/public/components/field_list/field_list_grouped.tsx b/src/plugins/unified_field_list/public/components/field_list/field_list_grouped.tsx new file mode 100644 index 0000000000000..5510ddb2b1d43 --- /dev/null +++ b/src/plugins/unified_field_list/public/components/field_list/field_list_grouped.tsx @@ -0,0 +1,245 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { partition, throttle } from 'lodash'; +import React, { useState, Fragment, useCallback, useMemo } from 'react'; +import { i18n } from '@kbn/i18n'; +import { EuiScreenReaderOnly, EuiSpacer } from '@elastic/eui'; +import { type DataViewField } from '@kbn/data-views-plugin/common'; +import { NoFieldsCallout } from './no_fields_callout'; +import { FieldsAccordion, type FieldsAccordionProps } from './fields_accordion'; +import type { FieldListGroups, FieldListItem } from '../../types'; +import { ExistenceFetchStatus } from '../../types'; +import './field_list_grouped.scss'; + +const PAGINATION_SIZE = 50; + +function getDisplayedFieldsLength<T extends FieldListItem>( + fieldGroups: FieldListGroups<T>, + accordionState: Partial<Record<string, boolean>> +) { + return Object.entries(fieldGroups) + .filter(([key]) => accordionState[key]) + .reduce((allFieldCount, [, { fields }]) => allFieldCount + fields.length, 0); +} + +export interface FieldListGroupedProps<T extends FieldListItem> { + fieldGroups: FieldListGroups<T>; + fieldsExistenceStatus: ExistenceFetchStatus; + fieldsExistInIndex: boolean; + renderFieldItem: FieldsAccordionProps<T>['renderFieldItem']; + screenReaderDescriptionForSearchInputId?: string; + 'data-test-subj'?: string; +} + +function InnerFieldListGrouped<T extends FieldListItem = DataViewField>({ + fieldGroups, + fieldsExistenceStatus, + fieldsExistInIndex, + renderFieldItem, + screenReaderDescriptionForSearchInputId, + 'data-test-subj': dataTestSubject = 'fieldListGrouped', +}: FieldListGroupedProps<T>) { + const hasSyncedExistingFields = + fieldsExistenceStatus && fieldsExistenceStatus !== ExistenceFetchStatus.unknown; + + const [fieldGroupsToShow, fieldGroupsToCollapse] = partition( + Object.entries(fieldGroups), + ([, { showInAccordion }]) => showInAccordion + ); + const [pageSize, setPageSize] = useState(PAGINATION_SIZE); + const [scrollContainer, setScrollContainer] = useState<Element | undefined>(undefined); + const [accordionState, setAccordionState] = useState<Partial<Record<string, boolean>>>(() => + Object.fromEntries( + fieldGroupsToShow.map(([key, { isInitiallyOpen }]) => [key, isInitiallyOpen]) + ) + ); + + const lazyScroll = useCallback(() => { + if (scrollContainer) { + const nearBottom = + scrollContainer.scrollTop + scrollContainer.clientHeight > + scrollContainer.scrollHeight * 0.9; + if (nearBottom) { + setPageSize( + Math.max( + PAGINATION_SIZE, + Math.min( + pageSize + PAGINATION_SIZE * 0.5, + getDisplayedFieldsLength<T>(fieldGroups, accordionState) + ) + ) + ); + } + } + }, [scrollContainer, pageSize, setPageSize, fieldGroups, accordionState]); + + const paginatedFields = useMemo(() => { + let remainingItems = pageSize; + return Object.fromEntries( + fieldGroupsToShow.map(([key, fieldGroup]) => { + if (!accordionState[key] || remainingItems <= 0) { + return [key, []]; + } + const slicedFieldList = fieldGroup.fields.slice(0, remainingItems); + remainingItems = remainingItems - slicedFieldList.length; + return [key, slicedFieldList]; + }) + ); + }, [pageSize, fieldGroupsToShow, accordionState]); + + return ( + <div + className="unifiedFieldList__fieldListGrouped" + ref={(el) => { + if (el && !el.dataset.dynamicScroll) { + el.dataset.dynamicScroll = 'true'; + setScrollContainer(el); + } + }} + onScroll={throttle(lazyScroll, 100)} + > + <div className="unifiedFieldList__fieldListGrouped__container"> + {Boolean(screenReaderDescriptionForSearchInputId) && ( + <EuiScreenReaderOnly> + <div + aria-live="polite" + id={screenReaderDescriptionForSearchInputId} + data-test-subj={`${dataTestSubject}__ariaDescription`} + > + {hasSyncedExistingFields + ? [ + fieldGroups.SelectedFields && + (!fieldGroups.SelectedFields?.hideIfEmpty || + fieldGroups.SelectedFields?.fields?.length > 0) && + i18n.translate( + 'unifiedFieldList.fieldListGrouped.fieldSearchForSelectedFieldsLiveRegion', + { + defaultMessage: + '{selectedFields} selected {selectedFields, plural, one {field} other {fields}}.', + values: { + selectedFields: fieldGroups.SelectedFields?.fields?.length || 0, + }, + } + ), + fieldGroups.AvailableFields?.fields && + i18n.translate( + 'unifiedFieldList.fieldListGrouped.fieldSearchForAvailableFieldsLiveRegion', + { + defaultMessage: + '{availableFields} available {availableFields, plural, one {field} other {fields}}.', + values: { + availableFields: fieldGroups.AvailableFields.fields.length, + }, + } + ), + fieldGroups.EmptyFields && + (!fieldGroups.EmptyFields?.hideIfEmpty || + fieldGroups.EmptyFields?.fields?.length > 0) && + i18n.translate( + 'unifiedFieldList.fieldListGrouped.fieldSearchForEmptyFieldsLiveRegion', + { + defaultMessage: + '{emptyFields} empty {emptyFields, plural, one {field} other {fields}}.', + values: { + emptyFields: fieldGroups.EmptyFields?.fields?.length || 0, + }, + } + ), + fieldGroups.MetaFields && + (!fieldGroups.MetaFields?.hideIfEmpty || + fieldGroups.MetaFields?.fields?.length > 0) && + i18n.translate( + 'unifiedFieldList.fieldListGrouped.fieldSearchForMetaFieldsLiveRegion', + { + defaultMessage: + '{metaFields} meta {metaFields, plural, one {field} other {fields}}.', + values: { + metaFields: fieldGroups.MetaFields?.fields?.length || 0, + }, + } + ), + ] + .filter(Boolean) + .join(' ') + : ''} + </div> + </EuiScreenReaderOnly> + )} + <ul> + {fieldGroupsToCollapse.flatMap(([, { fields }]) => + fields.map((field, index) => ( + <Fragment key={field.name}> + {renderFieldItem({ field, itemIndex: index, groupIndex: 0, hideDetails: true })} + </Fragment> + )) + )} + </ul> + <EuiSpacer size="s" /> + {fieldGroupsToShow.map(([key, fieldGroup], index) => { + const hidden = Boolean(fieldGroup.hideIfEmpty) && !fieldGroup.fields.length; + if (hidden) { + return null; + } + return ( + <Fragment key={key}> + <FieldsAccordion<T> + id={`${dataTestSubject}${key}`} + initialIsOpen={Boolean(accordionState[key])} + label={fieldGroup.title} + helpTooltip={fieldGroup.helpText} + hideDetails={fieldGroup.hideDetails} + hasLoaded={hasSyncedExistingFields} + fieldsCount={fieldGroup.fields.length} + isFiltered={fieldGroup.fieldCount !== fieldGroup.fields.length} + paginatedFields={paginatedFields[key]} + groupIndex={index + 1} + onToggle={(open) => { + setAccordionState((s) => ({ + ...s, + [key]: open, + })); + const displayedFieldLength = getDisplayedFieldsLength(fieldGroups, { + ...accordionState, + [key]: open, + }); + setPageSize( + Math.max( + PAGINATION_SIZE, + Math.min(Math.ceil(pageSize * 1.5), displayedFieldLength) + ) + ); + }} + showExistenceFetchError={fieldsExistenceStatus === ExistenceFetchStatus.failed} + showExistenceFetchTimeout={fieldsExistenceStatus === ExistenceFetchStatus.failed} // TODO: deprecate timeout logic? + renderCallout={() => ( + <NoFieldsCallout + isAffectedByGlobalFilter={fieldGroup.isAffectedByGlobalFilter} + isAffectedByTimerange={fieldGroup.isAffectedByTimeFilter} + isAffectedByFieldFilter={fieldGroup.fieldCount !== fieldGroup.fields.length} + fieldsExistInIndex={!!fieldsExistInIndex} + defaultNoFieldsMessage={fieldGroup.defaultNoFieldsMessage} + /> + )} + renderFieldItem={renderFieldItem} + /> + <EuiSpacer size="m" /> + </Fragment> + ); + })} + </div> + </div> + ); +} + +export type GenericFieldListGrouped = typeof InnerFieldListGrouped; +const FieldListGrouped = React.memo(InnerFieldListGrouped) as GenericFieldListGrouped; + +// Necessary for React.lazy +// eslint-disable-next-line import/no-default-export +export default FieldListGrouped; diff --git a/src/plugins/unified_field_list/public/components/field_list/fields_accordion.scss b/src/plugins/unified_field_list/public/components/field_list/fields_accordion.scss new file mode 100644 index 0000000000000..501b27969e768 --- /dev/null +++ b/src/plugins/unified_field_list/public/components/field_list/fields_accordion.scss @@ -0,0 +1,8 @@ +.unifiedFieldList__fieldsAccordion__titleTooltip { + margin-right: $euiSizeXS; +} + +.unifiedFieldList__fieldsAccordion__fieldItems { + // Quick fix for making sure the shadow and focus rings are visible outside the accordion bounds + padding: $euiSizeXS; +} diff --git a/src/plugins/unified_field_list/public/components/field_list/fields_accordion.test.tsx b/src/plugins/unified_field_list/public/components/field_list/fields_accordion.test.tsx new file mode 100644 index 0000000000000..2804c1bbe5ee1 --- /dev/null +++ b/src/plugins/unified_field_list/public/components/field_list/fields_accordion.test.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { stubLogstashDataView as dataView } from '@kbn/data-views-plugin/common/data_view.stub'; +import { EuiLoadingSpinner, EuiNotificationBadge, EuiText } from '@elastic/eui'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; +import { FieldsAccordion, FieldsAccordionProps } from './fields_accordion'; +import { FieldListItem } from '../../types'; + +describe('UnifiedFieldList <FieldsAccordion />', () => { + let defaultProps: FieldsAccordionProps<FieldListItem>; + const paginatedFields = dataView.fields; + + beforeEach(() => { + defaultProps = { + initialIsOpen: true, + onToggle: jest.fn(), + groupIndex: 0, + id: 'id', + label: 'label-test', + hasLoaded: true, + fieldsCount: paginatedFields.length, + isFiltered: false, + paginatedFields, + renderCallout: () => <div id="lens-test-callout">Callout</div>, + renderFieldItem: ({ field }) => <EuiText key={field.name}>{field.name}</EuiText>, + }; + }); + + it('renders fields correctly', () => { + const wrapper = mountWithIntl(<FieldsAccordion {...defaultProps} />); + expect(wrapper.find(EuiText)).toHaveLength(paginatedFields.length + 1); // + title + expect(wrapper.find(EuiText).first().text()).toBe(defaultProps.label); + expect(wrapper.find(EuiText).at(1).text()).toBe(paginatedFields[0].name); + expect(wrapper.find(EuiText).last().text()).toBe( + paginatedFields[paginatedFields.length - 1].name + ); + }); + + it('renders callout if no fields', () => { + const wrapper = mountWithIntl( + <FieldsAccordion {...defaultProps} fieldsCount={0} paginatedFields={[]} /> + ); + expect(wrapper.find('#lens-test-callout').length).toEqual(1); + }); + + it('renders accented notificationBadge state if isFiltered', () => { + const wrapper = mountWithIntl(<FieldsAccordion {...defaultProps} isFiltered={true} />); + expect(wrapper.find(EuiNotificationBadge).prop('color')).toEqual('accent'); + }); + + it('renders spinner if has not loaded', () => { + const wrapper = mountWithIntl(<FieldsAccordion {...defaultProps} hasLoaded={false} />); + expect(wrapper.find(EuiLoadingSpinner).length).toEqual(1); + }); +}); diff --git a/src/plugins/unified_field_list/public/components/field_list/fields_accordion.tsx b/src/plugins/unified_field_list/public/components/field_list/fields_accordion.tsx new file mode 100644 index 0000000000000..5222cf1b0e678 --- /dev/null +++ b/src/plugins/unified_field_list/public/components/field_list/fields_accordion.tsx @@ -0,0 +1,161 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useMemo, Fragment } from 'react'; +import { i18n } from '@kbn/i18n'; +import { + EuiText, + EuiNotificationBadge, + EuiSpacer, + EuiAccordion, + EuiLoadingSpinner, + EuiIconTip, +} from '@elastic/eui'; +import classNames from 'classnames'; +import { type DataViewField } from '@kbn/data-views-plugin/common'; +import type { FieldListItem } from '../../types'; +import './fields_accordion.scss'; + +export interface FieldsAccordionProps<T extends FieldListItem> { + initialIsOpen: boolean; + onToggle: (open: boolean) => void; + id: string; + label: string; + helpTooltip?: string; + hasLoaded: boolean; + fieldsCount: number; + hideDetails?: boolean; + isFiltered: boolean; + groupIndex: number; + paginatedFields: T[]; + renderFieldItem: (params: { + field: T; + hideDetails?: boolean; + itemIndex: number; + groupIndex: number; + }) => JSX.Element; + renderCallout: () => JSX.Element; + showExistenceFetchError?: boolean; + showExistenceFetchTimeout?: boolean; +} + +function InnerFieldsAccordion<T extends FieldListItem = DataViewField>({ + initialIsOpen, + onToggle, + id, + label, + helpTooltip, + hasLoaded, + fieldsCount, + hideDetails, + isFiltered, + groupIndex, + paginatedFields, + renderFieldItem, + renderCallout, + showExistenceFetchError, + showExistenceFetchTimeout, +}: FieldsAccordionProps<T>) { + const renderButton = useMemo(() => { + const titleClassname = classNames({ + // eslint-disable-next-line @typescript-eslint/naming-convention + unifiedFieldList__fieldsAccordion__titleTooltip: !!helpTooltip, + }); + + return ( + <EuiText size="xs"> + <strong className={titleClassname}>{label}</strong> + {!!helpTooltip && ( + <EuiIconTip + aria-label={helpTooltip} + type="questionInCircle" + color="subdued" + size="s" + position="right" + content={helpTooltip} + iconProps={{ + className: 'eui-alignTop', + }} + /> + )} + </EuiText> + ); + }, [label, helpTooltip]); + + const extraAction = useMemo(() => { + if (showExistenceFetchError) { + return ( + <EuiIconTip + aria-label={i18n.translate('unifiedFieldList.fieldsAccordion.existenceErrorAriaLabel', { + defaultMessage: 'Existence fetch failed', + })} + type="alert" + color="warning" + content={i18n.translate('unifiedFieldList.fieldsAccordion.existenceErrorLabel', { + defaultMessage: "Field information can't be loaded", + })} + /> + ); + } + if (showExistenceFetchTimeout) { + return ( + <EuiIconTip + aria-label={i18n.translate('unifiedFieldList.fieldsAccordion.existenceTimeoutAriaLabel', { + defaultMessage: 'Existence fetch timed out', + })} + type="clock" + color="warning" + content={i18n.translate('unifiedFieldList.fieldsAccordion.existenceTimeoutLabel', { + defaultMessage: 'Field information took too long', + })} + /> + ); + } + if (hasLoaded) { + return ( + <EuiNotificationBadge + size="m" + color={isFiltered ? 'accent' : 'subdued'} + data-test-subj={`${id}-count`} + > + {fieldsCount} + </EuiNotificationBadge> + ); + } + + return <EuiLoadingSpinner size="m" />; + }, [showExistenceFetchError, showExistenceFetchTimeout, hasLoaded, isFiltered, id, fieldsCount]); + + return ( + <EuiAccordion + initialIsOpen={initialIsOpen} + onToggle={onToggle} + data-test-subj={id} + id={id} + buttonContent={renderButton} + extraAction={extraAction} + > + <EuiSpacer size="s" /> + {hasLoaded && + (!!fieldsCount ? ( + <ul className="unifiedFieldList__fieldsAccordion__fieldItems"> + {paginatedFields && + paginatedFields.map((field, index) => ( + <Fragment key={field.name}> + {renderFieldItem({ field, itemIndex: index, groupIndex, hideDetails })} + </Fragment> + ))} + </ul> + ) : ( + renderCallout() + ))} + </EuiAccordion> + ); +} + +export const FieldsAccordion = React.memo(InnerFieldsAccordion) as typeof InnerFieldsAccordion; diff --git a/src/plugins/unified_field_list/public/components/field_list/index.tsx b/src/plugins/unified_field_list/public/components/field_list/index.tsx new file mode 100755 index 0000000000000..44302a7e1c42b --- /dev/null +++ b/src/plugins/unified_field_list/public/components/field_list/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { Fragment } from 'react'; +import { type DataViewField } from '@kbn/data-views-plugin/common'; +import type { FieldListGroupedProps, GenericFieldListGrouped } from './field_list_grouped'; +import { type FieldListItem } from '../../types'; + +const Fallback = () => <Fragment />; + +const LazyFieldListGrouped = React.lazy( + () => import('./field_list_grouped') +) as GenericFieldListGrouped; + +function WrappedFieldListGrouped<T extends FieldListItem = DataViewField>( + props: FieldListGroupedProps<T> +) { + return ( + <React.Suspense fallback={<Fallback />}> + <LazyFieldListGrouped<T> {...props} /> + </React.Suspense> + ); +} + +export const FieldListGrouped = WrappedFieldListGrouped; +export type { FieldListGroupedProps }; diff --git a/x-pack/plugins/lens/public/datasources/form_based/no_fields_callout.test.tsx b/src/plugins/unified_field_list/public/components/field_list/no_fields_callout.test.tsx similarity index 86% rename from x-pack/plugins/lens/public/datasources/form_based/no_fields_callout.test.tsx rename to src/plugins/unified_field_list/public/components/field_list/no_fields_callout.test.tsx index 635c06691a733..03936a89877ba 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/no_fields_callout.test.tsx +++ b/src/plugins/unified_field_list/public/components/field_list/no_fields_callout.test.tsx @@ -1,17 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; import { shallow } from 'enzyme'; import { NoFieldsCallout } from './no_fields_callout'; -describe('NoFieldCallout', () => { +describe('UnifiedFieldList <NoFieldCallout />', () => { it('renders correctly for index with no fields', () => { - const component = shallow(<NoFieldsCallout existFieldsInIndex={false} />); + const component = shallow(<NoFieldsCallout fieldsExistInIndex={false} />); expect(component).toMatchInlineSnapshot(` <EuiCallOut color="warning" @@ -21,7 +22,7 @@ describe('NoFieldCallout', () => { `); }); it('renders correctly when empty with no filters/timerange reasons', () => { - const component = shallow(<NoFieldsCallout existFieldsInIndex={true} />); + const component = shallow(<NoFieldsCallout fieldsExistInIndex={true} />); expect(component).toMatchInlineSnapshot(` <EuiCallOut color="warning" @@ -32,7 +33,7 @@ describe('NoFieldCallout', () => { }); it('renders correctly with passed defaultNoFieldsMessage', () => { const component = shallow( - <NoFieldsCallout existFieldsInIndex={true} defaultNoFieldsMessage="No empty fields" /> + <NoFieldsCallout fieldsExistInIndex={true} defaultNoFieldsMessage="No empty fields" /> ); expect(component).toMatchInlineSnapshot(` <EuiCallOut @@ -45,7 +46,7 @@ describe('NoFieldCallout', () => { it('renders properly when affected by field filter', () => { const component = shallow( - <NoFieldsCallout existFieldsInIndex={true} isAffectedByFieldFilter={true} /> + <NoFieldsCallout fieldsExistInIndex={true} isAffectedByFieldFilter={true} /> ); expect(component).toMatchInlineSnapshot(` <EuiCallOut @@ -68,7 +69,7 @@ describe('NoFieldCallout', () => { it('renders correctly when affected by global filters and timerange', () => { const component = shallow( <NoFieldsCallout - existFieldsInIndex={true} + fieldsExistInIndex={true} isAffectedByTimerange={true} isAffectedByGlobalFilter={true} defaultNoFieldsMessage="There are no available fields that contain data." @@ -98,7 +99,7 @@ describe('NoFieldCallout', () => { it('renders correctly when affected by global filters and field filters', () => { const component = shallow( <NoFieldsCallout - existFieldsInIndex={true} + fieldsExistInIndex={true} isAffectedByTimerange={true} isAffectedByFieldFilter={true} defaultNoFieldsMessage="There are no available fields that contain data." @@ -128,7 +129,7 @@ describe('NoFieldCallout', () => { it('renders correctly when affected by field filters, global filter and timerange', () => { const component = shallow( <NoFieldsCallout - existFieldsInIndex={true} + fieldsExistInIndex={true} isAffectedByFieldFilter={true} isAffectedByTimerange={true} isAffectedByGlobalFilter={true} diff --git a/src/plugins/unified_field_list/public/components/field_list/no_fields_callout.tsx b/src/plugins/unified_field_list/public/components/field_list/no_fields_callout.tsx new file mode 100644 index 0000000000000..3d24b400da3cb --- /dev/null +++ b/src/plugins/unified_field_list/public/components/field_list/no_fields_callout.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiCallOut } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +const defaultNoFieldsMessageCopy = i18n.translate( + 'unifiedFieldList.fieldList.noFieldsCallout.noDataLabel', + { + defaultMessage: 'There are no fields.', + } +); + +export const NoFieldsCallout = ({ + fieldsExistInIndex, + defaultNoFieldsMessage = defaultNoFieldsMessageCopy, + isAffectedByFieldFilter = false, + isAffectedByTimerange = false, + isAffectedByGlobalFilter = false, +}: { + fieldsExistInIndex: boolean; + isAffectedByFieldFilter?: boolean; + defaultNoFieldsMessage?: string; + isAffectedByTimerange?: boolean; + isAffectedByGlobalFilter?: boolean; +}) => { + if (!fieldsExistInIndex) { + return ( + <EuiCallOut + size="s" + color="warning" + title={i18n.translate('unifiedFieldList.fieldList.noFieldsCallout.noFieldsLabel', { + defaultMessage: 'No fields exist in this data view.', + })} + /> + ); + } + + return ( + <EuiCallOut + size="s" + color="warning" + title={ + isAffectedByFieldFilter + ? i18n.translate('unifiedFieldList.fieldList.noFieldsCallout.noFilteredFieldsLabel', { + defaultMessage: 'No fields match the selected filters.', + }) + : defaultNoFieldsMessage + } + > + {(isAffectedByTimerange || isAffectedByFieldFilter || isAffectedByGlobalFilter) && ( + <> + <strong> + {i18n.translate('unifiedFieldList.fieldList.noFieldsCallout.noFields.tryText', { + defaultMessage: 'Try:', + })} + </strong> + <ul> + {isAffectedByTimerange && ( + <li> + {i18n.translate( + 'unifiedFieldList.fieldList.noFieldsCallout.noFields.extendTimeBullet', + { + defaultMessage: 'Extending the time range', + } + )} + </li> + )} + {isAffectedByFieldFilter && ( + <li> + {i18n.translate( + 'unifiedFieldList.fieldList.noFieldsCallout.noFields.fieldTypeFilterBullet', + { + defaultMessage: 'Using different field filters', + } + )} + </li> + )} + {isAffectedByGlobalFilter && ( + <li> + {i18n.translate( + 'unifiedFieldList.fieldList.noFieldsCallout.noFields.globalFiltersBullet', + { + defaultMessage: 'Changing the global filters', + } + )} + </li> + )} + </ul> + </> + )} + </EuiCallOut> + ); +}; diff --git a/src/plugins/unified_field_list/public/components/field_stats/field_stats.tsx b/src/plugins/unified_field_list/public/components/field_stats/field_stats.tsx index c70f1df820252..b3600dc9f3971 100755 --- a/src/plugins/unified_field_list/public/components/field_stats/field_stats.tsx +++ b/src/plugins/unified_field_list/public/components/field_stats/field_stats.tsx @@ -8,8 +8,8 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { - DataView, - DataViewField, + type DataView, + type DataViewField, ES_FIELD_TYPES, getEsQueryConfig, KBN_FIELD_TYPES, @@ -75,7 +75,7 @@ export interface FieldStatsProps { 'data-test-subj'?: string; overrideMissingContent?: (params: { element: JSX.Element; - noDataFound?: boolean; + reason: 'no-data' | 'unsupported'; }) => JSX.Element | null; overrideFooter?: (params: { element: JSX.Element; @@ -304,7 +304,7 @@ const FieldStatsComponent: React.FC<FieldStatsProps> = ({ return overrideMissingContent ? overrideMissingContent({ - noDataFound: false, + reason: 'unsupported', element: messageNoAnalysis, }) : messageNoAnalysis; @@ -338,7 +338,7 @@ const FieldStatsComponent: React.FC<FieldStatsProps> = ({ return overrideMissingContent ? overrideMissingContent({ - noDataFound: true, + reason: 'no-data', element: messageNoData, }) : messageNoData; @@ -358,12 +358,14 @@ const FieldStatsComponent: React.FC<FieldStatsProps> = ({ defaultMessage: 'Top values', }), id: 'topValues', + 'data-test-subj': `${dataTestSubject}-buttonGroup-topValuesButton`, }, { label: i18n.translate('unifiedFieldList.fieldStats.fieldDistributionLabel', { defaultMessage: 'Distribution', }), id: 'histogram', + 'data-test-subj': `${dataTestSubject}-buttonGroup-distributionButton`, }, ]} onChange={(optionId: string) => { diff --git a/src/plugins/unified_field_list/public/hooks/use_existing_fields.test.tsx b/src/plugins/unified_field_list/public/hooks/use_existing_fields.test.tsx new file mode 100644 index 0000000000000..7a27a1468213d --- /dev/null +++ b/src/plugins/unified_field_list/public/hooks/use_existing_fields.test.tsx @@ -0,0 +1,536 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { renderHook } from '@testing-library/react-hooks'; +import { stubLogstashDataView as dataView } from '@kbn/data-views-plugin/common/data_view.stub'; +import { createStubDataView, stubFieldSpecMap } from '@kbn/data-plugin/public/stubs'; +import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; +import { UI_SETTINGS } from '@kbn/data-plugin/common'; +import { + useExistingFieldsFetcher, + useExistingFieldsReader, + resetExistingFieldsCache, + type ExistingFieldsFetcherParams, + ExistingFieldsReader, +} from './use_existing_fields'; +import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; +import { coreMock } from '@kbn/core/public/mocks'; +import * as ExistingFieldsServiceApi from '../services/field_existing/load_field_existing'; +import { ExistenceFetchStatus } from '../types'; + +const dslQuery = { bool: { must: [], filter: [], should: [], must_not: [] } }; +const rollupAggsMock = { + date_histogram: { + '@timestamp': { + agg: 'date_histogram', + fixed_interval: '20m', + delay: '10m', + time_zone: 'UTC', + }, + }, +}; + +jest.spyOn(ExistingFieldsServiceApi, 'loadFieldExisting').mockImplementation(async () => ({ + indexPatternTitle: 'test', + existingFieldNames: [], +})); + +describe('UnifiedFieldList useExistingFields', () => { + let mockedServices: ExistingFieldsFetcherParams['services']; + const anotherDataView = createStubDataView({ + spec: { + id: 'another-data-view', + title: 'logstash-0', + fields: stubFieldSpecMap, + }, + }); + const dataViewWithRestrictions = createStubDataView({ + spec: { + id: 'another-data-view-with-restrictions', + title: 'logstash-1', + fields: stubFieldSpecMap, + typeMeta: { + aggs: rollupAggsMock, + }, + }, + }); + jest.spyOn(dataViewWithRestrictions, 'getAggregationRestrictions'); + + beforeEach(() => { + const dataViews = dataViewPluginMocks.createStartContract(); + const core = coreMock.createStart(); + mockedServices = { + dataViews, + data: dataPluginMock.createStartContract(), + core, + }; + + core.uiSettings.get.mockImplementation((key: string) => { + if (key === UI_SETTINGS.META_FIELDS) { + return ['_id']; + } + }); + + dataViews.get.mockImplementation(async (id: string) => { + return [dataView, anotherDataView, dataViewWithRestrictions].find((dw) => dw.id === id)!; + }); + + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockClear(); + (dataViewWithRestrictions.getAggregationRestrictions as jest.Mock).mockClear(); + resetExistingFieldsCache(); + }); + + it('should work correctly based on the specified data view', async () => { + const dataViewId = dataView.id!; + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: [dataView.fields[0].name], + }; + }); + + const hookFetcher = renderHook(useExistingFieldsFetcher, { + initialProps: { + dataViews: [dataView], + services: mockedServices, + fromDate: '2019-01-01', + toDate: '2020-01-01', + query: { query: '', language: 'lucene' }, + filters: [], + }, + }); + + const hookReader = renderHook(useExistingFieldsReader); + + await hookFetcher.waitForNextUpdate(); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledWith( + expect.objectContaining({ + fromDate: '2019-01-01', + toDate: '2020-01-01', + dslQuery, + dataView, + timeFieldName: dataView.timeFieldName, + }) + ); + + // has existence info for the loaded data view => works more restrictive + expect(hookReader.result.current.isFieldsExistenceInfoUnavailable(dataViewId)).toBe(false); + expect(hookReader.result.current.hasFieldData(dataViewId, dataView.fields[0].name)).toBe(true); + expect(hookReader.result.current.hasFieldData(dataViewId, dataView.fields[1].name)).toBe(false); + expect(hookReader.result.current.getFieldsExistenceStatus(dataViewId)).toBe( + ExistenceFetchStatus.succeeded + ); + + // does not have existence info => works less restrictive + const anotherDataViewId = 'test-id'; + expect(hookReader.result.current.isFieldsExistenceInfoUnavailable(anotherDataViewId)).toBe( + false + ); + expect(hookReader.result.current.hasFieldData(anotherDataViewId, dataView.fields[0].name)).toBe( + true + ); + expect(hookReader.result.current.hasFieldData(anotherDataViewId, dataView.fields[1].name)).toBe( + true + ); + expect(hookReader.result.current.getFieldsExistenceStatus(anotherDataViewId)).toBe( + ExistenceFetchStatus.unknown + ); + }); + + it('should work correctly with multiple readers', async () => { + const dataViewId = dataView.id!; + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: [dataView.fields[0].name], + }; + }); + + const hookFetcher = renderHook(useExistingFieldsFetcher, { + initialProps: { + dataViews: [dataView], + services: mockedServices, + fromDate: '2019-01-01', + toDate: '2020-01-01', + query: { query: '', language: 'lucene' }, + filters: [], + }, + }); + + const hookReader1 = renderHook(useExistingFieldsReader); + const hookReader2 = renderHook(useExistingFieldsReader); + + await hookFetcher.waitForNextUpdate(); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalled(); + + const checkResults = (currentResult: ExistingFieldsReader) => { + expect(currentResult.isFieldsExistenceInfoUnavailable(dataViewId)).toBe(false); + expect(currentResult.hasFieldData(dataViewId, dataView.fields[0].name)).toBe(true); + expect(currentResult.hasFieldData(dataViewId, dataView.fields[1].name)).toBe(false); + expect(currentResult.getFieldsExistenceStatus(dataViewId)).toBe( + ExistenceFetchStatus.succeeded + ); + }; + + // both readers should get the same results + + checkResults(hookReader1.result.current); + checkResults(hookReader2.result.current); + + // info should be persisted even if the fetcher was unmounted + + hookFetcher.unmount(); + + checkResults(hookReader1.result.current); + checkResults(hookReader2.result.current); + }); + + it('should work correctly if load fails', async () => { + const dataViewId = dataView.id!; + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + throw new Error('test'); + }); + + const hookFetcher = renderHook(useExistingFieldsFetcher, { + initialProps: { + dataViews: [dataView], + services: mockedServices, + fromDate: '2019-01-01', + toDate: '2020-01-01', + query: { query: '', language: 'lucene' }, + filters: [], + }, + }); + + const hookReader = renderHook(useExistingFieldsReader); + + await hookFetcher.waitForNextUpdate(); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalled(); + + const currentResult = hookReader.result.current; + expect(currentResult.isFieldsExistenceInfoUnavailable(dataViewId)).toBe(true); + expect(currentResult.hasFieldData(dataViewId, dataView.fields[0].name)).toBe(true); + expect(currentResult.getFieldsExistenceStatus(dataViewId)).toBe(ExistenceFetchStatus.failed); + }); + + it('should work correctly for multiple data views', async () => { + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation( + async ({ dataView: currentDataView }) => { + return { + existingFieldNames: [currentDataView.fields[0].name], + }; + } + ); + + const hookFetcher = renderHook(useExistingFieldsFetcher, { + initialProps: { + dataViews: [dataView, anotherDataView, dataViewWithRestrictions], + services: mockedServices, + fromDate: '2019-01-01', + toDate: '2020-01-01', + query: { query: '', language: 'lucene' }, + filters: [], + }, + }); + + const hookReader = renderHook(useExistingFieldsReader); + await hookFetcher.waitForNextUpdate(); + + const currentResult = hookReader.result.current; + + expect(currentResult.isFieldsExistenceInfoUnavailable(dataView.id!)).toBe(false); + expect(currentResult.isFieldsExistenceInfoUnavailable(anotherDataView.id!)).toBe(false); + expect(currentResult.isFieldsExistenceInfoUnavailable(dataViewWithRestrictions.id!)).toBe(true); + expect(currentResult.isFieldsExistenceInfoUnavailable('test-id')).toBe(false); + + expect(currentResult.hasFieldData(dataView.id!, dataView.fields[0].name)).toBe(true); + expect(currentResult.hasFieldData(dataView.id!, dataView.fields[1].name)).toBe(false); + + expect(currentResult.hasFieldData(anotherDataView.id!, anotherDataView.fields[0].name)).toBe( + true + ); + expect(currentResult.hasFieldData(anotherDataView.id!, anotherDataView.fields[1].name)).toBe( + false + ); + + expect( + currentResult.hasFieldData( + dataViewWithRestrictions.id!, + dataViewWithRestrictions.fields[0].name + ) + ).toBe(true); + expect( + currentResult.hasFieldData( + dataViewWithRestrictions.id!, + dataViewWithRestrictions.fields[1].name + ) + ).toBe(true); + expect(currentResult.hasFieldData('test-id', 'test-field')).toBe(true); + + expect(currentResult.getFieldsExistenceStatus(dataView.id!)).toBe( + ExistenceFetchStatus.succeeded + ); + expect(currentResult.getFieldsExistenceStatus(anotherDataView.id!)).toBe( + ExistenceFetchStatus.succeeded + ); + expect(currentResult.getFieldsExistenceStatus(dataViewWithRestrictions.id!)).toBe( + ExistenceFetchStatus.succeeded + ); + expect(currentResult.getFieldsExistenceStatus('test-id')).toBe(ExistenceFetchStatus.unknown); + + expect(dataViewWithRestrictions.getAggregationRestrictions).toHaveBeenCalledTimes(1); + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledTimes(2); + }); + + it('should work correctly for data views with restrictions', async () => { + const dataViewId = dataViewWithRestrictions.id!; + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + throw new Error('test'); + }); + + const hookFetcher = renderHook(useExistingFieldsFetcher, { + initialProps: { + dataViews: [dataViewWithRestrictions], + services: mockedServices, + fromDate: '2019-01-01', + toDate: '2020-01-01', + query: { query: '', language: 'lucene' }, + filters: [], + }, + }); + + const hookReader = renderHook(useExistingFieldsReader); + await hookFetcher.waitForNextUpdate(); + await hookFetcher.waitFor(() => !hookFetcher.result.current.isProcessing); + + expect(dataViewWithRestrictions.getAggregationRestrictions).toHaveBeenCalled(); + expect(ExistingFieldsServiceApi.loadFieldExisting).not.toHaveBeenCalled(); + + const currentResult = hookReader.result.current; + expect(currentResult.isFieldsExistenceInfoUnavailable(dataViewId)).toBe(true); + expect(currentResult.hasFieldData(dataViewId, dataViewWithRestrictions.fields[0].name)).toBe( + true + ); + expect(currentResult.getFieldsExistenceStatus(dataViewId)).toBe(ExistenceFetchStatus.succeeded); + }); + + it('should work correctly for when data views are changed', async () => { + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation( + async ({ dataView: currentDataView }) => { + return { + existingFieldNames: [currentDataView.fields[0].name], + }; + } + ); + + const params: ExistingFieldsFetcherParams = { + dataViews: [dataView], + services: mockedServices, + fromDate: '2019-01-01', + toDate: '2020-01-01', + query: { query: '', language: 'lucene' }, + filters: [], + }; + const hookFetcher = renderHook(useExistingFieldsFetcher, { + initialProps: params, + }); + + const hookReader = renderHook(useExistingFieldsReader); + await hookFetcher.waitForNextUpdate(); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledWith( + expect.objectContaining({ + fromDate: '2019-01-01', + toDate: '2020-01-01', + dslQuery, + dataView, + timeFieldName: dataView.timeFieldName, + }) + ); + + expect(hookReader.result.current.getFieldsExistenceStatus(dataView.id!)).toBe( + ExistenceFetchStatus.succeeded + ); + expect(hookReader.result.current.getFieldsExistenceStatus(anotherDataView.id!)).toBe( + ExistenceFetchStatus.unknown + ); + + hookFetcher.rerender({ + ...params, + dataViews: [dataView, anotherDataView], + }); + + await hookFetcher.waitForNextUpdate(); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenNthCalledWith( + 2, + expect.objectContaining({ + fromDate: '2019-01-01', + toDate: '2020-01-01', + dslQuery, + dataView, + timeFieldName: dataView.timeFieldName, + }) + ); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenNthCalledWith( + 3, + expect.objectContaining({ + fromDate: '2019-01-01', + toDate: '2020-01-01', + dslQuery, + dataView: anotherDataView, + timeFieldName: anotherDataView.timeFieldName, + }) + ); + + expect(hookReader.result.current.getFieldsExistenceStatus(dataView.id!)).toBe( + ExistenceFetchStatus.succeeded + ); + expect(hookReader.result.current.getFieldsExistenceStatus(anotherDataView.id!)).toBe( + ExistenceFetchStatus.succeeded + ); + }); + + it('should work correctly for when params are changed', async () => { + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation( + async ({ dataView: currentDataView }) => { + return { + existingFieldNames: [currentDataView.fields[0].name], + }; + } + ); + + const params: ExistingFieldsFetcherParams = { + dataViews: [dataView], + services: mockedServices, + fromDate: '2019-01-01', + toDate: '2020-01-01', + query: { query: '', language: 'lucene' }, + filters: [], + }; + const hookFetcher = renderHook(useExistingFieldsFetcher, { + initialProps: params, + }); + + const hookReader = renderHook(useExistingFieldsReader); + await hookFetcher.waitForNextUpdate(); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledWith( + expect.objectContaining({ + fromDate: '2019-01-01', + toDate: '2020-01-01', + dslQuery, + dataView, + timeFieldName: dataView.timeFieldName, + }) + ); + + expect(hookReader.result.current.getFieldsExistenceStatus(dataView.id!)).toBe( + ExistenceFetchStatus.succeeded + ); + + hookFetcher.rerender({ + ...params, + fromDate: '2021-01-01', + toDate: '2022-01-01', + query: { query: 'test', language: 'kuery' }, + }); + + await hookFetcher.waitForNextUpdate(); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenNthCalledWith( + 2, + expect.objectContaining({ + fromDate: '2021-01-01', + toDate: '2022-01-01', + dslQuery: { + bool: { + filter: [ + { + multi_match: { + lenient: true, + query: 'test', + type: 'best_fields', + }, + }, + ], + must: [], + must_not: [], + should: [], + }, + }, + dataView, + timeFieldName: dataView.timeFieldName, + }) + ); + }); + + it('should call onNoData callback only once', async () => { + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: ['_id'], + }; + }); + + const params: ExistingFieldsFetcherParams = { + dataViews: [dataView], + services: mockedServices, + fromDate: '2019-01-01', + toDate: '2020-01-01', + query: { query: '', language: 'lucene' }, + filters: [], + onNoData: jest.fn(), + }; + const hookFetcher = renderHook(useExistingFieldsFetcher, { + initialProps: params, + }); + + const hookReader = renderHook(useExistingFieldsReader); + await hookFetcher.waitForNextUpdate(); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledWith( + expect.objectContaining({ + fromDate: '2019-01-01', + toDate: '2020-01-01', + dslQuery, + dataView, + timeFieldName: dataView.timeFieldName, + }) + ); + + expect(hookReader.result.current.getFieldsExistenceStatus(dataView.id!)).toBe( + ExistenceFetchStatus.succeeded + ); + + expect(params.onNoData).toHaveBeenCalledWith(dataView.id); + expect(params.onNoData).toHaveBeenCalledTimes(1); + + hookFetcher.rerender({ + ...params, + fromDate: '2021-01-01', + toDate: '2022-01-01', + }); + + await hookFetcher.waitForNextUpdate(); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenNthCalledWith( + 2, + expect.objectContaining({ + fromDate: '2021-01-01', + toDate: '2022-01-01', + dslQuery, + dataView, + timeFieldName: dataView.timeFieldName, + }) + ); + + expect(params.onNoData).toHaveBeenCalledTimes(1); // still 1 time + }); +}); diff --git a/src/plugins/unified_field_list/public/hooks/use_existing_fields.ts b/src/plugins/unified_field_list/public/hooks/use_existing_fields.ts new file mode 100644 index 0000000000000..ebf12d4609500 --- /dev/null +++ b/src/plugins/unified_field_list/public/hooks/use_existing_fields.ts @@ -0,0 +1,347 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { htmlIdGenerator } from '@elastic/eui'; +import { BehaviorSubject } from 'rxjs'; +import { CoreStart } from '@kbn/core/public'; +import type { AggregateQuery, EsQueryConfig, Filter, Query } from '@kbn/es-query'; +import { + DataPublicPluginStart, + DataViewsContract, + getEsQueryConfig, + UI_SETTINGS, +} from '@kbn/data-plugin/public'; +import { type DataView } from '@kbn/data-plugin/common'; +import { loadFieldExisting } from '../services/field_existing'; +import { ExistenceFetchStatus } from '../types'; + +const getBuildEsQueryAsync = async () => (await import('@kbn/es-query')).buildEsQuery; +const generateId = htmlIdGenerator(); + +export interface ExistingFieldsInfo { + fetchStatus: ExistenceFetchStatus; + existingFieldsByFieldNameMap: Record<string, boolean>; + numberOfFetches: number; + hasDataViewRestrictions?: boolean; +} + +export interface ExistingFieldsFetcherParams { + dataViews: DataView[]; + fromDate: string; + toDate: string; + query: Query | AggregateQuery; + filters: Filter[]; + services: { + core: Pick<CoreStart, 'uiSettings'>; + data: DataPublicPluginStart; + dataViews: DataViewsContract; + }; + onNoData?: (dataViewId: string) => unknown; +} + +type ExistingFieldsByDataViewMap = Record<string, ExistingFieldsInfo>; + +export interface ExistingFieldsFetcher { + refetchFieldsExistenceInfo: (dataViewId?: string) => Promise<void>; + isProcessing: boolean; +} + +export interface ExistingFieldsReader { + hasFieldData: (dataViewId: string, fieldName: string) => boolean; + getFieldsExistenceStatus: (dataViewId: string) => ExistenceFetchStatus; + isFieldsExistenceInfoUnavailable: (dataViewId: string) => boolean; +} + +const initialData: ExistingFieldsByDataViewMap = {}; +const unknownInfo: ExistingFieldsInfo = { + fetchStatus: ExistenceFetchStatus.unknown, + existingFieldsByFieldNameMap: {}, + numberOfFetches: 0, +}; + +const globalMap$ = new BehaviorSubject<ExistingFieldsByDataViewMap>(initialData); // for syncing between hooks +let lastFetchId: string = ''; // persist last fetch id to skip older requests/responses if any + +export const useExistingFieldsFetcher = ( + params: ExistingFieldsFetcherParams +): ExistingFieldsFetcher => { + const mountedRef = useRef<boolean>(true); + const [activeRequests, setActiveRequests] = useState<number>(0); + const isProcessing = activeRequests > 0; + + const fetchFieldsExistenceInfo = useCallback( + async ({ + dataViewId, + query, + filters, + fromDate, + toDate, + services: { dataViews, data, core }, + onNoData, + fetchId, + }: ExistingFieldsFetcherParams & { + dataViewId: string | undefined; + fetchId: string; + }): Promise<void> => { + if (!dataViewId) { + return; + } + + const currentInfo = globalMap$.getValue()?.[dataViewId]; + + if (!mountedRef.current) { + return; + } + + const numberOfFetches = (currentInfo?.numberOfFetches ?? 0) + 1; + const dataView = await dataViews.get(dataViewId); + + if (!dataView?.title) { + return; + } + + setActiveRequests((value) => value + 1); + + const hasRestrictions = Boolean(dataView.getAggregationRestrictions?.()); + const info: ExistingFieldsInfo = { + ...unknownInfo, + numberOfFetches, + }; + + if (hasRestrictions) { + info.fetchStatus = ExistenceFetchStatus.succeeded; + info.hasDataViewRestrictions = true; + } else { + try { + const result = await loadFieldExisting({ + dslQuery: await buildSafeEsQuery( + dataView, + query, + filters, + getEsQueryConfig(core.uiSettings) + ), + fromDate, + toDate, + timeFieldName: dataView.timeFieldName, + data, + uiSettingsClient: core.uiSettings, + dataViewsService: dataViews, + dataView, + }); + + const existingFieldNames = result?.existingFieldNames || []; + + const metaFields = core.uiSettings.get(UI_SETTINGS.META_FIELDS) || []; + if ( + !existingFieldNames.filter((fieldName) => !metaFields.includes?.(fieldName)).length && + numberOfFetches === 1 && + onNoData + ) { + onNoData(dataViewId); + } + + info.existingFieldsByFieldNameMap = booleanMap(existingFieldNames); + info.fetchStatus = ExistenceFetchStatus.succeeded; + } catch (error) { + // eslint-disable-next-line no-console + console.error(error); + info.fetchStatus = ExistenceFetchStatus.failed; + } + } + + // skip redundant and older results + if (mountedRef.current && fetchId === lastFetchId) { + globalMap$.next({ + ...globalMap$.getValue(), + [dataViewId]: info, + }); + } + + setActiveRequests((value) => value - 1); + }, + [mountedRef, setActiveRequests] + ); + + const dataViewsHash = getDataViewsHash(params.dataViews); + const refetchFieldsExistenceInfo = useCallback( + async (dataViewId?: string) => { + const fetchId = generateId(); + lastFetchId = fetchId; + // refetch only for the specified data view + if (dataViewId) { + await fetchFieldsExistenceInfo({ + fetchId, + dataViewId, + ...params, + }); + return; + } + // refetch for all mentioned data views + await Promise.all( + params.dataViews.map((dataView) => + fetchFieldsExistenceInfo({ + fetchId, + dataViewId: dataView.id, + ...params, + }) + ) + ); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [ + fetchFieldsExistenceInfo, + dataViewsHash, + params.query, + params.filters, + params.fromDate, + params.toDate, + ] + ); + + useEffect(() => { + refetchFieldsExistenceInfo(); + }, [refetchFieldsExistenceInfo]); + + useEffect(() => { + return () => { + mountedRef.current = false; + globalMap$.next({}); // reset the cache (readers will continue using their own data slice until they are unmounted too) + }; + }, [mountedRef]); + + return useMemo( + () => ({ + refetchFieldsExistenceInfo, + isProcessing, + }), + [refetchFieldsExistenceInfo, isProcessing] + ); +}; + +export const useExistingFieldsReader: () => ExistingFieldsReader = () => { + const mountedRef = useRef<boolean>(true); + const [existingFieldsByDataViewMap, setExistingFieldsByDataViewMap] = + useState<ExistingFieldsByDataViewMap>(globalMap$.getValue()); + + useEffect(() => { + const subscription = globalMap$.subscribe((data) => { + if (mountedRef.current && Object.keys(data).length > 0) { + setExistingFieldsByDataViewMap((savedData) => ({ + ...savedData, + ...data, + })); + } + }); + + return () => { + subscription.unsubscribe(); + }; + }, [setExistingFieldsByDataViewMap, mountedRef]); + + const hasFieldData = useCallback( + (dataViewId: string, fieldName: string) => { + const info = existingFieldsByDataViewMap[dataViewId]; + + if (info?.fetchStatus === ExistenceFetchStatus.succeeded) { + return ( + info?.hasDataViewRestrictions || Boolean(info?.existingFieldsByFieldNameMap[fieldName]) + ); + } + + return true; + }, + [existingFieldsByDataViewMap] + ); + + const getFieldsExistenceInfo = useCallback( + (dataViewId: string) => { + return dataViewId ? existingFieldsByDataViewMap[dataViewId] : unknownInfo; + }, + [existingFieldsByDataViewMap] + ); + + const getFieldsExistenceStatus = useCallback( + (dataViewId: string): ExistenceFetchStatus => { + return getFieldsExistenceInfo(dataViewId)?.fetchStatus || ExistenceFetchStatus.unknown; + }, + [getFieldsExistenceInfo] + ); + + const isFieldsExistenceInfoUnavailable = useCallback( + (dataViewId: string): boolean => { + const info = getFieldsExistenceInfo(dataViewId); + return Boolean( + info?.fetchStatus === ExistenceFetchStatus.failed || info?.hasDataViewRestrictions + ); + }, + [getFieldsExistenceInfo] + ); + + useEffect(() => { + return () => { + mountedRef.current = false; + }; + }, [mountedRef]); + + return useMemo( + () => ({ + hasFieldData, + getFieldsExistenceStatus, + isFieldsExistenceInfoUnavailable, + }), + [hasFieldData, getFieldsExistenceStatus, isFieldsExistenceInfoUnavailable] + ); +}; + +export const resetExistingFieldsCache = () => { + globalMap$.next(initialData); +}; + +function getDataViewsHash(dataViews: DataView[]): string { + return ( + dataViews + // From Lens it's coming as IndexPattern type and not the real DataView type + .map( + (dataView) => + `${dataView.id}:${dataView.title}:${dataView.timeFieldName || 'no-timefield'}:${ + dataView.fields?.length ?? 0 // adding a field will also trigger a refetch of fields existence data + }` + ) + .join(',') + ); +} + +// Wrapper around buildEsQuery, handling errors (e.g. because a query can't be parsed) by +// returning a query dsl object not matching anything +async function buildSafeEsQuery( + dataView: DataView, + query: Query | AggregateQuery, + filters: Filter[], + queryConfig: EsQueryConfig +) { + const buildEsQuery = await getBuildEsQueryAsync(); + try { + return buildEsQuery(dataView, query, filters, queryConfig); + } catch (e) { + return { + bool: { + must_not: { + match_all: {}, + }, + }, + }; + } +} + +function booleanMap(keys: string[]) { + return keys.reduce((acc, key) => { + acc[key] = true; + return acc; + }, {} as Record<string, boolean>); +} diff --git a/src/plugins/unified_field_list/public/hooks/use_grouped_fields.test.tsx b/src/plugins/unified_field_list/public/hooks/use_grouped_fields.test.tsx new file mode 100644 index 0000000000000..d4d6d3cdc906f --- /dev/null +++ b/src/plugins/unified_field_list/public/hooks/use_grouped_fields.test.tsx @@ -0,0 +1,272 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { renderHook } from '@testing-library/react-hooks'; +import { + stubDataViewWithoutTimeField, + stubLogstashDataView as dataView, +} from '@kbn/data-views-plugin/common/data_view.stub'; +import { createStubDataView, stubFieldSpecMap } from '@kbn/data-plugin/public/stubs'; +import { DataViewField } from '@kbn/data-views-plugin/common'; +import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; +import { type GroupedFieldsParams, useGroupedFields } from './use_grouped_fields'; +import { ExistenceFetchStatus, FieldListGroups, FieldsGroupNames } from '../types'; + +describe('UnifiedFieldList useGroupedFields()', () => { + let mockedServices: GroupedFieldsParams<DataViewField>['services']; + const allFields = dataView.fields; + const anotherDataView = createStubDataView({ + spec: { + id: 'another-data-view', + title: 'logstash-0', + fields: stubFieldSpecMap, + }, + }); + + beforeEach(() => { + const dataViews = dataViewPluginMocks.createStartContract(); + mockedServices = { + dataViews, + }; + + dataViews.get.mockImplementation(async (id: string) => { + return [dataView, stubDataViewWithoutTimeField].find((dw) => dw.id === id)!; + }); + }); + + it('should work correctly for no data', async () => { + const { result, waitForNextUpdate } = renderHook(() => + useGroupedFields({ + dataViewId: dataView.id!, + allFields: [], + services: mockedServices, + }) + ); + + await waitForNextUpdate(); + + const fieldGroups = result.current.fieldGroups; + + expect( + Object.keys(fieldGroups!).map( + (key) => `${key}-${fieldGroups![key as FieldsGroupNames]?.fields.length}` + ) + ).toStrictEqual([ + 'SpecialFields-0', + 'SelectedFields-0', + 'AvailableFields-0', + 'EmptyFields-0', + 'MetaFields-0', + ]); + }); + + it('should work correctly with fields', async () => { + const { result, waitForNextUpdate } = renderHook(() => + useGroupedFields({ + dataViewId: dataView.id!, + allFields, + services: mockedServices, + }) + ); + + await waitForNextUpdate(); + + const fieldGroups = result.current.fieldGroups; + + expect( + Object.keys(fieldGroups!).map( + (key) => `${key}-${fieldGroups![key as FieldsGroupNames]?.fields.length}` + ) + ).toStrictEqual([ + 'SpecialFields-0', + 'SelectedFields-0', + 'AvailableFields-25', + 'EmptyFields-0', + 'MetaFields-3', + ]); + }); + + it('should work correctly when filtered', async () => { + const { result, waitForNextUpdate } = renderHook(() => + useGroupedFields({ + dataViewId: dataView.id!, + allFields, + services: mockedServices, + onFilterField: (field: DataViewField) => field.name.startsWith('@'), + }) + ); + + await waitForNextUpdate(); + + const fieldGroups = result.current.fieldGroups; + + expect( + Object.keys(fieldGroups!).map( + (key) => `${key}-${fieldGroups![key as FieldsGroupNames]?.fields.length}` + ) + ).toStrictEqual([ + 'SpecialFields-0', + 'SelectedFields-0', + 'AvailableFields-2', + 'EmptyFields-0', + 'MetaFields-0', + ]); + }); + + it('should work correctly when custom unsupported fields are skipped', async () => { + const { result, waitForNextUpdate } = renderHook(() => + useGroupedFields({ + dataViewId: dataView.id!, + allFields, + services: mockedServices, + onSupportedFieldFilter: (field: DataViewField) => field.aggregatable, + }) + ); + + await waitForNextUpdate(); + + const fieldGroups = result.current.fieldGroups; + + expect( + Object.keys(fieldGroups!).map( + (key) => `${key}-${fieldGroups![key as FieldsGroupNames]?.fields.length}` + ) + ).toStrictEqual([ + 'SpecialFields-0', + 'SelectedFields-0', + 'AvailableFields-23', + 'EmptyFields-0', + 'MetaFields-3', + ]); + }); + + it('should work correctly when selected fields are present', async () => { + const { result, waitForNextUpdate } = renderHook(() => + useGroupedFields({ + dataViewId: dataView.id!, + allFields, + services: mockedServices, + onSelectedFieldFilter: (field: DataViewField) => + ['bytes', 'extension', '_id', '@timestamp'].includes(field.name), + }) + ); + + await waitForNextUpdate(); + + const fieldGroups = result.current.fieldGroups; + + expect( + Object.keys(fieldGroups!).map( + (key) => `${key}-${fieldGroups![key as FieldsGroupNames]?.fields.length}` + ) + ).toStrictEqual([ + 'SpecialFields-0', + 'SelectedFields-4', + 'AvailableFields-25', + 'EmptyFields-0', + 'MetaFields-3', + ]); + }); + + it('should work correctly for text-based queries (no data view)', async () => { + const { result } = renderHook(() => + useGroupedFields({ + dataViewId: null, + allFields, + services: mockedServices, + }) + ); + + const fieldGroups = result.current.fieldGroups; + + expect( + Object.keys(fieldGroups!).map( + (key) => `${key}-${fieldGroups![key as FieldsGroupNames]?.fields.length}` + ) + ).toStrictEqual(['SpecialFields-0', 'SelectedFields-0', 'AvailableFields-28', 'MetaFields-0']); + }); + + it('should work correctly when details are overwritten', async () => { + const { result, waitForNextUpdate } = renderHook(() => + useGroupedFields({ + dataViewId: dataView.id!, + allFields, + services: mockedServices, + onOverrideFieldGroupDetails: (groupName) => { + if (groupName === FieldsGroupNames.SelectedFields) { + return { + helpText: 'test', + }; + } + }, + }) + ); + + await waitForNextUpdate(); + + const fieldGroups = result.current.fieldGroups; + + expect(fieldGroups[FieldsGroupNames.SelectedFields]?.helpText).toBe('test'); + expect(fieldGroups[FieldsGroupNames.AvailableFields]?.helpText).not.toBe('test'); + }); + + it('should work correctly when changing a data view and existence info is available only for one of them', async () => { + const knownDataViewId = dataView.id!; + let fieldGroups: FieldListGroups<DataViewField>; + const props: GroupedFieldsParams<DataViewField> = { + dataViewId: dataView.id!, + allFields, + services: mockedServices, + fieldsExistenceReader: { + hasFieldData: (dataViewId, fieldName) => { + return dataViewId === knownDataViewId && ['bytes', 'extension'].includes(fieldName); + }, + getFieldsExistenceStatus: (dataViewId) => + dataViewId === knownDataViewId + ? ExistenceFetchStatus.succeeded + : ExistenceFetchStatus.unknown, + isFieldsExistenceInfoUnavailable: (dataViewId) => dataViewId !== knownDataViewId, + }, + }; + + const { result, waitForNextUpdate, rerender } = renderHook(useGroupedFields, { + initialProps: props, + }); + await waitForNextUpdate(); + + fieldGroups = result.current.fieldGroups; + + expect( + Object.keys(fieldGroups!).map( + (key) => `${key}-${fieldGroups![key as FieldsGroupNames]?.fields.length}` + ) + ).toStrictEqual([ + 'SpecialFields-0', + 'SelectedFields-0', + 'AvailableFields-2', + 'EmptyFields-23', + 'MetaFields-3', + ]); + + rerender({ + ...props, + dataViewId: anotherDataView.id!, + allFields: anotherDataView.fields, + }); + + await waitForNextUpdate(); + + fieldGroups = result.current.fieldGroups; + + expect( + Object.keys(fieldGroups!).map( + (key) => `${key}-${fieldGroups![key as FieldsGroupNames]?.fields.length}` + ) + ).toStrictEqual(['SpecialFields-0', 'SelectedFields-0', 'AvailableFields-8', 'MetaFields-0']); + }); +}); diff --git a/src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts b/src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts new file mode 100644 index 0000000000000..cfa5407a238cc --- /dev/null +++ b/src/plugins/unified_field_list/public/hooks/use_grouped_fields.ts @@ -0,0 +1,267 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { groupBy } from 'lodash'; +import { useEffect, useMemo, useState } from 'react'; +import { i18n } from '@kbn/i18n'; +import { type DataView, type DataViewField } from '@kbn/data-views-plugin/common'; +import { type DataViewsContract } from '@kbn/data-views-plugin/public'; +import { + type FieldListGroups, + type FieldsGroupDetails, + type FieldsGroup, + type FieldListItem, + FieldsGroupNames, +} from '../types'; +import { type ExistingFieldsReader } from './use_existing_fields'; + +export interface GroupedFieldsParams<T extends FieldListItem> { + dataViewId: string | null; // `null` is for text-based queries + allFields: T[]; + services: { + dataViews: DataViewsContract; + }; + fieldsExistenceReader?: ExistingFieldsReader; + onOverrideFieldGroupDetails?: ( + groupName: FieldsGroupNames + ) => Partial<FieldsGroupDetails> | undefined | null; + onSupportedFieldFilter?: (field: T) => boolean; + onSelectedFieldFilter?: (field: T) => boolean; + onFilterField?: (field: T) => boolean; +} + +export interface GroupedFieldsResult<T extends FieldListItem> { + fieldGroups: FieldListGroups<T>; +} + +export function useGroupedFields<T extends FieldListItem = DataViewField>({ + dataViewId, + allFields, + services, + fieldsExistenceReader, + onOverrideFieldGroupDetails, + onSupportedFieldFilter, + onSelectedFieldFilter, + onFilterField, +}: GroupedFieldsParams<T>): GroupedFieldsResult<T> { + const [dataView, setDataView] = useState<DataView | null>(null); + const fieldsExistenceInfoUnavailable: boolean = dataViewId + ? fieldsExistenceReader?.isFieldsExistenceInfoUnavailable(dataViewId) ?? false + : true; + const hasFieldDataHandler = + dataViewId && fieldsExistenceReader + ? fieldsExistenceReader.hasFieldData + : hasFieldDataByDefault; + + useEffect(() => { + const getDataView = async () => { + if (dataViewId) { + setDataView(await services.dataViews.get(dataViewId)); + } + }; + getDataView(); + // if field existence information changed, reload the data view too + }, [dataViewId, services.dataViews, setDataView, hasFieldDataHandler]); + + const unfilteredFieldGroups: FieldListGroups<T> = useMemo(() => { + const containsData = (field: T) => { + if (!dataViewId || !dataView) { + return true; + } + const overallField = dataView.getFieldByName?.(field.name); + return Boolean(overallField && hasFieldDataHandler(dataViewId, overallField.name)); + }; + + const fields = allFields || []; + const allSupportedTypesFields = onSupportedFieldFilter + ? fields.filter(onSupportedFieldFilter) + : fields; + const sortedFields = [...allSupportedTypesFields].sort(sortFields); + const groupedFields = { + ...getDefaultFieldGroups(), + ...groupBy(sortedFields, (field) => { + if (field.type === 'document') { + return 'specialFields'; + } else if (dataView?.metaFields?.includes(field.name)) { + return 'metaFields'; + } else if (containsData(field)) { + return 'availableFields'; + } else return 'emptyFields'; + }), + }; + const selectedFields = onSelectedFieldFilter ? sortedFields.filter(onSelectedFieldFilter) : []; + + let fieldGroupDefinitions: FieldListGroups<T> = { + SpecialFields: { + fields: groupedFields.specialFields, + fieldCount: groupedFields.specialFields.length, + isAffectedByGlobalFilter: false, + isAffectedByTimeFilter: false, + isInitiallyOpen: false, + showInAccordion: false, + title: '', + hideDetails: true, + }, + SelectedFields: { + fields: selectedFields, + fieldCount: selectedFields.length, + isInitiallyOpen: true, + showInAccordion: true, + title: i18n.translate('unifiedFieldList.useGroupedFields.selectedFieldsLabel', { + defaultMessage: 'Selected fields', + }), + isAffectedByGlobalFilter: false, + isAffectedByTimeFilter: true, + hideDetails: false, + hideIfEmpty: true, + }, + AvailableFields: { + fields: groupedFields.availableFields, + fieldCount: groupedFields.availableFields.length, + isInitiallyOpen: true, + showInAccordion: true, + title: + dataViewId && fieldsExistenceInfoUnavailable + ? i18n.translate('unifiedFieldList.useGroupedFields.allFieldsLabel', { + defaultMessage: 'All fields', + }) + : i18n.translate('unifiedFieldList.useGroupedFields.availableFieldsLabel', { + defaultMessage: 'Available fields', + }), + isAffectedByGlobalFilter: false, + isAffectedByTimeFilter: true, + // Show details on timeout but not failure + // hideDetails: fieldsExistenceInfoUnavailable && !existenceFetchTimeout, // TODO: is this check still necessary? + hideDetails: fieldsExistenceInfoUnavailable, + defaultNoFieldsMessage: i18n.translate( + 'unifiedFieldList.useGroupedFields.noAvailableDataLabel', + { + defaultMessage: `There are no available fields that contain data.`, + } + ), + }, + EmptyFields: { + fields: groupedFields.emptyFields, + fieldCount: groupedFields.emptyFields.length, + isAffectedByGlobalFilter: false, + isAffectedByTimeFilter: false, + isInitiallyOpen: false, + showInAccordion: true, + hideDetails: false, + hideIfEmpty: !dataViewId, + title: i18n.translate('unifiedFieldList.useGroupedFields.emptyFieldsLabel', { + defaultMessage: 'Empty fields', + }), + defaultNoFieldsMessage: i18n.translate( + 'unifiedFieldList.useGroupedFields.noEmptyDataLabel', + { + defaultMessage: `There are no empty fields.`, + } + ), + helpText: i18n.translate('unifiedFieldList.useGroupedFields.emptyFieldsLabelHelp', { + defaultMessage: 'Empty fields did not contain any values based on your filters.', + }), + }, + MetaFields: { + fields: groupedFields.metaFields, + fieldCount: groupedFields.metaFields.length, + isAffectedByGlobalFilter: false, + isAffectedByTimeFilter: false, + isInitiallyOpen: false, + showInAccordion: true, + hideDetails: false, + hideIfEmpty: !dataViewId, + title: i18n.translate('unifiedFieldList.useGroupedFields.metaFieldsLabel', { + defaultMessage: 'Meta fields', + }), + defaultNoFieldsMessage: i18n.translate( + 'unifiedFieldList.useGroupedFields.noMetaDataLabel', + { + defaultMessage: `There are no meta fields.`, + } + ), + }, + }; + + // do not show empty field accordion if there is no existence information + if (fieldsExistenceInfoUnavailable) { + delete fieldGroupDefinitions.EmptyFields; + } + + if (onOverrideFieldGroupDetails) { + fieldGroupDefinitions = Object.keys(fieldGroupDefinitions).reduce<FieldListGroups<T>>( + (definitions, name) => { + const groupName = name as FieldsGroupNames; + const group: FieldsGroup<T> | undefined = fieldGroupDefinitions[groupName]; + if (group) { + definitions[groupName] = { + ...group, + ...(onOverrideFieldGroupDetails(groupName) || {}), + }; + } + return definitions; + }, + {} as FieldListGroups<T> + ); + } + + return fieldGroupDefinitions; + }, [ + allFields, + onSupportedFieldFilter, + onSelectedFieldFilter, + onOverrideFieldGroupDetails, + dataView, + dataViewId, + hasFieldDataHandler, + fieldsExistenceInfoUnavailable, + ]); + + const fieldGroups: FieldListGroups<T> = useMemo(() => { + if (!onFilterField) { + return unfilteredFieldGroups; + } + + return Object.fromEntries( + Object.entries(unfilteredFieldGroups).map(([name, group]) => [ + name, + { ...group, fields: group.fields.filter(onFilterField) }, + ]) + ) as FieldListGroups<T>; + }, [unfilteredFieldGroups, onFilterField]); + + return useMemo( + () => ({ + fieldGroups, + }), + [fieldGroups] + ); +} + +function sortFields<T extends FieldListItem>(fieldA: T, fieldB: T) { + return (fieldA.displayName || fieldA.name).localeCompare( + fieldB.displayName || fieldB.name, + undefined, + { + sensitivity: 'base', + } + ); +} + +function hasFieldDataByDefault(): boolean { + return true; +} + +function getDefaultFieldGroups() { + return { + specialFields: [], + availableFields: [], + emptyFields: [], + metaFields: [], + }; +} diff --git a/src/plugins/unified_field_list/public/index.ts b/src/plugins/unified_field_list/public/index.ts index 2ada1027ee97a..94abf51566463 100755 --- a/src/plugins/unified_field_list/public/index.ts +++ b/src/plugins/unified_field_list/public/index.ts @@ -14,6 +14,7 @@ export type { NumberStatsResult, TopValuesResult, } from '../common/types'; +export { FieldListGrouped, type FieldListGroupedProps } from './components/field_list'; export type { FieldStatsProps, FieldStatsServices } from './components/field_stats'; export { FieldStats } from './components/field_stats'; export { @@ -44,4 +45,23 @@ export type { UnifiedFieldListPluginSetup, UnifiedFieldListPluginStart, AddFieldFilterHandler, + FieldListGroups, + FieldsGroupDetails, } from './types'; +export { ExistenceFetchStatus, FieldsGroupNames } from './types'; + +export { + useExistingFieldsFetcher, + useExistingFieldsReader, + resetExistingFieldsCache, + type ExistingFieldsInfo, + type ExistingFieldsFetcherParams, + type ExistingFieldsFetcher, + type ExistingFieldsReader, +} from './hooks/use_existing_fields'; + +export { + useGroupedFields, + type GroupedFieldsParams, + type GroupedFieldsResult, +} from './hooks/use_grouped_fields'; diff --git a/src/plugins/unified_field_list/public/services/field_existing/index.ts b/src/plugins/unified_field_list/public/services/field_existing/index.ts index 56be726b7c90f..6541afb4673bb 100644 --- a/src/plugins/unified_field_list/public/services/field_existing/index.ts +++ b/src/plugins/unified_field_list/public/services/field_existing/index.ts @@ -6,4 +6,9 @@ * Side Public License, v 1. */ -export { loadFieldExisting } from './load_field_existing'; +import type { LoadFieldExistingHandler } from './load_field_existing'; + +export const loadFieldExisting: LoadFieldExistingHandler = async (params) => { + const { loadFieldExisting: loadFieldExistingHandler } = await import('./load_field_existing'); + return await loadFieldExistingHandler(params); +}; diff --git a/src/plugins/unified_field_list/public/services/field_existing/load_field_existing.ts b/src/plugins/unified_field_list/public/services/field_existing/load_field_existing.ts index 79b2b056c6062..f8e369838c51a 100644 --- a/src/plugins/unified_field_list/public/services/field_existing/load_field_existing.ts +++ b/src/plugins/unified_field_list/public/services/field_existing/load_field_existing.ts @@ -24,7 +24,12 @@ interface FetchFieldExistenceParams { uiSettingsClient: IUiSettingsClient; } -export async function loadFieldExisting({ +export type LoadFieldExistingHandler = (params: FetchFieldExistenceParams) => Promise<{ + existingFieldNames: string[]; + indexPatternTitle: string; +}>; + +export const loadFieldExisting: LoadFieldExistingHandler = async ({ data, dslQuery, fromDate, @@ -33,7 +38,7 @@ export async function loadFieldExisting({ dataViewsService, uiSettingsClient, dataView, -}: FetchFieldExistenceParams) { +}) => { const includeFrozen = uiSettingsClient.get(UI_SETTINGS.SEARCH_INCLUDE_FROZEN); const useSampling = uiSettingsClient.get(FIELD_EXISTENCE_SETTING); const metaFields = uiSettingsClient.get(UI_SETTINGS.META_FIELDS); @@ -53,4 +58,4 @@ export async function loadFieldExisting({ return response.rawResponse; }, }); -} +}; diff --git a/src/plugins/unified_field_list/public/types.ts b/src/plugins/unified_field_list/public/types.ts index f7a712534d59d..de96cf6a44cfb 100755 --- a/src/plugins/unified_field_list/public/types.ts +++ b/src/plugins/unified_field_list/public/types.ts @@ -19,3 +19,44 @@ export type AddFieldFilterHandler = ( value: unknown, type: '+' | '-' ) => void; + +export enum ExistenceFetchStatus { + failed = 'failed', + succeeded = 'succeeded', + unknown = 'unknown', +} + +export interface FieldListItem { + name: DataViewField['name']; + type?: DataViewField['type']; + displayName?: DataViewField['displayName']; +} + +export enum FieldsGroupNames { + SpecialFields = 'SpecialFields', + SelectedFields = 'SelectedFields', + AvailableFields = 'AvailableFields', + EmptyFields = 'EmptyFields', + MetaFields = 'MetaFields', +} + +export interface FieldsGroupDetails { + showInAccordion: boolean; + isInitiallyOpen: boolean; + title: string; + helpText?: string; + isAffectedByGlobalFilter: boolean; + isAffectedByTimeFilter: boolean; + hideDetails?: boolean; + defaultNoFieldsMessage?: string; + hideIfEmpty?: boolean; +} + +export interface FieldsGroup<T extends FieldListItem> extends FieldsGroupDetails { + fields: T[]; + fieldCount: number; +} + +export type FieldListGroups<T extends FieldListItem> = { + [key in FieldsGroupNames]?: FieldsGroup<T>; +}; diff --git a/src/plugins/unified_field_list/tsconfig.json b/src/plugins/unified_field_list/tsconfig.json index eabadac9ef6fe..82d06d8618461 100644 --- a/src/plugins/unified_field_list/tsconfig.json +++ b/src/plugins/unified_field_list/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "../../typings/**/*", @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, diff --git a/src/plugins/unified_histogram/tsconfig.json b/src/plugins/unified_histogram/tsconfig.json index af8f24161fd31..a275fdc784dbc 100644 --- a/src/plugins/unified_histogram/tsconfig.json +++ b/src/plugins/unified_histogram/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../charts/tsconfig.json" }, { "path": "../data/tsconfig.json" }, diff --git a/src/plugins/unified_search/public/__stories__/search_bar.stories.tsx b/src/plugins/unified_search/public/__stories__/search_bar.stories.tsx index 60e0659a6112a..51cac48fbbbbc 100644 --- a/src/plugins/unified_search/public/__stories__/search_bar.stories.tsx +++ b/src/plugins/unified_search/public/__stories__/search_bar.stories.tsx @@ -298,6 +298,15 @@ storiesOf('SearchBar', module) query: { query: 'Test: miaou', language: 'kuery' }, } as unknown as SearchBarProps) ) + .add('with query menu off', () => + wrapSearchBarInContext({ + showDatePicker: false, + showFilterBar: false, + showQueryInput: true, + showQueryMenu: false, + query: { query: 'Test: miaou', language: 'kuery' }, + } as unknown as SearchBarProps) + ) .add('with only the filter bar and the date picker on', () => wrapSearchBarInContext({ showDatePicker: true, diff --git a/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts index 310e3d402df34..07dbf4eacec28 100644 --- a/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts @@ -21,24 +21,19 @@ describe('FieldSuggestions', () => { const uiSettings = { get: (key: string) => uiConfig[key], } as IUiSettingsClient; + let getTimeMock: jest.Mock; + let createFilterMock: jest.Mock; beforeEach(() => { + getTimeMock = jest.fn().mockReturnValue({ to: 'now', from: 'now-15m' }); + createFilterMock = jest.fn().mockReturnValue({ time: 'fake' }); http = { fetch: jest.fn().mockResolvedValue([]) }; getValueSuggestions = setupValueSuggestionProvider({ http, uiSettings } as CoreSetup, { timefilter: { timefilter: { - createFilter: () => { - return { - time: 'fake', - }; - }, - getTime: () => { - return { - to: 'now', - from: 'now-15m', - }; - }, + createFilter: createFilterMock, + getTime: getTimeMock, }, } as unknown as TimefilterSetup, }); @@ -234,6 +229,28 @@ describe('FieldSuggestions', () => { expect(http.fetch).toHaveBeenCalled(); }); + it('should round timefilter `to` value', async () => { + getTimeMock.mockReturnValue({ from: '2022-10-27||/d', to: '2022-10-27||/d' }); + + const [field] = stubFields.filter( + ({ type, aggregatable }) => type === 'string' && aggregatable + ); + + await getValueSuggestions({ + indexPattern: stubIndexPattern, + field, + query: '', + useTimeRange: true, + }); + + expect(createFilterMock.mock.calls[0][1]).toMatchInlineSnapshot(` + Object { + "from": "2022-10-27T04:00:00.000Z", + "to": "2022-10-28T03:59:59.999Z", + } + `); + }); + it('should use terms_enum', async () => { uiConfig = { [UI_SETTINGS.FILTERS_EDITOR_SUGGEST_VALUES]: true, diff --git a/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts index f935cd9362b56..127754583d448 100644 --- a/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts @@ -32,7 +32,7 @@ const getAutocompleteTimefilter = ({ timefilter }: TimefilterSetup, indexPattern // Use a rounded timerange so that memoizing works properly const roundedTimerange = { from: dateMath.parse(timeRange.from)!.startOf('minute').toISOString(), - to: dateMath.parse(timeRange.to)!.endOf('minute').toISOString(), + to: dateMath.parse(timeRange.to, { roundUp: true })!.endOf('minute').toISOString(), }; return timefilter.createFilter(indexPattern, roundedTimerange); }; diff --git a/src/plugins/unified_search/public/dataview_picker/assets/adhoc.svg b/src/plugins/unified_search/public/dataview_picker/assets/adhoc.svg new file mode 100644 index 0000000000000..04cf8bc8f22ba --- /dev/null +++ b/src/plugins/unified_search/public/dataview_picker/assets/adhoc.svg @@ -0,0 +1,4 @@ +<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path d="M12 2H2V13V14H1V13V2V1H13V2H12ZM5 5H10.999V4H5V5ZM3 5V4H4V5H3ZM5 8V7H9V8H5ZM3 8V7H4V8H3ZM5 11V10H8V11H5ZM3 11V10H4V11H3Z" fill="#07C"/> +<rect x="1.5" y="1.5" width="11" height="12" stroke="#07C" stroke-dasharray="2 2"/> +</svg> diff --git a/src/plugins/unified_search/public/dataview_picker/change_dataview.tsx b/src/plugins/unified_search/public/dataview_picker/change_dataview.tsx index 1e71da3a0b20a..3b987b8b19175 100644 --- a/src/plugins/unified_search/public/dataview_picker/change_dataview.tsx +++ b/src/plugins/unified_search/public/dataview_picker/change_dataview.tsx @@ -7,7 +7,7 @@ */ import { i18n } from '@kbn/i18n'; -import React, { useState, useEffect, useCallback, useRef } from 'react'; +import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react'; import { css } from '@emotion/react'; import { EuiPopover, @@ -26,13 +26,13 @@ import { EuiToolTip, EuiSpacer, } from '@elastic/eui'; -import type { DataViewListItem } from '@kbn/data-views-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import type { IUnifiedSearchPluginServices } from '../types'; import type { DataViewPickerPropsExtended } from '.'; -import { DataViewsList } from './dataview_list'; +import { type DataViewListItemEnhanced, DataViewsList } from './dataview_list'; import type { TextBasedLanguagesListProps } from './text_languages_list'; import type { TextBasedLanguagesTransitionModalProps } from './text_languages_transition_modal'; +import adhoc from './assets/adhoc.svg'; import { changeDataViewStyles } from './change_dataview.styles'; // local storage key for the text based languages transition modal @@ -80,7 +80,7 @@ export function ChangeDataView({ const [noDataViewMatches, setNoDataViewMatches] = useState(false); const [dataViewSearchString, setDataViewSearchString] = useState(''); const [indexMatches, setIndexMatches] = useState(0); - const [dataViewsList, setDataViewsList] = useState<DataViewListItem[]>([]); + const [dataViewsList, setDataViewsList] = useState<DataViewListItemEnhanced[]>([]); const [triggerLabel, setTriggerLabel] = useState(''); const [isTextBasedLangSelected, setIsTextBasedLangSelected] = useState( Boolean(textBasedLanguage) @@ -100,7 +100,7 @@ export function ChangeDataView({ useEffect(() => { const fetchDataViews = async () => { - const dataViewsRefs = await data.dataViews.getIdsWithTitle(); + const dataViewsRefs: DataViewListItemEnhanced[] = await data.dataViews.getIdsWithTitle(); if (adHocDataViews?.length) { adHocDataViews.forEach((adHocDataView) => { if (adHocDataView.id) { @@ -108,6 +108,7 @@ export function ChangeDataView({ title: adHocDataView.title, name: adHocDataView.name, id: adHocDataView.id, + isAdhoc: true, }); } }); @@ -151,6 +152,10 @@ export function ChangeDataView({ } }, [isTextBasedLangSelected, textBasedLanguage]); + const isAdHocSelected = useMemo(() => { + return adHocDataViews?.some((dataView) => dataView.id === currentDataViewId); + }, [adHocDataViews, currentDataViewId]); + const createTrigger = function () { const { label, title, 'data-test-subj': dataTestSubj, fullWidth, ...rest } = trigger; return ( @@ -168,7 +173,18 @@ export function ChangeDataView({ disabled={isDisabled} {...rest} > - {triggerLabel} + <> + {isAdHocSelected && ( + <EuiIcon + type={adhoc} + color="primary" + css={css` + margin-right: ${euiTheme.size.s}; + `} + /> + )} + {triggerLabel} + </> </EuiButton> ); }; diff --git a/src/plugins/unified_search/public/dataview_picker/dataview_list.tsx b/src/plugins/unified_search/public/dataview_picker/dataview_list.tsx index 1a4a1ddd4355e..108441954b53a 100644 --- a/src/plugins/unified_search/public/dataview_picker/dataview_list.tsx +++ b/src/plugins/unified_search/public/dataview_picker/dataview_list.tsx @@ -7,13 +7,17 @@ */ import React from 'react'; -import { EuiSelectable, EuiSelectableProps, EuiPanel } from '@elastic/eui'; +import { EuiSelectable, EuiSelectableProps, EuiPanel, EuiBadge } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; import { DataViewListItem } from '@kbn/data-views-plugin/public'; +export interface DataViewListItemEnhanced extends DataViewListItem { + isAdhoc?: boolean; +} + export interface DataViewsListProps { - dataViewsList: DataViewListItem[]; + dataViewsList: DataViewListItemEnhanced[]; onChangeDataView: (newId: string) => void; isTextBasedLangSelected?: boolean; currentDataViewId?: string; @@ -40,11 +44,18 @@ export function DataViewsList({ data-test-subj="indexPattern-switcher" searchable singleSelection="always" - options={dataViewsList?.map(({ title, id, name }) => ({ + options={dataViewsList?.map(({ title, id, name, isAdhoc }) => ({ key: id, label: name ? name : title, value: id, checked: id === currentDataViewId && !Boolean(isTextBasedLangSelected) ? 'on' : undefined, + append: isAdhoc ? ( + <EuiBadge color="hollow"> + {i18n.translate('unifiedSearch.query.queryBar.indexPattern.temporaryDataviewLabel', { + defaultMessage: 'Temporary', + })} + </EuiBadge> + ) : null, }))} onChange={(choices) => { const choice = choices.find(({ checked }) => checked) as unknown as { diff --git a/src/plugins/unified_search/public/dataview_picker/text_languages_list.tsx b/src/plugins/unified_search/public/dataview_picker/text_languages_list.tsx index 7b6ca242237c7..cf070b7746bfe 100644 --- a/src/plugins/unified_search/public/dataview_picker/text_languages_list.tsx +++ b/src/plugins/unified_search/public/dataview_picker/text_languages_list.tsx @@ -7,8 +7,8 @@ */ import React from 'react'; -import { EuiSelectable, EuiPanel, EuiBetaBadge } from '@elastic/eui'; -import { css } from '@emotion/react'; +import { i18n } from '@kbn/i18n'; +import { EuiSelectable, EuiPanel, EuiBadge } from '@elastic/eui'; import { TextBasedLanguages } from '.'; export interface TextBasedLanguagesListProps { @@ -39,15 +39,11 @@ export default function TextBasedLanguagesList({ value: lang, checked: lang === selectedOption ? 'on' : undefined, append: ( - <EuiBetaBadge - label="Technical preview" - color="hollow" - size="s" - css={css` - vertical-align: middle; - cursor: pointer; - `} - /> + <EuiBadge color="hollow"> + {i18n.translate('unifiedSearch.query.queryBar.textBasedLanguagesTechPreviewLabel', { + defaultMessage: 'Technical preview', + })} + </EuiBadge> ), }))} onChange={(choices) => { diff --git a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx index 26b5c1770ee8a..8426275f10dfd 100644 --- a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx @@ -436,6 +436,7 @@ export const QueryBarTopRow = React.memo( size={shouldShowDatePickerAsBadge() ? 's' : 'm'} color={props.isDirty ? 'success' : 'primary'} fill={props.isDirty} + needsUpdate={props.isDirty} data-test-subj="querySubmitButton" // @ts-expect-error Need to fix expecting `children` in EUI toolTipProps={{ diff --git a/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx b/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx index dbf7af6afe12d..f6f433de9fcf1 100644 --- a/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx @@ -28,7 +28,7 @@ import { QueryLanguageSwitcher } from './language_switcher'; import QueryStringInput from './query_string_input'; import { unifiedSearchPluginMock } from '../mocks'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); const startMock = coreMock.createStart(); const noop = () => { diff --git a/src/plugins/unified_search/public/search_bar/create_search_bar.tsx b/src/plugins/unified_search/public/search_bar/create_search_bar.tsx index 35555137f12b2..0320626bb0244 100644 --- a/src/plugins/unified_search/public/search_bar/create_search_bar.tsx +++ b/src/plugins/unified_search/public/search_bar/create_search_bar.tsx @@ -190,6 +190,7 @@ export function createSearchBar({ showAutoRefreshOnly={props.showAutoRefreshOnly} showDatePicker={props.showDatePicker} showFilterBar={props.showFilterBar} + showQueryMenu={props.showQueryMenu} showQueryInput={props.showQueryInput} showSaveQuery={props.showSaveQuery} showSubmitButton={props.showSubmitButton} diff --git a/src/plugins/unified_search/public/search_bar/search_bar.test.tsx b/src/plugins/unified_search/public/search_bar/search_bar.test.tsx index 0d0ff97ae4b05..0d17014e5203d 100644 --- a/src/plugins/unified_search/public/search_bar/search_bar.test.tsx +++ b/src/plugins/unified_search/public/search_bar/search_bar.test.tsx @@ -138,6 +138,7 @@ describe('SearchBar', () => { const FILTER_BAR = '[data-test-subj="unifiedFilterBar"]'; const QUERY_BAR = '.kbnQueryBar'; const QUERY_INPUT = '[data-test-subj="unifiedQueryInput"]'; + const QUERY_MENU_BUTTON = '[data-test-subj="showQueryBarMenu"]'; const EDITOR = '[data-test-subj="unifiedTextLangEditor"]'; beforeEach(() => { @@ -220,6 +221,20 @@ describe('SearchBar', () => { expect(component.find(QUERY_INPUT).length).toBeFalsy(); }); + it('Should NOT render the query menu button, if disabled', () => { + const component = mount( + wrapSearchBarInContext({ + indexPatterns: [mockIndexPattern], + screenTitle: 'test screen', + onQuerySubmit: noop, + query: kqlQuery, + showQueryMenu: false, + }) + ); + + expect(component.find(QUERY_MENU_BUTTON).length).toBeFalsy(); + }); + it('Should render query bar and filter bar', () => { const component = mount( wrapSearchBarInContext({ diff --git a/src/plugins/unified_search/public/search_bar/search_bar.tsx b/src/plugins/unified_search/public/search_bar/search_bar.tsx index ebaa3a317c270..3b158fd20b9f3 100644 --- a/src/plugins/unified_search/public/search_bar/search_bar.tsx +++ b/src/plugins/unified_search/public/search_bar/search_bar.tsx @@ -48,6 +48,7 @@ export interface SearchBarOwnProps<QT extends AggregateQuery | Query = Query> { screenTitle?: string; dataTestSubj?: string; // Togglers + showQueryMenu?: boolean; showQueryInput?: boolean; showFilterBar?: boolean; showDatePicker?: boolean; @@ -121,6 +122,7 @@ class SearchBarUI<QT extends (Query | AggregateQuery) | Query = Query> extends C State<QT | Query> > { public static defaultProps = { + showQueryMenu: true, showFilterBar: true, showDatePicker: true, showSubmitButton: true, @@ -448,7 +450,7 @@ class SearchBarUI<QT extends (Query | AggregateQuery) | Query = Query> extends C /> ); - const queryBarMenu = ( + const queryBarMenu = this.props.showQueryMenu ? ( <QueryBarMenu nonKqlMode={this.props.nonKqlMode} language={ @@ -488,7 +490,7 @@ class SearchBarUI<QT extends (Query | AggregateQuery) | Query = Query> extends C : undefined } /> - ); + ) : undefined; let filterBar; if (this.shouldRenderFilterBar()) { diff --git a/src/plugins/unified_search/tsconfig.json b/src/plugins/unified_search/tsconfig.json index 2f09d27c84b08..7477e97c779c9 100644 --- a/src/plugins/unified_search/tsconfig.json +++ b/src/plugins/unified_search/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", @@ -13,7 +12,7 @@ "server/**/*", "config.ts", ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, { "path": "../data_views/tsconfig.json" }, diff --git a/src/plugins/url_forwarding/kibana.json b/src/plugins/url_forwarding/kibana.json index 3e48cf73de5ef..12132c2a09666 100644 --- a/src/plugins/url_forwarding/kibana.json +++ b/src/plugins/url_forwarding/kibana.json @@ -5,6 +5,6 @@ "ui": true, "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" } } diff --git a/src/plugins/url_forwarding/tsconfig.json b/src/plugins/url_forwarding/tsconfig.json index 464cca51c6b9f..9a108878e86fb 100644 --- a/src/plugins/url_forwarding/tsconfig.json +++ b/src/plugins/url_forwarding/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["public/**/*"], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, ] } diff --git a/src/plugins/usage_collection/server/collector/types.ts b/src/plugins/usage_collection/server/collector/types.ts index 98271ef804952..ff5b7135ba5c0 100644 --- a/src/plugins/usage_collection/server/collector/types.ts +++ b/src/plugins/usage_collection/server/collector/types.ts @@ -8,7 +8,7 @@ import type { ElasticsearchClient, SavedObjectsClientContract, Logger } from '@kbn/core/server'; -import type { PossibleSchemaTypes } from '@kbn/analytics-client'; +import type { PossibleSchemaTypes, SchemaMetaOptional } from '@kbn/analytics-client'; export type { AllowedSchemaTypes, @@ -22,7 +22,17 @@ export type { * Helper to find out whether to keep recursively looking or if we are on an end value */ export type RecursiveMakeSchemaFrom<U> = U extends object - ? MakeSchemaFrom<U> + ? Record<string, unknown> extends U + ? + | { + // pass_through should only be allowed for Record<string, unknown> for now + type: 'pass_through'; + _meta: { + description: string; // Intentionally enforcing the descriptions here + } & SchemaMetaOptional<U>; + } + | MakeSchemaFrom<U> // But still allow being explicit in the definition if they want to. + : MakeSchemaFrom<U> : { type: PossibleSchemaTypes<U>; _meta?: { description: string } }; /** @@ -60,7 +70,7 @@ export interface CollectorFetchContext { /** * The fetch method has the context of the Collector itself * (this has access to all the properties of the collector like the logger) - * and the the first parameter is {@link CollectorFetchContext}. + * and the first parameter is {@link CollectorFetchContext}. */ export type CollectorFetchMethod<TReturn, ExtraOptions extends object = {}> = ( this: ICollector<TReturn> & ExtraOptions, // Specify the context of `this` for this.log and others to become available diff --git a/src/plugins/usage_collection/tsconfig.json b/src/plugins/usage_collection/tsconfig.json index 0430eb5d64bf1..531dde7fd609e 100644 --- a/src/plugins/usage_collection/tsconfig.json +++ b/src/plugins/usage_collection/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -13,7 +12,7 @@ "common/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../../plugins/kibana_utils/tsconfig.json" } ] diff --git a/src/plugins/vis_default_editor/kibana.json b/src/plugins/vis_default_editor/kibana.json index 7ae2321828a55..e5385724cf4a3 100644 --- a/src/plugins/vis_default_editor/kibana.json +++ b/src/plugins/vis_default_editor/kibana.json @@ -16,7 +16,7 @@ ], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "The default editor used in most aggregation-based visualizations." } diff --git a/src/plugins/vis_default_editor/tsconfig.json b/src/plugins/vis_default_editor/tsconfig.json index b6edd0176bfd0..6495253035f69 100644 --- a/src/plugins/vis_default_editor/tsconfig.json +++ b/src/plugins/vis_default_editor/tsconfig.json @@ -4,12 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, { "path": "../visualizations/tsconfig.json" }, diff --git a/src/plugins/vis_type_markdown/tsconfig.json b/src/plugins/vis_type_markdown/tsconfig.json index 7c32f44935195..3bd790ef80469 100644 --- a/src/plugins/vis_type_markdown/tsconfig.json +++ b/src/plugins/vis_type_markdown/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", "server/**/*", "*.ts" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../expressions/tsconfig.json" }, { "path": "../visualizations/tsconfig.json" }, diff --git a/src/plugins/vis_types/gauge/kibana.json b/src/plugins/vis_types/gauge/kibana.json index 428ee970c4e7f..942fa032e1e0a 100755 --- a/src/plugins/vis_types/gauge/kibana.json +++ b/src/plugins/vis_types/gauge/kibana.json @@ -23,7 +23,7 @@ ], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "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." } \ No newline at end of file diff --git a/src/plugins/vis_types/gauge/tsconfig.json b/src/plugins/vis_types/gauge/tsconfig.json index b1717173757e7..c94152b4d70df 100644 --- a/src/plugins/vis_types/gauge/tsconfig.json +++ b/src/plugins/vis_types/gauge/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "server/**/*", "*.ts" ], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../charts/tsconfig.json" }, { "path": "../../data/tsconfig.json" }, diff --git a/src/plugins/vis_types/heatmap/kibana.json b/src/plugins/vis_types/heatmap/kibana.json index c8df98e2b343a..077e9015b00af 100644 --- a/src/plugins/vis_types/heatmap/kibana.json +++ b/src/plugins/vis_types/heatmap/kibana.json @@ -1,14 +1,27 @@ { - "id": "visTypeHeatmap", - "version": "kibana", - "ui": true, - "server": true, - "requiredPlugins": ["charts", "data", "expressions", "visualizations", "usageCollection", "fieldFormats"], - "requiredBundles": ["visDefaultEditor"], - "extraPublicDirs": ["common/index"], - "owner": { - "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" - }, - "description": "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." - } + "id": "visTypeHeatmap", + "version": "kibana", + "ui": true, + "server": true, + "requiredPlugins": [ + "charts", + "data", + "expressions", + "visualizations", + "usageCollection", + "fieldFormats", + "dataViews" + ], + "requiredBundles": [ + "visDefaultEditor", + "kibanaUtils" + ], + "extraPublicDirs": [ + "common/index" + ], + "owner": { + "name": "Vis Editors", + "githubTeam": "kibana-visualizations" + }, + "description": "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." +} \ No newline at end of file diff --git a/src/plugins/vis_types/heatmap/public/convert_to_lens/configurations/index.test.ts b/src/plugins/vis_types/heatmap/public/convert_to_lens/configurations/index.test.ts new file mode 100644 index 0000000000000..3f60b6fde0a94 --- /dev/null +++ b/src/plugins/vis_types/heatmap/public/convert_to_lens/configurations/index.test.ts @@ -0,0 +1,114 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AvgColumn, DateHistogramColumn } from '@kbn/visualizations-plugin/common/convert_to_lens'; +import { Vis } from '@kbn/visualizations-plugin/public'; +import { getConfiguration } from '.'; +import { sampleHeatmapVis } from '../../sample_vis.test.mocks'; +import { HeatmapVisParams } from '../../types'; + +describe('getConfiguration', () => { + const layerId = 'layer-id'; + let vis: Vis<HeatmapVisParams>; + + const metric: AvgColumn = { + sourceField: 'price', + columnId: 'column-1', + operationType: 'average', + isBucketed: false, + isSplit: false, + dataType: 'string', + params: {}, + }; + const xColumn: DateHistogramColumn = { + sourceField: 'price', + columnId: 'column-2', + operationType: 'date_histogram', + isBucketed: true, + isSplit: false, + dataType: 'string', + params: { + interval: '1h', + }, + }; + + const yColumn: DateHistogramColumn = { + sourceField: 'price', + columnId: 'column-3', + operationType: 'date_histogram', + isBucketed: true, + isSplit: true, + dataType: 'string', + params: { + interval: '1h', + }, + }; + + beforeEach(() => { + vis = sampleHeatmapVis as unknown as Vis<HeatmapVisParams>; + }); + + test('should return valid configuration', async () => { + const result = await getConfiguration(layerId, vis, { + metrics: [metric.columnId], + buckets: [xColumn.columnId, yColumn.columnId], + }); + expect(result).toEqual({ + gridConfig: { + isCellLabelVisible: true, + isXAxisLabelVisible: true, + isXAxisTitleVisible: true, + isYAxisLabelVisible: true, + isYAxisTitleVisible: true, + type: 'heatmap_grid', + }, + layerId, + layerType: 'data', + legend: { isVisible: undefined, position: 'right', type: 'heatmap_legend' }, + palette: { + accessor: 'column-1', + name: 'custom', + params: { + colorStops: [ + { color: '#F7FBFF', stop: 0 }, + { color: '#DEEBF7', stop: 12.5 }, + { color: '#C3DBEE', stop: 25 }, + { color: '#9CC8E2', stop: 37.5 }, + { color: '#6DAED5', stop: 50 }, + { color: '#4391C6', stop: 62.5 }, + { color: '#2271B3', stop: 75 }, + { color: '#0D5097', stop: 87.5 }, + ], + continuity: 'none', + maxSteps: 5, + name: 'custom', + progression: 'fixed', + rangeMax: 100, + rangeMin: 0, + rangeType: 'number', + reverse: false, + stops: [ + { color: '#F7FBFF', stop: 12.5 }, + { color: '#DEEBF7', stop: 25 }, + { color: '#C3DBEE', stop: 37.5 }, + { color: '#9CC8E2', stop: 50 }, + { color: '#6DAED5', stop: 62.5 }, + { color: '#4391C6', stop: 75 }, + { color: '#2271B3', stop: 87.5 }, + { color: '#0D5097', stop: 100 }, + ], + }, + type: 'palette', + }, + shape: 'heatmap', + valueAccessor: metric.columnId, + xAccessor: xColumn.columnId, + yAccessor: yColumn.columnId, + }); + }); +}); diff --git a/src/plugins/vis_types/heatmap/public/convert_to_lens/configurations/index.ts b/src/plugins/vis_types/heatmap/public/convert_to_lens/configurations/index.ts new file mode 100644 index 0000000000000..2e7a3f161514a --- /dev/null +++ b/src/plugins/vis_types/heatmap/public/convert_to_lens/configurations/index.ts @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { HeatmapConfiguration } from '@kbn/visualizations-plugin/common'; +import { Vis } from '@kbn/visualizations-plugin/public'; +import { HeatmapVisParams } from '../../types'; +import { getPaletteForHeatmap } from './palette'; + +export const getConfiguration = async ( + layerId: string, + vis: Vis<HeatmapVisParams>, + { + metrics, + buckets, + }: { + metrics: string[]; + buckets: string[]; + } +): Promise<HeatmapConfiguration> => { + const [valueAccessor] = metrics; + const [xAccessor, yAccessor] = buckets; + + const { params, uiState } = vis; + const state = uiState.get('vis', {}) ?? {}; + + const palette = await getPaletteForHeatmap(params); + return { + layerId, + layerType: 'data', + shape: 'heatmap', + legend: { + type: 'heatmap_legend', + isVisible: state.legendOpen, + position: params.legendPosition, + }, + gridConfig: { + type: 'heatmap_grid', + isCellLabelVisible: params.valueAxes?.[0].labels.show ?? false, + isXAxisLabelVisible: true, + isYAxisLabelVisible: true, + isYAxisTitleVisible: true, + isXAxisTitleVisible: true, + }, + valueAccessor, + xAccessor, + yAccessor, + palette: palette ? { ...palette, accessor: valueAccessor } : undefined, + }; +}; diff --git a/src/plugins/vis_types/heatmap/public/convert_to_lens/configurations/palette.ts b/src/plugins/vis_types/heatmap/public/convert_to_lens/configurations/palette.ts new file mode 100644 index 0000000000000..32187e184d4ef --- /dev/null +++ b/src/plugins/vis_types/heatmap/public/convert_to_lens/configurations/palette.ts @@ -0,0 +1,52 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Range } from '@kbn/expressions-plugin/common'; +import { convertToLensModule } from '@kbn/visualizations-plugin/public'; +import { HeatmapVisParams } from '../../types'; +import { getStopsWithColorsFromColorsNumber } from '../../utils/palette'; + +type HeatmapVisParamsWithRanges = Omit<HeatmapVisParams, 'colorsRange'> & { + colorsRange: Exclude<HeatmapVisParams['colorsRange'], undefined>; +}; + +const isHeatmapVisParamsWithRanges = ( + params: HeatmapVisParams | HeatmapVisParamsWithRanges +): params is HeatmapVisParamsWithRanges => { + return Boolean(params.setColorRange && params.colorsRange && params.colorsRange.length); +}; + +export const getPaletteForHeatmap = async (params: HeatmapVisParams) => { + const { getPalette, getPaletteFromStopsWithColors, getPercentageModeConfig } = + await convertToLensModule; + + if (isHeatmapVisParamsWithRanges(params)) { + const percentageModeConfig = getPercentageModeConfig(params, false); + return getPalette(params, percentageModeConfig, params.percentageMode); + } + + const { color, stop = [] } = getStopsWithColorsFromColorsNumber( + params.colorsNumber, + params.colorSchema, + params.invertColors, + true + ); + const colorsRange: Range[] = [{ from: stop[0], to: stop[stop.length - 1], type: 'range' }]; + const { colorSchema, invertColors, percentageMode } = params; + const percentageModeConfig = getPercentageModeConfig( + { + colorsRange, + colorSchema, + invertColors, + percentageMode, + }, + false + ); + + return getPaletteFromStopsWithColors({ color, stop: stop ?? [] }, percentageModeConfig, true); +}; diff --git a/src/plugins/vis_types/heatmap/public/convert_to_lens/index.test.ts b/src/plugins/vis_types/heatmap/public/convert_to_lens/index.test.ts new file mode 100644 index 0000000000000..ef86b3829c248 --- /dev/null +++ b/src/plugins/vis_types/heatmap/public/convert_to_lens/index.test.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ColorSchemas } from '@kbn/charts-plugin/common'; +import { Vis } from '@kbn/visualizations-plugin/public'; +import { convertToLens } from '.'; +import { HeatmapVisParams } from '../types'; + +const mockGetColumnsFromVis = jest.fn(); +const mockGetConfiguration = jest.fn().mockReturnValue({}); +const mockGetDataViewByIndexPatternId = jest.fn(); +const mockConvertToFiltersColumn = jest.fn(); + +jest.mock('../services', () => ({ + getDataViewsStart: jest.fn(() => ({ get: () => ({}), getDefault: () => ({}) })), +})); + +jest.mock('@kbn/visualizations-plugin/public', () => ({ + convertToLensModule: Promise.resolve({ + getColumnsFromVis: jest.fn(() => mockGetColumnsFromVis()), + convertToFiltersColumn: jest.fn(() => mockConvertToFiltersColumn()), + }), + getDataViewByIndexPatternId: jest.fn(() => mockGetDataViewByIndexPatternId()), +})); + +jest.mock('./configurations', () => ({ + getConfiguration: jest.fn(() => mockGetConfiguration()), +})); + +const params: HeatmapVisParams = { + addTooltip: false, + addLegend: false, + enableHover: true, + legendPosition: 'bottom', + lastRangeIsRightOpen: false, + percentageMode: false, + valueAxes: [], + colorSchema: ColorSchemas.Blues, + invertColors: false, + colorsNumber: 4, + setColorRange: true, +}; + +const vis = { + isHierarchical: () => false, + type: {}, + params, + data: {}, +} as unknown as Vis<HeatmapVisParams>; + +const timefilter = { + getAbsoluteTime: () => {}, +} as any; + +describe('convertToLens', () => { + beforeEach(() => { + mockGetDataViewByIndexPatternId.mockReturnValue({ id: 'index-pattern' }); + mockConvertToFiltersColumn.mockReturnValue({ columnId: 'column-id-1' }); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + test('should return null if timefilter is undefined', async () => { + const result = await convertToLens(vis); + expect(result).toBeNull(); + }); + + test('should return null if mockGetDataViewByIndexPatternId returns null', async () => { + mockGetDataViewByIndexPatternId.mockReturnValue(null); + const result = await convertToLens(vis, timefilter); + expect(mockGetDataViewByIndexPatternId).toBeCalledTimes(1); + expect(mockGetColumnsFromVis).toBeCalledTimes(0); + expect(result).toBeNull(); + }); + + test('should return null if getColumnsFromVis returns null', async () => { + mockGetColumnsFromVis.mockReturnValue(null); + const result = await convertToLens(vis, timefilter); + expect(mockGetColumnsFromVis).toBeCalledTimes(1); + expect(result).toBeNull(); + }); + + test('should return null if metrics count is more than 1', async () => { + mockGetColumnsFromVis.mockReturnValue([ + { + metrics: ['1', '2'], + buckets: { all: [] }, + columns: [{ columnId: '2' }, { columnId: '1' }], + }, + ]); + const result = await convertToLens(vis, timefilter); + expect(mockGetColumnsFromVis).toBeCalledTimes(1); + expect(result).toBeNull(); + }); + + test('should return empty filters for x-axis if no buckets are specified', async () => { + mockGetColumnsFromVis.mockReturnValue([ + { + metrics: ['1'], + buckets: { all: [] }, + columns: [{ columnId: '1', dataType: 'number' }], + columnsWithoutReferenced: [ + { columnId: '1', meta: { aggId: 'agg-1' } }, + { columnId: '2', meta: { aggId: 'agg-2' } }, + { columnId: 'column-id-1' }, + ], + }, + ]); + const result = await convertToLens(vis, timefilter); + expect(mockGetColumnsFromVis).toBeCalledTimes(1); + expect(result).toEqual( + expect.objectContaining({ + configuration: {}, + indexPatternIds: ['index-pattern'], + layers: [ + expect.objectContaining({ + columnOrder: [], + columns: [{ columnId: '1', dataType: 'number' }, { columnId: 'column-id-1' }], + indexPatternId: 'index-pattern', + }), + ], + type: 'lnsHeatmap', + }) + ); + }); + + test('should return correct state for valid vis', async () => { + const config = { + layerType: 'data', + }; + + mockGetColumnsFromVis.mockReturnValue([ + { + metrics: ['1'], + buckets: { all: ['2'] }, + columns: [{ columnId: '1', dataType: 'number' }], + columnsWithoutReferenced: [ + { columnId: '1', meta: { aggId: 'agg-1' } }, + { columnId: '2', meta: { aggId: 'agg-2' } }, + ], + }, + ]); + mockGetConfiguration.mockReturnValue(config); + + const result = await convertToLens(vis, timefilter); + expect(mockGetColumnsFromVis).toBeCalledTimes(1); + expect(mockGetConfiguration).toBeCalledTimes(1); + expect(result?.type).toEqual('lnsHeatmap'); + expect(result?.layers.length).toEqual(1); + expect(result?.layers[0]).toEqual( + expect.objectContaining({ + columnOrder: [], + columns: [{ columnId: '1', dataType: 'number' }, { columnId: 'column-id-1' }], + indexPatternId: 'index-pattern', + }) + ); + expect(result?.configuration).toEqual(config); + }); +}); diff --git a/src/plugins/vis_types/heatmap/public/convert_to_lens/index.ts b/src/plugins/vis_types/heatmap/public/convert_to_lens/index.ts new file mode 100644 index 0000000000000..546d497e80560 --- /dev/null +++ b/src/plugins/vis_types/heatmap/public/convert_to_lens/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Column, ColumnWithMeta } from '@kbn/visualizations-plugin/common'; +import { + convertToLensModule, + getDataViewByIndexPatternId, +} from '@kbn/visualizations-plugin/public'; +import uuid from 'uuid'; +import { getDataViewsStart } from '../services'; +import { getConfiguration } from './configurations'; +import { ConvertHeatmapToLensVisualization } from './types'; + +export const isColumnWithMeta = (column: Column): column is ColumnWithMeta => { + if ((column as ColumnWithMeta).meta) { + return true; + } + return false; +}; + +export const excludeMetaFromColumn = (column: Column) => { + if (isColumnWithMeta(column)) { + const { meta, ...rest } = column; + return rest; + } + return column; +}; + +export const convertToLens: ConvertHeatmapToLensVisualization = async (vis, timefilter) => { + if (!timefilter) { + return null; + } + + const dataViews = getDataViewsStart(); + const dataView = await getDataViewByIndexPatternId(vis.data.indexPattern?.id, dataViews); + + if (!dataView) { + return null; + } + + const { getColumnsFromVis, convertToFiltersColumn } = await convertToLensModule; + const layers = getColumnsFromVis(vis, timefilter, dataView, { + buckets: ['segment'], + splits: ['group'], + unsupported: ['split_row', 'split_column'], + }); + + if (layers === null) { + return null; + } + + const [layerConfig] = layers; + + const xColumn = layerConfig.columns.find(({ isBucketed, isSplit }) => isBucketed && !isSplit); + const xAxisColumn = + xColumn ?? + convertToFiltersColumn(uuid(), { filters: [{ input: { language: 'lucene', query: '*' } }] })!; + + if (xColumn?.columnId !== xAxisColumn?.columnId) { + layerConfig.buckets.all.push(xAxisColumn.columnId); + layerConfig.columns.push(xAxisColumn); + } + const yColumn = layerConfig.columns.find(({ isBucketed, isSplit }) => isBucketed && isSplit); + + if (!layerConfig.buckets.all.length || layerConfig.metrics.length > 1) { + return null; + } + + const layerId = uuid(); + + const indexPatternId = dataView.id!; + const configuration = await getConfiguration(layerId, vis, { + metrics: layerConfig.metrics, + buckets: [xAxisColumn.columnId, yColumn?.columnId].filter<string>((c): c is string => + Boolean(c) + ), + }); + + return { + type: 'lnsHeatmap', + layers: [ + { + indexPatternId, + layerId, + columns: layerConfig.columns.map(excludeMetaFromColumn), + columnOrder: [], + }, + ], + configuration, + indexPatternIds: [indexPatternId], + }; +}; diff --git a/src/plugins/vis_types/heatmap/public/convert_to_lens/types.ts b/src/plugins/vis_types/heatmap/public/convert_to_lens/types.ts new file mode 100644 index 0000000000000..732b977dd7b59 --- /dev/null +++ b/src/plugins/vis_types/heatmap/public/convert_to_lens/types.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { TimefilterContract } from '@kbn/data-plugin/public'; +import { NavigateToLensContext, HeatmapConfiguration } from '@kbn/visualizations-plugin/common'; +import { Vis } from '@kbn/visualizations-plugin/public'; +import { HeatmapVisParams } from '../types'; + +export type ConvertHeatmapToLensVisualization = ( + vis: Vis<HeatmapVisParams>, + timefilter?: TimefilterContract +) => Promise<NavigateToLensContext<HeatmapConfiguration> | null>; diff --git a/src/plugins/vis_types/heatmap/public/plugin.ts b/src/plugins/vis_types/heatmap/public/plugin.ts index 44357cceaa86b..ee7349145e7c6 100644 --- a/src/plugins/vis_types/heatmap/public/plugin.ts +++ b/src/plugins/vis_types/heatmap/public/plugin.ts @@ -6,14 +6,16 @@ * Side Public License, v 1. */ -import { CoreSetup } from '@kbn/core/public'; +import { CoreSetup, CoreStart } from '@kbn/core/public'; import type { VisualizationsSetup } from '@kbn/visualizations-plugin/public'; import type { ChartsPluginSetup } from '@kbn/charts-plugin/public'; +import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { LEGACY_HEATMAP_CHARTS_LIBRARY } from '../common'; import { heatmapVisType } from './vis_type'; +import { setDataViewsStart } from './services'; /** @internal */ export interface VisTypeHeatmapSetupDependencies { @@ -28,6 +30,11 @@ export interface VisTypeHeatmapPluginStartDependencies { fieldFormats: FieldFormatsStart; } +/** @internal */ +export interface VisTypeHeatmapStartDependencies { + dataViews: DataViewsPublicPluginStart; +} + export class VisTypeHeatmapPlugin { setup( core: CoreSetup<VisTypeHeatmapPluginStartDependencies>, @@ -44,5 +51,7 @@ export class VisTypeHeatmapPlugin { return {}; } - start() {} + start(core: CoreStart, { dataViews }: VisTypeHeatmapStartDependencies) { + setDataViewsStart(dataViews); + } } diff --git a/src/plugins/vis_types/heatmap/public/sample_vis.test.mocks.ts b/src/plugins/vis_types/heatmap/public/sample_vis.test.mocks.ts index 6a33feb853221..89ede55b951ef 100644 --- a/src/plugins/vis_types/heatmap/public/sample_vis.test.mocks.ts +++ b/src/plugins/vis_types/heatmap/public/sample_vis.test.mocks.ts @@ -5,7 +5,9 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -export const sampleAreaVis = { + +const mockUiStateGet = jest.fn().mockReturnValue(() => {}); +export const sampleHeatmapVis = { type: { name: 'heatmap', title: 'Heatmap', @@ -1788,5 +1790,10 @@ export const sampleAreaVis = { }, }, isHierarchical: () => false, - uiState: {}, + uiState: { + vis: { + legendOpen: false, + }, + get: mockUiStateGet, + }, }; diff --git a/src/plugins/vis_types/heatmap/public/services.ts b/src/plugins/vis_types/heatmap/public/services.ts new file mode 100644 index 0000000000000..736ad70d49419 --- /dev/null +++ b/src/plugins/vis_types/heatmap/public/services.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createGetterSetter } from '@kbn/kibana-utils-plugin/public'; +import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; + +export const [getDataViewsStart, setDataViewsStart] = + createGetterSetter<DataViewsPublicPluginStart>('dataViews'); diff --git a/src/plugins/vis_types/heatmap/public/to_ast.test.ts b/src/plugins/vis_types/heatmap/public/to_ast.test.ts index d1e312755cf49..07585d9f2332f 100644 --- a/src/plugins/vis_types/heatmap/public/to_ast.test.ts +++ b/src/plugins/vis_types/heatmap/public/to_ast.test.ts @@ -7,7 +7,7 @@ */ import { Vis } from '@kbn/visualizations-plugin/public'; -import { sampleAreaVis } from './sample_vis.test.mocks'; +import { sampleHeatmapVis } from './sample_vis.test.mocks'; import { buildExpression } from '@kbn/expressions-plugin/public'; import { toExpressionAst } from './to_ast'; @@ -33,7 +33,7 @@ describe('heatmap vis toExpressionAst function', () => { } as any; beforeEach(() => { - vis = sampleAreaVis as any; + vis = sampleHeatmapVis as any; }); it('should match basic snapshot', () => { diff --git a/src/plugins/vis_types/heatmap/public/utils/palette.ts b/src/plugins/vis_types/heatmap/public/utils/palette.ts index aa978a2954e90..29109a55fd1e7 100644 --- a/src/plugins/vis_types/heatmap/public/utils/palette.ts +++ b/src/plugins/vis_types/heatmap/public/utils/palette.ts @@ -27,13 +27,20 @@ const getColor = ( export const getStopsWithColorsFromColorsNumber = ( colorsNumber: number | '', colorSchema: ColorSchemas, - invertColors: boolean = false + invertColors: boolean = false, + includeZeroElement: boolean = false ) => { const colors = []; const stops = []; if (!colorsNumber) { return { color: [] }; } + + if (includeZeroElement) { + colors.push(TRANSPARENT); + stops.push(0); + } + const step = 100 / colorsNumber; for (let i = 0; i < colorsNumber; i++) { colors.push(getColor(i, colorsNumber, colorSchema, invertColors)); diff --git a/src/plugins/vis_types/heatmap/public/vis_type/heatmap.tsx b/src/plugins/vis_types/heatmap/public/vis_type/heatmap.tsx index e5a92ca03f5cc..336da6e2d8041 100644 --- a/src/plugins/vis_types/heatmap/public/vis_type/heatmap.tsx +++ b/src/plugins/vis_types/heatmap/public/vis_type/heatmap.tsx @@ -16,6 +16,7 @@ import { HeatmapTypeProps, HeatmapVisParams, AxisType, ScaleType } from '../type import { toExpressionAst } from '../to_ast'; import { getHeatmapOptions } from '../editor/components'; import { SplitTooltip } from './split_tooltip'; +import { convertToLens } from '../convert_to_lens'; export const getHeatmapVisTypeDefinition = ({ showElasticChartsOptions = false, @@ -154,4 +155,10 @@ export const getHeatmapVisTypeDefinition = ({ ], }, requiresSearch: true, + navigateToLens: async (vis, timefilter) => (vis ? convertToLens(vis, timefilter) : null), + getExpressionVariables: async (vis, timeFilter) => { + return { + canNavigateToLens: Boolean(vis?.params ? await convertToLens(vis, timeFilter) : null), + }; + }, }); diff --git a/src/plugins/vis_types/heatmap/tsconfig.json b/src/plugins/vis_types/heatmap/tsconfig.json index 99e25a4eba632..f35697fe36997 100644 --- a/src/plugins/vis_types/heatmap/tsconfig.json +++ b/src/plugins/vis_types/heatmap/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "server/**/*", "*.ts" ], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../charts/tsconfig.json" }, { "path": "../../data/tsconfig.json" }, diff --git a/src/plugins/vis_types/metric/kibana.json b/src/plugins/vis_types/metric/kibana.json index 4d8f776d2a0bb..07b3586b950e0 100644 --- a/src/plugins/vis_types/metric/kibana.json +++ b/src/plugins/vis_types/metric/kibana.json @@ -17,7 +17,7 @@ ], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Registers the Metric aggregation-based visualization." } \ No newline at end of file diff --git a/src/plugins/vis_types/metric/tsconfig.json b/src/plugins/vis_types/metric/tsconfig.json index e8e2bb0573014..f86fa052e0884 100644 --- a/src/plugins/vis_types/metric/tsconfig.json +++ b/src/plugins/vis_types/metric/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["public/**/*", "server/**/*", "*.ts"], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../data/tsconfig.json" }, { "path": "../../visualizations/tsconfig.json" }, diff --git a/src/plugins/vis_types/pie/kibana.json b/src/plugins/vis_types/pie/kibana.json index 4c5ee6b50579e..13bc61667dfd7 100644 --- a/src/plugins/vis_types/pie/kibana.json +++ b/src/plugins/vis_types/pie/kibana.json @@ -1,14 +1,27 @@ { - "id": "visTypePie", - "version": "kibana", - "ui": true, - "server": true, - "requiredPlugins": ["charts", "data", "expressions", "visualizations", "usageCollection", "expressionPartitionVis", "dataViews"], - "requiredBundles": ["visDefaultEditor", "kibanaUtils"], - "extraPublicDirs": ["common/index"], - "owner": { - "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" - }, - "description": "Contains the pie 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." - } + "id": "visTypePie", + "version": "kibana", + "ui": true, + "server": true, + "requiredPlugins": [ + "charts", + "data", + "expressions", + "visualizations", + "usageCollection", + "expressionPartitionVis", + "dataViews" + ], + "requiredBundles": [ + "visDefaultEditor", + "kibanaUtils" + ], + "extraPublicDirs": [ + "common/index" + ], + "owner": { + "name": "Vis Editors", + "githubTeam": "kibana-visualizations" + }, + "description": "Contains the pie 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." +} \ No newline at end of file diff --git a/src/plugins/vis_types/pie/tsconfig.json b/src/plugins/vis_types/pie/tsconfig.json index ed052af072f2a..6c4dc9eae2541 100644 --- a/src/plugins/vis_types/pie/tsconfig.json +++ b/src/plugins/vis_types/pie/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "server/**/*", "*.ts" ], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../charts/tsconfig.json" }, { "path": "../../data/tsconfig.json" }, diff --git a/src/plugins/vis_types/table/kibana.json b/src/plugins/vis_types/table/kibana.json index d0ab6489ae61e..ba8b90e7df337 100644 --- a/src/plugins/vis_types/table/kibana.json +++ b/src/plugins/vis_types/table/kibana.json @@ -19,7 +19,7 @@ ], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Registers the datatable aggregation-based visualization." } diff --git a/src/plugins/vis_types/table/public/convert_to_lens/index.ts b/src/plugins/vis_types/table/public/convert_to_lens/index.ts index e69faccbfd7ec..ed23d612cb68c 100644 --- a/src/plugins/vis_types/table/public/convert_to_lens/index.ts +++ b/src/plugins/vis_types/table/public/convert_to_lens/index.ts @@ -73,6 +73,7 @@ export const convertToLens: ConvertTableToLensVisualization = async (vis, timefi return null; } const percentageColumn = getPercentageColumnFormulaColumn({ + visType: vis.type.name, agg: metricAgg as SchemaConfig<METRIC_TYPES>, dataView, aggs: visSchemas.metric as Array<SchemaConfig<METRIC_TYPES>>, diff --git a/src/plugins/vis_types/table/public/utils/use/use_ui_state.test.ts b/src/plugins/vis_types/table/public/utils/use/use_ui_state.test.ts index 5d6d0594e8e62..6be4eeca6bdc3 100644 --- a/src/plugins/vis_types/table/public/utils/use/use_ui_state.test.ts +++ b/src/plugins/vis_types/table/public/utils/use/use_ui_state.test.ts @@ -95,7 +95,7 @@ describe('useUiState', () => { describe('updating uiState through callbacks', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); it('should update the uiState with new sort', async () => { diff --git a/src/plugins/vis_types/table/tsconfig.json b/src/plugins/vis_types/table/tsconfig.json index 892c5691c8f04..7af02367b7996 100644 --- a/src/plugins/vis_types/table/tsconfig.json +++ b/src/plugins/vis_types/table/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "server/**/*", "*.ts" ], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../data/tsconfig.json" }, { "path": "../../visualizations/tsconfig.json" }, diff --git a/src/plugins/vis_types/tagcloud/kibana.json b/src/plugins/vis_types/tagcloud/kibana.json index 67d57dec9f1fa..53e6141b9fb0d 100644 --- a/src/plugins/vis_types/tagcloud/kibana.json +++ b/src/plugins/vis_types/tagcloud/kibana.json @@ -7,7 +7,7 @@ "requiredBundles": ["kibanaReact", "visDefaultEditor"], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Registers the tagcloud visualization. It is based on elastic-charts wordcloud." diff --git a/src/plugins/vis_types/tagcloud/tsconfig.json b/src/plugins/vis_types/tagcloud/tsconfig.json index 4087f9f04c92b..0159681d2e198 100644 --- a/src/plugins/vis_types/tagcloud/tsconfig.json +++ b/src/plugins/vis_types/tagcloud/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", "server/**/*", "*.ts" ], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../data/tsconfig.json" }, { "path": "../../expressions/tsconfig.json" }, diff --git a/src/plugins/vis_types/timelion/kibana.json b/src/plugins/vis_types/timelion/kibana.json index cf02808ec5c40..584593d69a546 100644 --- a/src/plugins/vis_types/timelion/kibana.json +++ b/src/plugins/vis_types/timelion/kibana.json @@ -9,7 +9,7 @@ "optionalPlugins": ["usageCollection"], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Registers the timelion visualization. Also contains the backend for both timelion app and timelion visualization." } diff --git a/src/plugins/vis_types/timelion/tsconfig.json b/src/plugins/vis_types/timelion/tsconfig.json index 5e20e43224cdb..5a660d5d4d780 100644 --- a/src/plugins/vis_types/timelion/tsconfig.json +++ b/src/plugins/vis_types/timelion/tsconfig.json @@ -4,15 +4,15 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", "server/**/*", + "server/timelion.json", "*.ts" ], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../visualizations/tsconfig.json" }, { "path": "../../data/tsconfig.json" }, diff --git a/src/plugins/vis_types/timeseries/kibana.json b/src/plugins/vis_types/timeseries/kibana.json index 049bd6beffd6f..9ce16f65ec753 100644 --- a/src/plugins/vis_types/timeseries/kibana.json +++ b/src/plugins/vis_types/timeseries/kibana.json @@ -9,7 +9,7 @@ "requiredBundles": ["unifiedSearch", "kibanaUtils", "kibanaReact", "fieldFormats"], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Registers the TSVB visualization. TSVB has its one editor, works with index patterns and index strings and contains 6 types of charts: timeseries, topN, table. markdown, metric and gauge." } diff --git a/src/plugins/vis_types/timeseries/public/application/components/series_editor.js b/src/plugins/vis_types/timeseries/public/application/components/series_editor.js index 7bd72b85edc1d..531075b36244b 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/series_editor.js +++ b/src/plugins/vis_types/timeseries/public/application/components/series_editor.js @@ -65,6 +65,10 @@ export class SeriesEditor extends Component { } }; + handleSeriesChange = (doc) => { + handleChange(this.props, doc); + }; + render() { const { limit, model, name, fields, colorPicker } = this.props; const list = model[name].filter((val, index) => index < (limit || Infinity)); @@ -89,7 +93,7 @@ export class SeriesEditor extends Component { disableDelete={model[name].length < 2} fields={fields} onAdd={() => handleAdd(this.props, newSeriesFn)} - onChange={(doc) => handleChange(this.props, doc)} + onChange={this.handleSeriesChange} onClone={() => this.handleClone(row)} onDelete={() => handleDelete(this.props, row)} model={row} diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/config.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/config.js index 48ba0e5403665..506ce0dbdf2a9 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/config.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/config.js @@ -35,7 +35,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { getDefaultQueryLanguage } from '../../lib/get_default_query_language'; import { checkIfNumericMetric } from '../../lib/check_if_numeric_metric'; import { QueryBarWrapper } from '../../query_bar_wrapper'; -import { DATA_FORMATTERS } from '../../../../../common/enums'; +import { DATA_FORMATTERS, BUCKET_TYPES } from '../../../../../common/enums'; import { isConfigurationFeatureEnabled } from '../../../../../common/check_ui_restrictions'; import { filterCannotBeAppliedErrorMessage } from '../../../../../common/errors'; import { tsvbEditorRowStyles } from '../../../styles/common.styles'; @@ -50,13 +50,20 @@ class TableSeriesConfigUi extends Component { } } + handleAggregateByChange = (selectedOptions) => { + this.props.onChange({ + aggregate_by: selectedOptions?.[0], + }); + }; + + handleSelectChange = createSelectHandler(this.props.onChange); + handleTextChange = createTextHandler(this.props.onChange); + changeModelFormatter = (formatter) => this.props.onChange({ formatter }); render() { const defaults = { offset_time: '', value_template: '{{value}}' }; const model = { ...defaults, ...this.props.model }; - const handleSelectChange = createSelectHandler(this.props.onChange); - const handleTextChange = createTextHandler(this.props.onChange); const htmlId = htmlIdGenerator(); const functionOptions = [ @@ -160,7 +167,7 @@ class TableSeriesConfigUi extends Component { fullWidth > <EuiFieldText - onChange={handleTextChange('value_template')} + onChange={this.handleTextChange('value_template')} value={model.value_template} disabled={model.formatter === DATA_FORMATTERS.DEFAULT} fullWidth @@ -214,7 +221,7 @@ class TableSeriesConfigUi extends Component { <EuiHorizontalRule margin="s" /> <EuiFlexGroup responsive={false} wrap={true}> - <EuiFlexItem grow={true}> + <EuiFlexItem grow={true} data-test-subj="tsvbAggregateBySelect"> <FieldSelect label={ <FormattedMessage id="visTypeTimeseries.table.fieldLabel" defaultMessage="Field" /> @@ -222,11 +229,7 @@ class TableSeriesConfigUi extends Component { fields={this.props.fields} indexPattern={this.props.panel.index_pattern} value={model.aggregate_by} - onChange={(value) => - this.props.onChange({ - aggregate_by: value?.[0], - }) - } + onChange={this.handleAggregateByChange} fullWidth restrict={[ KBN_FIELD_TYPES.NUMBER, @@ -236,7 +239,7 @@ class TableSeriesConfigUi extends Component { KBN_FIELD_TYPES.STRING, ]} uiRestrictions={this.props.uiRestrictions} - type={'terms'} + type={BUCKET_TYPES.TERMS} /> </EuiFlexItem> <EuiFlexItem grow={true}> @@ -251,9 +254,10 @@ class TableSeriesConfigUi extends Component { fullWidth > <EuiComboBox + data-test-subj="tsvbAggregateFunctionCombobox" options={functionOptions} selectedOptions={selectedAggFuncOption ? [selectedAggFuncOption] : []} - onChange={handleSelectChange('aggregate_function')} + onChange={this.handleSelectChange('aggregate_function')} singleSelection={{ asPlainText: true }} fullWidth /> diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/gauge/index.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/gauge/index.test.ts index cbc899981717b..9943cfa627e23 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/gauge/index.test.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/gauge/index.test.ts @@ -6,10 +6,11 @@ * Side Public License, v 1. */ +import { Vis } from '@kbn/visualizations-plugin/public'; import { METRIC_TYPES } from '@kbn/data-plugin/public'; import { stubLogstashDataView } from '@kbn/data-views-plugin/common/data_view.stub'; import { TSVB_METRIC_TYPES } from '../../../common/enums'; -import { Metric } from '../../../common/types'; +import { Panel, Metric } from '../../../common/types'; import { convertToLens } from '.'; import { createPanel, createSeries } from '../lib/__mocks__'; import { AvgColumn } from '../lib/convert'; @@ -58,6 +59,10 @@ describe('convertToLens', () => { series: [createSeries({ metrics: [metric] })], }); + const vis = { + params: model, + } as Vis<Panel>; + const metricColumn: AvgColumn = { columnId: 'col-id', dataType: 'number', @@ -89,51 +94,55 @@ describe('convertToLens', () => { test('should return null for invalid metrics', async () => { mockIsValidMetrics.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockIsValidMetrics).toBeCalledTimes(1); }); test('should return null for invalid or unsupported metrics', async () => { mockGetMetricsColumns.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockGetMetricsColumns).toBeCalledTimes(1); }); test('should return null for invalid or unsupported buckets', async () => { mockGetBucketsColumns.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockGetBucketsColumns).toBeCalledTimes(1); }); test('should return null if metric is staticValue', async () => { const result = await convertToLens({ - ...model, - series: [ - { - ...model.series[0], - metrics: [...model.series[0].metrics, { type: TSVB_METRIC_TYPES.STATIC } as Metric], - }, - ], - }); + params: { + ...model, + series: [ + { + ...model.series[0], + metrics: [...model.series[0].metrics, { type: TSVB_METRIC_TYPES.STATIC } as Metric], + }, + ], + }, + } as Vis<Panel>); expect(result).toBeNull(); expect(mockGetDataSourceInfo).toBeCalledTimes(0); }); test('should return null if only series agg is specified', async () => { const result = await convertToLens({ - ...model, - series: [ - { - ...model.series[0], - metrics: [ - { type: TSVB_METRIC_TYPES.SERIES_AGG, function: 'min', id: 'some-id' } as Metric, - ], - }, - ], - }); + params: { + ...model, + series: [ + { + ...model.series[0], + metrics: [ + { type: TSVB_METRIC_TYPES.SERIES_AGG, function: 'min', id: 'some-id' } as Metric, + ], + }, + ], + }, + } as Vis<Panel>); expect(result).toBeNull(); }); @@ -142,7 +151,7 @@ describe('convertToLens', () => { mockGetSeriesAgg.mockReturnValue({ metrics: [metric] }); mockGetConfigurationForGauge.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); }); @@ -151,8 +160,8 @@ describe('convertToLens', () => { mockGetSeriesAgg.mockReturnValue({ metrics: [metric] }); mockGetConfigurationForGauge.mockReturnValue({}); - const result = await convertToLens( - createPanel({ + const result = await convertToLens({ + params: createPanel({ series: [ createSeries({ metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], @@ -163,8 +172,8 @@ describe('convertToLens', () => { hidden: false, }), ], - }) - ); + }), + } as Vis<Panel>); expect(result).toBeDefined(); expect(result?.type).toBe('lnsMetric'); }); diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/gauge/index.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/gauge/index.ts index b97f8d59e9537..87d5333d4be51 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/gauge/index.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/gauge/index.ts @@ -45,7 +45,10 @@ const getMaxFormula = (metric: Metric, column?: Column) => { }))`; }; -export const convertToLens: ConvertTsvbToLensVisualization = async (model, timeRange) => { +export const convertToLens: ConvertTsvbToLensVisualization = async ( + { params: model }, + timeRange +) => { const dataViews = getDataViewsStart(); const series = model.series[0]; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/index.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/index.test.ts index 309f066b18f29..a97395f64c113 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/index.test.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/index.test.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { Vis } from '@kbn/visualizations-plugin/public'; import type { Panel } from '../../common/types'; import { convertTSVBtoLensConfiguration } from '.'; @@ -42,7 +43,9 @@ describe('convertTSVBtoLensConfiguration', () => { ...model, type: 'markdown', } as Panel; - const triggerOptions = await convertTSVBtoLensConfiguration(metricModel); + const triggerOptions = await convertTSVBtoLensConfiguration({ + params: metricModel, + } as Vis<Panel>); expect(triggerOptions).toBeNull(); }); @@ -51,7 +54,9 @@ describe('convertTSVBtoLensConfiguration', () => { ...model, use_kibana_indexes: false, }; - const triggerOptions = await convertTSVBtoLensConfiguration(stringIndexPatternModel); + const triggerOptions = await convertTSVBtoLensConfiguration({ + params: stringIndexPatternModel, + } as Vis<Panel>); expect(triggerOptions).toBeNull(); }); }); diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/index.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/index.ts index a3d08e89e91a2..3e1982aa0903e 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/index.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/index.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { Vis } from '@kbn/visualizations-plugin/public'; import { TimeRange } from '@kbn/data-plugin/common'; import type { Panel } from '../../common/types'; import { PANEL_TYPES } from '../../common/enums'; @@ -29,6 +30,10 @@ const getConvertFnByType = (type: PANEL_TYPES) => { const { convertToLens } = await import('./gauge'); return convertToLens; }, + [PANEL_TYPES.TABLE]: async () => { + const { convertToLens } = await import('./table'); + return convertToLens; + }, }; return convertionFns[type]?.(); @@ -39,17 +44,17 @@ const getConvertFnByType = (type: PANEL_TYPES) => { * Returns the Lens model, only if it is supported. If not, it returns null. * In case of null, the menu item is disabled and the user can't navigate to Lens. */ -export const convertTSVBtoLensConfiguration = async (model: Panel, timeRange?: TimeRange) => { +export const convertTSVBtoLensConfiguration = async (vis: Vis<Panel>, timeRange?: TimeRange) => { // Disables the option for not supported charts, for the string mode and for series with annotations - if (!model.use_kibana_indexes) { + if (!vis.params.use_kibana_indexes) { return null; } // Disables if model is invalid - if (model.isModelInvalid) { + if (vis.params.isModelInvalid) { return null; } - const convertFn = await getConvertFnByType(model.type); + const convertFn = await getConvertFnByType(vis.params.type); - return (await convertFn?.(model, timeRange)) ?? null; + return (await convertFn?.(vis, timeRange)) ?? null; }; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/index.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/index.test.ts index 9cb0238f9d265..0fabef6eebdbe 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/index.test.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/index.test.ts @@ -14,7 +14,7 @@ import { getConfigurationForMetric, getConfigurationForGauge } from '.'; const mockGetPalette = jest.fn(); -jest.mock('./palette', () => ({ +jest.mock('../palette', () => ({ getPalette: jest.fn(() => mockGetPalette()), })); diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/index.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/index.ts index 7b49d604b2343..e6814b0797a1a 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/index.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/index.ts @@ -10,7 +10,7 @@ import color from 'color'; import { MetricVisConfiguration } from '@kbn/visualizations-plugin/common'; import { Panel } from '../../../../../common/types'; import { Column, Layer } from '../../convert'; -import { getPalette } from './palette'; +import { getPalette } from '../palette'; import { findMetricColumn, getMetricWithCollapseFn } from '../../../utils'; export const getConfigurationForMetric = ( diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/palette.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/palette.test.ts deleted file mode 100644 index b7356f094f91a..0000000000000 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/palette.test.ts +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { getPalette } from './palette'; - -describe('getPalette', () => { - const baseColor = '#fff'; - const invalidRules = [ - { id: 'some-id-0' }, - { id: 'some-id-1', value: 10 }, - { id: 'some-id-2', operator: 'gte' }, - { id: 'some-id-3', color: '#000' }, - { id: 'some-id-4', background_color: '#000' }, - ]; - - describe('Metric', () => { - test('should return undefined if no filled rules was provided', () => { - expect(getPalette([])).toBeUndefined(); - expect(getPalette(invalidRules)).toBeUndefined(); - }); - - test('should return undefined if only one valid rule is provided and it is not lte', () => { - expect(getPalette([])).toBeUndefined(); - expect( - getPalette([ - ...invalidRules, - { id: 'some-id-5', operator: 'gt', value: 100, background_color: '#000' }, - ]) - ).toBeUndefined(); - }); - - test('should return custom palette if only one valid rule is provided and it is lte', () => { - expect(getPalette([])).toBeUndefined(); - expect( - getPalette([ - ...invalidRules, - { id: 'some-id-5', operator: 'lte', value: 100, background_color: '#000' }, - ]) - ).toEqual({ - name: 'custom', - params: { - colorStops: [{ color: '#000000', stop: 100 }], - continuity: 'below', - maxSteps: 5, - name: 'custom', - progression: 'fixed', - rangeMax: 100, - rangeMin: -Infinity, - rangeType: 'number', - reverse: false, - steps: 1, - stops: [{ color: '#000000', stop: 100 }], - }, - type: 'palette', - }); - }); - - test('should return undefined if more than two types of rules', () => { - expect(getPalette([])).toBeUndefined(); - expect( - getPalette([ - ...invalidRules, - { id: 'some-id-5', operator: 'lte', value: 100, background_color: '#000' }, - { id: 'some-id-6', operator: 'gte', value: 150, background_color: '#000' }, - { id: 'some-id-7', operator: 'lt', value: 200, background_color: '#000' }, - ]) - ).toBeUndefined(); - }); - - test('should return undefined if two types of rules and last rule is not lte', () => { - expect(getPalette([])).toBeUndefined(); - expect( - getPalette([ - ...invalidRules, - { id: 'some-id-5', operator: 'gte', value: 100, background_color: '#000' }, - { id: 'some-id-7', operator: 'lt', value: 200, background_color: '#000' }, - { id: 'some-id-6', operator: 'gte', value: 150, background_color: '#000' }, - ]) - ).toBeUndefined(); - }); - - test('should return undefined if all rules are lte', () => { - expect(getPalette([])).toBeUndefined(); - expect( - getPalette([ - ...invalidRules, - { id: 'some-id-5', operator: 'lte', value: 100, background_color: '#000' }, - { id: 'some-id-7', operator: 'lte', value: 200, background_color: '#000' }, - { id: 'some-id-6', operator: 'lte', value: 150, background_color: '#000' }, - ]) - ).toBeUndefined(); - }); - - test('should return undefined if two types of rules and all except last one are lt and last one is not lte', () => { - expect(getPalette([])).toBeUndefined(); - expect( - getPalette([ - ...invalidRules, - { id: 'some-id-5', operator: 'lt', value: 100, background_color: '#000' }, - { id: 'some-id-7', operator: 'gte', value: 200, background_color: '#000' }, - { id: 'some-id-6', operator: 'lt', value: 150, background_color: '#000' }, - ]) - ).toBeUndefined(); - }); - - test('should return custom palette if two types of rules and all except last one is lt and last one is lte', () => { - expect(getPalette([])).toBeUndefined(); - expect( - getPalette([ - ...invalidRules, - { id: 'some-id-5', operator: 'lt', value: 100, background_color: '#000' }, - { id: 'some-id-7', operator: 'lte', value: 200, background_color: '#000' }, - { id: 'some-id-6', operator: 'lt', value: 150, background_color: '#000' }, - ]) - ).toEqual({ - name: 'custom', - params: { - colorStops: [ - { color: '#000000', stop: -Infinity }, - { color: '#000000', stop: 100 }, - { color: '#000000', stop: 150 }, - ], - continuity: 'below', - maxSteps: 5, - name: 'custom', - progression: 'fixed', - rangeMax: 200, - rangeMin: -Infinity, - rangeType: 'number', - reverse: false, - steps: 4, - stops: [ - { color: '#000000', stop: 100 }, - { color: '#000000', stop: 150 }, - { color: '#000000', stop: 200 }, - ], - }, - type: 'palette', - }); - }); - - test('should return custom palette if last one is lte and all previous are gte', () => { - expect(getPalette([])).toBeUndefined(); - expect( - getPalette([ - ...invalidRules, - { id: 'some-id-5', operator: 'gte', value: 100, background_color: '#000' }, - { id: 'some-id-7', operator: 'lte', value: 200, background_color: '#000' }, - { id: 'some-id-6', operator: 'gte', value: 150, background_color: '#000' }, - ]) - ).toEqual({ - name: 'custom', - params: { - colorStops: [ - { color: '#000000', stop: 100 }, - { color: '#000000', stop: 150 }, - ], - continuity: 'none', - maxSteps: 5, - name: 'custom', - progression: 'fixed', - rangeMax: 200, - rangeMin: 100, - rangeType: 'number', - reverse: false, - steps: 2, - stops: [ - { color: '#000000', stop: 150 }, - { color: '#000000', stop: 200 }, - ], - }, - type: 'palette', - }); - }); - }); - - describe('Gauge', () => { - test('should return undefined if no filled rules was provided', () => { - expect(getPalette([], baseColor)).toBeUndefined(); - expect(getPalette(invalidRules, baseColor)).toBeUndefined(); - }); - - test('should return undefined if only one valid rule is provided and it is not lte', () => { - expect(getPalette([], baseColor)).toBeUndefined(); - expect( - getPalette( - [...invalidRules, { id: 'some-id-5', operator: 'gt', value: 100, gauge: '#000' }], - baseColor - ) - ).toBeUndefined(); - }); - - test('should return custom palette if only one valid rule is provided and it is lte', () => { - expect(getPalette([], baseColor)).toBeUndefined(); - expect( - getPalette( - [...invalidRules, { id: 'some-id-5', operator: 'lte', value: 100, gauge: '#000' }], - baseColor - ) - ).toEqual({ - name: 'custom', - params: { - colorStops: [{ color: '#000000', stop: 100 }], - continuity: 'below', - maxSteps: 5, - name: 'custom', - progression: 'fixed', - rangeMax: 100, - rangeMin: -Infinity, - rangeType: 'number', - reverse: false, - steps: 1, - stops: [{ color: '#000000', stop: 100 }], - }, - type: 'palette', - }); - }); - - test('should return undefined if more than two types of rules', () => { - expect(getPalette([], baseColor)).toBeUndefined(); - expect( - getPalette( - [ - ...invalidRules, - { id: 'some-id-5', operator: 'lte', value: 100, gauge: '#000' }, - { id: 'some-id-6', operator: 'gte', value: 150, gauge: '#000' }, - { id: 'some-id-7', operator: 'lt', value: 200, gauge: '#000' }, - ], - baseColor - ) - ).toBeUndefined(); - }); - - test('should return undefined if two types of rules and last rule is not lte', () => { - expect(getPalette([], baseColor)).toBeUndefined(); - expect( - getPalette( - [ - ...invalidRules, - { id: 'some-id-5', operator: 'gte', value: 100, gauge: '#000' }, - { id: 'some-id-7', operator: 'lt', value: 200, gauge: '#000' }, - { id: 'some-id-6', operator: 'gte', value: 150, gauge: '#000' }, - ], - baseColor - ) - ).toBeUndefined(); - }); - - test('should return undefined if all rules are lte', () => { - expect(getPalette([], baseColor)).toBeUndefined(); - expect( - getPalette( - [ - ...invalidRules, - { id: 'some-id-5', operator: 'lte', value: 100, gauge: '#000' }, - { id: 'some-id-7', operator: 'lte', value: 200, gauge: '#000' }, - { id: 'some-id-6', operator: 'lte', value: 150, gauge: '#000' }, - ], - baseColor - ) - ).toBeUndefined(); - }); - - test('should return undefined if two types of rules and all except last one are lt and last one is not lte', () => { - expect(getPalette([], baseColor)).toBeUndefined(); - expect( - getPalette( - [ - ...invalidRules, - { id: 'some-id-5', operator: 'lt', value: 100, gauge: '#000' }, - { id: 'some-id-7', operator: 'gte', value: 200, gauge: '#000' }, - { id: 'some-id-6', operator: 'lt', value: 150, gauge: '#000' }, - ], - baseColor - ) - ).toBeUndefined(); - }); - - test('should return custom palette if two types of rules and all except last one is lt and last one is lte', () => { - expect(getPalette([], baseColor)).toBeUndefined(); - expect( - getPalette( - [ - ...invalidRules, - { id: 'some-id-5', operator: 'lt', value: 100, gauge: '#000' }, - { id: 'some-id-7', operator: 'lte', value: 200, gauge: '#000' }, - { id: 'some-id-6', operator: 'lt', value: 150, gauge: '#000' }, - ], - baseColor - ) - ).toEqual({ - name: 'custom', - params: { - colorStops: [ - { color: '#000000', stop: -Infinity }, - { color: '#000000', stop: 100 }, - { color: '#000000', stop: 150 }, - ], - continuity: 'below', - maxSteps: 5, - name: 'custom', - progression: 'fixed', - rangeMax: 200, - rangeMin: -Infinity, - rangeType: 'number', - reverse: false, - steps: 4, - stops: [ - { color: '#000000', stop: 100 }, - { color: '#000000', stop: 150 }, - { color: '#000000', stop: 200 }, - ], - }, - type: 'palette', - }); - }); - - test('should return custom palette if last one is lte and all previous are gte', () => { - expect(getPalette([], baseColor)).toBeUndefined(); - expect( - getPalette( - [ - ...invalidRules, - { id: 'some-id-5', operator: 'gte', value: 100, gauge: '#000' }, - { id: 'some-id-7', operator: 'lte', value: 200, gauge: '#000' }, - { id: 'some-id-6', operator: 'gte', value: 150, gauge: '#000' }, - ], - baseColor - ) - ).toEqual({ - name: 'custom', - params: { - colorStops: [ - { color: baseColor, stop: -Infinity }, - { color: '#000000', stop: 100 }, - { color: '#000000', stop: 150 }, - ], - continuity: 'below', - maxSteps: 5, - name: 'custom', - progression: 'fixed', - rangeMax: 200, - rangeMin: -Infinity, - rangeType: 'number', - reverse: false, - steps: 3, - stops: [ - { color: baseColor, stop: 100 }, - { color: '#000000', stop: 150 }, - { color: '#000000', stop: 200 }, - ], - }, - type: 'palette', - }); - }); - }); -}); diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/palette.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/palette.ts deleted file mode 100644 index 4079ffb396647..0000000000000 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/metric/palette.ts +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import color from 'color'; -import { ColorStop, CustomPaletteParams, PaletteOutput } from '@kbn/coloring'; -import { uniqBy } from 'lodash'; -import { Panel } from '../../../../../common/types'; - -const Operators = { - GTE: 'gte', - GT: 'gt', - LTE: 'lte', - LT: 'lt', -} as const; - -type ColorStopsWithMinMax = Pick< - CustomPaletteParams, - 'colorStops' | 'stops' | 'steps' | 'rangeMax' | 'rangeMin' | 'continuity' ->; - -type MetricColorRules = Exclude<Panel['background_color_rules'], undefined>; -type GaugeColorRules = Exclude<Panel['gauge_color_rules'], undefined>; - -type MetricColorRule = MetricColorRules[number]; -type GaugeColorRule = GaugeColorRules[number]; - -type ValidMetricColorRule = Omit<MetricColorRule, 'background_color' | 'color'> & - ( - | { - background_color: Exclude<MetricColorRule['background_color'], undefined>; - color: MetricColorRule['color']; - } - | { - background_color: MetricColorRule['background_color']; - color: Exclude<MetricColorRule['color'], undefined>; - } - ); - -type ValidGaugeColorRule = Omit<GaugeColorRule, 'gauge'> & { - gauge: Exclude<GaugeColorRule['gauge'], undefined>; -}; - -const isValidColorRule = ( - rule: MetricColorRule | GaugeColorRule -): rule is ValidMetricColorRule | ValidGaugeColorRule => { - const { background_color: bColor, color: textColor } = rule as MetricColorRule; - const { gauge } = rule as GaugeColorRule; - - return rule.operator && (bColor ?? textColor ?? gauge) && rule.value !== undefined ? true : false; -}; - -const isMetricColorRule = ( - rule: ValidMetricColorRule | ValidGaugeColorRule -): rule is ValidMetricColorRule => { - const metricRule = rule as ValidMetricColorRule; - return metricRule.background_color ?? metricRule.color ? true : false; -}; - -const getColor = (rule: ValidMetricColorRule | ValidGaugeColorRule) => { - if (isMetricColorRule(rule)) { - return rule.background_color ?? rule.color; - } - return rule.gauge; -}; - -const getColorStopsWithMinMaxForAllGteOrWithLte = ( - rules: Array<ValidMetricColorRule | ValidGaugeColorRule>, - tailOperator: string, - baseColor?: string -): ColorStopsWithMinMax => { - const lastRule = rules[rules.length - 1]; - const lastRuleColor = getColor(lastRule); - const initRules = baseColor ? [{ stop: -Infinity, color: baseColor }] : []; - const colorStops = rules.reduce<ColorStop[]>((colors, rule, index, rulesArr) => { - const rgbColor = getColor(rule); - if (index === rulesArr.length - 1 && tailOperator === Operators.LTE) { - return colors; - } - // if last operation is LTE, color of gte should be replaced by lte - if (index === rulesArr.length - 2 && tailOperator === Operators.LTE) { - return [ - ...colors, - { - color: color(lastRuleColor).hex(), - stop: rule.value!, - }, - ]; - } - return [ - ...colors, - { - color: color(rgbColor).hex(), - stop: rule.value!, - }, - ]; - }, initRules); - - const stops = colorStops.reduce<ColorStop[]>((prevStops, colorStop, index, colorStopsArr) => { - if (index === colorStopsArr.length - 1) { - return [ - ...prevStops, - { - color: colorStop.color, - stop: tailOperator === Operators.LTE ? lastRule.value! : colorStop.stop + 1, - }, - ]; - } - return [...prevStops, { color: colorStop.color, stop: colorStopsArr[index + 1].stop }]; - }, []); - - const [rule] = rules; - return { - rangeMin: baseColor ? -Infinity : rule.value, - rangeMax: tailOperator === Operators.LTE ? lastRule.value : Infinity, - colorStops, - stops, - steps: colorStops.length, - continuity: - tailOperator === Operators.LTE ? (baseColor ? 'below' : 'none') : baseColor ? 'all' : 'above', - }; -}; - -const getColorStopsWithMinMaxForLtWithLte = ( - rules: Array<ValidMetricColorRule | ValidGaugeColorRule> -): ColorStopsWithMinMax => { - const lastRule = rules[rules.length - 1]; - const colorStops = rules.reduce<ColorStop[]>((colors, rule, index, rulesArr) => { - if (index === 0) { - return [{ color: color(getColor(rule)).hex(), stop: -Infinity }]; - } - const rgbColor = getColor(rule); - return [ - ...colors, - { - color: color(rgbColor).hex(), - stop: rulesArr[index - 1].value!, - }, - ]; - }, []); - - const stops = colorStops.reduce<ColorStop[]>((prevStops, colorStop, index, colorStopsArr) => { - if (index === colorStopsArr.length - 1) { - return [ - ...prevStops, - { - color: colorStop.color, - stop: lastRule.value!, - }, - ]; - } - return [...prevStops, { color: colorStop.color, stop: colorStopsArr[index + 1].stop }]; - }, []); - - return { - rangeMin: -Infinity, - rangeMax: lastRule.value, - colorStops, - stops, - steps: colorStops.length + 1, - continuity: 'below', - }; -}; - -const getColorStopWithMinMaxForLte = ( - rule: ValidMetricColorRule | ValidGaugeColorRule -): ColorStopsWithMinMax => { - const colorStop = { - color: color(getColor(rule)).hex(), - stop: rule.value!, - }; - return { - rangeMin: -Infinity, - rangeMax: rule.value!, - colorStops: [colorStop], - stops: [colorStop], - steps: 1, - continuity: 'below', - }; -}; - -const getColorStopWithMinMaxForGte = ( - rule: ValidMetricColorRule | ValidGaugeColorRule, - baseColor?: string -): ColorStopsWithMinMax => { - const colorStop = { - color: color(getColor(rule)).hex(), - stop: rule.value!, - }; - return { - colorStops: [...(baseColor ? [{ color: baseColor, stop: -Infinity }] : []), colorStop], - continuity: baseColor ? 'all' : 'above', - rangeMax: Infinity, - rangeMin: baseColor ? -Infinity : colorStop.stop, - steps: 2, - stops: [ - ...(baseColor ? [{ color: baseColor, stop: colorStop.stop }] : []), - { color: colorStop.color, stop: Infinity }, - ], - }; -}; - -const getCustomPalette = ( - colorStopsWithMinMax: ColorStopsWithMinMax -): PaletteOutput<CustomPaletteParams> => { - return { - name: 'custom', - params: { - continuity: 'all', - maxSteps: 5, - name: 'custom', - progression: 'fixed', - rangeMax: Infinity, - rangeMin: -Infinity, - rangeType: 'number', - reverse: false, - ...colorStopsWithMinMax, - }, - type: 'palette', - }; -}; - -export const getPalette = ( - rules: MetricColorRules | GaugeColorRules, - baseColor?: string -): PaletteOutput<CustomPaletteParams> | null | undefined => { - const validRules = (rules as Array<MetricColorRule | GaugeColorRule>).filter< - ValidMetricColorRule | ValidGaugeColorRule - >((rule): rule is ValidMetricColorRule | ValidGaugeColorRule => isValidColorRule(rule)); - - validRules.sort((rule1, rule2) => { - return rule1.value! - rule2.value!; - }); - - const kindOfRules = uniqBy(validRules, 'operator'); - - if (!kindOfRules.length) { - return; - } - - // lnsMetric is supporting lte only, if one rule is defined - if (validRules.length === 1) { - if (validRules[0].operator === Operators.LTE) { - return getCustomPalette(getColorStopWithMinMaxForLte(validRules[0])); - } - - if (validRules[0].operator === Operators.GTE) { - return getCustomPalette(getColorStopWithMinMaxForGte(validRules[0], baseColor)); - } - return; - } - - const headRules = validRules.slice(0, -1); - const tailRule = validRules[validRules.length - 1]; - const kindOfHeadRules = uniqBy(headRules, 'operator'); - - if ( - kindOfHeadRules.length > 1 || - (kindOfHeadRules[0].operator !== tailRule.operator && tailRule.operator !== Operators.LTE) - ) { - return; - } - - const [rule] = kindOfHeadRules; - - if (rule.operator === Operators.LTE) { - return; - } - - if (rule.operator === Operators.LT) { - if (tailRule.operator !== Operators.LTE) { - return; - } - return getCustomPalette(getColorStopsWithMinMaxForLtWithLte(validRules)); - } - - if (rule.operator === Operators.GTE) { - return getCustomPalette( - getColorStopsWithMinMaxForAllGteOrWithLte(validRules, tailRule.operator!, baseColor) - ); - } -}; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/palette/index.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/palette/index.test.ts new file mode 100644 index 0000000000000..059f0372c451a --- /dev/null +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/palette/index.test.ts @@ -0,0 +1,362 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getPalette } from '.'; + +describe('getPalette', () => { + const baseColor = '#fff'; + const invalidRules = [ + { id: 'some-id-0' }, + { id: 'some-id-1', value: 10 }, + { id: 'some-id-2', operator: 'gte' }, + { id: 'some-id-3', color: '#000' }, + { id: 'some-id-4', background_color: '#000' }, + ]; + + describe('Metric', () => { + test('should return undefined if no filled rules was provided', () => { + expect(getPalette([])).toBeUndefined(); + expect(getPalette(invalidRules)).toBeUndefined(); + }); + + test('should return undefined if only one valid rule is provided and it is not lte', () => { + expect(getPalette([])).toBeUndefined(); + expect( + getPalette([ + ...invalidRules, + { id: 'some-id-5', operator: 'gt', value: 100, background_color: '#000' }, + ]) + ).toBeUndefined(); + }); + + test('should return custom palette if only one valid rule is provided and it is lte', () => { + expect(getPalette([])).toBeUndefined(); + expect( + getPalette([ + ...invalidRules, + { id: 'some-id-5', operator: 'lte', value: 100, background_color: '#000' }, + ]) + ).toEqual({ + name: 'custom', + params: { + colorStops: [{ color: '#000000', stop: 100 }], + continuity: 'below', + maxSteps: 5, + name: 'custom', + progression: 'fixed', + rangeMax: 100, + rangeMin: -Infinity, + rangeType: 'number', + reverse: false, + steps: 1, + stops: [{ color: '#000000', stop: 100 }], + }, + type: 'palette', + }); + }); + + test('should return undefined if more than two types of rules', () => { + expect(getPalette([])).toBeUndefined(); + expect( + getPalette([ + ...invalidRules, + { id: 'some-id-5', operator: 'lte', value: 100, background_color: '#000' }, + { id: 'some-id-6', operator: 'gte', value: 150, background_color: '#000' }, + { id: 'some-id-7', operator: 'lt', value: 200, background_color: '#000' }, + ]) + ).toBeUndefined(); + }); + + test('should return undefined if two types of rules and last rule is not lte', () => { + expect(getPalette([])).toBeUndefined(); + expect( + getPalette([ + ...invalidRules, + { id: 'some-id-5', operator: 'gte', value: 100, background_color: '#000' }, + { id: 'some-id-7', operator: 'lt', value: 200, background_color: '#000' }, + { id: 'some-id-6', operator: 'gte', value: 150, background_color: '#000' }, + ]) + ).toBeUndefined(); + }); + + test('should return undefined if all rules are lte', () => { + expect(getPalette([])).toBeUndefined(); + expect( + getPalette([ + ...invalidRules, + { id: 'some-id-5', operator: 'lte', value: 100, background_color: '#000' }, + { id: 'some-id-7', operator: 'lte', value: 200, background_color: '#000' }, + { id: 'some-id-6', operator: 'lte', value: 150, background_color: '#000' }, + ]) + ).toBeUndefined(); + }); + + test('should return undefined if two types of rules and all except last one are lt and last one is not lte', () => { + expect(getPalette([])).toBeUndefined(); + expect( + getPalette([ + ...invalidRules, + { id: 'some-id-5', operator: 'lt', value: 100, background_color: '#000' }, + { id: 'some-id-7', operator: 'gte', value: 200, background_color: '#000' }, + { id: 'some-id-6', operator: 'lt', value: 150, background_color: '#000' }, + ]) + ).toBeUndefined(); + }); + + test('should return custom palette if two types of rules and all except last one is lt and last one is lte', () => { + expect(getPalette([])).toBeUndefined(); + expect( + getPalette([ + ...invalidRules, + { id: 'some-id-5', operator: 'lt', value: 100, background_color: '#000' }, + { id: 'some-id-7', operator: 'lte', value: 200, background_color: '#000' }, + { id: 'some-id-6', operator: 'lt', value: 150, background_color: '#000' }, + ]) + ).toEqual({ + name: 'custom', + params: { + colorStops: [ + { color: '#000000', stop: -Infinity }, + { color: '#000000', stop: 100 }, + { color: '#000000', stop: 150 }, + ], + continuity: 'below', + maxSteps: 5, + name: 'custom', + progression: 'fixed', + rangeMax: 200, + rangeMin: -Infinity, + rangeType: 'number', + reverse: false, + steps: 4, + stops: [ + { color: '#000000', stop: 100 }, + { color: '#000000', stop: 150 }, + { color: '#000000', stop: 200 }, + ], + }, + type: 'palette', + }); + }); + + test('should return custom palette if last one is lte and all previous are gte', () => { + expect(getPalette([])).toBeUndefined(); + expect( + getPalette([ + ...invalidRules, + { id: 'some-id-5', operator: 'gte', value: 100, background_color: '#000' }, + { id: 'some-id-7', operator: 'lte', value: 200, background_color: '#000' }, + { id: 'some-id-6', operator: 'gte', value: 150, background_color: '#000' }, + ]) + ).toEqual({ + name: 'custom', + params: { + colorStops: [ + { color: '#000000', stop: 100 }, + { color: '#000000', stop: 150 }, + ], + continuity: 'none', + maxSteps: 5, + name: 'custom', + progression: 'fixed', + rangeMax: 200, + rangeMin: 100, + rangeType: 'number', + reverse: false, + steps: 2, + stops: [ + { color: '#000000', stop: 150 }, + { color: '#000000', stop: 200 }, + ], + }, + type: 'palette', + }); + }); + }); + + describe('Gauge', () => { + test('should return undefined if no filled rules was provided', () => { + expect(getPalette([], baseColor)).toBeUndefined(); + expect(getPalette(invalidRules, baseColor)).toBeUndefined(); + }); + + test('should return undefined if only one valid rule is provided and it is not lte', () => { + expect(getPalette([], baseColor)).toBeUndefined(); + expect( + getPalette( + [...invalidRules, { id: 'some-id-5', operator: 'gt', value: 100, gauge: '#000' }], + baseColor + ) + ).toBeUndefined(); + }); + + test('should return custom palette if only one valid rule is provided and it is lte', () => { + expect(getPalette([], baseColor)).toBeUndefined(); + expect( + getPalette( + [...invalidRules, { id: 'some-id-5', operator: 'lte', value: 100, gauge: '#000' }], + baseColor + ) + ).toEqual({ + name: 'custom', + params: { + colorStops: [{ color: '#000000', stop: 100 }], + continuity: 'below', + maxSteps: 5, + name: 'custom', + progression: 'fixed', + rangeMax: 100, + rangeMin: -Infinity, + rangeType: 'number', + reverse: false, + steps: 1, + stops: [{ color: '#000000', stop: 100 }], + }, + type: 'palette', + }); + }); + + test('should return undefined if more than two types of rules', () => { + expect(getPalette([], baseColor)).toBeUndefined(); + expect( + getPalette( + [ + ...invalidRules, + { id: 'some-id-5', operator: 'lte', value: 100, gauge: '#000' }, + { id: 'some-id-6', operator: 'gte', value: 150, gauge: '#000' }, + { id: 'some-id-7', operator: 'lt', value: 200, gauge: '#000' }, + ], + baseColor + ) + ).toBeUndefined(); + }); + + test('should return undefined if two types of rules and last rule is not lte', () => { + expect(getPalette([], baseColor)).toBeUndefined(); + expect( + getPalette( + [ + ...invalidRules, + { id: 'some-id-5', operator: 'gte', value: 100, gauge: '#000' }, + { id: 'some-id-7', operator: 'lt', value: 200, gauge: '#000' }, + { id: 'some-id-6', operator: 'gte', value: 150, gauge: '#000' }, + ], + baseColor + ) + ).toBeUndefined(); + }); + + test('should return undefined if all rules are lte', () => { + expect(getPalette([], baseColor)).toBeUndefined(); + expect( + getPalette( + [ + ...invalidRules, + { id: 'some-id-5', operator: 'lte', value: 100, gauge: '#000' }, + { id: 'some-id-7', operator: 'lte', value: 200, gauge: '#000' }, + { id: 'some-id-6', operator: 'lte', value: 150, gauge: '#000' }, + ], + baseColor + ) + ).toBeUndefined(); + }); + + test('should return undefined if two types of rules and all except last one are lt and last one is not lte', () => { + expect(getPalette([], baseColor)).toBeUndefined(); + expect( + getPalette( + [ + ...invalidRules, + { id: 'some-id-5', operator: 'lt', value: 100, gauge: '#000' }, + { id: 'some-id-7', operator: 'gte', value: 200, gauge: '#000' }, + { id: 'some-id-6', operator: 'lt', value: 150, gauge: '#000' }, + ], + baseColor + ) + ).toBeUndefined(); + }); + + test('should return custom palette if two types of rules and all except last one is lt and last one is lte', () => { + expect(getPalette([], baseColor)).toBeUndefined(); + expect( + getPalette( + [ + ...invalidRules, + { id: 'some-id-5', operator: 'lt', value: 100, gauge: '#000' }, + { id: 'some-id-7', operator: 'lte', value: 200, gauge: '#000' }, + { id: 'some-id-6', operator: 'lt', value: 150, gauge: '#000' }, + ], + baseColor + ) + ).toEqual({ + name: 'custom', + params: { + colorStops: [ + { color: '#000000', stop: -Infinity }, + { color: '#000000', stop: 100 }, + { color: '#000000', stop: 150 }, + ], + continuity: 'below', + maxSteps: 5, + name: 'custom', + progression: 'fixed', + rangeMax: 200, + rangeMin: -Infinity, + rangeType: 'number', + reverse: false, + steps: 4, + stops: [ + { color: '#000000', stop: 100 }, + { color: '#000000', stop: 150 }, + { color: '#000000', stop: 200 }, + ], + }, + type: 'palette', + }); + }); + + test('should return custom palette if last one is lte and all previous are gte', () => { + expect(getPalette([], baseColor)).toBeUndefined(); + expect( + getPalette( + [ + ...invalidRules, + { id: 'some-id-5', operator: 'gte', value: 100, gauge: '#000' }, + { id: 'some-id-7', operator: 'lte', value: 200, gauge: '#000' }, + { id: 'some-id-6', operator: 'gte', value: 150, gauge: '#000' }, + ], + baseColor + ) + ).toEqual({ + name: 'custom', + params: { + colorStops: [ + { color: baseColor, stop: -Infinity }, + { color: '#000000', stop: 100 }, + { color: '#000000', stop: 150 }, + ], + continuity: 'below', + maxSteps: 5, + name: 'custom', + progression: 'fixed', + rangeMax: 200, + rangeMin: -Infinity, + rangeType: 'number', + reverse: false, + steps: 3, + stops: [ + { color: baseColor, stop: 100 }, + { color: '#000000', stop: 150 }, + { color: '#000000', stop: 200 }, + ], + }, + type: 'palette', + }); + }); + }); +}); diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/palette/index.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/palette/index.ts new file mode 100644 index 0000000000000..159804a1ea29b --- /dev/null +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/palette/index.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import color from 'color'; +import { ColorStop, CustomPaletteParams, PaletteOutput } from '@kbn/coloring'; +import { uniqBy } from 'lodash'; +import { Panel, Series } from '../../../../../common/types'; + +const Operators = { + GTE: 'gte', + GT: 'gt', + LTE: 'lte', + LT: 'lt', +} as const; + +type ColorStopsWithMinMax = Pick< + CustomPaletteParams, + 'colorStops' | 'stops' | 'steps' | 'rangeMax' | 'rangeMin' | 'continuity' +>; + +type MetricColorRules = Exclude<Panel['background_color_rules'], undefined>; +type GaugeColorRules = Exclude<Panel['gauge_color_rules'], undefined>; +type SeriesColorRules = Exclude<Series['color_rules'], undefined>; + +type MetricColorRule = MetricColorRules[number]; +type GaugeColorRule = GaugeColorRules[number]; +type SeriesColorRule = SeriesColorRules[number]; + +type ValidMetricColorRule = Omit<MetricColorRule, 'background_color' | 'color'> & + ( + | { + background_color: Exclude<MetricColorRule['background_color'], undefined>; + color: MetricColorRule['color']; + } + | { + background_color: MetricColorRule['background_color']; + color: Exclude<MetricColorRule['color'], undefined>; + } + ); + +type ValidGaugeColorRule = Omit<GaugeColorRule, 'gauge'> & { + gauge: Exclude<GaugeColorRule['gauge'], undefined>; +}; + +type ValidSeriesColorRule = Omit<SeriesColorRule, 'text'> & { + text: Exclude<SeriesColorRule['text'], undefined>; +}; + +const isValidColorRule = ( + rule: MetricColorRule | GaugeColorRule +): rule is ValidMetricColorRule | ValidGaugeColorRule | ValidSeriesColorRule => { + const { background_color: bColor, color: textColor } = rule as MetricColorRule; + const { gauge } = rule as GaugeColorRule; + const { text } = rule as SeriesColorRule; + + return Boolean( + rule.operator && (bColor ?? textColor ?? gauge ?? text) && rule.value !== undefined + ); +}; + +const isMetricColorRule = ( + rule: ValidMetricColorRule | ValidGaugeColorRule | ValidSeriesColorRule +): rule is ValidMetricColorRule => { + const metricRule = rule as ValidMetricColorRule; + return metricRule.background_color ?? metricRule.color ? true : false; +}; + +const isGaugeColorRule = ( + rule: ValidMetricColorRule | ValidGaugeColorRule | ValidSeriesColorRule +): rule is ValidGaugeColorRule => { + const metricRule = rule as ValidGaugeColorRule; + return Boolean(metricRule.gauge); +}; + +const getColor = (rule: ValidMetricColorRule | ValidGaugeColorRule | ValidSeriesColorRule) => { + if (isMetricColorRule(rule)) { + return rule.background_color ?? rule.color; + } else if (isGaugeColorRule(rule)) { + return rule.gauge; + } + return rule.text; +}; + +const getColorStopsWithMinMaxForAllGteOrWithLte = ( + rules: Array<ValidMetricColorRule | ValidGaugeColorRule | ValidSeriesColorRule>, + tailOperator: string, + baseColor?: string +): ColorStopsWithMinMax => { + const lastRule = rules[rules.length - 1]; + const lastRuleColor = getColor(lastRule); + const initRules = baseColor ? [{ stop: -Infinity, color: baseColor }] : []; + const colorStops = rules.reduce<ColorStop[]>((colors, rule, index, rulesArr) => { + const rgbColor = getColor(rule); + if (index === rulesArr.length - 1 && tailOperator === Operators.LTE) { + return colors; + } + // if last operation is LTE, color of gte should be replaced by lte + if (index === rulesArr.length - 2 && tailOperator === Operators.LTE) { + return [ + ...colors, + { + color: color(lastRuleColor).hex(), + stop: rule.value!, + }, + ]; + } + return [ + ...colors, + { + color: color(rgbColor).hex(), + stop: rule.value!, + }, + ]; + }, initRules); + + const stops = colorStops.reduce<ColorStop[]>((prevStops, colorStop, index, colorStopsArr) => { + if (index === colorStopsArr.length - 1) { + return [ + ...prevStops, + { + color: colorStop.color, + stop: tailOperator === Operators.LTE ? lastRule.value! : colorStop.stop + 1, + }, + ]; + } + return [...prevStops, { color: colorStop.color, stop: colorStopsArr[index + 1].stop }]; + }, []); + + const [rule] = rules; + return { + rangeMin: baseColor ? -Infinity : rule.value, + rangeMax: tailOperator === Operators.LTE ? lastRule.value : Infinity, + colorStops, + stops, + steps: colorStops.length, + continuity: + tailOperator === Operators.LTE ? (baseColor ? 'below' : 'none') : baseColor ? 'all' : 'above', + }; +}; + +const getColorStopsWithMinMaxForLtWithLte = ( + rules: Array<ValidMetricColorRule | ValidGaugeColorRule | ValidSeriesColorRule> +): ColorStopsWithMinMax => { + const lastRule = rules[rules.length - 1]; + const colorStops = rules.reduce<ColorStop[]>((colors, rule, index, rulesArr) => { + if (index === 0) { + return [{ color: color(getColor(rule)).hex(), stop: -Infinity }]; + } + const rgbColor = getColor(rule); + return [ + ...colors, + { + color: color(rgbColor).hex(), + stop: rulesArr[index - 1].value!, + }, + ]; + }, []); + + const stops = colorStops.reduce<ColorStop[]>((prevStops, colorStop, index, colorStopsArr) => { + if (index === colorStopsArr.length - 1) { + return [ + ...prevStops, + { + color: colorStop.color, + stop: lastRule.value!, + }, + ]; + } + return [...prevStops, { color: colorStop.color, stop: colorStopsArr[index + 1].stop }]; + }, []); + + return { + rangeMin: -Infinity, + rangeMax: lastRule.value, + colorStops, + stops, + steps: colorStops.length + 1, + continuity: 'below', + }; +}; + +const getColorStopWithMinMaxForLte = ( + rule: ValidMetricColorRule | ValidGaugeColorRule | ValidSeriesColorRule +): ColorStopsWithMinMax => { + const colorStop = { + color: color(getColor(rule)).hex(), + stop: rule.value!, + }; + return { + rangeMin: -Infinity, + rangeMax: rule.value!, + colorStops: [colorStop], + stops: [colorStop], + steps: 1, + continuity: 'below', + }; +}; + +const getColorStopWithMinMaxForGte = ( + rule: ValidMetricColorRule | ValidGaugeColorRule | ValidSeriesColorRule, + baseColor?: string +): ColorStopsWithMinMax => { + const colorStop = { + color: color(getColor(rule)).hex(), + stop: rule.value!, + }; + return { + colorStops: [...(baseColor ? [{ color: baseColor, stop: -Infinity }] : []), colorStop], + continuity: baseColor ? 'all' : 'above', + rangeMax: Infinity, + rangeMin: baseColor ? -Infinity : colorStop.stop, + steps: 2, + stops: [ + ...(baseColor ? [{ color: baseColor, stop: colorStop.stop }] : []), + { color: colorStop.color, stop: Infinity }, + ], + }; +}; + +const getCustomPalette = ( + colorStopsWithMinMax: ColorStopsWithMinMax +): PaletteOutput<CustomPaletteParams> => { + return { + name: 'custom', + params: { + continuity: 'all', + maxSteps: 5, + name: 'custom', + progression: 'fixed', + rangeMax: Infinity, + rangeMin: -Infinity, + rangeType: 'number', + reverse: false, + ...colorStopsWithMinMax, + }, + type: 'palette', + }; +}; + +export const getPalette = ( + rules: MetricColorRules | GaugeColorRules | SeriesColorRules, + baseColor?: string +): PaletteOutput<CustomPaletteParams> | null | undefined => { + const validRules = (rules as Array<MetricColorRule | GaugeColorRule | SeriesColorRule>).filter< + ValidMetricColorRule | ValidGaugeColorRule | ValidSeriesColorRule + >((rule): rule is ValidMetricColorRule | ValidGaugeColorRule | ValidSeriesColorRule => + isValidColorRule(rule) + ); + + validRules.sort((rule1, rule2) => { + return rule1.value! - rule2.value!; + }); + + const kindOfRules = uniqBy(validRules, 'operator'); + + if (!kindOfRules.length) { + return; + } + + // lnsMetric is supporting lte only, if one rule is defined + if (validRules.length === 1) { + if (validRules[0].operator === Operators.LTE) { + return getCustomPalette(getColorStopWithMinMaxForLte(validRules[0])); + } + + if (validRules[0].operator === Operators.GTE) { + return getCustomPalette(getColorStopWithMinMaxForGte(validRules[0], baseColor)); + } + return; + } + + const headRules = validRules.slice(0, -1); + const tailRule = validRules[validRules.length - 1]; + const kindOfHeadRules = uniqBy(headRules, 'operator'); + + if ( + kindOfHeadRules.length > 1 || + (kindOfHeadRules[0].operator !== tailRule.operator && tailRule.operator !== Operators.LTE) + ) { + return; + } + + const [rule] = kindOfHeadRules; + + if (rule.operator === Operators.LTE) { + return; + } + + if (rule.operator === Operators.LT) { + if (tailRule.operator !== Operators.LTE) { + return; + } + return getCustomPalette(getColorStopsWithMinMaxForLtWithLte(validRules)); + } + + if (rule.operator === Operators.GTE) { + return getCustomPalette( + getColorStopsWithMinMaxForAllGteOrWithLte(validRules, tailRule.operator!, baseColor) + ); + } +}; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/table/index.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/table/index.test.ts new file mode 100644 index 0000000000000..6deeaaa39fb8f --- /dev/null +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/table/index.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createSeries } from '../../__mocks__'; +import { getColumnState } from '.'; + +const mockGetPalette = jest.fn(); + +jest.mock('../palette', () => ({ + getPalette: jest.fn(() => mockGetPalette()), +})); + +describe('getColumnState', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockGetPalette.mockReturnValue({ id: 'custom' }); + }); + + test('should return column state without palette if series is not provided', () => { + const config = getColumnState('test'); + expect(config).toEqual({ + columnId: 'test', + alignment: 'left', + colorMode: 'none', + }); + expect(mockGetPalette).toBeCalledTimes(0); + }); + + test('should return column state with palette if series is provided', () => { + const config = getColumnState('test', undefined, createSeries()); + expect(config).toEqual({ + columnId: 'test', + alignment: 'left', + colorMode: 'text', + palette: { id: 'custom' }, + }); + expect(mockGetPalette).toBeCalledTimes(1); + }); + + test('should return column state with collapseFn if collapseFn is provided', () => { + const config = getColumnState('test', 'max', createSeries()); + expect(config).toEqual({ + columnId: 'test', + alignment: 'left', + colorMode: 'text', + palette: { id: 'custom' }, + collapseFn: 'max', + }); + expect(mockGetPalette).toBeCalledTimes(1); + }); +}); diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/table/index.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/table/index.ts new file mode 100644 index 0000000000000..7f152fa218842 --- /dev/null +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/configurations/table/index.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Series } from '../../../../../common/types'; +import { getPalette } from '../palette'; + +export const getColumnState = (columnId: string, collapseFn?: string, series?: Series) => { + const palette = series ? getPalette(series.color_rules ?? []) : undefined; + return { + columnId, + alignment: 'left' as const, + colorMode: palette ? 'text' : 'none', + ...(palette ? { palette } : {}), + ...(collapseFn ? { collapseFn } : {}), + }; +}; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/column.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/column.ts index c06cc3e722279..2be4e09bf8898 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/column.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/column.ts @@ -32,7 +32,7 @@ interface ExtraColumnFields { const isSupportedFormat = (format: string) => ['bytes', 'number', 'percent'].includes(format); -export const getFormat = (series: Series): FormatParams => { +export const getFormat = (series: Pick<Series, 'formatter' | 'value_template'>): FormatParams => { let suffix; if (!series.formatter || series.formatter === 'default') { diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/date_histogram.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/date_histogram.ts index f2173cf56b469..0887ad1168ddf 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/date_histogram.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/date_histogram.ts @@ -9,28 +9,36 @@ import type { DataView } from '@kbn/data-views-plugin/common'; import uuid from 'uuid'; import { DateHistogramParams, DataType } from '@kbn/visualizations-plugin/common/convert_to_lens'; -import { DateHistogramColumn } from './types'; -import type { Panel, Series } from '../../../../common/types'; +import { DateHistogramColumn, DateHistogramSeries } from './types'; +import type { Panel } from '../../../../common/types'; const getInterval = (interval?: string) => { return interval && !interval?.includes('=') ? interval : 'auto'; }; -export const convertToDateHistogramParams = (model: Panel, series: Series): DateHistogramParams => { +export const convertToDateHistogramParams = ( + model: Panel | undefined, + series: DateHistogramSeries, + includeEmptyRows: boolean = true +): DateHistogramParams => { return { - interval: getInterval(series.override_index_pattern ? series.series_interval : model.interval), + interval: getInterval(series.override_index_pattern ? series.series_interval : model?.interval), dropPartials: series.override_index_pattern ? series.series_drop_last_bucket > 0 - : model.drop_last_bucket > 0, - includeEmptyRows: true, + : (model?.drop_last_bucket ?? 0) > 0, + includeEmptyRows, }; }; export const convertToDateHistogramColumn = ( - model: Panel, - series: Series, + model: Panel | undefined, + series: DateHistogramSeries, dataView: DataView, - { fieldName, isSplit }: { fieldName: string; isSplit: boolean } + { + fieldName, + isSplit, + includeEmptyRows = true, + }: { fieldName: string; isSplit: boolean; includeEmptyRows?: boolean } ): DateHistogramColumn | null => { const dateField = dataView.getFieldByName(fieldName); @@ -38,7 +46,7 @@ export const convertToDateHistogramColumn = ( return null; } - const params = convertToDateHistogramParams(model, series); + const params = convertToDateHistogramParams(model, series, includeEmptyRows); return { columnId: uuid(), diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/filters.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/filters.ts index 9134504813b68..05d74337e848d 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/filters.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/filters.ts @@ -8,10 +8,9 @@ import uuid from 'uuid'; import { FiltersParams } from '@kbn/visualizations-plugin/common/convert_to_lens'; -import { FiltersColumn } from './types'; -import type { Series } from '../../../../common/types'; +import { FiltersColumn, FiltersSeries } from './types'; -export const convertToFiltersParams = (series: Series): FiltersParams => { +export const convertToFiltersParams = (series: FiltersSeries): FiltersParams => { const splitFilters = []; if (series.split_mode === 'filter' && series.filter) { splitFilters.push({ filter: series.filter }); @@ -35,7 +34,10 @@ export const convertToFiltersParams = (series: Series): FiltersParams => { }; }; -export const convertToFiltersColumn = (series: Series, isSplit: boolean): FiltersColumn | null => { +export const convertToFiltersColumn = ( + series: FiltersSeries, + isSplit: boolean +): FiltersColumn | null => { const params = convertToFiltersParams(series); if (!params.filters.length) { return null; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/static_value.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/static_value.test.ts index 907fe458c6a64..5d6dc036a7bd0 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/static_value.test.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/static_value.test.ts @@ -47,6 +47,11 @@ describe('convertToStaticValueColumn', () => { [{ series, metrics: [metric], dataView }, { visibleSeriesCount: 1 }], null, ], + [ + 'null if value is not specified', + [{ series, metrics: [metric], dataView }, { visibleSeriesCount: 2 }], + null, + ], [ 'static value column', [{ series, metrics: [{ ...metric, value: 'some value' }], dataView }], diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/static_value.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/static_value.ts index d3e6aef09b1cf..7990107bb5bf9 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/static_value.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/static_value.ts @@ -32,6 +32,9 @@ export const convertToStaticValueColumn = ( return null; } const currentMetric = metrics[metrics.length - 1]; + if (!currentMetric.value) { + return null; + } return { operationType: 'static_value', references: [], @@ -68,7 +71,10 @@ export const convertStaticValueToFormulaColumn = ( return null; } const currentMetric = metrics[metrics.length - 1]; - return createFormulaColumn(currentMetric.value ?? '', { + if (!currentMetric.value) { + return null; + } + return createFormulaColumn(currentMetric.value, { series, metric: currentMetric, dataView, diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/terms.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/terms.ts index 977de1947d4f8..c31d8dca68ced 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/terms.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/terms.ts @@ -9,16 +9,15 @@ import type { DataView } from '@kbn/data-views-plugin/common'; import { DataType, TermsParams } from '@kbn/visualizations-plugin/common'; import uuid from 'uuid'; -import { Series } from '../../../../common/types'; import { excludeMetaFromColumn, getFormat, isColumnWithMeta } from './column'; -import { Column, TermsColumn } from './types'; +import { Column, TermsColumn, TermsSeries } from './types'; interface OrderByWithAgg { orderAgg?: TermsParams['orderAgg']; orderBy: TermsParams['orderBy']; } -const getOrderByWithAgg = (series: Series, columns: Column[]): OrderByWithAgg | null => { +const getOrderByWithAgg = (series: TermsSeries, columns: Column[]): OrderByWithAgg | null => { if (series.terms_order_by === '_key') { return { orderBy: { type: 'alphabetical' } }; } @@ -56,7 +55,7 @@ const getOrderByWithAgg = (series: Series, columns: Column[]): OrderByWithAgg | }; export const convertToTermsParams = ( - series: Series, + series: TermsSeries, columns: Column[], secondaryFields: string[] ): TermsParams | null => { @@ -84,10 +83,11 @@ export const convertToTermsParams = ( export const convertToTermsColumn = ( termFields: [string, ...string[]], - series: Series, + series: TermsSeries, columns: Column[], dataView: DataView, - isSplit: boolean = false + isSplit: boolean = false, + label?: string ): TermsColumn | null => { const [baseField, ...secondaryFields] = termFields; const field = dataView.getFieldByName(baseField); @@ -108,6 +108,7 @@ export const convertToTermsColumn = ( sourceField: field.name, isBucketed: true, isSplit, + label, params: { ...params, ...getFormat(series) }, }; }; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/types.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/types.ts index 4b3b6c582f915..8c5a8660a4926 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/types.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/types.ts @@ -117,4 +117,24 @@ export interface CommonColumnConverterArgs { dataView: DataView; } -export { FiltersColumn, TermsColumn, DateHistogramColumn }; +export type TermsSeries = Pick< + Series, + | 'split_mode' + | 'terms_direction' + | 'terms_order_by' + | 'terms_size' + | 'terms_include' + | 'terms_exclude' + | 'terms_field' + | 'formatter' + | 'value_template' +>; + +export type FiltersSeries = Pick<Series, 'split_mode' | 'filter' | 'split_filters'>; + +export type DateHistogramSeries = Pick< + Series, + 'split_mode' | 'override_index_pattern' | 'series_interval' | 'series_drop_last_bucket' +>; + +export type { FiltersColumn, TermsColumn, DateHistogramColumn }; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/metrics/supported_metrics.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/metrics/supported_metrics.ts index debe064940c8e..a2130de36abd4 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/metrics/supported_metrics.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/metrics/supported_metrics.ts @@ -68,6 +68,7 @@ const supportedPanelTypes: readonly PANEL_TYPES[] = [ PANEL_TYPES.TOP_N, PANEL_TYPES.METRIC, PANEL_TYPES.GAUGE, + PANEL_TYPES.TABLE, ]; const supportedTimeRangeModes: readonly TIME_RANGE_DATA_MODES[] = [ diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/series/buckets_columns.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/series/buckets_columns.ts index c0aa201de6837..8ca184d443a68 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/series/buckets_columns.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/series/buckets_columns.ts @@ -7,18 +7,21 @@ */ import type { DataView } from '@kbn/data-views-plugin/common'; -import { Series, Panel } from '../../../../common/types'; +import { Panel } from '../../../../common/types'; import { getFieldsForTerms } from '../../../../common/fields_utils'; import { Column, convertToFiltersColumn, convertToDateHistogramColumn, convertToTermsColumn, + TermsSeries, + FiltersSeries, + DateHistogramSeries, } from '../convert'; import { getValidColumns } from './columns'; export const isSplitWithDateHistogram = ( - series: Series, + series: TermsSeries, splitFields: string[], dataView: DataView ) => { @@ -39,27 +42,49 @@ export const isSplitWithDateHistogram = ( return false; }; +const isFiltersSeries = ( + series: DateHistogramSeries | TermsSeries | FiltersSeries +): series is FiltersSeries => { + return series.split_mode === 'filters' || series.split_mode === 'filter'; +}; + +const isTermsSeries = ( + series: DateHistogramSeries | TermsSeries | FiltersSeries +): series is TermsSeries => { + return series.split_mode === 'terms'; +}; + +const isDateHistogramSeries = ( + series: DateHistogramSeries | TermsSeries | FiltersSeries, + isDateHistogram: boolean +): series is DateHistogramSeries => { + return isDateHistogram && series.split_mode === 'terms'; +}; + export const getBucketsColumns = ( - model: Panel, - series: Series, + model: Panel | undefined, + series: DateHistogramSeries | TermsSeries | FiltersSeries, columns: Column[], dataView: DataView, - isSplit: boolean = false + isSplit: boolean = false, + label?: string, + includeEmptyRowsForDateHistogram: boolean = true ) => { - if (series.split_mode === 'filters' || series.split_mode === 'filter') { + if (isFiltersSeries(series)) { const filterColumn = convertToFiltersColumn(series, true); return getValidColumns([filterColumn]); } - if (series.split_mode === 'terms') { + if (isTermsSeries(series)) { const splitFields = getFieldsForTerms(series.terms_field); const isDateHistogram = isSplitWithDateHistogram(series, splitFields, dataView); if (isDateHistogram === null) { return null; } - if (isDateHistogram) { + if (isDateHistogramSeries(series, isDateHistogram)) { const dateHistogramColumn = convertToDateHistogramColumn(model, series, dataView, { fieldName: splitFields[0], isSplit: true, + includeEmptyRows: includeEmptyRowsForDateHistogram, }); return getValidColumns(dateHistogramColumn); } @@ -73,7 +98,8 @@ export const getBucketsColumns = ( series, columns, dataView, - isSplit + isSplit, + label ); return getValidColumns(termsColumn); } diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/metric/index.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/metric/index.test.ts index 9407599573d9d..6d62994be4447 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/metric/index.test.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/metric/index.test.ts @@ -6,10 +6,12 @@ * Side Public License, v 1. */ +import { Vis } from '@kbn/visualizations-plugin/public'; import { METRIC_TYPES } from '@kbn/data-plugin/public'; import { stubLogstashDataView } from '@kbn/data-views-plugin/common/data_view.stub'; import { convertToLens } from '.'; import { createPanel, createSeries } from '../lib/__mocks__'; +import { Panel } from '../../../common/types'; const mockGetMetricsColumns = jest.fn(); const mockGetBucketsColumns = jest.fn(); @@ -54,6 +56,10 @@ describe('convertToLens', () => { ], }); + const vis = { + params: model, + } as Vis<Panel>; + const bucket = { isBucketed: true, isSplit: true, @@ -135,27 +141,27 @@ describe('convertToLens', () => { test('should return null for invalid metrics', async () => { mockIsValidMetrics.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockIsValidMetrics).toBeCalledTimes(1); }); test('should return null for invalid or unsupported metrics', async () => { mockGetMetricsColumns.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockGetMetricsColumns).toBeCalledTimes(1); }); test('should return null for invalid or unsupported buckets', async () => { mockGetBucketsColumns.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockGetBucketsColumns).toBeCalledTimes(1); }); test('should return state for valid model', async () => { - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeDefined(); expect(result?.type).toBe('lnsMetric'); expect(mockGetBucketsColumns).toBeCalledTimes(model.series.length); @@ -163,16 +169,16 @@ describe('convertToLens', () => { }); test('should skip hidden series', async () => { - const result = await convertToLens( - createPanel({ + const result = await convertToLens({ + params: createPanel({ series: [ createSeries({ metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], hidden: true, }), ], - }) - ); + }), + } as Vis<Panel>); expect(result).toBeDefined(); expect(result?.type).toBe('lnsMetric'); expect(mockIsValidMetrics).toBeCalledTimes(0); @@ -185,8 +191,8 @@ describe('convertToLens', () => { indexPattern: { id: 'test-index-pattern-1' }, }); - const result = await convertToLens( - createPanel({ + const result = await convertToLens({ + params: createPanel({ series: [ createSeries({ metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], @@ -197,8 +203,8 @@ describe('convertToLens', () => { hidden: false, }), ], - }) - ); + }), + } as Vis<Panel>); expect(result).toBeNull(); }); @@ -207,8 +213,8 @@ describe('convertToLens', () => { mockGetBucketsColumns.mockReturnValueOnce([]); mockGetMetricsColumns.mockReturnValueOnce([metric]); - const result = await convertToLens( - createPanel({ + const result = await convertToLens({ + params: createPanel({ series: [ createSeries({ metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], @@ -219,8 +225,8 @@ describe('convertToLens', () => { hidden: false, }), ], - }) - ); + }), + } as Vis<Panel>); expect(result).toBeNull(); }); @@ -229,8 +235,8 @@ describe('convertToLens', () => { mockGetBucketsColumns.mockReturnValueOnce([bucket2]); mockGetMetricsColumns.mockReturnValueOnce([metric]); - const result = await convertToLens( - createPanel({ + const result = await convertToLens({ + params: createPanel({ series: [ createSeries({ metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], @@ -241,8 +247,8 @@ describe('convertToLens', () => { hidden: false, }), ], - }) - ); + }), + } as Vis<Panel>); expect(result).toBeNull(); }); @@ -251,8 +257,8 @@ describe('convertToLens', () => { mockGetBucketsColumns.mockReturnValueOnce([bucket]); mockGetMetricsColumns.mockReturnValueOnce([metric]); - const result = await convertToLens( - createPanel({ + const result = await convertToLens({ + params: createPanel({ series: [ createSeries({ metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], @@ -263,8 +269,8 @@ describe('convertToLens', () => { hidden: false, }), ], - }) - ); + }), + } as Vis<Panel>); expect(result).toBeDefined(); expect(result?.type).toBe('lnsMetric'); expect(mockGetConfigurationForMetric).toBeCalledTimes(1); diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/metric/index.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/metric/index.ts index 149acc513b9ff..8577623b8bd93 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/metric/index.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/metric/index.ts @@ -22,12 +22,16 @@ import { excludeMetaFromLayers, getUniqueBuckets } from '../utils'; const MAX_SERIES = 2; const MAX_BUCKETS = 2; -export const convertToLens: ConvertTsvbToLensVisualization = async (model, timeRange) => { +export const convertToLens: ConvertTsvbToLensVisualization = async ( + { params: model }, + timeRange +) => { const dataViews = getDataViewsStart(); const seriesNum = model.series.filter((series) => !series.hidden).length; const indexPatternIds = new Set(); - const visibleSeries = model.series.filter(({ hidden }) => !hidden); + // we should get max only 2 series + const visibleSeries = model.series.filter(({ hidden }) => !hidden).slice(0, 2); let currentIndexPattern: DataView | null = null; for (const series of visibleSeries) { const datasourceInfo = await getDataSourceInfo( diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/table/index.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/table/index.test.ts new file mode 100644 index 0000000000000..37676b302fba1 --- /dev/null +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/table/index.test.ts @@ -0,0 +1,235 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { TableVisConfiguration } from '@kbn/visualizations-plugin/common'; +import { Vis } from '@kbn/visualizations-plugin/public'; +import { METRIC_TYPES } from '@kbn/data-plugin/public'; +import { stubLogstashDataView } from '@kbn/data-views-plugin/common/data_view.stub'; +import { convertToLens } from '.'; +import { createPanel, createSeries } from '../lib/__mocks__'; +import { Panel } from '../../../common/types'; +import { TSVB_METRIC_TYPES } from '../../../common/enums'; + +const mockConvertToDateHistogramColumn = jest.fn(); +const mockGetMetricsColumns = jest.fn(); +const mockGetBucketsColumns = jest.fn(); +const mockGetConfigurationForTimeseries = jest.fn(); +const mockIsValidMetrics = jest.fn(); +const mockGetDatasourceValue = jest + .fn() + .mockImplementation(() => Promise.resolve(stubLogstashDataView)); +const mockGetDataSourceInfo = jest.fn(); +const mockGetColumnState = jest.fn(); + +jest.mock('../../services', () => ({ + getDataViewsStart: jest.fn(() => mockGetDatasourceValue), +})); + +jest.mock('../lib/convert', () => ({ + excludeMetaFromColumn: jest.fn().mockReturnValue({}), +})); + +jest.mock('../lib/series', () => ({ + getMetricsColumns: jest.fn(() => mockGetMetricsColumns()), + getBucketsColumns: jest.fn(() => mockGetBucketsColumns()), +})); + +jest.mock('../lib/configurations/table', () => ({ + getColumnState: jest.fn(() => mockGetColumnState()), +})); + +jest.mock('../lib/metrics', () => ({ + isValidMetrics: jest.fn(() => mockIsValidMetrics()), + getReducedTimeRange: jest.fn().mockReturnValue('10'), +})); + +jest.mock('../lib/datasource', () => ({ + getDataSourceInfo: jest.fn(() => mockGetDataSourceInfo()), +})); + +describe('convertToLens', () => { + const model = createPanel({ + series: [ + createSeries({ + metrics: [ + { id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }, + { id: 'some-id-1', type: METRIC_TYPES.COUNT }, + ], + }), + ], + }); + + const vis = { + params: model, + uiState: { + get: () => ({}), + }, + } as Vis<Panel>; + + beforeEach(() => { + mockIsValidMetrics.mockReturnValue(true); + mockGetDataSourceInfo.mockReturnValue({ + indexPatternId: 'test-index-pattern', + timeField: 'timeField', + indexPattern: { id: 'test-index-pattern' }, + }); + mockConvertToDateHistogramColumn.mockReturnValue({}); + mockGetMetricsColumns.mockReturnValue([{}]); + mockGetBucketsColumns.mockReturnValue([{}]); + mockGetConfigurationForTimeseries.mockReturnValue({ layers: [] }); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + test('should return null for invalid metrics', async () => { + mockIsValidMetrics.mockReturnValue(null); + const result = await convertToLens(vis); + expect(result).toBeNull(); + expect(mockIsValidMetrics).toBeCalledTimes(1); + }); + + test('should return null for invalid or unsupported metrics', async () => { + mockGetMetricsColumns.mockReturnValue(null); + const result = await convertToLens(vis); + expect(result).toBeNull(); + expect(mockGetMetricsColumns).toBeCalledTimes(1); + }); + + test('should return null if several series have different “Field” + “Aggregate function”', async () => { + const result = await convertToLens({ + params: createPanel({ + series: [createSeries({ aggregate_by: 'new' }), createSeries({ aggregate_by: 'test' })], + }), + uiState: { + get: () => ({}), + }, + } as Vis<Panel>); + expect(result).toBeNull(); + expect(mockGetBucketsColumns).toBeCalledTimes(1); + }); + + test('should return null if “Aggregate function” is not supported', async () => { + const result = await convertToLens({ + params: createPanel({ + series: [createSeries({ aggregate_by: 'new', aggregate_function: 'cumulative_sum' })], + }), + uiState: { + get: () => ({}), + }, + } as Vis<Panel>); + expect(result).toBeNull(); + expect(mockGetBucketsColumns).toBeCalledTimes(1); + }); + + test('should return null if model have not visible metrics', async () => { + const result = await convertToLens({ + params: createPanel({ + series: [ + createSeries({ + metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], + hidden: true, + }), + ], + }), + uiState: { + get: () => ({}), + }, + } as Vis<Panel>); + expect(result).toBeNull(); + }); + + test('should return null if only static value is visible metric', async () => { + mockGetMetricsColumns.mockReturnValue([ + { columnId: 'metric-column-1', operationType: 'static_value' }, + ]); + const result = await convertToLens({ + params: createPanel({ + series: [ + createSeries({ + metrics: [{ id: 'some-id', type: TSVB_METRIC_TYPES.STATIC }], + hidden: true, + }), + ], + }), + uiState: { + get: () => ({}), + }, + } as Vis<Panel>); + expect(result).toBeNull(); + }); + + test('should return state for valid model', async () => { + const result = await convertToLens(vis); + expect(result).toBeDefined(); + expect(result?.type).toBe('lnsDatatable'); + expect(mockGetBucketsColumns).toBeCalledTimes(1); + // every series + group by + expect(mockGetColumnState).toBeCalledTimes(model.series.length + 1); + }); + + test('should return state for valid model with “Field” + “Aggregate function”', async () => { + const result = await convertToLens({ + params: createPanel({ + series: [createSeries({ aggregate_by: 'new', aggregate_function: 'sum' })], + }), + uiState: { + get: () => ({}), + }, + } as Vis<Panel>); + expect(result).toBeDefined(); + expect(result?.type).toBe('lnsDatatable'); + expect(mockGetBucketsColumns).toBeCalledTimes(2); + // every series + group by + (“Field” + “Aggregate function”) + expect(mockGetColumnState).toBeCalledTimes(model.series.length + 2); + }); + + test('should return correct sorting config', async () => { + mockGetMetricsColumns.mockReturnValue([{ columnId: 'metric-column-1' }]); + const result = await convertToLens({ + params: createPanel({ + series: [createSeries({ id: 'test' })], + }), + uiState: { + get: () => ({ sort: { order: 'decs', column: 'test' } }), + }, + } as Vis<Panel>); + expect(result).toBeDefined(); + expect(result?.type).toBe('lnsDatatable'); + expect((result?.configuration as TableVisConfiguration).sorting).toEqual({ + direction: 'decs', + columnId: 'metric-column-1', + }); + expect(mockGetBucketsColumns).toBeCalledTimes(1); + // every series + group by + expect(mockGetColumnState).toBeCalledTimes(model.series.length + 1); + }); + + test('should skip hidden series', async () => { + const result = await convertToLens({ + params: createPanel({ + series: [ + createSeries({ + metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], + hidden: true, + }), + createSeries({ + metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], + }), + ], + }), + uiState: { + get: () => ({}), + }, + } as Vis<Panel>); + expect(result).toBeDefined(); + expect(result?.type).toBe('lnsDatatable'); + expect(mockIsValidMetrics).toBeCalledTimes(1); + }); +}); diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/table/index.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/table/index.ts new file mode 100644 index 0000000000000..0219d1080724b --- /dev/null +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/table/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import uuid from 'uuid'; +import { parseTimeShift } from '@kbn/data-plugin/common'; +import { getIndexPatternIds, Layer } from '@kbn/visualizations-plugin/common/convert_to_lens'; +import { PANEL_TYPES } from '../../../common/enums'; +import { getDataViewsStart } from '../../services'; +import { getColumnState } from '../lib/configurations/table'; +import { getDataSourceInfo } from '../lib/datasource'; +import { getMetricsColumns, getBucketsColumns } from '../lib/series'; +import { getReducedTimeRange, isValidMetrics } from '../lib/metrics'; +import { ConvertTsvbToLensVisualization } from '../types'; +import { Layer as ExtendedLayer, excludeMetaFromColumn, Column } from '../lib/convert'; + +const excludeMetaFromLayers = (layers: Record<string, ExtendedLayer>): Record<string, Layer> => { + const newLayers: Record<string, Layer> = {}; + Object.entries(layers).forEach(([layerId, layer]) => { + const columns = layer.columns.map(excludeMetaFromColumn); + newLayers[layerId] = { ...layer, columns }; + }); + + return newLayers; +}; + +export const convertToLens: ConvertTsvbToLensVisualization = async ( + { params: model, uiState }, + timeRange +) => { + const columnStates = []; + const dataViews = getDataViewsStart(); + const seriesNum = model.series.filter((series) => !series.hidden).length; + const sortConfig = uiState.get('table')?.sort ?? {}; + + const datasourceInfo = await getDataSourceInfo( + model.index_pattern, + model.time_field, + false, + undefined, + undefined, + dataViews + ); + + if (!datasourceInfo) { + return null; + } + + const { indexPatternId, indexPattern } = datasourceInfo; + + const commonBucketsColumns = getBucketsColumns( + undefined, + { + split_mode: 'terms', + terms_field: model.pivot_id, + terms_size: model.pivot_rows ? model.pivot_rows.toString() : undefined, + }, + [], + indexPattern!, + false, + model.pivot_label, + false + ); + + if (!commonBucketsColumns) { + return null; + } + + const sortConfiguration = { + columnId: commonBucketsColumns[0].columnId, + direction: sortConfig.order, + }; + + columnStates.push(getColumnState(commonBucketsColumns[0].columnId)); + + let bucketsColumns: Column[] | null = []; + + if ( + !model.series.every( + (s) => + ((!s.aggregate_by && !model.series[0].aggregate_by) || + s.aggregate_by === model.series[0].aggregate_by) && + ((!s.aggregate_function && !model.series[0].aggregate_function) || + s.aggregate_function === model.series[0].aggregate_function) + ) + ) { + return null; + } + + if (model.series[0].aggregate_by) { + if ( + !model.series[0].aggregate_function || + !['sum', 'mean', 'min', 'max'].includes(model.series[0].aggregate_function) + ) { + return null; + } + bucketsColumns = getBucketsColumns( + undefined, + { + split_mode: 'terms', + terms_field: model.series[0].aggregate_by, + }, + [], + indexPattern!, + false + ); + if (bucketsColumns === null) { + return null; + } + + columnStates.push( + getColumnState( + bucketsColumns[0].columnId, + model.series[0].aggregate_function === 'mean' ? 'avg' : model.series[0].aggregate_function + ) + ); + } + + const metrics = []; + + // handle multiple layers/series + for (const [_, series] of model.series.entries()) { + if (series.hidden) { + continue; + } + + // not valid time shift + if (series.offset_time && parseTimeShift(series.offset_time) === 'invalid') { + return null; + } + + if (!isValidMetrics(series.metrics, PANEL_TYPES.TABLE, series.time_range_mode)) { + return null; + } + + const reducedTimeRange = getReducedTimeRange(model, series, timeRange); + + // handle multiple metrics + const metricsColumns = getMetricsColumns(series, indexPattern!, seriesNum, { + reducedTimeRange, + }); + if (!metricsColumns) { + return null; + } + + columnStates.push(getColumnState(metricsColumns[0].columnId, undefined, series)); + + if (sortConfig.column === series.id) { + sortConfiguration.columnId = metricsColumns[0].columnId; + } + + metrics.push(...metricsColumns); + } + + if (!metrics.length || metrics.every((metric) => metric.operationType === 'static_value')) { + return null; + } + + const extendedLayer: ExtendedLayer = { + indexPatternId: indexPatternId as string, + layerId: uuid(), + columns: [...metrics, ...commonBucketsColumns, ...bucketsColumns], + columnOrder: [], + }; + + const layers = Object.values(excludeMetaFromLayers({ 0: extendedLayer })); + + return { + type: 'lnsDatatable', + layers, + configuration: { + columns: columnStates, + layerId: extendedLayer.layerId, + layerType: 'data', + sorting: sortConfiguration, + }, + indexPatternIds: getIndexPatternIds(layers), + }; +}; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/timeseries/index.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/timeseries/index.test.ts index c81db38e05384..64fee3484b3b6 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/timeseries/index.test.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/timeseries/index.test.ts @@ -6,10 +6,12 @@ * Side Public License, v 1. */ +import { Vis } from '@kbn/visualizations-plugin/public'; import { METRIC_TYPES } from '@kbn/data-plugin/public'; import { stubLogstashDataView } from '@kbn/data-views-plugin/common/data_view.stub'; import { convertToLens } from '.'; import { createPanel, createSeries } from '../lib/__mocks__'; +import { Panel } from '../../../common/types'; const mockConvertToDateHistogramColumn = jest.fn(); const mockGetMetricsColumns = jest.fn(); @@ -60,6 +62,10 @@ describe('convertToLens', () => { ], }); + const vis = { + params: model, + } as Vis<Panel>; + beforeEach(() => { mockIsValidMetrics.mockReturnValue(true); mockGetDataSourceInfo.mockReturnValue({ @@ -79,35 +85,35 @@ describe('convertToLens', () => { test('should return null for invalid metrics', async () => { mockIsValidMetrics.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockIsValidMetrics).toBeCalledTimes(1); }); test('should return null for empty time field', async () => { mockGetDataSourceInfo.mockReturnValue({ timeField: null }); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockGetDataSourceInfo).toBeCalledTimes(1); }); test('should return null for invalid date histogram', async () => { mockConvertToDateHistogramColumn.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockConvertToDateHistogramColumn).toBeCalledTimes(1); }); test('should return null for invalid or unsupported metrics', async () => { mockGetMetricsColumns.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockGetMetricsColumns).toBeCalledTimes(1); }); test('should return null for invalid or unsupported buckets', async () => { mockGetBucketsColumns.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockGetBucketsColumns).toBeCalledTimes(1); }); @@ -119,14 +125,14 @@ describe('convertToLens', () => { operationType: 'static_value', }, ]); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockGetMetricsColumns).toBeCalledTimes(1); expect(mockGetBucketsColumns).toBeCalledTimes(1); }); test('should return state for valid model', async () => { - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeDefined(); expect(result?.type).toBe('lnsXY'); expect(mockGetBucketsColumns).toBeCalledTimes(model.series.length); @@ -134,16 +140,16 @@ describe('convertToLens', () => { }); test('should skip hidden series', async () => { - const result = await convertToLens( - createPanel({ + const result = await convertToLens({ + params: createPanel({ series: [ createSeries({ metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], hidden: true, }), ], - }) - ); + }), + } as Vis<Panel>); expect(result).toBeDefined(); expect(result?.type).toBe('lnsXY'); expect(mockIsValidMetrics).toBeCalledTimes(0); diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/timeseries/index.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/timeseries/index.ts index ef678fcc2dab4..a08b7113c4a7b 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/timeseries/index.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/timeseries/index.ts @@ -14,7 +14,6 @@ import { } from '@kbn/visualizations-plugin/common/convert_to_lens'; import uuid from 'uuid'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import { Panel } from '../../../common/types'; import { PANEL_TYPES } from '../../../common/enums'; import { getDataViewsStart } from '../../services'; import { getDataSourceInfo } from '../lib/datasource'; @@ -41,7 +40,7 @@ const excludeMetaFromLayers = (layers: Record<string, ExtendedLayer>): Record<st return newLayers; }; -export const convertToLens: ConvertTsvbToLensVisualization = async (model: Panel) => { +export const convertToLens: ConvertTsvbToLensVisualization = async ({ params: model }) => { const dataViews: DataViewsPublicPluginStart = getDataViewsStart(); const extendedLayers: Record<number, ExtendedLayer> = {}; const seriesNum = model.series.filter((series) => !series.hidden).length; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/top_n/index.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/top_n/index.test.ts index 7e4776f10ac9f..646323a6691d5 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/top_n/index.test.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/top_n/index.test.ts @@ -6,10 +6,12 @@ * Side Public License, v 1. */ +import { Vis } from '@kbn/visualizations-plugin/public'; import { METRIC_TYPES } from '@kbn/data-plugin/public'; import { stubLogstashDataView } from '@kbn/data-views-plugin/common/data_view.stub'; import { convertToLens } from '.'; import { createPanel, createSeries } from '../lib/__mocks__'; +import { Panel } from '../../../common/types'; const mockGetMetricsColumns = jest.fn(); const mockGetBucketsColumns = jest.fn(); @@ -59,6 +61,10 @@ describe('convertToLens', () => { ], }); + const vis = { + params: model, + } as Vis<Panel>; + beforeEach(() => { mockIsValidMetrics.mockReturnValue(true); mockGetDataSourceInfo.mockReturnValue({ @@ -77,27 +83,27 @@ describe('convertToLens', () => { test('should return null for invalid metrics', async () => { mockIsValidMetrics.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockIsValidMetrics).toBeCalledTimes(1); }); test('should return null for invalid or unsupported metrics', async () => { mockGetMetricsColumns.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockGetMetricsColumns).toBeCalledTimes(1); }); test('should return null for invalid or unsupported buckets', async () => { mockGetBucketsColumns.mockReturnValue(null); - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeNull(); expect(mockGetBucketsColumns).toBeCalledTimes(1); }); test('should return state for valid model', async () => { - const result = await convertToLens(model); + const result = await convertToLens(vis); expect(result).toBeDefined(); expect(result?.type).toBe('lnsXY'); expect(mockGetBucketsColumns).toBeCalledTimes(model.series.length); @@ -105,16 +111,16 @@ describe('convertToLens', () => { }); test('should skip hidden series', async () => { - const result = await convertToLens( - createPanel({ + const result = await convertToLens({ + params: createPanel({ series: [ createSeries({ metrics: [{ id: 'some-id', type: METRIC_TYPES.AVG, field: 'test-field' }], hidden: true, }), ], - }) - ); + }), + } as Vis<Panel>); expect(result).toBeDefined(); expect(result?.type).toBe('lnsXY'); expect(mockIsValidMetrics).toBeCalledTimes(0); diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/top_n/index.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/top_n/index.ts index 130646f72f127..9505b7f5f0c7e 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/top_n/index.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/top_n/index.ts @@ -28,7 +28,10 @@ const excludeMetaFromLayers = (layers: Record<string, ExtendedLayer>): Record<st return newLayers; }; -export const convertToLens: ConvertTsvbToLensVisualization = async (model, timeRange) => { +export const convertToLens: ConvertTsvbToLensVisualization = async ( + { params: model }, + timeRange +) => { const dataViews = getDataViewsStart(); const extendedLayers: Record<number, ExtendedLayer> = {}; const seriesNum = model.series.filter((series) => !series.hidden).length; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/types.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/types.ts index 69a90c7864eb3..9f00a669ea5c3 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/types.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/types.ts @@ -6,18 +6,22 @@ * Side Public License, v 1. */ +import { Vis } from '@kbn/visualizations-plugin/public'; import { MetricVisConfiguration, NavigateToLensContext, XYConfiguration, + TableVisConfiguration, } from '@kbn/visualizations-plugin/common'; import { TimeRange } from '@kbn/data-plugin/common'; import type { Panel } from '../../common/types'; export type ConvertTsvbToLensVisualization = ( - model: Panel, + vis: Vis<Panel>, timeRange?: TimeRange -) => Promise<NavigateToLensContext<XYConfiguration | MetricVisConfiguration> | null>; +) => Promise<NavigateToLensContext< + XYConfiguration | MetricVisConfiguration | TableVisConfiguration +> | null>; export interface Filter { kql?: string | { [key: string]: any } | undefined; diff --git a/src/plugins/vis_types/timeseries/public/metrics_type.ts b/src/plugins/vis_types/timeseries/public/metrics_type.ts index 3bf9f9b90bf1a..43be3ee3004f4 100644 --- a/src/plugins/vis_types/timeseries/public/metrics_type.ts +++ b/src/plugins/vis_types/timeseries/public/metrics_type.ts @@ -171,15 +171,13 @@ export const metricsVisDefinition: VisTypeDefinition< return { canNavigateToLens: Boolean( vis?.params - ? await convertTSVBtoLensConfiguration(vis.params as Panel, timeFilter?.getAbsoluteTime()) + ? await convertTSVBtoLensConfiguration(vis, timeFilter?.getAbsoluteTime()) : null ), }; }, navigateToLens: async (vis, timeFilter) => - vis?.params - ? await convertTSVBtoLensConfiguration(vis?.params as Panel, timeFilter?.getAbsoluteTime()) - : null, + vis?.params ? await convertTSVBtoLensConfiguration(vis, timeFilter?.getAbsoluteTime()) : null, inspectorAdapters: () => ({ requests: new RequestAdapter(), diff --git a/src/plugins/vis_types/timeseries/tsconfig.json b/src/plugins/vis_types/timeseries/tsconfig.json index be96a71b9a580..245443d4a37f6 100644 --- a/src/plugins/vis_types/timeseries/tsconfig.json +++ b/src/plugins/vis_types/timeseries/tsconfig.json @@ -4,7 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "common/**/*", @@ -13,7 +17,7 @@ "../../../../typings/**/*", "*.ts" ], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../charts/tsconfig.json" }, { "path": "../../data/tsconfig.json" }, diff --git a/src/plugins/vis_types/vega/kibana.json b/src/plugins/vis_types/vega/kibana.json index 5fbaabec722aa..da5e8c4071402 100644 --- a/src/plugins/vis_types/vega/kibana.json +++ b/src/plugins/vis_types/vega/kibana.json @@ -8,7 +8,7 @@ "requiredBundles": ["kibanaUtils", "kibanaReact", "visDefaultEditor"], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Registers the vega visualization. Is the elastic version of vega and vega-lite libraries." } diff --git a/src/plugins/vis_types/vega/tsconfig.json b/src/plugins/vis_types/vega/tsconfig.json index 7aa32cbda7201..b942db9888aa9 100644 --- a/src/plugins/vis_types/vega/tsconfig.json +++ b/src/plugins/vis_types/vega/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "strictNullChecks": false }, "include": [ @@ -12,9 +11,11 @@ "public/**/*", "*.ts", // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "public/test_utils/vega_map_test.json" + "public/test_utils/vega_map_test.json", + "public/test_utils/vegalite_graph.json", + "public/test_utils/vega_graph.json", ], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../data/tsconfig.json" }, { "path": "../../data_views/tsconfig.json" }, diff --git a/src/plugins/vis_types/vislib/kibana.json b/src/plugins/vis_types/vislib/kibana.json index 1f0a76bd364f8..e12149bb5ab01 100644 --- a/src/plugins/vis_types/vislib/kibana.json +++ b/src/plugins/vis_types/vislib/kibana.json @@ -8,7 +8,7 @@ "requiredBundles": ["kibanaUtils", "visTypePie", "visTypeHeatmap", "visTypeGauge", "kibanaReact"], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and heatmap charts. We want to replace them with elastic-charts." } diff --git a/src/plugins/vis_types/vislib/public/vis_controller.tsx b/src/plugins/vis_types/vislib/public/vis_controller.tsx index af9dda7ccf01f..50c72a46e818a 100644 --- a/src/plugins/vis_types/vislib/public/vis_controller.tsx +++ b/src/plugins/vis_types/vislib/public/vis_controller.tsx @@ -9,13 +9,10 @@ import $ from 'jquery'; import React, { RefObject } from 'react'; -import { METRIC_TYPE } from '@kbn/analytics'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import { ChartsPluginSetup } from '@kbn/charts-plugin/public'; import type { PersistedState } from '@kbn/visualizations-plugin/public'; import { IInterpreterRenderHandlers } from '@kbn/expressions-plugin/public'; -import { KibanaExecutionContext } from '@kbn/core-execution-context-common'; -import { getUsageCollectionStart } from './services'; import { VisTypeVislibCoreSetup } from './plugin'; import { VisLegend, CUSTOM_LEGEND_VIS_TYPES } from './vislib/components/legend'; import { BasicVislibParams } from './types'; @@ -30,38 +27,6 @@ const legendClassName = { export type VislibVisController = InstanceType<ReturnType<typeof createVislibVisController>>; -/** @internal **/ -const extractContainerType = (context?: KibanaExecutionContext): string | undefined => { - if (context) { - const recursiveGet = (item: KibanaExecutionContext): KibanaExecutionContext | undefined => { - if (item.type) { - return item; - } else if (item.child) { - return recursiveGet(item.child); - } - }; - return recursiveGet(context)?.type; - } -}; - -const renderComplete = ( - visParams: BasicVislibParams | PieVisParams, - handlers: IInterpreterRenderHandlers -) => { - const usageCollection = getUsageCollectionStart(); - const containerType = extractContainerType(handlers.getExecutionContext()); - - if (usageCollection && containerType) { - usageCollection.reportUiCounter( - containerType, - METRIC_TYPE.COUNT, - `render_agg_based_${visParams.type}` - ); - } - - handlers.done(); -}; - export const createVislibVisController = ( core: VisTypeVislibCoreSetup, charts: ChartsPluginSetup @@ -99,7 +64,8 @@ export const createVislibVisController = ( async render( esResponse: any, visParams: BasicVislibParams | PieVisParams, - handlers: IInterpreterRenderHandlers + handlers: IInterpreterRenderHandlers, + renderComplete: (() => void) | undefined ): Promise<void> { if (this.vislibVis) { this.destroy(false); @@ -109,11 +75,10 @@ export const createVislibVisController = ( this.chartEl.dataset.vislibChartType = visParams.type; if (this.el.clientWidth === 0 || this.el.clientHeight === 0) { - renderComplete(visParams, handlers); + renderComplete?.(); return; } - // @ts-expect-error const { Vis: Vislib } = await import('./vislib/vis'); const { uiState, event: fireEvent } = handlers; @@ -133,7 +98,7 @@ export const createVislibVisController = ( this.mountLegend(esResponse, visParams, fireEvent, uiState as PersistedState); } - renderComplete(visParams, handlers); + renderComplete?.(); }); this.removeListeners = () => { diff --git a/src/plugins/vis_types/vislib/public/vis_wrapper.tsx b/src/plugins/vis_types/vislib/public/vis_wrapper.tsx index a800abd3d11fb..5a68e74b5a485 100644 --- a/src/plugins/vis_types/vislib/public/vis_wrapper.tsx +++ b/src/plugins/vis_types/vislib/public/vis_wrapper.tsx @@ -6,20 +6,23 @@ * Side Public License, v 1. */ -import React, { useEffect, useMemo, useRef } from 'react'; -import { EuiResizeObserver } from '@elastic/eui'; +import React, { useEffect, useMemo, useRef, useCallback } from 'react'; +import { EuiResizeObserver, EuiResizeObserverProps } from '@elastic/eui'; import { debounce } from 'lodash'; import { IInterpreterRenderHandlers } from '@kbn/expressions-plugin/public'; import type { PersistedState } from '@kbn/visualizations-plugin/public'; import { ChartsPluginSetup } from '@kbn/charts-plugin/public'; +import { KibanaExecutionContext } from '@kbn/core-execution-context-common'; +import { METRIC_TYPE } from '@kbn/analytics'; import { VislibRenderValue } from './vis_type_vislib_vis_fn'; import { createVislibVisController, VislibVisController } from './vis_controller'; import { VisTypeVislibCoreSetup } from './plugin'; import { PieRenderValue } from './pie_fn'; import './index.scss'; +import { getUsageCollectionStart } from './services'; type VislibWrapperProps = (VislibRenderValue | PieRenderValue) & { core: VisTypeVislibCoreSetup; @@ -27,20 +30,67 @@ type VislibWrapperProps = (VislibRenderValue | PieRenderValue) & { handlers: IInterpreterRenderHandlers; }; +/** @internal **/ +const extractContainerType = (context?: KibanaExecutionContext): string | undefined => { + if (context) { + const recursiveGet = (item: KibanaExecutionContext): KibanaExecutionContext | undefined => { + if (item.type) { + return item; + } else if (item.child) { + return recursiveGet(item.child); + } + }; + return recursiveGet(context)?.type; + } +}; + const VislibWrapper = ({ core, charts, visData, visConfig, handlers }: VislibWrapperProps) => { const chartDiv = useRef<HTMLDivElement>(null); const visController = useRef<VislibVisController | null>(null); + const skipRenderComplete = useRef<boolean>(true); + + const renderComplete = useMemo( + () => () => { + const usageCollection = getUsageCollectionStart(); + const containerType = extractContainerType(handlers.getExecutionContext()); + + if (usageCollection && containerType) { + usageCollection.reportUiCounter( + containerType, + METRIC_TYPE.COUNT, + `render_agg_based_${visConfig!.type}` + ); + } + handlers.done(); + }, + [handlers, visConfig] + ); - const updateChart = useMemo( + const renderChart = useMemo( () => debounce(() => { if (visController.current) { - visController.current.render(visData, visConfig, handlers); + visController.current.render( + visData, + visConfig, + handlers, + skipRenderComplete.current ? undefined : renderComplete + ); } + skipRenderComplete.current = true; }, 100), - [visConfig, visData, handlers] + [handlers, renderComplete, skipRenderComplete, visConfig, visData] ); + const onResize: EuiResizeObserverProps['onResize'] = useCallback(() => { + renderChart(); + }, [renderChart]); + + useEffect(() => { + skipRenderComplete.current = false; + renderChart(); + }, [renderChart]); + useEffect(() => { if (chartDiv.current) { const Controller = createVislibVisController(core, charts); @@ -52,22 +102,20 @@ const VislibWrapper = ({ core, charts, visData, visConfig, handlers }: VislibWra }; }, [core, charts]); - useEffect(updateChart, [updateChart]); - useEffect(() => { if (handlers.uiState) { const uiState = handlers.uiState as PersistedState; - uiState.on('change', updateChart); + uiState.on('change', renderChart); return () => { - uiState?.off('change', updateChart); + uiState?.off('change', renderChart); }; } - }, [handlers.uiState, updateChart]); + }, [handlers.uiState, renderChart]); return ( - <EuiResizeObserver onResize={updateChart}> + <EuiResizeObserver onResize={onResize}> {(resizeRef) => ( <div className="vislib__wrapper" ref={resizeRef}> <div className="vislib__container" ref={chartDiv} /> diff --git a/src/plugins/vis_types/vislib/tsconfig.json b/src/plugins/vis_types/vislib/tsconfig.json index ef4d0a97fd2a4..0ff4d8d2900e4 100644 --- a/src/plugins/vis_types/vislib/tsconfig.json +++ b/src/plugins/vis_types/vislib/tsconfig.json @@ -4,14 +4,16 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", - "server/**/*" + "server/**/*", + "public/fixtures/dispatch_heatmap_d3.json", + "public/fixtures/dispatch_heatmap_config.json", + "public/fixtures/dispatch_heatmap_data_point.json", ], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../charts/tsconfig.json" }, { "path": "../../data/tsconfig.json" }, diff --git a/src/plugins/vis_types/xy/kibana.json b/src/plugins/vis_types/xy/kibana.json index 474a70431fc73..567c56fbcf9db 100644 --- a/src/plugins/vis_types/xy/kibana.json +++ b/src/plugins/vis_types/xy/kibana.json @@ -8,7 +8,7 @@ "extraPublicDirs": ["common/index"], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "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." } diff --git a/src/plugins/vis_types/xy/tsconfig.json b/src/plugins/vis_types/xy/tsconfig.json index 7cc6e60099cbf..f478d2de1b956 100644 --- a/src/plugins/vis_types/xy/tsconfig.json +++ b/src/plugins/vis_types/xy/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "server/**/*", "*.ts" ], - "references": [ + "kbn_references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../charts/tsconfig.json" }, { "path": "../../visualizations/tsconfig.json" }, diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/buckets/index.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/buckets/index.test.ts index f0a8e4d32f7c3..02a6140625c07 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/buckets/index.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/buckets/index.test.ts @@ -8,7 +8,7 @@ import { stubLogstashDataView } from '@kbn/data-views-plugin/common/data_view.stub'; import { BUCKET_TYPES, METRIC_TYPES } from '@kbn/data-plugin/common'; -import { convertBucketToColumns } from '.'; +import { BucketAggs, convertBucketToColumns } from '.'; import { DateHistogramColumn, FiltersColumn, RangeColumn, TermsColumn } from '../../types'; import { AggBasedColumn, SchemaConfig } from '../../..'; @@ -27,7 +27,7 @@ jest.mock('../convert', () => ({ describe('convertBucketToColumns', () => { const field = stubLogstashDataView.fields[0].name; const dateField = stubLogstashDataView.fields.find((f) => f.type === 'date')!.name; - const bucketAggs: SchemaConfig[] = [ + const bucketAggs: Array<SchemaConfig<BucketAggs | BUCKET_TYPES.DATE_RANGE>> = [ { accessor: 0, label: '', @@ -152,6 +152,7 @@ describe('convertBucketToColumns', () => { }, }, ]; + const visType = 'heatmap'; afterEach(() => { jest.clearAllMocks(); @@ -167,7 +168,7 @@ describe('convertBucketToColumns', () => { >([ [ 'null if bucket agg type is not supported', - [{ dataView: stubLogstashDataView, agg: bucketAggs[6], aggs, metricColumns }], + [{ dataView: stubLogstashDataView, agg: bucketAggs[6], aggs, metricColumns, visType }], () => {}, null, ], @@ -179,6 +180,7 @@ describe('convertBucketToColumns', () => { agg: { ...bucketAggs[0], aggParams: undefined }, aggs, metricColumns, + visType, }, ], () => {}, @@ -186,7 +188,7 @@ describe('convertBucketToColumns', () => { ], [ 'filters column if bucket agg is valid filters agg', - [{ dataView: stubLogstashDataView, agg: bucketAggs[0], aggs, metricColumns }], + [{ dataView: stubLogstashDataView, agg: bucketAggs[0], aggs, metricColumns, visType }], () => { mockConvertToFiltersColumn.mockReturnValue({ operationType: 'filters', @@ -198,7 +200,7 @@ describe('convertBucketToColumns', () => { ], [ 'date histogram column if bucket agg is valid date histogram agg', - [{ dataView: stubLogstashDataView, agg: bucketAggs[1], aggs, metricColumns }], + [{ dataView: stubLogstashDataView, agg: bucketAggs[1], aggs, metricColumns, visType }], () => { mockConvertToDateHistogramColumn.mockReturnValue({ operationType: 'date_histogram', @@ -210,7 +212,7 @@ describe('convertBucketToColumns', () => { ], [ 'date histogram column if bucket agg is valid terms agg with date field', - [{ dataView: stubLogstashDataView, agg: bucketAggs[3], aggs, metricColumns }], + [{ dataView: stubLogstashDataView, agg: bucketAggs[3], aggs, metricColumns, visType }], () => { mockConvertToDateHistogramColumn.mockReturnValue({ operationType: 'date_histogram', @@ -222,7 +224,7 @@ describe('convertBucketToColumns', () => { ], [ 'terms column if bucket agg is valid terms agg with no date field', - [{ dataView: stubLogstashDataView, agg: bucketAggs[2], aggs, metricColumns }], + [{ dataView: stubLogstashDataView, agg: bucketAggs[2], aggs, metricColumns, visType }], () => { mockConvertToTermsColumn.mockReturnValue({ operationType: 'terms', @@ -234,7 +236,7 @@ describe('convertBucketToColumns', () => { ], [ 'range column if bucket agg is valid histogram agg', - [{ dataView: stubLogstashDataView, agg: bucketAggs[4], aggs, metricColumns }], + [{ dataView: stubLogstashDataView, agg: bucketAggs[4], aggs, metricColumns, visType }], () => { mockConvertToRangeColumn.mockReturnValue({ operationType: 'range', @@ -246,7 +248,7 @@ describe('convertBucketToColumns', () => { ], [ 'range column if bucket agg is valid range agg', - [{ dataView: stubLogstashDataView, agg: bucketAggs[5], aggs, metricColumns }], + [{ dataView: stubLogstashDataView, agg: bucketAggs[5], aggs, metricColumns, visType }], () => { mockConvertToRangeColumn.mockReturnValue({ operationType: 'range', diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/buckets/index.ts b/src/plugins/visualizations/common/convert_to_lens/lib/buckets/index.ts index 0f929189f3369..db02b1e09fdce 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/buckets/index.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/buckets/index.ts @@ -9,9 +9,8 @@ import { BUCKET_TYPES, IAggConfig, METRIC_TYPES } from '@kbn/data-plugin/common'; import type { DataView } from '@kbn/data-views-plugin/common'; import { convertToSchemaConfig } from '../../../vis_schemas'; -import { SchemaConfig } from '../../..'; +import { AggBasedColumn, SchemaConfig } from '../../..'; import { - AggBasedColumn, CommonBucketConverterArgs, convertToDateHistogramColumn, convertToFiltersColumn, @@ -26,6 +25,7 @@ export type BucketAggs = | BUCKET_TYPES.FILTERS | BUCKET_TYPES.RANGE | BUCKET_TYPES.HISTOGRAM; + const SUPPORTED_BUCKETS: string[] = [ BUCKET_TYPES.TERMS, BUCKET_TYPES.DATE_HISTOGRAM, @@ -39,7 +39,7 @@ const isSupportedBucketAgg = (agg: SchemaConfig): agg is SchemaConfig<BucketAggs }; export const getBucketColumns = ( - { agg, dataView, metricColumns, aggs }: CommonBucketConverterArgs<BucketAggs>, + { agg, dataView, metricColumns, aggs, visType }: CommonBucketConverterArgs<BucketAggs>, { label, isSplit = false, @@ -76,7 +76,7 @@ export const getBucketColumns = ( if (field.type !== 'date') { return convertToTermsColumn( agg.aggId ?? '', - { agg, dataView, metricColumns, aggs }, + { agg, dataView, metricColumns, aggs, visType }, label, isSplit ); @@ -102,7 +102,9 @@ export const convertBucketToColumns = ( dataView, metricColumns, aggs, + visType, }: { + visType: string; agg: SchemaConfig | IAggConfig; dataView: DataView; metricColumns: AggBasedColumn[]; @@ -116,7 +118,7 @@ export const convertBucketToColumns = ( return null; } return getBucketColumns( - { agg: currentAgg, dataView, metricColumns, aggs }, + { agg: currentAgg, dataView, metricColumns, aggs, visType }, { label: getLabel(currentAgg), isSplit, diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/configurations/index.ts b/src/plugins/visualizations/common/convert_to_lens/lib/configurations/index.ts index c4592f50836c5..b4934d0bb0c85 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/configurations/index.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/configurations/index.ts @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -export { getPalette } from './palette'; +export { getPalette, getPaletteFromStopsWithColors } from './palette'; export { getPercentageModeConfig } from './percentage_mode'; diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/configurations/palette.ts b/src/plugins/visualizations/common/convert_to_lens/lib/configurations/palette.ts index a89177c914996..3f81291fab201 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/configurations/palette.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/configurations/palette.ts @@ -74,6 +74,21 @@ const convertToPercentColorStops = ( return { ...colorStops, stop }; }; +export const getPaletteFromStopsWithColors = ( + config: PaletteConfig, + percentageModeConfig: PercentageModeConfig, + isPercentPaletteSupported: boolean = false +) => { + const percentStopsWithColors = percentageModeConfig.isPercentageMode + ? convertToPercentColorStops(config, percentageModeConfig, isPercentPaletteSupported) + : config; + + return buildCustomPalette( + buildPaletteParams(percentStopsWithColors), + isPercentPaletteSupported && percentageModeConfig.isPercentageMode + ); +}; + export const getPalette = ( params: PaletteParams, percentageModeConfig: PercentageModeConfig, @@ -86,12 +101,10 @@ export const getPalette = ( } const stopsWithColors = getStopsWithColorsFromRanges(colorsRange, colorSchema, invertColors); - const percentStopsWithColors = percentageModeConfig.isPercentageMode - ? convertToPercentColorStops(stopsWithColors, percentageModeConfig, isPercentPaletteSupported) - : stopsWithColors; - return buildCustomPalette( - buildPaletteParams(percentStopsWithColors), - isPercentPaletteSupported && percentageModeConfig.isPercentageMode + return getPaletteFromStopsWithColors( + stopsWithColors, + percentageModeConfig, + isPercentPaletteSupported ); }; diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/formula.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/formula.ts index 0ad2a4072e19d..e79be2ba51516 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/formula.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/formula.ts @@ -21,6 +21,7 @@ export const createFormulaColumn = (formula: string, agg: SchemaConfig): Formula operationType: 'formula', ...createColumn(agg), references: [], + dataType: 'number', params: { ...params, ...getFormat() }, timeShift: agg.aggParams?.timeShift, meta: { aggId: createAggregationId(agg) }, diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/last_value.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/last_value.test.ts index 55ba1e8b5e09d..c46055ca6a9ab 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/last_value.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/last_value.test.ts @@ -22,6 +22,7 @@ jest.mock('../utils', () => ({ })); describe('convertToLastValueColumn', () => { + const visType = 'heatmap'; const dataView = stubLogstashDataView; const sortField = dataView.fields[0]; @@ -59,7 +60,13 @@ describe('convertToLastValueColumn', () => { test.each<[string, Parameters<typeof convertToLastValueColumn>, Partial<FiltersColumn> | null]>([ [ 'null if top hits size is more than 1', - [{ agg: { ...topHitAgg, aggParams: { ...topHitAgg.aggParams!, size: 2 } }, dataView }], + [ + { + agg: { ...topHitAgg, aggParams: { ...topHitAgg.aggParams!, size: 2 } }, + dataView, + visType, + }, + ], null, ], [ @@ -74,6 +81,7 @@ describe('convertToLastValueColumn', () => { }, }, dataView, + visType, }, ], null, @@ -88,7 +96,7 @@ describe('convertToLastValueColumn', () => { test('should skip if top hit field is not specified', () => { mockGetFieldNameFromField.mockReturnValue(null); - expect(convertToLastValueColumn({ agg: topHitAgg, dataView })).toBeNull(); + expect(convertToLastValueColumn({ agg: topHitAgg, dataView, visType })).toBeNull(); expect(mockGetFieldNameFromField).toBeCalledTimes(1); expect(dataView.getFieldByName).toBeCalledTimes(0); }); @@ -97,14 +105,14 @@ describe('convertToLastValueColumn', () => { mockGetFieldByName.mockReturnValue(null); dataView.getFieldByName = mockGetFieldByName; - expect(convertToLastValueColumn({ agg: topHitAgg, dataView })).toBeNull(); + expect(convertToLastValueColumn({ agg: topHitAgg, dataView, visType })).toBeNull(); expect(mockGetFieldNameFromField).toBeCalledTimes(1); expect(dataView.getFieldByName).toBeCalledTimes(1); expect(mockGetLabel).toBeCalledTimes(0); }); test('should return top hit column if top hit field is not present in index pattern', () => { - expect(convertToLastValueColumn({ agg: topHitAgg, dataView })).toEqual( + expect(convertToLastValueColumn({ agg: topHitAgg, dataView, visType })).toEqual( expect.objectContaining({ dataType: 'number', label: 'someLabel', diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/last_value.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/last_value.ts index 3162cf14e71c3..9525f4b41b7eb 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/last_value.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/last_value.ts @@ -25,7 +25,11 @@ const convertToLastValueParams = ( }; export const convertToLastValueColumn = ( - { agg, dataView }: CommonColumnConverterArgs<METRIC_TYPES.TOP_HITS | METRIC_TYPES.TOP_METRICS>, + { + visType, + agg, + dataView, + }: CommonColumnConverterArgs<METRIC_TYPES.TOP_HITS | METRIC_TYPES.TOP_METRICS>, reducedTimeRange?: string ): LastValueColumn | null => { const { aggParams } = agg; @@ -43,7 +47,7 @@ export const convertToLastValueColumn = ( } const field = dataView.getFieldByName(fieldName); - if (!isFieldValid(field, SUPPORTED_METRICS[agg.aggType])) { + if (!isFieldValid(visType, field, SUPPORTED_METRICS[agg.aggType])) { return null; } diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/metric.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/metric.test.ts index 3be17abc46ac1..a0419d46df6b5 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/metric.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/metric.test.ts @@ -16,6 +16,7 @@ const mockGetFieldByName = jest.fn(); describe('convertToLastValueColumn', () => { const dataView = stubLogstashDataView; + const visType = 'heatmap'; const agg: SchemaConfig<METRIC_TYPES.AVG> = { accessor: 0, @@ -42,6 +43,7 @@ describe('convertToLastValueColumn', () => { convertMetricAggregationColumnWithoutSpecialParams(SUPPORTED_METRICS[METRIC_TYPES.TOP_HITS], { agg, dataView, + visType, }) ).toBeNull(); }); @@ -54,6 +56,7 @@ describe('convertToLastValueColumn', () => { convertMetricAggregationColumnWithoutSpecialParams(SUPPORTED_METRICS[METRIC_TYPES.AVG], { agg, dataView, + visType, }) ).toBeNull(); expect(dataView.getFieldByName).toBeCalledTimes(1); @@ -67,6 +70,7 @@ describe('convertToLastValueColumn', () => { convertMetricAggregationColumnWithoutSpecialParams(SUPPORTED_METRICS[METRIC_TYPES.COUNT], { agg, dataView, + visType, }) ).toEqual(expect.objectContaining({ operationType: 'count' })); expect(dataView.getFieldByName).toBeCalledTimes(1); @@ -80,6 +84,7 @@ describe('convertToLastValueColumn', () => { convertMetricAggregationColumnWithoutSpecialParams(SUPPORTED_METRICS[METRIC_TYPES.AVG], { agg, dataView, + visType, }) ).toEqual( expect.objectContaining({ diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/metric.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/metric.ts index eb21b9f0fe91d..dd6c8b02687b0 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/metric.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/metric.ts @@ -78,7 +78,7 @@ export const isMetricWithField = ( export const convertMetricAggregationColumnWithoutSpecialParams = ( aggregation: SupportedMetric, - { agg, dataView }: CommonColumnConverterArgs<MetricsWithoutSpecialParams>, + { visType, agg, dataView }: CommonColumnConverterArgs<MetricsWithoutSpecialParams>, reducedTimeRange?: string ): MetricAggregationColumnWithoutSpecialParams | null => { if (!isSupportedAggregationWithoutParams(aggregation.name)) { @@ -94,7 +94,7 @@ export const convertMetricAggregationColumnWithoutSpecialParams = ( } const field = dataView.getFieldByName(sourceField); - if (!isFieldValid(field, aggregation)) { + if (!isFieldValid(visType, field, aggregation)) { return null; } diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/parent_pipeline.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/parent_pipeline.test.ts index c28324533c837..65dd1cf40aaef 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/parent_pipeline.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/parent_pipeline.test.ts @@ -40,6 +40,7 @@ jest.mock('../metrics', () => ({ })); describe('convertToOtherParentPipelineAggColumns', () => { + const visType = 'heatmap'; const field = stubLogstashDataView.fields[0].name; const aggs: Array<SchemaConfig<METRIC_TYPES>> = [ { @@ -81,6 +82,7 @@ describe('convertToOtherParentPipelineAggColumns', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.MOVING_FN>, + visType, }, ], () => { @@ -95,6 +97,7 @@ describe('convertToOtherParentPipelineAggColumns', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.MOVING_FN>, + visType, }, ], () => { @@ -112,6 +115,7 @@ describe('convertToOtherParentPipelineAggColumns', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.MOVING_FN>, + visType, }, ], () => { @@ -129,6 +133,7 @@ describe('convertToOtherParentPipelineAggColumns', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.MOVING_FN>, + visType, }, ], () => { @@ -147,6 +152,7 @@ describe('convertToOtherParentPipelineAggColumns', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.MOVING_FN>, + visType, }, ], () => { @@ -170,6 +176,7 @@ describe('convertToOtherParentPipelineAggColumns', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.MOVING_FN>, + visType, }, ], () => { @@ -188,6 +195,7 @@ describe('convertToOtherParentPipelineAggColumns', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.MOVING_FN>, + visType, }, ], () => { @@ -229,6 +237,7 @@ describe('convertToOtherParentPipelineAggColumns', () => { }); describe('convertToCumulativeSumAggColumn', () => { + const visType = 'heatmap'; const field = stubLogstashDataView.fields[0].name; const aggs: Array<SchemaConfig<METRIC_TYPES>> = [ { @@ -280,6 +289,7 @@ describe('convertToCumulativeSumAggColumn', () => { dataView: stubLogstashDataView, aggs, agg: { ...aggs[1], aggParams: undefined } as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, + visType, }, ], () => { @@ -294,6 +304,7 @@ describe('convertToCumulativeSumAggColumn', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, + visType, }, ], () => { @@ -308,6 +319,7 @@ describe('convertToCumulativeSumAggColumn', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, + visType, }, ], () => { @@ -325,6 +337,7 @@ describe('convertToCumulativeSumAggColumn', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, + visType, }, ], () => { @@ -342,6 +355,7 @@ describe('convertToCumulativeSumAggColumn', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, + visType, }, ], () => { @@ -360,6 +374,7 @@ describe('convertToCumulativeSumAggColumn', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, + visType, }, ], () => { @@ -383,6 +398,7 @@ describe('convertToCumulativeSumAggColumn', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, + visType, }, ], () => { @@ -401,6 +417,7 @@ describe('convertToCumulativeSumAggColumn', () => { dataView: stubLogstashDataView, aggs, agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, + visType, }, ], () => { diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/parent_pipeline.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/parent_pipeline.ts index ab41ceb259adb..0e0aef11316b2 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/parent_pipeline.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/parent_pipeline.ts @@ -38,7 +38,7 @@ export const convertToMovingAverageParams = ( }); export const convertToOtherParentPipelineAggColumns = ( - { agg, dataView, aggs }: ExtendedColumnConverterArgs<OtherParentPipelineAggs>, + { agg, dataView, aggs, visType }: ExtendedColumnConverterArgs<OtherParentPipelineAggs>, reducedTimeRange?: string ): FormulaColumn | [ParentPipelineAggColumn, AggBasedColumn] | null => { const { aggType } = agg; @@ -63,7 +63,7 @@ export const convertToOtherParentPipelineAggColumns = ( } if (PIPELINE_AGGS.includes(metric.aggType)) { - const formula = getFormulaForPipelineAgg({ agg, aggs, dataView }); + const formula = getFormulaForPipelineAgg({ agg, aggs, dataView, visType }); if (!formula) { return null; } @@ -71,7 +71,7 @@ export const convertToOtherParentPipelineAggColumns = ( return createFormulaColumn(formula, agg); } - const subMetric = convertMetricToColumns(metric, dataView, aggs); + const subMetric = convertMetricToColumns({ agg: metric, dataView, aggs, visType }); if (subMetric === null) { return null; @@ -90,7 +90,7 @@ export const convertToOtherParentPipelineAggColumns = ( }; export const convertToCumulativeSumAggColumn = ( - { agg, dataView, aggs }: ExtendedColumnConverterArgs<METRIC_TYPES.CUMULATIVE_SUM>, + { agg, dataView, aggs, visType }: ExtendedColumnConverterArgs<METRIC_TYPES.CUMULATIVE_SUM>, reducedTimeRange?: string ): | FormulaColumn @@ -119,7 +119,7 @@ export const convertToCumulativeSumAggColumn = ( // create column for sum or count const subMetric = convertMetricAggregationColumnWithoutSpecialParams( subAgg, - { agg: metric as SchemaConfig<METRIC_TYPES.SUM | METRIC_TYPES.COUNT>, dataView }, + { agg: metric as SchemaConfig<METRIC_TYPES.SUM | METRIC_TYPES.COUNT>, dataView, visType }, reducedTimeRange ); @@ -144,7 +144,7 @@ export const convertToCumulativeSumAggColumn = ( subMetric, ]; } else { - const formula = getFormulaForPipelineAgg({ agg, aggs, dataView }); + const formula = getFormulaForPipelineAgg({ agg, aggs, dataView, visType }); if (!formula) { return null; } diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentage_mode.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentage_mode.test.ts index 3b7e8ad7e797f..0ef5d07236d60 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentage_mode.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentage_mode.test.ts @@ -18,6 +18,7 @@ jest.mock('../metrics/formula', () => ({ })); describe('convertToColumnInPercentageMode', () => { + const visType = 'heatmap'; const formula = 'average(some_field)'; const dataView = stubLogstashDataView; @@ -42,7 +43,7 @@ describe('convertToColumnInPercentageMode', () => { test('should return null if it is not possible to build the valid formula', () => { mockGetFormulaForAgg.mockReturnValue(null); - expect(convertToColumnInPercentageMode({ agg, dataView, aggs: [agg] }, {})).toBeNull(); + expect(convertToColumnInPercentageMode({ agg, dataView, aggs: [agg], visType }, {})).toBeNull(); }); test('should return percentage mode over range formula if min and max was passed', () => { @@ -51,7 +52,7 @@ describe('convertToColumnInPercentageMode', () => { params: { format: { id: 'percent' }, formula: `((${formula}) - 0) / (100 - 0)` }, }; expect( - convertToColumnInPercentageMode({ agg, dataView, aggs: [agg] }, { min: 0, max: 100 }) + convertToColumnInPercentageMode({ agg, dataView, aggs: [agg], visType }, { min: 0, max: 100 }) ).toEqual(expect.objectContaining(formulaColumn)); }); @@ -60,7 +61,7 @@ describe('convertToColumnInPercentageMode', () => { operationType: 'formula', params: { format: { id: 'percent' }, formula: `(${formula}) / 10000` }, }; - expect(convertToColumnInPercentageMode({ agg, dataView, aggs: [agg] }, {})).toEqual( + expect(convertToColumnInPercentageMode({ agg, dataView, aggs: [agg], visType }, {})).toEqual( expect.objectContaining(formulaColumn) ); }); diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile.test.ts index b4cf7f141e928..adfab7f55d1c4 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile.test.ts @@ -24,6 +24,7 @@ jest.mock('../utils', () => ({ })); describe('convertToPercentileColumn', () => { + const visType = 'heatmap'; const dataView = stubLogstashDataView; const field = dataView.fields[0].displayName; const aggId = 'pr.10'; @@ -67,23 +68,27 @@ describe('convertToPercentileColumn', () => { test.each< [string, Parameters<typeof convertToPercentileColumn>, Partial<PercentileColumn> | null] >([ - ['null if no percents', [{ agg: { ...agg, aggId: 'pr' }, dataView }], null], + ['null if no percents', [{ agg: { ...agg, aggId: 'pr' }, dataView, visType }], null], [ 'null if no value', - [{ agg: { ...singlePercentileRankAgg, aggParams: undefined }, dataView }], + [{ agg: { ...singlePercentileRankAgg, aggParams: undefined }, dataView, visType }], + null, + ], + ['null if no aggId', [{ agg: { ...agg, aggId: undefined }, dataView, visType }], null], + ['null if no aggParams', [{ agg: { ...agg, aggParams: undefined }, dataView, visType }], null], + [ + 'null if aggId is invalid', + [{ agg: { ...agg, aggId: 'pr.invalid' }, dataView, visType }], null, ], - ['null if no aggId', [{ agg: { ...agg, aggId: undefined }, dataView }], null], - ['null if no aggParams', [{ agg: { ...agg, aggParams: undefined }, dataView }], null], - ['null if aggId is invalid', [{ agg: { ...agg, aggId: 'pr.invalid' }, dataView }], null], [ 'null if values are undefined', - [{ agg: { ...agg, aggParams: { percents: undefined, field } }, dataView }], + [{ agg: { ...agg, aggParams: { percents: undefined, field } }, dataView, visType }], null, ], [ 'null if values are empty', - [{ agg: { ...agg, aggParams: { percents: [], field } }, dataView }], + [{ agg: { ...agg, aggParams: { percents: [], field } }, dataView, visType }], null, ], ])('should return %s', (_, input, expected) => { @@ -96,7 +101,7 @@ describe('convertToPercentileColumn', () => { test('should return null if field is not specified', () => { mockGetFieldNameFromField.mockReturnValue(null); - expect(convertToPercentileColumn({ agg, dataView })).toBeNull(); + expect(convertToPercentileColumn({ agg, dataView, visType })).toBeNull(); expect(mockGetFieldNameFromField).toBeCalledTimes(1); expect(dataView.getFieldByName).toBeCalledTimes(0); }); @@ -105,13 +110,13 @@ describe('convertToPercentileColumn', () => { mockGetFieldByName.mockReturnValueOnce(null); dataView.getFieldByName = mockGetFieldByName; - expect(convertToPercentileColumn({ agg, dataView })).toBeNull(); + expect(convertToPercentileColumn({ agg, dataView, visType })).toBeNull(); expect(mockGetFieldNameFromField).toBeCalledTimes(1); expect(dataView.getFieldByName).toBeCalledTimes(1); }); test('should return percentile rank column for percentiles', () => { - expect(convertToPercentileColumn({ agg, dataView })).toEqual( + expect(convertToPercentileColumn({ agg, dataView, visType })).toEqual( expect.objectContaining({ dataType: 'number', label: 'someOtherLabel', @@ -126,7 +131,7 @@ describe('convertToPercentileColumn', () => { }); test('should return percentile rank column for single percentile', () => { - expect(convertToPercentileColumn({ agg: singlePercentileRankAgg, dataView })).toEqual( + expect(convertToPercentileColumn({ agg: singlePercentileRankAgg, dataView, visType })).toEqual( expect.objectContaining({ dataType: 'number', label: 'someOtherLabel', diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile.ts index de9d4e088b636..9989db1c5dda7 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile.ts @@ -51,6 +51,7 @@ const getPercent = ( export const convertToPercentileColumn = ( { + visType, agg, dataView, }: CommonColumnConverterArgs<METRIC_TYPES.PERCENTILES | METRIC_TYPES.SINGLE_PERCENTILE>, @@ -74,7 +75,7 @@ export const convertToPercentileColumn = ( } const field = dataView.getFieldByName(fieldName); - if (!isFieldValid(field, SUPPORTED_METRICS[agg.aggType])) { + if (!isFieldValid(visType, field, SUPPORTED_METRICS[agg.aggType])) { return null; } diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile_rank.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile_rank.test.ts index 8a696d51d871b..afeaa9899d107 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile_rank.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile_rank.test.ts @@ -24,6 +24,7 @@ jest.mock('../utils', () => ({ })); describe('convertToPercentileRankColumn', () => { + const visType = 'heatmap'; const dataView = stubLogstashDataView; const field = dataView.fields[0].displayName; const aggId = 'pr.10'; @@ -71,23 +72,27 @@ describe('convertToPercentileRankColumn', () => { Partial<PercentileRanksColumn> | null ] >([ - ['null if no percents', [{ agg: { ...agg, aggId: 'pr' }, dataView }], null], + ['null if no percents', [{ agg: { ...agg, aggId: 'pr' }, dataView, visType }], null], [ 'null if no value', - [{ agg: { ...singlePercentileRankAgg, aggParams: undefined }, dataView }], + [{ agg: { ...singlePercentileRankAgg, aggParams: undefined }, dataView, visType }], + null, + ], + ['null if no aggId', [{ agg: { ...agg, aggId: undefined }, dataView, visType }], null], + ['null if no aggParams', [{ agg: { ...agg, aggParams: undefined }, dataView, visType }], null], + [ + 'null if aggId is invalid', + [{ agg: { ...agg, aggId: 'pr.invalid' }, dataView, visType }], null, ], - ['null if no aggId', [{ agg: { ...agg, aggId: undefined }, dataView }], null], - ['null if no aggParams', [{ agg: { ...agg, aggParams: undefined }, dataView }], null], - ['null if aggId is invalid', [{ agg: { ...agg, aggId: 'pr.invalid' }, dataView }], null], [ 'null if values are undefined', - [{ agg: { ...agg, aggParams: { values: undefined, field } }, dataView }], + [{ agg: { ...agg, aggParams: { values: undefined, field } }, dataView, visType }], null, ], [ 'null if values are empty', - [{ agg: { ...agg, aggParams: { values: [], field } }, dataView }], + [{ agg: { ...agg, aggParams: { values: [], field } }, dataView, visType }], null, ], ])('should return %s', (_, input, expected) => { @@ -100,7 +105,7 @@ describe('convertToPercentileRankColumn', () => { test('should return null if field is not specified', () => { mockGetFieldNameFromField.mockReturnValue(null); - expect(convertToPercentileRankColumn({ agg, dataView })).toBeNull(); + expect(convertToPercentileRankColumn({ agg, dataView, visType })).toBeNull(); expect(mockGetFieldNameFromField).toBeCalledTimes(1); expect(dataView.getFieldByName).toBeCalledTimes(0); }); @@ -109,13 +114,13 @@ describe('convertToPercentileRankColumn', () => { mockGetFieldByName.mockReturnValueOnce(null); dataView.getFieldByName = mockGetFieldByName; - expect(convertToPercentileRankColumn({ agg, dataView })).toBeNull(); + expect(convertToPercentileRankColumn({ agg, dataView, visType })).toBeNull(); expect(mockGetFieldNameFromField).toBeCalledTimes(1); expect(dataView.getFieldByName).toBeCalledTimes(1); }); test('should return percentile rank column for percentile ranks', () => { - expect(convertToPercentileRankColumn({ agg, dataView })).toEqual( + expect(convertToPercentileRankColumn({ agg, dataView, visType })).toEqual( expect.objectContaining({ dataType: 'number', label: 'someOtherLabel', @@ -130,7 +135,9 @@ describe('convertToPercentileRankColumn', () => { }); test('should return percentile rank column for single percentile rank', () => { - expect(convertToPercentileRankColumn({ agg: singlePercentileRankAgg, dataView })).toEqual( + expect( + convertToPercentileRankColumn({ agg: singlePercentileRankAgg, dataView, visType }) + ).toEqual( expect.objectContaining({ dataType: 'number', label: 'someOtherLabel', diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile_rank.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile_rank.ts index 5124a26543552..8fb55789dd6a7 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile_rank.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/percentile_rank.ts @@ -50,6 +50,7 @@ const getPercent = ( export const convertToPercentileRankColumn = ( { + visType, agg, dataView, }: CommonColumnConverterArgs<METRIC_TYPES.SINGLE_PERCENTILE_RANK | METRIC_TYPES.PERCENTILE_RANKS>, @@ -69,7 +70,7 @@ export const convertToPercentileRankColumn = ( } const field = dataView.getFieldByName(fieldName); - if (!isFieldValid(field, SUPPORTED_METRICS[agg.aggType])) { + if (!isFieldValid(visType, field, SUPPORTED_METRICS[agg.aggType])) { return null; } diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/range.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/range.test.ts index 8f535c28c8264..5a754fd1c9466 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/range.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/range.test.ts @@ -60,7 +60,6 @@ describe('convertToRangeColumn', () => { params: { type: RANGE_MODES.Histogram, maxBars: 'auto', - ranges: [], }, }, ], diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/range.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/range.ts index 6a9f96fd5ad1e..98200c321935c 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/range.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/range.ts @@ -27,18 +27,17 @@ export const convertToRangeParams = ( return { type: RANGE_MODES.Histogram, maxBars: aggParams.maxBars ?? 'auto', - ranges: [], + includeEmptyRows: aggParams.min_doc_count, }; } else { return { type: RANGE_MODES.Range, maxBars: 'auto', - ranges: - aggParams.ranges?.map((range) => ({ - label: range.label, - from: range.from ?? null, - to: range.to ?? null, - })) ?? [], + ranges: aggParams.ranges?.map((range) => ({ + label: range.label, + from: range.from ?? null, + to: range.to ?? null, + })), }; } }; diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/sibling_pipeline.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/sibling_pipeline.test.ts index 759620650b8a6..6adde7004b69a 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/sibling_pipeline.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/sibling_pipeline.test.ts @@ -23,6 +23,7 @@ jest.mock('../../../vis_schemas', () => ({ })); describe('convertToSiblingPipelineColumns', () => { + const visType = 'heatmap'; const dataView = stubLogstashDataView; const aggId = 'agg-id-1'; const agg: SchemaConfig<METRIC_TYPES.AVG_BUCKET> = { @@ -46,7 +47,12 @@ describe('convertToSiblingPipelineColumns', () => { test('should return null if aggParams are not defined', () => { expect( - convertToSiblingPipelineColumns({ agg: { ...agg, aggParams: undefined }, aggs: [], dataView }) + convertToSiblingPipelineColumns({ + agg: { ...agg, aggParams: undefined }, + aggs: [], + dataView, + visType, + }) ).toBeNull(); expect(mockConvertMetricToColumns).toBeCalledTimes(0); }); @@ -57,6 +63,7 @@ describe('convertToSiblingPipelineColumns', () => { agg: { ...agg, aggParams: { customMetric: undefined } }, aggs: [], dataView, + visType, }) ).toBeNull(); expect(mockConvertMetricToColumns).toBeCalledTimes(0); @@ -64,7 +71,7 @@ describe('convertToSiblingPipelineColumns', () => { test('should return null if sibling agg is not supported', () => { mockConvertMetricToColumns.mockReturnValue(null); - expect(convertToSiblingPipelineColumns({ agg, aggs: [], dataView })).toBeNull(); + expect(convertToSiblingPipelineColumns({ agg, aggs: [], dataView, visType })).toBeNull(); expect(mockConvertToSchemaConfig).toBeCalledTimes(1); expect(mockConvertMetricToColumns).toBeCalledTimes(1); }); @@ -72,7 +79,7 @@ describe('convertToSiblingPipelineColumns', () => { test('should return column', () => { const column = { operationType: 'formula' }; mockConvertMetricToColumns.mockReturnValue([column]); - expect(convertToSiblingPipelineColumns({ agg, aggs: [], dataView })).toEqual(column); + expect(convertToSiblingPipelineColumns({ agg, aggs: [], dataView, visType })).toEqual(column); expect(mockConvertToSchemaConfig).toBeCalledTimes(1); expect(mockConvertMetricToColumns).toBeCalledTimes(1); }); diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/sibling_pipeline.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/sibling_pipeline.ts index a8389cb8601e4..c77500a55d5d1 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/sibling_pipeline.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/sibling_pipeline.ts @@ -22,11 +22,12 @@ export const convertToSiblingPipelineColumns = ( return null; } - const customMetricColumn = convertMetricToColumns( - { ...convertToSchemaConfig(aggParams.customMetric), label, aggId }, - columnConverterArgs.dataView, - columnConverterArgs.aggs - ); + const customMetricColumn = convertMetricToColumns({ + agg: { ...convertToSchemaConfig(aggParams.customMetric), label, aggId }, + dataView: columnConverterArgs.dataView, + aggs: columnConverterArgs.aggs, + visType: columnConverterArgs.visType, + }); if (!customMetricColumn) { return null; diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/std_deviation.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/std_deviation.test.ts index cbb1f03a6dc2e..c786d6b8c3a6f 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/std_deviation.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/std_deviation.test.ts @@ -22,6 +22,7 @@ jest.mock('../utils', () => ({ })); describe('convertToStdDeviationFormulaColumns', () => { + const visType = 'heatmap'; const dataView = stubLogstashDataView; const stdLowerAggId = 'agg-id.std_lower'; const stdUpperAggId = 'agg-id.std_upper'; @@ -51,22 +52,25 @@ describe('convertToStdDeviationFormulaColumns', () => { test.each< [string, Parameters<typeof convertToStdDeviationFormulaColumns>, Partial<FormulaColumn> | null] - >([['null if no aggId is passed', [{ agg: { ...agg, aggId: undefined }, dataView }], null]])( - 'should return %s', - (_, input, expected) => { - if (expected === null) { - expect(convertToStdDeviationFormulaColumns(...input)).toBeNull(); - } else { - expect(convertToStdDeviationFormulaColumns(...input)).toEqual( - expect.objectContaining(expected) - ); - } + >([ + [ + 'null if no aggId is passed', + [{ agg: { ...agg, aggId: undefined }, dataView, visType }], + null, + ], + ])('should return %s', (_, input, expected) => { + if (expected === null) { + expect(convertToStdDeviationFormulaColumns(...input)).toBeNull(); + } else { + expect(convertToStdDeviationFormulaColumns(...input)).toEqual( + expect.objectContaining(expected) + ); } - ); + }); test('should return null if field is not present', () => { mockGetFieldNameFromField.mockReturnValue(null); - expect(convertToStdDeviationFormulaColumns({ agg, dataView })).toBeNull(); + expect(convertToStdDeviationFormulaColumns({ agg, dataView, visType })).toBeNull(); expect(mockGetFieldNameFromField).toBeCalledTimes(1); expect(dataView.getFieldByName).toBeCalledTimes(0); }); @@ -74,14 +78,14 @@ describe('convertToStdDeviationFormulaColumns', () => { test("should return null if field doesn't exist in dataView", () => { mockGetFieldByName.mockReturnValue(null); dataView.getFieldByName = mockGetFieldByName; - expect(convertToStdDeviationFormulaColumns({ agg, dataView })).toBeNull(); + expect(convertToStdDeviationFormulaColumns({ agg, dataView, visType })).toBeNull(); expect(mockGetFieldNameFromField).toBeCalledTimes(1); expect(dataView.getFieldByName).toBeCalledTimes(1); }); test('should return null if agg id is invalid', () => { expect( - convertToStdDeviationFormulaColumns({ agg: { ...agg, aggId: 'some-id' }, dataView }) + convertToStdDeviationFormulaColumns({ agg: { ...agg, aggId: 'some-id' }, dataView, visType }) ).toBeNull(); expect(mockGetFieldNameFromField).toBeCalledTimes(1); expect(dataView.getFieldByName).toBeCalledTimes(1); @@ -89,7 +93,11 @@ describe('convertToStdDeviationFormulaColumns', () => { test('should return formula column for lower std deviation', () => { expect( - convertToStdDeviationFormulaColumns({ agg: { ...agg, aggId: stdLowerAggId }, dataView }) + convertToStdDeviationFormulaColumns({ + agg: { ...agg, aggId: stdLowerAggId }, + dataView, + visType, + }) ).toEqual( expect.objectContaining({ label, @@ -102,7 +110,11 @@ describe('convertToStdDeviationFormulaColumns', () => { test('should return formula column for upper std deviation', () => { expect( - convertToStdDeviationFormulaColumns({ agg: { ...agg, aggId: stdUpperAggId }, dataView }) + convertToStdDeviationFormulaColumns({ + agg: { ...agg, aggId: stdUpperAggId }, + dataView, + visType, + }) ).toEqual( expect.objectContaining({ label, diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/std_deviation.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/std_deviation.ts index f2c218d429bdf..fe4e854759d8f 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/std_deviation.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/std_deviation.ts @@ -50,7 +50,7 @@ export const getStdDeviationFormula = ( }; export const convertToStdDeviationFormulaColumns = ( - { agg, dataView }: CommonColumnConverterArgs<METRIC_TYPES.STD_DEV>, + { visType, agg, dataView }: CommonColumnConverterArgs<METRIC_TYPES.STD_DEV>, reducedTimeRange?: string ) => { const { aggId } = agg; @@ -64,7 +64,7 @@ export const convertToStdDeviationFormulaColumns = ( return null; } const field = dataView.getFieldByName(fieldName); - if (!isFieldValid(field, SUPPORTED_METRICS[agg.aggType])) { + if (!isFieldValid(visType, field, SUPPORTED_METRICS[agg.aggType])) { return null; } diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/supported_metrics.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/supported_metrics.ts index 17a8ccf26c369..61f3f3961b6dc 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/supported_metrics.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/supported_metrics.ts @@ -18,10 +18,12 @@ interface AggWithFormula { formula: string; } +type SupportedDataTypes = { [key: string]: readonly string[] } & { default: readonly string[] }; + export type AggOptions<T> = { isFullReference: boolean; isFieldRequired: boolean; - supportedDataTypes: readonly string[]; + supportedDataTypes: SupportedDataTypes; } & (T extends Exclude<Operation, 'formula'> ? Agg : AggWithFormula); // list of supported TSVB aggregation types in Lens @@ -62,9 +64,9 @@ export type SupportedMetrics = LocalSupportedMetrics & { [Key in UnsupportedSupportedMetrics]?: null; }; -const supportedDataTypesWithDate = ['number', 'date', 'histogram'] as const; -const supportedDataTypes = ['number', 'histogram'] as const; -const extendedSupportedDataTypes = [ +const supportedDataTypesWithDate: readonly string[] = ['number', 'date', 'histogram']; +const supportedDataTypes: readonly string[] = ['number', 'histogram']; +const extendedSupportedDataTypes: readonly string[] = [ 'string', 'boolean', 'number', @@ -74,44 +76,44 @@ const extendedSupportedDataTypes = [ 'date', 'date_range', 'murmur3', -] as const; +]; export const SUPPORTED_METRICS: SupportedMetrics = { avg: { name: 'average', isFullReference: false, isFieldRequired: true, - supportedDataTypes: ['number'], + supportedDataTypes: { default: ['number'] }, }, cardinality: { name: 'unique_count', isFullReference: false, isFieldRequired: true, - supportedDataTypes: extendedSupportedDataTypes, + supportedDataTypes: { default: extendedSupportedDataTypes }, }, count: { name: 'count', isFullReference: false, isFieldRequired: false, - supportedDataTypes: [], + supportedDataTypes: { default: ['number'] }, }, moving_avg: { name: 'moving_average', isFullReference: true, isFieldRequired: true, - supportedDataTypes: ['number'], + supportedDataTypes: { default: ['number'] }, }, derivative: { name: 'differences', isFullReference: true, isFieldRequired: true, - supportedDataTypes: ['number'], + supportedDataTypes: { default: ['number'] }, }, cumulative_sum: { name: 'cumulative_sum', isFullReference: true, isFieldRequired: true, - supportedDataTypes: ['number'], + supportedDataTypes: { default: ['number'] }, }, avg_bucket: { name: 'formula', @@ -119,7 +121,7 @@ export const SUPPORTED_METRICS: SupportedMetrics = { isFieldRequired: true, isFormula: true, formula: 'overall_average', - supportedDataTypes: ['number'], + supportedDataTypes: { default: ['number'] }, }, max_bucket: { name: 'formula', @@ -127,7 +129,7 @@ export const SUPPORTED_METRICS: SupportedMetrics = { isFieldRequired: true, isFormula: true, formula: 'overall_max', - supportedDataTypes: ['number'], + supportedDataTypes: { default: ['number'] }, }, min_bucket: { name: 'formula', @@ -135,7 +137,7 @@ export const SUPPORTED_METRICS: SupportedMetrics = { isFieldRequired: true, isFormula: true, formula: 'overall_min', - supportedDataTypes: ['number'], + supportedDataTypes: { default: ['number'] }, }, sum_bucket: { name: 'formula', @@ -143,79 +145,91 @@ export const SUPPORTED_METRICS: SupportedMetrics = { isFieldRequired: true, isFormula: true, formula: 'overall_sum', - supportedDataTypes: ['number'], + supportedDataTypes: { default: ['number'] }, }, max: { name: 'max', isFullReference: false, isFieldRequired: true, - supportedDataTypes: supportedDataTypesWithDate, + supportedDataTypes: { + default: ['number'], + heatmap: ['number'], + line: ['number'], + area: ['number'], + histogram: ['number'], + }, }, min: { name: 'min', isFullReference: false, isFieldRequired: true, - supportedDataTypes: supportedDataTypesWithDate, + supportedDataTypes: { + default: supportedDataTypesWithDate, + heatmap: ['number'], + line: ['number'], + area: ['number'], + histogram: ['number'], + }, }, percentiles: { name: 'percentile', isFullReference: false, isFieldRequired: true, - supportedDataTypes, + supportedDataTypes: { default: supportedDataTypes }, }, single_percentile: { name: 'percentile', isFullReference: false, isFieldRequired: true, - supportedDataTypes, + supportedDataTypes: { default: supportedDataTypes }, }, percentile_ranks: { name: 'percentile_rank', isFullReference: false, isFieldRequired: true, - supportedDataTypes, + supportedDataTypes: { default: supportedDataTypes }, }, single_percentile_rank: { name: 'percentile_rank', isFullReference: false, isFieldRequired: true, - supportedDataTypes, + supportedDataTypes: { default: supportedDataTypes }, }, sum: { name: 'sum', isFullReference: false, isFieldRequired: true, - supportedDataTypes, + supportedDataTypes: { default: supportedDataTypes }, }, top_hits: { name: 'last_value', isFullReference: false, isFieldRequired: true, - supportedDataTypes: extendedSupportedDataTypes, + supportedDataTypes: { default: extendedSupportedDataTypes }, }, top_metrics: { name: 'last_value', isFullReference: false, isFieldRequired: true, - supportedDataTypes: extendedSupportedDataTypes, + supportedDataTypes: { default: extendedSupportedDataTypes }, }, value_count: { name: 'count', isFullReference: false, isFieldRequired: true, - supportedDataTypes: extendedSupportedDataTypes, + supportedDataTypes: { default: extendedSupportedDataTypes }, }, std_dev: { name: 'standard_deviation', isFullReference: false, isFieldRequired: true, - supportedDataTypes, + supportedDataTypes: { default: supportedDataTypes }, }, median: { name: 'median', isFullReference: false, isFieldRequired: true, - supportedDataTypes, + supportedDataTypes: { default: supportedDataTypes }, }, } as const; diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/terms.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/terms.test.ts index d214ec74b09b1..516ad6b196095 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/terms.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/terms.test.ts @@ -23,6 +23,7 @@ jest.mock('../../../vis_schemas', () => ({ })); describe('convertToDateHistogramColumn', () => { + const visType = 'heatmap'; const aggId = `some-id`; const aggParams: AggParamsTerms = { field: stubLogstashDataView.fields[0].name, @@ -79,6 +80,7 @@ describe('convertToDateHistogramColumn', () => { dataView: stubLogstashDataView, aggs, metricColumns, + visType, }, '', false, @@ -95,6 +97,7 @@ describe('convertToDateHistogramColumn', () => { dataView: stubLogstashDataView, aggs, metricColumns, + visType, }, '', false, @@ -107,6 +110,8 @@ describe('convertToDateHistogramColumn', () => { size: 5, include: [], exclude: [], + includeIsRegex: false, + excludeIsRegex: false, parentFormat: { id: 'terms' }, orderBy: { type: 'alphabetical' }, orderDirection: 'asc', @@ -123,6 +128,7 @@ describe('convertToDateHistogramColumn', () => { dataView: stubLogstashDataView, aggs, metricColumns, + visType, }, '', false, @@ -135,6 +141,8 @@ describe('convertToDateHistogramColumn', () => { size: 5, include: [], exclude: [], + includeIsRegex: false, + excludeIsRegex: false, parentFormat: { id: 'terms' }, orderBy: { type: 'column', columnId: metricColumns[0].columnId }, orderAgg: metricColumns[0], @@ -152,6 +160,7 @@ describe('convertToDateHistogramColumn', () => { dataView: stubLogstashDataView, aggs, metricColumns, + visType, }, '', false, @@ -170,6 +179,7 @@ describe('convertToDateHistogramColumn', () => { dataView: stubLogstashDataView, aggs, metricColumns, + visType, }, '', false, @@ -188,6 +198,7 @@ describe('convertToDateHistogramColumn', () => { dataView: stubLogstashDataView, aggs, metricColumns, + visType, }, '', false, @@ -208,6 +219,7 @@ describe('convertToDateHistogramColumn', () => { dataView: stubLogstashDataView, aggs, metricColumns, + visType, }, '', false, @@ -220,6 +232,8 @@ describe('convertToDateHistogramColumn', () => { size: 5, include: [], exclude: [], + includeIsRegex: false, + excludeIsRegex: false, parentFormat: { id: 'terms' }, orderBy: { type: 'custom' }, orderAgg: metricColumns[0], diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/terms.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/terms.ts index 0a50390ec469e..a54a3857e20f6 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/terms.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/terms.ts @@ -23,6 +23,7 @@ const getOrderByWithAgg = ({ agg, dataView, aggs, + visType, metricColumns, }: CommonBucketConverterArgs<BUCKET_TYPES.TERMS>): OrderByWithAgg | null => { if (!agg.aggParams) { @@ -37,11 +38,12 @@ const getOrderByWithAgg = ({ if (!agg.aggParams.orderAgg) { return null; } - const orderMetricColumn = convertMetricToColumns( - convertToSchemaConfig(agg.aggParams.orderAgg), + const orderMetricColumn = convertMetricToColumns({ + agg: convertToSchemaConfig(agg.aggParams.orderAgg), dataView, - aggs - ); + aggs, + visType, + }); if (!orderMetricColumn) { return null; } @@ -68,35 +70,43 @@ const getOrderByWithAgg = ({ }; }; +const filterOutEmptyValues = (values: string | Array<number | string>): number[] | string[] => { + if (typeof values === 'string') { + return Boolean(values) ? [values] : []; + } + + return values.filter((v): v is string | number => { + if (typeof v === 'string') { + return Boolean(v); + } + return true; + }) as string[] | number[]; +}; + export const convertToTermsParams = ({ agg, dataView, aggs, metricColumns, + visType, }: CommonBucketConverterArgs<BUCKET_TYPES.TERMS>): TermsParams | null => { if (!agg.aggParams) { return null; } - const orderByWithAgg = getOrderByWithAgg({ agg, dataView, aggs, metricColumns }); + const orderByWithAgg = getOrderByWithAgg({ agg, dataView, aggs, metricColumns, visType }); if (orderByWithAgg === null) { return null; } + const exclude = agg.aggParams.exclude ? filterOutEmptyValues(agg.aggParams.exclude) : []; + const include = agg.aggParams.include ? filterOutEmptyValues(agg.aggParams.include) : []; return { size: agg.aggParams.size ?? 10, - include: agg.aggParams.include - ? Array.isArray(agg.aggParams.include) - ? agg.aggParams.include - : [agg.aggParams.include] - : [], - includeIsRegex: agg.aggParams.includeIsRegex, - exclude: agg.aggParams.exclude - ? Array.isArray(agg.aggParams.exclude) - ? agg.aggParams.exclude - : [agg.aggParams.exclude] - : [], - excludeIsRegex: agg.aggParams.excludeIsRegex, + include, + exclude, + includeIsRegex: Boolean(include.length && agg.aggParams.includeIsRegex), + excludeIsRegex: Boolean(exclude.length && agg.aggParams.excludeIsRegex), otherBucket: agg.aggParams.otherBucket, orderDirection: agg.aggParams.order?.value ?? 'desc', parentFormat: { id: 'terms' }, @@ -107,7 +117,7 @@ export const convertToTermsParams = ({ export const convertToTermsColumn = ( aggId: string, - { agg, dataView, aggs, metricColumns }: CommonBucketConverterArgs<BUCKET_TYPES.TERMS>, + { agg, dataView, aggs, metricColumns, visType }: CommonBucketConverterArgs<BUCKET_TYPES.TERMS>, label: string, isSplit: boolean ): TermsColumn | null => { @@ -121,7 +131,7 @@ export const convertToTermsColumn = ( return null; } - const params = convertToTermsParams({ agg, dataView, aggs, metricColumns }); + const params = convertToTermsParams({ agg, dataView, aggs, metricColumns, visType }); if (!params) { return null; } diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/convert/types.ts b/src/plugins/visualizations/common/convert_to_lens/lib/convert/types.ts index 8e6f9ec9443bb..97ccba39303fc 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/convert/types.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/convert/types.ts @@ -64,6 +64,7 @@ export interface CommonColumnConverterArgs< > { agg: SchemaConfig<Agg>; dataView: DataView; + visType: string; } export interface ExtendedColumnConverterArgs< @@ -75,6 +76,7 @@ export interface ExtendedColumnConverterArgs< export interface CommonBucketConverterArgs< Agg extends SupportedAggregation = SupportedAggregation > { + visType: string; agg: SchemaConfig<Agg>; dataView: DataView; metricColumns: AggBasedColumn[]; diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/formula.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/formula.test.ts index 95e128e22b092..72cd07ba03f7c 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/formula.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/formula.test.ts @@ -29,7 +29,7 @@ jest.mock('../utils', () => ({ })); const dataView = stubLogstashDataView; - +const visType = 'heatmap'; const field = stubLogstashDataView.fields[0].name; const aggs: Array<SchemaConfig<METRIC_TYPES>> = [ { @@ -97,7 +97,7 @@ describe('getFormulaForPipelineAgg', () => { test.each<[string, Parameters<typeof getFormulaForPipelineAgg>, () => void, string | null]>([ [ 'null if custom metric is invalid', - [{ agg: aggs[0] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView }], + [{ agg: aggs[0] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView, visType }], () => { mockGetMetricFromParentPipelineAgg.mockReturnValue(null); }, @@ -105,7 +105,7 @@ describe('getFormulaForPipelineAgg', () => { ], [ 'null if custom metric type is not supported', - [{ agg: aggs[0] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView }], + [{ agg: aggs[0] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView, visType }], () => { mockGetMetricFromParentPipelineAgg.mockReturnValue({ aggType: METRIC_TYPES.GEO_BOUNDS, @@ -115,7 +115,7 @@ describe('getFormulaForPipelineAgg', () => { ], [ 'correct formula if agg is parent pipeline agg and custom metric is valid and supported pipeline agg', - [{ agg: aggs[0] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView }], + [{ agg: aggs[0] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView, visType }], () => { mockGetMetricFromParentPipelineAgg .mockReturnValueOnce({ @@ -135,7 +135,7 @@ describe('getFormulaForPipelineAgg', () => { ], [ 'correct formula if agg is parent pipeline agg and custom metric is valid and supported not pipeline agg', - [{ agg: aggs[0] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView }], + [{ agg: aggs[0] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView, visType }], () => { mockGetMetricFromParentPipelineAgg.mockReturnValueOnce({ aggType: METRIC_TYPES.AVG, @@ -149,7 +149,7 @@ describe('getFormulaForPipelineAgg', () => { ], [ 'correct formula if agg is parent pipeline agg and custom metric is valid and supported percentile rank agg', - [{ agg: aggs[0] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView }], + [{ agg: aggs[0] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView, visType }], () => { mockGetMetricFromParentPipelineAgg.mockReturnValueOnce({ aggType: METRIC_TYPES.PERCENTILE_RANKS, @@ -163,7 +163,7 @@ describe('getFormulaForPipelineAgg', () => { ], [ 'correct formula if agg is sibling pipeline agg and custom metric is valid and supported agg', - [{ agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView }], + [{ agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView, visType }], () => { mockGetMetricFromParentPipelineAgg.mockReturnValueOnce({ aggType: METRIC_TYPES.AVG, @@ -212,6 +212,7 @@ describe('getFormulaForPipelineAgg', () => { agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView, + visType, }); expect(agg).toBeNull(); }); @@ -244,6 +245,7 @@ describe('getFormulaForPipelineAgg', () => { agg: aggs[1] as SchemaConfig<METRIC_TYPES.CUMULATIVE_SUM>, aggs, dataView, + visType, }); expect(agg).toBeNull(); }); @@ -270,6 +272,7 @@ describe('getFormulaForAgg', () => { agg: { ...aggs[0], aggType: METRIC_TYPES.GEO_BOUNDS, aggParams: { field } }, aggs, dataView, + visType, }, ], () => {}, @@ -277,7 +280,7 @@ describe('getFormulaForAgg', () => { ], [ 'correct pipeline formula if agg is valid pipeline agg', - [{ agg: aggs[0], aggs, dataView }], + [{ agg: aggs[0], aggs, dataView, visType }], () => { mockIsPipeline.mockReturnValue(true); mockGetMetricFromParentPipelineAgg.mockReturnValueOnce({ @@ -292,7 +295,7 @@ describe('getFormulaForAgg', () => { ], [ 'correct percentile formula if agg is valid percentile agg', - [{ agg: aggs[2], aggs, dataView }], + [{ agg: aggs[2], aggs, dataView, visType }], () => { mockIsPercentileAgg.mockReturnValue(true); }, @@ -300,7 +303,7 @@ describe('getFormulaForAgg', () => { ], [ 'correct percentile rank formula if agg is valid percentile rank agg', - [{ agg: aggs[3], aggs, dataView }], + [{ agg: aggs[3], aggs, dataView, visType }], () => { mockIsPercentileRankAgg.mockReturnValue(true); }, @@ -308,7 +311,7 @@ describe('getFormulaForAgg', () => { ], [ 'correct standart deviation formula if agg is valid standart deviation agg', - [{ agg: aggs[4], aggs, dataView }], + [{ agg: aggs[4], aggs, dataView, visType }], () => { mockIsStdDevAgg.mockReturnValue(true); }, @@ -316,7 +319,7 @@ describe('getFormulaForAgg', () => { ], [ 'correct metric formula if agg is valid other metric agg', - [{ agg: aggs[5], aggs, dataView }], + [{ agg: aggs[5], aggs, dataView, visType }], () => {}, 'average(bytes)', ], @@ -395,6 +398,7 @@ describe('getFormulaForAgg', () => { >, aggs, dataView, + visType, }); expect(result).toBeNull(); }); @@ -467,6 +471,7 @@ describe('getFormulaForAgg', () => { >, aggs, dataView, + visType, }); expect(result).toBeNull(); } diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/formula.ts b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/formula.ts index 276ac54e2fc3d..4492cd58ac230 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/formula.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/formula.ts @@ -66,7 +66,7 @@ const isDataViewField = (field: string | DataViewField): field is DataViewField return false; }; -const isValidAgg = (agg: SchemaConfig<METRIC_TYPES>, dataView: DataView) => { +const isValidAgg = (visType: string, agg: SchemaConfig<METRIC_TYPES>, dataView: DataView) => { const aggregation = SUPPORTED_METRICS[agg.aggType]; if (!aggregation) { return false; @@ -77,7 +77,7 @@ const isValidAgg = (agg: SchemaConfig<METRIC_TYPES>, dataView: DataView) => { } const sourceField = getFieldNameFromField(agg.aggParams?.field); const field = dataView.getFieldByName(sourceField!); - if (!isFieldValid(field, aggregation)) { + if (!isFieldValid(visType, field, aggregation)) { return false; } } @@ -86,13 +86,14 @@ const isValidAgg = (agg: SchemaConfig<METRIC_TYPES>, dataView: DataView) => { }; const getFormulaForAggsWithoutParams = ( + visType: string, agg: SchemaConfig<METRIC_TYPES>, dataView: DataView, selector: string | undefined, reducedTimeRange?: string ) => { const op = SUPPORTED_METRICS[agg.aggType]; - if (!isValidAgg(agg, dataView) || !op) { + if (!isValidAgg(visType, agg, dataView) || !op) { return null; } @@ -101,6 +102,7 @@ const getFormulaForAggsWithoutParams = ( }; const getFormulaForPercentileRanks = ( + visType: string, agg: SchemaConfig<METRIC_TYPES.PERCENTILE_RANKS>, dataView: DataView, selector: string | undefined, @@ -108,7 +110,7 @@ const getFormulaForPercentileRanks = ( ) => { const value = Number(agg.aggId?.split('.')[1]); const op = SUPPORTED_METRICS[agg.aggType]; - if (!isValidAgg(agg, dataView) || !op) { + if (!isValidAgg(visType, agg, dataView) || !op) { return null; } @@ -117,6 +119,7 @@ const getFormulaForPercentileRanks = ( }; const getFormulaForPercentile = ( + visType: string, agg: SchemaConfig<METRIC_TYPES.PERCENTILES>, dataView: DataView, selector: string, @@ -124,7 +127,7 @@ const getFormulaForPercentile = ( ) => { const percentile = Number(agg.aggId?.split('.')[1]); const op = SUPPORTED_METRICS[agg.aggType]; - if (!isValidAgg(agg, dataView) || !op) { + if (!isValidAgg(visType, agg, dataView) || !op) { return null; } @@ -138,6 +141,7 @@ const getFormulaForSubMetric = ({ agg, dataView, aggs, + visType, }: ExtendedColumnConverterArgs<METRIC_TYPES>): string | null => { const op = SUPPORTED_METRICS[agg.aggType]; if (!op) { @@ -148,12 +152,13 @@ const getFormulaForSubMetric = ({ PARENT_PIPELINE_OPS.includes(op.name) || SIBLING_PIPELINE_AGGS.includes(agg.aggType as METRIC_TYPES) ) { - return getFormulaForPipelineAgg({ agg: agg as PipelineAggs, aggs, dataView }); + return getFormulaForPipelineAgg({ agg: agg as PipelineAggs, aggs, dataView, visType }); } if (METRIC_OPS_WITHOUT_PARAMS.includes(op.name)) { const metricAgg = agg as MetricAggsWithoutParams; return getFormulaForAggsWithoutParams( + visType, metricAgg, dataView, metricAgg.aggParams && 'field' in metricAgg.aggParams @@ -168,6 +173,7 @@ const getFormulaForSubMetric = ({ const percentileRanksAgg = agg as SchemaConfig<METRIC_TYPES.PERCENTILE_RANKS>; return getFormulaForPercentileRanks( + visType, percentileRanksAgg, dataView, percentileRanksAgg.aggParams?.field @@ -181,6 +187,7 @@ export const getFormulaForPipelineAgg = ({ agg, dataView, aggs, + visType, }: ExtendedColumnConverterArgs< | METRIC_TYPES.CUMULATIVE_SUM | METRIC_TYPES.DERIVATIVE @@ -205,6 +212,7 @@ export const getFormulaForPipelineAgg = ({ agg: metricAgg, aggs, dataView, + visType, }); if (subFormula === null) { return null; @@ -222,13 +230,15 @@ export const getFormulaForAgg = ({ agg, aggs, dataView, + visType, }: ExtendedColumnConverterArgs<METRIC_TYPES>) => { if (isPipeline(agg)) { - return getFormulaForPipelineAgg({ agg, aggs, dataView }); + return getFormulaForPipelineAgg({ agg, aggs, dataView, visType }); } if (isPercentileAgg(agg)) { return getFormulaForPercentile( + visType, agg, dataView, getFieldNameFromField(agg.aggParams?.field) ?? '' @@ -237,6 +247,7 @@ export const getFormulaForAgg = ({ if (isPercentileRankAgg(agg)) { return getFormulaForPercentileRanks( + visType, agg, dataView, getFieldNameFromField(agg.aggParams?.field) ?? '' @@ -244,13 +255,14 @@ export const getFormulaForAgg = ({ } if (isStdDevAgg(agg) && agg.aggId) { - if (!isValidAgg(agg, dataView)) { + if (!isValidAgg(visType, agg, dataView)) { return null; } return getStdDeviationFormula(agg.aggId, getFieldNameFromField(agg.aggParams?.field) ?? ''); } return getFormulaForAggsWithoutParams( + visType, agg, dataView, isMetricWithField(agg) ? getFieldNameFromField(agg.aggParams?.field) ?? '' : '' diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/metrics.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/metrics.test.ts index 1cf3ff0b84064..c7674bf6603c0 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/metrics.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/metrics.test.ts @@ -9,6 +9,7 @@ import { METRIC_TYPES } from '@kbn/data-plugin/common'; import { stubLogstashDataView } from '@kbn/data-views-plugin/common/data_view.stub'; import { SchemaConfig } from '../../..'; +import { ExtendedColumnConverterArgs } from '../convert'; import { convertMetricToColumns } from './metrics'; const mockConvertMetricAggregationColumnWithoutSpecialParams = jest.fn(); @@ -37,6 +38,8 @@ jest.mock('../convert', () => ({ convertToColumnInPercentageMode: jest.fn(() => mockConvertToColumnInPercentageMode()), })); +const visType = 'heatmap'; + describe('convertMetricToColumns invalid cases', () => { const dataView = stubLogstashDataView; @@ -55,13 +58,18 @@ describe('convertMetricToColumns invalid cases', () => { mockConvertToCumulativeSumAggColumn.mockReturnValue(null); }); + const aggs: ExtendedColumnConverterArgs<METRIC_TYPES>['aggs'] = []; + test.each<[string, Parameters<typeof convertMetricToColumns>, null, jest.Mock | undefined]>([ [ 'null if agg is not supported', [ - { aggType: METRIC_TYPES.GEO_BOUNDS } as unknown as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.GEO_BOUNDS } as unknown as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -70,9 +78,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg AVG is not valid', [ - { aggType: METRIC_TYPES.AVG } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.AVG } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -81,9 +92,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg MIN is not valid', [ - { aggType: METRIC_TYPES.MIN } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MIN } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs: [], + visType, + }, { isPercentageMode: false }, ], null, @@ -92,9 +106,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg MAX is not valid', [ - { aggType: METRIC_TYPES.MAX } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MAX } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -103,9 +120,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg SUM is not valid', [ - { aggType: METRIC_TYPES.SUM } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.SUM } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -114,9 +134,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg COUNT is not valid', [ - { aggType: METRIC_TYPES.COUNT } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.COUNT } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -125,9 +148,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg CARDINALITY is not valid', [ - { aggType: METRIC_TYPES.CARDINALITY } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.CARDINALITY } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -136,9 +162,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg VALUE_COUNT is not valid', [ - { aggType: METRIC_TYPES.VALUE_COUNT } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.VALUE_COUNT } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -147,9 +176,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg MEDIAN is not valid', [ - { aggType: METRIC_TYPES.MEDIAN } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MEDIAN } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -158,9 +190,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg STD_DEV is not valid', [ - { aggType: METRIC_TYPES.STD_DEV } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.STD_DEV } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -169,9 +204,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg PERCENTILES is not valid', [ - { aggType: METRIC_TYPES.PERCENTILES } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.PERCENTILES } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -180,9 +218,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg SINGLE_PERCENTILE is not valid', [ - { aggType: METRIC_TYPES.SINGLE_PERCENTILE } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.SINGLE_PERCENTILE } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -191,9 +232,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg PERCENTILE_RANKS is not valid', [ - { aggType: METRIC_TYPES.PERCENTILE_RANKS } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.PERCENTILE_RANKS } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -202,9 +246,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg SINGLE_PERCENTILE_RANK is not valid', [ - { aggType: METRIC_TYPES.SINGLE_PERCENTILE_RANK } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.SINGLE_PERCENTILE_RANK } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -213,9 +260,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg TOP_HITS is not valid', [ - { aggType: METRIC_TYPES.TOP_HITS } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.TOP_HITS } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -224,9 +274,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg TOP_METRICS is not valid', [ - { aggType: METRIC_TYPES.TOP_METRICS } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.TOP_METRICS } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -235,9 +288,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg CUMULATIVE_SUM is not valid', [ - { aggType: METRIC_TYPES.CUMULATIVE_SUM } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.CUMULATIVE_SUM } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -246,9 +302,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg DERIVATIVE is not valid', [ - { aggType: METRIC_TYPES.DERIVATIVE } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.DERIVATIVE } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -257,9 +316,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg MOVING_FN is not valid', [ - { aggType: METRIC_TYPES.MOVING_FN } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MOVING_FN } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -268,9 +330,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg SUM_BUCKET is not valid', [ - { aggType: METRIC_TYPES.SUM_BUCKET } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.SUM_BUCKET } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -279,9 +344,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg MIN_BUCKET is not valid', [ - { aggType: METRIC_TYPES.MIN_BUCKET } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MIN_BUCKET } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -290,9 +358,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg MAX_BUCKET is not valid', [ - { aggType: METRIC_TYPES.MAX_BUCKET } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MAX_BUCKET } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -301,9 +372,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg AVG_BUCKET is not valid', [ - { aggType: METRIC_TYPES.AVG_BUCKET } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.AVG_BUCKET } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs: [], + visType, + }, { isPercentageMode: false }, ], null, @@ -312,9 +386,12 @@ describe('convertMetricToColumns invalid cases', () => { [ 'null if supported agg SERIAL_DIFF is not valid', [ - { aggType: METRIC_TYPES.SERIAL_DIFF } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.SERIAL_DIFF } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], null, @@ -330,6 +407,7 @@ describe('convertMetricToColumns invalid cases', () => { }); describe('convertMetricToColumns valid cases', () => { const dataView = stubLogstashDataView; + const aggs: ExtendedColumnConverterArgs<METRIC_TYPES>['aggs'] = []; beforeEach(() => { jest.clearAllMocks(); @@ -353,9 +431,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg AVG is valid', [ - { aggType: METRIC_TYPES.AVG } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.AVG } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -364,9 +445,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg MIN is valid', [ - { aggType: METRIC_TYPES.MIN } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MIN } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -375,9 +459,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg MAX is valid', [ - { aggType: METRIC_TYPES.MAX } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MAX } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -386,9 +473,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg SUM is valid', [ - { aggType: METRIC_TYPES.SUM } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.SUM } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -397,9 +487,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg COUNT is valid', [ - { aggType: METRIC_TYPES.COUNT } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.COUNT } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -408,9 +501,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg CARDINALITY is valid', [ - { aggType: METRIC_TYPES.CARDINALITY } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.CARDINALITY } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -419,9 +515,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg VALUE_COUNT is valid', [ - { aggType: METRIC_TYPES.VALUE_COUNT } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.VALUE_COUNT } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -430,9 +529,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg MEDIAN is valid', [ - { aggType: METRIC_TYPES.MEDIAN } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MEDIAN } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -441,9 +543,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg STD_DEV is valid', [ - { aggType: METRIC_TYPES.STD_DEV } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.STD_DEV } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -452,9 +557,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg PERCENTILES is valid', [ - { aggType: METRIC_TYPES.PERCENTILES } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.PERCENTILES } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -463,9 +571,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg SINGLE_PERCENTILE is valid', [ - { aggType: METRIC_TYPES.SINGLE_PERCENTILE } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.SINGLE_PERCENTILE } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -474,9 +585,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg PERCENTILE_RANKS is valid', [ - { aggType: METRIC_TYPES.PERCENTILE_RANKS } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.PERCENTILE_RANKS } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -485,9 +599,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg SINGLE_PERCENTILE_RANK is valid', [ - { aggType: METRIC_TYPES.SINGLE_PERCENTILE_RANK } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.SINGLE_PERCENTILE_RANK } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -496,9 +613,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg TOP_HITS is valid', [ - { aggType: METRIC_TYPES.TOP_HITS } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.TOP_HITS } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -507,9 +627,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg TOP_METRICS is valid', [ - { aggType: METRIC_TYPES.TOP_METRICS } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.TOP_METRICS } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -518,9 +641,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg CUMULATIVE_SUM is valid', [ - { aggType: METRIC_TYPES.CUMULATIVE_SUM } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.CUMULATIVE_SUM } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -529,9 +655,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg DERIVATIVE is valid', [ - { aggType: METRIC_TYPES.DERIVATIVE } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.DERIVATIVE } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -540,9 +669,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg MOVING_FN is valid', [ - { aggType: METRIC_TYPES.MOVING_FN } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MOVING_FN } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -551,9 +683,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg SUM_BUCKET is valid', [ - { aggType: METRIC_TYPES.SUM_BUCKET } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.SUM_BUCKET } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -562,9 +697,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg MIN_BUCKET is valid', [ - { aggType: METRIC_TYPES.MIN_BUCKET } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MIN_BUCKET } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -573,9 +711,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg MAX_BUCKET is valid', [ - { aggType: METRIC_TYPES.MAX_BUCKET } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.MAX_BUCKET } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -584,9 +725,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'array of columns if supported agg AVG_BUCKET is valid', [ - { aggType: METRIC_TYPES.AVG_BUCKET } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.AVG_BUCKET } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: false }, ], result, @@ -595,9 +739,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'column in percentage mode without range if percentageMode is enabled ', [ - { aggType: METRIC_TYPES.AVG_BUCKET } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.AVG_BUCKET } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: true, min: 0, max: 100 }, ], result, @@ -606,9 +753,12 @@ describe('convertMetricToColumns valid cases', () => { [ 'column in percentage mode with range if percentageMode is enabled ', [ - { aggType: METRIC_TYPES.AVG_BUCKET } as SchemaConfig<METRIC_TYPES>, - dataView, - [], + { + agg: { aggType: METRIC_TYPES.AVG_BUCKET } as SchemaConfig<METRIC_TYPES>, + dataView, + aggs, + visType, + }, { isPercentageMode: true, min: 0, max: 100 }, ], result, diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/metrics.ts b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/metrics.ts index be4c92cd4ec7f..5d765a6f286ba 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/metrics.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/metrics.ts @@ -7,8 +7,7 @@ */ import { METRIC_TYPES } from '@kbn/data-plugin/common'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import { PercentageModeConfig, SchemaConfig } from '../../..'; +import { PercentageModeConfig } from '../../..'; import { convertMetricAggregationColumnWithoutSpecialParams, convertToOtherParentPipelineAggColumns, @@ -20,14 +19,13 @@ import { convertToCumulativeSumAggColumn, AggBasedColumn, convertToColumnInPercentageMode, + ExtendedColumnConverterArgs, } from '../convert'; import { SUPPORTED_METRICS } from '../convert/supported_metrics'; import { getValidColumns } from '../utils'; export const convertMetricToColumns = ( - agg: SchemaConfig<METRIC_TYPES>, - dataView: DataView, - aggs: Array<SchemaConfig<METRIC_TYPES>>, + { agg, dataView, aggs, visType }: ExtendedColumnConverterArgs<METRIC_TYPES>, percentageModeConfig: PercentageModeConfig = { isPercentageMode: false } ): AggBasedColumn[] | null => { const supportedAgg = SUPPORTED_METRICS[agg.aggType]; @@ -38,7 +36,7 @@ export const convertMetricToColumns = ( if (percentageModeConfig.isPercentageMode) { const { isPercentageMode, ...minMax } = percentageModeConfig; - const formulaColumn = convertToColumnInPercentageMode({ agg, dataView, aggs }, minMax); + const formulaColumn = convertToColumnInPercentageMode({ agg, dataView, aggs, visType }, minMax); return getValidColumns(formulaColumn); } @@ -54,6 +52,7 @@ export const convertMetricToColumns = ( const columns = convertMetricAggregationColumnWithoutSpecialParams(supportedAgg, { agg, dataView, + visType, }); return getValidColumns(columns); } @@ -61,6 +60,7 @@ export const convertMetricToColumns = ( const columns = convertToStdDeviationFormulaColumns({ agg, dataView, + visType, }); return getValidColumns(columns); } @@ -68,6 +68,7 @@ export const convertMetricToColumns = ( const columns = convertToPercentileColumn({ agg, dataView, + visType, }); return getValidColumns(columns); } @@ -75,6 +76,7 @@ export const convertMetricToColumns = ( const columns = convertToPercentileColumn({ agg, dataView, + visType, }); return getValidColumns(columns); } @@ -82,6 +84,7 @@ export const convertMetricToColumns = ( const columns = convertToPercentileRankColumn({ agg, dataView, + visType, }); return getValidColumns(columns); } @@ -89,6 +92,7 @@ export const convertMetricToColumns = ( const columns = convertToPercentileRankColumn({ agg, dataView, + visType, }); return getValidColumns(columns); } @@ -97,6 +101,7 @@ export const convertMetricToColumns = ( const columns = convertToLastValueColumn({ agg, dataView, + visType, }); return getValidColumns(columns); } @@ -105,6 +110,7 @@ export const convertMetricToColumns = ( agg, dataView, aggs, + visType, }); return getValidColumns(columns); } @@ -114,6 +120,7 @@ export const convertMetricToColumns = ( agg, dataView, aggs, + visType, }); return getValidColumns(columns); } @@ -125,6 +132,7 @@ export const convertMetricToColumns = ( agg, dataView, aggs, + visType, }); return getValidColumns(columns); } diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/percentage_formula.test.ts b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/percentage_formula.test.ts index 9855ce44b6602..fe6204d1fb2a1 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/percentage_formula.test.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/percentage_formula.test.ts @@ -24,6 +24,7 @@ jest.mock('../convert', () => ({ })); describe('getPercentageColumnFormulaColumn', () => { + const visType = 'heatmap'; const dataView = stubLogstashDataView; const field = stubLogstashDataView.fields[0].name; const aggs: Array<SchemaConfig<METRIC_TYPES>> = [ @@ -52,7 +53,7 @@ describe('getPercentageColumnFormulaColumn', () => { >([ [ 'null if cannot build formula for provided agg', - [{ agg: aggs[0], aggs, dataView }], + [{ agg: aggs[0], aggs, dataView, visType }], () => { mockGetFormulaForAgg.mockReturnValue(null); }, @@ -60,7 +61,7 @@ describe('getPercentageColumnFormulaColumn', () => { ], [ 'null if cannot create formula column for provided arguments', - [{ agg: aggs[0], aggs, dataView }], + [{ agg: aggs[0], aggs, dataView, visType }], () => { mockGetFormulaForAgg.mockReturnValue('test-formula'); mockCreateFormulaColumn.mockReturnValue(null); @@ -69,7 +70,7 @@ describe('getPercentageColumnFormulaColumn', () => { ], [ 'formula column if provided arguments are valid', - [{ agg: aggs[0], aggs, dataView }], + [{ agg: aggs[0], aggs, dataView, visType }], () => { mockGetFormulaForAgg.mockReturnValue('test-formula'); mockCreateFormulaColumn.mockImplementation((formula) => ({ diff --git a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/percentage_formula.ts b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/percentage_formula.ts index 773851a770db4..8d7194d5c25df 100644 --- a/src/plugins/visualizations/common/convert_to_lens/lib/metrics/percentage_formula.ts +++ b/src/plugins/visualizations/common/convert_to_lens/lib/metrics/percentage_formula.ts @@ -14,8 +14,9 @@ export const getPercentageColumnFormulaColumn = ({ agg, aggs, dataView, + visType, }: ExtendedColumnConverterArgs<METRIC_TYPES>): FormulaColumn | null => { - const metricFormula = getFormulaForAgg({ agg, aggs, dataView }); + const metricFormula = getFormulaForAgg({ agg, aggs, dataView, visType }); if (!metricFormula) { return null; } diff --git a/src/plugins/visualizations/common/convert_to_lens/types/configurations.ts b/src/plugins/visualizations/common/convert_to_lens/types/configurations.ts index 4f7a5ad715215..8a6e70669dcf4 100644 --- a/src/plugins/visualizations/common/convert_to_lens/types/configurations.ts +++ b/src/plugins/visualizations/common/convert_to_lens/types/configurations.ts @@ -28,6 +28,9 @@ import { GaugeCentralMajorModes, CollapseFunctions, } from '../constants'; +import { ExpressionValueVisDimension } from '../../expression_functions'; + +export type ChartShapes = 'heatmap'; export type CollapseFunction = typeof CollapseFunctions[number]; @@ -183,6 +186,7 @@ export interface ColumnState { summaryRow?: 'none' | 'sum' | 'avg' | 'count' | 'min' | 'max'; alignment?: 'left' | 'right' | 'center'; collapseFn?: CollapseFunction; + palette?: PaletteOutput<CustomPaletteParams>; } export interface TableVisConfiguration { @@ -276,9 +280,63 @@ export type GaugeVisConfiguration = GaugeState & { layerType: typeof LayerTypes.DATA; }; +export interface HeatmapLegendConfig { + isVisible: boolean; + position: Position; + maxLines?: number; + shouldTruncate?: boolean; + legendSize?: LegendSize; + type: 'heatmap_legend'; +} + +export interface HeatmapGridConfig { + strokeWidth?: number; + strokeColor?: string; + isCellLabelVisible: boolean; + isYAxisLabelVisible: boolean; + isYAxisTitleVisible: boolean; + yTitle?: string; + isXAxisLabelVisible: boolean; + isXAxisTitleVisible: boolean; + xTitle?: string; + type: 'heatmap_grid'; +} +export interface HeatmapArguments { + percentageMode?: boolean; + lastRangeIsRightOpen?: boolean; + showTooltip?: boolean; + highlightInHover?: boolean; + palette?: PaletteOutput<CustomPaletteParams>; + xAccessor?: string | ExpressionValueVisDimension; + yAccessor?: string | ExpressionValueVisDimension; + valueAccessor?: string | ExpressionValueVisDimension; + splitRowAccessor?: string | ExpressionValueVisDimension; + splitColumnAccessor?: string | ExpressionValueVisDimension; + legend: HeatmapLegendConfig; + gridConfig: HeatmapGridConfig; + ariaLabel?: string; +} + +export type HeatmapLayerState = HeatmapArguments & { + layerId: string; + layerType: LayerType; + valueAccessor?: string; + xAccessor?: string; + yAccessor?: string; + shape: ChartShapes; +}; + +export type Palette = PaletteOutput<CustomPaletteParams> & { accessor: string }; + +export type HeatmapConfiguration = HeatmapLayerState & { + // need to store the current accessor to reset the color stops at accessor change + palette?: Palette; +}; + export type Configuration = | XYConfiguration | TableVisConfiguration | PartitionVisConfiguration | MetricVisConfiguration - | GaugeVisConfiguration; + | GaugeVisConfiguration + | HeatmapConfiguration; diff --git a/src/plugins/visualizations/common/convert_to_lens/types/params.ts b/src/plugins/visualizations/common/convert_to_lens/types/params.ts index d66822921fb19..4623506496382 100644 --- a/src/plugins/visualizations/common/convert_to_lens/types/params.ts +++ b/src/plugins/visualizations/common/convert_to_lens/types/params.ts @@ -55,7 +55,7 @@ interface Range { export interface RangeParams extends FormatParams { type: RangeMode; maxBars: 'auto' | number; - ranges: Range[]; + ranges?: Range[]; includeEmptyRows?: boolean; parentFormat?: { id: string; diff --git a/src/plugins/visualizations/common/convert_to_lens/utils.ts b/src/plugins/visualizations/common/convert_to_lens/utils.ts index 6a875bf63bea4..88c2802c421ec 100644 --- a/src/plugins/visualizations/common/convert_to_lens/utils.ts +++ b/src/plugins/visualizations/common/convert_to_lens/utils.ts @@ -18,7 +18,17 @@ export const isAnnotationsLayer = ( export const getIndexPatternIds = (layers: Layer[]) => layers.map(({ indexPatternId }) => indexPatternId); +const isValidFieldType = ( + visType: string, + { supportedDataTypes }: SupportedMetric, + field: DataViewField +) => { + const availableDataTypes = supportedDataTypes[visType] ?? supportedDataTypes.default; + return availableDataTypes.includes(field.type); +}; + export const isFieldValid = ( + visType: string, field: DataViewField | undefined, aggregation: SupportedMetric ): field is DataViewField => { @@ -26,7 +36,7 @@ export const isFieldValid = ( return false; } - if (field && (!field.aggregatable || !aggregation.supportedDataTypes.includes(field.type))) { + if (field && (!field.aggregatable || !isValidFieldType(visType, aggregation, field))) { return false; } diff --git a/src/plugins/visualizations/common/expression_functions/vis_dimension.ts b/src/plugins/visualizations/common/expression_functions/vis_dimension.ts index 99574e1c36756..88397e9218563 100644 --- a/src/plugins/visualizations/common/expression_functions/vis_dimension.ts +++ b/src/plugins/visualizations/common/expression_functions/vis_dimension.ts @@ -32,12 +32,14 @@ export type ExpressionValueVisDimension = ExpressionValueBoxed< } >; -export const visDimension = (): ExpressionFunctionDefinition< +export type ExpressionFunctionVisDimension = ExpressionFunctionDefinition< 'visdimension', Datatable, Arguments, ExpressionValueVisDimension -> => ({ +>; + +export const visDimension = (): ExpressionFunctionVisDimension => ({ name: 'visdimension', help: i18n.translate('visualizations.function.visDimension.help', { defaultMessage: 'Generates visConfig dimension object', diff --git a/src/plugins/visualizations/kibana.json b/src/plugins/visualizations/kibana.json index fc35feb51039c..f650b85dd71e1 100644 --- a/src/plugins/visualizations/kibana.json +++ b/src/plugins/visualizations/kibana.json @@ -25,7 +25,7 @@ "extraPublicDirs": ["common/constants", "common/utils", "common/expression_functions", "common/convert_to_lens"], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable." } diff --git a/src/plugins/visualizations/public/components/visualization_missed_saved_object_error.tsx b/src/plugins/visualizations/public/components/visualization_missed_saved_object_error.tsx index 767a2d38f8581..338a8f6fe7201 100644 --- a/src/plugins/visualizations/public/components/visualization_missed_saved_object_error.tsx +++ b/src/plugins/visualizations/public/components/visualization_missed_saved_object_error.tsx @@ -12,28 +12,25 @@ import React from 'react'; import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import type { ApplicationStart } from '@kbn/core/public'; import { DATA_VIEW_SAVED_OBJECT_TYPE } from '@kbn/data-plugin/common'; -import type { ViewMode } from '@kbn/embeddable-plugin/common'; import type { RenderMode } from '@kbn/expressions-plugin/common'; interface VisualizationMissedSavedObjectErrorProps { savedObjectMeta: { savedObjectType: typeof DATA_VIEW_SAVED_OBJECT_TYPE | 'search'; - savedObjectId?: string; }; application: ApplicationStart; - viewMode: ViewMode; + message: string; renderMode: RenderMode; } export const VisualizationMissedSavedObjectError = ({ savedObjectMeta, application, - viewMode, + message, renderMode, }: VisualizationMissedSavedObjectErrorProps) => { const { management: isManagementEnabled } = application.capabilities.navLinks; const isIndexPatternManagementEnabled = application.capabilities.management.kibana.indexPatterns; - const isEditVisEnabled = application.capabilities.visualize?.save; return ( <EuiEmptyPrompt @@ -59,33 +56,7 @@ export const VisualizationMissedSavedObjectError = ({ </RedirectAppLinks> ) : null } - body={ - <> - <p> - {i18n.translate('visualizations.missedDataView.errorMessage', { - defaultMessage: `Could not find the {type}: {id}`, - values: { - id: savedObjectMeta.savedObjectId ?? '-', - type: - savedObjectMeta.savedObjectType === 'search' - ? i18n.translate('visualizations.noSearch.label', { - defaultMessage: 'search', - }) - : i18n.translate('visualizations.noDataView.label', { - defaultMessage: 'data view', - }), - }, - })} - </p> - {viewMode === 'edit' && renderMode !== 'edit' && isEditVisEnabled ? ( - <p> - {i18n.translate('visualizations.missedDataView.editInVisualizeEditor', { - defaultMessage: `Edit in Visualize editor to fix the error`, - })} - </p> - ) : null} - </> - } + body={<p>{message}</p>} /> ); }; diff --git a/src/plugins/visualizations/public/convert_to_lens/index.ts b/src/plugins/visualizations/public/convert_to_lens/index.ts index 73509d49157ae..46fca64199ae1 100644 --- a/src/plugins/visualizations/public/convert_to_lens/index.ts +++ b/src/plugins/visualizations/public/convert_to_lens/index.ts @@ -8,8 +8,10 @@ export { getColumnsFromVis } from './schemas'; export { + convertToFiltersColumn, getPercentageColumnFormulaColumn, getPalette, + getPaletteFromStopsWithColors, getPercentageModeConfig, createStaticValueColumn, } from '../../common/convert_to_lens/lib'; diff --git a/src/plugins/visualizations/public/convert_to_lens/schemas.test.ts b/src/plugins/visualizations/public/convert_to_lens/schemas.test.ts index 54975d08b8486..aa338db367988 100644 --- a/src/plugins/visualizations/public/convert_to_lens/schemas.test.ts +++ b/src/plugins/visualizations/public/convert_to_lens/schemas.test.ts @@ -70,7 +70,9 @@ describe('getColumnsFromVis', () => { ); const aggConfig = new AggConfig(aggConfigs, {} as AggConfigOptions); - const vis = {} as Vis; + const vis = { + type: { name: 'heatmap' }, + } as Vis; beforeEach(() => { jest.clearAllMocks(); mockGetVisSchemas.mockReturnValue({}); diff --git a/src/plugins/visualizations/public/convert_to_lens/schemas.ts b/src/plugins/visualizations/public/convert_to_lens/schemas.ts index 3a225e540faae..1b44f7cdffda1 100644 --- a/src/plugins/visualizations/public/convert_to_lens/schemas.ts +++ b/src/plugins/visualizations/public/convert_to_lens/schemas.ts @@ -33,6 +33,7 @@ const areVisSchemasValid = (visSchemas: Schemas, unsupported: Array<keyof Schema }; const createLayer = ( + visType: string, visSchemas: Schemas, allMetrics: Array<SchemaConfig<METRIC_TYPES>>, metricsForLayer: Array<SchemaConfig<METRIC_TYPES>>, @@ -52,7 +53,7 @@ const createLayer = ( dropEmptyRowsInDateHistogram?: boolean ) => { const metricColumns = metricsForLayer.flatMap((m) => - convertMetricToColumns(m, dataView, allMetrics, percentageModeConfig) + convertMetricToColumns({ agg: m, dataView, aggs: allMetrics, visType }, percentageModeConfig) ); if (metricColumns.includes(null)) { return null; @@ -60,6 +61,7 @@ const createLayer = ( const metricColumnsWithoutNull = metricColumns as AggBasedColumn[]; const { customBucketColumns, customBucketsMap } = getCustomBucketColumns( + visType, customBucketsWithMetricIds, metricColumnsWithoutNull, dataView, @@ -72,6 +74,7 @@ const createLayer = ( } const bucketColumns = getBucketColumns( + visType, visSchemas, buckets, dataView, @@ -84,6 +87,7 @@ const createLayer = ( } const splitBucketColumns = getBucketColumns( + visType, visSchemas, splits, dataView, @@ -181,6 +185,7 @@ export const getColumnsFromVis = <T>( c.metricIds.some((m) => metricAggIds.includes(m)) ); const layer = createLayer( + vis.type.name, visSchemas, aggs, metrics, @@ -197,6 +202,7 @@ export const getColumnsFromVis = <T>( } } else { const layer = createLayer( + vis.type.name, visSchemas, aggs, aggs, diff --git a/src/plugins/visualizations/public/convert_to_lens/utils.test.ts b/src/plugins/visualizations/public/convert_to_lens/utils.test.ts index 50f667430a8cb..8c36b28452271 100644 --- a/src/plugins/visualizations/public/convert_to_lens/utils.test.ts +++ b/src/plugins/visualizations/public/convert_to_lens/utils.test.ts @@ -213,6 +213,7 @@ describe('getBucketCollapseFn', () => { describe('getBucketColumns', () => { const dataView = stubLogstashDataView; + const visType = 'heatmap'; beforeEach(() => { jest.clearAllMocks(); @@ -228,7 +229,7 @@ describe('getBucketColumns', () => { [bucketKey]: [], }; - expect(getBucketColumns(visSchemas, keys, dataView, false, [])).toEqual([]); + expect(getBucketColumns(visType, visSchemas, keys, dataView, false, [])).toEqual([]); expect(mockConvertBucketToColumns).toBeCalledTimes(0); }); @@ -254,7 +255,7 @@ describe('getBucketColumns', () => { }; mockConvertBucketToColumns.mockReturnValueOnce(null); - expect(getBucketColumns(visSchemas, keys, dataView, false, [])).toBeNull(); + expect(getBucketColumns(visType, visSchemas, keys, dataView, false, [])).toBeNull(); expect(mockConvertBucketToColumns).toBeCalledTimes(1); }); @@ -280,7 +281,7 @@ describe('getBucketColumns', () => { }; mockConvertBucketToColumns.mockReturnValueOnce([null]); - expect(getBucketColumns(visSchemas, keys, dataView, false, [])).toBeNull(); + expect(getBucketColumns(visType, visSchemas, keys, dataView, false, [])).toBeNull(); expect(mockConvertBucketToColumns).toBeCalledTimes(1); }); test('should return columns', () => { @@ -319,7 +320,7 @@ describe('getBucketColumns', () => { mockConvertBucketToColumns.mockReturnValue(returnValue); - expect(getBucketColumns(visSchemas, keys, dataView, false, [])).toEqual([ + expect(getBucketColumns(visType, visSchemas, keys, dataView, false, [])).toEqual([ ...returnValue, ...returnValue, ]); @@ -592,6 +593,8 @@ describe('sortColumns', () => { }); describe('getColumnIds', () => { + const visType = 'heatmap'; + const colId1 = '0_agg_id'; const colId2 = '1_agg_id'; const colId3 = '2_agg_id'; @@ -694,6 +697,7 @@ describe('getColumnIds', () => { }); expect( getCustomBucketColumns( + visType, customBucketsWithMetricIds, [ { columnId: 'col-3', meta: { aggId: '3' } }, diff --git a/src/plugins/visualizations/public/convert_to_lens/utils.ts b/src/plugins/visualizations/public/convert_to_lens/utils.ts index ba05d29cdeea9..531746ff86d87 100644 --- a/src/plugins/visualizations/public/convert_to_lens/utils.ts +++ b/src/plugins/visualizations/public/convert_to_lens/utils.ts @@ -63,6 +63,7 @@ export const getBucketCollapseFn = ( }; export const getBucketColumns = ( + visType: string, visSchemas: Schemas, keys: Array<keyof Schemas>, dataView: DataView, @@ -78,6 +79,7 @@ export const getBucketColumns = ( { agg: m, dataView, + visType, metricColumns, aggs: visSchemas.metric as Array<SchemaConfig<METRIC_TYPES>>, }, @@ -154,6 +156,7 @@ export const sortColumns = ( export const getColumnIds = (columns: AggBasedColumn[]) => columns.map(({ columnId }) => columnId); export const getCustomBucketColumns = ( + visType: string, customBucketsWithMetricIds: Array<{ customBucket: IAggConfig; metricIds: string[]; @@ -167,7 +170,7 @@ export const getCustomBucketColumns = ( const customBucketsMap: Record<string, string> = {}; customBucketsWithMetricIds.forEach((customBucketWithMetricIds) => { const customBucketColumn = convertBucketToColumns( - { agg: customBucketWithMetricIds.customBucket, dataView, metricColumns, aggs }, + { agg: customBucketWithMetricIds.customBucket, dataView, metricColumns, aggs, visType }, true, dropEmptyRowsInDateHistogram ); diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx b/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx index f2a2a7f8ae000..663d015c429de 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx @@ -29,7 +29,6 @@ import { IContainer, ReferenceOrValueEmbeddable, SavedObjectEmbeddableInput, - ViewMode, } from '@kbn/embeddable-plugin/public'; import { ExpressionAstExpression, @@ -401,6 +400,25 @@ export class VisualizeEmbeddable this.abortController.abort(); } this.renderComplete.dispatchError(); + + if (isFallbackDataView(this.vis.data.indexPattern)) { + error = new Error( + i18n.translate('visualizations.missedDataView.errorMessage', { + defaultMessage: `Could not find the {type}: {id}`, + values: { + id: this.vis.data.indexPattern.id ?? '-', + type: this.vis.data.savedSearchId + ? i18n.translate('visualizations.noSearch.label', { + defaultMessage: 'search', + }) + : i18n.translate('visualizations.noDataView.label', { + defaultMessage: 'data view', + }), + }, + }) + ); + } + this.updateOutput({ ...this.getOutput(), rendered: true, @@ -503,7 +521,7 @@ export class VisualizeEmbeddable const { error } = this.getOutput(); if (error) { - render(this.catchError(error), this.domNode); + render(this.renderError(error), this.domNode); } }) ); @@ -511,17 +529,16 @@ export class VisualizeEmbeddable await this.updateHandler(); } - public catchError(error: ErrorLike | string) { + private renderError(error: ErrorLike | string) { if (isFallbackDataView(this.vis.data.indexPattern)) { return ( <VisualizationMissedSavedObjectError - viewMode={this.input.viewMode ?? ViewMode.VIEW} renderMode={this.input.renderMode ?? 'view'} savedObjectMeta={{ - savedObjectId: this.vis.data.indexPattern.id, savedObjectType: this.vis.data.savedSearchId ? 'search' : DATA_VIEW_SAVED_OBJECT_TYPE, }} application={getApplication()} + message={typeof error === 'string' ? error : error.message} /> ); } diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx b/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx index 4dcaa582511c3..93b19953b9b91 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx @@ -134,7 +134,7 @@ export class VisualizeEmbeddableFactory public getDisplayName() { return i18n.translate('visualizations.displayName', { - defaultMessage: 'Visualization', + defaultMessage: 'visualization', }); } diff --git a/src/plugins/visualizations/public/visualize_app/components/visualize_byvalue_editor.tsx b/src/plugins/visualizations/public/visualize_app/components/visualize_byvalue_editor.tsx index b9ff8d98f2ced..8cc220e77c8bc 100644 --- a/src/plugins/visualizations/public/visualize_app/components/visualize_byvalue_editor.tsx +++ b/src/plugins/visualizations/public/visualize_app/components/visualize_byvalue_editor.tsx @@ -110,6 +110,7 @@ export const VisualizeByValueEditor = ({ onAppLeave }: VisualizeAppProps) => { visEditorRef={visEditorRef} embeddableId={embeddableId} onAppLeave={onAppLeave} + eventEmitter={eventEmitter} /> ); }; diff --git a/src/plugins/visualizations/public/visualize_app/components/visualize_editor.tsx b/src/plugins/visualizations/public/visualize_app/components/visualize_editor.tsx index 480f0c3d36ee1..221cdcc9d8e10 100644 --- a/src/plugins/visualizations/public/visualize_app/components/visualize_editor.tsx +++ b/src/plugins/visualizations/public/visualize_app/components/visualize_editor.tsx @@ -110,6 +110,7 @@ export const VisualizeEditor = ({ onAppLeave }: VisualizeAppProps) => { visEditorRef={visEditorRef} onAppLeave={onAppLeave} embeddableId={embeddableIdValue} + eventEmitter={eventEmitter} /> ); }; diff --git a/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx b/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx index 4598d2d23e613..7fa6418aa261b 100644 --- a/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx +++ b/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx @@ -7,6 +7,7 @@ */ import './visualize_editor.scss'; +import { EventEmitter } from 'events'; import React, { RefObject, useCallback, useEffect } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; @@ -48,6 +49,7 @@ interface VisualizeEditorCommonProps { originatingPath?: string; visualizationIdFromUrl?: string; embeddableId?: string; + eventEmitter?: EventEmitter; } export const VisualizeEditorCommon = ({ @@ -66,6 +68,7 @@ export const VisualizeEditorCommon = ({ visualizationIdFromUrl, embeddableId, visEditorRef, + eventEmitter, }: VisualizeEditorCommonProps) => { const { services } = useKibana<VisualizeServices>(); @@ -148,6 +151,7 @@ export const VisualizeEditorCommon = ({ visualizationIdFromUrl={visualizationIdFromUrl} embeddableId={embeddableId} onAppLeave={onAppLeave} + eventEmitter={eventEmitter} /> )} {visInstance?.vis?.type?.stage === 'experimental' && diff --git a/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx b/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx index e7512c6dd6473..2deffa0c511b3 100644 --- a/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx +++ b/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx @@ -7,7 +7,7 @@ */ import React, { memo, useCallback, useMemo, useState, useEffect } from 'react'; - +import { EventEmitter } from 'events'; import { AppMountParameters, OverlayRef } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import useLocalStorage from 'react-use/lib/useLocalStorage'; @@ -40,6 +40,7 @@ interface VisualizeTopNavProps { visualizationIdFromUrl?: string; embeddableId?: string; onAppLeave: AppMountParameters['onAppLeave']; + eventEmitter?: EventEmitter; } const TopNav = ({ @@ -57,6 +58,7 @@ const TopNav = ({ visualizationIdFromUrl, embeddableId, onAppLeave, + eventEmitter, }: VisualizeTopNavProps) => { const { services } = useKibana<VisualizeServices>(); const { TopNavMenu } = services.navigation.ui; @@ -114,7 +116,9 @@ const TopNav = ({ vis.type, vis.params, uiStateJSON?.vis, + uiStateJSON?.table, vis.data.indexPattern, + eventEmitter, ]); const displayEditInLensItem = Boolean(vis.type.navigateToLens && editInLensConfig); @@ -139,6 +143,7 @@ const TopNav = ({ hideLensBadge, setNavigateToLens, showBadge: !hideTryInLensBadge && displayEditInLensItem, + eventEmitter, }, services ); @@ -161,6 +166,7 @@ const TopNav = ({ displayEditInLensItem, hideLensBadge, hideTryInLensBadge, + eventEmitter, ]); const [indexPatterns, setIndexPatterns] = useState<DataView[]>([]); const showDatePicker = () => { diff --git a/src/plugins/visualizations/public/visualize_app/utils/get_top_nav_config.tsx b/src/plugins/visualizations/public/visualize_app/utils/get_top_nav_config.tsx index 36b92585f1096..cab3d41ff8266 100644 --- a/src/plugins/visualizations/public/visualize_app/utils/get_top_nav_config.tsx +++ b/src/plugins/visualizations/public/visualize_app/utils/get_top_nav_config.tsx @@ -8,6 +8,7 @@ import React from 'react'; import moment from 'moment'; +import EventEmitter from 'events'; import { i18n } from '@kbn/i18n'; import { EuiBetaBadgeProps } from '@elastic/eui'; import { parse } from 'query-string'; @@ -71,6 +72,7 @@ export interface TopNavConfigParams { hideLensBadge: () => void; setNavigateToLens: (flag: boolean) => void; showBadge: boolean; + eventEmitter?: EventEmitter; } const SavedObjectSaveModalDashboard = withSuspense(LazySavedObjectSaveModalDashboard); @@ -102,6 +104,7 @@ export const getTopNavConfig = ( hideLensBadge, setNavigateToLens, showBadge, + eventEmitter, }: TopNavConfigParams, { data, @@ -301,6 +304,10 @@ export const getTopNavConfig = ( }, }), run: async () => { + // lens doesn't support saved searches, should unlink before transition + if (eventEmitter && visInstance.vis.data.savedSearchId) { + eventEmitter.emit('unlinkFromSavedSearch', false); + } const updatedWithMeta = { ...editInLensConfig, savedObjectId: visInstance.vis.id, diff --git a/src/plugins/visualizations/public/visualize_app/utils/use/use_linked_search_updates.ts b/src/plugins/visualizations/public/visualize_app/utils/use/use_linked_search_updates.ts index 8d7f2a8ef61f4..ffd23ec06aea6 100644 --- a/src/plugins/visualizations/public/visualize_app/utils/use/use_linked_search_updates.ts +++ b/src/plugins/visualizations/public/visualize_app/utils/use/use_linked_search_updates.ts @@ -29,7 +29,7 @@ export const useLinkedSearchUpdates = ( // SearchSource is a promise-based stream of search results that can inherit from other search sources. const { searchSource } = visInstance.vis.data; - const unlinkFromSavedSearch = () => { + const unlinkFromSavedSearch = (showToast: boolean = true) => { const searchSourceParent = savedSearch.searchSource; const searchSourceGrandparent = searchSourceParent?.getParent(); const currentIndex = searchSourceParent?.getField('index'); @@ -44,14 +44,16 @@ export const useLinkedSearchUpdates = ( parentFilters: (searchSourceParent?.getOwnField('filter') as Filter[]) || [], }); - services.toastNotifications.addSuccess( - i18n.translate('visualizations.linkedToSearch.unlinkSuccessNotificationText', { - defaultMessage: `Unlinked from saved search '{searchTitle}'`, - values: { - searchTitle: savedSearch.title, - }, - }) - ); + if (showToast) { + services.toastNotifications.addSuccess( + i18n.translate('visualizations.linkedToSearch.unlinkSuccessNotificationText', { + defaultMessage: `Unlinked from saved search '{searchTitle}'`, + values: { + searchTitle: savedSearch.title, + }, + }) + ); + } }; eventEmitter.on('unlinkFromSavedSearch', unlinkFromSavedSearch); diff --git a/src/plugins/visualizations/tsconfig.json b/src/plugins/visualizations/tsconfig.json index 6a533c71facd7..7f00434c6181e 100644 --- a/src/plugins/visualizations/tsconfig.json +++ b/src/plugins/visualizations/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "server/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../charts/tsconfig.json" }, { "path": "../data/tsconfig.json" }, diff --git a/src/setup_node_env/tsconfig.json b/src/setup_node_env/tsconfig.json new file mode 100644 index 0000000000000..c7c05f89d04a6 --- /dev/null +++ b/src/setup_node_env/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "harden/**/*", + "root/**/*", + "*.js", + ], + "kbn_references": [ + { "path": "../../tsconfig.json" }, + ] +} diff --git a/test/accessibility/services/a11y/a11y.ts b/test/accessibility/services/a11y/a11y.ts index dd0d6c7f682e3..1215af1d106dc 100644 --- a/test/accessibility/services/a11y/a11y.ts +++ b/test/accessibility/services/a11y/a11y.ts @@ -12,7 +12,6 @@ import { AXE_CONFIG, AXE_OPTIONS } from '@kbn/axe-config'; import { FtrService } from '../../ftr_provider_context'; import { AxeReport, printResult } from './axe_report'; -// @ts-ignore JS that is run in browser as is import { analyzeWithAxe, analyzeWithAxeWithClient } from './analyze_with_axe'; interface AxeContext { diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json b/test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json index c54e279cedf8c..7231438f0b0e0 100644 --- a/test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json +++ b/test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json @@ -11,7 +11,7 @@ "../../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../../src/core/tsconfig.json" } ] } diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json b/test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json index d1faee2d113b6..483252cfa6fd9 100644 --- a/test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json +++ b/test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json @@ -10,7 +10,7 @@ "../../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../../src/core/tsconfig.json" } ] } diff --git a/test/analytics/tests/instrumented_events/from_the_browser/core_context_providers.ts b/test/analytics/tests/instrumented_events/from_the_browser/core_context_providers.ts index 3d0b018156ce7..79e43f0df086f 100644 --- a/test/analytics/tests/instrumented_events/from_the_browser/core_context_providers.ts +++ b/test/analytics/tests/instrumented_events/from_the_browser/core_context_providers.ts @@ -91,5 +91,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(event.context).not.to.have.property('cloudId'); } }); + + it('should have the properties provided by the "viewport_size" context provider', async () => { + expect(event.context).to.have.property('viewport_width'); + expect(event.context.viewport_width).to.be.a('number'); + expect(event.context).to.have.property('viewport_height'); + expect(event.context.viewport_height).to.be.a('number'); + }); }); } diff --git a/test/analytics/tests/instrumented_events/from_the_browser/index.ts b/test/analytics/tests/instrumented_events/from_the_browser/index.ts index 7c6ee6ff1e2af..c69f091cc4543 100644 --- a/test/analytics/tests/instrumented_events/from_the_browser/index.ts +++ b/test/analytics/tests/instrumented_events/from_the_browser/index.ts @@ -15,5 +15,6 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./loaded_kibana')); loadTestFile(require.resolve('./loaded_dashboard')); loadTestFile(require.resolve('./core_context_providers')); + loadTestFile(require.resolve('./viewport_resize')); }); } diff --git a/test/analytics/tests/instrumented_events/from_the_browser/viewport_resize.ts b/test/analytics/tests/instrumented_events/from_the_browser/viewport_resize.ts new file mode 100644 index 0000000000000..f5e084810a375 --- /dev/null +++ b/test/analytics/tests/instrumented_events/from_the_browser/viewport_resize.ts @@ -0,0 +1,52 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../services'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const ebtUIHelper = getService('kibana_ebt_ui'); + const browser = getService('browser'); + const { common } = getPageObjects(['common']); + + describe('Event "viewport_resize"', () => { + beforeEach(async () => { + // Navigating to `home` with the Welcome prompt because some runs were flaky + // as we handle the Welcome screen only if the login prompt pops up. + // Otherwise, it stays in the Welcome screen :/ + await common.navigateToApp('home'); + }); + + it('should emit a "viewport_resize" event when the browser is resized', async () => { + const events = await ebtUIHelper.getEvents(1, { + eventTypes: ['viewport_resize'], + withTimeoutMs: 100, + }); + expect(events.length).to.be(0); + // Resize the window + await browser.setWindowSize(500, 500); + const { height, width } = await browser.getWindowSize(); + expect(height).to.eql(500); + expect(width).to.eql(500); + + const actualInnerHeight = await browser.execute(() => window.innerHeight); + expect(actualInnerHeight <= height).to.be(true); // The address bar takes some space when not running on HEADLESS + + const [event] = await ebtUIHelper.getEvents(1, { eventTypes: ['viewport_resize'] }); + expect(event.event_type).to.eql('viewport_resize'); + expect(event.properties).to.eql({ + viewport_width: 500, + viewport_height: actualInnerHeight, + }); + + // Validating that the context is also updated + expect(event.context.viewport_width).to.be(500); + expect(event.context.viewport_height).to.be(actualInnerHeight); + }); + }); +} diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/mappings.json b/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/mappings.json index f745e0f69c5d3..fb2337c15216c 100644 --- a/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/mappings.json +++ b/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/mappings.json @@ -523,7 +523,10 @@ "number_of_shards": "1", "priority": "10", "refresh_interval": "1s", - "routing_partition_size": "1" + "routing_partition_size": "1", + "mapping": { + "total_fields": { "limit": 1500 } + } } } } diff --git a/test/common/services/es_delete_all_indices.ts b/test/common/services/es_delete_all_indices.ts index c0ffa44c2e2c3..5f0ecba2cbde8 100644 --- a/test/common/services/es_delete_all_indices.ts +++ b/test/common/services/es_delete_all_indices.ts @@ -9,12 +9,11 @@ import { FtrProviderContext } from '../ftr_provider_context'; export function EsDeleteAllIndicesProvider({ getService }: FtrProviderContext) { - const es = getService('es'); const log = getService('log'); - async function deleteConcreteIndices(indices: string[]) { + async function deleteConcreteIndices(indices: string[], esNode: any) { try { - await es.indices.delete({ + await esNode.indices.delete({ index: indices, ignore_unavailable: true, }); @@ -23,7 +22,8 @@ export function EsDeleteAllIndicesProvider({ getService }: FtrProviderContext) { } } - return async (patterns: string | string[]) => { + return async (patterns: string | string[], remote: boolean = false) => { + const esNode = remote ? getService('remoteEs' as 'es') : getService('es'); for (const pattern of [patterns].flat()) { for (let attempt = 1; ; attempt++) { if (attempt > 5) { @@ -31,7 +31,7 @@ export function EsDeleteAllIndicesProvider({ getService }: FtrProviderContext) { } // resolve pattern to concrete index names - const resp = await es.indices.getAlias( + const resp = await esNode.indices.getAlias( { index: pattern, }, @@ -55,7 +55,7 @@ export function EsDeleteAllIndicesProvider({ getService }: FtrProviderContext) { ); // delete the concrete indexes we found and try again until this pattern resolves to no indexes - await deleteConcreteIndices(indices); + await deleteConcreteIndices(indices, esNode); } } }; diff --git a/test/functional/apps/context/_context_navigation.ts b/test/functional/apps/context/_context_navigation.ts index d87ef6275f3d3..2451e351b6d9c 100644 --- a/test/functional/apps/context/_context_navigation.ts +++ b/test/functional/apps/context/_context_navigation.ts @@ -26,6 +26,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const filterBar = getService('filterBar'); const find = getService('find'); + const checkMainViewFilters = async () => { + for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) { + expect(await filterBar.hasFilter(columnName, value, true)).to.eql(true); + } + expect(await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes()).to.eql({ + start: 'Sep 18, 2015 @ 06:31:44.000', + end: 'Sep 23, 2015 @ 18:31:44.000', + }); + }; + describe('discover - context - back navigation', function contextSize() { before(async () => { await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); @@ -75,13 +85,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await find.clickByCssSelector(`[data-test-subj="breadcrumb first"]`); await PageObjects.discover.waitForDocTableLoadingComplete(); - for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) { - expect(await filterBar.hasFilter(columnName, value)).to.eql(true); - } - expect(await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes()).to.eql({ - start: 'Sep 18, 2015 @ 06:31:44.000', - end: 'Sep 23, 2015 @ 18:31:44.000', - }); + await checkMainViewFilters(); return true; } ); @@ -100,16 +104,42 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await find.clickByCssSelector(`[data-test-subj="breadcrumb first"]`); await PageObjects.discover.waitForDocTableLoadingComplete(); - for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) { - expect(await filterBar.hasFilter(columnName, value)).to.eql(true); - } - expect(await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes()).to.eql({ - start: 'Sep 18, 2015 @ 06:31:44.000', - end: 'Sep 23, 2015 @ 18:31:44.000', - }); + await checkMainViewFilters(); return true; } ); }); + + it('should go back via breadcrumbs with updated state after a goBack browser', async function () { + await dataGrid.clickRowToggle({ rowIndex: 0 }); + const rowActions = await dataGrid.getRowActions({ rowIndex: 0 }); + await rowActions[1].click(); + await PageObjects.context.waitUntilContextLoadingHasFinished(); + + await PageObjects.common.sleep(5000); + + // update url state + await filterBar.removeFilter('agent'); + await PageObjects.header.waitUntilLoadingHasFinished(); + + await find.clickByCssSelector(`[data-test-subj="breadcrumb first"]`); + await PageObjects.header.waitUntilLoadingHasFinished(); + + expect(await filterBar.getFilterCount()).to.eql(2); + await checkMainViewFilters(); + + await browser.goBack(); + await PageObjects.context.waitUntilContextLoadingHasFinished(); + + expect(await filterBar.getFilterCount()).to.eql(1); + const [filterName, filterValue] = TEST_FILTER_COLUMN_NAMES[1]; + expect(await filterBar.hasFilter(filterName, filterValue, false)).to.eql(true); + + await find.clickByCssSelector(`[data-test-subj="breadcrumb first"]`); + await PageObjects.header.waitUntilLoadingHasFinished(); + + expect(await filterBar.getFilterCount()).to.eql(2); + await checkMainViewFilters(); + }); }); } diff --git a/test/functional/apps/context/_discover_navigation.ts b/test/functional/apps/context/_discover_navigation.ts index 52efeefeb6546..d955b02599856 100644 --- a/test/functional/apps/context/_discover_navigation.ts +++ b/test/functional/apps/context/_discover_navigation.ts @@ -143,10 +143,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const rowActions = await dataGrid.getRowActions({ rowIndex: 0 }); await rowActions[0].click(); await PageObjects.common.sleep(250); - // accept alert if it pops up + + // close popup const alert = await browser.getAlert(); await alert?.accept(); - expect(await browser.getCurrentUrl()).to.contain('#/doc'); + if (await testSubjects.exists('confirmModalConfirmButton')) { + await testSubjects.click('confirmModalConfirmButton'); + } + + await retry.waitFor('navigate to doc view', async () => { + const currentUrl = await browser.getCurrentUrl(); + return currentUrl.includes('#/doc'); + }); await retry.waitFor('doc view being rendered', async () => { return await PageObjects.discover.isShowingDocViewer(); }); diff --git a/test/functional/apps/context/classic/_discover_navigation.ts b/test/functional/apps/context/classic/_discover_navigation.ts index 70047518979b0..cc265ecceaa53 100644 --- a/test/functional/apps/context/classic/_discover_navigation.ts +++ b/test/functional/apps/context/classic/_discover_navigation.ts @@ -33,7 +33,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const browser = getService('browser'); const kibanaServer = getService('kibanaServer'); - describe('context link in discover', () => { + describe('context link in discover classic', () => { before(async () => { await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update({ @@ -146,10 +146,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const rowActions = await docTable.getRowActions({ rowIndex: 0 }); await rowActions[1].click(); await PageObjects.common.sleep(250); - // accept alert if it pops up + + // close popup const alert = await browser.getAlert(); await alert?.accept(); - expect(await browser.getCurrentUrl()).to.contain('#/doc'); + if (await testSubjects.exists('confirmModalConfirmButton')) { + await testSubjects.click('confirmModalConfirmButton'); + } + + await retry.waitFor('navigate to doc view', async () => { + const currentUrl = await browser.getCurrentUrl(); + return currentUrl.includes('#/doc'); + }); await retry.waitFor('doc view being rendered', async () => { return await PageObjects.discover.isShowingDocViewer(); }); diff --git a/test/functional/apps/dashboard/group6/dashboard_error_handling.ts b/test/functional/apps/dashboard/group6/dashboard_error_handling.ts index 7e1956b82daf2..b00aec24809cc 100644 --- a/test/functional/apps/dashboard/group6/dashboard_error_handling.ts +++ b/test/functional/apps/dashboard/group6/dashboard_error_handling.ts @@ -51,14 +51,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // wrapping into own describe to make sure new tab is cleaned up even if test failed // see: https://github.com/elastic/kibana/pull/67280#discussion_r430528122 - describe('recreate index pattern link works', () => { - it('recreate index pattern link works', async () => { + describe('when the saved object is missing', () => { + it('shows the missing data view error message', async () => { await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.loadSavedDashboard('dashboard with missing index pattern'); await PageObjects.header.waitUntilLoadingHasFinished(); - const errorEmbeddable = await testSubjects.find('visualization-missed-data-view-error'); + const embeddableError = await testSubjects.find('embeddableError'); + const errorMessage = await embeddableError.getVisibleText(); - expect(await errorEmbeddable.isDisplayed()).to.be(true); + expect(errorMessage).to.contain('Could not find the data view'); }); }); }); diff --git a/test/functional/apps/dashboard_elements/controls/control_group_chaining.ts b/test/functional/apps/dashboard_elements/controls/control_group_chaining.ts index a27a1a4814cfb..652864471a04a 100644 --- a/test/functional/apps/dashboard_elements/controls/control_group_chaining.ts +++ b/test/functional/apps/dashboard_elements/controls/control_group_chaining.ts @@ -14,26 +14,58 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); const security = getService('security'); - const { dashboardControls, common, dashboard, timePicker } = getPageObjects([ + const { common, console, dashboard, dashboardControls, header, timePicker } = getPageObjects([ 'dashboardControls', 'timePicker', 'dashboard', + 'console', 'common', + 'header', ]); describe('Dashboard control group hierarchical chaining', () => { + const newDocuments: Array<{ index: string; id: string }> = []; let controlIds: string[]; - const ensureAvailableOptionsEql = async (controlId: string, expectation: string[]) => { + const ensureAvailableOptionsEql = async ( + controlId: string, + expectation: string[], + filterOutExists: boolean = true + ) => { await dashboardControls.optionsListOpenPopover(controlId); await retry.try(async () => { - expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql(expectation); + expect( + await dashboardControls.optionsListPopoverGetAvailableOptions(filterOutExists) + ).to.eql(expectation); }); await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); }; + const addDocument = async (index: string, document: string) => { + await console.enterRequest('\nPOST ' + index + '/_doc/ \n{\n ' + document); + await console.clickPlay(); + await header.waitUntilLoadingHasFinished(); + const response = JSON.parse(await console.getResponse()); + newDocuments.push({ index, id: response._id }); + }; + before(async () => { await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']); + + /* start by adding some incomplete data so that we can test `exists` query */ + await common.navigateToApp('console'); + await console.collapseHelp(); + await console.clearTextArea(); + await addDocument( + 'animals-cats-2018-01-01', + '"@timestamp": "2018-01-01T16:00:00.000Z", \n"animal": "cat"' + ); + await addDocument( + 'animals-dogs-2018-01-01', + '"@timestamp": "2018-01-01T16:00:00.000Z", \n"name": "Max", \n"sound": "woof"' + ); + + /* then, create our testing dashboard */ await common.navigateToApp('dashboard'); await dashboard.gotoDashboardLandingPage(); await dashboard.clickNewDashboard(); @@ -65,6 +97,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); after(async () => { + await common.navigateToApp('console'); + await console.collapseHelp(); + await console.clearTextArea(); + for (const { index, id } of newDocuments) { + await console.enterRequest(`\nDELETE /${index}/_doc/${id}`); + await console.clickPlay(); + await header.waitUntilLoadingHasFinished(); + } await security.testUser.restoreDefaults(); }); @@ -123,6 +163,60 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ]); }); + it('Excluding selections in the first control will validate the second and third controls', async () => { + await dashboardControls.optionsListOpenPopover(controlIds[0]); + await dashboardControls.optionsListPopoverSetIncludeSelections(false); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); + + await ensureAvailableOptionsEql(controlIds[1], ['Tiger', 'sylvester', 'Max']); + await ensureAvailableOptionsEql(controlIds[2], ['meow', 'hiss']); + }); + + it('Excluding all options of first control removes all options in second and third controls', async () => { + await dashboardControls.optionsListOpenPopover(controlIds[0]); + await dashboardControls.optionsListPopoverSelectOption('cat'); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); + + await dashboardControls.optionsListOpenPopover(controlIds[1]); + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(1); + await dashboardControls.optionsListOpenPopover(controlIds[2]); + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(1); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[2]); + }); + + it('Creating "does not exist" query from first control filters the second and third controls', async () => { + await dashboardControls.optionsListOpenPopover(controlIds[0]); + await dashboardControls.optionsListPopoverSelectOption('exists'); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); + await dashboard.waitForRenderComplete(); + + await dashboardControls.optionsListOpenPopover(controlIds[1]); + await dashboardControls.optionsListPopoverClearSelections(); + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(1); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql(['Max']); + + await dashboardControls.optionsListOpenPopover(controlIds[2]); + await dashboardControls.optionsListPopoverClearSelections(); + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(1); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql(['woof']); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[2]); + }); + + it('Creating "exists" query from first control filters the second and third controls', async () => { + await dashboardControls.optionsListOpenPopover(controlIds[0]); + await dashboardControls.optionsListPopoverSetIncludeSelections(true); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); + await dashboard.waitForRenderComplete(); + + await dashboardControls.optionsListOpenPopover(controlIds[1]); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.not.contain('Max'); + await dashboardControls.optionsListOpenPopover(controlIds[2]); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.not.contain( + 'woof' + ); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[2]); + }); + describe('Hierarchical chaining off', async () => { before(async () => { await dashboardControls.updateChainingSystem('NONE'); @@ -139,6 +233,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'sylvester', 'Fee Fee', 'Rover', + 'Max', ]); await ensureAvailableOptionsEql(controlIds[2], [ 'hiss', @@ -149,6 +244,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'growl', 'grr', 'bow ow ow', + 'woof', ]); }); }); diff --git a/test/functional/apps/dashboard_elements/controls/options_list.ts b/test/functional/apps/dashboard_elements/controls/options_list.ts index 0c8dea528d9e4..6cfe2c31fa0c1 100644 --- a/test/functional/apps/dashboard_elements/controls/options_list.ts +++ b/test/functional/apps/dashboard_elements/controls/options_list.ts @@ -21,10 +21,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const testSubjects = getService('testSubjects'); const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardPanelActions = getService('dashboardPanelActions'); - const { dashboardControls, timePicker, common, dashboard, header } = getPageObjects([ + + const { dashboardControls, timePicker, console, common, dashboard, header } = getPageObjects([ 'dashboardControls', 'timePicker', 'dashboard', + 'console', 'common', 'header', ]); @@ -32,8 +34,29 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const DASHBOARD_NAME = 'Test Options List Control'; describe('Dashboard options list integration', () => { + const newDocuments: Array<{ index: string; id: string }> = []; + + const addDocument = async (index: string, document: string) => { + await console.enterRequest('\nPOST ' + index + '/_doc/ \n{\n ' + document); + await console.clickPlay(); + await header.waitUntilLoadingHasFinished(); + const response = JSON.parse(await console.getResponse()); + newDocuments.push({ index, id: response._id }); + }; + before(async () => { await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']); + + /* start by adding some incomplete data so that we can test `exists` query */ + await common.navigateToApp('console'); + await console.collapseHelp(); + await console.clearTextArea(); + await addDocument( + 'animals-cats-2018-01-01', + '"@timestamp": "2018-01-01T16:00:00.000Z", \n"name": "Rosie", \n"sound": "hiss"' + ); + + /* then, create our testing dashboard */ await common.navigateToApp('dashboard'); await dashboard.gotoDashboardLandingPage(); await dashboard.clickNewDashboard(); @@ -215,7 +238,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Applies query settings to controls', async () => { it('Applies dashboard query to options list control', async () => { - await queryBar.setQuery('isDog : true '); + await queryBar.setQuery('animal.keyword : "dog" '); await queryBar.submitQuery(); await dashboard.waitForRenderComplete(); await header.waitUntilLoadingHasFinished(); @@ -336,10 +359,75 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const selectionString = await dashboardControls.optionsListGetSelectionsString(controlId); expect(selectionString).to.be('hiss, grr'); + }); + + it('excluding selections has expected results', async () => { + await dashboard.clickQuickSave(); + await dashboard.waitForRenderComplete(); await dashboardControls.optionsListOpenPopover(controlId); - await dashboardControls.optionsListPopoverClearSelections(); + await dashboardControls.optionsListPopoverSetIncludeSelections(false); await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + await dashboard.waitForRenderComplete(); + + expect(await pieChart.getPieSliceCount()).to.be(5); + await dashboard.clearUnsavedChanges(); + }); + + it('including selections has expected results', async () => { + await dashboardControls.optionsListOpenPopover(controlId); + await dashboardControls.optionsListPopoverSetIncludeSelections(true); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + await dashboard.waitForRenderComplete(); + + expect(await pieChart.getPieSliceCount()).to.be(2); + await dashboard.clearUnsavedChanges(); + }); + + describe('test exists query', async () => { + before(async () => { + await dashboardControls.deleteAllControls(); + await dashboardControls.createControl({ + controlType: OPTIONS_LIST_CONTROL, + dataViewTitle: 'animals-*', + fieldName: 'animal.keyword', + title: 'Animal', + }); + controlId = (await dashboardControls.getAllControlIds())[0]; + }); + + it('creating exists query has expected results', async () => { + expect((await pieChart.getPieChartValues())[0]).to.be(6); + await dashboardControls.optionsListOpenPopover(controlId); + await dashboardControls.optionsListPopoverSelectOption('exists'); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + await dashboard.waitForRenderComplete(); + + expect(await pieChart.getPieSliceCount()).to.be(5); + expect((await pieChart.getPieChartValues())[0]).to.be(5); + }); + + it('negating exists query has expected results', async () => { + await dashboardControls.optionsListOpenPopover(controlId); + await dashboardControls.optionsListPopoverSetIncludeSelections(false); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + await dashboard.waitForRenderComplete(); + + expect(await pieChart.getPieSliceCount()).to.be(1); + expect((await pieChart.getPieChartValues())[0]).to.be(1); + }); + }); + + after(async () => { + await dashboardControls.deleteAllControls(); + + await dashboardControls.createControl({ + controlType: OPTIONS_LIST_CONTROL, + dataViewTitle: 'animals-*', + fieldName: 'sound.keyword', + title: 'Animal Sounds', + }); + controlId = (await dashboardControls.getAllControlIds())[0]; }); }); @@ -359,7 +447,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('Can mark selections invalid with Query', async () => { - await queryBar.setQuery('isDog : false '); + await queryBar.setQuery('NOT animal.keyword : "dog" '); await queryBar.submitQuery(); await dashboard.waitForRenderComplete(); await header.waitUntilLoadingHasFinished(); @@ -408,7 +496,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('Does not mark selections invalid with Query', async () => { - await queryBar.setQuery('isDog : false '); + await queryBar.setQuery('NOT animal.keyword : "dog" '); await queryBar.submitQuery(); await dashboard.waitForRenderComplete(); await header.waitUntilLoadingHasFinished(); @@ -427,8 +515,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await filterBar.removeAllFilters(); await queryBar.clickQuerySubmitButton(); await dashboardControls.clearAllControls(); - await security.testUser.restoreDefaults(); }); }); + + after(async () => { + await common.navigateToApp('console'); + await console.collapseHelp(); + await console.clearTextArea(); + for (const { index, id } of newDocuments) { + await console.enterRequest(`\nDELETE /${index}/_doc/${id}`); + await console.clickPlay(); + await header.waitUntilLoadingHasFinished(); + } + await security.testUser.restoreDefaults(); + }); }); } diff --git a/test/functional/apps/discover/classic/_doc_table.ts b/test/functional/apps/discover/classic/_doc_table.ts index f44fcf7b578e6..36f180551938c 100644 --- a/test/functional/apps/discover/classic/_doc_table.ts +++ b/test/functional/apps/discover/classic/_doc_table.ts @@ -21,16 +21,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']); const defaultSettings = { defaultIndex: 'logstash-*', + hideAnnouncements: true, }; const testSubjects = getService('testSubjects'); - // FLAKY Chrome 103+ https://github.com/elastic/kibana/issues/138652 - describe.skip('discover doc table', function describeIndexTests() { + describe('discover doc table', function describeIndexTests() { const rowsHardLimit = 500; before(async function () { log.debug('load kibana index with default index pattern'); - await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); + await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); // and load a set of makelogs data @@ -42,6 +42,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); after(async function () { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover.json'); + await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.uiSettings.replace({}); }); @@ -140,7 +142,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(skipButtonText === activeElementText).to.be(true); }); - describe('expand a document row', function () { + describe('expand a document row', async function () { const rowToInspect = 1; beforeEach(async function () { // close the toggle if open @@ -194,9 +196,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(defaultMessageElResubmit).to.be.ok(); }); }); + it('should show allow toggling columns from the expanded document', async function () { await PageObjects.discover.clickNewSearchButton(); - await testSubjects.click('dscExplorerCalloutClose'); await retry.try(async function () { await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 }); @@ -204,6 +206,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const fields = ['_id', '_index', 'agent']; for (const field of fields) { await testSubjects.click(`toggleColumnButton-${field}`); + await testSubjects.click(`tableDocViewRow-${field}`); // to suppress the appeared tooltip } const headerWithFields = await docTable.getHeaderFields(); @@ -212,6 +215,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // remove columns for (const field of fields) { await testSubjects.click(`toggleColumnButton-${field}`); + await testSubjects.click(`tableDocViewRow-${field}`); } const headerWithoutFields = await docTable.getHeaderFields(); @@ -220,7 +224,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('add and remove columns', function () { + describe('add and remove columns', async function () { const extraColumns = ['phpmemory', 'ip']; afterEach(async function () { @@ -234,6 +238,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { for (const column of extraColumns) { await PageObjects.discover.clearFieldSearchInput(); await PageObjects.discover.findFieldByName(column); + await retry.waitFor('field to appear', async function () { + return await testSubjects.exists(`field-${column}`); + }); await PageObjects.discover.clickFieldListItemAdd(column); await PageObjects.header.waitUntilLoadingHasFinished(); // test the header now @@ -247,7 +254,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { for (const column of extraColumns) { await PageObjects.discover.clearFieldSearchInput(); await PageObjects.discover.findFieldByName(column); - log.debug(`add a ${column} column`); + await retry.waitFor('field to appear', async function () { + return await testSubjects.exists(`field-${column}`); + }); await PageObjects.discover.clickFieldListItemAdd(column); await PageObjects.header.waitUntilLoadingHasFinished(); } diff --git a/test/functional/apps/discover/group1/_discover.ts b/test/functional/apps/discover/group1/_discover.ts index 4b5137fadeb5c..60f2a54dd01fd 100644 --- a/test/functional/apps/discover/group1/_discover.ts +++ b/test/functional/apps/discover/group1/_discover.ts @@ -26,8 +26,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { defaultIndex: 'logstash-*', }; - // FLAKY: https://github.com/elastic/kibana/issues/142222 - describe.skip('discover test', function describeIndexTests() { + describe('discover test', function describeIndexTests() { before(async function () { log.debug('load kibana index with default index pattern'); await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); @@ -370,14 +369,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.header.waitUntilLoadingHasFinished(); const dataViewId = await PageObjects.discover.getCurrentDataViewId(); - const originalUrl = await browser.getCurrentUrl(); const newUrl = originalUrl.replace(dataViewId, 'invalid-data-view-id'); await browser.get(newUrl); - await PageObjects.header.waitUntilLoadingHasFinished(); - expect(await browser.getCurrentUrl()).to.be(originalUrl); - expect(await testSubjects.exists('dscDataViewNotFoundShowDefaultWarning')).to.be(true); + await retry.try(async () => { + expect(await browser.getCurrentUrl()).to.be(originalUrl); + expect(await testSubjects.exists('dscDataViewNotFoundShowDefaultWarning')).to.be(true); + }); }); it('should show a warning and fall back to the current data view if the URL is updated to an invalid data view ID', async () => { @@ -385,14 +384,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.timePicker.setDefaultAbsoluteRange(); const originalHash = await browser.execute<[], string>('return window.location.hash'); const dataViewId = await PageObjects.discover.getCurrentDataViewId(); - const newHash = originalHash.replace(dataViewId, 'invalid-data-view-id'); await browser.execute(`window.location.hash = "${newHash}"`); await PageObjects.header.waitUntilLoadingHasFinished(); - - const currentHash = await browser.execute<[], string>('return window.location.hash'); - expect(currentHash).to.be(originalHash); - expect(await testSubjects.exists('dscDataViewNotFoundShowSavedWarning')).to.be(true); + await retry.try(async () => { + const currentHash = await browser.execute<[], string>('return window.location.hash'); + expect(currentHash).to.be(originalHash); + expect(await testSubjects.exists('dscDataViewNotFoundShowSavedWarning')).to.be(true); + }); }); }); }); diff --git a/test/functional/apps/discover/group2/_adhoc_data_views.ts b/test/functional/apps/discover/group2/_adhoc_data_views.ts index 9a1f4dd84d300..ebce26a4a4310 100644 --- a/test/functional/apps/discover/group2/_adhoc_data_views.ts +++ b/test/functional/apps/discover/group2/_adhoc_data_views.ts @@ -57,6 +57,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should navigate back correctly from to surrounding and single views', async () => { await PageObjects.discover.createAdHocDataView('logstash', true); await PageObjects.header.waitUntilLoadingHasFinished(); + const first = await PageObjects.discover.getCurrentDataViewId(); + + await PageObjects.discover.addRuntimeField( + '_bytes-runtimefield', + `emit(doc["bytes"].value.toString())` + ); + await PageObjects.discover.clickFieldListItemToggle('_bytes-runtimefield'); + + const second = await PageObjects.discover.getCurrentDataViewId(); + expect(first).not.to.equal(second); // navigate to context view await dataGrid.clickRowToggle({ rowIndex: 0 }); @@ -182,9 +192,34 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(+second).to.equal(+first * 2); }); - it('should update id after data view field edit', async () => { - await PageObjects.common.navigateToApp('discover'); + it('should open saved search by navigation to context from embeddable', async () => { + // navigate to context view + await dataGrid.clickRowToggle({ rowIndex: 0 }); + const [, surrDocs] = await dataGrid.getRowActions({ rowIndex: 0 }); + await surrDocs.click(); + + // close popup + const alert = await browser.getAlert(); + await alert?.accept(); + if (await testSubjects.exists('confirmModalConfirmButton')) { + await testSubjects.click('confirmModalConfirmButton'); + } + await PageObjects.context.waitUntilContextLoadingHasFinished(); + + // open saved search + await find.clickByCssSelector(`[data-test-subj="breadcrumb first"]`); await PageObjects.header.waitUntilLoadingHasFinished(); + + const savedSearch = await find.byCssSelector(`[data-test-subj="breadcrumb last"]`); + const savedSearchName = await savedSearch.getVisibleText(); + expect(savedSearchName).to.be.equal('logst*-ss-_bytes-runtimefield'); + + // test the header now + const header = await dataGrid.getHeaderFields(); + expect(header.join(' ')).to.have.string('_bytes-runtimefield'); + }); + + it('should update id after data view field edit', async () => { await PageObjects.discover.loadSavedSearch('logst*-ss-_bytes-runtimefield'); await PageObjects.header.waitUntilLoadingHasFinished(); @@ -227,13 +262,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await browser.goBack(); await PageObjects.header.waitUntilLoadingHasFinished(); - const firstToast = await toasts.getToastContent(1); - expect(firstToast).to.equal( + const [firstToast, secondToast] = await toasts.getAllToastElements(); + expect(await firstToast.getVisibleText()).to.equal( `"${first}" is not a configured data view ID\nShowing the saved data view: "logstas*" (${second})` ); - const secondToast = await toasts.getToastContent(2); - expect(secondToast).to.equal( + expect(await secondToast.getVisibleText()).to.equal( `Different index references\nData view id references in some of the applied filters differ from the current data view.` ); }); diff --git a/test/functional/apps/discover/group2/_data_grid_context.ts b/test/functional/apps/discover/group2/_data_grid_context.ts index 407ec8dd542f9..41a8d1aba6dea 100644 --- a/test/functional/apps/discover/group2/_data_grid_context.ts +++ b/test/functional/apps/discover/group2/_data_grid_context.ts @@ -20,6 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); const filterBar = getService('filterBar'); const dataGrid = getService('dataGrid'); + const testSubjects = getService('testSubjects'); const PageObjects = getPageObjects([ 'common', 'discover', @@ -107,12 +108,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dataGrid.clickRowToggle({ rowIndex: 0 }); const rowActions = await dataGrid.getRowActions({ rowIndex: 0 }); await rowActions[1].click(); - await PageObjects.common.sleep(250); - // accept alert if it pops up + + // close popup const alert = await browser.getAlert(); await alert?.accept(); - expect(await browser.getCurrentUrl()).to.contain('#/context'); - await PageObjects.header.waitUntilLoadingHasFinished(); + if (await testSubjects.exists('confirmModalConfirmButton')) { + await testSubjects.click('confirmModalConfirmButton'); + } + + await retry.waitFor('navigate to context', async () => { + const currentUrl = await browser.getCurrentUrl(); + return currentUrl.includes('#/context'); + }); await retry.waitFor('document table has a length of 6', async () => { const nrOfDocs = (await dataGrid.getBodyRows()).length; log.debug('document table length', nrOfDocs); diff --git a/test/functional/apps/management/_index_pattern_filter.ts b/test/functional/apps/management/_index_pattern_filter.ts index afa64c474d39d..0503ac2e4bf61 100644 --- a/test/functional/apps/management/_index_pattern_filter.ts +++ b/test/functional/apps/management/_index_pattern_filter.ts @@ -13,11 +13,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); const retry = getService('retry'); const PageObjects = getPageObjects(['settings']); - const esArchiver = getService('esArchiver'); describe('index pattern filter', function describeIndexTests() { before(async function () { - await esArchiver.emptyKibanaIndex(); + await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.uiSettings.replace({}); await PageObjects.settings.navigateTo(); await PageObjects.settings.clickKibanaIndexPatterns(); @@ -29,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { afterEach(async function () { await PageObjects.settings.removeIndexPattern(); + await kibanaServer.savedObjects.cleanStandardList(); }); it('should filter indexed fields', async function () { diff --git a/test/functional/page_objects/dashboard_page_controls.ts b/test/functional/page_objects/dashboard_page_controls.ts index 15510a07dccb0..461734c61d0ce 100644 --- a/test/functional/page_objects/dashboard_page_controls.ts +++ b/test/functional/page_objects/dashboard_page_controls.ts @@ -346,10 +346,11 @@ export class DashboardPageControls extends FtrService { return +(await availableOptions.getAttribute('data-option-count')); } - public async optionsListPopoverGetAvailableOptions() { - this.log.debug(`getting available options count from options list`); + public async optionsListPopoverGetAvailableOptions(filterOutExists: boolean = true) { + this.log.debug(`getting available options from options list`); const availableOptions = await this.testSubjects.find(`optionsList-control-available-options`); - return (await availableOptions.getVisibleText()).split('\n'); + const availableOptionsArray = (await availableOptions.getVisibleText()).split('\n'); + return filterOutExists ? availableOptionsArray.slice(1) : availableOptionsArray; } public async optionsListPopoverSearchForOption(search: string) { @@ -376,6 +377,19 @@ export class DashboardPageControls extends FtrService { await this.testSubjects.click(`optionsList-control-clear-all-selections`); } + public async optionsListPopoverSetIncludeSelections(include: boolean) { + this.log.debug(`exclude selections`); + await this.optionsListPopoverAssertOpen(); + + const buttonGroup = await this.testSubjects.find('optionsList__includeExcludeButtonGroup'); + await ( + await this.find.descendantDisplayedByCssSelector( + include ? '[data-text="Include"]' : '[data-text="Exclude"]', + buttonGroup + ) + ).click(); + } + /* ----------------------------------------------------------- Control editor flyout ----------------------------------------------------------- */ diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 85c93c0fc2847..44a29441d2707 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -243,6 +243,10 @@ export class DiscoverPageObject extends FtrService { return await this.testSubjects.getVisibleText('unifiedHistogramQueryHits'); } + public async getHitCountInt() { + return parseInt(await this.getHitCount(), 10); + } + public async getDocHeader() { const table = await this.getDocTable(); const docHeader = await table.getHeaders(); diff --git a/test/functional/page_objects/home_page.ts b/test/functional/page_objects/home_page.ts index c9dd27498c4ad..3c143fa29a7e5 100644 --- a/test/functional/page_objects/home_page.ts +++ b/test/functional/page_objects/home_page.ts @@ -131,7 +131,12 @@ export class HomePageObject extends FtrService { async launchSampleDataSet(id: string) { await this.addSampleDataSet(id); await this.common.closeToastIfExists(); - await this.testSubjects.click(`launchSampleDataSet${id}`); + await this.retry.try(async () => { + await this.testSubjects.click(`launchSampleDataSet${id}`); + await this.find.byCssSelector( + `.euiPopover-isOpen[data-test-subj="launchSampleDataSet${id}"]` + ); + }); } async clickAllKibanaPlugins() { diff --git a/test/functional/page_objects/settings_page.ts b/test/functional/page_objects/settings_page.ts index 7f48d5acc4ec3..bfa038e5014ec 100644 --- a/test/functional/page_objects/settings_page.ts +++ b/test/functional/page_objects/settings_page.ts @@ -306,9 +306,11 @@ export class SettingsPageObject extends FtrService { } async clearFieldTypeFilter(type: string) { - await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown'); await this.retry.try(async () => { - await this.testSubjects.existOrFail('indexedFieldTypeFilterDropdown-popover'); + await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown'); + await this.find.byCssSelector( + '.euiPopover-isOpen[data-test-subj="indexedFieldTypeFilterDropdown-popover"]' + ); }); await this.retry.try(async () => { await this.testSubjects.existOrFail(`indexedFieldTypeFilterDropdown-option-${type}-checked`); @@ -319,8 +321,12 @@ export class SettingsPageObject extends FtrService { } async setFieldTypeFilter(type: string) { - await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown'); - await this.testSubjects.existOrFail('indexedFieldTypeFilterDropdown-popover'); + await this.retry.try(async () => { + await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown'); + await this.find.byCssSelector( + '.euiPopover-isOpen[data-test-subj="indexedFieldTypeFilterDropdown-popover"]' + ); + }); await this.testSubjects.existOrFail(`indexedFieldTypeFilterDropdown-option-${type}`); await this.testSubjects.click(`indexedFieldTypeFilterDropdown-option-${type}`); await this.testSubjects.existOrFail(`indexedFieldTypeFilterDropdown-option-${type}-checked`); diff --git a/test/functional/page_objects/visual_builder_page.ts b/test/functional/page_objects/visual_builder_page.ts index edbd53e80d8c5..1aacde4127f37 100644 --- a/test/functional/page_objects/visual_builder_page.ts +++ b/test/functional/page_objects/visual_builder_page.ts @@ -659,6 +659,28 @@ export class VisualBuilderPageObject extends FtrService { await this.comboBox.setElement(fieldEl, field); } + public async setFieldForAggregateBy(field: string): Promise<void> { + const aggregateBy = await this.testSubjects.find('tsvbAggregateBySelect'); + + await this.retry.try(async () => { + await this.comboBox.setElement(aggregateBy, field); + if (!(await this.comboBox.isOptionSelected(aggregateBy, field))) { + throw new Error(`aggregate by field - ${field} is not selected`); + } + }); + } + + public async setFunctionForAggregateFunction(func: string): Promise<void> { + const aggregateFunction = await this.testSubjects.find('tsvbAggregateFunctionCombobox'); + + await this.retry.try(async () => { + await this.comboBox.setElement(aggregateFunction, func); + if (!(await this.comboBox.isOptionSelected(aggregateFunction, func))) { + throw new Error(`aggregate function - ${func} is not selected`); + } + }); + } + public async checkFieldForAggregationValidity(aggNth: number = 0): Promise<boolean> { const fieldEl = await this.getFieldForAggregation(aggNth); diff --git a/test/functional/services/common/browser.ts b/test/functional/services/common/browser.ts index aaebdcf6975ad..6046aee567da8 100644 --- a/test/functional/services/common/browser.ts +++ b/test/functional/services/common/browser.ts @@ -552,7 +552,14 @@ class BrowserService extends FtrService { a2: A2, a3: A3 ): Promise<T>; - public async executeAsync<T = unknown>(fn: (...args: any[]) => void, ...args: any[]): Promise<T> { + public async executeAsync<T = unknown, A1 = unknown, A2 = unknown, A3 = unknown>( + fn: string, + ...args: any[] + ): Promise<T>; + public async executeAsync<T = unknown>( + fn: string | ((...args: any[]) => void), + ...args: any[] + ): Promise<T> { return await this.driver.executeAsyncScript<T>( fn, ...cloneDeepWith<any>(args, (arg) => { diff --git a/test/functional/services/data_grid.ts b/test/functional/services/data_grid.ts index 0c3464e103eca..7fde46031e737 100644 --- a/test/functional/services/data_grid.ts +++ b/test/functional/services/data_grid.ts @@ -296,6 +296,7 @@ export class DataGridService extends FtrService { await this.openColMenuByField(field); await this.find.clickByButtonText('Copy name'); } + public async clickEditField(field: string) { await this.openColMenuByField(field); await this.testSubjects.click('gridEditFieldButton'); diff --git a/test/functional/services/toasts.ts b/test/functional/services/toasts.ts index 6866c2a8b2fd2..9e7755c09b662 100644 --- a/test/functional/services/toasts.ts +++ b/test/functional/services/toasts.ts @@ -67,9 +67,9 @@ export class ToastsService extends FtrService { return await list.findByCssSelector(`.euiToast:nth-child(${index})`); } - public async getToastContent(index: number) { - const toast = await this.getToastElement(index); - return await toast.getVisibleText(); + public async getAllToastElements() { + const list = await this.getGlobalToastList(); + return await list.findAllByCssSelector(`.euiToast`); } private async getGlobalToastList() { diff --git a/test/functional/services/visualizations/pie_chart.ts b/test/functional/services/visualizations/pie_chart.ts index 0669bb6e91e52..4067c2f1868c5 100644 --- a/test/functional/services/visualizations/pie_chart.ts +++ b/test/functional/services/visualizations/pie_chart.ts @@ -178,6 +178,22 @@ export class PieChartService extends FtrService { ); } + async getPieChartValues(isNewLibrary: boolean = true) { + this.log.debug('PieChart.getPieChartValues'); + if (isNewLibrary) { + const slices = + (await this.visChart.getEsChartDebugState(partitionVisChartSelector))?.partition?.[0] + ?.partitions ?? []; + return slices.map((slice) => { + return slice.value; + }); + } + const chartTypes = await this.find.allByCssSelector('path.slice', this.defaultFindTimeout * 2); + return await Promise.all( + chartTypes.map(async (chart) => await chart.getAttribute('data-value')) + ); + } + async getPieSliceCount(isNewLibrary: boolean = true) { this.log.debug('PieChart.getPieSliceCount'); if (isNewLibrary) { diff --git a/test/interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json b/test/interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json index 893665751cf30..99f621e423747 100644 --- a/test/interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json +++ b/test/interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json @@ -10,7 +10,7 @@ "server/**/*.ts", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, ], } diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json index 86170d3561408..c50067e5cb872 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json @@ -11,7 +11,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/expressions/tsconfig.json" }, { "path": "../../../../src/plugins/inspector/tsconfig.json" }, diff --git a/test/node_roles_functional/background_tasks.config.ts b/test/node_roles_functional/background_tasks.config.ts index a2840cbb230ca..dc7a63b353dcc 100644 --- a/test/node_roles_functional/background_tasks.config.ts +++ b/test/node_roles_functional/background_tasks.config.ts @@ -40,7 +40,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { '--usageCollection.usageCounters.bufferDuration=0', `--plugin-path=${path.resolve(__dirname, 'plugins', 'core_plugin_initializer_context')}`, - '--node.roles=["background_tasks"]', + '--node.roles=["ui","background_tasks"]', ], }, }; diff --git a/test/node_roles_functional/plugins/core_plugin_initializer_context/tsconfig.json b/test/node_roles_functional/plugins/core_plugin_initializer_context/tsconfig.json index f148b232e21fb..97fa33bb4d1ed 100644 --- a/test/node_roles_functional/plugins/core_plugin_initializer_context/tsconfig.json +++ b/test/node_roles_functional/plugins/core_plugin_initializer_context/tsconfig.json @@ -9,7 +9,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/node_roles_functional/test_suites/background_tasks/initializer_context.ts b/test/node_roles_functional/test_suites/background_tasks/initializer_context.ts index dfe814779ff1a..e616ec8243c9d 100644 --- a/test/node_roles_functional/test_suites/background_tasks/initializer_context.ts +++ b/test/node_roles_functional/test_suites/background_tasks/initializer_context.ts @@ -16,7 +16,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide it('passes node roles to server PluginInitializerContext', async () => { await supertest.get('/core_plugin_initializer_context/node/roles').expect(200, { backgroundTasks: true, - ui: false, + ui: true, }); }); }); diff --git a/test/plugin_functional/plugins/app_link_test/tsconfig.json b/test/plugin_functional/plugins/app_link_test/tsconfig.json index b53fafd70cf5d..5e38e7f98cbb6 100644 --- a/test/plugin_functional/plugins/app_link_test/tsconfig.json +++ b/test/plugin_functional/plugins/app_link_test/tsconfig.json @@ -10,7 +10,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/plugins/kibana_react/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_app_status/tsconfig.json b/test/plugin_functional/plugins/core_app_status/tsconfig.json index f380bcc8e8b36..c81a6cc88fae2 100644 --- a/test/plugin_functional/plugins/core_app_status/tsconfig.json +++ b/test/plugin_functional/plugins/core_app_status/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "index.ts", @@ -13,7 +12,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, ], } diff --git a/test/plugin_functional/plugins/core_history_block/tsconfig.json b/test/plugin_functional/plugins/core_history_block/tsconfig.json index a6882ecb3d1e0..4804462c5637d 100644 --- a/test/plugin_functional/plugins/core_history_block/tsconfig.json +++ b/test/plugin_functional/plugins/core_history_block/tsconfig.json @@ -5,7 +5,7 @@ }, "include": ["index.ts", "public/**/*.ts", "public/**/*.tsx", "../../../../typings/**/*"], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/kibana_react/tsconfig.json" } ] diff --git a/test/plugin_functional/plugins/core_http/tsconfig.json b/test/plugin_functional/plugins/core_http/tsconfig.json index eab76d901e427..151126379c603 100644 --- a/test/plugin_functional/plugins/core_http/tsconfig.json +++ b/test/plugin_functional/plugins/core_http/tsconfig.json @@ -11,7 +11,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_plugin_a/tsconfig.json b/test/plugin_functional/plugins/core_plugin_a/tsconfig.json index eab76d901e427..151126379c603 100644 --- a/test/plugin_functional/plugins/core_plugin_a/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_a/tsconfig.json @@ -11,7 +11,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json b/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json index 87e51c3eab37a..b69ff0d55b060 100644 --- a/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json @@ -10,7 +10,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_plugin_b/tsconfig.json b/test/plugin_functional/plugins/core_plugin_b/tsconfig.json index 78476ce6697e1..582a563fa87d6 100644 --- a/test/plugin_functional/plugins/core_plugin_b/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_b/tsconfig.json @@ -11,7 +11,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../core_plugin_a/tsconfig.json" }, ] diff --git a/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json b/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json index 010574f0c3be0..a45b03ddb0183 100644 --- a/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json @@ -10,7 +10,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json b/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json index 87e51c3eab37a..b69ff0d55b060 100644 --- a/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json @@ -10,7 +10,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json b/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json index eab76d901e427..151126379c603 100644 --- a/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json @@ -11,7 +11,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json b/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json index 4c00a35a3db77..7e4d103b3c8b9 100644 --- a/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json @@ -8,7 +8,7 @@ "server/**/*.ts", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json b/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json index d346449e67c42..da607f805aca3 100644 --- a/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json @@ -10,7 +10,7 @@ "../../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json b/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json index b0e6d4f5d84ce..4e34148ffcc4f 100644 --- a/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json @@ -8,7 +8,7 @@ "../../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json b/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json index d346449e67c42..da607f805aca3 100644 --- a/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json @@ -10,7 +10,7 @@ "../../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json b/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json index d18f6a63263bf..1010dbde5e134 100644 --- a/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "index.ts", @@ -13,7 +12,7 @@ "../../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, ], } diff --git a/test/plugin_functional/plugins/data_search/tsconfig.json b/test/plugin_functional/plugins/data_search/tsconfig.json index e82f3fca8fb3c..fd0c6aee86728 100644 --- a/test/plugin_functional/plugins/data_search/tsconfig.json +++ b/test/plugin_functional/plugins/data_search/tsconfig.json @@ -8,7 +8,7 @@ "../../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/data/tsconfig.json" }, ] diff --git a/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json b/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json index b0e6d4f5d84ce..4e34148ffcc4f 100644 --- a/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json @@ -8,7 +8,7 @@ "../../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/index_patterns/tsconfig.json b/test/plugin_functional/plugins/index_patterns/tsconfig.json index 9ac0d7726c379..9eb1323172491 100644 --- a/test/plugin_functional/plugins/index_patterns/tsconfig.json +++ b/test/plugin_functional/plugins/index_patterns/tsconfig.json @@ -10,7 +10,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/data/tsconfig.json" }, ] diff --git a/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json b/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json index 043ace6ce064d..5ee68ce60a9a8 100644 --- a/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json +++ b/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json @@ -10,7 +10,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/ui_actions/tsconfig.json" }, { "path": "../../../../src/plugins/embeddable/tsconfig.json" }, diff --git a/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json b/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json index adf3815905d1d..2d0007320313b 100644 --- a/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json +++ b/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json @@ -11,7 +11,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/navigation/tsconfig.json" }, ] diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/kibana.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/kibana.json index 35be433601f45..25be1386e5232 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/kibana.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/kibana.json @@ -2,7 +2,7 @@ "id": "kbnTpCustomVisualizations", "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "version": "0.0.1", "kibanaVersion": "kibana", diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json index 8cbb8696409b6..954a4daa1eef0 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json @@ -10,7 +10,7 @@ "../../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/data/tsconfig.json" }, { "path": "../../../../src/plugins/visualizations/tsconfig.json" }, diff --git a/test/plugin_functional/plugins/management_test_plugin/tsconfig.json b/test/plugin_functional/plugins/management_test_plugin/tsconfig.json index 8222b8f011005..ee1ece5036cff 100644 --- a/test/plugin_functional/plugins/management_test_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/management_test_plugin/tsconfig.json @@ -10,7 +10,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/management/tsconfig.json" }, ] diff --git a/test/plugin_functional/plugins/rendering_plugin/tsconfig.json b/test/plugin_functional/plugins/rendering_plugin/tsconfig.json index eab76d901e427..151126379c603 100644 --- a/test/plugin_functional/plugins/rendering_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/rendering_plugin/tsconfig.json @@ -11,7 +11,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json b/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json index f148b232e21fb..97fa33bb4d1ed 100644 --- a/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json +++ b/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json @@ -9,7 +9,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json b/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json index eab76d901e427..151126379c603 100644 --- a/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json +++ b/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json @@ -11,7 +11,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json b/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json index f148b232e21fb..97fa33bb4d1ed 100644 --- a/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json +++ b/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json @@ -9,7 +9,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/session_notifications/tsconfig.json b/test/plugin_functional/plugins/session_notifications/tsconfig.json index c50f2e3f119c8..32b53be5109fb 100644 --- a/test/plugin_functional/plugins/session_notifications/tsconfig.json +++ b/test/plugin_functional/plugins/session_notifications/tsconfig.json @@ -11,7 +11,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/navigation/tsconfig.json" }, { "path": "../../../../src/plugins/data/tsconfig.json" }, diff --git a/test/plugin_functional/plugins/telemetry/tsconfig.json b/test/plugin_functional/plugins/telemetry/tsconfig.json index b32ac67279f40..bde8ed4c57ae0 100644 --- a/test/plugin_functional/plugins/telemetry/tsconfig.json +++ b/test/plugin_functional/plugins/telemetry/tsconfig.json @@ -5,7 +5,7 @@ }, "include": ["public/**/*.ts", "types.ts", "../../../../typings/**/*"], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/telemetry/tsconfig.json" }, ] diff --git a/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json b/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json index 6551c1496164f..1282ecf76b30e 100644 --- a/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json @@ -8,7 +8,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/usage_collection/tsconfig.json b/test/plugin_functional/plugins/usage_collection/tsconfig.json index d6f7d08f18589..56abcf79f17d0 100644 --- a/test/plugin_functional/plugins/usage_collection/tsconfig.json +++ b/test/plugin_functional/plugins/usage_collection/tsconfig.json @@ -11,7 +11,7 @@ "../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/usage_collection/tsconfig.json" }, ] diff --git a/test/scripts/checks/bundle_limits.sh b/test/scripts/checks/bundle_limits.sh index cfe08d73bb558..10d9d9343fda4 100755 --- a/test/scripts/checks/bundle_limits.sh +++ b/test/scripts/checks/bundle_limits.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Check Bundle Limits" \ - node scripts/build_kibana_platform_plugins --validate-limits +node scripts/build_kibana_platform_plugins --validate-limits diff --git a/test/scripts/checks/commit/commit.sh b/test/scripts/checks/commit/commit.sh index 5d300468a65e3..180f6dfb56e29 100755 --- a/test/scripts/checks/commit/commit.sh +++ b/test/scripts/checks/commit/commit.sh @@ -7,5 +7,4 @@ source src/dev/ci_setup/setup_env.sh # the pre-commit hook installation by default. # If files are more than 200 we will skip it and just use # the further ci steps that already check linting and file casing for the entire repo. -checks-reporter-with-killswitch "Quick commit checks" \ - "$(dirname "${0}")/commit_check_runner.sh" +"$(dirname "${0}")/commit_check_runner.sh" diff --git a/test/scripts/checks/file_casing.sh b/test/scripts/checks/file_casing.sh index b30dfaab62a98..1a2240d0562ff 100755 --- a/test/scripts/checks/file_casing.sh +++ b/test/scripts/checks/file_casing.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Check File Casing" \ - node scripts/check_file_casing --quiet +node scripts/check_file_casing --quiet diff --git a/test/scripts/checks/i18n.sh b/test/scripts/checks/i18n.sh index e7a2060aaa73a..468b8394081e1 100755 --- a/test/scripts/checks/i18n.sh +++ b/test/scripts/checks/i18n.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Check i18n" \ - node scripts/i18n_check --ignore-missing +node scripts/i18n_check --ignore-missing diff --git a/test/scripts/checks/jest_configs.sh b/test/scripts/checks/jest_configs.sh index 67fbee0b9fdf0..cebcbc63bb396 100755 --- a/test/scripts/checks/jest_configs.sh +++ b/test/scripts/checks/jest_configs.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Check Jest Configs" \ - node scripts/check_jest_configs +node scripts/check_jest_configs diff --git a/test/scripts/checks/licenses.sh b/test/scripts/checks/licenses.sh index 22494f11ce77c..8a19cdc2fc126 100755 --- a/test/scripts/checks/licenses.sh +++ b/test/scripts/checks/licenses.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Check Licenses" \ - node scripts/check_licenses --dev +node scripts/check_licenses --dev diff --git a/test/scripts/checks/plugins_with_circular_deps.sh b/test/scripts/checks/plugins_with_circular_deps.sh index a608d7e7b2edf..12e362e9193ee 100755 --- a/test/scripts/checks/plugins_with_circular_deps.sh +++ b/test/scripts/checks/plugins_with_circular_deps.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Check Plugins With Circular Dependencies" \ - node scripts/find_plugins_with_circular_deps +node scripts/find_plugins_with_circular_deps diff --git a/test/scripts/checks/telemetry.sh b/test/scripts/checks/telemetry.sh index 1622704b1fa92..09b2305f9d607 100755 --- a/test/scripts/checks/telemetry.sh +++ b/test/scripts/checks/telemetry.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Check Telemetry Schema" \ - node scripts/telemetry_check +node scripts/telemetry_check diff --git a/test/scripts/checks/test_hardening.sh b/test/scripts/checks/test_hardening.sh index cd0c5a7d3c3aa..332edb0fcde68 100755 --- a/test/scripts/checks/test_hardening.sh +++ b/test/scripts/checks/test_hardening.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Test Hardening" \ - node scripts/test_hardening +node scripts/test_hardening diff --git a/test/scripts/checks/test_projects.sh b/test/scripts/checks/test_projects.sh index ee74616a958fa..6a1a8b958c4aa 100755 --- a/test/scripts/checks/test_projects.sh +++ b/test/scripts/checks/test_projects.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Test Projects" \ - yarn kbn run-in-packages test +yarn kbn run-in-packages test diff --git a/test/scripts/checks/ts_projects.sh b/test/scripts/checks/ts_projects.sh index 467beb2977efc..9963d10792f94 100755 --- a/test/scripts/checks/ts_projects.sh +++ b/test/scripts/checks/ts_projects.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Check TypeScript Projects" \ - node scripts/check_ts_projects +node scripts/check_ts_projects diff --git a/test/scripts/checks/type_check_plugin_public_api_docs.sh b/test/scripts/checks/type_check_plugin_public_api_docs.sh index 77fa76038f7c4..b5fed38e192d2 100755 --- a/test/scripts/checks/type_check_plugin_public_api_docs.sh +++ b/test/scripts/checks/type_check_plugin_public_api_docs.sh @@ -2,14 +2,12 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Build TS Refs" \ - node scripts/build_ts_refs \ - --clean \ - --no-cache \ - --force - -checks-reporter-with-killswitch "Check Types" \ - node scripts/type_check +node scripts/build_ts_refs \ + --clean \ + --no-cache \ + --force + +node scripts/type_check echo " -- building api docs" node --max-old-space-size=12000 scripts/build_api_docs diff --git a/test/scripts/checks/verify_notice.sh b/test/scripts/checks/verify_notice.sh index 99bfd55edd3c1..55dd1c04aaf8a 100755 --- a/test/scripts/checks/verify_notice.sh +++ b/test/scripts/checks/verify_notice.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Verify NOTICE" \ - node scripts/notice --validate +node scripts/notice --validate diff --git a/test/scripts/jenkins_accessibility.sh b/test/scripts/jenkins_accessibility.sh index fa7cbd41d7078..fa582cf2d97d0 100755 --- a/test/scripts/jenkins_accessibility.sh +++ b/test/scripts/jenkins_accessibility.sh @@ -2,8 +2,7 @@ source test/scripts/jenkins_test_setup_oss.sh -checks-reporter-with-killswitch "Kibana accessibility tests" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --config test/accessibility/config.ts; +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --config test/accessibility/config.ts; diff --git a/test/scripts/jenkins_apm_cypress.sh b/test/scripts/jenkins_apm_cypress.sh index ac9baa8066743..2ccd7d760fba5 100755 --- a/test/scripts/jenkins_apm_cypress.sh +++ b/test/scripts/jenkins_apm_cypress.sh @@ -5,8 +5,7 @@ source test/scripts/jenkins_test_setup_xpack.sh echo " -> Running APM cypress tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "APM Cypress Tests" \ - node plugins/apm/scripts/test/e2e.js +node plugins/apm/scripts/test/e2e.js echo "" echo "" diff --git a/test/scripts/jenkins_build_kbn_sample_panel_action.sh b/test/scripts/jenkins_build_kbn_sample_panel_action.sh index 0c425d61d0528..67c3da246ed7c 100755 --- a/test/scripts/jenkins_build_kbn_sample_panel_action.sh +++ b/test/scripts/jenkins_build_kbn_sample_panel_action.sh @@ -4,6 +4,6 @@ source src/dev/ci_setup/setup_env.sh cd test/plugin_functional/plugins/kbn_sample_panel_action; if [[ ! -d "target" ]]; then - checks-reporter-with-killswitch "Build kbn_sample_panel_action" yarn build; + yarn build; fi cd -; diff --git a/test/scripts/jenkins_ci_group.sh b/test/scripts/jenkins_ci_group.sh index 3cf1c279f4134..b425889c42270 100755 --- a/test/scripts/jenkins_ci_group.sh +++ b/test/scripts/jenkins_ci_group.sh @@ -5,11 +5,10 @@ source test/scripts/jenkins_test_setup_oss.sh if [[ -z "$CODE_COVERAGE" ]]; then echo " -> Running functional and api tests" - checks-reporter-with-killswitch "Functional tests / Group ${CI_GROUP}" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --include-tag "ciGroup$CI_GROUP" + node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --include-tag "ciGroup$CI_GROUP" if [[ ! "$TASK_QUEUE_PROCESS_ID" && "$CI_GROUP" == "1" ]]; then source test/scripts/jenkins_build_kbn_sample_panel_action.sh diff --git a/test/scripts/jenkins_firefox_smoke.sh b/test/scripts/jenkins_firefox_smoke.sh index 247ab360b7912..4566b11822bf5 100755 --- a/test/scripts/jenkins_firefox_smoke.sh +++ b/test/scripts/jenkins_firefox_smoke.sh @@ -2,9 +2,8 @@ source test/scripts/jenkins_test_setup_oss.sh -checks-reporter-with-killswitch "Firefox smoke test" \ - node scripts/functional_tests \ - --bail --debug \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --include-tag "includeFirefox" \ - --config test/functional/config.firefox.js; +node scripts/functional_tests \ + --bail --debug \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --include-tag "includeFirefox" \ + --config test/functional/config.firefox.js; diff --git a/test/scripts/jenkins_fleet_cypress.sh b/test/scripts/jenkins_fleet_cypress.sh index 085c78cbf0a41..a6d9557812374 100755 --- a/test/scripts/jenkins_fleet_cypress.sh +++ b/test/scripts/jenkins_fleet_cypress.sh @@ -5,11 +5,10 @@ source test/scripts/jenkins_test_setup_xpack.sh echo " -> Running fleet cypress tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "Fleet Cypress Tests" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --config test/fleet_cypress/cli_config.ts +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --config test/fleet_cypress/cli_config.ts echo "" echo "" diff --git a/test/scripts/jenkins_osquery_cypress.sh b/test/scripts/jenkins_osquery_cypress.sh index fa9b528d2d444..b4a9420ff9440 100755 --- a/test/scripts/jenkins_osquery_cypress.sh +++ b/test/scripts/jenkins_osquery_cypress.sh @@ -5,11 +5,10 @@ source test/scripts/jenkins_test_setup_xpack.sh echo " -> Running osquery cypress tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "Osquery Cypress Tests" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --config test/osquery_cypress/cli_config.ts +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --config test/osquery_cypress/cli_config.ts echo "" echo "" diff --git a/test/scripts/jenkins_security_solution_cypress_chrome.sh b/test/scripts/jenkins_security_solution_cypress_chrome.sh index f29d9536f1502..0605a319896ce 100755 --- a/test/scripts/jenkins_security_solution_cypress_chrome.sh +++ b/test/scripts/jenkins_security_solution_cypress_chrome.sh @@ -5,11 +5,10 @@ source test/scripts/jenkins_test_setup_xpack.sh echo " -> Running security solution cypress tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "Security Solution Cypress Tests (Chrome)" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --config test/security_solution_cypress/cli_config.ts +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --config test/security_solution_cypress/cli_config.ts echo "" echo "" diff --git a/test/scripts/jenkins_security_solution_cypress_firefox.sh b/test/scripts/jenkins_security_solution_cypress_firefox.sh index af8f51d5796f7..79623d5a2a23b 100755 --- a/test/scripts/jenkins_security_solution_cypress_firefox.sh +++ b/test/scripts/jenkins_security_solution_cypress_firefox.sh @@ -5,11 +5,10 @@ source test/scripts/jenkins_test_setup_xpack.sh echo " -> Running security solution cypress tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "Security Solution Cypress Tests (Firefox)" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --config test/security_solution_cypress/config.firefox.ts +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --config test/security_solution_cypress/config.firefox.ts echo "" echo "" diff --git a/test/scripts/jenkins_uptime_playwright.sh b/test/scripts/jenkins_uptime_playwright.sh index ba921a5b46658..5bea30a223cd4 100755 --- a/test/scripts/jenkins_uptime_playwright.sh +++ b/test/scripts/jenkins_uptime_playwright.sh @@ -5,8 +5,7 @@ source test/scripts/jenkins_test_setup_xpack.sh echo " -> Running synthetics @elastic/synthetics tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "synthetics @elastic/synthetics Tests" \ - node plugins/synthetics/scripts/e2e.js +node plugins/synthetics/scripts/e2e.js echo "" echo "" diff --git a/test/scripts/jenkins_ux_synthetics.sh b/test/scripts/jenkins_ux_synthetics.sh index 0f5cfb729bcd1..acf2611e36b94 100755 --- a/test/scripts/jenkins_ux_synthetics.sh +++ b/test/scripts/jenkins_ux_synthetics.sh @@ -5,8 +5,7 @@ source test/scripts/jenkins_test_setup_xpack.sh echo " -> Running User Experience plugin @elastic/synthetics tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "User Experience plugin @elastic/synthetics Tests" \ - node plugins/ux/scripts/e2e.js +node plugins/ux/scripts/e2e.js echo "" echo "" diff --git a/test/scripts/jenkins_xpack_accessibility.sh b/test/scripts/jenkins_xpack_accessibility.sh index 3afd4bfb76396..b1daa0ada1d50 100755 --- a/test/scripts/jenkins_xpack_accessibility.sh +++ b/test/scripts/jenkins_xpack_accessibility.sh @@ -2,8 +2,7 @@ source test/scripts/jenkins_test_setup_xpack.sh -checks-reporter-with-killswitch "X-Pack accessibility tests" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --config test/accessibility/config.ts; +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --config test/accessibility/config.ts; diff --git a/test/scripts/jenkins_xpack_ci_group.sh b/test/scripts/jenkins_xpack_ci_group.sh index 0198a5d0ac5fa..59bcf45a2089f 100755 --- a/test/scripts/jenkins_xpack_ci_group.sh +++ b/test/scripts/jenkins_xpack_ci_group.sh @@ -5,11 +5,10 @@ source test/scripts/jenkins_test_setup_xpack.sh if [[ -z "$CODE_COVERAGE" ]]; then echo " -> Running functional and api tests" - checks-reporter-with-killswitch "X-Pack Chrome Functional tests / Group ${CI_GROUP}" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --include-tag "ciGroup$CI_GROUP" + node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --include-tag "ciGroup$CI_GROUP" echo "" echo "" @@ -32,4 +31,4 @@ else echo " -> copying screenshots and html for failures" cp -r test/functional/screenshots/* ../../kibana/x-pack/test/functional/screenshots/ || echo "copying screenshots failed" cp -r test/functional/failure_debug ../../kibana/x-pack/test/functional/ || echo "copying html failed" -fi \ No newline at end of file +fi diff --git a/test/scripts/jenkins_xpack_firefox_smoke.sh b/test/scripts/jenkins_xpack_firefox_smoke.sh index ae924a5e10552..de19d3867520d 100755 --- a/test/scripts/jenkins_xpack_firefox_smoke.sh +++ b/test/scripts/jenkins_xpack_firefox_smoke.sh @@ -2,10 +2,9 @@ source test/scripts/jenkins_test_setup_xpack.sh -checks-reporter-with-killswitch "X-Pack firefox smoke test" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --include-tag "includeFirefox" \ - --config test/functional/config.firefox.js \ - --config test/functional_embedded/config.firefox.ts; +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --include-tag "includeFirefox" \ + --config test/functional/config.firefox.js \ + --config test/functional_embedded/config.firefox.ts; diff --git a/test/scripts/jenkins_xpack_saved_objects_field_metrics.sh b/test/scripts/jenkins_xpack_saved_objects_field_metrics.sh index e3b0fe778bdfb..fc3a7db06a43b 100755 --- a/test/scripts/jenkins_xpack_saved_objects_field_metrics.sh +++ b/test/scripts/jenkins_xpack_saved_objects_field_metrics.sh @@ -2,8 +2,7 @@ source test/scripts/jenkins_test_setup_xpack.sh -checks-reporter-with-killswitch "Capture Kibana Saved Objects field count metrics" \ - node scripts/functional_tests \ - --debug --bail \ - --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --config test/saved_objects_field_count/config.ts; +node scripts/functional_tests \ + --debug --bail \ + --kibana-install-dir "$KIBANA_INSTALL_DIR" \ + --config test/saved_objects_field_count/config.ts; diff --git a/test/scripts/lint/eslint.sh b/test/scripts/lint/eslint.sh index 053150e42f409..8395df85c5d30 100755 --- a/test/scripts/lint/eslint.sh +++ b/test/scripts/lint/eslint.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Lint: eslint" \ - node scripts/eslint --no-cache +node scripts/eslint --no-cache diff --git a/test/scripts/lint/stylelint.sh b/test/scripts/lint/stylelint.sh index 3dcb682c40f0c..2f500c7e14aaa 100755 --- a/test/scripts/lint/stylelint.sh +++ b/test/scripts/lint/stylelint.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Lint: stylelint" \ - node scripts/stylelint +node scripts/stylelint diff --git a/test/scripts/test/api_integration.sh b/test/scripts/test/api_integration.sh index bf6f683989fe5..06263c38b0728 100755 --- a/test/scripts/test/api_integration.sh +++ b/test/scripts/test/api_integration.sh @@ -2,8 +2,7 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "API Integration Tests" \ - node scripts/functional_tests \ - --config test/api_integration/config.js \ - --bail \ - --debug +node scripts/functional_tests \ + --config test/api_integration/config.js \ + --bail \ + --debug diff --git a/test/scripts/test/interpreter_functional.sh b/test/scripts/test/interpreter_functional.sh index 1558989c0fdfc..2a40c81c34ad0 100755 --- a/test/scripts/test/interpreter_functional.sh +++ b/test/scripts/test/interpreter_functional.sh @@ -2,9 +2,8 @@ source test/scripts/jenkins_test_setup_oss.sh -checks-reporter-with-killswitch "Interpreter Functional Tests" \ - node scripts/functional_tests \ - --config test/interpreter_functional/config.ts \ - --bail \ - --debug \ - --kibana-install-dir $KIBANA_INSTALL_DIR +node scripts/functional_tests \ + --config test/interpreter_functional/config.ts \ + --bail \ + --debug \ + --kibana-install-dir $KIBANA_INSTALL_DIR diff --git a/test/scripts/test/jest_integration.sh b/test/scripts/test/jest_integration.sh index 89390657d1b48..3b27ba06842be 100755 --- a/test/scripts/test/jest_integration.sh +++ b/test/scripts/test/jest_integration.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Jest Integration Tests" \ - node --max-old-space-size=5120 scripts/jest_integration --ci +node --max-old-space-size=5120 scripts/jest_integration --ci diff --git a/test/scripts/test/jest_unit.sh b/test/scripts/test/jest_unit.sh index 539a64fbe1b7f..f368554e35760 100755 --- a/test/scripts/test/jest_unit.sh +++ b/test/scripts/test/jest_unit.sh @@ -2,5 +2,4 @@ source src/dev/ci_setup/setup_env.sh -checks-reporter-with-killswitch "Jest Unit Tests" \ - node scripts/jest --ci --maxWorkers=6 +node scripts/jest --ci --maxWorkers=6 diff --git a/test/scripts/test/plugin_functional.sh b/test/scripts/test/plugin_functional.sh index e0af062e1de4a..115ddb81d3e45 100755 --- a/test/scripts/test/plugin_functional.sh +++ b/test/scripts/test/plugin_functional.sh @@ -2,8 +2,7 @@ source test/scripts/jenkins_test_setup_oss.sh -checks-reporter-with-killswitch "Plugin Functional Tests" \ - node scripts/functional_tests \ - --config test/plugin_functional/config.ts \ - --bail \ - --debug +node scripts/functional_tests \ + --config test/plugin_functional/config.ts \ + --bail \ + --debug diff --git a/test/scripts/test/server_integration.sh b/test/scripts/test/server_integration.sh index 6ec08c7727e20..fa4c4c6ce2c35 100755 --- a/test/scripts/test/server_integration.sh +++ b/test/scripts/test/server_integration.sh @@ -2,20 +2,18 @@ source test/scripts/jenkins_test_setup_oss.sh -checks-reporter-with-killswitch "Server Integration Tests" \ - node scripts/functional_tests \ - --config test/server_integration/http/ssl/config.js \ - --config test/server_integration/http/ssl_redirect/config.js \ - --config test/server_integration/http/platform/config.ts \ - --config test/server_integration/http/ssl_with_p12/config.js \ - --config test/server_integration/http/ssl_with_p12_intermediate/config.js \ - --bail \ - --debug \ - --kibana-install-dir $KIBANA_INSTALL_DIR +node scripts/functional_tests \ + --config test/server_integration/http/ssl/config.js \ + --config test/server_integration/http/ssl_redirect/config.js \ + --config test/server_integration/http/platform/config.ts \ + --config test/server_integration/http/ssl_with_p12/config.js \ + --config test/server_integration/http/ssl_with_p12_intermediate/config.js \ + --bail \ + --debug \ + --kibana-install-dir $KIBANA_INSTALL_DIR # Tests that must be run against source in order to build test plugins -checks-reporter-with-killswitch "Status Integration Tests" \ - node scripts/functional_tests \ - --config test/server_integration/http/platform/config.status.ts \ - --bail \ - --debug \ +node scripts/functional_tests \ + --config test/server_integration/http/platform/config.status.ts \ + --bail \ + --debug diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json b/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json index 14ebb2e7d00c4..e0bcff939a451 100644 --- a/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json +++ b/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json @@ -9,7 +9,7 @@ "../../../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../../src/core/tsconfig.json" } ] } diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json b/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json index 6b27e9b4b7a6c..0d45d9195da6d 100644 --- a/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json +++ b/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json @@ -9,7 +9,7 @@ "../../../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../../../src/core/tsconfig.json" } ] } diff --git a/test/server_integration/http/ssl_redirect/index.js b/test/server_integration/http/ssl_redirect/index.js index 8abe700e26149..07ae0eb4bb565 100644 --- a/test/server_integration/http/ssl_redirect/index.js +++ b/test/server_integration/http/ssl_redirect/index.js @@ -9,7 +9,9 @@ export default function ({ getService }) { const supertest = getService('supertest'); - describe('kibana server with ssl', () => { + // Failing: See https://github.com/elastic/kibana/issues/131192 + // Failing: See https://github.com/elastic/kibana/issues/131192 + describe.skip('kibana server with ssl', () => { it('redirects http requests at redirect port to https', async () => { const host = process.env.TEST_KIBANA_HOST || 'localhost'; const port = process.env.TEST_KIBANA_PORT || '5620'; diff --git a/test/tsconfig.json b/test/tsconfig.json index 2df2827807972..1b5cf6f7a0eb2 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -23,12 +23,13 @@ "exclude": [ "target/**/*", "analytics/fixtures/plugins/**/*", - "interpreter_functional/plugins/**/*", - "plugin_functional/plugins/**/*", + "interactive_setup_api_integration/fixtures/test_endpoints/**/*", "server_integration/__fixtures__/plugins/**/*", + "*/plugins/**/*", ], - "references": [ + "kbn_references": [ { "path": "../src/core/tsconfig.json" }, + { "path": "../src/setup_node_env/tsconfig.json" }, { "path": "../src/plugins/telemetry_management_section/tsconfig.json" }, { "path": "../src/plugins/advanced_settings/tsconfig.json" }, { "path": "../src/plugins/management/tsconfig.json" }, diff --git a/tsconfig.base.json b/tsconfig.base.json index 6d42c567d3422..b5372e27d631c 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,10 +1,715 @@ { "compilerOptions": { "baseUrl": ".", + "rootDir": ".", "paths": { "@kbn/core": ["src/core"], "@kbn/core/*": ["src/core/*"], // START AUTOMATED PACKAGE LISTING + "@kbn/analytics-client": ["packages/analytics/client"], + "@kbn/analytics-client/*": ["packages/analytics/client/*"], + "@kbn/analytics-shippers-elastic-v3-browser": ["packages/analytics/shippers/elastic_v3/browser"], + "@kbn/analytics-shippers-elastic-v3-browser/*": ["packages/analytics/shippers/elastic_v3/browser/*"], + "@kbn/analytics-shippers-elastic-v3-common": ["packages/analytics/shippers/elastic_v3/common"], + "@kbn/analytics-shippers-elastic-v3-common/*": ["packages/analytics/shippers/elastic_v3/common/*"], + "@kbn/analytics-shippers-elastic-v3-server": ["packages/analytics/shippers/elastic_v3/server"], + "@kbn/analytics-shippers-elastic-v3-server/*": ["packages/analytics/shippers/elastic_v3/server/*"], + "@kbn/analytics-shippers-fullstory": ["packages/analytics/shippers/fullstory"], + "@kbn/analytics-shippers-fullstory/*": ["packages/analytics/shippers/fullstory/*"], + "@kbn/analytics-shippers-gainsight": ["packages/analytics/shippers/gainsight"], + "@kbn/analytics-shippers-gainsight/*": ["packages/analytics/shippers/gainsight/*"], + "@kbn/content-management-table-list": ["packages/content-management/table_list"], + "@kbn/content-management-table-list/*": ["packages/content-management/table_list/*"], + "@kbn/core-analytics-browser": ["packages/core/analytics/core-analytics-browser"], + "@kbn/core-analytics-browser/*": ["packages/core/analytics/core-analytics-browser/*"], + "@kbn/core-analytics-browser-internal": ["packages/core/analytics/core-analytics-browser-internal"], + "@kbn/core-analytics-browser-internal/*": ["packages/core/analytics/core-analytics-browser-internal/*"], + "@kbn/core-analytics-browser-mocks": ["packages/core/analytics/core-analytics-browser-mocks"], + "@kbn/core-analytics-browser-mocks/*": ["packages/core/analytics/core-analytics-browser-mocks/*"], + "@kbn/core-analytics-server": ["packages/core/analytics/core-analytics-server"], + "@kbn/core-analytics-server/*": ["packages/core/analytics/core-analytics-server/*"], + "@kbn/core-analytics-server-internal": ["packages/core/analytics/core-analytics-server-internal"], + "@kbn/core-analytics-server-internal/*": ["packages/core/analytics/core-analytics-server-internal/*"], + "@kbn/core-analytics-server-mocks": ["packages/core/analytics/core-analytics-server-mocks"], + "@kbn/core-analytics-server-mocks/*": ["packages/core/analytics/core-analytics-server-mocks/*"], + "@kbn/core-application-browser": ["packages/core/application/core-application-browser"], + "@kbn/core-application-browser/*": ["packages/core/application/core-application-browser/*"], + "@kbn/core-application-browser-internal": ["packages/core/application/core-application-browser-internal"], + "@kbn/core-application-browser-internal/*": ["packages/core/application/core-application-browser-internal/*"], + "@kbn/core-application-browser-mocks": ["packages/core/application/core-application-browser-mocks"], + "@kbn/core-application-browser-mocks/*": ["packages/core/application/core-application-browser-mocks/*"], + "@kbn/core-application-common": ["packages/core/application/core-application-common"], + "@kbn/core-application-common/*": ["packages/core/application/core-application-common/*"], + "@kbn/core-apps-browser-internal": ["packages/core/apps/core-apps-browser-internal"], + "@kbn/core-apps-browser-internal/*": ["packages/core/apps/core-apps-browser-internal/*"], + "@kbn/core-apps-browser-mocks": ["packages/core/apps/core-apps-browser-mocks"], + "@kbn/core-apps-browser-mocks/*": ["packages/core/apps/core-apps-browser-mocks/*"], + "@kbn/core-apps-server-internal": ["packages/core/apps/core-apps-server-internal"], + "@kbn/core-apps-server-internal/*": ["packages/core/apps/core-apps-server-internal/*"], + "@kbn/core-base-browser-internal": ["packages/core/base/core-base-browser-internal"], + "@kbn/core-base-browser-internal/*": ["packages/core/base/core-base-browser-internal/*"], + "@kbn/core-base-browser-mocks": ["packages/core/base/core-base-browser-mocks"], + "@kbn/core-base-browser-mocks/*": ["packages/core/base/core-base-browser-mocks/*"], + "@kbn/core-base-common": ["packages/core/base/core-base-common"], + "@kbn/core-base-common/*": ["packages/core/base/core-base-common/*"], + "@kbn/core-base-common-internal": ["packages/core/base/core-base-common-internal"], + "@kbn/core-base-common-internal/*": ["packages/core/base/core-base-common-internal/*"], + "@kbn/core-base-server-internal": ["packages/core/base/core-base-server-internal"], + "@kbn/core-base-server-internal/*": ["packages/core/base/core-base-server-internal/*"], + "@kbn/core-base-server-mocks": ["packages/core/base/core-base-server-mocks"], + "@kbn/core-base-server-mocks/*": ["packages/core/base/core-base-server-mocks/*"], + "@kbn/core-capabilities-browser-internal": ["packages/core/capabilities/core-capabilities-browser-internal"], + "@kbn/core-capabilities-browser-internal/*": ["packages/core/capabilities/core-capabilities-browser-internal/*"], + "@kbn/core-capabilities-browser-mocks": ["packages/core/capabilities/core-capabilities-browser-mocks"], + "@kbn/core-capabilities-browser-mocks/*": ["packages/core/capabilities/core-capabilities-browser-mocks/*"], + "@kbn/core-capabilities-common": ["packages/core/capabilities/core-capabilities-common"], + "@kbn/core-capabilities-common/*": ["packages/core/capabilities/core-capabilities-common/*"], + "@kbn/core-capabilities-server": ["packages/core/capabilities/core-capabilities-server"], + "@kbn/core-capabilities-server/*": ["packages/core/capabilities/core-capabilities-server/*"], + "@kbn/core-capabilities-server-internal": ["packages/core/capabilities/core-capabilities-server-internal"], + "@kbn/core-capabilities-server-internal/*": ["packages/core/capabilities/core-capabilities-server-internal/*"], + "@kbn/core-capabilities-server-mocks": ["packages/core/capabilities/core-capabilities-server-mocks"], + "@kbn/core-capabilities-server-mocks/*": ["packages/core/capabilities/core-capabilities-server-mocks/*"], + "@kbn/core-chrome-browser": ["packages/core/chrome/core-chrome-browser"], + "@kbn/core-chrome-browser/*": ["packages/core/chrome/core-chrome-browser/*"], + "@kbn/core-chrome-browser-internal": ["packages/core/chrome/core-chrome-browser-internal"], + "@kbn/core-chrome-browser-internal/*": ["packages/core/chrome/core-chrome-browser-internal/*"], + "@kbn/core-chrome-browser-mocks": ["packages/core/chrome/core-chrome-browser-mocks"], + "@kbn/core-chrome-browser-mocks/*": ["packages/core/chrome/core-chrome-browser-mocks/*"], + "@kbn/core-config-server-internal": ["packages/core/config/core-config-server-internal"], + "@kbn/core-config-server-internal/*": ["packages/core/config/core-config-server-internal/*"], + "@kbn/core-deprecations-browser": ["packages/core/deprecations/core-deprecations-browser"], + "@kbn/core-deprecations-browser/*": ["packages/core/deprecations/core-deprecations-browser/*"], + "@kbn/core-deprecations-browser-internal": ["packages/core/deprecations/core-deprecations-browser-internal"], + "@kbn/core-deprecations-browser-internal/*": ["packages/core/deprecations/core-deprecations-browser-internal/*"], + "@kbn/core-deprecations-browser-mocks": ["packages/core/deprecations/core-deprecations-browser-mocks"], + "@kbn/core-deprecations-browser-mocks/*": ["packages/core/deprecations/core-deprecations-browser-mocks/*"], + "@kbn/core-deprecations-common": ["packages/core/deprecations/core-deprecations-common"], + "@kbn/core-deprecations-common/*": ["packages/core/deprecations/core-deprecations-common/*"], + "@kbn/core-deprecations-server": ["packages/core/deprecations/core-deprecations-server"], + "@kbn/core-deprecations-server/*": ["packages/core/deprecations/core-deprecations-server/*"], + "@kbn/core-deprecations-server-internal": ["packages/core/deprecations/core-deprecations-server-internal"], + "@kbn/core-deprecations-server-internal/*": ["packages/core/deprecations/core-deprecations-server-internal/*"], + "@kbn/core-deprecations-server-mocks": ["packages/core/deprecations/core-deprecations-server-mocks"], + "@kbn/core-deprecations-server-mocks/*": ["packages/core/deprecations/core-deprecations-server-mocks/*"], + "@kbn/core-doc-links-browser": ["packages/core/doc-links/core-doc-links-browser"], + "@kbn/core-doc-links-browser/*": ["packages/core/doc-links/core-doc-links-browser/*"], + "@kbn/core-doc-links-browser-internal": ["packages/core/doc-links/core-doc-links-browser-internal"], + "@kbn/core-doc-links-browser-internal/*": ["packages/core/doc-links/core-doc-links-browser-internal/*"], + "@kbn/core-doc-links-browser-mocks": ["packages/core/doc-links/core-doc-links-browser-mocks"], + "@kbn/core-doc-links-browser-mocks/*": ["packages/core/doc-links/core-doc-links-browser-mocks/*"], + "@kbn/core-doc-links-server": ["packages/core/doc-links/core-doc-links-server"], + "@kbn/core-doc-links-server/*": ["packages/core/doc-links/core-doc-links-server/*"], + "@kbn/core-doc-links-server-internal": ["packages/core/doc-links/core-doc-links-server-internal"], + "@kbn/core-doc-links-server-internal/*": ["packages/core/doc-links/core-doc-links-server-internal/*"], + "@kbn/core-doc-links-server-mocks": ["packages/core/doc-links/core-doc-links-server-mocks"], + "@kbn/core-doc-links-server-mocks/*": ["packages/core/doc-links/core-doc-links-server-mocks/*"], + "@kbn/core-elasticsearch-client-server-internal": ["packages/core/elasticsearch/core-elasticsearch-client-server-internal"], + "@kbn/core-elasticsearch-client-server-internal/*": ["packages/core/elasticsearch/core-elasticsearch-client-server-internal/*"], + "@kbn/core-elasticsearch-client-server-mocks": ["packages/core/elasticsearch/core-elasticsearch-client-server-mocks"], + "@kbn/core-elasticsearch-client-server-mocks/*": ["packages/core/elasticsearch/core-elasticsearch-client-server-mocks/*"], + "@kbn/core-elasticsearch-server": ["packages/core/elasticsearch/core-elasticsearch-server"], + "@kbn/core-elasticsearch-server/*": ["packages/core/elasticsearch/core-elasticsearch-server/*"], + "@kbn/core-elasticsearch-server-internal": ["packages/core/elasticsearch/core-elasticsearch-server-internal"], + "@kbn/core-elasticsearch-server-internal/*": ["packages/core/elasticsearch/core-elasticsearch-server-internal/*"], + "@kbn/core-elasticsearch-server-mocks": ["packages/core/elasticsearch/core-elasticsearch-server-mocks"], + "@kbn/core-elasticsearch-server-mocks/*": ["packages/core/elasticsearch/core-elasticsearch-server-mocks/*"], + "@kbn/core-environment-server-internal": ["packages/core/environment/core-environment-server-internal"], + "@kbn/core-environment-server-internal/*": ["packages/core/environment/core-environment-server-internal/*"], + "@kbn/core-environment-server-mocks": ["packages/core/environment/core-environment-server-mocks"], + "@kbn/core-environment-server-mocks/*": ["packages/core/environment/core-environment-server-mocks/*"], + "@kbn/core-execution-context-browser": ["packages/core/execution-context/core-execution-context-browser"], + "@kbn/core-execution-context-browser/*": ["packages/core/execution-context/core-execution-context-browser/*"], + "@kbn/core-execution-context-browser-internal": ["packages/core/execution-context/core-execution-context-browser-internal"], + "@kbn/core-execution-context-browser-internal/*": ["packages/core/execution-context/core-execution-context-browser-internal/*"], + "@kbn/core-execution-context-browser-mocks": ["packages/core/execution-context/core-execution-context-browser-mocks"], + "@kbn/core-execution-context-browser-mocks/*": ["packages/core/execution-context/core-execution-context-browser-mocks/*"], + "@kbn/core-execution-context-common": ["packages/core/execution-context/core-execution-context-common"], + "@kbn/core-execution-context-common/*": ["packages/core/execution-context/core-execution-context-common/*"], + "@kbn/core-execution-context-server": ["packages/core/execution-context/core-execution-context-server"], + "@kbn/core-execution-context-server/*": ["packages/core/execution-context/core-execution-context-server/*"], + "@kbn/core-execution-context-server-internal": ["packages/core/execution-context/core-execution-context-server-internal"], + "@kbn/core-execution-context-server-internal/*": ["packages/core/execution-context/core-execution-context-server-internal/*"], + "@kbn/core-execution-context-server-mocks": ["packages/core/execution-context/core-execution-context-server-mocks"], + "@kbn/core-execution-context-server-mocks/*": ["packages/core/execution-context/core-execution-context-server-mocks/*"], + "@kbn/core-fatal-errors-browser": ["packages/core/fatal-errors/core-fatal-errors-browser"], + "@kbn/core-fatal-errors-browser/*": ["packages/core/fatal-errors/core-fatal-errors-browser/*"], + "@kbn/core-fatal-errors-browser-internal": ["packages/core/fatal-errors/core-fatal-errors-browser-internal"], + "@kbn/core-fatal-errors-browser-internal/*": ["packages/core/fatal-errors/core-fatal-errors-browser-internal/*"], + "@kbn/core-fatal-errors-browser-mocks": ["packages/core/fatal-errors/core-fatal-errors-browser-mocks"], + "@kbn/core-fatal-errors-browser-mocks/*": ["packages/core/fatal-errors/core-fatal-errors-browser-mocks/*"], + "@kbn/core-http-browser": ["packages/core/http/core-http-browser"], + "@kbn/core-http-browser/*": ["packages/core/http/core-http-browser/*"], + "@kbn/core-http-browser-internal": ["packages/core/http/core-http-browser-internal"], + "@kbn/core-http-browser-internal/*": ["packages/core/http/core-http-browser-internal/*"], + "@kbn/core-http-browser-mocks": ["packages/core/http/core-http-browser-mocks"], + "@kbn/core-http-browser-mocks/*": ["packages/core/http/core-http-browser-mocks/*"], + "@kbn/core-http-common": ["packages/core/http/core-http-common"], + "@kbn/core-http-common/*": ["packages/core/http/core-http-common/*"], + "@kbn/core-http-context-server-internal": ["packages/core/http/core-http-context-server-internal"], + "@kbn/core-http-context-server-internal/*": ["packages/core/http/core-http-context-server-internal/*"], + "@kbn/core-http-context-server-mocks": ["packages/core/http/core-http-context-server-mocks"], + "@kbn/core-http-context-server-mocks/*": ["packages/core/http/core-http-context-server-mocks/*"], + "@kbn/core-http-request-handler-context-server": ["packages/core/http/core-http-request-handler-context-server"], + "@kbn/core-http-request-handler-context-server/*": ["packages/core/http/core-http-request-handler-context-server/*"], + "@kbn/core-http-request-handler-context-server-internal": ["packages/core/http/core-http-request-handler-context-server-internal"], + "@kbn/core-http-request-handler-context-server-internal/*": ["packages/core/http/core-http-request-handler-context-server-internal/*"], + "@kbn/core-http-resources-server": ["packages/core/http/core-http-resources-server"], + "@kbn/core-http-resources-server/*": ["packages/core/http/core-http-resources-server/*"], + "@kbn/core-http-resources-server-internal": ["packages/core/http/core-http-resources-server-internal"], + "@kbn/core-http-resources-server-internal/*": ["packages/core/http/core-http-resources-server-internal/*"], + "@kbn/core-http-resources-server-mocks": ["packages/core/http/core-http-resources-server-mocks"], + "@kbn/core-http-resources-server-mocks/*": ["packages/core/http/core-http-resources-server-mocks/*"], + "@kbn/core-http-router-server-internal": ["packages/core/http/core-http-router-server-internal"], + "@kbn/core-http-router-server-internal/*": ["packages/core/http/core-http-router-server-internal/*"], + "@kbn/core-http-router-server-mocks": ["packages/core/http/core-http-router-server-mocks"], + "@kbn/core-http-router-server-mocks/*": ["packages/core/http/core-http-router-server-mocks/*"], + "@kbn/core-http-server": ["packages/core/http/core-http-server"], + "@kbn/core-http-server/*": ["packages/core/http/core-http-server/*"], + "@kbn/core-http-server-internal": ["packages/core/http/core-http-server-internal"], + "@kbn/core-http-server-internal/*": ["packages/core/http/core-http-server-internal/*"], + "@kbn/core-http-server-mocks": ["packages/core/http/core-http-server-mocks"], + "@kbn/core-http-server-mocks/*": ["packages/core/http/core-http-server-mocks/*"], + "@kbn/core-i18n-browser": ["packages/core/i18n/core-i18n-browser"], + "@kbn/core-i18n-browser/*": ["packages/core/i18n/core-i18n-browser/*"], + "@kbn/core-i18n-browser-internal": ["packages/core/i18n/core-i18n-browser-internal"], + "@kbn/core-i18n-browser-internal/*": ["packages/core/i18n/core-i18n-browser-internal/*"], + "@kbn/core-i18n-browser-mocks": ["packages/core/i18n/core-i18n-browser-mocks"], + "@kbn/core-i18n-browser-mocks/*": ["packages/core/i18n/core-i18n-browser-mocks/*"], + "@kbn/core-i18n-server": ["packages/core/i18n/core-i18n-server"], + "@kbn/core-i18n-server/*": ["packages/core/i18n/core-i18n-server/*"], + "@kbn/core-i18n-server-internal": ["packages/core/i18n/core-i18n-server-internal"], + "@kbn/core-i18n-server-internal/*": ["packages/core/i18n/core-i18n-server-internal/*"], + "@kbn/core-i18n-server-mocks": ["packages/core/i18n/core-i18n-server-mocks"], + "@kbn/core-i18n-server-mocks/*": ["packages/core/i18n/core-i18n-server-mocks/*"], + "@kbn/core-injected-metadata-browser": ["packages/core/injected-metadata/core-injected-metadata-browser"], + "@kbn/core-injected-metadata-browser/*": ["packages/core/injected-metadata/core-injected-metadata-browser/*"], + "@kbn/core-injected-metadata-browser-internal": ["packages/core/injected-metadata/core-injected-metadata-browser-internal"], + "@kbn/core-injected-metadata-browser-internal/*": ["packages/core/injected-metadata/core-injected-metadata-browser-internal/*"], + "@kbn/core-injected-metadata-browser-mocks": ["packages/core/injected-metadata/core-injected-metadata-browser-mocks"], + "@kbn/core-injected-metadata-browser-mocks/*": ["packages/core/injected-metadata/core-injected-metadata-browser-mocks/*"], + "@kbn/core-injected-metadata-common-internal": ["packages/core/injected-metadata/core-injected-metadata-common-internal"], + "@kbn/core-injected-metadata-common-internal/*": ["packages/core/injected-metadata/core-injected-metadata-common-internal/*"], + "@kbn/core-integrations-browser-internal": ["packages/core/integrations/core-integrations-browser-internal"], + "@kbn/core-integrations-browser-internal/*": ["packages/core/integrations/core-integrations-browser-internal/*"], + "@kbn/core-integrations-browser-mocks": ["packages/core/integrations/core-integrations-browser-mocks"], + "@kbn/core-integrations-browser-mocks/*": ["packages/core/integrations/core-integrations-browser-mocks/*"], + "@kbn/core-lifecycle-browser": ["packages/core/lifecycle/core-lifecycle-browser"], + "@kbn/core-lifecycle-browser/*": ["packages/core/lifecycle/core-lifecycle-browser/*"], + "@kbn/core-lifecycle-browser-internal": ["packages/core/lifecycle/core-lifecycle-browser-internal"], + "@kbn/core-lifecycle-browser-internal/*": ["packages/core/lifecycle/core-lifecycle-browser-internal/*"], + "@kbn/core-lifecycle-browser-mocks": ["packages/core/lifecycle/core-lifecycle-browser-mocks"], + "@kbn/core-lifecycle-browser-mocks/*": ["packages/core/lifecycle/core-lifecycle-browser-mocks/*"], + "@kbn/core-lifecycle-server": ["packages/core/lifecycle/core-lifecycle-server"], + "@kbn/core-lifecycle-server/*": ["packages/core/lifecycle/core-lifecycle-server/*"], + "@kbn/core-lifecycle-server-internal": ["packages/core/lifecycle/core-lifecycle-server-internal"], + "@kbn/core-lifecycle-server-internal/*": ["packages/core/lifecycle/core-lifecycle-server-internal/*"], + "@kbn/core-lifecycle-server-mocks": ["packages/core/lifecycle/core-lifecycle-server-mocks"], + "@kbn/core-lifecycle-server-mocks/*": ["packages/core/lifecycle/core-lifecycle-server-mocks/*"], + "@kbn/core-logging-browser-internal": ["packages/core/logging/core-logging-browser-internal"], + "@kbn/core-logging-browser-internal/*": ["packages/core/logging/core-logging-browser-internal/*"], + "@kbn/core-logging-browser-mocks": ["packages/core/logging/core-logging-browser-mocks"], + "@kbn/core-logging-browser-mocks/*": ["packages/core/logging/core-logging-browser-mocks/*"], + "@kbn/core-logging-common-internal": ["packages/core/logging/core-logging-common-internal"], + "@kbn/core-logging-common-internal/*": ["packages/core/logging/core-logging-common-internal/*"], + "@kbn/core-logging-server": ["packages/core/logging/core-logging-server"], + "@kbn/core-logging-server/*": ["packages/core/logging/core-logging-server/*"], + "@kbn/core-logging-server-internal": ["packages/core/logging/core-logging-server-internal"], + "@kbn/core-logging-server-internal/*": ["packages/core/logging/core-logging-server-internal/*"], + "@kbn/core-logging-server-mocks": ["packages/core/logging/core-logging-server-mocks"], + "@kbn/core-logging-server-mocks/*": ["packages/core/logging/core-logging-server-mocks/*"], + "@kbn/core-metrics-collectors-server-internal": ["packages/core/metrics/core-metrics-collectors-server-internal"], + "@kbn/core-metrics-collectors-server-internal/*": ["packages/core/metrics/core-metrics-collectors-server-internal/*"], + "@kbn/core-metrics-collectors-server-mocks": ["packages/core/metrics/core-metrics-collectors-server-mocks"], + "@kbn/core-metrics-collectors-server-mocks/*": ["packages/core/metrics/core-metrics-collectors-server-mocks/*"], + "@kbn/core-metrics-server": ["packages/core/metrics/core-metrics-server"], + "@kbn/core-metrics-server/*": ["packages/core/metrics/core-metrics-server/*"], + "@kbn/core-metrics-server-internal": ["packages/core/metrics/core-metrics-server-internal"], + "@kbn/core-metrics-server-internal/*": ["packages/core/metrics/core-metrics-server-internal/*"], + "@kbn/core-metrics-server-mocks": ["packages/core/metrics/core-metrics-server-mocks"], + "@kbn/core-metrics-server-mocks/*": ["packages/core/metrics/core-metrics-server-mocks/*"], + "@kbn/core-mount-utils-browser": ["packages/core/mount-utils/core-mount-utils-browser"], + "@kbn/core-mount-utils-browser/*": ["packages/core/mount-utils/core-mount-utils-browser/*"], + "@kbn/core-mount-utils-browser-internal": ["packages/core/mount-utils/core-mount-utils-browser-internal"], + "@kbn/core-mount-utils-browser-internal/*": ["packages/core/mount-utils/core-mount-utils-browser-internal/*"], + "@kbn/core-node-server": ["packages/core/node/core-node-server"], + "@kbn/core-node-server/*": ["packages/core/node/core-node-server/*"], + "@kbn/core-node-server-internal": ["packages/core/node/core-node-server-internal"], + "@kbn/core-node-server-internal/*": ["packages/core/node/core-node-server-internal/*"], + "@kbn/core-node-server-mocks": ["packages/core/node/core-node-server-mocks"], + "@kbn/core-node-server-mocks/*": ["packages/core/node/core-node-server-mocks/*"], + "@kbn/core-notifications-browser": ["packages/core/notifications/core-notifications-browser"], + "@kbn/core-notifications-browser/*": ["packages/core/notifications/core-notifications-browser/*"], + "@kbn/core-notifications-browser-internal": ["packages/core/notifications/core-notifications-browser-internal"], + "@kbn/core-notifications-browser-internal/*": ["packages/core/notifications/core-notifications-browser-internal/*"], + "@kbn/core-notifications-browser-mocks": ["packages/core/notifications/core-notifications-browser-mocks"], + "@kbn/core-notifications-browser-mocks/*": ["packages/core/notifications/core-notifications-browser-mocks/*"], + "@kbn/core-overlays-browser": ["packages/core/overlays/core-overlays-browser"], + "@kbn/core-overlays-browser/*": ["packages/core/overlays/core-overlays-browser/*"], + "@kbn/core-overlays-browser-internal": ["packages/core/overlays/core-overlays-browser-internal"], + "@kbn/core-overlays-browser-internal/*": ["packages/core/overlays/core-overlays-browser-internal/*"], + "@kbn/core-overlays-browser-mocks": ["packages/core/overlays/core-overlays-browser-mocks"], + "@kbn/core-overlays-browser-mocks/*": ["packages/core/overlays/core-overlays-browser-mocks/*"], + "@kbn/core-plugins-base-server-internal": ["packages/core/plugins/core-plugins-base-server-internal"], + "@kbn/core-plugins-base-server-internal/*": ["packages/core/plugins/core-plugins-base-server-internal/*"], + "@kbn/core-plugins-browser": ["packages/core/plugins/core-plugins-browser"], + "@kbn/core-plugins-browser/*": ["packages/core/plugins/core-plugins-browser/*"], + "@kbn/core-plugins-browser-internal": ["packages/core/plugins/core-plugins-browser-internal"], + "@kbn/core-plugins-browser-internal/*": ["packages/core/plugins/core-plugins-browser-internal/*"], + "@kbn/core-plugins-browser-mocks": ["packages/core/plugins/core-plugins-browser-mocks"], + "@kbn/core-plugins-browser-mocks/*": ["packages/core/plugins/core-plugins-browser-mocks/*"], + "@kbn/core-plugins-server": ["packages/core/plugins/core-plugins-server"], + "@kbn/core-plugins-server/*": ["packages/core/plugins/core-plugins-server/*"], + "@kbn/core-plugins-server-internal": ["packages/core/plugins/core-plugins-server-internal"], + "@kbn/core-plugins-server-internal/*": ["packages/core/plugins/core-plugins-server-internal/*"], + "@kbn/core-plugins-server-mocks": ["packages/core/plugins/core-plugins-server-mocks"], + "@kbn/core-plugins-server-mocks/*": ["packages/core/plugins/core-plugins-server-mocks/*"], + "@kbn/core-preboot-server": ["packages/core/preboot/core-preboot-server"], + "@kbn/core-preboot-server/*": ["packages/core/preboot/core-preboot-server/*"], + "@kbn/core-preboot-server-internal": ["packages/core/preboot/core-preboot-server-internal"], + "@kbn/core-preboot-server-internal/*": ["packages/core/preboot/core-preboot-server-internal/*"], + "@kbn/core-preboot-server-mocks": ["packages/core/preboot/core-preboot-server-mocks"], + "@kbn/core-preboot-server-mocks/*": ["packages/core/preboot/core-preboot-server-mocks/*"], + "@kbn/core-rendering-browser-internal": ["packages/core/rendering/core-rendering-browser-internal"], + "@kbn/core-rendering-browser-internal/*": ["packages/core/rendering/core-rendering-browser-internal/*"], + "@kbn/core-rendering-browser-mocks": ["packages/core/rendering/core-rendering-browser-mocks"], + "@kbn/core-rendering-browser-mocks/*": ["packages/core/rendering/core-rendering-browser-mocks/*"], + "@kbn/core-rendering-server-internal": ["packages/core/rendering/core-rendering-server-internal"], + "@kbn/core-rendering-server-internal/*": ["packages/core/rendering/core-rendering-server-internal/*"], + "@kbn/core-rendering-server-mocks": ["packages/core/rendering/core-rendering-server-mocks"], + "@kbn/core-rendering-server-mocks/*": ["packages/core/rendering/core-rendering-server-mocks/*"], + "@kbn/core-root-browser-internal": ["packages/core/root/core-root-browser-internal"], + "@kbn/core-root-browser-internal/*": ["packages/core/root/core-root-browser-internal/*"], + "@kbn/core-saved-objects-api-browser": ["packages/core/saved-objects/core-saved-objects-api-browser"], + "@kbn/core-saved-objects-api-browser/*": ["packages/core/saved-objects/core-saved-objects-api-browser/*"], + "@kbn/core-saved-objects-api-server": ["packages/core/saved-objects/core-saved-objects-api-server"], + "@kbn/core-saved-objects-api-server/*": ["packages/core/saved-objects/core-saved-objects-api-server/*"], + "@kbn/core-saved-objects-api-server-internal": ["packages/core/saved-objects/core-saved-objects-api-server-internal"], + "@kbn/core-saved-objects-api-server-internal/*": ["packages/core/saved-objects/core-saved-objects-api-server-internal/*"], + "@kbn/core-saved-objects-api-server-mocks": ["packages/core/saved-objects/core-saved-objects-api-server-mocks"], + "@kbn/core-saved-objects-api-server-mocks/*": ["packages/core/saved-objects/core-saved-objects-api-server-mocks/*"], + "@kbn/core-saved-objects-base-server-internal": ["packages/core/saved-objects/core-saved-objects-base-server-internal"], + "@kbn/core-saved-objects-base-server-internal/*": ["packages/core/saved-objects/core-saved-objects-base-server-internal/*"], + "@kbn/core-saved-objects-base-server-mocks": ["packages/core/saved-objects/core-saved-objects-base-server-mocks"], + "@kbn/core-saved-objects-base-server-mocks/*": ["packages/core/saved-objects/core-saved-objects-base-server-mocks/*"], + "@kbn/core-saved-objects-browser": ["packages/core/saved-objects/core-saved-objects-browser"], + "@kbn/core-saved-objects-browser/*": ["packages/core/saved-objects/core-saved-objects-browser/*"], + "@kbn/core-saved-objects-browser-internal": ["packages/core/saved-objects/core-saved-objects-browser-internal"], + "@kbn/core-saved-objects-browser-internal/*": ["packages/core/saved-objects/core-saved-objects-browser-internal/*"], + "@kbn/core-saved-objects-browser-mocks": ["packages/core/saved-objects/core-saved-objects-browser-mocks"], + "@kbn/core-saved-objects-browser-mocks/*": ["packages/core/saved-objects/core-saved-objects-browser-mocks/*"], + "@kbn/core-saved-objects-common": ["packages/core/saved-objects/core-saved-objects-common"], + "@kbn/core-saved-objects-common/*": ["packages/core/saved-objects/core-saved-objects-common/*"], + "@kbn/core-saved-objects-import-export-server-internal": ["packages/core/saved-objects/core-saved-objects-import-export-server-internal"], + "@kbn/core-saved-objects-import-export-server-internal/*": ["packages/core/saved-objects/core-saved-objects-import-export-server-internal/*"], + "@kbn/core-saved-objects-import-export-server-mocks": ["packages/core/saved-objects/core-saved-objects-import-export-server-mocks"], + "@kbn/core-saved-objects-import-export-server-mocks/*": ["packages/core/saved-objects/core-saved-objects-import-export-server-mocks/*"], + "@kbn/core-saved-objects-migration-server-internal": ["packages/core/saved-objects/core-saved-objects-migration-server-internal"], + "@kbn/core-saved-objects-migration-server-internal/*": ["packages/core/saved-objects/core-saved-objects-migration-server-internal/*"], + "@kbn/core-saved-objects-migration-server-mocks": ["packages/core/saved-objects/core-saved-objects-migration-server-mocks"], + "@kbn/core-saved-objects-migration-server-mocks/*": ["packages/core/saved-objects/core-saved-objects-migration-server-mocks/*"], + "@kbn/core-saved-objects-server": ["packages/core/saved-objects/core-saved-objects-server"], + "@kbn/core-saved-objects-server/*": ["packages/core/saved-objects/core-saved-objects-server/*"], + "@kbn/core-saved-objects-server-internal": ["packages/core/saved-objects/core-saved-objects-server-internal"], + "@kbn/core-saved-objects-server-internal/*": ["packages/core/saved-objects/core-saved-objects-server-internal/*"], + "@kbn/core-saved-objects-server-mocks": ["packages/core/saved-objects/core-saved-objects-server-mocks"], + "@kbn/core-saved-objects-server-mocks/*": ["packages/core/saved-objects/core-saved-objects-server-mocks/*"], + "@kbn/core-saved-objects-utils-server": ["packages/core/saved-objects/core-saved-objects-utils-server"], + "@kbn/core-saved-objects-utils-server/*": ["packages/core/saved-objects/core-saved-objects-utils-server/*"], + "@kbn/core-status-common": ["packages/core/status/core-status-common"], + "@kbn/core-status-common/*": ["packages/core/status/core-status-common/*"], + "@kbn/core-status-common-internal": ["packages/core/status/core-status-common-internal"], + "@kbn/core-status-common-internal/*": ["packages/core/status/core-status-common-internal/*"], + "@kbn/core-status-server": ["packages/core/status/core-status-server"], + "@kbn/core-status-server/*": ["packages/core/status/core-status-server/*"], + "@kbn/core-status-server-internal": ["packages/core/status/core-status-server-internal"], + "@kbn/core-status-server-internal/*": ["packages/core/status/core-status-server-internal/*"], + "@kbn/core-status-server-mocks": ["packages/core/status/core-status-server-mocks"], + "@kbn/core-status-server-mocks/*": ["packages/core/status/core-status-server-mocks/*"], + "@kbn/core-test-helpers-deprecations-getters": ["packages/core/test-helpers/core-test-helpers-deprecations-getters"], + "@kbn/core-test-helpers-deprecations-getters/*": ["packages/core/test-helpers/core-test-helpers-deprecations-getters/*"], + "@kbn/core-test-helpers-http-setup-browser": ["packages/core/test-helpers/core-test-helpers-http-setup-browser"], + "@kbn/core-test-helpers-http-setup-browser/*": ["packages/core/test-helpers/core-test-helpers-http-setup-browser/*"], + "@kbn/core-test-helpers-so-type-serializer": ["packages/core/test-helpers/core-test-helpers-so-type-serializer"], + "@kbn/core-test-helpers-so-type-serializer/*": ["packages/core/test-helpers/core-test-helpers-so-type-serializer/*"], + "@kbn/core-test-helpers-test-utils": ["packages/core/test-helpers/core-test-helpers-test-utils"], + "@kbn/core-test-helpers-test-utils/*": ["packages/core/test-helpers/core-test-helpers-test-utils/*"], + "@kbn/core-theme-browser": ["packages/core/theme/core-theme-browser"], + "@kbn/core-theme-browser/*": ["packages/core/theme/core-theme-browser/*"], + "@kbn/core-theme-browser-internal": ["packages/core/theme/core-theme-browser-internal"], + "@kbn/core-theme-browser-internal/*": ["packages/core/theme/core-theme-browser-internal/*"], + "@kbn/core-theme-browser-mocks": ["packages/core/theme/core-theme-browser-mocks"], + "@kbn/core-theme-browser-mocks/*": ["packages/core/theme/core-theme-browser-mocks/*"], + "@kbn/core-ui-settings-browser": ["packages/core/ui-settings/core-ui-settings-browser"], + "@kbn/core-ui-settings-browser/*": ["packages/core/ui-settings/core-ui-settings-browser/*"], + "@kbn/core-ui-settings-browser-internal": ["packages/core/ui-settings/core-ui-settings-browser-internal"], + "@kbn/core-ui-settings-browser-internal/*": ["packages/core/ui-settings/core-ui-settings-browser-internal/*"], + "@kbn/core-ui-settings-browser-mocks": ["packages/core/ui-settings/core-ui-settings-browser-mocks"], + "@kbn/core-ui-settings-browser-mocks/*": ["packages/core/ui-settings/core-ui-settings-browser-mocks/*"], + "@kbn/core-ui-settings-common": ["packages/core/ui-settings/core-ui-settings-common"], + "@kbn/core-ui-settings-common/*": ["packages/core/ui-settings/core-ui-settings-common/*"], + "@kbn/core-ui-settings-server": ["packages/core/ui-settings/core-ui-settings-server"], + "@kbn/core-ui-settings-server/*": ["packages/core/ui-settings/core-ui-settings-server/*"], + "@kbn/core-ui-settings-server-internal": ["packages/core/ui-settings/core-ui-settings-server-internal"], + "@kbn/core-ui-settings-server-internal/*": ["packages/core/ui-settings/core-ui-settings-server-internal/*"], + "@kbn/core-ui-settings-server-mocks": ["packages/core/ui-settings/core-ui-settings-server-mocks"], + "@kbn/core-ui-settings-server-mocks/*": ["packages/core/ui-settings/core-ui-settings-server-mocks/*"], + "@kbn/core-usage-data-base-server-internal": ["packages/core/usage-data/core-usage-data-base-server-internal"], + "@kbn/core-usage-data-base-server-internal/*": ["packages/core/usage-data/core-usage-data-base-server-internal/*"], + "@kbn/core-usage-data-server": ["packages/core/usage-data/core-usage-data-server"], + "@kbn/core-usage-data-server/*": ["packages/core/usage-data/core-usage-data-server/*"], + "@kbn/core-usage-data-server-internal": ["packages/core/usage-data/core-usage-data-server-internal"], + "@kbn/core-usage-data-server-internal/*": ["packages/core/usage-data/core-usage-data-server-internal/*"], + "@kbn/core-usage-data-server-mocks": ["packages/core/usage-data/core-usage-data-server-mocks"], + "@kbn/core-usage-data-server-mocks/*": ["packages/core/usage-data/core-usage-data-server-mocks/*"], + "@kbn/home-sample-data-card": ["packages/home/sample_data_card"], + "@kbn/home-sample-data-card/*": ["packages/home/sample_data_card/*"], + "@kbn/home-sample-data-tab": ["packages/home/sample_data_tab"], + "@kbn/home-sample-data-tab/*": ["packages/home/sample_data_tab/*"], + "@kbn/home-sample-data-types": ["packages/home/sample_data_types"], + "@kbn/home-sample-data-types/*": ["packages/home/sample_data_types/*"], + "@kbn/ace": ["packages/kbn-ace"], + "@kbn/ace/*": ["packages/kbn-ace/*"], + "@kbn/alerts": ["packages/kbn-alerts"], + "@kbn/alerts/*": ["packages/kbn-alerts/*"], + "@kbn/ambient-storybook-types": ["packages/kbn-ambient-storybook-types"], + "@kbn/ambient-storybook-types/*": ["packages/kbn-ambient-storybook-types/*"], + "@kbn/ambient-ui-types": ["packages/kbn-ambient-ui-types"], + "@kbn/ambient-ui-types/*": ["packages/kbn-ambient-ui-types/*"], + "@kbn/analytics": ["packages/kbn-analytics"], + "@kbn/analytics/*": ["packages/kbn-analytics/*"], + "@kbn/apm-config-loader": ["packages/kbn-apm-config-loader"], + "@kbn/apm-config-loader/*": ["packages/kbn-apm-config-loader/*"], + "@kbn/apm-synthtrace": ["packages/kbn-apm-synthtrace"], + "@kbn/apm-synthtrace/*": ["packages/kbn-apm-synthtrace/*"], + "@kbn/apm-utils": ["packages/kbn-apm-utils"], + "@kbn/apm-utils/*": ["packages/kbn-apm-utils/*"], + "@kbn/axe-config": ["packages/kbn-axe-config"], + "@kbn/axe-config/*": ["packages/kbn-axe-config/*"], + "@kbn/babel-plugin-synthetic-packages": ["packages/kbn-babel-plugin-synthetic-packages"], + "@kbn/babel-plugin-synthetic-packages/*": ["packages/kbn-babel-plugin-synthetic-packages/*"], + "@kbn/babel-preset": ["packages/kbn-babel-preset"], + "@kbn/babel-preset/*": ["packages/kbn-babel-preset/*"], + "@kbn/bazel-packages": ["packages/kbn-bazel-packages"], + "@kbn/bazel-packages/*": ["packages/kbn-bazel-packages/*"], + "@kbn/bazel-runner": ["packages/kbn-bazel-runner"], + "@kbn/bazel-runner/*": ["packages/kbn-bazel-runner/*"], + "@kbn/cases-components": ["packages/kbn-cases-components"], + "@kbn/cases-components/*": ["packages/kbn-cases-components/*"], + "@kbn/chart-icons": ["packages/kbn-chart-icons"], + "@kbn/chart-icons/*": ["packages/kbn-chart-icons/*"], + "@kbn/ci-stats-core": ["packages/kbn-ci-stats-core"], + "@kbn/ci-stats-core/*": ["packages/kbn-ci-stats-core/*"], + "@kbn/ci-stats-performance-metrics": ["packages/kbn-ci-stats-performance-metrics"], + "@kbn/ci-stats-performance-metrics/*": ["packages/kbn-ci-stats-performance-metrics/*"], + "@kbn/ci-stats-reporter": ["packages/kbn-ci-stats-reporter"], + "@kbn/ci-stats-reporter/*": ["packages/kbn-ci-stats-reporter/*"], + "@kbn/cli-dev-mode": ["packages/kbn-cli-dev-mode"], + "@kbn/cli-dev-mode/*": ["packages/kbn-cli-dev-mode/*"], + "@kbn/coloring": ["packages/kbn-coloring"], + "@kbn/coloring/*": ["packages/kbn-coloring/*"], + "@kbn/config": ["packages/kbn-config"], + "@kbn/config/*": ["packages/kbn-config/*"], + "@kbn/config-mocks": ["packages/kbn-config-mocks"], + "@kbn/config-mocks/*": ["packages/kbn-config-mocks/*"], + "@kbn/config-schema": ["packages/kbn-config-schema"], + "@kbn/config-schema/*": ["packages/kbn-config-schema/*"], + "@kbn/crypto": ["packages/kbn-crypto"], + "@kbn/crypto/*": ["packages/kbn-crypto/*"], + "@kbn/crypto-browser": ["packages/kbn-crypto-browser"], + "@kbn/crypto-browser/*": ["packages/kbn-crypto-browser/*"], + "@kbn/datemath": ["packages/kbn-datemath"], + "@kbn/datemath/*": ["packages/kbn-datemath/*"], + "@kbn/dev-cli-errors": ["packages/kbn-dev-cli-errors"], + "@kbn/dev-cli-errors/*": ["packages/kbn-dev-cli-errors/*"], + "@kbn/dev-cli-runner": ["packages/kbn-dev-cli-runner"], + "@kbn/dev-cli-runner/*": ["packages/kbn-dev-cli-runner/*"], + "@kbn/dev-proc-runner": ["packages/kbn-dev-proc-runner"], + "@kbn/dev-proc-runner/*": ["packages/kbn-dev-proc-runner/*"], + "@kbn/dev-utils": ["packages/kbn-dev-utils"], + "@kbn/dev-utils/*": ["packages/kbn-dev-utils/*"], + "@kbn/doc-links": ["packages/kbn-doc-links"], + "@kbn/doc-links/*": ["packages/kbn-doc-links/*"], + "@kbn/docs-utils": ["packages/kbn-docs-utils"], + "@kbn/docs-utils/*": ["packages/kbn-docs-utils/*"], + "@kbn/ebt-tools": ["packages/kbn-ebt-tools"], + "@kbn/ebt-tools/*": ["packages/kbn-ebt-tools/*"], + "@kbn/es": ["packages/kbn-es"], + "@kbn/es/*": ["packages/kbn-es/*"], + "@kbn/es-archiver": ["packages/kbn-es-archiver"], + "@kbn/es-archiver/*": ["packages/kbn-es-archiver/*"], + "@kbn/es-errors": ["packages/kbn-es-errors"], + "@kbn/es-errors/*": ["packages/kbn-es-errors/*"], + "@kbn/es-query": ["packages/kbn-es-query"], + "@kbn/es-query/*": ["packages/kbn-es-query/*"], + "@kbn/es-types": ["packages/kbn-es-types"], + "@kbn/es-types/*": ["packages/kbn-es-types/*"], + "@kbn/eslint-config": ["packages/kbn-eslint-config"], + "@kbn/eslint-config/*": ["packages/kbn-eslint-config/*"], + "@kbn/eslint-plugin-disable": ["packages/kbn-eslint-plugin-disable"], + "@kbn/eslint-plugin-disable/*": ["packages/kbn-eslint-plugin-disable/*"], + "@kbn/eslint-plugin-eslint": ["packages/kbn-eslint-plugin-eslint"], + "@kbn/eslint-plugin-eslint/*": ["packages/kbn-eslint-plugin-eslint/*"], + "@kbn/eslint-plugin-imports": ["packages/kbn-eslint-plugin-imports"], + "@kbn/eslint-plugin-imports/*": ["packages/kbn-eslint-plugin-imports/*"], + "@kbn/expect": ["packages/kbn-expect"], + "@kbn/expect/*": ["packages/kbn-expect/*"], + "@kbn/failed-test-reporter-cli": ["packages/kbn-failed-test-reporter-cli"], + "@kbn/failed-test-reporter-cli/*": ["packages/kbn-failed-test-reporter-cli/*"], + "@kbn/field-types": ["packages/kbn-field-types"], + "@kbn/field-types/*": ["packages/kbn-field-types/*"], + "@kbn/find-used-node-modules": ["packages/kbn-find-used-node-modules"], + "@kbn/find-used-node-modules/*": ["packages/kbn-find-used-node-modules/*"], + "@kbn/flot-charts": ["packages/kbn-flot-charts"], + "@kbn/flot-charts/*": ["packages/kbn-flot-charts/*"], + "@kbn/ftr-common-functional-services": ["packages/kbn-ftr-common-functional-services"], + "@kbn/ftr-common-functional-services/*": ["packages/kbn-ftr-common-functional-services/*"], + "@kbn/ftr-screenshot-filename": ["packages/kbn-ftr-screenshot-filename"], + "@kbn/ftr-screenshot-filename/*": ["packages/kbn-ftr-screenshot-filename/*"], + "@kbn/generate": ["packages/kbn-generate"], + "@kbn/generate/*": ["packages/kbn-generate/*"], + "@kbn/get-repo-files": ["packages/kbn-get-repo-files"], + "@kbn/get-repo-files/*": ["packages/kbn-get-repo-files/*"], + "@kbn/guided-onboarding": ["packages/kbn-guided-onboarding"], + "@kbn/guided-onboarding/*": ["packages/kbn-guided-onboarding/*"], + "@kbn/handlebars": ["packages/kbn-handlebars"], + "@kbn/handlebars/*": ["packages/kbn-handlebars/*"], + "@kbn/hapi-mocks": ["packages/kbn-hapi-mocks"], + "@kbn/hapi-mocks/*": ["packages/kbn-hapi-mocks/*"], + "@kbn/i18n": ["packages/kbn-i18n"], + "@kbn/i18n/*": ["packages/kbn-i18n/*"], + "@kbn/i18n-react": ["packages/kbn-i18n-react"], + "@kbn/i18n-react/*": ["packages/kbn-i18n-react/*"], + "@kbn/import-resolver": ["packages/kbn-import-resolver"], + "@kbn/import-resolver/*": ["packages/kbn-import-resolver/*"], + "@kbn/interpreter": ["packages/kbn-interpreter"], + "@kbn/interpreter/*": ["packages/kbn-interpreter/*"], + "@kbn/io-ts-utils": ["packages/kbn-io-ts-utils"], + "@kbn/io-ts-utils/*": ["packages/kbn-io-ts-utils/*"], + "@kbn/jest-serializers": ["packages/kbn-jest-serializers"], + "@kbn/jest-serializers/*": ["packages/kbn-jest-serializers/*"], + "@kbn/journeys": ["packages/kbn-journeys"], + "@kbn/journeys/*": ["packages/kbn-journeys/*"], + "@kbn/kibana-manifest-schema": ["packages/kbn-kibana-manifest-schema"], + "@kbn/kibana-manifest-schema/*": ["packages/kbn-kibana-manifest-schema/*"], + "@kbn/language-documentation-popover": ["packages/kbn-language-documentation-popover"], + "@kbn/language-documentation-popover/*": ["packages/kbn-language-documentation-popover/*"], + "@kbn/logging": ["packages/kbn-logging"], + "@kbn/logging/*": ["packages/kbn-logging/*"], + "@kbn/logging-mocks": ["packages/kbn-logging-mocks"], + "@kbn/logging-mocks/*": ["packages/kbn-logging-mocks/*"], + "@kbn/managed-vscode-config": ["packages/kbn-managed-vscode-config"], + "@kbn/managed-vscode-config/*": ["packages/kbn-managed-vscode-config/*"], + "@kbn/managed-vscode-config-cli": ["packages/kbn-managed-vscode-config-cli"], + "@kbn/managed-vscode-config-cli/*": ["packages/kbn-managed-vscode-config-cli/*"], + "@kbn/mapbox-gl": ["packages/kbn-mapbox-gl"], + "@kbn/mapbox-gl/*": ["packages/kbn-mapbox-gl/*"], + "@kbn/monaco": ["packages/kbn-monaco"], + "@kbn/monaco/*": ["packages/kbn-monaco/*"], + "@kbn/optimizer": ["packages/kbn-optimizer"], + "@kbn/optimizer/*": ["packages/kbn-optimizer/*"], + "@kbn/optimizer-webpack-helpers": ["packages/kbn-optimizer-webpack-helpers"], + "@kbn/optimizer-webpack-helpers/*": ["packages/kbn-optimizer-webpack-helpers/*"], + "@kbn/osquery-io-ts-types": ["packages/kbn-osquery-io-ts-types"], + "@kbn/osquery-io-ts-types/*": ["packages/kbn-osquery-io-ts-types/*"], + "@kbn/performance-testing-dataset-extractor": ["packages/kbn-performance-testing-dataset-extractor"], + "@kbn/performance-testing-dataset-extractor/*": ["packages/kbn-performance-testing-dataset-extractor/*"], + "@kbn/plugin-discovery": ["packages/kbn-plugin-discovery"], + "@kbn/plugin-discovery/*": ["packages/kbn-plugin-discovery/*"], + "@kbn/plugin-generator": ["packages/kbn-plugin-generator"], + "@kbn/plugin-generator/*": ["packages/kbn-plugin-generator/*"], + "@kbn/plugin-helpers": ["packages/kbn-plugin-helpers"], + "@kbn/plugin-helpers/*": ["packages/kbn-plugin-helpers/*"], + "@kbn/react-field": ["packages/kbn-react-field"], + "@kbn/react-field/*": ["packages/kbn-react-field/*"], + "@kbn/repo-source-classifier": ["packages/kbn-repo-source-classifier"], + "@kbn/repo-source-classifier/*": ["packages/kbn-repo-source-classifier/*"], + "@kbn/repo-source-classifier-cli": ["packages/kbn-repo-source-classifier-cli"], + "@kbn/repo-source-classifier-cli/*": ["packages/kbn-repo-source-classifier-cli/*"], + "@kbn/rule-data-utils": ["packages/kbn-rule-data-utils"], + "@kbn/rule-data-utils/*": ["packages/kbn-rule-data-utils/*"], + "@kbn/safer-lodash-set": ["packages/kbn-safer-lodash-set"], + "@kbn/safer-lodash-set/*": ["packages/kbn-safer-lodash-set/*"], + "@kbn/securitysolution-autocomplete": ["packages/kbn-securitysolution-autocomplete"], + "@kbn/securitysolution-autocomplete/*": ["packages/kbn-securitysolution-autocomplete/*"], + "@kbn/securitysolution-es-utils": ["packages/kbn-securitysolution-es-utils"], + "@kbn/securitysolution-es-utils/*": ["packages/kbn-securitysolution-es-utils/*"], + "@kbn/securitysolution-exception-list-components": ["packages/kbn-securitysolution-exception-list-components"], + "@kbn/securitysolution-exception-list-components/*": ["packages/kbn-securitysolution-exception-list-components/*"], + "@kbn/securitysolution-hook-utils": ["packages/kbn-securitysolution-hook-utils"], + "@kbn/securitysolution-hook-utils/*": ["packages/kbn-securitysolution-hook-utils/*"], + "@kbn/securitysolution-io-ts-alerting-types": ["packages/kbn-securitysolution-io-ts-alerting-types"], + "@kbn/securitysolution-io-ts-alerting-types/*": ["packages/kbn-securitysolution-io-ts-alerting-types/*"], + "@kbn/securitysolution-io-ts-list-types": ["packages/kbn-securitysolution-io-ts-list-types"], + "@kbn/securitysolution-io-ts-list-types/*": ["packages/kbn-securitysolution-io-ts-list-types/*"], + "@kbn/securitysolution-io-ts-types": ["packages/kbn-securitysolution-io-ts-types"], + "@kbn/securitysolution-io-ts-types/*": ["packages/kbn-securitysolution-io-ts-types/*"], + "@kbn/securitysolution-io-ts-utils": ["packages/kbn-securitysolution-io-ts-utils"], + "@kbn/securitysolution-io-ts-utils/*": ["packages/kbn-securitysolution-io-ts-utils/*"], + "@kbn/securitysolution-list-api": ["packages/kbn-securitysolution-list-api"], + "@kbn/securitysolution-list-api/*": ["packages/kbn-securitysolution-list-api/*"], + "@kbn/securitysolution-list-constants": ["packages/kbn-securitysolution-list-constants"], + "@kbn/securitysolution-list-constants/*": ["packages/kbn-securitysolution-list-constants/*"], + "@kbn/securitysolution-list-hooks": ["packages/kbn-securitysolution-list-hooks"], + "@kbn/securitysolution-list-hooks/*": ["packages/kbn-securitysolution-list-hooks/*"], + "@kbn/securitysolution-list-utils": ["packages/kbn-securitysolution-list-utils"], + "@kbn/securitysolution-list-utils/*": ["packages/kbn-securitysolution-list-utils/*"], + "@kbn/securitysolution-rules": ["packages/kbn-securitysolution-rules"], + "@kbn/securitysolution-rules/*": ["packages/kbn-securitysolution-rules/*"], + "@kbn/securitysolution-t-grid": ["packages/kbn-securitysolution-t-grid"], + "@kbn/securitysolution-t-grid/*": ["packages/kbn-securitysolution-t-grid/*"], + "@kbn/securitysolution-utils": ["packages/kbn-securitysolution-utils"], + "@kbn/securitysolution-utils/*": ["packages/kbn-securitysolution-utils/*"], + "@kbn/server-http-tools": ["packages/kbn-server-http-tools"], + "@kbn/server-http-tools/*": ["packages/kbn-server-http-tools/*"], + "@kbn/server-route-repository": ["packages/kbn-server-route-repository"], + "@kbn/server-route-repository/*": ["packages/kbn-server-route-repository/*"], + "@kbn/shared-svg": ["packages/kbn-shared-svg"], + "@kbn/shared-svg/*": ["packages/kbn-shared-svg/*"], + "@kbn/shared-ux-utility": ["packages/kbn-shared-ux-utility"], + "@kbn/shared-ux-utility/*": ["packages/kbn-shared-ux-utility/*"], + "@kbn/some-dev-log": ["packages/kbn-some-dev-log"], + "@kbn/some-dev-log/*": ["packages/kbn-some-dev-log/*"], + "@kbn/sort-package-json": ["packages/kbn-sort-package-json"], + "@kbn/sort-package-json/*": ["packages/kbn-sort-package-json/*"], + "@kbn/spec-to-console": ["packages/kbn-spec-to-console"], + "@kbn/spec-to-console/*": ["packages/kbn-spec-to-console/*"], + "@kbn/std": ["packages/kbn-std"], + "@kbn/std/*": ["packages/kbn-std/*"], + "@kbn/stdio-dev-helpers": ["packages/kbn-stdio-dev-helpers"], + "@kbn/stdio-dev-helpers/*": ["packages/kbn-stdio-dev-helpers/*"], + "@kbn/storybook": ["packages/kbn-storybook"], + "@kbn/storybook/*": ["packages/kbn-storybook/*"], + "@kbn/synthetic-package-map": ["packages/kbn-synthetic-package-map"], + "@kbn/synthetic-package-map/*": ["packages/kbn-synthetic-package-map/*"], + "@kbn/telemetry-tools": ["packages/kbn-telemetry-tools"], + "@kbn/telemetry-tools/*": ["packages/kbn-telemetry-tools/*"], + "@kbn/test": ["packages/kbn-test"], + "@kbn/test/*": ["packages/kbn-test/*"], + "@kbn/test-jest-helpers": ["packages/kbn-test-jest-helpers"], + "@kbn/test-jest-helpers/*": ["packages/kbn-test-jest-helpers/*"], + "@kbn/test-subj-selector": ["packages/kbn-test-subj-selector"], + "@kbn/test-subj-selector/*": ["packages/kbn-test-subj-selector/*"], + "@kbn/timelion-grammar": ["packages/kbn-timelion-grammar"], + "@kbn/timelion-grammar/*": ["packages/kbn-timelion-grammar/*"], + "@kbn/tinymath": ["packages/kbn-tinymath"], + "@kbn/tinymath/*": ["packages/kbn-tinymath/*"], + "@kbn/tooling-log": ["packages/kbn-tooling-log"], + "@kbn/tooling-log/*": ["packages/kbn-tooling-log/*"], + "@kbn/type-summarizer": ["packages/kbn-type-summarizer"], + "@kbn/type-summarizer/*": ["packages/kbn-type-summarizer/*"], + "@kbn/type-summarizer-cli": ["packages/kbn-type-summarizer-cli"], + "@kbn/type-summarizer-cli/*": ["packages/kbn-type-summarizer-cli/*"], + "@kbn/type-summarizer-core": ["packages/kbn-type-summarizer-core"], + "@kbn/type-summarizer-core/*": ["packages/kbn-type-summarizer-core/*"], + "@kbn/typed-react-router-config": ["packages/kbn-typed-react-router-config"], + "@kbn/typed-react-router-config/*": ["packages/kbn-typed-react-router-config/*"], + "@kbn/ui-framework": ["packages/kbn-ui-framework"], + "@kbn/ui-framework/*": ["packages/kbn-ui-framework/*"], + "@kbn/ui-shared-deps-npm": ["packages/kbn-ui-shared-deps-npm"], + "@kbn/ui-shared-deps-npm/*": ["packages/kbn-ui-shared-deps-npm/*"], + "@kbn/ui-shared-deps-src": ["packages/kbn-ui-shared-deps-src"], + "@kbn/ui-shared-deps-src/*": ["packages/kbn-ui-shared-deps-src/*"], + "@kbn/ui-theme": ["packages/kbn-ui-theme"], + "@kbn/ui-theme/*": ["packages/kbn-ui-theme/*"], + "@kbn/user-profile-components": ["packages/kbn-user-profile-components"], + "@kbn/user-profile-components/*": ["packages/kbn-user-profile-components/*"], + "@kbn/utility-types": ["packages/kbn-utility-types"], + "@kbn/utility-types/*": ["packages/kbn-utility-types/*"], + "@kbn/utility-types-jest": ["packages/kbn-utility-types-jest"], + "@kbn/utility-types-jest/*": ["packages/kbn-utility-types-jest/*"], + "@kbn/utils": ["packages/kbn-utils"], + "@kbn/utils/*": ["packages/kbn-utils/*"], + "@kbn/yarn-lock-validator": ["packages/kbn-yarn-lock-validator"], + "@kbn/yarn-lock-validator/*": ["packages/kbn-yarn-lock-validator/*"], + "@kbn/shared-ux-avatar-solution": ["packages/shared-ux/avatar/solution"], + "@kbn/shared-ux-avatar-solution/*": ["packages/shared-ux/avatar/solution/*"], + "@kbn/shared-ux-avatar-user-profile-components": ["packages/shared-ux/avatar/user_profile/impl"], + "@kbn/shared-ux-avatar-user-profile-components/*": ["packages/shared-ux/avatar/user_profile/impl/*"], + "@kbn/shared-ux-button-toolbar": ["packages/shared-ux/button_toolbar"], + "@kbn/shared-ux-button-toolbar/*": ["packages/shared-ux/button_toolbar/*"], + "@kbn/shared-ux-button-exit-full-screen": ["packages/shared-ux/button/exit_full_screen/impl"], + "@kbn/shared-ux-button-exit-full-screen/*": ["packages/shared-ux/button/exit_full_screen/impl/*"], + "@kbn/shared-ux-button-exit-full-screen-mocks": ["packages/shared-ux/button/exit_full_screen/mocks"], + "@kbn/shared-ux-button-exit-full-screen-mocks/*": ["packages/shared-ux/button/exit_full_screen/mocks/*"], + "@kbn/shared-ux-button-exit-full-screen-types": ["packages/shared-ux/button/exit_full_screen/types"], + "@kbn/shared-ux-button-exit-full-screen-types/*": ["packages/shared-ux/button/exit_full_screen/types/*"], + "@kbn/shared-ux-card-no-data": ["packages/shared-ux/card/no_data/impl"], + "@kbn/shared-ux-card-no-data/*": ["packages/shared-ux/card/no_data/impl/*"], + "@kbn/shared-ux-card-no-data-mocks": ["packages/shared-ux/card/no_data/mocks"], + "@kbn/shared-ux-card-no-data-mocks/*": ["packages/shared-ux/card/no_data/mocks/*"], + "@kbn/shared-ux-card-no-data-types": ["packages/shared-ux/card/no_data/types"], + "@kbn/shared-ux-card-no-data-types/*": ["packages/shared-ux/card/no_data/types/*"], + "@kbn/shared-ux-link-redirect-app": ["packages/shared-ux/link/redirect_app/impl"], + "@kbn/shared-ux-link-redirect-app/*": ["packages/shared-ux/link/redirect_app/impl/*"], + "@kbn/shared-ux-link-redirect-app-mocks": ["packages/shared-ux/link/redirect_app/mocks"], + "@kbn/shared-ux-link-redirect-app-mocks/*": ["packages/shared-ux/link/redirect_app/mocks/*"], + "@kbn/shared-ux-link-redirect-app-types": ["packages/shared-ux/link/redirect_app/types"], + "@kbn/shared-ux-link-redirect-app-types/*": ["packages/shared-ux/link/redirect_app/types/*"], + "@kbn/shared-ux-markdown": ["packages/shared-ux/markdown/impl"], + "@kbn/shared-ux-markdown/*": ["packages/shared-ux/markdown/impl/*"], + "@kbn/shared-ux-markdown-mocks": ["packages/shared-ux/markdown/mocks"], + "@kbn/shared-ux-markdown-mocks/*": ["packages/shared-ux/markdown/mocks/*"], + "@kbn/shared-ux-markdown-types": ["packages/shared-ux/markdown/types"], + "@kbn/shared-ux-markdown-types/*": ["packages/shared-ux/markdown/types/*"], + "@kbn/shared-ux-page-analytics-no-data": ["packages/shared-ux/page/analytics_no_data/impl"], + "@kbn/shared-ux-page-analytics-no-data/*": ["packages/shared-ux/page/analytics_no_data/impl/*"], + "@kbn/shared-ux-page-analytics-no-data-mocks": ["packages/shared-ux/page/analytics_no_data/mocks"], + "@kbn/shared-ux-page-analytics-no-data-mocks/*": ["packages/shared-ux/page/analytics_no_data/mocks/*"], + "@kbn/shared-ux-page-analytics-no-data-types": ["packages/shared-ux/page/analytics_no_data/types"], + "@kbn/shared-ux-page-analytics-no-data-types/*": ["packages/shared-ux/page/analytics_no_data/types/*"], + "@kbn/shared-ux-page-kibana-no-data": ["packages/shared-ux/page/kibana_no_data/impl"], + "@kbn/shared-ux-page-kibana-no-data/*": ["packages/shared-ux/page/kibana_no_data/impl/*"], + "@kbn/shared-ux-page-kibana-no-data-mocks": ["packages/shared-ux/page/kibana_no_data/mocks"], + "@kbn/shared-ux-page-kibana-no-data-mocks/*": ["packages/shared-ux/page/kibana_no_data/mocks/*"], + "@kbn/shared-ux-page-kibana-no-data-types": ["packages/shared-ux/page/kibana_no_data/types"], + "@kbn/shared-ux-page-kibana-no-data-types/*": ["packages/shared-ux/page/kibana_no_data/types/*"], + "@kbn/shared-ux-page-kibana-template": ["packages/shared-ux/page/kibana_template/impl"], + "@kbn/shared-ux-page-kibana-template/*": ["packages/shared-ux/page/kibana_template/impl/*"], + "@kbn/shared-ux-page-kibana-template-mocks": ["packages/shared-ux/page/kibana_template/mocks"], + "@kbn/shared-ux-page-kibana-template-mocks/*": ["packages/shared-ux/page/kibana_template/mocks/*"], + "@kbn/shared-ux-page-kibana-template-types": ["packages/shared-ux/page/kibana_template/types"], + "@kbn/shared-ux-page-kibana-template-types/*": ["packages/shared-ux/page/kibana_template/types/*"], + "@kbn/shared-ux-page-no-data-config": ["packages/shared-ux/page/no_data_config/impl"], + "@kbn/shared-ux-page-no-data-config/*": ["packages/shared-ux/page/no_data_config/impl/*"], + "@kbn/shared-ux-page-no-data-config-mocks": ["packages/shared-ux/page/no_data_config/mocks"], + "@kbn/shared-ux-page-no-data-config-mocks/*": ["packages/shared-ux/page/no_data_config/mocks/*"], + "@kbn/shared-ux-page-no-data-config-types": ["packages/shared-ux/page/no_data_config/types"], + "@kbn/shared-ux-page-no-data-config-types/*": ["packages/shared-ux/page/no_data_config/types/*"], + "@kbn/shared-ux-page-no-data": ["packages/shared-ux/page/no_data/impl"], + "@kbn/shared-ux-page-no-data/*": ["packages/shared-ux/page/no_data/impl/*"], + "@kbn/shared-ux-page-no-data-mocks": ["packages/shared-ux/page/no_data/mocks"], + "@kbn/shared-ux-page-no-data-mocks/*": ["packages/shared-ux/page/no_data/mocks/*"], + "@kbn/shared-ux-page-no-data-types": ["packages/shared-ux/page/no_data/types"], + "@kbn/shared-ux-page-no-data-types/*": ["packages/shared-ux/page/no_data/types/*"], + "@kbn/shared-ux-page-solution-nav": ["packages/shared-ux/page/solution_nav"], + "@kbn/shared-ux-page-solution-nav/*": ["packages/shared-ux/page/solution_nav/*"], + "@kbn/shared-ux-prompt-no-data-views": ["packages/shared-ux/prompt/no_data_views/impl"], + "@kbn/shared-ux-prompt-no-data-views/*": ["packages/shared-ux/prompt/no_data_views/impl/*"], + "@kbn/shared-ux-prompt-no-data-views-mocks": ["packages/shared-ux/prompt/no_data_views/mocks"], + "@kbn/shared-ux-prompt-no-data-views-mocks/*": ["packages/shared-ux/prompt/no_data_views/mocks/*"], + "@kbn/shared-ux-prompt-no-data-views-types": ["packages/shared-ux/prompt/no_data_views/types"], + "@kbn/shared-ux-prompt-no-data-views-types/*": ["packages/shared-ux/prompt/no_data_views/types/*"], + "@kbn/shared-ux-router": ["packages/shared-ux/router/impl"], + "@kbn/shared-ux-router/*": ["packages/shared-ux/router/impl/*"], + "@kbn/shared-ux-router-mocks": ["packages/shared-ux/router/mocks"], + "@kbn/shared-ux-router-mocks/*": ["packages/shared-ux/router/mocks/*"], + "@kbn/shared-ux-router-types": ["packages/shared-ux/router/types"], + "@kbn/shared-ux-router-types/*": ["packages/shared-ux/router/types/*"], + "@kbn/shared-ux-storybook-config": ["packages/shared-ux/storybook/config"], + "@kbn/shared-ux-storybook-config/*": ["packages/shared-ux/storybook/config/*"], + "@kbn/shared-ux-storybook-mock": ["packages/shared-ux/storybook/mock"], + "@kbn/shared-ux-storybook-mock/*": ["packages/shared-ux/storybook/mock/*"], + "@kbn/ml-agg-utils": ["x-pack/packages/ml/agg_utils"], + "@kbn/ml-agg-utils/*": ["x-pack/packages/ml/agg_utils/*"], + "@kbn/aiops-components": ["x-pack/packages/ml/aiops_components"], + "@kbn/aiops-components/*": ["x-pack/packages/ml/aiops_components/*"], + "@kbn/aiops-utils": ["x-pack/packages/ml/aiops_utils"], + "@kbn/aiops-utils/*": ["x-pack/packages/ml/aiops_utils/*"], + "@kbn/ml-is-populated-object": ["x-pack/packages/ml/is_populated_object"], + "@kbn/ml-is-populated-object/*": ["x-pack/packages/ml/is_populated_object/*"], + "@kbn/ml-string-hash": ["x-pack/packages/ml/string_hash"], + "@kbn/ml-string-hash/*": ["x-pack/packages/ml/string_hash/*"], "@kbn/bfetch-explorer-plugin": ["examples/bfetch_explorer"], "@kbn/bfetch-explorer-plugin/*": ["examples/bfetch_explorer/*"], "@kbn/dashboard-embeddable-examples-plugin": ["examples/dashboard_embeddable_examples"], @@ -21,6 +726,8 @@ "@kbn/expressions-explorer-plugin/*": ["examples/expressions_explorer/*"], "@kbn/field-formats-example-plugin": ["examples/field_formats_example"], "@kbn/field-formats-example-plugin/*": ["examples/field_formats_example/*"], + "@kbn/files-example-plugin": ["examples/files_example"], + "@kbn/files-example-plugin/*": ["examples/files_example/*"], "@kbn/guided-onboarding-example-plugin": ["examples/guided_onboarding_example"], "@kbn/guided-onboarding-example-plugin/*": ["examples/guided_onboarding_example/*"], "@kbn/hello-world-plugin": ["examples/hello_world"], @@ -115,6 +822,8 @@ "@kbn/expressions-plugin/*": ["src/plugins/expressions/*"], "@kbn/field-formats-plugin": ["src/plugins/field_formats"], "@kbn/field-formats-plugin/*": ["src/plugins/field_formats/*"], + "@kbn/files-plugin": ["src/plugins/files"], + "@kbn/files-plugin/*": ["src/plugins/files/*"], "@kbn/guided-onboarding-plugin": ["src/plugins/guided_onboarding"], "@kbn/guided-onboarding-plugin/*": ["src/plugins/guided_onboarding/*"], "@kbn/home-plugin": ["src/plugins/home"], @@ -277,14 +986,16 @@ "@kbn/ui-settings-plugin/*": ["test/plugin_functional/plugins/ui_settings_plugin/*"], "@kbn/usage-collection-test-plugin": ["test/plugin_functional/plugins/usage_collection"], "@kbn/usage-collection-test-plugin/*": ["test/plugin_functional/plugins/usage_collection/*"], + "@kbn/status-plugin-a-plugin": ["test/server_integration/__fixtures__/plugins/status_plugin_a"], + "@kbn/status-plugin-a-plugin/*": ["test/server_integration/__fixtures__/plugins/status_plugin_a/*"], + "@kbn/status-plugin-b-plugin": ["test/server_integration/__fixtures__/plugins/status_plugin_b"], + "@kbn/status-plugin-b-plugin/*": ["test/server_integration/__fixtures__/plugins/status_plugin_b/*"], "@kbn/alerting-example-plugin": ["x-pack/examples/alerting_example"], "@kbn/alerting-example-plugin/*": ["x-pack/examples/alerting_example/*"], "@kbn/embedded-lens-example-plugin": ["x-pack/examples/embedded_lens_example"], "@kbn/embedded-lens-example-plugin/*": ["x-pack/examples/embedded_lens_example/*"], "@kbn/exploratory-view-example-plugin": ["x-pack/examples/exploratory_view_example"], "@kbn/exploratory-view-example-plugin/*": ["x-pack/examples/exploratory_view_example/*"], - "@kbn/files-example-plugin": ["x-pack/examples/files_example"], - "@kbn/files-example-plugin/*": ["x-pack/examples/files_example/*"], "@kbn/reporting-example-plugin": ["x-pack/examples/reporting_example"], "@kbn/reporting-example-plugin/*": ["x-pack/examples/reporting_example/*"], "@kbn/screenshotting-example-plugin": ["x-pack/examples/screenshotting_example"], @@ -351,8 +1062,6 @@ "@kbn/features-plugin/*": ["x-pack/plugins/features/*"], "@kbn/file-upload-plugin": ["x-pack/plugins/file_upload"], "@kbn/file-upload-plugin/*": ["x-pack/plugins/file_upload/*"], - "@kbn/files-plugin": ["x-pack/plugins/files"], - "@kbn/files-plugin/*": ["x-pack/plugins/files/*"], "@kbn/fleet-plugin": ["x-pack/plugins/fleet"], "@kbn/fleet-plugin/*": ["x-pack/plugins/fleet/*"], "@kbn/global-search-bar-plugin": ["x-pack/plugins/global_search_bar"], @@ -395,6 +1104,8 @@ "@kbn/monitoring-collection-plugin/*": ["x-pack/plugins/monitoring_collection/*"], "@kbn/monitoring-plugin": ["x-pack/plugins/monitoring"], "@kbn/monitoring-plugin/*": ["x-pack/plugins/monitoring/*"], + "@kbn/notifications-plugin": ["x-pack/plugins/notifications"], + "@kbn/notifications-plugin/*": ["x-pack/plugins/notifications/*"], "@kbn/observability-plugin": ["x-pack/plugins/observability"], "@kbn/observability-plugin/*": ["x-pack/plugins/observability/*"], "@kbn/osquery-plugin": ["x-pack/plugins/osquery"], @@ -492,10 +1203,10 @@ "strict": true, // for now, don't use unknown in catch "useUnknownInCatchVariables": false, - // All TS projects should be composite and only include the files they select, and ref the files outside of the project - "composite": true, - // save information about the project graph on disk - "incremental": true, + // disabled for better IDE support, enabled when running the type_check script + "composite": false, + // disabled for better IDE support, enabled when running the type_check script + "incremental": false, // Do not check d.ts files by default "skipLibCheck": true, // enables "core language features" @@ -515,6 +1226,11 @@ // We have to enable this option explicitly since `esModuleInterop` doesn't enable it automatically when ES2015 or // ESNext module format is used. "allowSyntheticDefaultImports": true, + // Several packages use .js files to provide types without requiring transpilation. In order for TS to support this + // regardless of where the pacakge is imported, we need to enable `allowJs` globally. In specific packages we might + // want to disable parsing of JS files, in which case `allowJs` should be set to `false` locally. These packages will + // not be able to import packages which include JS code, or import packages which depend on JS code. + "allowJs": true, // Emits __importStar and __importDefault helpers for runtime babel ecosystem compatibility. "esModuleInterop": true, // Resolve modules in the same way as Node.js. Aka make `require` works the diff --git a/tsconfig.json b/tsconfig.json index ba72ca7a3a856..a03576565d124 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,21 +5,9 @@ }, "include": [ "kibana.d.ts", - "typings/**/*", - - "src/cli/**/*", - "src/cli_setup/**/*", - "src/cli_plugin/**/*", - "src/dev/**/*", - "src/fixtures/**/*", - - "x-pack/tasks/**/*", + "package.json", ], - "exclude": [], - "references": [ + "kbn_references": [ { "path": "./src/core/tsconfig.json" }, - { "path": "./src/plugins/usage_collection/tsconfig.json" }, - { "path": "./src/plugins/interactive_setup/tsconfig.json" }, - { "path": "./x-pack/plugins/reporting/tsconfig.json" }, ] } diff --git a/tsconfig.types.json b/tsconfig.types.json deleted file mode 100644 index 470745f52d5c3..0000000000000 --- a/tsconfig.types.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "composite": false, - "outDir": "./target/types", - "stripInternal": false, - "declaration": true, - "declarationMap": true, - "emitDeclarationOnly": true, - "declarationMap": true, - "rootDir": "./src" - }, - "include": [ - "src/core/server/index.ts", - "src/core/public/index.ts", - "typings" - ] -} diff --git a/vars/workers.groovy b/vars/workers.groovy index d95c3fdbb1b44..ea67ce415738f 100644 --- a/vars/workers.groovy +++ b/vars/workers.groovy @@ -108,7 +108,6 @@ def base(Map params, Closure closure) { "GIT_COMMIT=${checkoutInfo.commit}", "GIT_BRANCH=${checkoutInfo.branch}", "TMPDIR=${env.WORKSPACE}/tmp", // For Chrome and anything else that respects it - "BUILD_TS_REFS_DISABLE=true", // no need to build ts refs in bootstrap ]) { withCredentials([ string(credentialsId: 'vault-addr', variable: 'VAULT_ADDR'), diff --git a/versions.json b/versions.json index 30514180e5c1e..36212abba6dec 100644 --- a/versions.json +++ b/versions.json @@ -8,19 +8,13 @@ "currentMinor": true }, { - "version": "8.5.0", + "version": "8.5.1", "branch": "8.5", "currentMajor": true, "previousMinor": true }, { - "version": "8.4.4", - "branch": "8.4", - "currentMajor": true, - "previousMinor": true - }, - { - "version": "7.17.7", + "version": "7.17.8", "branch": "7.17", "previousMajor": true } diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 4f89798c71faf..c67fbd2cdabf0 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -20,7 +20,6 @@ "xpack.endpoint": "plugins/endpoint", "xpack.enterpriseSearch": "plugins/enterprise_search", "xpack.features": "plugins/features", - "xpack.files": "plugins/files", "xpack.dataVisualizer": "plugins/data_visualizer", "xpack.fileUpload": "plugins/file_upload", "xpack.globalSearch": ["plugins/global_search"], diff --git a/x-pack/examples/alerting_example/tsconfig.json b/x-pack/examples/alerting_example/tsconfig.json index 881c48029031d..024d7304ffad0 100644 --- a/x-pack/examples/alerting_example/tsconfig.json +++ b/x-pack/examples/alerting_example/tsconfig.json @@ -12,7 +12,7 @@ "../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/charts/tsconfig.json" }, diff --git a/x-pack/examples/embedded_lens_example/kibana.json b/x-pack/examples/embedded_lens_example/kibana.json index dc979e21aeff5..735118211647d 100644 --- a/x-pack/examples/embedded_lens_example/kibana.json +++ b/x-pack/examples/embedded_lens_example/kibana.json @@ -15,6 +15,6 @@ "requiredBundles": [], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" } } diff --git a/x-pack/examples/embedded_lens_example/tsconfig.json b/x-pack/examples/embedded_lens_example/tsconfig.json index e1016a6c011a1..d5689e03aeb6d 100644 --- a/x-pack/examples/embedded_lens_example/tsconfig.json +++ b/x-pack/examples/embedded_lens_example/tsconfig.json @@ -11,7 +11,7 @@ "../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, diff --git a/x-pack/examples/exploratory_view_example/tsconfig.json b/x-pack/examples/exploratory_view_example/tsconfig.json index ef464f3815e28..795beb43c563f 100644 --- a/x-pack/examples/exploratory_view_example/tsconfig.json +++ b/x-pack/examples/exploratory_view_example/tsconfig.json @@ -11,7 +11,7 @@ "../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, diff --git a/x-pack/examples/files_example/common/index.ts b/x-pack/examples/files_example/common/index.ts deleted file mode 100644 index aeb807e30aadf..0000000000000 --- a/x-pack/examples/files_example/common/index.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 type { FileKind, FileImageMetadata } from '@kbn/files-plugin/common'; - -export const PLUGIN_ID = 'filesExample'; -export const PLUGIN_NAME = 'Files example'; - -const httpTags = { - tags: [`access:${PLUGIN_ID}`], -}; - -export const exampleFileKind: FileKind = { - id: PLUGIN_ID, - allowedMimeTypes: ['image/png'], - http: { - create: httpTags, - delete: httpTags, - download: httpTags, - getById: httpTags, - list: httpTags, - share: httpTags, - update: httpTags, - }, -}; - -export type MyImageMetadata = FileImageMetadata; diff --git a/x-pack/examples/files_example/public/components/file_picker.tsx b/x-pack/examples/files_example/public/components/file_picker.tsx deleted file mode 100644 index 2bf5530655ba3..0000000000000 --- a/x-pack/examples/files_example/public/components/file_picker.tsx +++ /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 React from 'react'; -import type { FunctionComponent } from 'react'; - -import { exampleFileKind } from '../../common'; - -import { FilePicker } from '../imports'; - -interface Props { - onClose: () => void; - onDone: (ids: string[]) => void; -} - -export const MyFilePicker: FunctionComponent<Props> = ({ onClose, onDone }) => { - return <FilePicker kind={exampleFileKind.id} onClose={onClose} onDone={onDone} />; -}; diff --git a/x-pack/examples/files_example/public/imports.ts b/x-pack/examples/files_example/public/imports.ts deleted file mode 100644 index a60d9cb4a6a36..0000000000000 --- a/x-pack/examples/files_example/public/imports.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { - FilesClient, - FilesSetup, - FilesStart, - UploadFile, - FilesContext, - ScopedFilesClient, - FilePicker, - Image, -} from '@kbn/files-plugin/public'; - -export type { DeveloperExamplesSetup } from '@kbn/developer-examples-plugin/public'; diff --git a/x-pack/examples/files_example/public/index.ts b/x-pack/examples/files_example/public/index.ts deleted file mode 100644 index 15e472c4f4cc6..0000000000000 --- a/x-pack/examples/files_example/public/index.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 { FilesExamplePlugin } from './plugin'; - -// This exports static code and TypeScript types, -// as well as, Kibana Platform `plugin()` initializer. -export function plugin() { - return new FilesExamplePlugin(); -} diff --git a/x-pack/examples/files_example/public/plugin.ts b/x-pack/examples/files_example/public/plugin.ts deleted file mode 100644 index 4906b59d4d6fc..0000000000000 --- a/x-pack/examples/files_example/public/plugin.ts +++ /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 { AppNavLinkStatus } from '@kbn/core-application-browser'; -import { AppMountParameters, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import { PLUGIN_ID, PLUGIN_NAME, exampleFileKind, MyImageMetadata } from '../common'; -import { FilesExamplePluginsStart, FilesExamplePluginsSetup } from './types'; - -export class FilesExamplePlugin - implements Plugin<unknown, unknown, FilesExamplePluginsSetup, FilesExamplePluginsStart> -{ - public setup( - core: CoreSetup<FilesExamplePluginsStart>, - { files, developerExamples }: FilesExamplePluginsSetup - ) { - files.registerFileKind(exampleFileKind); - - developerExamples.register({ - appId: PLUGIN_ID, - title: PLUGIN_NAME, - description: 'Example plugin for the files plugin', - }); - - core.application.register({ - id: PLUGIN_ID, - title: PLUGIN_NAME, - navLinkStatus: AppNavLinkStatus.hidden, - async mount(params: AppMountParameters) { - // Load application bundle - const { renderApp } = await import('./application'); - // Get start services as specified in kibana.json - const [coreStart, deps] = await core.getStartServices(); - // Render the application - return renderApp( - coreStart, - { - files: { - unscoped: deps.files.filesClientFactory.asUnscoped<MyImageMetadata>(), - example: deps.files.filesClientFactory.asScoped<MyImageMetadata>(exampleFileKind.id), - }, - }, - params - ); - }, - }); - - // Return methods that should be available to other plugins - return {}; - } - - public start(core: CoreStart) { - return {}; - } - - public stop() {} -} diff --git a/x-pack/examples/files_example/public/types.ts b/x-pack/examples/files_example/public/types.ts deleted file mode 100644 index 0ac384055aaf3..0000000000000 --- a/x-pack/examples/files_example/public/types.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 { MyImageMetadata } from '../common'; -import type { - FilesSetup, - FilesStart, - ScopedFilesClient, - FilesClient, - DeveloperExamplesSetup, -} from './imports'; - -export interface FilesExamplePluginsSetup { - files: FilesSetup; - developerExamples: DeveloperExamplesSetup; -} - -export interface FilesExamplePluginsStart { - files: FilesStart; -} - -export interface FileClients { - unscoped: FilesClient<MyImageMetadata>; - // Example file kind - example: ScopedFilesClient<MyImageMetadata>; -} - -export interface AppPluginStartDependencies { - files: FileClients; -} diff --git a/x-pack/examples/files_example/server/index.ts b/x-pack/examples/files_example/server/index.ts deleted file mode 100644 index 5b6de87308e5e..0000000000000 --- a/x-pack/examples/files_example/server/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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { PluginInitializerContext } from '@kbn/core/server'; -import { FilesExamplePlugin } from './plugin'; - -// This exports static code and TypeScript types, -// as well as, Kibana Platform `plugin()` initializer. - -export function plugin(initializerContext: PluginInitializerContext) { - return new FilesExamplePlugin(initializerContext); -} diff --git a/x-pack/examples/files_example/server/plugin.ts b/x-pack/examples/files_example/server/plugin.ts deleted file mode 100644 index 2b077d6f3e88a..0000000000000 --- a/x-pack/examples/files_example/server/plugin.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '@kbn/core/server'; -import { exampleFileKind } from '../common'; -import type { FilesExamplePluginsSetup, FilesExamplePluginsStart } from './types'; - -export class FilesExamplePlugin - implements Plugin<unknown, unknown, FilesExamplePluginsSetup, FilesExamplePluginsStart> -{ - private readonly logger: Logger; - - constructor(initializerContext: PluginInitializerContext) { - this.logger = initializerContext.logger.get(); - } - - public setup(core: CoreSetup, { files }: FilesExamplePluginsSetup) { - this.logger.debug('filesExample: Setup'); - - files.registerFileKind(exampleFileKind); - - return {}; - } - - public start(core: CoreStart) { - this.logger.debug('filesExample: Started'); - return {}; - } - - public stop() {} -} diff --git a/x-pack/examples/files_example/server/types.ts b/x-pack/examples/files_example/server/types.ts deleted file mode 100644 index b1cef58620ca5..0000000000000 --- a/x-pack/examples/files_example/server/types.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 type { FilesSetup, FilesStart } from '@kbn/files-plugin/server'; - -export interface FilesExamplePluginsSetup { - files: FilesSetup; -} - -export interface FilesExamplePluginsStart { - files: FilesStart; -} diff --git a/x-pack/examples/files_example/tsconfig.json b/x-pack/examples/files_example/tsconfig.json deleted file mode 100644 index e75078a80019c..0000000000000 --- a/x-pack/examples/files_example/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types" - }, - "include": [ - "index.ts", - "common/**/*", - "public/**/*", - "server/**/*", - "public/**/*.ts", - "public/**/*.tsx", - "server/**/*.ts", - "../../../typings/**/*" - ], - "exclude": [], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../plugins/files/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" } - ] -} diff --git a/x-pack/examples/reporting_example/tsconfig.json b/x-pack/examples/reporting_example/tsconfig.json index 1b097d8e52868..4d20a411bd068 100644 --- a/x-pack/examples/reporting_example/tsconfig.json +++ b/x-pack/examples/reporting_example/tsconfig.json @@ -12,7 +12,7 @@ "../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/navigation/tsconfig.json" }, diff --git a/x-pack/examples/screenshotting_example/server/plugin.ts b/x-pack/examples/screenshotting_example/server/plugin.ts index 9ca74c6e16353..16a766558ff3f 100644 --- a/x-pack/examples/screenshotting_example/server/plugin.ts +++ b/x-pack/examples/screenshotting_example/server/plugin.ts @@ -38,6 +38,7 @@ export class ScreenshottingExamplePlugin implements Plugin<void, void> { ); return response.ok({ + headers: { 'content-type': 'application/json' }, body: JSON.stringify({ metrics, image: results[0]?.screenshots[0]?.data.toString('base64'), diff --git a/x-pack/examples/screenshotting_example/tsconfig.json b/x-pack/examples/screenshotting_example/tsconfig.json index b28f046f7b94b..cf117533adc8c 100644 --- a/x-pack/examples/screenshotting_example/tsconfig.json +++ b/x-pack/examples/screenshotting_example/tsconfig.json @@ -12,7 +12,7 @@ "../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/navigation/tsconfig.json" }, diff --git a/x-pack/examples/testing_embedded_lens/kibana.json b/x-pack/examples/testing_embedded_lens/kibana.json index febfc95bcecc2..2d4250165a159 100644 --- a/x-pack/examples/testing_embedded_lens/kibana.json +++ b/x-pack/examples/testing_embedded_lens/kibana.json @@ -16,6 +16,6 @@ "requiredBundles": [], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" } } diff --git a/x-pack/examples/testing_embedded_lens/tsconfig.json b/x-pack/examples/testing_embedded_lens/tsconfig.json index e1016a6c011a1..d5689e03aeb6d 100644 --- a/x-pack/examples/testing_embedded_lens/tsconfig.json +++ b/x-pack/examples/testing_embedded_lens/tsconfig.json @@ -11,7 +11,7 @@ "../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, diff --git a/x-pack/examples/third_party_lens_navigation_prompt/kibana.json b/x-pack/examples/third_party_lens_navigation_prompt/kibana.json index 81af0557a92c6..76618ca62bfe1 100644 --- a/x-pack/examples/third_party_lens_navigation_prompt/kibana.json +++ b/x-pack/examples/third_party_lens_navigation_prompt/kibana.json @@ -17,6 +17,6 @@ ], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" } } diff --git a/x-pack/examples/third_party_lens_navigation_prompt/tsconfig.json b/x-pack/examples/third_party_lens_navigation_prompt/tsconfig.json index d1f0f1f152e96..2fe95c9cd4833 100644 --- a/x-pack/examples/third_party_lens_navigation_prompt/tsconfig.json +++ b/x-pack/examples/third_party_lens_navigation_prompt/tsconfig.json @@ -9,7 +9,7 @@ "../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/expressions/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, diff --git a/x-pack/examples/third_party_maps_source_example/public/classes/custom_raster_source.tsx b/x-pack/examples/third_party_maps_source_example/public/classes/custom_raster_source.tsx index d36ed2485b5ba..3720235173751 100644 --- a/x-pack/examples/third_party_maps_source_example/public/classes/custom_raster_source.tsx +++ b/x-pack/examples/third_party_maps_source_example/public/classes/custom_raster_source.tsx @@ -6,7 +6,7 @@ */ import _ from 'lodash'; -import { ReactElement } from 'react'; +import React, { ReactElement } from 'react'; import { calculateBounds } from '@kbn/data-plugin/common'; import { FieldFormatter, MIN_ZOOM, MAX_ZOOM } from '@kbn/maps-plugin/common'; import type { @@ -42,7 +42,13 @@ export class CustomRasterSource implements IRasterSource { constructor(sourceDescriptor: CustomRasterSourceDescriptor) { this._descriptor = sourceDescriptor; } + async hasLegendDetails(): Promise<boolean> { + return true; + } + renderLegendDetails(): ReactElement<any> | null { + return <img alt="Radar legend" src="https://nowcoast.noaa.gov/images/legends/radar.png" />; + } async canSkipSourceUpdate( dataRequest: DataRequest, nextRequestMeta: DataRequestMeta diff --git a/x-pack/examples/third_party_maps_source_example/tsconfig.json b/x-pack/examples/third_party_maps_source_example/tsconfig.json index 1d8ff2f14e329..988c6c54a2d29 100644 --- a/x-pack/examples/third_party_maps_source_example/tsconfig.json +++ b/x-pack/examples/third_party_maps_source_example/tsconfig.json @@ -9,7 +9,7 @@ "common/**/*.ts", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../plugins/maps/tsconfig.json"}, { "path": "../../../examples/developer_examples/tsconfig.json" }, diff --git a/x-pack/examples/third_party_vis_lens_example/kibana.json b/x-pack/examples/third_party_vis_lens_example/kibana.json index 858466f7f7640..9a00bf0750c6e 100644 --- a/x-pack/examples/third_party_vis_lens_example/kibana.json +++ b/x-pack/examples/third_party_vis_lens_example/kibana.json @@ -19,6 +19,6 @@ ], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" } } diff --git a/x-pack/examples/third_party_vis_lens_example/tsconfig.json b/x-pack/examples/third_party_vis_lens_example/tsconfig.json index d9d1af39a2b98..bb145ebd30065 100644 --- a/x-pack/examples/third_party_vis_lens_example/tsconfig.json +++ b/x-pack/examples/third_party_vis_lens_example/tsconfig.json @@ -11,7 +11,7 @@ "../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/expressions/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, diff --git a/x-pack/examples/triggers_actions_ui_example/tsconfig.json b/x-pack/examples/triggers_actions_ui_example/tsconfig.json index f9a5d7110d7ce..d28a560f8ba88 100644 --- a/x-pack/examples/triggers_actions_ui_example/tsconfig.json +++ b/x-pack/examples/triggers_actions_ui_example/tsconfig.json @@ -11,7 +11,7 @@ "../../../typings/**/*", ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../plugins/alerting/tsconfig.json" }, diff --git a/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json b/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json index 0df8dda165f0d..8b87cc628e771 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json +++ b/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json @@ -11,7 +11,7 @@ "../../../typings/**/*" ], "exclude": [], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, diff --git a/x-pack/packages/ml/agg_utils/BUILD.bazel b/x-pack/packages/ml/agg_utils/BUILD.bazel index 8841369749200..ef8d59c000f01 100644 --- a/x-pack/packages/ml/agg_utils/BUILD.bazel +++ b/x-pack/packages/ml/agg_utils/BUILD.bazel @@ -95,7 +95,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -109,6 +108,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -120,17 +127,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/x-pack/packages/ml/agg_utils/index.ts b/x-pack/packages/ml/agg_utils/index.ts index cc7a426f94050..444a59cbf0dc4 100644 --- a/x-pack/packages/ml/agg_utils/index.ts +++ b/x-pack/packages/ml/agg_utils/index.ts @@ -11,7 +11,11 @@ export { fetchHistogramsForFields } from './src/fetch_histograms_for_fields'; export { getSamplerAggregationsResponsePath } from './src/get_sampler_aggregations_response_path'; export { numberValidator } from './src/validate_number'; -export type { FieldsForHistograms } from './src/fetch_histograms_for_fields'; +export type { + FieldsForHistograms, + NumericChartData, + NumericHistogramField, +} from './src/fetch_histograms_for_fields'; export type { AggCardinality, ChangePoint, @@ -22,5 +26,6 @@ export type { HistogramField, NumericColumnStats, NumericColumnStatsMap, + FieldValuePair, } from './src/types'; export type { NumberValidationResult } from './src/validate_number'; diff --git a/x-pack/packages/ml/agg_utils/package.json b/x-pack/packages/ml/agg_utils/package.json index c7e49c11207b2..671b3c479e480 100644 --- a/x-pack/packages/ml/agg_utils/package.json +++ b/x-pack/packages/ml/agg_utils/package.json @@ -6,5 +6,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts b/x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts index 338f55ad754c2..7986747d34dd3 100644 --- a/x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts +++ b/x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts @@ -29,7 +29,8 @@ export const fetchAggIntervals = async ( query: estypes.QueryDslQueryContainer, fields: HistogramField[], samplerShardSize: number, - runtimeMappings?: estypes.MappingRuntimeFields + runtimeMappings?: estypes.MappingRuntimeFields, + abortSignal?: AbortSignal ): Promise<NumericColumnStatsMap> => { const numericColumns = fields.filter((field) => { return field.type === KBN_FIELD_TYPES.NUMBER || field.type === KBN_FIELD_TYPES.DATE; @@ -49,16 +50,19 @@ export const fetchAggIntervals = async ( return aggs; }, {} as Record<string, object>); - const body = await client.search({ - index: indexPattern, - size: 0, - body: { - query, - aggs: buildSamplerAggregation(minMaxAggs, samplerShardSize), + const body = await client.search( + { + index: indexPattern, size: 0, - ...(isPopulatedObject(runtimeMappings) ? { runtime_mappings: runtimeMappings } : {}), + body: { + query, + aggs: buildSamplerAggregation(minMaxAggs, samplerShardSize), + size: 0, + ...(isPopulatedObject(runtimeMappings) ? { runtime_mappings: runtimeMappings } : {}), + }, }, - }); + { signal: abortSignal, maxRetries: 0 } + ); const aggsPath = getSamplerAggregationsResponsePath(samplerShardSize); const aggregations = aggsPath.length > 0 ? get(body.aggregations, aggsPath) : body.aggregations; diff --git a/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts b/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts index a921eaeae370b..70d5f6360155d 100644 --- a/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts +++ b/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts @@ -146,7 +146,8 @@ export const fetchHistogramsForFields = async ( query: any, fields: FieldsForHistograms, samplerShardSize: number, - runtimeMappings?: estypes.MappingRuntimeFields + runtimeMappings?: estypes.MappingRuntimeFields, + abortSignal?: AbortSignal ) => { const aggIntervals = { ...(await fetchAggIntervals( @@ -155,7 +156,8 @@ export const fetchHistogramsForFields = async ( query, fields.filter((f) => !isNumericHistogramFieldWithColumnStats(f)), samplerShardSize, - runtimeMappings + runtimeMappings, + abortSignal )), ...fields.filter(isNumericHistogramFieldWithColumnStats).reduce((p, field) => { const { interval, min, max, fieldName } = field; @@ -209,7 +211,7 @@ export const fetchHistogramsForFields = async ( ...(isPopulatedObject(runtimeMappings) ? { runtime_mappings: runtimeMappings } : {}), }, }, - { maxRetries: 0 } + { signal: abortSignal, maxRetries: 0 } ); const aggsPath = getSamplerAggregationsResponsePath(samplerShardSize); diff --git a/x-pack/packages/ml/agg_utils/tsconfig.json b/x-pack/packages/ml/agg_utils/tsconfig.json index 8afcd182578e7..424a7c9d59623 100644 --- a/x-pack/packages/ml/agg_utils/tsconfig.json +++ b/x-pack/packages/ml/agg_utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "stripInternal": false, diff --git a/x-pack/packages/ml/aiops_components/BUILD.bazel b/x-pack/packages/ml/aiops_components/BUILD.bazel index 08b49643adc2f..b47a6a8b1acd4 100644 --- a/x-pack/packages/ml/aiops_components/BUILD.bazel +++ b/x-pack/packages/ml/aiops_components/BUILD.bazel @@ -131,6 +131,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -142,17 +150,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/x-pack/packages/ml/aiops_components/package.json b/x-pack/packages/ml/aiops_components/package.json index f3cb901271998..e3fd69c7c8e11 100644 --- a/x-pack/packages/ml/aiops_components/package.json +++ b/x-pack/packages/ml/aiops_components/package.json @@ -7,5 +7,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/x-pack/packages/ml/aiops_utils/BUILD.bazel b/x-pack/packages/ml/aiops_utils/BUILD.bazel index 0e8edc688c617..b5a8daddebd9a 100644 --- a/x-pack/packages/ml/aiops_utils/BUILD.bazel +++ b/x-pack/packages/ml/aiops_utils/BUILD.bazel @@ -96,7 +96,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -110,6 +109,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -121,17 +128,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/x-pack/packages/ml/aiops_utils/package.json b/x-pack/packages/ml/aiops_utils/package.json index 395e8e4b8a168..d1b7bba50061b 100644 --- a/x-pack/packages/ml/aiops_utils/package.json +++ b/x-pack/packages/ml/aiops_utils/package.json @@ -7,5 +7,6 @@ "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/x-pack/packages/ml/aiops_utils/tsconfig.json b/x-pack/packages/ml/aiops_utils/tsconfig.json index 9f2708fb14528..4eb9855fa759d 100644 --- a/x-pack/packages/ml/aiops_utils/tsconfig.json +++ b/x-pack/packages/ml/aiops_utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "stripInternal": false, diff --git a/x-pack/packages/ml/is_populated_object/BUILD.bazel b/x-pack/packages/ml/is_populated_object/BUILD.bazel index 94906ecec9f56..00c2677acc693 100644 --- a/x-pack/packages/ml/is_populated_object/BUILD.bazel +++ b/x-pack/packages/ml/is_populated_object/BUILD.bazel @@ -83,7 +83,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -97,6 +96,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -108,17 +115,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/x-pack/packages/ml/is_populated_object/package.json b/x-pack/packages/ml/is_populated_object/package.json index ec81756845881..f5bdff98a7207 100644 --- a/x-pack/packages/ml/is_populated_object/package.json +++ b/x-pack/packages/ml/is_populated_object/package.json @@ -6,5 +6,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/x-pack/packages/ml/is_populated_object/tsconfig.json b/x-pack/packages/ml/is_populated_object/tsconfig.json index 49e920b0a461a..af8fdef592c43 100644 --- a/x-pack/packages/ml/is_populated_object/tsconfig.json +++ b/x-pack/packages/ml/is_populated_object/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "stripInternal": false, diff --git a/x-pack/packages/ml/string_hash/BUILD.bazel b/x-pack/packages/ml/string_hash/BUILD.bazel index f84191aedec26..b3684de8b3d0c 100644 --- a/x-pack/packages/ml/string_hash/BUILD.bazel +++ b/x-pack/packages/ml/string_hash/BUILD.bazel @@ -83,7 +83,6 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", tsconfig = ":tsconfig", @@ -97,6 +96,14 @@ js_library( visibility = ["//visibility:public"], ) +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + pkg_npm( name = "npm_module", deps = [":" + PKG_DIRNAME], @@ -108,17 +115,8 @@ filegroup( visibility = ["//visibility:public"], ) -pkg_npm_types( - name = "npm_module_types", - srcs = SRCS, - deps = [":tsc_types"], - package_name = PKG_REQUIRE_NAME, - tsconfig = ":tsconfig", - visibility = ["//visibility:public"], -) - -filegroup( +pkg_npm( name = "build_types", - srcs = [":npm_module_types"], + deps = [":npm_module_types"], visibility = ["//visibility:public"], ) diff --git a/x-pack/packages/ml/string_hash/package.json b/x-pack/packages/ml/string_hash/package.json index 9456893b31658..29bb620205745 100644 --- a/x-pack/packages/ml/string_hash/package.json +++ b/x-pack/packages/ml/string_hash/package.json @@ -6,5 +6,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0" + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" } diff --git a/x-pack/packages/ml/string_hash/tsconfig.json b/x-pack/packages/ml/string_hash/tsconfig.json index 49e920b0a461a..af8fdef592c43 100644 --- a/x-pack/packages/ml/string_hash/tsconfig.json +++ b/x-pack/packages/ml/string_hash/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "stripInternal": false, diff --git a/x-pack/performance/es_archives/ecommerce_sample_data/data.json.gz b/x-pack/performance/es_archives/ecommerce_sample_data/data.json.gz deleted file mode 100644 index a239a98699e67..0000000000000 Binary files a/x-pack/performance/es_archives/ecommerce_sample_data/data.json.gz and /dev/null differ diff --git a/x-pack/performance/es_archives/sample_data_ecommerce/data.json.gz b/x-pack/performance/es_archives/sample_data_ecommerce/data.json.gz new file mode 100644 index 0000000000000..bfc15ba9e0a37 Binary files /dev/null and b/x-pack/performance/es_archives/sample_data_ecommerce/data.json.gz differ diff --git a/x-pack/performance/es_archives/ecommerce_sample_data/mappings.json b/x-pack/performance/es_archives/sample_data_ecommerce/mappings.json similarity index 100% rename from x-pack/performance/es_archives/ecommerce_sample_data/mappings.json rename to x-pack/performance/es_archives/sample_data_ecommerce/mappings.json diff --git a/x-pack/performance/es_archives/sample_data_flights/data.json.gz b/x-pack/performance/es_archives/sample_data_flights/data.json.gz new file mode 100644 index 0000000000000..7e0f7cc411e47 Binary files /dev/null and b/x-pack/performance/es_archives/sample_data_flights/data.json.gz differ diff --git a/x-pack/performance/es_archives/sample_data_flights/mappings.json b/x-pack/performance/es_archives/sample_data_flights/mappings.json new file mode 100644 index 0000000000000..f852c18ebcc1c --- /dev/null +++ b/x-pack/performance/es_archives/sample_data_flights/mappings.json @@ -0,0 +1,100 @@ +{ + "type": "index", + "value": { + "aliases": { + }, + "index": "kibana_sample_data_flights", + "mappings": { + "properties": { + "AvgTicketPrice": { + "type": "float" + }, + "Cancelled": { + "type": "boolean" + }, + "Carrier": { + "type": "keyword" + }, + "Dest": { + "type": "keyword" + }, + "DestAirportID": { + "type": "keyword" + }, + "DestCityName": { + "type": "keyword" + }, + "DestCountry": { + "type": "keyword" + }, + "DestLocation": { + "type": "geo_point" + }, + "DestRegion": { + "type": "keyword" + }, + "DestWeather": { + "type": "keyword" + }, + "DistanceKilometers": { + "type": "float" + }, + "DistanceMiles": { + "type": "float" + }, + "FlightDelay": { + "type": "boolean" + }, + "FlightDelayMin": { + "type": "integer" + }, + "FlightDelayType": { + "type": "keyword" + }, + "FlightNum": { + "type": "keyword" + }, + "FlightTimeHour": { + "type": "keyword" + }, + "FlightTimeMin": { + "type": "float" + }, + "Origin": { + "type": "keyword" + }, + "OriginAirportID": { + "type": "keyword" + }, + "OriginCityName": { + "type": "keyword" + }, + "OriginCountry": { + "type": "keyword" + }, + "OriginLocation": { + "type": "geo_point" + }, + "OriginRegion": { + "type": "keyword" + }, + "OriginWeather": { + "type": "keyword" + }, + "dayOfWeek": { + "type": "integer" + }, + "timestamp": { + "type": "date" + } + } + }, + "settings": { + "index": { + "auto_expand_replicas": "0-1", + "number_of_replicas": "0", + "number_of_shards": "1" + } + } + } +} \ No newline at end of file diff --git a/x-pack/performance/es_archives/sample_data_logs/data.json.gz b/x-pack/performance/es_archives/sample_data_logs/data.json.gz new file mode 100644 index 0000000000000..6125fdcafcbb8 Binary files /dev/null and b/x-pack/performance/es_archives/sample_data_logs/data.json.gz differ diff --git a/x-pack/performance/es_archives/sample_data_logs/mappings.json b/x-pack/performance/es_archives/sample_data_logs/mappings.json new file mode 100644 index 0000000000000..84289354648ac --- /dev/null +++ b/x-pack/performance/es_archives/sample_data_logs/mappings.json @@ -0,0 +1,173 @@ +{ + "type": "index", + "value": { + "aliases": { + }, + "index": "kibana_sample_data_logs", + "mappings": { + "properties": { + "@timestamp": { + "path": "timestamp", + "type": "alias" + }, + "agent": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "bytes": { + "type": "long" + }, + "clientip": { + "type": "ip" + }, + "event": { + "properties": { + "dataset": { + "type": "keyword" + } + } + }, + "extension": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" + }, + "dest": { + "type": "keyword" + }, + "src": { + "type": "keyword" + }, + "srcdest": { + "type": "keyword" + } + } + }, + "host": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "index": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "ip": { + "type": "ip" + }, + "ip_range": { + "type": "ip_range" + }, + "machine": { + "properties": { + "os": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "ram": { + "type": "long" + } + } + }, + "memory": { + "type": "double" + }, + "message": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "phpmemory": { + "type": "long" + }, + "referer": { + "type": "keyword" + }, + "request": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "response": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "tags": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "timestamp": { + "type": "date" + }, + "timestamp_range": { + "type": "date_range" + }, + "url": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "utc_time": { + "type": "date" + } + } + }, + "settings": { + "index": { + "auto_expand_replicas": "0-1", + "number_of_replicas": "0", + "number_of_shards": "1" + } + } + } +} \ No newline at end of file diff --git a/x-pack/performance/journeys/data_stress_test_lens.ts b/x-pack/performance/journeys/data_stress_test_lens.ts index 9d4a6439da49f..cf9a4c44e930b 100644 --- a/x-pack/performance/journeys/data_stress_test_lens.ts +++ b/x-pack/performance/journeys/data_stress_test_lens.ts @@ -11,9 +11,8 @@ import { waitForVisualizations } from '../utils'; export const journey = new Journey({ kbnArchives: ['test/functional/fixtures/kbn_archiver/stress_test'], esArchives: ['test/functional/fixtures/es_archiver/stress_test'], -}).step('Go to dashboard', async ({ page, kbnUrl, kibanaServer }) => { +}).step('Go to dashboard', async ({ page, kbnUrl, kibanaServer, log }) => { await kibanaServer.uiSettings.update({ 'histogram:maxBars': 100 }); await page.goto(kbnUrl.get(`/app/dashboards#/view/92b143a0-2e9c-11ed-b1b6-a504560b392c`)); - - await waitForVisualizations(page, 1); + await waitForVisualizations(page, log, 1); }); diff --git a/x-pack/performance/journeys/ecommerce_dashboard.ts b/x-pack/performance/journeys/ecommerce_dashboard.ts index 05e46eab851b9..45a54fffd7620 100644 --- a/x-pack/performance/journeys/ecommerce_dashboard.ts +++ b/x-pack/performance/journeys/ecommerce_dashboard.ts @@ -7,50 +7,19 @@ import { Journey } from '@kbn/journeys'; import { subj } from '@kbn/test-subj-selector'; - -import { ToastsService } from '../services/toasts'; import { waitForVisualizations } from '../utils'; export const journey = new Journey({ - extendContext: ({ page, log }) => ({ - toasts: new ToastsService(log, page), - }), + esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce'], + kbnArchives: ['x-pack/performance/kbn_archives/ecommerce_no_map_dashboard'], }) - .step('Go to Sample Data Page', async ({ page, kbnUrl }) => { - await page.goto(kbnUrl.get(`/app/home#/tutorial_directory/sampleData`)); - - await page.waitForSelector(subj('showSampleDataButton')); - }) - .step('Open Sample Data pane', async ({ page }) => { - // open the "other sample data sets" section - await page.click(subj('showSampleDataButton')); - // wait for the logs card to be visible - await page.waitForSelector(subj('sampleDataSetCardecommerce')); + .step('Go to Dashboards Page', async ({ page, kbnUrl }) => { + await page.goto(kbnUrl.get(`/app/dashboards`)); + await page.waitForSelector('#dashboardListingHeading'); }) - .step('Remove Ecommerce Sample Data if installed', async ({ page, log, toasts }) => { - if (!(await page.$(subj('removeSampleDataSetecommerce')))) { - log.info('Ecommerce data does not need to be removed'); - return; - } - - // click the "remove" button - await page.click(subj('removeSampleDataSetecommerce')); - // wait for the toast acknowledging uninstallation - await toasts.waitForAndClear('uninstalled'); - }) - - .step('Install Ecommerce Sample Data', async ({ page, toasts }) => { - // click the "add data" button - await page.click(subj('addSampleDataSetecommerce')); - // wait for the toast acknowledging installation - await toasts.waitForAndClear('installed'); - }) - - .step('Go to Ecommerce Dashboard', async ({ page }) => { - await page.click(subj('launchSampleDataSetecommerce')); - await page.click(subj('viewSampleDataSetecommerce-dashboard')); - - await waitForVisualizations(page, 12); + .step('Go to Ecommerce Dashboard', async ({ page, log }) => { + await page.click(subj('dashboardListingTitleLink-[eCommerce]-Revenue-Dashboard')); + await waitForVisualizations(page, log, 13); }); diff --git a/x-pack/performance/journeys/ecommerce_dashboard_map_only.ts b/x-pack/performance/journeys/ecommerce_dashboard_map_only.ts new file mode 100644 index 0000000000000..883642be161e4 --- /dev/null +++ b/x-pack/performance/journeys/ecommerce_dashboard_map_only.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 { Journey } from '@kbn/journeys'; +import { subj } from '@kbn/test-subj-selector'; + +export const journey = new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce'], + kbnArchives: ['x-pack/performance/kbn_archives/ecommerce_map_only_dashboard'], +}) + + .step('Go to Dashboards Page', async ({ page, kbnUrl }) => { + await page.goto(kbnUrl.get(`/app/dashboards`)); + await page.waitForSelector('#dashboardListingHeading'); + }) + + .step('Go to Ecommerce No Map Dashboard', async ({ page, kbnUrl }) => { + await page.click(subj('dashboardListingTitleLink-[eCommerce]-Map-Only')); + await page.waitForSelector( + 'div[data-title="[eCommerce] Orders by Country"][data-render-complete="true"]' + ); + }); diff --git a/x-pack/performance/journeys/ecommerce_dashboard_saved_search_only.ts b/x-pack/performance/journeys/ecommerce_dashboard_saved_search_only.ts new file mode 100644 index 0000000000000..c63f239c5a491 --- /dev/null +++ b/x-pack/performance/journeys/ecommerce_dashboard_saved_search_only.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 { Journey } from '@kbn/journeys'; +import { subj } from '@kbn/test-subj-selector'; +import { waitForVisualizations } from '../utils'; + +export const journey = new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce'], + kbnArchives: ['x-pack/performance/kbn_archives/ecommerce_saved_search_only_dashboard'], +}) + + .step('Go to Dashboards Page', async ({ page, kbnUrl }) => { + await page.goto(kbnUrl.get(`/app/dashboards`)); + await page.waitForSelector('#dashboardListingHeading'); + }) + + .step('Go to Ecommerce Dashboard with Saved Search only', async ({ page, log }) => { + await page.click(subj('dashboardListingTitleLink-[eCommerce]-Saved-Search-Dashboard')); + await waitForVisualizations(page, log, 1); + }); diff --git a/x-pack/performance/journeys/ecommerce_dashboard_tsvb_gauge_only.ts b/x-pack/performance/journeys/ecommerce_dashboard_tsvb_gauge_only.ts new file mode 100644 index 0000000000000..ad252cfb16e88 --- /dev/null +++ b/x-pack/performance/journeys/ecommerce_dashboard_tsvb_gauge_only.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 { Journey } from '@kbn/journeys'; +import { subj } from '@kbn/test-subj-selector'; +import { waitForVisualizations } from '../utils'; + +export const journey = new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce'], + kbnArchives: ['x-pack/performance/kbn_archives/ecommerce_tsvb_gauge_only_dashboard'], +}) + + .step('Go to Dashboards Page', async ({ page, kbnUrl }) => { + await page.goto(kbnUrl.get(`/app/dashboards`)); + await page.waitForSelector('#dashboardListingHeading'); + }) + + .step('Go to Ecommerce Dashboard with TSVB Gauge only', async ({ page, log }) => { + await page.click(subj('dashboardListingTitleLink-[eCommerce]-TSVB-Gauge-Only-Dashboard')); + await waitForVisualizations(page, log, 1); + }); diff --git a/x-pack/performance/journeys/flight_dashboard.ts b/x-pack/performance/journeys/flight_dashboard.ts index 1fbf2e3e77cb2..d6cfa0d8acdeb 100644 --- a/x-pack/performance/journeys/flight_dashboard.ts +++ b/x-pack/performance/journeys/flight_dashboard.ts @@ -7,62 +7,19 @@ import { Journey } from '@kbn/journeys'; import { subj } from '@kbn/test-subj-selector'; - -import { ToastsService } from '../services/toasts'; import { waitForVisualizations } from '../utils'; export const journey = new Journey({ - extendContext: ({ page, log }) => ({ - toasts: new ToastsService(log, page), - }), + esArchives: ['x-pack/performance/es_archives/sample_data_flights'], + kbnArchives: ['x-pack/performance/kbn_archives/flights_no_map_dashboard'], }) - .step('Go to Sample Data Page', async ({ page, kbnUrl }) => { - await page.goto(kbnUrl.get(`/app/home#/tutorial_directory/sampleData`)); - - await page.waitForSelector(subj('showSampleDataButton')); - }) - - .step('Open Sample Data pane', async ({ page }) => { - // open the "other sample data sets" section - await page.click(subj('showSampleDataButton')); - // wait for the logs card to be visible - await page.waitForSelector(subj('sampleDataSetCardflights')); - }) - - .step('Remove Flights Sample Data if installed', async ({ page, log, toasts }) => { - if (!(await page.$(subj('removeSampleDataSetflights')))) { - log.info('Flights data does not need to be removed'); - return; - } - - // click the "remove" button - await page.click(subj('removeSampleDataSetflights')); - // wait for the toast acknowledging uninstallation - await toasts.waitForAndClear('uninstalled'); - }) - - .step('Install Flights Sample Data', async ({ page, toasts }) => { - // click the "add data" button - await page.click(subj('addSampleDataSetflights')); - // wait for the toast acknowledging installation - await toasts.waitForAndClear('installed'); - }) - - .step('Go to Flights Dashboard', async ({ page }) => { - await page.click(subj('launchSampleDataSetflights')); - await page.click(subj('viewSampleDataSetflights-dashboard')); - await waitForVisualizations(page, 14); + .step('Go to Dashboards Page', async ({ page, kbnUrl }) => { + await page.goto(kbnUrl.get(`/app/dashboards`)); + await page.waitForSelector('#dashboardListingHeading'); }) - .step('Go to Airport Connections Visualizations Edit', async ({ page }) => { - await page.click(subj('dashboardEditMode')); - - const flightsPanelHeadingSelector = `embeddablePanelHeading-[Flights]AirportConnections(HoverOverAirport)`; - const panelToggleMenuIconSelector = `embeddablePanelToggleMenuIcon`; - await page.click(subj(`${flightsPanelHeadingSelector} > ${panelToggleMenuIconSelector}`)); - - await page.click(subj('embeddablePanelAction-editPanel')); - - await waitForVisualizations(page, 1); + .step('Go to Flights Dashboard', async ({ page, log }) => { + await page.click(subj('dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard')); + await waitForVisualizations(page, log, 14); }); diff --git a/x-pack/performance/journeys/login.ts b/x-pack/performance/journeys/login.ts index 7c5808be83607..1990bd1babe0f 100644 --- a/x-pack/performance/journeys/login.ts +++ b/x-pack/performance/journeys/login.ts @@ -7,6 +7,7 @@ import { Journey } from '@kbn/journeys'; import { subj } from '@kbn/test-subj-selector'; +import { waitForChrome } from '../utils'; export const journey = new Journey({ skipAutoLogin: true, @@ -40,5 +41,5 @@ export const journey = new Journey({ await page.type(subj('loginPassword'), 'changeme', { delay: inputDelays.TYPING }); await page.click(subj('loginSubmit'), { delay: inputDelays.MOUSE_CLICK }); - await page.waitForSelector('#headerUserMenu'); + await waitForChrome(page); }); diff --git a/x-pack/performance/journeys/many_fields_discover.ts b/x-pack/performance/journeys/many_fields_discover.ts index 41ec0373c700c..7fc2ef20a2ab5 100644 --- a/x-pack/performance/journeys/many_fields_discover.ts +++ b/x-pack/performance/journeys/many_fields_discover.ts @@ -7,6 +7,7 @@ import { Journey } from '@kbn/journeys'; import { subj } from '@kbn/test-subj-selector'; +import { waitForChrome } from '../utils'; export const journey = new Journey({ // FAILING: https://github.com/elastic/kibana/issues/130287 @@ -16,6 +17,7 @@ export const journey = new Journey({ }) .step('Go to Discover Page', async ({ page, kbnUrl }) => { await page.goto(kbnUrl.get(`/app/discover`)); + await waitForChrome(page); await page.waitForSelector(subj('discoverDocTable')); }) .step('Expand the first document', async ({ page }) => { diff --git a/x-pack/performance/journeys/promotion_tracking_dashboard.ts b/x-pack/performance/journeys/promotion_tracking_dashboard.ts index e6bd67a2819c5..792a4dab88176 100644 --- a/x-pack/performance/journeys/promotion_tracking_dashboard.ts +++ b/x-pack/performance/journeys/promotion_tracking_dashboard.ts @@ -11,7 +11,7 @@ import { waitForVisualizations } from '../utils'; export const journey = new Journey({ kbnArchives: ['x-pack/performance/kbn_archives/promotion_tracking_dashboard'], - esArchives: ['x-pack/performance/es_archives/ecommerce_sample_data'], + esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce'], scalabilitySetup: { warmup: [ { @@ -50,6 +50,6 @@ export const journey = new Journey({ await page.click(subj('superDatePickerCommonlyUsed_Last_30 days')); }) - .step('Wait for visualization animations to finish', async ({ page }) => { - await waitForVisualizations(page, 1); + .step('Wait for visualization animations to finish', async ({ page, log }) => { + await waitForVisualizations(page, log, 1); }); diff --git a/x-pack/performance/journeys/web_logs_dashboard.ts b/x-pack/performance/journeys/web_logs_dashboard.ts index efba62acc517e..e4d4c66d272f6 100644 --- a/x-pack/performance/journeys/web_logs_dashboard.ts +++ b/x-pack/performance/journeys/web_logs_dashboard.ts @@ -7,50 +7,19 @@ import { Journey } from '@kbn/journeys'; import { subj } from '@kbn/test-subj-selector'; - -import { ToastsService } from '../services/toasts'; import { waitForVisualizations } from '../utils'; export const journey = new Journey({ - extendContext: ({ page, log }) => ({ - toasts: new ToastsService(log, page), - }), + esArchives: ['x-pack/performance/es_archives/sample_data_logs'], + kbnArchives: ['x-pack/performance/kbn_archives/logs_no_map_dashboard'], }) - .step('Go to Sample Data Page', async ({ page, kbnUrl }) => { - await page.goto(kbnUrl.get(`/app/home#/tutorial_directory/sampleData`)); - - await page.waitForSelector(subj('showSampleDataButton')); - }) - .step('Open Sample Data pane', async ({ page }) => { - // open the "other sample data sets" section - await page.click(subj('showSampleDataButton')); - // wait for the logs card to be visible - await page.waitForSelector(subj('sampleDataSetCardlogs')); + .step('Go to Dashboards Page', async ({ page, kbnUrl }) => { + await page.goto(kbnUrl.get(`/app/dashboards`)); + await page.waitForSelector('#dashboardListingHeading'); }) - .step('Remove Sample Data Logs if installed', async ({ page, log, toasts }) => { - if (!(await page.$(subj('removeSampleDataSetlogs')))) { - log.info('Logs data does not need to be removed'); - return; - } - - // click the "remove" button - await page.click(subj('removeSampleDataSetlogs')); - // wait for the toast acknowledging uninstallation - await toasts.waitForAndClear('uninstalled'); - }) - - .step('Install Logs Sample Data', async ({ page, toasts }) => { - // click the "add data" button - await page.click(subj('addSampleDataSetlogs')); - // wait for the toast acknowledging installation - await toasts.waitForAndClear('installed'); - }) - - .step('Go to Web Logs Dashboard', async ({ page }) => { - await page.click(subj('launchSampleDataSetlogs')); - await page.click(subj('viewSampleDataSetlogs-dashboard')); - - await waitForVisualizations(page, 11); + .step('Go to Web Logs Dashboard', async ({ page, log }) => { + await page.click(subj('dashboardListingTitleLink-[Logs]-Web-Traffic')); + await waitForVisualizations(page, log, 11); }); diff --git a/x-pack/performance/kbn_archives/ecommerce_map_only_dashboard.json b/x-pack/performance/kbn_archives/ecommerce_map_only_dashboard.json new file mode 100644 index 0000000000000..199af49402409 --- /dev/null +++ b/x-pack/performance/kbn_archives/ecommerce_map_only_dashboard.json @@ -0,0 +1,130 @@ +{ + "attributes": { + "fieldAttrs": "{\"products.manufacturer\":{\"count\":1},\"products.price\":{\"count\":1},\"products.product_name\":{\"count\":1},\"total_quantity\":{\"count\":1}}", + "fieldFormatMap": "{\"taxful_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}},\"products.price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"taxless_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxless_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxful_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.min_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_unit_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}}}", + "fields": "[]", + "name": "Kibana Sample Data eCommerce", + "runtimeFieldMap": "{}", + "timeFieldName": "order_date", + "title": "kibana_sample_data_ecommerce", + "typeMeta": "{}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-27T09:53:09.176Z", + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "migrationVersion": { + "index-pattern": "8.0.0" + }, + "references": [], + "type": "index-pattern", + "updated_at": "2022-10-27T09:53:09.176Z", + "version": "WzE0MywxXQ==" +} + +{ + "attributes": { + "description": "", + "layerListJSON": "[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"isAutoSelect\":true,\"lightModeDefault\":\"road_map_desaturated\"},\"visible\":true,\"style\":{},\"type\":\"EMS_VECTOR_TILE\",\"minZoom\":0,\"maxZoom\":24},{\"id\":\"7ameq\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"world_countries\",\"tooltipProperties\":[\"name\",\"iso2\"]},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"__kbnjoin__count__741db9c6-8ebb-4ea9-9885-b6b4ac019d14\",\"origin\":\"join\"},\"color\":\"Green to Red\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}}}},\"type\":\"GEOJSON_VECTOR\",\"joins\":[{\"leftField\":\"iso2\",\"right\":{\"type\":\"ES_TERM_SOURCE\",\"id\":\"741db9c6-8ebb-4ea9-9885-b6b4ac019d14\",\"indexPatternTitle\":\"kibana_sample_data_ecommerce\",\"term\":\"geoip.country_iso_code\",\"indexPatternRefName\":\"layer_1_join_0_index_pattern\",\"metrics\":[{\"type\":\"count\",\"label\":\"sales count\"}],\"applyGlobalQuery\":true}}]},{\"id\":\"jmtgf\",\"label\":\"United States\",\"minZoom\":0,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"usa_states\",\"tooltipProperties\":[\"name\"]},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"__kbnjoin__count__30a0ec24-49b6-476a-b4ed-6c1636333695\",\"origin\":\"join\"},\"color\":\"Blues\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}}}},\"type\":\"GEOJSON_VECTOR\",\"joins\":[{\"leftField\":\"name\",\"right\":{\"type\":\"ES_TERM_SOURCE\",\"id\":\"30a0ec24-49b6-476a-b4ed-6c1636333695\",\"indexPatternTitle\":\"kibana_sample_data_ecommerce\",\"term\":\"geoip.region_name\",\"indexPatternRefName\":\"layer_2_join_0_index_pattern\",\"metrics\":[{\"type\":\"count\",\"label\":\"sales count\"}],\"applyGlobalQuery\":true}}]},{\"id\":\"ui5f8\",\"label\":\"France\",\"minZoom\":0,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"france_departments\",\"tooltipProperties\":[\"label_en\"]},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"__kbnjoin__count__e325c9da-73fa-4b3b-8b59-364b99370826\",\"origin\":\"join\"},\"color\":\"Blues\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}}}},\"type\":\"GEOJSON_VECTOR\",\"joins\":[{\"leftField\":\"label_en\",\"right\":{\"type\":\"ES_TERM_SOURCE\",\"id\":\"e325c9da-73fa-4b3b-8b59-364b99370826\",\"indexPatternTitle\":\"kibana_sample_data_ecommerce\",\"term\":\"geoip.region_name\",\"indexPatternRefName\":\"layer_3_join_0_index_pattern\",\"metrics\":[{\"type\":\"count\",\"label\":\"sales count\"}],\"applyGlobalQuery\":true}}]},{\"id\":\"y3fjb\",\"label\":\"United Kingdom\",\"minZoom\":0,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"uk_subdivisions\",\"tooltipProperties\":[\"label_en\"]},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"__kbnjoin__count__612d805d-8533-43a9-ac0e-cbf51fe63dcd\",\"origin\":\"join\"},\"color\":\"Blues\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}}}},\"type\":\"GEOJSON_VECTOR\",\"joins\":[{\"leftField\":\"label_en\",\"right\":{\"type\":\"ES_TERM_SOURCE\",\"id\":\"612d805d-8533-43a9-ac0e-cbf51fe63dcd\",\"indexPatternTitle\":\"kibana_sample_data_ecommerce\",\"term\":\"geoip.region_name\",\"indexPatternRefName\":\"layer_4_join_0_index_pattern\",\"metrics\":[{\"type\":\"count\",\"label\":\"sales count\"}],\"applyGlobalQuery\":true}}]},{\"id\":\"c54wk\",\"label\":\"Sales\",\"minZoom\":9,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"id\":\"04c983b0-8cfa-4e6a-a64b-52c10b7008fe\",\"type\":\"ES_SEARCH\",\"geoField\":\"geoip.location\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[\"category\",\"customer_gender\",\"manufacturer\",\"order_id\",\"total_quantity\",\"total_unique_products\",\"taxful_total_price\",\"order_date\",\"geoip.region_name\",\"geoip.country_iso_code\"],\"indexPatternRefName\":\"layer_5_source_index_pattern\",\"applyGlobalQuery\":true,\"scalingType\":\"LIMIT\"},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"taxful_total_price\",\"origin\":\"source\"},\"color\":\"Greens\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}}}},\"type\":\"GEOJSON_VECTOR\"},{\"id\":\"qvhh3\",\"label\":\"Total Sales Revenue\",\"minZoom\":0,\"maxZoom\":9,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"aa7f87b8-9dc5-42be-b19e-1a2fa09b6cad\",\"geoField\":\"geoip.location\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\",\"label\":\"sales count\"},{\"type\":\"sum\",\"field\":\"taxful_total_price\",\"label\":\"total sales price\"}],\"indexPatternRefName\":\"layer_6_source_index_pattern\",\"applyGlobalQuery\":true},\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Greens\",\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#cccccc\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"sum_of_taxful_total_price\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":20,\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"labelText\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"sum_of_taxful_total_price\",\"origin\":\"source\"},\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"labelSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"sum_of_taxful_total_price\",\"origin\":\"source\"},\"minSize\":12,\"maxSize\":24,\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3}}},\"labelBorderSize\":{\"options\":{\"size\":\"MEDIUM\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}}}},\"type\":\"GEOJSON_VECTOR\"}]", + "mapStateJSON": "{\"zoom\":2.11,\"center\":{\"lon\":-15.07605,\"lat\":45.88578},\"timeFilters\":{\"from\":\"now-7d\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":true,\"interval\":0},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"settings\":{\"autoFitToDataBounds\":false}}", + "title": "[eCommerce] Orders by Country", + "uiStateJSON": "{\"isDarkMode\":false}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-27T09:53:09.176Z", + "id": "2c9c1f60-1909-11e9-919b-ffe5949a18d2", + "migrationVersion": { + "map": "8.4.0" + }, + "references": [ + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "layer_1_join_0_index_pattern", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "layer_2_join_0_index_pattern", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "layer_3_join_0_index_pattern", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "layer_4_join_0_index_pattern", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "layer_5_source_index_pattern", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "layer_6_source_index_pattern", + "type": "index-pattern" + } + ], + "type": "map", + "updated_at": "2022-10-27T09:53:09.176Z", + "version": "WzE2MSwxXQ==" +} + +{ + "attributes": { + "controlGroupInput": { + "chainingSystem": "HIERARCHICAL", + "controlStyle": "oneLine", + "ignoreParentSettingsJSON": "{\"ignoreFilters\":false,\"ignoreQuery\":false,\"ignoreTimerange\":false,\"ignoreValidations\":false}", + "panelsJSON": "{\"1ee1617f-fd8e-45e4-bc6a-d5736710ea20\":{\"order\":0,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"title\":\"Manufacturer\",\"fieldName\":\"manufacturer.keyword\",\"parentFieldName\":\"manufacturer\",\"id\":\"1ee1617f-fd8e-45e4-bc6a-d5736710ea20\",\"enhancements\":{}}},\"afa9fa0f-a002-41a5-bab9-b738316d2590\":{\"order\":1,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"title\":\"Category\",\"fieldName\":\"category.keyword\",\"parentFieldName\":\"category\",\"id\":\"afa9fa0f-a002-41a5-bab9-b738316d2590\",\"enhancements\":{}}},\"d3f766cb-5f96-4a12-8d3c-034e08be8855\":{\"order\":2,\"width\":\"small\",\"grow\":true,\"type\":\"rangeSliderControl\",\"explicitInput\":{\"title\":\"Quantity\",\"fieldName\":\"total_quantity\",\"id\":\"d3f766cb-5f96-4a12-8d3c-034e08be8855\",\"enhancements\":{}}}}" + }, + "description": "Analyze mock eCommerce orders and revenue", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}" + }, + "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", + "panelsJSON": "[{\"version\":\"8.6.0\",\"type\":\"map\",\"gridData\":{\"x\":0,\"y\":0,\"w\":48,\"h\":24,\"i\":\"11\"},\"panelIndex\":\"11\",\"embeddableConfig\":{\"isLayerTOCOpen\":false,\"hiddenLayers\":[],\"mapCenter\":{\"lat\":45.88578,\"lon\":-15.07605,\"zoom\":2.11},\"openTOCDetails\":[],\"enhancements\":{}},\"panelRefName\":\"panel_11\"}]", + "refreshInterval": { + "pause": true, + "value": 0 + }, + "timeTo": "2022-10-25T20:00:00.000Z", + "timeFrom": "2022-10-18T20:00:00.000Z", + "timeRestore": true, + "title": "[eCommerce] Map Only", + "version": 1 + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-27T09:56:03.234Z", + "id": "914d5090-55dd-11ed-989d-f3a363484c6c", + "migrationVersion": { + "dashboard": "8.6.0" + }, + "references": [ + { + "id": "2c9c1f60-1909-11e9-919b-ffe5949a18d2", + "name": "11:panel_11", + "type": "map" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_1ee1617f-fd8e-45e4-bc6a-d5736710ea20:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_afa9fa0f-a002-41a5-bab9-b738316d2590:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_d3f766cb-5f96-4a12-8d3c-034e08be8855:rangeSliderDataView", + "type": "index-pattern" + } + ], + "type": "dashboard", + "updated_at": "2022-10-27T09:56:03.234Z", + "version": "WzI2OCwxXQ==" +} diff --git a/x-pack/performance/kbn_archives/ecommerce_no_map_dashboard.json b/x-pack/performance/kbn_archives/ecommerce_no_map_dashboard.json new file mode 100644 index 0000000000000..b453dd48384af --- /dev/null +++ b/x-pack/performance/kbn_archives/ecommerce_no_map_dashboard.json @@ -0,0 +1,1403 @@ +{ + "attributes":{ + "fieldAttrs":"{\"products.manufacturer\":{\"count\":1},\"products.price\":{\"count\":1},\"products.product_name\":{\"count\":1},\"total_quantity\":{\"count\":1}}", + "fieldFormatMap":"{\"taxful_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}},\"products.price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"taxless_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxless_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxful_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.min_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_unit_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}}}", + "fields":"[]", + "name":"Kibana Sample Data eCommerce", + "runtimeFieldMap":"{}", + "timeFieldName":"order_date", + "title":"kibana_sample_data_ecommerce", + "typeMeta":"{}" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "migrationVersion":{ + "index-pattern":"8.0.0" + }, + "references":[], + "type":"index-pattern", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE0NiwxXQ==" +} + +{ + "attributes":{ + "description":"", + "kibanaSavedObjectMeta":{ + "searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" + }, + "title":"[eCommerce] Promotion Tracking", + "uiStateJSON":"{}", + "version":1, + "visState":"{\"title\":\"[eCommerce] Promotion Tracking\",\"type\":\"metrics\",\"aggs\":[],\"params\":{\"time_range_mode\":\"entire_time_range\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"ea20ae70-b88d-11e8-a451-f37365e9f268\",\"color\":\"rgba(211,96,134,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"ea20ae71-b88d-11e8-a451-f37365e9f268\",\"type\":\"sum\",\"field\":\"taxful_total_price\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":\"2\",\"point_size\":\"5\",\"fill\":\"0\",\"stacked\":\"none\",\"filter\":{\"query\":\"products.product_name:*trouser*\",\"language\":\"lucene\"},\"label\":\"Revenue Trousers\",\"value_template\":\"${{value}}\",\"split_color_mode\":\"gradient\"},{\"id\":\"062d77b0-b88e-11e8-a451-f37365e9f268\",\"color\":\"rgba(84,179,153,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"062d77b1-b88e-11e8-a451-f37365e9f268\",\"type\":\"sum\",\"field\":\"taxful_total_price\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":\"2\",\"point_size\":\"05\",\"fill\":\"0\",\"stacked\":\"none\",\"filter\":{\"query\":\"products.product_name:*watch*\",\"language\":\"lucene\"},\"label\":\"Revenue Watches\",\"value_template\":\"${{value}}\",\"split_color_mode\":\"gradient\"},{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"rgba(96,146,192,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"sum\",\"field\":\"taxful_total_price\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":\"2\",\"point_size\":\"5\",\"fill\":\"0\",\"stacked\":\"none\",\"filter\":{\"query\":\"products.product_name:*bag*\",\"language\":\"lucene\"},\"label\":\"Revenue Bags\",\"value_template\":\"${{value}}\",\"split_color_mode\":\"gradient\"},{\"id\":\"faa2c170-b88d-11e8-a451-f37365e9f268\",\"color\":\"rgba(202,142,174,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"faa2c171-b88d-11e8-a451-f37365e9f268\",\"type\":\"sum\",\"field\":\"taxful_total_price\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":\"2\",\"point_size\":\"5\",\"fill\":\"0\",\"stacked\":\"none\",\"filter\":{\"query\":\"products.product_name:*cocktail dress*\",\"language\":\"lucene\"},\"label\":\"Revenue Cocktail Dresses\",\"value_template\":\"${{value}}\",\"split_color_mode\":\"gradient\"}],\"time_field\":\"order_date\",\"interval\":\"12h\",\"use_kibana_indexes\":true,\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"legend_position\":\"bottom\",\"annotations\":[{\"fields\":\"taxful_total_price\",\"template\":\"Ring the bell! ${{taxful_total_price}}\",\"query_string\":{\"query\":\"taxful_total_price:>250\",\"language\":\"lucene\"},\"id\":\"c8c30be0-b88f-11e8-a451-f37365e9f268\",\"color\":\"rgba(25,77,51,1)\",\"time_field\":\"order_date\",\"icon\":\"fa-bell\",\"ignore_global_filters\":1,\"ignore_panel_filters\":1,\"index_pattern_ref_name\":\"metrics_1_index_pattern\"}],\"tooltip_mode\":\"show_all\",\"drop_last_bucket\":0,\"isModelInvalid\":false,\"index_pattern_ref_name\":\"metrics_0_index_pattern\"}}" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"45e07720-b890-11e8-a6d9-e546fe2bba5f", + "migrationVersion":{ + "visualization":"8.5.0" + }, + "references":[ + { + "id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name":"metrics_0_index_pattern", + "type":"index-pattern" + }, + { + "id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name":"metrics_1_index_pattern", + "type":"index-pattern" + } + ], + "type":"visualization", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE0NywxXQ==" +} + +{ + "attributes":{ + "description":"", + "kibanaSavedObjectMeta":{ + "searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" + }, + "title":"[eCommerce] Sold Products per Day", + "uiStateJSON":"{}", + "version":1, + "visState":"{\"title\":\"[eCommerce] Sold Products per Day\",\"type\":\"metrics\",\"aggs\":[],\"params\":{\"time_range_mode\":\"entire_time_range\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"gauge\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"count\"},{\"id\":\"fd1e1b90-e4e3-11eb-8234-cb7bfd534fce\",\"type\":\"math\",\"variables\":[{\"id\":\"00374270-e4e4-11eb-8234-cb7bfd534fce\",\"name\":\"c\",\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\"}],\"script\":\"params.c / (params._interval / 1000 / 60 / 60 / 24)\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"0.0\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Trxns / day\",\"split_color_mode\":\"gradient\",\"value_template\":\"\"}],\"time_field\":\"order_date\",\"interval\":\"1d\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"gauge_color_rules\":[{\"value\":150,\"id\":\"6da070c0-b891-11e8-b645-195edeb9de84\",\"gauge\":\"rgba(104,188,0,1)\",\"operator\":\"gte\"},{\"value\":150,\"id\":\"9b0cdbc0-b891-11e8-b645-195edeb9de84\",\"gauge\":\"rgba(244,78,59,1)\",\"operator\":\"lt\"}],\"gauge_width\":\"15\",\"gauge_inner_width\":\"10\",\"gauge_style\":\"half\",\"filter\":\"\",\"gauge_max\":\"300\",\"use_kibana_indexes\":true,\"hide_last_value_indicator\":true,\"tooltip_mode\":\"show_all\",\"drop_last_bucket\":0,\"isModelInvalid\":false,\"index_pattern_ref_name\":\"metrics_0_index_pattern\"}}" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"b80e6540-b891-11e8-a6d9-e546fe2bba5f", + "migrationVersion":{ + "visualization":"8.5.0" + }, + "references":[ + { + "id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name":"metrics_0_index_pattern", + "type":"index-pattern" + } + ], + "type":"visualization", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE0OCwxXQ==" +} + +{ + "attributes":{ + "columns":[ + "category", + "taxful_total_price", + "products.price", + "products.product_name", + "products.manufacturer", + "sku" + ], + "description":"", + "hits":0, + "kibanaSavedObjectMeta":{ + "searchSourceJSON":"{\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "sort":[ + [ + "order_date", + "desc" + ] + ], + "title":"[eCommerce] Orders", + "version":1 + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"3ba638e0-b894-11e8-a6d9-e546fe2bba5f", + "migrationVersion":{ + "search":"8.0.0" + }, + "references":[ + { + "id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name":"kibanaSavedObjectMeta.searchSourceJSON.index", + "type":"index-pattern" + } + ], + "type":"search", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE0OSwxXQ==" +} + +{ + "attributes":{ + "description":"", + "kibanaSavedObjectMeta":{ + "searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" + }, + "title":"[eCommerce] Markdown", + "uiStateJSON":"{}", + "version":1, + "visState":"{\"title\":\"[eCommerce] Markdown\",\"type\":\"markdown\",\"params\":{\"fontSize\":12,\"openLinksInNewTab\":false,\"markdown\":\"## Sample eCommerce 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).\"},\"aggs\":[]}" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"c00d1f90-f5ea-11eb-a78e-83aac3c38a60", + "migrationVersion":{ + "visualization":"8.5.0" + }, + "references":[], + "type":"visualization", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE1MSwxXQ==" +} + +{ + "attributes":{ + "state":{ + "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" + } + }, + "incompleteColumns":{} + } + } + } + }, + "filters":[], + "query":{ + "language":"kuery", + "query":"" + }, + "visualization":{ + "accessor":"041db33b-5c9c-47f3-a5d3-ef5e255d1663", + "layerId":"c7478794-6767-4286-9d65-1c0ecd909dd8", + "layerType":"data", + "size":"xl", + "textAlign":"center", + "titlePosition":"bottom" + } + }, + "title":"Sum of revenue", + "visualizationType":"lnsLegacyMetric" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"ce02e260-f5ea-11eb-a78e-83aac3c38a60", + "migrationVersion":{ + "lens":"8.6.0" + }, + "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" + } + ], + "type":"lens", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE1MywxXQ==" +} + +{ + "attributes":{ + "state":{ + "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" + } + }, + "incompleteColumns":{} + } + } + } + }, + "filters":[], + "query":{ + "language":"kuery", + "query":"" + }, + "visualization":{ + "accessor":"020bbfdf-9ef8-4802-aa9e-342d2ea0bebf", + "layerId":"4fb42a8e-b133-43c8-805c-a38472053938", + "layerType":"data", + "size":"xl", + "textAlign":"center", + "titlePosition":"bottom" + } + }, + "title":"Median spending", + "visualizationType":"lnsLegacyMetric" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"d5f90030-f5ea-11eb-a78e-83aac3c38a60", + "migrationVersion":{ + "lens":"8.6.0" + }, + "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-4fb42a8e-b133-43c8-805c-a38472053938", + "type":"index-pattern" + } + ], + "type":"lens", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE1NCwxXQ==" +} + +{ + "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":{ + "includeEmptyRows":true, + "interval":"1d" + }, + "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", + "layerType":"data", + "seriesType":"bar_stacked", + "xAccessor":"8289349e-6d1b-4abf-b164-0208183d2c34" + } + ], + "legend":{ + "isVisible":true, + "legendSize":"auto", + "position":"right" + }, + "preferredSeriesType":"bar_stacked", + "tickLabelsVisibilitySettings":{ + "x":true, + "yLeft":true, + "yRight":true + }, + "valueLabels":"hide", + "yLeftExtent":{ + "mode":"full" + }, + "yRightExtent":{ + "mode":"full" + } + } + }, + "title":"% of target revenue ($10k)", + "visualizationType":"lnsXY" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"c762b7a0-f5ea-11eb-a78e-83aac3c38a60", + "migrationVersion":{ + "lens":"8.6.0" + }, + "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" + } + ], + "type":"lens", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE1MiwxXQ==" +} + +{ + "attributes":{ + "state":{ + "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 + } + } + }, + "scale":"ratio", + "sourceField":"total_quantity" + } + }, + "incompleteColumns":{} + } + } + } + }, + "filters":[], + "query":{ + "language":"kuery", + "query":"" + }, + "visualization":{ + "accessor":"c52c2003-ae58-4604-bae7-52ba0fb38a01", + "layerId":"667067a2-7cdf-4f0e-a9fe-eb4f4f1f2f17", + "layerType":"data", + "size":"xl", + "textAlign":"center", + "titlePosition":"bottom" + } + }, + "title":"Avg. items sold", + "visualizationType":"lnsLegacyMetric" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"e3902840-f5ea-11eb-a78e-83aac3c38a60", + "migrationVersion":{ + "lens":"8.6.0" + }, + "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-667067a2-7cdf-4f0e-a9fe-eb4f4f1f2f17", + "type":"index-pattern" + } + ], + "type":"lens", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE1NiwxXQ==" +} + +{ + "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":{ + "includeEmptyRows":true, + "interval":"1d" + }, + "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", + "layerType":"data", + "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" + } + ] + } + ], + "legend":{ + "isVisible":true, + "legendSize":"auto", + "position":"right" + }, + "preferredSeriesType":"line", + "tickLabelsVisibilitySettings":{ + "x":true, + "yLeft":true, + "yRight":true + }, + "valueLabels":"hide", + "yLeftExtent":{ + "mode":"full" + }, + "yRightExtent":{ + "mode":"full" + } + } + }, + "title":"Transactions per day", + "visualizationType":"lnsXY" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"dde978b0-f5ea-11eb-a78e-83aac3c38a60", + "migrationVersion":{ + "lens":"8.6.0" + }, + "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" + } + ], + "type":"lens", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE1NSwxXQ==" +} + +{ + "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, + "parentFormat":{ + "id":"terms" + }, + "size":10 + }, + "scale":"ordinal", + "sourceField":"category.keyword" + }, + "ebcb19af-0900-4439-949f-d8cd9bccde19":{ + "dataType":"date", + "isBucketed":true, + "label":"order_date", + "operationType":"date_histogram", + "params":{ + "includeEmptyRows":true, + "interval":"1d" + }, + "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", + "layerType":"data", + "position":"top", + "seriesType":"bar_percentage_stacked", + "showGridlines":false, + "splitAccessor":"9f61a7df-198e-4754-b34c-81ed544136ba", + "xAccessor":"ebcb19af-0900-4439-949f-d8cd9bccde19" + } + ], + "legend":{ + "isVisible":true, + "legendSize":"auto", + "position":"right" + }, + "preferredSeriesType":"bar_percentage_stacked", + "tickLabelsVisibilitySettings":{ + "x":true, + "yLeft":true, + "yRight":true + }, + "valueLabels":"show", + "yLeftExtent":{ + "mode":"full" + }, + "yRightExtent":{ + "mode":"full" + } + } + }, + "title":"Breakdown by category", + "visualizationType":"lnsXY" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"eddf7850-f5ea-11eb-a78e-83aac3c38a60", + "migrationVersion":{ + "lens":"8.6.0" + }, + "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" + } + ], + "type":"lens", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE1NywxXQ==" +} + +{ + "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, + "parentFormat":{ + "id":"terms" + }, + "size":5 + }, + "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", + "layerType":"data", + "position":"top", + "seriesType":"bar_horizontal", + "showGridlines":false, + "xAccessor":"d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46" + } + ], + "legend":{ + "isVisible":true, + "legendSize":"auto", + "position":"right" + }, + "preferredSeriesType":"bar_horizontal", + "tickLabelsVisibilitySettings":{ + "x":true, + "yLeft":true, + "yRight":true + }, + "valueLabels":"show", + "yLeftExtent":{ + "mode":"full" + }, + "yRightExtent":{ + "mode":"full" + } + } + }, + "title":"Top products this week", + "visualizationType":"lnsXY" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"03071e90-f5eb-11eb-a78e-83aac3c38a60", + "migrationVersion":{ + "lens":"8.6.0" + }, + "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" + } + ], + "type":"lens", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE1OSwxXQ==" +} + +{ + "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":{ + "includeEmptyRows":true, + "interval":"1d" + }, + "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 + } + }, + "title":"Daily comparison", + "visualizationType":"lnsDatatable" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"ff6a21b0-f5ea-11eb-a78e-83aac3c38a60", + "migrationVersion":{ + "lens":"8.6.0" + }, + "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" + } + ], + "type":"lens", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE1OCwxXQ==" +} + +{ + "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, + "parentFormat":{ + "id":"terms" + }, + "size":5 + }, + "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", + "layerType":"data", + "position":"top", + "seriesType":"bar_horizontal", + "showGridlines":false, + "xAccessor":"d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46" + } + ], + "legend":{ + "isVisible":true, + "legendSize":"auto", + "position":"right" + }, + "preferredSeriesType":"bar_horizontal", + "tickLabelsVisibilitySettings":{ + "x":true, + "yLeft":true, + "yRight":true + }, + "valueLabels":"show", + "yLeftExtent":{ + "mode":"full" + }, + "yRightExtent":{ + "mode":"full" + } + } + }, + "title":"Top products last week", + "visualizationType":"lnsXY" + }, + "coreMigrationVersion":"8.6.0", + "created_at":"2022-10-25T16:45:01.844Z", + "id":"06379e00-f5eb-11eb-a78e-83aac3c38a60", + "migrationVersion":{ + "lens":"8.6.0" + }, + "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" + } + ], + "type":"lens", + "updated_at":"2022-10-25T16:45:01.844Z", + "version":"WzE2MCwxXQ==" +} + +{ + "attributes": { + "controlGroupInput": { + "chainingSystem": "HIERARCHICAL", + "controlStyle": "oneLine", + "ignoreParentSettingsJSON": "{\"ignoreFilters\":false,\"ignoreQuery\":false,\"ignoreTimerange\":false,\"ignoreValidations\":false}", + "panelsJSON": "{\"1ee1617f-fd8e-45e4-bc6a-d5736710ea20\":{\"order\":0,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"title\":\"Manufacturer\",\"fieldName\":\"manufacturer.keyword\",\"parentFieldName\":\"manufacturer\",\"id\":\"1ee1617f-fd8e-45e4-bc6a-d5736710ea20\",\"enhancements\":{}}},\"afa9fa0f-a002-41a5-bab9-b738316d2590\":{\"order\":1,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"title\":\"Category\",\"fieldName\":\"category.keyword\",\"parentFieldName\":\"category\",\"id\":\"afa9fa0f-a002-41a5-bab9-b738316d2590\",\"enhancements\":{}}},\"d3f766cb-5f96-4a12-8d3c-034e08be8855\":{\"order\":2,\"width\":\"small\",\"grow\":true,\"type\":\"rangeSliderControl\",\"explicitInput\":{\"title\":\"Quantity\",\"fieldName\":\"total_quantity\",\"id\":\"d3f766cb-5f96-4a12-8d3c-034e08be8855\",\"enhancements\":{}}}}" + }, + "description": "Analyze mock eCommerce orders and revenue", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}" + }, + "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", + "panelsJSON": "[{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":0,\"y\":21,\"w\":24,\"h\":10,\"i\":\"5\"},\"panelIndex\":\"5\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_5\"},{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":36,\"y\":7,\"w\":12,\"h\":7,\"i\":\"7\"},\"panelIndex\":\"7\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_7\"},{\"version\":\"8.6.0\",\"type\":\"search\",\"gridData\":{\"x\":0,\"y\":49,\"w\":48,\"h\":18,\"i\":\"10\"},\"panelIndex\":\"10\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_10\"},{\"version\":\"8.6.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.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":24,\"y\":0,\"w\":12,\"h\":7,\"i\":\"19a3c101-ad2e-4421-a71b-a4734ec1f03e\"},\"panelIndex\":\"19a3c101-ad2e-4421-a71b-a4734ec1f03e\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_19a3c101-ad2e-4421-a71b-a4734ec1f03e\"},{\"version\":\"8.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":36,\"y\":0,\"w\":12,\"h\":7,\"i\":\"491469e7-7d24-4216-aeb3-bca00e5c8c1b\"},\"panelIndex\":\"491469e7-7d24-4216-aeb3-bca00e5c8c1b\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_491469e7-7d24-4216-aeb3-bca00e5c8c1b\"},{\"version\":\"8.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":7,\"w\":24,\"h\":7,\"i\":\"7077b79f-2a99-4fcb-bbd4-456982843278\"},\"panelIndex\":\"7077b79f-2a99-4fcb-bbd4-456982843278\",\"embeddableConfig\":{\"enhancements\":{},\"hidePanelTitles\":false},\"title\":\"% of target revenue ($10k)\",\"panelRefName\":\"panel_7077b79f-2a99-4fcb-bbd4-456982843278\"},{\"version\":\"8.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":24,\"y\":7,\"w\":12,\"h\":7,\"i\":\"da51079b-952f-43dc-96e6-6f9415a3708b\"},\"panelIndex\":\"da51079b-952f-43dc-96e6-6f9415a3708b\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_da51079b-952f-43dc-96e6-6f9415a3708b\"},{\"version\":\"8.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":14,\"w\":24,\"h\":7,\"i\":\"a1b03eb9-a36b-4e12-aa1b-bb29b5d6c4ef\"},\"panelIndex\":\"a1b03eb9-a36b-4e12-aa1b-bb29b5d6c4ef\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_a1b03eb9-a36b-4e12-aa1b-bb29b5d6c4ef\"},{\"version\":\"8.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":24,\"y\":14,\"w\":24,\"h\":17,\"i\":\"64fd5dcf-30c5-4f5a-a78c-70b1fbf87e5b\"},\"panelIndex\":\"64fd5dcf-30c5-4f5a-a78c-70b1fbf87e5b\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_64fd5dcf-30c5-4f5a-a78c-70b1fbf87e5b\"},{\"version\":\"8.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":31,\"w\":24,\"h\":9,\"i\":\"b897d4be-cf83-46fb-a111-c7fbec9ef403\"},\"panelIndex\":\"b897d4be-cf83-46fb-a111-c7fbec9ef403\",\"embeddableConfig\":{\"hidePanelTitles\":false,\"enhancements\":{}},\"title\":\"Top products this week\",\"panelRefName\":\"panel_b897d4be-cf83-46fb-a111-c7fbec9ef403\"},{\"version\":\"8.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":24,\"y\":31,\"w\":24,\"h\":18,\"i\":\"bd330ede-2eef-4e2a-8100-22a21abf5038\"},\"panelIndex\":\"bd330ede-2eef-4e2a-8100-22a21abf5038\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_bd330ede-2eef-4e2a-8100-22a21abf5038\"},{\"version\":\"8.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":40,\"w\":24,\"h\":9,\"i\":\"e0f68f93-30f2-4da7-889a-6cd128a68d3f\"},\"panelIndex\":\"e0f68f93-30f2-4da7-889a-6cd128a68d3f\",\"embeddableConfig\":{\"timeRange\":{\"from\":\"now-2w\",\"to\":\"now-1w\"},\"hidePanelTitles\":false,\"enhancements\":{}},\"title\":\"Top products last week\",\"panelRefName\":\"panel_e0f68f93-30f2-4da7-889a-6cd128a68d3f\"}]", + "refreshInterval": { + "pause": true, + "value": 0 + }, + "timeTo": "2022-10-25T20:00:00.000Z", + "timeFrom": "2022-10-18T20:00:00.000Z", + "timeRestore": true, + "title": "[eCommerce] Revenue Dashboard", + "version": 1 + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-25T16:46:23.117Z", + "id": "722b74f0-b882-11e8-a6d9-e546fe2bba5f", + "migrationVersion": { + "dashboard": "8.6.0" + }, + "references": [ + { + "id": "45e07720-b890-11e8-a6d9-e546fe2bba5f", + "name": "5:panel_5", + "type": "visualization" + }, + { + "id": "b80e6540-b891-11e8-a6d9-e546fe2bba5f", + "name": "7:panel_7", + "type": "visualization" + }, + { + "id": "3ba638e0-b894-11e8-a6d9-e546fe2bba5f", + "name": "10:panel_10", + "type": "search" + }, + { + "id": "c00d1f90-f5ea-11eb-a78e-83aac3c38a60", + "name": "a71cf076-6895-491c-8878-63592e429ed5:panel_a71cf076-6895-491c-8878-63592e429ed5", + "type": "visualization" + }, + { + "id": "ce02e260-f5ea-11eb-a78e-83aac3c38a60", + "name": "19a3c101-ad2e-4421-a71b-a4734ec1f03e:panel_19a3c101-ad2e-4421-a71b-a4734ec1f03e", + "type": "lens" + }, + { + "id": "d5f90030-f5ea-11eb-a78e-83aac3c38a60", + "name": "491469e7-7d24-4216-aeb3-bca00e5c8c1b:panel_491469e7-7d24-4216-aeb3-bca00e5c8c1b", + "type": "lens" + }, + { + "id": "c762b7a0-f5ea-11eb-a78e-83aac3c38a60", + "name": "7077b79f-2a99-4fcb-bbd4-456982843278:panel_7077b79f-2a99-4fcb-bbd4-456982843278", + "type": "lens" + }, + { + "id": "e3902840-f5ea-11eb-a78e-83aac3c38a60", + "name": "da51079b-952f-43dc-96e6-6f9415a3708b:panel_da51079b-952f-43dc-96e6-6f9415a3708b", + "type": "lens" + }, + { + "id": "dde978b0-f5ea-11eb-a78e-83aac3c38a60", + "name": "a1b03eb9-a36b-4e12-aa1b-bb29b5d6c4ef:panel_a1b03eb9-a36b-4e12-aa1b-bb29b5d6c4ef", + "type": "lens" + }, + { + "id": "eddf7850-f5ea-11eb-a78e-83aac3c38a60", + "name": "64fd5dcf-30c5-4f5a-a78c-70b1fbf87e5b:panel_64fd5dcf-30c5-4f5a-a78c-70b1fbf87e5b", + "type": "lens" + }, + { + "id": "03071e90-f5eb-11eb-a78e-83aac3c38a60", + "name": "b897d4be-cf83-46fb-a111-c7fbec9ef403:panel_b897d4be-cf83-46fb-a111-c7fbec9ef403", + "type": "lens" + }, + { + "id": "ff6a21b0-f5ea-11eb-a78e-83aac3c38a60", + "name": "bd330ede-2eef-4e2a-8100-22a21abf5038:panel_bd330ede-2eef-4e2a-8100-22a21abf5038", + "type": "lens" + }, + { + "id": "06379e00-f5eb-11eb-a78e-83aac3c38a60", + "name": "e0f68f93-30f2-4da7-889a-6cd128a68d3f:panel_e0f68f93-30f2-4da7-889a-6cd128a68d3f", + "type": "lens" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_1ee1617f-fd8e-45e4-bc6a-d5736710ea20:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_afa9fa0f-a002-41a5-bab9-b738316d2590:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_d3f766cb-5f96-4a12-8d3c-034e08be8855:rangeSliderDataView", + "type": "index-pattern" + } + ], + "type": "dashboard", + "updated_at": "2022-10-25T16:46:23.117Z", + "version": "WzI0OSwxXQ==" +} diff --git a/x-pack/performance/kbn_archives/ecommerce_saved_search_only_dashboard.json b/x-pack/performance/kbn_archives/ecommerce_saved_search_only_dashboard.json new file mode 100644 index 0000000000000..bfec7da206c75 --- /dev/null +++ b/x-pack/performance/kbn_archives/ecommerce_saved_search_only_dashboard.json @@ -0,0 +1,121 @@ +{ + "attributes": { + "fieldAttrs": "{\"products.manufacturer\":{\"count\":1},\"products.price\":{\"count\":1},\"products.product_name\":{\"count\":1},\"total_quantity\":{\"count\":1}}", + "fieldFormatMap": "{\"taxful_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}},\"products.price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"taxless_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxless_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxful_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.min_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_unit_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}}}", + "fields": "[]", + "name": "Kibana Sample Data eCommerce", + "runtimeFieldMap": "{}", + "timeFieldName": "order_date", + "title": "kibana_sample_data_ecommerce", + "typeMeta": "{}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-31T12:06:45.150Z", + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "migrationVersion": { + "index-pattern": "8.0.0" + }, + "references": [], + "type": "index-pattern", + "updated_at": "2022-10-31T12:06:45.150Z", + "version": "WzEzNywxXQ==" +} + +{ + "attributes": { + "columns": [ + "category", + "taxful_total_price", + "products.price", + "products.product_name", + "products.manufacturer", + "sku" + ], + "description": "", + "hits": 0, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "sort": [ + [ + "order_date", + "desc" + ] + ], + "title": "[eCommerce] Orders", + "version": 1 + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-31T12:06:45.150Z", + "id": "3ba638e0-b894-11e8-a6d9-e546fe2bba5f", + "migrationVersion": { + "search": "8.0.0" + }, + "references": [ + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + } + ], + "type": "search", + "updated_at": "2022-10-31T12:06:45.150Z", + "version": "WzE0MCwxXQ==" +} + +{ + "attributes": { + "controlGroupInput": { + "chainingSystem": "HIERARCHICAL", + "controlStyle": "oneLine", + "ignoreParentSettingsJSON": "{\"ignoreFilters\":false,\"ignoreQuery\":false,\"ignoreTimerange\":false,\"ignoreValidations\":false}", + "panelsJSON": "{\"1ee1617f-fd8e-45e4-bc6a-d5736710ea20\":{\"order\":0,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"title\":\"Manufacturer\",\"fieldName\":\"manufacturer.keyword\",\"parentFieldName\":\"manufacturer\",\"id\":\"1ee1617f-fd8e-45e4-bc6a-d5736710ea20\",\"enhancements\":{}}},\"afa9fa0f-a002-41a5-bab9-b738316d2590\":{\"order\":1,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"title\":\"Category\",\"fieldName\":\"category.keyword\",\"parentFieldName\":\"category\",\"id\":\"afa9fa0f-a002-41a5-bab9-b738316d2590\",\"enhancements\":{}}},\"d3f766cb-5f96-4a12-8d3c-034e08be8855\":{\"order\":2,\"width\":\"small\",\"grow\":true,\"type\":\"rangeSliderControl\",\"explicitInput\":{\"title\":\"Quantity\",\"fieldName\":\"total_quantity\",\"id\":\"d3f766cb-5f96-4a12-8d3c-034e08be8855\",\"enhancements\":{}}}}" + }, + "description": "Analyze mock eCommerce orders and revenue", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}" + }, + "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", + "panelsJSON": "[{\"version\":\"8.6.0\",\"type\":\"search\",\"gridData\":{\"x\":0,\"y\":0,\"w\":48,\"h\":18,\"i\":\"10\"},\"panelIndex\":\"10\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_10\"}]", + "refreshInterval": { + "pause": true, + "value": 0 + }, + "timeTo": "2022-10-25T20:00:00.000Z", + "timeFrom": "2022-10-18T20:00:00.000Z", + "timeRestore": true, + "title": "[eCommerce] Saved Search Dashboard", + "version": 1 + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-31T12:08:58.731Z", + "id": "ccb9a590-5914-11ed-8d12-9d4a72794439", + "migrationVersion": { + "dashboard": "8.6.0" + }, + "references": [ + { + "id": "3ba638e0-b894-11e8-a6d9-e546fe2bba5f", + "name": "10:panel_10", + "type": "search" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_1ee1617f-fd8e-45e4-bc6a-d5736710ea20:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_afa9fa0f-a002-41a5-bab9-b738316d2590:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_d3f766cb-5f96-4a12-8d3c-034e08be8855:rangeSliderDataView", + "type": "index-pattern" + } + ], + "type": "dashboard", + "updated_at": "2022-10-31T12:08:58.731Z", + "version": "WzI1NCwxXQ==" +} diff --git a/x-pack/performance/kbn_archives/ecommerce_tsvb_gauge_only_dashboard.json b/x-pack/performance/kbn_archives/ecommerce_tsvb_gauge_only_dashboard.json new file mode 100644 index 0000000000000..1237d5c825f1a --- /dev/null +++ b/x-pack/performance/kbn_archives/ecommerce_tsvb_gauge_only_dashboard.json @@ -0,0 +1,108 @@ +{ + "attributes": { + "fieldAttrs": "{\"products.manufacturer\":{\"count\":1},\"products.price\":{\"count\":1},\"products.product_name\":{\"count\":1},\"total_quantity\":{\"count\":1}}", + "fieldFormatMap": "{\"taxful_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}},\"products.price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"taxless_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxless_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxful_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.min_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_unit_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}}}", + "fields": "[]", + "name": "Kibana Sample Data eCommerce", + "runtimeFieldMap": "{}", + "timeFieldName": "order_date", + "title": "kibana_sample_data_ecommerce", + "typeMeta": "{}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-31T12:48:03.382Z", + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "migrationVersion": { + "index-pattern": "8.0.0" + }, + "references": [], + "type": "index-pattern", + "updated_at": "2022-10-31T12:48:03.382Z", + "version": "WzM1NCwxXQ==" +} + +{ + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" + }, + "title": "[eCommerce] Sold Products per Day", + "uiStateJSON": "{}", + "version": 1, + "visState": "{\"title\":\"[eCommerce] Sold Products per Day\",\"type\":\"metrics\",\"aggs\":[],\"params\":{\"time_range_mode\":\"entire_time_range\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"gauge\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"count\"},{\"id\":\"fd1e1b90-e4e3-11eb-8234-cb7bfd534fce\",\"type\":\"math\",\"variables\":[{\"id\":\"00374270-e4e4-11eb-8234-cb7bfd534fce\",\"name\":\"c\",\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\"}],\"script\":\"params.c / (params._interval / 1000 / 60 / 60 / 24)\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"0.0\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Trxns / day\",\"split_color_mode\":\"gradient\",\"value_template\":\"\"}],\"time_field\":\"order_date\",\"interval\":\"1d\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"gauge_color_rules\":[{\"value\":150,\"id\":\"6da070c0-b891-11e8-b645-195edeb9de84\",\"gauge\":\"rgba(104,188,0,1)\",\"operator\":\"gte\"},{\"value\":150,\"id\":\"9b0cdbc0-b891-11e8-b645-195edeb9de84\",\"gauge\":\"rgba(244,78,59,1)\",\"operator\":\"lt\"}],\"gauge_width\":\"15\",\"gauge_inner_width\":\"10\",\"gauge_style\":\"half\",\"filter\":\"\",\"gauge_max\":\"300\",\"use_kibana_indexes\":true,\"hide_last_value_indicator\":true,\"tooltip_mode\":\"show_all\",\"drop_last_bucket\":0,\"isModelInvalid\":false,\"index_pattern_ref_name\":\"metrics_0_index_pattern\"}}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-31T12:48:03.382Z", + "id": "b80e6540-b891-11e8-a6d9-e546fe2bba5f", + "migrationVersion": { + "visualization": "8.5.0" + }, + "references": [ + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "metrics_0_index_pattern", + "type": "index-pattern" + } + ], + "type": "visualization", + "updated_at": "2022-10-31T12:48:03.382Z", + "version": "WzM1NiwxXQ==" +} + +{ + "attributes": { + "controlGroupInput": { + "chainingSystem": "HIERARCHICAL", + "controlStyle": "oneLine", + "ignoreParentSettingsJSON": "{\"ignoreFilters\":false,\"ignoreQuery\":false,\"ignoreTimerange\":false,\"ignoreValidations\":false}", + "panelsJSON": "{\"1ee1617f-fd8e-45e4-bc6a-d5736710ea20\":{\"order\":0,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"title\":\"Manufacturer\",\"fieldName\":\"manufacturer.keyword\",\"parentFieldName\":\"manufacturer\",\"id\":\"1ee1617f-fd8e-45e4-bc6a-d5736710ea20\",\"enhancements\":{}}},\"afa9fa0f-a002-41a5-bab9-b738316d2590\":{\"order\":1,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"title\":\"Category\",\"fieldName\":\"category.keyword\",\"parentFieldName\":\"category\",\"id\":\"afa9fa0f-a002-41a5-bab9-b738316d2590\",\"enhancements\":{}}},\"d3f766cb-5f96-4a12-8d3c-034e08be8855\":{\"order\":2,\"width\":\"small\",\"grow\":true,\"type\":\"rangeSliderControl\",\"explicitInput\":{\"title\":\"Quantity\",\"fieldName\":\"total_quantity\",\"id\":\"d3f766cb-5f96-4a12-8d3c-034e08be8855\",\"enhancements\":{}}}}" + }, + "description": "Analyze mock eCommerce orders and revenue", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}" + }, + "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", + "panelsJSON": "[{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":0,\"y\":0,\"w\":48,\"h\":19,\"i\":\"7\"},\"panelIndex\":\"7\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_7\"}]", + "refreshInterval": { + "pause": true, + "value": 0 + }, + "timeTo": "2022-10-25T20:00:00.000Z", + "timeFrom": "2022-10-18T20:00:00.000Z", + "timeRestore": true, + "title": "[eCommerce] TSVB Gauge Only Dashboard", + "version": 1 + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-31T12:51:08.112Z", + "id": "b05a8ee0-591a-11ed-8d12-9d4a72794439", + "migrationVersion": { + "dashboard": "8.6.0" + }, + "references": [ + { + "id": "b80e6540-b891-11e8-a6d9-e546fe2bba5f", + "name": "7:panel_7", + "type": "visualization" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_1ee1617f-fd8e-45e4-bc6a-d5736710ea20:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_afa9fa0f-a002-41a5-bab9-b738316d2590:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f", + "name": "controlGroup_d3f766cb-5f96-4a12-8d3c-034e08be8855:rangeSliderDataView", + "type": "index-pattern" + } + ], + "type": "dashboard", + "updated_at": "2022-10-31T12:51:08.112Z", + "version": "WzQ2MywxXQ==" +} diff --git a/x-pack/performance/kbn_archives/flights_no_map_dashboard.json b/x-pack/performance/kbn_archives/flights_no_map_dashboard.json new file mode 100644 index 0000000000000..f0afa9052ddae --- /dev/null +++ b/x-pack/performance/kbn_archives/flights_no_map_dashboard.json @@ -0,0 +1,338 @@ +{ + "attributes": { + "fieldFormatMap": "{\"hour_of_day\":{\"id\":\"number\",\"params\":{\"pattern\":\"00\"}},\"AvgTicketPrice\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}}}", + "name": "Kibana Sample Data Flights", + "runtimeFieldMap": "{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}", + "timeFieldName": "timestamp", + "title": "kibana_sample_data_flights" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T12:29:52.447Z", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "migrationVersion": { + "index-pattern": "8.0.0" + }, + "references": [], + "type": "index-pattern", + "updated_at": "2022-10-26T12:29:52.447Z", + "version": "WzEzNCwxXQ==" +} + +{ + "attributes": { + "columns": [ + "Carrier", + "OriginCityName", + "OriginCountry", + "DestCityName", + "DestCountry", + "FlightTimeMin", + "AvgTicketPrice", + "Cancelled", + "FlightDelayType" + ], + "description": "", + "hits": 0, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"highlightAll\":true,\"version\":true,\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "sort": [ + [ + "timestamp", + "desc" + ] + ], + "title": "[Flights] Flight Log", + "version": 1 + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T12:29:52.447Z", + "id": "571aaf70-4c88-11e8-b3d7-01146121b73d", + "migrationVersion": { + "search": "8.0.0" + }, + "references": [ + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + } + ], + "type": "search", + "updated_at": "2022-10-26T12:29:52.447Z", + "version": "WzEyOCwxXQ==" +} + +{ + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{}" + }, + "title": "[Flights] Delays & Cancellations", + "uiStateJSON": "{}", + "version": 1, + "visState": "{\"title\":\"[Flights] Delays & Cancellations\",\"type\":\"metrics\",\"aggs\":[],\"params\":{\"time_range_mode\":\"entire_time_range\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"rgba(0,156,224,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"filter_ratio\",\"numerator\":{\"query\":\"FlightDelay:true\",\"language\":\"lucene\"}}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"percent\",\"chart_type\":\"line\",\"line_width\":\"2\",\"point_size\":\"0\",\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Percent Delays\",\"split_color_mode\":\"gradient\"}],\"time_field\":\"timestamp\",\"interval\":\">=1h\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":0,\"show_grid\":1,\"annotations\":[{\"fields\":\"FlightDelay,Cancelled,Carrier\",\"template\":\"{{Carrier}}: Flight Delayed and Cancelled!\",\"query_string\":{\"query\":\"FlightDelay:true AND Cancelled:true\",\"language\":\"lucene\"},\"id\":\"53b7dff0-4c89-11e8-a66a-6989ad5a0a39\",\"color\":\"rgba(0,98,177,1)\",\"time_field\":\"timestamp\",\"icon\":\"fa-exclamation-triangle\",\"ignore_global_filters\":1,\"ignore_panel_filters\":1,\"index_pattern_ref_name\":\"metrics_1_index_pattern\"}],\"legend_position\":\"bottom\",\"use_kibana_indexes\":true,\"axis_scale\":\"normal\",\"tooltip_mode\":\"show_all\",\"drop_last_bucket\":0,\"isModelInvalid\":false,\"axis_max\":\"1\",\"index_pattern_ref_name\":\"metrics_0_index_pattern\"}}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T12:29:52.447Z", + "id": "bcb63b50-4c89-11e8-b3d7-01146121b73d", + "migrationVersion": { + "visualization": "8.5.0" + }, + "references": [ + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "metrics_0_index_pattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "metrics_1_index_pattern", + "type": "index-pattern" + } + ], + "type": "visualization", + "updated_at": "2022-10-26T12:29:52.447Z", + "version": "WzEyOSwxXQ==" +} + +{ + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[{\"meta\":{\"negate\":true,\"disabled\":false,\"alias\":null,\"type\":\"phrase\",\"key\":\"FlightDelayMin\",\"value\":\"0\",\"params\":{\"query\":0,\"type\":\"phrase\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\"},\"query\":{\"match\":{\"FlightDelayMin\":{\"query\":0,\"type\":\"phrase\"}}},\"$state\":{\"store\":\"appState\"}}],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "title": "[Flights] Delay Buckets", + "uiStateJSON": "{\"vis\":{\"legendOpen\":false}}", + "version": 1, + "visState": "{\"title\":\"[Flights] Delay Buckets\",\"type\":\"histogram\",\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"params\":{},\"schema\":\"metric\"},{\"id\":\"2\",\"enabled\":true,\"type\":\"histogram\",\"params\":{\"field\":\"FlightDelayMin\",\"interval\":30,\"used_interval\":30,\"min_doc_count\":false,\"has_extended_bounds\":false,\"extended_bounds\":{},\"customLabel\":\"Flight Delay Minutes\"},\"schema\":\"segment\"}],\"params\":{\"type\":\"histogram\",\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100,\"filter\":true,\"rotate\":0},\"title\":{}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":\"true\",\"type\":\"histogram\",\"mode\":\"stacked\",\"data\":{\"label\":\"Count\",\"id\":\"1\"},\"valueAxis\":\"ValueAxis-1\",\"drawLinesBetweenPoints\":true,\"showCircles\":true}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false,\"detailedTooltip\":true,\"palette\":{\"type\":\"palette\",\"name\":\"default\"},\"isVislibVis\":true,\"radiusRatio\":0,\"labels\":{\"show\":false},\"thresholdLine\":{\"show\":false,\"value\":10,\"width\":1,\"style\":\"full\",\"color\":\"#E7664C\"},\"legendSize\":\"auto\"}}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T12:29:52.447Z", + "id": "9886b410-4c8b-11e8-b3d7-01146121b73d", + "migrationVersion": { + "visualization": "8.5.0" + }, + "references": [ + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index", + "type": "index-pattern" + } + ], + "type": "visualization", + "updated_at": "2022-10-26T12:29:52.447Z", + "version": "WzEzMCwxXQ==" +} + +{ + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "title": "[Flights] Destination Weather", + "uiStateJSON": "{}", + "version": 1, + "visState": "{\"title\":\"[Flights] Destination Weather\",\"type\":\"tagcloud\",\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"params\":{},\"schema\":\"metric\"},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"params\":{\"field\":\"DestWeather\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":10,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\"},\"schema\":\"segment\"}],\"params\":{\"scale\":\"linear\",\"orientation\":\"single\",\"minFontSize\":12,\"maxFontSize\":46,\"showLabel\":false,\"palette\":{\"type\":\"palette\",\"name\":\"temperature\"}}}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T12:29:52.447Z", + "id": "293b5a30-4c8f-11e8-b3d7-01146121b73d", + "migrationVersion": { + "visualization": "8.5.0" + }, + "references": [ + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + } + ], + "type": "visualization", + "updated_at": "2022-10-26T12:29:52.447Z", + "version": "WzEzMSwxXQ==" +} + +{ + "attributes": { + "controlGroupInput": { + "chainingSystem": "HIERARCHICAL", + "controlStyle": "oneLine", + "ignoreParentSettingsJSON": "{\"ignoreFilters\":false,\"ignoreQuery\":false,\"ignoreTimerange\":false,\"ignoreValidations\":false}", + "panelsJSON": "{\"85b632c8-3b7b-408d-8223-b0caccf75bd3\":{\"order\":0,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"title\":\"Origin City\",\"fieldName\":\"OriginCityName\",\"id\":\"85b632c8-3b7b-408d-8223-b0caccf75bd3\",\"selectedOptions\":[],\"enhancements\":{}}},\"d4dc9d2b-5850-402a-921d-8a2cd0107156\":{\"order\":1,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"title\":\"Destination City\",\"fieldName\":\"DestCityName\",\"id\":\"d4dc9d2b-5850-402a-921d-8a2cd0107156\",\"enhancements\":{}}},\"bee4a16a-f5c1-40b2-887e-db1b9ad9e15f\":{\"order\":2,\"width\":\"small\",\"grow\":true,\"type\":\"rangeSliderControl\",\"explicitInput\":{\"title\":\"Average Ticket Price\",\"fieldName\":\"AvgTicketPrice\",\"id\":\"bee4a16a-f5c1-40b2-887e-db1b9ad9e15f\",\"enhancements\":{}}}}" + }, + "description": "Analyze mock flight data for ES-Air, Logstash Airways, Kibana Airlines and JetBeats", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}" + }, + "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", + "panelsJSON": "[{\"version\":\"8.6.0\",\"type\":\"search\",\"gridData\":{\"x\":0,\"y\":47,\"w\":48,\"h\":15,\"i\":\"4\"},\"panelIndex\":\"4\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_4\"},{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":0,\"y\":16,\"w\":24,\"h\":9,\"i\":\"7\"},\"panelIndex\":\"7\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_7\"},{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":0,\"y\":36,\"w\":24,\"h\":11,\"i\":\"10\"},\"panelIndex\":\"10\",\"embeddableConfig\":{\"vis\":{\"colors\":{\"Count\":\"#1F78C1\"},\"legendOpen\":false},\"enhancements\":{}},\"panelRefName\":\"panel_10\"},{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":36,\"y\":36,\"w\":12,\"h\":11,\"i\":\"21\"},\"panelIndex\":\"21\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_21\"},{\"version\":\"8.6.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.6.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\":\"lnsLegacyMetric\",\"state\":{\"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\":{}}}}},\"visualization\":{\"layerId\":\"8fa993db-c147-4954-adf7-4ff264d42576\",\"accessor\":\"81124c45-6ab6-42f4-8859-495d55eb8065\",\"layerType\":\"data\",\"textAlign\":\"center\",\"titlePosition\":\"bottom\",\"size\":\"xl\"},\"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-8fa993db-c147-4954-adf7-4ff264d42576\",\"type\":\"index-pattern\"}]},\"hidePanelTitles\":true}},{\"version\":\"8.6.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\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsLegacyMetric\",\"state\":{\"datasourceStates\":{\"formBased\":{\"layers\":{\"b4712d43-1e84-4f5b-878d-8e38ba748317\":{\"columns\":{\"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},\"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}},\"columnOrder\":[\"7e8fe9b1-f45c-4f3d-9561-30febcd357ec\",\"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0\",\"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1\",\"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2\"],\"incompleteColumns\":{}}}}},\"visualization\":{\"layerId\":\"b4712d43-1e84-4f5b-878d-8e38ba748317\",\"accessor\":\"7e8fe9b1-f45c-4f3d-9561-30febcd357ec\",\"layerType\":\"data\",\"textAlign\":\"center\",\"titlePosition\":\"bottom\",\"size\":\"xl\"},\"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-b4712d43-1e84-4f5b-878d-8e38ba748317\",\"type\":\"index-pattern\"}]},\"enhancements\":{}}},{\"version\":\"8.6.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\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsLegacyMetric\",\"state\":{\"datasourceStates\":{\"formBased\":{\"layers\":{\"b4712d43-1e84-4f5b-878d-8e38ba748317\":{\"columns\":{\"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},\"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-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}},\"columnOrder\":[\"c7851241-5526-499a-960b-357af8c2ce5b\",\"c7851241-5526-499a-960b-357af8c2ce5bX2\",\"c7851241-5526-499a-960b-357af8c2ce5bX0\",\"c7851241-5526-499a-960b-357af8c2ce5bX1\"],\"incompleteColumns\":{}}}}},\"visualization\":{\"layerId\":\"b4712d43-1e84-4f5b-878d-8e38ba748317\",\"accessor\":\"c7851241-5526-499a-960b-357af8c2ce5b\",\"layerType\":\"data\",\"textAlign\":\"center\",\"titlePosition\":\"bottom\",\"size\":\"xl\"},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[{\"meta\":{\"alias\":null,\"negate\":false,\"disabled\":false,\"type\":\"phrase\",\"key\":\"FlightDelay\",\"params\":{\"query\":true},\"index\":\"filter-index-pattern-0\"},\"query\":{\"match_phrase\":{\"FlightDelay\":true}},\"$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-b4712d43-1e84-4f5b-878d-8e38ba748317\",\"type\":\"index-pattern\"},{\"id\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"name\":\"filter-index-pattern-0\",\"type\":\"index-pattern\"}]},\"enhancements\":{}}},{\"version\":\"8.6.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\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsLegacyMetric\",\"state\":{\"datasourceStates\":{\"formBased\":{\"layers\":{\"b4712d43-1e84-4f5b-878d-8e38ba748317\":{\"columns\":{\"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},\"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}},\"columnOrder\":[\"7e8fe9b1-f45c-4f3d-9561-30febcd357ec\",\"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0\",\"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1\",\"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2\"],\"incompleteColumns\":{}}}}},\"visualization\":{\"layerId\":\"b4712d43-1e84-4f5b-878d-8e38ba748317\",\"accessor\":\"7e8fe9b1-f45c-4f3d-9561-30febcd357ec\",\"layerType\":\"data\",\"textAlign\":\"center\",\"titlePosition\":\"bottom\",\"size\":\"xl\"},\"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-b4712d43-1e84-4f5b-878d-8e38ba748317\",\"type\":\"index-pattern\"}]},\"enhancements\":{}}},{\"version\":\"8.6.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\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsLegacyMetric\",\"state\":{\"datasourceStates\":{\"formBased\":{\"layers\":{\"b4712d43-1e84-4f5b-878d-8e38ba748317\":{\"columns\":{\"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},\"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-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}},\"columnOrder\":[\"c7851241-5526-499a-960b-357af8c2ce5b\",\"c7851241-5526-499a-960b-357af8c2ce5bX2\",\"c7851241-5526-499a-960b-357af8c2ce5bX0\",\"c7851241-5526-499a-960b-357af8c2ce5bX1\"],\"incompleteColumns\":{}}}}},\"visualization\":{\"layerId\":\"b4712d43-1e84-4f5b-878d-8e38ba748317\",\"accessor\":\"c7851241-5526-499a-960b-357af8c2ce5b\",\"layerType\":\"data\",\"textAlign\":\"center\",\"titlePosition\":\"bottom\",\"size\":\"xl\"},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[{\"meta\":{\"alias\":null,\"negate\":false,\"disabled\":false,\"type\":\"phrase\",\"key\":\"Cancelled\",\"params\":{\"query\":true},\"index\":\"filter-index-pattern-0\"},\"query\":{\"match_phrase\":{\"Cancelled\":true}},\"$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-b4712d43-1e84-4f5b-878d-8e38ba748317\",\"type\":\"index-pattern\"},{\"id\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"name\":\"filter-index-pattern-0\",\"type\":\"index-pattern\"}]},\"enhancements\":{}}},{\"version\":\"8.6.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.6.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.6.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.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":24,\"y\":36,\"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\",\"metric\":\"aa152ace-ee2d-447b-b86d-459bef4d7880\",\"numberDisplay\":\"percent\",\"categoryDisplay\":\"default\",\"legendDisplay\":\"default\",\"nestedLegend\":false,\"layerType\":\"data\",\"legendSize\":\"auto\",\"primaryGroups\":[\"d1cee8bf-34cf-4141-99d7-ff043ee77b56\"]}]},\"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\"}]", + "refreshInterval": { + "pause": true, + "value": 0 + }, + "timeTo": "2022-10-26T09:00:00.000Z", + "timeFrom": "2022-10-19T09:00:00.000Z", + "timeRestore": true, + "title": "[Flights] Global Flight Dashboard", + "version": 1 + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T12:38:31.278Z", + "id": "7adfa750-4c81-11e8-b3d7-01146121b73d", + "migrationVersion": { + "dashboard": "8.6.0" + }, + "references": [ + { + "id": "571aaf70-4c88-11e8-b3d7-01146121b73d", + "name": "4:panel_4", + "type": "search" + }, + { + "id": "bcb63b50-4c89-11e8-b3d7-01146121b73d", + "name": "7:panel_7", + "type": "visualization" + }, + { + "id": "9886b410-4c8b-11e8-b3d7-01146121b73d", + "name": "10:panel_10", + "type": "visualization" + }, + { + "id": "293b5a30-4c8f-11e8-b3d7-01146121b73d", + "name": "21:panel_21", + "type": "visualization" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "392b4936-f753-47bc-a98d-a4e41a0a4cd4:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "392b4936-f753-47bc-a98d-a4e41a0a4cd4:indexpattern-datasource-layer-8fa993db-c147-4954-adf7-4ff264d42576", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "9271deff-5a61-4665-83fc-f9fdc6bf0c0b:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "9271deff-5a61-4665-83fc-f9fdc6bf0c0b:indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "aa591c29-1a31-4ee1-a71d-b829c06fd162:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "aa591c29-1a31-4ee1-a71d-b829c06fd162:indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "aa591c29-1a31-4ee1-a71d-b829c06fd162:filter-index-pattern-0", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "b766e3b8-4544-46ed-99e6-9ecc4847e2a2:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "b766e3b8-4544-46ed-99e6-9ecc4847e2a2:indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "2e33ade5-96e5-40b4-b460-493e5d4fa834:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "2e33ade5-96e5-40b4-b460-493e5d4fa834:indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "2e33ade5-96e5-40b4-b460-493e5d4fa834:filter-index-pattern-0", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "086ac2e9-dd16-4b45-92b8-1e43ff7e3f65:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "086ac2e9-dd16-4b45-92b8-1e43ff7e3f65:indexpattern-datasource-layer-03c34665-471c-49c7-acf1-5a11f517421c", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "fb86b32f-fb7a-45cf-9511-f366fef51bbd:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "fb86b32f-fb7a-45cf-9511-f366fef51bbd:indexpattern-datasource-layer-f26e8f7a-4118-4227-bea0-5c02d8b270f7", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "0cc42484-16f7-42ec-b38c-9bf8be69cde7:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "0cc42484-16f7-42ec-b38c-9bf8be69cde7:indexpattern-datasource-layer-e80cc05e-c52a-4e5f-ac71-4b37274867f5", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "5d53db36-2d5a-4adc-af7b-cec4c1a294e0:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "5d53db36-2d5a-4adc-af7b-cec4c1a294e0:indexpattern-datasource-layer-0c8e136b-a822-4fb3-836d-e06cbea4eea4", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "5d53db36-2d5a-4adc-af7b-cec4c1a294e0:filter-index-pattern-0", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "controlGroup_85b632c8-3b7b-408d-8223-b0caccf75bd3:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "controlGroup_d4dc9d2b-5850-402a-921d-8a2cd0107156:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "controlGroup_bee4a16a-f5c1-40b2-887e-db1b9ad9e15f:rangeSliderDataView", + "type": "index-pattern" + } + ], + "type": "dashboard", + "updated_at": "2022-10-26T12:38:31.278Z", + "version": "WzE4MywxXQ==" +} diff --git a/x-pack/performance/kbn_archives/logs_no_map_dashboard.json b/x-pack/performance/kbn_archives/logs_no_map_dashboard.json new file mode 100644 index 0000000000000..af22a152e48eb --- /dev/null +++ b/x-pack/performance/kbn_archives/logs_no_map_dashboard.json @@ -0,0 +1,473 @@ +{ + "attributes": { + "fieldFormatMap": "{\"hour_of_day\":{}}", + "name": "Kibana Sample Data Logs", + "runtimeFieldMap": "{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}", + "timeFieldName": "timestamp", + "title": "kibana_sample_data_logs" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T13:11:17.374Z", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "migrationVersion": { + "index-pattern": "8.0.0" + }, + "references": [], + "type": "index-pattern", + "updated_at": "2022-10-26T13:11:17.374Z", + "version": "WzEzNiwxXQ==" +} + +{ + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" + }, + "title": "[Logs] Host, Visits and Bytes Table", + "uiStateJSON": "{}", + "version": 1, + "visState": "{\"title\":\"[Logs] Host, Visits and Bytes Table\",\"type\":\"metrics\",\"aggs\":[],\"params\":{\"time_range_mode\":\"last_value\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"table\",\"series\":[{\"id\":\"bd09d600-e5b1-11e7-bfc2-a1f7e71965a1\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"bd09d601-e5b1-11e7-bfc2-a1f7e71965a1\",\"type\":\"sum\",\"field\":\"bytes\"},{\"sigma\":\"\",\"id\":\"c9514c90-e5b1-11e7-bfc2-a1f7e71965a1\",\"type\":\"sum_bucket\",\"field\":\"bd09d601-e5b1-11e7-bfc2-a1f7e71965a1\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"color_rules\":[{\"id\":\"c0c668d0-e5b1-11e7-bfc2-a1f7e71965a1\"}],\"label\":\"Bytes (Total)\",\"split_color_mode\":\"gradient\"},{\"id\":\"b7672c30-a6df-11e8-8b18-1da1dfc50975\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"b7672c31-a6df-11e8-8b18-1da1dfc50975\",\"type\":\"sum\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"color_rules\":[{\"id\":\"c0c668d0-e5b1-11e7-bfc2-a1f7e71965a1\"}],\"label\":\"Bytes (Last Hour)\",\"split_color_mode\":\"gradient\",\"trend_arrows\":1},{\"id\":\"f2c20700-a6df-11e8-8b18-1da1dfc50975\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"f2c20701-a6df-11e8-8b18-1da1dfc50975\",\"type\":\"cardinality\",\"field\":\"clientip\"},{\"sigma\":\"\",\"id\":\"f46333e0-a6df-11e8-8b18-1da1dfc50975\",\"type\":\"sum_bucket\",\"field\":\"f2c20701-a6df-11e8-8b18-1da1dfc50975\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Unique Visits (Total)\",\"color_rules\":[{\"value\":1000,\"id\":\"2e963080-a6e0-11e8-8b18-1da1dfc50975\",\"text\":\"rgba(211,49,21,1)\",\"operator\":\"lt\"},{\"value\":1000,\"id\":\"3d4fb880-a6e0-11e8-8b18-1da1dfc50975\",\"text\":\"rgba(252,196,0,1)\",\"operator\":\"gte\"},{\"value\":1500,\"id\":\"435f8a20-a6e0-11e8-8b18-1da1dfc50975\",\"text\":\"rgba(104,188,0,1)\",\"operator\":\"gte\"}],\"offset_time\":\"\",\"value_template\":\"\",\"trend_arrows\":0,\"split_color_mode\":\"gradient\"},{\"id\":\"46fd7fc0-e5b1-11e7-bfc2-a1f7e71965a1\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"46fd7fc1-e5b1-11e7-bfc2-a1f7e71965a1\",\"type\":\"cardinality\",\"field\":\"ip\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Unique Visits (Last Hour)\",\"color_rules\":[{\"value\":10,\"id\":\"4e90aeb0-a6e0-11e8-8b18-1da1dfc50975\",\"text\":\"rgba(211,49,21,1)\",\"operator\":\"lt\"},{\"value\":10,\"id\":\"6d59b1c0-a6e0-11e8-8b18-1da1dfc50975\",\"text\":\"rgba(252,196,0,1)\",\"operator\":\"gte\"},{\"value\":25,\"id\":\"77578670-a6e0-11e8-8b18-1da1dfc50975\",\"text\":\"rgba(104,188,0,1)\",\"operator\":\"gte\"}],\"offset_time\":\"\",\"value_template\":\"\",\"trend_arrows\":1,\"split_color_mode\":\"gradient\"}],\"time_field\":\"timestamp\",\"use_kibana_indexes\":true,\"interval\":\"1h\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"show_grid\":1,\"bar_color_rules\":[{\"id\":\"e9b4e490-e1c6-11e7-b4f6-0f68c45f7387\"}],\"pivot_id\":\"extension.keyword\",\"pivot_label\":\"Type\",\"drilldown_url\":\"\",\"axis_scale\":\"normal\",\"hide_last_value_indicator\":false,\"tooltip_mode\":\"show_all\",\"drop_last_bucket\":0,\"isModelInvalid\":false,\"index_pattern_ref_name\":\"metrics_0_index_pattern\"}}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T13:11:17.374Z", + "id": "4eb6e500-e1c7-11e7-b6d5-4dc382ef7f5b", + "migrationVersion": { + "visualization": "8.5.0" + }, + "references": [ + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "metrics_0_index_pattern", + "type": "index-pattern" + } + ], + "type": "visualization", + "updated_at": "2022-10-26T13:11:17.374Z", + "version": "WzEzMSwxXQ==" +} + +{ + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "title": "[Logs] Goals", + "uiStateJSON": "{\"vis\":{\"defaultColors\":{\"0 - 500\":\"rgb(165,0,38)\",\"500 - 1000\":\"rgb(255,255,190)\",\"1000 - 1500\":\"rgb(0,104,55)\"},\"colors\":{\"75 - 100\":\"#629E51\",\"50 - 75\":\"#EAB839\",\"0 - 50\":\"#E24D42\",\"0 - 100\":\"#E24D42\",\"200 - 300\":\"#7EB26D\",\"500 - 1000\":\"#E5AC0E\",\"0 - 500\":\"#E24D42\",\"1000 - 1500\":\"#7EB26D\"},\"legendOpen\":true}}", + "version": 1, + "visState": "{\"title\":\"[Logs] Goals\",\"type\":\"gauge\",\"params\":{\"type\":\"gauge\",\"addTooltip\":true,\"addLegend\":false,\"gauge\":{\"extendRange\":true,\"percentageMode\":false,\"gaugeType\":\"Arc\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"Labels\",\"colorsRange\":[{\"from\":0,\"to\":500},{\"from\":500,\"to\":1000},{\"from\":1000,\"to\":1500}],\"invertColors\":true,\"labels\":{\"show\":false,\"color\":\"black\"},\"scale\":{\"show\":true,\"labels\":false,\"color\":\"#333\"},\"type\":\"meter\",\"style\":{\"bgWidth\":0.9,\"width\":0.9,\"mask\":false,\"bgMask\":false,\"maskBars\":50,\"bgFill\":\"#eee\",\"bgColor\":false,\"subText\":\"visitors\",\"fontSize\":60,\"labelColor\":true},\"alignment\":\"horizontal\"},\"isDisplayWarning\":false},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"cardinality\",\"schema\":\"metric\",\"params\":{\"field\":\"clientip\",\"customLabel\":\"Unique Visitors\"}}]}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T13:11:17.374Z", + "id": "69a34b00-9ee8-11e7-8711-e7a007dcef99", + "migrationVersion": { + "visualization": "8.5.0" + }, + "references": [ + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + } + ], + "type": "visualization", + "updated_at": "2022-10-26T13:11:17.374Z", + "version": "WzEzMiwxXQ==" +} + +{ + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" + }, + "title": "[Logs] Machine OS and Destination Sankey Chart", + "uiStateJSON": "{}", + "version": 1, + "visState": "{\"title\":\"[Logs] Machine OS and Destination Sankey Chart\",\"type\":\"vega\",\"params\":{\"spec\":\"{ \\n $schema: https://vega.github.io/schema/vega/v5.json\\n data: [\\n\\t{\\n \\t// query ES based on the currently selected time range and filter string\\n \\tname: rawData\\n \\turl: {\\n \\t%context%: true\\n \\t%timefield%: timestamp\\n \\tindex: kibana_sample_data_logs\\n \\tbody: {\\n \\tsize: 0\\n \\taggs: {\\n \\ttable: {\\n \\tcomposite: {\\n \\tsize: 10000\\n \\tsources: [\\n \\t{\\n \\tstk1: {\\n \\tterms: {field: \\\"machine.os.keyword\\\"}\\n \\t}\\n \\t}\\n \\t{\\n \\tstk2: {\\n \\tterms: {field: \\\"geo.dest\\\"}\\n \\t}\\n \\t}\\n \\t]\\n \\t}\\n \\t}\\n \\t}\\n \\t}\\n \\t}\\n \\t// From the result, take just the data we are interested in\\n \\tformat: {property: \\\"aggregations.table.buckets\\\"}\\n \\t// Convert key.stk1 -> stk1 for simpler access below\\n \\ttransform: [\\n \\t{type: \\\"formula\\\", expr: \\\"datum.key.stk1\\\", as: \\\"stk1\\\"}\\n \\t{type: \\\"formula\\\", expr: \\\"datum.key.stk2\\\", as: \\\"stk2\\\"}\\n \\t{type: \\\"formula\\\", expr: \\\"datum.doc_count\\\", as: \\\"size\\\"}\\n \\t]\\n\\t}\\n\\t{\\n \\tname: nodes\\n \\tsource: rawData\\n \\ttransform: [\\n \\t// when a country is selected, filter out unrelated data\\n \\t{\\n \\ttype: filter\\n \\texpr: !groupSelector || groupSelector.stk1 == datum.stk1 || groupSelector.stk2 == datum.stk2\\n \\t}\\n \\t// Set new key for later lookups - identifies each node\\n \\t{type: \\\"formula\\\", expr: \\\"datum.stk1+datum.stk2\\\", as: \\\"key\\\"}\\n \\t// instead of each table row, create two new rows,\\n \\t// one for the source (stack=stk1) and one for destination node (stack=stk2).\\n \\t// The country code stored in stk1 and stk2 fields is placed into grpId field.\\n \\t{\\n \\ttype: fold\\n \\tfields: [\\\"stk1\\\", \\\"stk2\\\"]\\n \\tas: [\\\"stack\\\", \\\"grpId\\\"]\\n \\t}\\n \\t// Create a sortkey, different for stk1 and stk2 stacks.\\n \\t{\\n \\ttype: formula\\n \\texpr: datum.stack == 'stk1' ? datum.stk1+datum.stk2 : datum.stk2+datum.stk1\\n \\tas: sortField\\n \\t}\\n \\t// Calculate y0 and y1 positions for stacking nodes one on top of the other,\\n \\t// independently for each stack, and ensuring they are in the proper order,\\n \\t// alphabetical from the top (reversed on the y axis)\\n \\t{\\n \\ttype: stack\\n \\tgroupby: [\\\"stack\\\"]\\n \\tsort: {field: \\\"sortField\\\", order: \\\"descending\\\"}\\n \\tfield: size\\n \\t}\\n \\t// calculate vertical center point for each node, used to draw edges\\n \\t{type: \\\"formula\\\", expr: \\\"(datum.y0+datum.y1)/2\\\", as: \\\"yc\\\"}\\n \\t]\\n\\t}\\n\\t{\\n \\tname: groups\\n \\tsource: nodes\\n \\ttransform: [\\n \\t// combine all nodes into country groups, summing up the doc counts\\n \\t{\\n \\ttype: aggregate\\n \\tgroupby: [\\\"stack\\\", \\\"grpId\\\"]\\n \\tfields: [\\\"size\\\"]\\n \\tops: [\\\"sum\\\"]\\n \\tas: [\\\"total\\\"]\\n \\t}\\n \\t// re-calculate the stacking y0,y1 values\\n \\t{\\n \\ttype: stack\\n \\tgroupby: [\\\"stack\\\"]\\n \\tsort: {field: \\\"grpId\\\", order: \\\"descending\\\"}\\n \\tfield: total\\n \\t}\\n \\t// project y0 and y1 values to screen coordinates\\n \\t// doing it once here instead of doing it several times in marks\\n \\t{type: \\\"formula\\\", expr: \\\"scale('y', datum.y0)\\\", as: \\\"scaledY0\\\"}\\n \\t{type: \\\"formula\\\", expr: \\\"scale('y', datum.y1)\\\", as: \\\"scaledY1\\\"}\\n \\t// boolean flag if the label should be on the right of the stack\\n \\t{type: \\\"formula\\\", expr: \\\"datum.stack == 'stk1'\\\", as: \\\"rightLabel\\\"}\\n \\t// Calculate traffic percentage for this country using \\\"y\\\" scale\\n \\t// domain upper bound, which represents the total traffic\\n \\t{\\n \\ttype: formula\\n \\texpr: datum.total/domain('y')[1]\\n \\tas: percentage\\n \\t}\\n \\t]\\n\\t}\\n\\t{\\n \\t// This is a temp lookup table with all the 'stk2' stack nodes\\n \\tname: destinationNodes\\n \\tsource: nodes\\n \\ttransform: [\\n \\t{type: \\\"filter\\\", expr: \\\"datum.stack == 'stk2'\\\"}\\n \\t]\\n\\t}\\n\\t{\\n \\tname: edges\\n \\tsource: nodes\\n \\ttransform: [\\n \\t// we only want nodes from the left stack\\n \\t{type: \\\"filter\\\", expr: \\\"datum.stack == 'stk1'\\\"}\\n \\t// find corresponding node from the right stack, keep it as \\\"target\\\"\\n \\t{\\n \\ttype: lookup\\n \\tfrom: destinationNodes\\n \\tkey: key\\n \\tfields: [\\\"key\\\"]\\n \\tas: [\\\"target\\\"]\\n \\t}\\n \\t// calculate SVG link path between stk1 and stk2 stacks for the node pair\\n \\t{\\n \\ttype: linkpath\\n \\torient: horizontal\\n \\tshape: diagonal\\n \\tsourceY: {expr: \\\"scale('y', datum.yc)\\\"}\\n \\tsourceX: {expr: \\\"scale('x', 'stk1') + bandwidth('x')\\\"}\\n \\ttargetY: {expr: \\\"scale('y', datum.target.yc)\\\"}\\n \\ttargetX: {expr: \\\"scale('x', 'stk2')\\\"}\\n \\t}\\n \\t// A little trick to calculate the thickness of the line.\\n \\t// The value needs to be the same as the hight of the node, but scaling\\n \\t// size to screen's height gives inversed value because screen's Y\\n \\t// coordinate goes from the top to the bottom, whereas the graph's Y=0\\n \\t// is at the bottom. So subtracting scaled doc count from screen height\\n \\t// (which is the \\\"lower\\\" bound of the \\\"y\\\" scale) gives us the right value\\n \\t{\\n \\ttype: formula\\n \\texpr: range('y')[0]-scale('y', datum.size)\\n \\tas: strokeWidth\\n \\t}\\n \\t// Tooltip needs individual link's percentage of all traffic\\n \\t{\\n \\ttype: formula\\n \\texpr: datum.size/domain('y')[1]\\n \\tas: percentage\\n \\t}\\n \\t]\\n\\t}\\n ]\\n scales: [\\n\\t{\\n \\t// calculates horizontal stack positioning\\n \\tname: x\\n \\ttype: band\\n \\trange: width\\n \\tdomain: [\\\"stk1\\\", \\\"stk2\\\"]\\n \\tpaddingOuter: 0.05\\n \\tpaddingInner: 0.95\\n\\t}\\n\\t{\\n \\t// this scale goes up as high as the highest y1 value of all nodes\\n \\tname: y\\n \\ttype: linear\\n \\trange: height\\n \\tdomain: {data: \\\"nodes\\\", field: \\\"y1\\\"}\\n\\t}\\n\\t{\\n \\t// use rawData to ensure the colors stay the same when clicking.\\n \\tname: color\\n \\ttype: ordinal\\n \\trange: category\\n \\tdomain: {data: \\\"rawData\\\", field: \\\"stk1\\\"}\\n\\t}\\n\\t{\\n \\t// this scale is used to map internal ids (stk1, stk2) to stack names\\n \\tname: stackNames\\n \\ttype: ordinal\\n \\trange: [\\\"Source\\\", \\\"Destination\\\"]\\n \\tdomain: [\\\"stk1\\\", \\\"stk2\\\"]\\n\\t}\\n ]\\n axes: [\\n\\t{\\n \\t// x axis should use custom label formatting to print proper stack names\\n \\torient: bottom\\n \\tscale: x\\n \\tencode: {\\n \\tlabels: {\\n \\tupdate: {\\n \\ttext: {scale: \\\"stackNames\\\", field: \\\"value\\\"}\\n \\t}\\n \\t}\\n \\t}\\n\\t}\\n\\t{orient: \\\"left\\\", scale: \\\"y\\\"}\\n ]\\n marks: [\\n\\t{\\n \\t// draw the connecting line between stacks\\n \\ttype: path\\n \\tname: edgeMark\\n \\tfrom: {data: \\\"edges\\\"}\\n \\t// this prevents some autosizing issues with large strokeWidth for paths\\n \\tclip: true\\n \\tencode: {\\n \\tupdate: {\\n \\t// By default use color of the left node, except when showing traffic\\n \\t// from just one country, in which case use destination color.\\n \\tstroke: [\\n \\t{\\n \\ttest: groupSelector && groupSelector.stack=='stk1'\\n \\tscale: color\\n \\tfield: stk2\\n \\t}\\n \\t{scale: \\\"color\\\", field: \\\"stk1\\\"}\\n \\t]\\n \\tstrokeWidth: {field: \\\"strokeWidth\\\"}\\n \\tpath: {field: \\\"path\\\"}\\n \\t// when showing all traffic, and hovering over a country,\\n \\t// highlight the traffic from that country.\\n \\tstrokeOpacity: {\\n \\tsignal: !groupSelector && (groupHover.stk1 == datum.stk1 || groupHover.stk2 == datum.stk2) ? 0.9 : 0.3\\n \\t}\\n \\t// Ensure that the hover-selected edges show on top\\n \\tzindex: {\\n \\tsignal: !groupSelector && (groupHover.stk1 == datum.stk1 || groupHover.stk2 == datum.stk2) ? 1 : 0\\n \\t}\\n \\t// format tooltip string\\n \\ttooltip: {\\n \\tsignal: datum.stk1 + ' → ' + datum.stk2 + '\\t' + format(datum.size, ',.0f') + ' (' + format(datum.percentage, '.1%') + ')'\\n \\t}\\n \\t}\\n \\t// Simple mouseover highlighting of a single line\\n \\thover: {\\n \\tstrokeOpacity: {value: 1}\\n \\t}\\n \\t}\\n\\t}\\n\\t{\\n \\t// draw stack groups (countries)\\n \\ttype: rect\\n \\tname: groupMark\\n \\tfrom: {data: \\\"groups\\\"}\\n \\tencode: {\\n \\tenter: {\\n \\tfill: {scale: \\\"color\\\", field: \\\"grpId\\\"}\\n \\twidth: {scale: \\\"x\\\", band: 1}\\n \\t}\\n \\tupdate: {\\n \\tx: {scale: \\\"x\\\", field: \\\"stack\\\"}\\n \\ty: {field: \\\"scaledY0\\\"}\\n \\ty2: {field: \\\"scaledY1\\\"}\\n \\tfillOpacity: {value: 0.6}\\n \\ttooltip: {\\n \\tsignal: datum.grpId + ' ' + format(datum.total, ',.0f') + ' (' + format(datum.percentage, '.1%') + ')'\\n \\t}\\n \\t}\\n \\thover: {\\n \\tfillOpacity: {value: 1}\\n \\t}\\n \\t}\\n\\t}\\n\\t{\\n \\t// draw country code labels on the inner side of the stack\\n \\ttype: text\\n \\tfrom: {data: \\\"groups\\\"}\\n \\t// don't process events for the labels - otherwise line mouseover is unclean\\n \\tinteractive: false\\n \\tencode: {\\n \\tupdate: {\\n \\t// depending on which stack it is, position x with some padding\\n \\tx: {\\n \\tsignal: scale('x', datum.stack) + (datum.rightLabel ? bandwidth('x') + 8 : -8)\\n \\t}\\n \\t// middle of the group\\n \\tyc: {signal: \\\"(datum.scaledY0 + datum.scaledY1)/2\\\"}\\n \\talign: {signal: \\\"datum.rightLabel ? 'left' : 'right'\\\"}\\n \\tbaseline: {value: \\\"middle\\\"}\\n \\tfontWeight: {value: \\\"bold\\\"}\\n \\t// only show text label if the group's height is large enough\\n \\ttext: {signal: \\\"abs(datum.scaledY0-datum.scaledY1) > 13 ? datum.grpId : ''\\\"}\\n \\t}\\n \\t}\\n\\t}\\n\\t{\\n \\t// Create a \\\"show all\\\" button. Shown only when a country is selected.\\n \\ttype: group\\n \\tdata: [\\n \\t// We need to make the button show only when groupSelector signal is true.\\n \\t// Each mark is drawn as many times as there are elements in the backing data.\\n \\t// Which means that if values list is empty, it will not be drawn.\\n \\t// Here I create a data source with one empty object, and filter that list\\n \\t// based on the signal value. This can only be done in a group.\\n \\t{\\n \\tname: dataForShowAll\\n \\tvalues: [{}]\\n \\ttransform: [{type: \\\"filter\\\", expr: \\\"groupSelector\\\"}]\\n \\t}\\n \\t]\\n \\t// Set button size and positioning\\n \\tencode: {\\n \\tenter: {\\n \\txc: {signal: \\\"width/2\\\"}\\n \\ty: {value: 30}\\n \\twidth: {value: 80}\\n \\theight: {value: 30}\\n \\t}\\n \\t}\\n \\tmarks: [\\n \\t{\\n \\t// This group is shown as a button with rounded corners.\\n \\ttype: group\\n \\t// mark name allows signal capturing\\n \\tname: groupReset\\n \\t// Only shows button if dataForShowAll has values.\\n \\tfrom: {data: \\\"dataForShowAll\\\"}\\n \\tencode: {\\n \\tenter: {\\n \\tcornerRadius: {value: 6}\\n \\tfill: {value: \\\"#F5F7FA\\\"}\\n \\tstroke: {value: \\\"#c1c1c1\\\"}\\n \\tstrokeWidth: {value: 2}\\n \\t// use parent group's size\\n \\theight: {\\n \\tfield: {group: \\\"height\\\"}\\n \\t}\\n \\twidth: {\\n \\tfield: {group: \\\"width\\\"}\\n \\t}\\n \\t}\\n \\tupdate: {\\n \\t// groups are transparent by default\\n \\topacity: {value: 1}\\n \\t}\\n \\thover: {\\n \\topacity: {value: 0.7}\\n \\t}\\n \\t}\\n \\tmarks: [\\n \\t{\\n \\ttype: text\\n \\t// if true, it will prevent clicking on the button when over text.\\n \\tinteractive: false\\n \\tencode: {\\n \\tenter: {\\n \\t// center text in the paren group\\n \\txc: {\\n \\tfield: {group: \\\"width\\\"}\\n \\tmult: 0.5\\n \\t}\\n \\tyc: {\\n \\tfield: {group: \\\"height\\\"}\\n \\tmult: 0.5\\n \\toffset: 2\\n \\t}\\n \\talign: {value: \\\"center\\\"}\\n \\tbaseline: {value: \\\"middle\\\"}\\n \\tfontWeight: {value: \\\"bold\\\"}\\n \\ttext: {value: \\\"Show All\\\"}\\n \\t}\\n \\t}\\n \\t}\\n \\t]\\n \\t}\\n \\t]\\n\\t}\\n ]\\n signals: [\\n\\t{\\n \\t// used to highlight traffic to/from the same country\\n \\tname: groupHover\\n \\tvalue: {}\\n \\ton: [\\n \\t{\\n \\tevents: @groupMark:mouseover\\n \\tupdate: \\\"{stk1:datum.stack=='stk1' && datum.grpId, stk2:datum.stack=='stk2' && datum.grpId}\\\"\\n \\t}\\n \\t{events: \\\"mouseout\\\", update: \\\"{}\\\"}\\n \\t]\\n\\t}\\n\\t// used to filter only the data related to the selected country\\n\\t{\\n \\tname: groupSelector\\n \\tvalue: false\\n \\ton: [\\n \\t{\\n \\t// Clicking groupMark sets this signal to the filter values\\n \\tevents: @groupMark:click!\\n \\tupdate: \\\"{stack:datum.stack, stk1:datum.stack=='stk1' && datum.grpId, stk2:datum.stack=='stk2' && datum.grpId}\\\"\\n \\t}\\n \\t{\\n \\t// Clicking \\\"show all\\\" button, or double-clicking anywhere resets it\\n \\tevents: [\\n \\t{type: \\\"click\\\", markname: \\\"groupReset\\\"}\\n \\t{type: \\\"dblclick\\\"}\\n \\t]\\n \\tupdate: \\\"false\\\"\\n \\t}\\n \\t]\\n\\t}\\n ]\\n}\\n\"},\"aggs\":[]}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T13:11:17.374Z", + "id": "7cbd2350-2223-11e8-b802-5bcf64c2cfb4", + "migrationVersion": { + "visualization": "8.5.0" + }, + "references": [], + "type": "visualization", + "updated_at": "2022-10-26T13:11:17.374Z", + "version": "WzEzMywxXQ==" +} + +{ + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" + }, + "title": "[Logs] Response Codes Over Time + Annotations", + "uiStateJSON": "{}", + "version": 1, + "visState": "{\"title\":\"[Logs] Response Codes Over Time + Annotations\",\"type\":\"metrics\",\"aggs\":[],\"params\":{\"time_range_mode\":\"entire_time_range\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"rgba(115,216,255,1)\",\"split_mode\":\"filters\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"count\",\"field\":\"ip\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"percent\",\"chart_type\":\"line\",\"line_width\":\"2\",\"point_size\":\"0\",\"fill\":\"0.5\",\"stacked\":\"percent\",\"terms_field\":\"response.keyword\",\"terms_order_by\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"label\":\"Response Code Count\",\"split_color_mode\":\"gradient\",\"split_filters\":[{\"filter\":{\"query\":\"response.keyword >= 200 and response.keyword < 400\",\"language\":\"kuery\"},\"label\":\"HTTP 2xx and 3xx\",\"color\":\"rgba(84,179,153,1)\",\"id\":\"96b6ffe0-ea54-11eb-ad09-9f2ab44412fb\"},{\"filter\":{\"query\":\"response.keyword >= 400 and response.keyword < 500\",\"language\":\"kuery\"},\"label\":\"HTTP 4xx\",\"color\":\"rgba(214,191,87,1)\",\"id\":\"9e41b1b0-ea54-11eb-ad09-9f2ab44412fb\"},{\"filter\":{\"query\":\"response.keyword >= 500\",\"language\":\"kuery\"},\"label\":\"HTTP 5xx\",\"color\":\"rgba(211,96,134,1)\",\"id\":\"a6772270-ea54-11eb-ad09-9f2ab44412fb\"}],\"type\":\"timeseries\"}],\"time_field\":\"timestamp\",\"use_kibana_indexes\":true,\"interval\":\">=4h\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"show_grid\":1,\"annotations\":[{\"fields\":\"geo.src, host\",\"template\":\"Security Error from {{geo.src}} on {{host}}\",\"query_string\":{\"query\":\"tags:error AND tags:security\",\"language\":\"lucene\"},\"id\":\"bd7548a0-2223-11e8-832f-d5027f3c8a47\",\"color\":\"rgba(211,49,21,1)\",\"time_field\":\"timestamp\",\"icon\":\"fa-asterisk\",\"ignore_global_filters\":1,\"ignore_panel_filters\":1,\"index_pattern_ref_name\":\"metrics_1_index_pattern\"}],\"legend_position\":\"bottom\",\"axis_scale\":\"normal\",\"drop_last_bucket\":0,\"tooltip_mode\":\"show_all\",\"index_pattern_ref_name\":\"metrics_0_index_pattern\"}}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T13:11:17.374Z", + "id": "314c6f60-2224-11e8-b802-5bcf64c2cfb4", + "migrationVersion": { + "visualization": "8.5.0" + }, + "references": [ + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "metrics_0_index_pattern", + "type": "index-pattern" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "metrics_1_index_pattern", + "type": "index-pattern" + } + ], + "type": "visualization", + "updated_at": "2022-10-26T13:11:17.374Z", + "version": "WzEzNCwxXQ==" +} + +{ + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" + }, + "title": "[Logs] Unique Destination Heatmap", + "uiStateJSON": "{}", + "version": 1, + "visState": "{\"title\":\"[Logs] Unique Destination Heatmap\",\"type\":\"vega\",\"aggs\":[],\"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.dest\\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 filter: \\\"datum.buckets.unique.value > 0\\\"\\n }\\n ]\\n\\n mark: {\\n type: rect\\n tooltip: {\\n expr: \\\"{\\\\\\\"Unique Visitors\\\\\\\": datum.buckets.unique.value,\\\\\\\"geo.src\\\\\\\": datum.key,\\\\\\\"Hour\\\\\\\": datum.buckets.key}\\\"\\n }\\n }\\n\\n encoding: {\\n x: {\\n field: buckets.key\\n type: nominal\\n scale: {\\n domain: {\\n expr: \\\"sequence(0, 24)\\\"\\n }\\n }\\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: blues\\n }\\n }\\n }\\n}\\n\"}}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T13:11:17.374Z", + "id": "cb099a20-ea66-11eb-9425-113343a037e3", + "migrationVersion": { + "visualization": "8.5.0" + }, + "references": [], + "type": "visualization", + "updated_at": "2022-10-26T13:11:17.374Z", + "version": "WzEzMCwxXQ==" +} + +{ + "attributes": { + "state": { + "datasourceStates": { + "formBased": { + "layers": { + "7d9a32b1-8cc2-410c-83a5-2eb66a3f0321": { + "columnOrder": [ + "a8511a62-2b78-4ba4-9425-a417df6e059f", + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260", + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X0", + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X1", + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X2", + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X3" + ], + "columns": { + "a8511a62-2b78-4ba4-9425-a417df6e059f": { + "dataType": "number", + "isBucketed": true, + "label": "bytes", + "operationType": "range", + "params": { + "maxBars": "auto", + "ranges": [ + { + "from": 0, + "label": "", + "to": 1000 + } + ], + "type": "histogram" + }, + "scale": "interval", + "sourceField": "bytes" + }, + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "% of visits", + "operationType": "formula", + "params": { + "format": { + "id": "percent", + "params": { + "decimals": 1 + } + }, + "formula": "count() / overall_sum(count())", + "isFormulaBroken": false + }, + "references": [ + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X3" + ], + "scale": "ratio" + }, + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X0": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Part of count() / overall_sum(count())", + "operationType": "count", + "scale": "ratio", + "sourceField": "___records___" + }, + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X1": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Part of count() / overall_sum(count())", + "operationType": "count", + "scale": "ratio", + "sourceField": "___records___" + }, + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X2": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Part of count() / overall_sum(count())", + "operationType": "overall_sum", + "references": [ + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X1" + ], + "scale": "ratio" + }, + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X3": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Part of count() / overall_sum(count())", + "operationType": "math", + "params": { + "tinymathAst": { + "args": [ + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X0", + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X2" + ], + "location": { + "max": 30, + "min": 0 + }, + "name": "divide", + "text": "count() / overall_sum(count())", + "type": "function" + } + }, + "references": [ + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X0", + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260X2" + ], + "scale": "ratio" + } + }, + "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": [ + "b5f3dc78-dba8-4db8-87b6-24a0b9cca260" + ], + "layerId": "7d9a32b1-8cc2-410c-83a5-2eb66a3f0321", + "layerType": "data", + "position": "top", + "seriesType": "bar_stacked", + "showGridlines": false, + "xAccessor": "a8511a62-2b78-4ba4-9425-a417df6e059f" + } + ], + "legend": { + "isVisible": true, + "legendSize": "auto", + "position": "right" + }, + "preferredSeriesType": "bar_stacked", + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "valueLabels": "hide", + "yLeftExtent": { + "mode": "full" + }, + "yRightExtent": { + "mode": "full" + } + } + }, + "title": "[Logs] Bytes distribution", + "visualizationType": "lnsXY" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T13:11:17.374Z", + "id": "16b1d7d0-ea71-11eb-8b4b-f7b600de0f7d", + "migrationVersion": { + "lens": "8.6.0" + }, + "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-7d9a32b1-8cc2-410c-83a5-2eb66a3f0321", + "type": "index-pattern" + } + ], + "type": "lens", + "updated_at": "2022-10-26T13:11:17.374Z", + "version": "WzEzNSwxXQ==" +} + +{ + "attributes": { + "controlGroupInput": { + "chainingSystem": "HIERARCHICAL", + "controlStyle": "oneLine", + "ignoreParentSettingsJSON": "{\"ignoreFilters\":false,\"ignoreQuery\":false,\"ignoreTimerange\":false,\"ignoreValidations\":false}", + "panelsJSON": "{\"612f8db8-9ba9-41cf-a809-d133fe9b83a8\":{\"order\":0,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"fieldName\":\"geo.src\",\"title\":\"Source Country\",\"id\":\"612f8db8-9ba9-41cf-a809-d133fe9b83a8\",\"enhancements\":{}}},\"9807212f-5078-4c42-879c-6f28b3033fc9\":{\"order\":1,\"width\":\"small\",\"grow\":true,\"type\":\"optionsListControl\",\"explicitInput\":{\"fieldName\":\"machine.os.keyword\",\"parentFieldName\":\"machine.os\",\"title\":\"OS\",\"id\":\"9807212f-5078-4c42-879c-6f28b3033fc9\",\"enhancements\":{}}},\"6bf7a1b4-282e-43ac-aa46-81b97fa3acae\":{\"order\":2,\"width\":\"small\",\"grow\":true,\"type\":\"rangeSliderControl\",\"explicitInput\":{\"fieldName\":\"bytes\",\"title\":\"Bytes\",\"id\":\"6bf7a1b4-282e-43ac-aa46-81b97fa3acae\",\"enhancements\":{}}}}" + }, + "description": "Analyze mock web traffic log data for Elastic's website", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}" + }, + "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", + "panelsJSON": "[{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":0,\"y\":27,\"w\":24,\"h\":10,\"i\":\"9\"},\"panelIndex\":\"9\",\"embeddableConfig\":{\"mapCenter\":[36.8092847020594,-96.94335937500001],\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}},\"enhancements\":{}},\"panelRefName\":\"panel_9\"},{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":36,\"y\":0,\"w\":12,\"h\":7,\"i\":\"11\"},\"panelIndex\":\"11\",\"embeddableConfig\":{\"vis\":{\"colors\":{\"0 - 500\":\"#BF1B00\",\"1000 - 1500\":\"#7EB26D\",\"500 - 1000\":\"#F2C96D\"},\"defaultColors\":{\"0 - 500\":\"rgb(165,0,38)\",\"1000 - 1500\":\"rgb(0,104,55)\",\"500 - 1000\":\"rgb(255,255,190)\"},\"legendOpen\":false},\"enhancements\":{},\"hidePanelTitles\":true},\"title\":\"\",\"panelRefName\":\"panel_11\"},{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":24,\"y\":14,\"w\":24,\"h\":33,\"i\":\"14\"},\"panelIndex\":\"14\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_14\"},{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":0,\"y\":7,\"w\":24,\"h\":7,\"i\":\"15\"},\"panelIndex\":\"15\",\"embeddableConfig\":{\"enhancements\":{\"dynamicActions\":{\"events\":[]}}},\"panelRefName\":\"panel_15\"},{\"version\":\"8.6.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.6.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\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsLegacyMetric\",\"state\":{\"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\":{}}}}},\"visualization\":{\"layerId\":\"483defd2-775b-4a62-bdef-496c819bb8ed\",\"accessor\":\"37430d12-7452-4cc9-b035-5cfd4061edf0\",\"layerType\":\"data\",\"textAlign\":\"center\",\"titlePosition\":\"bottom\",\"size\":\"xl\"},\"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-483defd2-775b-4a62-bdef-496c819bb8ed\",\"type\":\"index-pattern\"}]},\"enhancements\":{}}},{\"version\":\"8.6.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\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsLegacyMetric\",\"state\":{\"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 >= 400 and response.keyword < 500\",\"language\":\"kuery\"},\"customLabel\":true},\"71c076a6-e782-4866-b8df-5fd85a41f08bX1\":{\"label\":\"Part of HTTP 5xx\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"___records___\",\"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 >= 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\":{}}}}},\"visualization\":{\"layerId\":\"f3793bb7-3971-4753-866d-4008e77a9f9a\",\"accessor\":\"71c076a6-e782-4866-b8df-5fd85a41f08b\",\"layerType\":\"data\",\"textAlign\":\"center\",\"titlePosition\":\"bottom\",\"size\":\"xl\"},\"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-f3793bb7-3971-4753-866d-4008e77a9f9a\",\"type\":\"index-pattern\"}]},\"enhancements\":{}}},{\"version\":\"8.6.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\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsLegacyMetric\",\"state\":{\"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\"},\"customLabel\":true},\"71c076a6-e782-4866-b8df-5fd85a41f08bX1\":{\"label\":\"Part of HTTP 5xx\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"___records___\",\"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\":{}}}}},\"visualization\":{\"layerId\":\"f3793bb7-3971-4753-866d-4008e77a9f9a\",\"accessor\":\"71c076a6-e782-4866-b8df-5fd85a41f08b\",\"layerType\":\"data\",\"textAlign\":\"center\",\"titlePosition\":\"bottom\",\"size\":\"xl\"},\"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-f3793bb7-3971-4753-866d-4008e77a9f9a\",\"type\":\"index-pattern\"}]},\"enhancements\":{}}},{\"version\":\"8.6.0\",\"type\":\"visualization\",\"gridData\":{\"x\":0,\"y\":14,\"w\":24,\"h\":13,\"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.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":37,\"w\":24,\"h\":10,\"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.6.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":47,\"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\"}]", + "refreshInterval": { + "pause": false, + "value": 900000 + }, + "timeTo": "2022-10-26T09:00:00.000Z", + "timeFrom": "2022-10-19T09:00:00.000Z", + "timeRestore": true, + "title": "[Logs] Web Traffic", + "version": 1 + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-26T13:15:53.832Z", + "id": "edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b", + "migrationVersion": { + "dashboard": "8.6.0" + }, + "references": [ + { + "id": "4eb6e500-e1c7-11e7-b6d5-4dc382ef7f5b", + "name": "9:panel_9", + "type": "visualization" + }, + { + "id": "69a34b00-9ee8-11e7-8711-e7a007dcef99", + "name": "11:panel_11", + "type": "visualization" + }, + { + "id": "7cbd2350-2223-11e8-b802-5bcf64c2cfb4", + "name": "14:panel_14", + "type": "visualization" + }, + { + "id": "314c6f60-2224-11e8-b802-5bcf64c2cfb4", + "name": "15:panel_15", + "type": "visualization" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "bb94016e-f4a6-49ca-87a9-296a2869d570:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "bb94016e-f4a6-49ca-87a9-296a2869d570:indexpattern-datasource-layer-483defd2-775b-4a62-bdef-496c819bb8ed", + "type": "index-pattern" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "01d8e435-91c0-484f-a11e-856747050b0a:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "01d8e435-91c0-484f-a11e-856747050b0a:indexpattern-datasource-layer-f3793bb7-3971-4753-866d-4008e77a9f9a", + "type": "index-pattern" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "8c1456d4-1993-4ba2-b701-04aca02c9fef:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "8c1456d4-1993-4ba2-b701-04aca02c9fef:indexpattern-datasource-layer-f3793bb7-3971-4753-866d-4008e77a9f9a", + "type": "index-pattern" + }, + { + "id": "cb099a20-ea66-11eb-9425-113343a037e3", + "name": "8e59c7cf-6e42-4343-a113-c4a255fcf2ce:panel_8e59c7cf-6e42-4343-a113-c4a255fcf2ce", + "type": "visualization" + }, + { + "id": "16b1d7d0-ea71-11eb-8b4b-f7b600de0f7d", + "name": "cbca842c-b9fa-4523-9ce0-14e350866e33:panel_cbca842c-b9fa-4523-9ce0-14e350866e33", + "type": "lens" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "1d5f0b3f-d9d2-4b26-997b-83bc5ca3090b:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "1d5f0b3f-d9d2-4b26-997b-83bc5ca3090b:indexpattern-datasource-layer-c35dc8ee-50d1-4ef7-8b4b-9c21a7e7d3b0", + "type": "index-pattern" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "controlGroup_612f8db8-9ba9-41cf-a809-d133fe9b83a8:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "controlGroup_9807212f-5078-4c42-879c-6f28b3033fc9:optionsListDataView", + "type": "index-pattern" + }, + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "controlGroup_6bf7a1b4-282e-43ac-aa46-81b97fa3acae:rangeSliderDataView", + "type": "index-pattern" + } + ], + "type": "dashboard", + "updated_at": "2022-10-26T13:15:53.832Z", + "version": "WzM1NywxXQ==" +} diff --git a/x-pack/performance/utils.ts b/x-pack/performance/utils.ts index c0a7ba95f7ee1..16c997c2166fa 100644 --- a/x-pack/performance/utils.ts +++ b/x-pack/performance/utils.ts @@ -5,15 +5,28 @@ * 2.0. */ +import { ToolingLog } from '@kbn/tooling-log'; import { Page } from 'playwright'; -export async function waitForVisualizations(page: Page, visCount: number) { - return await page.waitForFunction(function renderCompleted(cnt) { - const visualizations = Array.from(document.querySelectorAll('[data-rendering-count]')); - const visualizationElementsLoaded = visualizations.length === cnt; - const visualizationAnimationsFinished = visualizations.every( - (e) => e.getAttribute('data-render-complete') === 'true' +export async function waitForChrome(page: Page) { + return page.waitForSelector('.headerGlobalNav', { state: 'attached' }); +} + +export async function waitForVisualizations(page: Page, log: ToolingLog, visCount: number) { + try { + await page.waitForFunction(function renderCompleted(cnt) { + const visualizations = Array.from(document.querySelectorAll('[data-rendering-count]')); + const allVisLoaded = visualizations.length === cnt; + return allVisLoaded + ? visualizations.every((e) => e.getAttribute('data-render-complete') === 'true') + : false; + }, visCount); + } catch (err) { + const loadedVis = await page.$$('[data-rendering-count]'); + const renderedVis = await page.$$('[data-rendering-count][data-render-complete="true"]'); + log.error( + `'waitForVisualizations' failed: loaded - ${loadedVis.length}, rendered - ${renderedVis.length}, expected - ${visCount}` ); - return visualizationElementsLoaded && visualizationAnimationsFinished; - }, visCount); + throw err; + } } diff --git a/x-pack/plugins/actions/server/create_execute_function.ts b/x-pack/plugins/actions/server/create_execute_function.ts index 8f4c4eee61e84..19447bf8e79e5 100644 --- a/x-pack/plugins/actions/server/create_execute_function.ts +++ b/x-pack/plugins/actions/server/create_execute_function.ts @@ -16,7 +16,6 @@ import { import { ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE } from './constants/saved_objects'; import { ExecuteOptions as ActionExecutorOptions } from './lib/action_executor'; import { extractSavedObjectReferences, isSavedObjectExecutionSource } from './lib'; -import { RelatedSavedObjects } from './lib/related_saved_objects'; interface CreateExecuteFunctionOptions { taskManager: TaskManagerStartContract; @@ -25,21 +24,18 @@ interface CreateExecuteFunctionOptions { preconfiguredActions: PreConfiguredAction[]; } -export interface ExecuteOptions extends Pick<ActionExecutorOptions, 'params' | 'source'> { +export interface ExecuteOptions + extends Pick<ActionExecutorOptions, 'params' | 'source' | 'relatedSavedObjects' | 'consumer'> { id: string; spaceId: string; apiKey: string | null; executionId: string; - consumer?: string; - relatedSavedObjects?: RelatedSavedObjects; } -export interface ActionTaskParams extends Pick<ActionExecutorOptions, 'params'> { - actionId: string; +interface ActionTaskParams + extends Pick<ActionExecutorOptions, 'actionId' | 'params' | 'consumer' | 'relatedSavedObjects'> { apiKey: string | null; executionId: string; - consumer?: string; - relatedSavedObjects?: RelatedSavedObjects; } export interface GetConnectorsResult { @@ -176,43 +172,40 @@ export function createBulkExecutionEnqueuerFunction({ connectorIsPreconfigured[id] = isPreconfigured; }); - const actions = await Promise.all( - actionsToExecute.map(async (actionToExecute) => { - // Get saved object references from action ID and relatedSavedObjects - const { references, relatedSavedObjectWithRefs } = extractSavedObjectReferences( - actionToExecute.id, - connectorIsPreconfigured[actionToExecute.id], - actionToExecute.relatedSavedObjects - ); - const executionSourceReference = executionSourceAsSavedObjectReferences( - actionToExecute.source - ); - - const taskReferences = []; - if (executionSourceReference.references) { - taskReferences.push(...executionSourceReference.references); - } - if (references) { - taskReferences.push(...references); - } - - spaceIds[actionToExecute.id] = actionToExecute.spaceId; - - return { - type: ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE, - attributes: { - actionId: actionToExecute.id, - params: actionToExecute.params, - apiKey: actionToExecute.apiKey, - executionId: actionToExecute.executionId, - consumer: actionToExecute.consumer, - relatedSavedObjects: relatedSavedObjectWithRefs, - }, - references: taskReferences, - }; - }) - ); + const actions = actionsToExecute.map((actionToExecute) => { + // Get saved object references from action ID and relatedSavedObjects + const { references, relatedSavedObjectWithRefs } = extractSavedObjectReferences( + actionToExecute.id, + connectorIsPreconfigured[actionToExecute.id], + actionToExecute.relatedSavedObjects + ); + const executionSourceReference = executionSourceAsSavedObjectReferences( + actionToExecute.source + ); + + const taskReferences = []; + if (executionSourceReference.references) { + taskReferences.push(...executionSourceReference.references); + } + if (references) { + taskReferences.push(...references); + } + spaceIds[actionToExecute.id] = actionToExecute.spaceId; + + return { + type: ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE, + attributes: { + actionId: actionToExecute.id, + params: actionToExecute.params, + apiKey: actionToExecute.apiKey, + executionId: actionToExecute.executionId, + consumer: actionToExecute.consumer, + relatedSavedObjects: relatedSavedObjectWithRefs, + }, + references: taskReferences, + }; + }); const actionTaskParamsRecords: SavedObjectsBulkResponse<ActionTaskParams> = await unsecuredSavedObjectsClient.bulkCreate(actions); const taskInstances = actionTaskParamsRecords.saved_objects.map((so) => { diff --git a/x-pack/plugins/actions/server/create_unsecured_execute_function.test.ts b/x-pack/plugins/actions/server/create_unsecured_execute_function.test.ts new file mode 100644 index 0000000000000..ea8407b956276 --- /dev/null +++ b/x-pack/plugins/actions/server/create_unsecured_execute_function.test.ts @@ -0,0 +1,481 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import uuid from 'uuid'; +import { savedObjectsRepositoryMock } from '@kbn/core/server/mocks'; +import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; +import { createBulkUnsecuredExecutionEnqueuerFunction } from './create_unsecured_execute_function'; +import { actionTypeRegistryMock } from './action_type_registry.mock'; +import { asSavedObjectExecutionSource } from './lib/action_execution_source'; + +const mockTaskManager = taskManagerMock.createStart(); +const internalSavedObjectsRepository = savedObjectsRepositoryMock.create(); + +beforeEach(() => jest.resetAllMocks()); + +describe('bulkExecute()', () => { + test('schedules the actions with all given parameters with a preconfigured connector', async () => { + const executeFn = createBulkUnsecuredExecutionEnqueuerFunction({ + taskManager: mockTaskManager, + connectorTypeRegistry: actionTypeRegistryMock.create(), + preconfiguredConnectors: [ + { + id: '123', + actionTypeId: '.email', + config: {}, + isPreconfigured: true, + isDeprecated: false, + name: 'x', + secrets: {}, + }, + ], + }); + + internalSavedObjectsRepository.bulkCreate.mockResolvedValueOnce({ + saved_objects: [ + { + id: '234', + type: 'action_task_params', + attributes: { + actionId: '123', + }, + references: [], + }, + { + id: '345', + type: 'action_task_params', + attributes: { + actionId: '123', + }, + references: [], + }, + ], + }); + await executeFn(internalSavedObjectsRepository, [ + { + id: '123', + params: { baz: false }, + }, + { + id: '123', + params: { baz: true }, + }, + ]); + expect(mockTaskManager.bulkSchedule).toHaveBeenCalledTimes(1); + expect(mockTaskManager.bulkSchedule.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "params": Object { + "actionTaskParamsId": "234", + "spaceId": "default", + }, + "scope": Array [ + "actions", + ], + "state": Object {}, + "taskType": "actions:.email", + }, + Object { + "params": Object { + "actionTaskParamsId": "345", + "spaceId": "default", + }, + "scope": Array [ + "actions", + ], + "state": Object {}, + "taskType": "actions:.email", + }, + ], + ] + `); + + expect(internalSavedObjectsRepository.bulkCreate).toHaveBeenCalledWith([ + { + type: 'action_task_params', + attributes: { + actionId: '123', + params: { baz: false }, + apiKey: null, + }, + references: [], + }, + { + type: 'action_task_params', + attributes: { + actionId: '123', + params: { baz: true }, + apiKey: null, + }, + references: [], + }, + ]); + }); + + test('schedules the actions with all given parameters with a preconfigured connector and source specified', async () => { + const sourceUuid = uuid.v4(); + const source = { type: 'alert', id: sourceUuid }; + const executeFn = createBulkUnsecuredExecutionEnqueuerFunction({ + taskManager: mockTaskManager, + connectorTypeRegistry: actionTypeRegistryMock.create(), + preconfiguredConnectors: [ + { + id: '123', + actionTypeId: '.email', + config: {}, + isPreconfigured: true, + isDeprecated: false, + name: 'x', + secrets: {}, + }, + ], + }); + + internalSavedObjectsRepository.bulkCreate.mockResolvedValueOnce({ + saved_objects: [ + { + id: '234', + type: 'action_task_params', + attributes: { + actionId: '123', + }, + references: [ + { + id: sourceUuid, + name: 'source', + type: 'alert', + }, + ], + }, + { + id: '345', + type: 'action_task_params', + attributes: { + actionId: '123', + }, + references: [], + }, + ], + }); + await executeFn(internalSavedObjectsRepository, [ + { + id: '123', + params: { baz: false }, + source: asSavedObjectExecutionSource(source), + }, + { + id: '123', + params: { baz: true }, + }, + ]); + expect(mockTaskManager.bulkSchedule).toHaveBeenCalledTimes(1); + expect(mockTaskManager.bulkSchedule.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "params": Object { + "actionTaskParamsId": "234", + "spaceId": "default", + }, + "scope": Array [ + "actions", + ], + "state": Object {}, + "taskType": "actions:.email", + }, + Object { + "params": Object { + "actionTaskParamsId": "345", + "spaceId": "default", + }, + "scope": Array [ + "actions", + ], + "state": Object {}, + "taskType": "actions:.email", + }, + ], + ] + `); + + expect(internalSavedObjectsRepository.bulkCreate).toHaveBeenCalledWith([ + { + type: 'action_task_params', + attributes: { + actionId: '123', + params: { baz: false }, + apiKey: null, + }, + references: [ + { + id: sourceUuid, + name: 'source', + type: 'alert', + }, + ], + }, + { + type: 'action_task_params', + attributes: { + actionId: '123', + params: { baz: true }, + apiKey: null, + }, + references: [], + }, + ]); + }); + + test('schedules the actions with all given parameters with a preconfigured connector and relatedSavedObjects specified', async () => { + const sourceUuid = uuid.v4(); + const source = { type: 'alert', id: sourceUuid }; + const executeFn = createBulkUnsecuredExecutionEnqueuerFunction({ + taskManager: mockTaskManager, + connectorTypeRegistry: actionTypeRegistryMock.create(), + preconfiguredConnectors: [ + { + id: '123', + actionTypeId: '.email', + config: {}, + isPreconfigured: true, + isDeprecated: false, + name: 'x', + secrets: {}, + }, + ], + }); + + internalSavedObjectsRepository.bulkCreate.mockResolvedValueOnce({ + saved_objects: [ + { + id: '234', + type: 'action_task_params', + attributes: { + actionId: '123', + }, + references: [ + { + id: sourceUuid, + name: 'source', + type: 'alert', + }, + ], + }, + { + id: '345', + type: 'action_task_params', + attributes: { + actionId: '123', + }, + references: [ + { + id: 'some-id', + name: 'related_some-type_0', + type: 'some-type', + }, + ], + }, + ], + }); + await executeFn(internalSavedObjectsRepository, [ + { + id: '123', + params: { baz: false }, + source: asSavedObjectExecutionSource(source), + }, + { + id: '123', + params: { baz: true }, + relatedSavedObjects: [ + { + id: 'some-id', + namespace: 'some-namespace', + type: 'some-type', + }, + ], + }, + ]); + expect(mockTaskManager.bulkSchedule).toHaveBeenCalledTimes(1); + expect(mockTaskManager.bulkSchedule.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "params": Object { + "actionTaskParamsId": "234", + "spaceId": "default", + }, + "scope": Array [ + "actions", + ], + "state": Object {}, + "taskType": "actions:.email", + }, + Object { + "params": Object { + "actionTaskParamsId": "345", + "spaceId": "default", + }, + "scope": Array [ + "actions", + ], + "state": Object {}, + "taskType": "actions:.email", + }, + ], + ] + `); + + expect(internalSavedObjectsRepository.bulkCreate).toHaveBeenCalledWith([ + { + type: 'action_task_params', + attributes: { + actionId: '123', + params: { baz: false }, + apiKey: null, + }, + references: [ + { + id: sourceUuid, + name: 'source', + type: 'alert', + }, + ], + }, + { + type: 'action_task_params', + attributes: { + actionId: '123', + params: { baz: true }, + apiKey: null, + relatedSavedObjects: [ + { + id: 'related_some-type_0', + namespace: 'some-namespace', + type: 'some-type', + }, + ], + }, + references: [ + { + id: 'some-id', + name: 'related_some-type_0', + type: 'some-type', + }, + ], + }, + ]); + }); + + test('throws when scheduling action using non preconfigured connector', async () => { + const executeFn = createBulkUnsecuredExecutionEnqueuerFunction({ + taskManager: mockTaskManager, + connectorTypeRegistry: actionTypeRegistryMock.create(), + preconfiguredConnectors: [ + { + id: '123', + actionTypeId: '.email', + config: {}, + isPreconfigured: true, + isDeprecated: false, + name: 'x', + secrets: {}, + }, + ], + }); + await expect( + executeFn(internalSavedObjectsRepository, [ + { + id: '123', + params: { baz: false }, + }, + { + id: 'not-preconfigured', + params: { baz: true }, + }, + ]) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"not-preconfigured are not preconfigured connectors and can't be scheduled for unsecured actions execution"` + ); + }); + + test('throws when connector type is not enabled', async () => { + const mockedConnectorTypeRegistry = actionTypeRegistryMock.create(); + const executeFn = createBulkUnsecuredExecutionEnqueuerFunction({ + taskManager: mockTaskManager, + connectorTypeRegistry: mockedConnectorTypeRegistry, + preconfiguredConnectors: [ + { + id: '123', + actionTypeId: '.email', + config: {}, + isPreconfigured: true, + isDeprecated: false, + name: 'x', + secrets: {}, + }, + ], + }); + mockedConnectorTypeRegistry.ensureActionTypeEnabled.mockImplementation(() => { + throw new Error('Fail'); + }); + + await expect( + executeFn(internalSavedObjectsRepository, [ + { + id: '123', + params: { baz: false }, + }, + { + id: '123', + params: { baz: true }, + }, + ]) + ).rejects.toThrowErrorMatchingInlineSnapshot(`"Fail"`); + }); + + test('throws when scheduling action using non allow-listed preconfigured connector', async () => { + const executeFn = createBulkUnsecuredExecutionEnqueuerFunction({ + taskManager: mockTaskManager, + connectorTypeRegistry: actionTypeRegistryMock.create(), + preconfiguredConnectors: [ + { + id: '123', + actionTypeId: '.email', + config: {}, + isPreconfigured: true, + isDeprecated: false, + name: 'x', + secrets: {}, + }, + { + id: '456', + actionTypeId: 'not-in-allowlist', + config: {}, + isPreconfigured: true, + isDeprecated: false, + name: 'x', + secrets: {}, + }, + ], + }); + await expect( + executeFn(internalSavedObjectsRepository, [ + { + id: '123', + params: { baz: false }, + }, + { + id: '456', + params: { baz: true }, + }, + ]) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"not-in-allowlist actions cannot be scheduled for unsecured actions execution"` + ); + }); +}); diff --git a/x-pack/plugins/actions/server/create_unsecured_execute_function.ts b/x-pack/plugins/actions/server/create_unsecured_execute_function.ts new file mode 100644 index 0000000000000..4670601ecff83 --- /dev/null +++ b/x-pack/plugins/actions/server/create_unsecured_execute_function.ts @@ -0,0 +1,148 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ISavedObjectsRepository, SavedObjectsBulkResponse } from '@kbn/core/server'; +import { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +import { + ActionTypeRegistryContract as ConnectorTypeRegistryContract, + PreConfiguredAction as PreconfiguredConnector, +} from './types'; +import { ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE } from './constants/saved_objects'; +import { ExecuteOptions as ActionExecutorOptions } from './lib/action_executor'; +import { extractSavedObjectReferences, isSavedObjectExecutionSource } from './lib'; + +// This allowlist should only contain connector types that don't require API keys for +// execution. +const ALLOWED_CONNECTOR_TYPE_IDS = ['.email']; +interface CreateBulkUnsecuredExecuteFunctionOptions { + taskManager: TaskManagerStartContract; + connectorTypeRegistry: ConnectorTypeRegistryContract; + preconfiguredConnectors: PreconfiguredConnector[]; +} + +export interface ExecuteOptions + extends Pick<ActionExecutorOptions, 'params' | 'source' | 'relatedSavedObjects'> { + id: string; +} + +interface ActionTaskParams + extends Pick<ActionExecutorOptions, 'actionId' | 'params' | 'relatedSavedObjects'> { + apiKey: string | null; +} + +export type BulkUnsecuredExecutionEnqueuer<T> = ( + internalSavedObjectsRepository: ISavedObjectsRepository, + actionsToExectute: ExecuteOptions[] +) => Promise<T>; + +export function createBulkUnsecuredExecutionEnqueuerFunction({ + taskManager, + connectorTypeRegistry, + preconfiguredConnectors, +}: CreateBulkUnsecuredExecuteFunctionOptions): BulkUnsecuredExecutionEnqueuer<void> { + return async function execute( + internalSavedObjectsRepository: ISavedObjectsRepository, + actionsToExecute: ExecuteOptions[] + ) { + const connectorTypeIds: Record<string, string> = {}; + const connectorIds = [...new Set(actionsToExecute.map((action) => action.id))]; + + const notPreconfiguredConnectors = connectorIds.filter( + (connectorId) => + preconfiguredConnectors.find((connector) => connector.id === connectorId) == null + ); + + if (notPreconfiguredConnectors.length > 0) { + throw new Error( + `${notPreconfiguredConnectors.join( + ',' + )} are not preconfigured connectors and can't be scheduled for unsecured actions execution` + ); + } + + const connectors: PreconfiguredConnector[] = connectorIds + .map((connectorId) => + preconfiguredConnectors.find((pConnector) => pConnector.id === connectorId) + ) + .filter(Boolean) as PreconfiguredConnector[]; + + connectors.forEach((connector) => { + const { id, actionTypeId } = connector; + if (!connectorTypeRegistry.isActionExecutable(id, actionTypeId, { notifyUsage: true })) { + connectorTypeRegistry.ensureActionTypeEnabled(actionTypeId); + } + + if (!ALLOWED_CONNECTOR_TYPE_IDS.includes(actionTypeId)) { + throw new Error( + `${actionTypeId} actions cannot be scheduled for unsecured actions execution` + ); + } + + connectorTypeIds[id] = actionTypeId; + }); + + const actions = actionsToExecute.map((actionToExecute) => { + // Get saved object references from action ID and relatedSavedObjects + const { references, relatedSavedObjectWithRefs } = extractSavedObjectReferences( + actionToExecute.id, + true, + actionToExecute.relatedSavedObjects + ); + const executionSourceReference = executionSourceAsSavedObjectReferences( + actionToExecute.source + ); + + const taskReferences = []; + if (executionSourceReference.references) { + taskReferences.push(...executionSourceReference.references); + } + if (references) { + taskReferences.push(...references); + } + + return { + type: ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE, + attributes: { + actionId: actionToExecute.id, + params: actionToExecute.params, + apiKey: null, + relatedSavedObjects: relatedSavedObjectWithRefs, + }, + references: taskReferences, + }; + }); + const actionTaskParamsRecords: SavedObjectsBulkResponse<ActionTaskParams> = + await internalSavedObjectsRepository.bulkCreate(actions); + + const taskInstances = actionTaskParamsRecords.saved_objects.map((so) => { + const actionId = so.attributes.actionId; + return { + taskType: `actions:${connectorTypeIds[actionId]}`, + params: { + spaceId: 'default', + actionTaskParamsId: so.id, + }, + state: {}, + scope: ['actions'], + }; + }); + await taskManager.bulkSchedule(taskInstances); + }; +} + +function executionSourceAsSavedObjectReferences(executionSource: ActionExecutorOptions['source']) { + return isSavedObjectExecutionSource(executionSource) + ? { + references: [ + { + name: 'source', + ...executionSource.source, + }, + ], + } + : {}; +} diff --git a/x-pack/plugins/actions/server/index.ts b/x-pack/plugins/actions/server/index.ts index 1c7a66978ffb3..2713ee17463e4 100644 --- a/x-pack/plugins/actions/server/index.ts +++ b/x-pack/plugins/actions/server/index.ts @@ -12,6 +12,8 @@ import { configSchema, ActionsConfig, CustomHostSettings } from './config'; import { ActionsClient as ActionsClientClass } from './actions_client'; import { ActionsAuthorization as ActionsAuthorizationClass } from './authorization/actions_authorization'; +export type { IUnsecuredActionsClient } from './unsecured_actions_client/unsecured_actions_client'; +export { UnsecuredActionsClient } from './unsecured_actions_client/unsecured_actions_client'; export type ActionsClient = PublicMethodsOf<ActionsClientClass>; export type ActionsAuthorization = PublicMethodsOf<ActionsAuthorizationClass>; diff --git a/x-pack/plugins/actions/server/lib/action_executor.test.ts b/x-pack/plugins/actions/server/lib/action_executor.test.ts index 849cd2ff44ba5..4fde645fb367e 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.test.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.test.ts @@ -47,7 +47,21 @@ actionExecutor.initialize({ actionTypeRegistry, encryptedSavedObjectsClient, eventLogger, - preconfiguredActions: [], + preconfiguredActions: [ + { + id: 'preconfigured', + name: 'Preconfigured', + actionTypeId: 'test', + config: { + bar: 'preconfigured', + }, + secrets: { + apiKey: 'abc', + }, + isPreconfigured: true, + isDeprecated: false, + }, + ], }); beforeEach(() => { @@ -183,6 +197,107 @@ test('successfully executes', async () => { `); }); +test('successfully executes with preconfigured connector', async () => { + const actionType: jest.Mocked<ActionType> = { + id: 'test', + name: 'Test', + minimumLicenseRequired: 'basic', + supportedFeatureIds: ['alerting'], + executor: jest.fn(), + }; + + actionTypeRegistry.get.mockReturnValueOnce(actionType); + await actionExecutor.execute({ ...executeParams, actionId: 'preconfigured' }); + + expect(actionsClient.get).not.toHaveBeenCalled(); + expect(encryptedSavedObjectsClient.getDecryptedAsInternalUser).not.toHaveBeenCalled(); + + expect(actionTypeRegistry.get).toHaveBeenCalledWith('test'); + expect(actionTypeRegistry.isActionExecutable).toHaveBeenCalledWith('preconfigured', 'test', { + notifyUsage: true, + }); + + expect(actionType.executor).toHaveBeenCalledWith({ + actionId: 'preconfigured', + services: expect.anything(), + config: { + bar: 'preconfigured', + }, + secrets: { + apiKey: 'abc', + }, + params: { foo: true }, + logger: loggerMock, + }); + + expect(loggerMock.debug).toBeCalledWith('executing action test:preconfigured: Preconfigured'); + expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "event": Object { + "action": "execute-start", + "kind": "action", + }, + "kibana": Object { + "alert": Object { + "rule": Object { + "execution": Object { + "uuid": "123abc", + }, + }, + }, + "saved_objects": Array [ + Object { + "id": "preconfigured", + "namespace": "some-namespace", + "rel": "primary", + "type": "action", + "type_id": "test", + }, + ], + "space_ids": Array [ + "some-namespace", + ], + }, + "message": "action started: test:preconfigured: Preconfigured", + }, + ], + Array [ + Object { + "event": Object { + "action": "execute", + "kind": "action", + "outcome": "success", + }, + "kibana": Object { + "alert": Object { + "rule": Object { + "execution": Object { + "uuid": "123abc", + }, + }, + }, + "saved_objects": Array [ + Object { + "id": "preconfigured", + "namespace": "some-namespace", + "rel": "primary", + "type": "action", + "type_id": "test", + }, + ], + "space_ids": Array [ + "some-namespace", + ], + }, + "message": "action executed: test:preconfigured: Preconfigured", + }, + ], + ] + `); +}); + test('successfully executes as a task', async () => { const actionType: jest.Mocked<ActionType> = { id: 'test', @@ -509,6 +624,132 @@ test('throws an error when passing isESOCanEncrypt with value of false', async ( ); }); +test('should not throw error if action is preconfigured and isESOCanEncrypt is false', async () => { + const customActionExecutor = new ActionExecutor({ isESOCanEncrypt: false }); + customActionExecutor.initialize({ + logger: loggingSystemMock.create().get(), + spaces: spacesMock, + getActionsClientWithRequest, + getServices: () => services, + actionTypeRegistry, + encryptedSavedObjectsClient, + eventLogger: eventLoggerMock.create(), + preconfiguredActions: [ + { + id: 'preconfigured', + name: 'Preconfigured', + actionTypeId: 'test', + config: { + bar: 'preconfigured', + }, + secrets: { + apiKey: 'abc', + }, + isPreconfigured: true, + isDeprecated: false, + }, + ], + }); + const actionType: jest.Mocked<ActionType> = { + id: 'test', + name: 'Test', + minimumLicenseRequired: 'basic', + supportedFeatureIds: ['alerting'], + executor: jest.fn(), + }; + + actionTypeRegistry.get.mockReturnValueOnce(actionType); + await actionExecutor.execute({ ...executeParams, actionId: 'preconfigured' }); + + expect(actionsClient.get).not.toHaveBeenCalled(); + expect(encryptedSavedObjectsClient.getDecryptedAsInternalUser).not.toHaveBeenCalled(); + + expect(actionTypeRegistry.get).toHaveBeenCalledWith('test'); + expect(actionTypeRegistry.isActionExecutable).toHaveBeenCalledWith('preconfigured', 'test', { + notifyUsage: true, + }); + + expect(actionType.executor).toHaveBeenCalledWith({ + actionId: 'preconfigured', + services: expect.anything(), + config: { + bar: 'preconfigured', + }, + secrets: { + apiKey: 'abc', + }, + params: { foo: true }, + logger: loggerMock, + }); + + expect(loggerMock.debug).toBeCalledWith('executing action test:preconfigured: Preconfigured'); + expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "event": Object { + "action": "execute-start", + "kind": "action", + }, + "kibana": Object { + "alert": Object { + "rule": Object { + "execution": Object { + "uuid": "123abc", + }, + }, + }, + "saved_objects": Array [ + Object { + "id": "preconfigured", + "namespace": "some-namespace", + "rel": "primary", + "type": "action", + "type_id": "test", + }, + ], + "space_ids": Array [ + "some-namespace", + ], + }, + "message": "action started: test:preconfigured: Preconfigured", + }, + ], + Array [ + Object { + "event": Object { + "action": "execute", + "kind": "action", + "outcome": "success", + }, + "kibana": Object { + "alert": Object { + "rule": Object { + "execution": Object { + "uuid": "123abc", + }, + }, + }, + "saved_objects": Array [ + Object { + "id": "preconfigured", + "namespace": "some-namespace", + "rel": "primary", + "type": "action", + "type_id": "test", + }, + ], + "space_ids": Array [ + "some-namespace", + ], + }, + "message": "action executed: test:preconfigured: Preconfigured", + }, + ], + ] + `); +}); + test('does not log warning when alert executor succeeds', async () => { const executorMock = setupActionExecutorMock(); executorMock.mockResolvedValue({ diff --git a/x-pack/plugins/actions/server/lib/action_executor.ts b/x-pack/plugins/actions/server/lib/action_executor.ts index 90603499cd4a7..42e5c8c8e1a99 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.ts @@ -105,12 +105,6 @@ export class ActionExecutor { throw new Error('ActionExecutor not initialized'); } - if (!this.isESOCanEncrypt) { - throw new Error( - `Unable to execute action because the Encrypted Saved Objects plugin is missing encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.` - ); - } - return withSpan( { name: `execute_action`, @@ -135,11 +129,14 @@ export class ActionExecutor { const namespace = spaceId && spaceId !== 'default' ? { namespace: spaceId } : {}; const actionInfo = await getActionInfoInternal( - await getActionsClientWithRequest(request, source), + getActionsClientWithRequest, + request, + this.isESOCanEncrypt, encryptedSavedObjectsClient, preconfiguredActions, actionId, - namespace.namespace + namespace.namespace, + source ); const { actionTypeId, name, config, secrets } = actionInfo; @@ -321,11 +318,14 @@ export class ActionExecutor { const namespace = spaceId && spaceId !== 'default' ? { namespace: spaceId } : {}; if (!this.actionInfo || this.actionInfo.actionId !== actionId) { this.actionInfo = await getActionInfoInternal( - await getActionsClientWithRequest(request, source), + getActionsClientWithRequest, + request, + this.isESOCanEncrypt, encryptedSavedObjectsClient, preconfiguredActions, actionId, - namespace.namespace + namespace.namespace, + source ); } const task = taskInfo @@ -371,12 +371,18 @@ interface ActionInfo { actionId: string; } -async function getActionInfoInternal( - actionsClient: PublicMethodsOf<ActionsClient>, +async function getActionInfoInternal<Source = unknown>( + getActionsClientWithRequest: ( + request: KibanaRequest, + authorizationContext?: ActionExecutionSource<unknown> + ) => Promise<PublicMethodsOf<ActionsClient>>, + request: KibanaRequest, + isESOCanEncrypt: boolean, encryptedSavedObjectsClient: EncryptedSavedObjectsClient, preconfiguredActions: PreConfiguredAction[], actionId: string, - namespace: string | undefined + namespace: string | undefined, + source?: ActionExecutionSource<Source> ): Promise<ActionInfo> { // check to see if it's a pre-configured action first const pcAction = preconfiguredActions.find( @@ -392,6 +398,14 @@ async function getActionInfoInternal( }; } + if (!isESOCanEncrypt) { + throw new Error( + `Unable to execute action because the Encrypted Saved Objects plugin is missing encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.` + ); + } + + const actionsClient = await getActionsClientWithRequest(request, source); + // if not pre-configured action, should be a saved object // ensure user can read the action before processing const { actionTypeId, config, name } = await actionsClient.get({ id: actionId }); diff --git a/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.test.ts b/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.test.ts index 72cbda1312b9a..69eca915cc721 100644 --- a/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.test.ts +++ b/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.test.ts @@ -109,6 +109,43 @@ describe('createActionEventLogRecordObject', () => { }); }); + test('created action event "execute" with no kibana.alert.rule fields', async () => { + expect( + createActionEventLogRecordObject({ + actionId: '1', + name: 'test name', + action: 'execute', + message: 'action execution start', + namespace: 'default', + savedObjects: [ + { + id: '2', + type: 'action', + typeId: '.email', + relation: 'primary', + }, + ], + }) + ).toStrictEqual({ + event: { + action: 'execute', + kind: 'action', + }, + kibana: { + saved_objects: [ + { + id: '2', + namespace: 'default', + rel: 'primary', + type: 'action', + type_id: '.email', + }, + ], + }, + message: 'action execution start', + }); + }); + test('created action event "execute-timeout"', async () => { expect( createActionEventLogRecordObject({ diff --git a/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.ts b/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.ts index 5d556398dc668..2632ead26a477 100644 --- a/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.ts +++ b/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from 'lodash'; +import { isEmpty, set } from 'lodash'; import { IEvent, SAVED_OBJECT_REL_PRIMARY } from '@kbn/event-log-plugin/server'; import { RelatedSavedObjects } from './related_saved_objects'; @@ -38,6 +38,17 @@ export function createActionEventLogRecordObject(params: CreateActionEventLogRec const { action, message, task, namespace, executionId, spaceId, consumer, relatedSavedObjects } = params; + const kibanaAlertRule = { + ...(consumer ? { consumer } : {}), + ...(executionId + ? { + execution: { + uuid: executionId, + }, + } + : {}), + }; + const event: Event = { ...(params.timestamp ? { '@timestamp': params.timestamp } : {}), event: { @@ -45,18 +56,7 @@ export function createActionEventLogRecordObject(params: CreateActionEventLogRec kind: 'action', }, kibana: { - alert: { - rule: { - ...(consumer ? { consumer } : {}), - ...(executionId - ? { - execution: { - uuid: executionId, - }, - } - : {}), - }, - }, + ...(!isEmpty(kibanaAlertRule) ? { alert: { rule: kibanaAlertRule } } : {}), saved_objects: params.savedObjects.map((so) => ({ ...(so.relation ? { rel: so.relation } : {}), type: so.type, diff --git a/x-pack/plugins/actions/server/lib/get_custom_agents.test.ts b/x-pack/plugins/actions/server/lib/get_custom_agents.test.ts index 9bf1e26f1d374..7d61e4b4c6d43 100644 --- a/x-pack/plugins/actions/server/lib/get_custom_agents.test.ts +++ b/x-pack/plugins/actions/server/lib/get_custom_agents.test.ts @@ -6,7 +6,7 @@ */ import { Agent as HttpsAgent } from 'https'; -import HttpProxyAgent from 'http-proxy-agent'; +import { HttpProxyAgent } from 'http-proxy-agent'; import { HttpsProxyAgent } from 'https-proxy-agent'; import { Logger } from '@kbn/core/server'; import { getCustomAgents } from './get_custom_agents'; diff --git a/x-pack/plugins/actions/server/lib/get_custom_agents.ts b/x-pack/plugins/actions/server/lib/get_custom_agents.ts index 49eca54afcde7..220abeb6cc928 100644 --- a/x-pack/plugins/actions/server/lib/get_custom_agents.ts +++ b/x-pack/plugins/actions/server/lib/get_custom_agents.ts @@ -7,7 +7,7 @@ import { Agent as HttpAgent } from 'http'; import { Agent as HttpsAgent, AgentOptions } from 'https'; -import HttpProxyAgent from 'http-proxy-agent'; +import { HttpProxyAgent } from 'http-proxy-agent'; import { HttpsProxyAgent } from 'https-proxy-agent'; import { Logger } from '@kbn/core/server'; import { ActionsConfigurationUtilities } from '../actions_config'; diff --git a/x-pack/plugins/actions/server/lib/mustache_renderer.test.ts b/x-pack/plugins/actions/server/lib/mustache_renderer.test.ts index 4fa76f5a133ca..964a793d8f81c 100644 --- a/x-pack/plugins/actions/server/lib/mustache_renderer.test.ts +++ b/x-pack/plugins/actions/server/lib/mustache_renderer.test.ts @@ -340,4 +340,75 @@ describe('mustache_renderer', () => { const expected = '1 - {"c":2,"d":[3,4]} -- 5,{"f":6,"g":7}'; expect(renderMustacheString('{{a}} - {{b}} -- {{e}}', deepVariables, 'none')).toEqual(expected); }); + + describe('converting dot variables', () => { + it('handles multiple dots', () => { + const dotVariables = { + context: [ + { + _index: '.internal.alerts-observability.metrics.alerts-default-000001', + _id: 'a8616ced-c22b-466c-a964-8db53af930ef', + '_score.test': 1, + _source: { + 'kibana.alert.rule.category': 'Metric threshold', + 'kibana.alert.rule.consumer': 'infrastructure', + 'kibana.alert.rule.execution.uuid': 'c42da290-30be-4e90-a7fb-75e160bac758', + 'kibana.alert.rule.name': 'test rule', + 'kibana.alert.rule.producer': 'infrastructure', + 'kibana.alert.rule.rule_type_id': 'metrics.alert.threshold', + 'kibana.alert.rule.uuid': '534c0f20-5533-11ed-b0da-c1155191eec9', + 'kibana.space_ids': ['default'], + 'kibana.alert.rule.tags': [], + '@timestamp': '2022-10-26T13:50:06.516Z', + 'kibana.alert.reason': + 'event.duration is 235,545,454.54545 in the last 1 min for execute. Alert when > 0.', + 'kibana.alert.duration.us': 759925000, + 'kibana.alert.time_range': { + gte: '2022-10-26T13:37:26.591Z', + }, + 'kibana.alert.instance.id': 'execute', + 'kibana.alert.start': '2022-10-26T13:37:26.591Z', + 'kibana.alert.uuid': 'a8616ced-c22b-466c-a964-8db53af930ef', + 'kibana.alert.status': 'active', + 'kibana.alert.workflow_status': 'open', + 'event.kind': 'signal', + 'event.action': 'active', + 'kibana.version': '8.6.0', + tags: [], + }, + }, + ], + }; + + expect( + renderMustacheObject( + { + x: '{{context.0._source.kibana.alert.rule.category}} - {{context.0._score.test}} - {{context.0._source.kibana.alert.time_range.gte}}', + }, + dotVariables + ) + ).toMatchInlineSnapshot(` + Object { + "x": "Metric threshold - 1 - 2022-10-26T13:37:26.591Z", + } + `); + + expect( + renderMustacheString( + '{{context.0._source.kibana.alert.rule.category}} - {{context.0._score.test}} - {{context.0._source.kibana.alert.time_range.gte}}', + dotVariables, + 'none' + ) + ).toEqual('Metric threshold - 1 - 2022-10-26T13:37:26.591Z'); + }); + + it('should replace single value with the object', () => { + expect(renderMustacheObject({ x: '{{a}}' }, { a: 1, 'a.b': 2 })).toMatchInlineSnapshot(` + Object { + "x": "{\\"b\\":2}", + } + `); + expect(renderMustacheString('{{a}}', { a: 1, 'a.b': 2 }, 'none')).toEqual('{"b":2}'); + }); + }); }); diff --git a/x-pack/plugins/actions/server/lib/mustache_renderer.ts b/x-pack/plugins/actions/server/lib/mustache_renderer.ts index 3602cebaa7bf1..fc4381fa0c9c3 100644 --- a/x-pack/plugins/actions/server/lib/mustache_renderer.ts +++ b/x-pack/plugins/actions/server/lib/mustache_renderer.ts @@ -6,7 +6,7 @@ */ import Mustache from 'mustache'; -import { isString, isPlainObject, cloneDeepWith } from 'lodash'; +import { isString, isPlainObject, cloneDeepWith, merge } from 'lodash'; export type Escape = 'markdown' | 'slack' | 'json' | 'none'; type Variables = Record<string, unknown>; @@ -57,10 +57,36 @@ export function renderMustacheObject<Params>(params: Params, variables: Variable // return variables cloned, with a toString() added to objects function augmentObjectVariables(variables: Variables): Variables { const result = JSON.parse(JSON.stringify(variables)); + // convert variables with '.' in the name to objects + convertDotVariables(result); addToStringDeep(result); return result; } +function convertDotVariables(variables: Variables) { + Object.keys(variables).forEach((key) => { + if (key.includes('.')) { + const obj = buildObject(key, variables[key]); + variables = merge(variables, obj); + } + if (typeof variables[key] === 'object' && variables[key] != null) { + convertDotVariables(variables[key] as Variables); + } + }); +} + +function buildObject(key: string, value: unknown) { + const newObject: Variables = {}; + let tempObject = newObject; + const splits = key.split('.'); + const length = splits.length - 1; + splits.forEach((k, index) => { + tempObject[k] = index === length ? value : ({} as unknown); + tempObject = tempObject[k] as Variables; + }); + return newObject; +} + function addToStringDeep(object: unknown): void { // for objects, add a toString method, and then walk if (isNonNullObject(object)) { diff --git a/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts b/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts index 7fd09f2237eac..63ab73ccc0efe 100644 --- a/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts +++ b/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts @@ -304,7 +304,9 @@ test('cleans up action_task_params object', async () => { await taskRunner.run(); - expect(services.savedObjectsClient.delete).toHaveBeenCalledWith('action_task_params', '3'); + expect(services.savedObjectsClient.delete).toHaveBeenCalledWith('action_task_params', '3', { + refresh: false, + }); }); test('task runner should implement CancellableTask cancel method with logging warning message', async () => { @@ -367,7 +369,9 @@ test('runs successfully when cleanup fails and logs the error', async () => { await taskRunner.run(); - expect(services.savedObjectsClient.delete).toHaveBeenCalledWith('action_task_params', '3'); + expect(services.savedObjectsClient.delete).toHaveBeenCalledWith('action_task_params', '3', { + refresh: false, + }); expect(taskRunnerFactoryInitializerParams.logger.error).toHaveBeenCalledWith( 'Failed to cleanup action_task_params object [id="3"]: Fail' ); diff --git a/x-pack/plugins/actions/server/lib/task_runner_factory.ts b/x-pack/plugins/actions/server/lib/task_runner_factory.ts index 51672865d6771..2c23dbc77e316 100644 --- a/x-pack/plugins/actions/server/lib/task_runner_factory.ts +++ b/x-pack/plugins/actions/server/lib/task_runner_factory.ts @@ -171,7 +171,8 @@ export class TaskRunnerFactory { // Once support for legacy alert RBAC is dropped, this can be secured await getUnsecuredSavedObjectsClient(request).delete( ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE, - actionTaskExecutorParams.actionTaskParamsId + actionTaskExecutorParams.actionTaskParamsId, + { refresh: false } ); } catch (e) { // Log error only, we shouldn't fail the task because of an error here (if ever there's retry logic) diff --git a/x-pack/plugins/actions/server/mocks.ts b/x-pack/plugins/actions/server/mocks.ts index 3b8155818452f..34e02b9c43e58 100644 --- a/x-pack/plugins/actions/server/mocks.ts +++ b/x-pack/plugins/actions/server/mocks.ts @@ -17,6 +17,7 @@ import { PluginSetupContract, PluginStartContract, renderActionParameterTemplate import { Services } from './types'; import { actionsAuthorizationMock } from './authorization/actions_authorization.mock'; import { ConnectorTokenClient } from './lib/connector_token_client'; +import { unsecuredActionsClientMock } from './unsecured_actions_client/unsecured_actions_client.mock'; export { actionsAuthorizationMock }; export { actionsClientMock }; const logger = loggingSystemMock.create().get() as jest.Mocked<Logger>; @@ -38,6 +39,7 @@ const createStartMock = () => { isActionTypeEnabled: jest.fn(), isActionExecutable: jest.fn(), getActionsClientWithRequest: jest.fn().mockResolvedValue(actionsClientMock.create()), + getUnsecuredActionsClient: jest.fn().mockReturnValue(unsecuredActionsClientMock.create()), getActionsAuthorizationWithRequest: jest .fn() .mockReturnValue(actionsAuthorizationMock.create()), diff --git a/x-pack/plugins/actions/server/plugin.ts b/x-pack/plugins/actions/server/plugin.ts index 749fc7a21ebdf..8d2f7d6bb6320 100644 --- a/x-pack/plugins/actions/server/plugin.ts +++ b/x-pack/plugins/actions/server/plugin.ts @@ -101,6 +101,11 @@ import { createSubActionConnectorFramework } from './sub_action_framework'; import { IServiceAbstract, SubActionConnectorType } from './sub_action_framework/types'; import { SubActionConnector } from './sub_action_framework/sub_action_connector'; import { CaseConnector } from './sub_action_framework/case'; +import { + type IUnsecuredActionsClient, + UnsecuredActionsClient, +} from './unsecured_actions_client/unsecured_actions_client'; +import { createBulkUnsecuredExecutionEnqueuerFunction } from './create_unsecured_execute_function'; export interface PluginSetupContract { registerType< @@ -138,6 +143,8 @@ export interface PluginStartContract { preconfiguredActions: PreConfiguredAction[]; + getUnsecuredActionsClient(): IUnsecuredActionsClient; + renderActionParameterTemplates<Params extends ActionTypeParams = ActionTypeParams>( actionTypeId: string, actionId: string, @@ -453,6 +460,21 @@ export class ActionsPlugin implements Plugin<PluginSetupContract, PluginStartCon }); }; + const getUnsecuredActionsClient = () => { + const internalSavedObjectsRepository = core.savedObjects.createInternalRepository([ + ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE, + ]); + + return new UnsecuredActionsClient({ + internalSavedObjectsRepository, + executionEnqueuer: createBulkUnsecuredExecutionEnqueuerFunction({ + taskManager: plugins.taskManager, + connectorTypeRegistry: actionTypeRegistry!, + preconfiguredConnectors: preconfiguredActions, + }), + }); + }; + // Ensure the public API cannot be used to circumvent authorization // using our legacy exemption mechanism by passing in a legacy SO // as authorizationContext which would then set a Legacy AuthorizationMode @@ -533,6 +555,7 @@ export class ActionsPlugin implements Plugin<PluginSetupContract, PluginStartCon return instantiateAuthorization(request); }, getActionsClientWithRequest: secureGetActionsClientWithRequest, + getUnsecuredActionsClient, preconfiguredActions, renderActionParameterTemplates: (...args) => renderActionParameterTemplates(actionTypeRegistry, ...args), diff --git a/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.mock.ts b/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.mock.ts new file mode 100644 index 0000000000000..61318a4707ca8 --- /dev/null +++ b/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.mock.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { IUnsecuredActionsClient } from './unsecured_actions_client'; + +export type UnsecuredActionsClientMock = jest.Mocked<IUnsecuredActionsClient>; + +const createUnsecuredActionsClientMock = () => { + const mocked: UnsecuredActionsClientMock = { + bulkEnqueueExecution: jest.fn(), + }; + return mocked; +}; + +export const unsecuredActionsClientMock = { + create: createUnsecuredActionsClientMock, +}; diff --git a/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.test.ts b/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.test.ts new file mode 100644 index 0000000000000..c863e943b8dc0 --- /dev/null +++ b/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.test.ts @@ -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 { UnsecuredActionsClient } from './unsecured_actions_client'; +import { savedObjectsRepositoryMock } from '@kbn/core/server/mocks'; + +const internalSavedObjectsRepository = savedObjectsRepositoryMock.create(); +const executionEnqueuer = jest.fn(); + +let unsecuredActionsClient: UnsecuredActionsClient; + +beforeEach(() => { + jest.resetAllMocks(); + unsecuredActionsClient = new UnsecuredActionsClient({ + internalSavedObjectsRepository, + executionEnqueuer, + }); +}); + +describe('bulkEnqueueExecution()', () => { + test('throws error when enqueuing execution with not allowed requester id', async () => { + const opts = [ + { + id: 'preconfigured1', + params: {}, + executionId: '123abc', + }, + { + id: 'preconfigured2', + params: {}, + executionId: '456def', + }, + ]; + await expect( + unsecuredActionsClient.bulkEnqueueExecution('badId', opts) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"\\"badId\\" feature is not allow-listed for UnsecuredActionsClient access."` + ); + }); + + test('calls the executionEnqueuer with the appropriate parameters', async () => { + const opts = [ + { + id: 'preconfigured1', + params: {}, + executionId: '123abc', + }, + { + id: 'preconfigured2', + params: {}, + executionId: '456def', + }, + ]; + await expect( + unsecuredActionsClient.bulkEnqueueExecution('notifications', opts) + ).resolves.toMatchInlineSnapshot(`undefined`); + + expect(executionEnqueuer).toHaveBeenCalledWith(internalSavedObjectsRepository, opts); + }); +}); diff --git a/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts b/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts new file mode 100644 index 0000000000000..333490389013a --- /dev/null +++ b/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.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 { ISavedObjectsRepository } from '@kbn/core/server'; +import { + BulkUnsecuredExecutionEnqueuer, + ExecuteOptions, +} from '../create_unsecured_execute_function'; + +// allowlist for features wanting access to the unsecured actions client +// which allows actions to be enqueued for execution without a user request +const ALLOWED_REQUESTER_IDS = [ + 'notifications', + // For functional testing + 'functional_tester', +]; + +export interface UnsecuredActionsClientOpts { + internalSavedObjectsRepository: ISavedObjectsRepository; + executionEnqueuer: BulkUnsecuredExecutionEnqueuer<void>; +} + +export interface IUnsecuredActionsClient { + bulkEnqueueExecution: (requesterId: string, actionsToExecute: ExecuteOptions[]) => Promise<void>; +} + +export class UnsecuredActionsClient { + private readonly internalSavedObjectsRepository: ISavedObjectsRepository; + private readonly executionEnqueuer: BulkUnsecuredExecutionEnqueuer<void>; + + constructor(params: UnsecuredActionsClientOpts) { + this.executionEnqueuer = params.executionEnqueuer; + this.internalSavedObjectsRepository = params.internalSavedObjectsRepository; + } + + public async bulkEnqueueExecution( + requesterId: string, + actionsToExecute: ExecuteOptions[] + ): Promise<void> { + // Check that requesterId is allowed + if (!ALLOWED_REQUESTER_IDS.includes(requesterId)) { + throw new Error( + `"${requesterId}" feature is not allow-listed for UnsecuredActionsClient access.` + ); + } + return this.executionEnqueuer(this.internalSavedObjectsRepository, actionsToExecute); + } +} diff --git a/x-pack/plugins/actions/tsconfig.json b/x-pack/plugins/actions/tsconfig.json index 6fced06e2057f..3928d87b2a871 100644 --- a/x-pack/plugins/actions/tsconfig.json +++ b/x-pack/plugins/actions/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "server/**/*", @@ -13,7 +12,7 @@ "public/**/*", "common/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../spaces/tsconfig.json" }, diff --git a/x-pack/plugins/aiops/server/lib/is_request_aborted_error.test.ts b/x-pack/plugins/aiops/server/lib/is_request_aborted_error.test.ts new file mode 100644 index 0000000000000..ee9725dedda4b --- /dev/null +++ b/x-pack/plugins/aiops/server/lib/is_request_aborted_error.test.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { isRequestAbortedError } from './is_request_aborted_error'; + +describe('isRequestAbortedError', () => { + it('returns false for a string', () => { + expect(isRequestAbortedError('the-error')).toBe(false); + }); + it('returns false for a an object without a name field', () => { + expect(isRequestAbortedError({ error: 'the-error' })).toBe(false); + }); + it(`returns false for a an object with a name field other than 'RequestAbortedError'`, () => { + expect(isRequestAbortedError({ name: 'the-error' })).toBe(false); + }); + it(`returns true for a an object with a name field that contains 'RequestAbortedError'`, () => { + expect(isRequestAbortedError({ name: 'RequestAbortedError' })).toBe(true); + }); +}); diff --git a/x-pack/plugins/aiops/server/lib/is_request_aborted_error.ts b/x-pack/plugins/aiops/server/lib/is_request_aborted_error.ts new file mode 100644 index 0000000000000..b80256dcd8639 --- /dev/null +++ b/x-pack/plugins/aiops/server/lib/is_request_aborted_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. + */ + +import { isPopulatedObject } from '@kbn/ml-is-populated-object'; + +interface RequestAbortedError extends Error { + name: 'RequestAbortedError'; +} + +export function isRequestAbortedError(arg: unknown): arg is RequestAbortedError { + return isPopulatedObject(arg, ['name']) && arg.name === 'RequestAbortedError'; +} diff --git a/x-pack/plugins/aiops/server/routes/explain_log_rate_spikes.ts b/x-pack/plugins/aiops/server/routes/explain_log_rate_spikes.ts index c61e1915f68f7..9324b70d7225b 100644 --- a/x-pack/plugins/aiops/server/routes/explain_log_rate_spikes.ts +++ b/x-pack/plugins/aiops/server/routes/explain_log_rate_spikes.ts @@ -5,18 +5,22 @@ * 2.0. */ -import { chunk } from 'lodash'; +import { queue } from 'async'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { i18n } from '@kbn/i18n'; -import { asyncForEach } from '@kbn/std'; import type { IRouter } from '@kbn/core/server'; import { KBN_FIELD_TYPES } from '@kbn/field-types'; import type { Logger } from '@kbn/logging'; import type { DataRequestHandlerContext } from '@kbn/data-plugin/server'; import { streamFactory } from '@kbn/aiops-utils'; -import type { ChangePoint, NumericChartData, NumericHistogramField } from '@kbn/ml-agg-utils'; +import type { + ChangePoint, + ChangePointGroup, + NumericChartData, + NumericHistogramField, +} from '@kbn/ml-agg-utils'; import { fetchHistogramsForFields } from '@kbn/ml-agg-utils'; import { stringHash } from '@kbn/ml-string-hash'; @@ -34,16 +38,18 @@ import { } from '../../common/api/explain_log_rate_spikes'; import { API_ENDPOINT } from '../../common/api'; +import { isRequestAbortedError } from '../lib/is_request_aborted_error'; import type { AiopsLicense } from '../types'; import { fetchChangePointPValues } from './queries/fetch_change_point_p_values'; -import { fetchFieldCandidates } from './queries/fetch_field_candidates'; +import { fetchIndexInfo } from './queries/fetch_index_info'; import { dropDuplicates, fetchFrequentItems, groupDuplicates, } from './queries/fetch_frequent_items'; import type { ItemsetResult } from './queries/fetch_frequent_items'; +import { getHistogramQuery } from './queries/get_histogram_query'; import { getFieldValuePairCounts, getSimpleHierarchicalTree, @@ -92,6 +98,7 @@ export const defineExplainLogRateSpikesRoute = ( const client = (await context.core).elasticsearch.client.asCurrentUser; const controller = new AbortController(); + const abortSignal = controller.signal; let isRunning = false; let loaded = 0; @@ -129,9 +136,13 @@ export const defineExplainLogRateSpikesRoute = ( } function end() { - isRunning = false; - logDebugMessage('Ending analysis.'); - streamEnd(); + if (isRunning) { + isRunning = false; + logDebugMessage('Ending analysis.'); + streamEnd(); + } else { + logDebugMessage('end() was called again with isRunning already being false.'); + } } function endWithUpdatedLoadingState() { @@ -162,32 +173,48 @@ export const defineExplainLogRateSpikesRoute = ( logDebugMessage('Reset.'); push(resetAction()); pushPingWithTimeout(); - logDebugMessage('Load field candidates.'); + + // Step 1: Index Info: Field candidates, total doc count, sample probability + + const fieldCandidates: Awaited<ReturnType<typeof fetchIndexInfo>>['fieldCandidates'] = []; + let sampleProbability = 1; + let totalDocCount = 0; + + logDebugMessage('Fetch index information.'); push( updateLoadingStateAction({ ccsWarning: false, loaded, loadingState: i18n.translate( - 'xpack.aiops.explainLogRateSpikes.loadingState.loadingFieldCandidates', + 'xpack.aiops.explainLogRateSpikes.loadingState.loadingIndexInformation', { - defaultMessage: 'Loading field candidates.', + defaultMessage: 'Loading index information.', } ), }) ); - let fieldCandidates: Awaited<ReturnType<typeof fetchFieldCandidates>>; try { - fieldCandidates = await fetchFieldCandidates(client, request.body); + const indexInfo = await fetchIndexInfo(client, request.body, abortSignal); + fieldCandidates.push(...indexInfo.fieldCandidates); + sampleProbability = indexInfo.sampleProbability; + totalDocCount = indexInfo.totalDocCount; } catch (e) { - logger.error(`Failed to fetch field candidates, got: \n${e.toString()}`); - pushError(`Failed to fetch field candidates.`); + if (!isRequestAbortedError(e)) { + logger.error(`Failed to fetch index information, got: \n${e.toString()}`); + pushError(`Failed to fetch index information.`); + } end(); return; } + logDebugMessage(`Total document count: ${totalDocCount}`); + logDebugMessage(`Sample probability: ${sampleProbability}`); + loaded += LOADED_FIELD_CANDIDATES; + const fieldCandidatesCount = fieldCandidates.length; + push( updateLoadingStateAction({ ccsWarning: false, @@ -198,52 +225,53 @@ export const defineExplainLogRateSpikesRoute = ( defaultMessage: 'Identified {fieldCandidatesCount, plural, one {# field candidate} other {# field candidates}}.', values: { - fieldCandidatesCount: fieldCandidates.length, + fieldCandidatesCount, }, } ), }) ); - if (fieldCandidates.length === 0) { + if (fieldCandidatesCount === 0) { endWithUpdatedLoadingState(); } else if (shouldStop) { + logDebugMessage('shouldStop after fetching field candidates.'); end(); return; } const changePoints: ChangePoint[] = []; const fieldsToSample = new Set<string>(); - const chunkSize = 10; - let chunkCount = 0; - const fieldCandidatesChunks = chunk(fieldCandidates, chunkSize); + // Don't use more than 10 here otherwise Kibana will emit an error + // regarding a limit of abort signal listeners of more than 10. + const MAX_CONCURRENT_QUERIES = 10; logDebugMessage('Fetch p-values.'); - for (const fieldCandidatesChunk of fieldCandidatesChunks) { - chunkCount++; - logDebugMessage( - `Fetch p-values. Chunk ${chunkCount} of ${fieldCandidatesChunks.length}` - ); + const pValuesQueue = queue(async function (fieldCandidate: string) { + loaded += (1 / fieldCandidatesCount) * PROGRESS_STEP_P_VALUES; + let pValues: Awaited<ReturnType<typeof fetchChangePointPValues>>; + try { pValues = await fetchChangePointPValues( client, request.body, - fieldCandidatesChunk, + [fieldCandidate], logger, - pushError + sampleProbability, + pushError, + abortSignal ); } catch (e) { - logger.error( - `Failed to fetch p-values for ${JSON.stringify( - fieldCandidatesChunk - )}, got: \n${e.toString()}` - ); - pushError(`Failed to fetch p-values for ${JSON.stringify(fieldCandidatesChunk)}.`); - // Still continue the analysis even if chunks of p-value queries fail. - continue; + if (!isRequestAbortedError(e)) { + logger.error( + `Failed to fetch p-values for '${fieldCandidate}', got: \n${e.toString()}` + ); + pushError(`Failed to fetch p-values for '${fieldCandidate}'.`); + } + return; } if (pValues.length > 0) { @@ -251,12 +279,10 @@ export const defineExplainLogRateSpikesRoute = ( fieldsToSample.add(d.fieldName); }); changePoints.push(...pValues); - } - loaded += (1 / fieldCandidatesChunks.length) * PROGRESS_STEP_P_VALUES; - if (pValues.length > 0) { push(addChangePointsAction(pValues)); } + push( updateLoadingStateAction({ ccsWarning: false, @@ -267,7 +293,7 @@ export const defineExplainLogRateSpikesRoute = ( defaultMessage: 'Identified {fieldValuePairsCount, plural, one {# significant field/value pair} other {# significant field/value pairs}}.', values: { - fieldValuePairsCount: changePoints?.length ?? 0, + fieldValuePairsCount: changePoints.length, }, } ), @@ -276,13 +302,15 @@ export const defineExplainLogRateSpikesRoute = ( if (shouldStop) { logDebugMessage('shouldStop fetching p-values.'); - + pValuesQueue.kill(); end(); - return; } - } + }, MAX_CONCURRENT_QUERIES); + + pValuesQueue.push(fieldCandidates); + await pValuesQueue.drain(); - if (changePoints?.length === 0) { + if (changePoints.length === 0) { logDebugMessage('Stopping analysis, did not find change points.'); endWithUpdatedLoadingState(); return; @@ -295,22 +323,28 @@ export const defineExplainLogRateSpikesRoute = ( logDebugMessage('Fetch overall histogram.'); let overallTimeSeries: NumericChartData | undefined; + + const overallHistogramQuery = getHistogramQuery(request.body); + try { overallTimeSeries = ( (await fetchHistogramsForFields( client, request.body.index, - { match_all: {} }, + overallHistogramQuery, // fields histogramFields, // samplerShardSize -1, - undefined + undefined, + abortSignal )) as [NumericChartData] )[0]; } catch (e) { - logger.error(`Failed to fetch the overall histogram data, got: \n${e.toString()}`); - pushError(`Failed to fetch overall histogram data.`); + if (!isRequestAbortedError(e)) { + logger.error(`Failed to fetch the overall histogram data, got: \n${e.toString()}`); + pushError(`Failed to fetch overall histogram data.`); + } // Still continue the analysis even if loading the overall histogram fails. } @@ -329,6 +363,12 @@ export const defineExplainLogRateSpikesRoute = ( ); } + if (shouldStop) { + logDebugMessage('shouldStop after fetching overall histogram.'); + end(); + return; + } + if (groupingEnabled) { logDebugMessage('Group results.'); @@ -374,9 +414,17 @@ export const defineExplainLogRateSpikesRoute = ( request.body.deviationMin, request.body.deviationMax, logger, - pushError + sampleProbability, + pushError, + abortSignal ); + if (shouldStop) { + logDebugMessage('shouldStop after fetching frequent_items.'); + end(); + return; + } + if (fields.length > 0 && df.length > 0) { // The way the `frequent_items` aggregations works could return item sets that include // field/value pairs that are not part of the original list of significant change points. @@ -517,17 +565,29 @@ export const defineExplainLogRateSpikesRoute = ( pushHistogramDataLoadingState(); - logDebugMessage('Fetch group histograms.'); + if (shouldStop) { + logDebugMessage('shouldStop after grouping.'); + end(); + return; + } + + logDebugMessage(`Fetch ${changePointGroups.length} group histograms.`); + + const groupHistogramQueue = queue(async function (cpg: ChangePointGroup) { + if (shouldStop) { + logDebugMessage('shouldStop abort fetching group histograms.'); + groupHistogramQueue.kill(); + end(); + return; + } - await asyncForEach(changePointGroups, async (cpg) => { if (overallTimeSeries !== undefined) { - const histogramQuery = { - bool: { - filter: cpg.group.map((d) => ({ - term: { [d.fieldName]: d.fieldValue }, - })), - }, - }; + const histogramQuery = getHistogramQuery( + request.body, + cpg.group.map((d) => ({ + term: { [d.fieldName]: d.fieldValue }, + })) + ); let cpgTimeSeries: NumericChartData; try { @@ -548,16 +608,19 @@ export const defineExplainLogRateSpikesRoute = ( ], // samplerShardSize -1, - undefined + undefined, + abortSignal )) as [NumericChartData] )[0]; } catch (e) { - logger.error( - `Failed to fetch the histogram data for group #${ - cpg.id - }, got: \n${e.toString()}` - ); - pushError(`Failed to fetch the histogram data for group #${cpg.id}.`); + if (!isRequestAbortedError(e)) { + logger.error( + `Failed to fetch the histogram data for group #${ + cpg.id + }, got: \n${e.toString()}` + ); + pushError(`Failed to fetch the histogram data for group #${cpg.id}.`); + } return; } const histogram = @@ -584,33 +647,41 @@ export const defineExplainLogRateSpikesRoute = ( ]) ); } - }); + }, MAX_CONCURRENT_QUERIES); + + groupHistogramQueue.push(changePointGroups); + await groupHistogramQueue.drain(); } } catch (e) { - logger.error( - `Failed to transform field/value pairs into groups, got: \n${e.toString()}` - ); - pushError(`Failed to transform field/value pairs into groups.`); + if (!isRequestAbortedError(e)) { + logger.error( + `Failed to transform field/value pairs into groups, got: \n${e.toString()}` + ); + pushError(`Failed to transform field/value pairs into groups.`); + } } } loaded += PROGRESS_STEP_HISTOGRAMS_GROUPS; - logDebugMessage('Fetch field/value histograms.'); + logDebugMessage(`Fetch ${changePoints.length} field/value histograms.`); // time series filtered by fields - if (changePoints && overallTimeSeries !== undefined) { - await asyncForEach(changePoints, async (cp) => { + if (changePoints.length > 0 && overallTimeSeries !== undefined) { + const fieldValueHistogramQueue = queue(async function (cp: ChangePoint) { + if (shouldStop) { + logDebugMessage('shouldStop abort fetching field/value histograms.'); + fieldValueHistogramQueue.kill(); + end(); + return; + } + if (overallTimeSeries !== undefined) { - const histogramQuery = { - bool: { - filter: [ - { - term: { [cp.fieldName]: cp.fieldValue }, - }, - ], + const histogramQuery = getHistogramQuery(request.body, [ + { + term: { [cp.fieldName]: cp.fieldValue }, }, - }; + ]); let cpTimeSeries: NumericChartData; @@ -632,7 +703,8 @@ export const defineExplainLogRateSpikesRoute = ( ], // samplerShardSize -1, - undefined + undefined, + abortSignal )) as [NumericChartData] )[0]; } catch (e) { @@ -676,13 +748,20 @@ export const defineExplainLogRateSpikesRoute = ( ]) ); } - }); + }, MAX_CONCURRENT_QUERIES); + + fieldValueHistogramQueue.push(changePoints); + await fieldValueHistogramQueue.drain(); } endWithUpdatedLoadingState(); } catch (e) { - logger.error(`Explain log rate spikes analysis failed to finish, got: \n${e.toString()}`); - pushError(`Explain log rate spikes analysis failed to finish.`); + if (!isRequestAbortedError(e)) { + logger.error( + `Explain log rate spikes analysis failed to finish, got: \n${e.toString()}` + ); + pushError(`Explain log rate spikes analysis failed to finish.`); + } end(); } } diff --git a/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts b/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts index 0fb7f90c89c12..6400cc08ca4db 100644 --- a/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts +++ b/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts @@ -10,9 +10,12 @@ import { ElasticsearchClient } from '@kbn/core/server'; import type { Logger } from '@kbn/logging'; import { ChangePoint } from '@kbn/ml-agg-utils'; +import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { SPIKE_ANALYSIS_THRESHOLD } from '../../../common/constants'; import type { AiopsExplainLogRateSpikesSchema } from '../../../common/api/explain_log_rate_spikes'; +import { isRequestAbortedError } from '../../lib/is_request_aborted_error'; + import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; @@ -21,7 +24,9 @@ import { getRequestBase } from './get_request_base'; export const getChangePointRequest = ( params: AiopsExplainLogRateSpikesSchema, - fieldName: string + fieldName: string, + // The default value of 1 means no sampling will be used + sampleProbability: number = 1 ): estypes.SearchRequest => { const query = getQueryWithParams({ params, @@ -48,36 +53,49 @@ export const getChangePointRequest = ( ]; } - const body = { - query, - size: 0, - aggs: { - change_point_p_value: { - significant_terms: { - field: fieldName, - background_filter: { - bool: { - filter: [ - ...filter, - { - range: { - [timeFieldName]: { - gte: params.baselineMin, - lt: params.baselineMax, - format: 'epoch_millis', - }, + const pValueAgg: Record<string, estypes.AggregationsAggregationContainer> = { + change_point_p_value: { + significant_terms: { + field: fieldName, + background_filter: { + bool: { + filter: [ + ...filter, + { + range: { + [timeFieldName]: { + gte: params.baselineMin, + lt: params.baselineMax, + format: 'epoch_millis', }, }, - ], - }, + }, + ], }, - p_value: { background_is_superset: false }, - size: 1000, }, + // @ts-expect-error `p_value` is not yet part of `AggregationsAggregationContainer` + p_value: { background_is_superset: false }, + size: 1000, + }, + }, + }; + + const randomSamplerAgg: Record<string, estypes.AggregationsAggregationContainer> = { + sample: { + // @ts-expect-error `random_sampler` is not yet part of `AggregationsAggregationContainer` + random_sampler: { + probability: sampleProbability, }, + aggs: pValueAgg, }, }; + const body = { + query, + size: 0, + aggs: sampleProbability < 1 ? randomSamplerAgg : pValueAgg, + }; + return { ...getRequestBase(params), body, @@ -90,33 +108,72 @@ interface Aggs extends estypes.AggregationsSignificantLongTermsAggregate { buckets: estypes.AggregationsSignificantLongTermsBucket[]; } +interface PValuesAggregation extends estypes.AggregationsSamplerAggregation { + change_point_p_value: Aggs; +} + +interface RandomSamplerAggregation { + sample: PValuesAggregation; +} + +function isRandomSamplerAggregation(arg: unknown): arg is RandomSamplerAggregation { + return isPopulatedObject(arg, ['sample']); +} + export const fetchChangePointPValues = async ( esClient: ElasticsearchClient, params: AiopsExplainLogRateSpikesSchema, fieldNames: string[], logger: Logger, - emitError: (m: string) => void + // The default value of 1 means no sampling will be used + sampleProbability: number = 1, + emitError: (m: string) => void, + abortSignal?: AbortSignal ): Promise<ChangePoint[]> => { const result: ChangePoint[] = []; - for (const fieldName of fieldNames) { - const request = getChangePointRequest(params, fieldName); - const resp = await esClient.search<unknown, { change_point_p_value: Aggs }>(request); - - if (resp.aggregations === undefined) { + const settledPromises = await Promise.allSettled( + fieldNames.map((fieldName) => + esClient.search<unknown, { sample: PValuesAggregation } | { change_point_p_value: Aggs }>( + getChangePointRequest(params, fieldName, sampleProbability), + { signal: abortSignal, maxRetries: 0 } + ) + ) + ); + + function reportError(fieldName: string, error: unknown) { + if (!isRequestAbortedError(error)) { logger.error( `Failed to fetch p-value aggregation for fieldName "${fieldName}", got: \n${JSON.stringify( - resp, + error, null, 2 )}` ); emitError(`Failed to fetch p-value aggregation for fieldName "${fieldName}".`); + } + } + + for (const [index, settledPromise] of settledPromises.entries()) { + const fieldName = fieldNames[index]; + + if (settledPromise.status === 'rejected') { + reportError(fieldName, settledPromise.reason); + // Still continue the analysis even if individual p-value queries fail. + continue; + } + + const resp = settledPromise.value; + + if (resp.aggregations === undefined) { + reportError(fieldName, resp); // Still continue the analysis even if individual p-value queries fail. continue; } - const overallResult = resp.aggregations.change_point_p_value; + const overallResult = isRandomSamplerAggregation(resp.aggregations) + ? resp.aggregations.sample.change_point_p_value + : resp.aggregations.change_point_p_value; for (const bucket of overallResult.buckets) { const pValue = Math.exp(-bucket.score); diff --git a/x-pack/plugins/aiops/server/routes/queries/fetch_field_candidates.test.ts b/x-pack/plugins/aiops/server/routes/queries/fetch_field_candidates.test.ts deleted file mode 100644 index 53e21e7a9dcce..0000000000000 --- a/x-pack/plugins/aiops/server/routes/queries/fetch_field_candidates.test.ts +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; - -import type { ElasticsearchClient } from '@kbn/core/server'; - -import type { AiopsExplainLogRateSpikesSchema } from '../../../common/api/explain_log_rate_spikes'; - -import { fetchFieldCandidates, getRandomDocsRequest } from './fetch_field_candidates'; - -const params: AiopsExplainLogRateSpikesSchema = { - index: 'the-index', - timeFieldName: 'the-time-field-name', - start: 1577836800000, - end: 1609459200000, - baselineMin: 10, - baselineMax: 20, - deviationMin: 30, - deviationMax: 40, - includeFrozen: false, - searchQuery: '{"bool":{"filter":[],"must":[{"match_all":{}}],"must_not":[]}}', -}; - -describe('query_field_candidates', () => { - describe('getRandomDocsRequest', () => { - it('returns the most basic request body for a sample of random documents', () => { - const req = getRandomDocsRequest(params); - - expect(req).toEqual({ - body: { - _source: false, - fields: ['*'], - query: { - function_score: { - query: { - bool: { - filter: [ - { bool: { filter: [], must: [{ match_all: {} }], must_not: [] } }, - { - range: { - 'the-time-field-name': { - format: 'epoch_millis', - gte: 1577836800000, - lte: 1609459200000, - }, - }, - }, - ], - }, - }, - random_score: {}, - }, - }, - size: 1000, - }, - index: params.index, - ignore_throttled: undefined, - ignore_unavailable: true, - }); - }); - }); - - describe('fetchFieldCandidates', () => { - it('returns field candidates and total hits', async () => { - const esClientFieldCapsMock = jest.fn(() => ({ - fields: { - myIpFieldName: { ip: {} }, - myKeywordFieldName: { keyword: {} }, - myUnpopulatedKeywordFieldName: { keyword: {} }, - myNumericFieldName: { number: {} }, - }, - })); - const esClientSearchMock = jest.fn((req: estypes.SearchRequest): estypes.SearchResponse => { - return { - hits: { - hits: [ - { - fields: { - myIpFieldName: '1.1.1.1', - myKeywordFieldName: 'myKeywordFieldValue', - myNumericFieldName: 1234, - }, - }, - ], - }, - } as unknown as estypes.SearchResponse; - }); - - const esClientMock = { - fieldCaps: esClientFieldCapsMock, - search: esClientSearchMock, - } as unknown as ElasticsearchClient; - - const resp = await fetchFieldCandidates(esClientMock, params); - - expect(resp).toEqual(['myIpFieldName', 'myKeywordFieldName']); - expect(esClientFieldCapsMock).toHaveBeenCalledTimes(1); - expect(esClientSearchMock).toHaveBeenCalledTimes(1); - }); - }); -}); diff --git a/x-pack/plugins/aiops/server/routes/queries/fetch_field_candidates.ts b/x-pack/plugins/aiops/server/routes/queries/fetch_field_candidates.ts deleted file mode 100644 index 7a761d91c0da5..0000000000000 --- a/x-pack/plugins/aiops/server/routes/queries/fetch_field_candidates.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; - -import { ES_FIELD_TYPES } from '@kbn/field-types'; - -import type { ElasticsearchClient } from '@kbn/core/server'; - -import type { AiopsExplainLogRateSpikesSchema } from '../../../common/api/explain_log_rate_spikes'; - -import { getQueryWithParams } from './get_query_with_params'; -import { getRequestBase } from './get_request_base'; - -// TODO Consolidate with duplicate `fetchPValues` in -// `x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts` - -const POPULATED_DOC_COUNT_SAMPLE_SIZE = 1000; - -const SUPPORTED_ES_FIELD_TYPES = [ - ES_FIELD_TYPES.KEYWORD, - ES_FIELD_TYPES.IP, - ES_FIELD_TYPES.BOOLEAN, -]; - -export const getRandomDocsRequest = ( - params: AiopsExplainLogRateSpikesSchema -): estypes.SearchRequest => ({ - ...getRequestBase(params), - body: { - fields: ['*'], - _source: false, - query: { - function_score: { - query: getQueryWithParams({ params }), - // @ts-ignore - random_score: {}, - }, - }, - size: POPULATED_DOC_COUNT_SAMPLE_SIZE, - }, -}); - -export const fetchFieldCandidates = async ( - esClient: ElasticsearchClient, - params: AiopsExplainLogRateSpikesSchema -): Promise<string[]> => { - const { index } = params; - // Get all supported fields - const respMapping = await esClient.fieldCaps({ - index, - fields: '*', - }); - - const finalFieldCandidates: Set<string> = new Set([]); - const acceptableFields: Set<string> = new Set(); - - Object.entries(respMapping.fields).forEach(([key, value]) => { - const fieldTypes = Object.keys(value) as ES_FIELD_TYPES[]; - const isSupportedType = fieldTypes.some((type) => SUPPORTED_ES_FIELD_TYPES.includes(type)); - - // Check if fieldName is something we can aggregate on - if (isSupportedType) { - acceptableFields.add(key); - } - }); - - const resp = await esClient.search(getRandomDocsRequest(params)); - const sampledDocs = resp.hits.hits.map((d) => d.fields ?? {}); - - // Get all field names for each returned doc and flatten it - // to a list of unique field names used across all docs. - // and filter by list of acceptable fields and some APM specific unique fields. - [...new Set(sampledDocs.map(Object.keys).flat(1))].forEach((field) => { - if (acceptableFields.has(field)) { - finalFieldCandidates.add(field); - } - }); - - return [...finalFieldCandidates]; -}; diff --git a/x-pack/plugins/aiops/server/routes/queries/fetch_frequent_items.ts b/x-pack/plugins/aiops/server/routes/queries/fetch_frequent_items.ts index c9444aaca22af..da4b8bbe5e792 100644 --- a/x-pack/plugins/aiops/server/routes/queries/fetch_frequent_items.ts +++ b/x-pack/plugins/aiops/server/routes/queries/fetch_frequent_items.ts @@ -12,6 +12,9 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { Logger } from '@kbn/logging'; import type { ChangePoint, FieldValuePair } from '@kbn/ml-agg-utils'; +import { isPopulatedObject } from '@kbn/ml-is-populated-object'; + +const FREQUENT_ITEMS_FIELDS_LIMIT = 15; interface FrequentItemsAggregation extends estypes.AggregationsSamplerAggregation { fi: { @@ -19,6 +22,14 @@ interface FrequentItemsAggregation extends estypes.AggregationsSamplerAggregatio }; } +interface RandomSamplerAggregation { + sample: FrequentItemsAggregation; +} + +function isRandomSamplerAggregation(arg: unknown): arg is RandomSamplerAggregation { + return isPopulatedObject(arg, ['sample']); +} + export function dropDuplicates(cps: ChangePoint[], uniqueFields: Array<keyof ChangePoint>) { return uniqWith(cps, (a, b) => isEqual(pick(a, uniqueFields), pick(b, uniqueFields))); } @@ -56,12 +67,24 @@ export async function fetchFrequentItems( deviationMin: number, deviationMax: number, logger: Logger, - emitError: (m: string) => void + // The default value of 1 means no sampling will be used + sampleProbability: number = 1, + emitError: (m: string) => void, + abortSignal?: AbortSignal ) { - // get unique fields from change points - const fields = [...new Set(changePoints.map((t) => t.fieldName))]; + // Sort change points by ascending p-value, necessary to apply the field limit correctly. + const sortedChangePoints = changePoints.slice().sort((a, b) => { + return (a.pValue ?? 0) - (b.pValue ?? 0); + }); + + // Get up to 15 unique fields from change points with retained order + const fields = sortedChangePoints.reduce<string[]>((p, c) => { + if (p.length < FREQUENT_ITEMS_FIELDS_LIMIT && !p.some((d) => d === c.fieldName)) { + p.push(c.fieldName); + } + return p; + }, []); - // TODO add query params const query = { bool: { minimum_should_match: 2, @@ -76,7 +99,7 @@ export async function fetchFrequentItems( }, }, ], - should: changePoints.map((t) => { + should: sortedChangePoints.map((t) => { return { term: { [t.fieldName]: t.fieldValue } }; }), }, @@ -86,48 +109,46 @@ export async function fetchFrequentItems( field, })); - const totalDocCount = changePoints[0].total_doc_count; - const minDocCount = 50000; - let sampleProbability = 1; - - if (totalDocCount > minDocCount) { - sampleProbability = Math.min(0.5, minDocCount / totalDocCount); - } - - logger.debug(`frequent_items sample probability: ${sampleProbability}`); + const frequentItemsAgg: Record<string, estypes.AggregationsAggregationContainer> = { + fi: { + // @ts-expect-error `frequent_items` is not yet part of `AggregationsAggregationContainer` + frequent_items: { + minimum_set_size: 2, + size: 200, + minimum_support: 0.1, + fields: aggFields, + }, + }, + }; // frequent items can be slow, so sample and use 10% min_support - const aggs: Record<string, estypes.AggregationsAggregationContainer> = { + const randomSamplerAgg: Record<string, estypes.AggregationsAggregationContainer> = { sample: { + // @ts-expect-error `random_sampler` is not yet part of `AggregationsAggregationContainer` random_sampler: { probability: sampleProbability, }, - aggs: { - fi: { - // @ts-expect-error `frequent_items` is not yet part of `AggregationsAggregationContainer` - frequent_items: { - minimum_set_size: 2, - size: 200, - minimum_support: 0.1, - fields: aggFields, - }, - }, - }, + aggs: frequentItemsAgg, }, }; - const body = await client.search<unknown, { sample: FrequentItemsAggregation }>( + const esBody = { + query, + aggs: sampleProbability < 1 ? randomSamplerAgg : frequentItemsAgg, + size: 0, + track_total_hits: true, + }; + + const body = await client.search< + unknown, + { sample: FrequentItemsAggregation } | FrequentItemsAggregation + >( { index, size: 0, - body: { - query, - aggs, - size: 0, - track_total_hits: true, - }, + body: esBody, }, - { maxRetries: 0 } + { signal: abortSignal, maxRetries: 0 } ); if (body.aggregations === undefined) { @@ -142,13 +163,17 @@ export async function fetchFrequentItems( const totalDocCountFi = (body.hits.total as estypes.SearchTotalHits).value; - const shape = body.aggregations.sample.fi.buckets.length; + const frequentItems = isRandomSamplerAggregation(body.aggregations) + ? body.aggregations.sample.fi + : body.aggregations.fi; + + const shape = frequentItems.buckets.length; let maximum = shape; if (maximum > 50000) { maximum = 50000; } - const fiss = body.aggregations.sample.fi.buckets; + const fiss = frequentItems.buckets; fiss.length = maximum; const results: ItemsetResult[] = []; @@ -166,7 +191,7 @@ export async function fetchFrequentItems( Object.entries(fis.key).forEach(([key, value]) => { result.set[key] = value[0]; - const pValue = changePoints.find( + const pValue = sortedChangePoints.find( (t) => t.fieldName === key && t.fieldValue === value[0] )?.pValue; diff --git a/x-pack/plugins/aiops/server/routes/queries/fetch_index_info.test.ts b/x-pack/plugins/aiops/server/routes/queries/fetch_index_info.test.ts new file mode 100644 index 0000000000000..084c415a652cd --- /dev/null +++ b/x-pack/plugins/aiops/server/routes/queries/fetch_index_info.test.ts @@ -0,0 +1,113 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; + +import type { ElasticsearchClient } from '@kbn/core/server'; + +import type { AiopsExplainLogRateSpikesSchema } from '../../../common/api/explain_log_rate_spikes'; + +import { fetchIndexInfo, getRandomDocsRequest } from './fetch_index_info'; + +const params: AiopsExplainLogRateSpikesSchema = { + index: 'the-index', + timeFieldName: 'the-time-field-name', + start: 1577836800000, + end: 1609459200000, + baselineMin: 10, + baselineMax: 20, + deviationMin: 30, + deviationMax: 40, + includeFrozen: false, + searchQuery: '{"bool":{"filter":[],"must":[{"match_all":{}}],"must_not":[]}}', +}; + +describe('fetch_index_info', () => { + describe('getRandomDocsRequest', () => { + it('returns the most basic request body for a sample of random documents', () => { + const req = getRandomDocsRequest(params); + + expect(req).toEqual({ + body: { + _source: false, + fields: ['*'], + query: { + function_score: { + query: { + bool: { + filter: [ + { bool: { filter: [], must: [{ match_all: {} }], must_not: [] } }, + { + range: { + 'the-time-field-name': { + format: 'epoch_millis', + gte: 1577836800000, + lte: 1609459200000, + }, + }, + }, + ], + }, + }, + random_score: {}, + }, + }, + size: 1000, + track_total_hits: true, + }, + index: params.index, + ignore_throttled: undefined, + ignore_unavailable: true, + }); + }); + }); + + describe('fetchFieldCandidates', () => { + it('returns field candidates and total hits', async () => { + const esClientFieldCapsMock = jest.fn(() => ({ + fields: { + myIpFieldName: { ip: {} }, + myKeywordFieldName: { keyword: {} }, + myUnpopulatedKeywordFieldName: { keyword: {} }, + myNumericFieldName: { number: {} }, + }, + })); + const esClientSearchMock = jest.fn((req: estypes.SearchRequest): estypes.SearchResponse => { + return { + hits: { + hits: [ + { + fields: { + myIpFieldName: '1.1.1.1', + myKeywordFieldName: 'myKeywordFieldValue', + myNumericFieldName: 1234, + }, + }, + ], + total: { value: 5000000 }, + }, + } as unknown as estypes.SearchResponse; + }); + + const esClientMock = { + fieldCaps: esClientFieldCapsMock, + search: esClientSearchMock, + } as unknown as ElasticsearchClient; + + const { totalDocCount, sampleProbability, fieldCandidates } = await fetchIndexInfo( + esClientMock, + params + ); + + expect(fieldCandidates).toEqual(['myIpFieldName', 'myKeywordFieldName']); + expect(sampleProbability).toEqual(0.01); + expect(totalDocCount).toEqual(5000000); + expect(esClientFieldCapsMock).toHaveBeenCalledTimes(1); + expect(esClientSearchMock).toHaveBeenCalledTimes(1); + }); + }); +}); diff --git a/x-pack/plugins/aiops/server/routes/queries/fetch_index_info.ts b/x-pack/plugins/aiops/server/routes/queries/fetch_index_info.ts new file mode 100644 index 0000000000000..f1444ef5972b2 --- /dev/null +++ b/x-pack/plugins/aiops/server/routes/queries/fetch_index_info.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 type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; + +import { ES_FIELD_TYPES } from '@kbn/field-types'; + +import type { ElasticsearchClient } from '@kbn/core/server'; + +import type { AiopsExplainLogRateSpikesSchema } from '../../../common/api/explain_log_rate_spikes'; + +import { getQueryWithParams } from './get_query_with_params'; +import { getRequestBase } from './get_request_base'; + +// TODO Consolidate with duplicate `fetchPValues` in +// `x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts` + +const POPULATED_DOC_COUNT_SAMPLE_SIZE = 1000; +const SAMPLE_PROBABILITY_MIN_DOC_COUNT = 50000; + +const SUPPORTED_ES_FIELD_TYPES = [ + ES_FIELD_TYPES.KEYWORD, + ES_FIELD_TYPES.IP, + ES_FIELD_TYPES.BOOLEAN, +]; + +export const getRandomDocsRequest = ( + params: AiopsExplainLogRateSpikesSchema +): estypes.SearchRequest => ({ + ...getRequestBase(params), + body: { + fields: ['*'], + _source: false, + query: { + function_score: { + query: getQueryWithParams({ params }), + // @ts-ignore + random_score: {}, + }, + }, + size: POPULATED_DOC_COUNT_SAMPLE_SIZE, + // Used to determine sample probability for follow up queries + track_total_hits: true, + }, +}); + +export const fetchIndexInfo = async ( + esClient: ElasticsearchClient, + params: AiopsExplainLogRateSpikesSchema, + abortSignal?: AbortSignal +): Promise<{ fieldCandidates: string[]; sampleProbability: number; totalDocCount: number }> => { + const { index } = params; + // Get all supported fields + const respMapping = await esClient.fieldCaps( + { + index, + fields: '*', + }, + { signal: abortSignal, maxRetries: 0 } + ); + + const finalFieldCandidates: Set<string> = new Set([]); + const acceptableFields: Set<string> = new Set(); + + Object.entries(respMapping.fields).forEach(([key, value]) => { + const fieldTypes = Object.keys(value) as ES_FIELD_TYPES[]; + const isSupportedType = fieldTypes.some((type) => SUPPORTED_ES_FIELD_TYPES.includes(type)); + + // Check if fieldName is something we can aggregate on + if (isSupportedType) { + acceptableFields.add(key); + } + }); + + // Only the deviation window will be used to identify field candidates and sample probability based on total doc count. + const resp = await esClient.search( + getRandomDocsRequest({ ...params, start: params.deviationMin, end: params.deviationMax }), + { + signal: abortSignal, + maxRetries: 0, + } + ); + const sampledDocs = resp.hits.hits.map((d) => d.fields ?? {}); + + // Get all field names for each returned doc and flatten it + // to a list of unique field names used across all docs + // and filter by list of acceptable fields. + [...new Set(sampledDocs.map(Object.keys).flat(1))].forEach((field) => { + if (acceptableFields.has(field)) { + finalFieldCandidates.add(field); + } + }); + + const totalDocCount = (resp.hits.total as estypes.SearchTotalHits).value; + + let sampleProbability = 1; + + if (totalDocCount > SAMPLE_PROBABILITY_MIN_DOC_COUNT) { + sampleProbability = Math.min(0.5, SAMPLE_PROBABILITY_MIN_DOC_COUNT / totalDocCount); + } + + return { fieldCandidates: [...finalFieldCandidates], sampleProbability, totalDocCount }; +}; diff --git a/x-pack/plugins/aiops/server/routes/queries/get_histogram_query.test.ts b/x-pack/plugins/aiops/server/routes/queries/get_histogram_query.test.ts new file mode 100644 index 0000000000000..95113d39f41c8 --- /dev/null +++ b/x-pack/plugins/aiops/server/routes/queries/get_histogram_query.test.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 { getHistogramQuery } from './get_histogram_query'; + +const paramsMock = { + index: 'the-index', + timeFieldName: 'the-time-field-name', + start: 1577836800000, + end: 1609459200000, + baselineMin: 10, + baselineMax: 20, + deviationMin: 30, + deviationMax: 40, + includeFrozen: false, + searchQuery: '{"bool":{"filter":[],"must":[{"match_all":{}}],"must_not":[]}}', +}; + +describe('getHistogramQuery', () => { + it('returns histogram query without additional filters', () => { + const query = getHistogramQuery(paramsMock); + expect(query).toEqual({ + bool: { + filter: [ + { bool: { filter: [], must: [{ match_all: {} }], must_not: [] } }, + { + range: { + 'the-time-field-name': { + format: 'epoch_millis', + gte: 1577836800000, + lte: 1609459200000, + }, + }, + }, + ], + }, + }); + }); + + it('returns histogram query with additional filters', () => { + const query = getHistogramQuery(paramsMock, [ + { + term: { ['the-filter-fieldName']: 'the-filter-fieldValue' }, + }, + ]); + expect(query).toEqual({ + bool: { + filter: [ + { bool: { filter: [], must: [{ match_all: {} }], must_not: [] } }, + { + term: { + 'the-filter-fieldName': 'the-filter-fieldValue', + }, + }, + { + range: { + 'the-time-field-name': { + format: 'epoch_millis', + gte: 1577836800000, + lte: 1609459200000, + }, + }, + }, + ], + }, + }); + }); +}); diff --git a/x-pack/plugins/aiops/server/routes/queries/get_histogram_query.ts b/x-pack/plugins/aiops/server/routes/queries/get_histogram_query.ts new file mode 100644 index 0000000000000..f8e7138699fc4 --- /dev/null +++ b/x-pack/plugins/aiops/server/routes/queries/get_histogram_query.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 type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; + +import type { AiopsExplainLogRateSpikesSchema } from '../../../common/api/explain_log_rate_spikes'; + +import { getQueryWithParams } from './get_query_with_params'; + +export function getHistogramQuery( + params: AiopsExplainLogRateSpikesSchema, + filter: estypes.QueryDslQueryContainer[] = [] +) { + const histogramQuery = getQueryWithParams({ + params, + }); + + if (Array.isArray(histogramQuery.bool.filter)) { + const existingFilter = histogramQuery.bool.filter.filter((d) => Object.keys(d)[0] !== 'range'); + + histogramQuery.bool.filter = [ + ...existingFilter, + ...filter, + { + range: { + [params.timeFieldName]: { + gte: params.start, + lte: params.end, + format: 'epoch_millis', + }, + }, + }, + ]; + } + + return histogramQuery; +} diff --git a/x-pack/plugins/aiops/tsconfig.json b/x-pack/plugins/aiops/tsconfig.json index d91aab0ecf39a..d528e4fa3642d 100644 --- a/x-pack/plugins/aiops/tsconfig.json +++ b/x-pack/plugins/aiops/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "../../../typings/**/*", @@ -14,7 +13,7 @@ "server/**/*", "types/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, diff --git a/x-pack/plugins/alerting/README.md b/x-pack/plugins/alerting/README.md index ffe17b91b8aeb..b0d1cb19b0ccb 100644 --- a/x-pack/plugins/alerting/README.md +++ b/x-pack/plugins/alerting/README.md @@ -120,13 +120,9 @@ This is the primary function for a rule type. Whenever the rule needs to execute |previousStartedAt|The previous date and time the rule type started a successful execution.| |params|Parameters for the execution. This is where the parameters you require will be passed in. (e.g. threshold). Use rule type validation to ensure values are set before execution.| |state|State returned from the previous execution. This is the rule level state. What the executor returns will be serialized and provided here at the next execution.| -|alertId|The id of this rule.| |spaceId|The id of the space of this rule.| |namespace|The namespace of the space of this rule. This is the same as `spaceId`, unless `spaceId === "default"`, in which case the namespace = `undefined`.| -|name|The name of this rule. This will eventually be removed in favor of `rule.name`.| -|tags|The tags associated with this rule. This will eventually be removed in favor of `rule.tags`.| -|createdBy|The user ID of the user that created this rule. This will eventually be removed in favor of `rule.createdBy`.| -|updatedBy|The user ID of the user that last updated this rule. This will eventually be removed in favor of `rule.updatedBy`.| +|rule.id|The id of this rule.| |rule.name|The name of this rule.| |rule.tags|The tags associated with this rule.| |rule.consumer|The consumer of this rule type.| diff --git a/x-pack/plugins/alerting/common/execution_log_types.ts b/x-pack/plugins/alerting/common/execution_log_types.ts index 223b45cb98923..2d5e34df8f766 100644 --- a/x-pack/plugins/alerting/common/execution_log_types.ts +++ b/x-pack/plugins/alerting/common/execution_log_types.ts @@ -61,6 +61,7 @@ export interface IExecutionLog { schedule_delay_ms: number; timed_out: boolean; rule_id: string; + space_ids: string[]; rule_name: string; } diff --git a/x-pack/plugins/alerting/common/rule.ts b/x-pack/plugins/alerting/common/rule.ts index c6c598cf8aebc..56fcaa8832792 100644 --- a/x-pack/plugins/alerting/common/rule.ts +++ b/x-pack/plugins/alerting/common/rule.ts @@ -124,6 +124,7 @@ export type ResolvedSanitizedRule<Params extends RuleTypeParams = never> = Sanit export type SanitizedRuleConfig = Pick< SanitizedRule, + | 'id' | 'name' | 'tags' | 'consumer' diff --git a/x-pack/plugins/alerting/server/authorization/alerting_authorization.ts b/x-pack/plugins/alerting/server/authorization/alerting_authorization.ts index 7138aabe9d263..2b403684c8d53 100644 --- a/x-pack/plugins/alerting/server/authorization/alerting_authorization.ts +++ b/x-pack/plugins/alerting/server/authorization/alerting_authorization.ts @@ -51,6 +51,7 @@ export enum WriteOperations { UnmuteAlert = 'unmuteAlert', Snooze = 'snooze', BulkEdit = 'bulkEdit', + BulkDelete = 'bulkDelete', Unsnooze = 'unsnooze', } diff --git a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts index ee05e3cda32f6..6a57baaacef27 100644 --- a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts +++ b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts @@ -280,6 +280,7 @@ describe('getExecutionLogAggregation', () => { 'error.message', 'kibana.version', 'rule.id', + 'kibana.space_ids', 'rule.name', 'kibana.alerting.outcome', ], @@ -486,6 +487,7 @@ describe('getExecutionLogAggregation', () => { 'error.message', 'kibana.version', 'rule.id', + 'kibana.space_ids', 'rule.name', 'kibana.alerting.outcome', ], @@ -692,6 +694,7 @@ describe('getExecutionLogAggregation', () => { 'error.message', 'kibana.version', 'rule.id', + 'kibana.space_ids', 'rule.name', 'kibana.alerting.outcome', ], @@ -954,6 +957,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3074, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -976,6 +980,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, ], }); @@ -1203,6 +1208,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3074, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -1225,6 +1231,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, ], }); @@ -1444,6 +1451,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3074, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -1466,6 +1474,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, ], }); @@ -1690,6 +1699,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, { id: '61bb867b-661a-471f-bf92-23471afa10b3', @@ -1712,6 +1722,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3133, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, ], }); diff --git a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts index c2b261cd531ad..b65499de20d45 100644 --- a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts +++ b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { KueryNode } from '@kbn/core-saved-objects-api-server'; +import { KueryNode } from '@kbn/es-query'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import Boom from '@hapi/boom'; import { flatMap, get, isEmpty } from 'lodash'; @@ -18,6 +18,7 @@ const DEFAULT_MAX_BUCKETS_LIMIT = 1000; // do not retrieve more than this number const DEFAULT_MAX_KPI_BUCKETS_LIMIT = 10000; const RULE_ID_FIELD = 'rule.id'; +const SPACE_ID_FIELD = 'kibana.space_ids'; const RULE_NAME_FIELD = 'rule.name'; const PROVIDER_FIELD = 'event.provider'; const START_FIELD = 'event.start'; @@ -410,6 +411,7 @@ export function getExecutionLogAggregation({ ERROR_MESSAGE_FIELD, VERSION_FIELD, RULE_ID_FIELD, + SPACE_ID_FIELD, RULE_NAME_FIELD, ALERTING_OUTCOME_FIELD, ], @@ -443,7 +445,7 @@ export function getExecutionLogAggregation({ function buildDslFilterQuery(filter: IExecutionLogAggOptions['filter']) { try { const filterKueryNode = typeof filter === 'string' ? fromKueryExpression(filter) : filter; - return filter ? toElasticsearchQuery(filterKueryNode) : undefined; + return filterKueryNode ? toElasticsearchQuery(filterKueryNode) : undefined; } catch (err) { throw Boom.badRequest(`Invalid kuery syntax for filter ${filter}`); } @@ -494,8 +496,9 @@ function formatExecutionLogAggBucket(bucket: IExecutionUuidAggBucket): IExecutio status === 'failure' ? `${outcomeMessage} - ${outcomeErrorMessage}` : outcomeMessage; const version = outcomeAndMessage.kibana?.version ?? ''; - const ruleId = outcomeAndMessage.rule?.id ?? ''; - const ruleName = outcomeAndMessage.rule?.name ?? ''; + const ruleId = outcomeAndMessage ? outcomeAndMessage?.rule?.id ?? '' : ''; + const spaceIds = outcomeAndMessage ? outcomeAndMessage?.kibana?.space_ids ?? [] : []; + const ruleName = outcomeAndMessage ? outcomeAndMessage.rule?.name ?? '' : ''; return { id: bucket?.key ?? '', timestamp: bucket?.ruleExecution?.executeStartTime.value_as_string ?? '', @@ -515,6 +518,7 @@ function formatExecutionLogAggBucket(bucket: IExecutionUuidAggBucket): IExecutio schedule_delay_ms: scheduleDelayUs / Millis2Nanos, timed_out: timedOut, rule_id: ruleId, + space_ids: spaceIds, rule_name: ruleName, }; } diff --git a/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.test.ts b/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.test.ts index e86cd98f4a490..b36dfed980b02 100644 --- a/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.test.ts +++ b/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.test.ts @@ -25,7 +25,7 @@ const rule = { describe('wrapScopedClusterClient', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts b/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts index 9c10e619e3ebb..55dc0a5d62161 100644 --- a/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts +++ b/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts @@ -35,7 +35,7 @@ const createSearchSourceClientMock = () => { describe('wrapSearchSourceClient', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/alerting/server/mocks.ts b/x-pack/plugins/alerting/server/mocks.ts index b5e1a96d300dc..0a99489822d38 100644 --- a/x-pack/plugins/alerting/server/mocks.ts +++ b/x-pack/plugins/alerting/server/mocks.ts @@ -30,6 +30,7 @@ const createSetupMock = () => { const createStartMock = () => { const mock: jest.Mocked<PluginStartContract> = { listTypes: jest.fn(), + getAllTypes: jest.fn(), getAlertingAuthorizationWithRequest: jest.fn(), getRulesClientWithRequest: jest.fn().mockResolvedValue(rulesClientMock.create()), getFrameworkHealth: jest.fn(), diff --git a/x-pack/plugins/alerting/server/plugin.ts b/x-pack/plugins/alerting/server/plugin.ts index 7450dcb1a45d0..48d1bfee78e40 100644 --- a/x-pack/plugins/alerting/server/plugin.ts +++ b/x-pack/plugins/alerting/server/plugin.ts @@ -122,6 +122,8 @@ export interface PluginSetupContract { export interface PluginStartContract { listTypes: RuleTypeRegistry['list']; + getAllTypes: RuleTypeRegistry['getAllTypes']; + getRulesClientWithRequest(request: KibanaRequest): RulesClientApi; getAlertingAuthorizationWithRequest( @@ -464,6 +466,7 @@ export class AlertingPlugin { return { listTypes: ruleTypeRegistry!.list.bind(this.ruleTypeRegistry!), + getAllTypes: ruleTypeRegistry!.getAllTypes.bind(this.ruleTypeRegistry!), getAlertingAuthorizationWithRequest, getRulesClientWithRequest, getFrameworkHealth: async () => diff --git a/x-pack/plugins/alerting/server/routes/bulk_delete_rules.test.ts b/x-pack/plugins/alerting/server/routes/bulk_delete_rules.test.ts new file mode 100644 index 0000000000000..8fc27cfbc0054 --- /dev/null +++ b/x-pack/plugins/alerting/server/routes/bulk_delete_rules.test.ts @@ -0,0 +1,126 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { httpServiceMock } from '@kbn/core/server/mocks'; + +import { bulkDeleteRulesRoute } from './bulk_delete_rules'; +import { licenseStateMock } from '../lib/license_state.mock'; +import { mockHandlerArguments } from './_mock_handler_arguments'; +import { rulesClientMock } from '../rules_client.mock'; +import { RuleTypeDisabledError } from '../lib/errors/rule_type_disabled'; +import { verifyApiAccess } from '../lib/license_api_access'; + +const rulesClient = rulesClientMock.create(); + +jest.mock('../lib/license_api_access', () => ({ + verifyApiAccess: jest.fn(), +})); + +beforeEach(() => { + jest.resetAllMocks(); +}); + +describe('bulkDeleteRulesRoute', () => { + const bulkDeleteRequest = { filter: '' }; + const bulkDeleteResult = { errors: [], total: 1, taskIdsFailedToBeDeleted: [] }; + + it('should delete rules with proper parameters', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + + bulkDeleteRulesRoute({ router, licenseState }); + + const [config, handler] = router.patch.mock.calls[0]; + + expect(config.path).toBe('/internal/alerting/rules/_bulk_delete'); + + rulesClient.bulkDeleteRules.mockResolvedValueOnce(bulkDeleteResult); + + const [context, req, res] = mockHandlerArguments( + { rulesClient }, + { + body: bulkDeleteRequest, + }, + ['ok'] + ); + + expect(await handler(context, req, res)).toEqual({ + body: bulkDeleteResult, + }); + + expect(rulesClient.bulkDeleteRules).toHaveBeenCalledTimes(1); + expect(rulesClient.bulkDeleteRules.mock.calls[0]).toEqual([bulkDeleteRequest]); + + expect(res.ok).toHaveBeenCalled(); + }); + + it('ensures the license allows bulk deleting rules', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + + rulesClient.bulkDeleteRules.mockResolvedValueOnce(bulkDeleteResult); + + bulkDeleteRulesRoute({ router, licenseState }); + + const [, handler] = router.patch.mock.calls[0]; + + const [context, req, res] = mockHandlerArguments( + { rulesClient }, + { + body: bulkDeleteRequest, + } + ); + + await handler(context, req, res); + + expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); + }); + + it('ensures the license check prevents bulk deleting rules', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + + (verifyApiAccess as jest.Mock).mockImplementation(() => { + throw new Error('Failure'); + }); + + bulkDeleteRulesRoute({ router, licenseState }); + + const [, handler] = router.patch.mock.calls[0]; + + const [context, req, res] = mockHandlerArguments( + { rulesClient }, + { + body: bulkDeleteRequest, + } + ); + + expect(handler(context, req, res)).rejects.toMatchInlineSnapshot(`[Error: Failure]`); + }); + + it('ensures the rule type gets validated for the license', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + + bulkDeleteRulesRoute({ router, licenseState }); + + const [, handler] = router.patch.mock.calls[0]; + + rulesClient.bulkDeleteRules.mockRejectedValue( + new RuleTypeDisabledError('Fail', 'license_invalid') + ); + + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: {}, body: {} }, [ + 'ok', + 'forbidden', + ]); + + await handler(context, req, res); + + expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); + }); +}); diff --git a/x-pack/plugins/alerting/server/routes/bulk_delete_rules.ts b/x-pack/plugins/alerting/server/routes/bulk_delete_rules.ts new file mode 100644 index 0000000000000..1eca663de21a8 --- /dev/null +++ b/x-pack/plugins/alerting/server/routes/bulk_delete_rules.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 { schema } from '@kbn/config-schema'; +import { IRouter } from '@kbn/core/server'; +import { verifyAccessAndContext, handleDisabledApiKeysError } from './lib'; +import { ILicenseState, RuleTypeDisabledError } from '../lib'; +import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; + +export const bulkDeleteRulesRoute = ({ + router, + licenseState, +}: { + router: IRouter<AlertingRequestHandlerContext>; + licenseState: ILicenseState; +}) => { + router.patch( + { + path: `${INTERNAL_BASE_ALERTING_API_PATH}/rules/_bulk_delete`, + validate: { + body: schema.object({ + filter: schema.maybe(schema.string()), + ids: schema.maybe(schema.arrayOf(schema.string(), { minSize: 1, maxSize: 1000 })), + }), + }, + }, + handleDisabledApiKeysError( + router.handleLegacyErrors( + verifyAccessAndContext(licenseState, async (context, req, res) => { + const rulesClient = (await context.alerting).getRulesClient(); + const { filter, ids } = req.body; + + try { + const result = await rulesClient.bulkDeleteRules({ filter, ids }); + return res.ok({ body: result }); + } catch (e) { + if (e instanceof RuleTypeDisabledError) { + return e.sendResponse(res); + } + throw e; + } + }) + ) + ) + ); +}; diff --git a/x-pack/plugins/alerting/server/routes/get_action_error_log.ts b/x-pack/plugins/alerting/server/routes/get_action_error_log.ts index c833b65e34bb0..7e8028cad7f16 100644 --- a/x-pack/plugins/alerting/server/routes/get_action_error_log.ts +++ b/x-pack/plugins/alerting/server/routes/get_action_error_log.ts @@ -34,15 +34,19 @@ const querySchema = schema.object({ per_page: schema.number({ defaultValue: 10, min: 1 }), page: schema.number({ defaultValue: 1, min: 1 }), sort: sortFieldsSchema, + namespace: schema.maybe(schema.string()), + with_auth: schema.maybe(schema.boolean()), }); const rewriteReq: RewriteRequestCase<GetActionErrorLogByIdParams> = ({ date_start: dateStart, date_end: dateEnd, per_page: perPage, + namespace, ...rest }) => ({ ...rest, + namespace, dateStart, dateEnd, perPage, @@ -64,8 +68,13 @@ export const getActionErrorLogRoute = ( verifyAccessAndContext(licenseState, async function (context, req, res) { const rulesClient = (await context.alerting).getRulesClient(); const { id } = req.params; + const withAuth = req.query.with_auth; + const rewrittenReq = rewriteReq({ id, ...req.query }); + const getter = ( + withAuth ? rulesClient.getActionErrorLogWithAuth : rulesClient.getActionErrorLog + ).bind(rulesClient); return res.ok({ - body: await rulesClient.getActionErrorLog(rewriteReq({ id, ...req.query })), + body: await getter(rewrittenReq), }); }) ) diff --git a/x-pack/plugins/alerting/server/routes/get_global_execution_kpi.ts b/x-pack/plugins/alerting/server/routes/get_global_execution_kpi.ts index 29937cc3d8c98..2aec9d998a9e6 100644 --- a/x-pack/plugins/alerting/server/routes/get_global_execution_kpi.ts +++ b/x-pack/plugins/alerting/server/routes/get_global_execution_kpi.ts @@ -7,7 +7,7 @@ import { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; -import { RewriteRequestCase, verifyAccessAndContext } from './lib'; +import { RewriteRequestCase, verifyAccessAndContext, rewriteNamespaces } from './lib'; import { GetGlobalExecutionKPIParams } from '../rules_client'; import { ILicenseState } from '../lib'; @@ -15,14 +15,17 @@ const querySchema = schema.object({ date_start: schema.string(), date_end: schema.maybe(schema.string()), filter: schema.maybe(schema.string()), + namespaces: schema.maybe(schema.arrayOf(schema.string())), }); const rewriteReq: RewriteRequestCase<GetGlobalExecutionKPIParams> = ({ date_start: dateStart, date_end: dateEnd, + namespaces, ...rest }) => ({ ...rest, + namespaces: rewriteNamespaces(namespaces), dateStart, dateEnd, }); diff --git a/x-pack/plugins/alerting/server/routes/get_global_execution_logs.test.ts b/x-pack/plugins/alerting/server/routes/get_global_execution_logs.test.ts index 43b08ed0787e2..3ee2b0d1816ba 100644 --- a/x-pack/plugins/alerting/server/routes/get_global_execution_logs.test.ts +++ b/x-pack/plugins/alerting/server/routes/get_global_execution_logs.test.ts @@ -47,6 +47,7 @@ describe('getRuleExecutionLogRoute', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: ['namespace'], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -69,6 +70,7 @@ describe('getRuleExecutionLogRoute', () => { schedule_delay_ms: 3008, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: ['namespace'], }, ], }; diff --git a/x-pack/plugins/alerting/server/routes/get_global_execution_logs.ts b/x-pack/plugins/alerting/server/routes/get_global_execution_logs.ts index 4695e5e7bdf89..e08ec1ac5bcb8 100644 --- a/x-pack/plugins/alerting/server/routes/get_global_execution_logs.ts +++ b/x-pack/plugins/alerting/server/routes/get_global_execution_logs.ts @@ -9,7 +9,7 @@ import { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; import { ILicenseState } from '../lib'; import { GetGlobalExecutionLogParams } from '../rules_client'; -import { RewriteRequestCase, verifyAccessAndContext } from './lib'; +import { RewriteRequestCase, verifyAccessAndContext, rewriteNamespaces } from './lib'; import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; const sortOrderSchema = schema.oneOf([schema.literal('asc'), schema.literal('desc')]); @@ -38,15 +38,18 @@ const querySchema = schema.object({ per_page: schema.number({ defaultValue: 10, min: 1 }), page: schema.number({ defaultValue: 1, min: 1 }), sort: sortFieldsSchema, + namespaces: schema.maybe(schema.arrayOf(schema.string())), }); const rewriteReq: RewriteRequestCase<GetGlobalExecutionLogParams> = ({ date_start: dateStart, date_end: dateEnd, per_page: perPage, + namespaces, ...rest }) => ({ ...rest, + namespaces: rewriteNamespaces(namespaces), dateStart, dateEnd, perPage, diff --git a/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts b/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts index 048da6cbabeb3..eb22a6429809a 100644 --- a/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts +++ b/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts @@ -48,6 +48,7 @@ describe('getRuleExecutionLogRoute', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: ['namespace'], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -70,6 +71,7 @@ describe('getRuleExecutionLogRoute', () => { schedule_delay_ms: 3008, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: ['namespace'], }, ], }; diff --git a/x-pack/plugins/alerting/server/routes/index.ts b/x-pack/plugins/alerting/server/routes/index.ts index de9e2f112d9e9..dfb9c290af3d2 100644 --- a/x-pack/plugins/alerting/server/routes/index.ts +++ b/x-pack/plugins/alerting/server/routes/index.ts @@ -38,6 +38,7 @@ import { bulkEditInternalRulesRoute } from './bulk_edit_rules'; import { snoozeRuleRoute } from './snooze_rule'; import { unsnoozeRuleRoute } from './unsnooze_rule'; import { runSoonRoute } from './run_soon'; +import { bulkDeleteRulesRoute } from './bulk_delete_rules'; export interface RouteOptions { router: IRouter<AlertingRequestHandlerContext>; @@ -76,6 +77,7 @@ export function defineRoutes(opts: RouteOptions) { unmuteAlertRoute(router, licenseState); updateRuleApiKeyRoute(router, licenseState); bulkEditInternalRulesRoute(router, licenseState); + bulkDeleteRulesRoute({ router, licenseState }); snoozeRuleRoute(router, licenseState); unsnoozeRuleRoute(router, licenseState); runSoonRoute(router, licenseState); diff --git a/x-pack/plugins/alerting/server/routes/lib/index.ts b/x-pack/plugins/alerting/server/routes/lib/index.ts index e772f091bb059..90d903ada6eed 100644 --- a/x-pack/plugins/alerting/server/routes/lib/index.ts +++ b/x-pack/plugins/alerting/server/routes/lib/index.ts @@ -19,3 +19,4 @@ export type { export { verifyAccessAndContext } from './verify_access_and_context'; export { countUsageOfPredefinedIds } from './count_usage_of_predefined_ids'; export { rewriteRule } from './rewrite_rule'; +export { rewriteNamespaces } from './rewrite_namespaces'; diff --git a/x-pack/plugins/alerting/server/routes/lib/rewrite_namespaces.ts b/x-pack/plugins/alerting/server/routes/lib/rewrite_namespaces.ts new file mode 100644 index 0000000000000..5339b41526efe --- /dev/null +++ b/x-pack/plugins/alerting/server/routes/lib/rewrite_namespaces.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 const rewriteNamespaces = (namespaces?: Array<string | undefined>) => + namespaces + ? namespaces.map((id: string | undefined) => (id === 'default' ? undefined : id)) + : undefined; diff --git a/x-pack/plugins/alerting/server/rule_type_registry.mock.ts b/x-pack/plugins/alerting/server/rule_type_registry.mock.ts index 0af9d4b2d2342..706484fdd92f6 100644 --- a/x-pack/plugins/alerting/server/rule_type_registry.mock.ts +++ b/x-pack/plugins/alerting/server/rule_type_registry.mock.ts @@ -16,6 +16,7 @@ const createRuleTypeRegistryMock = () => { register: jest.fn(), get: jest.fn(), list: jest.fn(), + getAllTypes: jest.fn(), ensureRuleTypeEnabled: jest.fn(), }; return mocked; diff --git a/x-pack/plugins/alerting/server/rule_type_registry.test.ts b/x-pack/plugins/alerting/server/rule_type_registry.test.ts index ed52ebf8b04da..5ca22edaa9e04 100644 --- a/x-pack/plugins/alerting/server/rule_type_registry.test.ts +++ b/x-pack/plugins/alerting/server/rule_type_registry.test.ts @@ -611,6 +611,37 @@ describe('Create Lifecycle', () => { }); }); + describe('getAllTypes()', () => { + test('should return empty when nothing is registered', () => { + const registry = new RuleTypeRegistry(ruleTypeRegistryParams); + const result = registry.getAllTypes(); + expect(result).toEqual([]); + }); + + test('should return list of registered type ids', () => { + const registry = new RuleTypeRegistry(ruleTypeRegistryParams); + registry.register({ + id: 'test', + name: 'Test', + actionGroups: [ + { + id: 'testActionGroup', + name: 'Test Action Group', + }, + ], + defaultActionGroupId: 'testActionGroup', + doesSetRecoveryContext: false, + isExportable: true, + ruleTaskTimeout: '20m', + minimumLicenseRequired: 'basic', + executor: jest.fn(), + producer: 'alerts', + }); + const result = registry.getAllTypes(); + expect(result).toEqual(['test']); + }); + }); + describe('ensureRuleTypeEnabled', () => { let ruleTypeRegistry: RuleTypeRegistry; diff --git a/x-pack/plugins/alerting/server/rule_type_registry.ts b/x-pack/plugins/alerting/server/rule_type_registry.ts index 338450746781b..b908f7cb67b87 100644 --- a/x-pack/plugins/alerting/server/rule_type_registry.ts +++ b/x-pack/plugins/alerting/server/rule_type_registry.ts @@ -371,6 +371,10 @@ export class RuleTypeRegistry { ) ); } + + public getAllTypes(): string[] { + return [...this.ruleTypes.keys()]; + } } function normalizedActionVariables(actionVariables: RuleType['actionVariables']) { diff --git a/x-pack/plugins/alerting/server/rules_client.mock.ts b/x-pack/plugins/alerting/server/rules_client.mock.ts index 2092b98e48c0d..46a6c36bdea2a 100644 --- a/x-pack/plugins/alerting/server/rules_client.mock.ts +++ b/x-pack/plugins/alerting/server/rules_client.mock.ts @@ -34,8 +34,10 @@ const createRulesClientMock = () => { getGlobalExecutionKpiWithAuth: jest.fn(), getGlobalExecutionLogWithAuth: jest.fn(), getActionErrorLog: jest.fn(), + getActionErrorLogWithAuth: jest.fn(), getSpaceId: jest.fn(), bulkEdit: jest.fn(), + bulkDeleteRules: jest.fn(), snooze: jest.fn(), unsnooze: jest.fn(), calculateIsSnoozedUntil: jest.fn(), diff --git a/x-pack/plugins/alerting/server/rules_client/lib/index.ts b/x-pack/plugins/alerting/server/rules_client/lib/index.ts index f3f11589d2966..a221327d938ef 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/index.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/index.ts @@ -8,5 +8,6 @@ export { mapSortField } from './map_sort_field'; export { validateOperationOnAttributes } from './validate_attributes'; export { retryIfBulkEditConflicts } from './retry_if_bulk_edit_conflicts'; +export { retryIfBulkDeleteConflicts } from './retry_if_bulk_delete_conflicts'; export { applyBulkEditOperation } from './apply_bulk_edit_operation'; export { buildKueryNodeFilter } from './build_kuery_node_filter'; diff --git a/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_delete_conflicts.test.ts b/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_delete_conflicts.test.ts new file mode 100644 index 0000000000000..32a18ea7f0984 --- /dev/null +++ b/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_delete_conflicts.test.ts @@ -0,0 +1,100 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { KueryNode } from '@kbn/es-query'; +import { loggingSystemMock } from '@kbn/core/server/mocks'; + +import { retryIfBulkDeleteConflicts } from './retry_if_bulk_delete_conflicts'; +import { RETRY_IF_CONFLICTS_ATTEMPTS } from './wait_before_next_retry'; + +const mockFilter: KueryNode = { + type: 'function', + value: 'mock', +}; + +const mockLogger = loggingSystemMock.create().get(); + +const mockSuccessfulResult = { + apiKeysToInvalidate: ['apiKey1'], + errors: [], + taskIdsToDelete: ['taskId1'], +}; + +const error409 = { + message: 'some fake message', + status: 409, + rule: { + id: 'fake_rule_id', + name: 'fake rule name', + }, +}; + +const getOperationConflictsTimes = (times: number) => { + return async () => { + conflictOperationMock(); + times--; + if (times >= 0) { + return { + apiKeysToInvalidate: [], + taskIdsToDelete: [], + errors: [error409], + }; + } + return mockSuccessfulResult; + }; +}; + +const OperationSuccessful = async () => mockSuccessfulResult; +const conflictOperationMock = jest.fn(); + +describe('retryIfBulkDeleteConflicts', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + test('should work when operation is successful', async () => { + const result = await retryIfBulkDeleteConflicts(mockLogger, OperationSuccessful, mockFilter); + + expect(result).toEqual(mockSuccessfulResult); + }); + + test('should throw error when operation fails', async () => { + await expect( + retryIfBulkDeleteConflicts( + mockLogger, + async () => { + throw Error('Test failure'); + }, + mockFilter + ) + ).rejects.toThrowError('Test failure'); + }); + + test(`should return conflict errors when number of retries exceeds ${RETRY_IF_CONFLICTS_ATTEMPTS}`, async () => { + const result = await retryIfBulkDeleteConflicts( + mockLogger, + getOperationConflictsTimes(RETRY_IF_CONFLICTS_ATTEMPTS + 1), + mockFilter + ); + + expect(result.errors).toEqual([error409]); + expect(mockLogger.warn).toBeCalledWith('Bulk delete rules conflicts, exceeded retries'); + }); + + for (let i = 1; i <= RETRY_IF_CONFLICTS_ATTEMPTS; i++) { + test(`should work when operation conflicts ${i} times`, async () => { + const result = await retryIfBulkDeleteConflicts( + mockLogger, + getOperationConflictsTimes(i), + mockFilter + ); + + expect(conflictOperationMock.mock.calls.length).toBe(i + 1); + expect(result).toStrictEqual(mockSuccessfulResult); + }); + } +}); diff --git a/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_delete_conflicts.ts b/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_delete_conflicts.ts new file mode 100644 index 0000000000000..529055b85e44a --- /dev/null +++ b/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_delete_conflicts.ts @@ -0,0 +1,130 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import pMap from 'p-map'; +import { chunk } from 'lodash'; +import { KueryNode } from '@kbn/es-query'; +import { Logger } from '@kbn/core/server'; +import { convertRuleIdsToKueryNode } from '../../lib'; +import { BulkDeleteError } from '../rules_client'; +import { waitBeforeNextRetry, RETRY_IF_CONFLICTS_ATTEMPTS } from './wait_before_next_retry'; + +const MAX_RULES_IDS_IN_RETRY = 1000; + +export type BulkDeleteOperation = (filter: KueryNode | null) => Promise<{ + apiKeysToInvalidate: string[]; + errors: BulkDeleteError[]; + taskIdsToDelete: string[]; +}>; + +interface ReturnRetry { + apiKeysToInvalidate: string[]; + errors: BulkDeleteError[]; + taskIdsToDelete: string[]; +} + +/** + * Retries BulkDelete requests + * If in response are presents conflicted savedObjects(409 statusCode), this util constructs filter with failed SO ids and retries bulkDelete operation until + * all SO updated or number of retries exceeded + * @param logger + * @param bulkEditOperation + * @param filter - KueryNode filter + * @param retries - number of retries left + * @param accApiKeysToInvalidate - accumulated apiKeys that need to be invalidated + * @param accErrors - accumulated conflict errors + * @param accTaskIdsToDelete - accumulated task ids + * @returns Promise<ReturnRetry> + */ +export const retryIfBulkDeleteConflicts = async ( + logger: Logger, + bulkDeleteOperation: BulkDeleteOperation, + filter: KueryNode | null, + retries: number = RETRY_IF_CONFLICTS_ATTEMPTS, + accApiKeysToInvalidate: string[] = [], + accErrors: BulkDeleteError[] = [], + accTaskIdsToDelete: string[] = [] +): Promise<ReturnRetry> => { + try { + const { + apiKeysToInvalidate: currentApiKeysToInvalidate, + errors: currentErrors, + taskIdsToDelete: currentTaskIdsToDelete, + } = await bulkDeleteOperation(filter); + + const apiKeysToInvalidate = [...accApiKeysToInvalidate, ...currentApiKeysToInvalidate]; + const taskIdsToDelete = [...accTaskIdsToDelete, ...currentTaskIdsToDelete]; + const errors = + retries <= 0 + ? [...accErrors, ...currentErrors] + : [...accErrors, ...currentErrors.filter((error) => error.status !== 409)]; + + const ruleIdsWithConflictError = currentErrors.reduce<string[]>((acc, error) => { + if (error.status === 409) { + return [...acc, error.rule.id]; + } + return acc; + }, []); + + if (ruleIdsWithConflictError.length === 0) { + return { + apiKeysToInvalidate, + errors, + taskIdsToDelete, + }; + } + + if (retries <= 0) { + logger.warn('Bulk delete rules conflicts, exceeded retries'); + + return { + apiKeysToInvalidate, + errors, + taskIdsToDelete, + }; + } + + logger.debug( + `Bulk delete rules conflicts, retrying ..., ${ruleIdsWithConflictError.length} saved objects conflicted` + ); + + await waitBeforeNextRetry(retries); + + // here, we construct filter query with ids. But, due to a fact that number of conflicted saved objects can exceed few thousands we can encounter following error: + // "all shards failed: search_phase_execution_exception: [query_shard_exception] Reason: failed to create query: maxClauseCount is set to 2621" + // That's why we chunk processing ids into pieces by size equals to MAX_RULES_IDS_IN_RETRY + return ( + await pMap( + chunk(ruleIdsWithConflictError, MAX_RULES_IDS_IN_RETRY), + async (queryIds) => + retryIfBulkDeleteConflicts( + logger, + bulkDeleteOperation, + convertRuleIdsToKueryNode(queryIds), + retries - 1, + apiKeysToInvalidate, + errors, + taskIdsToDelete + ), + { + concurrency: 1, + } + ) + ).reduce<ReturnRetry>( + (acc, item) => { + return { + apiKeysToInvalidate: [...acc.apiKeysToInvalidate, ...item.apiKeysToInvalidate], + errors: [...acc.errors, ...item.errors], + taskIdsToDelete: [...acc.taskIdsToDelete, ...item.taskIdsToDelete], + }; + }, + { apiKeysToInvalidate: [], errors: [], taskIdsToDelete: [] } + ); + } catch (err) { + throw err; + } +}; diff --git a/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_edit_conflicts.test.ts b/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_edit_conflicts.test.ts index ae2a83614ac20..5053b367b938e 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_edit_conflicts.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_edit_conflicts.test.ts @@ -6,10 +6,8 @@ */ import { KueryNode } from '@kbn/es-query'; -import { - retryIfBulkEditConflicts, - RetryForConflictsAttempts, -} from './retry_if_bulk_edit_conflicts'; +import { retryIfBulkEditConflicts } from './retry_if_bulk_edit_conflicts'; +import { RETRY_IF_CONFLICTS_ATTEMPTS } from './wait_before_next_retry'; import { loggingSystemMock } from '@kbn/core/server/mocks'; const mockFilter: KueryNode = { @@ -112,11 +110,11 @@ describe('retryIfBulkEditConflicts', () => { ).rejects.toThrowError('Test failure'); }); - test(`should return conflict errors when number of retries exceeds ${RetryForConflictsAttempts}`, async () => { + test(`should return conflict errors when number of retries exceeds ${RETRY_IF_CONFLICTS_ATTEMPTS}`, async () => { const result = await retryIfBulkEditConflicts( mockLogger, mockOperationName, - getOperationConflictsTimes(RetryForConflictsAttempts + 1), + getOperationConflictsTimes(RETRY_IF_CONFLICTS_ATTEMPTS + 1), mockFilter ); @@ -132,7 +130,7 @@ describe('retryIfBulkEditConflicts', () => { expect(mockLogger.warn).toBeCalledWith(`${mockOperationName} conflicts, exceeded retries`); }); - for (let i = 1; i <= RetryForConflictsAttempts; i++) { + for (let i = 1; i <= RETRY_IF_CONFLICTS_ATTEMPTS; i++) { test(`should work when operation conflicts ${i} times`, async () => { const result = await retryIfBulkEditConflicts( mockLogger, diff --git a/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_edit_conflicts.ts b/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_edit_conflicts.ts index 9e1e60acb768f..550e13a6bffe5 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_edit_conflicts.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/retry_if_bulk_edit_conflicts.ts @@ -12,15 +12,7 @@ import { Logger, SavedObjectsBulkUpdateObject, SavedObjectsUpdateResponse } from import { convertRuleIdsToKueryNode } from '../../lib'; import { BulkEditError } from '../rules_client'; import { RawRule } from '../../types'; - -// number of times to retry when conflicts occur -export const RetryForConflictsAttempts = 2; - -// milliseconds to wait before retrying when conflicts occur -// note: we considered making this random, to help avoid a stampede, but -// with 1 retry it probably doesn't matter, and adding randomness could -// make it harder to diagnose issues -const RetryForConflictsDelay = 250; +import { waitBeforeNextRetry, RETRY_IF_CONFLICTS_ATTEMPTS } from './wait_before_next_retry'; // max number of failed SO ids in one retry filter const MaxIdsNumberInRetryFilter = 1000; @@ -57,7 +49,7 @@ export const retryIfBulkEditConflicts = async ( name: string, bulkEditOperation: BulkEditOperation, filter: KueryNode | null, - retries: number = RetryForConflictsAttempts, + retries: number = RETRY_IF_CONFLICTS_ATTEMPTS, accApiKeysToInvalidate: string[] = [], accResults: Array<SavedObjectsUpdateResponse<RawRule>> = [], accErrors: BulkEditError[] = [] @@ -154,13 +146,3 @@ export const retryIfBulkEditConflicts = async ( throw err; } }; - -// exponential delay before retry with adding random delay -async function waitBeforeNextRetry(retries: number): Promise<void> { - const exponentialDelayMultiplier = 1 + (RetryForConflictsAttempts - retries) ** 2; - const randomDelayMs = Math.floor(Math.random() * 100); - - await new Promise((resolve) => - setTimeout(resolve, RetryForConflictsDelay * exponentialDelayMultiplier + randomDelayMs) - ); -} diff --git a/x-pack/plugins/alerting/server/rules_client/lib/wait_before_next_retry.test.ts b/x-pack/plugins/alerting/server/rules_client/lib/wait_before_next_retry.test.ts new file mode 100644 index 0000000000000..2fd74a7e08a7c --- /dev/null +++ b/x-pack/plugins/alerting/server/rules_client/lib/wait_before_next_retry.test.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + getExponentialDelayMultiplier, + randomDelayMs, + RETRY_IF_CONFLICTS_DELAY, + RETRY_IF_CONFLICTS_ATTEMPTS, + waitBeforeNextRetry, +} from './wait_before_next_retry'; + +describe('waitBeforeNextRetry', () => { + const randomDelayPart = 0.1; + + beforeEach(() => { + jest.spyOn(global.Math, 'random').mockReturnValue(randomDelayPart); + jest.spyOn(window, 'setTimeout'); + }); + afterEach(() => { + jest.clearAllMocks(); + }); + + for (let i = 1; i <= RETRY_IF_CONFLICTS_ATTEMPTS; i++) { + it(`should set timout for ${i} tries`, async () => { + await waitBeforeNextRetry(i); + expect(setTimeout).toBeCalledTimes(1); + expect(setTimeout).toHaveBeenCalledWith( + expect.any(Function), + RETRY_IF_CONFLICTS_DELAY * getExponentialDelayMultiplier(i) + randomDelayMs + ); + }); + } +}); diff --git a/x-pack/plugins/alerting/server/rules_client/lib/wait_before_next_retry.ts b/x-pack/plugins/alerting/server/rules_client/lib/wait_before_next_retry.ts new file mode 100644 index 0000000000000..f836de26c4188 --- /dev/null +++ b/x-pack/plugins/alerting/server/rules_client/lib/wait_before_next_retry.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. + */ + +export const RETRY_IF_CONFLICTS_ATTEMPTS = 2; + +// milliseconds to wait before retrying when conflicts occur +// note: we considered making this random, to help avoid a stampede, but +// with 1 retry it probably doesn't matter, and adding randomness could +// make it harder to diagnose issues +export const RETRY_IF_CONFLICTS_DELAY = 250; + +export const randomDelayMs = Math.floor(Math.random() * 100); +export const getExponentialDelayMultiplier = (retries: number) => + 1 + (RETRY_IF_CONFLICTS_ATTEMPTS - retries) ** 2; + +/** + * exponential delay before retry with adding random delay + */ +export const waitBeforeNextRetry = async (retries: number): Promise<void> => { + const exponentialDelayMultiplier = getExponentialDelayMultiplier(retries); + + await new Promise((resolve) => + setTimeout(resolve, RETRY_IF_CONFLICTS_DELAY * exponentialDelayMultiplier + randomDelayMs) + ); +}; diff --git a/x-pack/plugins/alerting/server/rules_client/rules_client.ts b/x-pack/plugins/alerting/server/rules_client/rules_client.ts index d08f12f054a50..bd4f9deb36b5d 100644 --- a/x-pack/plugins/alerting/server/rules_client/rules_client.ts +++ b/x-pack/plugins/alerting/server/rules_client/rules_client.ts @@ -33,6 +33,7 @@ import { SavedObjectsUtils, SavedObjectAttributes, SavedObjectsBulkUpdateObject, + SavedObjectsBulkDeleteObject, SavedObjectsUpdateResponse, } from '@kbn/core/server'; import { ActionsClient, ActionsAuthorization } from '@kbn/actions-plugin/server'; @@ -104,6 +105,7 @@ import { mapSortField, validateOperationOnAttributes, retryIfBulkEditConflicts, + retryIfBulkDeleteConflicts, applyBulkEditOperation, buildKueryNodeFilter, } from './lib'; @@ -178,7 +180,7 @@ export interface RuleAggregation { }; } -export interface RuleBulkEditAggregation { +export interface RuleBulkOperationAggregation { alertTypeId: { buckets: Array<{ key: string[]; @@ -297,6 +299,16 @@ export type BulkEditOptions<Params extends RuleTypeParams> = | BulkEditOptionsFilter<Params> | BulkEditOptionsIds<Params>; +export interface BulkDeleteOptionsFilter { + filter?: string | KueryNode; +} + +export interface BulkDeleteOptionsIds { + ids?: string[]; +} + +export type BulkDeleteOptions = BulkDeleteOptionsFilter | BulkDeleteOptionsIds; + export interface BulkEditError { message: string; rule: { @@ -305,6 +317,15 @@ export interface BulkEditError { }; } +export interface BulkDeleteError { + message: string; + status: number; + rule: { + id: string; + name: string; + }; +} + export interface AggregateOptions extends IndexType { search?: string; defaultSearchOperator?: 'AND' | 'OR'; @@ -398,6 +419,7 @@ export interface GetGlobalExecutionKPIParams { dateStart: string; dateEnd?: string; filter?: string; + namespaces?: Array<string | undefined>; } export interface GetGlobalExecutionLogParams { @@ -407,6 +429,7 @@ export interface GetGlobalExecutionLogParams { page: number; perPage: number; sort: estypes.Sort; + namespaces?: Array<string | undefined>; } export interface GetActionErrorLogByIdParams { @@ -417,6 +440,7 @@ export interface GetActionErrorLogByIdParams { page: number; perPage: number; sort: estypes.Sort; + namespace?: string; } interface ScheduleTaskOptions { @@ -433,10 +457,13 @@ const extractedSavedObjectParamReferenceNamePrefix = 'param:'; // NOTE: Changing this prefix will require a migration to update the prefix in all existing `rule` saved objects const preconfiguredConnectorActionRefPrefix = 'preconfigured:'; -const MAX_RULES_NUMBER_FOR_BULK_EDIT = 10000; +const MAX_RULES_NUMBER_FOR_BULK_OPERATION = 10000; const API_KEY_GENERATE_CONCURRENCY = 50; const RULE_TYPE_CHECKS_CONCURRENCY = 50; +const actionErrorLogDefaultFilter = + 'event.provider:actions AND ((event.action:execute AND (event.outcome:failure OR kibana.alerting.status:warning)) OR (event.action:execute-timeout))'; + const alertingAuthorizationFilterOpts: AlertingAuthorizationFilterOpts = { type: AlertingAuthorizationFilterType.KQL, fieldNames: { ruleTypeId: 'alert.attributes.alertTypeId', consumer: 'alert.attributes.consumer' }, @@ -930,6 +957,7 @@ export class RulesClient { page, perPage, sort, + namespaces, }: GetGlobalExecutionLogParams): Promise<IExecutionLogResult> { this.logger.debug(`getGlobalExecutionLogWithAuth(): getting global execution log`); @@ -980,7 +1008,8 @@ export class RulesClient { perPage, sort, }), - } + }, + namespaces ); return formatExecutionLogResult(aggResult); @@ -1029,9 +1058,6 @@ export class RulesClient { }) ); - const defaultFilter = - 'event.provider:actions AND ((event.action:execute AND (event.outcome:failure OR kibana.alerting.status:warning)) OR (event.action:execute-timeout))'; - // default duration of instance summary is 60 * rule interval const dateNow = new Date(); const parsedDateStart = parseDate(dateStart, 'dateStart', dateNow); @@ -1048,7 +1074,9 @@ export class RulesClient { end: parsedDateEnd.toISOString(), page, per_page: perPage, - filter: filter ? `(${defaultFilter}) AND (${filter})` : defaultFilter, + filter: filter + ? `(${actionErrorLogDefaultFilter}) AND (${filter})` + : actionErrorLogDefaultFilter, sort: convertEsSortToEventLogSort(sort), }, rule.legacyId !== null ? [rule.legacyId] : undefined @@ -1062,10 +1090,85 @@ export class RulesClient { } } + public async getActionErrorLogWithAuth({ + id, + dateStart, + dateEnd, + filter, + page, + perPage, + sort, + namespace, + }: GetActionErrorLogByIdParams): Promise<IExecutionErrorsResult> { + this.logger.debug(`getActionErrorLogWithAuth(): getting action error logs for rule ${id}`); + + let authorizationTuple; + try { + authorizationTuple = await this.authorization.getFindAuthorizationFilter( + AlertingAuthorizationEntity.Alert, + { + type: AlertingAuthorizationFilterType.KQL, + fieldNames: { + ruleTypeId: 'kibana.alert.rule.rule_type_id', + consumer: 'kibana.alert.rule.consumer', + }, + } + ); + } catch (error) { + this.auditLogger?.log( + ruleAuditEvent({ + action: RuleAuditAction.GET_ACTION_ERROR_LOG, + error, + }) + ); + throw error; + } + + this.auditLogger?.log( + ruleAuditEvent({ + action: RuleAuditAction.GET_ACTION_ERROR_LOG, + savedObject: { type: 'alert', id }, + }) + ); + + // default duration of instance summary is 60 * rule interval + const dateNow = new Date(); + const parsedDateStart = parseDate(dateStart, 'dateStart', dateNow); + const parsedDateEnd = parseDate(dateEnd, 'dateEnd', dateNow); + + const eventLogClient = await this.getEventLogClient(); + + try { + const errorResult = await eventLogClient.findEventsWithAuthFilter( + 'alert', + [id], + authorizationTuple.filter as KueryNode, + namespace, + { + start: parsedDateStart.toISOString(), + end: parsedDateEnd.toISOString(), + page, + per_page: perPage, + filter: filter + ? `(${actionErrorLogDefaultFilter}) AND (${filter})` + : actionErrorLogDefaultFilter, + sort: convertEsSortToEventLogSort(sort), + } + ); + return formatExecutionErrorsResult(errorResult); + } catch (err) { + this.logger.debug( + `rulesClient.getActionErrorLog(): error searching event log for rule ${id}: ${err.message}` + ); + throw err; + } + } + public async getGlobalExecutionKpiWithAuth({ dateStart, dateEnd, filter, + namespaces, }: GetGlobalExecutionKPIParams) { this.logger.debug(`getGlobalExecutionLogWithAuth(): getting global execution log`); @@ -1111,7 +1214,8 @@ export class RulesClient { start: parsedDateStart.toISOString(), end: parsedDateEnd.toISOString(), aggs: getExecutionKPIAggregation(filter), - } + }, + namespaces ); return formatExecutionKPIResult(aggResult); @@ -1695,6 +1799,212 @@ export class RulesClient { ); } + private getAuthorizationFilter = async () => { + try { + const authorizationTuple = await this.authorization.getFindAuthorizationFilter( + AlertingAuthorizationEntity.Rule, + alertingAuthorizationFilterOpts + ); + return authorizationTuple.filter; + } catch (error) { + this.auditLogger?.log( + ruleAuditEvent({ + action: RuleAuditAction.DELETE, + error, + }) + ); + throw error; + } + }; + + public bulkDeleteRules = async (options: BulkDeleteOptions) => { + const filter = (options as BulkDeleteOptionsFilter).filter; + const ids = (options as BulkDeleteOptionsIds).ids; + + if (!ids && !filter) { + throw Boom.badRequest( + "Either 'ids' or 'filter' property in method's arguments should be provided" + ); + } + + if (ids?.length === 0) { + throw Boom.badRequest("'ids' property should not be an empty array"); + } + + if (ids && filter) { + throw Boom.badRequest( + "Both 'filter' and 'ids' are supplied. Define either 'ids' or 'filter' properties in method's arguments" + ); + } + + const kueryNodeFilter = ids ? convertRuleIdsToKueryNode(ids) : buildKueryNodeFilter(filter); + const authorizationFilter = await this.getAuthorizationFilter(); + + const kueryNodeFilterWithAuth = + authorizationFilter && kueryNodeFilter + ? nodeBuilder.and([kueryNodeFilter, authorizationFilter as KueryNode]) + : kueryNodeFilter; + + const { aggregations, total } = await this.unsecuredSavedObjectsClient.find< + RawRule, + RuleBulkOperationAggregation + >({ + filter: kueryNodeFilterWithAuth, + page: 1, + perPage: 0, + type: 'alert', + aggs: { + alertTypeId: { + multi_terms: { + terms: [ + { field: 'alert.attributes.alertTypeId' }, + { field: 'alert.attributes.consumer' }, + ], + }, + }, + }, + }); + + if (total > MAX_RULES_NUMBER_FOR_BULK_OPERATION) { + throw Boom.badRequest( + `More than ${MAX_RULES_NUMBER_FOR_BULK_OPERATION} rules matched for bulk delete` + ); + } + + const buckets = aggregations?.alertTypeId.buckets; + + if (buckets === undefined || buckets?.length === 0) { + throw Boom.badRequest('No rules found for bulk delete'); + } + + await pMap( + buckets, + async ({ key: [ruleType, consumer] }) => { + this.ruleTypeRegistry.ensureRuleTypeEnabled(ruleType); + try { + await this.authorization.ensureAuthorized({ + ruleTypeId: ruleType, + consumer, + operation: WriteOperations.BulkDelete, + entity: AlertingAuthorizationEntity.Rule, + }); + } catch (error) { + this.auditLogger?.log( + ruleAuditEvent({ + action: RuleAuditAction.DELETE, + error, + }) + ); + throw error; + } + }, + { concurrency: RULE_TYPE_CHECKS_CONCURRENCY } + ); + + const { apiKeysToInvalidate, errors, taskIdsToDelete } = await retryIfBulkDeleteConflicts( + this.logger, + (filterKueryNode: KueryNode | null) => this.bulkDeleteWithOCC({ filter: filterKueryNode }), + kueryNodeFilterWithAuth + ); + + const taskIdsFailedToBeDeleted: string[] = []; + if (taskIdsToDelete.length > 0) { + try { + const resultFromDeletingTasks = await this.taskManager.bulkRemoveIfExist(taskIdsToDelete); + resultFromDeletingTasks?.statuses.forEach((status) => { + if (!status.success) { + taskIdsFailedToBeDeleted.push(status.id); + } + }); + this.logger.debug( + `Successfully deleted schedules for underlying tasks: ${taskIdsToDelete + .filter((id) => taskIdsFailedToBeDeleted.includes(id)) + .join(', ')}` + ); + } catch (error) { + this.logger.error( + `Failure to delete schedules for underlying tasks: ${taskIdsToDelete.join( + ', ' + )}. TaskManager bulkRemoveIfExist failed with Error: ${error.message}` + ); + } + } + + await bulkMarkApiKeysForInvalidation( + { apiKeys: apiKeysToInvalidate }, + this.logger, + this.unsecuredSavedObjectsClient + ); + + return { errors, total, taskIdsFailedToBeDeleted }; + }; + + private bulkDeleteWithOCC = async ({ filter }: { filter: KueryNode | null }) => { + const rulesFinder = + await this.encryptedSavedObjectsClient.createPointInTimeFinderDecryptedAsInternalUser<RawRule>( + { + filter, + type: 'alert', + perPage: 100, + ...(this.namespace ? { namespaces: [this.namespace] } : undefined), + } + ); + + const rules: SavedObjectsBulkDeleteObject[] = []; + const apiKeysToInvalidate: string[] = []; + const taskIdsToDelete: string[] = []; + const errors: BulkDeleteError[] = []; + const apiKeyToRuleIdMapping: Record<string, string> = {}; + const taskIdToRuleIdMapping: Record<string, string> = {}; + const ruleNameToRuleIdMapping: Record<string, string> = {}; + + for await (const response of rulesFinder.find()) { + for (const rule of response.saved_objects) { + if (rule.attributes.apiKey) { + apiKeyToRuleIdMapping[rule.id] = rule.attributes.apiKey; + } + if (rule.attributes.name) { + ruleNameToRuleIdMapping[rule.id] = rule.attributes.name; + } + if (rule.attributes.scheduledTaskId) { + taskIdToRuleIdMapping[rule.id] = rule.attributes.scheduledTaskId; + } + rules.push(rule); + + this.auditLogger?.log( + ruleAuditEvent({ + action: RuleAuditAction.DELETE, + outcome: 'unknown', + savedObject: { type: 'alert', id: rule.id }, + }) + ); + } + } + + const result = await this.unsecuredSavedObjectsClient.bulkDelete(rules); + + result.statuses.forEach((status) => { + if (status.error === undefined) { + if (apiKeyToRuleIdMapping[status.id]) { + apiKeysToInvalidate.push(apiKeyToRuleIdMapping[status.id]); + } + if (taskIdToRuleIdMapping[status.id]) { + taskIdsToDelete.push(taskIdToRuleIdMapping[status.id]); + } + } else { + errors.push({ + message: status.error.message ?? 'n/a', + status: status.error.statusCode, + rule: { + id: status.id, + name: ruleNameToRuleIdMapping[status.id] ?? 'n/a', + }, + }); + } + }); + return { apiKeysToInvalidate, errors, taskIdsToDelete }; + }; + public async bulkEdit<Params extends RuleTypeParams>( options: BulkEditOptions<Params> ): Promise<{ @@ -1737,7 +2047,7 @@ export class RulesClient { const { aggregations, total } = await this.unsecuredSavedObjectsClient.find< RawRule, - RuleBulkEditAggregation + RuleBulkOperationAggregation >({ filter: qNodeFilterWithAuth, page: 1, @@ -1755,9 +2065,9 @@ export class RulesClient { }, }); - if (total > MAX_RULES_NUMBER_FOR_BULK_EDIT) { + if (total > MAX_RULES_NUMBER_FOR_BULK_OPERATION) { throw Boom.badRequest( - `More than ${MAX_RULES_NUMBER_FOR_BULK_EDIT} rules matched for bulk edit` + `More than ${MAX_RULES_NUMBER_FOR_BULK_OPERATION} rules matched for bulk edit` ); } const buckets = aggregations?.alertTypeId.buckets; diff --git a/x-pack/plugins/alerting/server/rules_client/tests/bulk_delete.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/bulk_delete.test.ts new file mode 100644 index 0000000000000..5e0a71edcae51 --- /dev/null +++ b/x-pack/plugins/alerting/server/rules_client/tests/bulk_delete.test.ts @@ -0,0 +1,492 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, ConstructorOptions } from '../rules_client'; +import { savedObjectsClientMock } from '@kbn/core/server/mocks'; +import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; +import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; +import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; +import { RecoveredActionGroup } from '../../../common'; +import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; +import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; +import { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; +import { getBeforeSetup, setGlobalDate } from './lib'; +import { bulkMarkApiKeysForInvalidation } from '../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; +import { loggerMock } from '@kbn/logging-mocks'; + +jest.mock('../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation', () => ({ + bulkMarkApiKeysForInvalidation: jest.fn(), +})); + +const taskManager = taskManagerMock.createStart(); +const ruleTypeRegistry = ruleTypeRegistryMock.create(); +const unsecuredSavedObjectsClient = savedObjectsClientMock.create(); +const encryptedSavedObjects = encryptedSavedObjectsMock.createClient(); +const authorization = alertingAuthorizationMock.create(); +const actionsAuthorization = actionsAuthorizationMock.create(); +const auditLogger = auditLoggerMock.create(); +const logger = loggerMock.create(); + +const kibanaVersion = 'v8.2.0'; +const createAPIKeyMock = jest.fn(); +const rulesClientParams: jest.Mocked<ConstructorOptions> = { + taskManager, + ruleTypeRegistry, + unsecuredSavedObjectsClient, + authorization: authorization as unknown as AlertingAuthorization, + actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, + spaceId: 'default', + namespace: 'default', + getUserName: jest.fn(), + createAPIKey: createAPIKeyMock, + logger, + encryptedSavedObjectsClient: encryptedSavedObjects, + getActionsClient: jest.fn(), + getEventLogClient: jest.fn(), + kibanaVersion, + auditLogger, + minimumScheduleInterval: { value: '1m', enforce: false }, +}; + +beforeEach(() => { + getBeforeSetup(rulesClientParams, taskManager, ruleTypeRegistry); + (auditLogger.log as jest.Mock).mockClear(); +}); + +setGlobalDate(); + +describe('bulkDelete', () => { + let rulesClient: RulesClient; + const existingRule = { + id: 'id1', + type: 'alert', + attributes: {}, + references: [], + version: '123', + }; + const existingDecryptedRule1 = { + ...existingRule, + attributes: { + ...existingRule.attributes, + scheduledTaskId: 'taskId1', + apiKey: Buffer.from('123:abc').toString('base64'), + }, + }; + const existingDecryptedRule2 = { + ...existingRule, + id: 'id2', + attributes: { + ...existingRule.attributes, + scheduledTaskId: 'taskId2', + apiKey: Buffer.from('321:abc').toString('base64'), + }, + }; + + const mockCreatePointInTimeFinderAsInternalUser = ( + response = { saved_objects: [existingDecryptedRule1, existingDecryptedRule2] } + ) => { + encryptedSavedObjects.createPointInTimeFinderDecryptedAsInternalUser = jest + .fn() + .mockResolvedValue({ + close: jest.fn(), + find: function* asyncGenerator() { + yield response; + }, + }); + }; + + beforeEach(async () => { + rulesClient = new RulesClient(rulesClientParams); + authorization.getFindAuthorizationFilter.mockResolvedValue({ + ensureRuleTypeIsAuthorized() {}, + }); + + unsecuredSavedObjectsClient.find.mockResolvedValue({ + aggregations: { + alertTypeId: { + buckets: [{ key: ['myType', 'myApp'], key_as_string: 'myType|myApp', doc_count: 2 }], + }, + }, + saved_objects: [], + per_page: 0, + page: 0, + total: 2, + }); + + ruleTypeRegistry.get.mockReturnValue({ + id: 'myType', + name: 'Test', + actionGroups: [ + { id: 'default', name: 'Default' }, + { id: 'custom', name: 'Not the Default' }, + ], + defaultActionGroupId: 'default', + minimumLicenseRequired: 'basic', + isExportable: true, + recoveryActionGroup: RecoveredActionGroup, + async executor() {}, + producer: 'alerts', + }); + }); + + test('should try to delete rules, one successful and one with 500 error', async () => { + mockCreatePointInTimeFinderAsInternalUser(); + unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ + statuses: [ + { id: 'id1', type: 'alert', success: true }, + { + id: 'id2', + type: 'alert', + success: false, + error: { + error: '', + message: 'UPS', + statusCode: 500, + }, + }, + ], + }); + + const result = await rulesClient.bulkDeleteRules({ filter: 'fake_filter' }); + + expect(unsecuredSavedObjectsClient.bulkDelete).toHaveBeenCalledTimes(1); + expect(unsecuredSavedObjectsClient.bulkDelete).toHaveBeenCalledWith([ + existingDecryptedRule1, + existingDecryptedRule2, + ]); + expect(taskManager.bulkRemoveIfExist).toHaveBeenCalledTimes(1); + expect(taskManager.bulkRemoveIfExist).toHaveBeenCalledWith(['taskId1']); + expect(bulkMarkApiKeysForInvalidation).toHaveBeenCalledTimes(1); + expect(bulkMarkApiKeysForInvalidation).toHaveBeenCalledWith( + { apiKeys: ['MTIzOmFiYw=='] }, + expect.anything(), + expect.anything() + ); + expect(result).toStrictEqual({ + errors: [{ message: 'UPS', rule: { id: 'id2', name: 'n/a' }, status: 500 }], + total: 2, + taskIdsFailedToBeDeleted: [], + }); + }); + + test('should try to delete rules, one successful and one with 409 error, which will not be deleted with retry', async () => { + unsecuredSavedObjectsClient.bulkDelete + .mockResolvedValueOnce({ + statuses: [ + { id: 'id1', type: 'alert', success: true }, + { + id: 'id2', + type: 'alert', + success: false, + error: { + error: '', + message: 'UPS', + statusCode: 409, + }, + }, + ], + }) + .mockResolvedValueOnce({ + statuses: [ + { + id: 'id2', + type: 'alert', + success: false, + error: { + error: '', + message: 'UPS', + statusCode: 409, + }, + }, + ], + }) + .mockResolvedValueOnce({ + statuses: [ + { + id: 'id2', + type: 'alert', + success: false, + error: { + error: '', + message: 'UPS', + statusCode: 409, + }, + }, + ], + }); + + encryptedSavedObjects.createPointInTimeFinderDecryptedAsInternalUser = jest + .fn() + .mockResolvedValueOnce({ + close: jest.fn(), + find: function* asyncGenerator() { + yield { saved_objects: [existingDecryptedRule1, existingDecryptedRule2] }; + }, + }) + .mockResolvedValueOnce({ + close: jest.fn(), + find: function* asyncGenerator() { + yield { saved_objects: [existingDecryptedRule2] }; + }, + }) + .mockResolvedValueOnce({ + close: jest.fn(), + find: function* asyncGenerator() { + yield { saved_objects: [existingDecryptedRule2] }; + }, + }); + + const result = await rulesClient.bulkDeleteRules({ ids: ['id1', 'id2'] }); + + expect(unsecuredSavedObjectsClient.bulkDelete).toHaveBeenCalledTimes(3); + expect(taskManager.bulkRemoveIfExist).toHaveBeenCalledTimes(1); + expect(taskManager.bulkRemoveIfExist).toHaveBeenCalledWith(['taskId1']); + expect(bulkMarkApiKeysForInvalidation).toHaveBeenCalledTimes(1); + expect(bulkMarkApiKeysForInvalidation).toHaveBeenCalledWith( + { apiKeys: ['MTIzOmFiYw=='] }, + expect.anything(), + expect.anything() + ); + expect(result).toStrictEqual({ + errors: [{ message: 'UPS', rule: { id: 'id2', name: 'n/a' }, status: 409 }], + total: 2, + taskIdsFailedToBeDeleted: [], + }); + }); + + test('should try to delete rules, one successful and one with 409 error, which successfully will be deleted with retry', async () => { + unsecuredSavedObjectsClient.bulkDelete + .mockResolvedValueOnce({ + statuses: [ + { id: 'id1', type: 'alert', success: true }, + { + id: 'id2', + type: 'alert', + success: false, + error: { + error: '', + message: 'UPS', + statusCode: 409, + }, + }, + ], + }) + .mockResolvedValueOnce({ + statuses: [ + { + id: 'id2', + type: 'alert', + success: true, + }, + ], + }); + + encryptedSavedObjects.createPointInTimeFinderDecryptedAsInternalUser = jest + .fn() + .mockResolvedValueOnce({ + close: jest.fn(), + find: function* asyncGenerator() { + yield { saved_objects: [existingDecryptedRule1, existingDecryptedRule2] }; + }, + }) + .mockResolvedValueOnce({ + close: jest.fn(), + find: function* asyncGenerator() { + yield { saved_objects: [existingDecryptedRule2] }; + }, + }) + .mockResolvedValueOnce({ + close: jest.fn(), + find: function* asyncGenerator() { + yield { saved_objects: [existingDecryptedRule2] }; + }, + }); + + const result = await rulesClient.bulkDeleteRules({ ids: ['id1', 'id2'] }); + + expect(unsecuredSavedObjectsClient.bulkDelete).toHaveBeenCalledTimes(2); + expect(taskManager.bulkRemoveIfExist).toHaveBeenCalledTimes(1); + expect(taskManager.bulkRemoveIfExist).toHaveBeenCalledWith(['taskId1', 'taskId2']); + expect(bulkMarkApiKeysForInvalidation).toHaveBeenCalledTimes(1); + expect(bulkMarkApiKeysForInvalidation).toHaveBeenCalledWith( + { apiKeys: ['MTIzOmFiYw==', 'MzIxOmFiYw=='] }, + expect.anything(), + expect.anything() + ); + expect(result).toStrictEqual({ + errors: [], + total: 2, + taskIdsFailedToBeDeleted: [], + }); + }); + + test('should thow an error if number of matched rules greater than 10,000', async () => { + unsecuredSavedObjectsClient.find.mockResolvedValue({ + aggregations: { + alertTypeId: { + buckets: [{ key: ['myType', 'myApp'], key_as_string: 'myType|myApp', doc_count: 2 }], + }, + }, + saved_objects: [], + per_page: 0, + page: 0, + total: 10001, + }); + + await expect(rulesClient.bulkDeleteRules({ filter: 'fake_filter' })).rejects.toThrow( + 'More than 10000 rules matched for bulk delete' + ); + }); + + test('should throw an error if we do not get buckets', async () => { + mockCreatePointInTimeFinderAsInternalUser(); + unsecuredSavedObjectsClient.find.mockResolvedValue({ + aggregations: { + alertTypeId: {}, + }, + saved_objects: [], + per_page: 0, + page: 0, + total: 2, + }); + + await expect(rulesClient.bulkDeleteRules({ filter: 'fake_filter' })).rejects.toThrow( + 'No rules found for bulk delete' + ); + }); + + describe('taskManager', () => { + test('should return task id if deleting task failed', async () => { + mockCreatePointInTimeFinderAsInternalUser(); + unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ + statuses: [ + { id: 'id1', type: 'alert', success: true }, + { id: 'id2', type: 'alert', success: true }, + ], + }); + taskManager.bulkRemoveIfExist.mockImplementation(async () => ({ + statuses: [ + { + id: 'taskId1', + type: 'alert', + success: true, + }, + { + id: 'taskId2', + type: 'alert', + success: false, + error: { + error: '', + message: 'UPS', + statusCode: 500, + }, + }, + ], + })); + + const result = await rulesClient.bulkDeleteRules({ filter: 'fake_filter' }); + + expect(logger.debug).toBeCalledTimes(1); + expect(logger.debug).toBeCalledWith( + 'Successfully deleted schedules for underlying tasks: taskId2' + ); + expect(result).toStrictEqual({ + errors: [], + total: 2, + taskIdsFailedToBeDeleted: ['taskId2'], + }); + }); + + test('should not throw an error if taskManager throw an error', async () => { + mockCreatePointInTimeFinderAsInternalUser(); + unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ + statuses: [ + { id: 'id1', type: 'alert', success: true }, + { id: 'id2', type: 'alert', success: true }, + ], + }); + taskManager.bulkRemoveIfExist.mockImplementation(() => { + throw new Error('UPS'); + }); + + const result = await rulesClient.bulkDeleteRules({ filter: 'fake_filter' }); + + expect(logger.error).toBeCalledTimes(1); + expect(logger.error).toBeCalledWith( + 'Failure to delete schedules for underlying tasks: taskId1, taskId2. TaskManager bulkRemoveIfExist failed with Error: UPS' + ); + expect(result).toStrictEqual({ + errors: [], + taskIdsFailedToBeDeleted: [], + total: 2, + }); + }); + }); + + describe('auditLogger', () => { + jest.spyOn(auditLogger, 'log').mockImplementation(); + + test('logs audit event when deleting rules', async () => { + mockCreatePointInTimeFinderAsInternalUser(); + unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ + statuses: [ + { id: 'id1', type: 'alert', success: true }, + { id: 'id2', type: 'alert', success: true }, + ], + }); + + await rulesClient.bulkDeleteRules({ filter: 'fake_filter' }); + + expect(auditLogger.log.mock.calls[0][0]?.event?.action).toEqual('rule_delete'); + expect(auditLogger.log.mock.calls[0][0]?.event?.outcome).toEqual('unknown'); + expect(auditLogger.log.mock.calls[0][0]?.kibana).toEqual({ + saved_object: { id: 'id1', type: 'alert' }, + }); + expect(auditLogger.log.mock.calls[1][0]?.event?.action).toEqual('rule_delete'); + expect(auditLogger.log.mock.calls[1][0]?.event?.outcome).toEqual('unknown'); + expect(auditLogger.log.mock.calls[1][0]?.kibana).toEqual({ + saved_object: { id: 'id2', type: 'alert' }, + }); + }); + + test('logs audit event when authentication failed', async () => { + mockCreatePointInTimeFinderAsInternalUser(); + authorization.ensureAuthorized.mockImplementation(() => { + throw new Error('Unauthorized'); + }); + unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ + statuses: [{ id: 'id1', type: 'alert', success: true }], + }); + + await expect(rulesClient.bulkDeleteRules({ filter: 'fake_filter' })).rejects.toThrowError( + 'Unauthorized' + ); + + expect(auditLogger.log.mock.calls[0][0]?.event?.action).toEqual('rule_delete'); + expect(auditLogger.log.mock.calls[0][0]?.event?.outcome).toEqual('failure'); + }); + + test('logs audit event when getting an authorization filter failed', async () => { + mockCreatePointInTimeFinderAsInternalUser(); + authorization.getFindAuthorizationFilter.mockImplementation(() => { + throw new Error('Error'); + }); + unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ + statuses: [{ id: 'id1', type: 'alert', success: true }], + }); + + await expect(rulesClient.bulkDeleteRules({ filter: 'fake_filter' })).rejects.toThrowError( + 'Error' + ); + + expect(auditLogger.log.mock.calls[0][0]?.event?.action).toEqual('rule_delete'); + expect(auditLogger.log.mock.calls[0][0]?.event?.outcome).toEqual('failure'); + }); + }); +}); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts index 3a18634b4f5db..6b635abe5d7f0 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts @@ -8,6 +8,7 @@ import { RulesClient, ConstructorOptions, GetActionErrorLogByIdParams } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; +import { fromKueryExpression } from '@kbn/es-query'; import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; @@ -574,3 +575,63 @@ describe('getActionErrorLog()', () => { }); }); }); + +describe('getActionErrorLogWithAuth()', () => { + let rulesClient: RulesClient; + + beforeEach(() => { + rulesClient = new RulesClient(rulesClientParams); + }); + + test('returns the expected return values when called', async () => { + const ruleSO = getRuleSavedObject({}); + authorization.getFindAuthorizationFilter.mockResolvedValue({ + filter: fromKueryExpression('*'), + ensureRuleTypeIsAuthorized() {}, + }); + unsecuredSavedObjectsClient.get.mockResolvedValueOnce(ruleSO); + eventLogClient.findEventsWithAuthFilter.mockResolvedValueOnce(findResults); + + const result = await rulesClient.getActionErrorLogWithAuth(getActionErrorLogParams()); + expect(result).toEqual({ + totalErrors: 5, + errors: [ + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.106Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.102Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.098Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.096Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.086Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + ], + }); + }); +}); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts index 83b85f4879cff..ffc40cd705abd 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts @@ -385,6 +385,7 @@ describe('getExecutionLogForRule()', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: [], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -407,6 +408,7 @@ describe('getExecutionLogForRule()', () => { schedule_delay_ms: 3345, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: [], }, ], }); @@ -719,6 +721,7 @@ describe('getGlobalExecutionLogWithAuth()', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: [], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -741,6 +744,7 @@ describe('getGlobalExecutionLogWithAuth()', () => { schedule_delay_ms: 3345, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: [], }, ], }); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/lib.ts b/x-pack/plugins/alerting/server/rules_client/tests/lib.ts index 37eccba1d0d56..6a1e84b38d039 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/lib.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/lib.ts @@ -51,6 +51,9 @@ export function getBeforeSetup( rulesClientParams.createAPIKey.mockResolvedValue({ apiKeysEnabled: false }); rulesClientParams.getUserName.mockResolvedValue('elastic'); taskManager.runSoon.mockResolvedValue({ id: '' }); + taskManager.bulkRemoveIfExist.mockResolvedValue({ + statuses: [{ id: 'taskId', type: 'alert', success: true }], + }); const actionsClient = actionsClientMock.create(); actionsClient.getBulk.mockResolvedValueOnce([ diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts index 20310fdae01f7..3d3c82d91fe28 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts @@ -231,11 +231,8 @@ describe('Task Runner', () => { expect(call.startedAt).toStrictEqual(new Date(DATE_1970)); expect(call.previousStartedAt).toStrictEqual(new Date(DATE_1970_5_MIN)); expect(call.state).toEqual({}); - expect(call.name).toBe(RULE_NAME); - expect(call.tags).toEqual(['rule-', '-tags']); - expect(call.createdBy).toBe('rule-creator'); - expect(call.updatedBy).toBe('rule-updater'); expect(call.rule).not.toBe(null); + expect(call.rule.id).toBe('1'); expect(call.rule.name).toBe(RULE_NAME); expect(call.rule.tags).toEqual(['rule-', '-tags']); expect(call.rule.consumer).toBe('bar'); @@ -2059,11 +2056,8 @@ describe('Task Runner', () => { expect(call.startedAt).toEqual(new Date(DATE_1970)); expect(call.previousStartedAt).toEqual(new Date(DATE_1970_5_MIN)); expect(call.state).toEqual({}); - expect(call.name).toBe(RULE_NAME); - expect(call.tags).toEqual(['rule-', '-tags']); - expect(call.createdBy).toBe('rule-creator'); - expect(call.updatedBy).toBe('rule-updater'); expect(call.rule).not.toBe(null); + expect(call.rule.id).toBe('1'); expect(call.rule.name).toBe(RULE_NAME); expect(call.rule.tags).toEqual(['rule-', '-tags']); expect(call.rule.consumer).toBe('bar'); diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index 0c6bbfbbd9866..fe8fcbb73152a 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -355,7 +355,6 @@ export class TaskRunner< updatedState = await this.context.executionContext.withContext(ctx, () => this.ruleType.executor({ - alertId: ruleId, executionId: this.executionId, services: { savedObjectsClient, @@ -372,11 +371,8 @@ export class TaskRunner< previousStartedAt: previousStartedAt ? new Date(previousStartedAt) : null, spaceId, namespace, - name, - tags, - createdBy, - updatedBy, rule: { + id: ruleId, name, tags, consumer, diff --git a/x-pack/plugins/alerting/server/types.ts b/x-pack/plugins/alerting/server/types.ts index f1917a079a26d..288e0a353d0c0 100644 --- a/x-pack/plugins/alerting/server/types.ts +++ b/x-pack/plugins/alerting/server/types.ts @@ -90,21 +90,16 @@ export interface RuleExecutorOptions< InstanceContext extends AlertInstanceContext = never, ActionGroupIds extends string = never > { - alertId: string; executionId: string; - startedAt: Date; - previousStartedAt: Date | null; - services: RuleExecutorServices<InstanceState, InstanceContext, ActionGroupIds>; + logger: Logger; params: Params; - state: State; + previousStartedAt: Date | null; rule: SanitizedRuleConfig; + services: RuleExecutorServices<InstanceState, InstanceContext, ActionGroupIds>; spaceId: string; + startedAt: Date; + state: State; namespace?: string; - name: string; - tags: string[]; - createdBy: string | null; - updatedBy: string | null; - logger: Logger; } export interface RuleParamsAndRefs<Params extends RuleTypeParams> { diff --git a/x-pack/plugins/alerting/tsconfig.json b/x-pack/plugins/alerting/tsconfig.json index 357f4ca940871..105ed878b0975 100644 --- a/x-pack/plugins/alerting/tsconfig.json +++ b/x-pack/plugins/alerting/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "server/**/*", @@ -13,7 +12,7 @@ "public/**/*", "common/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../actions/tsconfig.json" }, { "path": "../spaces/tsconfig.json" }, diff --git a/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap b/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap index 95c36d24aad5b..ab7a6d4139d4a 100644 --- a/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap +++ b/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap @@ -45,6 +45,8 @@ exports[`Error CONTAINER_IMAGE 1`] = `undefined`; exports[`Error DESTINATION_ADDRESS 1`] = `undefined`; +exports[`Error DEVICE_MODEL_NAME 1`] = `undefined`; + exports[`Error ERROR_CULPRIT 1`] = `"handleOopsie"`; exports[`Error ERROR_EXC_HANDLED 1`] = `undefined`; @@ -75,6 +77,8 @@ exports[`Error FAAS_DURATION 1`] = `undefined`; exports[`Error FAAS_ID 1`] = `undefined`; +exports[`Error FAAS_NAME 1`] = `undefined`; + exports[`Error FAAS_TRIGGER_TYPE 1`] = `undefined`; exports[`Error HOST 1`] = ` @@ -83,12 +87,16 @@ Object { } `; +exports[`Error HOST_ARCHITECTURE 1`] = `undefined`; + exports[`Error HOST_HOSTNAME 1`] = `"my hostname"`; exports[`Error HOST_NAME 1`] = `undefined`; exports[`Error HOST_OS_PLATFORM 1`] = `undefined`; +exports[`Error HOST_OS_VERSION 1`] = `undefined`; + exports[`Error HTTP_REQUEST_METHOD 1`] = `undefined`; exports[`Error HTTP_RESPONSE_STATUS_CODE 1`] = `undefined`; @@ -149,6 +157,8 @@ exports[`Error METRIC_SYSTEM_TOTAL_MEMORY 1`] = `undefined`; exports[`Error METRICSET_NAME 1`] = `undefined`; +exports[`Error NETWORK_CONNECTION_TYPE 1`] = `undefined`; + exports[`Error OBSERVER_HOSTNAME 1`] = `undefined`; exports[`Error OBSERVER_LISTENING 1`] = `undefined`; @@ -300,6 +310,8 @@ exports[`Span CONTAINER_IMAGE 1`] = `undefined`; exports[`Span DESTINATION_ADDRESS 1`] = `undefined`; +exports[`Span DEVICE_MODEL_NAME 1`] = `undefined`; + exports[`Span ERROR_CULPRIT 1`] = `undefined`; exports[`Span ERROR_EXC_HANDLED 1`] = `undefined`; @@ -330,16 +342,22 @@ exports[`Span FAAS_DURATION 1`] = `undefined`; exports[`Span FAAS_ID 1`] = `undefined`; +exports[`Span FAAS_NAME 1`] = `undefined`; + exports[`Span FAAS_TRIGGER_TYPE 1`] = `undefined`; exports[`Span HOST 1`] = `undefined`; +exports[`Span HOST_ARCHITECTURE 1`] = `undefined`; + exports[`Span HOST_HOSTNAME 1`] = `undefined`; exports[`Span HOST_NAME 1`] = `undefined`; exports[`Span HOST_OS_PLATFORM 1`] = `undefined`; +exports[`Span HOST_OS_VERSION 1`] = `undefined`; + exports[`Span HTTP_REQUEST_METHOD 1`] = `undefined`; exports[`Span HTTP_RESPONSE_STATUS_CODE 1`] = `undefined`; @@ -400,6 +418,8 @@ exports[`Span METRIC_SYSTEM_TOTAL_MEMORY 1`] = `undefined`; exports[`Span METRICSET_NAME 1`] = `undefined`; +exports[`Span NETWORK_CONNECTION_TYPE 1`] = `undefined`; + exports[`Span OBSERVER_HOSTNAME 1`] = `undefined`; exports[`Span OBSERVER_LISTENING 1`] = `undefined`; @@ -551,6 +571,8 @@ exports[`Transaction CONTAINER_IMAGE 1`] = `undefined`; exports[`Transaction DESTINATION_ADDRESS 1`] = `undefined`; +exports[`Transaction DEVICE_MODEL_NAME 1`] = `undefined`; + exports[`Transaction ERROR_CULPRIT 1`] = `undefined`; exports[`Transaction ERROR_EXC_HANDLED 1`] = `undefined`; @@ -581,6 +603,8 @@ exports[`Transaction FAAS_DURATION 1`] = `undefined`; exports[`Transaction FAAS_ID 1`] = `undefined`; +exports[`Transaction FAAS_NAME 1`] = `undefined`; + exports[`Transaction FAAS_TRIGGER_TYPE 1`] = `undefined`; exports[`Transaction HOST 1`] = ` @@ -589,12 +613,16 @@ Object { } `; +exports[`Transaction HOST_ARCHITECTURE 1`] = `undefined`; + exports[`Transaction HOST_HOSTNAME 1`] = `"my hostname"`; exports[`Transaction HOST_NAME 1`] = `undefined`; exports[`Transaction HOST_OS_PLATFORM 1`] = `undefined`; +exports[`Transaction HOST_OS_VERSION 1`] = `undefined`; + exports[`Transaction HTTP_REQUEST_METHOD 1`] = `"GET"`; exports[`Transaction HTTP_RESPONSE_STATUS_CODE 1`] = `200`; @@ -661,6 +689,8 @@ exports[`Transaction METRIC_SYSTEM_TOTAL_MEMORY 1`] = `undefined`; exports[`Transaction METRICSET_NAME 1`] = `undefined`; +exports[`Transaction NETWORK_CONNECTION_TYPE 1`] = `undefined`; + exports[`Transaction OBSERVER_HOSTNAME 1`] = `undefined`; exports[`Transaction OBSERVER_LISTENING 1`] = `undefined`; diff --git a/x-pack/plugins/apm/common/agent_configuration/runtime_types/trace_continuation_strategy_rt.ts b/x-pack/plugins/apm/common/agent_configuration/runtime_types/trace_continuation_strategy_rt.ts new file mode 100644 index 0000000000000..13eed0a78f966 --- /dev/null +++ b/x-pack/plugins/apm/common/agent_configuration/runtime_types/trace_continuation_strategy_rt.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import * as t from 'io-ts'; + +export const traceContinuationStrategyRt = t.union([ + t.literal('continue'), + t.literal('restart'), + t.literal('restart_external'), +]); diff --git a/x-pack/plugins/apm/common/agent_configuration/setting_definitions/__snapshots__/index.test.ts.snap b/x-pack/plugins/apm/common/agent_configuration/setting_definitions/__snapshots__/index.test.ts.snap index fc42af5ff7724..a4bc508856b45 100644 --- a/x-pack/plugins/apm/common/agent_configuration/setting_definitions/__snapshots__/index.test.ts.snap +++ b/x-pack/plugins/apm/common/agent_configuration/setting_definitions/__snapshots__/index.test.ts.snap @@ -47,21 +47,57 @@ Array [ "type": "select", "validationName": "(\\"off\\" | \\"errors\\" | \\"transactions\\" | \\"all\\")", }, + Object { + "key": "capture_body_content_types", + "type": "text", + "validationName": "string", + }, Object { "key": "capture_headers", "type": "boolean", "validationName": "(\\"true\\" | \\"false\\")", }, + Object { + "key": "capture_jmx_metrics", + "type": "text", + "validationName": "string", + }, Object { "key": "circuit_breaker_enabled", "type": "boolean", "validationName": "(\\"true\\" | \\"false\\")", }, + Object { + "key": "dedot_custom_metrics", + "type": "boolean", + "validationName": "(\\"true\\" | \\"false\\")", + }, Object { "key": "enable_log_correlation", "type": "boolean", "validationName": "(\\"true\\" | \\"false\\")", }, + Object { + "key": "exit_span_min_duration", + "min": "0ms", + "type": "duration", + "units": Array [ + "ms", + "s", + "m", + ], + "validationName": "durationRt", + }, + Object { + "key": "ignore_exceptions", + "type": "text", + "validationName": "string", + }, + Object { + "key": "ignore_message_queues", + "type": "text", + "validationName": "string", + }, Object { "key": "log_level", "options": Array [ @@ -156,6 +192,33 @@ Array [ ], "validationName": "durationRt", }, + Object { + "key": "span_compression_enabled", + "type": "boolean", + "validationName": "(\\"true\\" | \\"false\\")", + }, + Object { + "key": "span_compression_exact_match_max_duration", + "min": "0ms", + "type": "duration", + "units": Array [ + "ms", + "s", + "m", + ], + "validationName": "durationRt", + }, + Object { + "key": "span_compression_same_kind_max_duration", + "min": "0ms", + "type": "duration", + "units": Array [ + "ms", + "s", + "m", + ], + "validationName": "durationRt", + }, Object { "key": "span_frames_min_duration", "min": "-1ms", @@ -205,11 +268,40 @@ Array [ "type": "float", "validationName": "floatRt", }, + Object { + "key": "trace_continuation_strategy", + "options": Array [ + Object { + "text": "continue", + "value": "continue", + }, + Object { + "text": "restart", + "value": "restart", + }, + Object { + "text": "restart_external", + "value": "restart_external", + }, + ], + "type": "select", + "validationName": "(\\"continue\\" | \\"restart\\" | \\"restart_external\\")", + }, + Object { + "key": "trace_methods", + "type": "text", + "validationName": "string", + }, Object { "key": "transaction_ignore_urls", "type": "text", "validationName": "string", }, + Object { + "key": "transaction_ignore_user_agents", + "type": "text", + "validationName": "string", + }, Object { "key": "transaction_max_spans", "max": undefined, @@ -217,10 +309,25 @@ Array [ "type": "integer", "validationName": "integerRt", }, + Object { + "key": "transaction_name_groups", + "type": "text", + "validationName": "string", + }, Object { "key": "transaction_sample_rate", "type": "float", "validationName": "floatRt", }, + Object { + "key": "unnest_exceptions", + "type": "text", + "validationName": "string", + }, + Object { + "key": "use_path_as_transaction_name", + "type": "boolean", + "validationName": "(\\"true\\" | \\"false\\")", + }, ] `; diff --git a/x-pack/plugins/apm/common/agent_configuration/setting_definitions/general_settings.ts b/x-pack/plugins/apm/common/agent_configuration/setting_definitions/general_settings.ts index 0e565e1d88030..4e0f37fc76f3b 100644 --- a/x-pack/plugins/apm/common/agent_configuration/setting_definitions/general_settings.ts +++ b/x-pack/plugins/apm/common/agent_configuration/setting_definitions/general_settings.ts @@ -8,6 +8,7 @@ import { i18n } from '@kbn/i18n'; import { captureBodyRt } from '../runtime_types/capture_body_rt'; import { logLevelRt } from '../runtime_types/log_level_rt'; +import { traceContinuationStrategyRt } from '../runtime_types/trace_continuation_strategy_rt'; import { RawSettingDefinition } from './types'; export const generalSettings: RawSettingDefinition[] = [ @@ -72,6 +73,29 @@ export const generalSettings: RawSettingDefinition[] = [ excludeAgents: ['js-base', 'rum-js', 'php'], }, + { + key: 'capture_body_content_types', + type: 'text', + defaultValue: + 'application/x-www-form-urlencoded*, text/*, application/json*, application/xml*', + label: i18n.translate( + 'xpack.apm.agentConfig.captureBodyContentTypes.label', + { + defaultMessage: 'Capture Body Content Types', + } + ), + description: i18n.translate( + 'xpack.apm.agentConfig.captureBodyContentTypes.description', + { + defaultMessage: + 'Configures which content types should be recorded.\n' + + '\n' + + 'The defaults end with a wildcard so that content types like `text/plain; charset=utf-8` are captured as well.', + } + ), + includeAgents: ['java'], + }, + // Capture headers { key: 'capture_headers', @@ -90,6 +114,67 @@ export const generalSettings: RawSettingDefinition[] = [ excludeAgents: ['js-base', 'rum-js', 'nodejs', 'php'], }, + { + key: 'dedot_custom_metrics', + type: 'boolean', + defaultValue: 'true', + label: i18n.translate('xpack.apm.agentConfig.dedotCustomMetrics.label', { + defaultMessage: 'Dedot custom metrics', + }), + description: i18n.translate( + 'xpack.apm.agentConfig.dedotCustomMetrics.description', + { + defaultMessage: + 'Replaces dots with underscores in the metric names for custom metrics.\n' + + '\n' + + 'WARNING: Setting this to `false` can lead to mapping conflicts as dots indicate nesting in Elasticsearch.\n' + + 'An example of when a conflict happens is two metrics with the name `foo` and `foo.bar`.\n' + + 'The first metric maps `foo` to a number and the second metric maps `foo` as an object.', + } + ), + includeAgents: ['java'], + }, + + { + key: 'exit_span_min_duration', + type: 'duration', + defaultValue: '0ms', + min: '0ms', + label: i18n.translate('xpack.apm.agentConfig.exitSpanMinDuration.label', { + defaultMessage: 'Exit span min duration', + }), + description: i18n.translate( + 'xpack.apm.agentConfig.exitSpanMinDuration.description', + { + defaultMessage: + 'Exit spans are spans that represent a call to an external service, like a database. If such calls are very short, they are usually not relevant and can be ignored.\n' + + '\n' + + 'NOTE: If a span propagates distributed tracing ids, it will not be ignored, even if it is shorter than the configured threshold. This is to ensure that no broken traces are recorded.', + } + ), + includeAgents: ['java'], + }, + + { + key: 'ignore_message_queues', + type: 'text', + defaultValue: '', + label: i18n.translate('xpack.apm.agentConfig.ignoreMessageQueues.label', { + defaultMessage: 'Ignore message queues', + }), + description: i18n.translate( + 'xpack.apm.agentConfig.ignoreMessageQueues.description', + { + defaultMessage: + 'Used to filter out specific messaging queues/topics from being traced. \n' + + '\n' + + 'This property should be set to an array containing one or more strings.\n' + + 'When set, sends-to and receives-from the specified queues/topic will be ignored.', + } + ), + includeAgents: ['java'], + }, + // LOG_LEVEL { key: 'log_level', @@ -147,6 +232,68 @@ export const generalSettings: RawSettingDefinition[] = [ includeAgents: ['java'], }, + { + key: 'span_compression_enabled', + type: 'boolean', + defaultValue: 'true', + label: i18n.translate( + 'xpack.apm.agentConfig.spanCompressionEnabled.label', + { + defaultMessage: 'Span compression enabled', + } + ), + description: i18n.translate( + 'xpack.apm.agentConfig.spanCompressionEnabled.description', + { + defaultMessage: + 'Setting this option to true will enable span compression feature.\n' + + 'Span compression reduces the collection, processing, and storage overhead, and removes clutter from the UI. The tradeoff is that some information such as DB statements of all the compressed spans will not be collected.', + } + ), + includeAgents: ['java'], + }, + + { + key: 'span_compression_exact_match_max_duration', + type: 'duration', + defaultValue: '50ms', + min: '0ms', + label: i18n.translate( + 'xpack.apm.agentConfig.spanCompressionExactMatchMaxDuration.label', + { + defaultMessage: 'Span compression exact match max duration', + } + ), + description: i18n.translate( + 'xpack.apm.agentConfig.spanCompressionExactMatchMaxDuration.description', + { + defaultMessage: + 'Consecutive spans that are exact match and that are under this threshold will be compressed into a single composite span. This option does not apply to composite spans. This reduces the collection, processing, and storage overhead, and removes clutter from the UI. The tradeoff is that the DB statements of all the compressed spans will not be collected.', + } + ), + includeAgents: ['java'], + }, + { + key: 'span_compression_same_kind_max_duration', + type: 'duration', + defaultValue: '0ms', + min: '0ms', + label: i18n.translate( + 'xpack.apm.agentConfig.spanCompressionSameKindMaxDuration.label', + { + defaultMessage: 'Span compression same kind max duration', + } + ), + description: i18n.translate( + 'xpack.apm.agentConfig.spanCompressionSameKindMaxDuration.description', + { + defaultMessage: + 'Consecutive spans to the same destination that are under this threshold will be compressed into a single composite span. This option does not apply to composite spans. This reduces the collection, processing, and storage overhead, and removes clutter from the UI. The tradeoff is that the DB statements of all the compressed spans will not be collected.', + } + ), + includeAgents: ['java'], + }, + // SPAN_FRAMES_MIN_DURATION { key: 'span_frames_min_duration', @@ -184,6 +331,44 @@ export const generalSettings: RawSettingDefinition[] = [ includeAgents: ['java', 'dotnet', 'go'], }, + { + key: 'trace_continuation_strategy', + validation: traceContinuationStrategyRt, + type: 'select', + defaultValue: 'continue', + label: i18n.translate( + 'xpack.apm.agentConfig.traceContinuationStrategy.label', + { + defaultMessage: 'Trace continuation strategy', + } + ), + description: i18n.translate( + 'xpack.apm.agentConfig.traceContinuationStrategy.description', + { + defaultMessage: + 'This option allows some control over how the APM agent handles W3C trace-context headers on incoming requests. By default, the `traceparent` and `tracestate` headers are used per W3C spec for distributed tracing. However, in certain cases it can be helpful to not use the incoming `traceparent` header. Some example use cases:\n' + + '\n' + + '* An Elastic-monitored service is receiving requests with `traceparent` headers from unmonitored services.\n' + + '* An Elastic-monitored service is publicly exposed, and does not want tracing data (trace-ids, sampling decisions) to possibly be spoofed by user requests.\n' + + '\n' + + 'Valid values are:\n' + + "* 'continue': The default behavior. An incoming `traceparent` value is used to continue the trace and determine the sampling decision.\n" + + "* 'restart': Always ignores the `traceparent` header of incoming requests. A new trace-id will be generated and the sampling decision will be made based on transaction_sample_rate. A span link will be made to the incoming `traceparent`.\n" + + "* 'restart_external': If an incoming request includes the `es` vendor flag in `tracestate`, then any `traceparent` will be considered internal and will be handled as described for 'continue' above. Otherwise, any `traceparent` is considered external and will be handled as described for 'restart' above.\n" + + '\n' + + 'Starting with Elastic Observability 8.2, span links are visible in trace views.\n' + + '\n' + + 'This option is case-insensitive.', + } + ), + options: [ + { text: 'continue', value: 'continue' }, + { text: 'restart', value: 'restart' }, + { text: 'restart_external', value: 'restart_external' }, + ], + includeAgents: ['java'], + }, + // Transaction max spans { key: 'transaction_max_spans', @@ -257,4 +442,76 @@ export const generalSettings: RawSettingDefinition[] = [ ), includeAgents: ['java', 'nodejs', 'python', 'dotnet', 'ruby', 'go'], }, + + { + key: 'transaction_ignore_user_agents', + type: 'text', + defaultValue: '', + label: i18n.translate( + 'xpack.apm.agentConfig.transactionIgnoreUserAgents.label', + { + defaultMessage: 'Transaction ignore user agents', + } + ), + description: i18n.translate( + 'xpack.apm.agentConfig.transactionIgnoreUserAgents.description', + { + defaultMessage: + 'Used to restrict requests from certain User-Agents from being instrumented.\n' + + '\n' + + 'When an incoming HTTP request is detected,\n' + + 'the User-Agent from the request headers will be tested against each element in this list.\n' + + 'Example: `curl/*`, `*pingdom*`', + } + ), + includeAgents: ['java'], + }, + + { + key: 'use_path_as_transaction_name', + type: 'boolean', + defaultValue: 'false', + label: i18n.translate( + 'xpack.apm.agentConfig.usePathAsTransactionName.label', + { + defaultMessage: 'Use path as transaction name', + } + ), + description: i18n.translate( + 'xpack.apm.agentConfig.usePathAsTransactionName.description', + { + defaultMessage: + 'If set to `true`,\n' + + 'transaction names of unsupported or partially-supported frameworks will be in the form of `$method $path` instead of just `$method unknown route`.\n' + + '\n' + + 'WARNING: If your URLs contain path parameters like `/user/$userId`,\n' + + 'you should be very careful when enabling this flag,\n' + + 'as it can lead to an explosion of transaction groups.\n' + + 'Take a look at the `transaction_name_groups` option on how to mitigate this problem by grouping URLs together.', + } + ), + includeAgents: ['java'], + }, + + { + key: 'transaction_name_groups', + type: 'text', + defaultValue: '', + label: i18n.translate('xpack.apm.agentConfig.transactionNameGroups.label', { + defaultMessage: 'Transaction name groups', + }), + description: i18n.translate( + 'xpack.apm.agentConfig.transactionNameGroups.description', + { + defaultMessage: + 'With this option,\n' + + 'you can group transaction names that contain dynamic parts with a wildcard expression.\n' + + 'For example,\n' + + 'the pattern `GET /user/*/cart` would consolidate transactions,\n' + + 'such as `GET /users/42/cart` and `GET /users/73/cart` into a single transaction name `GET /users/*/cart`,\n' + + 'hence reducing the transaction name cardinality.', + } + ), + includeAgents: ['java'], + }, ]; diff --git a/x-pack/plugins/apm/common/agent_configuration/setting_definitions/index.test.ts b/x-pack/plugins/apm/common/agent_configuration/setting_definitions/index.test.ts index c9d33d37b6601..e41a3b6896ee8 100644 --- a/x-pack/plugins/apm/common/agent_configuration/setting_definitions/index.test.ts +++ b/x-pack/plugins/apm/common/agent_configuration/setting_definitions/index.test.ts @@ -43,134 +43,150 @@ describe('filterByAgent', () => { describe('options per agent', () => { it('go', () => { - expect(getSettingKeysForAgent('go')).toEqual([ - 'capture_body', - 'capture_headers', - 'log_level', - 'recording', - 'sanitize_field_names', - 'span_frames_min_duration', - 'stack_trace_limit', - 'transaction_ignore_urls', - 'transaction_max_spans', - 'transaction_sample_rate', - ]); + expect(getSettingKeysForAgent('go')).toEqual( + expect.arrayContaining([ + 'capture_body', + 'capture_headers', + 'log_level', + 'recording', + 'sanitize_field_names', + 'span_frames_min_duration', + 'stack_trace_limit', + 'transaction_ignore_urls', + 'transaction_max_spans', + 'transaction_sample_rate', + ]) + ); }); it('java', () => { - expect(getSettingKeysForAgent('java')).toEqual([ - 'api_request_size', - 'api_request_time', - 'capture_body', - 'capture_headers', - 'circuit_breaker_enabled', - 'enable_log_correlation', - 'log_level', - 'profiling_inferred_spans_enabled', - 'profiling_inferred_spans_excluded_classes', - 'profiling_inferred_spans_included_classes', - 'profiling_inferred_spans_min_duration', - 'profiling_inferred_spans_sampling_interval', - 'recording', - 'sanitize_field_names', - 'server_timeout', - 'span_frames_min_duration', - 'stack_trace_limit', - 'stress_monitor_cpu_duration_threshold', - 'stress_monitor_gc_relief_threshold', - 'stress_monitor_gc_stress_threshold', - 'stress_monitor_system_cpu_relief_threshold', - 'stress_monitor_system_cpu_stress_threshold', - 'transaction_ignore_urls', - 'transaction_max_spans', - 'transaction_sample_rate', - ]); + expect(getSettingKeysForAgent('java')).toEqual( + expect.arrayContaining([ + 'api_request_size', + 'api_request_time', + 'capture_body', + 'capture_headers', + 'circuit_breaker_enabled', + 'enable_log_correlation', + 'log_level', + 'profiling_inferred_spans_enabled', + 'profiling_inferred_spans_excluded_classes', + 'profiling_inferred_spans_included_classes', + 'profiling_inferred_spans_min_duration', + 'profiling_inferred_spans_sampling_interval', + 'recording', + 'sanitize_field_names', + 'server_timeout', + 'span_frames_min_duration', + 'stack_trace_limit', + 'stress_monitor_cpu_duration_threshold', + 'stress_monitor_gc_relief_threshold', + 'stress_monitor_gc_stress_threshold', + 'stress_monitor_system_cpu_relief_threshold', + 'stress_monitor_system_cpu_stress_threshold', + 'transaction_ignore_urls', + 'transaction_max_spans', + 'transaction_sample_rate', + ]) + ); }); it('js-base', () => { - expect(getSettingKeysForAgent('js-base')).toEqual([ - 'transaction_sample_rate', - ]); + expect(getSettingKeysForAgent('js-base')).toEqual( + expect.arrayContaining(['transaction_sample_rate']) + ); }); it('rum-js', () => { - expect(getSettingKeysForAgent('rum-js')).toEqual([ - 'transaction_sample_rate', - ]); + expect(getSettingKeysForAgent('rum-js')).toEqual( + expect.arrayContaining(['transaction_sample_rate']) + ); }); it('nodejs', () => { - expect(getSettingKeysForAgent('nodejs')).toEqual([ - 'capture_body', - 'log_level', - 'sanitize_field_names', - 'transaction_ignore_urls', - 'transaction_max_spans', - 'transaction_sample_rate', - ]); + expect(getSettingKeysForAgent('nodejs')).toEqual( + expect.arrayContaining([ + 'capture_body', + 'log_level', + 'sanitize_field_names', + 'transaction_ignore_urls', + 'transaction_max_spans', + 'transaction_sample_rate', + ]) + ); }); it('python', () => { - expect(getSettingKeysForAgent('python')).toEqual([ - 'api_request_size', - 'api_request_time', - 'capture_body', - 'capture_headers', - 'log_level', - 'recording', - 'sanitize_field_names', - 'span_frames_min_duration', - 'transaction_ignore_urls', - 'transaction_max_spans', - 'transaction_sample_rate', - ]); + expect(getSettingKeysForAgent('python')).toEqual( + expect.arrayContaining([ + 'api_request_size', + 'api_request_time', + 'capture_body', + 'capture_headers', + 'log_level', + 'recording', + 'sanitize_field_names', + 'span_frames_min_duration', + 'transaction_ignore_urls', + 'transaction_max_spans', + 'transaction_sample_rate', + ]) + ); }); it('dotnet', () => { - expect(getSettingKeysForAgent('dotnet')).toEqual([ - 'capture_body', - 'capture_headers', - 'log_level', - 'recording', - 'sanitize_field_names', - 'span_frames_min_duration', - 'stack_trace_limit', - 'transaction_ignore_urls', - 'transaction_max_spans', - 'transaction_sample_rate', - ]); + expect(getSettingKeysForAgent('dotnet')).toEqual( + expect.arrayContaining([ + 'capture_body', + 'capture_headers', + 'log_level', + 'recording', + 'sanitize_field_names', + 'span_frames_min_duration', + 'stack_trace_limit', + 'transaction_ignore_urls', + 'transaction_max_spans', + 'transaction_sample_rate', + ]) + ); }); it('ruby', () => { - expect(getSettingKeysForAgent('ruby')).toEqual([ - 'api_request_size', - 'api_request_time', - 'capture_body', - 'capture_headers', - 'log_level', - 'recording', - 'sanitize_field_names', - 'span_frames_min_duration', - 'transaction_ignore_urls', - 'transaction_max_spans', - 'transaction_sample_rate', - ]); + expect(getSettingKeysForAgent('ruby')).toEqual( + expect.arrayContaining([ + 'api_request_size', + 'api_request_time', + 'capture_body', + 'capture_headers', + 'log_level', + 'recording', + 'sanitize_field_names', + 'span_frames_min_duration', + 'transaction_ignore_urls', + 'transaction_max_spans', + 'transaction_sample_rate', + ]) + ); }); it('php', () => { - expect(getSettingKeysForAgent('php')).toEqual([ - 'log_level', - 'recording', - 'transaction_max_spans', - 'transaction_sample_rate', - ]); + expect(getSettingKeysForAgent('php')).toEqual( + expect.arrayContaining([ + 'log_level', + 'recording', + 'transaction_max_spans', + 'transaction_sample_rate', + ]) + ); }); it('"All" services (no agent name)', () => { - expect(getSettingKeysForAgent(undefined)).toEqual([ - 'transaction_max_spans', - 'transaction_sample_rate', - ]); + expect(getSettingKeysForAgent(undefined)).toEqual( + expect.arrayContaining([ + 'transaction_max_spans', + 'transaction_sample_rate', + ]) + ); }); }); }); diff --git a/x-pack/plugins/apm/common/agent_configuration/setting_definitions/java_settings.ts b/x-pack/plugins/apm/common/agent_configuration/setting_definitions/java_settings.ts index dc4eb89cf7dec..694eef7885b31 100644 --- a/x-pack/plugins/apm/common/agent_configuration/setting_definitions/java_settings.ts +++ b/x-pack/plugins/apm/common/agent_configuration/setting_definitions/java_settings.ts @@ -238,4 +238,95 @@ export const javaSettings: RawSettingDefinition[] = [ ), includeAgents: ['java'], }, + + { + key: 'capture_jmx_metrics', + type: 'text', + defaultValue: '', + label: i18n.translate('xpack.apm.agentConfig.captureJmxMetrics.label', { + defaultMessage: 'Capture JMX metrics', + }), + description: i18n.translate( + 'xpack.apm.agentConfig.captureJmxMetrics.description', + { + defaultMessage: + 'Report metrics from JMX to the APM Server\n' + + '\n' + + 'Can contain multiple comma separated JMX metric definitions:\n' + + '\n' + + '`object_name[<JMX object name pattern>] attribute[<JMX attribute>:metric_name=<optional metric name>]`\n' + + '\n' + + 'See the Java agent documentation for more details.', + } + ), + includeAgents: ['java'], + }, + + { + key: 'ignore_exceptions', + type: 'text', + defaultValue: '', + label: i18n.translate('xpack.apm.agentConfig.ignoreExceptions.label', { + defaultMessage: 'Ignore exceptions', + }), + description: i18n.translate( + 'xpack.apm.agentConfig.ignoreExceptions.description', + { + defaultMessage: + 'A list of exceptions that should be ignored and not reported as errors.\n' + + 'This allows to ignore exceptions thrown in regular control flow that are not actual errors.', + } + ), + includeAgents: ['java'], + }, + + { + key: 'trace_methods', + type: 'text', + defaultValue: '', + label: i18n.translate('xpack.apm.agentConfig.traceMethods.label', { + defaultMessage: 'Trace methods', + }), + description: i18n.translate( + 'xpack.apm.agentConfig.traceMethods.description', + { + defaultMessage: + 'A list of methods for which to create a transaction or span.\n' + + '\n' + + 'If you want to monitor a large number of methods,\n' + + 'use `profiling_inferred_spans_enabled`.\n' + + '\n' + + 'This works by instrumenting each matching method to include code that creates a span for the method.\n' + + 'While creating a span is quite cheap in terms of performance,\n' + + 'instrumenting a whole code base or a method which is executed in a tight loop leads to significant overhead.\n' + + '\n' + + 'NOTE: Only use wildcards if necessary.\n' + + 'The more methods you match the more overhead will be caused by the agent.\n' + + 'Also note that there is a maximum amount of spans per transaction `transaction_max_spans`.\n' + + '\n' + + 'See the Java agent documentation for more details.', + } + ), + includeAgents: ['java'], + }, + + { + key: 'unnest_exceptions', + type: 'text', + defaultValue: '', + label: i18n.translate('xpack.apm.agentConfig.unnestExceptions.label', { + defaultMessage: 'Unnest exceptions', + }), + description: i18n.translate( + 'xpack.apm.agentConfig.unnestExceptions.description', + { + defaultMessage: + 'When reporting exceptions,\n' + + 'un-nests the exceptions matching the wildcard pattern.\n' + + "This can come in handy for Spring's `org.springframework.web.util.NestedServletException`,\n" + + 'for example.', + } + ), + includeAgents: ['java'], + }, ]; diff --git a/x-pack/plugins/apm/common/critical_path/get_aggregated_critical_path_root_nodes.ts b/x-pack/plugins/apm/common/critical_path/get_aggregated_critical_path_root_nodes.ts new file mode 100644 index 0000000000000..5d00db3977b07 --- /dev/null +++ b/x-pack/plugins/apm/common/critical_path/get_aggregated_critical_path_root_nodes.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 { sumBy } from 'lodash'; +import type { CriticalPathResponse } from '../../server/routes/traces/get_aggregated_critical_path'; + +export interface CriticalPathTreeNode { + nodeId: string; + children: CriticalPathTreeNode[]; + countInclusive: number; + countExclusive: number; +} + +export function getAggregatedCriticalPathRootNodes(params: { + criticalPath: CriticalPathResponse; +}): { + rootNodes: CriticalPathTreeNode[]; + maxDepth: number; + numNodes: number; +} { + let maxDepth = 20; // min max depth + + const { criticalPath } = params; + + let numNodes = 0; + + function mergeNodesWithSameOperationId( + nodes: CriticalPathTreeNode[] + ): CriticalPathTreeNode[] { + const nodesByOperationId: Record<string, CriticalPathTreeNode> = {}; + const mergedNodes = nodes.reduce<CriticalPathTreeNode[]>( + (prev, node, index, array) => { + const nodeId = node.nodeId; + const operationId = criticalPath.operationIdByNodeId[nodeId]; + if (nodesByOperationId[operationId]) { + const prevNode = nodesByOperationId[operationId]; + prevNode.children.push(...node.children); + prevNode.countExclusive += node.countExclusive; + prevNode.countInclusive += node.countInclusive; + return prev; + } + + nodesByOperationId[operationId] = node; + + prev.push(node); + return prev; + }, + [] + ); + + numNodes += mergedNodes.length; + + mergedNodes.forEach((node) => { + node.children = mergeNodesWithSameOperationId(node.children); + }); + + return mergedNodes; + } + + function getNode(nodeId: string, depth: number): CriticalPathTreeNode { + maxDepth = Math.max(maxDepth, depth); + + const children = criticalPath.nodes[nodeId].map((childNodeId) => + getNode(childNodeId, depth + 1) + ); + + const nodeCountExclusive = criticalPath.timeByNodeId[nodeId] || 0; + const nodeCountInclusive = + sumBy(children, (child) => child.countInclusive) + nodeCountExclusive; + + return { + nodeId, + children, + countInclusive: nodeCountInclusive, + countExclusive: nodeCountExclusive, + }; + } + + const rootNodes = mergeNodesWithSameOperationId( + criticalPath.rootNodes.map((nodeId) => getNode(nodeId, 1)) + ); + + return { + rootNodes, + maxDepth, + numNodes, + }; +} diff --git a/x-pack/plugins/apm/common/critical_path/get_critical_path.test.ts b/x-pack/plugins/apm/common/critical_path/get_critical_path.test.ts new file mode 100644 index 0000000000000..38d1b0a3da1ca --- /dev/null +++ b/x-pack/plugins/apm/common/critical_path/get_critical_path.test.ts @@ -0,0 +1,274 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { apm, ApmFields, dedot } from '@kbn/apm-synthtrace'; +import { getWaterfall } from '../../public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers'; +import { Span } from '../../typings/es_schemas/ui/span'; +import { Transaction } from '../../typings/es_schemas/ui/transaction'; +import { getCriticalPath } from './get_critical_path'; + +describe('getCriticalPath', () => { + function getCriticalPathFromEvents(events: ApmFields[]) { + const waterfall = getWaterfall( + { + traceDocs: events.map( + (event) => dedot(event, {}) as Transaction | Span + ), + errorDocs: [], + exceedsMax: false, + linkedChildrenOfSpanCountBySpanId: {}, + }, + events[0]['transaction.id']! + ); + + return { + waterfall, + criticalPath: getCriticalPath(waterfall), + }; + } + it('adds the only active span to the critical path', () => { + const service = apm.service('a', 'development', 'java').instance('a'); + + const { + criticalPath: { segments }, + waterfall, + } = getCriticalPathFromEvents( + service + .transaction('/service-a') + .timestamp(1) + .duration(100) + .children( + service.span('foo', 'external', 'db').duration(100).timestamp(1) + ) + .serialize() + ); + + expect(segments).toEqual([ + { self: false, duration: 100000, item: waterfall.items[0], offset: 0 }, + { self: false, duration: 100000, item: waterfall.items[1], offset: 0 }, + { self: true, duration: 100000, item: waterfall.items[1], offset: 0 }, + ]); + }); + + it('adds the span that ended last', () => { + const service = apm.service('a', 'development', 'java').instance('a'); + + const { + criticalPath: { segments }, + waterfall, + } = getCriticalPathFromEvents( + service + .transaction('/service-a') + .timestamp(1) + .duration(100) + .children( + service.span('foo', 'external', 'db').duration(99).timestamp(1), + service.span('bar', 'external', 'db').duration(100).timestamp(1) + ) + .serialize() + ); + + const longerSpan = waterfall.items.find( + (item) => (item.doc as Span).span?.name === 'bar' + ); + + expect(segments).toEqual([ + { self: false, duration: 100000, item: waterfall.items[0], offset: 0 }, + { + self: false, + duration: 100000, + item: longerSpan, + offset: 0, + }, + { self: true, duration: 100000, item: longerSpan, offset: 0 }, + ]); + }); + + it('adds segment for uninstrumented gaps in the parent', () => { + const service = apm.service('a', 'development', 'java').instance('a'); + + const { + criticalPath: { segments }, + waterfall, + } = getCriticalPathFromEvents( + service + .transaction('/service-a') + .timestamp(1) + .duration(100) + .children( + service.span('foo', 'external', 'db').duration(50).timestamp(11) + ) + .serialize() + ); + + expect( + segments.map((segment) => ({ + self: segment.self, + duration: segment.duration, + id: segment.item.id, + offset: segment.offset, + })) + ).toEqual([ + { self: false, duration: 100000, id: waterfall.items[0].id, offset: 0 }, + { + self: true, + duration: 40000, + id: waterfall.items[0].id, + offset: 60000, + }, + { + self: false, + duration: 50000, + id: waterfall.items[1].id, + offset: 10000, + }, + { + self: true, + duration: 50000, + id: waterfall.items[1].id, + offset: 10000, + }, + { + self: true, + duration: 10000, + offset: 0, + id: waterfall.items[0].id, + }, + ]); + }); + + it('only considers a single child to be active at the same time', () => { + const service = apm.service('a', 'development', 'java').instance('a'); + + const { + criticalPath: { segments }, + waterfall, + } = getCriticalPathFromEvents( + service + .transaction('s1') + .timestamp(1) + .duration(100) + .children( + service.span('s2', 'external', 'db').duration(1).timestamp(1), + service.span('s3', 'external', 'db').duration(1).timestamp(2), + service.span('s4', 'external', 'db').duration(98).timestamp(3), + service + .span('s5', 'external', 'db') + .duration(98) + .timestamp(1) + .children( + service.span('s6', 'external', 'db').duration(30).timestamp(5), + service.span('s7', 'external', 'db').duration(30).timestamp(35) + ) + ) + .serialize() + ); + + const [_s1, s2, _s5, _s6, _s7, s3, s4] = waterfall.items; + + expect( + segments + .map((segment) => ({ + self: segment.self, + duration: segment.duration, + id: segment.item.id, + offset: segment.offset, + })) + .filter((segment) => segment.self) + .map((segment) => segment.id) + ).toEqual([s4.id, s3.id, s2.id]); + }); + + // https://www.uber.com/en-NL/blog/crisp-critical-path-analysis-for-microservice-architectures/ + it('correctly returns the critical path for the CRISP example', () => { + const service = apm.service('a', 'development', 'java').instance('a'); + + const { + criticalPath: { segments }, + waterfall, + } = getCriticalPathFromEvents( + service + .transaction('s1') + .timestamp(1) + .duration(100) + .children( + service.span('s2', 'external', 'db').duration(25).timestamp(6), + service + .span('s3', 'external', 'db') + .duration(50) + .timestamp(41) + .children( + service.span('s4', 'external', 'db').duration(20).timestamp(61), + service.span('s5', 'external', 'db').duration(30).timestamp(51) + ) + ) + .serialize() + ); + + const [s1, s2, s3, s5, _s4] = waterfall.items; + + expect( + segments + .map((segment) => ({ + self: segment.self, + duration: segment.duration, + id: segment.item.id, + offset: segment.offset, + })) + .filter((segment) => segment.self) + ).toEqual([ + // T9-T10 + { + self: true, + duration: 10000, + id: s1.id, + offset: 90000, + }, + // T8-T9 + { + self: true, + duration: 10000, + id: s3.id, + offset: 80000, + }, + // T5-T8 + { + self: true, + duration: s5.duration, + id: s5.id, + offset: s5.offset, + }, + // T4-T5 + { + self: true, + duration: 10000, + id: s3.id, + offset: 40000, + }, + // T3-T4 + { + self: true, + duration: 10000, + id: s1.id, + offset: 30000, + }, + // T2-T3 + { + self: true, + duration: 25000, + id: s2.id, + offset: 5000, + }, + // T1-T2 + { + duration: 5000, + id: s1.id, + offset: 0, + self: true, + }, + ]); + }); +}); diff --git a/x-pack/plugins/apm/common/critical_path/get_critical_path.ts b/x-pack/plugins/apm/common/critical_path/get_critical_path.ts new file mode 100644 index 0000000000000..ad4e166962ccb --- /dev/null +++ b/x-pack/plugins/apm/common/critical_path/get_critical_path.ts @@ -0,0 +1,137 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { + IWaterfall, + IWaterfallSpanOrTransaction, +} from '../../public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers'; +import { CriticalPath, CriticalPathSegment } from './types'; + +export function getCriticalPath(waterfall: IWaterfall): CriticalPath { + const segments: CriticalPathSegment[] = []; + + function scan({ + item, + start, + end, + }: { + item: IWaterfallSpanOrTransaction; + start: number; + end: number; + }): void { + segments.push({ + self: false, + duration: end - start, + item, + offset: start, + }); + const directChildren = waterfall.childrenByParentId[item.id]; + + if (directChildren && directChildren.length > 0) { + // We iterate over all the item's direct children. The one that + // ends last is the first item in the array. + const orderedChildren = directChildren.concat().sort((a, b) => { + const endTimeA = a.offset + a.skew + a.duration; + const endTimeB = b.offset + b.skew + b.duration; + if (endTimeA === endTimeB) { + return 0; + } + return endTimeB > endTimeA ? 1 : -1; + }); + + // For each point in time, determine what child is on the critical path. + // We start scanning at the end. Once we've decided what the child on the + // critical path is, scan its children, from the start time of that span + // until the end. The next scan time is the start time of the child that was + // on the critical path. + let scanTime = end; + + orderedChildren.forEach((child) => { + const normalizedChildStart = Math.max(child.offset + child.skew, start); + const childEnd = child.offset + child.skew + child.duration; + + // if a span ends before the current scan time, use the current + // scan time as when the child ended. We don't want to scan further + // than the scan time. This prevents overlap in the critical path. + const normalizedChildEnd = Math.min(childEnd, scanTime); + + const isOnCriticalPath = !( + // A span/tx is NOT on the critical path if: + // - The start time is equal to or greater than the current scan time. + // Otherwise, spans that started at the same time will all contribute to + // the critical path, but we only want one to contribute. + // - The span/tx ends before the start of the initial scan period. + // - The span ends _after_ the current scan time. + + ( + normalizedChildStart >= scanTime || + normalizedChildEnd < start || + childEnd > scanTime + ) + ); + + if (!isOnCriticalPath) { + return; + } + + if (normalizedChildEnd < scanTime - 1000) { + // This span is on the critical path, but it ended before the scan time. + // This means that there is a gap, so we add a segment to the critical path + // for the _parent_. There's a slight offset because we don't want really small + // segments that can be reasonably attributed to clock skew. + segments.push({ + item, + duration: scanTime - normalizedChildEnd, + offset: normalizedChildEnd, + self: true, + }); + } + + // scan this child for the period we're considering it to be on the critical path + scan({ + start: normalizedChildStart, + end: childEnd, + item: child, + }); + + // set the scan time to the start of the span, and scan the next child + scanTime = normalizedChildStart; + }); + + // there's an unattributed gap at the start, so add a segment for the parent as well + if (scanTime > start) { + segments.push({ + item, + offset: start, + duration: scanTime - start, + self: true, + }); + } + } else { + // for the entire scan period, add this item to the critical path + segments.push({ + item, + offset: start, + duration: end - start, + self: true, + }); + } + } + + if (waterfall.entryWaterfallTransaction) { + const start = + waterfall.entryWaterfallTransaction.skew + + waterfall.entryWaterfallTransaction.offset; + scan({ + item: waterfall.entryWaterfallTransaction, + start, + end: start + waterfall.entryWaterfallTransaction.duration, + }); + } + + return { segments }; +} diff --git a/x-pack/plugins/apm/common/critical_path/types.ts b/x-pack/plugins/apm/common/critical_path/types.ts new file mode 100644 index 0000000000000..56f3db04e866f --- /dev/null +++ b/x-pack/plugins/apm/common/critical_path/types.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { IWaterfallSpanOrTransaction } from '../../public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers'; + +export interface CriticalPathSegment { + item: IWaterfallSpanOrTransaction; + offset: number; + duration: number; + self: boolean; +} + +export interface CriticalPath { + segments: CriticalPathSegment[]; +} diff --git a/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts b/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts index f29bf3c607e86..1734742c31d86 100644 --- a/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts +++ b/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts @@ -123,6 +123,8 @@ export const HOST = 'host'; export const HOST_HOSTNAME = 'host.hostname'; // Do not use. Please use `HOST_NAME` instead. export const HOST_NAME = 'host.name'; export const HOST_OS_PLATFORM = 'host.os.platform'; +export const HOST_ARCHITECTURE = 'host.architecture'; +export const HOST_OS_VERSION = 'host.os.version'; export const CONTAINER_ID = 'container.id'; export const CONTAINER = 'container'; export const CONTAINER_IMAGE = 'container.image.name'; @@ -147,6 +149,7 @@ export const USER_AGENT_DEVICE = 'user_agent.device.name'; export const USER_AGENT_OS = 'user_agent.os.name'; export const FAAS_ID = 'faas.id'; +export const FAAS_NAME = 'faas.name'; export const FAAS_COLDSTART = 'faas.coldstart'; export const FAAS_TRIGGER_TYPE = 'faas.trigger.type'; export const FAAS_DURATION = 'faas.duration'; @@ -156,3 +159,7 @@ export const FAAS_BILLED_DURATION = 'faas.billed_duration'; // Metadata export const TIER = '_tier'; export const INDEX = '_index'; + +// Mobile +export const NETWORK_CONNECTION_TYPE = 'network.connection.type'; +export const DEVICE_MODEL_NAME = 'device.model.name'; diff --git a/x-pack/plugins/apm/common/index.ts b/x-pack/plugins/apm/common/index.ts new file mode 100644 index 0000000000000..d08ff963b0f1f --- /dev/null +++ b/x-pack/plugins/apm/common/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. + */ + +// for API tests +export { getAggregatedCriticalPathRootNodes } from './critical_path/get_aggregated_critical_path_root_nodes'; diff --git a/x-pack/plugins/apm/common/serverless.test.ts b/x-pack/plugins/apm/common/serverless.test.ts new file mode 100644 index 0000000000000..5473e9d735d86 --- /dev/null +++ b/x-pack/plugins/apm/common/serverless.test.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { getServerlessFunctionNameFromId } from './serverless'; + +describe('getServerlessFunctionNameFromId', () => { + it('returns serverlessId when regex does not match', () => { + expect(getServerlessFunctionNameFromId('foo')).toEqual('foo'); + }); + + it('returns correct serverless function name', () => { + expect( + getServerlessFunctionNameFromId( + 'arn:aws:lambda:us-west-2:123456789012:function:my-function' + ) + ).toEqual('my-function'); + expect( + getServerlessFunctionNameFromId( + 'arn:aws:lambda:us-west-2:123456789012:function:my:function' + ) + ).toEqual('my:function'); + }); +}); diff --git a/x-pack/plugins/apm/common/serverless.ts b/x-pack/plugins/apm/common/serverless.ts new file mode 100644 index 0000000000000..5e91cb04d868d --- /dev/null +++ b/x-pack/plugins/apm/common/serverless.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. + */ + +/** + * Gets the serverless function name from serverless id. + * Serverless id example: arn:aws:lambda:us-west-2:123456789012:function:my-function + * The function name is the last part after "function:" + */ +const serverlessIdRegex = /function:(.*)/; +export function getServerlessFunctionNameFromId(serverlessId: string) { + const match = serverlessIdRegex.exec(serverlessId); + return match ? match[1] : serverlessId; +} diff --git a/x-pack/plugins/apm/common/service_groups.test.ts b/x-pack/plugins/apm/common/service_groups.test.ts new file mode 100644 index 0000000000000..856eec4ef2e3f --- /dev/null +++ b/x-pack/plugins/apm/common/service_groups.test.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 { + isSupportedField, + validateServiceGroupKuery, + SERVICE_GROUP_SUPPORTED_FIELDS, +} from './service_groups'; +import { + TRANSACTION_TYPE, + TRANSACTION_DURATION, + SERVICE_FRAMEWORK_VERSION, +} from './elasticsearch_fieldnames'; + +describe('service_groups common utils', () => { + describe('isSupportedField', () => { + it('should allow supported fields', () => { + SERVICE_GROUP_SUPPORTED_FIELDS.map((field) => { + expect(isSupportedField(field)).toBe(true); + }); + }); + it('should reject unsupported fields', () => { + const unsupportedFields = [ + TRANSACTION_TYPE, + TRANSACTION_DURATION, + SERVICE_FRAMEWORK_VERSION, + ]; + unsupportedFields.map((field) => { + expect(isSupportedField(field)).toBe(false); + }); + }); + }); + describe('validateServiceGroupKuery', () => { + it('should validate supported KQL filter for a service group', () => { + const result = validateServiceGroupKuery( + `service.name: testbeans* or agent.name: "nodejs"` + ); + expect(result).toHaveProperty('isValidFields', true); + expect(result).toHaveProperty('isValidSyntax', true); + expect(result).not.toHaveProperty('message'); + }); + it('should return validation error when unsupported fields are used', () => { + const result = validateServiceGroupKuery( + `service.name: testbeans* or agent.name: "nodejs" or transaction.type: request` + ); + expect(result).toHaveProperty('isValidFields', false); + expect(result).toHaveProperty('isValidSyntax', true); + expect(result).toHaveProperty( + 'message', + 'Query filter for service group does not support fields [transaction.type]' + ); + }); + it('should return parsing error when KQL is incomplete', () => { + const result = validateServiceGroupKuery( + `service.name: testbeans* or agent.name: "nod` + ); + expect(result).toHaveProperty('isValidFields', false); + expect(result).toHaveProperty('isValidSyntax', false); + expect(result).toHaveProperty('message'); + expect(result).not.toBe(''); + }); + }); +}); diff --git a/x-pack/plugins/apm/common/service_groups.ts b/x-pack/plugins/apm/common/service_groups.ts index e3a82e7e56b6c..4b2ba1288ecae 100644 --- a/x-pack/plugins/apm/common/service_groups.ts +++ b/x-pack/plugins/apm/common/service_groups.ts @@ -5,6 +5,18 @@ * 2.0. */ +import { fromKueryExpression } from '@kbn/es-query'; +import { i18n } from '@kbn/i18n'; +import { getKueryFields } from './utils/get_kuery_fields'; +import { + AGENT_NAME, + SERVICE_NAME, + SERVICE_ENVIRONMENT, + SERVICE_LANGUAGE_NAME, +} from './elasticsearch_fieldnames'; + +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; @@ -20,3 +32,51 @@ export interface SavedServiceGroup extends ServiceGroup { id: string; updatedAt: number; } + +export const SERVICE_GROUP_SUPPORTED_FIELDS = [ + AGENT_NAME, + SERVICE_NAME, + SERVICE_ENVIRONMENT, + SERVICE_LANGUAGE_NAME, + LABELS, +]; + +export function isSupportedField(fieldName: string) { + return ( + fieldName.startsWith(LABELS) || + SERVICE_GROUP_SUPPORTED_FIELDS.includes(fieldName) + ); +} + +export function validateServiceGroupKuery(kuery: string): { + isValidFields: boolean; + isValidSyntax: boolean; + message?: string; +} { + try { + const kueryFields = getKueryFields([fromKueryExpression(kuery)]); + const unsupportedKueryFields = kueryFields.filter( + (fieldName) => !isSupportedField(fieldName) + ); + if (unsupportedKueryFields.length === 0) { + return { isValidFields: true, isValidSyntax: true }; + } + return { + isValidFields: false, + isValidSyntax: true, + message: i18n.translate('xpack.apm.serviceGroups.invalidFields.message', { + defaultMessage: + 'Query filter for service group does not support fields [{unsupportedFieldNames}]', + values: { + unsupportedFieldNames: unsupportedKueryFields.join(', '), + }, + }), + }; + } catch (error) { + return { + isValidFields: false, + isValidSyntax: false, + message: error.message, + }; + } +} diff --git a/x-pack/plugins/apm/common/tutorial/instructions/apm_agent_instructions.ts b/x-pack/plugins/apm/common/tutorial/instructions/apm_agent_instructions.ts index b1c5fc79816ac..9406942f85179 100644 --- a/x-pack/plugins/apm/common/tutorial/instructions/apm_agent_instructions.ts +++ b/x-pack/plugins/apm/common/tutorial/instructions/apm_agent_instructions.ts @@ -519,10 +519,12 @@ export const createDotNetAgentInstructions = ( defaultMessage: 'In case you don’t pass an `IConfiguration` instance to the agent (e.g. in case of non ASP.NET Core applications) \ you can also configure the agent through environment variables. \n \ - See [the documentation]({documentationLink}) for advanced usage.', + See [the documentation]({documentationLink}) for advanced usage, including the [Profiler Auto instrumentation]({profilerLink}) quick start.', values: { documentationLink: '{config.docs.base_url}guide/en/apm/agent/dotnet/current/configuration.html', + profilerLink: + '{config.docs.base_url}guide/en/apm/agent/dotnet/current/setup-auto-instrumentation.html#setup-auto-instrumentation', }, } ), diff --git a/x-pack/plugins/apm/common/utils/environment_query.ts b/x-pack/plugins/apm/common/utils/environment_query.ts index bc02e4cd2518b..42744778b861b 100644 --- a/x-pack/plugins/apm/common/utils/environment_query.ts +++ b/x-pack/plugins/apm/common/utils/environment_query.ts @@ -17,7 +17,7 @@ import { import { SERVICE_NODE_NAME_MISSING } from '../service_nodes'; export function environmentQuery( - environment: string + environment: string | undefined ): QueryDslQueryContainer[] { if (!environment || environment === ENVIRONMENT_ALL.value) { return []; diff --git a/x-pack/plugins/apm/server/lib/helpers/get_kuery_fields.test.ts b/x-pack/plugins/apm/common/utils/get_kuery_fields.test.ts similarity index 100% rename from x-pack/plugins/apm/server/lib/helpers/get_kuery_fields.test.ts rename to x-pack/plugins/apm/common/utils/get_kuery_fields.test.ts diff --git a/x-pack/plugins/apm/server/lib/helpers/get_kuery_fields.ts b/x-pack/plugins/apm/common/utils/get_kuery_fields.ts similarity index 100% rename from x-pack/plugins/apm/server/lib/helpers/get_kuery_fields.ts rename to x-pack/plugins/apm/common/utils/get_kuery_fields.ts diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/power_user/storage_explorer/storage_explorer.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/power_user/storage_explorer/storage_explorer.cy.ts index 2efebecf25756..3fdeff2e406a8 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/power_user/storage_explorer/storage_explorer.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/power_user/storage_explorer/storage_explorer.cy.ts @@ -79,6 +79,8 @@ describe('Storage Explorer', () => { it('has a list of summary stats', () => { cy.contains('Total APM size'); + cy.contains('Disk space used'); + cy.contains('Incremental APM size'); cy.contains('Daily data generation'); cy.contains('Traces per minute'); cy.contains('Number of services'); @@ -200,6 +202,7 @@ describe('Storage Explorer', () => { cy.contains('Service storage details'); cy.getByTestSubj('storageExplorerTimeseriesChart'); cy.getByTestSubj('serviceStorageDetailsTable'); + cy.getByTestSubj('storageExplorerIndicesStatsTable'); }); }); }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/deep_links.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/deep_links.cy.ts index 00b842f3265c7..513d9afeccf9d 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/deep_links.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/deep_links.cy.ts @@ -14,6 +14,7 @@ describe('APM deep links', () => { cy.getByTestSubj('nav-search-input').type('APM'); cy.contains('APM'); cy.contains('APM / Services'); + cy.contains('APM / Service groups'); cy.contains('APM / Traces'); cy.contains('APM / Service Map'); @@ -28,6 +29,11 @@ describe('APM deep links', () => { cy.contains('APM / Services').click({ force: true }); cy.url().should('include', '/apm/services'); + cy.getByTestSubj('nav-search-input').type('APM'); + // navigates to service groups page + cy.contains('APM / Service groups').click({ force: true }); + cy.url().should('include', '/apm/service-groups'); + cy.getByTestSubj('nav-search-input').type('APM'); // navigates to traces page cy.contains('APM / Traces').click({ force: true }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/service_inventory/header_filters/header_filters.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/service_inventory/header_filters/header_filters.cy.ts index 4f72e968d81f8..e689e126d4bfd 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/service_inventory/header_filters/header_filters.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/service_inventory/header_filters/header_filters.cy.ts @@ -28,6 +28,7 @@ describe('Service inventory - header filters', () => { specialServiceName, }) ); + cy.dismissServiceGroupsTour(); }); after(() => { diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts b/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts index 9e6e0189e636c..e0af1e1a84729 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts @@ -21,7 +21,7 @@ Cypress.Commands.add('loginAsEditorUser', () => { Cypress.Commands.add('loginAsMonitorUser', () => { return cy.loginAs({ - username: ApmUsername.apmMonitorIndices, + username: ApmUsername.apmMonitorClusterAndIndices, password: 'changeme', }); }); @@ -125,6 +125,16 @@ Cypress.Commands.add( } ); +Cypress.Commands.add('dismissServiceGroupsTour', () => { + window.localStorage.setItem( + 'apm.serviceGroupsTour', + JSON.stringify({ + createGroup: false, + editGroup: false, + }) + ); +}); + // A11y configuration const axeConfig = { diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts b/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts index 5d59d4691820a..d9675f2536315 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts @@ -23,5 +23,6 @@ declare namespace Cypress { }): void; updateAdvancedSettings(settings: Record<string, unknown>): void; getByTestSubj(selector: string): Chainable<JQuery<Element>>; + dismissServiceGroupsTour(): void; } } diff --git a/x-pack/plugins/apm/ftr_e2e/tsconfig.json b/x-pack/plugins/apm/ftr_e2e/tsconfig.json index 730971a284ed5..6a8ba7e1495ae 100644 --- a/x-pack/plugins/apm/ftr_e2e/tsconfig.json +++ b/x-pack/plugins/apm/ftr_e2e/tsconfig.json @@ -8,6 +8,7 @@ "target/**/*" ], "compilerOptions": { + "target": "es2015", "outDir": "target/types", "types": [ "cypress", @@ -15,7 +16,7 @@ "cypress-real-events" ] }, - "references": [ + "kbn_references": [ { "path": "../../../test/tsconfig.json" }, { "path": "../../../../test/tsconfig.json" }, { "path": "../tsconfig.json" }, diff --git a/x-pack/plugins/apm/kibana.json b/x-pack/plugins/apm/kibana.json index 78233626091e5..ff8f2c24cfd93 100644 --- a/x-pack/plugins/apm/kibana.json +++ b/x-pack/plugins/apm/kibana.json @@ -20,7 +20,9 @@ "share", "unifiedSearch", "dataViews", - "advancedSettings" + "advancedSettings", + "lens", + "maps" ], "optionalPlugins": [ "actions", @@ -47,6 +49,7 @@ "kibanaUtils", "ml", "observability", - "esUiShared" + "esUiShared", + "maps" ] -} +} \ No newline at end of file diff --git a/x-pack/plugins/apm/public/application/index.tsx b/x-pack/plugins/apm/public/application/index.tsx index c3cf929a40209..438283a9128e4 100644 --- a/x-pack/plugins/apm/public/application/index.tsx +++ b/x-pack/plugins/apm/public/application/index.tsx @@ -53,6 +53,7 @@ export const renderApp = ({ observabilityRuleTypeRegistry, dataViews: pluginsStart.dataViews, unifiedSearch: pluginsStart.unifiedSearch, + lens: pluginsStart.lens, }; // render APM feedback link in global help menu diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.stories.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.stories.tsx index 9c422df230e20..424e490b732b1 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.stories.tsx +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.stories.tsx @@ -9,6 +9,7 @@ import { Meta, Story } from '@storybook/react'; import React, { useState } from 'react'; import { CoreStart } from '@kbn/core/public'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; +import { TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/public'; import { RuleParams, ErrorCountRuleType } from '.'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { createCallApmApi } from '../../../../services/rest/create_call_apm_api'; @@ -129,7 +130,7 @@ EditingInStackManagement.args = { serviceName: 'testServiceName', threshold: 25, windowSize: 1, - windowUnit: 'm', + windowUnit: TIME_UNITS.MINUTE, }, metadata: undefined, }; diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx index 218f35c85400f..8868cd6ccce88 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx @@ -10,7 +10,10 @@ import { defaults, omit } from 'lodash'; import React, { useEffect } from 'react'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ForLastExpression } from '@kbn/triggers-actions-ui-plugin/public'; +import { + ForLastExpression, + TIME_UNITS, +} from '@kbn/triggers-actions-ui-plugin/public'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { asInteger } from '../../../../../common/utils/formatters'; import { useFetcher } from '../../../../hooks/use_fetcher'; @@ -21,16 +24,12 @@ import { IsAboveField, ServiceField, } from '../../utils/fields'; -import { - AlertMetadata, - getIntervalAndTimeRange, - TimeUnit, -} from '../../utils/helper'; +import { AlertMetadata, getIntervalAndTimeRange } from '../../utils/helper'; import { ApmRuleParamsContainer } from '../../ui_components/apm_rule_params_container'; export interface RuleParams { windowSize?: number; - windowUnit?: TimeUnit; + windowUnit?: TIME_UNITS; threshold?: number; serviceName?: string; environment?: string; @@ -55,8 +54,8 @@ export function ErrorCountRuleType(props: Props) { { ...omit(metadata, ['start', 'end']), ...ruleParams }, { threshold: 25, - windowSize: 1, - windowUnit: 'm', + windowSize: 5, + windowUnit: TIME_UNITS.MINUTE, environment: ENVIRONMENT_ALL.value, } ); @@ -65,7 +64,7 @@ export function ErrorCountRuleType(props: Props) { (callApmApi) => { const { interval, start, end } = getIntervalAndTimeRange({ windowSize: params.windowSize, - windowUnit: params.windowUnit as TimeUnit, + windowUnit: params.windowUnit, }); if (interval && start && end) { return callApmApi( @@ -135,7 +134,8 @@ export function ErrorCountRuleType(props: Props) { return ( <ApmRuleParamsContainer - defaults={params} + minimumWindowSize={{ value: 5, unit: TIME_UNITS.MINUTE }} + defaultParams={params} fields={fields} setRuleParams={setRuleParams} setRuleProperty={setRuleProperty} diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_anomaly_rule_type/index.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_anomaly_rule_type/index.tsx index 85c1e5ddcde20..f6523a62acda2 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_anomaly_rule_type/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_anomaly_rule_type/index.tsx @@ -10,6 +10,7 @@ import { defaults, omit } from 'lodash'; import React, { useEffect } from 'react'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/public'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { ANOMALY_SEVERITY } from '../../../../../common/ml_constants'; import { createCallApmApi } from '../../../../services/rest/create_call_apm_api'; @@ -61,7 +62,7 @@ export function TransactionDurationAnomalyRuleType(props: Props) { }, { windowSize: 30, - windowUnit: 'm', + windowUnit: TIME_UNITS.MINUTE, anomalySeverityType: ANOMALY_SEVERITY.CRITICAL, environment: ENVIRONMENT_ALL.value, } @@ -101,7 +102,7 @@ export function TransactionDurationAnomalyRuleType(props: Props) { return ( <ApmRuleParamsContainer fields={fields} - defaults={params} + defaultParams={params} setRuleParams={setRuleParams} setRuleProperty={setRuleProperty} /> diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx index e211fea900522..c2423741a4e9e 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx @@ -11,7 +11,10 @@ import { defaults, map, omit } from 'lodash'; import React, { useEffect } from 'react'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ForLastExpression } from '@kbn/triggers-actions-ui-plugin/public'; +import { + ForLastExpression, + TIME_UNITS, +} from '@kbn/triggers-actions-ui-plugin/public'; import { AggregationType } from '../../../../../common/rules/apm_rule_types'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { getDurationFormatter } from '../../../../../common/utils/formatters'; @@ -28,11 +31,7 @@ import { ServiceField, TransactionTypeField, } from '../../utils/fields'; -import { - AlertMetadata, - getIntervalAndTimeRange, - TimeUnit, -} from '../../utils/helper'; +import { AlertMetadata, getIntervalAndTimeRange } from '../../utils/helper'; import { ApmRuleParamsContainer } from '../../ui_components/apm_rule_params_container'; import { PopoverExpression } from '../../ui_components/popover_expression'; @@ -85,7 +84,7 @@ export function TransactionDurationRuleType(props: Props) { aggregationType: AggregationType.Avg, threshold: 1500, windowSize: 5, - windowUnit: 'm', + windowUnit: TIME_UNITS.MINUTE, environment: ENVIRONMENT_ALL.value, } ); @@ -94,7 +93,7 @@ export function TransactionDurationRuleType(props: Props) { (callApmApi) => { const { interval, start, end } = getIntervalAndTimeRange({ windowSize: params.windowSize, - windowUnit: params.windowUnit as TimeUnit, + windowUnit: params.windowUnit, }); if (interval && start && end) { return callApmApi( @@ -200,8 +199,9 @@ export function TransactionDurationRuleType(props: Props) { return ( <ApmRuleParamsContainer + minimumWindowSize={{ value: 5, unit: TIME_UNITS.MINUTE }} chartPreview={chartPreview} - defaults={params} + defaultParams={params} fields={fields} setRuleParams={setRuleParams} setRuleProperty={setRuleProperty} diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx index a17d1f403295a..8836c1229ee95 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx @@ -9,7 +9,10 @@ import { defaults, omit } from 'lodash'; import React, { useEffect } from 'react'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ForLastExpression } from '@kbn/triggers-actions-ui-plugin/public'; +import { + ForLastExpression, + TIME_UNITS, +} from '@kbn/triggers-actions-ui-plugin/public'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { asPercent } from '../../../../../common/utils/formatters'; import { useFetcher } from '../../../../hooks/use_fetcher'; @@ -21,11 +24,7 @@ import { ServiceField, TransactionTypeField, } from '../../utils/fields'; -import { - AlertMetadata, - getIntervalAndTimeRange, - TimeUnit, -} from '../../utils/helper'; +import { AlertMetadata, getIntervalAndTimeRange } from '../../utils/helper'; import { ApmRuleParamsContainer } from '../../ui_components/apm_rule_params_container'; interface RuleParams { @@ -57,7 +56,7 @@ export function TransactionErrorRateRuleType(props: Props) { { threshold: 30, windowSize: 5, - windowUnit: 'm', + windowUnit: TIME_UNITS.MINUTE, environment: ENVIRONMENT_ALL.value, } ); @@ -68,7 +67,7 @@ export function TransactionErrorRateRuleType(props: Props) { (callApmApi) => { const { interval, start, end } = getIntervalAndTimeRange({ windowSize: params.windowSize, - windowUnit: params.windowUnit as TimeUnit, + windowUnit: params.windowUnit, }); if (interval && start && end) { return callApmApi( @@ -142,8 +141,9 @@ export function TransactionErrorRateRuleType(props: Props) { return ( <ApmRuleParamsContainer + minimumWindowSize={{ value: 5, unit: TIME_UNITS.MINUTE }} fields={fields} - defaults={params} + defaultParams={params} setRuleParams={setRuleParams} setRuleProperty={setRuleProperty} chartPreview={chartPreview} diff --git a/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.test.tsx b/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.test.tsx index 65dcc8a534241..d6f05635b86ef 100644 --- a/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.test.tsx +++ b/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.test.tsx @@ -19,7 +19,7 @@ describe('ApmRuleParamsContainer', () => { expect(() => render( <ApmRuleParamsContainer - defaults={{}} + defaultParams={{}} fields={[null]} setRuleParams={() => {}} setRuleProperty={() => {}} diff --git a/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.tsx b/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.tsx index df252658e32c9..1ad348edcf4ac 100644 --- a/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.tsx @@ -5,24 +5,48 @@ * 2.0. */ -import { EuiFlexGrid, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import React, { useEffect } from 'react'; +import { EuiCallOut, EuiFlexGrid, EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import React, { useEffect, useState } from 'react'; +import { i18n } from '@kbn/i18n'; +import moment from 'moment'; +import { + getTimeUnitLabel, + TIME_UNITS, +} from '@kbn/triggers-actions-ui-plugin/public'; + +interface MinimumWindowSize { + value: number; + unit: TIME_UNITS; +} interface Props { setRuleParams: (key: string, value: any) => void; setRuleProperty: (key: string, value: any) => void; - defaults: Record<string, any>; + defaultParams: Record<string, any>; fields: React.ReactNode[]; chartPreview?: React.ReactNode; + minimumWindowSize?: MinimumWindowSize; } export function ApmRuleParamsContainer(props: Props) { - const { fields, setRuleParams, defaults, chartPreview } = props; + const { + fields, + setRuleParams, + defaultParams, + chartPreview, + minimumWindowSize, + } = props; const params: Record<string, any> = { - ...defaults, + ...defaultParams, }; + const showMinimumWindowSizeWarning = useShowMinimumWindowSize({ + windowSize: params.windowSize, + windowUnit: params.windowUnit, + minimumWindowSize, + }); + useEffect(() => { // we only want to run this on mount to set default values Object.keys(params).forEach((key) => { @@ -33,6 +57,10 @@ export function ApmRuleParamsContainer(props: Props) { }, []); return ( <> + {showMinimumWindowSizeWarning && minimumWindowSize && ( + <MinimumWindowSizeWarning minimumWindowSize={minimumWindowSize} /> + )} + <EuiSpacer size="l" /> <EuiFlexGrid gutterSize="l" direction="row" columns={2}> {fields.map((field, index) => ( @@ -41,8 +69,70 @@ export function ApmRuleParamsContainer(props: Props) { </EuiFlexItem> ))} </EuiFlexGrid> + {chartPreview} <EuiSpacer size="m" /> </> ); } + +function MinimumWindowSizeWarning({ + minimumWindowSize, +}: { + minimumWindowSize: MinimumWindowSize; +}) { + const description = i18n.translate( + 'xpack.apm.alertTypes.minimumWindowSize.description', + { + defaultMessage: + 'The recommended minimum value is {sizeValue} {sizeUnit}. This is to ensure that the alert has enough data to evaluate. If you choose a value that is too low, the alert may not fire as expected.', + values: { + sizeValue: minimumWindowSize.value, + sizeUnit: getTimeUnitLabel(minimumWindowSize.unit), + }, + } + ); + + return ( + <EuiCallOut + title={`Please increase "For the last" to at least ${ + minimumWindowSize.value + } ${getTimeUnitLabel(minimumWindowSize.unit)}`} + color="warning" + iconType="alert" + > + <p>{description}</p> + </EuiCallOut> + ); +} + +function useShowMinimumWindowSize({ + windowSize, + windowUnit, + minimumWindowSize, +}: { + windowSize?: number; + windowUnit?: TIME_UNITS; + minimumWindowSize?: MinimumWindowSize; +}) { + const [showMinimumWindowSizeWarning, setShowMinimumWindowSizeWarning] = + useState(false); + + useEffect(() => { + if (windowSize === undefined || minimumWindowSize === undefined) { + return; + } + + const currentWindowSize = moment + .duration(windowSize, windowUnit) + .asMilliseconds(); + const minimumWindowSizeAsMillis = moment + .duration(minimumWindowSize.value, minimumWindowSize.unit) + .asMilliseconds(); + + const shouldShow = currentWindowSize < minimumWindowSizeAsMillis; + setShowMinimumWindowSizeWarning(shouldShow); + }, [windowSize, windowUnit, minimumWindowSize]); + + return showMinimumWindowSizeWarning; +} diff --git a/x-pack/plugins/apm/public/components/alerting/utils/fields.tsx b/x-pack/plugins/apm/public/components/alerting/utils/fields.tsx index 129c36e14102c..3f028c2ead002 100644 --- a/x-pack/plugins/apm/public/components/alerting/utils/fields.tsx +++ b/x-pack/plugins/apm/public/components/alerting/utils/fields.tsx @@ -38,7 +38,9 @@ export function ServiceField({ })} > <SuggestionsSelect - customOptions={allowAll ? [ENVIRONMENT_ALL] : undefined} + customOptions={ + allowAll ? [{ label: allOptionText, value: '' }] : undefined + } customOptionText={i18n.translate( 'xpack.apm.serviceNamesSelectCustomOptionText', { @@ -106,7 +108,7 @@ export function TransactionTypeField({ return ( <PopoverExpression value={currentValue || allOptionText} title={label}> <SuggestionsSelect - customOptions={[ENVIRONMENT_ALL]} + customOptions={[{ label: allOptionText, value: '' }]} customOptionText={i18n.translate( 'xpack.apm.transactionTypesSelectCustomOptionText', { diff --git a/x-pack/plugins/apm/public/components/alerting/utils/helper.ts b/x-pack/plugins/apm/public/components/alerting/utils/helper.ts index 4032c33fa30b7..e5dc2a78b5a1c 100644 --- a/x-pack/plugins/apm/public/components/alerting/utils/helper.ts +++ b/x-pack/plugins/apm/public/components/alerting/utils/helper.ts @@ -4,6 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ + +import { TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/public'; import moment from 'moment'; export interface AlertMetadata { @@ -14,8 +16,6 @@ export interface AlertMetadata { end?: string; } -export type TimeUnit = 's' | 'm' | 'h' | 'd'; - const BUCKET_SIZE = 20; export function getIntervalAndTimeRange({ @@ -23,7 +23,7 @@ export function getIntervalAndTimeRange({ windowUnit, }: { windowSize: number; - windowUnit: TimeUnit; + windowUnit: TIME_UNITS; }) { const end = Date.now(); const start = diff --git a/x-pack/plugins/apm/public/components/app/correlations/use_failed_transactions_correlations.test.tsx b/x-pack/plugins/apm/public/components/app/correlations/use_failed_transactions_correlations.test.tsx index 54d455519329c..00c768fc1abbf 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/use_failed_transactions_correlations.test.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/use_failed_transactions_correlations.test.tsx @@ -108,7 +108,7 @@ function wrapper({ describe('useFailedTransactionsCorrelations', () => { beforeEach(async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); // Running all pending timers and switching to real timers using Jest afterEach(() => { diff --git a/x-pack/plugins/apm/public/components/app/correlations/use_latency_correlations.test.tsx b/x-pack/plugins/apm/public/components/app/correlations/use_latency_correlations.test.tsx index b63327901a028..a09530960589c 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/use_latency_correlations.test.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/use_latency_correlations.test.tsx @@ -102,7 +102,7 @@ function wrapper({ describe('useLatencyCorrelations', () => { beforeEach(async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterEach(() => { jest.useRealTimers(); diff --git a/x-pack/plugins/apm/public/components/app/dependency_detail_operations/dependency_detail_operations_list/index.tsx b/x-pack/plugins/apm/public/components/app/dependency_detail_operations/dependency_detail_operations_list/index.tsx index ecef396bb0c5d..792f3f0aece25 100644 --- a/x-pack/plugins/apm/public/components/app/dependency_detail_operations/dependency_detail_operations_list/index.tsx +++ b/x-pack/plugins/apm/public/components/app/dependency_detail_operations/dependency_detail_operations_list/index.tsx @@ -23,6 +23,7 @@ import { ITableColumn, ManagedTable } from '../../../shared/managed_table'; import { getComparisonEnabled } from '../../../shared/time_comparison/get_comparison_enabled'; import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip'; import { DependencyOperationDetailLink } from '../../dependency_operation_detail_view/dependency_operation_detail_link'; +import { TransactionTab } from '../../transaction_details/waterfall_with_summary/transaction_tabs'; interface OperationStatisticsItem extends SpanMetricGroup { spanName: string; @@ -35,7 +36,14 @@ function OperationLink({ spanName }: { spanName: string }) { <TruncateWithTooltip data-test-subj="apmOperationsListAppLink" text={spanName} - content={<DependencyOperationDetailLink {...query} spanName={spanName} />} + content={ + <DependencyOperationDetailLink + {...query} + spanName={spanName} + detailTab={TransactionTab.timeline} + showCriticalPath={false} + /> + } /> ); } diff --git a/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependency_operation_detail_trace_list.tsx b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependency_operation_detail_trace_list.tsx index da4c603ff283e..4dde4af56ccf3 100644 --- a/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependency_operation_detail_trace_list.tsx +++ b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependency_operation_detail_trace_list.tsx @@ -9,22 +9,28 @@ import { EuiFlexGroup, EuiFlexItem, EuiLink, + EuiRadio, EuiText, EuiTitle, RIGHT_ALIGNMENT, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; +import { useHistory } from 'react-router-dom'; import { ValuesType } from 'utility-types'; import { EventOutcome } from '../../../../common/event_outcome'; import { asMillisecondDuration } from '../../../../common/utils/formatters'; import { useApmParams } from '../../../hooks/use_apm_params'; import { useApmRouter } from '../../../hooks/use_apm_router'; -import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; +import { FetcherResult, FETCH_STATUS } from '../../../hooks/use_fetcher'; import { useTheme } from '../../../hooks/use_theme'; -import { useTimeRange } from '../../../hooks/use_time_range'; import { APIReturnType } from '../../../services/rest/create_call_apm_api'; -import { ITableColumn, ManagedTable } from '../../shared/managed_table'; +import { push } from '../../shared/links/url_helpers'; +import { + ITableColumn, + ManagedTable, + SortFunction, +} from '../../shared/managed_table'; import { ServiceLink } from '../../shared/service_link'; import { TimestampTooltip } from '../../shared/timestamp_tooltip'; @@ -32,15 +38,23 @@ type DependencySpan = ValuesType< APIReturnType<'GET /internal/apm/dependencies/operations/spans'>['spans'] >; -export function DependencyOperationDetailTraceList() { +export function DependencyOperationDetailTraceList({ + spanFetch, + sortFn, +}: { + spanFetch: FetcherResult< + APIReturnType<'GET /internal/apm/dependencies/operations/spans'> + >; + sortFn: SortFunction<DependencySpan>; +}) { const router = useApmRouter(); + const history = useHistory(); + const theme = useTheme(); const { query: { - dependencyName, - spanName, comparisonEnabled, environment, offset, @@ -49,8 +63,11 @@ export function DependencyOperationDetailTraceList() { refreshInterval, refreshPaused, kuery, - sampleRangeFrom, - sampleRangeTo, + sortField = '@timestamp', + sortDirection = 'desc', + pageSize = 10, + page = 1, + spanId, }, } = useApmParams('/dependencies/operation'); @@ -84,6 +101,7 @@ export function DependencyOperationDetailTraceList() { traceId, transactionId, transactionType, + showCriticalPath: false, }, }) : router.link('/link-to/trace/{traceId}', { @@ -99,9 +117,24 @@ export function DependencyOperationDetailTraceList() { return href; } - const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const columns: Array<ITableColumn<DependencySpan>> = [ + { + name: '', + field: 'spanId', + render: (_, { spanId: itemSpanId }) => { + return ( + <EuiRadio + id={itemSpanId} + onChange={(value) => { + push(history, { + query: { spanId: value ? itemSpanId : '' }, + }); + }} + checked={itemSpanId === spanId} + /> + ); + }, + }, { name: i18n.translate( 'xpack.apm.dependencyOperationDetailTraceListOutcomeColumn', @@ -121,38 +154,6 @@ export function DependencyOperationDetailTraceList() { return <EuiBadge color={color}>{outcome}</EuiBadge>; }, }, - { - name: i18n.translate( - 'xpack.apm.dependencyOperationDetailTraceListTraceIdColumn', - { defaultMessage: 'Trace' } - ), - field: 'traceId', - truncateText: true, - render: ( - _, - { - serviceName, - traceId, - transactionId, - transactionName, - transactionType, - } - ) => { - const href = getTraceLink({ - serviceName, - traceId, - transactionId, - transactionType, - transactionName, - }); - - return ( - <EuiLink href={href} style={{ whiteSpace: 'nowrap' }}> - {traceId.substr(0, 6)} - </EuiLink> - ); - }, - }, { name: i18n.translate( 'xpack.apm.dependencyOperationDetailTraceListServiceNameColumn', @@ -190,6 +191,7 @@ export function DependencyOperationDetailTraceList() { ), field: 'transactionName', truncateText: true, + width: '60%', render: ( _, { @@ -239,35 +241,6 @@ export function DependencyOperationDetailTraceList() { }, ]; - const { data = { spans: [] }, status } = useFetcher( - (callApmApi) => { - return callApmApi('GET /internal/apm/dependencies/operations/spans', { - params: { - query: { - dependencyName, - spanName, - start, - end, - environment, - kuery, - sampleRangeFrom, - sampleRangeTo, - }, - }, - }); - }, - [ - dependencyName, - spanName, - start, - end, - environment, - kuery, - sampleRangeFrom, - sampleRangeTo, - ] - ); - return ( <EuiFlexGroup direction="column"> <EuiFlexItem> @@ -281,15 +254,18 @@ export function DependencyOperationDetailTraceList() { </EuiFlexItem> <EuiFlexItem> <ManagedTable + tableLayout="auto" columns={columns} - items={data?.spans} - initialSortField="@timestamp" - initialSortDirection="desc" - initialPageSize={10} + items={spanFetch.data?.spans || []} + initialSortField={sortField} + initialSortDirection={sortDirection} + initialPageSize={pageSize} + initialPageIndex={page} isLoading={ - status === FETCH_STATUS.LOADING || - status === FETCH_STATUS.NOT_INITIATED + spanFetch.status === FETCH_STATUS.LOADING || + spanFetch.status === FETCH_STATUS.NOT_INITIATED } + sortFn={sortFn} /> </EuiFlexItem> </EuiFlexGroup> diff --git a/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependendecy_operation_distribution_chart.tsx b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependency_operation_distribution_chart.tsx similarity index 100% rename from x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependendecy_operation_distribution_chart.tsx rename to x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependency_operation_distribution_chart.tsx diff --git a/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/index.tsx b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/index.tsx index c824a61f019b2..9acd060f5fe68 100644 --- a/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/index.tsx +++ b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/index.tsx @@ -6,25 +6,142 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import React from 'react'; +import { omit, orderBy } from 'lodash'; +import React, { useEffect, useMemo, useRef } from 'react'; +import { useHistory } from 'react-router-dom'; +import type { DependencySpan } from '../../../../server/routes/dependencies/get_top_dependency_spans'; import { ChartPointerEventContextProvider } from '../../../context/chart_pointer_event/chart_pointer_event_context'; import { useApmParams } from '../../../hooks/use_apm_params'; import { useApmRouter } from '../../../hooks/use_apm_router'; import { useDependencyDetailOperationsBreadcrumb } from '../../../hooks/use_dependency_detail_operations_breadcrumb'; +import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; +import { useTimeRange } from '../../../hooks/use_time_range'; import { DependencyMetricCharts } from '../../shared/dependency_metric_charts'; import { DetailViewHeader } from '../../shared/detail_view_header'; -import { DependencyOperationDistributionChart } from './dependendecy_operation_distribution_chart'; +import { ResettingHeightRetainer } from '../../shared/height_retainer/resetting_height_container'; +import { push, replace } from '../../shared/links/url_helpers'; +import { SortFunction } from '../../shared/managed_table'; +import { useWaterfallFetcher } from '../transaction_details/use_waterfall_fetcher'; +import { WaterfallWithSummary } from '../transaction_details/waterfall_with_summary'; import { DependencyOperationDetailTraceList } from './dependency_operation_detail_trace_list'; +import { DependencyOperationDistributionChart } from './dependency_operation_distribution_chart'; +import { maybeRedirectToAvailableSpanSample } from './maybe_redirect_to_available_span_sample'; export function DependencyOperationDetailView() { const router = useApmRouter(); + const history = useHistory(); + const { - query: { spanName, ...query }, + query, + query: { + spanName, + dependencyName, + sampleRangeFrom, + sampleRangeTo, + kuery, + environment, + rangeFrom, + rangeTo, + spanId, + waterfallItemId, + detailTab, + sortField = '@timestamp', + sortDirection = 'desc', + showCriticalPath, + }, } = useApmParams('/dependencies/operation'); useDependencyDetailOperationsBreadcrumb(); + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + + const queryWithoutSpanName = omit(query, 'spanName'); + + const spanFetch = useFetcher( + (callApmApi) => { + return callApmApi('GET /internal/apm/dependencies/operations/spans', { + params: { + query: { + dependencyName, + spanName, + start, + end, + environment, + kuery, + sampleRangeFrom, + sampleRangeTo, + }, + }, + }); + }, + [ + dependencyName, + spanName, + start, + end, + environment, + kuery, + sampleRangeFrom, + sampleRangeTo, + ] + ); + + const getSortedSamples: SortFunction<DependencySpan> = ( + items, + localSortField, + localSortDirection + ) => { + return orderBy(items, localSortField, localSortDirection); + }; + + const samples = useMemo(() => { + return ( + getSortedSamples( + spanFetch.data?.spans ?? [], + sortField, + sortDirection + ).map((span) => ({ + spanId: span.spanId, + traceId: span.traceId, + transactionId: span.transactionId, + })) || [] + ); + }, [spanFetch.data?.spans, sortField, sortDirection]); + + const selectedSample = useMemo(() => { + return samples.find((sample) => sample.spanId === spanId); + }, [samples, spanId]); + + const waterfallFetch = useWaterfallFetcher({ + traceId: selectedSample?.traceId, + transactionId: selectedSample?.transactionId, + start, + end, + }); + + const queryRef = useRef(query); + + queryRef.current = query; + + useEffect(() => { + maybeRedirectToAvailableSpanSample({ + history, + page: queryRef.current.page ?? 0, + pageSize: queryRef.current.pageSize ?? 10, + replace, + samples, + spanFetchStatus: spanFetch.status, + spanId, + }); + }, [samples, spanId, history, queryRef, router, spanFetch.status]); + + const isWaterfallLoading = + spanFetch.status === FETCH_STATUS.NOT_INITIATED || + (spanFetch.status === FETCH_STATUS.LOADING && samples.length === 0) || + waterfallFetch.status === FETCH_STATUS.LOADING || + !waterfallFetch.waterfall.entryWaterfallTransaction; + return ( <EuiFlexGroup direction="column"> <EuiFlexItem> @@ -33,7 +150,9 @@ export function DependencyOperationDetailView() { 'xpack.apm.dependecyOperationDetailView.header.backLinkLabel', { defaultMessage: 'All operations' } )} - backHref={router.link('/dependencies/operations', { query })} + backHref={router.link('/dependencies/operations', { + query: queryWithoutSpanName, + })} title={spanName} /> </EuiFlexItem> @@ -50,7 +169,47 @@ export function DependencyOperationDetailView() { </EuiFlexItem> <EuiFlexItem> <EuiPanel hasBorder> - <DependencyOperationDetailTraceList /> + <DependencyOperationDetailTraceList + spanFetch={spanFetch} + sortFn={getSortedSamples} + /> + </EuiPanel> + </EuiFlexItem> + <EuiFlexItem> + <EuiPanel hasBorder> + <ResettingHeightRetainer reset={!isWaterfallLoading}> + <WaterfallWithSummary + environment={environment} + waterfallFetchResult={waterfallFetch} + traceSamples={samples} + traceSamplesFetchStatus={spanFetch.status} + onSampleClick={(sample) => { + push(history, { query: { spanId: sample.spanId } }); + }} + onTabClick={(tab) => { + push(history, { + query: { + detailTab: tab, + }, + }); + }} + serviceName={ + waterfallFetch.waterfall.entryWaterfallTransaction?.doc.service + .name + } + waterfallItemId={waterfallItemId} + detailTab={detailTab} + selectedSample={selectedSample || null} + showCriticalPath={showCriticalPath} + onShowCriticalPathChange={(nextShowCriticalPath) => { + push(history, { + query: { + showCriticalPath: nextShowCriticalPath ? 'true' : 'false', + }, + }); + }} + /> + </ResettingHeightRetainer> </EuiPanel> </EuiFlexItem> </EuiFlexGroup> diff --git a/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/maybe_redirect_to_available_span_sample.test.ts b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/maybe_redirect_to_available_span_sample.test.ts new file mode 100644 index 0000000000000..a7c2b2b669bf3 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/maybe_redirect_to_available_span_sample.test.ts @@ -0,0 +1,108 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { range } from 'lodash'; +import { maybeRedirectToAvailableSpanSample } from './maybe_redirect_to_available_span_sample'; +import { replace as urlHelpersReplace } from '../../shared/links/url_helpers'; +import { History } from 'history'; +import { FETCH_STATUS } from '../../../hooks/use_fetcher'; + +describe('maybeRedirectToAvailableSpanSample', () => { + const samples: Array<{ + spanId: string; + traceId: string; + transactionId: string; + }> = range(11).map((_, index) => ({ + spanId: (index + 1).toString(), + traceId: '', + transactionId: '', + })); + + let defaultParams: Omit< + Parameters<typeof maybeRedirectToAvailableSpanSample>[0], + 'replace' + > & { replace: jest.MockedFunction<typeof urlHelpersReplace> }; + + beforeEach(() => { + defaultParams = { + samples, + page: 0, + pageSize: 10, + history: { + location: { + search: '', + }, + } as History, + spanFetchStatus: FETCH_STATUS.SUCCESS, + replace: jest.fn(), + }; + }); + + it('does not redirect while loading', () => { + maybeRedirectToAvailableSpanSample({ + ...defaultParams, + spanId: undefined, + spanFetchStatus: FETCH_STATUS.LOADING, + }); + expect(defaultParams.replace).not.toHaveBeenCalled(); + }); + + it('redirects to the first available span if no span is selected', () => { + maybeRedirectToAvailableSpanSample({ + ...defaultParams, + spanId: undefined, + page: 1, + spanFetchStatus: FETCH_STATUS.SUCCESS, + }); + expect(defaultParams.replace).toHaveBeenCalled(); + + expect(defaultParams.replace.mock.calls[0][1].query).toEqual({ + spanId: samples[0].spanId, + page: '0', + }); + }); + + it('redirects to the first available span if the currently selected sample is not found', () => { + maybeRedirectToAvailableSpanSample({ + ...defaultParams, + page: 1, + spanId: '12', + spanFetchStatus: FETCH_STATUS.SUCCESS, + }); + expect(defaultParams.replace).toHaveBeenCalled(); + + expect(defaultParams.replace.mock.calls[0][1].query).toEqual({ + spanId: samples[0].spanId, + page: '0', + }); + }); + + it('does not redirect if the sample is found', () => { + maybeRedirectToAvailableSpanSample({ + ...defaultParams, + page: 0, + spanId: '1', + spanFetchStatus: FETCH_STATUS.SUCCESS, + }); + expect(defaultParams.replace).not.toHaveBeenCalled(); + }); + + it('redirects to the page of the currently selected sample', () => { + maybeRedirectToAvailableSpanSample({ + ...defaultParams, + page: 0, + spanId: '11', + spanFetchStatus: FETCH_STATUS.SUCCESS, + }); + + expect(defaultParams.replace).toHaveBeenCalled(); + + expect(defaultParams.replace.mock.calls[0][1].query).toEqual({ + page: '1', + spanId: '11', + }); + }); +}); diff --git a/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/maybe_redirect_to_available_span_sample.ts b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/maybe_redirect_to_available_span_sample.ts new file mode 100644 index 0000000000000..00ce95a255ea2 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/maybe_redirect_to_available_span_sample.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 { History } from 'history'; +import { FETCH_STATUS } from '../../../hooks/use_fetcher'; +import { replace as urlHelpersReplace } from '../../shared/links/url_helpers'; + +export function maybeRedirectToAvailableSpanSample({ + spanFetchStatus, + spanId, + pageSize, + page, + replace, + samples, + history, +}: { + spanFetchStatus: FETCH_STATUS; + spanId?: string; + pageSize: number; + page: number; + replace: typeof urlHelpersReplace; + history: History; + samples: Array<{ spanId: string; traceId: string; transactionId: string }>; +}) { + if (spanFetchStatus !== FETCH_STATUS.SUCCESS) { + // we're still loading, don't do anything + return; + } + + const nextSpanId = + samples.find((sample) => sample.spanId === spanId)?.spanId || + samples[0]?.spanId || + ''; + + const indexOfNextSample = + samples.findIndex((sample) => sample.spanId === nextSpanId) ?? 0; + + const nextPageIndex = Math.floor((indexOfNextSample + 1) / (pageSize ?? 10)); + + if (page !== nextPageIndex || (spanId ?? '') !== nextSpanId) { + replace(history, { + query: { spanId: nextSpanId, page: nextPageIndex.toString() }, + }); + } +} diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/detail_view/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/detail_view/index.tsx index 220f276f62152..21124629a4063 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/detail_view/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/detail_view/index.tsx @@ -96,9 +96,10 @@ export function DetailView({ errorGroup, urlParams, kuery }: Props) { const method = error.http?.request?.method; const status = error.http?.response?.status_code; - const traceExplorerLink = router.link('/traces/explorer', { + const traceExplorerLink = router.link('/traces/explorer/waterfall', { query: { ...query, + showCriticalPath: false, query: `${ERROR_GROUP_ID}:${groupId}`, type: TraceSearchType.kql, traceId: '', diff --git a/x-pack/plugins/apm/public/components/app/metrics/index.tsx b/x-pack/plugins/apm/public/components/app/metrics/index.tsx index 3149a13b940f8..0463df3778e87 100644 --- a/x-pack/plugins/apm/public/components/app/metrics/index.tsx +++ b/x-pack/plugins/apm/public/components/app/metrics/index.tsx @@ -6,17 +6,30 @@ */ import React from 'react'; -import { isJavaAgentName, isJRubyAgent } from '../../../../common/agent_name'; +import { + isJavaAgentName, + isJRubyAgent, + isServerlessAgent, +} from '../../../../common/agent_name'; import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; +import { ServerlessMetrics } from './serverless_metrics'; import { ServiceMetrics } from './service_metrics'; import { JvmMetricsOverview } from './jvm_metrics_overview'; export function Metrics() { const { agentName, runtimeName } = useApmServiceContext(); + const isServerless = isServerlessAgent(runtimeName); - if (isJavaAgentName(agentName) || isJRubyAgent(agentName, runtimeName)) { + if ( + !isServerless && + (isJavaAgentName(agentName) || isJRubyAgent(agentName, runtimeName)) + ) { return <JvmMetricsOverview />; } + if (isServerless) { + return <ServerlessMetrics />; + } + return <ServiceMetrics />; } diff --git a/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/index.tsx b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/index.tsx new file mode 100644 index 0000000000000..439192503244f --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/index.tsx @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React from 'react'; +import { ServerlessFunctions } from './serverless_functions'; +import { ServerlessSummary } from './serverless_summary'; +import { ServerlessActiveInstances } from './serverless_active_instances'; +import { ServerlessMetricsCharts } from './serverless_metrics_charts'; +import { ChartPointerEventContextProvider } from '../../../../context/chart_pointer_event/chart_pointer_event_context'; + +interface Props { + serverlessId?: string; +} + +export function ServerlessMetrics({ serverlessId }: Props) { + return ( + <EuiFlexGroup direction="column" gutterSize="m"> + <EuiFlexItem> + <ServerlessSummary serverlessId={serverlessId} /> + </EuiFlexItem> + {!serverlessId && ( + <EuiFlexItem> + <ServerlessFunctions /> + </EuiFlexItem> + )} + <ChartPointerEventContextProvider> + <EuiFlexItem> + <ServerlessMetricsCharts serverlessId={serverlessId} /> + </EuiFlexItem> + <EuiFlexItem> + <ServerlessActiveInstances serverlessId={serverlessId} /> + </EuiFlexItem> + </ChartPointerEventContextProvider> + </EuiFlexGroup> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_active_instances.tsx b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_active_instances.tsx new file mode 100644 index 0000000000000..9c44d472c5b70 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_active_instances.tsx @@ -0,0 +1,223 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { + EuiBasicTableColumn, + EuiFlexGroup, + EuiFlexItem, + EuiInMemoryTable, + euiPaletteColorBlind, + EuiPanel, + EuiTitle, + PropertySort, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React, { useMemo } from 'react'; +import { + asDynamicBytes, + asInteger, + asMillisecondDuration, +} from '../../../../../common/utils/formatters'; +import { Coordinate, TimeSeries } from '../../../../../typings/timeseries'; +import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; +import { useApmParams } from '../../../../hooks/use_apm_params'; +import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; +import { useTimeRange } from '../../../../hooks/use_time_range'; +import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; +import { TimeseriesChart } from '../../../shared/charts/timeseries_chart'; +import { ListMetric } from '../../../shared/list_metric'; +import { ServerlessFunctionNameLink } from './serverless_function_name_link'; + +type ServerlessActiveInstances = + APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances'>; + +const palette = euiPaletteColorBlind({ rotations: 2 }); + +interface Props { + serverlessId?: string; +} + +export function ServerlessActiveInstances({ serverlessId }: Props) { + const { + query: { environment, kuery, rangeFrom, rangeTo }, + } = useApmParams('/services/{serviceName}/metrics'); + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + const { serviceName } = useApmServiceContext(); + + const { data = { activeInstances: [], timeseries: [] }, status } = useFetcher( + (callApmApi) => { + if (!start || !end) { + return undefined; + } + return callApmApi( + 'GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances', + { + params: { + path: { + serviceName, + }, + query: { + kuery, + environment, + start, + end, + serverlessId, + }, + }, + } + ); + }, + [kuery, environment, serviceName, start, end, serverlessId] + ); + + const isLoading = status === FETCH_STATUS.LOADING; + + const columns: Array< + EuiBasicTableColumn<ServerlessActiveInstances['activeInstances'][0]> + > = [ + { + field: 'serverlessFunctionName', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.activeInstances.functionName', + { defaultMessage: 'Function name' } + ), + sortable: true, + truncateText: true, + render: (_, item) => { + return ( + <ServerlessFunctionNameLink + serverlessFunctionName={item.serverlessFunctionName} + serverlessId={item.serverlessId} + /> + ); + }, + }, + { + field: 'activeInstanceName', + name: i18n.translate('xpack.apm.serverlessMetrics.activeInstances.name', { + defaultMessage: 'Name', + }), + sortable: true, + }, + { + field: 'serverlessDurationAvg', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.serverlessFunctions.functionDuration', + { defaultMessage: 'Function duration' } + ), + sortable: true, + render: (_, { serverlessDurationAvg, timeseries }) => { + return ( + <ListMetric + isLoading={isLoading} + series={timeseries.serverlessDuration} + color={palette[1]} + valueLabel={asMillisecondDuration(serverlessDurationAvg)} + /> + ); + }, + }, + { + field: 'billedDurationAvg', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.activeInstances.billedDuration', + { defaultMessage: 'Billed duration' } + ), + sortable: true, + render: (_, { billedDurationAvg, timeseries }) => { + return ( + <ListMetric + isLoading={isLoading} + series={timeseries.billedDuration} + color={palette[2]} + valueLabel={asMillisecondDuration(billedDurationAvg)} + /> + ); + }, + }, + { + field: 'avgMemoryUsed', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.activeInstances.memoryUsageAvg', + { defaultMessage: 'Memory usage avg.' } + ), + sortable: true, + render: (_, { avgMemoryUsed }) => { + return asDynamicBytes(avgMemoryUsed); + }, + }, + { + field: 'memorySize', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.activeInstances.memorySize', + { defaultMessage: 'Memory size' } + ), + sortable: true, + render: (_, { memorySize }) => { + return asDynamicBytes(memorySize); + }, + }, + ]; + + const sorting = useMemo( + () => ({ + sort: { + field: 'serverlessDurationAvg', + direction: 'desc', + } as PropertySort, + }), + [] + ); + + const charts: Array<TimeSeries<Coordinate>> = useMemo( + () => [ + { + title: i18n.translate( + 'xpack.apm.serverlessMetrics.activeInstances.title', + { defaultMessage: 'Active instances' } + ), + data: data.timeseries, + type: 'bar', + color: palette[2], + }, + ], + [data.timeseries] + ); + + return ( + <EuiPanel hasBorder={true}> + <EuiFlexGroup direction="column" gutterSize="xs"> + <EuiFlexItem> + <EuiTitle size="xs"> + <h2> + {i18n.translate( + 'xpack.apm.serverlessMetrics.activeInstances.title', + { defaultMessage: 'Active instances' } + )} + </h2> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem> + <TimeseriesChart + timeseries={charts} + id="activeInstances" + fetchStatus={status} + yLabelFormat={asInteger} + /> + </EuiFlexItem> + <EuiFlexItem> + <EuiInMemoryTable + loading={isLoading} + items={data.activeInstances} + columns={columns} + pagination={{ showPerPageOptions: false, pageSize: 5 }} + sorting={sorting} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_function_name_link.tsx b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_function_name_link.tsx new file mode 100644 index 0000000000000..83fb9a5beee32 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_function_name_link.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 { EuiLink } from '@elastic/eui'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import React from 'react'; +import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; +import { useApmParams } from '../../../../hooks/use_apm_params'; +import { useApmRouter } from '../../../../hooks/use_apm_router'; +import { truncate } from '../../../../utils/style'; + +const StyledLink = euiStyled(EuiLink)`${truncate('100%')};`; + +interface Props { + serverlessFunctionName: string; + serverlessId: string; +} + +export function ServerlessFunctionNameLink({ + serverlessFunctionName, + serverlessId, +}: Props) { + const { serviceName } = useApmServiceContext(); + const { query } = useApmParams('/services/{serviceName}/metrics'); + const { link } = useApmRouter(); + return ( + <StyledLink + href={link('/services/{serviceName}/metrics/{id}', { + path: { + serviceName, + id: serverlessId, + }, + query, + })} + > + {serverlessFunctionName} + </StyledLink> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_functions.tsx b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_functions.tsx new file mode 100644 index 0000000000000..11c2f9056b117 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_functions.tsx @@ -0,0 +1,178 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { + EuiBasicTableColumn, + EuiFlexGroup, + EuiFlexItem, + EuiInMemoryTable, + EuiPanel, + EuiTitle, + PropertySort, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React, { useMemo } from 'react'; +import { + asDynamicBytes, + asMillisecondDuration, +} from '../../../../../common/utils/formatters'; +import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; +import { useApmParams } from '../../../../hooks/use_apm_params'; +import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; +import { useTimeRange } from '../../../../hooks/use_time_range'; +import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; +import { ServerlessFunctionNameLink } from './serverless_function_name_link'; + +type ServerlessFunctionOverview = + APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview'>['serverlessFunctionsOverview'][0]; + +export function ServerlessFunctions() { + const { + query: { environment, kuery, rangeFrom, rangeTo }, + } = useApmParams('/services/{serviceName}/metrics'); + + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + const { serviceName } = useApmServiceContext(); + + const { data = { serverlessFunctionsOverview: [] }, status } = useFetcher( + (callApmApi) => { + if (!start || !end) { + return undefined; + } + return callApmApi( + 'GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview', + { + params: { + path: { + serviceName, + }, + query: { + kuery, + environment, + start, + end, + }, + }, + } + ); + }, + [kuery, environment, serviceName, start, end] + ); + + const columns: Array<EuiBasicTableColumn<ServerlessFunctionOverview>> = [ + { + field: 'serverlessFunctionName', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.serverlessFunctions.functionName', + { defaultMessage: 'Function name' } + ), + sortable: true, + truncateText: true, + render: (_, item) => { + return ( + <ServerlessFunctionNameLink + serverlessFunctionName={item.serverlessFunctionName} + serverlessId={item.serverlessId} + /> + ); + }, + }, + { + field: 'serverlessDurationAvg', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.serverlessFunctions.functionDuration', + { defaultMessage: 'Function duration' } + ), + sortable: true, + render: (_, { serverlessDurationAvg }) => { + return asMillisecondDuration(serverlessDurationAvg); + }, + }, + { + field: 'billedDurationAvg', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.serverlessFunctions.billedDuration', + { defaultMessage: 'Billed duration' } + ), + sortable: true, + render: (_, { billedDurationAvg }) => { + return asMillisecondDuration(billedDurationAvg); + }, + }, + { + field: 'avgMemoryUsed', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.serverlessFunctions.memoryUsageAvg', + { defaultMessage: 'Memory usage avg.' } + ), + sortable: true, + render: (_, { avgMemoryUsed }) => { + return asDynamicBytes(avgMemoryUsed); + }, + }, + { + field: 'memorySize', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.serverlessFunctions.memorySize', + { defaultMessage: 'Memory size' } + ), + sortable: true, + render: (_, { memorySize }) => { + return asDynamicBytes(memorySize); + }, + }, + { + field: 'coldStartCount', + name: i18n.translate( + 'xpack.apm.serverlessMetrics.serverlessFunctions.coldStart', + { defaultMessage: 'Cold start' } + ), + sortable: true, + }, + ]; + + const isLoading = status === FETCH_STATUS.LOADING; + + const sorting = useMemo( + () => ({ + sort: { + field: 'serverlessDurationAvg', + direction: 'desc', + } as PropertySort, + }), + [] + ); + + return ( + <EuiPanel hasBorder={true}> + <EuiFlexGroup direction="column"> + <EuiFlexItem> + <EuiFlexGroup alignItems="center"> + <EuiFlexItem grow={false}> + <EuiTitle size="s"> + <h2> + {i18n.translate( + 'xpack.apm.serverlessMetrics.serverlessFunctions.title', + { defaultMessage: 'Lambda functions' } + )} + </h2> + </EuiTitle> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem> + <EuiInMemoryTable + loading={isLoading} + items={data.serverlessFunctionsOverview} + columns={columns} + pagination={{ showPerPageOptions: false, pageSize: 5 }} + sorting={sorting} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_metrics_charts.tsx b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_metrics_charts.tsx new file mode 100644 index 0000000000000..ca5ea070b995c --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_metrics_charts.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 { EuiFlexGrid, EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; +import { isEmpty, keyBy } from 'lodash'; +import React from 'react'; +import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; +import { useApmParams } from '../../../../hooks/use_apm_params'; +import { useFetcher } from '../../../../hooks/use_fetcher'; +import { useTimeRange } from '../../../../hooks/use_time_range'; +import { MetricsChart } from '../../../shared/charts/metrics_chart'; + +interface Props { + serverlessId?: string; +} + +const INITIAL_STATE = { + firstLineCharts: [], + secondLineCharts: [], +}; + +export function ServerlessMetricsCharts({ serverlessId }: Props) { + const { + query: { environment, kuery, rangeFrom, rangeTo }, + } = useApmParams('/services/{serviceName}/metrics'); + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + const { serviceName } = useApmServiceContext(); + + const { data = INITIAL_STATE, status } = useFetcher( + (callApmApi) => { + if (!start || !end) { + return undefined; + } + return callApmApi( + 'GET /internal/apm/services/{serviceName}/metrics/serverless/charts', + { + params: { + path: { + serviceName, + }, + query: { + kuery, + environment, + start, + end, + serverlessId, + }, + }, + } + ).then((resp) => { + const chartsByKey = keyBy(resp.charts, 'key'); + if (isEmpty(chartsByKey)) { + return { firstLineCharts: [], secondLineCharts: [] }; + } + + return { + firstLineCharts: [ + chartsByKey.avg_duration, + chartsByKey.cold_start_duration, + chartsByKey.cold_start_count, + ], + secondLineCharts: [ + chartsByKey.compute_usage, + chartsByKey.memory_usage_chart, + ], + }; + }); + }, + [kuery, environment, serviceName, start, end, serverlessId] + ); + + return ( + <EuiFlexGroup direction="column" gutterSize="m"> + <EuiFlexItem> + <EuiFlexGrid columns={3} gutterSize="m"> + {data.firstLineCharts.map((chart) => ( + <EuiFlexItem key={chart.key}> + <EuiPanel hasBorder={true}> + <MetricsChart + start={start} + end={end} + chart={chart} + fetchStatus={status} + /> + </EuiPanel> + </EuiFlexItem> + ))} + </EuiFlexGrid> + </EuiFlexItem> + <EuiFlexItem> + <EuiFlexGrid columns={2} gutterSize="m"> + {data.secondLineCharts.map((chart) => ( + <EuiFlexItem key={chart.key}> + <EuiPanel hasBorder={true}> + <MetricsChart + start={start} + end={end} + chart={chart} + fetchStatus={status} + /> + </EuiPanel> + </EuiFlexItem> + ))} + </EuiFlexGrid> + </EuiFlexItem> + </EuiFlexGroup> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx new file mode 100644 index 0000000000000..365937c8c48a2 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx @@ -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 { + EuiFlexGroup, + EuiFlexItem, + EuiLink, + EuiPanel, + EuiSpacer, + EuiStat, + EuiTitle, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import styled from 'styled-components'; +import { + asMillisecondDuration, + asPercent, +} from '../../../../../common/utils/formatters'; +import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; +import { useApmParams } from '../../../../hooks/use_apm_params'; +import { useBreakpoints } from '../../../../hooks/use_breakpoints'; +import { useFetcher, FETCH_STATUS } from '../../../../hooks/use_fetcher'; +import { useTimeRange } from '../../../../hooks/use_time_range'; + +interface Props { + serverlessId?: string; +} + +const CentralizedContainer = styled.div` + display: flex; + align-items: center; +`; + +const Border = styled.div` + height: 55px; + border-right: 1px solid ${({ theme }) => theme.eui.euiColorLightShade}; +`; + +function VerticalRule() { + return ( + <CentralizedContainer> + <Border /> + </CentralizedContainer> + ); +} + +export function ServerlessSummary({ serverlessId }: Props) { + const breakpoints = useBreakpoints(); + const { + query: { environment, kuery, rangeFrom, rangeTo }, + } = useApmParams('/services/{serviceName}/metrics'); + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + const { serviceName } = useApmServiceContext(); + + const { data, status } = useFetcher( + (callApmApi) => { + if (!start || !end) { + return undefined; + } + return callApmApi( + 'GET /internal/apm/services/{serviceName}/metrics/serverless/summary', + { + params: { + path: { + serviceName, + }, + query: { + kuery, + environment, + start, + end, + serverlessId, + }, + }, + } + ); + }, + [kuery, environment, serviceName, start, end, serverlessId] + ); + + const showVerticalRule = !breakpoints.isSmall; + const isLoading = status === FETCH_STATUS.LOADING; + + return ( + <EuiPanel hasBorder={true}> + <EuiFlexGroup> + <EuiFlexItem> + <EuiTitle size="xs"> + <h2> + {i18n.translate('xpack.apm.serverlessMetrics.summary.title', { + defaultMessage: 'Summary', + })} + </h2> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiLink href="https://ela.st/feedback-aws-lambda" target="_blank"> + {i18n.translate('xpack.apm.serverlessMetrics.summary.feedback', { + defaultMessage: 'Send feedback', + })} + </EuiLink> + </EuiFlexItem> + </EuiFlexGroup> + <EuiSpacer size="m" /> + <EuiFlexGroup gutterSize="xl"> + <EuiFlexItem grow={false}> + <EuiStat + isLoading={isLoading} + title={data?.serverlessFunctionsTotal} + titleSize="s" + description={i18n.translate( + 'xpack.apm.serverlessMetrics.summary.lambdaFunctions', + { + defaultMessage: + 'Lambda {serverlessFunctionsTotal, plural, one {function} other {functions}}', + values: { + serverlessFunctionsTotal: data?.serverlessFunctionsTotal, + }, + } + )} + reverse + /> + </EuiFlexItem> + {showVerticalRule && <VerticalRule />} + <EuiFlexItem grow={false}> + <EuiStat + isLoading={isLoading} + title={asMillisecondDuration(data?.serverlessDurationAvg)} + titleSize="s" + description={i18n.translate( + 'xpack.apm.serverlessMetrics.summary.functionDurationAvg', + { defaultMessage: 'Function duration avg.' } + )} + reverse + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiStat + isLoading={isLoading} + title={asMillisecondDuration(data?.billedDurationAvg)} + titleSize="s" + description={i18n.translate( + 'xpack.apm.serverlessMetrics.summary.billedDurationAvg', + { defaultMessage: 'Billed duration avg.' } + )} + reverse + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiStat + isLoading={isLoading} + title={asPercent(data?.memoryUsageAvgRate, 1)} + titleSize="s" + description={i18n.translate( + 'xpack.apm.serverlessMetrics.summary.memoryUsageAvg', + { defaultMessage: 'Memory usage avg.' } + )} + reverse + /> + </EuiFlexItem> + {showVerticalRule && <VerticalRule />} + {data?.estimatedCost && ( + <EuiFlexItem grow={false}> + <EuiStat + isLoading={isLoading} + title={`$${data.estimatedCost}`} + titleSize="s" + description={i18n.translate( + 'xpack.apm.serverlessMetrics.summary.estimatedCost', + { defaultMessage: 'Estimated costs avg.' } + )} + reverse + /> + </EuiFlexItem> + )} + </EuiFlexGroup> + </EuiPanel> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/metrics_details/index.tsx b/x-pack/plugins/apm/public/components/app/metrics_details/index.tsx index 4adbb25c26d1e..13082d41f5970 100644 --- a/x-pack/plugins/apm/public/components/app/metrics_details/index.tsx +++ b/x-pack/plugins/apm/public/components/app/metrics_details/index.tsx @@ -5,8 +5,21 @@ * 2.0. */ import React from 'react'; +import { isServerlessAgent } from '../../../../common/agent_name'; +import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; +import { useApmParams } from '../../../hooks/use_apm_params'; +import { ServerlessMetricsDetails } from './serverless_metrics_details'; import { ServiceNodeMetrics } from './service_node_metrics'; export function MetricsDetails() { - return <ServiceNodeMetrics />; + const { + path: { id }, + } = useApmParams('/services/{serviceName}/metrics/{id}'); + const { runtimeName } = useApmServiceContext(); + + if (isServerlessAgent(runtimeName)) { + return <ServerlessMetricsDetails serverlessId={id} />; + } + + return <ServiceNodeMetrics serviceNodeName={id} />; } diff --git a/x-pack/plugins/apm/public/components/app/metrics_details/serverless_metrics_details/index.tsx b/x-pack/plugins/apm/public/components/app/metrics_details/serverless_metrics_details/index.tsx new file mode 100644 index 0000000000000..7b80ed857134d --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/metrics_details/serverless_metrics_details/index.tsx @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React, { useMemo } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; +import { ServerlessMetrics } from '../../metrics/serverless_metrics'; +import { getServerlessFunctionNameFromId } from '../../../../../common/serverless'; +import { useBreadcrumb } from '../../../../context/breadcrumbs/use_breadcrumb'; +import { useApmRouter } from '../../../../hooks/use_apm_router'; +import { useApmParams } from '../../../../hooks/use_apm_params'; + +interface Props { + serverlessId: string; +} + +export function ServerlessMetricsDetails({ serverlessId }: Props) { + const apmRouter = useApmRouter(); + const { path, query } = useApmParams('/services/{serviceName}/metrics/{id}'); + + const serverlessFunctionName = useMemo( + () => getServerlessFunctionNameFromId(serverlessId), + [serverlessId] + ); + + useBreadcrumb( + () => ({ + title: serverlessFunctionName, + href: apmRouter.link('/services/{serviceName}/metrics/{id}', { + path, + query, + }), + }), + [apmRouter, path, query, serverlessFunctionName] + ); + + return ( + <EuiFlexGroup direction="column"> + <EuiFlexItem> + <EuiTitle> + <h2>{serverlessFunctionName}</h2> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem> + <ServerlessMetrics serverlessId={serverlessId} /> + </EuiFlexItem> + </EuiFlexGroup> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/metrics_details/service_node_metrics/index.test.tsx b/x-pack/plugins/apm/public/components/app/metrics_details/service_node_metrics/index.test.tsx index 9356cab2d1f9c..e8deea04a71e0 100644 --- a/x-pack/plugins/apm/public/components/app/metrics_details/service_node_metrics/index.test.tsx +++ b/x-pack/plugins/apm/public/components/app/metrics_details/service_node_metrics/index.test.tsx @@ -16,7 +16,7 @@ describe('ServiceNodeMetrics', () => { expect(() => shallow( <MockApmPluginContextWrapper> - <ServiceNodeMetrics /> + <ServiceNodeMetrics serviceNodeName="foo" /> </MockApmPluginContextWrapper> ) ).not.toThrowError(); diff --git a/x-pack/plugins/apm/public/components/app/metrics_details/service_node_metrics/index.tsx b/x-pack/plugins/apm/public/components/app/metrics_details/service_node_metrics/index.tsx index cc0703c036780..4a6dd62b46e7c 100644 --- a/x-pack/plugins/apm/public/components/app/metrics_details/service_node_metrics/index.tsx +++ b/x-pack/plugins/apm/public/components/app/metrics_details/service_node_metrics/index.tsx @@ -46,15 +46,16 @@ const Truncate = euiStyled.span` ${truncate(unit * 12)} `; -export function ServiceNodeMetrics() { +interface Props { + serviceNodeName: string; +} + +export function ServiceNodeMetrics({ serviceNodeName }: Props) { const { agentName, serviceName } = useApmServiceContext(); const apmRouter = useApmRouter(); - const { - path: { id: serviceNodeName }, - query, - } = useApmParams('/services/{serviceName}/metrics/{id}'); + const { query } = useApmParams('/services/{serviceName}/metrics/{id}'); const { environment, kuery, rangeFrom, rangeTo } = query; @@ -92,13 +93,14 @@ export function ServiceNodeMetrics() { kuery, start, end, + environment, }, }, } ); } }, - [kuery, serviceName, serviceNodeName, start, end] + [kuery, serviceName, serviceNodeName, start, end, environment] ); const { docLinks } = useApmPluginContext().core; diff --git a/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/create_button.tsx b/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/create_button.tsx index cd1b819ce114e..6c872423d577a 100644 --- a/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/create_button.tsx +++ b/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/create_button.tsx @@ -7,42 +7,42 @@ import { EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { ServiceGroupsTour } from '../service_groups_tour'; -import { useServiceGroupsTour } from '../use_service_groups_tour'; +// import { ServiceGroupsTour } from '../service_groups_tour'; +// import { useServiceGroupsTour } from '../use_service_groups_tour'; interface Props { onClick: () => void; } export function CreateButton({ onClick }: Props) { - const { tourEnabled, dismissTour } = useServiceGroupsTour('createGroup'); + // const { tourEnabled, dismissTour } = useServiceGroupsTour('createGroup'); return ( - <ServiceGroupsTour - tourEnabled={tourEnabled} - dismissTour={dismissTour} - title={i18n.translate('xpack.apm.serviceGroups.tour.createGroups.title', { - defaultMessage: 'Introducing service groups', - })} - content={i18n.translate( - 'xpack.apm.serviceGroups.tour.createGroups.content', - { - defaultMessage: - 'Group services together to build curated inventory views that remove noise and simplify investigations across services. Groups are Kibana space-specific and available for any users with appropriate access.', - } - )} + // <ServiceGroupsTour + // tourEnabled={tourEnabled} + // dismissTour={dismissTour} + // title={i18n.translate('xpack.apm.serviceGroups.tour.createGroups.title', { + // defaultMessage: 'Introducing service groups', + // })} + // content={i18n.translate( + // 'xpack.apm.serviceGroups.tour.createGroups.content', + // { + // defaultMessage: + // 'Group services together to build curated inventory views that remove noise and simplify investigations across services. Groups are Kibana space-specific and available for any users with appropriate access.', + // } + // )} + // > + <EuiButton + iconType="plusInCircle" + data-test-subj="apmCreateServiceGroupButton" + onClick={() => { + // dismissTour(); + onClick(); + }} > - <EuiButton - iconType="plusInCircle" - data-test-subj="apmCreateServiceGroupButton" - onClick={() => { - dismissTour(); - onClick(); - }} - > - {i18n.translate('xpack.apm.serviceGroups.createGroupLabel', { - defaultMessage: 'Create group', - })} - </EuiButton> - </ServiceGroupsTour> + {i18n.translate('xpack.apm.serviceGroups.createGroupLabel', { + defaultMessage: 'Create group', + })} + </EuiButton> + // </ServiceGroupsTour> ); } diff --git a/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/select_services.tsx b/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/select_services.tsx index 7a97583bbd4ae..96b0b47a38a1b 100644 --- a/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/select_services.tsx +++ b/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/select_services.tsx @@ -27,6 +27,10 @@ import { KueryBar } from '../../../shared/kuery_bar'; import { ServiceListPreview } from './service_list_preview'; import type { StagedServiceGroup } from './save_modal'; import { getDateRange } from '../../../../context/url_params_context/helpers'; +import { + validateServiceGroupKuery, + isSupportedField, +} from '../../../../../common/service_groups'; const CentralizedContainer = styled.div` display: flex; @@ -39,13 +43,6 @@ const MAX_CONTAINER_HEIGHT = 600; const MODAL_HEADER_HEIGHT = 180; const MODAL_FOOTER_HEIGHT = 80; -const suggestedFieldsWhitelist = [ - 'agent.name', - 'service.name', - 'service.language.name', - 'service.environment', -]; - const Container = styled.div` width: 600px; height: ${MAX_CONTAINER_HEIGHT}px; @@ -70,6 +67,9 @@ export function SelectServices({ }: Props) { const [kuery, setKuery] = useState(serviceGroup?.kuery || ''); const [stagedKuery, setStagedKuery] = useState(serviceGroup?.kuery || ''); + const [kueryValidationMessage, setKueryValidationMessage] = useState< + string | undefined + >(); useEffect(() => { if (isEdit) { @@ -78,6 +78,14 @@ export function SelectServices({ } }, [isEdit, serviceGroup.kuery]); + useEffect(() => { + if (!stagedKuery) { + return; + } + const { message } = validateServiceGroupKuery(stagedKuery); + setKueryValidationMessage(message); + }, [stagedKuery]); + const { start, end } = useMemo( () => getDateRange({ @@ -122,6 +130,11 @@ export function SelectServices({ } )} </EuiText> + {kueryValidationMessage && ( + <EuiText color="danger" size="s"> + {kueryValidationMessage} + </EuiText> + )} <EuiFlexGroup gutterSize="s"> <EuiFlexItem> <KueryBar @@ -144,10 +157,7 @@ export function SelectServices({ }, } = querySuggestion; - return ( - fieldName.startsWith('label') || - suggestedFieldsWhitelist.includes(fieldName) - ); + return isSupportedField(fieldName); } return true; }} diff --git a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_button_group.tsx b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_button_group.tsx new file mode 100644 index 0000000000000..09a26dd150116 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_button_group.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 { EuiButtonGroup } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { useHistory } from 'react-router-dom'; +import { ServiceGroupsTour } from './service_groups_tour'; +import { useServiceGroupsTour } from './use_service_groups_tour'; + +const buttonGroupOptions = { + allServices: { + option: { + id: 'allServices', + label: i18n.translate('xpack.apm.serviceGroups.buttonGroup.allServices', { + defaultMessage: 'All services', + }), + }, + pathname: '/services', + }, + serviceGroups: { + option: { + id: 'serviceGroups', + label: i18n.translate( + 'xpack.apm.serviceGroups.buttonGroup.serviceGroups', + { defaultMessage: 'Service groups' } + ), + }, + pathname: '/service-groups', + }, +}; + +type SelectedNavButton = keyof typeof buttonGroupOptions; + +export function ServiceGroupsButtonGroup({ + selectedNavButton, +}: { + selectedNavButton: SelectedNavButton; +}) { + const history = useHistory(); + const { tourEnabled, dismissTour } = useServiceGroupsTour('createGroup'); + return ( + <ServiceGroupsTour + tourEnabled={tourEnabled} + dismissTour={dismissTour} + anchorPosition="leftUp" + title={i18n.translate('xpack.apm.serviceGroups.tour.createGroups.title', { + defaultMessage: 'Introducing service groups', + })} + content={i18n.translate( + 'xpack.apm.serviceGroups.tour.createGroups.content', + { + defaultMessage: + 'Group services together to build curated inventory views that remove noise and simplify investigations across services. Groups are Kibana space-specific and available for any users with appropriate access.', + } + )} + > + <EuiButtonGroup + color="primary" + options={[ + buttonGroupOptions.allServices.option, + buttonGroupOptions.serviceGroups.option, + ]} + idSelected={selectedNavButton as string} + onChange={(id) => { + const { pathname } = buttonGroupOptions[id as SelectedNavButton]; + history.push({ pathname }); + }} + legend={i18n.translate('xpack.apm.servicesGroups.buttonGroup.legend', { + defaultMessage: 'View all services or service groups', + })} + /> + </ServiceGroupsTour> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/index.tsx b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/index.tsx index 734298dabe9eb..2ee0224acda13 100644 --- a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/index.tsx @@ -12,6 +12,7 @@ import { EuiFlexItem, EuiFormControlLayout, EuiText, + EuiLink, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { isEmpty, sortBy } from 'lodash'; @@ -21,6 +22,8 @@ import { ServiceGroupsListItems } from './service_groups_list'; import { Sort } from './sort'; import { RefreshServiceGroupsSubscriber } from '../refresh_service_groups_subscriber'; import { getDateRange } from '../../../../context/url_params_context/helpers'; +import { ServiceGroupSaveButton } from '../service_group_save'; +import { BetaBadge } from '../../../shared/beta_badge'; export type ServiceGroupsSortType = 'recently_added' | 'alphabetical'; @@ -39,33 +42,24 @@ export function ServiceGroupsList() { [] ); + const { serviceGroups } = data; + const { start, end } = useMemo( - () => - getDateRange({ - rangeFrom: 'now-24h', - rangeTo: 'now', - }), + () => getDateRange({ rangeFrom: 'now-24h', rangeTo: 'now' }), [] ); const { data: servicesCountData = { servicesCounts: {} } } = useFetcher( (callApmApi) => { - if (start && end) { + if (start && end && serviceGroups.length) { return callApmApi('GET /internal/apm/service_groups/services_count', { - params: { - query: { - start, - end, - }, - }, + params: { query: { start, end } }, }); } }, - [start, end] + [start, end, serviceGroups.length] ); - const { serviceGroups } = data; - const isLoading = status === FETCH_STATUS.NOT_INITIATED || status === FETCH_STATUS.LOADING; @@ -91,7 +85,6 @@ export function ServiceGroupsList() { }, []); if (isLoading) { - // return null; return ( <EuiEmptyPrompt icon={<EuiLoadingLogo logo="logoObservability" size="xl" />} @@ -127,9 +120,7 @@ export function ServiceGroupsList() { onChange={(e) => setFilter(e.target.value)} placeholder={i18n.translate( 'xpack.apm.servicesGroups.filter', - { - defaultMessage: 'Filter groups', - } + { defaultMessage: 'Filter groups' } )} /> </EuiFormControlLayout> @@ -145,51 +136,118 @@ export function ServiceGroupsList() { <EuiFlexItem> <EuiFlexGroup direction="column" gutterSize="m"> <EuiFlexItem> - <EuiFlexGroup gutterSize="s"> + <EuiFlexGroup direction="row" gutterSize="m"> + {serviceGroups.length ? ( + <> + <EuiFlexItem grow={1}> + <EuiFlexGroup gutterSize="s"> + <EuiFlexItem grow={false}> + <EuiText style={{ fontWeight: 'bold' }} size="s"> + {i18n.translate( + 'xpack.apm.serviceGroups.groupsCount', + { + defaultMessage: + '{servicesCount} {servicesCount, plural, =0 {groups} one {group} other {groups}}', + values: { servicesCount: filteredItems.length }, + } + )} + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> + <EuiText color="subdued" size="s"> + {i18n.translate( + 'xpack.apm.serviceGroups.listDescription', + { + defaultMessage: + 'Displayed service counts reflect the last 24 hours.', + } + )} + </EuiText> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <ServiceGroupSaveButton /> + </EuiFlexItem> + </> + ) : null} + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem> + <EuiFlexGroup + alignItems="center" + justifyContent="flexStart" + gutterSize="s" + > + <EuiFlexItem grow={false}> + <div> + <BetaBadge /> + </div> + </EuiFlexItem> <EuiFlexItem grow={false}> - <EuiText style={{ fontWeight: 'bold' }} size="s"> - {i18n.translate('xpack.apm.serviceGroups.groupsCount', { - defaultMessage: - '{servicesCount} {servicesCount, plural, =0 {group} one {group} other {groups}}', - values: { servicesCount: filteredItems.length + 1 }, - })} - </EuiText> + <EuiLink + href="https://ela.st/feedback-service-groups" + target="_blank" + > + {i18n.translate( + 'xpack.apm.serviceGroups.beta.feedback.link', + { defaultMessage: 'Send feedback' } + )} + </EuiLink> </EuiFlexItem> </EuiFlexGroup> - <EuiText color="subdued" size="s"> - {i18n.translate('xpack.apm.serviceGroups.listDescription', { - defaultMessage: - 'Displayed service counts reflect the last 24 hours.', - })} - </EuiText> </EuiFlexItem> <EuiFlexItem> - {items.length ? ( - <ServiceGroupsListItems - items={items} - servicesCounts={servicesCountData.servicesCounts} - isLoading={isLoading} - /> + {serviceGroups.length ? ( + items.length ? ( + <ServiceGroupsListItems + items={items} + servicesCounts={servicesCountData.servicesCounts} + isLoading={isLoading} + /> + ) : ( + <EuiEmptyPrompt + iconType="layers" + iconColor="black" + title={ + <h2> + {i18n.translate( + 'xpack.apm.serviceGroups.filtered.emptyPrompt.serviceGroups', + { defaultMessage: 'Service groups' } + )} + </h2> + } + body={ + <p> + {i18n.translate( + 'xpack.apm.serviceGroups.filtered.emptyPrompt.message', + { defaultMessage: 'No groups found for this filter' } + )} + </p> + } + /> + ) ) : ( <EuiEmptyPrompt - iconType="layers" - iconColor="black" + iconType="addDataApp" title={ <h2> {i18n.translate( - 'xpack.apm.serviceGroups.emptyPrompt.serviceGroups', - { defaultMessage: 'Service groups' } + 'xpack.apm.serviceGroups.data.emptyPrompt.noServiceGroups', + { defaultMessage: 'No service groups' } )} </h2> } body={ <p> {i18n.translate( - 'xpack.apm.serviceGroups.emptyPrompt.message', - { defaultMessage: 'No groups found for this filter' } + 'xpack.apm.serviceGroups.data.emptyPrompt.message', + { + defaultMessage: + 'Start grouping and organising your services and your application. Learn more about Service groups or create a group.', + } )} </p> } + actions={<ServiceGroupSaveButton />} /> )} </EuiFlexItem> diff --git a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/service_group_card.tsx b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/service_group_card.tsx index 96d6f381ebe14..bc8a424c922b9 100644 --- a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/service_group_card.tsx +++ b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/service_group_card.tsx @@ -18,15 +18,12 @@ import { ServiceGroup, SERVICE_GROUP_COLOR_DEFAULT, } from '../../../../../common/service_groups'; -import { ServiceGroupsTour } from '../service_groups_tour'; -import { useServiceGroupsTour } from '../use_service_groups_tour'; interface Props { serviceGroup: ServiceGroup; hideServiceCount?: boolean; onClick?: () => void; href?: string; - withTour?: boolean; servicesCount?: number; } @@ -35,11 +32,8 @@ export function ServiceGroupsCard({ hideServiceCount = false, onClick, href, - withTour, servicesCount, }: Props) { - const { tourEnabled, dismissTour } = useServiceGroupsTour('serviceGroupCard'); - const cardProps: EuiCardProps = { style: { width: 286 }, icon: ( @@ -81,45 +75,10 @@ export function ServiceGroupsCard({ )} </EuiFlexGroup> ), - onClick: () => { - dismissTour(); - if (onClick) { - onClick(); - } - }, + onClick, href, }; - if (withTour) { - return ( - <EuiFlexItem key={serviceGroup.groupName}> - <EuiCard - layout="vertical" - {...cardProps} - description={ - <ServiceGroupsTour - tourEnabled={tourEnabled} - dismissTour={dismissTour} - title={i18n.translate( - 'xpack.apm.serviceGroups.tour.serviceGroups.title', - { defaultMessage: 'All services group' } - )} - content={i18n.translate( - 'xpack.apm.serviceGroups.tour.serviceGroups.content', - { - defaultMessage: - "Now that you've created a service group, your All services inventory has moved here. This group cannot be edited or removed.", - } - )} - > - <>{cardProps.description}</> - </ServiceGroupsTour> - } - /> - </EuiFlexItem> - ); - } - return ( <EuiFlexItem key={serviceGroup.groupName}> <EuiCard layout="vertical" {...cardProps} /> diff --git a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/service_groups_list.tsx b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/service_groups_list.tsx index 000759cc92021..64935927b9363 100644 --- a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/service_groups_list.tsx +++ b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_list/service_groups_list.tsx @@ -5,11 +5,9 @@ * 2.0. */ import { EuiFlexGrid } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; import React from 'react'; import { SavedServiceGroup } from '../../../../../common/service_groups'; import { ServiceGroupsCard } from './service_group_card'; -import { SERVICE_GROUP_COLOR_DEFAULT } from '../../../../../common/service_groups'; import { useApmRouter } from '../../../../hooks/use_apm_router'; import { useApmParams } from '../../../../hooks/use_apm_params'; import { useDefaultEnvironment } from '../../../../hooks/use_default_environment'; @@ -42,30 +40,6 @@ export function ServiceGroupsListItems({ items, servicesCounts }: Props) { })} /> ))} - <ServiceGroupsCard - withTour - serviceGroup={{ - groupName: i18n.translate( - 'xpack.apm.serviceGroups.list.allServices.name', - { defaultMessage: 'All services' } - ), - kuery: 'service.name : *', - description: i18n.translate( - 'xpack.apm.serviceGroups.list.allServices.description', - { defaultMessage: 'View all services' } - ), - color: SERVICE_GROUP_COLOR_DEFAULT, - }} - hideServiceCount - href={router.link('/services', { - query: { - ...query, - serviceGroup: '', - environment, - kuery: '', - }, - })} - /> </EuiFlexGrid> ); } diff --git a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_tour.tsx b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_tour.tsx index 0d4f825caefe3..4f7a457be49b4 100644 --- a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_tour.tsx +++ b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_tour.tsx @@ -5,19 +5,26 @@ * 2.0. */ -import { EuiButtonEmpty, EuiSpacer, EuiText, EuiTourStep } from '@elastic/eui'; +import { + EuiButtonEmpty, + EuiSpacer, + EuiText, + EuiTourStep, + PopoverAnchorPosition, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { ElasticDocsLink } from '../../shared/links/elastic_docs_link'; -export type TourType = 'createGroup' | 'editGroup' | 'serviceGroupCard'; +export type TourType = 'createGroup' | 'editGroup'; interface Props { title: string; content: string; tourEnabled: boolean; dismissTour: () => void; + anchorPosition?: PopoverAnchorPosition; children: React.ReactElement; } @@ -26,6 +33,7 @@ export function ServiceGroupsTour({ dismissTour, title, content, + anchorPosition, children, }: Props) { return ( @@ -46,9 +54,7 @@ export function ServiceGroupsTour({ > {i18n.translate( 'xpack.apm.serviceGroups.tour.content.link.docs', - { - defaultMessage: 'docs', - } + { defaultMessage: 'docs' } )} </ElasticDocsLink> ), @@ -63,7 +69,7 @@ export function ServiceGroupsTour({ step={1} stepsTotal={1} title={title} - anchorPosition="leftUp" + anchorPosition={anchorPosition} footerAction={ <EuiButtonEmpty color="text" size="xs" onClick={dismissTour}> {i18n.translate('xpack.apm.serviceGroups.tour.dismiss', { diff --git a/x-pack/plugins/apm/public/components/app/service_groups/use_service_groups_tour.tsx b/x-pack/plugins/apm/public/components/app/service_groups/use_service_groups_tour.tsx index ba27b0e2640e8..400a88a026e01 100644 --- a/x-pack/plugins/apm/public/components/app/service_groups/use_service_groups_tour.tsx +++ b/x-pack/plugins/apm/public/components/app/service_groups/use_service_groups_tour.tsx @@ -11,7 +11,6 @@ import { TourType } from './service_groups_tour'; const INITIAL_STATE: Record<TourType, boolean> = { createGroup: true, editGroup: true, - serviceGroupCard: true, }; export function useServiceGroupsTour(type: TourType) { diff --git a/x-pack/plugins/apm/public/components/app/service_map/popover/edge_contents.tsx b/x-pack/plugins/apm/public/components/app/service_map/popover/edge_contents.tsx index 4bcc8bb8ca53b..8f5b7e9acce39 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/popover/edge_contents.tsx +++ b/x-pack/plugins/apm/public/components/app/service_map/popover/edge_contents.tsx @@ -49,7 +49,7 @@ export function EdgeContents({ elementData }: ContentsProps) { ` [ span where service.name == "${sourceService}" and span.destination.service.resource == "${edgeData.targetData[SPAN_DESTINATION_SERVICE_RESOURCE]}" ]`; } - const url = apmRouter.link('/traces/explorer', { + const url = apmRouter.link('/traces/explorer/waterfall', { query: { ...query, type: TraceSearchType.eql, @@ -58,6 +58,7 @@ export function EdgeContents({ elementData }: ContentsProps) { traceId: '', transactionId: '', detailTab: TransactionTab.timeline, + showCriticalPath: false, }, }); diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/filters/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/filters/index.tsx new file mode 100644 index 0000000000000..22a1544d2013f --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/filters/index.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 { EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui'; +import React from 'react'; +import { useHistory } from 'react-router-dom'; +import { Environment } from '../../../../../../common/environment_rt'; +import { useApmServiceContext } from '../../../../../context/apm_service/use_apm_service_context'; +import { useFetcher } from '../../../../../hooks/use_fetcher'; +import type { APIReturnType } from '../../../../../services/rest/create_call_apm_api'; +import { push } from '../../../../shared/links/url_helpers'; + +type MobileFilter = + APIReturnType<'GET /internal/apm/services/{serviceName}/mobile/filters'>['mobileFilters'][0]; + +interface Props { + end: string; + environment: Environment; + transactionType?: string; + kuery: string; + start: string; + filters: Record<MobileFilter['key'], string | undefined>; +} + +const ALL_OPTION = { + value: 'all', + text: 'All', +}; + +export function MobileFilters({ + end, + environment, + transactionType, + kuery, + start, + filters, +}: Props) { + const history = useHistory(); + const { serviceName } = useApmServiceContext(); + const { data = { mobileFilters: [] } } = useFetcher( + (callApmApi) => { + return callApmApi( + 'GET /internal/apm/services/{serviceName}/mobile/filters', + { + params: { + path: { serviceName }, + query: { end, environment, kuery, start, transactionType }, + }, + } + ); + }, + [end, environment, kuery, serviceName, start, transactionType] + ); + + function toSelectOptions(items?: string[]) { + return [ + ALL_OPTION, + ...(items?.map((item) => ({ value: item, text: item })) || []), + ]; + } + + function onChangeFilter(key: MobileFilter['key'], value: string) { + push(history, { + query: { [key]: value === ALL_OPTION.value ? '' : value }, + }); + } + + return ( + <EuiFlexGroup justifyContent="flexEnd"> + {data.mobileFilters.map((filter) => { + return ( + <EuiFlexItem grow={false} key={filter.key}> + <EuiSelect + prepend={filter.label} + options={toSelectOptions(filter.options)} + value={filters[filter.key]} + onChange={(e) => { + onChangeFilter(filter.key, e.target.value); + }} + /> + </EuiFlexItem> + ); + })} + </EuiFlexGroup> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.test.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.test.tsx new file mode 100644 index 0000000000000..9718bb2afc370 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.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 { render } from '@testing-library/react'; +import React from 'react'; +import { EmbeddedMap } from './embedded_map'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { embeddablePluginMock } from '@kbn/embeddable-plugin/public/mocks'; +import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context'; +import { MemoryRouter } from 'react-router-dom'; + +describe('Embedded Map', () => { + it('it renders', async () => { + const mockSetLayerList = jest.fn(); + const mockUpdateInput = jest.fn(); + const mockRender = jest.fn(); + + const mockEmbeddable = embeddablePluginMock.createStartContract(); + mockEmbeddable.getEmbeddableFactory = jest.fn().mockImplementation(() => ({ + create: () => ({ + setLayerList: mockSetLayerList, + updateInput: mockUpdateInput, + render: mockRender, + }), + })); + + const { findByTestId } = render( + <MemoryRouter + initialEntries={[ + '/services/{serviceName}/overview?rangeFrom=now-15m&rangeTo=now&', + ]} + > + <MockApmPluginContextWrapper> + <KibanaContextProvider services={{ embeddable: mockEmbeddable }}> + <EmbeddedMap filters={[]} /> + </KibanaContextProvider> + </MockApmPluginContextWrapper> + </MemoryRouter> + ); + expect( + await findByTestId('serviceOverviewEmbeddedMap') + ).toBeInTheDocument(); + + expect(mockSetLayerList).toHaveBeenCalledTimes(1); + expect(mockUpdateInput).toHaveBeenCalledTimes(1); + expect(mockRender).toHaveBeenCalledTimes(1); + }); +}); diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.tsx new file mode 100644 index 0000000000000..8e30430a6e21d --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.tsx @@ -0,0 +1,173 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect, useState, useRef } from 'react'; +import uuid from 'uuid'; +import { + MapEmbeddable, + MapEmbeddableInput, + MapEmbeddableOutput, +} from '@kbn/maps-plugin/public'; +import { MAP_SAVED_OBJECT_TYPE } from '@kbn/maps-plugin/common'; +import { + ErrorEmbeddable, + ViewMode, + isErrorEmbeddable, +} from '@kbn/embeddable-plugin/public'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { css } from '@emotion/react'; +import { i18n } from '@kbn/i18n'; +import { EuiText } from '@elastic/eui'; +import type { Filter } from '@kbn/es-query'; +import { ApmPluginStartDeps } from '../../../../../plugin'; +import { getLayerList } from './get_layer_list'; +import { useApmParams } from '../../../../../hooks/use_apm_params'; +import { useTimeRange } from '../../../../../hooks/use_time_range'; + +function EmbeddedMapComponent({ filters }: { filters: Filter[] }) { + const { + query: { rangeFrom, rangeTo, kuery }, + } = useApmParams('/services/{serviceName}/overview'); + + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + const [error, setError] = useState<boolean>(); + + const [embeddable, setEmbeddable] = useState< + MapEmbeddable | ErrorEmbeddable | undefined + >(); + + const embeddableRoot: React.RefObject<HTMLDivElement> = + useRef<HTMLDivElement>(null); + + const { + embeddable: embeddablePlugin, + maps, + notifications, + } = useKibana<ApmPluginStartDeps>().services; + + useEffect(() => { + async function setupEmbeddable() { + const factory = embeddablePlugin?.getEmbeddableFactory< + MapEmbeddableInput, + MapEmbeddableOutput, + MapEmbeddable + >(MAP_SAVED_OBJECT_TYPE); + + if (!factory) { + setError(true); + notifications?.toasts.addDanger({ + title: i18n.translate( + 'xpack.apm.serviceOverview.embeddedMap.error.toastTitle', + { + defaultMessage: 'An error occurred when adding map embeddable', + } + ), + text: i18n.translate( + 'xpack.apm.serviceOverview.embeddedMap.error.toastDescription', + { + defaultMessage: `Embeddable factory with id "{embeddableFactoryId}" was not found.`, + values: { + embeddableFactoryId: MAP_SAVED_OBJECT_TYPE, + }, + } + ), + }); + return; + } + + const input: MapEmbeddableInput = { + attributes: { title: '' }, + id: uuid.v4(), + title: i18n.translate( + 'xpack.apm.serviceOverview.embeddedMap.input.title', + { + defaultMessage: 'Latency by country', + } + ), + filters, + viewMode: ViewMode.VIEW, + isLayerTOCOpen: false, + query: { + query: kuery, + language: 'kuery', + }, + timeRange: { + from: start, + to: end, + }, + hideFilterActions: true, + }; + + const embeddableObject = await factory.create(input); + if (embeddableObject && !isErrorEmbeddable(embeddableObject)) { + const layerList = await getLayerList(maps); + await embeddableObject.setLayerList(layerList); + } + + setEmbeddable(embeddableObject); + } + + setupEmbeddable(); + // Set up exactly once after the component mounts + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + // We can only render after embeddable has already initialized + useEffect(() => { + if (embeddableRoot.current && embeddable) { + embeddable.render(embeddableRoot.current); + } + }, [embeddable, embeddableRoot]); + + useEffect(() => { + if (embeddable) { + embeddable.updateInput({ + filters, + query: { + query: kuery, + language: 'kuery', + }, + timeRange: { + from: start, + to: end, + }, + }); + } + }, [start, end, kuery, filters, embeddable]); + + return ( + <> + {error && ( + <EuiText size="s"> + <p> + {i18n.translate('xpack.apm.serviceOverview.embeddedMap.error', { + defaultMessage: 'Could not load map', + })} + </p> + </EuiText> + )} + {!error && ( + <div + data-test-subj="serviceOverviewEmbeddedMap" + css={css` + width: 100%; + height: 400px; + display: flex; + flex: 1 1 100%; + z-index: 1; + min-height: 0; + `} + ref={embeddableRoot} + /> + )} + </> + ); +} + +EmbeddedMapComponent.displayName = 'EmbeddedMap'; + +export const EmbeddedMap = React.memo(EmbeddedMapComponent); diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/get_layer_list.ts b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/get_layer_list.ts new file mode 100644 index 0000000000000..49bf9fdbe2656 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/get_layer_list.ts @@ -0,0 +1,151 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + EMSFileSourceDescriptor, + LayerDescriptor as BaseLayerDescriptor, + VectorLayerDescriptor as BaseVectorLayerDescriptor, + VectorStyleDescriptor, + AGG_TYPE, + COLOR_MAP_TYPE, + FIELD_ORIGIN, + LABEL_BORDER_SIZES, + LAYER_TYPE, + SOURCE_TYPES, + STYLE_TYPE, + SYMBOLIZE_AS_TYPES, +} from '@kbn/maps-plugin/common'; +import uuid from 'uuid'; +import type { MapsStartApi } from '@kbn/maps-plugin/public'; +import { i18n } from '@kbn/i18n'; +import { + CLIENT_GEO_COUNTRY_ISO_CODE, + TRANSACTION_DURATION, +} from '../../../../../../common/elasticsearch_fieldnames'; +import { APM_STATIC_DATA_VIEW_ID } from '../../../../../../common/data_view_constants'; + +interface VectorLayerDescriptor extends BaseVectorLayerDescriptor { + sourceDescriptor: EMSFileSourceDescriptor; +} + +const FIELD_NAME = 'apm-service-overview-layer-country'; +const COUNTRY_NAME = 'name'; +const TRANSACTION_DURATION_COUNTRY = `__kbnjoin__avg_of_transaction.duration.us__${FIELD_NAME}`; + +function getLayerStyle(): VectorStyleDescriptor { + return { + type: 'VECTOR', + properties: { + icon: { type: STYLE_TYPE.STATIC, options: { value: 'marker' } }, + fillColor: { + type: STYLE_TYPE.DYNAMIC, + options: { + color: 'Blue to Red', + colorCategory: 'palette_0', + fieldMetaOptions: { isEnabled: true, sigma: 3 }, + type: COLOR_MAP_TYPE.ORDINAL, + field: { + name: TRANSACTION_DURATION_COUNTRY, + origin: FIELD_ORIGIN.JOIN, + }, + useCustomColorRamp: false, + }, + }, + lineColor: { + type: STYLE_TYPE.DYNAMIC, + options: { color: '#3d3d3d', fieldMetaOptions: { isEnabled: true } }, + }, + lineWidth: { type: STYLE_TYPE.STATIC, options: { size: 1 } }, + iconSize: { type: STYLE_TYPE.STATIC, options: { size: 6 } }, + iconOrientation: { + type: STYLE_TYPE.STATIC, + options: { orientation: 0 }, + }, + labelText: { + type: STYLE_TYPE.DYNAMIC, + options: { + field: { + name: TRANSACTION_DURATION_COUNTRY, + origin: FIELD_ORIGIN.JOIN, + }, + }, + }, + labelZoomRange: { + options: { + useLayerZoomRange: true, + minZoom: 0, + maxZoom: 24, + }, + }, + labelColor: { + type: STYLE_TYPE.STATIC, + options: { color: '#000000' }, + }, + labelSize: { type: STYLE_TYPE.STATIC, options: { size: 14 } }, + labelBorderColor: { + type: STYLE_TYPE.STATIC, + options: { color: '#FFFFFF' }, + }, + symbolizeAs: { options: { value: SYMBOLIZE_AS_TYPES.CIRCLE } }, + labelBorderSize: { options: { size: LABEL_BORDER_SIZES.SMALL } }, + }, + isTimeAware: true, + }; +} + +export async function getLayerList(maps?: MapsStartApi) { + const basemapLayerDescriptor = maps + ? await maps.createLayerDescriptors.createBasemapLayerDescriptor() + : null; + + const pageLoadDurationByCountryLayer: VectorLayerDescriptor = { + joins: [ + { + leftField: 'iso2', + right: { + type: SOURCE_TYPES.ES_TERM_SOURCE, + id: FIELD_NAME, + term: CLIENT_GEO_COUNTRY_ISO_CODE, + metrics: [ + { + type: AGG_TYPE.AVG, + field: TRANSACTION_DURATION, + label: i18n.translate( + 'xpack.apm.serviceOverview.embeddedMap.metric.label', + { + defaultMessage: 'Page load duration', + } + ), + }, + ], + indexPatternId: APM_STATIC_DATA_VIEW_ID, + applyGlobalQuery: true, + applyGlobalTime: true, + applyForceRefresh: true, + }, + }, + ], + sourceDescriptor: { + type: SOURCE_TYPES.EMS_FILE, + id: 'world_countries', + tooltipProperties: [COUNTRY_NAME], + }, + style: getLayerStyle(), + id: uuid.v4(), + label: null, + minZoom: 0, + maxZoom: 24, + alpha: 0.75, + visible: true, + type: LAYER_TYPE.GEOJSON_VECTOR, + }; + + return [ + ...(basemapLayerDescriptor ? [basemapLayerDescriptor] : []), + pageLoadDurationByCountryLayer, + ] as BaseLayerDescriptor[]; +} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/index.tsx new file mode 100644 index 0000000000000..8a5917bd861b6 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/index.tsx @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiTitle, EuiSpacer } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import type { Filter } from '@kbn/es-query'; +import { EmbeddedMap } from './embedded_map'; + +export function LatencyMap({ filters }: { filters: Filter[] }) { + return ( + <> + <EuiTitle size="xs"> + <h3> + {i18n.translate('xpack.apm.serviceOverview.embeddedMap.title', { + defaultMessage: 'Average latency per country', + })} + </h3> + </EuiTitle> + <EuiSpacer size="s" /> + <EmbeddedMap filters={filters} /> + </> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/__snapshots__/most_used_chart.test.tsx.snap b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/__snapshots__/most_used_chart.test.tsx.snap new file mode 100644 index 0000000000000..b98475f93e0aa --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/__snapshots__/most_used_chart.test.tsx.snap @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Most used chart with Lens gets lens attributes 1`] = ` +Object { + "references": Array [ + Object { + "id": "apm_static_index_pattern_id", + "name": "indexpattern-datasource-layer-host-os-version", + "type": "index-pattern", + }, + ], + "state": Object { + "datasourceStates": Object { + "formBased": Object { + "layers": Object { + "host-os-version": Object { + "columnOrder": Array [ + "termsColumn", + "countColumn", + ], + "columns": Object { + "countColumn": Object { + "dataType": "number", + "isBucketed": false, + "label": "Count of records", + "operationType": "count", + "scale": "ratio", + "sourceField": "___records___", + }, + "termsColumn": Object { + "dataType": "string", + "isBucketed": true, + "label": "Top 5 values of host.os.version", + "operationType": "terms", + "params": Object { + "orderBy": Object { + "columnId": "countColumn", + "type": "column", + }, + "orderDirection": "desc", + "size": 5, + }, + "scale": "ordinal", + "sourceField": "host.os.version", + }, + }, + }, + }, + }, + }, + "filters": Array [ + Object { + "meta": Object {}, + "query": Object { + "term": Object { + "processor.event": "transaction", + }, + }, + }, + Object { + "meta": Object {}, + "query": Object { + "term": Object { + "service.name": "opbeans-swift", + }, + }, + }, + Object { + "meta": Object {}, + "query": Object { + "term": Object { + "transaction.type": "request", + }, + }, + }, + ], + "query": Object { + "language": "kuery", + "query": "", + }, + "visualization": Object { + "layers": Array [ + Object { + "categoryDisplay": "default", + "layerId": "host-os-version", + "layerType": "data", + "legendDisplay": "hide", + "metric": "countColumn", + "numberDisplay": "percent", + "primaryGroups": Array [ + "termsColumn", + ], + }, + ], + "shape": "pie", + }, + }, + "title": "most-used-host-os-version", + "visualizationType": "lnsPie", +} +`; diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/get_lens_attributes.ts b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/get_lens_attributes.ts new file mode 100644 index 0000000000000..87435bbe68969 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/get_lens_attributes.ts @@ -0,0 +1,115 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { i18n } from '@kbn/i18n'; +import { + CountIndexPatternColumn, + TermsIndexPatternColumn, + PersistedIndexPatternLayer, + PieVisualizationState, + TypedLensByValueInput, +} from '@kbn/lens-plugin/public'; +import type { Filter } from '@kbn/es-query'; +import { APM_STATIC_DATA_VIEW_ID } from '../../../../../../common/data_view_constants'; +import { MostUsedMetricTypes } from '.'; + +const BUCKET_SIZE = 5; + +export function getLensAttributes({ + metric, + filters, + kuery = '', +}: { + metric: MostUsedMetricTypes; + filters: Filter[]; + kuery?: string; +}): TypedLensByValueInput['attributes'] { + const metricId = metric.replaceAll('.', '-'); + + const columnA = 'termsColumn'; + const columnB = 'countColumn'; + + const dataLayer: PersistedIndexPatternLayer = { + columnOrder: [columnA, columnB], + columns: { + [columnA]: { + label: i18n.translate( + 'xpack.apm.serviceOverview.lensFlyout.topValues', + { + defaultMessage: 'Top {BUCKET_SIZE} values of {metric}', + values: { + BUCKET_SIZE, + metric, + }, + } + ), + dataType: 'string', + operationType: 'terms', + scale: 'ordinal', + sourceField: metric, + isBucketed: true, + params: { + size: BUCKET_SIZE, + orderBy: { + type: 'column', + columnId: columnB, + }, + orderDirection: 'desc', + }, + } as TermsIndexPatternColumn, + [columnB]: { + label: i18n.translate( + 'xpack.apm.serviceOverview.lensFlyout.countRecords', + { + defaultMessage: 'Count of records', + } + ), + dataType: 'number', + operationType: 'count', + scale: 'ratio', + isBucketed: false, + sourceField: '___records___', + } as CountIndexPatternColumn, + }, + }; + + return { + title: `most-used-${metricId}`, + visualizationType: 'lnsPie', + references: [ + { + type: 'index-pattern', + id: APM_STATIC_DATA_VIEW_ID, + name: `indexpattern-datasource-layer-${metricId}`, + }, + ], + state: { + visualization: { + shape: 'pie', + layers: [ + { + layerId: metricId, + primaryGroups: [columnA], + metric: columnB, + categoryDisplay: 'default', + legendDisplay: 'hide', + numberDisplay: 'percent', + layerType: 'data', + }, + ], + } as PieVisualizationState, + datasourceStates: { + formBased: { + layers: { + [metricId]: dataLayer, + }, + }, + }, + filters, + query: { language: 'kuery', query: kuery }, + }, + }; +} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/index.tsx new file mode 100644 index 0000000000000..b78df50106e7e --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/index.tsx @@ -0,0 +1,122 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiTitle, EuiFlexItem, EuiPanel } from '@elastic/eui'; +import React, { useMemo, useCallback } from 'react'; +import type { Filter } from '@kbn/es-query'; +import { i18n } from '@kbn/i18n'; +import { ViewMode } from '@kbn/embeddable-plugin/public'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { ApmPluginStartDeps } from '../../../../../plugin'; +import { getLensAttributes } from './get_lens_attributes'; +import { + DEVICE_MODEL_NAME, + HOST_OS_VERSION, + NETWORK_CONNECTION_TYPE, + SERVICE_VERSION, +} from '../../../../../../common/elasticsearch_fieldnames'; + +export type MostUsedMetricTypes = + | typeof DEVICE_MODEL_NAME + | typeof SERVICE_VERSION + | typeof HOST_OS_VERSION + | typeof NETWORK_CONNECTION_TYPE; + +export function MostUsedChart({ + title, + start, + end, + kuery, + filters, + metric, +}: { + title: React.ReactNode; + start: string; + end: string; + kuery?: string; + filters: Filter[]; + metric: MostUsedMetricTypes; +}) { + const { services } = useKibana<ApmPluginStartDeps>(); + const { + lens: { EmbeddableComponent, navigateToPrefilledEditor, canUseEditor }, + } = services; + + const lensAttributes = useMemo( + () => + getLensAttributes({ + kuery, + filters, + metric, + }), + [kuery, filters, metric] + ); + + const openInLens = useCallback(() => { + if (lensAttributes) { + navigateToPrefilledEditor( + { + id: `dataVisualizer-${metric}`, + timeRange: { + from: start, + to: end, + }, + attributes: lensAttributes, + }, + { + openInNewTab: true, + } + ); + } + }, [navigateToPrefilledEditor, lensAttributes, start, end, metric]); + + const getOpenInLensAction = () => { + return { + id: 'openInLens', + type: 'link', + getDisplayName() { + return i18n.translate('xpack.apm.serviceOverview.openInLens', { + defaultMessage: 'Open in Lens', + }); + }, + getIconType() { + return 'visArea'; + }, + async isCompatible() { + return true; + }, + async execute() { + openInLens(); + return; + }, + }; + }; + + return ( + <EuiPanel hasBorder={true}> + <EuiFlexItem grow={false}> + <EuiTitle size="xs"> + <h2>{title}</h2> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem> + <EmbeddableComponent + viewMode={ViewMode.VIEW} + id={`most-used-${metric.replaceAll('.', '-')}`} + hidePanelTitles + withDefaultActions + style={{ height: 200 }} + attributes={lensAttributes} + timeRange={{ + from: start, + to: end, + }} + {...(canUseEditor() && { extraActions: [getOpenInLensAction()] })} + /> + </EuiFlexItem> + </EuiPanel> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/most_used_chart.test.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/most_used_chart.test.tsx new file mode 100644 index 0000000000000..fa4a5bf3657f6 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/most_used_chart/most_used_chart.test.tsx @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { render } from '@testing-library/react'; +import { MemoryRouter } from 'react-router-dom'; +import { CoreStart } from '@kbn/core/public'; +import React, { ReactNode } from 'react'; +import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; +import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context'; +import { getLensAttributes } from './get_lens_attributes'; +import { MostUsedChart, MostUsedMetricTypes } from '.'; +import { HOST_OS_VERSION } from '../../../../../../common/elasticsearch_fieldnames'; + +const mockEmbeddableComponent = jest.fn(); + +function Wrapper({ children }: { children?: ReactNode }) { + const KibanaReactContext = createKibanaReactContext({ + lens: { + EmbeddableComponent: mockEmbeddableComponent.mockReturnValue( + <div data-test-subj="lens-mock" /> + ), + canUseEditor: jest.fn(() => true), + navigateToPrefilledEditor: jest.fn(), + }, + } as Partial<CoreStart>); + + return ( + <MemoryRouter> + <KibanaReactContext.Provider> + <MockApmPluginContextWrapper>{children}</MockApmPluginContextWrapper> + </KibanaReactContext.Provider> + </MemoryRouter> + ); +} + +const renderOptions = { wrapper: Wrapper }; + +describe('Most used chart with Lens', () => { + const props = { + metric: HOST_OS_VERSION as MostUsedMetricTypes, + filters: [ + { + meta: {}, + query: { + term: { + 'processor.event': 'transaction', + }, + }, + }, + { + meta: {}, + query: { + term: { + 'service.name': 'opbeans-swift', + }, + }, + }, + { + meta: {}, + query: { + term: { + 'transaction.type': 'request', + }, + }, + }, + ], + }; + test('gets lens attributes', () => { + expect(getLensAttributes(props)).toMatchSnapshot(); + }); + + test('Renders most used chart with Lens', () => { + const start = '2022-10-30T20%3A52%3A47.080Z'; + const end = '2022-10-31T20%3A52%3A47.080Z'; + + render( + <MostUsedChart + title="Most used os version" + start={start} + end={end} + metric={HOST_OS_VERSION as MostUsedMetricTypes} + filters={props.filters} + />, + renderOptions + ); + + expect(mockEmbeddableComponent).toHaveBeenCalledTimes(1); + expect(mockEmbeddableComponent.mock.calls[0][0]).toEqual( + expect.objectContaining({ + timeRange: { + from: start, + to: end, + }, + attributes: getLensAttributes(props), + }) + ); + }); +}); diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx index 4dd20ca8a0d94..12948d098af57 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx @@ -18,7 +18,16 @@ import { TransactionsTable } from '../../../shared/transactions_table'; import { AggregatedTransactionsBadge } from '../../../shared/aggregated_transactions_badge'; import { useApmParams } from '../../../../hooks/use_apm_params'; import { useTimeRange } from '../../../../hooks/use_time_range'; - +import { MostUsedChart } from './most_used_chart'; +import { LatencyMap } from './latency_map'; +import { MobileFilters } from './filters'; +import { useFiltersForMobileCharts } from './use_filters_for_mobile_charts'; +import { + DEVICE_MODEL_NAME, + HOST_OS_VERSION, + NETWORK_CONNECTION_TYPE, + SERVICE_VERSION, +} from '../../../../../common/elasticsearch_fieldnames'; interface Props { latencyChartHeight: number; rowDirection: 'column' | 'row'; @@ -34,10 +43,21 @@ export function ServiceOverviewMobileCharts({ }: Props) { const { fallbackToTransactions, serviceName } = useApmServiceContext(); const router = useApmRouter(); + const filters = useFiltersForMobileCharts(); const { query, - query: { environment, kuery, rangeFrom, rangeTo }, + query: { + environment, + kuery, + rangeFrom, + rangeTo, + netConnectionType, + device, + osVersion, + appVersion, + transactionType, + }, } = useApmParams('/services/{serviceName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -51,6 +71,21 @@ export function ServiceOverviewMobileCharts({ return ( <EuiFlexGroup direction="column" gutterSize="s"> + <EuiFlexItem> + <MobileFilters + start={start} + end={end} + environment={environment} + transactionType={transactionType} + kuery={kuery} + filters={{ + device, + osVersion, + appVersion, + netConnectionType, + }} + /> + </EuiFlexItem> {fallbackToTransactions && ( <EuiFlexItem> <AggregatedTransactionsBadge /> @@ -121,6 +156,82 @@ export function ServiceOverviewMobileCharts({ </EuiFlexItem> </EuiFlexGroup> </EuiFlexItem> + + <EuiFlexItem> + <EuiPanel hasBorder={true}> + <LatencyMap filters={filters} /> + </EuiPanel> + </EuiFlexItem> + + <EuiFlexItem> + <EuiFlexGroup direction={rowDirection} gutterSize="s"> + {/* Device */} + <EuiFlexItem> + <MostUsedChart + title={i18n.translate( + 'xpack.apm.serviceOverview.mostUsed.device', + { + defaultMessage: 'Most used device', + } + )} + metric={DEVICE_MODEL_NAME} + start={start} + end={end} + kuery={kuery} + filters={filters} + /> + </EuiFlexItem> + {/* NCT */} + <EuiFlexItem> + <MostUsedChart + title={i18n.translate('xpack.apm.serviceOverview.mostUsed.nct', { + defaultMessage: 'Most used NCT', + })} + metric={NETWORK_CONNECTION_TYPE} + start={start} + end={end} + kuery={kuery} + filters={filters} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem> + <EuiFlexGroup direction={rowDirection} gutterSize="s"> + {/* OS Version */} + <EuiFlexItem> + <MostUsedChart + title={i18n.translate( + 'xpack.apm.serviceOverview.mostUsed.osVersion', + { + defaultMessage: 'Most used OS version', + } + )} + metric={HOST_OS_VERSION} + start={start} + end={end} + kuery={kuery} + filters={filters} + /> + </EuiFlexItem> + {/* App version */} + <EuiFlexItem> + <MostUsedChart + title={i18n.translate( + 'xpack.apm.serviceOverview.mostUsed.appVersion', + { + defaultMessage: 'Most used app version', + } + )} + metric={SERVICE_VERSION} + start={start} + end={end} + kuery={kuery} + filters={filters} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> </EuiFlexGroup> ); } diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/use_filters_for_mobile_charts.ts b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/use_filters_for_mobile_charts.ts new file mode 100644 index 0000000000000..3412decc3f9be --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/use_filters_for_mobile_charts.ts @@ -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 { useMemo } from 'react'; +import { type QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import { isNil, isEmpty } from 'lodash'; +import { environmentQuery } from '../../../../../common/utils/environment_query'; +import { useApmParams } from '../../../../hooks/use_apm_params'; +import { + SERVICE_NAME, + TRANSACTION_TYPE, + HOST_OS_VERSION, + DEVICE_MODEL_NAME, + NETWORK_CONNECTION_TYPE, + SERVICE_VERSION, +} from '../../../../../common/elasticsearch_fieldnames'; + +function termQuery<T extends string>( + field: T, + value: string | boolean | number | undefined | null +): QueryDslQueryContainer[] { + if (isNil(value) || isEmpty(value)) { + return []; + } + + return [{ term: { [field]: value } }]; +} + +export function useFiltersForMobileCharts() { + const { + path: { serviceName }, + query: { + environment, + transactionType, + device, + osVersion, + appVersion, + netConnectionType, + }, + } = useApmParams('/services/{serviceName}/overview'); + + return useMemo( + () => + [ + ...termQuery(SERVICE_NAME, serviceName), + ...termQuery(TRANSACTION_TYPE, transactionType), + ...termQuery(HOST_OS_VERSION, osVersion), + ...termQuery(DEVICE_MODEL_NAME, device), + ...termQuery(NETWORK_CONNECTION_TYPE, netConnectionType), + ...termQuery(SERVICE_VERSION, appVersion), + ...environmentQuery(environment), + ].map((query) => ({ + meta: {}, + query, + })), + [ + environment, + transactionType, + serviceName, + osVersion, + device, + netConnectionType, + appVersion, + ] + ); +} diff --git a/x-pack/plugins/apm/public/components/app/settings/general_settings/index.tsx b/x-pack/plugins/apm/public/components/app/settings/general_settings/index.tsx index 2faad60fb8b81..564cddd1af89c 100644 --- a/x-pack/plugins/apm/public/components/app/settings/general_settings/index.tsx +++ b/x-pack/plugins/apm/public/components/app/settings/general_settings/index.tsx @@ -16,6 +16,8 @@ import { defaultApmServiceEnvironment, enableComparisonByDefault, enableInspectEsQueries, + apmAWSLambdaPriceFactor, + apmAWSLambdaRequestCostPerMillion, } from '@kbn/observability-plugin/common'; import { isEmpty } from 'lodash'; import React from 'react'; @@ -30,6 +32,8 @@ const apmSettingsKeys = [ apmServiceGroupMaxNumberOfServices, enableInspectEsQueries, apmLabsButton, + apmAWSLambdaPriceFactor, + apmAWSLambdaRequestCostPerMillion, ]; export function GeneralSettings() { diff --git a/x-pack/plugins/apm/public/components/app/storage_explorer/get_storage_explorer_links.ts b/x-pack/plugins/apm/public/components/app/storage_explorer/get_storage_explorer_links.ts new file mode 100644 index 0000000000000..1736cd852a417 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/storage_explorer/get_storage_explorer_links.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { CoreStart } from '@kbn/core-lifecycle-browser'; + +export function getIndexManagementHref(core: CoreStart) { + return core.application.getUrlForApp('management', { + path: '/data/index_management/data_streams', + }); +} + +export function getStorageExplorerFeedbackHref() { + return 'https://ela.st/feedback-storage-explorer'; +} + +export function getKibanaAdvancedSettingsHref(core: CoreStart) { + return core.application.getUrlForApp('management', { + path: '/kibana/settings?query=category:(observability)', + }); +} diff --git a/x-pack/plugins/apm/public/components/app/storage_explorer/index.tsx b/x-pack/plugins/apm/public/components/app/storage_explorer/index.tsx index 5b8c044d2276c..060c8c00da6e7 100644 --- a/x-pack/plugins/apm/public/components/app/storage_explorer/index.tsx +++ b/x-pack/plugins/apm/public/components/app/storage_explorer/index.tsx @@ -12,8 +12,14 @@ import { EuiSpacer, EuiEmptyPrompt, EuiLoadingSpinner, + EuiCallOut, + EuiLink, + EuiButton, + EuiPanel, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; import { IndexLifecyclePhaseSelect } from './index_lifecycle_phase_select'; import { ServicesTable } from './services_table'; import { SearchBar } from '../../shared/search_bar'; @@ -22,18 +28,51 @@ import { PermissionDenied } from './prompts/permission_denied'; import { useFetcher, FETCH_STATUS } from '../../../hooks/use_fetcher'; import { SummaryStats } from './summary_stats'; import { ApmEnvironmentFilter } from '../../shared/environment_filter'; +import { TipsAndResources } from './resources/tips_and_resources'; +import { useLocalStorage } from '../../../hooks/use_local_storage'; +import { getKibanaAdvancedSettingsHref } from './get_storage_explorer_links'; -const INITIAL_DATA = { hasPrivileges: false }; +type CalloutType = 'crossClusterSearch' | 'optimizePerformance'; + +const CALLOUT_DISMISS_INITIAL_STATE: Record<CalloutType, boolean> = { + crossClusterSearch: false, + optimizePerformance: false, +}; + +const dismissButtonText = i18n.translate( + 'xpack.apm.storageExplorer.callout.dimissButton', + { + defaultMessage: 'Dismiss', + } +); export function StorageExplorer() { - const { data: { hasPrivileges } = INITIAL_DATA, status } = useFetcher( + const { core } = useApmPluginContext(); + + const [calloutDismissed, setCalloutDismissed] = useLocalStorage( + 'apm.storageExplorer.calloutDismissed', + CALLOUT_DISMISS_INITIAL_STATE + ); + + const { data: hasPrivilegesData, status: hasPrivilegesStatus } = useFetcher( (callApmApi) => { return callApmApi('GET /internal/apm/storage_explorer/privileges'); }, [] ); - const loading = status === FETCH_STATUS.LOADING; + const { data: isCrossClusterSearchData } = useFetcher( + (callApmApi) => { + if (!calloutDismissed.crossClusterSearch) { + return callApmApi( + 'GET /internal/apm/storage_explorer/is_cross_cluster_search' + ); + } + }, + [calloutDismissed] + ); + + const loading = hasPrivilegesStatus === FETCH_STATUS.LOADING; if (loading) { return ( @@ -51,7 +90,7 @@ export function StorageExplorer() { ); } - if (!hasPrivileges) { + if (!hasPrivilegesData?.hasPrivileges) { return <PermissionDenied />; } @@ -67,11 +106,94 @@ export function StorageExplorer() { </EuiFlexItem> </EuiFlexGroup> <EuiSpacer /> + + {!calloutDismissed.optimizePerformance && ( + <EuiCallOut + title={i18n.translate( + 'xpack.apm.storageExplorer.longLoadingTimeCalloutTitle', + { + defaultMessage: 'Long loading time?', + } + )} + iconType="timeRefresh" + > + <p> + <FormattedMessage + id="xpack.apm.storageExplorer.longLoadingTimeCalloutText" + defaultMessage="Enable progressive loading of data and optimized sorting for services list in {kibanaAdvancedSettingsLink}." + values={{ + kibanaAdvancedSettingsLink: ( + <EuiLink href={getKibanaAdvancedSettingsHref(core)}> + {i18n.translate( + 'xpack.apm.storageExplorer.longLoadingTimeCalloutLink', + { + defaultMessage: 'Kibana advanced settings', + } + )} + </EuiLink> + ), + }} + /> + </p> + <EuiButton + onClick={() => + setCalloutDismissed({ + ...calloutDismissed, + optimizePerformance: true, + }) + } + > + {dismissButtonText} + </EuiButton> + </EuiCallOut> + )} + + {!calloutDismissed.crossClusterSearch && + isCrossClusterSearchData?.isCrossClusterSearch && ( + <> + <EuiSpacer size="s" /> + <EuiCallOut + title={i18n.translate( + 'xpack.apm.storageExplorer.crossClusterSearchCalloutTitle', + { + defaultMessage: 'Searching across clusters?', + } + )} + iconType="search" + > + <p> + {i18n.translate( + 'xpack.apm.storageExplorer.crossClusterSearchCalloutText', + { + defaultMessage: + 'While getting document count works with cross-cluster search, index statistics such as size are only displayed for data that are stored in this cluster.', + } + )} + </p> + <EuiButton + onClick={() => + setCalloutDismissed({ + ...calloutDismissed, + crossClusterSearch: true, + }) + } + > + {dismissButtonText} + </EuiButton> + </EuiCallOut> + </> + )} + + <EuiSpacer /> <SummaryStats /> <EuiSpacer /> - <StorageChart /> + <EuiPanel hasShadow={false} hasBorder={true}> + <StorageChart /> + <EuiSpacer /> + <ServicesTable /> + </EuiPanel> <EuiSpacer /> - <ServicesTable /> + <TipsAndResources /> </> ); } diff --git a/x-pack/plugins/apm/public/components/app/storage_explorer/resources/tips_and_resources.tsx b/x-pack/plugins/apm/public/components/app/storage_explorer/resources/tips_and_resources.tsx new file mode 100644 index 0000000000000..8de6d7d3e56d7 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/storage_explorer/resources/tips_and_resources.tsx @@ -0,0 +1,203 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { + EuiAccordion, + EuiPanel, + EuiFlexItem, + EuiTitle, + EuiButton, + EuiCard, + EuiIcon, + EuiListGroup, + EuiFlexGroup, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { useApmRouter } from '../../../../hooks/use_apm_router'; +import { useApmParams } from '../../../../hooks/use_apm_params'; +import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; +import { + getIndexManagementHref, + getStorageExplorerFeedbackHref, +} from '../get_storage_explorer_links'; + +export function TipsAndResources() { + const router = useApmRouter(); + const { core } = useApmPluginContext(); + const { docLinks } = core; + + const { + query: { rangeFrom, rangeTo, environment, kuery, comparisonEnabled }, + } = useApmParams('/storage-explorer'); + + const cards = [ + { + icon: 'beaker', + title: i18n.translate( + 'xpack.apm.storageExplorer.resources.errorMessages.title', + { + defaultMessage: 'Reduce transactions', + } + ), + description: i18n.translate( + 'xpack.apm.storageExplorer.resources.errorMessages.description', + { + defaultMessage: + 'Configure a more aggressive transaction sampling policy. Transaction sampling lowers the amount of data ingested without negatively impacting the usefulness of that data.', + } + ), + href: docLinks.links.apm.transactionSampling, + }, + { + icon: 'visLine', + title: i18n.translate( + 'xpack.apm.storageExplorer.resources.compressedSpans.title', + { + defaultMessage: 'Reduce spans', + } + ), + description: i18n.translate( + 'xpack.apm.storageExplorer.resources.compressedSpans.description', + { + defaultMessage: + 'Enable span compression. Span compression saves on data and transfer costs by compressing multiple similar spans into a single span.', + } + ), + href: docLinks.links.apm.spanCompression, + }, + { + icon: 'indexEdit', + title: i18n.translate( + 'xpack.apm.storageExplorer.resources.samplingRate.title', + { + defaultMessage: 'Manage the index lifecycle', + } + ), + description: i18n.translate( + 'xpack.apm.storageExplorer.resources.samplingRate.description', + { + defaultMessage: + 'Customize your index lifecycle policies. Index lifecycle policies allow you to manage indices according to your performance, resiliency, and retention requirements.', + } + ), + href: docLinks.links.apm.indexLifecycleManagement, + }, + ]; + + const resourcesListItems = [ + { + label: i18n.translate( + 'xpack.apm.storageExplorer.resources.indexManagement', + { + defaultMessage: 'Index management', + } + ), + href: getIndexManagementHref(core), + iconType: 'indexEdit', + }, + { + label: i18n.translate( + 'xpack.apm.storageExplorer.resources.serviceInventory', + { + defaultMessage: 'Service inventory', + } + ), + href: router.link('/services', { + query: { + rangeFrom, + rangeTo, + environment, + comparisonEnabled, + kuery, + serviceGroup: '', + }, + }), + iconType: 'tableDensityExpanded', + }, + { + label: i18n.translate( + 'xpack.apm.storageExplorer.resources.documentation', + { + defaultMessage: 'Documentation', + } + ), + href: docLinks.links.apm.storageExplorer, + target: '_blank', + iconType: 'documentation', + }, + { + label: i18n.translate( + 'xpack.apm.storageExplorer.resources.sendFeedback', + { + defaultMessage: 'Send feedback', + } + ), + href: getStorageExplorerFeedbackHref(), + target: '_blank', + iconType: 'editorComment', + }, + ]; + + return ( + <EuiPanel hasBorder={true} hasShadow={false}> + <EuiAccordion + id="tipsAndResourcesAccordion" + buttonContent={ + <EuiTitle size="xs"> + <h2> + {i18n.translate( + 'xpack.apm.storageExplorer.resources.accordionTitle', + { + defaultMessage: 'Tips and tricks', + } + )} + </h2> + </EuiTitle> + } + initialIsOpen + paddingSize="m" + > + <EuiFlexGroup justifyContent="spaceAround"> + {cards.map(({ icon, title, description, href }) => ( + <EuiFlexItem> + <EuiCard + icon={<EuiIcon size="xl" type={icon} />} + title={title} + description={description} + footer={ + <EuiButton href={href} target="_blank"> + {i18n.translate( + 'xpack.apm.storageExplorer.resources.learnMoreButton', + { + defaultMessage: 'Learn more', + } + )} + </EuiButton> + } + /> + </EuiFlexItem> + ))} + <EuiFlexItem grow={false}> + <EuiTitle size="xs"> + <h3> + {i18n.translate('xpack.apm.storageExplorer.resources.title', { + defaultMessage: 'Resources', + })} + </h3> + </EuiTitle> + <EuiListGroup + listItems={resourcesListItems} + color="primary" + size="s" + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiAccordion> + </EuiPanel> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/index.tsx b/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/index.tsx index 7f2dd2d8a096f..8fe102ea72961 100644 --- a/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/index.tsx +++ b/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useState, useEffect, ReactNode } from 'react'; +import React, { useState, ReactNode } from 'react'; import { EuiInMemoryTable, EuiBasicTableColumn, @@ -14,9 +14,13 @@ import { RIGHT_ALIGNMENT, EuiToolTip, EuiIcon, + EuiProgress, + EuiPanel, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { ValuesType } from 'utility-types'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { apmServiceInventoryOptimizedSorting } from '@kbn/observability-plugin/common'; +import { AgentName } from '../../../../../typings/es_schemas/ui/fields/agent'; import { EnvironmentBadge } from '../../../shared/environment_badge'; import { asPercent } from '../../../../../common/utils/formatters'; import { ServiceLink } from '../../../shared/service_link'; @@ -27,14 +31,26 @@ import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plug import { asDynamicBytes } from '../../../../../common/utils/formatters'; import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n'; import { useApmParams } from '../../../../hooks/use_apm_params'; -import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; +import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; import { useProgressiveFetcher } from '../../../../hooks/use_progressive_fetcher'; import { useTimeRange } from '../../../../hooks/use_time_range'; import { SizeLabel } from './size_label'; -import type { APIReturnType } from '../../../../services/rest/create_call_apm_api'; +import { joinByKey } from '../../../../../common/utils/join_by_key'; -type StorageExplorerItems = - APIReturnType<'GET /internal/apm/storage_explorer'>['serviceStatistics']; +interface StorageExplorerItem { + serviceName: string; + environments?: string[]; + size?: number; + agentName?: AgentName; + sampling?: number; +} + +enum StorageExplorerFieldName { + ServiceName = 'serviceName', + Environments = 'environments', + Sampling = 'sampling', + Size = 'size', +} export function ServicesTable() { const [itemIdToExpandedRowMap, setItemIdToExpandedRowMap] = useState< @@ -76,7 +92,29 @@ export function ServicesTable() { setItemIdToExpandedRowMap(expandedRowMapValues); }; - const { data, status } = useProgressiveFetcher( + const useOptimizedSorting = + useKibana().services.uiSettings?.get<boolean>( + apmServiceInventoryOptimizedSorting + ) || false; + + const sortedAndFilteredServicesFetch = useFetcher( + (callApmApi) => { + if (useOptimizedSorting) { + return callApmApi('GET /internal/apm/storage_explorer/get_services', { + params: { + query: { + environment, + kuery, + indexLifecyclePhase, + }, + }, + }); + } + }, + [environment, kuery, indexLifecyclePhase, useOptimizedSorting] + ); + + const serviceStatisticsFetch = useProgressiveFetcher( (callApmApi) => { return callApmApi('GET /internal/apm/storage_explorer', { params: { @@ -93,165 +131,193 @@ export function ServicesTable() { [indexLifecyclePhase, start, end, environment, kuery] ); - useEffect(() => { - // Closes any open rows when fetching new items - setItemIdToExpandedRowMap({}); - }, [status]); + const serviceStatisticsItems = + serviceStatisticsFetch.data?.serviceStatistics ?? []; + const preloadedServices = sortedAndFilteredServicesFetch.data?.services || []; + + const initialSortField = useOptimizedSorting + ? StorageExplorerFieldName.ServiceName + : StorageExplorerFieldName.Size; - const loading = - status === FETCH_STATUS.NOT_INITIATED || status === FETCH_STATUS.LOADING; + const initialSortDirection = + initialSortField === StorageExplorerFieldName.ServiceName ? 'asc' : 'desc'; - const columns: Array<EuiBasicTableColumn<ValuesType<StorageExplorerItems>>> = + const loading = serviceStatisticsFetch.status === FETCH_STATUS.LOADING; + + const items = joinByKey( [ - { - field: 'serviceName', - name: i18n.translate( - 'xpack.apm.storageExplorer.table.serviceColumnName', - { - defaultMessage: 'Service', - } - ), - sortable: true, - render: (_, { serviceName, agentName }) => { - const serviceLinkQuery = { - comparisonEnabled, - environment, - kuery, - rangeFrom, - rangeTo, - serviceGroup: '', - }; + ...(initialSortField === StorageExplorerFieldName.ServiceName + ? preloadedServices + : []), + ...serviceStatisticsItems, + ], + 'serviceName' + ); - return ( - <TruncateWithTooltip - data-test-subj="apmStorageExplorerServiceLink" - text={serviceName || NOT_AVAILABLE_LABEL} - content={ - <ServiceLink - query={serviceLinkQuery} - serviceName={serviceName} - agentName={agentName} - /> - } - /> - ); - }, - }, - { - field: 'environment', - name: i18n.translate( - 'xpack.apm.storageExplorer.table.environmentColumnName', - { - defaultMessage: 'Environment', - } - ), - render: (_, { environments }) => ( - <EnvironmentBadge environments={environments ?? []} /> - ), - sortable: true, - }, + const columns: Array<EuiBasicTableColumn<StorageExplorerItem>> = [ + { + field: 'serviceName', + name: i18n.translate( + 'xpack.apm.storageExplorer.table.serviceColumnName', + { + defaultMessage: 'Service', + } + ), + sortable: true, + render: (_, { serviceName, agentName }) => { + const serviceLinkQuery = { + comparisonEnabled, + environment, + kuery, + rangeFrom, + rangeTo, + serviceGroup: '', + }; - { - field: 'sampling', - name: ( - <EuiToolTip - content={i18n.translate( - 'xpack.apm.storageExplorer.table.samplingColumnDescription', - { - defaultMessage: `The number of sampled transactions divided by total throughput. This value may differ from the configured transaction sample rate because it might be affected by the initial service's decision when using head-based sampling or by a set of policies when using tail-based sampling.`, - } - )} - > - <> - {i18n.translate( - 'xpack.apm.storageExplorer.table.samplingColumnName', - { - defaultMessage: 'Sample rate', - } - )}{' '} - <EuiIcon - size="s" - color="subdued" - type="questionInCircle" - className="eui-alignTop" + return ( + <TruncateWithTooltip + data-test-subj="apmStorageExplorerServiceLink" + text={serviceName || NOT_AVAILABLE_LABEL} + content={ + <ServiceLink + query={serviceLinkQuery} + serviceName={serviceName} + agentName={agentName} /> - </> - </EuiToolTip> - ), - render: (value: string) => asPercent(parseFloat(value), 1), - sortable: true, + } + /> + ); }, - { - field: 'size', - name: <SizeLabel />, - render: (_, { size }) => asDynamicBytes(size) || NOT_AVAILABLE_LABEL, - sortable: true, - }, - { - align: RIGHT_ALIGNMENT, - width: '40px', - isExpander: true, - name: ( - <EuiScreenReaderOnly> - <span> - {i18n.translate('xpack.apm.storageExplorer.table.expandRow', { - defaultMessage: 'Expand row', - })} - </span> - </EuiScreenReaderOnly> - ), - render: ({ serviceName }: { serviceName: string }) => { - return ( - <EuiButtonIcon - data-test-subj={`storageDetailsButton_${serviceName}`} - onClick={() => toggleRowDetails(serviceName)} - aria-label={ - itemIdToExpandedRowMap[serviceName] - ? i18n.translate('xpack.apm.storageExplorer.table.collapse', { - defaultMessage: 'Collapse', - }) - : i18n.translate('xpack.apm.storageExplorer.table.expand', { - defaultMessage: 'Expand', - }) - } - iconType={ - itemIdToExpandedRowMap[serviceName] ? 'arrowUp' : 'arrowDown' + }, + { + field: 'environment', + name: i18n.translate( + 'xpack.apm.storageExplorer.table.environmentColumnName', + { + defaultMessage: 'Environment', + } + ), + render: (_, { environments }) => ( + <EnvironmentBadge environments={environments ?? []} /> + ), + sortable: true, + }, + + { + field: 'sampling', + name: ( + <EuiToolTip + content={i18n.translate( + 'xpack.apm.storageExplorer.table.samplingColumnDescription', + { + defaultMessage: `The number of sampled transactions divided by total throughput. This value may differ from the configured transaction sample rate because it might be affected by the initial service's decision when using head-based sampling or by a set of policies when using tail-based sampling.`, + } + )} + > + <> + {i18n.translate( + 'xpack.apm.storageExplorer.table.samplingColumnName', + { + defaultMessage: 'Sample rate', } + )}{' '} + <EuiIcon + size="s" + color="subdued" + type="questionInCircle" + className="eui-alignTop" /> - ); - }, + </> + </EuiToolTip> + ), + render: (value: string) => asPercent(parseFloat(value), 1), + sortable: true, + }, + { + field: 'size', + name: <SizeLabel />, + render: (_, { size }) => asDynamicBytes(size) || NOT_AVAILABLE_LABEL, + sortable: true, + }, + { + align: RIGHT_ALIGNMENT, + width: '40px', + isExpander: true, + name: ( + <EuiScreenReaderOnly> + <span> + {i18n.translate('xpack.apm.storageExplorer.table.expandRow', { + defaultMessage: 'Expand row', + })} + </span> + </EuiScreenReaderOnly> + ), + render: ({ serviceName }: { serviceName: string }) => { + return ( + <EuiButtonIcon + data-test-subj={`storageDetailsButton_${serviceName}`} + onClick={() => toggleRowDetails(serviceName)} + aria-label={ + itemIdToExpandedRowMap[serviceName] + ? i18n.translate('xpack.apm.storageExplorer.table.collapse', { + defaultMessage: 'Collapse', + }) + : i18n.translate('xpack.apm.storageExplorer.table.expand', { + defaultMessage: 'Expand', + }) + } + iconType={ + itemIdToExpandedRowMap[serviceName] ? 'arrowUp' : 'arrowDown' + } + /> + ); }, - ]; + }, + ]; return ( - <EuiInMemoryTable - tableCaption={i18n.translate('xpack.apm.storageExplorer.table.caption', { - defaultMessage: 'Storage explorer', - })} - items={data?.serviceStatistics ?? []} - columns={columns} - pagination={true} - sorting={true} - itemId="serviceName" - itemIdToExpandedRowMap={itemIdToExpandedRowMap} - loading={loading} - data-test-subj="storageExplorerServicesTable" - error={ - status === FETCH_STATUS.FAILURE - ? i18n.translate('xpack.apm.storageExplorer.table.errorMessage', { - defaultMessage: 'Failed to fetch', - }) - : '' - } - message={ - loading - ? i18n.translate('xpack.apm.storageExplorer.table.loading', { - defaultMessage: 'Loading...', - }) - : i18n.translate('xpack.apm.storageExplorer.table.noResults', { - defaultMessage: 'No data found', - }) - } - /> + <EuiPanel + hasShadow={false} + paddingSize="none" + style={{ position: 'relative' }} + > + {loading && <EuiProgress size="xs" color="accent" position="absolute" />} + <EuiInMemoryTable + tableCaption={i18n.translate( + 'xpack.apm.storageExplorer.table.caption', + { + defaultMessage: 'Storage explorer', + } + )} + items={items ?? []} + columns={columns} + pagination={true} + sorting={{ + sort: { + field: initialSortField, + direction: initialSortDirection, + }, + }} + itemId="serviceName" + itemIdToExpandedRowMap={itemIdToExpandedRowMap} + data-test-subj="storageExplorerServicesTable" + error={ + status === FETCH_STATUS.FAILURE + ? i18n.translate('xpack.apm.storageExplorer.table.errorMessage', { + defaultMessage: 'Failed to fetch', + }) + : '' + } + message={ + loading + ? i18n.translate('xpack.apm.storageExplorer.table.loading', { + defaultMessage: 'Loading...', + }) + : i18n.translate('xpack.apm.storageExplorer.table.noResults', { + defaultMessage: 'No data found', + }) + } + /> + </EuiPanel> ); } diff --git a/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/index_stats_per_service.tsx b/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/index_stats_per_service.tsx new file mode 100644 index 0000000000000..04505e85ef806 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/index_stats_per_service.tsx @@ -0,0 +1,159 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { + EuiInMemoryTable, + EuiBasicTableColumn, + EuiPanel, + EuiTitle, + EuiSpacer, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { ValuesType } from 'utility-types'; +import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n'; +import { + asDynamicBytes, + asInteger, +} from '../../../../../common/utils/formatters'; +import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; +import type { APIReturnType } from '../../../../services/rest/create_call_apm_api'; +import { SizeLabel } from './size_label'; + +type StorageExplorerIndicesStats = + APIReturnType<'GET /internal/apm/services/{serviceName}/storage_details'>['indicesStats']; + +interface Props { + indicesStats: StorageExplorerIndicesStats; + status: FETCH_STATUS; +} + +export function IndexStatsPerService({ indicesStats, status }: Props) { + const columns: Array< + EuiBasicTableColumn<ValuesType<StorageExplorerIndicesStats>> + > = [ + { + field: 'indexName', + name: i18n.translate('xpack.apm.storageExplorer.indicesStats.indexName', { + defaultMessage: 'Name', + }), + sortable: true, + }, + { + field: 'primary', + name: i18n.translate('xpack.apm.storageExplorer.indicesStats.primaries', { + defaultMessage: 'Primaries', + }), + render: (_, { primary }) => primary ?? NOT_AVAILABLE_LABEL, + sortable: true, + }, + { + field: 'replica', + name: i18n.translate('xpack.apm.storageExplorer.indicesStats.replicas', { + defaultMessage: 'Replicas', + }), + render: (_, { replica }) => replica ?? NOT_AVAILABLE_LABEL, + sortable: true, + }, + { + field: 'numberOfDocs', + name: i18n.translate( + 'xpack.apm.storageExplorer.indicesStats.numberOfDocs', + { + defaultMessage: 'Docs count', + } + ), + render: (_, { numberOfDocs }) => asInteger(numberOfDocs), + sortable: true, + }, + { + field: 'size', + name: <SizeLabel />, + render: (_, { size }) => asDynamicBytes(size) ?? NOT_AVAILABLE_LABEL, + sortable: true, + }, + { + field: 'dataStream', + name: i18n.translate( + 'xpack.apm.storageExplorer.indicesStats.dataStream', + { + defaultMessage: 'Data stream', + } + ), + render: (_, { dataStream }) => dataStream ?? NOT_AVAILABLE_LABEL, + sortable: true, + }, + { + field: 'lifecyclePhase', + name: i18n.translate( + 'xpack.apm.storageExplorer.indicesStats.lifecyclePhase', + { + defaultMessage: 'Lifecycle phase', + } + ), + render: (_, { lifecyclePhase }) => lifecyclePhase ?? NOT_AVAILABLE_LABEL, + sortable: true, + }, + ]; + + const loading = + status === FETCH_STATUS.NOT_INITIATED || status === FETCH_STATUS.LOADING; + + return ( + <> + <EuiTitle size="xs"> + <h5> + {i18n.translate('xpack.apm.storageExplorer.indicesStats.title', { + defaultMessage: 'Indices breakdown', + })} + </h5> + </EuiTitle> + <EuiSpacer /> + <EuiPanel> + <EuiInMemoryTable + tableCaption={i18n.translate( + 'xpack.apm.storageExplorer.indicesStats.table.caption', + { + defaultMessage: 'Storage explorer indices breakdown', + } + )} + items={indicesStats} + columns={columns} + pagination={true} + sorting={true} + loading={loading} + data-test-subj="storageExplorerIndicesStatsTable" + error={ + status === FETCH_STATUS.FAILURE + ? i18n.translate( + 'xpack.apm.storageExplorer.indicesStats.table.errorMessage', + { + defaultMessage: 'Failed to fetch', + } + ) + : '' + } + message={ + loading + ? i18n.translate( + 'xpack.apm.storageExplorer.indicesStats.table.loading', + { + defaultMessage: 'Loading...', + } + ) + : i18n.translate( + 'xpack.apm.storageExplorer.indicesStats.table.noResults', + { + defaultMessage: 'No data found', + } + ) + } + /> + </EuiPanel> + </> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/storage_details_per_service.tsx b/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/storage_details_per_service.tsx index 0a101d3357684..4005c01f1b8f5 100644 --- a/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/storage_details_per_service.tsx +++ b/x-pack/plugins/apm/public/components/app/storage_explorer/services_table/storage_details_per_service.tsx @@ -41,6 +41,7 @@ import { asDynamicBytes } from '../../../../../common/utils/formatters'; import { getComparisonEnabled } from '../../../shared/time_comparison/get_comparison_enabled'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; import { SizeLabel } from './size_label'; +import { IndexStatsPerService } from './index_stats_per_service'; interface Props { serviceName: string; @@ -155,7 +156,7 @@ export function StorageDetailsPerService({ return ( <> - <EuiFlexGroup direction="column" responsive={false} gutterSize="m"> + <EuiFlexGroup direction="column" responsive={false} gutterSize="l"> <EuiFlexItem> <EuiFlexGroup justifyContent="spaceBetween"> <EuiFlexItem> @@ -265,6 +266,12 @@ export function StorageDetailsPerService({ </EuiFlexItem> </EuiFlexGroup> </EuiFlexItem> + <EuiFlexItem> + <IndexStatsPerService + indicesStats={data.indicesStats} + status={status} + /> + </EuiFlexItem> </EuiFlexGroup> </> ); diff --git a/x-pack/plugins/apm/public/components/app/storage_explorer/storage_chart.tsx b/x-pack/plugins/apm/public/components/app/storage_explorer/storage_chart.tsx index 4aeb59fe58f9c..5ca58ebc7559e 100644 --- a/x-pack/plugins/apm/public/components/app/storage_explorer/storage_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/storage_explorer/storage_chart.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React from 'react'; -import { euiPaletteColorBlind, EuiPanel } from '@elastic/eui'; +import { euiPaletteColorBlind } from '@elastic/eui'; import { AreaSeries, Axis, @@ -83,56 +83,54 @@ export function StorageChart() { const isEmpty = isTimeseriesEmpty(storageTimeSeries); return ( - <EuiPanel hasShadow={false} hasBorder={true}> - <ChartContainer - hasData={!isEmpty} - height={400} - status={status} - id="storageExplorerTimeseriesChart" - > - <Chart id="storageExplorerTimeseriesChart"> - <Settings - theme={[ - { - areaSeriesStyle: { - line: { visible: false }, - area: { opacity: 1 }, - }, + <ChartContainer + hasData={!isEmpty} + height={400} + status={status} + id="storageExplorerTimeseriesChart" + > + <Chart id="storageExplorerTimeseriesChart"> + <Settings + theme={[ + { + areaSeriesStyle: { + line: { visible: false }, + area: { opacity: 1 }, }, - ...chartTheme, - ]} - showLegend - legendPosition={Position.Right} + }, + ...chartTheme, + ]} + showLegend + legendPosition={Position.Right} + /> + <Axis + id="x-axis" + position={Position.Bottom} + showOverlappingTicks + tickFormat={xFormatter} + gridLine={{ visible: false }} + /> + <Axis + id="y-axis" + position={Position.Left} + showGridLines + tickFormat={asDynamicBytes} + /> + {storageTimeSeries.map((serie) => ( + <AreaSeries + timeZone={timeZone} + key={serie.title} + id={serie.title} + xScaleType={ScaleType.Time} + yScaleType={ScaleType.Linear} + xAccessor="x" + yAccessors={['y']} + data={isEmpty ? [] : serie.data} + color={serie.color} + stackAccessors={['x']} /> - <Axis - id="x-axis" - position={Position.Bottom} - showOverlappingTicks - tickFormat={xFormatter} - gridLine={{ visible: false }} - /> - <Axis - id="y-axis" - position={Position.Left} - showGridLines - tickFormat={asDynamicBytes} - /> - {storageTimeSeries.map((serie) => ( - <AreaSeries - timeZone={timeZone} - key={serie.title} - id={serie.title} - xScaleType={ScaleType.Time} - yScaleType={ScaleType.Linear} - xAccessor="x" - yAccessors={['y']} - data={isEmpty ? [] : serie.data} - color={serie.color} - stackAccessors={['x']} - /> - ))} - </Chart> - </ChartContainer> - </EuiPanel> + ))} + </Chart> + </ChartContainer> ); } diff --git a/x-pack/plugins/apm/public/components/app/storage_explorer/summary_stats.tsx b/x-pack/plugins/apm/public/components/app/storage_explorer/summary_stats.tsx index c5ffb336ca549..b6f6e5167f3d3 100644 --- a/x-pack/plugins/apm/public/components/app/storage_explorer/summary_stats.tsx +++ b/x-pack/plugins/apm/public/components/app/storage_explorer/summary_stats.tsx @@ -14,30 +14,28 @@ import { EuiText, useEuiFontSize, EuiLink, - EuiLoadingSpinner, + EuiToolTip, + EuiIcon, + EuiProgress, + EuiLoadingContent, + EuiSpacer, } from '@elastic/eui'; import { useEuiTheme } from '@elastic/eui'; import { css } from '@emotion/react'; +import { isEmpty } from 'lodash'; import { useProgressiveFetcher } from '../../../hooks/use_progressive_fetcher'; import { useTimeRange } from '../../../hooks/use_time_range'; import { useApmParams } from '../../../hooks/use_apm_params'; -import { asDynamicBytes } from '../../../../common/utils/formatters'; +import { asDynamicBytes, asPercent } from '../../../../common/utils/formatters'; import { useApmRouter } from '../../../hooks/use_apm_router'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; import { FETCH_STATUS } from '../../../hooks/use_fetcher'; import { asTransactionRate } from '../../../../common/utils/formatters'; - -const INITIAL_DATA = { - estimatedSize: 0, - dailyDataGeneration: 0, - tracesPerMinute: 0, - numberOfServices: 0, -}; +import { getIndexManagementHref } from './get_storage_explorer_links'; export function SummaryStats() { const router = useApmRouter(); const { core } = useApmPluginContext(); - const { euiTheme } = useEuiTheme(); const { query: { @@ -63,7 +61,7 @@ export function SummaryStats() { }, }); - const { data = INITIAL_DATA, status } = useProgressiveFetcher( + const { data, status } = useProgressiveFetcher( (callApmApi) => { return callApmApi('GET /internal/apm/storage_explorer_summary_stats', { params: { @@ -80,92 +78,137 @@ export function SummaryStats() { [indexLifecyclePhase, environment, kuery, start, end] ); - const loading = status === FETCH_STATUS.LOADING; + const loading = + status === FETCH_STATUS.LOADING || status === FETCH_STATUS.NOT_INITIATED; + + const hasData = !isEmpty(data); return ( - <EuiPanel hasBorder={true} hasShadow={false} paddingSize="l"> - {loading && ( - <EuiText textAlign="center"> - <EuiLoadingSpinner size="l" /> - </EuiText> - )} - {!loading && ( - <EuiFlexGroup justifyContent="spaceBetween"> - <EuiFlexItem> - <EuiFlexGroup gutterSize="xl"> - <SummaryMetric - label={i18n.translate( - 'xpack.apm.storageExplorer.summary.totalSize', - { - defaultMessage: 'Total APM size', - } - )} - value={asDynamicBytes(data?.estimatedSize)} - color={euiTheme.colors.primary} - /> - <SummaryMetric - label={i18n.translate( - 'xpack.apm.storageExplorer.summary.dailyDataGeneration', - { - defaultMessage: 'Daily data generation', - } - )} - value={asDynamicBytes(data?.dailyDataGeneration)} - color={euiTheme.colors.danger} - /> - <SummaryMetric - label={i18n.translate( - 'xpack.apm.storageExplorer.summary.tracesPerMinute', + <EuiPanel + hasBorder={true} + hasShadow={false} + paddingSize="l" + style={{ position: 'relative' }} + > + {loading && <EuiProgress size="xs" color="accent" position="absolute" />} + <EuiFlexGroup justifyContent="spaceBetween"> + <EuiFlexItem> + <EuiFlexGroup gutterSize="xl"> + <SummaryMetric + label={i18n.translate( + 'xpack.apm.storageExplorer.summary.totalSize', + { + defaultMessage: 'Total APM size', + } + )} + tooltipContent={i18n.translate( + 'xpack.apm.storageExplorer.summary.totalSize.tooltip', + { + defaultMessage: + 'Total storage size of all the APM indices currently, ignoring all filters.', + } + )} + value={asDynamicBytes(data?.totalSize)} + loading={loading} + hasData={hasData} + /> + <SummaryMetric + label={i18n.translate( + 'xpack.apm.storageExplorer.summary.diskSpaceUsedPct', + { + defaultMessage: 'Disk space used', + } + )} + tooltipContent={i18n.translate( + 'xpack.apm.storageExplorer.summary.diskSpaceUsedPct.tooltip', + { + defaultMessage: + 'The percentage of the storage capacity that is currently used by all the APM indices compared to the max. storage capacity currently configured for Elasticsearch.', + } + )} + value={asPercent(data?.diskSpaceUsedPct, 1)} + loading={loading} + hasData={hasData} + /> + <SummaryMetric + label={i18n.translate( + 'xpack.apm.storageExplorer.summary.incrementalSize', + { + defaultMessage: 'Incremental APM size', + } + )} + tooltipContent={i18n.translate( + 'xpack.apm.storageExplorer.summary.incrementalSize.tooltip', + { + defaultMessage: + 'The estimated storage size used by the APM indices based on the filters selected.', + } + )} + value={asDynamicBytes(data?.estimatedIncrementalSize)} + loading={loading} + hasData={hasData} + /> + <SummaryMetric + label={i18n.translate( + 'xpack.apm.storageExplorer.summary.dailyDataGeneration', + { + defaultMessage: 'Daily data generation', + } + )} + value={asDynamicBytes(data?.dailyDataGeneration)} + loading={loading} + hasData={hasData} + /> + <SummaryMetric + label={i18n.translate( + 'xpack.apm.storageExplorer.summary.tracesPerMinute', + { + defaultMessage: 'Traces per minute', + } + )} + value={asTransactionRate(data?.tracesPerMinute)} + loading={loading} + hasData={hasData} + /> + <SummaryMetric + label={i18n.translate( + 'xpack.apm.storageExplorer.summary.numberOfServices', + { + defaultMessage: 'Number of services', + } + )} + value={(data?.numberOfServices ?? 0).toString()} + loading={loading} + hasData={hasData} + /> + </EuiFlexGroup> + </EuiFlexItem> + + <EuiFlexItem grow={false}> + <EuiFlexGroup direction="column" justifyContent="spaceBetween"> + <EuiFlexItem> + <EuiLink href={serviceInventoryLink}> + {i18n.translate( + 'xpack.apm.storageExplorer.summary.serviceInventoryLink', { - defaultMessage: 'Traces per minute', + defaultMessage: 'Go to Service Inventory', } )} - value={asTransactionRate(data?.tracesPerMinute)} - color={euiTheme.colors.accent} - /> - <SummaryMetric - label={i18n.translate( - 'xpack.apm.storageExplorer.summary.numberOfServices', + </EuiLink> + </EuiFlexItem> + <EuiFlexItem> + <EuiLink href={getIndexManagementHref(core)}> + {i18n.translate( + 'xpack.apm.storageExplorer.summary.indexManagementLink', { - defaultMessage: 'Number of services', + defaultMessage: 'Go to Index Management', } )} - value={data?.numberOfServices.toString()} - color={euiTheme.colors.success} - /> - </EuiFlexGroup> - </EuiFlexItem> - - <EuiFlexItem grow={false}> - <EuiFlexGroup direction="column" justifyContent="spaceBetween"> - <EuiFlexItem> - <EuiLink href={serviceInventoryLink}> - {i18n.translate( - 'xpack.apm.storageExplorer.summary.serviceInventoryLink', - { - defaultMessage: 'Go to Service Inventory', - } - )} - </EuiLink> - </EuiFlexItem> - <EuiFlexItem> - <EuiLink - href={core.http.basePath.prepend( - '/app/management/data/index_management/data_streams' - )} - > - {i18n.translate( - 'xpack.apm.storageExplorer.summary.indexManagementLink', - { - defaultMessage: 'Go to Index Management', - } - )} - </EuiLink> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - </EuiFlexGroup> - )} + </EuiLink> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> </EuiPanel> ); } @@ -173,29 +216,55 @@ export function SummaryStats() { function SummaryMetric({ label, value, - color, + tooltipContent, + loading, + hasData, }: { label: string; value: string; - color: string; + tooltipContent?: string; + loading: boolean; + hasData: boolean; }) { - const xxlFontSize = useEuiFontSize('xxl', { measurement: 'px' }); + const xlFontSize = useEuiFontSize('xl', { measurement: 'px' }); const { euiTheme } = useEuiTheme(); return ( <EuiFlexItem grow={false}> - <EuiText size="s" color="subdued"> - {label} - </EuiText> - <EuiText - css={css` - ${xxlFontSize} - font-weight: ${euiTheme.font.weight.bold}; - color: ${color}; - `} - > - {value} - </EuiText> + {tooltipContent ? ( + <EuiToolTip content={tooltipContent}> + <EuiText size="s" color="subdued"> + {label}{' '} + <EuiIcon + size="s" + color="subdued" + type="questionInCircle" + className="eui-alignTop" + /> + </EuiText> + </EuiToolTip> + ) : ( + <EuiText size="s" color="subdued"> + {label} + </EuiText> + )} + {loading && !hasData && ( + <> + <EuiSpacer size="s" /> + <EuiLoadingContent lines={2} /> + </> + )} + {hasData && ( + <EuiText + css={css` + ${xlFontSize} + font-weight: ${euiTheme.font.weight.bold}; + color: ${euiTheme.colors.text}; + `} + > + {value} + </EuiText> + )} </EuiFlexItem> ); } diff --git a/x-pack/plugins/apm/public/components/app/top_traces_overview/index.tsx b/x-pack/plugins/apm/public/components/app/top_traces_overview/index.tsx index 37eaf27bfb562..685074155c380 100644 --- a/x-pack/plugins/apm/public/components/app/top_traces_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/top_traces_overview/index.tsx @@ -44,18 +44,20 @@ export function TopTracesOverview() { ); return ( - <> - <SearchBar /> + <EuiFlexGroup direction="column"> + <EuiFlexItem grow={false}> + <SearchBar /> + </EuiFlexItem> {fallbackToTransactions && ( - <EuiFlexGroup> - <EuiFlexItem> - <AggregatedTransactionsBadge /> - </EuiFlexItem> - </EuiFlexGroup> + <EuiFlexItem grow={false}> + <AggregatedTransactionsBadge /> + </EuiFlexItem> )} - <TraceList response={response} /> - </> + <EuiFlexItem grow> + <TraceList response={response} /> + </EuiFlexItem> + </EuiFlexGroup> ); } diff --git a/x-pack/plugins/apm/public/components/app/trace_explorer/index.tsx b/x-pack/plugins/apm/public/components/app/trace_explorer/index.tsx index 47287084386ad..74b38ea153558 100644 --- a/x-pack/plugins/apm/public/components/app/trace_explorer/index.tsx +++ b/x-pack/plugins/apm/public/components/app/trace_explorer/index.tsx @@ -4,7 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiTab, EuiTabs } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import React, { useEffect, useMemo, useState } from 'react'; import { useHistory } from 'react-router-dom'; import { @@ -12,42 +13,38 @@ import { TraceSearchType, } from '../../../../common/trace_explorer'; import { useApmParams } from '../../../hooks/use_apm_params'; -import { useFetcher } from '../../../hooks/use_fetcher'; +import { useApmRouter } from '../../../hooks/use_apm_router'; +import { useApmRoutePath } from '../../../hooks/use_apm_route_path'; import { useTimeRange } from '../../../hooks/use_time_range'; +import { TraceExplorerSamplesFetcherContextProvider } from '../../../hooks/use_trace_explorer_samples'; +import { APIClientRequestParamsOf } from '../../../services/rest/create_call_apm_api'; import { ApmDatePicker } from '../../shared/date_picker/apm_date_picker'; -import { fromQuery, toQuery, push } from '../../shared/links/url_helpers'; -import { useWaterfallFetcher } from '../transaction_details/use_waterfall_fetcher'; -import { WaterfallWithSummary } from '../transaction_details/waterfall_with_summary'; +import { push } from '../../shared/links/url_helpers'; +import { TechnicalPreviewBadge } from '../../shared/technical_preview_badge'; +import { TransactionTab } from '../transaction_details/waterfall_with_summary/transaction_tabs'; import { TraceSearchBox } from './trace_search_box'; -const INITIAL_DATA = { - traceSamples: [], -}; - -export function TraceExplorer() { - const [query, setQuery] = useState<TraceSearchQuery>({ +export function TraceExplorer({ children }: { children: React.ReactElement }) { + const [searchQuery, setSearchQuery] = useState<TraceSearchQuery>({ query: '', type: TraceSearchType.kql, }); const { + query, query: { rangeFrom, rangeTo, environment, query: queryFromUrlParams, type: typeFromUrlParams, - traceId, - transactionId, - waterfallItemId, - detailTab, }, } = useApmParams('/traces/explorer'); const history = useHistory(); useEffect(() => { - setQuery({ + setSearchQuery({ query: queryFromUrlParams, type: typeFromUrlParams, }); @@ -58,115 +55,95 @@ export function TraceExplorer() { rangeTo, }); - const { - data = INITIAL_DATA, - status, - error, - } = useFetcher( - (callApmApi) => { - return callApmApi('GET /internal/apm/traces/find', { - params: { - query: { - start, - end, - environment, - query: queryFromUrlParams, - type: typeFromUrlParams, - }, - }, - }); - }, - [start, end, environment, queryFromUrlParams, typeFromUrlParams] - ); + const params = useMemo< + APIClientRequestParamsOf<'GET /internal/apm/traces/find'>['params'] + >(() => { + return { + query: { + start, + end, + environment, + query: queryFromUrlParams, + type: typeFromUrlParams, + }, + }; + }, [start, end, environment, queryFromUrlParams, typeFromUrlParams]); - useEffect(() => { - const nextSample = data.traceSamples[0]; - const nextWaterfallItemId = ''; - history.replace({ - ...history.location, - search: fromQuery({ - ...toQuery(history.location.search), - traceId: nextSample?.traceId ?? '', - transactionId: nextSample?.transactionId, - waterfallItemId: nextWaterfallItemId, - }), - }); - }, [data, history]); - - const waterfallFetchResult = useWaterfallFetcher({ - traceId, - transactionId, - start, - end, - }); + const router = useApmRouter(); - const traceSamplesFetchResult = useMemo( - () => ({ - data, - status, - error, - }), - [data, status, error] - ); + const routePath = useApmRoutePath(); return ( - <EuiFlexGroup direction="column" gutterSize="s"> - <EuiFlexItem> - <EuiFlexGroup direction="row"> - <EuiFlexItem grow> - <TraceSearchBox - query={query} - error={false} - loading={false} - onQueryCommit={() => { - history.push({ - ...history.location, - search: fromQuery({ - ...toQuery(history.location.search), - query: query.query, - type: query.type, - }), - }); - }} - onQueryChange={(nextQuery) => { - setQuery(nextQuery); - }} - /> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <ApmDatePicker /> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - <EuiFlexItem> - <WaterfallWithSummary - waterfallFetchResult={waterfallFetchResult} - traceSamplesFetchResult={traceSamplesFetchResult} - environment={environment} - onSampleClick={(sample) => { - push(history, { - query: { - traceId: sample.traceId, - transactionId: sample.transactionId, - waterfallItemId: '', - }, - }); - }} - onTabClick={(nextDetailTab) => { - push(history, { - query: { - detailTab: nextDetailTab, - }, - }); - }} - detailTab={detailTab} - waterfallItemId={waterfallItemId} - serviceName={ - waterfallFetchResult.waterfall.entryWaterfallTransaction?.doc - .service.name - } - /> - </EuiFlexItem> - </EuiFlexGroup> + <TraceExplorerSamplesFetcherContextProvider params={params}> + <EuiFlexGroup direction="column" gutterSize="s"> + <EuiFlexItem grow={false}> + <EuiFlexGroup direction="row"> + <EuiFlexItem grow> + <TraceSearchBox + query={searchQuery} + error={false} + loading={false} + onQueryCommit={() => { + push(history, { + query: { + query: searchQuery.query, + type: searchQuery.type, + }, + }); + }} + onQueryChange={(nextQuery) => { + setSearchQuery(nextQuery); + }} + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <ApmDatePicker /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiTabs> + <EuiTab + href={router.link('/traces/explorer/waterfall', { + query: { + ...query, + traceId: '', + transactionId: '', + waterfallItemId: '', + detailTab: TransactionTab.timeline, + }, + })} + isSelected={routePath === '/traces/explorer/waterfall'} + > + {i18n.translate('xpack.apm.traceExplorer.waterfallTab', { + defaultMessage: 'Waterfall', + })} + </EuiTab> + <EuiTab + href={router.link('/traces/explorer/critical_path', { + query, + })} + isSelected={routePath === '/traces/explorer/critical_path'} + > + <EuiFlexGroup direction="row" gutterSize="s"> + <EuiFlexItem grow={false}> + {i18n.translate('xpack.apm.traceExplorer.criticalPathTab', { + defaultMessage: 'Aggregated critical path', + })} + </EuiFlexItem> + <EuiFlexItem grow={false}> + <TechnicalPreviewBadge + icon="beaker" + size="s" + style={{ verticalAlign: 'middle' }} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiTab> + </EuiTabs> + </EuiFlexItem> + <EuiFlexItem>{children}</EuiFlexItem> + </EuiFlexGroup> + </TraceExplorerSamplesFetcherContextProvider> ); } diff --git a/x-pack/plugins/apm/public/components/app/trace_explorer/trace_explorer_aggregated_critical_path.tsx b/x-pack/plugins/apm/public/components/app/trace_explorer/trace_explorer_aggregated_critical_path.tsx new file mode 100644 index 0000000000000..6ff12fac2351a --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/trace_explorer/trace_explorer_aggregated_critical_path.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, { useMemo } from 'react'; +import { useApmParams } from '../../../hooks/use_apm_params'; +import { useTimeRange } from '../../../hooks/use_time_range'; +import { useTraceExplorerSamples } from '../../../hooks/use_trace_explorer_samples'; +import { CriticalPathFlamegraph } from '../../shared/critical_path_flamegraph'; + +export function TraceExplorerAggregatedCriticalPath() { + const { + query: { rangeFrom, rangeTo }, + } = useApmParams('/traces/explorer/critical_path'); + + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + + const { + data: { traceSamples }, + status: samplesFetchStatus, + } = useTraceExplorerSamples(); + + const traceIds = useMemo(() => { + return traceSamples.map((sample) => sample.traceId); + }, [traceSamples]); + + return ( + <CriticalPathFlamegraph + start={start} + end={end} + traceIds={traceIds} + traceIdsFetchStatus={samplesFetchStatus} + /> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/trace_explorer/trace_explorer_waterfall.tsx b/x-pack/plugins/apm/public/components/app/trace_explorer/trace_explorer_waterfall.tsx new file mode 100644 index 0000000000000..5c25421869da4 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/trace_explorer/trace_explorer_waterfall.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 React, { useEffect } from 'react'; +import { useHistory } from 'react-router-dom'; +import { useApmParams } from '../../../hooks/use_apm_params'; +import { useTimeRange } from '../../../hooks/use_time_range'; +import { useTraceExplorerSamples } from '../../../hooks/use_trace_explorer_samples'; +import { push, replace } from '../../shared/links/url_helpers'; +import { useWaterfallFetcher } from '../transaction_details/use_waterfall_fetcher'; +import { WaterfallWithSummary } from '../transaction_details/waterfall_with_summary'; + +export function TraceExplorerWaterfall() { + const history = useHistory(); + + const traceSamplesFetchResult = useTraceExplorerSamples(); + + const { + query: { + traceId, + transactionId, + waterfallItemId, + rangeFrom, + rangeTo, + environment, + showCriticalPath, + detailTab, + }, + } = useApmParams('/traces/explorer/waterfall'); + + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + + useEffect(() => { + const nextSample = traceSamplesFetchResult.data?.traceSamples[0]; + const nextWaterfallItemId = ''; + replace(history, { + query: { + traceId: nextSample?.traceId ?? '', + transactionId: nextSample?.transactionId ?? '', + waterfallItemId: nextWaterfallItemId, + }, + }); + }, [traceSamplesFetchResult.data, history]); + + const waterfallFetchResult = useWaterfallFetcher({ + traceId, + transactionId, + start, + end, + }); + + return ( + <WaterfallWithSummary + waterfallFetchResult={waterfallFetchResult} + traceSamples={traceSamplesFetchResult.data.traceSamples} + traceSamplesFetchStatus={traceSamplesFetchResult.status} + environment={environment} + onSampleClick={(sample) => { + push(history, { + query: { + traceId: sample.traceId, + transactionId: sample.transactionId, + waterfallItemId: '', + }, + }); + }} + onTabClick={(nextDetailTab) => { + push(history, { + query: { + detailTab: nextDetailTab, + }, + }); + }} + detailTab={detailTab} + waterfallItemId={waterfallItemId} + serviceName={ + waterfallFetchResult.waterfall.entryWaterfallTransaction?.doc.service + .name + } + showCriticalPath={showCriticalPath} + onShowCriticalPathChange={(nextShowCriticalPath) => { + push(history, { + query: { + showCriticalPath: nextShowCriticalPath ? 'true' : 'false', + }, + }); + }} + /> + ); +} diff --git a/x-pack/plugins/apm/public/components/app/trace_overview/index.tsx b/x-pack/plugins/apm/public/components/app/trace_overview/index.tsx index 1093a74f6bc2f..7e48b1bb1a60b 100644 --- a/x-pack/plugins/apm/public/components/app/trace_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/trace_overview/index.tsx @@ -4,16 +4,22 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiTab, EuiTabs } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { useApmRouter } from '../../../hooks/use_apm_router'; +import React from 'react'; +import { TraceSearchType } from '../../../../common/trace_explorer'; import { useApmParams } from '../../../hooks/use_apm_params'; +import { useApmRouter } from '../../../hooks/use_apm_router'; import { useApmRoutePath } from '../../../hooks/use_apm_route_path'; -import { TraceSearchType } from '../../../../common/trace_explorer'; -import { TransactionTab } from '../transaction_details/waterfall_with_summary/transaction_tabs'; import { useTraceExplorerEnabledSetting } from '../../../hooks/use_trace_explorer_enabled_setting'; +import { ApmMainTemplate } from '../../routing/templates/apm_main_template'; import { TechnicalPreviewBadge } from '../../shared/technical_preview_badge'; +import { Breadcrumb } from '../breadcrumb'; +import { TransactionTab } from '../transaction_details/waterfall_with_summary/transaction_tabs'; + +type Tab = Required< + Required<React.ComponentProps<typeof ApmMainTemplate>>['pageHeader'] +>['tabs'][number]; export function TraceOverview({ children }: { children: React.ReactElement }) { const isTraceExplorerEnabled = useTraceExplorerEnabledSetting(); @@ -24,11 +30,7 @@ export function TraceOverview({ children }: { children: React.ReactElement }) { const routePath = useApmRoutePath(); - if (!isTraceExplorerEnabled) { - return children; - } - - const explorerLink = router.link('/traces/explorer', { + const topTracesLink = router.link('/traces', { query: { comparisonEnabled: query.comparisonEnabled, environment: query.environment, @@ -38,16 +40,14 @@ export function TraceOverview({ children }: { children: React.ReactElement }) { offset: query.offset, refreshInterval: query.refreshInterval, refreshPaused: query.refreshPaused, - query: '', - type: TraceSearchType.kql, - waterfallItemId: '', - traceId: '', - transactionId: '', - detailTab: TransactionTab.timeline, }, }); - const topTracesLink = router.link('/traces', { + const title = i18n.translate('xpack.apm.views.traceOverview.title', { + defaultMessage: 'Traces', + }); + + const explorerLink = router.link('/traces/explorer/waterfall', { query: { comparisonEnabled: query.comparisonEnabled, environment: query.environment, @@ -57,30 +57,65 @@ export function TraceOverview({ children }: { children: React.ReactElement }) { offset: query.offset, refreshInterval: query.refreshInterval, refreshPaused: query.refreshPaused, + query: '', + type: TraceSearchType.kql, + waterfallItemId: '', + traceId: '', + transactionId: '', + detailTab: TransactionTab.timeline, + showCriticalPath: false, }, }); + const tabs: Tab[] = isTraceExplorerEnabled + ? [ + { + href: topTracesLink, + label: i18n.translate('xpack.apm.traceOverview.topTracesTab', { + defaultMessage: 'Top traces', + }), + isSelected: routePath === '/traces', + }, + { + href: explorerLink, + label: ( + <EuiFlexGroup gutterSize="s"> + <EuiFlexItem grow={false}> + {i18n.translate('xpack.apm.traceOverview.traceExplorerTab', { + defaultMessage: 'Explorer', + })} + </EuiFlexItem> + <EuiFlexItem grow={false}> + <TechnicalPreviewBadge + icon="beaker" + style={{ verticalAlign: 'middle' }} + /> + </EuiFlexItem> + </EuiFlexGroup> + ), + isSelected: routePath.startsWith('/traces/explorer'), + }, + ] + : []; + return ( - <EuiFlexGroup direction="column"> - <EuiFlexItem> - <EuiTabs size="l"> - <EuiTab href={topTracesLink} isSelected={routePath === '/traces'}> - {i18n.translate('xpack.apm.traceOverview.topTracesTab', { - defaultMessage: 'Top traces', - })} - </EuiTab> - <EuiTab - href={explorerLink} - append={<TechnicalPreviewBadge icon="beaker" />} - isSelected={routePath === '/traces/explorer'} - > - {i18n.translate('xpack.apm.traceOverview.traceExplorerTab', { - defaultMessage: 'Explorer', - })} - </EuiTab> - </EuiTabs> - </EuiFlexItem> - <EuiFlexItem>{children}</EuiFlexItem> - </EuiFlexGroup> + <Breadcrumb href="/traces" title={title}> + <ApmMainTemplate + pageTitle={title} + pageSectionProps={{ + contentProps: { + style: { + display: 'flex', + flexGrow: 1, + }, + }, + }} + pageHeader={{ + tabs, + }} + > + {children} + </ApmMainTemplate> + </Breadcrumb> ); } diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/aggregated_critical_path_tab.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/aggregated_critical_path_tab.tsx new file mode 100644 index 0000000000000..3a6f479a61254 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/transaction_details/aggregated_critical_path_tab.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 { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React, { useMemo } from 'react'; +import { useApmParams } from '../../../hooks/use_apm_params'; +import { useTimeRange } from '../../../hooks/use_time_range'; +import { CriticalPathFlamegraph } from '../../shared/critical_path_flamegraph'; +import { TechnicalPreviewBadge } from '../../shared/technical_preview_badge'; +import { TabContentProps } from './transaction_details_tabs'; + +function TransactionDetailAggregatedCriticalPath({ + traceSamplesFetchResult, +}: TabContentProps) { + const { + path: { serviceName }, + query: { rangeFrom, rangeTo, transactionName }, + } = useApmParams('/services/{serviceName}/transactions/view'); + + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + + const traceIds = useMemo(() => { + return ( + traceSamplesFetchResult.data?.traceSamples.map( + (sample) => sample.traceId + ) ?? [] + ); + }, [traceSamplesFetchResult.data]); + + return ( + <CriticalPathFlamegraph + start={start} + end={end} + traceIdsFetchStatus={traceSamplesFetchResult.status} + traceIds={traceIds} + serviceName={serviceName} + transactionName={transactionName} + /> + ); +} + +export const aggregatedCriticalPathTab = { + dataTestSubj: 'apmAggregatedCriticalPathTabButton', + key: 'aggregatedCriticalPath', + label: ( + <EuiFlexGroup gutterSize="s" direction="row"> + <EuiFlexItem grow={false}> + {i18n.translate( + 'xpack.apm.transactionDetails.tabs.aggregatedCriticalPathLabel', + { + defaultMessage: 'Aggregated critical path', + } + )} + </EuiFlexItem> + <EuiFlexItem> + <TechnicalPreviewBadge + icon="beaker" + size="s" + style={{ verticalAlign: 'middle' }} + /> + </EuiFlexItem> + </EuiFlexGroup> + ), + component: TransactionDetailAggregatedCriticalPath, +}; diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx index 73b224d60aaa4..72bf5a048e9e7 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx @@ -21,7 +21,7 @@ import { useApmParams } from '../../../../hooks/use_apm_params'; import { useTimeRange } from '../../../../hooks/use_time_range'; import { DurationDistributionChartWithScrubber } from '../../../shared/charts/duration_distribution_chart_with_scrubber'; import { HeightRetainer } from '../../../shared/height_retainer'; -import { fromQuery, toQuery } from '../../../shared/links/url_helpers'; +import { fromQuery, push, toQuery } from '../../../shared/links/url_helpers'; import { TransactionTab } from '../waterfall_with_summary/transaction_tabs'; import { useTransactionDistributionChartData } from './use_transaction_distribution_chart_data'; import { TraceSamplesFetchResult } from '../../../../hooks/use_transaction_trace_samples_fetcher'; @@ -43,7 +43,7 @@ export function TransactionDistribution({ const { traceId, transactionId } = urlParams; const { - query: { rangeFrom, rangeTo }, + query: { rangeFrom, rangeTo, showCriticalPath }, } = useApmParams('/services/{serviceName}/transactions/view'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -117,7 +117,16 @@ export function TransactionDistribution({ waterfallItemId={waterfallItemId} detailTab={detailTab as TransactionTab | undefined} waterfallFetchResult={waterfallFetchResult} - traceSamplesFetchResult={traceSamplesFetchResult} + traceSamplesFetchStatus={traceSamplesFetchResult.status} + traceSamples={traceSamplesFetchResult.data?.traceSamples} + showCriticalPath={showCriticalPath} + onShowCriticalPathChange={(nextShowCriticalPath) => { + push(history, { + query: { + showCriticalPath: nextShowCriticalPath ? 'true' : 'false', + }, + }); + }} /> </div> </HeightRetainer> diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/transaction_details_tabs.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/transaction_details_tabs.tsx index c99703d4f90f8..866c94702fb00 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/transaction_details_tabs.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/transaction_details_tabs.tsx @@ -27,6 +27,8 @@ import { latencyCorrelationsTab } from './latency_correlations_tab'; import { traceSamplesTab } from './trace_samples_tab'; import { useSampleChartSelection } from '../../../hooks/use_sample_chart_selection'; import { FETCH_STATUS } from '../../../hooks/use_fetcher'; +import { useCriticalPathFeatureEnabledSetting } from '../../../hooks/use_critical_path_feature_enabled_setting'; +import { aggregatedCriticalPathTab } from './aggregated_critical_path_tab'; export interface TabContentProps { clearChartSelection: () => void; @@ -46,12 +48,18 @@ const tabs = [ export function TransactionDetailsTabs() { const { query } = useApmParams('/services/{serviceName}/transactions/view'); + const isCriticalPathFeatureEnabled = useCriticalPathFeatureEnabledSetting(); + + const availableTabs = isCriticalPathFeatureEnabled + ? tabs.concat(aggregatedCriticalPathTab) + : tabs; + const { urlParams } = useLegacyUrlParams(); const history = useHistory(); const [currentTab, setCurrentTab] = useState(traceSamplesTab.key); const { component: TabContent } = - tabs.find((tab) => tab.key === currentTab) ?? traceSamplesTab; + availableTabs.find((tab) => tab.key === currentTab) ?? traceSamplesTab; const { environment, kuery, transactionName } = query; @@ -107,7 +115,7 @@ export function TransactionDetailsTabs() { return ( <> <EuiTabs> - {tabs.map(({ dataTestSubj, key, label }) => ( + {availableTabs.map(({ dataTestSubj, key, label }) => ( <EuiTab data-test-subj={dataTestSubj} key={key} diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/index.tsx index 57d630393f9a9..508540d9e5ce3 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/index.tsx @@ -22,55 +22,71 @@ import { MaybeViewTraceLink } from './maybe_view_trace_link'; import { TransactionTab, TransactionTabs } from './transaction_tabs'; import { Environment } from '../../../../../common/environment_rt'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; -import { TraceSamplesFetchResult } from '../../../../hooks/use_transaction_trace_samples_fetcher'; import { WaterfallFetchResult } from '../use_waterfall_fetcher'; -interface Props { +interface Props<TSample extends {}> { waterfallFetchResult: WaterfallFetchResult; - traceSamplesFetchResult: TraceSamplesFetchResult; + traceSamples?: TSample[]; + traceSamplesFetchStatus: FETCH_STATUS; environment: Environment; - onSampleClick: (sample: { transactionId: string; traceId: string }) => void; - onTabClick: (tab: string) => void; + onSampleClick: (sample: TSample) => void; + onTabClick: (tab: TransactionTab) => void; serviceName?: string; waterfallItemId?: string; detailTab?: TransactionTab; + showCriticalPath: boolean; + onShowCriticalPathChange: (showCriticalPath: boolean) => void; + selectedSample?: TSample | null; } -export function WaterfallWithSummary({ +export function WaterfallWithSummary<TSample extends {}>({ waterfallFetchResult, - traceSamplesFetchResult, + traceSamples, + traceSamplesFetchStatus, environment, onSampleClick, onTabClick, serviceName, waterfallItemId, detailTab, -}: Props) { + showCriticalPath, + onShowCriticalPathChange, + selectedSample, +}: Props<TSample>) { const [sampleActivePage, setSampleActivePage] = useState(0); + const isControlled = selectedSample !== undefined; + + const isLoading = + waterfallFetchResult.status === FETCH_STATUS.LOADING || + traceSamplesFetchStatus === FETCH_STATUS.LOADING; + const isSucceded = + waterfallFetchResult.status === FETCH_STATUS.SUCCESS && + traceSamplesFetchStatus === FETCH_STATUS.SUCCESS; + useEffect(() => { - setSampleActivePage(0); - }, [traceSamplesFetchResult.data.traceSamples]); + if (!isControlled) { + setSampleActivePage(0); + } + }, [traceSamples, isControlled]); const goToSample = (index: number) => { - setSampleActivePage(index); - const sample = traceSamplesFetchResult.data.traceSamples[index]; + const sample = traceSamples![index]; + if (!isControlled) { + setSampleActivePage(index); + } onSampleClick(sample); }; + const samplePageIndex = isControlled + ? selectedSample + ? traceSamples?.indexOf(selectedSample) + : 0 + : sampleActivePage; + const { entryWaterfallTransaction } = waterfallFetchResult.waterfall; - const isLoading = - waterfallFetchResult.status === FETCH_STATUS.LOADING || - traceSamplesFetchResult.status === FETCH_STATUS.LOADING; - const isSucceded = - waterfallFetchResult.status === FETCH_STATUS.SUCCESS && - traceSamplesFetchResult.status === FETCH_STATUS.SUCCESS; - if ( - !entryWaterfallTransaction && - traceSamplesFetchResult.data.traceSamples.length === 0 && - isSucceded - ) { + if (!entryWaterfallTransaction && traceSamples?.length === 0 && isSucceded) { return ( <EuiEmptyPrompt title={ @@ -88,78 +104,85 @@ export function WaterfallWithSummary({ const entryTransaction = entryWaterfallTransaction?.doc; return ( - <> - <EuiFlexGroup alignItems="center"> - <EuiFlexItem grow={false}> - <EuiTitle size="xs"> - <h5> - {i18n.translate('xpack.apm.transactionDetails.traceSampleTitle', { - defaultMessage: 'Trace sample', - })} - </h5> - </EuiTitle> - </EuiFlexItem> - <EuiFlexItem> - {traceSamplesFetchResult.data.traceSamples.length > 0 && ( - <EuiPagination - pageCount={traceSamplesFetchResult.data.traceSamples.length} - activePage={sampleActivePage} - onPageClick={goToSample} - compressed - /> - )} - </EuiFlexItem> - <EuiFlexItem> - <EuiFlexGroup justifyContent="flexEnd"> - <EuiFlexItem grow={false}> - <TransactionActionMenu - isLoading={isLoading} - transaction={entryTransaction} + <EuiFlexGroup direction="column" gutterSize="s"> + <EuiFlexItem grow={false}> + <EuiFlexGroup alignItems="center"> + <EuiFlexItem grow={false}> + <EuiTitle size="xs"> + <h5> + {i18n.translate( + 'xpack.apm.transactionDetails.traceSampleTitle', + { + defaultMessage: 'Trace sample', + } + )} + </h5> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem grow> + {!!traceSamples?.length && ( + <EuiPagination + pageCount={traceSamples.length} + activePage={samplePageIndex} + onPageClick={goToSample} + compressed /> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <MaybeViewTraceLink - isLoading={isLoading} - transaction={entryTransaction} - waterfall={waterfallFetchResult.waterfall} - environment={environment} - /> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - </EuiFlexGroup> - - <EuiSpacer size="s" /> + )} + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiFlexGroup justifyContent="flexEnd"> + <EuiFlexItem grow={false}> + <TransactionActionMenu + isLoading={isLoading} + transaction={entryTransaction} + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <MaybeViewTraceLink + isLoading={isLoading} + transaction={entryTransaction} + waterfall={waterfallFetchResult.waterfall} + environment={environment} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> {isLoading || !entryTransaction ? ( - <> + <EuiFlexItem grow={false}> <EuiSpacer size="s" /> <EuiLoadingContent lines={1} data-test-sub="loading-content" /> - </> + </EuiFlexItem> ) : ( - <TransactionSummary - errorCount={ - waterfallFetchResult.waterfall.apiResponse.errorDocs.length - } - totalDuration={ - waterfallFetchResult.waterfall.rootTransaction?.transaction.duration - .us - } - transaction={entryTransaction} - /> + <EuiFlexItem grow={false}> + <TransactionSummary + errorCount={ + waterfallFetchResult.waterfall.apiResponse.errorDocs.length + } + totalDuration={ + waterfallFetchResult.waterfall.rootTransaction?.transaction + .duration.us + } + transaction={entryTransaction} + /> + </EuiFlexItem> )} - <EuiSpacer size="s" /> - - <TransactionTabs - transaction={entryTransaction} - detailTab={detailTab} - serviceName={serviceName} - waterfallItemId={waterfallItemId} - onTabClick={onTabClick} - waterfall={waterfallFetchResult.waterfall} - isLoading={isLoading} - /> - </> + <EuiFlexItem grow={false}> + <TransactionTabs + transaction={entryTransaction} + detailTab={detailTab} + serviceName={serviceName} + waterfallItemId={waterfallItemId} + onTabClick={onTabClick} + waterfall={waterfallFetchResult.waterfall} + isLoading={isLoading} + showCriticalPath={showCriticalPath} + onShowCriticalPathChange={onShowCriticalPathChange} + /> + </EuiFlexItem> + </EuiFlexGroup> ); } diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx index 1621ea72b39a1..40b1944605b58 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx @@ -53,7 +53,8 @@ export function MaybeViewTraceLink({ query: { comparisonEnabled, offset }, } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', - '/traces/explorer' + '/traces/explorer', + '/dependencies/operation' ); const latencyAggregationType = diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/transaction_tabs.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/transaction_tabs.tsx index e3fdaeea24846..85e8b36942936 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/transaction_tabs.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/transaction_tabs.tsx @@ -22,6 +22,8 @@ interface Props { serviceName?: string; waterfallItemId?: string; onTabClick: (tab: TransactionTab) => void; + showCriticalPath: boolean; + onShowCriticalPathChange: (showCriticalPath: boolean) => void; } export function TransactionTabs({ @@ -32,6 +34,8 @@ export function TransactionTabs({ waterfallItemId, serviceName, onTabClick, + showCriticalPath, + onShowCriticalPathChange, }: Props) { const tabs = [timelineTab, metadataTab, logsTab]; const currentTab = tabs.find(({ key }) => key === detailTab) ?? timelineTab; @@ -64,6 +68,8 @@ export function TransactionTabs({ serviceName={serviceName} waterfall={waterfall} transaction={transaction} + showCriticalPath={showCriticalPath} + onShowCriticalPathChange={onShowCriticalPathChange} /> )} </> @@ -104,16 +110,22 @@ function TimelineTabContent({ waterfall, waterfallItemId, serviceName, + showCriticalPath, + onShowCriticalPathChange, }: { waterfallItemId?: string; serviceName?: string; waterfall: IWaterfall; + showCriticalPath: boolean; + onShowCriticalPathChange: (showCriticalPath: boolean) => void; }) { return ( <WaterfallContainer waterfallItemId={waterfallItemId} serviceName={serviceName} waterfall={waterfall} + showCriticalPath={showCriticalPath} + onShowCriticalPathChange={onShowCriticalPathChange} /> ); } diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/index.tsx index 2dd74aeae3eef..b9f149c32e491 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/index.tsx @@ -5,26 +5,36 @@ * 2.0. */ -import React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiSwitch } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import { keyBy } from 'lodash'; +import React from 'react'; +import { useCriticalPathFeatureEnabledSetting } from '../../../../../hooks/use_critical_path_feature_enabled_setting'; +import { TechnicalPreviewBadge } from '../../../../shared/technical_preview_badge'; +import { Waterfall } from './waterfall'; import { IWaterfall, WaterfallLegendType, } from './waterfall/waterfall_helpers/waterfall_helpers'; -import { Waterfall } from './waterfall'; import { WaterfallLegends } from './waterfall_legends'; interface Props { waterfallItemId?: string; serviceName?: string; waterfall: IWaterfall; + showCriticalPath: boolean; + onShowCriticalPathChange: (showCriticalPath: boolean) => void; } export function WaterfallContainer({ serviceName, waterfallItemId, waterfall, + showCriticalPath, + onShowCriticalPathChange, }: Props) { + const isCriticalPathFeatureEnabled = useCriticalPathFeatureEnabledSetting(); + if (!waterfall) { return null; } @@ -74,9 +84,40 @@ export function WaterfallContainer({ }); return ( - <div> - <WaterfallLegends legends={legendsWithFallbackLabel} type={colorBy} /> - <Waterfall waterfallItemId={waterfallItemId} waterfall={waterfall} /> - </div> + <EuiFlexGroup direction="column"> + {isCriticalPathFeatureEnabled ? ( + <EuiFlexItem> + <EuiSwitch + id="showCriticalPath" + label={ + <EuiFlexGroup gutterSize="s"> + <EuiFlexItem grow={false}> + {i18n.translate('xpack.apm.waterfall.showCriticalPath', { + defaultMessage: 'Show critical path', + })} + </EuiFlexItem> + <EuiFlexItem grow={false}> + <TechnicalPreviewBadge icon="beaker" /> + </EuiFlexItem> + </EuiFlexGroup> + } + checked={showCriticalPath} + onChange={(event) => { + onShowCriticalPathChange(event.target.checked); + }} + /> + </EuiFlexItem> + ) : null} + <EuiFlexItem> + <WaterfallLegends legends={legendsWithFallbackLabel} type={colorBy} /> + </EuiFlexItem> + <EuiFlexItem> + <Waterfall + showCriticalPath={showCriticalPath} + waterfallItemId={waterfallItemId} + waterfall={waterfall} + /> + </EuiFlexItem> + </EuiFlexGroup> ); } diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/accordion_waterfall.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/accordion_waterfall.tsx index c0932e041de1a..3b996bfb3cdd1 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/accordion_waterfall.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/accordion_waterfall.tsx @@ -15,12 +15,16 @@ import { } from '@elastic/eui'; import React, { Dispatch, SetStateAction, useEffect, useState } from 'react'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { groupBy } from 'lodash'; +import { transparentize } from 'polished'; import { Margins } from '../../../../../shared/charts/timeline'; import { IWaterfall, IWaterfallSpanOrTransaction, } from './waterfall_helpers/waterfall_helpers'; import { WaterfallItem } from './waterfall_item'; +import { getCriticalPath } from '../../../../../../../common/critical_path/get_critical_path'; +import { useTheme } from '../../../../../../hooks/use_theme'; interface AccordionWaterfallProps { isOpen: boolean; @@ -32,6 +36,7 @@ interface AccordionWaterfallProps { waterfall: IWaterfall; timelineMargins: Margins; onClickWaterfallItem: (item: IWaterfallSpanOrTransaction) => void; + showCriticalPath: boolean; } const ACCORDION_HEIGHT = '48px'; @@ -85,8 +90,11 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) { setMaxLevel, timelineMargins, onClickWaterfallItem, + showCriticalPath, } = props; + const theme = useTheme(); + const [isOpen, setIsOpen] = useState(props.isOpen); const [nextLevel] = useState(level + 1); @@ -94,7 +102,26 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) { setMaxLevel(nextLevel); }, [nextLevel, setMaxLevel]); - const children = waterfall.childrenByParentId[item.id] || []; + let children = waterfall.childrenByParentId[item.id] || []; + + const criticalPath = showCriticalPath + ? getCriticalPath(waterfall) + : undefined; + + const criticalPathSegmentsById = groupBy( + criticalPath?.segments, + (segment) => segment.item.id + ); + + let displayedColor = item.color; + + if (showCriticalPath) { + children = children.filter( + (child) => criticalPathSegmentsById[child.id]?.length + ); + displayedColor = transparentize(0.5, item.color); + } + const errorCount = waterfall.getErrorCount(item.id); // To indent the items creating the parent/child tree @@ -131,7 +158,7 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) { <WaterfallItem key={item.id} timelineMargins={timelineMargins} - color={item.color} + color={displayedColor} item={item} hasToggle={hasToggle} totalDuration={duration} @@ -141,6 +168,14 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) { onClick={() => { onClickWaterfallItem(item); }} + segments={criticalPathSegmentsById[item.id] + ?.filter((segment) => segment.self) + .map((segment) => ({ + color: theme.eui.euiColorAccent, + left: + (segment.offset - item.offset - item.skew) / item.duration, + width: segment.duration / item.duration, + }))} /> </EuiFlexItem> </EuiFlexGroup> diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx index 04c3734eebaff..d117cb2d982c1 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx @@ -52,8 +52,14 @@ const WaterfallItemsContainer = euiStyled.div` interface Props { waterfallItemId?: string; waterfall: IWaterfall; + showCriticalPath: boolean; } -export function Waterfall({ waterfall, waterfallItemId }: Props) { + +export function Waterfall({ + waterfall, + waterfallItemId, + showCriticalPath, +}: Props) { const history = useHistory(); const [isAccordionOpen, setIsAccordionOpen] = useState(true); const itemContainerHeight = 58; // TODO: This is a nasty way to calculate the height of the svg element. A better approach should be found @@ -119,6 +125,7 @@ export function Waterfall({ waterfall, waterfallItemId }: Props) { onClickWaterfallItem={(item: IWaterfallItem) => toggleFlyout({ history, item }) } + showCriticalPath={showCriticalPath} /> )} </WaterfallItemsContainer> diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx index 0b500cb79a746..59abacb1c325c 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx @@ -33,7 +33,8 @@ interface Props { export function StickySpanProperties({ span, transaction }: Props) { const { query } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', - '/traces/explorer' + '/traces/explorer', + '/dependencies/operation' ); const { environment, comparisonEnabled, offset } = query; diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx index 9bfff6a4ea89b..8057ee3a32b7d 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx @@ -83,6 +83,31 @@ const ItemText = euiStyled.span` } `; +const CriticalPathItemBar = euiStyled.div` + box-sizing: border-box; + position: relative; + height: ${({ theme }) => theme.eui.euiSizeS}; + top : ${({ theme }) => theme.eui.euiSizeS}; + min-width: 2px; + background-color: transparent; + display: flex; + flex-direction: row; +`; + +const CriticalPathItemSegment = euiStyled.div<{ + left: number; + width: number; + color: string; +}>` + box-sizing: border-box; + position: absolute; + height: ${({ theme }) => theme.eui.euiSizeS}; + left: ${(props) => props.left * 100}%; + width: ${(props) => props.width * 100}%; + min-width: 2px; + background-color: ${(props) => props.color}; +`; + interface IWaterfallItemProps { timelineMargins: Margins; totalDuration?: number; @@ -92,6 +117,11 @@ interface IWaterfallItemProps { isSelected: boolean; errorCount: number; marginLeftLevel: number; + segments?: Array<{ + left: number; + width: number; + color: string; + }>; onClick: () => unknown; } @@ -194,6 +224,7 @@ export function WaterfallItem({ errorCount, marginLeftLevel, onClick, + segments, }: IWaterfallItemProps) { const [widthFactor, setWidthFactor] = useState(1); const waterfallItemRef: React.RefObject<any> = useRef(null); @@ -217,7 +248,9 @@ export function WaterfallItem({ 100; const isCompositeSpan = item.docType === 'span' && item.doc.span.composite; + const itemBarStyle = getItemBarStyle(item, color, width, left); + const isServerlessColdstart = item.docType === 'transaction' && item.doc.faas?.coldstart; @@ -237,7 +270,19 @@ export function WaterfallItem({ style={itemBarStyle} color={isCompositeSpan ? 'transparent' : color} type={item.docType} - /> + > + {segments?.length ? ( + <CriticalPathItemBar> + {segments?.map((segment) => ( + <CriticalPathItemSegment + color={segment.color} + left={segment.left} + width={segment.width} + /> + ))} + </CriticalPathItemBar> + ) : null} + </ItemBar> <ItemText // using inline styles instead of props to avoid generating a css class for each item style={{ minWidth: `${Math.max(100 - left, 0)}%` }} > @@ -277,7 +322,8 @@ function RelatedErrors({ const theme = useTheme(); const { query } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', - '/traces/explorer' + '/traces/explorer', + '/dependencies/operation' ); let kuery = `${TRACE_ID} : "${item.doc.trace.id}"`; diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall_container.stories.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall_container.stories.tsx index a10518ab58e4c..0a08dcb166048 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall_container.stories.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall_container.stories.tsx @@ -8,6 +8,7 @@ import { Meta, Story } from '@storybook/react'; import React, { ComponentProps } from 'react'; import { MemoryRouter } from 'react-router-dom'; +import { noop } from 'lodash'; import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context'; import { WaterfallContainer } from '.'; import { getWaterfall } from './waterfall/waterfall_helpers/waterfall_helpers'; @@ -59,6 +60,8 @@ export const Example: Story<Args> = ({ serviceName={serviceName} waterfallItemId={waterfallItemId} waterfall={waterfall} + showCriticalPath={false} + onShowCriticalPathChange={noop} /> ); }; @@ -76,6 +79,8 @@ export const WithErrors: Story<Args> = ({ serviceName={serviceName} waterfallItemId={waterfallItemId} waterfall={waterfall} + showCriticalPath={false} + onShowCriticalPathChange={noop} /> ); }; @@ -93,6 +98,8 @@ export const ChildStartsBeforeParent: Story<Args> = ({ serviceName={serviceName} waterfallItemId={waterfallItemId} waterfall={waterfall} + showCriticalPath={false} + onShowCriticalPathChange={noop} /> ); }; @@ -110,6 +117,8 @@ export const InferredSpans: Story<Args> = ({ serviceName={serviceName} waterfallItemId={waterfallItemId} waterfall={waterfall} + showCriticalPath={false} + onShowCriticalPathChange={noop} /> ); }; @@ -127,6 +136,8 @@ export const ManyChildrenWithSameLength: Story<Args> = ({ serviceName={serviceName} waterfallItemId={waterfallItemId} waterfall={waterfall} + showCriticalPath={false} + onShowCriticalPathChange={noop} /> ); }; diff --git a/x-pack/plugins/apm/public/components/routing/apm_route_config.tsx b/x-pack/plugins/apm/public/components/routing/apm_route_config.tsx index 53fab0ed5694c..4624c29376fa5 100644 --- a/x-pack/plugins/apm/public/components/routing/apm_route_config.tsx +++ b/x-pack/plugins/apm/public/components/routing/apm_route_config.tsx @@ -18,7 +18,6 @@ import { serviceDetail } from './service_detail'; import { settings } from './settings'; import { ApmMainTemplate } from './templates/apm_main_template'; import { ServiceGroupsList } from '../app/service_groups'; -import { ServiceGroupsRedirect } from './service_groups_redirect'; import { offsetRt } from '../../../common/comparison_rt'; const ServiceGroupsTitle = i18n.translate( @@ -78,11 +77,11 @@ const apmRoutes = { <ApmMainTemplate pageTitle={ServiceGroupsTitle} environmentFilter={false} - showServiceGroupSaveButton + showServiceGroupSaveButton={false} + showServiceGroupsNav + selectedNavButton="serviceGroups" > - <ServiceGroupsRedirect> - <ServiceGroupsList /> - </ServiceGroupsRedirect> + <ServiceGroupsList /> </ApmMainTemplate> </Breadcrumb> ), diff --git a/x-pack/plugins/apm/public/components/routing/home/dependencies.tsx b/x-pack/plugins/apm/public/components/routing/home/dependencies.tsx index a20634c31912c..7b0d93d7550e1 100644 --- a/x-pack/plugins/apm/public/components/routing/home/dependencies.tsx +++ b/x-pack/plugins/apm/public/components/routing/home/dependencies.tsx @@ -20,6 +20,7 @@ import { DependencyDetailView } from '../../app/dependency_detail_view'; import { DependenciesInventory } from '../../app/dependencies_inventory'; import { DependencyOperationDetailView } from '../../app/dependency_operation_detail_view'; import { useApmParams } from '../../../hooks/use_apm_params'; +import { TransactionTab } from '../../app/transaction_details/waterfall_with_summary/transaction_tabs'; export const DependenciesInventoryTitle = i18n.translate( 'xpack.apm.views.dependenciesInventory.title', @@ -73,13 +74,27 @@ export const dependencies = { query: t.intersection([ t.type({ spanName: t.string, + detailTab: t.union([ + t.literal(TransactionTab.timeline), + t.literal(TransactionTab.metadata), + t.literal(TransactionTab.logs), + ]), + showCriticalPath: toBooleanRt, }), t.partial({ + spanId: t.string, sampleRangeFrom: toNumberRt, sampleRangeTo: toNumberRt, + waterfallItemId: t.string, }), ]), }), + defaults: { + query: { + detailTab: TransactionTab.timeline, + showCriticalPath: '', + }, + }, element: <DependencyOperationDetailView />, }, '/dependencies/overview': { diff --git a/x-pack/plugins/apm/public/components/routing/home/index.tsx b/x-pack/plugins/apm/public/components/routing/home/index.tsx index 51a68488f9d81..b908f87832b95 100644 --- a/x-pack/plugins/apm/public/components/routing/home/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/home/index.tsx @@ -19,10 +19,11 @@ import { ServiceInventory } from '../../app/service_inventory'; import { ServiceMapHome } from '../../app/service_map'; import { TopTracesOverview } from '../../app/top_traces_overview'; import { TraceExplorer } from '../../app/trace_explorer'; +import { TraceExplorerAggregatedCriticalPath } from '../../app/trace_explorer/trace_explorer_aggregated_critical_path'; +import { TraceExplorerWaterfall } from '../../app/trace_explorer/trace_explorer_waterfall'; import { TraceOverview } from '../../app/trace_overview'; import { TransactionTab } from '../../app/transaction_details/waterfall_with_summary/transaction_tabs'; import { RedirectTo } from '../redirect_to'; -import { ServiceGroupsRedirect } from '../service_groups_redirect'; import { ApmMainTemplate } from '../templates/apm_main_template'; import { ServiceGroupTemplate } from '../templates/service_group_template'; import { dependencies } from './dependencies'; @@ -185,11 +186,7 @@ export const home = { element: <ServiceMapHome />, serviceGroupContextTab: 'service-map', }), - ...page({ - path: '/traces', - title: i18n.translate('xpack.apm.views.traceOverview.title', { - defaultMessage: 'Traces', - }), + '/traces': { element: ( <TraceOverview> <Outlet /> @@ -197,7 +194,42 @@ export const home = { ), children: { '/traces/explorer': { - element: <TraceExplorer />, + element: ( + <TraceExplorer> + <Outlet /> + </TraceExplorer> + ), + children: { + '/traces/explorer/waterfall': { + element: <TraceExplorerWaterfall />, + params: t.type({ + query: t.type({ + traceId: t.string, + transactionId: t.string, + waterfallItemId: t.string, + detailTab: t.union([ + t.literal(TransactionTab.timeline), + t.literal(TransactionTab.metadata), + t.literal(TransactionTab.logs), + ]), + }), + }), + defaults: { + query: { + waterfallItemId: '', + traceId: '', + transactionId: '', + detailTab: TransactionTab.timeline, + }, + }, + }, + '/traces/explorer/critical_path': { + element: <TraceExplorerAggregatedCriticalPath />, + }, + '/traces/explorer': { + element: <RedirectTo pathname="/traces/explorer/waterfall" />, + }, + }, params: t.type({ query: t.type({ query: t.string, @@ -205,24 +237,14 @@ export const home = { t.literal(TraceSearchType.kql), t.literal(TraceSearchType.eql), ]), - waterfallItemId: t.string, - traceId: t.string, - transactionId: t.string, - detailTab: t.union([ - t.literal(TransactionTab.timeline), - t.literal(TransactionTab.metadata), - t.literal(TransactionTab.logs), - ]), + showCriticalPath: toBooleanRt, }), }), defaults: { query: { query: '', type: TraceSearchType.kql, - waterfallItemId: '', - traceId: '', - transactionId: '', - detailTab: TransactionTab.timeline, + showCriticalPath: '', }, }, }, @@ -230,17 +252,11 @@ export const home = { element: <TopTracesOverview />, }, }, - }), + }, ...dependencies, ...legacyBackends, ...storageExplorer, - '/': { - element: ( - <ServiceGroupsRedirect> - <RedirectTo pathname="/service-groups" /> - </ServiceGroupsRedirect> - ), - }, + '/': { element: <RedirectTo pathname="/services" /> }, }, }, }; diff --git a/x-pack/plugins/apm/public/components/routing/home/storage_explorer.tsx b/x-pack/plugins/apm/public/components/routing/home/storage_explorer.tsx index c4bc86f766811..e971002dfbcd3 100644 --- a/x-pack/plugins/apm/public/components/routing/home/storage_explorer.tsx +++ b/x-pack/plugins/apm/public/components/routing/home/storage_explorer.tsx @@ -18,6 +18,7 @@ import { indexLifecyclePhaseRt, IndexLifecyclePhaseSelectOption, } from '../../../../common/storage_explorer_types'; +import { getStorageExplorerFeedbackHref } from '../../app/storage_explorer/get_storage_explorer_links'; export const storageExplorer = { '/storage-explorer': { @@ -39,11 +40,11 @@ export const storageExplorer = { > <EuiFlexItem grow={false}> <EuiTitle size="l"> - <h2> + <h1> {i18n.translate('xpack.apm.views.storageExplorer.title', { defaultMessage: 'Storage explorer', })} - </h2> + </h1> </EuiTitle> </EuiFlexItem> <EuiFlexItem grow={false}> @@ -52,10 +53,7 @@ export const storageExplorer = { </EuiFlexGroup> ), rightSideItems: [ - <EuiLink - href="https://ela.st/feedback-storage-explorer" - target="_blank" - > + <EuiLink href={getStorageExplorerFeedbackHref()} target="_blank"> {i18n.translate( 'xpack.apm.views.storageExplorer.giveFeedback', { diff --git a/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx b/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx index fdd1aedfa0022..96600d8b85b5c 100644 --- a/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx @@ -149,6 +149,10 @@ export const serviceDetail = { pageSize: toNumberRt, sortField: t.string, sortDirection: t.union([t.literal('asc'), t.literal('desc')]), + device: t.string, + osVersion: t.string, + appVersion: t.string, + netConnectionType: t.string, }), }), }, @@ -180,6 +184,7 @@ export const serviceDetail = { t.type({ transactionName: t.string, comparisonEnabled: toBooleanRt, + showCriticalPath: toBooleanRt, }), t.partial({ traceId: t.string, @@ -188,6 +193,11 @@ export const serviceDetail = { offsetRt, ]), }), + defaults: { + query: { + showCriticalPath: '', + }, + }, }, '/services/{serviceName}/transactions': { element: <TransactionOverview />, diff --git a/x-pack/plugins/apm/public/components/routing/service_groups_redirect.tsx b/x-pack/plugins/apm/public/components/routing/service_groups_redirect.tsx deleted file mode 100644 index f309c69932903..0000000000000 --- a/x-pack/plugins/apm/public/components/routing/service_groups_redirect.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import React from 'react'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { enableServiceGroups } from '@kbn/observability-plugin/public'; -import { RedirectTo } from './redirect_to'; -import { useFetcher, FETCH_STATUS } from '../../hooks/use_fetcher'; - -export function ServiceGroupsRedirect({ - children, -}: { - children?: React.ReactNode; -}) { - const { data = { serviceGroups: [] }, status } = useFetcher( - (callApmApi) => callApmApi('GET /internal/apm/service-groups'), - [] - ); - const { serviceGroups } = data; - const isLoading = - status === FETCH_STATUS.NOT_INITIATED || status === FETCH_STATUS.LOADING; - const { - services: { uiSettings }, - } = useKibana(); - const isServiceGroupsEnabled = uiSettings?.get<boolean>(enableServiceGroups); - - if (isLoading) { - return null; - } - if (!isServiceGroupsEnabled || serviceGroups.length === 0) { - return <RedirectTo pathname={'/services'} />; - } - return <>{children}</>; -} diff --git a/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx b/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx index 4eb7d8140fdf3..c4bcc4e5fc612 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx @@ -6,17 +6,18 @@ */ import { EuiPageHeaderProps } from '@elastic/eui'; -import React from 'react'; -import { useLocation } from 'react-router-dom'; import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { ObservabilityPageTemplateProps } from '@kbn/observability-plugin/public/components/shared/page_template/page_template'; import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template'; -import { enableServiceGroups } from '@kbn/observability-plugin/public'; +import React from 'react'; +import { useLocation } from 'react-router-dom'; import { EnvironmentsContextProvider } from '../../../context/environments_context/environments_context'; -import { useFetcher, FETCH_STATUS } from '../../../hooks/use_fetcher'; +import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; import { ApmPluginStartDeps } from '../../../plugin'; +import { ServiceGroupSaveButton } from '../../app/service_groups'; +import { ServiceGroupsButtonGroup } from '../../app/service_groups/service_groups_button_group'; import { ApmEnvironmentFilter } from '../../shared/environment_filter'; import { getNoDataConfig } from './no_data_config'; -import { ServiceGroupSaveButton } from '../../app/service_groups'; // Paths that must skip the no data screen const bypassNoDataScreenPaths = ['/settings']; @@ -37,6 +38,8 @@ export function ApmMainTemplate({ children, environmentFilter = true, showServiceGroupSaveButton = false, + showServiceGroupsNav = false, + selectedNavButton, ...pageTemplateProps }: { pageTitle?: React.ReactNode; @@ -44,7 +47,10 @@ export function ApmMainTemplate({ children: React.ReactNode; environmentFilter?: boolean; showServiceGroupSaveButton?: boolean; -} & KibanaPageTemplateProps) { + showServiceGroupsNav?: boolean; + selectedNavButton?: 'serviceGroups' | 'allServices'; +} & KibanaPageTemplateProps & + Pick<ObservabilityPageTemplateProps, 'pageSectionProps'>) { const location = useLocation(); const { services } = useKibana<ApmPluginStartDeps>(); @@ -97,14 +103,8 @@ export function ApmMainTemplate({ loading: isLoading, }); - const { - services: { uiSettings }, - } = useKibana<ApmPluginStartDeps>(); - const isServiceGroupsEnabled = uiSettings?.get<boolean>(enableServiceGroups); - const renderServiceGroupSaveButton = - showServiceGroupSaveButton && isServiceGroupsEnabled; const rightSideItems = [ - ...(renderServiceGroupSaveButton ? [<ServiceGroupSaveButton />] : []), + ...(showServiceGroupSaveButton ? [<ServiceGroupSaveButton />] : []), ...(environmentFilter ? [<ApmEnvironmentFilter />] : []), ]; @@ -116,6 +116,10 @@ export function ApmMainTemplate({ pageTitle, rightSideItems, ...pageHeader, + children: + showServiceGroupsNav && selectedNavButton ? ( + <ServiceGroupsButtonGroup selectedNavButton={selectedNavButton} /> + ) : null, }} {...pageTemplateProps} > diff --git a/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx b/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx index 1eece05eb8843..149188243ea35 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx @@ -9,17 +9,13 @@ import { EuiPageHeaderProps, EuiFlexGroup, EuiFlexItem, - EuiButtonIcon, EuiLoadingContent, - EuiLoadingSpinner, + EuiIcon, } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template'; -import { enableServiceGroups } from '@kbn/observability-plugin/public'; -import { useFetcher, FETCH_STATUS } from '../../../hooks/use_fetcher'; -import { ApmPluginStartDeps } from '../../../plugin'; +import { useFetcher } from '../../../hooks/use_fetcher'; import { useApmRouter } from '../../../hooks/use_apm_router'; import { useAnyOfApmParams } from '../../../hooks/use_apm_params'; import { ApmMainTemplate } from './apm_main_template'; @@ -39,11 +35,6 @@ export function ServiceGroupTemplate({ environmentFilter?: boolean; serviceGroupContextTab: ServiceGroupContextTab['key']; } & KibanaPageTemplateProps) { - const { - services: { uiSettings }, - } = useKibana<ApmPluginStartDeps>(); - const isServiceGroupsEnabled = uiSettings?.get<boolean>(enableServiceGroups); - const router = useApmRouter(); const { query, @@ -61,18 +52,9 @@ export function ServiceGroupTemplate({ [serviceGroupId] ); - const { data: serviceGroupsData, status: serviceGroupsStatus } = useFetcher( - (callApmApi) => { - if (!serviceGroupId && isServiceGroupsEnabled) { - return callApmApi('GET /internal/apm/service-groups'); - } - }, - [serviceGroupId, isServiceGroupsEnabled] - ); - const serviceGroupName = data?.serviceGroup.groupName; const loadingServiceGroupName = !!serviceGroupId && !serviceGroupName; - const hasServiceGroups = !!serviceGroupsData?.serviceGroups.length; + const isAllServices = !serviceGroupId; const serviceGroupsLink = router.link('/service-groups', { query: { ...query, serviceGroup: '' }, }); @@ -85,29 +67,13 @@ export function ServiceGroupTemplate({ justifyContent="flexStart" responsive={false} > - {serviceGroupsStatus === FETCH_STATUS.LOADING && ( - <EuiFlexItem grow={false}> - <EuiLoadingSpinner size="l" /> - </EuiFlexItem> - )} - {(serviceGroupId || hasServiceGroups) && ( - <EuiFlexItem grow={false}> - <EuiButtonIcon - iconType="layers" - color="text" - aria-label="Go to service groups" - iconSize="xl" - href={serviceGroupsLink} - /> - </EuiFlexItem> - )} <EuiFlexItem grow={false}> {loadingServiceGroupName ? ( <EuiLoadingContent lines={2} style={{ width: 180, height: 40 }} /> ) : ( serviceGroupName || i18n.translate('xpack.apm.serviceGroup.allServices.title', { - defaultMessage: 'All services', + defaultMessage: 'Services', }) )} </EuiFlexItem> @@ -145,13 +111,33 @@ export function ServiceGroupTemplate({ ); return ( <ApmMainTemplate - pageTitle={isServiceGroupsEnabled ? serviceGroupsPageTitle : pageTitle} + pageTitle={serviceGroupsPageTitle} pageHeader={{ - tabs: isServiceGroupsEnabled ? tabs : undefined, + tabs, + breadcrumbs: !isAllServices + ? [ + { + text: ( + <> + <EuiIcon size="s" type="arrowLeft" />{' '} + {i18n.translate( + 'xpack.apm.serviceGroups.breadcrumb.return', + { defaultMessage: 'Return' } + )} + </> + ), + color: 'primary', + 'aria-current': false, + href: serviceGroupsLink, + }, + ] + : undefined, ...pageHeader, }} environmentFilter={environmentFilter} - showServiceGroupSaveButton={true} + showServiceGroupSaveButton={!isAllServices} + showServiceGroupsNav={isAllServices} + selectedNavButton={isAllServices ? 'allServices' : 'serviceGroups'} {...pageTemplateProps} > {children} diff --git a/x-pack/plugins/apm/public/components/shared/charts/spark_plot/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/spark_plot/index.tsx index ad3def1903517..58ff1bbfdb6ca 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/spark_plot/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/spark_plot/index.tsx @@ -50,7 +50,7 @@ export function SparkPlot({ valueLabel: React.ReactNode; compact?: boolean; comparisonSeries?: Coordinate[]; - comparisonSeriesColor: string; + comparisonSeriesColor?: string; }) { return ( <EuiFlexGroup @@ -90,7 +90,7 @@ function SparkPlotItem({ series?: Coordinate[] | null; compact?: boolean; comparisonSeries?: Coordinate[]; - comparisonSeriesColor: string; + comparisonSeriesColor?: string; }) { const theme = useTheme(); const defaultChartTheme = useChartTheme(); diff --git a/x-pack/plugins/apm/public/components/shared/critical_path_flamegraph/critical_path_flamegraph_tooltip.tsx b/x-pack/plugins/apm/public/components/shared/critical_path_flamegraph/critical_path_flamegraph_tooltip.tsx new file mode 100644 index 0000000000000..882b974abd6fe --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/critical_path_flamegraph/critical_path_flamegraph_tooltip.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 { + EuiBadge, + EuiFlexGroup, + EuiFlexItem, + EuiHorizontalRule, + EuiPanel, +} from '@elastic/eui'; +import React from 'react'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { i18n } from '@kbn/i18n'; +import type { CriticalPathResponse } from '../../../../server/routes/traces/get_aggregated_critical_path'; +import { + AGENT_NAME, + SERVICE_NAME, + SPAN_NAME, + SPAN_SUBTYPE, + SPAN_TYPE, + TRANSACTION_NAME, + TRANSACTION_TYPE, +} from '../../../../common/elasticsearch_fieldnames'; +import { SpanIcon } from '../span_icon'; +import { AgentIcon } from '../agent_icon'; +import { asPercent } from '../../../../common/utils/formatters'; + +export function CriticalPathFlamegraphTooltip({ + metadata, + countInclusive, + countExclusive, + totalCount, +}: { + metadata?: CriticalPathResponse['metadata'][string]; + countInclusive: number; + countExclusive: number; + totalCount: number; +}) { + if (!metadata) { + return <></>; + } + + return ( + <EuiPanel> + <EuiFlexGroup direction="column" gutterSize="s"> + {metadata['processor.event'] === ProcessorEvent.transaction ? ( + <EuiFlexItem grow={false}> + <EuiFlexGroup + direction="row" + gutterSize="s" + style={{ overflowWrap: 'anywhere' }} + alignItems="center" + > + <EuiFlexItem grow={false}> + {metadata[TRANSACTION_NAME]} + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiBadge>{metadata[TRANSACTION_TYPE]}</EuiBadge> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + ) : ( + <EuiFlexItem> + <EuiFlexGroup + direction="row" + gutterSize="s" + style={{ overflowWrap: 'anywhere' }} + alignItems="center" + > + <EuiFlexItem grow={false}> + <SpanIcon + type={metadata[SPAN_TYPE]} + subtype={metadata[SPAN_SUBTYPE]} + /> + </EuiFlexItem> + <EuiFlexItem grow={false}>{metadata[SPAN_NAME]}</EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + )} + <EuiFlexItem> + <EuiHorizontalRule margin="none" /> + </EuiFlexItem> + <EuiFlexItem> + <EuiFlexGroup direction="row" gutterSize="xs" alignItems="center"> + <EuiFlexItem grow={false}> + <AgentIcon agentName={metadata[AGENT_NAME]} /> + </EuiFlexItem> + <EuiFlexItem grow={false}>{metadata[SERVICE_NAME]}</EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem> + <EuiHorizontalRule margin="none" /> + </EuiFlexItem> + <EuiFlexItem> + <EuiFlexGroup direction="column" gutterSize="s"> + <EuiFlexItem grow={false}> + {i18n.translate('xpack.apm.criticalPathFlameGraph.selfTime', { + defaultMessage: 'Self time: {value}', + values: { + value: asPercent(countExclusive / totalCount, 1), + }, + })} + </EuiFlexItem> + <EuiFlexItem grow={false}> + {i18n.translate('xpack.apm.criticalPathFlameGraph.totalTime', { + defaultMessage: 'Total time: {value}', + values: { + value: asPercent(countInclusive / totalCount, 1), + }, + })} + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + ); +} diff --git a/x-pack/plugins/apm/public/components/shared/critical_path_flamegraph/critical_path_to_flamegraph.ts b/x-pack/plugins/apm/public/components/shared/critical_path_flamegraph/critical_path_to_flamegraph.ts new file mode 100644 index 0000000000000..4bc5e222fa8c7 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/critical_path_flamegraph/critical_path_to_flamegraph.ts @@ -0,0 +1,144 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ColumnarViewModel } from '@elastic/charts'; +import { memoize, sumBy } from 'lodash'; +import { lighten, parseToRgb } from 'polished'; +import seedrandom from 'seedrandom'; +import type { CriticalPathResponse } from '../../../../server/routes/traces/get_aggregated_critical_path'; +import { + CriticalPathTreeNode, + getAggregatedCriticalPathRootNodes, +} from '../../../../common/critical_path/get_aggregated_critical_path_root_nodes'; + +const lightenColor = lighten(0.2); + +export function criticalPathToFlamegraph( + params: { + criticalPath: CriticalPathResponse; + colors: string[]; + } & ({ serviceName: string; transactionName: string } | {}) +): { + viewModel: ColumnarViewModel; + operationId: string[]; + countExclusive: Float64Array; + sum: number; +} { + let sum = 0; + + const { criticalPath, colors } = params; + + const { rootNodes, maxDepth, numNodes } = + getAggregatedCriticalPathRootNodes(params); + + // include the root node + const totalSize = numNodes + 1; + + const operationId = new Array<string>(totalSize); + const countInclusive = new Float64Array(totalSize); + const countExclusive = new Float64Array(totalSize); + const label = new Array<string>(totalSize); + const position = new Float32Array(totalSize * 2); + const size = new Float32Array(totalSize); + const color = new Float32Array(totalSize * 4); + + // eslint-disable-next-line guard-for-in + for (const nodeId in criticalPath.timeByNodeId) { + const count = criticalPath.timeByNodeId[nodeId]; + sum += count; + } + + let maxValue = 0; + + let index = 0; + + const availableColors: Array<[number, number, number, number]> = colors.map( + (vizColor) => { + const rgb = parseToRgb(lightenColor(vizColor)); + + return [rgb.red / 255, rgb.green / 255, rgb.blue / 255, 1]; + } + ); + + const pickColor = memoize((identifier: string) => { + const idx = + Math.abs(seedrandom(identifier).int32()) % availableColors.length; + return availableColors[idx]; + }); + + function addNodeToFlamegraph( + node: CriticalPathTreeNode, + x: number, + y: number + ) { + let nodeOperationId: string; + let nodeLabel: string; + let operationMetadata: CriticalPathResponse['metadata'][string] | undefined; + if (node.nodeId === 'root') { + nodeOperationId = ''; + nodeLabel = 'root'; + } else { + nodeOperationId = criticalPath.operationIdByNodeId[node.nodeId]; + operationMetadata = criticalPath.metadata[nodeOperationId]; + nodeLabel = + operationMetadata['processor.event'] === 'transaction' + ? operationMetadata['transaction.name'] + : operationMetadata['span.name']; + } + + operationId[index] = nodeOperationId; + countInclusive[index] = node.countInclusive; + countExclusive[index] = node.countExclusive; + label[index] = nodeLabel; + position[index * 2] = x / maxValue; + position[index * 2 + 1] = 1 - (y + 1) / (maxDepth + 1); + size[index] = node.countInclusive / maxValue; + + const identifier = + operationMetadata?.['processor.event'] === 'transaction' + ? operationMetadata['transaction.type'] + : operationMetadata?.['span.subtype'] || + operationMetadata?.['span.type'] || + ''; + + color.set(pickColor(identifier), index * 4); + + index++; + + let childX = x; + node.children.forEach((child) => { + addNodeToFlamegraph(child, childX, y + 1); + childX += child.countInclusive; + }); + } + + const root: CriticalPathTreeNode = { + children: rootNodes, + nodeId: 'root', + countExclusive: 0, + countInclusive: sumBy(rootNodes, 'countInclusive'), + }; + + maxValue = root.countInclusive; + + addNodeToFlamegraph(root, 0, 0); + + return { + viewModel: { + value: countInclusive, + label, + color, + position0: position, + position1: position, + size0: size, + size1: size, + }, + operationId, + countExclusive, + sum, + }; +} diff --git a/x-pack/plugins/apm/public/components/shared/critical_path_flamegraph/index.tsx b/x-pack/plugins/apm/public/components/shared/critical_path_flamegraph/index.tsx new file mode 100644 index 0000000000000..f99b82a112c78 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/critical_path_flamegraph/index.tsx @@ -0,0 +1,165 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { Chart, Datum, Flame, Settings } from '@elastic/charts'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiLoadingSpinner, + euiPaletteColorBlind, +} from '@elastic/eui'; +import { css } from '@emotion/css'; +import { useChartTheme } from '@kbn/observability-plugin/public'; +import { uniqueId } from 'lodash'; +import React, { useMemo, useRef } from 'react'; +import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; +import { CriticalPathFlamegraphTooltip } from './critical_path_flamegraph_tooltip'; +import { criticalPathToFlamegraph } from './critical_path_to_flamegraph'; + +const chartClassName = css` + flex-grow: 1; +`; + +export function CriticalPathFlamegraph( + props: { + start: string; + end: string; + traceIds: string[]; + traceIdsFetchStatus: FETCH_STATUS; + } & ({ serviceName: string; transactionName: string } | {}) +) { + const { start, end, traceIds, traceIdsFetchStatus } = props; + + const serviceName = 'serviceName' in props ? props.serviceName : null; + const transactionName = + 'transactionName' in props ? props.transactionName : null; + + // Use a reference to time range, to not invalidate the API fetch + // we only care for traceIds, start/end are there to limit the search + // request to a certain time range. It shouldn't affect the actual results + // of the search. + const timerange = useRef({ start, end }); + timerange.current = { start, end }; + + const { + data: { criticalPath } = { criticalPath: null }, + status: criticalPathFetchStatus, + } = useFetcher( + (callApmApi) => { + if (!traceIds.length) { + return Promise.resolve({ criticalPath: null }); + } + + return callApmApi('POST /internal/apm/traces/aggregated_critical_path', { + params: { + body: { + start: timerange.current.start, + end: timerange.current.end, + traceIds, + serviceName, + transactionName, + }, + }, + }); + }, + [timerange, traceIds, serviceName, transactionName] + ); + + const chartTheme = useChartTheme(); + + const isLoading = + traceIdsFetchStatus === FETCH_STATUS.NOT_INITIATED || + traceIdsFetchStatus === FETCH_STATUS.LOADING || + criticalPathFetchStatus === FETCH_STATUS.NOT_INITIATED || + criticalPathFetchStatus === FETCH_STATUS.LOADING; + + const flameGraph = useMemo(() => { + if (!criticalPath) { + return undefined; + } + + const colors = euiPaletteColorBlind({}); + + const flamegraph = criticalPathToFlamegraph({ + criticalPath, + colors, + }); + + return { + ...flamegraph, + // make sure Flame re-renders when data changes, workaround for https://github.com/elastic/elastic-charts/issues/1766 + key: uniqueId(), + }; + }, [criticalPath]); + + const themeOverrides = { + chartMargins: { top: 0, left: 0, bottom: 0, right: 0 }, + chartPaddings: { left: 0, right: 0, top: 0, bottom: 0 }, + }; + + return ( + <EuiFlexGroup + direction="column" + gutterSize="l" + alignItems="stretch" + justifyContent="center" + style={{ minHeight: 400 }} + > + {isLoading ? ( + <EuiFlexItem grow={false} style={{ alignSelf: 'center' }}> + <EuiLoadingSpinner size="l" /> + </EuiFlexItem> + ) : ( + flameGraph && ( + <EuiFlexItem grow> + <Chart key={flameGraph.key} className={chartClassName}> + <Settings + theme={[ + { + chartMargins: themeOverrides.chartMargins, + chartPaddings: themeOverrides.chartPaddings, + }, + ...chartTheme, + ]} + tooltip={{ + customTooltip: (tooltipProps) => { + const valueIndex = tooltipProps.values[0] + .valueAccessor as number; + const operationId = flameGraph.operationId[valueIndex]; + const operationMetadata = + criticalPath?.metadata[operationId]; + const countInclusive = + flameGraph.viewModel.value[valueIndex]; + const countExclusive = + flameGraph.countExclusive[valueIndex]; + + return ( + <CriticalPathFlamegraphTooltip + metadata={operationMetadata} + countInclusive={countInclusive} + countExclusive={countExclusive} + totalCount={flameGraph.viewModel.value[0]} + /> + ); + }, + }} + onElementClick={(elements) => {}} + /> + <Flame + id="aggregated_critical_path" + columnarData={flameGraph.viewModel} + valueAccessor={(d: Datum) => d.value as number} + valueFormatter={(value) => `${value}`} + animation={{ duration: 100 }} + controlProviderCallback={{}} + /> + </Chart> + </EuiFlexItem> + ) + )} + </EuiFlexGroup> + ); +} diff --git a/x-pack/plugins/apm/public/components/shared/date_picker/date_picker.test.tsx b/x-pack/plugins/apm/public/components/shared/date_picker/date_picker.test.tsx index a5632ead92ecd..4a4ff85785456 100644 --- a/x-pack/plugins/apm/public/components/shared/date_picker/date_picker.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/date_picker/date_picker.test.tsx @@ -124,7 +124,7 @@ describe('DatePicker', () => { }); it('enables auto-refresh when refreshPaused is false', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const { wrapper } = mountDatePicker({ rangeFrom: 'now-15m', rangeTo: 'now', @@ -139,7 +139,7 @@ describe('DatePicker', () => { }); it('disables auto-refresh when refreshPaused is true', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); mountDatePicker({ rangeFrom: 'now-15m', rangeTo: 'now', diff --git a/x-pack/plugins/apm/public/components/shared/height_retainer/resetting_height_container.tsx b/x-pack/plugins/apm/public/components/shared/height_retainer/resetting_height_container.tsx new file mode 100644 index 0000000000000..00a1b9dd40c31 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/height_retainer/resetting_height_container.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, { useRef } from 'react'; + +export function ResettingHeightRetainer( + props: React.DetailedHTMLProps< + React.HTMLAttributes<HTMLDivElement>, + HTMLDivElement + > & { reset?: boolean } +) { + const { reset, ...containerProps } = props; + const resetRef = useRef(reset); + const containerRef = useRef<HTMLDivElement>(null); + + const minHeightRef = useRef(0); + + if (resetRef.current !== reset) { + minHeightRef.current = reset ? 0 : containerRef.current?.clientHeight ?? 0; + + resetRef.current = reset; + } + + return ( + <div + {...containerProps} + ref={containerRef} + style={{ minHeight: minHeightRef.current }} + /> + ); +} diff --git a/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx b/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx index e8903fcad92bd..c8e9de32c83f3 100644 --- a/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx @@ -19,7 +19,6 @@ import { useApmParams } from '../../../hooks/use_apm_params'; import { useApmDataView } from '../../../hooks/use_apm_data_view'; import { fromQuery, toQuery } from '../links/url_helpers'; import { getBoolFilter } from './get_bool_filter'; -// @ts-expect-error import { Typeahead } from './typeahead'; import { useProcessorEvent } from './use_processor_event'; diff --git a/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlexplorer_link.test.tsx b/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlexplorer_link.test.tsx index 49c9c6c244c01..ad0b06b73df53 100644 --- a/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlexplorer_link.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlexplorer_link.test.tsx @@ -23,7 +23,7 @@ describe('MLExplorerLink', () => { ); expect(href).toMatchInlineSnapshot( - `"/app/ml/explorer?_g=(ml:(jobIds:!(myservicename-mytransactiontype-high_mean_response_time)),refreshInterval:(pause:!t,value:0),time:(from:now%2Fw,to:now-4h))&_a=(explorer:(mlExplorerFilter:(),mlExplorerSwimlane:()))"` + `"/app/ml/explorer?_g=(ml:(jobIds:!(myservicename-mytransactiontype-high_mean_response_time)),refreshInterval:(pause:!t,value:10000),time:(from:now%2Fw,to:now-4h))&_a=(explorer:(mlExplorerFilter:(),mlExplorerSwimlane:()))"` ); }); diff --git a/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlexplorer_link.tsx b/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlexplorer_link.tsx index 9da957f97c974..0990a961c0d4b 100644 --- a/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlexplorer_link.tsx +++ b/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlexplorer_link.tsx @@ -7,11 +7,9 @@ import React, { ReactNode } from 'react'; import { EuiLink } from '@elastic/eui'; -import { UI_SETTINGS } from '@kbn/data-plugin/common'; import { useMlHref, ML_PAGES } from '@kbn/ml-plugin/public'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; -import { TimePickerRefreshInterval } from '../../date_picker/typings'; interface Props { children?: ReactNode; @@ -39,17 +37,10 @@ export function useExplorerHref({ jobId }: { jobId: string }) { } = useApmPluginContext(); const { urlParams } = useLegacyUrlParams(); - const timePickerRefreshIntervalDefaults = - core.uiSettings.get<TimePickerRefreshInterval>( - UI_SETTINGS.TIMEPICKER_REFRESH_INTERVAL_DEFAULTS - ); - const { // hardcoding a custom default of 1 hour since the default kibana timerange of 15 minutes is shorter than the ML interval rangeFrom = 'now-1h', rangeTo = 'now', - refreshInterval = timePickerRefreshIntervalDefaults.value, - refreshPaused = timePickerRefreshIntervalDefaults.pause, } = urlParams; const href = useMlHref(ml, core.http.basePath.get(), { @@ -57,7 +48,7 @@ export function useExplorerHref({ jobId }: { jobId: string }) { pageState: { jobIds: [jobId], timeRange: { from: rangeFrom, to: rangeTo }, - refreshInterval: { pause: refreshPaused, value: refreshInterval }, + refreshInterval: { pause: true, value: 10000 }, }, }); diff --git a/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlmanage_jobs_link.test.tsx b/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlmanage_jobs_link.test.tsx index c2ce967768502..c7f3186670248 100644 --- a/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlmanage_jobs_link.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlmanage_jobs_link.test.tsx @@ -17,6 +17,6 @@ test('MLManageJobsLink', async () => { } as Location); expect(href).toMatchInlineSnapshot( - `"/app/ml/jobs?_a=(jobs:(queryText:'groups:(apm)'))&_g=(refreshInterval:(pause:!t,value:0),time:(from:now-5h,to:now-2h))"` + `"/app/ml/jobs?_a=(jobs:(queryText:'groups:(apm)'))&_g=(refreshInterval:(pause:!t,value:10000),time:(from:now-5h,to:now-2h))"` ); }); diff --git a/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlsingle_metric_link.test.tsx b/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlsingle_metric_link.test.tsx index dcf9cc9a06ffc..eb6ae275563a3 100644 --- a/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlsingle_metric_link.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlsingle_metric_link.test.tsx @@ -23,7 +23,7 @@ describe('MLSingleMetricLink', () => { ); expect(href).toMatchInlineSnapshot( - `"/app/ml/timeseriesexplorer?_g=(ml:(jobIds:!(myservicename-mytransactiontype-high_mean_response_time)),refreshInterval:(pause:!t,value:0),time:(from:now%2Fw,to:now-4h))&_a=(timeseriesexplorer:(mlTimeSeriesExplorer:()))"` + `"/app/ml/timeseriesexplorer?_g=(ml:(jobIds:!(myservicename-mytransactiontype-high_mean_response_time)),refreshInterval:(pause:!t,value:10000),time:(from:now%2Fw,to:now-4h))&_a=(timeseriesexplorer:(mlTimeSeriesExplorer:()))"` ); }); it('should produce the correct URL with jobId, serviceName, and transactionType', async () => { @@ -42,7 +42,7 @@ describe('MLSingleMetricLink', () => { ); expect(href).toMatchInlineSnapshot( - `"/app/ml/timeseriesexplorer?_g=(ml:(jobIds:!(myservicename-mytransactiontype-high_mean_response_time)),refreshInterval:(pause:!t,value:0),time:(from:now%2Fw,to:now-4h))&_a=(timeseriesexplorer:(mlTimeSeriesExplorer:(entities:(service.name:opbeans-test,transaction.type:request))))"` + `"/app/ml/timeseriesexplorer?_g=(ml:(jobIds:!(myservicename-mytransactiontype-high_mean_response_time)),refreshInterval:(pause:!t,value:10000),time:(from:now%2Fw,to:now-4h))&_a=(timeseriesexplorer:(mlTimeSeriesExplorer:(entities:(service.name:opbeans-test,transaction.type:request))))"` ); }); diff --git a/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlsingle_metric_link.tsx b/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlsingle_metric_link.tsx index cc2d855550af3..7c4232866157b 100644 --- a/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlsingle_metric_link.tsx +++ b/x-pack/plugins/apm/public/components/shared/links/machine_learning_links/mlsingle_metric_link.tsx @@ -7,11 +7,9 @@ import React, { ReactNode } from 'react'; import { EuiLink } from '@elastic/eui'; -import { UI_SETTINGS } from '@kbn/data-plugin/common'; import { useMlHref, ML_PAGES } from '@kbn/ml-plugin/public'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; -import { TimePickerRefreshInterval } from '../../date_picker/typings'; interface Props { children?: ReactNode; @@ -40,7 +38,7 @@ export function MLSingleMetricLink({ ); } -export function useSingleMetricHref({ +function useSingleMetricHref({ jobId, serviceName, transactionType, @@ -55,17 +53,10 @@ export function useSingleMetricHref({ } = useApmPluginContext(); const { urlParams } = useLegacyUrlParams(); - const timePickerRefreshIntervalDefaults = - core.uiSettings.get<TimePickerRefreshInterval>( - UI_SETTINGS.TIMEPICKER_REFRESH_INTERVAL_DEFAULTS - ); - const { // hardcoding a custom default of 1 hour since the default kibana timerange of 15 minutes is shorter than the ML interval rangeFrom = 'now-1h', rangeTo = 'now', - refreshInterval = timePickerRefreshIntervalDefaults.value, - refreshPaused = timePickerRefreshIntervalDefaults.pause, } = urlParams; const entities = @@ -83,7 +74,7 @@ export function useSingleMetricHref({ pageState: { jobIds: [jobId], timeRange: { from: rangeFrom, to: rangeTo }, - refreshInterval: { pause: refreshPaused, value: refreshInterval }, + refreshInterval: { pause: true, value: 10000 }, ...entities, }, }); diff --git a/x-pack/plugins/apm/public/components/shared/managed_table/index.tsx b/x-pack/plugins/apm/public/components/shared/managed_table/index.tsx index a4814211399e3..41512f00d22b6 100644 --- a/x-pack/plugins/apm/public/components/shared/managed_table/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/managed_table/index.tsx @@ -36,11 +36,7 @@ interface Props<T> { showPerPageOptions?: boolean; noItemsMessage?: React.ReactNode; sortItems?: boolean; - sortFn?: ( - items: T[], - sortField: string, - sortDirection: 'asc' | 'desc' - ) => T[]; + sortFn?: SortFunction<T>; pagination?: boolean; isLoading?: boolean; error?: boolean; @@ -57,6 +53,12 @@ function defaultSortFn<T extends any>( return orderBy(items, sortField, sortDirection); } +export type SortFunction<T> = ( + items: T[], + sortField: string, + sortDirection: 'asc' | 'desc' +) => T[]; + function UnoptimizedManagedTable<T>(props: Props<T>) { const history = useHistory(); const { diff --git a/x-pack/plugins/apm/public/components/shared/redirect_with_offset/index.test.tsx b/x-pack/plugins/apm/public/components/shared/redirect_with_offset/index.test.tsx index a47d3c76b500b..2a04856a7a1c4 100644 --- a/x-pack/plugins/apm/public/components/shared/redirect_with_offset/index.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/redirect_with_offset/index.test.tsx @@ -31,6 +31,11 @@ describe('RedirectWithOffset', () => { .spyOn(useApmPluginContextExports, 'useApmPluginContext') .mockReturnValue({ core: { + http: { + basePath: { + prepend: () => {}, + }, + }, uiSettings: { get: () => defaultSetting, }, diff --git a/x-pack/plugins/apm/public/components/shared/service_icons/serverless_details.tsx b/x-pack/plugins/apm/public/components/shared/service_icons/serverless_details.tsx index 5d6e3f5df0b66..2c6fabc72c037 100644 --- a/x-pack/plugins/apm/public/components/shared/service_icons/serverless_details.tsx +++ b/x-pack/plugins/apm/public/components/shared/service_icons/serverless_details.tsx @@ -72,5 +72,17 @@ export function ServerlessDetails({ serverless }: Props) { }); } + if (serverless.hostArchitecture) { + listItems.push({ + title: i18n.translate( + 'xpack.apm.serviceIcons.serviceDetails.cloud.architecture', + { defaultMessage: 'Architecture' } + ), + description: ( + <EuiBadge color="hollow">{serverless.hostArchitecture}</EuiBadge> + ), + }); + } + return <EuiDescriptionList textStyle="reverse" listItems={listItems} />; } diff --git a/x-pack/plugins/apm/public/components/shared/technical_preview_badge.tsx b/x-pack/plugins/apm/public/components/shared/technical_preview_badge.tsx index 64002312bdc45..b00d0c256f3f5 100644 --- a/x-pack/plugins/apm/public/components/shared/technical_preview_badge.tsx +++ b/x-pack/plugins/apm/public/components/shared/technical_preview_badge.tsx @@ -9,11 +9,11 @@ import { EuiBetaBadge, IconType } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -interface Props { +type Props = { icon?: IconType; -} +} & Pick<React.ComponentProps<typeof EuiBetaBadge>, 'size' | 'style'>; -export function TechnicalPreviewBadge({ icon }: Props) { +export function TechnicalPreviewBadge({ icon, size, style }: Props) { return ( <EuiBetaBadge label={i18n.translate('xpack.apm.technicalPreviewBadgeLabel', { @@ -27,6 +27,8 @@ export function TechnicalPreviewBadge({ icon }: Props) { } )} iconType={icon} + size={size} + style={style} /> ); } diff --git a/x-pack/plugins/apm/public/hooks/create_shared_use_fetcher.tsx b/x-pack/plugins/apm/public/hooks/create_shared_use_fetcher.tsx new file mode 100644 index 0000000000000..ba608fcd451c8 --- /dev/null +++ b/x-pack/plugins/apm/public/hooks/create_shared_use_fetcher.tsx @@ -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 React, { createContext, useContext, useMemo } from 'react'; +import type { APIEndpoint } from '../../server'; +import type { + APIClientRequestParamsOf, + APIReturnType, +} from '../services/rest/create_call_apm_api'; +import { useFetcher, FetcherResult } from './use_fetcher'; + +interface SharedUseFetcher<TEndpoint extends APIEndpoint> { + useFetcherResult: () => FetcherResult<APIReturnType<TEndpoint>> & { + refetch: () => void; + }; + Provider: React.FunctionComponent< + { + children: React.ReactElement; + params: {}; + } & APIClientRequestParamsOf<TEndpoint> + >; +} + +export function createSharedUseFetcher<TEndpoint extends APIEndpoint>( + endpoint: TEndpoint +): SharedUseFetcher<TEndpoint> { + const Context = createContext< + APIClientRequestParamsOf<APIEndpoint> | undefined + >(undefined); + + const returnValue: SharedUseFetcher<TEndpoint> = { + useFetcherResult: () => { + const context = useContext(Context); + + if (!context) { + throw new Error('Context was not found'); + } + + const params = context.params; + + const result = useFetcher( + (callApmApi) => { + return callApmApi( + ...([endpoint, { params }] as Parameters<typeof callApmApi>) + ); + }, + [params] + ); + + return result as ReturnType< + SharedUseFetcher<TEndpoint>['useFetcherResult'] + >; + }, + Provider: (props) => { + const { children } = props; + + const params = props.params; + + const memoizedParams = useMemo(() => { + return { params }; + }, [params]); + return ( + <Context.Provider value={memoizedParams}>{children}</Context.Provider> + ); + }, + }; + + return returnValue; +} diff --git a/x-pack/plugins/apm/public/hooks/use_apm_router.ts b/x-pack/plugins/apm/public/hooks/use_apm_router.ts index d10b6da857802..d479b3f1af414 100644 --- a/x-pack/plugins/apm/public/hooks/use_apm_router.ts +++ b/x-pack/plugins/apm/public/hooks/use_apm_router.ts @@ -6,6 +6,7 @@ */ import { useRouter } from '@kbn/typed-react-router-config'; +import { useMemo } from 'react'; import type { ApmRouter } from '../components/routing/apm_route_config'; import { useApmPluginContext } from '../context/apm_plugin/use_apm_plugin_context'; @@ -13,12 +14,13 @@ export function useApmRouter() { const router = useRouter(); const { core } = useApmPluginContext(); - const link = (...args: [any]) => { - return core.http.basePath.prepend('/app/apm' + router.link(...args)); - }; - - return { - ...router, - link, - } as unknown as ApmRouter; + return useMemo( + () => + ({ + ...router, + link: (...args: [any]) => + core.http.basePath.prepend('/app/apm' + router.link(...args)), + } as unknown as ApmRouter), + [core.http.basePath, router] + ); } diff --git a/x-pack/plugins/apm/public/hooks/use_critical_path_feature_enabled_setting.ts b/x-pack/plugins/apm/public/hooks/use_critical_path_feature_enabled_setting.ts new file mode 100644 index 0000000000000..29c6d10ea2d69 --- /dev/null +++ b/x-pack/plugins/apm/public/hooks/use_critical_path_feature_enabled_setting.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 { enableCriticalPath } from '@kbn/observability-plugin/common'; +import { useApmPluginContext } from '../context/apm_plugin/use_apm_plugin_context'; + +export function useCriticalPathFeatureEnabledSetting() { + const { core } = useApmPluginContext(); + + const isCriticalPathFeatureEnabled = + core.uiSettings.get<boolean>(enableCriticalPath); + + return isCriticalPathFeatureEnabled; +} diff --git a/x-pack/plugins/apm/public/hooks/use_fetcher.integration.test.tsx b/x-pack/plugins/apm/public/hooks/use_fetcher.integration.test.tsx index 4b19ea5dddbda..27f29b7dff12e 100644 --- a/x-pack/plugins/apm/public/hooks/use_fetcher.integration.test.tsx +++ b/x-pack/plugins/apm/public/hooks/use_fetcher.integration.test.tsx @@ -23,7 +23,7 @@ describe('when simulating race condition', () => { let renderSpy: jest.Mock; beforeEach(async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); renderSpy = jest.fn(); requestCallOrder = []; diff --git a/x-pack/plugins/apm/public/hooks/use_fetcher.test.tsx b/x-pack/plugins/apm/public/hooks/use_fetcher.test.tsx index ed4d1f0791992..a25fcb7245451 100644 --- a/x-pack/plugins/apm/public/hooks/use_fetcher.test.tsx +++ b/x-pack/plugins/apm/public/hooks/use_fetcher.test.tsx @@ -36,7 +36,7 @@ describe('useFetcher', () => { >; beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); async function fn() { await delay(500); return 'response from hook'; @@ -86,7 +86,7 @@ describe('useFetcher', () => { >; beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); async function fn(): Promise<string> { await delay(500); throw new Error('Something went wrong'); @@ -129,7 +129,7 @@ describe('useFetcher', () => { describe('when a hook already has data', () => { it('should show "first response" while loading "second response"', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const hook = renderHook( /* eslint-disable-next-line react-hooks/exhaustive-deps */ diff --git a/x-pack/plugins/apm/public/hooks/use_ml_manage_jobs_href.ts b/x-pack/plugins/apm/public/hooks/use_ml_manage_jobs_href.ts index 5eb1f6bb8f0bf..c5b9b0dba5a3a 100644 --- a/x-pack/plugins/apm/public/hooks/use_ml_manage_jobs_href.ts +++ b/x-pack/plugins/apm/public/hooks/use_ml_manage_jobs_href.ts @@ -5,9 +5,7 @@ * 2.0. */ -import { UI_SETTINGS } from '@kbn/data-plugin/public'; import { ML_PAGES, useMlHref } from '@kbn/ml-plugin/public'; -import { TimePickerRefreshInterval } from '../components/shared/date_picker/typings'; import { useApmPluginContext } from '../context/apm_plugin/use_apm_plugin_context'; import { useLegacyUrlParams } from '../context/url_params_context/use_url_params'; @@ -19,17 +17,10 @@ export function useMlManageJobsHref({ jobId }: { jobId?: string } = {}) { const { urlParams } = useLegacyUrlParams(); - const timePickerRefreshIntervalDefaults = - core.uiSettings.get<TimePickerRefreshInterval>( - UI_SETTINGS.TIMEPICKER_REFRESH_INTERVAL_DEFAULTS - ); - const { // hardcoding a custom default of 1 hour since the default kibana timerange of 15 minutes is shorter than the ML interval rangeFrom = 'now-1h', rangeTo = 'now', - refreshInterval = timePickerRefreshIntervalDefaults.value, - refreshPaused = timePickerRefreshIntervalDefaults.pause, } = urlParams; const mlADLink = useMlHref(ml, core.http.basePath.get(), { @@ -39,7 +30,7 @@ export function useMlManageJobsHref({ jobId }: { jobId?: string } = {}) { jobId, globalState: { time: { from: rangeFrom, to: rangeTo }, - refreshInterval: { pause: refreshPaused, value: refreshInterval }, + refreshInterval: { pause: true, value: 10000 }, }, }, }); diff --git a/x-pack/plugins/apm/public/hooks/use_service_metric_charts_fetcher.ts b/x-pack/plugins/apm/public/hooks/use_service_metric_charts_fetcher.ts index 8c55178d7bbed..624c3c626fe97 100644 --- a/x-pack/plugins/apm/public/hooks/use_service_metric_charts_fetcher.ts +++ b/x-pack/plugins/apm/public/hooks/use_service_metric_charts_fetcher.ts @@ -32,7 +32,7 @@ export function useServiceMetricChartsFetcher({ } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { agentName, serviceName, runtimeName } = useApmServiceContext(); + const { agentName, serviceName } = useApmServiceContext(); const { data = INITIAL_DATA, @@ -53,23 +53,13 @@ export function useServiceMetricChartsFetcher({ start, end, agentName, - serviceRuntimeName: runtimeName, }, }, } ); } }, - [ - environment, - kuery, - serviceName, - start, - end, - agentName, - serviceNodeName, - runtimeName, - ] + [environment, kuery, serviceName, start, end, agentName, serviceNodeName] ); return { diff --git a/x-pack/plugins/apm/public/hooks/use_trace_explorer_samples.ts b/x-pack/plugins/apm/public/hooks/use_trace_explorer_samples.ts new file mode 100644 index 0000000000000..17b71ac1cc28a --- /dev/null +++ b/x-pack/plugins/apm/public/hooks/use_trace_explorer_samples.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 { useMemo } from 'react'; +import { createSharedUseFetcher } from './create_shared_use_fetcher'; + +const sharedUseFetcher = createSharedUseFetcher( + 'GET /internal/apm/traces/find' +); + +const useTraceExplorerSamples = () => { + const result = sharedUseFetcher.useFetcherResult(); + + return useMemo(() => { + return { + ...result, + data: result.data || { + traceSamples: [], + }, + }; + }, [result]); +}; +const TraceExplorerSamplesFetcherContextProvider = sharedUseFetcher.Provider; + +export { useTraceExplorerSamples, TraceExplorerSamplesFetcherContextProvider }; diff --git a/x-pack/plugins/apm/public/hooks/use_transaction_trace_samples_fetcher.ts b/x-pack/plugins/apm/public/hooks/use_transaction_trace_samples_fetcher.ts index 9bb2b68266827..510118b6a191c 100644 --- a/x-pack/plugins/apm/public/hooks/use_transaction_trace_samples_fetcher.ts +++ b/x-pack/plugins/apm/public/hooks/use_transaction_trace_samples_fetcher.ts @@ -12,10 +12,6 @@ import { useApmServiceContext } from '../context/apm_service/use_apm_service_con import { useApmParams } from './use_apm_params'; import { useTimeRange } from './use_time_range'; -const INITIAL_DATA = { - traceSamples: [], -}; - export type TraceSamplesFetchResult = ReturnType< typeof useTransactionTraceSamplesFetcher >; @@ -41,11 +37,7 @@ export function useTransactionTraceSamplesFetcher({ urlParams: { transactionId, traceId, sampleRangeFrom, sampleRangeTo }, } = useLegacyUrlParams(); - const { - data = INITIAL_DATA, - status, - error, - } = useFetcher( + const { data, status, error } = useFetcher( (callApmApi) => { if (serviceName && start && end && transactionType && transactionName) { return callApmApi( diff --git a/x-pack/plugins/apm/public/plugin.ts b/x-pack/plugins/apm/public/plugin.ts index 18dcba1468780..0ea3fa56d1dda 100644 --- a/x-pack/plugins/apm/public/plugin.ts +++ b/x-pack/plugins/apm/public/plugin.ts @@ -21,6 +21,7 @@ import type { DataPublicPluginStart, DataPublicPluginSetup, } from '@kbn/data-plugin/public'; +import { LensPublicStart } from '@kbn/lens-plugin/public'; import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import type { EmbeddableStart } from '@kbn/embeddable-plugin/public'; import type { HomePublicPluginSetup } from '@kbn/home-plugin/public'; @@ -48,7 +49,6 @@ import type { } from '@kbn/triggers-actions-ui-plugin/public'; import type { SecurityPluginStart } from '@kbn/security-plugin/public'; import { SpacesPluginStart } from '@kbn/spaces-plugin/public'; -import { enableServiceGroups } from '@kbn/observability-plugin/public'; import { InfraClientStartExports } from '@kbn/infra-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { registerApmRuleTypes } from './components/alerting/rule_types/register_apm_rule_types'; @@ -98,16 +98,17 @@ export interface ApmPluginStartDeps { dataViews: DataViewsPublicPluginStart; unifiedSearch: UnifiedSearchPublicPluginStart; storage: IStorageWrapper; + lens: LensPublicStart; } const servicesTitle = i18n.translate('xpack.apm.navigation.servicesTitle', { defaultMessage: 'Services', }); -const allServicesTitle = i18n.translate( - 'xpack.apm.navigation.allServicesTitle', +const serviceGroupsTitle = i18n.translate( + 'xpack.apm.navigation.serviceGroupsTitle', { - defaultMessage: 'All services', + defaultMessage: 'Service groups', } ); @@ -154,11 +155,6 @@ export class ApmPlugin implements Plugin<ApmPluginSetup, ApmPluginStart> { pluginSetupDeps.home.featureCatalogue.register(featureCatalogueEntry); } - const serviceGroupsEnabled = core.uiSettings.get<boolean>( - enableServiceGroups, - false - ); - // register observability nav if user has access to plugin plugins.observability.navigation.registerSections( from(core.getStartServices()).pipe( @@ -170,26 +166,18 @@ export class ApmPlugin implements Plugin<ApmPluginSetup, ApmPluginStart> { label: 'APM', sortKey: 400, entries: [ - serviceGroupsEnabled - ? { - label: servicesTitle, - app: 'apm', - path: '/service-groups', - matchPath(currentPath: string) { - return [ - '/service-groups', - '/services', - '/service-map', - ].some((testPath) => - currentPath.startsWith(testPath) - ); - }, - } - : { - label: servicesTitle, - app: 'apm', - path: '/services', - }, + { + label: servicesTitle, + app: 'apm', + path: '/services', + matchPath(currentPath: string) { + return [ + '/service-groups', + '/services', + '/service-map', + ].some((testPath) => currentPath.startsWith(testPath)); + }, + }, { label: tracesTitle, app: 'apm', path: '/traces' }, { label: dependenciesTitle, @@ -209,15 +197,6 @@ export class ApmPlugin implements Plugin<ApmPluginSetup, ApmPluginStart> { } }, }, - ...(serviceGroupsEnabled - ? [] - : [ - { - label: serviceMapTitle, - app: 'apm', - path: '/service-map', - }, - ]), ], }, ]; @@ -298,18 +277,14 @@ export class ApmPlugin implements Plugin<ApmPluginSetup, ApmPluginStart> { icon: 'plugins/apm/public/icon.svg', category: DEFAULT_APP_CATEGORIES.observability, deepLinks: [ - ...(serviceGroupsEnabled - ? [ - { - id: 'service-groups-list', - title: servicesTitle, - path: '/service-groups', - }, - ] - : []), + { + id: 'service-groups-list', + title: serviceGroupsTitle, + path: '/service-groups', + }, { id: 'services', - title: serviceGroupsEnabled ? allServicesTitle : servicesTitle, + title: servicesTitle, path: '/services', }, { id: 'traces', title: tracesTitle, path: '/traces' }, diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/agent_config_instructions.tsx b/x-pack/plugins/apm/public/tutorial/config_agent/agent_config_instructions.tsx index c7244002e59f5..0e4ad1f3f44a0 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/agent_config_instructions.tsx +++ b/x-pack/plugins/apm/public/tutorial/config_agent/agent_config_instructions.tsx @@ -25,7 +25,7 @@ export function AgentConfigInstructions({ }) { const defaultValues = { apmServiceName: 'my-service-name', - apmEnvironment: 'production', + apmEnvironment: 'my-environment', }; if (variantId === 'openTelemetry') { @@ -60,7 +60,11 @@ export function AgentConfigInstructions({ /> <EuiSpacer /> - <EuiCodeBlock isCopyable language="bash" data-test-subj="commands"> + <EuiCodeBlock + isCopyable + language={variantId === 'java' ? variantId : 'bash'} + data-test-subj="commands" + > {commands} </EuiCodeBlock> </> diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/commands/django.ts b/x-pack/plugins/apm/public/tutorial/config_agent/commands/django.ts index 4379f15c59cde..15279a71a6573 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/commands/django.ts +++ b/x-pack/plugins/apm/public/tutorial/config_agent/commands/django.ts @@ -9,8 +9,8 @@ import { i18n } from '@kbn/i18n'; export const djangoVariables = { apmServiceName: 'SERVICE_NAME', - apmServerUrl: 'SERVER_URL', secretToken: 'SECRET_TOKEN', + apmServerUrl: 'SERVER_URL', apmEnvironment: 'ENVIRONMENT', }; @@ -21,50 +21,50 @@ export const django = `# ${i18n.translate( } )} INSTALLED_APPS = ( -'elasticapm.contrib.django', -# ... + 'elasticapm.contrib.django', + # ... ) ELASTIC_APM = { -# ${i18n.translate( - 'xpack.apm.tutorial.djangoClient.configure.commands.setRequiredServiceNameComment', - { - defaultMessage: 'Set the required service name. Allowed characters:', - } -)} -# ${i18n.translate( - 'xpack.apm.tutorial.djangoClient.configure.commands.allowedCharactersComment', - { - defaultMessage: 'a-z, A-Z, 0-9, -, _, and space', - } -)} -#'${djangoVariables.apmServiceName}': '{{{apmServiceName}}}', + # ${i18n.translate( + 'xpack.apm.tutorial.djangoClient.configure.commands.setRequiredServiceNameComment', + { + defaultMessage: 'Set the required service name. Allowed characters:', + } + )} + # ${i18n.translate( + 'xpack.apm.tutorial.djangoClient.configure.commands.allowedCharactersComment', + { + defaultMessage: 'a-z, A-Z, 0-9, -, _, and space', + } + )} + #'${djangoVariables.apmServiceName}': '{{{apmServiceName}}}', -# ${i18n.translate( - 'xpack.apm.tutorial.djangoClient.configure.commands.useIfApmServerRequiresTokenComment', - { - defaultMessage: 'Use if APM Server requires a secret token', - } -)} -'${djangoVariables.secretToken}': '{{{secretToken}}}', + # ${i18n.translate( + 'xpack.apm.tutorial.djangoClient.configure.commands.useIfApmServerRequiresTokenComment', + { + defaultMessage: 'Use if APM Server requires a secret token', + } + )} + '${djangoVariables.secretToken}': '{{{secretToken}}}', -# ${i18n.translate( - 'xpack.apm.tutorial.djangoClient.configure.commands.setCustomApmServerUrlComment', - { - defaultMessage: - 'Set the custom APM Server URL (default: {defaultApmServerUrl})', - values: { defaultApmServerUrl: 'http://localhost:8200' }, - } -)} -'${djangoVariables.apmServerUrl}': '{{{apmServerUrl}}}', + # ${i18n.translate( + 'xpack.apm.tutorial.djangoClient.configure.commands.setCustomApmServerUrlComment', + { + defaultMessage: + 'Set the custom APM Server URL (default: {defaultApmServerUrl})', + values: { defaultApmServerUrl: 'http://localhost:8200' }, + } + )} + '${djangoVariables.apmServerUrl}': '{{{apmServerUrl}}}', -# ${i18n.translate( - 'xpack.apm.tutorial.djangoClient.configure.commands.setServiceEnvironmentComment', - { - defaultMessage: 'Set the service environment', - } -)} -'${djangoVariables.apmEnvironment}': '{{{apmEnvironment}}}', + # ${i18n.translate( + 'xpack.apm.tutorial.djangoClient.configure.commands.setServiceEnvironmentComment', + { + defaultMessage: 'Set the service environment', + } + )} + '${djangoVariables.apmEnvironment}': '{{{apmEnvironment}}}', } # ${i18n.translate( @@ -74,6 +74,6 @@ ELASTIC_APM = { } )} MIDDLEWARE = ( -'elasticapm.contrib.django.middleware.TracingMiddleware', -#... + 'elasticapm.contrib.django.middleware.TracingMiddleware', + #... )`; diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/commands/flask.ts b/x-pack/plugins/apm/public/tutorial/config_agent/commands/flask.ts index 11423c4e059db..a6289c0a88c1b 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/commands/flask.ts +++ b/x-pack/plugins/apm/public/tutorial/config_agent/commands/flask.ts @@ -33,45 +33,45 @@ apm = ElasticAPM(app) )} from elasticapm.contrib.flask import ElasticAPM app.config['ELASTIC_APM'] = { -# ${i18n.translate( - 'xpack.apm.tutorial.flaskClient.configure.commands.setRequiredServiceNameComment', - { - defaultMessage: 'Set the required service name. Allowed characters:', - } -)} -# ${i18n.translate( - 'xpack.apm.tutorial.flaskClient.configure.commands.allowedCharactersComment', - { - defaultMessage: 'a-z, A-Z, 0-9, -, _, and space', - } -)} -#'${flaskVariables.apmServiceName}': '{{{apmServiceName}}}', + # ${i18n.translate( + 'xpack.apm.tutorial.flaskClient.configure.commands.setRequiredServiceNameComment', + { + defaultMessage: 'Set the required service name. Allowed characters:', + } + )} + # ${i18n.translate( + 'xpack.apm.tutorial.flaskClient.configure.commands.allowedCharactersComment', + { + defaultMessage: 'a-z, A-Z, 0-9, -, _, and space', + } + )} + #'${flaskVariables.apmServiceName}': '{{{apmServiceName}}}', -# ${i18n.translate( - 'xpack.apm.tutorial.flaskClient.configure.commands.useIfApmServerRequiresTokenComment', - { - defaultMessage: 'Use if APM Server requires a secret token', - } -)} -'${flaskVariables.secretToken}': '{{{secretToken}}}', + # ${i18n.translate( + 'xpack.apm.tutorial.flaskClient.configure.commands.useIfApmServerRequiresTokenComment', + { + defaultMessage: 'Use if APM Server requires a secret token', + } + )} + '${flaskVariables.secretToken}': '{{{secretToken}}}', -# ${i18n.translate( - 'xpack.apm.tutorial.flaskClient.configure.commands.setCustomApmServerUrlComment', - { - defaultMessage: - 'Set the custom APM Server URL (default: {defaultApmServerUrl})', - values: { defaultApmServerUrl: 'http://localhost:8200' }, - } -)} -'${flaskVariables.apmServerUrl}': '{{{apmServerUrl}}}', + # ${i18n.translate( + 'xpack.apm.tutorial.flaskClient.configure.commands.setCustomApmServerUrlComment', + { + defaultMessage: + 'Set the custom APM Server URL (default: {defaultApmServerUrl})', + values: { defaultApmServerUrl: 'http://localhost:8200' }, + } + )} + '${flaskVariables.apmServerUrl}': '{{{apmServerUrl}}}', -# ${i18n.translate( - 'xpack.apm.tutorial.flaskClient.configure.commands.setServiceEnvironmentComment', - { - defaultMessage: 'Set the service environment', - } -)} -'${flaskVariables.apmEnvironment}': '{{{apmEnvironment}}}', + # ${i18n.translate( + 'xpack.apm.tutorial.flaskClient.configure.commands.setServiceEnvironmentComment', + { + defaultMessage: 'Set the service environment', + } + )} + '${flaskVariables.apmEnvironment}': '{{{apmEnvironment}}}', } apm = ElasticAPM(app)`; diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/commands/get_apm_agent_commands.test.ts b/x-pack/plugins/apm/public/tutorial/config_agent/commands/get_apm_agent_commands.test.ts index efbcfae955a55..d01d3acc5d519 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/commands/get_apm_agent_commands.test.ts +++ b/x-pack/plugins/apm/public/tutorial/config_agent/commands/get_apm_agent_commands.test.ts @@ -10,7 +10,7 @@ import { getApmAgentCommands } from './get_apm_agent_commands'; describe('getCommands', () => { const defaultValues = { apmServiceName: 'my-service-name', - apmEnvironment: 'production', + apmEnvironment: 'my-environment', }; describe('unknown agent', () => { it('renders empty command', () => { @@ -37,7 +37,7 @@ describe('getCommands', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token= \\\\ -Delastic.apm.server_url= \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); @@ -57,7 +57,7 @@ describe('getCommands', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token=foobar \\\\ -Delastic.apm.server_url=localhost:8220 \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); @@ -85,7 +85,7 @@ describe('getCommands', () => { serviceVersion: '', // Set the service environment - environment: 'production' + environment: 'my-environment' })" `); }); @@ -113,7 +113,7 @@ describe('getCommands', () => { serviceVersion: '', // Set the service environment - environment: 'production' + environment: 'my-environment' })" `); }); @@ -130,18 +130,18 @@ describe('getCommands', () => { "// Add this to the VERY top of the first file loaded in your app var apm = require('elastic-apm-node').start({ - // Override the service name from package.json - // Allowed characters: a-z, A-Z, 0-9, -, _, and space - serviceName: 'my-service-name', + // Override the service name from package.json + // Allowed characters: a-z, A-Z, 0-9, -, _, and space + serviceName: 'my-service-name', - // Use if APM Server requires a secret token - secretToken: '', + // Use if APM Server requires a secret token + secretToken: '', - // Set the custom APM Server URL (default: http://localhost:8200) - serverUrl: '', + // Set the custom APM Server URL (default: http://localhost:8200) + serverUrl: '', - // Set the service environment - environment: 'production' + // Set the service environment + environment: 'my-environment' })" `); }); @@ -159,18 +159,18 @@ describe('getCommands', () => { "// Add this to the VERY top of the first file loaded in your app var apm = require('elastic-apm-node').start({ - // Override the service name from package.json - // Allowed characters: a-z, A-Z, 0-9, -, _, and space - serviceName: 'my-service-name', + // Override the service name from package.json + // Allowed characters: a-z, A-Z, 0-9, -, _, and space + serviceName: 'my-service-name', - // Use if APM Server requires a secret token - secretToken: 'foobar', + // Use if APM Server requires a secret token + secretToken: 'foobar', - // Set the custom APM Server URL (default: http://localhost:8200) - serverUrl: 'localhost:8220', + // Set the custom APM Server URL (default: http://localhost:8200) + serverUrl: 'localhost:8220', - // Set the service environment - environment: 'production' + // Set the service environment + environment: 'my-environment' })" `); }); @@ -186,29 +186,29 @@ describe('getCommands', () => { expect(commands).toMatchInlineSnapshot(` "# Add the agent to the installed apps INSTALLED_APPS = ( - 'elasticapm.contrib.django', - # ... + 'elasticapm.contrib.django', + # ... ) ELASTIC_APM = { - # Set the required service name. Allowed characters: - # a-z, A-Z, 0-9, -, _, and space - #'SERVICE_NAME': 'my-service-name', + # Set the required service name. Allowed characters: + # a-z, A-Z, 0-9, -, _, and space + #'SERVICE_NAME': 'my-service-name', - # Use if APM Server requires a secret token - 'SECRET_TOKEN': '', + # Use if APM Server requires a secret token + 'SECRET_TOKEN': '', - # Set the custom APM Server URL (default: http://localhost:8200) - 'SERVER_URL': '', + # Set the custom APM Server URL (default: http://localhost:8200) + 'SERVER_URL': '', - # Set the service environment - 'ENVIRONMENT': 'production', + # Set the service environment + 'ENVIRONMENT': 'my-environment', } # To send performance metrics, add our tracing middleware: MIDDLEWARE = ( - 'elasticapm.contrib.django.middleware.TracingMiddleware', - #... + 'elasticapm.contrib.django.middleware.TracingMiddleware', + #... )" `); }); @@ -225,29 +225,29 @@ describe('getCommands', () => { expect(commands).toMatchInlineSnapshot(` "# Add the agent to the installed apps INSTALLED_APPS = ( - 'elasticapm.contrib.django', - # ... + 'elasticapm.contrib.django', + # ... ) ELASTIC_APM = { - # Set the required service name. Allowed characters: - # a-z, A-Z, 0-9, -, _, and space - #'SERVICE_NAME': 'my-service-name', + # Set the required service name. Allowed characters: + # a-z, A-Z, 0-9, -, _, and space + #'SERVICE_NAME': 'my-service-name', - # Use if APM Server requires a secret token - 'SECRET_TOKEN': 'foobar', + # Use if APM Server requires a secret token + 'SECRET_TOKEN': 'foobar', - # Set the custom APM Server URL (default: http://localhost:8200) - 'SERVER_URL': 'localhost:8220', + # Set the custom APM Server URL (default: http://localhost:8200) + 'SERVER_URL': 'localhost:8220', - # Set the service environment - 'ENVIRONMENT': 'production', + # Set the service environment + 'ENVIRONMENT': 'my-environment', } # To send performance metrics, add our tracing middleware: MIDDLEWARE = ( - 'elasticapm.contrib.django.middleware.TracingMiddleware', - #... + 'elasticapm.contrib.django.middleware.TracingMiddleware', + #... )" `); }); @@ -269,18 +269,18 @@ describe('getCommands', () => { # or configure to use ELASTIC_APM in your application's settings from elasticapm.contrib.flask import ElasticAPM app.config['ELASTIC_APM'] = { - # Set the required service name. Allowed characters: - # a-z, A-Z, 0-9, -, _, and space - #'SERVICE_NAME': 'my-service-name', + # Set the required service name. Allowed characters: + # a-z, A-Z, 0-9, -, _, and space + #'SERVICE_NAME': 'my-service-name', - # Use if APM Server requires a secret token - 'SECRET_TOKEN': '', + # Use if APM Server requires a secret token + 'SECRET_TOKEN': '', - # Set the custom APM Server URL (default: http://localhost:8200) - 'SERVER_URL': '', + # Set the custom APM Server URL (default: http://localhost:8200) + 'SERVER_URL': '', - # Set the service environment - 'ENVIRONMENT': 'production', + # Set the service environment + 'ENVIRONMENT': 'my-environment', } apm = ElasticAPM(app)" @@ -305,18 +305,18 @@ describe('getCommands', () => { # or configure to use ELASTIC_APM in your application's settings from elasticapm.contrib.flask import ElasticAPM app.config['ELASTIC_APM'] = { - # Set the required service name. Allowed characters: - # a-z, A-Z, 0-9, -, _, and space - #'SERVICE_NAME': 'my-service-name', + # Set the required service name. Allowed characters: + # a-z, A-Z, 0-9, -, _, and space + #'SERVICE_NAME': 'my-service-name', - # Use if APM Server requires a secret token - 'SECRET_TOKEN': 'foobar', + # Use if APM Server requires a secret token + 'SECRET_TOKEN': 'foobar', - # Set the custom APM Server URL (default: http://localhost:8200) - 'SERVER_URL': 'localhost:8220', + # Set the custom APM Server URL (default: http://localhost:8200) + 'SERVER_URL': 'localhost:8220', - # Set the service environment - 'ENVIRONMENT': 'production', + # Set the service environment + 'ENVIRONMENT': 'my-environment', } apm = ElasticAPM(app)" @@ -345,7 +345,7 @@ describe('getCommands', () => { server_url: '' # Set the service environment - environment: 'production'" + environment: 'my-environment'" `); }); it('renders with secret token and url', () => { @@ -372,7 +372,7 @@ describe('getCommands', () => { server_url: 'localhost:8220' # Set the service environment - environment: 'production'" + environment: 'my-environment'" `); }); }); @@ -398,7 +398,7 @@ describe('getCommands', () => { server_url: '', # Set the service environment - environment: 'production'" + environment: 'my-environment'" `); }); it('renders with secret token and url', () => { @@ -425,7 +425,7 @@ describe('getCommands', () => { server_url: 'localhost:8220', # Set the service environment - environment: 'production'" + environment: 'my-environment'" `); }); }); @@ -451,7 +451,7 @@ describe('getCommands', () => { export ELASTIC_APM_SERVER_URL= # Set the service environment - export ELASTIC_APM_ENVIRONMENT=production + export ELASTIC_APM_ENVIRONMENT=my-environment " `); }); @@ -479,7 +479,7 @@ describe('getCommands', () => { export ELASTIC_APM_SERVER_URL=localhost:8220 # Set the service environment - export ELASTIC_APM_ENVIRONMENT=production + export ELASTIC_APM_ENVIRONMENT=my-environment " `); }); @@ -498,7 +498,7 @@ describe('getCommands', () => { \\"ServiceName\\": \\"my-service-name\\", //allowed characters: a-z, A-Z, 0-9, -, _, and space. Default is the entry assembly of the application \\"SecretToken\\": \\"\\", \\"ServerUrl\\": \\"\\", //Set custom APM Server URL (default: http://localhost:8200) - \\"Environment\\": \\"production\\", // Set the service environment + \\"Environment\\": \\"my-environment\\", // Set the service environment } }" `); @@ -519,7 +519,7 @@ describe('getCommands', () => { \\"ServiceName\\": \\"my-service-name\\", //allowed characters: a-z, A-Z, 0-9, -, _, and space. Default is the entry assembly of the application \\"SecretToken\\": \\"foobar\\", \\"ServerUrl\\": \\"localhost:8220\\", //Set custom APM Server URL (default: http://localhost:8200) - \\"Environment\\": \\"production\\", // Set the service environment + \\"Environment\\": \\"my-environment\\", // Set the service environment } }" `); @@ -537,7 +537,7 @@ describe('getCommands', () => { "elastic_apm.service_name=\\"my-service-name\\" elastic_apm.secret_token=\\"\\" elastic_apm.server_url=\\"\\" - elastic_apm.environment=\\"production\\" + elastic_apm.environment=\\"my-environment\\" " `); }); @@ -555,7 +555,7 @@ describe('getCommands', () => { "elastic_apm.service_name=\\"my-service-name\\" elastic_apm.secret_token=\\"foobar\\" elastic_apm.server_url=\\"localhost:8220\\" - elastic_apm.environment=\\"production\\" + elastic_apm.environment=\\"my-environment\\" " `); }); diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/commands/java.ts b/x-pack/plugins/apm/public/tutorial/config_agent/commands/java.ts index 2d056b3a242f3..4edcb6aab2170 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/commands/java.ts +++ b/x-pack/plugins/apm/public/tutorial/config_agent/commands/java.ts @@ -16,6 +16,6 @@ export const java = `java -javaagent:/path/to/elastic-apm-agent-<version>.jar \\ -${javaVariables.apmServiceName}={{{apmServiceName}}} \\ -${javaVariables.secretToken}={{{secretToken}}} \\ -${javaVariables.apmServerUrl}={{{apmServerUrl}}} \\ --${javaVariables.apmEnvironment}=production \\ +-${javaVariables.apmEnvironment}={{{apmEnvironment}}} \\ -Delastic.apm.application_packages=org.example \\ -jar {{{apmServiceName}}}.jar`; diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/commands/node.ts b/x-pack/plugins/apm/public/tutorial/config_agent/commands/node.ts index 8b8ba07a7cb9c..2510599cff94e 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/commands/node.ts +++ b/x-pack/plugins/apm/public/tutorial/config_agent/commands/node.ts @@ -22,43 +22,43 @@ export const node = `// ${i18n.translate( )} var apm = require('elastic-apm-node').start({ -// ${i18n.translate( - 'xpack.apm.tutorial.nodeClient.configure.commands.setRequiredServiceNameComment', - { - defaultMessage: 'Override the service name from package.json', - } -)} -// ${i18n.translate( - 'xpack.apm.tutorial.nodeClient.configure.commands.allowedCharactersComment', - { - defaultMessage: 'Allowed characters: a-z, A-Z, 0-9, -, _, and space', - } -)} -${nodeVariables.apmServiceName}: '{{{apmServiceName}}}', + // ${i18n.translate( + 'xpack.apm.tutorial.nodeClient.configure.commands.setRequiredServiceNameComment', + { + defaultMessage: 'Override the service name from package.json', + } + )} + // ${i18n.translate( + 'xpack.apm.tutorial.nodeClient.configure.commands.allowedCharactersComment', + { + defaultMessage: 'Allowed characters: a-z, A-Z, 0-9, -, _, and space', + } + )} + ${nodeVariables.apmServiceName}: '{{{apmServiceName}}}', -// ${i18n.translate( - 'xpack.apm.tutorial.nodeClient.configure.commands.useIfApmRequiresTokenComment', - { - defaultMessage: 'Use if APM Server requires a secret token', - } -)} -${nodeVariables.secretToken}: '{{{secretToken}}}', + // ${i18n.translate( + 'xpack.apm.tutorial.nodeClient.configure.commands.useIfApmRequiresTokenComment', + { + defaultMessage: 'Use if APM Server requires a secret token', + } + )} + ${nodeVariables.secretToken}: '{{{secretToken}}}', -// ${i18n.translate( - 'xpack.apm.tutorial.nodeClient.configure.commands.setCustomApmServerUrlComment', - { - defaultMessage: - 'Set the custom APM Server URL (default: {defaultApmServerUrl})', - values: { defaultApmServerUrl: 'http://localhost:8200' }, - } -)} -${nodeVariables.apmServerUrl}: '{{{apmServerUrl}}}', + // ${i18n.translate( + 'xpack.apm.tutorial.nodeClient.configure.commands.setCustomApmServerUrlComment', + { + defaultMessage: + 'Set the custom APM Server URL (default: {defaultApmServerUrl})', + values: { defaultApmServerUrl: 'http://localhost:8200' }, + } + )} + ${nodeVariables.apmServerUrl}: '{{{apmServerUrl}}}', -// ${i18n.translate( - 'xpack.apm.tutorial.nodeClient.configure.commands.setCustomServiceEnvironmentComment', - { - defaultMessage: 'Set the service environment', - } -)} -${nodeVariables.apmEnvironment}: '{{{apmEnvironment}}}' + // ${i18n.translate( + 'xpack.apm.tutorial.nodeClient.configure.commands.setCustomServiceEnvironmentComment', + { + defaultMessage: 'Set the service environment', + } + )} + ${nodeVariables.apmEnvironment}: '{{{apmEnvironment}}}' })`; diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx b/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx index b1ebe783518d0..edae01e0b6043 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx +++ b/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx @@ -90,7 +90,7 @@ describe('TutorialConfigAgent', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token= \\\\ -Delastic.apm.server_url=http://localhost:8200 \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); @@ -104,7 +104,7 @@ describe('TutorialConfigAgent', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token=foo token \\\\ -Delastic.apm.server_url=foo url \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); @@ -141,7 +141,7 @@ describe('TutorialConfigAgent', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token= \\\\ -Delastic.apm.server_url=http://localhost:8200 \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); @@ -177,7 +177,7 @@ describe('TutorialConfigAgent', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token= \\\\ -Delastic.apm.server_url=http://localhost:8200 \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); @@ -219,7 +219,7 @@ describe('TutorialConfigAgent', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token=cloud_token \\\\ -Delastic.apm.server_url=cloud_url \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); @@ -258,7 +258,7 @@ describe('TutorialConfigAgent', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token=apm_cloud_token \\\\ -Delastic.apm.server_url=apm_cloud_url \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); @@ -290,7 +290,7 @@ describe('TutorialConfigAgent', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token= \\\\ -Delastic.apm.server_url=http://localhost:8200 \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); @@ -353,7 +353,7 @@ describe('TutorialConfigAgent', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token= \\\\ -Delastic.apm.server_url=http://localhost:8200 \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); @@ -390,7 +390,7 @@ describe('TutorialConfigAgent', () => { -Delastic.apm.service_name=my-service-name \\\\ -Delastic.apm.secret_token=cloud_token \\\\ -Delastic.apm.server_url=cloud_url \\\\ - -Delastic.apm.environment=production \\\\ + -Delastic.apm.environment=my-environment \\\\ -Delastic.apm.application_packages=org.example \\\\ -jar my-service-name.jar" `); diff --git a/x-pack/plugins/apm/public/utils/test_helpers.tsx b/x-pack/plugins/apm/public/utils/test_helpers.tsx index 4510493fccef5..bb81f73ef7705 100644 --- a/x-pack/plugins/apm/public/utils/test_helpers.tsx +++ b/x-pack/plugins/apm/public/utils/test_helpers.tsx @@ -19,8 +19,6 @@ import { Moment } from 'moment-timezone'; import React from 'react'; import { MemoryRouter } from 'react-router-dom'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; -import type { ESSearchRequest, ESSearchResponse } from '@kbn/es-types'; -import { APMConfig } from '../../server'; import { MockApmPluginContextWrapper } from '../context/apm_plugin/mock_apm_plugin_context'; import { UrlParamsProvider } from '../context/url_params_context/url_params_context'; @@ -110,95 +108,6 @@ export function expectTextsInDocument(output: any, texts: string[]) { }); } -interface MockSetup { - apmEventClient: any; - internalClient: any; - config: APMConfig; - indices: { - sourcemap: string; - error: string; - onboarding: string; - span: string; - transaction: string; - metric: string; - apmAgentConfigurationIndex: string; - apmCustomLinkIndex: string; - }; -} - -interface Options { - mockResponse?: ( - request: ESSearchRequest - ) => ESSearchResponse<unknown, ESSearchRequest>; -} - -export async function inspectSearchParams( - fn: (mockSetup: MockSetup) => Promise<any>, - options: Options = {} -) { - const spy = jest.fn().mockImplementation(async (request) => { - return options.mockResponse - ? options.mockResponse(request) - : { - hits: { - hits: { - total: { - value: 0, - }, - }, - }, - }; - }); - - let response; - let error; - - const mockSetup = { - apmEventClient: { search: spy } as any, - internalClient: { search: spy } as any, - config: new Proxy( - {}, - { - get: (_, key) => { - switch (key) { - default: - return 'myIndex'; - - case 'xpack.apm.metricsInterval': - return 30; - } - }, - } - ) as APMConfig, - indices: { - sourcemap: 'myIndex', - error: 'myIndex', - onboarding: 'myIndex', - span: 'myIndex', - transaction: 'myIndex', - metric: 'myIndex', - apmAgentConfigurationIndex: 'myIndex', - apmCustomLinkIndex: 'myIndex', - }, - }; - try { - response = await fn(mockSetup); - } catch (err) { - error = err; - // we're only extracting the search params - } - - return { - params: spy.mock.calls[0][0], - response, - error, - spy, - teardown: () => spy.mockClear(), - }; -} - -export type SearchParamsMock = Awaited<ReturnType<typeof inspectSearchParams>>; - export function renderWithTheme( component: React.ReactNode, params?: any, diff --git a/x-pack/plugins/apm/scripts/infer_route_return_types/index.ts b/x-pack/plugins/apm/scripts/infer_route_return_types/index.ts index 081d7cacef801..ee5a05f64ca40 100644 --- a/x-pack/plugins/apm/scripts/infer_route_return_types/index.ts +++ b/x-pack/plugins/apm/scripts/infer_route_return_types/index.ts @@ -21,7 +21,6 @@ import { import Path from 'path'; import { execSync } from 'child_process'; import { argv } from 'yargs'; -// @ts-expect-error import { optimizeTsConfig } from '../optimize_tsconfig/optimize'; // This script adds explicit return types to route handlers, diff --git a/x-pack/plugins/apm/server/index.ts b/x-pack/plugins/apm/server/index.ts index 85fb7efc53702..17682706571cc 100644 --- a/x-pack/plugins/apm/server/index.ts +++ b/x-pack/plugins/apm/server/index.ts @@ -54,6 +54,7 @@ const configSchema = schema.object({ sourcemap: schema.string({ defaultValue: 'apm-*' }), onboarding: schema.string({ defaultValue: 'apm-*' }), }), + forceSyntheticSource: schema.boolean({ defaultValue: false }), }); // plugin config diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/anomaly_search.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/anomaly_search.ts index b6d54dd5c63ee..0017e94863828 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/anomaly_search.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/anomaly_search.ts @@ -6,7 +6,7 @@ */ import type { ESSearchRequest, ESSearchResponse } from '@kbn/es-types'; -import { Setup } from '../helpers/setup_request'; +import { MlClient } from '../helpers/get_ml_client'; interface SharedFields { job_id: string; @@ -43,7 +43,7 @@ interface MlRecord extends SharedFields { type AnomalyDocument = MlRecord | MlModelPlot; export async function anomalySearch<TParams extends ESSearchRequest>( - mlAnomalySearch: Required<Setup>['ml']['mlSystem']['mlAnomalySearch'], + mlAnomalySearch: Required<MlClient>['mlSystem']['mlAnomalySearch'], params: TParams ): Promise<ESSearchResponse<AnomalyDocument, TParams>> { const response = await mlAnomalySearch(params, []); diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts index fd369cd1328f2..7480fd1c847f3 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts @@ -19,22 +19,31 @@ import { import { Environment } from '../../../common/environment_rt'; import { environmentQuery } from '../../../common/utils/environment_query'; import { withApmSpan } from '../../utils/with_apm_span'; -import { Setup } from '../helpers/setup_request'; +import { MlClient } from '../helpers/get_ml_client'; import { APM_ML_JOB_GROUP, ML_MODULE_ID_APM_TRANSACTION } from './constants'; import { getAnomalyDetectionJobs } from './get_anomaly_detection_jobs'; +import { ApmIndicesConfig } from '../../routes/settings/apm_indices/get_apm_indices'; -export async function createAnomalyDetectionJobs( - setup: Setup, - environments: Environment[], - logger: Logger -) { - const { ml, indices } = setup; - - if (!ml) { +export async function createAnomalyDetectionJobs({ + mlClient, + indices, + environments, + logger, +}: { + mlClient?: MlClient; + indices: ApmIndicesConfig; + environments: Environment[]; + logger: Logger; +}) { + if (!mlClient) { throw Boom.notImplemented(ML_ERRORS.ML_NOT_AVAILABLE); } - const uniqueMlJobEnvs = await getUniqueMlJobEnvs(setup, environments, logger); + const uniqueMlJobEnvs = await getUniqueMlJobEnvs( + mlClient, + environments, + logger + ); if (uniqueMlJobEnvs.length === 0) { return []; } @@ -44,10 +53,10 @@ export async function createAnomalyDetectionJobs( `Creating ML anomaly detection jobs for environments: [${uniqueMlJobEnvs}].` ); - const dataViewName = indices.metric; + const apmMetricIndex = indices.metric; const responses = await Promise.all( uniqueMlJobEnvs.map((environment) => - createAnomalyDetectionJob({ ml, environment, dataViewName }) + createAnomalyDetectionJob({ mlClient, environment, apmMetricIndex }) ) ); @@ -66,22 +75,22 @@ export async function createAnomalyDetectionJobs( } async function createAnomalyDetectionJob({ - ml, + mlClient, environment, - dataViewName, + apmMetricIndex, }: { - ml: Required<Setup>['ml']; + mlClient: Required<MlClient>; environment: string; - dataViewName: string; + apmMetricIndex: string; }) { return withApmSpan('create_anomaly_detection_job', async () => { const randomToken = uuid().substr(-4); - return ml.modules.setup({ + return mlClient.modules.setup({ moduleId: ML_MODULE_ID_APM_TRANSACTION, prefix: `${APM_ML_JOB_GROUP}-${snakeCase(environment)}-${randomToken}-`, groups: [APM_ML_JOB_GROUP], - indexPatternName: dataViewName, + indexPatternName: apmMetricIndex, applyToAllSpaces: true, start: moment().subtract(4, 'weeks').valueOf(), query: { @@ -110,12 +119,12 @@ async function createAnomalyDetectionJob({ } async function getUniqueMlJobEnvs( - setup: Setup, + mlClient: MlClient, environments: Environment[], logger: Logger ) { // skip creation of duplicate ML jobs - const jobs = await getAnomalyDetectionJobs(setup); + const jobs = await getAnomalyDetectionJobs(mlClient); const existingMlJobEnvs = jobs .filter((job) => job.version === 3) .map(({ environment }) => environment); diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts index 9047ae9ed90d0..46b87f6247dcb 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts @@ -6,15 +6,13 @@ */ import Boom from '@hapi/boom'; import { ML_ERRORS } from '../../../common/anomaly_detection'; -import { Setup } from '../helpers/setup_request'; +import { MlClient } from '../helpers/get_ml_client'; import { getMlJobsWithAPMGroup } from './get_ml_jobs_with_apm_group'; -export function getAnomalyDetectionJobs(setup: Setup) { - const { ml } = setup; - - if (!ml) { +export function getAnomalyDetectionJobs(mlClient?: MlClient) { + if (!mlClient) { throw Boom.notImplemented(ML_ERRORS.ML_NOT_AVAILABLE); } - return getMlJobsWithAPMGroup(ml.anomalyDetectors); + return getMlJobsWithAPMGroup(mlClient.anomalyDetectors); } diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_timeseries.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_timeseries.ts index b1c77a4fe4372..50b8eef4001c9 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_timeseries.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_timeseries.ts @@ -19,7 +19,7 @@ import type { ServiceAnomalyTimeseries } from '../../../common/anomaly_detection import { apmMlJobsQuery } from './apm_ml_jobs_query'; import { asMutableArray } from '../../../common/utils/as_mutable_array'; import { maybe } from '../../../common/utils/maybe'; -import type { Setup } from '../helpers/setup_request'; +import type { MlClient } from '../helpers/get_ml_client'; import { anomalySearch } from './anomaly_search'; import { getAnomalyResultBucketSize } from './get_anomaly_result_bucket_size'; import { getMlJobsWithAPMGroup } from './get_ml_jobs_with_apm_group'; @@ -51,7 +51,7 @@ export async function getAnomalyTimeseries({ start, end, logger, - mlSetup, + mlClient, environment: preferredEnvironment, }: { serviceName: string; @@ -60,13 +60,13 @@ export async function getAnomalyTimeseries({ end: number; environment: Environment; logger: Logger; - mlSetup: Required<Setup>['ml']; + mlClient: MlClient; }): Promise<ServiceAnomalyTimeseries[]> { - if (!mlSetup) { + if (!mlClient) { return []; } - const mlJobs = await getMlJobsWithAPMGroup(mlSetup.anomalyDetectors); + const mlJobs = await getMlJobsWithAPMGroup(mlClient.anomalyDetectors); if (!mlJobs.length) { return []; @@ -98,7 +98,7 @@ export async function getAnomalyTimeseries({ minBucketSize, }); const anomaliesResponse = await anomalySearch( - mlSetup.mlSystem.mlAnomalySearch, + mlClient.mlSystem.mlAnomalySearch, { body: { size: 0, diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/index.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/index.ts index 7a1c4da71b788..fcce003d89206 100644 --- a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/index.ts +++ b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/index.ts @@ -17,7 +17,11 @@ type ISavedObjectsClient = Pick<SavedObjectsClient, 'find'>; type TelemetryTaskExecutor = (params: { indices: ApmIndicesConfig; - search<TSearchRequest extends ESSearchRequest>( + search< + TSearchRequest extends ESSearchRequest & { index: string | string[] } & { + body: { timeout: string }; + } + >( params: TSearchRequest ): Promise<ESSearchResponse<unknown, TSearchRequest>>; indicesStats( diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.test.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.test.ts index 253c8ed9e44d2..26c0caac5e2d3 100644 --- a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.test.ts +++ b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.test.ts @@ -434,7 +434,7 @@ describe('data telemetry collection tasks', () => { } }); - expect(await task?.executor({ search } as any)).toEqual({ + expect(await task?.executor({ search, indices } as any)).toEqual({ cardinality: { client: { geo: { country_iso_code: { rum: { '1d': 5 } } } }, transaction: { name: { all_agents: { '1d': 3 }, rum: { '1d': 1 } } }, diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts index d114b31d75e3c..b89be16b58017 100644 --- a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts +++ b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts @@ -17,7 +17,7 @@ import { APM_SERVICE_GROUP_SAVED_OBJECT_TYPE, MAX_NUMBER_OF_SERVICE_GROUPS, } from '../../../../common/service_groups'; -import { getKueryFields } from '../../helpers/get_kuery_fields'; +import { getKueryFields } from '../../../../common/utils/get_kuery_fields'; import { AGENT_NAME, AGENT_VERSION, @@ -148,6 +148,7 @@ export const tasks: TelemetryTask[] = [ await search({ index: indices.transaction, body: { + timeout, query: { bool: { filter: [ @@ -355,6 +356,7 @@ export const tasks: TelemetryTask[] = [ const response = await search({ index: [indices.transaction], body: { + timeout, query: { bool: { filter: [{ range: { '@timestamp': { gte: 'now-1d' } } }], @@ -1032,8 +1034,9 @@ export const tasks: TelemetryTask[] = [ }, { name: 'cardinality', - executor: async ({ search }) => { + executor: async ({ indices, search }) => { const allAgentsCardinalityResponse = await search({ + index: [indices.transaction], body: { size: 0, timeout, @@ -1058,6 +1061,7 @@ export const tasks: TelemetryTask[] = [ }); const rumAgentCardinalityResponse = await search({ + index: [indices.transaction], body: { size: 0, timeout, diff --git a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts index a9c7745178219..4c76699d2089b 100644 --- a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts +++ b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts @@ -24,10 +24,10 @@ import { SPAN_SUBTYPE, SPAN_TYPE, } from '../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../helpers/setup_request'; import { withApmSpan } from '../../../utils/with_apm_span'; import { Node, NodeType } from '../../../../common/connections'; import { excludeRumExitSpansQuery } from '../exclude_rum_exit_spans_query'; +import { APMEventClient } from '../../helpers/create_es_client/create_apm_event_client'; type Destination = { dependencyName: string; @@ -48,21 +48,19 @@ type Destination = { // - for each span, find the transaction it creates // - if there is a transaction, match the dependency name (span.destination.service.resource) to a service export const getDestinationMap = ({ - setup, + apmEventClient, start, end, filter, offset, }: { - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; filter: QueryDslQueryContainer[]; offset?: string; }) => { return withApmSpan('get_destination_map', async () => { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_stats.ts b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_stats.ts index 7057847c34c0c..409565db5729f 100644 --- a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_stats.ts +++ b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_stats.ts @@ -27,27 +27,25 @@ import { } from '../../../../common/elasticsearch_fieldnames'; import { getBucketSize } from '../../helpers/get_bucket_size'; import { EventOutcome } from '../../../../common/event_outcome'; -import { Setup } from '../../helpers/setup_request'; import { NodeType } from '../../../../common/connections'; import { excludeRumExitSpansQuery } from '../exclude_rum_exit_spans_query'; +import { APMEventClient } from '../../helpers/create_es_client/create_apm_event_client'; export const getStats = async ({ - setup, + apmEventClient, start, end, filter, numBuckets, offset, }: { - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; filter: QueryDslQueryContainer[]; numBuckets: number; offset?: string; }) => { - const { apmEventClient } = setup; - const { offsetInMs, startWithOffset, endWithOffset } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/index.ts b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/index.ts index 7c9781e08db31..4ba113b698bc1 100644 --- a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/index.ts +++ b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/index.ts @@ -9,14 +9,14 @@ import { ValuesType } from 'utility-types'; import { merge } from 'lodash'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { joinByKey } from '../../../../common/utils/join_by_key'; -import { Setup } from '../../helpers/setup_request'; import { getStats } from './get_stats'; import { getDestinationMap } from './get_destination_map'; import { calculateThroughputWithRange } from '../../helpers/calculate_throughput'; import { withApmSpan } from '../../../utils/with_apm_span'; +import { APMEventClient } from '../../helpers/create_es_client/create_apm_event_client'; export function getConnectionStats({ - setup, + apmEventClient, start, end, numBuckets, @@ -24,7 +24,7 @@ export function getConnectionStats({ collapseBy, offset, }: { - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; numBuckets: number; @@ -35,7 +35,7 @@ export function getConnectionStats({ return withApmSpan('get_connection_stats_and_map', async () => { const [allMetrics, destinationMap] = await Promise.all([ getStats({ - setup, + apmEventClient, start, end, filter, @@ -43,7 +43,7 @@ export function getConnectionStats({ offset, }), getDestinationMap({ - setup, + apmEventClient, start, end, filter, diff --git a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts index d5068669bf27c..449455d1f6bf4 100644 --- a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts +++ b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts @@ -54,6 +54,7 @@ describe('APMEventClient', () => { indices: {} as any, options: { includeFrozen: false, + forceSyntheticSource: false, }, }); diff --git a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts index f013448d6abe5..ed2d3e123fdb5 100644 --- a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts +++ b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts @@ -80,6 +80,7 @@ export interface APMEventClientConfig { indices: ApmIndicesConfig; options: { includeFrozen: boolean; + forceSyntheticSource: boolean; }; } @@ -87,8 +88,9 @@ export class APMEventClient { private readonly esClient: ElasticsearchClient; private readonly debug: boolean; private readonly request: KibanaRequest; - private readonly indices: ApmIndicesConfig; + public readonly indices: ApmIndicesConfig; private readonly includeFrozen: boolean; + private readonly forceSyntheticSource: boolean; constructor(config: APMEventClientConfig) { this.esClient = config.esClient; @@ -96,6 +98,7 @@ export class APMEventClient { this.request = config.request; this.indices = config.indices; this.includeFrozen = config.options.includeFrozen; + this.forceSyntheticSource = config.options.forceSyntheticSource; } private callAsyncWithDebug<T extends { body: any }>({ @@ -149,11 +152,18 @@ export class APMEventClient { this.indices ); + const forceSyntheticSourceForThisRequest = + this.forceSyntheticSource && + params.apm.events.includes(ProcessorEvent.metric); + const searchParams = { ...withProcessorEventFilter, ...(this.includeFrozen ? { ignore_throttled: false } : {}), ignore_unavailable: true, preference: 'any', + ...(forceSyntheticSourceForThisRequest + ? { force_synthetic_source: true } + : {}), }; return this.callAsyncWithDebug({ diff --git a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_internal_es_client/index.ts b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_internal_es_client/index.ts index 4fe0238594757..f48971588a050 100644 --- a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_internal_es_client/index.ts +++ b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_internal_es_client/index.ts @@ -15,10 +15,11 @@ import { getDebugTitle, } from '../call_async_with_debug'; import { cancelEsRequestOnAbort } from '../cancel_es_request_on_abort'; +import { getApmIndices } from '../../../../routes/settings/apm_indices/get_apm_indices'; export type APMIndexDocumentParams<T> = estypes.IndexRequest<T>; -export type APMInternalClient = Awaited< +export type APMInternalESClient = Awaited< ReturnType<typeof createInternalESClient> >; @@ -26,8 +27,13 @@ export async function createInternalESClient({ context, debug, request, -}: Pick<APMRouteHandlerResources, 'context' | 'request'> & { debug: boolean }) { - const { asInternalUser } = (await context.core).elasticsearch.client; + config, +}: Pick<APMRouteHandlerResources, 'context' | 'request' | 'config'> & { + debug: boolean; +}) { + const coreContext = await context.core; + const { asInternalUser } = coreContext.elasticsearch.client; + const savedObjectsClient = coreContext.savedObjects.client; function callEs<T extends { body: any }>( operationName: string, @@ -62,6 +68,7 @@ export async function createInternalESClient({ } return { + apmIndices: await getApmIndices({ savedObjectsClient, config }), search: async < TDocument = unknown, TSearchRequest extends ESSearchRequest = ESSearchRequest diff --git a/x-pack/plugins/apm/server/lib/helpers/get_apm_event_client.ts b/x-pack/plugins/apm/server/lib/helpers/get_apm_event_client.ts new file mode 100644 index 0000000000000..7ed4902fa0615 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/helpers/get_apm_event_client.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 { UI_SETTINGS } from '@kbn/data-plugin/common'; +import { APMRouteHandlerResources } from '../../routes/typings'; +import { getApmIndices } from '../../routes/settings/apm_indices/get_apm_indices'; +import { APMEventClient } from './create_es_client/create_apm_event_client'; +import { withApmSpan } from '../../utils/with_apm_span'; + +export async function getApmEventClient({ + context, + params, + config, + request, +}: APMRouteHandlerResources): Promise<APMEventClient> { + return withApmSpan('get_apm_event_client', async () => { + const coreContext = await context.core; + const [indices, includeFrozen] = await Promise.all([ + getApmIndices({ + savedObjectsClient: coreContext.savedObjects.client, + config, + }), + withApmSpan('get_ui_settings', () => + coreContext.uiSettings.client.get<boolean>( + UI_SETTINGS.SEARCH_INCLUDE_FROZEN + ) + ), + ]); + + return new APMEventClient({ + esClient: coreContext.elasticsearch.client.asCurrentUser, + debug: params.query._inspect, + request, + indices, + options: { + includeFrozen, + forceSyntheticSource: config.forceSyntheticSource, + }, + }); + }); +} diff --git a/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts b/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts index 863929a2719a5..a2946137cf911 100644 --- a/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts +++ b/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts @@ -6,7 +6,6 @@ */ import moment from 'moment'; -// @ts-expect-error import { calculateAuto } from './calculate_auto'; export function getBucketSize({ @@ -22,7 +21,7 @@ export function getBucketSize({ }) { const duration = moment.duration(end - start, 'ms'); const bucketSize = Math.max( - calculateAuto.near(numBuckets, duration).asSeconds(), + calculateAuto.near(numBuckets, duration)?.asSeconds() ?? 0, minBucketSize || 1 ); diff --git a/x-pack/plugins/apm/server/lib/helpers/get_ml_client.ts b/x-pack/plugins/apm/server/lib/helpers/get_ml_client.ts new file mode 100644 index 0000000000000..372df50be6d4d --- /dev/null +++ b/x-pack/plugins/apm/server/lib/helpers/get_ml_client.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 { isActivePlatinumLicense } from '../../../common/license_check'; +import { APMRouteHandlerResources } from '../../routes/typings'; + +export interface MlClient { + mlSystem: any; + anomalyDetectors: any; + modules: any; +} + +export async function getMlClient({ + plugins, + context, + request, +}: APMRouteHandlerResources) { + const [coreContext, licensingContext] = await Promise.all([ + context.core, + context.licensing, + ]); + + const mlplugin = plugins.ml; + + if (!mlplugin || !isActivePlatinumLicense(licensingContext.license)) { + return; + } + return { + mlSystem: mlplugin.setup.mlSystemProvider( + request, + coreContext.savedObjects.client + ), + anomalyDetectors: mlplugin.setup.anomalyDetectorsProvider( + request, + coreContext.savedObjects.client + ), + modules: mlplugin.setup.modulesProvider( + request, + coreContext.savedObjects.client + ), + }; +} diff --git a/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts b/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts deleted file mode 100644 index faaeb5db91405..0000000000000 --- a/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { setupRequest } from './setup_request'; -import { APMConfig } from '../..'; -import { APMRouteHandlerResources } from '../../routes/typings'; -import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { getApmIndices } from '../../routes/settings/apm_indices/get_apm_indices'; - -jest.mock('../../routes/settings/apm_indices/get_apm_indices', () => ({ - getApmIndices: async () => - ({ - sourcemap: 'apm-*', - error: 'apm-*', - onboarding: 'apm-*', - span: 'apm-*', - transaction: 'apm-*', - metric: 'apm-*', - apmAgentConfigurationIndex: 'apm-*', - } as Awaited<ReturnType<typeof getApmIndices>>), -})); - -function getMockResources() { - const esClientMock = elasticsearchServiceMock.createScopedClusterClient(); - // @ts-expect-error incomplete definition - esClientMock.asCurrentUser.search.mockResponse({}); - // @ts-expect-error incomplete definition - esClientMock.asInternalUser.search.mockResponse({}); - - const mockResources = { - config: new Proxy( - {}, - { - get: () => 'apm-*', - } - ) as APMConfig, - params: { - query: { - _inspect: false, - }, - }, - context: { - core: { - elasticsearch: { - client: esClientMock, - }, - uiSettings: { - client: { - get: jest.fn().mockResolvedValue(false), - }, - }, - savedObjects: { - client: { - get: jest.fn(), - }, - }, - }, - }, - plugins: { - ml: undefined, - }, - request: { - url: '', - events: { - aborted$: { - subscribe: jest.fn().mockReturnValue({ unsubscribe: jest.fn() }), - }, - }, - }, - } as unknown as APMRouteHandlerResources & { - context: { - core: { - elasticsearch: { - client: typeof esClientMock; - }; - uiSettings: { - client: { - get: jest.Mock<any, any>; - }; - }; - savedObjects: { - client: { - get: jest.Mock<any, any>; - }; - }; - }; - }; - }; - - return mockResources; -} - -describe('setupRequest', () => { - describe('with default args', () => { - it('calls callWithRequest', async () => { - const mockResources = getMockResources(); - const { apmEventClient } = await setupRequest(mockResources); - await apmEventClient.search('foo', { - apm: { events: [ProcessorEvent.transaction] }, - body: { track_total_hits: 10_000, size: 10 }, - }); - - expect( - mockResources.context.core.elasticsearch.client.asCurrentUser.search - ).toHaveBeenCalledWith( - { - index: ['apm-*'], - body: { - track_total_hits: 10000, - size: 10, - query: { - bool: { - filter: [{ terms: { 'processor.event': ['transaction'] } }], - }, - }, - }, - ignore_unavailable: true, - preference: 'any', - }, - { - signal: expect.any(Object), - meta: true, - } - ); - }); - - it('calls callWithInternalUser', async () => { - const mockResources = getMockResources(); - const { internalClient } = await setupRequest(mockResources); - await internalClient.search('foo', { - index: ['apm-*'], - body: { foo: 'bar' }, - } as any); - expect( - mockResources.context.core.elasticsearch.client.asInternalUser.search - ).toHaveBeenCalledWith( - { - index: ['apm-*'], - body: { - foo: 'bar', - }, - }, - { - signal: expect.any(Object), - meta: true, - } - ); - }); - }); -}); - -describe('with includeFrozen=false', () => { - it('should NOT send "ignore_throttled:true" in the request', async () => { - const mockResources = getMockResources(); - - // mock includeFrozen to return false - mockResources.context.core.uiSettings.client.get.mockResolvedValue(false); - - const { apmEventClient } = await setupRequest(mockResources); - - await apmEventClient.search('foo', { - apm: { - events: [], - }, - body: { track_total_hits: 10_000, size: 10 }, - }); - - const params = - mockResources.context.core.elasticsearch.client.asCurrentUser.search.mock - .calls[0][0]; - // @ts-expect-error missing body definition - expect(params.ignore_throttled).toBe(undefined); - }); -}); - -describe('with includeFrozen=true', () => { - it('sets `ignore_throttled=false`', async () => { - const mockResources = getMockResources(); - - // mock includeFrozen to return true - mockResources.context.core.uiSettings.client.get.mockResolvedValue(true); - - const { apmEventClient } = await setupRequest(mockResources); - - await apmEventClient.search('foo', { - apm: { events: [] }, - body: { track_total_hits: 10_000, size: 10 }, - }); - - const params = - mockResources.context.core.elasticsearch.client.asCurrentUser.search.mock - .calls[0][0]; - // @ts-expect-error missing body definition - expect(params.ignore_throttled).toBe(false); - }); -}); diff --git a/x-pack/plugins/apm/server/lib/helpers/setup_request.ts b/x-pack/plugins/apm/server/lib/helpers/setup_request.ts deleted file mode 100644 index dc6e379367408..0000000000000 --- a/x-pack/plugins/apm/server/lib/helpers/setup_request.ts +++ /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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { KibanaRequest } from '@kbn/core/server'; -import { UI_SETTINGS } from '@kbn/data-plugin/common'; -import { isActivePlatinumLicense } from '../../../common/license_check'; -import { APMConfig } from '../..'; -import { APMRouteHandlerResources } from '../../routes/typings'; -import { - ApmIndicesConfig, - getApmIndices, -} from '../../routes/settings/apm_indices/get_apm_indices'; -import { APMEventClient } from './create_es_client/create_apm_event_client'; -import { - APMInternalClient, - createInternalESClient, -} from './create_es_client/create_internal_es_client'; -import { withApmSpan } from '../../utils/with_apm_span'; - -// Explicitly type Setup to prevent TS initialization errors -// https://github.com/microsoft/TypeScript/issues/34933 - -export interface Setup { - apmEventClient: APMEventClient; - internalClient: APMInternalClient; - ml?: ReturnType<typeof getMlSetup>; - config: APMConfig; - indices: ApmIndicesConfig; -} - -export async function setupRequest({ - context, - params, - core, - plugins, - request, - config, -}: APMRouteHandlerResources): Promise<Setup> { - return withApmSpan('setup_request', async () => { - const { query } = params; - const coreContext = await context.core; - const licensingContext = await context.licensing; - - const [indices, includeFrozen] = await Promise.all([ - getApmIndices({ - savedObjectsClient: coreContext.savedObjects.client, - config, - }), - withApmSpan('get_ui_settings', () => - coreContext.uiSettings.client.get<boolean>( - UI_SETTINGS.SEARCH_INCLUDE_FROZEN - ) - ), - ]); - - return { - indices, - apmEventClient: new APMEventClient({ - esClient: coreContext.elasticsearch.client.asCurrentUser, - debug: query._inspect, - request, - indices, - options: { includeFrozen }, - }), - internalClient: await createInternalESClient({ - context, - request, - debug: query._inspect, - }), - ml: - plugins.ml && isActivePlatinumLicense(licensingContext.license) - ? getMlSetup( - plugins.ml.setup, - coreContext.savedObjects.client, - request - ) - : undefined, - config, - }; - }); -} - -function getMlSetup( - ml: Required<APMRouteHandlerResources['plugins']>['ml']['setup'], - savedObjectsClient: Awaited< - APMRouteHandlerResources['context']['core'] - >['savedObjects']['client'], - request: KibanaRequest -) { - return { - mlSystem: ml.mlSystemProvider(request, savedObjectsClient), - anomalyDetectors: ml.anomalyDetectorsProvider(request, savedObjectsClient), - modules: ml.modulesProvider(request, savedObjectsClient), - }; -} diff --git a/x-pack/plugins/apm/server/lib/helpers/spans/get_is_using_service_destination_metrics.ts b/x-pack/plugins/apm/server/lib/helpers/spans/get_is_using_service_destination_metrics.ts index 0dbf3006a324d..6b58db02bbbbc 100644 --- a/x-pack/plugins/apm/server/lib/helpers/spans/get_is_using_service_destination_metrics.ts +++ b/x-pack/plugins/apm/server/lib/helpers/spans/get_is_using_service_destination_metrics.ts @@ -19,7 +19,7 @@ import { SPAN_DURATION, SPAN_NAME, } from '../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../setup_request'; +import { APMEventClient } from '../create_es_client/create_apm_event_client'; export function getProcessorEventForServiceDestinationStatistics( searchServiceDestinationMetrics: boolean @@ -54,20 +54,18 @@ export function getDocCountFieldForServiceDestinationStatistics( } export async function getIsUsingServiceDestinationMetrics({ - setup, + apmEventClient, useSpanName, kuery, start, end, }: { - setup: Setup; + apmEventClient: APMEventClient; useSpanName: boolean; kuery: string; start: number; end: number; }) { - const { apmEventClient } = setup; - async function getServiceDestinationMetricsCount( query?: QueryDslQueryContainer ) { diff --git a/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.test.ts b/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.test.ts index 1fac873ced7be..ff118ed5b16c6 100644 --- a/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.test.ts +++ b/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.test.ts @@ -63,7 +63,12 @@ describe('getIsUsingTransactionEvents', () => { it('should be false', async () => { mock = await inspectSearchParams( - (setup) => getIsUsingTransactionEvents({ setup, kuery: '' }), + ({ mockApmEventClient, mockConfig }) => + getIsUsingTransactionEvents({ + config: mockConfig, + apmEventClient: mockApmEventClient, + kuery: '', + }), { config } ); expect(mock.response).toBe(false); @@ -71,7 +76,12 @@ describe('getIsUsingTransactionEvents', () => { it('should not query for data', async () => { mock = await inspectSearchParams( - (setup) => getIsUsingTransactionEvents({ setup, kuery: '' }), + ({ mockApmEventClient, mockConfig }) => + getIsUsingTransactionEvents({ + config: mockConfig, + apmEventClient: mockApmEventClient, + kuery: '', + }), { config } ); expect(mock.spy).toHaveBeenCalledTimes(0); @@ -84,7 +94,12 @@ describe('getIsUsingTransactionEvents', () => { }; it('should be false when kuery is empty', async () => { mock = await inspectSearchParams( - (setup) => getIsUsingTransactionEvents({ setup, kuery: '' }), + ({ mockApmEventClient, mockConfig }) => + getIsUsingTransactionEvents({ + config: mockConfig, + apmEventClient: mockApmEventClient, + kuery: '', + }), { config } ); expect(mock.response).toBe(false); @@ -92,9 +107,10 @@ describe('getIsUsingTransactionEvents', () => { it('should be false when kuery is set and metrics data found', async () => { mock = await inspectSearchParams( - (setup) => + ({ mockApmEventClient, mockConfig }) => getIsUsingTransactionEvents({ - setup, + config: mockConfig, + apmEventClient: mockApmEventClient, kuery: 'proccessor.event: "transaction"', }), { @@ -116,9 +132,10 @@ describe('getIsUsingTransactionEvents', () => { it('should be true when kuery is set and metrics data are not found', async () => { mock = await inspectSearchParams( - (setup) => + ({ mockApmEventClient, mockConfig }) => getIsUsingTransactionEvents({ - setup, + config: mockConfig, + apmEventClient: mockApmEventClient, kuery: 'proccessor.event: "transaction"', }), { @@ -140,7 +157,12 @@ describe('getIsUsingTransactionEvents', () => { it('should not query for data when kuery is empty', async () => { mock = await inspectSearchParams( - (setup) => getIsUsingTransactionEvents({ setup, kuery: '' }), + ({ mockApmEventClient, mockConfig }) => + getIsUsingTransactionEvents({ + config: mockConfig, + apmEventClient: mockApmEventClient, + kuery: '', + }), { config } ); expect(mock.spy).toHaveBeenCalledTimes(0); @@ -148,9 +170,10 @@ describe('getIsUsingTransactionEvents', () => { it('should query for data when kuery is set', async () => { mock = await inspectSearchParams( - (setup) => + ({ mockApmEventClient, mockConfig }) => getIsUsingTransactionEvents({ - setup, + config: mockConfig, + apmEventClient: mockApmEventClient, kuery: 'proccessor.event: "transaction"', }), { config } @@ -167,7 +190,12 @@ describe('getIsUsingTransactionEvents', () => { it('should query for data once if metrics data found', async () => { mock = await inspectSearchParams( - (setup) => getIsUsingTransactionEvents({ setup, kuery: '' }), + ({ mockApmEventClient, mockConfig }) => + getIsUsingTransactionEvents({ + config: mockConfig, + apmEventClient: mockApmEventClient, + kuery: '', + }), { config, mockResponse: (request) => { @@ -187,7 +215,12 @@ describe('getIsUsingTransactionEvents', () => { it('should query for data twice if metrics data not found', async () => { mock = await inspectSearchParams( - (setup) => getIsUsingTransactionEvents({ setup, kuery: '' }), + ({ mockApmEventClient, mockConfig }) => + getIsUsingTransactionEvents({ + config: mockConfig, + apmEventClient: mockApmEventClient, + kuery: '', + }), { config, mockResponse: (request) => { @@ -207,7 +240,12 @@ describe('getIsUsingTransactionEvents', () => { it('should be false if metrics data are found', async () => { mock = await inspectSearchParams( - (setup) => getIsUsingTransactionEvents({ setup, kuery: '' }), + ({ mockApmEventClient, mockConfig }) => + getIsUsingTransactionEvents({ + config: mockConfig, + apmEventClient: mockApmEventClient, + kuery: '', + }), { config, mockResponse: (request) => { @@ -226,7 +264,12 @@ describe('getIsUsingTransactionEvents', () => { it('should be true if no metrics data are found', async () => { mock = await inspectSearchParams( - (setup) => getIsUsingTransactionEvents({ setup, kuery: '' }), + ({ mockApmEventClient, mockConfig }) => + getIsUsingTransactionEvents({ + config: mockConfig, + apmEventClient: mockApmEventClient, + kuery: '', + }), { config, mockResponse: (request) => { @@ -245,7 +288,12 @@ describe('getIsUsingTransactionEvents', () => { it('should be false if no metrics or transactions data are found', async () => { mock = await inspectSearchParams( - (setup) => getIsUsingTransactionEvents({ setup, kuery: '' }), + ({ mockApmEventClient, mockConfig }) => + getIsUsingTransactionEvents({ + config: mockConfig, + apmEventClient: mockApmEventClient, + kuery: '', + }), { config, mockResponse: () => mockResponseNoHits } ); expect(mock.response).toBe(false); diff --git a/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.ts b/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.ts index 409010d3c695d..20832c70d007b 100644 --- a/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.ts +++ b/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.ts @@ -8,17 +8,19 @@ import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getSearchTransactionsEvents } from '.'; -import { Setup } from '../setup_request'; import { APMEventClient } from '../create_es_client/create_apm_event_client'; import { SearchAggregatedTransactionSetting } from '../../../../common/aggregated_transactions'; +import { APMConfig } from '../../..'; export async function getIsUsingTransactionEvents({ - setup: { config, apmEventClient }, + config, + apmEventClient, kuery, start, end, }: { - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; kuery: string; start?: number; end?: number; diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/get_coldstart_rate.ts b/x-pack/plugins/apm/server/lib/transaction_groups/get_coldstart_rate.ts index c16b600cda146..74419d47507a4 100644 --- a/x-pack/plugins/apm/server/lib/transaction_groups/get_coldstart_rate.ts +++ b/x-pack/plugins/apm/server/lib/transaction_groups/get_coldstart_rate.ts @@ -21,13 +21,13 @@ import { getProcessorEventForTransactions, } from '../helpers/transactions'; import { getBucketSizeForAggregatedTransactions } from '../helpers/get_bucket_size_for_aggregated_transactions'; -import { Setup } from '../helpers/setup_request'; import { calculateTransactionColdstartRate, getColdstartAggregation, getTransactionColdstartRateTimeSeries, } from '../helpers/transaction_coldstart_rate'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; +import { APMEventClient } from '../helpers/create_es_client/create_apm_event_client'; export async function getColdstartRate({ environment, @@ -35,7 +35,7 @@ export async function getColdstartRate({ serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -46,7 +46,7 @@ export async function getColdstartRate({ serviceName: string; transactionType?: string; transactionName: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; start: number; end: number; @@ -55,8 +55,6 @@ export async function getColdstartRate({ transactionColdstartRate: Coordinate[]; average: number | null; }> { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, @@ -131,7 +129,7 @@ export async function getColdstartRatePeriods({ serviceName, transactionType, transactionName = '', - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -142,7 +140,7 @@ export async function getColdstartRatePeriods({ serviceName: string; transactionType?: string; transactionName?: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; start: number; end: number; @@ -154,7 +152,7 @@ export async function getColdstartRatePeriods({ serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, }; diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts b/x-pack/plugins/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts index 6cebbce9d974c..8fb57d037a3c6 100644 --- a/x-pack/plugins/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts +++ b/x-pack/plugins/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts @@ -24,13 +24,13 @@ import { getProcessorEventForTransactions, } from '../helpers/transactions'; import { getBucketSizeForAggregatedTransactions } from '../helpers/get_bucket_size_for_aggregated_transactions'; -import { Setup } from '../helpers/setup_request'; import { calculateFailedTransactionRate, getOutcomeAggregation, getFailedTransactionRateTimeSeries, } from '../helpers/transaction_error_rate'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; +import { APMEventClient } from '../helpers/create_es_client/create_apm_event_client'; export async function getFailedTransactionRate({ environment, @@ -38,7 +38,7 @@ export async function getFailedTransactionRate({ serviceName, transactionTypes, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -50,7 +50,7 @@ export async function getFailedTransactionRate({ serviceName: string; transactionTypes: string[]; transactionName?: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; start: number; end: number; @@ -60,8 +60,6 @@ export async function getFailedTransactionRate({ timeseries: Coordinate[]; average: number | null; }> { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/plugin.ts b/x-pack/plugins/apm/server/plugin.ts index de49cc793ede4..a6509c6779197 100644 --- a/x-pack/plugins/apm/server/plugin.ts +++ b/x-pack/plugins/apm/server/plugin.ts @@ -234,6 +234,7 @@ export class APMPlugin indices, options: { includeFrozen, + forceSyntheticSource: currentConfig.forceSyntheticSource, }, }); }, diff --git a/x-pack/plugins/apm/server/routes/alerts/average_or_percentile_agg.ts b/x-pack/plugins/apm/server/routes/alerts/average_or_percentile_agg.ts deleted file mode 100644 index 0a7b9e29229bb..0000000000000 --- a/x-pack/plugins/apm/server/routes/alerts/average_or_percentile_agg.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { AggregationType } from '../../../common/rules/apm_rule_types'; -import { getDurationFieldForTransactions } from '../../lib/helpers/transactions'; - -type TransactionDurationField = ReturnType< - typeof getDurationFieldForTransactions ->; - -/* eslint @typescript-eslint/consistent-type-definitions: ["error", "type"] */ -type AvgLatencyAgg = { - avgLatency: { avg: { field: TransactionDurationField } }; -}; -type PctLatencyAgg = { - pctLatency: { - percentiles: { - field: TransactionDurationField; - percents: [95] | [99]; - keyed: false; - }; - }; -}; - -export function averageOrPercentileAgg({ - aggregationType, - transactionDurationField, -}: { - aggregationType: AggregationType; - transactionDurationField: TransactionDurationField; -}): AvgLatencyAgg | PctLatencyAgg { - if (aggregationType === AggregationType.Avg) { - return { avgLatency: { avg: { field: transactionDurationField } } }; - } - return { - pctLatency: { - percentiles: { - field: transactionDurationField, - percents: [aggregationType === AggregationType.P95 ? 95 : 99], - keyed: false as const, - }, - }, - }; -} diff --git a/x-pack/plugins/apm/server/routes/alerts/route.ts b/x-pack/plugins/apm/server/routes/alerts/route.ts index 56e23d2712868..c040c00387d07 100644 --- a/x-pack/plugins/apm/server/routes/alerts/route.ts +++ b/x-pack/plugins/apm/server/routes/alerts/route.ts @@ -9,10 +9,10 @@ import * as t from 'io-ts'; import { getTransactionDurationChartPreview } from './rule_types/transaction_duration/get_transaction_duration_chart_preview'; import { getTransactionErrorCountChartPreview } from './rule_types/error_count/get_error_count_chart_preview'; import { getTransactionErrorRateChartPreview } from './rule_types/transaction_error_rate/get_transaction_error_rate_chart_preview'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { environmentRt, rangeRt } from '../default_api_types'; import { AggregationType } from '../../../common/rules/apm_rule_types'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const alertParamsRt = t.intersection([ t.partial({ @@ -40,12 +40,13 @@ const transactionErrorRateChartPreview = createApmServerRoute({ handler: async ( resources ): Promise<{ errorRateChartPreview: Array<{ x: number; y: number }> }> => { - const setup = await setupRequest(resources); - const { params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, config } = resources; const { _inspect, ...alertParams } = params.query; const errorRateChartPreview = await getTransactionErrorRateChartPreview({ - setup, + config, + apmEventClient, alertParams, }); @@ -60,13 +61,13 @@ const transactionErrorCountChartPreview = createApmServerRoute({ handler: async ( resources ): Promise<{ errorCountChartPreview: Array<{ x: number; y: number }> }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { _inspect, ...alertParams } = params.query; const errorCountChartPreview = await getTransactionErrorCountChartPreview({ - setup, + apmEventClient, alertParams, }); @@ -86,15 +87,16 @@ const transactionDurationChartPreview = createApmServerRoute({ data: Array<{ x: number; y: number | null }>; }>; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); - const { params } = resources; + const { params, config } = resources; const { _inspect, ...alertParams } = params.query; const latencyChartPreview = await getTransactionDurationChartPreview({ alertParams, - setup, + config, + apmEventClient, }); return { latencyChartPreview }; diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/get_service_group_fields_for_anomaly.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/get_service_group_fields_for_anomaly.ts new file mode 100644 index 0000000000000..0786cd81aa7f2 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/get_service_group_fields_for_anomaly.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 { firstValueFrom } from 'rxjs'; +import { + IScopedClusterClient, + SavedObjectsClientContract, +} from '@kbn/core/server'; +import { + SERVICE_ENVIRONMENT, + SERVICE_NAME, + TRANSACTION_TYPE, + TRANSACTION_DURATION, +} from '../../../../../common/elasticsearch_fieldnames'; +import { alertingEsClient } from '../../alerting_es_client'; +import { + getServiceGroupFields, + getServiceGroupFieldsAgg, +} from '../get_service_group_fields'; +import { getApmIndices } from '../../../settings/apm_indices/get_apm_indices'; +import { RegisterRuleDependencies } from '../../register_apm_rule_types'; + +export async function getServiceGroupFieldsForAnomaly({ + config$, + scopedClusterClient, + savedObjectsClient, + serviceName, + environment, + transactionType, + timestamp, + bucketSpan, +}: { + config$: RegisterRuleDependencies['config$']; + scopedClusterClient: IScopedClusterClient; + savedObjectsClient: SavedObjectsClientContract; + serviceName: string; + environment: string; + transactionType: string; + timestamp: number; + bucketSpan: number; +}) { + const config = await firstValueFrom(config$); + const indices = await getApmIndices({ + config, + savedObjectsClient, + }); + const { transaction: index } = indices; + + const params = { + index, + body: { + size: 0, + track_total_hits: false, + query: { + bool: { + filter: [ + { term: { [SERVICE_NAME]: serviceName } }, + { term: { [TRANSACTION_TYPE]: transactionType } }, + { term: { [SERVICE_ENVIRONMENT]: environment } }, + { + range: { + '@timestamp': { + gte: timestamp, + lte: timestamp + bucketSpan * 1000, + format: 'epoch_millis', + }, + }, + }, + ], + }, + }, + aggs: { + ...getServiceGroupFieldsAgg({ + sort: [{ [TRANSACTION_DURATION]: { order: 'desc' as const } }], + }), + }, + }, + }; + + const response = await alertingEsClient({ + scopedClusterClient, + params, + }); + if (!response.aggregations) { + return {}; + } + return getServiceGroupFields(response.aggregations); +} diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts index d82a4997ffe0e..d85b8df2798fe 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts @@ -46,6 +46,7 @@ import { getAlertUrlTransaction } from '../../../../../common/utils/formatters'; import { getMLJobs } from '../../../service_map/get_service_anomalies'; import { apmActionVariables } from '../../action_variables'; import { RegisterRuleDependencies } from '../../register_apm_rule_types'; +import { getServiceGroupFieldsForAnomaly } from './get_service_group_fields_for_anomaly'; const paramsSchema = schema.object({ serviceName: schema.maybe(schema.string()), @@ -66,6 +67,7 @@ const ruleTypeConfig = RULE_TYPES_CONFIG[ApmRuleType.Anomaly]; export function registerAnomalyRuleType({ logger, ruleDataClient, + config$, alerting, ml, basePath, @@ -102,6 +104,7 @@ export function registerAnomalyRuleType({ if (!ml) { return {}; } + const ruleParams = params; const request = {} as KibanaRequest; const { mlAnomalySearch } = ml.mlSystemProvider( @@ -161,8 +164,14 @@ export function registerAnomalyRuleType({ }, }, }, - ...termQuery('partition_field_value', ruleParams.serviceName), - ...termQuery('by_field_value', ruleParams.transactionType), + ...termQuery( + 'partition_field_value', + ruleParams.serviceName, + { queryEmptyString: false } + ), + ...termQuery('by_field_value', ruleParams.transactionType, { + queryEmptyString: false, + }), ...termQuery( 'detector_index', getApmMlDetectorIndex(ApmMlDetectorType.txLatency) @@ -178,7 +187,8 @@ export function registerAnomalyRuleType({ { field: 'by_field_value' }, { field: 'job_id' }, ], - size: 10000, + size: 1000, + order: { 'latest_score.record_score': 'desc' as const }, }, aggs: { latest_score: { @@ -188,6 +198,8 @@ export function registerAnomalyRuleType({ { field: 'partition_field_value' }, { field: 'by_field_value' }, { field: 'job_id' }, + { field: 'timestamp' }, + { field: 'bucket_span' }, ] as const), sort: { timestamp: 'desc' as const, @@ -222,14 +234,35 @@ export function registerAnomalyRuleType({ transactionType: latest.by_field_value as string, environment: job.environment, score: latest.record_score as number, + timestamp: Date.parse(latest.timestamp as string), + bucketSpan: latest.bucket_span as number, }; }) .filter((anomaly) => anomaly ? anomaly.score >= threshold : false ) ?? []; - compact(anomalies).forEach((anomaly) => { - const { serviceName, environment, transactionType, score } = anomaly; + for (const anomaly of compact(anomalies)) { + const { + serviceName, + environment, + transactionType, + score, + timestamp, + bucketSpan, + } = anomaly; + + const eventSourceFields = await getServiceGroupFieldsForAnomaly({ + config$, + scopedClusterClient: services.scopedClusterClient, + savedObjectsClient: services.savedObjectsClient, + serviceName, + environment, + transactionType, + timestamp, + bucketSpan, + }); + const severityLevel = getSeverity(score); const reasonMessage = formatAnomalyReason({ measured: score, @@ -270,6 +303,7 @@ export function registerAnomalyRuleType({ [ALERT_EVALUATION_VALUE]: score, [ALERT_EVALUATION_THRESHOLD]: threshold, [ALERT_REASON]: reasonMessage, + ...eventSourceFields, }, }) .scheduleActions(ruleTypeConfig.defaultActionGroupId, { @@ -281,7 +315,7 @@ export function registerAnomalyRuleType({ reason: reasonMessage, viewInAppUrl, }); - }); + } return {}; }, diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/get_error_count_chart_preview.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/get_error_count_chart_preview.ts index 3489ae4d91be6..fa819e268c802 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/get_error_count_chart_preview.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/get_error_count_chart_preview.ts @@ -10,16 +10,15 @@ import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { SERVICE_NAME } from '../../../../../common/elasticsearch_fieldnames'; import { AlertParams } from '../../route'; import { environmentQuery } from '../../../../../common/utils/environment_query'; -import { Setup } from '../../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTransactionErrorCountChartPreview({ - setup, + apmEventClient, alertParams, }: { - setup: Setup; + apmEventClient: APMEventClient; alertParams: AlertParams; }) { - const { apmEventClient } = setup; const { serviceName, environment, interval, start, end } = alertParams; const query = { diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts index 58e475ced07fb..d9826aae392c8 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts @@ -37,6 +37,10 @@ import { getApmIndices } from '../../../settings/apm_indices/get_apm_indices'; import { apmActionVariables } from '../../action_variables'; import { alertingEsClient } from '../../alerting_es_client'; import { RegisterRuleDependencies } from '../../register_apm_rule_types'; +import { + getServiceGroupFieldsAgg, + getServiceGroupFields, +} from '../get_service_group_fields'; const paramsSchema = schema.object({ windowSize: schema.number(), @@ -107,7 +111,9 @@ export function registerErrorCountRuleType({ }, }, { term: { [PROCESSOR_EVENT]: ProcessorEvent.error } }, - ...termQuery(SERVICE_NAME, ruleParams.serviceName), + ...termQuery(SERVICE_NAME, ruleParams.serviceName, { + queryEmptyString: false, + }), ...environmentQuery(ruleParams.environment), ], }, @@ -122,8 +128,10 @@ export function registerErrorCountRuleType({ missing: ENVIRONMENT_NOT_DEFINED.value, }, ], - size: 10000, + size: 1000, + order: { _count: 'desc' as const }, }, + aggs: getServiceGroupFieldsAgg(), }, }, }, @@ -137,13 +145,19 @@ export function registerErrorCountRuleType({ const errorCountResults = response.aggregations?.error_counts.buckets.map((bucket) => { const [serviceName, environment] = bucket.key; - return { serviceName, environment, errorCount: bucket.doc_count }; + return { + serviceName, + environment, + errorCount: bucket.doc_count, + sourceFields: getServiceGroupFields(bucket), + }; }) ?? []; errorCountResults .filter((result) => result.errorCount >= ruleParams.threshold) .forEach((result) => { - const { serviceName, environment, errorCount } = result; + const { serviceName, environment, errorCount, sourceFields } = + result; const alertReason = formatErrorCountReason({ serviceName, threshold: ruleParams.threshold, @@ -176,6 +190,7 @@ export function registerErrorCountRuleType({ [ALERT_EVALUATION_VALUE]: errorCount, [ALERT_EVALUATION_THRESHOLD]: ruleParams.threshold, [ALERT_REASON]: alertReason, + ...sourceFields, }, }) .scheduleActions(ruleTypeConfig.defaultActionGroupId, { diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/get_service_group_fields.test.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/get_service_group_fields.test.ts new file mode 100644 index 0000000000000..0df590d524f91 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/get_service_group_fields.test.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 { + getServiceGroupFields, + getServiceGroupFieldsAgg, + flattenSourceDoc, +} from './get_service_group_fields'; + +const mockSourceObj = { + service: { + name: 'testbeans', + environment: 'testing', + language: { + name: 'typescript', + }, + }, + labels: { + team: 'test', + }, + agent: { + name: 'nodejs', + }, +}; + +const mockBucket = { + source_fields: { + hits: { + hits: [{ _source: mockSourceObj }], + }, + }, +}; + +describe('getSourceFields', () => { + it('should return a flattened record of fields and values for a given bucket', () => { + const result = getServiceGroupFields(mockBucket); + expect(result).toMatchInlineSnapshot(` + Object { + "agent.name": "nodejs", + "labels.team": "test", + "service.environment": "testing", + "service.language.name": "typescript", + "service.name": "testbeans", + } + `); + }); +}); + +describe('getSourceFieldsAgg', () => { + it('should create a agg for specific source fields', () => { + const agg = getServiceGroupFieldsAgg(); + expect(agg).toMatchInlineSnapshot(` + Object { + "source_fields": Object { + "top_hits": Object { + "_source": Object { + "includes": Array [ + "agent.name", + "service.name", + "service.environment", + "service.language.name", + "labels", + ], + }, + "size": 1, + }, + }, + } + `); + }); + + it('should accept options for top_hits options', () => { + const agg = getServiceGroupFieldsAgg({ + sort: [{ 'transaction.duration.us': { order: 'desc' } }], + }); + expect(agg).toMatchInlineSnapshot(` + Object { + "source_fields": Object { + "top_hits": Object { + "_source": Object { + "includes": Array [ + "agent.name", + "service.name", + "service.environment", + "service.language.name", + "labels", + ], + }, + "size": 1, + "sort": Array [ + Object { + "transaction.duration.us": Object { + "order": "desc", + }, + }, + ], + }, + }, + } + `); + }); +}); + +describe('flattenSourceDoc', () => { + it('should flatten a given nested object with dot delim paths as keys', () => { + const result = flattenSourceDoc(mockSourceObj); + expect(result).toMatchInlineSnapshot(` + Object { + "agent.name": "nodejs", + "labels.team": "test", + "service.environment": "testing", + "service.language.name": "typescript", + "service.name": "testbeans", + } + `); + }); +}); diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/get_service_group_fields.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/get_service_group_fields.ts new file mode 100644 index 0000000000000..2a50b8ba2f31e --- /dev/null +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/get_service_group_fields.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 { AggregationsTopHitsAggregation } from '@elastic/elasticsearch/lib/api/types'; +import { SERVICE_GROUP_SUPPORTED_FIELDS } from '../../../../common/service_groups'; + +export interface SourceDoc { + [key: string]: string | SourceDoc; +} + +export function getServiceGroupFieldsAgg( + topHitsOpts: AggregationsTopHitsAggregation = {} +) { + return { + source_fields: { + top_hits: { + size: 1, + _source: { + includes: SERVICE_GROUP_SUPPORTED_FIELDS, + }, + ...topHitsOpts, + }, + }, + }; +} + +interface AggResultBucket { + source_fields: { + hits: { + hits: Array<{ _source: any }>; + }; + }; +} + +export function getServiceGroupFields(bucket?: AggResultBucket) { + if (!bucket) { + return {}; + } + const sourceDoc: SourceDoc = + bucket?.source_fields?.hits.hits[0]?._source ?? {}; + return flattenSourceDoc(sourceDoc); +} + +export function flattenSourceDoc( + val: SourceDoc | string, + path: string[] = [] +): Record<string, string> { + if (typeof val !== 'object') { + return { [path.join('.')]: val }; + } + return Object.keys(val).reduce((acc, key) => { + const fieldMap = flattenSourceDoc(val[key], [...path, key]); + return { ...acc, ...fieldMap }; + }, {}); +} diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/average_or_percentile_agg.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/average_or_percentile_agg.ts new file mode 100644 index 0000000000000..2e61108b8a9a0 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/average_or_percentile_agg.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 { AggregationType } from '../../../../../common/rules/apm_rule_types'; +import { getDurationFieldForTransactions } from '../../../../lib/helpers/transactions'; + +type TransactionDurationField = ReturnType< + typeof getDurationFieldForTransactions +>; + +/* eslint @typescript-eslint/consistent-type-definitions: ["error", "type"] */ +type AvgLatencyAgg = { + avgLatency: { avg: { field: TransactionDurationField } }; +}; +type PctLatencyAgg = { + pctLatency: { + percentiles: { + field: TransactionDurationField; + percents: [95] | [99]; + keyed: false; + }; + }; +}; + +export function averageOrPercentileAgg({ + aggregationType, + transactionDurationField, +}: { + aggregationType: AggregationType; + transactionDurationField: TransactionDurationField; +}): AvgLatencyAgg | PctLatencyAgg { + if (aggregationType === AggregationType.Avg) { + return { avgLatency: { avg: { field: transactionDurationField } } }; + } + return { + pctLatency: { + percentiles: { + field: transactionDurationField, + percents: [aggregationType === AggregationType.P95 ? 95 : 99], + keyed: false as const, + }, + }, + }; +} + +export function getMultiTermsSortOrder(aggregationType: AggregationType): { + order: { [path: string]: 'desc' }; +} { + if (aggregationType === AggregationType.Avg) { + return { order: { avgLatency: 'desc' } }; + } + const percentsKey = aggregationType === AggregationType.P95 ? 95 : 99; + return { order: { [`pctLatency.${percentsKey}`]: 'desc' } }; +} diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/get_transaction_duration_chart_preview.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/get_transaction_duration_chart_preview.ts index ad01f8a4c3c25..781e9739fdba9 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/get_transaction_duration_chart_preview.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/get_transaction_duration_chart_preview.ts @@ -21,21 +21,23 @@ import { getDurationFieldForTransactions, getProcessorEventForTransactions, } from '../../../../lib/helpers/transactions'; -import { Setup } from '../../../../lib/helpers/setup_request'; import { ENVIRONMENT_NOT_DEFINED, getEnvironmentLabel, } from '../../../../../common/environment_filter_values'; -import { averageOrPercentileAgg } from '../../average_or_percentile_agg'; +import { averageOrPercentileAgg } from './average_or_percentile_agg'; +import { APMConfig } from '../../../..'; +import { APMEventClient } from '../../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTransactionDurationChartPreview({ alertParams, - setup, + config, + apmEventClient, }: { alertParams: AlertParams; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; }) { - const { apmEventClient } = setup; const { aggregationType = AggregationType.Avg, environment, @@ -46,7 +48,8 @@ export async function getTransactionDurationChartPreview({ end, } = alertParams; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + config, + apmEventClient, kuery: '', }); diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.test.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.test.ts index 4d8b91636fb6c..2b159e7acc0d2 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.test.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.test.ts @@ -24,10 +24,10 @@ describe('registerTransactionDurationRuleType', () => { }, }, aggregations: { - environments: { + series: { buckets: [ { - key: 'ENVIRONMENT_NOT_DEFINED', + key: ['opbeans-java', 'ENVIRONMENT_NOT_DEFINED', 'request'], avgLatency: { value: 5500000, }, diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts index 0ea099c8d4bc2..b4c7a6212b62d 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts @@ -14,6 +14,7 @@ import { } from '@kbn/rule-data-utils'; import { firstValueFrom } from 'rxjs'; import { asDuration } from '@kbn/observability-plugin/common/utils/formatters'; +import { termQuery } from '@kbn/observability-plugin/server'; import { createLifecycleRuleTypeFactory } from '@kbn/rule-registry-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getAlertUrlTransaction } from '../../../../../common/utils/formatters'; @@ -46,7 +47,14 @@ import { getApmIndices } from '../../../settings/apm_indices/get_apm_indices'; import { apmActionVariables } from '../../action_variables'; import { alertingEsClient } from '../../alerting_es_client'; import { RegisterRuleDependencies } from '../../register_apm_rule_types'; -import { averageOrPercentileAgg } from '../../average_or_percentile_agg'; +import { + averageOrPercentileAgg, + getMultiTermsSortOrder, +} from './average_or_percentile_agg'; +import { + getServiceGroupFields, + getServiceGroupFieldsAgg, +} from '../get_service_group_fields'; const paramsSchema = schema.object({ serviceName: schema.string(), @@ -140,26 +148,37 @@ export function registerTransactionDurationRuleType({ ...getDocumentTypeFilterForTransactions( searchAggregatedTransactions ), - { term: { [SERVICE_NAME]: ruleParams.serviceName } }, - { - term: { - [TRANSACTION_TYPE]: ruleParams.transactionType, - }, - }, + ...termQuery(SERVICE_NAME, ruleParams.serviceName, { + queryEmptyString: false, + }), + ...termQuery(TRANSACTION_TYPE, ruleParams.transactionType, { + queryEmptyString: false, + }), ...environmentQuery(ruleParams.environment), ] as QueryDslQueryContainer[], }, }, aggs: { - environments: { - terms: { - field: SERVICE_ENVIRONMENT, - missing: ENVIRONMENT_NOT_DEFINED.value, + series: { + multi_terms: { + terms: [ + { field: SERVICE_NAME }, + { + field: SERVICE_ENVIRONMENT, + missing: ENVIRONMENT_NOT_DEFINED.value, + }, + { field: TRANSACTION_TYPE }, + ], + size: 1000, + ...getMultiTermsSortOrder(ruleParams.aggregationType), + }, + aggs: { + ...averageOrPercentileAgg({ + aggregationType: ruleParams.aggregationType, + transactionDurationField: field, + }), + ...getServiceGroupFieldsAgg(), }, - aggs: averageOrPercentileAgg({ - aggregationType: ruleParams.aggregationType, - transactionDurationField: field, - }), }, }, }, @@ -177,32 +196,40 @@ export function registerTransactionDurationRuleType({ // Converts threshold to microseconds because this is the unit used on transactionDuration const thresholdMicroseconds = ruleParams.threshold * 1000; - const triggeredEnvironmentDurations = - response.aggregations.environments.buckets - .map((bucket) => { - const { key: environment } = bucket; - const transactionDuration = - 'avgLatency' in bucket // only true if ruleParams.aggregationType === 'avg' - ? bucket.avgLatency.value - : bucket.pctLatency.values[0].value; - return { transactionDuration, environment }; - }) - .filter( - ({ transactionDuration }) => - transactionDuration !== null && - transactionDuration > thresholdMicroseconds - ) as Array<{ transactionDuration: number; environment: string }>; + const triggeredBuckets = []; + for (const bucket of response.aggregations.series.buckets) { + const [serviceName, environment, transactionType] = bucket.key; + const transactionDuration = + 'avgLatency' in bucket // only true if ruleParams.aggregationType === 'avg' + ? bucket.avgLatency.value + : bucket.pctLatency.values[0].value; + if ( + transactionDuration !== null && + transactionDuration > thresholdMicroseconds + ) { + triggeredBuckets.push({ + serviceName, + environment, + transactionType, + transactionDuration, + sourceFields: getServiceGroupFields(bucket), + }); + } + } for (const { + serviceName, environment, + transactionType, transactionDuration, - } of triggeredEnvironmentDurations) { + sourceFields, + } of triggeredBuckets) { const durationFormatter = getDurationFormatter(transactionDuration); const transactionDurationFormatted = durationFormatter(transactionDuration).formatted; const reasonMessage = formatTransactionDurationReason({ measured: transactionDuration, - serviceName: ruleParams.serviceName, + serviceName, threshold: thresholdMicroseconds, asDuration, aggregationType: String(ruleParams.aggregationType), @@ -211,9 +238,9 @@ export function registerTransactionDurationRuleType({ }); const relativeViewInAppUrl = getAlertUrlTransaction( - ruleParams.serviceName, + serviceName, getEnvironmentEsField(environment)?.[SERVICE_ENVIRONMENT], - ruleParams.transactionType + transactionType ); const viewInAppUrl = basePath.publicBaseUrl @@ -228,18 +255,19 @@ export function registerTransactionDurationRuleType({ environment )}`, fields: { - [SERVICE_NAME]: ruleParams.serviceName, + [SERVICE_NAME]: serviceName, ...getEnvironmentEsField(environment), - [TRANSACTION_TYPE]: ruleParams.transactionType, + [TRANSACTION_TYPE]: transactionType, [PROCESSOR_EVENT]: ProcessorEvent.transaction, [ALERT_EVALUATION_VALUE]: transactionDuration, [ALERT_EVALUATION_THRESHOLD]: thresholdMicroseconds, [ALERT_REASON]: reasonMessage, + ...sourceFields, }, }) .scheduleActions(ruleTypeConfig.defaultActionGroupId, { - transactionType: ruleParams.transactionType, - serviceName: ruleParams.serviceName, + transactionType, + serviceName, environment: getEnvironmentLabel(environment), threshold: thresholdMicroseconds, triggerValue: transactionDurationFormatted, diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/get_transaction_error_rate_chart_preview.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/get_transaction_error_rate_chart_preview.ts index 9921b0ce16a3f..d799e025c3453 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/get_transaction_error_rate_chart_preview.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/get_transaction_error_rate_chart_preview.ts @@ -17,25 +17,28 @@ import { getDocumentTypeFilterForTransactions, getProcessorEventForTransactions, } from '../../../../lib/helpers/transactions'; -import { Setup } from '../../../../lib/helpers/setup_request'; import { calculateFailedTransactionRate, getOutcomeAggregation, } from '../../../../lib/helpers/transaction_error_rate'; +import { APMConfig } from '../../../..'; +import { APMEventClient } from '../../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTransactionErrorRateChartPreview({ - setup, + config, + apmEventClient, alertParams, }: { - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; alertParams: AlertParams; }) { - const { apmEventClient } = setup; const { serviceName, environment, transactionType, interval, start, end } = alertParams; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + config, + apmEventClient, kuery: '', start, end, diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts index 15a5880345ffd..73f7ccda26401 100644 --- a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts @@ -44,6 +44,10 @@ import { alertingEsClient } from '../../alerting_es_client'; import { RegisterRuleDependencies } from '../../register_apm_rule_types'; import { SearchAggregatedTransactionSetting } from '../../../../../common/aggregated_transactions'; import { getDocumentTypeFilterForTransactions } from '../../../../lib/helpers/transactions'; +import { + getServiceGroupFields, + getServiceGroupFieldsAgg, +} from '../get_service_group_fields'; const paramsSchema = schema.object({ windowSize: schema.number(), @@ -136,8 +140,12 @@ export function registerTransactionErrorRateRuleType({ ], }, }, - ...termQuery(SERVICE_NAME, ruleParams.serviceName), - ...termQuery(TRANSACTION_TYPE, ruleParams.transactionType), + ...termQuery(SERVICE_NAME, ruleParams.serviceName, { + queryEmptyString: false, + }), + ...termQuery(TRANSACTION_TYPE, ruleParams.transactionType, { + queryEmptyString: false, + }), ...environmentQuery(ruleParams.environment), ], }, @@ -153,13 +161,15 @@ export function registerTransactionErrorRateRuleType({ }, { field: TRANSACTION_TYPE }, ], - size: 10000, + size: 1000, + order: { _count: 'desc' as const }, }, aggs: { outcomes: { terms: { field: EVENT_OUTCOME, }, + aggs: getServiceGroupFieldsAgg(), }, }, }, @@ -180,10 +190,10 @@ export function registerTransactionErrorRateRuleType({ for (const bucket of response.aggregations.series.buckets) { const [serviceName, environment, transactionType] = bucket.key; - const failed = - bucket.outcomes.buckets.find( - (outcomeBucket) => outcomeBucket.key === EventOutcome.failure - )?.doc_count ?? 0; + const failedOutcomeBucket = bucket.outcomes.buckets.find( + (outcomeBucket) => outcomeBucket.key === EventOutcome.failure + ); + const failed = failedOutcomeBucket?.doc_count ?? 0; const succesful = bucket.outcomes.buckets.find( (outcomeBucket) => outcomeBucket.key === EventOutcome.success @@ -196,13 +206,19 @@ export function registerTransactionErrorRateRuleType({ environment, transactionType, errorRate, + sourceFields: getServiceGroupFields(failedOutcomeBucket), }); } } results.forEach((result) => { - const { serviceName, environment, transactionType, errorRate } = - result; + const { + serviceName, + environment, + transactionType, + errorRate, + sourceFields, + } = result; const reasonMessage = formatTransactionErrorRateReason({ threshold: ruleParams.threshold, measured: errorRate, @@ -241,6 +257,7 @@ export function registerTransactionErrorRateRuleType({ [ALERT_EVALUATION_VALUE]: errorRate, [ALERT_EVALUATION_THRESHOLD]: ruleParams.threshold, [ALERT_REASON]: reasonMessage, + ...sourceFields, }, }) .scheduleActions(ruleTypeConfig.defaultActionGroupId, { diff --git a/x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts b/x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts index 03971c6d115bf..84ef941462b39 100644 --- a/x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts +++ b/x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts @@ -41,6 +41,7 @@ import { traceRouteRepository } from '../traces/route'; import { transactionRouteRepository } from '../transactions/route'; import { storageExplorerRouteRepository } from '../storage_explorer/route'; import { labsRouteRepository } from '../settings/labs/route'; +import { mobileRouteRepository } from '../mobile/route'; function getTypedGlobalApmServerRouteRepository() { const repository = { @@ -75,6 +76,7 @@ function getTypedGlobalApmServerRouteRepository() { ...debugTelemetryRoute, ...timeRangeMetadataRoute, ...labsRouteRepository, + ...mobileRouteRepository, }; return repository; diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation.ts index 74ef7bc56fdce..48d468c517972 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation.ts @@ -12,12 +12,11 @@ import { TRANSACTION_DURATION, } from '../../../../common/elasticsearch_fieldnames'; import type { CommonCorrelationsQueryParams } from '../../../../common/correlations/types'; - -import { Setup } from '../../../lib/helpers/setup_request'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export const fetchDurationCorrelation = async ({ - setup, + apmEventClient, eventType, start, end, @@ -29,7 +28,7 @@ export const fetchDurationCorrelation = async ({ fractions, totalDocCount, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; eventType: ProcessorEvent; expectations: number[]; ranges: estypes.AggregationsAggregationRange[]; @@ -40,8 +39,6 @@ export const fetchDurationCorrelation = async ({ correlation: number | null; ksTest: number | null; }> => { - const { apmEventClient } = setup; - const resp = await apmEventClient.search('get_duration_correlation', { apm: { events: [eventType], diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation_with_histogram.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation_with_histogram.ts index 4fd82d431af67..a4b2b0c6284d5 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation_with_histogram.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation_with_histogram.ts @@ -19,13 +19,13 @@ import { } from '../../../../common/correlations/constants'; import { LatencyDistributionChartType } from '../../../../common/latency_distribution_chart_types'; -import { Setup } from '../../../lib/helpers/setup_request'; import { fetchDurationCorrelation } from './fetch_duration_correlation'; import { fetchDurationRanges } from './fetch_duration_ranges'; import { getEventType } from '../utils'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function fetchDurationCorrelationWithHistogram({ - setup, + apmEventClient, chartType, start, end, @@ -39,7 +39,7 @@ export async function fetchDurationCorrelationWithHistogram({ totalDocCount, fieldValuePair, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; chartType: LatencyDistributionChartType; expectations: number[]; ranges: estypes.AggregationsAggregationRange[]; @@ -60,7 +60,7 @@ export async function fetchDurationCorrelationWithHistogram({ }; const { correlation, ksTest } = await fetchDurationCorrelation({ - setup, + apmEventClient, eventType, start, end, @@ -76,7 +76,7 @@ export async function fetchDurationCorrelationWithHistogram({ if (correlation !== null && ksTest !== null && !isNaN(ksTest)) { if (correlation > CORRELATION_THRESHOLD && ksTest < KS_TEST_THRESHOLD) { const { durationRanges: histogram } = await fetchDurationRanges({ - setup, + apmEventClient, chartType, start, end, diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts index 29863b52c42bb..c15f40d78d2c1 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts @@ -16,9 +16,8 @@ import { POPULATED_DOC_COUNT_SAMPLE_SIZE, } from '../../../../common/correlations/constants'; import { hasPrefixToInclude } from '../../../../common/correlations/utils'; - -import { Setup } from '../../../lib/helpers/setup_request'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; const SUPPORTED_ES_FIELD_TYPES = [ ES_FIELD_TYPES.KEYWORD, @@ -36,7 +35,7 @@ export const shouldBeExcluded = (fieldName: string) => { }; export const fetchDurationFieldCandidates = async ({ - setup, + apmEventClient, eventType, query, start, @@ -45,13 +44,11 @@ export const fetchDurationFieldCandidates = async ({ kuery, }: CommonCorrelationsQueryParams & { query: estypes.QueryDslQueryContainer; - setup: Setup; + apmEventClient: APMEventClient; eventType: ProcessorEvent.transaction | ProcessorEvent.span; }): Promise<{ fieldCandidates: string[]; }> => { - const { apmEventClient } = setup; - // Get all supported fields const [respMapping, respRandomDoc] = await Promise.all([ apmEventClient.fieldCaps('get_field_caps', { diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_fractions.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_fractions.ts index c77399d215d51..222cce131372d 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_fractions.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_fractions.ts @@ -13,14 +13,14 @@ import { SPAN_DURATION, TRANSACTION_DURATION, } from '../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; /** * Compute the actual percentile bucket counts and actual fractions */ export const fetchDurationFractions = async ({ - setup, + apmEventClient, eventType, start, end, @@ -29,11 +29,10 @@ export const fetchDurationFractions = async ({ query, ranges, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; eventType: ProcessorEvent; ranges: estypes.AggregationsAggregationRange[]; }): Promise<{ fractions: number[]; totalDocCount: number }> => { - const { apmEventClient } = setup; const resp = await apmEventClient.search('get_duration_fractions', { apm: { events: [eventType], diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_histogram_range_steps.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_histogram_range_steps.ts index 4e7c852ca9924..7e86fc70bad79 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_histogram_range_steps.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_histogram_range_steps.ts @@ -10,9 +10,9 @@ import { scaleLog } from 'd3-scale'; import { isFiniteNumber } from '@kbn/observability-plugin/common/utils/is_finite_number'; import { CommonCorrelationsQueryParams } from '../../../../common/correlations/types'; import { LatencyDistributionChartType } from '../../../../common/latency_distribution_chart_types'; -import { Setup } from '../../../lib/helpers/setup_request'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; import { getDurationField, getEventType } from '../utils'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; const getHistogramRangeSteps = (min: number, max: number, steps: number) => { // A d3 based scale function as a helper to get equally distributed bins on a log scale. @@ -25,7 +25,7 @@ const getHistogramRangeSteps = (min: number, max: number, steps: number) => { export const fetchDurationHistogramRangeSteps = async ({ chartType, - setup, + apmEventClient, start, end, environment, @@ -36,7 +36,7 @@ export const fetchDurationHistogramRangeSteps = async ({ durationMaxOverride, }: CommonCorrelationsQueryParams & { chartType: LatencyDistributionChartType; - setup: Setup; + apmEventClient: APMEventClient; searchMetrics: boolean; durationMinOverride?: number; durationMaxOverride?: number; @@ -59,8 +59,6 @@ export const fetchDurationHistogramRangeSteps = async ({ }; } - const { apmEventClient } = setup; - const durationField = getDurationField(chartType, searchMetrics); // when using metrics data, ensure we filter by docs with the appropriate duration field diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_percentiles.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_percentiles.ts index 618ee3a321939..d303777b08c79 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_percentiles.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_percentiles.ts @@ -6,15 +6,15 @@ */ import { SIGNIFICANT_VALUE_DIGITS } from '../../../../common/correlations/constants'; -import { Setup } from '../../../lib/helpers/setup_request'; import { LatencyDistributionChartType } from '../../../../common/latency_distribution_chart_types'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; import { CommonCorrelationsQueryParams } from '../../../../common/correlations/types'; import { getDurationField, getEventType } from '../utils'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export const fetchDurationPercentiles = async ({ chartType, - setup, + apmEventClient, start, end, environment, @@ -24,7 +24,7 @@ export const fetchDurationPercentiles = async ({ searchMetrics, }: CommonCorrelationsQueryParams & { chartType: LatencyDistributionChartType; - setup: Setup; + apmEventClient: APMEventClient; percents?: number[]; searchMetrics: boolean; }): Promise<{ @@ -63,7 +63,7 @@ export const fetchDurationPercentiles = async ({ }, }, }; - const response = await setup.apmEventClient.search( + const response = await apmEventClient.search( 'get_duration_percentiles', params ); diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_ranges.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_ranges.ts index 1aca4f7be852f..c8f2aae2e9372 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_ranges.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_ranges.ts @@ -8,14 +8,14 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { sumBy } from 'lodash'; import { LatencyDistributionChartType } from '../../../../common/latency_distribution_chart_types'; -import { Setup } from '../../../lib/helpers/setup_request'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; import { Environment } from '../../../../common/environment_rt'; import { getDurationField, getEventType } from '../utils'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export const fetchDurationRanges = async ({ rangeSteps, - setup, + apmEventClient, start, end, environment, @@ -25,7 +25,7 @@ export const fetchDurationRanges = async ({ searchMetrics, }: { rangeSteps: number[]; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; environment: Environment; @@ -37,7 +37,6 @@ export const fetchDurationRanges = async ({ totalDocCount: number; durationRanges: Array<{ key: number; doc_count: number }>; }> => { - const { apmEventClient } = setup; const durationField = getDurationField(chartType, searchMetrics); // when using metrics data, ensure we filter by docs with the appropriate duration field diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_failed_events_correlation_p_values.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_failed_events_correlation_p_values.ts index 0eddb2b655e3a..405ca6250e5d5 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_failed_events_correlation_p_values.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_failed_events_correlation_p_values.ts @@ -13,13 +13,13 @@ import { } from '../../../../common/elasticsearch_fieldnames'; import { EventOutcome } from '../../../../common/event_outcome'; import { LatencyDistributionChartType } from '../../../../common/latency_distribution_chart_types'; -import { Setup } from '../../../lib/helpers/setup_request'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; import { fetchDurationRanges } from './fetch_duration_ranges'; import { getEventType } from '../utils'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export const fetchFailedEventsCorrelationPValues = async ({ - setup, + apmEventClient, start, end, environment, @@ -28,12 +28,10 @@ export const fetchFailedEventsCorrelationPValues = async ({ rangeSteps, fieldName, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; rangeSteps: number[]; fieldName: string; }) => { - const { apmEventClient } = setup; - const chartType = LatencyDistributionChartType.failedTransactionsCorrelations; const searchMetrics = false; // failed transactions correlations does not search metrics documents const eventType = getEventType(chartType, searchMetrics); @@ -106,7 +104,7 @@ export const fetchFailedEventsCorrelationPValues = async ({ 0.25 * Math.min(Math.max((bucket.score - 13.816) / 101.314, 0), 1); const { durationRanges: histogram } = await fetchDurationRanges({ - setup, + apmEventClient, chartType, start, end, diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_field_value_pairs.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_field_value_pairs.ts index e0b12cb8bb9c8..72ffea93e2cae 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_field_value_pairs.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_field_value_pairs.ts @@ -13,11 +13,11 @@ import type { import { TERMS_SIZE } from '../../../../common/correlations/constants'; import { splitAllSettledPromises } from '../utils'; -import { Setup } from '../../../lib/helpers/setup_request'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export const fetchFieldValuePairs = async ({ - setup, + apmEventClient, fieldCandidates, eventType, start, @@ -26,12 +26,10 @@ export const fetchFieldValuePairs = async ({ kuery, query, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; fieldCandidates: string[]; eventType: ProcessorEvent; }): Promise<{ fieldValuePairs: FieldValuePair[]; errors: any[] }> => { - const { apmEventClient } = setup; - const { fulfilled: responses, rejected: errors } = splitAllSettledPromises( await Promise.allSettled( fieldCandidates.map(async (fieldName) => { diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_p_values.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_p_values.ts index 72cd6baaefec4..2c94473ccaa41 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_p_values.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_p_values.ts @@ -10,13 +10,13 @@ import type { FailedTransactionsCorrelation } from '../../../../common/correlati import { CommonCorrelationsQueryParams } from '../../../../common/correlations/types'; import { LatencyDistributionChartType } from '../../../../common/latency_distribution_chart_types'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; import { splitAllSettledPromises, getEventType } from '../utils'; import { fetchDurationHistogramRangeSteps } from './fetch_duration_histogram_range_steps'; import { fetchFailedEventsCorrelationPValues } from './fetch_failed_events_correlation_p_values'; export const fetchPValues = async ({ - setup, + apmEventClient, start, end, environment, @@ -26,7 +26,7 @@ export const fetchPValues = async ({ durationMax, fieldCandidates, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; durationMin?: number; durationMax?: number; fieldCandidates: string[]; @@ -36,7 +36,7 @@ export const fetchPValues = async ({ const eventType = getEventType(chartType, searchMetrics); const { rangeSteps } = await fetchDurationHistogramRangeSteps({ - setup, + apmEventClient, chartType, start, end, @@ -52,7 +52,7 @@ export const fetchPValues = async ({ await Promise.allSettled( fieldCandidates.map((fieldName) => fetchFailedEventsCorrelationPValues({ - setup, + apmEventClient, start, end, environment, @@ -96,7 +96,8 @@ export const fetchPValues = async ({ } }); - const index = setup.indices[eventType as keyof typeof setup.indices]; + const index = + apmEventClient.indices[eventType as keyof typeof apmEventClient.indices]; const ccsWarning = rejected.length > 0 && index.includes(':'); diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_significant_correlations.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_significant_correlations.ts index abb23fbfac0e8..82e91167f19d2 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_significant_correlations.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_significant_correlations.ts @@ -15,7 +15,6 @@ import type { } from '../../../../common/correlations/types'; import { LatencyDistributionChartType } from '../../../../common/latency_distribution_chart_types'; -import { Setup } from '../../../lib/helpers/setup_request'; import { computeExpectationsAndRanges, splitAllSettledPromises, @@ -26,9 +25,10 @@ import { fetchDurationFractions } from './fetch_duration_fractions'; import { fetchDurationHistogramRangeSteps } from './fetch_duration_histogram_range_steps'; import { fetchDurationRanges } from './fetch_duration_ranges'; import { getEventType } from '../utils'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export const fetchSignificantCorrelations = async ({ - setup, + apmEventClient, start, end, environment, @@ -38,7 +38,7 @@ export const fetchSignificantCorrelations = async ({ durationMaxOverride, fieldValuePairs, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; durationMinOverride?: number; durationMaxOverride?: number; fieldValuePairs: FieldValuePair[]; @@ -50,7 +50,7 @@ export const fetchSignificantCorrelations = async ({ const eventType = getEventType(chartType, searchMetrics); const { percentiles: percentilesRecords } = await fetchDurationPercentiles({ - setup, + apmEventClient, chartType, start, end, @@ -69,7 +69,7 @@ export const fetchSignificantCorrelations = async ({ const { expectations, ranges } = computeExpectationsAndRanges(percentiles); const { fractions, totalDocCount } = await fetchDurationFractions({ - setup, + apmEventClient, eventType, start, end, @@ -80,7 +80,7 @@ export const fetchSignificantCorrelations = async ({ }); const { rangeSteps } = await fetchDurationHistogramRangeSteps({ - setup, + apmEventClient, chartType, start, end, @@ -96,7 +96,7 @@ export const fetchSignificantCorrelations = async ({ await Promise.allSettled( fieldValuePairs.map((fieldValuePair) => fetchDurationCorrelationWithHistogram({ - setup, + apmEventClient, chartType, start, end, @@ -142,7 +142,7 @@ export const fetchSignificantCorrelations = async ({ if (latencyCorrelations.length === 0 && fallbackResult) { const { fieldName, fieldValue } = fallbackResult; const { durationRanges: histogram } = await fetchDurationRanges({ - setup, + apmEventClient, chartType, start, end, @@ -165,7 +165,8 @@ export const fetchSignificantCorrelations = async ({ } } - const index = setup.indices[eventType as keyof typeof setup.indices]; + const index = + apmEventClient.indices[eventType as keyof typeof apmEventClient.indices]; const ccsWarning = rejected.length > 0 && index.includes(':'); diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_boolean_field_stats.ts b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_boolean_field_stats.ts index 0d03843fd2088..ff1019778ad56 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_boolean_field_stats.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_boolean_field_stats.ts @@ -11,11 +11,11 @@ import { FieldValuePair, } from '../../../../../common/correlations/types'; import { BooleanFieldStats } from '../../../../../common/correlations/field_stats_types'; -import { Setup } from '../../../../lib/helpers/setup_request'; import { getCommonCorrelationsQuery } from '../get_common_correlations_query'; +import { APMEventClient } from '../../../../lib/helpers/create_es_client/create_apm_event_client'; export const fetchBooleanFieldStats = async ({ - setup, + apmEventClient, eventType, start, end, @@ -24,12 +24,10 @@ export const fetchBooleanFieldStats = async ({ field, query, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; eventType: ProcessorEvent; field: FieldValuePair; }): Promise<BooleanFieldStats> => { - const { apmEventClient } = setup; - const { fieldName } = field; const { aggregations } = await apmEventClient.search( diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_field_value_field_stats.ts b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_field_value_field_stats.ts index 9208a8ad682d3..622c7b7d8952e 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_field_value_field_stats.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_field_value_field_stats.ts @@ -14,11 +14,11 @@ import { FieldValueFieldStats, TopValueBucket, } from '../../../../../common/correlations/field_stats_types'; -import { Setup } from '../../../../lib/helpers/setup_request'; import { getCommonCorrelationsQuery } from '../get_common_correlations_query'; +import { APMEventClient } from '../../../../lib/helpers/create_es_client/create_apm_event_client'; export const fetchFieldValueFieldStats = async ({ - setup, + apmEventClient, eventType, start, end, @@ -28,11 +28,9 @@ export const fetchFieldValueFieldStats = async ({ field, }: CommonCorrelationsQueryParams & { eventType: ProcessorEvent; - setup: Setup; + apmEventClient: APMEventClient; field: FieldValuePair; }): Promise<FieldValueFieldStats> => { - const { apmEventClient } = setup; - const { aggregations } = await apmEventClient.search( 'get_field_value_field_stats', { diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_fields_stats.ts b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_fields_stats.ts index 2cd1843c6d008..90ed9b3a92950 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_fields_stats.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_fields_stats.ts @@ -16,10 +16,10 @@ import { FieldStats } from '../../../../../common/correlations/field_stats_types import { fetchKeywordFieldStats } from './fetch_keyword_field_stats'; import { fetchNumericFieldStats } from './fetch_numeric_field_stats'; import { fetchBooleanFieldStats } from './fetch_boolean_field_stats'; -import { Setup } from '../../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../../lib/helpers/create_es_client/create_apm_event_client'; export const fetchFieldsStats = async ({ - setup, + apmEventClient, eventType, start, end, @@ -29,13 +29,12 @@ export const fetchFieldsStats = async ({ fieldsToSample, }: CommonCorrelationsQueryParams & { eventType: ProcessorEvent; - setup: Setup; + apmEventClient: APMEventClient; fieldsToSample: string[]; }): Promise<{ stats: FieldStats[]; errors: any[]; }> => { - const { apmEventClient } = setup; const stats: FieldStats[] = []; const errors: any[] = []; @@ -68,7 +67,7 @@ export const fetchFieldsStats = async ({ case ES_FIELD_TYPES.KEYWORD: case ES_FIELD_TYPES.IP: return fetchKeywordFieldStats({ - setup, + apmEventClient, eventType, start, end, @@ -91,7 +90,7 @@ export const fetchFieldsStats = async ({ case ES_FIELD_TYPES.UNSIGNED_LONG: case ES_FIELD_TYPES.BYTE: return fetchNumericFieldStats({ - setup, + apmEventClient, eventType, start, end, @@ -104,7 +103,7 @@ export const fetchFieldsStats = async ({ break; case ES_FIELD_TYPES.BOOLEAN: return fetchBooleanFieldStats({ - setup, + apmEventClient, eventType, start, end, diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_keyword_field_stats.ts b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_keyword_field_stats.ts index 30e88c0eb8efb..7127db07721e7 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_keyword_field_stats.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_keyword_field_stats.ts @@ -11,11 +11,11 @@ import { FieldValuePair, } from '../../../../../common/correlations/types'; import { KeywordFieldStats } from '../../../../../common/correlations/field_stats_types'; -import { Setup } from '../../../../lib/helpers/setup_request'; import { getCommonCorrelationsQuery } from '../get_common_correlations_query'; +import { APMEventClient } from '../../../../lib/helpers/create_es_client/create_apm_event_client'; export const fetchKeywordFieldStats = async ({ - setup, + apmEventClient, eventType, start, end, @@ -24,12 +24,10 @@ export const fetchKeywordFieldStats = async ({ query, field, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; eventType: ProcessorEvent; field: FieldValuePair; }): Promise<KeywordFieldStats> => { - const { apmEventClient } = setup; - const body = await apmEventClient.search('get_keyword_field_stats', { apm: { events: [eventType], diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_numeric_field_stats.ts b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_numeric_field_stats.ts index 04b43e09d182a..63bd2a3ea9c8b 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_numeric_field_stats.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_numeric_field_stats.ts @@ -15,11 +15,11 @@ import { CommonCorrelationsQueryParams, FieldValuePair, } from '../../../../../common/correlations/types'; -import { Setup } from '../../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../../lib/helpers/create_es_client/create_apm_event_client'; import { getCommonCorrelationsQuery } from '../get_common_correlations_query'; export const fetchNumericFieldStats = async ({ - setup, + apmEventClient, eventType, start, end, @@ -28,12 +28,10 @@ export const fetchNumericFieldStats = async ({ query, field, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; eventType: ProcessorEvent; field: FieldValuePair; }): Promise<NumericFieldStats> => { - const { apmEventClient } = setup; - const { fieldName } = field; const { aggregations } = await apmEventClient.search( diff --git a/x-pack/plugins/apm/server/routes/correlations/route.ts b/x-pack/plugins/apm/server/routes/correlations/route.ts index fd3a405bc7a95..cdadd7053f517 100644 --- a/x-pack/plugins/apm/server/routes/correlations/route.ts +++ b/x-pack/plugins/apm/server/routes/correlations/route.ts @@ -15,8 +15,6 @@ import { termQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { isActivePlatinumLicense } from '../../../common/license_check'; -import { setupRequest } from '../../lib/helpers/setup_request'; - import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { fetchDurationFieldCandidates } from './queries/fetch_duration_field_candidates'; @@ -30,6 +28,7 @@ import { fetchFieldValuePairs } from './queries/fetch_field_value_pairs'; import { fetchSignificantCorrelations } from './queries/fetch_significant_correlations'; import { fetchFieldsStats } from './queries/field_stats/fetch_fields_stats'; import { fetchPValues } from './queries/fetch_p_values'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const INVALID_LICENSE = i18n.translate('xpack.apm.correlations.license.text', { defaultMessage: @@ -58,7 +57,7 @@ const fieldCandidatesTransactionsRoute = createApmServerRoute({ throw Boom.forbidden(INVALID_LICENSE); } - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { query: { @@ -87,7 +86,7 @@ const fieldCandidatesTransactionsRoute = createApmServerRoute({ ], }, }, - setup, + apmEventClient, }); }, }); @@ -124,7 +123,7 @@ const fieldStatsTransactionsRoute = createApmServerRoute({ throw Boom.forbidden(INVALID_LICENSE); } - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { body: { @@ -140,7 +139,7 @@ const fieldStatsTransactionsRoute = createApmServerRoute({ } = resources.params; return fetchFieldsStats({ - setup, + apmEventClient, eventType: ProcessorEvent.transaction, start, end, @@ -190,7 +189,7 @@ const fieldValueStatsTransactionsRoute = createApmServerRoute({ throw Boom.forbidden(INVALID_LICENSE); } - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { query: { @@ -207,7 +206,7 @@ const fieldValueStatsTransactionsRoute = createApmServerRoute({ } = resources.params; return fetchFieldValueFieldStats({ - setup, + apmEventClient, eventType: ProcessorEvent.transaction, start, end, @@ -262,7 +261,7 @@ const fieldValuePairsTransactionsRoute = createApmServerRoute({ throw Boom.forbidden(INVALID_LICENSE); } - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { body: { @@ -278,7 +277,7 @@ const fieldValuePairsTransactionsRoute = createApmServerRoute({ } = resources.params; return fetchFieldValuePairs({ - setup, + apmEventClient, eventType: ProcessorEvent.transaction, start, end, @@ -334,8 +333,7 @@ const significantCorrelationsTransactionsRoute = createApmServerRoute({ totalDocCount: number; fallbackResult?: import('./../../../common/correlations/latency_correlations/types').LatencyCorrelation; }> => { - const setup = await setupRequest(resources); - + const apmEventClient = await getApmEventClient(resources); const { body: { serviceName, @@ -352,7 +350,7 @@ const significantCorrelationsTransactionsRoute = createApmServerRoute({ } = resources.params; return fetchSignificantCorrelations({ - setup, + apmEventClient, start, end, environment, @@ -402,7 +400,7 @@ const pValuesTransactionsRoute = createApmServerRoute({ ccsWarning: boolean; fallbackResult?: import('./../../../common/correlations/failed_transactions_correlations/types').FailedTransactionsCorrelation; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { body: { @@ -420,7 +418,7 @@ const pValuesTransactionsRoute = createApmServerRoute({ } = resources.params; return fetchPValues({ - setup, + apmEventClient, start, end, environment, diff --git a/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.test.ts b/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.test.ts index 65ecb93bcb76e..512a1f78a62b7 100644 --- a/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.test.ts +++ b/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.test.ts @@ -6,10 +6,10 @@ */ import { createStaticDataView } from './create_static_data_view'; -import { Setup } from '../../lib/helpers/setup_request'; import * as HistoricalAgentData from '../historical_data/has_historical_agent_data'; import { DataViewsService } from '@kbn/data-views-plugin/common'; import { APMRouteHandlerResources, APMCore } from '../typings'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; import { APMConfig } from '../..'; function getMockedDataViewService(existingDataViewTitle: string) { @@ -21,15 +21,6 @@ function getMockedDataViewService(existingDataViewTitle: string) { } as unknown as DataViewsService; } -const setupMock = { - indices: { - transaction: 'apm-*-transaction-*', - span: 'apm-*-span-*', - error: 'apm-*-error-*', - metric: 'apm-*-metrics-*', - } as APMConfig['indices'], -} as unknown as Setup; - const coreMock = { start: () => { return { @@ -44,11 +35,21 @@ const coreMock = { }, } as unknown as APMCore; +const apmEventClientMock = { + search: jest.fn(), + indices: { + transaction: 'apm-*-transaction-*', + span: 'apm-*-span-*', + error: 'apm-*-error-*', + metric: 'apm-*-metrics-*', + } as APMConfig['indices'], +} as unknown as APMEventClient; + describe('createStaticDataView', () => { it(`should not create data view if 'xpack.apm.autocreateApmIndexPattern=false'`, async () => { const dataViewService = getMockedDataViewService('apm-*'); await createStaticDataView({ - setup: setupMock, + apmEventClient: apmEventClientMock, resources: { config: { autoCreateApmDataView: false }, } as APMRouteHandlerResources, @@ -66,7 +67,7 @@ describe('createStaticDataView', () => { const dataViewService = getMockedDataViewService('apm-*'); await createStaticDataView({ - setup: setupMock, + apmEventClient: apmEventClientMock, resources: { config: { autoCreateApmDataView: false }, } as APMRouteHandlerResources, @@ -84,7 +85,7 @@ describe('createStaticDataView', () => { const dataViewService = getMockedDataViewService('apm-*'); await createStaticDataView({ - setup: setupMock, + apmEventClient: apmEventClientMock, resources: { core: coreMock, config: { autoCreateApmDataView: true }, @@ -106,7 +107,7 @@ describe('createStaticDataView', () => { 'apm-*-transaction-*,apm-*-span-*,apm-*-error-*,apm-*-metrics-*'; await createStaticDataView({ - setup: setupMock, + apmEventClient: apmEventClientMock, resources: { core: coreMock, config: { autoCreateApmDataView: true }, @@ -135,7 +136,7 @@ describe('createStaticDataView', () => { ); await createStaticDataView({ - setup: setupMock, + apmEventClient: apmEventClientMock, resources: { core: coreMock, config: { autoCreateApmDataView: true }, diff --git a/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts b/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts index c2310acadcff0..61fbe9b362347 100644 --- a/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts +++ b/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts @@ -11,6 +11,7 @@ import { i18n } from '@kbn/i18n'; import { TRACE_ID, TRANSACTION_ID, + TRANSACTION_DURATION, } from '../../../common/elasticsearch_fieldnames'; import { APM_STATIC_DATA_VIEW_ID } from '../../../common/data_view_constants'; import { hasHistoricalAgentData } from '../historical_data/has_historical_agent_data'; @@ -18,7 +19,7 @@ import { withApmSpan } from '../../utils/with_apm_span'; import { getApmDataViewTitle } from './get_apm_data_view_title'; import { APMRouteHandlerResources } from '../typings'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export type CreateDataViewResponse = Promise< | { created: boolean; dataView: DataView } @@ -28,11 +29,11 @@ export type CreateDataViewResponse = Promise< export async function createStaticDataView({ dataViewService, resources, - setup, + apmEventClient, }: { dataViewService: DataViewsService; resources: APMRouteHandlerResources; - setup: Setup; + apmEventClient: APMEventClient; }): CreateDataViewResponse { const { config } = resources; @@ -50,7 +51,7 @@ export async function createStaticDataView({ // Discover and other apps will throw errors if an data view exists without having matching indices. // The following ensures the data view is only created if APM data is found - const hasData = await hasHistoricalAgentData(setup); + const hasData = await hasHistoricalAgentData(apmEventClient); if (!hasData) { return { @@ -61,7 +62,7 @@ export async function createStaticDataView({ }; } - const apmDataViewTitle = getApmDataViewTitle(setup.indices); + const apmDataViewTitle = getApmDataViewTitle(apmEventClient.indices); const shouldCreateOrUpdate = await getShouldCreateOrUpdate({ apmDataViewTitle, dataViewService, @@ -172,6 +173,17 @@ function createAndSaveStaticDataView({ labelTemplate: '{{value}}', }, }, + [TRANSACTION_DURATION]: { + id: 'duration', + params: { + inputFormat: 'microseconds', + outputFormat: 'asMilliseconds', + showSuffix: true, + useShortSuffix: true, + outputPrecision: 2, + includeSpaceWithSuffix: true, + }, + }, }, }, true diff --git a/x-pack/plugins/apm/server/routes/data_view/route.ts b/x-pack/plugins/apm/server/routes/data_view/route.ts index 6f55f67fc9b4f..12055e32337ca 100644 --- a/x-pack/plugins/apm/server/routes/data_view/route.ts +++ b/x-pack/plugins/apm/server/routes/data_view/route.ts @@ -12,14 +12,14 @@ import { import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { getApmDataViewTitle } from './get_apm_data_view_title'; import { getApmIndices } from '../settings/apm_indices/get_apm_indices'; -import { setupRequest } from '../../lib/helpers/setup_request'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const staticDataViewRoute = createApmServerRoute({ endpoint: 'POST /internal/apm/data_view/static', options: { tags: ['access:apm'] }, handler: async (resources): CreateDataViewResponse => { const { context, plugins, request } = resources; - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const coreContext = await context.core; const dataViewStart = await plugins.dataViews.start(); @@ -33,7 +33,7 @@ const staticDataViewRoute = createApmServerRoute({ const res = await createStaticDataView({ dataViewService, resources, - setup, + apmEventClient, }); return res; diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_dependency_latency_distribution.ts b/x-pack/plugins/apm/server/routes/dependencies/get_dependency_latency_distribution.ts index 9f9e356c96dce..150ec8664a246 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_dependency_latency_distribution.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_dependency_latency_distribution.ts @@ -14,12 +14,12 @@ import { import { Environment } from '../../../common/environment_rt'; import { EventOutcome } from '../../../common/event_outcome'; import { LatencyDistributionChartType } from '../../../common/latency_distribution_chart_types'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; import { getOverallLatencyDistribution } from '../latency_distribution/get_overall_latency_distribution'; import { OverallLatencyDistributionResponse } from '../latency_distribution/types'; export async function getDependencyLatencyDistribution({ - setup, + apmEventClient, dependencyName, spanName, kuery, @@ -28,7 +28,7 @@ export async function getDependencyLatencyDistribution({ end, percentileThreshold, }: { - setup: Setup; + apmEventClient: APMEventClient; dependencyName: string; spanName: string; kuery: string; @@ -40,9 +40,9 @@ export async function getDependencyLatencyDistribution({ allSpansDistribution: OverallLatencyDistributionResponse; failedSpansDistribution: OverallLatencyDistributionResponse; }> { - const commonProps = { + const commonParams = { chartType: LatencyDistributionChartType.dependencyLatency, - setup, + apmEventClient, start, end, environment, @@ -62,11 +62,11 @@ export async function getDependencyLatencyDistribution({ const [allSpansDistribution, failedSpansDistribution] = await Promise.all([ getOverallLatencyDistribution({ - ...commonProps, + ...commonParams, query: commonQuery, }), getOverallLatencyDistribution({ - ...commonProps, + ...commonParams, query: { bool: { filter: [ diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_error_rate_charts_for_dependency.ts b/x-pack/plugins/apm/server/routes/dependencies/get_error_rate_charts_for_dependency.ts index d1f7a655c9f1c..135178aca2ac9 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_error_rate_charts_for_dependency.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_error_rate_charts_for_dependency.ts @@ -17,7 +17,6 @@ import { SPAN_NAME, } from '../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../common/utils/environment_query'; -import { Setup } from '../../lib/helpers/setup_request'; import { getMetricsDateHistogramParams } from '../../lib/helpers/metrics'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; import { @@ -25,11 +24,12 @@ import { getDocumentTypeFilterForServiceDestinationStatistics, getProcessorEventForServiceDestinationStatistics, } from '../../lib/helpers/spans/get_is_using_service_destination_metrics'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getErrorRateChartsForDependency({ dependencyName, spanName, - setup, + apmEventClient, start, end, environment, @@ -39,7 +39,7 @@ export async function getErrorRateChartsForDependency({ }: { dependencyName: string; spanName: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; environment: string; @@ -47,8 +47,6 @@ export async function getErrorRateChartsForDependency({ searchServiceDestinationMetrics: boolean; offset?: string; }) { - const { apmEventClient } = setup; - const { offsetInMs, startWithOffset, endWithOffset } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_latency_charts_for_dependency.ts b/x-pack/plugins/apm/server/routes/dependencies/get_latency_charts_for_dependency.ts index 706b0c9d59b9a..14689f9665708 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_latency_charts_for_dependency.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_latency_charts_for_dependency.ts @@ -15,7 +15,6 @@ import { SPAN_NAME, } from '../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../common/utils/environment_query'; -import { Setup } from '../../lib/helpers/setup_request'; import { getMetricsDateHistogramParams } from '../../lib/helpers/metrics'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; import { @@ -24,12 +23,13 @@ import { getLatencyFieldForServiceDestinationStatistics, getProcessorEventForServiceDestinationStatistics, } from '../../lib/helpers/spans/get_is_using_service_destination_metrics'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getLatencyChartsForDependency({ dependencyName, spanName, searchServiceDestinationMetrics, - setup, + apmEventClient, start, end, environment, @@ -39,15 +39,13 @@ export async function getLatencyChartsForDependency({ dependencyName: string; spanName: string; searchServiceDestinationMetrics: boolean; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; environment: string; kuery: string; offset?: string; }) { - const { apmEventClient } = setup; - const { offsetInMs, startWithOffset, endWithOffset } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_metadata_for_dependency.ts b/x-pack/plugins/apm/server/routes/dependencies/get_metadata_for_dependency.ts index 1ebfeab5d8a0b..5daf4483f8fd0 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_metadata_for_dependency.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_metadata_for_dependency.ts @@ -9,21 +9,19 @@ import { rangeQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { maybe } from '../../../common/utils/maybe'; import { SPAN_DESTINATION_SERVICE_RESOURCE } from '../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getMetadataForDependency({ - setup, + apmEventClient, dependencyName, start, end, }: { - setup: Setup; + apmEventClient: APMEventClient; dependencyName: string; start: number; end: number; }) { - const { apmEventClient } = setup; - const sampleResponse = await apmEventClient.search( 'get_metadata_for_dependency', { diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_throughput_charts_for_dependency.ts b/x-pack/plugins/apm/server/routes/dependencies/get_throughput_charts_for_dependency.ts index 63c72f6c460d8..6ba07907666be 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_throughput_charts_for_dependency.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_throughput_charts_for_dependency.ts @@ -15,7 +15,6 @@ import { SPAN_NAME, } from '../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../common/utils/environment_query'; -import { Setup } from '../../lib/helpers/setup_request'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; import { getBucketSize } from '../../lib/helpers/get_bucket_size'; import { @@ -23,11 +22,12 @@ import { getDocumentTypeFilterForServiceDestinationStatistics, getProcessorEventForServiceDestinationStatistics, } from '../../lib/helpers/spans/get_is_using_service_destination_metrics'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getThroughputChartsForDependency({ dependencyName, spanName, - setup, + apmEventClient, start, end, environment, @@ -37,7 +37,7 @@ export async function getThroughputChartsForDependency({ }: { dependencyName: string; spanName: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; environment: string; @@ -45,8 +45,6 @@ export async function getThroughputChartsForDependency({ searchServiceDestinationMetrics: boolean; offset?: string; }) { - const { apmEventClient } = setup; - const { offsetInMs, startWithOffset, endWithOffset } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_top_dependencies.ts b/x-pack/plugins/apm/server/routes/dependencies/get_top_dependencies.ts index 08e2f6183303e..d8ee73af18e87 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_top_dependencies.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_top_dependencies.ts @@ -10,10 +10,10 @@ import { NodeType } from '../../../common/connections'; import { environmentQuery } from '../../../common/utils/environment_query'; import { getConnectionStats } from '../../lib/connections/get_connection_stats'; import { getConnectionStatsItemsWithRelativeImpact } from '../../lib/connections/get_connection_stats/get_connection_stats_items_with_relative_impact'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTopDependencies({ - setup, + apmEventClient, start, end, numBuckets, @@ -21,7 +21,7 @@ export async function getTopDependencies({ offset, kuery, }: { - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; numBuckets: number; @@ -30,7 +30,7 @@ export async function getTopDependencies({ kuery: string; }) { const statsItems = await getConnectionStats({ - setup, + apmEventClient, start, end, numBuckets, diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_operations.ts b/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_operations.ts index 3c688f9aaa488..b2e4c44a730fb 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_operations.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_operations.ts @@ -24,13 +24,13 @@ import { environmentQuery } from '../../../common/utils/environment_query'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; import { calculateThroughputWithRange } from '../../lib/helpers/calculate_throughput'; import { getBucketSizeForAggregatedTransactions } from '../../lib/helpers/get_bucket_size_for_aggregated_transactions'; -import { Setup } from '../../lib/helpers/setup_request'; import { getDocumentTypeFilterForServiceDestinationStatistics, getLatencyFieldForServiceDestinationStatistics, getProcessorEventForServiceDestinationStatistics, } from '../../lib/helpers/spans/get_is_using_service_destination_metrics'; import { calculateImpactBuilder } from '../traces/calculate_impact_builder'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; const MAX_NUM_OPERATIONS = 500; @@ -47,7 +47,7 @@ export interface DependencyOperation { } export async function getTopDependencyOperations({ - setup, + apmEventClient, dependencyName, start, end, @@ -56,7 +56,7 @@ export async function getTopDependencyOperations({ kuery, searchServiceDestinationMetrics, }: { - setup: Setup; + apmEventClient: APMEventClient; dependencyName: string; start: number; end: number; @@ -65,8 +65,6 @@ export async function getTopDependencyOperations({ kuery: string; searchServiceDestinationMetrics: boolean; }) { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset, offsetInMs } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_spans.ts b/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_spans.ts index 6b4998517735a..83d7f2bf52b9e 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_spans.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_spans.ts @@ -5,14 +5,14 @@ * 2.0. */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { kqlQuery, rangeQuery, termQuery, termsQuery, } from '@kbn/observability-plugin/server'; -import { compact, keyBy } from 'lodash'; -import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { keyBy } from 'lodash'; import { AGENT_NAME, EVENT_OUTCOME, @@ -20,6 +20,7 @@ import { SERVICE_NAME, SPAN_DESTINATION_SERVICE_RESOURCE, SPAN_DURATION, + SPAN_ID, SPAN_NAME, TRACE_ID, TRANSACTION_ID, @@ -29,18 +30,20 @@ import { import { Environment } from '../../../common/environment_rt'; import { EventOutcome } from '../../../common/event_outcome'; import { environmentQuery } from '../../../common/utils/environment_query'; +import { maybe } from '../../../common/utils/maybe'; import { AgentName } from '../../../typings/es_schemas/ui/fields/agent'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; const MAX_NUM_SPANS = 1000; export interface DependencySpan { '@timestamp': number; + spanId: string; spanName: string; serviceName: string; agentName: AgentName; traceId: string; - transactionId?: string; + transactionId: string; transactionType?: string; transactionName?: string; duration: number; @@ -48,7 +51,7 @@ export interface DependencySpan { } export async function getTopDependencySpans({ - setup, + apmEventClient, dependencyName, spanName, start, @@ -58,7 +61,7 @@ export async function getTopDependencySpans({ sampleRangeFrom, sampleRangeTo, }: { - setup: Setup; + apmEventClient: APMEventClient; dependencyName: string; spanName: string; start: number; @@ -68,8 +71,6 @@ export async function getTopDependencySpans({ sampleRangeFrom?: number; sampleRangeTo?: number; }): Promise<DependencySpan[]> { - const { apmEventClient } = setup; - const spans = ( await apmEventClient.search('get_top_dependency_spans', { apm: { @@ -86,6 +87,7 @@ export async function getTopDependencySpans({ ...kqlQuery(kuery), ...termQuery(SPAN_DESTINATION_SERVICE_RESOURCE, dependencyName), ...termQuery(SPAN_NAME, spanName), + { exists: { field: TRANSACTION_ID } }, ...((sampleRangeFrom ?? 0) >= 0 && (sampleRangeTo ?? 0) > 0 ? [ { @@ -102,6 +104,7 @@ export async function getTopDependencySpans({ }, }, _source: [ + SPAN_ID, TRACE_ID, TRANSACTION_ID, SPAN_NAME, @@ -116,7 +119,7 @@ export async function getTopDependencySpans({ }) ).hits.hits.map((hit) => hit._source); - const transactionIds = compact(spans.map((span) => span.transaction?.id)); + const transactionIds = spans.map((span) => span.transaction!.id); const transactions = ( await apmEventClient.search('get_transactions_for_dependency_spans', { @@ -145,19 +148,18 @@ export async function getTopDependencySpans({ ); return spans.map((span): DependencySpan => { - const transaction = span.transaction - ? transactionsById[span.transaction.id] - : undefined; + const transaction = maybe(transactionsById[span.transaction!.id]); return { '@timestamp': new Date(span['@timestamp']).getTime(), + spanId: span.span.id, spanName: span.span.name, serviceName: span.service.name, agentName: span.agent.name, duration: span.span.duration.us, traceId: span.trace.id, outcome: (span.event?.outcome || EventOutcome.unknown) as EventOutcome, - transactionId: transaction?.transaction.id, + transactionId: span.transaction!.id, transactionType: transaction?.transaction.type, transactionName: transaction?.transaction.name, }; diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_upstream_services_for_dependency.ts b/x-pack/plugins/apm/server/routes/dependencies/get_upstream_services_for_dependency.ts index 4d620619e2eb1..8f2710cbc972f 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_upstream_services_for_dependency.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_upstream_services_for_dependency.ts @@ -10,10 +10,10 @@ import { SPAN_DESTINATION_SERVICE_RESOURCE } from '../../../common/elasticsearch import { environmentQuery } from '../../../common/utils/environment_query'; import { getConnectionStats } from '../../lib/connections/get_connection_stats'; import { getConnectionStatsItemsWithRelativeImpact } from '../../lib/connections/get_connection_stats/get_connection_stats_items_with_relative_impact'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getUpstreamServicesForDependency({ - setup, + apmEventClient, start, end, dependencyName, @@ -22,7 +22,7 @@ export async function getUpstreamServicesForDependency({ environment, offset, }: { - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; dependencyName: string; @@ -32,7 +32,7 @@ export async function getUpstreamServicesForDependency({ offset?: string; }) { const statsItems = await getConnectionStats({ - setup, + apmEventClient, start, end, filter: [ diff --git a/x-pack/plugins/apm/server/routes/dependencies/route.ts b/x-pack/plugins/apm/server/routes/dependencies/route.ts index 1ba2e92eee57a..964e1ed95834a 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/route.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/route.ts @@ -7,7 +7,6 @@ import * as t from 'io-ts'; import { toBooleanRt, toNumberRt } from '@kbn/io-ts-utils'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { getMetadataForDependency } from './get_metadata_for_dependency'; @@ -28,6 +27,7 @@ import { DependencySpan, getTopDependencySpans, } from './get_top_dependency_spans'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const topDependenciesRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/dependencies/top_dependencies', @@ -100,11 +100,11 @@ const topDependenciesRoute = createApmServerRoute({ location: import('./../../../common/connections').Node; }>; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { environment, offset, numBuckets, kuery, start, end } = resources.params.query; - const opts = { setup, start, end, numBuckets, environment, kuery }; + const opts = { apmEventClient, start, end, numBuckets, environment, kuery }; const [currentDependencies, previousDependencies] = await Promise.all([ getTopDependencies(opts), @@ -198,7 +198,7 @@ const upstreamServicesForDependencyRoute = createApmServerRoute({ location: import('./../../../common/connections').Node; }>; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { query: { dependencyName, @@ -213,7 +213,7 @@ const upstreamServicesForDependencyRoute = createApmServerRoute({ const opts = { dependencyName, - setup, + apmEventClient, start, end, numBuckets, @@ -264,14 +264,14 @@ const dependencyMetadataRoute = createApmServerRoute({ ): Promise<{ metadata: { spanType: string | undefined; spanSubtype: string | undefined }; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { dependencyName, start, end } = params.query; const metadata = await getMetadataForDependency({ dependencyName, - setup, + apmEventClient, start, end, }); @@ -304,7 +304,7 @@ const dependencyLatencyChartsRoute = createApmServerRoute({ currentTimeseries: Array<{ x: number; y: number }>; comparisonTimeseries: Array<{ x: number; y: number }> | null; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { dependencyName, @@ -322,7 +322,7 @@ const dependencyLatencyChartsRoute = createApmServerRoute({ dependencyName, spanName, searchServiceDestinationMetrics, - setup, + apmEventClient, start, end, kuery, @@ -333,7 +333,7 @@ const dependencyLatencyChartsRoute = createApmServerRoute({ dependencyName, spanName, searchServiceDestinationMetrics, - setup, + apmEventClient, start, end, kuery, @@ -371,7 +371,7 @@ const dependencyThroughputChartsRoute = createApmServerRoute({ currentTimeseries: Array<{ x: number; y: number | null }>; comparisonTimeseries: Array<{ x: number; y: number | null }> | null; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { dependencyName, @@ -388,7 +388,7 @@ const dependencyThroughputChartsRoute = createApmServerRoute({ getThroughputChartsForDependency({ dependencyName, spanName, - setup, + apmEventClient, start, end, kuery, @@ -399,7 +399,7 @@ const dependencyThroughputChartsRoute = createApmServerRoute({ ? getThroughputChartsForDependency({ dependencyName, spanName, - setup, + apmEventClient, start, end, kuery, @@ -438,7 +438,7 @@ const dependencyFailedTransactionRateChartsRoute = createApmServerRoute({ currentTimeseries: Array<{ x: number; y: number }>; comparisonTimeseries: Array<{ x: number; y: number }> | null; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { dependencyName, @@ -455,7 +455,7 @@ const dependencyFailedTransactionRateChartsRoute = createApmServerRoute({ getErrorRateChartsForDependency({ dependencyName, spanName, - setup, + apmEventClient, start, end, kuery, @@ -466,7 +466,7 @@ const dependencyFailedTransactionRateChartsRoute = createApmServerRoute({ ? getErrorRateChartsForDependency({ dependencyName, spanName, - setup, + apmEventClient, start, end, kuery, @@ -501,7 +501,7 @@ const dependencyOperationsRoute = createApmServerRoute({ handler: async ( resources ): Promise<{ operations: DependencyOperation[] }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { query: { @@ -516,7 +516,7 @@ const dependencyOperationsRoute = createApmServerRoute({ } = resources.params; const operations = await getTopDependencyOperations({ - setup, + apmEventClient, dependencyName, start, end, @@ -553,7 +553,7 @@ const dependencyLatencyDistributionChartsRoute = createApmServerRoute({ allSpansDistribution: OverallLatencyDistributionResponse; failedSpansDistribution: OverallLatencyDistributionResponse; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { dependencyName, @@ -566,7 +566,7 @@ const dependencyLatencyDistributionChartsRoute = createApmServerRoute({ } = params.query; return getDependencyLatencyDistribution({ - setup, + apmEventClient, dependencyName, spanName, percentileThreshold, @@ -593,7 +593,7 @@ const topDependencySpansRoute = createApmServerRoute({ ]), }), handler: async (resources): Promise<{ spans: DependencySpan[] }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { query: { @@ -609,7 +609,7 @@ const topDependencySpansRoute = createApmServerRoute({ } = resources.params; const spans = await getTopDependencySpans({ - setup, + apmEventClient, dependencyName, spanName, start, diff --git a/x-pack/plugins/apm/server/routes/environments/get_all_environments.test.ts b/x-pack/plugins/apm/server/routes/environments/get_all_environments.test.ts index 0f27839d94048..7a70bbff5f165 100644 --- a/x-pack/plugins/apm/server/routes/environments/get_all_environments.test.ts +++ b/x-pack/plugins/apm/server/routes/environments/get_all_environments.test.ts @@ -19,11 +19,11 @@ describe('getAllEnvironments', () => { }); it('fetches all environments', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getAllEnvironments({ searchAggregatedTransactions: false, serviceName: 'test', - setup, + apmEventClient: mockApmEventClient, size: 50, }) ); @@ -32,12 +32,12 @@ describe('getAllEnvironments', () => { }); it('fetches all environments with includeMissing', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getAllEnvironments({ includeMissing: true, searchAggregatedTransactions: false, serviceName: 'test', - setup, + apmEventClient: mockApmEventClient, size: 50, }) ); diff --git a/x-pack/plugins/apm/server/routes/environments/get_all_environments.ts b/x-pack/plugins/apm/server/routes/environments/get_all_environments.ts index 6cac07f1ea9be..8cd7c14a0d629 100644 --- a/x-pack/plugins/apm/server/routes/environments/get_all_environments.ts +++ b/x-pack/plugins/apm/server/routes/environments/get_all_environments.ts @@ -7,13 +7,13 @@ import { termQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { Setup } from '../../lib/helpers/setup_request'; import { SERVICE_NAME, SERVICE_ENVIRONMENT, } from '../../../common/elasticsearch_fieldnames'; import { ENVIRONMENT_NOT_DEFINED } from '../../../common/environment_filter_values'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; /** * This is used for getting *all* environments, and does not filter by range. @@ -23,21 +23,19 @@ export async function getAllEnvironments({ includeMissing = false, searchAggregatedTransactions, serviceName, - setup, + apmEventClient, size, }: { includeMissing?: boolean; searchAggregatedTransactions: boolean; serviceName?: string; - setup: Setup; + apmEventClient: APMEventClient; size: number; }) { const operationName = serviceName ? 'get_all_environments_for_service' : 'get_all_environments_for_all_services'; - const { apmEventClient } = setup; - const params = { apm: { events: [ diff --git a/x-pack/plugins/apm/server/routes/environments/get_environments.test.ts b/x-pack/plugins/apm/server/routes/environments/get_environments.test.ts index 472fd9d226e35..0cc84dfe6517b 100644 --- a/x-pack/plugins/apm/server/routes/environments/get_environments.test.ts +++ b/x-pack/plugins/apm/server/routes/environments/get_environments.test.ts @@ -19,9 +19,9 @@ describe('getEnvironments', () => { }); it('fetches environments', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getEnvironments({ - setup, + apmEventClient: mockApmEventClient, serviceName: 'foo', searchAggregatedTransactions: false, size: 50, @@ -34,9 +34,9 @@ describe('getEnvironments', () => { }); it('fetches environments without a service name', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getEnvironments({ - setup, + apmEventClient: mockApmEventClient, searchAggregatedTransactions: false, size: 50, start: 0, diff --git a/x-pack/plugins/apm/server/routes/environments/get_environments.ts b/x-pack/plugins/apm/server/routes/environments/get_environments.ts index dbd0eb5a9d9c6..e8a3abace204e 100644 --- a/x-pack/plugins/apm/server/routes/environments/get_environments.ts +++ b/x-pack/plugins/apm/server/routes/environments/get_environments.ts @@ -13,8 +13,8 @@ import { } from '../../../common/elasticsearch_fieldnames'; import { ENVIRONMENT_NOT_DEFINED } from '../../../common/environment_filter_values'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; -import { Setup } from '../../lib/helpers/setup_request'; import { Environment } from '../../../common/environment_rt'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; /** * This is used for getting the list of environments for the environments selector, @@ -23,12 +23,12 @@ import { Environment } from '../../../common/environment_rt'; export async function getEnvironments({ searchAggregatedTransactions, serviceName, - setup, + apmEventClient, size, start, end, }: { - setup: Setup; + apmEventClient: APMEventClient; serviceName?: string; searchAggregatedTransactions: boolean; size: number; @@ -39,8 +39,6 @@ export async function getEnvironments({ ? 'get_environments_for_service' : 'get_environments'; - const { apmEventClient } = setup; - const params = { apm: { events: [ diff --git a/x-pack/plugins/apm/server/routes/environments/route.ts b/x-pack/plugins/apm/server/routes/environments/route.ts index 4a7755230754c..32b7d2a5117d5 100644 --- a/x-pack/plugins/apm/server/routes/environments/route.ts +++ b/x-pack/plugins/apm/server/routes/environments/route.ts @@ -8,10 +8,10 @@ import * as t from 'io-ts'; import { maxSuggestions } from '@kbn/observability-plugin/common'; import { getSearchTransactionsEvents } from '../../lib/helpers/transactions'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { getEnvironments } from './get_environments'; import { rangeRt } from '../default_api_types'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const environmentsRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/environments', @@ -30,18 +30,15 @@ const environmentsRoute = createApmServerRoute({ environments: Array< | 'ENVIRONMENT_NOT_DEFINED' | 'ENVIRONMENT_ALL' - | t.Branded< - string, - import('./../../../../../../node_modules/@types/kbn__io-ts-utils/index').NonEmptyStringBrand - > + | t.Branded<string, import('@kbn/io-ts-utils').NonEmptyStringBrand> >; }> => { - const setup = await setupRequest(resources); - const { context, params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { context, params, config } = resources; const { serviceName, start, end } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, start, end, kuery: '', @@ -51,7 +48,7 @@ const environmentsRoute = createApmServerRoute({ maxSuggestions ); const environments = await getEnvironments({ - setup, + apmEventClient, serviceName, searchAggregatedTransactions, size, diff --git a/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.test.ts b/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.test.ts index 6d460e5d42d7b..4a3fc6d969cd0 100644 --- a/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.test.ts +++ b/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.test.ts @@ -6,7 +6,6 @@ */ import { getBuckets } from './get_buckets'; -import { APMConfig } from '../../..'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; describe('get buckets', () => { @@ -29,30 +28,9 @@ describe('get buckets', () => { serviceName: 'myServiceName', bucketSize: 10, kuery: '', - setup: { - apmEventClient: { - search: clientSpy, - } as any, - internalClient: { - search: clientSpy, - } as any, - config: new Proxy( - {}, - { - get: () => 'myIndex', - } - ) as APMConfig, - indices: { - sourcemap: 'apm-*', - error: 'apm-*', - onboarding: 'apm-*', - span: 'apm-*', - transaction: 'apm-*', - metric: 'apm-*', - apmAgentConfigurationIndex: '.apm-agent-configuration', - apmCustomLinkIndex: '.apm-custom-link', - }, - }, + apmEventClient: { + search: clientSpy, + } as any, start: 1528113600000, end: 1528977600000, }); diff --git a/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.ts b/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.ts index bd1b070da90d7..770305df2aab2 100644 --- a/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.ts +++ b/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.ts @@ -16,7 +16,7 @@ import { SERVICE_NAME, } from '../../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../../common/utils/environment_query'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getBuckets({ environment, @@ -24,7 +24,7 @@ export async function getBuckets({ serviceName, groupId, bucketSize, - setup, + apmEventClient, start, end, }: { @@ -33,12 +33,10 @@ export async function getBuckets({ serviceName: string; groupId?: string; bucketSize: number; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; }) { - const { apmEventClient } = setup; - const params = { apm: { events: [ProcessorEvent.error], diff --git a/x-pack/plugins/apm/server/routes/errors/distribution/get_distribution.ts b/x-pack/plugins/apm/server/routes/errors/distribution/get_distribution.ts index f4df8ab5b7dfb..9d7116a03226d 100644 --- a/x-pack/plugins/apm/server/routes/errors/distribution/get_distribution.ts +++ b/x-pack/plugins/apm/server/routes/errors/distribution/get_distribution.ts @@ -6,10 +6,10 @@ */ import { offsetPreviousPeriodCoordinates } from '../../../../common/utils/offset_previous_period_coordinate'; -import { Setup } from '../../../lib/helpers/setup_request'; import { BUCKET_TARGET_COUNT } from '../../transactions/constants'; import { getBuckets } from './get_buckets'; import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; function getBucketSize({ start, end }: { start: number; end: number }) { return Math.floor((end - start) / BUCKET_TARGET_COUNT); @@ -20,7 +20,7 @@ export async function getErrorDistribution({ kuery, serviceName, groupId, - setup, + apmEventClient, start, end, offset, @@ -29,7 +29,7 @@ export async function getErrorDistribution({ kuery: string; serviceName: string; groupId?: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; offset?: string; @@ -50,7 +50,7 @@ export async function getErrorDistribution({ kuery, serviceName, groupId, - setup, + apmEventClient, bucketSize, }; const currentPeriodPromise = getBuckets({ diff --git a/x-pack/plugins/apm/server/routes/errors/distribution/queries.test.ts b/x-pack/plugins/apm/server/routes/errors/distribution/queries.test.ts index bda8abc1659eb..2030239a68eaa 100644 --- a/x-pack/plugins/apm/server/routes/errors/distribution/queries.test.ts +++ b/x-pack/plugins/apm/server/routes/errors/distribution/queries.test.ts @@ -20,10 +20,10 @@ describe('error distribution queries', () => { }); it('fetches an error distribution', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getErrorDistribution({ serviceName: 'serviceName', - setup, + apmEventClient: mockApmEventClient, environment: ENVIRONMENT_ALL.value, kuery: '', start: 0, @@ -35,11 +35,11 @@ describe('error distribution queries', () => { }); it('fetches an error distribution with a group id', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getErrorDistribution({ serviceName: 'serviceName', groupId: 'foo', - setup, + apmEventClient: mockApmEventClient, environment: ENVIRONMENT_ALL.value, kuery: '', start: 0, diff --git a/x-pack/plugins/apm/server/routes/errors/erroneous_transactions/get_top_erroneous_transactions.ts b/x-pack/plugins/apm/server/routes/errors/erroneous_transactions/get_top_erroneous_transactions.ts index d126057f515be..70ee012635b01 100644 --- a/x-pack/plugins/apm/server/routes/errors/erroneous_transactions/get_top_erroneous_transactions.ts +++ b/x-pack/plugins/apm/server/routes/errors/erroneous_transactions/get_top_erroneous_transactions.ts @@ -26,16 +26,16 @@ import { TRANSACTION_TYPE, } from '../../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../../common/utils/environment_query'; -import { Setup } from '../../../lib/helpers/setup_request'; import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; async function getTopErroneousTransactions({ environment, kuery, serviceName, groupId, - setup, + apmEventClient, start, end, numBuckets, @@ -45,14 +45,12 @@ async function getTopErroneousTransactions({ kuery: string; serviceName: string; groupId: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; numBuckets: number; offset?: string; }) { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset, offsetInMs } = getOffsetInMs({ start, end, @@ -132,7 +130,7 @@ async function getTopErroneousTransactions({ export async function getTopErroneousTransactionsPeriods({ kuery, serviceName, - setup, + apmEventClient, numBuckets, groupId, environment, @@ -142,7 +140,7 @@ export async function getTopErroneousTransactionsPeriods({ }: { kuery: string; serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; numBuckets: number; groupId: string; environment: string; @@ -155,7 +153,7 @@ export async function getTopErroneousTransactionsPeriods({ environment, kuery, serviceName, - setup, + apmEventClient, numBuckets, groupId, start, @@ -166,7 +164,7 @@ export async function getTopErroneousTransactionsPeriods({ environment, kuery, serviceName, - setup, + apmEventClient, numBuckets, groupId, start, diff --git a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts index 325b134902c86..30720c2d799c3 100644 --- a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts +++ b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts @@ -20,13 +20,13 @@ import { } from '../../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; -import { Setup } from '../../../lib/helpers/setup_request'; import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getErrorGroupDetailedStatistics({ kuery, serviceName, - setup, + apmEventClient, numBuckets, groupIds, environment, @@ -36,7 +36,7 @@ export async function getErrorGroupDetailedStatistics({ }: { kuery: string; serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; numBuckets: number; groupIds: string[]; environment: string; @@ -44,8 +44,6 @@ export async function getErrorGroupDetailedStatistics({ end: number; offset?: string; }): Promise<Array<{ groupId: string; timeseries: Coordinate[] }>> { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, @@ -124,7 +122,7 @@ export async function getErrorGroupDetailedStatistics({ export async function getErrorGroupPeriods({ kuery, serviceName, - setup, + apmEventClient, numBuckets, groupIds, environment, @@ -134,7 +132,7 @@ export async function getErrorGroupPeriods({ }: { kuery: string; serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; numBuckets: number; groupIds: string[]; environment: string; @@ -146,7 +144,7 @@ export async function getErrorGroupPeriods({ environment, kuery, serviceName, - setup, + apmEventClient, numBuckets, groupIds, }; diff --git a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts index c27d30a253f28..f4d2fcff4a402 100644 --- a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts +++ b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts @@ -25,12 +25,12 @@ import { } from '../../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { getErrorName } from '../../../lib/helpers/get_error_name'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getErrorGroupMainStatistics({ kuery, serviceName, - setup, + apmEventClient, environment, sortField, sortDirection = 'desc', @@ -42,7 +42,7 @@ export async function getErrorGroupMainStatistics({ }: { kuery: string; serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; environment: string; sortField?: string; sortDirection?: 'asc' | 'desc'; @@ -52,8 +52,6 @@ export async function getErrorGroupMainStatistics({ transactionName?: string; transactionType?: string; }) { - const { apmEventClient } = setup; - // sort buckets by last occurrence of error const sortByLatestOccurrence = sortField === 'lastSeen'; diff --git a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts index d5a8b8a5ac650..744db1c9c21b8 100644 --- a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts +++ b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts @@ -15,14 +15,14 @@ import { } from '../../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { getTransaction } from '../../transactions/get_transaction'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getErrorGroupSample({ environment, kuery, serviceName, groupId, - setup, + apmEventClient, start, end, }: { @@ -30,12 +30,10 @@ export async function getErrorGroupSample({ kuery: string; serviceName: string; groupId: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; }) { - const { apmEventClient } = setup; - const params = { apm: { events: [ProcessorEvent.error as const], @@ -72,7 +70,7 @@ export async function getErrorGroupSample({ transaction = await getTransaction({ transactionId, traceId, - setup, + apmEventClient, start, end, }); diff --git a/x-pack/plugins/apm/server/routes/errors/queries.test.ts b/x-pack/plugins/apm/server/routes/errors/queries.test.ts index 7cb84db0d7862..bc0f18884d1b0 100644 --- a/x-pack/plugins/apm/server/routes/errors/queries.test.ts +++ b/x-pack/plugins/apm/server/routes/errors/queries.test.ts @@ -21,11 +21,11 @@ describe('error queries', () => { }); it('fetches a single error group', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getErrorGroupSample({ groupId: 'groupId', serviceName: 'serviceName', - setup, + apmEventClient: mockApmEventClient, environment: ENVIRONMENT_ALL.value, kuery: '', start: 0, @@ -37,12 +37,12 @@ describe('error queries', () => { }); it('fetches multiple error groups', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getErrorGroupMainStatistics({ sortDirection: 'asc', sortField: 'foo', serviceName: 'serviceName', - setup, + apmEventClient: mockApmEventClient, environment: ENVIRONMENT_ALL.value, kuery: '', start: 0, @@ -54,12 +54,12 @@ describe('error queries', () => { }); it('fetches multiple error groups when sortField = lastSeen', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getErrorGroupMainStatistics({ sortDirection: 'asc', sortField: 'lastSeen', serviceName: 'serviceName', - setup, + apmEventClient: mockApmEventClient, environment: ENVIRONMENT_ALL.value, kuery: '', start: 0, diff --git a/x-pack/plugins/apm/server/routes/errors/route.ts b/x-pack/plugins/apm/server/routes/errors/route.ts index 17faea2765daa..5bb3bda954ee5 100644 --- a/x-pack/plugins/apm/server/routes/errors/route.ts +++ b/x-pack/plugins/apm/server/routes/errors/route.ts @@ -9,13 +9,13 @@ import { jsonRt, toNumberRt } from '@kbn/io-ts-utils'; import * as t from 'io-ts'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { getErrorDistribution } from './distribution/get_distribution'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { getErrorGroupMainStatistics } from './get_error_groups/get_error_group_main_statistics'; import { getErrorGroupPeriods } from './get_error_groups/get_error_group_detailed_statistics'; import { getErrorGroupSample } from './get_error_groups/get_error_group_sample'; import { offsetRt } from '../../../common/comparison_rt'; import { getTopErroneousTransactionsPeriods } from './erroneous_transactions/get_top_erroneous_transactions'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const errorsMainStatisticsRoute = createApmServerRoute({ endpoint: @@ -49,7 +49,7 @@ const errorsMainStatisticsRoute = createApmServerRoute({ }>; }> => { const { params } = resources; - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { serviceName } = params.path; const { environment, kuery, sortField, sortDirection, start, end } = params.query; @@ -60,7 +60,7 @@ const errorsMainStatisticsRoute = createApmServerRoute({ serviceName, sortField, sortDirection, - setup, + apmEventClient, start, end, }); @@ -102,7 +102,7 @@ const errorsMainStatisticsByTransactionNameRoute = createApmServerRoute({ }>; }> => { const { params } = resources; - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { serviceName } = params.path; const { environment, @@ -118,7 +118,7 @@ const errorsMainStatisticsByTransactionNameRoute = createApmServerRoute({ environment, kuery, serviceName, - setup, + apmEventClient, start, end, maxNumberOfErrorGroups, @@ -164,7 +164,7 @@ const errorsDetailedStatisticsRoute = createApmServerRoute({ groupId: string; }>; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { @@ -177,7 +177,7 @@ const errorsDetailedStatisticsRoute = createApmServerRoute({ environment, kuery, serviceName, - setup, + apmEventClient, numBuckets, groupIds, start, @@ -207,7 +207,7 @@ const errorGroupsRoute = createApmServerRoute({ occurrencesCount: number; }> => { const { params } = resources; - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { serviceName, groupId } = params.path; const { environment, kuery, start, end } = params.query; @@ -216,7 +216,7 @@ const errorGroupsRoute = createApmServerRoute({ groupId, kuery, serviceName, - setup, + apmEventClient, start, end, }); @@ -250,7 +250,7 @@ const errorDistributionRoute = createApmServerRoute({ }>; bucketSize: number; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { serviceName } = params.path; const { environment, kuery, groupId, start, end, offset } = params.query; @@ -259,7 +259,7 @@ const errorDistributionRoute = createApmServerRoute({ kuery, serviceName, groupId, - setup, + apmEventClient, start, end, offset, @@ -298,7 +298,7 @@ const topErroneousTransactionsRoute = createApmServerRoute({ }>; }> => { const { params } = resources; - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { path: { serviceName, groupId }, @@ -310,7 +310,7 @@ const topErroneousTransactionsRoute = createApmServerRoute({ groupId, kuery, serviceName, - setup, + apmEventClient, start, end, numBuckets, diff --git a/x-pack/plugins/apm/server/routes/event_metadata/route.ts b/x-pack/plugins/apm/server/routes/event_metadata/route.ts index a057be53ef43f..02709d2c499e5 100644 --- a/x-pack/plugins/apm/server/routes/event_metadata/route.ts +++ b/x-pack/plugins/apm/server/routes/event_metadata/route.ts @@ -9,7 +9,7 @@ import * as t from 'io-ts'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { getEventMetadata } from './get_event_metadata'; import { processorEventRt } from '../../../common/processor_event'; -import { setupRequest } from '../../lib/helpers/setup_request'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const eventMetadataRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/event_metadata/{processorEvent}/{id}', @@ -23,14 +23,14 @@ const eventMetadataRoute = createApmServerRoute({ handler: async ( resources ): Promise<{ metadata: Partial<Record<string, unknown[]>> }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { path: { processorEvent, id }, } = resources.params; const metadata = await getEventMetadata({ - apmEventClient: setup.apmEventClient, + apmEventClient, processorEvent, id, }); diff --git a/x-pack/plugins/apm/server/routes/fallback_to_transactions/route.ts b/x-pack/plugins/apm/server/routes/fallback_to_transactions/route.ts index 60355b5447b85..2b9af46c0ac4d 100644 --- a/x-pack/plugins/apm/server/routes/fallback_to_transactions/route.ts +++ b/x-pack/plugins/apm/server/routes/fallback_to_transactions/route.ts @@ -7,9 +7,9 @@ import * as t from 'io-ts'; import { getIsUsingTransactionEvents } from '../../lib/helpers/transactions/get_is_using_transaction_events'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { kueryRt, rangeRt } from '../default_api_types'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const fallbackToTransactionsRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/fallback_to_transactions', @@ -18,15 +18,17 @@ const fallbackToTransactionsRoute = createApmServerRoute({ }), options: { tags: ['access:apm'] }, handler: async (resources): Promise<{ fallbackToTransactions: boolean }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { + config, params: { query: { kuery, start, end }, }, } = resources; return { fallbackToTransactions: await getIsUsingTransactionEvents({ - setup, + config, + apmEventClient, kuery, start, end, diff --git a/x-pack/plugins/apm/server/routes/fleet/create_cloud_apm_package_policy.ts b/x-pack/plugins/apm/server/routes/fleet/create_cloud_apm_package_policy.ts index 1feeab80875e0..e3a0ccd5345c8 100644 --- a/x-pack/plugins/apm/server/routes/fleet/create_cloud_apm_package_policy.ts +++ b/x-pack/plugins/apm/server/routes/fleet/create_cloud_apm_package_policy.ts @@ -21,9 +21,9 @@ import { APMPluginStartDependencies, } from '../../types'; import { getApmPackagePolicyDefinition } from './get_apm_package_policy_definition'; -import { Setup } from '../../lib/helpers/setup_request'; import { mergePackagePolicyWithApm } from './merge_package_policy_with_apm'; import { ELASTIC_CLOUD_APM_AGENT_POLICY_ID } from '../../../common/fleet'; +import { APMInternalESClient } from '../../lib/helpers/create_es_client/create_internal_es_client'; export async function createCloudApmPackgePolicy({ cloudPluginSetup, @@ -31,7 +31,7 @@ export async function createCloudApmPackgePolicy({ savedObjectsClient, esClient, logger, - setup, + internalESClient, request, }: { cloudPluginSetup: APMPluginSetupDependencies['cloud']; @@ -39,7 +39,7 @@ export async function createCloudApmPackgePolicy({ savedObjectsClient: SavedObjectsClientContract; esClient: ElasticsearchClient; logger: Logger; - setup: Setup; + internalESClient: APMInternalESClient; request: KibanaRequest; }): Promise<PackagePolicy> { const { attributes } = await savedObjectsClient.get( @@ -57,7 +57,7 @@ export async function createCloudApmPackgePolicy({ request, }); const mergedAPMPackagePolicy = await mergePackagePolicyWithApm({ - setup, + internalESClient, packagePolicy: apmPackagePolicyDefinition, fleetPluginStart, }); diff --git a/x-pack/plugins/apm/server/routes/fleet/merge_package_policy_with_apm.ts b/x-pack/plugins/apm/server/routes/fleet/merge_package_policy_with_apm.ts index 5442185decde3..37f0705904770 100644 --- a/x-pack/plugins/apm/server/routes/fleet/merge_package_policy_with_apm.ts +++ b/x-pack/plugins/apm/server/routes/fleet/merge_package_policy_with_apm.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Setup } from '../../lib/helpers/setup_request'; +import { APMInternalESClient } from '../../lib/helpers/create_es_client/create_internal_es_client'; import { APMPluginStartDependencies } from '../../types'; import { listConfigurations } from '../settings/agent_configuration/list_configurations'; import { @@ -16,14 +16,14 @@ import { getPackagePolicyWithSourceMap, listArtifacts } from './source_maps'; export async function mergePackagePolicyWithApm({ packagePolicy, - setup, + internalESClient, fleetPluginStart, }: { packagePolicy: PackagePolicy; - setup: Setup; + internalESClient: APMInternalESClient; fleetPluginStart: NonNullable<APMPluginStartDependencies['fleet']>; }) { - const agentConfigurations = await listConfigurations({ setup }); + const agentConfigurations = await listConfigurations(internalESClient); const artifacts = await listArtifacts({ fleetPluginStart }); return getPackagePolicyWithAgentConfigurations( getPackagePolicyWithSourceMap({ packagePolicy, artifacts }), diff --git a/x-pack/plugins/apm/server/routes/fleet/register_fleet_policy_callbacks.ts b/x-pack/plugins/apm/server/routes/fleet/register_fleet_policy_callbacks.ts index 5235ddb9cb9d9..52e77f3643bcd 100644 --- a/x-pack/plugins/apm/server/routes/fleet/register_fleet_policy_callbacks.ts +++ b/x-pack/plugins/apm/server/routes/fleet/register_fleet_policy_callbacks.ts @@ -14,10 +14,10 @@ import { UpdatePackagePolicy, } from '@kbn/fleet-plugin/common'; import { APMPlugin, APMRouteHandlerResources } from '../..'; +import { createInternalESClient } from '../../lib/helpers/create_es_client/create_internal_es_client'; import { AgentConfiguration } from '../../../common/agent_configuration/configuration_types'; import { AGENT_NAME } from '../../../common/elasticsearch_fieldnames'; import { APMPluginStartDependencies } from '../../types'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { mergePackagePolicyWithApm } from './merge_package_policy_with_apm'; export async function registerFleetPolicyCallbacks({ @@ -97,19 +97,16 @@ function registerPackagePolicyExternalCallback({ if (packagePolicy.package?.name !== 'apm') { return packagePolicy; } - const setup = await setupRequest({ + + const internalESClient = await createInternalESClient({ context: context as any, - params: { query: { _inspect: false } }, - core: null as any, - plugins, + debug: false, request, config, - logger, - ruleDataClient, - kibanaVersion, }); + return await mergePackagePolicyWithApm({ - setup, + internalESClient, fleetPluginStart, packagePolicy, }); diff --git a/x-pack/plugins/apm/server/routes/fleet/route.ts b/x-pack/plugins/apm/server/routes/fleet/route.ts index 418f85a0d53b9..f988e2bba7f5b 100644 --- a/x-pack/plugins/apm/server/routes/fleet/route.ts +++ b/x-pack/plugins/apm/server/routes/fleet/route.ts @@ -23,10 +23,10 @@ import { import { getUnsupportedApmServerSchema } from './get_unsupported_apm_server_schema'; import { isSuperuser } from './is_superuser'; import { getInternalSavedObjectsClient } from '../../lib/helpers/get_internal_saved_objects_client'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { getLatestApmPackage } from './get_latest_apm_package'; import { getJavaAgentVersionsFromRegistry } from './get_java_agent_versions'; +import { createInternalESClient } from '../../lib/helpers/create_es_client/create_internal_es_client'; const hasFleetDataRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/fleet/has_apm_policies', @@ -245,7 +245,12 @@ const createCloudApmPackagePolicyRoute = createApmServerRoute({ throw Boom.forbidden(CLOUD_SUPERUSER_REQUIRED_MESSAGE); } - const setup = await setupRequest(resources); + const internalESClient = await createInternalESClient({ + context, + request, + debug: resources.params.query._inspect, + config: resources.config, + }); const cloudApmPackagePolicy = await createCloudApmPackgePolicy({ cloudPluginSetup, @@ -253,7 +258,7 @@ const createCloudApmPackagePolicyRoute = createApmServerRoute({ savedObjectsClient, esClient, logger, - setup, + internalESClient, request, }); diff --git a/x-pack/plugins/apm/server/routes/fleet/sync_agent_configs_to_apm_package_policies.ts b/x-pack/plugins/apm/server/routes/fleet/sync_agent_configs_to_apm_package_policies.ts index c36be18c6b251..5d8e7147ad1f2 100644 --- a/x-pack/plugins/apm/server/routes/fleet/sync_agent_configs_to_apm_package_policies.ts +++ b/x-pack/plugins/apm/server/routes/fleet/sync_agent_configs_to_apm_package_policies.ts @@ -13,20 +13,20 @@ import { import { TelemetryUsageCounter } from '../typings'; import { APMPluginStartDependencies } from '../../types'; import { getInternalSavedObjectsClient } from '../../lib/helpers/get_internal_saved_objects_client'; -import { Setup } from '../../lib/helpers/setup_request'; import { listConfigurations } from '../settings/agent_configuration/list_configurations'; import { getApmPackagePolicies } from './get_apm_package_policies'; import { getPackagePolicyWithAgentConfigurations } from './register_fleet_policy_callbacks'; +import { APMInternalESClient } from '../../lib/helpers/create_es_client/create_internal_es_client'; export async function syncAgentConfigsToApmPackagePolicies({ core, fleetPluginStart, - setup, + internalESClient, telemetryUsageCounter, }: { core: { setup: CoreSetup; start: () => Promise<CoreStart> }; fleetPluginStart: NonNullable<APMPluginStartDependencies['fleet']>; - setup: Setup; + internalESClient: APMInternalESClient; telemetryUsageCounter?: TelemetryUsageCounter; }) { if (telemetryUsageCounter) { @@ -40,7 +40,7 @@ export async function syncAgentConfigsToApmPackagePolicies({ const [savedObjectsClient, agentConfigurations, packagePolicies] = await Promise.all([ getInternalSavedObjectsClient(core.setup), - listConfigurations({ setup }), + listConfigurations(internalESClient), getApmPackagePolicies({ core, fleetPluginStart, diff --git a/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts b/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts index e269e036396fd..befd25abb22f2 100644 --- a/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts +++ b/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts @@ -6,12 +6,10 @@ */ import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; // Note: this logic is duplicated in tutorials/apm/envs/on_prem -export async function hasHistoricalAgentData(setup: Setup) { - const { apmEventClient } = setup; - +export async function hasHistoricalAgentData(apmEventClient: APMEventClient) { const params = { terminate_after: 1, apm: { diff --git a/x-pack/plugins/apm/server/routes/historical_data/route.ts b/x-pack/plugins/apm/server/routes/historical_data/route.ts index e9836df61acbf..204af4bb05b03 100644 --- a/x-pack/plugins/apm/server/routes/historical_data/route.ts +++ b/x-pack/plugins/apm/server/routes/historical_data/route.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { setupRequest } from '../../lib/helpers/setup_request'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { hasHistoricalAgentData } from './has_historical_agent_data'; @@ -13,8 +13,8 @@ const hasDataRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/has_data', options: { tags: ['access:apm'] }, handler: async (resources): Promise<{ hasData: boolean }> => { - const setup = await setupRequest(resources); - const hasData = await hasHistoricalAgentData(setup); + const apmEventClient = await getApmEventClient(resources); + const hasData = await hasHistoricalAgentData(apmEventClient); return { hasData }; }, }); diff --git a/x-pack/plugins/apm/server/routes/infrastructure/get_infrastructure_data.ts b/x-pack/plugins/apm/server/routes/infrastructure/get_infrastructure_data.ts index 0d79901efbc72..73c9732335c10 100644 --- a/x-pack/plugins/apm/server/routes/infrastructure/get_infrastructure_data.ts +++ b/x-pack/plugins/apm/server/routes/infrastructure/get_infrastructure_data.ts @@ -7,7 +7,6 @@ import { rangeQuery, kqlQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { Setup } from '../../lib/helpers/setup_request'; import { environmentQuery } from '../../../common/utils/environment_query'; import { SERVICE_NAME, @@ -15,24 +14,23 @@ import { HOST_HOSTNAME, KUBERNETES_POD_NAME, } from '../../../common/elasticsearch_fieldnames'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export const getInfrastructureData = async ({ kuery, serviceName, environment, - setup, + apmEventClient, start, end, }: { kuery: string; serviceName: string; environment: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; }) => { - const { apmEventClient } = setup; - const response = await apmEventClient.search('get_service_infrastructure', { apm: { events: [ProcessorEvent.metric], diff --git a/x-pack/plugins/apm/server/routes/infrastructure/route.ts b/x-pack/plugins/apm/server/routes/infrastructure/route.ts index 678f380bc4fd8..151ed589396ce 100644 --- a/x-pack/plugins/apm/server/routes/infrastructure/route.ts +++ b/x-pack/plugins/apm/server/routes/infrastructure/route.ts @@ -6,7 +6,7 @@ */ import * as t from 'io-ts'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; -import { setupRequest } from '../../lib/helpers/setup_request'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { getInfrastructureData } from './get_infrastructure_data'; import { getContainerHostNames } from './get_host_names'; @@ -29,7 +29,7 @@ const infrastructureRoute = createApmServerRoute({ hostNames: string[]; podNames: string[]; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const infraMetricsClient = createInfraMetricsClient(resources); const { params } = resources; @@ -40,7 +40,7 @@ const infrastructureRoute = createApmServerRoute({ } = params; const infrastructureData = await getInfrastructureData({ - setup, + apmEventClient, serviceName, environment, kuery, diff --git a/x-pack/plugins/apm/server/routes/latency_distribution/get_overall_latency_distribution.ts b/x-pack/plugins/apm/server/routes/latency_distribution/get_overall_latency_distribution.ts index 206deb8a32d15..39ff3cf622dfd 100644 --- a/x-pack/plugins/apm/server/routes/latency_distribution/get_overall_latency_distribution.ts +++ b/x-pack/plugins/apm/server/routes/latency_distribution/get_overall_latency_distribution.ts @@ -7,21 +7,17 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { Environment } from '../../../common/environment_rt'; - -import { Setup } from '../../lib/helpers/setup_request'; - import { withApmSpan } from '../../utils/with_apm_span'; - import { fetchDurationRanges } from '../correlations/queries/fetch_duration_ranges'; import { fetchDurationHistogramRangeSteps } from '../correlations/queries/fetch_duration_histogram_range_steps'; - import { getPercentileThresholdValue } from './get_percentile_threshold_value'; import type { OverallLatencyDistributionResponse } from './types'; import { LatencyDistributionChartType } from '../../../common/latency_distribution_chart_types'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getOverallLatencyDistribution({ chartType, - setup, + apmEventClient, start, end, environment, @@ -33,7 +29,7 @@ export async function getOverallLatencyDistribution({ searchMetrics, }: { chartType: LatencyDistributionChartType; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; environment: Environment; @@ -51,7 +47,7 @@ export async function getOverallLatencyDistribution({ overallLatencyDistribution.percentileThresholdValue = await getPercentileThresholdValue({ chartType, - setup, + apmEventClient, start, end, environment, @@ -70,7 +66,7 @@ export async function getOverallLatencyDistribution({ const { durationMin, durationMax, rangeSteps } = await fetchDurationHistogramRangeSteps({ chartType, - setup, + apmEventClient, start, end, environment, @@ -88,7 +84,7 @@ export async function getOverallLatencyDistribution({ // #3: get histogram chart data const { totalDocCount, durationRanges } = await fetchDurationRanges({ chartType, - setup, + apmEventClient, start, end, environment, diff --git a/x-pack/plugins/apm/server/routes/latency_distribution/get_percentile_threshold_value.ts b/x-pack/plugins/apm/server/routes/latency_distribution/get_percentile_threshold_value.ts index e24fefa572882..bb6b65c4a1735 100644 --- a/x-pack/plugins/apm/server/routes/latency_distribution/get_percentile_threshold_value.ts +++ b/x-pack/plugins/apm/server/routes/latency_distribution/get_percentile_threshold_value.ts @@ -7,11 +7,11 @@ import { CommonCorrelationsQueryParams } from '../../../common/correlations/types'; import { LatencyDistributionChartType } from '../../../common/latency_distribution_chart_types'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; import { fetchDurationPercentiles } from '../correlations/queries/fetch_duration_percentiles'; export async function getPercentileThresholdValue({ - setup, + apmEventClient, chartType, start, end, @@ -21,13 +21,13 @@ export async function getPercentileThresholdValue({ percentileThreshold, searchMetrics, }: CommonCorrelationsQueryParams & { - setup: Setup; + apmEventClient: APMEventClient; chartType: LatencyDistributionChartType; percentileThreshold: number; searchMetrics: boolean; }) { const durationPercentiles = await fetchDurationPercentiles({ - setup, + apmEventClient, chartType, start, end, diff --git a/x-pack/plugins/apm/server/routes/latency_distribution/route.ts b/x-pack/plugins/apm/server/routes/latency_distribution/route.ts index ac0e65abe3157..0208d0a979b7e 100644 --- a/x-pack/plugins/apm/server/routes/latency_distribution/route.ts +++ b/x-pack/plugins/apm/server/routes/latency_distribution/route.ts @@ -10,7 +10,6 @@ import { toNumberRt } from '@kbn/io-ts-utils'; import { termQuery } from '@kbn/observability-plugin/server'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { getOverallLatencyDistribution } from './get_overall_latency_distribution'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { getSearchTransactionsEvents } from '../../lib/helpers/transactions'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; @@ -23,6 +22,7 @@ import { latencyDistributionChartTypeRt, LatencyDistributionChartType, } from '../../../common/latency_distribution_chart_types'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const latencyOverallTransactionDistributionRoute = createApmServerRoute({ endpoint: 'POST /internal/apm/latency/overall_distribution/transactions', @@ -54,7 +54,7 @@ const latencyOverallTransactionDistributionRoute = createApmServerRoute({ handler: async ( resources ): Promise<import('./types').OverallLatencyDistributionResponse> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { environment, @@ -75,7 +75,8 @@ const latencyOverallTransactionDistributionRoute = createApmServerRoute({ const searchAggregatedTransactions = chartType === LatencyDistributionChartType.transactionLatency ? await getSearchTransactionsEvents({ - ...setup, + config: resources.config, + apmEventClient, kuery, start, end, @@ -83,7 +84,7 @@ const latencyOverallTransactionDistributionRoute = createApmServerRoute({ : false; return getOverallLatencyDistribution({ - setup, + apmEventClient, chartType, environment, kuery, diff --git a/x-pack/plugins/apm/server/routes/latency_distribution/types.ts b/x-pack/plugins/apm/server/routes/latency_distribution/types.ts index 4fb19eba4e57d..79e386381a303 100644 --- a/x-pack/plugins/apm/server/routes/latency_distribution/types.ts +++ b/x-pack/plugins/apm/server/routes/latency_distribution/types.ts @@ -5,18 +5,6 @@ * 2.0. */ -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { FieldValuePair } from '../../../common/correlations/types'; - -import { Setup } from '../../lib/helpers/setup_request'; - -export interface OverallLatencyDistributionOptions { - query: QueryDslQueryContainer; - percentileThreshold: number; - termFilters?: FieldValuePair[]; - setup: Setup; -} - export interface OverallLatencyDistributionResponse { durationMin?: number; durationMax?: number; diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/default.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/default.ts index b4e95d5217daa..d228cdd352981 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/default.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/default.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMConfig } from '../../..'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; import { getCPUChartData } from './shared/cpu'; import { getMemoryChartData } from './shared/memory'; @@ -13,19 +14,37 @@ export function getDefaultMetricsCharts({ environment, kuery, serviceName, - setup, + config, + apmEventClient, start, end, }: { environment: string; kuery: string; serviceName: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; start: number; end: number; }) { return Promise.all([ - getCPUChartData({ environment, kuery, setup, serviceName, start, end }), - getMemoryChartData({ environment, kuery, setup, serviceName, start, end }), + getCPUChartData({ + environment, + kuery, + config, + apmEventClient, + serviceName, + start, + end, + }), + getMemoryChartData({ + environment, + kuery, + config, + apmEventClient, + serviceName, + start, + end, + }), ]); } diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.test.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.test.ts index 8b3fcbfe5ce88..debb20c11f1a5 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.test.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.test.ts @@ -5,11 +5,12 @@ * 2.0. */ +import { APMConfig } from '../../../../..'; import { METRIC_JAVA_GC_COUNT, METRIC_JAVA_GC_TIME, } from '../../../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../../../lib/helpers/create_es_client/create_apm_event_client'; import { ChartBase } from '../../../types'; import { fetchAndTransformGcMetrics } from './fetch_and_transform_gc_metrics'; @@ -49,10 +50,10 @@ describe('fetchAndTransformGcMetrics', () => { }, }, }; - const setup = { - apmEventClient: { search: () => Promise.resolve(response) }, - config: { 'xpack.gc.metricsInterval': 0 }, - } as unknown as Setup; + const config = { 'xpack.gc.metricsInterval': 0 } as unknown as APMConfig; + const apmEventClient = { + search: () => Promise.resolve(response), + } as unknown as APMEventClient; const fieldName = METRIC_JAVA_GC_TIME; const { series } = await fetchAndTransformGcMetrics({ @@ -61,7 +62,8 @@ describe('fetchAndTransformGcMetrics', () => { fieldName, kuery: '', operationName: 'test operation name', - setup, + config, + apmEventClient, serviceName: 'test service name', start: 1633456140000, end: 1633457078105, @@ -109,10 +111,10 @@ describe('fetchAndTransformGcMetrics', () => { }, }, }; - const setup = { - apmEventClient: { search: () => Promise.resolve(response) }, - config: { 'xpack.gc.metricsInterval': 0 }, - } as unknown as Setup; + const config = { 'xpack.gc.metricsInterval': 0 } as unknown as APMConfig; + const apmEventClient = { + search: () => Promise.resolve(response), + } as unknown as APMEventClient; const fieldName = METRIC_JAVA_GC_COUNT; const { series } = await fetchAndTransformGcMetrics({ @@ -121,7 +123,8 @@ describe('fetchAndTransformGcMetrics', () => { fieldName, kuery: '', operationName: 'test operation name', - setup, + config, + apmEventClient, serviceName: 'test service name', start: 1633456140000, end: 1633457078105, diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts index 08f0cf52d00c0..cb97295bbca01 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts @@ -10,7 +10,6 @@ import { euiLightVars as theme } from '@kbn/ui-theme'; import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { isFiniteNumber } from '../../../../../../common/utils/is_finite_number'; -import { Setup } from '../../../../../lib/helpers/setup_request'; import { getMetricsDateHistogramParams } from '../../../../../lib/helpers/metrics'; import { ChartBase } from '../../../types'; @@ -28,11 +27,14 @@ import { environmentQuery, serviceNodeNameQuery, } from '../../../../../../common/utils/environment_query'; +import { APMConfig } from '../../../../..'; +import { APMEventClient } from '../../../../../lib/helpers/create_es_client/create_apm_event_client'; export async function fetchAndTransformGcMetrics({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, chartBase, @@ -43,7 +45,8 @@ export async function fetchAndTransformGcMetrics({ }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; start: number; @@ -52,8 +55,6 @@ export async function fetchAndTransformGcMetrics({ fieldName: typeof METRIC_JAVA_GC_COUNT | typeof METRIC_JAVA_GC_TIME; operationName: string; }) { - const { apmEventClient, config } = setup; - const { bucketSize } = getBucketSize({ start, end }); // GC rate and time are reported by the agents as monotonically diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/get_gc_rate_chart.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/get_gc_rate_chart.ts index 0476025594b26..6fac756ccef5f 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/get_gc_rate_chart.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/get_gc_rate_chart.ts @@ -8,9 +8,10 @@ import { euiLightVars as theme } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; import { METRIC_JAVA_GC_COUNT } from '../../../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../../../lib/helpers/setup_request'; import { fetchAndTransformGcMetrics } from './fetch_and_transform_gc_metrics'; import { ChartBase } from '../../../types'; +import { APMConfig } from '../../../../..'; +import { APMEventClient } from '../../../../../lib/helpers/create_es_client/create_apm_event_client'; const series = { [METRIC_JAVA_GC_COUNT]: { @@ -34,7 +35,8 @@ const chartBase: ChartBase = { function getGcRateChart({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, @@ -42,7 +44,8 @@ function getGcRateChart({ }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; start: number; @@ -51,7 +54,8 @@ function getGcRateChart({ return fetchAndTransformGcMetrics({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/get_gc_time_chart.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/get_gc_time_chart.ts index b1ef7b5e106f5..fed63945800da 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/get_gc_time_chart.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/get_gc_time_chart.ts @@ -8,9 +8,10 @@ import { euiLightVars as theme } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; import { METRIC_JAVA_GC_TIME } from '../../../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../../../lib/helpers/setup_request'; import { fetchAndTransformGcMetrics } from './fetch_and_transform_gc_metrics'; import { ChartBase } from '../../../types'; +import { APMEventClient } from '../../../../../lib/helpers/create_es_client/create_apm_event_client'; +import { APMConfig } from '../../../../..'; const series = { [METRIC_JAVA_GC_TIME]: { @@ -34,7 +35,8 @@ const chartBase: ChartBase = { function getGcTimeChart({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, @@ -42,7 +44,8 @@ function getGcTimeChart({ }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; start: number; @@ -51,7 +54,8 @@ function getGcTimeChart({ return fetchAndTransformGcMetrics({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/heap_memory/index.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/heap_memory/index.ts index d57dfb184ca88..86c0b0af26054 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/heap_memory/index.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/heap_memory/index.ts @@ -13,10 +13,11 @@ import { METRIC_JAVA_HEAP_MEMORY_USED, AGENT_NAME, } from '../../../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../../../lib/helpers/setup_request'; import { fetchAndTransformMetrics } from '../../../fetch_and_transform_metrics'; import { ChartBase } from '../../../types'; import { JAVA_AGENT_NAMES } from '../../../../../../common/agent_name'; +import { APMConfig } from '../../../../..'; +import { APMEventClient } from '../../../../../lib/helpers/create_es_client/create_apm_event_client'; const series = { heapMemoryUsed: { @@ -55,7 +56,8 @@ const chartBase: ChartBase = { export function getHeapMemoryChart({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, @@ -63,7 +65,8 @@ export function getHeapMemoryChart({ }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; start: number; @@ -72,7 +75,8 @@ export function getHeapMemoryChart({ return fetchAndTransformMetrics({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/index.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/index.ts index 5250884ed5e44..558e37af1cffc 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/index.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/index.ts @@ -7,18 +7,20 @@ import { withApmSpan } from '../../../../utils/with_apm_span'; import { getHeapMemoryChart } from './heap_memory'; -import { Setup } from '../../../../lib/helpers/setup_request'; import { getNonHeapMemoryChart } from './non_heap_memory'; import { getThreadCountChart } from './thread_count'; import { getCPUChartData } from '../shared/cpu'; import { getMemoryChartData } from '../shared/memory'; import { getGcRateChart } from './gc/get_gc_rate_chart'; import { getGcTimeChart } from './gc/get_gc_time_chart'; +import { APMConfig } from '../../../..'; +import { APMEventClient } from '../../../../lib/helpers/create_es_client/create_apm_event_client'; export function getJavaMetricsCharts({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, @@ -26,7 +28,8 @@ export function getJavaMetricsCharts({ }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; start: number; @@ -36,7 +39,8 @@ export function getJavaMetricsCharts({ const options = { environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/non_heap_memory/index.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/non_heap_memory/index.ts index 379962d928e28..888af8d795afb 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/non_heap_memory/index.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/non_heap_memory/index.ts @@ -13,10 +13,11 @@ import { METRIC_JAVA_NON_HEAP_MEMORY_USED, AGENT_NAME, } from '../../../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../../../lib/helpers/setup_request'; import { ChartBase } from '../../../types'; import { fetchAndTransformMetrics } from '../../../fetch_and_transform_metrics'; import { JAVA_AGENT_NAMES } from '../../../../../../common/agent_name'; +import { APMConfig } from '../../../../..'; +import { APMEventClient } from '../../../../../lib/helpers/create_es_client/create_apm_event_client'; const series = { nonHeapMemoryUsed: { @@ -52,7 +53,8 @@ const chartBase: ChartBase = { export async function getNonHeapMemoryChart({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, @@ -60,7 +62,8 @@ export async function getNonHeapMemoryChart({ }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; start: number; @@ -69,7 +72,8 @@ export async function getNonHeapMemoryChart({ return fetchAndTransformMetrics({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/thread_count/index.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/thread_count/index.ts index b9a49acb3d16e..74daa14438a15 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/thread_count/index.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/thread_count/index.ts @@ -11,10 +11,11 @@ import { METRIC_JAVA_THREAD_COUNT, AGENT_NAME, } from '../../../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../../../lib/helpers/setup_request'; import { ChartBase } from '../../../types'; import { fetchAndTransformMetrics } from '../../../fetch_and_transform_metrics'; import { JAVA_AGENT_NAMES } from '../../../../../../common/agent_name'; +import { APMConfig } from '../../../../..'; +import { APMEventClient } from '../../../../../lib/helpers/create_es_client/create_apm_event_client'; const series = { threadCount: { @@ -44,7 +45,8 @@ const chartBase: ChartBase = { export async function getThreadCountChart({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, @@ -52,7 +54,8 @@ export async function getThreadCountChart({ }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; start: number; @@ -61,7 +64,8 @@ export async function getThreadCountChart({ return fetchAndTransformMetrics({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/active_instances.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/active_instances.ts deleted file mode 100644 index 02cbfc3b5704c..0000000000000 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/active_instances.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; -import { euiLightVars as theme } from '@kbn/ui-theme'; -import { - SERVICE_NAME, - SERVICE_NODE_NAME, -} from '../../../../../common/elasticsearch_fieldnames'; -import { environmentQuery } from '../../../../../common/utils/environment_query'; -import { getMetricsDateHistogramParams } from '../../../../lib/helpers/metrics'; -import { Setup } from '../../../../lib/helpers/setup_request'; -import { - getDocumentTypeFilterForTransactions, - getProcessorEventForTransactions, -} from '../../../../lib/helpers/transactions'; -import { GenericMetricsChart } from '../../fetch_and_transform_metrics'; - -export async function getActiveInstances({ - environment, - kuery, - setup, - serviceName, - start, - end, - searchAggregatedTransactions, -}: { - environment: string; - kuery: string; - setup: Setup; - serviceName: string; - start: number; - end: number; - searchAggregatedTransactions: boolean; -}): Promise<GenericMetricsChart> { - const { apmEventClient, config } = setup; - - const aggs = { - activeInstances: { - cardinality: { - field: SERVICE_NODE_NAME, - }, - }, - }; - - const params = { - apm: { - events: [getProcessorEventForTransactions(searchAggregatedTransactions)], - }, - body: { - track_total_hits: false, - size: 0, - query: { - bool: { - filter: [ - { term: { [SERVICE_NAME]: serviceName } }, - ...rangeQuery(start, end), - ...environmentQuery(environment), - ...kqlQuery(kuery), - ...getDocumentTypeFilterForTransactions( - searchAggregatedTransactions - ), - ], - }, - }, - aggs: { - ...aggs, - timeseriesData: { - date_histogram: getMetricsDateHistogramParams({ - start, - end, - metricsInterval: config.metricsInterval, - }), - aggs, - }, - }, - }, - }; - - const { aggregations } = await apmEventClient.search( - 'get_active_instances', - params - ); - - return { - title: i18n.translate('xpack.apm.agentMetrics.serverless.activeInstances', { - defaultMessage: 'Active instances', - }), - key: 'active_instances', - yUnit: 'integer', - description: i18n.translate( - 'xpack.apm.agentMetrics.serverless.activeInstances.description', - { - defaultMessage: - 'This chart shows the number of active instances of your serverless function over time. Multiple active instances may be a result of provisioned concurrency for your function or an increase in concurrent load that scales your function on-demand. An increase in active instance can be an indicator for an increase in concurrent invocations.', - } - ), - series: [ - { - title: i18n.translate( - 'xpack.apm.agentMetrics.serverless.series.activeInstances', - { defaultMessage: 'Active instances' } - ), - key: 'active_instances', - type: 'bar', - color: theme.euiColorVis1, - overallValue: aggregations?.activeInstances.value ?? 0, - data: - aggregations?.timeseriesData.buckets.map((timeseriesBucket) => ({ - x: timeseriesBucket.key, - y: timeseriesBucket.activeInstances.value, - })) || [], - }, - ], - }; -} diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/cold_start_count.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/cold_start_count.ts deleted file mode 100644 index d884aa8dce446..0000000000000 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/cold_start_count.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { termQuery } from '@kbn/observability-plugin/server'; -import { euiLightVars as theme } from '@kbn/ui-theme'; -import { - FAAS_COLDSTART, - METRICSET_NAME, -} from '../../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../../lib/helpers/setup_request'; -import { fetchAndTransformMetrics } from '../../fetch_and_transform_metrics'; -import { ChartBase } from '../../types'; - -const chartBase: ChartBase = { - title: i18n.translate('xpack.apm.agentMetrics.serverless.coldStart', { - defaultMessage: 'Cold start', - }), - key: 'cold_start_count', - type: 'bar', - yUnit: 'integer', - series: { - coldStart: { - title: i18n.translate('xpack.apm.agentMetrics.serverless.coldStart', { - defaultMessage: 'Cold start', - }), - color: theme.euiColorVis5, - }, - }, -}; - -export function getColdStartCount({ - environment, - kuery, - setup, - serviceName, - start, - end, -}: { - environment: string; - kuery: string; - setup: Setup; - serviceName: string; - start: number; - end: number; -}) { - return fetchAndTransformMetrics({ - environment, - kuery, - setup, - serviceName, - start, - end, - chartBase, - aggs: { coldStart: { sum: { field: FAAS_COLDSTART } } }, - additionalFilters: [ - ...termQuery(FAAS_COLDSTART, true), - ...termQuery(METRICSET_NAME, 'transaction'), - ], - operationName: 'get_cold_start_count', - }); -} diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/cold_start_duration.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/cold_start_duration.ts deleted file mode 100644 index 5a78f5d97d5e8..0000000000000 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/cold_start_duration.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { euiLightVars as theme } from '@kbn/ui-theme'; -import { FAAS_COLDSTART_DURATION } from '../../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../../lib/helpers/setup_request'; -import { fetchAndTransformMetrics } from '../../fetch_and_transform_metrics'; -import { ChartBase } from '../../types'; -import { isFiniteNumber } from '../../../../../common/utils/is_finite_number'; - -const chartBase: ChartBase = { - title: i18n.translate('xpack.apm.agentMetrics.serverless.coldStartDuration', { - defaultMessage: 'Cold start duration', - }), - key: 'cold_start_duration', - type: 'linemark', - yUnit: 'time', - series: { - coldStart: { - title: i18n.translate( - 'xpack.apm.agentMetrics.serverless.coldStartDuration', - { defaultMessage: 'Cold start duration' } - ), - color: theme.euiColorVis5, - }, - }, - description: i18n.translate( - 'xpack.apm.agentMetrics.serverless.coldStartDuration.description', - { - defaultMessage: - 'Cold start duration shows the execution duration of the serverless runtime for requests that experience cold starts.', - } - ), -}; - -export async function getColdStartDuration({ - environment, - kuery, - setup, - serviceName, - start, - end, -}: { - environment: string; - kuery: string; - setup: Setup; - serviceName: string; - start: number; - end: number; -}) { - const coldStartDurationMetric = await fetchAndTransformMetrics({ - environment, - kuery, - setup, - serviceName, - start, - end, - chartBase, - aggs: { coldStart: { avg: { field: FAAS_COLDSTART_DURATION } } }, - additionalFilters: [{ exists: { field: FAAS_COLDSTART_DURATION } }], - operationName: 'get_cold_start_duration', - }); - - const [series] = coldStartDurationMetric.series; - - const data = series.data.map(({ x, y }) => ({ - x, - // Cold start duration duration is stored in ms, convert it to microseconds so it uses the same unit as the other charts - y: isFiniteNumber(y) ? y * 1000 : y, - })); - - return { - ...coldStartDurationMetric, - series: [ - { - ...series, - // Cold start duration duration is stored in ms, convert it to microseconds - overallValue: series.overallValue * 1000, - data, - }, - ], - }; -} diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/compute_usage.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/compute_usage.ts deleted file mode 100644 index bb8d5023c9af2..0000000000000 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/compute_usage.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 { i18n } from '@kbn/i18n'; -import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { - kqlQuery, - rangeQuery, - termQuery, -} from '@kbn/observability-plugin/server'; -import { euiLightVars as theme } from '@kbn/ui-theme'; -import { - FAAS_BILLED_DURATION, - METRICSET_NAME, - METRIC_SYSTEM_TOTAL_MEMORY, - SERVICE_NAME, -} from '../../../../../common/elasticsearch_fieldnames'; -import { environmentQuery } from '../../../../../common/utils/environment_query'; -import { isFiniteNumber } from '../../../../../common/utils/is_finite_number'; -import { getMetricsDateHistogramParams } from '../../../../lib/helpers/metrics'; -import { Setup } from '../../../../lib/helpers/setup_request'; -import { GenericMetricsChart } from '../../fetch_and_transform_metrics'; - -/** - * To calculate the compute usage we need to multiply the "system.memory.total" by "faas.billed_duration". - * But the result of this calculation is in Bytes-milliseconds, as the "system.memory.total" is stored in bytes and the "faas.billed_duration" is stored in milliseconds. - * But to calculate the overall cost AWS uses GB-second, so we need to convert the result to this unit. - */ -const GB = 1024 ** 3; -function calculateComputeUsageGBSeconds({ - faasBilledDuration, - totalMemory, -}: { - faasBilledDuration?: number | null; - totalMemory?: number | null; -}) { - if (!isFiniteNumber(faasBilledDuration) || !isFiniteNumber(totalMemory)) { - return 0; - } - - const totalMemoryGB = totalMemory / GB; - const faasBilledDurationSec = faasBilledDuration / 1000; - return totalMemoryGB * faasBilledDurationSec; -} - -export async function getComputeUsage({ - environment, - kuery, - setup, - serviceName, - start, - end, -}: { - environment: string; - kuery: string; - setup: Setup; - serviceName: string; - start: number; - end: number; -}): Promise<GenericMetricsChart> { - const { apmEventClient, config } = setup; - - const aggs = { - avgFaasBilledDuration: { avg: { field: FAAS_BILLED_DURATION } }, - avgTotalMemory: { avg: { field: METRIC_SYSTEM_TOTAL_MEMORY } }, - }; - - const params = { - apm: { - events: [ProcessorEvent.metric], - }, - body: { - track_total_hits: false, - size: 0, - query: { - bool: { - filter: [ - { term: { [SERVICE_NAME]: serviceName } }, - ...rangeQuery(start, end), - ...environmentQuery(environment), - ...kqlQuery(kuery), - { exists: { field: FAAS_BILLED_DURATION } }, - ...termQuery(METRICSET_NAME, 'app'), - ], - }, - }, - aggs: { - timeseriesData: { - date_histogram: getMetricsDateHistogramParams({ - start, - end, - metricsInterval: config.metricsInterval, - }), - aggs, - }, - ...aggs, - }, - }, - }; - - const { aggregations } = await apmEventClient.search( - 'get_compute_usage', - params - ); - const timeseriesData = aggregations?.timeseriesData; - - return { - title: i18n.translate('xpack.apm.agentMetrics.serverless.computeUsage', { - defaultMessage: 'Compute usage', - }), - key: 'compute_usage', - yUnit: 'number', - description: i18n.translate( - 'xpack.apm.agentMetrics.serverless.computeUsage.description', - { - defaultMessage: - "Compute usage (in GB-seconds) is the execution time multiplied by the available memory size of your function's instances. The compute usage is a direct indicator for the costs of your serverless function.", - } - ), - series: - !timeseriesData || timeseriesData.buckets.length === 0 - ? [] - : [ - { - title: i18n.translate( - 'xpack.apm.agentMetrics.serverless.computeUsage', - { defaultMessage: 'Compute usage' } - ), - key: 'compute_usage', - type: 'bar', - overallValue: calculateComputeUsageGBSeconds({ - faasBilledDuration: aggregations?.avgFaasBilledDuration.value, - totalMemory: aggregations?.avgTotalMemory.value, - }), - color: theme.euiColorVis0, - data: timeseriesData.buckets.map((bucket) => { - const computeUsage = calculateComputeUsageGBSeconds({ - faasBilledDuration: bucket.avgFaasBilledDuration.value, - totalMemory: bucket.avgTotalMemory.value, - }); - return { - x: bucket.key, - y: computeUsage, - }; - }), - }, - ], - }; -} diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/index.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/index.ts deleted file mode 100644 index 5635dd5c0e50b..0000000000000 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/index.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { withApmSpan } from '../../../../utils/with_apm_span'; -import { Setup } from '../../../../lib/helpers/setup_request'; -import { getServerlessFunctionLatency } from './serverless_function_latency'; -import { getColdStartDuration } from './cold_start_duration'; -import { getMemoryChartData } from '../shared/memory'; -import { getComputeUsage } from './compute_usage'; -import { getActiveInstances } from './active_instances'; -import { getColdStartCount } from './cold_start_count'; -import { getSearchTransactionsEvents } from '../../../../lib/helpers/transactions'; - -export function getServerlessAgentMetricCharts({ - environment, - kuery, - setup, - serviceName, - start, - end, -}: { - environment: string; - kuery: string; - setup: Setup; - serviceName: string; - start: number; - end: number; -}) { - return withApmSpan('get_serverless_agent_metric_charts', async () => { - const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, - kuery, - start, - end, - }); - - const options = { - environment, - kuery, - setup, - serviceName, - start, - end, - }; - return await Promise.all([ - getServerlessFunctionLatency({ - ...options, - searchAggregatedTransactions, - }), - getMemoryChartData(options), - getColdStartDuration(options), - getColdStartCount(options), - getComputeUsage(options), - getActiveInstances({ ...options, searchAggregatedTransactions }), - ]); - }); -} diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/serverless_function_latency.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/serverless_function_latency.ts deleted file mode 100644 index 0a27c66ef036b..0000000000000 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/serverless/serverless_function_latency.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { euiLightVars as theme } from '@kbn/ui-theme'; -import { FAAS_BILLED_DURATION } from '../../../../../common/elasticsearch_fieldnames'; -import { LatencyAggregationType } from '../../../../../common/latency_aggregation_types'; -import { isFiniteNumber } from '../../../../../common/utils/is_finite_number'; -import { getVizColorForIndex } from '../../../../../common/viz_colors'; -import { Setup } from '../../../../lib/helpers/setup_request'; -import { getLatencyTimeseries } from '../../../transactions/get_latency_charts'; -import { - fetchAndTransformMetrics, - GenericMetricsChart, -} from '../../fetch_and_transform_metrics'; -import { ChartBase } from '../../types'; - -const billedDurationAvg = { - title: i18n.translate('xpack.apm.agentMetrics.serverless.billedDurationAvg', { - defaultMessage: 'Billed Duration', - }), -}; - -const chartBase: ChartBase = { - title: i18n.translate('xpack.apm.agentMetrics.serverless.avgDuration', { - defaultMessage: 'Avg. Duration', - }), - key: 'avg_duration', - type: 'linemark', - yUnit: 'time', - series: {}, - description: i18n.translate( - 'xpack.apm.agentMetrics.serverless.avgDuration.description', - { - defaultMessage: - 'Transaction duration is the time spent processing and responding to a request. If the request is queued it will not be contribute to the transaction duration but will contribute the overall billed duration', - } - ), -}; - -async function getServerlessLantecySeries({ - environment, - kuery, - setup, - serviceName, - start, - end, - searchAggregatedTransactions, -}: { - environment: string; - kuery: string; - setup: Setup; - serviceName: string; - start: number; - end: number; - searchAggregatedTransactions: boolean; -}): Promise<GenericMetricsChart['series']> { - const transactionLatency = await getLatencyTimeseries({ - environment, - kuery, - serviceName, - setup, - searchAggregatedTransactions, - latencyAggregationType: LatencyAggregationType.avg, - start, - end, - }); - - return [ - { - title: i18n.translate( - 'xpack.apm.agentMetrics.serverless.transactionDuration', - { defaultMessage: 'Transaction Duration' } - ), - key: 'transaction_duration', - type: 'linemark', - color: getVizColorForIndex(1, theme), - overallValue: transactionLatency.overallAvgDuration ?? 0, - data: transactionLatency.latencyTimeseries, - }, - ]; -} - -export async function getServerlessFunctionLatency({ - environment, - kuery, - setup, - serviceName, - start, - end, - searchAggregatedTransactions, -}: { - environment: string; - kuery: string; - setup: Setup; - serviceName: string; - start: number; - end: number; - searchAggregatedTransactions: boolean; -}): Promise<GenericMetricsChart> { - const options = { - environment, - kuery, - setup, - serviceName, - start, - end, - }; - - const [billedDurationMetrics, serverlessDurationSeries] = await Promise.all([ - fetchAndTransformMetrics({ - ...options, - chartBase: { ...chartBase, series: { billedDurationAvg } }, - aggs: { - billedDurationAvg: { avg: { field: FAAS_BILLED_DURATION } }, - }, - additionalFilters: [{ exists: { field: FAAS_BILLED_DURATION } }], - operationName: 'get_billed_duration', - }), - getServerlessLantecySeries({ ...options, searchAggregatedTransactions }), - ]); - - const [series] = billedDurationMetrics.series; - const data = series.data.map(({ x, y }) => ({ - x, - // Billed duration is stored in ms, convert it to microseconds so it uses the same unit as the other chart - y: isFiniteNumber(y) ? y * 1000 : y, - })); - - return { - ...billedDurationMetrics, - series: [ - { - ...series, - // Billed duration is stored in ms, convert it to microseconds - overallValue: series.overallValue * 1000, - data, - }, - ...serverlessDurationSeries, - ], - }; -} diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/shared/cpu/index.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/shared/cpu/index.ts index d09b35e25e396..7da8e16bc28cc 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/shared/cpu/index.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/shared/cpu/index.ts @@ -11,9 +11,10 @@ import { METRIC_SYSTEM_CPU_PERCENT, METRIC_PROCESS_CPU_PERCENT, } from '../../../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../../../lib/helpers/setup_request'; import { ChartBase } from '../../../types'; import { fetchAndTransformMetrics } from '../../../fetch_and_transform_metrics'; +import { APMConfig } from '../../../../..'; +import { APMEventClient } from '../../../../../lib/helpers/create_es_client/create_apm_event_client'; const series = { systemCPUMax: { @@ -55,7 +56,8 @@ const chartBase: ChartBase = { export function getCPUChartData({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, @@ -63,7 +65,8 @@ export function getCPUChartData({ }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; start: number; @@ -72,7 +75,8 @@ export function getCPUChartData({ return fetchAndTransformMetrics({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/shared/memory/index.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/shared/memory/index.ts index a7e41ea71b725..c4aa4f82fe558 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/shared/memory/index.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/shared/memory/index.ts @@ -15,9 +15,10 @@ import { METRIC_SYSTEM_FREE_MEMORY, METRIC_SYSTEM_TOTAL_MEMORY, } from '../../../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../../../lib/helpers/setup_request'; import { fetchAndTransformMetrics } from '../../../fetch_and_transform_metrics'; import { ChartBase } from '../../../types'; +import { APMConfig } from '../../../../..'; +import { APMEventClient } from '../../../../../lib/helpers/create_es_client/create_apm_event_client'; const series = { memoryUsedMax: { @@ -83,19 +84,21 @@ export const percentCgroupMemoryUsedScript = { export async function getMemoryChartData({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, - faasId, + serverlessId, start, end, }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; - faasId?: string; + serverlessId?: string; start: number; end: number; }) { @@ -103,7 +106,8 @@ export async function getMemoryChartData({ const cgroupResponse = await fetchAndTransformMetrics({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, @@ -115,7 +119,7 @@ export async function getMemoryChartData({ }, additionalFilters: [ { exists: { field: METRIC_CGROUP_MEMORY_USAGE_BYTES } }, - ...termQuery(FAAS_ID, faasId), + ...termQuery(FAAS_ID, serverlessId), ], operationName: 'get_cgroup_memory_metrics_charts', }); @@ -124,7 +128,8 @@ export async function getMemoryChartData({ return await fetchAndTransformMetrics({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, @@ -137,7 +142,7 @@ export async function getMemoryChartData({ additionalFilters: [ { exists: { field: METRIC_SYSTEM_FREE_MEMORY } }, { exists: { field: METRIC_SYSTEM_TOTAL_MEMORY } }, - ...termQuery(FAAS_ID, faasId), + ...termQuery(FAAS_ID, serverlessId), ], operationName: 'get_system_memory_metrics_charts', }); diff --git a/x-pack/plugins/apm/server/routes/metrics/fetch_and_transform_metrics.ts b/x-pack/plugins/apm/server/routes/metrics/fetch_and_transform_metrics.ts index 31ca4f54d932d..c23950b311e24 100644 --- a/x-pack/plugins/apm/server/routes/metrics/fetch_and_transform_metrics.ts +++ b/x-pack/plugins/apm/server/routes/metrics/fetch_and_transform_metrics.ts @@ -12,9 +12,11 @@ import type { AggregationOptionsByType } from '@kbn/es-types'; import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getVizColorForIndex } from '../../../common/viz_colors'; -import { APMEventESSearchRequest } from '../../lib/helpers/create_es_client/create_apm_event_client'; +import { + APMEventClient, + APMEventESSearchRequest, +} from '../../lib/helpers/create_es_client/create_apm_event_client'; import { getMetricsDateHistogramParams } from '../../lib/helpers/metrics'; -import { Setup } from '../../lib/helpers/setup_request'; import { ChartBase } from './types'; import { environmentQuery, @@ -22,6 +24,7 @@ import { } from '../../../common/utils/environment_query'; import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames'; import { ChartType, Coordinate, YUnit } from '../../../typings/timeseries'; +import { APMConfig } from '../..'; type MetricsAggregationMap = Unionize<{ min: AggregationOptionsByType['min']; @@ -63,7 +66,8 @@ export interface FetchAndTransformMetrics { export async function fetchAndTransformMetrics<T extends MetricAggs>({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, start, @@ -75,7 +79,8 @@ export async function fetchAndTransformMetrics<T extends MetricAggs>({ }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; start: number; @@ -85,8 +90,6 @@ export async function fetchAndTransformMetrics<T extends MetricAggs>({ additionalFilters?: QueryDslQueryContainer[]; operationName: string; }): Promise<FetchAndTransformMetrics> { - const { apmEventClient, config } = setup; - const params: GenericMetricsRequest = { apm: { events: [ProcessorEvent.metric], diff --git a/x-pack/plugins/apm/server/routes/metrics/get_metrics_chart_data_by_agent.ts b/x-pack/plugins/apm/server/routes/metrics/get_metrics_chart_data_by_agent.ts index b5ae2bbe093ae..afe1e6e919a26 100644 --- a/x-pack/plugins/apm/server/routes/metrics/get_metrics_chart_data_by_agent.ts +++ b/x-pack/plugins/apm/server/routes/metrics/get_metrics_chart_data_by_agent.ts @@ -5,54 +5,50 @@ * 2.0. */ -import { Setup } from '../../lib/helpers/setup_request'; import { getJavaMetricsCharts } from './by_agent/java'; import { getDefaultMetricsCharts } from './by_agent/default'; -import { isJavaAgentName, isServerlessAgent } from '../../../common/agent_name'; +import { isJavaAgentName } from '../../../common/agent_name'; import { GenericMetricsChart } from './fetch_and_transform_metrics'; -import { getServerlessAgentMetricCharts } from './by_agent/serverless'; +import { APMConfig } from '../..'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getMetricsChartDataByAgent({ environment, kuery, - setup, + config, + apmEventClient, serviceName, serviceNodeName, agentName, start, end, - serviceRuntimeName, }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; serviceNodeName?: string; agentName: string; start: number; end: number; - serviceRuntimeName?: string; }): Promise<GenericMetricsChart[]> { const options = { environment, kuery, - setup, + config, + apmEventClient, serviceName, start, end, }; - const serverlessAgent = isServerlessAgent(serviceRuntimeName); - if (isJavaAgentName(agentName) && !serverlessAgent) { + if (isJavaAgentName(agentName)) { return getJavaMetricsCharts({ ...options, serviceNodeName, }); } - if (serverlessAgent) { - return getServerlessAgentMetricCharts(options); - } - return getDefaultMetricsCharts(options); } diff --git a/x-pack/plugins/apm/server/routes/metrics/get_service_nodes.ts b/x-pack/plugins/apm/server/routes/metrics/get_service_nodes.ts index e22ae93b25d53..2dd719717be00 100644 --- a/x-pack/plugins/apm/server/routes/metrics/get_service_nodes.ts +++ b/x-pack/plugins/apm/server/routes/metrics/get_service_nodes.ts @@ -21,25 +21,23 @@ import { SERVICE_NODE_NAME, } from '../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../common/utils/environment_query'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; const getServiceNodes = async ({ kuery, - setup, + apmEventClient, serviceName, environment, start, end, }: { kuery: string; - setup: Setup; + apmEventClient: APMEventClient; serviceName: string; environment: string; start: number; end: number; }) => { - const { apmEventClient } = setup; - const params = { apm: { events: [ProcessorEvent.metric], diff --git a/x-pack/plugins/apm/server/routes/metrics/queries.test.ts b/x-pack/plugins/apm/server/routes/metrics/queries.test.ts index af36a030157c0..015cde00ece3e 100644 --- a/x-pack/plugins/apm/server/routes/metrics/queries.test.ts +++ b/x-pack/plugins/apm/server/routes/metrics/queries.test.ts @@ -22,9 +22,10 @@ describe('metrics queries', () => { const createTests = (serviceNodeName?: string) => { it('fetches cpu chart data', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient, mockConfig }) => getCPUChartData({ - setup, + config: mockConfig, + apmEventClient: mockApmEventClient, serviceName: 'foo', serviceNodeName, environment: ENVIRONMENT_ALL.value, @@ -38,9 +39,10 @@ describe('metrics queries', () => { }); it('fetches memory chart data', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient, mockConfig }) => getMemoryChartData({ - setup, + config: mockConfig, + apmEventClient: mockApmEventClient, serviceName: 'foo', serviceNodeName, environment: ENVIRONMENT_ALL.value, @@ -54,9 +56,10 @@ describe('metrics queries', () => { }); it('fetches heap memory chart data', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient, mockConfig }) => getHeapMemoryChart({ - setup, + config: mockConfig, + apmEventClient: mockApmEventClient, serviceName: 'foo', serviceNodeName, environment: ENVIRONMENT_ALL.value, @@ -70,9 +73,10 @@ describe('metrics queries', () => { }); it('fetches non heap memory chart data', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient, mockConfig }) => getNonHeapMemoryChart({ - setup, + config: mockConfig, + apmEventClient: mockApmEventClient, serviceName: 'foo', serviceNodeName, environment: ENVIRONMENT_ALL.value, @@ -86,9 +90,10 @@ describe('metrics queries', () => { }); it('fetches thread count chart data', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient, mockConfig }) => getThreadCountChart({ - setup, + config: mockConfig, + apmEventClient: mockApmEventClient, serviceName: 'foo', serviceNodeName, environment: ENVIRONMENT_ALL.value, diff --git a/x-pack/plugins/apm/server/routes/metrics/route.ts b/x-pack/plugins/apm/server/routes/metrics/route.ts index 8aea9cc5a981c..c8fb71c3455f9 100644 --- a/x-pack/plugins/apm/server/routes/metrics/route.ts +++ b/x-pack/plugins/apm/server/routes/metrics/route.ts @@ -6,12 +6,13 @@ */ import * as t from 'io-ts'; -import { setupRequest } from '../../lib/helpers/setup_request'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { FetchAndTransformMetrics } from './fetch_and_transform_metrics'; import { getMetricsChartDataByAgent } from './get_metrics_chart_data_by_agent'; import { getServiceNodes } from './get_service_nodes'; +import { metricsServerlessRouteRepository } from './serverless/route'; const metricsChartsRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/services/{serviceName}/metrics/charts', @@ -25,7 +26,6 @@ const metricsChartsRoute = createApmServerRoute({ }), t.partial({ serviceNodeName: t.string, - serviceRuntimeName: t.string, }), environmentRt, kueryRt, @@ -38,29 +38,22 @@ const metricsChartsRoute = createApmServerRoute({ ): Promise<{ charts: FetchAndTransformMetrics[]; }> => { - const { params } = resources; - const setup = await setupRequest(resources); + const { params, config } = resources; + const apmEventClient = await getApmEventClient(resources); const { serviceName } = params.path; - const { - agentName, - environment, - kuery, - serviceNodeName, - start, - end, - serviceRuntimeName, - } = params.query; + const { agentName, environment, kuery, serviceNodeName, start, end } = + params.query; const charts = await getMetricsChartDataByAgent({ environment, kuery, - setup, + config, + apmEventClient, serviceName, agentName, serviceNodeName, start, end, - serviceRuntimeName, }); return { charts }; @@ -88,14 +81,14 @@ const serviceMetricsJvm = createApmServerRoute({ threadCount: number | null; }>; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { serviceName } = params.path; const { kuery, environment, start, end } = params.query; const serviceNodes = await getServiceNodes({ kuery, - setup, + apmEventClient, serviceName, environment, start, @@ -108,4 +101,5 @@ const serviceMetricsJvm = createApmServerRoute({ export const metricsRouteRepository = { ...metricsChartsRoute, ...serviceMetricsJvm, + ...metricsServerlessRouteRepository, }; diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/get_active_instances_overview.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/get_active_instances_overview.ts new file mode 100644 index 0000000000000..5361070e50c8d --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/get_active_instances_overview.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 { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { + kqlQuery, + rangeQuery, + termQuery, +} from '@kbn/observability-plugin/server'; +import { + FAAS_BILLED_DURATION, + FAAS_DURATION, + FAAS_ID, + METRICSET_NAME, + METRIC_SYSTEM_FREE_MEMORY, + METRIC_SYSTEM_TOTAL_MEMORY, + SERVICE_NAME, + SERVICE_NODE_NAME, +} from '../../../../common/elasticsearch_fieldnames'; +import { getServerlessFunctionNameFromId } from '../../../../common/serverless'; +import { environmentQuery } from '../../../../common/utils/environment_query'; +import { Coordinate } from '../../../../typings/timeseries'; +import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; +import { calcMemoryUsed } from './helper'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; + +interface ActiveInstanceTimeseries { + serverlessDuration: Coordinate[]; + billedDuration: Coordinate[]; +} + +export interface ActiveInstanceOverview { + activeInstanceName: string; + serverlessId: string; + serverlessFunctionName: string; + timeseries: ActiveInstanceTimeseries; + serverlessDurationAvg: number | null; + billedDurationAvg: number | null; + avgMemoryUsed?: number | null; + memorySize: number | null; +} + +export async function getServerlessActiveInstancesOverview({ + end, + environment, + kuery, + serviceName, + start, + serverlessId, + apmEventClient, +}: { + environment: string; + kuery: string; + serviceName: string; + start: number; + end: number; + serverlessId?: string; + apmEventClient: APMEventClient; +}) { + const { intervalString } = getBucketSize({ + start, + end, + numBuckets: 20, + }); + + const aggs = { + faasDurationAvg: { avg: { field: FAAS_DURATION } }, + faasBilledDurationAvg: { avg: { field: FAAS_BILLED_DURATION } }, + }; + + const params = { + apm: { + events: [ProcessorEvent.metric], + }, + body: { + track_total_hits: 1, + size: 0, + query: { + bool: { + filter: [ + ...termQuery(METRICSET_NAME, 'app'), + { term: { [SERVICE_NAME]: serviceName } }, + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...kqlQuery(kuery), + ...termQuery(FAAS_ID, serverlessId), + ], + }, + }, + aggs: { + activeInstances: { + terms: { field: SERVICE_NODE_NAME }, + aggs: { + serverlessFunctions: { + terms: { field: FAAS_ID }, + aggs: { + ...{ + ...aggs, + maxTotalMemory: { + max: { field: METRIC_SYSTEM_TOTAL_MEMORY }, + }, + avgTotalMemory: { + avg: { field: METRIC_SYSTEM_TOTAL_MEMORY }, + }, + avgFreeMemory: { avg: { field: METRIC_SYSTEM_FREE_MEMORY } }, + }, + timeseries: { + date_histogram: { + field: '@timestamp', + fixed_interval: intervalString, + min_doc_count: 0, + extended_bounds: { + min: start, + max: end, + }, + }, + aggs, + }, + }, + }, + }, + }, + }, + }, + }; + + const response = await apmEventClient.search( + 'ger_serverless_active_instances_overview', + params + ); + + return ( + response.aggregations?.activeInstances?.buckets?.flatMap((bucket) => { + const activeInstanceName = bucket.key as string; + const serverlessFunctionsDetails = + bucket.serverlessFunctions.buckets.reduce<ActiveInstanceOverview[]>( + (acc, curr) => { + const currentServerlessId = curr.key as string; + + const timeseries = + curr.timeseries.buckets.reduce<ActiveInstanceTimeseries>( + (timeseriesAcc, timeseriesCurr) => { + return { + serverlessDuration: [ + ...timeseriesAcc.serverlessDuration, + { + x: timeseriesCurr.key, + y: timeseriesCurr.faasDurationAvg.value, + }, + ], + billedDuration: [ + ...timeseriesAcc.billedDuration, + { + x: timeseriesCurr.key, + y: timeseriesCurr.faasBilledDurationAvg.value, + }, + ], + }; + }, + { + serverlessDuration: [], + billedDuration: [], + } + ); + return [ + ...acc, + { + activeInstanceName, + serverlessId: currentServerlessId, + serverlessFunctionName: + getServerlessFunctionNameFromId(currentServerlessId), + timeseries, + serverlessDurationAvg: curr.faasDurationAvg.value, + billedDurationAvg: curr.faasBilledDurationAvg.value, + avgMemoryUsed: calcMemoryUsed({ + memoryFree: curr.avgFreeMemory.value, + memoryTotal: curr.avgTotalMemory.value, + }), + memorySize: curr.avgTotalMemory.value, + }, + ]; + }, + [] + ); + return serverlessFunctionsDetails; + }) || [] + ); +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/get_active_instances_timeseries.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/get_active_instances_timeseries.ts new file mode 100644 index 0000000000000..facd270aec728 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/get_active_instances_timeseries.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 { + kqlQuery, + rangeQuery, + termQuery, +} from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { + FAAS_ID, + METRICSET_NAME, + SERVICE_NAME, + SERVICE_NODE_NAME, +} from '../../../../common/elasticsearch_fieldnames'; +import { environmentQuery } from '../../../../common/utils/environment_query'; +import { Coordinate } from '../../../../typings/timeseries'; +import { getMetricsDateHistogramParams } from '../../../lib/helpers/metrics'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; +import { APMConfig } from '../../..'; + +export async function getActiveInstancesTimeseries({ + environment, + kuery, + serviceName, + start, + end, + serverlessId, + config, + apmEventClient, +}: { + environment: string; + kuery: string; + serviceName: string; + start: number; + end: number; + serverlessId?: string; + config: APMConfig; + apmEventClient: APMEventClient; +}): Promise<Coordinate[]> { + const aggs = { + activeInstances: { + cardinality: { + field: SERVICE_NODE_NAME, + }, + }, + }; + + const params = { + apm: { + events: [ProcessorEvent.metric], + }, + body: { + track_total_hits: false, + size: 0, + query: { + bool: { + filter: [ + ...termQuery(METRICSET_NAME, 'app'), + { term: { [SERVICE_NAME]: serviceName } }, + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...kqlQuery(kuery), + ...termQuery(FAAS_ID, serverlessId), + ], + }, + }, + aggs: { + ...aggs, + timeseriesData: { + date_histogram: getMetricsDateHistogramParams({ + start, + end, + metricsInterval: config.metricsInterval, + }), + aggs, + }, + }, + }, + }; + + const { aggregations } = await apmEventClient.search( + 'get_active_instances', + params + ); + + return ( + aggregations?.timeseriesData?.buckets?.map((timeseriesBucket) => ({ + x: timeseriesBucket.key, + y: timeseriesBucket.activeInstances.value, + })) || [] + ); +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/get_cold_start_count_chart.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/get_cold_start_count_chart.ts new file mode 100644 index 0000000000000..a56e6c4c8764c --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/get_cold_start_count_chart.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 { i18n } from '@kbn/i18n'; +import { termQuery } from '@kbn/observability-plugin/server'; +import { euiLightVars as theme } from '@kbn/ui-theme'; +import { APMConfig } from '../../..'; +import { + FAAS_COLDSTART, + FAAS_ID, + METRICSET_NAME, +} from '../../../../common/elasticsearch_fieldnames'; +import { fetchAndTransformMetrics } from '../fetch_and_transform_metrics'; +import { ChartBase } from '../types'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; + +const chartBase: ChartBase = { + title: i18n.translate('xpack.apm.agentMetrics.serverless.coldStart.title', { + defaultMessage: 'Cold starts', + }), + key: 'cold_start_count', + type: 'bar', + yUnit: 'integer', + series: { + coldStart: { + title: i18n.translate('xpack.apm.agentMetrics.serverless.coldStart', { + defaultMessage: 'Cold start', + }), + color: theme.euiColorVis5, + }, + }, +}; + +export function getColdStartCountChart({ + environment, + kuery, + config, + apmEventClient, + serviceName, + start, + end, + serverlessId, +}: { + environment: string; + kuery: string; + config: APMConfig; + apmEventClient: APMEventClient; + serviceName: string; + start: number; + end: number; + serverlessId?: string; +}) { + return fetchAndTransformMetrics({ + environment, + kuery, + config, + apmEventClient, + serviceName, + start, + end, + chartBase, + aggs: { coldStart: { sum: { field: FAAS_COLDSTART } } }, + additionalFilters: [ + ...termQuery(FAAS_COLDSTART, true), + ...termQuery(FAAS_ID, serverlessId), + ...termQuery(METRICSET_NAME, 'app'), + ], + operationName: 'get_cold_start_count', + }); +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/get_cold_start_duration_chart.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/get_cold_start_duration_chart.ts new file mode 100644 index 0000000000000..b1802edb5440b --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/get_cold_start_duration_chart.ts @@ -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 { i18n } from '@kbn/i18n'; +import { euiLightVars as theme } from '@kbn/ui-theme'; +import { termQuery } from '@kbn/observability-plugin/server'; +import { + FAAS_COLDSTART_DURATION, + FAAS_ID, + METRICSET_NAME, +} from '../../../../common/elasticsearch_fieldnames'; +import { fetchAndTransformMetrics } from '../fetch_and_transform_metrics'; +import { ChartBase } from '../types'; +import { isFiniteNumber } from '../../../../common/utils/is_finite_number'; +import { APMConfig } from '../../..'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; + +const chartBase: ChartBase = { + title: i18n.translate('xpack.apm.agentMetrics.serverless.coldStartDuration', { + defaultMessage: 'Cold start duration', + }), + key: 'cold_start_duration', + type: 'linemark', + yUnit: 'time', + series: { + coldStart: { + title: i18n.translate( + 'xpack.apm.agentMetrics.serverless.coldStartDuration', + { defaultMessage: 'Cold start duration' } + ), + color: theme.euiColorVis5, + }, + }, + description: i18n.translate( + 'xpack.apm.agentMetrics.serverless.coldStartDuration.description', + { + defaultMessage: + 'Cold start duration shows the execution duration of the serverless runtime for requests that experience cold starts.', + } + ), +}; + +export async function getColdStartDurationChart({ + environment, + kuery, + config, + apmEventClient, + serviceName, + start, + end, + serverlessId, +}: { + environment: string; + kuery: string; + config: APMConfig; + apmEventClient: APMEventClient; + serviceName: string; + start: number; + end: number; + serverlessId?: string; +}) { + const coldStartDurationMetric = await fetchAndTransformMetrics({ + environment, + kuery, + config, + apmEventClient, + serviceName, + start, + end, + chartBase, + aggs: { coldStart: { avg: { field: FAAS_COLDSTART_DURATION } } }, + additionalFilters: [ + { exists: { field: FAAS_COLDSTART_DURATION } }, + ...termQuery(FAAS_ID, serverlessId), + ...termQuery(METRICSET_NAME, 'app'), + ], + operationName: 'get_cold_start_duration', + }); + + const [series] = coldStartDurationMetric.series; + + const data = series?.data?.map(({ x, y }) => ({ + x, + // Cold start duration duration is stored in ms, convert it to microseconds so it uses the same unit as the other charts + y: isFiniteNumber(y) ? y * 1000 : y, + })); + + return { + ...coldStartDurationMetric, + series: series + ? [ + { + ...series, + // Cold start duration duration is stored in ms, convert it to microseconds + overallValue: series.overallValue * 1000, + data, + }, + ] + : [], + }; +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/get_compute_usage_chart.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/get_compute_usage_chart.ts new file mode 100644 index 0000000000000..1c08588d9ec64 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/get_compute_usage_chart.ts @@ -0,0 +1,141 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { + kqlQuery, + rangeQuery, + termQuery, +} from '@kbn/observability-plugin/server'; +import { euiLightVars as theme } from '@kbn/ui-theme'; +import { APMConfig } from '../../..'; +import { + FAAS_BILLED_DURATION, + FAAS_ID, + METRICSET_NAME, + METRIC_SYSTEM_TOTAL_MEMORY, + SERVICE_NAME, +} from '../../../../common/elasticsearch_fieldnames'; +import { environmentQuery } from '../../../../common/utils/environment_query'; +import { getMetricsDateHistogramParams } from '../../../lib/helpers/metrics'; +import { GenericMetricsChart } from '../fetch_and_transform_metrics'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; +import { calcComputeUsageGBSeconds } from './helper'; + +export async function getComputeUsageChart({ + environment, + kuery, + config, + apmEventClient, + serviceName, + start, + end, + serverlessId, +}: { + environment: string; + kuery: string; + config: APMConfig; + apmEventClient: APMEventClient; + serviceName: string; + start: number; + end: number; + serverlessId?: string; +}): Promise<GenericMetricsChart> { + const aggs = { + avgFaasBilledDuration: { avg: { field: FAAS_BILLED_DURATION } }, + avgTotalMemory: { avg: { field: METRIC_SYSTEM_TOTAL_MEMORY } }, + countInvocations: { value_count: { field: FAAS_BILLED_DURATION } }, + }; + + const params = { + apm: { + events: [ProcessorEvent.metric], + }, + body: { + track_total_hits: false, + size: 0, + query: { + bool: { + filter: [ + { term: { [SERVICE_NAME]: serviceName } }, + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...kqlQuery(kuery), + { exists: { field: FAAS_BILLED_DURATION } }, + ...termQuery(METRICSET_NAME, 'app'), + ...termQuery(FAAS_ID, serverlessId), + ], + }, + }, + aggs: { + timeseriesData: { + date_histogram: getMetricsDateHistogramParams({ + start, + end, + metricsInterval: config.metricsInterval, + }), + aggs, + }, + ...aggs, + }, + }, + }; + + const { aggregations } = await apmEventClient.search( + 'get_compute_usage', + params + ); + const timeseriesData = aggregations?.timeseriesData; + + return { + title: i18n.translate('xpack.apm.agentMetrics.serverless.computeUsage', { + defaultMessage: 'Compute usage', + }), + key: 'compute_usage', + yUnit: 'number', + description: i18n.translate( + 'xpack.apm.agentMetrics.serverless.computeUsage.description', + { + defaultMessage: + "Compute usage (in GB-seconds) is the execution time multiplied by the available memory size of your function's instances. The compute usage is a direct indicator for the costs of your serverless function.", + } + ), + series: + !timeseriesData || timeseriesData.buckets.length === 0 + ? [] + : [ + { + title: i18n.translate( + 'xpack.apm.agentMetrics.serverless.computeUsage', + { defaultMessage: 'Compute usage' } + ), + key: 'compute_usage', + type: 'bar', + overallValue: + calcComputeUsageGBSeconds({ + billedDuration: aggregations?.avgFaasBilledDuration.value, + totalMemory: aggregations?.avgTotalMemory.value, + countInvocations: aggregations?.countInvocations.value, + }) ?? 0, + color: theme.euiColorVis0, + data: timeseriesData.buckets.map((bucket) => { + const computeUsage = + calcComputeUsageGBSeconds({ + billedDuration: bucket.avgFaasBilledDuration.value, + totalMemory: bucket.avgTotalMemory.value, + countInvocations: bucket.countInvocations.value, + }) ?? 0; + return { + x: bucket.key, + y: computeUsage, + }; + }), + }, + ], + }; +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_agent_metrics_chart.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_agent_metrics_chart.ts new file mode 100644 index 0000000000000..1d1bf19b635be --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_agent_metrics_chart.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 { getSearchTransactionsEvents } from '../../../lib/helpers/transactions'; +import { withApmSpan } from '../../../utils/with_apm_span'; +import { getMemoryChartData } from '../by_agent/shared/memory'; +import { getColdStartCountChart } from './get_cold_start_count_chart'; +import { getColdStartDurationChart } from './get_cold_start_duration_chart'; +import { getComputeUsageChart } from './get_compute_usage_chart'; +import { getServerlessFunctionLatencyChart } from './get_serverless_function_latency_chart'; +import { APMConfig } from '../../..'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; + +export function getServerlessAgentMetricsCharts({ + environment, + kuery, + config, + apmEventClient, + serviceName, + start, + end, + serverlessId, +}: { + environment: string; + kuery: string; + config: APMConfig; + apmEventClient: APMEventClient; + serviceName: string; + start: number; + end: number; + serverlessId?: string; +}) { + return withApmSpan('get_serverless_agent_metric_charts', async () => { + const searchAggregatedTransactions = await getSearchTransactionsEvents({ + config, + apmEventClient, + kuery, + start, + end, + }); + + const options = { + environment, + kuery, + apmEventClient, + config, + serviceName, + start, + end, + serverlessId, + }; + return await Promise.all([ + getServerlessFunctionLatencyChart({ + ...options, + searchAggregatedTransactions, + }), + getMemoryChartData(options), + getColdStartDurationChart(options), + getColdStartCountChart(options), + getComputeUsageChart(options), + ]); + }); +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_function_latency_chart.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_function_latency_chart.ts new file mode 100644 index 0000000000000..47593c3f48409 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_function_latency_chart.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 { i18n } from '@kbn/i18n'; +import { euiLightVars as theme } from '@kbn/ui-theme'; +import { termQuery } from '@kbn/observability-plugin/server'; +import { isEmpty } from 'lodash'; +import { + FAAS_BILLED_DURATION, + FAAS_ID, + METRICSET_NAME, +} from '../../../../common/elasticsearch_fieldnames'; +import { LatencyAggregationType } from '../../../../common/latency_aggregation_types'; +import { isFiniteNumber } from '../../../../common/utils/is_finite_number'; +import { getVizColorForIndex } from '../../../../common/viz_colors'; +import { getLatencyTimeseries } from '../../transactions/get_latency_charts'; +import { APMConfig } from '../../..'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; +import { + fetchAndTransformMetrics, + GenericMetricsChart, +} from '../fetch_and_transform_metrics'; +import { ChartBase } from '../types'; + +const billedDurationAvg = { + title: i18n.translate('xpack.apm.agentMetrics.serverless.billedDurationAvg', { + defaultMessage: 'Billed Duration', + }), +}; + +const chartBase: ChartBase = { + title: i18n.translate('xpack.apm.agentMetrics.serverless.avgDuration', { + defaultMessage: 'Lambda Duration', + }), + key: 'avg_duration', + type: 'linemark', + yUnit: 'time', + series: {}, + description: i18n.translate( + 'xpack.apm.agentMetrics.serverless.avgDuration.description', + { + defaultMessage: + 'Transaction duration is the time spent processing and responding to a request. If the request is queued it will not be contribute to the transaction duration but will contribute the overall billed duration', + } + ), +}; + +async function getServerlessLantecySeries({ + environment, + kuery, + apmEventClient, + serviceName, + start, + end, + serverlessId, + searchAggregatedTransactions, +}: { + environment: string; + kuery: string; + apmEventClient: APMEventClient; + serviceName: string; + start: number; + end: number; + serverlessId?: string; + searchAggregatedTransactions: boolean; +}): Promise<GenericMetricsChart['series']> { + const transactionLatency = await getLatencyTimeseries({ + environment, + kuery, + serviceName, + apmEventClient, + searchAggregatedTransactions, + latencyAggregationType: LatencyAggregationType.avg, + start, + end, + serverlessId, + }); + + return [ + { + title: i18n.translate( + 'xpack.apm.agentMetrics.serverless.transactionDuration', + { defaultMessage: 'Transaction Duration' } + ), + key: 'transaction_duration', + type: 'linemark', + color: getVizColorForIndex(1, theme), + overallValue: transactionLatency.overallAvgDuration ?? 0, + data: transactionLatency.latencyTimeseries, + }, + ]; +} + +export async function getServerlessFunctionLatencyChart({ + environment, + kuery, + config, + apmEventClient, + serviceName, + start, + end, + serverlessId, + searchAggregatedTransactions, +}: { + environment: string; + kuery: string; + config: APMConfig; + apmEventClient: APMEventClient; + serviceName: string; + start: number; + end: number; + serverlessId?: string; + searchAggregatedTransactions: boolean; +}): Promise<GenericMetricsChart> { + const options = { + environment, + kuery, + config, + apmEventClient, + serviceName, + start, + end, + }; + + const [billedDurationMetrics, serverlessDurationSeries] = await Promise.all([ + fetchAndTransformMetrics({ + ...options, + chartBase: { ...chartBase, series: { billedDurationAvg } }, + aggs: { + billedDurationAvg: { avg: { field: FAAS_BILLED_DURATION } }, + }, + additionalFilters: [ + { exists: { field: FAAS_BILLED_DURATION } }, + ...termQuery(FAAS_ID, serverlessId), + ...termQuery(METRICSET_NAME, 'app'), + ], + operationName: 'get_billed_duration', + }), + getServerlessLantecySeries({ + ...options, + serverlessId, + searchAggregatedTransactions, + }), + ]); + + const series = []; + + const [billedDurationSeries] = billedDurationMetrics.series; + if (billedDurationSeries) { + const data = billedDurationSeries.data?.map(({ x, y }) => ({ + x, + // Billed duration is stored in ms, convert it to microseconds so it uses the same unit as the other chart + y: isFiniteNumber(y) ? y * 1000 : y, + })); + series.push({ + ...billedDurationSeries, + // Billed duration is stored in ms, convert it to microseconds + overallValue: billedDurationSeries.overallValue * 1000, + data: data || [], + }); + } + + if (!isEmpty(serverlessDurationSeries[0].data)) { + series.push(...serverlessDurationSeries); + } + + return { + ...billedDurationMetrics, + series, + }; +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_functions_overview.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_functions_overview.ts new file mode 100644 index 0000000000000..236e950c1f13c --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_functions_overview.ts @@ -0,0 +1,100 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { + kqlQuery, + rangeQuery, + termQuery, +} from '@kbn/observability-plugin/server'; +import { + FAAS_BILLED_DURATION, + FAAS_COLDSTART, + FAAS_DURATION, + FAAS_ID, + METRICSET_NAME, + METRIC_SYSTEM_FREE_MEMORY, + METRIC_SYSTEM_TOTAL_MEMORY, + SERVICE_NAME, +} from '../../../../common/elasticsearch_fieldnames'; +import { getServerlessFunctionNameFromId } from '../../../../common/serverless'; +import { environmentQuery } from '../../../../common/utils/environment_query'; +import { calcMemoryUsed } from './helper'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; + +export async function getServerlessFunctionsOverview({ + end, + environment, + kuery, + serviceName, + start, + apmEventClient, +}: { + environment: string; + kuery: string; + serviceName: string; + start: number; + end: number; + apmEventClient: APMEventClient; +}) { + const params = { + apm: { + events: [ProcessorEvent.metric], + }, + body: { + track_total_hits: false, + size: 0, + query: { + bool: { + filter: [ + ...termQuery(METRICSET_NAME, 'app'), + { term: { [SERVICE_NAME]: serviceName } }, + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...kqlQuery(kuery), + ], + }, + }, + aggs: { + serverlessFunctions: { + terms: { field: FAAS_ID }, + aggs: { + faasDurationAvg: { avg: { field: FAAS_DURATION } }, + faasBilledDurationAvg: { avg: { field: FAAS_BILLED_DURATION } }, + coldStartCount: { sum: { field: FAAS_COLDSTART } }, + maxTotalMemory: { max: { field: METRIC_SYSTEM_TOTAL_MEMORY } }, + avgTotalMemory: { avg: { field: METRIC_SYSTEM_TOTAL_MEMORY } }, + avgFreeMemory: { avg: { field: METRIC_SYSTEM_FREE_MEMORY } }, + }, + }, + }, + }, + }; + + const response = await apmEventClient.search( + 'ger_serverless_functions_overview', + params + ); + + const serverlessFunctionsOverview = + response.aggregations?.serverlessFunctions?.buckets?.map((bucket) => { + const serverlessId = bucket.key as string; + return { + serverlessId, + serverlessFunctionName: getServerlessFunctionNameFromId(serverlessId), + serverlessDurationAvg: bucket.faasDurationAvg.value, + billedDurationAvg: bucket.faasBilledDurationAvg.value, + coldStartCount: bucket.coldStartCount.value, + avgMemoryUsed: calcMemoryUsed({ + memoryFree: bucket.avgFreeMemory.value, + memoryTotal: bucket.avgTotalMemory.value, + }), + memorySize: bucket.maxTotalMemory.value, + }; + }); + + return serverlessFunctionsOverview || []; +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_summary.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_summary.ts new file mode 100644 index 0000000000000..7d8f94606f86b --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_summary.ts @@ -0,0 +1,167 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { + termQuery, + kqlQuery, + rangeQuery, +} from '@kbn/observability-plugin/server'; +import { + FAAS_BILLED_DURATION, + FAAS_DURATION, + FAAS_ID, + HOST_ARCHITECTURE, + METRICSET_NAME, + METRIC_SYSTEM_FREE_MEMORY, + METRIC_SYSTEM_TOTAL_MEMORY, + SERVICE_NAME, +} from '../../../../common/elasticsearch_fieldnames'; +import { environmentQuery } from '../../../../common/utils/environment_query'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; +import { calcEstimatedCost, calcMemoryUsedRate } from './helper'; + +export type AwsLambdaArchitecture = 'arm' | 'x86_64'; + +export type AWSLambdaPriceFactor = Record<AwsLambdaArchitecture, number>; + +async function getServerlessTransactionThroughput({ + end, + environment, + kuery, + serviceName, + start, + serverlessId, + apmEventClient, +}: { + environment: string; + kuery: string; + serviceName: string; + start: number; + end: number; + serverlessId?: string; + apmEventClient: APMEventClient; +}) { + const params = { + apm: { + events: [ProcessorEvent.transaction], + }, + body: { + track_total_hits: true, + size: 0, + query: { + bool: { + filter: [ + ...termQuery(SERVICE_NAME, serviceName), + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...kqlQuery(kuery), + ...termQuery(FAAS_ID, serverlessId), + ], + }, + }, + }, + }; + + const response = await apmEventClient.search( + 'get_serverless_transaction_throughout', + params + ); + + return response.hits.total.value; +} + +export async function getServerlessSummary({ + end, + environment, + kuery, + serviceName, + start, + serverlessId, + apmEventClient, + awsLambdaPriceFactor, + awsLambdaRequestCostPerMillion, +}: { + environment: string; + kuery: string; + serviceName: string; + start: number; + end: number; + serverlessId?: string; + apmEventClient: APMEventClient; + awsLambdaPriceFactor?: AWSLambdaPriceFactor; + awsLambdaRequestCostPerMillion?: number; +}) { + const params = { + apm: { + events: [ProcessorEvent.metric], + }, + body: { + track_total_hits: false, + size: 0, + query: { + bool: { + filter: [ + ...termQuery(METRICSET_NAME, 'app'), + { term: { [SERVICE_NAME]: serviceName } }, + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...kqlQuery(kuery), + ...termQuery(FAAS_ID, serverlessId), + ], + }, + }, + aggs: { + totalFunctions: { cardinality: { field: FAAS_ID } }, + faasDurationAvg: { avg: { field: FAAS_DURATION } }, + faasBilledDurationAvg: { avg: { field: FAAS_BILLED_DURATION } }, + avgTotalMemory: { avg: { field: METRIC_SYSTEM_TOTAL_MEMORY } }, + avgFreeMemory: { avg: { field: METRIC_SYSTEM_FREE_MEMORY } }, + countInvocations: { value_count: { field: FAAS_BILLED_DURATION } }, + sample: { + top_metrics: { + metrics: [{ field: HOST_ARCHITECTURE }], + sort: [{ '@timestamp': { order: 'desc' as const } }], + }, + }, + }, + }, + }; + + const [response, transactionThroughput] = await Promise.all([ + apmEventClient.search('get_serverless_summary', params), + getServerlessTransactionThroughput({ + end, + environment, + kuery, + serviceName, + apmEventClient, + start, + serverlessId, + }), + ]); + + return { + memoryUsageAvgRate: calcMemoryUsedRate({ + memoryFree: response.aggregations?.avgFreeMemory?.value, + memoryTotal: response.aggregations?.avgTotalMemory?.value, + }), + serverlessFunctionsTotal: response.aggregations?.totalFunctions?.value, + serverlessDurationAvg: response.aggregations?.faasDurationAvg?.value, + billedDurationAvg: response.aggregations?.faasBilledDurationAvg?.value, + estimatedCost: calcEstimatedCost({ + awsLambdaPriceFactor, + awsLambdaRequestCostPerMillion, + architecture: response.aggregations?.sample?.top?.[0]?.metrics?.[ + HOST_ARCHITECTURE + ] as AwsLambdaArchitecture | undefined, + transactionThroughput, + billedDuration: response.aggregations?.faasBilledDurationAvg.value, + totalMemory: response.aggregations?.avgTotalMemory.value, + countInvocations: response.aggregations?.countInvocations.value, + }), + }; +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/helper.test.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/helper.test.ts new file mode 100644 index 0000000000000..23b322663353e --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/helper.test.ts @@ -0,0 +1,128 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { + calcMemoryUsed, + calcMemoryUsedRate, + calcEstimatedCost, +} from './helper'; +describe('calcMemoryUsed', () => { + it('returns undefined when memory values are no a number', () => { + [ + { memoryFree: null, memoryTotal: null }, + { memoryFree: undefined, memoryTotal: undefined }, + { memoryFree: 100, memoryTotal: undefined }, + { memoryFree: undefined, memoryTotal: 100 }, + ].forEach(({ memoryFree, memoryTotal }) => { + expect(calcMemoryUsed({ memoryFree, memoryTotal })).toBeUndefined(); + }); + }); + + it('returns correct memory used', () => { + expect(calcMemoryUsed({ memoryFree: 50, memoryTotal: 100 })).toBe(50); + }); +}); + +describe('calcMemoryUsedRate', () => { + it('returns undefined when memory values are no a number', () => { + [ + { memoryFree: null, memoryTotal: null }, + { memoryFree: undefined, memoryTotal: undefined }, + { memoryFree: 100, memoryTotal: undefined }, + { memoryFree: undefined, memoryTotal: 100 }, + ].forEach(({ memoryFree, memoryTotal }) => { + expect(calcMemoryUsedRate({ memoryFree, memoryTotal })).toBeUndefined(); + }); + }); + + it('returns correct memory used rate', () => { + expect(calcMemoryUsedRate({ memoryFree: 50, memoryTotal: 100 })).toBe(0.5); + }); +}); + +const AWS_LAMBDA_PRICE_FACTOR = { + x86_64: 0.0000166667, + arm: 0.0000133334, +}; + +describe('calcEstimatedCost', () => { + it('returns undefined when price factor is not defined', () => { + expect( + calcEstimatedCost({ + totalMemory: 1, + billedDuration: 1, + transactionThroughput: 1, + architecture: 'arm', + }) + ).toBeUndefined(); + }); + + it('returns undefined when architecture is not defined', () => { + expect( + calcEstimatedCost({ + totalMemory: 1, + billedDuration: 1, + transactionThroughput: 1, + awsLambdaPriceFactor: AWS_LAMBDA_PRICE_FACTOR, + }) + ).toBeUndefined(); + }); + + it('returns undefined when compute usage is not defined', () => { + expect( + calcEstimatedCost({ + transactionThroughput: 1, + awsLambdaPriceFactor: AWS_LAMBDA_PRICE_FACTOR, + architecture: 'arm', + }) + ).toBeUndefined(); + }); + + it('returns undefined when request cost per million is not defined', () => { + expect( + calcEstimatedCost({ + totalMemory: 1, + billedDuration: 1, + transactionThroughput: 1, + awsLambdaPriceFactor: AWS_LAMBDA_PRICE_FACTOR, + architecture: 'arm', + }) + ).toBeUndefined(); + }); + + describe('x86_64 architecture', () => { + const architecture = 'x86_64'; + it('returns correct cost', () => { + expect( + calcEstimatedCost({ + awsLambdaPriceFactor: AWS_LAMBDA_PRICE_FACTOR, + architecture, + billedDuration: 4000, + totalMemory: 536870912, // 0.5gb + transactionThroughput: 100000, + awsLambdaRequestCostPerMillion: 0.2, + countInvocations: 1, + }) + ).toEqual(0.03); + }); + }); + describe('arm architecture', () => { + const architecture = 'arm'; + it('returns correct cost', () => { + expect( + calcEstimatedCost({ + awsLambdaPriceFactor: AWS_LAMBDA_PRICE_FACTOR, + architecture, + billedDuration: 8000, + totalMemory: 536870912, // 0.5gb + transactionThroughput: 200000, + awsLambdaRequestCostPerMillion: 0.2, + countInvocations: 1, + }) + ).toEqual(0.05); + }); + }); +}); diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/helper.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/helper.ts new file mode 100644 index 0000000000000..df3ba8c4b9898 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/helper.ts @@ -0,0 +1,113 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { isFiniteNumber } from '../../../../common/utils/is_finite_number'; +import { + AwsLambdaArchitecture, + AWSLambdaPriceFactor, +} from './get_serverless_summary'; + +export function calcMemoryUsedRate({ + memoryFree, + memoryTotal, +}: { + memoryFree?: number | null; + memoryTotal?: number | null; +}) { + if (!isFiniteNumber(memoryFree) || !isFiniteNumber(memoryTotal)) { + return undefined; + } + + return (memoryTotal - memoryFree) / memoryTotal; +} + +export function calcMemoryUsed({ + memoryFree, + memoryTotal, +}: { + memoryFree?: number | null; + memoryTotal?: number | null; +}) { + if (!isFiniteNumber(memoryFree) || !isFiniteNumber(memoryTotal)) { + return undefined; + } + + return memoryTotal - memoryFree; +} + +const GB = 1024 ** 3; +/** + * To calculate the compute usage we need to multiply the "system.memory.total" by "faas.billed_duration". + * But the result of this calculation is in Bytes-milliseconds, as the "system.memory.total" is stored in bytes and the "faas.billed_duration" is stored in milliseconds. + * But to calculate the overall cost AWS uses GB-second, so we need to convert the result to this unit. + */ +export function calcComputeUsageGBSeconds({ + billedDuration, + totalMemory, + countInvocations, +}: { + billedDuration?: number | null; + totalMemory?: number | null; + countInvocations?: number | null; +}) { + if ( + !isFiniteNumber(billedDuration) || + !isFiniteNumber(totalMemory) || + !isFiniteNumber(countInvocations) + ) { + return undefined; + } + + const totalMemoryGB = totalMemory / GB; + const faasBilledDurationSec = billedDuration / 1000; + return totalMemoryGB * faasBilledDurationSec * countInvocations; +} + +export function calcEstimatedCost({ + awsLambdaPriceFactor, + architecture, + transactionThroughput, + billedDuration, + totalMemory, + awsLambdaRequestCostPerMillion, + countInvocations, +}: { + awsLambdaPriceFactor?: AWSLambdaPriceFactor; + architecture?: AwsLambdaArchitecture; + transactionThroughput: number; + billedDuration?: number | null; + totalMemory?: number | null; + awsLambdaRequestCostPerMillion?: number; + countInvocations?: number | null; +}) { + try { + const computeUsage = calcComputeUsageGBSeconds({ + billedDuration, + totalMemory, + countInvocations, + }); + if ( + !awsLambdaPriceFactor || + !architecture || + !isFiniteNumber(awsLambdaRequestCostPerMillion) || + !isFiniteNumber(awsLambdaPriceFactor?.[architecture]) || + !isFiniteNumber(computeUsage) + ) { + return undefined; + } + + const priceFactor = awsLambdaPriceFactor?.[architecture]; + + const estimatedCost = + computeUsage * priceFactor + + transactionThroughput * (awsLambdaRequestCostPerMillion / 1000000); + + // Rounds up the decimals + return Math.ceil(estimatedCost * 100) / 100; + } catch (e) { + return undefined; + } +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/route.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/route.ts new file mode 100644 index 0000000000000..af907851623b5 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/route.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 * as t from 'io-ts'; +import { + apmAWSLambdaPriceFactor, + apmAWSLambdaRequestCostPerMillion, +} from '@kbn/observability-plugin/common'; +import { createApmServerRoute } from '../../apm_routes/create_apm_server_route'; +import { environmentRt, kueryRt, rangeRt } from '../../default_api_types'; +import { getServerlessAgentMetricsCharts } from './get_serverless_agent_metrics_chart'; +import { getServerlessActiveInstancesOverview } from './get_active_instances_overview'; +import { getServerlessFunctionsOverview } from './get_serverless_functions_overview'; +import { + AWSLambdaPriceFactor, + getServerlessSummary, +} from './get_serverless_summary'; +import { getActiveInstancesTimeseries } from './get_active_instances_timeseries'; +import { getApmEventClient } from '../../../lib/helpers/get_apm_event_client'; + +const serverlessMetricsChartsRoute = createApmServerRoute({ + endpoint: + 'GET /internal/apm/services/{serviceName}/metrics/serverless/charts', + params: t.type({ + path: t.type({ + serviceName: t.string, + }), + query: t.intersection([ + environmentRt, + kueryRt, + rangeRt, + t.partial({ serverlessId: t.string }), + ]), + }), + options: { tags: ['access:apm'] }, + handler: async ( + resources + ): Promise<{ + charts: Awaited<ReturnType<typeof getServerlessAgentMetricsCharts>>; + }> => { + const { params, config } = resources; + const apmEventClient = await getApmEventClient(resources); + + const { serviceName } = params.path; + const { environment, kuery, start, end, serverlessId } = params.query; + + const charts = await getServerlessAgentMetricsCharts({ + environment, + start, + end, + kuery, + config, + apmEventClient, + serviceName, + serverlessId, + }); + return { charts }; + }, +}); + +const serverlessMetricsActiveInstancesRoute = createApmServerRoute({ + endpoint: + 'GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances', + params: t.type({ + path: t.type({ + serviceName: t.string, + }), + query: t.intersection([ + environmentRt, + kueryRt, + rangeRt, + t.partial({ serverlessId: t.string }), + ]), + }), + options: { tags: ['access:apm'] }, + handler: async ( + resources + ): Promise<{ + activeInstances: Awaited< + ReturnType<typeof getServerlessActiveInstancesOverview> + >; + timeseries: Awaited<ReturnType<typeof getActiveInstancesTimeseries>>; + }> => { + const { params, config } = resources; + const apmEventClient = await getApmEventClient(resources); + + const { serviceName } = params.path; + const { environment, kuery, start, end, serverlessId } = params.query; + + const options = { + environment, + start, + end, + kuery, + serviceName, + serverlessId, + apmEventClient, + }; + + const [activeInstances, timeseries] = await Promise.all([ + getServerlessActiveInstancesOverview(options), + getActiveInstancesTimeseries({ ...options, config }), + ]); + return { activeInstances, timeseries }; + }, +}); + +const serverlessMetricsFunctionsOverviewRoute = createApmServerRoute({ + endpoint: + 'GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview', + params: t.type({ + path: t.type({ + serviceName: t.string, + }), + query: t.intersection([environmentRt, kueryRt, rangeRt]), + }), + options: { tags: ['access:apm'] }, + handler: async ( + resources + ): Promise<{ + serverlessFunctionsOverview: Awaited< + ReturnType<typeof getServerlessFunctionsOverview> + >; + }> => { + const { params } = resources; + const apmEventClient = await getApmEventClient(resources); + + const { serviceName } = params.path; + const { environment, kuery, start, end } = params.query; + + const serverlessFunctionsOverview = await getServerlessFunctionsOverview({ + environment, + start, + end, + kuery, + apmEventClient, + serviceName, + }); + return { serverlessFunctionsOverview }; + }, +}); + +const serverlessMetricsSummaryRoute = createApmServerRoute({ + endpoint: + 'GET /internal/apm/services/{serviceName}/metrics/serverless/summary', + params: t.type({ + path: t.type({ + serviceName: t.string, + }), + query: t.intersection([ + environmentRt, + kueryRt, + rangeRt, + t.partial({ serverlessId: t.string }), + ]), + }), + options: { tags: ['access:apm'] }, + handler: async ( + resources + ): Promise<Awaited<ReturnType<typeof getServerlessSummary>>> => { + const { params, context } = resources; + const { + uiSettings: { client: uiSettingsClient }, + } = await context.core; + + const [ + apmEventClient, + awsLambdaPriceFactor, + awsLambdaRequestCostPerMillion, + ] = await Promise.all([ + getApmEventClient(resources), + uiSettingsClient + .get<string>(apmAWSLambdaPriceFactor) + .then( + (value): AWSLambdaPriceFactor => + JSON.parse(value) as AWSLambdaPriceFactor + ), + uiSettingsClient.get<number>(apmAWSLambdaRequestCostPerMillion), + ]); + + const { serviceName } = params.path; + const { environment, kuery, start, end, serverlessId } = params.query; + + return getServerlessSummary({ + environment, + start, + end, + kuery, + apmEventClient, + serviceName, + serverlessId, + awsLambdaPriceFactor, + awsLambdaRequestCostPerMillion, + }); + }, +}); + +export const metricsServerlessRouteRepository = { + ...serverlessMetricsChartsRoute, + ...serverlessMetricsSummaryRoute, + ...serverlessMetricsFunctionsOverviewRoute, + ...serverlessMetricsActiveInstancesRoute, +}; diff --git a/x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts b/x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts new file mode 100644 index 0000000000000..bdd1667b4c8e8 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts @@ -0,0 +1,147 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { + termQuery, + kqlQuery, + rangeQuery, +} from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { + DEVICE_MODEL_NAME, + HOST_OS_VERSION, + NETWORK_CONNECTION_TYPE, + SERVICE_NAME, + SERVICE_VERSION, + TRANSACTION_TYPE, +} from '../../../common/elasticsearch_fieldnames'; +import { environmentQuery } from '../../../common/utils/environment_query'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; + +type MobileFiltersTypes = + | 'device' + | 'appVersion' + | 'osVersion' + | 'netConnectionType'; +type MobileFilters = Array<{ + key: MobileFiltersTypes; + options: string[]; + label: string; +}>; + +export async function getMobileFilters({ + kuery, + apmEventClient, + serviceName, + transactionType, + environment, + start, + end, +}: { + kuery: string; + apmEventClient: APMEventClient; + serviceName: string; + transactionType?: string; + environment: string; + start: number; + end: number; +}): Promise<MobileFilters> { + const response = await apmEventClient.search('get_mobile_filters', { + apm: { + events: [ + ProcessorEvent.error, + ProcessorEvent.metric, + ProcessorEvent.transaction, + ], + }, + body: { + track_total_hits: false, + size: 0, + query: { + bool: { + filter: [ + ...termQuery(SERVICE_NAME, serviceName), + ...termQuery(TRANSACTION_TYPE, transactionType), + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...kqlQuery(kuery), + ], + }, + }, + aggs: { + devices: { + terms: { + field: DEVICE_MODEL_NAME, + size: 10, + }, + }, + osVersions: { + terms: { + field: HOST_OS_VERSION, + size: 10, + }, + }, + appVersions: { + terms: { + field: SERVICE_VERSION, + size: 10, + }, + }, + netConnectionTypes: { + terms: { + field: NETWORK_CONNECTION_TYPE, + size: 10, + }, + }, + }, + }, + }); + + return [ + { + key: 'device', + label: i18n.translate('xpack.apm.mobile.filters.device', { + defaultMessage: 'Device', + }), + options: + response.aggregations?.devices?.buckets?.map( + ({ key }) => key as string + ) || [], + }, + { + key: 'osVersion', + label: i18n.translate('xpack.apm.mobile.filters.osVersion', { + defaultMessage: 'OS version', + }), + options: + response.aggregations?.osVersions?.buckets?.map( + ({ key }) => key as string + ) || [], + }, + { + key: 'appVersion', + label: i18n.translate('xpack.apm.mobile.filters.appVersion', { + defaultMessage: 'App version', + }), + options: + response.aggregations?.appVersions?.buckets?.map( + ({ key }) => key as string + ) || [], + }, + { + key: 'netConnectionType', + label: i18n.translate('xpack.apm.mobile.filters.nct', { + defaultMessage: 'NCT', + }), + options: + response.aggregations?.netConnectionTypes?.buckets?.map( + ({ key }) => key as string + ) || [], + }, + ]; +} diff --git a/x-pack/plugins/apm/server/routes/mobile/route.ts b/x-pack/plugins/apm/server/routes/mobile/route.ts new file mode 100644 index 0000000000000..81042f9522d92 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/mobile/route.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 * as t from 'io-ts'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; +import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; +import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; +import { getMobileFilters } from './get_mobile_filters'; + +const mobileFilters = createApmServerRoute({ + endpoint: 'GET /internal/apm/services/{serviceName}/mobile/filters', + params: t.type({ + path: t.type({ + serviceName: t.string, + }), + query: t.intersection([ + kueryRt, + rangeRt, + environmentRt, + t.partial({ + transactionType: t.string, + }), + ]), + }), + options: { tags: ['access:apm'] }, + handler: async ( + resources + ): Promise<{ + mobileFilters: Awaited<ReturnType<typeof getMobileFilters>>; + }> => { + const apmEventClient = await getApmEventClient(resources); + const { params } = resources; + const { serviceName } = params.path; + const { kuery, environment, start, end, transactionType } = params.query; + + const filters = await getMobileFilters({ + kuery, + environment, + transactionType, + start, + end, + serviceName, + apmEventClient, + }); + return { mobileFilters: filters }; + }, +}); + +export const mobileRouteRepository = { + ...mobileFilters, +}; diff --git a/x-pack/plugins/apm/server/routes/observability_overview/get_service_count.ts b/x-pack/plugins/apm/server/routes/observability_overview/get_service_count.ts index ecdf1c792ffe5..315f9345bff84 100644 --- a/x-pack/plugins/apm/server/routes/observability_overview/get_service_count.ts +++ b/x-pack/plugins/apm/server/routes/observability_overview/get_service_count.ts @@ -8,22 +8,20 @@ import { rangeQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../lib/helpers/setup_request'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServiceCount({ - setup, + apmEventClient, searchAggregatedTransactions, start, end, }: { - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; start: number; end: number; }) { - const { apmEventClient } = setup; - const params = { apm: { events: [ diff --git a/x-pack/plugins/apm/server/routes/observability_overview/get_transactions_per_minute.ts b/x-pack/plugins/apm/server/routes/observability_overview/get_transactions_per_minute.ts index cfc89a7589cdf..8f99b6a08ae84 100644 --- a/x-pack/plugins/apm/server/routes/observability_overview/get_transactions_per_minute.ts +++ b/x-pack/plugins/apm/server/routes/observability_overview/get_transactions_per_minute.ts @@ -11,30 +11,28 @@ import { TRANSACTION_REQUEST, } from '../../../common/transaction_types'; import { TRANSACTION_TYPE } from '../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../lib/helpers/setup_request'; import { getDocumentTypeFilterForTransactions, getProcessorEventForTransactions, } from '../../lib/helpers/transactions'; import { calculateThroughputWithRange } from '../../lib/helpers/calculate_throughput'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTransactionsPerMinute({ - setup, + apmEventClient, bucketSize, searchAggregatedTransactions, start, end, intervalString, }: { - setup: Setup; + apmEventClient: APMEventClient; bucketSize: number; intervalString: string; searchAggregatedTransactions: boolean; start: number; end: number; }) { - const { apmEventClient } = setup; - const { aggregations } = await apmEventClient.search( 'observability_overview_get_transactions_per_minute', { diff --git a/x-pack/plugins/apm/server/routes/observability_overview/has_data.ts b/x-pack/plugins/apm/server/routes/observability_overview/has_data.ts index 384f26b31e70c..66436caa7a405 100644 --- a/x-pack/plugins/apm/server/routes/observability_overview/has_data.ts +++ b/x-pack/plugins/apm/server/routes/observability_overview/has_data.ts @@ -6,10 +6,16 @@ */ import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; +import { ApmIndicesConfig } from '../settings/apm_indices/get_apm_indices'; -export async function getHasData({ setup }: { setup: Setup }) { - const { apmEventClient } = setup; +export async function getHasData({ + indices, + apmEventClient, +}: { + indices: ApmIndicesConfig; + apmEventClient: APMEventClient; +}) { try { const params = { apm: { @@ -32,12 +38,12 @@ export async function getHasData({ setup }: { setup: Setup }) { ); return { hasData: response.hits.total.value > 0, - indices: setup.indices, + indices, }; } catch (e) { return { hasData: false, - indices: setup.indices, + indices, }; } } diff --git a/x-pack/plugins/apm/server/routes/observability_overview/route.ts b/x-pack/plugins/apm/server/routes/observability_overview/route.ts index 4ed5332801ef3..600b3929d7e6e 100644 --- a/x-pack/plugins/apm/server/routes/observability_overview/route.ts +++ b/x-pack/plugins/apm/server/routes/observability_overview/route.ts @@ -7,7 +7,6 @@ import * as t from 'io-ts'; import { toNumberRt } from '@kbn/io-ts-utils'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { getServiceCount } from './get_service_count'; import { getTransactionsPerMinute } from './get_transactions_per_minute'; import { getHasData } from './has_data'; @@ -15,6 +14,7 @@ import { rangeRt } from '../default_api_types'; import { getSearchTransactionsEvents } from '../../lib/helpers/transactions'; import { withApmSpan } from '../../utils/with_apm_span'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const observabilityOverviewHasDataRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/observability_overview/has_data', @@ -25,8 +25,11 @@ const observabilityOverviewHasDataRoute = createApmServerRoute({ hasData: boolean; indices: import('./../../../../observability/common/typings').ApmIndicesConfig; }> => { - const setup = await setupRequest(resources); - return await getHasData({ setup }); + const apmEventClient = await getApmEventClient(resources); + return await getHasData({ + indices: apmEventClient.indices, + apmEventClient, + }); }, }); @@ -47,12 +50,12 @@ const observabilityOverviewRoute = createApmServerRoute({ | { value: undefined; timeseries: never[] } | { value: number; timeseries: Array<{ x: number; y: number | null }> }; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { bucketSize, intervalString, start, end } = resources.params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config: resources.config, start, end, kuery: '', @@ -71,13 +74,13 @@ const observabilityOverviewRoute = createApmServerRoute({ }> => { const [serviceCount, transactionPerMinute] = await Promise.all([ getServiceCount({ - setup, + apmEventClient, searchAggregatedTransactions, start, end, }), getTransactionsPerMinute({ - setup, + apmEventClient, bucketSize, searchAggregatedTransactions, start, diff --git a/x-pack/plugins/apm/server/routes/service_groups/get_services_counts.ts b/x-pack/plugins/apm/server/routes/service_groups/get_services_counts.ts index c820cdd8445fc..b261c2a4cfd4a 100644 --- a/x-pack/plugins/apm/server/routes/service_groups/get_services_counts.ts +++ b/x-pack/plugins/apm/server/routes/service_groups/get_services_counts.ts @@ -8,23 +8,21 @@ import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { rangeQuery, kqlQuery } from '@kbn/observability-plugin/server'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import { Setup } from '../../lib/helpers/setup_request'; import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames'; import { SavedServiceGroup } from '../../../common/service_groups'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServicesCounts({ - setup, + apmEventClient, start, end, serviceGroups, }: { - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; serviceGroups: SavedServiceGroup[]; }) { - const { apmEventClient } = setup; - const serviceGroupsKueryMap: Record<string, QueryDslQueryContainer> = serviceGroups.reduce((acc, sg) => { return { diff --git a/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts b/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts index 236b3e20222c2..4acfb49762629 100644 --- a/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts +++ b/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts @@ -13,23 +13,21 @@ import { SERVICE_ENVIRONMENT, SERVICE_NAME, } from '../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function lookupServices({ - setup, + apmEventClient, kuery, start, end, maxNumberOfServices, }: { - setup: Setup; + apmEventClient: APMEventClient; kuery: string; start: number; end: number; maxNumberOfServices: number; }) { - const { apmEventClient } = setup; - const response = await apmEventClient.search('lookup_services', { apm: { events: [ diff --git a/x-pack/plugins/apm/server/routes/service_groups/route.ts b/x-pack/plugins/apm/server/routes/service_groups/route.ts index 4430aaae760eb..dde307efa7c4b 100644 --- a/x-pack/plugins/apm/server/routes/service_groups/route.ts +++ b/x-pack/plugins/apm/server/routes/service_groups/route.ts @@ -6,8 +6,8 @@ */ import * as t from 'io-ts'; +import Boom from '@hapi/boom'; import { apmServiceGroupMaxNumberOfServices } from '@kbn/observability-plugin/common'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { kueryRt, rangeRt } from '../default_api_types'; import { getServiceGroups } from './get_service_groups'; @@ -15,8 +15,12 @@ import { getServiceGroup } from './get_service_group'; import { saveServiceGroup } from './save_service_group'; import { deleteServiceGroup } from './delete_service_group'; import { lookupServices } from './lookup_services'; -import { SavedServiceGroup } from '../../../common/service_groups'; +import { + validateServiceGroupKuery, + SavedServiceGroup, +} from '../../../common/service_groups'; import { getServicesCounts } from './get_services_counts'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const serviceGroupsRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/service-groups', @@ -57,7 +61,7 @@ const serviceGroupsWithServiceCountRoute = createApmServerRoute({ query: { start, end }, } = params; - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const serviceGroups = await getServiceGroups({ savedObjectsClient, @@ -65,7 +69,7 @@ const serviceGroupsWithServiceCountRoute = createApmServerRoute({ return { servicesCounts: await getServicesCounts({ - setup, + apmEventClient, serviceGroups, start, end, @@ -120,6 +124,12 @@ const serviceGroupSaveRoute = createApmServerRoute({ const { savedObjects: { client: savedObjectsClient }, } = await context.core; + const { isValidFields, isValidSyntax, message } = validateServiceGroupKuery( + params.body.kuery + ); + if (!(isValidFields && isValidSyntax)) { + throw Boom.badRequest(message); + } await saveServiceGroup({ savedObjectsClient, @@ -164,12 +174,12 @@ const serviceGroupServicesRoute = createApmServerRoute({ const { uiSettings: { client: uiSettingsClient }, } = await context.core; - const [setup, maxNumberOfServices] = await Promise.all([ - setupRequest(resources), + const [apmEventClient, maxNumberOfServices] = await Promise.all([ + getApmEventClient(resources), uiSettingsClient.get<number>(apmServiceGroupMaxNumberOfServices), ]); const items = await lookupServices({ - setup, + apmEventClient, kuery, start, end, diff --git a/x-pack/plugins/apm/server/routes/service_map/fetch_service_paths_from_trace_ids.ts b/x-pack/plugins/apm/server/routes/service_map/fetch_service_paths_from_trace_ids.ts index e5d97708ae173..5d044846da6e7 100644 --- a/x-pack/plugins/apm/server/routes/service_map/fetch_service_paths_from_trace_ids.ts +++ b/x-pack/plugins/apm/server/routes/service_map/fetch_service_paths_from_trace_ids.ts @@ -13,16 +13,14 @@ import { ExternalConnectionNode, ServiceConnectionNode, } from '../../../common/service_map'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function fetchServicePathsFromTraceIds( - setup: Setup, + apmEventClient: APMEventClient, traceIds: string[], start: number, end: number ) { - const { apmEventClient } = setup; - // make sure there's a range so ES can skip shards const dayInMs = 24 * 60 * 60 * 1000; const startRange = start - dayInMs; diff --git a/x-pack/plugins/apm/server/routes/service_map/get_service_anomalies.ts b/x-pack/plugins/apm/server/routes/service_map/get_service_anomalies.ts index 3c5211528cc91..f03ada8b0e81b 100644 --- a/x-pack/plugins/apm/server/routes/service_map/get_service_anomalies.ts +++ b/x-pack/plugins/apm/server/routes/service_map/get_service_anomalies.ts @@ -20,7 +20,7 @@ import { } from '../../../common/transaction_types'; import { withApmSpan } from '../../utils/with_apm_span'; import { getMlJobsWithAPMGroup } from '../../lib/anomaly_detection/get_ml_jobs_with_apm_group'; -import { Setup } from '../../lib/helpers/setup_request'; +import { MlClient } from '../../lib/helpers/get_ml_client'; import { apmMlAnomalyQuery } from '../../lib/anomaly_detection/apm_ml_anomaly_query'; import { ApmMlDetectorType } from '../../../common/anomaly_detection/apm_ml_detectors'; @@ -33,20 +33,18 @@ export type ServiceAnomaliesResponse = Awaited< ReturnType<typeof getServiceAnomalies> >; export async function getServiceAnomalies({ - setup, + mlClient, environment, start, end, }: { - setup: Setup; + mlClient?: MlClient; environment: string; start: number; end: number; }) { return withApmSpan('get_service_anomalies', async () => { - const { ml } = setup; - - if (!ml) { + if (!mlClient) { throw Boom.notImplemented(ML_ERRORS.ML_NOT_AVAILABLE); } @@ -108,9 +106,9 @@ export async function getServiceAnomalies({ // pass an empty array of job ids to anomaly search // so any validation is skipped withApmSpan('ml_anomaly_search', () => - ml.mlSystem.mlAnomalySearch(params, []) + mlClient.mlSystem.mlAnomalySearch(params, []) ), - getMLJobIds(ml.anomalyDetectors, environment), + getMLJobIds(mlClient.anomalyDetectors, environment), ]); const typedAnomalyResponse: ESSearchResponse<unknown, typeof params> = @@ -157,14 +155,14 @@ export async function getServiceAnomalies({ export async function getMLJobs( anomalyDetectors: ReturnType<MlPluginSetup['anomalyDetectorsProvider']>, - environment: string + environment?: string ) { const jobs = await getMlJobsWithAPMGroup(anomalyDetectors); // to filter out legacy jobs we are filtering by the existence of `apm_ml_version` in `custom_settings` // and checking that it is compatable. const mlJobs = jobs.filter((job) => job.version >= 2); - if (environment !== ENVIRONMENT_ALL.value) { + if (environment && environment !== ENVIRONMENT_ALL.value) { const matchingMLJob = mlJobs.find((job) => job.environment === environment); if (!matchingMLJob) { return []; @@ -176,7 +174,7 @@ export async function getMLJobs( export async function getMLJobIds( anomalyDetectors: ReturnType<MlPluginSetup['anomalyDetectorsProvider']>, - environment: string + environment?: string ) { const mlJobs = await getMLJobs(anomalyDetectors, environment); return mlJobs.map((job) => job.jobId); diff --git a/x-pack/plugins/apm/server/routes/service_map/get_service_map.ts b/x-pack/plugins/apm/server/routes/service_map/get_service_map.ts index 05424b4805d89..d5a7c20b5204f 100644 --- a/x-pack/plugins/apm/server/routes/service_map/get_service_map.ts +++ b/x-pack/plugins/apm/server/routes/service_map/get_service_map.ts @@ -16,7 +16,7 @@ import { } from '../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../common/utils/environment_query'; import { withApmSpan } from '../../utils/with_apm_span'; -import { Setup } from '../../lib/helpers/setup_request'; +import { MlClient } from '../../lib/helpers/get_ml_client'; import { DEFAULT_ANOMALIES, getServiceAnomalies, @@ -28,9 +28,13 @@ import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; import { ServiceGroup } from '../../../common/service_groups'; import { serviceGroupQuery } from '../../lib/service_group_query'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; +import { APMConfig } from '../..'; export interface IEnvOptions { - setup: Setup; + mlClient?: MlClient; + config: APMConfig; + apmEventClient: APMEventClient; serviceNames?: string[]; environment: string; searchAggregatedTransactions: boolean; @@ -41,7 +45,8 @@ export interface IEnvOptions { } async function getConnectionData({ - setup, + config, + apmEventClient, serviceNames, environment, start, @@ -50,7 +55,8 @@ async function getConnectionData({ }: IEnvOptions) { return withApmSpan('get_service_map_connections', async () => { const { traceIds } = await getTraceSampleIds({ - setup, + config, + apmEventClient, serviceNames, environment, start, @@ -58,7 +64,7 @@ async function getConnectionData({ serviceGroup, }); - const chunks = chunk(traceIds, setup.config.serviceMapMaxTracesPerRequest); + const chunks = chunk(traceIds, config.serviceMapMaxTracesPerRequest); const init = { connections: [], @@ -75,7 +81,7 @@ async function getConnectionData({ Promise.all( chunks.map((traceIdsChunk) => getServiceMapFromTraceIds({ - setup, + apmEventClient, traceIds: traceIdsChunk, start, end, @@ -100,7 +106,7 @@ async function getServicesData( ) { const { environment, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -146,8 +152,6 @@ async function getServicesData( }, }; - const { apmEventClient } = setup; - const response = await apmEventClient.search( 'get_service_stats_for_service_map', params diff --git a/x-pack/plugins/apm/server/routes/service_map/get_service_map_dependency_node_info.ts b/x-pack/plugins/apm/server/routes/service_map/get_service_map_dependency_node_info.ts index 8d2210827918a..241672a7fa4db 100644 --- a/x-pack/plugins/apm/server/routes/service_map/get_service_map_dependency_node_info.ts +++ b/x-pack/plugins/apm/server/routes/service_map/get_service_map_dependency_node_info.ts @@ -17,14 +17,14 @@ import { EventOutcome } from '../../../common/event_outcome'; import { environmentQuery } from '../../../common/utils/environment_query'; import { withApmSpan } from '../../utils/with_apm_span'; import { calculateThroughputWithRange } from '../../lib/helpers/calculate_throughput'; -import { Setup } from '../../lib/helpers/setup_request'; import { getBucketSize } from '../../lib/helpers/get_bucket_size'; import { getFailedTransactionRateTimeSeries } from '../../lib/helpers/transaction_error_rate'; import { NodeStats } from '../../../common/service_map'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; interface Options { - setup: Setup; + apmEventClient: APMEventClient; environment: string; dependencyName: string; start: number; @@ -35,13 +35,12 @@ interface Options { export function getServiceMapDependencyNodeInfo({ environment, dependencyName, - setup, + apmEventClient, start, end, offset, }: Options): Promise<NodeStats> { return withApmSpan('get_service_map_dependency_node_stats', async () => { - const { apmEventClient } = setup; const { offsetInMs, startWithOffset, endWithOffset } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/routes/service_map/get_service_map_from_trace_ids.ts b/x-pack/plugins/apm/server/routes/service_map/get_service_map_from_trace_ids.ts index 6a61a514881b0..21daa774152f3 100644 --- a/x-pack/plugins/apm/server/routes/service_map/get_service_map_from_trace_ids.ts +++ b/x-pack/plugins/apm/server/routes/service_map/get_service_map_from_trace_ids.ts @@ -7,7 +7,7 @@ import { find, uniqBy } from 'lodash'; import { Connection, ConnectionNode } from '../../../common/service_map'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; import { fetchServicePathsFromTraceIds } from './fetch_service_paths_from_trace_ids'; export function getConnections({ @@ -40,18 +40,18 @@ export function getConnections({ } export async function getServiceMapFromTraceIds({ - setup, + apmEventClient, traceIds, start, end, }: { - setup: Setup; + apmEventClient: APMEventClient; traceIds: string[]; start: number; end: number; }) { const serviceMapFromTraceIdsScriptResponse = - await fetchServicePathsFromTraceIds(setup, traceIds, start, end); + await fetchServicePathsFromTraceIds(apmEventClient, traceIds, start, end); const serviceMapScriptedAggValue = serviceMapFromTraceIdsScriptResponse.aggregations?.service_map.value; diff --git a/x-pack/plugins/apm/server/routes/service_map/get_service_map_service_node_info.ts b/x-pack/plugins/apm/server/routes/service_map/get_service_map_service_node_info.ts index 72e8b3b267cf2..7f4b260b83309 100644 --- a/x-pack/plugins/apm/server/routes/service_map/get_service_map_service_node_info.ts +++ b/x-pack/plugins/apm/server/routes/service_map/get_service_map_service_node_info.ts @@ -24,7 +24,6 @@ import { import { environmentQuery } from '../../../common/utils/environment_query'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; import { getBucketSizeForAggregatedTransactions } from '../../lib/helpers/get_bucket_size_for_aggregated_transactions'; -import { Setup } from '../../lib/helpers/setup_request'; import { getDocumentTypeFilterForTransactions, getDurationFieldForTransactions, @@ -36,9 +35,10 @@ import { percentCgroupMemoryUsedScript, percentSystemMemoryUsedScript, } from '../metrics/by_agent/shared/memory'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; interface Options { - setup: Setup; + apmEventClient: APMEventClient; environment: string; serviceName: string; searchAggregatedTransactions: boolean; @@ -53,7 +53,7 @@ interface TaskParameters { searchAggregatedTransactions: boolean; minutes: number; serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; intervalString: string; @@ -65,7 +65,7 @@ interface TaskParameters { export function getServiceMapServiceNodeInfo({ environment, serviceName, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -99,7 +99,7 @@ export function getServiceMapServiceNodeInfo({ searchAggregatedTransactions, minutes, serviceName, - setup, + apmEventClient, start: startWithOffset, end: endWithOffset, intervalString, @@ -125,7 +125,7 @@ export function getServiceMapServiceNodeInfo({ } async function getFailedTransactionsRateStats({ - setup, + apmEventClient, serviceName, environment, searchAggregatedTransactions, @@ -137,7 +137,7 @@ async function getFailedTransactionsRateStats({ return withApmSpan('get_error_rate_for_service_map_node', async () => { const { average, timeseries } = await getFailedTransactionRate({ environment, - setup, + apmEventClient, serviceName, searchAggregatedTransactions, start, @@ -154,7 +154,7 @@ async function getFailedTransactionsRateStats({ } async function getTransactionStats({ - setup, + apmEventClient, filter, minutes, searchAggregatedTransactions, @@ -163,8 +163,6 @@ async function getTransactionStats({ intervalString, offsetInMs, }: TaskParameters): Promise<NodeStats['transactionStats']> { - const { apmEventClient } = setup; - const durationField = getDurationFieldForTransactions( searchAggregatedTransactions ); @@ -241,15 +239,13 @@ async function getTransactionStats({ } async function getCpuStats({ - setup, + apmEventClient, filter, intervalString, start, end, offsetInMs, }: TaskParameters): Promise<NodeStats['cpuUsage']> { - const { apmEventClient } = setup; - const response = await apmEventClient.search( 'get_avg_cpu_usage_for_service_map_node', { @@ -295,7 +291,7 @@ async function getCpuStats({ } function getMemoryStats({ - setup, + apmEventClient, filter, intervalString, start, @@ -303,8 +299,6 @@ function getMemoryStats({ offsetInMs, }: TaskParameters) { return withApmSpan('get_memory_stats_for_service_map_node', async () => { - const { apmEventClient } = setup; - const getMemoryUsage = async ({ additionalFilters, script, diff --git a/x-pack/plugins/apm/server/routes/service_map/get_trace_sample_ids.ts b/x-pack/plugins/apm/server/routes/service_map/get_trace_sample_ids.ts index 76d15d06da0b7..2289d3df26485 100644 --- a/x-pack/plugins/apm/server/routes/service_map/get_trace_sample_ids.ts +++ b/x-pack/plugins/apm/server/routes/service_map/get_trace_sample_ids.ts @@ -18,29 +18,30 @@ import { } from '../../../common/elasticsearch_fieldnames'; import { SERVICE_MAP_TIMEOUT_ERROR } from '../../../common/service_map'; import { environmentQuery } from '../../../common/utils/environment_query'; -import { Setup } from '../../lib/helpers/setup_request'; import { serviceGroupQuery } from '../../lib/service_group_query'; import { ServiceGroup } from '../../../common/service_groups'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; +import { APMConfig } from '../..'; const MAX_TRACES_TO_INSPECT = 1000; export async function getTraceSampleIds({ serviceNames, environment, - setup, + config, + apmEventClient, start, end, serviceGroup, }: { serviceNames?: string[]; environment: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; start: number; end: number; serviceGroup: ServiceGroup | null; }) { - const { apmEventClient, config } = setup; - const query = { bool: { filter: [...rangeQuery(start, end), ...serviceGroupQuery(serviceGroup)], diff --git a/x-pack/plugins/apm/server/routes/service_map/route.ts b/x-pack/plugins/apm/server/routes/service_map/route.ts index c2de9bf956a85..1cf4dd40afbcf 100644 --- a/x-pack/plugins/apm/server/routes/service_map/route.ts +++ b/x-pack/plugins/apm/server/routes/service_map/route.ts @@ -13,7 +13,7 @@ import { isActivePlatinumLicense } from '../../../common/license_check'; import { invalidLicenseMessage } from '../../../common/service_map'; import { notifyFeatureUsage } from '../../feature'; import { getSearchTransactionsEvents } from '../../lib/helpers/transactions'; -import { setupRequest } from '../../lib/helpers/setup_request'; +import { getMlClient } from '../../lib/helpers/get_ml_client'; import { getServiceMap } from './get_service_map'; import { getServiceMapDependencyNodeInfo } from './get_service_map_dependency_node_info'; import { getServiceMapServiceNodeInfo } from './get_service_map_service_node_info'; @@ -21,6 +21,7 @@ import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { environmentRt, rangeRt } from '../default_api_types'; import { getServiceGroup } from '../service_groups/get_service_group'; import { offsetRt } from '../../../common/comparison_rt'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const serviceMapRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/service-map', @@ -115,28 +116,32 @@ const serviceMapRoute = createApmServerRoute({ savedObjects: { client: savedObjectsClient }, uiSettings: { client: uiSettingsClient }, } = await context.core; - const [setup, serviceGroup, maxNumberOfServices] = await Promise.all([ - setupRequest(resources), - serviceGroupId - ? getServiceGroup({ - savedObjectsClient, - serviceGroupId, - }) - : Promise.resolve(null), - uiSettingsClient.get<number>(apmServiceGroupMaxNumberOfServices), - ]); + const [mlClient, apmEventClient, serviceGroup, maxNumberOfServices] = + await Promise.all([ + getMlClient(resources), + getApmEventClient(resources), + serviceGroupId + ? getServiceGroup({ + savedObjectsClient, + serviceGroupId, + }) + : Promise.resolve(null), + uiSettingsClient.get<number>(apmServiceGroupMaxNumberOfServices), + ]); const serviceNames = compact([serviceName]); const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, start, end, kuery: '', }); return getServiceMap({ - setup, + mlClient, + config, + apmEventClient, serviceNames, environment, searchAggregatedTransactions, @@ -176,7 +181,7 @@ const serviceMapServiceNodeRoute = createApmServerRoute({ if (!isActivePlatinumLicense(licensingContext.license)) { throw Boom.forbidden(invalidLicenseMessage); } - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { path: { serviceName }, @@ -184,8 +189,8 @@ const serviceMapServiceNodeRoute = createApmServerRoute({ } = params; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, start, end, kuery: '', @@ -193,7 +198,7 @@ const serviceMapServiceNodeRoute = createApmServerRoute({ const commonProps = { environment, - setup, + apmEventClient, serviceName, searchAggregatedTransactions, start, @@ -239,13 +244,19 @@ const serviceMapDependencyNodeRoute = createApmServerRoute({ if (!isActivePlatinumLicense(licensingContext.license)) { throw Boom.forbidden(invalidLicenseMessage); } - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { query: { dependencyName, environment, start, end, offset }, } = params; - const commonProps = { environment, setup, dependencyName, start, end }; + const commonProps = { + environment, + apmEventClient, + dependencyName, + start, + end, + }; const [currentPeriod, previousPeriod] = await Promise.all([ getServiceMapDependencyNodeInfo(commonProps), diff --git a/x-pack/plugins/apm/server/routes/services/annotations/get_derived_service_annotations.test.ts b/x-pack/plugins/apm/server/routes/services/annotations/get_derived_service_annotations.test.ts index d763f1f913c4d..6c2ce8742dac1 100644 --- a/x-pack/plugins/apm/server/routes/services/annotations/get_derived_service_annotations.test.ts +++ b/x-pack/plugins/apm/server/routes/services/annotations/get_derived_service_annotations.test.ts @@ -26,9 +26,9 @@ describe('getDerivedServiceAnnotations', () => { describe('with 0 versions', () => { it('returns no annotations', async () => { mock = await inspectSearchParams( - (setup) => + ({ mockApmEventClient }) => getDerivedServiceAnnotations({ - setup, + apmEventClient: mockApmEventClient, serviceName: 'foo', environment: 'bar', searchAggregatedTransactions: false, @@ -54,9 +54,9 @@ describe('getDerivedServiceAnnotations', () => { describe('with 1 version', () => { it('returns no annotations', async () => { mock = await inspectSearchParams( - (setup) => + ({ mockApmEventClient }) => getDerivedServiceAnnotations({ - setup, + apmEventClient: mockApmEventClient, serviceName: 'foo', environment: 'bar', searchAggregatedTransactions: false, @@ -87,9 +87,9 @@ describe('getDerivedServiceAnnotations', () => { versionsFirstSeen, ]; mock = await inspectSearchParams( - (setup) => + ({ mockApmEventClient }) => getDerivedServiceAnnotations({ - setup, + apmEventClient: mockApmEventClient, serviceName: 'foo', environment: 'bar', searchAggregatedTransactions: false, diff --git a/x-pack/plugins/apm/server/routes/services/annotations/get_derived_service_annotations.ts b/x-pack/plugins/apm/server/routes/services/annotations/get_derived_service_annotations.ts index a718e9932661e..c98bc9dbeb17b 100644 --- a/x-pack/plugins/apm/server/routes/services/annotations/get_derived_service_annotations.ts +++ b/x-pack/plugins/apm/server/routes/services/annotations/get_derived_service_annotations.ts @@ -18,10 +18,10 @@ import { getDocumentTypeFilterForTransactions, getProcessorEventForTransactions, } from '../../../lib/helpers/transactions'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getDerivedServiceAnnotations({ - setup, + apmEventClient, serviceName, environment, searchAggregatedTransactions, @@ -30,13 +30,11 @@ export async function getDerivedServiceAnnotations({ }: { serviceName: string; environment: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; start: number; end: number; }) { - const { apmEventClient } = setup; - const filter: ESFilter[] = [ { term: { [SERVICE_NAME]: serviceName } }, ...getDocumentTypeFilterForTransactions(searchAggregatedTransactions), diff --git a/x-pack/plugins/apm/server/routes/services/annotations/index.test.ts b/x-pack/plugins/apm/server/routes/services/annotations/index.test.ts index a044648bd7a4f..729a2c16dd65e 100644 --- a/x-pack/plugins/apm/server/routes/services/annotations/index.test.ts +++ b/x-pack/plugins/apm/server/routes/services/annotations/index.test.ts @@ -10,11 +10,11 @@ import { } from '@kbn/observability-plugin/server'; import { ElasticsearchClient, Logger } from '@kbn/core/server'; import { getServiceAnnotations } from '.'; -import { Setup } from '../../../lib/helpers/setup_request'; import * as GetDerivedServiceAnnotations from './get_derived_service_annotations'; import * as GetStoredAnnotations from './get_stored_annotations'; import { Annotation, AnnotationType } from '../../../../common/annotations'; import { errors } from '@elastic/elasticsearch'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; describe('getServiceAnnotations', () => { const storedAnnotations = [ @@ -60,7 +60,7 @@ describe('getServiceAnnotations', () => { client: {} as ElasticsearchClient, logger: {} as Logger, annotationsClient: {} as ScopedAnnotationsClient, - setup: {} as Setup, + apmEventClient: {} as APMEventClient, }); expect(annotations).toEqual({ annotations: storedAnnotations, @@ -96,7 +96,7 @@ describe('getServiceAnnotations', () => { client: {} as ElasticsearchClient, logger: {} as Logger, annotationsClient: {} as ScopedAnnotationsClient, - setup: {} as Setup, + apmEventClient: {} as APMEventClient, }); expect(annotations).toEqual({ annotations: storedAnnotations, @@ -133,7 +133,7 @@ describe('getServiceAnnotations', () => { client: {} as ElasticsearchClient, logger: {} as Logger, annotationsClient: {} as ScopedAnnotationsClient, - setup: {} as Setup, + apmEventClient: {} as APMEventClient, }) ).rejects.toThrow('BOOM'); }); @@ -171,7 +171,7 @@ describe('getServiceAnnotations', () => { client: {} as ElasticsearchClient, logger: {} as Logger, annotationsClient: {} as ScopedAnnotationsClient, - setup: {} as Setup, + apmEventClient: {} as APMEventClient, }); expect(annotations).toEqual({ annotations: [] }); }); @@ -206,7 +206,7 @@ describe('getServiceAnnotations', () => { client: {} as ElasticsearchClient, logger: {} as Logger, annotationsClient: {} as ScopedAnnotationsClient, - setup: {} as Setup, + apmEventClient: {} as APMEventClient, }) ).rejects.toThrow('BOOM'); }); @@ -240,7 +240,7 @@ describe('getServiceAnnotations', () => { client: {} as ElasticsearchClient, logger: {} as Logger, annotationsClient: {} as ScopedAnnotationsClient, - setup: {} as Setup, + apmEventClient: {} as APMEventClient, }); expect(annotations).toEqual({ annotations: storedAnnotations, diff --git a/x-pack/plugins/apm/server/routes/services/annotations/index.ts b/x-pack/plugins/apm/server/routes/services/annotations/index.ts index cc103f2fe6cef..41f199f456d7d 100644 --- a/x-pack/plugins/apm/server/routes/services/annotations/index.ts +++ b/x-pack/plugins/apm/server/routes/services/annotations/index.ts @@ -7,12 +7,12 @@ import { ElasticsearchClient, Logger } from '@kbn/core/server'; import { ScopedAnnotationsClient } from '@kbn/observability-plugin/server'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; import { getDerivedServiceAnnotations } from './get_derived_service_annotations'; import { getStoredAnnotations } from './get_stored_annotations'; export async function getServiceAnnotations({ - setup, + apmEventClient, searchAggregatedTransactions, serviceName, environment, @@ -24,7 +24,7 @@ export async function getServiceAnnotations({ }: { serviceName: string; environment: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; annotationsClient?: ScopedAnnotationsClient; client: ElasticsearchClient; @@ -38,7 +38,7 @@ export async function getServiceAnnotations({ // start fetching derived annotations (based on transactions), but don't wait on it // it will likely be significantly slower than the stored annotations const derivedAnnotationsPromise = getDerivedServiceAnnotations({ - setup, + apmEventClient, serviceName, environment, searchAggregatedTransactions, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_agent.ts b/x-pack/plugins/apm/server/routes/services/get_service_agent.ts index 78b68f3a88ba4..e848dd9befbfb 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_agent.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_agent.ts @@ -12,7 +12,7 @@ import { SERVICE_NAME, SERVICE_RUNTIME_NAME, } from '../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; interface ServiceAgent { agent?: { @@ -27,17 +27,15 @@ interface ServiceAgent { export async function getServiceAgent({ serviceName, - setup, + apmEventClient, start, end, }: { serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; }) { - const { apmEventClient } = setup; - const params = { terminate_after: 1, apm: { diff --git a/x-pack/plugins/apm/server/routes/services/get_service_dependencies.ts b/x-pack/plugins/apm/server/routes/services/get_service_dependencies.ts index cf60502e9861b..e0878a9361f30 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_dependencies.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_dependencies.ts @@ -9,10 +9,10 @@ import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../common/utils/environment_query'; import { getConnectionStats } from '../../lib/connections/get_connection_stats'; import { getConnectionStatsItemsWithRelativeImpact } from '../../lib/connections/get_connection_stats/get_connection_stats_items_with_relative_impact'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServiceDependencies({ - setup, + apmEventClient, start, end, serviceName, @@ -20,7 +20,7 @@ export async function getServiceDependencies({ environment, offset, }: { - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; serviceName: string; @@ -29,7 +29,7 @@ export async function getServiceDependencies({ offset?: string; }) { const statsItems = await getConnectionStats({ - setup, + apmEventClient, start, end, numBuckets, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_dependencies_breakdown.ts b/x-pack/plugins/apm/server/routes/services/get_service_dependencies_breakdown.ts index 4fc7667fa2349..8b940b8525b66 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_dependencies_breakdown.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_dependencies_breakdown.ts @@ -9,18 +9,18 @@ import { kqlQuery } from '@kbn/observability-plugin/server'; import { getNodeName } from '../../../common/connections'; import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../common/utils/environment_query'; -import { Setup } from '../../lib/helpers/setup_request'; import { getConnectionStats } from '../../lib/connections/get_connection_stats'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServiceDependenciesBreakdown({ - setup, + apmEventClient, start, end, serviceName, environment, kuery, }: { - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; serviceName: string; @@ -28,7 +28,7 @@ export async function getServiceDependenciesBreakdown({ kuery: string; }) { const items = await getConnectionStats({ - setup, + apmEventClient, start, end, numBuckets: 100, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instance_metadata_details.ts b/x-pack/plugins/apm/server/routes/services/get_service_instance_metadata_details.ts index c69ea36d3f236..22893a5acefd3 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instance_metadata_details.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instance_metadata_details.ts @@ -12,27 +12,26 @@ import { SERVICE_NAME, SERVICE_NODE_NAME, } from '../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../lib/helpers/setup_request'; import { maybe } from '../../../common/utils/maybe'; import { getDocumentTypeFilterForTransactions, getProcessorEventForTransactions, } from '../../lib/helpers/transactions'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServiceInstanceMetadataDetails({ serviceName, serviceNodeName, - setup, + apmEventClient, start, end, }: { serviceName: string; serviceNodeName: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; }) { - const { apmEventClient } = setup; const filter = [ { term: { [SERVICE_NAME]: serviceName } }, { term: { [SERVICE_NODE_NAME]: serviceNodeName } }, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instances/detailed_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_instances/detailed_statistics.ts index 01e82c6d57c77..2d23345c3ba1b 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instances/detailed_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instances/detailed_statistics.ts @@ -11,15 +11,15 @@ import { Coordinate } from '../../../../typings/timeseries'; import { LatencyAggregationType } from '../../../../common/latency_aggregation_types'; import { joinByKey } from '../../../../common/utils/join_by_key'; import { withApmSpan } from '../../../utils/with_apm_span'; -import { Setup } from '../../../lib/helpers/setup_request'; import { getServiceInstancesSystemMetricStatistics } from './get_service_instances_system_metric_statistics'; import { getServiceInstancesTransactionStatistics } from './get_service_instances_transaction_statistics'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; interface ServiceInstanceDetailedStatisticsParams { environment: string; kuery: string; latencyAggregationType: LatencyAggregationType; - setup: Setup; + apmEventClient: APMEventClient; serviceName: string; transactionType: string; searchAggregatedTransactions: boolean; @@ -67,7 +67,7 @@ export async function getServiceInstancesDetailedStatisticsPeriods({ environment, kuery, latencyAggregationType, - setup, + apmEventClient, serviceName, transactionType, searchAggregatedTransactions, @@ -80,7 +80,7 @@ export async function getServiceInstancesDetailedStatisticsPeriods({ environment: string; kuery: string; latencyAggregationType: LatencyAggregationType; - setup: Setup; + apmEventClient: APMEventClient; serviceName: string; transactionType: string; searchAggregatedTransactions: boolean; @@ -97,7 +97,7 @@ export async function getServiceInstancesDetailedStatisticsPeriods({ environment, kuery, latencyAggregationType, - setup, + apmEventClient, serviceName, transactionType, searchAggregatedTransactions, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts index 7e899f4140c15..71e1b2f7658c1 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts @@ -20,7 +20,7 @@ import { SERVICE_NODE_NAME_MISSING } from '../../../../common/service_nodes'; import { Coordinate } from '../../../../typings/timeseries'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; import { percentCgroupMemoryUsedScript, percentSystemMemoryUsedScript, @@ -48,7 +48,7 @@ export async function getServiceInstancesSystemMetricStatistics< >({ environment, kuery, - setup, + apmEventClient, serviceName, size, start, @@ -58,7 +58,7 @@ export async function getServiceInstancesSystemMetricStatistics< isComparisonSearch, offset, }: { - setup: Setup; + apmEventClient: APMEventClient; serviceName: string; start: number; end: number; @@ -70,8 +70,6 @@ export async function getServiceInstancesSystemMetricStatistics< isComparisonSearch: T; offset?: string; }): Promise<Array<ServiceInstanceSystemMetricStatistics<T>>> { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_transaction_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_transaction_statistics.ts index 464b4c07ec58d..8bff6b47308bc 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_transaction_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_transaction_statistics.ts @@ -27,8 +27,8 @@ import { getLatencyAggregation, getLatencyValue, } from '../../../lib/helpers/latency_aggregation_type'; -import { Setup } from '../../../lib/helpers/setup_request'; import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; interface ServiceInstanceTransactionPrimaryStatistics { serviceNodeName: string; @@ -54,7 +54,7 @@ export async function getServiceInstancesTransactionStatistics< environment, kuery, latencyAggregationType, - setup, + apmEventClient, transactionType, serviceName, size, @@ -67,7 +67,7 @@ export async function getServiceInstancesTransactionStatistics< offset, }: { latencyAggregationType: LatencyAggregationType; - setup: Setup; + apmEventClient: APMEventClient; serviceName: string; transactionType: string; searchAggregatedTransactions: boolean; @@ -81,8 +81,6 @@ export async function getServiceInstancesTransactionStatistics< numBuckets?: number; offset?: string; }): Promise<Array<ServiceInstanceTransactionStatistics<T>>> { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instances/main_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_instances/main_statistics.ts index a09b105cb5a79..095f3c981a689 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instances/main_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instances/main_statistics.ts @@ -8,7 +8,7 @@ import { LatencyAggregationType } from '../../../../common/latency_aggregation_types'; import { joinByKey } from '../../../../common/utils/join_by_key'; import { withApmSpan } from '../../../utils/with_apm_span'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; import { getServiceInstancesSystemMetricStatistics } from './get_service_instances_system_metric_statistics'; import { getServiceInstancesTransactionStatistics } from './get_service_instances_transaction_statistics'; @@ -16,7 +16,7 @@ interface ServiceInstanceMainStatisticsParams { environment: string; kuery: string; latencyAggregationType: LatencyAggregationType; - setup: Setup; + apmEventClient: APMEventClient; serviceName: string; transactionType: string; searchAggregatedTransactions: boolean; diff --git a/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts b/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts index a7014d65b7182..dfe482325035b 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts @@ -28,7 +28,7 @@ import { import { ContainerType } from '../../../common/service_metadata'; import { TransactionRaw } from '../../../typings/es_schemas/raw/transaction_raw'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; import { should } from './get_service_metadata_icons'; type ServiceMetadataDetailsRaw = Pick< @@ -59,6 +59,7 @@ export interface ServiceMetadataDetails { type?: string; functionNames?: string[]; faasTriggerTypes?: string[]; + hostArchitecture?: string; }; cloud?: { provider?: string; @@ -78,19 +79,17 @@ export interface ServiceMetadataDetails { export async function getServiceMetadataDetails({ serviceName, - setup, + apmEventClient, searchAggregatedTransactions, start, end, }: { serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; start: number; end: number; }): Promise<ServiceMetadataDetails> { - const { apmEventClient } = setup; - const filter = [ { term: { [SERVICE_NAME]: serviceName } }, ...rangeQuery(start, end), @@ -104,6 +103,7 @@ export async function getServiceMetadataDetails({ ProcessorEvent.metric, ], }, + sort: [{ '@timestamp': { order: 'desc' as const } }], body: { track_total_hits: 1, size: 1, @@ -214,6 +214,7 @@ export async function getServiceMetadataDetails({ faasTriggerTypes: response.aggregations?.faasTriggerTypes.buckets.map( (bucket) => bucket.key as string ), + hostArchitecture: host?.architecture, } : undefined; diff --git a/x-pack/plugins/apm/server/routes/services/get_service_metadata_icons.ts b/x-pack/plugins/apm/server/routes/services/get_service_metadata_icons.ts index 7cf5304ded844..6b6ee0489ad19 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_metadata_icons.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_metadata_icons.ts @@ -20,7 +20,7 @@ import { import { ContainerType } from '../../../common/service_metadata'; import { TransactionRaw } from '../../../typings/es_schemas/raw/transaction_raw'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; type ServiceMetadataIconsRaw = Pick< TransactionRaw, @@ -44,19 +44,17 @@ export const should = [ export async function getServiceMetadataIcons({ serviceName, - setup, + apmEventClient, searchAggregatedTransactions, start, end, }: { serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; start: number; end: number; }): Promise<ServiceMetadataIcons> { - const { apmEventClient } = setup; - const filter = [ { term: { [SERVICE_NAME]: serviceName } }, ...rangeQuery(start, end), diff --git a/x-pack/plugins/apm/server/routes/services/get_service_node_metadata.ts b/x-pack/plugins/apm/server/routes/services/get_service_node_metadata.ts index 7a8e786c2912b..f85bed4b77bba 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_node_metadata.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_node_metadata.ts @@ -7,7 +7,6 @@ import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { Setup } from '../../lib/helpers/setup_request'; import { HOST_NAME, CONTAINER_ID, @@ -21,25 +20,25 @@ import { environmentQuery, serviceNodeNameQuery, } from '../../../common/utils/environment_query'; -import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServiceNodeMetadata({ kuery, serviceName, serviceNodeName, - setup, + apmEventClient, start, end, + environment, }: { kuery: string; serviceName: string; serviceNodeName: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; + environment: string; }) { - const { apmEventClient } = setup; - const params = { apm: { events: [ProcessorEvent.metric], @@ -52,7 +51,7 @@ export async function getServiceNodeMetadata({ filter: [ { term: { [SERVICE_NAME]: serviceName } }, ...rangeQuery(start, end), - ...environmentQuery(ENVIRONMENT_ALL.value), + ...environmentQuery(environment), ...kqlQuery(kuery), ...serviceNodeNameQuery(serviceNodeName), ], diff --git a/x-pack/plugins/apm/server/routes/services/get_service_transaction_group_detailed_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_transaction_group_detailed_statistics.ts index df02ba0647483..5e8c5b0cc1c55 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_transaction_group_detailed_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_transaction_group_detailed_statistics.ts @@ -28,16 +28,16 @@ import { getLatencyAggregation, getLatencyValue, } from '../../lib/helpers/latency_aggregation_type'; -import { Setup } from '../../lib/helpers/setup_request'; import { calculateFailedTransactionRate } from '../../lib/helpers/transaction_error_rate'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServiceTransactionGroupDetailedStatistics({ environment, kuery, serviceName, transactionNames, - setup, + apmEventClient, numBuckets, searchAggregatedTransactions, transactionType, @@ -50,7 +50,7 @@ export async function getServiceTransactionGroupDetailedStatistics({ kuery: string; serviceName: string; transactionNames: string[]; - setup: Setup; + apmEventClient: APMEventClient; numBuckets: number; searchAggregatedTransactions: boolean; transactionType: string; @@ -67,8 +67,6 @@ export async function getServiceTransactionGroupDetailedStatistics({ impact: number; }> > { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, @@ -185,7 +183,7 @@ export async function getServiceTransactionGroupDetailedStatistics({ export async function getServiceTransactionGroupDetailedStatisticsPeriods({ serviceName, transactionNames, - setup, + apmEventClient, numBuckets, searchAggregatedTransactions, transactionType, @@ -198,7 +196,7 @@ export async function getServiceTransactionGroupDetailedStatisticsPeriods({ }: { serviceName: string; transactionNames: string[]; - setup: Setup; + apmEventClient: APMEventClient; numBuckets: number; searchAggregatedTransactions: boolean; transactionType: string; @@ -210,7 +208,7 @@ export async function getServiceTransactionGroupDetailedStatisticsPeriods({ offset?: string; }) { const commonProps = { - setup, + apmEventClient, serviceName, transactionNames, searchAggregatedTransactions, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_transaction_groups.ts b/x-pack/plugins/apm/server/routes/services/get_service_transaction_groups.ts index 4a589f96b68f1..7b828d91af9a0 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_transaction_groups.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_transaction_groups.ts @@ -25,8 +25,9 @@ import { getLatencyAggregation, getLatencyValue, } from '../../lib/helpers/latency_aggregation_type'; -import { Setup } from '../../lib/helpers/setup_request'; import { calculateFailedTransactionRate } from '../../lib/helpers/transaction_error_rate'; +import { APMConfig } from '../..'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export type ServiceOverviewTransactionGroupSortField = | 'name' @@ -39,7 +40,8 @@ export async function getServiceTransactionGroups({ environment, kuery, serviceName, - setup, + config, + apmEventClient, searchAggregatedTransactions, transactionType, latencyAggregationType, @@ -49,14 +51,14 @@ export async function getServiceTransactionGroups({ environment: string; kuery: string; serviceName: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; transactionType: string; latencyAggregationType: LatencyAggregationType; start: number; end: number; }) { - const { apmEventClient, config } = setup; const bucketSize = config.ui.transactionGroupBucketSize; const field = getDurationFieldForTransactions(searchAggregatedTransactions); diff --git a/x-pack/plugins/apm/server/routes/services/get_service_transaction_types.ts b/x-pack/plugins/apm/server/routes/services/get_service_transaction_types.ts index 73d53a24d4f24..1081c35b7eb70 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_transaction_types.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_transaction_types.ts @@ -10,27 +10,25 @@ import { SERVICE_NAME, TRANSACTION_TYPE, } from '../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; import { getDocumentTypeFilterForTransactions, getProcessorEventForTransactions, } from '../../lib/helpers/transactions'; export async function getServiceTransactionTypes({ - setup, + apmEventClient, serviceName, searchAggregatedTransactions, start, end, }: { serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; start: number; end: number; }) { - const { apmEventClient } = setup; - const params = { apm: { events: [getProcessorEventForTransactions(searchAggregatedTransactions)], diff --git a/x-pack/plugins/apm/server/routes/services/get_services/get_health_statuses.ts b/x-pack/plugins/apm/server/routes/services/get_services/get_health_statuses.ts index 4fc1636deda2f..1c3ed953122a0 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/get_health_statuses.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/get_health_statuses.ts @@ -10,30 +10,30 @@ import { getServiceHealthStatus, ServiceHealthStatus, } from '../../../../common/service_health_status'; +import { MlClient } from '../../../lib/helpers/get_ml_client'; import { getServiceAnomalies } from '../../service_map/get_service_anomalies'; -import { ServicesItemsSetup } from './get_services_items'; interface AggregationParams { environment: string; - setup: ServicesItemsSetup; + mlClient?: MlClient; start: number; end: number; } export const getHealthStatuses = async ({ environment, - setup, + mlClient, start, end, }: AggregationParams): Promise< Array<{ serviceName: string; healthStatus: ServiceHealthStatus }> > => { - if (!setup.ml) { + if (!mlClient) { return []; } const anomalies = await getServiceAnomalies({ - setup, + mlClient, environment, start, end, diff --git a/x-pack/plugins/apm/server/routes/services/get_services/get_service_aggregated_transaction_stats.ts b/x-pack/plugins/apm/server/routes/services/get_services/get_service_aggregated_transaction_stats.ts index d7282dfd2db85..73436ad9afb67 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/get_service_aggregated_transaction_stats.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/get_service_aggregated_transaction_stats.ts @@ -24,15 +24,15 @@ import { environmentQuery } from '../../../../common/utils/environment_query'; import { AgentName } from '../../../../typings/es_schemas/ui/fields/agent'; import { calculateThroughputWithRange } from '../../../lib/helpers/calculate_throughput'; import { calculateFailedTransactionRateFromServiceMetrics } from '../../../lib/helpers/transaction_error_rate'; -import { ServicesItemsSetup } from './get_services_items'; import { serviceGroupQuery } from '../../../lib/service_group_query'; import { ServiceGroup } from '../../../../common/service_groups'; import { RandomSampler } from '../../../lib/helpers/get_random_sampler'; import { getDocumentTypeFilterForServiceMetrics } from '../../../lib/helpers/service_metrics'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; interface AggregationParams { environment: string; kuery: string; - setup: ServicesItemsSetup; + apmEventClient: APMEventClient; maxNumServices: number; start: number; end: number; @@ -43,15 +43,13 @@ interface AggregationParams { export async function getServiceAggregatedTransactionStats({ environment, kuery, - setup, + apmEventClient, maxNumServices, start, end, serviceGroup, randomSampler, }: AggregationParams) { - const { apmEventClient } = setup; - const response = await apmEventClient.search( 'get_service_aggregated_transaction_stats', { diff --git a/x-pack/plugins/apm/server/routes/services/get_services/get_service_transaction_stats.ts b/x-pack/plugins/apm/server/routes/services/get_services/get_service_transaction_stats.ts index 0d0d831b61a1e..ba5903133e445 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/get_service_transaction_stats.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/get_service_transaction_stats.ts @@ -28,15 +28,15 @@ import { calculateFailedTransactionRate, getOutcomeAggregation, } from '../../../lib/helpers/transaction_error_rate'; -import { ServicesItemsSetup } from './get_services_items'; import { serviceGroupQuery } from '../../../lib/service_group_query'; import { ServiceGroup } from '../../../../common/service_groups'; import { RandomSampler } from '../../../lib/helpers/get_random_sampler'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; interface AggregationParams { environment: string; kuery: string; - setup: ServicesItemsSetup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; maxNumServices: number; start: number; @@ -48,7 +48,7 @@ interface AggregationParams { export async function getServiceTransactionStats({ environment, kuery, - setup, + apmEventClient, searchAggregatedTransactions, maxNumServices, start, @@ -56,8 +56,6 @@ export async function getServiceTransactionStats({ serviceGroup, randomSampler, }: AggregationParams) { - const { apmEventClient } = setup; - const outcomes = getOutcomeAggregation(); const metrics = { diff --git a/x-pack/plugins/apm/server/routes/services/get_services/get_services_from_error_and_metric_documents.ts b/x-pack/plugins/apm/server/routes/services/get_services/get_services_from_error_and_metric_documents.ts index 92cb6396856d8..7ae1698b988dd 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/get_services_from_error_and_metric_documents.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/get_services_from_error_and_metric_documents.ts @@ -14,14 +14,14 @@ import { SERVICE_NAME, } from '../../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../../common/utils/environment_query'; -import { Setup } from '../../../lib/helpers/setup_request'; import { serviceGroupQuery } from '../../../lib/service_group_query'; import { ServiceGroup } from '../../../../common/service_groups'; import { RandomSampler } from '../../../lib/helpers/get_random_sampler'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServicesFromErrorAndMetricDocuments({ environment, - setup, + apmEventClient, maxNumServices, kuery, start, @@ -29,7 +29,7 @@ export async function getServicesFromErrorAndMetricDocuments({ serviceGroup, randomSampler, }: { - setup: Setup; + apmEventClient: APMEventClient; environment: string; maxNumServices: number; kuery: string; @@ -38,8 +38,6 @@ export async function getServicesFromErrorAndMetricDocuments({ serviceGroup: ServiceGroup | null; randomSampler: RandomSampler; }) { - const { apmEventClient } = setup; - const response = await apmEventClient.search( 'get_services_from_error_and_metric_documents', { diff --git a/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts b/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts index 7ee41a2bea0e0..b72ab6f286005 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts @@ -7,7 +7,7 @@ import { Logger } from '@kbn/logging'; import { withApmSpan } from '../../../utils/with_apm_span'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { MlClient } from '../../../lib/helpers/get_ml_client'; import { getHealthStatuses } from './get_health_statuses'; import { getServicesFromErrorAndMetricDocuments } from './get_services_from_error_and_metric_documents'; import { getServiceTransactionStats } from './get_service_transaction_stats'; @@ -15,15 +15,15 @@ import { getServiceAggregatedTransactionStats } from './get_service_aggregated_t import { mergeServiceStats } from './merge_service_stats'; import { ServiceGroup } from '../../../../common/service_groups'; import { RandomSampler } from '../../../lib/helpers/get_random_sampler'; - -export type ServicesItemsSetup = Setup; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; const MAX_NUMBER_OF_SERVICES = 500; export async function getServicesItems({ environment, kuery, - setup, + mlClient, + apmEventClient, searchAggregatedTransactions, searchAggregatedServiceMetrics, logger, @@ -34,7 +34,8 @@ export async function getServicesItems({ }: { environment: string; kuery: string; - setup: ServicesItemsSetup; + mlClient?: MlClient; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; searchAggregatedServiceMetrics: boolean; logger: Logger; @@ -44,10 +45,9 @@ export async function getServicesItems({ randomSampler: RandomSampler; }) { return withApmSpan('get_services_items', async () => { - const params = { + const commonParams = { environment, kuery, - setup, searchAggregatedTransactions, searchAggregatedServiceMetrics, maxNumServices: MAX_NUMBER_OF_SERVICES, @@ -63,10 +63,19 @@ export async function getServicesItems({ healthStatuses, ] = await Promise.all([ searchAggregatedServiceMetrics - ? getServiceAggregatedTransactionStats(params) - : getServiceTransactionStats(params), - getServicesFromErrorAndMetricDocuments(params), - getHealthStatuses(params).catch((err) => { + ? getServiceAggregatedTransactionStats({ + ...commonParams, + apmEventClient, + }) + : getServiceTransactionStats({ + ...commonParams, + apmEventClient, + }), + getServicesFromErrorAndMetricDocuments({ + ...commonParams, + apmEventClient, + }), + getHealthStatuses({ ...commonParams, mlClient }).catch((err) => { logger.error(err); return []; }), diff --git a/x-pack/plugins/apm/server/routes/services/get_services/get_sorted_and_filtered_services.ts b/x-pack/plugins/apm/server/routes/services/get_services/get_sorted_and_filtered_services.ts index a006c5b02509d..dff072cfc05f6 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/get_sorted_and_filtered_services.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/get_sorted_and_filtered_services.ts @@ -7,17 +7,52 @@ import { Logger } from '@kbn/logging'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; import { SERVICE_NAME } from '../../../../common/elasticsearch_fieldnames'; import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { Environment } from '../../../../common/environment_rt'; import { joinByKey } from '../../../../common/utils/join_by_key'; import { ServiceGroup } from '../../../../common/service_groups'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { MlClient } from '../../../lib/helpers/get_ml_client'; import { getHealthStatuses } from './get_health_statuses'; import { lookupServices } from '../../service_groups/lookup_services'; +export async function getServiceNamesFromTermsEnum({ + apmEventClient, + environment, + maxNumberOfServices, +}: { + apmEventClient: APMEventClient; + environment: Environment; + maxNumberOfServices: number; +}) { + if (environment !== ENVIRONMENT_ALL.value) { + return []; + } + const response = await apmEventClient.termsEnum( + 'get_services_from_terms_enum', + { + apm: { + events: [ + ProcessorEvent.transaction, + ProcessorEvent.span, + ProcessorEvent.metric, + ProcessorEvent.error, + ], + }, + body: { + size: maxNumberOfServices, + field: SERVICE_NAME, + }, + } + ); + + return response.terms; +} + export async function getSortedAndFilteredServices({ - setup, + mlClient, + apmEventClient, start, end, environment, @@ -25,7 +60,8 @@ export async function getSortedAndFilteredServices({ serviceGroup, maxNumberOfServices, }: { - setup: Setup; + mlClient?: MlClient; + apmEventClient: APMEventClient; start: number; end: number; environment: Environment; @@ -33,36 +69,9 @@ export async function getSortedAndFilteredServices({ serviceGroup: ServiceGroup | null; maxNumberOfServices: number; }) { - const { apmEventClient } = setup; - - async function getServiceNamesFromTermsEnum() { - if (environment !== ENVIRONMENT_ALL.value) { - return []; - } - const response = await apmEventClient.termsEnum( - 'get_services_from_terms_enum', - { - apm: { - events: [ - ProcessorEvent.transaction, - ProcessorEvent.span, - ProcessorEvent.metric, - ProcessorEvent.error, - ], - }, - body: { - size: maxNumberOfServices, - field: SERVICE_NAME, - }, - } - ); - - return response.terms; - } - const [servicesWithHealthStatuses, selectedServices] = await Promise.all([ getHealthStatuses({ - setup, + mlClient, start, end, environment, @@ -72,13 +81,17 @@ export async function getSortedAndFilteredServices({ }), serviceGroup ? getServiceNamesFromServiceGroup({ - setup, + apmEventClient, start, end, maxNumberOfServices, serviceGroup, }) - : getServiceNamesFromTermsEnum(), + : getServiceNamesFromTermsEnum({ + apmEventClient, + environment, + maxNumberOfServices, + }), ]); const services = joinByKey( @@ -93,20 +106,20 @@ export async function getSortedAndFilteredServices({ } async function getServiceNamesFromServiceGroup({ - setup, + apmEventClient, start, end, maxNumberOfServices, serviceGroup: { kuery }, }: { - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; maxNumberOfServices: number; serviceGroup: ServiceGroup; }) { const services = await lookupServices({ - setup, + apmEventClient, kuery, start, end, diff --git a/x-pack/plugins/apm/server/routes/services/get_services/index.ts b/x-pack/plugins/apm/server/routes/services/get_services/index.ts index 83932f630357e..d3a3952fff963 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/index.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/index.ts @@ -7,15 +7,17 @@ import { Logger } from '@kbn/logging'; import { withApmSpan } from '../../../utils/with_apm_span'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { MlClient } from '../../../lib/helpers/get_ml_client'; import { getServicesItems } from './get_services_items'; import { ServiceGroup } from '../../../../common/service_groups'; import { RandomSampler } from '../../../lib/helpers/get_random_sampler'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServices({ environment, kuery, - setup, + mlClient, + apmEventClient, searchAggregatedTransactions, searchAggregatedServiceMetrics, logger, @@ -26,7 +28,8 @@ export async function getServices({ }: { environment: string; kuery: string; - setup: Setup; + mlClient?: MlClient; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; searchAggregatedServiceMetrics: boolean; logger: Logger; @@ -39,7 +42,8 @@ export async function getServices({ const items = await getServicesItems({ environment, kuery, - setup, + mlClient, + apmEventClient, searchAggregatedTransactions, searchAggregatedServiceMetrics, logger, diff --git a/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/get_service_aggregated_transaction_detailed_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/get_service_aggregated_transaction_detailed_statistics.ts index 83df6d0773d73..f6ae0b220ee43 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/get_service_aggregated_transaction_detailed_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/get_service_aggregated_transaction_detailed_statistics.ts @@ -24,16 +24,16 @@ import { environmentQuery } from '../../../../common/utils/environment_query'; import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; import { calculateThroughputWithRange } from '../../../lib/helpers/calculate_throughput'; import { getBucketSizeForAggregatedTransactions } from '../../../lib/helpers/get_bucket_size_for_aggregated_transactions'; -import { Setup } from '../../../lib/helpers/setup_request'; import { calculateFailedTransactionRateFromServiceMetrics } from '../../../lib/helpers/transaction_error_rate'; import { RandomSampler } from '../../../lib/helpers/get_random_sampler'; import { getDocumentTypeFilterForServiceMetrics } from '../../../lib/helpers/service_metrics'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServiceAggregatedTransactionDetailedStats({ serviceNames, environment, kuery, - setup, + apmEventClient, searchAggregatedServiceMetrics, offset, start, @@ -43,14 +43,13 @@ export async function getServiceAggregatedTransactionDetailedStats({ serviceNames: string[]; environment: string; kuery: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedServiceMetrics: boolean; offset?: string; start: number; end: number; randomSampler: RandomSampler; }) { - const { apmEventClient } = setup; const { offsetInMs, startWithOffset, endWithOffset } = getOffsetInMs({ start, end, @@ -185,7 +184,7 @@ export async function getServiceAggregatedDetailedStatsPeriods({ serviceNames, environment, kuery, - setup, + apmEventClient, searchAggregatedServiceMetrics, offset, start, @@ -195,7 +194,7 @@ export async function getServiceAggregatedDetailedStatsPeriods({ serviceNames: string[]; environment: string; kuery: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedServiceMetrics: boolean; offset?: string; start: number; @@ -207,7 +206,7 @@ export async function getServiceAggregatedDetailedStatsPeriods({ serviceNames, environment, kuery, - setup, + apmEventClient, searchAggregatedServiceMetrics, start, end, diff --git a/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/get_service_transaction_detailed_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/get_service_transaction_detailed_statistics.ts index c587b3711e58a..fbddad6aa1c42 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/get_service_transaction_detailed_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/get_service_transaction_detailed_statistics.ts @@ -25,18 +25,18 @@ import { } from '../../../lib/helpers/transactions'; import { calculateThroughputWithRange } from '../../../lib/helpers/calculate_throughput'; import { getBucketSizeForAggregatedTransactions } from '../../../lib/helpers/get_bucket_size_for_aggregated_transactions'; -import { Setup } from '../../../lib/helpers/setup_request'; import { calculateFailedTransactionRate, getOutcomeAggregation, } from '../../../lib/helpers/transaction_error_rate'; import { RandomSampler } from '../../../lib/helpers/get_random_sampler'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServiceTransactionDetailedStats({ serviceNames, environment, kuery, - setup, + apmEventClient, searchAggregatedTransactions, offset, start, @@ -46,14 +46,13 @@ export async function getServiceTransactionDetailedStats({ serviceNames: string[]; environment: string; kuery: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; offset?: string; start: number; end: number; randomSampler: RandomSampler; }) { - const { apmEventClient } = setup; const { offsetInMs, startWithOffset, endWithOffset } = getOffsetInMs({ start, end, @@ -182,7 +181,7 @@ export async function getServiceDetailedStatsPeriods({ serviceNames, environment, kuery, - setup, + apmEventClient, searchAggregatedTransactions, offset, start, @@ -192,7 +191,7 @@ export async function getServiceDetailedStatsPeriods({ serviceNames: string[]; environment: string; kuery: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; offset?: string; start: number; @@ -204,7 +203,7 @@ export async function getServiceDetailedStatsPeriods({ serviceNames, environment, kuery, - setup, + apmEventClient, searchAggregatedTransactions, start, end, diff --git a/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/index.ts b/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/index.ts index b142b3484d559..583bb6e938aad 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/index.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services_detailed_statistics/index.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { Setup } from '../../../lib/helpers/setup_request'; import { getServiceDetailedStatsPeriods } from './get_service_transaction_detailed_statistics'; import { getServiceAggregatedDetailedStatsPeriods } from './get_service_aggregated_transaction_detailed_statistics'; import { RandomSampler } from '../../../lib/helpers/get_random_sampler'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getServicesDetailedStatistics({ serviceNames, environment, kuery, - setup, + apmEventClient, searchAggregatedTransactions, searchAggregatedServiceMetrics, offset, @@ -25,7 +25,7 @@ export async function getServicesDetailedStatistics({ serviceNames: string[]; environment: string; kuery: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; searchAggregatedServiceMetrics: boolean; offset?: string; @@ -37,7 +37,7 @@ export async function getServicesDetailedStatistics({ serviceNames, environment, kuery, - setup, + apmEventClient, start, end, randomSampler, diff --git a/x-pack/plugins/apm/server/routes/services/get_throughput.ts b/x-pack/plugins/apm/server/routes/services/get_throughput.ts index a4312b6dca896..5413bcbf56322 100644 --- a/x-pack/plugins/apm/server/routes/services/get_throughput.ts +++ b/x-pack/plugins/apm/server/routes/services/get_throughput.ts @@ -20,16 +20,16 @@ import { getDocumentTypeFilterForTransactions, getProcessorEventForTransactions, } from '../../lib/helpers/transactions'; -import { Setup } from '../../lib/helpers/setup_request'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; import { getBucketSizeForAggregatedTransactions } from '../../lib/helpers/get_bucket_size_for_aggregated_transactions'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; interface Options { environment: string; kuery: string; searchAggregatedTransactions: boolean; serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; transactionType: string; transactionName?: string; start: number; @@ -42,15 +42,13 @@ export async function getThroughput({ kuery, searchAggregatedTransactions, serviceName, - setup, + apmEventClient, transactionType, transactionName, start, end, offset, }: Options) { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, diff --git a/x-pack/plugins/apm/server/routes/services/queries.test.ts b/x-pack/plugins/apm/server/routes/services/queries.test.ts index ff9f79867c2d7..f253fa175545b 100644 --- a/x-pack/plugins/apm/server/routes/services/queries.test.ts +++ b/x-pack/plugins/apm/server/routes/services/queries.test.ts @@ -23,10 +23,10 @@ describe('services queries', () => { }); it('fetches the service agent name', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getServiceAgent({ serviceName: 'foo', - setup, + apmEventClient: mockApmEventClient, start: 0, end: 50000, }) @@ -36,10 +36,10 @@ describe('services queries', () => { }); it('fetches the service transaction types', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getServiceTransactionTypes({ serviceName: 'foo', - setup, + apmEventClient: mockApmEventClient, searchAggregatedTransactions: false, start: 0, end: 50000, @@ -50,9 +50,10 @@ describe('services queries', () => { }); it('fetches the service items', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getServicesItems({ - setup, + mlClient: undefined, + apmEventClient: mockApmEventClient, searchAggregatedTransactions: false, searchAggregatedServiceMetrics: false, logger: {} as any, @@ -74,7 +75,9 @@ describe('services queries', () => { }); it('fetches the agent status', async () => { - mock = await inspectSearchParams((setup) => hasHistoricalAgentData(setup)); + mock = await inspectSearchParams(({ mockApmEventClient }) => + hasHistoricalAgentData(mockApmEventClient) + ); expect(mock.params).toMatchSnapshot(); }); diff --git a/x-pack/plugins/apm/server/routes/services/route.ts b/x-pack/plugins/apm/server/routes/services/route.ts index 1f1cac260331f..071b04faa52e7 100644 --- a/x-pack/plugins/apm/server/routes/services/route.ts +++ b/x-pack/plugins/apm/server/routes/services/route.ts @@ -21,7 +21,7 @@ import { apmServiceGroupMaxNumberOfServices } from '@kbn/observability-plugin/co import { latencyAggregationTypeRt } from '../../../common/latency_aggregation_types'; import { getSearchTransactionsEvents } from '../../lib/helpers/transactions'; import { getServiceInventorySearchSource } from '../../lib/helpers/get_service_inventory_search_source'; -import { setupRequest } from '../../lib/helpers/setup_request'; +import { getMlClient } from '../../lib/helpers/get_ml_client'; import { getServiceAnnotations } from './annotations'; import { getServices } from './get_services'; import { getServiceAgent } from './get_service_agent'; @@ -56,6 +56,7 @@ import { getServiceGroup } from '../service_groups/get_service_group'; import { offsetRt } from '../../../common/comparison_rt'; import { getRandomSampler } from '../../lib/helpers/get_random_sampler'; import { createInfraMetricsClient } from '../../lib/helpers/create_es_client/create_infra_metrics_client/create_infra_metrics_client'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const servicesRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/services', @@ -108,6 +109,7 @@ const servicesRoute = createApmServerRoute({ >; }> { const { + config, context, params, logger, @@ -126,15 +128,15 @@ const servicesRoute = createApmServerRoute({ const savedObjectsClient = (await context.core).savedObjects.client; const coreContext = await resources.context.core; - const [setup, serviceGroup, randomSampler] = await Promise.all([ - setupRequest(resources), - serviceGroupId - ? getServiceGroup({ savedObjectsClient, serviceGroupId }) - : Promise.resolve(null), - getRandomSampler({ security, request, probability }), - ]); - - const { apmEventClient, config } = setup; + const [mlClient, apmEventClient, serviceGroup, randomSampler] = + await Promise.all([ + getMlClient(resources), + getApmEventClient(resources), + serviceGroupId + ? getServiceGroup({ savedObjectsClient, serviceGroupId }) + : Promise.resolve(null), + getRandomSampler({ security, request, probability }), + ]); const serviceMetricsEnabled = await coreContext.uiSettings.client.get<boolean>(enableServiceMetrics); @@ -152,7 +154,8 @@ const servicesRoute = createApmServerRoute({ return getServices({ environment, kuery, - setup, + mlClient, + apmEventClient, searchAggregatedTransactions, searchAggregatedServiceMetrics, logger, @@ -212,6 +215,7 @@ const servicesDetailedStatisticsRoute = createApmServerRoute({ }>; }> => { const { + config, params, request, plugins: { security }, @@ -223,13 +227,11 @@ const servicesDetailedStatisticsRoute = createApmServerRoute({ const { serviceNames } = params.body; - const [setup, randomSampler] = await Promise.all([ - setupRequest(resources), + const [apmEventClient, randomSampler] = await Promise.all([ + getApmEventClient(resources), getRandomSampler({ security, request, probability }), ]); - const { apmEventClient, config } = setup; - const serviceMetricsEnabled = await coreContext.uiSettings.client.get<boolean>(enableServiceMetrics); @@ -250,7 +252,7 @@ const servicesDetailedStatisticsRoute = createApmServerRoute({ return getServicesDetailedStatistics({ environment, kuery, - setup, + apmEventClient, searchAggregatedTransactions, searchAggregatedServiceMetrics, offset, @@ -274,15 +276,15 @@ const serviceMetadataDetailsRoute = createApmServerRoute({ ): Promise< import('./get_service_metadata_details').ServiceMetadataDetails > => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const infraMetricsClient = createInfraMetricsClient(resources); - const { params } = resources; + const { params, config } = resources; const { serviceName } = params.path; const { start, end } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, start, end, kuery: '', @@ -290,7 +292,7 @@ const serviceMetadataDetailsRoute = createApmServerRoute({ const serviceMetadataDetails = await getServiceMetadataDetails({ serviceName, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -321,14 +323,14 @@ const serviceMetadataIconsRoute = createApmServerRoute({ handler: async ( resources ): Promise<import('./get_service_metadata_icons').ServiceMetadataIcons> => { - const setup = await setupRequest(resources); - const { params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, config } = resources; const { serviceName } = params.path; const { start, end } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, start, end, kuery: '', @@ -336,7 +338,7 @@ const serviceMetadataIconsRoute = createApmServerRoute({ return getServiceMetadataIcons({ serviceName, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -359,14 +361,14 @@ const serviceAgentRoute = createApmServerRoute({ | { agentName?: undefined; runtimeName?: undefined } | { agentName: string | undefined; runtimeName: string | undefined } > => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { serviceName } = params.path; const { start, end } = params.query; return getServiceAgent({ serviceName, - setup, + apmEventClient, start, end, }); @@ -383,17 +385,17 @@ const serviceTransactionTypesRoute = createApmServerRoute({ }), options: { tags: ['access:apm'] }, handler: async (resources): Promise<{ transactionTypes: string[] }> => { - const setup = await setupRequest(resources); - const { params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, config } = resources; const { serviceName } = params.path; const { start, end } = params.query; return getServiceTransactionTypes({ serviceName, - setup, + apmEventClient, searchAggregatedTransactions: await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, start, end, kuery: '', @@ -412,24 +414,25 @@ const serviceNodeMetadataRoute = createApmServerRoute({ serviceName: t.string, serviceNodeName: t.string, }), - query: t.intersection([kueryRt, rangeRt]), + query: t.intersection([kueryRt, rangeRt, environmentRt]), }), options: { tags: ['access:apm'] }, handler: async ( resources ): Promise<{ host: string | number; containerId: string | number }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { serviceName, serviceNodeName } = params.path; - const { kuery, start, end } = params.query; + const { kuery, start, end, environment } = params.query; return getServiceNodeMetadata({ kuery, - setup, + apmEventClient, serviceName, serviceNodeName, start, end, + environment, }); }, }); @@ -448,8 +451,8 @@ const serviceAnnotationsRoute = createApmServerRoute({ ): Promise<{ annotations: Array<import('./../../../common/annotations').Annotation>; }> => { - const setup = await setupRequest(resources); - const { params, plugins, context, request, logger } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, plugins, context, request, logger, config } = resources; const { serviceName } = params.path; const { environment, start, end } = params.query; const esClient = (await context.core).elasticsearch.client; @@ -466,8 +469,8 @@ const serviceAnnotationsRoute = createApmServerRoute({ ) : undefined, getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, start, end, kuery: '', @@ -477,7 +480,7 @@ const serviceAnnotationsRoute = createApmServerRoute({ return getServiceAnnotations({ environment, - setup, + apmEventClient, searchAggregatedTransactions, serviceName, annotationsClient, @@ -586,8 +589,8 @@ const serviceThroughputRoute = createApmServerRoute({ y: import('./../../../typings/common').Maybe<number>; }>; }> => { - const setup = await setupRequest(resources); - const { params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, config } = resources; const { serviceName } = params.path; const { environment, @@ -599,7 +602,8 @@ const serviceThroughputRoute = createApmServerRoute({ end, } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + config, + apmEventClient, kuery, start, end, @@ -610,7 +614,7 @@ const serviceThroughputRoute = createApmServerRoute({ kuery, searchAggregatedTransactions, serviceName, - setup, + apmEventClient, transactionType, transactionName, }; @@ -680,8 +684,8 @@ const serviceInstancesMainStatisticsRoute = createApmServerRoute({ memoryUsage?: number | null | undefined; }>; }> => { - const setup = await setupRequest(resources); - const { params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, config } = resources; const { serviceName } = params.path; const { environment, @@ -694,7 +698,8 @@ const serviceInstancesMainStatisticsRoute = createApmServerRoute({ } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + config, + apmEventClient, kuery, start, end, @@ -706,7 +711,7 @@ const serviceInstancesMainStatisticsRoute = createApmServerRoute({ kuery, latencyAggregationType, serviceName, - setup, + apmEventClient, transactionType, searchAggregatedTransactions, start, @@ -719,7 +724,7 @@ const serviceInstancesMainStatisticsRoute = createApmServerRoute({ kuery, latencyAggregationType, serviceName, - setup, + apmEventClient, transactionType, searchAggregatedTransactions, start, @@ -800,8 +805,8 @@ const serviceInstancesDetailedStatisticsRoute = createApmServerRoute({ serviceNodeName: string; }>; }> => { - const setup = await setupRequest(resources); - const { params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, config } = resources; const { serviceName } = params.path; const { environment, @@ -816,7 +821,8 @@ const serviceInstancesDetailedStatisticsRoute = createApmServerRoute({ } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + apmEventClient, + config, kuery, start, end, @@ -827,7 +833,7 @@ const serviceInstancesDetailedStatisticsRoute = createApmServerRoute({ kuery, latencyAggregationType, serviceName, - setup, + apmEventClient, transactionType, searchAggregatedTransactions, numBuckets, @@ -901,7 +907,7 @@ export const serviceInstancesMetadataDetails = createApmServerRoute({ | import('./../../../typings/es_schemas/raw/fields/cloud').Cloud | undefined; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const infraMetricsClient = createInfraMetricsClient(resources); const { params } = resources; const { serviceName, serviceNodeName } = params.path; @@ -909,7 +915,7 @@ export const serviceInstancesMetadataDetails = createApmServerRoute({ const serviceInstanceMetadataDetails = await getServiceInstanceMetadataDetails({ - setup, + apmEventClient, serviceName, serviceNodeName, start, @@ -1002,13 +1008,13 @@ export const serviceDependenciesRoute = createApmServerRoute({ location: import('./../../../common/connections').Node; }>; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { serviceName } = params.path; const { environment, numBuckets, start, end, offset } = params.query; const opts = { - setup, + apmEventClient, start, end, serviceName, @@ -1061,13 +1067,13 @@ export const serviceDependenciesBreakdownRoute = createApmServerRoute({ ): Promise<{ breakdown: Array<{ title: string; data: Array<{ x: number; y: number }> }>; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { serviceName } = params.path; const { environment, start, end, kuery } = params.query; const breakdown = await getServiceDependenciesBreakdown({ - setup, + apmEventClient, start, end, serviceName, @@ -1103,9 +1109,9 @@ const serviceAnomalyChartsRoute = createApmServerRoute({ import('./../../../common/anomaly_detection/service_anomaly_timeseries').ServiceAnomalyTimeseries >; }> => { - const setup = await setupRequest(resources); + const mlClient = await getMlClient(resources); - if (!setup.ml) { + if (!mlClient) { throw Boom.notImplemented(ML_ERRORS.ML_NOT_AVAILABLE); } @@ -1120,7 +1126,7 @@ const serviceAnomalyChartsRoute = createApmServerRoute({ transactionType, start, end, - mlSetup: setup.ml, + mlClient, logger: resources.logger, environment, }); @@ -1177,16 +1183,19 @@ const sortedAndFilteredServicesRoute = createApmServerRoute({ uiSettings: { client: uiSettingsClient }, } = await resources.context.core; - const [setup, serviceGroup, maxNumberOfServices] = await Promise.all([ - setupRequest(resources), - serviceGroupId - ? getServiceGroup({ savedObjectsClient, serviceGroupId }) - : Promise.resolve(null), - uiSettingsClient.get<number>(apmServiceGroupMaxNumberOfServices), - ]); + const [mlClient, apmEventClient, serviceGroup, maxNumberOfServices] = + await Promise.all([ + getMlClient(resources), + getApmEventClient(resources), + serviceGroupId + ? getServiceGroup({ savedObjectsClient, serviceGroupId }) + : Promise.resolve(null), + uiSettingsClient.get<number>(apmServiceGroupMaxNumberOfServices), + ]); return { services: await getSortedAndFilteredServices({ - setup, + mlClient, + apmEventClient, start, end, environment, diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/routes/settings/agent_configuration/__snapshots__/queries.test.ts.snap index 1e2380189dbec..e626209fe75db 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/__snapshots__/queries.test.ts.snap +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/__snapshots__/queries.test.ts.snap @@ -1,88 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`agent configuration queries findExactConfiguration find configuration by service.environment 1`] = ` -Object { - "body": Object { - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "service.name", - }, - }, - ], - }, - }, - Object { - "term": Object { - "service.environment": "bar", - }, - }, - ], - }, - }, - }, - "index": "myIndex", -} -`; +exports[`agent configuration queries findExactConfiguration find configuration by service.environment 1`] = `undefined`; -exports[`agent configuration queries findExactConfiguration find configuration by service.name 1`] = ` -Object { - "body": Object { - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "service.name": "foo", - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "service.environment", - }, - }, - ], - }, - }, - ], - }, - }, - }, - "index": "myIndex", -} -`; +exports[`agent configuration queries findExactConfiguration find configuration by service.name 1`] = `undefined`; -exports[`agent configuration queries findExactConfiguration find configuration by service.name and service.environment 1`] = ` -Object { - "body": Object { - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "service.name": "foo", - }, - }, - Object { - "term": Object { - "service.environment": "bar", - }, - }, - ], - }, - }, - }, - "index": "myIndex", -} -`; +exports[`agent configuration queries findExactConfiguration find configuration by service.name and service.environment 1`] = `undefined`; exports[`agent configuration queries getAllEnvironments fetches all environments 1`] = ` Object { @@ -120,142 +42,10 @@ Object { } `; -exports[`agent configuration queries getExistingEnvironmentsForService fetches unavailable environments 1`] = ` -Object { - "body": Object { - "aggs": Object { - "environments": Object { - "terms": Object { - "field": "service.environment", - "missing": "ALL_OPTION_VALUE", - "size": 50, - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "service.name": "foo", - }, - }, - ], - }, - }, - "size": 0, - }, - "index": "myIndex", -} -`; +exports[`agent configuration queries getExistingEnvironmentsForService fetches unavailable environments 1`] = `undefined`; -exports[`agent configuration queries listConfigurations fetches configurations 1`] = ` -Object { - "index": "myIndex", - "size": 200, -} -`; +exports[`agent configuration queries listConfigurations fetches configurations 1`] = `undefined`; -exports[`agent configuration queries searchConfigurations fetches filtered configurations with an environment 1`] = ` -Object { - "body": Object { - "query": Object { - "bool": Object { - "minimum_should_match": 2, - "should": Array [ - Object { - "constant_score": Object { - "boost": 2, - "filter": Object { - "term": Object { - "service.name": "foo", - }, - }, - }, - }, - Object { - "constant_score": Object { - "boost": 1, - "filter": Object { - "term": Object { - "service.environment": "bar", - }, - }, - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "service.name", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "service.environment", - }, - }, - ], - }, - }, - ], - }, - }, - }, - "index": "myIndex", -} -`; +exports[`agent configuration queries searchConfigurations fetches filtered configurations with an environment 1`] = `undefined`; -exports[`agent configuration queries searchConfigurations fetches filtered configurations without an environment 1`] = ` -Object { - "body": Object { - "query": Object { - "bool": Object { - "minimum_should_match": 2, - "should": Array [ - Object { - "constant_score": Object { - "boost": 2, - "filter": Object { - "term": Object { - "service.name": "foo", - }, - }, - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "service.name", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "service.environment", - }, - }, - ], - }, - }, - ], - }, - }, - }, - "index": "myIndex", -} -`; +exports[`agent configuration queries searchConfigurations fetches filtered configurations without an environment 1`] = `undefined`; diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/create_or_update_configuration.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/create_or_update_configuration.ts index 07a9f79829306..5e7a1551fdc6c 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/create_or_update_configuration.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/create_or_update_configuration.ts @@ -6,27 +6,27 @@ */ import hash from 'object-hash'; -import { Setup } from '../../../lib/helpers/setup_request'; import { AgentConfiguration, AgentConfigurationIntake, } from '../../../../common/agent_configuration/configuration_types'; -import { APMIndexDocumentParams } from '../../../lib/helpers/create_es_client/create_internal_es_client'; +import { + APMIndexDocumentParams, + APMInternalESClient, +} from '../../../lib/helpers/create_es_client/create_internal_es_client'; export function createOrUpdateConfiguration({ configurationId, configurationIntake, - setup, + internalESClient, }: { configurationId?: string; configurationIntake: AgentConfigurationIntake; - setup: Setup; + internalESClient: APMInternalESClient; }) { - const { internalClient, indices } = setup; - const params: APMIndexDocumentParams<AgentConfiguration> = { refresh: true, - index: indices.apmAgentConfigurationIndex, + index: internalESClient.apmIndices.apmAgentConfigurationIndex, body: { agent_name: configurationIntake.agent_name, service: { @@ -45,5 +45,5 @@ export function createOrUpdateConfiguration({ params.id = configurationId; } - return internalClient.index('create_or_update_agent_configuration', params); + return internalESClient.index('create_or_update_agent_configuration', params); } diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/delete_configuration.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/delete_configuration.ts index 5ac8437b15786..58896f40b2ede 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/delete_configuration.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/delete_configuration.ts @@ -5,22 +5,20 @@ * 2.0. */ -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; export async function deleteConfiguration({ configurationId, - setup, + internalESClient, }: { configurationId: string; - setup: Setup; + internalESClient: APMInternalESClient; }) { - const { internalClient, indices } = setup; - const params = { refresh: 'wait_for' as const, - index: indices.apmAgentConfigurationIndex, + index: internalESClient.apmIndices.apmAgentConfigurationIndex, id: configurationId, }; - return internalClient.delete('delete_agent_configuration', params); + return internalESClient.delete('delete_agent_configuration', params); } diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/find_exact_configuration.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/find_exact_configuration.ts index 053f1836c0303..484357be294ae 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/find_exact_configuration.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/find_exact_configuration.ts @@ -11,19 +11,17 @@ import { SERVICE_ENVIRONMENT, SERVICE_NAME, } from '../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; import { convertConfigSettingsToString } from './convert_settings_to_string'; import { getConfigsAppliedToAgentsThroughFleet } from './get_config_applied_to_agent_through_fleet'; export async function findExactConfiguration({ service, - setup, + internalESClient, }: { service: AgentConfiguration['service']; - setup: Setup; + internalESClient: APMInternalESClient; }) { - const { internalClient, indices } = setup; - const serviceNameFilter = service.name ? { term: { [SERVICE_NAME]: service.name } } : { bool: { must_not: [{ exists: { field: SERVICE_NAME } }] } }; @@ -33,7 +31,7 @@ export async function findExactConfiguration({ : { bool: { must_not: [{ exists: { field: SERVICE_ENVIRONMENT } }] } }; const params = { - index: indices.apmAgentConfigurationIndex, + index: internalESClient.apmIndices.apmAgentConfigurationIndex, body: { query: { bool: { filter: [serviceNameFilter, environmentFilter] }, @@ -42,11 +40,11 @@ export async function findExactConfiguration({ }; const [agentConfig, configsAppliedToAgentsThroughFleet] = await Promise.all([ - internalClient.search<AgentConfiguration, typeof params>( + internalESClient.search<AgentConfiguration, typeof params>( 'find_exact_agent_configuration', params ), - getConfigsAppliedToAgentsThroughFleet({ setup }), + getConfigsAppliedToAgentsThroughFleet(internalESClient), ]); const hit = agentConfig.hits.hits[0] as diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_agent_name_by_service.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_agent_name_by_service.ts index f70bd330bfc3e..1ebc98877941f 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_agent_name_by_service.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_agent_name_by_service.ts @@ -6,19 +6,17 @@ */ import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { Setup } from '../../../lib/helpers/setup_request'; import { SERVICE_NAME } from '../../../../common/elasticsearch_fieldnames'; import { AGENT_NAME } from '../../../../common/elasticsearch_fieldnames'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getAgentNameByService({ serviceName, - setup, + apmEventClient, }: { serviceName: string; - setup: Setup; + apmEventClient: APMEventClient; }) { - const { apmEventClient } = setup; - const params = { terminate_after: 1, apm: { diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_config_applied_to_agent_through_fleet.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_config_applied_to_agent_through_fleet.ts index 351c21b43c1e9..1e5099966ea7c 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_config_applied_to_agent_through_fleet.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_config_applied_to_agent_through_fleet.ts @@ -8,17 +8,13 @@ import { termQuery, rangeQuery } from '@kbn/observability-plugin/server'; import datemath from '@kbn/datemath'; import { METRICSET_NAME } from '../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../lib/helpers/setup_request'; - -export async function getConfigsAppliedToAgentsThroughFleet({ - setup, -}: { - setup: Setup; -}) { - const { internalClient, indices } = setup; +import { APMInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; +export async function getConfigsAppliedToAgentsThroughFleet( + internalESClient: APMInternalESClient +) { const params = { - index: indices.metric, + index: internalESClient.apmIndices.metric, size: 0, body: { query: { @@ -43,7 +39,7 @@ export async function getConfigsAppliedToAgentsThroughFleet({ }, }; - const response = await internalClient.search( + const response = await internalESClient.search( 'get_config_applied_to_agent_through_fleet', params ); diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_environments/get_existing_environments_for_service.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_environments/get_existing_environments_for_service.ts index a3925c060a1c5..336a992da7b2c 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_environments/get_existing_environments_for_service.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_environments/get_existing_environments_for_service.ts @@ -5,30 +5,28 @@ * 2.0. */ -import { Setup } from '../../../../lib/helpers/setup_request'; import { SERVICE_NAME, SERVICE_ENVIRONMENT, } from '../../../../../common/elasticsearch_fieldnames'; import { ALL_OPTION_VALUE } from '../../../../../common/agent_configuration/all_option'; +import { APMInternalESClient } from '../../../../lib/helpers/create_es_client/create_internal_es_client'; export async function getExistingEnvironmentsForService({ serviceName, - setup, + internalESClient, size, }: { serviceName: string | undefined; - setup: Setup; + internalESClient: APMInternalESClient; size: number; }) { - const { internalClient, indices } = setup; - const bool = serviceName ? { filter: [{ term: { [SERVICE_NAME]: serviceName } }] } : { must_not: [{ exists: { field: SERVICE_NAME } }] }; const params = { - index: indices.apmAgentConfigurationIndex, + index: internalESClient.apmIndices.apmAgentConfigurationIndex, body: { size: 0, query: { bool }, @@ -44,7 +42,7 @@ export async function getExistingEnvironmentsForService({ }, }; - const resp = await internalClient.search( + const resp = await internalESClient.search( 'get_existing_environments_for_service', params ); diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_environments/index.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_environments/index.ts index 46ab82152caad..298d7d5817388 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_environments/index.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_environments/index.ts @@ -7,18 +7,21 @@ import { withApmSpan } from '../../../../utils/with_apm_span'; import { getAllEnvironments } from '../../../environments/get_all_environments'; -import { Setup } from '../../../../lib/helpers/setup_request'; import { getExistingEnvironmentsForService } from './get_existing_environments_for_service'; import { ALL_OPTION_VALUE } from '../../../../../common/agent_configuration/all_option'; +import { APMEventClient } from '../../../../lib/helpers/create_es_client/create_apm_event_client'; +import { APMInternalESClient } from '../../../../lib/helpers/create_es_client/create_internal_es_client'; export async function getEnvironments({ serviceName, - setup, + internalESClient, + apmEventClient, searchAggregatedTransactions, size, }: { serviceName: string | undefined; - setup: Setup; + internalESClient: APMInternalESClient; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; size: number; }) { @@ -27,10 +30,14 @@ export async function getEnvironments({ getAllEnvironments({ searchAggregatedTransactions, serviceName, - setup, + apmEventClient, + size, + }), + getExistingEnvironmentsForService({ + serviceName, + internalESClient, size, }), - getExistingEnvironmentsForService({ serviceName, setup, size }), ]); return [ALL_OPTION_VALUE, ...allEnvironments].map((environment) => { diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/list_configurations.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/list_configurations.ts index 416cb50c0a801..7f6a5dd20bf0b 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/list_configurations.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/list_configurations.ts @@ -5,25 +5,25 @@ * 2.0. */ -import { Setup } from '../../../lib/helpers/setup_request'; import { AgentConfiguration } from '../../../../common/agent_configuration/configuration_types'; import { convertConfigSettingsToString } from './convert_settings_to_string'; import { getConfigsAppliedToAgentsThroughFleet } from './get_config_applied_to_agent_through_fleet'; +import { APMInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; -export async function listConfigurations({ setup }: { setup: Setup }) { - const { internalClient, indices } = setup; - +export async function listConfigurations( + internalESClient: APMInternalESClient +) { const params = { - index: indices.apmAgentConfigurationIndex, + index: internalESClient.apmIndices.apmAgentConfigurationIndex, size: 200, }; const [agentConfigs, configsAppliedToAgentsThroughFleet] = await Promise.all([ - internalClient.search<AgentConfiguration>( + internalESClient.search<AgentConfiguration>( 'list_agent_configuration', params ), - getConfigsAppliedToAgentsThroughFleet({ setup }), + getConfigsAppliedToAgentsThroughFleet(internalESClient), ]); return agentConfigs.hits.hits diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/mark_applied_by_agent.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/mark_applied_by_agent.ts index 78e0ce68624a6..c104b4743df91 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/mark_applied_by_agent.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/mark_applied_by_agent.ts @@ -5,23 +5,21 @@ * 2.0. */ -import { Setup } from '../../../lib/helpers/setup_request'; import { AgentConfiguration } from '../../../../common/agent_configuration/configuration_types'; +import { APMInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; // We're not wrapping this function with a span as it is not blocking the request export async function markAppliedByAgent({ id, body, - setup, + internalESClient, }: { id: string; body: AgentConfiguration; - setup: Setup; + internalESClient: APMInternalESClient; }) { - const { internalClient, indices } = setup; - const params = { - index: indices.apmAgentConfigurationIndex, + index: internalESClient.apmIndices.apmAgentConfigurationIndex, id, // by specifying the `id` elasticsearch will do an "upsert" body: { ...body, @@ -29,7 +27,7 @@ export async function markAppliedByAgent({ }, }; - return internalClient.index<AgentConfiguration>( + return internalESClient.index<AgentConfiguration>( 'mark_configuration_applied_by_agent', params ); diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/queries.test.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/queries.test.ts index 49a97c1ca4f77..4d2fb4f768ec6 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/queries.test.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/queries.test.ts @@ -24,11 +24,11 @@ describe('agent configuration queries', () => { describe('getAllEnvironments', () => { it('fetches all environments', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getAllEnvironments({ searchAggregatedTransactions: false, serviceName: 'foo', - setup, + apmEventClient: mockApmEventClient, size: 50, }) ); @@ -39,10 +39,10 @@ describe('agent configuration queries', () => { describe('getExistingEnvironmentsForService', () => { it('fetches unavailable environments', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockInternalESClient }) => getExistingEnvironmentsForService({ serviceName: 'foo', - setup, + internalESClient: mockInternalESClient, size: 50, }) ); @@ -53,10 +53,8 @@ describe('agent configuration queries', () => { describe('listConfigurations', () => { it('fetches configurations', async () => { - mock = await inspectSearchParams((setup) => - listConfigurations({ - setup, - }) + mock = await inspectSearchParams(({ mockInternalESClient }) => + listConfigurations(mockInternalESClient) ); expect(mock.params).toMatchSnapshot(); @@ -65,12 +63,12 @@ describe('agent configuration queries', () => { describe('searchConfigurations', () => { it('fetches filtered configurations without an environment', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockInternalESClient }) => searchConfigurations({ service: { name: 'foo', }, - setup, + internalESClient: mockInternalESClient, }) ); @@ -78,13 +76,13 @@ describe('agent configuration queries', () => { }); it('fetches filtered configurations with an environment', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockInternalESClient }) => searchConfigurations({ service: { name: 'foo', environment: 'bar', }, - setup, + internalESClient: mockInternalESClient, }) ); @@ -94,10 +92,10 @@ describe('agent configuration queries', () => { describe('findExactConfiguration', () => { it('find configuration by service.name', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockInternalESClient }) => findExactConfiguration({ service: { name: 'foo' }, - setup, + internalESClient: mockInternalESClient, }) ); @@ -105,10 +103,10 @@ describe('agent configuration queries', () => { }); it('find configuration by service.environment', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockInternalESClient }) => findExactConfiguration({ service: { environment: 'bar' }, - setup, + internalESClient: mockInternalESClient, }) ); @@ -116,10 +114,10 @@ describe('agent configuration queries', () => { }); it('find configuration by service.name and service.environment', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockInternalESClient }) => findExactConfiguration({ service: { name: 'foo', environment: 'bar' }, - setup, + internalESClient: mockInternalESClient, }) ); diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/route.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/route.ts index eb04de4430381..d9fddf51dc737 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/route.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/route.ts @@ -9,7 +9,6 @@ import * as t from 'io-ts'; import Boom from '@hapi/boom'; import { toBooleanRt } from '@kbn/io-ts-utils'; import { maxSuggestions } from '@kbn/observability-plugin/common'; -import { setupRequest } from '../../../lib/helpers/setup_request'; import { createOrUpdateConfiguration } from './create_or_update_configuration'; import { searchConfigurations } from './search_configurations'; import { findExactConfiguration } from './find_exact_configuration'; @@ -25,6 +24,8 @@ import { } from '../../../../common/agent_configuration/runtime_types/agent_configuration_intake_rt'; import { getSearchTransactionsEvents } from '../../../lib/helpers/transactions'; import { syncAgentConfigsToApmPackagePolicies } from '../../fleet/sync_agent_configs_to_apm_package_policies'; +import { getApmEventClient } from '../../../lib/helpers/get_apm_event_client'; +import { createInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; // get list of configurations const agentConfigurationRoute = createApmServerRoute({ @@ -37,9 +38,15 @@ const agentConfigurationRoute = createApmServerRoute({ import('./../../../../common/agent_configuration/configuration_types').AgentConfiguration >; }> => { - const setup = await setupRequest(resources); + const { context, request, params, config } = resources; + const internalESClient = await createInternalESClient({ + context, + request, + debug: params.query._inspect, + config, + }); - const configurations = await listConfigurations({ setup }); + const configurations = await listConfigurations(internalESClient); return { configurations }; }, @@ -57,15 +64,22 @@ const getSingleAgentConfigurationRoute = createApmServerRoute({ ): Promise< import('./../../../../common/agent_configuration/configuration_types').AgentConfiguration > => { - const setup = await setupRequest(resources); - const { params, logger } = resources; - - const { name, environment } = params.query; - + const { params, logger, context, request, config } = resources; + const { name, environment, _inspect } = params.query; const service = { name, environment }; - const config = await findExactConfiguration({ service, setup }); - if (!config) { + const internalESClient = await createInternalESClient({ + context, + request, + debug: _inspect, + config, + }); + const exactConfig = await findExactConfiguration({ + service, + internalESClient, + }); + + if (!exactConfig) { logger.info( `Config was not found for ${service.name}/${service.environment}` ); @@ -73,7 +87,7 @@ const getSingleAgentConfigurationRoute = createApmServerRoute({ throw Boom.notFound(); } - return config; + return exactConfig; }, }); @@ -89,13 +103,28 @@ const deleteAgentConfigurationRoute = createApmServerRoute({ }), }), handler: async (resources): Promise<{ result: string }> => { - const setup = await setupRequest(resources); - const { params, logger, core, telemetryUsageCounter } = resources; - + const { + params, + logger, + core, + telemetryUsageCounter, + context, + request, + config, + } = resources; const { service } = params.body; - const config = await findExactConfiguration({ service, setup }); - if (!config) { + const internalESClient = await createInternalESClient({ + context, + request, + debug: params.query._inspect, + config, + }); + const exactConfig = await findExactConfiguration({ + service, + internalESClient, + }); + if (!exactConfig) { logger.info( `Config was not found for ${service.name}/${service.environment}` ); @@ -104,19 +133,19 @@ const deleteAgentConfigurationRoute = createApmServerRoute({ } logger.info( - `Deleting config ${service.name}/${service.environment} (${config.id})` + `Deleting config ${service.name}/${service.environment} (${exactConfig.id})` ); const deleteConfigurationResult = await deleteConfiguration({ - configurationId: config.id, - setup, + configurationId: exactConfig.id, + internalESClient, }); if (resources.plugins.fleet) { await syncAgentConfigsToApmPackagePolicies({ core, fleetPluginStart: await resources.plugins.fleet.start(), - setup, + internalESClient, telemetryUsageCounter, }); logger.info( @@ -139,41 +168,55 @@ const createOrUpdateAgentConfigurationRoute = createApmServerRoute({ t.type({ body: agentConfigurationIntakeRt }), ]), handler: async (resources): Promise<void> => { - const setup = await setupRequest(resources); - const { params, logger, core, telemetryUsageCounter } = resources; + const { + params, + logger, + core, + telemetryUsageCounter, + context, + request, + config, + } = resources; const { body, query } = params; + const internalESClient = await createInternalESClient({ + context, + request, + debug: params.query._inspect, + config, + }); + // if the config already exists, it is fetched and updated // this is to avoid creating two configs with identical service params - const config = await findExactConfiguration({ + const exactConfig = await findExactConfiguration({ service: body.service, - setup, + internalESClient, }); // if the config exists ?overwrite=true is required - if (config && !query.overwrite) { + if (exactConfig && !query.overwrite) { throw Boom.badRequest( `A configuration already exists for "${body.service.name}/${body.service.environment}. Use ?overwrite=true to overwrite the existing configuration.` ); } logger.info( - `${config ? 'Updating' : 'Creating'} config ${body.service.name}/${ + `${exactConfig ? 'Updating' : 'Creating'} config ${body.service.name}/${ body.service.environment }` ); await createOrUpdateConfiguration({ - configurationId: config?.id, + configurationId: exactConfig?.id, configurationIntake: body, - setup, + internalESClient, }); if (resources.plugins.fleet) { await syncAgentConfigsToApmPackagePolicies({ core, fleetPluginStart: await resources.plugins.fleet.start(), - setup, + internalESClient, telemetryUsageCounter, }); logger.info( @@ -207,7 +250,7 @@ const agentConfigurationSearchRoute = createApmServerRoute({ > | null > => { - const { params, logger } = resources; + const { params, logger, context, config, request } = resources; const { service, @@ -215,13 +258,18 @@ const agentConfigurationSearchRoute = createApmServerRoute({ mark_as_applied_by_agent: markAsAppliedByAgent, } = params.body; - const setup = await setupRequest(resources); - const config = await searchConfigurations({ + const internalESClient = await createInternalESClient({ + context, + request, + debug: params.query._inspect, + config, + }); + const configuration = await searchConfigurations({ service, - setup, + internalESClient, }); - if (!config) { + if (!configuration) { logger.debug( `[Central configuration] Config was not found for ${service.name}/${service.environment}` ); @@ -232,24 +280,28 @@ const agentConfigurationSearchRoute = createApmServerRoute({ // It will be set to true of the etags match or if `markAsAppliedByAgent=true` // `markAsAppliedByAgent=true` means "force setting it to true regardless of etag". This is needed for Jaeger agent that doesn't have etags const willMarkAsApplied = - (markAsAppliedByAgent || etag === config._source.etag) && - !config._source.applied_by_agent; + (markAsAppliedByAgent || etag === configuration._source.etag) && + !configuration._source.applied_by_agent; logger.debug( `[Central configuration] Config was found for: service.name = ${service.name}, service.environment = ${service.environment}, etag (requested) = ${etag}, - etag (existing) = ${config._source.etag}, + etag (existing) = ${configuration._source.etag}, markAsAppliedByAgent = ${markAsAppliedByAgent}, willMarkAsApplied = ${willMarkAsApplied}` ); if (willMarkAsApplied) { - markAppliedByAgent({ id: config._id, body: config._source, setup }); + markAppliedByAgent({ + id: configuration._id, + body: configuration._source, + internalESClient, + }); } - return config; + return configuration; }, }); @@ -269,14 +321,22 @@ const listAgentConfigurationEnvironmentsRoute = createApmServerRoute({ ): Promise<{ environments: Array<{ name: string; alreadyConfigured: boolean }>; }> => { - const setup = await setupRequest(resources); - const { context, params } = resources; + const { context, request, params, config } = resources; + const [internalESClient, apmEventClient] = await Promise.all([ + createInternalESClient({ + context, + request, + debug: params.query._inspect, + config, + }), + getApmEventClient(resources), + ]); const coreContext = await context.core; const { serviceName, start, end } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, kuery: '', start, end, @@ -286,7 +346,8 @@ const listAgentConfigurationEnvironmentsRoute = createApmServerRoute({ ); const environments = await getEnvironments({ serviceName, - setup, + internalESClient, + apmEventClient, searchAggregatedTransactions, size, }); @@ -303,10 +364,13 @@ const agentConfigurationAgentNameRoute = createApmServerRoute({ }), options: { tags: ['access:apm'] }, handler: async (resources): Promise<{ agentName: string | undefined }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { serviceName } = params.query; - const agentName = await getAgentNameByService({ serviceName, setup }); + const agentName = await getAgentNameByService({ + serviceName, + apmEventClient, + }); return { agentName }; }, }); diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/search_configurations.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/search_configurations.ts index 665615d09db09..ea58a92eca7ca 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/search_configurations.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/search_configurations.ts @@ -10,19 +10,17 @@ import { SERVICE_NAME, SERVICE_ENVIRONMENT, } from '../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../lib/helpers/setup_request'; import { AgentConfiguration } from '../../../../common/agent_configuration/configuration_types'; import { convertConfigSettingsToString } from './convert_settings_to_string'; +import { APMInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; export async function searchConfigurations({ service, - setup, + internalESClient, }: { service: AgentConfiguration['service']; - setup: Setup; + internalESClient: APMInternalESClient; }) { - const { internalClient, indices } = setup; - // In the following `constant_score` is being used to disable IDF calculation (where frequency of a term influences scoring). // Additionally a boost has been added to service.name to ensure it scores higher. // If there is tie between a config with a matching service.name and a config with a matching environment, the config that matches service.name wins @@ -49,7 +47,7 @@ export async function searchConfigurations({ : []; const params = { - index: indices.apmAgentConfigurationIndex, + index: internalESClient.apmIndices.apmAgentConfigurationIndex, body: { query: { bool: { @@ -69,7 +67,7 @@ export async function searchConfigurations({ }, }; - const resp = await internalClient.search<AgentConfiguration, typeof params>( + const resp = await internalESClient.search<AgentConfiguration, typeof params>( 'search_agent_configurations', params ); diff --git a/x-pack/plugins/apm/server/routes/settings/anomaly_detection/route.ts b/x-pack/plugins/apm/server/routes/settings/anomaly_detection/route.ts index e30f669b9cd7b..5d0825f55992d 100644 --- a/x-pack/plugins/apm/server/routes/settings/anomaly_detection/route.ts +++ b/x-pack/plugins/apm/server/routes/settings/anomaly_detection/route.ts @@ -13,14 +13,15 @@ import { isActivePlatinumLicense } from '../../../../common/license_check'; import { ML_ERRORS } from '../../../../common/anomaly_detection'; import { createApmServerRoute } from '../../apm_routes/create_apm_server_route'; import { createAnomalyDetectionJobs } from '../../../lib/anomaly_detection/create_anomaly_detection_jobs'; -import { setupRequest } from '../../../lib/helpers/setup_request'; +import { getMlClient } from '../../../lib/helpers/get_ml_client'; import { getAllEnvironments } from '../../environments/get_all_environments'; import { getSearchTransactionsEvents } from '../../../lib/helpers/transactions'; import { notifyFeatureUsage } from '../../../feature'; import { updateToV3 } from './update_to_v3'; import { environmentStringRt } from '../../../../common/environment_rt'; import { getMlJobsWithAPMGroup } from '../../../lib/anomaly_detection/get_ml_jobs_with_apm_group'; - +import { getApmEventClient } from '../../../lib/helpers/get_apm_event_client'; +import { getApmIndices } from '../apm_indices/get_apm_indices'; // get ML anomaly detection jobs for each environment const anomalyDetectionJobsRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/settings/anomaly-detection/jobs', @@ -35,7 +36,7 @@ const anomalyDetectionJobsRoute = createApmServerRoute({ >; hasLegacyJobs: boolean; }> => { - const setup = await setupRequest(resources); + const mlClient = await getMlClient(resources); const { context } = resources; const licensingContext = await context.licensing; @@ -43,11 +44,11 @@ const anomalyDetectionJobsRoute = createApmServerRoute({ throw Boom.forbidden(ML_ERRORS.INVALID_LICENSE); } - if (!setup.ml) { + if (!mlClient) { throw Boom.forbidden(ML_ERRORS.ML_NOT_AVAILABLE); } - const jobs = await getMlJobsWithAPMGroup(setup.ml?.anomalyDetectors); + const jobs = await getMlJobsWithAPMGroup(mlClient?.anomalyDetectors); return { jobs, @@ -68,17 +69,29 @@ const createAnomalyDetectionJobsRoute = createApmServerRoute({ }), }), handler: async (resources): Promise<{ jobCreated: true }> => { - const { params, context, logger } = resources; + const { params, context, logger, config } = resources; const { environments } = params.body; const licensingContext = await context.licensing; - - const setup = await setupRequest(resources); + const coreContext = await context.core; + + const [mlClient, indices] = await Promise.all([ + getMlClient(resources), + getApmIndices({ + savedObjectsClient: coreContext.savedObjects.client, + config, + }), + ]); if (!isActivePlatinumLicense(licensingContext.license)) { throw Boom.forbidden(ML_ERRORS.INVALID_LICENSE); } - await createAnomalyDetectionJobs(setup, environments, logger); + await createAnomalyDetectionJobs({ + mlClient, + indices, + environments, + logger, + }); notifyFeatureUsage({ licensingPlugin: licensingContext, @@ -94,12 +107,12 @@ const anomalyDetectionEnvironmentsRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/settings/anomaly-detection/environments', options: { tags: ['access:apm'] }, handler: async (resources): Promise<{ environments: string[] }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const coreContext = await resources.context.core; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config: resources.config, kuery: '', }); const size = await coreContext.uiSettings.client.get<number>( @@ -108,7 +121,7 @@ const anomalyDetectionEnvironmentsRoute = createApmServerRoute({ const environments = await getAllEnvironments({ includeMissing: true, searchAggregatedTransactions, - setup, + apmEventClient, size, }); @@ -128,20 +141,26 @@ const anomalyDetectionUpdateToV3Route = createApmServerRoute({ ], }, handler: async (resources): Promise<{ update: boolean }> => { - const [setup, esClient] = await Promise.all([ - setupRequest(resources), + const { config, context } = resources; + const coreContext = await context.core; + const [mlClient, esClient, indices] = await Promise.all([ + getMlClient(resources), resources.core .start() .then( (start): ElasticsearchClient => start.elasticsearch.client.asInternalUser ), + getApmIndices({ + config, + savedObjectsClient: coreContext.savedObjects.client, + }), ]); const { logger } = resources; return { - update: await updateToV3({ setup, logger, esClient }), + update: await updateToV3({ mlClient, logger, indices, esClient }), }; }, }); diff --git a/x-pack/plugins/apm/server/routes/settings/anomaly_detection/update_to_v3.ts b/x-pack/plugins/apm/server/routes/settings/anomaly_detection/update_to_v3.ts index 4c0cd118fab2b..47339759d45da 100644 --- a/x-pack/plugins/apm/server/routes/settings/anomaly_detection/update_to_v3.ts +++ b/x-pack/plugins/apm/server/routes/settings/anomaly_detection/update_to_v3.ts @@ -11,19 +11,22 @@ import { ElasticsearchClient } from '@kbn/core/server'; import { JOB_STATE } from '@kbn/ml-plugin/common'; import { createAnomalyDetectionJobs } from '../../../lib/anomaly_detection/create_anomaly_detection_jobs'; import { getAnomalyDetectionJobs } from '../../../lib/anomaly_detection/get_anomaly_detection_jobs'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { MlClient } from '../../../lib/helpers/get_ml_client'; import { withApmSpan } from '../../../utils/with_apm_span'; +import { ApmIndicesConfig } from '../apm_indices/get_apm_indices'; export async function updateToV3({ logger, - setup, + indices, + mlClient, esClient, }: { logger: Logger; - setup: Setup; + mlClient?: MlClient; + indices: ApmIndicesConfig; esClient: ElasticsearchClient; }) { - const allJobs = await getAnomalyDetectionJobs(setup); + const allJobs = await getAnomalyDetectionJobs(mlClient); const v2Jobs = allJobs.filter((job) => job.version === 2); @@ -54,7 +57,7 @@ export async function updateToV3({ ); } - await createAnomalyDetectionJobs(setup, environments, logger); + await createAnomalyDetectionJobs({ mlClient, indices, environments, logger }); return true; } diff --git a/x-pack/plugins/apm/server/routes/settings/apm_indices/get_apm_indices.ts b/x-pack/plugins/apm/server/routes/settings/apm_indices/get_apm_indices.ts index bebb92d6b6445..f80c81d0bd0ef 100644 --- a/x-pack/plugins/apm/server/routes/settings/apm_indices/get_apm_indices.ts +++ b/x-pack/plugins/apm/server/routes/settings/apm_indices/get_apm_indices.ts @@ -6,7 +6,6 @@ */ import { SavedObjectsClient } from '@kbn/core/server'; -import { ApmIndicesConfig } from '@kbn/observability-plugin/common/typings'; import { APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, APM_INDEX_SETTINGS_SAVED_OBJECT_ID, @@ -16,7 +15,16 @@ import { APMRouteHandlerResources } from '../../typings'; import { withApmSpan } from '../../../utils/with_apm_span'; import { APMIndices } from '../../../saved_objects/apm_indices'; -export type { ApmIndicesConfig }; +export type ApmIndicesConfig = Readonly<{ + sourcemap: string; + error: string; + onboarding: string; + span: string; + transaction: string; + metric: string; + apmAgentConfigurationIndex: string; + apmCustomLinkIndex: string; +}>; type ISavedObjectsClient = Pick<SavedObjectsClient, 'get'>; diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link/__snapshots__/list_custom_links.test.ts.snap b/x-pack/plugins/apm/server/routes/settings/custom_link/__snapshots__/list_custom_links.test.ts.snap index bb8f6dcb22902..d05f0bc081eba 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link/__snapshots__/list_custom_links.test.ts.snap +++ b/x-pack/plugins/apm/server/routes/settings/custom_link/__snapshots__/list_custom_links.test.ts.snap @@ -1,90 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`List Custom Links fetches all custom links 1`] = ` -Object { - "body": Object { - "query": Object { - "bool": Object { - "filter": Array [], - }, - }, - "sort": Array [ - Object { - "label.keyword": Object { - "order": "asc", - }, - }, - ], - }, - "index": "myIndex", - "size": 500, -} -`; +exports[`List Custom Links fetches all custom links 1`] = `undefined`; -exports[`List Custom Links filters custom links 1`] = ` -Object { - "body": Object { - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "term": Object { - "service.name": "foo", - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "service.name", - }, - }, - ], - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "term": Object { - "transaction.name": "bar", - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "transaction.name", - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - "sort": Array [ - Object { - "label.keyword": Object { - "order": "asc", - }, - }, - ], - }, - "index": "myIndex", - "size": 500, -} -`; +exports[`List Custom Links filters custom links 1`] = `undefined`; diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link/create_or_update_custom_link.test.ts b/x-pack/plugins/apm/server/routes/settings/custom_link/create_or_update_custom_link.test.ts index 7690210ac0123..f93e1f87b7360 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link/create_or_update_custom_link.test.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link/create_or_update_custom_link.test.ts @@ -5,21 +5,23 @@ * 2.0. */ -import { Setup } from '../../../lib/helpers/setup_request'; import { mockNow } from '../../../utils/test_helpers'; import { CustomLink } from '../../../../common/custom_link/custom_link_types'; import { createOrUpdateCustomLink } from './create_or_update_custom_link'; +import { ApmIndicesConfig } from '../apm_indices/get_apm_indices'; +import { APMInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; describe('Create or Update Custom link', () => { const internalClientIndexMock = jest.fn(); - const mockedSetup = { - internalClient: { - index: internalClientIndexMock, - }, - indices: { - apmCustomLinkIndex: 'apmCustomLinkIndex', - }, - } as unknown as Setup; + + const mockIndices = { + apmCustomLinkIndex: 'apmCustomLinkIndex', + } as unknown as ApmIndicesConfig; + + const mockInternalESClient = { + apmIndices: mockIndices, + index: internalClientIndexMock, + } as unknown as APMInternalESClient; const customLink = { label: 'foo', @@ -38,7 +40,10 @@ describe('Create or Update Custom link', () => { }); it('creates a new custom link', () => { - createOrUpdateCustomLink({ customLink, setup: mockedSetup }); + createOrUpdateCustomLink({ + customLink, + internalESClient: mockInternalESClient, + }); expect(internalClientIndexMock).toHaveBeenCalledWith( 'create_or_update_custom_link', { @@ -58,7 +63,7 @@ describe('Create or Update Custom link', () => { createOrUpdateCustomLink({ customLinkId: 'bar', customLink, - setup: mockedSetup, + internalESClient: mockInternalESClient, }); expect(internalClientIndexMock).toHaveBeenCalledWith( 'create_or_update_custom_link', diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link/create_or_update_custom_link.ts b/x-pack/plugins/apm/server/routes/settings/custom_link/create_or_update_custom_link.ts index 6431390936763..0eaada68ba9b0 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link/create_or_update_custom_link.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link/create_or_update_custom_link.ts @@ -9,24 +9,24 @@ import { CustomLink, CustomLinkES, } from '../../../../common/custom_link/custom_link_types'; -import { Setup } from '../../../lib/helpers/setup_request'; import { toESFormat } from './helper'; -import { APMIndexDocumentParams } from '../../../lib/helpers/create_es_client/create_internal_es_client'; +import { + APMIndexDocumentParams, + APMInternalESClient, +} from '../../../lib/helpers/create_es_client/create_internal_es_client'; export function createOrUpdateCustomLink({ customLinkId, customLink, - setup, + internalESClient, }: { customLinkId?: string; customLink: Omit<CustomLink, '@timestamp'>; - setup: Setup; + internalESClient: APMInternalESClient; }) { - const { internalClient, indices } = setup; - const params: APMIndexDocumentParams<CustomLinkES> = { refresh: true, - index: indices.apmCustomLinkIndex, + index: internalESClient.apmIndices.apmCustomLinkIndex, body: { '@timestamp': Date.now(), ...toESFormat(customLink), @@ -38,5 +38,5 @@ export function createOrUpdateCustomLink({ params.id = customLinkId; } - return internalClient.index('create_or_update_custom_link', params); + return internalESClient.index('create_or_update_custom_link', params); } diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link/delete_custom_link.ts b/x-pack/plugins/apm/server/routes/settings/custom_link/delete_custom_link.ts index 6366bbcfd9f07..53f6b830aa44a 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link/delete_custom_link.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link/delete_custom_link.ts @@ -5,22 +5,20 @@ * 2.0. */ -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; export function deleteCustomLink({ customLinkId, - setup, + internalESClient, }: { customLinkId: string; - setup: Setup; + internalESClient: APMInternalESClient; }) { - const { internalClient, indices } = setup; - const params = { refresh: 'wait_for' as const, - index: indices.apmCustomLinkIndex, + index: internalESClient.apmIndices.apmCustomLinkIndex, id: customLinkId, }; - return internalClient.delete('delete_custom_link', params); + return internalESClient.delete('delete_custom_link', params); } diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.test.ts b/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.test.ts index e6ba932ca58d6..1d3639bbb9f11 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.test.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.test.ts @@ -10,7 +10,6 @@ import { SearchParamsMock, } from '../../../utils/test_helpers'; import { getTransaction } from './get_transaction'; -import { Setup } from '../../../lib/helpers/setup_request'; import { SERVICE_NAME, TRANSACTION_TYPE, @@ -21,18 +20,18 @@ import { describe('custom link get transaction', () => { let mock: SearchParamsMock; it('fetches without filter', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getTransaction({ - setup: setup as unknown as Setup, + apmEventClient: mockApmEventClient, }) ); expect(mock.params).toMatchSnapshot(); }); it('fetches with all filter', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getTransaction({ - setup: setup as unknown as Setup, + apmEventClient: mockApmEventClient, filters: { [SERVICE_NAME]: 'foo', [SERVICE_ENVIRONMENT]: 'bar', diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.ts b/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.ts index 0dfece7bdc34b..d454b447b17f9 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.ts @@ -8,19 +8,17 @@ import * as t from 'io-ts'; import { compact } from 'lodash'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { Setup } from '../../../lib/helpers/setup_request'; import { filterOptionsRt } from './custom_link_types'; import { splitFilterValueByComma } from './helper'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTransaction({ - setup, + apmEventClient, filters = {}, }: { - setup: Setup; + apmEventClient: APMEventClient; filters?: t.TypeOf<typeof filterOptionsRt>; }) { - const { apmEventClient } = setup; - const esFilters = compact( Object.entries(filters) // loops through the filters splitting the value by comma and removing white spaces diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link/list_custom_links.test.ts b/x-pack/plugins/apm/server/routes/settings/custom_link/list_custom_links.test.ts index 8ea4061e46cf2..469b6f8c356b1 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link/list_custom_links.test.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link/list_custom_links.test.ts @@ -10,7 +10,6 @@ import { inspectSearchParams, SearchParamsMock, } from '../../../utils/test_helpers'; -import { Setup } from '../../../lib/helpers/setup_request'; import { SERVICE_NAME, TRANSACTION_NAME, @@ -20,10 +19,8 @@ describe('List Custom Links', () => { let mock: SearchParamsMock; it('fetches all custom links', async () => { - mock = await inspectSearchParams((setup) => - listCustomLinks({ - setup: setup as unknown as Setup, - }) + mock = await inspectSearchParams(({ mockInternalESClient }) => + listCustomLinks({ internalESClient: mockInternalESClient }) ); expect(mock.params).toMatchSnapshot(); @@ -34,10 +31,10 @@ describe('List Custom Links', () => { [SERVICE_NAME]: 'foo', [TRANSACTION_NAME]: 'bar', }; - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockInternalESClient }) => listCustomLinks({ filters, - setup: setup as unknown as Setup, + internalESClient: mockInternalESClient, }) ); diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link/list_custom_links.ts b/x-pack/plugins/apm/server/routes/settings/custom_link/list_custom_links.ts index a64d958dabd09..c435767ffd424 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link/list_custom_links.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link/list_custom_links.ts @@ -11,18 +11,17 @@ import { CustomLink, CustomLinkES, } from '../../../../common/custom_link/custom_link_types'; -import { Setup } from '../../../lib/helpers/setup_request'; import { fromESFormat } from './helper'; import { filterOptionsRt } from './custom_link_types'; +import { APMInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; export async function listCustomLinks({ - setup, + internalESClient, filters = {}, }: { - setup: Setup; + internalESClient: APMInternalESClient; filters?: t.TypeOf<typeof filterOptionsRt>; }): Promise<CustomLink[]> { - const { internalClient, indices } = setup; const esFilters = Object.entries(filters).map(([key, value]) => { return { bool: { @@ -36,7 +35,7 @@ export async function listCustomLinks({ }); const params = { - index: indices.apmCustomLinkIndex, + index: internalESClient.apmIndices.apmCustomLinkIndex, size: 500, body: { query: { @@ -53,7 +52,7 @@ export async function listCustomLinks({ ], }, }; - const resp = await internalClient.search<CustomLinkES>( + const resp = await internalESClient.search<CustomLinkES>( 'list_custom_links', params ); diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link/route.ts b/x-pack/plugins/apm/server/routes/settings/custom_link/route.ts index 1bd6328bdcee5..87087409e3206 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link/route.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link/route.ts @@ -12,13 +12,14 @@ import { isActiveGoldLicense } from '../../../../common/license_check'; import { INVALID_LICENSE } from '../../../../common/custom_link'; import { FILTER_OPTIONS } from '../../../../common/custom_link/custom_link_filter_options'; import { notifyFeatureUsage } from '../../../feature'; -import { setupRequest } from '../../../lib/helpers/setup_request'; import { createOrUpdateCustomLink } from './create_or_update_custom_link'; import { filterOptionsRt, payloadRt } from './custom_link_types'; import { deleteCustomLink } from './delete_custom_link'; import { getTransaction } from './get_transaction'; import { listCustomLinks } from './list_custom_links'; import { createApmServerRoute } from '../../apm_routes/create_apm_server_route'; +import { getApmEventClient } from '../../../lib/helpers/get_apm_event_client'; +import { createInternalESClient } from '../../../lib/helpers/create_es_client/create_internal_es_client'; const customLinkTransactionRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/settings/custom_links/transaction', @@ -31,12 +32,12 @@ const customLinkTransactionRoute = createApmServerRoute({ ): Promise< import('./../../../../typings/es_schemas/ui/transaction').Transaction > => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { query } = params; // picks only the items listed in FILTER_OPTIONS const filters = pick(query, FILTER_OPTIONS); - return await getTransaction({ setup, filters }); + return await getTransaction({ apmEventClient, filters }); }, }); @@ -53,19 +54,28 @@ const listCustomLinksRoute = createApmServerRoute({ import('./../../../../common/custom_link/custom_link_types').CustomLink >; }> => { - const { context, params } = resources; + const { context, params, request, config } = resources; const licensingContext = await context.licensing; if (!isActiveGoldLicense(licensingContext.license)) { throw Boom.forbidden(INVALID_LICENSE); } - const setup = await setupRequest(resources); const { query } = params; + const internalESClient = await createInternalESClient({ + context, + request, + debug: resources.params.query._inspect, + config, + }); + // picks only the items listed in FILTER_OPTIONS const filters = pick(query, FILTER_OPTIONS); - const customLinks = await listCustomLinks({ setup, filters }); + const customLinks = await listCustomLinks({ + internalESClient, + filters, + }); return { customLinks }; }, }); @@ -77,13 +87,19 @@ const createCustomLinkRoute = createApmServerRoute({ }), options: { tags: ['access:apm', 'access:apm_write'] }, handler: async (resources): Promise<void> => { - const { context, params } = resources; + const { context, params, request, config } = resources; const licensingContext = await context.licensing; if (!isActiveGoldLicense(licensingContext.license)) { throw Boom.forbidden(INVALID_LICENSE); } - const setup = await setupRequest(resources); + + const internalESClient = await createInternalESClient({ + context, + request, + debug: resources.params.query._inspect, + config, + }); const customLink = params.body; notifyFeatureUsage({ @@ -91,7 +107,7 @@ const createCustomLinkRoute = createApmServerRoute({ featureName: 'customLinks', }); - await createOrUpdateCustomLink({ customLink, setup }); + await createOrUpdateCustomLink({ customLink, internalESClient }); }, }); @@ -107,13 +123,19 @@ const updateCustomLinkRoute = createApmServerRoute({ tags: ['access:apm', 'access:apm_write'], }, handler: async (resources): Promise<void> => { - const { params, context } = resources; + const { params, context, request, config } = resources; const licensingContext = await context.licensing; if (!isActiveGoldLicense(licensingContext.license)) { throw Boom.forbidden(INVALID_LICENSE); } - const setup = await setupRequest(resources); + + const internalESClient = await createInternalESClient({ + context, + request, + debug: resources.params.query._inspect, + config, + }); const { id } = params.path; const customLink = params.body; @@ -121,7 +143,7 @@ const updateCustomLinkRoute = createApmServerRoute({ await createOrUpdateCustomLink({ customLinkId: id, customLink, - setup, + internalESClient, }); }, }); @@ -137,17 +159,23 @@ const deleteCustomLinkRoute = createApmServerRoute({ tags: ['access:apm', 'access:apm_write'], }, handler: async (resources): Promise<{ result: string }> => { - const { context, params } = resources; + const { context, params, request, config } = resources; const licensingContext = await context.licensing; if (!isActiveGoldLicense(licensingContext.license)) { throw Boom.forbidden(INVALID_LICENSE); } - const setup = await setupRequest(resources); + + const internalESClient = await createInternalESClient({ + context, + request, + debug: resources.params.query._inspect, + config, + }); const { id } = params.path; const res = await deleteCustomLink({ customLinkId: id, - setup, + internalESClient, }); return res; }, diff --git a/x-pack/plugins/apm/server/routes/span_links/get_linked_children.ts b/x-pack/plugins/apm/server/routes/span_links/get_linked_children.ts index 172463ff7cf64..60dfe40f469fb 100644 --- a/x-pack/plugins/apm/server/routes/span_links/get_linked_children.ts +++ b/x-pack/plugins/apm/server/routes/span_links/get_linked_children.ts @@ -18,24 +18,22 @@ import { } from '../../../common/elasticsearch_fieldnames'; import type { SpanRaw } from '../../../typings/es_schemas/raw/span_raw'; import type { TransactionRaw } from '../../../typings/es_schemas/raw/transaction_raw'; -import { Setup } from '../../lib/helpers/setup_request'; import { getBufferedTimerange } from './utils'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; async function fetchLinkedChildrenOfSpan({ traceId, - setup, + apmEventClient, start, end, spanId, }: { traceId: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; spanId?: string; }) { - const { apmEventClient } = setup; - const { startWithBuffer, endWithBuffer } = getBufferedTimerange({ start, end, @@ -83,18 +81,18 @@ function getSpanId(source: TransactionRaw | SpanRaw) { export async function getLinkedChildrenCountBySpanId({ traceId, - setup, + apmEventClient, start, end, }: { traceId: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; }) { const linkedChildren = await fetchLinkedChildrenOfSpan({ traceId, - setup, + apmEventClient, start, end, }); @@ -115,20 +113,20 @@ export async function getLinkedChildrenCountBySpanId({ export async function getLinkedChildrenOfSpan({ traceId, spanId, - setup, + apmEventClient, start, end, }: { traceId: string; spanId: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; }) { const linkedChildren = await fetchLinkedChildrenOfSpan({ traceId, spanId, - setup, + apmEventClient, start, end, }); diff --git a/x-pack/plugins/apm/server/routes/span_links/get_linked_parents.ts b/x-pack/plugins/apm/server/routes/span_links/get_linked_parents.ts index 3bc8d9ef59419..76efb549bc222 100644 --- a/x-pack/plugins/apm/server/routes/span_links/get_linked_parents.ts +++ b/x-pack/plugins/apm/server/routes/span_links/get_linked_parents.ts @@ -15,10 +15,10 @@ import { } from '../../../common/elasticsearch_fieldnames'; import { SpanRaw } from '../../../typings/es_schemas/raw/span_raw'; import { TransactionRaw } from '../../../typings/es_schemas/raw/transaction_raw'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getLinkedParentsOfSpan({ - setup, + apmEventClient, traceId, spanId, start, @@ -27,13 +27,11 @@ export async function getLinkedParentsOfSpan({ }: { traceId: string; spanId: string; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; processorEvent: ProcessorEvent; }) { - const { apmEventClient } = setup; - const response = await apmEventClient.search('get_linked_parents_of_span', { apm: { events: [processorEvent], diff --git a/x-pack/plugins/apm/server/routes/span_links/get_span_links_details.ts b/x-pack/plugins/apm/server/routes/span_links/get_span_links_details.ts index a09d10b422834..c27764e91fbcc 100644 --- a/x-pack/plugins/apm/server/routes/span_links/get_span_links_details.ts +++ b/x-pack/plugins/apm/server/routes/span_links/get_span_links_details.ts @@ -26,24 +26,22 @@ import { SpanLinkDetails } from '../../../common/span_links'; import { SpanLink } from '../../../typings/es_schemas/raw/fields/span_links'; import { SpanRaw } from '../../../typings/es_schemas/raw/span_raw'; import { TransactionRaw } from '../../../typings/es_schemas/raw/transaction_raw'; -import { Setup } from '../../lib/helpers/setup_request'; import { getBufferedTimerange } from './utils'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; async function fetchSpanLinksDetails({ - setup, + apmEventClient, kuery, spanLinks, start, end, }: { - setup: Setup; + apmEventClient: APMEventClient; kuery: string; spanLinks: SpanLink[]; start: number; end: number; }) { - const { apmEventClient } = setup; - const { startWithBuffer, endWithBuffer } = getBufferedTimerange({ start, end, @@ -119,13 +117,13 @@ async function fetchSpanLinksDetails({ } export async function getSpanLinksDetails({ - setup, + apmEventClient, spanLinks, kuery, start, end, }: { - setup: Setup; + apmEventClient: APMEventClient; spanLinks: SpanLink[]; kuery: string; start: number; @@ -140,7 +138,7 @@ export async function getSpanLinksDetails({ const chunkedResponses = await Promise.all( spanLinksChunks.map((spanLinksChunk) => fetchSpanLinksDetails({ - setup, + apmEventClient, kuery, spanLinks: spanLinksChunk, start, diff --git a/x-pack/plugins/apm/server/routes/span_links/route.ts b/x-pack/plugins/apm/server/routes/span_links/route.ts index 34b5864778144..18f361503d374 100644 --- a/x-pack/plugins/apm/server/routes/span_links/route.ts +++ b/x-pack/plugins/apm/server/routes/span_links/route.ts @@ -5,7 +5,6 @@ * 2.0. */ import * as t from 'io-ts'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { getSpanLinksDetails } from './get_span_links_details'; import { getLinkedChildrenOfSpan } from './get_linked_children'; @@ -13,6 +12,7 @@ import { kueryRt, rangeRt } from '../default_api_types'; import { SpanLinkDetails } from '../../../common/span_links'; import { processorEventRt } from '../../../common/processor_event'; import { getLinkedParentsOfSpan } from './get_linked_parents'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const linkedParentsRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/traces/{traceId}/span_links/{spanId}/parents', @@ -36,9 +36,9 @@ const linkedParentsRoute = createApmServerRoute({ const { params: { query, path }, } = resources; - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const linkedParents = await getLinkedParentsOfSpan({ - setup, + apmEventClient, traceId: path.traceId, spanId: path.spanId, start: query.start, @@ -48,7 +48,7 @@ const linkedParentsRoute = createApmServerRoute({ return { spanLinksDetails: await getSpanLinksDetails({ - setup, + apmEventClient, spanLinks: linkedParents, kuery: query.kuery, start: query.start, @@ -76,9 +76,9 @@ const linkedChildrenRoute = createApmServerRoute({ const { params: { query, path }, } = resources; - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const linkedChildren = await getLinkedChildrenOfSpan({ - setup, + apmEventClient, traceId: path.traceId, spanId: path.spanId, start: query.start, @@ -87,7 +87,7 @@ const linkedChildrenRoute = createApmServerRoute({ return { spanLinksDetails: await getSpanLinksDetails({ - setup, + apmEventClient, spanLinks: linkedChildren, kuery: query.kuery, start: query.start, diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/get_service_statistics.ts b/x-pack/plugins/apm/server/routes/storage_explorer/get_service_statistics.ts index 169bff0cd7113..25a3ad5431fa5 100644 --- a/x-pack/plugins/apm/server/routes/storage_explorer/get_service_statistics.ts +++ b/x-pack/plugins/apm/server/routes/storage_explorer/get_service_statistics.ts @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { termQuery, kqlQuery, @@ -12,7 +11,6 @@ import { } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { ApmPluginRequestHandlerContext } from '../typings'; -import { Setup } from '../../lib/helpers/setup_request'; import { IndexLifecyclePhaseSelectOption, indexLifeCyclePhaseToDataTier, @@ -34,9 +32,10 @@ import { getEstimatedSizeForDocumentsInIndex, } from './indices_stats_helpers'; import { RandomSampler } from '../../lib/helpers/get_random_sampler'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; async function getMainServiceStatistics({ - setup, + apmEventClient, context, indexLifecyclePhase, randomSampler, @@ -45,7 +44,7 @@ async function getMainServiceStatistics({ environment, kuery, }: { - setup: Setup; + apmEventClient: APMEventClient; context: ApmPluginRequestHandlerContext; indexLifecyclePhase: IndexLifecyclePhaseSelectOption; randomSampler: RandomSampler; @@ -54,10 +53,8 @@ async function getMainServiceStatistics({ environment: string; kuery: string; }) { - const { apmEventClient } = setup; - const [{ indices: allIndicesStats }, response] = await Promise.all([ - getTotalIndicesStats({ context, setup }), + getTotalIndicesStats({ context, apmEventClient }), apmEventClient.search('get_main_service_statistics', { apm: { events: [ @@ -82,7 +79,7 @@ async function getMainServiceStatistics({ indexLifeCyclePhaseToDataTier[indexLifecyclePhase] ) : []), - ] as QueryDslQueryContainer[], + ], }, }, aggs: { @@ -176,7 +173,7 @@ async function getMainServiceStatistics({ } export async function getServiceStatistics({ - setup, + apmEventClient, context, indexLifecyclePhase, randomSampler, @@ -186,7 +183,7 @@ export async function getServiceStatistics({ kuery, searchAggregatedTransactions, }: { - setup: Setup; + apmEventClient: APMEventClient; context: ApmPluginRequestHandlerContext; indexLifecyclePhase: IndexLifecyclePhaseSelectOption; randomSampler: RandomSampler; @@ -199,7 +196,7 @@ export async function getServiceStatistics({ const [docCountPerProcessorEvent, totalTransactionsPerService] = await Promise.all([ getMainServiceStatistics({ - setup, + apmEventClient, context, indexLifecyclePhase, randomSampler, @@ -209,7 +206,7 @@ export async function getServiceStatistics({ end, }), getTotalTransactionsPerService({ - setup, + apmEventClient, searchAggregatedTransactions, indexLifecyclePhase, randomSampler, diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/get_size_timeseries.ts b/x-pack/plugins/apm/server/routes/storage_explorer/get_size_timeseries.ts index f513efe059f71..56c7085a1bdc4 100644 --- a/x-pack/plugins/apm/server/routes/storage_explorer/get_size_timeseries.ts +++ b/x-pack/plugins/apm/server/routes/storage_explorer/get_size_timeseries.ts @@ -17,7 +17,6 @@ import { INDEX, } from '../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../common/utils/environment_query'; -import { Setup } from '../../lib/helpers/setup_request'; import { getBucketSizeForAggregatedTransactions } from '../../lib/helpers/get_bucket_size_for_aggregated_transactions'; import { IndexLifecyclePhaseSelectOption, @@ -29,11 +28,12 @@ import { getTotalIndicesStats, getEstimatedSizeForDocumentsInIndex, } from './indices_stats_helpers'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getSizeTimeseries({ environment, kuery, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -43,7 +43,7 @@ export async function getSizeTimeseries({ }: { environment: string; kuery: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; start: number; end: number; @@ -51,8 +51,6 @@ export async function getSizeTimeseries({ randomSampler: RandomSampler; context: ApmPluginRequestHandlerContext; }) { - const { apmEventClient } = setup; - const { intervalString } = getBucketSizeForAggregatedTransactions({ start, end, @@ -60,7 +58,7 @@ export async function getSizeTimeseries({ }); const [{ indices: allIndicesStats }, res] = await Promise.all([ - getTotalIndicesStats({ setup, context }), + getTotalIndicesStats({ apmEventClient, context }), apmEventClient.search('get_storage_timeseries', { apm: { events: [ diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/get_storage_details_per_processor_event.ts b/x-pack/plugins/apm/server/routes/storage_explorer/get_storage_details_per_processor_event.ts deleted file mode 100644 index 8f92ce9d93809..0000000000000 --- a/x-pack/plugins/apm/server/routes/storage_explorer/get_storage_details_per_processor_event.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. - */ - -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { - termQuery, - kqlQuery, - rangeQuery, -} from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { Setup } from '../../lib/helpers/setup_request'; -import { - PROCESSOR_EVENT, - SERVICE_NAME, - TIER, - INDEX, -} from '../../../common/elasticsearch_fieldnames'; -import { - IndexLifecyclePhaseSelectOption, - indexLifeCyclePhaseToDataTier, -} from '../../../common/storage_explorer_types'; -import { environmentQuery } from '../../../common/utils/environment_query'; -import { ApmPluginRequestHandlerContext } from '../typings'; -import { - getTotalIndicesStats, - getEstimatedSizeForDocumentsInIndex, -} from './indices_stats_helpers'; -import { RandomSampler } from '../../lib/helpers/get_random_sampler'; - -export async function getStorageDetailsPerProcessorEvent({ - setup, - context, - indexLifecyclePhase, - randomSampler, - start, - end, - environment, - kuery, - serviceName, -}: { - setup: Setup; - context: ApmPluginRequestHandlerContext; - indexLifecyclePhase: IndexLifecyclePhaseSelectOption; - randomSampler: RandomSampler; - start: number; - end: number; - environment: string; - kuery: string; - serviceName: string; -}) { - const { apmEventClient } = setup; - - const [{ indices: allIndicesStats }, response] = await Promise.all([ - getTotalIndicesStats({ setup, context }), - apmEventClient.search('get_storage_details_per_processor_event', { - apm: { - events: [ - ProcessorEvent.span, - ProcessorEvent.transaction, - ProcessorEvent.error, - ProcessorEvent.metric, - ], - }, - body: { - size: 0, - track_total_hits: false, - query: { - bool: { - filter: [ - ...environmentQuery(environment), - ...kqlQuery(kuery), - ...rangeQuery(start, end), - ...termQuery(SERVICE_NAME, serviceName), - ...(indexLifecyclePhase !== IndexLifecyclePhaseSelectOption.All - ? termQuery( - TIER, - indexLifeCyclePhaseToDataTier[indexLifecyclePhase] - ) - : []), - ] as QueryDslQueryContainer[], - }, - }, - aggs: { - sample: { - random_sampler: randomSampler, - aggs: { - processor_event: { - terms: { - field: PROCESSOR_EVENT, - size: 10, - }, - aggs: { - number_of_metric_docs_for_processor_event: { - value_count: { - field: PROCESSOR_EVENT, - }, - }, - indices: { - terms: { - field: INDEX, - size: 500, - }, - aggs: { - number_of_metric_docs_for_index: { - value_count: { - field: INDEX, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }), - ]); - - return [ - ProcessorEvent.transaction, - ProcessorEvent.span, - ProcessorEvent.metric, - ProcessorEvent.error, - ].map((processorEvent) => { - const bucketForProcessorEvent = - response.aggregations?.sample.processor_event.buckets?.find( - (x) => x.key === processorEvent - ); - - return { - processorEvent, - docs: - bucketForProcessorEvent?.number_of_metric_docs_for_processor_event - .value ?? 0, - size: - allIndicesStats && bucketForProcessorEvent - ? bucketForProcessorEvent.indices.buckets.reduce((prev, curr) => { - return ( - prev + - getEstimatedSizeForDocumentsInIndex({ - allIndicesStats, - indexName: curr.key as string, - numberOfDocs: curr.number_of_metric_docs_for_index.value, - }) - ); - }, 0) - : 0, - }; - }); -} diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/get_storage_details_per_service.ts b/x-pack/plugins/apm/server/routes/storage_explorer/get_storage_details_per_service.ts new file mode 100644 index 0000000000000..5ed230235f408 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/storage_explorer/get_storage_details_per_service.ts @@ -0,0 +1,271 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + termQuery, + kqlQuery, + rangeQuery, +} from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { + PROCESSOR_EVENT, + SERVICE_NAME, + TIER, + INDEX, +} from '../../../common/elasticsearch_fieldnames'; +import { + IndexLifecyclePhaseSelectOption, + indexLifeCyclePhaseToDataTier, +} from '../../../common/storage_explorer_types'; +import { environmentQuery } from '../../../common/utils/environment_query'; +import { ApmPluginRequestHandlerContext } from '../typings'; +import { + getTotalIndicesStats, + getEstimatedSizeForDocumentsInIndex, + getIndicesLifecycleStatus, + getIndicesInfo, +} from './indices_stats_helpers'; +import { RandomSampler } from '../../lib/helpers/get_random_sampler'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; + +export async function getStorageDetailsPerProcessorEvent({ + apmEventClient, + context, + indexLifecyclePhase, + randomSampler, + start, + end, + environment, + kuery, + serviceName, +}: { + apmEventClient: APMEventClient; + context: ApmPluginRequestHandlerContext; + indexLifecyclePhase: IndexLifecyclePhaseSelectOption; + randomSampler: RandomSampler; + start: number; + end: number; + environment: string; + kuery: string; + serviceName: string; +}) { + const [{ indices: allIndicesStats }, response] = await Promise.all([ + getTotalIndicesStats({ apmEventClient, context }), + apmEventClient.search('get_storage_details_per_processor_event', { + apm: { + events: [ + ProcessorEvent.span, + ProcessorEvent.transaction, + ProcessorEvent.error, + ProcessorEvent.metric, + ], + }, + body: { + size: 0, + track_total_hits: false, + query: { + bool: { + filter: [ + ...environmentQuery(environment), + ...kqlQuery(kuery), + ...rangeQuery(start, end), + ...termQuery(SERVICE_NAME, serviceName), + ...(indexLifecyclePhase !== IndexLifecyclePhaseSelectOption.All + ? termQuery( + TIER, + indexLifeCyclePhaseToDataTier[indexLifecyclePhase] + ) + : []), + ], + }, + }, + aggs: { + sample: { + random_sampler: randomSampler, + aggs: { + processor_event: { + terms: { + field: PROCESSOR_EVENT, + size: 10, + }, + aggs: { + number_of_metric_docs_for_processor_event: { + value_count: { + field: PROCESSOR_EVENT, + }, + }, + indices: { + terms: { + field: INDEX, + size: 500, + }, + aggs: { + number_of_metric_docs_for_index: { + value_count: { + field: INDEX, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }), + ]); + + return [ + ProcessorEvent.transaction, + ProcessorEvent.span, + ProcessorEvent.metric, + ProcessorEvent.error, + ].map((processorEvent) => { + const bucketForProcessorEvent = + response.aggregations?.sample.processor_event.buckets?.find( + (x) => x.key === processorEvent + ); + + return { + processorEvent, + docs: + bucketForProcessorEvent?.number_of_metric_docs_for_processor_event + .value ?? 0, + size: + allIndicesStats && bucketForProcessorEvent + ? bucketForProcessorEvent.indices.buckets.reduce((prev, curr) => { + return ( + prev + + getEstimatedSizeForDocumentsInIndex({ + allIndicesStats, + indexName: curr.key as string, + numberOfDocs: curr.number_of_metric_docs_for_index.value, + }) + ); + }, 0) + : 0, + }; + }); +} + +export async function getStorageDetailsPerIndex({ + apmEventClient, + context, + indexLifecyclePhase, + randomSampler, + start, + end, + environment, + kuery, + serviceName, +}: { + apmEventClient: APMEventClient; + context: ApmPluginRequestHandlerContext; + indexLifecyclePhase: IndexLifecyclePhaseSelectOption; + randomSampler: RandomSampler; + start: number; + end: number; + environment: string; + kuery: string; + serviceName: string; +}) { + const [ + { indices: allIndicesStats }, + indicesLifecycleStatus, + indicesInfo, + response, + ] = await Promise.all([ + getTotalIndicesStats({ apmEventClient, context }), + getIndicesLifecycleStatus({ apmEventClient, context }), + getIndicesInfo({ apmEventClient, context }), + apmEventClient.search('get_storage_details_per_index', { + apm: { + events: [ + ProcessorEvent.span, + ProcessorEvent.transaction, + ProcessorEvent.error, + ProcessorEvent.metric, + ], + }, + body: { + size: 0, + track_total_hits: false, + query: { + bool: { + filter: [ + ...environmentQuery(environment), + ...kqlQuery(kuery), + ...rangeQuery(start, end), + ...termQuery(SERVICE_NAME, serviceName), + ...(indexLifecyclePhase !== IndexLifecyclePhaseSelectOption.All + ? termQuery( + TIER, + indexLifeCyclePhaseToDataTier[indexLifecyclePhase] + ) + : []), + ], + }, + }, + aggs: { + sample: { + random_sampler: randomSampler, + aggs: { + indices: { + terms: { + field: INDEX, + size: 500, + }, + aggs: { + number_of_metric_docs_for_index: { + value_count: { + field: INDEX, + }, + }, + }, + }, + }, + }, + }, + }, + }), + ]); + + return ( + response.aggregations?.sample.indices.buckets.map((bucket) => { + const indexName = bucket.key as string; + const numberOfDocs = bucket.number_of_metric_docs_for_index.value; + const indexInfo = indicesInfo[indexName]; + const indexLifecycle = indicesLifecycleStatus[indexName]; + + const size = + allIndicesStats && + getEstimatedSizeForDocumentsInIndex({ + allIndicesStats, + indexName, + numberOfDocs, + }); + + return { + indexName, + numberOfDocs, + primary: indexInfo + ? indexInfo.settings?.index?.number_of_shards ?? 0 + : undefined, + replica: indexInfo + ? indexInfo.settings?.number_of_replicas ?? 0 + : undefined, + size, + dataStream: indexInfo?.data_stream, + lifecyclePhase: + indexLifecycle && 'phase' in indexLifecycle + ? indexLifecycle.phase + : undefined, + }; + }) ?? [] + ); +} diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/get_summary_statistics.ts b/x-pack/plugins/apm/server/routes/storage_explorer/get_summary_statistics.ts index dfa510e8f0890..23f2146b18060 100644 --- a/x-pack/plugins/apm/server/routes/storage_explorer/get_summary_statistics.ts +++ b/x-pack/plugins/apm/server/routes/storage_explorer/get_summary_statistics.ts @@ -6,7 +6,6 @@ */ import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { termQuery, kqlQuery, @@ -15,8 +14,8 @@ import { import { getTotalIndicesStats, getEstimatedSizeForDocumentsInIndex, + getApmDiskSpacedUsedPct, } from './indices_stats_helpers'; -import { Setup } from '../../lib/helpers/setup_request'; import { ApmPluginRequestHandlerContext } from '../typings'; import { IndexLifecyclePhaseSelectOption, @@ -36,9 +35,10 @@ import { isRootTransaction, } from '../../lib/helpers/transactions'; import { calculateThroughputWithRange } from '../../lib/helpers/calculate_throughput'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTracesPerMinute({ - setup, + apmEventClient, indexLifecyclePhase, start, end, @@ -46,7 +46,7 @@ export async function getTracesPerMinute({ kuery, searchAggregatedTransactions, }: { - setup: Setup; + apmEventClient: APMEventClient; indexLifecyclePhase: IndexLifecyclePhaseSelectOption; start: number; end: number; @@ -54,8 +54,6 @@ export async function getTracesPerMinute({ kuery: string; searchAggregatedTransactions: boolean; }) { - const { apmEventClient } = setup; - const response = await apmEventClient.search('get_traces_per_minute', { apm: { events: [getProcessorEventForTransactions(searchAggregatedTransactions)], @@ -102,7 +100,7 @@ export async function getTracesPerMinute({ } export async function getMainSummaryStats({ - setup, + apmEventClient, context, indexLifecyclePhase, randomSampler, @@ -111,7 +109,7 @@ export async function getMainSummaryStats({ environment, kuery, }: { - setup: Setup; + apmEventClient: APMEventClient; context: ApmPluginRequestHandlerContext; indexLifecyclePhase: IndexLifecyclePhaseSelectOption; randomSampler: RandomSampler; @@ -120,10 +118,9 @@ export async function getMainSummaryStats({ environment: string; kuery: string; }) { - const { apmEventClient } = setup; - - const [{ indices: allIndicesStats }, res] = await Promise.all([ - getTotalIndicesStats({ context, setup }), + const [totalIndicesStats, totalDiskSpace, res] = await Promise.all([ + getTotalIndicesStats({ context, apmEventClient }), + getApmDiskSpacedUsedPct(context), apmEventClient.search('get_storage_explorer_main_summary_stats', { apm: { events: [ @@ -148,7 +145,7 @@ export async function getMainSummaryStats({ indexLifeCyclePhaseToDataTier[indexLifecyclePhase] ) : []), - ] as QueryDslQueryContainer[], + ], }, }, aggs: { @@ -180,7 +177,8 @@ export async function getMainSummaryStats({ }), ]); - const estimatedSize = allIndicesStats + const { indices: allIndicesStats } = totalIndicesStats; + const estimatedIncrementalSize = allIndicesStats ? res.aggregations?.sample.indices.buckets.reduce((prev, curr) => { return ( prev + @@ -194,10 +192,13 @@ export async function getMainSummaryStats({ : 0; const durationAsDays = (end - start) / 1000 / 60 / 60 / 24; + const totalApmSize = totalIndicesStats._all.total?.store?.size_in_bytes ?? 0; return { + totalSize: totalApmSize, + diskSpaceUsedPct: totalApmSize / totalDiskSpace, numberOfServices: res.aggregations?.services_count.value ?? 0, - estimatedSize, - dailyDataGeneration: estimatedSize / durationAsDays, + estimatedIncrementalSize, + dailyDataGeneration: estimatedIncrementalSize / durationAsDays, }; } diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/get_total_transactions_per_service.ts b/x-pack/plugins/apm/server/routes/storage_explorer/get_total_transactions_per_service.ts index 793c69ab71b4c..1f883adee3f70 100644 --- a/x-pack/plugins/apm/server/routes/storage_explorer/get_total_transactions_per_service.ts +++ b/x-pack/plugins/apm/server/routes/storage_explorer/get_total_transactions_per_service.ts @@ -4,13 +4,11 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { termQuery, kqlQuery, rangeQuery, } from '@kbn/observability-plugin/server'; -import { Setup } from '../../lib/helpers/setup_request'; import { getProcessorEventForTransactions, getDocumentTypeFilterForTransactions, @@ -22,9 +20,10 @@ import { } from '../../../common/storage_explorer_types'; import { environmentQuery } from '../../../common/utils/environment_query'; import { RandomSampler } from '../../lib/helpers/get_random_sampler'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTotalTransactionsPerService({ - setup, + apmEventClient, searchAggregatedTransactions, indexLifecyclePhase, randomSampler, @@ -33,7 +32,7 @@ export async function getTotalTransactionsPerService({ environment, kuery, }: { - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; indexLifecyclePhase: IndexLifecyclePhaseSelectOption; randomSampler: RandomSampler; @@ -42,8 +41,6 @@ export async function getTotalTransactionsPerService({ environment: string; kuery: string; }) { - const { apmEventClient } = setup; - const response = await apmEventClient.search( 'get_total_transactions_per_service', { @@ -70,7 +67,7 @@ export async function getTotalTransactionsPerService({ indexLifeCyclePhaseToDataTier[indexLifecyclePhase] ) : []), - ] as QueryDslQueryContainer[], + ], }, }, aggs: { diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/has_storage_explorer_privileges.ts b/x-pack/plugins/apm/server/routes/storage_explorer/has_storage_explorer_privileges.ts index 714c0eee1c62c..d30bf8402fa4f 100644 --- a/x-pack/plugins/apm/server/routes/storage_explorer/has_storage_explorer_privileges.ts +++ b/x-pack/plugins/apm/server/routes/storage_explorer/has_storage_explorer_privileges.ts @@ -8,18 +8,18 @@ import { every } from 'lodash'; import { uniq } from 'lodash'; import { ApmPluginRequestHandlerContext } from '../typings'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function hasStorageExplorerPrivileges({ context, - setup, + apmEventClient, }: { context: ApmPluginRequestHandlerContext; - setup: Setup; + apmEventClient: APMEventClient; }) { const { indices: { transaction, span, metric, error }, - } = setup; + } = apmEventClient; const names = uniq( [transaction, span, metric, error].flatMap((indexPatternString) => @@ -28,17 +28,19 @@ export async function hasStorageExplorerPrivileges({ ); const esClient = (await context.core).elasticsearch.client; - const { index } = await esClient.asCurrentUser.security.hasPrivileges({ - body: { - index: [ - { - names, - privileges: ['monitor'], - }, - ], - }, - }); + const { index, cluster } = + await esClient.asCurrentUser.security.hasPrivileges({ + body: { + index: [ + { + names, + privileges: ['monitor'], + }, + ], + cluster: ['monitor'], + }, + }); - const hasPrivileges = every(index, 'monitor'); + const hasPrivileges = cluster.monitor && every(index, 'monitor'); return hasPrivileges; } diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/indices_stats_helpers.ts b/x-pack/plugins/apm/server/routes/storage_explorer/indices_stats_helpers.ts index aa9e854cc4a29..3b9ed12e56f81 100644 --- a/x-pack/plugins/apm/server/routes/storage_explorer/indices_stats_helpers.ts +++ b/x-pack/plugins/apm/server/routes/storage_explorer/indices_stats_helpers.ts @@ -4,22 +4,19 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { uniq } from 'lodash'; +import { uniq, values, sumBy } from 'lodash'; import { IndicesStatsIndicesStats } from '@elastic/elasticsearch/lib/api/types'; -import { Setup } from '../../lib/helpers/setup_request'; import { ApmPluginRequestHandlerContext } from '../typings'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTotalIndicesStats({ context, - setup, + apmEventClient, }: { context: ApmPluginRequestHandlerContext; - setup: Setup; + apmEventClient: APMEventClient; }) { - const { - indices: { transaction, span, metric, error }, - } = setup; - const index = uniq([transaction, span, metric, error]).join(); + const index = getApmIndicesCombined(apmEventClient); const esClient = (await context.core).elasticsearch.client; const totalStats = await esClient.asCurrentUser.indices.stats({ index }); return totalStats; @@ -44,3 +41,67 @@ export function getEstimatedSizeForDocumentsInIndex({ return estimatedSize; } + +export async function getApmDiskSpacedUsedPct( + context: ApmPluginRequestHandlerContext +) { + const esClient = (await context.core).elasticsearch.client; + const { nodes: diskSpacePerNode } = await esClient.asCurrentUser.nodes.stats({ + metric: 'fs', + filter_path: 'nodes.*.fs.total.total_in_bytes', + }); + + const totalDiskSpace = sumBy( + values(diskSpacePerNode), + (node) => node?.fs?.total?.total_in_bytes ?? 0 + ); + + return totalDiskSpace; +} + +export async function getIndicesLifecycleStatus({ + context, + apmEventClient, +}: { + context: ApmPluginRequestHandlerContext; + apmEventClient: APMEventClient; +}) { + const index = getApmIndicesCombined(apmEventClient); + const esClient = (await context.core).elasticsearch.client; + const { indices } = await esClient.asCurrentUser.ilm.explainLifecycle({ + index, + filter_path: 'indices.*.phase', + }); + + return indices; +} + +export async function getIndicesInfo({ + context, + apmEventClient, +}: { + context: ApmPluginRequestHandlerContext; + apmEventClient: APMEventClient; +}) { + const index = getApmIndicesCombined(apmEventClient); + const esClient = (await context.core).elasticsearch.client; + const indicesInfo = await esClient.asCurrentUser.indices.get({ + index, + filter_path: [ + '*.settings.index.number_of_shards', + '*.settings.index.number_of_replicas', + '*.data_stream', + ], + features: ['settings'], + }); + + return indicesInfo; +} + +export function getApmIndicesCombined(apmEventClient: APMEventClient) { + const { + indices: { transaction, span, metric, error }, + } = apmEventClient; + + return uniq([transaction, span, metric, error]).join(); +} diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/is_cross_cluster_search.test.ts b/x-pack/plugins/apm/server/routes/storage_explorer/is_cross_cluster_search.test.ts new file mode 100644 index 0000000000000..d4604df07e3f6 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/storage_explorer/is_cross_cluster_search.test.ts @@ -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 { isCrossClusterSearch } from './is_cross_cluster_search'; +import { ApmIndicesConfig } from '@kbn/observability-plugin/common/typings'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; + +describe('isCrossClusterSearch', () => { + it('returns false when there are no remote clusters in APM indices', () => { + const mockApmEventClient = { + indices: { + transaction: 'traces-apm*', + span: 'traces-apm*', + metric: 'metrics-apm*', + error: 'logs-apm*', + } as ApmIndicesConfig, + } as unknown as APMEventClient; + + expect(isCrossClusterSearch(mockApmEventClient)).toBe(false); + }); + + it('returns false when there are multiple indices per type and no remote clusters in APM indices', () => { + const mockApmEventClient = { + indices: { + transaction: 'traces-apm*,test-apm*', + span: 'traces-apm*,test-apm*', + metric: 'metrics-apm*,test-apm*', + error: 'logs-apm*,test-apm*', + } as ApmIndicesConfig, + } as unknown as APMEventClient; + + expect(isCrossClusterSearch(mockApmEventClient)).toBe(false); + }); + + it('returns false when there are remote clusters in onboarding and sourcemap indices', () => { + const mockApmEventClient = { + indices: { + transaction: '', + span: '', + metric: '', + error: '', + onboarding: 'apm-*,remote_cluster:apm-*', + sourcemap: 'apm-*,remote_cluster:apm-*', + } as ApmIndicesConfig, + } as unknown as APMEventClient; + + expect(isCrossClusterSearch(mockApmEventClient)).toBe(false); + }); + + it('returns true when there are remote clusters in transaction indices', () => { + const mockApmEventClient = { + indices: { + transaction: 'traces-apm*,remote_cluster:traces-apm*', + span: '', + metric: '', + error: '', + } as ApmIndicesConfig, + } as unknown as APMEventClient; + + expect(isCrossClusterSearch(mockApmEventClient)).toBe(true); + }); + + it('returns true when there are remote clusters in span indices', () => { + const mockApmEventClient = { + indices: { + transaction: '', + span: 'traces-apm*,remote_cluster:traces-apm*', + metric: '', + error: '', + } as ApmIndicesConfig, + } as unknown as APMEventClient; + + expect(isCrossClusterSearch(mockApmEventClient)).toBe(true); + }); + + it('returns true when there are remote clusters in metrics indices', () => { + const mockApmEventClient = { + indices: { + transaction: '', + span: '', + metric: 'metrics-apm*,remote_cluster:metrics-apm*', + error: '', + } as ApmIndicesConfig, + } as unknown as APMEventClient; + + expect(isCrossClusterSearch(mockApmEventClient)).toBe(true); + }); + + it('returns true when there are remote clusters in error indices', () => { + const mockApmEventClient = { + indices: { + transaction: '', + span: '', + metric: '', + error: 'logs-apm*,remote_cluster:logs-apm*', + } as ApmIndicesConfig, + } as unknown as APMEventClient; + + expect(isCrossClusterSearch(mockApmEventClient)).toBe(true); + }); +}); diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/is_cross_cluster_search.ts b/x-pack/plugins/apm/server/routes/storage_explorer/is_cross_cluster_search.ts new file mode 100644 index 0000000000000..cf149fe1a0414 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/storage_explorer/is_cross_cluster_search.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; +import { getApmIndicesCombined } from './indices_stats_helpers'; + +export function isCrossClusterSearch(apmEventClient: APMEventClient) { + // Check if a remote cluster is set in APM indices + return getApmIndicesCombined(apmEventClient).includes(':'); +} diff --git a/x-pack/plugins/apm/server/routes/storage_explorer/route.ts b/x-pack/plugins/apm/server/routes/storage_explorer/route.ts index 9d817efbf34f5..d22a0bee3b2a5 100644 --- a/x-pack/plugins/apm/server/routes/storage_explorer/route.ts +++ b/x-pack/plugins/apm/server/routes/storage_explorer/route.ts @@ -9,10 +9,13 @@ import * as t from 'io-ts'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; +import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { getSearchTransactionsEvents } from '../../lib/helpers/transactions'; -import { setupRequest } from '../../lib/helpers/setup_request'; -import { indexLifecyclePhaseRt } from '../../../common/storage_explorer_types'; +import { + indexLifecyclePhaseRt, + IndexLifecyclePhaseSelectOption, +} from '../../../common/storage_explorer_types'; import { getServiceStatistics } from './get_service_statistics'; import { probabilityRt, @@ -21,7 +24,10 @@ import { rangeRt, } from '../default_api_types'; import { AgentName } from '../../../typings/es_schemas/ui/fields/agent'; -import { getStorageDetailsPerProcessorEvent } from './get_storage_details_per_processor_event'; +import { + getStorageDetailsPerIndex, + getStorageDetailsPerProcessorEvent, +} from './get_storage_details_per_service'; import { getRandomSampler } from '../../lib/helpers/get_random_sampler'; import { getSizeTimeseries } from './get_size_timeseries'; import { hasStorageExplorerPrivileges } from './has_storage_explorer_privileges'; @@ -29,6 +35,9 @@ import { getMainSummaryStats, getTracesPerMinute, } from './get_summary_statistics'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; +import { isCrossClusterSearch } from './is_cross_cluster_search'; +import { getServiceNamesFromTermsEnum } from '../services/get_services/get_sorted_and_filtered_services'; const storageExplorerRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/storage_explorer', @@ -54,6 +63,7 @@ const storageExplorerRoute = createApmServerRoute({ }>; }> => { const { + config, params, context, request, @@ -71,19 +81,19 @@ const storageExplorerRoute = createApmServerRoute({ }, } = params; - const [setup, randomSampler] = await Promise.all([ - setupRequest(resources), + const [apmEventClient, randomSampler] = await Promise.all([ + getApmEventClient(resources), getRandomSampler({ security, request, probability }), ]); const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, kuery, }); const serviceStatistics = await getServiceStatistics({ - setup, + apmEventClient, context, indexLifecyclePhase, randomSampler, @@ -127,6 +137,15 @@ const storageExplorerServiceDetailsRoute = createApmServerRoute({ docs: number; size: number; }>; + indicesStats: Array<{ + indexName: string; + numberOfDocs: number; + primary?: number | string; + replica?: number | string; + size?: number; + dataStream?: string; + lifecyclePhase?: string; + }>; }> => { const { params, @@ -147,24 +166,37 @@ const storageExplorerServiceDetailsRoute = createApmServerRoute({ }, } = params; - const [setup, randomSampler] = await Promise.all([ - setupRequest(resources), + const [apmEventClient, randomSampler] = await Promise.all([ + getApmEventClient(resources), getRandomSampler({ security, request, probability }), ]); - const processorEventStats = await getStorageDetailsPerProcessorEvent({ - setup, - context, - indexLifecyclePhase, - randomSampler, - environment, - kuery, - start, - end, - serviceName, - }); + const [processorEventStats, indicesStats] = await Promise.all([ + getStorageDetailsPerProcessorEvent({ + apmEventClient, + context, + indexLifecyclePhase, + randomSampler, + environment, + kuery, + start, + end, + serviceName, + }), + getStorageDetailsPerIndex({ + apmEventClient, + context, + indexLifecyclePhase, + randomSampler, + environment, + kuery, + start, + end, + serviceName, + }), + ]); - return { processorEventStats }; + return { processorEventStats, indicesStats }; }, }); @@ -189,6 +221,7 @@ const storageChartRoute = createApmServerRoute({ }>; }> => { const { + config, params, context, request, @@ -206,14 +239,14 @@ const storageChartRoute = createApmServerRoute({ }, } = params; - const [setup, randomSampler] = await Promise.all([ - setupRequest(resources), + const [apmEventClient, randomSampler] = await Promise.all([ + getApmEventClient(resources), getRandomSampler({ security, request, probability }), ]); const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, kuery, }); @@ -225,7 +258,7 @@ const storageChartRoute = createApmServerRoute({ kuery, start, end, - setup, + apmEventClient, context, }); @@ -247,10 +280,10 @@ const storageExplorerPrivilegesRoute = createApmServerRoute({ throw Boom.internal(SECURITY_REQUIRED_MESSAGE); } - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const hasPrivileges = await hasStorageExplorerPrivileges({ context, - setup, + apmEventClient, }); return { hasPrivileges }; @@ -274,10 +307,13 @@ const storageExplorerSummaryStatsRoute = createApmServerRoute({ ): Promise<{ tracesPerMinute: number; numberOfServices: number; - estimatedSize: number; + totalSize: number; + diskSpaceUsedPct: number; + estimatedIncrementalSize: number; dailyDataGeneration: number; }> => { const { + config, params, context, request, @@ -295,20 +331,20 @@ const storageExplorerSummaryStatsRoute = createApmServerRoute({ }, } = params; - const [setup, randomSampler] = await Promise.all([ - setupRequest(resources), + const [apmEventClient, randomSampler] = await Promise.all([ + getApmEventClient(resources), getRandomSampler({ security, request, probability }), ]); const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, kuery, }); const [mainSummaryStats, tracesPerMinute] = await Promise.all([ getMainSummaryStats({ - setup, + apmEventClient, context, indexLifecyclePhase, randomSampler, @@ -318,7 +354,7 @@ const storageExplorerSummaryStatsRoute = createApmServerRoute({ kuery, }), getTracesPerMinute({ - setup, + apmEventClient, indexLifecyclePhase, start, end, @@ -335,12 +371,68 @@ const storageExplorerSummaryStatsRoute = createApmServerRoute({ }, }); +const storageExplorerIsCrossClusterSearchRoute = createApmServerRoute({ + endpoint: 'GET /internal/apm/storage_explorer/is_cross_cluster_search', + options: { tags: ['access:apm'] }, + handler: async (resources): Promise<{ isCrossClusterSearch: boolean }> => { + const apmEventClient = await getApmEventClient(resources); + return { isCrossClusterSearch: isCrossClusterSearch(apmEventClient) }; + }, +}); + +const storageExplorerGetServices = createApmServerRoute({ + endpoint: 'GET /internal/apm/storage_explorer/get_services', + options: { + tags: ['access:apm'], + }, + params: t.type({ + query: t.intersection([indexLifecyclePhaseRt, environmentRt, kueryRt]), + }), + handler: async ( + resources + ): Promise<{ + services: Array<{ + serviceName: string; + }>; + }> => { + const { + query: { environment, kuery, indexLifecyclePhase }, + } = resources.params; + + if ( + kuery || + indexLifecyclePhase !== IndexLifecyclePhaseSelectOption.All || + environment !== ENVIRONMENT_ALL.value + ) { + return { + services: [], + }; + } + + const apmEventClient = await getApmEventClient(resources); + + const services = await getServiceNamesFromTermsEnum({ + apmEventClient, + environment, + maxNumberOfServices: 500, + }); + + return { + services: services.map((serviceName): { serviceName: string } => ({ + serviceName, + })), + }; + }, +}); + export const storageExplorerRouteRepository = { ...storageExplorerRoute, ...storageExplorerServiceDetailsRoute, ...storageChartRoute, ...storageExplorerPrivilegesRoute, ...storageExplorerSummaryStatsRoute, + ...storageExplorerIsCrossClusterSearchRoute, + ...storageExplorerGetServices, }; const SECURITY_REQUIRED_MESSAGE = i18n.translate( diff --git a/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_aggregation.ts b/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_aggregation.ts index 56ed34805c2fb..856b6bea1b9a5 100644 --- a/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_aggregation.ts +++ b/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_aggregation.ts @@ -8,14 +8,14 @@ import { rangeQuery, termQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getSuggestionsWithTermsAggregation({ fieldName, fieldValue, searchAggregatedTransactions, serviceName, - setup, + apmEventClient, size, start, end, @@ -24,13 +24,11 @@ export async function getSuggestionsWithTermsAggregation({ fieldValue: string; searchAggregatedTransactions: boolean; serviceName?: string; - setup: Setup; + apmEventClient: APMEventClient; size: number; start: number; end: number; }) { - const { apmEventClient } = setup; - const response = await apmEventClient.search( 'get_suggestions_with_terms_aggregation', { diff --git a/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_enum.ts b/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_enum.ts index 4437a36151895..c945438ff01cf 100644 --- a/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_enum.ts +++ b/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_enum.ts @@ -6,13 +6,13 @@ */ import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; -import { Setup } from '../../lib/helpers/setup_request'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getSuggestionsWithTermsEnum({ fieldName, fieldValue, searchAggregatedTransactions, - setup, + apmEventClient, size, start, end, @@ -20,40 +20,35 @@ export async function getSuggestionsWithTermsEnum({ fieldName: string; fieldValue: string; searchAggregatedTransactions: boolean; - setup: Setup; + apmEventClient: APMEventClient; size: number; start: number; end: number; }) { - const { apmEventClient } = setup; - - const response = await apmEventClient.termsEnum( - 'get_suggestions_with_terms_enum', - { - apm: { - events: [ - getProcessorEventForTransactions(searchAggregatedTransactions), - ProcessorEvent.error, - ProcessorEvent.metric, - ], - }, - body: { - case_insensitive: true, - field: fieldName, - size, - string: fieldValue, - index_filter: { - range: { - ['@timestamp']: { - gte: start, - lte: end, - format: 'epoch_millis', - }, + const response = await apmEventClient.termsEnum('get_suggestions', { + apm: { + events: [ + getProcessorEventForTransactions(searchAggregatedTransactions), + ProcessorEvent.error, + ProcessorEvent.metric, + ], + }, + body: { + case_insensitive: true, + field: fieldName, + size, + string: fieldValue, + index_filter: { + range: { + ['@timestamp']: { + gte: start, + lte: end, + format: 'epoch_millis', }, }, }, - } - ); + }, + }); return { terms: response.terms }; } diff --git a/x-pack/plugins/apm/server/routes/suggestions/route.ts b/x-pack/plugins/apm/server/routes/suggestions/route.ts index f0396ac62ca51..6888fd06ed6c3 100644 --- a/x-pack/plugins/apm/server/routes/suggestions/route.ts +++ b/x-pack/plugins/apm/server/routes/suggestions/route.ts @@ -10,9 +10,9 @@ import { maxSuggestions } from '@kbn/observability-plugin/common'; import { getSuggestionsWithTermsEnum } from './get_suggestions_with_terms_enum'; import { getSuggestionsWithTermsAggregation } from './get_suggestions_with_terms_aggregation'; import { getSearchTransactionsEvents } from '../../lib/helpers/transactions'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { rangeRt } from '../default_api_types'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const suggestionsRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/suggestions', @@ -28,12 +28,12 @@ const suggestionsRoute = createApmServerRoute({ }), options: { tags: ['access:apm'] }, handler: async (resources): Promise<{ terms: string[] }> => { - const setup = await setupRequest(resources); - const { context, params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { context, params, config } = resources; const { fieldName, fieldValue, serviceName, start, end } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - apmEventClient: setup.apmEventClient, - config: setup.config, + apmEventClient, + config, kuery: '', }); const coreContext = await context.core; @@ -46,7 +46,7 @@ const suggestionsRoute = createApmServerRoute({ fieldName, fieldValue, searchAggregatedTransactions, - setup, + apmEventClient, size, start, end, @@ -65,7 +65,7 @@ const suggestionsRoute = createApmServerRoute({ fieldValue, searchAggregatedTransactions, serviceName, - setup, + apmEventClient, size, start, end, diff --git a/x-pack/plugins/apm/server/routes/time_range_metadata/route.ts b/x-pack/plugins/apm/server/routes/time_range_metadata/route.ts index f0321f4cfde4d..bde0058b57560 100644 --- a/x-pack/plugins/apm/server/routes/time_range_metadata/route.ts +++ b/x-pack/plugins/apm/server/routes/time_range_metadata/route.ts @@ -7,7 +7,7 @@ import { toBooleanRt } from '@kbn/io-ts-utils'; import * as t from 'io-ts'; import { TimeRangeMetadata } from '../../../common/time_range_metadata'; -import { setupRequest } from '../../lib/helpers/setup_request'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; import { getIsUsingServiceDestinationMetrics } from '../../lib/helpers/spans/get_is_using_service_destination_metrics'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { kueryRt, rangeRt } from '../default_api_types'; @@ -25,7 +25,7 @@ export const timeRangeMetadataRoute = createApmServerRoute({ tags: ['access:apm'], }, handler: async (resources): Promise<TimeRangeMetadata> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { query: { useSpanName, start, end, kuery }, @@ -33,7 +33,7 @@ export const timeRangeMetadataRoute = createApmServerRoute({ const [isUsingServiceDestinationMetrics] = await Promise.all([ getIsUsingServiceDestinationMetrics({ - setup, + apmEventClient, useSpanName, start, end, diff --git a/x-pack/plugins/apm/server/routes/traces/get_aggregated_critical_path.ts b/x-pack/plugins/apm/server/routes/traces/get_aggregated_critical_path.ts new file mode 100644 index 0000000000000..612039ed0914b --- /dev/null +++ b/x-pack/plugins/apm/server/routes/traces/get_aggregated_critical_path.ts @@ -0,0 +1,426 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { rangeQuery, termsQuery } from '@kbn/observability-plugin/server'; +import { Logger } from '@kbn/logging'; +import { + AGENT_NAME, + PROCESSOR_EVENT, + SERVICE_NAME, + SPAN_NAME, + SPAN_SUBTYPE, + SPAN_TYPE, + TRACE_ID, + TRANSACTION_NAME, + TRANSACTION_TYPE, +} from '../../../common/elasticsearch_fieldnames'; +import { AgentName } from '../../../typings/es_schemas/ui/fields/agent'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; + +type OperationMetadata = { + [SERVICE_NAME]: string; + [AGENT_NAME]: AgentName; +} & ( + | { + [PROCESSOR_EVENT]: ProcessorEvent.transaction; + [TRANSACTION_TYPE]: string; + [TRANSACTION_NAME]: string; + } + | { + [PROCESSOR_EVENT]: ProcessorEvent.span; + [SPAN_NAME]: string; + [SPAN_TYPE]: string; + [SPAN_SUBTYPE]: string; + } +); + +type OperationId = string; + +type NodeId = string; + +export interface CriticalPathResponse { + metadata: Record<OperationId, OperationMetadata>; + timeByNodeId: Record<NodeId, number>; + nodes: Record<NodeId, NodeId[]>; + rootNodes: NodeId[]; + operationIdByNodeId: Record<NodeId, OperationId>; +} + +const TWO_DAYS_MS = 2 * 24 * 60 * 60 * 1000; + +export async function getAggregatedCriticalPath({ + traceIds, + start, + end, + apmEventClient, + serviceName, + transactionName, + logger, +}: { + traceIds: string[]; + start: number; + end: number; + apmEventClient: APMEventClient; + serviceName: string | null; + transactionName: string | null; + logger: Logger; +}): Promise<{ criticalPath: CriticalPathResponse | null }> { + const now = Date.now(); + + const response = await apmEventClient.search('get_aggregated_critical_path', { + apm: { + events: [ProcessorEvent.span, ProcessorEvent.transaction], + }, + body: { + size: 0, + track_total_hits: false, + query: { + bool: { + filter: [ + ...termsQuery(TRACE_ID, ...traceIds), + // we need a range query to allow ES to skip shards based on the time range, + // but we need enough padding to make sure we get the full trace + ...rangeQuery(start - TWO_DAYS_MS, end + TWO_DAYS_MS), + ], + }, + }, + aggs: { + critical_path: { + scripted_metric: { + params: { + // can't send null parameters to ES. undefined will be removed during JSON serialisation + serviceName: serviceName || undefined, + transactionName: transactionName || undefined, + }, + init_script: { + source: ` + state.eventsById = [:]; + state.metadataByOperationId = [:]; + `, + }, + map_script: { + source: ` + String toHash (def item) { + long FNV_32_INIT = 0x811c9dc5L; + long FNV_32_PRIME = 0x01000193L; + char[] chars = item.toString().toCharArray(); + long rv = FNV_32_INIT; + int len = chars.length; + for(int i = 0; i < len; i++) { + byte bt = (byte) chars[i]; + rv ^= bt; + rv *= FNV_32_PRIME; + } + return rv.toString(); + } + + def id; + double duration; + + def operationMetadata = [ + "service.name": doc['service.name'].value, + "processor.event": doc['processor.event'].value, + "agent.name": doc['agent.name'].value + ]; + + def isSpan = !doc['span.id'].empty; + + if (isSpan) { + id = doc['span.id'].value; + operationMetadata.put('span.name', doc['span.name'].value); + if (!doc['span.type'].empty) { + operationMetadata.put('span.type', doc['span.type'].value); + } + if (!doc['span.subtype'].empty) { + operationMetadata.put('span.subtype', doc['span.subtype'].value); + } + duration = doc['span.duration.us'].value; + } else { + id = doc['transaction.id'].value; + operationMetadata.put('transaction.name', doc['transaction.name'].value); + operationMetadata.put('transaction.type', doc['transaction.type'].value); + duration = doc['transaction.duration.us'].value; + } + + String operationId = toHash(operationMetadata); + + def map = [ + "traceId": doc['trace.id'].value, + "id": id, + "parentId": doc['parent.id'].empty ? null : doc['parent.id'].value, + "operationId": operationId, + "timestamp": doc['timestamp.us'].value, + "duration": duration + ]; + + if (state.metadataByOperationId[operationId] == null) { + state.metadataByOperationId.put(operationId, operationMetadata); + } + state.eventsById.put(id, map); + `, + }, + combine_script: { + source: 'return state;', + }, + reduce_script: { + source: ` + String toHash (def item) { + long FNV_32_INIT = 0x811c9dc5L; + long FNV_32_PRIME = 0x01000193L; + char[] chars = item.toString().toCharArray(); + long rv = FNV_32_INIT; + int len = chars.length; + for(int i = 0; i < len; i++) { + byte bt = (byte) chars[i]; + rv ^= bt; + rv *= FNV_32_PRIME; + } + return rv.toString(); + } + + def processEvent (def context, def event) { + if (context.processedEvents[event.id] != null) { + return context.processedEvents[event.id]; + } + + def processedEvent = [ + "children": [] + ]; + + if(event.parentId != null) { + def parent = context.events[event.parentId]; + if (parent == null) { + return null; + } + def processedParent = processEvent(context, parent); + if (processedParent == null) { + return null; + } + processedParent.children.add(processedEvent); + } + + context.processedEvents.put(event.id, processedEvent); + + processedEvent.putAll(event); + + if (context.params.serviceName != null && context.params.transactionName != null) { + + def metadata = context.metadata[event.operationId]; + + if (metadata != null + && context.params.serviceName == metadata['service.name'] + && metadata['transaction.name'] != null + && context.params.transactionName == metadata['transaction.name'] + ) { + context.entryTransactions.add(processedEvent); + } + + } else if (event.parentId == null) { + context.entryTransactions.add(processedEvent); + } + + return processedEvent; + } + + double getClockSkew (def context, def item, def parent ) { + if (parent == null) { + return 0; + } + + def processorEvent = context.metadata[item.operationId]['processor.event']; + + def isTransaction = processorEvent == 'transaction'; + + if (!isTransaction) { + return parent.skew; + } + + double parentStart = parent.timestamp + parent.skew; + double offsetStart = parentStart - item.timestamp; + if (offsetStart > 0) { + double latency = Math.round(Math.max(parent.duration - item.duration, 0) / 2); + return offsetStart + latency; + } + + return 0; + } + + void setOffsetAndSkew ( def context, def event, def parent, def startOfTrace ) { + event.skew = getClockSkew(context, event, parent); + event.offset = event.timestamp - startOfTrace; + for(child in event.children) { + setOffsetAndSkew(context, child, event, startOfTrace); + } + event.end = event.offset + event.skew + event.duration; + } + + void count ( def context, def nodeId, def duration ) { + context.timeByNodeId[nodeId] = (context.timeByNodeId[nodeId] ?: 0) + duration; + } + + void scan ( def context, def item, def start, def end, def path ) { + + def nodeId = toHash(path); + + def childNodes = context.nodes[nodeId] != null ? context.nodes[nodeId] : []; + + context.nodes[nodeId] = childNodes; + + context.operationIdByNodeId[nodeId] = item.operationId; + + if (item.children.size() == 0) { + count(context, nodeId, end - start); + return; + } + + item.children.sort((a, b) -> { + if (b.end === a.end) { + return 0; + } + if (b.end > a.end) { + return 1; + } + return -1; + }); + + def scanTime = end; + + for(child in item.children) { + double normalizedChildStart = Math.max(child.offset + child.skew, start); + double childEnd = child.offset + child.skew + child.duration; + + double normalizedChildEnd = Math.min(childEnd, scanTime); + + def isOnCriticalPath = !( + normalizedChildStart >= scanTime || + normalizedChildEnd < start || + childEnd > scanTime + ); + + if (!isOnCriticalPath) { + continue; + } + + def childPath = path.clone(); + + childPath.add(child.operationId); + + def childId = toHash(childPath); + + if(!childNodes.contains(childId)) { + childNodes.add(childId); + } + + if (normalizedChildEnd < (scanTime - 1000)) { + count(context, nodeId, scanTime - normalizedChildEnd); + } + + scan(context, child, normalizedChildStart, childEnd, childPath); + + scanTime = normalizedChildStart; + } + + if (scanTime > start) { + count(context, nodeId, scanTime - start); + } + + } + + def events = [:]; + def metadata = [:]; + def processedEvents = [:]; + def entryTransactions = []; + def timeByNodeId = [:]; + def nodes = [:]; + def rootNodes = []; + def operationIdByNodeId = [:]; + + + def context = [ + "events": events, + "metadata": metadata, + "processedEvents": processedEvents, + "entryTransactions": entryTransactions, + "timeByNodeId": timeByNodeId, + "nodes": nodes, + "operationIdByNodeId": operationIdByNodeId, + "params": params + ]; + + for(state in states) { + if (state.eventsById != null) { + events.putAll(state.eventsById); + } + if (state.metadataByOperationId != null) { + metadata.putAll(state.metadataByOperationId); + } + } + + + for(def event: events.values()) { + processEvent(context, event); + } + + for(transaction in context.entryTransactions) { + transaction.skew = 0; + transaction.offset = 0; + setOffsetAndSkew(context, transaction, null, transaction.timestamp); + + def path = []; + def parent = transaction; + while (parent != null) { + path.add(parent.operationId); + if (parent.parentId == null) { + break; + } + parent = context.processedEvents[parent.parentId]; + } + + Collections.reverse(path); + + def nodeId = toHash(path); + + scan(context, transaction, 0, transaction.duration, path); + + if (!rootNodes.contains(nodeId)) { + rootNodes.add(nodeId); + } + + } + + return [ + "timeByNodeId": timeByNodeId, + "metadata": metadata, + "nodes": nodes, + "rootNodes": rootNodes, + "operationIdByNodeId": operationIdByNodeId + ];`, + }, + }, + }, + }, + }, + }); + + logger.debug( + `Retrieved critical path in ${Date.now() - now}ms, took: ${response.took}ms` + ); + + if (!response.aggregations) { + return { + criticalPath: null, + }; + } + + const criticalPath = response.aggregations?.critical_path + .value as CriticalPathResponse; + + return { + criticalPath, + }; +} diff --git a/x-pack/plugins/apm/server/routes/traces/get_top_traces_primary_stats.ts b/x-pack/plugins/apm/server/routes/traces/get_top_traces_primary_stats.ts index 92ff9c38260df..dc9143685902b 100644 --- a/x-pack/plugins/apm/server/routes/traces/get_top_traces_primary_stats.ts +++ b/x-pack/plugins/apm/server/routes/traces/get_top_traces_primary_stats.ts @@ -13,7 +13,6 @@ import { } from '@kbn/observability-plugin/server'; import { AgentName } from '../../../typings/es_schemas/ui/fields/agent'; import { withApmSpan } from '../../utils/with_apm_span'; -import { Setup } from '../../lib/helpers/setup_request'; import { asMutableArray } from '../../../common/utils/as_mutable_array'; import { environmentQuery } from '../../../common/utils/environment_query'; import { calculateImpactBuilder } from './calculate_impact_builder'; @@ -31,6 +30,7 @@ import { TRANSACTION_NAME, } from '../../../common/elasticsearch_fieldnames'; import { RandomSampler } from '../../lib/helpers/get_random_sampler'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export type BucketKey = Record< typeof TRANSACTION_NAME | typeof SERVICE_NAME, @@ -44,7 +44,7 @@ interface TopTracesParams { searchAggregatedTransactions: boolean; start: number; end: number; - setup: Setup; + apmEventClient: APMEventClient; randomSampler: RandomSampler; } export async function getTopTracesPrimaryStats({ @@ -54,11 +54,11 @@ export async function getTopTracesPrimaryStats({ searchAggregatedTransactions, start, end, - setup, + apmEventClient, randomSampler, }: TopTracesParams) { return withApmSpan('get_top_traces_primary_stats', async () => { - const response = await setup.apmEventClient.search( + const response = await apmEventClient.search( 'get_transaction_group_stats', { apm: { diff --git a/x-pack/plugins/apm/server/routes/traces/get_trace_items.ts b/x-pack/plugins/apm/server/routes/traces/get_trace_items.ts index f1c1efc8664ce..960924e1aa4b0 100644 --- a/x-pack/plugins/apm/server/routes/traces/get_trace_items.ts +++ b/x-pack/plugins/apm/server/routes/traces/get_trace_items.ts @@ -18,16 +18,17 @@ import { TRACE_ID, TRANSACTION_DURATION, } from '../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../lib/helpers/setup_request'; import { getLinkedChildrenCountBySpanId } from '../span_links/get_linked_children'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; +import { APMConfig } from '../..'; export async function getTraceItems( traceId: string, - setup: Setup, + config: APMConfig, + apmEventClient: APMEventClient, start: number, end: number ) { - const { apmEventClient, config } = setup; const maxTraceItems = config.ui.maxTraceItems; const excludedLogLevels = ['debug', 'info', 'warning']; @@ -80,7 +81,7 @@ export async function getTraceItems( await Promise.all([ errorResponsePromise, traceResponsePromise, - getLinkedChildrenCountBySpanId({ traceId, setup, start, end }), + getLinkedChildrenCountBySpanId({ traceId, apmEventClient, start, end }), ]); const exceedsMax = traceResponse.hits.total.value > maxTraceItems; diff --git a/x-pack/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts b/x-pack/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts index 5f56d20dbbf9f..2e74d104592d7 100644 --- a/x-pack/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts +++ b/x-pack/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts @@ -11,7 +11,6 @@ import { } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Environment } from '../../../common/environment_rt'; -import { Setup } from '../../lib/helpers/setup_request'; import { TraceSearchType } from '../../../common/trace_explorer'; import { environmentQuery } from '../../../common/utils/environment_query'; import { @@ -22,16 +21,17 @@ import { TRANSACTION_SAMPLED, } from '../../../common/elasticsearch_fieldnames'; import { asMutableArray } from '../../../common/utils/as_mutable_array'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTraceSamplesByQuery({ - setup, + apmEventClient, start, end, environment, query, type, }: { - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; environment: Environment; @@ -45,7 +45,7 @@ export async function getTraceSamplesByQuery({ if (type === TraceSearchType.kql) { traceIds = ( - await setup.apmEventClient.search('get_trace_ids_by_kql_query', { + await apmEventClient.search('get_trace_ids_by_kql_query', { apm: { events: [ ProcessorEvent.transaction, @@ -81,7 +81,7 @@ export async function getTraceSamplesByQuery({ } else if (type === TraceSearchType.eql) { traceIds = ( - await setup.apmEventClient.eqlSearch('get_trace_ids_by_eql_query', { + await apmEventClient.eqlSearch('get_trace_ids_by_eql_query', { apm: { events: [ ProcessorEvent.transaction, @@ -115,7 +115,7 @@ export async function getTraceSamplesByQuery({ return []; } - const traceSamplesResponse = await setup.apmEventClient.search( + const traceSamplesResponse = await apmEventClient.search( 'get_trace_samples_by_trace_ids', { apm: { diff --git a/x-pack/plugins/apm/server/routes/traces/queries.test.ts b/x-pack/plugins/apm/server/routes/traces/queries.test.ts index f1bd97fd88ebd..9f342392b5a09 100644 --- a/x-pack/plugins/apm/server/routes/traces/queries.test.ts +++ b/x-pack/plugins/apm/server/routes/traces/queries.test.ts @@ -19,8 +19,8 @@ describe('trace queries', () => { }); it('fetches a trace', async () => { - mock = await inspectSearchParams((setup) => - getTraceItems('foo', setup, 0, 50000) + mock = await inspectSearchParams(({ mockConfig, mockApmEventClient }) => + getTraceItems('foo', mockConfig, mockApmEventClient, 0, 50000) ); expect(mock.params).toMatchSnapshot(); diff --git a/x-pack/plugins/apm/server/routes/traces/route.ts b/x-pack/plugins/apm/server/routes/traces/route.ts index 336e862bcd09d..39ac9e2b354a0 100644 --- a/x-pack/plugins/apm/server/routes/traces/route.ts +++ b/x-pack/plugins/apm/server/routes/traces/route.ts @@ -6,8 +6,8 @@ */ import * as t from 'io-ts'; +import { nonEmptyStringRt } from '@kbn/io-ts-utils'; import { TraceSearchType } from '../../../common/trace_explorer'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { getSearchTransactionsEvents } from '../../lib/helpers/transactions'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { @@ -22,6 +22,11 @@ import { getTopTracesPrimaryStats } from './get_top_traces_primary_stats'; import { getTraceItems } from './get_trace_items'; import { getTraceSamplesByQuery } from './get_trace_samples_by_query'; import { getRandomSampler } from '../../lib/helpers/get_random_sampler'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; +import { + CriticalPathResponse, + getAggregatedCriticalPath, +} from './get_aggregated_critical_path'; const tracesRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/traces', @@ -44,6 +49,7 @@ const tracesRoute = createApmServerRoute({ }>; }> => { const { + config, params, request, plugins: { security }, @@ -51,13 +57,14 @@ const tracesRoute = createApmServerRoute({ const { environment, kuery, start, end, probability } = params.query; - const [setup, randomSampler] = await Promise.all([ - setupRequest(resources), + const [apmEventClient, randomSampler] = await Promise.all([ + getApmEventClient(resources), getRandomSampler({ security, request, probability }), ]); const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + apmEventClient, + config, kuery, start, end, @@ -66,7 +73,7 @@ const tracesRoute = createApmServerRoute({ return await getTopTracesPrimaryStats({ environment, kuery, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -97,12 +104,11 @@ const tracesByIdRoute = createApmServerRoute({ >; linkedChildrenOfSpanCountBySpanId: Record<string, number>; }> => { - const setup = await setupRequest(resources); - const { params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, config } = resources; const { traceId } = params.path; const { start, end } = params.query; - - return getTraceItems(traceId, setup, start, end); + return getTraceItems(traceId, config, apmEventClient, start, end); }, }); @@ -121,8 +127,8 @@ const rootTransactionByTraceIdRoute = createApmServerRoute({ }> => { const { params } = resources; const { traceId } = params.path; - const setup = await setupRequest(resources); - return getRootTransactionByTraceId(traceId, setup); + const apmEventClient = await getApmEventClient(resources); + return getRootTransactionByTraceId(traceId, apmEventClient); }, }); @@ -141,9 +147,9 @@ const transactionByIdRoute = createApmServerRoute({ }> => { const { params } = resources; const { transactionId } = params.path; - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); return { - transaction: await getTransaction({ transactionId, setup }), + transaction: await getTransaction({ transactionId, apmEventClient }), }; }, }); @@ -173,11 +179,11 @@ const findTracesRoute = createApmServerRoute({ }> => { const { start, end, environment, query, type } = resources.params.query; - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); return { traceSamples: await getTraceSamplesByQuery({ - setup, + apmEventClient, start, end, environment, @@ -188,10 +194,49 @@ const findTracesRoute = createApmServerRoute({ }, }); +const aggregatedCriticalPathRoute = createApmServerRoute({ + endpoint: 'POST /internal/apm/traces/aggregated_critical_path', + params: t.type({ + body: t.intersection([ + t.type({ + traceIds: t.array(t.string), + serviceName: t.union([nonEmptyStringRt, t.null]), + transactionName: t.union([nonEmptyStringRt, t.null]), + }), + rangeRt, + ]), + }), + options: { + tags: ['access:apm'], + }, + handler: async ( + resources + ): Promise<{ criticalPath: CriticalPathResponse | null }> => { + const { + params: { + body: { traceIds, start, end, serviceName, transactionName }, + }, + } = resources; + + const apmEventClient = await getApmEventClient(resources); + + return getAggregatedCriticalPath({ + traceIds, + start, + end, + apmEventClient, + serviceName, + transactionName, + logger: resources.logger, + }); + }, +}); + export const traceRouteRepository = { ...tracesByIdRoute, ...tracesRoute, ...rootTransactionByTraceIdRoute, ...transactionByIdRoute, ...findTracesRoute, + ...aggregatedCriticalPathRoute, }; diff --git a/x-pack/plugins/apm/server/routes/transactions/breakdown/index.test.ts b/x-pack/plugins/apm/server/routes/transactions/breakdown/index.test.ts index 2df04fcdb0548..668b95c7e8db5 100644 --- a/x-pack/plugins/apm/server/routes/transactions/breakdown/index.test.ts +++ b/x-pack/plugins/apm/server/routes/transactions/breakdown/index.test.ts @@ -11,115 +11,111 @@ import noDataResponse from './mock_responses/no_data.json'; import dataResponse from './mock_responses/data.json'; import { APMConfig } from '../../..'; import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; -import { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices'; - -const mockIndices: ApmIndicesConfig = { - sourcemap: 'myIndex', - error: 'myIndex', - onboarding: 'myIndex', - span: 'myIndex', - transaction: 'myIndex', - metric: 'myIndex', - apmAgentConfigurationIndex: 'myIndex', - apmCustomLinkIndex: 'myIndex', -}; - -function getMockSetup(esResponse: any) { - const clientSpy = jest.fn().mockReturnValueOnce(esResponse); - return { - apmEventClient: { search: clientSpy } as any, - internalClient: { search: clientSpy } as any, - config: new Proxy( - {}, - { - get: () => 'myIndex', - } - ) as APMConfig, - indices: mockIndices, - }; + +const mockConfig = new Proxy( + {}, + { + get: () => 'myIndex', + } +) as APMConfig; + +function getMockApmEventClient(esResponse: any) { + const apmEventClientSpy = jest.fn().mockReturnValueOnce(esResponse); + return { apmEventClient: { search: apmEventClientSpy } as any }; } describe('getTransactionBreakdown', () => { - it('returns an empty array if no data is available', async () => { - const response = await getTransactionBreakdown({ - serviceName: 'myServiceName', - transactionType: 'request', - setup: getMockSetup(noDataResponse), - environment: ENVIRONMENT_ALL.value, - kuery: '', - start: 0, - end: 500000, + describe('when no data is available', () => { + const { apmEventClient } = getMockApmEventClient(noDataResponse); + it('returns an empty array if no data is available', async () => { + const response = await getTransactionBreakdown({ + serviceName: 'myServiceName', + transactionType: 'request', + config: mockConfig, + apmEventClient, + environment: ENVIRONMENT_ALL.value, + kuery: '', + start: 0, + end: 500000, + }); + + expect(Object.keys(response.timeseries).length).toBe(0); }); - - expect(Object.keys(response.timeseries).length).toBe(0); }); - it('returns a timeseries grouped by type and subtype', async () => { - const response = await getTransactionBreakdown({ - serviceName: 'myServiceName', - transactionType: 'request', - setup: getMockSetup(dataResponse), - environment: ENVIRONMENT_ALL.value, - kuery: '', - start: 0, - end: 500000, - }); - - const { timeseries } = response; + describe('when data is returned', () => { + it('returns a timeseries grouped by type and subtype', async () => { + const { apmEventClient } = getMockApmEventClient(dataResponse); + const response = await getTransactionBreakdown({ + serviceName: 'myServiceName', + transactionType: 'request', + config: mockConfig, + apmEventClient, + environment: ENVIRONMENT_ALL.value, + kuery: '', + start: 0, + end: 500000, + }); - expect(timeseries.length).toBe(4); + const { timeseries } = response; - const appTimeseries = timeseries[0]; - expect(appTimeseries.title).toBe('app'); - expect(appTimeseries.type).toBe('areaStacked'); - expect(appTimeseries.hideLegend).toBe(false); + expect(timeseries.length).toBe(4); - // empty buckets should result in null values for visible types - expect(appTimeseries.data.length).toBe(276); - expect(appTimeseries.data.length).not.toBe(257); + const appTimeseries = timeseries[0]; + expect(appTimeseries.title).toBe('app'); + expect(appTimeseries.type).toBe('areaStacked'); + expect(appTimeseries.hideLegend).toBe(false); - expect(appTimeseries.data[0].x).toBe(1561102380000); + // empty buckets should result in null values for visible types + expect(appTimeseries.data.length).toBe(276); + expect(appTimeseries.data.length).not.toBe(257); - expect(appTimeseries.data[0].y).toBeCloseTo(0.8689440187037277); - }); + expect(appTimeseries.data[0].x).toBe(1561102380000); - it('should not include more KPIs than MAX_KPIs', async () => { - // @ts-expect-error - constants.MAX_KPIS = 2; - - const response = await getTransactionBreakdown({ - serviceName: 'myServiceName', - transactionType: 'request', - setup: getMockSetup(dataResponse), - environment: ENVIRONMENT_ALL.value, - kuery: '', - start: 0, - end: 500000, + expect(appTimeseries.data[0].y).toBeCloseTo(0.8689440187037277); }); - const { timeseries } = response; - - expect(timeseries.map((serie) => serie.title)).toEqual(['app', 'http']); - }); - - it('fills in gaps for a given timestamp', async () => { - const response = await getTransactionBreakdown({ - serviceName: 'myServiceName', - transactionType: 'request', - setup: getMockSetup(dataResponse), - environment: ENVIRONMENT_ALL.value, - kuery: '', - start: 0, - end: 500000, + it('should not include more KPIs than MAX_KPIs', async () => { + const { apmEventClient } = getMockApmEventClient(dataResponse); + // @ts-expect-error + constants.MAX_KPIS = 2; + + const response = await getTransactionBreakdown({ + serviceName: 'myServiceName', + transactionType: 'request', + config: mockConfig, + apmEventClient, + environment: ENVIRONMENT_ALL.value, + kuery: '', + start: 0, + end: 500000, + }); + const { timeseries } = response; + + expect(timeseries.map((serie) => serie.title)).toEqual(['app', 'http']); }); - const { timeseries } = response; - - const appTimeseries = timeseries.find((series) => series.title === 'app'); - - // missing values should be 0 if other span types do have data for that timestamp - expect((appTimeseries as NonNullable<typeof appTimeseries>).data[1].y).toBe( - 0 - ); + it('fills in gaps for a given timestamp', async () => { + const { apmEventClient } = getMockApmEventClient(dataResponse); + const response = await getTransactionBreakdown({ + serviceName: 'myServiceName', + transactionType: 'request', + config: mockConfig, + apmEventClient, + environment: ENVIRONMENT_ALL.value, + kuery: '', + start: 0, + end: 500000, + }); + + const { timeseries } = response; + + const appTimeseries = timeseries.find((series) => series.title === 'app'); + + // missing values should be 0 if other span types do have data for that timestamp + expect( + (appTimeseries as NonNullable<typeof appTimeseries>).data[1].y + ).toBe(0); + }); }); }); diff --git a/x-pack/plugins/apm/server/routes/transactions/breakdown/index.ts b/x-pack/plugins/apm/server/routes/transactions/breakdown/index.ts index 0c2293ec980c0..5630a4c0c475a 100644 --- a/x-pack/plugins/apm/server/routes/transactions/breakdown/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/breakdown/index.ts @@ -17,16 +17,18 @@ import { TRANSACTION_TYPE, TRANSACTION_NAME, } from '../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../lib/helpers/setup_request'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { getMetricsDateHistogramParams } from '../../../lib/helpers/metrics'; import { MAX_KPIS } from './constants'; import { getVizColorForIndex } from '../../../../common/viz_colors'; +import { APMConfig } from '../../..'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTransactionBreakdown({ environment, kuery, - setup, + config, + apmEventClient, serviceName, transactionName, transactionType, @@ -35,15 +37,14 @@ export async function getTransactionBreakdown({ }: { environment: string; kuery: string; - setup: Setup; + config: APMConfig; + apmEventClient: APMEventClient; serviceName: string; transactionName?: string; transactionType: string; start: number; end: number; }) { - const { apmEventClient, config } = setup; - const subAggs = { sum_all_self_times: { sum: { diff --git a/x-pack/plugins/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts b/x-pack/plugins/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts index 0538832b6e84c..8a5ec8c83814d 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts @@ -4,9 +4,9 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { Setup } from '../../lib/helpers/setup_request'; import { getFailedTransactionRate } from '../../lib/transaction_groups/get_failed_transaction_rate'; import { offsetPreviousPeriodCoordinates } from '../../../common/utils/offset_previous_period_coordinate'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getFailedTransactionRatePeriods({ environment, @@ -14,7 +14,7 @@ export async function getFailedTransactionRatePeriods({ serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -25,7 +25,7 @@ export async function getFailedTransactionRatePeriods({ serviceName: string; transactionType: string; transactionName?: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; start: number; end: number; @@ -37,7 +37,7 @@ export async function getFailedTransactionRatePeriods({ serviceName, transactionTypes: [transactionType], transactionName, - setup, + apmEventClient, searchAggregatedTransactions, }; diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts index 47cc552fe4b54..be534d877d9fd 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts @@ -11,6 +11,7 @@ import { termQuery, } from '@kbn/observability-plugin/server'; import { + FAAS_ID, SERVICE_NAME, TRANSACTION_NAME, TRANSACTION_TYPE, @@ -23,13 +24,13 @@ import { getDurationFieldForTransactions, getProcessorEventForTransactions, } from '../../../lib/helpers/transactions'; -import { Setup } from '../../../lib/helpers/setup_request'; import { getBucketSizeForAggregatedTransactions } from '../../../lib/helpers/get_bucket_size_for_aggregated_transactions'; import { getLatencyAggregation, getLatencyValue, } from '../../../lib/helpers/latency_aggregation_type'; import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export type LatencyChartsSearchResponse = Awaited< ReturnType<typeof searchLatency> @@ -41,27 +42,27 @@ function searchLatency({ serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, latencyAggregationType, start, end, offset, + serverlessId, }: { environment: string; kuery: string; serviceName: string; transactionType: string | undefined; transactionName: string | undefined; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; latencyAggregationType: LatencyAggregationType; start: number; end: number; offset?: string; + serverlessId?: string; }) { - const { apmEventClient } = setup; - const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, @@ -97,6 +98,7 @@ function searchLatency({ ...kqlQuery(kuery), ...termQuery(TRANSACTION_NAME, transactionName), ...termQuery(TRANSACTION_TYPE, transactionType), + ...termQuery(FAAS_ID, serverlessId), ], }, }, @@ -127,24 +129,26 @@ export async function getLatencyTimeseries({ serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, latencyAggregationType, start, end, offset, + serverlessId, }: { environment: string; kuery: string; serviceName: string; transactionType?: string; transactionName?: string; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; latencyAggregationType: LatencyAggregationType; start: number; end: number; offset?: string; + serverlessId?: string; }) { const response = await searchLatency({ environment, @@ -152,12 +156,13 @@ export async function getLatencyTimeseries({ serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, latencyAggregationType, start, end, offset, + serverlessId, }); if (!response.aggregations) { @@ -185,7 +190,7 @@ export async function getLatencyPeriods({ serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, latencyAggregationType, kuery, @@ -197,7 +202,7 @@ export async function getLatencyPeriods({ serviceName: string; transactionType: string | undefined; transactionName: string | undefined; - setup: Setup; + apmEventClient: APMEventClient; searchAggregatedTransactions: boolean; latencyAggregationType: LatencyAggregationType; kuery: string; @@ -210,7 +215,7 @@ export async function getLatencyPeriods({ serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, kuery, environment, diff --git a/x-pack/plugins/apm/server/routes/transactions/get_transaction/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_transaction/index.ts index f3eab3707e1ed..9ca077744899e 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_transaction/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_transaction/index.ts @@ -11,24 +11,22 @@ import { TRACE_ID, TRANSACTION_ID, } from '../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../lib/helpers/setup_request'; import { asMutableArray } from '../../../../common/utils/as_mutable_array'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getTransaction({ transactionId, traceId, - setup, + apmEventClient, start, end, }: { transactionId: string; traceId?: string; - setup: Setup; + apmEventClient: APMEventClient; start?: number; end?: number; }) { - const { apmEventClient } = setup; - const resp = await apmEventClient.search('get_transaction', { apm: { events: [ProcessorEvent.transaction], diff --git a/x-pack/plugins/apm/server/routes/transactions/get_transaction_by_trace/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_transaction_by_trace/index.ts index ca3b3bba12307..0f27d37c2b0ab 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_transaction_by_trace/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_transaction_by_trace/index.ts @@ -10,14 +10,12 @@ import { TRACE_ID, PARENT_ID, } from '../../../../common/elasticsearch_fieldnames'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; export async function getRootTransactionByTraceId( traceId: string, - setup: Setup + apmEventClient: APMEventClient ) { - const { apmEventClient } = setup; - const params = { apm: { events: [ProcessorEvent.transaction as const], diff --git a/x-pack/plugins/apm/server/routes/transactions/queries.test.ts b/x-pack/plugins/apm/server/routes/transactions/queries.test.ts index 4770dce0a1cb2..b87a356c17142 100644 --- a/x-pack/plugins/apm/server/routes/transactions/queries.test.ts +++ b/x-pack/plugins/apm/server/routes/transactions/queries.test.ts @@ -22,11 +22,12 @@ describe('transaction queries', () => { }); it('fetches breakdown data for transactions', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient, mockConfig }) => getTransactionBreakdown({ serviceName: 'foo', transactionType: 'bar', - setup, + config: mockConfig, + apmEventClient: mockApmEventClient, environment: ENVIRONMENT_ALL.value, kuery: '', start: 0, @@ -38,12 +39,13 @@ describe('transaction queries', () => { }); it('fetches breakdown data for transactions for a transaction name', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient, mockConfig }) => getTransactionBreakdown({ serviceName: 'foo', transactionType: 'bar', transactionName: 'baz', - setup, + config: mockConfig, + apmEventClient: mockApmEventClient, environment: ENVIRONMENT_ALL.value, kuery: '', start: 0, @@ -55,14 +57,14 @@ describe('transaction queries', () => { }); it('fetches transaction trace samples', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getTraceSamples({ serviceName: 'foo', transactionName: 'bar', transactionType: 'baz', traceId: 'qux', transactionId: 'quz', - setup, + apmEventClient: mockApmEventClient, environment: ENVIRONMENT_ALL.value, kuery: '', start: 0, @@ -74,11 +76,11 @@ describe('transaction queries', () => { }); it('fetches a transaction', async () => { - mock = await inspectSearchParams((setup) => + mock = await inspectSearchParams(({ mockApmEventClient }) => getTransaction({ transactionId: 'foo', traceId: 'bar', - setup, + apmEventClient: mockApmEventClient, start: 0, end: 50000, }) diff --git a/x-pack/plugins/apm/server/routes/transactions/route.ts b/x-pack/plugins/apm/server/routes/transactions/route.ts index 3bc4dbfe7aae7..4a3ecfe5794ca 100644 --- a/x-pack/plugins/apm/server/routes/transactions/route.ts +++ b/x-pack/plugins/apm/server/routes/transactions/route.ts @@ -12,7 +12,6 @@ import { latencyAggregationTypeRt, } from '../../../common/latency_aggregation_types'; import { getSearchTransactionsEvents } from '../../lib/helpers/transactions'; -import { setupRequest } from '../../lib/helpers/setup_request'; import { getServiceTransactionGroups } from '../services/get_service_transaction_groups'; import { getServiceTransactionGroupDetailedStatisticsPeriods } from '../services/get_service_transaction_group_detailed_statistics'; import { getTransactionBreakdown } from './breakdown'; @@ -23,6 +22,7 @@ import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { offsetRt } from '../../../common/comparison_rt'; import { getTraceSamples } from './trace_samples'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; const transactionGroupsMainStatisticsRoute = createApmServerRoute({ endpoint: @@ -56,8 +56,8 @@ const transactionGroupsMainStatisticsRoute = createApmServerRoute({ isAggregationAccurate: boolean; bucketSize: number; }> => { - const { params } = resources; - const setup = await setupRequest(resources); + const { params, config } = resources; + const apmEventClient = await getApmEventClient(resources); const { path: { serviceName }, query: { @@ -69,9 +69,9 @@ const transactionGroupsMainStatisticsRoute = createApmServerRoute({ end, }, } = params; - const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + apmEventClient, + config, kuery, start, end, @@ -80,7 +80,8 @@ const transactionGroupsMainStatisticsRoute = createApmServerRoute({ return getServiceTransactionGroups({ environment, kuery, - setup, + config, + apmEventClient, serviceName, searchAggregatedTransactions, transactionType, @@ -139,8 +140,8 @@ const transactionGroupsDetailedStatisticsRoute = createApmServerRoute({ impact: number; }>; }> => { - const setup = await setupRequest(resources); - const { params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, config } = resources; const { path: { serviceName }, @@ -158,7 +159,8 @@ const transactionGroupsDetailedStatisticsRoute = createApmServerRoute({ } = params; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + config, + apmEventClient, kuery, start, end, @@ -167,7 +169,7 @@ const transactionGroupsDetailedStatisticsRoute = createApmServerRoute({ return await getServiceTransactionGroupDetailedStatisticsPeriods({ environment, kuery, - setup, + apmEventClient, serviceName, transactionNames, searchAggregatedTransactions, @@ -221,8 +223,8 @@ const transactionLatencyChartsRoute = createApmServerRoute({ overallAvgDuration: null; }; }> => { - const setup = await setupRequest(resources); - const { params, logger } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, logger, config } = resources; const { serviceName } = params.path; const { @@ -237,7 +239,8 @@ const transactionLatencyChartsRoute = createApmServerRoute({ } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + config, + apmEventClient, kuery, start, end, @@ -249,7 +252,7 @@ const transactionLatencyChartsRoute = createApmServerRoute({ serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, logger, start, @@ -298,7 +301,7 @@ const transactionTraceSamplesRoute = createApmServerRoute({ ): Promise<{ traceSamples: Array<{ transactionId: string; traceId: string }>; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); const { params } = resources; const { serviceName } = params.path; const { @@ -324,7 +327,7 @@ const transactionTraceSamplesRoute = createApmServerRoute({ traceId, sampleRangeFrom, sampleRangeTo, - setup, + apmEventClient, start, end, }); @@ -359,8 +362,8 @@ const transactionChartsBreakdownRoute = createApmServerRoute({ legendValue: string; }>; }> => { - const setup = await setupRequest(resources); - const { params } = resources; + const apmEventClient = await getApmEventClient(resources); + const { params, config } = resources; const { serviceName } = params.path; const { environment, kuery, transactionName, transactionType, start, end } = @@ -372,7 +375,8 @@ const transactionChartsBreakdownRoute = createApmServerRoute({ serviceName, transactionName, transactionType, - setup, + config, + apmEventClient, start, end, }); @@ -416,9 +420,9 @@ const transactionChartsErrorRateRoute = createApmServerRoute({ average: null; }; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); - const { params } = resources; + const { params, config } = resources; const { serviceName } = params.path; const { environment, @@ -431,7 +435,8 @@ const transactionChartsErrorRateRoute = createApmServerRoute({ } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + config, + apmEventClient, kuery, start, end, @@ -443,7 +448,7 @@ const transactionChartsErrorRateRoute = createApmServerRoute({ serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -490,15 +495,16 @@ const transactionChartsColdstartRateRoute = createApmServerRoute({ average: null; }; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); - const { params } = resources; + const { params, config } = resources; const { serviceName } = params.path; const { environment, kuery, transactionType, start, end, offset } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + config, + apmEventClient, kuery, start, end, @@ -509,7 +515,7 @@ const transactionChartsColdstartRateRoute = createApmServerRoute({ kuery, serviceName, transactionType, - setup, + apmEventClient, searchAggregatedTransactions, start, end, @@ -557,9 +563,9 @@ const transactionChartsColdstartRateByTransactionNameRoute = average: null; }; }> => { - const setup = await setupRequest(resources); + const apmEventClient = await getApmEventClient(resources); - const { params } = resources; + const { params, config } = resources; const { serviceName } = params.path; const { environment, @@ -572,7 +578,8 @@ const transactionChartsColdstartRateByTransactionNameRoute = } = params.query; const searchAggregatedTransactions = await getSearchTransactionsEvents({ - ...setup, + config, + apmEventClient, kuery, start, end, @@ -584,7 +591,7 @@ const transactionChartsColdstartRateByTransactionNameRoute = serviceName, transactionType, transactionName, - setup, + apmEventClient, searchAggregatedTransactions, start, end, diff --git a/x-pack/plugins/apm/server/routes/transactions/trace_samples/index.ts b/x-pack/plugins/apm/server/routes/transactions/trace_samples/index.ts index 572fa1a1c6d11..9fe3e7ff79335 100644 --- a/x-pack/plugins/apm/server/routes/transactions/trace_samples/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/trace_samples/index.ts @@ -18,7 +18,7 @@ import { TRANSACTION_TYPE, } from '../../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../../common/utils/environment_query'; -import { Setup } from '../../../lib/helpers/setup_request'; +import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; const TRACE_SAMPLES_SIZE = 500; @@ -32,7 +32,7 @@ export async function getTraceSamples({ traceId, sampleRangeFrom, sampleRangeTo, - setup, + apmEventClient, start, end, }: { @@ -45,13 +45,11 @@ export async function getTraceSamples({ traceId: string; sampleRangeFrom?: number; sampleRangeTo?: number; - setup: Setup; + apmEventClient: APMEventClient; start: number; end: number; }) { return withApmSpan('get_trace_samples', async () => { - const { apmEventClient } = setup; - const commonFilters = [ { term: { [SERVICE_NAME]: serviceName } }, { term: { [TRANSACTION_TYPE]: transactionType } }, diff --git a/x-pack/plugins/apm/server/test_helpers/create_apm_users/authentication.ts b/x-pack/plugins/apm/server/test_helpers/create_apm_users/authentication.ts index f3d15ee6db21e..f4ea0629f848b 100644 --- a/x-pack/plugins/apm/server/test_helpers/create_apm_users/authentication.ts +++ b/x-pack/plugins/apm/server/test_helpers/create_apm_users/authentication.ts @@ -15,7 +15,7 @@ export enum ApmUsername { apmReadUserWithoutMlAccess = 'apm_read_user_without_ml_access', apmManageOwnAgentKeys = 'apm_manage_own_agent_keys', apmManageOwnAndCreateAgentKeys = 'apm_manage_own_and_create_agent_keys', - apmMonitorIndices = 'apm_monitor_indices', + apmMonitorClusterAndIndices = 'apm_monitor_cluster_and_indices', } export enum ApmCustomRolename { @@ -23,7 +23,7 @@ export enum ApmCustomRolename { apmAnnotationsWriteUser = 'apm_annotations_write_user', apmManageOwnAgentKeys = 'apm_manage_own_agent_keys', apmManageOwnAndCreateAgentKeys = 'apm_manage_own_and_create_agent_keys', - apmMonitorIndices = 'apm_monitor_indices', + apmMonitorClusterAndIndices = 'apm_monitor_cluster_and_indices', } export const customRoles = { @@ -77,7 +77,7 @@ export const customRoles = { }, ], }, - [ApmCustomRolename.apmMonitorIndices]: { + [ApmCustomRolename.apmMonitorClusterAndIndices]: { elasticsearch: { indices: [ { @@ -85,6 +85,7 @@ export const customRoles = { privileges: ['monitor'], }, ], + cluster: ['monitor'], }, }, }; @@ -118,9 +119,9 @@ export const users: Record< ApmCustomRolename.apmManageOwnAndCreateAgentKeys, ], }, - [ApmUsername.apmMonitorIndices]: { + [ApmUsername.apmMonitorClusterAndIndices]: { builtInRoleNames: ['viewer'], - customRoleNames: [ApmCustomRolename.apmMonitorIndices], + customRoleNames: [ApmCustomRolename.apmMonitorClusterAndIndices], }, }; diff --git a/x-pack/plugins/apm/server/utils/test_helpers.tsx b/x-pack/plugins/apm/server/utils/test_helpers.tsx index c39e2b78d07c8..22b0de8af8e26 100644 --- a/x-pack/plugins/apm/server/utils/test_helpers.tsx +++ b/x-pack/plugins/apm/server/utils/test_helpers.tsx @@ -7,6 +7,8 @@ import type { ESSearchRequest, ESSearchResponse } from '@kbn/es-types'; import { APMConfig } from '..'; +import { APMEventClient } from '../lib/helpers/create_es_client/create_apm_event_client'; +import { APMInternalESClient } from '../lib/helpers/create_es_client/create_internal_es_client'; import { ApmIndicesConfig } from '../routes/settings/apm_indices/get_apm_indices'; interface Options { @@ -16,15 +18,18 @@ interface Options { config?: Partial<APMConfig>; } -interface MockSetup { - apmEventClient: any; - internalClient: any; - config: APMConfig; - indices: ApmIndicesConfig; -} - export async function inspectSearchParams( - fn: (mockSetup: MockSetup) => Promise<any>, + fn: ({ + mockApmEventClient, + mockConfig, + mockInternalESClient, + mockIndices, + }: { + mockApmEventClient: APMEventClient; + mockConfig: APMConfig; + mockInternalESClient: APMInternalESClient; + mockIndices: ApmIndicesConfig; + }) => Promise<any>, options: Options = {} ) { const spy = jest.fn().mockImplementation(async (request) => { @@ -43,8 +48,8 @@ export async function inspectSearchParams( let response; let error; - - const mockApmIndices: { + const mockApmEventClient = { search: spy } as any; + const indices: { [Property in keyof APMConfig['indices']]: string; } = { sourcemap: 'myIndex', @@ -54,43 +59,45 @@ export async function inspectSearchParams( transaction: 'myIndex', metric: 'myIndex', }; - const mockSetup = { - apmEventClient: { search: spy } as any, - internalClient: { search: spy } as any, - config: new Proxy( - {}, - { - get: (_, key: keyof APMConfig) => { - const { config } = options; - if (config?.[key]) { - return config?.[key]; - } + const mockConfig = new Proxy( + {}, + { + get: (_, key: keyof APMConfig) => { + const { config } = options; + if (config?.[key]) { + return config?.[key]; + } - switch (key) { - default: - return 'myIndex'; - case 'indices': - return mockApmIndices; - case 'ui': - return { - enabled: true, - transactionGroupBucketSize: 1000, - maxTraceItems: 1000, - }; - case 'metricsInterval': - return 30; - } - }, - } - ) as APMConfig, - indices: { - ...mockApmIndices, - apmAgentConfigurationIndex: 'myIndex', - apmCustomLinkIndex: 'myIndex', - }, + switch (key) { + default: + return 'myIndex'; + case 'indices': + return indices; + case 'ui': + return { + enabled: true, + transactionGroupBucketSize: 1000, + maxTraceItems: 1000, + }; + case 'metricsInterval': + return 30; + } + }, + } + ) as APMConfig; + const mockInternalESClient = { search: spy } as any; + const mockIndices = { + ...indices, + apmAgentConfigurationIndex: 'myIndex', + apmCustomLinkIndex: 'myIndex', }; try { - response = await fn(mockSetup); + response = await fn({ + mockIndices, + mockApmEventClient, + mockConfig, + mockInternalESClient, + }); } catch (err) { error = err; // we're only extracting the search params diff --git a/x-pack/plugins/apm/tsconfig.json b/x-pack/plugins/apm/tsconfig.json index 2c10a8d175ad1..17ee8b7bcaddd 100644 --- a/x-pack/plugins/apm/tsconfig.json +++ b/x-pack/plugins/apm/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "../../../typings/**/*", @@ -13,11 +12,12 @@ "scripts/**/*", "server/**/*", "typings/**/*", + "jest.config.js", // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 "public/**/*.json", - "server/**/*.json" + "server/**/*.json", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, diff --git a/x-pack/plugins/banners/tsconfig.json b/x-pack/plugins/banners/tsconfig.json index 56c347d985ed2..77b896508fac8 100644 --- a/x-pack/plugins/banners/tsconfig.json +++ b/x-pack/plugins/banners/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["public/**/*", "server/**/*", "common/**/*", "../../../typings/**/*"], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/screenshot_mode/tsconfig.json" }, diff --git a/x-pack/plugins/canvas/public/routes/workpad/hooks/use_autoplay_helper.test.tsx b/x-pack/plugins/canvas/public/routes/workpad/hooks/use_autoplay_helper.test.tsx index 085a9093e8b8a..acbd425e1d245 100644 --- a/x-pack/plugins/canvas/public/routes/workpad/hooks/use_autoplay_helper.test.tsx +++ b/x-pack/plugins/canvas/public/routes/workpad/hooks/use_autoplay_helper.test.tsx @@ -25,7 +25,7 @@ const getContextWrapper: (context: WorkpadRoutingContextType) => FC = <WorkpadRoutingContext.Provider value={context}>{children}</WorkpadRoutingContext.Provider>; describe('useAutoplayHelper', () => { - beforeEach(() => jest.useFakeTimers()); + beforeEach(() => jest.useFakeTimers('legacy')); test('starts the timer when fullscreen and autoplay is on', () => { const context = getMockedContext({ isFullscreen: true, @@ -47,7 +47,7 @@ describe('useAutoplayHelper', () => { const { rerender } = renderHook(useAutoplayHelper, { wrapper: getContextWrapper(context) }); - jest.runTimersToTime(context.autoplayInterval - 1); + jest.advanceTimersByTime(context.autoplayInterval - 1); context.isAutoplayPaused = true; diff --git a/x-pack/plugins/canvas/public/routes/workpad/hooks/use_refresh_helper.test.tsx b/x-pack/plugins/canvas/public/routes/workpad/hooks/use_refresh_helper.test.tsx index d502e634ede04..ac64f509b56b4 100644 --- a/x-pack/plugins/canvas/public/routes/workpad/hooks/use_refresh_helper.test.tsx +++ b/x-pack/plugins/canvas/public/routes/workpad/hooks/use_refresh_helper.test.tsx @@ -37,7 +37,7 @@ const getContextWrapper: (context: WorkpadRoutingContextType) => FC = describe('useRefreshHelper', () => { beforeEach(() => { jest.resetAllMocks(); - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); test('starts a timer to refresh', () => { @@ -73,7 +73,7 @@ describe('useRefreshHelper', () => { mockGetState.mockReturnValue(state); const { rerender } = renderHook(useRefreshHelper, { wrapper: getContextWrapper(context) }); - jest.runTimersToTime(context.refreshInterval - 1); + jest.advanceTimersByTime(context.refreshInterval - 1); expect(mockDispatch).not.toHaveBeenCalledWith(refreshAction); state.transient.inFlight = true; diff --git a/x-pack/plugins/canvas/shareable_runtime/index.ts b/x-pack/plugins/canvas/shareable_runtime/index.ts index 41ecd875c4326..aee57c3780503 100644 --- a/x-pack/plugins/canvas/shareable_runtime/index.ts +++ b/x-pack/plugins/canvas/shareable_runtime/index.ts @@ -6,7 +6,7 @@ */ export * from './api'; -import '@kbn/core/server/core_app/assets/legacy_light_theme.css'; +import '@kbn/core-apps-server-internal/assets/legacy_light_theme.css'; import '../public/style/index.scss'; import '@elastic/eui/dist/eui_theme_light.css'; import '@kbn/ui-framework/dist/kui_light.css'; diff --git a/x-pack/plugins/canvas/storybook/storyshots.skipped_test.tsx b/x-pack/plugins/canvas/storybook/storyshots.skipped_test.tsx new file mode 100644 index 0000000000000..1088113124578 --- /dev/null +++ b/x-pack/plugins/canvas/storybook/storyshots.skipped_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. + */ + +// This file is skipped +// @storybook/addon-storyshots is not supported in Jest 27+ https://github.com/storybookjs/storybook/issues/15916 + +import fs from 'fs'; +import { ReactChildren, createElement } from 'react'; +import path from 'path'; +import moment from 'moment'; +import 'moment-timezone'; +import ReactDOM from 'react-dom'; +import { shallow } from 'enzyme'; +import { create, act } from 'react-test-renderer'; + +import initStoryshots, { Stories2SnapsConverter } from '@storybook/addon-storyshots'; +// @ts-expect-error untyped library +import styleSheetSerializer from 'jest-styled-components/src/styleSheetSerializer'; +import { addSerializer } from 'jest-specific-snapshot'; +import { createSerializer } from '@emotion/jest'; +import { replaceEmotionPrefix } from '@elastic/eui/lib/test'; + +// Several of the renderers, used by the runtime, use jQuery. +import jquery from 'jquery'; +// @ts-expect-error jQuery global +global.$ = jquery; +// @ts-expect-error jQuery global +global.jQuery = jquery; + +// Set our default timezone to UTC for tests so we can generate predictable snapshots +moment.tz.setDefault('UTC'); + +// Freeze time for the tests for predictable snapshots +const testTime = new Date(Date.UTC(2019, 5, 1)); // June 1 2019 +Date.now = jest.fn(() => testTime.getTime()); + +// Mock telemetry service +jest.mock('../public/lib/ui_metric', () => ({ trackCanvasUiMetric: () => {} })); + +// Mock React Portal for components that use modals, tooltips, etc +// @ts-expect-error Portal mocks are notoriously difficult to type +ReactDOM.createPortal = jest.fn((element) => element); + +// To be resolved by EUI team. +// https://github.com/elastic/eui/issues/3712 +jest.mock('@elastic/eui/lib/components/overlay_mask/overlay_mask', () => { + return { + EuiOverlayMask: ({ children }: { children: ReactChildren }) => children, + }; +}); + +// Disabling this test due to https://github.com/elastic/eui/issues/2242 +jest.mock( + '../public/components/workpad_header/share_menu/flyout/__stories__/flyout.stories', + () => { + return 'Disabled Panel'; + } +); + +// @ts-expect-error untyped library +import { EuiObserver } from '@elastic/eui/test-env/components/observer/observer'; +jest.mock('@elastic/eui/test-env/components/observer/observer'); +EuiObserver.mockImplementation(() => 'EuiObserver'); + +import { ExpressionInput } from '@kbn/presentation-util-plugin/public/components/expression_input'; +jest.mock('@kbn/presentation-util-plugin/public/components/expression_input'); +// @ts-expect-error +ExpressionInput.mockImplementation(() => 'ExpressionInput'); + +// @ts-expect-error untyped library +import Dropzone from 'react-dropzone'; +jest.mock('react-dropzone'); +Dropzone.mockImplementation(() => 'Dropzone'); + +// This element uses a `ref` and cannot be rendered by Jest snapshots. +import { RenderedElement } from '../shareable_runtime/components/rendered_element'; +jest.mock('../shareable_runtime/components/rendered_element'); +// @ts-expect-error +RenderedElement.mockImplementation(() => 'RenderedElement'); + +// Some of the code requires that this directory exists, but the tests don't actually require any css to be present +const cssDir = path.resolve(__dirname, '../../../../built_assets/css'); +if (!fs.existsSync(cssDir)) { + fs.mkdirSync(cssDir, { recursive: true }); +} + +addSerializer(styleSheetSerializer); + +const emotionSerializer = createSerializer({ + classNameReplacer: replaceEmotionPrefix, + includeStyles: false, +}); +addSerializer(emotionSerializer); + +const converter = new Stories2SnapsConverter(); + +// Initialize Storyshots and build the Jest Snapshots +initStoryshots({ + configPath: path.resolve(__dirname), + framework: 'react', + asyncJest: true, + test: async ({ story, context, done }) => { + const renderer = create(createElement(story.render)); + // wait until the element will perform all renders and resolve all promises (lazy loading, especially) + await act(() => new Promise((resolve) => setTimeout(resolve, 0))); + // save each snapshot to a different file (similar to "multiSnapshotWithOptions") + const snapshotFileName = converter.getSnapshotFileName(context); + expect(renderer).toMatchSpecificSnapshot(snapshotFileName); + done?.(); + }, + // Don't snapshot tests that start with 'redux' + storyNameRegex: /^((?!.*?redux).)*$/, + renderer: shallow, +}); diff --git a/x-pack/plugins/canvas/storybook/storyshots.test.tsx b/x-pack/plugins/canvas/storybook/storyshots.test.tsx deleted file mode 100644 index d880a31f446d3..0000000000000 --- a/x-pack/plugins/canvas/storybook/storyshots.test.tsx +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import fs from 'fs'; -import { ReactChildren, createElement } from 'react'; -import path from 'path'; -import moment from 'moment'; -import 'moment-timezone'; -import ReactDOM from 'react-dom'; -import { shallow } from 'enzyme'; -import { create, act } from 'react-test-renderer'; - -import initStoryshots, { Stories2SnapsConverter } from '@storybook/addon-storyshots'; -// @ts-expect-error untyped library -import styleSheetSerializer from 'jest-styled-components/src/styleSheetSerializer'; -import { addSerializer } from 'jest-specific-snapshot'; -import { createSerializer } from '@emotion/jest'; -import { replaceEmotionPrefix } from '@elastic/eui/lib/test'; - -// Several of the renderers, used by the runtime, use jQuery. -import jquery from 'jquery'; -// @ts-expect-error jQuery global -global.$ = jquery; -// @ts-expect-error jQuery global -global.jQuery = jquery; - -// Set our default timezone to UTC for tests so we can generate predictable snapshots -moment.tz.setDefault('UTC'); - -// Freeze time for the tests for predictable snapshots -const testTime = new Date(Date.UTC(2019, 5, 1)); // June 1 2019 -Date.now = jest.fn(() => testTime.getTime()); - -// Mock telemetry service -jest.mock('../public/lib/ui_metric', () => ({ trackCanvasUiMetric: () => {} })); - -// Mock React Portal for components that use modals, tooltips, etc -// @ts-expect-error Portal mocks are notoriously difficult to type -ReactDOM.createPortal = jest.fn((element) => element); - -// To be resolved by EUI team. -// https://github.com/elastic/eui/issues/3712 -jest.mock('@elastic/eui/lib/components/overlay_mask/overlay_mask', () => { - return { - EuiOverlayMask: ({ children }: { children: ReactChildren }) => children, - }; -}); - -// Disabling this test due to https://github.com/elastic/eui/issues/2242 -jest.mock( - '../public/components/workpad_header/share_menu/flyout/__stories__/flyout.stories', - () => { - return 'Disabled Panel'; - } -); - -// @ts-expect-error untyped library -import { EuiObserver } from '@elastic/eui/test-env/components/observer/observer'; -jest.mock('@elastic/eui/test-env/components/observer/observer'); -EuiObserver.mockImplementation(() => 'EuiObserver'); - -import { ExpressionInput } from '@kbn/presentation-util-plugin/public/components/expression_input'; -jest.mock('@kbn/presentation-util-plugin/public/components/expression_input'); -// @ts-expect-error -ExpressionInput.mockImplementation(() => 'ExpressionInput'); - -// @ts-expect-error untyped library -import Dropzone from 'react-dropzone'; -jest.mock('react-dropzone'); -Dropzone.mockImplementation(() => 'Dropzone'); - -// This element uses a `ref` and cannot be rendered by Jest snapshots. -import { RenderedElement } from '../shareable_runtime/components/rendered_element'; -jest.mock('../shareable_runtime/components/rendered_element'); -// @ts-expect-error -RenderedElement.mockImplementation(() => 'RenderedElement'); - -// Some of the code requires that this directory exists, but the tests don't actually require any css to be present -const cssDir = path.resolve(__dirname, '../../../../built_assets/css'); -if (!fs.existsSync(cssDir)) { - fs.mkdirSync(cssDir, { recursive: true }); -} - -addSerializer(styleSheetSerializer); - -const emotionSerializer = createSerializer({ - classNameReplacer: replaceEmotionPrefix, - includeStyles: false, -}); -addSerializer(emotionSerializer); - -const converter = new Stories2SnapsConverter(); - -// Initialize Storyshots and build the Jest Snapshots -initStoryshots({ - configPath: path.resolve(__dirname), - framework: 'react', - asyncJest: true, - test: async ({ story, context, done }) => { - const renderer = create(createElement(story.render)); - // wait until the element will perform all renders and resolve all promises (lazy loading, especially) - await act(() => new Promise((resolve) => setTimeout(resolve, 0))); - // save each snapshot to a different file (similar to "multiSnapshotWithOptions") - const snapshotFileName = converter.getSnapshotFileName(context); - expect(renderer).toMatchSpecificSnapshot(snapshotFileName); - done?.(); - }, - // Don't snapshot tests that start with 'redux' - storyNameRegex: /^((?!.*?redux).)*$/, - renderer: shallow, -}); diff --git a/x-pack/plugins/canvas/tsconfig.json b/x-pack/plugins/canvas/tsconfig.json index f0dd93fa0f7a0..32e1e6e6d5842 100644 --- a/x-pack/plugins/canvas/tsconfig.json +++ b/x-pack/plugins/canvas/tsconfig.json @@ -4,10 +4,14 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, // the plugin contains some heavy json files - "resolveJsonModule": false + "resolveJsonModule": false, + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "../../../typings/**/*", @@ -22,7 +26,8 @@ "tasks/mocks/*", "types/**/*" ], - "references": [ + "kbn_references": [ + { "path": "../../../src/setup_node_env/tsconfig.json" }, { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/bfetch/tsconfig.json" }, { "path": "../../../src/plugins/charts/tsconfig.json" }, diff --git a/x-pack/plugins/cases/common/api/cases/case.ts b/x-pack/plugins/cases/common/api/cases/case.ts index a6b81dc42af74..ecda555f49553 100644 --- a/x-pack/plugins/cases/common/api/cases/case.ts +++ b/x-pack/plugins/cases/common/api/cases/case.ts @@ -14,27 +14,21 @@ import { CasesStatusResponseRt, CaseStatusRt } from './status'; import { CaseConnectorRt } from '../connectors'; import { CaseAssigneesRt } from './assignee'; -const BucketsAggs = rt.array( - rt.type({ - key: rt.string, - }) -); +export const AttachmentTotalsRt = rt.type({ + alerts: rt.number, + userComments: rt.number, +}); -export const GetCaseIdsByAlertIdAggsRt = rt.type({ - references: rt.type({ - doc_count: rt.number, - caseIds: rt.type({ - buckets: BucketsAggs, - }), - }), +export const RelatedCaseInfoRt = rt.type({ + id: rt.string, + title: rt.string, + description: rt.string, + status: CaseStatusRt, + createdAt: rt.string, + totals: AttachmentTotalsRt, }); -export const CasesByAlertIdRt = rt.array( - rt.type({ - id: rt.string, - title: rt.string, - }) -); +export const CasesByAlertIdRt = rt.array(RelatedCaseInfoRt); export const SettingsRt = rt.type({ syncAlerts: rt.boolean, @@ -350,5 +344,6 @@ export type CaseExternalServiceBasic = rt.TypeOf<typeof CaseExternalServiceBasic export type AllTagsFindRequest = rt.TypeOf<typeof AllTagsFindRequestRt>; export type AllReportersFindRequest = AllTagsFindRequest; -export type GetCaseIdsByAlertIdAggs = rt.TypeOf<typeof GetCaseIdsByAlertIdAggsRt>; +export type AttachmentTotals = rt.TypeOf<typeof AttachmentTotalsRt>; +export type RelatedCaseInfo = rt.TypeOf<typeof RelatedCaseInfoRt>; export type CasesByAlertId = rt.TypeOf<typeof CasesByAlertIdRt>; diff --git a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx index 89bd623307f1f..0ba5a65bf3207 100644 --- a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx @@ -29,7 +29,7 @@ export interface AllCasesSelectorModalProps { const Modal = styled(EuiModal)` ${({ theme }) => ` - width: ${theme.eui.euiBreakpoints.xl}; + min-width: ${theme.eui.euiBreakpoints.l}; max-width: ${theme.eui.euiBreakpoints.xl}; `} `; diff --git a/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.test.tsx b/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.test.tsx index df2ba80901738..effa3d450af89 100644 --- a/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.test.tsx +++ b/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.test.tsx @@ -44,4 +44,24 @@ describe('CreateCaseFlyout', () => { }); expect(onClose).toBeCalled(); }); + + it('renders headerContent when passed', async () => { + const headerContent = <p data-test-subj="testing123" />; + const { getByTestId } = mockedContext.render( + <CreateCaseFlyout {...defaultProps} headerContent={headerContent} /> + ); + + await act(async () => { + expect(getByTestId('testing123')).toBeTruthy(); + expect(getByTestId('create-case-flyout-header').children.length).toEqual(2); + }); + }); + + it('does not render headerContent when undefined', async () => { + const { getByTestId } = mockedContext.render(<CreateCaseFlyout {...defaultProps} />); + + await act(async () => { + expect(getByTestId('create-case-flyout-header').children.length).toEqual(1); + }); + }); }); diff --git a/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx b/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx index 75a18f2e70209..8f5e420f6b79d 100644 --- a/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx +++ b/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx @@ -25,6 +25,7 @@ export interface CreateCaseFlyoutProps { onClose?: () => void; onSuccess?: (theCase: Case) => Promise<void>; attachments?: CaseAttachmentsWithoutOwner; + headerContent?: React.ReactNode; } const StyledFlyout = styled(EuiFlyout)` @@ -71,9 +72,10 @@ const FormWrapper = styled.div` `; export const CreateCaseFlyout = React.memo<CreateCaseFlyoutProps>( - ({ afterCaseCreated, onClose, onSuccess, attachments }) => { + ({ afterCaseCreated, onClose, onSuccess, attachments, headerContent }) => { const handleCancel = onClose || function () {}; const handleOnSuccess = onSuccess || async function () {}; + return ( <QueryClientProvider client={casesQueryClient}> <GlobalStyle /> @@ -83,10 +85,11 @@ export const CreateCaseFlyout = React.memo<CreateCaseFlyoutProps>( // maskProps is needed in order to apply the z-index to the parent overlay element, not to the flyout only maskProps={{ className: maskOverlayClassName }} > - <EuiFlyoutHeader hasBorder> + <EuiFlyoutHeader data-test-subj="create-case-flyout-header" hasBorder> <EuiTitle size="m"> <h2>{i18n.CREATE_CASE_TITLE}</h2> </EuiTitle> + {headerContent && headerContent} </EuiFlyoutHeader> <StyledEuiFlyoutBody> <FormWrapper> diff --git a/x-pack/plugins/cases/public/components/create/flyout/use_cases_add_to_new_case_flyout.tsx b/x-pack/plugins/cases/public/components/create/flyout/use_cases_add_to_new_case_flyout.tsx index 86b03f46bf745..a92046e8c9928 100644 --- a/x-pack/plugins/cases/public/components/create/flyout/use_cases_add_to_new_case_flyout.tsx +++ b/x-pack/plugins/cases/public/components/create/flyout/use_cases_add_to_new_case_flyout.tsx @@ -5,6 +5,7 @@ * 2.0. */ +import type React from 'react'; import { useCallback } from 'react'; import type { CaseAttachmentsWithoutOwner } from '../../../types'; import { useCasesToast } from '../../../common/use_cases_toast'; @@ -29,12 +30,16 @@ export const useCasesAddToNewCaseFlyout = (props: AddToNewCaseFlyoutProps = {}) }, [dispatch]); const openFlyout = useCallback( - ({ attachments }: { attachments?: CaseAttachmentsWithoutOwner } = {}) => { + ({ + attachments, + headerContent, + }: { attachments?: CaseAttachmentsWithoutOwner; headerContent?: React.ReactNode } = {}) => { dispatch({ type: CasesContextStoreActionsList.OPEN_CREATE_CASE_FLYOUT, payload: { ...props, attachments, + headerContent, onClose: () => { closeFlyout(); if (props.onClose) { diff --git a/x-pack/plugins/cases/public/components/links/index.test.tsx b/x-pack/plugins/cases/public/components/links/index.test.tsx index e2da1a28261e7..2fd05e45ade25 100644 --- a/x-pack/plugins/cases/public/components/links/index.test.tsx +++ b/x-pack/plugins/cases/public/components/links/index.test.tsx @@ -74,7 +74,7 @@ describe('Configuration button', () => { test('it shows the tooltip when hovering the button', () => { // Use fake timers so we don't have to wait for the EuiToolTip timeout - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const msgTooltip = 'My message tooltip'; const titleTooltip = 'My title'; diff --git a/x-pack/plugins/cases/public/components/user_actions/use_user_actions_handler.test.tsx b/x-pack/plugins/cases/public/components/user_actions/use_user_actions_handler.test.tsx index 510be840d5436..bb663dd89bd10 100644 --- a/x-pack/plugins/cases/public/components/user_actions/use_user_actions_handler.test.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/use_user_actions_handler.test.tsx @@ -28,7 +28,7 @@ const openLensModal = jest.fn(); describe('useUserActionsHandler', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); jest.spyOn(global, 'setTimeout'); }); diff --git a/x-pack/plugins/cases/server/client/cases/get.ts b/x-pack/plugins/cases/server/client/cases/get.ts index 27d098702f4c8..4f219db2c28f7 100644 --- a/x-pack/plugins/cases/server/client/cases/get.ts +++ b/x-pack/plugins/cases/server/client/cases/get.ts @@ -19,6 +19,7 @@ import type { CasesByAlertIDRequest, CasesByAlertId, CaseAttributes, + AttachmentTotals, } from '../../../common/api'; import { CaseResponseRt, @@ -62,9 +63,10 @@ export const getCasesByAlertID = async ( clientArgs: CasesClientArgs ): Promise<CasesByAlertId> => { const { - services: { caseService }, + services: { caseService, attachmentService }, logger, authorization, + unsecuredSavedObjectsClient, } = clientArgs; try { @@ -104,6 +106,11 @@ export const getCasesByAlertID = async ( return []; } + const commentStats = await attachmentService.getCaseCommentStats({ + unsecuredSavedObjectsClient, + caseIds, + }); + const casesInfo = await caseService.getCases({ caseIds, }); @@ -125,6 +132,10 @@ export const getCasesByAlertID = async ( validCasesInfo.map((caseInfo) => ({ id: caseInfo.id, title: caseInfo.attributes.title, + description: caseInfo.attributes.description, + status: caseInfo.attributes.status, + createdAt: caseInfo.attributes.created_at, + totals: getAttachmentTotalsForCaseId(caseInfo.id, commentStats), })) ); } catch (error) { @@ -138,6 +149,9 @@ export const getCasesByAlertID = async ( } }; +const getAttachmentTotalsForCaseId = (id: string, stats: Map<string, AttachmentTotals>) => + stats.get(id) ?? { alerts: 0, userComments: 0 }; + /** * The parameters for retrieving a case */ diff --git a/x-pack/plugins/cases/server/services/attachments/index.ts b/x-pack/plugins/cases/server/services/attachments/index.ts index e12ff71a20cf9..325038b016c45 100644 --- a/x-pack/plugins/cases/server/services/attachments/index.ts +++ b/x-pack/plugins/cases/server/services/attachments/index.ts @@ -20,6 +20,7 @@ import type { import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { KueryNode } from '@kbn/es-query'; import type { + AttachmentTotals, AttributesTypeAlerts, CommentAttributes as AttachmentAttributes, CommentAttributesWithoutRefs as AttachmentAttributesWithoutRefs, @@ -93,11 +94,6 @@ interface BulkUpdateAttachmentArgs extends ClientArgs, IndexRefresh { comments: UpdateArgs[]; } -interface CommentStats { - nonAlerts: number; - alerts: number; -} - export class AttachmentService { constructor( private readonly log: Logger, @@ -463,7 +459,7 @@ export class AttachmentService { }: { unsecuredSavedObjectsClient: SavedObjectsClientContract; caseIds: string[]; - }): Promise<Map<string, CommentStats>> { + }): Promise<Map<string, AttachmentTotals>> { if (caseIds.length <= 0) { return new Map(); } @@ -498,11 +494,11 @@ export class AttachmentService { return ( res.aggregations?.references.caseIds.buckets.reduce((acc, idBucket) => { acc.set(idBucket.key, { - nonAlerts: idBucket.reverse.comments.doc_count, + userComments: idBucket.reverse.comments.doc_count, alerts: idBucket.reverse.alerts.value, }); return acc; - }, new Map<string, CommentStats>()) ?? new Map() + }, new Map<string, AttachmentTotals>()) ?? new Map() ); } diff --git a/x-pack/plugins/cases/server/services/cases/index.ts b/x-pack/plugins/cases/server/services/cases/index.ts index 8b0a5e70f925e..8359675a0ce0b 100644 --- a/x-pack/plugins/cases/server/services/cases/index.ts +++ b/x-pack/plugins/cases/server/services/cases/index.ts @@ -28,7 +28,6 @@ import { MAX_DOCS_PER_PAGE, } from '../../../common/constants'; import type { - GetCaseIdsByAlertIdAggs, CaseResponse, CasesFindRequest, CommentAttributes, @@ -122,6 +121,15 @@ interface GetReportersArgs { filter?: KueryNode; } +interface GetCaseIdsByAlertIdAggs { + references: { + doc_count: number; + caseIds: { + buckets: Array<{ key: string }>; + }; + }; +} + export class CasesService { private readonly log: Logger; private readonly unsecuredSavedObjectsClient: SavedObjectsClientContract; @@ -222,13 +230,13 @@ export class CasesService { const casesWithComments = new Map<string, CaseResponse>(); for (const [id, caseInfo] of casesMap.entries()) { - const { alerts, nonAlerts } = commentTotals.get(id) ?? { alerts: 0, nonAlerts: 0 }; + const { alerts, userComments } = commentTotals.get(id) ?? { alerts: 0, userComments: 0 }; casesWithComments.set( id, flattenCaseSavedObject({ savedObject: caseInfo, - totalComment: nonAlerts, + totalComment: userComments, totalAlerts: alerts, }) ); diff --git a/x-pack/plugins/cases/tsconfig.json b/x-pack/plugins/cases/tsconfig.json index b893fcfc9b277..0237880148358 100644 --- a/x-pack/plugins/cases/tsconfig.json +++ b/x-pack/plugins/cases/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "server/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, // optionalPlugins from ./kibana.json diff --git a/x-pack/plugins/cloud/tsconfig.json b/x-pack/plugins/cloud/tsconfig.json index ca9ba32ed10b0..523869f892d3a 100644 --- a/x-pack/plugins/cloud/tsconfig.json +++ b/x-pack/plugins/cloud/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, }, "include": [ ".storybook/**/*", @@ -13,7 +12,7 @@ "server/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, ] diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/tsconfig.json b/x-pack/plugins/cloud_integrations/cloud_chat/tsconfig.json index 967962363be2c..bc4d834ed6971 100644 --- a/x-pack/plugins/cloud_integrations/cloud_chat/tsconfig.json +++ b/x-pack/plugins/cloud_integrations/cloud_chat/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, }, "include": [ ".storybook/**/*", @@ -13,7 +12,7 @@ "server/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../cloud/tsconfig.json" }, { "path": "../../security/tsconfig.json" }, diff --git a/x-pack/plugins/cloud_integrations/cloud_experiments/common/metadata_service/metadata_service.test.ts b/x-pack/plugins/cloud_integrations/cloud_experiments/common/metadata_service/metadata_service.test.ts index 8764eb434213e..fd955a44ee9cc 100644 --- a/x-pack/plugins/cloud_integrations/cloud_experiments/common/metadata_service/metadata_service.test.ts +++ b/x-pack/plugins/cloud_integrations/cloud_experiments/common/metadata_service/metadata_service.test.ts @@ -20,7 +20,7 @@ jest.mock('rxjs', () => { }); describe('MetadataService', () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); let metadataService: MetadataService; @@ -43,12 +43,12 @@ describe('MetadataService', () => { }); test( - 'emits in_trial when trial_end_date is provided', + 'emits inTrial when trialEndDate is provided', fakeSchedulers(async (advance) => { const initialMetadata = { userId: 'fake-user-id', kibanaVersion: 'version', - trial_end_date: new Date(0).toISOString(), + trialEndDate: new Date(0).toISOString(), }; metadataService.setup(initialMetadata); @@ -62,7 +62,7 @@ describe('MetadataService', () => { await new Promise((resolve) => process.nextTick(resolve)); // The timer triggers a promise, so we need to skip to the next tick await expect(firstValueFrom(metadataService.userMetadata$)).resolves.toStrictEqual({ ...initialMetadata, - in_trial: false, + inTrial: false, }); }) ); @@ -75,9 +75,9 @@ describe('MetadataService', () => { }); test( - 'emits has_data after resolving the `hasUserDataView`', + 'emits hasData after resolving the `hasUserDataView`', fakeSchedulers(async (advance) => { - metadataService.start({ hasDataFetcher: async () => ({ has_data: true }) }); + metadataService.start({ hasDataFetcher: async () => ({ hasData: true }) }); // Still equals initialMetadata await expect(firstValueFrom(metadataService.userMetadata$)).resolves.toStrictEqual( @@ -89,7 +89,7 @@ describe('MetadataService', () => { await new Promise((resolve) => process.nextTick(resolve)); // The timer triggers a promise, so we need to skip to the next tick await expect(firstValueFrom(metadataService.userMetadata$)).resolves.toStrictEqual({ ...initialMetadata, - has_data: true, + hasData: true, }); }) ); diff --git a/x-pack/plugins/cloud_integrations/cloud_experiments/common/metadata_service/metadata_service.ts b/x-pack/plugins/cloud_integrations/cloud_experiments/common/metadata_service/metadata_service.ts index 6691211b7b01c..dacdd7d3b4799 100644 --- a/x-pack/plugins/cloud_integrations/cloud_experiments/common/metadata_service/metadata_service.ts +++ b/x-pack/plugins/cloud_integrations/cloud_experiments/common/metadata_service/metadata_service.ts @@ -21,18 +21,18 @@ import { import { type Duration } from 'moment'; export interface MetadataServiceStartContract { - hasDataFetcher: () => Promise<{ has_data: boolean }>; + hasDataFetcher: () => Promise<{ hasData: boolean }>; } export interface UserMetadata extends Record<string, string | boolean | number | undefined> { // Static values userId: string; kibanaVersion: string; - trial_end_date?: string; - is_elastic_staff_owned?: boolean; + trialEndDate?: string; + isElasticStaff?: boolean; // Dynamic/calculated values - in_trial?: boolean; - has_data?: boolean; + inTrial?: boolean; + hasData?: boolean; } export interface MetadataServiceConfig { @@ -48,14 +48,14 @@ export class MetadataService { public setup(initialUserMetadata: UserMetadata) { this._userMetadata$.next(initialUserMetadata); - // Calculate `in_trial` based on the `trial_end_date`. + // Calculate `inTrial` based on the `trialEndDate`. // Elastic Cloud allows customers to end their trials earlier or even extend it in some cases, but this is a good compromise for now. - const trialEndDate = initialUserMetadata.trial_end_date; + const trialEndDate = initialUserMetadata.trialEndDate; if (trialEndDate) { this.scheduleUntil( - () => ({ in_trial: Date.now() <= new Date(trialEndDate).getTime() }), - // Stop recalculating in_trial when the user is no-longer in trial - (metadata) => metadata.in_trial === false + () => ({ inTrial: Date.now() <= new Date(trialEndDate).getTime() }), + // Stop recalculating inTrial when the user is no-longer in trial + (metadata) => metadata.inTrial === false ); } } @@ -64,7 +64,7 @@ export class MetadataService { return this._userMetadata$.pipe( filter(Boolean), // Ensure we don't return undefined debounceTime(100), // Swallows multiple emissions that may occur during bootstrap - distinct((meta) => [meta.in_trial, meta.has_data].join('-')), // Checks if any of the dynamic fields have changed + distinct((meta) => [meta.inTrial, meta.hasData].join('-')), // Checks if any of the dynamic fields have changed shareReplay(1) ); } @@ -76,7 +76,7 @@ export class MetadataService { this.scheduleUntil( async () => hasDataFetcher(), // Stop checking the moment the user has any data - (metadata) => metadata.has_data === true + (metadata) => metadata.hasData === true ); } diff --git a/x-pack/plugins/cloud_integrations/cloud_experiments/public/plugin.test.ts b/x-pack/plugins/cloud_integrations/cloud_experiments/public/plugin.test.ts index 9c1e3d25537fd..05ce6dddf3615 100644 --- a/x-pack/plugins/cloud_integrations/cloud_experiments/public/plugin.test.ts +++ b/x-pack/plugins/cloud_integrations/cloud_experiments/public/plugin.test.ts @@ -128,9 +128,9 @@ describe('Cloud Experiments public plugin', () => { }); expect(metadataServiceSetupSpy).toHaveBeenCalledWith({ - is_elastic_staff_owned: true, + isElasticStaff: true, kibanaVersion: 'version', - trial_end_date: '2020-10-01T14:13:12.000Z', + trialEndDate: '2020-10-01T14:13:12.000Z', userId: '1c2412b751f056aef6e340efa5637d137442d489a4b1e3117071e7c87f8523f2', }); }); @@ -170,7 +170,7 @@ describe('Cloud Experiments public plugin', () => { ); }); - test('triggers a userMetadataUpdate for `has_data`', async () => { + test('triggers a userMetadataUpdate for `hasData`', async () => { plugin.setup(coreMock.createSetup(), { cloud: { ...cloudMock.createSetup(), isCloudEnabled: true }, }); @@ -184,7 +184,7 @@ describe('Cloud Experiments public plugin', () => { // For some reason, fakeSchedulers is not working on browser-side tests :shrug: expect(launchDarklyInstanceMock.updateUserMetadata).toHaveBeenCalledWith( expect.objectContaining({ - has_data: true, + hasData: true, }) ); }); diff --git a/x-pack/plugins/cloud_integrations/cloud_experiments/public/plugin.ts b/x-pack/plugins/cloud_integrations/cloud_experiments/public/plugin.ts index 164d6e45c5294..90c43fb475a60 100755 --- a/x-pack/plugins/cloud_integrations/cloud_experiments/public/plugin.ts +++ b/x-pack/plugins/cloud_integrations/cloud_experiments/public/plugin.ts @@ -82,8 +82,8 @@ export class CloudExperimentsPlugin this.metadataService.setup({ userId: sha256(deps.cloud.cloudId), kibanaVersion: this.kibanaVersion, - trial_end_date: deps.cloud.trialEndDate?.toISOString(), - is_elastic_staff_owned: deps.cloud.isElasticStaffOwned, + trialEndDate: deps.cloud.trialEndDate?.toISOString(), + isElasticStaff: deps.cloud.isElasticStaffOwned, }); } } @@ -98,7 +98,7 @@ export class CloudExperimentsPlugin ): CloudExperimentsPluginStart { if (cloud.isCloudEnabled) { this.metadataService.start({ - hasDataFetcher: async () => ({ has_data: await dataViews.hasData.hasUserDataView() }), + hasDataFetcher: async () => ({ hasData: await dataViews.hasData.hasUserDataView() }), }); // We only subscribe to the user metadata updates if Cloud is enabled. diff --git a/x-pack/plugins/cloud_integrations/cloud_experiments/server/plugin.test.ts b/x-pack/plugins/cloud_integrations/cloud_experiments/server/plugin.test.ts index 4d33e0ce65a7d..d01c085dacd75 100644 --- a/x-pack/plugins/cloud_integrations/cloud_experiments/server/plugin.test.ts +++ b/x-pack/plugins/cloud_integrations/cloud_experiments/server/plugin.test.ts @@ -118,8 +118,8 @@ describe('Cloud Experiments server plugin', () => { expect(launchDarklyInstanceMock.updateUserMetadata).toHaveBeenCalledWith({ userId: '1c2412b751f056aef6e340efa5637d137442d489a4b1e3117071e7c87f8523f2', kibanaVersion: coreMock.createPluginInitializerContext().env.packageInfo.version, - is_elastic_staff_owned: true, - trial_end_date: expect.any(String), + isElasticStaff: true, + trialEndDate: expect.any(String), }); }) ); @@ -165,7 +165,7 @@ describe('Cloud Experiments server plugin', () => { ); }); - test('triggers a userMetadataUpdate for `has_data`', async () => { + test('triggers a userMetadataUpdate for `hasData`', async () => { plugin.setup(coreMock.createSetup(), { cloud: { ...cloudMock.createSetup(), isCloudEnabled: true }, }); @@ -177,7 +177,7 @@ describe('Cloud Experiments server plugin', () => { await new Promise((resolve) => setTimeout(resolve, 200)); // Waiting for scheduler and debounceTime to complete (don't know why fakeScheduler didn't work here). expect(launchDarklyInstanceMock.updateUserMetadata).toHaveBeenCalledWith( expect.objectContaining({ - has_data: true, + hasData: true, }) ); }); diff --git a/x-pack/plugins/cloud_integrations/cloud_experiments/server/plugin.ts b/x-pack/plugins/cloud_integrations/cloud_experiments/server/plugin.ts index 093b17934b686..7c7b04fcee3fe 100755 --- a/x-pack/plugins/cloud_integrations/cloud_experiments/server/plugin.ts +++ b/x-pack/plugins/cloud_integrations/cloud_experiments/server/plugin.ts @@ -89,8 +89,8 @@ export class CloudExperimentsPlugin // We use the Cloud ID as the userId in the Cloud Experiments userId: createSHA256Hash(deps.cloud.cloudId), kibanaVersion: this.initializerContext.env.packageInfo.version, - trial_end_date: deps.cloud.trialEndDate?.toISOString(), - is_elastic_staff_owned: deps.cloud.isElasticStaffOwned, + trialEndDate: deps.cloud.trialEndDate?.toISOString(), + isElasticStaff: deps.cloud.isElasticStaffOwned, }); // We only subscribe to the user metadata updates if Cloud is enabled. @@ -146,7 +146,7 @@ export class CloudExperimentsPlugin private async addHasDataMetadata( core: CoreStart, dataViews: DataViewsServerPluginStart - ): Promise<{ has_data: boolean }> { + ): Promise<{ hasData: boolean }> { const dataViewsService = await dataViews.dataViewsServiceFactory( core.savedObjects.createInternalRepository(), core.elasticsearch.client.asInternalUser, @@ -154,7 +154,7 @@ export class CloudExperimentsPlugin true // Ignore capabilities checks ); return { - has_data: await dataViewsService.hasUserDataView(), + hasData: await dataViewsService.hasUserDataView(), }; } } diff --git a/x-pack/plugins/cloud_integrations/cloud_experiments/server/usage/register_usage_collector.ts b/x-pack/plugins/cloud_integrations/cloud_experiments/server/usage/register_usage_collector.ts index 9a800dabe9fc8..8522a44a962e0 100644 --- a/x-pack/plugins/cloud_integrations/cloud_experiments/server/usage/register_usage_collector.ts +++ b/x-pack/plugins/cloud_integrations/cloud_experiments/server/usage/register_usage_collector.ts @@ -10,7 +10,7 @@ import type { LaunchDarklyClient } from '../launch_darkly_client'; export interface Usage { initialized: boolean; - flags: Record<string, string>; + flags: Record<string, unknown>; flagNames: string[]; } @@ -36,10 +36,8 @@ export function registerUsageCollector( }, // We'll likely map "flags" as `flattened`, so "flagNames" helps out to discover the key names flags: { - DYNAMIC_KEY: { - type: 'keyword', - _meta: { description: 'Flags received by the client' }, - }, + type: 'pass_through', + _meta: { description: 'Flags received by the client' }, }, flagNames: { type: 'array', diff --git a/x-pack/plugins/cloud_integrations/cloud_experiments/tsconfig.json b/x-pack/plugins/cloud_integrations/cloud_experiments/tsconfig.json index 7f0e98957c5f7..5e32996131fb1 100644 --- a/x-pack/plugins/cloud_integrations/cloud_experiments/tsconfig.json +++ b/x-pack/plugins/cloud_integrations/cloud_experiments/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, }, "include": [ ".storybook/**/*", @@ -13,7 +12,7 @@ "server/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/data_views/tsconfig.json" }, { "path": "../../../../src/plugins/usage_collection/tsconfig.json" }, diff --git a/x-pack/plugins/cloud_integrations/cloud_full_story/tsconfig.json b/x-pack/plugins/cloud_integrations/cloud_full_story/tsconfig.json index e81bf47099981..b2f06a09a6e03 100644 --- a/x-pack/plugins/cloud_integrations/cloud_full_story/tsconfig.json +++ b/x-pack/plugins/cloud_integrations/cloud_full_story/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, }, "include": [ ".storybook/**/*", @@ -13,7 +12,7 @@ "server/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../cloud/tsconfig.json" }, ] diff --git a/x-pack/plugins/cloud_integrations/cloud_gain_sight/tsconfig.json b/x-pack/plugins/cloud_integrations/cloud_gain_sight/tsconfig.json index e81bf47099981..392e17e62f1d9 100644 --- a/x-pack/plugins/cloud_integrations/cloud_gain_sight/tsconfig.json +++ b/x-pack/plugins/cloud_integrations/cloud_gain_sight/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, }, "include": [ ".storybook/**/*", @@ -13,7 +12,10 @@ "server/**/*", "../../../typings/**/*" ], - "references": [ + "exclude": [ + "server/assets/*.js", + ], + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../cloud/tsconfig.json" }, ] diff --git a/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.test.ts b/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.test.ts index e6107874b6d5d..f086f20956778 100644 --- a/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.test.ts +++ b/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.test.ts @@ -31,47 +31,74 @@ describe('Cloud Links Plugin - public', () => { plugin.stop(); }); - test('calls maybeAddCloudLinks when cloud and security are enabled and it is an authenticated page', () => { - const coreStart = coreMock.createStart(); - coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); - const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; - const security = securityMock.createStart(); - plugin.start(coreStart, { cloud, security }); - expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(1); - }); + describe('Onboarding Setup Guide link registration', () => { + test('registers the Onboarding Setup Guide link when cloud is enabled and it is an authenticated page', () => { + const coreStart = coreMock.createStart(); + coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); + const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; + plugin.start(coreStart, { cloud }); + expect(coreStart.chrome.registerGlobalHelpExtensionMenuLink).toHaveBeenCalledTimes(1); + }); - test('does not call maybeAddCloudLinks when security is disabled', () => { - const coreStart = coreMock.createStart(); - coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); - const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; - plugin.start(coreStart, { cloud }); - expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); - }); + test('does not register the Onboarding Setup Guide link when cloud is enabled but it is an unauthenticated page', () => { + const coreStart = coreMock.createStart(); + coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(true); + const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; + plugin.start(coreStart, { cloud }); + expect(coreStart.chrome.registerGlobalHelpExtensionMenuLink).not.toHaveBeenCalled(); + }); - test('does not call maybeAddCloudLinks when the page is anonymous', () => { - const coreStart = coreMock.createStart(); - coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(true); - const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; - const security = securityMock.createStart(); - plugin.start(coreStart, { cloud, security }); - expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); + test('does not register the Onboarding Setup Guide link when cloud is not enabled', () => { + const coreStart = coreMock.createStart(); + const cloud = { ...cloudMock.createStart(), isCloudEnabled: false }; + plugin.start(coreStart, { cloud }); + expect(coreStart.chrome.registerGlobalHelpExtensionMenuLink).not.toHaveBeenCalled(); + }); }); - test('does not call maybeAddCloudLinks when cloud is disabled', () => { - const coreStart = coreMock.createStart(); - coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); - const security = securityMock.createStart(); - plugin.start(coreStart, { security }); - expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); - }); + describe('maybeAddCloudLinks', () => { + test('calls maybeAddCloudLinks when cloud and security are enabled and it is an authenticated page', () => { + const coreStart = coreMock.createStart(); + coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); + const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; + const security = securityMock.createStart(); + plugin.start(coreStart, { cloud, security }); + expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(1); + }); + + test('does not call maybeAddCloudLinks when security is disabled', () => { + const coreStart = coreMock.createStart(); + coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); + const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; + plugin.start(coreStart, { cloud }); + expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); + }); + + test('does not call maybeAddCloudLinks when the page is anonymous', () => { + const coreStart = coreMock.createStart(); + coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(true); + const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; + const security = securityMock.createStart(); + plugin.start(coreStart, { cloud, security }); + expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); + }); + + test('does not call maybeAddCloudLinks when cloud is disabled', () => { + const coreStart = coreMock.createStart(); + coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); + const security = securityMock.createStart(); + plugin.start(coreStart, { security }); + expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); + }); - test('does not call maybeAddCloudLinks when isCloudEnabled is false', () => { - const coreStart = coreMock.createStart(); - coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); - const cloud = { ...cloudMock.createStart(), isCloudEnabled: false }; - const security = securityMock.createStart(); - plugin.start(coreStart, { cloud, security }); - expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); + test('does not call maybeAddCloudLinks when isCloudEnabled is false', () => { + const coreStart = coreMock.createStart(); + coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); + const cloud = { ...cloudMock.createStart(), isCloudEnabled: false }; + const security = securityMock.createStart(); + plugin.start(coreStart, { cloud, security }); + expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); + }); }); }); }); diff --git a/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.ts b/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.ts deleted file mode 100755 index 7fbf7a8a65064..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { CoreStart, Plugin } from '@kbn/core/public'; -import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; -import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public'; -import { maybeAddCloudLinks } from './maybe_add_cloud_links'; - -interface CloudLinksDepsSetup { - cloud?: CloudSetup; - security?: SecurityPluginSetup; -} - -interface CloudLinksDepsStart { - cloud?: CloudStart; - security?: SecurityPluginStart; -} - -export class CloudLinksPlugin - implements Plugin<void, void, CloudLinksDepsSetup, CloudLinksDepsStart> -{ - public setup() {} - - public start(core: CoreStart, { cloud, security }: CloudLinksDepsStart) { - if ( - cloud?.isCloudEnabled && - security && - !core.http.anonymousPaths.isAnonymous(window.location.pathname) - ) { - maybeAddCloudLinks({ security, chrome: core.chrome, cloud }); - } - } - - public stop() {} -} diff --git a/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.tsx b/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.tsx new file mode 100755 index 0000000000000..0d64ed13cde9f --- /dev/null +++ b/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.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 { FormattedMessage } from '@kbn/i18n-react'; +import type { CoreStart, Plugin } from '@kbn/core/public'; +import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; +import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public'; +import { maybeAddCloudLinks } from './maybe_add_cloud_links'; + +interface CloudLinksDepsSetup { + cloud?: CloudSetup; + security?: SecurityPluginSetup; +} + +interface CloudLinksDepsStart { + cloud?: CloudStart; + security?: SecurityPluginStart; +} + +export class CloudLinksPlugin + implements Plugin<void, void, CloudLinksDepsSetup, CloudLinksDepsStart> +{ + public setup() {} + + public start(core: CoreStart, { cloud, security }: CloudLinksDepsStart) { + if (cloud?.isCloudEnabled && !core.http.anonymousPaths.isAnonymous(window.location.pathname)) { + core.chrome.registerGlobalHelpExtensionMenuLink({ + linkType: 'custom', + href: core.http.basePath.prepend('/app/home#/getting_started'), + content: <FormattedMessage id="xpack.cloudLinks.setupGuide" defaultMessage="Setup guide" />, + 'data-test-subj': 'cloudOnboardingSetupGuideLink', + priority: 1000, // We want this link to be at the very top. + }); + + if (security) { + maybeAddCloudLinks({ security, chrome: core.chrome, cloud }); + } + } + } + + public stop() {} +} diff --git a/x-pack/plugins/cloud_integrations/cloud_links/tsconfig.json b/x-pack/plugins/cloud_integrations/cloud_links/tsconfig.json index 967962363be2c..bc4d834ed6971 100644 --- a/x-pack/plugins/cloud_integrations/cloud_links/tsconfig.json +++ b/x-pack/plugins/cloud_integrations/cloud_links/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, }, "include": [ ".storybook/**/*", @@ -13,7 +12,7 @@ "server/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../cloud/tsconfig.json" }, { "path": "../../security/tsconfig.json" }, diff --git a/x-pack/plugins/cloud_security_posture/common/constants.ts b/x-pack/plugins/cloud_security_posture/common/constants.ts index 764cb49dae8d2..a956800136483 100644 --- a/x-pack/plugins/cloud_security_posture/common/constants.ts +++ b/x-pack/plugins/cloud_security_posture/common/constants.ts @@ -49,3 +49,11 @@ export const CSP_RULE_TEMPLATE_SAVED_OBJECT_TYPE = 'csp-rule-template'; export const CLOUDBEAT_VANILLA = 'cloudbeat/cis_k8s'; // Integration input export const CLOUDBEAT_EKS = 'cloudbeat/cis_eks'; // Integration input + +export const LOCAL_STORAGE_PAGE_SIZE_LATEST_FINDINGS_KEY = 'cloudPosture:latestFindings:pageSize'; +export const LOCAL_STORAGE_PAGE_SIZE_RESOURCE_FINDINGS_KEY = + 'cloudPosture:resourceFindings:pageSize'; +export const LOCAL_STORAGE_PAGE_SIZE_FINDINGS_BY_RESOURCE_KEY = + 'cloudPosture:findingsByResource:pageSize'; +export const LOCAL_STORAGE_PAGE_SIZE_BENCHMARK_KEY = 'cloudPosture:benchmark:pageSize'; +export const LOCAL_STORAGE_PAGE_SIZE_RULES_KEY = 'cloudPosture:rules:pageSize'; diff --git a/x-pack/plugins/cloud_security_posture/common/schemas/csp_finding.ts b/x-pack/plugins/cloud_security_posture/common/schemas/csp_finding.ts index 636182e97e46f..4ef4a2c0ebb0f 100644 --- a/x-pack/plugins/cloud_security_posture/common/schemas/csp_finding.ts +++ b/x-pack/plugins/cloud_security_posture/common/schemas/csp_finding.ts @@ -12,8 +12,10 @@ import type { CspRuleMetadata } from './csp_rule_metadata'; export interface CspFinding { '@timestamp': string; cluster_id: string; - cluster?: { - name?: string; + orchestrator?: { + cluster?: { + name?: string; + }; }; result: CspFindingResult; resource: CspFindingResource; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx index fce512d95315b..ce615733e4b98 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx @@ -6,6 +6,7 @@ */ import React, { useState } from 'react'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import { EuiFieldSearch, EuiFieldSearchProps, @@ -30,6 +31,7 @@ import { } from './use_csp_benchmark_integrations'; import { extractErrorMessage } from '../../../common/utils/helpers'; import * as TEST_SUBJ from './test_subjects'; +import { LOCAL_STORAGE_PAGE_SIZE_BENCHMARK_KEY } from '../../../common/constants'; const SEARCH_DEBOUNCE_MS = 300; @@ -126,10 +128,14 @@ const BenchmarkSearchField = ({ }; export const Benchmarks = () => { + const [pageSize, setPageSize] = useLocalStorage<number>( + LOCAL_STORAGE_PAGE_SIZE_BENCHMARK_KEY, + 10 + ); const [query, setQuery] = useState<UseCspBenchmarkIntegrationsProps>({ name: '', page: 1, - perPage: 10, + perPage: pageSize || 10, sortField: 'package_policy.name', sortOrder: 'asc', }); @@ -169,7 +175,7 @@ export const Benchmarks = () => { error={queryResult.error ? extractErrorMessage(queryResult.error) : undefined} loading={queryResult.isFetching} pageIndex={query.page} - pageSize={query.perPage} + pageSize={pageSize || query.perPage} sorting={{ // @ts-expect-error - EUI types currently do not support sorting by nested fields sort: { field: query.sortField, direction: query.sortOrder }, @@ -177,6 +183,7 @@ export const Benchmarks = () => { }} totalItemCount={totalItemCount} setQuery={({ page, sort }) => { + setPageSize(page.size); setQuery((current) => ({ ...current, page: page.index, diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.tsx index 3294ee8ec4965..92b6ca6dcc68e 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.tsx @@ -8,6 +8,7 @@ import React, { useMemo } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiBottomBar, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import type { Evaluation } from '../../../../common/types'; import { CloudPosturePageTitle } from '../../../components/cloud_posture_page_title'; import type { FindingsBaseProps } from '../types'; @@ -31,6 +32,7 @@ import { FindingsGroupBySelector } from '../layout/findings_group_by_selector'; import { useUrlQuery } from '../../../common/hooks/use_url_query'; import { ErrorCallout } from '../layout/error_callout'; import { getLimitProperties } from '../utils/get_limit_properties'; +import { LOCAL_STORAGE_PAGE_SIZE_LATEST_FINDINGS_KEY } from '../../../../common/constants'; export const getDefaultQuery = ({ query, @@ -48,7 +50,10 @@ const MAX_ITEMS = 500; export const LatestFindingsContainer = ({ dataView }: FindingsBaseProps) => { const getPersistedDefaultQuery = usePersistedQuery(getDefaultQuery); const { urlQuery, setUrlQuery } = useUrlQuery(getPersistedDefaultQuery); - + const [pageSize, setPageSize] = useLocalStorage( + LOCAL_STORAGE_PAGE_SIZE_LATEST_FINDINGS_KEY, + urlQuery.pageSize + ); /** * Page URL query to ES query */ @@ -62,7 +67,10 @@ export const LatestFindingsContainer = ({ dataView }: FindingsBaseProps) => { * Page ES query result */ const findingsGroupByNone = useLatestFindings({ - ...getPaginationQuery({ pageIndex: urlQuery.pageIndex, pageSize: urlQuery.pageSize }), + ...getPaginationQuery({ + pageIndex: urlQuery.pageIndex, + pageSize: pageSize || urlQuery.pageSize, + }), query: baseEsQuery.query, sort: urlQuery.sort, enabled: !baseEsQuery.error, @@ -137,20 +145,21 @@ export const LatestFindingsContainer = ({ dataView }: FindingsBaseProps) => { loading={findingsGroupByNone.isFetching} items={findingsGroupByNone.data?.page || []} pagination={getPaginationTableParams({ - pageSize: urlQuery.pageSize, + pageSize: pageSize || urlQuery.pageSize, pageIndex: urlQuery.pageIndex, totalItemCount: limitedTotalItemCount, })} sorting={{ sort: { field: urlQuery.sort.field, direction: urlQuery.sort.direction }, }} - setTableOptions={({ page, sort }) => + setTableOptions={({ page, sort }) => { + setPageSize(page.size); setUrlQuery({ sort, pageIndex: page.index, pageSize: page.size, - }) - } + }); + }} onAddFilter={(field, value, negate) => setUrlQuery({ pageIndex: 0, diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/findings_by_resource_container.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/findings_by_resource_container.tsx index e9ce59fe9f0c0..982fd12fbc06f 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/findings_by_resource_container.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/findings_by_resource_container.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { Route, Switch } from 'react-router-dom'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import type { Evaluation } from '../../../../common/types'; import { CloudPosturePageTitle } from '../../../components/cloud_posture_page_title'; import { FindingsSearchBar } from '../layout/findings_search_bar'; @@ -30,6 +31,7 @@ import { findingsNavigation } from '../../../common/navigation/constants'; import { ResourceFindings } from './resource_findings/resource_findings_container'; import { ErrorCallout } from '../layout/error_callout'; import { FindingsDistributionBar } from '../layout/findings_distribution_bar'; +import { LOCAL_STORAGE_PAGE_SIZE_FINDINGS_BY_RESOURCE_KEY } from '../../../../common/constants'; const getDefaultQuery = ({ query, @@ -59,6 +61,10 @@ export const FindingsByResourceContainer = ({ dataView }: FindingsBaseProps) => const LatestFindingsByResource = ({ dataView }: FindingsBaseProps) => { const getPersistedDefaultQuery = usePersistedQuery(getDefaultQuery); const { urlQuery, setUrlQuery } = useUrlQuery(getPersistedDefaultQuery); + const [pageSize, setPageSize] = useLocalStorage( + LOCAL_STORAGE_PAGE_SIZE_FINDINGS_BY_RESOURCE_KEY, + urlQuery.pageSize + ); /** * Page URL query to ES query @@ -73,7 +79,10 @@ const LatestFindingsByResource = ({ dataView }: FindingsBaseProps) => { * Page ES query result */ const findingsGroupByResource = useFindingsByResource({ - ...getPaginationQuery(urlQuery), + ...getPaginationQuery({ + pageIndex: urlQuery.pageIndex, + pageSize: pageSize || urlQuery.pageSize, + }), sortDirection: urlQuery.sortDirection, query: baseEsQuery.query, enabled: !baseEsQuery.error, @@ -148,17 +157,18 @@ const LatestFindingsByResource = ({ dataView }: FindingsBaseProps) => { loading={findingsGroupByResource.isFetching} items={findingsGroupByResource.data?.page || []} pagination={getPaginationTableParams({ - pageSize: urlQuery.pageSize, + pageSize: pageSize || urlQuery.pageSize, pageIndex: urlQuery.pageIndex, totalItemCount: findingsGroupByResource.data?.total || 0, })} - setTableOptions={({ sort, page }) => + setTableOptions={({ sort, page }) => { + setPageSize(page.size); setUrlQuery({ sortDirection: sort?.direction, pageIndex: page.index, pageSize: page.size, - }) - } + }); + }} sorting={{ sort: { field: 'failed_findings', direction: urlQuery.sortDirection }, }} diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/resource_findings_container.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/resource_findings_container.tsx index 75997efaf6294..e61415b7d0af1 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/resource_findings_container.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/resource_findings_container.tsx @@ -15,6 +15,7 @@ import { Link, useParams } from 'react-router-dom'; import { FormattedMessage } from '@kbn/i18n-react'; import { generatePath } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import { CspInlineDescriptionList } from '../../../../components/csp_inline_description_list'; import type { Evaluation } from '../../../../../common/types'; import { CspFinding } from '../../../../../common/schemas/csp_finding'; @@ -37,6 +38,7 @@ import { ResourceFindingsTable } from './resource_findings_table'; import { FindingsSearchBar } from '../../layout/findings_search_bar'; import { ErrorCallout } from '../../layout/error_callout'; import { FindingsDistributionBar } from '../../layout/findings_distribution_bar'; +import { LOCAL_STORAGE_PAGE_SIZE_RESOURCE_FINDINGS_KEY } from '../../../../../common/constants'; const getDefaultQuery = ({ query, @@ -90,6 +92,10 @@ export const ResourceFindings = ({ dataView }: FindingsBaseProps) => { const params = useParams<{ resourceId: string }>(); const getPersistedDefaultQuery = usePersistedQuery(getDefaultQuery); const { urlQuery, setUrlQuery } = useUrlQuery(getPersistedDefaultQuery); + const [pageSize, setPageSize] = useLocalStorage( + LOCAL_STORAGE_PAGE_SIZE_RESOURCE_FINDINGS_KEY, + urlQuery.pageSize + ); /** * Page URL query to ES query @@ -105,7 +111,7 @@ export const ResourceFindings = ({ dataView }: FindingsBaseProps) => { */ const resourceFindings = useResourceFindings({ ...getPaginationQuery({ - pageSize: urlQuery.pageSize, + pageSize: pageSize || urlQuery.pageSize, pageIndex: urlQuery.pageIndex, }), sort: urlQuery.sort, @@ -195,16 +201,17 @@ export const ResourceFindings = ({ dataView }: FindingsBaseProps) => { loading={resourceFindings.isFetching} items={resourceFindings.data?.page || []} pagination={getPaginationTableParams({ - pageSize: urlQuery.pageSize, + pageSize: pageSize || urlQuery.pageSize, pageIndex: urlQuery.pageIndex, totalItemCount: resourceFindings.data?.total || 0, })} sorting={{ sort: { field: urlQuery.sort.field, direction: urlQuery.sort.direction }, }} - setTableOptions={({ page, sort }) => - setUrlQuery({ pageIndex: page.index, pageSize: page.size, sort }) - } + setTableOptions={({ page, sort }) => { + setPageSize(page.size); + setUrlQuery({ pageIndex: page.index, pageSize: page.size, sort }); + }} onAddFilter={(field, value, negate) => setUrlQuery({ pageIndex: 0, diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx index cc5f10a0bf061..84f39bb150c26 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx @@ -7,6 +7,7 @@ import React, { useState, useMemo } from 'react'; import { EuiPanel, EuiSpacer } from '@elastic/eui'; import { useParams } from 'react-router-dom'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import { extractErrorMessage, createCspRuleSearchFilterByPackagePolicy, @@ -22,6 +23,7 @@ import { } from './use_csp_rules'; import * as TEST_SUBJECTS from './test_subjects'; import { RuleFlyout } from './rules_flyout'; +import { LOCAL_STORAGE_PAGE_SIZE_RULES_KEY } from '../../../common/constants'; interface RulesPageData { rules_page: RuleSavedObject[]; @@ -68,6 +70,7 @@ export type PageUrlParams = Record<'policyId' | 'packagePolicyId', string>; export const RulesContainer = () => { const params = useParams<PageUrlParams>(); const [selectedRuleId, setSelectedRuleId] = useState<string | null>(null); + const [pageSize, setPageSize] = useLocalStorage<number>(LOCAL_STORAGE_PAGE_SIZE_RULES_KEY, 10); const [rulesQuery, setRulesQuery] = useState<RulesQuery>({ filter: createCspRuleSearchFilterByPackagePolicy({ packagePolicyId: params.packagePolicyId, @@ -75,7 +78,7 @@ export const RulesContainer = () => { }), search: '', page: 0, - perPage: 10, + perPage: pageSize || 10, }); const { data, status, error } = useFindCspRules({ @@ -105,11 +108,12 @@ export const RulesContainer = () => { total={rulesPageData.total} error={rulesPageData.error} loading={rulesPageData.loading} - perPage={rulesQuery.perPage} + perPage={pageSize || rulesQuery.perPage} page={rulesQuery.page} - setPagination={(paginationQuery) => - setRulesQuery((currentQuery) => ({ ...currentQuery, ...paginationQuery })) - } + setPagination={(paginationQuery) => { + setPageSize(paginationQuery.perPage); + setRulesQuery((currentQuery) => ({ ...currentQuery, ...paginationQuery })); + }} setSelectedRuleId={setSelectedRuleId} selectedRuleId={selectedRuleId} /> diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts index 03767f366246c..2b288d6e696e8 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts @@ -18,7 +18,11 @@ const mockClusterBuckets: ClusterBucket[] = [ _id: '123', _index: '123', _source: { - cluster: { name: 'cluster_name' }, + orchestrator: { + cluster: { + name: 'cluster_name', + }, + }, rule: { benchmark: { name: 'CIS Kubernetes', id: 'cis_k8s' } }, '@timestamp': '123', }, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts index d768d65ac32c7..388672f25409d 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts @@ -71,7 +71,7 @@ export const getClustersFromAggs = (clusters: ClusterBucket[]): ClusterWithoutTr const meta = { clusterId: cluster.key, - clusterName: latestFindingHit._source.cluster?.name, + clusterName: latestFindingHit._source.orchestrator?.cluster?.name, benchmarkName: latestFindingHit._source.rule.benchmark.name, benchmarkId: latestFindingHit._source.rule.benchmark.id, lastUpdate: latestFindingHit._source['@timestamp'], diff --git a/x-pack/plugins/cloud_security_posture/tsconfig.json b/x-pack/plugins/cloud_security_posture/tsconfig.json index 4788655dabb2d..09588ccdd6247 100755 --- a/x-pack/plugins/cloud_security_posture/tsconfig.json +++ b/x-pack/plugins/cloud_security_posture/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -16,7 +15,7 @@ "public/**/*.json", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/navigation/tsconfig.json" }, diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_indices_list.test.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_indices_list.test.js index 16d38d42d46b2..50e984eec194e 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_indices_list.test.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_indices_list.test.js @@ -17,7 +17,7 @@ describe('<FollowerIndicesList />', () => { let httpRequestsMockHelpers; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); ({ httpRequestsMockHelpers } = setupEnvironment()); }); diff --git a/x-pack/plugins/cross_cluster_replication/tsconfig.json b/x-pack/plugins/cross_cluster_replication/tsconfig.json index 4c1f3b20fa23e..f815f7e812d0a 100644 --- a/x-pack/plugins/cross_cluster_replication/tsconfig.json +++ b/x-pack/plugins/cross_cluster_replication/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, // required plugins { "path": "../../../src/plugins/home/tsconfig.json" }, diff --git a/x-pack/plugins/dashboard_enhanced/tsconfig.json b/x-pack/plugins/dashboard_enhanced/tsconfig.json index 9cd81c66fff4b..79ef7ff25b110 100644 --- a/x-pack/plugins/dashboard_enhanced/tsconfig.json +++ b/x-pack/plugins/dashboard_enhanced/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../../src/plugins/dashboard/tsconfig.json" }, diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/field_type_icon.test.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/field_type_icon.test.tsx index 9962937fa80dc..771b27ace1c5b 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/field_type_icon.test.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/field_type_icon.test.tsx @@ -19,9 +19,10 @@ describe('FieldTypeIcon', () => { expect(typeIconComponent).toMatchSnapshot(); }); - test(`render with tooltip and test hovering`, () => { + // TODO: Broken with Jest 27 + test.skip(`render with tooltip and test hovering`, () => { // Use fake timers so we don't have to wait for the EuiToolTip timeout - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const typeIconComponent = mount( <FieldTypeIcon type={SUPPORTED_FIELD_TYPES.KEYWORD} tooltipEnabled={true} /> diff --git a/x-pack/plugins/data_visualizer/tsconfig.json b/x-pack/plugins/data_visualizer/tsconfig.json index 2168eaa5696c5..82484dc83b6cd 100644 --- a/x-pack/plugins/data_visualizer/tsconfig.json +++ b/x-pack/plugins/data_visualizer/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "../../../typings/**/*", @@ -14,7 +13,7 @@ "server/**/*", "types/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, diff --git a/x-pack/plugins/discover_enhanced/tsconfig.json b/x-pack/plugins/discover_enhanced/tsconfig.json index 631ca8a577cdf..baa3aae67c3f8 100644 --- a/x-pack/plugins/discover_enhanced/tsconfig.json +++ b/x-pack/plugins/discover_enhanced/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["*.ts", "common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/discover/tsconfig.json" }, diff --git a/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json b/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json index b3ae397963c1d..b4ef559e81ce4 100644 --- a/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json +++ b/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["public/**/*"], - "references": [ + "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../../../src/plugins/ui_actions_enhanced/tsconfig.json" }, { "path": "../../../../src/plugins/embeddable/tsconfig.json" }, diff --git a/x-pack/plugins/embeddable_enhanced/tsconfig.json b/x-pack/plugins/embeddable_enhanced/tsconfig.json index 13e684dbdefce..c4086ef69251a 100644 --- a/x-pack/plugins/embeddable_enhanced/tsconfig.json +++ b/x-pack/plugins/embeddable_enhanced/tsconfig.json @@ -4,12 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, diff --git a/x-pack/plugins/encrypted_saved_objects/tsconfig.json b/x-pack/plugins/encrypted_saved_objects/tsconfig.json index 4b06756a9cf2f..a09f47180d4f7 100644 --- a/x-pack/plugins/encrypted_saved_objects/tsconfig.json +++ b/x-pack/plugins/encrypted_saved_objects/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["server/**/*"], - "references": [ + "kbn_references": [ { "path": "../security/tsconfig.json" }, ] } diff --git a/x-pack/plugins/enterprise_search/common/constants.ts b/x-pack/plugins/enterprise_search/common/constants.ts index 3fe7d29d3801a..b0801ee654d6f 100644 --- a/x-pack/plugins/enterprise_search/common/constants.ts +++ b/x-pack/plugins/enterprise_search/common/constants.ts @@ -97,6 +97,26 @@ export const WORKPLACE_SEARCH_PLUGIN = { SUPPORT_URL: 'https://discuss.elastic.co/c/enterprise-search/workplace-search/', }; +export const SEARCH_EXPERIENCES_PLUGIN = { + ID: 'searchExperiences', + NAME: i18n.translate('xpack.enterpriseSearch.searchExperiences.productName', { + defaultMessage: 'Enterprise Search', + }), + NAV_TITLE: i18n.translate('xpack.enterpriseSearch.searchExperiences.navTitle', { + defaultMessage: 'Search experiences', + }), + DESCRIPTION: i18n.translate('xpack.enterpriseSearch.searchExperiences.productDescription', { + defaultMessage: 'Build an intuitive, engaging search experience without reinventing the wheel.', + }), + URL: '/app/enterprise_search/search_experiences', + SUPPORT_URL: 'https://discuss.elastic.co/c/enterprise-search/', + GITHUB_URL: 'https://github.com/elastic/search-ui/', + DOCUMENTATION_URL: 'https://docs.elastic.co/search-ui/', + ELASTICSEARCH_TUTORIAL_URL: 'https://docs.elastic.co/search-ui/tutorials/elasticsearch', + APP_SEARCH_TUTORIAL_URL: 'https://docs.elastic.co/search-ui/tutorials/app-search', + WORKPLACE_SEARCH_TUTORIAL_URL: 'https://docs.elastic.co/search-ui/tutorials/workplace-search', +}; + export const LICENSED_SUPPORT_URL = 'https://support.elastic.co'; export const JSON_HEADER = { diff --git a/x-pack/plugins/enterprise_search/common/ml_inference_pipeline/index.test.ts b/x-pack/plugins/enterprise_search/common/ml_inference_pipeline/index.test.ts index 538d8016a0a73..b2616ed7615ba 100644 --- a/x-pack/plugins/enterprise_search/common/ml_inference_pipeline/index.test.ts +++ b/x-pack/plugins/enterprise_search/common/ml_inference_pipeline/index.test.ts @@ -17,6 +17,7 @@ import { getMlModelTypesForModelConfig, getSetProcessorForInferenceType, SUPPORTED_PYTORCH_TASKS as LOCAL_SUPPORTED_PYTORCH_TASKS, + parseMlInferenceParametersFromPipeline, } from '.'; const mockModel: MlTrainedModelConfig = { @@ -198,3 +199,45 @@ describe('generateMlInferencePipelineBody lib function', () => { ); }); }); + +describe('parseMlInferenceParametersFromPipeline', () => { + it('returns pipeline parameters from ingest pipeline', () => { + expect( + parseMlInferenceParametersFromPipeline('unit-test', { + processors: [ + { + inference: { + field_map: { + body: 'text_field', + }, + model_id: 'test-model', + target_field: 'ml.inference.test', + }, + }, + ], + }) + ).toEqual({ + destination_field: 'test', + model_id: 'test-model', + pipeline_name: 'unit-test', + source_field: 'body', + }); + }); + it('return null if pipeline missing inference processor', () => { + expect(parseMlInferenceParametersFromPipeline('unit-test', { processors: [] })).toBeNull(); + }); + it('return null if pipeline missing field_map', () => { + expect( + parseMlInferenceParametersFromPipeline('unit-test', { + processors: [ + { + inference: { + model_id: 'test-model', + target_field: 'test', + }, + }, + ], + }) + ).toBeNull(); + }); +}); diff --git a/x-pack/plugins/enterprise_search/common/ml_inference_pipeline/index.ts b/x-pack/plugins/enterprise_search/common/ml_inference_pipeline/index.ts index b5b4526d1723b..4e5b124f8dff0 100644 --- a/x-pack/plugins/enterprise_search/common/ml_inference_pipeline/index.ts +++ b/x-pack/plugins/enterprise_search/common/ml_inference_pipeline/index.ts @@ -5,9 +5,13 @@ * 2.0. */ -import { IngestSetProcessor, MlTrainedModelConfig } from '@elastic/elasticsearch/lib/api/types'; +import { + IngestPipeline, + IngestSetProcessor, + MlTrainedModelConfig, +} from '@elastic/elasticsearch/lib/api/types'; -import { MlInferencePipeline } from '../types/pipelines'; +import { MlInferencePipeline, CreateMlInferencePipelineParameters } from '../types/pipelines'; // Getting an error importing this from @kbn/ml-plugin/common/constants/data_frame_analytics' // So defining it locally for now with a test to make sure it matches. @@ -151,3 +155,25 @@ export const formatPipelineName = (rawName: string) => .trim() .replace(/\s+/g, '_') // Convert whitespaces to underscores .toLowerCase(); + +export const parseMlInferenceParametersFromPipeline = ( + name: string, + pipeline: IngestPipeline +): CreateMlInferencePipelineParameters | null => { + const processor = pipeline?.processors?.find((proc) => proc.inference !== undefined); + if (!processor || processor?.inference === undefined) { + return null; + } + const { inference: inferenceProcessor } = processor; + const sourceFields = Object.keys(inferenceProcessor.field_map ?? {}); + const sourceField = sourceFields.length === 1 ? sourceFields[0] : null; + if (!sourceField) { + return null; + } + return { + destination_field: inferenceProcessor.target_field.replace('ml.inference.', ''), + model_id: inferenceProcessor.model_id, + pipeline_name: name, + source_field: sourceField, + }; +}; diff --git a/x-pack/plugins/enterprise_search/common/types/connectors.ts b/x-pack/plugins/enterprise_search/common/types/connectors.ts index 44105cf34c0c2..378633ce52d6a 100644 --- a/x-pack/plugins/enterprise_search/common/types/connectors.ts +++ b/x-pack/plugins/enterprise_search/common/types/connectors.ts @@ -26,9 +26,13 @@ export enum ConnectorStatus { } export enum SyncStatus { - IN_PROGRESS = 'in_progress', + CANCELING = 'canceling', + CANCELED = 'canceled', COMPLETED = 'completed', ERROR = 'error', + IN_PROGRESS = 'in_progress', + PENDING = 'pending', + SUSPENDED = 'suspended', } export interface IngestPipelineParams { @@ -38,11 +42,68 @@ export interface IngestPipelineParams { run_ml_inference: boolean; } +export enum FilteringPolicy { + EXCLUDE = 'exclude', + INCLUDE = 'include', +} + +export enum FilteringRuleRule { + CONTAINS = 'contains', + ENDS_WITH = 'ends_with', + EQUALS = 'equals', + GT = '>', + LT = '<', + REGEX = 'regex', + STARTS_WITH = 'starts_with', +} + +export interface FilteringRule { + created_at: string; + field: string; + id: string; + order: number; + policy: FilteringPolicy; + rule: FilteringRuleRule; + updated_at: string; + value: string; +} + +export interface FilteringValidation { + ids: string[]; + messages: string[]; +} + +export enum FilteringValidationState { + EDITED = 'edited', + INVALID = 'invalid', + VALID = 'valid', +} + +export interface FilteringRules { + advanced_snippet: { + created_at: string; + updated_at: string; + value: Record<string, unknown>; + }; + rules: FilteringRule[]; + validation: { + errors: FilteringValidation[]; + state: FilteringValidationState; + }; +} + +export interface FilteringConfig { + active: FilteringRules; + domain: string; + draft: FilteringRules; +} + export interface Connector { api_key_id: string | null; configuration: ConnectorConfiguration; description: string | null; error: string | null; + filtering: FilteringConfig[]; id: string; index_name: string; is_native: boolean; diff --git a/x-pack/plugins/enterprise_search/common/types/error_codes.ts b/x-pack/plugins/enterprise_search/common/types/error_codes.ts index 8ceb77281a1e5..c7691d99d4677 100644 --- a/x-pack/plugins/enterprise_search/common/types/error_codes.ts +++ b/x-pack/plugins/enterprise_search/common/types/error_codes.ts @@ -14,6 +14,7 @@ export enum ErrorCode { INDEX_ALREADY_EXISTS = 'index_already_exists', INDEX_NOT_FOUND = 'index_not_found', PIPELINE_ALREADY_EXISTS = 'pipeline_already_exists', + PIPELINE_IS_IN_USE = 'pipeline_is_in_use', RESOURCE_NOT_FOUND = 'resource_not_found', UNAUTHORIZED = 'unauthorized', UNCAUGHT_EXCEPTION = 'uncaught_exception', diff --git a/x-pack/plugins/enterprise_search/common/types/indices.ts b/x-pack/plugins/enterprise_search/common/types/indices.ts index 3fbd9dccb3efd..571a62cdd88f6 100644 --- a/x-pack/plugins/enterprise_search/common/types/indices.ts +++ b/x-pack/plugins/enterprise_search/common/types/indices.ts @@ -15,6 +15,10 @@ import { import { Connector } from './connectors'; import { Crawler } from './crawler'; +export interface AlwaysShowPattern { + alias_pattern: string; + index_pattern: string; +} export interface ElasticsearchIndex { count: number; // Elasticsearch _count health?: HealthStatus; diff --git a/x-pack/plugins/enterprise_search/common/types/pipelines.ts b/x-pack/plugins/enterprise_search/common/types/pipelines.ts index 9b53e98d584d7..38314f6d162de 100644 --- a/x-pack/plugins/enterprise_search/common/types/pipelines.ts +++ b/x-pack/plugins/enterprise_search/common/types/pipelines.ts @@ -64,3 +64,10 @@ export interface DeleteMlInferencePipelineResponse { deleted?: string; updated?: string; } + +export interface CreateMlInferencePipelineParameters { + destination_field?: string; + model_id: string; + pipeline_name: string; + source_field: string; +} diff --git a/x-pack/plugins/enterprise_search/kibana.json b/x-pack/plugins/enterprise_search/kibana.json index 4c99ca1df9e0f..f62df46d025a8 100644 --- a/x-pack/plugins/enterprise_search/kibana.json +++ b/x-pack/plugins/enterprise_search/kibana.json @@ -2,7 +2,7 @@ "id": "enterpriseSearch", "version": "kibana", "kibanaVersion": "kibana", - "requiredPlugins": ["features", "spaces", "security", "licensing", "data", "charts", "infra", "cloud", "esUiShared"], + "requiredPlugins": ["features", "spaces", "security", "licensing", "data", "charts", "infra", "cloud", "esUiShared", "guidedOnboarding"], "configPath": ["enterpriseSearch"], "optionalPlugins": ["usageCollection", "home", "customIntegrations", "ml"], "server": true, diff --git a/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts b/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts index 9921dd7d82dc1..dd654fb8357af 100644 --- a/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts +++ b/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts @@ -23,6 +23,7 @@ export const mockKibanaValues = { isCloudEnabled: false, deployment_url: 'https://cloud.elastic.co/deployments/some-id', }, + guidedOnboarding: {}, history: mockHistory, isCloud: false, navigateToUrl: jest.fn(), diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/components/add_analytics_collections/add_analytics_collection_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/components/add_analytics_collections/add_analytics_collection_logic.test.ts index 7b281208f79e8..a0610dc546fbf 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/components/add_analytics_collections/add_analytics_collection_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/components/add_analytics_collections/add_analytics_collection_logic.test.ts @@ -97,7 +97,7 @@ describe('addAnalyticsCollectionLogic', () => { describe('listeners', () => { describe('onApiSuccess', () => { it('should flash a success toast and navigate to collection view', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const { navigateToUrl } = mockKibanaValues; diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/delete_analytics_collection_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/delete_analytics_collection_logic.test.ts index 08ca206671de0..baaea238fa6b4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/delete_analytics_collection_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/delete_analytics_collection_logic.test.ts @@ -57,7 +57,7 @@ describe('deleteAnalyticsCollectionLogic', () => { it('calls makeRequest on deleteAnalyticsCollections', async () => { const collectionName = 'name'; - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); DeleteAnalyticsCollectionLogic.actions.makeRequest = jest.fn(); DeleteAnalyticsCollectionLogic.actions.deleteAnalyticsCollection(collectionName); jest.advanceTimersByTime(150); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.test.ts index 614f3506b4ef9..17f3ab989162d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.test.ts @@ -119,7 +119,7 @@ describe('ApiLogsLogic', () => { describe('listeners', () => { describe('pollForApiLogs', () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const setIntervalSpy = jest.spyOn(global, 'setInterval'); it('starts a poll that calls fetchApiLogs at set intervals', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.test.ts index 59ec64c69d5a8..9064d1185a3d0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.test.ts @@ -73,7 +73,7 @@ describe('CrawlerLogic', () => { beforeEach(() => { jest.clearAllMocks(); - jest.useFakeTimers(); // this should be run before every test to reset these mocks + jest.useFakeTimers('legacy'); // this should be run before every test to reset these mocks mount(); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.test.ts index 4e25477d65dbf..4ea8dd55ffb44 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.test.ts @@ -380,7 +380,7 @@ describe('CurationLogic', () => { }); describe('updateCuration', () => { - beforeAll(() => jest.useFakeTimers()); + beforeAll(() => jest.useFakeTimers('legacy')); afterAll(() => jest.useRealTimers()); it('should make a PUT API call with queries and promoted/hidden IDs to update', async () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts index d82b4f5d4b055..1bb1a815d2364 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts @@ -255,7 +255,7 @@ describe('EngineLogic', () => { }); describe('pollEmptyEngine', () => { - beforeEach(() => jest.useFakeTimers()); + beforeEach(() => jest.useFakeTimers('legacy')); afterEach(() => jest.clearAllTimers()); afterAll(() => jest.useRealTimers()); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts index fba8b118d4d24..a4ea5595bba3a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts @@ -329,7 +329,7 @@ describe('LogRetentionLogic', () => { }); describe('fetchLogRetention', () => { - beforeAll(() => jest.useFakeTimers()); + beforeAll(() => jest.useFakeTimers('legacy')); afterAll(() => jest.useRealTimers()); describe('isLogRetentionUpdating', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts index bf0bad4f1088a..f413fefb7f89b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts @@ -341,7 +341,7 @@ describe('RelevanceTuningLogic', () => { describe('getSearchResults', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/sample_response/sample_response_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/sample_response/sample_response_logic.test.ts index ee20fab3da66c..6712a32c94bcc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/sample_response/sample_response_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/sample_response/sample_response_logic.test.ts @@ -83,7 +83,7 @@ describe('SampleResponseLogic', () => { describe('listeners', () => { describe('getSearchResults', () => { - beforeAll(() => jest.useFakeTimers()); + beforeAll(() => jest.useFakeTimers('legacy')); afterAll(() => jest.useRealTimers()); it('makes a search API request and calls getSearchResultsSuccess with the first result of the response', async () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.test.ts index a56d2f7d5c949..ab8426dce3636 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.test.ts @@ -78,7 +78,7 @@ describe('SearchLogic', () => { describe('listeners', () => { describe('search', () => { - beforeAll(() => jest.useFakeTimers()); + beforeAll(() => jest.useFakeTimers('legacy')); afterAll(() => jest.useRealTimers()); it('should make a GET API call with a search query', async () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/cypress/tsconfig.json b/x-pack/plugins/enterprise_search/public/applications/app_search/cypress/tsconfig.json index 40361607aa3c5..e2c99c65d590e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/cypress/tsconfig.json +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/cypress/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../shared/cypress/tsconfig.json", - "references": [{ "path": "../../shared/cypress/tsconfig.json" }], + "kbn_references": [{ "path": "../../shared/cypress/tsconfig.json" }], "compilerOptions": { "outDir": "../../../../target/cypress/types/app_search" }, "include": ["./**/*"] } diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/search_indices.mock.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/search_indices.mock.ts index b8063d57ff984..8af3be8b9e0a6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/search_indices.mock.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/search_indices.mock.ts @@ -7,7 +7,13 @@ import { ENTERPRISE_SEARCH_CONNECTOR_CRAWLER_SERVICE_TYPE } from '../../../../common/constants'; -import { ConnectorStatus, SyncStatus } from '../../../../common/types/connectors'; +import { + ConnectorStatus, + FilteringPolicy, + FilteringRuleRule, + FilteringValidationState, + SyncStatus, +} from '../../../../common/types/connectors'; import { ElasticsearchIndexWithIngestion } from '../../../../common/types/indices'; export const indices: ElasticsearchIndexWithIngestion[] = [ @@ -29,6 +35,57 @@ export const indices: ElasticsearchIndexWithIngestion[] = [ configuration: { foo: { label: 'bar', value: 'barbar' } }, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + }, + ], id: '2', index_name: 'connector', is_native: false, @@ -79,6 +136,57 @@ export const indices: ElasticsearchIndexWithIngestion[] = [ configuration: { foo: { label: 'bar', value: 'barbar' } }, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + }, + ], id: '4', index_name: 'connector-crawler', is_native: true, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/view_index.mock.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/view_index.mock.ts index db4080f18e7a4..4d1039e2969b2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/view_index.mock.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/view_index.mock.ts @@ -7,7 +7,13 @@ import { ENTERPRISE_SEARCH_CONNECTOR_CRAWLER_SERVICE_TYPE } from '../../../../common/constants'; -import { SyncStatus, ConnectorStatus } from '../../../../common/types/connectors'; +import { + SyncStatus, + ConnectorStatus, + FilteringPolicy, + FilteringRuleRule, + FilteringValidationState, +} from '../../../../common/types/connectors'; import { ApiViewIndex, @@ -32,12 +38,64 @@ export const apiIndex: ApiViewIndex = { store: { size_in_bytes: '8024' }, }, }; + export const connectorIndex: ConnectorViewIndex = { connector: { api_key_id: null, configuration: { foo: { label: 'bar', value: 'barbar' } }, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + }, + ], id: '2', index_name: 'connector', is_native: false, @@ -94,6 +152,57 @@ export const connectorCrawlerIndex: CrawlerViewIndex = { configuration: { foo: { label: 'bar', value: 'barbar' } }, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + }, + ], id: '4', index_name: 'connector-crawler', is_native: true, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/cancel_syncs_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/cancel_syncs_api_logic.test.ts new file mode 100644 index 0000000000000..a19b09ff5ce5b --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/cancel_syncs_api_logic.test.ts @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { mockHttpValues } from '../../../__mocks__/kea_logic'; + +import { nextTick } from '@kbn/test-jest-helpers'; + +import { cancelSyncs } from './cancel_syncs_api_logic'; + +describe('CancelSyncsLogic', () => { + const { http } = mockHttpValues; + beforeEach(() => { + jest.clearAllMocks(); + }); + describe('cancelSyncs', () => { + it('calls correct api', async () => { + const promise = Promise.resolve('result'); + http.post.mockReturnValue(promise); + const result = cancelSyncs({ connectorId: 'connectorId1' }); + await nextTick(); + expect(http.post).toHaveBeenCalledWith( + '/internal/enterprise_search/connectors/connectorId1/cancel_syncs' + ); + await expect(result).resolves.toEqual('result'); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/cancel_syncs_api_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/cancel_syncs_api_logic.ts new file mode 100644 index 0000000000000..297e26f2c05ec --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/cancel_syncs_api_logic.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 { createApiLogic } from '../../../shared/api_logic/create_api_logic'; +import { HttpLogic } from '../../../shared/http'; + +export interface CancelSyncsApiArgs { + connectorId: string; +} + +export const cancelSyncs = async ({ connectorId }: CancelSyncsApiArgs) => { + const route = `/internal/enterprise_search/connectors/${connectorId}/cancel_syncs`; + return await HttpLogic.values.http.post(route); +}; + +export const CancelSyncsApiLogic = createApiLogic(['cancel_syncs_api_logic'], cancelSyncs); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/attach_ml_inference_pipeline.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/attach_ml_inference_pipeline.test.ts new file mode 100644 index 0000000000000..4c88466ba32b7 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/attach_ml_inference_pipeline.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { mockHttpValues } from '../../../__mocks__/kea_logic'; + +import { + attachMlInferencePipeline, + AttachMlInferencePipelineApiLogicArgs, + AttachMlInferencePipelineResponse, +} from './attach_ml_inference_pipeline'; + +describe('AttachMlInferencePipelineApiLogic', () => { + const { http } = mockHttpValues; + beforeEach(() => { + jest.clearAllMocks(); + }); + describe('createMlInferencePipeline', () => { + it('calls the api', async () => { + const response: Promise<AttachMlInferencePipelineResponse> = Promise.resolve({ + addedToParentPipeline: true, + created: false, + id: 'unit-test', + }); + http.post.mockReturnValue(response); + + const args: AttachMlInferencePipelineApiLogicArgs = { + indexName: 'unit-test-index', + pipelineName: 'unit-test', + }; + const result = await attachMlInferencePipeline(args); + expect(http.post).toHaveBeenCalledWith( + '/internal/enterprise_search/indices/unit-test-index/ml_inference/pipeline_processors/attach', + { + body: '{"pipeline_name":"unit-test"}', + } + ); + expect(result).toEqual({ + addedToParentPipeline: true, + created: false, + id: args.pipelineName, + }); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/attach_ml_inference_pipeline.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/attach_ml_inference_pipeline.ts new file mode 100644 index 0000000000000..433c41a75ea0f --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/attach_ml_inference_pipeline.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 { AttachMlInferencePipelineResponse } from '../../../../../common/types/pipelines'; + +import { createApiLogic } from '../../../shared/api_logic/create_api_logic'; +import { HttpLogic } from '../../../shared/http'; + +export interface AttachMlInferencePipelineApiLogicArgs { + indexName: string; + pipelineName: string; +} + +export type { AttachMlInferencePipelineResponse }; + +export const attachMlInferencePipeline = async ( + args: AttachMlInferencePipelineApiLogicArgs +): Promise<AttachMlInferencePipelineResponse> => { + const route = `/internal/enterprise_search/indices/${args.indexName}/ml_inference/pipeline_processors/attach`; + const params = { + pipeline_name: args.pipelineName, + }; + + return await HttpLogic.values.http.post<AttachMlInferencePipelineResponse>(route, { + body: JSON.stringify(params), + }); +}; + +export const AttachMlInferencePipelineApiLogic = createApiLogic( + ['attach_ml_inference_pipeline_api_logic'], + attachMlInferencePipeline +); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/ml_models/create_ml_inference_pipeline.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/create_ml_inference_pipeline.test.ts similarity index 100% rename from x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/ml_models/create_ml_inference_pipeline.test.ts rename to x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/create_ml_inference_pipeline.test.ts diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/ml_models/create_ml_inference_pipeline.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/create_ml_inference_pipeline.ts similarity index 89% rename from x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/ml_models/create_ml_inference_pipeline.ts rename to x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/create_ml_inference_pipeline.ts index ee5e7dd1c4295..78f08c4bc0ee8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/ml_models/create_ml_inference_pipeline.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/create_ml_inference_pipeline.ts @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { CreateMlInferencePipelineParameters } from '../../../../../common/types/pipelines'; import { createApiLogic } from '../../../shared/api_logic/create_api_logic'; import { HttpLogic } from '../../../shared/http'; @@ -23,7 +24,7 @@ export const createMlInferencePipeline = async ( args: CreateMlInferencePipelineApiLogicArgs ): Promise<CreateMlInferencePipelineResponse> => { const route = `/internal/enterprise_search/indices/${args.indexName}/ml_inference/pipeline_processors`; - const params = { + const params: CreateMlInferencePipelineParameters = { destination_field: args.destinationField, model_id: args.modelId, pipeline_name: args.pipelineName, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/ml_models/delete_ml_inference_pipeline.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/delete_ml_inference_pipeline.ts similarity index 87% rename from x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/ml_models/delete_ml_inference_pipeline.ts rename to x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/delete_ml_inference_pipeline.ts index 4abef52979380..b3ca9db0e81cb 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/ml_models/delete_ml_inference_pipeline.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/delete_ml_inference_pipeline.ts @@ -4,6 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { DeleteMlInferencePipelineResponse } from '../../../../../common/types/pipelines'; + import { createApiLogic } from '../../../shared/api_logic/create_api_logic'; import { HttpLogic } from '../../../shared/http'; @@ -12,10 +14,7 @@ export interface DeleteMlInferencePipelineApiLogicArgs { pipelineName: string; } -export interface DeleteMlInferencePipelineResponse { - deleted?: string; - updated?: string; -} +export type { DeleteMlInferencePipelineResponse }; export const deleteMlInferencePipeline = async ( args: DeleteMlInferencePipelineApiLogicArgs diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/detach_ml_inference_pipeline.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/detach_ml_inference_pipeline.test.ts new file mode 100644 index 0000000000000..a26934a40e7d0 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/detach_ml_inference_pipeline.test.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 { mockHttpValues } from '../../../__mocks__/kea_logic'; + +import { + detachMlInferencePipeline, + DetachMlInferencePipelineResponse, +} from './detach_ml_inference_pipeline'; + +describe('DetachMlInferencePipelineApiLogic', () => { + const { http } = mockHttpValues; + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe('detachMlInferencePipeline', () => { + it('calls detach ml inference api', async () => { + const response: Promise<DetachMlInferencePipelineResponse> = Promise.resolve({ + updated: 'parent-pipeline-name', + }); + http.delete.mockReturnValue(response); + const result = await detachMlInferencePipeline({ + indexName: 'mock-index-name', + pipelineName: 'mock-pipeline-name', + }); + + expect(http.delete).toHaveBeenCalledWith( + '/internal/enterprise_search/indices/mock-index-name/ml_inference/pipeline_processors/mock-pipeline-name/detach' + ); + + expect(result).toEqual({ + updated: 'parent-pipeline-name', + }); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/detach_ml_inference_pipeline.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/detach_ml_inference_pipeline.ts new file mode 100644 index 0000000000000..5a390e2b26368 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/detach_ml_inference_pipeline.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 { DeleteMlInferencePipelineResponse } from '../../../../../common/types/pipelines'; + +import { createApiLogic } from '../../../shared/api_logic/create_api_logic'; +import { HttpLogic } from '../../../shared/http'; + +export interface DetachMlInferencePipelineApiLogicArgs { + indexName: string; + pipelineName: string; +} + +export type DetachMlInferencePipelineResponse = DeleteMlInferencePipelineResponse; + +export const detachMlInferencePipeline = async ( + args: DetachMlInferencePipelineApiLogicArgs +): Promise<DetachMlInferencePipelineResponse> => { + const route = `/internal/enterprise_search/indices/${args.indexName}/ml_inference/pipeline_processors/${args.pipelineName}/detach`; + return await HttpLogic.values.http.delete<DetachMlInferencePipelineResponse>(route); +}; + +export const DetachMlInferencePipelineApiLogic = createApiLogic( + ['detach_ml_inference_pipeline_api_logic'], + detachMlInferencePipeline +); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/fetch_ml_inference_pipeline_processors.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/fetch_ml_inference_pipeline_processors.ts index 85f481b513525..2d881a0463bb7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/fetch_ml_inference_pipeline_processors.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/fetch_ml_inference_pipeline_processors.ts @@ -9,10 +9,18 @@ import { InferencePipeline } from '../../../../../common/types/pipelines'; import { createApiLogic } from '../../../shared/api_logic/create_api_logic'; import { HttpLogic } from '../../../shared/http'; -export const fetchMlInferencePipelineProcessors = async ({ indexName }: { indexName: string }) => { +export interface FetchMlInferencePipelineProcessorsApiLogicArgs { + indexName: string; +} + +export type FetchMlInferencePipelineProcessorsResponse = InferencePipeline[]; + +export const fetchMlInferencePipelineProcessors = async ({ + indexName, +}: FetchMlInferencePipelineProcessorsApiLogicArgs) => { const route = `/internal/enterprise_search/indices/${indexName}/ml_inference/pipeline_processors`; - return await HttpLogic.values.http.get<InferencePipeline[]>(route); + return await HttpLogic.values.http.get<FetchMlInferencePipelineProcessorsResponse>(route); }; export const FetchMlInferencePipelineProcessorsApiLogic = createApiLogic( diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/fetch_ml_inference_pipelines.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/fetch_ml_inference_pipelines.ts new file mode 100644 index 0000000000000..d5df97d259fda --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/pipelines/fetch_ml_inference_pipelines.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { MlInferencePipeline } from '../../../../../common/types/pipelines'; +import { createApiLogic } from '../../../shared/api_logic/create_api_logic'; +import { HttpLogic } from '../../../shared/http'; + +export type FetchMlInferencePipelinesArgs = undefined; +export type FetchMlInferencePipelinesResponse = Record<string, MlInferencePipeline | undefined>; + +export const fetchMlInferencePipelines = async () => { + const route = '/internal/enterprise_search/pipelines/ml_inference'; + + return await HttpLogic.values.http.get<FetchMlInferencePipelinesResponse>(route); +}; + +export const FetchMlInferencePipelinesApiLogic = createApiLogic( + ['fetch_ml_inference_pipelines_api_logic'], + fetchMlInferencePipelines +); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/method_connector/add_connector_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/method_connector/add_connector_logic.test.ts index e4b817f3d5973..7487a7790f797 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/method_connector/add_connector_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/method_connector/add_connector_logic.test.ts @@ -53,7 +53,7 @@ describe('AddConnectorLogic', () => { describe('apiSuccess', () => { it('navigates to correct spot and flashes success toast', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); AddConnectorApiLogic.actions.apiSuccess({ indexName: 'success' } as any); await nextTick(); jest.advanceTimersByTime(1001); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/new_search_index_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/new_search_index_logic.test.ts index f5ae61dc75dd9..8f22ba28b8dc3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/new_search_index_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/new_search_index_logic.test.ts @@ -86,7 +86,7 @@ describe('NewSearchIndexLogic', () => { }); }); it('calls makeRequest on whether API exists with a 150ms debounce', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); NewSearchIndexLogic.actions.makeRequest = jest.fn(); NewSearchIndexLogic.actions.setRawName('indexname'); await nextTick(); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/header_actions.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/header_actions.test.tsx new file mode 100644 index 0000000000000..ec0dfd0de3ef7 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/header_actions.test.tsx @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { apiIndex, connectorIndex, crawlerIndex } from '../../../../__mocks__/view_index.mock'; + +import React from 'react'; + +import { CrawlerStatusIndicator } from '../../../shared/crawler_status_indicator/crawler_status_indicator'; + +import { getHeaderActions } from './header_actions'; +import { SearchEnginesPopover } from './search_engines_popover'; +import { SyncsContextMenu } from './syncs_context_menu'; + +describe('Header Actions', () => { + it('renders api index', () => { + expect(getHeaderActions(apiIndex)).toEqual([ + <SearchEnginesPopover indexName="api" ingestionMethod="api" isHiddenIndex={false} />, + ]); + }); + it('renders connector index', () => { + expect(getHeaderActions(connectorIndex)).toEqual([ + <SyncsContextMenu />, + <SearchEnginesPopover + indexName="connector" + ingestionMethod="connector" + isHiddenIndex={false} + />, + ]); + }); + it('renders crawler index', () => { + expect(getHeaderActions(crawlerIndex)).toEqual([ + <CrawlerStatusIndicator />, + <SearchEnginesPopover indexName="crawler" ingestionMethod="crawler" isHiddenIndex={false} />, + ]); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/header_actions.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/header_actions.tsx index 10d821b87b0ee..0bf12fa6e200d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/header_actions.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/header_actions.tsx @@ -12,14 +12,14 @@ import { isCrawlerIndex, isConnectorIndex, getIngestionMethod } from '../../../. import { CrawlerStatusIndicator } from '../../../shared/crawler_status_indicator/crawler_status_indicator'; import { SearchEnginesPopover } from './search_engines_popover'; -import { SyncButton } from './sync_button'; +import { SyncsContextMenu } from './syncs_context_menu'; // Used to populate rightSideItems of an EuiPageTemplate, which is rendered right-to-left export const getHeaderActions = (indexData?: ElasticsearchIndexWithIngestion) => { const ingestionMethod = getIngestionMethod(indexData); return [ ...(isCrawlerIndex(indexData) ? [<CrawlerStatusIndicator />] : []), - ...(isConnectorIndex(indexData) ? [<SyncButton />] : []), + ...(isConnectorIndex(indexData) ? [<SyncsContextMenu />] : []), <SearchEnginesPopover indexName={indexData?.name} ingestionMethod={ingestionMethod} diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/sync_button.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/sync_button.tsx deleted file mode 100644 index 461bb2dd0e646..0000000000000 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/sync_button.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 { useValues, useActions } from 'kea'; - -import { EuiButton } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; - -import { IngestionStatus } from '../../../../types'; -import { IndexViewLogic } from '../../index_view_logic'; - -export const SyncButton: React.FC = () => { - const { ingestionMethod, ingestionStatus, isSyncing, isWaitingForSync } = - useValues(IndexViewLogic); - const { startSync } = useActions(IndexViewLogic); - - const getSyncButtonText = () => { - if (isWaitingForSync) { - return i18n.translate( - 'xpack.enterpriseSearch.content.index.syncButton.waitingForSync.label', - { - defaultMessage: 'Waiting for sync', - } - ); - } - if (isSyncing && ingestionStatus !== IngestionStatus.ERROR) { - return i18n.translate('xpack.enterpriseSearch.content.index.syncButton.syncing.label', { - defaultMessage: 'Syncing', - }); - } - return i18n.translate('xpack.enterpriseSearch.content.index.syncButton.label', { - defaultMessage: 'Sync', - }); - }; - return ( - <EuiButton - data-telemetry-id={`entSearchContent-${ingestionMethod}-header-syncNow-startSync`} - onClick={startSync} - fill - disabled={ingestionStatus === IngestionStatus.INCOMPLETE} - isLoading={ - // If there's an error, the ingestion status may not be accurate and we may need to be able to trigger a sync - (isSyncing && !(ingestionStatus === IngestionStatus.ERROR)) || isWaitingForSync - } - > - {getSyncButtonText()} - </EuiButton> - ); -}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/syncs_context_menu.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/syncs_context_menu.test.tsx new file mode 100644 index 0000000000000..e49077f040542 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/syncs_context_menu.test.tsx @@ -0,0 +1,106 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import '../../../../../__mocks__/shallow_useeffect.mock'; +import { setMockValues, setMockActions } from '../../../../../__mocks__/kea_logic'; + +import React from 'react'; + +import { + EuiPopover, + EuiContextMenuItem, + EuiContextMenuPanel, + EuiButton, + EuiResizeObserver, +} from '@elastic/eui'; + +import { mountWithIntl } from '@kbn/test-jest-helpers'; + +import { Status } from '../../../../../../../common/types/api'; + +import { IngestionMethod, IngestionStatus } from '../../../../types'; + +import { SyncsContextMenu } from './syncs_context_menu'; + +describe('SyncsContextMenu', () => { + const startSync = jest.fn(); + const cancelSyncs = jest.fn(); + + const mockValues = { + ingestionMethod: IngestionMethod.CONNECTOR, + ingestionStatus: IngestionStatus.CONNECTED, + isCanceling: false, + isSyncing: false, + isWaitingForSync: false, + status: Status.SUCCESS, + }; + + beforeEach(() => { + setMockValues(mockValues); + setMockActions({ + cancelSyncs, + startSync, + }); + }); + + it('renders', () => { + setMockValues({ ...mockValues, isWaitingForSync: true }); + const wrapper = mountWithIntl(<SyncsContextMenu />); + const popover = wrapper.find(EuiPopover); + + expect(popover).toHaveLength(1); + expect(popover.props().isOpen).toEqual(false); + }); + + it('Can cancel syncs', () => { + setMockValues({ ...mockValues, isSyncing: true }); + const wrapper = mountWithIntl(<SyncsContextMenu />); + const button = wrapper.find(EuiButton); + button.simulate('click'); + + const menuItems = wrapper + .find(EuiContextMenuPanel) + .find(EuiResizeObserver) + .find(EuiContextMenuItem); + expect(menuItems).toHaveLength(1); + + const firstButton = menuItems.get(0); + + expect(firstButton.props).toEqual( + expect.objectContaining({ + children: 'Cancel Syncs', + disabled: false, + }) + ); + menuItems.first().simulate('click'); + expect(cancelSyncs).toHaveBeenCalled(); + }); + + it('Can start a sync', () => { + setMockValues({ ...mockValues, ingestionStatus: IngestionStatus.ERROR }); + const wrapper = mountWithIntl(<SyncsContextMenu />); + const button = wrapper.find(EuiButton); + button.simulate('click'); + + const menuItems = wrapper + .find(EuiContextMenuPanel) + .find(EuiResizeObserver) + .find(EuiContextMenuItem); + expect(menuItems).toHaveLength(2); + + const firstButton = menuItems.get(0); + + expect(firstButton.props).toEqual( + expect.objectContaining({ + children: 'Sync', + disabled: false, + }) + ); + menuItems.first().simulate('click'); + expect(startSync).toHaveBeenCalled(); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/syncs_context_menu.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/syncs_context_menu.tsx new file mode 100644 index 0000000000000..5ffda5726bdbd --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/header_actions/syncs_context_menu.tsx @@ -0,0 +1,126 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React, { useState } from 'react'; + +import { useActions, useValues } from 'kea'; + +import { + EuiButton, + EuiContextMenuItem, + EuiContextMenuPanel, + EuiFlexGroup, + EuiFlexItem, + EuiLoadingSpinner, + EuiPopover, +} from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; + +import { Status } from '../../../../../../../common/types/api'; +import { CancelSyncsApiLogic } from '../../../../api/connector/cancel_syncs_api_logic'; +import { IngestionStatus } from '../../../../types'; +import { CancelSyncsLogic } from '../../connector/cancel_syncs_logic'; +import { IndexViewLogic } from '../../index_view_logic'; + +export const SyncsContextMenu: React.FC = () => { + const { ingestionMethod, ingestionStatus, isCanceling, isSyncing, isWaitingForSync } = + useValues(IndexViewLogic); + const { cancelSyncs } = useActions(CancelSyncsLogic); + const { status } = useValues(CancelSyncsApiLogic); + const { startSync } = useActions(IndexViewLogic); + + const [isPopoverOpen, setPopover] = useState(false); + + const togglePopover = () => setPopover(!isPopoverOpen); + const closePopover = () => setPopover(false); + + const getSyncButtonText = () => { + if (isWaitingForSync) { + return i18n.translate( + 'xpack.enterpriseSearch.content.index.syncButton.waitingForSync.label', + { + defaultMessage: 'Waiting for sync', + } + ); + } + if (isSyncing && ingestionStatus !== IngestionStatus.ERROR) { + return i18n.translate('xpack.enterpriseSearch.content.index.syncButton.syncing.label', { + defaultMessage: 'Syncing', + }); + } + return i18n.translate('xpack.enterpriseSearch.content.index.syncButton.label', { + defaultMessage: 'Sync', + }); + }; + + const syncLoading = (isSyncing || isWaitingForSync) && ingestionStatus !== IngestionStatus.ERROR; + + return ( + <EuiPopover + button={ + <EuiButton + data-telemetry-id={`entSearchContent-${ingestionMethod}-header-sync-openSyncMenu`} + iconType="arrowDown" + iconSide="right" + onClick={togglePopover} + fill + > + <EuiFlexGroup alignItems="center" responsive={false} gutterSize="s"> + {syncLoading && ( + <EuiFlexItem grow={false}> + <EuiLoadingSpinner size="m" /> + </EuiFlexItem> + )} + <EuiFlexItem>{getSyncButtonText()}</EuiFlexItem> + </EuiFlexGroup> + </EuiButton> + } + isOpen={isPopoverOpen} + closePopover={closePopover} + panelPaddingSize="none" + anchorPosition="downLeft" + > + <EuiContextMenuPanel + items={[ + ...(syncLoading + ? [] + : [ + <EuiContextMenuItem + data-telemetry-id={`entSearchContent-${ingestionMethod}-header-sync-startSync`} + disabled={ingestionStatus === IngestionStatus.CONNECTED} + key="Sync" + onClick={() => { + closePopover(); + startSync(); + }} + icon="play" + > + {getSyncButtonText()} + </EuiContextMenuItem>, + ]), + <EuiContextMenuItem + data-telemetry-id={`entSearchContent-${ingestionMethod}-header-sync-cancelSync`} + disabled={ + (isCanceling && ingestionStatus !== IngestionStatus.ERROR) || + status === Status.LOADING + } + key="Cancel sync" + onClick={() => { + closePopover(); + cancelSyncs(); + }} + icon="trash" + > + {i18n.translate('xpack.enterpriseSearch.index.header.cancelSyncsTitle', { + defaultMessage: 'Cancel Syncs', + })} + </EuiContextMenuItem>, + ]} + /> + </EuiPopover> + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/cancel_syncs_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/cancel_syncs_logic.test.ts new file mode 100644 index 0000000000000..a63dac6806cc8 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/cancel_syncs_logic.test.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 { LogicMounter, mockFlashMessageHelpers } from '../../../../__mocks__/kea_logic'; + +import { indices } from '../../../__mocks__/search_indices.mock'; + +import { FetchIndexApiLogic } from '../../../api/index/fetch_index_api_logic'; +import { IndexViewLogic } from '../index_view_logic'; + +import { CancelSyncsLogic } from './cancel_syncs_logic'; + +describe('CancelSyncsLogic', () => { + const { mount } = new LogicMounter(CancelSyncsLogic); + const { mount: IndexViewLogicMount } = new LogicMounter(IndexViewLogic); + const { mount: FetchIndexApiLogicMount } = new LogicMounter(FetchIndexApiLogic); + const { clearFlashMessages, flashAPIErrors, flashSuccessToast } = mockFlashMessageHelpers; + const DEFAULT_VALUES = { + connectorId: null, + isConnectorIndex: false, + }; + + beforeEach(() => { + jest.clearAllMocks(); + IndexViewLogicMount(); + FetchIndexApiLogicMount(); + mount(); + }); + it('has expected default values', () => { + expect(CancelSyncsLogic.values).toEqual(DEFAULT_VALUES); + }); + + describe('actions', () => { + describe('cancelSyncs', () => { + it('should not call makeCancelSyncRequest if index is not a connector', () => { + CancelSyncsLogic.actions.makeCancelSyncsRequest = jest.fn(); + CancelSyncsLogic.actions.cancelSyncs(); + expect(CancelSyncsLogic.actions.makeCancelSyncsRequest).not.toHaveBeenCalled(); + }); + it('should call clearFlashMessages and request if index is a connector', () => { + CancelSyncsLogic.actions.makeCancelSyncsRequest = jest.fn(); + FetchIndexApiLogic.actions.apiSuccess(indices[1]); + CancelSyncsLogic.actions.cancelSyncs(); + expect(CancelSyncsLogic.actions.makeCancelSyncsRequest).toHaveBeenCalled(); + }); + }); + describe('makeRequest', () => { + it('should call clearFlashMessages', () => { + CancelSyncsLogic.actions.makeCancelSyncsRequest({ + connectorId: 'id', + }); + expect(clearFlashMessages).toHaveBeenCalled(); + }); + }); + describe('apiError', () => { + it('should call flashAPIError', () => { + CancelSyncsLogic.actions.cancelSyncsApiError('error' as any); + expect(flashAPIErrors).toHaveBeenCalledWith('error'); + }); + }); + describe('apiSuccess', () => { + it('should call flashAPIError', () => { + CancelSyncsLogic.actions.cancelSyncsApiSuccess('success' as any); + expect(flashSuccessToast).toHaveBeenCalledWith('Successfully canceled syncs'); + }); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/cancel_syncs_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/cancel_syncs_logic.ts new file mode 100644 index 0000000000000..73fa34d69c83d --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/cancel_syncs_logic.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 { kea, MakeLogicType } from 'kea'; + +import { i18n } from '@kbn/i18n'; + +import { Actions } from '../../../../shared/api_logic/create_api_logic'; +import { + clearFlashMessages, + flashAPIErrors, + flashSuccessToast, +} from '../../../../shared/flash_messages'; + +import { + CancelSyncsApiArgs, + CancelSyncsApiLogic, +} from '../../../api/connector/cancel_syncs_api_logic'; +import { IndexViewLogic } from '../index_view_logic'; + +type CancelSyncsApiActions = Actions<CancelSyncsApiArgs, {}>; + +interface CancelSyncsLogicValues { + connectorId?: string; + isConnectorIndex: boolean; +} + +interface CancelSyncsLogicActions { + cancelSyncs: () => void; + cancelSyncsApiError: CancelSyncsApiActions['apiError']; + cancelSyncsApiSuccess: CancelSyncsApiActions['apiSuccess']; + makeCancelSyncsRequest: CancelSyncsApiActions['makeRequest']; +} + +export const CancelSyncsLogic = kea<MakeLogicType<CancelSyncsLogicValues, CancelSyncsLogicActions>>( + { + actions: { + cancelSyncs: true, + }, + connect: { + actions: [ + CancelSyncsApiLogic, + [ + 'apiError as cancelSyncsApiError', + 'apiSuccess as cancelSyncsApiSuccess', + 'makeRequest as makeCancelSyncsRequest', + ], + ], + values: [IndexViewLogic, ['connectorId', 'isConnectorIndex']], + }, + listeners: ({ actions, values }) => ({ + cancelSyncs: () => { + if (values.isConnectorIndex && values.connectorId) { + actions.makeCancelSyncsRequest({ connectorId: values.connectorId }); + } + }, + cancelSyncsApiError: (e) => flashAPIErrors(e), + cancelSyncsApiSuccess: () => { + flashSuccessToast( + i18n.translate('xpack.enterpriseSearch.content.searchIndex.cancelSyncs.successMessage', { + defaultMessage: 'Successfully canceled syncs', + }) + ); + }, + makeCancelSyncsRequest: () => { + clearFlashMessages(); + }, + }), + } +); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/add_domain/add_domain_form.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/add_domain/add_domain_form.tsx index b0722ca50d2c7..e3d38256e9642 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/add_domain/add_domain_form.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/add_domain/add_domain_form.tsx @@ -19,6 +19,7 @@ import { EuiFieldText, EuiSpacer, EuiText, + EuiFormControlLayout, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -56,13 +57,14 @@ export const AddDomainForm: React.FC = () => { > <EuiFlexGroup> <EuiFlexItem grow> - <EuiFieldText - autoFocus - placeholder="https://" - value={addDomainFormInputValue} - onChange={(e) => setAddDomainFormInputValue(e.target.value)} - fullWidth - /> + <EuiFormControlLayout clear={{ onClick: () => setAddDomainFormInputValue('') }}> + <EuiFieldText + autoFocus + value={addDomainFormInputValue} + onChange={(e) => setAddDomainFormInputValue(e.target.value)} + fullWidth + /> + </EuiFormControlLayout> </EuiFlexItem> <EuiFlexItem grow={false}> <EuiButton type="submit" fill disabled={addDomainFormInputValue.length === 0}> diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/add_domain/validation_step_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/add_domain/validation_step_panel.tsx index 07e86b5f92d9e..fb33f620f82a7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/add_domain/validation_step_panel.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/add_domain/validation_step_panel.tsx @@ -10,10 +10,12 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem, + EuiLink, EuiMarkdownFormat, EuiPanel, EuiSpacer, EuiTitle, + getDefaultEuiMarkdownProcessingPlugins, } from '@elastic/eui'; import { CrawlerDomainValidationStep } from '../../../../../api/crawler/types'; @@ -27,6 +29,9 @@ interface ValidationStepPanelProps { step: CrawlerDomainValidationStep; } +const processingPlugins = getDefaultEuiMarkdownProcessingPlugins(); +processingPlugins[1][1].components.a = (props) => <EuiLink {...props} target="_blank" />; + export const ValidationStepPanel: React.FC<ValidationStepPanelProps> = ({ step, label, @@ -49,7 +54,11 @@ export const ValidationStepPanel: React.FC<ValidationStepPanelProps> = ({ {showErrorMessage && ( <> <EuiSpacer size="xs" /> - <EuiMarkdownFormat textSize="s" data-test-subj="errorMessage"> + <EuiMarkdownFormat + textSize="s" + data-test-subj="errorMessage" + processingPluginList={processingPlugins} + > {step.message || ''} </EuiMarkdownFormat> {action && ( diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/domains_table.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/domains_table.tsx index 44a22f258b506..c86fc2b3a20dc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/domains_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/domains_table.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { useActions, useValues } from 'kea'; -import { EuiBasicTableColumn, EuiBasicTable } from '@elastic/eui'; +import { EuiBasicTableColumn, EuiBasicTable, EuiButtonIcon, EuiCopy } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -39,18 +39,23 @@ export const DomainsTable: React.FC = () => { { field: 'url', name: i18n.translate('xpack.enterpriseSearch.crawler.domainsTable.column.domainURL', { - defaultMessage: 'Domain URL', + defaultMessage: 'Domain', }), render: (_, domain: CrawlerDomain) => ( - <EuiLinkTo - data-test-subj="CrawlerDomainURL" - to={generateEncodedPath(SEARCH_INDEX_CRAWLER_DOMAIN_DETAIL_PATH, { - domainId: domain.id, - indexName, - })} - > - {domain.url} - </EuiLinkTo> + <> + <EuiCopy textToCopy={domain.url}> + {(copy) => <EuiButtonIcon onClick={copy} iconSize="s" iconType="copy" />} + </EuiCopy> + <EuiLinkTo + data-test-subj="CrawlerDomainURL" + to={generateEncodedPath(SEARCH_INDEX_CRAWLER_DOMAIN_DETAIL_PATH, { + domainId: domain.id, + indexName, + })} + > + {domain.url} + </EuiLinkTo> + </> ), }, { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/documents_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/documents_logic.test.ts index b927e6a5738e7..1bd1e1a405ee3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/documents_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/documents_logic.test.ts @@ -85,7 +85,7 @@ describe('DocumentsLogic', () => { describe('listeners', () => { describe('setSearchQuery', () => { it('make documents apiRequest request after 250ms debounce', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); DocumentsLogic.actions.makeRequest = jest.fn(); DocumentsLogic.actions.setSearchQuery('test'); await nextTick(); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_view_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_view_logic.test.ts index e09b66051e4aa..2bce9072d169d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_view_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_view_logic.test.ts @@ -32,6 +32,8 @@ const DEFAULT_VALUES = { indexName: '', ingestionMethod: IngestionMethod.API, ingestionStatus: IngestionStatus.CONNECTED, + isCanceling: false, + isConnectorIndex: false, isSyncing: false, isWaitingForSync: false, lastUpdated: null, @@ -93,8 +95,11 @@ describe('IndexViewLogic', () => { ...CONNECTOR_VALUES.index, connector: { ...CONNECTOR_VALUES.index.connector, sync_now: true }, }, + isCanceling: false, + isConnectorIndex: true, isWaitingForSync: true, localSyncNowValue: true, + pipelineData: undefined, syncStatus: SyncStatus.COMPLETED, }) ); @@ -199,7 +204,7 @@ describe('IndexViewLogic', () => { describe('createNewFetchIndexTimeout', () => { it('should trigger fetchIndex after timeout', async () => { IndexViewLogic.actions.fetchIndex = jest.fn(); - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); IndexViewLogic.actions.createNewFetchIndexTimeout(1); expect(IndexViewLogic.actions.fetchIndex).not.toHaveBeenCalled(); jest.advanceTimersByTime(2); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_view_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_view_logic.ts index 454bc5f9a0be0..a31b4f4b491f6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_view_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_view_logic.ts @@ -14,6 +14,7 @@ import { IngestPipelineParams, SyncStatus, } from '../../../../../common/types/connectors'; +import { ElasticsearchIndexWithIngestion } from '../../../../../common/types/indices'; import { Actions } from '../../../shared/api_logic/create_api_logic'; import { flashAPIErrors, @@ -43,25 +44,26 @@ import { IndexNameLogic } from './index_name_logic'; const FETCH_INDEX_POLLING_DURATION = 5000; // 1 seconds const FETCH_INDEX_POLLING_DURATION_ON_FAILURE = 30000; // 30 seconds -type FetchIndexApiValues = Actions<FetchIndexApiParams, FetchIndexApiResponse>; -type StartSyncApiValues = Actions<StartSyncArgs, {}>; +type FetchIndexApiActions = Actions<FetchIndexApiParams, FetchIndexApiResponse>; +type StartSyncApiActions = Actions<StartSyncArgs, {}>; export interface IndexViewActions { + cancelSyncs(): void; clearFetchIndexTimeout(): void; createNewFetchIndexTimeout(duration: number): { duration: number }; fetchCrawlerData: () => void; fetchIndex: () => void; - fetchIndexApiSuccess: FetchIndexApiValues['apiSuccess']; - makeFetchIndexRequest: FetchIndexApiValues['makeRequest']; - makeStartSyncRequest: StartSyncApiValues['makeRequest']; + fetchIndexApiSuccess: FetchIndexApiActions['apiSuccess']; + makeFetchIndexRequest: FetchIndexApiActions['makeRequest']; + makeStartSyncRequest: StartSyncApiActions['makeRequest']; recheckIndex: () => void; - resetFetchIndexApi: FetchIndexApiValues['apiReset']; + resetFetchIndexApi: FetchIndexApiActions['apiReset']; resetRecheckIndexLoading: () => void; setFetchIndexTimeoutId(timeoutId: NodeJS.Timeout): { timeoutId: NodeJS.Timeout }; startFetchIndexPoll(): void; startSync(): void; - startSyncApiError: StartSyncApiValues['apiError']; - startSyncApiSuccess: StartSyncApiValues['apiSuccess']; + startSyncApiError: StartSyncApiActions['apiError']; + startSyncApiSuccess: StartSyncApiActions['apiSuccess']; stopFetchIndexPoll(): void; } @@ -74,6 +76,7 @@ export interface IndexViewValues { indexName: string; ingestionMethod: IngestionMethod; ingestionStatus: IngestionStatus; + isCanceling: boolean; isSyncing: boolean; isWaitingForSync: boolean; lastUpdated: string | null; @@ -237,6 +240,14 @@ export const IndexViewLogic = kea<MakeLogicType<IndexViewValues, IndexViewAction index: [() => [selectors.data], (data) => (data ? indexToViewIndex(data) : undefined)], ingestionMethod: [() => [selectors.data], (data) => getIngestionMethod(data)], ingestionStatus: [() => [selectors.data], (data) => getIngestionStatus(data)], + isCanceling: [ + () => [selectors.syncStatus], + (syncStatus: SyncStatus) => syncStatus === SyncStatus.CANCELING, + ], + isConnectorIndex: [ + () => [selectors.data], + (data: ElasticsearchIndexWithIngestion | undefined) => isConnectorIndex(data), + ], isSyncing: [ () => [selectors.syncStatus], (syncStatus: SyncStatus) => syncStatus === SyncStatus.IN_PROGRESS, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.test.tsx new file mode 100644 index 0000000000000..1dd7d8eeccf2d --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.test.tsx @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { shallow } from 'enzyme'; + +import { EuiButtonEmpty, EuiToolTip } from '@elastic/eui'; + +import { InferencePipeline, TrainedModelState } from '../../../../../../common/types/pipelines'; + +import { DeleteInferencePipelineButton } from './delete_inference_pipeline_button'; + +export const DEFAULT_VALUES: InferencePipeline = { + modelId: 'sample-bert-ner-model', + modelState: TrainedModelState.Started, + pipelineName: 'Sample Processor', + pipelineReferences: ['index@ml-inference'], + types: ['pytorch', 'ner'], +}; + +describe('DeleteInferencePipelineButton', () => { + const onClickHandler = jest.fn(); + beforeEach(() => { + jest.clearAllMocks(); + }); + it('renders button with defaults', () => { + const wrapper = shallow( + <DeleteInferencePipelineButton onClick={onClickHandler} pipeline={DEFAULT_VALUES} /> + ); + const tooltip = wrapper.find(EuiToolTip); + expect(tooltip).toHaveLength(0); + + const btn = wrapper.find(EuiButtonEmpty); + expect(btn).toHaveLength(1); + expect(btn.prop('iconType')).toBe('trash'); + expect(btn.prop('color')).toBe('text'); + expect(btn.prop('children')).toBe('Delete pipeline'); + }); + it('renders disabled with tooltip with multiple references', () => { + const wrapper = shallow( + <DeleteInferencePipelineButton + onClick={onClickHandler} + pipeline={{ + ...DEFAULT_VALUES, + pipelineReferences: ['index@ml-inference', 'other-index@ml-inference'], + }} + /> + ); + const tooltip = wrapper.find(EuiToolTip); + expect(tooltip).toHaveLength(1); + + const btn = wrapper.find(EuiButtonEmpty); + expect(btn).toHaveLength(1); + expect(btn.prop('disabled')).toBe(true); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.tsx new file mode 100644 index 0000000000000..4ab47fec32223 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.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 from 'react'; + +import { EuiButtonEmpty, EuiToolTip } from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; + +import { InferencePipeline } from '../../../../../../common/types/pipelines'; + +export interface DeleteInferencePipelineButtonProps { + 'data-telemetry-id'?: string; + onClick: () => void; + pipeline: InferencePipeline; +} + +const DELETE_PIPELINE_LABEL = i18n.translate( + 'xpack.enterpriseSearch.inferencePipelineCard.action.delete', + { + defaultMessage: 'Delete pipeline', + } +); + +export const DeleteInferencePipelineButton: React.FC<DeleteInferencePipelineButtonProps> = ( + props +) => { + if (props.pipeline.pipelineReferences.length > 1) { + const indexReferences = props.pipeline.pipelineReferences + .map((mlPipeline) => mlPipeline.replace('@ml-inference', '')) + .join(', '); + return ( + <EuiToolTip + position="top" + content={i18n.translate( + 'xpack.enterpriseSearch.inferencePipelineCard.action.delete.disabledDescription', + { + defaultMessage: + 'This inference pipeline cannot be deleted because it is used in multiple pipelines [{indexReferences}]. You must detach this pipeline from all but one ingest pipeline before it can be deleted.', + values: { + indexReferences, + }, + } + )} + > + <EuiButtonEmpty + data-telemetry-id={props['data-telemetry-id']} + size="s" + flush="both" + iconType="trash" + color="text" + disabled + > + {DELETE_PIPELINE_LABEL} + </EuiButtonEmpty> + </EuiToolTip> + ); + } + return ( + <EuiButtonEmpty + data-telemetry-id={props['data-telemetry-id']} + size="s" + flush="both" + iconType="trash" + color="text" + onClick={props.onClick} + > + {DELETE_PIPELINE_LABEL} + </EuiButtonEmpty> + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.test.ts new file mode 100644 index 0000000000000..16722f7add9e9 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.test.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 { LogicMounter, mockFlashMessageHelpers } from '../../../../__mocks__/kea_logic'; + +import { nextTick } from '@kbn/test-jest-helpers'; + +import { HttpError } from '../../../../../../common/types/api'; +import { MlInferenceHistoryResponse } from '../../../../../../common/types/pipelines'; +import { FetchMlInferencePipelineHistoryApiLogic } from '../../../api/pipelines/fetch_ml_inference_pipeline_history'; + +import { InferenceHistoryValues, InferenceHistoryLogic } from './inference_history_logic'; + +const DEFAULT_VALUES: InferenceHistoryValues = { + fetchIndexInferenceHistoryStatus: 0, + indexName: '', + inferenceHistory: undefined, + inferenceHistoryData: undefined, + isLoading: true, +}; + +describe('InferenceHistoryLogic', () => { + const { mount } = new LogicMounter(InferenceHistoryLogic); + const { mount: mountFetchMlInferencePipelineHistoryApiLogic } = new LogicMounter( + FetchMlInferencePipelineHistoryApiLogic + ); + + beforeEach(() => { + jest.clearAllMocks(); + mountFetchMlInferencePipelineHistoryApiLogic(); + mount(); + }); + + it('has expected default values', () => { + expect(InferenceHistoryLogic.values).toEqual(DEFAULT_VALUES); + }); + + describe('listeners', () => { + it('flashes errors on history fetch error', async () => { + const error = { + body: { + error: '', + message: 'this is an error', + statusCode: 500, + }, + } as HttpError; + FetchMlInferencePipelineHistoryApiLogic.actions.apiError(error); + await nextTick(); + + expect(mockFlashMessageHelpers.flashAPIErrors).toHaveBeenCalledWith(error); + }); + it('clears flash messages on history fetch', async () => { + FetchMlInferencePipelineHistoryApiLogic.actions.makeRequest({ indexName: 'test' }); + await nextTick(); + expect(mockFlashMessageHelpers.clearFlashMessages).toHaveBeenCalledTimes(1); + }); + }); + + describe('selectors', () => { + describe('inferenceHistory', () => { + it('returns history from api response', () => { + const historyResponse: MlInferenceHistoryResponse = { + history: [ + { + doc_count: 10, + pipeline: 'unit-test', + }, + { + doc_count: 12, + pipeline: 'unit-test-002', + }, + ], + }; + FetchMlInferencePipelineHistoryApiLogic.actions.apiSuccess(historyResponse); + + expect(InferenceHistoryLogic.values.inferenceHistory).toEqual(historyResponse.history); + }); + }); + describe('isLoading', () => { + it('returns false for success', () => { + FetchMlInferencePipelineHistoryApiLogic.actions.apiSuccess({ history: [] }); + expect(InferenceHistoryLogic.values.isLoading).toBe(false); + }); + it('returns false for error', () => { + FetchMlInferencePipelineHistoryApiLogic.actions.apiError({ + body: { + error: '', + message: 'this is an error', + statusCode: 500, + }, + } as HttpError); + expect(InferenceHistoryLogic.values.isLoading).toBe(false); + }); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.ts index 1a27f5dfd8346..e1ec8feb77f09 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.ts @@ -18,14 +18,14 @@ import { } from '../../../api/pipelines/fetch_ml_inference_pipeline_history'; import { IndexNameLogic } from '../index_name_logic'; -interface InferenceHistoryActions { +export interface InferenceHistoryActions { fetchIndexInferenceHistory: Actions< FetchMlInferencePipelineHistoryApiLogicArgs, FetchMlInferencePipelineHistoryApiLogicResponse >['makeRequest']; } -interface InferenceHistoryValues { +export interface InferenceHistoryValues { fetchIndexInferenceHistoryStatus: Status; indexName: string; inferenceHistory: MlInferenceHistoryItem[] | undefined; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx index a888364ac8bb3..f83dfd3fea11b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx @@ -36,6 +36,7 @@ import { IndexNameLogic } from '../index_name_logic'; import { IndexViewLogic } from '../index_view_logic'; +import { DeleteInferencePipelineButton } from './delete_inference_pipeline_button'; import { TrainedModelHealth } from './ml_model_health'; import { PipelinesLogic } from './pipelines_logic'; @@ -45,7 +46,7 @@ export const InferencePipelineCard: React.FC<InferencePipeline> = (pipeline) => const { ingestionMethod } = useValues(IndexViewLogic); const [isPopOverOpen, setIsPopOverOpen] = useState(false); const [showConfirmDelete, setShowConfirmDelete] = useState(false); - const { deleteMlPipeline } = useActions(PipelinesLogic); + const { deleteMlPipeline, detachMlPipeline } = useActions(PipelinesLogic); const showConfirmDeleteModal = () => { setShowConfirmDelete(true); setIsPopOverOpen(false); @@ -110,20 +111,32 @@ export const InferencePipelineCard: React.FC<InferencePipeline> = (pipeline) => <EuiFlexItem> <div> <EuiButtonEmpty - data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-inferencePipeline-deletePipeline`} + data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-inferencePipeline-detachPipeline`} size="s" flush="both" - iconType="trash" + iconType="unlink" color="text" - onClick={showConfirmDeleteModal} + onClick={() => { + detachMlPipeline({ indexName, pipelineName }); + setIsPopOverOpen(false); + }} > {i18n.translate( - 'xpack.enterpriseSearch.inferencePipelineCard.action.delete', - { defaultMessage: 'Delete pipeline' } + 'xpack.enterpriseSearch.inferencePipelineCard.action.detach', + { defaultMessage: 'Detach pipeline' } )} </EuiButtonEmpty> </div> </EuiFlexItem> + <EuiFlexItem> + <div> + <DeleteInferencePipelineButton + data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-inferencePipeline-deletePipeline`} + onClick={showConfirmDeleteModal} + pipeline={pipeline} + /> + </div> + </EuiFlexItem> </EuiFlexGroup> </EuiPopover> </EuiFlexItem> diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.test.tsx new file mode 100644 index 0000000000000..4948257a18aff --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.test.tsx @@ -0,0 +1,409 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { setMockValues, setMockActions } from '../../../../../__mocks__/kea_logic'; + +import React from 'react'; + +import { shallow } from 'enzyme'; + +import { + EuiButton, + EuiButtonEmpty, + EuiCallOut, + EuiStepsHorizontal, + EuiLoadingSpinner, +} from '@elastic/eui'; +import { TrainedModelConfigResponse } from '@kbn/ml-plugin/common/types/trained_models'; + +import { + AddMLInferencePipelineModal, + AddProcessorContent, + ModalFooter, + ModalSteps, +} from './add_ml_inference_pipeline_modal'; +import { ConfigurePipeline } from './configure_pipeline'; +import { AddInferencePipelineSteps, EMPTY_PIPELINE_CONFIGURATION } from './ml_inference_logic'; +import { NoModelsPanel } from './no_models'; +import { ReviewPipeline } from './review_pipeline'; +import { TestPipeline } from './test_pipeline'; + +const supportedMLModels: TrainedModelConfigResponse[] = [ + { + inference_config: { + ner: {}, + }, + input: { + field_names: [], + }, + model_id: 'test_model_id', + model_type: 'pytorch', + tags: ['test_tag'], + version: '1', + }, +]; +const DEFAULT_VALUES = { + addInferencePipelineModal: { + configuration: { ...EMPTY_PIPELINE_CONFIGURATION }, + indexName: 'unit-test-index', + simulateBody: '', + step: AddInferencePipelineSteps.Configuration, + }, + createErrors: [], + indexName: 'unit-test-index', + isLoading: false, + isPipelineDataValid: true, + supportedMLModels, +}; +const onClose = jest.fn(); + +describe('AddMLInferencePipelineModal', () => { + beforeEach(() => { + jest.clearAllMocks(); + setMockValues({ ...DEFAULT_VALUES }); + setMockActions({ + setIndexName: jest.fn(), + }); + }); + it('renders AddProcessorContent', () => { + const wrapper = shallow(<AddMLInferencePipelineModal onClose={onClose} />); + expect(wrapper.find(AddProcessorContent)).toHaveLength(1); + }); + describe('AddProcessorContent', () => { + it('renders spinner when loading', () => { + setMockValues({ ...DEFAULT_VALUES, isLoading: true }); + const wrapper = shallow(<AddProcessorContent onClose={onClose} />); + expect(wrapper.find(EuiLoadingSpinner)).toHaveLength(1); + }); + it('renders no models panel when there are no models', () => { + setMockValues({ ...DEFAULT_VALUES, supportedMLModels: [] }); + const wrapper = shallow(<AddProcessorContent onClose={onClose} />); + expect(wrapper.find(NoModelsPanel)).toHaveLength(1); + }); + it('renders ModalSteps', () => { + const wrapper = shallow(<AddProcessorContent onClose={onClose} />); + expect(wrapper.find(ModalSteps)).toHaveLength(1); + }); + it('renders ModalFooter', () => { + const wrapper = shallow(<AddProcessorContent onClose={onClose} />); + expect(wrapper.find(ModalFooter)).toHaveLength(1); + }); + it('renders errors', () => { + const errorMsg = 'oh no!'; + setMockValues({ ...DEFAULT_VALUES, createErrors: [errorMsg] }); + const wrapper = shallow(<AddProcessorContent onClose={onClose} />); + + expect(wrapper.find(EuiCallOut)).toHaveLength(1); + const errorCallout = wrapper.find(EuiCallOut); + expect(errorCallout.prop('color')).toBe('danger'); + expect(errorCallout.prop('iconType')).toBe('alert'); + expect(errorCallout.find('p')).toHaveLength(1); + expect(errorCallout.find('p').text()).toBe(errorMsg); + }); + it('renders configure step', () => { + const wrapper = shallow(<AddProcessorContent onClose={onClose} />); + expect(wrapper.find(ConfigurePipeline)).toHaveLength(1); + }); + it('renders test step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + step: AddInferencePipelineSteps.Test, + }, + }); + const wrapper = shallow(<AddProcessorContent onClose={onClose} />); + expect(wrapper.find(TestPipeline)).toHaveLength(1); + }); + it('renders review step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + step: AddInferencePipelineSteps.Review, + }, + }); + const wrapper = shallow(<AddProcessorContent onClose={onClose} />); + expect(wrapper.find(ReviewPipeline)).toHaveLength(1); + }); + }); + describe('ModalSteps', () => { + const CONFIGURE_STEP_INDEX = 0; + const TEST_STEP_INDEX = 1; + const REVIEW_STEP_INDEX = 2; + const setAddInferencePipelineStep = jest.fn(); + beforeEach(() => { + setMockActions({ + setAddInferencePipelineStep, + }); + }); + it('renders EuiStepsHorizontal', () => { + const wrapper = shallow(<ModalSteps />); + expect(wrapper.find(EuiStepsHorizontal)).toHaveLength(1); + }); + it('configure step is complete with valid data', () => { + const wrapper = shallow(<ModalSteps />); + const steps = wrapper.find(EuiStepsHorizontal); + const configureStep = steps.prop('steps')[CONFIGURE_STEP_INDEX]; + expect(configureStep.title).toBe('Configure'); + expect(configureStep.status).toBe('complete'); + }); + it('configure step is current with invalid data', () => { + setMockValues({ + ...DEFAULT_VALUES, + isPipelineDataValid: false, + }); + const wrapper = shallow(<ModalSteps />); + const steps = wrapper.find(EuiStepsHorizontal); + const configureStep = steps.prop('steps')[CONFIGURE_STEP_INDEX]; + expect(configureStep.title).toBe('Configure'); + expect(configureStep.status).toBe('current'); + }); + it('test step is current when on step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + step: AddInferencePipelineSteps.Test, + }, + }); + const wrapper = shallow(<ModalSteps />); + const steps = wrapper.find(EuiStepsHorizontal); + const testStep = steps.prop('steps')[TEST_STEP_INDEX]; + expect(testStep.title).toBe('Test'); + expect(testStep.status).toBe('current'); + }); + it('review step is current when on step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + step: AddInferencePipelineSteps.Review, + }, + }); + const wrapper = shallow(<ModalSteps />); + const steps = wrapper.find(EuiStepsHorizontal); + const reviewStep = steps.prop('steps')[REVIEW_STEP_INDEX]; + expect(reviewStep.title).toBe('Review'); + expect(reviewStep.status).toBe('current'); + }); + it('clicking configure step updates step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + step: AddInferencePipelineSteps.Review, + }, + }); + const wrapper = shallow(<ModalSteps />); + const steps = wrapper.find(EuiStepsHorizontal); + const configStep = steps.prop('steps')[CONFIGURE_STEP_INDEX]; + configStep.onClick({} as any); + expect(setAddInferencePipelineStep).toHaveBeenCalledWith( + AddInferencePipelineSteps.Configuration + ); + }); + it('clicking test step updates step', () => { + const wrapper = shallow(<ModalSteps />); + const steps = wrapper.find(EuiStepsHorizontal); + const testStep = steps.prop('steps')[TEST_STEP_INDEX]; + testStep.onClick({} as any); + expect(setAddInferencePipelineStep).toHaveBeenCalledWith(AddInferencePipelineSteps.Test); + }); + it('clicking review step updates step', () => { + const wrapper = shallow(<ModalSteps />); + const steps = wrapper.find(EuiStepsHorizontal); + const reviewStep = steps.prop('steps')[REVIEW_STEP_INDEX]; + reviewStep.onClick({} as any); + expect(setAddInferencePipelineStep).toHaveBeenCalledWith(AddInferencePipelineSteps.Review); + }); + it('cannot click test step when data is invalid', () => { + setMockValues({ + ...DEFAULT_VALUES, + isPipelineDataValid: false, + }); + const wrapper = shallow(<ModalSteps />); + const steps = wrapper.find(EuiStepsHorizontal); + const testStep = steps.prop('steps')[TEST_STEP_INDEX]; + testStep.onClick({} as any); + expect(setAddInferencePipelineStep).not.toHaveBeenCalled(); + }); + it('cannot click review step when data is invalid', () => { + setMockValues({ + ...DEFAULT_VALUES, + isPipelineDataValid: false, + }); + const wrapper = shallow(<ModalSteps />); + const steps = wrapper.find(EuiStepsHorizontal); + const reviewStep = steps.prop('steps')[REVIEW_STEP_INDEX]; + reviewStep.onClick({} as any); + expect(setAddInferencePipelineStep).not.toHaveBeenCalled(); + }); + }); + describe('ModalFooter', () => { + const ingestionMethod = 'crawler'; + const actions = { + attachPipeline: jest.fn(), + createPipeline: jest.fn(), + setAddInferencePipelineStep: jest.fn(), + }; + beforeEach(() => { + setMockActions(actions); + }); + it('renders cancel button on config step', () => { + const wrapper = shallow(<ModalFooter ingestionMethod={ingestionMethod} onClose={onClose} />); + const cancelBtn = wrapper.find(EuiButtonEmpty); + expect(cancelBtn).toHaveLength(1); + expect(cancelBtn.prop('children')).toBe('Cancel'); + cancelBtn.prop('onClick')!({} as any); + expect(onClose).toHaveBeenCalledTimes(1); + }); + it('renders cancel button on test step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Test, + }, + }); + const wrapper = shallow(<ModalFooter ingestionMethod={ingestionMethod} onClose={onClose} />); + expect(wrapper.find(EuiButtonEmpty)).toHaveLength(2); + const cancelBtn = wrapper.find(EuiButtonEmpty).at(1); + expect(cancelBtn.prop('children')).toBe('Cancel'); + cancelBtn.prop('onClick')!({} as any); + expect(onClose).toHaveBeenCalledTimes(1); + }); + it('renders cancel button on review step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Review, + }, + }); + const wrapper = shallow(<ModalFooter ingestionMethod={ingestionMethod} onClose={onClose} />); + expect(wrapper.find(EuiButtonEmpty)).toHaveLength(2); + const cancelBtn = wrapper.find(EuiButtonEmpty).at(1); + expect(cancelBtn.prop('children')).toBe('Cancel'); + cancelBtn.prop('onClick')!({} as any); + expect(onClose).toHaveBeenCalledTimes(1); + }); + it('renders back button on test step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Test, + }, + }); + const wrapper = shallow(<ModalFooter ingestionMethod={ingestionMethod} onClose={onClose} />); + expect(wrapper.find(EuiButtonEmpty)).toHaveLength(2); + const backBtn = wrapper.find(EuiButtonEmpty).at(0); + expect(backBtn.prop('children')).toBe('Back'); + backBtn.prop('onClick')!({} as any); + expect(actions.setAddInferencePipelineStep).toHaveBeenCalledWith( + AddInferencePipelineSteps.Configuration + ); + }); + it('renders back button on review step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Review, + }, + }); + const wrapper = shallow(<ModalFooter ingestionMethod={ingestionMethod} onClose={onClose} />); + expect(wrapper.find(EuiButtonEmpty)).toHaveLength(2); + const backBtn = wrapper.find(EuiButtonEmpty).at(0); + expect(backBtn.prop('children')).toBe('Back'); + backBtn.prop('onClick')!({} as any); + expect(actions.setAddInferencePipelineStep).toHaveBeenCalledWith( + AddInferencePipelineSteps.Test + ); + }); + it('renders enabled Continue with valid data', () => { + const wrapper = shallow(<ModalFooter ingestionMethod={ingestionMethod} onClose={onClose} />); + const contBtn = wrapper.find(EuiButton); + expect(contBtn).toHaveLength(1); + expect(contBtn.prop('children')).toBe('Continue'); + expect(contBtn.prop('disabled')).toBe(false); + contBtn.prop('onClick')!({} as any); + expect(actions.setAddInferencePipelineStep).toHaveBeenCalledWith( + AddInferencePipelineSteps.Test + ); + }); + it('renders disabled Continue with invalid data', () => { + setMockValues({ ...DEFAULT_VALUES, isPipelineDataValid: false }); + const wrapper = shallow(<ModalFooter ingestionMethod={ingestionMethod} onClose={onClose} />); + expect(wrapper.find(EuiButton)).toHaveLength(1); + expect(wrapper.find(EuiButton).prop('children')).toBe('Continue'); + expect(wrapper.find(EuiButton).prop('disabled')).toBe(true); + }); + it('renders Continue button on test step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Test, + }, + }); + const wrapper = shallow(<ModalFooter ingestionMethod={ingestionMethod} onClose={onClose} />); + const contBtn = wrapper.find(EuiButton); + expect(contBtn).toHaveLength(1); + expect(contBtn.prop('children')).toBe('Continue'); + expect(contBtn.prop('disabled')).toBe(false); + contBtn.prop('onClick')!({} as any); + expect(actions.setAddInferencePipelineStep).toHaveBeenCalledWith( + AddInferencePipelineSteps.Review + ); + }); + it('renders create button on review step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Review, + configuration: { + destinationField: 'test', + existingPipeline: false, + modelID: 'test-model', + pipelineName: 'my-test-pipeline', + sourceField: 'body', + }, + }, + }); + + const wrapper = shallow(<ModalFooter ingestionMethod={ingestionMethod} onClose={onClose} />); + const actionButton = wrapper.find(EuiButton); + expect(actionButton).toHaveLength(1); + expect(actionButton.prop('children')).toBe('Create'); + expect(actionButton.prop('color')).toBe('success'); + actionButton.prop('onClick')!({} as any); + expect(actions.createPipeline).toHaveBeenCalledTimes(1); + }); + it('renders attach button on review step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Review, + configuration: { + destinationField: 'test', + existingPipeline: true, + modelID: 'test-model', + pipelineName: 'my-test-pipeline', + sourceField: 'body', + }, + }, + }); + + const wrapper = shallow(<ModalFooter ingestionMethod={ingestionMethod} onClose={onClose} />); + const actionButton = wrapper.find(EuiButton); + expect(actionButton).toHaveLength(1); + expect(actionButton.prop('children')).toBe('Attach'); + expect(actionButton.prop('color')).toBe('primary'); + actionButton.prop('onClick')!({} as any); + expect(actions.attachPipeline).toHaveBeenCalledTimes(1); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx index edbf18f8b009c..bc8d8d7962ca3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx @@ -77,7 +77,7 @@ export const AddMLInferencePipelineModal: React.FC<AddMLInferencePipelineModalPr ); }; -const AddProcessorContent: React.FC<AddMLInferencePipelineModalProps> = ({ onClose }) => { +export const AddProcessorContent: React.FC<AddMLInferencePipelineModalProps> = ({ onClose }) => { const { ingestionMethod } = useValues(IndexViewLogic); const { createErrors, @@ -85,6 +85,15 @@ const AddProcessorContent: React.FC<AddMLInferencePipelineModalProps> = ({ onClo isLoading, addInferencePipelineModal: { step }, } = useValues(MLInferenceLogic); + // Using the value of create errors to reduce unnecessary hook calls + const createErrorsHookDep = createErrors.join('|'); + useEffect(() => { + if (createErrors.length === 0) return; + const modalOverflow = document.getElementsByClassName('euiModalBody__overflow'); + if (modalOverflow.length === 0) return; + modalOverflow[0].scrollTop = 0; + }, [createErrorsHookDep]); + if (isLoading) { return ( <EuiModalBody> @@ -92,7 +101,7 @@ const AddProcessorContent: React.FC<AddMLInferencePipelineModalProps> = ({ onClo </EuiModalBody> ); } - if (supportedMLModels === undefined || supportedMLModels?.length === 0) { + if (supportedMLModels.length === 0) { return <NoModelsPanel />; } return ( @@ -125,7 +134,7 @@ const AddProcessorContent: React.FC<AddMLInferencePipelineModalProps> = ({ onClo ); }; -const ModalSteps: React.FC = () => { +export const ModalSteps: React.FC = () => { const { addInferencePipelineModal: { step }, isPipelineDataValid, @@ -183,13 +192,14 @@ const ModalSteps: React.FC = () => { return <EuiStepsHorizontal steps={navSteps} />; }; -const ModalFooter: React.FC<AddMLInferencePipelineModalProps & { ingestionMethod: string }> = ({ - ingestionMethod, - onClose, -}) => { +export const ModalFooter: React.FC< + AddMLInferencePipelineModalProps & { ingestionMethod: string } +> = ({ ingestionMethod, onClose }) => { const { addInferencePipelineModal: modal, isPipelineDataValid } = useValues(MLInferenceLogic); - const { createPipeline, setAddInferencePipelineStep } = useActions(MLInferenceLogic); + const { attachPipeline, createPipeline, setAddInferencePipelineStep } = + useActions(MLInferenceLogic); + const attachExistingPipeline = Boolean(modal.configuration.existingPipeline); let nextStep: AddInferencePipelineSteps | undefined; let previousStep: AddInferencePipelineSteps | undefined; switch (modal.step) { @@ -239,6 +249,21 @@ const ModalFooter: React.FC<AddMLInferencePipelineModalProps & { ingestionMethod > {CONTINUE_BUTTON_LABEL} </EuiButton> + ) : attachExistingPipeline ? ( + <EuiButton + color="primary" + data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-addMlInference-attach`} + disabled={!isPipelineDataValid} + fill + onClick={attachPipeline} + > + {i18n.translate( + 'xpack.enterpriseSearch.content.indices.transforms.addInferencePipelineModal.footer.attach', + { + defaultMessage: 'Attach', + } + )} + </EuiButton> ) : ( <EuiButton color="success" diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/configure_pipeline.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/configure_pipeline.tsx index 868801116a041..347b6ea53a201 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/configure_pipeline.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/configure_pipeline.tsx @@ -30,10 +30,25 @@ import { docLinks } from '../../../../../shared/doc_links'; import { IndexViewLogic } from '../../index_view_logic'; -import { MLInferenceLogic } from './ml_inference_logic'; +import { EMPTY_PIPELINE_CONFIGURATION, MLInferenceLogic } from './ml_inference_logic'; import { MlModelSelectOption } from './model_select_option'; +import { PipelineSelectOption } from './pipeline_select_option'; const MODEL_SELECT_PLACEHOLDER_VALUE = 'model_placeholder$$'; +const PIPELINE_SELECT_PLACEHOLDER_VALUE = 'pipeline_placeholder$$'; + +const CHOOSE_EXISTING_LABEL = i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipeline.chooseLabel', + { defaultMessage: 'Choose' } +); +const CHOOSE_NEW_LABEL = i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipeline.newLabel', + { defaultMessage: 'New' } +); +const CHOOSE_PIPELINE_LABEL = i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipeline.existingLabel', + { defaultMessage: 'Existing' } +); const NoSourceFieldsError: React.FC = () => ( <FormattedMessage @@ -56,14 +71,15 @@ export const ConfigurePipeline: React.FC = () => { const { addInferencePipelineModal: { configuration }, formErrors, + existingInferencePipelines, supportedMLModels, sourceFields, } = useValues(MLInferenceLogic); - const { setInferencePipelineConfiguration } = useActions(MLInferenceLogic); + const { selectExistingPipeline, setInferencePipelineConfiguration } = + useActions(MLInferenceLogic); const { ingestionMethod } = useValues(IndexViewLogic); const { destinationField, modelID, pipelineName, sourceField } = configuration; - const models = supportedMLModels ?? []; const nameError = formErrors.pipelineName !== undefined && pipelineName.length > 0; const emptySourceFields = (sourceFields?.length ?? 0) === 0; @@ -76,12 +92,30 @@ export const ConfigurePipeline: React.FC = () => { ), value: MODEL_SELECT_PLACEHOLDER_VALUE, }, - ...models.map((model) => ({ + ...supportedMLModels.map((model) => ({ dropdownDisplay: <MlModelSelectOption model={model} />, inputDisplay: model.model_id, value: model.model_id, })), ]; + const pipelineOptions: Array<EuiSuperSelectOption<string>> = [ + { + disabled: true, + inputDisplay: i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipeline.placeholder', + { defaultMessage: 'Select one' } + ), + value: PIPELINE_SELECT_PLACEHOLDER_VALUE, + }, + ...(existingInferencePipelines?.map((pipeline) => ({ + disabled: pipeline.disabled, + dropdownDisplay: <PipelineSelectOption pipeline={pipeline} />, + inputDisplay: pipeline.pipelineName, + value: pipeline.pipelineName, + })) ?? []), + ]; + + const inputsDisabled = configuration.existingPipeline !== false; return ( <> @@ -106,45 +140,107 @@ export const ConfigurePipeline: React.FC = () => { </EuiText> <EuiSpacer /> <EuiForm component="form"> - <EuiFormRow - fullWidth - label={i18n.translate( - 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.nameLabel', - { - defaultMessage: 'Name', - } - )} - helpText={ - !nameError && - i18n.translate( - 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.name.helpText', - { - defaultMessage: - 'Pipeline names are unique within a deployment and can only contain letters, numbers, underscores, and hyphens. The pipeline name will be automatically prefixed with "ml-inference-".', - } - ) - } - error={nameError && formErrors.pipelineName} - isInvalid={nameError} - > - <EuiFieldText - data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-configureInferencePipeline-uniqueName`} - fullWidth - placeholder={i18n.translate( - 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.namePlaceholder', - { - defaultMessage: 'Enter a unique name for this pipeline', - } + <EuiFlexGroup> + <EuiFlexItem grow={false}> + <EuiFormRow + label={i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.chooseExistingLabel', + { defaultMessage: 'New or existing' } + )} + > + <EuiSelect + options={[ + { + disabled: true, + text: CHOOSE_EXISTING_LABEL, + value: '', + }, + { + text: CHOOSE_NEW_LABEL, + value: 'false', + }, + { + disabled: + !existingInferencePipelines || existingInferencePipelines.length === 0, + text: CHOOSE_PIPELINE_LABEL, + value: 'true', + }, + ]} + onChange={(e) => + setInferencePipelineConfiguration({ + ...EMPTY_PIPELINE_CONFIGURATION, + existingPipeline: e.target.value === 'true', + }) + } + /> + </EuiFormRow> + </EuiFlexItem> + <EuiFlexItem> + {configuration.existingPipeline === true ? ( + <EuiFormRow + fullWidth + label={i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipelineLabel', + { + defaultMessage: 'Select an existing inference pipeline', + } + )} + > + <EuiSuperSelect + fullWidth + hasDividers + data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-configureInferencePipeline-selectExistingPipeline`} + valueOfSelected={ + pipelineName.length > 0 ? pipelineName : PIPELINE_SELECT_PLACEHOLDER_VALUE + } + options={pipelineOptions} + onChange={(value) => selectExistingPipeline(value)} + /> + </EuiFormRow> + ) : ( + <EuiFormRow + fullWidth + label={i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.nameLabel', + { + defaultMessage: 'Name', + } + )} + helpText={ + !nameError && + i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.name.helpText', + { + defaultMessage: + 'Pipeline names are unique within a deployment and can only contain letters, numbers, underscores, and hyphens. The pipeline name will be automatically prefixed with "ml-inference-".', + } + ) + } + error={nameError && formErrors.pipelineName} + isInvalid={nameError} + > + <EuiFieldText + data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-configureInferencePipeline-uniqueName`} + disabled={inputsDisabled} + fullWidth + placeholder={i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.namePlaceholder', + { + defaultMessage: 'Enter a unique name for this pipeline', + } + )} + value={pipelineName} + onChange={(e) => + setInferencePipelineConfiguration({ + ...configuration, + pipelineName: e.target.value, + }) + } + /> + </EuiFormRow> )} - value={pipelineName} - onChange={(e) => - setInferencePipelineConfiguration({ - ...configuration, - pipelineName: e.target.value, - }) - } - /> - </EuiFormRow> + </EuiFlexItem> + </EuiFlexGroup> <EuiSpacer /> <EuiFormRow label={i18n.translate( @@ -159,6 +255,7 @@ export const ConfigurePipeline: React.FC = () => { data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-configureInferencePipeline-selectTrainedModel`} fullWidth hasDividers + disabled={inputsDisabled} itemLayoutAlign="top" onChange={(value) => setInferencePipelineConfiguration({ @@ -185,6 +282,7 @@ export const ConfigurePipeline: React.FC = () => { > <EuiSelect data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-configureInferencePipeline-selectSchemaField`} + disabled={inputsDisabled} value={sourceField} options={[ { @@ -235,6 +333,7 @@ export const ConfigurePipeline: React.FC = () => { > <EuiFieldText data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-configureInferencePipeline-destionationField`} + disabled={inputsDisabled} placeholder="custom_field_name" value={destinationField} onChange={(e) => diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/ml_inference_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/ml_inference_logic.test.ts index c605009d7eb0d..4224c150af904 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/ml_inference_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/ml_inference_logic.test.ts @@ -7,20 +7,27 @@ import { LogicMounter } from '../../../../../__mocks__/kea_logic'; -import { HttpError, Status } from '../../../../../../../common/types/api'; +import { HttpResponse } from '@kbn/core/public'; + +import { ErrorResponse, HttpError, Status } from '../../../../../../../common/types/api'; +import { TrainedModelState } from '../../../../../../../common/types/pipelines'; import { MappingsApiLogic } from '../../../../api/mappings/mappings_logic'; -import { CreateMlInferencePipelineApiLogic } from '../../../../api/ml_models/create_ml_inference_pipeline'; import { MLModelsApiLogic } from '../../../../api/ml_models/ml_models_logic'; +import { AttachMlInferencePipelineApiLogic } from '../../../../api/pipelines/attach_ml_inference_pipeline'; +import { CreateMlInferencePipelineApiLogic } from '../../../../api/pipelines/create_ml_inference_pipeline'; +import { FetchMlInferencePipelineProcessorsApiLogic } from '../../../../api/pipelines/fetch_ml_inference_pipeline_processors'; +import { FetchMlInferencePipelinesApiLogic } from '../../../../api/pipelines/fetch_ml_inference_pipelines'; import { SimulateMlInterfacePipelineApiLogic } from '../../../../api/pipelines/simulate_ml_inference_pipeline_processors'; import { MLInferenceLogic, EMPTY_PIPELINE_CONFIGURATION, AddInferencePipelineSteps, + MLInferenceProcessorsValues, } from './ml_inference_logic'; -const DEFAULT_VALUES = { +const DEFAULT_VALUES: MLInferenceProcessorsValues = { addInferencePipelineModal: { configuration: { ...EMPTY_PIPELINE_CONFIGURATION, @@ -46,6 +53,7 @@ const DEFAULT_VALUES = { step: AddInferencePipelineSteps.Configuration, }, createErrors: [], + existingInferencePipelines: [], formErrors: { modelID: 'Field is required.', pipelineName: 'Field is required.', @@ -57,6 +65,8 @@ const DEFAULT_VALUES = { mappingData: undefined, mappingStatus: 0, mlInferencePipeline: undefined, + mlInferencePipelineProcessors: undefined, + mlInferencePipelinesData: undefined, mlModelsData: undefined, mlModelsStatus: 0, simulatePipelineData: undefined, @@ -64,7 +74,7 @@ const DEFAULT_VALUES = { simulatePipelineResult: undefined, simulatePipelineStatus: 0, sourceFields: undefined, - supportedMLModels: undefined, + supportedMLModels: [], }; describe('MlInferenceLogic', () => { @@ -77,13 +87,25 @@ describe('MlInferenceLogic', () => { const { mount: mountCreateMlInferencePipelineApiLogic } = new LogicMounter( CreateMlInferencePipelineApiLogic ); + const { mount: mountAttachMlInferencePipelineApiLogic } = new LogicMounter( + AttachMlInferencePipelineApiLogic + ); + const { mount: mountFetchMlInferencePipelineProcessorsApiLogic } = new LogicMounter( + FetchMlInferencePipelineProcessorsApiLogic + ); + const { mount: mountFetchMlInferencePipelinesApiLogic } = new LogicMounter( + FetchMlInferencePipelinesApiLogic + ); beforeEach(() => { jest.clearAllMocks(); mountMappingApiLogic(); mountMLModelsApiLogic(); + mountFetchMlInferencePipelineProcessorsApiLogic(); + mountFetchMlInferencePipelinesApiLogic(); mountSimulateMlInterfacePipelineApiLogic(); mountCreateMlInferencePipelineApiLogic(); + mountAttachMlInferencePipelineApiLogic(); mount(); }); @@ -110,6 +132,70 @@ describe('MlInferenceLogic', () => { }); }); }); + describe('attachApiError', () => { + it('updates create errors', () => { + MLInferenceLogic.actions.attachApiError({ + body: { + error: '', + message: 'this is an error', + statusCode: 500, + }, + } as HttpResponse<ErrorResponse>); + + expect(MLInferenceLogic.values.createErrors).toEqual(['this is an error']); + }); + }); + describe('createApiError', () => { + it('updates create errors', () => { + MLInferenceLogic.actions.createApiError({ + body: { + error: '', + message: 'this is an error', + statusCode: 500, + }, + } as HttpResponse<ErrorResponse>); + + expect(MLInferenceLogic.values.createErrors).toEqual(['this is an error']); + }); + }); + describe('makeAttachPipelineRequest', () => { + it('clears existing errors', () => { + MLInferenceLogic.actions.attachApiError({ + body: { + error: '', + message: 'this is an error', + statusCode: 500, + }, + } as HttpResponse<ErrorResponse>); + + expect(MLInferenceLogic.values.createErrors).not.toHaveLength(0); + MLInferenceLogic.actions.makeAttachPipelineRequest({ + indexName: 'test', + pipelineName: 'unit-test', + }); + expect(MLInferenceLogic.values.createErrors).toHaveLength(0); + }); + }); + describe('makeCreatePipelineRequest', () => { + it('clears existing errors', () => { + MLInferenceLogic.actions.createApiError({ + body: { + error: '', + message: 'this is an error', + statusCode: 500, + }, + } as HttpResponse<ErrorResponse>); + + expect(MLInferenceLogic.values.createErrors).not.toHaveLength(0); + MLInferenceLogic.actions.makeCreatePipelineRequest({ + indexName: 'test', + pipelineName: 'unit-test', + modelId: 'test-model', + sourceField: 'body', + }); + expect(MLInferenceLogic.values.createErrors).toHaveLength(0); + }); + }); }); describe('selectors', () => { @@ -162,6 +248,220 @@ describe('MlInferenceLogic', () => { expect(MLInferenceLogic.values.simulatePipelineResult).toEqual(simulateResponse); }); }); + describe('existingInferencePipelines', () => { + beforeEach(() => { + MappingsApiLogic.actions.apiSuccess({ + mappings: { + properties: { + body: { + type: 'text', + }, + }, + }, + }); + }); + it('returns empty list when there is not existing pipelines available', () => { + expect(MLInferenceLogic.values.existingInferencePipelines).toEqual([]); + }); + it('returns existing pipeline option', () => { + FetchMlInferencePipelinesApiLogic.actions.apiSuccess({ + 'unit-test': { + processors: [ + { + inference: { + field_map: { + body: 'text_field', + }, + model_id: 'test-model', + target_field: 'ml.inference.test-field', + }, + }, + ], + version: 1, + }, + }); + + expect(MLInferenceLogic.values.existingInferencePipelines).toEqual([ + { + destinationField: 'test-field', + disabled: false, + pipelineName: 'unit-test', + modelType: '', + modelId: 'test-model', + sourceField: 'body', + }, + ]); + }); + it('returns disabled pipeline option if missing source field', () => { + FetchMlInferencePipelinesApiLogic.actions.apiSuccess({ + 'unit-test': { + processors: [ + { + inference: { + field_map: { + body_content: 'text_field', + }, + model_id: 'test-model', + target_field: 'ml.inference.test-field', + }, + }, + ], + version: 1, + }, + }); + + expect(MLInferenceLogic.values.existingInferencePipelines).toEqual([ + { + destinationField: 'test-field', + disabled: true, + disabledReason: expect.any(String), + pipelineName: 'unit-test', + modelType: '', + modelId: 'test-model', + sourceField: 'body_content', + }, + ]); + }); + it('returns disabled pipeline option if model is redacted', () => { + FetchMlInferencePipelinesApiLogic.actions.apiSuccess({ + 'unit-test': { + processors: [ + { + inference: { + field_map: { + body: 'text_field', + }, + model_id: '', + target_field: 'ml.inference.test-field', + }, + }, + ], + version: 1, + }, + }); + + expect(MLInferenceLogic.values.existingInferencePipelines).toEqual([ + { + destinationField: 'test-field', + disabled: true, + disabledReason: expect.any(String), + pipelineName: 'unit-test', + modelType: '', + modelId: '', + sourceField: 'body', + }, + ]); + }); + it('returns disabled pipeline option if pipeline already attached', () => { + FetchMlInferencePipelineProcessorsApiLogic.actions.apiSuccess([ + { + modelId: 'test-model', + modelState: TrainedModelState.Started, + pipelineName: 'unit-test', + pipelineReferences: ['test@ml-inference'], + types: ['ner', 'pytorch'], + }, + ]); + FetchMlInferencePipelinesApiLogic.actions.apiSuccess({ + 'unit-test': { + processors: [ + { + inference: { + field_map: { + body: 'text_field', + }, + model_id: 'test-model', + target_field: 'ml.inference.test-field', + }, + }, + ], + version: 1, + }, + }); + + expect(MLInferenceLogic.values.existingInferencePipelines).toEqual([ + { + destinationField: 'test-field', + disabled: true, + disabledReason: expect.any(String), + pipelineName: 'unit-test', + modelType: '', + modelId: 'test-model', + sourceField: 'body', + }, + ]); + }); + }); + describe('mlInferencePipeline', () => { + it('returns undefined when configuration is invalid', () => { + MLInferenceLogic.actions.setInferencePipelineConfiguration({ + destinationField: '', + modelID: '', + pipelineName: 'unit-test', + sourceField: '', + }); + + expect(MLInferenceLogic.values.mlInferencePipeline).toBeUndefined(); + }); + it('generates inference pipeline', () => { + MLModelsApiLogic.actions.apiSuccess([ + { + inference_config: { + text_classification: { + classification_labels: ['one', 'two'], + tokenization: { + bert: {}, + }, + }, + }, + input: { + field_names: ['text_field'], + }, + model_id: 'test-model', + model_type: 'pytorch', + tags: [], + version: '1.0.0', + }, + ]); + MLInferenceLogic.actions.setInferencePipelineConfiguration({ + destinationField: '', + modelID: 'test-model', + pipelineName: 'unit-test', + sourceField: 'body', + }); + + expect(MLInferenceLogic.values.mlInferencePipeline).not.toBeUndefined(); + }); + it('returns undefined when existing pipeline not yet selected', () => { + MLInferenceLogic.actions.setInferencePipelineConfiguration({ + existingPipeline: true, + destinationField: '', + modelID: '', + pipelineName: '', + sourceField: '', + }); + expect(MLInferenceLogic.values.mlInferencePipeline).toBeUndefined(); + }); + it('return existing pipeline when selected', () => { + const existingPipeline = { + description: 'this is a test', + processors: [], + version: 1, + }; + FetchMlInferencePipelinesApiLogic.actions.apiSuccess({ + 'unit-test': existingPipeline, + }); + MLInferenceLogic.actions.setInferencePipelineConfiguration({ + existingPipeline: true, + destinationField: '', + modelID: '', + pipelineName: 'unit-test', + sourceField: '', + }); + expect(MLInferenceLogic.values.mlInferencePipeline).not.toBeUndefined(); + expect(MLInferenceLogic.values.mlInferencePipeline).toEqual(existingPipeline); + }); + }); }); describe('listeners', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/ml_inference_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/ml_inference_logic.ts index f4a968da1c2a1..fcdad4f66d141 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/ml_inference_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/ml_inference_logic.ts @@ -15,6 +15,8 @@ import { TrainedModelConfigResponse } from '@kbn/ml-plugin/common/types/trained_ import { formatPipelineName, generateMlInferencePipelineBody, + getMlModelTypesForModelConfig, + parseMlInferenceParametersFromPipeline, } from '../../../../../../../common/ml_inference_pipeline'; import { Status } from '../../../../../../../common/types/api'; import { MlInferencePipeline } from '../../../../../../../common/types/pipelines'; @@ -30,16 +32,30 @@ import { GetMappingsResponse, MappingsApiLogic, } from '../../../../api/mappings/mappings_logic'; -import { - CreateMlInferencePipelineApiLogic, - CreateMlInferencePipelineApiLogicArgs, - CreateMlInferencePipelineResponse, -} from '../../../../api/ml_models/create_ml_inference_pipeline'; import { GetMlModelsArgs, GetMlModelsResponse, MLModelsApiLogic, } from '../../../../api/ml_models/ml_models_logic'; +import { + AttachMlInferencePipelineApiLogic, + AttachMlInferencePipelineApiLogicArgs, + AttachMlInferencePipelineResponse, +} from '../../../../api/pipelines/attach_ml_inference_pipeline'; +import { + CreateMlInferencePipelineApiLogic, + CreateMlInferencePipelineApiLogicArgs, + CreateMlInferencePipelineResponse, +} from '../../../../api/pipelines/create_ml_inference_pipeline'; +import { + FetchMlInferencePipelineProcessorsApiLogic, + FetchMlInferencePipelineProcessorsResponse, +} from '../../../../api/pipelines/fetch_ml_inference_pipeline_processors'; +import { + FetchMlInferencePipelinesApiLogic, + FetchMlInferencePipelinesArgs, + FetchMlInferencePipelinesResponse, +} from '../../../../api/pipelines/fetch_ml_inference_pipelines'; import { SimulateMlInterfacePipelineApiLogic, SimulateMlInterfacePipelineArgs, @@ -47,11 +63,20 @@ import { } from '../../../../api/pipelines/simulate_ml_inference_pipeline_processors'; import { isConnectorIndex } from '../../../../utils/indices'; -import { isSupportedMLModel, sortSourceFields } from '../../../shared/ml_inference/utils'; +import { + getMLType, + isSupportedMLModel, + sortSourceFields, +} from '../../../shared/ml_inference/utils'; import { AddInferencePipelineFormErrors, InferencePipelineConfiguration } from './types'; -import { validateInferencePipelineConfiguration } from './utils'; +import { + validateInferencePipelineConfiguration, + EXISTING_PIPELINE_DISABLED_MODEL_REDACTED, + EXISTING_PIPELINE_DISABLED_MISSING_SOURCE_FIELD, + EXISTING_PIPELINE_DISABLED_PIPELINE_EXISTS, +} from './utils'; export const EMPTY_PIPELINE_CONFIGURATION: InferencePipelineConfiguration = { destinationField: '', @@ -69,7 +94,26 @@ export enum AddInferencePipelineSteps { const API_REQUEST_COMPLETE_STATUSES = [Status.SUCCESS, Status.ERROR]; const DEFAULT_CONNECTOR_FIELDS = ['body', 'title', 'id', 'type', 'url']; +export interface MLInferencePipelineOption { + destinationField: string; + disabled: boolean; + disabledReason?: string; + modelId: string; + modelType: string; + pipelineName: string; + sourceField: string; +} + interface MLInferenceProcessorsActions { + attachApiError: Actions< + AttachMlInferencePipelineApiLogicArgs, + AttachMlInferencePipelineResponse + >['apiError']; + attachApiSuccess: Actions< + AttachMlInferencePipelineApiLogicArgs, + AttachMlInferencePipelineResponse + >['apiSuccess']; + attachPipeline: () => void; createApiError: Actions< CreateMlInferencePipelineApiLogicArgs, CreateMlInferencePipelineResponse @@ -79,18 +123,29 @@ interface MLInferenceProcessorsActions { CreateMlInferencePipelineResponse >['apiSuccess']; createPipeline: () => void; + makeAttachPipelineRequest: Actions< + AttachMlInferencePipelineApiLogicArgs, + AttachMlInferencePipelineResponse + >['makeRequest']; makeCreatePipelineRequest: Actions< CreateMlInferencePipelineApiLogicArgs, CreateMlInferencePipelineResponse >['makeRequest']; makeMLModelsRequest: Actions<GetMlModelsArgs, GetMlModelsResponse>['makeRequest']; makeMappingRequest: Actions<GetMappingsArgs, GetMappingsResponse>['makeRequest']; + makeMlInferencePipelinesRequest: Actions< + FetchMlInferencePipelinesArgs, + FetchMlInferencePipelinesResponse + >['makeRequest']; makeSimulatePipelineRequest: Actions< SimulateMlInterfacePipelineArgs, SimulateMlInterfacePipelineResponse >['makeRequest']; mappingsApiError: Actions<GetMappingsArgs, GetMappingsResponse>['apiError']; mlModelsApiError: Actions<GetMlModelsArgs, GetMlModelsResponse>['apiError']; + selectExistingPipeline: (pipelineName: string) => { + pipelineName: string; + }; setAddInferencePipelineStep: (step: AddInferencePipelineSteps) => { step: AddInferencePipelineSteps; }; @@ -120,21 +175,24 @@ export interface AddInferencePipelineModal { step: AddInferencePipelineSteps; } -interface MLInferenceProcessorsValues { +export interface MLInferenceProcessorsValues { addInferencePipelineModal: AddInferencePipelineModal; createErrors: string[]; + existingInferencePipelines: MLInferencePipelineOption[]; formErrors: AddInferencePipelineFormErrors; - index: FetchIndexApiResponse; + index: FetchIndexApiResponse | undefined; isLoading: boolean; isPipelineDataValid: boolean; mappingData: typeof MappingsApiLogic.values.data; mappingStatus: Status; - mlInferencePipeline?: MlInferencePipeline; - mlModelsData: TrainedModelConfigResponse[]; + mlInferencePipeline: MlInferencePipeline | undefined; + mlInferencePipelineProcessors: FetchMlInferencePipelineProcessorsResponse | undefined; + mlInferencePipelinesData: FetchMlInferencePipelinesResponse | undefined; + mlModelsData: TrainedModelConfigResponse[] | undefined; mlModelsStatus: Status; simulatePipelineData: typeof SimulateMlInterfacePipelineApiLogic.values.data; simulatePipelineErrors: string[]; - simulatePipelineResult: IngestSimulateResponse; + simulatePipelineResult: IngestSimulateResponse | undefined; simulatePipelineStatus: Status; sourceFields: string[] | undefined; supportedMLModels: TrainedModelConfigResponse[]; @@ -144,8 +202,10 @@ export const MLInferenceLogic = kea< MakeLogicType<MLInferenceProcessorsValues, MLInferenceProcessorsActions> >({ actions: { + attachPipeline: true, clearFormErrors: true, createPipeline: true, + selectExistingPipeline: (pipelineName: string) => ({ pipelineName }), setAddInferencePipelineStep: (step: AddInferencePipelineSteps) => ({ step }), setFormErrors: (inputErrors: AddInferencePipelineFormErrors) => ({ inputErrors }), setIndexName: (indexName: string) => ({ indexName }), @@ -160,6 +220,8 @@ export const MLInferenceLogic = kea< }, connect: { actions: [ + FetchMlInferencePipelinesApiLogic, + ['makeRequest as makeMlInferencePipelinesRequest'], MappingsApiLogic, ['makeRequest as makeMappingRequest', 'apiError as mappingsApiError'], MLModelsApiLogic, @@ -176,20 +238,43 @@ export const MLInferenceLogic = kea< 'apiSuccess as createApiSuccess', 'makeRequest as makeCreatePipelineRequest', ], + AttachMlInferencePipelineApiLogic, + [ + 'apiError as attachApiError', + 'apiSuccess as attachApiSuccess', + 'makeRequest as makeAttachPipelineRequest', + ], ], values: [ FetchIndexApiLogic, ['data as index'], + FetchMlInferencePipelinesApiLogic, + ['data as mlInferencePipelinesData'], MappingsApiLogic, ['data as mappingData', 'status as mappingStatus'], MLModelsApiLogic, ['data as mlModelsData', 'status as mlModelsStatus'], SimulateMlInterfacePipelineApiLogic, ['data as simulatePipelineData', 'status as simulatePipelineStatus'], + FetchMlInferencePipelineProcessorsApiLogic, + ['data as mlInferencePipelineProcessors'], ], }, events: {}, listeners: ({ values, actions }) => ({ + attachPipeline: () => { + const { + addInferencePipelineModal: { + configuration: { pipelineName }, + indexName, + }, + } = values; + + actions.makeAttachPipelineRequest({ + indexName, + pipelineName, + }); + }, createPipeline: () => { const { addInferencePipelineModal: { configuration, indexName }, @@ -206,7 +291,21 @@ export const MLInferenceLogic = kea< sourceField: configuration.sourceField, }); }, + selectExistingPipeline: ({ pipelineName }) => { + const pipeline = values.mlInferencePipelinesData?.[pipelineName]; + if (!pipeline) return; + const params = parseMlInferenceParametersFromPipeline(pipelineName, pipeline); + if (params === null) return; + actions.setInferencePipelineConfiguration({ + destinationField: params.destination_field ?? '', + existingPipeline: true, + modelID: params.model_id, + pipelineName, + sourceField: params.source_field, + }); + }, setIndexName: ({ indexName }) => { + actions.makeMlInferencePipelinesRequest(undefined); actions.makeMLModelsRequest(undefined); actions.makeMappingRequest({ indexName }); }, @@ -264,7 +363,9 @@ export const MLInferenceLogic = kea< createErrors: [ [], { + attachApiError: (_, error) => getErrorsFromHttpResponse(error), createApiError: (_, error) => getErrorsFromHttpResponse(error), + makeAttachPipelineRequest: () => [], makeCreatePipelineRequest: () => [], }, ], @@ -297,12 +398,24 @@ export const MLInferenceLogic = kea< selectors.isPipelineDataValid, selectors.addInferencePipelineModal, selectors.mlModelsData, + selectors.mlInferencePipelinesData, ], ( - isPipelineDataValid: boolean, - { configuration }: AddInferencePipelineModal, - models: MLInferenceProcessorsValues['mlModelsData'] + isPipelineDataValid: MLInferenceProcessorsValues['isPipelineDataValid'], + { configuration }: MLInferenceProcessorsValues['addInferencePipelineModal'], + models: MLInferenceProcessorsValues['mlModelsData'], + mlInferencePipelinesData: MLInferenceProcessorsValues['mlInferencePipelinesData'] ) => { + if (configuration.existingPipeline) { + if (configuration.pipelineName.length === 0) { + return undefined; + } + const pipeline = mlInferencePipelinesData?.[configuration.pipelineName]; + if (!pipeline) { + return undefined; + } + return pipeline as MlInferencePipeline; + } if (!isPipelineDataValid) return undefined; const model = models?.find((mlModel) => mlModel.model_id === configuration.modelID); if (!model) return undefined; @@ -350,7 +463,69 @@ export const MLInferenceLogic = kea< supportedMLModels: [ () => [selectors.mlModelsData], (mlModelsData: TrainedModelConfigResponse[] | undefined) => { - return mlModelsData?.filter(isSupportedMLModel); + return mlModelsData?.filter(isSupportedMLModel) ?? []; + }, + ], + existingInferencePipelines: [ + () => [ + selectors.mlInferencePipelinesData, + selectors.sourceFields, + selectors.supportedMLModels, + selectors.mlInferencePipelineProcessors, + ], + ( + mlInferencePipelinesData: MLInferenceProcessorsValues['mlInferencePipelinesData'], + sourceFields: MLInferenceProcessorsValues['sourceFields'], + supportedMLModels: MLInferenceProcessorsValues['supportedMLModels'], + mlInferencePipelineProcessors: MLInferenceProcessorsValues['mlInferencePipelineProcessors'] + ) => { + if (!mlInferencePipelinesData) { + return []; + } + const indexProcessorNames = + mlInferencePipelineProcessors?.map((processor) => processor.pipelineName) ?? []; + + const existingPipelines: MLInferencePipelineOption[] = Object.entries( + mlInferencePipelinesData + ) + .map(([pipelineName, pipeline]): MLInferencePipelineOption | undefined => { + if (!pipeline) return undefined; + const pipelineParams = parseMlInferenceParametersFromPipeline(pipelineName, pipeline); + if (!pipelineParams) return undefined; + const { + destination_field: destinationField, + model_id: modelId, + source_field: sourceField, + } = pipelineParams; + + let disabled: boolean = false; + let disabledReason: string | undefined; + if (!(sourceFields?.includes(sourceField) ?? false)) { + disabled = true; + disabledReason = EXISTING_PIPELINE_DISABLED_MISSING_SOURCE_FIELD; + } else if (indexProcessorNames.includes(pipelineName)) { + disabled = true; + disabledReason = EXISTING_PIPELINE_DISABLED_PIPELINE_EXISTS; + } else if (pipelineParams.model_id.length === 0) { + disabled = true; + disabledReason = EXISTING_PIPELINE_DISABLED_MODEL_REDACTED; + } + const mlModel = supportedMLModels.find((model) => model.model_id === modelId); + const modelType = mlModel ? getMLType(getMlModelTypesForModelConfig(mlModel)) : ''; + + return { + destinationField: destinationField ?? '', + disabled, + disabledReason, + modelId, + modelType, + pipelineName, + sourceField, + }; + }) + .filter((p): p is MLInferencePipelineOption => p !== undefined); + + return existingPipelines; }, ], }), diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/pipeline_select_option.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/pipeline_select_option.tsx new file mode 100644 index 0000000000000..f782c827a9728 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/pipeline_select_option.tsx @@ -0,0 +1,96 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiTextColor, EuiTitle } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +import { MLInferencePipelineOption } from './ml_inference_logic'; +import { EXISTING_PIPELINE_DISABLED_MISSING_SOURCE_FIELD } from './utils'; + +export interface PipelineSelectOptionProps { + pipeline: MLInferencePipelineOption; +} + +const REDACTED_MODE_ID_DISPLAY = i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipeline.redactedModel', + { + defaultMessage: 'Trained model not available in this space', + } +); + +export const PipelineSelectOption: React.FC<PipelineSelectOptionProps> = ({ pipeline }) => { + const modelIdDisplay = pipeline.modelId.length > 0 ? pipeline.modelId : REDACTED_MODE_ID_DISPLAY; + return ( + <EuiFlexGroup direction="column" gutterSize="xs"> + {pipeline.disabled && ( + <EuiFlexItem> + <EuiFlexGroup> + <EuiFlexItem grow={false}> + <EuiIcon type="alert" color="warning" /> + </EuiFlexItem> + <EuiFlexItem> + <EuiTextColor color="default"> + {pipeline.disabledReason ?? EXISTING_PIPELINE_DISABLED_MISSING_SOURCE_FIELD} + </EuiTextColor> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + )} + <EuiFlexItem> + <EuiTitle size="xs"> + <h4>{pipeline.pipelineName}</h4> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem> + <EuiFlexGroup gutterSize="s" alignItems="center" justifyContent="flexEnd"> + <EuiFlexItem> + {pipeline.disabled ? ( + modelIdDisplay + ) : ( + <EuiTextColor color="subdued">{modelIdDisplay}</EuiTextColor> + )} + </EuiFlexItem> + {pipeline.modelType.length > 0 && ( + <EuiFlexItem grow={false}> + <span> + <EuiBadge color="hollow">{pipeline.modelType}</EuiBadge> + </span> + </EuiFlexItem> + )} + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem> + <EuiFlexGroup> + <EuiFlexItem> + <strong> + {i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipeline.sourceField', + { defaultMessage: 'Source field' } + )} + </strong> + </EuiFlexItem> + <EuiFlexItem>{pipeline.sourceField}</EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem> + <EuiFlexGroup> + <EuiFlexItem> + <strong> + {i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipeline.destinationField', + { defaultMessage: 'Destination field' } + )} + </strong> + </EuiFlexItem> + <EuiFlexItem>{pipeline.destinationField}</EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/types.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/types.ts index 29ad5e9193fdb..9ad288c4b84f5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/types.ts @@ -7,6 +7,7 @@ export interface InferencePipelineConfiguration { destinationField: string; + existingPipeline?: boolean; modelID: string; pipelineName: string; sourceField: string; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/utils.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/utils.ts index 8db23f5deb7d6..8ad94e5f92da4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/utils.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/utils.ts @@ -31,6 +31,12 @@ export const validateInferencePipelineConfiguration = ( config: InferencePipelineConfiguration ): AddInferencePipelineFormErrors => { const errors: AddInferencePipelineFormErrors = {}; + if (config.existingPipeline === true) { + if (config.pipelineName.length === 0) { + errors.pipelineName = FIELD_REQUIRED_ERROR; + } + return errors; + } if (config.pipelineName.trim().length === 0) { errors.pipelineName = FIELD_REQUIRED_ERROR; } else if (!isValidPipelineName(config.pipelineName)) { @@ -45,3 +51,27 @@ export const validateInferencePipelineConfiguration = ( return errors; }; + +export const EXISTING_PIPELINE_DISABLED_MISSING_SOURCE_FIELD = i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipeline.disabledSourceFieldDescription', + { + defaultMessage: + 'This pipeline cannot be selected because the source field does not exist on this index.', + } +); + +export const EXISTING_PIPELINE_DISABLED_PIPELINE_EXISTS = i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipeline.disabledPipelineExistsDescription', + { + defaultMessage: 'This pipeline cannot be selected because it is already attached.', + } +); + +// TODO: removed when we support attaching pipelines with unavailable models +export const EXISTING_PIPELINE_DISABLED_MODEL_REDACTED = i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.addInferencePipelineModal.steps.configure.existingPipeline.disabledModelRedactedDescription', + { + defaultMessage: + 'This pipeline cannot be selected because it uses a trained model not available in this Kibana space.', + } +); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts new file mode 100644 index 0000000000000..2359cf6e67390 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.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 { LogicMounter } from '../../../../__mocks__/kea_logic'; + +import { nextTick } from '@kbn/test-jest-helpers'; + +import { FetchCustomPipelineApiLogic } from '../../../api/index/fetch_custom_pipeline_api_logic'; + +import { + IndexPipelinesConfigurationsLogic, + IndexPipelinesConfigurationsValues, +} from './pipelines_json_configurations_logic'; + +const indexName = 'unit-test-index'; +const DEFAULT_VALUES: IndexPipelinesConfigurationsValues = { + indexName, + indexPipelinesData: undefined, + pipelineNames: [], + pipelines: {}, + selectedPipeline: undefined, + selectedPipelineId: '', + selectedPipelineJSON: '', +}; + +describe('IndexPipelinesConfigurationsLogic', () => { + const { mount } = new LogicMounter(IndexPipelinesConfigurationsLogic); + const { mount: mountFetchCustomPipelineApiLogic } = new LogicMounter(FetchCustomPipelineApiLogic); + + beforeEach(async () => { + jest.clearAllMocks(); + const indexNameProps = { indexName }; + mountFetchCustomPipelineApiLogic(); + mount(undefined, indexNameProps); + }); + + it('has expected default values', () => { + expect(IndexPipelinesConfigurationsLogic.values).toEqual(DEFAULT_VALUES); + }); + + describe('actions', () => { + it('selectPipeline updates selectedPipelineId', () => { + IndexPipelinesConfigurationsLogic.actions.selectPipeline('unit-test'); + + expect(IndexPipelinesConfigurationsLogic.values.selectedPipelineId).toEqual('unit-test'); + }); + it('fetchIndexPipelinesDataSuccess selects index ingest pipeline if found', async () => { + const pipelines = { + 'ent-search-generic-ingest': { + version: 1, + }, + [indexName]: { + processors: [], + version: 1, + }, + }; + FetchCustomPipelineApiLogic.actions.apiSuccess(pipelines); + await nextTick(); + + expect(IndexPipelinesConfigurationsLogic.values.selectedPipelineId).toEqual(indexName); + }); + it('fetchIndexPipelinesDataSuccess selects first pipeline as default pipeline', async () => { + const pipelines = { + 'ent-search-generic-ingest': { + version: 1, + }, + }; + FetchCustomPipelineApiLogic.actions.apiSuccess(pipelines); + await nextTick(); + + expect(IndexPipelinesConfigurationsLogic.values.selectedPipelineId).toEqual( + 'ent-search-generic-ingest' + ); + }); + }); + + describe('selectors', () => { + it('pipelineNames returns names of pipelines', async () => { + const pipelines = { + 'ent-search-generic-ingest': { + version: 1, + }, + [indexName]: { + processors: [], + version: 1, + }, + }; + FetchCustomPipelineApiLogic.actions.apiSuccess(pipelines); + await nextTick(); + + expect(IndexPipelinesConfigurationsLogic.values.pipelineNames).toEqual([ + 'ent-search-generic-ingest', + indexName, + ]); + }); + it('selectedPipeline returns full pipeline', async () => { + const pipelines = { + 'ent-search-generic-ingest': { + version: 1, + }, + foo: { + version: 2, + }, + bar: { + version: 3, + }, + }; + FetchCustomPipelineApiLogic.actions.apiSuccess(pipelines); + IndexPipelinesConfigurationsLogic.actions.selectPipeline('foo'); + await nextTick(); + + expect(IndexPipelinesConfigurationsLogic.values.selectedPipeline).toEqual(pipelines.foo); + expect(IndexPipelinesConfigurationsLogic.values.selectedPipelineJSON.length).toBeGreaterThan( + 0 + ); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.ts index 4bdf541cc7c73..d450dff591f6c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.ts @@ -25,9 +25,9 @@ interface IndexPipelinesConfigurationsActions { selectPipeline: (pipeline: string) => { pipeline: string }; } -interface IndexPipelinesConfigurationsValues { +export interface IndexPipelinesConfigurationsValues { indexName: string; - indexPipelinesData: FetchCustomPipelineApiLogicResponse; + indexPipelinesData: FetchCustomPipelineApiLogicResponse | undefined; pipelineNames: string[]; pipelines: Record<string, IngestPipeline>; selectedPipeline: IngestPipeline | undefined; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts index 0ac8b0949690b..584ffb5823d44 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts @@ -4,14 +4,18 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ + import { LogicMounter, mockFlashMessageHelpers } from '../../../../__mocks__/kea_logic'; import { apiIndex, connectorIndex } from '../../../__mocks__/view_index.mock'; import type { IngestPipeline } from '@elastic/elasticsearch/lib/api/types'; +import { nextTick } from '@kbn/test-jest-helpers'; + import { UpdatePipelineApiLogic } from '../../../api/connector/update_pipeline_api_logic'; import { FetchCustomPipelineApiLogic } from '../../../api/index/fetch_custom_pipeline_api_logic'; import { FetchIndexApiLogic } from '../../../api/index/fetch_index_api_logic'; +import { DetachMlInferencePipelineApiLogic } from '../../../api/pipelines/detach_ml_inference_pipeline'; import { PipelinesLogic } from './pipelines_logic'; @@ -43,6 +47,9 @@ describe('PipelinesLogic', () => { const { mount: mountFetchIndexApiLogic } = new LogicMounter(FetchIndexApiLogic); const { mount: mountUpdatePipelineLogic } = new LogicMounter(UpdatePipelineApiLogic); const { mount: mountFetchCustomPipelineApiLogic } = new LogicMounter(FetchCustomPipelineApiLogic); + const { mount: mountDetachMlInferencePipelineApiLogic } = new LogicMounter( + DetachMlInferencePipelineApiLogic + ); const { clearFlashMessages, flashAPIErrors, flashSuccessToast } = mockFlashMessageHelpers; const newPipeline = { @@ -53,6 +60,7 @@ describe('PipelinesLogic', () => { beforeEach(() => { jest.clearAllMocks(); + mountDetachMlInferencePipelineApiLogic(); mountFetchIndexApiLogic(); mountFetchCustomPipelineApiLogic(); mountUpdatePipelineLogic(); @@ -235,5 +243,29 @@ describe('PipelinesLogic', () => { }); }); }); + describe('detachMlPipelineSuccess', () => { + it('re-fetches pipeline data', async () => { + jest.spyOn(PipelinesLogic.actions, 'fetchMlInferenceProcessors'); + jest.spyOn(PipelinesLogic.actions, 'fetchCustomPipeline'); + FetchIndexApiLogic.actions.apiSuccess(connectorIndex); + DetachMlInferencePipelineApiLogic.actions.apiSuccess({ + updated: 'mock-pipeline-name', + }); + await nextTick(); + expect(PipelinesLogic.actions.fetchMlInferenceProcessors).toHaveBeenCalledWith({ + indexName: connectorIndex.name, + }); + expect(PipelinesLogic.actions.fetchCustomPipeline).toHaveBeenCalledWith({ + indexName: connectorIndex.name, + }); + }); + }); + describe('detachMlPipelineError', () => { + it('calls flashAPIErrors', () => { + DetachMlInferencePipelineApiLogic.actions.apiError('error' as any); + expect(flashAPIErrors).toHaveBeenCalledTimes(1); + expect(flashAPIErrors).toHaveBeenCalledWith('error'); + }); + }); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.ts index dca18863cde02..3d003e63c93c2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.ts @@ -47,12 +47,27 @@ import { FetchIndexApiParams, FetchIndexApiResponse, } from '../../../api/index/fetch_index_api_logic'; -import { CreateMlInferencePipelineApiLogic } from '../../../api/ml_models/create_ml_inference_pipeline'; +import { + AttachMlInferencePipelineApiLogic, + AttachMlInferencePipelineApiLogicArgs, + AttachMlInferencePipelineResponse, +} from '../../../api/pipelines/attach_ml_inference_pipeline'; +import { + CreateMlInferencePipelineApiLogic, + CreateMlInferencePipelineApiLogicArgs, + CreateMlInferencePipelineResponse, +} from '../../../api/pipelines/create_ml_inference_pipeline'; import { DeleteMlInferencePipelineApiLogic, DeleteMlInferencePipelineApiLogicArgs, DeleteMlInferencePipelineResponse, -} from '../../../api/ml_models/delete_ml_inference_pipeline'; +} from '../../../api/pipelines/delete_ml_inference_pipeline'; +import { + DetachMlInferencePipelineApiLogic, + DetachMlInferencePipelineApiLogicArgs, + DetachMlInferencePipelineResponse, +} from '../../../api/pipelines/detach_ml_inference_pipeline'; + import { FetchMlInferencePipelineProcessorsApiLogic } from '../../../api/pipelines/fetch_ml_inference_pipeline_processors'; import { isApiIndex, isConnectorIndex, isCrawlerIndex } from '../../../utils/indices'; @@ -60,6 +75,10 @@ type PipelinesActions = Pick< Actions<PostPipelineArgs, PostPipelineResponse>, 'apiError' | 'apiSuccess' | 'makeRequest' > & { + attachMlInferencePipelineSuccess: Actions< + AttachMlInferencePipelineApiLogicArgs, + AttachMlInferencePipelineResponse + >['apiSuccess']; closeAddMlInferencePipelineModal: () => void; closeModal: () => void; createCustomPipeline: Actions< @@ -74,6 +93,10 @@ type PipelinesActions = Pick< CreateCustomPipelineApiLogicArgs, CreateCustomPipelineApiLogicResponse >['apiSuccess']; + createMlInferencePipelineSuccess: Actions< + CreateMlInferencePipelineApiLogicArgs, + CreateMlInferencePipelineResponse + >['apiSuccess']; deleteMlPipeline: Actions< DeleteMlInferencePipelineApiLogicArgs, DeleteMlInferencePipelineResponse @@ -86,6 +109,18 @@ type PipelinesActions = Pick< DeleteMlInferencePipelineApiLogicArgs, DeleteMlInferencePipelineResponse >['apiSuccess']; + detachMlPipeline: Actions< + DetachMlInferencePipelineApiLogicArgs, + DetachMlInferencePipelineResponse + >['makeRequest']; + detachMlPipelineError: Actions< + DetachMlInferencePipelineApiLogicArgs, + DetachMlInferencePipelineResponse + >['apiError']; + detachMlPipelineSuccess: Actions< + DetachMlInferencePipelineApiLogicArgs, + DetachMlInferencePipelineResponse + >['apiSuccess']; fetchCustomPipeline: Actions< FetchCustomPipelineApiLogicArgs, FetchCustomPipelineApiLogicResponse @@ -153,6 +188,8 @@ export const PipelinesLogic = kea<MakeLogicType<PipelinesValues, PipelinesAction 'makeRequest as fetchMlInferenceProcessors', 'apiError as fetchMlInferenceProcessorsApiError', ], + AttachMlInferencePipelineApiLogic, + ['apiSuccess as attachMlInferencePipelineSuccess'], CreateMlInferencePipelineApiLogic, ['apiSuccess as createMlInferencePipelineSuccess'], DeleteMlInferencePipelineApiLogic, @@ -161,6 +198,12 @@ export const PipelinesLogic = kea<MakeLogicType<PipelinesValues, PipelinesAction 'apiSuccess as deleteMlPipelineSuccess', 'makeRequest as deleteMlPipeline', ], + DetachMlInferencePipelineApiLogic, + [ + 'apiError as detachMlPipelineError', + 'apiSuccess as detachMlPipelineSuccess', + 'makeRequest as detachMlPipeline', + ], ], values: [ FetchCustomPipelineApiLogic, @@ -201,6 +244,12 @@ export const PipelinesLogic = kea<MakeLogicType<PipelinesValues, PipelinesAction }) ); }, + attachMlInferencePipelineSuccess: () => { + // Re-fetch processors to ensure we display newly added ml processor + actions.fetchMlInferenceProcessors({ indexName: values.index.name }); + // Needed to ensure correct JSON is available in the JSON configurations tab + actions.fetchCustomPipeline({ indexName: values.index.name }); + }, closeModal: () => actions.setPipelineState( isConnectorIndex(values.index) || isCrawlerIndex(values.index) @@ -247,6 +296,26 @@ export const PipelinesLogic = kea<MakeLogicType<PipelinesValues, PipelinesAction // Needed to ensure correct JSON is available in the JSON configurations tab actions.fetchCustomPipeline({ indexName: values.index.name }); }, + detachMlPipelineError: (error) => flashAPIErrors(error), + detachMlPipelineSuccess: (response) => { + if (response.updated) { + flashSuccessToast( + i18n.translate( + 'xpack.enterpriseSearch.content.indices.pipelines.successToastDetachMlPipeline.title', + { + defaultMessage: 'Detached machine learning inference pipeline from "{pipelineName}"', + values: { + pipelineName: response.updated, + }, + } + ) + ); + } + // Re-fetch processors to ensure we display newly removed ml processor + actions.fetchMlInferenceProcessors({ indexName: values.index.name }); + // Needed to ensure correct JSON is available in the JSON configurations tab + actions.fetchCustomPipeline({ indexName: values.index.name }); + }, fetchIndexApiSuccess: (index) => { if (!values.showModal) { // Don't do this when the modal is open to avoid overwriting the values while editing @@ -287,6 +356,7 @@ export const PipelinesLogic = kea<MakeLogicType<PipelinesValues, PipelinesAction showAddMlInferencePipelineModal: [ false, { + attachMlInferencePipelineSuccess: () => false, closeAddMlInferencePipelineModal: () => false, createMlInferencePipelineSuccess: () => false, openAddMlInferencePipelineModal: () => true, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/search_index.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/search_index.tsx index b407118970262..c60f05eb48256 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/search_index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/search_index.tsx @@ -11,6 +11,8 @@ import { useParams } from 'react-router-dom'; import { useValues } from 'kea'; +import useObservable from 'react-use/lib/useObservable'; + import { EuiTabbedContent, EuiTabbedContentTab } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -62,6 +64,20 @@ export const SearchIndex: React.FC = () => { const { indexName } = useValues(IndexNameLogic); + /** + * Guided Onboarding needs us to mark the add data step as complete as soon as the user has data in an index + * Putting it here guarantees that if a user is viewing an index with data, it'll be marked as complete + */ + const { guidedOnboarding } = useValues(KibanaLogic); + const isDataStepActive = useObservable( + guidedOnboarding.guidedOnboardingApi!.isGuideStepActive$('search', 'add_data') + ); + useEffect(() => { + if (isDataStepActive && indexData?.count) { + guidedOnboarding.guidedOnboardingApi?.completeGuideStep('search', 'add_data'); + } + }, [isDataStepActive, indexData?.count]); + useEffect(() => { if ( isConnectorIndex(indexData) && diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts index ff761b17e7388..d9b6a6248ce3b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts @@ -315,7 +315,7 @@ describe('IndicesLogic', () => { expect(IndicesLogic.actions.closeDeleteModal).toHaveBeenCalled(); }); it('calls makeRequest on fetchIndices', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); IndicesLogic.actions.makeRequest = jest.fn(); IndicesLogic.actions.fetchIndices({ meta: DEFAULT_META, returnHiddenIndices: false }); jest.advanceTimersByTime(150); @@ -326,7 +326,7 @@ describe('IndicesLogic', () => { }); }); it('calls makeRequest once on two fetchIndices calls within 150ms', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); IndicesLogic.actions.makeRequest = jest.fn(); IndicesLogic.actions.fetchIndices({ meta: DEFAULT_META, returnHiddenIndices: false }); jest.advanceTimersByTime(130); @@ -341,7 +341,7 @@ describe('IndicesLogic', () => { expect(IndicesLogic.actions.makeRequest).toHaveBeenCalledTimes(1); }); it('calls makeRequest twice on two fetchIndices calls outside 150ms', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); IndicesLogic.actions.makeRequest = jest.fn(); IndicesLogic.actions.fetchIndices({ meta: DEFAULT_META, returnHiddenIndices: false }); jest.advanceTimersByTime(150); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/crawler_status_indicator/stop_crawl_popover_context_menu.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/crawler_status_indicator/stop_crawl_popover_context_menu.tsx index 2c9024b5b771b..d893369eace3e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/crawler_status_indicator/stop_crawl_popover_context_menu.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/crawler_status_indicator/stop_crawl_popover_context_menu.tsx @@ -73,7 +73,7 @@ export const StopCrawlPopoverContextMenu: React.FC = () => { {i18n.translate( 'xpack.enterpriseSearch.crawler.crawlerStatusIndicator.cancelCrawlMenuItemLabel', { - defaultMessage: 'Cancel Crawl', + defaultMessage: 'Cancel Crawls', } )} </EuiContextMenuItem>, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/ml_inference/utils.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/ml_inference/utils.ts index 0b2955cb7f30e..f24fe059cc5d0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/ml_inference/utils.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/ml_inference/utils.ts @@ -8,14 +8,9 @@ import { i18n } from '@kbn/i18n'; import { TrainedModelConfigResponse } from '@kbn/ml-plugin/common/types/trained_models'; -export const NLP_CONFIG_KEYS = [ - 'fill_mask', - 'ner', - 'text_classification', - 'text_embedding', - 'question_answering', - 'zero_shot_classification', -]; +import { SUPPORTED_PYTORCH_TASKS } from '../../../../../../common/ml_inference_pipeline'; + +export const NLP_CONFIG_KEYS: string[] = Object.values(SUPPORTED_PYTORCH_TASKS); export const RECOMMENDED_FIELDS = ['body', 'body_content', 'title']; export const NLP_DISPLAY_TITLES: Record<string, string | undefined> = { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/utils/sync_status_to_text.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/utils/sync_status_to_text.test.ts index d9ecdf6ebc556..4272eaf11641e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/utils/sync_status_to_text.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/utils/sync_status_to_text.test.ts @@ -19,6 +19,18 @@ describe('syncStatusToText', () => { it('should return correct value for in progress', () => { expect(syncStatusToText(SyncStatus.IN_PROGRESS)).toEqual('Sync in progress'); }); + it('should return correct value for canceling', () => { + expect(syncStatusToText(SyncStatus.CANCELING)).toEqual('Canceling sync'); + }); + it('should return correct value for canceled', () => { + expect(syncStatusToText(SyncStatus.CANCELED)).toEqual('Sync canceled'); + }); + it('should return correct value for pending', () => { + expect(syncStatusToText(SyncStatus.PENDING)).toEqual('Sync pending'); + }); + it('should return correct value for suspended', () => { + expect(syncStatusToText(SyncStatus.SUSPENDED)).toEqual('Sync suspended'); + }); }); describe('syncStatusToColor', () => { @@ -31,4 +43,16 @@ describe('syncStatusToColor', () => { it('should return correct value for in progress', () => { expect(syncStatusToColor(SyncStatus.IN_PROGRESS)).toEqual('warning'); }); + it('should return correct value for canceling', () => { + expect(syncStatusToColor(SyncStatus.CANCELING)).toEqual('warning'); + }); + it('should return correct value for canceled', () => { + expect(syncStatusToColor(SyncStatus.CANCELED)).toEqual('danger'); + }); + it('should return correct value for pending', () => { + expect(syncStatusToColor(SyncStatus.PENDING)).toEqual('warning'); + }); + it('should return correct value for suspended', () => { + expect(syncStatusToColor(SyncStatus.SUSPENDED)).toEqual('warning'); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/utils/sync_status_to_text.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/utils/sync_status_to_text.ts index 51d69f2e53ad7..5d79f92565a34 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/utils/sync_status_to_text.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/utils/sync_status_to_text.ts @@ -23,6 +23,22 @@ export function syncStatusToText(status: SyncStatus): string { return i18n.translate('xpack.enterpriseSearch.content.syncStatus.inProgress', { defaultMessage: 'Sync in progress', }); + case SyncStatus.CANCELED: + return i18n.translate('xpack.enterpriseSearch.content.syncStatus.canceling', { + defaultMessage: 'Sync canceled', + }); + case SyncStatus.CANCELING: + return i18n.translate('xpack.enterpriseSearch.content.syncStatus.canceled', { + defaultMessage: 'Canceling sync', + }); + case SyncStatus.PENDING: + return i18n.translate('xpack.enterpriseSearch.content.syncStatus.pending', { + defaultMessage: 'Sync pending', + }); + case SyncStatus.SUSPENDED: + return i18n.translate('xpack.enterpriseSearch.content.syncStatus.suspended', { + defaultMessage: 'Sync suspended', + }); } } @@ -31,8 +47,12 @@ export function syncStatusToColor(status: SyncStatus): string { case SyncStatus.COMPLETED: return 'success'; case SyncStatus.ERROR: + case SyncStatus.CANCELED: return 'danger'; case SyncStatus.IN_PROGRESS: + case SyncStatus.PENDING: + case SyncStatus.SUSPENDED: + case SyncStatus.CANCELING: return 'warning'; } } diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/cypress/tsconfig.json b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/cypress/tsconfig.json index fd75825bd3e26..9ea4c931ce39e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/cypress/tsconfig.json +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/cypress/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../shared/cypress/tsconfig.json", - "references": [{ "path": "../../shared/cypress/tsconfig.json" }], + "kbn_references": [{ "path": "../../shared/cypress/tsconfig.json" }], "compilerOptions": { "outDir": "../../../../target/cypress/types/enterprise_search" }, "include": ["./**/*"] } 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 455707779e739..0915e17ac6ab1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx @@ -12,6 +12,7 @@ import { getContext } from 'kea'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { coreMock } from '@kbn/core/public/mocks'; +import { guidedOnboardingMock } from '@kbn/guided-onboarding-plugin/public/mocks'; import { licensingMock } from '@kbn/licensing-plugin/public/mocks'; import { securityMock } from '@kbn/security-plugin/public/mocks'; @@ -27,8 +28,9 @@ describe('renderApp', () => { params: coreMock.createAppMountParameters(), core: coreMock.createStart(), plugins: { - licensing: licensingMock.createStart(), charts: chartPluginMock.createStartContract(), + guidedOnboarding: guidedOnboardingMock.createStart(), + licensing: licensingMock.createStart(), security: securityMock.createStart(), }, } as any; diff --git a/x-pack/plugins/enterprise_search/public/applications/index.tsx b/x-pack/plugins/enterprise_search/public/applications/index.tsx index 65903dde2b68f..1d6de5d5b3b93 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.tsx @@ -62,6 +62,7 @@ export const renderApp = ( charts: plugins.charts, cloud: plugins.cloud, uiSettings: core.uiSettings, + guidedOnboarding: plugins.guidedOnboarding, history: params.history, navigateToUrl: core.application.navigateToUrl, security: plugins.security, diff --git a/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/layout/index.ts b/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/layout/index.ts new file mode 100644 index 0000000000000..51fa23df81b01 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/layout/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 { EnterpriseSearchSearchExperiencesPageTemplate } from './page_template'; diff --git a/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/layout/page_template.test.tsx b/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/layout/page_template.test.tsx new file mode 100644 index 0000000000000..f1c889c020d7a --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/layout/page_template.test.tsx @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +jest.mock('../../../shared/layout/nav', () => ({ + useEnterpriseSearchNav: () => [], +})); + +import React from 'react'; + +import { shallow } from 'enzyme'; + +import { SetSearchExperiencesChrome } from '../../../shared/kibana_chrome'; +import { EnterpriseSearchPageTemplateWrapper } from '../../../shared/layout'; +import { SendEnterpriseSearchTelemetry } from '../../../shared/telemetry'; + +import { EnterpriseSearchSearchExperiencesPageTemplate } from './page_template'; + +describe('EnterpriseSearchSearchExperiencesPageTemplate', () => { + it('renders', () => { + const wrapper = shallow( + <EnterpriseSearchSearchExperiencesPageTemplate> + <div className="hello">world</div> + </EnterpriseSearchSearchExperiencesPageTemplate> + ); + + expect(wrapper.type()).toEqual(EnterpriseSearchPageTemplateWrapper); + expect(wrapper.prop('solutionNav')).toEqual({ name: 'Enterprise Search', items: [] }); + expect(wrapper.find('.hello').text()).toEqual('world'); + }); + + describe('page chrome', () => { + it('takes a breadcrumb array & renders a product-specific page chrome', () => { + const wrapper = shallow( + <EnterpriseSearchSearchExperiencesPageTemplate pageChrome={['Some page']} /> + ); + const setPageChrome = wrapper + .find(EnterpriseSearchPageTemplateWrapper) + .prop('setPageChrome') as any; + + expect(setPageChrome.type).toEqual(SetSearchExperiencesChrome); + expect(setPageChrome.props.trail).toEqual(['Some page']); + }); + }); + + describe('page telemetry', () => { + it('takes a metric & renders product-specific telemetry viewed event', () => { + const wrapper = shallow( + <EnterpriseSearchSearchExperiencesPageTemplate pageViewTelemetry="some_page" /> + ); + + expect(wrapper.find(SendEnterpriseSearchTelemetry).prop('action')).toEqual('viewed'); + expect(wrapper.find(SendEnterpriseSearchTelemetry).prop('metric')).toEqual('some_page'); + }); + }); + + describe('props', () => { + it('passes down any ...pageTemplateProps that EnterpriseSearchPageTemplateWrapper accepts', () => { + const wrapper = shallow( + <EnterpriseSearchSearchExperiencesPageTemplate + pageHeader={{ pageTitle: 'hello world' }} + isLoading={false} + emptyState={<div />} + /> + ); + + expect( + wrapper.find(EnterpriseSearchPageTemplateWrapper).prop('pageHeader')!.pageTitle + ).toEqual('hello world'); + expect(wrapper.find(EnterpriseSearchPageTemplateWrapper).prop('isLoading')).toEqual(false); + expect(wrapper.find(EnterpriseSearchPageTemplateWrapper).prop('emptyState')).toEqual(<div />); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/layout/page_template.tsx b/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/layout/page_template.tsx new file mode 100644 index 0000000000000..5c4d1958d0c38 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/layout/page_template.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 { SEARCH_EXPERIENCES_PLUGIN } from '../../../../../common/constants'; +import { SetSearchExperiencesChrome } from '../../../shared/kibana_chrome'; +import { EnterpriseSearchPageTemplateWrapper, PageTemplateProps } from '../../../shared/layout'; +import { useEnterpriseSearchNav } from '../../../shared/layout'; +import { SendEnterpriseSearchTelemetry } from '../../../shared/telemetry'; + +export const EnterpriseSearchSearchExperiencesPageTemplate: React.FC<PageTemplateProps> = ({ + children, + pageChrome, + pageViewTelemetry, + ...pageTemplateProps +}) => { + return ( + <EnterpriseSearchPageTemplateWrapper + {...pageTemplateProps} + solutionNav={{ + name: SEARCH_EXPERIENCES_PLUGIN.NAME, + items: useEnterpriseSearchNav(), + }} + setPageChrome={pageChrome && <SetSearchExperiencesChrome trail={pageChrome} />} + > + {pageViewTelemetry && ( + <SendEnterpriseSearchTelemetry action="viewed" metric={pageViewTelemetry} /> + )} + {children} + </EnterpriseSearchPageTemplateWrapper> + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/search_experiences_guide/index.ts b/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/search_experiences_guide/index.ts new file mode 100644 index 0000000000000..fd811cfd6a92b --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/search_experiences_guide/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 { SearchExperiencesGuide } from './search_experiences_guide'; diff --git a/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/search_experiences_guide/search_experiences_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/search_experiences_guide/search_experiences_guide.tsx new file mode 100644 index 0000000000000..3d32130a50e51 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/search_experiences/components/search_experiences_guide/search_experiences_guide.tsx @@ -0,0 +1,214 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, + EuiPanel, + EuiTitle, + EuiSpacer, + EuiText, + EuiButton, + EuiButtonEmpty, + EuiImage, + EuiHorizontalRule, + EuiCard, + EuiIcon, +} from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; + +import { FormattedMessage } from '@kbn/i18n-react'; + +import { SEARCH_EXPERIENCES_PLUGIN } from '../../../../../common/constants'; +import searchExperiencesIllustration from '../../../../assets/images/search_experiences.svg'; + +import { SetSearchExperiencesChrome as SetPageChrome } from '../../../shared/kibana_chrome'; +import { EnterpriseSearchSearchExperiencesPageTemplate } from '../layout'; + +export const SearchExperiencesGuide: React.FC = () => { + return ( + <EnterpriseSearchSearchExperiencesPageTemplate + restrictWidth + pageHeader={{ + pageTitle: i18n.translate('xpack.enterpriseSearch.searchExperiences.guide.pageTitle', { + defaultMessage: 'Build a search experience with Search UI', + }), + }} + > + <SetPageChrome /> + <EuiPanel color="transparent" paddingSize="none"> + <EuiFlexGroup + className="addContentEmptyPrompt" + justifyContent="spaceBetween" + direction="row" + responsive + > + <EuiFlexItem grow> + <EuiFlexGroup direction="column" justifyContent="center" responsive={false}> + <EuiFlexItem grow={false}> + <EuiTitle> + <h2>About Search UI</h2> + </EuiTitle> + <EuiSpacer size="l" /> + <EuiText grow={false}> + <p> + <FormattedMessage + id="xpack.enterpriseSearch.searchExperiences.guide.description" + defaultMessage="Search UI is a JavaScript library for implementing world-class search experiences without reinventing the wheel. It works out of the box with Elasticsearch, App Search, and Workplace Search, so you can focus on building the best experience for your users, customers, and employees." + /> + </p> + </EuiText> + </EuiFlexItem> + <EuiFlexItem> + <EuiFlexGroup> + <EuiFlexItem grow={false}> + <EuiButton + href={SEARCH_EXPERIENCES_PLUGIN.DOCUMENTATION_URL} + target="_blank" + color="primary" + fill + iconType={'popout'} + iconSide="right" + > + <FormattedMessage + id="xpack.enterpriseSearch.searchExperiences.guide.documentationLink" + defaultMessage="Visit the Search UI documentation" + /> + </EuiButton> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + href={SEARCH_EXPERIENCES_PLUGIN.GITHUB_URL} + target="_blank" + iconType={'popout'} + iconSide="right" + > + <FormattedMessage + id="xpack.enterpriseSearch.searchExperiences.guide.githubLink" + defaultMessage="Search UI on Github" + /> + </EuiButtonEmpty> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiTitle> + <h2> + <FormattedMessage + id="xpack.enterpriseSearch.searchExperiences.guide.featuresTitle" + defaultMessage="Features" + /> + </h2> + </EuiTitle> + <EuiSpacer size="l" /> + <EuiText grow={false}> + <ul> + <li> + <FormattedMessage + id="xpack.enterpriseSearch.searchExperiences.guide.features.1" + defaultMessage="You know, for search. Elastic builds and maintains Search UI." + /> + </li> + <li> + <FormattedMessage + id="xpack.enterpriseSearch.searchExperiences.guide.features.2" + defaultMessage="Build a complete search experience quickly with a few lines of code." + /> + </li> + <li> + <FormattedMessage + id="xpack.enterpriseSearch.searchExperiences.guide.features.3" + defaultMessage="Search UI is highly customizable, so you can build the perfect search experience for your users." + /> + </li> + <li> + <FormattedMessage + id="xpack.enterpriseSearch.searchExperiences.guide.features.4" + defaultMessage="Searches, paging, filtering, and more, are captured in the URL for direct result linking." + /> + </li> + <li> + <FormattedMessage + id="xpack.enterpriseSearch.searchExperiences.guide.features.5" + defaultMessage="Not just for React. Use with any JavaScript library, even vanilla JavaScript." + /> + </li> + </ul> + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiImage + size="xl" + float="right" + src={searchExperiencesIllustration} + alt="Search experiences illustration" + /> + </EuiFlexItem> + </EuiFlexGroup> + <EuiHorizontalRule margin="xxl" /> + <EuiTitle> + <h2> + <FormattedMessage + id="xpack.enterpriseSearch.searchExperiences.guide.tutorialsTitle" + defaultMessage="Get started quickly with a tutorial" + /> + </h2> + </EuiTitle> + <EuiSpacer size="xl" /> + <EuiFlexGroup responsive> + <EuiFlexItem> + <EuiCard + icon={<EuiIcon size="xl" type="logoElasticsearch" />} + title="Elasticsearch" + description={i18n.translate( + 'xpack.enterpriseSearch.searchExperiences.guide.tutorials.elasticsearch.description', + { + defaultMessage: 'Build a search experience with Elasticsearch and Search UI.', + } + )} + href={SEARCH_EXPERIENCES_PLUGIN.ELASTICSEARCH_TUTORIAL_URL} + target="_blank" + /> + </EuiFlexItem> + <EuiFlexItem> + <EuiCard + icon={<EuiIcon size="xl" type="logoAppSearch" />} + title="App Search" + description={i18n.translate( + 'xpack.enterpriseSearch.searchExperiences.guide.tutorials.appSearch.description', + { + defaultMessage: 'Build a search experience with App Search and Search UI.', + } + )} + href={SEARCH_EXPERIENCES_PLUGIN.APP_SEARCH_TUTORIAL_URL} + target="_blank" + /> + </EuiFlexItem> + <EuiFlexItem> + <EuiCard + icon={<EuiIcon size="xl" type="logoWorkplaceSearch" />} + title="Workplace Search" + description={i18n.translate( + 'xpack.enterpriseSearch.searchExperiences.guide.tutorials.workplaceSearch.description', + { + defaultMessage: 'Build a search experience with Workplace Search and Search UI.', + } + )} + href={SEARCH_EXPERIENCES_PLUGIN.WORKPLACE_SEARCH_TUTORIAL_URL} + target="_blank" + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + </EnterpriseSearchSearchExperiencesPageTemplate> + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/search_experiences/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/search_experiences/index.test.tsx new file mode 100644 index 0000000000000..ceaf735802226 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/search_experiences/index.test.tsx @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { setMockValues } from '../__mocks__/kea_logic'; + +import React from 'react'; + +import { shallow } from 'enzyme'; + +import { SearchExperiencesGuide } from './components/search_experiences_guide'; + +import { SearchExperiences } from '.'; + +describe('SearchExperiences', () => { + it('renders the Search Experiences guide', () => { + setMockValues({ + errorConnectingMessage: '', + config: { host: 'localhost' }, + }); + const wrapper = shallow(<SearchExperiences />); + + expect(wrapper.find(SearchExperiencesGuide)).toHaveLength(1); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/search_experiences/index.tsx b/x-pack/plugins/enterprise_search/public/applications/search_experiences/index.tsx new file mode 100644 index 0000000000000..4416c8309211b --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/search_experiences/index.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 { Route, Switch } from 'react-router-dom'; + +import { isVersionMismatch } from '../../../common/is_version_mismatch'; +import { InitialAppData } from '../../../common/types'; +import { VersionMismatchPage } from '../shared/version_mismatch'; + +import { SearchExperiencesGuide } from './components/search_experiences_guide'; + +import { ROOT_PATH } from './routes'; + +export const SearchExperiences: React.FC<InitialAppData> = (props) => { + const { enterpriseSearchVersion, kibanaVersion } = props; + const incompatibleVersions = isVersionMismatch(enterpriseSearchVersion, kibanaVersion); + + const showView = () => { + if (incompatibleVersions) { + return ( + <VersionMismatchPage + enterpriseSearchVersion={enterpriseSearchVersion} + kibanaVersion={kibanaVersion} + /> + ); + } + + return <SearchExperiencesGuide />; + }; + + return ( + <Switch> + <Route exact path={ROOT_PATH}> + {showView()} + </Route> + </Switch> + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/search_experiences/routes.ts b/x-pack/plugins/enterprise_search/public/applications/search_experiences/routes.ts new file mode 100644 index 0000000000000..d6b0b0a669281 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/search_experiences/routes.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 ROOT_PATH = '/'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/cypress/tsconfig.json b/x-pack/plugins/enterprise_search/public/applications/shared/cypress/tsconfig.json index e728943de044e..f36cb624e03ec 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/cypress/tsconfig.json +++ b/x-pack/plugins/enterprise_search/public/applications/shared/cypress/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../../../../../../tsconfig.base.json", - "references": [{ "path": "../../../../../../../test/tsconfig.json" }], + "kbn_references": [{ "path": "../../../../../../../test/tsconfig.json" }], "include": ["./**/*"], "compilerOptions": { "outDir": "../../../../target/cypress/types/shared", diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts b/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts index 21be13375b980..db80e75fbcf20 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts @@ -18,6 +18,7 @@ import { ScopedHistory, IUiSettingsClient, } from '@kbn/core/public'; +import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; import { SecurityPluginStart } from '@kbn/security-plugin/public'; import { ProductAccess } from '../../../../common/types'; @@ -41,6 +42,7 @@ interface KibanaLogicProps { renderHeaderActions(HeaderActions: FC): void; // Required plugins charts: ChartsPluginStart; + guidedOnboarding: GuidedOnboardingPluginStart; security: SecurityPluginStart; uiSettings: IUiSettingsClient; // Optional plugins @@ -59,6 +61,7 @@ export const KibanaLogic = kea<MakeLogicType<KibanaValues>>({ config: [props.config || {}, {}], charts: [props.charts, {}], cloud: [props.cloud || {}, {}], + guidedOnboarding: [props.guidedOnboarding, {}], history: [props.history, {}], navigateToUrl: [ (url: string, options?: CreateHrefOptions) => { diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.ts b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.ts index 70fcedb9da260..140ec10df23da 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.ts @@ -15,6 +15,7 @@ import { APP_SEARCH_PLUGIN, WORKPLACE_SEARCH_PLUGIN, ENTERPRISE_SEARCH_CONTENT_PLUGIN, + SEARCH_EXPERIENCES_PLUGIN, } from '../../../../common/constants'; import { stripLeadingSlash } from '../../../../common/strip_slashes'; @@ -129,3 +130,9 @@ export const useEnterpriseSearchContentBreadcrumbs = (breadcrumbs: Breadcrumbs = { text: ENTERPRISE_SEARCH_CONTENT_PLUGIN.NAV_TITLE, path: '/' }, ...breadcrumbs, ]); + +export const useSearchExperiencesBreadcrumbs = (breadcrumbs: Breadcrumbs = []) => + useEnterpriseSearchBreadcrumbs([ + { text: SEARCH_EXPERIENCES_PLUGIN.NAV_TITLE, path: '/' }, + ...breadcrumbs, + ]); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_title.ts b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_title.ts index 29b52953a578f..49279881ef00e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_title.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_title.ts @@ -10,6 +10,7 @@ import { ANALYTICS_PLUGIN, APP_SEARCH_PLUGIN, WORKPLACE_SEARCH_PLUGIN, + SEARCH_EXPERIENCES_PLUGIN, } from '../../../../common/constants'; /** @@ -43,3 +44,6 @@ export const appSearchTitle = (page: Title = []) => export const workplaceSearchTitle = (page: Title = []) => generateTitle([...page, WORKPLACE_SEARCH_PLUGIN.NAME]); + +export const searchExperiencesTitle = (page: Title = []) => + generateTitle([...page, SEARCH_EXPERIENCES_PLUGIN.NAME]); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/index.ts b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/index.ts index 28e5833a0faca..1a013bf11df35 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/index.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/index.ts @@ -12,4 +12,5 @@ export { SetElasticsearchChrome, SetAppSearchChrome, SetWorkplaceSearchChrome, + SetSearchExperiencesChrome, } from './set_chrome'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx index d0327e528376d..72b68c9a5cc7f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx @@ -20,6 +20,7 @@ import { useAppSearchBreadcrumbs, useWorkplaceSearchBreadcrumbs, BreadcrumbTrail, + useSearchExperiencesBreadcrumbs, } from './generate_breadcrumbs'; import { enterpriseSearchTitle, @@ -27,6 +28,7 @@ import { elasticsearchTitle, appSearchTitle, workplaceSearchTitle, + searchExperiencesTitle, } from './generate_title'; /** @@ -150,5 +152,22 @@ export const SetEnterpriseSearchContentChrome: React.FC<SetChromeProps> = ({ tra return null; }; +export const SetSearchExperiencesChrome: React.FC<SetChromeProps> = ({ trail = [] }) => { + const { setBreadcrumbs, setDocTitle } = useValues(KibanaLogic); + + const title = reverseArray(trail); + const docTitle = searchExperiencesTitle(title); + + const crumbs = useGenerateBreadcrumbs(trail); + const breadcrumbs = useSearchExperiencesBreadcrumbs(crumbs); + + useEffect(() => { + setBreadcrumbs(breadcrumbs); + setDocTitle(docTitle); + }, [trail]); + + return null; +}; + // Small util - performantly reverses an array without mutating the original array const reverseArray = (array: string[]) => array.slice().reverse(); 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 67fb93ae643f6..bd367e7de8e7d 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 @@ -72,6 +72,11 @@ describe('useEnterpriseSearchContentNav', () => { id: 'elasticsearch', name: 'Elasticsearch', }, + { + href: '/app/enterprise_search/search_experiences', + id: 'searchExperiences', + name: 'Search Experiences', + }, { href: '/app/enterprise_search/app_search', id: 'app_search', @@ -108,6 +113,11 @@ describe('useEnterpriseSearchContentNav', () => { id: 'elasticsearch', name: 'Elasticsearch', }, + { + href: '/app/enterprise_search/search_experiences', + id: 'searchExperiences', + name: 'Search Experiences', + }, ], name: 'Search', }); @@ -129,6 +139,11 @@ describe('useEnterpriseSearchContentNav', () => { id: 'elasticsearch', name: 'Elasticsearch', }, + { + href: '/app/enterprise_search/search_experiences', + id: 'searchExperiences', + name: 'Search Experiences', + }, { href: '/app/enterprise_search/workplace_search', id: 'workplace_search', @@ -155,6 +170,11 @@ describe('useEnterpriseSearchContentNav', () => { id: 'elasticsearch', name: 'Elasticsearch', }, + { + href: '/app/enterprise_search/search_experiences', + id: 'searchExperiences', + name: 'Search Experiences', + }, { href: '/app/enterprise_search/app_search', id: 'app_search', 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 967095d9674ba..471c40668b4a3 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 @@ -16,6 +16,7 @@ import { ELASTICSEARCH_PLUGIN, ENTERPRISE_SEARCH_CONTENT_PLUGIN, ENTERPRISE_SEARCH_OVERVIEW_PLUGIN, + SEARCH_EXPERIENCES_PLUGIN, WORKPLACE_SEARCH_PLUGIN, } from '../../../../common/constants'; import { enableBehavioralAnalyticsSection } from '../../../../common/ui_settings_keys'; @@ -106,6 +107,16 @@ export const useEnterpriseSearchNav = () => { to: ELASTICSEARCH_PLUGIN.URL, }), }, + { + id: 'searchExperiences', + name: i18n.translate('xpack.enterpriseSearch.nav.searchExperiencesTitle', { + defaultMessage: 'Search Experiences', + }), + ...generateNavLink({ + shouldNotCreateHref: true, + to: SEARCH_EXPERIENCES_PLUGIN.URL, + }), + }, ...(productAccess.hasAppSearchAccess ? [ { @@ -135,7 +146,7 @@ export const useEnterpriseSearchNav = () => { ] : []), ], - name: i18n.translate('xpack.enterpriseSearch.nav.searchExperiencesTitle', { + name: i18n.translate('xpack.enterpriseSearch.nav.searchTitle', { defaultMessage: 'Search', }), }, diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/schema/field_type_select/index.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/schema/field_type_select/index.tsx index fb6c0f2047b12..8fd744c4ebe6f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/schema/field_type_select/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/schema/field_type_select/index.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiSelect } from '@elastic/eui'; -import { SchemaType } from '../types'; +import { SchemaType, IgnoreSchemaTypes } from '../types'; interface Props { fieldName: string; @@ -25,7 +25,10 @@ export const SchemaFieldTypeSelect: React.FC<Props> = ({ disabled, ...rest }) => { - const fieldTypeOptions = Object.values(SchemaType).map((type) => ({ value: type, text: type })); + const fieldTypeOptions = Object.values(SchemaType) + .filter((type) => !IgnoreSchemaTypes.includes(type)) + .map((type) => ({ value: type, text: type })); + return ( <EuiSelect {...rest} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/schema/types.ts b/x-pack/plugins/enterprise_search/public/applications/shared/schema/types.ts index 6e206ddc71971..42ecc4498fbbf 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/schema/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/schema/types.ts @@ -16,6 +16,8 @@ export enum SchemaType { Date = 'date', Nested = 'nested', } +// Certain Schema types may have to be ignored from showing up, these types could be added to this list +export const IgnoreSchemaTypes = [SchemaType.Nested]; // Certain API endpoints will use these internal type names, which map to the external names above export enum InternalSchemaType { String = 'string', diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress/tsconfig.json b/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress/tsconfig.json index 39f8bea5debc6..296f97269fb0c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress/tsconfig.json +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../shared/cypress/tsconfig.json", - "references": [{ "path": "../../shared/cypress/tsconfig.json" }], + "kbn_references": [{ "path": "../../shared/cypress/tsconfig.json" }], "compilerOptions": { "outDir": "../../../../target/cypress/types/workplace_search" }, "include": ["./**/*"] } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_logic.test.ts index 75c9010ae9be5..a610cdc887d98 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_logic.test.ts @@ -80,7 +80,7 @@ describe('SourcesLogic', () => { }; beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); jest.clearAllMocks(); mount(); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.test.ts index bc82c95871676..a167c5a1c11c3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.test.ts @@ -239,7 +239,7 @@ describe('GroupsLogic', () => { }; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/enterprise_search/public/assets/images/search_experiences.svg b/x-pack/plugins/enterprise_search/public/assets/images/search_experiences.svg new file mode 100644 index 0000000000000..4baea2fca1c7d --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/images/search_experiences.svg @@ -0,0 +1,1393 @@ +<svg width="732" height="504" viewBox="0 0 732 504" fill="none" xmlns="http://www.w3.org/2000/svg"> + <g clip-path="url(#clip0_8_64576)"> + <path d="M497.95 61.6H436.35V0H497.95V61.6ZM440.98 56.98H493.33V4.62H440.98V56.97V56.98Z" fill="#E6EAF1"></path> + <path d="M200.3 503.94H138.7V442.34H200.3V503.94ZM143.33 499.32H195.68V446.97H143.33V499.32Z" fill="#E6EAF1"></path> + <path d="M152.36 79.9H585.3C599.55 79.9 611.11 91.47 611.11 105.71V406.69H126.55V105.71C126.55 91.46 138.12 79.9 152.36 79.9V79.9Z" fill="#8BD1C8"></path> + <path d="M152.31 311.68C152.55 312.96 154.09 314.18 155.13 313.92C156.18 313.65 156.87 312.59 156.68 311.53" fill="#5BC4BD"></path> + <path d="M212.26 320.78C212.22 321.13 212.36 321.7 212.62 321.86C213.32 322.29 214.09 321.61 214.21 321.2C214.33 320.79 213.75 319.96 212.95 320.08C212.68 320.12 212.29 320.51 212.26 320.78V320.78Z" fill="#5BC4BD"></path> + <path d="M151.95 318.33C151.77 318.17 151.18 318.22 151 318.4C150.82 318.58 150.81 319.12 150.96 319.36C151.07 319.54 151.78 319.78 152.08 319.56C152.38 319.34 152.13 318.5 151.95 318.34V318.33Z" fill="#5BC4BD"></path> + <path d="M199.79 323.04C199.44 322.63 199.06 322.01 198.43 322.07C197.81 322.13 197.84 322.9 197.95 323.13C198.16 323.57 198.85 324.56 199.32 324.51C199.79 324.45 199.91 323.19 199.79 323.04V323.04Z" fill="#5BC4BD"></path> + <path d="M164.13 322.58C163.96 321.46 162.56 320.63 161.33 320.9C160.24 321.14 159.24 322.59 159.46 323.62C159.73 324.92 160.98 325.9 162.03 325.64C163.07 325.39 164.29 323.61 164.14 322.58H164.13Z" fill="#5BC4BD"></path> + <path d="M200.19 316.9C200.42 317.94 201.21 318.6 202 318.39C203.02 318.12 203.8 316.89 203.64 315.81C203.53 315.08 202.41 314.54 201.49 314.77C200.43 315.04 199.96 315.82 200.19 316.89V316.9Z" fill="#5BC4BD"></path> + <path d="M215.55 314.42C215.7 315.13 216.39 315.56 217.16 315.43C217.9 315.3 218.33 314.64 218.17 313.85C218.05 313.24 217.33 312.79 216.68 312.92C215.87 313.07 215.4 313.7 215.56 314.43L215.55 314.42Z" fill="#5BC4BD"></path> + <path d="M194.78 313.58C194.85 314.23 195.52 314.69 196.21 314.58C196.97 314.45 197.41 313.9 197.29 313.22C197.17 312.52 196.56 312.05 195.89 312.17C195.28 312.27 194.71 313 194.77 313.59L194.78 313.58Z" fill="#5BC4BD"></path> + <path d="M182.33 314.85C182.62 315.51 182.82 316.2 183.06 316.88C183.03 317.72 183.53 318.14 184.22 318.09C184.96 318.04 185.4 317.5 185.47 316.66C185.51 316.21 185.52 315.7 185.73 315.32C186.15 314.57 186.21 313.85 185.71 313.18C185.33 312.67 183.69 312.64 183.1 313.09C182.55 313.52 181.93 313.94 182.33 314.84V314.85Z" fill="#5BC4BD"></path> + <path d="M176.4 316.02C176.19 315.23 175.48 314.9 174.88 315.07C174.32 315.24 174.33 315.66 174.4 316.1C174.51 316.72 175.05 317.1 175.56 316.83C175.93 316.63 176.19 316.23 176.4 316.02Z" fill="#5BC4BD"></path> + <path d="M191.72 315.41C191.7 314.81 191.07 314.14 190.58 314.35C190.17 314.53 189.25 315.03 189.39 315.63C189.53 316.23 190.4 316.26 190.79 316.28C191.27 316.3 191.75 316.06 191.72 315.41V315.41Z" fill="#5BC4BD"></path> + <path d="M192.07 323.52C192.07 323.38 191.79 323.06 191.55 323.12C191.31 323.18 191.02 323.5 191 323.72C190.99 323.9 191.33 324.48 191.65 324.44C191.97 324.4 192.06 323.78 192.07 323.52V323.52Z" fill="#5BC4BD"></path> + <path d="M171.37 317.87C171.33 317.56 170.9 317.38 170.68 317.39C170.46 317.39 169.87 317.76 169.92 318.06C169.97 318.36 170.62 318.57 170.83 318.52C171.05 318.47 171.42 318.18 171.37 317.87Z" fill="#5BC4BD"></path> + <path d="M176.46 326.81C176.6 326.82 177.1 326.53 177.05 326.18C177 325.83 176.39 325.81 176.14 325.83C175.99 325.84 175.69 326.17 175.73 326.4C175.77 326.63 176.2 326.79 176.46 326.81Z" fill="#5BC4BD"></path> + <path d="M207.85 315.2C207.82 315.09 207.67 314.91 207.5 314.94C207.34 314.97 207.14 315.15 207.2 315.37C207.26 315.6 207.53 315.63 207.65 315.61C207.77 315.59 207.88 315.3 207.85 315.2V315.2Z" fill="#5BC4BD"></path> + <path d="M182.34 325C182.71 324.35 182.67 324.62 183.43 324.62C184.19 324.62 185.25 324.15 184.82 322.87C184.39 321.59 182.88 321.25 181.74 321.51C180.6 321.77 179.58 323.94 180.24 325.21C180.71 326.12 181.97 325.65 182.34 325.01V325Z" fill="#5BC4BD"></path> + <path d="M217.46 318.01C217.22 316.65 216.03 315.8 214.73 316.07C213.59 316.31 212.92 317.16 213.1 318.13C213.34 319.41 214.87 320.64 215.9 320.38C216.95 320.12 217.65 319.06 217.46 318V318.01Z" fill="#5BC4BD"></path> + <path d="M225.32 316.27C225.34 315.91 225.11 315.43 224.83 315.2C224.26 314.73 223.73 314.96 222.76 315.93C223.03 316.59 223.1 317.46 224.13 317.4C224.79 317.36 225.28 316.93 225.31 316.27H225.32Z" fill="#5BC4BD"></path> + <path d="M272.98 327.62C272.94 327.97 273.08 328.54 273.34 328.71C274.04 329.15 274.81 328.47 274.94 328.06C275.07 327.65 274.49 326.81 273.68 326.93C273.41 326.97 273.01 327.36 272.98 327.62V327.62Z" fill="#5BC4BD"></path> + <path d="M260.28 312.57C260.55 313.01 261.32 313.23 261.72 312.97Z" fill="#5BC4BD"></path> + <path d="M204.54 314.46C204.59 313.87 204.02 313.54 203.56 313.66C203.23 313.75 202.39 314.14 202.56 314.86C202.73 315.58 203.58 315.42 203.87 315.34C204.17 315.25 204.52 314.79 204.54 314.46Z" fill="#5BC4BD"></path> + <path d="M212.68 324.78C212.5 324.62 211.91 324.66 211.73 324.84C211.55 325.02 211.53 325.56 211.68 325.8C211.79 325.98 212.5 326.22 212.8 326.01C213.1 325.8 212.86 324.95 212.68 324.79V324.78Z" fill="#5BC4BD"></path> + <path d="M260.49 329.8C260.14 329.39 259.76 328.77 259.14 328.82C258.52 328.87 258.54 329.65 258.65 329.88C258.86 330.32 259.54 331.32 260.01 331.26C260.48 331.2 260.61 329.94 260.49 329.8Z" fill="#5BC4BD"></path> + <path d="M266.73 312.12C265.25 312.03 264.46 313.14 265.02 314.43C265.37 315.22 265.87 315.97 266.42 316.65C267 317.37 268.52 317.42 269.31 316.9C269.79 316.59 270.54 315.56 269.69 314.76C267.79 314.27 268.6 313.13 267.36 312.33C267.14 312.19 266.85 312.16 266.73 312.13V312.12Z" fill="#5BC4BD"></path> + <path d="M224.84 329.11C224.68 327.99 223.28 327.15 222.05 327.41C220.96 327.64 219.95 329.08 220.16 330.12C220.42 331.42 221.66 332.41 222.72 332.16C223.76 331.92 225 330.14 224.84 329.12V329.11Z" fill="#5BC4BD"></path> + <path d="M260.93 323.67C261.15 324.71 261.94 325.37 262.73 325.17C263.75 324.9 264.54 323.68 264.38 322.61C264.27 321.88 263.15 321.33 262.24 321.56C261.18 321.83 260.7 322.6 260.93 323.67Z" fill="#5BC4BD"></path> + <path d="M227.68 315.62C227.77 316.41 228.63 316.86 229.74 316.71C230.59 316.59 231.1 316.01 230.96 315.3C230.81 314.55 229.66 313.5 229.06 313.57C228.13 313.67 227.55 314.53 227.68 315.62V315.62Z" fill="#5BC4BD"></path> + <path d="M252.86 315.23C252.26 315.39 251.78 316.31 251.98 316.94C252.17 317.56 252.9 317.96 253.55 317.8C254.21 317.64 254.55 317.04 254.41 316.28C254.26 315.5 253.58 315.04 252.87 315.23H252.86Z" fill="#5BC4BD"></path> + <path d="M276.31 321.29C276.46 322 277.14 322.44 277.91 322.31C278.65 322.19 279.08 321.52 278.93 320.74C278.81 320.13 278.1 319.68 277.44 319.8C276.63 319.95 276.15 320.58 276.31 321.3V321.29Z" fill="#5BC4BD"></path> + <path d="M287.16 315.72C287.77 315.6 288.28 314.81 288.13 314.22C287.98 313.63 287.21 313.15 286.61 313.25C285.97 313.36 285.56 313.91 285.66 314.54C285.78 315.3 286.49 315.85 287.17 315.71L287.16 315.72Z" fill="#5BC4BD"></path> + <path d="M255.54 320.32C255.6 320.97 256.27 321.44 256.97 321.33C257.73 321.21 258.17 320.66 258.06 319.98C257.95 319.28 257.33 318.81 256.67 318.92C256.06 319.02 255.48 319.74 255.54 320.33V320.32Z" fill="#5BC4BD"></path> + <path d="M243.09 321.5C243.38 322.16 243.57 322.86 243.8 323.54C243.76 324.38 244.27 324.8 244.95 324.76C245.69 324.72 246.14 324.18 246.21 323.34C246.25 322.89 246.26 322.38 246.48 322.01C246.9 321.26 246.97 320.54 246.48 319.87C246.1 319.36 244.47 319.31 243.87 319.77C243.31 320.19 242.7 320.61 243.09 321.51V321.5Z" fill="#5BC4BD"></path> + <path d="M241.02 313.78C241.78 313.69 242.2 313.17 242.09 312.44C241.98 311.68 241.29 311.13 240.6 311.26C239.98 311.38 239.6 312.06 239.74 312.8C239.86 313.44 240.41 313.85 241.02 313.78V313.78Z" fill="#5BC4BD"></path> + <path d="M235.13 317.05C235.23 317.67 235.77 318.05 236.28 317.78C236.65 317.59 236.91 317.18 237.12 316.97C236.91 316.18 236.21 315.84 235.61 316.01C235.05 316.17 235.05 316.6 235.13 317.04V317.05Z" fill="#5BC4BD"></path> + <path d="M237.15 322.63C236.94 321.84 236.24 321.5 235.64 321.67C235.08 321.83 235.08 322.26 235.16 322.7C235.26 323.32 235.8 323.7 236.31 323.43C236.68 323.24 236.94 322.83 237.15 322.62V322.63Z" fill="#5BC4BD"></path> + <path d="M252.47 322.12C252.45 321.52 251.83 320.84 251.33 321.06C250.92 321.24 250 321.73 250.14 322.33C250.28 322.93 251.14 322.97 251.53 322.99C252.01 323.01 252.49 322.77 252.47 322.12Z" fill="#5BC4BD"></path> + <path d="M293.78 311.17C293.78 311.53 294.65 312.71 295.27 312.61Z" fill="#5BC4BD"></path> + <path d="M252.77 330.23C252.77 330.09 252.5 329.76 252.25 329.82C252.01 329.88 251.71 330.19 251.7 330.42C251.69 330.6 252.03 331.18 252.35 331.15C252.67 331.11 252.77 330.49 252.77 330.24V330.23Z" fill="#5BC4BD"></path> + <path d="M232.1 324.45C232.06 324.14 231.64 323.96 231.41 323.97C231.19 323.97 230.59 324.33 230.64 324.63C230.69 324.93 231.33 325.14 231.54 325.09C231.76 325.04 232.13 324.76 232.09 324.44L232.1 324.45Z" fill="#5BC4BD"></path> + <path d="M237.14 333.42C237.28 333.44 237.78 333.14 237.74 332.8C237.7 332.46 237.08 332.42 236.83 332.44C236.68 332.45 236.37 332.78 236.41 333.01C236.45 333.24 236.88 333.4 237.14 333.43V333.42Z" fill="#5BC4BD"></path> + <path d="M268.61 322.02C268.58 321.91 268.43 321.72 268.26 321.75C268.09 321.78 267.9 321.95 267.96 322.18C268.02 322.41 268.29 322.45 268.41 322.43C268.53 322.41 268.64 322.12 268.61 322.02V322.02Z" fill="#5BC4BD"></path> + <path d="M244.51 312.15C244.23 312.15 243.96 312.21 243.68 312.47C243.06 313.05 243.3 314.25 243.99 314.78C244.56 315.22 245.66 315.34 246.25 314.9C247.07 314.28 246.9 313.27 246.76 312.97" fill="#5BC4BD"></path> + <path d="M243.03 331.65C243.4 331.01 243.36 331.27 244.12 331.27C244.88 331.27 245.94 330.81 245.52 329.53C245.1 328.25 243.59 327.89 242.45 328.15C241.31 328.41 240.28 330.57 240.93 331.84C241.4 332.76 242.66 332.29 243.03 331.65Z" fill="#5BC4BD"></path> + <path d="M317.31 334.36C316.84 333.16 315.19 332.44 314.01 332.92C312.99 333.34 312.34 335.07 312.78 336.18C313.23 337.32 314.68 337.69 316.19 337.05C317.25 336.6 317.73 335.45 317.3 334.35L317.31 334.36Z" fill="#5BC4BD"></path> + <path d="M319.06 311.89C319.62 313.08 320.83 313.44 322.09 312.79Z" fill="#5BC4BD"></path> + <path d="M355.06 313.78C355.6 314.81 356.6 315.23 357.49 314.8C358.66 314.23 359.44 312.42 358.91 311.5" fill="#5BC4BD"></path> + <path d="M290.9 325.2C291.33 324.3 291.19 323.22 290.43 322.68C290.1 322.44 289.51 322.32 289.12 322.43C287.87 322.79 287.25 323.68 287.37 325.28C287.81 325.51 288.27 325.84 288.77 325.99C289.64 326.24 290.6 325.84 290.9 325.21V325.2Z" fill="#5BC4BD"></path> + <path d="M316.32 339.99C315.37 340.55 314.89 342.04 315.35 343.01C315.64 343.62 316.82 343.89 317.54 343.51C318.64 342.94 319 341.94 318.45 340.93C317.98 340.06 316.96 339.61 316.31 339.99H316.32Z" fill="#5BC4BD"></path> + <path d="M332.22 329.95C331.38 330.32 330.98 331.21 331.33 331.94C331.78 332.89 333.04 333.47 333.77 333.07C334.62 332.6 335.08 331.36 334.72 330.51C334.44 329.86 333.1 329.56 332.23 329.94L332.22 329.95Z" fill="#5BC4BD"></path> + <path d="M295.44 328.19C296.44 327.76 296.62 327.18 296.11 326.06C295.66 325.07 294.91 324.66 294.21 325.01C293.57 325.33 292.91 327 293.2 327.57C293.62 328.38 294.46 328.61 295.44 328.19V328.19Z" fill="#5BC4BD"></path> + <path d="M294.39 342.67C293.68 343.05 293.37 343.68 293.61 344.24C293.9 344.92 295.5 345.63 296.09 345.35C296.94 344.94 297.12 344.15 296.6 343.13C296.17 342.29 295.4 342.13 294.39 342.67V342.67Z" fill="#5BC4BD"></path> + <path d="M303.92 342.78C303.22 343.09 303.03 344.25 303.52 345.24C303.82 345.86 304.32 345.93 304.88 345.69C305.71 345.34 306.25 344.34 305.96 343.74C305.63 343.06 304.49 342.53 303.92 342.78Z" fill="#5BC4BD"></path> + <path d="M349.01 320.56C348.68 321 349.38 322.58 350.11 322.49C350.68 322.42 351.23 321.74 351.13 321.23C351 320.49 349.34 320.12 349 320.56H349.01Z" fill="#5BC4BD"></path> + <path d="M346.16 330.37C346.11 330.93 347.12 331.94 347.72 331.71C348.57 331.39 349.01 330.88 348.35 329.94C347.69 329 346.2 329.81 346.16 330.37Z" fill="#5BC4BD"></path> + <path d="M356.25 324.02C355.67 324.13 355.51 324.77 355.74 325.18C355.91 325.48 356.51 326.17 357.17 325.82C357.83 325.47 357.44 324.68 357.28 324.43C357.11 324.17 356.57 323.95 356.25 324.02V324.02Z" fill="#5BC4BD"></path> + <path d="M364 313.4C363.89 313.61 364.09 314.17 364.31 314.3C364.53 314.42 365.06 314.3 365.24 314.09C365.38 313.93 365.43 313.19 365.14 312.96C364.85 312.73 364.11 313.19 364 313.41V313.4Z" fill="#5BC4BD"></path> + <path d="M319.08 353.34C318.79 353.46 318.73 353.92 318.8 354.13C318.87 354.34 319.37 354.82 319.64 354.69C319.91 354.56 319.95 353.88 319.84 353.69C319.73 353.49 319.36 353.21 319.07 353.34H319.08Z" fill="#5BC4BD"></path> + <path d="M345.18 319.6C345.18 319.84 345.36 320.23 345.64 320.32C345.92 320.41 346.24 320 346.31 319.77C346.37 319.59 346.18 318.97 345.83 318.89C345.48 318.81 345.17 319.4 345.17 319.6H345.18Z" fill="#5BC4BD"></path> + <path d="M347.51 337.95C347.06 338.22 347.31 338.72 347.43 338.92C347.52 339.08 348.03 339.19 348.18 339.08C348.37 338.94 348.53 338.49 348.44 338.3C348.35 338.12 347.97 337.68 347.52 337.95H347.51Z" fill="#5BC4BD"></path> + <path d="M285.35 347.25C285.54 347.42 285.8 347.67 286.14 347.49C286.48 347.31 286.42 346.96 286.33 346.84C286.18 346.64 285.86 346.24 285.45 346.38C285.04 346.52 285.24 347.15 285.34 347.24L285.35 347.25Z" fill="#5BC4BD"></path> + <path d="M319.77 323.06C320.14 322.97 321 323.22 321.34 322.61C321.68 322 320.39 320.32 320.07 320.17C319.75 320.03 318.75 320.01 318.84 319.29C318.93 318.57 319.57 317.91 319.22 317.21C318.87 316.51 318.16 314.88 316.94 314.9C315.79 314.93 316.04 315.96 315.6 316.49C315.16 317.02 315.01 317.96 315.65 318.61C316.29 319.26 317.21 319.57 317.39 319.99C317.57 320.41 317.62 320.97 316.95 321.17C316.28 321.37 315.7 322.33 316.2 323.68C316.71 325.03 318.54 325.44 319.14 324.57C319.74 323.7 319.39 323.13 319.76 323.04L319.77 323.06Z" fill="#5BC4BD"></path> + <path d="M302.49 333.55C301.95 333.66 301.68 334.21 301.86 334.82C302.15 335.81 302.65 336.37 303.15 336.26C303.68 336.14 304.37 334.99 304.25 334.42C304.15 333.93 303.12 333.42 302.49 333.55V333.55Z" fill="#5BC4BD"></path> + <path d="M273.18 336.51C272.98 336.66 272.62 336.83 272.76 337.22C272.91 337.6 273.26 337.55 273.39 337.49C273.61 337.38 274.14 337.06 274.01 336.72C273.88 336.38 273.3 336.43 273.18 336.52V336.51Z" fill="#5BC4BD"></path> + <path d="M285.8 311.57C286.02 312.45 286.5 312.9 287.07 312.76Z" fill="#5BC4BD"></path> + <path d="M268.71 330.94C269.58 330.34 269.94 329.42 269.92 328.39C269.92 328.06 269.69 327.63 269.42 327.42C268.38 326.57 267.18 326.66 266.21 327.59C266.02 327.78 265.83 327.97 265.62 328.16C265.26 327.78 264.94 327.39 264.58 327.07C263.88 326.45 263.39 326.46 262.7 327.07C262.06 327.63 261.85 328.35 262.1 329.15C262.35 329.94 263.03 330.22 263.77 330.26C264.3 330.29 264.84 330.11 265.4 330.03C265.58 330.21 265.76 330.42 265.97 330.59C266.75 331.23 268 331.44 268.72 330.94H268.71Z" fill="#5BC4BD"></path> + <path d="M344.62 316.56C344.31 315.75 343.84 314.98 343.32 314.28C342.77 313.53 341.26 313.42 340.44 313.9C339.95 314.19 339.66 314.61 339.86 315.12C340.36 316.44 340.99 317.7 342.18 318.55C342.39 318.7 342.69 318.74 342.8 318.78C344.27 318.94 345.12 317.86 344.61 316.55L344.62 316.56Z" fill="#5BC4BD"></path> + <path d="M305.53 318.31C304.85 316.96 303.43 316.43 302.23 317.08C301.32 317.57 300.97 318.34 301.18 319.27C301.09 319.3 301 319.33 300.92 319.37C300.05 319.86 299.68 321.3 300.17 322.32C300.63 323.28 302.22 323.86 303.15 323.41C304.05 322.97 304.61 322.02 304.57 321.17C305.5 320.56 305.97 319.2 305.52 318.3L305.53 318.31Z" fill="#5BC4BD"></path> + <path d="M299.97 312.46C300.17 312.83 300.54 313.09 300.97 313.24C300.77 313.61 300.76 314.11 300.99 314.55C301.31 315.16 302.09 315.42 302.65 315.1C303.22 314.77 303.45 313.8 303.09 313.23C303.05 313.16 302.99 313.1 302.94 313.04" fill="#5BC4BD"></path> + <path d="M298.05 317.11C297.56 316.17 295.93 315.89 294.7 316.52C293.79 316.98 293.45 318.12 294.03 319.04C295 320.57 295.57 320.52 297.21 319.91C298.23 319.53 298.58 318.12 298.05 317.1V317.11Z" fill="#5BC4BD"></path> + <path d="M309.93 340.12C310.88 339.75 311.25 338.15 310.68 336.92C310.24 335.97 309.33 335.66 308.35 336.11C307.15 336.66 306.77 337.74 307.33 338.99C307.76 339.96 308.99 340.5 309.94 340.12H309.93Z" fill="#5BC4BD"></path> + <path d="M270.67 321.27C270.31 320.35 269.04 319.58 268.35 319.85C267.4 320.22 266.82 321.51 267.17 322.46C267.5 323.36 268.93 323.82 270.02 323.37C270.74 323.07 271.02 322.17 270.66 321.27H270.67Z" fill="#5BC4BD"></path> + <path d="M311.27 320.91C310.61 321.27 310.47 322.34 310.97 323.23C311.56 324.28 312.29 324.48 313.43 323.88C314.31 323.42 314.81 322.41 314.46 321.76C313.98 320.85 312.23 320.39 311.27 320.91V320.91Z" fill="#5BC4BD"></path> + <path d="M335.17 316.91C336.14 316.38 336.38 315.55 335.85 314.56C335.36 313.65 334.53 313.28 333.86 313.67C332.97 314.19 332.45 315.79 332.93 316.55C333.29 317.13 334.42 317.31 335.17 316.91Z" fill="#5BC4BD"></path> + <path d="M296.84 336.34C296.5 335.73 295.44 335.39 294.85 335.69C294.14 336.05 293.42 337.8 293.74 338.36C294.15 339.06 295.46 339.25 296.42 338.73C297.29 338.27 297.43 337.41 296.83 336.33L296.84 336.34Z" fill="#5BC4BD"></path> + <path d="M260.82 316.65C260.04 317 259.63 318.19 259.98 319.06C260.33 319.92 261.07 320.13 262.18 319.66C262.93 319.34 263.55 318.29 263.33 317.71C263.01 316.89 261.62 316.3 260.82 316.65V316.65Z" fill="#5BC4BD"></path> + <path d="M271.39 315.87C271.79 316.08 272.28 315.99 272.65 315.7C273.33 315.17 273.05 314.44 272.81 313.67C272.02 313.57 271.19 313.29 270.8 314.22C270.77 314.3 270.75 314.39 270.74 314.49C270.09 314.21 269.05 314.15 268.48 314.48C267.9 314.81 267.73 315.51 268.08 316.18C268.59 317.17 269.6 317.63 270.33 317.23C270.91 316.91 271.28 316.4 271.39 315.88V315.87Z" fill="#5BC4BD"></path> + <path d="M323.24 335.52C323.92 335.17 324.32 333.78 323.96 333.03C323.67 332.41 322.29 332.08 321.6 332.47C321.06 332.77 320.71 333.68 320.94 334.18C321.46 335.3 322.49 335.9 323.23 335.52H323.24Z" fill="#5BC4BD"></path> + <path d="M297.36 333.91C298.48 333.29 298.96 332.41 298.57 331.72C298.2 331.05 296.74 330.71 296.05 331.14C295.54 331.46 295.28 332.84 295.62 333.41C295.94 333.94 296.84 334.2 297.35 333.91H297.36Z" fill="#5BC4BD"></path> + <path d="M253.35 318.6C252.58 318.89 252.02 319.94 252.29 320.58C252.63 321.39 253.73 321.99 254.43 321.75C255.16 321.5 255.43 320.36 255.02 319.29C254.81 318.74 253.94 318.38 253.35 318.6V318.6Z" fill="#5BC4BD"></path> + <path d="M298.97 344.97C298.43 345.23 297.94 346.36 298.18 346.78C298.51 347.36 299.64 347.7 300.21 347.38C300.78 347.06 300.97 346.3 300.63 345.67C300.3 345.07 299.48 344.72 298.97 344.97V344.97Z" fill="#5BC4BD"></path> + <path d="M323.76 342.91C322.95 343.14 322.47 344.09 322.71 344.71C322.95 345.33 323.93 345.75 324.51 345.47C325.06 345.21 325.27 344.17 324.81 343.12C324.57 343.06 324.11 342.81 323.76 342.91Z" fill="#5BC4BD"></path> + <path d="M300.98 342.06C301.25 342.12 301.79 341.69 301.93 341.36C302.07 341.03 301.97 340.47 301.76 340.16C301.62 339.95 301.06 339.88 300.75 339.96C300.13 340.12 299.55 340.41 298.96 340.68C298.46 340.91 298.41 341.31 298.7 341.84C298.86 341.89 299.1 342.06 299.25 342C299.86 341.75 300.38 341.93 300.98 342.06V342.06Z" fill="#5BC4BD"></path> + <path d="M303.24 327.19C302.93 326.74 301.61 326.54 301.12 326.87C300.71 327.15 300.62 328.3 300.98 328.83C301.29 329.29 301.9 329.33 302.39 328.93C303.19 328.28 303.52 327.61 303.23 327.19H303.24Z" fill="#5BC4BD"></path> + <path d="M331.98 345.98C331.56 346.2 331.35 347.36 331.62 347.94C331.91 348.57 332.62 348.78 333.28 348.44C333.92 348.11 334.14 347.53 333.86 346.96C333.5 346.25 332.48 345.71 331.98 345.98V345.98Z" fill="#5BC4BD"></path> + <path d="M312.56 314.79C312.29 314.39 311.77 313.91 311.35 313.89C310.39 313.86 309.88 314.75 309.99 315.49C309.68 315.14 309.42 314.76 309.23 314.29C309.11 313.98 308.55 313.71 308.17 313.68C307.56 313.63 306.99 313.47 306.4 313.32C305.6 313.12 304.79 313.58 304.59 314.29C304.29 315.33 304.53 315.96 305.51 316.26C306.03 316.42 306.62 316.35 307.27 316.4C307.35 316.71 307.44 317.02 307.52 317.33C307.68 317.93 308.13 318.26 308.69 318.3C309.45 318.35 309.92 317.84 310.3 317.23C310.53 316.87 310.59 316.5 310.48 316.17C310.94 316.44 311.61 316.5 312.13 316.2C312.66 315.9 312.89 315.3 312.54 314.78L312.56 314.79Z" fill="#5BC4BD"></path> + <path d="M291.32 311.96C290.81 312.04 290.42 312.34 290.3 312.51C289.87 313.08 290.07 313.61 290.3 314.16C290.49 314.67 290.52 315.22 291.2 315.48C291.99 315.78 292.96 315.04 293.15 314.19C293.23 313.81 293.15 313.34 292.97 312.93C293.68 312.55 293.96 311.79 293.61 311.16" fill="#5BC4BD"></path> + <path d="M275.14 322.68C275.15 321.96 275.11 321.22 274.3 320.95C273.67 320.74 273.04 321.04 272.85 321.68C272.73 322.07 272.81 322.74 273.07 322.97C273.75 323.57 274.48 323.26 275.14 322.69V322.68Z" fill="#5BC4BD"></path> + <path d="M318.92 328.73C318.62 328.19 317.95 328 317.35 328.28C316.7 328.58 316.46 329.15 316.72 329.76C317 330.42 317.75 330.72 318.34 330.42C318.93 330.12 319.22 329.28 318.92 328.73V328.73Z" fill="#5BC4BD"></path> + <path d="M305.63 327.87C306.21 328.38 306.82 328.86 307.47 328.2C308.09 327.57 307.76 326.93 307.24 326.41C306.27 326.39 305.73 326.77 305.63 327.87V327.87Z" fill="#5BC4BD"></path> + <path d="M282.83 349.77C282.52 350.43 283.9 351.48 284.65 351.2C285.4 350.92 285.9 349.89 285.53 349.37C285.16 348.85 283.13 349.11 282.83 349.77Z" fill="#5BC4BD"></path> + <path d="M338.77 323.18C339.12 323.16 339.84 322.2 339.59 321.7C339.32 321.16 338.62 320.94 338.04 321.23C337.51 321.49 337.27 322.14 337.68 322.59C337.98 322.92 338.42 323.21 338.77 323.18V323.18Z" fill="#5BC4BD"></path> + <path d="M341.01 323.3C340.68 323.62 340.4 324.18 340.42 324.63C340.44 325.12 341.44 325.41 341.89 325.05C342.19 324.82 342.29 324.34 342.4 324.13C342.03 323.29 341.38 322.94 341.01 323.3V323.3Z" fill="#5BC4BD"></path> + <path d="M296.6 349.1C296.03 349.33 295.72 350.05 295.99 350.57C296.3 351.16 296.85 351.23 297.38 350.99C297.87 350.77 298.05 350.32 297.86 349.77C297.65 349.18 297.11 348.89 296.6 349.09V349.1Z" fill="#5BC4BD"></path> + <path d="M284.63 322.93C284.27 322.89 283.76 322.71 283.32 322.83C282.76 322.97 282.65 323.52 282.89 324.02C283.1 324.46 283.41 324.88 284.02 324.66C284.55 324.47 284.92 323.7 284.63 322.94V322.93Z" fill="#5BC4BD"></path> + <path d="M334.04 338.3C334.25 338.94 335.32 338.86 335.85 339.1C335.95 339.01 336.05 338.92 336.15 338.83C336.45 338.14 336.33 337.92 336.03 337.44C335.73 336.96 335.37 336.78 335.21 336.73C334.87 337.19 333.84 337.66 334.05 338.3H334.04Z" fill="#5BC4BD"></path> + <path d="M322.22 339.09C321.67 339.28 321.76 339.87 322 340.34C322.28 340.88 322.98 341.12 323.34 340.74C323.61 340.45 324.34 339.85 323.91 339.29C323.48 338.73 322.63 338.95 322.22 339.09V339.09Z" fill="#5BC4BD"></path> + <path d="M302.38 354.18C302.26 354.52 302.85 355.15 303.17 355.61C303.26 355.73 303.46 356.04 303.9 355.8C304.34 355.56 304.65 354.45 304.22 353.91C303.79 353.37 302.67 353.41 302.39 354.18H302.38Z" fill="#5BC4BD"></path> + <path d="M323.88 318.15C324.26 318.94 325.38 319.49 326.09 319.23C326.97 318.9 327.55 317.39 327.12 316.56C326.83 316 325.73 315.82 324.89 316.19C324.04 316.57 323.56 317.49 323.88 318.16V318.15Z" fill="#5BC4BD"></path> + <path d="M322.03 325.82C320.77 326.26 320.84 327.65 320.91 328.37C320.98 329.09 322.61 329.35 323.52 328.68C324.11 328.24 324.18 327.7 323.94 327.09C323.62 326.28 322.66 325.61 322.03 325.83V325.82Z" fill="#5BC4BD"></path> + <path d="M311.36 327.78C310.77 328.16 310.54 328.94 310.89 329.5C311.25 330.08 311.76 330.1 312.32 329.81C312.98 329.47 313.25 328.73 312.92 328.15C312.61 327.59 311.9 327.42 311.35 327.78H311.36Z" fill="#5BC4BD"></path> + <path d="M321.83 316.86C322.35 316.88 322.59 316.12 322.38 315.61C322.12 314.92 321.57 314.81 321.15 315.08C320.81 315.29 320.23 315.73 320.46 316.23C320.69 316.73 321.37 316.84 321.84 316.86H321.83Z" fill="#5BC4BD"></path> + <path d="M327.79 332.93C327.33 333.25 327.37 334.29 327.53 334.66C327.76 335.19 328.38 335.29 328.96 334.98C329.56 334.66 329.48 334.1 329.19 333.72C328.95 333.4 328.25 332.61 327.79 332.93V332.93Z" fill="#5BC4BD"></path> + <path d="M325.37 338.44C325.12 338.7 324.94 339.21 325.01 339.55C325.12 340.07 326.11 340.3 326.52 339.9C326.77 339.66 326.81 339.21 326.89 339.03C326.45 338.28 325.74 338.05 325.38 338.44H325.37Z" fill="#5BC4BD"></path> + <path d="M350.27 315.14C350.45 314.69 348.58 313.59 348.07 313.79C347.56 313.99 347.68 315.21 348.41 315.83C349.14 316.45 350.09 315.59 350.27 315.14Z" fill="#5BC4BD"></path> + <path d="M272.45 331.35C272.27 331.95 272.58 332.24 273.85 332.58C274.75 332.08 274.31 330.88 273.77 330.68C273.32 330.51 272.6 330.88 272.46 331.36L272.45 331.35Z" fill="#5BC4BD"></path> + <path d="M263.51 334.68C263.33 335.28 263.95 336.24 264.91 335.91C265.81 335.41 265.37 334.21 264.83 334.01C264.38 333.84 263.66 334.21 263.52 334.69L263.51 334.68Z" fill="#5BC4BD"></path> + <path d="M344.25 330.98C344.18 330.73 343.77 330.1 343.23 330.26C342.69 330.42 342.87 331.24 342.99 331.47C343.11 331.71 343.47 332.12 343.9 331.92C344.33 331.72 344.33 331.23 344.25 330.97V330.98Z" fill="#5BC4BD"></path> + <path d="M317.62 351.21C317.6 351.07 317.18 350.67 316.86 350.8C316.54 350.93 316.67 351.54 316.76 351.77C316.81 351.91 317.21 352.12 317.42 352.02C317.63 351.92 317.67 351.46 317.63 351.21H317.62Z" fill="#5BC4BD"></path> + <path d="M335.44 335.45C335.32 335.33 335.18 335.12 335 335.18C334.82 335.24 334.9 335.43 334.83 335.6C335.01 335.68 335.15 335.79 335.27 335.77C335.34 335.77 335.47 335.48 335.44 335.45V335.45Z" fill="#5BC4BD"></path> + <path d="M287.2 328.87C287.3 329.23 287.52 329.33 287.87 329.21C288.19 329.1 288.31 328.92 288.21 328.58C288.11 328.24 287.92 328.1 287.55 328.21C287.2 328.32 287.07 328.52 287.2 328.87V328.87Z" fill="#5BC4BD"></path> + <path d="M282.68 322.15C283.1 321.68 283.3 321.13 283.34 320.57C283.4 319.81 283.04 319.13 282.43 318.48C281.81 317.83 281.83 316.9 281 316.56C279.87 316.1 277.92 315.93 276.6 317.57C275.8 318.56 275.61 319.5 275.85 320.38C276.13 321.4 277.48 321.43 278.16 322.3C279.76 324.36 281.5 323.46 282.68 322.14V322.15Z" fill="#5BC4BD"></path> + <path d="M281.85 313.9C282.53 314.52 284.26 314.25 284.73 313.46Z" fill="#5BC4BD"></path> + <path d="M289.86 318.74C289.79 317.85 288.87 316.36 287.27 316.85C285.67 317.34 284.99 318.53 285.24 319.54C285.49 320.56 287.22 321.6 288.31 321.25C289.71 320.8 289.93 319.63 289.85 318.74H289.86Z" fill="#5BC4BD"></path> + <path d="M333.4 322.55C331.59 322.44 331.81 324.3 330.71 323.81C329.61 323.32 330.54 322.53 328.96 321.95C327.38 321.37 325.93 322.37 326.18 323.54C326.43 324.71 327.46 324.94 327.44 325.22C327.42 325.5 326.98 326.7 327.88 327.02C329.77 327.69 329.93 325.85 330.55 325.87C331.17 325.89 332.17 326.67 333.08 326.78C334.36 326.94 335.59 326.37 335.61 325C335.63 323.41 334.66 322.64 333.41 322.56L333.4 322.55Z" fill="#5BC4BD"></path> + <path d="M288.3 338.23C288.79 338 288.92 337.75 289.04 337.43C289.16 337.11 289.42 336.83 289.34 336.28C289.26 335.73 288.84 334.74 288.07 334.4C287.3 334.06 286.6 334.16 286.03 334.58C285.47 335 285.37 335.69 285.44 336.16C285.51 336.63 285.83 337.48 286.48 337.71C287.13 337.94 287.76 338.48 288.3 338.22V338.23Z" fill="#5BC4BD"></path> + <path d="M292.94 331.41C293.12 331.14 293.08 330.79 292.88 330.6C292.68 330.41 292.12 330.42 291.9 330.62C291.68 330.82 291.86 331.3 292.08 331.48C292.26 331.64 292.77 331.68 292.94 331.41Z" fill="#5BC4BD"></path> + <path d="M280.62 329.97C279.9 329.83 278.81 329.66 278.65 330.67C278.49 331.68 279.13 331.91 279.44 331.93C279.75 331.95 280.17 332.44 279.83 332.53C279.49 332.62 279.29 333 279.5 333.84C279.71 334.68 280.16 335.08 281.04 334.99C282.01 334.9 282.73 333.85 282.58 332.81C282.43 331.76 281.81 331.68 281.78 331C281.74 330.32 281.34 330.11 280.63 329.97H280.62Z" fill="#5BC4BD"></path> + <path d="M282.34 342.09C281.49 342.25 280.51 342.17 279.82 342.99C279.83 343.38 279.84 343.8 279.85 344.21C278.95 344.93 278.48 345.93 278.83 346.5C279.12 346.97 279.6 347.17 280.17 347.02C281.18 346.76 281.42 346.38 281.41 345.13C282.01 344.52 282.61 344.02 283.06 343.42C283.51 342.82 283.06 341.95 282.34 342.08V342.09Z" fill="#5BC4BD"></path> + <path d="M308.72 324.63C309.31 324.35 309.54 323.73 309.27 323.13C308.98 322.48 308.43 322.25 307.81 322.51C307.15 322.79 306.82 323.5 307.06 324.11C307.3 324.7 308.06 324.94 308.73 324.63H308.72Z" fill="#5BC4BD"></path> + <path d="M334.87 334.5C334.69 333.13 333.53 332.23 332.22 332.45C331.07 332.64 330.36 333.46 330.5 334.44C330.68 335.73 332.16 337.03 333.2 336.81C334.26 336.59 335 335.57 334.86 334.5H334.87Z" fill="#5BC4BD"></path> + <path d="M398.85 325.77C399.96 325.56 400.56 324.82 400.4 323.82C400.25 322.91 399.46 322.14 398.79 322.26C397.8 322.44 396.92 323.7 397.04 324.75C397.12 325.41 398.02 325.92 398.84 325.77H398.85Z" fill="#5BC4BD"></path> + <path d="M349.53 315.17C349.68 315.9 350.37 316.4 351.07 316.29C351.77 316.18 352.32 315.41 352.18 314.76C352.04 314.12 351.2 313.59 350.55 313.74C349.86 313.9 349.4 314.55 349.53 315.17V315.17Z" fill="#5BC4BD"></path> + <path d="M342.69 328.38C343.33 328.31 343.81 327.65 343.72 326.96C343.62 326.22 343.05 325.69 342.42 325.77C341.74 325.85 341.2 326.45 341.25 327.11C341.3 327.81 342.04 328.46 342.69 328.39V328.38Z" fill="#5BC4BD"></path> + <path d="M342.8 333.1C342.83 332.74 342.63 332.25 342.36 332.01C341.81 331.52 341.27 331.72 340.26 332.66C340.5 333.33 340.54 334.2 341.57 334.19C342.23 334.18 342.74 333.77 342.8 333.11V333.1Z" fill="#5BC4BD"></path> + <path d="M368.64 327.42C369.32 327.36 369.9 326.69 369.8 326.06C369.7 325.4 369.04 324.89 368.38 324.95C367.71 325.01 367.33 325.48 367.36 326.2C367.4 326.95 367.94 327.48 368.63 327.42H368.64Z" fill="#5BC4BD"></path> + <path d="M399.6 311.16C400.11 311.98 400.83 311.44 401.58 311.2Z" fill="#5BC4BD"></path> + <path d="M327.65 324.6C327.33 324.15 325.62 324.33 325.47 325.05C325.36 325.61 325.83 326.34 326.35 326.41C327.09 326.51 327.96 325.05 327.65 324.59V324.6Z" fill="#5BC4BD"></path> + <path d="M319.2 318.85C318.68 318.63 317.41 319.27 317.44 319.92C317.48 320.83 317.83 321.41 318.93 321.07C320.03 320.73 319.72 319.07 319.2 318.85V318.85Z" fill="#5BC4BD"></path> + <path d="M389.94 346.46C389.88 346.81 390 347.39 390.25 347.56C390.93 348.03 391.73 347.38 391.87 346.98C392.01 346.58 391.47 345.71 390.66 345.8C390.38 345.83 389.98 346.2 389.93 346.46H389.94Z" fill="#5BC4BD"></path> + <path d="M377.89 330.89C378.14 331.34 378.9 331.59 379.31 331.35C379.89 331 379.66 329.44 379.13 329.33C378.6 329.22 377.56 330.29 377.89 330.89Z" fill="#5BC4BD"></path> + <path d="M406.4 324.56C406.43 325.11 407.59 325.73 407.95 325.51C408.31 325.29 408.37 324.75 408.38 324.3C408.38 323.81 408.05 323.36 407.41 323.51C406.86 323.64 406.36 323.86 406.4 324.56Z" fill="#5BC4BD"></path> + <path d="M381.31 326.17C381.48 327.17 382.4 328.03 383.17 327.91C383.94 327.79 384.87 326.46 384.73 325.67C384.53 324.49 383.74 323.88 382.68 324.11C381.64 324.33 381.13 325.1 381.31 326.16V326.17Z" fill="#5BC4BD"></path> + <path d="M390.74 330.06C391.14 330.06 391.48 329.21 391.54 328.86C391.63 328.34 390.89 327.76 390.44 327.99C390.15 328.14 389.87 328.64 389.89 328.97C389.91 329.28 390.34 330.06 390.74 330.06Z" fill="#5BC4BD"></path> + <path d="M322.12 330.41C322.19 329.82 321.64 329.47 321.17 329.57C320.83 329.64 319.98 330 320.12 330.73C320.26 331.46 321.12 331.34 321.41 331.26C321.71 331.18 322.08 330.73 322.12 330.41Z" fill="#5BC4BD"></path> + <path d="M329.82 341.07C329.65 340.9 329.06 340.92 328.87 341.09C328.68 341.26 328.64 341.8 328.78 342.04C328.88 342.22 329.58 342.49 329.89 342.29C330.2 342.09 329.99 341.24 329.82 341.06V341.07Z" fill="#5BC4BD"></path> + <path d="M329.74 321.26C329.51 321.19 329.08 321.24 328.91 321.47C328.74 321.7 329.03 322.14 329.22 322.28C329.38 322.39 330.02 322.4 330.2 322.1C330.38 321.8 329.92 321.32 329.73 321.26H329.74Z" fill="#5BC4BD"></path> + <path d="M377.37 348.11C377.04 347.69 376.69 347.05 376.06 347.08C375.43 347.11 375.43 347.88 375.53 348.11C375.72 348.56 376.36 349.59 376.83 349.55C377.3 349.51 377.49 348.26 377.37 348.11V348.11Z" fill="#5BC4BD"></path> + <path d="M311.58 317.79C311.46 317.27 310.91 317.37 310.68 317.41C310.5 317.44 310.24 317.9 310.3 318.07C310.38 318.3 310.75 318.58 310.96 318.56C311.16 318.53 311.7 318.31 311.58 317.79V317.79Z" fill="#5BC4BD"></path> + <path d="M345.23 322.77C345.42 323.04 345.57 323.41 345.57 323.73C345.57 325.04 346.25 325.68 347.56 325.54C347.51 325.7 347.49 325.87 347.52 326.01C347.65 326.56 348.42 326.93 349.16 326.8C350.05 326.65 350.66 325.94 350.52 325.23C350.39 324.56 349.74 324.15 349.02 324.29C349.09 323.93 349.05 323.52 348.89 323.07C348.68 322.48 348.5 321.99 348.73 321.36C349.06 320.43 348.53 319.65 348.03 318.94C347.57 318.29 346.43 318.08 345.63 318.37C345.55 318.4 345.48 318.43 345.41 318.46C345.72 318.01 345.91 317.44 345.82 316.95C345.69 316.18 344.84 315.76 343.73 315.91C342.89 316.03 342.07 316.84 342.15 317.49C342.27 318.39 343.4 319.37 344.22 319.29C344.34 319.28 344.46 319.24 344.57 319.19C344.41 319.47 344.32 319.8 344.31 320.21C344.27 321.23 344.69 321.99 345.24 322.76L345.23 322.77Z" fill="#5BC4BD"></path> + <path d="M374.23 317.4C373.68 317.8 373.6 318.77 374.06 319.67C374.21 319.96 374.38 320.23 374.55 320.52C374.14 321.22 373.63 321.92 373.68 322.66C373.49 322.7 373.3 322.75 373.12 322.82C372.25 323.13 371.67 324.77 372.14 325.56C372.61 326.35 374.31 326.88 375.31 326.03C375.91 325.52 376.19 324.96 376.25 324.41C376.36 324.41 376.47 324.41 376.58 324.39C377.9 324.28 378.27 323.36 378.43 322.23C379.15 322.23 379.94 322.6 380.26 321.61C380.46 320.99 380.25 320.49 379.76 320.18C378.89 319.64 378.38 320.32 377.88 320.91C377.47 320.7 377.09 320.52 376.7 320.32C376.95 319.75 377.17 319.27 377.4 318.75C377.11 318.35 376.9 317.95 376.59 317.66C376.08 317.19 374.68 317.07 374.25 317.38L374.23 317.4Z" fill="#5BC4BD"></path> + <path d="M332.81 321.67C333.67 321.62 334.55 321.41 335.38 321.14C336.26 320.85 336.84 319.45 336.63 318.52C336.51 317.96 336.2 317.56 335.65 317.59C334.24 317.66 332.85 317.86 331.67 318.74C331.46 318.9 331.33 319.16 331.26 319.26C330.66 320.61 331.42 321.75 332.82 321.67H332.81Z" fill="#5BC4BD"></path> + <path d="M384.36 330.71C382.89 330.56 382.05 331.64 382.56 332.95C382.87 333.76 383.35 334.52 383.87 335.22C384.42 335.96 385.93 336.08 386.75 335.59C387.24 335.3 388.03 334.3 387.22 333.47C385.34 332.9 386.2 331.79 385 330.94C384.79 330.79 384.49 330.75 384.38 330.71H384.36Z" fill="#5BC4BD"></path> + <path d="M341.78 345.91C341.66 344.79 340.31 343.88 339.06 344.09C337.96 344.28 336.89 345.67 337.06 346.71C337.27 348.02 338.47 349.06 339.53 348.85C340.58 348.65 341.89 346.93 341.78 345.9V345.91Z" fill="#5BC4BD"></path> + <path d="M389.05 313.71C388.21 313.85 387.11 315.28 387.22 316.09C387.34 316.96 388.35 317.66 389.31 317.56C390.24 317.45 391.15 316.37 391.03 315.51C390.89 314.48 389.88 313.57 389.05 313.71Z" fill="#5BC4BD"></path> + <path d="M378.07 342.01C378.25 343.06 379.01 343.76 379.8 343.59C380.83 343.37 381.67 342.18 381.56 341.1C381.48 340.36 380.39 339.77 379.47 339.96C378.4 340.18 377.89 340.93 378.07 342.02V342.01Z" fill="#5BC4BD"></path> + <path d="M335.4 312.57C335.6 313.66 336.32 314.15 337.42 313.95C338.44 313.77 339.05 313.09 338.88 312.33" fill="#5BC4BD"></path> + <path d="M356 327.36C356.89 327.19 357.76 325.83 357.62 324.82C357.51 323.98 356.81 323.52 355.83 323.64C354.66 323.78 354.16 324.47 354.34 325.69C354.49 326.7 355.28 327.5 356 327.37V327.36Z" fill="#5BC4BD"></path> + <path d="M394.46 318.26C394.57 319.04 395.85 319.91 396.71 319.79C397.37 319.7 398.13 318.55 398.05 317.77C397.99 317.12 397.19 316.41 396.6 316.48C395.27 316.64 394.34 317.41 394.46 318.26V318.26Z" fill="#5BC4BD"></path> + <path d="M391.02 325.94C391.15 326.81 391.7 327.36 392.39 327.29C393.15 327.22 394.31 325.93 394.23 325.25C394.11 324.27 393.31 323.76 392.16 323.91C391.28 324.03 390.85 324.79 391.02 325.94Z" fill="#5BC4BD"></path> + <path d="M405.32 312.15C404.68 312.24 404.11 313.12 404.27 313.78C404.49 314.68 405.29 315.36 405.99 315.24C406.85 315.09 407.79 313.98 407.68 313.25C407.58 312.61 406.3 312.01 405.33 312.15H405.32Z" fill="#5BC4BD"></path> + <path d="M345.19 332.55C345.25 333.34 346.09 333.83 347.2 333.72C348.06 333.64 348.59 333.08 348.48 332.36C348.37 331.61 347.26 330.51 346.66 330.55C345.73 330.61 345.11 331.45 345.2 332.54L345.19 332.55Z" fill="#5BC4BD"></path> + <path d="M348.81 312.54C348.88 313.22 349.36 313.61 350.03 313.53C351.35 313.36 352.14 312.69 352.03 311.83" fill="#5BC4BD"></path> + <path d="M381.62 317.85C381.69 318.59 382.76 319.38 383.57 319.29C384.2 319.22 384.59 318.7 384.53 318C384.46 317.14 383.71 316.42 382.92 316.45C382.19 316.48 381.56 317.16 381.62 317.86V317.85Z" fill="#5BC4BD"></path> + <path d="M370.37 333.23C369.76 333.37 369.25 334.26 369.42 334.91C369.58 335.54 370.29 335.97 370.95 335.83C371.62 335.7 371.98 335.11 371.87 334.34C371.75 333.55 371.1 333.07 370.37 333.23Z" fill="#5BC4BD"></path> + <path d="M393.53 340.28C393.65 341 394.31 341.46 395.09 341.37C395.84 341.28 396.3 340.63 396.17 339.84C396.08 339.23 395.38 338.74 394.72 338.83C393.9 338.94 393.4 339.55 393.52 340.28H393.53Z" fill="#5BC4BD"></path> + <path d="M393.1 311.41C393.27 312.07 393.9 312.45 394.61 312.24C395.17 312.07 395.8 311.89 395.71 311.29" fill="#5BC4BD"></path> + <path d="M402.09 321.64C402.2 322.31 403 322.86 403.68 322.73C404.3 322.62 404.69 322.07 404.62 321.42C404.53 320.6 403.92 320.09 403.18 320.21C402.55 320.32 402 321.04 402.1 321.63L402.09 321.64Z" fill="#5BC4BD"></path> + <path d="M404.61 335.17C405.22 335.08 405.77 334.3 405.64 333.71C405.51 333.12 404.77 332.6 404.16 332.68C403.52 332.76 403.09 333.3 403.16 333.93C403.25 334.69 403.93 335.27 404.62 335.17H404.61Z" fill="#5BC4BD"></path> + <path d="M365.31 313.09C364.82 312.74 364.22 312.68 363.86 313.2C363.59 313.6 363.33 314.25 363.48 314.64C363.65 315.1 363.96 315.27 364.33 315.31C363.91 316.11 364.04 317.16 364.38 318.11C364.59 318.7 364.98 319.14 365.45 319.44C366.09 319.85 366.86 319.86 367.72 319.63C368.59 319.39 369.39 319.85 370.09 319.28C371.03 318.51 372.1 316.87 371.29 314.93C370.8 313.75 370.06 313.15 369.18 312.94C368.15 312.7 367.48 313.88 366.39 314.06C366.19 314.09 366.01 314.14 365.84 314.19C365.88 313.78 365.76 313.41 365.31 313.09V313.09Z" fill="#5BC4BD"></path> + <path d="M339.63 325.42C339.92 325.62 340.65 325.53 340.95 325.28C341.69 324.66 341.39 323.43 340.76 323.05C340.13 322.67 339.04 323.05 338.93 324.11C338.88 324.53 339.26 325.17 339.63 325.42Z" fill="#5BC4BD"></path> + <path d="M413.51 313.81C413.6 314.43 414.32 314.87 415.02 314.74C415.7 314.61 416.06 314.02 415.94 313.24C415.81 312.43 415.36 311.97 414.83 312.09C414.19 312.24 413.43 313.23 413.52 313.81H413.51Z" fill="#5BC4BD"></path> + <path d="M372.83 338.42C372.86 339.07 373.51 339.57 374.21 339.48C374.97 339.39 375.44 338.86 375.36 338.18C375.28 337.47 374.68 336.98 374.02 337.06C373.41 337.13 372.8 337.83 372.83 338.42Z" fill="#5BC4BD"></path> + <path d="M398.67 328.69C398 328.72 397.47 329.31 397.5 330.01C397.53 330.74 397.94 331.12 398.65 331.06C399.43 331 399.91 330.49 399.87 329.79C399.83 329.18 399.26 328.66 398.67 328.69Z" fill="#5BC4BD"></path> + <path d="M328.32 314.06C328.24 314.4 328.92 315.38 329.48 315.3C330.08 315.21 330.5 314.61 330.41 313.98C330.33 313.4 329.78 312.97 329.22 313.21C328.81 313.39 328.4 313.72 328.32 314.06V314.06Z" fill="#5BC4BD"></path> + <path d="M327.52 316.15C327.32 315.74 326.87 315.3 326.44 315.18C325.97 315.05 325.38 315.9 325.58 316.45C325.71 316.8 326.13 317.05 326.3 317.21C327.22 317.11 327.75 316.6 327.52 316.15V316.15Z" fill="#5BC4BD"></path> + <path d="M375.28 327.28C375.03 327.17 374.43 327.28 374.33 327.48C374.14 327.85 373.99 328.45 374.16 328.77C374.52 329.42 375.17 329.15 375.72 328.94C376.05 328.23 376.01 327.6 375.28 327.28Z" fill="#5BC4BD"></path> + <path d="M360.33 339.08C360.59 339.75 360.75 340.46 360.96 341.14C360.89 341.98 361.37 342.42 362.06 342.41C362.8 342.4 363.27 341.88 363.38 341.04C363.44 340.59 363.47 340.09 363.7 339.72C364.15 338.99 364.25 338.28 363.79 337.58C363.43 337.05 361.8 336.94 361.19 337.36C360.61 337.76 359.98 338.15 360.34 339.07L360.33 339.08Z" fill="#5BC4BD"></path> + <path d="M358.59 331.27C359.35 331.21 359.79 330.71 359.72 329.97C359.64 329.2 358.98 328.63 358.28 328.73C357.66 328.82 357.25 329.49 357.36 330.23C357.45 330.87 357.98 331.31 358.6 331.26L358.59 331.27Z" fill="#5BC4BD"></path> + <path d="M352.57 334.29C352.65 334.91 353.17 335.32 353.69 335.07C354.07 334.89 354.34 334.5 354.56 334.3C354.39 333.5 353.69 333.14 353.09 333.28C352.52 333.42 352.51 333.85 352.56 334.29H352.57Z" fill="#5BC4BD"></path> + <path d="M354.35 339.96C354.18 339.16 353.48 338.8 352.88 338.94C352.31 339.08 352.3 339.51 352.35 339.95C352.43 340.57 352.95 340.98 353.47 340.73C353.85 340.55 354.12 340.16 354.34 339.96H354.35Z" fill="#5BC4BD"></path> + <path d="M369.69 340.1C369.69 339.5 369.1 338.8 368.6 338.99C368.19 339.15 367.24 339.61 367.35 340.21C367.46 340.82 368.33 340.89 368.71 340.93C369.19 340.97 369.67 340.75 369.68 340.1H369.69Z" fill="#5BC4BD"></path> + <path d="M332.42 327.48C332.8 327.79 334.42 326.35 334.38 325.8C334.35 325.25 333.15 324.99 332.33 325.49C331.51 325.99 332.04 327.16 332.41 327.47L332.42 327.48Z" fill="#5BC4BD"></path> + <path d="M411.42 330.91C411.4 331.27 412.22 332.49 412.85 332.41C413.48 332.34 413.72 330.84 413.64 330.31C413.58 329.92 412.96 329.24 412.34 329.31C411.72 329.38 411.45 330.36 411.41 330.91H411.42Z" fill="#5BC4BD"></path> + <path d="M319.21 316.85C319.47 316.85 320.2 316.67 320.21 316.11C320.22 315.55 319.39 315.46 319.13 315.51C318.86 315.55 318.37 315.77 318.42 316.23C318.47 316.69 318.94 316.85 319.21 316.86V316.85Z" fill="#5BC4BD"></path> + <path d="M419.86 312.01C419.84 312.19 420.26 312.79 420.47 312.76C420.68 312.73 420.92 312.12 420.93 311.86C420.93 311.72 420.53 311.39 420.43 311.43C420.19 311.53 419.88 311.78 419.85 312L419.86 312.01Z" fill="#5BC4BD"></path> + <path d="M369.64 348.22C369.64 348.08 369.39 347.74 369.14 347.79C368.89 347.84 368.59 348.14 368.56 348.36C368.54 348.54 368.85 349.14 369.17 349.11C369.49 349.09 369.62 348.47 369.63 348.21L369.64 348.22Z" fill="#5BC4BD"></path> + <path d="M416.42 322.15C416.51 322.51 417.05 322.7 417.26 322.67C417.47 322.64 417.76 322.27 417.76 322.04C417.76 321.85 417.38 321.51 417.19 321.52C416.96 321.53 416.33 321.78 416.42 322.14V322.15Z" fill="#5BC4BD"></path> + <path d="M349.23 341.56C349.2 341.25 348.79 341.05 348.57 341.05C348.35 341.05 347.74 341.38 347.78 341.68C347.82 341.98 348.45 342.22 348.66 342.18C348.88 342.14 349.26 341.87 349.24 341.56H349.23Z" fill="#5BC4BD"></path> + <path d="M353.88 350.74C354.02 350.76 354.53 350.49 354.5 350.14C354.47 349.79 353.86 349.73 353.61 349.74C353.46 349.74 353.14 350.06 353.17 350.29C353.2 350.52 353.63 350.7 353.88 350.74Z" fill="#5BC4BD"></path> + <path d="M417.53 314.4C417.58 314.63 417.85 314.68 417.97 314.66C418.09 314.64 418.22 314.36 418.19 314.26C418.16 314.15 418.02 313.96 417.86 313.98C417.7 314 417.49 314.17 417.54 314.4H417.53Z" fill="#5BC4BD"></path> + <path d="M385.81 340.68C385.78 340.57 385.64 340.38 385.48 340.4C385.31 340.42 385.11 340.59 385.16 340.82C385.21 341.05 385.48 341.1 385.6 341.08C385.72 341.07 385.85 340.78 385.82 340.68H385.81Z" fill="#5BC4BD"></path> + <path d="M361.52 332.41C362.07 332.88 363.17 333.04 363.77 332.63C364.62 332.05 364.49 331.03 364.36 330.72C365.44 330.44 366.28 329.36 366.13 328.36C365.98 327.34 365.39 326.61 364.6 326.34C364.99 326.1 365.3 325.71 365.42 325.1C365.75 323.46 365.03 322.3 364.01 322.04C363.33 321.86 362.33 322.26 361.68 322.89C361.49 322.33 361.01 321.98 360.44 322.05C359.84 322.12 359.36 322.81 359.43 323.5C359.5 324.18 360.11 324.7 360.77 324.63C360.85 324.63 360.93 324.6 361.01 324.58C361.08 325.61 361.84 326.19 362.52 326.49C362.57 326.51 362.62 326.53 362.67 326.55C362.01 326.96 361.71 327.73 361.84 328.79C361.89 329.19 362 329.53 362.15 329.82C361.87 329.8 361.6 329.85 361.31 330.1C360.67 330.65 360.86 331.86 361.52 332.43V332.41Z" fill="#5BC4BD"></path> + <path d="M376.03 311.19C376.28 311.55 375.43 313.36 376.44 314.48C377.45 315.6 378.91 315.4 379.98 314.64" fill="#5BC4BD"></path> + <path d="M357.6 311.83C357.69 311.82 357.79 311.79 357.88 311.75C357.42 312.29 357.17 313.06 357.3 313.81C357.35 314.1 357.45 314.35 357.58 314.57C356.64 314.33 355.15 314.77 354.62 315.49C354.09 316.2 354.23 317.52 355.05 318.36C355.59 318.91 356.14 319.3 355.92 320.26C355.76 320.95 356.41 321.27 357.09 321.36C357.84 320.77 357.92 320.12 357.38 319.53C357.96 318.77 358.49 318.27 358.79 317.66C359.08 317.07 358.86 316.04 358.47 315.34C358.91 315.52 359.45 315.56 360.07 315.41C361.79 315 362.23 314.4 362.04 312.94" fill="#5BC4BD"></path> + <path d="M390.31 323.23C390.94 323.1 391.43 322.41 391.34 321.78C391.26 321.18 390.47 320.68 389.85 320.83C389.21 320.98 388.84 321.64 389 322.37C389.14 323.04 389.65 323.38 390.31 323.24V323.23Z" fill="#5BC4BD"></path> + <path d="M359.85 349.22C360.25 348.59 360.2 348.85 360.96 348.89C361.72 348.93 362.8 348.51 362.43 347.21C362.06 345.91 360.58 345.49 359.42 345.7C358.27 345.91 357.15 348.02 357.74 349.32C358.17 350.25 359.45 349.85 359.84 349.22H359.85Z" fill="#5BC4BD"></path> + <path d="M451.62 321.88C450.83 320.87 449.04 320.65 448.05 321.45C447.2 322.14 447.07 323.99 447.81 324.93C448.57 325.89 450.07 325.83 451.33 324.78C452.22 324.04 452.34 322.8 451.62 321.87V321.88Z" fill="#5BC4BD"></path> + <path d="M391.52 313.35C390.63 312.39 389.22 312.39 388.3 313.35C387.6 314.08 387.62 315.44 388.34 316.2C389.07 316.97 390.57 316.8 391.58 315.83C392.3 315.14 392.28 314.15 391.52 313.34V313.35Z" fill="#5BC4BD"></path> + <path d="M423.69 320.7C423.84 319.71 423.4 318.72 422.52 318.42C422.13 318.29 421.53 318.34 421.19 318.56C420.1 319.26 419.76 320.29 420.34 321.79C420.83 321.88 421.36 322.07 421.88 322.06C422.79 322.06 423.59 321.39 423.69 320.7Z" fill="#5BC4BD"></path> + <path d="M452.29 327.55C451.54 328.36 451.51 329.93 452.23 330.72C452.69 331.22 453.89 331.14 454.48 330.57C455.37 329.71 455.42 328.64 454.61 327.84C453.91 327.14 452.8 327 452.29 327.55Z" fill="#5BC4BD"></path> + <path d="M464.63 313.36C463.93 313.96 463.8 314.92 464.35 315.52C465.05 316.3 466.43 316.49 467.01 315.9C467.69 315.21 467.78 313.88 467.18 313.18C466.73 312.64 465.36 312.74 464.63 313.36V313.36Z" fill="#5BC4BD"></path> + <path d="M428.9 322.27C429.73 321.57 429.74 320.96 428.93 320.04C428.21 319.23 427.38 319.05 426.81 319.58C426.29 320.07 426.14 321.86 426.58 322.32C427.21 322.98 428.09 322.96 428.91 322.27H428.9Z" fill="#5BC4BD"></path> + <path d="M432.07 336.43C431.5 337 431.39 337.69 431.78 338.16C432.25 338.72 433.99 338.95 434.47 338.51C435.16 337.87 435.11 337.06 434.32 336.24C433.67 335.56 432.88 335.63 432.07 336.43V336.43Z" fill="#5BC4BD"></path> + <path d="M441.23 333.79C440.65 334.29 440.8 335.45 441.55 336.26C442.02 336.76 442.51 336.69 442.99 336.3C443.69 335.72 443.92 334.61 443.46 334.12C442.95 333.56 441.7 333.38 441.23 333.79V333.79Z" fill="#5BC4BD"></path> + <path d="M458.78 339.54C458.54 339.74 458.62 340.19 458.74 340.38C458.86 340.56 459.48 340.87 459.71 340.67C459.94 340.47 459.77 339.81 459.62 339.66C459.46 339.5 459.02 339.34 458.78 339.54V339.54Z" fill="#5BC4BD"></path> + <path d="M481.57 316.61C481.21 317 481.6 317.4 481.77 317.56C481.9 317.69 482.42 317.64 482.53 317.5C482.67 317.31 482.69 316.83 482.55 316.68C482.41 316.53 481.92 316.22 481.57 316.61V316.61Z" fill="#5BC4BD"></path> + <path d="M424.72 343.42C424.95 343.53 425.27 343.69 425.55 343.42C425.83 343.15 425.66 342.83 425.55 342.74C425.35 342.59 424.93 342.3 424.58 342.55C424.23 342.8 424.6 343.35 424.72 343.41V343.42Z" fill="#5BC4BD"></path> + <path d="M447.5 311.98C448.37 313.13 450.25 312.99 450.57 311.98Z" fill="#5BC4BD"></path> + <path d="M437.2 325.37C436.71 325.64 436.61 326.23 436.96 326.77C437.53 327.63 438.17 328.02 438.61 327.78C439.08 327.52 439.41 326.22 439.13 325.7C438.89 325.26 437.76 325.07 437.2 325.37V325.37Z" fill="#5BC4BD"></path> + <path d="M409.97 336.64C409.82 336.84 409.52 337.11 409.78 337.44C410.03 337.77 410.35 337.61 410.46 337.51C410.64 337.34 411.05 336.88 410.83 336.6C410.61 336.32 410.06 336.53 409.98 336.64H409.97Z" fill="#5BC4BD"></path> + <path d="M404.09 332.59C404.75 331.77 404.83 330.78 404.52 329.8C404.42 329.48 404.08 329.14 403.76 329.01C402.52 328.5 401.4 328.93 400.73 330.1C400.6 330.33 400.47 330.57 400.33 330.82C399.87 330.56 399.46 330.28 399.02 330.08C398.17 329.69 397.71 329.84 397.22 330.61C396.77 331.33 396.77 332.08 397.24 332.78C397.7 333.46 398.44 333.54 399.16 333.36C399.67 333.23 400.14 332.91 400.65 332.67C400.88 332.79 401.11 332.94 401.35 333.04C402.28 333.43 403.54 333.27 404.08 332.59H404.09Z" fill="#5BC4BD"></path> + <path d="M396.23 312.24C396.96 313.09 398.23 313.08 399.15 312.22Z" fill="#5BC4BD"></path> + <path d="M431.83 312.06C431.75 312.11 431.68 312.17 431.61 312.23C430.92 312.95 430.98 314.43 431.74 315.27C432.46 316.06 434.15 316.16 434.91 315.46C435.64 314.78 435.91 313.71 435.63 312.91" fill="#5BC4BD"></path> + <path d="M402.49 311.46C403.24 312.28 405.02 312.41 405.81 311.71Z" fill="#5BC4BD"></path> + <path d="M424.83 311.3C424.09 312.01 424.1 313.19 424.92 313.91C426.29 315.1 426.82 314.88 428.22 313.83" fill="#5BC4BD"></path> + <path d="M446.21 329.51C447.01 328.88 446.91 327.24 446 326.23C445.3 325.45 444.34 325.41 443.53 326.12C442.54 326.99 442.48 328.13 443.38 329.17C444.08 329.98 445.4 330.13 446.2 329.5L446.21 329.51Z" fill="#5BC4BD"></path> + <path d="M403.19 322.77C402.58 322 401.14 321.62 400.56 322.07C399.76 322.7 399.58 324.1 400.18 324.91C400.76 325.68 402.26 325.7 403.17 324.96C403.78 324.47 403.78 323.53 403.18 322.77H403.19Z" fill="#5BC4BD"></path> + <path d="M442.35 313.04C443.22 313.88 443.97 313.85 444.89 312.96Z" fill="#5BC4BD"></path> + <path d="M432.58 329.66C432.08 329.18 430.97 329.15 430.49 329.61C429.92 330.16 429.73 332.05 430.2 332.49C430.8 333.05 432.1 332.84 432.88 332.07C433.58 331.38 433.47 330.51 432.58 329.66V329.66Z" fill="#5BC4BD"></path> + <path d="M392.43 321.17C391.79 321.72 391.73 322.98 392.32 323.72C392.9 324.45 393.67 324.43 394.6 323.66C395.23 323.14 395.52 321.95 395.14 321.46C394.6 320.77 393.09 320.6 392.44 321.17H392.43Z" fill="#5BC4BD"></path> + <path d="M402.32 317.39C402.76 317.48 403.21 317.25 403.48 316.87C403.98 316.17 403.5 315.54 403.05 314.88C402.27 315.01 401.39 314.99 401.28 315.99C401.28 316.07 401.28 316.17 401.3 316.26C400.59 316.17 399.58 316.43 399.14 316.9C398.68 317.38 398.72 318.11 399.24 318.64C400.02 319.44 401.11 319.59 401.69 318.99C402.15 318.52 402.36 317.92 402.32 317.39Z" fill="#5BC4BD"></path> + <path d="M457.63 321.28C458.18 320.75 458.16 319.31 457.61 318.69C457.15 318.18 455.74 318.26 455.19 318.83C454.76 319.27 454.69 320.24 455.05 320.66C455.87 321.58 457.03 321.87 457.63 321.29V321.28Z" fill="#5BC4BD"></path> + <path d="M432.38 327.19C433.27 326.27 433.48 325.3 432.91 324.74C432.36 324.21 430.87 324.3 430.33 324.91C429.93 325.36 430.08 326.76 430.57 327.21C431.03 327.62 431.97 327.61 432.38 327.19V327.19Z" fill="#5BC4BD"></path> + <path d="M385.83 325.19C385.18 325.69 384.95 326.86 385.39 327.39C385.95 328.07 387.17 328.32 387.78 327.89C388.4 327.44 388.34 326.27 387.64 325.37C387.28 324.9 386.34 324.81 385.84 325.19H385.83Z" fill="#5BC4BD"></path> + <path d="M437.11 337.32C436.67 337.73 436.52 338.95 436.87 339.28C437.35 339.74 438.53 339.74 438.98 339.28C439.44 338.81 439.4 338.02 438.89 337.52C438.4 337.04 437.52 336.94 437.1 337.33L437.11 337.32Z" fill="#5BC4BD"></path> + <path d="M460.26 328.2C459.55 328.65 459.36 329.7 459.77 330.23C460.18 330.75 461.24 330.87 461.71 330.44C462.16 330.03 462.06 328.98 461.32 328.11C461.07 328.13 460.56 328.01 460.25 328.21L460.26 328.2Z" fill="#5BC4BD"></path> + <path d="M438.19 333.95C438.46 333.93 438.86 333.36 438.9 333.01C438.94 332.65 438.68 332.14 438.39 331.91C438.19 331.75 437.64 331.84 437.36 332.01C436.81 332.34 436.34 332.79 435.86 333.21C435.45 333.58 435.52 333.97 435.95 334.4C436.11 334.4 436.4 334.5 436.52 334.4C437.03 333.98 437.59 334 438.19 333.96V333.95Z" fill="#5BC4BD"></path> + <path d="M436.09 319.06C435.67 318.72 434.34 318.91 433.97 319.36C433.65 319.75 433.9 320.87 434.4 321.27C434.83 321.62 435.42 321.49 435.78 320.96C436.36 320.11 436.48 319.37 436.09 319.05V319.06Z" fill="#5BC4BD"></path> + <path d="M469.02 328.78C468.69 329.11 468.82 330.28 469.24 330.76C469.7 331.28 470.44 331.28 470.97 330.76C471.48 330.26 471.53 329.64 471.1 329.18C470.56 328.6 469.42 328.39 469.02 328.78V328.78Z" fill="#5BC4BD"></path> + <path d="M407.87 322.83C407.67 322.14 407.42 321.44 406.57 321.42C405.91 321.4 405.39 321.87 405.39 322.53C405.39 322.93 405.65 323.55 405.97 323.7C406.8 324.08 407.4 323.57 407.87 322.83V322.83Z" fill="#5BC4BD"></path> + <path d="M451.54 316.01C451.1 315.58 450.4 315.59 449.9 316.03C449.37 316.5 449.3 317.12 449.72 317.63C450.18 318.18 450.98 318.25 451.46 317.79C451.94 317.33 451.98 316.44 451.53 316.01H451.54Z" fill="#5BC4BD"></path> + <path d="M382.18 318.62C383.07 318.22 383.02 317.45 382.67 316.51C381.89 316.41 381.14 316.1 380.69 316.93C380.4 317.46 380.49 318.07 381.01 318.41C381.33 318.62 381.88 318.76 382.19 318.62H382.18Z" fill="#5BC4BD"></path> + <path d="M438.56 319.02C439.26 319.35 439.98 319.63 440.42 318.8C440.83 318.02 440.33 317.5 439.69 317.15C438.75 317.41 438.35 317.93 438.57 319.01L438.56 319.02Z" fill="#5BC4BD"></path> + <path d="M423.04 346.56C422.94 347.28 424.56 347.89 425.19 347.4C425.82 346.91 426.01 345.79 425.51 345.4C425.01 345.01 423.14 345.84 423.04 346.56V346.56Z" fill="#5BC4BD"></path> + <path d="M436.03 341.95C435.55 342.34 435.46 343.11 435.87 343.53C436.34 344 436.88 343.92 437.32 343.53C437.72 343.18 437.77 342.7 437.43 342.23C437.06 341.72 436.46 341.6 436.03 341.94V341.95Z" fill="#5BC4BD"></path> + <path d="M417.03 320.33C416.67 320.4 416.13 320.37 415.74 320.61C415.24 320.91 415.3 321.46 415.67 321.87C416 322.23 416.41 322.54 416.94 322.16C417.4 321.83 417.52 320.98 417.03 320.33V320.33Z" fill="#5BC4BD"></path> + <path d="M468.78 320.83C469.17 321.38 470.17 321 470.74 321.07C470.81 320.96 470.88 320.84 470.95 320.73C471.04 319.99 470.86 319.81 470.43 319.44C470 319.07 469.61 319 469.44 319C469.25 319.54 468.39 320.28 468.78 320.84V320.83Z" fill="#5BC4BD"></path> + <path d="M457.68 324.99C457.21 325.34 457.46 325.87 457.83 326.25C458.25 326.69 459 326.72 459.23 326.25C459.41 325.89 459.93 325.11 459.36 324.7C458.79 324.29 458.04 324.74 457.69 325L457.68 324.99Z" fill="#5BC4BD"></path> + <path d="M443.03 345.15C443.01 345.51 443.76 345.94 444.2 346.29C444.32 346.38 444.6 346.62 444.95 346.26C445.3 345.9 445.28 344.76 444.71 344.36C444.14 343.96 443.08 344.32 443.03 345.14V345.15Z" fill="#5BC4BD"></path> + <path d="M453.68 312.34C452.6 313.12 453.07 314.44 453.34 315.1C453.61 315.76 455.25 315.55 455.93 314.64C456.37 314.05 456.28 313.52 455.87 312.99C455.33 312.3 454.22 311.94 453.68 312.33V312.34Z" fill="#5BC4BD"></path> + <path d="M444.03 317.29C443.57 317.83 443.58 318.64 444.08 319.07C444.59 319.52 445.09 319.39 445.54 318.96C446.08 318.44 446.12 317.66 445.64 317.2C445.18 316.76 444.46 316.8 444.03 317.29V317.29Z" fill="#5BC4BD"></path> + <path d="M461.24 317.48C460.89 317.92 461.23 318.9 461.49 319.21C461.86 319.65 462.49 319.57 462.95 319.1C463.43 318.62 463.2 318.11 462.81 317.83C462.49 317.59 461.59 317.04 461.24 317.48Z" fill="#5BC4BD"></path> + <path d="M460.51 323.46C460.35 323.78 460.32 324.32 460.48 324.63C460.73 325.1 461.75 325.03 462.03 324.53C462.2 324.23 462.11 323.79 462.13 323.59C461.5 323 460.75 322.98 460.51 323.46V323.46Z" fill="#5BC4BD"></path> + <path d="M407.79 331.9C407.79 332.53 408.17 332.72 409.48 332.67C410.19 331.93 409.44 330.91 408.85 330.87C408.37 330.84 407.79 331.4 407.79 331.9V331.9Z" fill="#5BC4BD"></path> + <path d="M400.19 337.67C400.19 338.3 401.06 339.04 401.88 338.44C402.59 337.7 401.84 336.68 401.25 336.64C400.77 336.61 400.19 337.17 400.19 337.67V337.67Z" fill="#5BC4BD"></path> + <path d="M475.38 311.72C475.57 311.92 476.03 312.2 476.38 311.89Z" fill="#5BC4BD"></path> + <path d="M456.76 337.92C456.7 337.79 456.18 337.53 455.91 337.75C455.64 337.97 455.94 338.51 456.09 338.71C456.18 338.83 456.62 338.92 456.79 338.76C456.96 338.6 456.87 338.15 456.75 337.92H456.76Z" fill="#5BC4BD"></path> + <path d="M469.3 317.7C469.15 317.62 468.95 317.46 468.8 317.57C468.65 317.68 468.78 317.84 468.76 318.02C468.95 318.04 469.12 318.11 469.23 318.06C469.3 318.03 469.33 317.72 469.3 317.7Z" fill="#5BC4BD"></path> + <path d="M421.21 325.29C421.41 325.6 421.65 325.64 421.95 325.42C422.22 325.23 422.29 325.01 422.09 324.72C421.89 324.43 421.67 324.34 421.35 324.55C421.04 324.75 420.98 324.99 421.2 325.28L421.21 325.29Z" fill="#5BC4BD"></path> + <path d="M414.94 320.15C415.21 319.58 415.24 319 415.12 318.45C414.96 317.7 414.42 317.15 413.65 316.72C412.87 316.28 412.62 315.38 411.73 315.3C410.52 315.19 408.6 315.58 407.8 317.54C407.32 318.72 407.41 319.67 407.89 320.44C408.45 321.33 409.76 320.97 410.65 321.62C412.78 323.14 414.19 321.76 414.94 320.16V320.15Z" fill="#5BC4BD"></path> + <path d="M411.77 312.49C412.6 312.89 414.18 312.13 414.4 311.24Z" fill="#5BC4BD"></path> + <path d="M420.84 314.81C420.52 313.98 419.21 312.81 417.81 313.74C416.42 314.67 416.11 316 416.64 316.9C417.17 317.8 419.13 318.31 420.08 317.65C421.29 316.81 421.16 315.63 420.84 314.8V314.81Z" fill="#5BC4BD"></path> + <path d="M424.95 333.93C425.36 333.57 425.4 333.29 425.42 332.95C425.44 332.61 425.61 332.26 425.38 331.77C425.15 331.28 424.45 330.44 423.62 330.34C422.79 330.24 422.14 330.54 421.72 331.1C421.3 331.66 421.41 332.35 421.61 332.78C421.81 333.21 422.36 333.93 423.05 333.97C423.74 334.01 424.49 334.34 424.94 333.94L424.95 333.93Z" fill="#5BC4BD"></path> + <path d="M427.43 326.06C427.52 325.75 427.39 325.42 427.14 325.3C426.89 325.18 426.36 325.35 426.2 325.6C426.04 325.85 426.36 326.26 426.62 326.38C426.84 326.48 427.33 326.38 427.43 326.06Z" fill="#5BC4BD"></path> + <path d="M415.22 328.23C414.49 328.31 413.4 328.46 413.53 329.47C413.66 330.48 414.35 330.52 414.65 330.45C414.95 330.38 415.49 330.73 415.2 330.91C414.9 331.09 414.82 331.52 415.26 332.26C415.7 333 416.25 333.25 417.07 332.92C417.97 332.55 418.36 331.34 417.92 330.38C417.47 329.42 416.86 329.52 416.63 328.87C416.4 328.23 415.96 328.14 415.23 328.22L415.22 328.23Z" fill="#5BC4BD"></path> + <path d="M420.36 339.34C419.59 339.73 418.63 339.94 418.21 340.92C418.33 341.29 418.47 341.69 418.6 342.08C417.95 343.03 417.78 344.12 418.28 344.57C418.69 344.94 419.21 344.99 419.71 344.68C420.61 344.14 420.72 343.7 420.35 342.52C420.75 341.76 421.18 341.12 421.44 340.41C421.7 339.7 421.02 339 420.36 339.34Z" fill="#5BC4BD"></path> + <path d="M440.59 315.03C441.07 314.59 441.11 313.93 440.68 313.44C440.21 312.9 439.62 312.84 439.1 313.27C438.55 313.72 438.43 314.5 438.84 315.02C439.24 315.52 440.04 315.53 440.59 315.03Z" fill="#5BC4BD"></path> + <path d="M448.07 316.31C448.24 314.94 447.35 313.78 446.03 313.66C444.87 313.56 443.98 314.17 443.86 315.16C443.71 316.45 444.82 318.08 445.88 318.14C446.97 318.2 447.94 317.39 448.07 316.32V316.31Z" fill="#5BC4BD"></path> + <path d="M512.18 323.96C513.31 324.04 514.07 323.47 514.17 322.47C514.26 321.55 513.68 320.61 513.01 320.56C512.01 320.49 510.83 321.49 510.69 322.53C510.6 323.19 511.34 323.91 512.18 323.97V323.96Z" fill="#5BC4BD"></path> + <path d="M457.18 312.35C457.82 312.44 458.45 311.92 458.53 311.23Z" fill="#5BC4BD"></path> + <path d="M456.1 316.94C456.22 316.6 456.15 316.07 455.95 315.77C455.54 315.16 454.97 315.22 453.76 315.87C453.82 316.58 453.64 317.43 454.64 317.68C455.29 317.84 455.88 317.57 456.1 316.95V316.94Z" fill="#5BC4BD"></path> + <path d="M482.53 317.95C483.21 318.07 483.93 317.56 484 316.93C484.07 316.27 483.56 315.6 482.91 315.5C482.24 315.39 481.76 315.75 481.61 316.45C481.46 317.19 481.85 317.83 482.53 317.95V317.95Z" fill="#5BC4BD"></path> + <path d="M498.35 341.75C498.2 342.08 498.17 342.66 498.37 342.89C498.91 343.51 499.84 343.09 500.09 342.74C500.34 342.39 500.02 341.41 499.22 341.29C498.95 341.25 498.46 341.5 498.35 341.75Z" fill="#5BC4BD"></path> + <path d="M490.61 323.64C490.74 324.14 491.41 324.57 491.87 324.44C492.52 324.25 492.69 322.68 492.2 322.44C491.71 322.2 490.44 322.97 490.61 323.64Z" fill="#5BC4BD"></path> + <path d="M519.8 324.7C519.69 325.24 520.66 326.13 521.06 326.01C521.46 325.89 521.66 325.38 521.78 324.94C521.91 324.46 521.7 323.95 521.04 323.93C520.48 323.92 519.94 324.01 519.8 324.7Z" fill="#5BC4BD"></path> + <path d="M495.11 319.93C495.02 320.94 495.69 322.01 496.47 322.08C497.25 322.16 498.48 321.11 498.55 320.31C498.65 319.11 498.04 318.33 496.96 318.29C495.9 318.25 495.21 318.86 495.11 319.93Z" fill="#5BC4BD"></path> + <path d="M503.26 326.07C503.65 326.17 504.19 325.44 504.34 325.11C504.55 324.63 503.99 323.88 503.49 324C503.17 324.07 502.77 324.49 502.71 324.81C502.65 325.12 502.87 325.98 503.26 326.08V326.07Z" fill="#5BC4BD"></path> + <path d="M441.52 321.39C441.4 321.19 440.82 321.05 440.6 321.17C440.38 321.29 440.2 321.8 440.27 322.07C440.32 322.27 440.93 322.71 441.28 322.59C441.63 322.47 441.65 321.6 441.52 321.38V321.39Z" fill="#5BC4BD"></path> + <path d="M485.77 340.18C485.55 339.69 485.38 338.98 484.76 338.85C484.15 338.72 483.95 339.47 483.98 339.72C484.05 340.21 484.41 341.36 484.88 341.44C485.35 341.52 485.84 340.35 485.76 340.18H485.77Z" fill="#5BC4BD"></path> + <path d="M462.45 311.28C462.44 311.84 463.09 312.39 463.84 312.46C464.74 312.54 465.51 312.01 465.55 311.28" fill="#5BC4BD"></path> + <path d="M489.73 311.82C489.8 312.14 489.9 312.44 489.99 312.77C489.42 313.34 488.75 313.89 488.61 314.62C488.42 314.62 488.22 314.62 488.03 314.62C487.11 314.7 486.13 316.14 486.39 317.02C486.65 317.9 488.16 318.85 489.34 318.27C490.05 317.93 490.46 317.46 490.66 316.94C490.77 316.96 490.87 316.99 490.98 317.01C492.28 317.24 492.88 316.44 493.31 315.39C494 315.58 494.68 316.13 495.23 315.25C495.58 314.7 495.5 314.16 495.1 313.74C494.39 312.99 493.73 313.53 493.1 313.97C492.75 313.67 492.43 313.39 492.1 313.1C492.49 312.62 492.82 312.2 493.17 311.76" fill="#5BC4BD"></path> + <path d="M496.91 325.09C495.53 324.57 494.44 325.4 494.6 326.8C494.7 327.66 494.97 328.52 495.29 329.33C495.64 330.19 497.07 330.68 497.98 330.41C498.53 330.25 499.55 329.49 498.97 328.47C497.3 327.44 498.4 326.59 497.46 325.46C497.29 325.26 497.02 325.15 496.91 325.08V325.09Z" fill="#5BC4BD"></path> + <path d="M451.88 329.08C452.05 327.96 450.97 326.75 449.71 326.64C448.6 326.54 447.21 327.62 447.11 328.67C446.98 329.99 447.88 331.3 448.96 331.37C450.02 331.44 451.73 330.11 451.88 329.08V329.08Z" fill="#5BC4BD"></path> + <path d="M503.37 311.67C503.27 312.54 504.07 313.48 505.03 313.61C505.96 313.74 507.11 312.92 507.21 312.06" fill="#5BC4BD"></path> + <path d="M487.99 334.44C487.9 335.5 488.46 336.37 489.27 336.4C490.33 336.45 491.44 335.51 491.6 334.43C491.71 333.7 490.8 332.85 489.86 332.8C488.77 332.74 488.09 333.34 487.99 334.44V334.44Z" fill="#5BC4BD"></path> + <path d="M469.14 312.68C469.03 313.7 469.59 314.67 470.32 314.72C471.22 314.78 472.41 313.68 472.53 312.67" fill="#5BC4BD"></path> + <path d="M509.83 315.59C509.74 316.37 510.76 317.54 511.62 317.64C512.29 317.72 513.31 316.8 513.43 316.02C513.53 315.38 512.93 314.49 512.35 314.41C511.02 314.23 509.92 314.74 509.83 315.6V315.59Z" fill="#5BC4BD"></path> + <path d="M504.57 322.16C504.48 323.04 504.87 323.7 505.56 323.81C506.31 323.93 507.76 322.98 507.85 322.3C507.98 321.32 507.34 320.62 506.18 320.48C505.3 320.37 504.69 321.01 504.57 322.15V322.16Z" fill="#5BC4BD"></path> + <path d="M521.88 312.41C521.23 312.34 520.46 313.04 520.45 313.72C520.43 314.65 521.04 315.51 521.75 315.56C522.62 315.63 523.81 314.79 523.88 314.06C523.95 313.42 522.85 312.52 521.88 312.41Z" fill="#5BC4BD"></path> + <path d="M458.54 317.02C458.4 317.8 459.09 318.48 460.19 318.66C461.04 318.8 461.69 318.39 461.77 317.67C461.85 316.91 461.06 315.57 460.46 315.46C459.55 315.28 458.74 315.94 458.54 317.02V317.02Z" fill="#5BC4BD"></path> + <path d="M497.51 311.96C497.39 312.69 498.23 313.73 499.03 313.85C499.66 313.94 500.16 313.53 500.29 312.84" fill="#5BC4BD"></path> + <path d="M482.74 324.01C482.12 323.99 481.39 324.73 481.39 325.39C481.39 326.04 481.97 326.63 482.64 326.67C483.32 326.71 483.82 326.23 483.91 325.46C484 324.67 483.48 324.03 482.74 324.01V324.01Z" fill="#5BC4BD"></path> + <path d="M503.39 336.67C503.33 337.39 503.85 338.01 504.62 338.11C505.37 338.21 505.97 337.7 506.06 336.9C506.12 336.28 505.57 335.64 504.91 335.56C504.09 335.46 503.45 335.93 503.39 336.66V336.67Z" fill="#5BC4BD"></path> + <path d="M516.36 320.78C516.29 321.45 516.93 322.19 517.62 322.24C518.25 322.29 518.77 321.85 518.86 321.21C518.98 320.39 518.51 319.74 517.77 319.68C517.13 319.62 516.42 320.18 516.36 320.78V320.78Z" fill="#5BC4BD"></path> + <path d="M515.39 334.51C516.01 334.57 516.73 333.96 516.75 333.36C516.77 332.75 516.19 332.07 515.58 331.99C514.94 331.91 514.38 332.32 514.29 332.95C514.18 333.71 514.7 334.44 515.39 334.51V334.51Z" fill="#5BC4BD"></path> + <path d="M529.38 316.08C529.31 316.7 529.9 317.31 530.61 317.36C531.3 317.41 531.79 316.93 531.87 316.14C531.95 315.33 531.63 314.76 531.08 314.75C530.43 314.74 529.44 315.51 529.38 316.08V316.08Z" fill="#5BC4BD"></path> + <path d="M483.81 329.66C483.68 330.3 484.18 330.94 484.88 331.04C485.64 331.15 486.23 330.75 486.32 330.07C486.42 329.36 485.97 328.74 485.3 328.65C484.69 328.57 483.92 329.09 483.81 329.67V329.66Z" fill="#5BC4BD"></path> + <path d="M511.27 326.74C510.61 326.6 509.96 327.04 509.8 327.72C509.64 328.44 509.94 328.91 510.65 329.03C511.42 329.16 512.01 328.8 512.15 328.11C512.26 327.51 511.85 326.86 511.27 326.74Z" fill="#5BC4BD"></path> + <path d="M489 319.49C488.78 319.32 488.18 319.28 488.03 319.44C487.75 319.75 487.45 320.3 487.54 320.65C487.73 321.37 488.42 321.27 489 321.21C489.5 320.61 489.62 319.99 488.99 319.49H489Z" fill="#5BC4BD"></path> + <path d="M471.56 327.15C471.64 327.86 471.62 328.59 471.65 329.31C471.37 330.1 471.73 330.65 472.4 330.82C473.12 330.99 473.71 330.61 474.02 329.83C474.19 329.41 474.35 328.93 474.66 328.63C475.28 328.04 475.56 327.37 475.28 326.58C475.07 325.98 473.52 325.46 472.82 325.72C472.16 325.96 471.45 326.18 471.56 327.16V327.15Z" fill="#5BC4BD"></path> + <path d="M471.84 319.15C472.59 319.29 473.15 318.91 473.26 318.18C473.38 317.42 472.88 316.7 472.18 316.62C471.55 316.55 470.99 317.09 470.91 317.84C470.84 318.48 471.24 319.04 471.85 319.15H471.84Z" fill="#5BC4BD"></path> + <path d="M465.25 320.56C465.17 321.18 465.57 321.71 466.14 321.6C466.55 321.52 466.92 321.21 467.18 321.07C467.21 320.25 466.64 319.72 466.02 319.71C465.43 319.71 465.31 320.11 465.26 320.55L465.25 320.56Z" fill="#5BC4BD"></path> + <path d="M465.55 326.49C465.58 325.67 465.01 325.14 464.39 325.13C463.8 325.13 463.68 325.53 463.63 325.97C463.55 326.59 463.95 327.12 464.52 327.01C464.93 326.93 465.3 326.62 465.56 326.48L465.55 326.49Z" fill="#5BC4BD"></path> + <path d="M480.35 330.49C480.51 329.91 480.11 329.08 479.58 329.14C479.14 329.19 478.11 329.39 478.07 330.01C478.03 330.63 478.84 330.91 479.21 331.05C479.66 331.21 480.19 331.12 480.36 330.49H480.35Z" fill="#5BC4BD"></path> + <path d="M523.05 332.1C522.94 332.45 523.43 333.83 524.05 333.91C524.67 334 525.29 332.61 525.35 332.08C525.39 331.69 524.96 330.87 524.35 330.78C523.74 330.69 523.22 331.57 523.05 332.09V332.1Z" fill="#5BC4BD"></path> + <path d="M535.99 315.94C535.92 316.11 536.18 316.8 536.4 316.82C536.61 316.85 536.99 316.31 537.07 316.07C537.11 315.94 536.81 315.52 536.7 315.53C536.44 315.56 536.08 315.73 536 315.94H535.99Z" fill="#5BC4BD"></path> + <path d="M478.26 338.33C478.3 338.2 478.14 337.81 477.89 337.79C477.64 337.77 477.27 337.99 477.19 338.2C477.12 338.37 477.28 339.02 477.6 339.08C477.92 339.14 478.19 338.57 478.27 338.33H478.26Z" fill="#5BC4BD"></path> + <path d="M530.66 312.5C530.66 312.81 531.11 313.12 531.28 313.12C531.55 313.12 532.09 313.1 532.1 312.79C532.1 312.49 531.81 312.15 531.6 312.09C531.39 312.03 530.67 312.19 530.67 312.5H530.66Z" fill="#5BC4BD"></path> + <path d="M530.1 324.88C530.1 325.25 530.57 325.57 530.78 325.59C530.99 325.61 531.37 325.33 531.42 325.11C531.47 324.93 531.19 324.5 530.99 324.47C530.77 324.42 530.09 324.51 530.09 324.88H530.1Z" fill="#5BC4BD"></path> + <path d="M460.19 326.75C460.24 326.44 459.89 326.15 459.68 326.09C459.47 326.03 458.79 326.2 458.75 326.5C458.71 326.8 459.26 327.19 459.48 327.21C459.7 327.23 460.14 327.06 460.19 326.75Z" fill="#5BC4BD"></path> + <path d="M462.38 336.81C462.51 336.87 463.08 336.73 463.13 336.39C463.18 336.05 462.61 335.83 462.37 335.78C462.22 335.75 461.83 335.97 461.8 336.2C461.77 336.43 462.14 336.71 462.37 336.81H462.38Z" fill="#5BC4BD"></path> + <path d="M533.13 317.67C533.13 317.9 533.37 318.02 533.48 318.04C533.59 318.06 533.79 317.81 533.79 317.71C533.79 317.59 533.7 317.37 533.54 317.35C533.38 317.33 533.13 317.44 533.12 317.67H533.13Z" fill="#5BC4BD"></path> + <path d="M495.81 335.11C495.81 334.99 495.72 334.77 495.56 334.75C495.39 334.73 495.15 334.84 495.14 335.07C495.14 335.3 495.38 335.42 495.49 335.44C495.61 335.46 495.8 335.21 495.8 335.11H495.81Z" fill="#5BC4BD"></path> + <path d="M474.61 311.83C474.5 312.51 474.97 313.16 475.63 313.26C475.71 313.27 475.79 313.27 475.87 313.26C475.68 314.28 476.27 315.03 476.85 315.49C476.89 315.52 476.94 315.55 476.98 315.58C476.24 315.81 475.76 316.48 475.61 317.54C475.56 317.94 475.58 318.29 475.65 318.61C475.39 318.52 475.11 318.5 474.76 318.67C474 319.04 473.88 320.26 474.38 320.97C474.79 321.56 475.81 322 476.5 321.75C477.46 321.4 477.6 320.38 477.55 320.05C478.66 320.05 479.75 319.21 479.86 318.21C479.97 317.18 479.59 316.33 478.88 315.87C479.32 315.74 479.72 315.43 479.99 314.88C480.72 313.37 480.31 312.07 479.4 311.56C478.79 311.22 477.72 311.35 476.93 311.79" fill="#5BC4BD"></path> + <path d="M504.56 319.35C505.2 319.38 505.85 318.83 505.92 318.2C505.99 317.6 505.36 316.92 504.72 316.9C504.06 316.88 503.54 317.43 503.51 318.17C503.48 318.86 503.89 319.31 504.56 319.34V319.35Z" fill="#5BC4BD"></path> + <path d="M468.53 336.84C469.07 336.33 468.96 336.57 469.69 336.8C470.42 337.03 471.56 336.89 471.54 335.54C471.51 334.19 470.18 333.41 469.01 333.32C467.84 333.23 466.23 335 466.47 336.4C466.65 337.41 467.99 337.34 468.53 336.83V336.84Z" fill="#5BC4BD"></path> + <path d="M559.32 312.27C558.74 313.12 558.03 313.88 557.33 314.73C554.9 313.95 554.14 314.35 554.01 316.63C553.94 317.86 554.94 318.79 556.17 318.47C557.09 318.23 557.85 317.64 558.94 317.07C559.91 317.65 561.12 318.23 562.25 317.47C563.65 316.52 563.75 314.25 562.41 312.82C561.9 312.28 562 311.97 562.09 311.44" fill="#5BC4BD"></path> + <path d="M559.64 329.76C560.02 328.53 559.52 327.14 558.57 326.82C557.48 326.45 555.56 327.37 555.3 328.38C555.02 329.48 555.77 330.82 556.84 331.12C557.99 331.45 559.32 330.8 559.65 329.75L559.64 329.76Z" fill="#5BC4BD"></path> + <path d="M538.54 330.62C537.58 330.4 536.91 330.96 536.67 332.17C536.53 332.85 537.11 333.8 537.76 333.96C538.53 334.14 540.22 333.29 540.34 332.66C540.49 331.86 539.61 330.87 538.55 330.63L538.54 330.62Z" fill="#5BC4BD"></path> + <path d="M576.54 314.54C575.69 314.33 575.04 314.85 574.73 316C574.48 316.93 574.81 317.72 575.51 317.87C576.17 318.02 577.86 317.22 578.02 316.68C578.3 315.74 577.66 314.81 576.54 314.53V314.54Z" fill="#5BC4BD"></path> + <path d="M526.2 312.39C526.04 313.07 526.45 313.63 527.22 313.8C528.53 314.09 529.24 313.8 529.47 312.85" fill="#5BC4BD"></path> + <path d="M521.82 311.63C521.64 312.6 522.36 313.05 522.98 313.51C524.31 312.9 524.69 312.44 524.49 311.67" fill="#5BC4BD"></path> + <path d="M540.39 325.95C540.81 325.24 541.42 324.67 540.81 323.94C540.39 323.44 539.81 323.33 539.18 323.63C538.67 323.87 538.44 324.25 538.56 324.8C538.77 325.74 539.49 325.88 540.38 325.95H540.39Z" fill="#5BC4BD"></path> + <path d="M564.84 349.9C565.26 349.19 565.87 348.62 565.26 347.89C564.84 347.39 564.26 347.28 563.63 347.58C563.12 347.82 562.89 348.2 563.01 348.75C563.22 349.69 563.94 349.83 564.83 349.9H564.84Z" fill="#5BC4BD"></path> + <path d="M516.76 336.39C516.11 336.19 515.48 336.55 515.23 337.27C514.99 337.95 515.25 338.45 515.93 338.66C516.62 338.87 517.29 338.52 517.48 337.85C517.65 337.29 517.28 336.55 516.75 336.39H516.76Z" fill="#5BC4BD"></path> + <path d="M573.51 334.59C572.98 334.44 572.22 334.85 572.06 335.37C571.88 335.93 572.31 336.83 572.84 337.02C573.37 337.21 574.09 336.8 574.27 336.22C574.46 335.57 574.08 334.75 573.51 334.59V334.59Z" fill="#5BC4BD"></path> + <path d="M520.08 314.73C520.27 314.47 520.28 313.78 520.08 313.59C519.74 313.26 519.13 312.95 518.7 313.02C517.74 313.18 517.97 314.04 517.9 314.83C518.76 315.25 519.51 315.5 520.08 314.73Z" fill="#5BC4BD"></path> + <path d="M521.76 330.04C521.32 329.92 520.76 330.48 520.59 331.16C520.46 331.68 520.66 332.03 521.17 332.12C521.73 332.23 522.27 332.16 522.49 331.51C522.66 330.99 522.24 330.17 521.76 330.04V330.04Z" fill="#5BC4BD"></path> + <path d="M503.7 314.13C503.18 313.95 502.16 314.78 502.23 315.19C502.29 315.6 502.77 315.88 503.19 316.05C503.64 316.24 504.18 316.11 504.29 315.46C504.38 314.9 504.37 314.36 503.71 314.13H503.7Z" fill="#5BC4BD"></path> + <path d="M567.81 343.01C567.57 342.95 567.06 342.82 566.86 343.2C566.67 343.58 567.15 343.93 567.28 343.93C567.53 343.94 567.85 343.81 568.03 343.63C568.11 343.55 567.94 343.03 567.81 343.01V343.01Z" fill="#5BC4BD"></path> + <path d="M525.6 323.21C525.81 323.63 526.38 323.5 526.7 323.06C526.96 322.7 527.13 321.98 526.99 321.58C526.79 321.02 526.29 321.11 526.14 321.2C525.81 321.39 525.73 321.77 525.65 322.16C525.57 322.51 525.42 322.85 525.59 323.21H525.6Z" fill="#5BC4BD"></path> + <path d="M536.3 320.54C535.52 319.48 534.54 319.29 533.68 319.55C532.81 319.81 532.61 321.27 532.95 322.5C533.2 323.39 534.79 324.09 535.61 323.67C536.43 323.25 537.08 321.6 536.3 320.54Z" fill="#5BC4BD"></path> + <path d="M566.21 311.2C566.12 311.34 566.04 311.49 565.98 311.64C565.52 312.68 565.8 313.32 566.88 313.66C567.79 313.94 568.69 314.16 569.49 312.88C569.62 313.54 569.78 313.89 569.74 314.22C569.65 314.94 569.93 315.39 570.58 315.63C571.27 315.88 571.96 315.99 572.56 315.37" fill="#5BC4BD"></path> + <path d="M546.35 317.61C547.22 317.35 547.45 317.98 547.97 318.3C548.43 318.59 549.08 318.65 549.65 318.71C550.01 318.74 550.39 318.6 550.75 318.49C551.11 318.38 551.47 318.22 551.82 318.06C552.97 317.55 553.38 316.85 553.11 315.9C552.8 314.84 551.86 314.32 550.69 314.54C549.48 314.76 548.26 315.11 547.04 315.12C546.04 315.13 544.89 315.87 544.94 316.56C544.99 317.25 546.04 317.71 546.36 317.62L546.35 317.61Z" fill="#5BC4BD"></path> + <path d="M593.15 317.22C592.21 316.84 591.28 316.42 590.37 316.03C590.96 314.26 590.85 314.08 589.26 313.91C588.6 314.62 588.74 315.28 589.43 315.95C588.24 317.94 589 319.05 591.47 319.11C591.54 319.24 591.64 319.38 591.68 319.53C591.86 320.2 592.34 320.33 592.95 320.33C593.53 320.33 593.81 320.01 594.05 319.51C594.63 318.3 594.42 317.72 593.16 317.22H593.15Z" fill="#5BC4BD"></path> + <path d="M529.72 325.64C528.53 325.28 527.4 325.89 527.06 327.08C526.72 328.26 527.56 329.77 528.73 330.07C529.78 330.34 531.24 329.49 531.6 328.39C531.99 327.23 531.2 326.08 529.72 325.64Z" fill="#5BC4BD"></path> + <path d="M553.98 327.37C554.44 326.89 554.59 326.32 554.24 325.73C554.12 325.52 553.82 325.25 553.62 325.26C553.01 325.29 552.41 325.45 551.74 325.57C550.56 324.58 549.37 324.36 548.77 325.06C548.18 325.75 548.37 327.4 549.11 328.07C549.9 328.78 550.47 328.59 551.94 327.05C552.6 327.56 553.2 328.17 553.97 327.38L553.98 327.37Z" fill="#5BC4BD"></path> + <path d="M557.57 337.2C556.72 336.99 555.6 337.8 555.38 338.8C555.15 339.84 555.75 340.64 556.96 340.88C558.14 341.11 558.96 340.6 559.17 339.5C559.38 338.44 558.71 337.49 557.57 337.2Z" fill="#5BC4BD"></path> + <path d="M581.24 317.95C580.08 317.65 579.14 318.17 578.84 319.27C578.51 320.47 579.41 321.92 580.65 322.17C581.59 322.36 582.92 321.49 583.19 320.5C583.5 319.38 582.69 318.32 581.25 317.94L581.24 317.95Z" fill="#5BC4BD"></path> + <path d="M530.69 315.28C530.07 315.37 529.04 315.44 528.06 315.69C527.45 315.85 527.04 316.43 527.24 317.11C527.42 317.71 527.84 318.13 528.59 318.04C528.95 317.99 529.34 318.01 529.7 318.08C530.75 318.27 531.41 318 531.88 317.14C532.33 316.31 532.03 315.63 530.69 315.28V315.28Z" fill="#5BC4BD"></path> + <path d="M578.26 342.19C577.47 341.34 575.88 341.28 575.36 342.08C574.88 342.81 574.97 343.54 575.44 344.24C575.92 344.97 576.64 345.04 577.34 344.73C577.91 344.48 579.23 344.29 579.31 343.38C579.39 342.47 578.56 342.51 578.26 342.19V342.19Z" fill="#5BC4BD"></path> + <path d="M564.63 322.78C563.45 322.48 562.76 322.76 562.5 323.64C562.24 324.55 562.87 325.83 563.69 326.05C564.51 326.27 565.79 325.52 566.05 324.67C566.26 323.98 565.53 323.01 564.63 322.78V322.78Z" fill="#5BC4BD"></path> + <path d="M582.08 331.84C582.8 332 583.79 331.24 583.99 330.37C584.18 329.56 583.57 328.68 582.65 328.43C581.78 328.2 581.2 328.48 580.98 329.23C580.67 330.31 581.23 331.64 582.08 331.83V331.84Z" fill="#5BC4BD"></path> + <path d="M551.36 322.09C552.14 322.34 553.28 321.73 553.63 320.86C553.91 320.16 553.33 319.07 552.49 318.75C551.88 318.51 550.89 318.94 550.69 319.51C550.28 320.71 550.57 321.84 551.36 322.09V322.09Z" fill="#5BC4BD"></path> + <path d="M515.58 317.92C515.74 317.29 515.15 316.43 514.48 316.32C513.56 316.17 512.63 316.65 512.47 317.34C512.28 318.19 512.94 319.49 513.65 319.66C514.28 319.82 515.32 318.86 515.57 317.91L515.58 317.92Z" fill="#5BC4BD"></path> + <path d="M553.26 332.53C552.47 332.23 551.22 332.8 550.92 333.61C550.67 334.26 551.08 335.1 551.77 335.35C552.53 335.63 553.58 335.05 553.86 334.19C554.11 333.41 553.88 332.76 553.25 332.52L553.26 332.53Z" fill="#5BC4BD"></path> + <path d="M544.2 321.87C543.53 321.65 543.01 322.08 542.76 323.04C542.49 324.1 542.72 324.71 543.48 324.9C544.52 325.17 545.41 324.74 545.58 323.9C545.69 323.36 544.81 322.07 544.19 321.87H544.2Z" fill="#5BC4BD"></path> + <path d="M575.57 326.4C574.58 326.23 573.77 327.34 573.72 327.74C573.66 328.14 574.61 329.21 575.57 329.04C576.17 328.94 576.59 328.44 576.58 327.71C576.56 327.02 576.24 326.51 575.58 326.39L575.57 326.4Z" fill="#5BC4BD"></path> + <path d="M544.34 332.33C543.68 332.17 542.86 332.7 542.72 333.38C542.59 334 542.94 334.57 543.57 334.75C544.37 334.98 545.07 334.61 545.24 333.88C545.38 333.26 544.93 332.47 544.34 332.33Z" fill="#5BC4BD"></path> + <path d="M508.06 311.28C507.4 311.12 506.58 311.65 506.44 312.33C506.31 312.95 506.66 313.52 507.29 313.7C508.09 313.93 508.79 313.56 508.96 312.83C509.1 312.21 508.65 311.42 508.06 311.28V311.28Z" fill="#5BC4BD"></path> + <path d="M567.59 316.37C566.97 316.21 566.55 316.49 566.29 317.07C566.01 317.7 566.14 318.32 566.63 318.71C567.39 319.32 568.47 318.84 568.73 318.33C568.99 317.82 568.62 316.64 567.59 316.38V316.37Z" fill="#5BC4BD"></path> + <path d="M510.89 324.83C510.29 324.67 509.6 325.17 509.45 325.87C509.31 326.55 509.71 327.1 510.48 327.29C511.27 327.48 511.88 327.25 511.97 326.7C512.07 326.05 511.45 324.97 510.89 324.83V324.83Z" fill="#5BC4BD"></path> + <path d="M571.65 324.74C571.75 324.12 571.24 323.35 570.35 323.18C570.08 323.42 569.53 323.7 569.3 324.16C568.98 324.79 569.6 325.56 570.36 325.71C570.97 325.82 571.54 325.39 571.65 324.75V324.74Z" fill="#5BC4BD"></path> + <path d="M573.42 322.82C574.09 322.98 574.8 322.56 574.93 321.93C575.07 321.23 574.56 320.48 573.87 320.37C573.24 320.27 572.53 320.75 572.41 321.35C572.3 321.94 572.8 322.67 573.42 322.82V322.82Z" fill="#5BC4BD"></path> + <path d="M583.86 337.93C583.29 337.68 582.61 338.02 582.41 338.61C582.23 339.16 582.59 339.84 583.17 340.07C583.77 340.31 584.54 339.98 584.61 339.4C584.7 338.76 584.5 338.2 583.85 337.92L583.86 337.93Z" fill="#5BC4BD"></path> + <path d="M601.69 311.9C600.88 311.36 600.25 311.83 599.65 312.63C599.98 313.34 600.13 314.14 601.08 314.07C601.69 314.03 602.15 313.63 602.15 313.01C602.15 312.63 601.98 312.09 601.69 311.9Z" fill="#5BC4BD"></path> + <path d="M523.49 323.96C522.89 323.81 522.43 324.07 522.17 324.62C521.95 325.09 522.68 326.23 523.18 326.15C523.68 326.07 523.94 325.75 524.16 325.37C524.49 324.83 524.1 324.12 523.49 323.97V323.96Z" fill="#5BC4BD"></path> + <path d="M557.74 320.21C557.57 320.01 557.01 319.9 556.77 320.03C556.06 320.4 556.04 321.04 556.38 321.78C557.02 321.91 557.73 322.14 558.07 321.35C558.2 321.06 557.98 320.5 557.74 320.21Z" fill="#5BC4BD"></path> + <path d="M585.75 312.44C585.02 312.23 584.6 313.18 584.33 313.58C584.02 314.03 584.42 314.61 585.04 314.81C585.7 315.02 586.21 314.8 586.24 314.14C586.26 313.68 586.49 312.66 585.76 312.45L585.75 312.44Z" fill="#5BC4BD"></path> + <path d="M566.76 335.36C566.31 335.36 565.16 335.51 565.08 335.96C564.99 336.41 565.89 337.06 566.29 337.29C566.72 337.54 567.37 337.02 567.45 336.45C567.53 335.91 567.35 335.37 566.77 335.36H566.76Z" fill="#5BC4BD"></path> + <path d="M530.15 323.45C530.43 323.49 530.93 323.22 531.03 322.98C531.17 322.64 531.17 322.06 530.96 321.81C530.4 321.14 529.81 321.58 529.25 321.94C529.17 322.72 529.35 323.34 530.15 323.45V323.45Z" fill="#5BC4BD"></path> + <path d="M520.09 321.06C519.48 320.89 518.91 321.22 518.94 321.79C518.96 322.21 518.97 322.69 519.32 322.89C519.67 323.09 520.73 322.54 520.82 321.93C520.91 321.35 520.52 321.17 520.09 321.05V321.06Z" fill="#5BC4BD"></path> + <path d="M542.61 337.3C542.17 337.29 541.05 337.47 540.92 337.94C540.79 338.41 541.84 338.99 542.25 339.14C542.75 339.32 543.18 339.04 543.25 338.4C543.31 337.85 543.2 337.31 542.61 337.3V337.3Z" fill="#5BC4BD"></path> + <path d="M595.24 320.82C594.87 320.7 594.35 321.06 594.04 321.16C593.79 322.05 594.18 322.39 594.65 322.53C595.13 322.67 595.75 322.59 595.8 321.99C595.83 321.59 595.54 320.91 595.24 320.82V320.82Z" fill="#5BC4BD"></path> + <path d="M534.23 344.76C533.83 344.71 532.79 344.88 532.72 345.22C532.65 345.56 533.32 346.28 533.66 346.52C534.12 346.84 534.64 346.47 534.88 345.83C535.11 345.18 534.71 344.82 534.23 344.76V344.76Z" fill="#5BC4BD"></path> + <path d="M540.75 328.18C540.47 328.11 539.56 328.44 539.5 328.79C539.44 329.13 540.2 329.86 540.39 329.82C540.79 329.75 541.51 329.42 541.49 329.09C541.47 328.76 541.06 328.26 540.75 328.18V328.18Z" fill="#5BC4BD"></path> + <path d="M563.59 327.7C563.13 327.6 562.59 328.58 562.51 328.94C562.46 329.18 562.91 329.65 563.24 329.79C563.66 329.97 564.18 329.79 564.16 329.22C564.15 328.82 564.05 327.79 563.59 327.69V327.7Z" fill="#5BC4BD"></path> + <path d="M520.17 343.49C519.83 343.44 519.2 343.57 519.09 343.82C518.97 344.08 519.3 344.69 519.56 344.83C519.8 344.96 520.76 344.83 520.86 344.51C520.96 344.19 520.38 343.51 520.17 343.49V343.49Z" fill="#5BC4BD"></path> + <path d="M495.92 316.32C495.59 316.16 494.16 316.45 493.98 317.06C493.81 317.67 495.09 318.47 495.61 318.6C495.99 318.7 496.86 318.39 497.03 317.79C497.2 317.2 496.41 316.56 495.91 316.32H495.92Z" fill="#5BC4BD"></path> + <path d="M510.1 331.39C509.94 331.3 509.23 331.46 509.17 331.67C509.11 331.87 509.59 332.33 509.82 332.44C509.95 332.5 510.41 332.26 510.41 332.15C510.41 331.89 510.3 331.51 510.11 331.4L510.1 331.39Z" fill="#5BC4BD"></path> + <path d="M514.26 326.6C513.95 326.56 513.59 326.96 513.56 327.13C513.52 327.4 513.47 327.94 513.77 327.98C514.07 328.03 514.44 327.79 514.53 327.58C514.62 327.38 514.56 326.64 514.26 326.6Z" fill="#5BC4BD"></path> + <path d="M502.08 324.31C501.71 324.25 501.33 324.68 501.28 324.88C501.23 325.08 501.46 325.5 501.67 325.58C501.84 325.65 502.3 325.43 502.37 325.25C502.45 325.04 502.46 324.36 502.09 324.3L502.08 324.31Z" fill="#5BC4BD"></path> + <path d="M544.33 345.6C544.63 345.7 544.97 345.39 545.06 345.18C545.14 344.98 545.08 344.29 544.79 344.2C544.5 344.11 544.03 344.61 543.99 344.82C543.94 345.04 544.04 345.5 544.34 345.59L544.33 345.6Z" fill="#5BC4BD"></path> + <path d="M548.99 353.03C548.92 353.15 548.97 353.73 549.3 353.83C549.63 353.93 549.92 353.39 550.01 353.16C550.06 353.02 549.9 352.6 549.67 352.54C549.44 352.48 549.12 352.8 548.98 353.02L548.99 353.03Z" fill="#5BC4BD"></path> + <path d="M508.8 328.32C508.57 328.28 508.42 328.51 508.39 328.62C508.36 328.73 508.57 328.96 508.68 328.98C508.8 329 509.02 328.94 509.07 328.78C509.12 328.62 509.04 328.36 508.81 328.32H508.8Z" fill="#5BC4BD"></path> + <path d="M547.8 336.21C547.57 336.17 547.42 336.39 547.39 336.51C547.36 336.62 547.57 336.85 547.68 336.87C547.8 336.89 548.02 336.83 548.07 336.67C548.11 336.51 548.04 336.25 547.81 336.21H547.8Z" fill="#5BC4BD"></path> + <path d="M594.72 334.14C594.56 334.05 593.99 333.95 593.79 334.42C593.59 334.88 594.21 335.08 594.44 335.19C594.57 335.25 595.03 335.01 595.03 334.9C595.03 334.64 594.92 334.26 594.73 334.15L594.72 334.14Z" fill="#5BC4BD"></path> + <path d="M528.08 332.87C527.92 332.78 527.35 332.68 527.15 333.15C526.95 333.61 527.57 333.81 527.8 333.92C527.93 333.98 528.39 333.74 528.39 333.63C528.39 333.37 528.28 332.99 528.09 332.88L528.08 332.87Z" fill="#5BC4BD"></path> + <path d="M591.85 325.38C591.54 325.34 591.18 325.74 591.15 325.91C591.11 326.18 591.06 326.72 591.36 326.76C591.66 326.81 592.03 326.57 592.12 326.36C592.21 326.16 592.15 325.42 591.85 325.38Z" fill="#5BC4BD"></path> + <path d="M591.71 330.26C591.23 330.17 590.9 330.46 590.85 330.88C590.8 331.3 591.23 331.59 591.45 331.63C591.69 331.67 592.11 331.67 592.26 331.21C592.41 330.75 592.19 330.34 591.71 330.26Z" fill="#5BC4BD"></path> + <path d="M539.18 321.36C540.24 321.97 541.67 321.88 541.85 320.8C542.03 319.72 541.63 318.95 541.15 318C540.79 317.29 539.79 317.5 540.17 316.64C540.55 315.78 541.09 313.91 539.42 313.42C538.6 313.18 537.5 313.78 537.14 314.57C537.14 314.57 537.14 314.59 537.13 314.6C536.86 313.97 536.24 313.41 535.48 313.25C534.45 313.03 533.11 313.99 532.92 315.08C532.74 316.13 533.38 317.22 534.29 317.4C535.14 317.57 536.43 316.87 536.99 316.06C537.07 316.42 537.23 316.73 537.5 316.89C538.11 317.28 536.83 318.39 537.64 318.99C538.41 319.55 538.1 320.75 539.16 321.36H539.18Z" fill="#5BC4BD"></path> + <path d="M143.46 79.9H594.21C603.54 79.9 611.12 87.48 611.12 96.81V124.81H126.55V96.81C126.55 87.48 134.13 79.9 143.46 79.9Z" fill="#20BBB1"></path> + <path d="M670.02 36.18H468.04V147.51H670.02V36.18Z" fill="#F37450"></path> + <path d="M573.55 193.87H163.18C130.678 193.87 104.33 220.218 104.33 252.72C104.33 285.222 130.678 311.57 163.18 311.57H573.55C606.052 311.57 632.4 285.222 632.4 252.72C632.4 220.218 606.052 193.87 573.55 193.87Z" fill="#263A7C"></path> + <path d="M157.3 268.76C157.4 269.86 158.3 270.7 159.31 270.65C160.37 270.6 161.02 269.82 160.94 268.68C160.85 267.46 160.17 266.77 159.14 266.84C158.13 266.91 157.22 267.87 157.31 268.75L157.3 268.76Z" fill="#308DCC"></path> + <path d="M155.99 258.26C156.56 258.18 156.97 257.69 156.91 257.17C156.87 256.84 156.69 256.57 156.45 256.39L155.26 258.05C155.48 258.2 155.74 258.29 155.98 258.26H155.99Z" fill="#308DCC"></path> + <path d="M176.36 249.7C176.15 249.65 175.91 249.77 175.7 249.95C175.66 249.85 175.62 249.74 175.55 249.64C174.86 248.47 173.8 248.17 173.05 248.56C172.55 248.82 172.16 249.6 172.1 250.33C171.68 250.09 171.21 250.15 170.9 250.49C170.58 250.86 170.66 251.53 171.07 251.91C171.48 252.29 172.13 252.26 172.49 251.86C172.54 251.81 172.57 251.76 172.6 251.7C173.2 252.29 173.97 252.22 174.54 252.04C174.58 252.03 174.62 252.01 174.66 251.99C174.48 252.59 174.72 253.22 175.37 253.78C175.48 253.88 175.59 253.96 175.71 254.03L177.66 251.18C177.44 251.01 177.2 250.89 176.97 250.81C177.06 250.37 176.75 249.79 176.35 249.7H176.36Z" fill="#308DCC"></path> + <path d="M173.28 253.62C173.46 253.7 173.81 253.68 173.96 253.5C174.11 253.32 173.91 252.95 173.76 252.83C173.64 252.73 173.12 252.68 172.96 252.91C172.79 253.14 173.13 253.56 173.28 253.62V253.62Z" fill="#308DCC"></path> + <path d="M158.39 254.23C158.72 254.79 159.62 255.03 160.29 254.85C160.36 254.83 160.41 254.81 160.47 254.79C160.19 255.13 160 255.58 160.03 255.98C160.03 256.04 160.07 256.09 160.09 256.15C160.06 256.19 160.03 256.24 160 256.28C159.97 256.34 159.94 256.4 159.92 256.45C159.86 256.01 159.67 255.57 159.35 255.32C158.85 254.93 158.12 255.13 157.53 255.82C157.08 256.35 157.03 257.28 157.43 257.62C157.99 258.1 159.2 258.08 159.65 257.59C159.72 257.52 159.77 257.43 159.81 257.34C159.86 257.59 159.99 257.84 160.2 258.1C160.72 258.74 161.39 258.97 162.14 259.14C162.4 259.2 162.69 259.34 162.87 259.53C163.58 260.31 164.33 260.33 165.05 259.54C165.11 259.67 165.18 259.78 165.28 259.85C165.29 259.85 165.31 259.85 165.32 259.86C165.3 259.96 165.28 260.07 165.3 260.18C165.41 261.01 166.43 261.89 167.16 261.78C167.71 261.7 168.2 260.91 168.13 260.22C168.05 259.46 167.63 259.05 166.94 258.99C167.11 258.52 167.02 258.02 166.66 257.75C166.22 257.42 165.61 257.52 165.25 258C165.1 257.75 164.85 257.52 164.51 257.33C164.07 257.09 163.69 256.89 163.49 256.38C163.38 256.12 163.21 255.95 163.02 255.81C163.02 255.81 163.02 255.79 163.02 255.78C162.98 255.05 162.14 254.18 161.48 254.19C161.38 254.19 161.29 254.21 161.19 254.24C161.34 254.03 161.43 253.76 161.47 253.43C161.52 253.07 161.47 252.74 161.39 252.43C161.68 252.41 161.96 252.29 162.15 252.05C162.51 251.61 162.43 250.85 161.99 250.53C161.64 250.28 161.06 250.33 160.69 250.59C160.69 250.56 160.68 250.53 160.69 250.51C160.69 250.48 160.69 250.46 160.69 250.43L158.22 253.89C158.28 253.99 158.34 254.1 158.4 254.2L158.39 254.23Z" fill="#308DCC"></path> + <path d="M154.12 268.76C153.96 268.81 153.71 268.73 153.55 268.63C152.64 268.04 152.19 267.93 151.72 268.37L156.77 271.98C156.91 271.88 157.03 271.76 157.11 271.6C157.35 271.13 157.11 270.75 156.75 270.42C156.37 270.06 156.02 269.68 155.63 269.34C155.2 268.96 154.79 268.54 154.11 268.76H154.12Z" fill="#308DCC"></path> + <path d="M170.84 253.08C170.14 253.06 169.42 253.17 168.73 253.33C168 253.5 167.44 254.59 167.54 255.35C167.6 255.81 167.82 256.15 168.27 256.17C168.68 256.19 169.09 256.17 169.49 256.14C170.09 256.48 170.8 256.49 171.11 256.09C171.2 255.97 171.26 255.82 171.3 255.65C171.39 255.6 171.48 255.58 171.57 255.52C171.75 255.41 171.87 255.2 171.94 255.13C172.52 254.08 171.98 253.11 170.85 253.08H170.84Z" fill="#308DCC"></path> + <path d="M156.4 258.46C155.32 258.51 154.64 258.99 154.67 259.69C154.69 260.23 155.57 261.06 156.09 261.04C156.63 261.02 157.32 260.05 157.31 259.34C157.31 258.79 156.94 258.44 156.4 258.46V258.46Z" fill="#308DCC"></path> + <path d="M172.38 258.92L172.52 258.72C172.46 258.78 172.42 258.85 172.38 258.92Z" fill="#308DCC"></path> + <path d="M156.4 262.34C156.15 262.36 155.9 262.46 155.66 262.61C155.71 262.33 155.62 262.05 155.39 261.79C155.24 261.62 155.07 261.52 154.9 261.46C154.82 261.37 154.74 261.3 154.66 261.24C154.28 260.97 153.88 260.9 153.57 261.21C152.76 262.01 152.03 262.89 151.79 264.05C151.75 264.26 151.81 264.49 151.82 264.59C152.18 265.73 153.26 266 154.06 265.2C154.29 264.97 154.51 264.71 154.71 264.44C154.88 265.27 155.82 266.07 156.67 266.04C157.55 266.01 158.25 265.27 158.2 264.41C158.13 263.18 157.34 262.27 156.4 262.35V262.34Z" fill="#308DCC"></path> + <path d="M165.33 266.12C164.82 266.16 164.34 266.92 164.35 267.67C164.36 268.41 164.88 269.04 165.47 269.04L166.81 267.08C166.5 266.54 165.87 266.09 165.33 266.12V266.12Z" fill="#308DCC"></path> + <path d="M163.13 269.35C162.53 269.33 162.28 269.7 162.35 270.1C162.4 270.42 162.55 270.99 162.99 270.98C163.43 270.97 163.73 270.49 163.89 270.15C164.07 269.77 163.57 269.35 163.13 269.35Z" fill="#308DCC"></path> + <path d="M150.52 266.93C150.87 266.88 151.03 266.19 150.82 265.79C150.68 265.52 150.32 265.42 149.98 265.46L149.38 266.31C149.52 266.71 150 267 150.52 266.93V266.93Z" fill="#308DCC"></path> + <path d="M171.48 250.03C172.18 249.68 171.83 248.7 171.55 248.43C171.27 248.16 169.86 249.2 169.85 249.65C169.84 250.1 170.78 250.38 171.48 250.04V250.03Z" fill="#308DCC"></path> + <path d="M162.24 271.8C161.39 271.07 160.21 271.16 159.54 271.99C159.06 272.6 159 273.29 159.34 273.8L160.31 274.5C160.72 274.63 161.18 274.65 161.58 274.57C161.6 274.59 161.61 274.61 161.63 274.64L163.29 272.21C163.11 272.22 162.87 272.23 162.61 272.26C162.52 272.09 162.4 271.93 162.24 271.8V271.8Z" fill="#308DCC"></path> + <path d="M162.7 262.19C162.43 261.3 161.72 260.58 161.02 260.61C160.38 260.63 159.69 261.19 159.35 261.83C158.91 262.09 158.65 262.77 159.08 263.36C159.19 263.51 159.41 263.63 159.64 263.7C160.05 264.13 160.65 264.43 161.2 264.39C161.59 264.36 161.94 264.21 162.22 263.99C162.65 264.29 163.33 264.27 163.65 263.9C164 263.51 163.93 262.85 163.5 262.49C163.26 262.28 162.97 262.19 162.7 262.2V262.19Z" fill="#308DCC"></path> + <path d="M177.26 247.95C176.89 248.35 176.91 248.84 177.32 249.25C177.75 249.68 178.36 249.7 178.74 249.3C179.12 248.9 179.1 248.18 178.71 247.86C178.29 247.52 177.62 247.57 177.26 247.96V247.95Z" fill="#308DCC"></path> + <path d="M185.43 239.72C185.32 239.88 185.24 240.04 185.19 240.2L185.71 239.43C185.61 239.51 185.51 239.61 185.43 239.72V239.72Z" fill="#308DCC"></path> + <path d="M152 266.6C151.82 266.68 151.59 266.94 151.62 267.18C151.65 267.41 152.05 267.52 152.24 267.5C152.39 267.48 152.79 267.14 152.73 266.86C152.68 266.58 152.14 266.54 151.99 266.61L152 266.6Z" fill="#308DCC"></path> + <path d="M181.71 243.38C181.77 243.32 181.84 243.26 181.9 243.19C182.64 242.41 182.37 241.66 181.85 240.89C182.28 240.51 182.96 240.3 182.62 239.53C182.4 239.05 182.01 238.86 181.55 238.94C180.73 239.08 180.8 239.77 180.81 240.39C180.45 240.49 180.12 240.58 179.78 240.67C179.63 240.19 179.49 239.78 179.36 239.35C178.97 239.27 178.63 239.14 178.28 239.13C177.72 239.13 176.81 239.81 176.72 240.23C176.61 240.77 177.08 241.39 177.84 241.69C178.08 241.78 178.34 241.85 178.6 241.94C178.73 242.58 178.8 243.28 179.23 243.7C179.14 243.83 179.05 243.96 178.97 244.1C178.61 244.76 179.15 246.06 179.86 246.28C180 246.32 180.18 246.33 180.35 246.31C180.21 246.44 180.08 246.61 180.05 246.76C180 247.02 180.11 247.23 180.28 247.36L181.13 246.12C181.13 246.12 181.06 246.12 181.02 246.11C181.08 246.08 181.14 246.05 181.2 246.01L182.01 244.82C182.08 244.21 181.95 243.73 181.7 243.37L181.71 243.38Z" fill="#308DCC"></path> + <path d="M176.28 230.22C176.8 229.63 176.88 228.87 176.59 228.15L174.7 230.8C175.29 230.9 175.85 230.71 176.28 230.22V230.22Z" fill="#308DCC"></path> + <path d="M185.81 230.03C185.17 229.49 184.07 229.48 183.65 230.02C183.5 230.21 183.42 230.52 183.39 230.85C183.32 230.78 183.22 230.72 183.09 230.71C182.73 230.67 181.82 230.73 181.68 231.1C181.54 231.47 182.34 232.01 182.66 232.17C183.01 232.34 183.34 232.17 183.47 231.77C183.55 232.06 183.66 232.31 183.83 232.45C184.37 232.91 185.36 232.79 185.88 232.2C186.38 231.63 186.34 230.49 185.81 230.04V230.03Z" fill="#308DCC"></path> + <path d="M180.44 231.26C181.16 230.44 181.02 229.38 180.08 228.57C179.46 228.03 178.31 228.18 177.67 228.87C176.97 229.63 177.09 230.53 177.98 231.31C178.88 232.09 179.73 232.08 180.44 231.26Z" fill="#308DCC"></path> + <path d="M167.21 263.06C166.68 263.6 166.76 264.44 167.41 265.05C167.58 265.22 167.81 265.27 168.04 265.27L169.39 263.29C169.39 263.29 169.33 263.2 169.29 263.16C168.82 262.77 167.56 262.7 167.21 263.05V263.06Z" fill="#308DCC"></path> + <path d="M183.35 236.34C183.69 235.96 183.64 235.44 183.23 235.04C182.72 234.56 181.88 234.53 181.42 234.97C180.99 235.38 180.98 236.14 181.4 236.52C181.84 236.93 182.91 236.83 183.35 236.34V236.34Z" fill="#308DCC"></path> + <path d="M179.95 224.88C179.95 224.88 179.91 224.94 179.89 224.97C179.33 224.97 178.9 225.36 178.67 226.14C178.51 226.68 178.9 227.49 179.41 227.66C180.02 227.87 181.44 227.3 181.58 226.8C181.58 226.77 181.58 226.75 181.58 226.72C181.69 226.65 181.79 226.56 181.86 226.46C182.11 226.12 182.07 225.74 181.78 225.4L181.22 224.95C180.67 224.61 180.21 224.57 179.93 224.88H179.95Z" fill="#308DCC"></path> + <path d="M172.54 246.21C173.15 246.11 173.62 245.7 174.01 245.1C174.4 244.49 175.14 244.33 175.24 243.61C175.39 242.64 175.15 241.07 173.61 240.34C172.68 239.9 171.9 239.93 171.26 240.28C170.9 240.48 170.76 240.84 170.66 241.23C170.27 241.56 170.03 242.06 170.05 242.59C170.05 242.61 170.05 242.62 170.05 242.64C170 242.71 169.95 242.77 169.91 242.84C169.71 242.57 169.44 242.42 169 242.47C168.51 242.53 168.12 242.81 168.19 243.32C168.24 243.71 168.44 244.24 168.74 244.4C169.09 244.58 169.37 244.52 169.62 244.34C169.8 245.05 170.45 245.61 171.16 245.99C171.61 246.23 172.08 246.28 172.53 246.21H172.54Z" fill="#308DCC"></path> + <path d="M173.22 255.69C172.89 256.08 173.01 256.7 173.47 257.09C173.5 257.12 173.54 257.13 173.58 257.15L174.65 255.59C174.19 255.25 173.56 255.28 173.22 255.69V255.69Z" fill="#308DCC"></path> + <path d="M157.25 266.82C156.93 266.51 156.07 267 155.85 267.74C155.63 268.49 156.58 268.91 156.97 268.89C157.36 268.87 157.56 267.13 157.25 266.82Z" fill="#308DCC"></path> + <path d="M178.68 235.48C178.92 234.44 177.58 232.57 176.63 232.36C175.68 232.14 175.09 233.2 174.81 233.18C174.63 233.17 174.32 232.56 173.81 232.06L170.76 236.33C170.86 236.4 170.95 236.46 171.06 236.52C170.96 236.87 171.06 237.25 171.35 237.49C171.73 237.8 172.51 237.75 172.81 237.39C173.02 237.14 173.05 236.8 172.93 236.5C173.59 236.11 174.17 235.47 174.44 235.54C174.57 235.57 174.73 235.83 174.93 236.13C174.73 236.18 174.56 236.25 174.53 236.36C174.5 236.44 174.53 236.55 174.59 236.68C174.35 236.84 174.45 237.51 174.58 237.66C174.7 237.81 175.18 237.83 175.35 237.71C175.38 237.68 175.41 237.64 175.44 237.59C175.68 237.63 175.92 237.48 176.1 237.22C176.21 237.26 176.33 237.3 176.46 237.31C177.67 237.44 178.44 236.53 178.68 235.49V235.48Z" fill="#308DCC"></path> + <path d="M163.85 246.02C163.94 246.48 164.18 246.93 164.57 247.23C164.76 247.38 164.95 247.47 165.15 247.54C164.87 247.69 164.6 247.95 164.37 248.26C164.37 248.21 164.4 248.17 164.4 248.13C164.4 247.56 163.86 246.99 163.32 247C163.24 247 163.18 247.03 163.11 247.05L162.4 248.04C162.4 248.04 162.4 248.06 162.4 248.07C162.43 248.68 162.85 249.14 163.37 249.12C163.62 249.12 163.85 249.01 164.03 248.85C163.91 249.14 163.84 249.44 163.86 249.69C163.88 249.91 163.97 250.12 164.11 250.32C164.05 250.75 164.23 251.21 164.52 251.43C164.88 251.7 165.49 251.62 165.84 251.2C166.39 251.23 166.87 251.23 167.22 251.86C167.5 252.36 168.06 252.21 168.52 251.89C168.65 251.13 168.35 250.69 167.71 250.63C167.65 249.86 167.7 249.27 167.55 248.74C167.4 248.23 166.72 247.73 166.1 247.52C166.46 247.39 166.81 247.12 167.1 246.7C167.91 245.53 167.85 244.93 166.95 244.15C166.51 243.8 166.03 243.67 165.56 243.74C165.57 243.74 165.58 243.73 165.59 243.72C165.59 243.69 165.57 243.65 165.57 243.62L163.86 246.02H163.85Z" fill="#308DCC"></path> + <path d="M189.37 233.64C189 233.33 188.26 233.45 187.96 233.87C187.65 234.31 187.79 234.9 188.28 235.26C188.35 235.31 188.42 235.33 188.49 235.37L189.53 233.85C189.48 233.78 189.44 233.7 189.37 233.65V233.64Z" fill="#308DCC"></path> + <path d="M183.45 227.54C183.3 228.03 183.54 228.51 184.03 228.71C184.6 228.93 185.12 228.74 185.36 228.27L183.84 227.04C183.66 227.17 183.51 227.34 183.45 227.54V227.54Z" fill="#308DCC"></path> + <path d="M184.47 237.23C184.55 237.07 184.55 236.51 184.32 236.42C184.09 236.33 183.68 236.7 183.63 236.86C183.57 237.03 183.63 237.41 183.86 237.51C184.09 237.61 184.39 237.39 184.47 237.23Z" fill="#308DCC"></path> + <path d="M187.34 230.2C187.16 230.15 187.02 230.32 186.99 230.41C186.96 230.5 187.11 230.7 187.2 230.72C187.29 230.74 187.48 230.72 187.53 230.59C187.58 230.46 187.53 230.25 187.35 230.2H187.34Z" fill="#308DCC"></path> + <path d="M173.32 285.62C154.75 285.62 139.64 270.51 139.64 251.94C139.64 233.37 154.75 218.26 173.32 218.26C191.89 218.26 207 233.37 207 251.94C207 270.51 191.89 285.62 173.32 285.62ZM173.32 229.21C160.79 229.21 150.59 239.41 150.59 251.94C150.59 264.47 160.79 274.67 173.32 274.67C185.85 274.67 196.05 264.47 196.05 251.94C196.05 239.41 185.85 229.21 173.32 229.21V229.21Z" fill="white"></path> + <path d="M196.305 267.192L188.562 274.935L207.675 294.048L215.418 286.305L196.305 267.192Z" fill="white"></path> + <path d="M625.47 99.88C637.548 99.88 647.34 90.0885 647.34 78.01C647.34 65.9315 637.548 56.14 625.47 56.14C613.392 56.14 603.6 65.9315 603.6 78.01C603.6 90.0885 613.392 99.88 625.47 99.88Z" fill="#F6947E"></path> + <path d="M730.53 296.49H671.16V355.86H730.53V296.49Z" fill="#20BBB1"></path> + <path d="M694.47 345.1L678.02 328.65L685.34 321.33L694.47 330.47L715.13 309.82L722.44 317.13L694.47 345.1Z" fill="white"></path> + <path d="M59.9 54.47H0.530029V113.84H59.9V54.47Z" fill="#20BBB1"></path> + <path d="M23.85 103.07L7.40002 86.62L14.71 79.31L23.85 88.45L44.5 67.79L51.81 75.1L23.85 103.07Z" fill="white"></path> + <path d="M169.91 342.61H25.88V473.64H169.91V342.61Z" fill="#42A4DC"></path> + <path d="M131.94 455.23C131.66 456.18 132.07 457.22 132.79 457.41C133.44 457.58 134.21 457.37 134.79 456.96C134.87 457.2 134.99 457.45 135.16 457.71C136.24 459.33 137.09 459.56 138.53 458.54C139.62 457.77 140.74 457.06 141.82 456.34C143.57 458.42 143.87 458.44 145.14 456.78C144.72 455.47 143.82 455.09 142.55 455.33C140.92 452.4 139.07 452.37 137.36 455.11C137.15 455.08 136.92 455.08 136.71 455.01C136.19 454.83 135.81 454.89 135.51 455.09C135.3 454.63 134.88 454.19 134.41 454.05C133.23 453.68 132.27 454.14 131.94 455.24V455.23Z" fill="#308DCC"></path> + <path d="M143.56 464.17C143.65 464.2 143.74 464.22 143.84 464.23C144.19 464.4 144.61 464.48 145.01 464.31C145.33 464.17 145.65 463.69 145.68 463.33C145.7 463.11 145.65 462.92 145.57 462.75C145.57 462.74 145.58 462.72 145.59 462.71C145.81 462.06 145.51 461.66 144.94 461.43C144.1 461.09 143.02 461.42 142.8 462.05C142.55 462.76 142.99 463.95 143.57 464.17H143.56Z" fill="#308DCC"></path> + <path d="M95.29 473.5C95.46 472.81 95.09 472.11 94.47 471.94C93.75 471.74 92.99 472.13 92.78 472.81C92.7 473.08 92.72 473.37 92.81 473.64H95.24C95.24 473.64 95.28 473.55 95.29 473.5V473.5Z" fill="#308DCC"></path> + <path d="M85.76 459.88C85.53 460.49 85.91 461.21 86.57 461.44C87.28 461.69 88 461.41 88.22 460.82C88.46 460.18 88.16 459.43 87.55 459.17C86.91 458.9 85.99 459.26 85.76 459.88Z" fill="#308DCC"></path> + <path d="M81.5 457.85C81.8 458.04 82.34 458.08 82.67 457.95C83.35 457.68 83.42 457.11 83.04 455.78C82.34 455.69 81.54 455.33 81.09 456.26C80.8 456.86 80.94 457.49 81.5 457.85Z" fill="#308DCC"></path> + <path d="M159.49 473.36C159.16 473.25 158.97 473.48 158.92 473.63H159.8C159.75 473.51 159.66 473.41 159.49 473.36Z" fill="#308DCC"></path> + <path d="M84.25 466.36C83.98 467.22 84.34 468.08 85.04 468.28C85.7 468.46 86.36 468.07 86.55 467.36C86.84 467.58 87.22 467.74 87.7 467.8C88.32 467.88 88.84 467.94 89.3 468.43C89.98 469.15 90.92 469.02 91.77 468.89C92.56 468.77 93.26 467.84 93.36 467C93.37 466.92 93.37 466.84 93.38 466.76C93.64 467.25 94.07 467.66 94.54 467.81C94.98 467.95 95.42 467.81 95.79 467.45C95.72 467.63 95.67 467.82 95.66 468.01C95.61 469.14 96.21 469.89 97.21 469.95C98.13 470.01 99.06 469.41 99.09 468.73C99.13 467.73 98.1 466.58 97.05 466.48C96.78 466.45 96.5 466.57 96.26 466.78C96.31 466.67 96.36 466.55 96.41 466.42C96.69 465.61 96.33 464.51 95.71 464.3C94.85 464 93.47 464.57 93.17 465.34C93.13 465.45 93.1 465.57 93.1 465.7C92.92 465.43 92.66 465.2 92.3 465C91.41 464.5 90.54 464.54 89.6 464.68C89.27 464.73 88.88 464.7 88.59 464.55C87.42 463.97 86.54 464.28 86.08 465.51C85.96 465.39 85.82 465.3 85.68 465.26C85.13 465.13 84.46 465.65 84.24 466.37L84.25 466.36Z" fill="#308DCC"></path> + <path d="M96.21 454.08C95.86 454.87 95.66 455.75 95.53 456.61C95.39 457.52 96.38 458.67 97.3 458.91C97.86 459.05 98.35 458.96 98.57 458.45C99.14 457.16 99.59 455.83 99.34 454.38C99.34 454.34 99.31 454.3 99.3 454.26C100.26 454.17 100.85 453.57 100.86 452.62C100.87 451.56 100.24 450.88 99.16 450.83C98.82 450.81 98.48 450.88 98.17 451.01C98.18 450.9 98.17 450.79 98.13 450.7C97.99 450.44 97.48 450.5 97.27 450.61C97.1 450.7 96.8 451.27 96.99 451.57C97.05 451.66 97.14 451.7 97.25 451.71C97.14 451.88 97.06 452.06 97.05 452.25C97.03 452.5 97.14 452.79 97.3 453.07C96.85 453.19 96.45 453.52 96.2 454.09L96.21 454.08Z" fill="#308DCC"></path> + <path d="M73.37 449.55C73.7 448.48 72.94 446.9 71.93 446.58C70.67 446.18 69.2 446.78 68.9 447.82C68.61 448.84 69.55 450.79 70.52 451.16C71.57 451.56 72.99 450.76 73.37 449.55V449.55Z" fill="#308DCC"></path> + <path d="M134.94 462.97C134.11 462.97 133.39 463.58 133.36 464.34C133.34 464.99 134.37 466.36 134.95 466.45C135.37 466.51 135.79 466.29 136.1 465.89C137.16 466.11 138.02 465.6 138.45 464.46C138.66 463.9 138.59 463.26 138.33 462.74C139.08 462.7 139.84 462.69 140.47 462.09C141.45 461.16 141.5 461.03 140.68 459.75C140.03 459.74 139.49 459.75 138.96 459.71C138.08 459.65 137.12 460.41 137 461.28C136.98 461.42 137 461.58 137.04 461.74C136.31 461.66 135.44 462.18 134.92 462.98L134.94 462.97Z" fill="#308DCC"></path> + <path d="M82.91 471.49C81.94 471.17 80.87 471.51 80.67 472.21C80.55 472.62 80.68 473.15 80.95 473.63H84.11C84.45 472.58 84.05 471.86 82.92 471.48L82.91 471.49Z" fill="#308DCC"></path> + <path d="M146.02 472.32C145.62 472.2 145.27 472.23 144.97 472.38C144.71 472.12 144.38 471.92 144.02 471.85C143.38 471.72 142.47 472.31 142.38 472.91C142.34 473.16 142.33 473.41 142.35 473.64H147.55C147.29 473.07 146.72 472.54 146.02 472.33V472.32Z" fill="#308DCC"></path> + <path d="M124.74 455.7C124.01 455.47 122.75 456.17 122.47 456.95C122.24 457.59 122.99 458.8 123.74 459.01C124.34 459.18 125.22 458.78 125.41 458.26C125.83 457.1 125.53 455.94 124.73 455.69L124.74 455.7Z" fill="#308DCC"></path> + <path d="M78.95 461.48C78.64 462.28 78.9 463.01 79.59 463.23C80.31 463.47 81.79 462.98 82.03 462.42C82.06 462.34 82.08 462.26 82.1 462.18C82.24 462.23 82.38 462.27 82.54 462.28C83.16 462.32 83.79 461.75 83.84 461.09C83.91 460.27 83.43 459.65 82.69 459.6C82.1 459.57 81.6 459.94 81.39 460.49C81.24 460.38 81.08 460.29 80.9 460.21C80.17 459.91 79.35 460.44 78.95 461.47V461.48Z" fill="#308DCC"></path> + <path d="M89.78 458.48C89.47 458.65 89.23 459.34 89.31 459.72C89.53 460.66 90.76 460.95 91.39 460.56C92.01 460.17 92.16 459.02 91.27 458.45C90.91 458.22 90.18 458.26 89.79 458.49L89.78 458.48Z" fill="#308DCC"></path> + <path d="M125.29 464.39C125.55 463.72 125.24 462.99 124.6 462.78C123.97 462.58 123.17 462.97 123 463.57C122.83 464.16 123.17 464.77 123.8 465C124.47 465.24 125.05 465 125.29 464.39Z" fill="#308DCC"></path> + <path d="M163.16 471.78C162.43 471.45 161.35 471.82 161.25 472.45C161.2 472.75 161.56 473.2 162.01 473.55C161.98 473.58 161.96 473.6 161.93 473.63H163.8C163.98 473.02 163.71 472.02 163.16 471.77V471.78Z" fill="#308DCC"></path> + <path d="M154.67 464.23C154.86 463.59 154.53 463.16 153.98 462.95C153.48 462.76 153.03 462.95 152.78 463.47C152.65 463.74 152.63 464.01 152.69 464.24C152.19 463.83 152.22 463.51 152.22 463C152.22 462.22 151.38 461.61 150.63 461.68C149.85 461.75 149.69 462.24 149.72 462.89C149.73 463.15 149.76 463.44 149.75 463.7C149.64 463.62 149.54 463.55 149.42 463.52C148.79 463.34 148.11 463.75 147.91 464.43C147.72 465.09 148.05 465.91 148.6 466.09C148.62 466.09 148.64 466.09 148.65 466.09C148.46 466.4 148.28 466.71 148.09 467.04C146.77 466.86 145.96 466.92 145.52 467.34C145.38 467.15 145.26 466.94 145.12 466.73C144.97 466.5 144.28 466.42 143.95 466.56C143.62 466.7 143.29 467.16 143.22 467.53C143.17 467.78 143.52 468.22 143.8 468.39C144.21 468.63 144.66 468.8 145.11 468.97C145.11 469.14 145.12 469.3 145.15 469.49C145.29 470.71 146.43 471.46 147.59 470.93C148.08 470.7 148.52 470.37 148.97 469.99C149.13 470.42 149.55 470.75 150.22 470.95C150.99 471.18 151.65 470.95 151.88 470.38C151.97 470.16 151.95 469.84 151.88 469.5C152.42 469.5 152.94 469.35 153.4 468.91C154.44 467.9 154.37 466.1 153.34 464.86C153.88 465 154.5 464.73 154.65 464.22L154.67 464.23Z" fill="#308DCC"></path> + <path d="M69.4 472.33C69.3 471.64 69.24 470.9 68.26 470.8C67.55 470.73 66.84 470.56 66.13 470.43C65.41 469.99 64.8 470.22 64.5 470.84C64.18 471.5 64.43 472.16 65.13 472.64C65.51 472.89 65.94 473.15 66.16 473.52C66.19 473.57 66.22 473.6 66.25 473.64H69.01C69.27 473.2 69.44 472.69 69.39 472.33H69.4Z" fill="#308DCC"></path> + <path d="M78.41 473.62C78.61 473.02 78.2 472.36 77.49 472.12C76.88 471.91 76.25 472.19 76.01 472.76C75.88 473.08 75.87 473.38 75.95 473.63H78.41C78.41 473.63 78.41 473.63 78.41 473.62V473.62Z" fill="#308DCC"></path> + <path d="M74.83 466.67C74.82 467.09 75.04 467.51 75.12 467.8C75.91 468.01 76.55 467.55 76.69 466.95C76.82 466.38 76.45 466.18 76.03 466.02C75.44 465.81 74.84 466.09 74.83 466.67V466.67Z" fill="#308DCC"></path> + <path d="M71.07 463.29C70.48 463.08 69.88 463.36 69.87 463.94C69.86 464.36 70.08 464.78 70.16 465.07C70.95 465.28 71.59 464.82 71.73 464.22C71.86 463.65 71.49 463.45 71.07 463.29V463.29Z" fill="#308DCC"></path> + <path d="M152.75 454.96C152.36 454.85 151.63 455.2 151.33 455.71C151.1 455.38 150.7 455.13 150.28 454.9C149.6 455.29 148.85 455.66 148.99 456.57C149.08 457.19 149.61 457.68 150.3 457.55C150.72 457.47 151.28 457.16 151.42 456.81C151.42 456.81 151.42 456.81 151.42 456.79C151.7 457.17 152.21 457.4 152.69 457.18C153.02 457.02 153.04 456.16 153.14 455.61C153.17 455.46 153.24 455.1 152.76 454.96H152.75Z" fill="#308DCC"></path> + <path d="M101.8 473.64H102.63C102.34 473.61 102.06 473.6 101.8 473.64Z" fill="#308DCC"></path> + <path d="M111.23 465.25C110.38 464.87 108.9 465.52 108.61 466.42C108.42 467.02 109.07 467.92 109.93 468.25C110.77 468.57 111.7 468.29 111.99 467.65C112.13 467.49 112.23 467.31 112.25 467.1C112.29 466.69 112.15 466.32 111.92 466.04C111.76 465.68 111.52 465.39 111.23 465.25V465.25Z" fill="#308DCC"></path> + <path d="M128.46 467.45C127.75 467.22 127.04 467.56 126.86 468.2C126.69 468.82 127.07 469.43 127.71 469.57C128.4 469.72 129.11 469.32 129.25 468.68C129.4 468.02 129.05 467.64 128.45 467.45H128.46Z" fill="#308DCC"></path> + <path d="M71.6 458.42C71.32 458.32 70.81 458.78 70.75 458.98C70.69 459.2 70.75 459.66 71.05 459.77C71.34 459.89 71.7 459.6 71.8 459.41C71.9 459.22 71.88 458.52 71.6 458.42Z" fill="#308DCC"></path> + <path d="M60.76 459.79C60.68 459.91 60.69 460.49 61.01 460.62C61.34 460.75 61.66 460.23 61.77 460.01C61.83 459.87 61.7 459.45 61.48 459.37C61.26 459.29 60.91 459.59 60.76 459.8V459.79Z" fill="#308DCC"></path> + <path d="M100.3 468.81C99.91 469.89 100.74 471.61 101.81 471.95C102.85 472.28 104.35 471.45 104.71 470.36C104.89 469.79 104.84 469.2 104.62 468.72C104.94 468.5 105.19 468.19 105.23 467.88C105.37 466.55 104.82 465.47 103.97 465.4C103.18 465.34 102.05 466.39 101.98 467.25C101.98 467.37 102 467.5 102.05 467.64C101.23 467.77 100.53 468.2 100.31 468.82L100.3 468.81Z" fill="#308DCC"></path> + <path d="M126.73 473.64H127.17C127.02 473.61 126.87 473.61 126.73 473.64Z" fill="#308DCC"></path> + <path d="M60.06 469C61.39 469.26 62.43 468.12 62.76 467C63.09 465.88 61.71 463.92 60.28 463.87C59.25 463.83 59.04 465.15 59.42 465.79C59.8 466.43 59.59 466.27 59.21 466.93C58.83 467.59 58.72 468.74 60.05 469H60.06Z" fill="#308DCC"></path> + <path d="M131.2 423.78C132.56 423.84 133.74 422.89 133.86 421.65C133.99 420.34 133.14 419.42 131.72 419.32C130.22 419.22 129.25 419.93 129.16 421.21C129.08 422.45 130.09 423.73 131.19 423.78H131.2Z" fill="#308DCC"></path> + <path d="M102.36 399.44C101.06 399.33 99.47 400.49 99.45 401.55C99.43 402.64 100.26 403.58 101.34 403.69C102.72 403.82 103.85 402.89 103.93 401.56C104 400.4 103.35 399.52 102.37 399.44H102.36Z" fill="#308DCC"></path> + <path d="M144.69 448.45C143.03 448.7 142.9 449.05 143.89 450.36C143.72 451.2 143.4 451.85 143.53 452.39C143.67 452.96 144.16 453.52 144.64 453.92C145.22 454.41 146.08 454.04 146.42 453.14C146.62 452.61 146.83 451.85 146.61 451.43C146.32 450.91 145.59 450.63 144.98 450.19C145.19 449.64 145.45 448.96 144.7 448.44L144.69 448.45Z" fill="#308DCC"></path> + <path d="M149.26 397.01C149.22 398 149.86 398.91 150.61 398.92C151.72 398.92 152.89 397.89 152.99 396.83C153.02 396.46 152.77 396.04 152.4 395.73C153.62 395.19 154.27 394.18 153.91 393.41C153.57 392.7 152.1 392.23 151.32 392.6C150.71 392.88 150.32 394.2 150.62 394.93C150.67 395.06 150.77 395.18 150.88 395.29C149.92 395.4 149.31 396.04 149.26 397.02V397.01Z" fill="#308DCC"></path> + <path d="M129.97 397.62C129.88 398.32 130.87 399.27 131.82 399.39C132.73 399.51 133.53 398.95 133.61 398.14C133.71 397.1 132.93 395.95 132.1 395.92C131.95 395.92 131.81 395.93 131.66 395.96C131.42 395.75 130.99 395.73 130.82 395.81C130.63 395.9 130.46 396.34 130.52 396.56C130.52 396.56 130.53 396.57 130.54 396.58C130.24 396.88 130.02 397.24 129.97 397.62Z" fill="#308DCC"></path> + <path d="M168.82 465.47C168.94 464.49 168.15 463.69 166.99 463.6C166.44 463.56 166.01 463.8 165.75 464.28C165.45 464.01 165.08 463.85 164.72 463.89C164.3 463.94 163.97 464.09 163.7 464.32C164.62 462.75 164.35 461.98 162.73 460.46C162.69 460.42 162.66 460.37 162.61 460.3V460.28C162.89 460.51 163.27 460.7 163.48 460.77C163.97 460.94 164.47 460.76 164.59 460.12C164.71 459.47 164.39 458.92 163.83 458.88C163.57 458.86 163.03 459.03 162.66 459.27C162.59 458.57 162.26 458.17 161.66 458.11C160.85 458.03 160.13 458.75 160.32 459.72C160.49 460.57 160 460.9 159.54 461.44C158.02 460.26 156.88 460.51 156.24 462.06C156.18 462.21 156.12 462.37 156.09 462.53C155.82 463.64 156.2 464.21 157.32 464.36C158.26 464.49 159.19 464.54 159.76 463.14C160.01 463.77 160.22 464.09 160.24 464.42C160.28 465.14 160.62 465.55 161.31 465.66C162.03 465.78 162.71 465.77 163.2 465.1C163.17 465.17 163.13 465.23 163.11 465.31C162.86 466.15 163.26 466.75 163.94 467.09C164.5 467.37 165.48 468.27 166.24 467.75C166.57 467.53 166.65 467.28 166.64 467.04C167.35 467 168.77 465.99 168.83 465.45L168.82 465.47Z" fill="#308DCC"></path> + <path d="M161.93 423.11C162.64 423.17 164.06 422.06 164.1 421.43C164.14 420.77 163.83 420.25 163.24 419.97C163.88 419.54 164.35 418.88 163.94 417.92C163.6 417.13 162.44 416.67 161.6 416.9C161.59 416.9 161.58 416.9 161.57 416.91C161.74 416.58 161.82 416.19 161.81 415.79C162.16 416.37 162.88 416.91 163.46 416.9C163.98 416.9 164.72 416.13 164.93 415.49C164.96 415.55 164.98 415.6 165.01 415.66C165.45 415.59 165.83 415.58 166.18 415.45C166.66 415.28 166.97 414.9 167.05 414.48C167.43 414.63 167.89 414.63 168.35 414.43C168.85 414.22 169.28 413.9 169.89 414.23V410.98C169.83 411 169.78 411.02 169.75 411.06C169.54 411.34 169.32 411.48 169.08 411.54C168.85 410.85 167.96 410.23 167.03 410.18C166.05 410.13 165.48 410.79 165.45 412.03C165.45 412.39 165.63 412.79 165.91 413.09C165.74 413.07 165.56 413.09 165.39 413.15C164.98 413.32 164.66 413.74 164.31 414.05C164.3 414.05 164.29 414.04 164.28 414.03L164.26 414C164.26 414 164.26 414.02 164.27 414.03C164.1 413.92 163.92 413.85 163.75 413.85C162.57 413.82 161.75 414.25 161.61 414.94C161.59 414.89 161.58 414.83 161.55 414.77C161.07 413.84 159.48 413.41 158.51 413.97C157.89 414.32 157.5 414.97 157.44 415.61C157.27 415.55 157.08 415.51 156.86 415.54C155.84 415.68 155.21 416.09 155.25 416.6C155.28 417.14 156.32 417.99 156.9 417.96C157.27 417.94 157.72 417.42 157.92 416.9C158.5 417.45 159.55 417.8 160.35 417.73C160.13 418.02 159.99 418.34 160.03 418.65C160.12 419.37 158.44 419.09 158.5 420.1C158.55 421.05 157.43 421.58 157.64 422.78C157.85 423.99 158.82 425.03 159.77 424.48C160.51 424.06 160.88 423.48 161.2 422.78C161.38 422.96 161.61 423.07 161.89 423.1L161.93 423.11Z" fill="#308DCC"></path> + <path d="M120.29 470.27C120.7 470.07 121.1 469.69 121.39 469.05C121.5 468.8 121.54 468.55 121.55 468.3C122.22 468.15 123.05 467.65 123.28 467.12C123.51 466.59 123.89 465.88 123.28 465.46C122.47 464.89 122.26 464.13 122.12 463.26C122.04 462.76 121.77 462.48 121.38 462.39C121.76 461.81 120.82 460.54 119.73 460.37C119 460.26 118.57 460.6 118.31 461.2C117.96 462 118.17 463.15 118.78 463.44C119.11 463.6 119.41 463.63 119.69 463.59C119.69 463.72 119.72 463.85 119.8 463.97C120.4 464.85 120.24 465.59 119.92 466.28C119.92 466.31 119.92 466.34 119.92 466.36C118.92 466.57 118.76 467.19 118.44 466.99C118.11 466.79 117.68 466.01 117.01 466.21C116.34 466.41 116.06 468.5 116.19 468.83C116.32 469.16 117.02 469.88 116.44 470.32C115.86 470.76 114.95 470.79 114.7 471.52C114.54 472 114.22 472.86 114.25 473.64H118.1C118.18 473.46 118.23 473.26 118.23 473.04C118.23 472.36 117.99 471.7 117.94 471.23C118.06 471.26 118.17 471.3 118.31 471.31C119.51 471.37 120.15 471.04 120.32 470.28L120.29 470.27Z" fill="#308DCC"></path> + <path d="M161.45 400.93C161.12 400.91 160.79 400.96 160.52 401.1C159.97 401.4 159.84 401.98 160.17 402.66C160.67 403.68 161.28 404.12 161.86 403.88C162.2 403.74 162.49 403.33 162.65 402.88C162.66 402.88 162.67 402.88 162.69 402.89C163.45 402.98 164.2 402.08 164.3 400.98C164.33 400.66 164.25 400.43 164.11 400.26C164.72 400.77 165.69 400.94 166.51 400.6C167.69 400.11 168.03 399.05 167.43 397.71C166.83 396.36 165.87 395.94 164.65 396.48C163.42 397.02 163.02 398.29 163.65 399.68C163.74 399.87 163.87 400.03 164.02 400.18C163.86 400.03 163.63 399.94 163.36 399.9C162.5 399.78 161.58 400.31 161.45 400.94V400.93Z" fill="#308DCC"></path> + <path d="M159.65 453.19C159.65 452.49 159 451.76 158.35 451.73C157.83 451.7 156.87 452.71 156.87 453.28C156.87 453.73 157.7 454.44 158.26 454.48C159.01 454.53 159.65 453.93 159.65 453.2V453.19Z" fill="#308DCC"></path> + <path d="M112.6 469.96C112.6 469.96 112.59 469.94 112.58 469.93C112.23 469.55 111.52 469.93 111.31 470.43C111.01 471.1 111.32 471.57 111.81 471.67C112.2 471.76 112.92 471.85 113.11 471.34C113.13 471.29 113.11 471.24 113.13 471.19C113.4 471.4 113.73 471.56 114.05 471.72C115.26 470.89 115.55 470.38 115.22 469.65C114.98 469.11 114.54 468.83 113.92 468.88C113.29 468.93 112.68 469.38 112.6 469.94V469.96Z" fill="#308DCC"></path> + <path d="M116.94 422.27C116.19 422.25 115.55 422.81 115.51 423.52C115.47 424.22 116.09 424.93 116.75 424.94C117.41 424.94 118.11 424.24 118.11 423.58C118.11 422.87 117.58 422.28 116.94 422.26V422.27Z" fill="#308DCC"></path> + <path d="M105.57 412.67C105.5 413.31 106.03 413.93 106.73 413.99C107.48 414.06 108.11 413.62 108.18 412.99C108.26 412.31 107.78 411.65 107.14 411.55C106.45 411.44 105.65 412.02 105.57 412.67Z" fill="#308DCC"></path> + <path d="M100.17 410.29C100.03 410.94 100.32 411.52 100.95 411.73C101.29 411.84 101.82 411.75 102.11 411.54C102.71 411.11 102.63 410.54 101.95 409.35C101.24 409.43 100.39 409.28 100.17 410.29Z" fill="#308DCC"></path> + <path d="M101.82 439.62C102.48 439.67 103.13 439.14 103.22 438.49C103.31 437.82 102.93 437.34 102.23 437.22C101.49 437.09 100.86 437.51 100.76 438.19C100.66 438.87 101.19 439.58 101.82 439.62V439.62Z" fill="#308DCC"></path> + <path d="M111.26 473.64C111.31 473.58 111.35 473.51 111.39 473.43C111.53 473.14 111.42 472.46 111.19 472.31C110.8 472.04 110.15 471.84 109.74 471.99C109.38 472.11 109.22 472.31 109.16 472.56C107.99 472.3 107.09 472.7 106.68 473.65H111.25L111.26 473.64Z" fill="#308DCC"></path> + <path d="M112.63 396.62C112.11 396.39 111.29 396.69 111.1 397.18C110.84 397.88 112.07 399.05 112.58 398.85C113.09 398.65 113.29 396.93 112.62 396.63L112.63 396.62Z" fill="#308DCC"></path> + <path d="M119.41 389.93C118.52 389.77 117.88 389.98 117.96 391.12C118.05 392.27 119.73 392.33 120.06 391.88C120.39 391.42 120.04 390.04 119.41 389.93V389.93Z" fill="#308DCC"></path> + <path d="M149.57 460.34C149.62 459.55 148.97 458.68 148.3 458.75C147.49 458.84 146.88 459.26 146.76 460.15C146.65 460.95 147.4 461.66 148.35 461.68C149 461.7 149.53 461.12 149.57 460.34Z" fill="#308DCC"></path> + <path d="M76.32 454.79C75.71 455.35 76.16 456.27 76.53 456.5C76.89 456.73 77.85 456.39 77.95 455.59C77.98 455.31 77.71 454.84 77.46 454.73C77.13 454.59 76.54 454.58 76.32 454.79V454.79Z" fill="#308DCC"></path> + <path d="M94.56 447.72C94.77 448.36 96.35 448.48 96.57 447.99C96.63 447.85 96.61 447.66 96.54 447.46C96.77 446.94 96.84 446.28 96.5 446.01C96.05 445.66 95.18 445.75 94.89 446.18C94.77 446.35 94.76 446.59 94.82 446.84C94.61 447.11 94.48 447.46 94.57 447.72H94.56Z" fill="#308DCC"></path> + <path d="M126.37 445.11C126.97 444.9 127.01 443.56 126.9 443.21C126.79 442.87 126.31 442.62 126.03 442.64C125.75 442.66 125.13 442.84 124.94 443.49C124.75 444.14 125.78 445.31 126.38 445.11H126.37Z" fill="#308DCC"></path> + <path d="M93.28 459.15C93.19 459.54 93.94 460.06 94.27 460.2C94.75 460.4 95.48 459.81 95.36 459.32C95.28 459 94.85 458.62 94.53 458.57C94.22 458.52 93.37 458.76 93.28 459.16V459.15Z" fill="#308DCC"></path> + <path d="M108.28 390.14C107.54 390.11 107.47 390.98 107.47 391.28C107.47 391.59 107.83 392.05 108.14 392.16C108.69 392.36 109.16 391.9 109.17 391.42C109.17 391.07 109.02 390.17 108.28 390.14Z" fill="#308DCC"></path> + <path d="M96.05 397.3C96.25 397.17 96.37 396.59 96.24 396.37C96.11 396.15 95.6 395.99 95.33 396.07C95.13 396.13 94.71 396.75 94.84 397.09C94.97 397.43 95.85 397.42 96.05 397.29V397.3Z" fill="#308DCC"></path> + <path d="M115.38 401.62C115.5 401.41 115.55 400.98 115.35 400.77C115.16 400.55 114.67 400.73 114.49 400.9C114.35 401.03 114.19 401.65 114.45 401.9C114.71 402.15 115.27 401.8 115.37 401.63L115.38 401.62Z" fill="#308DCC"></path> + <path d="M79.05 440.31C78.57 440.4 77.43 440.79 77.36 441.26C77.29 441.73 78.48 442.19 78.65 442.1C78.82 442.02 79.02 441.93 79.21 441.84C79.15 441.95 79.11 442.06 79.12 442.16C79.16 442.53 80.01 442.73 80.25 442.65C80.47 442.57 80.73 442.04 80.66 441.79C80.59 441.55 80.13 441.27 79.85 441.28C79.89 441.2 79.94 441.14 79.96 441.04C80.07 440.42 79.31 440.25 79.07 440.29L79.05 440.31Z" fill="#308DCC"></path> + <path d="M122.79 384.68C123.32 384.68 123.35 384.12 123.36 383.89C123.36 383.71 122.98 383.35 122.8 383.37C122.56 383.4 122.2 383.7 122.18 383.91C122.16 384.11 122.26 384.68 122.79 384.69V384.68Z" fill="#308DCC"></path> + <path d="M137.37 438.25C137.3 439.35 138.08 440.32 139.14 440.44C140.16 440.56 141.23 439.65 141.28 438.62C141.32 437.87 140.79 437.22 139.98 436.89C140.36 437.01 140.77 437.07 141.19 437.06C142.5 437.01 144.3 434.81 144.25 433.6C144.2 432.39 142.75 432.03 142.68 431.69C142.62 431.35 144.18 430.15 144.08 428.65C143.97 427.16 141.95 425.89 140.89 425.92C139.82 425.95 139.01 426.09 138.36 426.7C137.58 427.43 137.08 428.91 137.62 429.9C138.16 430.89 139.74 431.57 139.75 432.01C139.76 432.45 138.06 433.5 138.3 435C138.45 435.93 139.02 436.52 139.75 436.82C139.53 436.75 139.29 436.7 139.04 436.68C138.04 436.62 137.43 437.19 137.36 438.25H137.37Z" fill="#308DCC"></path> + <path d="M136.45 416.98C136.39 417.75 136.16 419.53 137.22 420.13C138.22 420.7 138.54 419.69 139.19 419.45C139.84 419.21 140.45 418.49 140.23 417.6C140.09 417.03 139.78 416.52 139.59 416.1C139.88 415.75 140.04 415.21 139.89 414.88C139.88 414.85 139.84 414.83 139.82 414.81C139.97 414.71 140.17 414.67 140.43 414.74C141.11 414.91 142.1 414.38 142.36 412.96C142.62 411.54 141.25 410.25 140.29 410.69C139.33 411.13 139.34 411.79 138.97 411.68C138.6 411.56 137.99 410.91 137.39 411.26C136.79 411.61 137.03 413.71 137.23 414C137.38 414.21 137.86 414.54 137.95 414.93C137.82 415.08 137.76 415.25 137.79 415.44C137.33 415.97 136.5 416.23 136.44 416.98H136.45Z" fill="#308DCC"></path> + <path d="M110.47 416.39C110.17 416.52 109.77 416.58 109.46 416.51C108.18 416.23 107.41 416.75 107.25 418.05C107.1 417.96 106.95 417.91 106.8 417.91C106.24 417.91 105.71 418.58 105.67 419.33C105.62 420.23 106.17 420.98 106.9 421C107.59 421.02 108.13 420.47 108.15 419.74C108.48 419.88 108.89 419.94 109.37 419.89C109.99 419.82 110.51 419.75 111.08 420.11C111.91 420.64 112.79 420.29 113.59 419.96C114.33 419.65 114.78 418.59 114.68 417.74C114.67 417.66 114.65 417.58 114.64 417.5C115.01 417.91 115.53 418.21 116.02 418.24C116.8 418.28 117.4 417.55 117.5 416.44C117.57 415.59 116.96 414.61 116.31 414.55C115.4 414.47 114.2 415.35 114.1 416.17C114.09 416.29 114.1 416.41 114.12 416.54C113.88 416.32 113.58 416.16 113.18 416.05C112.2 415.78 111.36 416.03 110.49 416.39H110.47Z" fill="#308DCC"></path> + <path d="M154.52 439.53C155.14 438.44 154.82 437.69 153.5 436.78C153.41 435.97 153.46 435.28 153.24 434.69C153.11 434.32 152.84 434.05 152.53 433.88C152.52 433.84 152.53 433.79 152.5 433.75C152.21 433.14 151.27 432.85 150.66 433.17C150.16 433.43 149.96 433.96 150.1 434.5C149.73 434.7 149.36 434.91 148.97 435.12C148.02 434.6 147.83 434.55 147.31 435.32C146.94 434.96 146.35 434.54 146 434.7C145.55 434.9 145.77 436.08 145.92 436.49C145.95 436.57 145.99 436.62 146.03 436.68C145.96 436.65 145.9 436.62 145.83 436.59C145.16 436.38 144.6 436.72 144.14 437.2C143.67 437.69 144.02 438.2 144.18 438.67C144.5 439.58 145.25 439.89 146.29 440.01C146.65 439.52 147.05 438.98 147.46 438.42C147.57 438.67 147.68 438.9 147.77 439.13C148.2 440.15 147.9 440.6 146.79 440.41C145.56 440.2 144.91 440.78 144.41 441.75C143.96 442.62 144.11 443.63 144.83 444.33C145.64 445.12 146.43 445.26 147.35 444.57C147.91 444.15 148.38 443.53 148.7 442.91C148.97 442.39 149.22 442 149.81 441.96C150.68 441.9 150.9 441.33 150.8 440.54C152.53 441.29 153.72 440.93 154.51 439.55L154.52 439.53ZM147.36 437.3C147.13 437.19 146.91 437.07 146.69 436.96C146.83 436.94 146.97 436.89 147.12 436.79C147.26 436.69 147.39 436.59 147.5 436.47C147.68 436.71 147.75 436.97 147.36 437.31V437.3Z" fill="#308DCC"></path> + <path d="M156.36 449.78C156.36 449.78 156.39 449.77 156.41 449.76C157.36 449.25 157.67 448.12 157.16 447.06C156.78 446.27 155.44 445.93 154.53 446.39C153.71 446.8 153.43 447.58 153.73 448.47C153.3 448.6 152.91 448.85 152.62 449.37C152.33 449.9 151.9 450.35 151.14 450.51C150.25 450.7 149.63 451.84 149.75 452.53C149.86 453.17 151.71 454.77 152.77 454.84C153.64 454.31 154.8 453.64 155.92 452.91C156.06 452.82 156.08 452.38 156.02 452.15C155.82 451.48 155.91 450.91 156.24 450.27C156.32 450.12 156.35 449.95 156.36 449.78V449.78Z" fill="#308DCC"></path> + <path d="M100.63 444.99C101 445.69 101.48 446.08 102 446.27C101.98 446.38 101.96 446.49 101.94 446.6C101.75 447.91 102.57 448.48 103.63 448.88C103.52 449.33 103.27 449.78 103.34 450.19C103.25 450.23 103.17 450.27 103.11 450.29C102.78 451.15 103 451.86 103.51 451.86C103.97 451.86 104.57 451.66 104.86 451.33C104.96 451.22 104.98 451.06 104.95 450.89C105.08 450.83 105.21 450.74 105.33 450.63C106.05 449.9 105.5 449.26 105.04 448.64C105.33 448.28 105.6 447.95 105.88 447.62C106.38 447.99 106.8 448.31 107.25 448.65C107.7 448.45 108.14 448.34 108.49 448.1C109.06 447.71 109.49 446.37 109.28 445.88C109.05 445.36 108.37 445.08 107.59 445.13C107.74 444.97 107.84 444.78 107.88 444.67C107.96 444.41 108 443.87 107.55 443.71C107.11 443.55 106.76 443.9 106.63 444.13C106.51 444.35 106.37 445.01 106.78 445.3C106.58 445.36 106.37 445.42 106.16 445.49C105.57 444.94 105 444.28 104.26 444.17C104.26 443.98 104.26 443.78 104.23 443.59C104.22 443.49 104.18 443.4 104.15 443.31C104.44 443.36 104.7 443.34 104.84 443.22C105.27 442.86 105.27 441.43 104.68 441.17C103.85 440.8 103.18 440.85 102.99 441.98C102.98 442.06 102.99 442.13 102.99 442.2C102.57 442 102.13 441.92 101.78 442.03C100.91 442.32 100.01 443.85 100.62 445.02L100.63 444.99Z" fill="#308DCC"></path> + <path d="M134.64 424.49C134.11 424.11 133.6 424.36 133.14 424.72C132.64 425.12 132.11 425.49 131.63 425.9C131.09 426.36 130.5 426.79 130.66 427.66C130.7 427.86 130.55 428.16 130.4 428.33C129.23 429.67 129.23 430.17 130.46 431.26C130.98 431.72 131.62 431.83 132.05 431.28C132.49 430.72 133.02 430.48 133.65 430.26C135.09 429.76 135.65 428.44 135.15 426.98C135.04 426.65 135 426.29 134.98 426.19C135.35 425.3 135.09 424.82 134.63 424.49H134.64Z" fill="#308DCC"></path> + <path d="M144.14 468.94C143.66 467.95 142.64 467.6 141.52 468.01C140.36 468.44 139.22 468.98 138.02 469.21C137.04 469.39 136.03 470.32 136.2 470.98C136.37 471.64 137.48 471.93 137.78 471.78C137.87 471.74 137.95 471.71 138.03 471.68C138.04 471.69 138.06 471.71 138.07 471.72C138.31 471.88 138.58 471.89 138.83 471.8C139.04 471.92 139.24 472.08 139.49 472.18C140 472.39 140.64 472.34 141.21 472.29C141.57 472.26 141.92 472.05 142.26 471.88C142.6 471.71 142.92 471.49 143.24 471.28C144.28 470.58 144.57 469.82 144.14 468.93V468.94Z" fill="#308DCC"></path> + <path d="M126.83 464.53C126.91 464.57 127 464.61 127.08 464.64C126.95 464.8 126.86 464.98 126.83 465.2C126.78 465.65 126.98 466.13 127.08 466.6H127C127.58 466.65 128.17 466.71 128.81 466.77C128.96 466.36 129.15 466.01 129.21 465.65C129.3 465.14 129.12 464.69 128.8 464.42C128.97 464.28 129.1 464.11 129.21 463.91C129.29 463.96 129.37 464.01 129.45 464.05C130.46 464.47 132.15 463.7 132.62 462.6C132.75 462.3 132.78 461.98 132.74 461.67C133.02 461.25 132.77 460.75 132.36 460.37C132.01 460.05 131.69 459.7 131.35 459.37C130.52 458.56 127.7 459.03 127.22 460.06C127.18 460.16 127.13 460.29 127.16 460.38C127.59 461.36 126.84 461.86 126.35 462.5C125.74 463.29 125.95 464.07 126.82 464.54L126.83 464.53Z" fill="#308DCC"></path> + <path d="M114.26 407.14C114.35 408.06 115.58 408.94 116.53 408.94C117.1 408.94 117.56 408.73 117.65 408.19C117.9 406.8 118.01 405.4 117.42 404.05C117.31 403.81 117.08 403.63 117 403.53C115.82 402.64 114.54 403.13 114.3 404.52C114.15 405.37 114.17 406.27 114.25 407.14H114.26Z" fill="#308DCC"></path> + <path d="M92.28 450.53C91.42 450.66 90.57 450.95 89.77 451.3C88.92 451.67 88.48 453.12 88.77 454.02C88.95 454.56 89.74 455.56 90.74 454.95C91.71 453.25 92.6 454.32 93.7 453.34C93.89 453.17 94 452.89 94.06 452.78C94.54 451.38 93.67 450.32 92.28 450.53V450.53Z" fill="#308DCC"></path> + <path d="M88.94 403.11C87.62 403.02 86.34 403.96 86.3 405.04C86.26 406.11 87.65 407.77 88.68 407.89C89.8 408.02 90.98 406.91 91.06 405.64C91.12 404.52 90 403.17 88.95 403.11H88.94Z" fill="#308DCC"></path> + <path d="M116.87 455.67C116.72 457.11 117.79 458.26 119.49 458.49C120.89 458.68 122.18 457.61 122.33 456.14C122.45 454.98 121.86 454.16 120.71 453.83C120.89 453.64 121.03 453.44 121.08 453.3C121.29 452.76 120.92 452.25 120.29 452.07C119.64 451.88 119.3 452.33 119.24 452.8C119.21 453 119.19 453.35 119.24 453.68C117.89 453.75 117 454.47 116.88 455.68L116.87 455.67Z" fill="#308DCC"></path> + <path d="M107.68 458.82C106.8 458.75 105.89 459.57 105.79 460.54C105.69 461.47 106.54 462.59 107.41 462.67C108.44 462.76 109.55 461.98 109.6 461.14C109.65 460.29 108.5 458.9 107.68 458.83V458.82Z" fill="#308DCC"></path> + <path d="M150.96 425.81C151.99 425.85 152.69 425.38 152.99 424.47C153.08 424.49 153.17 424.51 153.26 424.51C154.26 424.53 155.31 423.49 155.41 422.36C155.44 422.05 155.36 421.72 155.22 421.4C155.79 421.15 156.3 420.69 156.46 420.05C156.78 418.77 156.3 417.9 155.55 417.4C154.8 416.9 153.54 417.67 152.81 418.71C152.59 419.02 152.55 419.49 152.63 419.96C151.94 420.12 151.33 420.54 151.04 421.09C149.93 421.13 148.82 422.06 148.75 423.06C148.64 424.57 149.59 425.75 150.95 425.81H150.96Z" fill="#308DCC"></path> + <path d="M132.6 442.8C132.29 442.59 131.99 442.34 131.65 442.18C130.87 441.8 130.06 441.66 129.37 442.34C128.65 443.04 128.09 443.83 128.38 444.95C128.7 446.17 129.87 446.74 131.03 446.2C132.47 445.52 132.95 444.58 132.7 442.9L132.6 442.8Z" fill="#308DCC"></path> + <path d="M146.04 430.82C145.95 431.97 146.77 433.15 147.75 433.29C148.81 433.44 150.5 432.01 150.54 430.94C150.55 430.63 150.45 430.33 150.29 430.05C150.34 429.88 150.37 429.69 150.38 429.5C150.58 429.27 150.71 428.97 150.73 428.62C150.77 427.93 150.23 427.31 149.59 427.3C149.42 427.3 149.24 427.35 149.08 427.43C148.69 427.38 148.24 427.48 147.73 427.75C147.22 428.02 146.89 428.79 146.95 429.38C146.44 429.74 146.08 430.26 146.03 430.82H146.04Z" fill="#308DCC"></path> + <path d="M157.15 430.15C157.78 430.19 158.36 429.9 158.7 429.4C159.05 429.54 159.43 429.53 159.79 429.34C160.28 429.08 160.71 427.58 160.47 426.98C160.21 426.33 159.55 426.19 158.65 426.62C158.62 426.63 158.59 426.65 158.56 426.67C158.22 426.28 157.65 426.12 156.72 425.95C156.69 425.95 156.66 425.95 156.63 425.95C156.66 425.88 156.69 425.8 156.7 425.71C156.82 425.07 156.53 424.55 155.91 424.26C155.4 424.02 154.96 424.08 154.61 424.53C154.02 425.29 154.37 425.94 154.88 426.66C154.95 426.65 155.02 426.64 155.08 426.63C154.78 426.99 154.58 427.44 154.55 427.93C154.49 428.98 155.74 430.06 157.13 430.16L157.15 430.15Z" fill="#308DCC"></path> + <path d="M84.44 444.15C83.38 444.09 82.53 444.68 82.52 445.49C82.52 445.97 82.72 446.45 83.04 446.85C82.78 447.07 82.58 447.32 82.5 447.6C82.22 448.65 82.8 449.77 83.82 450.13C85.12 450.59 86.45 449.96 86.84 448.69C87.15 447.68 86.84 446.76 86.07 446.37C86.1 446.24 86.13 446.1 86.13 445.97C86.15 444.88 85.53 444.21 84.43 444.15H84.44Z" fill="#308DCC"></path> + <path d="M135.75 445.28C135.99 445.4 136.51 445.22 136.75 445C137.43 444.37 137.49 443.12 137.08 442.27C136.76 441.61 136.27 441.45 135.61 441.58C134.65 441.76 134.1 442.38 133.95 443.51C133.93 443.67 133.97 443.84 133.98 444L134.08 444.1C134.63 444.51 135.15 444.99 135.76 445.29L135.75 445.28Z" fill="#308DCC"></path> + <path d="M119.6 445.24C120.6 445.37 121.93 444.25 122 443.21C122.04 442.62 121.34 441.92 120.62 441.82C119.45 441.66 118.59 442.26 118.49 443.29C118.39 444.21 118.92 445.14 119.6 445.23V445.24Z" fill="#308DCC"></path> + <path d="M122.6 409.07C121.49 409.03 120.86 409.62 120.81 410.74C120.76 411.77 121.29 412.52 122.06 412.53C123.09 412.53 124.35 411.43 124.34 410.53C124.34 409.84 123.45 409.11 122.6 409.08V409.07Z" fill="#308DCC"></path> + <path d="M103.61 425.87C103.58 426.77 104.71 427.92 105.73 428.02C106.57 428.1 107.18 427.52 107.28 426.54C107.4 425.36 106.84 424.72 105.61 424.63C104.59 424.56 103.64 425.15 103.61 425.87V425.87Z" fill="#308DCC"></path> + <path d="M169.91 455.29C169.56 455.56 169.27 455.96 169.23 456.33C169.16 457.08 169.44 457.74 169.91 458.09V455.29Z" fill="#308DCC"></path> + <path d="M161.38 448.61C160.55 448.55 159.91 449.43 159.85 450.75C159.82 451.34 160.59 452.12 161.22 452.14C161.88 452.16 163 451.32 163.07 450.75C163.17 449.91 162.2 448.68 161.39 448.62L161.38 448.61Z" fill="#308DCC"></path> + <path d="M97.23 460.34C96.35 460.27 95.7 460.69 95.61 461.38C95.51 462.14 96.51 463.55 97.19 463.62C98.17 463.72 98.85 463.06 98.96 461.89C99.04 461.01 98.39 460.42 97.24 460.33L97.23 460.34Z" fill="#308DCC"></path> + <path d="M147.69 447.52C147.08 447.41 146.25 448.05 146.16 448.71C146.05 449.49 146.69 450.55 147.33 450.66C148.25 450.82 149.51 450.01 149.6 449.19C149.68 448.44 148.88 447.74 147.69 447.52V447.52Z" fill="#308DCC"></path> + <path d="M140.49 400.97C140.42 401.65 141.44 402.64 142.23 402.66C142.51 402.66 142.82 402.55 143.08 402.36C143.62 402.67 144.61 402.72 145.3 402.4C145.89 402.12 146.18 401.12 145.83 400.54C145.36 399.74 144.4 399.32 143.76 399.65C143.63 399.72 143.5 399.82 143.38 399.94C143.15 399.52 142.8 399.24 142.38 399.22C141.62 399.17 140.56 400.16 140.48 400.99L140.49 400.97Z" fill="#308DCC"></path> + <path d="M123.65 444.66C122.62 444.62 121.73 445.32 121.71 446.2C121.7 446.77 122.91 447.88 123.61 447.95C124.33 448.02 124.83 447.5 124.9 446.6C124.99 445.48 124.48 444.69 123.65 444.66V444.66Z" fill="#308DCC"></path> + <path d="M100.39 417.42C101.15 417.47 102.46 416.64 102.56 416.04C102.71 415.12 102.03 414.33 100.94 414.17C100.16 414.05 99.49 414.76 99.35 415.87C99.24 416.72 99.67 417.36 100.39 417.42Z" fill="#308DCC"></path> + <path d="M119.64 425.45C120.3 425.52 121.47 424.58 121.53 423.94C121.59 423.27 120.53 422.27 119.66 422.16C118.99 422.07 118.49 422.46 118.43 423.13C118.31 424.46 118.78 425.37 119.64 425.46V425.45Z" fill="#308DCC"></path> + <path d="M151.03 444.58C150.51 444.74 149.85 446.64 150.29 447.29C150.71 447.92 151.35 448.05 152.02 447.87C152.64 447.71 153.09 447.33 153.09 446.61C153.09 445.68 151.55 444.42 151.04 444.58H151.03Z" fill="#308DCC"></path> + <path d="M107.2 452.97C106.47 452.87 105.48 453.72 105.37 454.53C105.37 454.13 105.25 453.71 105.02 453.51C104.75 453.28 103.57 453.45 103.39 453.98C103.2 454.55 103.54 455.2 104.15 455.41C104.71 455.6 105.33 455.31 105.37 454.7C105.37 454.7 105.37 454.68 105.37 454.67C105.37 455.24 105.76 455.68 106.41 455.78C107.05 455.87 107.7 455.58 108.04 455.1C107.49 456.03 107.69 456.99 108.37 457.75C109.58 459.1 110.74 457.63 111.16 458.75C111.58 459.87 110.38 459.77 111.09 461.3C111.8 462.83 113.54 463.14 114.18 462.14C114.82 461.14 114.26 460.25 114.47 460.06C114.47 460.06 114.48 460.05 114.49 460.05C115.41 459.97 116.29 459.08 116.42 458.03C116.58 456.76 115.83 455.94 114.36 455.8C113.38 455.7 112.68 455.96 112.28 456.53C112.09 456.01 111.9 455.41 111.57 454.99C110.78 453.98 109.5 453.51 108.52 454.47C108.32 454.66 108.17 454.86 108.05 455.06C108.15 454.91 108.23 454.74 108.26 454.56C108.4 453.84 107.87 453.07 107.18 452.98L107.2 452.97Z" fill="#308DCC"></path> + <path d="M115.42 461.82C114.79 461.74 113.94 462.67 113.92 463.47C113.9 464.1 114.34 464.5 115.1 464.55C116.24 464.62 116.92 464.31 117 463.69C117.09 462.97 116.21 461.93 115.42 461.83V461.82Z" fill="#308DCC"></path> + <path d="M169.91 451.84C169.68 451.47 169.37 451.16 169.11 451.13C168.53 451.07 167.68 451.76 167.59 452.37C167.48 453.14 167.99 453.77 168.77 453.84C169.18 453.88 169.62 453.68 169.91 453.39V451.83V451.84Z" fill="#308DCC"></path> + <path d="M144.84 460.83C145.38 460.56 145.7 460.04 145.44 459.49C145.24 459.05 144.83 458.51 144.41 458.42C143.34 458.17 143.16 459.17 142.68 459.91C143.32 460.7 143.88 461.31 144.83 460.84L144.84 460.83Z" fill="#308DCC"></path> + <path d="M93.29 437.28C92.64 437.3 92.07 437.9 92.05 438.57C92.04 439.09 92.31 439.49 92.78 439.68C92.77 439.99 92.97 440.44 93.22 440.6C93.71 440.93 94.27 440.6 94.4 440.13C94.44 439.97 94.48 439.66 94.42 439.37C94.6 439.16 94.71 438.89 94.72 438.59C94.72 437.97 93.96 437.27 93.3 437.29L93.29 437.28Z" fill="#308DCC"></path> + <path d="M140.39 382.96C139.67 382.92 139.18 383.3 139.14 383.94C139.08 384.73 139.69 385.72 140.25 385.74C140.72 385.76 141.5 384.87 141.56 384.24C141.63 383.55 141.13 383 140.39 382.96V382.96Z" fill="#308DCC"></path> + <path d="M98.97 472.08C98.48 472.05 97.97 472.39 97.71 472.85C97.53 472.69 97.33 472.55 97.13 472.48C96.5 472.23 95.92 472.49 95.7 473.12C95.64 473.3 95.59 473.47 95.56 473.64H100.06C100.07 473.58 100.1 473.53 100.11 473.46C100.15 472.82 99.57 472.13 98.96 472.09L98.97 472.08Z" fill="#308DCC"></path> + <path d="M143.41 422.35C143.16 421.88 142.61 421.48 142.01 421.47C141.91 421.47 141.81 421.49 141.72 421.51C141.66 421.3 141.38 420.89 140.93 421.01C140.44 421.15 140.69 421.75 140.75 422C140.76 422.06 140.87 422.13 140.98 422.18C140.96 422.27 140.93 422.36 140.93 422.47C140.96 422.96 141.15 423.63 141.51 423.86C142.32 424.38 143.21 423.87 143.5 423.18C143.59 423.65 143.62 424.1 143.54 424.6C143.49 424.92 143.82 425.44 144.14 425.67C144.64 426.03 145.04 426.46 145.47 426.89C146.06 427.48 146.99 427.49 147.52 426.98C148.31 426.24 148.42 425.58 147.74 424.82C147.38 424.41 146.84 424.17 146.3 423.8C146.39 423.49 146.47 423.18 146.56 422.87C146.72 422.31 146.53 421.82 146.13 421.5C146.58 421.58 147.04 421.57 147.43 421.42C148.57 420.98 148.95 419.64 148.36 418.22C148 417.37 147.27 416.89 146.45 416.9C146.56 416.64 146.63 416.35 146.64 416.05C146.67 414.84 146.15 414.3 144.86 414.23C143.87 414.17 142.92 414.79 142.88 415.52C142.83 416.4 143.75 417.47 144.71 417.79C144.17 418.5 143.95 419.52 144.31 420.28C144.49 420.66 144.83 420.97 145.25 421.2C144.88 421.2 144.5 421.35 144.13 421.54C143.75 421.74 143.5 422.01 143.43 422.35H143.41Z" fill="#308DCC"></path> + <path d="M87.75 471.65C87.81 471 87.39 470.47 86.75 470.39C85.99 470.3 85.27 470.84 85.22 471.54C85.17 472.16 85.81 472.86 86.41 472.87C87.02 472.87 87.69 472.27 87.75 471.65V471.65Z" fill="#308DCC"></path> + <path d="M159.95 468.65C160.12 468.1 159.55 467.01 158.49 466.92C157.85 466.87 157.48 467.22 157.33 467.83C157.16 468.5 157.4 469.08 157.94 469.39C158.79 469.86 159.78 469.21 159.95 468.65Z" fill="#308DCC"></path> + <path d="M108.36 441.42C108.91 442.51 110.26 443.92 112.34 443.56C113.6 443.34 114.35 442.76 114.75 441.94C115.21 440.99 114.21 440.08 114.28 438.97C114.29 438.77 114.28 438.58 114.28 438.4C114.67 438.53 115.06 438.49 115.47 438.12C115.92 437.71 116.11 437.15 115.68 436.68C115.35 436.33 114.77 435.93 114.36 435.99C113.87 436.06 113.64 436.32 113.52 436.67C112.83 436.08 111.78 435.98 110.78 436.1C110.48 436.14 110.2 436.22 109.95 436.35C109.96 436.31 109.98 436.27 109.99 436.24C110.04 436.07 109.75 435.62 109.57 435.6C109.33 435.57 108.91 435.77 108.84 435.97C108.77 436.16 108.74 436.73 109.24 436.87C108.7 437.4 108.52 438.15 108.56 439.03C108.6 439.93 107.97 440.61 108.38 441.42H108.36Z" fill="#308DCC"></path> + <path d="M109.14 410.34C108.88 410.58 108.81 411.31 108.98 411.66C109.42 412.52 110.69 412.5 111.2 411.97C111.71 411.44 111.57 410.29 110.57 409.95C110.17 409.81 109.46 410.03 109.14 410.34Z" fill="#308DCC"></path> + <path d="M165.36 469.79C164.72 469.79 164.1 470.39 164.09 471.01C164.08 471.61 164.7 472.25 165.34 472.29C166.03 472.34 166.66 471.8 166.67 471.15C166.68 470.44 166.05 469.78 165.36 469.79Z" fill="#308DCC"></path> + <path d="M90.16 441.29C90.22 440.68 89.68 439.93 89.1 439.83C88.46 439.72 87.83 440.24 87.75 440.94C87.67 441.7 88.08 442.28 88.77 442.35C89.48 442.42 90.09 441.96 90.16 441.29V441.29Z" fill="#308DCC"></path> + <path d="M152.17 413.58C151.32 413.8 151.27 414.52 151.45 415.23C152.28 415.75 152.93 415.69 153.58 414.8C153.35 414.06 153.07 413.34 152.17 413.57V413.58Z" fill="#308DCC"></path> + <path d="M149.44 472.39C149.24 472.22 148.67 472.21 148.45 472.37C147.98 472.72 147.91 473.16 148.09 473.63H149.89C149.91 473.57 149.94 473.52 149.96 473.45C150.03 473.14 149.73 472.63 149.44 472.39V472.39Z" fill="#308DCC"></path> + <path d="M122.72 401.84C122.41 401.68 121.3 402.14 121.26 402.69C121.21 403.29 121.7 403.84 122.34 403.89C122.92 403.94 123.46 403.5 123.35 402.9C123.27 402.46 123.03 401.99 122.72 401.83V401.84Z" fill="#308DCC"></path> + <path d="M121 398.64C120.63 398.69 120.29 399.05 120.1 399.17C119.99 400.09 120.37 400.72 120.87 400.6C121.32 400.49 121.85 400.15 122.06 399.76C122.29 399.33 121.59 398.57 121.01 398.64H121Z" fill="#308DCC"></path> + <path d="M99.42 444.69C99.59 444.47 99.6 443.86 99.44 443.72C99.12 443.45 98.57 443.17 98.22 443.27C97.51 443.48 97.63 444.17 97.7 444.75C98.32 445.23 98.94 445.33 99.42 444.69Z" fill="#308DCC"></path> + <path d="M133.4 389.67C133.27 389.7 133.14 389.72 133.01 389.75C132.4 390.18 132.39 390.44 132.41 391C132.42 391.57 132.64 391.9 132.75 392.03C133.28 391.81 134.4 391.94 134.55 391.28C134.7 390.62 133.74 390.14 133.41 389.67H133.4Z" fill="#308DCC"></path> + <path d="M144.97 394.69C144.59 394.8 143.65 394.94 143.74 395.64C143.83 396.34 144.67 396.59 145.09 396.67C145.67 396.79 145.89 396.23 145.92 395.71C145.96 395.1 145.48 394.53 144.97 394.68V394.69Z" fill="#308DCC"></path> + <path d="M92.7 428.71C92.44 428.06 92.2 427.36 91.22 427.5C90.51 427.6 89.79 427.6 89.07 427.65C88.27 427.39 87.73 427.77 87.59 428.44C87.44 429.16 87.84 429.74 88.63 430.03C89.06 430.19 89.54 430.33 89.85 430.64C90.46 431.24 91.13 431.5 91.91 431.2C92.5 430.97 92.98 429.4 92.7 428.71Z" fill="#308DCC"></path> + <path d="M100.24 428.92C101.01 429.01 101.71 428.49 101.77 427.79C101.82 427.16 101.26 426.61 100.51 426.56C99.87 426.51 99.32 426.92 99.23 427.54C99.12 428.3 99.51 428.84 100.24 428.93V428.92Z" fill="#308DCC"></path> + <path d="M97.61 420.99C96.98 420.93 96.48 421.34 96.6 421.91C96.69 422.32 97.01 422.67 97.16 422.93C97.98 422.93 98.49 422.34 98.48 421.72C98.48 421.13 98.06 421.03 97.61 420.98V420.99Z" fill="#308DCC"></path> + <path d="M92.14 419.53C91.51 419.47 91.01 419.88 91.13 420.45C91.22 420.86 91.54 421.21 91.69 421.47C92.51 421.47 93.02 420.88 93.01 420.26C93.01 419.67 92.59 419.57 92.14 419.52V419.53Z" fill="#308DCC"></path> + <path d="M169.39 391.72C168.89 391.7 168.06 392.49 168.15 393.18C168.18 393.39 168.29 393.58 168.45 393.73C168.31 394.99 168.78 396.67 169.49 397.23C169.63 397.34 169.77 397.4 169.91 397.45V391.73C169.85 391.76 169.79 391.81 169.73 391.84C169.65 391.78 169.55 391.73 169.39 391.72V391.72Z" fill="#308DCC"></path> + <path d="M122.32 424.92C121.73 425.31 121.54 425.91 121.73 426.49C122.03 427.39 122.91 427.27 123.75 427.37C124.04 426.81 124.29 426.31 124.25 425.83C124.54 426.05 124.87 426.19 125.19 426.22C126.28 426.31 127.6 425.2 127.72 424.08C127.75 423.79 127.72 423.51 127.63 423.25C127.82 423.38 128.01 423.46 128.14 423.41C128.45 423.28 128.6 422.41 128.49 422.23C128.31 421.94 127.82 421.53 127.54 421.61C127.32 421.67 127.11 422.09 127.07 422.41C126.77 422.15 126.4 421.97 125.98 421.94C124.46 421.82 123.21 422.63 123.15 423.79C123.13 424.1 123.21 424.43 123.35 424.74C123.02 424.63 122.66 424.7 122.3 424.93L122.32 424.92Z" fill="#308DCC"></path> + <path d="M132.93 413.79C133.01 412.92 132.33 411.87 131.59 411.73C130.67 411.56 129.4 412.56 129.33 413.5C129.31 413.86 129.58 414.25 130 414.54C129.46 414.81 129.27 415.28 129.53 415.88C129.81 416.54 130.5 416.84 131.14 416.57C131.68 416.34 132.01 415.59 131.81 415.08C131.79 415.02 131.74 414.98 131.71 414.93C132.36 414.8 132.88 414.35 132.94 413.79H132.93Z" fill="#308DCC"></path> + <path d="M137.46 406.09C137.43 406.29 137.43 406.5 137.46 406.71C137.25 406.64 137 406.64 136.91 406.7C136.68 406.84 136.23 407.14 136.39 407.4C136.55 407.66 136.97 407.8 137.18 407.73C137.3 407.7 137.5 407.53 137.64 407.35C137.82 407.76 138.11 408.08 138.45 408.15C139.75 408.42 140.41 407.19 140.72 406.54C141.03 405.89 139.76 404.83 138.64 404.94C137.91 405.01 137.57 405.44 137.46 406.09V406.09Z" fill="#308DCC"></path> + <path d="M118.69 438.1C118.52 439.18 119.29 440.13 120.41 440.24C121.37 440.33 122.1 440.26 122.64 440.05C122.81 440.91 123.63 441.75 124.83 441.81C125.07 441.82 125.29 441.79 125.48 441.73C125.6 441.93 125.75 442.08 125.91 442.13C126.36 442.26 127.33 441.59 127.55 440.99C127.79 440.34 127.43 439.68 126.73 439.46C126.7 439.45 126.66 439.46 126.63 439.44C126.54 438.86 126.2 438.38 125.65 438.11C124.94 437.77 124.19 437.85 123.61 438.17C123.35 437.17 122.23 436.01 121.29 435.9C120.37 435.79 118.86 437.06 118.7 438.09L118.69 438.1Z" fill="#308DCC"></path> + <path d="M123.64 435.69C124.31 435.74 124.91 435.3 124.96 434.72C125.01 434.12 124.24 433.34 123.58 433.33C122.95 433.33 122.42 433.83 122.38 434.45C122.34 435.12 122.86 435.63 123.64 435.69Z" fill="#308DCC"></path> + <path d="M148.62 411.94C149.33 411.92 149.92 411.36 149.9 410.7C149.88 410.02 149.46 409.74 148.83 409.7C148.09 409.65 147.48 410.15 147.46 410.82C147.44 411.46 147.96 411.97 148.61 411.94H148.62Z" fill="#308DCC"></path> + <path d="M88.16 436.39C88.75 436.53 89.56 436.1 89.48 435.57C89.42 435.13 89.18 434.11 88.56 434.08C87.94 434.06 87.68 434.88 87.56 435.25C87.41 435.7 87.52 436.23 88.15 436.38L88.16 436.39Z" fill="#308DCC"></path> + <path d="M134.03 415.95C133.6 415.67 133 416.2 132.92 416.74C132.79 417.47 133.21 417.84 133.71 417.83C134.11 417.82 134.83 417.74 134.9 417.19C134.97 416.64 134.43 416.2 134.04 415.95H134.03Z" fill="#308DCC"></path> + <path d="M127.79 431.77C127.79 431.33 126.97 431.02 126.45 431.2C125.81 431.42 125.67 432.71 126.34 433.01C127.01 433.31 127.79 432.63 127.79 431.77Z" fill="#308DCC"></path> + <path d="M137.2 396.74C136.52 396.71 136.3 397.23 136.35 397.7C136.39 398.1 136.59 399.14 137.15 399.1C137.71 399.06 138.21 398.15 138.26 397.74C138.33 397.17 137.85 396.76 137.2 396.74V396.74Z" fill="#308DCC"></path> + <path d="M141.81 393.77C141.47 393.85 141.21 394.21 141.05 394.33C141.05 395.19 141.53 395.76 142.05 395.61C142.4 395.51 142.82 395.17 142.93 394.84C143.1 394.34 142.37 393.63 141.81 393.77Z" fill="#308DCC"></path> + <path d="M108.73 402.85C108.35 403.15 109.39 405.05 109.93 405.14C110.47 405.23 110.99 404.12 110.68 403.21C110.37 402.3 109.11 402.55 108.73 402.85Z" fill="#308DCC"></path> + <path d="M122.53 393.47C123.08 393.6 123.34 392.82 123.36 392.55C123.38 392.28 123.28 391.75 122.81 391.7C122.34 391.65 122.09 392.07 122.02 392.33C121.95 392.58 121.98 393.33 122.53 393.47V393.47Z" fill="#308DCC"></path> + <path d="M80.35 433.46C80.18 433.4 79.53 433.57 79.48 433.89C79.43 434.21 80 434.47 80.25 434.54C80.39 434.58 80.77 434.4 80.78 434.15C80.78 433.9 80.56 433.53 80.35 433.46V433.46Z" fill="#308DCC"></path> + <path d="M91.48 414.68C91.18 414.65 90.8 415.22 90.79 415.43C90.78 415.66 90.96 416.09 91.27 416.13C91.58 416.17 91.86 415.81 91.91 415.59C91.96 415.38 91.77 414.71 91.47 414.68H91.48Z" fill="#308DCC"></path> + <path d="M82.32 418.59C82.35 418.44 82.11 418.06 81.88 418.04C81.65 418.02 81.38 418.39 81.29 418.63C81.24 418.76 81.39 419.32 81.74 419.37C82.09 419.42 82.28 418.83 82.32 418.59Z" fill="#308DCC"></path> + <path d="M131.87 393.01C131.91 393.17 131.93 393.43 132.11 393.46C132.29 393.5 132.33 393.29 132.47 393.19C132.36 393.03 132.29 392.87 132.18 392.82C132.11 392.79 131.86 392.97 131.87 393.01V393.01Z" fill="#308DCC"></path> + <path d="M84.03 451.32C83.8 451.32 83.69 451.57 83.68 451.69C83.67 451.81 83.92 452 84.02 451.99C84.14 451.99 84.35 451.89 84.37 451.73C84.38 451.56 84.27 451.33 84.03 451.32Z" fill="#308DCC"></path> + <path d="M169.28 423.78C169.63 423.87 169.84 423.76 169.92 423.4V423.04C169.87 422.9 169.74 422.8 169.53 422.75C169.2 422.68 169 422.78 168.92 423.11C168.84 423.45 168.92 423.68 169.29 423.77L169.28 423.78Z" fill="#308DCC"></path> + <path d="M163.69 433.68C164.55 433.89 165.28 433.8 165.83 433.52C166.28 433.7 166.81 433.76 167.26 433.62C167.98 433.39 168.45 432.25 168.16 431.4C167.95 430.78 167 430.28 166.43 430.5C166.43 430.5 166.41 430.5 166.4 430.51C166.06 429.95 165.58 429.49 165.05 429.37C163.62 429.04 162.83 429.93 162.44 430.73C162.05 431.53 162.07 433.28 163.7 433.68H163.69Z" fill="#308DCC"></path> + <path d="M133.84 451.17C134.41 452.06 136.67 452.41 137.49 451.88C138.31 451.35 137.97 450.19 138.17 450.01C138.38 449.83 139.85 450.43 140.85 449.74C141.84 449.05 141.9 447.14 141.44 446.41C141.27 446.14 141.1 445.92 140.93 445.71C140.95 445.68 140.98 445.65 141 445.62C141.1 445.43 141.08 444.73 140.8 444.63C140.57 444.55 140.21 444.82 140.05 445.04C139.99 445.02 139.94 444.98 139.88 444.96C139.05 444.72 137.82 444.98 137.36 445.75C136.89 446.53 137.07 447.9 136.76 448.09C136.46 448.28 135.03 447.53 134.1 448.3C133.17 449.07 133.27 450.25 133.84 451.15V451.17Z" fill="#308DCC"></path> + <path d="M97.47 430.14C96.9 430.57 96.49 431.6 96.76 432.28C97.14 433.23 98.16 433.34 98.49 433.28C98.52 434.39 99.4 435.45 100.4 435.53C101.43 435.61 102.27 435.2 102.71 434.48C102.86 434.91 103.17 435.31 103.74 435.56C105.27 436.24 106.56 435.8 107.04 434.87C107.36 434.25 107.19 433.18 106.73 432.41C107.32 432.35 107.76 431.96 107.82 431.39C107.88 430.79 107.32 430.17 106.63 430.08C105.95 429.99 105.31 430.48 105.23 431.14C105.23 431.22 105.23 431.3 105.23 431.38C104.21 431.22 103.47 431.83 103.03 432.43C103 432.47 102.97 432.52 102.94 432.57C102.69 431.83 102.01 431.37 100.94 431.27C100.54 431.23 100.19 431.26 99.87 431.34C99.95 431.07 99.96 430.79 99.78 430.45C99.38 429.7 98.16 429.62 97.47 430.14Z" fill="#308DCC"></path> + <path d="M114.94 448.99C114.53 449.15 112.96 447.92 111.64 448.66C110.32 449.4 110.19 450.86 110.69 452.08C111.19 453.3 113.87 454.23 114.99 453.77C115.2 453.68 115.36 453.55 115.49 453.41C115.94 453.3 116.32 453 116.47 452.56C116.57 452.28 116.59 451.97 116.57 451.67C117.19 451.83 118.47 452.41 119.57 451.91C120.94 451.29 121.43 448.96 121.04 447.97C120.64 446.98 120.23 446.26 119.44 445.86C119.33 445.8 119.2 445.76 119.08 445.72C119 445.22 118.48 444.71 118.31 444.28C118.18 444.28 118.04 444.27 117.91 444.26C117.39 444.46 117.22 444.65 117.12 444.97C116.98 444.89 116.83 444.83 116.66 444.82C116.05 444.78 115.3 445.39 115.26 445.97C115.23 446.37 115.44 446.73 115.78 446.95C115.39 447.81 115.26 448.87 114.94 449V448.99Z" fill="#308DCC"></path> + <path d="M129.46 401.68C128.44 400.89 127.09 400.75 126.37 401.91C125.54 403.26 125.97 404.43 127.01 405.14C128.51 406.16 129.28 404.45 129.96 405.44C130.64 406.43 129.45 406.62 130.51 407.94C131.57 409.26 133.33 409.13 133.71 408C134.09 406.87 133.33 406.14 133.49 405.91C133.65 405.68 134.64 404.87 134.04 404.14C132.76 402.6 131.68 404.1 131.16 403.76C130.64 403.42 130.18 402.25 129.46 401.69V401.68Z" fill="#308DCC"></path> + <path d="M131.53 471.87C131.76 470.96 131.97 469.02 130.24 468.83C129.39 468.73 128.41 469.51 128.19 470.35C128.19 470.36 128.19 470.37 128.19 470.38C127.82 469.8 127.11 469.36 126.33 469.33C125.4 469.29 124.4 470.2 124.17 471.17C123.98 471.06 123.76 470.96 123.48 470.87C122.53 470.57 121.47 470.95 121.25 471.65C121.18 471.87 121.18 472.12 121.23 472.38C120.68 472.54 120.04 472.74 119.42 473.02C119.14 473.15 118.92 473.37 118.81 473.64H124.52C124.62 473.47 124.7 473.29 124.76 473.1C125.07 473.41 125.46 473.61 125.87 473.63C126.74 473.65 127.89 472.75 128.3 471.85C128.44 472.19 128.65 472.47 128.94 472.59C129.3 472.74 129.16 473.19 129.09 473.65H133.14C133.01 473.46 132.86 473.26 132.71 473.06C132.24 472.42 131.29 472.79 131.51 471.88L131.53 471.87Z" fill="#308DCC"></path> + <path d="M126.03 450.02C125.97 450.17 125.93 450.29 125.89 450.42C125.76 450.33 125.63 450.28 125.48 450.28C125.13 450.28 124.79 450.56 124.61 450.64C124.39 451.48 124.73 452.14 125.27 452.12C125.44 452.12 125.63 452.06 125.81 451.98C125.85 452.35 125.86 452.7 125.65 453.1C125.15 454.05 125.52 454.64 126.38 455.4C126.5 455.51 126.64 455.63 126.78 455.75C126.35 455.86 125.98 456.2 126.05 456.58C126.11 456.92 126.54 457.35 126.88 457.44C127.41 457.58 127.89 457.33 127.86 456.63C127.86 456.57 127.86 456.51 127.86 456.45C128.45 456.7 129.06 456.69 129.59 456.06C130.61 454.84 129.93 454.01 129.54 453.73C129.15 453.45 128.97 452.47 129.49 452.61C130.01 452.75 130.6 452.41 130.99 451.11C131.11 450.71 131.16 450.35 131.14 450.03C131.33 449.91 131.49 449.75 131.57 449.56C131.84 448.95 131.43 447.96 130.83 447.75C130.47 447.62 129.98 447.81 129.57 448.24C128.24 447.8 126.61 448.6 126.02 450.03L126.03 450.02Z" fill="#308DCC"></path> + <path d="M166.29 418.27C166 418.41 165.85 418.73 165.93 419C166.01 419.27 166.49 419.54 166.78 419.49C167.07 419.43 167.16 418.93 167.07 418.66C166.99 418.43 166.59 418.13 166.29 418.28V418.27Z" fill="#308DCC"></path> + <path d="M115.49 427.15C114.91 426.48 113.59 426.32 112.6 426.93C111.94 427.33 111.44 427.79 110.55 427.36C109.91 427.05 109.46 427.61 109.22 428.26C109.63 429.12 110.25 429.35 110.94 428.95C111.55 429.69 111.92 430.31 112.45 430.74C112.97 431.15 114.01 431.17 114.78 430.94C114.51 431.33 114.35 431.84 114.36 432.48C114.38 434.24 114.87 434.81 116.33 434.95C117.75 435.03 118.7 434.08 118.82 432.47C118.82 432.36 118.82 432.26 118.82 432.15C119.22 432.73 119.84 433.2 120.46 433.28C121.15 433.37 121.89 432.61 122 431.7C122.12 430.62 121.5 429.9 120.3 429.74C119.42 429.62 118.46 430.21 118.41 430.88C118.41 430.97 118.41 431.07 118.42 431.17C118 430.6 117.3 430.19 116.54 430.15C116.25 430.14 115.98 430.18 115.73 430.25C116.17 429.38 116.07 427.83 115.49 427.16V427.15Z" fill="#308DCC"></path> + <path d="M124.8 416.01C123.39 415.89 121.95 416.78 121.84 417.83C121.72 418.97 122.94 420.44 124.06 420.51C125.15 420.58 126.41 419.41 126.48 418.26C126.56 417.12 125.78 416.09 124.79 416L124.8 416.01Z" fill="#308DCC"></path> + <path d="M101.17 459.15C100.48 459.15 100.04 459.56 100.03 460.24C100.02 460.83 100.5 461.39 101.07 461.52C101.05 461.57 101.03 461.62 101.01 461.67C100.71 462.66 101.04 463.51 101.8 463.71C102.8 463.97 104.29 463.2 104.5 462.32C104.66 461.65 103.98 460.72 103.16 460.49C102.91 460.42 102.69 460.39 102.48 460.4C102.48 460.38 102.48 460.35 102.48 460.33C102.48 459.67 101.92 459.17 101.17 459.16V459.15Z" fill="#308DCC"></path> + <path d="M148.97 418.29C149.68 418.39 150.33 417.95 150.43 417.3C150.43 417.3 150.43 417.29 150.43 417.28C150.65 417.46 151.02 417.59 151.23 417.53C151.58 417.42 152.03 417.05 152.08 416.73C152.24 415.87 151.52 415.7 150.89 415.49C150.49 415.76 150.2 416.06 150.14 416.42C149.93 416.19 149.62 416.03 149.26 416C148.61 415.94 148.1 416.36 148.02 417C147.94 417.71 148.29 418.19 148.96 418.28L148.97 418.29Z" fill="#308DCC"></path> + <path d="M129.2 436.89C129.46 437.07 128.11 438.62 129.54 439.63C130.96 440.65 132.13 440.39 132.89 439.01C133.13 438.58 133.64 438.22 134.21 437.85C134.22 437.85 134.23 437.85 134.25 437.85C134.73 437.88 135.24 437.51 135.35 437.06C136.09 436.49 136.64 435.8 136.45 434.8C136.71 434.53 136.67 434.16 136.48 433.85C136.26 433.51 135.47 432.82 135.17 432.97C134.56 432.67 133.91 432.73 133.53 432.97C132.87 433.38 132.6 434.34 132.09 434.45C131.58 434.56 132.46 433.81 130.74 433.64C129.02 433.47 127.51 435.7 129.21 436.87L129.2 436.89Z" fill="#308DCC"></path> + <path d="M81.44 424.78C81.96 425.31 81.72 425.2 81.52 425.94C81.31 426.68 81.49 427.82 82.84 427.75C84.19 427.68 84.93 426.32 84.98 425.15C85.03 423.98 83.22 422.42 81.82 422.71C80.81 422.92 80.93 424.26 81.45 424.78H81.44Z" fill="#308DCC"></path> + <path d="M165.85 442.05C165.96 442.03 166.08 442 166.19 441.96C167.05 441.67 167.21 440.21 166.84 438.99C166.57 438.11 164.95 437.45 164.15 437.89C163.67 438.15 163.27 438.85 163.19 439.58C162.94 439.58 162.71 439.59 162.52 439.68C162.34 439.77 162.18 439.89 162.03 440.03C162.03 439.93 162.05 439.83 162.05 439.73C162.05 439.47 162.19 439.21 162.27 438.95C162.38 438.58 162.4 438.26 162.35 437.99C162.39 437.99 162.43 438.01 162.48 438.01C163.15 438.06 163.68 437.81 163.92 437.17C164.01 436.94 164.03 436.54 163.89 436.39C163.48 435.94 162.97 435.58 162.45 435.14C162.46 433.61 161.87 432.54 160.95 432.52C160.57 432.52 160.16 432.72 159.79 433.03C159.75 432.96 159.71 432.89 159.65 432.82C159.12 432.15 157.91 432.29 157.32 432.93C157.06 433.21 156.88 433.66 156.83 434.1C156.03 434.06 155.4 434.57 155.37 435.29C155.35 435.88 155.88 436.49 156.44 436.53C156.94 436.56 157.47 436.23 157.74 435.78C158.21 435.97 158.71 435.91 158.9 435.83C159.01 435.79 159.08 435.72 159.16 435.67C159.51 435.99 160.19 436.14 161.44 436.23C161.45 436.57 161.44 436.92 161.51 437.22C160.89 437.17 160.42 437.66 160.28 438.56C160.26 438.66 160.36 438.78 160.34 438.88C160.22 439.4 159.93 439.64 159.41 439.33C159.22 439.22 159.09 439.02 158.9 438.92C158.12 438.49 157.14 438.62 156.44 439.21C156.3 439.33 156.18 439.45 156.08 439.57C155.96 439.57 155.84 439.6 155.72 439.63C155.06 439.86 154.68 440.7 154.92 441.4C155.12 441.95 155.75 442.33 156.4 442.38C156.88 442.97 157.55 443.31 158.33 443.5C158.28 444.06 158.17 444.56 158.22 445.04C158.38 446.52 159.48 446.96 160.67 446.06C161.71 445.28 161.77 444.14 160.79 443.26C160.51 443.01 160.16 442.84 159.51 442.42C159.98 442.04 160.25 441.63 160.58 441.57C160.87 441.52 161.1 441.44 161.3 441.34C161.21 441.78 161.23 442.23 161.4 442.62C161.88 443.72 163.22 444.33 164.24 443.91C165.1 443.56 165.73 442.79 165.87 442.04L165.85 442.05Z" fill="#308DCC"></path> + <path d="M158.73 407.6C158.4 407.04 157.01 406.73 156.32 407.07C155.7 407.38 155.52 408.05 155.88 408.75C156.49 409.95 157.17 410.3 158.04 409.88C158.09 409.86 158.13 409.82 158.17 409.79C158.16 409.82 158.13 409.85 158.12 409.87C157.96 410.34 158.58 411.31 159.18 411.52C159.7 411.7 160.22 411.37 160.37 410.75C160.4 410.63 160.41 410.52 160.43 410.4C160.9 410.78 161.52 411.06 161.98 411.01C162.56 410.94 163.36 410.93 163.43 410.18C163.52 409.19 164.08 408.64 164.77 408.08C165.12 407.79 165.24 407.47 165.18 407.13C165.41 407.16 165.64 407.18 165.87 407.21C166.42 407.27 166.67 406.95 166.69 406.35C166.58 406.23 166.46 405.95 166.3 405.93C165.65 405.84 165.29 405.41 164.85 404.99C164.65 404.8 163.96 404.89 163.68 405.1C163.4 405.31 163.21 405.8 163.21 406.17C163.12 406.23 163.05 406.31 163 406.41C162.54 407.37 161.81 407.59 161.05 407.65C160.5 407.89 160.07 408.35 159.88 408.82C159.5 408.79 158.92 409.04 158.52 409.36C158.85 408.81 158.98 408 158.73 407.56V407.6Z" fill="#308DCC"></path> + <path d="M154.12 403.21C153.26 403.69 153.37 404.53 153.41 405.3C153.69 405.44 153.93 405.54 154.15 405.61C154.42 406.01 154.87 406.27 155.47 406.33C156.78 406.47 157.66 405.74 157.82 404.38C157.95 403.32 157.17 402.24 156.16 402.07C155.52 401.96 154.82 402.42 154.36 403.11C154.27 403.13 154.19 403.16 154.11 403.2L154.12 403.21Z" fill="#308DCC"></path> + <path d="M153.03 458.35C152.52 458.11 152.08 458.17 151.73 458.62C151.14 459.38 151.49 460.03 152 460.75C152.82 460.63 153.65 460.73 153.82 459.8C153.94 459.16 153.65 458.64 153.03 458.35Z" fill="#308DCC"></path> + <path d="M169.32 457.69C169.09 457.19 168.3 456.86 167.79 457.06C167.25 457.28 166.82 458.18 167.02 458.71C167.21 459.24 167.99 459.54 168.55 459.3C169.18 459.04 169.56 458.22 169.32 457.68V457.69Z" fill="#308DCC"></path> + <path d="M151.06 401.69C150.63 401.31 150.27 401.42 149.91 401.65C149.69 401.58 149.47 401.52 149.22 401.49C148.08 401.33 147.08 402.08 146.88 403.24C146.67 404.51 147.72 405.97 148.97 406.16C150.06 406.32 151.5 405.17 151.7 403.99C151.77 403.58 151.68 403.2 151.49 402.85C151.47 402.42 151.33 401.93 151.06 401.69V401.69Z" fill="#308DCC"></path> + <path d="M149.43 364.14C148.64 363.89 148.07 364.74 148.05 365.17C148.03 365.6 148.8 366.26 149.55 365.95C149.81 365.84 150.09 365.37 150.05 365.1C150 364.75 149.72 364.23 149.43 364.14V364.14Z" fill="#308DCC"></path> + <path d="M165.37 378.35C165.91 378.3 166.59 376.98 166.1 376.5C165.73 376.14 164.93 376.12 164.61 376.47C164.16 376.97 164.83 378.4 165.37 378.35V378.35Z" fill="#308DCC"></path> + <path d="M138.9 390.38C138.62 390.69 138.72 391.23 138.84 391.67C138.98 392.14 139.43 392.47 139.99 392.15C140.48 391.87 140.89 391.51 140.65 390.85C140.46 390.33 139.17 390.08 138.89 390.39L138.9 390.38Z" fill="#308DCC"></path> + <path d="M161.92 380.88C161.21 381.22 160.71 382.76 161.07 383.48C161.61 384.55 162.54 384.9 163.48 384.37C164.41 383.85 164.68 382.97 164.2 382.01C163.75 381.1 162.62 380.54 161.92 380.88Z" fill="#308DCC"></path> + <path d="M154.93 382.92C155.16 382.69 155.29 382.13 155.17 381.83C155.06 381.54 154.43 380.92 154.04 381.04C153.65 381.16 153.58 382.07 153.62 382.42C153.69 382.94 154.56 383.28 154.92 382.93L154.93 382.92Z" fill="#308DCC"></path> + <path d="M158.15 458.84C158.3 459.04 158.6 459.2 158.86 459.23C158.97 459.23 159.26 458.78 159.2 458.67C159.09 458.45 158.86 457.97 158.45 458.06C158.04 458.15 158.07 458.75 158.15 458.85V458.84Z" fill="#308DCC"></path> + <path d="M161.69 358.33C161.25 358.5 161.44 359.76 161.59 359.87C162.03 360.18 162.55 360.69 163.14 360.48C163.73 360.27 163.51 359.53 163.35 359.33C163.04 358.95 162.13 358.16 161.68 358.33H161.69Z" fill="#308DCC"></path> + <path d="M148.42 414.26C148.87 414.23 149.53 413.9 149.74 413.54C150.04 413.03 149.66 412.71 149.49 412.65C149.13 412.52 148.79 412.7 148.44 412.88C148.12 413.05 147.76 413.14 147.6 413.5C147.41 413.93 147.88 414.29 148.42 414.26V414.26Z" fill="#308DCC"></path> + <path d="M168.1 384.93C167.41 385.13 166.55 385.01 166.53 386.05C166.53 386.7 166.87 387.12 167.43 387.27C168.42 387.54 168.7 386.73 169.02 386.03C169.33 386.08 169.62 386.13 169.91 386.18V380.53C169.56 381.14 169.46 381.71 169.55 382.22C169.45 382.26 169.34 382.29 169.24 382.33C168.01 382.82 167.92 383.81 168.1 384.93V384.93Z" fill="#308DCC"></path> + <path d="M169.91 430.71V427.05C169.06 426.36 168.17 425.7 167.48 424.88C166.84 424.12 165.53 423.7 165.04 424.18C164.9 424.32 164.83 424.51 164.8 424.72C164.02 425.29 163.61 426.25 163.97 427.07C164.13 427.45 164.58 427.85 164.97 427.95C165.24 428.02 165.49 428.05 165.73 428.05C165.88 428.45 166.14 428.83 166.38 429.18C166.58 429.48 166.94 429.68 167.25 429.89C167.57 430.1 167.92 430.27 168.26 430.44C168.92 430.77 169.46 430.85 169.92 430.71H169.91Z" fill="#308DCC"></path> + <path d="M156.27 374.57C155.88 374.99 155.42 376.17 156.44 376.74C158.4 376.74 157.91 378.05 159.3 378.51C159.55 378.59 159.84 378.54 159.96 378.55C161.41 378.27 161.9 376.99 161.04 375.89C160.5 375.21 159.83 374.61 159.13 374.09C158.39 373.54 156.91 373.87 156.27 374.57Z" fill="#308DCC"></path> + <path d="M167.51 401.1C167.22 401.33 167.02 401.67 167 402.08C166.98 402.55 167.22 403.03 167.56 403.3C167.58 403.35 167.59 403.41 167.61 403.46C167.97 404.34 168.79 404.88 169.7 404.98C169.39 405.25 169.2 405.71 169.16 406.33C169.12 406.97 169.38 407.42 169.91 407.66V399.62C169.54 399.58 169.15 399.62 168.76 399.8C168.15 400.07 167.73 400.53 167.51 401.11V401.1Z" fill="#308DCC"></path> + <path d="M159.04 392.58C158.18 392.95 157.63 394.25 157.99 395.04C158.43 395.98 159.65 396.56 160.41 396.19C161.18 395.81 161.81 394.12 161.47 393.38C161.1 392.58 159.93 392.2 159.04 392.59V392.58Z" fill="#308DCC"></path> + <path d="M153.48 412.52C153.75 412.77 153.98 413.08 154.15 413.4C154.67 414.33 155.3 414.67 156.27 414.48C157.19 414.3 157.53 413.63 156.95 412.38C156.49 411.96 155.78 411.21 154.95 410.61C154.44 410.24 153.73 410.29 153.33 410.88C152.98 411.4 152.93 412 153.48 412.51V412.52Z" fill="#308DCC"></path> + <path d="M160.58 364.91C159.66 365.42 159.2 366.8 159.62 367.81C159.91 368.49 161.13 368.74 161.96 368.29C162.92 367.77 163.19 366.9 162.7 365.92C162.23 364.96 161.29 364.52 160.58 364.92V364.91Z" fill="#308DCC"></path> + <path d="M168.35 420.85C168.55 421.37 169.19 421.64 169.91 421.6V418.28C169.73 418.29 169.56 418.33 169.39 418.42C168.81 418.73 168.13 420.3 168.34 420.85H168.35Z" fill="#308DCC"></path> + <path d="M152.1 386.64C152.5 387.54 153.41 387.8 154.47 387.32C155.01 387.07 155.26 386.61 155.23 386.01C155.48 385.95 155.69 385.68 155.73 385.5C155.78 385.29 155.59 384.62 155.29 384.59C155.14 384.57 154.98 384.7 154.85 384.86C154.46 384.2 153.84 383.92 153.25 384.16C152.54 384.45 151.81 386.02 152.08 386.64H152.1Z" fill="#308DCC"></path> + <path d="M163.49 390.76C163.8 391.56 164.73 392.04 165.48 391.78C166.17 391.54 166.58 390.7 166.32 390.06C166.04 389.38 164.78 388.93 164.04 389.25C163.46 389.5 163.24 390.11 163.5 390.77L163.49 390.76Z" fill="#308DCC"></path> + <path d="M146.6 371.47C145.91 371.77 145.66 372.52 146.01 373.25C146.28 373.81 147.08 374.07 147.69 373.79C148.44 373.44 148.74 372.72 148.41 372.06C148.09 371.41 147.32 371.16 146.6 371.47Z" fill="#308DCC"></path> + <path d="M154.74 400.43C155.23 401.38 155.94 401.73 156.55 401.45C157.3 401.1 157.61 400.22 157.21 399.55C156.86 398.96 156.14 398.79 155.52 399.19C155.03 399.51 154.49 399.87 154.74 400.42V400.43Z" fill="#308DCC"></path> + <path d="M143.8 391.8C143.24 392.09 143.02 392.73 143.28 393.33C143.61 394.09 144.34 394.4 145.01 394.07C145.52 393.81 145.81 393.12 145.67 392.58C145.69 392.58 145.71 392.6 145.73 392.61C146.54 392.83 147.44 392.26 147.55 391.6C147.61 391.25 147.45 390.84 147.2 390.53C147.65 390.89 148.21 391.05 148.61 390.84C149.5 390.38 149.98 388.91 149.56 387.95C149.29 387.34 148.28 387.11 147.54 387.5C146.54 388.02 146.18 388.91 146.62 389.81C146.7 389.97 146.8 390.11 146.91 390.24C146.75 390.12 146.57 390.03 146.39 390.02C145.8 389.96 145.11 390.71 144.94 391.8C144.57 391.65 144.13 391.63 143.79 391.8H143.8Z" fill="#308DCC"></path> + <path d="M139.29 380.17C138.73 380.44 138.43 381.33 138.73 381.86C139.03 382.39 139.89 382.67 140.45 382.42C141.04 382.16 141.3 381.52 141.05 380.93C140.75 380.23 139.92 379.87 139.3 380.17H139.29Z" fill="#308DCC"></path> + <path d="M135.27 402.74C134.66 403.06 134.49 403.73 134.83 404.44C135.19 405.18 135.75 405.49 136.23 405.21C136.79 404.88 137.23 403.71 136.99 403.19C136.73 402.62 135.91 402.41 135.27 402.74Z" fill="#308DCC"></path> + <path d="M168.76 367.82C168.54 367.21 167.78 366.92 167.13 367.2C166.43 367.51 166.13 368.15 166.41 368.78C166.7 369.43 167.41 369.73 168.02 369.46C168.58 369.21 168.96 368.36 168.76 367.81V367.82Z" fill="#308DCC"></path> + <path d="M145.39 383.93C145.61 384.5 146.3 384.84 146.86 384.64C147.49 384.42 147.82 383.7 147.6 383.04C147.36 382.35 146.86 382.1 146.19 382.37C145.46 382.66 145.15 383.28 145.39 383.93V383.93Z" fill="#308DCC"></path> + <path d="M144.33 411.75C143.83 411.88 143.41 413.17 143.79 413.5C144.17 413.83 144.58 413.83 145.02 413.76C145.64 413.67 145.95 412.91 145.68 412.35C145.41 411.79 144.92 411.6 144.33 411.75V411.75Z" fill="#308DCC"></path> + <path d="M168.31 436.32C168.52 436.73 168.73 437.19 169.12 437.34C169.34 437.59 169.6 437.84 169.92 438.06V431.67C169.53 431.87 169.22 432.16 168.98 432.5C168.54 433.12 168.49 433.89 168.69 434.76C168.77 435.1 168.74 435.42 168.71 435.73C168.56 435.89 168.42 436.09 168.3 436.33L168.31 436.32Z" fill="#308DCC"></path> + <path d="M164.02 454.19C164.49 453.9 164.79 453.43 164.42 452.97C164.14 452.62 163.29 451.83 162.89 452.05C162.49 452.27 162.55 453.37 162.63 453.83C162.71 454.32 163.53 454.49 164.02 454.19V454.19Z" fill="#308DCC"></path> + <path d="M168.74 377.73C168.63 378.51 168.85 379.09 169.65 379.19C169.73 379.19 169.82 379.19 169.92 379.15V377.23C169.51 377.13 169.1 377.45 168.75 377.72L168.74 377.73Z" fill="#308DCC"></path> + <path d="M145.75 407.89C145.6 407.54 145.31 407.32 145.01 407.29C144.99 406.67 144.56 406.15 143.97 406.11C143.31 406.07 142.63 406.64 142.61 407.26C142.59 407.87 143.07 408.38 143.73 408.45C143.77 408.45 143.8 408.45 143.84 408.45C143.84 408.45 143.84 408.45 143.84 408.46C143.9 408.85 145.01 409.32 145.54 409.01C146.04 408.71 145.93 408.3 145.75 407.89V407.89Z" fill="#308DCC"></path> + <path d="M152.14 427.77C151.84 427.94 151.76 428.99 151.91 429.11C152.22 429.37 152.93 429.72 153.17 429.5C153.41 429.28 153.54 428.64 153.4 428.35C153.28 428.08 152.44 427.6 152.14 427.77Z" fill="#308DCC"></path> + <path d="M167.5 447.07C167.61 446.97 167.77 446.82 167.93 446.64C168.32 447.52 169.19 448.44 169.91 448.63V443.01C169.72 443.31 169.6 443.64 169.56 443.96C168.7 444.12 167.98 444.68 167.78 445.41C167.38 445.38 166.87 445.5 166.67 445.61C166.46 445.72 166.38 446.38 166.48 446.72C166.61 447.16 167.08 447.44 167.5 447.07Z" fill="#308DCC"></path> + <path d="M132.21 385.2C131.63 385.45 131.83 386.96 132.06 387.44C132.23 387.8 133.02 388.27 133.59 388.02C134.16 387.78 134.14 386.76 134.01 386.22C133.93 385.87 132.78 384.95 132.21 385.2V385.2Z" fill="#308DCC"></path> + <path d="M169.14 356.53C168.84 356.65 168.9 357.27 168.96 357.52C168.99 357.66 169.34 357.9 169.56 357.79C169.71 357.71 169.84 357.51 169.91 357.33V357.01C169.81 356.8 169.41 356.44 169.14 356.54V356.53Z" fill="#308DCC"></path> + <path d="M142.63 441.44C142.43 441.54 142.14 441.91 142.26 442.2C142.38 442.49 142.83 442.56 143.04 442.49C143.25 442.43 143.74 441.94 143.62 441.66C143.5 441.38 142.82 441.34 142.63 441.44Z" fill="#308DCC"></path> + <path d="M139.49 450.52C139.35 450.54 138.94 450.95 139.07 451.27C139.2 451.59 139.8 451.47 140.04 451.39C140.19 451.34 140.4 450.95 140.3 450.74C140.2 450.53 139.75 450.48 139.49 450.52Z" fill="#308DCC"></path> + <path d="M155.77 368.98C155.66 369.03 155.62 369.34 155.68 369.43C155.74 369.53 155.93 369.67 156.08 369.6C156.23 369.53 156.38 369.31 156.27 369.11C156.16 368.91 155.89 368.93 155.78 368.98H155.77Z" fill="#308DCC"></path> + <path d="M156.45 387.44C156.21 387.57 156.04 387.8 155.92 388.06C155.9 388.06 155.87 388.03 155.85 388.03C155.62 388.01 155.35 388.38 155.26 388.62C155.21 388.75 155.36 389.31 155.71 389.36C155.81 389.37 155.9 389.33 155.98 389.26C156.31 389.71 157.09 389.9 157.6 389.61C158.17 389.28 158.33 388.54 157.97 387.89C157.64 387.29 157.05 387.12 156.46 387.44H156.45Z" fill="#308DCC"></path> + <path d="M92.6 359.47H65.65L52.18 382.8L65.65 406.14H92.6L106.07 382.8L92.6 359.47Z" fill="#2676BC"></path> + <path d="M154.69 112.06C159.953 112.06 164.22 107.793 164.22 102.53C164.22 97.2667 159.953 93 154.69 93C149.427 93 145.16 97.2667 145.16 102.53C145.16 107.793 149.427 112.06 154.69 112.06Z" fill="white"></path> + <path d="M184.5 112.06C189.763 112.06 194.03 107.793 194.03 102.53C194.03 97.2667 189.763 93 184.5 93C179.237 93 174.97 97.2667 174.97 102.53C174.97 107.793 179.237 112.06 184.5 112.06Z" fill="white"></path> + <path d="M214.31 112.06C219.573 112.06 223.84 107.793 223.84 102.53C223.84 97.2667 219.573 93 214.31 93C209.047 93 204.78 97.2667 204.78 102.53C204.78 107.793 209.047 112.06 214.31 112.06Z" fill="white"></path> + <path d="M143.32 473.41H138.7V442.34H169.77V446.96H143.32V473.41Z" fill="#2676BC"></path> + <path d="M731.64 274.31H670.04V212.71H731.64V274.31ZM674.67 269.69H727.02V217.34H674.67V269.69Z" fill="#E6EAF1"></path> + <path d="M136.89 420.18H45.17V432.89H136.89V420.18Z" fill="#2676BC"></path> + <path d="M114.76 443.17H45.17V455.88H114.76V443.17Z" fill="#2676BC"></path> + <path d="M486.92 106.43L514.48 78.87L548.61 113L565.56 96.06L600.8 131.3H486.92V106.43Z" fill="#F6947E"></path> + <path d="M516.25 369.81H281.51V461.66H516.25V369.81Z" fill="#F7B119"></path> + <path d="M329.56 436.11H306.04L317.8 415.74L329.56 395.37L341.32 415.74L353.08 436.11H329.56Z" fill="#FFD839"></path> + <path d="M447.92 394H377.85V409.06H447.92V394Z" fill="#FFD839"></path> + <path d="M477.4 421.04H377.85V436.1H477.4V421.04Z" fill="#FFD839"></path> + <path d="M684.49 260.23C683.82 261.17 684.02 262.4 684.97 263.11C685.99 263.88 687.78 263.63 688.53 262.6C689.18 261.71 688.82 259.9 687.86 259.18C686.88 258.45 685.44 258.89 684.5 260.23H684.49Z" fill="#E6EAF1"></path> + <path d="M682.85 257.81C683.37 256.83 682.99 255.31 682.09 254.74C681.52 254.38 680.38 254.76 679.96 255.46C679.32 256.52 679.55 257.56 680.54 258.13C681.4 258.62 682.5 258.47 682.86 257.81H682.85Z" fill="#E6EAF1"></path> + <path d="M709.05 256.21C708.27 255.74 707.43 255.99 706.82 256.86C706.2 257.75 706.35 258.34 707.37 259.02C708.27 259.62 709.13 259.58 709.54 258.91C709.92 258.31 709.59 256.53 709.05 256.21V256.21Z" fill="#E6EAF1"></path> + <path d="M697.97 244.77C698.78 245.26 699.52 244.99 700.09 244C700.49 243.3 700.43 242.61 699.92 242.25C699.32 241.83 697.58 242.06 697.23 242.61C696.72 243.41 696.99 244.17 697.97 244.77Z" fill="#E6EAF1"></path> + <path d="M690.97 246.61C690.39 246.24 689.93 246.44 689.57 246.95C689.04 247.69 689.11 248.82 689.68 249.18C690.32 249.58 691.57 249.44 691.92 248.92C692.35 248.28 691.9 247.2 690.97 246.62V246.61Z" fill="#E6EAF1"></path> + <path d="M672.36 247.62C672.44 247.8 672.56 247.96 672.65 248.01C672.85 248.12 673.31 248.16 673.49 247.91C673.67 247.66 673.49 247.24 673.31 247.09C673.16 246.96 672.58 246.84 672.36 247.02V247.63V247.62Z" fill="#E6EAF1"></path> + <path d="M705.38 235.34C705.13 235.29 704.78 235.22 704.58 235.55C704.38 235.88 704.62 236.15 704.76 236.2C704.99 236.29 705.47 236.47 705.74 236.13C706.01 235.79 705.51 235.36 705.38 235.34V235.34Z" fill="#E6EAF1"></path> + <path d="M688.66 271.99H691.92C691.8 271.86 691.67 271.73 691.51 271.6C690.52 270.84 689.07 271.2 688.66 271.99Z" fill="#E6EAF1"></path> + <path d="M696.02 254.05C695.63 254.43 695.65 255.77 696.05 256.19C696.39 256.55 697.54 256.45 698 256.01C698.4 255.63 698.35 255.02 697.87 254.6C697.1 253.91 696.38 253.7 696.02 254.05V254.05Z" fill="#E6EAF1"></path> + <path d="M720.68 237.36C720.55 237.57 720.27 238.12 720.56 238.34C720.85 238.56 721.32 238.21 721.37 238.08C721.46 237.85 721.68 237.51 721.35 237.26C721.02 237.01 720.75 237.24 720.67 237.37L720.68 237.36Z" fill="#E6EAF1"></path> + <path d="M715.29 271.99H715.95C715.95 271.99 715.86 271.96 715.81 271.96C715.63 271.94 715.45 271.96 715.29 271.99Z" fill="#E6EAF1"></path> + <path d="M725.97 271.53C726.22 271.69 726.44 271.85 726.67 272H729.12C729.24 271.82 729.31 271.6 729.34 271.34V270.86C729.34 270.79 729.34 270.72 729.32 270.64C729.1 269.36 728.12 268.78 726.89 269.24C726.54 269.37 726.23 269.61 725.56 269.99C725.43 269.4 725.2 268.97 725.3 268.65C725.65 267.59 725.25 266.97 724.35 266.49C724.12 266.37 723.96 266.13 723.76 265.94C723.11 265.31 722.47 265.18 722.06 265.6C721.91 265.76 721.81 265.93 721.77 266.1C721.73 266.1 721.71 266.08 721.67 266.07C721.3 266.03 721.11 266.17 721.09 266.55C721.04 266.92 721.21 267.1 721.58 267.12C721.76 267.13 721.9 267.1 721.99 267.01C722.12 267.19 722.29 267.36 722.51 267.53C722.59 267.59 722.74 267.56 722.82 267.63C723.23 267.98 723.31 268.34 722.79 268.66C722.6 268.77 722.37 268.81 722.19 268.93C721.45 269.43 721.11 270.36 721.31 271.25C721.38 271.56 721.48 271.81 721.61 272.01H725.52C725.68 271.87 725.84 271.71 725.99 271.54L725.97 271.53Z" fill="#E6EAF1"></path> + <path d="M705.87 264.35C704.97 263.78 703.31 264.12 702.76 264.99C702.23 265.83 702.25 266.94 702.73 267.64C702.26 268.65 702.57 270.05 703.43 270.58C704.72 271.37 706.2 271.08 706.88 269.89C707.39 268.99 707.29 268.16 706.62 267.47C706.68 267.4 706.74 267.33 706.78 267.25C707.26 266.37 706.82 264.96 705.86 264.35H705.87Z" fill="#E6EAF1"></path> + <path d="M709.26 271.39C708.67 271.04 707.87 271.23 707.56 271.79C707.53 271.85 707.5 271.92 707.48 271.99H709.82C709.7 271.75 709.51 271.54 709.25 271.38L709.26 271.39Z" fill="#E6EAF1"></path> + <path d="M710.42 267.66C710.9 267.95 711.56 267.9 712.18 267.62C712.12 267.76 712.08 267.94 712.05 268.15C711.92 269.01 712.18 269.54 713.03 269.81C713.96 270.1 715.03 269.41 715.29 268.39C715.55 267.37 715.02 267.05 715.25 266.41C715.48 265.76 715.19 265.42 714.58 265.02C714.27 264.82 713.88 264.57 713.5 264.49C713.33 264.26 713.11 264.05 712.82 263.91C711.19 263.12 710.73 263.46 709.66 264.84C708.99 265.7 709.44 267.08 710.42 267.67V267.66Z" fill="#E6EAF1"></path> + <path d="M688.22 254.34C687.61 255.15 688.13 256.71 689.27 257.45C690.15 258.02 691.08 257.82 691.68 256.91C692.41 255.81 692.17 254.7 691.03 253.92C690.15 253.32 688.83 253.51 688.22 254.33V254.34Z" fill="#E6EAF1"></path> + <path d="M693.78 269.99C693.38 270.66 693.37 271.49 693.69 272H696.59C696.84 271.83 697.05 271.62 697.18 271.38C697.55 270.73 697.11 269.75 696.21 269.25C695.15 268.66 694.43 268.88 693.78 269.99Z" fill="#E6EAF1"></path> + <path d="M679.31 265.25C678.92 265.9 679.31 267.29 680 267.75C680.57 268.12 681.92 267.68 682.3 266.99C682.6 266.45 682.42 265.49 681.96 265.19C680.93 264.51 679.73 264.54 679.31 265.25Z" fill="#E6EAF1"></path> + <path d="M703.92 252.52C703.37 252.24 702.47 252.49 702.18 253C701.56 254.12 701.61 255.11 702.3 255.5C702.97 255.87 704.39 255.39 704.75 254.67C705.02 254.13 704.52 252.82 703.92 252.51V252.52Z" fill="#E6EAF1"></path> + <path d="M673 257.45C672.67 257.96 673.04 258.95 673.98 259.61C674.21 259.53 674.74 259.51 674.99 259.24C675.56 258.62 675.47 257.56 674.93 257.16C674.4 256.76 673.35 256.92 673 257.46V257.45Z" fill="#E6EAF1"></path> + <path d="M696.31 247.13C695.93 247.67 695.38 247.79 694.81 247.99C694.55 248.08 694.31 248.74 694.37 249.08C694.43 249.44 694.8 249.86 695.15 250.01C695.38 250.11 695.89 249.88 696.12 249.65C696.56 249.19 696.91 248.64 697.26 248.1C697.56 247.64 697.39 247.27 696.87 246.98C696.71 247.02 696.41 247 696.32 247.13H696.31Z" fill="#E6EAF1"></path> + <path d="M718.58 266.09C718.15 265.76 717.83 265.3 717.11 265.44C716.28 265.6 715.84 266.74 716.13 267.56C716.26 267.92 716.57 268.29 716.95 268.54C716.55 269.24 716.71 270.03 717.33 270.38C717.84 270.67 718.63 270.48 718.92 270C719.18 269.57 719.13 268.95 718.85 268.5C719.24 268.17 719.41 267.7 719.43 267.5C719.5 266.79 719.04 266.45 718.57 266.09H718.58Z" fill="#E6EAF1"></path> + <path d="M688.13 268.32C688.52 267.72 688.43 267.11 687.89 266.73C687.3 266.32 686.51 266.45 686.17 267.02C685.82 267.59 686.02 268.46 686.56 268.76C687.1 269.06 687.77 268.87 688.13 268.32V268.32Z" fill="#E6EAF1"></path> + <path d="M698.02 264.38C698.8 264.11 698.83 263.02 698.44 262.66C698.42 262.64 698.39 262.64 698.37 262.62C698.35 262.58 698.34 262.54 698.32 262.5C697.56 262.37 696.79 262.28 696.58 263.19C696.38 264.05 697 264.42 697.72 264.59C697.83 264.52 697.93 264.46 698.02 264.38V264.38Z" fill="#E6EAF1"></path> + <path d="M703.89 231.62C703.4 232.26 703.51 233.39 704.1 233.64C704.69 233.89 706.28 232.6 706.19 231.88C706.1 231.16 704.38 230.99 703.89 231.62V231.62Z" fill="#E6EAF1"></path> + <path d="M693.18 238.49C692.88 238.93 692.96 239.41 693.41 239.77C693.9 240.16 694.51 240.13 694.83 239.68C695.2 239.18 695.08 238.41 694.57 238.11C693.99 237.77 693.49 238 693.17 238.48L693.18 238.49Z" fill="#E6EAF1"></path> + <path d="M678.31 261.68C678.68 261.22 678.29 260.77 677.84 260.5C677.32 260.19 676.59 260.35 676.49 260.87C676.41 261.26 676.11 262.15 676.77 262.4C677.43 262.65 678.04 262.02 678.31 261.68V261.68Z" fill="#E6EAF1"></path> + <path d="M687.25 238.41C687.17 238.05 686.34 237.83 685.83 237.61C685.69 237.55 685.36 237.39 685.11 237.83C684.86 238.26 685.18 239.37 685.83 239.6C686.48 239.83 687.42 239.21 687.25 238.41Z" fill="#E6EAF1"></path> + <path d="M685.06 270.1C684.62 269.53 683.1 270.16 682.68 271.21C682.56 271.5 682.55 271.76 682.6 271.99H685.8C685.87 271.23 685.37 270.51 685.06 270.1Z" fill="#E6EAF1"></path> + <path d="M692.99 263.88C692.38 263.58 691.93 263.83 691.61 264.37C691.22 265.01 691.39 265.78 691.97 266.1C692.53 266.41 693.22 266.18 693.5 265.59C693.8 264.95 693.58 264.17 692.99 263.88V263.88Z" fill="#E6EAF1"></path> + <path d="M676.12 268.24C675.65 267.92 675.07 268.15 674.74 268.72C674.4 269.31 674.76 269.74 675.2 269.92C675.57 270.06 676.59 270.37 676.81 269.85C677.03 269.33 676.45 268.47 676.12 268.24Z" fill="#E6EAF1"></path> + <path d="M674.22 263.25C674.14 263.59 674.33 263.99 674.37 264.18C675.13 264.59 675.86 264.41 675.97 263.88C676.04 263.53 675.93 263 675.69 262.75C675.32 262.36 674.36 262.7 674.22 263.25Z" fill="#E6EAF1"></path> + <path d="M723.95 243.36C724.42 243.27 724.84 242.57 724.71 242.09C724.55 241.48 724.13 241.4 722.88 241.78C722.38 242.68 723.38 243.47 723.95 243.36Z" fill="#E6EAF1"></path> + <path d="M676.29 248.02C676.17 247.93 675.73 247.96 675.6 248.15C675.47 248.34 675.68 248.76 675.85 248.95C675.94 249.06 676.51 249.18 676.71 248.89C676.91 248.6 676.48 248.16 676.29 248.01V248.02Z" fill="#E6EAF1"></path> + <path d="M713.51 252.7C713.75 252.42 713.75 252.18 713.46 251.95C713.19 251.7 712.95 251.73 712.71 252.01C712.5 252.27 712.49 252.49 712.75 252.72C713.02 252.95 713.25 252.98 713.5 252.69L713.51 252.7Z" fill="#E6EAF1"></path> + <path d="M726.38 261.99C726.15 261.67 725.7 261.37 725.32 261.33C724.03 261.18 723.11 261.76 722.61 263.28C722.93 263.66 723.22 264.14 723.63 264.47C723.75 264.57 723.89 264.63 724.03 264.69C724.48 265.35 725.31 265.9 726.19 265.74C727.48 265.5 728.08 264.7 728.23 263.81C728.35 263.03 727.45 262.31 726.39 261.99H726.38Z" fill="#E6EAF1"></path> + <path d="M707.61 244.57C707.31 245.03 707.34 245.3 707.41 245.64C707.48 245.98 707.41 246.35 707.75 246.77C707.88 246.93 708.08 247.11 708.33 247.27C708.33 247.33 708.31 247.39 708.32 247.45C708.41 248.56 709.16 249.37 709.99 249.28C710.65 249.21 711.19 248.88 711.49 248.44C711.77 248.79 712.26 248.89 712.72 248.77C713.55 248.55 713.58 247.76 713.65 246.96C712.96 246.56 712.3 245.99 711.58 246.69C711.52 246.75 711.47 246.83 711.43 246.91C711.39 246.87 711.33 246.83 711.28 246.79C711.35 246.68 711.42 246.58 711.46 246.45C711.72 245.8 711.44 245.16 711.13 244.8C710.83 244.44 710.11 243.88 709.43 244.03C708.75 244.18 707.94 244.05 707.61 244.55V244.57Z" fill="#E6EAF1"></path> + <path d="M710.65 238.16C711.29 237.58 712.17 237.13 712.32 236.07C712.11 235.74 711.87 235.39 711.65 235.05C712.03 233.97 711.91 232.86 711.31 232.57C710.82 232.32 710.31 232.41 709.9 232.83C709.18 233.59 709.18 234.03 709.84 235.09C709.65 235.92 709.4 236.66 709.33 237.41C709.26 238.16 710.1 238.66 710.65 238.17V238.16Z" fill="#E6EAF1"></path> + <path d="M697.72 268.44C698.31 268.84 698.9 268.75 699.29 268.19C699.7 267.61 699.61 266.83 699.09 266.44C698.58 266.06 697.8 266.26 697.4 266.88C697.05 267.43 697.18 268.08 697.72 268.44Z" fill="#E6EAF1"></path> + <path d="M701.43 238.67C701.51 239.73 702.77 240.55 704.17 240.44C705.16 240.36 705.77 239.58 705.7 238.48C705.62 237.17 704.53 236.28 703.2 236.44C702.19 236.56 701.35 237.62 701.42 238.67H701.43Z" fill="#E6EAF1"></path> + <path d="M716.17 224.74C716.19 225.73 717.09 226.41 718.24 226.33C719.12 226.27 719.57 225.57 719.51 224.38C719.46 223.41 718.9 222.77 718.19 222.84C717.51 222.91 716.16 224.18 716.17 224.74V224.74Z" fill="#E6EAF1"></path> + <path d="M727.1 267.65C727.17 268.56 727.86 269.1 728.93 269.08C729.07 269.08 729.21 269.07 729.33 269.05V265.7C729.23 265.68 729.13 265.67 729.02 265.68C728.31 265.73 727.06 267.02 727.11 267.65H727.1Z" fill="#E6EAF1"></path> + <path d="M728.19 234.12C727.44 234.18 726.89 234.87 726.99 235.59C727.09 236.28 727.84 236.91 728.49 236.85C728.75 236.83 729.07 236.54 729.33 236.19V233.87C729.13 233.92 728.93 234.03 728.75 234.23C728.55 234.15 728.36 234.11 728.19 234.12Z" fill="#E6EAF1"></path> + <path d="M723.57 223.46C722.83 223.44 722.14 223.55 721.76 224.32C720.61 226.64 720.8 227.37 722.9 228.83C722.94 228.86 722.98 228.91 723.04 228.97V228.99C722.73 228.8 722.33 228.67 722.1 228.63C721.59 228.53 721.12 228.78 721.1 229.43C721.07 230.09 721.47 230.59 722.03 230.55C722.29 230.53 722.8 230.29 723.13 229.99C723.3 230.68 723.69 231.02 724.29 230.99C725.1 230.95 725.72 230.14 725.39 229.2C725.1 228.39 725.54 227.98 725.92 227.38C727.6 228.34 728.69 227.92 729.1 226.3C729.14 226.14 729.17 225.98 729.19 225.81C729.3 224.68 728.84 224.16 727.71 224.17C726.76 224.17 725.83 224.26 725.47 225.72C725.14 225.13 724.88 224.85 724.82 224.52C724.68 223.81 724.28 223.46 723.59 223.44L723.57 223.46Z" fill="#E6EAF1"></path> + <path d="M727.16 251.62C727.3 251.64 727.42 251.63 727.54 251.62C727.81 251.87 728.15 252.02 728.61 251.91C728.93 251.83 729.18 251.65 729.33 251.41V250.22C729.15 249.9 728.85 249.59 728.59 249.54C728.53 249.54 728.48 249.54 728.43 249.53C728.54 249.2 728.78 249.06 729.22 249.25C729.26 249.27 729.29 249.29 729.32 249.31V239.47C728.77 239.66 728.3 240.01 728.1 240.46C727.84 241.04 727.83 241.62 727.96 242.19C727.65 242.27 727.33 242.46 727.02 242.77C726.11 243.69 726.21 244.83 727.3 245.56C727.61 245.77 727.99 245.89 728.69 246.21C728.28 246.65 728.07 247.1 727.75 247.2C726.68 247.53 726.41 248.22 726.55 249.23C726.59 249.49 726.49 249.76 726.45 250.03C726.31 250.93 726.58 251.52 727.16 251.61V251.62Z" fill="#E6EAF1"></path> + <path d="M697.8 257.13C697.72 257.95 698.25 258.48 698.91 258.8C699.39 259.03 699.95 259.08 700.51 259.21C700.56 259.34 700.61 259.48 700.67 259.61C700.61 259.7 700.55 259.79 700.51 259.9C700.17 260.87 700.24 261.62 700.71 261.82C701.11 262 701.99 261.68 702.44 261.27C702.7 261.35 702.97 261.37 703.22 261.32C704.25 261.1 704.95 260.39 705.32 259.43C705.44 259.12 705.4 258.64 705.23 258.34C704.59 257.15 703.45 256.78 702.2 257.26C701.95 257.36 701.7 257.46 701.44 257.56C701.25 257.07 701.11 256.59 700.9 256.15C700.49 255.31 700.04 255.13 699.17 255.42C698.36 255.69 697.89 256.27 697.81 257.11L697.8 257.13Z" fill="#E6EAF1"></path> + <path d="M702.64 226.6C702.53 226.49 702.4 226.39 702.31 226.26C701.93 225.68 701.43 225.7 700.86 225.9C700.31 226.09 700.14 226.47 700.07 227.02C699.89 228.35 700.27 228.84 701.62 228.93C702.63 229 703.65 229.11 704.64 229.2C704.62 231.06 704.79 231.2 706.35 230.87C706.76 229.99 706.42 229.4 705.56 228.98C706.07 226.72 705.01 225.9 702.64 226.6Z" fill="#E6EAF1"></path> + <path d="M712.32 242.45C713.97 242.35 714.73 241.54 714.69 239.92C714.66 238.69 713.37 237.61 712.07 237.74C711.05 237.84 710.01 239.3 710.05 240.61C710.08 241.73 711.06 242.53 712.32 242.45Z" fill="#E6EAF1"></path> + <path d="M717.37 241.54C716.43 241.54 715.54 242.52 715.4 243.59C714.72 244.21 714.68 245.39 715.33 246.17C716.01 246.98 716.58 246.73 716.97 247.29C717.36 247.85 717.81 247.82 718.49 247.56C719.17 247.3 720.19 246.87 719.8 245.93C719.72 245.73 719.62 245.59 719.52 245.48C719.88 245.1 720.1 244.62 720.07 244.13C720 243.09 718.39 241.55 717.37 241.55V241.54Z" fill="#E6EAF1"></path> + <path d="M711.97 220.35C711.02 220.46 710.02 221.7 710.07 222.72C710.13 223.88 711.22 224.64 712.71 224.55C713.9 224.48 714.64 223.69 714.59 222.55C714.53 221.3 713.23 220.21 711.97 220.35V220.35Z" fill="#E6EAF1"></path> + <path d="M705.06 252.91C705.02 253.87 706.16 254.84 707.34 254.85C708.12 254.85 708.72 254.13 708.74 253.16C708.76 252.18 707.89 250.97 707.15 250.95C706.13 250.93 705.1 251.89 705.06 252.9V252.91Z" fill="#E6EAF1"></path> + <path d="M699.74 247C699.74 247.63 700.01 248.04 700.55 248.25C700.51 248.31 700.47 248.36 700.43 248.42C699.93 249.27 700.26 250.08 701.34 250.67C701.95 251.01 703.03 250.74 703.37 250.18C703.72 249.6 703.55 248.16 703.14 247.56C703.26 247.39 703.34 247.22 703.35 247.05C703.37 246.17 702.31 245.09 701.44 245.11C700.59 245.13 699.75 246.07 699.74 247.01V247Z" fill="#E6EAF1"></path> + <path d="M713.4 233.84C713.43 234.5 714.98 235.48 715.82 235.37C716.42 235.3 717.09 234.46 717.06 233.83C717.01 232.74 716.27 231.94 715.38 232.01C714.32 232.1 713.35 232.99 713.39 233.83L713.4 233.84Z" fill="#E6EAF1"></path> + <path d="M727.15 238.03C727.1 237.44 726.22 236.78 725.59 236.85C724.93 236.93 723.95 237.91 723.96 238.49C723.98 239.33 725.12 240.41 725.93 240.36C726.76 240.31 727.26 239.34 727.15 238.03V238.03Z" fill="#E6EAF1"></path> + <path d="M692.05 245.44C692.05 246.32 692.84 247.29 693.58 247.34C694.35 247.39 695.04 246.44 695.07 245.3C695.07 245.07 694.98 244.82 694.82 244.61C694.88 244.56 694.95 244.51 695 244.45C695.32 243.94 695.15 242.73 694.72 242.49C694.14 242.17 693 242.48 692.68 243.05C692.45 243.46 692.52 243.95 692.8 244.34C692.38 244.62 692.06 245.04 692.06 245.44H692.05Z" fill="#E6EAF1"></path> + <path d="M719.24 237.52C719.24 236.74 718.65 236.19 717.87 236.24C717.21 236.28 716.55 236.91 716.58 237.48C716.61 238.06 717.44 238.99 717.92 238.97C718.51 238.95 719.25 238.14 719.25 237.52H719.24Z" fill="#E6EAF1"></path> + <path d="M726.18 221.82C726.82 221.78 727.14 221.38 727.2 220.76C727.27 220.07 726.96 219.53 726.37 219.31C725.46 218.97 724.58 219.75 724.49 220.33C724.4 220.9 725.12 221.9 726.18 221.83V221.82Z" fill="#E6EAF1"></path> + <path d="M721.46 216.21C721.63 215.92 722.03 215.5 722.13 215.02H719.74C719.74 215.02 719.74 215.09 719.74 215.12C719.83 215.74 720.56 216.32 721.46 216.2V216.21Z" fill="#E6EAF1"></path> + <path d="M718.64 217.49C717.95 217.54 717.41 218.17 717.48 218.8C717.57 219.51 718.29 220.07 718.97 219.96C719.6 219.86 720.13 219.18 720.06 218.58C719.99 217.99 719.28 217.44 718.64 217.49V217.49Z" fill="#E6EAF1"></path> + <path d="M710.6 254.37C710.34 254.68 710.15 255.33 710.31 255.64C710.71 256.46 711.5 256.45 712.33 256.17C712.62 255.51 712.87 254.81 712.22 254.25C711.72 253.82 711.03 253.85 710.6 254.36V254.37Z" fill="#E6EAF1"></path> + <path d="M695.06 234.37C694.5 234.6 694.18 235.12 694.37 235.71C694.48 236.07 694.82 236.53 695.15 236.62C696.09 236.88 696.54 236.24 696.87 235.3C696.33 234.72 695.95 234.01 695.07 234.37H695.06Z" fill="#E6EAF1"></path> + <path d="M709.15 229.72C709.27 230.17 709.37 231.21 710.14 231.18C710.9 231.15 711 230.12 711.14 229.66C711.29 229.14 710.73 228.71 710.09 228.71C709.4 228.71 708.98 229.08 709.16 229.72H709.15Z" fill="#E6EAF1"></path> + <path d="M698.52 226.15C698.91 226.15 699.29 225.65 699.55 225.45C699.51 224.52 699.04 224.32 698.54 224.33C698.04 224.34 697.48 224.62 697.62 225.2C697.71 225.59 698.21 226.14 698.52 226.14V226.15Z" fill="#E6EAF1"></path> + <path d="M707.32 264.81C708.34 264.69 708.4 263.42 707.98 263.02C707.63 262.69 706.82 262.75 706.51 263.14C706.11 263.63 706.29 264.02 707.33 264.81H707.32Z" fill="#E6EAF1"></path> + <path d="M700.36 219.3C700.06 219.35 699.78 219.69 699.76 219.92C699.74 220.14 700.02 220.82 700.32 220.77C700.63 220.72 700.85 220.22 700.82 220.05C700.78 219.78 700.66 219.25 700.36 219.3V219.3Z" fill="#E6EAF1"></path> + <path d="M698.13 215.34C698.13 215.82 698.46 216.14 698.95 216.08C699.43 216.01 699.66 215.63 699.57 215.22C699.55 215.14 699.51 215.08 699.47 215.02H698.21C698.16 215.1 698.13 215.21 698.13 215.34Z" fill="#E6EAF1"></path> + <path d="M715.63 252.04C714.51 252.65 713.98 253.44 713.86 254.34C713.82 254.65 713.91 254.91 714.05 255.16C713.92 255.18 713.78 255.2 713.65 255.24C712.78 255.48 712.17 256.33 712.25 257.02C712.36 258.01 713.05 258.86 713.98 258.92C714.39 258.95 714.95 258.74 715.23 258.44C715.39 258.26 715.51 258.08 715.62 257.9C715.9 258.41 716.26 258.73 716.67 258.9C716.62 258.94 716.57 258.98 716.53 259.02C715.58 260.14 716.01 261.25 716.53 261.97C717.06 262.69 718.63 263.48 719.73 262.22C720.02 261.89 720.23 261.55 720.37 261.21C720.7 260.98 720.97 260.58 720.99 260.06C720.85 259.98 720.69 259.87 720.52 259.76C720.44 259.41 720.28 259.09 720.03 258.85C719.9 258.72 719.73 258.63 719.54 258.55C720.08 258.28 720.45 257.87 720.7 257.38C720.84 257.1 720.9 256.8 720.92 256.49C720.97 256.66 721.03 256.82 721.11 256.97C721.46 257.65 722.12 258.04 722.98 258.26C723.02 258.27 723.06 258.29 723.1 258.3C723.49 259.1 724.27 259.85 725.04 259.91C726.5 260.03 727.16 259.04 727.43 258.19C727.45 258.12 727.47 258.03 727.48 257.94C727.95 257.45 728.31 256.81 728.42 255.95C728.58 254.68 728.24 253.79 727.58 253.17C726.81 252.45 725.64 253.14 724.61 252.75C722.16 251.83 721.16 253.53 720.85 255.27C720.83 255.37 720.83 255.47 720.82 255.57C720.78 255.41 720.73 255.25 720.67 255.09C720.35 254.25 720.73 253.4 720.08 252.77C719.22 251.91 717.48 251.01 715.63 252.01V252.04Z" fill="#E6EAF1"></path> + <path d="M721.9 250.66C722.29 251.49 723.99 251.91 724.72 251.36C725.46 250.81 725.82 249.07 724.87 248.16C723.92 247.25 722.92 247.22 722.12 247.63C721.31 248.03 721.36 249.51 721.9 250.66Z" fill="#E6EAF1"></path> + <path d="M719.74 271.97C719.16 271.36 718.47 271.18 717.79 271.36C717.39 271.46 717.11 271.71 716.92 272H719.75C719.75 272 719.75 271.99 719.74 271.98V271.97Z" fill="#E6EAF1"></path> + <path d="M61.6 198.76H0V137.16H61.6V198.76ZM4.63 194.14H56.97V141.79H4.62V194.14H4.63Z" fill="#E6EAF1"></path> + <path d="M12.35 194.6C11.33 193.93 9.92 194.46 9.06 195.85C8.94 196.04 8.86 196.25 8.81 196.45H13.44C13.31 195.71 12.93 194.97 12.36 194.6H12.35Z" fill="#E6EAF1"></path> + <path d="M36.58 190.96C36.75 191.94 37.49 192.74 38.42 192.75C38.83 192.75 39.38 192.51 39.63 192.19C40.44 191.18 40.44 190.09 39.42 188.86C38.93 188.93 38.37 188.92 37.87 189.09C37.01 189.38 36.46 190.27 36.58 190.96V190.96Z" fill="#E6EAF1"></path> + <path d="M4.98999 193.99C5.87999 194.43 6.96999 194.21 7.27999 193.53C7.73999 192.52 7.26999 191.03 6.32999 190.51C5.73999 190.18 4.61999 190.64 4.24999 191.36C3.67999 192.46 3.96999 193.49 4.98999 193.99V193.99Z" fill="#E6EAF1"></path> + <path d="M31.83 193.25C32.38 193.57 32.9 193.66 33.31 193.55C33.31 193.57 33.31 193.59 33.31 193.6C33.35 193.71 33.51 193.88 33.67 193.84C33.83 193.8 34.02 193.61 33.95 193.39C33.93 193.32 33.88 193.27 33.83 193.24C33.89 193.17 33.95 193.09 34 193.01C34.34 192.38 33.91 190.63 33.35 190.34C32.54 189.92 31.72 190.21 31.16 191.13C30.59 192.06 30.78 192.64 31.84 193.25H31.83Z" fill="#E6EAF1"></path> + <path d="M20.71 177.49C20.25 178.31 20.56 179.06 21.58 179.6C22.42 180.04 23.14 179.73 23.65 178.7C24.01 177.98 23.9 177.29 23.38 176.97C22.75 176.58 21.03 176.92 20.71 177.49V177.49Z" fill="#E6EAF1"></path> + <path d="M13.33 182.28C12.85 183.05 12.99 184.17 13.57 184.5C14.23 184.87 15.47 184.64 15.79 184.1C16.18 183.44 15.67 182.39 14.7 181.86C14.1 181.53 13.65 181.76 13.33 182.28V182.28Z" fill="#E6EAF1"></path> + <path d="M28.81 170.51C29.06 170.16 28.53 169.76 28.4 169.74C28.14 169.71 27.8 169.66 27.61 170C27.42 170.34 27.69 170.6 27.83 170.64C28.07 170.72 28.56 170.86 28.81 170.51V170.51Z" fill="#E6EAF1"></path> + <path d="M20.19 188.98C19.82 189.38 19.93 190.72 20.35 191.12C20.72 191.46 21.85 191.28 22.29 190.82C22.67 190.41 22.58 189.81 22.07 189.42C21.26 188.78 20.53 188.62 20.19 188.99V188.98Z" fill="#E6EAF1"></path> + <path d="M12.43 189.75C11.87 190.6 12.49 192.12 13.67 192.79C14.58 193.31 15.5 193.05 16.04 192.11C16.7 190.97 16.39 189.87 15.21 189.17C14.29 188.62 12.99 188.9 12.43 189.75Z" fill="#E6EAF1"></path> + <path d="M54.68 180.42C54.26 181.08 54.55 181.97 55.36 182.5C56.18 183.04 57.67 182.95 58.07 182.33C58.34 181.92 58.41 181.39 58.33 180.88C58.56 181.46 58.78 182.05 59.28 182.47V179.17C58.77 179.28 58.2 179.88 58.18 180.36C58.04 180.02 57.82 179.72 57.53 179.52C57.37 179.41 57.18 179.35 56.98 179.32C57.2 178.98 57.23 178.51 57.06 177.85C56.84 177 55.98 176.45 55.21 176.69C54.58 176.88 53.62 178.3 53.72 178.88C53.82 179.43 54.4 179.83 55.13 179.92C54.96 180.07 54.8 180.24 54.67 180.43L54.68 180.42Z" fill="#E6EAF1"></path> + <path d="M24.25 183.09C23.81 183.97 24.18 184.75 25.3 185.28C25.93 185.58 26.99 185.25 27.3 184.66C27.67 183.96 27.25 182.11 26.66 181.84C25.92 181.5 24.74 182.11 24.25 183.08V183.09Z" fill="#E6EAF1"></path> + <path d="M56.96 188.19C56.71 189.02 57.36 189.45 58 189.94C58.51 189.67 59.1 189.46 59.29 188.97V188.24C59.27 188.19 59.25 188.13 59.22 188.08C59.24 188.08 59.27 188.06 59.29 188.06V184.89C58.71 184.89 58.21 185.15 57.98 185.61C57.69 186.2 57.68 186.83 57.89 187.33C57.44 187.39 57.09 187.75 56.96 188.19V188.19Z" fill="#E6EAF1"></path> + <path d="M16.82 179.85C17.43 180.16 18.3 179.96 18.58 179.46C18.87 178.93 18.62 177.73 18.19 177.53C17.59 177.24 16.47 177.62 16.19 178.21C15.91 178.8 16.19 179.54 16.83 179.85H16.82Z" fill="#E6EAF1"></path> + <path d="M18.25 184.12C18.29 184.3 18.42 184.5 18.59 184.66C18.36 184.99 18.18 185.59 18.14 185.9C18.08 186.46 18.65 186.74 19.33 186.64C20.01 186.54 20.13 186.01 19.96 185.56C19.9 185.4 19.74 185.15 19.55 184.93C19.74 184.85 19.92 184.72 20.03 184.59C20.44 184.1 20.76 183.53 21.07 182.97C21.35 182.49 21.15 182.14 20.61 181.87C20.45 181.92 20.15 181.92 20.07 182.06C19.72 182.62 19.18 182.77 18.63 183.01C18.38 183.12 18.18 183.78 18.26 184.13L18.25 184.12Z" fill="#E6EAF1"></path> + <path d="M27.26 195.49C27.44 195.02 26.84 194.04 26.25 193.81C25.82 193.65 25.4 193.85 25.16 194.28C24.94 194.18 24.67 194.13 24.55 194.16C24.33 194.22 23.98 194.53 24.04 194.84C24.1 195.15 24.53 195.3 24.75 195.28C24.79 195.28 24.84 195.26 24.89 195.24C24.83 195.87 24.98 196.32 25.34 196.46C25.34 196.46 25.36 196.46 25.37 196.46H25.83C26.39 196.34 27.1 195.91 27.25 195.5L27.26 195.49Z" fill="#E6EAF1"></path> + <path d="M16.72 174.89C17.23 175.25 17.84 175.18 18.14 174.72C18.47 174.2 18.31 173.43 17.79 173.17C17.19 172.87 16.71 173.12 16.41 173.62C16.14 174.08 16.25 174.55 16.72 174.89Z" fill="#E6EAF1"></path> + <path d="M9.02001 173.19C8.88001 173.14 8.54001 173 8.32001 173.45C8.10001 173.9 8.48001 174.98 9.15001 175.18C9.82001 175.37 10.71 174.7 10.49 173.91C10.39 173.56 9.55001 173.39 9.02001 173.2V173.19Z" fill="#E6EAF1"></path> + <path d="M52.81 168.73C53.28 168.61 53.65 167.89 53.49 167.42C53.29 166.82 52.23 166.4 51.64 167.22C51.2 168.15 52.24 168.88 52.8 168.73H52.81Z" fill="#E6EAF1"></path> + <path d="M37.48 185.83C37.19 185.59 36.95 185.64 36.74 185.94C36.54 186.21 36.55 186.43 36.83 186.65C37.11 186.87 37.35 186.88 37.58 186.58C37.81 186.29 37.79 186.05 37.49 185.84L37.48 185.83Z" fill="#E6EAF1"></path> + <path d="M48.49 196.45H52.91C52.79 195.99 52.33 195.59 51.73 195.32C51.79 195.32 51.85 195.33 51.92 195.32C52.24 195.29 52.63 194.83 52.76 194.49C52.86 194.24 52.68 193.7 52.46 193.55C51.8 193.1 51.23 193.39 50.74 194.05C50.86 194.45 50.96 194.89 51.24 195.14C51 195.07 50.75 195 50.49 194.97C49.75 194.88 48.79 195.66 48.49 196.45V196.45Z" fill="#E6EAF1"></path> + <path d="M41.15 195.64C41.72 196.32 43.33 197.02 44.36 195.69C44.63 195.34 44.82 194.99 44.94 194.64C45.47 194.71 45.94 194.55 46.24 194.05C46.37 193.84 46.47 193.45 46.36 193.28C46.04 192.76 45.61 192.31 45.19 191.78C45.49 190.28 45.12 189.12 44.22 188.93C43.97 188.88 43.68 188.93 43.39 189.03C43.66 188.91 43.96 188.77 44.15 188.54C44.53 188.1 44.3 187.59 43.81 187.32C43.38 187.08 42.89 186.92 42.52 187.45C42.19 187.91 42.34 188.74 43.01 189.2C42.41 189.53 41.88 190.1 41.74 190.67C41.6 191.27 41.7 191.66 42.21 191.99C41.7 192.11 41.24 192.35 40.98 192.7C40.1 193.88 40.6 194.96 41.17 195.64H41.15Z" fill="#E6EAF1"></path> + <path d="M32.97 178.19C32.3 178.38 31.49 178.3 31.19 178.82C30.92 179.29 30.96 179.57 31.05 179.9C31.14 180.23 31.08 180.61 31.46 181.01C31.66 181.22 32 181.47 32.4 181.64C32.33 181.66 32.25 181.67 32.18 181.69C31.51 181.9 30.95 182.86 31.13 183.5C31.34 184.27 32.89 185.34 33.51 185.14C34.28 184.89 34.74 183.64 34.44 182.59C34.33 182.19 34.11 181.9 33.81 181.73C34.5 181.52 34.96 181.08 35.15 180.48C35.37 179.81 35.05 179.19 34.72 178.85C34.39 178.5 33.64 177.99 32.97 178.18V178.19Z" fill="#E6EAF1"></path> + <path d="M31.33 187.06C31.34 187.39 31.57 187.65 31.85 187.69C32.13 187.73 32.58 187.39 32.64 187.11C32.7 186.83 32.28 186.54 32 186.51C31.76 186.49 31.32 186.74 31.33 187.07V187.06Z" fill="#E6EAF1"></path> + <path d="M38.99 179.95C39.08 180.05 39.18 180.13 39.27 180.2C38.94 180.74 39.13 181.33 39.43 182C40.25 182.03 41.05 182.3 41.4 181.42C41.4 181.4 41.4 181.39 41.41 181.37C41.65 181.37 41.92 181.29 42.24 181.15C42.63 180.97 43.12 180.73 43.38 180.38C43.7 180.79 44.14 181 44.66 180.83C45.7 180.48 46.18 179.75 46.79 178.88C47.24 178.23 46.59 177.45 47.52 177.37C48.46 177.29 50.36 176.88 49.99 175.18C49.81 174.34 48.76 173.66 47.89 173.73C47.88 173.73 47.87 173.73 47.86 173.73C48.29 173.19 48.48 172.38 48.26 171.64C47.97 170.63 46.48 169.91 45.43 170.27C45.1 170.38 44.81 170.58 44.58 170.82C44.55 170.78 44.53 170.73 44.47 170.7C44.13 170.47 43.87 170.72 43.8 170.85C43.68 171.07 43.44 171.63 43.74 171.83C43.82 171.88 43.92 171.89 44.01 171.88C43.97 172.12 43.98 172.36 44.05 172.59C44.31 173.42 45.54 174.22 46.51 174.32C46.23 174.56 46.04 174.85 46.02 175.16C45.97 175.89 44.38 175.29 44.24 176.29C44.11 177.23 42.91 177.54 42.88 178.76C42.88 178.79 42.88 178.81 42.88 178.84C42.55 178.68 42.22 178.78 42.06 178.89C41.8 179.05 41.17 178.89 41.4 178.63C41.62 178.36 41.57 177.93 40.92 177.36C40.72 177.19 40.53 177.07 40.34 176.99C41.08 176.94 41.89 176.58 42.23 175.84C42.78 174.65 42.49 173.7 41.85 173.06C41.21 172.42 39.83 172.94 38.91 173.83C38.25 174.47 38.4 176.21 39.15 176.73C39.29 176.83 39.47 176.89 39.67 176.93C39.45 176.98 39.23 177.1 39 177.3C38.26 177.93 38.27 179.2 39 179.97L38.99 179.95Z" fill="#E6EAF1"></path> + <path d="M59.29 196.45V191.91C58.66 191.79 58.03 191.65 57.37 191.52C56.89 189.01 56.17 188.53 54.11 189.51C53 190.04 52.65 191.36 53.52 192.28C54.17 192.97 55.05 193.36 56.07 194.05C56.07 194.3 56.06 194.55 56.07 194.81C56 195.42 56.15 196.02 56.48 196.45H59.27H59.29Z" fill="#E6EAF1"></path> + <path d="M49.37 168.02C49.95 168.06 50.74 168.21 50.95 167.49C51.23 166.54 51.89 166.1 52.66 165.68C53.31 165.33 53.43 164.77 53.06 164.14C52.67 163.48 51.65 163.15 51.23 163.7C50.59 164.55 49.83 164.63 49.08 164.55C48.18 164.74 47.46 165.52 47.47 166.16C47.48 166.82 48.57 167.96 49.36 168.02H49.37Z" fill="#E6EAF1"></path> + <path d="M44.4 196.25C44.23 196.29 44.07 196.37 43.91 196.46H45.59C45.17 196.26 44.74 196.17 44.4 196.25Z" fill="#E6EAF1"></path> + <path d="M39.68 142.15C38.6 142.47 38.08 143.27 38.34 144.24C38.58 145.13 39.45 145.82 40.1 145.63C41.06 145.35 41.82 144 41.58 142.98C41.43 142.33 40.48 141.92 39.68 142.15V142.15Z" fill="#E6EAF1"></path> + <path d="M44.56 163.05C43.89 163.24 43.59 163.86 43.8 164.62C44.17 165.91 44.77 166.39 45.71 166.15C46.39 165.97 47.06 164.7 46.83 164.03C46.62 163.41 45.3 162.85 44.56 163.05V163.05Z" fill="#E6EAF1"></path> + <path d="M43.14 158.84C42.2 159.15 42.15 159.99 42.04 160.76C43.21 161.64 43.79 161.75 44.37 161.21C44.8 160.81 44.93 160.31 44.68 159.73C44.42 159.11 43.72 158.65 43.13 158.84H43.14Z" fill="#E6EAF1"></path> + <path d="M18.02 167.55C18.59 167.43 19.06 166.76 18.96 166.21C18.83 165.54 18.21 165.16 17.46 165.28C16.75 165.4 16.43 165.86 16.57 166.56C16.72 167.26 17.34 167.69 18.02 167.54V167.55Z" fill="#E6EAF1"></path> + <path d="M38.45 156.92C38.49 157.87 38.64 158.65 39.58 158.78C39.9 158.82 40.51 158.5 40.58 158.23C40.71 157.77 40.69 157.09 40.42 156.75C39.83 155.98 39.17 156.6 38.45 156.91V156.92Z" fill="#E6EAF1"></path> + <path d="M25.39 167.08C24.87 167.22 24.66 167.56 24.82 168.05C25 168.59 25.31 169.04 25.99 168.92C26.37 168.85 26.74 168.44 26.89 168.04C26.93 168.07 26.97 168.1 27.02 168.11C27.62 168.32 29.13 166.94 29 166.23C28.87 165.52 27.14 165.45 26.69 166.11C26.5 166.4 26.43 166.77 26.45 167.12C26.15 167.01 25.76 166.98 25.39 167.08V167.08Z" fill="#E6EAF1"></path> + <path d="M30.65 143.33C30.32 143.58 30.31 144.13 30.35 144.58C30.4 145.07 30.77 145.48 31.39 145.27C31.92 145.09 32.4 144.81 32.28 144.12C32.19 143.57 30.98 143.08 30.64 143.33H30.65Z" fill="#E6EAF1"></path> + <path d="M53.73 140.79C54.05 141.95 54.9 142.46 55.93 142.13C56.94 141.8 57.37 140.98 57.09 139.95C57.04 139.78 56.97 139.63 56.89 139.48H53.99C53.76 139.93 53.63 140.43 53.74 140.8L53.73 140.79Z" fill="#E6EAF1"></path> + <path d="M58.6 144.37C58.47 145.01 58.73 145.48 59.25 145.74C59.26 145.74 59.27 145.74 59.29 145.75V143.61C58.97 143.68 58.71 143.86 58.61 144.37H58.6Z" fill="#E6EAF1"></path> + <path d="M49.85 181.5C49.28 181.87 49.36 183.02 49.6 183.25C50.25 183.89 49.81 184.39 49.77 185C49.75 185.33 49.84 185.67 49.95 186.01C49.53 186.07 49.09 186.11 48.66 185.98C46.16 185.21 45.26 186.96 45.06 188.72C44.99 189.35 45.14 189.91 45.43 190.39C45.82 191.05 46.5 191.4 47.38 191.57C48.26 191.74 48.78 192.51 49.66 192.31C50.84 192.03 52.54 191.05 52.67 188.94C52.67 188.87 52.67 188.81 52.67 188.75C53.3 188.98 53.85 188.86 54.34 188.37C55.12 187.6 55.13 186.52 54.38 185.59C54.03 185.16 53.67 184.74 53.31 184.31C53.45 184.06 53.48 183.75 53.38 183.43C53.25 183.05 52.81 182.54 52.46 182.51C52.31 182.49 52.17 182.51 52.05 182.53C51.52 181.73 50.42 181.15 49.88 181.5H49.85Z" fill="#E6EAF1"></path> + <path d="M51.05 171.37C51.18 171.94 51.32 172.51 51.46 173.14C51.5 173.14 51.53 173.14 51.57 173.14C51.5 173.24 51.44 173.35 51.4 173.46C51.04 174.45 51.27 175.42 51.88 176.24C52.08 176.51 52.51 176.72 52.85 176.75C54.19 176.84 55.12 176.07 55.38 174.76C55.43 174.5 55.48 174.23 55.53 173.95C55.9 174.02 56.24 174.1 56.58 174.16C56.77 174.57 57.06 174.99 57.42 175.17C57.98 175.45 58.43 175.01 58.68 174.45C58.87 174.02 59.09 173.61 59.29 173.19V171.9C58.99 170.8 58.11 169.56 57.32 169.47C57.22 169.46 57.07 169.46 57 169.52C56.21 170.25 55.49 169.69 54.74 169.43C53.79 169.11 53.13 169.56 52.96 170.53C52.94 170.62 52.94 170.71 52.93 170.8C52.74 170.73 52.53 170.7 52.32 170.74C51.87 170.83 51.48 171.19 51.07 171.42L51.05 171.35V171.37Z" fill="#E6EAF1"></path> + <path d="M30.23 173.71C30.49 174.76 31.94 175.63 33.07 175.43C34.27 175.22 34.91 173.98 34.59 172.46C34.54 172.2 34.44 171.97 34.31 171.76C34.8 171.31 35.29 170.83 35.36 170.04C35.13 169.73 34.87 169.39 34.63 169.06C34.71 168.78 34.76 168.49 34.77 168.22C34.9 168.4 35.14 168.55 35.42 168.58C35.86 168.64 36.58 168.44 36.86 168.13C37.25 167.69 36.94 167.3 36.79 167.21C36.46 167.01 36.1 167.12 35.72 167.23C35.37 167.33 35.01 167.35 34.77 167.68C34.77 167.68 34.77 167.69 34.77 167.7C34.71 167.16 34.5 166.74 34.16 166.6C33.8 166.45 33.44 166.47 33.13 166.65C33.16 166.5 33.16 166.35 33.12 166.19C32.96 165.59 32.52 165.31 31.91 165.34C31.39 165.37 30.74 166.56 31.05 166.95C31.36 167.34 31.77 167.42 32.21 167.44C32.29 167.44 32.37 167.44 32.44 167.42C32.15 167.96 32.29 168.4 32.85 169.2C32.76 169.75 32.64 170.26 32.57 170.76C32.41 170.76 32.25 170.78 32.08 170.81C30.88 171.08 29.96 172.54 30.25 173.7L30.23 173.71Z" fill="#E6EAF1"></path> + <path d="M56.33 161.66C56.59 162.99 57.91 163.84 59.29 163.62V158.3C58.94 158.2 58.57 158.18 58.16 158.27C56.75 158.59 56 159.97 56.33 161.65V161.66Z" fill="#E6EAF1"></path> + <path d="M52.23 150.58C52.02 149.73 50.95 149.13 50 149.34C49.09 149.54 48.29 150.71 48.5 151.55C48.75 152.56 49.84 153.36 50.65 153.14C51.48 152.91 52.42 151.38 52.23 150.58Z" fill="#E6EAF1"></path> + <path d="M53.17 157.18C53.4 158.17 54.65 158.86 55.8 158.63C57.05 158.38 57.59 157.4 57.26 155.97C56.92 154.53 56.07 153.93 54.77 154.23C53.45 154.53 52.83 155.7 53.18 157.18H53.17Z" fill="#E6EAF1"></path> + <path d="M40.9 166.22C40.46 166.67 40.29 167.24 40.73 167.85C40.94 168.15 41.11 168.5 41.22 168.84C41.55 169.85 42.1 170.31 43.09 170.31C44.03 170.31 44.49 169.72 44.16 168.38C43.78 167.88 43.23 167 42.54 166.26C42.11 165.8 41.4 165.71 40.9 166.22Z" fill="#E6EAF1"></path> + <path d="M42.42 147.88C41.77 148.04 41.13 149.26 41.29 150.03C41.42 150.67 42.29 151.29 42.86 151.16C44.17 150.87 45.02 150 44.81 149.17C44.62 148.4 43.26 147.67 42.42 147.88Z" fill="#E6EAF1"></path> + <path d="M45.94 139.97C45.19 140.12 44.17 141.52 44.32 142.18C44.54 143.14 45.38 143.57 46.52 143.3C47.38 143.09 47.73 142.29 47.44 141.17C47.22 140.31 46.62 139.83 45.94 139.97V139.97Z" fill="#E6EAF1"></path> + <path d="M33.65 153.35C32.81 153.59 31.99 154.79 32.17 155.5C32.33 156.12 33.67 156.59 34.62 156.35C35.25 156.19 35.73 155.26 35.5 154.62C35.19 153.74 34.33 153.15 33.64 153.35H33.65Z" fill="#E6EAF1"></path> + <path d="M39.79 196.44C39.67 195.6 38.58 194.78 37.72 194.9C37.04 194.99 36.5 195.74 36.6 196.46H39.79C39.79 196.46 39.79 196.45 39.79 196.44Z" fill="#E6EAF1"></path> + <path d="M43.71 185.57C44.24 185.4 44.95 184.02 44.83 183.38C44.7 182.69 44.08 182.43 43.12 182.67C42.05 182.94 41.64 183.43 41.83 184.2C42.09 185.25 42.89 185.82 43.71 185.57Z" fill="#E6EAF1"></path> + <path d="M55.54 147.02C54.92 147.15 54.59 147.71 54.72 148.41C54.88 149.26 55.69 149.9 56.48 149.79C57.2 149.69 57.76 148.94 57.63 148.26C57.49 147.53 56.34 146.86 55.54 147.03V147.02Z" fill="#E6EAF1"></path> + <path d="M49.83 157.98C49.23 158.17 48.99 158.71 49.19 159.44C49.49 160.54 50 161.09 50.62 160.96C51.33 160.82 52.03 159.65 51.88 158.87C51.75 158.25 50.6 157.74 49.84 157.97L49.83 157.98Z" fill="#E6EAF1"></path> + <path d="M46.87 155.84C46.64 155.2 45.97 154.88 45.28 155.17C44.74 155.39 44.13 155.64 44.28 156.23C44.58 157.26 45.21 157.73 45.86 157.58C46.67 157.38 47.14 156.58 46.87 155.84V155.84Z" fill="#E6EAF1"></path> + <path d="M34.01 187.58C33.4 187.76 33.07 188.34 33.21 188.98C33.39 189.79 34.05 190.23 34.77 190.03C35.39 189.86 35.86 189.09 35.7 188.5C35.53 187.85 34.67 187.38 34.01 187.57V187.58Z" fill="#E6EAF1"></path> + <path d="M35.94 148.11C36.56 147.94 37.03 147.17 36.87 146.58C36.7 145.93 35.84 145.46 35.18 145.65C34.57 145.83 34.24 146.41 34.38 147.05C34.56 147.86 35.22 148.3 35.94 148.1V148.11Z" fill="#E6EAF1"></path> + <path d="M24.72 154.77C24.06 154.97 23.76 155.59 23.96 156.35C24.17 157.14 24.67 157.56 25.18 157.38C25.8 157.16 26.45 156.1 26.31 155.54C26.16 154.93 25.4 154.57 24.71 154.77H24.72Z" fill="#E6EAF1"></path> + <path d="M36.73 171.8C36.83 172.07 37.3 172.38 37.57 172.35C37.93 172.31 38.44 172.03 38.56 171.73C38.88 170.92 38.21 170.61 37.63 170.29C36.91 170.59 36.45 171.05 36.73 171.81V171.8Z" fill="#E6EAF1"></path> + <path d="M32.83 161.16C32.47 161.37 32.05 161.62 32.04 162.02C32.03 162.42 33.02 163.09 33.6 162.88C34.15 162.68 34.12 162.26 34.02 161.82C33.88 161.21 33.32 160.86 32.83 161.16V161.16Z" fill="#E6EAF1"></path> + <path d="M29.14 188.18C29.05 188.2 28.99 188.26 28.93 188.35C28.78 187.78 28.39 187.15 27.98 186.97C27.42 186.72 26.53 187.03 26.27 187.56C25.72 188.71 25.83 189.71 26.54 190.05C27.11 190.33 28.16 189.98 28.68 189.42C28.68 189.62 28.68 189.8 28.71 189.92C28.79 190.45 29.25 190.69 29.83 190.45C30.34 190.24 30.76 189.89 30.49 189.36C30.29 188.96 29.6 188.07 29.12 188.18H29.14Z" fill="#E6EAF1"></path> + <path d="M36.5 182.56C36.17 182.67 35.89 183.68 36.01 183.83C36.26 184.15 36.89 184.62 37.18 184.45C37.46 184.28 37.71 183.67 37.63 183.37C37.56 183.09 36.83 182.45 36.5 182.56Z" fill="#E6EAF1"></path> + <path d="M13.55 171.81C13.27 171.83 12.88 172.41 12.89 172.71C12.89 172.98 13.46 173.76 13.79 173.7C14.12 173.64 14.44 172.81 14.36 172.6C14.24 172.28 13.83 171.79 13.55 171.81V171.81Z" fill="#E6EAF1"></path> + <path d="M25.89 140C26.14 139.95 26.31 139.74 26.43 139.48H24.7C24.97 139.8 25.45 140.1 25.89 140Z" fill="#E6EAF1"></path> + <path d="M20.18 157.98C20.18 157.79 19.7 157.25 19.49 157.29C19.28 157.34 19.11 157.97 19.12 158.23C19.12 158.37 19.56 158.66 19.66 158.61C19.89 158.49 20.17 158.2 20.18 157.98V157.98Z" fill="#E6EAF1"></path> + <path d="M25.58 158.97C25.33 159.06 24.83 159.28 24.93 159.56C25.03 159.85 25.42 160.06 25.65 160.04C25.87 160.02 26.49 159.62 26.38 159.33C26.27 159.04 25.75 158.91 25.58 158.97V158.97Z" fill="#E6EAF1"></path> + <path d="M22.57 147.55C22.44 147.2 21.89 147.07 21.68 147.12C21.48 147.17 21.22 147.57 21.24 147.79C21.26 147.97 21.67 148.28 21.86 148.25C22.08 148.22 22.69 147.9 22.56 147.55H22.57Z" fill="#E6EAF1"></path> + <path d="M21.8 155.14C21.68 155.17 21.59 155.47 21.62 155.56C21.66 155.67 21.82 155.84 21.98 155.8C22.14 155.76 22.33 155.57 22.26 155.35C22.19 155.13 21.92 155.1 21.8 155.13V155.14Z" fill="#E6EAF1"></path> + <path d="M26.95 175.11C27.18 174.99 27.46 174.7 27.47 174.48C27.47 174.29 27.29 173.75 26.78 173.79C26.28 173.83 26.4 174.47 26.41 174.73C26.41 174.87 26.85 175.16 26.95 175.11V175.11Z" fill="#E6EAF1"></path> + <path d="M59.29 155.76V151.66C58.64 152.73 58.67 154.87 59.29 155.76Z" fill="#E6EAF1"></path> + <path d="M48.43 143.8C47.82 143.99 47.4 144.74 47.55 145.35C47.7 145.94 48.52 146.35 49.13 146.14C49.75 145.93 50.05 145.23 49.82 144.52C49.61 143.87 49.07 143.59 48.42 143.79L48.43 143.8Z" fill="#E6EAF1"></path> + <path d="M327.94 277.68H376.26V232.42H327.94V277.68Z" fill="#F6947E"></path> + <path d="M327.81 277.68C340.308 277.68 350.44 267.548 350.44 255.05C350.44 242.552 340.308 232.42 327.81 232.42C315.312 232.42 305.18 242.552 305.18 255.05C305.18 267.548 315.312 277.68 327.81 277.68Z" fill="#F6947E"></path> + <path d="M376.25 277.68C388.748 277.68 398.88 267.548 398.88 255.05C398.88 242.552 388.748 232.42 376.25 232.42C363.752 232.42 353.62 242.552 353.62 255.05C353.62 267.548 363.752 277.68 376.25 277.68Z" fill="#F6947E"></path> + <path d="M319.87 243.12C319.99 242.02 319.13 240.85 318.15 240.77C318.13 240.77 318.12 240.77 318.11 240.77C318.07 241.4 317.84 241.66 317.55 241.67C317.24 241.67 317.5 242.19 317.76 242.27C318.02 242.35 318.53 242.7 318.17 243.53C317.82 244.36 316.91 243.98 316.32 243.71C316.07 243.59 315.89 243.48 315.75 243.34C315.93 244.1 316.58 244.62 317.54 244.73C318.87 244.87 319.76 244.27 319.88 243.14L319.87 243.12Z" fill="#F37450"></path> + <path d="M345.64 261.58C345.7 260.61 344.98 259.75 344.03 259.62C342.81 259.46 341.77 260.25 341.66 261.42C341.56 262.45 342.1 263.25 342.98 263.36C344.13 263.5 345.58 262.53 345.64 261.58V261.58Z" fill="#F37450"></path> + <path d="M318.29 263.59C318.04 264.18 317.57 264.64 317.02 264.73C316.5 264.81 315.75 264.46 315.17 263.98C315.28 264.75 315.82 265.48 316.43 265.52C317.29 265.59 318.24 264.88 318.38 264.07C318.41 263.92 318.38 263.76 318.3 263.59H318.29Z" fill="#F37450"></path> + <path d="M331.03 240.21C330.45 240.18 329.8 240.79 329.78 241.37C329.76 241.91 330.1 242.37 330.56 242.51C330.64 242.26 330.83 242.04 331.17 241.94C331.44 241.92 331.65 241.99 331.81 242.11C331.96 241.94 332.07 241.74 332.09 241.5C332.15 240.88 331.62 240.22 331.03 240.2V240.21Z" fill="#F37450"></path> + <path d="M340.57 251.49C340.66 250.92 340.2 250.36 339.58 250.28C338.92 250.2 338.34 250.57 338.25 251.12C338.16 251.72 338.56 252.32 339.13 252.43C339.74 252.55 340.47 252.06 340.56 251.48L340.57 251.49Z" fill="#F37450"></path> + <path d="M343.6 252.61C343.05 252.97 343.1 253.48 343.67 254.56C344.3 254.51 345.06 254.68 345.28 253.78C345.42 253.21 345.19 252.68 344.63 252.47C344.33 252.36 343.86 252.42 343.59 252.6L343.6 252.61Z" fill="#F37450"></path> + <path d="M335.13 265.08C335.39 264.46 334.33 263.38 333.87 263.55C333.41 263.72 333.17 265.24 333.76 265.53C334.21 265.75 334.95 265.51 335.13 265.08V265.08Z" fill="#F37450"></path> + <path d="M327.5 271.26C328.29 271.43 328.87 271.26 328.83 270.25C328.79 269.23 327.29 269.11 326.99 269.51C326.69 269.91 326.95 271.14 327.51 271.27L327.5 271.26Z" fill="#F37450"></path> + <path d="M337.41 271.43C338.07 271.48 338.16 270.71 338.16 270.45C338.16 270.17 337.86 269.75 337.59 269.64C337.1 269.44 336.67 269.84 336.65 270.26C336.63 270.57 336.75 271.38 337.4 271.43H337.41Z" fill="#F37450"></path> + <path d="M331.47 260.99C331.35 261.17 331.3 261.55 331.47 261.75C331.64 261.95 332.07 261.8 332.24 261.67C332.37 261.56 332.53 261.01 332.31 260.78C332.09 260.55 331.57 260.84 331.48 260.99H331.47Z" fill="#F37450"></path> + <path d="M324.27 276.98C324.48 276.97 324.82 276.71 324.84 276.52C324.86 276.34 324.79 275.83 324.32 275.81C323.85 275.79 323.8 276.29 323.79 276.5C323.78 276.66 324.11 276.99 324.27 276.98V276.98Z" fill="#F37450"></path> + <path d="M311.95 251.23C312.08 250.85 312.29 250.5 312.61 250.22C312.6 249.8 312.54 249.43 312.47 249.29C312.47 249.29 312.47 249.29 312.46 249.29C312.06 249.29 311.65 249.03 311.35 248.92C311.27 248.2 311.75 247.61 312.25 247.56C312.34 247.56 312.4 247.57 312.47 247.59C312.84 247.34 313.21 247.1 313.27 246.64C313.35 245.95 313.61 244.39 312.69 243.82C311.82 243.28 311.51 244.17 310.92 244.36C310.33 244.55 309.77 245.18 309.93 245.97C310.09 246.76 310.63 247.44 310.56 247.85C310.49 248.26 310.26 248.69 309.66 248.52C309.14 248.37 308.38 248.69 308.01 249.62C308.99 249.7 310.11 250.87 310.1 251.74C310.1 251.78 310.09 251.83 310.08 251.87C310.52 251.54 310.59 251.2 310.84 251.29C311.09 251.38 311.46 251.76 311.87 251.79C311.87 251.61 311.9 251.44 311.96 251.26L311.95 251.23Z" fill="#F37450"></path> + <path d="M339.66 244.04C339.05 244 338.55 244.47 338.51 245.12C338.22 244.98 337.86 244.91 337.43 244.95C336.88 245 336.41 245.03 335.92 244.69C335.2 244.19 334.4 244.47 333.68 244.74C333.01 244.99 332.58 245.92 332.64 246.68C332.64 246.75 332.66 246.82 332.67 246.89C332.35 246.52 331.91 246.23 331.46 246.19C330.97 246.15 330.56 246.45 330.31 246.97C330.52 246.99 330.73 247.01 330.93 247.07C331.56 247.26 332.09 247.65 332.13 248.39C332.15 248.74 332.08 249.04 331.94 249.31C332.51 249.06 333.02 248.58 333.1 248.1C333.12 248 333.11 247.89 333.1 247.77C333.3 247.97 333.57 248.12 333.92 248.23C334.78 248.5 335.54 248.31 336.33 248.02C336.61 247.92 336.96 247.87 337.23 247.94C338.36 248.24 339.06 247.8 339.24 246.64C339.37 246.72 339.5 246.78 339.64 246.78C340.14 246.79 340.63 246.22 340.7 245.55C340.77 244.75 340.31 244.06 339.66 244.02V244.04Z" fill="#F37450"></path> + <path d="M317.03 239.28C317.1 239.29 317.14 239.32 317.2 239.33C317.41 239.18 317.63 239.03 317.84 238.86C318.34 238.47 318.87 238.11 318.76 237.32C318.73 237.14 318.87 236.88 319.01 236.73C320.08 235.58 320.11 235.14 319.08 234.15C317.5 234.81 316.01 235.65 314.64 236.64C314.59 236.99 314.61 237.38 314.73 237.78C314.82 238.08 314.84 238.4 314.85 238.49C314.49 239.27 314.7 239.7 315.11 240.02C315.22 240.1 315.33 240.15 315.43 240.18C315.75 239.58 316.39 239.18 317.03 239.28Z" fill="#F37450"></path> + <path d="M332.66 256.12C332.61 255.3 331.54 254.48 330.7 254.44C330.19 254.42 329.78 254.59 329.68 255.07C329.56 255.64 329.46 256.22 329.44 256.79C329.63 256.68 329.83 256.59 330.03 256.56C331.09 256.4 331.69 256.73 331.8 257.55C331.92 258.38 331.3 259.32 330.56 259.45C330.52 259.45 330.48 259.45 330.45 259.45C331.37 259.95 332.31 259.53 332.54 258.44C332.7 257.69 332.72 256.88 332.67 256.11L332.66 256.12Z" fill="#F37450"></path> + <path d="M307.14 248.36C306.84 248.31 306.52 248.14 306.32 247.93C306.22 248.22 306.14 248.51 306.05 248.8C306.47 248.76 306.87 248.6 307.14 248.36Z" fill="#F37450"></path> + <path d="M326.95 252.71C327.03 251.79 326.58 251.11 325.89 251.08C325.41 251.06 324.87 251.31 324.46 251.66C325.36 251.71 326.23 252.34 326.31 253.07C326.34 253.38 326.27 253.7 326.12 254C326.59 253.8 326.89 253.38 326.95 252.71V252.71Z" fill="#F37450"></path> + <path d="M342.74 239.82C342.8 239.02 341.83 237.96 340.93 237.84C340.18 237.74 339.62 238.24 339.5 239.11C339.35 240.15 339.83 240.74 340.92 240.86C341.83 240.96 342.69 240.47 342.74 239.82V239.82Z" fill="#F37450"></path> + <path d="M307.12 261.13C306.93 261.22 306.81 261.47 306.64 261.77C306.83 262.04 307.08 262.22 307.38 262.25C308.05 262.32 309.03 261.48 309.13 260.74C309.2 260.21 308.55 259.45 307.91 259.23C308.15 260.08 307.99 260.71 307.12 261.13V261.13Z" fill="#F37450"></path> + <path d="M346.2 248.85C346.33 248.09 345.97 247.51 345.33 247.44C344.66 247.37 343.46 248.06 343.35 248.59C343.19 249.4 343.77 250.13 344.73 250.31C345.42 250.44 346.04 249.83 346.2 248.85Z" fill="#F37450"></path> + <path d="M328.35 242.6C328.95 242.7 329.4 242.37 329.48 241.78C329.63 240.61 329.24 239.78 328.48 239.67C327.89 239.59 326.82 240.38 326.75 240.95C326.67 241.54 327.58 242.47 328.36 242.6H328.35Z" fill="#F37450"></path> + <path d="M309.39 241.91C309.31 242.03 309.22 242.14 309.14 242.26C309.25 242.17 309.34 242.05 309.39 241.91Z" fill="#F37450"></path> + <path d="M337.32 253.44C337.56 253.23 337.65 252.59 337.5 252.28C337.14 251.5 336.01 251.48 335.54 251.93C335.07 252.38 335.15 253.41 336.03 253.75C336.38 253.89 337.02 253.71 337.32 253.45V253.44Z" fill="#F37450"></path> + <path d="M306.5 253.99C305.87 253.9 305.41 254.21 305.31 254.79C305.2 255.42 305.61 256 306.2 256.06C306.79 256.12 307.41 255.63 307.45 255.08C307.49 254.53 307.08 254.07 306.49 253.98L306.5 253.99Z" fill="#F37450"></path> + <path d="M326.28 259.85C326.34 259.32 325.92 258.82 325.36 258.75C324.84 258.69 324.35 259.06 324.43 259.59C324.49 259.98 324.68 260.41 324.96 260.56C325.23 260.71 326.23 260.34 326.29 259.85H326.28Z" fill="#F37450"></path> + <path d="M327.2 263.02C327.33 262.21 327.01 261.63 326.57 261.72C326.17 261.8 325.69 262.09 325.49 262.43C325.27 262.81 325.87 263.51 326.39 263.46C326.72 263.43 327.03 263.12 327.21 263.02H327.2Z" fill="#F37450"></path> + <path d="M314.1 269.55C313.95 270.13 314.78 270.59 315.06 271.02C315.18 271 315.29 270.98 315.41 270.96C315.97 270.59 315.98 270.37 315.99 269.87C315.99 269.37 315.82 269.06 315.72 268.94C315.24 269.12 314.25 268.97 314.1 269.55V269.55Z" fill="#F37450"></path> + <path d="M347.23 243.41C347.2 243.49 347.17 243.58 347.17 243.67C347.17 244.11 347.43 244.25 347.75 244.32C347.58 244.01 347.41 243.71 347.23 243.41Z" fill="#F37450"></path> + <path d="M326.07 240.05C326.61 239.73 326.8 239.19 326.65 238.67C326.41 237.86 325.63 237.93 324.88 237.82C324.69 238.16 324.52 238.48 324.43 238.79C324.54 238.84 324.64 238.93 324.66 239.12C324.7 239.48 324.36 239.56 324.15 239.64C324.03 239.69 323.52 239.61 323.48 239.29C323.45 239.1 323.64 238.96 323.83 238.88C323.74 238.85 323.65 238.81 323.56 238.8C322.59 238.68 321.38 239.63 321.24 240.62C321.1 241.58 321.77 242.48 322.71 242.59C324.06 242.75 325.19 242.07 325.28 241.04C325.3 240.76 325.25 240.47 325.13 240.19C325.42 240.3 325.74 240.25 326.07 240.05V240.05Z" fill="#F37450"></path> + <path d="M317.17 251.38C317.25 251.42 317.32 251.45 317.4 251.47C318.21 251.65 319.38 250.81 319.46 249.97C319.52 249.41 318.79 248.74 317.97 248.61C317.15 248.48 316.35 248.94 316.27 249.59C316.25 249.72 316.27 249.86 316.28 250C316.47 250.22 316.64 250.49 316.79 250.84C316.88 251.04 317.01 251.22 317.16 251.37L317.17 251.38Z" fill="#F37450"></path> + <path d="M311.53 257.05C311.77 256.88 311.92 256.62 311.99 256.28C312.15 255.52 311.75 254.55 311.18 254.41C310.03 254.13 309.4 255.2 309.11 255.77C308.95 256.08 309.21 256.51 309.63 256.83C310.21 256.61 311.04 256.7 311.54 257.05H311.53Z" fill="#F37450"></path> + <path d="M314.65 246.5C314.58 246.98 315.04 247.39 315.37 247.63C315.74 247.9 316.29 247.44 316.39 246.96C316.53 246.32 316.17 245.97 315.73 245.97C315.37 245.97 314.73 246.01 314.66 246.5H314.65Z" fill="#F37450"></path> + <path d="M321.44 233.77C321.43 234.16 322.15 234.46 322.61 234.32C323.09 234.17 323.28 233.36 322.99 232.93C322.5 233.04 322.02 233.16 321.55 233.29C321.48 233.44 321.44 233.6 321.43 233.77H321.44Z" fill="#F37450"></path> + <path d="M312.7 263.78C312.67 263.43 312.53 262.49 312.03 262.51C311.53 262.53 311.06 263.32 311 263.68C310.92 264.19 311.33 264.56 311.91 264.61C312.51 264.66 312.72 264.21 312.69 263.78H312.7Z" fill="#F37450"></path> + <path d="M308.38 266.65C308.38 266.65 308.4 266.63 308.41 266.63C308.44 266 308.16 265.55 307.81 265.46C307.79 265.47 307.77 265.5 307.75 265.51C307.95 265.9 308.16 266.28 308.39 266.65H308.38Z" fill="#F37450"></path> + <path d="M336.13 258.42C336.12 258.32 336.12 258.23 336.12 258.13C335.78 258.39 335.53 259.1 335.72 259.73C335.96 260.55 337.09 260.37 337.44 260.11C337.57 260.01 337.53 259.72 337.41 259.37C336.86 259.42 336.2 258.93 336.14 258.41L336.13 258.42Z" fill="#F37450"></path> + <path d="M324.08 268.79C324.06 269.03 324.12 269.51 324.54 269.57C324.96 269.63 325.19 269.26 325.26 269.03C325.33 268.81 325.33 268.14 324.85 268C324.37 267.87 324.11 268.55 324.08 268.79Z" fill="#F37450"></path> + <path d="M316 267.92C316 267.92 316 267.91 316 267.9C316 267.9 316 267.9 315.99 267.91L316 267.92Z" fill="#F37450"></path> + <path d="M321.41 259.4C320.87 260.12 320.21 259.7 319.55 259.45C319.51 258.74 319.42 258.04 320.13 257.73C320.51 257.56 320.96 257.59 321.25 257.86C321.29 257.78 321.34 257.7 321.4 257.62C321.35 257.58 321.3 257.53 321.25 257.49C319.95 256.53 319.21 258.03 318.64 257.13C318.07 256.23 319.13 256.1 318.24 254.89C318.13 254.74 318.01 254.61 317.88 254.5C317.69 254.76 317.46 255.02 317.13 255.27C316.54 255.71 315.94 255.89 315.36 255.91C315.46 256.25 315.6 256.49 315.52 256.6C315.37 256.8 314.46 257.49 314.97 258.15C316.05 259.56 317.07 258.27 317.52 258.59C317.97 258.91 318.34 259.97 318.97 260.49C319.85 261.23 321.05 261.4 321.72 260.39C321.92 260.09 322.05 259.79 322.11 259.51C321.89 259.42 321.69 259.32 321.53 259.19C321.5 259.27 321.47 259.35 321.42 259.41L321.41 259.4Z" fill="#F37450"></path> + <path d="M329.43 233.45C329.42 233.55 329.43 233.64 329.43 233.73C329.1 233.2 328.56 232.76 328.01 232.67C327.4 232.57 326.71 233.22 326.59 234.03C326.44 234.99 326.97 235.65 328.04 235.83C328.81 235.96 329.7 235.48 329.76 234.88C329.76 234.8 329.76 234.71 329.76 234.62C330.11 235.14 330.72 235.53 331.4 235.59C331.66 235.61 331.9 235.59 332.12 235.52C331.7 236.28 331.73 237.66 332.23 238.28C332.72 238.9 333.89 239.08 334.79 238.57C335.39 238.23 335.85 237.85 336.63 238.26C337.19 238.55 337.61 238.07 337.84 237.5C337.5 236.72 336.96 236.5 336.33 236.83C335.81 236.15 335.5 235.59 335.04 235.19C334.6 234.81 333.67 234.76 332.97 234.94C333.23 234.6 333.38 234.15 333.4 233.58C333.4 233.41 333.4 233.25 333.4 233.1C332.2 232.8 330.96 232.59 329.69 232.49C329.57 232.77 329.48 233.08 329.44 233.44L329.43 233.45Z" fill="#F37450"></path> + <path d="M325.21 247.36C325.36 246.69 325.69 246.12 326.21 245.74C325.99 244.87 325.18 243.98 324.37 243.9C324.17 243.88 323.97 243.92 323.76 243.98C323.75 244.07 323.71 244.16 323.65 244.26C323.48 244.54 323.06 244.7 322.7 244.67C322.39 245 322.17 245.41 322.13 245.82C322.02 246.83 322.68 247.78 323.56 247.88C324.13 247.95 324.7 247.83 325.18 247.59C325.18 247.51 325.18 247.43 325.2 247.35L325.21 247.36Z" fill="#F37450"></path> + <path d="M327.69 265.85C327.94 266.99 329.02 267.63 330.16 267.31C331.03 267.07 331.63 266.02 331.43 265.11C331.22 264.18 330 263.64 328.78 263.92C327.92 264.12 327.49 264.89 327.69 265.85V265.85Z" fill="#F37450"></path> + <path d="M307.36 248.39C308.52 248.35 309.25 247.71 309.48 246.31C309.15 246.02 308.83 245.64 308.42 245.4C308.11 245.22 307.77 245.16 307.44 245.18C307.01 246.07 306.64 246.99 306.32 247.94C306.52 248.15 306.84 248.31 307.14 248.37C307.21 248.38 307.29 248.4 307.36 248.39Z" fill="#F37450"></path> + <path d="M323.47 239.29C323.51 239.61 324.02 239.69 324.14 239.64C324.35 239.56 324.7 239.48 324.65 239.12C324.63 238.93 324.53 238.83 324.42 238.79C324.32 238.75 324.22 238.75 324.16 238.76C324.08 238.78 323.94 238.82 323.82 238.88C323.62 238.97 323.44 239.1 323.47 239.29V239.29Z" fill="#F37450"></path> + <path d="M307.05 257.18C306.34 257.18 305.97 257.75 306.1 258.66C306.11 258.75 306.22 258.83 306.23 258.92C306.26 259.37 306.09 259.63 305.63 259.55C306.06 261.66 306.78 263.66 307.75 265.52C307.77 265.51 307.79 265.49 307.81 265.47C308 265.35 308.18 265.18 308.35 264.94C309.03 264.01 308.79 263.02 307.73 262.52C307.43 262.38 307.08 262.33 306.42 262.14C306.5 262.02 306.57 261.89 306.64 261.78C306.8 261.48 306.92 261.24 307.12 261.14C308 260.71 308.15 260.09 307.91 259.24C307.91 259.22 307.91 259.21 307.9 259.2C307.83 258.98 307.89 258.72 307.88 258.48C307.88 257.67 307.56 257.18 307.04 257.18H307.05Z" fill="#F37450"></path> + <path d="M330.93 247.07C330.73 247.01 330.52 246.99 330.31 246.97C330.04 246.95 329.76 246.95 329.47 246.92C329.35 246.72 329.24 246.5 329.1 246.31C328.57 245.59 327.53 245.14 326.8 245.42C326.58 245.5 326.38 245.61 326.2 245.74C325.68 246.12 325.35 246.69 325.2 247.36C325.18 247.43 325.18 247.51 325.18 247.6C325.19 247.85 325.28 248.13 325.42 248.31C326.14 249.27 327.19 249.44 328.23 248.85C328.44 248.73 328.64 248.61 328.86 248.48C329.09 248.89 329.28 249.29 329.53 249.64C330 250.32 330.42 250.42 331.15 250.05C331.51 249.87 331.77 249.61 331.93 249.3C332.07 249.03 332.14 248.73 332.12 248.38C332.08 247.65 331.55 247.25 330.92 247.06L330.93 247.07Z" fill="#F37450"></path> + <path d="M329.1 274.19C328.95 276.25 330 276.82 331.98 275.89C332.09 275.97 332.22 276.04 332.32 276.14C332.73 276.6 333.17 276.51 333.65 276.27C334.11 276.03 334.21 275.67 334.2 275.18C334.18 273.99 333.78 273.61 332.58 273.71C331.68 273.79 330.77 273.82 329.89 273.88C329.65 272.24 329.49 272.14 328.16 272.64C327.92 273.47 328.3 273.94 329.11 274.2L329.1 274.19Z" fill="#F37450"></path> + <path d="M322.19 267.36C323.08 267.13 323.79 265.71 323.58 264.56C323.41 263.58 322.43 263.01 321.34 263.24C319.9 263.55 319.34 264.37 319.59 265.78C319.78 266.86 321.06 267.63 322.19 267.35V267.36Z" fill="#F37450"></path> + <path d="M318.29 263.59C318.46 263.19 318.53 262.75 318.44 262.32C318.24 261.35 316.93 260.44 316.01 260.63C314.89 260.86 314.08 261.89 314.29 262.82C314.38 263.2 314.73 263.63 315.16 263.98C315.75 264.46 316.5 264.81 317.01 264.73C317.56 264.65 318.03 264.18 318.28 263.59H318.29Z" fill="#F37450"></path> + <path d="M324.46 251.66C324.32 251.66 324.18 251.66 324.04 251.68C323.35 251.78 322.92 252.5 323.03 253.35C323.14 254.22 324.07 255.16 324.72 255.08C325.3 255 325.83 254.55 326.11 254C326.26 253.71 326.33 253.39 326.3 253.07C326.22 252.33 325.36 251.71 324.45 251.66H324.46Z" fill="#F37450"></path> + <path d="M331.79 257.56C331.67 256.74 331.08 256.4 330.02 256.57C329.82 256.6 329.62 256.69 329.43 256.8C328.94 257.1 328.56 257.61 328.61 258.01C328.7 258.75 329.68 259.51 330.43 259.46C330.47 259.46 330.51 259.46 330.54 259.46C331.28 259.33 331.9 258.39 331.78 257.56H331.79Z" fill="#F37450"></path> + <path d="M320.04 272.83C320.96 272.61 321.69 271.69 321.54 270.96C321.42 270.38 319.93 269.73 319.2 269.94C318.69 270.08 318.21 270.91 318.32 271.46C318.51 272.41 319.27 273.02 320.04 272.83V272.83Z" fill="#F37450"></path> + <path d="M324.18 258.3C323.95 257.34 323.18 256.72 322.46 256.91C322 257.03 321.64 257.29 321.4 257.61C321.34 257.69 321.29 257.76 321.25 257.85C320.95 257.58 320.51 257.56 320.13 257.72C319.43 258.03 319.51 258.73 319.55 259.44C320.21 259.7 320.87 260.11 321.41 259.39C321.45 259.33 321.49 259.26 321.52 259.17C321.68 259.29 321.89 259.4 322.1 259.49C322.56 259.68 323.08 259.78 323.46 259.67C324.03 259.51 324.33 258.94 324.17 258.29L324.18 258.3Z" fill="#F37450"></path> + <path d="M309.64 266.92C309.32 266.99 309.08 267.22 308.94 267.54C309.47 268.34 310.05 269.1 310.68 269.83C311.19 269.51 311.7 268.73 311.63 268.3C311.5 267.56 310.35 266.76 309.65 266.92H309.64Z" fill="#F37450"></path> + <path d="M338.76 257.9C338.64 257.13 337.82 256.38 337.16 256.43C336.54 256.48 336.1 257.25 336.11 258.14C336.11 258.23 336.11 258.33 336.12 258.43C336.18 258.95 336.84 259.44 337.39 259.39C337.39 259.39 337.4 259.39 337.41 259.39C338.13 259.3 338.84 258.52 338.75 257.91L338.76 257.9Z" fill="#F37450"></path> + <path d="M317.29 269.46C317.87 269.34 318.36 268.69 318.26 268.19C318.15 267.68 317.3 266.98 316.88 267.06C316.54 267.12 316.19 267.5 316.02 267.9C316.02 267.9 316.02 267.91 316.02 267.92C315.94 268.12 315.89 268.33 315.92 268.51C316.03 269.19 316.62 269.6 317.3 269.46H317.29Z" fill="#F37450"></path> + <path d="M319.84 252.85C320.34 253.16 320.94 253.04 321.25 252.53C321.43 252.22 321.51 251.63 321.34 251.37C320.88 250.7 320.19 250.82 319.49 251.17C319.33 251.79 319.2 252.44 319.84 252.84V252.85Z" fill="#F37450"></path> + <path d="M337.6 268.03C338.07 267.75 338.27 267.25 338.03 266.76C337.88 266.46 337.52 266.1 337.22 266.06C336.36 265.96 336.05 266.58 335.89 267.45C336.44 267.88 336.87 268.46 337.6 268.03Z" fill="#F37450"></path> + <path d="M325.15 275.03C325.76 274.93 326.07 274.55 325.83 274.02C325.66 273.64 325.43 272.74 324.77 272.87C324.1 273 324.15 273.92 324.1 274.34C324.03 274.82 324.59 275.12 325.15 275.03V275.03Z" fill="#F37450"></path> + <path d="M311.34 248.92C311.64 249.03 312.05 249.29 312.45 249.29C312.45 249.29 312.45 249.29 312.46 249.29C312.96 249.28 313.17 248.84 313.07 248.36C312.99 248 312.84 247.66 312.45 247.59C312.38 247.58 312.32 247.56 312.23 247.56C311.73 247.61 311.25 248.19 311.33 248.92H311.34Z" fill="#F37450"></path> + <path d="M335.67 275.73C335.33 275.78 335.06 276.28 334.86 276.48C334.86 276.51 334.87 276.52 334.88 276.55C335.35 276.39 335.82 276.22 336.28 276.04C336.08 275.85 335.84 275.71 335.68 275.73H335.67Z" fill="#F37450"></path> + <path d="M323.77 243.99C323.83 243.65 323.53 243.35 322.72 242.91C321.84 243.15 321.95 244.28 322.38 244.57C322.47 244.63 322.59 244.67 322.71 244.68C323.06 244.71 323.49 244.55 323.66 244.27C323.72 244.17 323.75 244.08 323.77 243.99Z" fill="#F37450"></path> + <path d="M330.55 242.52C330.41 242.93 330.55 243.43 330.82 243.62C331.17 243.86 331.87 243.7 332.1 243.32C332.3 242.98 332.19 242.41 331.8 242.13C331.63 242.01 331.42 241.93 331.16 241.96C330.82 242.05 330.63 242.27 330.55 242.53V242.52Z" fill="#F37450"></path> + <path d="M309.95 243.73C310.28 243.71 310.43 243.56 310.39 243.23C310.39 242.9 310.21 242.77 309.89 242.79C309.59 242.81 309.45 242.95 309.46 243.26C309.48 243.57 309.61 243.74 309.95 243.72V243.73Z" fill="#F37450"></path> + <path d="M317.13 255.26C317.45 255.02 317.68 254.76 317.88 254.49C318.23 254.01 318.39 253.51 318.38 252.99C318.36 252.27 317.67 251.91 317.17 251.37C317.02 251.21 316.89 251.04 316.8 250.84C316.65 250.49 316.47 250.22 316.29 250C315.32 248.86 313.95 249.27 312.86 250C312.77 250.06 312.69 250.13 312.61 250.21C312.29 250.5 312.08 250.84 311.95 251.22C311.89 251.39 311.87 251.57 311.86 251.75C311.84 252.23 312 252.72 312.29 253.22C312.69 253.91 312.47 254.71 313.12 255.18C313.65 255.57 314.47 255.92 315.37 255.89C315.95 255.87 316.56 255.69 317.14 255.25L317.13 255.26Z" fill="#F37450"></path> + <path d="M309.52 259.91C310.48 260.58 311.36 260.47 312.01 260.01C312.67 259.55 312.43 258.26 311.8 257.32C311.73 257.22 311.64 257.14 311.53 257.06C311.04 256.71 310.2 256.62 309.62 256.84C309.47 256.9 309.32 256.97 309.22 257.08C308.64 257.66 308.56 259.24 309.52 259.92V259.91Z" fill="#F37450"></path> + <path d="M307.99 249.6C307.92 249.6 307.86 249.58 307.79 249.58C306.49 249.67 306.05 250.63 305.92 251.42C305.79 252.2 306.26 253.69 307.75 253.61C309.17 253.53 309.98 252.73 310.06 251.85C310.06 251.81 310.08 251.76 310.08 251.72C310.08 250.85 308.97 249.69 307.99 249.6Z" fill="#F37450"></path> + <path d="M312.63 238.56C313.1 238.36 313.33 237.95 313.43 237.57C313 237.92 312.59 238.3 312.19 238.68C312.34 238.66 312.49 238.62 312.63 238.56Z" fill="#F37450"></path> + <path d="M318.17 243.53C318.52 242.7 318.02 242.36 317.76 242.27C317.5 242.18 317.24 241.68 317.55 241.67C317.83 241.67 318.07 241.41 318.11 240.77C318.11 240.71 318.13 240.67 318.13 240.6C318.13 239.89 317.86 239.48 317.22 239.32C317.16 239.31 317.12 239.28 317.05 239.27C316.41 239.17 315.77 239.57 315.45 240.17C315.34 240.37 315.27 240.59 315.25 240.82C315.15 241.76 315.67 241.96 315.55 242.56C315.48 242.91 315.57 243.13 315.76 243.32C315.9 243.46 316.08 243.58 316.33 243.69C316.92 243.96 317.83 244.34 318.18 243.51L318.17 243.53Z" fill="#F37450"></path> + <path d="M477.89 245.09L477.58 245.63C477.69 245.61 477.8 245.58 477.91 245.59C477.89 245.44 477.89 245.27 477.9 245.09H477.89Z" fill="#42A4DC"></path> + <path d="M499 243.47C499 243.47 499.05 243.43 499.08 243.42C499.05 243.42 499.03 243.42 499 243.42C499 243.44 499 243.46 499 243.48V243.47Z" fill="#42A4DC"></path> + <path d="M567.6 234.03H546.63C546.38 234.14 546.09 234.15 545.82 234.03H538.84C538.52 234.11 538.19 234.12 537.9 234.03H527.59C527.58 234.09 527.59 234.15 527.56 234.21C527.32 234.82 526.58 235.09 525.98 234.81C525.73 234.69 525.48 234.36 525.33 234.04H519.82C519.77 234.18 519.69 234.32 519.56 234.46C519.33 234.7 518.76 234.77 518.39 234.7C518 234.62 517.77 234.36 517.67 234.04H516.65C517.23 234.64 517.55 235.78 517.27 236.62C516.99 237.46 516.1 237.83 515.11 237.52C513.98 237.18 513.41 236 513.82 234.84C513.93 234.52 514.13 234.24 514.39 234.04H513.62C513.69 234.25 513.73 234.49 513.74 234.69C513.77 235.24 513.33 235.56 512.8 235.6C511.86 235.67 511.6 234.98 511.33 234.12C511.36 234.1 511.39 234.07 511.42 234.05H509.84C509.89 234.72 509.66 234.86 508.78 235.2C507.96 235.52 507.25 235.16 506.53 234.94C506.24 234.85 506.08 234.45 506.06 234.05H503.83C503.89 234.07 503.96 234.09 504.02 234.12C505 234.6 505.23 235.16 504.8 235.97C504.34 236.85 503.39 237.32 502.78 236.96C502.33 236.69 501.93 235.22 502.17 234.69C502.31 234.38 502.58 234.16 502.9 234.05H498.45C498.42 234.17 498.37 234.28 498.3 234.39C498.13 234.67 497.86 234.89 497.6 235.18C497.09 234.91 496.63 234.67 496.17 234.43L496.23 234.46C496.26 234.33 496.27 234.19 496.29 234.05H494.85C494.85 234.05 494.84 234.11 494.83 234.14C494.49 235.18 493.82 235.54 492.83 235.18C492.21 234.96 491.85 234.54 491.81 234.05H491.75C491.61 234.06 491.46 234.05 491.33 234.05H489.81C489.75 234.15 489.68 234.24 489.6 234.32C489.65 234.58 489.64 234.83 489.55 235.01C489.18 235.78 488.5 235.91 487.41 235.41C486.79 235.13 486.55 234.59 486.78 234.04H484.79C484.62 234.12 484.42 234.19 484.17 234.26L483.69 235.09C483.81 235.42 483.87 235.78 483.82 236.17C483.72 237.06 483.41 237.95 482.75 238.42C483.03 238.6 483.21 238.86 483.16 239.29C483.12 239.66 482.66 240.07 482.28 240.28C481.79 240.56 481.34 240.28 481.08 239.8C481.06 239.75 481.05 239.71 481.03 239.67L480.33 240.88C480.36 240.99 480.37 241.12 480.31 241.29C480.24 241.48 480.05 241.63 479.83 241.75L479.38 242.53C479.71 242.44 480.07 242.46 480.42 242.6C480.78 242.75 481.12 243.12 481.38 243.54C481.64 243.41 481.94 243.39 482.25 243.54C482.75 243.78 482.95 244.47 482.57 244.88C482.33 245.13 482.08 245.33 481.73 245.36C481.38 246.12 480.21 246.79 479.32 246.81C479.48 247.38 479.39 248.05 478.94 248.59C478.42 249.23 477.57 249.36 476.76 248.91C476.45 248.74 476.22 248.52 476.06 248.27L474.51 250.95C474.94 251.68 474.65 252.35 474.16 252.94C474.12 252.99 474.06 253.03 474.02 253.08C474.04 253.08 474.06 253.08 474.08 253.1C474.51 253.34 474.69 254.05 474.44 254.51C474.19 254.97 473.68 255.15 473.19 255.01C473.66 255.37 473.88 255.86 473.85 256.48C473.85 256.66 473.8 256.81 473.75 256.96L474.86 258.89C475.29 258.64 475.83 258.56 476.35 258.72C477.25 259 477.62 259.65 477.35 260.5C477.28 260.72 477.19 260.91 477.08 261.09C477.49 260.52 478.13 260.15 478.96 260.22C480.3 260.33 480.85 262.02 481.24 262.1C481.63 262.18 482.55 260.96 483.51 260.7C484.48 260.44 485.65 261.19 486.12 262.01C486.41 262.52 486.45 263.05 486.38 263.68C486.64 263.49 487.4 263.54 487.71 263.65C488.12 263.79 488.4 264.18 488.07 264.7C487.75 265.22 487.23 265.44 486.88 265.08C486.69 264.88 486.4 264.42 486.31 264.08C486.29 264.18 486.28 264.27 486.26 264.38C486.06 265.31 484.54 266.78 483.23 266.56C481.92 266.34 481.2 264.73 480.9 264.71C480.6 264.69 479.98 265.88 478.92 265.66C478.86 265.65 478.78 265.61 478.72 265.58L479.95 267.71C480.28 267.66 480.62 267.68 480.94 267.78C481.79 268.06 482.33 269.18 482.11 270.13C482.18 270.13 482.25 270.13 482.33 270.15C482.92 270.28 483.39 271.03 483.24 271.59C483.15 271.91 482.89 272.15 482.57 272.26L484.27 275.2H484.93C484.93 275.2 484.95 275.15 484.96 275.13C484.24 274.68 483.97 273.98 484.23 273.09C484.57 271.92 485.79 271.35 487.07 271.77C487.54 271.92 487.92 272.35 488.14 272.86C488.28 272.89 488.38 273.12 488.48 273.22C488.48 273.45 488.42 273.63 488.33 273.76C488.33 273.89 488.32 274.03 488.29 274.16C488.57 274.42 488.78 274.79 488.87 275.2H497.18C496.81 274.95 496.61 274.47 496.71 273.99C496.83 273.42 497.37 273.08 497.92 273.23C498.49 273.38 498.8 274.01 498.6 274.65C498.52 274.89 498.41 275.08 498.25 275.21H500.28C500.25 275.1 500.23 274.99 500.22 274.92C500.21 274.79 500.31 274.49 500.66 274.51C501.01 274.53 501.09 274.83 501.16 275.05C501.16 275.08 501.16 275.14 501.16 275.22H501.81C502.13 274.74 502.68 274.39 503.27 274.26C502.65 274.09 502 273.69 501.97 273.34C501.92 272.78 502.76 272.21 503.47 272.33C504.17 272.45 504.75 273.86 504.24 274.23C504.37 274.26 504.49 274.29 504.61 274.34C505.05 274.53 505.37 274.85 505.56 275.22H514.5C514.63 275.15 514.76 275.1 514.84 275.05C514.97 275.1 515.09 275.16 515.2 275.22H567.59L579.47 254.64L567.59 234.06L567.6 234.03ZM534.39 236.18C534.66 235.7 535.6 235.41 536.06 235.66C536.44 235.86 536.66 236.94 536.42 237.4C536.19 237.86 535.4 238.05 534.87 237.78C534.25 237.46 534.04 236.78 534.39 236.18ZM521.52 240.74C521.61 240.62 521.7 240.51 521.8 240.4C522.84 239.34 523.87 239.5 524.73 240.99C525.29 240.69 525.81 240.58 525.95 239.83C526.11 238.96 526.95 238.61 527.59 238.94C528.06 239.19 528.21 239.62 528.03 240.23C528.42 240.15 528.92 240.19 529.12 240.29C529.57 240.51 529.65 241.07 529.34 241.57C529.03 242.06 528.56 242.04 528.21 241.74C528.06 241.61 527.8 241.32 527.65 241.04C527.65 241.04 527.65 241.05 527.64 241.06C527.66 241.14 527.67 241.19 527.69 241.23C528.66 243.29 528.47 243.94 526.55 245.21C525.91 245.63 525.33 245.41 524.78 245.06C524.26 244.74 524.1 244.29 524.31 243.68C524.41 243.4 524.33 243.07 524.34 242.47C524.12 242.69 523.91 242.84 523.71 242.94C523.96 243.08 524.17 243.32 524.06 243.69C523.88 244.32 523.06 244.27 522.76 244.19C522.35 244.08 522.05 243.58 522.34 243.15C522.38 243.08 522.45 243.02 522.53 242.96C522.32 242.88 522.11 242.77 521.91 242.66C521.04 242.16 520.91 241.56 521.5 240.74H521.52ZM527.39 251.36C527.17 251.89 526.46 252.12 525.91 251.86C525.4 251.61 525.09 250.88 525.3 250.39C525.51 249.89 526.22 249.6 526.75 249.81C527.32 250.03 527.63 250.78 527.38 251.37L527.39 251.36ZM524.15 263.66C523.89 264.14 523.18 264.35 522.76 264.09C522.33 263.83 522.13 262.96 522.39 262.51C522.63 262.09 523.36 261.88 523.8 262.1C524.27 262.34 524.45 263.13 524.16 263.66H524.15ZM520.79 245.52C521.12 245.07 521.54 244.9 522.05 245.16C522.9 245.58 523 246.67 522.68 247.07C522.36 247.47 521.32 247.68 520.78 247.01C520.43 246.58 520.43 246.02 520.79 245.52V245.52ZM519.16 252.1C518.78 252.79 517.52 253.21 516.85 252.86C516.18 252.52 515.87 251.28 516.26 250.54C516.65 249.82 517.3 249.7 518.27 250.19C519.01 250.56 519.46 251.54 519.15 252.1H519.16ZM518.17 262.6C517.99 263.08 517.33 263.41 517 263.12C516.69 262.84 516.04 262.11 516.2 261.74C516.36 261.37 517.38 261.44 517.78 261.53C518.28 261.65 518.34 262.14 518.17 262.6V262.6ZM510.57 237.1C510.81 236.72 511.52 236.11 512.22 236.51C512.72 236.8 512.94 237.38 512.66 237.92C512.52 238.2 512.09 238.5 511.79 238.5C510.92 238.52 510.33 237.47 510.57 237.09V237.1ZM510.38 245.87C510.9 246.09 511.2 246.47 511.3 246.88C511.39 246.61 511.6 246.41 511.96 246.31C512.15 246.26 512.49 246.38 512.67 246.54C512.94 246.41 513.41 246.65 513.48 246.8C513.58 246.99 513.63 247.44 513.41 247.57C513.26 247.65 513.07 247.62 512.9 247.55C512.89 247.61 512.87 247.67 512.84 247.71C512.4 248.33 511.82 248 511.29 247.77C511.27 247.7 511.27 247.63 511.26 247.56C511.17 247.86 510.98 248.16 510.66 248.42C510.56 248.47 510.35 248.63 510.12 248.67C508.83 248.9 507.64 248.51 506.49 248C506.04 247.8 505.95 247.36 506.08 246.87C506.13 246.67 506.23 246.46 506.36 246.27C506.31 245.82 506.43 245.27 506.75 244.74C507.03 244.28 507.97 244.1 508.46 244.41C508.82 244.65 509.07 245.06 509.17 245.48C509.58 245.58 509.99 245.7 510.37 245.87H510.38ZM512.9 253.58C513.02 254.12 512.94 254.76 512.63 255.31C512.15 256.16 510.87 256.48 509.93 255.98C509.05 255.51 508.65 254.21 509.1 253.31C509.12 253.26 509.17 253.22 509.2 253.18C509.2 253.1 509.2 253.03 509.23 252.95C509.41 252.41 509.99 252.1 510.5 252.27C510.57 252.29 510.63 252.34 510.69 252.4C511.26 252.3 511.85 252.33 512.25 252.57C512.32 252.61 512.38 252.67 512.44 252.72C512.42 252.6 512.4 252.48 512.4 252.37C512.4 251.91 513.03 251.72 513.8 252.01C513.86 252.2 514.1 252.57 514.07 252.9C514.01 253.4 513.26 253.83 512.92 253.59L512.9 253.58ZM514.07 263.06C513.87 263.77 512.71 264.2 511.83 263.9C511.15 263.67 510.84 262.85 511.13 262.09C511.43 261.29 512.46 260.64 513.05 260.86C513.81 261.16 514.31 262.23 514.08 263.06H514.07ZM503.79 237.32C503.99 236.73 504.63 236.4 505.17 236.6C505.72 236.8 506.05 237.62 505.81 238.19C505.59 238.73 504.92 239 504.35 238.79C503.82 238.6 503.57 237.95 503.79 237.32ZM504.39 240.23C504.48 240.25 504.57 240.25 504.65 240.27C504.8 240.03 505.02 239.84 505.33 239.76C505.66 239.68 506.28 239.9 506.43 240.17C506.47 240.23 506.49 240.31 506.51 240.39C506.9 240.39 507.28 240.39 507.66 240.4C508.72 240.43 509.45 241.06 509.51 242.04C509.57 242.92 509.08 243.45 507.99 243.68C507.66 243.75 507.32 243.82 506.98 243.85C506.65 243.88 506.29 243.93 505.98 243.84C505.49 243.69 504.94 243.52 504.6 243.17C504.21 242.79 504.13 242.2 503.32 242.27C503.03 242.29 502.21 241.69 502.29 241.08C502.37 240.48 503.51 240.05 504.38 240.22L504.39 240.23ZM501.83 250.89C501.99 250.25 502.7 249.96 503.53 250.17C503.61 249.76 503.79 249.4 504.05 249.2C504.71 248.7 505.7 249.12 506.54 250.2C507.14 250.22 507.7 250.2 508.23 250.28C508.41 250.31 508.61 250.6 508.68 250.81C508.87 251.39 508.64 251.86 508.14 252.19C507.32 252.74 506.91 252.09 506.43 251.53C505.53 252.14 504.98 252.41 504.56 252.4C504.25 252.98 503.57 253.41 503.06 253.3C502.28 253.12 501.59 251.8 501.81 250.91L501.83 250.89ZM497.29 249.58C498.18 249.9 498.64 251.33 498.24 252.52C497.96 253.36 496.9 253.81 495.93 253.51C494.96 253.2 494.21 251.87 494.5 250.94C494.8 249.98 496.32 249.24 497.28 249.58H497.29ZM495.23 247.08C495.23 246.58 495.5 246.29 495.99 246.17C496.59 246.03 497.08 246.24 497.35 246.75C497.74 247.49 497.11 247.88 496.61 248.42C495.85 248.19 495.25 247.94 495.24 247.08H495.23ZM498.84 254.7C499.32 254.93 499.57 255.7 499.33 256.21C499.05 256.81 498.37 257 497.72 256.65C497.21 256.38 497.01 255.81 497.24 255.3C497.49 254.74 498.31 254.43 498.85 254.69L498.84 254.7ZM496.34 260.51C496.04 260.79 495.54 261.16 495.08 260.99C494.62 260.82 494.7 260.18 494.78 259.83C494.81 259.7 494.87 259.59 494.96 259.5C494.82 259.3 494.74 259.1 494.82 258.95C495.02 258.57 496.03 258.62 496.41 258.71C496.92 258.84 496.91 259.33 496.76 259.79C496.7 259.99 496.59 260.12 496.47 260.21C496.47 260.32 496.42 260.43 496.34 260.51ZM490.17 256.42C490.44 255.48 491.76 254.87 492.82 255.21C493.9 255.55 494.32 256.54 493.91 257.82C493.53 259.02 492.55 259.56 491.45 259.18C490.4 258.81 489.83 257.59 490.17 256.43V256.42ZM491.19 262.07C490.63 262.54 489.75 262.07 489.66 261.46C489.57 260.85 490.3 260.14 490.75 260.15C491.2 260.16 491.21 260.49 491.22 260.62C491.26 261.12 491.44 261.86 491.19 262.07V262.07ZM492.81 254.9C492.29 254.65 491.97 253.75 492.19 253.18C491.75 253.46 491.18 253.55 490.65 253.36C489.71 253.02 489.03 251.65 489.34 250.72C489.43 250.45 489.62 250.2 489.87 249.99C489.45 249.92 489.07 249.6 488.65 249.23C488.91 248.52 488.99 247.74 489.84 247.67C490.38 247.62 490.86 247.92 491.07 248.51C491.2 248.87 491.18 249.2 491.01 249.46C491.31 249.4 491.6 249.4 491.87 249.48C492.83 249.77 493.27 250.96 492.9 252.21C493.26 251.97 493.67 251.93 494.12 252.14C495 252.55 495.58 253.57 495.3 254.24C495.08 254.77 493.45 255.2 492.81 254.89V254.9ZM489.01 244.08C488.88 244.28 488.39 244.42 488.15 244.33C487.47 244.08 487.44 243.51 487.65 242.84C488.2 242.63 488.8 242.36 489.16 243.05C489.3 243.31 489.19 243.81 489.01 244.08ZM494.48 244.4C494.36 244.83 493.95 245.12 493.48 245.16C493.37 245.27 493.25 245.36 493.13 245.42C493.23 245.45 493.33 245.47 493.43 245.51C493.99 245.7 494.22 246.21 494.01 246.78C493.73 247.51 492.64 248.22 492.07 248.02C491.52 247.83 490.96 246.62 491.16 246.06C491.28 245.72 491.55 245.49 491.92 245.38C491.33 245.1 490.79 244.54 490.76 244.01C490.69 242.88 491.14 241.65 491.95 241.58C492.76 241.51 493.57 241.86 494.05 242.93C494.08 242.99 494.08 243.05 494.1 243.11C494.45 243.41 494.61 243.9 494.48 244.39V244.4ZM483.64 241.21C484.07 239.97 484.66 239.67 486.19 240.02C486.74 240.15 487.15 240.39 487.43 240.71C487.41 240.25 487.51 239.72 487.7 239.3C487.11 239.21 486.83 238.79 486.79 238.27C486.74 237.64 487.21 237.21 487.77 237.19C488.57 237.15 489.36 237.25 489.92 237.3C489.98 236.89 490.31 236.59 490.92 236.46C491.43 236.8 491.82 237.31 491.42 237.8C491.26 238 491.17 238.18 491.13 238.36C491.14 238.47 491.13 238.58 491.1 238.69C491.12 239.01 491.25 239.32 491.36 239.66C491.68 240.65 491.26 241.75 490.56 242.11C489.85 242.47 488.49 242.23 487.84 241.66C487.86 241.89 487.84 242.13 487.76 242.38C487.57 243.03 487.06 243.55 486.48 243.79C486.57 243.79 486.65 243.81 486.73 243.84C487.3 244.02 487.61 244.98 487.32 245.72C487.27 245.84 487.22 245.95 487.16 246.05C487.23 246.08 487.3 246.1 487.36 246.14C488.57 246.81 489.03 247.95 488.48 248.89C487.96 249.78 486.53 250.24 485.67 249.81C484.72 249.33 484.26 247.86 484.78 246.9C484.83 246.8 484.89 246.72 484.96 246.63C484.37 246.28 484.02 245.61 484.22 245.11C484.42 244.59 484.96 244.15 485.54 243.93C485.45 243.92 485.35 243.9 485.26 243.87C484.99 243.78 484.75 243.66 484.54 243.53C484.45 243.51 484.38 243.46 484.32 243.38C483.63 242.85 483.37 242.07 483.64 241.19V241.21ZM478.39 249.25C478.66 248.68 479.26 248.31 479.62 248.49C480.01 248.69 480.23 249.49 479.98 249.91C479.67 250.44 479.18 250.39 478.71 250.2C478.29 250.02 478.18 249.69 478.39 249.26V249.25ZM481.7 256.47C481.92 257.12 481.53 258.41 479.9 258.6C479.2 258.68 478.72 258.46 478.36 258.09C478.33 258.06 478.3 258.03 478.27 257.99C478.07 257.76 477.92 257.48 477.78 257.18C477.42 256.99 477.2 256.47 477.33 256.06C477.33 256.05 477.33 256.04 477.34 256.03C477.14 255.46 476.94 254.94 476.62 254.65C475.59 253.7 475.61 252.64 476.79 251.62C477.97 250.6 479.03 252.09 479.23 251.91C480.6 250.68 482.21 252.46 481.7 253.91C481.19 255.36 480.72 254.44 480.71 254.91C480.71 255.38 481.47 255.81 481.69 256.47H481.7ZM482.01 248.71C481.52 248.54 481.27 247.94 481.45 247.37C481.66 246.71 482.21 246.37 482.78 246.55C483.31 246.71 483.63 247.28 483.49 247.82C483.35 248.38 482.51 248.89 482 248.72L482.01 248.71ZM483.2 250.27C483.6 249.75 484.68 250.14 484.74 250.74C484.79 251.23 484.35 251.87 483.97 251.78C483.22 251.6 482.81 250.78 483.2 250.27V250.27ZM484.71 252.85C484.69 252.95 484.24 253.08 484.14 253C483.96 252.86 483.46 252.57 483.72 252.21C483.98 251.85 484.46 252.03 484.58 252.14C484.73 252.27 484.76 252.63 484.7 252.85H484.71ZM487.28 259.18C487.19 259.18 486.87 259.13 486.56 259.16C485.19 259.28 484.17 258.52 484.04 257.17C483.98 256.57 483.89 256.07 483.5 255.57C483.11 255.08 483.34 254.55 483.85 254.2C485.05 253.37 485.48 253.47 486.39 254.77C486.51 254.94 486.73 255.12 486.92 255.13C487.71 255.18 487.96 255.77 488.24 256.34C488.49 256.85 488.7 257.38 488.94 257.9C489.16 258.38 489.26 258.87 488.83 259.25C488.44 259.58 487.97 259.7 487.28 259.2V259.18ZM488.82 269.9C488.49 270.08 488.1 270.09 487.71 269.88C487.46 269.74 487.21 269.6 486.96 269.46C486.53 269.85 486.2 270.27 485.78 270.49C484.98 270.92 484.43 270.68 483.96 269.84C483.82 269.6 483.8 269.32 483.84 269.04C483.77 268.85 483.74 268.66 483.75 268.49C483.79 267.9 484.63 267.39 485.41 267.47C485.54 267.38 485.67 267.29 485.79 267.19C486.05 266.97 486.57 266.78 486.84 266.9C487.26 267.08 487.65 267.14 488.07 267.17C487.53 266.78 487.28 265.9 487.9 265.31C488.17 265.05 488.8 265.02 489.22 265.1C489.77 265.2 490 265.72 489.86 266.25C489.73 266.77 489.27 267.16 488.81 267.28C489.09 267.41 489.28 267.68 489.37 268.05C489.39 268.15 489.41 268.25 489.42 268.34C489.54 268.29 489.66 268.26 489.8 268.27C490.38 268.28 491.1 269.04 491.09 269.64C491.09 270.07 490.2 270.71 489.67 270.68C489.31 270.65 488.97 270.32 488.81 269.91L488.82 269.9ZM492.17 274.49C491.15 274.46 490.63 273.99 490.68 273.15C490.74 272.13 491.23 271.6 492.06 271.67C492.64 271.71 493.55 272.98 493.47 273.63C493.4 274.17 492.88 274.52 492.17 274.49ZM495.55 270.23C495.22 271.32 494.64 271.67 493.6 271.38C492.72 271.14 492.13 270.38 492.31 269.74C492.44 269.28 492.85 268.84 493.34 268.55C492.86 268.47 492.59 268.02 492.69 267.47C492.79 266.96 493.13 266.7 493.6 266.75C494.12 266.8 494.5 267.1 494.48 267.69C494.48 267.89 494.37 268.07 494.23 268.22C494.45 268.19 494.66 268.18 494.85 268.24C495.47 268.43 495.81 269.37 495.55 270.22V270.23ZM497.17 268.35C496 267.83 495.75 266.86 496.04 266.31C496.33 265.76 495.95 265.45 495.57 265.29C495.19 265.14 494.41 265.53 493.61 265.53C492.8 265.53 492.3 264.85 492.23 264.24C492.16 263.63 491.36 263.14 492.06 262.39C492.8 261.6 494.29 262.17 494.94 262.39C495.6 262.61 495.62 263.42 496.02 263.93C496.42 264.44 497.05 263.81 497.35 263.7C497.64 263.58 499.51 263.82 499.69 264.42C499.87 265.02 499.18 265.41 499 265.7C498.82 265.99 499.4 266.13 499.58 267.05C499.76 267.97 498.36 268.88 497.18 268.36L497.17 268.35ZM499.89 273.9C499.77 274.08 499.42 274.5 499.15 274.35C498.88 274.2 498.94 273.68 499.03 273.59C499.19 273.42 499.53 273.2 499.72 273.3C499.91 273.4 499.97 273.79 499.9 273.9H499.89ZM500.51 259.3C500.24 259.91 499.19 260.28 498.45 260.03C497.83 259.81 497.54 258.94 497.83 258.16C498.12 257.39 498.92 256.81 499.46 256.97C500.26 257.22 500.85 258.53 500.51 259.29V259.3ZM499.49 248.09C498.86 247.78 498.77 247.21 499.21 246.33C499.26 246.24 499.31 246.18 499.36 246.1C498.61 245.83 498.16 245.33 498.13 244.8C497.6 244.9 496.92 244.66 496.41 244.21C495.6 243.48 496.09 242.5 495.53 241.86C494.93 241.19 496.26 240.46 495.8 240.01C495.6 239.81 495.52 239.52 495.51 239.19C494.88 239.79 493.62 240.16 492.91 239.85C492.15 239.52 491.79 238.46 492.15 237.58C492.52 236.66 493.86 236.08 494.72 236.46C495.35 236.74 495.79 237.34 495.9 237.94C495.9 237.94 495.9 237.92 495.92 237.92C496.38 237.3 497.45 236.98 498.11 237.34C498.23 237.41 498.32 237.49 498.41 237.57C498.45 237.5 498.48 237.41 498.53 237.35C497.9 237.18 497.54 236.6 497.7 236.01C497.87 235.39 498.64 235.07 499.4 235.3C500.04 235.49 500.5 236.09 500.39 236.58C500.36 236.71 500.28 236.83 500.17 236.94C501.26 237.35 501.55 238.13 501.04 239.17C500.91 239.43 500.89 239.78 500.93 240.07C501.06 240.9 501.09 241.68 500.66 242.47C500.48 242.79 500.28 243.02 500.04 243.18C500.15 243.18 500.26 243.21 500.36 243.24C501.04 243.5 501.55 244.73 501.29 245.5C501.24 245.65 501.13 245.78 500.98 245.89C501.36 246.38 501.65 247.25 501.5 247.61C501.2 248.32 500.34 248.52 499.49 248.09V248.09ZM501.28 259.18C501.21 259.31 501 259.32 500.91 259.28C500.82 259.25 500.68 259.01 500.73 258.91C500.78 258.82 500.95 258.65 501.14 258.73C501.33 258.81 501.35 259.04 501.28 259.18ZM502.77 271.19C502.59 271.76 501.94 272.04 501.34 271.81C500.79 271.6 500.58 271.09 500.79 270.49C500.99 269.93 501.53 269.63 502.06 269.77C502.59 269.92 502.95 270.63 502.77 271.19V271.19ZM503.07 268.29C502.57 267.89 501.65 267.06 502.15 265.99C502.4 265.45 503.43 265.26 504.14 265.57C504.68 265.8 504.98 266.18 504.89 266.83C504.75 267.83 503.56 268.7 503.07 268.29V268.29ZM509.06 271.27C508.84 271.98 507.82 272.25 506.78 271.88C506.32 271.71 505.96 270.93 506.1 270.4C506.29 269.72 507.36 269.06 507.93 269.26C508.63 269.51 509.26 270.63 509.06 271.27ZM508.23 264.5C507.29 264.1 506.9 263.36 507.19 262.56C507.05 262.72 506.85 262.88 506.57 263.01C505.81 263.38 505.32 262.35 505.16 262.16C505 261.97 504.2 262.47 503.31 261.91C502.42 261.35 502.68 259.79 504.04 259.16C505.4 258.52 505.32 259.6 506.31 259.21C506.79 259.02 506.73 258.68 506.68 258.26C506.22 258.83 505.32 259.07 504.76 258.72C504.21 258.37 504.01 257.57 504.34 257.05C504.76 256.4 505.94 256.14 506.58 256.55C506.76 256.67 506.87 256.83 506.94 257.01C507.01 256.92 507.09 256.82 507.19 256.73C508.02 255.98 509.12 255.85 510.11 256.86C510.96 257.73 510.56 258.87 509.66 259.58C509.02 260.09 507.91 260.24 507.51 260.61C507.25 260.86 507.6 261.47 507.45 262.09C507.93 261.46 508.85 261.12 509.46 261.42C510.4 261.88 510.8 262.84 510.42 263.72C510.03 264.64 509.22 264.93 508.24 264.51L508.23 264.5ZM511.63 266.37C512.05 266.43 512.45 266.72 512.28 267.3C512.12 267.86 511.67 268.19 511.19 268.01C510.85 267.88 510.17 267.26 510.25 266.77C510.33 266.28 511.27 266.33 511.63 266.37ZM511.34 275.06C510.9 274.92 510.46 274.61 510.69 274.14C510.85 273.79 511.25 273.12 511.87 273.19C512.49 273.26 512.42 274.1 512.43 274.46C512.45 274.93 511.86 275.22 511.34 275.06ZM513.41 273.82C512.65 273.59 512.05 273.34 512.04 272.48C512.04 272.21 512.12 272.01 512.27 271.86C512.27 271.82 512.25 271.78 512.25 271.74C512.23 271.26 512.82 270.96 513.57 271.15C513.63 271.29 513.82 271.54 513.87 271.81C513.98 271.91 514.08 272.02 514.16 272.17C514.55 272.91 513.92 273.3 513.42 273.84L513.41 273.82ZM514.4 244.16C513.34 244.45 512.57 244.82 511.73 244.86C510.6 244.91 509.91 243.91 510.2 242.86C510.62 241.33 511.17 240.88 512.32 241.29C512.67 241.24 512.95 241.27 513.02 241.41C513.05 241.47 513.07 241.55 513.08 241.63C513.2 241.69 513.32 241.75 513.45 241.83C514.22 241.22 514.98 240.69 515.64 240.06C515.92 239.79 516.04 239.33 516.18 238.92C516.37 238.38 516.66 238.02 517.33 238.23C517.97 238.43 518.46 239.21 518.2 239.85C518.02 240.3 517.88 240.55 518.22 241.11C519.03 242.45 518.69 244.15 517.62 244.9C517.82 245.25 517.83 245.78 517.58 246.1C517.18 246.62 515.74 246.08 515.67 245.59C515.65 245.46 515.74 245.3 515.88 245.15C515.33 244.96 514.84 244.56 514.42 244.17L514.4 244.16ZM515.77 256.03C515.51 255.85 515.21 255.35 515.29 255.15C515.42 254.85 516.07 254.1 516.46 254.27C516.85 254.44 516.73 255.35 516.67 255.7C516.58 256.2 516.1 256.26 515.77 256.02V256.03ZM516.2 263.59C516.27 263.44 516.49 263.48 516.64 263.48C516.68 263.48 516.78 263.73 516.74 263.79C516.67 263.88 516.52 263.9 516.36 263.96C516.3 263.82 516.13 263.74 516.2 263.59V263.59ZM517.35 268.96C517.16 269.08 516.86 269.14 516.64 269.08C516.53 269.05 516.18 268.66 516.42 268.36C516.66 268.07 517.08 268.28 517.28 268.37C517.38 268.42 517.43 268.9 517.35 268.95V268.96ZM519.21 265.5C518.73 265.69 518.12 266.41 517.58 266.15C517.04 265.89 517.39 264.94 517.31 264.44C517.45 264.37 517.78 264.25 518.27 264.36C518.76 264.47 518.98 264.53 519.23 265.15C519.23 265.27 519.23 265.39 519.22 265.51L519.21 265.5ZM519.69 255.92C519.55 256.31 519.07 256.29 518.84 256.21C518.62 256.14 517.99 255.75 518.22 255.3C518.45 254.85 519.1 254.99 519.31 255.1C519.52 255.21 519.83 255.52 519.69 255.91V255.92ZM520.11 253.51C519.78 253.13 520.2 251.69 521.21 251.85C521.68 251.93 521.93 252.1 522.04 252.33C522.06 252.3 522.07 252.26 522.09 252.24C522.37 251.89 522.91 251.74 523.19 251.59C523.93 251.9 524.23 252.67 524.03 253.19C523.81 253.73 523.23 254 522.73 253.79C522.42 253.66 522.16 253.4 522.03 253.11C522 253.19 521.97 253.27 521.93 253.36C521.7 253.89 520.43 253.89 520.11 253.51V253.51ZM523.53 272.95C523.34 273.58 522.76 273.9 522.18 273.69C521.65 273.5 521.04 272.64 521.16 272.24C521.3 271.76 522.28 271.45 522.95 271.66C523.49 271.83 523.72 272.34 523.53 272.95V272.95ZM527.21 270.83C526.96 271.61 525.79 271.53 525.24 271.64C524.58 271.78 523.97 271.58 523.68 270.86C523.4 270.16 523.46 269.52 524.02 268.97C524.62 268.37 525.99 268.72 526.52 269.61C526.72 269.95 527.46 270.06 527.21 270.84V270.83ZM527.75 256.7C527.65 257.23 527.3 257.55 526.88 257.63C526.88 257.63 526.88 257.65 526.88 257.66C526.86 257.82 526.47 258.08 526.31 258.03C526.11 257.97 525.63 257.83 525.74 257.37C525.74 257.33 525.78 257.31 525.79 257.28C525.4 256.92 525.17 256.4 525.25 256.18C525.37 255.84 526.28 255.02 527.11 255.36C527.67 255.59 527.85 256.09 527.74 256.69L527.75 256.7ZM528.66 247.94C528.08 247.67 527.94 246.93 528.33 246.16C528.81 245.22 529.47 244.88 530.18 245.23C531.11 245.68 531.49 246.61 531.07 247.38C530.83 247.82 529.22 248.19 528.67 247.94H528.66ZM532.57 268.37C532.39 268.86 531.67 269 531.19 268.68C530.73 268.37 530.54 267.71 530.8 267.27C531.08 266.79 531.74 266.62 532.19 266.94C532.7 267.31 532.77 267.83 532.57 268.37ZM533.71 260.39C533.37 261.11 532.37 261.59 531.77 261.31C531.07 260.99 530.83 259.72 531.3 258.84C531.63 258.22 532.19 258.09 532.9 258.45C533.66 258.83 534.02 259.72 533.71 260.39V260.39ZM534.85 251.65C534.43 252.46 533.11 252.97 532.33 252.63C531.3 252.18 530.78 250.75 531.3 249.77C531.77 248.87 532.68 248.59 533.64 249.07C534.82 249.66 535.33 250.74 534.85 251.66V251.65ZM534.92 242.12C534.21 241.78 533.99 240.83 534.44 239.97C534.7 239.47 535.59 239.13 536.08 239.34C536.78 239.64 537.53 241.08 537.26 241.6C536.92 242.27 535.77 242.52 534.92 242.12V242.12ZM538.69 246.68C538.54 247.25 538.06 247.34 537.52 247.04C537.02 246.76 536.78 246.17 537.13 245.84C537.44 245.55 537.98 244.8 538.58 245.11C539.18 245.43 538.79 246.28 538.69 246.67V246.68ZM538.98 236.35C539.67 235.09 540.62 234.8 541.94 235.46C542.94 235.96 543.34 237.02 542.86 237.89C542.3 238.91 540.85 239.58 540.02 239.2C538.96 238.72 538.45 237.31 538.98 236.35V236.35ZM540.74 262.67C540.52 263.04 540.16 262.96 539.96 262.88C539.78 262.81 539.46 262.47 539.58 262.12C539.7 261.76 540.04 261.57 540.44 261.74C540.84 261.91 540.96 262.3 540.74 262.67ZM540.79 258.63C540.54 258.53 540.68 258.07 540.77 257.85C540.83 257.71 541.22 257.43 541.48 257.52C541.74 257.61 541.65 258.26 541.54 258.42C541.42 258.58 541.05 258.72 540.8 258.63H540.79ZM542.46 266.39C542.44 266.49 541.99 266.62 541.89 266.54C541.71 266.4 541.21 266.11 541.47 265.75C541.73 265.39 542.21 265.57 542.33 265.68C542.48 265.81 542.51 266.17 542.45 266.39H542.46ZM543.36 253.33C542.83 253.22 542.44 253.01 542.41 252.4C542.41 252.26 542.34 252.12 542.31 251.99C540.18 251.47 539.72 250.37 541.13 248.86C540.66 248.15 540.66 247.54 541.37 247.05C542.72 247.5 542.78 247.68 541.94 249.1C542.66 249.61 543.39 250.15 544.14 250.66C545.14 251.33 545.21 251.88 544.48 252.82C544.18 253.21 543.87 253.43 543.37 253.33H543.36ZM545.54 255.31C545.39 255.82 544.83 255.78 544.44 255.57C544.06 255.36 543.78 254.99 544.17 254.26C544.46 254.23 544.98 254.01 545.28 254.19C545.52 254.33 545.65 254.98 545.55 255.32L545.54 255.31ZM548.62 243.25C548.21 244.09 547.08 244.53 546.25 244.17C545.16 243.7 544.72 242.53 545.24 241.48C545.68 240.6 546.5 240.27 547.3 240.66C548.43 241.2 549.03 242.4 548.62 243.25ZM552.74 248.68C552.62 249.22 552.14 249.48 551.61 249.4C550.77 249.28 550.79 248.56 550.64 247.88C551.31 247.3 551.94 247.01 552.55 247.63C552.76 247.84 552.82 248.35 552.74 248.68ZM553.64 237.6C553.21 238.32 552.14 238.66 551.48 238.3C550.8 237.93 550.47 236.62 550.88 235.95C551.17 235.48 552.25 235.35 552.88 235.71C553.81 236.25 554.06 236.88 553.64 237.59V237.6ZM558.86 242.23C558.55 242.76 557.51 242.93 556.89 242.55C556.42 242.25 556.2 241.44 556.48 240.99C557.02 240.12 557.97 239.71 558.54 240.09C559.09 240.46 559.25 241.56 558.87 242.23H558.86Z" fill="#42A4DC"></path> + <path d="M472.64 254.69C472.57 254.62 472.53 254.54 472.49 254.45L472.41 254.6C472.41 254.6 472.49 254.61 472.53 254.63C472.57 254.65 472.6 254.67 472.64 254.69V254.69Z" fill="#42A4DC"></path> + <path d="M476.51 261.72L476.66 261.99C476.74 261.73 476.84 261.48 476.98 261.26C476.84 261.45 476.68 261.6 476.51 261.73V261.72Z" fill="#42A4DC"></path> + <path d="M491.73 234.03H491.31C491.45 234.03 491.59 234.04 491.73 234.03Z" fill="#308DCC"></path> + <path d="M547.3 240.66C546.5 240.28 545.68 240.6 545.24 241.48C544.72 242.52 545.16 243.7 546.25 244.17C547.08 244.53 548.21 244.09 548.62 243.25C549.04 242.4 548.43 241.2 547.3 240.66Z" fill="#308DCC"></path> + <path d="M495.29 254.24C495.57 253.57 494.99 252.54 494.11 252.14C493.66 251.93 493.25 251.97 492.89 252.21C493.26 250.96 492.82 249.77 491.86 249.48C491.59 249.4 491.3 249.4 491 249.46C491.17 249.2 491.18 248.87 491.06 248.51C490.85 247.92 490.37 247.62 489.83 247.67C488.98 247.74 488.9 248.52 488.64 249.23C489.06 249.6 489.44 249.92 489.86 249.99C489.61 250.2 489.42 250.45 489.33 250.72C489.02 251.64 489.7 253.02 490.64 253.36C491.18 253.55 491.74 253.46 492.18 253.18C491.96 253.75 492.28 254.65 492.8 254.9C493.44 255.2 495.07 254.78 495.29 254.25V254.24Z" fill="#308DCC"></path> + <path d="M531.05 247.39C531.47 246.62 531.09 245.7 530.16 245.24C529.46 244.9 528.8 245.24 528.31 246.17C527.92 246.94 528.06 247.68 528.64 247.95C529.19 248.2 530.8 247.82 531.04 247.39H531.05Z" fill="#308DCC"></path> + <path d="M487.4 235.4C488.48 235.9 489.16 235.77 489.54 235C489.63 234.82 489.63 234.57 489.59 234.31C489.67 234.23 489.74 234.14 489.8 234.04H486.77C486.55 234.58 486.79 235.12 487.4 235.41V235.4Z" fill="#308DCC"></path> + <path d="M525.98 234.8C526.58 235.09 527.31 234.8 527.56 234.2C527.58 234.15 527.58 234.08 527.59 234.02H525.34C525.49 234.35 525.73 234.67 525.99 234.79L525.98 234.8Z" fill="#308DCC"></path> + <path d="M484.28 234.03L484.15 234.25C484.4 234.18 484.6 234.11 484.77 234.03H484.28Z" fill="#308DCC"></path> + <path d="M497.33 246.75C497.06 246.24 496.57 246.04 495.97 246.17C495.48 246.28 495.21 246.57 495.21 247.08C495.21 247.93 495.82 248.19 496.58 248.42C497.08 247.88 497.72 247.5 497.32 246.75H497.33Z" fill="#308DCC"></path> + <path d="M513.85 271.8C513.8 271.54 513.61 271.28 513.55 271.14C512.81 270.95 512.21 271.26 512.23 271.73C512.23 271.77 512.24 271.81 512.25 271.85C512.1 272 512.02 272.21 512.02 272.47C512.02 273.32 512.63 273.58 513.39 273.81C513.89 273.27 514.53 272.89 514.13 272.14C514.05 271.99 513.95 271.88 513.84 271.78L513.85 271.8Z" fill="#308DCC"></path> + <path d="M523.79 262.11C523.35 261.88 522.62 262.1 522.38 262.52C522.12 262.97 522.33 263.84 522.75 264.1C523.18 264.36 523.88 264.15 524.14 263.67C524.43 263.14 524.25 262.36 523.78 262.11H523.79Z" fill="#308DCC"></path> + <path d="M478.71 250.2C479.18 250.4 479.66 250.44 479.98 249.91C480.23 249.49 480.01 248.7 479.62 248.49C479.26 248.31 478.67 248.68 478.39 249.25C478.18 249.68 478.29 250.02 478.71 250.19V250.2Z" fill="#308DCC"></path> + <path d="M516.4 268.37C516.16 268.66 516.52 269.06 516.62 269.09C516.84 269.15 517.14 269.09 517.33 268.97C517.41 268.92 517.36 268.43 517.26 268.39C517.06 268.3 516.64 268.09 516.4 268.38V268.37Z" fill="#308DCC"></path> + <path d="M521.92 242.66C522.12 242.78 522.33 242.88 522.54 242.96C522.46 243.02 522.39 243.08 522.35 243.15C522.06 243.59 522.36 244.09 522.77 244.19C523.07 244.27 523.88 244.32 524.07 243.69C524.18 243.32 523.97 243.08 523.72 242.94C523.92 242.84 524.13 242.7 524.35 242.47C524.35 243.07 524.41 243.41 524.32 243.68C524.11 244.29 524.26 244.74 524.79 245.06C525.35 245.4 525.93 245.63 526.56 245.21C528.48 243.94 528.66 243.29 527.7 241.23C527.68 241.19 527.67 241.14 527.65 241.06C527.65 241.06 527.65 241.05 527.66 241.04C527.81 241.32 528.06 241.6 528.22 241.74C528.57 242.04 529.04 242.06 529.35 241.57C529.67 241.07 529.58 240.51 529.13 240.29C528.92 240.19 528.42 240.15 528.04 240.23C528.22 239.63 528.07 239.19 527.6 238.94C526.96 238.61 526.12 238.96 525.96 239.83C525.82 240.58 525.3 240.7 524.74 240.99C523.88 239.51 522.85 239.34 521.81 240.4C521.71 240.5 521.61 240.62 521.53 240.74C520.94 241.56 521.06 242.17 521.94 242.66H521.92Z" fill="#308DCC"></path> + <path d="M503.33 242.28C504.14 242.21 504.22 242.8 504.61 243.18C504.96 243.52 505.51 243.69 505.99 243.85C506.3 243.95 506.66 243.89 506.99 243.86C507.33 243.83 507.66 243.76 508 243.69C509.1 243.46 509.58 242.93 509.52 242.05C509.45 241.07 508.73 240.44 507.67 240.41C507.29 240.4 506.9 240.4 506.52 240.4C506.49 240.32 506.47 240.24 506.44 240.18C506.28 239.91 505.67 239.69 505.34 239.77C505.03 239.84 504.81 240.03 504.66 240.28C504.57 240.27 504.48 240.26 504.4 240.24C503.53 240.06 502.39 240.49 502.31 241.1C502.23 241.7 503.05 242.31 503.34 242.29L503.33 242.28Z" fill="#308DCC"></path> + <path d="M496.16 234.41C496.62 234.65 497.09 234.89 497.59 235.16C497.85 234.87 498.12 234.65 498.29 234.37C498.36 234.26 498.4 234.14 498.44 234.03H496.28C496.26 234.17 496.25 234.31 496.22 234.44L496.16 234.41V234.41Z" fill="#308DCC"></path> + <path d="M544.46 252.83C545.19 251.89 545.11 251.34 544.12 250.67C543.37 250.17 542.64 249.63 541.92 249.11C542.76 247.68 542.7 247.5 541.35 247.06C540.64 247.55 540.64 248.16 541.11 248.87C539.71 250.38 540.16 251.48 542.29 252C542.32 252.13 542.39 252.27 542.39 252.41C542.42 253.02 542.82 253.23 543.34 253.34C543.84 253.44 544.15 253.22 544.45 252.83H544.46Z" fill="#308DCC"></path> + <path d="M542.85 237.91C543.33 237.04 542.93 235.98 541.93 235.48C540.61 234.82 539.67 235.1 538.97 236.37C538.44 237.33 538.96 238.74 540.01 239.22C540.84 239.6 542.29 238.93 542.85 237.91V237.91Z" fill="#308DCC"></path> + <path d="M538.83 234.03H537.89C538.18 234.12 538.51 234.11 538.83 234.03Z" fill="#308DCC"></path> + <path d="M509.43 261.41C508.82 261.11 507.91 261.45 507.42 262.08C507.58 261.47 507.22 260.85 507.48 260.6C507.88 260.22 508.99 260.07 509.63 259.57C510.53 258.86 510.94 257.72 510.08 256.85C509.09 255.84 507.99 255.97 507.16 256.72C507.06 256.81 506.98 256.91 506.91 257C506.84 256.82 506.73 256.65 506.55 256.54C505.92 256.13 504.73 256.4 504.31 257.04C503.97 257.56 504.17 258.37 504.73 258.71C505.29 259.06 506.19 258.83 506.65 258.25C506.7 258.67 506.77 259.01 506.28 259.2C505.28 259.58 505.37 258.51 504.01 259.15C502.65 259.79 502.39 261.34 503.28 261.9C504.17 262.46 504.97 261.97 505.13 262.15C505.29 262.33 505.79 263.36 506.54 263C506.83 262.86 507.02 262.71 507.16 262.55C506.88 263.35 507.26 264.09 508.2 264.49C509.18 264.91 509.99 264.62 510.38 263.7C510.76 262.82 510.35 261.86 509.42 261.4L509.43 261.41Z" fill="#308DCC"></path> + <path d="M533.62 249.08C532.67 248.6 531.75 248.88 531.28 249.78C530.77 250.76 531.28 252.19 532.31 252.64C533.09 252.98 534.41 252.47 534.83 251.66C535.3 250.74 534.8 249.67 533.62 249.07V249.08Z" fill="#308DCC"></path> + <path d="M506.53 234.92C507.25 235.14 507.96 235.51 508.78 235.18C509.65 234.84 509.89 234.7 509.84 234.03H506.06C506.08 234.43 506.25 234.83 506.53 234.92V234.92Z" fill="#308DCC"></path> + <path d="M526.5 269.61C525.97 268.72 524.6 268.37 524 268.97C523.45 269.52 523.39 270.16 523.66 270.86C523.95 271.58 524.55 271.78 525.22 271.64C525.77 271.53 526.94 271.61 527.19 270.83C527.44 270.05 526.7 269.93 526.5 269.6V269.61Z" fill="#308DCC"></path> + <path d="M516.25 250.54C515.85 251.28 516.17 252.52 516.84 252.86C517.51 253.21 518.77 252.79 519.15 252.1C519.46 251.53 519.01 250.56 518.27 250.19C517.3 249.71 516.64 249.82 516.26 250.54H516.25Z" fill="#308DCC"></path> + <path d="M552.88 235.71C552.25 235.35 551.17 235.48 550.88 235.95C550.47 236.62 550.8 237.92 551.48 238.3C552.14 238.66 553.21 238.32 553.64 237.6C554.07 236.89 553.81 236.25 552.88 235.72V235.71Z" fill="#308DCC"></path> + <path d="M537.25 241.62C537.52 241.1 536.77 239.66 536.07 239.36C535.58 239.15 534.69 239.49 534.43 239.99C533.98 240.85 534.19 241.8 534.91 242.14C535.76 242.54 536.91 242.29 537.25 241.62V241.62Z" fill="#308DCC"></path> + <path d="M502.16 234.67C501.92 235.2 502.32 236.68 502.77 236.94C503.37 237.3 504.32 236.83 504.79 235.95C505.22 235.13 504.99 234.58 504.01 234.1C503.95 234.07 503.89 234.05 503.82 234.03H502.88C502.56 234.14 502.29 234.36 502.15 234.67H502.16Z" fill="#308DCC"></path> + <path d="M546.63 234.03H545.81C546.08 234.15 546.37 234.14 546.62 234.03H546.63Z" fill="#308DCC"></path> + <path d="M532.89 258.46C532.17 258.1 531.62 258.23 531.29 258.85C530.82 259.73 531.06 260.99 531.76 261.32C532.36 261.6 533.36 261.12 533.7 260.4C534.02 259.73 533.65 258.85 532.89 258.46V258.46Z" fill="#308DCC"></path> + <path d="M508.46 244.41C507.97 244.09 507.03 244.27 506.75 244.74C506.43 245.27 506.31 245.82 506.36 246.27C506.23 246.46 506.13 246.67 506.08 246.87C505.96 247.36 506.04 247.8 506.49 248C507.64 248.51 508.83 248.9 510.12 248.67C510.35 248.63 510.56 248.47 510.66 248.42C510.98 248.16 511.17 247.86 511.26 247.56C511.26 247.63 511.26 247.69 511.29 247.77C511.82 248 512.39 248.33 512.84 247.71C512.87 247.67 512.88 247.61 512.9 247.55C513.07 247.62 513.26 247.65 513.41 247.57C513.64 247.45 513.58 246.99 513.48 246.8C513.4 246.66 512.94 246.42 512.67 246.54C512.49 246.38 512.16 246.26 511.96 246.31C511.6 246.41 511.4 246.61 511.3 246.88C511.2 246.47 510.9 246.09 510.38 245.87C510 245.7 509.59 245.58 509.18 245.48C509.08 245.06 508.83 244.64 508.47 244.41H508.46Z" fill="#308DCC"></path> + <path d="M501.49 247.6C501.64 247.24 501.35 246.37 500.97 245.88C501.12 245.77 501.23 245.64 501.28 245.49C501.54 244.72 501.03 243.49 500.35 243.23C500.25 243.19 500.14 243.17 500.03 243.17C500.27 243.01 500.47 242.78 500.65 242.46C501.09 241.67 501.05 240.89 500.92 240.06C500.87 239.77 500.9 239.42 501.03 239.16C501.55 238.12 501.26 237.34 500.16 236.93C500.27 236.82 500.35 236.7 500.38 236.57C500.49 236.08 500.03 235.48 499.39 235.29C498.62 235.06 497.86 235.38 497.69 236C497.53 236.59 497.89 237.17 498.52 237.34C498.47 237.4 498.44 237.49 498.4 237.56C498.31 237.48 498.22 237.4 498.1 237.33C497.43 236.97 496.36 237.28 495.91 237.91C495.91 237.91 495.91 237.93 495.89 237.93C495.78 237.33 495.34 236.73 494.71 236.45C493.86 236.06 492.51 236.65 492.14 237.57C491.79 238.45 492.14 239.51 492.9 239.84C493.61 240.15 494.86 239.78 495.5 239.18C495.5 239.51 495.59 239.81 495.79 240C496.25 240.46 494.93 241.18 495.52 241.85C496.08 242.48 495.59 243.47 496.4 244.2C496.91 244.66 497.59 244.9 498.12 244.79C498.14 245.32 498.6 245.82 499.35 246.09C499.3 246.17 499.25 246.23 499.2 246.32C498.76 247.19 498.86 247.76 499.48 248.08C500.34 248.51 501.19 248.3 501.49 247.6V247.6ZM499 243.47C499 243.47 499 243.43 499 243.41C499.03 243.41 499.05 243.41 499.08 243.41C499.05 243.43 499.03 243.45 499 243.46V243.47Z" fill="#308DCC"></path> + <path d="M558.53 240.09C557.96 239.71 557.01 240.13 556.47 240.99C556.19 241.44 556.41 242.25 556.88 242.55C557.5 242.94 558.55 242.77 558.85 242.23C559.24 241.55 559.07 240.45 558.52 240.09H558.53Z" fill="#308DCC"></path> + <path d="M527.11 255.38C526.28 255.05 525.37 255.86 525.25 256.2C525.17 256.41 525.4 256.94 525.79 257.3C525.77 257.33 525.75 257.35 525.74 257.39C525.63 257.85 526.1 257.99 526.31 258.05C526.47 258.09 526.86 257.84 526.88 257.68C526.88 257.68 526.88 257.66 526.88 257.65C527.31 257.57 527.65 257.25 527.75 256.72C527.87 256.11 527.68 255.61 527.12 255.39L527.11 255.38Z" fill="#308DCC"></path> + <path d="M534.87 237.78C535.4 238.05 536.19 237.85 536.42 237.4C536.66 236.94 536.43 235.86 536.06 235.66C535.6 235.42 534.67 235.71 534.39 236.18C534.04 236.78 534.25 237.47 534.87 237.78Z" fill="#308DCC"></path> + <path d="M512.8 235.58C513.34 235.54 513.77 235.22 513.74 234.67C513.74 234.47 513.69 234.24 513.62 234.02H511.43C511.43 234.02 511.37 234.07 511.34 234.09C511.61 234.96 511.87 235.64 512.81 235.57L512.8 235.58Z" fill="#308DCC"></path> + <path d="M497.23 255.31C497 255.82 497.2 256.39 497.71 256.66C498.36 257.01 499.04 256.82 499.32 256.22C499.56 255.7 499.32 254.94 498.83 254.71C498.29 254.45 497.48 254.76 497.22 255.32L497.23 255.31Z" fill="#308DCC"></path> + <path d="M522.67 247.07C522.99 246.67 522.89 245.58 522.04 245.16C521.53 244.9 521.11 245.07 520.78 245.52C520.42 246.02 520.42 246.58 520.77 247.01C521.32 247.68 522.35 247.47 522.67 247.07V247.07Z" fill="#308DCC"></path> + <path d="M525.3 250.39C525.09 250.88 525.4 251.62 525.91 251.86C526.46 252.13 527.16 251.89 527.39 251.36C527.64 250.78 527.34 250.03 526.76 249.8C526.23 249.59 525.52 249.88 525.31 250.38L525.3 250.39Z" fill="#308DCC"></path> + <path d="M518.4 234.69C518.77 234.76 519.34 234.69 519.57 234.45C519.7 234.31 519.78 234.17 519.83 234.03H517.68C517.78 234.35 518.01 234.62 518.4 234.69Z" fill="#308DCC"></path> + <path d="M511.78 238.51C512.09 238.51 512.51 238.21 512.65 237.93C512.92 237.39 512.71 236.81 512.21 236.52C511.51 236.12 510.8 236.73 510.56 237.11C510.32 237.49 510.91 238.54 511.78 238.52V238.51Z" fill="#308DCC"></path> + <path d="M532.17 266.95C531.72 266.63 531.07 266.79 530.78 267.28C530.52 267.72 530.7 268.38 531.17 268.69C531.65 269.01 532.37 268.87 532.55 268.38C532.74 267.84 532.68 267.32 532.17 266.95Z" fill="#308DCC"></path> + <path d="M550.63 247.88C550.79 248.56 550.77 249.28 551.6 249.4C552.14 249.48 552.61 249.21 552.73 248.68C552.8 248.35 552.75 247.84 552.54 247.63C551.93 247.01 551.3 247.3 550.63 247.88Z" fill="#308DCC"></path> + <path d="M538.57 245.13C537.97 244.81 537.43 245.56 537.12 245.86C536.77 246.19 537.01 246.78 537.51 247.06C538.05 247.36 538.53 247.27 538.68 246.7C538.79 246.3 539.17 245.46 538.57 245.14V245.13Z" fill="#308DCC"></path> + <path d="M516.19 261.73C516.03 262.1 516.69 262.84 516.99 263.11C517.32 263.4 517.98 263.07 518.16 262.59C518.33 262.13 518.27 261.63 517.77 261.52C517.38 261.43 516.35 261.35 516.19 261.73V261.73Z" fill="#308DCC"></path> + <path d="M489.15 243.05C488.78 242.36 488.19 242.64 487.64 242.84C487.43 243.5 487.47 244.07 488.14 244.33C488.38 244.42 488.86 244.28 489 244.08C489.18 243.81 489.29 243.31 489.15 243.05Z" fill="#308DCC"></path> + <path d="M480.31 241.28C480.37 241.11 480.37 240.99 480.33 240.87L479.83 241.73C480.05 241.62 480.23 241.46 480.31 241.27V241.28Z" fill="#308DCC"></path> + <path d="M496.75 259.79C496.9 259.33 496.91 258.84 496.4 258.71C496.02 258.62 495.02 258.56 494.81 258.95C494.73 259.1 494.81 259.3 494.95 259.5C494.87 259.59 494.8 259.7 494.77 259.83C494.69 260.18 494.61 260.82 495.07 260.99C495.53 261.16 496.02 260.79 496.33 260.51C496.42 260.43 496.46 260.32 496.46 260.21C496.58 260.11 496.68 259.99 496.75 259.79Z" fill="#308DCC"></path> + <path d="M544.16 254.26C543.77 254.99 544.05 255.36 544.43 255.57C544.82 255.78 545.38 255.83 545.53 255.31C545.63 254.97 545.5 254.32 545.26 254.18C544.96 254.01 544.44 254.22 544.15 254.25L544.16 254.26Z" fill="#308DCC"></path> + <path d="M516.65 255.71C516.71 255.36 516.82 254.45 516.44 254.28C516.06 254.11 515.4 254.86 515.27 255.16C515.18 255.36 515.49 255.86 515.75 256.04C516.08 256.27 516.56 256.21 516.65 255.72V255.71Z" fill="#308DCC"></path> + <path d="M499.01 273.59C498.92 273.68 498.86 274.19 499.13 274.35C499.4 274.5 499.75 274.09 499.87 273.9C499.94 273.78 499.87 273.39 499.69 273.3C499.51 273.21 499.16 273.43 499 273.59H499.01Z" fill="#308DCC"></path> + <path d="M500.7 258.91C500.65 259 500.8 259.24 500.88 259.28C500.98 259.32 501.19 259.31 501.25 259.18C501.32 259.05 501.3 258.81 501.11 258.73C500.92 258.65 500.75 258.82 500.7 258.91Z" fill="#308DCC"></path> + <path d="M541.46 265.75C541.2 266.11 541.7 266.4 541.88 266.54C541.98 266.62 542.42 266.49 542.45 266.39C542.5 266.16 542.47 265.81 542.33 265.68C542.21 265.57 541.73 265.38 541.47 265.75H541.46Z" fill="#308DCC"></path> + <path d="M483.73 252.21C483.47 252.57 483.97 252.86 484.15 253C484.25 253.08 484.69 252.95 484.72 252.85C484.77 252.62 484.74 252.27 484.6 252.14C484.48 252.03 484 251.84 483.74 252.21H483.73Z" fill="#308DCC"></path> + <path d="M541.47 257.53C541.21 257.44 540.82 257.71 540.76 257.86C540.67 258.08 540.53 258.54 540.78 258.64C541.03 258.74 541.4 258.6 541.52 258.43C541.64 258.27 541.73 257.62 541.46 257.53H541.47Z" fill="#308DCC"></path> + <path d="M540.43 261.75C540.03 261.58 539.69 261.78 539.57 262.13C539.45 262.49 539.77 262.82 539.95 262.89C540.15 262.97 540.51 263.05 540.73 262.68C540.95 262.31 540.83 261.91 540.43 261.75Z" fill="#308DCC"></path> + <path d="M504.62 274.3C504.5 274.25 504.38 274.22 504.25 274.19C504.77 273.81 504.18 272.4 503.48 272.29C502.78 272.17 501.93 272.74 501.98 273.3C502.01 273.65 502.66 274.05 503.28 274.22C502.69 274.36 502.14 274.71 501.82 275.18H505.56C505.37 274.8 505.05 274.49 504.61 274.3H504.62Z" fill="#308DCC"></path> + <path d="M493.91 257.81C494.31 256.53 493.91 255.54 492.82 255.2C491.76 254.87 490.44 255.47 490.17 256.41C489.83 257.57 490.4 258.8 491.45 259.16C492.55 259.54 493.53 259.01 493.91 257.8V257.81Z" fill="#308DCC"></path> + <path d="M513.82 234.83C513.42 235.99 513.98 237.17 515.11 237.51C516.1 237.81 516.99 237.44 517.27 236.61C517.55 235.77 517.23 234.63 516.65 234.03H514.38C514.13 234.24 513.93 234.51 513.81 234.83H513.82Z" fill="#308DCC"></path> + <path d="M513.04 260.87C512.46 260.64 511.43 261.3 511.12 262.1C510.83 262.86 511.14 263.67 511.82 263.91C512.7 264.21 513.86 263.78 514.06 263.07C514.3 262.24 513.8 261.17 513.03 260.87H513.04Z" fill="#308DCC"></path> + <path d="M494.09 243.13C494.07 243.07 494.06 243.01 494.04 242.95C493.56 241.88 492.74 241.53 491.94 241.6C491.14 241.67 490.69 242.9 490.75 244.03C490.78 244.56 491.32 245.12 491.91 245.4C491.54 245.5 491.27 245.73 491.15 246.08C490.95 246.64 491.51 247.85 492.06 248.04C492.62 248.23 493.72 247.53 494 246.8C494.22 246.23 493.98 245.73 493.42 245.53C493.32 245.49 493.22 245.47 493.12 245.44C493.24 245.37 493.36 245.28 493.47 245.18C493.94 245.14 494.35 244.86 494.47 244.42C494.6 243.94 494.44 243.44 494.09 243.14V243.13Z" fill="#308DCC"></path> + <path d="M504.34 238.79C504.91 239 505.58 238.73 505.8 238.19C506.04 237.62 505.71 236.8 505.16 236.6C504.62 236.4 503.98 236.74 503.78 237.32C503.56 237.95 503.81 238.59 504.34 238.79Z" fill="#308DCC"></path> + <path d="M515.64 245.59C515.71 246.08 517.15 246.61 517.55 246.1C517.79 245.78 517.79 245.25 517.59 244.9C518.67 244.15 519 242.45 518.19 241.11C517.85 240.55 517.99 240.29 518.17 239.85C518.42 239.21 517.94 238.43 517.3 238.23C516.63 238.03 516.34 238.38 516.15 238.92C516.01 239.32 515.9 239.79 515.61 240.06C514.95 240.69 514.19 241.22 513.42 241.83C513.29 241.75 513.17 241.7 513.05 241.63C513.04 241.54 513.02 241.47 512.99 241.41C512.93 241.27 512.64 241.24 512.29 241.29C511.14 240.89 510.59 241.34 510.17 242.86C509.88 243.91 510.57 244.91 511.7 244.86C512.54 244.82 513.32 244.45 514.37 244.16C514.79 244.55 515.28 244.95 515.83 245.14C515.69 245.29 515.6 245.45 515.62 245.58L515.64 245.59Z" fill="#308DCC"></path> + <path d="M521.91 253.36C521.95 253.27 521.98 253.19 522.01 253.11C522.14 253.4 522.39 253.66 522.71 253.79C523.22 254 523.8 253.74 524.01 253.19C524.22 252.67 523.92 251.9 523.17 251.59C522.89 251.75 522.36 251.89 522.07 252.24C522.05 252.27 522.03 252.3 522.02 252.33C521.91 252.1 521.65 251.92 521.19 251.85C520.18 251.68 519.77 253.13 520.09 253.51C520.41 253.89 521.68 253.88 521.91 253.36V253.36Z" fill="#308DCC"></path> + <path d="M480.91 264.69C481.21 264.71 481.93 266.32 483.24 266.54C484.55 266.76 486.08 265.28 486.27 264.36C486.29 264.25 486.3 264.16 486.32 264.06C486.41 264.4 486.7 264.86 486.89 265.06C487.23 265.42 487.75 265.2 488.08 264.68C488.4 264.16 488.12 263.77 487.72 263.63C487.42 263.52 486.65 263.48 486.39 263.66C486.47 263.04 486.42 262.5 486.13 261.99C485.66 261.16 484.49 260.42 483.52 260.68C482.55 260.94 481.63 262.16 481.25 262.08C480.87 262 480.31 260.31 478.97 260.2C478.13 260.13 477.5 260.51 477.09 261.07C477.2 260.89 477.29 260.7 477.36 260.48C477.62 259.63 477.26 258.98 476.36 258.7C475.84 258.54 475.3 258.62 474.87 258.87L476.52 261.72C476.69 261.59 476.85 261.44 476.99 261.25C476.85 261.48 476.75 261.73 476.67 261.98L478.73 265.55C478.8 265.58 478.87 265.62 478.93 265.63C479.99 265.84 480.6 264.66 480.91 264.68V264.69Z" fill="#308DCC"></path> + <path d="M499.56 267.04C499.38 266.12 498.81 265.98 498.98 265.69C499.15 265.4 499.85 265.01 499.67 264.41C499.49 263.81 497.63 263.58 497.33 263.69C497.04 263.81 496.4 264.43 496 263.92C495.6 263.41 495.58 262.6 494.92 262.38C494.26 262.16 492.78 261.6 492.04 262.38C491.34 263.12 492.15 263.61 492.21 264.23C492.27 264.85 492.78 265.52 493.59 265.52C494.4 265.52 495.17 265.13 495.55 265.28C495.93 265.43 496.31 265.75 496.02 266.3C495.73 266.85 495.98 267.82 497.15 268.34C498.32 268.86 499.73 267.95 499.55 267.03L499.56 267.04Z" fill="#308DCC"></path> + <path d="M488.94 257.89C488.7 257.37 488.49 256.84 488.24 256.33C487.96 255.77 487.71 255.17 486.92 255.12C486.74 255.11 486.51 254.92 486.39 254.76C485.47 253.47 485.04 253.36 483.85 254.19C483.34 254.54 483.11 255.07 483.5 255.56C483.89 256.06 483.99 256.57 484.04 257.16C484.17 258.51 485.19 259.28 486.56 259.15C486.87 259.12 487.19 259.17 487.28 259.17C487.97 259.68 488.44 259.56 488.83 259.22C489.27 258.84 489.16 258.35 488.94 257.87V257.89Z" fill="#308DCC"></path> + <path d="M488.34 273.75C488.43 273.62 488.48 273.44 488.49 273.21C488.4 273.11 488.29 272.88 488.15 272.85C487.93 272.34 487.55 271.91 487.08 271.76C485.8 271.35 484.58 271.92 484.24 273.08C483.98 273.96 484.24 274.66 484.97 275.12C484.96 275.14 484.95 275.17 484.94 275.19H488.88C488.78 274.78 488.58 274.41 488.3 274.15C488.33 274.02 488.34 273.89 488.34 273.75V273.75Z" fill="#308DCC"></path> + <path d="M483.25 271.58C483.4 271.01 482.93 270.26 482.34 270.14C482.27 270.12 482.2 270.12 482.12 270.12C482.34 269.17 481.79 268.05 480.95 267.77C480.63 267.67 480.28 267.65 479.96 267.7L482.59 272.25C482.91 272.14 483.17 271.9 483.26 271.58H483.25Z" fill="#308DCC"></path> + <path d="M494.84 268.25C494.65 268.19 494.44 268.2 494.22 268.23C494.36 268.08 494.46 267.91 494.47 267.7C494.49 267.11 494.11 266.81 493.59 266.76C493.12 266.71 492.77 266.97 492.68 267.48C492.58 268.02 492.85 268.48 493.33 268.56C492.85 268.85 492.44 269.28 492.3 269.75C492.11 270.39 492.71 271.15 493.59 271.39C494.63 271.67 495.2 271.33 495.54 270.24C495.8 269.39 495.46 268.45 494.84 268.26V268.25Z" fill="#308DCC"></path> + <path d="M473.19 255C473.68 255.14 474.19 254.97 474.44 254.5C474.69 254.04 474.51 253.33 474.08 253.09C474.06 253.08 474.04 253.09 474.02 253.07C474.07 253.02 474.12 252.98 474.16 252.93C474.65 252.34 474.94 251.67 474.51 250.94L472.48 254.45C472.52 254.53 472.56 254.61 472.63 254.69C472.59 254.67 472.56 254.65 472.52 254.63C472.48 254.61 472.44 254.61 472.4 254.6L473.75 256.95C473.8 256.81 473.84 256.65 473.85 256.47C473.88 255.85 473.66 255.36 473.19 255V255Z" fill="#308DCC"></path> + <path d="M503.07 253.29C503.58 253.41 504.25 252.98 504.57 252.39C504.99 252.41 505.54 252.14 506.44 251.52C506.92 252.08 507.33 252.73 508.15 252.18C508.64 251.85 508.87 251.38 508.69 250.8C508.62 250.59 508.42 250.3 508.24 250.27C507.7 250.19 507.15 250.21 506.55 250.19C505.71 249.11 504.71 248.7 504.06 249.19C503.8 249.39 503.63 249.75 503.54 250.16C502.7 249.96 502 250.24 501.84 250.88C501.62 251.77 502.31 253.09 503.09 253.27L503.07 253.29Z" fill="#308DCC"></path> + <path d="M492.82 235.16C493.81 235.51 494.48 235.16 494.82 234.12C494.82 234.09 494.83 234.06 494.84 234.03H491.79C491.83 234.52 492.2 234.94 492.81 235.16H492.82Z" fill="#308DCC"></path> + <path d="M507.92 269.25C507.35 269.05 506.28 269.72 506.09 270.39C505.94 270.92 506.3 271.71 506.77 271.87C507.81 272.24 508.83 271.96 509.05 271.26C509.25 270.61 508.62 269.49 507.92 269.25Z" fill="#308DCC"></path> + <path d="M514.51 275.18H515.21C515.1 275.12 514.98 275.06 514.85 275.01C514.77 275.06 514.64 275.12 514.51 275.18Z" fill="#308DCC"></path> + <path d="M522.93 271.67C522.26 271.45 521.28 271.77 521.14 272.25C521.02 272.65 521.63 273.51 522.16 273.7C522.74 273.91 523.32 273.59 523.51 272.96C523.7 272.35 523.47 271.84 522.93 271.67V271.67Z" fill="#308DCC"></path> + <path d="M482.28 240.27C482.65 240.06 483.12 239.64 483.16 239.28C483.21 238.85 483.03 238.59 482.75 238.41C483.4 237.94 483.71 237.05 483.82 236.16C483.87 235.77 483.81 235.41 483.69 235.08L481.05 239.66C481.05 239.66 481.08 239.74 481.1 239.79C481.36 240.26 481.81 240.55 482.3 240.27H482.28Z" fill="#308DCC"></path> + <path d="M502.05 269.76C501.52 269.61 500.98 269.92 500.78 270.48C500.57 271.08 500.78 271.59 501.33 271.8C501.93 272.03 502.58 271.75 502.76 271.18C502.94 270.62 502.59 269.91 502.05 269.76V269.76Z" fill="#308DCC"></path> + <path d="M512.38 252.37C512.38 252.48 512.39 252.6 512.42 252.72C512.36 252.67 512.3 252.61 512.23 252.57C511.83 252.33 511.24 252.3 510.67 252.4C510.61 252.34 510.55 252.29 510.48 252.27C509.97 252.1 509.39 252.41 509.21 252.95C509.18 253.03 509.19 253.1 509.18 253.18C509.15 253.22 509.1 253.27 509.08 253.31C508.63 254.22 509.03 255.52 509.91 255.98C510.85 256.48 512.12 256.17 512.61 255.31C512.92 254.76 513 254.12 512.88 253.58C513.22 253.82 513.98 253.39 514.03 252.89C514.07 252.56 513.83 252.19 513.76 252C512.99 251.71 512.36 251.91 512.36 252.36L512.38 252.37Z" fill="#308DCC"></path> + <path d="M518.25 264.36C517.76 264.25 517.42 264.36 517.29 264.44C517.37 264.94 517.02 265.89 517.56 266.15C518.1 266.41 518.72 265.69 519.19 265.5C519.19 265.38 519.19 265.26 519.2 265.14C518.95 264.52 518.74 264.46 518.24 264.35L518.25 264.36Z" fill="#308DCC"></path> + <path d="M511.85 273.19C511.23 273.11 510.84 273.79 510.67 274.14C510.45 274.61 510.88 274.92 511.32 275.06C511.84 275.22 512.43 274.93 512.41 274.46C512.39 274.1 512.47 273.27 511.85 273.19V273.19Z" fill="#308DCC"></path> + <path d="M499.44 256.97C498.91 256.8 498.1 257.39 497.81 258.16C497.52 258.94 497.81 259.81 498.43 260.03C499.17 260.29 500.22 259.91 500.49 259.3C500.83 258.54 500.24 257.23 499.44 256.98V256.97Z" fill="#308DCC"></path> + <path d="M504.13 265.56C503.42 265.25 502.39 265.45 502.14 265.98C501.63 267.05 502.56 267.88 503.06 268.28C503.56 268.68 504.74 267.81 504.88 266.82C504.97 266.17 504.67 265.79 504.13 265.56V265.56Z" fill="#308DCC"></path> + <path d="M476.76 248.9C477.58 249.35 478.42 249.22 478.94 248.58C479.38 248.04 479.47 247.37 479.32 246.8C480.21 246.78 481.39 246.11 481.73 245.35C482.08 245.32 482.34 245.12 482.57 244.87C482.95 244.46 482.75 243.77 482.25 243.53C481.93 243.38 481.64 243.39 481.38 243.53C481.12 243.1 480.78 242.73 480.42 242.59C480.07 242.45 479.71 242.43 479.38 242.52L477.89 245.1C477.89 245.28 477.89 245.44 477.9 245.6C477.79 245.6 477.68 245.63 477.57 245.64L476.05 248.27C476.21 248.52 476.43 248.74 476.75 248.91L476.76 248.9Z" fill="#308DCC"></path> + <path d="M483.51 247.81C483.64 247.27 483.33 246.7 482.8 246.54C482.23 246.37 481.68 246.71 481.47 247.36C481.29 247.93 481.54 248.54 482.03 248.7C482.54 248.87 483.38 248.37 483.52 247.8L483.51 247.81Z" fill="#308DCC"></path> + <path d="M497.94 273.21C497.39 273.06 496.84 273.4 496.73 273.97C496.63 274.45 496.83 274.94 497.2 275.18H498.28C498.43 275.05 498.55 274.86 498.63 274.62C498.83 273.99 498.52 273.36 497.95 273.2L497.94 273.21Z" fill="#308DCC"></path> + <path d="M484.75 250.74C484.69 250.14 483.61 249.75 483.21 250.27C482.81 250.79 483.23 251.61 483.98 251.78C484.36 251.87 484.8 251.23 484.75 250.74V250.74Z" fill="#308DCC"></path> + <path d="M511.18 268.01C511.66 268.19 512.11 267.86 512.27 267.3C512.44 266.72 512.04 266.42 511.62 266.37C511.27 266.32 510.33 266.27 510.24 266.77C510.16 267.26 510.84 267.89 511.18 268.01Z" fill="#308DCC"></path> + <path d="M519.28 255.11C519.07 255 518.42 254.86 518.19 255.31C517.96 255.76 518.58 256.15 518.81 256.22C519.04 256.29 519.52 256.32 519.66 255.93C519.8 255.54 519.49 255.23 519.28 255.12V255.11Z" fill="#308DCC"></path> + <path d="M516.72 263.79C516.76 263.74 516.66 263.48 516.62 263.48C516.47 263.48 516.25 263.44 516.18 263.59C516.11 263.74 516.28 263.81 516.34 263.96C516.5 263.9 516.66 263.88 516.72 263.79V263.79Z" fill="#308DCC"></path> + <path d="M484.32 243.41C484.38 243.49 484.45 243.53 484.54 243.56C484.75 243.69 484.99 243.81 485.26 243.9C485.35 243.93 485.44 243.95 485.54 243.96C484.96 244.18 484.42 244.62 484.22 245.14C484.03 245.64 484.38 246.3 484.96 246.66C484.9 246.74 484.83 246.83 484.78 246.93C484.27 247.89 484.72 249.36 485.67 249.84C486.53 250.27 487.96 249.8 488.48 248.92C489.03 247.99 488.56 246.84 487.36 246.17C487.29 246.13 487.22 246.11 487.16 246.08C487.22 245.98 487.27 245.87 487.32 245.75C487.61 245.02 487.31 244.06 486.73 243.87C486.65 243.84 486.57 243.83 486.48 243.82C487.06 243.58 487.57 243.06 487.76 242.41C487.83 242.16 487.86 241.92 487.84 241.69C488.5 242.25 489.86 242.5 490.56 242.14C491.26 241.78 491.68 240.68 491.36 239.69C491.25 239.35 491.12 239.04 491.1 238.72C491.13 238.61 491.14 238.5 491.13 238.39C491.17 238.21 491.26 238.02 491.42 237.83C491.82 237.34 491.44 236.83 490.92 236.49C490.32 236.62 489.99 236.91 489.92 237.33C489.36 237.28 488.57 237.18 487.77 237.22C487.21 237.25 486.74 237.67 486.79 238.3C486.83 238.83 487.1 239.24 487.7 239.33C487.51 239.75 487.41 240.28 487.43 240.74C487.15 240.42 486.74 240.18 486.19 240.05C484.66 239.69 484.07 240 483.64 241.24C483.37 242.12 483.64 242.9 484.32 243.43V243.41Z" fill="#308DCC"></path> + <path d="M494.49 250.94C494.2 251.87 494.95 253.2 495.92 253.51C496.89 253.82 497.95 253.37 498.23 252.52C498.63 251.33 498.16 249.89 497.28 249.58C496.32 249.24 494.79 249.98 494.5 250.94H494.49Z" fill="#308DCC"></path> + <path d="M481.72 253.92C482.23 252.47 480.62 250.69 479.25 251.92C479.04 252.11 477.99 250.62 476.81 251.63C475.63 252.64 475.61 253.71 476.64 254.66C476.96 254.95 477.16 255.47 477.36 256.04C477.36 256.05 477.36 256.06 477.35 256.07C477.22 256.48 477.44 257 477.8 257.19C477.93 257.49 478.09 257.77 478.29 258C478.32 258.04 478.34 258.07 478.38 258.1C478.74 258.47 479.22 258.69 479.92 258.61C481.55 258.42 481.94 257.13 481.72 256.48C481.5 255.83 480.74 255.39 480.74 254.92C480.74 254.45 481.22 255.38 481.73 253.92H481.72Z" fill="#308DCC"></path> + <path d="M492.06 271.66C491.22 271.6 490.73 272.12 490.68 273.14C490.63 273.98 491.16 274.45 492.17 274.48C492.88 274.5 493.41 274.16 493.47 273.62C493.55 272.97 492.64 271.7 492.06 271.66Z" fill="#308DCC"></path> + <path d="M501.18 275.02C501.11 274.8 501.02 274.5 500.68 274.48C500.34 274.46 500.23 274.76 500.24 274.89C500.24 274.97 500.27 275.08 500.3 275.18H501.17C501.18 275.11 501.19 275.04 501.17 275.01L501.18 275.02Z" fill="#308DCC"></path> + <path d="M491.1 269.64C491.1 269.05 490.39 268.28 489.81 268.27C489.68 268.27 489.55 268.3 489.43 268.34C489.41 268.24 489.4 268.14 489.38 268.05C489.29 267.68 489.1 267.41 488.82 267.28C489.28 267.16 489.74 266.77 489.87 266.25C490.01 265.73 489.77 265.2 489.23 265.1C488.8 265.02 488.18 265.05 487.91 265.31C487.29 265.9 487.54 266.78 488.08 267.17C487.66 267.15 487.26 267.08 486.85 266.9C486.58 266.78 486.06 266.97 485.8 267.19C485.68 267.29 485.55 267.38 485.42 267.47C484.63 267.39 483.8 267.9 483.76 268.49C483.75 268.66 483.78 268.85 483.85 269.04C483.81 269.31 483.83 269.6 483.97 269.84C484.45 270.68 484.99 270.91 485.79 270.49C486.22 270.26 486.54 269.85 486.97 269.46C487.22 269.6 487.47 269.74 487.72 269.88C488.11 270.1 488.5 270.08 488.83 269.9C488.99 270.31 489.33 270.65 489.69 270.67C490.22 270.71 491.1 270.06 491.11 269.63L491.1 269.64Z" fill="#308DCC"></path> + <path d="M490.74 260.14C490.3 260.13 489.56 260.84 489.65 261.45C489.74 262.06 490.62 262.53 491.18 262.06C491.43 261.85 491.25 261.1 491.21 260.61C491.2 260.48 491.18 260.15 490.74 260.14V260.14Z" fill="#308DCC"></path> + <path d="M432.07 274.49H412.65L424.21 254.47L435.77 234.44L447.33 254.47L458.89 274.49H432.07Z" fill="#FEC618"></path> + <path d="M275.07 234.44H294.5L282.94 254.47L271.38 274.49L259.81 254.47L248.25 234.44H275.07Z" fill="#FEC618"></path> + <path d="M497.95 61.6H468.29V56.97H493.33V36.17H497.95V61.6Z" fill="#F6947E"></path> + <path d="M562.18 41.37C563.29 41.6 564.12 41.13 564.35 40.15C564.56 39.25 564.11 38.24 563.45 38.1C562.47 37.9 561.17 38.74 560.9 39.75C560.73 40.39 561.37 41.2 562.19 41.37H562.18Z" fill="#F6947E"></path> + <path d="M546.15 57.21C545.96 57.51 545.86 58.09 546.03 58.35C546.48 59.04 547.47 58.74 547.75 58.42C548.03 58.1 547.85 57.1 547.08 56.87C546.81 56.79 546.3 56.98 546.16 57.21H546.15Z" fill="#F6947E"></path> + <path d="M540.83 38.25C540.89 38.76 541.51 39.28 541.97 39.21C542.64 39.1 543.01 37.57 542.56 37.27C542.11 36.97 540.75 37.57 540.83 38.25Z" fill="#F6947E"></path> + <path d="M569.63 43.09C569.45 43.61 570.29 44.62 570.71 44.55C571.12 44.48 571.39 44 571.56 43.59C571.75 43.13 571.61 42.59 570.96 42.49C570.4 42.4 569.86 42.42 569.63 43.09Z" fill="#F6947E"></path> + <path d="M553.05 42.3C553.43 42.45 554.06 41.79 554.24 41.49C554.51 41.05 554.05 40.23 553.55 40.27C553.22 40.3 552.77 40.66 552.67 40.97C552.57 41.27 552.67 42.15 553.05 42.3Z" fill="#F6947E"></path> + <path d="M533.88 54.02C533.73 53.5 533.65 52.78 533.06 52.57C532.47 52.36 532.17 53.08 532.18 53.33C532.18 53.82 532.4 55.01 532.85 55.15C533.3 55.29 533.94 54.2 533.89 54.02H533.88Z" fill="#F6947E"></path> + <path d="M546.89 40.51C545.58 39.82 544.4 40.51 544.38 41.91C544.37 42.78 544.52 43.66 544.74 44.51C544.97 45.41 546.33 46.08 547.27 45.93C547.84 45.84 548.94 45.22 548.5 44.14C546.97 42.91 548.18 42.2 547.39 40.96C547.25 40.74 546.99 40.59 546.9 40.51H546.89Z" fill="#F6947E"></path> + <path d="M501.72 38.62C502.03 37.54 501.12 36.19 499.88 35.92C498.79 35.68 497.28 36.57 497.04 37.6C496.74 38.89 497.46 40.3 498.52 40.51C499.57 40.72 501.43 39.62 501.71 38.62H501.72Z" fill="#F6947E"></path> + <path d="M536.83 48.62C536.6 49.66 537.05 50.59 537.85 50.73C538.89 50.91 540.11 50.13 540.42 49.08C540.63 48.37 539.83 47.41 538.91 47.24C537.84 47.04 537.08 47.55 536.84 48.62H536.83Z" fill="#F6947E"></path> + <path d="M554.86 38.59C554.65 39.45 554.96 40.16 555.62 40.36C556.35 40.58 557.91 39.82 558.09 39.16C558.35 38.21 557.8 37.43 556.67 37.14C555.81 36.92 555.13 37.47 554.86 38.59V38.59Z" fill="#F6947E"></path> + <path d="M532.98 37.59C532.36 37.49 531.55 38.13 531.47 38.78C531.39 39.42 531.88 40.09 532.54 40.21C533.21 40.34 533.77 39.93 533.95 39.18C534.14 38.41 533.71 37.71 532.98 37.59V37.59Z" fill="#F6947E"></path> + <path d="M551.81 52.82C551.65 53.53 552.09 54.21 552.84 54.41C553.57 54.61 554.23 54.18 554.42 53.4C554.56 52.8 554.1 52.09 553.46 51.92C552.66 51.72 551.97 52.09 551.81 52.81V52.82Z" fill="#F6947E"></path> + <path d="M566.73 38.76C566.58 39.42 567.12 40.23 567.79 40.37C568.41 40.5 568.98 40.14 569.15 39.51C569.37 38.71 569 38.01 568.27 37.85C567.64 37.71 566.87 38.17 566.73 38.76Z" fill="#F6947E"></path> + <path d="M563.99 52.24C564.59 52.38 565.39 51.87 565.49 51.28C565.59 50.68 565.1 49.92 564.5 49.76C563.87 49.59 563.27 49.93 563.1 50.55C562.89 51.29 563.31 52.08 563.99 52.24V52.24Z" fill="#F6947E"></path> + <path d="M533.31 43.34C533.1 43.96 533.51 44.66 534.19 44.85C534.93 45.05 535.56 44.74 535.74 44.07C535.93 43.38 535.56 42.7 534.92 42.53C534.33 42.37 533.5 42.79 533.31 43.35V43.34Z" fill="#F6947E"></path> + <path d="M560.91 44.01C560.28 43.79 559.57 44.14 559.33 44.79C559.08 45.48 559.32 45.98 560 46.2C560.75 46.43 561.38 46.15 561.6 45.48C561.79 44.9 561.46 44.2 560.91 44.01V44.01Z" fill="#F6947E"></path> + <path d="M521.48 39.26C521.47 39.98 521.35 40.69 521.28 41.41C520.9 42.16 521.18 42.75 521.82 43C522.51 43.27 523.14 42.96 523.56 42.23C523.78 41.83 524.01 41.38 524.35 41.13C525.04 40.62 525.4 40 525.23 39.18C525.1 38.56 523.63 37.84 522.9 38C522.22 38.15 521.48 38.28 521.47 39.26H521.48Z" fill="#F6947E"></path> + <path d="M515.61 37.83C515.75 37.02 515.24 36.43 514.63 36.34C514.05 36.25 513.88 36.65 513.76 37.08C513.6 37.69 513.93 38.26 514.51 38.23C514.93 38.21 515.33 37.95 515.61 37.84V37.83Z" fill="#F6947E"></path> + <path d="M529.77 43.71C530 43.15 529.71 42.28 529.18 42.27C528.74 42.27 527.69 42.33 527.57 42.94C527.45 43.55 528.22 43.94 528.57 44.11C528.99 44.33 529.53 44.31 529.78 43.71H529.77Z" fill="#F6947E"></path> + <path d="M571.9 50.85C571.74 51.18 572.05 52.61 572.66 52.78C573.27 52.95 574.06 51.65 574.18 51.13C574.27 50.75 573.95 49.88 573.36 49.71C572.76 49.54 572.14 50.35 571.9 50.84V50.85Z" fill="#F6947E"></path> + <path d="M586.82 36.5C586.73 36.66 586.9 37.37 587.11 37.43C587.32 37.48 587.76 37 587.87 36.77C587.93 36.64 587.68 36.19 587.57 36.19C587.31 36.19 586.93 36.31 586.82 36.5V36.5Z" fill="#F6947E"></path> + <path d="M526.68 51.22C526.74 51.09 526.63 50.68 526.38 50.64C526.13 50.59 525.74 50.76 525.63 50.95C525.54 51.11 525.61 51.78 525.92 51.88C526.23 51.98 526.57 51.45 526.68 51.22V51.22Z" fill="#F6947E"></path> + <path d="M579.82 44.6C579.77 44.97 580.19 45.34 580.4 45.4C580.6 45.45 581.02 45.21 581.1 45.01C581.17 44.84 580.95 44.38 580.76 44.32C580.55 44.25 579.87 44.24 579.82 44.61V44.6Z" fill="#F6947E"></path> + <path d="M510.26 37.39C510.35 37.09 510.04 36.75 509.83 36.67C509.63 36.59 508.94 36.67 508.86 36.95C508.78 37.23 509.28 37.7 509.49 37.75C509.71 37.8 510.16 37.69 510.26 37.39V37.39Z" fill="#F6947E"></path> + <path d="M511.13 47.65C511.25 47.72 511.83 47.66 511.93 47.33C512.03 47 511.49 46.71 511.25 46.63C511.11 46.58 510.69 46.75 510.64 46.97C510.59 47.19 510.91 47.52 511.13 47.65Z" fill="#F6947E"></path> + <path d="M583.76 37.84C583.72 38.07 583.95 38.22 584.06 38.25C584.17 38.28 584.4 38.06 584.42 37.96C584.44 37.84 584.38 37.62 584.22 37.57C584.06 37.52 583.8 37.61 583.77 37.84H583.76Z" fill="#F6947E"></path> + <path d="M544.49 50.3C544.51 50.18 544.45 49.96 544.29 49.91C544.13 49.87 543.87 49.95 543.84 50.18C543.8 50.41 544.03 50.56 544.14 50.59C544.25 50.62 544.48 50.4 544.5 50.3H544.49Z" fill="#F6947E"></path> + <path d="M517.22 48.48C517.82 48.05 517.68 48.27 518.37 48.59C519.06 48.91 520.22 48.92 520.36 47.58C520.51 46.24 519.29 45.29 518.14 45.05C516.99 44.81 515.16 46.35 515.23 47.78C515.28 48.81 516.61 48.91 517.22 48.48Z" fill="#F6947E"></path> + <path d="M617.09 54.86C618.16 55.22 619.05 54.86 619.39 53.91C619.7 53.04 619.39 51.98 618.74 51.77C617.79 51.45 616.4 52.12 616.01 53.1C615.76 53.72 616.3 54.6 617.09 54.87V54.86Z" fill="#F6947E"></path> + <path d="M624.13 36.54C623.55 36.62 623.16 36.96 623.03 37.57C622.89 38.23 623.2 39.01 623.79 39.18C624.74 39.46 625.26 38.8 625.79 38.23C625.33 36.84 624.92 36.41 624.13 36.53V36.54Z" fill="#F6947E"></path> + <path d="M589.87 41.65C590.5 41.93 591.32 41.62 591.54 41.03C591.77 40.41 591.44 39.64 590.84 39.37C590.22 39.1 589.66 39.32 589.35 39.97C589.02 40.65 589.24 41.37 589.87 41.65V41.65Z" fill="#F6947E"></path> + <path d="M647.85 46.96C647.58 47.58 647.87 48.25 648.55 48.58C649.2 48.89 649.73 48.69 650.01 48.04C650.29 47.38 650.02 46.68 649.38 46.41C648.84 46.18 648.07 46.46 647.85 46.97V46.96Z" fill="#F6947E"></path> + <path d="M626.68 41.27C626.44 41.05 625.76 40.97 625.55 41.15C625.19 41.45 624.81 42.02 624.83 42.46C624.88 43.43 625.77 43.3 626.54 43.45C627.05 42.64 627.38 41.92 626.68 41.28V41.27Z" fill="#F6947E"></path> + <path d="M642.08 41.29C641.92 41.71 642.4 42.33 643.07 42.58C643.58 42.77 643.94 42.6 644.09 42.11C644.26 41.56 644.26 41.02 643.63 40.73C643.13 40.5 642.27 40.83 642.09 41.29H642.08Z" fill="#F6947E"></path> + <path d="M599.26 68.64C599.04 68.92 598.86 69.48 599 69.75C599.37 70.49 600.38 70.31 600.7 70.03C601.02 69.75 600.96 68.73 600.22 68.41C599.96 68.3 599.43 68.43 599.26 68.64Z" fill="#F6947E"></path> + <path d="M596.28 49.18C596.28 49.7 596.83 50.28 597.3 50.27C597.98 50.25 598.53 48.77 598.12 48.42C597.71 48.07 596.29 48.5 596.28 49.18Z" fill="#F6947E"></path> + <path d="M624.28 57.47C624.04 57.97 624.75 59.07 625.17 59.05C625.59 59.03 625.91 58.59 626.13 58.2C626.37 57.77 626.3 57.22 625.67 57.04C625.13 56.89 624.58 56.84 624.28 57.47Z" fill="#F6947E"></path> + <path d="M601.56 46.71C601.22 47.67 601.61 48.87 602.34 49.14C603.07 49.41 604.53 48.7 604.79 47.94C605.19 46.8 604.79 45.9 603.75 45.58C602.73 45.27 601.91 45.69 601.55 46.71H601.56Z" fill="#F6947E"></path> + <path d="M607.92 54.68C608.27 54.87 608.98 54.3 609.2 54.02C609.53 53.61 609.17 52.75 608.66 52.73C608.33 52.72 607.84 53.02 607.7 53.32C607.57 53.6 607.56 54.49 607.92 54.68V54.68Z" fill="#F6947E"></path> + <path d="M587.47 63.99C587.38 63.46 587.39 62.73 586.83 62.45C586.27 62.17 585.89 62.85 585.86 63.1C585.81 63.59 585.86 64.79 586.3 64.99C586.73 65.19 587.5 64.18 587.47 63.99V63.99Z" fill="#F6947E"></path> + <path d="M602.02 52.15C600.81 51.3 599.55 51.84 599.36 53.23C599.24 54.09 599.29 54.99 599.4 55.85C599.52 56.77 600.79 57.6 601.74 57.57C602.31 57.55 603.49 57.07 603.18 55.94C601.81 54.53 603.1 53.97 602.46 52.65C602.35 52.41 602.11 52.24 602.03 52.15H602.02Z" fill="#F6947E"></path> + <path d="M557.41 44.8C557.85 43.76 557.11 42.31 555.91 41.89C554.86 41.52 553.25 42.22 552.89 43.21C552.44 44.46 552.98 45.94 554.01 46.28C555.02 46.61 557 45.75 557.41 44.79V44.8Z" fill="#F6947E"></path> + <path d="M614.37 39.57C613.56 39.28 611.91 40 611.62 40.76C611.31 41.58 611.84 42.68 612.74 43.06C613.6 43.42 614.92 42.91 615.23 42.1C615.6 41.13 615.17 39.85 614.37 39.57V39.57Z" fill="#F6947E"></path> + <path d="M591.04 58.99C590.68 60 591.01 60.97 591.79 61.21C592.8 61.52 594.11 60.89 594.54 59.88C594.83 59.2 594.16 58.15 593.26 57.87C592.22 57.55 591.41 57.96 591.04 58.99Z" fill="#F6947E"></path> + <path d="M616.89 46.17C616.61 46.91 617.31 48.29 618.11 48.6C618.74 48.84 619.95 48.21 620.27 47.48C620.53 46.88 620.17 45.87 619.63 45.65C618.39 45.14 617.2 45.37 616.89 46.17V46.17Z" fill="#F6947E"></path> + <path d="M610.16 51.22C609.85 52.05 610.07 52.79 610.7 53.07C611.4 53.37 613.04 52.81 613.3 52.18C613.67 51.27 613.22 50.43 612.14 50C611.31 49.68 610.57 50.14 610.16 51.22Z" fill="#F6947E"></path> + <path d="M629.35 46.09C628.74 45.86 627.82 46.35 627.64 47C627.39 47.9 627.76 48.88 628.44 49.11C629.26 49.39 630.63 48.88 630.88 48.19C631.1 47.59 630.27 46.44 629.35 46.09V46.09Z" fill="#F6947E"></path> + <path d="M605.86 39.59C605.56 40.27 606.12 41.48 606.87 41.8C607.45 42.05 608.05 41.78 608.34 41.13C608.7 40.34 608.39 39.35 607.69 38.99C607.04 38.66 606.15 38.95 605.87 39.59H605.86Z" fill="#F6947E"></path> + <path d="M588.56 47.57C587.96 47.39 587.08 47.93 586.91 48.57C586.75 49.2 587.16 49.92 587.8 50.12C588.45 50.33 589.05 49.99 589.33 49.27C589.61 48.53 589.27 47.78 588.56 47.57V47.57Z" fill="#F6947E"></path> + <path d="M605.4 64.97C605.16 65.65 605.51 66.38 606.23 66.68C606.93 66.97 607.64 66.62 607.92 65.87C608.14 65.29 607.76 64.53 607.14 64.29C606.37 63.99 605.64 64.29 605.39 64.98L605.4 64.97Z" fill="#F6947E"></path> + <path d="M619.94 40.98C620.51 41.11 621.15 41.25 621.37 40.68C621.71 39.66 621.46 38.91 620.84 38.67C620.07 38.37 619.22 38.76 619.02 39.52C618.84 40.18 619.22 40.82 619.94 40.98V40.98Z" fill="#F6947E"></path> + <path d="M621.92 52.82C621.69 53.45 622.12 54.33 622.78 54.55C623.38 54.75 623.99 54.46 624.24 53.86C624.56 53.1 624.27 52.35 623.56 52.11C622.96 51.9 622.13 52.26 621.92 52.83V52.82Z" fill="#F6947E"></path> + <path d="M617.56 65.88C618.14 66.1 618.99 65.68 619.17 65.11C619.34 64.53 618.95 63.72 618.38 63.49C617.78 63.25 617.14 63.51 616.89 64.1C616.6 64.81 616.91 65.65 617.56 65.89V65.88Z" fill="#F6947E"></path> + <path d="M635.71 51.51C635.49 52.09 635.9 52.83 636.58 53.05C637.24 53.27 637.84 52.93 638.11 52.18C638.39 51.41 638.22 50.79 637.69 50.64C637.06 50.46 635.91 50.96 635.71 51.5V51.51Z" fill="#F6947E"></path> + <path d="M588.19 53.31C587.91 53.9 588.23 54.64 588.88 54.91C589.59 55.2 590.26 54.96 590.52 54.33C590.79 53.67 590.52 52.95 589.89 52.7C589.32 52.47 588.45 52.78 588.19 53.31Z" fill="#F6947E"></path> + <path d="M615.51 57.33C614.91 57.03 614.16 57.29 613.85 57.92C613.52 58.57 613.7 59.1 614.35 59.4C615.06 59.72 615.73 59.51 616.03 58.88C616.29 58.33 616.05 57.6 615.52 57.33H615.51Z" fill="#F6947E"></path> + <path d="M636.23 38.89C636.02 39.47 636.23 39.96 636.74 40.28C637.18 40.55 638.4 39.95 638.37 39.45C638.35 38.95 638.05 38.65 637.7 38.39C637.2 38.01 636.45 38.31 636.23 38.9V38.89Z" fill="#F6947E"></path> + <path d="M595.74 44.76C595.57 44.54 595 44.36 594.82 44.48C594.47 44.71 594.05 45.17 594.05 45.53C594.05 46.27 594.75 46.35 595.33 46.44C595.96 45.98 596.23 45.41 595.75 44.77L595.74 44.76Z" fill="#F6947E"></path> + <path d="M576.95 47.83C576.85 48.54 576.65 49.24 576.5 49.94C576.03 50.64 576.24 51.26 576.85 51.58C577.5 51.93 578.17 51.7 578.67 51.02C578.94 50.65 579.22 50.23 579.59 50.02C580.34 49.6 580.77 49.03 580.7 48.19C580.64 47.56 579.27 46.67 578.53 46.74C577.83 46.81 577.09 46.85 576.95 47.82V47.83Z" fill="#F6947E"></path> + <path d="M579.21 40.16C579.9 40.48 580.54 40.25 580.83 39.57C581.13 38.86 580.83 38.04 580.17 37.79C579.58 37.57 578.9 37.95 578.63 38.65C578.4 39.26 578.65 39.89 579.21 40.16V40.16Z" fill="#F6947E"></path> + <path d="M572.48 39.87C572.24 40.45 572.5 41.06 573.08 41.1C573.5 41.13 573.93 40.92 574.22 40.85C574.46 40.07 574.03 39.41 573.43 39.25C572.86 39.09 572.65 39.46 572.48 39.88V39.87Z" fill="#F6947E"></path> + <path d="M632.98 41.95C632.74 42.53 633 43.14 633.58 43.18C634 43.21 634.48 43.25 634.72 42.93C634.96 42.61 634.53 41.49 633.93 41.33C633.36 41.17 633.15 41.54 632.98 41.96V41.95Z" fill="#F6947E"></path> + <path d="M571.29 45.7C571.53 44.92 571.1 44.26 570.5 44.1C569.93 43.94 569.72 44.31 569.55 44.73C569.31 45.31 569.57 45.92 570.15 45.96C570.57 45.99 571 45.78 571.29 45.71V45.7Z" fill="#F6947E"></path> + <path d="M584.63 53.25C584.93 52.72 584.75 51.82 584.22 51.75C583.78 51.69 582.73 51.63 582.54 52.21C582.35 52.8 583.06 53.28 583.39 53.5C583.78 53.77 584.32 53.81 584.64 53.25H584.63Z" fill="#F6947E"></path> + <path d="M655.27 44.36C655.19 44.69 655.24 45.33 655.48 45.47C655.72 45.61 656.37 45.36 656.54 45.11C656.69 44.88 656.67 43.92 656.36 43.78C656.05 43.64 655.32 44.14 655.27 44.35V44.36Z" fill="#F6947E"></path> + <path d="M625.59 65.45C625.39 65.76 625.53 67.22 626.11 67.46C626.69 67.7 627.64 66.51 627.82 66.01C627.96 65.64 627.75 64.74 627.17 64.51C626.6 64.27 625.88 64.99 625.58 65.46L625.59 65.45Z" fill="#F6947E"></path> + <path d="M642.14 53.02C642.03 53.17 642.12 53.9 642.31 53.98C642.51 54.06 643.01 53.64 643.15 53.42C643.23 53.3 643.03 52.82 642.92 52.8C642.66 52.77 642.27 52.84 642.14 53.02Z" fill="#F6947E"></path> + <path d="M580.65 60.33C580.73 60.21 580.66 59.79 580.42 59.71C580.18 59.63 579.77 59.75 579.64 59.93C579.53 60.08 579.52 60.75 579.81 60.89C580.1 61.02 580.51 60.55 580.65 60.33Z" fill="#F6947E"></path> + <path d="M637.83 48.37C637.75 48.67 638.11 49.08 638.28 49.12C638.54 49.19 639.07 49.3 639.15 49.01C639.23 48.72 639.03 48.32 638.84 48.21C638.65 48.1 637.91 48.07 637.84 48.37H637.83Z" fill="#F6947E"></path> + <path d="M634.21 60.21C634.11 60.57 634.49 60.99 634.69 61.07C634.89 61.14 635.32 60.96 635.43 60.77C635.52 60.61 635.35 60.13 635.18 60.04C634.98 59.94 634.3 59.85 634.21 60.21V60.21Z" fill="#F6947E"></path> + <path d="M566.04 44.61C566.17 44.32 565.9 43.95 565.71 43.84C565.52 43.73 564.83 43.72 564.71 44C564.59 44.28 565.04 44.8 565.24 44.87C565.45 44.94 565.92 44.89 566.05 44.6L566.04 44.61Z" fill="#F6947E"></path> + <path d="M565.65 54.9C565.76 54.99 566.34 55 566.48 54.68C566.62 54.36 566.11 54.01 565.9 53.9C565.76 53.83 565.33 53.95 565.25 54.17C565.17 54.39 565.45 54.75 565.65 54.9Z" fill="#F6947E"></path> + <path d="M638.94 53.98C638.87 54.2 639.08 54.38 639.19 54.42C639.3 54.46 639.55 54.27 639.58 54.17C639.61 54.06 639.58 53.82 639.42 53.76C639.26 53.7 639 53.75 638.94 53.97V53.98Z" fill="#F6947E"></path> + <path d="M598.45 61.58C598.48 61.47 598.45 61.23 598.29 61.17C598.13 61.11 597.87 61.16 597.81 61.38C597.74 61.6 597.95 61.78 598.06 61.82C598.17 61.86 598.42 61.67 598.45 61.57V61.58Z" fill="#F6947E"></path> + <path d="M610.85 48.5C611.46 48.69 612.23 48.32 612.46 47.73C612.68 47.17 612.23 46.35 611.62 46.17C610.99 45.99 610.35 46.39 610.13 47.1C609.93 47.76 610.21 48.3 610.86 48.5H610.85Z" fill="#F6947E"></path> + <path d="M571.6 56.46C572.25 56.1 572.08 56.31 572.73 56.71C573.38 57.11 574.52 57.27 574.83 55.95C575.14 54.63 574.04 53.55 572.93 53.17C571.82 52.79 569.82 54.1 569.71 55.53C569.63 56.56 570.95 56.82 571.6 56.46Z" fill="#F6947E"></path> + <path d="M652.73 66.92C652.77 66.34 652.9 65.55 652.18 65.35C651.22 65.08 650.78 64.43 650.35 63.66C649.99 63.01 649.43 62.9 648.81 63.28C648.15 63.67 647.83 64.7 648.39 65.11C649.25 65.74 649.34 66.49 649.26 67.25C649.46 68.14 650.25 68.86 650.89 68.84C651.55 68.82 652.67 67.71 652.72 66.93L652.73 66.92Z" fill="#F6947E"></path> + <path d="M666.72 42.21C665.23 43 665.23 43.37 666.6 44.28C666.72 45.13 666.63 45.85 666.93 46.32C667.25 46.81 667.9 47.18 668.48 47.4C669.19 47.67 669.88 47.04 669.9 46.07C669.91 45.5 669.86 44.72 669.51 44.4C669.06 44 668.28 43.98 667.56 43.78C667.58 43.19 667.59 42.46 666.72 42.22V42.21Z" fill="#F6947E"></path> + <path d="M667.5 81.68C666.56 81.96 666.24 82.77 666.62 83.95C666.83 84.61 667.8 85.16 668.44 84.98C669.2 84.76 670.26 83.19 670.05 82.58C669.79 81.81 668.54 81.37 667.49 81.68H667.5Z" fill="#F6947E"></path> + <path d="M626.98 76.93C627.31 78.01 628.12 78.52 629.09 78.25C629.98 78 630.65 77.12 630.46 76.48C630.17 75.52 628.81 74.79 627.79 75.03C627.14 75.19 626.74 76.14 626.98 76.94V76.93Z" fill="#F6947E"></path> + <path d="M649.4 72.53C650.68 72.14 651.16 71.53 650.9 70.6C650.71 69.92 649.43 69.27 648.77 69.51C648.16 69.73 647.61 71.05 647.82 71.79C648.01 72.46 648.64 72.75 649.4 72.53V72.53Z" fill="#F6947E"></path> + <path d="M645.98 72C645.57 71.57 645.07 71.45 644.5 71.71C643.88 71.98 643.43 72.68 643.63 73.27C643.95 74.21 644.79 74.24 645.56 74.34C646.42 73.16 646.53 72.58 645.98 72V72Z" fill="#F6947E"></path> + <path d="M666.83 76.69C666.85 75.87 667.11 75.07 666.22 74.73C665.61 74.5 665.05 74.69 664.65 75.25C664.32 75.71 664.3 76.15 664.68 76.58C665.32 77.3 666.02 77.06 666.83 76.69V76.69Z" fill="#F6947E"></path> + <path d="M621.88 47.11C622.01 47.78 622.75 48.28 623.36 48.11C624 47.93 624.44 47.22 624.3 46.58C624.16 45.92 623.65 45.59 622.94 45.71C622.2 45.84 621.74 46.44 621.87 47.11H621.88Z" fill="#F6947E"></path> + <path d="M651.31 97.35C650.65 97.49 650.27 98.11 650.4 98.86C650.52 99.57 650.99 99.88 651.69 99.73C652.39 99.58 652.81 98.95 652.65 98.27C652.52 97.7 651.84 97.24 651.3 97.35H651.31Z" fill="#F6947E"></path> + <path d="M643.62 76.82C643.66 76.5 643.33 75.9 643.06 75.83C642.6 75.71 641.92 75.74 641.58 76.01C640.82 76.61 641.44 77.26 641.77 77.98C642.72 77.93 643.5 77.77 643.62 76.83V76.82Z" fill="#F6947E"></path> + <path d="M652.57 89.36C652.13 89.47 651.91 90.23 652.1 90.91C652.24 91.43 652.59 91.63 653.07 91.47C653.61 91.29 654.06 90.97 653.92 90.29C653.82 89.75 653.05 89.24 652.56 89.36H652.57Z" fill="#F6947E"></path> + <path d="M605.4 70.46C605.04 70.44 604.49 70.62 604.34 70.89C603.95 71.62 604.68 72.34 605.1 72.44C605.52 72.54 606.31 71.9 606.14 71.11C606.08 70.84 605.67 70.48 605.4 70.46Z" fill="#F6947E"></path> + <path d="M619.49 56.71C619.07 57.01 618.91 57.8 619.2 58.17C619.61 58.71 621.14 58.3 621.18 57.76C621.22 57.22 620.05 56.31 619.49 56.71V56.71Z" fill="#F6947E"></path> + <path d="M629.04 84.3C628.5 84.4 628.01 85.62 628.27 85.95C628.53 86.28 629.08 86.28 629.52 86.23C630.01 86.18 630.42 85.8 630.2 85.18C630.01 84.65 629.73 84.18 629.04 84.3V84.3Z" fill="#F6947E"></path> + <path d="M624.57 59.56C623.6 59.84 622.85 60.85 623.05 61.6C623.26 62.36 624.68 63.12 625.45 62.9C626.6 62.56 627.11 61.71 626.76 60.69C626.42 59.68 625.6 59.26 624.56 59.56H624.57Z" fill="#F6947E"></path> + <path d="M648.34 45.14C648.84 44.75 648.42 43.47 648.21 43.18C648 42.89 647.45 42.82 647.2 42.93C646.95 43.04 646.42 43.42 646.45 44.09C646.48 44.76 647.85 45.53 648.34 45.14V45.14Z" fill="#F6947E"></path> + <path d="M621.79 69.37C621.84 69.77 622.72 70.01 623.07 70.03C623.59 70.06 624.09 69.26 623.8 68.84C623.62 68.57 623.09 68.34 622.77 68.4C622.46 68.46 621.74 68.97 621.79 69.37Z" fill="#F6947E"></path> + <path d="M602.32 58.16C602.7 57.78 603.3 57.36 603.2 56.74C603.1 56.12 602.33 56.21 602.11 56.33C601.68 56.57 600.74 57.32 600.83 57.79C600.92 58.26 602.19 58.29 602.32 58.16Z" fill="#F6947E"></path> + <path d="M652.58 81.52C652.96 81.79 653.41 81.39 653.47 80.85C653.52 80.41 653.32 79.69 653 79.42C652.55 79.03 652.17 79.35 652.08 79.51C651.89 79.84 652 80.21 652.12 80.58C652.23 80.93 652.25 81.29 652.58 81.52V81.52Z" fill="#F6947E"></path> + <path d="M660.62 73.97C659.42 73.43 658.47 73.74 657.85 74.39C657.22 75.04 657.76 76.41 658.65 77.32C659.3 77.98 661.03 77.8 661.55 77.04C662.06 76.28 661.82 74.51 660.62 73.97V73.97Z" fill="#F6947E"></path> + <path d="M632.47 51.52C632.01 51.02 631.04 51.05 630.2 51.61C629.93 51.79 629.68 51.99 629.41 52.2C628.67 51.87 627.92 51.45 627.18 51.58C627.12 51.4 627.05 51.21 626.96 51.04C626.55 50.21 624.86 49.82 624.13 50.38C623.4 50.94 623.06 52.69 624.03 53.58C624.61 54.11 625.19 54.33 625.74 54.33C625.76 54.44 625.77 54.55 625.8 54.66C626.06 55.96 627.01 56.23 628.15 56.25C628.22 56.96 627.95 57.79 628.97 57.99C629.61 58.11 630.08 57.85 630.33 57.33C630.77 56.4 630.03 55.98 629.39 55.55C629.55 55.12 629.69 54.72 629.84 54.31C630.43 54.5 630.94 54.66 631.48 54.82C631.84 54.49 632.22 54.23 632.47 53.89C632.88 53.33 632.84 51.92 632.47 51.53V51.52Z" fill="#F6947E"></path> + <path d="M657.23 61.26C657.1 60.66 656.8 60.12 657.52 59.49C657.88 59.59 658.32 59.85 658.6 59.74C659.06 59.56 659.6 59.22 659.8 58.8C660.07 58.23 659.63 57.79 659.06 57.55C658.62 57.36 658.2 57.14 657.77 56.94C656.72 56.45 654.22 57.83 654.11 58.96C654.1 59.06 654.11 59.21 654.16 59.28C654.9 60.06 654.35 60.78 654.1 61.55C653.79 62.5 654.25 63.16 655.22 63.32C655.31 63.33 655.4 63.34 655.49 63.34C655.42 63.53 655.39 63.74 655.44 63.95C655.54 64.39 655.9 64.78 656.14 65.19L656.07 65.21C656.64 65.07 657.21 64.93 657.84 64.78C657.84 64.34 657.91 63.96 657.84 63.59C657.75 63.08 657.44 62.72 657.05 62.56C657.26 62.21 657.34 61.76 657.23 61.27V61.26Z" fill="#F6947E"></path> + <path d="M620.41 63.11C620.39 61.63 619.22 60.92 617.98 61.57C617.21 61.97 616.51 62.53 615.87 63.13C615.19 63.76 615.25 65.28 615.83 66.03C616.18 66.49 617.26 67.16 617.99 66.25C618.34 64.32 619.54 65.04 620.25 63.75C620.38 63.52 620.38 63.22 620.41 63.1V63.11Z" fill="#F6947E"></path> + <path d="M662.03 50.92C661.82 50.96 661.61 51.04 661.38 51.04C660.4 51.04 660.08 51.61 659.94 52.39C659.81 53.14 660.18 53.61 660.82 54.09C662.38 55.26 663.26 55.19 664.28 53.75C665.05 52.67 665.87 51.62 666.66 50.58C669.01 51.96 669.3 51.88 669.93 49.89C669.09 48.79 668.12 48.74 667 49.39C664.49 47.16 662.74 47.75 662.03 50.9V50.92Z" fill="#F6947E"></path> + <path d="M657.36 81.64C656.14 81.91 655.46 82.99 655.74 84.19C656.02 85.38 657.49 86.29 658.65 85.99C659.7 85.72 660.55 84.26 660.34 83.12C660.11 81.92 658.86 81.3 657.35 81.64H657.36Z" fill="#F6947E"></path> + <path d="M646.29 60.04C647.68 59.75 648.54 58.31 648.19 56.88C647.87 55.56 646.81 54.99 645.27 55.32C643.46 55.7 642.54 56.84 642.88 58.26C643.22 59.67 644.61 60.4 646.28 60.05L646.29 60.04Z" fill="#F6947E"></path> + <path d="M637.83 65.83C637.59 65.01 636.05 64.08 635.26 64.29C634.41 64.51 633.83 65.59 634.04 66.54C634.25 67.45 635.43 68.23 636.27 68.01C637.27 67.75 638.06 66.65 637.83 65.84V65.83Z" fill="#F6947E"></path> + <path d="M653.45 40.89C653.08 40.8 652.72 40.66 652.35 40.62C651.49 40.52 650.68 40.66 650.25 41.53C649.81 42.43 649.54 43.36 650.19 44.32C650.9 45.37 652.19 45.52 653.1 44.62C654.23 43.5 654.37 42.46 653.58 40.95L653.45 40.89V40.89Z" fill="#F6947E"></path> + <path d="M638.87 61.7C639.19 63.01 640.36 63.63 641.84 63.26C642.83 63.01 643.5 61.76 643.26 60.62C642.99 59.37 642 58.85 640.58 59.2C639.15 59.55 638.56 60.42 638.87 61.71V61.7Z" fill="#F6947E"></path> + <path d="M653.15 72.12C652.65 72.5 651.79 73.06 651.05 73.77C650.6 74.21 650.52 74.91 651.03 75.41C651.48 75.85 652.06 76.01 652.66 75.56C652.95 75.34 653.3 75.17 653.65 75.05C654.66 74.71 655.11 74.15 655.09 73.16C655.08 72.22 654.48 71.77 653.14 72.12H653.15Z" fill="#F6947E"></path> + <path d="M665.08 54.72C664.23 54.96 663.57 55.99 663.75 56.85C663.87 57.45 664.7 58.14 665.2 57.91C665.97 57.57 666.84 57.35 667.3 56.46C667.92 55.26 667.92 55.12 666.72 54.18C666.1 54.38 665.6 54.57 665.09 54.71L665.08 54.72Z" fill="#F6947E"></path> + <path d="M608.47 58.16C607.44 58.46 606.84 59.29 607.1 60.06C607.44 61.06 608.71 61.76 609.78 61.52C610.5 61.36 610.97 60.21 610.67 59.31C610.33 58.27 609.52 57.85 608.47 58.16V58.16Z" fill="#F6947E"></path> + <path d="M657.24 42.19C657.5 42.22 657.94 41.88 658.09 41.59C658.52 40.78 658.17 39.57 657.49 38.9C656.96 38.38 656.46 38.4 655.87 38.74C655.03 39.23 654.72 40 654.94 41.12C654.97 41.28 655.06 41.42 655.13 41.57L655.26 41.63C655.92 41.83 656.57 42.11 657.24 42.19V42.19Z" fill="#F6947E"></path> + <path d="M642 47.51C642.99 47.3 643.87 45.81 643.59 44.8C643.44 44.23 642.54 43.8 641.83 43.95C640.68 44.19 640.06 45.04 640.31 46.05C640.53 46.95 641.33 47.65 642 47.51V47.51Z" fill="#F6947E"></path> + <path d="M663.53 62.42C664.31 62.27 664.76 61.18 664.5 60.09C664.26 59.08 663.65 58.79 662.47 59.1C661.62 59.33 661.09 60.19 661.33 60.96C661.53 61.58 662.96 62.53 663.54 62.42H663.53Z" fill="#F6947E"></path> + <path d="M633.94 71.72C633.18 71.92 632.46 73.29 632.68 74.13C632.85 74.78 634.07 75.4 634.84 75.23C635.48 75.09 636.09 74.22 635.95 73.64C635.64 72.34 634.76 71.5 633.93 71.72H633.94Z" fill="#F6947E"></path> + <path d="M625.91 69.18C625.06 69.41 624.58 70.02 624.73 70.7C624.89 71.45 626.3 72.45 626.96 72.29C627.92 72.06 628.34 71.21 628.05 70.08C627.83 69.22 627.02 68.88 625.91 69.18V69.18Z" fill="#F6947E"></path> + <path d="M641.25 81.81C641.08 81.18 640.15 80.72 639.51 80.95C638.64 81.27 638.06 82.14 638.26 82.82C638.51 83.66 639.72 84.46 640.43 84.27C641.05 84.1 641.5 82.76 641.25 81.81V81.81Z" fill="#F6947E"></path> + <path d="M646.68 48.73C647.39 48.55 647.68 47.9 647.45 47.03C647.16 45.95 646.42 45.37 645.62 45.62C644.64 45.92 644.03 46.88 644.3 47.71C644.48 48.25 645.99 48.9 646.67 48.73H646.68Z" fill="#F6947E"></path> + <path d="M668.15 71.27C667.46 71.4 667.21 72.03 667.47 72.99C667.75 74.05 668.25 74.46 669.01 74.26C670.05 73.98 670.62 73.18 670.35 72.36C670.18 71.83 668.79 71.14 668.15 71.27V71.27Z" fill="#F6947E"></path> + <path d="M632.87 58.92C632.15 59.07 631.48 60.23 631.66 61.02C631.8 61.64 632.36 61.96 633.06 61.83C633.91 61.66 634.54 60.84 634.42 60.05C634.31 59.33 633.56 58.78 632.87 58.92Z" fill="#F6947E"></path> + <path d="M644.16 67.21C645.26 66.9 645.8 66.38 645.66 65.77C645.51 65.06 644.33 64.37 643.56 64.54C642.94 64.67 642.45 65.84 642.69 66.59C642.88 67.19 643.43 67.42 644.16 67.21Z" fill="#F6947E"></path> + <path d="M616.31 49.5C616.11 48.91 615.16 48.5 614.54 48.74C613.94 48.97 613.59 49.73 613.8 50.37C614.01 51.02 614.63 51.31 615.38 51.11C616.15 50.9 616.56 50.2 616.31 49.5V49.5Z" fill="#F6947E"></path> + <path d="M611.96 73.32C611.26 73.52 610.88 74.23 611.06 74.99C611.23 75.72 611.93 76.1 612.7 75.89C613.3 75.73 613.7 74.98 613.53 74.34C613.32 73.54 612.66 73.11 611.95 73.32H611.96Z" fill="#F6947E"></path> + <path d="M639.93 71.17C640.16 71.71 640.41 72.31 641 72.16C642.03 71.85 642.49 71.21 642.33 70.56C642.12 69.76 641.31 69.3 640.58 69.57C639.94 69.81 639.64 70.49 639.93 71.17V71.17Z" fill="#F6947E"></path> + <path d="M631.45 79.68C630.8 79.86 630.34 80.72 630.55 81.38C630.73 81.98 631.32 82.31 631.96 82.16C632.77 81.97 633.2 81.31 632.99 80.59C632.81 79.97 632.03 79.51 631.45 79.68V79.68Z" fill="#F6947E"></path> + <path d="M618.3 83.74C618.46 84.34 619.29 84.79 619.86 84.6C620.44 84.4 620.86 83.61 620.72 83.01C620.57 82.38 619.98 82.01 619.36 82.16C618.62 82.33 618.12 83.08 618.3 83.75V83.74Z" fill="#F6947E"></path> + <path d="M635.73 42.17C636.02 41.64 636.01 41.04 635.45 40.75C635.02 40.53 634.34 40.35 633.97 40.53C633.53 40.75 633.4 41.08 633.4 41.46C632.55 41.13 631.53 41.39 630.63 41.84C630.06 42.12 629.68 42.55 629.43 43.06C629.09 43.75 629.17 44.51 629.5 45.33C629.84 46.16 629.47 47.02 630.12 47.64C631 48.48 632.74 49.36 634.58 48.33C635.69 47.71 636.21 46.9 636.31 46C636.43 44.95 635.18 44.42 634.88 43.36C634.82 43.16 634.76 42.99 634.69 42.83C635.1 42.83 635.45 42.66 635.72 42.17H635.73Z" fill="#F6947E"></path> + <path d="M640.54 90.13C639.94 90.29 639.58 91.06 639.79 91.74C640 92.4 640.62 92.69 641.38 92.48C642.17 92.26 642.58 91.76 642.39 91.24C642.17 90.63 641.09 89.98 640.53 90.13H640.54Z" fill="#F6947E"></path> + <path d="M611.42 52.54C610.78 52.65 610.36 53.35 610.52 54.04C610.7 54.79 611.28 55.19 611.95 55.03C612.64 54.86 613.07 54.22 612.91 53.57C612.77 52.97 612 52.45 611.42 52.54Z" fill="#F6947E"></path> + <path d="M624.06 77.09C623.95 76.43 623.31 75.97 622.61 76.08C621.88 76.19 621.56 76.64 621.7 77.35C621.85 78.12 622.41 78.54 623.1 78.41C623.7 78.3 624.15 77.68 624.06 77.09Z" fill="#F6947E"></path> + <path d="M651.11 83.21C650.51 83.38 650.23 83.82 650.27 84.43C650.3 84.95 651.5 85.58 651.9 85.27C652.29 84.96 652.36 84.55 652.38 84.1C652.4 83.47 651.71 83.04 651.11 83.2V83.21Z" fill="#F6947E"></path> + <path d="M622.78 53.7C622.86 53.44 622.68 52.86 622.47 52.78C622.08 52.63 621.46 52.55 621.17 52.76C620.57 53.19 620.91 53.8 621.17 54.33C621.91 54.58 622.53 54.47 622.77 53.7H622.78Z" fill="#F6947E"></path> + <path d="M656.67 79.51C656.93 79.41 657.24 78.93 657.21 78.67C657.16 78.31 656.88 77.8 656.58 77.69C655.76 77.38 655.46 78.05 655.15 78.64C655.46 79.35 655.92 79.81 656.68 79.52L656.67 79.51Z" fill="#F6947E"></path> + <path d="M609.34 40.2C608.7 40.53 608.02 40.78 607.36 41.06C606.52 41.09 606.13 41.62 606.23 42.3C606.33 43.03 606.9 43.44 607.74 43.45C608.19 43.45 608.7 43.43 609.09 43.62C609.87 43.99 610.59 44 611.22 43.46C611.7 43.05 611.63 41.41 611.14 40.85C610.68 40.32 610.22 39.74 609.35 40.2H609.34Z" fill="#F6947E"></path> + <path d="M616.89 37.58C617.03 38.33 617.59 38.71 618.31 38.55C619.06 38.38 619.56 37.66 619.38 36.97C619.22 36.36 618.51 36.03 617.78 36.22C617.15 36.39 616.78 36.96 616.89 37.57V37.58Z" fill="#F6947E"></path> + <path d="M646.73 82.34C646.12 82.49 645.78 83.05 646.08 83.54C646.3 83.89 646.55 84.31 646.95 84.32C647.35 84.33 648.01 83.33 647.79 82.75C647.59 82.2 647.16 82.24 646.73 82.34V82.34Z" fill="#F6947E"></path> + <path d="M638.76 41.08C638.96 42.15 640 42.8 641.1 42.52C642.03 42.29 642.7 41.98 643.14 41.6C643.59 42.36 644.64 42.87 645.79 42.53C646.7 42.26 647.03 41.57 646.97 40.65C646.89 39.61 646.25 38.89 645.33 38.79C644.55 38.7 643.87 39.03 643.42 39.53C642.84 38.67 641.4 37.95 640.48 38.16C639.57 38.36 638.57 40.07 638.77 41.09L638.76 41.08Z" fill="#F6947E"></path> + <path d="M609.4 49.61C610 49.55 610.63 48.87 610.38 48.4C610.17 48.01 609.61 47.12 609.02 47.3C608.43 47.48 608.46 48.35 608.47 48.74C608.48 49.22 608.76 49.68 609.4 49.61V49.61Z" fill="#F6947E"></path> + <path d="M668.23 78.47C667.95 78.54 667.32 79.28 667.43 79.61C667.54 79.94 668.56 80.2 668.71 80.08C669.02 79.82 669.49 79.19 669.32 78.91C669.15 78.63 668.54 78.39 668.23 78.47Z" fill="#F6947E"></path> + <path d="M657.75 101.87C657.43 101.99 656.94 102.41 656.97 102.69C656.99 102.97 657.58 103.35 657.88 103.34C658.15 103.34 658.92 102.76 658.86 102.42C658.8 102.08 657.96 101.78 657.76 101.86L657.75 101.87Z" fill="#F6947E"></path> + <path d="M623.32 90.01C622.96 90.03 621.85 90.99 621.99 91.6C622.13 92.21 623.65 92.29 624.16 92.15C624.54 92.05 625.15 91.35 625.01 90.75C624.87 90.15 623.87 89.98 623.32 90.01V90.01Z" fill="#F6947E"></path> + <path d="M643.06 96.24C642.87 96.24 642.33 96.73 642.38 96.94C642.43 97.15 643.07 97.31 643.32 97.3C643.46 97.3 643.74 96.85 643.69 96.76C643.56 96.53 643.28 96.25 643.06 96.25V96.24Z" fill="#F6947E"></path> + <path d="M601.33 50.49C601.47 50.49 601.77 50.18 601.7 49.95C601.62 49.71 601.29 49.44 601.07 49.44C600.88 49.44 600.33 49.82 600.39 50.14C600.45 50.46 601.08 50.51 601.33 50.5V50.49Z" fill="#F6947E"></path> + <path d="M644.34 90.02C644.05 90.13 643.93 90.66 643.99 90.82C644.08 91.07 644.3 91.57 644.59 91.46C644.88 91.35 645.08 90.96 645.06 90.74C645.04 90.52 644.63 89.91 644.34 90.02Z" fill="#F6947E"></path> + <path d="M632.6 93.97C632.25 94.1 632.13 94.66 632.18 94.86C632.23 95.06 632.64 95.31 632.86 95.29C633.04 95.27 633.34 94.85 633.31 94.66C633.27 94.44 632.95 93.84 632.6 93.97V93.97Z" fill="#F6947E"></path> + <path d="M640.42 94.19C640.2 94.27 640.18 94.54 640.21 94.65C640.24 94.76 640.54 94.86 640.64 94.82C640.75 94.78 640.92 94.62 640.88 94.46C640.84 94.3 640.65 94.11 640.43 94.19H640.42Z" fill="#F6947E"></path> + <path d="M610.67 65.69C610.78 65.65 610.95 65.49 610.91 65.33C610.87 65.17 610.68 64.98 610.46 65.06C610.24 65.14 610.22 65.41 610.25 65.52C610.28 65.64 610.58 65.73 610.68 65.69H610.67Z" fill="#F6947E"></path> + <path d="M659.47 88.74C659.28 88.74 658.75 88.93 658.79 89.44C658.84 89.94 659.48 89.81 659.73 89.8C659.87 89.8 660.15 89.35 660.1 89.26C659.97 89.03 659.69 88.75 659.47 88.75V88.74Z" fill="#F6947E"></path> + <path d="M657.39 48.37C658.23 49.02 660.47 48.6 661.07 47.83C661.67 47.06 660.96 46.08 661.1 45.84C661.24 45.6 662.83 45.67 663.54 44.7C664.25 43.73 663.67 41.9 662.99 41.36C662.32 40.83 661.74 40.49 661.03 40.52C660.17 40.56 659.1 41.22 658.91 42.1C658.73 42.99 659.35 44.23 659.13 44.51C658.91 44.79 657.31 44.55 656.69 45.59C656.06 46.63 656.56 47.71 657.39 48.36V48.37Z" fill="#F6947E"></path> + <path d="M616.1 40.62C615.7 41.22 615.66 42.33 616.14 42.88C616.82 43.65 617.81 43.41 618.1 43.24C618.5 44.28 619.68 44.99 620.65 44.73C621.65 44.46 622.3 43.8 622.48 42.97C622.76 43.33 623.19 43.6 623.81 43.65C625.48 43.79 626.54 42.94 626.69 41.9C626.79 41.21 626.27 40.26 625.58 39.68C626.12 39.43 626.4 38.91 626.27 38.36C626.13 37.77 625.39 37.37 624.72 37.52C624.05 37.66 623.61 38.34 623.76 38.98C623.78 39.06 623.81 39.14 623.84 39.21C622.82 39.4 622.33 40.22 622.11 40.93C622.09 40.98 622.08 41.03 622.07 41.09C621.59 40.48 620.79 40.27 619.75 40.52C619.36 40.61 619.03 40.76 618.77 40.94C618.76 40.66 618.67 40.39 618.39 40.13C617.77 39.55 616.59 39.88 616.1 40.61V40.62Z" fill="#F6947E"></path> + <path d="M640.48 57.07C641.38 56.26 640.73 54.91 640.95 54.65C641.17 54.39 643.1 54.83 644.18 53.8C645.26 52.77 644.96 50.4 644.26 49.6C643.56 48.8 642.93 48.26 642.05 48.14C641.49 48.07 640.83 48.19 640.26 48.48C639.97 48.13 639.51 47.96 639.07 48.08C638.48 48.24 637.98 49.07 638.13 49.63C638.24 50.02 638.56 50.29 638.94 50.38C638.86 51.32 639.09 52.37 638.83 52.59C638.5 52.88 636.6 52.24 635.61 53.37C634.62 54.5 634.98 55.93 635.85 56.91C636.72 57.89 639.57 57.88 640.47 57.07H640.48Z" fill="#F6947E"></path> + <path d="M663.53 73.28C664.75 73.29 665.95 72.52 665.59 71.49C665.23 70.46 664.49 69.98 663.61 69.39C662.95 68.94 662.18 69.61 662.09 68.68C662 67.75 661.56 65.85 659.86 66.24C659.03 66.43 658.36 67.49 658.44 68.35C658.44 68.36 658.44 68.37 658.44 68.38C657.9 67.96 657.08 67.78 656.34 68.01C655.33 68.32 654.64 69.81 655 70.86C655.35 71.87 656.44 72.5 657.33 72.21C658.16 71.94 658.94 70.7 659.03 69.72C659.27 69.99 659.57 70.18 659.88 70.2C660.61 70.24 660.03 71.84 661.03 71.96C661.98 72.08 662.29 73.27 663.52 73.29L663.53 73.28Z" fill="#F6947E"></path> + <path d="M649.65 49.89C649.56 51.54 650.47 51.86 650.32 52.92C650.16 53.98 650.71 54.42 651.77 54.85C651.92 54.91 652.09 54.98 652.26 55.04C651.89 55.29 651.65 55.73 651.84 56.06C652.01 56.36 652.56 56.62 652.91 56.59C653.45 56.54 653.82 56.15 653.57 55.5C653.55 55.45 653.53 55.39 653.51 55.33C654.14 55.37 654.72 55.16 655.01 54.38C655.57 52.89 654.65 52.33 654.19 52.2C653.72 52.07 653.23 51.2 653.78 51.16C654.33 51.12 654.76 50.61 654.7 49.25C654.64 47.89 654.08 47.15 652.7 47C651.19 46.84 649.75 48.22 649.66 49.87L649.65 49.89Z" fill="#F6947E"></path> + <path d="M628.52 68.16C628.72 68.77 629.47 69.18 630.08 69.02C630.66 68.87 631.07 68.03 630.85 67.43C630.63 66.81 629.93 66.52 629.23 66.76C628.58 66.98 628.31 67.52 628.52 68.16V68.16Z" fill="#F6947E"></path> + <path d="M599.21 40.88C599.88 41.2 599.62 41.18 599.66 41.94C599.71 42.7 600.25 43.72 601.5 43.21C602.75 42.69 602.99 41.17 602.66 40.05C602.32 38.93 600.09 38.06 598.87 38.8C597.99 39.33 598.54 40.56 599.21 40.88V40.88Z" fill="#F6947E"></path> + <path d="M647.67 91.66C647.09 92.63 647.26 93.57 648.11 94.11C648.89 94.6 649.99 94.51 650.34 93.93C650.85 93.07 650.49 91.57 649.62 90.98C649.07 90.6 648.09 90.95 647.67 91.66Z" fill="#F6947E"></path> + <path d="M665.99 105.32C667.14 106.01 667.91 105.96 668.43 105.14C668.81 104.55 668.43 103.16 667.81 102.83C667.23 102.52 665.89 103 665.49 103.66C665.12 104.25 665.33 104.92 666 105.32H665.99Z" fill="#F6947E"></path> + <path d="M664.08 102.43C664.12 101.84 663.87 101.39 663.3 101.13C662.69 100.86 661.86 100.99 661.56 101.53C661.08 102.4 661.62 103.05 662.06 103.68C663.52 103.52 664.02 103.22 664.07 102.42L664.08 102.43Z" fill="#F6947E"></path> + <path d="M666.35 67.86C665.94 68.41 666.07 69.29 666.6 69.63C667.16 69.99 667.98 69.83 668.37 69.3C668.77 68.75 668.66 68.16 668.1 67.71C667.51 67.24 666.75 67.31 666.34 67.86H666.35Z" fill="#F6947E"></path> + <path d="M648.87 123.4C648.32 123 647.61 123.14 647.14 123.74C646.7 124.31 646.78 124.87 647.36 125.28C647.95 125.7 648.69 125.58 649.09 125.01C649.43 124.53 649.32 123.72 648.87 123.39V123.4Z" fill="#F6947E"></path> + <path d="M658.92 103.92C659.18 103.73 659.41 103.08 659.28 102.84C659.06 102.42 658.59 101.93 658.16 101.86C657.2 101.7 657.14 102.6 656.83 103.32C657.51 103.99 658.15 104.46 658.92 103.92V103.92Z" fill="#F6947E"></path> + <path d="M655.64 118.97C655.26 118.72 654.55 119.07 654.17 119.66C653.88 120.12 653.96 120.5 654.41 120.76C654.91 121.04 655.44 121.15 655.86 120.6C656.19 120.16 656.05 119.25 655.64 118.97Z" fill="#F6947E"></path> + <path d="M637.98 71.32C637.75 71.04 637.25 70.75 636.95 70.83C636.15 71.03 636.11 72.06 636.32 72.43C636.53 72.8 637.53 72.96 638 72.3C638.16 72.07 638.15 71.52 637.98 71.32Z" fill="#F6947E"></path> + <path d="M657.63 72.53C657.12 72.42 656.43 72.83 656.35 73.29C656.23 73.96 657.56 74.81 657.99 74.48C658.42 74.15 658.3 72.67 657.63 72.52V72.53Z" fill="#F6947E"></path> + <path d="M643.59 98.14C643.15 97.8 641.92 98.26 641.85 98.68C641.78 99.09 642.14 99.5 642.48 99.8C642.85 100.13 643.4 100.17 643.71 99.6C643.98 99.1 644.13 98.58 643.58 98.15L643.59 98.14Z" fill="#F6947E"></path> + <path d="M658.93 78.21C658.07 77.68 656.81 77.8 656.4 78.46C655.98 79.12 656.37 80.69 657.05 81.11C658.08 81.74 659.05 81.54 659.57 80.6C660.09 79.67 659.85 78.78 658.93 78.21Z" fill="#F6947E"></path> + <path d="M649.79 82.74C649.53 83.05 649.94 83.86 650.16 84.13C650.49 84.54 651.41 84.37 651.54 83.87C651.62 83.55 651.43 83.01 651.17 82.81C650.92 82.62 650.06 82.43 649.79 82.73V82.74Z" fill="#F6947E"></path> + <path d="M645.03 60.78C645.57 60.81 646.28 60.97 646.67 60.48C647.06 59.99 646.48 59.48 646.24 59.4C645.77 59.24 644.58 59.05 644.3 59.43C644.01 59.81 644.84 60.78 645.03 60.79V60.78Z" fill="#F6947E"></path> + <path d="M661.46 113.72C661.52 114.18 662.11 114.24 662.55 113.93C662.91 113.67 663.31 113.04 663.29 112.62C663.27 112.03 662.78 111.96 662.61 111.99C662.24 112.07 662.04 112.4 661.84 112.74C661.65 113.05 661.4 113.32 661.45 113.71L661.46 113.72Z" fill="#F6947E"></path> + <path d="M670.19 78.67C670.25 77.99 669.57 77.29 668.6 77.04C668.29 76.96 667.97 76.91 667.63 76.85C667.37 76.08 667.19 75.24 666.59 74.79C666.69 74.62 666.77 74.44 666.84 74.26C667.18 73.4 666.33 71.88 665.43 71.72C664.53 71.56 663 72.48 662.99 73.79C662.99 74.58 663.22 75.15 663.59 75.56C663.52 75.64 663.45 75.73 663.39 75.82C662.6 76.88 663.05 77.77 663.79 78.63C663.31 79.16 662.51 79.52 663.05 80.41C663.39 80.97 663.9 81.14 664.46 80.97C665.44 80.67 665.26 79.84 665.15 79.08C665.58 78.9 665.97 78.74 666.37 78.58C666.63 79.14 666.85 79.63 667.09 80.14C667.58 80.18 668.02 80.29 668.45 80.24C669.13 80.17 670.16 79.19 670.2 78.67H670.19Z" fill="#F6947E"></path> + <path d="M653.51 77.51C654.59 76.51 654.34 75.16 653.02 74.68C652.21 74.38 651.32 74.24 650.45 74.16C649.53 74.08 648.45 75.14 648.27 76.08C648.17 76.64 648.39 77.89 649.56 77.83C651.23 76.79 651.5 78.17 652.93 77.83C653.18 77.77 653.41 77.57 653.51 77.51V77.51Z" fill="#F6947E"></path> + <path d="M664.58 117.34C663.56 116.62 662.31 116.84 661.6 117.86C660.9 118.87 661.22 120.57 662.23 121.23C663.14 121.82 664.79 121.48 665.49 120.56C666.22 119.59 665.85 118.25 664.58 117.35V117.34Z" fill="#F6947E"></path> + <path d="M663.19 92.25C663.64 91.52 663.29 89.75 662.61 89.3C661.87 88.82 660.68 89.11 660.13 89.91C659.6 90.68 659.81 92.07 660.54 92.55C661.41 93.12 662.75 92.96 663.2 92.25H663.19Z" fill="#F6947E"></path> + <path d="M668.81 107.83C668.19 107.72 667.19 107.45 666.18 107.38C665.55 107.34 664.97 107.75 664.95 108.46C664.93 109.09 665.2 109.62 665.94 109.77C666.3 109.84 666.66 109.98 666.98 110.16C667.91 110.68 668.63 110.63 669.35 109.96C670.04 109.32 669.97 108.57 668.81 107.82V107.83Z" fill="#F6947E"></path> + <path d="M649.16 65.34C648.25 64.78 647.23 64.89 646.83 65.6C646.32 66.52 646.65 67.93 647.54 68.57C648.14 69 649.31 68.57 649.78 67.75C650.32 66.8 650.09 65.92 649.16 65.34V65.34Z" fill="#F6947E"></path> + <path d="M656.21 93.31C655.55 92.88 654.05 93.27 653.58 93.99C653.21 94.55 653.58 95.88 654.22 96.33C654.75 96.71 655.81 96.57 656.14 96.09C656.9 94.98 656.93 93.77 656.21 93.31V93.31Z" fill="#F6947E"></path> + <path d="M652.7 85.67C651.96 85.19 651.19 85.25 650.78 85.81C650.33 86.43 650.54 88.15 651.1 88.54C651.91 89.1 652.83 88.84 653.47 87.86C653.96 87.12 653.67 86.29 652.7 85.67V85.67Z" fill="#F6947E"></path> + <path d="M653.64 105.51C654 104.97 653.71 103.96 653.11 103.65C652.29 103.22 651.25 103.37 650.88 103.98C650.43 104.73 650.64 106.16 651.26 106.56C651.8 106.91 653.1 106.34 653.64 105.51Z" fill="#F6947E"></path> + <path d="M664.98 83.93C664.38 83.5 663.08 83.78 662.61 84.45C662.25 84.97 662.38 85.6 662.95 86.03C663.64 86.55 664.68 86.46 665.18 85.84C665.64 85.27 665.54 84.35 664.98 83.93Z" fill="#F6947E"></path> + <path d="M666.41 97.87C667.38 98.47 668.12 98.53 668.49 98.01C668.91 97.42 668.63 96.09 667.99 95.62C667.47 95.25 666.28 95.66 665.88 96.35C665.57 96.89 665.76 97.46 666.41 97.86V97.87Z" fill="#F6947E"></path> + <path d="M660.84 65.33C661.14 64.78 660.8 63.81 660.21 63.51C659.63 63.22 658.84 63.47 658.51 64.05C658.17 64.64 658.37 65.3 659.02 65.72C659.69 66.15 660.49 65.98 660.84 65.33Z" fill="#F6947E"></path> + <path d="M640.27 78.1C639.65 77.72 638.87 77.91 638.43 78.55C638 79.17 638.19 79.94 638.87 80.37C639.39 80.7 640.22 80.5 640.58 79.95C641.03 79.26 640.91 78.48 640.28 78.1H640.27Z" fill="#F6947E"></path> + <path d="M660.63 97.39C660.38 97.92 660.11 98.51 660.63 98.85C661.55 99.4 662.34 99.32 662.7 98.76C663.16 98.07 662.95 97.16 662.26 96.8C661.65 96.49 660.95 96.72 660.64 97.39H660.63Z" fill="#F6947E"></path> + <path d="M648.64 96.82C648.07 96.46 647.12 96.7 646.77 97.29C646.45 97.83 646.6 98.49 647.14 98.86C647.82 99.33 648.61 99.21 649 98.57C649.34 98.02 649.16 97.14 648.65 96.82H648.64Z" fill="#F6947E"></path> + <path d="M636.8 89.79C636.47 90.31 636.69 91.23 637.22 91.52C637.75 91.81 638.63 91.6 638.97 91.09C639.33 90.55 639.21 89.87 638.69 89.51C638.06 89.07 637.17 89.2 636.8 89.79Z" fill="#F6947E"></path> + <path d="M647 110.57C646.48 110.23 645.67 110.48 645.31 111.09C644.96 111.68 645.16 112.34 645.83 112.77C646.52 113.21 647.17 113.17 647.42 112.69C647.73 112.11 647.48 110.89 647 110.57Z" fill="#F6947E"></path> + <path d="M655.31 63.75C654.8 63.35 654 63.51 653.6 64.09C653.16 64.72 653.25 65.42 653.82 65.81C654.41 66.21 655.17 66.09 655.55 65.54C655.9 65.03 655.77 64.11 655.31 63.75V63.75Z" fill="#F6947E"></path> + <path d="M645.59 89.6C646.01 89.08 645.91 88.29 645.37 87.85C644.8 87.39 644.25 87.45 643.82 88.02C643.36 88.65 643.42 89.34 643.97 89.77C644.45 90.14 645.22 90.06 645.59 89.6Z" fill="#F6947E"></path> + <path d="M659.22 113.76C658.7 113.43 658.18 113.52 657.76 113.96C657.4 114.33 657.73 115.65 658.23 115.73C658.72 115.81 659.07 115.59 659.41 115.3C659.89 114.89 659.75 114.09 659.23 113.76H659.22Z" fill="#F6947E"></path> + <path d="M662.07 72.95C662.32 72.83 662.62 72.31 662.54 72.11C662.39 71.72 662.03 71.21 661.68 71.13C660.95 70.97 660.73 71.64 660.52 72.18C660.84 72.9 661.33 73.28 662.06 72.94L662.07 72.95Z" fill="#F6947E"></path> + <path d="M665.69 115.39C665.94 115.52 666.5 115.42 666.68 115.22C666.92 114.94 667.1 114.39 666.98 114.09C666.66 113.28 665.96 113.51 665.32 113.67C665 114.38 664.97 115.03 665.69 115.39Z" fill="#F6947E"></path> + <path d="M663.05 53.92C662.38 53.67 661.74 53.33 661.09 53.03C660.51 52.42 659.86 52.49 659.41 53.03C658.93 53.59 659.01 54.29 659.57 54.92C659.87 55.26 660.23 55.62 660.35 56.03C660.6 56.85 661.07 57.4 661.9 57.5C662.53 57.58 663.69 56.43 663.78 55.69C663.86 54.99 663.98 54.26 663.06 53.92H663.05Z" fill="#F6947E"></path> + <path d="M656.92 109.93C656.4 109.58 655.75 109.7 655.59 110.26C655.47 110.66 655.33 111.13 655.59 111.43C655.85 111.73 657.04 111.55 657.32 111C657.59 110.48 657.28 110.19 656.91 109.94L656.92 109.93Z" fill="#F6947E"></path> + <path d="M666.33 48.85C667.05 49.25 667.78 48.97 668.06 48.42C668.33 47.9 668.02 47.61 667.65 47.36C667.13 47.01 666.48 47.13 666.32 47.69C666.2 48.09 666.32 48.56 666.32 48.86L666.33 48.85Z" fill="#F6947E"></path> + <path d="M656.12 60.29C656.57 60.69 657.49 60.71 657.67 60.2C657.82 59.78 658.11 58.77 657.57 58.46C657.04 58.15 656.42 58.75 656.13 59.01C655.78 59.34 655.63 59.85 656.11 60.29H656.12Z" fill="#F6947E"></path> + <path d="M662.76 136.89C662.4 136.71 661.36 136.54 661.18 136.84C661 137.14 661.41 138.04 661.66 138.38C662 138.83 662.61 138.65 663.03 138.11C663.46 137.57 663.19 137.1 662.76 136.89V136.89Z" fill="#F6947E"></path> + <path d="M649.84 131.21C649.53 131.06 648.9 130.97 648.71 131.18C648.52 131.39 648.63 132.08 648.84 132.29C649.03 132.49 649.97 132.67 650.17 132.4C650.37 132.13 650.03 131.3 649.84 131.21V131.21Z" fill="#F6947E"></path> + <path d="M635.52 97.72C635.26 97.46 633.81 97.28 633.45 97.8C633.09 98.32 634.06 99.49 634.5 99.78C634.83 99.99 635.75 99.98 636.11 99.47C636.46 98.96 635.91 98.11 635.52 97.72V97.72Z" fill="#F6947E"></path> + <path d="M644.16 116.53C644.04 116.39 643.31 116.32 643.19 116.5C643.07 116.68 643.38 117.26 643.56 117.44C643.66 117.54 644.17 117.45 644.21 117.35C644.3 117.1 644.31 116.7 644.16 116.54V116.53Z" fill="#F6947E"></path> + <path d="M650.05 54.9C650.15 55 650.57 55.02 650.7 54.81C650.83 54.59 650.8 54.16 650.65 54C650.53 53.86 649.87 53.71 649.68 53.97C649.49 54.23 649.87 54.73 650.05 54.91V54.9Z" fill="#F6947E"></path> + <path d="M649.62 113.31C649.34 113.17 648.87 113.43 648.79 113.59C648.66 113.83 648.45 114.33 648.72 114.47C648.99 114.61 649.42 114.5 649.57 114.33C649.72 114.17 649.9 113.45 649.62 113.31V113.31Z" fill="#F6947E"></path> + <path d="M638.81 107.26C638.48 107.09 637.98 107.37 637.87 107.55C637.76 107.73 637.84 108.19 638.01 108.34C638.15 108.46 638.66 108.4 638.78 108.25C638.92 108.07 639.15 107.43 638.82 107.26H638.81Z" fill="#F6947E"></path> + <path d="M668.51 43.95C668.76 44.14 669.18 43.95 669.33 43.79C669.47 43.63 669.63 42.95 669.38 42.78C669.13 42.61 668.53 42.93 668.42 43.11C668.3 43.3 668.26 43.77 668.51 43.95V43.95Z" fill="#F6947E"></path> + <path d="M658.54 41.39C658.43 41.48 658.3 42.05 658.58 42.25C658.86 42.45 659.31 42.03 659.47 41.84C659.57 41.72 659.54 41.28 659.35 41.15C659.16 41.02 658.74 41.22 658.55 41.39H658.54Z" fill="#F6947E"></path> + <path d="M643.9 113.2C643.69 113.09 643.48 113.25 643.41 113.35C643.34 113.45 643.48 113.73 643.57 113.78C643.67 113.83 643.91 113.85 644 113.71C644.09 113.57 644.1 113.31 643.9 113.19V113.2Z" fill="#F6947E"></path> + <path d="M645.06 72.03C645.16 72.08 645.4 72.1 645.49 71.96C645.58 71.82 645.59 71.56 645.39 71.44C645.18 71.33 644.97 71.49 644.9 71.59C644.83 71.69 644.97 71.97 645.06 72.02V72.03Z" fill="#F6947E"></path> + <path d="M660.73 123.67C660.61 123.53 660.1 123.26 659.76 123.64C659.42 124.01 659.95 124.4 660.13 124.58C660.23 124.68 660.74 124.59 660.78 124.49C660.87 124.24 660.88 123.84 660.73 123.68V123.67Z" fill="#F6947E"></path> + <path d="M655.21 86.91C654.89 87.47 655.09 88.3 655.62 88.64C656.12 88.97 657.02 88.71 657.32 88.15C657.63 87.57 657.38 86.86 656.73 86.5C656.13 86.17 655.54 86.33 655.21 86.92V86.91Z" fill="#F6947E"></path> + <path d="M655.75 46.87C655.96 47.58 655.8 47.37 655.27 47.92C654.74 48.47 654.35 49.55 655.57 50.13C656.79 50.71 658.08 49.87 658.69 48.87C659.29 47.87 658.44 45.63 657.07 45.22C656.08 44.93 655.55 46.15 655.76 46.87H655.75Z" fill="#F6947E"></path> + <path d="M669.37 131.95C669.3 131.28 668.72 130.84 667.96 130.89C667.24 130.94 666.88 131.37 666.96 132.08C667.04 132.8 667.62 133.27 668.31 133.19C668.89 133.12 669.42 132.5 669.37 131.95Z" fill="#F6947E"></path> + <path d="M664.18 137.87C664.09 137.54 663.73 137.01 663.45 137.01C663.17 137.01 662.73 137.55 662.71 137.84C662.69 138.11 663.18 138.94 663.52 138.91C663.86 138.88 664.25 138.08 664.19 137.87H664.18Z" fill="#F6947E"></path> + <path d="M302.56 393.46C303.61 393.66 304.72 392.64 304.97 391.26C305.15 390.28 304.55 389.49 303.46 389.28C302.17 389.03 301.03 389.86 300.85 391.18C300.71 392.18 301.52 393.27 302.56 393.47V393.46Z" fill="#FEC618"></path> + <path d="M331.74 379.21C332.19 379 332.73 378.84 333.15 378.52C333.88 377.98 334.14 376.98 333.82 376.35C333.67 376.05 333.46 375.8 333.22 375.6C333.03 375.08 332.7 374.61 332.3 374.27C331.62 373.69 330.1 373.83 329.14 374.49C328.93 373.94 328.49 373.53 328.07 373.25C327.55 372.91 326.55 372.74 325.79 373.19C325.92 372.93 325.65 372.5 325.5 372.33C325.4 372.21 324.96 372.17 324.8 372.33C324.64 372.5 324.77 372.94 324.9 373.16C324.95 373.25 325.27 373.4 325.53 373.37C325.31 373.56 325.12 373.81 325 374.15C324.42 375.72 324.95 376.98 325.91 377.4C326.71 377.75 328.14 377.29 328.82 376.5C329.13 376.73 329.53 376.86 329.86 376.82C330.15 376.78 330.29 376.78 330.38 376.83C330.29 377.72 330.71 378.51 331.77 379.19L331.74 379.21Z" fill="#FEC618"></path> + <path d="M291.5 373.23C291.39 373.9 292.28 375.54 292.83 375.66C293.79 375.89 294.68 375.2 294.89 374.06C295.05 373.2 294.49 372.58 293.33 372.34C292.38 372.14 291.62 372.52 291.5 373.23V373.23Z" fill="#FEC618"></path> + <path d="M338.96 374.57C339.01 374.36 339.03 374.18 339.03 374.02C339.22 373.92 339.42 373.84 339.62 373.81C340.47 373.7 341.09 373.32 341.33 372.52C341.51 371.91 340.57 370.57 339.85 370.37C339.18 370.18 338.47 369.94 337.99 370.79C337.63 371.41 337.19 371.99 336.79 372.58C336.73 372.62 336.68 372.67 336.62 372.71C336.12 372.82 335.77 373.13 335.68 373.62C335.54 374.32 336.48 375.86 337.1 375.97C338 376.13 338.69 375.6 338.95 374.56L338.96 374.57Z" fill="#FEC618"></path> + <path d="M351.54 382.71C350.61 382.54 350.01 383.06 349.83 384.18C349.7 384.97 350.01 385.6 350.61 385.75C351.32 385.93 352.87 385.09 353 384.45C353.19 383.53 352.67 382.9 351.54 382.7V382.71Z" fill="#FEC618"></path> + <path d="M358.6 377.68C358.83 376.8 358.36 375.77 357.7 375.64C356.96 375.49 355.84 376.07 355.7 376.68C355.53 377.43 356.33 378.28 357.41 378.49C358.08 378.62 358.44 378.27 358.6 377.68Z" fill="#FEC618"></path> + <path d="M347.99 394.16C348.24 394.11 348.59 394.06 348.66 393.68C348.73 393.3 348.41 393.14 348.26 393.13C348.01 393.13 347.5 393.13 347.37 393.55C347.24 393.96 347.86 394.18 347.99 394.16V394.16Z" fill="#FEC618"></path> + <path d="M350.05 373.34C350.28 372.85 349.78 371.6 349.26 371.35C348.81 371.13 347.78 371.64 347.5 372.22C347.26 372.72 347.53 373.27 348.13 373.49C349.09 373.86 349.84 373.8 350.06 373.34H350.05Z" fill="#FEC618"></path> + <path d="M332.07 397.31C332.07 397.56 331.99 397.95 332.38 398.07C332.77 398.19 332.95 397.88 332.97 397.73C333.02 397.49 333.08 396.87 332.73 396.77C332.38 396.67 332.07 397.16 332.06 397.31H332.07Z" fill="#FEC618"></path> + <path d="M299.94 371.46C299.99 371.21 299.88 370.65 299.68 370.26C300.19 370.26 300.55 370.11 300.76 369.81H293.56C293.63 369.92 293.72 370.04 293.85 370.14C295.8 371.84 296.56 371.85 298.5 370.18C298.54 370.15 298.59 370.12 298.67 370.08H298.69C298.43 370.33 298.2 370.68 298.1 370.89C297.88 371.36 298 371.87 298.62 372.06C299.25 372.25 299.83 372 299.94 371.44V371.46Z" fill="#FEC618"></path> + <path d="M316.14 369.81H313.08C313.75 370.86 314.84 371.03 315.8 370.18C315.92 370.08 316.02 369.95 316.14 369.81Z" fill="#FEC618"></path> + <path d="M319.16 371.84C319.42 371.87 319.66 372.04 319.91 372.14C320.75 372.5 321.39 372.39 321.62 371.85C321.94 371.12 321.52 370.48 320.52 370.21C320.42 370.18 320.29 370.26 320.2 370.23C319.93 370.13 319.76 369.99 319.7 369.81H317.37C317.44 369.93 317.5 370.05 317.51 370.16C317.56 371.27 318.16 371.71 319.17 371.83L319.16 371.84Z" fill="#FEC618"></path> + <path d="M319.49 401.65C320.27 401.93 320.91 401.56 321.38 401C321.72 400.6 321.91 400.06 322.18 399.56C322.44 399.53 322.71 399.51 322.97 399.45C323.95 399.22 324.87 398.35 324.92 397.48C324.97 396.43 324.46 395.57 323.63 394.97C323.36 394.77 322.89 394.7 322.55 394.78C321.24 395.1 320.59 396.1 320.74 397.44C320.77 397.71 320.81 397.97 320.84 398.25C320.32 398.31 319.82 398.32 319.34 398.42C318.42 398.61 318.13 398.99 318.19 399.91C318.25 400.76 318.69 401.36 319.48 401.65H319.49Z" fill="#FEC618"></path> + <path d="M290.95 391.82C292.19 392.33 292.76 392.08 293.19 390.8C293.51 389.84 293.88 388.89 294.22 387.95C296.02 388.44 296.2 388.31 296.27 386.72C295.52 386.1 294.87 386.28 294.24 387C292.18 385.93 291.12 386.75 291.2 389.22C291.07 389.3 290.94 389.4 290.79 389.45C290.14 389.67 290.03 390.16 290.07 390.76C290.11 391.34 290.44 391.6 290.95 391.81V391.82Z" fill="#FEC618"></path> + <path d="M306.62 385.61C307.71 385.87 308.73 385.12 308.98 383.88C309.3 382.26 308.71 381.31 307.13 380.94C305.93 380.66 304.56 381.63 304.35 382.92C304.19 383.94 305.34 385.3 306.61 385.61H306.62Z" fill="#FEC618"></path> + <path d="M309.38 378.77C309.11 379.79 310.04 381.06 311.23 381.31C312.32 381.54 313.84 380.6 314.06 379.56C314.32 378.3 313.62 377.01 312.56 376.81C311.54 376.62 309.64 377.78 309.37 378.77H309.38Z" fill="#FEC618"></path> + <path d="M291.76 378.95C291.99 377.78 291.42 376.87 290.3 376.63C289.08 376.37 287.69 377.35 287.51 378.61C287.37 379.56 288.32 380.83 289.32 381.05C290.46 381.29 291.47 380.42 291.76 378.96V378.95Z" fill="#FEC618"></path> + <path d="M332.64 369.81H329.96C330.21 369.98 330.5 370.1 330.84 370.13C331.75 370.21 332.28 370.13 332.64 369.81Z" fill="#FEC618"></path> + <path d="M317.26 393.56C318.18 393.84 319.41 392.98 319.71 391.84C319.91 391.09 319.37 390.32 318.44 390.06C317.49 389.79 316.11 390.33 315.9 391.04C315.62 392.02 316.29 393.26 317.26 393.56Z" fill="#FEC618"></path> + <path d="M346.02 382.09C346.24 382.12 346.47 382.06 346.69 381.95C347.2 382.3 347.79 382.29 348.2 381.86C348.69 381.35 348.7 380.57 348.22 380.11C348.15 380.04 348.05 380 347.96 379.95C348 379.11 347.41 378.55 346.29 378.4C345.6 378.3 344.68 378.93 344.57 379.59C344.43 380.37 345.38 382.01 346.02 382.09V382.09Z" fill="#FEC618"></path> + <path d="M310.18 397.21C311.08 397.46 311.69 396.99 311.99 395.83C312.19 395.04 311.73 393.91 311.13 393.73C310.29 393.48 308.97 394.24 308.77 395.08C308.57 395.91 309.27 396.96 310.17 397.21H310.18Z" fill="#FEC618"></path> + <path d="M300.93 380.66C301.58 380.79 302.91 379.55 303.03 378.71C303.11 378.11 302.47 377.25 301.86 377.12C300.8 376.89 299.83 377.4 299.68 378.28C299.5 379.32 300.11 380.49 300.94 380.66H300.93Z" fill="#FEC618"></path> + <path d="M315.21 385.11C315.21 384.25 314.45 384.03 313.7 383.75C313.14 384.32 312.42 384.81 312.92 385.69C312.96 385.76 313.02 385.83 313.1 385.9C312.48 386.24 311.81 387.04 311.72 387.68C311.63 388.34 312.09 388.9 312.82 389.03C313.92 389.22 314.89 388.71 315.02 387.88C315.12 387.23 314.94 386.62 314.59 386.22C315 386.03 315.22 385.59 315.22 385.12L315.21 385.11Z" fill="#FEC618"></path> + <path d="M308.1 371.62C308.92 371.82 310.25 370.99 310.41 370.19C310.43 370.06 310.43 369.94 310.41 369.82H306.93C306.96 370.5 307.59 371.5 308.1 371.62Z" fill="#FEC618"></path> + <path d="M344.67 376.51C344.85 375.25 344.45 374.33 343.66 374.21C342.9 374.1 341.75 375.05 341.67 375.86C341.65 376.11 341.8 376.43 342.02 376.73C341.84 376.74 341.67 376.79 341.56 376.93C341.16 377.4 341.65 378.12 341.87 378.44C342.14 378.84 342.62 379.08 343.12 378.67C343.44 378.42 343.61 377.93 343.55 377.55C344.07 377.44 344.59 376.98 344.66 376.5L344.67 376.51Z" fill="#FEC618"></path> + <path d="M306.72 404.25C307.57 404.47 308.71 403.96 308.95 403.26C309.19 402.53 308.45 401.62 307.36 401.3C306.79 401.13 305.97 401.61 305.8 402.21C305.57 403 306.06 404.08 306.73 404.25H306.72Z" fill="#FEC618"></path> + <path d="M282.99 373.79C283.1 372.79 281.94 372.05 281.54 372.02C281.54 372.02 281.52 372.02 281.51 372.02V374.85C281.58 374.85 281.65 374.87 281.73 374.87C282.42 374.81 282.91 374.47 282.99 373.79V373.79Z" fill="#FEC618"></path> + <path d="M305.25 378.5C305.82 378.62 306.92 378.05 307.03 377.58C307.16 377.01 306.56 376.09 305.97 375.93C305.22 375.73 304.53 376.17 304.38 376.93C304.25 377.58 304.69 378.38 305.26 378.49L305.25 378.5Z" fill="#FEC618"></path> + <path d="M354.44 381.94C354.32 382.53 354.92 383.6 355.4 383.67C356.06 383.76 357.01 383.07 357.11 382.42C357.2 381.77 356.71 381.16 356.01 381.04C355.33 380.93 354.56 381.38 354.45 381.94H354.44Z" fill="#FEC618"></path> + <path d="M353.36 377.4C353.18 377.09 352.68 376.82 352.3 376.81C352.05 376.8 351.65 377.19 351.52 377.49C351.27 378.08 351.15 378.72 351.01 379.35C350.89 379.89 351.18 380.17 351.78 380.26C351.91 380.17 352.2 380.08 352.24 379.92C352.41 379.28 352.87 378.97 353.33 378.58C353.54 378.4 353.53 377.71 353.35 377.4H353.36Z" fill="#FEC618"></path> + <path d="M342.83 370.54C343.28 370.57 343.62 370.26 343.72 369.81H341.6C341.9 370.18 342.41 370.52 342.82 370.54H342.83Z" fill="#FEC618"></path> + <path d="M287.42 372.89C288.13 372.99 288.85 372.43 288.92 371.74C288.98 371.1 288.47 370.42 287.86 370.34C287.27 370.26 286.56 370.81 286.45 371.44C286.33 372.12 286.79 372.8 287.43 372.89H287.42Z" fill="#FEC618"></path> + <path d="M326.28 370.23C326.45 370.13 326.57 369.98 326.66 369.81H323.84C324.08 369.97 324.37 370.06 324.67 370.15C325.19 370.3 325.65 370.62 326.27 370.24L326.28 370.23Z" fill="#FEC618"></path> + <path d="M320.38 386.98C319.83 387.36 319.69 388.03 320.08 388.57C320.32 388.9 320.89 389.24 321.24 389.18C322.13 389 322.32 388.24 322.27 387.36C321.71 386.92 321.09 386.49 320.39 386.98H320.38Z" fill="#FEC618"></path> + <path d="M297.91 399.54C298.29 399.52 298.82 399.31 298.99 399.02C299.48 398.18 298.98 397.58 298.15 397.02C297.46 397.39 296.67 397.59 296.79 398.53C296.87 399.13 297.29 399.57 297.91 399.54Z" fill="#FEC618"></path> + <path d="M350.71 397.1C350.94 396.33 350.43 395.31 349.79 395.29C349.15 395.27 348.13 397.04 348.47 397.68C348.81 398.32 350.48 397.87 350.71 397.1Z" fill="#FEC618"></path> + <path d="M297.53 383.14C297.7 382.4 296.72 382.04 296.31 381.79C295.85 381.51 295.28 381.94 295.13 382.57C294.96 383.24 295.21 383.73 295.87 383.73C296.33 383.73 297.37 383.89 297.53 383.15V383.14Z" fill="#FEC618"></path> + <path d="M329.22 381.5C329.39 380.96 329 380.21 328.22 379.97C327.97 380.23 327.52 380.53 327.34 380.95C327.11 381.48 327.48 381.9 328.03 382.01C328.51 382.11 329.03 382.12 329.23 381.5H329.22Z" fill="#FEC618"></path> + <path d="M287.96 392.61C287.84 393.09 287.96 393.71 288.57 393.73C288.97 393.73 289.63 393.4 289.71 393.1C289.81 392.73 289.42 392.23 289.3 391.92C288.39 391.72 288.08 392.13 287.96 392.61Z" fill="#FEC618"></path> + <path d="M364.73 383.2C364.04 383.21 363.39 384.13 363.83 384.82C364.03 385.13 364.89 385.04 365.45 385.06C365.6 385.06 365.97 385.09 366.04 384.6C366.12 384.11 365.43 383.19 364.73 383.2V383.2Z" fill="#FEC618"></path> + <path d="M329.34 394.39C329.49 393.37 328.27 392.99 327.78 393.3C327.37 393.56 327.23 394.35 327.52 394.76C327.89 395.27 328.31 395.2 329.34 394.4V394.39Z" fill="#FEC618"></path> + <path d="M326.56 403.52C326.71 402.5 325.49 402.12 325 402.43C324.59 402.69 324.45 403.48 324.74 403.89C325.11 404.4 326.25 404.49 326.56 403.53V403.52Z" fill="#FEC618"></path> + <path d="M371.23 371.56C371.28 371.33 370.94 371.02 370.71 370.9C370.59 370.83 370.01 370.92 369.92 371.26C369.83 371.6 370.39 371.86 370.63 371.93C370.78 371.98 371.18 371.79 371.23 371.56Z" fill="#FEC618"></path> + <path d="M283.55 389.57C283.52 389.87 283.78 390.23 283.99 390.31C284.2 390.39 284.93 390.29 284.95 389.98C284.97 389.67 284.56 389.33 284.38 389.31C284.11 389.28 283.57 389.27 283.54 389.57H283.55Z" fill="#FEC618"></path> + <path d="M334.19 380.85C334.06 381.19 334.15 381.42 334.5 381.53C334.84 381.67 335.06 381.55 335.18 381.21C335.29 380.89 335.21 380.68 334.89 380.56C334.56 380.44 334.33 380.5 334.2 380.85H334.19Z" fill="#FEC618"></path> + <path d="M326.41 381.04C326.29 380.42 325.98 379.93 325.56 379.56C324.99 379.05 324.23 378.92 323.35 379.02C322.46 379.12 321.73 378.54 320.96 379C319.91 379.62 318.59 381.06 319.09 383.11C319.39 384.35 320.03 385.07 320.87 385.41C321.85 385.81 322.69 384.75 323.8 384.74C326.41 384.72 326.75 382.78 326.42 381.05L326.41 381.04Z" fill="#FEC618"></path> + <path d="M319.35 376.7C320.26 376.53 321.09 375 320.75 374.15C320.41 373.3 318.81 372.5 317.69 373.19C316.57 373.88 316.29 374.83 316.48 375.72C316.67 376.61 318.1 376.93 319.35 376.7Z" fill="#FEC618"></path> + <path d="M339.23 387.35C339.64 387.58 340.51 387.84 341.1 387.46C341.68 387.08 342.48 386.91 342.61 386.33C342.73 385.8 342.61 385.55 342.42 385.26C342.24 384.97 342.18 384.59 341.69 384.32C341.2 384.05 340.16 383.79 339.42 384.19C338.69 384.6 338.34 385.22 338.33 385.92C338.33 386.62 338.81 387.12 339.23 387.35V387.35Z" fill="#FEC618"></path> + <path d="M339.32 378.06C339.05 378.11 338.72 378.56 338.74 378.85C338.76 379.14 339.25 379.29 339.53 379.23C339.76 379.18 340.11 378.81 340 378.5C339.89 378.19 339.59 378.01 339.32 378.06V378.06Z" fill="#FEC618"></path> + <path d="M333.77 390.67C334.57 391.02 335.15 390.9 335.62 390.15C336.13 389.33 335.74 388.12 334.82 387.6C333.9 387.08 333.46 387.52 332.89 387.14C332.32 386.75 331.92 386.95 331.37 387.44C330.83 387.93 330.03 388.69 330.73 389.43C331.43 390.17 332.01 389.8 332.21 389.57C332.41 389.34 333.05 389.3 332.92 389.62C332.79 389.94 332.96 390.34 333.76 390.68L333.77 390.67Z" fill="#FEC618"></path> + <path d="M342.24 396.67C342.27 397.82 342.78 398.81 343.44 398.87C343.99 398.92 344.44 398.66 344.66 398.12C345.07 397.15 344.9 396.74 343.91 395.99C343.79 395.14 343.76 394.37 343.55 393.64C343.35 392.92 342.38 392.75 342.05 393.4C341.66 394.17 341 394.9 341.23 395.95C341.55 396.18 341.89 396.42 342.22 396.67H342.24Z" fill="#FEC618"></path> + <path d="M384.32 370.67C385.38 370.73 385.87 371.32 386.21 372C386.87 372.64 387.92 372.82 388.44 372.46C388.67 372.3 388.86 371.94 388.98 371.53C389.88 371.63 390.78 371.14 391.14 370.29C391.21 370.13 391.26 369.98 391.29 369.82H383.56C383.64 370.27 383.9 370.65 384.32 370.68V370.67Z" fill="#FEC618"></path> + <path d="M409.83 376.67C410.37 377.11 411.48 377.05 411.92 376.55C412.45 375.96 412.49 374.06 411.98 373.66C411.34 373.15 410.05 373.46 409.34 374.28C408.7 375.02 408.87 375.88 409.83 376.66V376.67Z" fill="#FEC618"></path> + <path d="M375.17 392.15C375.78 391.46 375.88 390.36 375.36 389.92C374.6 389.27 373.06 389.38 372.33 390.14C371.87 390.62 372.04 391.64 372.68 392.18C373.54 392.91 374.5 392.9 375.17 392.15V392.15Z" fill="#FEC618"></path> + <path d="M387.02 374.17C386.62 374.69 386.87 376.09 387.45 376.6C387.97 377.06 388.66 376.97 389.18 376.37C390.05 375.35 390.12 374.58 389.4 373.94C388.88 373.47 387.45 373.61 387.02 374.17V374.17Z" fill="#FEC618"></path> + <path d="M386.92 379.97C387 378.51 386.78 377.96 386.01 377.78C385.44 377.64 384.95 377.81 384.6 378.33C384.23 378.89 384.23 379.73 384.71 380.11C385.49 380.72 386.22 380.3 386.92 379.97V379.97Z" fill="#FEC618"></path> + <path d="M406.09 370.46C405.96 370.24 405.85 370.02 405.73 369.81H403.65C403.56 369.99 403.5 370.19 403.48 370.42C403.45 370.99 403.68 371.37 404.22 371.52C405.14 371.78 405.61 371.2 406.09 370.45V370.46Z" fill="#FEC618"></path> + <path d="M404.18 396.23C403.7 396.7 403.72 397.43 404.23 397.99C404.72 398.52 405.28 398.53 405.79 398.02C406.3 397.51 406.31 396.76 405.81 396.27C405.39 395.86 404.57 395.83 404.18 396.22V396.23Z" fill="#FEC618"></path> + <path d="M400.93 388.82C400.62 389.15 400.84 389.91 401.37 390.38C401.77 390.74 402.17 390.72 402.49 390.32C402.85 389.87 403.05 389.37 402.57 388.86C402.19 388.46 401.27 388.45 400.93 388.81V388.82Z" fill="#FEC618"></path> + <path d="M351.85 400.21C352.26 400.07 352.58 399.1 352 398.53C351.8 398.33 351.26 398.25 351.03 398.39C350.72 398.57 350.35 399.02 350.38 399.33C350.45 400.15 351.45 400.36 351.86 400.22L351.85 400.21Z" fill="#FEC618"></path> + <path d="M355.45 379.21C355.26 379.69 355.55 380.44 355.99 380.6C356.63 380.83 357.69 379.66 357.44 379.18C357.19 378.7 355.71 378.58 355.45 379.21V379.21Z" fill="#FEC618"></path> + <path d="M379.85 398.63C380.23 398.32 380.37 397.78 379.85 397.38C379.4 397.04 378.91 396.79 378.4 397.27C377.99 397.64 378.25 398.93 378.64 399.07C379.03 399.21 379.5 398.91 379.85 398.63Z" fill="#FEC618"></path> + <path d="M363.73 378.63C362.9 377.97 361.98 378.05 361.27 378.87C360.6 379.63 360.52 380.89 361.1 381.41C361.68 381.93 363.3 381.81 363.82 381.2C364.61 380.29 364.57 379.3 363.73 378.63V378.63Z" fill="#FEC618"></path> + <path d="M365.64 387.08C365.34 386.95 364.77 387.05 364.54 387.27C364.31 387.48 363.98 388.31 364.24 388.62C364.5 388.93 365.37 388.66 365.67 388.48C366.12 388.22 366.11 387.28 365.64 387.08V387.08Z" fill="#FEC618"></path> + <path d="M341.79 389.7C341.91 389.17 342.18 388.5 341.76 388.03C341.34 387.56 340.74 388.05 340.62 388.27C340.39 388.7 340 389.85 340.33 390.19C340.66 390.53 341.75 389.88 341.79 389.69V389.7Z" fill="#FEC618"></path> + <path d="M395.81 381.68C396.09 381.92 396.31 382.21 396.71 382.22C397.18 382.24 397.33 381.66 397.1 381.18C396.91 380.78 396.35 380.29 395.93 380.23C395.34 380.15 395.19 380.62 395.2 380.8C395.22 381.18 395.51 381.43 395.81 381.68V381.68Z" fill="#FEC618"></path> + <path d="M361.36 370.05C360.56 370.18 359.7 370.22 359.15 370.73C359 370.61 358.84 370.49 358.67 370.39C358.29 370.16 357.72 370.18 357.19 370.35C357.19 370.32 357.22 370.3 357.22 370.27C357.26 370.12 357.26 369.96 357.25 369.8H352.26C352.26 369.8 352.26 369.82 352.28 369.83C352.49 370.05 352.78 370.16 353.07 370.19C353.25 370.92 353.82 371.44 354.74 371.66C355.12 371.75 355.51 371.72 355.88 371.6C355.74 372.5 356.38 373.91 357.57 374.12C358.34 374.26 358.95 374.12 359.42 373.82C359.49 373.9 359.57 373.98 359.64 374.06C360.56 375.01 361.51 374.72 362.48 374.13C362.93 374.69 363.15 375.54 364.11 375.15C364.71 374.91 364.97 374.43 364.9 373.86C364.77 372.84 363.92 372.89 363.15 372.87C363.05 372.42 362.95 372.01 362.86 371.58C363.46 371.42 363.97 371.28 364.51 371.13C364.63 370.65 364.81 370.24 364.84 369.81H361.45C361.42 369.89 361.39 369.97 361.36 370.05V370.05Z" fill="#FEC618"></path> + <path d="M357.41 389.02C357.95 389.22 359.22 389.2 359.35 388.04C358.6 386.22 360 386.18 359.9 384.72C359.88 384.46 359.73 384.21 359.68 384.09C358.87 382.86 357.5 382.89 356.81 384.11C356.38 384.86 356.09 385.72 355.88 386.56C355.65 387.46 356.52 388.7 357.41 389.02V389.02Z" fill="#FEC618"></path> + <path d="M404.11 379.37C403.27 378.49 401.89 378.64 400.79 379.73C399.91 380.61 399.92 381.89 400.81 382.75C401.69 383.6 403.42 383.57 404.23 382.69C404.96 381.89 404.9 380.21 404.1 379.37H404.11Z" fill="#FEC618"></path> + <path d="M375.68 379.64C376.38 378.88 376.45 377.53 375.82 376.97C375.18 376.41 373.37 376.46 372.82 377.06C372.22 377.71 372.32 378.93 373.01 379.61C373.68 380.26 375.09 380.28 375.68 379.64V379.64Z" fill="#FEC618"></path> + <path d="M374.54 369.91C374.31 370.16 374.13 370.4 374 370.64C373.77 370.62 373.36 370.75 373.29 371.04C373.21 371.34 373.54 371.67 373.75 371.74C373.75 371.74 373.77 371.74 373.78 371.74C373.84 372.16 374.06 372.56 374.46 372.94C375.43 373.87 376.75 373.76 377.8 372.64C378.46 371.94 378.39 370.65 377.69 369.8H374.64C374.64 369.8 374.57 369.86 374.54 369.9V369.91Z" fill="#FEC618"></path> + <path d="M394.31 373.82C393.79 373.03 393.04 372.98 392.11 374C391.9 374.59 391.47 375.53 391.24 376.52C391.1 377.13 391.41 377.77 392.11 377.91C392.73 378.04 393.3 377.86 393.57 377.15C393.7 376.81 393.9 376.48 394.13 376.19C394.79 375.35 394.87 374.64 394.33 373.82H394.31Z" fill="#FEC618"></path> + <path d="M349.88 388.5C350.4 387.98 350.17 386.75 349.44 386.16C348.59 385.47 347.69 385.55 346.96 386.38C346.26 387.18 346.2 388.21 346.84 388.72C347.67 389.38 349.11 389.28 349.88 388.51V388.5Z" fill="#FEC618"></path> + <path d="M378.38 386.5C378.84 386.04 378.88 384.97 378.46 384.56C377.49 383.63 376.3 383.4 375.73 384.03C375.2 384.61 375.33 386.15 375.97 386.74C376.46 387.19 377.83 387.06 378.39 386.5H378.38Z" fill="#FEC618"></path> + <path d="M370.16 388.29C370.84 387.58 370.74 386.63 369.88 385.84C369.23 385.24 368.37 385.39 367.59 386.24C367 386.89 366.93 387.66 367.41 388.16C367.95 388.7 369.68 388.79 370.15 388.29H370.16Z" fill="#FEC618"></path> + <path d="M387.33 388.58C386.85 388.14 385.81 388.26 385.4 388.8C384.84 389.54 384.82 390.59 385.36 391.05C386.02 391.62 387.48 391.65 387.97 391.1C388.4 390.62 388.05 389.25 387.33 388.58V388.58Z" fill="#FEC618"></path> + <path d="M367.91 373.84C367.38 374.36 367.45 375.69 368.03 376.26C368.48 376.7 369.13 376.67 369.64 376.19C370.26 375.59 370.35 374.56 369.82 373.96C369.34 373.41 368.41 373.35 367.91 373.84Z" fill="#FEC618"></path> + <path d="M346.98 375.18C346.6 375.7 346.72 376.52 347.23 376.95C347.76 377.38 348.44 377.29 348.96 376.72C349.49 376.13 349.46 375.31 348.88 374.86C348.39 374.47 347.37 374.65 346.98 375.18V375.18Z" fill="#FEC618"></path> + <path d="M360.1 399.02C360.52 398.56 360.45 397.71 359.96 397.26C359.36 396.7 358.57 396.7 358.08 397.26C357.6 397.81 357.66 398.61 358.22 399.15C358.76 399.67 359.55 399.62 360.09 399.02H360.1Z" fill="#FEC618"></path> + <path d="M381.9 380.59C382.59 379.77 382.64 378.98 382.15 378.53C381.54 377.96 380.61 378.02 380.14 378.64C379.73 379.19 379.84 379.92 380.45 380.34C380.94 380.67 381.47 381.04 381.89 380.59H381.9Z" fill="#FEC618"></path> + <path d="M378.09 394C378.57 394.41 379.24 394.36 379.7 393.9C380.28 393.31 380.29 392.51 379.72 392.02C379.24 391.6 378.33 391.63 377.93 392.08C377.48 392.58 377.56 393.56 378.09 394Z" fill="#FEC618"></path> + <path d="M370.83 402.47C371.21 401.99 371.14 401.09 370.69 400.67C370.22 400.22 369.53 400.23 369.08 400.69C368.55 401.24 368.53 402.14 369.04 402.6C369.5 403.02 370.44 402.95 370.82 402.47H370.83Z" fill="#FEC618"></path> + <path d="M393.2 397.48C393.75 396.87 393.82 396.23 393.38 395.89C392.86 395.49 391.61 395.53 391.22 395.96C390.8 396.42 390.91 397.26 391.46 397.72C391.99 398.16 392.67 398.07 393.2 397.48Z" fill="#FEC618"></path> + <path d="M370.21 395.52C370.66 395.1 370.7 394.33 370.31 393.89C369.86 393.39 369.07 393.36 368.55 393.82C368 394.3 367.97 394.86 368.47 395.38C369.01 395.94 369.71 396 370.22 395.52H370.21Z" fill="#FEC618"></path> + <path d="M398.16 385.74C398.32 385.27 398.16 384.88 397.93 384.5C397.61 383.96 396.79 383.97 396.38 384.43C395.97 384.89 395.98 385.42 396.34 385.91C396.65 386.33 398 386.22 398.16 385.74V385.74Z" fill="#FEC618"></path> + <path d="M355.84 374.29C355.43 374.37 354.87 374.64 354.74 374.98C354.47 375.67 355.09 376 355.59 376.29C356.35 376.1 356.81 375.67 356.6 374.89C356.53 374.62 356.06 374.24 355.85 374.28L355.84 374.29Z" fill="#FEC618"></path> + <path d="M399.06 378.32C399.23 378.09 399.23 377.52 399.06 377.32C398.83 377.04 398.31 376.77 397.99 376.83C397.13 377.01 397.25 377.74 397.3 378.4C397.95 378.83 398.58 378.97 399.06 378.31V378.32Z" fill="#FEC618"></path> + <path d="M393.48 387.62C393.82 387.41 393.83 386.21 393.34 385.84C392.87 385.49 392.53 385.75 392.23 386.07C391.8 386.52 391.81 387.18 392.33 387.43C392.71 387.61 393.14 387.83 393.48 387.62V387.62Z" fill="#FEC618"></path> + <path d="M419.78 384.75C419.55 385.08 419.21 386.07 419.47 386.3C419.73 386.52 420.69 386.27 421.06 386.08C421.56 385.82 421.48 385.19 421.02 384.68C420.56 384.17 420.05 384.35 419.77 384.75H419.78Z" fill="#FEC618"></path> + <path d="M409.5 372.29C409.62 371.9 409.67 371.12 409.38 370.98C409.08 370.84 408.44 370.97 408.23 371.2C408.03 371.42 407.9 372.37 408.18 372.59C408.45 372.81 409.45 372.48 409.51 372.3L409.5 372.29Z" fill="#FEC618"></path> + <path d="M413.28 396.43C413.04 396.19 412.18 396.38 412.05 396.56C411.85 396.84 411.66 397.45 411.84 397.67C412.01 397.89 412.71 397.89 412.96 397.73C413.19 397.58 413.52 396.67 413.29 396.43H413.28Z" fill="#FEC618"></path> + <path d="M378.53 406.51C378.79 406.22 378.93 405.31 378.49 404.87C378.05 404.44 377.11 404.84 376.67 405.16C376.37 405.37 375.96 406.78 376.41 407.22C376.86 407.66 378.18 406.9 378.54 406.51H378.53Z" fill="#FEC618"></path> + <path d="M396.63 399.75C396.47 399.85 396.28 400.56 396.44 400.7C396.59 400.85 397.22 400.64 397.43 400.49C397.55 400.41 397.54 399.89 397.45 399.83C397.22 399.7 396.83 399.62 396.64 399.74L396.63 399.75Z" fill="#FEC618"></path> + <path d="M336.81 383.78C336.93 383.7 337.02 383.28 336.83 383.12C336.64 382.96 336.21 382.91 336.02 383.03C335.86 383.13 335.6 383.75 335.83 383.98C336.05 384.21 336.61 383.92 336.82 383.77L336.81 383.78Z" fill="#FEC618"></path> + <path d="M395.35 394.91C395.53 394.67 395.5 394.22 395.35 394.05C395.21 393.87 394.54 393.58 394.36 393.83C394.18 394.08 394.36 394.59 394.49 394.69C394.71 394.85 395.16 395.15 395.34 394.91H395.35Z" fill="#FEC618"></path> + <path d="M386.61 403.49C386.39 403.79 386.58 404.32 386.74 404.47C386.89 404.61 387.37 404.6 387.54 404.47C387.68 404.35 387.71 403.84 387.58 403.7C387.43 403.53 386.83 403.2 386.61 403.5V403.49Z" fill="#FEC618"></path> + <path d="M425.28 376.23C425.51 376.01 425.39 375.57 425.25 375.39C425.11 375.22 424.47 374.96 424.26 375.17C424.05 375.39 424.26 376.03 424.43 376.17C424.6 376.32 425.05 376.44 425.28 376.22V376.23Z" fill="#FEC618"></path> + <path d="M433.93 374.79C433.77 374.96 433.9 375.4 434.03 375.62C434.1 375.74 434.64 375.97 434.89 375.72C435.14 375.47 434.8 374.96 434.63 374.78C434.53 374.66 434.09 374.62 433.93 374.78V374.79Z" fill="#FEC618"></path> + <path d="M393.83 399.87C393.9 399.78 393.96 399.55 393.83 399.43C393.71 399.32 393.45 399.26 393.3 399.45C393.15 399.63 393.28 399.87 393.37 399.95C393.46 400.03 393.76 399.95 393.82 399.87H393.83Z" fill="#FEC618"></path> + <path d="M352.89 391.53C352.96 391.44 353.02 391.21 352.89 391.09C352.77 390.98 352.51 390.92 352.36 391.11C352.21 391.29 352.34 391.53 352.43 391.61C352.52 391.69 352.82 391.61 352.88 391.53H352.89Z" fill="#FEC618"></path> + <path d="M407.19 385.32C407.31 385.24 407.3 384.72 407.21 384.66C406.98 384.53 406.59 384.45 406.4 384.57C406.24 384.67 405.89 385.12 406.21 385.52C406.52 385.92 406.99 385.46 407.2 385.31L407.19 385.32Z" fill="#FEC618"></path> + <path d="M368 369.81C368.37 370.15 368.84 370.39 369.35 370.53C370.03 370.72 371.02 370.36 371.85 369.81H368Z" fill="#FEC618"></path> + <path d="M392.98 371.92C393.82 372.57 395.08 372.52 395.67 371.8C396.04 371.35 396.15 370.56 396.06 369.82H392.18C392.11 370.59 392.39 371.47 392.98 371.92Z" fill="#FEC618"></path> + <path d="M370.81 382.08C370.29 381.68 369.55 381.81 369.08 382.39C368.65 382.93 368.71 383.53 369.24 383.96C369.74 384.36 370.59 384.3 371.02 383.84C371.43 383.4 371.32 382.48 370.81 382.08Z" fill="#FEC618"></path> + <path d="M452.96 369.81C452.92 370.55 453.52 371.38 454.17 371.18C455.19 370.88 455.85 371.26 456.4 371.78C456.5 371.83 456.6 371.86 456.71 371.89C456.6 372.39 456.63 372.92 456.85 373.35C457.06 373.77 457.5 374.11 458 374.32C458.21 374.89 458.68 375.49 459.15 375.68C459.8 375.93 460.42 375.61 460.69 374.87C460.89 374.35 460.96 373.91 460.92 373.56C461.24 372.93 461.23 372.07 460.83 371.18C460.43 370.3 459.63 369.85 458.77 369.92C458.77 369.88 458.76 369.85 458.75 369.81H452.97H452.96Z" fill="#FEC618"></path> + <path d="M452.95 394.5C453.29 393.64 453 392.57 452.36 392.34C451.42 391.99 450.01 392.63 449.59 393.59C449.32 394.2 449.84 395.1 450.62 395.39C451.68 395.78 452.58 395.44 452.95 394.51V394.5Z" fill="#FEC618"></path> + <path d="M458.19 377.28C457.6 377.35 457.2 377.67 457.06 378.28C456.9 378.93 457.19 379.72 457.78 379.91C458.72 380.22 459.26 379.57 459.81 379.02C459.39 377.62 458.99 377.18 458.2 377.27L458.19 377.28Z" fill="#FEC618"></path> + <path d="M425.48 380.82C425.73 380.2 425.42 379.42 424.83 379.14C424.22 378.85 423.65 379.06 423.32 379.69C422.97 380.36 423.17 381.09 423.79 381.39C424.41 381.69 425.24 381.4 425.48 380.82V380.82Z" fill="#FEC618"></path> + <path d="M477.56 382.01C477.07 381.77 476.2 382.07 476 382.53C475.82 382.95 476.29 383.58 476.95 383.85C477.45 384.05 477.82 383.9 477.98 383.41C478.16 382.87 478.18 382.32 477.56 382.01V382.01Z" fill="#FEC618"></path> + <path d="M433.81 410.08C434.14 409.81 434.11 408.79 433.38 408.45C433.13 408.33 432.59 408.45 432.42 408.65C432.19 408.92 432 409.48 432.13 409.75C432.48 410.5 433.49 410.35 433.82 410.08H433.81Z" fill="#FEC618"></path> + <path d="M431.84 388.4C431.44 388.04 430 388.43 429.98 389.11C429.96 389.63 430.5 390.23 430.97 390.23C431.65 390.23 432.24 388.76 431.84 388.4Z" fill="#FEC618"></path> + <path d="M458.58 399.81C459 399.81 459.33 399.37 459.57 398.98C459.82 398.56 459.77 398 459.14 397.81C458.6 397.64 458.06 397.58 457.74 398.2C457.49 398.69 458.17 399.81 458.58 399.81Z" fill="#FEC618"></path> + <path d="M438.53 388.11C438.96 386.99 438.59 386.07 437.56 385.73C436.55 385.39 435.72 385.79 435.33 386.79C434.97 387.74 435.32 388.95 436.04 389.24C436.77 389.53 438.24 388.86 438.53 388.11V388.11Z" fill="#FEC618"></path> + <path d="M441.46 394.94C441.81 395.14 442.53 394.59 442.76 394.32C443.1 393.92 442.76 393.04 442.26 393.01C441.93 392.99 441.43 393.28 441.29 393.57C441.15 393.85 441.12 394.74 441.47 394.94H441.46Z" fill="#FEC618"></path> + <path d="M383.44 373.35C383.38 373.12 382.86 372.83 382.61 372.88C382.58 372.88 382.56 372.91 382.53 372.92C382.49 372.84 382.44 372.76 382.37 372.69C381.86 372.18 380.5 372.23 379.93 372.79C379.48 373.24 379.69 374.48 380.31 374.99C380.79 375.39 381.38 375.29 381.88 374.72C382.06 374.52 382.2 374.32 382.32 374.14C382.48 374.31 382.69 374.45 382.87 374.44C383.24 374.42 383.5 373.59 383.43 373.35H383.44Z" fill="#FEC618"></path> + <path d="M419.56 404.62C419.99 404.83 420.78 403.84 420.76 403.65C420.69 403.11 420.71 402.39 420.16 402.09C419.61 401.8 419.21 402.46 419.17 402.71C419.1 403.2 419.13 404.4 419.56 404.61V404.62Z" fill="#FEC618"></path> + <path d="M469.77 377.78C470.21 377.64 470.17 377.04 469.77 376.67C469.45 376.36 468.76 376.09 468.35 376.18C467.83 376.29 467.8 376.69 467.85 376.89C467.64 376.94 467.46 377.07 467.3 377.29C466.73 378.06 467.11 378.7 467.64 379.41C468.45 379.26 469.28 379.34 469.43 378.41C469.46 378.19 469.43 377.99 469.37 377.8C469.5 377.82 469.63 377.83 469.77 377.78V377.78Z" fill="#FEC618"></path> + <path d="M409.32 370.29C409.38 370.13 409.4 369.97 409.38 369.81H406.32C406.4 370.26 406.8 370.74 407.34 370.94C408.18 371.26 409.07 370.97 409.31 370.28L409.32 370.29Z" fill="#FEC618"></path> + <path d="M434.85 381.94C435.46 382.31 435.96 383.03 436.74 382.34C437.22 381.91 437.3 381.37 437.04 380.85C436.57 379.94 435.78 380.27 435.05 380.52C434.8 380.13 434.57 379.78 434.33 379.41C434.84 379.05 435.27 378.74 435.73 378.42C435.68 377.93 435.71 377.48 435.58 377.07C435.38 376.41 434.24 375.59 433.71 375.64C433.03 375.71 432.47 376.5 432.4 377.5C432.38 377.82 432.4 378.15 432.39 378.49C431.68 378.88 430.89 379.22 430.55 379.89C430.37 379.83 430.18 379.77 429.99 379.74C429.08 379.56 427.75 380.68 427.75 381.6C427.75 382.52 428.94 383.85 430.24 383.62C431.01 383.48 431.54 383.15 431.87 382.71C431.97 382.76 432.06 382.81 432.16 382.86C433.35 383.44 434.14 382.84 434.85 381.95V381.94Z" fill="#FEC618"></path> + <path d="M436.68 396.07C435.36 394.62 436.66 394.1 436.06 392.76C435.95 392.52 435.72 392.34 435.64 392.24C434.45 391.36 433.18 391.86 432.95 393.24C432.81 394.09 432.83 395 432.91 395.86C433 396.78 434.25 397.65 435.2 397.65C435.77 397.65 436.96 397.2 436.68 396.06V396.07Z" fill="#FEC618"></path> + <path d="M391.26 383.61C391.73 382.58 391.03 381.12 389.85 380.66C388.81 380.26 387.18 380.92 386.79 381.9C386.64 382.29 386.59 382.7 386.62 383.1C386.47 382.81 385.88 382.49 385.62 382.57C385.17 382.72 384.61 383.11 384.47 383.52C384.16 384.44 385.03 384.65 385.69 385.07C386.24 384.68 386.67 384.28 386.74 383.78C386.93 384.35 387.31 384.81 387.81 384.99C388.81 385.35 390.82 384.54 391.25 383.6L391.26 383.61Z" fill="#FEC618"></path> + <path d="M445.38 371.42C446.7 372 448.11 371.34 448.85 369.82H444.11C444.23 370.54 444.65 371.11 445.38 371.42Z" fill="#FEC618"></path> + <path d="M449.13 382.58C449.53 381.62 449.13 380.33 448.34 380.02C447.54 379.71 445.87 380.38 445.55 381.14C445.21 381.95 445.72 383.07 446.6 383.47C447.45 383.85 448.79 383.38 449.12 382.58H449.13Z" fill="#FEC618"></path> + <path d="M448.73 375.28C449.13 374.34 448.54 373.05 447.48 372.55C446.32 372.01 445.31 372.48 444.72 373.82C444.13 375.18 444.46 376.16 445.69 376.7C446.93 377.24 448.12 376.68 448.73 375.27V375.28Z" fill="#FEC618"></path> + <path d="M425.16 401C426.16 401.34 427.49 400.74 427.95 399.75C428.26 399.08 427.62 398.01 426.73 397.7C425.7 397.35 424.88 397.73 424.48 398.76C424.09 399.75 424.4 400.74 425.17 401H425.16Z" fill="#FEC618"></path> + <path d="M415.64 373.55C415.9 372.93 415.72 372.33 415.18 371.91C415.23 371.87 415.29 371.85 415.33 371.8C415.91 371.21 415.92 370.41 415.35 369.92C415.3 369.87 415.22 369.85 415.16 369.82H413.81C413.72 369.87 413.63 369.91 413.57 369.99C413.23 370.37 413.2 371.01 413.42 371.49C412.98 371.63 412.63 372.01 412.38 372.63C412 373.58 412.27 374.67 412.95 374.92C413.8 375.23 415.24 374.5 415.64 373.56V373.55Z" fill="#FEC618"></path> + <path d="M453.43 386.24C452.2 385.7 451.01 385.89 450.68 386.68C450.38 387.41 451.04 388.81 451.83 389.14C452.45 389.4 453.68 388.8 454.02 388.08C454.29 387.49 453.97 386.47 453.43 386.23V386.24Z" fill="#FEC618"></path> + <path d="M444.3 393.4C444.99 393.72 446.64 393.21 446.92 392.59C447.32 391.69 446.89 390.84 445.82 390.38C445 390.03 444.24 390.47 443.81 391.54C443.48 392.36 443.67 393.11 444.3 393.4V393.4Z" fill="#FEC618"></path> + <path d="M402.13 375.9C402.91 376.27 403.65 376.05 403.92 375.38C404.2 374.68 403.81 373.17 403.28 372.89C402.75 372.62 402.18 372.69 401.7 373.02C401.38 372.2 400.44 371.36 399.39 371.52C399.15 371.56 398.93 371.62 398.73 371.69C398.45 371.22 397.87 371.18 396.71 371.43C396.57 372.13 396.16 372.9 397.06 373.41C397.13 373.45 397.2 373.46 397.28 373.49C397.23 374.33 398.35 375.13 399.54 375.4C400 375.5 400.57 375.27 401.03 374.9C401.22 375.28 401.6 375.64 402.13 375.89V375.9Z" fill="#FEC618"></path> + <path d="M440.78 382.03C441.36 382.29 441.96 382.04 442.27 381.41C442.65 380.64 442.37 379.63 441.68 379.25C441.04 378.9 440.14 379.17 439.84 379.8C439.52 380.47 440.04 381.7 440.78 382.03V382.03Z" fill="#FEC618"></path> + <path d="M451.89 376.62C452.48 376.83 453 376.53 453.28 375.82C453.36 375.63 453.4 375.46 453.44 375.29C453.59 375.4 453.89 375.49 453.95 375.44C454.15 375.27 454.36 374.93 454.32 374.71C454.28 374.53 453.98 374.04 453.5 374.19C453.48 374.19 453.46 374.21 453.44 374.22C453.36 374.02 453.24 373.84 453.04 373.75C452.38 373.44 451.12 373.96 450.79 374.68C450.52 375.25 451.15 376.35 451.9 376.61L451.89 376.62Z" fill="#FEC618"></path> + <path d="M421.49 389.81C422.14 390.04 422.75 389.72 423.04 389C423.34 388.27 423.02 387.51 422.32 387.28C421.73 387.09 420.83 387.6 420.64 388.23C420.46 388.85 420.85 389.58 421.49 389.8V389.81Z" fill="#FEC618"></path> + <path d="M439.44 406.89C440.13 407.2 440.85 406.87 441.15 406.13C441.38 405.55 441.03 404.78 440.42 404.53C439.66 404.21 438.92 404.48 438.65 405.17C438.39 405.85 438.72 406.58 439.43 406.9L439.44 406.89Z" fill="#FEC618"></path> + <path d="M455.31 381.33C455.68 380.32 455.46 379.57 454.84 379.31C454.08 378.99 453.22 379.36 453 380.1C452.81 380.76 453.16 381.41 453.88 381.59C454.45 381.73 455.08 381.9 455.31 381.33V381.33Z" fill="#FEC618"></path> + <path d="M450.16 404.6C449.85 405.3 450.14 406.15 450.78 406.41C451.35 406.64 452.22 406.26 452.41 405.68C452.6 405.1 452.23 404.28 451.66 404.03C451.06 403.77 450.42 404.01 450.16 404.6Z" fill="#FEC618"></path> + <path d="M424.89 371.24C424.77 371.86 424.89 372.43 425.13 372.93C425.47 373.61 426.13 374.01 426.98 374.25C427.85 374.49 428.3 375.29 429.19 375.15C430.39 374.96 432.15 374.1 432.44 372.02C432.57 371.1 432.43 370.38 432.09 369.82H425.35C425.12 370.25 424.97 370.74 424.87 371.24H424.89Z" fill="#FEC618"></path> + <path d="M422.43 394.63C423.13 394.94 423.8 394.72 424.08 394.09C424.37 393.44 424.11 392.71 423.5 392.44C422.94 392.19 422.06 392.48 421.78 393C421.48 393.58 421.78 394.33 422.43 394.62V394.63Z" fill="#FEC618"></path> + <path d="M447.75 399.84C448.45 400.18 449.13 399.99 449.44 399.37C449.72 398.83 449.5 398.09 448.97 397.81C448.38 397.49 447.63 397.73 447.29 398.35C446.94 398.99 447.1 399.53 447.75 399.84V399.84Z" fill="#FEC618"></path> + <path d="M429.11 386.33C429.76 385.89 430.04 385.33 429.58 384.67C429.42 384.44 428.85 384.25 428.66 384.36C428.3 384.58 427.87 385.02 427.86 385.38C427.84 386.12 428.53 386.22 429.11 386.32V386.33Z" fill="#FEC618"></path> + <path d="M470.64 373.31C470.72 373.04 470.52 372.5 470.29 372.37C469.98 372.19 469.4 372.11 469.12 372.28C469.1 372.29 469.09 372.31 469.07 372.32C469.16 371.28 468.69 370.56 468.02 370.13C467.25 369.65 466.02 370.46 465.32 371.52C465.2 371.22 464.98 370.94 464.64 370.69C463.88 370.13 463.16 370.33 462.63 371.61C462.63 372.24 462.56 373.27 462.67 374.28C462.74 374.9 463.26 375.4 463.96 375.29C464.58 375.2 465.06 374.83 465.07 374.08C465.07 373.74 465.14 373.39 465.25 373.06C465.43 373.61 465.77 374.11 466.2 374.28C466.91 374.56 468.18 374.19 468.75 373.32C468.82 373.53 468.92 373.75 469.02 373.97C469.78 374.15 470.42 374.06 470.64 373.29V373.31Z" fill="#FEC618"></path> + <path d="M412.31 386.17C411.61 386.22 410.87 386.24 410.7 387.2C410.58 387.91 410.36 388.6 410.19 389.3C409.7 389.99 409.89 390.61 410.49 390.95C411.13 391.32 411.8 391.11 412.32 390.45C412.6 390.09 412.89 389.68 413.27 389.48C414.03 389.08 414.48 388.52 414.43 387.69C414.39 387.05 413.04 386.12 412.3 386.18L412.31 386.17Z" fill="#FEC618"></path> + <path d="M414.82 379.06C415.14 378.36 414.86 377.53 414.21 377.26C413.63 377.02 412.94 377.38 412.65 378.08C412.4 378.68 412.63 379.32 413.19 379.6C413.87 379.94 414.51 379.73 414.82 379.06V379.06Z" fill="#FEC618"></path> + <path d="M407.43 378.52C406.87 378.35 406.64 378.71 406.46 379.12C406.21 379.7 406.46 380.31 407.03 380.36C407.44 380.4 407.88 380.2 408.18 380.14C408.44 379.36 408.03 378.7 407.44 378.52H407.43Z" fill="#FEC618"></path> + <path d="M466.88 382.94C466.63 383.52 466.88 384.13 467.45 384.18C467.86 384.22 468.35 384.27 468.6 383.96C468.85 383.65 468.45 382.52 467.86 382.34C467.3 382.17 467.07 382.53 466.89 382.94H466.88Z" fill="#FEC618"></path> + <path d="M403.4 383.88C403.15 384.46 403.4 385.07 403.97 385.12C404.38 385.16 404.82 384.96 405.12 384.9C405.38 384.12 404.97 383.46 404.38 383.28C403.82 383.11 403.59 383.47 403.41 383.88H403.4Z" fill="#FEC618"></path> + <path d="M416.16 391.75C415.95 392.33 416.65 392.83 416.97 393.06C417.36 393.34 417.89 393.4 418.23 392.84C418.54 392.32 418.39 391.42 417.86 391.33C417.42 391.26 416.37 391.17 416.16 391.75Z" fill="#FEC618"></path> + <path d="M459.28 408.24C459.86 408.5 460.83 407.33 461.03 406.84C461.18 406.47 460.99 405.57 460.43 405.32C459.87 405.07 459.13 405.77 458.82 406.22C458.61 406.52 458.71 407.98 459.28 408.24V408.24Z" fill="#FEC618"></path> + <path d="M414.05 399.8C414.13 399.68 414.08 399.26 413.84 399.18C413.6 399.1 413.19 399.2 413.05 399.38C412.94 399.53 412.91 400.2 413.2 400.34C413.49 400.48 413.91 400.02 414.05 399.81V399.8Z" fill="#FEC618"></path> + <path d="M471.97 390.25C472.23 390.33 472.76 390.45 472.84 390.16C472.92 389.87 472.74 389.47 472.55 389.35C472.36 389.23 471.63 389.18 471.54 389.48C471.45 389.78 471.8 390.2 471.96 390.25H471.97Z" fill="#FEC618"></path> + <path d="M399.08 383.92C399.29 384 399.76 383.96 399.89 383.68C400.03 383.4 399.77 383.02 399.58 382.9C399.39 382.79 398.7 382.76 398.58 383.04C398.46 383.32 398.88 383.85 399.08 383.92Z" fill="#FEC618"></path> + <path d="M399.21 393.94C399.32 394.03 399.9 394.06 400.05 393.74C400.2 393.42 399.7 393.06 399.49 392.94C399.35 392.87 398.92 392.97 398.83 393.19C398.74 393.4 399.01 393.77 399.21 393.94V393.94Z" fill="#FEC618"></path> + <path d="M473.12 395.35C473.15 395.24 473.13 395 472.98 394.94C472.83 394.88 472.56 394.91 472.49 395.14C472.42 395.36 472.62 395.54 472.73 395.59C472.84 395.64 473.09 395.46 473.12 395.36V395.35Z" fill="#FEC618"></path> + <path d="M431.17 401.35C431.1 401.57 431.3 401.75 431.41 401.8C431.52 401.85 431.77 401.67 431.8 401.57C431.83 401.46 431.81 401.22 431.66 401.16C431.51 401.1 431.24 401.13 431.17 401.36V401.35Z" fill="#FEC618"></path> + <path d="M421.16 380.93C421.55 379.97 421.42 379.05 420.87 378.41C421.33 378.41 421.8 378.22 422.21 377.76C423.33 376.51 423.3 375.15 422.56 374.41C422.07 373.91 421 373.75 420.12 373.95C420.25 373.37 420.01 372.83 419.48 372.6C418.93 372.36 418.16 372.7 417.87 373.33C417.84 373.4 417.84 373.46 417.82 373.53C417.56 373.48 417.32 373.55 417.15 373.84C416.93 374.22 416.56 375.29 416.92 375.63C417.27 375.97 418.27 375.32 418.6 375.03C418.63 375.03 418.66 375.05 418.68 375.06C418.21 375.98 418.57 376.87 419.01 377.48C419.04 377.52 419.08 377.57 419.11 377.61C418.33 377.62 417.69 378.13 417.26 379.11C417.1 379.48 417.02 379.82 417 380.15C416.77 379.99 416.51 379.9 416.13 379.96C415.29 380.11 414.84 381.24 415.13 382.07C415.36 382.75 416.22 383.45 416.95 383.4C417.97 383.33 418.39 382.39 418.43 382.06C419.5 382.37 420.78 381.86 421.16 380.93V380.93Z" fill="#FEC618"></path> + <path d="M441.34 370.77C441.31 370.62 441.6 370.27 441.91 369.81H436.76C437.46 370.43 438.4 370.87 438.42 371.2C438.45 371.64 436.79 372.76 437.09 374.24C437.36 375.59 438.51 376.17 439.7 376.19C439.78 376.46 440.49 377.08 440.79 376.94C441.1 376.8 441.22 375.93 441.11 375.75C441.11 375.75 441.11 375.75 441.1 375.74C442.12 375 443.05 373.51 442.98 372.61C442.88 371.4 441.41 371.1 441.34 370.77V370.77Z" fill="#FEC618"></path> + <path d="M435.64 369.97C435.99 370.11 436.38 370.03 436.68 369.81H435.39C435.47 369.88 435.55 369.94 435.63 369.97H435.64Z" fill="#FEC618"></path> + <path d="M416.95 370.3C417.43 370.23 417.77 370.06 417.97 369.81H416.48C416.6 369.99 416.77 370.15 416.95 370.3Z" fill="#FEC618"></path> + <path d="M443.88 387.43C443.66 388.08 443.93 388.63 444.57 388.85C445.18 389.06 445.95 388.71 446.2 388.13C446.43 387.57 446.01 386.75 445.4 386.55C444.77 386.35 444.12 386.73 443.88 387.44V387.43Z" fill="#FEC618"></path> + <path d="M408.36 395.26C408.71 393.95 407.64 392.84 406.54 392.43C405.44 392.02 403.4 393.27 403.25 394.69C403.14 395.71 404.45 396.01 405.11 395.68C405.77 395.35 405.6 395.54 406.23 395.96C406.87 396.38 408.01 396.57 408.35 395.26H408.36Z" fill="#FEC618"></path> + <path d="M488.42 390.26C490.05 390.69 491.83 389.27 492.02 387.31C492.09 386.58 492.39 386.44 492.85 386.16C493.51 385.75 493.6 384.72 493.15 384.11C492.68 383.48 492.18 383.6 491.65 383.96C491.26 384.23 490.84 384.57 490.4 384.62C489.38 384.74 488.34 384.71 487.24 384.74C486.22 382.4 485.42 382.09 483.62 383.5C482.65 384.26 482.61 385.62 483.66 386.34C484.44 386.87 485.39 387.06 486.54 387.51C486.75 388.62 487.1 389.91 488.42 390.26V390.26Z" fill="#FEC618"></path> + <path d="M477.45 396.39C478.63 395.87 479.34 394.57 478.95 393.65C478.51 392.59 476.55 391.75 475.62 392.22C474.6 392.73 474.09 394.18 474.57 395.19C475.08 396.27 476.44 396.84 477.45 396.4V396.39Z" fill="#FEC618"></path> + <path d="M515.25 408.9C515.47 409.27 515.83 409.55 516.25 409.71V402.73C515.52 402.73 514.83 403.08 514.52 403.69C513.92 404.91 514.18 406.49 515.04 407.04C514.84 407.62 514.89 408.28 515.25 408.9Z" fill="#FEC618"></path> + <path d="M462.55 383.79C463.25 383.37 463.42 382.06 462.9 381.1C462.43 380.24 461.57 380.1 460.5 380.71C460.14 380.92 459.88 381.38 459.79 381.84C459.66 381.84 459.54 381.86 459.47 381.92C459.1 382.21 458.71 382.77 458.72 383.21C458.74 384.18 459.63 384.08 460.4 384.25C460.58 383.99 460.73 383.74 460.83 383.5C461.47 383.82 462.22 383.99 462.55 383.8V383.79Z" fill="#FEC618"></path> + <path d="M503.57 385.05C503.45 385.12 503.36 385.27 503.29 385.46C503.13 385.03 502.74 384.61 502.49 384.47C501.98 384.2 501.43 384.49 501.17 385.09C500.89 385.71 501.29 386.1 501.75 386.23C502.06 386.32 502.79 386.45 503.15 386.23C503.15 386.47 503.18 386.7 503.27 386.86C503.62 387.52 504.47 387.76 505.09 387.38C505.68 387.01 505.97 386.08 505.66 385.51C505.41 385.05 504.06 384.76 503.57 385.05Z" fill="#FEC618"></path> + <path d="M467.53 412.58C467.63 411.94 467.33 411.43 466.69 411.15C466.17 410.92 465.73 411 465.4 411.46C464.83 412.23 465.21 412.87 465.74 413.58C466.55 413.43 467.38 413.51 467.53 412.58Z" fill="#FEC618"></path> + <path d="M443.58 370.03C443.69 369.98 443.78 369.9 443.87 369.81H442.25C442.6 370.15 443.11 370.25 443.58 370.03Z" fill="#FEC618"></path> + <path d="M482.24 411.65C482.86 411.37 483.22 410.54 482.96 410.01C482.72 409.51 481.91 409.21 481.42 409.43C480.89 409.67 480.49 410.58 480.7 411.1C480.91 411.62 481.69 411.9 482.25 411.65H482.24Z" fill="#FEC618"></path> + <path d="M493.74 382.5C494.43 382.13 494.84 381.12 494.43 380.59C493.93 379.94 493.25 379.64 492.43 380C491.69 380.33 491.48 381.33 491.95 382.15C492.27 382.72 493.04 382.86 493.73 382.49L493.74 382.5Z" fill="#FEC618"></path> + <path d="M472.55 411.85C472.66 411.85 472.94 411.39 472.88 411.28C472.76 411.06 472.52 410.59 472.11 410.69C471.7 410.79 471.76 411.39 471.83 411.49C471.99 411.69 472.29 411.84 472.55 411.85V411.85Z" fill="#FEC618"></path> + <path d="M495.8 393.74C495.2 394.15 495.04 394.65 495.29 395.3C495.56 395.98 495.93 396.58 496.79 396.62C499.37 396.76 499.97 396.3 500.48 393.8C500.49 393.75 500.52 393.7 500.55 393.61C500.55 393.61 500.56 393.61 500.57 393.61C500.52 393.97 500.55 394.39 500.6 394.61C500.71 395.11 501.12 395.45 501.73 395.22C501.77 395.21 501.79 395.18 501.83 395.16C501.51 395.74 501.49 396.42 501.97 397.06C502.92 398.33 504.16 398.36 505.2 397.65C506.7 396.63 505.39 395.29 506.56 395.02C507.73 394.75 507.47 395.93 509.08 395.43C509.13 395.42 509.16 395.39 509.2 395.38C509.22 395.43 509.23 395.47 509.25 395.52C509.55 396.12 510.39 396.47 510.9 396.22C511.42 395.96 511.95 394.84 511.74 394.4C511.59 394.08 511.16 393.83 510.71 393.73C510.79 393.26 510.67 392.8 510.3 392.49C509.39 391.72 508.43 392.16 508.28 391.92C508.13 391.68 507.74 390.47 506.84 390.76C504.94 391.38 505.93 392.94 505.43 393.3C504.93 393.66 503.66 393.66 502.88 394.12C502.73 394.21 502.59 394.31 502.45 394.42C502.48 394.26 502.47 394.1 502.39 393.93C502.27 393.7 501.85 393.33 501.45 393.14C502.01 392.71 502.18 392.22 501.92 391.68C501.83 391.49 501.69 391.33 501.52 391.21C501.55 391.16 501.59 391.11 501.62 391.06C502.06 390.25 501.84 389.3 501.11 388.94C500.18 388.47 498.82 388.77 498.49 389.53C498.18 390.23 498.36 391.15 498.84 391.74C498.56 391.73 498.28 391.65 497.96 391.6C498.18 389.68 497.37 388.84 495.71 389.1C495.55 389.13 495.39 389.16 495.23 389.21C494.14 389.56 493.85 390.18 494.31 391.22C494.69 392.09 495.13 392.91 496.62 392.67C496.21 393.21 496.05 393.56 495.78 393.74H495.8Z" fill="#FEC618"></path> + <path d="M513.9 383.86C514.12 383.74 514.31 383.57 514.44 383.32C514.73 382.76 514.62 382.23 514.19 381.89C514.19 381.8 514.19 381.73 514.19 381.63C514.76 381.83 515.25 381.85 515.47 382.1C515.72 382.4 515.98 382.58 516.24 382.68V377.94C515.99 377.67 515.68 377.45 515.32 377.33C514.97 377.21 514.67 377.17 514.39 377.19C514.49 376.79 514.46 376.31 514.33 375.85C515.38 375.73 515.8 375.05 515.88 373.57C516 373.48 516.12 373.39 516.24 373.31V369.8H510.98C510.98 369.8 510.93 369.88 510.9 369.91C510.27 370.79 509.74 370.78 509.33 369.8H505.06C505.02 369.9 504.96 369.99 504.94 370.11C504.83 370.62 504.83 371.04 504.96 371.4C504.47 372.5 504.8 373.5 505.83 373.96C506.74 374.36 507.82 374.1 508.1 373.4C508.19 373.17 508.23 372.93 508.23 372.67C508.78 372.63 509.22 372.67 509.55 373.12C510.05 373.84 510.65 373.73 511.28 373.22C511.33 373.58 511.41 373.88 511.51 374.17C510.93 374.42 510.38 374.92 509.97 375.64C509.4 376.65 509.73 377.85 510.74 378.46C511.3 378.8 512.03 378.85 512.7 378.67C512.32 379.47 512.36 380.32 512.64 381.18C512.14 381.43 511.65 381.59 511.27 381.89C510.09 382.8 510.29 383.96 511.68 384.51C512.64 384.89 513.46 384.62 513.88 383.85L513.9 383.86Z" fill="#FEC618"></path> + <path d="M483.57 382.34C484.16 381.41 483.93 380.36 483 379.62C482.12 378.93 481.18 378.29 480.4 377.5C480.52 377.36 480.62 377.19 480.69 377.09C480.77 376.97 480.59 376.48 480.48 376.47C480.22 376.43 479.83 376.49 479.69 376.67C479.67 376.7 479.64 376.76 479.62 376.82C478.94 376.4 478.07 376.25 477.7 376.63C477.22 377.12 477.56 378.22 477.84 378.39C478.61 378.87 478.29 379.46 478.39 380.06C478.48 380.6 478.85 381.12 479.19 381.59C479.4 381.88 479.76 382.08 480.08 382.27C480.41 382.47 480.76 382.63 481.1 382.79C482.24 383.32 483.04 383.17 483.57 382.34V382.34Z" fill="#FEC618"></path> + <path d="M489.53 372.15C490.48 372.56 491.41 373.01 492.33 373.44C492.38 373.62 492.45 373.76 492.55 373.8C492.65 373.84 492.8 373.8 492.96 373.74C493.01 373.77 493.07 373.79 493.12 373.82C492.26 376.4 492.4 376.67 494.47 376.88C495.37 375.83 495.22 374.87 494.35 373.91C495.5 371.87 495.39 370.48 494.12 369.82H488.12C487.83 370.95 488.24 371.6 489.52 372.15H489.53Z" fill="#FEC618"></path> + <path d="M508.9 408.22C507.93 408.19 507.52 408.73 507.47 409.69C505.19 410.11 504.86 411.41 506.44 413.31C506.38 413.45 506.35 413.62 506.26 413.75C505.88 414.32 506.09 414.78 506.5 415.23C506.89 415.66 507.31 415.66 507.84 415.52C509.13 415.16 509.43 414.62 508.98 413.34C508.64 412.38 508.35 411.41 508.04 410.46C509.76 409.74 509.82 409.53 508.9 408.23V408.22Z" fill="#FEC618"></path> + <path d="M512.95 400.25C513.43 401.12 515.06 401.49 516.25 401.03V396.99C516.19 396.95 516.12 396.92 516.06 396.88C516.18 396.22 515.95 395.57 515.45 395.32C514.67 394.92 513.44 395.17 513.04 395.81C512.73 396.31 512.8 397.1 513.1 397.72C512.63 398.44 512.52 399.45 512.96 400.24L512.95 400.25Z" fill="#FEC618"></path> + <path d="M514.36 393.88C514.64 394.54 515.43 394.94 516.25 394.97V386.1C515.67 386.33 515.24 386.8 515.27 387.33C515.33 388.38 515.95 388.62 515.71 388.92C515.47 389.22 514.64 389.54 514.74 390.24C514.77 390.43 514.96 390.61 515.21 390.77C514.51 391.56 514.03 393.1 514.36 393.88V393.88Z" fill="#FEC618"></path> + <path d="M475.52 390.56C476.19 390.59 476.71 390.32 476.93 389.68C477.01 389.44 477.02 389.05 476.88 388.9C476.45 388.46 475.94 388.11 475.41 387.69C475.38 386.16 474.76 385.11 473.83 385.12C472.93 385.12 471.8 386.36 471.79 387.36C471.78 388.42 472.3 388.73 474.43 388.81C474.48 389.64 474.42 390.5 475.53 390.55L475.52 390.56Z" fill="#FEC618"></path> + <path d="M469.82 402.46C470.75 401.92 471.03 400.79 470.49 399.74C470.09 398.96 468.74 398.66 467.84 399.15C466.9 399.66 466.7 400.65 467.32 401.71C467.92 402.75 468.85 403.03 469.82 402.46V402.46Z" fill="#FEC618"></path> + <path d="M487.51 375.66C488.81 376.02 488.95 375.99 489.62 374.62C489.29 374.06 489 373.61 488.76 373.13C488.35 372.35 487.21 371.92 486.4 372.27C485.84 372.52 485.34 373.47 485.66 373.91C486.16 374.59 486.55 375.4 487.51 375.66V375.66Z" fill="#FEC618"></path> + <path d="M477.86 419.57C478.43 419.83 479.43 420.7 480.18 420.16C480.93 419.62 480.34 419.02 480.39 418.59C480.51 417.43 479.51 416.2 478.56 416.34C477.69 416.47 477.21 417 476.99 417.82C476.76 418.66 477.18 419.25 477.87 419.57H477.86Z" fill="#FEC618"></path> + <path d="M485.5 397.87C486.16 397.57 486.41 396.38 485.99 395.55C485.51 394.6 484.94 394.23 484.26 394.4C484.42 394.36 484.57 394.27 484.66 394.06C484.86 393.57 484.35 393.33 484.13 393.24C483.96 393.17 483.49 393.39 483.44 393.57C483.38 393.8 483.52 394.25 483.71 394.34C483.81 394.39 484.03 394.45 484.24 394.4C484.14 394.43 484.04 394.46 483.94 394.51C483.09 394.91 482.54 396.24 482.91 397C483.28 397.76 484.69 398.23 485.5 397.86V397.87Z" fill="#FEC618"></path> + <path d="M508.85 400.56C509.44 400.27 509.73 398.47 509.31 397.73C509.01 397.21 507.97 396.92 507.41 397.2C506.43 397.67 505.98 398.67 506.4 399.46C506.9 400.4 508.1 400.94 508.86 400.57L508.85 400.56Z" fill="#FEC618"></path> + <path d="M483.93 371.48C483.53 370.69 482.57 370.35 481.87 370.75C481.3 371.07 480.67 372.67 480.9 373.21C481.2 373.94 482.37 374.16 483.39 373.67C484.33 373.22 484.49 372.57 483.93 371.48V371.48Z" fill="#FEC618"></path> + <path d="M490.68 414.64C491.03 415.29 492.25 415.53 493.04 415.11C493.78 414.72 494.04 413.68 493.61 412.82C493.21 412.01 492.62 411.76 491.91 412.1C490.89 412.58 490.26 413.88 490.68 414.64Z" fill="#FEC618"></path> + <path d="M480.19 386.01C480.9 385.76 481.34 384.6 481.03 383.76C480.81 383.15 479.83 382.68 479.27 382.91C478.1 383.39 477.44 384.35 477.77 385.11C478.1 385.86 479.31 386.31 480.19 386.01V386.01Z" fill="#FEC618"></path> + <path d="M508.96 389.02C509.28 388.87 509.56 388.52 509.75 388.12C509.82 388.17 509.88 388.23 509.95 388.28C510.7 388.73 511.87 388.67 512.23 388.11C512.96 386.99 512.06 385.93 511.56 385.41C511.17 384.99 510.17 385.41 509.62 386.15C509.12 385.73 508.22 385.76 507.26 386.27C506.74 386.55 506.48 387.62 506.79 388.16C507.12 388.74 508.42 389.25 508.94 389.01L508.96 389.02Z" fill="#FEC618"></path> + <path d="M507.29 378.34C508.08 377.85 508.36 375.89 507.95 375.53C507.54 375.17 505.58 375.6 505.25 376.31C504.93 376.99 505.15 377.6 505.66 378.09C506.12 378.53 506.68 378.72 507.29 378.34V378.34Z" fill="#FEC618"></path> + <path d="M471.21 393.98C471.41 393.83 471.59 393.62 471.71 393.32C472.01 392.56 471.86 391.93 471.34 391.77C470.82 391.61 469.95 391.9 469.54 392.31C469.29 392.28 469.04 392.29 468.82 392.38C468.17 392.62 467.81 393.49 468.07 394.17C468.36 394.93 469.49 395.33 470.32 394.98C470.84 394.76 471.14 394.39 471.21 393.99V393.98Z" fill="#FEC618"></path> + <path d="M472.6 381.96C473.08 381.68 473.47 380.18 473.21 379.58C472.94 378.94 472.27 378.82 471.38 379.27C471.34 379.29 471.3 379.31 471.26 379.34C470.84 379.29 470.38 379.56 470.21 379.98C469.99 380.53 470.16 381.01 470.62 381.34C471.13 382.08 471.92 382.35 472.58 381.97L472.6 381.96Z" fill="#FEC618"></path> + <path d="M490.15 407.79C490.66 407.32 490.83 406.75 490.48 406.17C489.95 405.31 488.59 405.44 488.25 405.66C487.91 405.88 487.73 407.3 488.49 407.91C488.96 408.29 489.62 408.28 490.15 407.79Z" fill="#FEC618"></path> + <path d="M465.44 386.58C465.13 385.98 464.19 385.71 463.58 386.05C463.23 386.24 463.04 386.58 463.01 386.94C462.41 386.79 461.59 387.23 461.4 387.84C461.13 388.73 461.47 389.72 462.13 389.97C462.95 390.28 464.32 389.8 464.6 389.12C464.68 388.92 464.64 388.67 464.53 388.39C464.64 388.37 464.75 388.33 464.86 388.27C465.43 387.97 465.72 387.11 465.43 386.58H465.44Z" fill="#FEC618"></path> + <path d="M491.38 393.03C490.72 393.24 490.34 393.74 490.37 394.37C490.41 395.34 491.48 395.84 492.05 395.7C492.61 395.55 493.24 394.5 492.76 393.55C492.47 392.98 491.98 392.84 491.38 393.03Z" fill="#FEC618"></path> + <path d="M489.15 402.11C489.53 401.88 489.76 401.36 489.69 400.8C490.27 400.45 490.56 399.57 490.34 399.23C490.03 398.76 488.63 398.57 488.29 399.12C488.1 399.43 487.98 399.72 487.98 399.98C487.35 400.2 487.19 401.12 487.57 401.77C487.88 402.3 488.59 402.45 489.15 402.1V402.11Z" fill="#FEC618"></path> + <path d="M493.42 402.73C494.04 402.37 494.27 401.49 493.9 400.9C493.56 400.36 492.73 400.14 492.2 400.45C491.68 400.75 491.46 401.62 491.76 402.19C492.08 402.8 492.87 403.06 493.42 402.73V402.73Z" fill="#FEC618"></path> + <path d="M497.72 382.23C498.76 382.05 498.8 381.18 498.76 380.27C498.08 379.89 497.37 379.45 496.66 380.04C496.18 380.44 496.03 381.15 496.5 381.66C496.79 381.97 497.35 382.29 497.72 382.23Z" fill="#FEC618"></path> + <path d="M487.98 380.66C488.26 380.86 488.84 380.88 489.16 380.72C489.77 380.42 489.96 379.75 489.7 379.15C489.34 378.32 488.29 378.39 487.82 378.57C487.35 378.75 487.18 380.09 487.98 380.66V380.66Z" fill="#FEC618"></path> + <path d="M487.27 420C487.08 419.41 486.38 419.12 485.8 419.36C485.27 419.58 484.99 420.3 485.2 420.9C485.42 421.51 486.17 421.87 486.65 421.55C487.19 421.19 487.48 420.68 487.26 420H487.27Z" fill="#FEC618"></path> + <path d="M516.25 416.65V416.32C516.23 416.43 516.23 416.54 516.25 416.65Z" fill="#FEC618"></path> + <path d="M481.32 388.68C481.39 388.8 481.45 388.92 481.52 389.04C481.58 389.43 481.82 389.79 482.26 390.01C482.9 390.34 483.43 390.16 483.73 389.51C484.03 388.86 483.78 388.15 483.15 387.86C483.01 387.8 482.86 387.77 482.7 387.77C482.06 387.61 481.62 388.01 481.32 388.69V388.68Z" fill="#FEC618"></path> + <path d="M477.56 406.67C478.02 406.37 478.3 405.88 477.93 405.44C477.64 405.09 476.76 404.34 476.37 404.57C475.98 404.8 476.07 405.9 476.16 406.35C476.26 406.83 477.08 406.98 477.56 406.67V406.67Z" fill="#FEC618"></path> + <path d="M463.7 370.4C463.96 370.31 464.28 370.06 464.43 369.81H462.63C462.66 369.89 462.7 369.97 462.75 370.05C462.9 370.29 463.44 370.49 463.69 370.4H463.7Z" fill="#FEC618"></path> + <path d="M460.15 389.77C460.6 389.45 460.93 389.02 460.56 388.56C460.28 388.22 459.41 387.5 458.97 387.71C458.53 387.92 458.78 389.09 458.94 389.5C459.13 390 459.63 390.13 460.15 389.77V389.77Z" fill="#FEC618"></path> + <path d="M507.64 417.27C507.49 416.92 506.87 416.76 506.59 416.6C505.75 417 505.76 417.52 505.96 417.96C506.17 418.41 506.64 418.83 507.12 418.47C507.44 418.23 507.76 417.56 507.63 417.27H507.64Z" fill="#FEC618"></path> + <path d="M448.09 386.33C447.79 386.5 447.68 387.48 447.73 387.9C447.79 388.46 448.41 388.61 449.05 388.36C449.69 388.11 449.7 387.57 449.43 387.17C449.2 386.84 448.39 386.17 448.09 386.33Z" fill="#FEC618"></path> + <path d="M464.91 380.61C464.61 380.79 464.57 381.84 464.72 381.96C465.04 382.21 465.76 382.54 465.99 382.31C466.23 382.08 466.33 381.44 466.19 381.16C466.06 380.9 465.21 380.44 464.91 380.62V380.61Z" fill="#FEC618"></path> + <path d="M481.6 398.01C481.37 397.6 480.28 397.83 479.96 398.01C479.75 398.13 479.69 398.78 479.8 399.12C479.94 399.55 480.42 399.82 480.83 399.44C481.12 399.17 481.83 398.42 481.6 398V398.01Z" fill="#FEC618"></path> + <path d="M455.45 395.32C455.58 395.61 456.03 395.66 456.24 395.59C456.33 395.56 456.48 395.43 456.61 395.28C457.11 395.33 457.58 395.08 457.8 394.58C458.14 393.82 457.87 393.08 457.17 392.81C456.57 392.58 455.73 392.92 455.51 393.48C455.37 393.84 455.45 394.29 455.66 394.65C455.49 394.81 455.34 395.09 455.44 395.32H455.45Z" fill="#FEC618"></path> + <path d="M453.5 404.58C453.64 404.53 453.84 404.13 453.74 403.92C453.64 403.71 453.18 403.68 452.93 403.72C452.79 403.74 452.39 404.17 452.53 404.49C452.67 404.81 453.27 404.67 453.5 404.58V404.58Z" fill="#FEC618"></path> + <path d="M464.3 391.63C464.19 391.68 464.16 391.99 464.22 392.08C464.28 392.18 464.48 392.31 464.63 392.24C464.78 392.17 464.92 391.94 464.8 391.74C464.68 391.54 464.41 391.58 464.3 391.63V391.63Z" fill="#FEC618"></path> + <path d="M496.91 426.39C497.11 426.22 497.32 425.88 497.28 425.66C497.24 425.48 496.94 424.99 496.46 425.14C495.98 425.29 496.24 425.89 496.31 426.14C496.35 426.28 496.83 426.46 496.92 426.39H496.91Z" fill="#FEC618"></path> + <path d="M501.42 418.59C501.63 418.52 502.15 418 501.98 417.74C501.81 417.48 501.27 417.47 501.12 417.56C500.89 417.7 500.45 418.02 500.62 418.28C500.79 418.54 501.21 418.66 501.42 418.59Z" fill="#FEC618"></path> + <path d="M497.86 421.89C498.31 421.7 498.47 421.27 498.22 420.85C497.97 420.43 497.53 420.38 497.18 420.62C496.83 420.86 496.9 421.38 497.01 421.56C497.14 421.77 497.41 422.08 497.86 421.89V421.89Z" fill="#FEC618"></path> + <path d="M467.56 369.81C468.06 370.32 469.12 370.53 470.09 370.4C470.38 370.36 470.66 370.18 470.91 369.93C471.5 370.24 472.24 370.4 472.84 370.33C472.62 370.63 472.5 370.95 472.55 371.26C472.66 371.98 470.98 371.75 471.07 372.75C471.15 373.7 470.05 374.26 470.29 375.46C470.53 376.66 471.54 377.67 472.47 377.1C472.77 376.91 473.01 376.7 473.2 376.46C473.37 376.62 473.57 376.76 473.81 376.86C474.93 377.36 476.54 376.73 477 375.63C477.41 374.63 476.77 373.07 475.74 372.55C475.72 372.55 475.71 372.55 475.69 372.53C476.36 372.08 476.88 371.39 476.42 370.4C476.31 370.16 476.11 369.96 475.88 369.79H467.56V369.81Z" fill="#FEC618"></path> + <path d="M494.45 421C495.08 419.77 494.63 418.37 493.42 417.81C492.36 417.32 491.31 417.6 490.88 418.48C490.3 419.65 490.79 421.55 491.77 421.96C492.77 422.38 493.96 421.95 494.45 420.99V421Z" fill="#FEC618"></path> + <path d="M504.36 420.36C504.93 420.67 505.7 420.39 506.01 419.77C506.35 419.1 506.17 418.35 505.61 418.05C505 417.73 504.22 417.93 503.89 418.49C503.54 419.09 503.78 420.05 504.36 420.36Z" fill="#FEC618"></path> + <path d="M500.16 424.51C500.71 424.88 501.36 424.82 501.79 424.31C502.02 424.03 502.13 423.51 502.04 423.16C501.86 422.45 501.3 422.31 499.94 422.51C499.76 423.2 499.3 423.94 500.16 424.51V424.51Z" fill="#FEC618"></path> + <path d="M494.08 408.75C494.08 408.2 492.55 407.38 492.03 407.89C491.62 408.29 491.6 409.16 491.99 409.51C492.55 410.01 494.09 409.29 494.08 408.74V408.75Z" fill="#FEC618"></path> + <path d="M485.17 410.73C485.46 410.84 486.02 410.67 486.24 410.43C486.63 409.99 486.37 409.38 485.93 409.2C485.61 409.07 484.71 408.88 484.41 409.56C484.11 410.24 484.89 410.62 485.17 410.73Z" fill="#FEC618"></path> + <path d="M485.77 423.05C485.52 423.09 485.18 423.51 485.16 423.79C485.14 424 485.56 424.62 485.93 424.62C486.3 424.62 486.61 423.81 486.56 423.57C486.51 423.34 486.02 423.01 485.77 423.05V423.05Z" fill="#FEC618"></path> + <path d="M512.6 422.18C512.87 421.55 512.56 420.85 511.89 420.56C512.15 420.3 512.35 419.94 512.48 419.48C512.64 418.88 512.77 418.37 513.31 417.97C514.11 417.39 514.11 416.44 514.09 415.58C514.08 414.78 513.25 413.97 512.43 413.75C512.35 413.73 512.27 413.72 512.2 413.7C512.72 413.5 513.19 413.14 513.39 412.68C513.72 411.97 513.26 411.14 512.25 410.64C511.49 410.26 510.35 410.47 510.06 411.05C509.65 411.86 510.03 413.31 510.75 413.7C510.85 413.76 510.97 413.8 511.1 413.82C510.81 413.96 510.55 414.19 510.3 414.52C509.69 415.33 509.61 416.2 509.63 417.15C509.63 417.48 509.55 417.87 509.37 418.14C508.64 419.22 508.84 420.13 509.99 420.76C509.85 420.86 509.74 420.99 509.69 421.13C509.49 421.66 509.91 422.39 510.6 422.71C511.42 423.09 512.32 422.85 512.61 422.18H512.6Z" fill="#FEC618"></path> + <path d="M504.92 408.79C505.13 408.26 505.1 407.76 504.63 407.47C503.49 406.77 502.3 406.19 500.93 406.17C500.91 405.75 500.8 405.3 500.57 404.85C500.03 403.78 499.02 403.42 497.99 403.91C496.97 404.41 496.48 405.8 496.87 406.88C496.6 406.99 496.59 407.5 496.68 407.72C496.75 407.9 497.27 408.27 497.59 408.13C497.69 408.08 497.74 407.98 497.77 407.86C498.18 408.07 498.67 408.19 499.14 408.17C499.24 408.57 499.52 408.95 499.98 409.23C500.72 409.68 501.56 410 502.4 410.24C503.29 410.5 504.56 409.67 504.91 408.79H504.92Z" fill="#FEC618"></path> + <path d="M490.19 435.47C491.17 435.9 493.22 435.22 493.71 434.31C494.25 433.32 493.64 431.81 492.49 431.28C491.48 430.81 489.81 431.36 489.36 432.31C488.79 433.51 489.2 435.04 490.19 435.47V435.47Z" fill="#FEC618"></path> + <path d="M510.28 404.96C510.67 404 510.1 402.43 509.26 402.11C508.62 401.87 507.61 402.42 507.27 403.2C507.11 403.56 507.05 403.9 507.09 404.2C506.68 404.14 506.2 404.27 505.91 404.3C505.37 404.36 505.19 405.05 505.45 405.64C505.73 406.27 506.23 406.51 506.75 406.1C507 405.9 507.52 405.59 507.7 405.19C507.84 405.29 507.99 405.39 508.17 405.47C509.11 405.89 510 405.68 510.29 404.96H510.28Z" fill="#FEC618"></path> + <path d="M515.92 427.03C516.02 427.07 516.13 427.1 516.25 427.12V423.79C515.96 423.97 515.71 424.28 515.5 424.71C515.05 425.63 515.26 426.74 515.92 427.03Z" fill="#FEC618"></path> + <path d="M506.3 383.58C506.91 383.89 508.2 383.31 508.51 382.59C508.75 382.02 508.48 381.09 507.99 380.83C507.51 380.58 507.02 380.48 506.58 380.49C506.15 379.89 505.66 379.34 504.7 379.38C504.09 379.41 503.49 379.28 502.95 378.71C502.91 378.67 502.87 378.64 502.82 378.61C503.36 378.57 503.79 378.02 503.99 377.71C504.3 377.23 503.89 376.83 503.43 376.6C503.98 376.19 504.1 375.24 503.7 374.2C503.48 373.62 502.5 373.25 501.89 373.51C501.17 373.83 500.6 374.92 500.83 375.53C501.05 376.08 501.66 376.54 502.27 376.72C502.17 376.82 502.1 376.94 502.09 377.09C502.06 377.38 501.95 377.93 502.14 378.29C501.53 378.14 500.84 378.27 500.48 378.58C499.99 379.01 499.59 381.42 500.09 382.36C501 382.83 502.17 383.47 503.38 384.04C503.53 384.11 503.92 383.91 504.08 383.73C504.52 383.24 505.01 383.03 505.67 382.96C505.84 383.23 506.06 383.46 506.3 383.59V383.58Z" fill="#FEC618"></path> + <path d="M505.06 427.32C505.81 427.74 506.57 427.57 506.88 426.92C507.21 426.23 506.92 424.7 506.4 424.4C505.6 423.92 504.61 424.27 504.07 425.22C503.68 425.91 504.09 426.78 505.06 427.32V427.32Z" fill="#FEC618"></path> + <path d="M499.47 376.11C499.69 376.01 500.21 375.93 500.44 375.64C500.94 374.96 500.74 373.92 500.17 373.57C500.11 373.54 500.05 373.51 499.98 373.49C499.98 373.42 499.98 373.36 499.98 373.29C500.56 373.18 501.28 373.05 501.33 372.14C500.25 370.85 499.88 370.93 499.28 372.45C498.47 372.74 497.75 372.81 497.36 373.2C496.94 373.62 496.73 374.33 496.63 374.94C496.51 375.69 497.27 376.23 498.23 376.06C498.49 376.01 498.79 375.94 499.06 375.83C499.19 375.93 499.32 376.02 499.47 376.11V376.11Z" fill="#FEC618"></path> + <path d="M490.95 378.75C491.44 379.02 492 379.01 492.32 378.53C492.59 378.13 492.84 377.5 492.7 377.09C492.4 376.2 491.66 376.34 490.9 376.38C490.35 376.22 489.78 376.47 489.51 377.06C489.21 377.71 489.39 378.31 489.96 378.59C490.25 378.73 490.6 378.77 490.94 378.75H490.95Z" fill="#FEC618"></path> + <path d="M504.67 416.81C505.63 416.72 506.08 415.53 505.77 414.86C505.47 414.19 504.35 413.9 503.66 414.71C503.38 415.03 503.33 415.77 503.5 416.19C503.63 416.52 504.28 416.85 504.67 416.82V416.81Z" fill="#FEC618"></path> + <path d="M501.81 400.23C501.37 400.15 500.85 400.19 500.59 400.43C500.33 400.66 500.34 401.86 500.85 402.1C501.39 402.37 502.08 402.1 502.36 401.53C502.62 401 502.41 400.34 501.81 400.23V400.23Z" fill="#FEC618"></path> + <path d="M497.13 401.89C497.94 402.33 498.67 402.21 498.74 401.7C498.74 401.67 498.74 401.63 498.74 401.59C499.01 401.65 499.24 401.67 499.38 401.6C500.28 401.19 500.55 400.1 500.02 399.07C499.62 398.29 498.8 398.15 497.73 398.67C496.86 399.1 496.49 399.86 496.84 400.49C496.88 400.56 496.94 400.64 497.02 400.72C497 400.76 496.98 400.8 496.96 400.84C496.87 401.21 497.08 401.65 497.12 401.88L497.13 401.89Z" fill="#FEC618"></path> + <path d="M495.14 387.51C495.13 386.94 495.66 385.94 495.1 385.56C494.54 385.18 493.74 385.89 493.18 386.03L493.11 386.42C493.29 387.15 493.52 387.25 494.05 387.44C494.58 387.64 494.97 387.56 495.14 387.5V387.51Z" fill="#FEC618"></path> + <path d="M515.85 431.72C515.99 431.8 516.12 431.84 516.25 431.87V429.42C515.91 429.53 515.6 429.78 515.41 430.16C515.13 430.74 515.31 431.4 515.85 431.71V431.72Z" fill="#FEC618"></path> + <path d="M510.82 431.95C511.13 431.19 510.76 430.5 510.18 430.28C509.63 430.07 509.38 430.42 509.18 430.81C508.89 431.37 509.09 432 509.66 432.09C510.07 432.16 510.52 431.99 510.82 431.95V431.95Z" fill="#FEC618"></path> + <path d="M505.81 435.37C505.52 435.93 505.72 436.56 506.29 436.65C506.7 436.72 507.15 436.55 507.45 436.51C507.76 435.75 507.39 435.06 506.81 434.84C506.26 434.63 506.01 434.98 505.81 435.37V435.37Z" fill="#FEC618"></path> + <path d="M497.44 412.13C496.48 412.08 496.25 413.35 496.39 413.81C496.53 414.28 498.67 414.01 498.96 413.53C499.24 413.06 498.4 412.17 497.44 412.12V412.13Z" fill="#FEC618"></path> + <path d="M492.73 397.53C493.05 397.07 492.42 396.54 492.18 396.42C491.93 396.3 491.4 396.2 491.19 396.62C490.97 397.04 491.27 397.42 491.49 397.58C491.7 397.73 492.41 397.99 492.73 397.53V397.53Z" fill="#FEC618"></path> + <path d="M514.44 451.45C514.32 451.59 514.24 452.26 514.52 452.42C514.8 452.58 515.25 452.14 515.41 451.94C515.5 451.83 515.47 451.4 515.24 451.3C515.01 451.2 514.59 451.28 514.44 451.45V451.45Z" fill="#FEC618"></path> + <path d="M502.06 434.13C501.88 434.01 501.19 433.93 501.05 434.2C500.91 434.47 501.3 435.03 501.5 435.11C501.71 435.2 502.17 435.19 502.33 434.92C502.48 434.65 502.25 434.25 502.07 434.13H502.06Z" fill="#FEC618"></path> + <path d="M501.83 444.99C502 444.68 501.53 444.29 501.32 444.16C501.19 444.08 500.75 444.16 500.65 444.36C500.54 444.57 500.8 444.95 500.98 445.13C501.08 445.23 501.66 445.29 501.83 444.99Z" fill="#FEC618"></path> + <path d="M496.24 388.62C496.34 388.47 496.17 388.36 496.12 388.19C495.93 388.24 495.75 388.23 495.67 388.32C495.62 388.37 495.69 388.67 495.73 388.68C495.89 388.7 496.14 388.78 496.24 388.63V388.62Z" fill="#FEC618"></path> + <path d="M506.76 447.24C507.44 446.95 507.25 447.13 507.86 447.59C508.47 448.05 509.59 448.31 510.02 447.03C510.45 445.75 509.46 444.57 508.39 444.09C507.32 443.61 505.2 444.73 504.96 446.14C504.79 447.15 506.07 447.54 506.75 447.24H506.76Z" fill="#FEC618"></path> + <path d="M510.48 458.27C510.67 458.33 511.25 458.37 511.38 457.85C511.5 457.34 510.97 457.17 510.74 457.11C510.56 457.06 510.13 457.35 510.1 457.53C510.07 457.77 510.28 458.19 510.48 458.26V458.27Z" fill="#FEC618"></path> + <path d="M516.25 439.2C515.82 438.69 515.06 438.21 514.55 438.22C513.85 438.22 513.11 438.19 512.88 439.15C512.71 439.85 512.45 440.52 512.23 441.21C511.7 441.86 511.85 442.5 512.42 442.88C513.04 443.29 513.72 443.13 514.28 442.49C514.47 442.28 514.67 442.05 514.89 441.86C515.41 441.87 515.96 441.69 516.25 441.4V439.2V439.2Z" fill="#FEC618"></path> + <path d="M46.29 310.31C54.0441 310.31 60.33 304.024 60.33 296.27C60.33 288.516 54.0441 282.23 46.29 282.23C38.5359 282.23 32.25 288.516 32.25 296.27C32.25 304.024 38.5359 310.31 46.29 310.31Z" fill="#F6947E"></path> + <path d="M305.94 34.34H287.45L296.69 18.32L305.94 2.31L315.18 18.32L324.42 34.34H305.94Z" fill="#FFD839"></path> + <path d="M664.27 428.57H647.55L639.19 443.05L647.55 457.53H664.27L672.62 443.05L664.27 428.57Z" fill="#42A4DC"></path> + </g> + <defs> + <clipPath id="clip0_8_64576"> + <rect width="731.64" height="503.94" fill="white"></rect> + </clipPath> + </defs> +</svg> diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index f193016e73f0d..6e35890bdcaa5 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -18,6 +18,7 @@ import { AppNavLinkStatus, } 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 { LicensingPluginStart } from '@kbn/licensing-plugin/public'; import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public'; @@ -29,6 +30,7 @@ import { ENTERPRISE_SEARCH_CONTENT_PLUGIN, ENTERPRISE_SEARCH_OVERVIEW_PLUGIN, WORKPLACE_SEARCH_PLUGIN, + SEARCH_EXPERIENCES_PLUGIN, } from '../common/constants'; import { InitialAppData } from '../common/types'; @@ -53,9 +55,10 @@ interface PluginsSetup { export interface PluginsStart { cloud?: CloudSetup & CloudStart; - licensing: LicensingPluginStart; charts: ChartsPluginStart; data: DataPublicPluginStart; + guidedOnboarding: GuidedOnboardingPluginStart; + licensing: LicensingPluginStart; security: SecurityPluginStart; } @@ -213,6 +216,27 @@ export class EnterpriseSearchPlugin implements Plugin { }, }); + core.application.register({ + id: SEARCH_EXPERIENCES_PLUGIN.ID, + title: SEARCH_EXPERIENCES_PLUGIN.NAME, + euiIconType: ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.LOGO, + appRoute: SEARCH_EXPERIENCES_PLUGIN.URL, + category: DEFAULT_APP_CATEGORIES.enterpriseSearch, + mount: async (params: AppMountParameters) => { + const kibanaDeps = await this.getKibanaDeps(core, params, cloud); + const { chrome, http } = kibanaDeps.core; + chrome.docTitle.change(SEARCH_EXPERIENCES_PLUGIN.NAME); + + await this.getInitialData(http); + const pluginData = this.getPluginData(); + + const { renderApp } = await import('./applications'); + const { SearchExperiences } = await import('./applications/search_experiences'); + + return renderApp(SearchExperiences, kibanaDeps, pluginData); + }, + }); + if (plugins.home) { plugins.home.featureCatalogue.registerSolution({ id: ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.ID, @@ -264,6 +288,16 @@ export class EnterpriseSearchPlugin implements Plugin { category: 'data', showOnHomePage: false, }); + + plugins.home.featureCatalogue.register({ + id: SEARCH_EXPERIENCES_PLUGIN.ID, + title: SEARCH_EXPERIENCES_PLUGIN.NAME, + icon: 'logoEnterpriseSearch', + description: SEARCH_EXPERIENCES_PLUGIN.DESCRIPTION, + path: SEARCH_EXPERIENCES_PLUGIN.URL, + category: 'data', + showOnHomePage: false, + }); } } diff --git a/x-pack/plugins/enterprise_search/server/__mocks__/fetch_indices.mock.ts b/x-pack/plugins/enterprise_search/server/__mocks__/fetch_indices.mock.ts index bcdf0404e9ecf..dc8d2b0b255eb 100644 --- a/x-pack/plugins/enterprise_search/server/__mocks__/fetch_indices.mock.ts +++ b/x-pack/plugins/enterprise_search/server/__mocks__/fetch_indices.mock.ts @@ -67,6 +67,20 @@ export const mockMultiIndexResponse = { 'search-alias-search-prefixed-regular-index': {}, }, }, + '.ent-search-engine-documents-12345': { + aliases: { + 'alias-.ent-search-engine-documents-12345': {}, + 'search-alias-.ent-search-engine-documents-12345': {}, + }, + settings: { index: { hidden: 'true' } }, + }, + 'search-prefixed-.ent-search-engine-documents-12345': { + aliases: { + 'alias-search-prefixed-.ent-search-engine-documents-12345': {}, + 'search-alias-search-prefixed-.ent-search-engine-documents-12345': {}, + }, + settings: { index: { hidden: 'true' } }, + }, }; export const mockMultiStatsResponse: { @@ -109,6 +123,24 @@ export const mockMultiStatsResponse: { 'search-prefixed-regular-index': { ...mockSingleIndexStatsResponse.indices['search-regular-index'], }, + '.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, + 'alias-.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, + 'search-alias-.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, + 'search-prefixed-.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, + 'alias-search-prefixed-.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, + 'search-alias-search-prefixed-.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, }, }; @@ -124,8 +156,8 @@ export const getIndexReturnValue = (indexName: string) => { ...mockMultiStatsResponse.indices[indexName], alias: indexName.startsWith('alias') || indexName.startsWith('search-alias'), count: 100, + hidden: indexName.includes('hidden') || indexName.includes('.ent-search-engine-documents'), name: indexName, - hidden: indexName.includes('hidden'), privileges: { manage: true, read: true }, total: { ...mockMultiStatsResponse.indices[indexName].total, diff --git a/x-pack/plugins/enterprise_search/server/index.ts b/x-pack/plugins/enterprise_search/server/index.ts index dfcfa8ba4627c..c91789eadac35 100644 --- a/x-pack/plugins/enterprise_search/server/index.ts +++ b/x-pack/plugins/enterprise_search/server/index.ts @@ -41,7 +41,7 @@ export const config: PluginConfigDescriptor<ConfigType> = { export const CONNECTORS_INDEX = '.elastic-connectors'; export const CURRENT_CONNECTORS_INDEX = '.elastic-connectors-v1'; export const CONNECTORS_JOBS_INDEX = '.elastic-connectors-sync-jobs'; -export const CONNECTORS_VERSION = '1'; +export const CONNECTORS_VERSION = 1; export const CRAWLERS_INDEX = '.ent-search-actastic-crawler2_configurations'; export const ANALYTICS_COLLECTIONS_INDEX = '.elastic-analytics-collections'; export const ANALYTICS_VERSION = '1'; diff --git a/x-pack/plugins/enterprise_search/server/index_management/setup_indices.test.ts b/x-pack/plugins/enterprise_search/server/index_management/setup_indices.test.ts index 69bc3c4ab7e6e..cea60531f2d2b 100644 --- a/x-pack/plugins/enterprise_search/server/index_management/setup_indices.test.ts +++ b/x-pack/plugins/enterprise_search/server/index_management/setup_indices.test.ts @@ -38,9 +38,86 @@ describe('Setup Indices', () => { configuration: { type: 'object', }, + description: { type: 'text' }, error: { type: 'keyword' }, + filtering: { + properties: { + active: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + validation: { + properties: { + errors: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + state: { type: 'keyword' }, + }, + }, + }, + }, + domain: { type: 'keyword' }, + draft: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + validation: { + properties: { + errors: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + state: { type: 'keyword' }, + }, + }, + }, + }, + }, + }, index_name: { type: 'keyword' }, + is_native: { type: 'boolean' }, language: { type: 'keyword' }, + last_deleted_document_count: { type: 'long' }, + last_indexed_document_count: { type: 'long' }, last_seen: { type: 'date' }, last_sync_error: { type: 'keyword' }, last_sync_status: { type: 'keyword' }, @@ -72,14 +149,41 @@ describe('Setup Indices', () => { }, properties: { completed_at: { type: 'date' }, - connector: { properties: connectorsMappings.properties }, connector_id: { type: 'keyword', }, created_at: { type: 'date' }, deleted_document_count: { type: 'integer' }, - error: { - type: 'keyword', + error: { type: 'keyword' }, + filtering: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + domain: { type: 'keyword' }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + warnings: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + }, }, indexed_document_count: { type: 'integer' }, status: { diff --git a/x-pack/plugins/enterprise_search/server/index_management/setup_indices.ts b/x-pack/plugins/enterprise_search/server/index_management/setup_indices.ts index bf6d2d3f96011..8ac6b2e232eef 100644 --- a/x-pack/plugins/enterprise_search/server/index_management/setup_indices.ts +++ b/x-pack/plugins/enterprise_search/server/index_management/setup_indices.ts @@ -28,15 +28,88 @@ interface IndexDefinition { } const connectorMappingsProperties: Record<string, MappingProperty> = { - api_key_id: { - type: 'keyword', - }, - configuration: { - type: 'object', - }, + api_key_id: { type: 'keyword' }, + configuration: { type: 'object' }, + description: { type: 'text' }, error: { type: 'keyword' }, + filtering: { + properties: { + active: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + validation: { + properties: { + errors: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + state: { type: 'keyword' }, + }, + }, + }, + }, + domain: { type: 'keyword' }, + draft: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + validation: { + properties: { + errors: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + state: { type: 'keyword' }, + }, + }, + }, + }, + }, + }, index_name: { type: 'keyword' }, + is_native: { type: 'boolean' }, language: { type: 'keyword' }, + last_deleted_document_count: { type: 'long' }, + last_indexed_document_count: { type: 'long' }, last_seen: { type: 'date' }, last_sync_error: { type: 'keyword' }, last_sync_status: { type: 'keyword' }, @@ -87,7 +160,7 @@ const indices: IndexDefinition[] = [ mappings: { _meta: { pipeline: defaultConnectorsPipelineMeta, - version: '1', + version: 1, }, properties: connectorMappingsProperties, }, @@ -98,23 +171,46 @@ const indices: IndexDefinition[] = [ aliases: ['.elastic-connectors-sync-jobs'], mappings: { _meta: { - version: '1', + version: 1, }, properties: { completed_at: { type: 'date' }, - connector: { properties: connectorMappingsProperties }, - connector_id: { - type: 'keyword', - }, + connector_id: { type: 'keyword' }, created_at: { type: 'date' }, deleted_document_count: { type: 'integer' }, - error: { - type: 'keyword', + error: { type: 'keyword' }, + filtering: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + domain: { type: 'keyword' }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + warnings: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + }, }, indexed_document_count: { type: 'integer' }, - status: { - type: 'keyword', - }, + status: { type: 'keyword' }, worker_hostname: { type: 'keyword' }, }, }, diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts index cad0b3b88e38e..d97a6f0b7999b 100644 --- a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts @@ -88,6 +88,57 @@ describe('addConnector lib function', () => { configuration: {}, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + }, + ], index_name: 'index_name', is_native: false, language: 'fr', @@ -219,6 +270,57 @@ describe('addConnector lib function', () => { configuration: {}, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + }, + ], index_name: 'index_name', is_native: true, language: null, @@ -272,6 +374,57 @@ describe('addConnector lib function', () => { configuration: {}, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + }, + ], index_name: 'search-index_name', is_native: false, language: 'en', diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts index 1b02dda8d26ad..05a3b9ab4b7e2 100644 --- a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts @@ -7,9 +7,14 @@ import { IScopedClusterClient } from '@kbn/core/server'; -import { CONNECTORS_INDEX } from '../..'; -import { CONNECTORS_VERSION } from '../..'; -import { ConnectorDocument, ConnectorStatus } from '../../../common/types/connectors'; +import { CONNECTORS_INDEX, CONNECTORS_VERSION } from '../..'; +import { + ConnectorDocument, + ConnectorStatus, + FilteringPolicy, + FilteringRuleRule, + FilteringValidationState, +} from '../../../common/types/connectors'; import { ErrorCode } from '../../../common/types/error_codes'; import { DefaultConnectorsPipelineMeta, @@ -84,11 +89,63 @@ export const addConnector = async ( connectorsIndicesMapping[`${CONNECTORS_INDEX}-v${CONNECTORS_VERSION}`]?.mappings?._meta ?.pipeline; + const currentTimestamp = new Date().toISOString(); const document: ConnectorDocument = { api_key_id: null, configuration: {}, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: currentTimestamp, + updated_at: currentTimestamp, + value: {}, + }, + rules: [ + { + created_at: currentTimestamp, + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: currentTimestamp, + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: currentTimestamp, + updated_at: currentTimestamp, + value: {}, + }, + rules: [ + { + created_at: currentTimestamp, + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: currentTimestamp, + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + }, + ], index_name: input.index_name, is_native: input.is_native, language: input.language, diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/post_cancel_syncs.test.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/post_cancel_syncs.test.ts new file mode 100644 index 0000000000000..ed4544cdeb2eb --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/post_cancel_syncs.test.ts @@ -0,0 +1,90 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IScopedClusterClient } from '@kbn/core/server'; + +import { CONNECTORS_INDEX, CONNECTORS_JOBS_INDEX } from '../..'; +import { SyncStatus } from '../../../common/types/connectors'; + +import { cancelSyncs } from './post_cancel_syncs'; + +describe('addConnector lib function', () => { + const mockClient = { + asCurrentUser: { + update: jest.fn(), + updateByQuery: jest.fn(), + }, + asInternalUser: {}, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should call updateByQuery to cancel syncs', async () => { + mockClient.asCurrentUser.updateByQuery.mockImplementation(() => ({ _id: 'fakeId' })); + + await expect( + cancelSyncs(mockClient as unknown as IScopedClusterClient, 'connectorId') + ).resolves.toEqual(undefined); + expect(mockClient.asCurrentUser.updateByQuery).toHaveBeenCalledTimes(2); + expect(mockClient.asCurrentUser.updateByQuery).toHaveBeenCalledWith({ + index: CONNECTORS_JOBS_INDEX, + query: { + bool: { + must: [ + { + term: { + connector_id: 'connectorId', + }, + }, + { + terms: { + status: [SyncStatus.IN_PROGRESS], + }, + }, + ], + }, + }, + refresh: true, + script: { + lang: 'painless', + source: `ctx._source['status'] = '${SyncStatus.CANCELING}'`, + }, + }); + expect(mockClient.asCurrentUser.updateByQuery).toHaveBeenCalledWith({ + index: CONNECTORS_JOBS_INDEX, + query: { + bool: { + must: [ + { + term: { + connector_id: 'connectorId', + }, + }, + { + terms: { + status: [SyncStatus.PENDING, SyncStatus.SUSPENDED], + }, + }, + ], + }, + }, + refresh: true, + script: { + lang: 'painless', + source: `ctx._source['status'] = '${SyncStatus.CANCELED}'`, + }, + }); + await expect(mockClient.asCurrentUser.update).toHaveBeenCalledWith({ + doc: { last_sync_status: SyncStatus.CANCELED, sync_now: false }, + id: 'connectorId', + index: CONNECTORS_INDEX, + refresh: true, + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/post_cancel_syncs.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/post_cancel_syncs.ts new file mode 100644 index 0000000000000..91b439f072d94 --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/post_cancel_syncs.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 { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; + +import { CONNECTORS_INDEX, CONNECTORS_JOBS_INDEX } from '../..'; +import { SyncStatus } from '../../../common/types/connectors'; + +export const cancelSyncs = async ( + client: IScopedClusterClient, + connectorId: string +): Promise<void> => { + await client.asCurrentUser.updateByQuery({ + index: CONNECTORS_JOBS_INDEX, + query: { + bool: { + must: [ + { + term: { + connector_id: connectorId, + }, + }, + { + terms: { + status: [SyncStatus.PENDING, SyncStatus.SUSPENDED], + }, + }, + ], + }, + }, + refresh: true, + script: { + lang: 'painless', + source: `ctx._source['status'] = '${SyncStatus.CANCELED}'`, + }, + }); + await client.asCurrentUser.updateByQuery({ + index: CONNECTORS_JOBS_INDEX, + query: { + bool: { + must: [ + { + term: { + connector_id: connectorId, + }, + }, + { + terms: { + status: [SyncStatus.IN_PROGRESS], + }, + }, + ], + }, + }, + refresh: true, + script: { + lang: 'painless', + source: `ctx._source['status'] = '${SyncStatus.CANCELING}'`, + }, + }); + await client.asCurrentUser.update({ + doc: { last_sync_status: SyncStatus.CANCELED, sync_now: false }, + id: connectorId, + index: CONNECTORS_INDEX, + refresh: true, + }); +}; diff --git a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts index c9ccd1841cf76..df7fee347161d 100644 --- a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts @@ -223,7 +223,7 @@ describe('callEnterpriseSearchConfigAPI', () => { }); it('handles timeouts', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); // Warning callEnterpriseSearchConfigAPI(mockDependencies); diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.test.ts b/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.test.ts index 4a01295fbeaa8..767587a26cf77 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.test.ts @@ -385,7 +385,13 @@ describe('fetchIndices lib function', () => { expect(mockClient.asCurrentUser.indices.stats).not.toHaveBeenCalled(); }); - describe('alwaysShowSearchPattern', () => { + describe('alwaysShowPattern', () => { + const sortIndices = (index1: any, index2: any) => { + if (index1.name < index2.name) return -1; + if (index1.name > index2.name) return 1; + return 0; + }; + beforeEach(() => { mockClient.asCurrentUser.indices.get.mockImplementation(() => mockMultiIndexResponse); mockClient.asCurrentUser.indices.stats.mockImplementation(() => mockMultiStatsResponse); @@ -401,13 +407,14 @@ describe('fetchIndices lib function', () => { '*', false, true, - 'search-' + { alias_pattern: 'search-', index_pattern: '.ent-search-engine-documents' } ); // This is the list of mock indices and aliases that are: // - Non-hidden indices and aliases + // - hidden indices that starts with ".ent-search-engine-documents" // - search- prefixed aliases that point to hidden indices - expect(returnValue).toEqual( + expect(returnValue.sort(sortIndices)).toEqual( [ 'regular-index', 'alias-regular-index', @@ -415,9 +422,14 @@ describe('fetchIndices lib function', () => { 'search-prefixed-regular-index', 'alias-search-prefixed-regular-index', 'search-alias-search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'search-alias-.ent-search-engine-documents-12345', + 'search-alias-search-prefixed-.ent-search-engine-documents-12345', 'search-alias-hidden-index', 'search-alias-search-prefixed-hidden-index', - ].map(getIndexReturnValue) + ] + .map(getIndexReturnValue) + .sort(sortIndices) ); // This is the list of mock indices and aliases that are: @@ -430,6 +442,9 @@ describe('fetchIndices lib function', () => { 'search-prefixed-hidden-index', 'alias-hidden-index', 'alias-search-prefixed-hidden-index', + 'alias-.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', + 'alias-search-prefixed-.ent-search-engine-documents-12345', ].map(getIndexReturnValue) ) ); @@ -463,11 +478,19 @@ describe('fetchIndices lib function', () => { '*', true, true, - 'search-' + { alias_pattern: 'search-', index_pattern: '.ent-search-engine-documents' } ); expect(returnValue).toEqual( - expect.arrayContaining(Object.keys(mockMultiStatsResponse.indices).map(getIndexReturnValue)) + expect.not.arrayContaining(['alias-.ent-search-engine-documents-12345']) + ); + + // this specific alias should not be returned because... + const expectedIndices = Object.keys(mockMultiStatsResponse.indices).filter( + (indexName) => indexName !== 'alias-.ent-search-engine-documents-12345' + ); + expect(returnValue.sort(sortIndices)).toEqual( + expectedIndices.map(getIndexReturnValue).sort(sortIndices) ); expect(mockClient.asCurrentUser.indices.get).toHaveBeenCalledWith({ diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.ts b/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.ts index fd9180ba71130..e0a1750d2a8e4 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.ts @@ -13,7 +13,7 @@ import { } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { IScopedClusterClient } from '@kbn/core/server'; -import { ElasticsearchIndexWithPrivileges } from '../../../common/types/indices'; +import { AlwaysShowPattern, ElasticsearchIndexWithPrivileges } from '../../../common/types/indices'; import { fetchIndexCounts } from './fetch_index_counts'; import { fetchIndexPrivileges } from './fetch_index_privileges'; @@ -34,12 +34,14 @@ export const fetchIndices = async ( indexPattern: string, returnHiddenIndices: boolean, includeAliases: boolean, - alwaysShowSearchPattern?: 'search-' + alwaysShowPattern?: AlwaysShowPattern ): Promise<ElasticsearchIndexWithPrivileges[]> => { // This call retrieves alias and settings information about indices - // If we provide an override pattern with alwaysShowSearchPattern we get everything and filter out hiddens. + // If we provide an override pattern with alwaysShowPattern we get everything and filter out hiddens. const expandWildcards: ExpandWildcard[] = - returnHiddenIndices || alwaysShowSearchPattern ? ['hidden', 'all'] : ['open']; + returnHiddenIndices || alwaysShowPattern?.alias_pattern || alwaysShowPattern?.index_pattern + ? ['hidden', 'all'] + : ['open']; const { allIndexMatches, indexAndAliasNames, indicesNames, alwaysShowMatchNames } = await getIndexData( @@ -48,7 +50,7 @@ export const fetchIndices = async ( expandWildcards, returnHiddenIndices, includeAliases, - alwaysShowSearchPattern + alwaysShowPattern ); if (indicesNames.length === 0) { @@ -80,19 +82,28 @@ export const fetchIndices = async ( privileges: { manage: false, read: false, ...indexPrivileges[name] }, }; return includeAliases - ? [indexEntry, ...expandAliases(name, aliases, indexData, totalIndexData)] + ? [ + indexEntry, + ...expandAliases( + name, + aliases, + indexData, + totalIndexData, + ...(name.startsWith('.ent-search-engine-documents') ? [alwaysShowPattern] : []) + ), + ] : [indexEntry]; }); let indicesData = regularIndexData; - if (alwaysShowSearchPattern && includeAliases) { + if (alwaysShowPattern?.alias_pattern && includeAliases) { const indexNamesAlreadyIncluded = regularIndexData.map(({ name }) => name); const itemsToInclude = getAlwaysShowAliases(indexNamesAlreadyIncluded, alwaysShowMatchNames) .map(getIndexDataMapper(totalIndexData)) .flatMap(({ name, aliases, ...indexData }) => { - return expandAliases(name, aliases, indexData, totalIndexData, alwaysShowSearchPattern); + return expandAliases(name, aliases, indexData, totalIndexData, alwaysShowPattern); }); indicesData = [...indicesData, ...itemsToInclude]; diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/delete_ml_inference_pipeline.test.ts b/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/delete_ml_inference_pipeline.test.ts index 8782dcc772d75..9fc5f27b12ce7 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/delete_ml_inference_pipeline.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/delete_ml_inference_pipeline.test.ts @@ -8,6 +8,8 @@ import { errors } from '@elastic/elasticsearch'; import { ElasticsearchClient } from '@kbn/core/server'; +import { ErrorCode } from '../../../../../../common/types/error_codes'; + import { deleteMlInferencePipeline } from './delete_ml_inference_pipeline'; describe('deleteMlInferencePipeline lib function', () => { @@ -72,7 +74,9 @@ describe('deleteMlInferencePipeline lib function', () => { }); it('should succeed when parent pipeline is missing', async () => { - mockClient.ingest.getPipeline.mockImplementation(() => Promise.reject(notFoundError)); + mockClient.ingest.getPipeline + .mockImplementationOnce(() => Promise.resolve({})) // 1st call (get *@ml-inference) + .mockImplementation(() => Promise.reject(notFoundError)); // Subsequent calls mockClient.ingest.deletePipeline.mockImplementation(() => Promise.resolve({ acknowledged: true }) ); @@ -115,4 +119,36 @@ describe('deleteMlInferencePipeline lib function', () => { id: 'my-ml-pipeline', }); }); + + it("should fail when pipeline is used in another index's pipeline", async () => { + const mockGetPipelines = { + ...mockGetPipeline, // References my-ml-pipeline + 'my-other-index@ml-inference': { + id: 'my-other-index@ml-inference', + processors: [ + { + pipeline: { + name: 'my-ml-pipeline', // Also references my-ml-pipeline + }, + }, + ], + }, + }; + + mockClient.ingest.getPipeline + .mockImplementationOnce(() => Promise.resolve(mockGetPipelines)) // 1st call + .mockImplementation(() => Promise.resolve(mockGetPipeline)); // Subsequent calls + mockClient.ingest.deletePipeline.mockImplementation(() => Promise.reject(notFoundError)); + + await expect( + deleteMlInferencePipeline( + 'my-index', + 'my-ml-pipeline', + mockClient as unknown as ElasticsearchClient + ) + ).rejects.toThrow(ErrorCode.PIPELINE_IS_IN_USE); + + expect(mockClient.ingest.putPipeline).toHaveBeenCalledTimes(0); + expect(mockClient.ingest.deletePipeline).toHaveBeenCalledTimes(0); + }); }); diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/delete_ml_inference_pipeline.ts b/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/delete_ml_inference_pipeline.ts index 6cb74d75dd6ce..0d9609e05bba4 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/delete_ml_inference_pipeline.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/delete_ml_inference_pipeline.ts @@ -7,8 +7,11 @@ import { ElasticsearchClient } from '@kbn/core/server'; +import { ErrorCode } from '../../../../../../common/types/error_codes'; import { DeleteMlInferencePipelineResponse } from '../../../../../../common/types/pipelines'; +import { getInferencePipelineNameFromIndexName } from '../../../../../utils/ml_inference_pipeline_utils'; + import { detachMlInferencePipeline } from './detach_ml_inference_pipeline'; export const deleteMlInferencePipeline = async ( @@ -16,22 +19,66 @@ export const deleteMlInferencePipeline = async ( pipelineName: string, client: ElasticsearchClient ) => { - let response: DeleteMlInferencePipelineResponse = {}; + // Check if the pipeline is in use in a different index's managed pipeline + const otherPipelineName = await findUsageInOtherManagedPipelines(pipelineName, indexName, client); + if (otherPipelineName) { + throw Object.assign(new Error(ErrorCode.PIPELINE_IS_IN_USE), { + pipelineName: otherPipelineName, + }); + } + + // Detach the pipeline first + const response = await detachPipeline(indexName, pipelineName, client); + + // Finally, delete pipeline + const deleteResponse = await client.ingest.deletePipeline({ id: pipelineName }); + if (deleteResponse.acknowledged === true) { + response.deleted = pipelineName; + } + return response; +}; + +const detachPipeline = async ( + indexName: string, + pipelineName: string, + client: ElasticsearchClient +): Promise<DeleteMlInferencePipelineResponse> => { try { - response = await detachMlInferencePipeline(indexName, pipelineName, client); + return await detachMlInferencePipeline(indexName, pipelineName, client); } catch (error) { // only suppress Not Found error if (error.meta?.statusCode !== 404) { throw error; } - } - // finally, delete pipeline - const deleteResponse = await client.ingest.deletePipeline({ id: pipelineName }); - if (deleteResponse.acknowledged === true) { - response.deleted = pipelineName; + return {}; } +}; - return response; +const findUsageInOtherManagedPipelines = async ( + pipelineName: string, + indexName: string, + client: ElasticsearchClient +): Promise<string | undefined> => { + try { + // Fetch all managed parent ML pipelines + const pipelines = await client.ingest.getPipeline({ + id: '*@ml-inference', + }); + + // The given inference pipeline is being used in another index's managed pipeline if: + // - The index name is different from the one we're deleting from, AND + // - Its processors contain at least one entry in which the supplied pipeline name is referenced + return Object.entries(pipelines).find( + ([name, pipeline]) => + name !== getInferencePipelineNameFromIndexName(indexName) && + pipeline.processors?.find((processor) => processor.pipeline?.name === pipelineName) + )?.[0]; // Managed pipeline name + } catch (error) { + // only suppress Not Found error + if (error.meta?.statusCode !== 404) { + throw error; + } + } }; diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/get_ml_inference_pipeline_processors.ts b/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/get_ml_inference_pipeline_processors.ts index 12902b896e0d8..4a2ba80ca43ab 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/get_ml_inference_pipeline_processors.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/pipelines/ml_inference/pipeline_processors/get_ml_inference_pipeline_processors.ts @@ -202,7 +202,7 @@ export const fetchMlInferencePipelineProcessors = async ( indexName: string ): Promise<InferencePipeline[]> => { if (!trainedModelsProvider) { - return Promise.reject(new Error('Machine Learning is not enabled')); + throw new Error('Machine Learning is not enabled'); } const allMlPipelines = await fetchMlInferencePipelines(client); diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.test.ts b/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.test.ts index 927109359c31e..720cbb9e0484d 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.test.ts @@ -87,13 +87,13 @@ describe('expandAliases util function', () => { ]); }); - it('expands only aliases that starts with alwaysShowSearchPattern', () => { + it('expands only aliases that starts with alwaysShowPattern', () => { const expandedAliasList = expandAliases( mockIndexName, mockAliases, mockIndex, mockIndicesData, - 'search-' + { alias_pattern: 'search-', index_pattern: '.ent-search-engine-documents' } ); expect(expandedAliasList).toEqual([ diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.ts b/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.ts index 47103639b7866..55a17bf7ba0fa 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.ts @@ -7,7 +7,7 @@ import { SecurityHasPrivilegesPrivileges } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { ElasticsearchIndex } from '../../../../common/types/indices'; +import { AlwaysShowPattern, ElasticsearchIndex } from '../../../../common/types/indices'; export const getAlwaysShowAliases = (indexAndAliasNames: string[], alwaysShowNames: string[]) => { if (alwaysShowNames.length === 0) return []; @@ -23,10 +23,10 @@ export const expandAliases = ( indexCounts: Record<string, number>; indexPrivileges: Record<string, SecurityHasPrivilegesPrivileges>; }, - alwaysShowSearchPattern?: 'search-' + alwaysShowPattern?: AlwaysShowPattern ) => { - const filteredAliases = alwaysShowSearchPattern - ? aliases.filter((alias) => alias.startsWith(alwaysShowSearchPattern)) + const filteredAliases = alwaysShowPattern + ? aliases.filter((alias) => alias.startsWith(alwaysShowPattern.alias_pattern)) : aliases; return filteredAliases.map((alias) => ({ alias: true, diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.test.ts b/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.test.ts index 7e9859a4e8076..cfbec2012bb72 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.test.ts @@ -116,12 +116,16 @@ describe('getIndexData util function', () => { 'regular-index', 'search-prefixed-hidden-index', 'search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', ], indicesNames: [ 'hidden-index', 'regular-index', 'search-prefixed-hidden-index', 'search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', ], }); }); @@ -164,21 +168,29 @@ describe('getIndexData util function', () => { 'search-prefixed-regular-index', 'alias-search-prefixed-regular-index', 'search-alias-search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'alias-.ent-search-engine-documents-12345', + 'search-alias-.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', + 'alias-search-prefixed-.ent-search-engine-documents-12345', + 'search-alias-search-prefixed-.ent-search-engine-documents-12345', ], indicesNames: [ 'hidden-index', 'regular-index', 'search-prefixed-hidden-index', 'search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', ], }); }); // This is a happy path tests for a case where we set all parameter on route // There are other possible cases where if you set includeAliases to false and still - // pass a search- pattern. you will get some weird results back. It won't be false but + // pass a 'search-' pattern and '.ent-search-engine-documents'. you will get some weird results back. It won't be false but // useless. These will go away on the next iterations we have. - it('returns non-hidden and alwaysShowSearchPattern matching indices', async () => { + it('returns non-hidden and alwaysShowPattern matching indices ', async () => { mockClient.asCurrentUser.indices.get.mockImplementationOnce(() => { return mockMultiIndexResponse; }); @@ -189,7 +201,7 @@ describe('getIndexData util function', () => { ['hidden', 'all'], false, true, - 'search-' + { alias_pattern: 'search-', index_pattern: '.ent-search-engine-documents' } ); expect(mockClient.asCurrentUser.indices.get).toHaveBeenCalledWith({ @@ -206,6 +218,8 @@ describe('getIndexData util function', () => { 'regular-index', 'search-prefixed-hidden-index', 'search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', ], expandWildcards: ['hidden', 'all'], indexAndAliasNames: [ @@ -221,8 +235,18 @@ describe('getIndexData util function', () => { 'search-prefixed-regular-index', 'alias-search-prefixed-regular-index', 'search-alias-search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'alias-.ent-search-engine-documents-12345', + 'search-alias-.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', + 'alias-search-prefixed-.ent-search-engine-documents-12345', + 'search-alias-search-prefixed-.ent-search-engine-documents-12345', + ], + indicesNames: [ + 'regular-index', + 'search-prefixed-regular-index', + '.ent-search-engine-documents-12345', ], - indicesNames: ['regular-index', 'search-prefixed-regular-index'], }); }); }); diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.ts b/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.ts index e3c667141e95d..7ac4b8d2d858b 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.ts @@ -9,6 +9,8 @@ import { ExpandWildcard } from '@elastic/elasticsearch/lib/api/types'; import { IScopedClusterClient } from '@kbn/core/server'; +import { AlwaysShowPattern } from '../../../../common/types/indices'; + import { TotalIndexData } from '../fetch_indices'; import { mapIndexStats } from './map_index_stats'; @@ -19,7 +21,7 @@ export const getIndexData = async ( expandWildcards: ExpandWildcard[], returnHiddenIndices: boolean, includeAliases: boolean, - alwaysShowSearchPattern?: 'search-' + alwaysShowPattern?: AlwaysShowPattern ) => { const totalIndices = await client.asCurrentUser.indices.get({ expand_wildcards: expandWildcards, @@ -31,7 +33,7 @@ export const getIndexData = async ( index: indexPattern, }); - // Index names that with one of their aliases match with the alwaysShowSearchPattern + // Index names that with one of their aliases match with the alwaysShowPattern const alwaysShowPatternMatches = new Set<string>(); const indexAndAliasNames: string[] = Object.keys(totalIndices).reduce( @@ -44,7 +46,10 @@ export const getIndexData = async ( accum.push(alias); // Add indexName to the set if an alias matches the pattern - if (alwaysShowSearchPattern && alias.startsWith(alwaysShowSearchPattern)) { + if ( + alwaysShowPattern?.alias_pattern && + alias.startsWith(alwaysShowPattern?.alias_pattern) + ) { alwaysShowPatternMatches.add(indexName); } }); @@ -57,7 +62,10 @@ export const getIndexData = async ( const indicesNames = returnHiddenIndices ? Object.keys(totalIndices) : Object.keys(totalIndices).filter( - (indexName) => !(totalIndices[indexName]?.settings?.index?.hidden === 'true') + (indexName) => + !(totalIndices[indexName]?.settings?.index?.hidden === 'true') || + (alwaysShowPattern?.index_pattern && + indexName.startsWith(alwaysShowPattern.index_pattern)) ); return { allIndexMatches: totalIndices, diff --git a/x-pack/plugins/enterprise_search/server/lib/pipelines/ml_inference/get_ml_inference_pipelines.test.ts b/x-pack/plugins/enterprise_search/server/lib/pipelines/ml_inference/get_ml_inference_pipelines.test.ts index b05a9bb15d5e8..0765fafcc9d1d 100644 --- a/x-pack/plugins/enterprise_search/server/lib/pipelines/ml_inference/get_ml_inference_pipelines.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/pipelines/ml_inference/get_ml_inference_pipelines.test.ts @@ -105,10 +105,10 @@ describe('getMlInferencePipelines', () => { expect( (actualPipelines.pipeline1.processors as IngestProcessorContainer[])[1].inference?.model_id - ).toBeDefined(); + ).toEqual('model1'); expect( (actualPipelines.pipeline2.processors as IngestProcessorContainer[])[1].inference?.model_id - ).toBeDefined(); + ).toEqual('model2'); expect( (actualPipelines.pipeline3.processors as IngestProcessorContainer[])[1].inference?.model_id ).toEqual(''); // Redacted model ID @@ -117,7 +117,7 @@ describe('getMlInferencePipelines', () => { ).toEqual(''); expect( (actualPipelines.pipeline4.processors as IngestProcessorContainer[])[2].inference?.model_id - ).toBeDefined(); + ).toEqual('model2'); expect( (actualPipelines.pipeline4.processors as IngestProcessorContainer[])[3].inference?.model_id ).toEqual(''); diff --git a/x-pack/plugins/enterprise_search/server/lib/pipelines/ml_inference/get_ml_inference_pipelines.ts b/x-pack/plugins/enterprise_search/server/lib/pipelines/ml_inference/get_ml_inference_pipelines.ts index 4bdf7e95d4a06..2dfc6951b2224 100644 --- a/x-pack/plugins/enterprise_search/server/lib/pipelines/ml_inference/get_ml_inference_pipelines.ts +++ b/x-pack/plugins/enterprise_search/server/lib/pipelines/ml_inference/get_ml_inference_pipelines.ts @@ -20,7 +20,7 @@ export const getMlInferencePipelines = async ( trainedModelsProvider: MlTrainedModels | undefined ): Promise<Record<string, IngestPipeline>> => { if (!trainedModelsProvider) { - return Promise.reject(new Error('Machine Learning is not enabled')); + throw new Error('Machine Learning is not enabled'); } // Fetch all ML inference pipelines and trained models that are accessible in the current @@ -37,17 +37,22 @@ export const getMlInferencePipelines = async ( // Process pipelines: check if the model_id is one of the redacted ones, if so, redact it in the // result as well - const inferencePipelinesResult: Record<string, IngestPipeline> = {}; - Object.entries(fetchedInferencePipelines).forEach(([name, inferencePipeline]) => { - inferencePipelinesResult[name] = { - ...inferencePipeline, - processors: inferencePipeline.processors?.map((processor) => - redactModelIdIfInaccessible(processor, accessibleModelIds) - ), - }; - }); + const inferencePipelinesResult: Record<string, IngestPipeline> = Object.entries( + fetchedInferencePipelines + ).reduce( + (currentPipelines, [name, inferencePipeline]) => ({ + ...currentPipelines, + [name]: { + ...inferencePipeline, + processors: inferencePipeline.processors?.map((processor) => + redactModelIdIfInaccessible(processor, accessibleModelIds) + ), + }, + }), + {} + ); - return Promise.resolve(inferencePipelinesResult); + return inferencePipelinesResult; }; /** diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index 90620af30f6b8..436e412958178 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -30,6 +30,7 @@ import { ANALYTICS_PLUGIN, APP_SEARCH_PLUGIN, WORKPLACE_SEARCH_PLUGIN, + SEARCH_EXPERIENCES_PLUGIN, ENTERPRISE_SEARCH_RELEVANCE_LOGS_SOURCE_ID, ENTERPRISE_SEARCH_AUDIT_LOGS_SOURCE_ID, ENTERPRISE_SEARCH_ANALYTICS_LOGS_SOURCE_ID, @@ -110,6 +111,7 @@ export class EnterpriseSearchPlugin implements Plugin { ANALYTICS_PLUGIN.ID, APP_SEARCH_PLUGIN.ID, WORKPLACE_SEARCH_PLUGIN.ID, + SEARCH_EXPERIENCES_PLUGIN.ID, ]; if (customIntegrations) { @@ -158,6 +160,7 @@ export class EnterpriseSearchPlugin implements Plugin { elasticsearch: showEnterpriseSearch, appSearch: hasAppSearchAccess, workplaceSearch: hasWorkplaceSearchAccess, + searchExperiences: showEnterpriseSearch, }, catalogue: { enterpriseSearch: showEnterpriseSearch, @@ -166,6 +169,7 @@ export class EnterpriseSearchPlugin implements Plugin { elasticsearch: showEnterpriseSearch, appSearch: hasAppSearchAccess, workplaceSearch: hasWorkplaceSearchAccess, + searchExperiences: showEnterpriseSearch, }, }; }); diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/connectors.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/connectors.ts index 9663b216ec91c..81207f19d1261 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/connectors.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/connectors.ts @@ -14,6 +14,7 @@ import { ConnectorStatus } from '../../../common/types/connectors'; import { ErrorCode } from '../../../common/types/error_codes'; import { addConnector } from '../../lib/connectors/add_connector'; import { fetchSyncJobsByConnectorId } from '../../lib/connectors/fetch_sync_jobs'; +import { cancelSyncs } from '../../lib/connectors/post_cancel_syncs'; import { startConnectorSync } from '../../lib/connectors/start_sync'; import { updateConnectorConfiguration } from '../../lib/connectors/update_connector_configuration'; import { updateConnectorNameAndDescription } from '../../lib/connectors/update_connector_name_and_description'; @@ -69,6 +70,22 @@ export function registerConnectorRoutes({ router, log }: RouteDependencies) { }) ); + router.post( + { + path: '/internal/enterprise_search/connectors/{connectorId}/cancel_syncs', + validate: { + params: schema.object({ + connectorId: schema.string(), + }), + }, + }, + elasticsearchErrorHandler(log, async (context, request, response) => { + const { client } = (await context.core).elasticsearch; + await cancelSyncs(client, request.params.connectorId); + return response.ok(); + }) + ); + router.post( { path: '/internal/enterprise_search/connectors/{connectorId}/configuration', diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.test.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.test.ts index 52039cc48173b..3fd65abfdba5f 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.test.ts @@ -449,6 +449,26 @@ describe('Enterprise Search Managed Indices', () => { ); expect(mockRouter.response.customError).toHaveBeenCalledTimes(1); }); + + it('raises error if the pipeline is in use', async () => { + (deleteMlInferencePipeline as jest.Mock).mockImplementationOnce(() => { + return Promise.reject({ + message: ErrorCode.PIPELINE_IS_IN_USE, + pipelineName: 'my-other-index@ml-inference', + }); + }); + + await mockRouter.callRoute({ + params: { indexName, pipelineName }, + }); + + expect(deleteMlInferencePipeline).toHaveBeenCalledWith( + indexName, + pipelineName, + mockClient.asCurrentUser + ); + expect(mockRouter.response.customError).toHaveBeenCalledTimes(1); + }); }); describe('POST /internal/enterprise_search/indices/{indexName}/ml_inference/pipeline_processors/simulate', () => { diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts index 02a7dd528f872..25fbac7328f73 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts @@ -16,6 +16,7 @@ import { i18n } from '@kbn/i18n'; import { DEFAULT_PIPELINE_NAME } from '../../../common/constants'; import { ErrorCode } from '../../../common/types/error_codes'; +import { AlwaysShowPattern } from '../../../common/types/indices'; import type { CreateMlInferencePipelineResponse, @@ -48,6 +49,7 @@ import { createError } from '../../utils/create_error'; import { elasticsearchErrorHandler } from '../../utils/elasticsearch_error_handler'; import { isIndexNotFoundException, + isPipelineIsInUseException, isResourceNotFoundException, } from '../../utils/identify_exceptions'; import { getPrefixedInferencePipelineProcessorName } from '../../utils/ml_inference_pipeline_utils'; @@ -62,7 +64,11 @@ export function registerIndexRoutes({ { path: '/internal/enterprise_search/search_indices', validate: false }, elasticsearchErrorHandler(log, async (context, _, response) => { const { client } = (await context.core).elasticsearch; - const indices = await fetchIndices(client, '*', false, true, 'search-'); + const patterns: AlwaysShowPattern = { + alias_pattern: 'search-', + index_pattern: '.ent-search-engine-documents', + }; + const indices = await fetchIndices(client, '*', false, true, patterns); return response.ok({ body: indices, @@ -697,7 +703,24 @@ export function registerIndexRoutes({ response, statusCode: 404, }); + } else if (isPipelineIsInUseException(error)) { + return createError({ + errorCode: ErrorCode.PIPELINE_IS_IN_USE, + message: i18n.translate( + 'xpack.enterpriseSearch.server.routes.indices.mlInference.pipelineProcessors.pipelineIsInUseError', + { + defaultMessage: + "Inference pipeline is used in managed pipeline '{pipelineName}' of a different index", + values: { + pipelineName: error.pipelineName, + }, + } + ), + response, + statusCode: 400, + }); } + // otherwise, let the default handler wrap it throw error; } diff --git a/x-pack/plugins/enterprise_search/server/utils/identify_exceptions.ts b/x-pack/plugins/enterprise_search/server/utils/identify_exceptions.ts index d65f2918275d2..9577eabfd31f3 100644 --- a/x-pack/plugins/enterprise_search/server/utils/identify_exceptions.ts +++ b/x-pack/plugins/enterprise_search/server/utils/identify_exceptions.ts @@ -5,6 +5,8 @@ * 2.0. */ +import { ErrorCode } from '../../common/types/error_codes'; + export interface ElasticsearchResponseError { meta?: { body?: { @@ -28,3 +30,6 @@ export const isResourceNotFoundException = (error: ElasticsearchResponseError) = export const isUnauthorizedException = (error: ElasticsearchResponseError) => error.meta?.statusCode === 403; + +export const isPipelineIsInUseException = (error: Error) => + error.message === ErrorCode.PIPELINE_IS_IN_USE; diff --git a/x-pack/plugins/enterprise_search/tsconfig.json b/x-pack/plugins/enterprise_search/tsconfig.json index 10fcc3b8c0d58..e94487d939500 100644 --- a/x-pack/plugins/enterprise_search/tsconfig.json +++ b/x-pack/plugins/enterprise_search/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "exclude": ["public/applications/**/cypress/**/*"], "include": [ @@ -13,7 +12,7 @@ "server/**/*", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/charts/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, diff --git a/x-pack/plugins/event_log/server/es/cluster_client_adapter.mock.ts b/x-pack/plugins/event_log/server/es/cluster_client_adapter.mock.ts index 3cb1b8d12c0b1..adf1ecf0f7881 100644 --- a/x-pack/plugins/event_log/server/es/cluster_client_adapter.mock.ts +++ b/x-pack/plugins/event_log/server/es/cluster_client_adapter.mock.ts @@ -24,6 +24,7 @@ const createClusterClientMock = () => { getExistingIndexAliases: jest.fn(), setIndexAliasToHidden: jest.fn(), queryEventsBySavedObjects: jest.fn(), + queryEventsWithAuthFilter: jest.fn(), aggregateEventsBySavedObjects: jest.fn(), aggregateEventsWithAuthFilter: jest.fn(), shutdown: jest.fn(), 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 ea3e98e599ab5..a7a9e8bd0867a 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 @@ -779,7 +779,7 @@ describe('aggregateEventsWithAuthFilter', () => { }); const options: AggregateEventsWithAuthFilter = { index: 'index-name', - namespace: 'namespace', + namespaces: ['namespace'], type: 'saved-object-type', aggregateOptions: DEFAULT_OPTIONS as AggregateOptionsType, authFilter: fromKueryExpression('test:test'), @@ -1515,7 +1515,7 @@ describe('getQueryBody', () => { describe('getQueryBodyWithAuthFilter', () => { const options = { index: 'index-name', - namespace: undefined, + namespaces: undefined, type: 'saved-object-type', authFilter: fromKueryExpression('test:test'), }; @@ -1559,11 +1559,17 @@ describe('getQueryBodyWithAuthFilter', () => { }, { bool: { - must_not: { - exists: { - field: 'kibana.saved_objects.namespace', + should: [ + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, + }, + }, }, - }, + ], }, }, ], @@ -1580,7 +1586,7 @@ describe('getQueryBodyWithAuthFilter', () => { expect( getQueryBodyWithAuthFilter( logger, - { ...options, namespace: 'namespace' } as AggregateEventsWithAuthFilter, + { ...options, namespaces: ['namespace'] } as AggregateEventsWithAuthFilter, {} ) ).toEqual({ @@ -1619,10 +1625,16 @@ describe('getQueryBodyWithAuthFilter', () => { }, }, { - term: { - 'kibana.saved_objects.namespace': { - value: 'namespace', - }, + bool: { + should: [ + { + term: { + 'kibana.saved_objects.namespace': { + value: 'namespace', + }, + }, + }, + ], }, }, ], @@ -1713,11 +1725,17 @@ describe('getQueryBodyWithAuthFilter', () => { }, { bool: { - must_not: { - exists: { - field: 'kibana.saved_objects.namespace', + should: [ + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, + }, + }, }, - }, + ], }, }, ], @@ -1772,11 +1790,17 @@ describe('getQueryBodyWithAuthFilter', () => { }, { bool: { - must_not: { - exists: { - field: 'kibana.saved_objects.namespace', + should: [ + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, + }, + }, }, - }, + ], }, }, ], @@ -1838,11 +1862,17 @@ describe('getQueryBodyWithAuthFilter', () => { }, { bool: { - must_not: { - exists: { - field: 'kibana.saved_objects.namespace', + should: [ + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, + }, + }, }, - }, + ], }, }, ], @@ -1905,11 +1935,17 @@ describe('getQueryBodyWithAuthFilter', () => { }, { bool: { - must_not: { - exists: { - field: 'kibana.saved_objects.namespace', + should: [ + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, + }, + }, }, - }, + ], }, }, ], diff --git a/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts b/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts index e807899d6290b..0d38895dbd800 100644 --- a/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts +++ b/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts @@ -50,14 +50,26 @@ interface QueryOptionsEventsBySavedObjectFilter { legacyIds?: string[]; } -export interface AggregateEventsWithAuthFilter { +interface QueryOptionsEventsWithAuthFilter { index: string; namespace: string | undefined; type: string; + ids: string[]; + authFilter: KueryNode; +} + +export interface AggregateEventsWithAuthFilter { + index: string; + namespaces?: Array<string | undefined>; + type: string; authFilter: KueryNode; aggregateOptions: AggregateOptionsType; } +export type FindEventsOptionsWithAuthFilter = QueryOptionsEventsWithAuthFilter & { + findOptions: FindOptionsType; +}; + export type FindEventsOptionsBySavedObjectFilter = QueryOptionsEventsBySavedObjectFilter & { findOptions: FindOptionsType; }; @@ -70,6 +82,12 @@ export interface AggregateEventsBySavedObjectResult { aggregations: Record<string, estypes.AggregationsAggregate> | undefined; } +type GetQueryBodyWithAuthFilterOpts = + | (FindEventsOptionsWithAuthFilter & { + namespaces: AggregateEventsWithAuthFilter['namespaces']; + }) + | AggregateEventsWithAuthFilter; + // eslint-disable-next-line @typescript-eslint/no-explicit-any type AliasAny = any; @@ -389,6 +407,50 @@ export class ClusterClientAdapter<TDoc extends { body: AliasAny; index: string } } } + public async queryEventsWithAuthFilter( + queryOptions: FindEventsOptionsWithAuthFilter + ): Promise<QueryEventsBySavedObjectResult> { + const { index, type, ids, findOptions } = queryOptions; + const { page, per_page: perPage, sort } = findOptions; + + const esClient = await this.elasticsearchClientPromise; + + const query = getQueryBodyWithAuthFilter( + this.logger, + { ...queryOptions, namespaces: [queryOptions.namespace] }, + pick(queryOptions.findOptions, ['start', 'end', 'filter']) + ); + + const body: estypes.SearchRequest['body'] = { + size: perPage, + from: (page - 1) * perPage, + query, + ...(sort + ? { sort: sort.map((s) => ({ [s.sort_field]: { order: s.sort_order } })) as estypes.Sort } + : {}), + }; + + try { + const { + hits: { hits, total }, + } = await esClient.search<IValidatedEvent>({ + index, + track_total_hits: true, + body, + }); + return { + page, + per_page: perPage, + total: isNumber(total) ? total : total!.value, + data: hits.map((hit) => hit._source), + }; + } catch (err) { + throw new Error( + `querying for Event Log by for type "${type}" and ids "${ids}" failed with: ${err.message}` + ); + } + } + public async aggregateEventsBySavedObjects( queryOptions: AggregateEventsOptionsBySavedObjectFilter ): Promise<AggregateEventsBySavedObjectResult> { @@ -462,13 +524,15 @@ export class ClusterClientAdapter<TDoc extends { body: AliasAny; index: string } export function getQueryBodyWithAuthFilter( logger: Logger, - opts: AggregateEventsWithAuthFilter, + opts: GetQueryBodyWithAuthFilterOpts, queryOptions: QueryOptionsType ) { - const { namespace, type, authFilter } = opts; + const { namespaces, type, authFilter } = opts; const { start, end, filter } = queryOptions ?? {}; - const namespaceQuery = getNamespaceQuery(namespace); + const namespaceQuery = (namespaces ?? [undefined]).map((namespace) => + getNamespaceQuery(namespace) + ); let dslFilterQuery: estypes.QueryDslBoolQuery['filter']; try { const filterKueryNode = filter ? fromKueryExpression(filter) : null; @@ -501,8 +565,12 @@ export function getQueryBodyWithAuthFilter( }, }, }, - // @ts-expect-error undefined is not assignable as QueryDslTermQuery value - namespaceQuery, + { + bool: { + // @ts-expect-error undefined is not assignable as QueryDslTermQuery value + should: namespaceQuery, + }, + }, ]; const musts: estypes.QueryDslQueryContainer[] = [ diff --git a/x-pack/plugins/event_log/server/event_log_client.mock.ts b/x-pack/plugins/event_log/server/event_log_client.mock.ts index 0e11ded65be65..a44a319626ded 100644 --- a/x-pack/plugins/event_log/server/event_log_client.mock.ts +++ b/x-pack/plugins/event_log/server/event_log_client.mock.ts @@ -10,6 +10,7 @@ import { IEventLogClient } from './types'; const createEventLogClientMock = () => { const mock: jest.Mocked<IEventLogClient> = { findEventsBySavedObjectIds: jest.fn(), + findEventsWithAuthFilter: jest.fn(), aggregateEventsBySavedObjectIds: jest.fn(), aggregateEventsWithAuthFilter: jest.fn(), }; diff --git a/x-pack/plugins/event_log/server/event_log_client.test.ts b/x-pack/plugins/event_log/server/event_log_client.test.ts index 5e4fd08819fb3..b91ef3ef43836 100644 --- a/x-pack/plugins/event_log/server/event_log_client.test.ts +++ b/x-pack/plugins/event_log/server/event_log_client.test.ts @@ -256,7 +256,7 @@ describe('EventLogStart', () => { }); expect(esContext.esAdapter.aggregateEventsWithAuthFilter).toHaveBeenCalledWith({ index: esContext.esNames.indexPattern, - namespace: undefined, + namespaces: [undefined], type: 'saved-object-type', authFilter: testAuthFilter, aggregateOptions: { diff --git a/x-pack/plugins/event_log/server/event_log_client.ts b/x-pack/plugins/event_log/server/event_log_client.ts index e23b5f137eef1..9a35868d248e5 100644 --- a/x-pack/plugins/event_log/server/event_log_client.ts +++ b/x-pack/plugins/event_log/server/event_log_client.ts @@ -12,7 +12,7 @@ import { IClusterClient, KibanaRequest } from '@kbn/core/server'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { SpacesServiceStart } from '@kbn/spaces-plugin/server'; -import { KueryNode } from '@kbn/core-saved-objects-api-server'; +import { KueryNode } from '@kbn/es-query'; import { EsContext } from './es'; import { IEventLogClient } from './types'; import { QueryEventsBySavedObjectResult } from './es/cluster_client_adapter'; @@ -112,6 +112,31 @@ export class EventLogClient implements IEventLogClient { }); } + public async findEventsWithAuthFilter( + type: string, + ids: string[], + authFilter: KueryNode, + namespace: string | undefined, + options?: Partial<FindOptionsType> + ): Promise<QueryEventsBySavedObjectResult> { + if (!authFilter) { + throw new Error('No authorization filter defined!'); + } + + const findOptions = queryOptionsSchema.validate(options ?? {}); + + return await this.esContext.esAdapter.queryEventsWithAuthFilter({ + index: this.esContext.esNames.indexPattern, + namespace: namespace + ? this.spacesService?.spaceIdToNamespace(namespace) + : await this.getNamespace(), + type, + ids, + findOptions, + authFilter, + }); + } + public async aggregateEventsBySavedObjectIds( type: string, ids: string[], @@ -142,7 +167,8 @@ export class EventLogClient implements IEventLogClient { public async aggregateEventsWithAuthFilter( type: string, authFilter: KueryNode, - options?: AggregateOptionsType + options?: AggregateOptionsType, + namespaces?: Array<string | undefined> ) { if (!authFilter) { throw new Error('No authorization filter defined!'); @@ -158,7 +184,7 @@ export class EventLogClient implements IEventLogClient { return await this.esContext.esAdapter.aggregateEventsWithAuthFilter({ index: this.esContext.esNames.indexPattern, - namespace: await this.getNamespace(), + namespaces: namespaces ?? [await this.getNamespace()], type, authFilter, aggregateOptions: { ...aggregateOptions, aggs } as AggregateOptionsType, diff --git a/x-pack/plugins/event_log/server/types.ts b/x-pack/plugins/event_log/server/types.ts index d610a8bff9c2a..07a7e7ed2f7e2 100644 --- a/x-pack/plugins/event_log/server/types.ts +++ b/x-pack/plugins/event_log/server/types.ts @@ -57,6 +57,13 @@ export interface IEventLogClient { options?: Partial<FindOptionsType>, legacyIds?: string[] ): Promise<QueryEventsBySavedObjectResult>; + findEventsWithAuthFilter( + type: string, + ids: string[], + authFilter: KueryNode, + namespace: string | undefined, + options?: Partial<FindOptionsType> + ): Promise<QueryEventsBySavedObjectResult>; aggregateEventsBySavedObjectIds( type: string, ids: string[], @@ -66,7 +73,8 @@ export interface IEventLogClient { aggregateEventsWithAuthFilter( type: string, authFilter: KueryNode, - options?: Partial<AggregateOptionsType> + options?: Partial<AggregateOptionsType>, + namespaces?: Array<string | undefined> ): Promise<AggregateEventsBySavedObjectResult>; } diff --git a/x-pack/plugins/event_log/tsconfig.json b/x-pack/plugins/event_log/tsconfig.json index 28dd8f244a3da..2695ae967fb74 100644 --- a/x-pack/plugins/event_log/tsconfig.json +++ b/x-pack/plugins/event_log/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "server/**/*", @@ -14,7 +13,7 @@ "generated/*.json", "common/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../spaces/tsconfig.json" } ] diff --git a/x-pack/plugins/features/common/sub_feature.ts b/x-pack/plugins/features/common/sub_feature.ts index 2795e50bce473..58142fd88c0c3 100644 --- a/x-pack/plugins/features/common/sub_feature.ts +++ b/x-pack/plugins/features/common/sub_feature.ts @@ -16,6 +16,17 @@ export interface SubFeatureConfig { /** Display name for this sub-feature */ name: string; + /** + * Whether or not this privilege should only be granted to `All Spaces *`. Should be used for features that do not + * support Spaces. Defaults to `false`. + */ + requireAllSpaces?: boolean; + + /** + * Optional message to display on the Role Management screen when configuring permissions for this feature. + */ + privilegesTooltip?: string; + /** Collection of privilege groups */ privilegeGroups: readonly SubFeaturePrivilegeGroupConfig[]; } @@ -90,6 +101,10 @@ export class SubFeature { return this.config.privilegeGroups; } + public get requireAllSpaces() { + return this.config.requireAllSpaces ?? false; + } + public toRaw() { return { ...this.config }; } diff --git a/x-pack/plugins/features/server/feature_schema.ts b/x-pack/plugins/features/server/feature_schema.ts index 30b2ddea3d7d5..05d172887d870 100644 --- a/x-pack/plugins/features/server/feature_schema.ts +++ b/x-pack/plugins/features/server/feature_schema.ts @@ -163,6 +163,8 @@ const kibanaMutuallyExclusiveSubFeaturePrivilegeSchema = const kibanaSubFeatureSchema = schema.object({ name: schema.string(), + requireAllSpaces: schema.maybe(schema.boolean()), + privilegesTooltip: schema.maybe(schema.string()), privilegeGroups: schema.maybe( schema.arrayOf( schema.oneOf([ diff --git a/x-pack/plugins/features/tsconfig.json b/x-pack/plugins/features/tsconfig.json index b16d7b47bba5b..d658362136865 100644 --- a/x-pack/plugins/features/tsconfig.json +++ b/x-pack/plugins/features/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../licensing/tsconfig.json" }, ] diff --git a/x-pack/plugins/file_upload/public/importer/geo/abstract_geo_file_importer.tsx b/x-pack/plugins/file_upload/public/importer/geo/abstract_geo_file_importer.tsx index afc95cc830768..14c47eea70359 100644 --- a/x-pack/plugins/file_upload/public/importer/geo/abstract_geo_file_importer.tsx +++ b/x-pack/plugins/file_upload/public/importer/geo/abstract_geo_file_importer.tsx @@ -14,7 +14,6 @@ import { CreateDocsResponse, ImportResults } from '../types'; import { callImportRoute, Importer, IMPORT_RETRIES, MAX_CHUNK_CHAR_COUNT } from '../importer'; import { MB } from '../../../common/constants'; import type { ImportDoc, ImportFailure, ImportResponse } from '../../../common/types'; -// @ts-expect-error import { geoJsonCleanAndValidate } from './geojson_clean_and_validate'; import { createChunks } from './create_chunks'; diff --git a/x-pack/plugins/file_upload/public/importer/geo/geojson_importer/geojson_importer.ts b/x-pack/plugins/file_upload/public/importer/geo/geojson_importer/geojson_importer.ts index c3de1ac2e9491..20b73a9ef2acc 100644 --- a/x-pack/plugins/file_upload/public/importer/geo/geojson_importer/geojson_importer.ts +++ b/x-pack/plugins/file_upload/public/importer/geo/geojson_importer/geojson_importer.ts @@ -7,7 +7,6 @@ import { Feature } from 'geojson'; import { i18n } from '@kbn/i18n'; -// @ts-expect-error import { JSONLoader, loadInBatches } from '../loaders'; import type { ImportFailure } from '../../../../common/types'; import { AbstractGeoFileImporter } from '../abstract_geo_file_importer'; @@ -36,12 +35,13 @@ export class GeoJsonImporter extends AbstractGeoFileImporter { }; if (this._iterator === undefined) { - this._iterator = await loadInBatches(this._getFile(), JSONLoader, { + // TODO: loadInBatches returns an AsyncIterable, not an AsyncInterator, which doesn't necessarily have a .next() function + this._iterator = (await loadInBatches(this._getFile(), JSONLoader, { json: { jsonpaths: ['$.features'], _rootObjectBatches: true, }, - }); + })) as any; } if (!this._getIsActive() || !this._iterator) { diff --git a/x-pack/plugins/file_upload/public/importer/geo/shapefile_importer/shapefile_importer.tsx b/x-pack/plugins/file_upload/public/importer/geo/shapefile_importer/shapefile_importer.tsx index 86877a7a4ff67..7fb30577ee00d 100644 --- a/x-pack/plugins/file_upload/public/importer/geo/shapefile_importer/shapefile_importer.tsx +++ b/x-pack/plugins/file_upload/public/importer/geo/shapefile_importer/shapefile_importer.tsx @@ -7,7 +7,6 @@ import React from 'react'; import { Feature } from 'geojson'; -// @ts-expect-error import { BrowserFileSystem, DBFLoader, loadInBatches, ShapefileLoader } from '../loaders'; import type { ImportFailure } from '../../../../common/types'; import { ShapefileEditor } from './shapefile_editor'; diff --git a/x-pack/plugins/file_upload/tsconfig.json b/x-pack/plugins/file_upload/tsconfig.json index efea61e38b3e8..a8cdfe45ef59f 100644 --- a/x-pack/plugins/file_upload/tsconfig.json +++ b/x-pack/plugins/file_upload/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, diff --git a/x-pack/plugins/files/.storybook/main.ts b/x-pack/plugins/files/.storybook/main.ts deleted file mode 100644 index e82ec6c47bbec..0000000000000 --- a/x-pack/plugins/files/.storybook/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'], - reactOptions: { - strictMode: true, - }, -}; diff --git a/x-pack/plugins/files/.storybook/manager.ts b/x-pack/plugins/files/.storybook/manager.ts deleted file mode 100644 index 167046920a796..0000000000000 --- a/x-pack/plugins/files/.storybook/manager.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -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 React Storybook', - brandUrl: 'https://github.com/elastic/kibana/tree/main/x-pack/plugins/files', - }), - showPanel: true.valueOf, - selectedPanel: PANEL_ID, -}); diff --git a/x-pack/plugins/files/common/api_routes.ts b/x-pack/plugins/files/common/api_routes.ts deleted file mode 100644 index 2f522e7c77150..0000000000000 --- a/x-pack/plugins/files/common/api_routes.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 { TypeOf, Type } from '@kbn/config-schema'; -import { PLUGIN_ID } from './constants'; - -export const API_BASE_PATH = `/api/${PLUGIN_ID}`; - -export const FILES_API_BASE_PATH = `${API_BASE_PATH}/files`; - -export const FILES_SHARE_API_BASE_PATH = `${API_BASE_PATH}/shares`; - -export const FILES_PUBLIC_API_BASE_PATH = `${API_BASE_PATH}/public`; - -export interface EndpointInputs< - P extends Type<unknown> = Type<unknown>, - Q extends Type<unknown> = Type<unknown>, - B extends Type<unknown> = Type<unknown> -> { - params?: P; - query?: Q; - body?: B; -} - -export interface CreateRouteDefinition<Inputs extends EndpointInputs, R> { - inputs: { - params: TypeOf<NonNullable<Inputs['params']>>; - query: TypeOf<NonNullable<Inputs['query']>>; - body: TypeOf<NonNullable<Inputs['body']>>; - }; - output: R; -} - -export type AnyEndpoint = CreateRouteDefinition<EndpointInputs, unknown>; - -/** - * Abstract type definition for API route inputs and outputs. - * - * These definitions should be shared between the public and server - * as the single source of truth. - */ -export interface HttpApiInterfaceEntryDefinition< - P = unknown, - Q = unknown, - B = unknown, - R = unknown -> { - inputs: { - params: P; - query: Q; - body: B; - }; - output: R; -} - -export type { Endpoint as CreateFileKindHttpEndpoint } from '../server/routes/file_kind/create'; -export type { Endpoint as DeleteFileKindHttpEndpoint } from '../server/routes/file_kind/delete'; -export type { Endpoint as DownloadFileKindHttpEndpoint } from '../server/routes/file_kind/download'; -export type { Endpoint as GetByIdFileKindHttpEndpoint } from '../server/routes/file_kind/get_by_id'; -export type { Endpoint as ListFileKindHttpEndpoint } from '../server/routes/file_kind/list'; -export type { Endpoint as UpdateFileKindHttpEndpoint } from '../server/routes/file_kind/update'; -export type { Endpoint as UploadFileKindHttpEndpoint } from '../server/routes/file_kind/upload'; -export type { Endpoint as FindFilesHttpEndpoint } from '../server/routes/find'; -export type { Endpoint as FilesMetricsHttpEndpoint } from '../server/routes/metrics'; -export type { Endpoint as FileShareHttpEndpoint } from '../server/routes/file_kind/share/share'; -export type { Endpoint as FileUnshareHttpEndpoint } from '../server/routes/file_kind/share/unshare'; -export type { Endpoint as FileGetShareHttpEndpoint } from '../server/routes/file_kind/share/get'; -export type { Endpoint as FileListSharesHttpEndpoint } from '../server/routes/file_kind/share/list'; -export type { Endpoint as FilePublicDownloadHttpEndpoint } from '../server/routes/public_facing/download'; diff --git a/x-pack/plugins/files/common/constants.ts b/x-pack/plugins/files/common/constants.ts deleted file mode 100644 index be0bfa3ca80c4..0000000000000 --- a/x-pack/plugins/files/common/constants.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. - */ - -/** - * The files plugin ID - */ -export const PLUGIN_ID = 'files' as const; -/** - * The files plugin name - */ -export const PLUGIN_NAME = 'files' as const; - -/** - * Unique type name of the file saved object - */ -export const FILE_SO_TYPE = 'file'; -/** - * Unique type name of the public file saved object - */ -export const FILE_SHARE_SO_TYPE = 'fileShare'; - -/** - * The name of the fixed size ES-backed blob store - */ -export const ES_FIXED_SIZE_INDEX_BLOB_STORE = 'esFixedSizeIndex' as const; diff --git a/x-pack/plugins/files/common/file_kinds_registry/index.ts b/x-pack/plugins/files/common/file_kinds_registry/index.ts deleted file mode 100644 index 5df6744546c03..0000000000000 --- a/x-pack/plugins/files/common/file_kinds_registry/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 { createGetterSetter } from '@kbn/kibana-utils-plugin/common'; -import assert from 'assert'; -import { FileKind } from '..'; - -export interface FileKindsRegistry { - /** - * Register a new file kind. - */ - register(fileKind: FileKind): void; - - /** - * Gets a {@link FileKind} or throws. - */ - get(id: string): FileKind; - - /** - * Return all registered {@link FileKind}s. - */ - getAll(): FileKind[]; -} - -/** - * @internal - */ -export class FileKindsRegistryImpl implements FileKindsRegistry { - constructor(private readonly onRegister?: (fileKind: FileKind) => void) {} - - private readonly fileKinds = new Map<string, FileKind>(); - - register(fileKind: FileKind) { - if (this.fileKinds.get(fileKind.id)) { - throw new Error(`File kind "${fileKind.id}" already registered.`); - } - - if (fileKind.id !== encodeURIComponent(fileKind.id)) { - throw new Error( - `File kind id "${fileKind.id}" is not a valid file kind ID. Choose an ID that does not need to be URI encoded.` - ); - } - - this.fileKinds.set(fileKind.id, fileKind); - this.onRegister?.(fileKind); - } - - get(id: string): FileKind { - const fileKind = this.fileKinds.get(id); - assert(fileKind, `File kind with id "${id}" not found.`); - return fileKind; - } - - getAll(): FileKind[] { - return Array.from(this.fileKinds.values()); - } -} - -export const [getFileKindsRegistry, setFileKindsRegistry] = - createGetterSetter<FileKindsRegistry>('fileKindsRegistry'); diff --git a/x-pack/plugins/files/common/index.ts b/x-pack/plugins/files/common/index.ts deleted file mode 100755 index be06c5708ce06..0000000000000 --- a/x-pack/plugins/files/common/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { FILE_SO_TYPE, PLUGIN_ID, PLUGIN_NAME, ES_FIXED_SIZE_INDEX_BLOB_STORE } from './constants'; - -export type { - File, - FileKind, - FileJSON, - FileShare, - FileStatus, - Pagination, - FileMetadata, - FilesMetrics, - FileShareJSON, - FileCompression, - FileSavedObject, - BaseFileMetadata, - FileShareOptions, - FileImageMetadata, - FileUnshareOptions, - BlobStorageSettings, - UpdatableFileMetadata, - FileShareJSONWithToken, - UpdatableFileShareMetadata, -} from './types'; diff --git a/x-pack/plugins/files/common/types.ts b/x-pack/plugins/files/common/types.ts deleted file mode 100644 index 53f97962597a8..0000000000000 --- a/x-pack/plugins/files/common/types.ts +++ /dev/null @@ -1,557 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { SavedObject } from '@kbn/core/server'; -import type { Observable } from 'rxjs'; -import type { Readable } from 'stream'; -import type { ES_FIXED_SIZE_INDEX_BLOB_STORE } from './constants'; - -/** - * Values for paginating through results. - */ -export interface Pagination { - /** - * Page of results. - */ - page?: number; - /** - * Number of results per page. - */ - perPage?: number; -} - -/** - * Status of a file. - * - * AWAITING_UPLOAD - A file object has been created but does not have any contents. - * UPLOADING - File contents are being uploaded. - * READY - File contents have been uploaded and are ready for to be downloaded. - * UPLOAD_ERROR - An attempt was made to upload file contents but failed. - * DELETED - The file contents have been or are being deleted. - */ -export type FileStatus = 'AWAITING_UPLOAD' | 'UPLOADING' | 'READY' | 'UPLOAD_ERROR' | 'DELETED'; - -/** - * Supported file compression algorithms - */ -export type FileCompression = 'br' | 'gzip' | 'deflate' | 'none'; - -/** - * File metadata fields are defined per the ECS specification: - * - * https://www.elastic.co/guide/en/ecs/current/ecs-file.html - * - * Custom fields are named according to the custom field convention: "CustomFieldName". - */ -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -export type BaseFileMetadata = { - /** - * Name of the file - * - * @note This field is recommended since it will provide a better UX - */ - name?: string; - - /** - * MIME type of the file contents - */ - mime_type?: string; - - /** - * ISO string representing the file creation date - */ - created?: string; - - /** - * Size of the file - */ - size?: number; - - /** - * Hash of the file's contents - */ - hash?: { - /** - * UTF-8 string representing MD5 hash - */ - md5?: string; - /** - * UTF-8 string representing sha1 hash - */ - sha1?: string; - /** - * UTF-8 string representing sha256 hash - */ - sha256?: string; - /** - * UTF-8 string representing sha384 hash - */ - sha384?: string; - /** - * UTF-8 string representing sha512 hash - */ - sha512?: string; - /** - * UTF-8 string representing shadeep hash - */ - ssdeep?: string; - /** - * UTF-8 string representing tlsh hash - */ - tlsh?: string; - [hashName: string]: string | undefined; - }; - - /** - * The file extension, for example "jpg", "png", "svg" and so forth - */ - extension?: string; - - /** - * Alternate text that can be used used to describe the contents of the file - * in human-friendly language - */ - Alt?: string; - - /** - * ISO string representing when the file was last updated - */ - Updated?: string; - - /** - * The file's current status - */ - Status?: FileStatus; - - /** - * The maximum number of bytes per file chunk - */ - ChunkSize?: number; - - /** - * Compression algorithm used to transform chunks before they were stored. - */ - Compression?: FileCompression; -}; - -/** - * Extra metadata on a file object specific to Kibana implementation. - */ -export type FileMetadata<Meta = unknown> = Required< - Pick<BaseFileMetadata, 'created' | 'name' | 'Status' | 'Updated'> -> & - BaseFileMetadata & { - /** - * Unique identifier of the kind of file. Kibana applications can register - * these at runtime. - */ - FileKind: string; - - /** - * User-defined metadata - */ - Meta?: Meta; - }; - -/** - * Attributes of a file that represent a serialised version of the file. - */ -export interface FileJSON<Meta = unknown> { - /** - * Unique file ID. - */ - id: string; - /** - * ISO string of when this file was created - */ - created: FileMetadata['created']; - /** - * ISO string of when the file was updated - */ - updated: FileMetadata['Updated']; - /** - * File name. - * - * @note Does not have to be unique. - */ - name: FileMetadata['name']; - /** - * MIME type of the file's contents. - */ - mimeType: FileMetadata['mime_type']; - /** - * The size, in bytes, of the file content. - */ - size: FileMetadata['size']; - /** - * The file extension (dot suffix). - * - * @note this value can be derived from MIME type but is stored for search - * convenience. - */ - extension: FileMetadata['extension']; - - /** - * A consumer defined set of attributes. - * - * Consumers of the file service can add their own tags and identifiers to - * a file using the "meta" object. - */ - meta: FileMetadata<Meta>['Meta']; - /** - * Use this text to describe the file contents for display and accessibility. - */ - alt: FileMetadata['Alt']; - /** - * A unique kind that governs various aspects of the file. A consumer of the - * files service must register a file kind and link their files to a specific - * kind. - * - * @note This enables stricter access controls to CRUD and other functionality - * exposed by the files service. - */ - fileKind: FileMetadata['FileKind']; - /** - * The current status of the file. - * - * See {@link FileStatus} for more details. - */ - status: FileMetadata['Status']; -} - -/** - * An {@link SavedObject} containing a file object (i.e., metadata only). - */ -export type FileSavedObject<Meta = unknown> = SavedObject<FileMetadata<Meta>>; - -/** - * The set of file metadata that can be updated. - */ -export type UpdatableFileMetadata<Meta = unknown> = Pick<FileJSON<Meta>, 'meta' | 'alt' | 'name'>; - -/** - * Data stored with a file share object - */ -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -export type FileShare = { - /** - * ISO timestamp of when the file share was created. - */ - created: string; - - /** - * Secret token used to access the associated file. - */ - token: string; - - /** - * Human friendly name for this share token. - */ - name?: string; - - /** - * The unix timestamp (in milliseconds) this file share will expire. - * - * TODO: in future we could add a special value like "forever", but this should - * not be the default. - */ - valid_until: number; -}; - -/** - * Attributes of a file that represent a serialised version of the file. - */ -export interface FileShareJSON { - /** - * Unique ID share instance - */ - id: string; - /** - * ISO timestamp the share was created - */ - created: FileShare['created']; - /** - * Unix timestamp (in milliseconds) of when this share expires - */ - validUntil: FileShare['valid_until']; - /** - * A user-friendly name for the file share - */ - name?: FileShare['name']; - /** - * The ID of the file this share is linked to - */ - fileId: string; -} - -/** - * A version of the file share with a token included. - * - * @note This should only be shown when the file share is first created - */ -export type FileShareJSONWithToken = FileShareJSON & { - /** - * Secret token that can be used to access files - */ - token: string; -}; - -/** - * Set of attributes that can be updated in a file share. - */ -export type UpdatableFileShareMetadata = Pick<FileShare, 'name'>; - -/** - * Arguments to pass to share a file - */ -export interface FileShareOptions { - /** - * Optional name for the file share, should be human-friendly. - */ - name?: string; - /** - * Unix timestamp (in milliseconds) when the file share will expire. - * - * @note default is 30 days - */ - validUntil?: number; -} -/** - * Arguments for unsharing a file - */ -export interface FileUnshareOptions { - /** - * Specify the share instance to remove - */ - shareId: string; -} - -/** - * A class with set of properties and behaviors of the "smart" file object and adds - * behaviours for interacting with files on top of the pure data. - */ -export interface File<Meta = unknown> { - /** - * The file ID - */ - id: string; - - /** - * File metadata in camelCase form. - */ - data: FileJSON<Meta>; - /** - * Update a file object's metadatathat can be updated. - * - * @param attr - The of attributes to update. - */ - update(attr: Partial<UpdatableFileMetadata<Meta>>): Promise<File<Meta>>; - - /** - * Stream file content to storage. - * - * @param content - The content to stream to storage. - * @param abort$ - An observable that can be used to abort the upload at any time. - */ - uploadContent(content: Readable, abort$?: Observable<unknown>): Promise<File<Meta>>; - - /** - * Stream file content from storage. - */ - downloadContent(): Promise<Readable>; - - /** - * Delete a file. - * - * @note This will delete the file metadata, contents and any other objects - * related to the file owned by files. - */ - delete(): Promise<void>; - - /** - * Generate a secure token that can be used to access a file's content. - * - * @note This makes a file available for public download. Any agent with the - * token will bypass normal authz and authn checks. - * - * @param opts - Share file options. - */ - share(opts?: FileShareOptions): Promise<FileShareJSONWithToken>; - - /** - * List all current {@link FileShareJSON} objects that have been created for - * a file. - */ - listShares(): Promise<FileShareJSON[]>; - - /** - * Remove a {@link FileShareJSON} object therefore ceasing to share a file's - * content. - * - * @param opts - Unshare file options - */ - unshare(opts: FileUnshareOptions): Promise<void>; - - /** - * Get a JSON representation of the file. Convenient for serialisation. - */ - toJSON(): FileJSON<Meta>; -} - -/** - * Defines all the settings for supported blob stores. - * - * Key names map to unique blob store implementations and so must not be changed - * without a migration - */ -export interface BlobStorageSettings { - /** - * Single index that supports up to 50GB of blobs - */ - [ES_FIXED_SIZE_INDEX_BLOB_STORE]?: { - index: string; - }; - // Other blob store settings will go here once available -} - -interface HttpEndpointDefinition { - /** - * Specify the tags for this endpoint. - * - * @example - * // This will enable access control to this endpoint for users that can access "myApp" only. - * { tags: ['access:myApp'] } - * - */ - tags: string[]; -} - -/** - * A descriptor of meta values associated with a set or "kind" of files. - * - * @note In order to use the file service consumers must register a {@link FileKind} - * in the {@link FileKindsRegistry}. - */ -export interface FileKind { - /** - * Unique file kind ID - */ - id: string; - /** - * Maximum size, in bytes, a file of this kind can be. - * - * @default 4MiB - */ - maxSizeBytes?: number; - - /** - * The MIME type of the file content. - * - * @default accept all mime types - */ - allowedMimeTypes?: string[]; - - /** - * Blob store specific settings that enable configuration of storage - * details. - */ - blobStoreSettings?: BlobStorageSettings; - - /** - * Specify which HTTP routes to create for the file kind. - * - * You can always create your own HTTP routes for working with files but - * this interface allows you to expose basic CRUD operations, upload, download - * and sharing of files over a RESTful-like interface. - * - * @note The public {@link FileClient} uses these endpoints. - */ - http: { - /** - * Expose file creation (and upload) over HTTP. - */ - create?: HttpEndpointDefinition; - /** - * Expose file updates over HTTP. - */ - update?: HttpEndpointDefinition; - /** - * Expose file deletion over HTTP. - */ - delete?: HttpEndpointDefinition; - /** - * Expose "get by ID" functionality over HTTP. - */ - getById?: HttpEndpointDefinition; - /** - * Expose the ability to list all files of this kind over HTTP. - */ - list?: HttpEndpointDefinition; - /** - * Expose the ability to download a file's contents over HTTP. - */ - download?: HttpEndpointDefinition; - /** - * Expose file share functionality over HTTP. - */ - share?: HttpEndpointDefinition; - }; -} - -/** - * A collection of generally useful metrics about files. - */ -export interface FilesMetrics { - /** - * Metrics about all storage media. - */ - storage: { - /** - * The ES fixed size blob store. - */ - [ES_FIXED_SIZE_INDEX_BLOB_STORE]: { - /** - * The total size in bytes that can be used in this storage medium - */ - capacity: number; - /** - * Bytes currently used - */ - used: number; - /** - * Bytes currently available - */ - available: number; - }; - }; - /** - * A count of all files grouped by status - */ - countByStatus: Record<FileStatus, number>; - /** - * A count of all files grouped by extension - */ - countByExtension: Record<string, number>; -} - -/** - * Set of metadata captured for every image uploaded via the file services' - * public components. - */ -export interface FileImageMetadata { - /** - * The blurhash that can be displayed while the image is loading - */ - blurhash?: string; - /** - * Width, in px, of the original image - */ - width: number; - /** - * Height, in px, of the original image - */ - height: number; -} diff --git a/x-pack/plugins/files/jest.config.js b/x-pack/plugins/files/jest.config.js deleted file mode 100644 index ade30bacab1fa..0000000000000 --- a/x-pack/plugins/files/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/files'], - coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/files', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/files/{common,public,server}/**/*.{js,ts,tsx}'], -}; diff --git a/x-pack/plugins/files/jest.integration.config.js b/x-pack/plugins/files/jest.integration.config.js deleted file mode 100644 index fbcfd8ed04b67..0000000000000 --- a/x-pack/plugins/files/jest.integration.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_integration', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/files'], -}; diff --git a/x-pack/plugins/files/kibana.json b/x-pack/plugins/files/kibana.json deleted file mode 100755 index ad83b24ef0842..0000000000000 --- a/x-pack/plugins/files/kibana.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id": "files", - "version": "1.0.0", - "kibanaVersion": "kibana", - "owner": { - "name": "@elastic/kibana-app-services", - "githubTeam": "team:AppServicesUx" - }, - "description": "File upload, download, sharing, and serving over HTTP implementation in Kibana.", - "server": true, - "ui": true, - "requiredPlugins": [], - "requiredBundles": ["kibanaUtils"], - "optionalPlugins": ["security", "usageCollection"] -} diff --git a/x-pack/plugins/files/public/components/context.tsx b/x-pack/plugins/files/public/components/context.tsx deleted file mode 100644 index a18ea212beffe..0000000000000 --- a/x-pack/plugins/files/public/components/context.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, { createContext, useContext, type FunctionComponent } from 'react'; -import { FileKindsRegistry, getFileKindsRegistry } from '../../common/file_kinds_registry'; -import type { FilesClient } from '../types'; - -export interface FilesContextValue { - registry: FileKindsRegistry; - /** - * A files client that will be used process uploads. - */ - client: FilesClient<any>; -} - -const FilesContextObject = createContext<FilesContextValue>(null as unknown as FilesContextValue); - -export const useFilesContext = () => { - const ctx = useContext(FilesContextObject); - if (!ctx) { - throw new Error('FilesContext is not found!'); - } - return ctx; -}; - -interface ContextProps { - /** - * A files client that will be used process uploads. - */ - client: FilesClient<any>; -} -export const FilesContext: FunctionComponent<ContextProps> = ({ client, children }) => { - return ( - <FilesContextObject.Provider - value={{ - client, - registry: getFileKindsRegistry(), - }} - > - {children} - </FilesContextObject.Provider> - ); -}; diff --git a/x-pack/plugins/files/public/components/file_picker/components/clear_filter_button.tsx b/x-pack/plugins/files/public/components/file_picker/components/clear_filter_button.tsx deleted file mode 100644 index 14356b9b02bd4..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/components/clear_filter_button.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 React from 'react'; -import type { FunctionComponent } from 'react'; -import useObservable from 'react-use/lib/useObservable'; -import { EuiLink } from '@elastic/eui'; -import { css } from '@emotion/react'; -import { useFilePickerContext } from '../context'; - -import { i18nTexts } from '../i18n_texts'; - -interface Props { - onClick: () => void; -} - -export const ClearFilterButton: FunctionComponent<Props> = ({ onClick }) => { - const { state } = useFilePickerContext(); - const query = useObservable(state.queryDebounced$); - if (!query) { - return null; - } - return ( - <div - css={css` - display: grid; - place-items: center; - `} - > - <EuiLink onClick={onClick}>{i18nTexts.clearFilterButton}</EuiLink> - </div> - ); -}; diff --git a/x-pack/plugins/files/public/components/file_picker/components/modal_footer.tsx b/x-pack/plugins/files/public/components/file_picker/components/modal_footer.tsx deleted file mode 100644 index d0d0e146d2c3b..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/components/modal_footer.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 { EuiFlexGroup, EuiModalFooter } from '@elastic/eui'; -import type { FunctionComponent } from 'react'; -import React from 'react'; - -import { Pagination } from './pagination'; -import { SelectButton, Props as SelectButtonProps } from './select_button'; - -interface Props { - onDone: SelectButtonProps['onClick']; -} - -export const ModalFooter: FunctionComponent<Props> = ({ onDone }) => { - return ( - <EuiModalFooter> - <EuiFlexGroup gutterSize="none" justifyContent="spaceBetween" alignItems="center"> - <Pagination /> - <SelectButton onClick={onDone} /> - </EuiFlexGroup> - </EuiModalFooter> - ); -}; diff --git a/x-pack/plugins/files/public/components/file_picker/components/pagination.tsx b/x-pack/plugins/files/public/components/file_picker/components/pagination.tsx deleted file mode 100644 index bc2d0d444ba45..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/components/pagination.tsx +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import type { FunctionComponent } from 'react'; -import { EuiPagination } from '@elastic/eui'; -import { useFilePickerContext } from '../context'; -import { useBehaviorSubject } from '../../use_behavior_subject'; - -export const Pagination: FunctionComponent = () => { - const { state } = useFilePickerContext(); - const page = useBehaviorSubject(state.currentPage$); - const pageCount = useBehaviorSubject(state.totalPages$); - return <EuiPagination onPageClick={state.setPage} pageCount={pageCount} activePage={page} />; -}; diff --git a/x-pack/plugins/files/public/components/file_picker/components/title.tsx b/x-pack/plugins/files/public/components/file_picker/components/title.tsx deleted file mode 100644 index de1015241f656..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/components/title.tsx +++ /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 React from 'react'; -import type { FunctionComponent } from 'react'; -import { EuiTitle } from '@elastic/eui'; -import { i18nTexts } from '../i18n_texts'; - -export const Title: FunctionComponent = () => ( - <EuiTitle> - <h2>{i18nTexts.title}</h2> - </EuiTitle> -); diff --git a/x-pack/plugins/files/public/components/file_picker/components/upload_files.tsx b/x-pack/plugins/files/public/components/file_picker/components/upload_files.tsx deleted file mode 100644 index 143d20fd63ec0..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/components/upload_files.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 { EuiEmptyPrompt, EuiText } from '@elastic/eui'; -import type { FunctionComponent } from 'react'; -import { UploadFile } from '../../upload_file'; -import { useFilePickerContext } from '../context'; -import { i18nTexts } from '../i18n_texts'; - -interface Props { - kind: string; -} - -export const UploadFilesPrompt: FunctionComponent<Props> = ({ kind }) => { - const { state } = useFilePickerContext(); - return ( - <EuiEmptyPrompt - data-test-subj="emptyPrompt" - title={<h3>{i18nTexts.emptyStatePrompt}</h3>} - body={ - <EuiText color="subdued" size="s"> - <p>{i18nTexts.emptyStatePromptSubtitle}</p> - </EuiText> - } - titleSize="s" - actions={[ - // TODO: We can remove this once the entire modal is an upload area - <UploadFile - kind={kind} - immediate - onDone={(file) => { - state.selectFile(file.map(({ id }) => id)); - state.retry(); - }} - />, - ]} - /> - ); -}; diff --git a/x-pack/plugins/files/public/components/file_picker/context.tsx b/x-pack/plugins/files/public/components/file_picker/context.tsx deleted file mode 100644 index 67e745b745829..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/context.tsx +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { createContext, useContext, useMemo, useEffect } from 'react'; -import type { FunctionComponent } from 'react'; -import { useFilesContext, FilesContextValue } from '../context'; -import { FilePickerState, createFilePickerState } from './file_picker_state'; - -interface FilePickerContextValue extends FilesContextValue { - state: FilePickerState; - kind: string; -} - -const FilePickerCtx = createContext<FilePickerContextValue>( - null as unknown as FilePickerContextValue -); - -interface FilePickerContextProps { - kind: string; - pageSize: number; -} -export const FilePickerContext: FunctionComponent<FilePickerContextProps> = ({ - kind, - pageSize, - children, -}) => { - const filesContext = useFilesContext(); - const { client } = filesContext; - const state = useMemo( - () => createFilePickerState({ pageSize, client, kind }), - [pageSize, client, kind] - ); - useEffect(() => state.dispose, [state]); - return ( - <FilePickerCtx.Provider value={{ state, kind, ...filesContext }}> - {children} - </FilePickerCtx.Provider> - ); -}; - -export const useFilePickerContext = (): FilePickerContextValue => { - const ctx = useContext(FilePickerCtx); - if (!ctx) throw new Error('FilePickerContext not found!'); - return ctx; -}; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.tsx b/x-pack/plugins/files/public/components/file_picker/file_picker.tsx deleted file mode 100644 index 72920b72a865d..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/file_picker.tsx +++ /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. - */ - -import React from 'react'; -import type { FunctionComponent } from 'react'; -import useObservable from 'react-use/lib/useObservable'; -import { - EuiModal, - EuiModalBody, - EuiModalHeader, - EuiLoadingSpinner, - EuiSpacer, - EuiFlexGroup, -} from '@elastic/eui'; - -import { useBehaviorSubject } from '../use_behavior_subject'; -import { useFilePickerContext, FilePickerContext } from './context'; - -import { Title } from './components/title'; -import { ErrorContent } from './components/error_content'; -import { UploadFilesPrompt } from './components/upload_files'; -import { FileGrid } from './components/file_grid'; -import { SearchField } from './components/search_field'; -import { ModalFooter } from './components/modal_footer'; - -import './file_picker.scss'; -import { ClearFilterButton } from './components/clear_filter_button'; - -export interface Props<Kind extends string = string> { - /** - * The file kind that was passed to the registry. - */ - kind: Kind; - /** - * Will be called when the modal is closed - */ - onClose: () => void; - /** - * Will be called after a user has a selected a set of files - */ - onDone: (fileIds: string[]) => void; - /** - * The number of results to show per page. - */ - pageSize?: number; -} - -const Component: FunctionComponent<Props> = ({ onClose, onDone }) => { - const { state, kind } = useFilePickerContext(); - - const hasFiles = useBehaviorSubject(state.hasFiles$); - const hasQuery = useBehaviorSubject(state.hasQuery$); - const isLoading = useBehaviorSubject(state.isLoading$); - const error = useBehaviorSubject(state.loadingError$); - - useObservable(state.files$); - - const renderFooter = () => <ModalFooter onDone={onDone} />; - - return ( - <EuiModal - data-test-subj="filePickerModal" - className="filesFilePicker filesFilePicker--fixed" - maxWidth="75vw" - onClose={onClose} - > - <EuiModalHeader> - <Title /> - <SearchField /> - </EuiModalHeader> - {isLoading ? ( - <> - <EuiModalBody> - <EuiFlexGroup justifyContent="center" alignItems="center" gutterSize="none"> - <EuiLoadingSpinner data-test-subj="loadingSpinner" size="xl" /> - </EuiFlexGroup> - </EuiModalBody> - {renderFooter()} - </> - ) : Boolean(error) ? ( - <EuiModalBody> - <ErrorContent error={error as Error} /> - </EuiModalBody> - ) : !hasFiles && !hasQuery ? ( - <EuiModalBody> - <UploadFilesPrompt kind={kind} /> - </EuiModalBody> - ) : ( - <> - <EuiModalBody> - <FileGrid /> - <EuiSpacer /> - <ClearFilterButton onClick={() => state.setQuery(undefined)} /> - </EuiModalBody> - {renderFooter()} - </> - )} - </EuiModal> - ); -}; - -export const FilePicker: FunctionComponent<Props> = (props) => ( - <FilePickerContext pageSize={props.pageSize ?? 20} kind={props.kind}> - <Component {...props} /> - </FilePickerContext> -); - -/* eslint-disable import/no-default-export */ -export default FilePicker; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker_state.ts b/x-pack/plugins/files/public/components/file_picker/file_picker_state.ts deleted file mode 100644 index 3ca6ee9ffca99..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/file_picker_state.ts +++ /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 { - map, - tap, - from, - switchMap, - Observable, - shareReplay, - debounceTime, - Subscription, - combineLatest, - BehaviorSubject, - distinctUntilChanged, -} from 'rxjs'; -import { FileJSON } from '../../../common'; -import { FilesClient } from '../../types'; - -function naivelyFuzzify(query: string): string { - return query.includes('*') ? query : `*${query}*`; -} - -export class FilePickerState { - /** - * Files the user has selected - */ - public readonly selectedFileIds$ = new BehaviorSubject<string[]>([]); - - public readonly isLoading$ = new BehaviorSubject<boolean>(true); - public readonly loadingError$ = new BehaviorSubject<undefined | Error>(undefined); - public readonly hasFiles$ = new BehaviorSubject<boolean>(false); - public readonly hasQuery$ = new BehaviorSubject<boolean>(false); - public readonly query$ = new BehaviorSubject<undefined | string>(undefined); - public readonly queryDebounced$ = this.query$.pipe(debounceTime(100)); - public readonly currentPage$ = new BehaviorSubject<number>(0); - public readonly totalPages$ = new BehaviorSubject<undefined | number>(undefined); - - /** - * This is how we keep a deduplicated list of file ids representing files a user - * has selected - */ - private readonly fileSet = new Set<string>(); - private readonly retry$ = new BehaviorSubject<void>(undefined); - private readonly subscriptions: Subscription[] = []; - private readonly internalIsLoading$ = new BehaviorSubject<boolean>(true); - - constructor( - private readonly client: FilesClient, - private readonly kind: string, - public readonly pageSize: number - ) { - this.subscriptions = [ - this.query$ - .pipe( - tap(() => this.setIsLoading(true)), - map((query) => Boolean(query)), - distinctUntilChanged() - ) - .subscribe(this.hasQuery$), - this.internalIsLoading$ - .pipe(debounceTime(100), distinctUntilChanged()) - .subscribe(this.isLoading$), - ]; - } - - /** - * File objects we have loaded on the front end, stored here so that it can - * easily be passed to all relevant UI. - * - * @note This is not explicitly kept in sync with the selected files! - * @note This is not explicitly kept in sync with the selected files! - */ - public readonly files$ = combineLatest([ - this.currentPage$.pipe(distinctUntilChanged()), - this.query$.pipe(distinctUntilChanged(), debounceTime(100)), - this.retry$, - ]).pipe( - switchMap(([page, query]) => this.sendRequest(page, query)), - tap(({ total }) => this.updateTotalPages({ total })), - tap(({ total }) => this.hasFiles$.next(Boolean(total))), - map(({ files }) => files), - shareReplay() - ); - - private updateTotalPages = ({ total }: { total: number }): void => { - this.totalPages$.next(Math.ceil(total / this.pageSize)); - }; - - private sendNextSelectedFiles() { - this.selectedFileIds$.next(this.getSelectedFileIds()); - } - - private setIsLoading(value: boolean) { - this.internalIsLoading$.next(value); - } - - public selectFile = (fileId: string | string[]): void => { - (Array.isArray(fileId) ? fileId : [fileId]).forEach((id) => this.fileSet.add(id)); - this.sendNextSelectedFiles(); - }; - - private abort: undefined | (() => void) = undefined; - private sendRequest = ( - page: number, - query: undefined | string - ): Observable<{ files: FileJSON[]; total: number }> => { - if (this.abort) this.abort(); - this.setIsLoading(true); - this.loadingError$.next(undefined); - - const abortController = new AbortController(); - this.abort = () => { - try { - abortController.abort(); - } catch (e) { - // ignore - } - }; - - const request$ = from( - this.client.list({ - kind: this.kind, - name: query ? [naivelyFuzzify(query)] : undefined, - page: page + 1, - status: ['READY'], - perPage: this.pageSize, - abortSignal: abortController.signal, - }) - ).pipe( - tap(() => { - this.setIsLoading(false); - this.abort = undefined; - }), - shareReplay() - ); - - request$.subscribe({ - error: (e: Error) => { - if (e.name === 'AbortError') return; - this.setIsLoading(false); - this.loadingError$.next(e); - }, - }); - - return request$; - }; - - public retry = (): void => { - this.retry$.next(); - }; - - public hasFilesSelected = (): boolean => { - return this.fileSet.size > 0; - }; - - public unselectFile = (fileId: string): void => { - if (this.fileSet.delete(fileId)) this.sendNextSelectedFiles(); - }; - - public isFileIdSelected = (fileId: string): boolean => { - return this.fileSet.has(fileId); - }; - - public getSelectedFileIds = (): string[] => { - return Array.from(this.fileSet); - }; - - public setQuery = (query: undefined | string): void => { - if (query) this.query$.next(query); - else this.query$.next(undefined); - this.currentPage$.next(0); - }; - - public setPage = (page: number): void => { - this.currentPage$.next(page); - }; - - public dispose = (): void => { - for (const sub of this.subscriptions) sub.unsubscribe(); - }; - - watchFileSelected$ = (id: string): Observable<boolean> => { - return this.selectedFileIds$.pipe( - map(() => this.fileSet.has(id)), - distinctUntilChanged() - ); - }; -} - -interface CreateFilePickerArgs { - client: FilesClient; - kind: string; - pageSize: number; -} -export const createFilePickerState = ({ - pageSize, - client, - kind, -}: CreateFilePickerArgs): FilePickerState => { - return new FilePickerState(client, kind, pageSize); -}; diff --git a/x-pack/plugins/files/public/components/file_picker/i18n_texts.ts b/x-pack/plugins/files/public/components/file_picker/i18n_texts.ts deleted file mode 100644 index 2670ecd71b084..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/i18n_texts.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const i18nTexts = { - title: i18n.translate('xpack.files.filePicker.title', { - defaultMessage: 'Select a file', - }), - loadingFilesErrorTitle: i18n.translate('xpack.files.filePicker.error.loadingTitle', { - defaultMessage: 'Could not load files', - }), - retryButtonLabel: i18n.translate('xpack.files.filePicker.error.retryButtonLabel', { - defaultMessage: 'Retry', - }), - emptyStatePrompt: i18n.translate('xpack.files.filePicker.emptyStatePrompt', { - defaultMessage: 'No files found', - }), - emptyStatePromptSubtitle: i18n.translate('xpack.files.filePicker.emptyStatePromptSubtitle', { - defaultMessage: 'Upload your first file.', - }), - selectFileLabel: i18n.translate('xpack.files.filePicker.selectFileButtonLable', { - defaultMessage: 'Select file', - }), - selectFilesLabel: (nrOfFiles: number) => - i18n.translate('xpack.files.filePicker.selectFilesButtonLable', { - defaultMessage: 'Select {nrOfFiles} files', - values: { nrOfFiles }, - }), - searchFieldPlaceholder: i18n.translate('xpack.files.filePicker.searchFieldPlaceholder', { - defaultMessage: 'my-file-*', - }), - emptyFileGridPrompt: i18n.translate('xpack.files.filePicker.emptyGridPrompt', { - defaultMessage: 'No files matched filter', - }), - loadMoreButtonLabel: i18n.translate('xpack.files.filePicker.loadMoreButtonLabel', { - defaultMessage: 'Load more', - }), - clearFilterButton: i18n.translate('xpack.files.filePicker.clearFilterButtonLabel', { - defaultMessage: 'Clear filter', - }), -}; diff --git a/x-pack/plugins/files/public/components/file_picker/index.tsx b/x-pack/plugins/files/public/components/file_picker/index.tsx deleted file mode 100644 index 47c892ef1cadd..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/index.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; 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 type { Props } from './file_picker'; - -export type { Props as FilePickerProps }; - -const FilePickerContainer = lazy(() => import('./file_picker')); - -export const FilePicker = (props: Props) => ( - <Suspense fallback={<EuiLoadingSpinner size="xl" />}> - <FilePickerContainer {...props} /> - </Suspense> -); diff --git a/x-pack/plugins/files/public/components/image/components/img.tsx b/x-pack/plugins/files/public/components/image/components/img.tsx deleted file mode 100644 index 295b062ca1fd8..0000000000000 --- a/x-pack/plugins/files/public/components/image/components/img.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 from 'react'; -import type { ImgHTMLAttributes, MutableRefObject } from 'react'; -import type { EuiImageSize } from '@elastic/eui/src/components/image/image_types'; -import { useEuiTheme } from '@elastic/eui'; -import { css } from '@emotion/react'; -import { sizes } from '../styles'; - -export interface Props extends ImgHTMLAttributes<HTMLImageElement> { - hidden: boolean; - size?: EuiImageSize; - observerRef: (el: null | HTMLImageElement) => void; -} - -export const Img = React.forwardRef<HTMLImageElement, Props>( - ({ observerRef, src, hidden, size, ...rest }, ref) => { - const { euiTheme } = useEuiTheme(); - const styles = [ - css` - transition: opacity ${euiTheme.animation.extraFast}; - `, - hidden - ? css` - visibility: hidden; - ` - : undefined, - size ? sizes[size] : undefined, - ]; - return ( - <img - alt="" - css={styles} - {...rest} - src={src} - ref={(element) => { - observerRef(element); - if (ref) { - if (typeof ref === 'function') ref(element); - else (ref as MutableRefObject<HTMLImageElement | null>).current = element; - } - }} - /> - ); - } -); diff --git a/x-pack/plugins/files/public/components/image/components/index.ts b/x-pack/plugins/files/public/components/image/components/index.ts deleted file mode 100644 index 7fee8f7fd63fb..0000000000000 --- a/x-pack/plugins/files/public/components/image/components/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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { Img } from './img'; -export type { Props as ImgProps } from './img'; -export { Blurhash } from './blurhash'; diff --git a/x-pack/plugins/files/public/components/image/index.ts b/x-pack/plugins/files/public/components/image/index.ts deleted file mode 100644 index 05ffe3dd1c4e7..0000000000000 --- a/x-pack/plugins/files/public/components/image/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { Image } from './image'; -export type { Props as ImageProps } from './image'; diff --git a/x-pack/plugins/files/public/components/image/styles.ts b/x-pack/plugins/files/public/components/image/styles.ts deleted file mode 100644 index b14121c667a50..0000000000000 --- a/x-pack/plugins/files/public/components/image/styles.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { css } from '@emotion/react'; - -// Values taken from @elastic/eui/src/components/image -export const sizes = { - s: css` - width: 100px; - `, - m: css` - width: 200px; - `, - l: css` - width: 360px; - `, - xl: css` - width: 600px; - `, - original: css` - width: auto; - `, - fullWidth: css` - width: 100%; - `, -}; diff --git a/x-pack/plugins/files/public/components/index.ts b/x-pack/plugins/files/public/components/index.ts deleted file mode 100644 index c5ab1382b4dfa..0000000000000 --- a/x-pack/plugins/files/public/components/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 { Image, type ImageProps } from './image'; -export { UploadFile, type UploadFileProps } from './upload_file'; -export { FilePicker, type FilePickerProps } from './file_picker'; -export { FilesContext } from './context'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/index.ts b/x-pack/plugins/files/public/components/upload_file/components/index.ts deleted file mode 100644 index fbc7ffd8eda79..0000000000000 --- a/x-pack/plugins/files/public/components/upload_file/components/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { ControlButton } from './control_button'; -export { ClearButton } from './clear_button'; diff --git a/x-pack/plugins/files/public/components/upload_file/context.ts b/x-pack/plugins/files/public/components/upload_file/context.ts deleted file mode 100644 index e88f5d2441489..0000000000000 --- a/x-pack/plugins/files/public/components/upload_file/context.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import React from 'react'; -import type { UploadState } from './upload_state'; - -export const context = React.createContext<UploadState | null>(null); -export const useUploadState = () => React.useContext(context)!; diff --git a/x-pack/plugins/files/public/components/upload_file/i18n_texts.ts b/x-pack/plugins/files/public/components/upload_file/i18n_texts.ts deleted file mode 100644 index b58616e3d86b0..0000000000000 --- a/x-pack/plugins/files/public/components/upload_file/i18n_texts.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 { i18n } from '@kbn/i18n'; - -export const i18nTexts = { - defaultPickerLabel: i18n.translate('xpack.files.uploadFile.defaultFilePickerLabel', { - defaultMessage: 'Upload a file', - }), - upload: i18n.translate('xpack.files.uploadFile.uploadButtonLabel', { - defaultMessage: 'Upload', - }), - uploading: i18n.translate('xpack.files.uploadFile.uploadingButtonLabel', { - defaultMessage: 'Uploading', - }), - uploadComplete: i18n.translate('xpack.files.uploadFile.uploadCompleteButtonLabel', { - defaultMessage: 'Upload complete', - }), - retry: i18n.translate('xpack.files.uploadFile.retryButtonLabel', { - defaultMessage: 'Retry', - }), - clear: i18n.translate('xpack.files.uploadFile.clearButtonLabel', { - defaultMessage: 'Clear', - }), - cancel: i18n.translate('xpack.files.uploadFile.cancelButtonLabel', { - defaultMessage: 'Cancel', - }), - uploadDone: i18n.translate('xpack.files.uploadFile.uploadDoneToolTipContent', { - defaultMessage: 'Your file was successfully uploaded!', - }), - fileTooLarge: (expectedSize: string) => - i18n.translate('xpack.files.uploadFile.fileTooLargeErrorMessage', { - defaultMessage: - 'File is too large. Maximum size is {expectedSize, plural, one {# byte} other {# bytes} }.', - values: { expectedSize }, - }), -}; diff --git a/x-pack/plugins/files/public/components/upload_file/index.tsx b/x-pack/plugins/files/public/components/upload_file/index.tsx deleted file mode 100644 index 4901c46a78c91..0000000000000 --- a/x-pack/plugins/files/public/components/upload_file/index.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; 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 type { Props } from './upload_file'; - -export type { Props as UploadFileProps }; - -const UploadFileContainer = lazy(() => import('./upload_file')); - -export const UploadFile = (props: Props) => ( - <Suspense fallback={<EuiLoadingSpinner size="xl" />}> - <UploadFileContainer {...props} /> - </Suspense> -); diff --git a/x-pack/plugins/files/public/components/upload_file/util/index.ts b/x-pack/plugins/files/public/components/upload_file/util/index.ts deleted file mode 100644 index e8fbb4e1ecedc..0000000000000 --- a/x-pack/plugins/files/public/components/upload_file/util/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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { SimpleStateSubject, createStateSubject } from './simple_state_subject'; - -export { parseFileName } from './parse_file_name'; diff --git a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.ts b/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.ts deleted file mode 100644 index 485b3013631dd..0000000000000 --- a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -interface Result { - name: string; -} - -export function parseFileName(fileName: string): Result { - const withoutExt = fileName.substring(0, fileName.lastIndexOf('.')) || fileName; - return { - name: withoutExt - .trim() - .slice(0, 256) - .replace(/[^a-z0-9\s]/gi, '_'), // replace invalid chars - }; -} diff --git a/x-pack/plugins/files/public/components/use_behavior_subject.ts b/x-pack/plugins/files/public/components/use_behavior_subject.ts deleted file mode 100644 index f68ae6faef28c..0000000000000 --- a/x-pack/plugins/files/public/components/use_behavior_subject.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { BehaviorSubject } from 'rxjs'; -import useObservable from 'react-use/lib/useObservable'; - -export function useBehaviorSubject<T>(o$: BehaviorSubject<T>) { - return useObservable(o$, o$.getValue()); -} diff --git a/x-pack/plugins/files/public/components/util/index.ts b/x-pack/plugins/files/public/components/util/index.ts deleted file mode 100644 index e3e30fdb17bb3..0000000000000 --- a/x-pack/plugins/files/public/components/util/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { getImageMetadata, isImage, fitToBox } from './image_metadata'; -export type { ImageMetadataFactory } from './image_metadata'; diff --git a/x-pack/plugins/files/public/files_client/index.ts b/x-pack/plugins/files/public/files_client/index.ts deleted file mode 100644 index 60f3022e825df..0000000000000 --- a/x-pack/plugins/files/public/files_client/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 { createFilesClient } from './files_client'; diff --git a/x-pack/plugins/files/public/index.ts b/x-pack/plugins/files/public/index.ts deleted file mode 100644 index a9bd88615ff12..0000000000000 --- a/x-pack/plugins/files/public/index.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 { FilesPlugin } from './plugin'; -export type { FilesSetup, FilesStart } from './plugin'; -export type { - FilesClient, - ScopedFilesClient, - FilesClientFactory, - FilesClientResponses, -} from './types'; -export { - FilesContext, - Image, - type ImageProps, - UploadFile, - type UploadFileProps, - FilePicker, - type FilePickerProps, -} from './components'; - -export function plugin() { - return new FilesPlugin(); -} diff --git a/x-pack/plugins/files/public/mocks.ts b/x-pack/plugins/files/public/mocks.ts deleted file mode 100644 index c34438d096a2b..0000000000000 --- a/x-pack/plugins/files/public/mocks.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 type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; -import type { FilesClient } from './types'; - -// TODO: Remove this once we have access to the shared file client mock -export const createMockFilesClient = (): DeeplyMockedKeys<FilesClient> => ({ - create: jest.fn(), - delete: jest.fn(), - download: jest.fn(), - find: jest.fn(), - getById: jest.fn(), - getDownloadHref: jest.fn(), - getMetrics: jest.fn(), - getShare: jest.fn(), - list: jest.fn(), - listShares: jest.fn(), - publicDownload: jest.fn(), - share: jest.fn(), - unshare: jest.fn(), - update: jest.fn(), - upload: jest.fn(), -}); diff --git a/x-pack/plugins/files/public/plugin.ts b/x-pack/plugins/files/public/plugin.ts deleted file mode 100644 index 2f5481f8f2511..0000000000000 --- a/x-pack/plugins/files/public/plugin.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import { - getFileKindsRegistry, - setFileKindsRegistry, - FileKindsRegistryImpl, -} from '../common/file_kinds_registry'; -import type { FilesClient, FilesClientFactory } from './types'; -import { createFilesClient } from './files_client'; -import { FileKind } from '../common'; -import { ScopedFilesClient } from '.'; - -/** - * Public setup-phase contract - */ -export interface FilesSetup { - /** - * A factory for creating an {@link FilesClient} instance. This requires a - * registered {@link FileKind}. - * - * @track-adoption - */ - filesClientFactory: FilesClientFactory; - - /** - * Register a {@link FileKind} which allows for specifying details about the files - * that will be uploaded. - * - * @param {FileKind} fileKind - the file kind to register - */ - registerFileKind(fileKind: FileKind): void; -} - -export type FilesStart = Pick<FilesSetup, 'filesClientFactory'>; - -/** - * Bringing files to Kibana - */ -export class FilesPlugin implements Plugin<FilesSetup, FilesStart> { - private filesClientFactory: undefined | FilesClientFactory; - - constructor() { - setFileKindsRegistry(new FileKindsRegistryImpl()); - } - - setup(core: CoreSetup): FilesSetup { - this.filesClientFactory = { - asScoped<M = unknown>(fileKind: string) { - return createFilesClient({ fileKind, http: core.http }) as ScopedFilesClient<M>; - }, - asUnscoped<M>() { - return createFilesClient({ http: core.http }) as FilesClient<M>; - }, - }; - return { - filesClientFactory: this.filesClientFactory, - registerFileKind: (fileKind: FileKind) => { - getFileKindsRegistry().register(fileKind); - }, - }; - } - - start(core: CoreStart): FilesStart { - return { - filesClientFactory: this.filesClientFactory!, - }; - } -} diff --git a/x-pack/plugins/files/public/types.ts b/x-pack/plugins/files/public/types.ts deleted file mode 100644 index fcc5c11b1ae45..0000000000000 --- a/x-pack/plugins/files/public/types.ts +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FileJSON } from '../common'; -import type { - FindFilesHttpEndpoint, - FileShareHttpEndpoint, - FileUnshareHttpEndpoint, - FileGetShareHttpEndpoint, - FilesMetricsHttpEndpoint, - ListFileKindHttpEndpoint, - CreateFileKindHttpEndpoint, - FileListSharesHttpEndpoint, - UpdateFileKindHttpEndpoint, - UploadFileKindHttpEndpoint, - DeleteFileKindHttpEndpoint, - GetByIdFileKindHttpEndpoint, - DownloadFileKindHttpEndpoint, - FilePublicDownloadHttpEndpoint, - HttpApiInterfaceEntryDefinition, -} from '../common/api_routes'; - -type UnscopedClientMethodFrom<E extends HttpApiInterfaceEntryDefinition> = ( - args: E['inputs']['body'] & - E['inputs']['params'] & - E['inputs']['query'] & { abortSignal?: AbortSignal } -) => Promise<E['output']>; - -/** - * @param args - Input to the endpoint which includes body, params and query of the RESTful endpoint. - */ -type ClientMethodFrom<E extends HttpApiInterfaceEntryDefinition, ExtraArgs extends {} = {}> = ( - args: Parameters<UnscopedClientMethodFrom<E>>[0] & { kind: string } & ExtraArgs -) => Promise<E['output']>; - -interface GlobalEndpoints { - /** - * Get metrics of file system, like storage usage. - * - * @param args - Get metrics arguments - */ - getMetrics: () => Promise<FilesMetricsHttpEndpoint['output']>; - /** - * Download a file, bypassing regular security by way of a - * secret share token. - * - * @param args - Get public download arguments. - */ - publicDownload: UnscopedClientMethodFrom<FilePublicDownloadHttpEndpoint>; - /** - * Find a set of files given some filters. - * - * @param args - File filters - */ - find: UnscopedClientMethodFrom<FindFilesHttpEndpoint>; -} - -/** - * A client that can be used to manage a specific {@link FileKind}. - */ -export interface FilesClient<M = unknown> extends GlobalEndpoints { - /** - * Create a new file object with the provided metadata. - * - * @param args - create file args - */ - create: ClientMethodFrom<CreateFileKindHttpEndpoint<M>>; - /** - * Delete a file object and all associated share and content objects. - * - * @param args - delete file args - */ - delete: ClientMethodFrom<DeleteFileKindHttpEndpoint>; - /** - * Get a file object by ID. - * - * @param args - get file by ID args - */ - getById: ClientMethodFrom<GetByIdFileKindHttpEndpoint<M>>; - /** - * List all file objects, of a given {@link FileKind}. - * - * @param args - list files args - */ - list: ClientMethodFrom<ListFileKindHttpEndpoint<M>>; - /** - * Update a set of of metadata values of the file object. - * - * @param args - update file args - */ - update: ClientMethodFrom<UpdateFileKindHttpEndpoint<M>>; - /** - * Stream the contents of the file to Kibana server for storage. - * - * @param args - upload file args - */ - upload: ( - args: UploadFileKindHttpEndpoint['inputs']['params'] & - UploadFileKindHttpEndpoint['inputs']['query'] & { - /** - * Should be blob or ReadableStream of some kind. - */ - body: unknown; - kind: string; - abortSignal?: AbortSignal; - contentType?: string; - } - ) => Promise<UploadFileKindHttpEndpoint['output']>; - /** - * Stream a download of the file object's content. - * - * @param args - download file args - */ - download: ClientMethodFrom<DownloadFileKindHttpEndpoint>; - /** - * Get a string for downloading a file that can be passed to a button element's - * href for download. - * - * @param args - get download URL args - */ - getDownloadHref: (args: Pick<FileJSON, 'id' | 'fileKind'>) => string; - /** - * Share a file by creating a new file share instance. - * - * @note This returns the secret token that can be used - * to access a file via the public download enpoint. - * - * @param args - File share arguments - */ - share: ClientMethodFrom<FileShareHttpEndpoint>; - /** - * Delete a file share instance. - * - * @param args - File unshare arguments - */ - unshare: ClientMethodFrom<FileUnshareHttpEndpoint>; - /** - * Get a file share instance. - * - * @param args - Get file share arguments - */ - getShare: ClientMethodFrom<FileGetShareHttpEndpoint>; - /** - * List all file shares. Optionally scoping to a specific - * file. - * - * @param args - Get file share arguments - */ - listShares: ClientMethodFrom<FileListSharesHttpEndpoint>; -} - -export type FilesClientResponses<M = unknown> = { - [K in keyof FilesClient]: Awaited<ReturnType<FilesClient<M>[K]>>; -}; - -/** - * A files client that is scoped to a specific {@link FileKind}. - * - * More convenient if you want to re-use the same client for the same file kind - * and not specify the kind every time. - */ -export type ScopedFilesClient<M = unknown> = { - [K in keyof FilesClient]: K extends 'list' - ? (arg?: Omit<Parameters<FilesClient<M>[K]>[0], 'kind'>) => ReturnType<FilesClient<M>[K]> - : (arg: Omit<Parameters<FilesClient<M>[K]>[0], 'kind'>) => ReturnType<FilesClient<M>[K]>; -}; - -/** - * A factory for creating a {@link ScopedFilesClient} - */ -export interface FilesClientFactory { - /** - * Create a files client. - */ - asUnscoped<M = unknown>(): FilesClient<M>; - /** - * Create a {@link ScopedFileClient} for a given {@link FileKind}. - * - * @param fileKind - The {@link FileKind} to create a client for. - */ - asScoped<M = unknown>(fileKind: string): ScopedFilesClient<M>; -} diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts b/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts deleted file mode 100644 index a31e0c8b672dc..0000000000000 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { - ContentStream, - getReadableContentStream, - getWritableContentStream, -} from './content_stream'; - -export type { - ContentStreamArgs, - ContentStreamEncoding, - ContentStreamParameters, - ReadableContentStream, - WritableContentStream, -} from './content_stream'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.test.ts b/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.test.ts deleted file mode 100644 index 9d1ddda739717..0000000000000 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.test.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 { Readable } from 'stream'; -import { promisify } from 'util'; -import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; -import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; -import { Semaphore } from '@kbn/std'; - -import { ElasticsearchBlobStorageClient } from './es'; - -const setImmediate = promisify(global.setImmediate); - -describe('ElasticsearchBlobStorageClient', () => { - let esClient: ElasticsearchClient; - let blobStoreClient: ElasticsearchBlobStorageClient; - let semaphore: Semaphore; - - beforeEach(() => { - semaphore = new Semaphore(1); - esClient = elasticsearchServiceMock.createElasticsearchClient(); - blobStoreClient = new ElasticsearchBlobStorageClient( - esClient, - undefined, - undefined, - loggingSystemMock.createLogger(), - semaphore - ); - }); - - test('limits max concurrent uploads', async () => { - const acquireSpy = jest.spyOn(semaphore, 'acquire'); - (esClient.index as jest.Mock).mockImplementation(() => { - return new Promise((res, rej) => setTimeout(() => rej('failed'), 100)); - }); - const [p1, p2, ...rest] = [ - blobStoreClient.upload(Readable.from(['test'])).catch(() => {}), - blobStoreClient.upload(Readable.from(['test'])).catch(() => {}), - blobStoreClient.upload(Readable.from(['test'])).catch(() => {}), - blobStoreClient.upload(Readable.from(['test'])).catch(() => {}), - ]; - await setImmediate(); - expect(acquireSpy).toHaveBeenCalledTimes(4); - await p1; - expect(esClient.index).toHaveBeenCalledTimes(1); - await p2; - expect(esClient.index).toHaveBeenCalledTimes(2); - await Promise.all(rest); - expect(esClient.index).toHaveBeenCalledTimes(4); - }); -}); diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/index.ts b/x-pack/plugins/files/server/blob_storage_service/adapters/es/index.ts deleted file mode 100644 index 75ac82acb66df..0000000000000 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/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 { ElasticsearchBlobStorageClient, MAX_BLOB_STORE_SIZE_BYTES } from './es'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts b/x-pack/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts deleted file mode 100644 index 8bcc8c503bb49..0000000000000 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import sinon from 'sinon'; -import { ElasticsearchClient } from '@kbn/core/server'; -import { Readable } from 'stream'; -import { - createTestServers, - TestElasticsearchUtils, - TestKibanaUtils, -} from '@kbn/core/test_helpers/kbn_server'; - -import { ElasticsearchBlobStorageClient, BLOB_STORAGE_SYSTEM_INDEX_NAME } from '../es'; - -describe('Elasticsearch blob storage', () => { - let manageES: TestElasticsearchUtils; - let manageKbn: TestKibanaUtils; - let esBlobStorage: ElasticsearchBlobStorageClient; - let esClient: ElasticsearchClient; - const sandbox = sinon.createSandbox(); - - beforeAll(async () => { - ElasticsearchBlobStorageClient.configureConcurrentUpload(Infinity); - const { startES, startKibana } = createTestServers({ adjustTimeout: jest.setTimeout }); - manageES = await startES(); - manageKbn = await startKibana(); - esClient = manageKbn.coreStart.elasticsearch.client.asInternalUser; - }); - - afterAll(async () => { - await manageKbn.root.shutdown(); - await manageKbn.stop(); - await manageES.stop(); - }); - - const createEsBlobStorage = ({ chunkSize }: { chunkSize?: string } = {}) => - new ElasticsearchBlobStorageClient( - esClient, - undefined, - chunkSize, - manageKbn.root.logger.get('es-blob-test') - ); - - beforeEach(() => { - esBlobStorage = createEsBlobStorage(); - sandbox.spy(esClient, 'get'); - }); - - afterEach(async () => { - await esClient.indices.delete({ index: BLOB_STORAGE_SYSTEM_INDEX_NAME }); - sandbox.restore(); - }); - - it('sets up a new blob storage index after first write', async () => { - expect(await esClient.indices.exists({ index: BLOB_STORAGE_SYSTEM_INDEX_NAME })).toBe(false); - await esBlobStorage.upload(Readable.from(['upload this'])); - expect(await esClient.indices.exists({ index: BLOB_STORAGE_SYSTEM_INDEX_NAME })).toBe(true); - }); - - it('uploads and retrieves file content of known size', async () => { - const { id, size } = await esBlobStorage.upload(Readable.from(['upload this'])); - const rs = await esBlobStorage.download({ id, size }); - const chunks: string[] = []; - for await (const chunk of rs) { - chunks.push(chunk); - } - expect(chunks.join('')).toBe('upload this'); - expect((esClient.get as sinon.SinonSpy).calledOnce).toBe(true); - }); - - /** - * Test a case where, if, for whatever reason, the file size is unknown we should - * still be able to download the file. - */ - it('uploads and retrieves file content of unknown size', async () => { - const { id } = await esBlobStorage.upload(Readable.from(['upload this'])); - const rs = await esBlobStorage.download({ id }); - const chunks: string[] = []; - for await (const chunk of rs) { - chunks.push(chunk); - } - expect(chunks.join('')).toBe('upload this'); - // Called once because we should have found 'last: true' - expect((esClient.get as sinon.SinonSpy).calledOnce).toBe(true); - expect((esClient.get as sinon.SinonSpy).args[0]).toEqual([ - { - id: id + '.0', - index: BLOB_STORAGE_SYSTEM_INDEX_NAME, - _source_includes: ['data', 'last'], - }, - { - headers: { accept: 'application/cbor' }, - asStream: true, - }, - ]); - }); - - it('uploads and downloads a file of many chunks', async () => { - const fileString = Buffer.alloc(36 * 1028, 'a'); - esBlobStorage = createEsBlobStorage({ chunkSize: '1024B' }); - const { id } = await esBlobStorage.upload(Readable.from([fileString])); - expect(await getAllDocCount()).toMatchObject({ count: 37 }); - const rs = await esBlobStorage.download({ id }); - const chunks: string[] = []; - for await (const chunk of rs) { - chunks.push(chunk); - } - expect(chunks.join('')).toBe(fileString.toString('utf-8')); - }); - - const getAllDocCount = async () => { - await esClient.indices.refresh({ index: BLOB_STORAGE_SYSTEM_INDEX_NAME }); - return esClient.count({ - index: BLOB_STORAGE_SYSTEM_INDEX_NAME, - query: { match_all: {} }, - }); - }; - - it('uploads and removes file content', async () => { - const { id } = await esBlobStorage.upload(Readable.from(['upload this'])); - expect(await getAllDocCount()).toMatchObject({ count: 1 }); - await esBlobStorage.delete(id); - expect(await getAllDocCount()).toMatchObject({ count: 0 }); - }); - - it('chunks files and then deletes all chunks when cleaning up', async () => { - const oneMiB = 1024 * 1024; - const fileString = Buffer.alloc(31 * oneMiB, 'a'); - const fileString2 = Buffer.alloc(8 * oneMiB, 'b'); - - esBlobStorage = createEsBlobStorage(); - const { id } = await esBlobStorage.upload(Readable.from([fileString])); - const { id: id2 } = await esBlobStorage.upload(Readable.from([fileString2])); - expect(await getAllDocCount()).toMatchObject({ count: 10 }); - await esBlobStorage.delete(id); - expect(await getAllDocCount()).toMatchObject({ count: 2 }); - // Now we check that the other file is still intact - const rs = await esBlobStorage.download({ id: id2 }); - const chunks: Buffer[] = []; - for await (const chunk of rs) { - chunks.push(chunk); - } - const resultString = chunks.join(''); - expect(resultString).toBe(fileString2.toString('utf-8')); - }); - - it('stores chunks at exactly max chunk size', async () => { - esBlobStorage = createEsBlobStorage({ chunkSize: '1024B' }); - const fileBuffer = Buffer.alloc(2048, 'a'); - const { id } = await esBlobStorage.upload(Readable.from([fileBuffer])); - expect(await getAllDocCount()).toMatchObject({ count: 2 }); - const rs = await esBlobStorage.download({ id }); - const chunks: Buffer[] = []; - for await (const chunk of rs) { - chunks.push(chunk); - } - expect(chunks.join('')).toEqual(fileBuffer.toString('utf-8')); - }); -}); diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/index.ts b/x-pack/plugins/files/server/blob_storage_service/adapters/index.ts deleted file mode 100644 index 75ac82acb66df..0000000000000 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/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 { ElasticsearchBlobStorageClient, MAX_BLOB_STORE_SIZE_BYTES } from './es'; diff --git a/x-pack/plugins/files/server/blob_storage_service/index.ts b/x-pack/plugins/files/server/blob_storage_service/index.ts deleted file mode 100644 index fd8d4e190c092..0000000000000 --- a/x-pack/plugins/files/server/blob_storage_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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { BlobStorageService } from './blob_storage_service'; -export { ElasticsearchBlobStorageClient } from './adapters'; -export type { BlobStorageClient, UploadOptions } from './types'; diff --git a/x-pack/plugins/files/server/blob_storage_service/types.ts b/x-pack/plugins/files/server/blob_storage_service/types.ts deleted file mode 100644 index 6a5c40708a973..0000000000000 --- a/x-pack/plugins/files/server/blob_storage_service/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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { JsonValue } from '@kbn/utility-types'; -import type { Readable, Transform } from 'stream'; - -export type BlobAttribute = [key: string, value: JsonValue]; - -export interface UploadOptions { - /** - * Optionally provide any transforms to run on the readable source stream - * as it is being uploaded. - */ - transforms?: Transform[]; - - /** - * The ID to use to derive blob IDs. - * - * If "mycoolid" is provided. The blob IDs will look like: - * "mycoolid.0" - * "mycoolid.1" - * "mycoolid.2" - * - * And so on. - */ - id?: string; -} - -/** - * An interface that must be implemented by any blob storage adapter. - * - * @note - * The blob storage target must be fully managed by Kibana through this interface - * to avoid corrupting stored data. - * - * @note - * File IDs are stored in Kibana Saved Objects as references to a file. - * - * @internal - */ -export interface BlobStorageClient { - /** - * Upload a new file. - * - * Generates a random file ID and returns it upon successfully uploading a - * file. The file size can be used when downloading the file later. - * - * @param content - The readable stream to upload. - * @param opts - Optional options to use when uploading the file. - */ - upload(content: Readable, opts?: UploadOptions): Promise<{ id: string; size: number }>; - - /** - * Download a file. - * - * Given an ID, and optional file size, retrieve the file contents as a readable - * stream. - * - * @param args - Arguments to download a file - */ - download(args: { id: string; size?: number }): Promise<Readable>; - - /** - * Delete a file given a unique ID. - * - * @param id - The ID of the file to delete. - */ - delete(id: string): Promise<void>; -} diff --git a/x-pack/plugins/files/server/file/errors.ts b/x-pack/plugins/files/server/file/errors.ts deleted file mode 100644 index 34ce179555ff0..0000000000000 --- a/x-pack/plugins/files/server/file/errors.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. - */ - -/* eslint-disable max-classes-per-file */ - -class FileError extends Error { - constructor(message?: string) { - super(message); - Error.captureStackTrace(this); - } -} - -export class ContentAlreadyUploadedError extends FileError {} -export class NoDownloadAvailableError extends FileError {} -export class UploadInProgressError extends FileError {} -export class AlreadyDeletedError extends FileError {} -export class AbortedUploadError extends FileError {} diff --git a/x-pack/plugins/files/server/file/file.ts b/x-pack/plugins/files/server/file/file.ts deleted file mode 100644 index c1b9d8ad12fde..0000000000000 --- a/x-pack/plugins/files/server/file/file.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 { Logger } from '@kbn/core/server'; -import { Readable } from 'stream'; -import { - map, - from, - race, - defer, - NEVER, - mergeMap, - catchError, - Observable, - lastValueFrom, -} from 'rxjs'; -import type { FileShareJSON, FileShareJSONWithToken } from '../../common/types'; -import type { File as IFile, UpdatableFileMetadata, FileJSON } from '../../common'; -import { fileAttributesReducer, Action } from './file_attributes_reducer'; -import type { FileClientImpl } from '../file_client/file_client'; -import { - AbortedUploadError, - AlreadyDeletedError, - UploadInProgressError, - NoDownloadAvailableError, - ContentAlreadyUploadedError, -} from './errors'; - -/** - * Scopes file actions to an ID and set of attributes. - * - * Also exposes the upload and download functionality. - */ -export class File<M = unknown> implements IFile { - constructor( - public readonly id: string, - private metadata: FileJSON<M>, - private readonly fileClient: FileClientImpl, - private readonly logger: Logger - ) {} - - private async updateFileState(action: Action): Promise<void> { - const metadata = fileAttributesReducer(this.data, action); - await this.fileClient.internalUpdate(this.id, metadata); - this.data = metadata as FileJSON<M>; - } - - private isReady(): boolean { - return this.data.status === 'READY'; - } - - private isDeleted(): boolean { - return this.data.status === 'DELETED'; - } - - private uploadInProgress(): boolean { - return this.data.status === 'UPLOADING'; - } - - public async update(attrs: Partial<UpdatableFileMetadata>): Promise<IFile<M>> { - await this.updateFileState({ - action: 'updateFile', - payload: attrs, - }); - return this; - } - - private upload(content: Readable): Observable<{ size: number }> { - return defer(() => this.fileClient.upload(this.id, content)); - } - - public async uploadContent( - content: Readable, - abort$: Observable<unknown> = NEVER - ): Promise<IFile<M>> { - if (this.uploadInProgress()) { - throw new UploadInProgressError('Upload already in progress.'); - } - if (this.isReady()) { - throw new ContentAlreadyUploadedError('Already uploaded file content.'); - } - this.logger.debug(`Uploading file [id = ${this.id}][name = ${this.data.name}].`); - - await lastValueFrom( - from(this.updateFileState({ action: 'uploading' })).pipe( - mergeMap(() => - race( - this.upload(content), - abort$.pipe( - map(() => { - throw new AbortedUploadError(`Aborted upload of ${this.id}!`); - }) - ) - ) - ), - mergeMap(({ size }) => { - return this.updateFileState({ action: 'uploaded', payload: { size } }); - }), - catchError(async (e) => { - try { - await this.updateFileState({ action: 'uploadError' }); - } catch (updateError) { - this.logger.error( - `Could not update file ${this.id} after upload error (${e.message}). Update failed with: ${updateError.message}. This file may be in an inconsistent state.` - ); - } - this.fileClient.deleteContent(this.id).catch(() => {}); - throw e; - }) - ) - ); - - return this; - } - - public downloadContent(): Promise<Readable> { - const { size } = this.data; - if (!this.isReady()) { - throw new NoDownloadAvailableError('This file content is not available for download.'); - } - // We pass through this file ID to retrieve blob content. - return this.fileClient.download({ id: this.id, size }); - } - - public async delete(): Promise<void> { - if (this.uploadInProgress()) { - throw new UploadInProgressError('Cannot delete file while upload in progress'); - } - if (this.isDeleted()) { - throw new AlreadyDeletedError('File has already been deleted'); - } - await this.updateFileState({ - action: 'delete', - }); - await this.fileClient.delete({ id: this.id, hasContent: this.isReady() }); - } - - public async share({ - name, - validUntil, - }: { - name: string; - validUntil?: number; - }): Promise<FileShareJSONWithToken> { - return this.fileClient.share({ name, validUntil, file: this }); - } - - async listShares(): Promise<FileShareJSON[]> { - const { shares } = await this.fileClient.listShares({ - fileId: this.id, - }); - return shares; - } - - async unshare(opts: { shareId: string }): Promise<void> { - await this.fileClient.unshare({ id: opts.shareId }); - } - - public toJSON(): FileJSON<M> { - return this.data; - } - - public get data(): FileJSON<M> { - return this.metadata; - } - private set data(v: FileJSON<M>) { - this.metadata = v; - } -} diff --git a/x-pack/plugins/files/server/file/index.ts b/x-pack/plugins/files/server/file/index.ts deleted file mode 100644 index 2b584945cb71f..0000000000000 --- a/x-pack/plugins/files/server/file/index.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 * as fileErrors from './errors'; - -export { File } from './file'; -export { toJSON } from './to_json'; -export { fileAttributesReducer } from './file_attributes_reducer'; -export type { Action } from './file_attributes_reducer'; -export { fileErrors }; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/index.ts b/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/index.ts deleted file mode 100644 index 9e7273b685f89..0000000000000 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { SavedObjectsFileMetadataClient } from './saved_objects'; -export { EsIndexFilesMetadataClient } from './es_index'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/index.ts b/x-pack/plugins/files/server/file_client/file_metadata_client/index.ts deleted file mode 100644 index 690a6b472b00f..0000000000000 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export type { - FileMetadataClient, - FileDescriptor, - DeleteArg as DeleteMetedataArg, - FindArg as FindMetadataArg, - GetArg as GetMetadataArg, - GetUsageMetricsArgs, - UpdateArgs as UpdateMetadataArg, -} from './file_metadata_client'; -export { SavedObjectsFileMetadataClient, EsIndexFilesMetadataClient } from './adapters'; diff --git a/x-pack/plugins/files/server/file_client/index.ts b/x-pack/plugins/files/server/file_client/index.ts deleted file mode 100644 index 46eec400b77bc..0000000000000 --- a/x-pack/plugins/files/server/file_client/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { EsIndexFilesMetadataClient, SavedObjectsFileMetadataClient } from './file_metadata_client'; -export type { - FileMetadataClient, - DeleteMetedataArg, - FileDescriptor, - FindMetadataArg, - GetMetadataArg, - GetUsageMetricsArgs, - UpdateMetadataArg, -} from './file_metadata_client'; -export { FileClientImpl } from './file_client'; -export type { FileClient } from './types'; -export { createEsFileClient } from './create_es_file_client'; -export type { CreateEsFileClientArgs } from './create_es_file_client'; -export { - AlreadyDeletedError, - ContentAlreadyUploadedError, - NoDownloadAvailableError, - UploadInProgressError, -} from '../file/errors'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/index.ts b/x-pack/plugins/files/server/file_client/stream_transforms/index.ts deleted file mode 100644 index b3a82e897a02c..0000000000000 --- a/x-pack/plugins/files/server/file_client/stream_transforms/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 { enforceMaxByteSizeTransform } from './max_byte_size_transform'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts b/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts deleted file mode 100644 index 3b2c236e8a287..0000000000000 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export class MaxByteSizeExceededError extends Error { - constructor(expectedSize: number) { - super(`Maximum of ${expectedSize} bytes exceeded`); - Error.captureStackTrace(this); - } -} diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts b/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts deleted file mode 100644 index b3a82e897a02c..0000000000000 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/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 { enforceMaxByteSizeTransform } from './max_byte_size_transform'; diff --git a/x-pack/plugins/files/server/file_client/types.ts b/x-pack/plugins/files/server/file_client/types.ts deleted file mode 100644 index 19a50f7249fa2..0000000000000 --- a/x-pack/plugins/files/server/file_client/types.ts +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { File, FileShareJSONWithToken, UpdatableFileMetadata } from '../../common/types'; -import { CreateFileArgs } from '../file_service'; -import { FileShareServiceStart } from '../file_share_service'; -import { FileMetadataClient } from './file_metadata_client'; - -export type P1<F extends (...args: any[]) => any> = Parameters<F>[0]; - -export interface DeleteArgs { - /** ID of the file to delete */ - id: string; - /** - * If `true`, the file will be deleted from the blob storage. - * - * @default true - */ - hasContent?: boolean; -} - -/** - * Args to create a file - */ -export interface CreateArgs { - /** - * Unique file ID - */ - id?: string; - /** - * The file's metadata - */ - metadata: Omit<CreateFileArgs, 'fileKind'>; -} - -/** - * File share args - */ -export interface ShareArgs { - /** - * Name of the file share - */ - name?: string; - /** - * Unix timestamp (in milliseconds) when the file share will expire - */ - validUntil?: number; - /** - * The file to share - */ - file: File; -} - -/** - * Wraps the {@link FileMetadataClient} and {@link BlobStorageClient} client - * to provide basic file CRUD functionality. - * - * For now this is just a shallow type of the implementation for export purposes. - */ -export interface FileClient { - /** See {@link FileMetadata.FileKind}. */ - fileKind: string; - - /** - * See {@link FileMetadataClient.create}. - * - * @param arg - Arg to create a file. - * */ - create<M = unknown>(arg: CreateArgs): Promise<File<M>>; - - /** - * See {@link FileMetadataClient.get} - * - * @param arg - Argument to get a file - */ - get<M = unknown>(arg: P1<FileMetadataClient['get']>): Promise<File<M>>; - - /** - * {@link FileMetadataClient.update} - * - * @param id - File id - * @param metadata - new file metadata - */ - update<M = unknown>(id: string, metadata: UpdatableFileMetadata<M>): Promise<void>; - - /** - * Delete a file. - * @param arg - Argument to delete a file - */ - delete(arg: DeleteArgs): Promise<void>; - - /** - * See {@link FileMetadataClient.find}. - * - * @param arg - Argument to find files - */ - find: (arg?: P1<FileMetadataClient['find']>) => Promise<{ files: File[]; total: number }>; - - /** - * Create a file share instance for this file. - * - * @note this will only work for files that are share capable. - * - * @param args - Arguments to create a file share - */ - share(args: ShareArgs): Promise<FileShareJSONWithToken>; - /** - * Create a file share instance for this file. - * - * @note this will only work for files that are share capable. - * - * @param args - Arguments to remove a file share - */ - unshare: FileShareServiceStart['delete']; - /** - * Create a file share instance for this file. - * - * @note this will only work for files that are share capable. - * - * @param arg - Arguments to remove a file share - */ - listShares: FileShareServiceStart['list']; -} diff --git a/x-pack/plugins/files/server/file_client/utils.ts b/x-pack/plugins/files/server/file_client/utils.ts deleted file mode 100644 index b8b51117e8ac1..0000000000000 --- a/x-pack/plugins/files/server/file_client/utils.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { FileMetadata } from '../../common'; - -export function createDefaultFileAttributes(): Pick< - FileMetadata, - 'created' | 'Updated' | 'Status' -> { - const dateString = new Date().toISOString(); - return { - created: dateString, - Status: 'AWAITING_UPLOAD', - Updated: dateString, - }; -} diff --git a/x-pack/plugins/files/server/file_service/errors.ts b/x-pack/plugins/files/server/file_service/errors.ts deleted file mode 100644 index 905f26cf8fe14..0000000000000 --- a/x-pack/plugins/files/server/file_service/errors.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export class FileNotFoundError extends Error { - constructor(message: string) { - super(message); - Error.captureStackTrace(this); - } -} diff --git a/x-pack/plugins/files/server/file_service/index.ts b/x-pack/plugins/files/server/file_service/index.ts deleted file mode 100644 index 457e5f3d4dfb8..0000000000000 --- a/x-pack/plugins/files/server/file_service/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { FileServiceFactoryImpl as FileServiceFactory } from './file_service_factory'; -export type { - CreateFileArgs, - DeleteFileArgs, - FindFileArgs, - GetByIdArgs, - UpdateFileArgs, -} from './file_action_types'; -export type { FileServiceStart } from './file_service'; -export * as errors from './errors'; diff --git a/x-pack/plugins/files/server/file_share_service/errors.ts b/x-pack/plugins/files/server/file_share_service/errors.ts deleted file mode 100644 index 89979f0689979..0000000000000 --- a/x-pack/plugins/files/server/file_share_service/errors.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/* eslint-disable max-classes-per-file */ - -abstract class FileShareError extends Error { - constructor(message: string) { - super(message); - Error.captureStackTrace(this); - } -} - -export class ExpiryDateInThePastError extends FileShareError {} -export class FileShareNotFoundError extends FileShareError {} -export class FileShareTokenInvalidError extends FileShareError {} diff --git a/x-pack/plugins/files/server/file_share_service/generate_share_token.test.ts b/x-pack/plugins/files/server/file_share_service/generate_share_token.test.ts deleted file mode 100644 index 93767c7484986..0000000000000 --- a/x-pack/plugins/files/server/file_share_service/generate_share_token.test.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 { generateShareToken } from './generate_share_token'; - -describe('generateShareToken', () => { - it('should contain only expected chars of a given length', () => { - for (let i = 0; i < 50; i++) { - expect(generateShareToken()).toMatch(/^[a-zA-O0-9]{40}$/); - } - }); -}); diff --git a/x-pack/plugins/files/server/file_share_service/index.ts b/x-pack/plugins/files/server/file_share_service/index.ts deleted file mode 100644 index dd52ec05777c1..0000000000000 --- a/x-pack/plugins/files/server/file_share_service/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { InternalFileShareService } from './internal_file_share_service'; -export type { - CreateShareArgs, - DeleteArgs as DeleteShareArgs, - DeleteForFileArgs as DeleteSharesForFileArgs, - GetArgs as GetShareArgs, - ListArgs as ListSharesArgs, - UpdateArgs as UpdateShareArgs, -} from './internal_file_share_service'; -export type { FileShareServiceStart } from './types'; diff --git a/x-pack/plugins/files/server/file_share_service/types.ts b/x-pack/plugins/files/server/file_share_service/types.ts deleted file mode 100644 index bf3147d933083..0000000000000 --- a/x-pack/plugins/files/server/file_share_service/types.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { FileShareJSON, FileShare } from '../../common/types'; -import type { GetArgs, UpdateArgs, DeleteArgs, ListArgs } from './internal_file_share_service'; - -/** - * We only expose functionality here that do not require you to have a {@link File} - * instance loaded. - */ -export interface FileShareServiceStart { - /** - * Get a share instance - * - * @param {GetArgs} arg - the arguments to get the share instance - */ - get(arg: GetArgs): Promise<FileShareJSON>; - - /** - * List share objects - * - * @param {ListArgs} arg - the arguments to list share objects - */ - list(arg: ListArgs): Promise<{ shares: FileShareJSON[] }>; - - /** - * Update a share instance. - * - * @param {UpdateArgs} args - the arguments to update a share instance - */ - update(args: UpdateArgs): Promise<FileShare & { id: string }>; - - /** - * Delete a share instance. - * - * @param {DeleteArgs} args - the arguments to delete a share instance - */ - delete(args: DeleteArgs): Promise<void>; -} diff --git a/x-pack/plugins/files/server/index.ts b/x-pack/plugins/files/server/index.ts deleted file mode 100755 index fe2bd3e69eec0..0000000000000 --- a/x-pack/plugins/files/server/index.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { PluginInitializerContext } from '@kbn/core/server'; -import { FilesPlugin } from './plugin'; - -export type { - FileClient, - FileDescriptor, - GetMetadataArg, - FindMetadataArg, - UpdateMetadataArg, - DeleteMetedataArg, - FileMetadataClient, - GetUsageMetricsArgs, - CreateEsFileClientArgs, -} from './file_client'; -export { createEsFileClient } from './file_client'; - -export type { FilesSetup, FilesStart } from './types'; -export type { - FileShareServiceStart, - CreateShareArgs, - DeleteShareArgs, - DeleteSharesForFileArgs, - GetShareArgs, - ListSharesArgs, - UpdateShareArgs, -} from './file_share_service'; -export type { - GetByIdArgs, - FindFileArgs, - CreateFileArgs, - DeleteFileArgs, - UpdateFileArgs, - FileServiceStart, -} from './file_service'; -export type { FileServiceFactory } from './file_service/file_service_factory'; - -export function plugin(initializerContext: PluginInitializerContext) { - return new FilesPlugin(initializerContext); -} diff --git a/x-pack/plugins/files/server/mocks.ts b/x-pack/plugins/files/server/mocks.ts deleted file mode 100644 index de9a495818ff2..0000000000000 --- a/x-pack/plugins/files/server/mocks.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 { KibanaRequest } from '@kbn/core/server'; -import { DeeplyMockedKeys } from '@kbn/utility-types-jest'; -import * as stream from 'stream'; -import { File } from '../common'; -import { FileClient, FileServiceFactory, FileServiceStart } from '.'; - -export const createFileServiceMock = (): DeeplyMockedKeys<FileServiceStart> => ({ - create: jest.fn(), - delete: jest.fn(), - deleteShareObject: jest.fn(), - find: jest.fn(), - getById: jest.fn(), - getByToken: jest.fn(), - getShareObject: jest.fn(), - getUsageMetrics: jest.fn(), - listShareObjects: jest.fn(), - update: jest.fn(), - updateShareObject: jest.fn(), -}); - -export const createFileServiceFactoryMock = (): DeeplyMockedKeys<FileServiceFactory> => ({ - asInternal: jest.fn(createFileServiceMock), - asScoped: jest.fn((_: KibanaRequest) => createFileServiceMock()), -}); - -export const createFileMock = (): DeeplyMockedKeys<File> => { - const fileMock: DeeplyMockedKeys<File> = { - id: '123', - data: { - id: '123', - created: '2022-10-10T14:57:30.682Z', - updated: '2022-10-19T14:43:20.112Z', - name: 'test.txt', - mimeType: 'text/plain', - size: 1234, - extension: '.txt', - meta: {}, - alt: undefined, - fileKind: 'none', - status: 'READY', - }, - update: jest.fn(), - uploadContent: jest.fn(), - downloadContent: jest.fn().mockResolvedValue(new stream.Readable()), - delete: jest.fn(), - share: jest.fn(), - listShares: jest.fn(), - unshare: jest.fn(), - toJSON: jest.fn(), - }; - - fileMock.update.mockResolvedValue(fileMock); - fileMock.uploadContent.mockResolvedValue(fileMock); - - return fileMock; -}; - -export const createFileClientMock = (): DeeplyMockedKeys<FileClient> => { - const fileMock = createFileMock(); - - return { - fileKind: 'none', - create: jest.fn().mockResolvedValue(fileMock), - get: jest.fn().mockResolvedValue(fileMock), - update: jest.fn(), - delete: jest.fn(), - find: jest.fn().mockResolvedValue({ files: [fileMock], total: 1 }), - share: jest.fn(), - unshare: jest.fn(), - listShares: jest.fn().mockResolvedValue({ shares: [] }), - }; -}; diff --git a/x-pack/plugins/files/server/plugin.ts b/x-pack/plugins/files/server/plugin.ts deleted file mode 100755 index 08357e28bd3d0..0000000000000 --- a/x-pack/plugins/files/server/plugin.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { - PluginInitializerContext, - CoreSetup, - Plugin, - Logger, - CoreStart, -} from '@kbn/core/server'; - -import { PLUGIN_ID } from '../common/constants'; -import { - setFileKindsRegistry, - getFileKindsRegistry, - FileKindsRegistryImpl, -} from '../common/file_kinds_registry'; - -import { BlobStorageService } from './blob_storage_service'; -import { FileServiceFactory } from './file_service'; -import type { FilesPluginSetupDependencies, FilesSetup, FilesStart } from './types'; - -import type { FilesRequestHandlerContext, FilesRouter } from './routes/types'; -import { registerRoutes, registerFileKindRoutes } from './routes'; -import { Counters, registerUsageCollector } from './usage'; - -export class FilesPlugin implements Plugin<FilesSetup, FilesStart, FilesPluginSetupDependencies> { - private readonly logger: Logger; - private fileServiceFactory: undefined | FileServiceFactory; - private securitySetup: FilesPluginSetupDependencies['security']; - - constructor(initializerContext: PluginInitializerContext) { - this.logger = initializerContext.logger.get(); - } - - public setup( - core: CoreSetup, - { security, usageCollection }: FilesPluginSetupDependencies - ): FilesSetup { - const usageCounter = usageCollection?.createUsageCounter(PLUGIN_ID); - FileServiceFactory.setup(core.savedObjects, usageCounter); - this.securitySetup = security; - - core.http.registerRouteHandlerContext<FilesRequestHandlerContext, typeof PLUGIN_ID>( - PLUGIN_ID, - async (ctx, req) => { - return { - fileService: { - asCurrentUser: () => this.fileServiceFactory!.asScoped(req), - asInternalUser: () => this.fileServiceFactory!.asInternal(), - logger: this.logger.get('files-routes'), - usageCounter: usageCounter - ? (counter: Counters) => usageCounter.incrementCounter({ counterName: counter }) - : undefined, - }, - }; - } - ); - - const router: FilesRouter = core.http.createRouter(); - registerRoutes(router); - setFileKindsRegistry( - new FileKindsRegistryImpl((fk) => { - registerFileKindRoutes(router, fk); - }) - ); - registerUsageCollector({ - usageCollection, - getFileService: () => this.fileServiceFactory?.asInternal(), - }); - - return { - registerFileKind(fileKind) { - getFileKindsRegistry().register(fileKind); - }, - }; - } - - public start(coreStart: CoreStart): FilesStart { - const { savedObjects } = coreStart; - const esClient = coreStart.elasticsearch.client.asInternalUser; - const blobStorageService = new BlobStorageService( - esClient, - this.logger.get('blob-storage-service') - ); - this.fileServiceFactory = new FileServiceFactory( - savedObjects, - blobStorageService, - this.securitySetup, - getFileKindsRegistry(), - this.logger.get('files-service') - ); - - return { - fileServiceFactory: this.fileServiceFactory, - }; - } - - public stop() {} -} diff --git a/x-pack/plugins/files/server/routes/api_routes.ts b/x-pack/plugins/files/server/routes/api_routes.ts deleted file mode 100644 index b40696bfe61e7..0000000000000 --- a/x-pack/plugins/files/server/routes/api_routes.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 { - FILES_API_BASE_PATH, - FILES_SHARE_API_BASE_PATH, - FILES_PUBLIC_API_BASE_PATH, - API_BASE_PATH, -} from '../../common/api_routes'; - -export * from '../../common/api_routes'; - -export const FILES_API_ROUTES = { - find: `${API_BASE_PATH}/find`, - metrics: `${API_BASE_PATH}/metrics`, - public: { - download: `${FILES_PUBLIC_API_BASE_PATH}/blob/{fileName?}`, - }, - fileKind: { - getCreateFileRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}`, - getUploadRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}/{id}/blob`, - getDownloadRoute: (fileKind: string) => - `${FILES_API_BASE_PATH}/${fileKind}/{id}/blob/{fileName?}`, - getUpdateRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}/{id}`, - getDeleteRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}/{id}`, - getListRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}/list`, - getByIdRoute: (fileKind: string) => `${FILES_API_BASE_PATH}/${fileKind}/{id}`, - getShareRoute: (fileKind: string) => `${FILES_SHARE_API_BASE_PATH}/${fileKind}/{fileId}`, - getUnshareRoute: (fileKind: string) => `${FILES_SHARE_API_BASE_PATH}/${fileKind}/{id}`, - getGetShareRoute: (fileKind: string) => `${FILES_SHARE_API_BASE_PATH}/${fileKind}/{id}`, - getListShareRoute: (fileKind: string) => `${FILES_SHARE_API_BASE_PATH}/${fileKind}`, - }, -}; diff --git a/x-pack/plugins/files/server/routes/common.ts b/x-pack/plugins/files/server/routes/common.ts deleted file mode 100644 index 8e17a39511b53..0000000000000 --- a/x-pack/plugins/files/server/routes/common.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import mime from 'mime'; -import type { ResponseHeaders } from '@kbn/core/server'; -import type { File } from '../../common/types'; - -interface Args { - file: File; - fileName?: string; -} - -export function getDownloadHeadersForFile({ file, fileName }: Args): ResponseHeaders { - return { - 'content-type': - (fileName && mime.getType(fileName)) ?? file.data.mimeType ?? 'application/octet-stream', - // Note, this name can be overridden by the client if set via a "download" attribute on the HTML tag. - 'content-disposition': `attachment; filename="${fileName || getDownloadedFileName(file)}"`, - 'cache-control': 'max-age=31536000, immutable', - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options - 'x-content-type-options': 'nosniff', - }; -} - -export function getDownloadedFileName(file: File): string { - // When creating a file we also calculate the extension so the `file.extension` - // check is not really necessary except for type checking. - if (file.data.mimeType && file.data.extension) { - return `${file.data.name}.${file.data.extension}`; - } - return file.data.name; -} diff --git a/x-pack/plugins/files/server/routes/file_kind/create.ts b/x-pack/plugins/files/server/routes/file_kind/create.ts deleted file mode 100644 index 78a7260771a16..0000000000000 --- a/x-pack/plugins/files/server/routes/file_kind/create.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 { schema } from '@kbn/config-schema'; -import type { FileJSON, FileKind } from '../../../common/types'; -import { CreateRouteDefinition, FILES_API_ROUTES } from '../api_routes'; -import type { FileKindRouter } from './types'; -import * as commonSchemas from '../common_schemas'; -import { CreateHandler } from './types'; - -export const method = 'post' as const; - -const rt = { - body: schema.object({ - name: commonSchemas.fileName, - alt: commonSchemas.fileAlt, - meta: commonSchemas.fileMeta, - mimeType: schema.maybe(schema.string()), - }), -}; - -export type Endpoint<M = unknown> = CreateRouteDefinition<typeof rt, { file: FileJSON<M> }>; - -export const handler: CreateHandler<Endpoint> = async ({ fileKind, files }, req, res) => { - const { fileService } = await files; - const { - body: { name, alt, meta, mimeType }, - } = req; - const file = await fileService - .asCurrentUser() - .create({ fileKind, name, alt, meta, mime: mimeType }); - const body: Endpoint['output'] = { - file: file.toJSON(), - }; - return res.ok({ body }); -}; - -export function register(fileKindRouter: FileKindRouter, fileKind: FileKind) { - if (fileKind.http.create) { - fileKindRouter[method]( - { - path: FILES_API_ROUTES.fileKind.getCreateFileRoute(fileKind.id), - validate: { - ...rt, - }, - options: { - tags: fileKind.http.create.tags, - }, - }, - handler - ); - } -} diff --git a/x-pack/plugins/files/server/routes/file_kind/download.ts b/x-pack/plugins/files/server/routes/file_kind/download.ts deleted file mode 100644 index d4ae37ddb6623..0000000000000 --- a/x-pack/plugins/files/server/routes/file_kind/download.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import { Readable } from 'stream'; - -import type { FileKind } from '../../../common/types'; -import { fileNameWithExt } from '../common_schemas'; -import { fileErrors } from '../../file'; -import { getDownloadHeadersForFile } from '../common'; -import { getById } from './helpers'; -import type { CreateHandler, FileKindRouter } from './types'; -import { CreateRouteDefinition, FILES_API_ROUTES } from '../api_routes'; - -export const method = 'get' as const; - -const rt = { - params: schema.object({ - id: schema.string(), - fileName: schema.maybe(fileNameWithExt), - }), -}; - -export type Endpoint = CreateRouteDefinition<typeof rt, any>; - -type Response = Readable; - -export const handler: CreateHandler<Endpoint> = async ({ files, fileKind }, req, res) => { - const { fileService } = await files; - const { - params: { id, fileName }, - } = req; - const { error, result: file } = await getById(fileService.asCurrentUser(), id, fileKind); - if (error) return error; - try { - const body: Response = await file.downloadContent(); - return res.ok({ - body, - headers: getDownloadHeadersForFile({ file, fileName }), - }); - } catch (e) { - if (e instanceof fileErrors.NoDownloadAvailableError) { - return res.notFound({ body: { message: e.message } }); - } - throw e; - } -}; - -export function register(fileKindRouter: FileKindRouter, fileKind: FileKind) { - if (fileKind.http.download) { - fileKindRouter[method]( - { - path: FILES_API_ROUTES.fileKind.getDownloadRoute(fileKind.id), - validate: { ...rt }, - options: { - tags: fileKind.http.download.tags, - }, - }, - handler - ); - } -} diff --git a/x-pack/plugins/files/server/routes/file_kind/index.ts b/x-pack/plugins/files/server/routes/file_kind/index.ts deleted file mode 100644 index 1bd61b8fb2f2e..0000000000000 --- a/x-pack/plugins/files/server/routes/file_kind/index.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 { FileKind } from '../../../common/types'; - -import { FilesRouter } from '../types'; - -import { enhanceRouter } from './enhance_router'; - -import * as create from './create'; -import * as upload from './upload'; -import * as update from './update'; -import * as deleteEndpoint from './delete'; -import * as list from './list'; -import * as download from './download'; -import * as getById from './get_by_id'; -import * as share from './share/share'; -import * as unshare from './share/unshare'; -import * as listShare from './share/list'; -import * as getShare from './share/get'; - -/** - * Register a single file kind's routes - */ -export function registerFileKindRoutes(router: FilesRouter, fileKind: FileKind) { - const fileKindRouter = enhanceRouter({ router, fileKind: fileKind.id }); - [ - create, - upload, - update, - deleteEndpoint, - list, - download, - getById, - share, - unshare, - getShare, - listShare, - ].forEach((route) => { - route.register(fileKindRouter, fileKind); - }); -} diff --git a/x-pack/plugins/files/server/routes/file_kind/list.ts b/x-pack/plugins/files/server/routes/file_kind/list.ts deleted file mode 100644 index b9b389f41b7a9..0000000000000 --- a/x-pack/plugins/files/server/routes/file_kind/list.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 type { FileJSON, FileKind } from '../../../common/types'; -import { CreateRouteDefinition, FILES_API_ROUTES } from '../api_routes'; -import type { CreateHandler, FileKindRouter } from './types'; -import { - stringOrArrayOfStrings, - nameStringOrArrayOfNameStrings, - toArrayOrUndefined, -} from '../find'; - -export const method = 'post' as const; - -const rt = { - body: schema.object({ - status: schema.maybe(stringOrArrayOfStrings), - extension: schema.maybe(stringOrArrayOfStrings), - name: schema.maybe(nameStringOrArrayOfNameStrings), - meta: schema.maybe(schema.object({}, { unknowns: 'allow' })), - }), - query: schema.object({ - page: schema.maybe(schema.number()), - perPage: schema.maybe(schema.number({ defaultValue: 100 })), - }), -}; - -export type Endpoint<M = unknown> = CreateRouteDefinition< - typeof rt, - { files: Array<FileJSON<M>>; total: number } ->; - -export const handler: CreateHandler<Endpoint> = async ({ files, fileKind }, req, res) => { - const { - body: { name, status, extension, meta }, - query: { page, perPage }, - } = req; - const { fileService } = await files; - const body: Endpoint['output'] = await fileService.asCurrentUser().find({ - kind: [fileKind], - name: toArrayOrUndefined(name), - status: toArrayOrUndefined(status), - extension: toArrayOrUndefined(extension), - page, - perPage, - meta, - }); - return res.ok({ body }); -}; - -export function register(fileKindRouter: FileKindRouter, fileKind: FileKind) { - if (fileKind.http.list) { - fileKindRouter[method]( - { - path: FILES_API_ROUTES.fileKind.getListRoute(fileKind.id), - validate: { ...rt }, - options: { - tags: fileKind.http.list.tags, - }, - }, - handler - ); - } -} diff --git a/x-pack/plugins/files/server/routes/file_kind/share/list.ts b/x-pack/plugins/files/server/routes/file_kind/share/list.ts deleted file mode 100644 index edd58dbed7b6e..0000000000000 --- a/x-pack/plugins/files/server/routes/file_kind/share/list.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { schema } from '@kbn/config-schema'; - -import { CreateRouteDefinition, FILES_API_ROUTES } from '../../api_routes'; -import type { FileKind, FileShareJSON } from '../../../../common/types'; -import { CreateHandler, FileKindRouter } from '../types'; - -export const method = 'get' as const; - -const rt = { - query: schema.object({ - page: schema.maybe(schema.number()), - perPage: schema.maybe(schema.number()), - forFileId: schema.maybe(schema.string()), - }), -}; - -export type Endpoint = CreateRouteDefinition<typeof rt, { shares: FileShareJSON[] }>; - -export const handler: CreateHandler<Endpoint> = async ({ files }, req, res) => { - const { fileService } = await files; - const { - query: { forFileId, page, perPage }, - } = req; - - const result = await fileService - .asCurrentUser() - .listShareObjects({ fileId: forFileId, page, perPage }); - - const body: Endpoint['output'] = result; - return res.ok({ - body, - }); -}; - -export function register(fileKindRouter: FileKindRouter, fileKind: FileKind) { - if (fileKind.http.share) { - fileKindRouter[method]( - { - path: FILES_API_ROUTES.fileKind.getListShareRoute(fileKind.id), - validate: { ...rt }, - options: { - tags: fileKind.http.share.tags, - }, - }, - handler - ); - } -} diff --git a/x-pack/plugins/files/server/routes/file_kind/types.ts b/x-pack/plugins/files/server/routes/file_kind/types.ts deleted file mode 100644 index 148767f27a285..0000000000000 --- a/x-pack/plugins/files/server/routes/file_kind/types.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 type { IRouter, RequestHandler } from '@kbn/core/server'; -import { AnyEndpoint } from '../api_routes'; -import type { FilesRequestHandlerContext } from '../types'; - -export type FileKindRouter = IRouter<FileKindsRequestHandlerContext>; - -export interface FileKindsRequestHandlerContext extends FilesRequestHandlerContext { - fileKind: string; -} - -export type FileKindsRequestHandler<P = unknown, Q = unknown, B = unknown> = RequestHandler< - P, - Q, - B, - FileKindsRequestHandlerContext ->; - -export type CreateHandler<E extends AnyEndpoint> = FileKindsRequestHandler< - E['inputs']['params'], - E['inputs']['query'], - E['inputs']['body'] ->; diff --git a/x-pack/plugins/files/server/routes/index.ts b/x-pack/plugins/files/server/routes/index.ts deleted file mode 100644 index 0a71599ac773e..0000000000000 --- a/x-pack/plugins/files/server/routes/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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FilesRouter } from './types'; - -import * as find from './find'; -import * as metrics from './metrics'; -import * as publicDownload from './public_facing/download'; - -export { registerFileKindRoutes } from './file_kind'; - -export function registerRoutes(router: FilesRouter) { - [find, metrics, publicDownload].forEach((endpoint) => { - endpoint.register(router); - }); -} diff --git a/x-pack/plugins/files/server/routes/metrics.ts b/x-pack/plugins/files/server/routes/metrics.ts deleted file mode 100644 index eb1d0ae39b9a1..0000000000000 --- a/x-pack/plugins/files/server/routes/metrics.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 type { FilesRouter } from './types'; - -import { FilesMetrics } from '../../common'; -import { CreateRouteDefinition, FILES_API_ROUTES } from './api_routes'; -import type { FilesRequestHandler } from './types'; - -const method = 'get' as const; - -export type Endpoint = CreateRouteDefinition<{}, FilesMetrics>; - -const handler: FilesRequestHandler = async ({ files }, req, res) => { - const { fileService } = await files; - const body: Endpoint['output'] = await fileService.asCurrentUser().getUsageMetrics(); - return res.ok({ - body, - }); -}; - -export function register(router: FilesRouter) { - router[method]( - { - path: FILES_API_ROUTES.metrics, - validate: {}, - }, - handler - ); -} diff --git a/x-pack/plugins/files/server/routes/public_facing/download.ts b/x-pack/plugins/files/server/routes/public_facing/download.ts deleted file mode 100644 index bd77cabaf7e4d..0000000000000 --- a/x-pack/plugins/files/server/routes/public_facing/download.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { schema } from '@kbn/config-schema'; -import { Readable } from 'stream'; -import { NoDownloadAvailableError } from '../../file/errors'; -import { FileNotFoundError } from '../../file_service/errors'; -import { - FileShareNotFoundError, - FileShareTokenInvalidError, -} from '../../file_share_service/errors'; -import type { FilesRouter } from '../types'; -import { CreateRouteDefinition, FILES_API_ROUTES } from '../api_routes'; -import { getDownloadHeadersForFile } from '../common'; -import { fileNameWithExt } from '../common_schemas'; -import { CreateHandler } from '../types'; - -const method = 'get' as const; - -const rt = { - query: schema.object({ - token: schema.string(), - }), - params: schema.object({ - fileName: schema.maybe(fileNameWithExt), - }), -}; - -export type Endpoint = CreateRouteDefinition<typeof rt, any>; - -const handler: CreateHandler<Endpoint> = async ({ files }, req, res) => { - const { fileService } = await files; - const { - query: { token }, - params: { fileName }, - } = req; - - try { - const file = await fileService.asInternalUser().getByToken(token); - const body: Readable = await file.downloadContent(); - return res.ok({ - body, - headers: getDownloadHeadersForFile({ file, fileName }), - }); - } catch (e) { - if ( - e instanceof FileNotFoundError || - e instanceof FileShareNotFoundError || - e instanceof FileShareTokenInvalidError - ) { - return res.badRequest({ body: { message: 'Invalid token' } }); - } - if (e instanceof NoDownloadAvailableError) { - return res.badRequest({ - body: { message: 'No download available. Try uploading content to the file first.' }, - }); - } - - throw e; - } -}; - -export function register(router: FilesRouter) { - router[method]( - { - path: FILES_API_ROUTES.public.download, - validate: { ...rt }, - options: { - authRequired: false, - }, - }, - handler - ); -} diff --git a/x-pack/plugins/files/server/routes/types.ts b/x-pack/plugins/files/server/routes/types.ts deleted file mode 100644 index f47808a85c3bf..0000000000000 --- a/x-pack/plugins/files/server/routes/types.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { - RequestHandlerContext, - IRouter, - RequestHandler, - RouteMethod, - KibanaResponseFactory, - IKibanaResponse, - Logger, -} from '@kbn/core/server'; -import type { FileServiceStart } from '../file_service'; -import { Counters } from '../usage'; -import { AnyEndpoint } from './api_routes'; - -export interface FilesRequestHandlerContext extends RequestHandlerContext { - files: Promise<{ - fileService: { - asCurrentUser: () => FileServiceStart; - asInternalUser: () => FileServiceStart; - logger: Logger; - usageCounter?: (counter: Counters) => void; - }; - }>; -} - -export type FilesRouter = IRouter<FilesRequestHandlerContext>; - -export type FilesRequestHandler< - P = unknown, - Q = unknown, - B = unknown, - Method extends RouteMethod = any -> = RequestHandler<P, Q, B, FilesRequestHandlerContext, Method, KibanaResponseFactory>; - -export type AsyncResponse<T> = Promise<IKibanaResponse<T>>; - -export type CreateHandler<E extends AnyEndpoint> = FilesRequestHandler< - E['inputs']['params'], - E['inputs']['query'], - E['inputs']['body'] ->; diff --git a/x-pack/plugins/files/server/saved_objects/file.ts b/x-pack/plugins/files/server/saved_objects/file.ts deleted file mode 100644 index 352a00016f86d..0000000000000 --- a/x-pack/plugins/files/server/saved_objects/file.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 { SavedObjectsType, SavedObjectsFieldMapping } from '@kbn/core/server'; -import { FILE_SO_TYPE } from '../../common'; -import type { FileMetadata } from '../../common'; - -type Properties = Record< - keyof Omit<FileMetadata, 'Alt' | 'Compression' | 'ChunkSize' | 'hash'>, - SavedObjectsFieldMapping ->; - -const properties: Properties = { - created: { - type: 'date', - }, - Updated: { - type: 'date', - }, - name: { - type: 'text', - }, - Status: { - type: 'keyword', - }, - mime_type: { - type: 'keyword', - }, - extension: { - type: 'keyword', - }, - size: { - type: 'long', - }, - Meta: { - type: 'flattened', - }, - FileKind: { - type: 'keyword', - }, -}; - -export const fileObjectType: SavedObjectsType<FileMetadata> = { - name: FILE_SO_TYPE, - hidden: true, - namespaceType: 'multiple-isolated', - management: { - importableAndExportable: false, - }, - mappings: { - dynamic: false, - properties, - }, -}; diff --git a/x-pack/plugins/files/server/saved_objects/index.ts b/x-pack/plugins/files/server/saved_objects/index.ts deleted file mode 100644 index 2871e4f52f272..0000000000000 --- a/x-pack/plugins/files/server/saved_objects/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { fileObjectType } from './file'; -import { fileShareObjectType } from './file_share'; - -export const hiddenTypes = [fileObjectType.name, fileShareObjectType.name]; -export { fileObjectType, fileShareObjectType }; diff --git a/x-pack/plugins/files/server/test_utils/index.ts b/x-pack/plugins/files/server/test_utils/index.ts deleted file mode 100644 index 98215f70649db..0000000000000 --- a/x-pack/plugins/files/server/test_utils/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { setupIntegrationEnvironment } from './setup_integration_environment'; -export type { TestEnvironmentUtils } from './setup_integration_environment'; diff --git a/x-pack/plugins/files/server/types.ts b/x-pack/plugins/files/server/types.ts deleted file mode 100644 index 85fc6a0f60ed6..0000000000000 --- a/x-pack/plugins/files/server/types.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 type { SecurityPluginSetup } from '@kbn/security-plugin/server'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -import { FileKind } from '../common'; -import { FileServiceFactory } from './file_service/file_service_factory'; - -/** - * Files plugin setup contract - */ -export interface FilesSetup { - /** - * Register a {@link FileKind} which allows for specifying details about the files - * that will be uploaded. - * - * @param {FileKind} fileKind - the file kind to register - * - * @track-adoption - */ - registerFileKind(fileKind: FileKind): void; -} - -export interface FilesPluginSetupDependencies { - security?: SecurityPluginSetup; - usageCollection?: UsageCollectionSetup; -} - -/** - * Files plugin start contract - */ -export interface FilesStart { - /** - * Create an instance of {@link FileServiceStart}. - * - * @track-adoption - */ - fileServiceFactory: FileServiceFactory; -} diff --git a/x-pack/plugins/files/server/usage/index.ts b/x-pack/plugins/files/server/usage/index.ts deleted file mode 100644 index af624244bcdd5..0000000000000 --- a/x-pack/plugins/files/server/usage/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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { registerUsageCollector } from './register_usage_collector'; -export type { Counters } from './counters'; -export { getCounters } from './counters'; diff --git a/x-pack/plugins/files/tsconfig.json b/x-pack/plugins/files/tsconfig.json deleted file mode 100644 index 5b8c42aab622a..0000000000000 --- a/x-pack/plugins/files/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": ["common/**/*", "public/**/*", "server/**/*", ".storybook/**/*"], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../security/tsconfig.json" }, - { "path": "../../../src/plugins/usage_collection/tsconfig.json" } - ] -} diff --git a/x-pack/plugins/fleet/.storybook/smoke.test.tsx b/x-pack/plugins/fleet/.storybook/smoke.test.tsx index 1fca60a1af4a4..a3984a42a5ab2 100644 --- a/x-pack/plugins/fleet/.storybook/smoke.test.tsx +++ b/x-pack/plugins/fleet/.storybook/smoke.test.tsx @@ -11,14 +11,16 @@ import { act } from 'react-dom/test-utils'; import initStoryshots from '@storybook/addon-storyshots'; describe('Fleet Storybook Smoke', () => { - initStoryshots({ - configPath: __dirname, - framework: 'react', - test: async ({ story }) => { - const renderer = mount(createElement(story.render)); - // wait until the element will perform all renders and resolve all promises (lazy loading, especially) - await act(() => new Promise((resolve) => setTimeout(resolve, 0))); - expect(renderer.html()).not.toContain('euiErrorBoundary'); - }, + test('Init', async () => { + await initStoryshots({ + configPath: __dirname, + framework: 'react', + test: async ({ story }) => { + const renderer = mount(createElement(story.render)); + // wait until the element will perform all renders and resolve all promises (lazy loading, especially) + await act(() => new Promise((resolve) => setTimeout(resolve, 0))); + expect(renderer.html()).not.toContain('euiErrorBoundary'); + }, + }); }); }); diff --git a/x-pack/plugins/fleet/common/constants/index.ts b/x-pack/plugins/fleet/common/constants/index.ts index 01193687125c6..3aeed30c7e41b 100644 --- a/x-pack/plugins/fleet/common/constants/index.ts +++ b/x-pack/plugins/fleet/common/constants/index.ts @@ -25,6 +25,8 @@ export * from './authz'; // setting in the future? export const SO_SEARCH_LIMIT = 10000; +export const ES_SEARCH_LIMIT = 10000; + export const FLEET_SERVER_INDICES_VERSION = 1; export const FLEET_SERVER_ARTIFACTS_INDEX = '.fleet-artifacts'; diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index b2ccff5e7188b..42db2ff330680 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -247,7 +247,35 @@ } }, "operationId": "get-package-categories" - } + }, + "parameters": [ + { + "in": "query", + "name": "prerelease", + "schema": { + "type": "boolean", + "default": false + }, + "description": "Whether to include prerelease packages in categories count (e.g. beta, rc, preview) " + }, + { + "in": "query", + "name": "experimental", + "deprecated": true, + "schema": { + "type": "boolean", + "default": false + } + }, + { + "in": "query", + "name": "include_policy_templates", + "schema": { + "type": "boolean", + "default": false + } + } + ] }, "/epm/packages/limited": { "get": { @@ -304,6 +332,31 @@ "default": false }, "description": "Whether to exclude the install status of each package. Enabling this option will opt in to caching for the response via `cache-control` headers. If you don't need up-to-date installation info for a package, and are querying for a list of available packages, providing this flag can improve performance substantially." + }, + { + "in": "query", + "name": "prerelease", + "schema": { + "type": "boolean", + "default": false + }, + "description": "Whether to return prerelease versions of packages (e.g. beta, rc, preview) " + }, + { + "in": "query", + "name": "experimental", + "deprecated": true, + "schema": { + "type": "boolean", + "default": false + } + }, + { + "in": "query", + "name": "category", + "schema": { + "type": "string" + } } ] }, @@ -4206,6 +4259,9 @@ "items": { "type": "string" } + }, + "prerelease_integrations_enabled": { + "type": "boolean" } }, "required": [ @@ -4401,6 +4457,8 @@ }, "release": { "type": "string", + "deprecated": true, + "description": "release label is deprecated, derive from the version instead (packages follow semver)", "enum": [ "experimental", "beta", @@ -5016,6 +5074,14 @@ "monitoring_output_id": { "type": "string", "nullable": true + }, + "fleet_server_host_id": { + "type": "string", + "nullable": true + }, + "download_source_id": { + "type": "string", + "nullable": true } }, "required": [ @@ -5165,10 +5231,20 @@ "type": "string" }, "data_output_id": { - "type": "string" + "type": "string", + "nullable": true }, "monitoring_output_id": { - "type": "string" + "type": "string", + "nullable": true + }, + "fleet_server_host_id": { + "type": "string", + "nullable": true + }, + "download_source_id": { + "type": "string", + "nullable": true }, "revision": { "type": "number" diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index 139711f13b899..08581dea73259 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -154,6 +154,26 @@ paths: schema: $ref: '#/components/schemas/get_categories_response' operationId: get-package-categories + parameters: + - in: query + name: prerelease + schema: + type: boolean + default: false + description: >- + Whether to include prerelease packages in categories count (e.g. beta, + rc, preview) + - in: query + name: experimental + deprecated: true + schema: + type: boolean + default: false + - in: query + name: include_policy_templates + schema: + type: boolean + default: false /epm/packages/limited: get: summary: Packages - Get limited list @@ -196,6 +216,24 @@ paths: headers. If you don't need up-to-date installation info for a package, and are querying for a list of available packages, providing this flag can improve performance substantially. + - in: query + name: prerelease + schema: + type: boolean + default: false + description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, + preview) + - in: query + name: experimental + deprecated: true + schema: + type: boolean + default: false + - in: query + name: category + schema: + type: string /epm/packages/_bulk: post: summary: Packages - Bulk install @@ -2617,6 +2655,8 @@ components: type: array items: type: string + prerelease_integrations_enabled: + type: boolean required: - fleet_server_hosts - id @@ -2751,6 +2791,10 @@ components: type: string release: type: string + deprecated: true + description: >- + release label is deprecated, derive from the version instead + (packages follow semver) enum: - experimental - beta @@ -3180,6 +3224,12 @@ components: monitoring_output_id: type: string nullable: true + fleet_server_host_id: + type: string + nullable: true + download_source_id: + type: string + nullable: true required: - name - namespace @@ -3282,8 +3332,16 @@ components: type: string data_output_id: type: string + nullable: true monitoring_output_id: type: string + nullable: true + fleet_server_host_id: + type: string + nullable: true + download_source_id: + type: string + nullable: true revision: type: number agents: diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/agent_policy.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/agent_policy.yaml index b3895ed2627f7..ab00144064760 100644 --- a/x-pack/plugins/fleet/common/openapi/components/schemas/agent_policy.yaml +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/agent_policy.yaml @@ -21,8 +21,16 @@ allOf: type: string data_output_id: type: string + nullable: true monitoring_output_id: type: string + nullable: true + fleet_server_host_id: + type: string + nullable: true + download_source_id: + type: string + nullable: true revision: type: number agents: diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/new_agent_policy.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/new_agent_policy.yaml index 7ad8988f1b0e4..3485d235b7b69 100644 --- a/x-pack/plugins/fleet/common/openapi/components/schemas/new_agent_policy.yaml +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/new_agent_policy.yaml @@ -22,6 +22,12 @@ properties: monitoring_output_id: type: string nullable: true + fleet_server_host_id: + type: string + nullable: true + download_source_id: + type: string + nullable: true required: - name - - namespace \ No newline at end of file + - namespace diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/package_info.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/package_info.yaml index 80c777a07718c..17f70e274ed52 100644 --- a/x-pack/plugins/fleet/common/openapi/components/schemas/package_info.yaml +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/package_info.yaml @@ -9,6 +9,8 @@ properties: type: string release: type: string + deprecated: true + description: release label is deprecated, derive from the version instead (packages follow semver) enum: - experimental - beta diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/settings.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/settings.yaml index 280460771989e..145b598267a0a 100644 --- a/x-pack/plugins/fleet/common/openapi/components/schemas/settings.yaml +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/settings.yaml @@ -9,6 +9,8 @@ properties: type: array items: type: string + prerelease_integrations_enabled: + type: boolean required: - fleet_server_hosts - id diff --git a/x-pack/plugins/fleet/common/openapi/paths/epm@categories.yaml b/x-pack/plugins/fleet/common/openapi/paths/epm@categories.yaml index 1f2c3930d6ba3..9a69a930fa988 100644 --- a/x-pack/plugins/fleet/common/openapi/paths/epm@categories.yaml +++ b/x-pack/plugins/fleet/common/openapi/paths/epm@categories.yaml @@ -9,3 +9,22 @@ get: schema: $ref: ../components/schemas/get_categories_response.yaml operationId: get-package-categories +parameters: + - in: query + name: prerelease + schema: + type: boolean + default: false + description: >- + Whether to include prerelease packages in categories count (e.g. beta, rc, preview) + - in: query + name: experimental + deprecated: true + schema: + type: boolean + default: false + - in: query + name: include_policy_templates + schema: + type: boolean + default: false \ No newline at end of file diff --git a/x-pack/plugins/fleet/common/openapi/paths/epm@packages.yaml b/x-pack/plugins/fleet/common/openapi/paths/epm@packages.yaml index 9c29b9d18357c..a6332360283bd 100644 --- a/x-pack/plugins/fleet/common/openapi/paths/epm@packages.yaml +++ b/x-pack/plugins/fleet/common/openapi/paths/epm@packages.yaml @@ -20,3 +20,20 @@ parameters: caching for the response via `cache-control` headers. If you don't need up-to-date installation info for a package, and are querying for a list of available packages, providing this flag can improve performance substantially. + - in: query + name: prerelease + schema: + type: boolean + default: false + description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, preview) + - in: query + name: experimental + deprecated: true + schema: + type: boolean + default: false + - in: query + name: category + schema: + type: string diff --git a/x-pack/plugins/fleet/common/services/routes.ts b/x-pack/plugins/fleet/common/services/routes.ts index c2f76758c3d7b..4c8f053b56cf9 100644 --- a/x-pack/plugins/fleet/common/services/routes.ts +++ b/x-pack/plugins/fleet/common/services/routes.ts @@ -21,6 +21,7 @@ import { K8S_API_ROUTES, PRECONFIGURATION_API_ROUTES, DOWNLOAD_SOURCE_API_ROUTES, + FLEET_SERVER_HOST_API_ROUTES, } from '../constants'; export const epmRouteService = { @@ -218,6 +219,17 @@ export const outputRoutesService = { getCreateLogstashApiKeyPath: () => OUTPUT_API_ROUTES.LOGSTASH_API_KEY_PATTERN, }; +export const fleetServerHostsRoutesService = { + getInfoPath: (itemId: string) => + FLEET_SERVER_HOST_API_ROUTES.INFO_PATTERN.replace('{itemId}', itemId), + getUpdatePath: (itemId: string) => + FLEET_SERVER_HOST_API_ROUTES.UPDATE_PATTERN.replace('{itemId}', itemId), + getListPath: () => FLEET_SERVER_HOST_API_ROUTES.LIST_PATTERN, + getDeletePath: (itemId: string) => + FLEET_SERVER_HOST_API_ROUTES.DELETE_PATTERN.replace('{itemId}', itemId), + getCreatePath: () => FLEET_SERVER_HOST_API_ROUTES.CREATE_PATTERN, +}; + export const settingsRoutesService = { getInfoPath: () => SETTINGS_API_ROUTES.INFO_PATTERN, getUpdatePath: () => SETTINGS_API_ROUTES.UPDATE_PATTERN, diff --git a/x-pack/plugins/fleet/common/types/models/agent_policy.ts b/x-pack/plugins/fleet/common/types/models/agent_policy.ts index ea22f73a2e5f9..8389cb07da15c 100644 --- a/x-pack/plugins/fleet/common/types/models/agent_policy.ts +++ b/x-pack/plugins/fleet/common/types/models/agent_policy.ts @@ -29,6 +29,7 @@ export interface NewAgentPolicy { data_output_id?: string | null; monitoring_output_id?: string | null; download_source_id?: string | null; + fleet_server_host_id?: string | null; schema_version?: string; } diff --git a/x-pack/plugins/fleet/common/types/models/epm.ts b/x-pack/plugins/fleet/common/types/models/epm.ts index b25266db5407c..4ef4a7fdd751b 100644 --- a/x-pack/plugins/fleet/common/types/models/epm.ts +++ b/x-pack/plugins/fleet/common/types/models/epm.ts @@ -351,6 +351,7 @@ export interface RegistryElasticsearch { 'index_template.settings'?: estypes.IndicesIndexSettings; 'index_template.mappings'?: estypes.MappingTypeMapping; 'ingest_pipeline.name'?: string; + source_mode?: 'default' | 'synthetic'; } export interface RegistryDataStreamPrivileges { @@ -418,9 +419,11 @@ export type PackageListItem = Installable<RegistrySearchResult> & { id: string; }; +export type IntegrationCardReleaseLabel = 'beta' | 'preview' | 'ga' | 'rc'; + export interface IntegrationCardItem { url: string; - release?: 'beta' | 'experimental' | 'ga'; + release?: IntegrationCardReleaseLabel; description: string; name: string; title: string; diff --git a/x-pack/plugins/fleet/common/types/models/settings.ts b/x-pack/plugins/fleet/common/types/models/settings.ts index 17bbe7a73c1da..c70fa944e6c24 100644 --- a/x-pack/plugins/fleet/common/types/models/settings.ts +++ b/x-pack/plugins/fleet/common/types/models/settings.ts @@ -9,7 +9,8 @@ import type { SavedObjectAttributes } from '@kbn/core/public'; export interface BaseSettings { has_seen_add_data_notice?: boolean; - fleet_server_hosts: string[]; + fleet_server_hosts?: string[]; + prerelease_integrations_enabled: boolean; } export interface Settings extends BaseSettings { diff --git a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts index e12bdbb202321..105558e0d0620 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts @@ -17,7 +17,9 @@ import type { export interface GetCategoriesRequest { query: { + // deprecated in 8.6 experimental?: boolean; + prerelease?: boolean; include_policy_templates?: boolean; }; } @@ -31,7 +33,9 @@ export interface GetCategoriesResponse { export interface GetPackagesRequest { query: { category?: string; + // deprecated in 8.6 experimental?: boolean; + prerelease?: boolean; excludeInstallStatus?: boolean; }; } diff --git a/x-pack/plugins/fleet/common/types/rest_spec/fleet_server_hosts.ts b/x-pack/plugins/fleet/common/types/rest_spec/fleet_server_hosts.ts index bf8be3cb38407..ebd2b42b6c689 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/fleet_server_hosts.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/fleet_server_hosts.ts @@ -10,3 +10,27 @@ import type { FleetServerHost } from '../models'; import type { ListResult } from './common'; export type GetFleetServerHostsResponse = ListResult<FleetServerHost>; + +export interface PutFleetServerHostsRequest { + params: { + itemId: string; + }; + body: { + name?: string; + host_urls?: string[]; + is_default?: boolean; + }; +} + +export interface PostFleetServerHostsRequest { + body: { + id?: string; + name?: string; + host_urls?: string[]; + is_default?: boolean; + }; +} + +export interface PostFleetServerHostsResponse { + item: FleetServerHost; +} diff --git a/x-pack/plugins/fleet/cypress/e2e/a11y/home_page.cy.ts b/x-pack/plugins/fleet/cypress/e2e/a11y/home_page.cy.ts index b76942ec9a456..a0d65683ecf3e 100644 --- a/x-pack/plugins/fleet/cypress/e2e/a11y/home_page.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/a11y/home_page.cy.ts @@ -24,17 +24,24 @@ import { DATA_STREAMS_TAB, SETTINGS_TAB, SETTINGS_FLEET_SERVER_HOST_HEADING, - FLEET_SERVER_HOST_INPUT, + FLEET_SERVER_SETUP, + LANDING_PAGE_ADD_FLEET_SERVER_BUTTON, } from '../../screens/fleet'; import { AGENT_POLICY_NAME_LINK } from '../../screens/integrations'; import { cleanupAgentPolicies, unenrollAgent } from '../../tasks/cleanup'; +import { setFleetServerHost } from '../../tasks/fleet_server'; describe('Home page', () => { before(() => { + setFleetServerHost('https://fleetserver:8220'); navigateTo(FLEET); - cy.getBySel(AGENT_FLYOUT.QUICK_START_TAB_BUTTON, { timeout: 15000 }).should('be.visible'); + cy.getBySel(LANDING_PAGE_ADD_FLEET_SERVER_BUTTON).click(); }); describe('Agents', () => { + before(() => { + cy.getBySel(AGENT_FLYOUT.QUICK_START_TAB_BUTTON, { timeout: 15000 }).should('be.visible'); + setFleetServerHost('https://fleetserver:8220'); + }); const fleetServerHost = 'https://localhost:8220'; describe('Quick Start', () => { @@ -42,10 +49,14 @@ describe('Home page', () => { checkA11y({ skipFailures: false }); }); it('Install Fleet Server', () => { - cy.getBySel(FLEET_SERVER_HOST_INPUT, { timeout: 15000 }).should('be.visible'); - cy.getBySel(FLEET_SERVER_HOST_INPUT).getBySel('comboBoxSearchInput').type(fleetServerHost); + cy.getBySel(FLEET_SERVER_SETUP.ADD_HOST_BTN).click(); + cy.getBySel(FLEET_SERVER_SETUP.NAME_INPUT).type('Host edited'); + cy.get('[placeholder="Specify host URL"', { timeout: 15000 }).should('be.visible'); + cy.get('[placeholder="Specify host URL"').type(fleetServerHost); cy.getBySel(GENERATE_FLEET_SERVER_POLICY_BUTTON).click(); - cy.getBySel(PLATFORM_TYPE_LINUX_BUTTON, { timeout: 15000 }).should('be.visible'); + cy.getBySel(PLATFORM_TYPE_LINUX_BUTTON, { timeout: 15000 }) + .scrollIntoView() + .should('be.visible'); checkA11y({ skipFailures: false }); }); }); @@ -58,13 +69,17 @@ describe('Home page', () => { checkA11y({ skipFailures: false }); }); it('Add your fleet sever host', () => { + cy.getBySel(FLEET_SERVER_SETUP.ADD_HOST_BTN).click(); + cy.getBySel(FLEET_SERVER_SETUP.NAME_INPUT).type('New host'); + cy.get('[placeholder="Specify host URL"').type('https://localhost:8220'); cy.getBySel(ADVANCED_FLEET_SERVER_ADD_HOST_BUTTON).click(); checkA11y({ skipFailures: false }); }); it('Generate service token', () => { - cy.getBySel(ADVANCED_FLEET_SERVER_ADD_HOST_BUTTON, { timeout: 15000 }).should('be.visible'); cy.getBySel(ADVANCED_FLEET_SERVER_GENERATE_SERVICE_TOKEN_BUTTON).click(); - cy.getBySel(PLATFORM_TYPE_LINUX_BUTTON, { timeout: 15000 }).should('be.visible'); + cy.getBySel(PLATFORM_TYPE_LINUX_BUTTON, { timeout: 15000 }) + .scrollIntoView() + .should('be.visible'); checkA11y({ skipFailures: false }); }); }); @@ -72,6 +87,7 @@ describe('Home page', () => { describe('Agent Policies', () => { before(() => { + navigateTo(FLEET); cy.getBySel(AGENT_POLICIES_TAB).click(); cy.getBySel(AGENT_POLICIES_CREATE_AGENT_POLICY_FLYOUT.CREATE_BUTTON, { timeout: 15000, @@ -101,6 +117,7 @@ describe('Home page', () => { describe('Enrollment Tokens', () => { before(() => { + navigateTo(FLEET); cy.getBySel(ENROLLMENT_TOKENS_TAB).click(); }); it('Enrollment Tokens Table', () => { diff --git a/x-pack/plugins/fleet/cypress/e2e/fleet_settings.cy.ts b/x-pack/plugins/fleet/cypress/e2e/fleet_settings.cy.ts index a1c4eef06bdb5..6bdef072fc5f4 100644 --- a/x-pack/plugins/fleet/cypress/e2e/fleet_settings.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/fleet_settings.cy.ts @@ -6,12 +6,29 @@ */ import { TOAST_CLOSE_BTN, CONFIRM_MODAL } from '../screens/navigation'; -import { SETTINGS_SAVE_BTN, SETTINGS_OUTPUTS } from '../screens/fleet'; +import { + SETTINGS_SAVE_BTN, + SETTINGS_OUTPUTS, + SETTINGS_FLEET_SERVER_HOSTS, + FLEET_SERVER_HOST_FLYOUT, + FLEET_SERVER_SETUP, + GENERATE_FLEET_SERVER_POLICY_BUTTON, +} from '../screens/fleet'; describe('Edit settings', () => { beforeEach(() => { - cy.intercept('/api/fleet/settings', { - item: { id: 'fleet-default-settings', fleet_server_hosts: [] }, + cy.intercept('/api/fleet/fleet_server_hosts', { + items: [ + { + id: 'fleet-default-settings', + name: 'Host', + host_urls: ['https://localhost:8220'], + is_default: true, + }, + ], + page: 1, + perPage: 10000, + total: 0, }); cy.intercept('/api/fleet/outputs', { items: [ @@ -29,22 +46,45 @@ describe('Edit settings', () => { cy.getBySel(TOAST_CLOSE_BTN).click(); }); - it('should update Fleet server hosts', () => { - cy.getBySel(SETTINGS_OUTPUTS.EDIT_HOSTS_BTN).click(); - cy.get('[placeholder="Specify host URL"').type('https://localhost:8220'); + it('should allow to update Fleet server hosts', () => { + cy.getBySel(SETTINGS_FLEET_SERVER_HOSTS.EDIT_BUTTON).click(); - cy.intercept('/api/fleet/settings', { - item: { id: 'fleet-default-settings', fleet_server_hosts: ['https://localhost:8220'] }, - }); - cy.intercept('PUT', '/api/fleet/settings', { - fleet_server_hosts: ['https://localhost:8220'], - }).as('updateSettings'); + cy.getBySel(FLEET_SERVER_HOST_FLYOUT.NAME_INPUT).clear().type('Edited Host'); + + cy.get('[placeholder="Specify host URL"').clear().type('https://localhost:8221'); + + cy.intercept('PUT', '/api/fleet/fleet_server_hosts/fleet-default-settings', { + name: 'Edited Host', + host_urls: ['https://localhost:8221'], + is_default: false, + }).as('updateFleetServerHosts'); cy.getBySel(SETTINGS_SAVE_BTN).click(); cy.getBySel(CONFIRM_MODAL.CONFIRM_BUTTON).click(); - cy.wait('@updateSettings').then((interception) => { - expect(interception.request.body.fleet_server_hosts[0]).to.equal('https://localhost:8220'); + cy.wait('@updateFleetServerHosts').then((interception) => { + expect(interception.request.body.host_urls[0]).to.equal('https://localhost:8221'); + }); + }); + + it('should allow to create new Fleet server hosts', () => { + cy.getBySel(SETTINGS_FLEET_SERVER_HOSTS.ADD_BUTTON).click(); + cy.getBySel(FLEET_SERVER_SETUP.ADD_HOST_BTN).click(); + + cy.getBySel(FLEET_SERVER_SETUP.NAME_INPUT).type('New Host'); + cy.getBySel(FLEET_SERVER_SETUP.DEFAULT_SWITCH).click(); + cy.get('[placeholder="Specify host URL"').type('https://localhost:8221'); + + cy.intercept('POST', '/api/fleet/fleet_server_hosts', { + name: 'New Host', + host_urls: ['https://localhost:8221'], + is_default: true, + }).as('updateFleetServerHosts'); + + cy.getBySel(GENERATE_FLEET_SERVER_POLICY_BUTTON).click(); + + cy.wait('@updateFleetServerHosts').then((interception) => { + expect(interception.request.body.host_urls[0]).to.equal('https://localhost:8221'); }); }); diff --git a/x-pack/plugins/fleet/cypress/e2e/fleet_startup.cy.ts b/x-pack/plugins/fleet/cypress/e2e/fleet_startup.cy.ts index befa2074ac865..d3f71e16b4d3b 100644 --- a/x-pack/plugins/fleet/cypress/e2e/fleet_startup.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/fleet_startup.cy.ts @@ -11,12 +11,14 @@ import { AGENT_FLYOUT, CREATE_FLEET_SERVER_POLICY_BTN, AGENT_POLICY_CREATE_STATUS_CALLOUT, - FLEET_SERVER_HOST_INPUT, ADVANCED_FLEET_SERVER_ADD_HOST_BUTTON, ADVANCED_FLEET_SERVER_GENERATE_SERVICE_TOKEN_BUTTON, + FLEET_SERVER_SETUP, + LANDING_PAGE_ADD_FLEET_SERVER_BUTTON, } from '../screens/fleet'; import { cleanupAgentPolicies, unenrollAgent } from '../tasks/cleanup'; import { verifyPolicy, verifyAgentPackage, navigateToTab } from '../tasks/fleet'; +import { deleteFleetServer } from '../tasks/fleet_server'; import { FLEET, navigateTo } from '../tasks/navigation'; describe('Fleet startup', () => { @@ -36,6 +38,12 @@ describe('Fleet startup', () => { }); describe('Create policies', () => { + before(() => { + unenrollAgent(); + cleanupAgentPolicies(); + deleteFleetServer(); + }); + after(() => { cleanupAgentPolicies(); }); @@ -80,27 +88,32 @@ describe('Fleet startup', () => { }); it('should create Fleet Server policy', () => { + cy.getBySel(LANDING_PAGE_ADD_FLEET_SERVER_BUTTON).click(); + cy.getBySel(AGENT_FLYOUT.ADVANCED_TAB_BUTTON).click(); - cy.getBySel(CREATE_FLEET_SERVER_POLICY_BTN).click(); + cy.getBySel(CREATE_FLEET_SERVER_POLICY_BTN, { timeout: 180000 }).click(); // Wait until the success callout is shown before navigating away cy.getBySel(AGENT_POLICY_CREATE_STATUS_CALLOUT) .should('exist') .and('have.class', 'euiCallOut--success'); + cy.getBySel(AGENT_FLYOUT.CLOSE_BUTTON).click(); // verify policy is created and has fleet server and system package verifyPolicy('Fleet Server policy 1', ['Fleet Server', 'System']); + // Reopen Flyout navigateToTab(AGENTS_TAB); + cy.getBySel(LANDING_PAGE_ADD_FLEET_SERVER_BUTTON).click(); cy.getBySel(AGENT_FLYOUT.ADVANCED_TAB_BUTTON).click(); // verify create button changed to dropdown cy.getBySel(AGENT_FLYOUT.POLICY_DROPDOWN); // verify fleet server enroll command contains created policy id - cy.getBySel(FLEET_SERVER_HOST_INPUT) - .getBySel('comboBoxSearchInput') - .type('https://localhost:8220'); + cy.getBySel(FLEET_SERVER_SETUP.ADD_HOST_BTN).click(); + cy.getBySel(FLEET_SERVER_SETUP.NAME_INPUT).type('New host'); + cy.get('[placeholder="Specify host URL"').type('https://localhost:8220'); cy.getBySel(ADVANCED_FLEET_SERVER_ADD_HOST_BUTTON).click(); cy.getBySel(ADVANCED_FLEET_SERVER_GENERATE_SERVICE_TOKEN_BUTTON).click(); diff --git a/x-pack/plugins/fleet/cypress/e2e/install_assets.cy.ts b/x-pack/plugins/fleet/cypress/e2e/install_assets.cy.ts index 81ef56a4b1f52..4234df15d861e 100644 --- a/x-pack/plugins/fleet/cypress/e2e/install_assets.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/install_assets.cy.ts @@ -35,7 +35,7 @@ describe('Install unverified package assets', () => { }).as('installAssets'); // save mocking out the whole package response, but make it so that fleet server is always uninstalled - cy.intercept('GET', '/api/fleet/epm/packages/fleet_server', (req) => { + cy.intercept('GET', '/api/fleet/epm/packages/fleet_server*', (req) => { req.continue((res) => { if (res.body?.item?.savedObject) { delete res.body.item.savedObject; diff --git a/x-pack/plugins/fleet/cypress/e2e/integrations_mock.cy.ts b/x-pack/plugins/fleet/cypress/e2e/integrations_mock.cy.ts index ce207cd3598e2..3095f628599d6 100644 --- a/x-pack/plugins/fleet/cypress/e2e/integrations_mock.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/integrations_mock.cy.ts @@ -16,7 +16,7 @@ describe('Add Integration - Mock API', () => { const oldVersion = '0.3.3'; const newVersion = '1.3.4'; beforeEach(() => { - cy.intercept('/api/fleet/epm/packages?experimental=true', { + cy.intercept('/api/fleet/epm/packages?prerelease=true', { items: [ { name: 'apache', @@ -28,7 +28,7 @@ describe('Add Integration - Mock API', () => { ], }); - cy.intercept(`/api/fleet/epm/packages/apache/${oldVersion}`, { + cy.intercept(`/api/fleet/epm/packages/apache/${oldVersion}*`, { item: { name: 'apache', version: oldVersion, @@ -99,7 +99,7 @@ describe('Add Integration - Mock API', () => { cy.getBySel(INTEGRATION_POLICIES_UPGRADE_CHECKBOX).uncheck({ force: true }); - cy.intercept(`/api/fleet/epm/packages/apache/${newVersion}`, { + cy.intercept(`/api/fleet/epm/packages/apache/${newVersion}*`, { item: { name: 'apache', version: newVersion, diff --git a/x-pack/plugins/fleet/cypress/e2e/integrations_real.cy.ts b/x-pack/plugins/fleet/cypress/e2e/integrations_real.cy.ts index c3bee2d758df0..3b7c29561bc93 100644 --- a/x-pack/plugins/fleet/cypress/e2e/integrations_real.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/integrations_real.cy.ts @@ -174,7 +174,7 @@ describe('Add Integration - Real API', () => { setupIntegrations(); cy.getBySel(getIntegrationCategories('aws')).click(); cy.getBySel(INTEGRATIONS_SEARCHBAR.BADGE).contains('AWS').should('exist'); - cy.getBySel(INTEGRATION_LIST).find('.euiCard').should('have.length', 30); + cy.getBySel(INTEGRATION_LIST).find('.euiCard').should('have.length', 28); cy.getBySel(INTEGRATIONS_SEARCHBAR.INPUT).clear().type('Cloud'); cy.getBySel(INTEGRATION_LIST).find('.euiCard').should('have.length', 3); diff --git a/x-pack/plugins/fleet/cypress/screens/fleet.ts b/x-pack/plugins/fleet/cypress/screens/fleet.ts index a9df1dc4d8ef1..2b1ad9e8324b4 100644 --- a/x-pack/plugins/fleet/cypress/screens/fleet.ts +++ b/x-pack/plugins/fleet/cypress/screens/fleet.ts @@ -7,6 +7,7 @@ export const ADD_AGENT_BUTTON = 'addAgentButton'; export const ADD_AGENT_BUTTON_TOP = 'addAgentBtnTop'; +export const LANDING_PAGE_ADD_FLEET_SERVER_BUTTON = 'fleetServerLanding.addFleetServerButton'; export const AGENTS_TAB = 'fleet-agents-tab'; export const AGENT_POLICIES_TAB = 'fleet-agent-policies-tab'; @@ -48,7 +49,7 @@ export const SETTINGS_SAVE_BTN = 'saveApplySettingsBtn'; export const AGENT_POLICY_SYSTEM_MONITORING_CHECKBOX = 'agentPolicyFormSystemMonitoringCheckbox'; export const INSTALL_INTEGRATIONS_ADVANCE_OPTIONS_BTN = 'AgentPolicyAdvancedOptions.AccordionBtn'; export const AGENT_POLICY_CREATE_STATUS_CALLOUT = 'agentPolicyCreateStatusCallOut'; -export const FLEET_SERVER_HOST_INPUT = 'fleetServerHostInput'; + export const EXISTING_HOSTS_TAB = 'existingHostsTab'; export const NEW_HOSTS_TAB = 'newHostsTab'; @@ -96,11 +97,15 @@ export const AGENT_BINARY_SOURCES_FLYOUT = { export const SETTINGS_OUTPUTS = { EDIT_BTN: 'editOutputBtn', ADD_BTN: 'addOutputBtn', - EDIT_HOSTS_BTN: 'editHostsBtn', NAME_INPUT: 'settingsOutputsFlyout.nameInput', TYPE_INPUT: 'settingsOutputsFlyout.typeInput', }; +export const SETTINGS_FLEET_SERVER_HOSTS = { + ADD_BUTTON: 'settings.fleetServerHosts.addFleetServerHostBtn', + EDIT_BUTTON: 'fleetServerHostsTable.edit.btn', +}; + export const AGENT_POLICY_FORM = { DOWNLOAD_SOURCE_SELECT: 'agentPolicyForm.downloadSource.select', }; @@ -114,3 +119,15 @@ export const FLEET_AGENT_LIST_PAGE = { CHECKBOX_SELECT_ALL: 'checkboxSelectAll', BULK_ACTIONS_BUTTON: 'agentBulkActionsButton', }; + +export const FLEET_SERVER_HOST_FLYOUT = { + NAME_INPUT: 'fleetServerHostsFlyout.nameInput', + DEFAULT_SWITCH: 'fleetServerHostsFlyout.isDefaultSwitch', +}; + +export const FLEET_SERVER_SETUP = { + NAME_INPUT: 'fleetServerSetup.nameInput', + HOST_INPUT: 'fleetServerSetup.multiRowInput', + DEFAULT_SWITCH: 'fleetServerHostsFlyout.isDefaultSwitch', + ADD_HOST_BTN: 'fleetServerSetup.addNewHostBtn', +}; diff --git a/x-pack/plugins/fleet/cypress/tasks/fleet_server.ts b/x-pack/plugins/fleet/cypress/tasks/fleet_server.ts index 946ded57e738f..8ec8e75c1d13f 100644 --- a/x-pack/plugins/fleet/cypress/tasks/fleet_server.ts +++ b/x-pack/plugins/fleet/cypress/tasks/fleet_server.ts @@ -49,13 +49,23 @@ export function setupFleetServer() { }); } +export function deleteFleetServer() { + cy.task('deleteDocsByQuery', { + index: '.fleet-servers', + query: { match_all: {} }, + ignoreUnavailable: true, + }); +} + export function setFleetServerHost(host = 'https://fleetserver:8220') { cy.request({ - method: 'PUT', - url: '/api/fleet/settings', + method: 'POST', + url: '/api/fleet/fleet_server_hosts', headers: { 'kbn-xsrf': 'xx' }, body: { - fleet_server_hosts: [host], + name: 'Default host', + host_urls: [host], + is_default: true, }, }); } diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/advanced_tab.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/advanced_tab.tsx index e13d9b5394dc9..a471e57e70bba 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/advanced_tab.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/advanced_tab.tsx @@ -58,12 +58,12 @@ export const AdvancedTab: React.FunctionComponent<AdvancedTabProps> = ({ selecte serviceToken, generateServiceToken, isLoadingServiceToken, - disabled: !Boolean(fleetServerHostForm.isFleetServerHostSubmitted), + disabled: Boolean(!fleetServerHostForm.fleetServerHost), }), getInstallFleetServerStep({ isFleetServerReady, serviceToken, - fleetServerHost: fleetServerHostForm.fleetServerHost, + fleetServerHost: fleetServerHostForm.fleetServerHost?.host_urls[0], fleetServerPolicyId: fleetServerPolicyId || selectedPolicyId, deploymentMode, disabled: !Boolean(serviceToken), diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/components/fleet_server_host_combobox.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/components/fleet_server_host_combobox.tsx index 0508bd9108d3a..ca9e9755496ce 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/components/fleet_server_host_combobox.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/components/fleet_server_host_combobox.tsx @@ -6,12 +6,15 @@ */ import React, { useState } from 'react'; import type { EuiComboBoxOptionOption } from '@elastic/eui'; + import { EuiComboBox, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; +import type { FleetServerHost } from '../../../types'; + interface Props { - fleetServerHost: string | undefined; + fleetServerHost: FleetServerHost | undefined; fleetServerHostSettings: string[]; isDisabled: boolean; isInvalid: boolean; @@ -42,7 +45,6 @@ export const FleetServerHostComboBox: React.FunctionComponent<Props> = ({ setCreatedOptions([...createdOptions, option]); onFleetServerHostChange(option); }; - return ( <EuiComboBox<string> fullWidth @@ -57,7 +59,11 @@ export const FleetServerHostComboBox: React.FunctionComponent<Props> = ({ values: { searchValuePlaceholder: '{searchValue}' }, } )} - selectedOptions={fleetServerHost ? [{ label: fleetServerHost, value: fleetServerHost }] : []} + selectedOptions={ + fleetServerHost + ? [{ label: fleetServerHost.host_urls[0], value: fleetServerHost.host_urls[0] }] + : [] + } prepend={ <EuiText> <FormattedMessage diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/hooks/use_fleet_server_host.ts b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/hooks/use_fleet_server_host.ts index 05eeccf4a9312..aa7992f03e16e 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/hooks/use_fleet_server_host.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/hooks/use_fleet_server_host.ts @@ -4,100 +4,109 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import { i18n } from '@kbn/i18n'; -import { useCallback, useEffect, useState } from 'react'; - -import { sendPutSettings, useGetSettings } from '../../../hooks'; - -const URL_REGEX = /^(https):\/\/[^\s$.?#].[^\s]*$/gm; +import { useCallback, useEffect, useState, useMemo } from 'react'; + +import { + sendPostFleetServerHost, + useGetFleetServerHosts, + useComboInput, + useInput, + useSwitchInput, +} from '../../../hooks'; +import type { FleetServerHost } from '../../../types'; + +import { + validateName, + validateFleetServerHosts, +} from '../../../sections/settings/components/fleet_server_hosts_flyout/use_fleet_server_host_form'; export interface FleetServerHostForm { - saveFleetServerHost: () => Promise<void>; - fleetServerHost?: string; - fleetServerHostSettings: string[]; + fleetServerHosts: FleetServerHost[]; + saveFleetServerHost: (host: Omit<FleetServerHost, 'id'>) => Promise<FleetServerHost>; isFleetServerHostSubmitted: boolean; - setFleetServerHost: React.Dispatch<React.SetStateAction<string | undefined>>; + fleetServerHost?: FleetServerHost | null; + setFleetServerHost: React.Dispatch<React.SetStateAction<FleetServerHost | undefined | null>>; + validate: () => boolean; error?: string; - validateFleetServerHost: () => boolean; + inputs: { + hostUrlsInput: ReturnType<typeof useComboInput>; + nameInput: ReturnType<typeof useInput>; + isDefaultInput: ReturnType<typeof useSwitchInput>; + }; } export const useFleetServerHost = (): FleetServerHostForm => { - const [fleetServerHost, setFleetServerHost] = useState<string>(); + const [fleetServerHost, setFleetServerHost] = useState<FleetServerHost | null>(); const [isFleetServerHostSubmitted, setIsFleetServerHostSubmitted] = useState<boolean>(false); - const [error, setError] = useState<string>(); - const { data: settings } = useGetSettings(); + const isPreconfigured = fleetServerHost?.is_preconfigured ?? false; + const nameInput = useInput(fleetServerHost?.name ?? '', validateName, isPreconfigured); - useEffect(() => { - const settingsFleetServerHosts = settings?.item.fleet_server_hosts ?? []; + const isDefaultInput = useSwitchInput( + fleetServerHost?.is_default ?? false, + isPreconfigured || fleetServerHost?.is_default + ); - if (settingsFleetServerHosts.length) { - setFleetServerHost(settingsFleetServerHosts[0]); - } - }, [settings?.item.fleet_server_hosts]); - - const validateFleetServerHost = useCallback(() => { - if (!fleetServerHost) { - setError( - i18n.translate('xpack.fleet.fleetServerHost.requiredError', { - defaultMessage: 'Fleet server host is required.', - }) - ); + const hostUrlsInput = useComboInput( + 'hostUrls', + fleetServerHost?.host_urls || [], + validateFleetServerHosts, + isPreconfigured + ); + const validate = useCallback( + () => hostUrlsInput.validate() && nameInput.validate(), + [hostUrlsInput, nameInput] + ); - return false; - } else if (!fleetServerHost.startsWith('https')) { - setError( - i18n.translate('xpack.fleet.fleetServerHost.requiresHttpsError', { - defaultMessage: 'Fleet server host must begin with "https"', - }) - ); + const { data, resendRequest: refreshGetFleetServerHosts } = useGetFleetServerHosts(); - return false; - } else if (!fleetServerHost.match(URL_REGEX)) { - setError( - i18n.translate('xpack.fleet.fleetServerSetup.addFleetServerHostInvalidUrlError', { - defaultMessage: 'Invalid URL', - }) - ); - - return false; - } + const fleetServerHosts = useMemo(() => data?.items ?? [], [data?.items]); - return true; - }, [fleetServerHost]); - - const saveFleetServerHost = useCallback(async () => { - setIsFleetServerHostSubmitted(false); - - if (!validateFleetServerHost()) { - return; + useEffect(() => { + const defaultHost = fleetServerHosts.find((item) => item.is_default === true); + if (defaultHost) { + setFleetServerHost(defaultHost); + } else { + setFleetServerHost(null); } - - // If the Fleet Server host provided already exists in settings, don't submit it - if (settings?.item.fleet_server_hosts.includes(fleetServerHost!)) { + }, [fleetServerHosts]); + + const saveFleetServerHost = useCallback( + async (newFleetServerHost: Omit<FleetServerHost, 'id'>) => { + setIsFleetServerHostSubmitted(false); + + const res = await sendPostFleetServerHost({ + name: newFleetServerHost?.name, + host_urls: newFleetServerHost?.host_urls, + is_default: newFleetServerHost?.is_default, + }); + if (res.error) { + throw res.error; + } + if (!res.data) { + throw new Error('No data'); + } + + await refreshGetFleetServerHosts(); setIsFleetServerHostSubmitted(true); - return; - } - - const res = await sendPutSettings({ - fleet_server_hosts: [fleetServerHost!, ...(settings?.item.fleet_server_hosts || [])], - }); - - if (res.error) { - throw res.error; - } + setFleetServerHost(res.data.item); - setIsFleetServerHostSubmitted(true); - }, [fleetServerHost, settings?.item.fleet_server_hosts, validateFleetServerHost]); + return res.data.item; + }, + [refreshGetFleetServerHosts] + ); return { + fleetServerHosts, saveFleetServerHost, fleetServerHost, - fleetServerHostSettings: settings?.item.fleet_server_hosts ?? [], isFleetServerHostSubmitted, setFleetServerHost, - error, - validateFleetServerHost, + validate, + inputs: { + hostUrlsInput, + nameInput, + isDefaultInput, + }, }; }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/hooks/use_quick_start_form.ts b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/hooks/use_quick_start_form.ts index 84fd39aeec378..eb3404febfeec 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/hooks/use_quick_start_form.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/hooks/use_quick_start_form.ts @@ -8,10 +8,13 @@ import { useState, useCallback, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; +import type { useComboInput, useInput, useSwitchInput } from '../../../hooks'; import { sendCreateAgentPolicy, sendGetOneAgentPolicy, useStartServices } from '../../../hooks'; import type { NewAgentPolicy } from '../../../types'; +import type { FleetServerHost } from '../../../types'; + import { useSelectFleetServerPolicy } from './use_select_fleet_server_policy'; import { useServiceToken } from './use_service_token'; import { useFleetServerHost } from './use_fleet_server_host'; @@ -30,14 +33,19 @@ export type QuickStartCreateFormStatus = 'initial' | 'loading' | 'error' | 'succ export interface QuickStartCreateForm { status: QuickStartCreateFormStatus; + fleetServerHosts: FleetServerHost[]; error?: string; submit: () => void; - fleetServerHost?: string; - fleetServerHostSettings: string[]; + setFleetServerHost: React.Dispatch<React.SetStateAction<FleetServerHost | undefined | null>>; + fleetServerHost?: FleetServerHost | null; isFleetServerHostSubmitted: boolean; - onFleetServerHostChange: (value: string) => void; fleetServerPolicyId?: string; serviceToken?: string; + inputs: { + hostUrlsInput: ReturnType<typeof useComboInput>; + nameInput: ReturnType<typeof useInput>; + isDefaultInput: ReturnType<typeof useSwitchInput>; + }; } /** @@ -51,13 +59,14 @@ export const useQuickStartCreateForm = (): QuickStartCreateForm => { const [error, setError] = useState<string | undefined>(); const { + fleetServerHosts, fleetServerHost, - fleetServerHostSettings, isFleetServerHostSubmitted, - setFleetServerHost, - validateFleetServerHost, saveFleetServerHost, error: fleetServerError, + setFleetServerHost, + validate, + inputs, } = useFleetServerHost(); // When a validation error is surfaced from the Fleet Server host form, we want to treat it @@ -71,18 +80,23 @@ export const useQuickStartCreateForm = (): QuickStartCreateForm => { const { fleetServerPolicyId, setFleetServerPolicyId } = useSelectFleetServerPolicy(); const { serviceToken, generateServiceToken } = useServiceToken(); - const onFleetServerHostChange = useCallback( - (value: string) => { - setFleetServerHost(value); - }, - [setFleetServerHost] - ); - const submit = useCallback(async () => { try { - if (validateFleetServerHost()) { + if ((!fleetServerHost && validate()) || fleetServerHost) { setStatus('loading'); - await saveFleetServerHost(); + + const newFleetServerHost = { + name: inputs.nameInput.value, + host_urls: inputs.hostUrlsInput.value, + is_default: inputs.isDefaultInput.value, + is_preconfigured: false, + }; + + if (!fleetServerHost) { + const res = await saveFleetServerHost(newFleetServerHost); + setFleetServerHost(res); + } + await generateServiceToken(); const existingPolicy = await sendGetOneAgentPolicy( @@ -99,11 +113,9 @@ export const useQuickStartCreateForm = (): QuickStartCreateForm => { withSysMonitoring: true, } ); - setFleetServerPolicyId(createPolicyResponse.data?.item.id); } - setFleetServerHost(fleetServerHost); setStatus('success'); } } catch (err) { @@ -117,11 +129,14 @@ export const useQuickStartCreateForm = (): QuickStartCreateForm => { setError(err.message); } }, [ - validateFleetServerHost, + validate, + fleetServerHost, + inputs.nameInput.value, + inputs.hostUrlsInput.value, + inputs.isDefaultInput.value, + setFleetServerHost, saveFleetServerHost, generateServiceToken, - setFleetServerHost, - fleetServerHost, setFleetServerPolicyId, notifications.toasts, ]); @@ -131,10 +146,11 @@ export const useQuickStartCreateForm = (): QuickStartCreateForm => { error, submit, fleetServerPolicyId, + fleetServerHosts, fleetServerHost, - fleetServerHostSettings, + setFleetServerHost, isFleetServerHostSubmitted, - onFleetServerHostChange, serviceToken, + inputs, }; }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/index.tsx index bb0c2607cfe1a..5f609e1155519 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useState } from 'react'; +import React, { useState, useCallback } from 'react'; import { EuiButtonGroup, EuiFlexGroup, @@ -16,12 +16,15 @@ import { EuiSpacer, EuiText, EuiTitle, + EuiToolTip, + EuiFlexItem, + EuiButton, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; -import { useStartServices } from '../../hooks'; +import { useStartServices, useFlyoutContext } from '../../hooks'; import { QuickStartTab } from './quick_start_tab'; import { AdvancedTab } from './advanced_tab'; @@ -134,17 +137,78 @@ export const FleetServerFlyout: React.FunctionComponent<Props> = ({ onClose }) = ); }; -// Renders instructions directly -export const FleetServerInstructions: React.FunctionComponent = () => { - const { tabs, currentTab, setCurrentTab, currentTabContent } = useFleetServerTabs(); +export const AddFleetServerLanding: React.FunctionComponent = () => { + const { docLinks } = useStartServices(); + const flyoutContext = useFlyoutContext(); + + const onClickAddFleetServer = useCallback(() => { + flyoutContext.openFleetServerFlyout(); + }, [flyoutContext]); return ( <ContentWrapper gutterSize="none" justifyContent="center" direction="column"> - <Header tabs={tabs} currentTab={currentTab} onTabClick={(id) => setCurrentTab(id)} /> - - <EuiSpacer size="m" /> - - {currentTabContent} + <EuiFlexGroup alignItems="center" direction="column"> + <EuiFlexItem> + <EuiTitle size="m"> + <h2 data-test-subj="addFleetServerHeader"> + <FormattedMessage + id="xpack.fleet.fleetServerLanding.title" + defaultMessage="Add a Fleet Server" + /> + </h2> + </EuiTitle> + </EuiFlexItem> + + <EuiFlexItem> + <EuiText + css={` + max-width: 500px; + text-align: center; + `} + > + <FormattedMessage + id="xpack.fleet.fleetServerLanding.instructions" + defaultMessage="A Fleet Server is required before you can enroll agents with Fleet. Follow the instructions below to set up a Fleet Server. For more information, see the {userGuideLink}" + values={{ + userGuideLink: ( + <EuiLink + href={docLinks.links.fleet.fleetServerAddFleetServer} + external + target="_blank" + > + <FormattedMessage + id="xpack.fleet.fleetServerSetup.setupGuideLink" + defaultMessage="Fleet and Elastic Agent Guide" + /> + </EuiLink> + ), + }} + /> + </EuiText> + </EuiFlexItem> + <EuiSpacer size="s" /> + <EuiFlexItem> + <EuiToolTip + content={ + <FormattedMessage + id="xpack.fleet.fleetServerLanding.addFleetServerButton.tooltip" + defaultMessage="Fleet Server is a component of the Elastic Stack used to centrally manage Elastic Agents" + /> + } + > + <EuiButton + onClick={onClickAddFleetServer} + fill + data-test-subj="fleetServerLanding.addFleetServerButton" + > + <FormattedMessage + id="xpack.fleet.fleetServerLanding.addFleetServerButton" + defaultMessage="Add Fleet Server" + /> + </EuiButton> + </EuiToolTip> + </EuiFlexItem> + </EuiFlexGroup> </ContentWrapper> ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/instructions.stories.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/instructions.stories.tsx index 9993fab723a44..cc930783f73c5 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/instructions.stories.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/instructions.stories.tsx @@ -7,10 +7,10 @@ import React from 'react'; -import { FleetServerInstructions as FleetServerInstructionsComponent } from '.'; +import { AddFleetServerLanding } from '.'; export const FleetServerInstructions = () => { - return <FleetServerInstructionsComponent />; + return <AddFleetServerLanding />; }; FleetServerInstructions.args = { diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/quick_start_tab.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/quick_start_tab.tsx index 758a34113efcd..1ae9f22b304d0 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/quick_start_tab.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/quick_start_tab.tsx @@ -17,24 +17,44 @@ import { } from './steps'; export const QuickStartTab: React.FunctionComponent = () => { - const quickStartCreateForm = useQuickStartCreateForm(); + const { + fleetServerHost, + setFleetServerHost, + fleetServerHosts, + fleetServerPolicyId, + serviceToken, + status, + error, + submit, + inputs, + } = useQuickStartCreateForm(); + const { isFleetServerReady } = useWaitForFleetServer(); const steps = [ getGettingStartedStep({ - quickStartCreateForm, + fleetServerHosts, + fleetServerHost, + setFleetServerHost, + fleetServerPolicyId, + serviceToken, + status, + error, + submit, + isFleetServerHostSubmitted: false, + inputs, }), getInstallFleetServerStep({ isFleetServerReady, - fleetServerHost: quickStartCreateForm.fleetServerHost, - fleetServerPolicyId: quickStartCreateForm.fleetServerPolicyId, - serviceToken: quickStartCreateForm.serviceToken, + fleetServerHost: fleetServerHost?.host_urls[0], + fleetServerPolicyId, + serviceToken, deploymentMode: 'quickstart', - disabled: quickStartCreateForm.status !== 'success', + disabled: status !== 'success', }), getConfirmFleetServerConnectionStep({ isFleetServerReady, - disabled: quickStartCreateForm.status !== 'success', + disabled: status !== 'success', }), ]; diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/add_fleet_server_host.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/add_fleet_server_host.tsx index 62b11e3295ecf..0b5369b2b769c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/add_fleet_server_host.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/add_fleet_server_host.tsx @@ -5,26 +5,31 @@ * 2.0. */ -import React, { useState, useCallback } from 'react'; +import React, { useState, useCallback, useMemo } from 'react'; + import type { EuiStepProps } from '@elastic/eui'; +import { EuiSelect, EuiSwitch } from '@elastic/eui'; import { EuiButton, EuiCallOut, EuiCode, - EuiFlexGroup, - EuiFlexItem, EuiForm, EuiFormErrorText, EuiLink, EuiSpacer, EuiText, + EuiFormRow, + EuiFieldText, + EuiButtonEmpty, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import type { FleetServerHost } from '../../../types'; + import { useStartServices, useLink } from '../../../hooks'; import type { FleetServerHostForm } from '../hooks'; -import { FleetServerHostComboBox } from '../components'; +import { MultiRowInput } from '../../../sections/settings/components/multi_row_input'; export const getAddFleetServerHostStep = ({ fleetServerHostForm, @@ -50,27 +55,47 @@ export const AddFleetServerHostStepContent = ({ fleetServerHostForm: FleetServerHostForm; }) => { const { - fleetServerHost, - fleetServerHostSettings, setFleetServerHost, - validateFleetServerHost, + fleetServerHost: selectedFleetServerHost, saveFleetServerHost, + fleetServerHosts, error, + validate, + inputs, } = fleetServerHostForm; const [isLoading, setIsLoading] = useState(false); - const [submittedFleetServerHost, setSubmittedFleetServerHost] = useState<string>(); + const [submittedFleetServerHost, setSubmittedFleetServerHost] = useState<FleetServerHost>(); const { notifications } = useStartServices(); const { getHref } = useLink(); + const fleetServerHostsOptions = useMemo( + () => + fleetServerHosts.map((fleetServerHost) => { + return { + text: fleetServerHost.name, + value: fleetServerHost.id, + }; + }), + [fleetServerHosts] + ); + const onSubmit = useCallback(async () => { try { - setSubmittedFleetServerHost(''); + setSubmittedFleetServerHost(undefined); setIsLoading(true); - if (validateFleetServerHost()) { - await saveFleetServerHost(); - setSubmittedFleetServerHost(fleetServerHost); + const newFleetServerHost = { + name: inputs.nameInput.value, + host_urls: inputs.hostUrlsInput.value, + is_default: true, + id: 'fleet-server-host', + is_preconfigured: false, + }; + setFleetServerHost(newFleetServerHost); + if (validate()) { + setSubmittedFleetServerHost(newFleetServerHost); + setFleetServerHost(await saveFleetServerHost(newFleetServerHost)); } } catch (err) { notifications.toasts.addError(err, { @@ -81,18 +106,14 @@ export const AddFleetServerHostStepContent = ({ } finally { setIsLoading(false); } - }, [validateFleetServerHost, saveFleetServerHost, fleetServerHost, notifications.toasts]); - - const onChange = useCallback( - (host: string) => { - setFleetServerHost(host); - - if (error) { - validateFleetServerHost(); - } - }, - [error, setFleetServerHost, validateFleetServerHost] - ); + }, [ + inputs.nameInput.value, + inputs.hostUrlsInput.value, + setFleetServerHost, + validate, + saveFleetServerHost, + notifications.toasts, + ]); return ( <EuiForm onSubmit={onSubmit}> @@ -104,22 +125,96 @@ export const AddFleetServerHostStepContent = ({ /> </EuiText> <EuiSpacer size="m" /> - <EuiFlexGroup wrap> - <EuiFlexItem - css={` - max-width: 100%; - `} - > - <FleetServerHostComboBox - fleetServerHost={fleetServerHost} - fleetServerHostSettings={fleetServerHostSettings} - isDisabled={isLoading} - isInvalid={!!error} - onFleetServerHostChange={onChange} + {fleetServerHosts.length > 0 ? ( + <> + <EuiSelect + fullWidth + prepend={ + <EuiText size="relative" color={''}> + <FormattedMessage + id="xpack.fleet.fleetServerSetup.fleetServerHostsLabel" + defaultMessage="Fleet Server Hosts" + /> + </EuiText> + } + append={ + <EuiButtonEmpty + data-test-subj="fleetServerSetup.addNewHostBtn" + onClick={() => setFleetServerHost(null)} + > + <FormattedMessage + id="xpack.fleet.fleetServerSetup.addFleetServerHostBtn" + defaultMessage="Add new Fleet Server Hosts" + /> + </EuiButtonEmpty> + } + onChange={(e) => + setFleetServerHost( + fleetServerHosts.find((fleetServerHost) => fleetServerHost.id === e.target.value) + ) + } + options={fleetServerHostsOptions} /> - {error && <EuiFormErrorText>{error}</EuiFormErrorText>} - </EuiFlexItem> - <EuiFlexItem grow={false}> + <EuiSpacer size="m" /> + </> + ) : null} + {!selectedFleetServerHost ? ( + <> + <EuiFormRow + fullWidth + label={ + <FormattedMessage + id="xpack.fleet.fleetServerSetup.nameInputLabel" + defaultMessage="Name" + /> + } + {...inputs.nameInput.formRowProps} + > + <EuiFieldText + data-test-subj="fleetServerSetup.nameInput" + fullWidth + placeholder={i18n.translate('xpack.fleet.fleetServerSetup.nameInputPlaceholder', { + defaultMessage: 'Specify name', + })} + {...inputs.nameInput.props} + /> + </EuiFormRow> + <EuiFormRow + fullWidth + label={ + <FormattedMessage + id="xpack.fleet.fleetServerSetup.hostUrlLabel" + defaultMessage="URL" + /> + } + > + <> + <MultiRowInput + data-test-subj="fleetServerSetup.multiRowInput" + {...inputs.hostUrlsInput.props} + placeholder={i18n.translate( + 'xpack.fleet.fleetServerSetup.fleetServerHostsInputPlaceholder', + { + defaultMessage: 'Specify host URL', + } + )} + /> + {error && <EuiFormErrorText>{error}</EuiFormErrorText>} + </> + </EuiFormRow> + <EuiFormRow fullWidth {...inputs.isDefaultInput.formRowProps}> + <EuiSwitch + data-test-subj="fleetServerHostsFlyout.isDefaultSwitch" + {...inputs.isDefaultInput.props} + disabled={false} + label={ + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostsFlyout.defaultOutputSwitchLabel" + defaultMessage="Make this Fleet server the default one." + /> + } + /> + </EuiFormRow> <EuiButton isLoading={isLoading} onClick={onSubmit} @@ -130,8 +225,8 @@ export const AddFleetServerHostStepContent = ({ defaultMessage="Add host" /> </EuiButton> - </EuiFlexItem> - </EuiFlexGroup> + </> + ) : null} {submittedFleetServerHost && ( <> <EuiSpacer size="m" /> @@ -150,7 +245,7 @@ export const AddFleetServerHostStepContent = ({ id="xpack.fleet.fleetServerSetup.addFleetServerHostSuccessText" defaultMessage="Added {host}. You can edit your Fleet Server hosts in {fleetSettingsLink}." values={{ - host: submittedFleetServerHost, + host: submittedFleetServerHost.host_urls[0], fleetSettingsLink: ( <EuiLink href={getHref('settings')}> <FormattedMessage diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/get_started.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/get_started.tsx index 79acb26802499..321de1da5b0a3 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/get_started.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/get_started.tsx @@ -5,53 +5,65 @@ * 2.0. */ -import React from 'react'; +import React, { useMemo } from 'react'; import type { EuiStepProps } from '@elastic/eui'; +import { EuiSelect, EuiButtonEmpty } from '@elastic/eui'; import { EuiButton, EuiCallOut, EuiCode, - EuiFlexGroup, - EuiFlexItem, EuiForm, EuiFormErrorText, EuiLink, EuiSpacer, EuiText, + EuiFormRow, + EuiFieldText, + EuiSwitch, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { css } from '@emotion/react'; + +import { MultiRowInput } from '../../../sections/settings/components/multi_row_input'; import { useLink } from '../../../hooks'; import type { QuickStartCreateForm } from '../hooks'; -import { FleetServerHostComboBox } from '../components'; -export function getGettingStartedStep({ - quickStartCreateForm, -}: { - quickStartCreateForm: QuickStartCreateForm; -}): EuiStepProps { +export function getGettingStartedStep(props: QuickStartCreateForm): EuiStepProps { return { title: i18n.translate('xpack.fleet.fleetServerFlyout.getStartedTitle', { defaultMessage: 'Get started with Fleet Server', }), - status: quickStartCreateForm.status === 'success' ? 'complete' : 'current', - children: <GettingStartedStepContent quickStartCreateForm={quickStartCreateForm} />, + status: props.status === 'success' ? 'complete' : 'current', + children: <GettingStartedStepContent {...props} />, }; } -const GettingStartedStepContent: React.FunctionComponent<{ - quickStartCreateForm: QuickStartCreateForm; -}> = ({ quickStartCreateForm }) => { +const GettingStartedStepContent: React.FunctionComponent<QuickStartCreateForm> = ({ + fleetServerHosts, + fleetServerHost: selectedFleetServerHost, + setFleetServerHost, + status, + error, + inputs, + submit, +}) => { const { getHref } = useLink(); - const { fleetServerHost, fleetServerHostSettings, onFleetServerHostChange } = - quickStartCreateForm; + const fleetServerHostsOptions = useMemo( + () => + fleetServerHosts.map((fleetServerHost) => { + return { + text: fleetServerHost.name, + value: fleetServerHost.id, + }; + }), + [fleetServerHosts] + ); - if (quickStartCreateForm.status === 'success') { + if (status === 'success') { return ( <EuiCallOut color="success" @@ -66,9 +78,9 @@ const GettingStartedStepContent: React.FunctionComponent<{ <EuiText> <FormattedMessage id="xpack.fleet.fleetServerFlyout.generateFleetServerPolicySuccessInstructions" - defaultMessage="Fleet server policy and service token have been generated. Host configured at {hostUrl}. You can edit your Fleet Server hosts in {fleetSettingsLink}." + defaultMessage="Fleet server policy and service token have been generated. Host configured at {hostUrl}. You can edit your Fleet Server hosts in {fleetSettingsLink}." values={{ - hostUrl: <EuiCode>{fleetServerHost}</EuiCode>, + hostUrl: <EuiCode>{selectedFleetServerHost?.host_urls[0]}</EuiCode>, fleetSettingsLink: ( <EuiLink href={getHref('settings')}> <FormattedMessage @@ -88,40 +100,112 @@ const GettingStartedStepContent: React.FunctionComponent<{ <> <EuiText> <FormattedMessage - id="xpack.fleet.fleetServerFlyout.getStartedInstructions" + id="xpack.fleet.fleetServerSetup.getStartedInstructions" defaultMessage="First, set the public IP or host name and port that agents will use to reach Fleet Server. It uses port {port} by default. We'll then generate a policy for you automatically." values={{ port: <EuiCode>8220</EuiCode> }} /> </EuiText> <EuiSpacer size="m" /> + {fleetServerHosts.length > 0 ? ( + <> + <EuiSelect + fullWidth + prepend={ + <EuiText size="relative" color={''}> + <FormattedMessage + id="xpack.fleet.fleetServerSetup.fleetServerHostsLabel" + defaultMessage="Fleet Server Hosts" + /> + </EuiText> + } + append={ + <EuiButtonEmpty + data-test-subj="fleetServerSetup.addNewHostBtn" + onClick={() => setFleetServerHost(null)} + > + <FormattedMessage + id="xpack.fleet.fleetServerSetup.addFleetServerHostBtn" + defaultMessage="Add new Fleet Server Hosts" + /> + </EuiButtonEmpty> + } + onChange={(e) => + setFleetServerHost( + fleetServerHosts.find((fleetServerHost) => fleetServerHost.id === e.target.value) + ) + } + options={fleetServerHostsOptions} + /> + <EuiSpacer size="m" /> + </> + ) : null} - <EuiForm onSubmit={quickStartCreateForm.submit}> - <EuiFlexGroup> - <EuiFlexItem - css={css` - max-width: 100%; - `} - > - <FleetServerHostComboBox - fleetServerHost={fleetServerHost} - fleetServerHostSettings={fleetServerHostSettings} - isDisabled={quickStartCreateForm.status === 'loading'} - isInvalid={!!quickStartCreateForm.error} - onFleetServerHostChange={onFleetServerHostChange} - /> - - {quickStartCreateForm.status === 'error' && ( - <EuiFormErrorText>{quickStartCreateForm.error}</EuiFormErrorText> - )} - </EuiFlexItem> - </EuiFlexGroup> - - <EuiSpacer size="m" /> + <EuiForm onSubmit={submit}> + {!selectedFleetServerHost ? ( + <> + <EuiFormRow + fullWidth + label={ + <FormattedMessage + id="xpack.fleet.fleetServerSetup.nameInputLabel" + defaultMessage="Name" + /> + } + {...inputs.nameInput.formRowProps} + > + <EuiFieldText + data-test-subj="fleetServerSetup.nameInput" + fullWidth + placeholder={i18n.translate('xpack.fleet.fleetServerSetup.nameInputPlaceholder', { + defaultMessage: 'Specify name', + })} + {...inputs.nameInput.props} + /> + </EuiFormRow> + <EuiFormRow + fullWidth + label={ + <FormattedMessage + id="xpack.fleet.fleetServerSetup.hostUrlLabel" + defaultMessage="URL" + /> + } + > + <> + <MultiRowInput + data-test-subj="fleetServerSetup.multiRowInput" + {...inputs.hostUrlsInput.props} + placeholder={i18n.translate( + 'xpack.fleet.fleetServerSetup.fleetServerHostsInputPlaceholder', + { + defaultMessage: 'Specify host URL', + } + )} + /> + {status === 'error' && <EuiFormErrorText>{error}</EuiFormErrorText>} + </> + </EuiFormRow> + <EuiFormRow fullWidth {...inputs.isDefaultInput.formRowProps}> + <EuiSwitch + data-test-subj="fleetServerHostsFlyout.isDefaultSwitch" + {...inputs.isDefaultInput.props} + disabled={false} + label={ + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostsFlyout.defaultOutputSwitchLabel" + defaultMessage="Make this Fleet server the default one." + /> + } + /> + </EuiFormRow> + <EuiSpacer size="m" /> + </> + ) : null} <EuiButton - isLoading={quickStartCreateForm.status === 'loading'} - onClick={quickStartCreateForm.submit} + isLoading={status === 'loading'} + onClick={submit} data-test-subj="generateFleetServerPolicyButton" > <FormattedMessage diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx index 663ebf1aaeb49..14ff7e820b388 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx @@ -55,7 +55,7 @@ export const SearchBar: React.FunctionComponent<Props> = ({ usageCollection, } = useStartServices(); - const [indexPatternFields, setIndexPatternFields] = useState<FieldSpec[]>(); + const [dataView, setDataView] = useState<DataView | undefined>(); const isQueryValid = useMemo(() => { if (!value || value === '') { @@ -86,9 +86,14 @@ export const SearchBar: React.FunctionComponent<Props> = ({ return true; } }); - setIndexPatternFields(fields); + const fieldsMap = fields.reduce((acc: Record<string, FieldSpec>, curr: FieldSpec) => { + acc[curr.name] = curr; + return acc; + }, {}); + const newDataView = await data.dataViews.create({ title: indexPattern, fields: fieldsMap }); + setDataView(newDataView); } catch (err) { - setIndexPatternFields(undefined); + setDataView(undefined); } }; fetchFields(); @@ -98,16 +103,7 @@ export const SearchBar: React.FunctionComponent<Props> = ({ <NoWrapQueryStringInput iconType="search" disableLanguageSwitcher={true} - indexPatterns={ - indexPatternFields - ? ([ - { - title: indexPattern, - fields: indexPatternFields, - }, - ] as DataView[]) - : [] - } + indexPatterns={dataView ? [dataView] : []} query={{ query: value, language: 'kuery', diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/actions_menu.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/actions_menu.tsx index 6e2dc54470a17..fa4e03c81b656 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/actions_menu.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/actions_menu.tsx @@ -12,6 +12,7 @@ import { EuiContextMenuItem, EuiPortal } from '@elastic/eui'; import type { AgentPolicy } from '../../../types'; import { useAuthz } from '../../../hooks'; import { AgentEnrollmentFlyout, ContextMenuActions } from '../../../components'; +import { FLEET_SERVER_PACKAGE } from '../../../constants'; import { AgentPolicyYamlFlyout } from './agent_policy_yaml_flyout'; import { AgentPolicyCopyProvider } from './agent_policy_copy_provider'; @@ -36,6 +37,14 @@ export const AgentPolicyActionMenu = memo<{ enrollmentFlyoutOpenByDefault ); + const isFleetServerPolicy = useMemo( + () => + agentPolicy.package_policies?.some( + (packagePolicy) => packagePolicy.package?.name === FLEET_SERVER_PACKAGE + ), + [agentPolicy] + ); + const [isContextMenuOpen, setIsContextMenuOpen] = useState(false); const onContextMenuChange = useCallback( @@ -83,10 +92,17 @@ export const AgentPolicyActionMenu = memo<{ }} key="enrollAgents" > - <FormattedMessage - id="xpack.fleet.agentPolicyActionMenu.enrollAgentActionText" - defaultMessage="Add agent" - /> + {isFleetServerPolicy ? ( + <FormattedMessage + id="xpack.fleet.agentPolicyActionMenu.addFleetServerActionText" + defaultMessage="Add Fleet Server" + /> + ) : ( + <FormattedMessage + id="xpack.fleet.agentPolicyActionMenu.enrollAgentActionText" + defaultMessage="Add agent" + /> + )} </EuiContextMenuItem>, viewPolicyItem, <EuiContextMenuItem diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.test.tsx index 874f60a604bfe..446d33a91af91 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.test.tsx @@ -113,7 +113,7 @@ describe('useOutputOptions', () => { Object { "disabled": false, "inputDisplay": "Default (currently Output 1)", - "value": "@@##DEFAULT_OUTPUT_VALUE##@@", + "value": "@@##DEFAULT_SELECT##@@", }, Object { "disabled": false, @@ -137,7 +137,7 @@ describe('useOutputOptions', () => { Object { "disabled": undefined, "inputDisplay": "Default (currently Output 1)", - "value": "@@##DEFAULT_OUTPUT_VALUE##@@", + "value": "@@##DEFAULT_SELECT##@@", }, Object { "disabled": false, @@ -175,7 +175,7 @@ describe('useOutputOptions', () => { Object { "disabled": false, "inputDisplay": "Default (currently Output 1)", - "value": "@@##DEFAULT_OUTPUT_VALUE##@@", + "value": "@@##DEFAULT_SELECT##@@", }, Object { "disabled": true, @@ -199,7 +199,7 @@ describe('useOutputOptions', () => { Object { "disabled": undefined, "inputDisplay": "Default (currently Output 1)", - "value": "@@##DEFAULT_OUTPUT_VALUE##@@", + "value": "@@##DEFAULT_SELECT##@@", }, Object { "disabled": true, @@ -237,7 +237,7 @@ describe('useOutputOptions', () => { Object { "disabled": false, "inputDisplay": "Default (currently Logstash 1)", - "value": "@@##DEFAULT_OUTPUT_VALUE##@@", + "value": "@@##DEFAULT_SELECT##@@", }, Object { "disabled": false, @@ -256,7 +256,7 @@ describe('useOutputOptions', () => { Object { "disabled": undefined, "inputDisplay": "Default (currently Logstash 1)", - "value": "@@##DEFAULT_OUTPUT_VALUE##@@", + "value": "@@##DEFAULT_SELECT##@@", }, Object { "disabled": false, @@ -315,7 +315,7 @@ describe('useOutputOptions', () => { /> </EuiText> </React.Fragment>, - "value": "@@##DEFAULT_OUTPUT_VALUE##@@", + "value": "@@##DEFAULT_SELECT##@@", }, Object { "disabled": false, @@ -352,7 +352,7 @@ describe('useOutputOptions', () => { Object { "disabled": undefined, "inputDisplay": "Default (currently Logstash 1)", - "value": "@@##DEFAULT_OUTPUT_VALUE##@@", + "value": "@@##DEFAULT_SELECT##@@", }, Object { "disabled": false, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.tsx index a5c8c68564d39..83573a17c2c8e 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.tsx @@ -10,7 +10,12 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiSpacer } from '@elastic/eui'; -import { useGetOutputs, useLicense, useGetDownloadSources } from '../../../../hooks'; +import { + useGetOutputs, + useLicense, + useGetDownloadSources, + useGetFleetServerHosts, +} from '../../../../hooks'; import { LICENCE_FOR_PER_POLICY_OUTPUT, FLEET_APM_PACKAGE, @@ -19,8 +24,7 @@ import { import type { NewAgentPolicy, AgentPolicy } from '../../../../types'; // The super select component do not support null or '' as a value -export const DEFAULT_OUTPUT_VALUE = '@@##DEFAULT_OUTPUT_VALUE##@@'; -export const DEFAULT_DOWNLOAD_SOURCE_VALUE = '@@##DEFAULT_DOWNLOAD_SOURCE_VALUE##@@'; +export const DEFAULT_SELECT_VALUE = '@@##DEFAULT_SELECT##@@'; function getOutputLabel(name: string, disabledMessage?: React.ReactNode) { if (!disabledMessage) { @@ -49,7 +53,7 @@ function getDefaultOutput( }), defaultOutputDisabledMessage ), - value: DEFAULT_OUTPUT_VALUE, + value: DEFAULT_SELECT_VALUE, disabled: defaultOutputDisabled, }; } @@ -184,7 +188,60 @@ function getDefaultDownloadSource( }), defaultDownloadSourceDisabledMessage ), - value: DEFAULT_DOWNLOAD_SOURCE_VALUE, + value: DEFAULT_SELECT_VALUE, disabled: defaultDownloadSourceDisabled, }; } + +export function useFleetServerHostsOptions(agentPolicy: Partial<NewAgentPolicy | AgentPolicy>) { + const fleetServerHostsRequest = useGetFleetServerHosts(); + + const fleetServerHostsOptions = useMemo(() => { + if (fleetServerHostsRequest.isLoading || !fleetServerHostsRequest.data) { + return []; + } + + const defaultFleetServerHosts = fleetServerHostsRequest.data.items.find( + (item) => item.is_default + ); + const defaultFleetServerHostsName = defaultFleetServerHosts?.name; + + return [ + getDefaultFleetServerHosts(defaultFleetServerHostsName), + ...fleetServerHostsRequest.data.items + .filter((item) => !item.is_default) + .map((item) => { + return { + value: item.id, + inputDisplay: item.name, + }; + }), + ]; + }, [fleetServerHostsRequest]); + + return useMemo( + () => ({ + fleetServerHostsOptions, + isLoading: fleetServerHostsRequest.isLoading, + }), + [fleetServerHostsOptions, fleetServerHostsRequest.isLoading] + ); +} + +function getDefaultFleetServerHosts( + defaultFleetServerHostsName?: string, + defaultFleetServerHostsDisabled?: boolean, + defaultFleetServerHostsDisabledMessage?: React.ReactNode +) { + return { + inputDisplay: getOutputLabel( + i18n.translate('xpack.fleet.agentPolicy.fleetServerHostsOptions.defaultOutputText', { + defaultMessage: 'Default (currently {defaultFleetServerHostsName})', + values: { defaultFleetServerHostsName }, + }), + defaultFleetServerHostsDisabledMessage + ), + value: DEFAULT_SELECT_VALUE, + disabled: defaultFleetServerHostsDisabled, + }; +} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.tsx index f8eab1fe8513e..179f61db9a5b7 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.tsx @@ -36,8 +36,8 @@ import { policyHasFleetServer } from '../../../../services'; import { useOutputOptions, useDownloadSourcesOptions, - DEFAULT_OUTPUT_VALUE, - DEFAULT_DOWNLOAD_SOURCE_VALUE, + DEFAULT_SELECT_VALUE, + useFleetServerHostsOptions, } from './hooks'; interface Props { @@ -65,6 +65,9 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent<Props> = const { dataDownloadSourceOptions, isLoading: isLoadingDownloadSources } = useDownloadSourcesOptions(agentPolicy); + const { fleetServerHostsOptions, isLoading: isLoadingFleetServerHostsOption } = + useFleetServerHostsOptions(agentPolicy); + // agent monitoring checkbox group can appear multiple times in the DOM, ids have to be unique to work correctly const monitoringCheckboxIdSuffix = Date.now(); @@ -292,6 +295,45 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent<Props> = /> </EuiFormRow> </EuiDescribedFormGroup> + <EuiDescribedFormGroup + title={ + <h4> + <FormattedMessage + id="xpack.fleet.agentPolicyForm.fleetServerHostsLabel" + defaultMessage="Fleet Server" + /> + </h4> + } + description={ + <FormattedMessage + id="xpack.fleet.agentPolicyForm.fleetServerHostsDescripton" + defaultMessage="Select to which Fleet Server the agents in this policy will communicate." + /> + } + > + <EuiFormRow + fullWidth + error={ + touchedFields.fleet_server_host_id && validation.fleet_server_host_id + ? validation.fleet_server_host_id + : null + } + isInvalid={Boolean(touchedFields.fleet_server_host_id && validation.fleet_server_host_id)} + > + <EuiSuperSelect + disabled={agentPolicy.is_managed === true} + valueOfSelected={agentPolicy.fleet_server_host_id || DEFAULT_SELECT_VALUE} + fullWidth + isLoading={isLoadingFleetServerHostsOption} + onChange={(e) => { + updateAgentPolicy({ + fleet_server_host_id: e !== DEFAULT_SELECT_VALUE ? e : null, + }); + }} + options={fleetServerHostsOptions} + /> + </EuiFormRow> + </EuiDescribedFormGroup> <EuiDescribedFormGroup title={ <h4> @@ -319,12 +361,12 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent<Props> = > <EuiSuperSelect disabled={agentPolicy.is_managed === true} - valueOfSelected={agentPolicy.data_output_id || DEFAULT_OUTPUT_VALUE} + valueOfSelected={agentPolicy.data_output_id || DEFAULT_SELECT_VALUE} fullWidth isLoading={isLoadingOptions} onChange={(e) => { updateAgentPolicy({ - data_output_id: e !== DEFAULT_OUTPUT_VALUE ? e : null, + data_output_id: e !== DEFAULT_SELECT_VALUE ? e : null, }); }} options={dataOutputOptions} @@ -358,12 +400,12 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent<Props> = > <EuiSuperSelect disabled={agentPolicy.is_managed === true} - valueOfSelected={agentPolicy.monitoring_output_id || DEFAULT_OUTPUT_VALUE} + valueOfSelected={agentPolicy.monitoring_output_id || DEFAULT_SELECT_VALUE} fullWidth isLoading={isLoadingOptions} onChange={(e) => { updateAgentPolicy({ - monitoring_output_id: e !== DEFAULT_OUTPUT_VALUE ? e : null, + monitoring_output_id: e !== DEFAULT_SELECT_VALUE ? e : null, }); }} options={monitoringOutputOptions} @@ -397,12 +439,12 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent<Props> = isInvalid={Boolean(touchedFields.download_source_id && validation.download_source_id)} > <EuiSuperSelect - valueOfSelected={agentPolicy.download_source_id || DEFAULT_DOWNLOAD_SOURCE_VALUE} + valueOfSelected={agentPolicy.download_source_id || DEFAULT_SELECT_VALUE} fullWidth isLoading={isLoadingDownloadSources} onChange={(e) => { updateAgentPolicy({ - download_source_id: e !== DEFAULT_DOWNLOAD_SOURCE_VALUE ? e : null, + download_source_id: e !== DEFAULT_SELECT_VALUE ? e : null, }); }} options={dataDownloadSourceOptions} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx index 9b94537a73c27..54b6205da2ed9 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx @@ -21,6 +21,8 @@ import { } from '@elastic/eui'; import { useRouteMatch } from 'react-router-dom'; +import { mapPackageReleaseToIntegrationCardRelease } from '../../../../../../../../services/package_prerelease'; + import { getRegistryDataStreamAssetBaseName } from '../../../../../../../../../common/services'; import type { @@ -148,7 +150,11 @@ export const PackagePolicyInputStreamConfig = memo<Props>( )} {packagePolicyInputStream.release && packagePolicyInputStream.release !== 'ga' ? ( <EuiFlexItem grow={false}> - <InlineReleaseBadge release={packagePolicyInputStream.release} /> + <InlineReleaseBadge + release={mapPackageReleaseToIntegrationCardRelease( + packagePolicyInputStream.release + )} + /> </EuiFlexItem> ) : null} </EuiFlexGroup> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_managed.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_managed.tsx index 0bec2892d688d..ecbda47baad79 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_managed.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_managed.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useMemo, useState } from 'react'; +import React, { useState } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiLink, EuiSteps, EuiSpacer } from '@elastic/eui'; @@ -28,7 +28,7 @@ export const InstallElasticAgentManagedPageStep: React.FC<InstallAgentPageProps> setIsManaged, agentPolicy, enrollmentAPIKey, - settings, + fleetServerHosts, enrolledAgentIds, } = props; @@ -40,10 +40,6 @@ export const InstallElasticAgentManagedPageStep: React.FC<InstallAgentPageProps> const [commandCopied, setCommandCopied] = useState(false); - const fleetServerHosts = useMemo(() => { - return settings?.fleet_server_hosts || []; - }, [settings]); - if (!enrollmentAPIKey) { return ( <Error diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/index.tsx index 6ce311b36aa6a..46f12816f02c0 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/index.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { splitPkgKey } from '../../../../../../../common/services'; -import { useGetPackageInfoByKey, useGetSettings, useLink } from '../../../../hooks'; +import { useGetPackageInfoByKey, useLink, useFleetServerHostsForPolicy } from '../../../../hooks'; import type { AddToPolicyParams, CreatePackagePolicyParams } from '../types'; @@ -66,13 +66,11 @@ export const CreatePackagePolicyMultiPage: CreatePackagePolicyParams = ({ setCurrentStep(0); }; - const { isLoading: isSettingsLoading, data: settingsData } = useGetSettings(); - const { data: packageInfoData, error: packageInfoError, isLoading: isPackageInfoLoading, - } = useGetPackageInfoByKey(pkgName, pkgVersion); + } = useGetPackageInfoByKey(pkgName, pkgVersion, { prerelease: true }); const { agentPolicy, @@ -82,7 +80,6 @@ export const CreatePackagePolicyMultiPage: CreatePackagePolicyParams = ({ } = useGetAgentPolicyOrDefault(queryParamsPolicyId); const packageInfo = useMemo(() => packageInfoData?.item, [packageInfoData]); - const settings = useMemo(() => settingsData?.item, [settingsData]); const integrationInfo = useMemo(() => { if (!integration) return; @@ -95,6 +92,8 @@ export const CreatePackagePolicyMultiPage: CreatePackagePolicyParams = ({ setOnSplash(false); }; + const { fleetServerHosts, isLoadingInitialRequest } = useFleetServerHostsForPolicy(agentPolicy); + const cancelUrl = getHref('add_integration_to_policy', { pkgkey, useMultiPageLayout: false, @@ -105,7 +104,7 @@ export const CreatePackagePolicyMultiPage: CreatePackagePolicyParams = ({ if (onSplash || !packageInfo) { return ( <AddFirstIntegrationSplashScreen - isLoading={isPackageInfoLoading || isSettingsLoading || isAgentPolicyLoading} + isLoading={isPackageInfoLoading || isLoadingInitialRequest || isAgentPolicyLoading} error={packageInfoError || agentPolicyError} integrationInfo={integrationInfo} packageInfo={packageInfo} @@ -134,7 +133,7 @@ export const CreatePackagePolicyMultiPage: CreatePackagePolicyParams = ({ return ( <MultiPageStepsLayout - settings={settings} + fleetServerHosts={fleetServerHosts} agentPolicy={agentPolicy} enrollmentAPIKey={enrollmentAPIKey} currentStep={currentStep} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/types.ts b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/types.ts index d3a195e0513d4..2ac88f8528caa 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/types.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/types.ts @@ -11,7 +11,6 @@ import type { RegistryPolicyTemplate, PackageInfo, AgentPolicy, - Settings, EnrollmentAPIKey, } from '../../../../types'; @@ -21,7 +20,7 @@ export interface MultiPageStep { } export interface MultiPageStepLayoutProps { - settings?: Settings; + fleetServerHosts: string[]; agentPolicy?: AgentPolicy; error?: Error; enrollmentAPIKey?: EnrollmentAPIKey; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_add_agent_modal.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_add_agent_modal.tsx index b6d568971140a..18be0df355395 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_add_agent_modal.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_add_agent_modal.tsx @@ -51,7 +51,7 @@ export const PostInstallAddAgentModal: React.FunctionComponent<{ <p> <FormattedMessage id="xpack.fleet.agentPolicy.postInstallAddAgentModalDescription" - defaultMessage="To complete this integration, add {elasticAgent} to your hosts to collect data and send it to Elastic Stack" + defaultMessage="To complete this integration, add {elasticAgent} to your hosts to collect data and send it to Elastic Stack." values={{ elasticAgent: <strong>Elastic Agent</strong>, }} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx index 02f36e2cadcfe..0192b7a4a7928 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx @@ -99,7 +99,7 @@ export const CreatePackagePolicySinglePage: CreatePackagePolicyParams = ({ data: packageInfoData, error: packageInfoError, isLoading: isPackageInfoLoading, - } = useGetPackageInfoByKey(pkgName, pkgVersion); + } = useGetPackageInfoByKey(pkgName, pkgVersion, { prerelease: true }); const packageInfo = useMemo(() => { if (packageInfoData && packageInfoData.item) { return packageInfoData.item; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx index c23f29a81c395..5f2aefda403cc 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx @@ -91,6 +91,8 @@ export const SettingsView = memo<{ agentPolicy: AgentPolicy }>( monitoring_output_id, // eslint-disable-next-line @typescript-eslint/naming-convention download_source_id, + // eslint-disable-next-line @typescript-eslint/naming-convention + fleet_server_host_id, } = agentPolicy; const { data, error } = await sendUpdateAgentPolicy(agentPolicy.id, { name, @@ -101,6 +103,7 @@ export const SettingsView = memo<{ agentPolicy: AgentPolicy }>( data_output_id, monitoring_output_id, download_source_id, + fleet_server_host_id, }); if (data) { notifications.toasts.addSuccess( @@ -144,7 +147,8 @@ export const SettingsView = memo<{ agentPolicy: AgentPolicy }>( 'unenroll_timeout', 'data_output_id', 'monitoring_output_id', - 'download_source_id' + 'download_source_id', + 'fleet_server_host_id' ) ), [agentPolicy] diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx index e11d1ccda3b91..aa9ca6277a43c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx @@ -265,7 +265,8 @@ export const EditPackagePolicyForm = memo<{ const { data: packageData } = await sendGetPackageInfoByKey( _packageInfo!.name, - _packageInfo!.version + _packageInfo!.version, + { prerelease: true } ); if (packageData?.item) { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx index 11ddcef4c8aee..0eccf5a8cec33 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx @@ -188,15 +188,19 @@ export const AgentDetailsOverviewSection: React.FunctionComponent<{ description: (agent.tags ?? []).length > 0 ? <Tags tags={agent.tags ?? []} /> : '-', }, ].map(({ title, description }) => { + const tooltip = + typeof description === 'string' && description.length > 20 ? description : ''; return ( <EuiFlexGroup> <FlexItemWithMinWidth grow={3}> <EuiDescriptionListTitle>{title}</EuiDescriptionListTitle> </FlexItemWithMinWidth> <FlexItemWithMinWidth grow={7}> - <EuiDescriptionListDescription className="eui-textTruncate"> - {description} - </EuiDescriptionListDescription> + <EuiToolTip position="top" content={tooltip}> + <EuiDescriptionListDescription className="eui-textTruncate"> + {description} + </EuiDescriptionListDescription> + </EuiToolTip> </FlexItemWithMinWidth> </EuiFlexGroup> ); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout.tsx index dfa6623f4a90a..d40948f2323c6 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout.tsx @@ -254,6 +254,21 @@ const actionNames: { cancelledText: 'update tags', }, CANCEL: { inProgressText: 'Cancelling', completedText: 'cancelled', cancelledText: '' }, + SETTINGS: { + inProgressText: 'Updating settings of', + completedText: 'updated settings', + cancelledText: 'update settings', + }, + POLICY_CHANGE: { + inProgressText: 'Changing policy of', + completedText: 'changed policy', + cancelledText: 'change policy', + }, + INPUT_ACTION: { + inProgressText: 'Input action in progress of', + completedText: 'input action completed', + cancelledText: 'input action', + }, ACTION: { inProgressText: 'Actioning', completedText: 'actioned', cancelledText: 'action' }, }; 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 98b1688308203..33503018b49a0 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 @@ -110,7 +110,7 @@ describe('agent_list_page', () => { totalInactive: 0, }, }); - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterEach(() => { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/fleet_server_requirement_page.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/fleet_server_requirement_page.tsx index b4818a6908adf..fe089a6669c27 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/fleet_server_requirement_page.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/fleet_server_requirement_page.tsx @@ -15,7 +15,7 @@ import { FleetServerMissingPrivileges } from '../components/fleet_server_callout import { Loading } from '../components'; -import { FleetServerInstructions } from '../../../components'; +import { AddFleetServerLanding } from '../../../components'; import { CloudInstructions, EnrollmentRecommendation } from './components'; @@ -78,7 +78,7 @@ export const FleetServerRequirementPage: React.FunctionComponent< ) : showEnrollmentRecommendation ? ( <EnrollmentRecommendation showStandaloneTab={showStandaloneTab} /> ) : ( - <FleetServerInstructions /> + <AddFleetServerLanding /> )} </FlexItemWithMinWidth> </ContentWrapper> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.tsx index d7d376e83e316..7bb890dff81a8 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.tsx @@ -162,15 +162,16 @@ export const AgentUpgradeAgentModal: React.FunctionComponent<AgentUpgradeAgentMo try { setIsSubmitting(true); - const { error } = isSingleAgent - ? await sendPostAgentUpgrade((agents[0] as Agent).id, { - version, - }) - : await sendPostBulkAgentUpgrade({ - version, - agents: Array.isArray(agents) ? agents.map((agent) => agent.id) : agents, - ...rolloutOptions, - }); + const { error } = + isSingleAgent && !isScheduled + ? await sendPostAgentUpgrade((agents[0] as Agent).id, { + version, + }) + : await sendPostBulkAgentUpgrade({ + version, + agents: Array.isArray(agents) ? agents.map((agent) => agent.id) : agents, + ...rolloutOptions, + }); if (error) { if (error?.statusCode === 400) { setErrors(error?.message); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.test.tsx index e30e4512e1de7..20db1fc804d11 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.test.tsx @@ -9,7 +9,6 @@ import React from 'react'; import { createFleetTestRendererMock } from '../../../../mock'; import { useFleetStatus } from '../../../../hooks/use_fleet_status'; -import { useGetSettings } from '../../../../hooks/use_request/settings'; import { useAuthz } from '../../../../hooks/use_authz'; import { AgentsApp } from '.'; @@ -35,7 +34,6 @@ jest.mock('./agent_list_page', () => { }); const mockedUsedFleetStatus = useFleetStatus as jest.MockedFunction<typeof useFleetStatus>; -const mockedUseGetSettings = useGetSettings as jest.MockedFunction<typeof useGetSettings>; const mockedUseAuthz = useAuthz as jest.MockedFunction<typeof useAuthz>; function renderAgentsApp() { @@ -48,12 +46,6 @@ function renderAgentsApp() { } describe('AgentApp', () => { beforeEach(() => { - mockedUseGetSettings.mockReturnValue({ - isLoading: false, - data: { - item: {}, - }, - } as any); mockedUseAuthz.mockReturnValue({ fleet: { all: true, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx index 9c3fa21c752f8..30fc1b84964f3 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx @@ -39,7 +39,7 @@ import { queryClient } from '..'; import { pkgKeyFromPackageInfo } from '../../../services'; const fetchInstalledIntegrations = async () => { - const response = await sendGetPackages({ experimental: true }); + const response = await sendGetPackages({ prerelease: true }); if (response.error) { throw new Error(response.error.message); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.stories.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.stories.tsx index c4ff6917867ca..236c60f2d0c40 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.stories.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.stories.tsx @@ -21,14 +21,18 @@ interface Args { const args: Args = { width: 1200, }; +const fleetServerHost = { + id: 'id1', + name: 'fleet server 1', + host_urls: ['https://host1.fr:8220', 'https://host2-with-a-longer-name.fr:8220'], + is_default: false, + is_preconfigured: false, +}; export const FleetServerHostsFlyout = ({ width }: Args) => { return ( <div style={{ width }}> - <Component - onClose={() => {}} - fleetServerHosts={['https://host1.fr:8220', 'https://host2-with-a-longer-name.fr:8220']} - /> + <Component onClose={() => {}} fleetServerHost={fleetServerHost} /> </div> ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.tsx index 57c9ded6609b5..b64876d3b2524 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.tsx @@ -21,71 +21,132 @@ import { EuiButtonEmpty, EuiButton, EuiSpacer, + EuiForm, + EuiFormRow, + EuiFieldText, + EuiSwitch, } from '@elastic/eui'; import { MultiRowInput } from '../multi_row_input'; import { useStartServices } from '../../../../hooks'; import { FLYOUT_MAX_WIDTH } from '../../constants'; +import type { FleetServerHost } from '../../../../types'; import { useFleetServerHostsForm } from './use_fleet_server_host_form'; export interface FleetServerHostsFlyoutProps { onClose: () => void; - fleetServerHosts: string[]; + fleetServerHost?: FleetServerHost; } export const FleetServerHostsFlyout: React.FunctionComponent<FleetServerHostsFlyoutProps> = ({ onClose, - fleetServerHosts, + fleetServerHost, }) => { const { docLinks } = useStartServices(); - const form = useFleetServerHostsForm(fleetServerHosts, onClose); + const form = useFleetServerHostsForm(fleetServerHost, onClose); + const { inputs } = form; return ( <EuiFlyout maxWidth={FLYOUT_MAX_WIDTH} onClose={onClose}> <EuiFlyoutHeader hasBorder={true}> <EuiTitle size="m"> - <h2 id="FleetPackagePolicyPreviousVersionFlyoutTitle"> - <FormattedMessage - id="xpack.fleet.settings.fleetServerHostsFlyout.title" - defaultMessage="Fleet Server hosts" - /> + <h2> + {fleetServerHost ? ( + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostsFlyout.editTitle" + defaultMessage="Edit Fleet Server" + /> + ) : ( + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostsFlyout.addTitle" + defaultMessage="Add Fleet Server" + /> + )} </h2> </EuiTitle> </EuiFlyoutHeader> <EuiFlyoutBody> - <EuiText color="subdued"> - <FormattedMessage - id="xpack.fleet.settings.fleetServerHostsFlyout.description" - defaultMessage="Specify the URLs that your agents will use to connect to a Fleet Server. If multiple URLs exist, Fleet shows the first provided URL for enrollment purposes. Fleet Server uses port 8220 by default. Refer to the {link}." - values={{ - link: ( - <EuiLink - href={docLinks.links.fleet.settingsFleetServerHostSettings} - target="_blank" - external - > - <FormattedMessage - id="xpack.fleet.settings.fleetServerHostsFlyout.userGuideLink" - defaultMessage="Fleet and Elastic Agent Guide" - /> - </EuiLink> - ), - }} - /> - </EuiText> - <EuiSpacer size="m" /> - <MultiRowInput - {...form.fleetServerHostsInput.props} - id="fleet-server-inputs" - placeholder={i18n.translate( - 'xpack.fleet.settings.fleetServerHostsFlyout.fleetServerHostsInputPlaceholder', - { - defaultMessage: 'Specify host URL', + <EuiForm onSubmit={form.submit}> + <EuiFormRow + fullWidth + label={ + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostsFlyout.nameInputLabel" + defaultMessage="Name" + /> } - )} - /> + {...inputs.nameInput.formRowProps} + > + <EuiFieldText + data-test-subj="fleetServerHostsFlyout.nameInput" + fullWidth + {...inputs.nameInput.props} + placeholder={i18n.translate( + 'xpack.fleet.settings.fleetServerHostsFlyout.nameInputPlaceholder', + { + defaultMessage: 'Specify name', + } + )} + /> + </EuiFormRow> + <EuiFormRow + fullWidth + label={ + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostsFlyout.hostUrlLabel" + defaultMessage="URL" + /> + } + > + <> + <EuiText color="subdued" size="relative"> + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostsFlyout.description" + defaultMessage="Specify multiple URLs to scale out your deployment and provide automatic failover. If multiple URLs exist, Fleet shows the first provided URL for enrollment purposes. Enrolled Elastic Agents will connect to the URLs in round robin order until they connect successfully. For more information, see the {link} ." + values={{ + link: ( + <EuiLink + href={docLinks.links.fleet.settingsFleetServerHostSettings} + target="_blank" + external + > + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostsFlyout.userGuideLink" + defaultMessage="Fleet and Elastic Agent Guide" + /> + </EuiLink> + ), + }} + /> + </EuiText> + <EuiSpacer size="m" /> + <MultiRowInput + {...form.inputs.hostUrlsInput.props} + id="fleet-server-inputs" + placeholder={i18n.translate( + 'xpack.fleet.settings.fleetServerHostsFlyout.fleetServerHostsInputPlaceholder', + { + defaultMessage: 'Specify host URL', + } + )} + /> + </> + </EuiFormRow> + <EuiFormRow fullWidth {...inputs.isDefaultInput.formRowProps}> + <EuiSwitch + data-test-subj="fleetServerHostsFlyout.isDefaultSwitch" + {...inputs.isDefaultInput.props} + label={ + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostsFlyout.defaultOutputSwitchLabel" + defaultMessage="Make this Fleet server the default one." + /> + } + /> + </EuiFormRow> + </EuiForm> </EuiFlyoutBody> <EuiFlyoutFooter> <EuiFlexGroup justifyContent="spaceBetween"> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/use_fleet_server_host_form.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/use_fleet_server_host_form.test.tsx index aeb49928f3d1e..8df533f0206b7 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/use_fleet_server_host_form.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/use_fleet_server_host_form.test.tsx @@ -23,16 +23,16 @@ jest.mock('../../hooks/use_confirm_modal', () => ({ describe('useFleetServerHostsForm', () => { it('should not allow to submit an invalid form', async () => { const testRenderer = createFleetTestRendererMock(); - const onSucess = jest.fn(); - const { result } = testRenderer.renderHook(() => useFleetServerHostsForm([], onSucess)); + const onSuccess = jest.fn(); + const { result } = testRenderer.renderHook(() => useFleetServerHostsForm(undefined, onSuccess)); act(() => - result.current.fleetServerHostsInput.props.onChange(['https://test.fr', 'https://test.fr']) + result.current.inputs.hostUrlsInput.props.onChange(['https://test.fr', 'https://test.fr']) ); await act(() => result.current.submit()); - expect(result.current.fleetServerHostsInput.props.errors).toMatchInlineSnapshot(` + expect(result.current.inputs.hostUrlsInput.props.errors).toMatchInlineSnapshot(` Array [ Object { "index": 0, @@ -44,40 +44,62 @@ describe('useFleetServerHostsForm', () => { }, ] `); - expect(onSucess).not.toBeCalled(); + expect(onSuccess).not.toBeCalled(); expect(result.current.isDisabled).toBeTruthy(); }); it('should submit a valid form', async () => { const testRenderer = createFleetTestRendererMock(); - const onSucess = jest.fn(); + const onSuccess = jest.fn(); testRenderer.startServices.http.post.mockResolvedValue({}); - const { result } = testRenderer.renderHook(() => useFleetServerHostsForm([], onSucess)); + const { result } = testRenderer.renderHook(() => + useFleetServerHostsForm( + { + id: 'id1', + name: 'fleet server 1', + host_urls: [], + is_default: false, + is_preconfigured: false, + }, + onSuccess + ) + ); - act(() => result.current.fleetServerHostsInput.props.onChange(['https://test.fr'])); + act(() => result.current.inputs.hostUrlsInput.props.onChange(['https://test.fr'])); await act(() => result.current.submit()); - expect(onSucess).toBeCalled(); + expect(onSuccess).toBeCalled(); }); it('should allow the user to correct and submit a invalid form', async () => { const testRenderer = createFleetTestRendererMock(); - const onSucess = jest.fn(); + const onSuccess = jest.fn(); testRenderer.startServices.http.post.mockResolvedValue({}); - const { result } = testRenderer.renderHook(() => useFleetServerHostsForm([], onSucess)); + const { result } = testRenderer.renderHook(() => + useFleetServerHostsForm( + { + id: 'id1', + name: 'fleet server 1', + host_urls: [], + is_default: false, + is_preconfigured: false, + }, + onSuccess + ) + ); act(() => - result.current.fleetServerHostsInput.props.onChange(['https://test.fr', 'https://test.fr']) + result.current.inputs.hostUrlsInput.props.onChange(['https://test.fr', 'https://test.fr']) ); await act(() => result.current.submit()); - expect(onSucess).not.toBeCalled(); + expect(onSuccess).not.toBeCalled(); expect(result.current.isDisabled).toBeTruthy(); - act(() => result.current.fleetServerHostsInput.props.onChange(['https://test.fr'])); + act(() => result.current.inputs.hostUrlsInput.props.onChange(['https://test.fr'])); expect(result.current.isDisabled).toBeFalsy(); await act(() => result.current.submit()); - expect(onSucess).toBeCalled(); + expect(onSuccess).toBeCalled(); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/use_fleet_server_host_form.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/use_fleet_server_host_form.tsx index bfe6ffd044140..27d839dc7af59 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/use_fleet_server_host_form.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/use_fleet_server_host_form.tsx @@ -4,16 +4,23 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +// copy this one import React, { useCallback, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { sendPutSettings, useComboInput, useStartServices } from '../../../../hooks'; +import { + sendPostFleetServerHost, + sendPutFleetServerHost, + useComboInput, + useInput, + useStartServices, + useSwitchInput, +} from '../../../../hooks'; import { isDiffPathProtocol } from '../../../../../../../common/services'; import { useConfirmModal } from '../../hooks/use_confirm_modal'; -import { getAgentAndPolicyCount } from '../../services/agent_and_policies_count'; +import type { FleetServerHost } from '../../../../types'; const URL_REGEX = /^(https):\/\/[^\s$.?#].[^\s]*$/gm; @@ -24,46 +31,14 @@ const ConfirmTitle = () => ( /> ); -interface ConfirmDescriptionProps { - agentCount: number; - agentPolicyCount: number; -} - -const ConfirmDescription: React.FunctionComponent<ConfirmDescriptionProps> = ({ - agentCount, - agentPolicyCount, -}) => ( +const ConfirmDescription: React.FunctionComponent = ({}) => ( <FormattedMessage id="xpack.fleet.settings.fleetServerHostsFlyout.confirmModalText" - defaultMessage="This action will update {policies} and {agents}. This action can not be undone. Are you sure you wish to continue?" - values={{ - agents: ( - <strong> - <FormattedMessage - id="xpack.fleet.settings.fleetServerHostsFlyout.agentsCount" - defaultMessage="{agentCount, plural, one {# agent} other {# agents}}" - values={{ - agentCount, - }} - /> - </strong> - ), - policies: ( - <strong> - <FormattedMessage - id="xpack.fleet.settings.fleetServerHostsFlyout.agentPolicyCount" - defaultMessage="{agentPolicyCount, plural, one {# agent policy} other {# agent policies}}" - values={{ - agentPolicyCount, - }} - /> - </strong> - ), - }} + defaultMessage="This action will update agent policies enrolled in this Fleet Server. This action can not be undone. Are you sure you wish to continue?" /> ); -function validateFleetServerHosts(value: string[]) { +export function validateFleetServerHosts(value: string[]) { if (value.length === 0) { return [ { @@ -87,7 +62,7 @@ function validateFleetServerHosts(value: string[]) { } else if (!val.match(URL_REGEX)) { res.push({ message: i18n.translate('xpack.fleet.settings.fleetServerHostsError', { - defaultMessage: 'Invalid URL', + defaultMessage: 'Invalid URL (must be an https URL)', }), index: idx, }); @@ -127,24 +102,41 @@ function validateFleetServerHosts(value: string[]) { } } +export function validateName(value: string) { + if (!value || value === '') { + return [ + i18n.translate('xpack.fleet.settings.fleetServerHost.nameIsRequiredErrorMessage', { + defaultMessage: 'Name is required', + }), + ]; + } +} + export function useFleetServerHostsForm( - fleetServerHostsDefaultValue: string[], + fleetServerHost: FleetServerHost | undefined, onSuccess: () => void ) { const [isLoading, setIsLoading] = useState(false); const { notifications } = useStartServices(); const { confirm } = useConfirmModal(); + const isPreconfigured = fleetServerHost?.is_preconfigured ?? false; - const fleetServerHostsInput = useComboInput( - 'fleetServerHostsInput', - fleetServerHostsDefaultValue, - validateFleetServerHosts + const nameInput = useInput(fleetServerHost?.name ?? '', validateName, isPreconfigured); + const isDefaultInput = useSwitchInput( + fleetServerHost?.is_default ?? false, + isPreconfigured || fleetServerHost?.is_default + ); + + const hostUrlsInput = useComboInput( + 'hostUrls', + fleetServerHost?.host_urls || [], + validateFleetServerHosts, + isPreconfigured ); - const fleetServerHostsInputValidate = fleetServerHostsInput.validate; const validate = useCallback( - () => fleetServerHostsInputValidate(), - [fleetServerHostsInputValidate] + () => hostUrlsInput.validate() && nameInput.validate(), + [hostUrlsInput, nameInput] ); const submit = useCallback(async () => { @@ -152,46 +144,69 @@ export function useFleetServerHostsForm( if (!validate()) { return; } - const { agentCount, agentPolicyCount } = await getAgentAndPolicyCount(); - if ( - !(await confirm( - <ConfirmTitle />, - <ConfirmDescription agentCount={agentCount} agentPolicyCount={agentPolicyCount} /> - )) - ) { + if (!(await confirm(<ConfirmTitle />, <ConfirmDescription />))) { return; } setIsLoading(true); - const settingsResponse = await sendPutSettings({ - fleet_server_hosts: fleetServerHostsInput.value, - }); - if (settingsResponse.error) { - throw settingsResponse.error; + if (fleetServerHost) { + const res = await sendPutFleetServerHost(fleetServerHost.id, { + name: nameInput.value, + host_urls: hostUrlsInput.value, + is_default: isDefaultInput.value, + }); + if (res.error) { + throw res.error; + } + } else { + const res = await sendPostFleetServerHost({ + name: nameInput.value, + host_urls: hostUrlsInput.value, + is_default: isDefaultInput.value, + }); + if (res.error) { + throw res.error; + } } notifications.toasts.addSuccess( i18n.translate('xpack.fleet.settings.fleetServerHostsFlyout.successToastTitle', { - defaultMessage: 'Settings saved', + defaultMessage: 'Fleet Server host saved', }) ); setIsLoading(false); - onSuccess(); + await onSuccess(); } catch (error) { setIsLoading(false); notifications.toasts.addError(error, { title: i18n.translate('xpack.fleet.settings.fleetServerHostsFlyout.errorToastTitle', { - defaultMessage: 'An error happened while saving settings', + defaultMessage: 'An error happened while saving Fleet Server host', }), }); } - }, [fleetServerHostsInput.value, validate, notifications, confirm, onSuccess]); + }, [ + fleetServerHost, + nameInput.value, + hostUrlsInput.value, + isDefaultInput.value, + validate, + notifications, + confirm, + onSuccess, + ]); const isDisabled = - isLoading || !fleetServerHostsInput.hasChanged || fleetServerHostsInput.props.isInvalid; + isLoading || + (!hostUrlsInput.hasChanged && !isDefaultInput.hasChanged && !nameInput.hasChanged) || + hostUrlsInput.props.isInvalid || + nameInput.props.isInvalid; return { isLoading, isDisabled, submit, - fleetServerHostsInput, + inputs: { + hostUrlsInput, + nameInput, + isDefaultInput, + }, }; } diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_table/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_table/index.tsx new file mode 100644 index 0000000000000..053baaf4e4f8a --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_table/index.tsx @@ -0,0 +1,156 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 styled from 'styled-components'; + +import { + EuiBasicTable, + EuiFlexGroup, + EuiFlexItem, + EuiIconTip, + EuiIcon, + EuiButtonIcon, +} from '@elastic/eui'; +import type { EuiBasicTableColumn } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +import type { FleetServerHost } from '../../../../types'; +import { useLink } from '../../../../hooks'; + +export interface FleetServerHostsTableProps { + fleetServerHosts: FleetServerHost[]; + deleteFleetServerHost: (fleetServerHost: FleetServerHost) => void; +} + +const NameFlexItemWithMaxWidth = styled(EuiFlexItem)` + max-width: 250px; +`; + +// Allow child to be truncated +const FlexGroupWithMinWidth = styled(EuiFlexGroup)` + min-width: 0px; +`; + +export const FleetServerHostsTable: React.FunctionComponent<FleetServerHostsTableProps> = ({ + fleetServerHosts, + deleteFleetServerHost, +}) => { + const { getHref } = useLink(); + + const columns = useMemo((): Array<EuiBasicTableColumn<FleetServerHost>> => { + return [ + { + render: (fleetServerHost: FleetServerHost) => ( + <EuiFlexGroup alignItems="center" gutterSize="xs"> + <NameFlexItemWithMaxWidth grow={false}> + <p title={fleetServerHost.name} className={`eui-textTruncate`}> + {fleetServerHost.name} + </p> + </NameFlexItemWithMaxWidth> + {fleetServerHost.is_preconfigured && ( + <EuiFlexItem grow={false}> + <EuiIconTip + content={i18n.translate( + 'xpack.fleet.settings.fleetServerHostsTable.managedTooltip', + { + defaultMessage: + 'This Fleet server host is managed outside of Fleet. Please refer to your kibana config file for more info.', + } + )} + type="lock" + size="m" + color="subdued" + /> + </EuiFlexItem> + )} + </EuiFlexGroup> + ), + width: '288px', + name: i18n.translate('xpack.fleet.settings.fleetServerHostsTable.nameColumnTitle', { + defaultMessage: 'Name', + }), + }, + { + truncateText: true, + field: 'host_urls', + render: (urls: string[]) => ( + <FlexGroupWithMinWidth direction="column" gutterSize="xs"> + {urls.map((url) => ( + <EuiFlexItem key={url}> + <p title={url} className={`eui-textTruncate`}> + {url} + </p> + </EuiFlexItem> + ))} + </FlexGroupWithMinWidth> + ), + name: i18n.translate('xpack.fleet.settings.fleetServerHostsTable.hostUrlsColumnTitle', { + defaultMessage: 'Host URLs', + }), + }, + { + render: (fleetServerHost: FleetServerHost) => + fleetServerHost.is_default ? ( + <EuiIcon type="check" data-test-subj="fleetServerHostTable.defaultIcon" /> + ) : null, + width: '200px', + name: i18n.translate('xpack.fleet.settings.fleetServerHostsTable.defaultColumnTitle', { + defaultMessage: 'Default', + }), + }, + { + width: '68px', + render: (fleetServerHost: FleetServerHost) => { + const isDeleteVisible = !fleetServerHost.is_default && !fleetServerHost.is_preconfigured; + + return ( + <EuiFlexGroup gutterSize="s" justifyContent="flexEnd"> + <EuiFlexItem grow={false}> + {isDeleteVisible && ( + <EuiButtonIcon + color="text" + iconType="trash" + onClick={() => deleteFleetServerHost(fleetServerHost)} + title={i18n.translate( + 'xpack.fleet.settings.fleetServerHostsTable.deleteButtonTitle', + { + defaultMessage: 'Delete', + } + )} + data-test-subj="fleetServerHostsTable.delete.btn" + /> + )} + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButtonIcon + color="text" + iconType="pencil" + href={getHref('settings_edit_fleet_server_hosts', { + itemId: fleetServerHost.id, + })} + title={i18n.translate( + 'xpack.fleet.settings.fleetServerHostsTable.editButtonTitle', + { + defaultMessage: 'Edit', + } + )} + data-test-subj="fleetServerHostsTable.edit.btn" + /> + </EuiFlexItem> + </EuiFlexGroup> + ); + }, + name: i18n.translate('xpack.fleet.settings.fleetServerHostsTable.actionsColumnTitle', { + defaultMessage: 'Actions', + }), + }, + ]; + }, [getHref, deleteFleetServerHost]); + + return <EuiBasicTable columns={columns} items={fleetServerHosts} />; +}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/multi_row_input/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/multi_row_input/index.tsx index 8bb0a565be040..35165beefca45 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/multi_row_input/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/multi_row_input/index.tsx @@ -373,6 +373,7 @@ export const MultiRowInput: FunctionComponent<MultiRowInputProps> = ({ {displayErrors(globalErrors)} <EuiSpacer size="m" /> <EuiButtonEmpty + data-test-subj="fleetServerHosts.multiRowInput.addRowButton" disabled={disabled} size="xs" flush="left" diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/fleet_server_hosts_section.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/fleet_server_hosts_section.tsx new file mode 100644 index 0000000000000..1114efb814a21 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/fleet_server_hosts_section.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 from 'react'; + +import { EuiTitle, EuiLink, EuiText, EuiSpacer, EuiButtonEmpty } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import type { FleetServerHost } from '../../../../types'; +import { useLink, useStartServices } from '../../../../hooks'; +import { FleetServerHostsTable } from '../fleet_server_hosts_table'; + +export interface FleetServerHostsSectionProps { + fleetServerHosts: FleetServerHost[]; + deleteFleetServerHost: (fleetServerHost: FleetServerHost) => void; +} + +export const FleetServerHostsSection: React.FunctionComponent<FleetServerHostsSectionProps> = ({ + fleetServerHosts, + deleteFleetServerHost, +}) => { + const { docLinks } = useStartServices(); + const { getHref } = useLink(); + + return ( + <> + <EuiTitle size="s"> + <h4 data-test-subj="fleetServerHostHeader"> + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostSectionTitle" + defaultMessage="Fleet server hosts" + /> + </h4> + </EuiTitle> + <EuiSpacer size="xs" /> + <EuiText color="subdued" size="m"> + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostSectionSubtitle" + defaultMessage="Specify the URLs that your agents will use to connect to a Fleet Server. If multiple URLs exist, Fleet will show the first provided URL for enrollment purposes. For more information, see the {guideLink} ." + values={{ + guideLink: ( + <EuiLink href={docLinks.links.fleet.guide} target="_blank" external> + <FormattedMessage + id="xpack.fleet.settings.fleetUserGuideLink" + defaultMessage="Fleet and Elastic Agent Guide" + /> + </EuiLink> + ), + }} + /> + </EuiText> + <EuiSpacer size="m" /> + <FleetServerHostsTable + fleetServerHosts={fleetServerHosts} + deleteFleetServerHost={deleteFleetServerHost} + /> + <EuiSpacer size="s" /> + <EuiButtonEmpty + iconType="plusInCircle" + href={getHref('settings_create_fleet_server_hosts')} + data-test-subj="settings.fleetServerHosts.addFleetServerHostBtn" + > + <FormattedMessage + id="xpack.fleet.settings.fleetServerHostCreateButtonLabel" + defaultMessage="Add Fleet Server" + /> + </EuiButtonEmpty> + <EuiSpacer size="m" /> + </> + ); +}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/index.tsx index 4c5db21725639..613221600b99b 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/index.tsx @@ -8,31 +8,36 @@ import React from 'react'; import { EuiSpacer } from '@elastic/eui'; -import type { Output, Settings, DownloadSource } from '../../../../types'; +import type { Output, DownloadSource, FleetServerHost } from '../../../../types'; -import { SettingsSection } from './settings_section'; +import { FleetServerHostsSection } from './fleet_server_hosts_section'; import { OutputSection } from './output_section'; import { AgentBinarySection } from './agent_binary_section'; export interface SettingsPageProps { - settings: Settings; outputs: Output[]; + fleetServerHosts: FleetServerHost[]; deleteOutput: (output: Output) => void; + deleteFleetServerHost: (fleetServerHost: FleetServerHost) => void; downloadSources: DownloadSource[]; deleteDownloadSource: (ds: DownloadSource) => void; } export const SettingsPage: React.FunctionComponent<SettingsPageProps> = ({ - settings, outputs, + fleetServerHosts, deleteOutput, + deleteFleetServerHost, downloadSources, deleteDownloadSource, }) => { return ( <> <EuiSpacer size="m" /> - <SettingsSection settings={settings} /> + <FleetServerHostsSection + fleetServerHosts={fleetServerHosts} + deleteFleetServerHost={deleteFleetServerHost} + /> <EuiSpacer size="m" /> <OutputSection outputs={outputs} deleteOutput={deleteOutput} /> <EuiSpacer size="m" /> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/settings_section.stories.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/settings_section.stories.tsx deleted file mode 100644 index 9eab2479b901a..0000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/settings_section.stories.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 { SettingsSection as Component } from './settings_section'; - -export default { - component: Component, - title: 'Sections/Fleet/Settings', -}; - -interface Args { - width: number; - fleetServerHosts: string[]; -} - -const args: Args = { - width: 1200, - fleetServerHosts: [ - 'https://myfleetserver:8220', - 'https://alongerfleetserverwithaverylongname:8220', - ], -}; - -export const SettingsSection = ({ width, fleetServerHosts }: Args) => { - return ( - <div style={{ width }}> - <Component - settings={{ - id: 'default-settings', - fleet_server_hosts: fleetServerHosts, - preconfigured_fields: [], - }} - /> - </div> - ); -}; - -SettingsSection.args = args; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/settings_section.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/settings_section.tsx deleted file mode 100644 index bf471a0acd30a..0000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/settings_section.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 { - EuiTitle, - EuiLink, - EuiText, - EuiSpacer, - EuiBasicTable, - EuiButtonEmpty, - EuiToolTip, -} from '@elastic/eui'; -import type { EuiBasicTableColumn } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { i18n } from '@kbn/i18n'; - -import type { Settings } from '../../../../types'; -import { useLink, useStartServices } from '../../../../hooks'; - -export interface SettingsSectionProps { - settings: Settings; -} - -export const SettingsSection: React.FunctionComponent<SettingsSectionProps> = ({ settings }) => { - const { docLinks } = useStartServices(); - const { getHref } = useLink(); - - const columns = useMemo((): Array<EuiBasicTableColumn<string>> => { - return [ - { - render: (host: string) => host, - name: i18n.translate('xpack.fleet.settings.fleetServerHostUrlColumnTitle', { - defaultMessage: 'Host URL', - }), - }, - ]; - }, []); - - const isEditDisabled = settings.preconfigured_fields?.includes('fleet_server_hosts') ?? false; - const BtnWrapper = useMemo((): React.FunctionComponent => { - if (!isEditDisabled) { - return ({ children }) => <>{children}</>; - } - - return ({ children }) => ( - <EuiToolTip - content={ - <FormattedMessage - id="xpack.fleet.settings.fleetServerHostsPreconfiguredTooltipContent" - defaultMessage="Fleet Server hosts are configured outside of Fleet. Refer to your kibana config for more details." - /> - } - > - <>{children}</> - </EuiToolTip> - ); - }, [isEditDisabled]); - - return ( - <> - <EuiTitle size="s"> - <h4 data-test-subj="fleetServerHostHeader"> - <FormattedMessage - id="xpack.fleet.settings.fleetServerHostSectionTitle" - defaultMessage="Fleet server hosts" - /> - </h4> - </EuiTitle> - <EuiSpacer size="xs" /> - <EuiText color="subdued" size="m"> - <FormattedMessage - id="xpack.fleet.settings.fleetServerHostSectionSubtitle" - defaultMessage="Specify the URLs that your agents will use to connect to a Fleet Server. If multiple URLs exist, Fleet will show the first provided URL for enrollment purposes. For more information, see the {guideLink} ." - values={{ - guideLink: ( - <EuiLink href={docLinks.links.fleet.guide} target="_blank" external> - <FormattedMessage - id="xpack.fleet.settings.fleetUserGuideLink" - defaultMessage="Fleet and Elastic Agent Guide" - /> - </EuiLink> - ), - }} - /> - </EuiText> - <EuiSpacer size="m" /> - <EuiBasicTable columns={columns} items={settings.fleet_server_hosts} /> - <EuiSpacer size="s" /> - <BtnWrapper> - <EuiButtonEmpty - iconType="pencil" - href={getHref('settings_edit_fleet_server_hosts')} - data-test-subj="editHostsBtn" - disabled={isEditDisabled} - > - <FormattedMessage - id="xpack.fleet.settings.fleetServerHostEditButtonLabel" - defaultMessage="Edit hosts" - /> - </EuiButtonEmpty> - </BtnWrapper> - <EuiSpacer size="m" /> - </> - ); -}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/index.tsx new file mode 100644 index 0000000000000..1fec1c76430eb --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/index.tsx @@ -0,0 +1,6 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/use_delete_fleet_server_host.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/use_delete_fleet_server_host.tsx new file mode 100644 index 0000000000000..7c2046a01e517 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/use_delete_fleet_server_host.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, { useCallback } from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; + +import { sendDeleteFleetServerHost, useStartServices } from '../../../hooks'; +import type { FleetServerHost } from '../../../types'; + +import { useConfirmModal } from './use_confirm_modal'; + +const ConfirmTitle = () => ( + <FormattedMessage + id="xpack.fleet.settings.deleteFleetServerHosts.confirmModalTitle" + defaultMessage="Delete and deploy changes?" + /> +); + +const ConfirmDescription: React.FunctionComponent = ({}) => ( + <FormattedMessage + id="xpack.fleet.settings.deleteFleetServerHosts.confirmModalText" + defaultMessage="This action will change agent policies currently enrolled in this Fleet Server, to instead enroll in your default Fleet server. Are you sure you wish to continue?" + /> +); + +export function useDeleteFleetServerHost(onSuccess: () => void) { + const { confirm } = useConfirmModal(); + const { notifications } = useStartServices(); + const deleteFleetServerHost = useCallback( + async (fleetServerHost: FleetServerHost) => { + try { + const isConfirmed = await confirm(<ConfirmTitle />, <ConfirmDescription />, { + buttonColor: 'danger', + confirmButtonText: i18n.translate( + 'xpack.fleet.settings.deleteFleetServerHosts.confirmButtonLabel', + { + defaultMessage: 'Delete and deploy changes', + } + ), + }); + + if (!isConfirmed) { + return; + } + + const res = await sendDeleteFleetServerHost(fleetServerHost.id); + + if (res.error) { + throw res.error; + } + + onSuccess(); + } catch (err) { + notifications.toasts.addError(err, { + title: i18n.translate('xpack.fleet.settings.deleteFleetServerHosts.errorToastTitle', { + defaultMessage: 'Error deleting Fleet Server hosts', + }), + }); + } + }, + [confirm, notifications.toasts, onSuccess] + ); + + return { deleteFleetServerHost }; +} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/index.tsx index 7a94d9ef4bc79..fde10e18a67c5 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/index.tsx @@ -9,16 +9,25 @@ import React, { useCallback } from 'react'; import { EuiPortal } from '@elastic/eui'; import { Router, Route, Switch, useHistory, Redirect } from 'react-router-dom'; -import { useBreadcrumbs, useGetOutputs, useGetSettings, useGetDownloadSources } from '../../hooks'; +import { + useBreadcrumbs, + useGetOutputs, + useGetDownloadSources, + useGetFleetServerHosts, + useFlyoutContext, +} from '../../hooks'; import { FLEET_ROUTING_PATHS, pagePathGetters } from '../../constants'; import { DefaultLayout } from '../../layouts'; import { Loading } from '../../components'; +import { FleetServerFlyout } from '../../components'; + import { SettingsPage } from './components/settings_page'; import { withConfirmModalProvider } from './hooks/use_confirm_modal'; import { FleetServerHostsFlyout } from './components/fleet_server_hosts_flyout'; import { EditOutputFlyout } from './components/edit_output_flyout'; import { useDeleteOutput } from './hooks/use_delete_output'; +import { useDeleteFleetServerHost } from './hooks/use_delete_fleet_server_host'; import { EditDownloadSourceFlyout } from './components/download_source_flyout'; import { useDeleteDownloadSource } from './components/download_source_flyout/use_delete_download_source'; @@ -26,29 +35,38 @@ export const SettingsApp = withConfirmModalProvider(() => { useBreadcrumbs('settings'); const history = useHistory(); - const settings = useGetSettings(); const outputs = useGetOutputs(); + const fleetServerHosts = useGetFleetServerHosts(); const downloadSources = useGetDownloadSources(); + const flyoutContext = useFlyoutContext(); const { deleteOutput } = useDeleteOutput(outputs.resendRequest); const { deleteDownloadSource } = useDeleteDownloadSource(downloadSources.resendRequest); + const { deleteFleetServerHost } = useDeleteFleetServerHost(fleetServerHosts.resendRequest); - const resendSettingsRequest = settings.resendRequest; const resendOutputRequest = outputs.resendRequest; const resendDownloadSourceRequest = downloadSources.resendRequest; + const resendFleetServerHostsRequest = fleetServerHosts.resendRequest; const onCloseCallback = useCallback(() => { - resendSettingsRequest(); + flyoutContext.closeFleetServerFlyout(); resendOutputRequest(); resendDownloadSourceRequest(); + resendFleetServerHostsRequest(); history.replace(pagePathGetters.settings()[1]); - }, [resendSettingsRequest, resendOutputRequest, resendDownloadSourceRequest, history]); + }, [ + flyoutContext, + resendOutputRequest, + resendDownloadSourceRequest, + resendFleetServerHostsRequest, + history, + ]); if ( - (settings.isLoading && settings.isInitialRequest) || - !settings.data?.item || (outputs.isLoading && outputs.isInitialRequest) || !outputs.data?.items || + (fleetServerHosts.isLoading && fleetServerHosts.isInitialRequest) || + !fleetServerHosts.data?.items || (downloadSources.isLoading && downloadSources.isInitialRequest) || !downloadSources.data?.items ) { @@ -64,11 +82,27 @@ export const SettingsApp = withConfirmModalProvider(() => { <Router history={history}> <Switch> <Route path={FLEET_ROUTING_PATHS.settings_edit_fleet_server_hosts}> + {(route: { match: { params: { itemId: string } } }) => { + const fleetServerHost = fleetServerHosts.data?.items.find( + (o) => route.match.params.itemId === o.id + ); + if (!fleetServerHost) { + return <Redirect to={FLEET_ROUTING_PATHS.settings} />; + } + + return ( + <EuiPortal> + <FleetServerHostsFlyout + onClose={onCloseCallback} + fleetServerHost={fleetServerHost} + /> + </EuiPortal> + ); + }} + </Route> + <Route path={FLEET_ROUTING_PATHS.settings_create_fleet_server_hosts}> <EuiPortal> - <FleetServerHostsFlyout - onClose={onCloseCallback} - fleetServerHosts={settings.data?.item.fleet_server_hosts ?? []} - /> + <FleetServerFlyout onClose={onCloseCallback} /> </EuiPortal> </Route> <Route path={FLEET_ROUTING_PATHS.settings_create_outputs}> @@ -117,9 +151,10 @@ export const SettingsApp = withConfirmModalProvider(() => { </Switch> </Router> <SettingsPage - settings={settings.data.item} outputs={outputs.data.items} + fleetServerHosts={fleetServerHosts.data.items} deleteOutput={deleteOutput} + deleteFleetServerHost={deleteFleetServerHost} downloadSources={downloadSources.data.items} deleteDownloadSource={deleteDownloadSource} /> diff --git a/x-pack/plugins/fleet/public/applications/integrations/hooks/index.ts b/x-pack/plugins/fleet/public/applications/integrations/hooks/index.ts index 5b6b19af169f0..76b6b49c8c5cb 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/hooks/index.ts +++ b/x-pack/plugins/fleet/public/applications/integrations/hooks/index.ts @@ -14,3 +14,5 @@ export * from './use_agent_policy_context'; export * from './use_integrations_state'; export * from './use_confirm_force_install'; export * from './use_confirm_open_unverified'; +export * from './use_packages'; +export * from './use_categories'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/hooks/use_categories.tsx b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_categories.tsx new file mode 100644 index 0000000000000..abc601a3ceeb2 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_categories.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 { useEffect, useCallback, useState } from 'react'; + +import type { RequestError } from '../../fleet/hooks'; +import { sendGetCategories } from '../../fleet/hooks'; +import type { GetCategoriesResponse } from '../types'; + +export function useCategories(prerelease?: boolean) { + const [data, setData] = useState<GetCategoriesResponse | undefined>(); + const [error, setError] = useState<RequestError | undefined>(); + const [isLoading, setIsLoading] = useState(true); + const [isPrereleaseEnabled, setIsPrereleaseEnabled] = useState(prerelease); + + const fetchData = useCallback(async () => { + if (prerelease === undefined) { + return; + } + if (isPrereleaseEnabled === prerelease) { + return; + } + setIsPrereleaseEnabled(prerelease); + setIsLoading(true); + try { + const res = await sendGetCategories({ + include_policy_templates: true, + prerelease, + }); + if (res.error) { + throw res.error; + } + if (res.data) { + setData(res.data); + } + } catch (err) { + setError(err); + } + setIsLoading(false); + }, [prerelease, isPrereleaseEnabled]); + + useEffect(() => { + fetchData(); + }, [fetchData]); + + return { + data, + error, + isLoading, + }; +} diff --git a/x-pack/plugins/fleet/public/applications/integrations/hooks/use_packages.tsx b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_packages.tsx new file mode 100644 index 0000000000000..c2dfa7e7406fa --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_packages.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 { useEffect, useCallback, useState } from 'react'; + +import type { RequestError } from '../../fleet/hooks'; +import { sendGetPackages } from '../../fleet/hooks'; +import type { GetPackagesResponse } from '../types'; + +export function usePackages(prerelease?: boolean) { + const [data, setData] = useState<GetPackagesResponse | undefined>(); + const [error, setError] = useState<RequestError | undefined>(); + const [isLoading, setIsLoading] = useState(true); + const [isPrereleaseEnabled, setIsPrereleaseEnabled] = useState(prerelease); + + const fetchData = useCallback(async () => { + if (prerelease === undefined) { + return; + } + if (isPrereleaseEnabled === prerelease) { + return; + } + setIsPrereleaseEnabled(prerelease); + setIsLoading(true); + try { + const res = await sendGetPackages({ + category: '', + excludeInstallStatus: true, + prerelease, + }); + if (res.error) { + throw res.error; + } + if (res.data) { + setData(res.data); + } + } catch (err) { + setError(err); + } + setIsLoading(false); + }, [prerelease, isPrereleaseEnabled]); + + useEffect(() => { + fetchData(); + }, [fetchData]); + + return { + data, + error, + isLoading, + }; +} diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.stories.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.stories.tsx index 86b34f2415e2e..ebc18d84487db 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.stories.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.stories.tsx @@ -32,5 +32,11 @@ export default { } as Meta; export const IntegrationPreference = () => { - return <Component initialType="recommended" onChange={action('onChange')} />; + return ( + <Component + initialType="recommended" + onChange={action('onChange')} + onPrereleaseEnabledChange={() => {}} + /> + ); }; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx index b99683adbf8f4..4e4aafa271b3b 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React from 'react'; +import React, { useCallback, useEffect } from 'react'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; @@ -20,9 +20,10 @@ import { EuiIconTip, EuiFlexGroup, EuiFlexItem, + EuiSwitch, } from '@elastic/eui'; -import { useStartServices } from '../../../hooks'; +import { sendPutSettings, useGetSettings, useStartServices } from '../../../hooks'; export type IntegrationPreferenceType = 'recommended' | 'beats' | 'agent'; @@ -34,6 +35,7 @@ interface Option { export interface Props { initialType: IntegrationPreferenceType; onChange: (type: IntegrationPreferenceType) => void; + onPrereleaseEnabledChange: (prerelease: boolean) => void; } const recommendedTooltip = ( @@ -47,6 +49,10 @@ const Item = styled(EuiFlexItem)` padding-left: ${(props) => props.theme.eui.euiSizeXS}; `; +const EuiSwitchNoWrap = styled(EuiSwitch)` + white-space: nowrap; +`; + const options: Option[] = [ { type: 'recommended', @@ -77,11 +83,46 @@ const options: Option[] = [ }, ]; -export const IntegrationPreference = ({ initialType, onChange }: Props) => { +export const IntegrationPreference = ({ + initialType, + onChange, + onPrereleaseEnabledChange, +}: Props) => { const [idSelected, setIdSelected] = React.useState<IntegrationPreferenceType>(initialType); const { docLinks } = useStartServices(); + const [prereleaseIntegrationsEnabled, setPrereleaseIntegrationsEnabled] = React.useState< + boolean | undefined + >(undefined); + + const { data: settings, error: settingsError } = useGetSettings(); + + useEffect(() => { + const isEnabled = Boolean(settings?.item.prerelease_integrations_enabled); + if (settings?.item) { + setPrereleaseIntegrationsEnabled(isEnabled); + } else if (settingsError) { + setPrereleaseIntegrationsEnabled(false); + } + }, [settings?.item, settingsError]); + + useEffect(() => { + if (prereleaseIntegrationsEnabled !== undefined) { + onPrereleaseEnabledChange(prereleaseIntegrationsEnabled); + } + }, [onPrereleaseEnabledChange, prereleaseIntegrationsEnabled]); + + const updateSettings = useCallback(async (prerelease: boolean) => { + const res = await sendPutSettings({ + prerelease_integrations_enabled: prerelease, + }); + + if (res.error) { + throw res.error; + } + }, []); + const link = ( <EuiLink href={docLinks.links.fleet.beatsAgentComparison}> <FormattedMessage @@ -105,8 +146,28 @@ export const IntegrationPreference = ({ initialType, onChange }: Props) => { label: option.label, })); + const onPrereleaseSwitchChange = ( + event: React.BaseSyntheticEvent< + React.MouseEvent<HTMLButtonElement>, + HTMLButtonElement, + EventTarget & { checked: boolean } + > + ) => { + const isChecked = event.target.checked; + setPrereleaseIntegrationsEnabled(isChecked); + updateSettings(isChecked); + }; + return ( <EuiPanel hasShadow={false} paddingSize="none"> + {prereleaseIntegrationsEnabled !== undefined && ( + <EuiSwitchNoWrap + label="Display beta integrations" + checked={prereleaseIntegrationsEnabled} + onChange={onPrereleaseSwitchChange} + /> + )} + <EuiSpacer size="l" /> <EuiText size="s">{title}</EuiText> <EuiSpacer size="m" /> <EuiForm> diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.stories.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.stories.tsx index dee9dfbe4d42b..f17ca41ef41b4 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.stories.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.stories.tsx @@ -36,7 +36,7 @@ const argTypes = { release: { control: { type: 'radio', - options: ['ga', 'beta', 'experimental'], + options: ['ga', 'beta', 'preview', 'rc'], }, }, isUnverified: { diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.test.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.test.tsx index fa76b0e7932fb..2abfb3168cdb1 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.test.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.test.tsx @@ -25,6 +25,16 @@ jest.mock('../../../hooks', () => { navigateToUrl: jest.fn(), }, }), + useIsGuidedOnboardingActive: jest.fn().mockReturnValue(false), + }; +}); + +jest.mock('../../../components', () => { + return { + ...jest.requireActual('../../../components'), + WithGuidedOnboardingTour: ({ children }: { children: React.ReactNode }) => { + return <>{children}</>; + }, }; }); diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.tsx index a37fdcf5533c8..553731bb3fd36 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.tsx @@ -16,8 +16,8 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { CardIcon } from '../../../../../components/package_icon'; import type { IntegrationCardItem } from '../../../../../../common/types/models/epm'; -import { InlineReleaseBadge } from '../../../components'; -import { useStartServices } from '../../../hooks'; +import { InlineReleaseBadge, WithGuidedOnboardingTour } from '../../../components'; +import { useStartServices, useIsGuidedOnboardingActive } from '../../../hooks'; import { INTEGRATIONS_BASE_PATH, INTEGRATIONS_PLUGIN_ID } from '../../../constants'; export type PackageCardProps = IntegrationCardItem; @@ -74,6 +74,7 @@ export function PackageCard({ } const { application } = useStartServices(); + const isGuidedOnboardingActive = useIsGuidedOnboardingActive(name); const onCardClick = () => { if (url.startsWith(INTEGRATIONS_BASE_PATH)) { @@ -90,30 +91,37 @@ export function PackageCard({ const testid = `integration-card:${id}`; return ( - <TrackApplicationView viewId={testid}> - <Card - data-test-subj={testid} - layout="horizontal" - title={title || ''} - titleSize="xs" - description={description} - hasBorder - icon={ - <CardIcon - icons={icons} - packageName={name} - integrationName={integration} - version={version} - size="xl" - /> - } - onClick={onCardClick} - > - <EuiFlexGroup gutterSize="xs"> - {verifiedBadge} - {releaseBadge} - </EuiFlexGroup> - </Card> - </TrackApplicationView> + <WithGuidedOnboardingTour + packageKey={name} + isTourVisible={isGuidedOnboardingActive} + tourType={'integrationCard'} + tourOffset={10} + > + <TrackApplicationView viewId={testid}> + <Card + data-test-subj={testid} + layout="horizontal" + title={title || ''} + titleSize="xs" + description={description} + hasBorder + icon={ + <CardIcon + icons={icons} + packageName={name} + integrationName={integration} + version={version} + size="xl" + /> + } + onClick={onCardClick} + > + <EuiFlexGroup gutterSize="xs"> + {verifiedBadge} + {releaseBadge} + </EuiFlexGroup> + </Card> + </TrackApplicationView> + </WithGuidedOnboardingTour> ); } diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.stories.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.stories.tsx index 0e746d8ca8195..aa472212940a3 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.stories.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.stories.tsx @@ -74,7 +74,7 @@ export const List = (props: Args) => ( name: 'aws', release: 'beta', id: 'package_two', - version: '1.0.0', + version: '1.0.0-beta', url: 'https://example.com', icons: [], integration: 'integration', @@ -84,9 +84,9 @@ export const List = (props: Args) => ( title: 'Package Three', description: 'Not Installed Description', name: 'azure', - release: 'experimental', + release: 'preview', id: 'package_three', - version: '1.0.0', + version: '0.1.0', url: 'https://example.com', icons: [], integration: 'integration', @@ -110,7 +110,7 @@ export const List = (props: Args) => ( name: 'unknown', release: 'beta', id: 'package_five', - version: '1.0.0', + version: '1.0.0-beta', url: 'https://example.com', icons: [], integration: 'integration', @@ -120,9 +120,9 @@ export const List = (props: Args) => ( title: 'Package Six', description: 'Installed Description', name: 'kibana', - release: 'experimental', + release: 'preview', id: 'package_six', - version: '1.0.0', + version: '0.1.0', url: 'https://example.com', icons: [], integration: 'integration', diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx index 49a8cbeb37d21..cb03f5321e578 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx @@ -17,6 +17,7 @@ import type { GetInfoResponse, GetPackagePoliciesResponse, GetStatsResponse, + GetSettingsResponse, } from '../../../../../../../common/types/rest_spec'; import type { DetailViewPanelName, @@ -79,11 +80,23 @@ describe('when on integration detail', () => { }); }); - describe('and the package is not installed', () => { + function mockGAAndPrereleaseVersions(pkgVersion: string) { + const unInstalledPackage = mockedApi.responseProvider.epmGetInfo('nginx'); + unInstalledPackage.item.status = 'not_installed'; + unInstalledPackage.item.version = pkgVersion; + mockedApi.responseProvider.epmGetInfo.mockImplementation((name, version, query) => { + if (query?.prerelease === false) { + const gaPackage = { item: { ...unInstalledPackage.item } }; + gaPackage.item.version = '1.0.0'; + return gaPackage; + } + return unInstalledPackage; + }); + } + + describe('and the package is not installed and prerelease enabled', () => { beforeEach(async () => { - const unInstalledPackage = mockedApi.responseProvider.epmGetInfo(); - unInstalledPackage.item.status = 'not_installed'; - mockedApi.responseProvider.epmGetInfo.mockReturnValue(unInstalledPackage); + mockGAAndPrereleaseVersions('1.0.0-beta'); await render(); }); @@ -96,6 +109,39 @@ describe('when on integration detail', () => { await mockedApi.waitForApi(); expect(renderResult.queryByTestId('tab-policies')).toBeNull(); }); + + it('should display version select if prerelease setting enabled and prererelase version available', async () => { + await mockedApi.waitForApi(); + const versionSelect = renderResult.queryByTestId('versionSelect'); + expect(versionSelect?.textContent).toEqual('1.0.0-beta1.0.0'); + expect((versionSelect as any)?.value).toEqual('1.0.0-beta'); + }); + + it('should display prerelease callout if prerelease setting enabled and prerelease version available', async () => { + await mockedApi.waitForApi(); + const calloutTitle = renderResult.getByTestId('prereleaseCallout'); + expect(calloutTitle).toBeInTheDocument(); + const calloutGABtn = renderResult.getByTestId('switchToGABtn'); + expect((calloutGABtn as any)?.href).toEqual( + 'http://localhost/mock/app/integrations/detail/nginx-1.0.0/overview' + ); + }); + }); + + describe('and the package is not installed and prerelease disabled', () => { + beforeEach(async () => { + mockGAAndPrereleaseVersions('1.0.0'); + mockedApi.responseProvider.getSettings.mockReturnValue({ + item: { prerelease_integrations_enabled: false, id: '', fleet_server_hosts: [] }, + }); + await render(); + }); + + it('should display version text and no callout if prerelease setting disabled', async () => { + await mockedApi.waitForApi(); + expect((renderResult.queryByTestId('versionText') as any)?.textContent).toEqual('1.0.0'); + expect(renderResult.queryByTestId('prereleaseCallout')).toBeNull(); + }); }); describe('and a custom UI extension is NOT registered', () => { @@ -267,13 +313,16 @@ interface MockedApi< } interface EpmPackageDetailsResponseProvidersMock { - epmGetInfo: jest.MockedFunction<() => GetInfoResponse>; + epmGetInfo: jest.MockedFunction< + (pkgName: string, pkgVersion?: string, options?: { prerelease?: boolean }) => GetInfoResponse + >; epmGetFile: jest.MockedFunction<() => string>; epmGetStats: jest.MockedFunction<() => GetStatsResponse>; fleetSetup: jest.MockedFunction<() => GetFleetStatusResponse>; packagePolicyList: jest.MockedFunction<() => GetPackagePoliciesResponse>; agentPolicyList: jest.MockedFunction<() => GetAgentPoliciesResponse>; appCheckPermissions: jest.MockedFunction<() => CheckPermissionsResponse>; + getSettings: jest.MockedFunction<() => GetSettingsResponse>; } const mockApiCalls = ( @@ -753,6 +802,8 @@ On Windows, the module was tested with Nginx installed from the Chocolatey repos success: true, }; + const getSettingsResponse = { item: { prerelease_integrations_enabled: true } }; + const mockedApiInterface: MockedApi<EpmPackageDetailsResponseProvidersMock> = { waitForApi() { return new Promise((resolve) => { @@ -771,14 +822,19 @@ On Windows, the module was tested with Nginx installed from the Chocolatey repos packagePolicyList: jest.fn().mockReturnValue(packagePoliciesResponse), agentPolicyList: jest.fn().mockReturnValue(agentPoliciesResponse), appCheckPermissions: jest.fn().mockReturnValue(appCheckPermissionsResponse), + getSettings: jest.fn().mockReturnValue(getSettingsResponse), }, }; - http.get.mockImplementation(async (path: any) => { + http.get.mockImplementation((async (path: any, options: any) => { if (typeof path === 'string') { if (path === epmRouteService.getInfoPath(`nginx`, `0.3.7`)) { markApiCallAsHandled(); - return mockedApiInterface.responseProvider.epmGetInfo(); + return mockedApiInterface.responseProvider.epmGetInfo('nginx'); + } + if (path === epmRouteService.getInfoPath(`nginx`)) { + markApiCallAsHandled(); + return mockedApiInterface.responseProvider.epmGetInfo('nginx', undefined, options.query); } if (path === epmRouteService.getFilePath('/package/nginx/0.3.7/docs/README.md')) { @@ -820,13 +876,16 @@ On Windows, the module was tested with Nginx installed from the Chocolatey repos if (path === '/api/fleet/agents') { return Promise.resolve(); } + if (path === '/api/fleet/settings') { + return mockedApiInterface.responseProvider.getSettings(); + } const err = new Error(`API [GET ${path}] is not MOCKED!`); // eslint-disable-next-line no-console console.error(err); throw err; } - }); + }) as any); return mockedApiInterface; }; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx index d649bede3db44..b18e0b49d2445 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx @@ -17,6 +17,7 @@ import { EuiDescriptionListTitle, EuiFlexGroup, EuiFlexItem, + EuiSelect, EuiSpacer, EuiText, } from '@elastic/eui'; @@ -24,6 +25,8 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import semverLt from 'semver/functions/lt'; +import { getPackageReleaseLabel } from '../../../../../../services/package_prerelease'; + import { splitPkgKey } from '../../../../../../../common/services'; import { HIDDEN_API_REFERENCE_PACKAGES } from '../../../../../../../common/constants'; @@ -36,9 +39,10 @@ import { useAuthz, usePermissionCheck, useIntegrationsStateContext, + useGetSettings, } from '../../../../hooks'; import { INTEGRATIONS_ROUTING_PATHS } from '../../../../constants'; -import { ExperimentalFeaturesService } from '../../../../services'; +import { ExperimentalFeaturesService, isPackagePrerelease } from '../../../../services'; import { useGetPackageInfoByKey, useLink, @@ -107,7 +111,7 @@ export function Detail() { const { getId: getAgentPolicyId } = useAgentPolicyContext(); const { getFromIntegrations } = useIntegrationsStateContext(); const { pkgkey, panel } = useParams<DetailParams>(); - const { getHref } = useLink(); + const { getHref, getPath } = useLink(); const canInstallPackages = useAuthz().integrations.installPackages; const canReadPackageSettings = useAuthz().integrations.readPackageSettings; const canReadIntegrationPolicies = useAuthz().integrations.readIntegrationPolicies; @@ -153,6 +157,17 @@ export function Detail() { packageInfo.savedObject && semverLt(packageInfo.savedObject.attributes.version, packageInfo.latestVersion); + const [prereleaseIntegrationsEnabled, setPrereleaseIntegrationsEnabled] = React.useState< + boolean | undefined + >(); + + const { data: settings } = useGetSettings(); + + useEffect(() => { + const isEnabled = Boolean(settings?.item.prerelease_integrations_enabled); + setPrereleaseIntegrationsEnabled(isEnabled); + }, [settings?.item.prerelease_integrations_enabled]); + const { pkgName, pkgVersion } = splitPkgKey(pkgkey); // Fetch package info const { @@ -161,7 +176,34 @@ export function Detail() { isLoading: packageInfoLoading, isInitialRequest: packageIsInitialRequest, resendRequest: refreshPackageInfo, - } = useGetPackageInfoByKey(pkgName, pkgVersion); + } = useGetPackageInfoByKey(pkgName, pkgVersion, { + prerelease: prereleaseIntegrationsEnabled, + }); + + const [latestGAVersion, setLatestGAVersion] = useState<string | undefined>(); + const [latestPrereleaseVersion, setLatestPrereleaseVersion] = useState<string | undefined>(); + + // fetch latest GA version (prerelease=false) + const { data: packageInfoLatestGAData } = useGetPackageInfoByKey(pkgName, '', { + prerelease: false, + }); + + useEffect(() => { + const pkg = packageInfoLatestGAData?.item; + const isGAVersion = pkg && !isPackagePrerelease(pkg.version); + if (isGAVersion) { + setLatestGAVersion(pkg.version); + } + }, [packageInfoLatestGAData?.item]); + + // fetch latest Prerelease version (prerelease=true) + const { data: packageInfoLatestPrereleaseData } = useGetPackageInfoByKey(pkgName, '', { + prerelease: true, + }); + + useEffect(() => { + setLatestPrereleaseVersion(packageInfoLatestPrereleaseData?.item.version); + }, [packageInfoLatestPrereleaseData?.item.version]); const { isFirstTimeAgentUser = false, isLoading: firstTimeUserLoading } = useIsFirstTimeAgentUser(); @@ -272,7 +314,7 @@ export function Detail() { </EuiFlexItem> {packageInfo?.release && packageInfo.release !== 'ga' ? ( <EuiFlexItem grow={false}> - <HeaderReleaseBadge release={packageInfo.release} /> + <HeaderReleaseBadge release={getPackageReleaseLabel(packageInfo.version)} /> </EuiFlexItem> ) : null} </EuiFlexGroup> @@ -326,6 +368,46 @@ export function Detail() { ] ); + const showVersionSelect = useMemo( + () => + prereleaseIntegrationsEnabled && + latestGAVersion && + latestPrereleaseVersion && + latestGAVersion !== latestPrereleaseVersion && + (!packageInfo?.version || + packageInfo.version === latestGAVersion || + packageInfo.version === latestPrereleaseVersion), + [prereleaseIntegrationsEnabled, latestGAVersion, latestPrereleaseVersion, packageInfo?.version] + ); + + const versionOptions = useMemo( + () => [ + { + value: latestPrereleaseVersion, + text: latestPrereleaseVersion, + }, + { + value: latestGAVersion, + text: latestGAVersion, + }, + ], + [latestPrereleaseVersion, latestGAVersion] + ); + + const versionLabel = i18n.translate('xpack.fleet.epm.versionLabel', { + defaultMessage: 'Version', + }); + + const onVersionChange = useCallback( + (version: string, packageName: string) => { + const path = getPath('integration_details_overview', { + pkgkey: `${packageName}-${version}`, + }); + history.push(path); + }, + [getPath, history] + ); + const headerRightContent = useMemo( () => packageInfo ? ( @@ -334,12 +416,24 @@ export function Detail() { <EuiFlexGroup justifyContent="flexEnd" direction="row"> {[ { - label: i18n.translate('xpack.fleet.epm.versionLabel', { - defaultMessage: 'Version', - }), + label: showVersionSelect ? undefined : versionLabel, content: ( <EuiFlexGroup gutterSize="s"> - <EuiFlexItem>{packageInfo.version}</EuiFlexItem> + <EuiFlexItem> + {showVersionSelect ? ( + <EuiSelect + data-test-subj="versionSelect" + prepend={versionLabel} + options={versionOptions} + value={packageInfo.version} + onChange={(event) => + onVersionChange(event.target.value, packageInfo.name) + } + /> + ) : ( + <div data-test-subj="versionText">{packageInfo.version}</div> + )} + </EuiFlexItem> {updateAvailable ? ( <EuiFlexItem grow={false}> <UpdateIcon /> @@ -416,6 +510,10 @@ export function Detail() { missingSecurityConfiguration, integrationInfo?.title, handleAddIntegrationPolicyClick, + onVersionChange, + showVersionSelect, + versionLabel, + versionOptions, ] ); @@ -605,7 +703,11 @@ export function Detail() { ) : ( <Switch> <Route path={INTEGRATIONS_ROUTING_PATHS.integration_details_overview}> - <OverviewPage packageInfo={packageInfo} integrationInfo={integrationInfo} /> + <OverviewPage + packageInfo={packageInfo} + integrationInfo={integrationInfo} + latestGAVersion={latestGAVersion} + /> </Route> <Route path={INTEGRATIONS_ROUTING_PATHS.integration_details_settings}> <SettingsPage packageInfo={packageInfo} theme$={services.theme.theme$} /> diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx index 51991fb8aab33..21b3fd0f4f11c 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx @@ -6,14 +6,14 @@ */ import React, { memo, useMemo } from 'react'; import styled from 'styled-components'; -import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiLink } from '@elastic/eui'; +import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiLink, EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { isIntegrationPolicyTemplate } from '../../../../../../../../common/services'; -import { useFleetStatus, useStartServices } from '../../../../../../../hooks'; -import { isPackageUnverified } from '../../../../../../../services'; +import { useFleetStatus, useLink, useStartServices } from '../../../../../../../hooks'; +import { isPackagePrerelease, isPackageUnverified } from '../../../../../../../services'; import type { PackageInfo, RegistryPolicyTemplate } from '../../../../../types'; import { Screenshots } from './screenshots'; @@ -23,6 +23,7 @@ import { Details } from './details'; interface Props { packageInfo: PackageInfo; integrationInfo?: RegistryPolicyTemplate; + latestGAVersion?: string; } const LeftColumn = styled(EuiFlexItem)` @@ -66,48 +67,97 @@ const UnverifiedCallout: React.FC = () => { ); }; -export const OverviewPage: React.FC<Props> = memo(({ packageInfo, integrationInfo }) => { - const screenshots = useMemo( - () => integrationInfo?.screenshots || packageInfo.screenshots || [], - [integrationInfo, packageInfo.screenshots] - ); - const { packageVerificationKeyId } = useFleetStatus(); - const isUnverified = isPackageUnverified(packageInfo, packageVerificationKeyId); +const PrereleaseCallout: React.FC<{ + packageName: string; + latestGAVersion?: string; + packageTitle: string; +}> = ({ packageName, packageTitle, latestGAVersion }) => { + const { getHref } = useLink(); + const overviewPathLatestGA = getHref('integration_details_overview', { + pkgkey: `${packageName}-${latestGAVersion}`, + }); + return ( - <EuiFlexGroup alignItems="flexStart"> - <LeftColumn grow={2} /> - <EuiFlexItem grow={9} className="eui-textBreakWord"> - {isUnverified && <UnverifiedCallout />} - {packageInfo.readme ? ( - <Readme - readmePath={ - integrationInfo && - isIntegrationPolicyTemplate(integrationInfo) && - integrationInfo?.readme - ? integrationInfo?.readme - : packageInfo.readme - } - packageName={packageInfo.name} - version={packageInfo.version} - /> - ) : null} - </EuiFlexItem> - <EuiFlexItem grow={3}> - <EuiFlexGroup direction="column" gutterSize="l" alignItems="flexStart"> - {screenshots.length ? ( - <EuiFlexItem> - <Screenshots - images={screenshots} - packageName={packageInfo.name} - version={packageInfo.version} + <> + <EuiCallOut + data-test-subj="prereleaseCallout" + title={i18n.translate('xpack.fleet.epm.prereleaseWarningCalloutTitle', { + defaultMessage: 'This is a pre-release version of {packageTitle} integration.', + values: { + packageTitle, + }, + })} + iconType="iInCircle" + color="warning" + > + {latestGAVersion && ( + <p> + <EuiButton href={overviewPathLatestGA} color="warning" data-test-subj="switchToGABtn"> + <FormattedMessage + id="xpack.fleet.epm.prereleaseWarningCalloutSwitchToGAButton" + defaultMessage="Switch to latest GA version" /> - </EuiFlexItem> - ) : null} - <EuiFlexItem> - <Details packageInfo={packageInfo} /> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - </EuiFlexGroup> + </EuiButton> + </p> + )} + </EuiCallOut> + <EuiSpacer size="l" /> + </> ); -}); +}; + +export const OverviewPage: React.FC<Props> = memo( + ({ packageInfo, integrationInfo, latestGAVersion }) => { + const screenshots = useMemo( + () => integrationInfo?.screenshots || packageInfo.screenshots || [], + [integrationInfo, packageInfo.screenshots] + ); + const { packageVerificationKeyId } = useFleetStatus(); + const isUnverified = isPackageUnverified(packageInfo, packageVerificationKeyId); + const isPrerelease = isPackagePrerelease(packageInfo.version); + return ( + <EuiFlexGroup alignItems="flexStart"> + <LeftColumn grow={2} /> + <EuiFlexItem grow={9} className="eui-textBreakWord"> + {isUnverified && <UnverifiedCallout />} + {isPrerelease && ( + <PrereleaseCallout + packageName={packageInfo.name} + packageTitle={packageInfo.title} + latestGAVersion={latestGAVersion} + /> + )} + {packageInfo.readme ? ( + <Readme + readmePath={ + integrationInfo && + isIntegrationPolicyTemplate(integrationInfo) && + integrationInfo?.readme + ? integrationInfo?.readme + : packageInfo.readme + } + packageName={packageInfo.name} + version={packageInfo.version} + /> + ) : null} + </EuiFlexItem> + <EuiFlexItem grow={3}> + <EuiFlexGroup direction="column" gutterSize="l" alignItems="flexStart"> + {screenshots.length ? ( + <EuiFlexItem> + <Screenshots + images={screenshots} + packageName={packageInfo.name} + version={packageInfo.version} + /> + </EuiFlexItem> + ) : null} + <EuiFlexItem> + <Details packageInfo={packageInfo} /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + ); + } +); diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx index 7f56592cdc84b..a763d26e2821b 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx @@ -20,19 +20,17 @@ import { isIntegrationPolicyTemplate, } from '../../../../../../../common/services'; -import { useStartServices } from '../../../../hooks'; +import { useCategories, usePackages, useStartServices } from '../../../../hooks'; import { pagePathGetters } from '../../../../constants'; import { - useGetCategories, - useGetPackages, useBreadcrumbs, useGetAppendCustomIntegrations, useGetReplacementCustomIntegrations, useLink, } from '../../../../hooks'; import { doesPackageHaveIntegrations } from '../../../../services'; -import type { GetPackagesResponse, PackageList } from '../../../../types'; +import type { PackageList } from '../../../../types'; import { PackageListGrid } from '../../components/package_list_grid'; import type { PackageListItem } from '../../../../types'; @@ -183,11 +181,11 @@ const packageListToIntegrationsList = (packages: PackageList): PackageList => { // TODO: clintandrewhall - this component is hard to test due to the hooks, particularly those that use `http` // or `location` to load data. Ideally, we'll split this into "connected" and "pure" components. -export const AvailablePackages: React.FC<{ - allPackages?: GetPackagesResponse | null; - isLoading: boolean; -}> = ({ allPackages, isLoading }) => { +export const AvailablePackages: React.FC<{}> = ({}) => { const [preference, setPreference] = useState<IntegrationPreferenceType>('recommended'); + const [prereleaseIntegrationsEnabled, setPrereleaseIntegrationsEnabled] = React.useState< + boolean | undefined + >(undefined); useBreadcrumbs('integrations_all'); @@ -222,10 +220,7 @@ export const AvailablePackages: React.FC<{ data: eprPackages, isLoading: isLoadingAllPackages, error: eprPackageLoadingError, - } = useGetPackages({ - category: '', - excludeInstallStatus: true, - }); + } = usePackages(prereleaseIntegrationsEnabled); // Remove Kubernetes package granularity if (eprPackages?.items) { @@ -276,9 +271,7 @@ export const AvailablePackages: React.FC<{ data: eprCategories, isLoading: isLoadingCategories, error: eprCategoryLoadingError, - } = useGetCategories({ - include_policy_templates: true, - }); + } = useCategories(prereleaseIntegrationsEnabled); const categories: CategoryFacet[] = useMemo(() => { const eprAndCustomCategories: CategoryFacet[] = isLoadingCategories @@ -306,7 +299,13 @@ export const AvailablePackages: React.FC<{ let controls = [ <EuiFlexItem grow={false}> <EuiHorizontalRule margin="m" /> - <IntegrationPreference initialType={preference} onChange={setPreference} /> + <IntegrationPreference + initialType={preference} + onChange={setPreference} + onPrereleaseEnabledChange={(isEnabled) => { + setPrereleaseIntegrationsEnabled(isEnabled); + }} + /> </EuiFlexItem>, ]; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx index 18d96fbd66346..31c7ee7eeb362 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx @@ -10,6 +10,8 @@ import { Switch, Route } from 'react-router-dom'; import type { CustomIntegration } from '@kbn/custom-integrations-plugin/common'; +import { getPackageReleaseLabel } from '../../../../../../services/package_prerelease'; + import { installationStatuses } from '../../../../../../../common/constants'; import type { DynamicPage, DynamicPagePathValues, StaticPage } from '../../../../constants'; @@ -19,7 +21,10 @@ import { isPackageUnverified } from '../../../../services'; import type { PackageListItem } from '../../../../types'; -import type { IntegrationCardItem } from '../../../../../../../common/types/models'; +import type { + IntegrationCardItem, + IntegrationCardReleaseLabel, +} from '../../../../../../../common/types/models'; import { useGetPackages } from '../../../../hooks'; @@ -65,31 +70,31 @@ export const mapToCard = ({ let isUnverified = false; + let version = 'version' in item ? item.version || '' : ''; + if (item.type === 'ui_link') { uiInternalPathUrl = item.id.includes('language_client.') ? addBasePath(item.uiInternalPath) : item.uiExternalLink || getAbsolutePath(item.uiInternalPath); } else { - let urlVersion = item.version; - if ('savedObject' in item) { - urlVersion = item.savedObject.attributes.version || item.version; + // installed package + if ( + ['updates_available', 'installed'].includes(selectedCategory ?? '') && + 'savedObject' in item + ) { + version = item.savedObject.attributes.version || item.version; isUnverified = isPackageUnverified(item, packageVerificationKeyId); } const url = getHref('integration_details_overview', { - pkgkey: `${item.name}-${urlVersion}`, + pkgkey: `${item.name}-${version}`, ...(item.integration ? { integration: item.integration } : {}), }); uiInternalPathUrl = url; } - let release: 'ga' | 'beta' | 'experimental' | undefined; - if ('release' in item) { - release = item.release; - } else if ((item as CustomIntegration).isBeta === true) { - release = 'beta'; - } + const release: IntegrationCardReleaseLabel = getPackageReleaseLabel(version); return { id: `${item.type === 'ui_link' ? 'ui_link' : 'epr'}:${item.id}`, @@ -100,7 +105,7 @@ export const mapToCard = ({ fromIntegrations: selectedCategory, integration: 'integration' in item ? item.integration || '' : '', name: 'name' in item ? item.name : item.id, - version: 'version' in item ? item.version || '' : '', + version, release, categories: ((item.categories || []) as string[]).filter((c: string) => !!c), isUnverified, @@ -108,8 +113,9 @@ export const mapToCard = ({ }; export const EPMHomePage: React.FC = () => { + // loading packages to find installed ones const { data: allPackages, isLoading } = useGetPackages({ - experimental: true, + prerelease: true, }); const installedPackages = useMemo( @@ -132,7 +138,7 @@ export const EPMHomePage: React.FC = () => { </Route> <Route path={INTEGRATIONS_ROUTING_PATHS.integrations_all}> <DefaultLayout section="browse" sectionsWithWarning={sectionsWithWarning}> - <AvailablePackages allPackages={allPackages} isLoading={isLoading} /> + <AvailablePackages /> </DefaultLayout> </Route> </Switch> diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.mocks.ts b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.mocks.ts index 371edf0c6f6e9..5865572678ba3 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.mocks.ts +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.mocks.ts @@ -17,6 +17,16 @@ jest.mock('../../hooks/use_request', () => { const module = jest.requireActual('../../hooks/use_request'); return { ...module, + useGetFleetServerHosts: jest.fn().mockReturnValue({ + data: { + items: [ + { + is_default: true, + host_urls: ['http://test.fr'], + }, + ], + }, + }), useGetSettings: jest.fn().mockReturnValue({ data: { item: { fleet_server_hosts: ['test'] } }, }), diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.tsx index 6e46ec90d5faf..ea184084b040e 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.tsx @@ -16,7 +16,11 @@ import { coreMock } from '@kbn/core/public/mocks'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import type { AgentPolicy } from '../../../common'; -import { useGetSettings, sendGetOneAgentPolicy, useGetAgents } from '../../hooks/use_request'; +import { + useGetFleetServerHosts, + sendGetOneAgentPolicy, + useGetAgents, +} from '../../hooks/use_request'; import { FleetStatusProvider, ConfigContext, @@ -78,8 +82,15 @@ describe('<AgentEnrollmentFlyout />', () => { let testBed: TestBed; beforeEach(() => { - (useGetSettings as jest.Mock).mockReturnValue({ - data: { item: { fleet_server_hosts: ['test'] } }, + (useGetFleetServerHosts as jest.Mock).mockReturnValue({ + data: { + items: [ + { + is_default: true, + host_urls: ['http://test.fr'], + }, + ], + }, }); (useFleetStatus as jest.Mock).mockReturnValue({ isReady: true }); @@ -155,7 +166,6 @@ describe('<AgentEnrollmentFlyout />', () => { describe('managed instructions', () => { it('uses the agent policy selection step', () => { const { exists } = testBed; - expect(exists('agentEnrollmentFlyout')).toBe(true); expect(exists('agent-policy-selection-step')).toBe(true); expect(exists('agent-enrollment-key-selection-step')).toBe(false); diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx index cde975fed45dd..4773a30f1e822 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx @@ -19,10 +19,16 @@ import { EuiFlyoutFooter, EuiTab, EuiTabs, + EuiLink, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useGetSettings, useFleetStatus, useAgentEnrollmentFlyoutData } from '../../hooks'; +import { + useStartServices, + useFleetStatus, + useAgentEnrollmentFlyoutData, + useFleetServerHostsForPolicy, +} from '../../hooks'; import { FLEET_SERVER_PACKAGE } from '../../constants'; import type { PackagePolicy, AgentPolicy } from '../../types'; @@ -51,9 +57,8 @@ export const AgentEnrollmentFlyout: React.FunctionComponent<FlyOutProps> = ({ return policies.find((p) => p.id === id); }; - const settings = useGetSettings(); const fleetStatus = useFleetStatus(); - const fleetServerHosts = settings.data?.item?.fleet_server_hosts || []; + const { docLinks } = useStartServices(); const [selectedPolicyId, setSelectedPolicyId] = useState(agentPolicy?.id); const [isFleetServerPolicySelected, setIsFleetServerPolicySelected] = useState<boolean>(false); @@ -70,6 +75,10 @@ export const AgentEnrollmentFlyout: React.FunctionComponent<FlyOutProps> = ({ const { agentPolicyWithPackagePolicies } = useAgentPolicyWithPackagePolicies(selectedPolicyId); + const { fleetServerHosts, isLoadingInitialRequest } = useFleetServerHostsForPolicy( + agentPolicyWithPackagePolicies + ); + const selectedPolicy = agentPolicyWithPackagePolicies ? agentPolicyWithPackagePolicies : findPolicyById(agentPolicies, selectedPolicyId); @@ -92,26 +101,55 @@ export const AgentEnrollmentFlyout: React.FunctionComponent<FlyOutProps> = ({ const { isK8s } = useIsK8sPolicy(selectedPolicy ? selectedPolicy : undefined); - const isLoadingInitialRequest = settings.isLoading && settings.isInitialRequest; - return ( <EuiFlyout data-test-subj="agentEnrollmentFlyout" onClose={onClose} size="m"> <EuiFlyoutHeader hasBorder aria-labelledby="FleetAgentEnrollmentFlyoutTitle"> <EuiTitle size="m"> <h2 id="FleetAgentEnrollmentFlyoutTitle"> - <FormattedMessage - id="xpack.fleet.agentEnrollment.flyoutTitle" - defaultMessage="Add agent" - /> + {isFleetServerPolicySelected ? ( + <FormattedMessage + id="xpack.fleet.agentEnrollment.flyoutFleetServerTitle" + defaultMessage="Add Fleet Server" + /> + ) : ( + <FormattedMessage + id="xpack.fleet.agentEnrollment.flyoutTitle" + defaultMessage="Add agent" + /> + )} </h2> </EuiTitle> <EuiSpacer size="l" /> - <EuiText> - <FormattedMessage - id="xpack.fleet.agentEnrollment.agentDescription" - defaultMessage="Add Elastic Agents to your hosts to collect data and send it to the Elastic Stack." - /> - </EuiText> + {isFleetServerPolicySelected ? ( + <EuiText> + <FormattedMessage + id="xpack.fleet.agentEnrollment.instructionstFleetServer" + defaultMessage="A Fleet Server is required before you can enroll agents with Fleet. Follow the instructions below to set up a Fleet Server. For more information, see the {userGuideLink}" + values={{ + userGuideLink: ( + <EuiLink + href={docLinks.links.fleet.fleetServerAddFleetServer} + external + target="_blank" + > + <FormattedMessage + id="xpack.fleet.agentEnrollment.setupGuideLink" + defaultMessage="Fleet and Elastic Agent Guide" + /> + </EuiLink> + ), + }} + /> + </EuiText> + ) : ( + <EuiText> + <FormattedMessage + id="xpack.fleet.agentEnrollment.agentDescription" + defaultMessage="Add Elastic Agents to your hosts to collect data and send it to the Elastic Stack." + /> + </EuiText> + )} + {selectionType === 'tabs' ? ( <> <EuiSpacer size="l" /> @@ -151,7 +189,7 @@ export const AgentEnrollmentFlyout: React.FunctionComponent<FlyOutProps> = ({ <Loading size="l" /> ) : ( <Instructions - settings={settings.data?.item} + fleetServerHosts={fleetServerHosts} setSelectedPolicyId={setSelectedPolicyId} agentPolicy={agentPolicy} selectedPolicy={selectedPolicy} diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/instructions.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/instructions.tsx index 97c0542ab2477..c8e15b93a7dad 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/instructions.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/instructions.tsx @@ -32,7 +32,7 @@ export const Instructions = (props: InstructionProps) => { const { agentPolicies, isFleetServerPolicySelected, - settings, + fleetServerHosts, isLoadingAgentPolicies, selectionType, setSelectionType, @@ -66,19 +66,15 @@ export const Instructions = (props: InstructionProps) => { const fleetServers = agents?.items || []; - const fleetServerHosts = useMemo(() => { - return settings?.fleet_server_hosts || []; - }, [settings]); - if (isLoadingAgents || isLoadingAgentPolicies) return <Loading size="l" />; - const hasNoFleetServerHost = fleetStatus.isReady && fleetServerHosts.length === 0; + const hasNoFleetServerHost = fleetStatus.isReady && (fleetServerHosts?.length ?? 0) === 0; const showAgentEnrollment = fleetStatus.isReady && !isFleetServerUnhealthy && fleetServers.length > 0 && - fleetServerHosts.length > 0; + (fleetServerHosts?.length ?? 0) > 0; const showFleetServerEnrollment = fleetServers.length === 0 || diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps/compute_steps.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps/compute_steps.tsx index 1bb7f446ec77c..9d39364876da0 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps/compute_steps.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps/compute_steps.tsx @@ -186,7 +186,7 @@ export const ManagedSteps: React.FunctionComponent<InstructionProps> = ({ setSelectedPolicyId, selectedApiKeyId, setSelectedAPIKeyId, - settings, + fleetServerHosts, refreshAgentPolicies, mode, setMode, @@ -207,9 +207,6 @@ export const ManagedSteps: React.FunctionComponent<InstructionProps> = ({ const enrolledAgentIds = usePollingAgentCount(selectedPolicy?.id || ''); - const fleetServerHosts = useMemo(() => { - return settings?.fleet_server_hosts || []; - }, [settings]); const installManagedCommands = ManualInstructions(enrollToken, fleetServerHosts, kibanaVersion); const instructionsSteps = useMemo(() => { diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/types.ts b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/types.ts index 7c501df0b3f3b..0cbae55c6ffd9 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/types.ts +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { AgentPolicy, Settings } from '../../types'; +import type { AgentPolicy } from '../../types'; import type { InstalledIntegrationPolicy } from './use_get_agent_incoming_data'; @@ -19,8 +19,6 @@ export interface BaseProps { */ agentPolicy?: AgentPolicy; - settings?: Settings; - isFleetServerPolicySelected?: boolean; isK8s?: K8sMode; @@ -51,4 +49,5 @@ export interface InstructionProps extends BaseProps { setSelectionType: (type: SelectionType) => void; selectedApiKeyId?: string; setSelectedAPIKeyId: (key?: string) => void; + fleetServerHosts: string[]; } diff --git a/x-pack/plugins/fleet/public/components/release_badge.tsx b/x-pack/plugins/fleet/public/components/release_badge.tsx index 3252ea21ee2df..488b2a6a46131 100644 --- a/x-pack/plugins/fleet/public/components/release_badge.tsx +++ b/x-pack/plugins/fleet/public/components/release_badge.tsx @@ -9,28 +9,34 @@ import React from 'react'; import { EuiBadge, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import type { PackageInfo, RegistryRelease } from '../types'; +import type { IntegrationCardReleaseLabel } from '../../common/types'; -const RELEASE_BADGE_LABEL: { [key in Exclude<RegistryRelease, 'ga'>]: string } = { +const RELEASE_BADGE_LABEL: { [key in Exclude<IntegrationCardReleaseLabel, 'ga'>]: string } = { beta: i18n.translate('xpack.fleet.epm.releaseBadge.betaLabel', { defaultMessage: 'Beta', }), - experimental: i18n.translate('xpack.fleet.epm.releaseBadge.experimentalLabel', { + preview: i18n.translate('xpack.fleet.epm.releaseBadge.technicalPreviewLabel', { defaultMessage: 'Technical preview', }), + rc: i18n.translate('xpack.fleet.epm.releaseBadge.releaseCandidateLabel', { + defaultMessage: 'Release Candidate', + }), }; -const RELEASE_BADGE_DESCRIPTION: { [key in Exclude<RegistryRelease, 'ga'>]: string } = { +const RELEASE_BADGE_DESCRIPTION: { [key in Exclude<IntegrationCardReleaseLabel, 'ga'>]: string } = { beta: i18n.translate('xpack.fleet.epm.releaseBadge.betaDescription', { defaultMessage: 'This integration is not recommended for use in production environments.', }), - experimental: i18n.translate('xpack.fleet.epm.releaseBadge.experimentalDescription', { + preview: i18n.translate('xpack.fleet.epm.releaseBadge.technicalPreviewDescription', { defaultMessage: 'This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.', }), + rc: i18n.translate('xpack.fleet.epm.releaseBadge.releaseCandidateDescription', { + defaultMessage: 'This integration is not recommended for use in production environments.', + }), }; -export const HeaderReleaseBadge: React.FC<{ release: NonNullable<PackageInfo['release']> }> = ({ +export const HeaderReleaseBadge: React.FC<{ release: IntegrationCardReleaseLabel }> = ({ release, }) => { if (release === 'ga') return null; @@ -43,7 +49,7 @@ export const HeaderReleaseBadge: React.FC<{ release: NonNullable<PackageInfo['re ); }; -export const InlineReleaseBadge: React.FC<{ release: NonNullable<PackageInfo['release']> }> = ({ +export const InlineReleaseBadge: React.FC<{ release: IntegrationCardReleaseLabel }> = ({ release, }) => { if (release === 'ga') return null; diff --git a/x-pack/plugins/fleet/public/components/with_guided_onboarding_tour.tsx b/x-pack/plugins/fleet/public/components/with_guided_onboarding_tour.tsx index 5ed0256e7f881..9065cb723d8b5 100644 --- a/x-pack/plugins/fleet/public/components/with_guided_onboarding_tour.tsx +++ b/x-pack/plugins/fleet/public/components/with_guided_onboarding_tour.tsx @@ -11,7 +11,7 @@ import type { EuiTourStepProps } from '@elastic/eui'; import { EuiButton, EuiText, EuiTourStep } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -type TourType = 'addIntegrationButton' | 'integrationsList' | 'agentModalButton'; +type TourType = 'addIntegrationButton' | 'integrationCard' | 'agentModalButton'; const getTourConfig = (packageKey: string, tourType: TourType) => { if (packageKey.startsWith('endpoint') && tourType === 'addIntegrationButton') { return { @@ -25,6 +25,17 @@ const getTourConfig = (packageKey: string, tourType: TourType) => { }; } + if (packageKey.startsWith('endpoint') && tourType === 'integrationCard') { + return { + title: i18n.translate('xpack.fleet.guidedOnboardingTour.endpointCard.title', { + defaultMessage: 'Select Elastic Defend', + }), + description: i18n.translate('xpack.fleet.guidedOnboardingTour.endpointCard.description', { + defaultMessage: 'The best way to get data quickly in to your SIEM.', + }), + }; + } + if (packageKey.startsWith('kubernetes') && tourType === 'addIntegrationButton') { return { title: i18n.translate('xpack.fleet.guidedOnboardingTour.kubernetesButton.tourTitle', { @@ -90,6 +101,10 @@ export const WithGuidedOnboardingTour: FunctionComponent<{ })} </EuiButton> } + isOpen={isGuidedOnboardingTourOpen} + // Close the tour when the user clicks outside of the tour. This is a workaround for + // popover remaining open when the user changes the category of the integration list + closePopover={() => setIsGuidedOnboardingTourOpen(false)} > {children} </EuiTourStep> diff --git a/x-pack/plugins/fleet/public/constants/page_paths.ts b/x-pack/plugins/fleet/public/constants/page_paths.ts index fa9d6c1cec21c..d276d777661ed 100644 --- a/x-pack/plugins/fleet/public/constants/page_paths.ts +++ b/x-pack/plugins/fleet/public/constants/page_paths.ts @@ -16,9 +16,9 @@ export type StaticPage = | 'enrollment_tokens' | 'data_streams' | 'settings' - | 'settings_edit_fleet_server_hosts' | 'settings_create_outputs' | 'settings_create_download_sources' + | 'settings_create_fleet_server_hosts' | 'debug'; export type DynamicPage = @@ -42,7 +42,8 @@ export type DynamicPage = | 'agent_details' | 'agent_details_logs' | 'settings_edit_outputs' - | 'settings_edit_download_sources'; + | 'settings_edit_download_sources' + | 'settings_edit_fleet_server_hosts'; export type Page = StaticPage | DynamicPage; @@ -69,7 +70,8 @@ export const FLEET_ROUTING_PATHS = { enrollment_tokens: '/enrollment-tokens', data_streams: '/data-streams', settings: '/settings', - settings_edit_fleet_server_hosts: '/settings/edit-fleet-server-hosts', + settings_create_fleet_server_hosts: '/settings/create-fleet-server-hosts', + settings_edit_fleet_server_hosts: '/settings/fleet-server-hosts/:itemId', settings_create_outputs: '/settings/create-outputs', settings_edit_outputs: '/settings/outputs/:outputId', settings_create_download_sources: '/settings/create-download-sources', @@ -200,9 +202,13 @@ export const pagePathGetters: { enrollment_tokens: () => [FLEET_BASE_PATH, '/enrollment-tokens'], data_streams: () => [FLEET_BASE_PATH, '/data-streams'], settings: () => [FLEET_BASE_PATH, FLEET_ROUTING_PATHS.settings], - settings_edit_fleet_server_hosts: () => [ + settings_edit_fleet_server_hosts: ({ itemId }) => [ FLEET_BASE_PATH, - FLEET_ROUTING_PATHS.settings_edit_fleet_server_hosts, + FLEET_ROUTING_PATHS.settings_edit_fleet_server_hosts.replace(':itemId', itemId.toString()), + ], + settings_create_fleet_server_hosts: () => [ + FLEET_BASE_PATH, + FLEET_ROUTING_PATHS.settings_create_fleet_server_hosts, ], settings_edit_outputs: ({ outputId }) => [ FLEET_BASE_PATH, diff --git a/x-pack/plugins/fleet/public/hooks/index.ts b/x-pack/plugins/fleet/public/hooks/index.ts index b155ccf63a0db..236392144e18b 100644 --- a/x-pack/plugins/fleet/public/hooks/index.ts +++ b/x-pack/plugins/fleet/public/hooks/index.ts @@ -29,3 +29,4 @@ export * from './use_package_installations'; export * from './use_agent_enrollment_flyout_data'; export * from './use_flyout_context'; export * from './use_is_guided_onboarding_active'; +export * from './use_fleet_server_hosts_for_policy'; diff --git a/x-pack/plugins/fleet/public/hooks/use_fleet_server_hosts_for_policy.test.tsx b/x-pack/plugins/fleet/public/hooks/use_fleet_server_hosts_for_policy.test.tsx new file mode 100644 index 0000000000000..9da0b8ea1704c --- /dev/null +++ b/x-pack/plugins/fleet/public/hooks/use_fleet_server_hosts_for_policy.test.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 { renderHook } from '@testing-library/react-hooks'; + +import { useFleetServerHostsForPolicy } from './use_fleet_server_hosts_for_policy'; +import { useGetFleetServerHosts } from './use_request/fleet_server_hosts'; + +jest.mock('./use_request/fleet_server_hosts'); + +const mockedUseGetFleetServerHosts = useGetFleetServerHosts as jest.MockedFunction< + typeof useGetFleetServerHosts +>; + +describe('useFleetServerHostsForPolicy', () => { + beforeEach(() => { + mockedUseGetFleetServerHosts.mockReturnValue({ + isLoading: false, + isInitialRequest: false, + data: { + items: [ + { + id: 'default', + is_default: true, + host_urls: ['https://defaultfleetserver:8220'], + is_preconfigured: false, + name: 'Default', + }, + { + id: 'custom1', + is_default: false, + host_urls: ['https://custom1:8220'], + is_preconfigured: false, + name: 'Custom 1', + }, + ], + page: 1, + perPage: 100, + total: 2, + }, + } as any); + }); + it('should return default hosts if used without agent policy', () => { + const { result } = renderHook(() => useFleetServerHostsForPolicy()); + expect(result.current.fleetServerHosts).toEqual(['https://defaultfleetserver:8220']); + }); + + it('should return default hosts if used with agent policy that do not override fleet server host', () => { + const { result } = renderHook(() => + useFleetServerHostsForPolicy({ + id: 'testpolicy1', + } as any) + ); + expect(result.current.fleetServerHosts).toEqual(['https://defaultfleetserver:8220']); + }); + + it('should return custom hosts if used with agent policy that override fleet server hosts', () => { + const { result } = renderHook(() => + useFleetServerHostsForPolicy({ + id: 'testpolicy1', + fleet_server_host_id: 'custom1', + } as any) + ); + expect(result.current.fleetServerHosts).toEqual(['https://custom1:8220']); + }); +}); diff --git a/x-pack/plugins/fleet/public/hooks/use_fleet_server_hosts_for_policy.ts b/x-pack/plugins/fleet/public/hooks/use_fleet_server_hosts_for_policy.ts new file mode 100644 index 0000000000000..f1cf639918172 --- /dev/null +++ b/x-pack/plugins/fleet/public/hooks/use_fleet_server_hosts_for_policy.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 { useMemo } from 'react'; + +import type { AgentPolicy } from '../types'; + +import { useGetFleetServerHosts } from './use_request'; + +/** + * Return Fleet server hosts urls for a given agent policy + */ +export function useFleetServerHostsForPolicy(agentPolicy?: AgentPolicy | null) { + const fleetServerHostsRequest = useGetFleetServerHosts(); + const fleetServerHosts = useMemo(() => { + return ( + fleetServerHostsRequest.data?.items.filter((item) => + agentPolicy?.fleet_server_host_id + ? item.id === agentPolicy?.fleet_server_host_id + : item.is_default + )?.[0]?.host_urls ?? [] + ); + }, [agentPolicy, fleetServerHostsRequest]); + + const isLoadingInitialRequest = + fleetServerHostsRequest.isLoading && fleetServerHostsRequest.isInitialRequest; + + const allFleetServerHosts = useMemo( + () => fleetServerHostsRequest.data?.items ?? [], + [fleetServerHostsRequest] + ); + + return useMemo( + () => ({ isLoadingInitialRequest, fleetServerHosts, allFleetServerHosts }), + [fleetServerHosts, allFleetServerHosts, isLoadingInitialRequest] + ); +} diff --git a/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx b/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx index 5a0b6285c71db..e4dabcff4e8a0 100644 --- a/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx +++ b/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx @@ -28,7 +28,7 @@ interface UpdatableIntegration { export const usePackageInstallations = () => { const { data: allPackages, isLoading: isLoadingPackages } = useGetPackages({ - experimental: true, + prerelease: true, }); const { data: agentPolicyData, isLoading: isLoadingPolicies } = useGetAgentPolicies({ diff --git a/x-pack/plugins/fleet/public/hooks/use_request/epm.ts b/x-pack/plugins/fleet/public/hooks/use_request/epm.ts index 3a0033435ed9d..9c88cfae46c4d 100644 --- a/x-pack/plugins/fleet/public/hooks/use_request/epm.ts +++ b/x-pack/plugins/fleet/public/hooks/use_request/epm.ts @@ -44,7 +44,15 @@ export const useGetCategories = (query: GetCategoriesRequest['query'] = {}) => { return useRequest<GetCategoriesResponse>({ path: epmRouteService.getCategoriesPath(), method: 'get', - query: { experimental: true, ...query }, + query, + }); +}; + +export const sendGetCategories = (query: GetCategoriesRequest['query'] = {}) => { + return sendRequest<GetCategoriesResponse>({ + path: epmRouteService.getCategoriesPath(), + method: 'get', + query, }); }; @@ -52,7 +60,7 @@ export const useGetPackages = (query: GetPackagesRequest['query'] = {}) => { return useRequest<GetPackagesResponse>({ path: epmRouteService.getListPath(), method: 'get', - query: { experimental: true, ...query }, + query, }); }; @@ -60,7 +68,7 @@ export const sendGetPackages = (query: GetPackagesRequest['query'] = {}) => { return sendRequest<GetPackagesResponse>({ path: epmRouteService.getListPath(), method: 'get', - query: { experimental: true, ...query }, + query, }); }; @@ -74,14 +82,22 @@ export const useGetLimitedPackages = () => { export const useGetPackageInfoByKey = ( pkgName: string, pkgVersion?: string, - ignoreUnverified: boolean = false + options?: { + ignoreUnverified?: boolean; + prerelease?: boolean; + } ) => { const confirmOpenUnverified = useConfirmOpenUnverified(); - const [ignoreUnverifiedQueryParam, setIgnoreUnverifiedQueryParam] = useState(ignoreUnverified); + const [ignoreUnverifiedQueryParam, setIgnoreUnverifiedQueryParam] = useState( + options?.ignoreUnverified + ); const res = useRequest<GetInfoResponse>({ path: epmRouteService.getInfoPath(pkgName, pkgVersion), method: 'get', - query: ignoreUnverifiedQueryParam ? { ignoreUnverified: ignoreUnverifiedQueryParam } : {}, + query: { + ...options, + ...(ignoreUnverifiedQueryParam ? { ignoreUnverified: ignoreUnverifiedQueryParam } : {}), + }, }); useEffect(() => { @@ -111,12 +127,15 @@ export const useGetPackageStats = (pkgName: string) => { export const sendGetPackageInfoByKey = ( pkgName: string, pkgVersion?: string, - ignoreUnverified?: boolean + options?: { + ignoreUnverified?: boolean; + prerelease?: boolean; + } ) => { return sendRequest<GetInfoResponse>({ path: epmRouteService.getInfoPath(pkgName, pkgVersion), method: 'get', - query: ignoreUnverified ? { ignoreUnverified } : {}, + query: options, }); }; diff --git a/x-pack/plugins/fleet/public/hooks/use_request/fleet_server_hosts.ts b/x-pack/plugins/fleet/public/hooks/use_request/fleet_server_hosts.ts new file mode 100644 index 0000000000000..f066da66dba12 --- /dev/null +++ b/x-pack/plugins/fleet/public/hooks/use_request/fleet_server_hosts.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 { fleetServerHostsRoutesService } from '../../../common/services'; +import type { + GetFleetServerHostsResponse, + PostFleetServerHostsRequest, + PutFleetServerHostsRequest, + PostFleetServerHostsResponse, +} from '../../../common/types/rest_spec/fleet_server_hosts'; + +import { sendRequest, useRequest } from './use_request'; + +export function useGetFleetServerHosts() { + return useRequest<GetFleetServerHostsResponse>({ + method: 'get', + path: fleetServerHostsRoutesService.getListPath(), + }); +} + +export function sendDeleteFleetServerHost(itemId: string) { + return sendRequest({ + method: 'delete', + path: fleetServerHostsRoutesService.getDeletePath(itemId), + }); +} + +export function sendPutFleetServerHost(itemId: string, body: PutFleetServerHostsRequest['body']) { + return sendRequest({ + method: 'put', + path: fleetServerHostsRoutesService.getUpdatePath(itemId), + body, + }); +} + +export function sendPostFleetServerHost(body: PostFleetServerHostsRequest['body']) { + return sendRequest<PostFleetServerHostsResponse>({ + method: 'post', + path: fleetServerHostsRoutesService.getCreatePath(), + body, + }); +} diff --git a/x-pack/plugins/fleet/public/hooks/use_request/index.ts b/x-pack/plugins/fleet/public/hooks/use_request/index.ts index 1ca5297cb22a2..8b1f80b5852fa 100644 --- a/x-pack/plugins/fleet/public/hooks/use_request/index.ts +++ b/x-pack/plugins/fleet/public/hooks/use_request/index.ts @@ -18,3 +18,4 @@ export * from './setup'; export * from './app'; export * from './ingest_pipelines'; export * from './download_source'; +export * from './fleet_server_hosts'; diff --git a/x-pack/plugins/fleet/public/services/index.ts b/x-pack/plugins/fleet/public/services/index.ts index d6167b4548e65..9d6ef9b4563ae 100644 --- a/x-pack/plugins/fleet/public/services/index.ts +++ b/x-pack/plugins/fleet/public/services/index.ts @@ -47,3 +47,4 @@ export { pkgKeyFromPackageInfo } from './pkg_key_from_package_info'; export { createExtensionRegistrationCallback } from './ui_extensions'; export { incrementPolicyName } from './increment_policy_name'; export { policyHasFleetServer } from './has_fleet_server'; +export { isPackagePrerelease } from './package_prerelease'; diff --git a/x-pack/plugins/fleet/public/services/package_prerelease.test.ts b/x-pack/plugins/fleet/public/services/package_prerelease.test.ts new file mode 100644 index 0000000000000..cb4fe530571d3 --- /dev/null +++ b/x-pack/plugins/fleet/public/services/package_prerelease.test.ts @@ -0,0 +1,60 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getPackageReleaseLabel, isPackagePrerelease } from './package_prerelease'; + +describe('isPackagePrerelease', () => { + it('should return prerelease true for 0.1.0', () => { + expect(isPackagePrerelease('0.1.0')).toBe(true); + }); + + it('should return prerelease false for 1.1.0', () => { + expect(isPackagePrerelease('1.1.0')).toBe(false); + }); + + it('should return prerelease true for 1.0.0-preview', () => { + expect(isPackagePrerelease('1.0.0-preview')).toBe(true); + }); + + it('should return prerelease true for 1.0.0-beta', () => { + expect(isPackagePrerelease('1.0.0-beta')).toBe(true); + }); + + it('should return prerelease true for 1.0.0-rc', () => { + expect(isPackagePrerelease('1.0.0-rc')).toBe(true); + }); + + it('should return prerelease true for 1.0.0-dev.0', () => { + expect(isPackagePrerelease('1.0.0-dev.0')).toBe(true); + }); +}); + +describe('getPackageReleaseLabel', () => { + it('should return preview for 0.1.0', () => { + expect(getPackageReleaseLabel('0.1.0')).toEqual('preview'); + }); + + it('should return ga for 1.1.0', () => { + expect(getPackageReleaseLabel('1.1.0')).toEqual('ga'); + }); + + it('should return preview for 1.0.0-preview1', () => { + expect(getPackageReleaseLabel('1.0.0-preview1')).toEqual('preview'); + }); + + it('should return beta for 1.0.0-beta', () => { + expect(getPackageReleaseLabel('1.0.0-beta')).toEqual('beta'); + }); + + it('should return rc for 1.0.0-rc', () => { + expect(getPackageReleaseLabel('1.0.0-rc')).toEqual('rc'); + }); + + it('should return beta for 1.0.0-dev.0', () => { + expect(getPackageReleaseLabel('1.0.0-dev.0')).toBe('beta'); + }); +}); diff --git a/x-pack/plugins/fleet/public/services/package_prerelease.ts b/x-pack/plugins/fleet/public/services/package_prerelease.ts new file mode 100644 index 0000000000000..6cda43e20e642 --- /dev/null +++ b/x-pack/plugins/fleet/public/services/package_prerelease.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 type { IntegrationCardReleaseLabel, RegistryRelease } from '../../common/types'; + +export function isPackagePrerelease(version: string): boolean { + // derive from semver + return version.startsWith('0') || version.includes('-'); +} + +export function getPackageReleaseLabel(version: string): IntegrationCardReleaseLabel { + if (version.startsWith('0') || version.includes('-preview')) { + return 'preview'; + } else if (version.includes('-rc')) { + return 'rc'; + } else if (version.includes('-')) { + return 'beta'; + } + return 'ga'; +} + +export function mapPackageReleaseToIntegrationCardRelease( + release: RegistryRelease +): IntegrationCardReleaseLabel { + return release === 'experimental' ? 'preview' : release; +} diff --git a/x-pack/plugins/fleet/public/types/index.ts b/x-pack/plugins/fleet/public/types/index.ts index 2438272503ac7..7554d2ba0f45e 100644 --- a/x-pack/plugins/fleet/public/types/index.ts +++ b/x-pack/plugins/fleet/public/types/index.ts @@ -24,6 +24,7 @@ export type { PackagePolicyPackage, Output, DownloadSource, + FleetServerHost, DataStream, Settings, ActionStatus, diff --git a/x-pack/plugins/fleet/scripts/create_agents/create_agents.ts b/x-pack/plugins/fleet/scripts/create_agents/create_agents.ts index 31df24c70a5d4..0a9d14339729a 100644 --- a/x-pack/plugins/fleet/scripts/create_agents/create_agents.ts +++ b/x-pack/plugins/fleet/scripts/create_agents/create_agents.ts @@ -99,8 +99,6 @@ async function createAgentPolicy(id: string) { namespace: 'default', description: '', monitoring_enabled: ['logs'], - data_output_id: 'fleet-default-output', - monitoring_output_id: 'fleet-default-output', }), headers: { Authorization: auth, diff --git a/x-pack/plugins/fleet/scripts/install_all_packages/install_all_packages.ts b/x-pack/plugins/fleet/scripts/install_all_packages/install_all_packages.ts index e07ff9f5a1808..4215a460a29cb 100644 --- a/x-pack/plugins/fleet/scripts/install_all_packages/install_all_packages.ts +++ b/x-pack/plugins/fleet/scripts/install_all_packages/install_all_packages.ts @@ -57,7 +57,7 @@ async function deletePackage(name: string, version: string) { async function getAllPackages() { const res = await fetch( - `${REGISTRY_URL}/search?experimental=true&kibana.version=${KIBANA_VERSION}`, + `${REGISTRY_URL}/search?prerelease=true&kibana.version=${KIBANA_VERSION}`, { headers: { accept: '*/*', diff --git a/x-pack/plugins/fleet/scripts/verify_test_packages/index.js b/x-pack/plugins/fleet/scripts/verify_test_packages/index.js new file mode 100644 index 0000000000000..2c3f64739962b --- /dev/null +++ b/x-pack/plugins/fleet/scripts/verify_test_packages/index.js @@ -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. + */ + +require('../../../../../src/setup_node_env'); +require('./verify_test_packages').run(); diff --git a/x-pack/plugins/fleet/scripts/verify_test_packages/verify_test_packages.test.ts b/x-pack/plugins/fleet/scripts/verify_test_packages/verify_test_packages.test.ts new file mode 100644 index 0000000000000..219d101d6e1ad --- /dev/null +++ b/x-pack/plugins/fleet/scripts/verify_test_packages/verify_test_packages.test.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 { verifyAllTestPackages } from './verify_test_packages'; + +describe('Test packages', () => { + test('All test packages should be valid (node scripts/verify_test_packages) ', async () => { + const { errors } = await verifyAllTestPackages(); + expect(errors).toEqual([]); + }); +}); diff --git a/x-pack/plugins/fleet/scripts/verify_test_packages/verify_test_packages.ts b/x-pack/plugins/fleet/scripts/verify_test_packages/verify_test_packages.ts new file mode 100644 index 0000000000000..ff7347e599ee6 --- /dev/null +++ b/x-pack/plugins/fleet/scripts/verify_test_packages/verify_test_packages.ts @@ -0,0 +1,106 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import path from 'path'; +import { readdirSync, statSync, readFile } from 'fs'; +import { promisify } from 'util'; + +import partition from 'lodash/partition'; +import type { Logger } from '@kbn/core/server'; + +import { ToolingLog } from '@kbn/tooling-log'; + +import { + _generatePackageInfoFromPaths, + generatePackageInfoFromArchiveBuffer, +} from '../../server/services/epm/archive/parse'; + +const readFileAsync = promisify(readFile); + +const TEST_PACKAGE_DIRECTORIES = [ + '../../../../test/fleet_api_integration/apis/fixtures/bundled_packages', + '../../../../test/fleet_api_integration/apis/fixtures/test_packages', + '../../../../test/fleet_api_integration/apis/fixtures/package_verification/packages', +]; + +const getAllPathsFromDir = (dir: string): string[] => + readdirSync(dir).flatMap((file) => { + const joinedPath = path.join(dir, file); + if (!statSync(joinedPath).isDirectory()) return joinedPath; + + return getAllPathsFromDir(joinedPath); + }); + +const getAllPackagesFromDir = (packagesDir: string) => + readdirSync(packagesDir).flatMap((packageDir) => { + const packagePath = path.join(packagesDir, packageDir); + + if (packagePath.endsWith('.zip')) return packagePath; + + if (!statSync(packagePath).isDirectory()) return []; + + return readdirSync(packagePath) + .map((version) => path.join(packagePath, version)) + .filter((versionPath) => statSync(versionPath).isDirectory() || packagePath.endsWith('.zip')); + }); + +export const run = async () => { + const logger = new ToolingLog({ + level: 'info', + writeTo: process.stdout, + }); + + const { errors } = await verifyAllTestPackages(logger); + + if (errors.length) { + logger.error(`${errors.length} packages failed validation. Exiting with error.`); + process.exit(1); + } +}; + +export const verifyAllTestPackages = async ( + logger?: ToolingLog | Logger +): Promise<{ successCount: number; errors: Error[] }> => { + const errors = []; + let successCount = 0; + for (const dir of TEST_PACKAGE_DIRECTORIES) { + const packageVersionPaths = getAllPackagesFromDir(path.join(__dirname, dir)); + + const [zips, dirs] = partition(packageVersionPaths, (p) => p.endsWith('.zip')); + + for (const zipPath of zips) { + const buffer = await readFileAsync(zipPath); + + try { + const { packageInfo } = await generatePackageInfoFromArchiveBuffer( + buffer, + 'application/zip' + ); + logger?.info(`Successfully parsed zip pkg ${packageInfo.name}-${packageInfo.version}`); + successCount++; + } catch (e) { + logger?.error(`Error parsing ${zipPath} : ${e}`); + errors.push(e); + } + } + + const allPackageDirPaths = dirs.map(getAllPathsFromDir); + for (const [i, packagePaths] of allPackageDirPaths.entries()) { + const topLevelDir = packageVersionPaths[i]; + try { + const packageInfo = await _generatePackageInfoFromPaths(packagePaths, topLevelDir); + logger?.info(`Successfully parsed ${packageInfo.name}-${packageInfo.version}`); + successCount++; + } catch (e) { + logger?.error(`Error parsing ${topLevelDir} : ${e}`); + errors.push(e); + } + } + } + + return { successCount, errors }; +}; diff --git a/x-pack/plugins/fleet/server/collectors/register.ts b/x-pack/plugins/fleet/server/collectors/register.ts index f19682a5a243a..a194ff9b560e5 100644 --- a/x-pack/plugins/fleet/server/collectors/register.ts +++ b/x-pack/plugins/fleet/server/collectors/register.ts @@ -37,6 +37,16 @@ export const fetchUsage = async (core: CoreSetup, config: FleetConfigType) => { return usage; }; +export const fetchAgentsUsage = async (core: CoreSetup, config: FleetConfigType) => { + const [soClient, esClient] = await getInternalClients(core); + const usage = { + agents_enabled: getIsAgentsEnabled(config), + agents: await getAgentUsage(config, soClient, esClient), + fleet_server: await getFleetServerUsage(soClient, esClient), + }; + return usage; +}; + export function registerFleetUsageCollector( core: CoreSetup, config: FleetConfigType, diff --git a/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts b/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts index 001aa0caf6a47..1b4d784fcdf9d 100644 --- a/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts +++ b/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts @@ -194,3 +194,7 @@ on_failure: field: error.message value: - 'failed in Fleet agent final_pipeline: {{ _ingest.on_failure_message }}'`; + +// File storage indexes supporting endpoint Upload/download +export const FILE_STORAGE_METADATA_INDEX = '.fleet-*-files'; +export const FILE_STORAGE_DATA_INDEX = '.fleet-*-file-data'; diff --git a/x-pack/plugins/fleet/server/plugin.ts b/x-pack/plugins/fleet/server/plugin.ts index 7d00f944fbf81..63ef9a304ade8 100644 --- a/x-pack/plugins/fleet/server/plugin.ts +++ b/x-pack/plugins/fleet/server/plugin.ts @@ -101,7 +101,7 @@ import { AgentServiceImpl, PackageServiceImpl, } from './services'; -import { registerFleetUsageCollector, fetchUsage } from './collectors/register'; +import { registerFleetUsageCollector, fetchUsage, fetchAgentsUsage } from './collectors/register'; import { getAuthzFromRequest, makeRouterWithFleetAuthz } from './routes/security'; import { FleetArtifactsClient } from './services/artifacts'; import type { FleetRouter } from './types/request_context'; @@ -110,6 +110,8 @@ import { setupFleet } from './services/setup'; import { BulkActionsResolver } from './services/agents'; import type { PackagePolicyService } from './services/package_policy_service'; import { PackagePolicyServiceImpl } from './services/package_policy'; +import { registerFleetUsageLogger, startFleetUsageLogger } from './services/fleet_usage_logger'; +import { CheckDeletedFilesTask } from './tasks/check_deleted_files_task'; export interface FleetSetupDeps { security: SecurityPluginSetup; @@ -219,6 +221,7 @@ export class FleetPlugin private readonly fleetStatus$: BehaviorSubject<ServiceStatus>; private bulkActionsResolver?: BulkActionsResolver; private fleetUsageSender?: FleetUsageSender; + private checkDeletedFilesTask?: CheckDeletedFilesTask; private agentService?: AgentService; private packageService?: PackageService; @@ -388,6 +391,7 @@ export class FleetPlugin this.kibanaVersion, this.isProductionMode ); + registerFleetUsageLogger(deps.taskManager, async () => fetchAgentsUsage(core, config)); const router: FleetRouter = core.http.createRouter<FleetRequestHandlerContext>(); // Allow read-only users access to endpoints necessary for Integrations UI @@ -424,6 +428,11 @@ export class FleetPlugin this.telemetryEventsSender.setup(deps.telemetry); this.bulkActionsResolver = new BulkActionsResolver(deps.taskManager, core); + this.checkDeletedFilesTask = new CheckDeletedFilesTask({ + core, + taskManager: deps.taskManager, + logFactory: this.initializerContext.logger, + }); } public start(core: CoreStart, plugins: FleetStartDeps): FleetStartContract { @@ -455,6 +464,8 @@ export class FleetPlugin this.telemetryEventsSender.start(plugins.telemetry, core); this.bulkActionsResolver?.start(plugins.taskManager); this.fleetUsageSender?.start(plugins.taskManager); + this.checkDeletedFilesTask?.start({ taskManager: plugins.taskManager }); + startFleetUsageLogger(plugins.taskManager); const logger = appContextService.getLogger(); @@ -569,7 +580,7 @@ export class FleetPlugin internalSoClient, this.getLogger() ); - return this.packageService; + return this.packageService!; } private getLogger(): Logger { diff --git a/x-pack/plugins/fleet/server/routes/epm/handlers.ts b/x-pack/plugins/fleet/server/routes/epm/handlers.ts index 242e272cd184b..5ef609fe9b6cc 100644 --- a/x-pack/plugins/fleet/server/routes/epm/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/epm/handlers.ts @@ -37,6 +37,7 @@ import type { GetStatsRequestSchema, FleetRequestHandler, UpdatePackageRequestSchema, + GetLimitedPackagesRequestSchema, } from '../../types'; import { bulkInstallPackages, @@ -67,7 +68,9 @@ export const getCategoriesHandler: FleetRequestHandler< TypeOf<typeof GetCategoriesRequestSchema.query> > = async (context, request, response) => { try { - const res = await getCategories(request.query); + const res = await getCategories({ + ...request.query, + }); const body: GetCategoriesResponse = { items: res, response: res, @@ -103,10 +106,17 @@ export const getListHandler: FleetRequestHandler< } }; -export const getLimitedListHandler: FleetRequestHandler = async (context, request, response) => { +export const getLimitedListHandler: FleetRequestHandler< + undefined, + TypeOf<typeof GetLimitedPackagesRequestSchema.query>, + undefined +> = async (context, request, response) => { try { const savedObjectsClient = (await context.fleet).epm.internalSoClient; - const res = await getLimitedPackages({ savedObjectsClient }); + const res = await getLimitedPackages({ + savedObjectsClient, + prerelease: request.query.prerelease, + }); const body: GetLimitedPackagesResponse = { items: res, response: res, @@ -200,7 +210,7 @@ export const getInfoHandler: FleetRequestHandler< try { const savedObjectsClient = (await context.fleet).epm.internalSoClient; const { pkgName, pkgVersion } = request.params; - const { ignoreUnverified = false } = request.query; + const { ignoreUnverified = false, prerelease } = request.query; if (pkgVersion && !semverValid(pkgVersion)) { throw new FleetError('Package version is not a valid semver'); } @@ -210,6 +220,7 @@ export const getInfoHandler: FleetRequestHandler< pkgVersion: pkgVersion || '', skipArchive: true, ignoreUnverified, + prerelease, }); const body: GetInfoResponse = { item: res, @@ -307,7 +318,7 @@ const bulkInstallServiceResponseToHttpEntry = ( export const bulkInstallPackagesFromRegistryHandler: FleetRequestHandler< undefined, - undefined, + TypeOf<typeof BulkUpgradePackagesFromRegistryRequestSchema.query>, TypeOf<typeof BulkUpgradePackagesFromRegistryRequestSchema.body> > = async (context, request, response) => { const coreContext = await context.core; @@ -320,6 +331,7 @@ export const bulkInstallPackagesFromRegistryHandler: FleetRequestHandler< esClient, packagesToInstall: request.body.packages, spaceId, + prerelease: request.query.prerelease, }); const payload = bulkInstalledResponses.map(bulkInstallServiceResponseToHttpEntry); const body: BulkInstallPackagesResponse = { diff --git a/x-pack/plugins/fleet/server/routes/fleet_server_policy_config/handler.ts b/x-pack/plugins/fleet/server/routes/fleet_server_policy_config/handler.ts index 3df4daf126119..705cde4d87e32 100644 --- a/x-pack/plugins/fleet/server/routes/fleet_server_policy_config/handler.ts +++ b/x-pack/plugins/fleet/server/routes/fleet_server_policy_config/handler.ts @@ -78,9 +78,11 @@ export const getFleetServerPolicyHandler: RequestHandler< export const deleteFleetServerPolicyHandler: RequestHandler< TypeOf<typeof GetOneFleetServerHostRequestSchema.params> > = async (context, request, response) => { - const soClient = (await context.core).savedObjects.client; try { - await deleteFleetServerHost(soClient, request.params.itemId); + const coreContext = await context.core; + const soClient = coreContext.savedObjects.client; + const esClient = coreContext.elasticsearch.client.asInternalUser; + await deleteFleetServerHost(soClient, esClient, request.params.itemId); const body = { id: request.params.itemId, }; @@ -102,13 +104,22 @@ export const putFleetServerPolicyHandler: RequestHandler< undefined, TypeOf<typeof PutFleetServerHostRequestSchema.body> > = async (context, request, response) => { - const soClient = (await context.core).savedObjects.client; try { + const coreContext = await await context.core; + const esClient = coreContext.elasticsearch.client.asInternalUser; + const soClient = coreContext.savedObjects.client; + const item = await updateFleetServerHost(soClient, request.params.itemId, request.body); const body = { item, }; + if (item.is_default) { + await agentPolicyService.bumpAllAgentPolicies(soClient, esClient); + } else { + await agentPolicyService.bumpAllAgentPoliciesForFleetServerHosts(soClient, esClient, item.id); + } + return response.ok({ body }); } catch (error) { if (SavedObjectsErrorHelpers.isNotFoundError(error)) { diff --git a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts index d96d574f77bed..ee9caa4def673 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts @@ -204,6 +204,7 @@ export const createPackagePolicyHandler: FleetRequestHandler< pkgName: pkg.name, pkgVersion: pkg.version, ignoreUnverified: force, + prerelease: true, }); newPackagePolicy = simplifiedPackagePolicytoNewPackagePolicy(newPolicy, pkgInfo, { experimental_data_stream_features: pkg.experimental_data_stream_features, diff --git a/x-pack/plugins/fleet/server/saved_objects/index.ts b/x-pack/plugins/fleet/server/saved_objects/index.ts index 4a943789cac68..b0fbe456246c6 100644 --- a/x-pack/plugins/fleet/server/saved_objects/index.ts +++ b/x-pack/plugins/fleet/server/saved_objects/index.ts @@ -70,6 +70,7 @@ const getSavedObjectTypes = ( properties: { fleet_server_hosts: { type: 'keyword' }, has_seen_add_data_notice: { type: 'boolean', index: false }, + prerelease_integrations_enabled: { type: 'boolean' }, }, }, migrations: { @@ -104,6 +105,7 @@ const getSavedObjectTypes = ( data_output_id: { type: 'keyword' }, monitoring_output_id: { type: 'keyword' }, download_source_id: { type: 'keyword' }, + fleet_server_host_id: { type: 'keyword' }, }, }, migrations: { diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v8_6_0.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v8_6_0.ts index 5134249ddd1ef..e43406d859600 100644 --- a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v8_6_0.ts +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v8_6_0.ts @@ -16,5 +16,7 @@ export const migrateSettingsToV860: SavedObjectMigrationFn<Settings, Settings> = // @ts-expect-error has_seen_fleet_migration_notice property does not exists anymore delete settingsDoc.attributes.has_seen_fleet_migration_notice; + settingsDoc.attributes.prerelease_integrations_enabled = false; + return settingsDoc; }; diff --git a/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.test.ts b/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.test.ts index 1059d4a44933f..4ce84ea96eca3 100644 --- a/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.test.ts +++ b/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.test.ts @@ -37,12 +37,13 @@ function mockAgentPolicy(data: Partial<AgentPolicy>) { }); } -jest.mock('../settings', () => { +jest.mock('../fleet_server_host', () => { return { - getSettings: () => { + getFleetServerHostsForAgentPolicy: async () => { return { id: '93f74c0-e876-11ea-b7d3-8b2acec6f75c', - fleet_server_hosts: ['http://fleetserver:8220'], + is_default: true, + host_urls: ['http://fleetserver:8220'], }; }, }; diff --git a/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts b/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts index 283d3d57faae6..3a1ba1d33abc9 100644 --- a/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts @@ -8,24 +8,19 @@ import type { SavedObjectsClientContract } from '@kbn/core/server'; import { safeLoad } from 'js-yaml'; -import type { - FullAgentPolicy, - PackagePolicy, - Settings, - Output, - FullAgentPolicyOutput, -} from '../../types'; +import type { FullAgentPolicy, PackagePolicy, Output, FullAgentPolicyOutput } from '../../types'; import { agentPolicyService } from '../agent_policy'; import { outputService } from '../output'; import { dataTypes, outputType } from '../../../common/constants'; import type { FullAgentPolicyOutputPermissions, PackageInfo } from '../../../common/types'; -import { getSettings } from '../settings'; import { DEFAULT_OUTPUT } from '../../constants'; import { getSourceUriForAgentPolicy } from '../../routes/agent/source_uri_utils'; import { getPackageInfo } from '../epm/packages'; import { pkgToPkgKey, splitPkgKey } from '../epm/registry'; +import { getFleetServerHostsForAgentPolicy } from '../fleet_server_host'; +import { appContextService } from '../app_context'; import { getMonitoringPermissions } from './monitoring_permissions'; import { storedPackagePoliciesToAgentInputs } from '.'; @@ -188,17 +183,19 @@ export async function getFullAgentPolicy( return outputPermissions; }, {}); - // only add settings if not in standalone + // only add fleet server hosts if not in standalone if (!standalone) { - let settings: Settings; - try { - settings = await getSettings(soClient); - } catch (error) { - throw new Error('Default settings is not setup'); - } - if (settings.fleet_server_hosts && settings.fleet_server_hosts.length) { + const fleetServerHost = await getFleetServerHostsForAgentPolicy(soClient, agentPolicy).catch( + (err) => { + appContextService.getLogger()?.error(err); + + return; + } + ); + + if (fleetServerHost) { fullAgentPolicy.fleet = { - hosts: settings.fleet_server_hosts, + hosts: fleetServerHost.host_urls, }; } } diff --git a/x-pack/plugins/fleet/server/services/agent_policy.test.ts b/x-pack/plugins/fleet/server/services/agent_policy.test.ts index 8dd8c885af3e4..5ed4b0a290c93 100644 --- a/x-pack/plugins/fleet/server/services/agent_policy.test.ts +++ b/x-pack/plugins/fleet/server/services/agent_policy.test.ts @@ -391,6 +391,29 @@ describe('agent policy', () => { mockedOutputService.getDefaultDataOutputId.mockResolvedValue('default-output'); mockedGetFullAgentPolicy.mockResolvedValue(null); + const mockFleetServerHost = { + id: 'id1', + name: 'fleet server 1', + host_urls: ['https://host1.fr:8220', 'https://host2-with-a-longer-name.fr:8220'], + is_default: false, + is_preconfigured: false, + }; + soClient.find.mockResolvedValue({ + saved_objects: [ + { + id: 'existing-fleet-server-host', + type: 'fleet-fleet-server-host', + score: 1, + references: [], + version: '1.0.0', + attributes: mockFleetServerHost, + }, + ], + page: 0, + per_page: 0, + total: 0, + }); + const mockSo = { attributes: {}, id: 'policy123', @@ -428,6 +451,28 @@ describe('agent policy', () => { references: [], }; soClient.get.mockResolvedValue(mockSo); + const mockFleetServerHost = { + id: 'id1', + name: 'fleet server 1', + host_urls: ['https://host1.fr:8220', 'https://host2-with-a-longer-name.fr:8220'], + is_default: false, + is_preconfigured: false, + }; + soClient.find.mockResolvedValue({ + saved_objects: [ + { + id: 'existing-fleet-server-host', + type: 'fleet-fleet-server-host', + score: 1, + references: [], + version: '1.0.0', + attributes: mockFleetServerHost, + }, + ], + page: 0, + per_page: 0, + total: 0, + }); soClient.bulkGet.mockResolvedValue({ saved_objects: [mockSo], }); diff --git a/x-pack/plugins/fleet/server/services/agent_policy.ts b/x-pack/plugins/fleet/server/services/agent_policy.ts index b9978d85ee73d..44696a7f1a997 100644 --- a/x-pack/plugins/fleet/server/services/agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/agent_policy.ts @@ -545,6 +545,41 @@ class AgentPolicyService { } } + /** + * Remove a Fleet Server from all agent policies that are using it, to use the default one instead. + */ + public async removeFleetServerHostFromAll( + soClient: SavedObjectsClientContract, + esClient: ElasticsearchClient, + fleetServerHostId: string + ) { + const agentPolicies = ( + await soClient.find<AgentPolicySOAttributes>({ + type: SAVED_OBJECT_TYPE, + fields: ['revision', 'fleet_server_host_id'], + searchFields: ['fleet_server_host_id'], + search: escapeSearchQueryPhrase(fleetServerHostId), + perPage: SO_SEARCH_LIMIT, + }) + ).saved_objects.map((so) => ({ + id: so.id, + ...so.attributes, + })); + + if (agentPolicies.length > 0) { + await pMap( + agentPolicies, + (agentPolicy) => + this.update(soClient, esClient, agentPolicy.id, { + fleet_server_host_id: null, + }), + { + concurrency: 50, + } + ); + } + } + public async bumpAllAgentPoliciesForOutput( soClient: SavedObjectsClientContract, esClient: ElasticsearchClient, @@ -955,6 +990,38 @@ class AgentPolicyService { return res; } + + public async bumpAllAgentPoliciesForFleetServerHosts( + soClient: SavedObjectsClientContract, + esClient: ElasticsearchClient, + fleetServerHostId: string, + options?: { user?: AuthenticatedUser } + ): Promise<SavedObjectsBulkUpdateResponse<AgentPolicy>> { + const currentPolicies = await soClient.find<AgentPolicySOAttributes>({ + type: SAVED_OBJECT_TYPE, + fields: ['revision', 'fleet_server_host_id'], + searchFields: ['fleet_server_host_id'], + search: escapeSearchQueryPhrase(fleetServerHostId), + perPage: SO_SEARCH_LIMIT, + }); + const bumpedPolicies = currentPolicies.saved_objects.map((policy) => { + policy.attributes = { + ...policy.attributes, + revision: policy.attributes.revision + 1, + updated_at: new Date().toISOString(), + updated_by: options?.user ? options.user.username : 'system', + }; + return policy; + }); + const res = await soClient.bulkUpdate<AgentPolicySOAttributes>(bumpedPolicies); + await pMap( + currentPolicies.saved_objects, + (policy) => this.triggerAgentPolicyUpdatedEvent(soClient, esClient, 'updated', policy.id), + { concurrency: 50 } + ); + + return res; + } } export const agentPolicyService = new AgentPolicyService(); diff --git a/x-pack/plugins/fleet/server/services/agents/action_status.ts b/x-pack/plugins/fleet/server/services/agents/action_status.ts index 7ab162b0aef79..5c6753425cbc7 100644 --- a/x-pack/plugins/fleet/server/services/agents/action_status.ts +++ b/x-pack/plugins/fleet/server/services/agents/action_status.ts @@ -12,6 +12,8 @@ import type { FleetServerAgentAction, ActionStatus, ListWithKuery } from '../../ import { AGENT_ACTIONS_INDEX, AGENT_ACTIONS_RESULTS_INDEX } from '../../../common'; import { appContextService } from '..'; +const PRECISION_THRESHOLD = 40000; + /** * Return current bulk actions */ @@ -42,7 +44,7 @@ export async function getActionStatuses( agent_count: { cardinality: { field: 'agent_id', - precision_threshold: 40000, // max value + precision_threshold: PRECISION_THRESHOLD, // max value }, }, }, @@ -65,9 +67,12 @@ export async function getActionStatuses( (bucket: any) => bucket.key === action.actionId ); const nbAgentsActioned = action.nbAgentsActioned || action.nbAgentsActionCreated; + const cardinalityCount = (matchingBucket?.agent_count as any)?.value ?? 0; + const docCount = matchingBucket?.doc_count ?? 0; const nbAgentsAck = Math.min( - matchingBucket?.doc_count ?? 0, - (matchingBucket?.agent_count as any)?.value ?? 0, + docCount, + // only using cardinality count when count lower than precision threshold + docCount > PRECISION_THRESHOLD ? docCount : cardinalityCount, nbAgentsActioned ); const completionTime = (matchingBucket?.max_timestamp as any)?.value_as_string; diff --git a/x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts b/x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts index f05441f3db1ff..af6ae76a646b0 100644 --- a/x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts +++ b/x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts @@ -81,21 +81,12 @@ spec: - name: varlog mountPath: /var/log readOnly: true - - name: etc-kubernetes - mountPath: /hostfs/etc/kubernetes + - name: etc-full + mountPath: /hostfs/etc readOnly: true - name: var-lib mountPath: /hostfs/var/lib readOnly: true - - name: passwd - mountPath: /hostfs/etc/passwd - readOnly: true - - name: group - mountPath: /hostfs/etc/group - readOnly: true - - name: etcsysmd - mountPath: /hostfs/etc/systemd - readOnly: true volumes: - name: datastreams configMap: @@ -113,26 +104,15 @@ spec: - name: varlog hostPath: path: /var/log - # Needed for cloudbeat - - name: etc-kubernetes + # The following volumes are needed for Cloud Security Posture integration (cloudbeat) + # If you are not using this integration, then these volumes and the corresponding + # mounts can be removed. + - name: etc-full hostPath: - path: /etc/kubernetes - # Needed for cloudbeat + path: /etc - name: var-lib hostPath: path: /var/lib - # Needed for cloudbeat - - name: passwd - hostPath: - path: /etc/passwd - # Needed for cloudbeat - - name: group - hostPath: - path: /etc/group - # Needed for cloudbeat - - name: etcsysmd - hostPath: - path: /etc/systemd --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -367,21 +347,12 @@ spec: - name: varlog mountPath: /var/log readOnly: true - - name: etc-kubernetes - mountPath: /hostfs/etc/kubernetes + - name: etc-full + mountPath: /hostfs/etc readOnly: true - name: var-lib mountPath: /hostfs/var/lib readOnly: true - - name: passwd - mountPath: /hostfs/etc/passwd - readOnly: true - - name: group - mountPath: /hostfs/etc/group - readOnly: true - - name: etcsysmd - mountPath: /hostfs/etc/systemd - readOnly: true - name: etc-mid mountPath: /etc/machine-id readOnly: true @@ -398,26 +369,15 @@ spec: - name: varlog hostPath: path: /var/log - # Needed for cloudbeat - - name: etc-kubernetes + # The following volumes are needed for Cloud Security Posture integration (cloudbeat) + # If you are not using this integration, then these volumes and the corresponding + # mounts can be removed. + - name: etc-full hostPath: - path: /etc/kubernetes - # Needed for cloudbeat + path: /etc - name: var-lib hostPath: path: /var/lib - # Needed for cloudbeat - - name: passwd - hostPath: - path: /etc/passwd - # Needed for cloudbeat - - name: group - hostPath: - path: /etc/group - # Needed for cloudbeat - - name: etcsysmd - hostPath: - path: /etc/systemd # Mount /etc/machine-id from the host to determine host ID # Needed for Elastic Security integration - name: etc-mid diff --git a/x-pack/plugins/fleet/server/services/epm/archive/parse.test.ts b/x-pack/plugins/fleet/server/services/epm/archive/parse.test.ts new file mode 100644 index 0000000000000..e4ee10c4e270c --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/archive/parse.test.ts @@ -0,0 +1,139 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { parseDefaultIngestPipeline, parseDataStreamElasticsearchEntry } from './parse'; +describe('parseDefaultIngestPipeline', () => { + it('Should return undefined for stream without any elasticsearch dir', () => { + expect( + parseDefaultIngestPipeline('pkg-1.0.0/data_stream/stream1/', [ + 'pkg-1.0.0/data_stream/stream1/manifest.yml', + ]) + ).toEqual(undefined); + }); + it('Should return undefined for stream with non default ingest pipeline', () => { + expect( + parseDefaultIngestPipeline('pkg-1.0.0/data_stream/stream1/', [ + 'pkg-1.0.0/data_stream/stream1/manifest.yml', + 'pkg-1.0.0/data_stream/stream1/elasticsearch/ingest_pipeline/someotherpipeline.yml', + ]) + ).toEqual(undefined); + }); + it('Should return default for yml ingest pipeline', () => { + expect( + parseDefaultIngestPipeline('pkg-1.0.0/data_stream/stream1/', [ + 'pkg-1.0.0/data_stream/stream1/manifest.yml', + 'pkg-1.0.0/data_stream/stream1/elasticsearch/ingest_pipeline/default.yml', + ]) + ).toEqual('default'); + }); + it('Should return default for json ingest pipeline', () => { + expect( + parseDefaultIngestPipeline('pkg-1.0.0/data_stream/stream1/', [ + 'pkg-1.0.0/data_stream/stream1/manifest.yml', + 'pkg-1.0.0/data_stream/stream1/elasticsearch/ingest_pipeline/default.json', + ]) + ).toEqual('default'); + }); +}); + +describe('parseDataStreamElasticsearchEntry', () => { + it('Should handle undefined elasticsearch', () => { + expect(parseDataStreamElasticsearchEntry()).toEqual({}); + }); + it('Should handle empty elasticsearch', () => { + expect(parseDataStreamElasticsearchEntry({})).toEqual({}); + }); + it('Should not include junk keys', () => { + expect(parseDataStreamElasticsearchEntry({ a: 1, b: 2 })).toEqual({}); + }); + it('Should add index pipeline', () => { + expect(parseDataStreamElasticsearchEntry({}, 'default')).toEqual({ + 'ingest_pipeline.name': 'default', + }); + }); + it('Should add privileges', () => { + expect( + parseDataStreamElasticsearchEntry({ privileges: { index: ['priv1'], cluster: ['priv2'] } }) + ).toEqual({ privileges: { index: ['priv1'], cluster: ['priv2'] } }); + }); + it('Should add source_mode', () => { + expect(parseDataStreamElasticsearchEntry({ source_mode: 'default' })).toEqual({ + source_mode: 'default', + }); + expect(parseDataStreamElasticsearchEntry({ source_mode: 'synthetic' })).toEqual({ + source_mode: 'synthetic', + }); + }); + it('Should add index_template mappings and expand dots', () => { + expect( + parseDataStreamElasticsearchEntry({ + index_template: { mappings: { dynamic: false, something: { 'dot.somethingelse': 'val' } } }, + }) + ).toEqual({ + 'index_template.mappings': { dynamic: false, something: { dot: { somethingelse: 'val' } } }, + }); + }); + it('Should add index_template settings and expand dots', () => { + expect( + parseDataStreamElasticsearchEntry({ + index_template: { + settings: { + index: { + codec: 'best_compression', + 'sort.field': 'monitor.id', + }, + }, + }, + }) + ).toEqual({ + 'index_template.settings': { + index: { + codec: 'best_compression', + sort: { field: 'monitor.id' }, + }, + }, + }); + }); + it('Should handle dotted values for mappings and settings', () => { + expect( + parseDataStreamElasticsearchEntry({ + 'index_template.mappings': { dynamic: false }, + 'index_template.settings': { 'index.lifecycle.name': 'reference' }, + }) + ).toEqual({ + 'index_template.mappings': { dynamic: false }, + 'index_template.settings': { 'index.lifecycle.name': 'reference' }, + }); + }); + it('Should handle non-dotted values for privileges', () => { + expect( + parseDataStreamElasticsearchEntry({ + privileges: { + indices: ['read'], + cluster: ['test'], + }, + }) + ).toEqual({ + privileges: { + indices: ['read'], + cluster: ['test'], + }, + }); + }); + it('Should handle dotted values for privileges', () => { + expect( + parseDataStreamElasticsearchEntry({ + 'privileges.indices': ['read'], + 'privileges.cluster': ['test'], + }) + ).toEqual({ + privileges: { + indices: ['read'], + cluster: ['test'], + }, + }); + }); +}); diff --git a/x-pack/plugins/fleet/server/services/epm/archive/parse.ts b/x-pack/plugins/fleet/server/services/epm/archive/parse.ts index 3fe7087ffb79b..8bcda08fdec6b 100644 --- a/x-pack/plugins/fleet/server/services/epm/archive/parse.ts +++ b/x-pack/plugins/fleet/server/services/epm/archive/parse.ts @@ -5,9 +5,14 @@ * 2.0. */ +import { readFile } from 'fs'; + +import { promisify } from 'util'; +import path from 'path'; + import { merge } from '@kbn/std'; import yaml from 'js-yaml'; -import { pick, uniq } from 'lodash'; +import { pick } from 'lodash'; import semverMajor from 'semver/functions/major'; import semverPrerelease from 'semver/functions/prerelease'; @@ -32,6 +37,7 @@ import { pkgToPkgKey } from '../registry'; import { unpackBufferEntries } from '.'; +const readFileAsync = promisify(readFile); const MANIFESTS: Record<string, Buffer> = {}; const MANIFEST_NAME = 'manifest.yml'; @@ -56,13 +62,13 @@ const expandDottedField = (dottedFieldName: string, val: unknown): object => { } }; -export const expandDottedObject = (dottedObj: object) => { +export const expandDottedObject = (dottedObj: object = {}) => { if (typeof dottedObj !== 'object' || Array.isArray(dottedObj)) { return dottedObj; } return Object.entries(dottedObj).reduce( (acc, [key, val]) => merge(acc, expandDottedField(key, val)), - {} + {} as Record<string, any> ); }; @@ -136,9 +142,9 @@ export async function generatePackageInfoFromArchiveBuffer( ): Promise<{ paths: string[]; packageInfo: ArchivePackage }> { const entries = await unpackBufferEntries(archiveBuffer, contentType); const paths: string[] = []; - entries.forEach(({ path, buffer }) => { - paths.push(path); - if (path.endsWith(MANIFEST_NAME) && buffer) MANIFESTS[path] = buffer; + entries.forEach(({ path: bufferPath, buffer }) => { + paths.push(bufferPath); + if (bufferPath.endsWith(MANIFEST_NAME) && buffer) MANIFESTS[bufferPath] = buffer; }); return { @@ -147,17 +153,33 @@ export async function generatePackageInfoFromArchiveBuffer( }; } -function parseAndVerifyArchive(paths: string[]): ArchivePackage { +/* +This is a util function for verifying packages from a directory not an archive. +It is only to be called from test scripts. +*/ +export async function _generatePackageInfoFromPaths( + paths: string[], + topLevelDir: string +): Promise<ArchivePackage> { + await Promise.all( + paths.map(async (filePath) => { + if (filePath.endsWith(MANIFEST_NAME)) MANIFESTS[filePath] = await readFileAsync(filePath); + }) + ); + return parseAndVerifyArchive(paths, topLevelDir); +} + +function parseAndVerifyArchive(paths: string[], topLevelDirOverride?: string): ArchivePackage { // The top-level directory must match pkgName-pkgVersion, and no other top-level files or directories may be present - const toplevelDir = paths[0].split('/')[0]; - paths.forEach((path) => { - if (path.split('/')[0] !== toplevelDir) { + const toplevelDir = topLevelDirOverride || paths[0].split('/')[0]; + paths.forEach((filePath) => { + if (!filePath.startsWith(toplevelDir)) { throw new PackageInvalidArchiveError('Package contains more than one top-level directory.'); } }); // The package must contain a manifest file ... - const manifestFile = `${toplevelDir}/${MANIFEST_NAME}`; + const manifestFile = path.join(toplevelDir, MANIFEST_NAME); const manifestBuffer = MANIFESTS[manifestFile]; if (!paths.includes(manifestFile) || !manifestBuffer) { throw new PackageInvalidArchiveError(`Package must contain a top-level ${MANIFEST_NAME} file.`); @@ -189,13 +211,19 @@ function parseAndVerifyArchive(paths: string[]): ArchivePackage { // Package name and version from the manifest must match those from the toplevel directory const pkgKey = pkgToPkgKey({ name: parsed.name, version: parsed.version }); - if (toplevelDir !== pkgKey) { + if (!topLevelDirOverride && toplevelDir !== pkgKey) { throw new PackageInvalidArchiveError( `Name ${parsed.name} and version ${parsed.version} do not match top-level directory ${toplevelDir}` ); } - const parsedDataStreams = parseAndVerifyDataStreams(paths, parsed.name, parsed.version); + const parsedDataStreams = parseAndVerifyDataStreams( + paths, + parsed.name, + parsed.version, + topLevelDirOverride + ); + if (parsedDataStreams.length) { parsed.data_streams = parsedDataStreams; } @@ -228,26 +256,27 @@ function parseAndVerifyReadme(paths: string[], pkgName: string, pkgVersion: stri export function parseAndVerifyDataStreams( paths: string[], pkgName: string, - pkgVersion: string + pkgVersion: string, + pkgBasePathOverride?: string ): RegistryDataStream[] { // A data stream is made up of a subdirectory of name-version/data_stream/, containing a manifest.yml - let dataStreamPaths: string[] = []; + const dataStreamPaths = new Set<string>(); const dataStreams: RegistryDataStream[] = []; - const pkgKey = pkgToPkgKey({ name: pkgName, version: pkgVersion }); - - // pick all paths matching name-version/data_stream/DATASTREAM_PATH/... - // from those, pick all unique data stream paths - paths - .filter((path) => path.startsWith(`${pkgKey}/data_stream/`)) - .forEach((path) => { - const parts = path.split('/'); - if (parts.length > 2 && parts[2]) dataStreamPaths.push(parts[2]); - }); - - dataStreamPaths = uniq(dataStreamPaths); + const pkgBasePath = pkgBasePathOverride || pkgToPkgKey({ name: pkgName, version: pkgVersion }); + const dataStreamsBasePath = path.join(pkgBasePath, 'data_stream'); + // pick all paths matching name-version/data_stream/DATASTREAM_NAME/... + // from those, pick all unique data stream names + paths.forEach((filePath) => { + if (!filePath.startsWith(dataStreamsBasePath)) return; + + const streamWithoutPrefix = filePath.slice(dataStreamsBasePath.length); + const [dataStreamPath] = streamWithoutPrefix.split('/').filter((v) => v); // remove undefined incase of leading / + if (dataStreamPath) dataStreamPaths.add(dataStreamPath); + }); dataStreamPaths.forEach((dataStreamPath) => { - const manifestFile = `${pkgKey}/data_stream/${dataStreamPath}/${MANIFEST_NAME}`; + const fullDataStreamPath = path.join(dataStreamsBasePath, dataStreamPath); + const manifestFile = path.join(fullDataStreamPath, MANIFEST_NAME); const manifestBuffer = MANIFESTS[manifestFile]; if (!paths.includes(manifestFile) || !manifestBuffer) { throw new PackageInvalidArchiveError( @@ -273,52 +302,19 @@ export function parseAndVerifyDataStreams( elasticsearch, ...restOfProps } = manifest; + if (!(dataStreamTitle && type)) { throw new PackageInvalidArchiveError( `Invalid manifest for data stream '${dataStreamPath}': one or more fields missing of 'title', 'type'` ); } - let ingestPipeline; - const ingestPipelinePaths = paths.filter((path) => - path.startsWith(`${pkgKey}/data_stream/${dataStreamPath}/elasticsearch/ingest_pipeline`) - ); - - if ( - ingestPipelinePaths.length && - (ingestPipelinePaths.some((ingestPipelinePath) => - ingestPipelinePath.endsWith(DEFAULT_INGEST_PIPELINE_FILE_NAME_YML) - ) || - ingestPipelinePaths.some((ingestPipelinePath) => - ingestPipelinePath.endsWith(DEFAULT_INGEST_PIPELINE_FILE_NAME_JSON) - )) - ) { - ingestPipeline = DEFAULT_INGEST_PIPELINE_VALUE; - } - + const ingestPipeline = parseDefaultIngestPipeline(fullDataStreamPath, paths); const streams = parseAndVerifyStreams(manifestStreams, dataStreamPath); - - const parsedElasticsearchEntry: Record<string, any> = {}; - - if (ingestPipeline) { - parsedElasticsearchEntry['ingest_pipeline.name'] = DEFAULT_INGEST_PIPELINE_VALUE; - } - - if (elasticsearch?.privileges) { - parsedElasticsearchEntry.privileges = elasticsearch.privileges; - } - - if (elasticsearch?.index_template?.mappings) { - parsedElasticsearchEntry['index_template.mappings'] = expandDottedEntries( - elasticsearch.index_template.mappings - ); - } - - if (elasticsearch?.index_template?.settings) { - parsedElasticsearchEntry['index_template.settings'] = expandDottedEntries( - elasticsearch.index_template.settings - ); - } + const parsedElasticsearchEntry = parseDataStreamElasticsearchEntry( + elasticsearch, + ingestPipeline + ); // Build up the stream object here so we can conditionally insert nullable fields. The package registry omits undefined // fields, so we're mimicking that behavior here. @@ -512,3 +508,52 @@ export function parseAndVerifyInputs(manifestInputs: any, location: string): Reg } return inputs; } + +export function parseDataStreamElasticsearchEntry( + elasticsearch?: Record<string, any>, + ingestPipeline?: string +) { + const parsedElasticsearchEntry: Record<string, any> = {}; + const expandedElasticsearch = expandDottedObject(elasticsearch); + if (ingestPipeline) { + parsedElasticsearchEntry['ingest_pipeline.name'] = ingestPipeline; + } + + if (expandedElasticsearch?.privileges) { + parsedElasticsearchEntry.privileges = expandedElasticsearch.privileges; + } + + if (expandedElasticsearch?.source_mode) { + parsedElasticsearchEntry.source_mode = expandedElasticsearch.source_mode; + } + + if (expandedElasticsearch?.index_template?.mappings) { + parsedElasticsearchEntry['index_template.mappings'] = expandDottedEntries( + expandedElasticsearch.index_template.mappings + ); + } + + if (expandedElasticsearch?.index_template?.settings) { + parsedElasticsearchEntry['index_template.settings'] = expandDottedEntries( + expandedElasticsearch.index_template.settings + ); + } + + return parsedElasticsearchEntry; +} + +const isDefaultPipelineFile = (pipelinePath: string) => + pipelinePath.endsWith(DEFAULT_INGEST_PIPELINE_FILE_NAME_YML) || + pipelinePath.endsWith(DEFAULT_INGEST_PIPELINE_FILE_NAME_JSON); + +export function parseDefaultIngestPipeline(fullDataStreamPath: string, paths: string[]) { + const ingestPipelineDirPath = path.join(fullDataStreamPath, '/elasticsearch/ingest_pipeline'); + const defaultIngestPipelinePaths = paths.filter( + (pipelinePath) => + pipelinePath.startsWith(ingestPipelineDirPath) && isDefaultPipelineFile(pipelinePath) + ); + + if (!defaultIngestPipelinePaths.length) return undefined; + + return DEFAULT_INGEST_PIPELINE_VALUE; +} diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts index d69fd167ee117..7ea61bde7a0e8 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts @@ -39,6 +39,14 @@ describe('Install pipeline tests', () => { await res.install(esClient, logger); expect(esClient.ingest.putPipeline).toBeCalled(); + + // It should add the @custom pipeline for the main pipeline + const pipelinesWithCustomProcessor = esClient.ingest.putPipeline.mock.calls.filter((call) => + // @ts-ignore-error + call[0]?.body.includes('@custom') + ); + + expect(pipelinesWithCustomProcessor).toHaveLength(1); }); it('should work with datastream with ingest pipelines define in the package', async () => { @@ -73,6 +81,14 @@ describe('Install pipeline tests', () => { await res.install(esClient, logger); expect(esClient.ingest.putPipeline).toBeCalledTimes(2); + + // It should add the @custom pipeline only for the main pipeline + const pipelinesWithCustomProcessor = esClient.ingest.putPipeline.mock.calls.filter((call) => + // @ts-ignore-error + call[0]?.body.includes('@custom') + ); + + expect(pipelinesWithCustomProcessor).toHaveLength(1); }); }); }); diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts index 2d9fdb31036e7..7ada81c26c926 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts @@ -157,7 +157,8 @@ export async function installAllPipelines({ let datastreamPipelineCreated = false; pipelinePaths.forEach((path) => { const { name, extension } = getNameAndExtension(path); - if (name === dataStream?.ingest_pipeline) { + const isMainPipeline = name === dataStream?.ingest_pipeline; + if (isMainPipeline) { datastreamPipelineCreated = true; } const nameForInstallation = getPipelineNameForInstallation({ @@ -168,9 +169,8 @@ export async function installAllPipelines({ const content = getAsset(path).toString('utf-8'); pipelinesInfos.push({ nameForInstallation, - customIngestPipelineNameForInstallation: dataStream - ? getCustomPipelineNameForDatastream(dataStream) - : undefined, + customIngestPipelineNameForInstallation: + dataStream && isMainPipeline ? getCustomPipelineNameForDatastream(dataStream) : undefined, content, extension, }); diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts index 527b93a66d130..14a773cfd94bf 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts @@ -228,9 +228,17 @@ export function buildComponentTemplates(params: { templateName: string; registryElasticsearch: RegistryElasticsearch | undefined; packageName: string; + pipelineName?: string; defaultSettings: IndexTemplate['template']['settings']; }) { - const { templateName, registryElasticsearch, packageName, defaultSettings, mappings } = params; + const { + templateName, + registryElasticsearch, + packageName, + defaultSettings, + mappings, + pipelineName, + } = params; const packageTemplateName = `${templateName}${PACKAGE_TEMPLATE_SUFFIX}`; const userSettingsTemplateName = `${templateName}${USER_SETTINGS_TEMPLATE_SUFFIX}`; @@ -256,6 +264,7 @@ export function buildComponentTemplates(params: { ...templateSettings, index: { ...templateSettings.index, + ...(pipelineName ? { default_pipeline: pipelineName } : {}), mapping: { ...templateSettings?.mapping, total_fields: { @@ -392,12 +401,12 @@ export function prepareTemplate({ mappings, packageName, templateName, + pipelineName, registryElasticsearch: dataStream.elasticsearch, }); const template = getTemplate({ templateIndexPattern, - pipelineName, packageName, composedOfTemplates: Object.keys(componentTemplates), templatePriority, diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts index 5605125bd4ff3..c0187e1446258 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts @@ -58,14 +58,12 @@ const META_PROP_KEYS = ['metric_type', 'unit']; */ export function getTemplate({ templateIndexPattern, - pipelineName, packageName, composedOfTemplates, templatePriority, hidden, }: { templateIndexPattern: string; - pipelineName?: string | undefined; packageName: string; composedOfTemplates: string[]; templatePriority: number; @@ -78,9 +76,6 @@ export function getTemplate({ templatePriority, hidden ); - if (pipelineName) { - template.template.settings.index.default_pipeline = pipelineName; - } if (template.template.settings.index.final_pipeline) { throw new Error(`Error template for ${templateIndexPattern} contains a final_pipeline`); } diff --git a/x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts b/x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts index 92ea60d290040..2cf665e0fc094 100644 --- a/x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts @@ -141,6 +141,7 @@ export async function installKibanaAssetsAndReferences({ pkgTitle, paths, installedPkg, + spaceId, }: { savedObjectsClient: SavedObjectsClientContract; savedObjectsImporter: Pick<ISavedObjectsImporter, 'import' | 'resolveImportErrors'>; @@ -151,6 +152,7 @@ export async function installKibanaAssetsAndReferences({ pkgTitle: string; paths: string[]; installedPkg?: SavedObject<Installation>; + spaceId: string; }) { const kibanaAssets = await getKibanaAssets(paths); if (installedPkg) await deleteKibanaSavedObjectsAssets({ savedObjectsClient, installedPkg }); @@ -167,7 +169,6 @@ export async function installKibanaAssetsAndReferences({ pkgName, kibanaAssets, }); - await withPackageSpan('Create and assign package tags', () => tagKibanaAssets({ savedObjectTagAssignmentService, @@ -175,6 +176,7 @@ export async function installKibanaAssetsAndReferences({ kibanaAssets, pkgTitle, pkgName, + spaceId, }) ); diff --git a/x-pack/plugins/fleet/server/services/epm/kibana/assets/tag_assets.test.ts b/x-pack/plugins/fleet/server/services/epm/kibana/assets/tag_assets.test.ts index 3c946217d36b4..d887631240175 100644 --- a/x-pack/plugins/fleet/server/services/epm/kibana/assets/tag_assets.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/kibana/assets/tag_assets.test.ts @@ -11,18 +11,18 @@ describe('tagKibanaAssets', () => { updateTagAssignments: jest.fn(), } as any; const savedObjectTagClient = { - getAll: jest.fn(), + get: jest.fn(), create: jest.fn(), } as any; beforeEach(() => { savedObjectTagAssignmentService.updateTagAssignments.mockReset(); - savedObjectTagClient.getAll.mockReset(); + savedObjectTagClient.get.mockReset(); savedObjectTagClient.create.mockReset(); }); - it('should create Managed and System tags when tagKibanaAssets with System package', async () => { - savedObjectTagClient.getAll.mockResolvedValue([]); + it('should create Managed and System tags when tagKibanaAssets with System package when no tags exist', async () => { + savedObjectTagClient.get.mockRejectedValue(new Error('not found')); savedObjectTagClient.create.mockImplementation(({ name }: { name: string }) => Promise.resolve({ id: name.toLowerCase(), name }) ); @@ -34,6 +34,7 @@ describe('tagKibanaAssets', () => { kibanaAssets, pkgTitle: 'System', pkgName: 'system', + spaceId: 'default', }); expect(savedObjectTagClient.create).toHaveBeenCalledWith( @@ -42,7 +43,7 @@ describe('tagKibanaAssets', () => { description: '', color: '#FFFFFF', }, - { id: 'managed', overwrite: true, refresh: false } + { id: 'fleet-managed-default', overwrite: true, refresh: false } ); expect(savedObjectTagClient.create).toHaveBeenCalledWith( { @@ -50,10 +51,10 @@ describe('tagKibanaAssets', () => { description: '', color: '#FFFFFF', }, - { id: 'system', overwrite: true, refresh: false } + { id: 'fleet-pkg-system-default', overwrite: true, refresh: false } ); expect(savedObjectTagAssignmentService.updateTagAssignments).toHaveBeenCalledWith({ - tags: ['managed', 'system'], + tags: ['fleet-managed-default', 'fleet-pkg-system-default'], assign: kibanaAssets.dashboard, unassign: [], refresh: false, @@ -61,10 +62,7 @@ describe('tagKibanaAssets', () => { }); it('should only assign Managed and System tags when tags already exist', async () => { - savedObjectTagClient.getAll.mockResolvedValue([ - { id: 'managed', name: 'Managed' }, - { id: 'system', name: 'System' }, - ]); + savedObjectTagClient.get.mockResolvedValue({ name: '', color: '', description: '' }); const kibanaAssets = { dashboard: [{ id: 'dashboard1', type: 'dashboard' }] } as any; await tagKibanaAssets({ @@ -73,11 +71,12 @@ describe('tagKibanaAssets', () => { kibanaAssets, pkgTitle: 'System', pkgName: 'system', + spaceId: 'default', }); expect(savedObjectTagClient.create).not.toHaveBeenCalled(); expect(savedObjectTagAssignmentService.updateTagAssignments).toHaveBeenCalledWith({ - tags: ['managed', 'system'], + tags: ['fleet-managed-default', 'fleet-pkg-system-default'], assign: kibanaAssets.dashboard, unassign: [], refresh: false, @@ -85,7 +84,7 @@ describe('tagKibanaAssets', () => { }); it('should skip non taggable asset types', async () => { - savedObjectTagClient.getAll.mockResolvedValue([]); + savedObjectTagClient.get.mockRejectedValue(new Error('tag not found')); savedObjectTagClient.create.mockImplementation(({ name }: { name: string }) => Promise.resolve({ id: name.toLowerCase(), name }) ); @@ -104,10 +103,11 @@ describe('tagKibanaAssets', () => { kibanaAssets, pkgTitle: 'System', pkgName: 'system', + spaceId: 'default', }); expect(savedObjectTagAssignmentService.updateTagAssignments).toHaveBeenCalledWith({ - tags: ['managed', 'system'], + tags: ['fleet-managed-default', 'fleet-pkg-system-default'], assign: [ ...kibanaAssets.dashboard, ...kibanaAssets.search, @@ -129,8 +129,132 @@ describe('tagKibanaAssets', () => { kibanaAssets, pkgTitle: 'System', pkgName: 'system', + spaceId: 'default', }); expect(savedObjectTagAssignmentService.updateTagAssignments).not.toHaveBeenCalled(); }); + + it('should use legacy managed tag if it exists', async () => { + savedObjectTagClient.get.mockImplementation(async (id: string) => { + if (id === 'managed') return { name: 'managed', description: '', color: '' }; + + throw new Error('not found'); + }); + + savedObjectTagClient.create.mockImplementation(({ name }: { name: string }) => + Promise.resolve({ id: name.toLowerCase(), name }) + ); + const kibanaAssets = { dashboard: [{ id: 'dashboard1', type: 'dashboard' }] } as any; + + await tagKibanaAssets({ + savedObjectTagAssignmentService, + savedObjectTagClient, + kibanaAssets, + pkgTitle: 'System', + pkgName: 'system', + spaceId: 'default', + }); + + expect(savedObjectTagClient.create).not.toHaveBeenCalledWith( + { + name: 'Managed', + description: '', + color: '#FFFFFF', + }, + { id: 'fleet-managed-default', overwrite: true, refresh: false } + ); + + expect(savedObjectTagClient.create).toHaveBeenCalledWith( + { + name: 'System', + description: '', + color: '#FFFFFF', + }, + { id: 'fleet-pkg-system-default', overwrite: true, refresh: false } + ); + expect(savedObjectTagAssignmentService.updateTagAssignments).toHaveBeenCalledWith({ + tags: ['managed', 'fleet-pkg-system-default'], + assign: kibanaAssets.dashboard, + unassign: [], + refresh: false, + }); + }); + + it('should use legacy package tag if it exists', async () => { + savedObjectTagClient.get.mockImplementation(async (id: string) => { + if (id === 'system') return { name: 'system', description: '', color: '' }; + + throw new Error('not found'); + }); + + savedObjectTagClient.create.mockImplementation(({ name }: { name: string }) => + Promise.resolve({ id: name.toLowerCase(), name }) + ); + const kibanaAssets = { dashboard: [{ id: 'dashboard1', type: 'dashboard' }] } as any; + + await tagKibanaAssets({ + savedObjectTagAssignmentService, + savedObjectTagClient, + kibanaAssets, + pkgTitle: 'System', + pkgName: 'system', + spaceId: 'default', + }); + + expect(savedObjectTagClient.create).toHaveBeenCalledWith( + { + name: 'Managed', + description: '', + color: '#FFFFFF', + }, + { id: 'fleet-managed-default', overwrite: true, refresh: false } + ); + + expect(savedObjectTagClient.create).not.toHaveBeenCalledWith( + { + name: 'System', + description: '', + color: '#FFFFFF', + }, + { id: 'system', overwrite: true, refresh: false } + ); + expect(savedObjectTagAssignmentService.updateTagAssignments).toHaveBeenCalledWith({ + tags: ['fleet-managed-default', 'system'], + assign: kibanaAssets.dashboard, + unassign: [], + refresh: false, + }); + }); + + it('should use both legacy tags if they exist', async () => { + savedObjectTagClient.get.mockImplementation(async (id: string) => { + if (id === 'managed') return { name: 'managed', description: '', color: '' }; + if (id === 'system') return { name: 'system', description: '', color: '' }; + + throw new Error('not found'); + }); + + savedObjectTagClient.create.mockImplementation(({ name }: { name: string }) => + Promise.resolve({ id: name.toLowerCase(), name }) + ); + const kibanaAssets = { dashboard: [{ id: 'dashboard1', type: 'dashboard' }] } as any; + + await tagKibanaAssets({ + savedObjectTagAssignmentService, + savedObjectTagClient, + kibanaAssets, + pkgTitle: 'System', + pkgName: 'system', + spaceId: 'default', + }); + + expect(savedObjectTagClient.create).not.toHaveBeenCalled(); + expect(savedObjectTagAssignmentService.updateTagAssignments).toHaveBeenCalledWith({ + tags: ['managed', 'system'], + assign: kibanaAssets.dashboard, + unassign: [], + refresh: false, + }); + }); }); diff --git a/x-pack/plugins/fleet/server/services/epm/kibana/assets/tag_assets.ts b/x-pack/plugins/fleet/server/services/epm/kibana/assets/tag_assets.ts index 842932d71359e..1d61c3c908872 100644 --- a/x-pack/plugins/fleet/server/services/epm/kibana/assets/tag_assets.ts +++ b/x-pack/plugins/fleet/server/services/epm/kibana/assets/tag_assets.ts @@ -15,22 +15,45 @@ import { KibanaSavedObjectTypeMapping } from './install'; const TAG_COLOR = '#FFFFFF'; const MANAGED_TAG_NAME = 'Managed'; -const MANAGED_TAG_ID = 'managed'; - -export async function tagKibanaAssets({ - savedObjectTagAssignmentService, - savedObjectTagClient, - kibanaAssets, - pkgTitle, - pkgName, -}: { +const LEGACY_MANAGED_TAG_ID = 'managed'; + +const getManagedTagId = (spaceId: string) => `fleet-managed-${spaceId}`; +const getPackageTagId = (spaceId: string, pkgName: string) => `fleet-pkg-${pkgName}-${spaceId}`; +const getLegacyPackageTagId = (pkgName: string) => pkgName; + +interface TagAssetsParams { savedObjectTagAssignmentService: IAssignmentService; savedObjectTagClient: ITagsClient; kibanaAssets: Record<KibanaAssetType, ArchiveAsset[]>; pkgTitle: string; pkgName: string; -}) { - const taggableAssets = Object.entries(kibanaAssets).flatMap(([assetType, assets]) => { + spaceId: string; +} + +export async function tagKibanaAssets(opts: TagAssetsParams) { + const { savedObjectTagAssignmentService, kibanaAssets } = opts; + const taggableAssets = getTaggableAssets(kibanaAssets); + + // no assets to tag + if (taggableAssets.length === 0) { + return; + } + + const [managedTagId, packageTagId] = await Promise.all([ + ensureManagedTag(opts), + ensurePackageTag(opts), + ]); + + await savedObjectTagAssignmentService.updateTagAssignments({ + tags: [managedTagId, packageTagId], + assign: taggableAssets, + unassign: [], + refresh: false, + }); +} + +function getTaggableAssets(kibanaAssets: TagAssetsParams['kibanaAssets']) { + return Object.entries(kibanaAssets).flatMap(([assetType, assets]) => { if (!taggableTypes.includes(KibanaSavedObjectTypeMapping[assetType as KibanaAssetType])) { return []; } @@ -41,41 +64,57 @@ export async function tagKibanaAssets({ return assets; }); +} - // no assets to tag - if (taggableAssets.length === 0) { - return; - } +async function ensureManagedTag( + opts: Pick<TagAssetsParams, 'spaceId' | 'savedObjectTagClient'> +): Promise<string> { + const { spaceId, savedObjectTagClient } = opts; - const allTags = await savedObjectTagClient.getAll(); - let managedTag = allTags.find((tag) => tag.name === MANAGED_TAG_NAME); - if (!managedTag) { - managedTag = await savedObjectTagClient.create( - { - name: MANAGED_TAG_NAME, - description: '', - color: TAG_COLOR, - }, - { id: MANAGED_TAG_ID, overwrite: true, refresh: false } - ); - } + const managedTagId = getManagedTagId(spaceId); + const managedTag = await savedObjectTagClient.get(managedTagId).catch(() => {}); - let packageTag = allTags.find((tag) => tag.name === pkgTitle); - if (!packageTag) { - packageTag = await savedObjectTagClient.create( - { - name: pkgTitle, - description: '', - color: TAG_COLOR, - }, - { id: pkgName, overwrite: true, refresh: false } - ); - } + if (managedTag) return managedTagId; - await savedObjectTagAssignmentService.updateTagAssignments({ - tags: [managedTag.id, packageTag.id], - assign: taggableAssets, - unassign: [], - refresh: false, - }); + const legacyManagedTag = await savedObjectTagClient.get(LEGACY_MANAGED_TAG_ID).catch(() => {}); + + if (legacyManagedTag) return LEGACY_MANAGED_TAG_ID; + + await savedObjectTagClient.create( + { + name: MANAGED_TAG_NAME, + description: '', + color: TAG_COLOR, + }, + { id: managedTagId, overwrite: true, refresh: false } + ); + + return managedTagId; +} + +async function ensurePackageTag( + opts: Pick<TagAssetsParams, 'spaceId' | 'savedObjectTagClient' | 'pkgName' | 'pkgTitle'> +): Promise<string> { + const { spaceId, savedObjectTagClient, pkgName, pkgTitle } = opts; + + const packageTagId = getPackageTagId(spaceId, pkgName); + const packageTag = await savedObjectTagClient.get(packageTagId).catch(() => {}); + + if (packageTag) return packageTagId; + + const legacyPackageTagId = getLegacyPackageTagId(pkgName); + const legacyPackageTag = await savedObjectTagClient.get(legacyPackageTagId).catch(() => {}); + + if (legacyPackageTag) return legacyPackageTagId; + + await savedObjectTagClient.create( + { + name: pkgTitle, + description: '', + color: TAG_COLOR, + }, + { id: packageTagId, overwrite: true, refresh: false } + ); + + return packageTagId; } diff --git a/x-pack/plugins/fleet/server/services/epm/package_service.test.ts b/x-pack/plugins/fleet/server/services/epm/package_service.test.ts index f4f853d778923..44d35f3e4c33c 100644 --- a/x-pack/plugins/fleet/server/services/epm/package_service.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/package_service.test.ts @@ -92,7 +92,7 @@ function getTest( method: mocks.packageClient.fetchFindLatestPackage.bind(mocks.packageClient), args: ['package name'], spy: jest.spyOn(epmRegistry, 'fetchFindLatestPackageOrThrow'), - spyArgs: ['package name'], + spyArgs: ['package name', undefined], spyResponse: { name: 'fetchFindLatestPackage test' }, expectedReturnValue: { name: 'fetchFindLatestPackage test' }, }; diff --git a/x-pack/plugins/fleet/server/services/epm/package_service.ts b/x-pack/plugins/fleet/server/services/epm/package_service.ts index 45fb673771327..f3d82f13d96ee 100644 --- a/x-pack/plugins/fleet/server/services/epm/package_service.ts +++ b/x-pack/plugins/fleet/server/services/epm/package_service.ts @@ -26,6 +26,7 @@ import { checkSuperuser } from '../../routes/security'; import { FleetUnauthorizedError } from '../../errors'; import { installTransforms, isTransform } from './elasticsearch/transform/install'; +import type { FetchFindLatestPackageOptions } from './registry'; import { fetchFindLatestPackageOrThrow, getPackage } from './registry'; import { ensureInstalledPackage, getInstallation } from './packages'; @@ -45,7 +46,10 @@ export interface PackageClient { spaceId?: string; }): Promise<Installation | undefined>; - fetchFindLatestPackage(packageName: string): Promise<RegistryPackage | BundledPackage>; + fetchFindLatestPackage( + packageName: string, + options?: FetchFindLatestPackageOptions + ): Promise<RegistryPackage | BundledPackage>; getPackage( packageName: string, @@ -116,9 +120,12 @@ class PackageClientImpl implements PackageClient { }); } - public async fetchFindLatestPackage(packageName: string) { + public async fetchFindLatestPackage( + packageName: string, + options?: FetchFindLatestPackageOptions + ): Promise<RegistryPackage | BundledPackage> { await this.#runPreflight(); - return fetchFindLatestPackageOrThrow(packageName); + return fetchFindLatestPackageOrThrow(packageName, options); } public async getPackage( diff --git a/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts b/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts index 4ecec17560731..78683ecd07e0a 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts @@ -133,6 +133,7 @@ export async function _installPackage({ paths, installedPkg, logger, + spaceId, }) ); // Necessary to avoid async promise rejection warning diff --git a/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts b/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts index a9d027ce51c8a..66b9323dd0939 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts @@ -22,6 +22,7 @@ interface BulkInstallPackagesParams { force?: boolean; spaceId: string; preferredSource?: 'registry' | 'bundled'; + prerelease?: boolean; } export async function bulkInstallPackages({ @@ -30,6 +31,7 @@ export async function bulkInstallPackages({ esClient, spaceId, force, + prerelease, }: BulkInstallPackagesParams): Promise<BulkInstallResponse[]> { const logger = appContextService.getLogger(); @@ -39,7 +41,7 @@ export async function bulkInstallPackages({ return Promise.resolve(pkg); } - return Registry.fetchFindLatestPackageOrThrow(pkg); + return Registry.fetchFindLatestPackageOrThrow(pkg, { prerelease }); }) ); 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 20ed655d97176..19ced885822a4 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 @@ -22,10 +22,17 @@ import { appContextService } from '../../app_context'; import { PackageNotFoundError } from '../../../errors'; +import { getSettings } from '../../settings'; + import { getPackageInfo, getPackageUsageStats } from './get'; const MockRegistry = Registry as jest.Mocked<typeof Registry>; +jest.mock('../../settings'); + +const mockGetSettings = getSettings as jest.Mock; +mockGetSettings.mockResolvedValue({ prerelease_integrations_enabled: true }); + describe('When using EPM `get` services', () => { describe('and invoking getPackageUsageStats()', () => { let soClient: jest.Mocked<SavedObjectsClientContract>; 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 b8b447a8de526..e8d1cd1380303 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/get.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/get.ts @@ -49,8 +49,14 @@ export async function getPackages( excludeInstallStatus?: boolean; } & Registry.SearchParams ) { - const { savedObjectsClient, experimental, category, excludeInstallStatus = false } = options; - const registryItems = await Registry.fetchList({ category, experimental }).then((items) => { + const { + savedObjectsClient, + category, + excludeInstallStatus = false, + prerelease = false, + } = options; + + const registryItems = await Registry.fetchList({ category, prerelease }).then((items) => { return items.map((item) => Object.assign({}, item, { title: item.title || nameAsTitle(item.name) }, { id: item.name }) ); @@ -87,11 +93,12 @@ export async function getPackages( // Get package names for packages which cannot have more than one package policy on an agent policy export async function getLimitedPackages(options: { savedObjectsClient: SavedObjectsClientContract; + prerelease?: boolean; }): Promise<string[]> { - const { savedObjectsClient } = options; + const { savedObjectsClient, prerelease } = options; const allPackages = await getPackages({ savedObjectsClient, - experimental: true, + prerelease, }); const installedPackages = allPackages.filter( (pkg) => pkg.status === installationStatuses.Installed @@ -126,6 +133,7 @@ export async function getPackageInfo({ pkgVersion, skipArchive = false, ignoreUnverified = false, + prerelease, }: { savedObjectsClient: SavedObjectsClientContract; pkgName: string; @@ -133,10 +141,11 @@ export async function getPackageInfo({ /** Avoid loading the registry archive into the cache (only use for performance reasons). Defaults to `false` */ skipArchive?: boolean; ignoreUnverified?: boolean; + prerelease?: boolean; }): Promise<PackageInfo> { const [savedObject, latestPackage] = await Promise.all([ getInstallationObject({ savedObjectsClient, pkgName }), - Registry.fetchFindLatestPackageOrUndefined(pkgName), + Registry.fetchFindLatestPackageOrUndefined(pkgName, { prerelease }), ]); if (!savedObject && !latestPackage) { diff --git a/x-pack/plugins/fleet/server/services/epm/packages/get_prerelease_setting.ts b/x-pack/plugins/fleet/server/services/epm/packages/get_prerelease_setting.ts new file mode 100644 index 0000000000000..df4b47d13ef2f --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/packages/get_prerelease_setting.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 { SavedObjectsClientContract } from '@kbn/core/server'; + +import { appContextService } from '../../app_context'; +import { getSettings } from '../../settings'; + +export async function getPrereleaseFromSettings( + savedObjectsClient: SavedObjectsClientContract +): Promise<boolean> { + let prerelease: boolean = false; + try { + ({ prerelease_integrations_enabled: prerelease } = await getSettings(savedObjectsClient)); + } catch (err) { + appContextService + .getLogger() + .warn('Error while trying to load prerelease flag from settings, defaulting to false', err); + } + return prerelease; +} 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 ebd0bde8b09b4..d7f67ca1d2ae0 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/install.ts @@ -113,7 +113,7 @@ export async function ensureInstalledPackage(options: { // If pkgVersion isn't specified, find the latest package version const pkgKeyProps = pkgVersion ? { name: pkgName, version: pkgVersion } - : await Registry.fetchFindLatestPackageOrThrow(pkgName); + : await Registry.fetchFindLatestPackageOrThrow(pkgName, { prerelease: true }); const installedPackageResult = await isPackageVersionOrLaterInstalled({ savedObjectsClient, @@ -234,6 +234,7 @@ interface InstallRegistryPackageParams { force?: boolean; neverIgnoreVerificationError?: boolean; ignoreConstraints?: boolean; + prerelease?: boolean; } interface InstallUploadedArchiveParams { savedObjectsClient: SavedObjectsClientContract; @@ -301,6 +302,7 @@ async function installPackageFromRegistry({ const [latestPackage, { paths, packageInfo, verificationResult }] = await Promise.all([ Registry.fetchFindLatestPackageOrThrow(pkgName, { ignoreConstraints, + prerelease: true, }), Registry.getPackage(pkgName, pkgVersion, { ignoreUnverified: force && !neverIgnoreVerificationError, 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 4213a50ebf5bf..a6259d1eb6552 100644 --- a/x-pack/plugins/fleet/server/services/epm/registry/index.ts +++ b/x-pack/plugins/fleet/server/services/epm/registry/index.ts @@ -25,6 +25,7 @@ import type { GetCategoriesRequest, PackageVerificationResult, ArchivePackage, + BundledPackage, } from '../../../types'; import { getArchiveFilelist, @@ -55,6 +56,8 @@ import { getRegistryUrl } from './registry_url'; export interface SearchParams { category?: CategoryId; + prerelease?: boolean; + // deprecated experimental?: boolean; } @@ -70,8 +73,8 @@ export async function fetchList(params?: SearchParams): Promise<RegistrySearchRe if (params.category) { url.searchParams.set('category', params.category); } - if (params.experimental) { - url.searchParams.set('experimental', params.experimental.toString()); + if (params.prerelease) { + url.searchParams.set('prerelease', params.prerelease.toString()); } } @@ -80,22 +83,31 @@ export async function fetchList(params?: SearchParams): Promise<RegistrySearchRe return fetchUrl(url.toString()).then(JSON.parse); } -interface FetchFindLatestPackageOptions { +export interface FetchFindLatestPackageOptions { ignoreConstraints?: boolean; + prerelease?: boolean; } async function _fetchFindLatestPackage( packageName: string, options?: FetchFindLatestPackageOptions -) { +): Promise<RegistryPackage | BundledPackage | null> { return withPackageSpan(`Find latest package ${packageName}`, async () => { const logger = appContextService.getLogger(); - const { ignoreConstraints = false } = options ?? {}; + const { ignoreConstraints = false, prerelease = false } = options ?? {}; const bundledPackage = await getBundledPackageByName(packageName); + // temporary workaround to allow synthetics package beta version until there is a GA available + // needed because synthetics is installed by default on kibana startup + const prereleaseAllowedExceptions = ['synthetics']; + + const prereleaseEnabled = prerelease || prereleaseAllowedExceptions.includes(packageName); + const registryUrl = getRegistryUrl(); - const url = new URL(`${registryUrl}/search?package=${packageName}&experimental=true`); + const url = new URL( + `${registryUrl}/search?package=${packageName}&prerelease=${prereleaseEnabled}` + ); if (!ignoreConstraints) { setKibanaVersion(url); @@ -224,8 +236,8 @@ export async function fetchCategories( const registryUrl = getRegistryUrl(); const url = new URL(`${registryUrl}/categories`); if (params) { - if (params.experimental) { - url.searchParams.set('experimental', params.experimental.toString()); + if (params.prerelease) { + url.searchParams.set('prerelease', params.prerelease.toString()); } if (params.include_policy_templates) { url.searchParams.set('include_policy_templates', params.include_policy_templates.toString()); diff --git a/x-pack/plugins/fleet/server/services/epm/registry/proxy.ts b/x-pack/plugins/fleet/server/services/epm/registry/proxy.ts index 8b1529de93b3c..0ff64789d12ed 100644 --- a/x-pack/plugins/fleet/server/services/epm/registry/proxy.ts +++ b/x-pack/plugins/fleet/server/services/epm/registry/proxy.ts @@ -5,12 +5,9 @@ * 2.0. */ -import HttpProxyAgent from 'http-proxy-agent'; -import HttpsProxyAgent from 'https-proxy-agent'; -import type { - HttpsProxyAgentOptions, - HttpsProxyAgent as IHttpsProxyAgent, -} from 'https-proxy-agent'; +import { HttpProxyAgent } from 'http-proxy-agent'; +import { HttpsProxyAgent } from 'https-proxy-agent'; +import type { HttpsProxyAgentOptions } from 'https-proxy-agent'; import { appContextService } from '../..'; @@ -20,7 +17,7 @@ export interface RegistryProxySettings { proxyRejectUnauthorizedCertificates?: boolean; } -type ProxyAgent = IHttpsProxyAgent | HttpProxyAgent; +type ProxyAgent = HttpsProxyAgent | HttpProxyAgent; type GetProxyAgentParams = RegistryProxySettings & { targetUrl: string }; export function getRegistryProxyUrl(): string | undefined { @@ -30,11 +27,10 @@ export function getRegistryProxyUrl(): string | undefined { export function getProxyAgent(options: GetProxyAgentParams): ProxyAgent { const isHttps = options.targetUrl.startsWith('https:'); - const agentOptions = isHttps && getProxyAgentOptions(options); + const agentOptions = isHttps ? getProxyAgentOptions(options) : options.proxyUrl; const agent: ProxyAgent = isHttps - ? // @ts-expect-error ts(7009) HttpsProxyAgent isn't a class so TS complains about using `new` - new HttpsProxyAgent(agentOptions) - : new HttpProxyAgent(options.proxyUrl); + ? new HttpsProxyAgent(agentOptions) + : new HttpProxyAgent(agentOptions); return agent; } diff --git a/x-pack/plugins/fleet/server/services/files/index.test.ts b/x-pack/plugins/fleet/server/services/files/index.test.ts new file mode 100644 index 0000000000000..8d1baf2202235 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/files/index.test.ts @@ -0,0 +1,204 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ElasticsearchClientMock } from '@kbn/core/server/mocks'; +import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; + +import { ES_SEARCH_LIMIT } from '../../../common/constants'; +import { + FILE_STORAGE_DATA_INDEX, + FILE_STORAGE_METADATA_INDEX, +} from '../../constants/fleet_es_assets'; + +import { fileIdsWithoutChunksByIndex, getFilesByStatus, updateFilesStatus } from '.'; + +const ENDPOINT_FILE_METADATA_INDEX = '.fleet-endpoint-files'; +const ENDPOINT_FILE_INDEX = '.fleet-endpoint-file-data'; + +describe('files service', () => { + let esClientMock: ElasticsearchClientMock; + const abortController = new AbortController(); + + beforeEach(() => { + esClientMock = elasticsearchServiceMock.createElasticsearchClient(); + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + describe('#getFilesByStatus()', () => { + it('should return expected values', async () => { + const status = 'READY'; + esClientMock.search.mockResolvedValueOnce({ + took: 5, + timed_out: false, + _shards: { + total: 1, + successful: 1, + skipped: 0, + failed: 0, + }, + hits: { + hits: [ + { + _index: ENDPOINT_FILE_METADATA_INDEX, + _id: 'someid1', + }, + { + _index: ENDPOINT_FILE_METADATA_INDEX, + _id: 'someid2', + }, + ], + }, + }); + + const result = await getFilesByStatus(esClientMock, abortController, status); + + expect(esClientMock.search).toBeCalledWith( + { + index: FILE_STORAGE_METADATA_INDEX, + body: { + size: ES_SEARCH_LIMIT, + query: { + term: { + 'file.Status.keyword': status, + }, + }, + _source: false, + }, + ignore_unavailable: true, + }, + { signal: abortController.signal } + ); + expect(result).toEqual([ + { _index: ENDPOINT_FILE_METADATA_INDEX, _id: 'someid1' }, + { _index: ENDPOINT_FILE_METADATA_INDEX, _id: 'someid2' }, + ]); + }); + }); + + describe('#fileIdsWithoutChunks()', () => { + it('should return expected values', async () => { + esClientMock.search.mockResolvedValueOnce({ + took: 5, + timed_out: false, + _shards: { + total: 1, + successful: 1, + skipped: 0, + failed: 0, + }, + hits: { + hits: [ + { + _index: ENDPOINT_FILE_INDEX, + _id: 'keep1', + _source: { + bid: 'keep1', + }, + }, + { + _index: ENDPOINT_FILE_INDEX, + _id: 'keep2', + _source: { + bid: 'keep2', + }, + }, + ], + }, + }); + + const files = [ + { _index: ENDPOINT_FILE_METADATA_INDEX, _id: 'keep1' }, + { _index: ENDPOINT_FILE_METADATA_INDEX, _id: 'keep2' }, + { _index: ENDPOINT_FILE_METADATA_INDEX, _id: 'delete1' }, + { _index: ENDPOINT_FILE_METADATA_INDEX, _id: 'delete2' }, + ]; + const { fileIdsByIndex: deletedFileIdsByIndex, allFileIds: allDeletedFileIds } = + await fileIdsWithoutChunksByIndex(esClientMock, abortController, files); + + expect(esClientMock.search).toBeCalledWith( + { + index: FILE_STORAGE_DATA_INDEX, + body: { + size: ES_SEARCH_LIMIT, + query: { + bool: { + must: [ + { + terms: { + 'bid.keyword': Array.from(files.map((file) => file._id)), + }, + }, + { + term: { + last: true, + }, + }, + ], + }, + }, + _source: ['bid'], + }, + }, + { signal: abortController.signal } + ); + expect(deletedFileIdsByIndex).toEqual({ + [ENDPOINT_FILE_METADATA_INDEX]: new Set(['delete1', 'delete2']), + }); + expect(allDeletedFileIds).toEqual(new Set(['delete1', 'delete2'])); + }); + }); + + describe('#updateFilesStatus()', () => { + it('calls esClient.updateByQuery with expected values', () => { + const FAKE_INTEGRATION_METADATA_INDEX = '.fleet-someintegration-files'; + const files = { + [ENDPOINT_FILE_METADATA_INDEX]: new Set(['delete1', 'delete2']), + [FAKE_INTEGRATION_METADATA_INDEX]: new Set(['delete2', 'delete3']), + }; + const status = 'DELETED'; + updateFilesStatus(esClientMock, abortController, files, status); + + expect(esClientMock.updateByQuery).toHaveBeenNthCalledWith( + 1, + { + index: ENDPOINT_FILE_METADATA_INDEX, + refresh: true, + query: { + ids: { + values: Array.from(files[ENDPOINT_FILE_METADATA_INDEX]), + }, + }, + script: { + source: `ctx._source.file.Status = '${status}'`, + lang: 'painless', + }, + }, + { signal: abortController.signal } + ); + expect(esClientMock.updateByQuery).toHaveBeenNthCalledWith( + 2, + { + index: FAKE_INTEGRATION_METADATA_INDEX, + refresh: true, + query: { + ids: { + values: Array.from(files[FAKE_INTEGRATION_METADATA_INDEX]), + }, + }, + script: { + source: `ctx._source.file.Status = '${status}'`, + lang: 'painless', + }, + }, + { signal: abortController.signal } + ); + }); + }); +}); diff --git a/x-pack/plugins/fleet/server/services/files/index.ts b/x-pack/plugins/fleet/server/services/files/index.ts new file mode 100644 index 0000000000000..c5b472e917a53 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/files/index.ts @@ -0,0 +1,149 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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'; +import type { UpdateByQueryResponse, SearchHit } from '@elastic/elasticsearch/lib/api/types'; + +import { + FILE_STORAGE_DATA_INDEX, + FILE_STORAGE_METADATA_INDEX, +} from '../../constants/fleet_es_assets'; +import { ES_SEARCH_LIMIT } from '../../../common/constants'; +import type { FILE_STATUS } from '../../types/files'; + +/** + * Gets files with given status + * + * @param esClient + * @param abortController + * @param status + */ +export async function getFilesByStatus( + esClient: ElasticsearchClient, + abortController: AbortController, + status: FILE_STATUS = 'READY' +): Promise<SearchHit[]> { + const result = await esClient.search( + { + index: FILE_STORAGE_METADATA_INDEX, + body: { + size: ES_SEARCH_LIMIT, + query: { + term: { + 'file.Status.keyword': status, + }, + }, + _source: false, + }, + ignore_unavailable: true, + }, + { signal: abortController.signal } + ); + + return result.hits.hits; +} + +interface FileIdsByIndex { + [index: string]: Set<string>; +} + +/** + * Returns subset of fileIds that don't have any file chunks + * + * @param esClient + * @param abortController + * @param files + */ +export async function fileIdsWithoutChunksByIndex( + esClient: ElasticsearchClient, + abortController: AbortController, + files: SearchHit[] +): Promise<{ fileIdsByIndex: FileIdsByIndex; allFileIds: Set<string> }> { + const allFileIds: Set<string> = new Set(); + const noChunkFileIdsByIndex = files.reduce((acc, file) => { + allFileIds.add(file._id); + + const fileIds = acc[file._index]; + acc[file._index] = fileIds ? fileIds.add(file._id) : new Set([file._id]); + return acc; + }, {} as FileIdsByIndex); + + const chunks = await esClient.search<{ bid: string }>( + { + index: FILE_STORAGE_DATA_INDEX, + body: { + size: ES_SEARCH_LIMIT, + query: { + bool: { + must: [ + { + terms: { + 'bid.keyword': Array.from(allFileIds), + }, + }, + { + term: { + last: true, + }, + }, + ], + }, + }, + _source: ['bid'], + }, + }, + { signal: abortController.signal } + ); + + chunks.hits.hits.forEach((hit) => { + const fileId = hit._source?.bid; + if (!fileId) return; + const integration = hit._index.split('-')[1]; + const metadataIndex = `.fleet-${integration}-files`; + if (noChunkFileIdsByIndex[metadataIndex]?.delete(fileId)) { + allFileIds.delete(fileId); + } + }); + + return { fileIdsByIndex: noChunkFileIdsByIndex, allFileIds }; +} + +/** + * Updates given files to provided status + * + * @param esClient + * @param abortController + * @param fileIdsByIndex + * @param status + */ +export function updateFilesStatus( + esClient: ElasticsearchClient, + abortController: AbortController, + fileIdsByIndex: FileIdsByIndex, + status: FILE_STATUS +): Promise<UpdateByQueryResponse[]> { + return Promise.all( + Object.entries(fileIdsByIndex).map(([index, fileIds]) => { + return esClient.updateByQuery( + { + index, + refresh: true, + query: { + ids: { + values: Array.from(fileIds), + }, + }, + script: { + source: `ctx._source.file.Status = '${status}'`, + lang: 'painless', + }, + }, + { signal: abortController.signal } + ); + }) + ); +} diff --git a/x-pack/plugins/fleet/server/services/fleet_server_host.test.ts b/x-pack/plugins/fleet/server/services/fleet_server_host.test.ts index 72602df6af3db..40f65ca21c5ef 100644 --- a/x-pack/plugins/fleet/server/services/fleet_server_host.test.ts +++ b/x-pack/plugins/fleet/server/services/fleet_server_host.test.ts @@ -13,54 +13,7 @@ import { DEFAULT_FLEET_SERVER_HOST_ID, } from '../constants'; -import { appContextService } from './app_context'; import { migrateSettingsToFleetServerHost } from './fleet_server_host'; -import { getCloudFleetServersHosts } from './settings'; - -jest.mock('./app_context'); - -const mockedAppContextService = appContextService as jest.Mocked<typeof appContextService>; - -describe('getCloudFleetServersHosts', () => { - afterEach(() => { - mockedAppContextService.getCloud.mockReset(); - }); - it('should return undefined if cloud is not setup', () => { - expect(getCloudFleetServersHosts()).toBeUndefined(); - }); - - it('should return fleet server hosts if cloud is correctly setup with default port == 443', () => { - mockedAppContextService.getCloud.mockReturnValue({ - cloudId: - 'dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==', - isCloudEnabled: true, - deploymentId: 'deployment-id-1', - apm: {}, - }); - - expect(getCloudFleetServersHosts()).toMatchInlineSnapshot(` - Array [ - "https://deployment-id-1.fleet.us-east-1.aws.found.io", - ] - `); - }); - - it('should return fleet server hosts if cloud is correctly setup with a default port', () => { - mockedAppContextService.getCloud.mockReturnValue({ - cloudId: - 'test:dGVzdC5mcjo5MjQzJGRhM2I2YjNkYWY5ZDRjODE4ZjI4ZmEzNDdjMzgzODViJDgxMmY4NWMxZjNjZTQ2YTliYjgxZjFjMWIxMzRjNmRl', - isCloudEnabled: true, - deploymentId: 'deployment-id-1', - apm: {}, - }); - - expect(getCloudFleetServersHosts()).toMatchInlineSnapshot(` - Array [ - "https://deployment-id-1.fleet.test.fr:9243", - ] - `); - }); -}); describe('migrateSettingsToFleetServerHost', () => { it('should not migrate settings if a default fleet server policy config exists', async () => { diff --git a/x-pack/plugins/fleet/server/services/fleet_server_host.ts b/x-pack/plugins/fleet/server/services/fleet_server_host.ts index a3ade854770c3..68b688bcbfcc1 100644 --- a/x-pack/plugins/fleet/server/services/fleet_server_host.ts +++ b/x-pack/plugins/fleet/server/services/fleet_server_host.ts @@ -5,8 +5,9 @@ * 2.0. */ -import type { SavedObjectsClientContract } from '@kbn/core/server'; +import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; +import { normalizeHostsForAgents } from '../../common/services'; import { GLOBAL_SETTINGS_SAVED_OBJECT_TYPE, FLEET_SERVER_HOST_SAVED_OBJECT_TYPE, @@ -19,9 +20,12 @@ import type { FleetServerHostSOAttributes, FleetServerHost, NewFleetServerHost, + AgentPolicy, } from '../types'; import { FleetServerHostUnauthorizedError } from '../errors'; +import { agentPolicyService } from './agent_policy'; + export async function createFleetServerHost( soClient: SavedObjectsClientContract, data: NewFleetServerHost, @@ -39,6 +43,10 @@ export async function createFleetServerHost( } } + if (data.host_urls) { + data.host_urls = data.host_urls.map(normalizeHostsForAgents); + } + const res = await soClient.create<FleetServerHostSOAttributes>( FLEET_SERVER_HOST_SAVED_OBJECT_TYPE, data, @@ -85,6 +93,7 @@ export async function listFleetServerHosts(soClient: SavedObjectsClientContract) export async function deleteFleetServerHost( soClient: SavedObjectsClientContract, + esClient: ElasticsearchClient, id: string, options?: { fromPreconfiguration?: boolean } ) { @@ -102,6 +111,8 @@ export async function deleteFleetServerHost( ); } + await agentPolicyService.removeFleetServerHostFromAll(soClient, esClient, id); + return await soClient.delete(FLEET_SERVER_HOST_SAVED_OBJECT_TYPE, id); } @@ -133,6 +144,10 @@ export async function updateFleetServerHost( } } + if (data.host_urls) { + data.host_urls = data.host_urls.map(normalizeHostsForAgents); + } + await soClient.update<FleetServerHostSOAttributes>(FLEET_SERVER_HOST_SAVED_OBJECT_TYPE, id, data); return { @@ -177,6 +192,22 @@ export async function bulkGetFleetServerHosts( ); } +export async function getFleetServerHostsForAgentPolicy( + soClient: SavedObjectsClientContract, + agentPolicy: AgentPolicy +) { + if (agentPolicy.fleet_server_host_id) { + return getFleetServerHost(soClient, agentPolicy.fleet_server_host_id); + } + + const defaultFleetServerHost = await getDefaultFleetServerHost(soClient); + if (!defaultFleetServerHost) { + throw new Error('Default Fleet Server host is not setup'); + } + + return defaultFleetServerHost; +} + /** * Get the default Fleet server policy hosts or throw if it does not exists */ diff --git a/x-pack/plugins/fleet/server/services/fleet_usage_logger.ts b/x-pack/plugins/fleet/server/services/fleet_usage_logger.ts new file mode 100644 index 0000000000000..6aa84262dc541 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/fleet_usage_logger.ts @@ -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 type { + ConcreteTaskInstance, + TaskManagerStartContract, + TaskManagerSetupContract, +} from '@kbn/task-manager-plugin/server'; + +import type { fetchAgentsUsage } from '../collectors/register'; + +import { appContextService } from './app_context'; + +const TASK_ID = 'Fleet-Usage-Logger-Task'; +const TASK_TYPE = 'Fleet-Usage-Logger'; + +export async function registerFleetUsageLogger( + taskManager: TaskManagerSetupContract, + fetchUsage: () => ReturnType<typeof fetchAgentsUsage> +) { + taskManager.registerTaskDefinitions({ + [TASK_TYPE]: { + title: 'Fleet Usage Logger', + timeout: '1m', + maxAttempts: 1, + createTaskRunner: ({ taskInstance }: { taskInstance: ConcreteTaskInstance }) => { + return { + async run() { + try { + const usageData = await fetchUsage(); + if (appContextService.getLogger().isLevelEnabled('debug')) { + appContextService.getLogger().debug(`Fleet Usage: ${JSON.stringify(usageData)}`); + } else { + appContextService.getLogger().info(`Fleet Usage: ${JSON.stringify(usageData)}`); + } + } catch (error) { + appContextService + .getLogger() + .error('Error occurred while fetching fleet usage: ' + error); + } + }, + + async cancel() {}, + }; + }, + }, + }); +} + +export async function startFleetUsageLogger(taskManager: TaskManagerStartContract) { + const isDebugLogLevelEnabled = appContextService.getLogger().isLevelEnabled('debug'); + const isInfoLogLevelEnabled = appContextService.getLogger().isLevelEnabled('info'); + if (!isInfoLogLevelEnabled) { + return; + } + appContextService.getLogger().info(`Task ${TASK_ID} scheduled with interval 5m`); + await taskManager?.ensureScheduled({ + id: TASK_ID, + taskType: TASK_TYPE, + schedule: { + interval: isDebugLogLevelEnabled ? '5m' : '15m', + }, + scope: ['fleet'], + state: {}, + params: {}, + }); +} diff --git a/x-pack/plugins/fleet/server/services/package_policies/package_policy_name_helper.ts b/x-pack/plugins/fleet/server/services/package_policies/package_policy_name_helper.ts index c712ccc06ad92..90db39a3e03b0 100644 --- a/x-pack/plugins/fleet/server/services/package_policies/package_policy_name_helper.ts +++ b/x-pack/plugins/fleet/server/services/package_policies/package_policy_name_helper.ts @@ -39,20 +39,23 @@ export async function incrementPackagePolicyCopyName( // find all pacakge policies starting with the same name and increment the name const packagePolicyData = await packagePolicyService.list(soClient, { perPage: SO_SEARCH_LIMIT, - kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.name: ${packageName}*`, + // split package name on first space as KQL do not support wildcard and space + kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.name: ${packageName.split(' ')[0]}*`, }); const maxVersion = packagePolicyData.items.length > 0 ? Math.max( - ...packagePolicyData.items.map((item) => { - const matches = item.name.match(/^(.*)\s\(copy\s?([0-9]*)\)$/); - if (matches) { - return parseInt(matches[2], 10) || 1; - } + ...packagePolicyData.items + .filter((item) => item.name.startsWith(packageName)) + .map((item) => { + const matches = item.name.match(/^(.*)\s\(copy\s?([0-9]*)\)$/); + if (matches) { + return parseInt(matches[2], 10) || 1; + } - return 0; - }) + return 0; + }) ) : 0; diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index f52316dd4452b..b4e78d2f4c2ca 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -187,6 +187,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { savedObjectsClient: soClient, pkgName: packagePolicy.package.name, pkgVersion: packagePolicy.package.version, + prerelease: true, })); // Check if it is a limited package, and if so, check that the corresponding agent policy does not @@ -508,6 +509,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { savedObjectsClient: soClient, pkgName: packagePolicy.package.name, pkgVersion: packagePolicy.package.version, + prerelease: true, }); validatePackagePolicyOrThrow(packagePolicy, pkgInfo); @@ -801,6 +803,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { savedObjectsClient: soClient, pkgName: packagePolicy!.package!.name, pkgVersion: pkgVersion ?? '', + prerelease: !!pkgVersion, // using prerelease only if version is specified }); } @@ -1129,6 +1132,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { pkgName, pkgVersion, skipArchive: true, + prerelease: true, }); if (packageInfo) { return packageToPackagePolicy(packageInfo, ''); @@ -1146,6 +1150,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { savedObjectsClient: soClient, pkgName: pkgInstall.name, pkgVersion: pkgInstall.version, + prerelease: true, }); if (packageInfo) { @@ -1594,6 +1599,7 @@ async function getPackageInfoForPackagePolicies( savedObjectsClient: soClient, pkgName: pkgInfo.name, pkgVersion: pkgInfo.version, + prerelease: true, }); resultMap.set(pkgKey, pkgInfoData); diff --git a/x-pack/plugins/fleet/server/services/preconfiguration/fleet_server_host.test.ts b/x-pack/plugins/fleet/server/services/preconfiguration/fleet_server_host.test.ts index 468058f87f448..87717860e9be4 100644 --- a/x-pack/plugins/fleet/server/services/preconfiguration/fleet_server_host.test.ts +++ b/x-pack/plugins/fleet/server/services/preconfiguration/fleet_server_host.test.ts @@ -4,10 +4,27 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { savedObjectsClientMock } from '@kbn/core/server/mocks'; -import { getPreconfiguredFleetServerHostFromConfig } from './fleet_server_host'; +import { appContextService } from '../app_context'; +import { getDefaultFleetServerHost, createFleetServerHost } from '../fleet_server_host'; + +import { + createCloudFleetServerHostIfNeeded, + getCloudFleetServersHosts, + getPreconfiguredFleetServerHostFromConfig, +} from './fleet_server_host'; jest.mock('../fleet_server_host'); +jest.mock('../app_context'); + +const mockedAppContextService = appContextService as jest.Mocked<typeof appContextService>; +const mockedGetDefaultFleetServerHost = getDefaultFleetServerHost as jest.MockedFunction< + typeof getDefaultFleetServerHost +>; +const mockedCreateFleetServerHost = createFleetServerHost as jest.MockedFunction< + typeof createFleetServerHost +>; describe('getPreconfiguredFleetServerHostFromConfig', () => { it('should work with preconfigured fleetServerHosts', () => { @@ -81,3 +98,106 @@ describe('getPreconfiguredFleetServerHostFromConfig', () => { ); }); }); + +describe('getCloudFleetServersHosts', () => { + afterEach(() => { + mockedAppContextService.getCloud.mockReset(); + }); + it('should return undefined if cloud is not setup', () => { + expect(getCloudFleetServersHosts()).toBeUndefined(); + }); + + it('should return fleet server hosts if cloud is correctly setup with default port == 443', () => { + mockedAppContextService.getCloud.mockReturnValue({ + cloudId: + 'dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==', + isCloudEnabled: true, + deploymentId: 'deployment-id-1', + apm: {}, + }); + + expect(getCloudFleetServersHosts()).toMatchInlineSnapshot(` + Array [ + "https://deployment-id-1.fleet.us-east-1.aws.found.io", + ] + `); + }); + + it('should return fleet server hosts if cloud is correctly setup with a default port', () => { + mockedAppContextService.getCloud.mockReturnValue({ + cloudId: + 'test:dGVzdC5mcjo5MjQzJGRhM2I2YjNkYWY5ZDRjODE4ZjI4ZmEzNDdjMzgzODViJDgxMmY4NWMxZjNjZTQ2YTliYjgxZjFjMWIxMzRjNmRl', + isCloudEnabled: true, + deploymentId: 'deployment-id-1', + apm: {}, + }); + + expect(getCloudFleetServersHosts()).toMatchInlineSnapshot(` + Array [ + "https://deployment-id-1.fleet.test.fr:9243", + ] + `); + }); +}); + +describe('createCloudFleetServerHostIfNeeded', () => { + beforeEach(() => { + mockedCreateFleetServerHost.mockReset(); + }); + afterEach(() => { + mockedAppContextService.getCloud.mockReset(); + }); + it('should do nothing if there is no cloud fleet server hosts', async () => { + const soClient = savedObjectsClientMock.create(); + + await createCloudFleetServerHostIfNeeded(soClient); + + expect(mockedCreateFleetServerHost).not.toBeCalled(); + }); + + it('should do nothing if there is already an host configured', async () => { + const soClient = savedObjectsClientMock.create(); + mockedAppContextService.getCloud.mockReturnValue({ + cloudId: + 'dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==', + isCloudEnabled: true, + deploymentId: 'deployment-id-1', + apm: {}, + }); + mockedGetDefaultFleetServerHost.mockResolvedValue({ + id: 'test', + } as any); + + await createCloudFleetServerHostIfNeeded(soClient); + + expect(mockedCreateFleetServerHost).not.toBeCalled(); + }); + + it('should create a new fleet server hosts if there is no host configured', async () => { + const soClient = savedObjectsClientMock.create(); + mockedAppContextService.getCloud.mockReturnValue({ + cloudId: + 'dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==', + isCloudEnabled: true, + deploymentId: 'deployment-id-1', + apm: {}, + }); + mockedGetDefaultFleetServerHost.mockResolvedValue(null); + soClient.create.mockResolvedValue({ + id: 'test-id', + attributes: {}, + } as any); + + await createCloudFleetServerHostIfNeeded(soClient); + + expect(mockedCreateFleetServerHost).toBeCalledTimes(1); + expect(mockedCreateFleetServerHost).toBeCalledWith( + expect.anything(), + expect.objectContaining({ + host_urls: ['https://deployment-id-1.fleet.us-east-1.aws.found.io'], + is_default: true, + }), + { id: 'fleet-default-fleet-server-host', overwrite: true, fromPreconfiguration: true } + ); + }); +}); diff --git a/x-pack/plugins/fleet/server/services/preconfiguration/fleet_server_host.ts b/x-pack/plugins/fleet/server/services/preconfiguration/fleet_server_host.ts index 465a2f8706ea9..15e2bf5d80a7b 100644 --- a/x-pack/plugins/fleet/server/services/preconfiguration/fleet_server_host.ts +++ b/x-pack/plugins/fleet/server/services/preconfiguration/fleet_server_host.ts @@ -5,20 +5,41 @@ * 2.0. */ -import type { SavedObjectsClientContract } from '@kbn/core/server'; +import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; import { isEqual } from 'lodash'; +import { decodeCloudId, normalizeHostsForAgents } from '../../../common/services'; import type { FleetConfigType } from '../../config'; import { DEFAULT_FLEET_SERVER_HOST_ID } from '../../constants'; import type { FleetServerHost } from '../../types'; +import { appContextService } from '../app_context'; import { bulkGetFleetServerHosts, createFleetServerHost, deleteFleetServerHost, listFleetServerHosts, updateFleetServerHost, + getDefaultFleetServerHost, } from '../fleet_server_host'; +import { agentPolicyService } from '../agent_policy'; + +export function getCloudFleetServersHosts() { + const cloudSetup = appContextService.getCloud(); + if (cloudSetup && cloudSetup.isCloudEnabled && cloudSetup.cloudId && cloudSetup.deploymentId) { + const res = decodeCloudId(cloudSetup.cloudId); + if (!res) { + return; + } + + // Fleet Server url are formed like this `https://<deploymentId>.fleet.<host> + return [ + `https://${cloudSetup.deploymentId}.fleet.${res.host}${ + res.defaultPort !== '443' ? `:${res.defaultPort}` : '' + }`, + ]; + } +} export function getPreconfiguredFleetServerHostFromConfig(config?: FleetConfigType) { const { fleetServerHosts: fleetServerHostsFromConfig } = config; @@ -47,14 +68,21 @@ export function getPreconfiguredFleetServerHostFromConfig(config?: FleetConfigTy export async function ensurePreconfiguredFleetServerHosts( soClient: SavedObjectsClientContract, + esClient: ElasticsearchClient, preconfiguredFleetServerHosts: FleetServerHost[] ) { - await createOrUpdatePreconfiguredFleetServerHosts(soClient, preconfiguredFleetServerHosts); - await cleanPreconfiguredFleetServerHosts(soClient, preconfiguredFleetServerHosts); + await createOrUpdatePreconfiguredFleetServerHosts( + soClient, + esClient, + preconfiguredFleetServerHosts + ); + await createCloudFleetServerHostIfNeeded(soClient); + await cleanPreconfiguredFleetServerHosts(soClient, esClient, preconfiguredFleetServerHosts); } export async function createOrUpdatePreconfiguredFleetServerHosts( soClient: SavedObjectsClientContract, + esClient: ElasticsearchClient, preconfiguredFleetServerHosts: FleetServerHost[] ) { const existingFleetServerHosts = await bulkGetFleetServerHosts( @@ -77,7 +105,10 @@ export async function createOrUpdatePreconfiguredFleetServerHosts( (!existingHost.is_preconfigured || existingHost.is_default !== preconfiguredFleetServerHost.is_default || existingHost.name !== preconfiguredFleetServerHost.name || - !isEqual(existingHost?.host_urls, preconfiguredFleetServerHost.host_urls)); + !isEqual( + existingHost.host_urls.map(normalizeHostsForAgents), + preconfiguredFleetServerHost.host_urls.map(normalizeHostsForAgents) + )); if (isCreate) { await createFleetServerHost( @@ -98,14 +129,40 @@ export async function createOrUpdatePreconfiguredFleetServerHosts( }, { fromPreconfiguration: true } ); - // TODO Bump revision of all policies using that output + if (data.is_default) { + await agentPolicyService.bumpAllAgentPolicies(soClient, esClient); + } else { + await agentPolicyService.bumpAllAgentPoliciesForFleetServerHosts(soClient, esClient, id); + } } }) ); } +export async function createCloudFleetServerHostIfNeeded(soClient: SavedObjectsClientContract) { + const cloudServerHosts = getCloudFleetServersHosts(); + if (!cloudServerHosts || cloudServerHosts.length === 0) { + return; + } + + const defaultFleetServerHost = await getDefaultFleetServerHost(soClient); + if (!defaultFleetServerHost) { + await createFleetServerHost( + soClient, + { + name: 'Default', + is_default: true, + host_urls: cloudServerHosts, + is_preconfigured: false, + }, + { id: DEFAULT_FLEET_SERVER_HOST_ID, overwrite: true, fromPreconfiguration: true } + ); + } +} + export async function cleanPreconfiguredFleetServerHosts( soClient: SavedObjectsClientContract, + esClient: ElasticsearchClient, preconfiguredFleetServerHosts: FleetServerHost[] ) { const existingFleetServerHosts = await listFleetServerHosts(soClient); @@ -131,7 +188,7 @@ export async function cleanPreconfiguredFleetServerHosts( } ); } else { - await deleteFleetServerHost(soClient, existingFleetServerHost.id, { + await deleteFleetServerHost(soClient, esClient, existingFleetServerHost.id, { fromPreconfiguration: true, }); } diff --git a/x-pack/plugins/fleet/server/services/settings.test.ts b/x-pack/plugins/fleet/server/services/settings.test.ts index 642553f0db674..ca0be8130b21a 100644 --- a/x-pack/plugins/fleet/server/services/settings.test.ts +++ b/x-pack/plugins/fleet/server/services/settings.test.ts @@ -8,53 +8,12 @@ import { savedObjectsClientMock } from '@kbn/core/server/mocks'; import { appContextService } from './app_context'; -import { getCloudFleetServersHosts, settingsSetup } from './settings'; +import { settingsSetup } from './settings'; jest.mock('./app_context'); const mockedAppContextService = appContextService as jest.Mocked<typeof appContextService>; -describe('getCloudFleetServersHosts', () => { - afterEach(() => { - mockedAppContextService.getCloud.mockReset(); - }); - it('should return undefined if cloud is not setup', () => { - expect(getCloudFleetServersHosts()).toBeUndefined(); - }); - - it('should return fleet server hosts if cloud is correctly setup with default port == 443', () => { - mockedAppContextService.getCloud.mockReturnValue({ - cloudId: - 'dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==', - isCloudEnabled: true, - deploymentId: 'deployment-id-1', - apm: {}, - }); - - expect(getCloudFleetServersHosts()).toMatchInlineSnapshot(` - Array [ - "https://deployment-id-1.fleet.us-east-1.aws.found.io", - ] - `); - }); - - it('should return fleet server hosts if cloud is correctly setup with a default port', () => { - mockedAppContextService.getCloud.mockReturnValue({ - cloudId: - 'test:dGVzdC5mcjo5MjQzJGRhM2I2YjNkYWY5ZDRjODE4ZjI4ZmEzNDdjMzgzODViJDgxMmY4NWMxZjNjZTQ2YTliYjgxZjFjMWIxMzRjNmRl', - isCloudEnabled: true, - deploymentId: 'deployment-id-1', - apm: {}, - }); - - expect(getCloudFleetServersHosts()).toMatchInlineSnapshot(` - Array [ - "https://deployment-id-1.fleet.test.fr:9243", - ] - `); - }); -}); - describe('settingsSetup', () => { afterEach(() => { mockedAppContextService.getCloud.mockReset(); @@ -82,7 +41,7 @@ describe('settingsSetup', () => { expect(soClientMock.create).toBeCalled(); }); - it('should do nothing if there is settings and no default fleet server hosts', async () => { + it('should do nothing if there is settings', async () => { const soClientMock = savedObjectsClientMock.create(); soClientMock.find.mockResolvedValue({ @@ -111,204 +70,4 @@ describe('settingsSetup', () => { expect(soClientMock.create).not.toBeCalled(); }); - - it('should update settings if there is settings without fleet server hosts and default fleet server hosts', async () => { - const soClientMock = savedObjectsClientMock.create(); - mockedAppContextService.getCloud.mockReturnValue({ - cloudId: - 'test:dGVzdC5mcjo5MjQzJGRhM2I2YjNkYWY5ZDRjODE4ZjI4ZmEzNDdjMzgzODViJDgxMmY4NWMxZjNjZTQ2YTliYjgxZjFjMWIxMzRjNmRl', - isCloudEnabled: true, - deploymentId: 'deployment-id-1', - apm: {}, - }); - - soClientMock.find.mockResolvedValue({ - total: 1, - page: 0, - per_page: 10, - saved_objects: [ - { - id: 'defaultsettings', - attributes: {}, - type: 'so_type', - references: [], - score: 0, - }, - ], - }); - - soClientMock.update.mockResolvedValue({ - id: 'updated', - attributes: {}, - references: [], - type: 'so_type', - }); - - soClientMock.create.mockResolvedValue({ - id: 'created', - attributes: {}, - references: [], - type: 'so_type', - }); - - await settingsSetup(soClientMock); - - expect(soClientMock.create).not.toBeCalled(); - expect(soClientMock.update).toBeCalledWith('ingest_manager_settings', 'defaultsettings', { - fleet_server_hosts: ['https://deployment-id-1.fleet.test.fr:9243'], - }); - }); - - it('should update settings if there is a new fleet server host in the config', async () => { - const soClientMock = savedObjectsClientMock.create(); - mockedAppContextService.getCloud.mockReturnValue({ - cloudId: - 'test:dGVzdC5mcjo5MjQzJGRhM2I2YjNkYWY5ZDRjODE4ZjI4ZmEzNDdjMzgzODViJDgxMmY4NWMxZjNjZTQ2YTliYjgxZjFjMWIxMzRjNmRl', - isCloudEnabled: true, - deploymentId: 'deployment-id-1', - apm: {}, - }); - mockedAppContextService.getConfig.mockReturnValue({ - agents: { - fleet_server: { hosts: ['http://fleetserverupdated.fr:8220'] }, - }, - } as any); - - soClientMock.find.mockResolvedValue({ - total: 1, - page: 0, - per_page: 10, - saved_objects: [ - { - id: 'defaultsettings', - attributes: { - fleet_server_hosts: ['https://deployment-id-1.fleet.test.fr:9243'], - }, - type: 'so_type', - references: [], - score: 0, - }, - ], - }); - - soClientMock.update.mockResolvedValue({ - id: 'updated', - attributes: {}, - references: [], - type: 'so_type', - }); - - soClientMock.create.mockResolvedValue({ - id: 'created', - attributes: {}, - references: [], - type: 'so_type', - }); - - await settingsSetup(soClientMock); - - expect(soClientMock.create).not.toBeCalled(); - expect(soClientMock.update).toBeCalledWith('ingest_manager_settings', 'defaultsettings', { - fleet_server_hosts: ['http://fleetserverupdated.fr:8220'], - }); - }); - - it('should update settings if there is no new fleet server hosts in the config', async () => { - const soClientMock = savedObjectsClientMock.create(); - mockedAppContextService.getCloud.mockReturnValue({ - cloudId: - 'test:dGVzdC5mcjo5MjQzJGRhM2I2YjNkYWY5ZDRjODE4ZjI4ZmEzNDdjMzgzODViJDgxMmY4NWMxZjNjZTQ2YTliYjgxZjFjMWIxMzRjNmRl', - isCloudEnabled: true, - deploymentId: 'deployment-id-1', - apm: {}, - }); - mockedAppContextService.getConfig.mockReturnValue({ - agents: { - fleet_server: { hosts: ['http://fleetserverupdated.fr:8220'] }, - }, - } as any); - - soClientMock.find.mockResolvedValue({ - total: 1, - page: 0, - per_page: 10, - saved_objects: [ - { - id: 'defaultsettings', - attributes: { - fleet_server_hosts: ['http://fleetserverupdated.fr:8220'], - }, - type: 'so_type', - references: [], - score: 0, - }, - ], - }); - - soClientMock.update.mockResolvedValue({ - id: 'updated', - attributes: {}, - references: [], - type: 'so_type', - }); - - soClientMock.create.mockResolvedValue({ - id: 'created', - attributes: {}, - references: [], - type: 'so_type', - }); - - await settingsSetup(soClientMock); - - expect(soClientMock.create).not.toBeCalled(); - expect(soClientMock.update).not.toBeCalled(); - }); - - it('should not update settings with cloud settings if there is settings with fleet server hosts and default fleet server hosts', async () => { - const soClientMock = savedObjectsClientMock.create(); - mockedAppContextService.getCloud.mockReturnValue({ - cloudId: - 'test:dGVzdC5mcjo5MjQzJGRhM2I2YjNkYWY5ZDRjODE4ZjI4ZmEzNDdjMzgzODViJDgxMmY4NWMxZjNjZTQ2YTliYjgxZjFjMWIxMzRjNmRl', - isCloudEnabled: true, - deploymentId: 'deployment-id-1', - apm: {}, - }); - - soClientMock.find.mockResolvedValue({ - total: 1, - page: 0, - per_page: 10, - saved_objects: [ - { - id: 'defaultsettings', - attributes: { - fleet_server_hosts: ['http://fleetserver:1234'], - }, - type: 'so_type', - references: [], - score: 0, - }, - ], - }); - - soClientMock.update.mockResolvedValue({ - id: 'updated', - attributes: {}, - references: [], - type: 'so_type', - }); - - soClientMock.create.mockResolvedValue({ - id: 'created', - attributes: {}, - references: [], - type: 'so_type', - }); - - await settingsSetup(soClientMock); - - expect(soClientMock.create).not.toBeCalled(); - expect(soClientMock.update).not.toBeCalled(); - }); }); diff --git a/x-pack/plugins/fleet/server/services/settings.ts b/x-pack/plugins/fleet/server/services/settings.ts index 41b30acc512eb..e710251c39f91 100644 --- a/x-pack/plugins/fleet/server/services/settings.ts +++ b/x-pack/plugins/fleet/server/services/settings.ts @@ -6,10 +6,9 @@ */ import Boom from '@hapi/boom'; -import { isEqual } from 'lodash'; import type { SavedObjectsClientContract } from '@kbn/core/server'; -import { decodeCloudId, normalizeHostsForAgents } from '../../common/services'; +import { normalizeHostsForAgents } from '../../common/services'; import { GLOBAL_SETTINGS_SAVED_OBJECT_TYPE, GLOBAL_SETTINGS_ID } from '../../common/constants'; import type { SettingsSOAttributes, Settings, BaseSettings } from '../../common/types'; @@ -34,23 +33,7 @@ export async function getSettings(soClient: SavedObjectsClientContract): Promise export async function settingsSetup(soClient: SavedObjectsClientContract) { try { - const settings = await getSettings(soClient); - const defaultSettings = createDefaultSettings(); - - const fleetServerHostsIsPreconfigured = getConfigFleetServerHosts()?.length ?? 0 > 0; - - const fleetServerHostsShouldBeUpdated = - !settings.fleet_server_hosts || - settings.fleet_server_hosts.length === 0 || - (fleetServerHostsIsPreconfigured && - !isEqual(settings.fleet_server_hosts, defaultSettings.fleet_server_hosts)); - - // Migration for < 7.13 Kibana - if (defaultSettings.fleet_server_hosts.length > 0 && fleetServerHostsShouldBeUpdated) { - return saveSettings(soClient, { - fleet_server_hosts: defaultSettings.fleet_server_hosts, - }); - } + await getSettings(soClient); } catch (e) { if (e.isBoom && e.output.statusCode === 404) { const defaultSettings = createDefaultSettings(); @@ -116,29 +99,5 @@ function getConfigFleetServerHosts() { } export function createDefaultSettings(): BaseSettings { - const configFleetServerHosts = getConfigFleetServerHosts(); - const cloudFleetServerHosts = getCloudFleetServersHosts(); - - const fleetServerHosts = configFleetServerHosts ?? cloudFleetServerHosts ?? []; - - return { - fleet_server_hosts: fleetServerHosts, - }; -} - -export function getCloudFleetServersHosts() { - const cloudSetup = appContextService.getCloud(); - if (cloudSetup && cloudSetup.isCloudEnabled && cloudSetup.cloudId && cloudSetup.deploymentId) { - const res = decodeCloudId(cloudSetup.cloudId); - if (!res) { - return; - } - - // Fleet Server url are formed like this `https://<deploymentId>.fleet.<host> - return [ - `https://${cloudSetup.deploymentId}.fleet.${res.host}${ - res.defaultPort !== '443' ? `:${res.defaultPort}` : '' - }`, - ]; - } + return { prerelease_integrations_enabled: false }; } diff --git a/x-pack/plugins/fleet/server/services/setup.ts b/x-pack/plugins/fleet/server/services/setup.ts index 37f368a4b8647..3cb2dc030cf75 100644 --- a/x-pack/plugins/fleet/server/services/setup.ts +++ b/x-pack/plugins/fleet/server/services/setup.ts @@ -83,12 +83,14 @@ async function createSetupSideEffects( logger.debug('Setting up Fleet download source'); const defaultDownloadSource = await downloadSourceService.ensureDefault(soClient); - logger.debug('Setting up Fleet outputs'); - + logger.debug('Setting up Fleet Sever Hosts'); await ensurePreconfiguredFleetServerHosts( soClient, + esClient, getPreconfiguredFleetServerHostFromConfig(appContextService.getConfig()) ); + + logger.debug('Setting up Fleet outputs'); await Promise.all([ ensurePreconfiguredOutputs( soClient, diff --git a/x-pack/plugins/fleet/server/tasks/check_deleted_files_task.test.ts b/x-pack/plugins/fleet/server/tasks/check_deleted_files_task.test.ts new file mode 100644 index 0000000000000..899c2a85b8e6d --- /dev/null +++ b/x-pack/plugins/fleet/server/tasks/check_deleted_files_task.test.ts @@ -0,0 +1,176 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { coreMock } from '@kbn/core/server/mocks'; +import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; +import type { TaskManagerSetupContract } from '@kbn/task-manager-plugin/server'; +import { TaskStatus } from '@kbn/task-manager-plugin/server'; +import type { CoreSetup } from '@kbn/core/server'; +import type { ElasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; +import { loggingSystemMock } from '@kbn/core/server/mocks'; + +import { createAppContextStartContractMock } from '../mocks'; +import { FILE_STORAGE_DATA_INDEX, FILE_STORAGE_METADATA_INDEX } from '../constants/fleet_es_assets'; +import { appContextService } from '../services'; + +import { CheckDeletedFilesTask, TYPE, VERSION } from './check_deleted_files_task'; + +const MOCK_TASK_INSTANCE = { + id: `${TYPE}:${VERSION}`, + runAt: new Date(), + attempts: 0, + ownerId: '', + status: TaskStatus.Running, + startedAt: new Date(), + scheduledAt: new Date(), + retryAt: new Date(), + params: {}, + state: {}, + taskType: TYPE, +}; + +describe('check deleted files task', () => { + const { createSetup: coreSetupMock } = coreMock; + const { createSetup: tmSetupMock, createStart: tmStartMock } = taskManagerMock; + + let mockContract: ReturnType<typeof createAppContextStartContractMock>; + let mockTask: CheckDeletedFilesTask; + let mockCore: CoreSetup; + let mockTaskManagerSetup: jest.Mocked<TaskManagerSetupContract>; + beforeEach(() => { + mockContract = createAppContextStartContractMock(); + appContextService.start(mockContract); + mockCore = coreSetupMock(); + mockTaskManagerSetup = tmSetupMock(); + mockTask = new CheckDeletedFilesTask({ + core: mockCore, + taskManager: mockTaskManagerSetup, + logFactory: loggingSystemMock.create(), + }); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + describe('task lifecycle', () => { + it('should create task', () => { + expect(mockTask).toBeInstanceOf(CheckDeletedFilesTask); + }); + + it('should register task', () => { + expect(mockTaskManagerSetup.registerTaskDefinitions).toHaveBeenCalled(); + }); + + it('should schedule task', async () => { + const mockTaskManagerStart = tmStartMock(); + await mockTask.start({ taskManager: mockTaskManagerStart }); + expect(mockTaskManagerStart.ensureScheduled).toHaveBeenCalled(); + }); + }); + + describe('task logic', () => { + let esClient: ElasticsearchClientMock; + const abortController = new AbortController(); + + beforeEach(async () => { + const [{ elasticsearch }] = await mockCore.getStartServices(); + esClient = elasticsearch.client.asInternalUser as ElasticsearchClientMock; + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + const runTask = async (taskInstance = MOCK_TASK_INSTANCE) => { + const mockTaskManagerStart = tmStartMock(); + await mockTask.start({ taskManager: mockTaskManagerStart }); + const createTaskRunner = + mockTaskManagerSetup.registerTaskDefinitions.mock.calls[0][0][TYPE].createTaskRunner; + const taskRunner = createTaskRunner({ taskInstance }); + return taskRunner.run(); + }; + + it('should attempt to update deleted files', async () => { + // mock getReadyFiles search + esClient.search + .mockResolvedValueOnce({ + took: 5, + timed_out: false, + _shards: { + total: 1, + successful: 1, + skipped: 0, + failed: 0, + }, + hits: { + total: { + value: 1, + relation: 'eq', + }, + hits: [ + { + _id: 'metadata-testid1', + _index: FILE_STORAGE_METADATA_INDEX, + _source: { file: { status: 'READY' } }, + }, + { + _id: 'metadata-testid2', + _index: FILE_STORAGE_METADATA_INDEX, + _source: { file: { status: 'READY' } }, + }, + ], + }, + }) + // mock doFilesHaveChunks search + .mockResolvedValueOnce({ + took: 5, + timed_out: false, + _shards: { + total: 1, + successful: 1, + skipped: 0, + failed: 0, + }, + hits: { + total: { + value: 0, + relation: 'eq', + }, + hits: [ + { + _id: 'data-testid1', + _index: FILE_STORAGE_DATA_INDEX, + _source: { + bid: 'metadata-testid1', + }, + }, + ], + }, + }); + + await runTask(); + + expect(esClient.updateByQuery).toHaveBeenCalledWith( + { + index: FILE_STORAGE_METADATA_INDEX, + query: { + ids: { + values: ['metadata-testid2'], + }, + }, + refresh: true, + script: { + lang: 'painless', + source: "ctx._source.file.Status = 'DELETED'", + }, + }, + { signal: abortController.signal } + ); + }); + }); +}); diff --git a/x-pack/plugins/fleet/server/tasks/check_deleted_files_task.ts b/x-pack/plugins/fleet/server/tasks/check_deleted_files_task.ts new file mode 100644 index 0000000000000..d7bafe07fb531 --- /dev/null +++ b/x-pack/plugins/fleet/server/tasks/check_deleted_files_task.ts @@ -0,0 +1,141 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { CoreSetup, Logger } from '@kbn/core/server'; +import type { + ConcreteTaskInstance, + TaskManagerSetupContract, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; +import { throwUnrecoverableError } from '@kbn/task-manager-plugin/server'; +import type { LoggerFactory } from '@kbn/core/server'; +import { errors } from '@elastic/elasticsearch'; + +import { + fileIdsWithoutChunksByIndex, + getFilesByStatus, + updateFilesStatus, +} from '../services/files'; + +export const TYPE = 'fleet:check-deleted-files-task'; +export const VERSION = '1.0.0'; +const TITLE = 'Fleet Deleted Files Periodic Tasks'; +const TIMEOUT = '2m'; +const SCOPE = ['fleet']; +const INTERVAL = '1d'; + +interface CheckDeletedFilesTaskSetupContract { + core: CoreSetup; + taskManager: TaskManagerSetupContract; + logFactory: LoggerFactory; +} + +interface CheckDeletedFilesTaskStartContract { + taskManager: TaskManagerStartContract; +} + +export class CheckDeletedFilesTask { + private logger: Logger; + private wasStarted: boolean = false; + private abortController = new AbortController(); + + constructor(setupContract: CheckDeletedFilesTaskSetupContract) { + const { core, taskManager, logFactory } = setupContract; + this.logger = logFactory.get(this.taskId); + + taskManager.registerTaskDefinitions({ + [TYPE]: { + title: TITLE, + timeout: TIMEOUT, + createTaskRunner: ({ taskInstance }: { taskInstance: ConcreteTaskInstance }) => { + return { + run: async () => { + return this.runTask(taskInstance, core); + }, + cancel: async () => { + this.abortController.abort('task timed out'); + }, + }; + }, + }, + }); + } + + public start = async ({ taskManager }: CheckDeletedFilesTaskStartContract) => { + if (!taskManager) { + this.logger.error('missing required service during start'); + return; + } + + this.wasStarted = true; + + try { + await taskManager.ensureScheduled({ + id: this.taskId, + taskType: TYPE, + scope: SCOPE, + schedule: { + interval: INTERVAL, + }, + state: {}, + params: { version: VERSION }, + }); + } catch (e) { + this.logger.error(`Error scheduling task, received error: ${e}`); + } + }; + + private get taskId(): string { + return `${TYPE}:${VERSION}`; + } + + private runTask = async (taskInstance: ConcreteTaskInstance, core: CoreSetup) => { + if (!this.wasStarted) { + this.logger.debug('[runTask()] Aborted. Task not started yet'); + return; + } + + // Check that this task is current + if (taskInstance.id !== this.taskId) { + throwUnrecoverableError(new Error('Outdated task version')); + } + + const [{ elasticsearch }] = await core.getStartServices(); + const esClient = elasticsearch.client.asInternalUser; + + try { + const readyFiles = await getFilesByStatus(esClient, this.abortController); + if (!readyFiles.length) return; + + const { fileIdsByIndex: deletedFileIdsByIndex, allFileIds: allDeletedFileIds } = + await fileIdsWithoutChunksByIndex(esClient, this.abortController, readyFiles); + if (!allDeletedFileIds.size) return; + + this.logger.info(`Attempting to update ${allDeletedFileIds.size} files to DELETED status`); + this.logger.debug(`Attempting to file ids: ${deletedFileIdsByIndex}`); + const updatedFilesResponses = await updateFilesStatus( + esClient, + this.abortController, + deletedFileIdsByIndex, + 'DELETED' + ); + const failures = updatedFilesResponses.flatMap( + (updatedFilesResponse) => updatedFilesResponse.failures + ); + if (failures?.length) { + this.logger.warn(`Failed to update ${failures.length} files to DELETED status`); + this.logger.debug(`Failed to update files to DELETED status: ${failures}`); + } + } catch (err) { + if (err instanceof errors.RequestAbortedError) { + this.logger.warn(`request aborted due to timeout: ${err}`); + return; + } + this.logger.error(err); + } + }; +} diff --git a/x-pack/plugins/fleet/server/types/files/index.ts b/x-pack/plugins/fleet/server/types/files/index.ts new file mode 100644 index 0000000000000..aa3c7b7be18b2 --- /dev/null +++ b/x-pack/plugins/fleet/server/types/files/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 type FILE_STATUS = 'AWAITING_UPLOAD' | 'UPLOADING' | 'READY' | 'UPLOAD_ERROR' | 'DELETED'; diff --git a/x-pack/plugins/fleet/server/types/models/agent_policy.ts b/x-pack/plugins/fleet/server/types/models/agent_policy.ts index 406dcbafc8894..487969cb93eb9 100644 --- a/x-pack/plugins/fleet/server/types/models/agent_policy.ts +++ b/x-pack/plugins/fleet/server/types/models/agent_policy.ts @@ -35,6 +35,7 @@ export const AgentPolicyBaseSchema = { data_output_id: schema.maybe(schema.nullable(schema.string())), monitoring_output_id: schema.maybe(schema.nullable(schema.string())), download_source_id: schema.maybe(schema.nullable(schema.string())), + fleet_server_host_id: schema.maybe(schema.nullable(schema.string())), }; export const NewAgentPolicySchema = schema.object({ diff --git a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts index f69576a2a8b56..9e36413f80150 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts @@ -9,7 +9,8 @@ import { schema } from '@kbn/config-schema'; export const GetCategoriesRequestSchema = { query: schema.object({ - experimental: schema.maybe(schema.boolean()), + prerelease: schema.maybe(schema.boolean()), + experimental: schema.maybe(schema.boolean()), // deprecated include_policy_templates: schema.maybe(schema.boolean()), }), }; @@ -17,11 +18,18 @@ export const GetCategoriesRequestSchema = { export const GetPackagesRequestSchema = { query: schema.object({ category: schema.maybe(schema.string()), - experimental: schema.maybe(schema.boolean()), + prerelease: schema.maybe(schema.boolean()), + experimental: schema.maybe(schema.boolean()), // deprecated excludeInstallStatus: schema.maybe(schema.boolean({ defaultValue: false })), }), }; +export const GetLimitedPackagesRequestSchema = { + query: schema.object({ + prerelease: schema.maybe(schema.boolean()), + }), +}; + export const GetFileRequestSchema = { params: schema.object({ pkgName: schema.string(), @@ -37,6 +45,7 @@ export const GetInfoRequestSchema = { }), query: schema.object({ ignoreUnverified: schema.maybe(schema.boolean()), + prerelease: schema.maybe(schema.boolean()), }), }; @@ -44,6 +53,10 @@ export const GetInfoRequestSchemaDeprecated = { params: schema.object({ pkgkey: schema.string(), }), + query: schema.object({ + ignoreUnverified: schema.maybe(schema.boolean()), + prerelease: schema.maybe(schema.boolean()), + }), }; export const UpdatePackageRequestSchema = { @@ -96,6 +109,9 @@ export const InstallPackageFromRegistryRequestSchemaDeprecated = { }; export const BulkUpgradePackagesFromRegistryRequestSchema = { + query: schema.object({ + prerelease: schema.maybe(schema.boolean()), + }), body: schema.object({ packages: schema.arrayOf(schema.string(), { minSize: 1 }), }), diff --git a/x-pack/plugins/fleet/server/types/rest_spec/settings.ts b/x-pack/plugins/fleet/server/types/rest_spec/settings.ts index 4544b677cba8c..4a1c2975c80e0 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/settings.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/settings.ts @@ -35,5 +35,6 @@ export const PutSettingsRequestSchema = { }) ), kibana_ca_sha256: schema.maybe(schema.string()), + prerelease_integrations_enabled: schema.maybe(schema.boolean()), }), }; diff --git a/x-pack/plugins/fleet/tsconfig.json b/x-pack/plugins/fleet/tsconfig.json index c9c730b6a170c..cb43a425b17c9 100644 --- a/x-pack/plugins/fleet/tsconfig.json +++ b/x-pack/plugins/fleet/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, }, "exclude": ["cypress.config.ts"], "include": [ @@ -19,15 +18,16 @@ "cypress.config.ts", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/setup_node_env/tsconfig.json" }, // add references to other TypeScript projects the plugin depends on // requiredPlugins from ./kibana.json { "path": "../licensing/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../encrypted_saved_objects/tsconfig.json" }, - {"path": "../../../src/plugins/guided_onboarding/tsconfig.json"}, + { "path": "../../../src/plugins/guided_onboarding/tsconfig.json" }, // optionalPlugins from ./kibana.json { "path": "../security/tsconfig.json" }, diff --git a/x-pack/plugins/global_search/tsconfig.json b/x-pack/plugins/global_search/tsconfig.json index 6a0385e5c080b..8a5a197e6b72f 100644 --- a/x-pack/plugins/global_search/tsconfig.json +++ b/x-pack/plugins/global_search/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", @@ -12,7 +11,7 @@ "common/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../licensing/tsconfig.json" } ] diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx index 78f38087b9ad1..2bd37e0448b6c 100644 --- a/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx +++ b/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx @@ -42,7 +42,7 @@ const createResult = (result: Result): GlobalSearchResult => { const createBatch = (...results: Result[]): GlobalSearchBatchedResults => ({ results: results.map(createResult), }); -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); describe('SearchBar', () => { let searchService: ReturnType<typeof globalSearchPluginMock.createStartContract>; diff --git a/x-pack/plugins/global_search_bar/tsconfig.json b/x-pack/plugins/global_search_bar/tsconfig.json index 04464a3c08200..a3fb00c15aea0 100644 --- a/x-pack/plugins/global_search_bar/tsconfig.json +++ b/x-pack/plugins/global_search_bar/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, { "path": "../global_search/tsconfig.json" }, diff --git a/x-pack/plugins/global_search_providers/tsconfig.json b/x-pack/plugins/global_search_providers/tsconfig.json index 4ce15f6d44683..5787569cddceb 100644 --- a/x-pack/plugins/global_search_providers/tsconfig.json +++ b/x-pack/plugins/global_search_providers/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", "server/**/*", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../global_search/tsconfig.json" } ] diff --git a/x-pack/plugins/graph/tsconfig.json b/x-pack/plugins/graph/tsconfig.json index 38711a903fe5c..8a17949e7981d 100644 --- a/x-pack/plugins/graph/tsconfig.json +++ b/x-pack/plugins/graph/tsconfig.json @@ -5,7 +5,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "*.ts", @@ -14,7 +18,7 @@ "server/**/*", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../licensing/tsconfig.json" }, { "path": "../features/tsconfig.json"}, diff --git a/x-pack/plugins/grokdebugger/tsconfig.json b/x-pack/plugins/grokdebugger/tsconfig.json index aefb15f74c7b6..da551988a7e60 100644 --- a/x-pack/plugins/grokdebugger/tsconfig.json +++ b/x-pack/plugins/grokdebugger/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "server/**/*", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/dev_tools/tsconfig.json"}, { "path": "../../../src/plugins/home/tsconfig.json"}, diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/edit_warning.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/edit_warning.test.ts index 98d6078da031c..39417219cddb9 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/edit_warning.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/edit_warning.test.ts @@ -16,7 +16,7 @@ describe('<EditPolicy /> edit warning', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/frozen_phase.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/frozen_phase.test.ts index ffe11133be7fd..5b08b4225916b 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/frozen_phase.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/frozen_phase.test.ts @@ -17,7 +17,7 @@ describe('<EditPolicy /> frozen phase', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/cloud_aware_behavior.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/cloud_aware_behavior.test.ts index 75db772ec0926..be83028c81b2f 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/cloud_aware_behavior.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/cloud_aware_behavior.test.ts @@ -18,7 +18,7 @@ describe('<EditPolicy /> node allocation cloud-aware behavior', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/cold_phase.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/cold_phase.test.ts index 63382de45f414..217a6264f5745 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/cold_phase.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/cold_phase.test.ts @@ -14,7 +14,7 @@ describe('<EditPolicy /> node allocation in the cold phase', () => { const { httpSetup, setDelayResponse, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/general_behavior.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/general_behavior.test.ts index 4830cee8ee237..e9f970fbba207 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/general_behavior.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/general_behavior.test.ts @@ -24,7 +24,7 @@ describe('<EditPolicy /> node allocation general behavior', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/warm_phase.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/warm_phase.test.ts index 6f96aaf07da1b..df6e409550be9 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/warm_phase.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/node_allocation/warm_phase.test.ts @@ -14,7 +14,7 @@ describe('<EditPolicy /> node allocation in the warm phase', () => { const { httpSetup, setDelayResponse, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/request_flyout.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/request_flyout.test.ts index 61dda6fa65efb..30873b54548eb 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/request_flyout.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/request_flyout.test.ts @@ -15,7 +15,7 @@ describe('<EditPolicy /> request flyout', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/cold_phase_validation.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/cold_phase_validation.test.ts index e75d2cb72ab28..cee0af407442e 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/cold_phase_validation.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/cold_phase_validation.test.ts @@ -15,7 +15,7 @@ describe('<EditPolicy /> cold phase validation', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/error_indicators.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/error_indicators.test.ts index bd4a2caec0be5..2503b32f0506a 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/error_indicators.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/error_indicators.test.ts @@ -14,7 +14,7 @@ describe('<EditPolicy /> error indicators', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/hot_phase_validation.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/hot_phase_validation.test.ts index 71f83a59360d6..54683f638c746 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/hot_phase_validation.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/hot_phase_validation.test.ts @@ -16,7 +16,7 @@ describe('<EditPolicy /> hot phase validation', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/policy_name_validation.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/policy_name_validation.test.ts index c530f73a66c11..19ee23142cd92 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/policy_name_validation.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/policy_name_validation.test.ts @@ -17,7 +17,7 @@ describe('<EditPolicy /> policy name validation', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/timing.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/timing.test.ts index 5838f04ba70e9..08790cf23bf95 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/timing.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/timing.test.ts @@ -18,7 +18,7 @@ describe('<EditPolicy /> timing validation', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/warm_phase_validation.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/warm_phase_validation.test.ts index 47917b1f8e3d7..6fb079819ec36 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/warm_phase_validation.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/form_validation/warm_phase_validation.test.ts @@ -15,7 +15,7 @@ describe('<EditPolicy /> warm phase validation', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_lifecycle_management/tsconfig.json b/x-pack/plugins/index_lifecycle_management/tsconfig.json index 4b5d7657ed9f6..97d01cbe8a45b 100644 --- a/x-pack/plugins/index_lifecycle_management/tsconfig.json +++ b/x-pack/plugins/index_lifecycle_management/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "__jest__/**/*", @@ -14,7 +13,7 @@ "server/**/*", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, // required plugins { "path": "../licensing/tsconfig.json" }, diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.test.tsx index 861b1041a4f14..99277bb4cc4b6 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.test.tsx @@ -48,7 +48,7 @@ describe('<TemplateClone />', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); httpRequestsMockHelpers.setLoadTelemetryResponse({}); httpRequestsMockHelpers.setLoadComponentTemplatesResponse([]); httpRequestsMockHelpers.setLoadTemplateResponse(templateToClone.name, templateToClone); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx index 6813398a34ae0..ca42777532acc 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx @@ -80,7 +80,7 @@ describe('<TemplateCreate />', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); httpRequestsMockHelpers.setLoadComponentTemplatesResponse(componentTemplates); httpRequestsMockHelpers.setLoadNodesPluginsResponse([]); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx index 4b94cb92c83d0..a99b5476a766f 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx @@ -52,7 +52,7 @@ describe('<TemplateEdit />', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); httpRequestsMockHelpers.setLoadComponentTemplatesResponse([]); }); diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/date_range_datatype.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/date_range_datatype.test.tsx index 60114223bef0d..1b752807ba1c9 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/date_range_datatype.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/date_range_datatype.test.tsx @@ -29,7 +29,7 @@ describe('Mappings editor: date range datatype', () => { let testBed: MappingsEditorTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/other_datatype.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/other_datatype.test.tsx index 81ca155b022b1..58d063cc658cc 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/other_datatype.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/other_datatype.test.tsx @@ -21,7 +21,7 @@ describe('Mappings editor: other datatype', () => { let testBed: MappingsEditorTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/point_datatype.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/point_datatype.test.tsx index 8c235f2d2d9e9..c35d6c231186d 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/point_datatype.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/point_datatype.test.tsx @@ -28,7 +28,7 @@ describe('Mappings editor: point datatype', () => { let testBed: MappingsEditorTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/scaled_float_datatype.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/scaled_float_datatype.test.tsx index 17e7317e098cc..bbd0afa495e48 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/scaled_float_datatype.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/scaled_float_datatype.test.tsx @@ -31,7 +31,7 @@ describe('Mappings editor: scaled float datatype', () => { let testBed: MappingsEditorTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/shape_datatype.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/shape_datatype.test.tsx index 94aea2a3b13af..9724a81d673bf 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/shape_datatype.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/shape_datatype.test.tsx @@ -29,7 +29,7 @@ describe('Mappings editor: shape datatype', () => { let testBed: MappingsEditorTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/text_datatype.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/text_datatype.test.tsx index db8678478aa3d..38fd47476e931 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/text_datatype.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/text_datatype.test.tsx @@ -34,7 +34,7 @@ describe('Mappings editor: text datatype', () => { let testBed: MappingsEditorTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/version_datatype.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/version_datatype.test.tsx index 5f638ebb31a43..6a61d9bac058b 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/version_datatype.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/version_datatype.test.tsx @@ -26,7 +26,7 @@ describe('Mappings editor: version datatype', () => { let testBed: MappingsEditorTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/edit_field.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/edit_field.test.tsx index 4440f54f1034b..7403be97c6644 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/edit_field.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/edit_field.test.tsx @@ -21,7 +21,7 @@ describe('Mappings editor: edit field', () => { let testBed: MappingsEditorTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mapped_fields.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mapped_fields.test.tsx index eb219503424b3..fe32e3b6099f0 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mapped_fields.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mapped_fields.test.tsx @@ -14,7 +14,7 @@ const onChangeHandler = jest.fn(); describe('Mappings editor: mapped fields', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mappings_editor.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mappings_editor.test.tsx index 9b4f31f3dfc16..c296361f3685b 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mappings_editor.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mappings_editor.test.tsx @@ -21,7 +21,7 @@ describe('Mappings editor: core', () => { let testBed: MappingsEditorTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/runtime_fields.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/runtime_fields.test.tsx index 76e5dcda8fc44..d1b85685588d0 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/runtime_fields.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/runtime_fields.test.tsx @@ -20,7 +20,7 @@ describe('Mappings editor: runtime fields', () => { let getMappingsEditorData = getMappingsEditorDataFactory(onChangeHandler); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/index_management/tsconfig.json b/x-pack/plugins/index_management/tsconfig.json index 120e58c2850c5..cf7a457358cb8 100644 --- a/x-pack/plugins/index_management/tsconfig.json +++ b/x-pack/plugins/index_management/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "__jest__/**/*", @@ -14,7 +13,7 @@ "test/**/*", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, { "path": "../../../src/plugins/management/tsconfig.json" }, diff --git a/x-pack/plugins/infra/common/log_views/resolved_log_view.mock.ts b/x-pack/plugins/infra/common/log_views/resolved_log_view.mock.ts index 268b2f692f62a..8c09f16e3b53e 100644 --- a/x-pack/plugins/infra/common/log_views/resolved_log_view.mock.ts +++ b/x-pack/plugins/infra/common/log_views/resolved_log_view.mock.ts @@ -10,6 +10,7 @@ import { createStubDataView } from '@kbn/data-views-plugin/common/stubs'; import { defaultLogViewsStaticConfig } from './defaults'; import { ResolvedLogView, resolveLogView } from './resolved_log_view'; import { LogViewAttributes } from './types'; +import { DataViewSpec } from '@kbn/data-views-plugin/common'; export const createResolvedLogViewMock = ( resolvedLogViewOverrides: Partial<ResolvedLogView> = {} @@ -41,15 +42,26 @@ export const createResolvedLogViewMock = ( messageColumn: { id: 'MESSAGE_COLUMN_ID' }, }, ], + dataViewReference: createStubDataView({ + spec: { + id: 'log-view-data-view-mock', + title: 'log-indices-*', + }, + }), ...resolvedLogViewOverrides, }); export const createResolvedLogViewMockFromAttributes = (logViewAttributes: LogViewAttributes) => resolveLogView( + 'log-view-id', logViewAttributes, { get: async () => createStubDataView({ spec: {} }), getFieldsForWildcard: async () => [], + create: async (spec: DataViewSpec) => + createStubDataView({ + spec, + }), } as unknown as DataViewsContract, defaultLogViewsStaticConfig ); diff --git a/x-pack/plugins/infra/common/log_views/resolved_log_view.ts b/x-pack/plugins/infra/common/log_views/resolved_log_view.ts index d7e155172a57e..2fc2fd7aa2374 100644 --- a/x-pack/plugins/infra/common/log_views/resolved_log_view.ts +++ b/x-pack/plugins/infra/common/log_views/resolved_log_view.ts @@ -23,21 +23,24 @@ export interface ResolvedLogView { fields: ResolvedLogViewField[]; runtimeMappings: estypes.MappingRuntimeFields; columns: LogViewColumnConfiguration[]; + dataViewReference: DataView; } export const resolveLogView = async ( + logViewId: string, logViewAttributes: LogViewAttributes, dataViewsService: DataViewsContract, config: LogViewsStaticConfig ): Promise<ResolvedLogView> => { if (logViewAttributes.logIndices.type === 'index_name') { - return await resolveLegacyReference(logViewAttributes, dataViewsService, config); + return await resolveLegacyReference(logViewId, logViewAttributes, dataViewsService, config); } else { return await resolveDataViewReference(logViewAttributes, dataViewsService); } }; const resolveLegacyReference = async ( + logViewId: string, logViewAttributes: LogViewAttributes, dataViewsService: DataViewsContract, config: LogViewsStaticConfig @@ -48,28 +51,32 @@ const resolveLegacyReference = async ( const indices = logViewAttributes.logIndices.indexName; - const fields = await dataViewsService - .getFieldsForWildcard({ - pattern: indices, - allowNoIndex: true, - }) + const dataViewReference = await dataViewsService + .create( + { + id: `log-view-${logViewId}`, + title: indices, + timeFieldName: TIMESTAMP_FIELD, + allowNoIndex: true, + }, + false, + false + ) .catch((error) => { - throw new ResolveLogViewError( - `Failed to fetch fields for indices "${indices}": ${error}`, - error - ); + throw new ResolveLogViewError(`Failed to create Data View reference: ${error}`, error); }); return { - indices: logViewAttributes.logIndices.indexName, + indices, timestampField: TIMESTAMP_FIELD, tiebreakerField: TIEBREAKER_FIELD, messageField: config.messageFields, - fields, + fields: dataViewReference.fields, runtimeMappings: {}, columns: logViewAttributes.logColumns, name: logViewAttributes.name, description: logViewAttributes.description, + dataViewReference, }; }; @@ -97,6 +104,7 @@ const resolveDataViewReference = async ( columns: logViewAttributes.logColumns, name: logViewAttributes.name, description: logViewAttributes.description, + dataViewReference: dataView, }; }; diff --git a/x-pack/plugins/infra/public/components/log_stream/log_stream.tsx b/x-pack/plugins/infra/public/components/log_stream/log_stream.tsx index 2913b2cbb5ecf..e5aeefba983f1 100644 --- a/x-pack/plugins/infra/public/components/log_stream/log_stream.tsx +++ b/x-pack/plugins/infra/public/components/log_stream/log_stream.tsx @@ -7,11 +7,11 @@ import { buildEsQuery, Filter, Query } from '@kbn/es-query'; import { JsonValue } from '@kbn/utility-types'; -import { noop } from 'lodash'; import React, { useCallback, useEffect, useMemo } from 'react'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { noop } from 'lodash'; import { LogEntryCursor } from '../../../common/log_entry'; import { defaultLogViewsStaticConfig } from '../../../common/log_views'; import { BuiltEsQuery, useLogStream } from '../../containers/logs/log_stream'; diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/errors.ts b/x-pack/plugins/infra/public/containers/logs/log_filter/errors.ts new file mode 100644 index 0000000000000..09e3af3e241a4 --- /dev/null +++ b/x-pack/plugins/infra/public/containers/logs/log_filter/errors.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. + */ + +/* eslint-disable max-classes-per-file */ +export class UnsupportedLanguageError extends Error { + constructor(message?: string) { + super(message); + Object.setPrototypeOf(this, new.target.prototype); + } +} + +export class QueryParsingError extends Error { + constructor(message?: string) { + super(message); + Object.setPrototypeOf(this, new.target.prototype); + } +} diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts b/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts index 70d72c25158da..4a2f6e280ebe6 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts +++ b/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts @@ -5,12 +5,16 @@ * 2.0. */ -import { buildEsQuery, DataViewBase, Query } from '@kbn/es-query'; +import { useMemo, useEffect, useCallback, useState } from 'react'; +import { merge, of } from 'rxjs'; +import { i18n } from '@kbn/i18n'; +import { buildEsQuery, DataViewBase, Query, AggregateQuery, isOfQueryType } from '@kbn/es-query'; import createContainer from 'constate'; -import { useCallback, useState } from 'react'; -import useDebounce from 'react-use/lib/useDebounce'; import { useKibanaQuerySettings } from '../../../utils/use_kibana_query_settings'; import { BuiltEsQuery } from '../log_stream'; +import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; +import { useSubscription } from '../../../utils/use_observable'; +import { UnsupportedLanguageError, QueryParsingError } from './errors'; interface ILogFilterState { filterQuery: { @@ -18,90 +22,126 @@ interface ILogFilterState { serializedQuery: string; originalQuery: Query; } | null; - filterQueryDraft: Query; - validationErrors: string[]; + queryStringQuery: Query | AggregateQuery | null; + validationError: Error | null; } -const initialLogFilterState: ILogFilterState = { +export const DEFAULT_QUERY = { + language: 'kuery', + query: '', +}; + +const INITIAL_LOG_FILTER_STATE = { filterQuery: null, - filterQueryDraft: { - language: 'kuery', - query: '', - }, - validationErrors: [], + queryStringQuery: null, + validationError: null, }; -const validationDebounceTimeout = 1000; // milliseconds +// Error toasts +export const errorToastTitle = i18n.translate( + 'xpack.infra.logsPage.toolbar.logFilterErrorToastTitle', + { + defaultMessage: 'Log filter error', + } +); + +const unsupportedLanguageError = i18n.translate( + 'xpack.infra.logsPage.toolbar.logFilterUnsupportedLanguageError', + { + defaultMessage: 'SQL is not supported', + } +); + +export const useLogFilterState = ({ dataView }: { dataView?: DataViewBase }) => { + const { + notifications: { toasts }, + data: { + query: { queryString }, + }, + } = useKibanaContextForPlugin().services; -export const useLogFilterState = ({ indexPattern }: { indexPattern: DataViewBase }) => { - const [logFilterState, setLogFilterState] = useState<ILogFilterState>(initialLogFilterState); const kibanaQuerySettings = useKibanaQuerySettings(); + const [logFilterState, setLogFilterState] = useState<ILogFilterState>(INITIAL_LOG_FILTER_STATE); + + useEffect(() => { + const handleValidationError = (error: Error) => { + if (error instanceof UnsupportedLanguageError) { + toasts.addError(error, { title: errorToastTitle }); + queryString.setQuery(DEFAULT_QUERY); + } else if (error instanceof QueryParsingError) { + toasts.addError(error, { title: errorToastTitle }); + } + }; + + if (logFilterState.validationError) { + handleValidationError(logFilterState.validationError); + } + }, [logFilterState.validationError, queryString, toasts]); + const parseQuery = useCallback( - (filterQuery: Query) => buildEsQuery(indexPattern, filterQuery, [], kibanaQuerySettings), - [indexPattern, kibanaQuerySettings] + (filterQuery: Query) => { + return buildEsQuery(dataView, filterQuery, [], kibanaQuerySettings); + }, + [dataView, kibanaQuerySettings] ); - const setLogFilterQueryDraft = useCallback((filterQueryDraft: Query) => { - setLogFilterState((previousLogFilterState) => ({ - ...previousLogFilterState, - filterQueryDraft, - validationErrors: [], - })); - }, []); - - const [, cancelPendingValidation] = useDebounce( - () => { - setLogFilterState((previousLogFilterState) => { + const getNewLogFilterState = useCallback( + (newQuery: Query | AggregateQuery) => + (previousLogFilterState: ILogFilterState): ILogFilterState => { try { - parseQuery(logFilterState.filterQueryDraft); - return { - ...previousLogFilterState, - validationErrors: [], - }; + if (!isOfQueryType(newQuery)) { + throw new UnsupportedLanguageError(unsupportedLanguageError); + } + try { + const parsedQuery = parseQuery(newQuery); + return { + filterQuery: { + parsedQuery, + serializedQuery: JSON.stringify(parsedQuery), + originalQuery: newQuery, + }, + queryStringQuery: newQuery, + validationError: null, + }; + } catch (error) { + throw new QueryParsingError(error); + } } catch (error) { return { ...previousLogFilterState, - validationErrors: [`${error}`], + queryStringQuery: newQuery, + validationError: error, }; } - }); - }, - validationDebounceTimeout, - [logFilterState.filterQueryDraft, parseQuery] + }, + [parseQuery] ); - const applyLogFilterQuery = useCallback( - (filterQuery: Query) => { - cancelPendingValidation(); - try { - const parsedQuery = parseQuery(filterQuery); - setLogFilterState((previousLogFilterState) => ({ - ...previousLogFilterState, - filterQuery: { - parsedQuery, - serializedQuery: JSON.stringify(parsedQuery), - originalQuery: filterQuery, - }, - filterQueryDraft: filterQuery, - validationErrors: [], - })); - } catch (error) { - setLogFilterState((previousLogFilterState) => ({ - ...previousLogFilterState, - validationErrors: [`${error}`], - })); - } - }, - [cancelPendingValidation, parseQuery] + useSubscription( + useMemo(() => { + return merge(of(undefined), queryString.getUpdates$()); // NOTE: getUpdates$ uses skip(1) so we do this to ensure an initial emit of a value. + }, [queryString]), + useMemo(() => { + return { + next: () => { + setLogFilterState(getNewLogFilterState(queryString.getQuery())); + }, + }; + }, [getNewLogFilterState, queryString]) ); + // NOTE: If the dataView changes the query will need to be reparsed and the filter regenerated. + useEffect(() => { + if (dataView) { + setLogFilterState(getNewLogFilterState(queryString.getQuery())); + } + }, [dataView, getNewLogFilterState, queryString]); + return { - filterQuery: logFilterState.filterQuery, - filterQueryDraft: logFilterState.filterQueryDraft, - isFilterQueryDraftValid: logFilterState.validationErrors.length === 0, - setLogFilterQueryDraft, - applyLogFilterQuery, + queryStringQuery: logFilterState.queryStringQuery, // NOTE: Query String Manager query. + filterQuery: logFilterState.filterQuery, // NOTE: Valid and syntactically correct query applied to requests etc. + validationError: logFilterState.validationError, }; }; diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx b/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx index 2a5970721f5e5..a6f6166b7cf06 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx @@ -9,24 +9,33 @@ import * as rt from 'io-ts'; import React from 'react'; import { Query } from '@kbn/es-query'; import { replaceStateKeyInQueryString, UrlStateContainer } from '../../../utils/url_state'; -import { useLogFilterStateContext } from './log_filter_state'; +import { useLogFilterStateContext, DEFAULT_QUERY } from './log_filter_state'; +import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; export const WithLogFilterUrlState: React.FC = () => { - const { filterQuery, applyLogFilterQuery } = useLogFilterStateContext(); + const { + data: { + query: { queryString }, + }, + } = useKibanaContextForPlugin().services; + + const { queryStringQuery } = useLogFilterStateContext(); return ( <UrlStateContainer - urlState={filterQuery?.originalQuery} + urlState={queryStringQuery} urlStateKey="logFilter" mapToUrlState={mapToFilterQuery} onChange={(urlState) => { if (urlState) { - applyLogFilterQuery(urlState); + queryString.setQuery(urlState); } }} onInitialize={(urlState) => { if (urlState) { - applyLogFilterQuery(urlState); + queryString.setQuery(urlState); + } else { + queryString.setQuery(DEFAULT_QUERY); } }} /> diff --git a/x-pack/plugins/infra/public/hooks/use_log_view.mock.ts b/x-pack/plugins/infra/public/hooks/use_log_view.mock.ts index daebfb82b4564..8bef101abe666 100644 --- a/x-pack/plugins/infra/public/hooks/use_log_view.mock.ts +++ b/x-pack/plugins/infra/public/hooks/use_log_view.mock.ts @@ -17,10 +17,7 @@ const defaultLogViewId = 'default'; export const createUninitializedUseLogViewMock = (logViewId: string = defaultLogViewId) => (): IUseLogView => ({ - derivedDataView: { - fields: [], - title: 'unknown', - }, + derivedDataView: undefined, hasFailedLoading: false, hasFailedLoadingLogView: false, hasFailedLoadingLogViewStatus: false, diff --git a/x-pack/plugins/infra/public/hooks/use_log_view.ts b/x-pack/plugins/infra/public/hooks/use_log_view.ts index b1b8bb6e33cc9..1781bc7346a2f 100644 --- a/x-pack/plugins/infra/public/hooks/use_log_view.ts +++ b/x-pack/plugins/infra/public/hooks/use_log_view.ts @@ -6,7 +6,7 @@ */ import createContainer from 'constate'; -import { useCallback, useEffect, useMemo, useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import type { HttpHandler } from '@kbn/core/public'; import { LogView, LogViewAttributes, LogViewStatus, ResolvedLogView } from '../../common/log_views'; import type { ILogViewsClient } from '../services/log_views'; @@ -63,14 +63,6 @@ export const useLogView = ({ [logViews] ); - const derivedDataView = useMemo( - () => ({ - fields: resolvedLogView?.fields ?? [], - title: resolvedLogView?.indices ?? 'unknown', - }), - [resolvedLogView] - ); - const isLoadingLogView = loadLogViewRequest.state === 'pending'; const isResolvingLogView = resolveLogViewRequest.state === 'pending'; const isLoadingLogViewStatus = loadLogViewStatusRequest.state === 'pending'; @@ -97,7 +89,7 @@ export const useLogView = ({ const load = useCallback(async () => { const loadedLogView = await loadLogView(logViewId); - const resolvedLoadedLogView = await resolveLogView(loadedLogView.attributes); + const resolvedLoadedLogView = await resolveLogView(loadedLogView.id, loadedLogView.attributes); const resolvedLogViewStatus = await loadLogViewStatus(resolvedLoadedLogView); return [loadedLogView, resolvedLoadedLogView, resolvedLogViewStatus]; @@ -106,7 +98,10 @@ export const useLogView = ({ const update = useCallback( async (logViewAttributes: Partial<LogViewAttributes>) => { const updatedLogView = await updateLogView(logViewId, logViewAttributes); - const resolvedUpdatedLogView = await resolveLogView(updatedLogView.attributes); + const resolvedUpdatedLogView = await resolveLogView( + updatedLogView.id, + updatedLogView.attributes + ); const resolvedLogViewStatus = await loadLogViewStatus(resolvedUpdatedLogView); return [updatedLogView, resolvedUpdatedLogView, resolvedLogViewStatus]; @@ -121,7 +116,7 @@ export const useLogView = ({ return { logViewId, isUninitialized, - derivedDataView, + derivedDataView: resolvedLogView?.dataViewReference, // Failure states hasFailedLoading, diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx index 18ac30bb35e14..3b5956240d0e3 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx @@ -34,10 +34,16 @@ import { useLogViewContext } from '../../../hooks/use_log_view'; import { datemathToEpochMillis, isValidDatemath } from '../../../utils/datemath'; import { LogsToolbar } from './page_toolbar'; import { PageViewLogInContext } from './page_view_log_in_context'; +import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; const PAGE_THRESHOLD = 2; export const LogsPageLogsContent: React.FunctionComponent = () => { + const { + data: { + query: { queryString }, + }, + } = useKibanaContextForPlugin().services; const { resolvedLogView, logView, logViewId } = useLogViewContext(); const { textScale, textWrap } = useLogViewConfigurationContext(); const { @@ -65,7 +71,7 @@ export const LogsPageLogsContent: React.FunctionComponent = () => { updateDateRange, lastCompleteDateRangeExpressionUpdate, } = useLogPositionStateContext(); - const { filterQuery, applyLogFilterQuery } = useLogFilterStateContext(); + const { filterQuery } = useLogFilterStateContext(); const { isReloading, @@ -193,14 +199,14 @@ export const LogsPageLogsContent: React.FunctionComponent = () => { const setFilter = useCallback( (filter: Query, flyoutItemId: string, timeKey: TimeKey | undefined | null) => { - applyLogFilterQuery(filter); + queryString.setQuery(filter); if (timeKey) { jumpToTargetPosition(timeKey); } setSurroundingLogsId(flyoutItemId); stopLiveStreaming(); }, - [applyLogFilterQuery, jumpToTargetPosition, setSurroundingLogsId, stopLiveStreaming] + [jumpToTargetPosition, queryString, setSurroundingLogsId, stopLiveStreaming] ); return ( diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx index ea2af542586a2..026119ff5c74c 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx @@ -27,7 +27,7 @@ const LogFilterState: React.FC = ({ children }) => { const { derivedDataView } = useLogViewContext(); return ( - <LogFilterStateProvider indexPattern={derivedDataView}> + <LogFilterStateProvider dataView={derivedDataView}> <WithLogFilterUrlState /> {children} </LogFilterStateProvider> diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx index 210def8f8844c..cf30518f78ede 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx @@ -6,11 +6,8 @@ */ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { Query } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { QueryStringInput } from '@kbn/unified-search-plugin/public'; -import { DataView } from '@kbn/data-views-plugin/public'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; import { LogCustomizationMenu } from '../../../components/logging/log_customization_menu'; @@ -18,8 +15,6 @@ import { LogDatepicker } from '../../../components/logging/log_datepicker'; import { LogHighlightsMenu } from '../../../components/logging/log_highlights_menu'; import { LogTextScaleControls } from '../../../components/logging/log_text_scale_controls'; import { LogTextWrapControls } from '../../../components/logging/log_text_wrap_controls'; -import { useLogFilterStateContext } from '../../../containers/logs/log_filter'; -import { useLogEntryFlyoutContext } from '../../../containers/logs/log_flyout'; import { useLogHighlightsStateContext } from '../../../containers/logs/log_highlights/log_highlights'; import { useLogPositionStateContext } from '../../../containers/logs/log_position'; import { useLogViewConfigurationContext } from '../../../containers/logs/log_view_configuration'; @@ -29,11 +24,11 @@ export const LogsToolbar = () => { const { derivedDataView } = useLogViewContext(); const { availableTextScales, setTextScale, setTextWrap, textScale, textWrap } = useLogViewConfigurationContext(); - const { filterQueryDraft, isFilterQueryDraftValid, applyLogFilterQuery, setLogFilterQueryDraft } = - useLogFilterStateContext(); - const { setSurroundingLogsId } = useLogEntryFlyoutContext(); - const { http, notifications, docLinks, uiSettings, data, dataViews, storage, unifiedSearch } = - useKibanaContextForPlugin().services; + const { + unifiedSearch: { + ui: { SearchBar }, + }, + } = useKibanaContextForPlugin().services; const { setHighlightTerms, @@ -57,36 +52,20 @@ export const LogsToolbar = () => { <div> <EuiFlexGroup alignItems="center" justifyContent="spaceBetween" gutterSize="l" wrap> <QueryBarFlexItem> - <QueryStringInput - disableLanguageSwitcher={true} + <SearchBar + appName={i18n.translate('xpack.infra.appName', { + defaultMessage: 'Infra logs', + })} iconType="search" - indexPatterns={[derivedDataView as DataView]} - isInvalid={!isFilterQueryDraftValid} - onChange={(query: Query) => { - setSurroundingLogsId(null); - setLogFilterQueryDraft(query); - }} - onSubmit={(query: Query) => { - setSurroundingLogsId(null); - applyLogFilterQuery(query); - }} placeholder={i18n.translate('xpack.infra.logsPage.toolbar.kqlSearchFieldPlaceholder', { defaultMessage: 'Search for log entries… (e.g. host.name:host-1)', })} - query={filterQueryDraft} - appName={i18n.translate('xpack.infra.appName', { - defaultMessage: 'Infra logs', - })} - deps={{ - unifiedSearch, - notifications, - http, - docLinks, - uiSettings, - data, - dataViews, - storage, - }} + useDefaultBehaviors={true} + indexPatterns={derivedDataView ? [derivedDataView] : undefined} + showQueryInput={true} + showQueryMenu={false} + showFilterBar={false} + showDatePicker={false} /> </QueryBarFlexItem> <EuiFlexItem grow={false}> diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.tsx new file mode 100644 index 0000000000000..036d22d8b7c5f --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.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 React from 'react'; +import { EuiSpacer } from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; +import { InfraLoadingPanel } from '../../../../components/loading'; +import { useMetricsDataViewContext } from '../hooks/use_data_view'; +import { UnifiedSearchBar } from './unified_search_bar'; +import { HostsTable } from './hosts_table'; + +export const HostContainer = () => { + const { metricsDataView, isDataViewLoading, hasFailedLoadingDataView } = + useMetricsDataViewContext(); + + if (isDataViewLoading) { + return ( + <InfraLoadingPanel + height="100%" + width="auto" + text={i18n.translate('xpack.infra.waffle.loadingDataText', { + defaultMessage: 'Loading data', + })} + /> + ); + } + + return hasFailedLoadingDataView || !metricsDataView ? null : ( + <> + <UnifiedSearchBar dataView={metricsDataView} /> + <EuiSpacer /> + <HostsTable /> + </> + ); +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx index f81f80faca73e..759c65ca84b2e 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx @@ -6,23 +6,87 @@ */ import React from 'react'; -import { EuiBasicTable } from '@elastic/eui'; -import type { SnapshotNode } from '../../../../../common/http_api'; +import { EuiInMemoryTable } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import { HostsTableColumns } from './hosts_table_columns'; +import { NoData } from '../../../../components/empty_states'; +import { InfraLoadingPanel } from '../../../../components/loading'; import { useHostTable } from '../hooks/use_host_table'; +import { useSnapshot } from '../../inventory_view/hooks/use_snaphot'; +import type { SnapshotMetricType } from '../../../../../common/inventory_models/types'; +import type { InfraTimerangeInput } from '../../../../../common/http_api'; +import { useUnifiedSearchContext } from '../hooks/use_unified_search'; +import { useSourceContext } from '../../../../containers/metrics_source'; -interface Props { - nodes: SnapshotNode[]; -} +const HOST_METRICS: Array<{ type: SnapshotMetricType }> = [ + { type: 'rx' }, + { type: 'tx' }, + { type: 'memory' }, + { type: 'cpuCores' }, + { type: 'memoryTotal' }, +]; + +export const HostsTable = () => { + const { sourceId } = useSourceContext(); + const { esQuery, dateRangeTimestamp } = useUnifiedSearchContext(); + + const timeRange: InfraTimerangeInput = { + from: dateRangeTimestamp.from, + to: dateRangeTimestamp.to, + interval: '1m', + ignoreLookback: true, + }; + + // Snapshot endpoint internally uses the indices stored in source.configuration.metricAlias. + // For the Unified Search, we create a data view, which for now will be built off of source.configuration.metricAlias too + // if we introduce data view selection, we'll have to change this hook and the endpoint to accept a new parameter for the indices + const { loading, nodes, reload } = useSnapshot( + esQuery && JSON.stringify(esQuery), + HOST_METRICS, + [], + 'host', + sourceId, + dateRangeTimestamp.to, + '', + '', + true, + timeRange + ); -export const HostsTable: React.FunctionComponent<Props> = ({ nodes }) => { const items = useHostTable(nodes); + const noData = items.length === 0; return ( - <EuiBasicTable - tableCaption="Infrastructure metrics for hosts" - items={items} - columns={HostsTableColumns} - /> + <> + {loading ? ( + <InfraLoadingPanel + height="100%" + width="auto" + text={i18n.translate('xpack.infra.waffle.loadingDataText', { + defaultMessage: 'Loading data', + })} + /> + ) : noData ? ( + <div> + <NoData + titleText={i18n.translate('xpack.infra.waffle.noDataTitle', { + defaultMessage: 'There is no data to display.', + })} + bodyText={i18n.translate('xpack.infra.waffle.noDataDescription', { + defaultMessage: 'Try adjusting your time or filter.', + })} + refetchText={i18n.translate('xpack.infra.waffle.checkNewDataButtonLabel', { + defaultMessage: 'Check for new data', + })} + onRefetch={() => { + reload(); + }} + testString="noMetricsDataPrompt" + /> + </div> + ) : ( + <EuiInMemoryTable pagination sorting items={items} columns={HostsTableColumns} /> + )} + </> ); }; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table_columns.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table_columns.tsx index 7bd8184b0e464..04d035b5fb7eb 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table_columns.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table_columns.tsx @@ -9,13 +9,14 @@ import { EuiBasicTableColumn } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiText } from '@elastic/eui'; +import type { SnapshotNodeMetric } from '../../../../../common/http_api'; import { scaleUpPercentage } from '../../../../components/infrastructure_node_metrics_tables/shared/hooks'; -import type { SnapshotNodeMetric } from '../../../../../common/http_api/snapshot_api'; import { NumberCell } from '../../../../components/infrastructure_node_metrics_tables/shared/components'; interface HostNodeRow extends HostMetics { - os?: string | null | undefined; - servicesOnHost?: number | null | undefined; + os?: string | null; + servicesOnHost?: number | null; + name: string; } export interface HostMetics { @@ -31,7 +32,8 @@ export const HostsTableColumns: Array<EuiBasicTableColumn<HostNodeRow>> = [ name: i18n.translate('xpack.infra.hostsTable.nameColumnHeader', { defaultMessage: 'Name', }), - field: 'label', + field: 'name', + sortable: true, truncateText: true, textOnly: true, render: (name: string) => <EuiText size="s">{name}</EuiText>, @@ -41,59 +43,63 @@ export const HostsTableColumns: Array<EuiBasicTableColumn<HostNodeRow>> = [ defaultMessage: 'Operating System', }), field: 'os', - render: (os: string) => <EuiText size="s">{os ?? '-'}</EuiText>, + sortable: true, + render: (os: string) => <EuiText size="s">{os}</EuiText>, }, { name: i18n.translate('xpack.infra.hostsTable.numberOfCpusColumnHeader', { defaultMessage: '# of CPUs', }), - field: 'cpuCores', - render: (cpuCores: { value: number }) => <NumberCell value={cpuCores.value} />, + field: 'cpuCores.value', + sortable: true, + render: (value: number) => <NumberCell value={value} />, }, { name: i18n.translate('xpack.infra.hostsTable.diskLatencyColumnHeader', { defaultMessage: 'Disk Latency', }), field: 'diskLatency', + sortable: true, render: (ds: number) => <NumberCell value={ds} unit=" ms" />, }, { name: i18n.translate('xpack.infra.hostsTable.averageTxColumnHeader', { defaultMessage: 'TX (avg.)', }), - field: 'tx', - render: (tx: { avg: number }) => <NumberCell value={tx.avg} />, + field: 'tx.avg', + sortable: true, + render: (avg: number) => <NumberCell value={avg} />, }, { name: i18n.translate('xpack.infra.hostsTable.averageRxColumnHeader', { defaultMessage: 'RX (avg.)', }), - field: 'rx', - render: (rx: { avg: number }) => <NumberCell value={rx.avg} />, + field: 'rx.avg', + sortable: true, + render: (avg: number) => <NumberCell value={avg} />, }, { name: i18n.translate('xpack.infra.hostsTable.averageMemoryTotalColumnHeader', { defaultMessage: 'Memory total (avg.)', }), - field: 'memoryTotal', - render: (memoryTotal: { avg: number }) => ( - <NumberCell value={Math.floor(memoryTotal.avg)} unit=" MB" /> - ), + field: 'memoryTotal.avg', + sortable: true, + render: (avg: number) => <NumberCell value={Math.floor(avg)} unit=" MB" />, }, { name: i18n.translate('xpack.infra.hostsTable.servicesOnHostColumnHeader', { defaultMessage: 'Services on Host', }), field: 'servicesOnHost', + sortable: true, render: (servicesOnHost: number) => <NumberCell value={servicesOnHost} />, }, { name: i18n.translate('xpack.infra.hostsTable.averageMemoryUsageColumnHeader', { defaultMessage: 'Memory usage (avg.)', }), - field: 'memory', - render: (memory: { avg: number }) => ( - <NumberCell value={scaleUpPercentage(memory.avg)} unit="%" /> - ), + field: 'memory.avg', + sortable: true, + render: (avg: number) => <NumberCell value={scaleUpPercentage(avg)} unit="%" />, }, ]; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/unified_search_bar.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/unified_search_bar.tsx new file mode 100644 index 0000000000000..ec9879579908e --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/unified_search_bar.tsx @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import type { Filter, Query, TimeRange } from '@kbn/es-query'; +import type { DataView } from '@kbn/data-views-plugin/public'; +import type { SavedQuery } from '@kbn/data-plugin/public'; +import type { InfraClientStartDeps } from '../../../../types'; +import { useUnifiedSearchContext } from '../hooks/use_unified_search'; + +interface Props { + dataView: DataView; +} + +export const UnifiedSearchBar = ({ dataView }: Props) => { + const { + services: { unifiedSearch }, + } = useKibana<InfraClientStartDeps>(); + const { + unifiedSearchDateRange, + unifiedSearchQuery, + submitFilterChange, + saveQuery, + clearSavedQUery, + } = useUnifiedSearchContext(); + + const { SearchBar } = unifiedSearch.ui; + + const onFilterChange = (filters: Filter[]) => { + onQueryChange({ filters }); + }; + + const onQuerySubmit = (payload: { dateRange: TimeRange; query?: Query }) => { + onQueryChange({ payload }); + }; + + const onClearSavedQuery = () => { + clearSavedQUery(); + }; + + const onQuerySave = (savedQuery: SavedQuery) => { + saveQuery(savedQuery); + }; + + const onQueryChange = ({ + payload, + filters, + }: { + payload?: { dateRange: TimeRange; query?: Query }; + filters?: Filter[]; + }) => { + submitFilterChange(payload?.query, payload?.dateRange, filters); + }; + + return ( + <SearchBar + appName={'Infra Hosts'} + indexPatterns={[dataView]} + query={unifiedSearchQuery} + dateRangeFrom={unifiedSearchDateRange.from} + dateRangeTo={unifiedSearchDateRange.to} + onQuerySubmit={onQuerySubmit} + onSaved={onQuerySave} + onSavedQueryUpdated={onQuerySave} + onClearSavedQuery={onClearSavedQuery} + showSaveQuery + showQueryInput + // @ts-expect-error onFiltersUpdated is a valid prop on SearchBar + onFiltersUpdated={onFilterChange} + /> + ); +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts new file mode 100644 index 0000000000000..2a2bb57b102ff --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts @@ -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 { useDataView } from './use_data_view'; +import { renderHook } from '@testing-library/react-hooks'; +import { KibanaReactContextValue, useKibana } from '@kbn/kibana-react-plugin/public'; +import { coreMock, notificationServiceMock } from '@kbn/core/public/mocks'; +import type { DataView } from '@kbn/data-views-plugin/public'; +import { DataViewsServicePublic } from '@kbn/data-views-plugin/public/types'; +import { InfraClientStartDeps } from '../../../../types'; +import { CoreStart } from '@kbn/core/public'; + +jest.mock('@kbn/i18n'); +jest.mock('@kbn/kibana-react-plugin/public'); + +let dataViewMock: jest.Mocked<DataViewsServicePublic>; +const useKibanaMock = useKibana as jest.MockedFunction<typeof useKibana>; +const notificationMock = notificationServiceMock.createStartContract(); +const prop = { metricAlias: 'test' }; + +const mockUseKibana = () => { + useKibanaMock.mockReturnValue({ + services: { + ...coreMock.createStart(), + notifications: notificationMock, + dataViews: dataViewMock, + } as Partial<CoreStart> & Partial<InfraClientStartDeps>, + } as unknown as KibanaReactContextValue<Partial<CoreStart> & Partial<InfraClientStartDeps>>); +}; + +const mockDataView = { + id: 'mock-id', + title: 'mock-title', + timeFieldName: 'mock-time-field-name', + isPersisted: () => false, + getName: () => 'mock-data-view', + toSpec: () => ({}), +} as jest.Mocked<DataView>; + +describe('useHostTable hook', () => { + beforeEach(() => { + dataViewMock = { + createAndSave: jest.fn(), + find: jest.fn(), + } as Partial<DataViewsServicePublic> as jest.Mocked<DataViewsServicePublic>; + + mockUseKibana(); + }); + + it('should find an existing Data view', async () => { + dataViewMock.find.mockReturnValue(Promise.resolve([mockDataView])); + const { result, waitForNextUpdate } = renderHook(() => useDataView(prop)); + + await waitForNextUpdate(); + expect(result.current.isDataViewLoading).toEqual(false); + expect(result.current.hasFailedLoadingDataView).toEqual(false); + expect(result.current.metricsDataView).toEqual(mockDataView); + }); + + it('should create a new Data view', async () => { + dataViewMock.find.mockReturnValue(Promise.resolve([])); + dataViewMock.createAndSave.mockReturnValue(Promise.resolve(mockDataView)); + const { result, waitForNextUpdate } = renderHook(() => useDataView(prop)); + + await waitForNextUpdate(); + expect(result.current.isDataViewLoading).toEqual(false); + expect(result.current.hasFailedLoadingDataView).toEqual(false); + expect(result.current.metricsDataView).toEqual(mockDataView); + }); + + it('should display a toast when it fails to load the data view', async () => { + dataViewMock.find.mockReturnValue(Promise.reject()); + const { result, waitForNextUpdate } = renderHook(() => useDataView(prop)); + + await waitForNextUpdate(); + expect(result.current.isDataViewLoading).toEqual(false); + expect(result.current.hasFailedLoadingDataView).toEqual(true); + expect(result.current.metricsDataView).toBeUndefined(); + expect(notificationMock.toasts.addDanger).toBeCalledTimes(1); + }); +}); diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.ts index b60b2aa89db62..f927afa72890c 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.ts +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { useCallback, useState, useEffect } from 'react'; +import { i18n } from '@kbn/i18n'; +import { useCallback, useState, useEffect, useMemo } from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import createContainer from 'constate'; import type { DataView } from '@kbn/data-views-plugin/public'; @@ -15,7 +16,7 @@ import { useTrackedPromise } from '../../../../utils/use_tracked_promise'; export const useDataView = ({ metricAlias }: { metricAlias: string }) => { const [metricsDataView, setMetricsDataView] = useState<DataView>(); const { - services: { dataViews }, + services: { dataViews, notifications }, } = useKibana<InfraClientStartDeps>(); const [createDataViewRequest, createDataView] = useTrackedPromise( @@ -33,7 +34,7 @@ export const useDataView = ({ metricAlias }: { metricAlias: string }) => { const [getDataViewRequest, getDataView] = useTrackedPromise( { - createPromise: (indexPattern: string): Promise<DataView[]> => { + createPromise: (_indexPattern: string): Promise<DataView[]> => { return dataViews.find(metricAlias, 1); }, onResolve: (response: DataView[]) => { @@ -58,17 +59,36 @@ export const useDataView = ({ metricAlias }: { metricAlias: string }) => { } }, [metricAlias, createDataView, getDataView]); - const hasFailedFetchingDataView = getDataViewRequest.state === 'rejected'; - const hasFailedCreatingDataView = createDataViewRequest.state === 'rejected'; + const isDataViewLoading = useMemo( + () => getDataViewRequest.state === 'pending' || createDataViewRequest.state === 'pending', + [getDataViewRequest.state, createDataViewRequest.state] + ); + + const hasFailedLoadingDataView = useMemo( + () => getDataViewRequest.state === 'rejected' || createDataViewRequest.state === 'rejected', + [getDataViewRequest.state, createDataViewRequest.state] + ); useEffect(() => { loadDataView(); }, [metricAlias, loadDataView]); + useEffect(() => { + if (hasFailedLoadingDataView && notifications) { + notifications.toasts.addDanger( + i18n.translate('xpack.infra.hostsTable.errorOnCreateOrLoadDataview', { + defaultMessage: + 'There was an error trying to load or create the Data View: {metricAlias}', + values: { metricAlias }, + }) + ); + } + }, [hasFailedLoadingDataView, notifications, metricAlias]); + return { metricsDataView, - hasFailedCreatingDataView, - hasFailedFetchingDataView, + isDataViewLoading, + hasFailedLoadingDataView, }; }; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_table.test.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_table.test.ts index e0d26413f0453..81b0e93f10121 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_table.test.ts +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_table.test.ts @@ -70,6 +70,8 @@ describe('useHostTable hook', () => { const items = [ { + name: 'host-0', + os: '-', rx: { name: 'rx', avg: 252456.92916666667, @@ -91,11 +93,10 @@ describe('useHostTable hook', () => { avg: 34359.738368, }, - value: 'host-0', - label: 'host-0', - os: null, }, { + name: 'host-1', + os: 'macOS', rx: { name: 'rx', avg: 95.86339715321859, @@ -116,10 +117,6 @@ describe('useHostTable hook', () => { name: 'memoryTotal', avg: 9.194304, }, - value: 'host-1', - label: 'host-1', - ip: '243.86.94.22', - os: 'macOS', }, ]; const result = renderHook(() => useHostTable(nodes)); diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_table.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_table.ts index 4c604b2a27217..32eed5e54ce6b 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_table.ts +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_table.ts @@ -5,7 +5,6 @@ * 2.0. */ -import { last } from 'lodash'; import { useMemo } from 'react'; import type { SnapshotNode, SnapshotNodeMetric } from '../../../../../common/http_api'; import { HostMetics } from '../components/hosts_table_columns'; @@ -13,9 +12,10 @@ import { HostMetics } from '../components/hosts_table_columns'; type MappedMetrics = Record<keyof HostMetics, SnapshotNodeMetric>; export const useHostTable = (nodes: SnapshotNode[]) => { - const items: MappedMetrics[] = useMemo(() => { - return nodes.map(({ metrics, path }) => ({ - ...last(path), + const items = useMemo(() => { + return nodes.map(({ metrics, path, name }) => ({ + name, + os: path.at(-1)?.os ?? '-', ...metrics.reduce((data, metric) => { data[metric.name as keyof HostMetics] = metric; return data; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts new file mode 100644 index 0000000000000..4b3d4e7a47df6 --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts @@ -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 { useKibana } from '@kbn/kibana-react-plugin/public'; +import createContainer from 'constate'; +import { useCallback, useReducer } from 'react'; +import { buildEsQuery, Filter, Query, TimeRange } from '@kbn/es-query'; +import DateMath from '@kbn/datemath'; +import type { SavedQuery } from '@kbn/data-plugin/public'; +import type { InfraClientStartDeps } from '../../../../types'; +import { useMetricsDataViewContext } from './use_data_view'; +import { useKibanaTimefilterTime } from '../../../../hooks/use_kibana_timefilter_time'; + +const DEFAULT_FROM_MINUTES_VALUE = 15; + +export const useUnifiedSearch = () => { + const [, forceUpdate] = useReducer((x: number) => x + 1, 0); + + const { metricsDataView } = useMetricsDataViewContext(); + const { services } = useKibana<InfraClientStartDeps>(); + const { + data: { query: queryManager }, + } = services; + + const [getTime, setTime] = useKibanaTimefilterTime({ + from: `now-${DEFAULT_FROM_MINUTES_VALUE}m`, + to: 'now', + }); + const { queryString, filterManager } = queryManager; + + const currentDate = new Date(); + const fromTS = + DateMath.parse(getTime().from)?.valueOf() ?? + new Date(currentDate.getMinutes() - DEFAULT_FROM_MINUTES_VALUE).getTime(); + const toTS = DateMath.parse(getTime().to)?.valueOf() ?? currentDate.getTime(); + + const currentTimeRange = { + from: fromTS, + to: toTS, + }; + + const submitFilterChange = useCallback( + (query?: Query, dateRange?: TimeRange, filters?: Filter[]) => { + if (filters) { + filterManager.setFilters(filters); + } + + setTime({ + ...getTime(), + ...dateRange, + }); + + queryString.setQuery({ ...queryString.getQuery(), ...query }); + // Unified search holds the all state, we need to force the hook to rerender so that it can return the most recent values + // This can be removed once we get the state from the URL + forceUpdate(); + }, + [filterManager, queryString, getTime, setTime] + ); + + const saveQuery = useCallback( + (newSavedQuery: SavedQuery) => { + const savedQueryFilters = newSavedQuery.attributes.filters ?? []; + const globalFilters = filterManager.getGlobalFilters(); + filterManager.setFilters([...savedQueryFilters, ...globalFilters]); + + // Unified search holds the all state, we need to force the hook to rerender so that it can return the most recent values + // This can be removed once we get the state from the URL + forceUpdate(); + }, + [filterManager] + ); + + const clearSavedQUery = useCallback(() => { + filterManager.setFilters(filterManager.getGlobalFilters()); + + // Unified search holds the all state, we need to force the hook to rerender so that it can return the most recent values + // This can be removed once we get the state from the URL + forceUpdate(); + }, [filterManager]); + + const buildQuery = useCallback(() => { + if (!metricsDataView) { + return null; + } + return buildEsQuery(metricsDataView, queryString.getQuery(), filterManager.getFilters()); + }, [filterManager, metricsDataView, queryString]); + + return { + dateRangeTimestamp: currentTimeRange, + esQuery: buildQuery(), + submitFilterChange, + saveQuery, + clearSavedQUery, + unifiedSearchQuery: queryString.getQuery() as Query, + unifiedSearchDateRange: getTime(), + unifiedSearchFilters: filterManager.getFilters(), + }; +}; + +export const UnifiedSearch = createContainer(useUnifiedSearch); +export const [UnifiedSearchProvider, useUnifiedSearchContext] = UnifiedSearch; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hosts_content.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/hosts_content.tsx deleted file mode 100644 index 25aa168ca8dc0..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/hosts_content.tsx +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { Query, TimeRange } from '@kbn/es-query'; -import { i18n } from '@kbn/i18n'; -import React, { useState, useCallback } from 'react'; -import { SearchBar } from '@kbn/unified-search-plugin/public'; -import { EuiSpacer } from '@elastic/eui'; -import { NoData } from '../../../components/empty_states'; -import { InfraLoadingPanel } from '../../../components/loading'; -import { useMetricsDataViewContext } from './hooks/use_data_view'; -import { HostsTable } from './components/hosts_table'; -import { useSourceContext } from '../../../containers/metrics_source'; -import { useSnapshot } from '../inventory_view/hooks/use_snaphot'; -import type { SnapshotMetricType } from '../../../../common/inventory_models/types'; - -export const HostsContent: React.FunctionComponent = () => { - const { source, sourceId } = useSourceContext(); - const [dateRange, setDateRange] = useState<TimeRange>({ from: 'now-15m', to: 'now' }); - const [query, setQuery] = useState<Query>({ query: '', language: 'kuery' }); - const { metricsDataView, hasFailedCreatingDataView, hasFailedFetchingDataView } = - useMetricsDataViewContext(); - // needed to refresh the lens table when filters havent changed - - const onQuerySubmit = useCallback( - (payload: { dateRange: TimeRange; query?: Query }) => { - setDateRange(payload.dateRange); - if (payload.query) { - setQuery(payload.query); - } - }, - [setDateRange, setQuery] - ); - - const hostMetrics: Array<{ type: SnapshotMetricType }> = [ - { type: 'rx' }, - { type: 'tx' }, - { type: 'memory' }, - { type: 'cpuCores' }, - { type: 'memoryTotal' }, - ]; - - const { loading, nodes, reload } = useSnapshot( - '', // use the unified search query, supported type? - hostMetrics, - [], - 'host', - sourceId, - 1666081614879, // currentTime. need to add support for TimeRange? - '', - '', - true, - { - from: 1666081614879, // dynamic time range needs to be supported - interval: '1m', - lookbackSize: 5, - to: 1666082814879, - } - ); - - const noData = !loading && nodes && nodes.length === 0; - - return ( - <div> - {metricsDataView && !loading ? ( - noData ? ( - <NoData - titleText={i18n.translate('xpack.infra.waffle.noDataTitle', { - defaultMessage: 'There is no data to display.', - })} - bodyText={i18n.translate('xpack.infra.waffle.noDataDescription', { - defaultMessage: 'Try adjusting your time or filter.', - })} - refetchText={i18n.translate('xpack.infra.waffle.checkNewDataButtonLabel', { - defaultMessage: 'Check for new data', - })} - onRefetch={() => { - reload(); - }} - testString="noMetricsDataPrompt" - /> - ) : ( - <> - <SearchBar - showFilterBar={false} - showDatePicker={true} - showAutoRefreshOnly={false} - showSaveQuery={true} - showQueryInput={true} - query={query} - dateRangeFrom={dateRange.from} - dateRangeTo={dateRange.to} - indexPatterns={[metricsDataView]} - onQuerySubmit={onQuerySubmit} - /> - <EuiSpacer /> - <HostsTable nodes={nodes} /> - </> - ) - ) : hasFailedCreatingDataView || hasFailedFetchingDataView ? ( - <div> - <div>There was an error trying to load or create the Data View:</div> - {source?.configuration.metricAlias} - </div> - ) : ( - <InfraLoadingPanel - height="100vh" - width="auto" - text={i18n.translate('xpack.infra.waffle.loadingDataText', { - defaultMessage: 'Loading data', - })} - /> - )} - </div> - ); -}; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx index a5dfd7f2ddd0f..3321be0af193c 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx @@ -9,16 +9,16 @@ import { EuiErrorBoundary } from '@elastic/eui'; import React from 'react'; import { useTrackPageview } from '@kbn/observability-plugin/public'; import { APP_WRAPPER_CLASS } from '@kbn/core/public'; - import { SourceErrorPage } from '../../../components/source_error_page'; import { SourceLoadingPage } from '../../../components/source_loading_page'; import { useSourceContext } from '../../../containers/metrics_source'; import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs'; import { MetricsPageTemplate } from '../page_template'; import { hostsTitle } from '../../../translations'; -import { HostsContent } from './hosts_content'; import { MetricsDataViewProvider } from './hooks/use_data_view'; import { fullHeightContentStyles } from '../../../page_template.styles'; +import { UnifiedSearchProvider } from './hooks/use_unified_search'; +import { HostContainer } from './components/hosts_container'; export const HostsPage = () => { const { @@ -56,7 +56,9 @@ export const HostsPage = () => { }} > <MetricsDataViewProvider metricAlias={source.configuration.metricAlias}> - <HostsContent /> + <UnifiedSearchProvider> + <HostContainer /> + </UnifiedSearchProvider> </MetricsDataViewProvider> </MetricsPageTemplate> </div> diff --git a/x-pack/plugins/infra/public/services/log_views/log_views_client.ts b/x-pack/plugins/infra/public/services/log_views/log_views_client.ts index 0de44f87d719e..65bb031d3407b 100644 --- a/x-pack/plugins/infra/public/services/log_views/log_views_client.ts +++ b/x-pack/plugins/infra/public/services/log_views/log_views_client.ts @@ -53,7 +53,7 @@ export class LogViewsClient implements ILogViewsClient { public async getResolvedLogView(logViewId: string): Promise<ResolvedLogView> { const logView = await this.getLogView(logViewId); - const resolvedLogView = await this.resolveLogView(logView.attributes); + const resolvedLogView = await this.resolveLogView(logView.id, logView.attributes); return resolvedLogView; } @@ -118,8 +118,11 @@ export class LogViewsClient implements ILogViewsClient { return data; } - public async resolveLogView(logViewAttributes: LogViewAttributes): Promise<ResolvedLogView> { - return await resolveLogView(logViewAttributes, this.dataViews, this.config); + public async resolveLogView( + logViewId: string, + logViewAttributes: LogViewAttributes + ): Promise<ResolvedLogView> { + return await resolveLogView(logViewId, logViewAttributes, this.dataViews, this.config); } } diff --git a/x-pack/plugins/infra/public/services/log_views/types.ts b/x-pack/plugins/infra/public/services/log_views/types.ts index 20e176db4cab4..9054ef79b4a4c 100644 --- a/x-pack/plugins/infra/public/services/log_views/types.ts +++ b/x-pack/plugins/infra/public/services/log_views/types.ts @@ -32,5 +32,5 @@ export interface ILogViewsClient { getResolvedLogViewStatus(resolvedLogView: ResolvedLogView): Promise<LogViewStatus>; getResolvedLogView(logViewId: string): Promise<ResolvedLogView>; putLogView(logViewId: string, logViewAttributes: Partial<LogViewAttributes>): Promise<LogView>; - resolveLogView(logViewAttributes: LogViewAttributes): Promise<ResolvedLogView>; + resolveLogView(logViewId: string, logViewAttributes: LogViewAttributes): Promise<ResolvedLogView>; } diff --git a/x-pack/plugins/infra/public/utils/url_state.tsx b/x-pack/plugins/infra/public/utils/url_state.tsx index 77f04292cbde2..c45b47074f8ca 100644 --- a/x-pack/plugins/infra/public/utils/url_state.tsx +++ b/x-pack/plugins/infra/public/utils/url_state.tsx @@ -7,11 +7,11 @@ import { parse, stringify } from 'query-string'; import { History, Location } from 'history'; -import { throttle } from 'lodash'; import React from 'react'; import { Route, RouteProps } from 'react-router-dom'; import { decode, encode, RisonValue } from 'rison-node'; import { url } from '@kbn/kibana-utils-plugin/public'; +import { throttle } from 'lodash'; interface UrlStateContainerProps<UrlState> { urlState: UrlState | undefined; diff --git a/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts index 64d389a1c0bf7..55b847d33f87d 100644 --- a/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts @@ -22,16 +22,18 @@ import { SpacesPluginSetup } from '@kbn/spaces-plugin/server'; import { PluginSetupContract as AlertingPluginContract } from '@kbn/alerting-plugin/server'; import { MlPluginSetup } from '@kbn/ml-plugin/server'; import { RuleRegistryPluginSetupContract } from '@kbn/rule-registry-plugin/server'; +import { ObservabilityPluginSetup } from '@kbn/observability-plugin/server'; export interface InfraServerPluginSetupDeps { + alerting: AlertingPluginContract; data: DataPluginSetup; home: HomeServerPluginSetup; + features: FeaturesPluginSetup; + ruleRegistry: RuleRegistryPluginSetupContract; + observability: ObservabilityPluginSetup; spaces: SpacesPluginSetup; usageCollection: UsageCollectionSetup; visTypeTimeseries: VisTypeTimeseriesSetup; - features: FeaturesPluginSetup; - alerting: AlertingPluginContract; - ruleRegistry: RuleRegistryPluginSetupContract; ml?: MlPluginSetup; } diff --git a/x-pack/plugins/infra/server/lib/alerting/common/messages.ts b/x-pack/plugins/infra/server/lib/alerting/common/messages.ts index 80dae7ffac959..644c31813deae 100644 --- a/x-pack/plugins/infra/server/lib/alerting/common/messages.ts +++ b/x-pack/plugins/infra/server/lib/alerting/common/messages.ts @@ -169,6 +169,14 @@ export const alertStateActionVariableDescription = i18n.translate( } ); +export const alertDetailUrlActionVariableDescription = i18n.translate( + 'xpack.infra.metrics.alerting.alertDetailUrlActionVariableDescription', + { + defaultMessage: + 'Link to the view within Elastic that shows further details and context surrounding this alert', + } +); + export const reasonActionVariableDescription = i18n.translate( 'xpack.infra.metrics.alerting.reasonActionVariableDescription', { @@ -211,7 +219,7 @@ export const viewInAppUrlActionVariableDescription = i18n.translate( 'xpack.infra.metrics.alerting.viewInAppUrlActionVariableDescription', { defaultMessage: - 'Link to the view or feature within Elastic that can be used to investigate the alert and its context further', + 'Link to the view or feature within Elastic that can assist with further investigation', } ); diff --git a/x-pack/plugins/infra/server/lib/alerting/common/utils.ts b/x-pack/plugins/infra/server/lib/alerting/common/utils.ts index 2618af72168cd..ced80c75a3ef1 100644 --- a/x-pack/plugins/infra/server/lib/alerting/common/utils.ts +++ b/x-pack/plugins/infra/server/lib/alerting/common/utils.ts @@ -9,8 +9,11 @@ import { isEmpty, isError } from 'lodash'; import { schema } from '@kbn/config-schema'; import { Logger, LogMeta } from '@kbn/logging'; import type { IBasePath } from '@kbn/core/server'; +import { addSpaceIdToPath } from '@kbn/spaces-plugin/common'; +import { ObservabilityConfig } from '@kbn/observability-plugin/server'; import { ALERT_RULE_PARAMETERS, TIMESTAMP } from '@kbn/rule-data-utils'; import { parseTechnicalFields } from '@kbn/rule-registry-plugin/common/parse_technical_fields'; +import { LINK_TO_METRICS_EXPLORER } from '../../../../common/alerting/metrics'; import { getInventoryViewInAppUrl } from '../../../../common/alerting/metrics/alert_link'; import { AlertExecutionDetails, @@ -83,18 +86,30 @@ export const createScopedLogger = ( }; }; -export const getViewInAppUrl = (basePath: IBasePath, relativeViewInAppUrl: string) => - basePath.publicBaseUrl - ? new URL(basePath.prepend(relativeViewInAppUrl), basePath.publicBaseUrl).toString() - : relativeViewInAppUrl; +export const getAlertDetailsPageEnabledForApp = ( + config: ObservabilityConfig['unsafe']['alertDetails'] | null, + appName: keyof ObservabilityConfig['unsafe']['alertDetails'] +): boolean => { + if (!config) return false; -export const getViewInAppUrlInventory = ( - criteria: InventoryMetricConditions[], - nodeType: string, - timestamp: string, - basePath: IBasePath -) => { + return config[appName].enabled; +}; + +export const getViewInInventoryAppUrl = ({ + basePath, + criteria, + nodeType, + spaceId, + timestamp, +}: { + basePath: IBasePath; + criteria: InventoryMetricConditions[]; + nodeType: string; + spaceId: string; + timestamp: string; +}) => { const { metric, customMetric } = criteria[0]; + const fields = { [`${ALERT_RULE_PARAMETERS}.criteria.metric`]: [metric], [`${ALERT_RULE_PARAMETERS}.criteria.customMetric.id`]: [customMetric?.id], @@ -104,6 +119,18 @@ export const getViewInAppUrlInventory = ( [TIMESTAMP]: timestamp, }; - const relativeViewInAppUrl = getInventoryViewInAppUrl(parseTechnicalFields(fields, true)); - return getViewInAppUrl(basePath, relativeViewInAppUrl); + return addSpaceIdToPath( + basePath.publicBaseUrl, + spaceId, + getInventoryViewInAppUrl(parseTechnicalFields(fields, true)) + ); }; + +export const getViewInMetricsAppUrl = (basePath: IBasePath, spaceId: string) => + addSpaceIdToPath(basePath.publicBaseUrl, spaceId, LINK_TO_METRICS_EXPLORER); + +export const getAlertDetailsUrl = ( + basePath: IBasePath, + spaceId: string, + alertUuid: string | null +) => addSpaceIdToPath(basePath.publicBaseUrl, spaceId, `/app/observability/alerts/${alertUuid}`); diff --git a/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts index 2e51d2e8291b5..4a5fe10081355 100644 --- a/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts @@ -30,7 +30,12 @@ import { buildNoDataAlertReason, stateToAlertMessage, } from '../common/messages'; -import { createScopedLogger, getViewInAppUrlInventory } from '../common/utils'; +import { + createScopedLogger, + getAlertDetailsUrl, + getViewInInventoryAppUrl, + UNGROUPED_FACTORY_KEY, +} from '../common/utils'; import { evaluateCondition, ConditionResult } from './evaluate_condition'; type InventoryMetricThresholdAllowedActionGroups = ActionGroupIdsOf< @@ -61,12 +66,21 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = InventoryMetricThresholdAlertState, InventoryMetricThresholdAlertContext, InventoryMetricThresholdAllowedActionGroups - >(async ({ services, params, alertId, executionId, startedAt }) => { + >(async ({ services, params, executionId, spaceId, startedAt, rule: { id: ruleId } }) => { const startTime = Date.now(); + const { criteria, filterQuery, sourceId = 'default', nodeType, alertOnNoData } = params; + if (criteria.length === 0) throw new Error('Cannot execute an alert with 0 conditions'); - const logger = createScopedLogger(libs.logger, 'inventoryRule', { alertId, executionId }); - const { alertWithLifecycle, savedObjectsClient, getAlertStartedDate } = services; + + const logger = createScopedLogger(libs.logger, 'inventoryRule', { + alertId: ruleId, + executionId, + }); + + const esClient = services.scopedClusterClient.asCurrentUser; + + const { alertWithLifecycle, savedObjectsClient, getAlertStartedDate, getAlertUuid } = services; const alertFactory: InventoryMetricThresholdAlertFactory = (id, reason, additionalContext) => alertWithLifecycle({ id, @@ -85,23 +99,28 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = logger.error(e.message); const actionGroupId = FIRED_ACTIONS.id; // Change this to an Error action group when able const reason = buildInvalidQueryAlertReason(params.filterQueryText); - const alert = alertFactory('*', reason); - const indexedStartedDate = getAlertStartedDate('*') ?? startedAt.toISOString(); - const viewInAppUrl = getViewInAppUrlInventory( - criteria, - nodeType, - indexedStartedDate, - libs.basePath - ); + const alert = alertFactory(UNGROUPED_FACTORY_KEY, reason); + const indexedStartedDate = + getAlertStartedDate(UNGROUPED_FACTORY_KEY) ?? startedAt.toISOString(); + const alertUuid = getAlertUuid(UNGROUPED_FACTORY_KEY); + alert.scheduleActions(actionGroupId, { - group: '*', + alertDetailsUrl: getAlertDetailsUrl(libs.basePath, spaceId, alertUuid), alertState: stateToAlertMessage[AlertStates.ERROR], + group: UNGROUPED_FACTORY_KEY, + metric: mapToConditionsLookup(criteria, (c) => c.metric), reason, timestamp: startedAt.toISOString(), - viewInAppUrl, value: null, - metric: mapToConditionsLookup(criteria, (c) => c.metric), + viewInAppUrl: getViewInInventoryAppUrl({ + basePath: libs.basePath, + criteria, + nodeType, + timestamp: indexedStartedDate, + spaceId, + }), }); + return {}; } } @@ -109,7 +128,7 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = const [, , { logViews }] = await libs.getStartServices(); const logQueryFields: LogQueryFields | undefined = await logViews - .getClient(savedObjectsClient, services.scopedClusterClient.asCurrentUser) + .getClient(savedObjectsClient, esClient) .getResolvedLogView(sourceId) .then( ({ indices }) => ({ indexPattern: indices }), @@ -120,18 +139,19 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = const results = await Promise.all( criteria.map((condition) => evaluateCondition({ - condition, - nodeType, - source, - logQueryFields, - esClient: services.scopedClusterClient.asCurrentUser, compositeSize, - filterQuery, + condition, + esClient, executionTimestamp: startedAt, + filterQuery, logger, + logQueryFields, + nodeType, + source, }) ) ); + let scheduledActionsCount = 0; const inventoryItems = Object.keys(first(results)!); for (const group of inventoryItems) { @@ -190,25 +210,28 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = const alert = alertFactory(group, reason, additionalContext); const indexedStartedDate = getAlertStartedDate(group) ?? startedAt.toISOString(); - const viewInAppUrl = getViewInAppUrlInventory( - criteria, - nodeType, - indexedStartedDate, - libs.basePath - ); + const alertUuid = getAlertUuid(group); + scheduledActionsCount++; const context = { - group, + alertDetailsUrl: getAlertDetailsUrl(libs.basePath, spaceId, alertUuid), alertState: stateToAlertMessage[nextState], + group, reason, + metric: mapToConditionsLookup(criteria, (c) => c.metric), timestamp: startedAt.toISOString(), - viewInAppUrl, + threshold: mapToConditionsLookup(criteria, (c) => c.threshold), value: mapToConditionsLookup(results, (result) => formatMetric(result[group].metric, result[group].currentValue) ), - threshold: mapToConditionsLookup(criteria, (c) => c.threshold), - metric: mapToConditionsLookup(criteria, (c) => c.metric), + viewInAppUrl: getViewInInventoryAppUrl({ + basePath: libs.basePath, + criteria, + nodeType, + timestamp: indexedStartedDate, + spaceId, + }), ...additionalContext, }; alert.scheduleActions(actionGroupId, context); @@ -217,24 +240,27 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = const { getRecoveredAlerts } = services.alertFactory.done(); const recoveredAlerts = getRecoveredAlerts(); + for (const alert of recoveredAlerts) { const recoveredAlertId = alert.getId(); const indexedStartedDate = getAlertStartedDate(recoveredAlertId) ?? startedAt.toISOString(); - const viewInAppUrl = getViewInAppUrlInventory( - criteria, - nodeType, - indexedStartedDate, - libs.basePath - ); - const context = { - group: recoveredAlertId, + const alertUuid = getAlertUuid(recoveredAlertId); + + alert.setContext({ + alertDetailsUrl: getAlertDetailsUrl(libs.basePath, spaceId, alertUuid), alertState: stateToAlertMessage[AlertStates.OK], - timestamp: startedAt.toISOString(), - viewInAppUrl, - threshold: mapToConditionsLookup(criteria, (c) => c.threshold), + group: recoveredAlertId, metric: mapToConditionsLookup(criteria, (c) => c.metric), - }; - alert.setContext(context); + threshold: mapToConditionsLookup(criteria, (c) => c.threshold), + timestamp: startedAt.toISOString(), + viewInAppUrl: getViewInInventoryAppUrl({ + basePath: libs.basePath, + criteria, + nodeType, + timestamp: indexedStartedDate, + spaceId, + }), + }); } const stopTime = Date.now(); diff --git a/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/register_inventory_metric_threshold_rule_type.ts b/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/register_inventory_metric_threshold_rule_type.ts index b3b1f5ba21c65..030628f59ad38 100644 --- a/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/register_inventory_metric_threshold_rule_type.ts +++ b/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/register_inventory_metric_threshold_rule_type.ts @@ -24,6 +24,7 @@ import { } from '../../../../common/inventory_models/types'; import { InfraBackendLibs } from '../../infra_types'; import { + alertDetailUrlActionVariableDescription, alertStateActionVariableDescription, cloudActionVariableDescription, containerActionVariableDescription, @@ -39,7 +40,11 @@ import { valueActionVariableDescription, viewInAppUrlActionVariableDescription, } from '../common/messages'; -import { oneOfLiterals, validateIsStringElasticsearchJSONFilter } from '../common/utils'; +import { + getAlertDetailsPageEnabledForApp, + oneOfLiterals, + validateIsStringElasticsearchJSONFilter, +} from '../common/utils'; import { createInventoryMetricThresholdExecutor, FIRED_ACTIONS, @@ -72,6 +77,8 @@ export async function registerMetricInventoryThresholdRuleType( alertingPlugin: PluginSetupContract, libs: InfraBackendLibs ) { + const config = libs.getAlertDetailsConfig(); + alertingPlugin.registerType({ id: METRIC_INVENTORY_THRESHOLD_ALERT_TYPE_ID, name: i18n.translate('xpack.infra.metrics.inventory.alertName', { @@ -102,6 +109,9 @@ export async function registerMetricInventoryThresholdRuleType( context: [ { name: 'group', description: groupActionVariableDescription }, { name: 'alertState', description: alertStateActionVariableDescription }, + ...(getAlertDetailsPageEnabledForApp(config, 'metrics') + ? [{ name: 'alertDetailsUrl', description: alertDetailUrlActionVariableDescription }] + : []), { name: 'reason', description: reasonActionVariableDescription }, { name: 'timestamp', description: timestampActionVariableDescription }, { name: 'value', description: valueActionVariableDescription }, diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.ts new file mode 100644 index 0000000000000..f5e2a19cb70e9 --- /dev/null +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.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 { ElasticsearchClient } from '@kbn/core/server'; +import type { Logger } from '@kbn/logging'; +import { isString, get, identity } from 'lodash'; +import type { BucketKey } from './get_data'; +import { calculateCurrentTimeframe, createBaseFilters } from './metric_query'; +import { MetricExpressionParams } from '../../../../../common/alerting/metrics'; + +export interface MissingGroupsRecord { + key: string; + bucketKey: BucketKey; +} + +export const checkMissingGroups = async ( + esClient: ElasticsearchClient, + metricParams: MetricExpressionParams, + indexPattern: string, + groupBy: string | undefined | string[], + filterQuery: string | undefined, + logger: Logger, + timeframe: { start: number; end: number }, + missingGroups: MissingGroupsRecord[] = [] +): Promise<MissingGroupsRecord[]> => { + if (missingGroups.length === 0) { + return missingGroups; + } + const currentTimeframe = calculateCurrentTimeframe(metricParams, timeframe); + const baseFilters = createBaseFilters(metricParams, currentTimeframe, filterQuery); + const groupByFields = isString(groupBy) ? [groupBy] : groupBy ? groupBy : []; + + const searches = missingGroups.flatMap((group) => { + const groupByFilters = Object.values(group.bucketKey).map((key, index) => { + return { + match: { + [groupByFields[index]]: key, + }, + }; + }); + return [ + { index: indexPattern }, + { + size: 0, + terminate_after: 1, + track_total_hits: true, + query: { + bool: { + filter: [...baseFilters, ...groupByFilters], + }, + }, + }, + ]; + }); + + logger.trace(`Request: ${JSON.stringify({ searches })}`); + const response = await esClient.msearch({ searches }); + logger.trace(`Response: ${JSON.stringify(response)}`); + + const verifiedMissingGroups = response.responses + .map((resp, index) => { + const total = get(resp, 'hits.total.value', 0) as number; + if (!total) { + return missingGroups[index]; + } + return null; + }) + .filter(identity) as MissingGroupsRecord[]; + + return verifiedMissingGroups; +}; diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/convert_strings_to_missing_groups_record.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/convert_strings_to_missing_groups_record.ts new file mode 100644 index 0000000000000..ef1091579dd76 --- /dev/null +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/convert_strings_to_missing_groups_record.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 { isString } from 'lodash'; +import { MissingGroupsRecord } from './check_missing_group'; + +export const convertStringsToMissingGroupsRecord = ( + missingGroups: Array<string | MissingGroupsRecord> +) => { + return missingGroups.map((subject) => { + if (isString(subject)) { + const parts = subject.split(','); + return { + key: subject, + bucketKey: parts.reduce((acc, part, index) => { + return { ...acc, [`groupBy${index}`]: part }; + }, {}), + }; + } + return subject; + }); +}; diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts index f994726f21f84..2d0299a9043e2 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts @@ -14,6 +14,7 @@ import { getIntervalInSeconds } from '../../../../../common/utils/get_interval_i import { DOCUMENT_COUNT_I18N } from '../../common/messages'; import { createTimerange } from './create_timerange'; import { getData } from './get_data'; +import { checkMissingGroups, MissingGroupsRecord } from './check_missing_group'; export interface EvaluatedRuleParams { criteria: MetricExpressionParams[]; @@ -29,6 +30,7 @@ export type Evaluation = Omit<MetricExpressionParams, 'metric'> & { shouldFire: boolean; shouldWarn: boolean; isNoData: boolean; + bucketKey: Record<string, string>; }; export const evaluateRule = async <Params extends EvaluatedRuleParams = EvaluatedRuleParams>( @@ -40,7 +42,7 @@ export const evaluateRule = async <Params extends EvaluatedRuleParams = Evaluate logger: Logger, lastPeriodEnd?: number, timeframe?: { start?: number; end: number }, - missingGroups: string[] = [] + missingGroups: MissingGroupsRecord[] = [] ): Promise<Array<Record<string, Evaluation>>> => { const { criteria, groupBy, filterQuery } = params; @@ -69,12 +71,24 @@ export const evaluateRule = async <Params extends EvaluatedRuleParams = Evaluate lastPeriodEnd ); - for (const missingGroup of missingGroups) { - if (currentValues[missingGroup] == null) { - currentValues[missingGroup] = { + const verifiedMissingGroups = await checkMissingGroups( + esClient, + criterion, + config.metricAlias, + groupBy, + filterQuery, + logger, + calculatedTimerange, + missingGroups + ); + + for (const missingGroup of verifiedMissingGroups) { + if (currentValues[missingGroup.key] == null) { + currentValues[missingGroup.key] = { value: null, trigger: false, warn: false, + bucketKey: missingGroup.bucketKey, }; } } @@ -91,6 +105,7 @@ export const evaluateRule = async <Params extends EvaluatedRuleParams = Evaluate shouldFire: result.trigger, shouldWarn: result.warn, isNoData: result.value === null, + bucketKey: result.bucketKey, }; } } diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/get_data.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/get_data.ts index 2ad725b1a8309..5fd30095afbab 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/get_data.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/get_data.ts @@ -17,10 +17,10 @@ import { getElasticsearchMetricQuery } from './metric_query'; export type GetDataResponse = Record< string, - { warn: boolean; trigger: boolean; value: number | null } + { warn: boolean; trigger: boolean; value: number | null; bucketKey: BucketKey } >; -type BucketKey = Record<string, string>; +export type BucketKey = Record<string, string>; interface AggregatedValue { value: number | null; values?: Record<string, number | null>; @@ -69,6 +69,7 @@ const NO_DATA_RESPONSE = { value: null, warn: false, trigger: false, + bucketKey: { groupBy0: UNGROUPED_FACTORY_KEY }, }, }; @@ -112,6 +113,7 @@ export const getData = async ( trigger: false, warn: false, value: null, + bucketKey: bucket.key, }; } else { const value = @@ -126,6 +128,7 @@ export const getData = async ( trigger: (shouldTrigger && shouldTrigger.value > 0) || false, warn: (shouldWarn && shouldWarn.value > 0) || false, value, + bucketKey: bucket.key, }; } } @@ -177,6 +180,7 @@ export const getData = async ( value, warn, trigger, + bucketKey: { groupBy0: UNGROUPED_FACTORY_KEY }, }, }; } @@ -185,6 +189,7 @@ export const getData = async ( value, warn: (shouldWarn && shouldWarn.value > 0) || false, trigger: (shouldTrigger && shouldTrigger.value > 0) || false, + bucketKey: { groupBy0: UNGROUPED_FACTORY_KEY }, }, }; } else { diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts index 06da4c09a8be6..45de5c1f8f4d4 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts @@ -12,11 +12,56 @@ import { createPercentileAggregation } from './create_percentile_aggregation'; import { createRateAggsBuckets, createRateAggsBucketScript } from './create_rate_aggregation'; import { wrapInCurrentPeriod } from './wrap_in_period'; -const getParsedFilterQuery: (filterQuery: string | undefined) => Record<string, any> | null = ( +const getParsedFilterQuery: (filterQuery: string | undefined) => Array<Record<string, any>> = ( filterQuery ) => { - if (!filterQuery) return null; - return JSON.parse(filterQuery); + if (!filterQuery) return []; + return [JSON.parse(filterQuery)]; +}; + +export const calculateCurrentTimeframe = ( + metricParams: MetricExpressionParams, + timeframe: { start: number; end: number } +) => ({ + ...timeframe, + start: moment(timeframe.end) + .subtract( + metricParams.aggType === Aggregators.RATE ? metricParams.timeSize * 2 : metricParams.timeSize, + metricParams.timeUnit + ) + .valueOf(), +}); + +export const createBaseFilters = ( + metricParams: MetricExpressionParams, + timeframe: { start: number; end: number }, + filterQuery?: string +) => { + const { metric } = metricParams; + const rangeFilters = [ + { + range: { + '@timestamp': { + gte: moment(timeframe.start).toISOString(), + lte: moment(timeframe.end).toISOString(), + }, + }, + }, + ]; + + const metricFieldFilters = metric + ? [ + { + exists: { + field: metric, + }, + }, + ] + : []; + + const parsedFilterQuery = getParsedFilterQuery(filterQuery); + + return [...rangeFilters, ...metricFieldFilters, ...parsedFilterQuery]; }; export const getElasticsearchMetricQuery = ( @@ -39,17 +84,7 @@ export const getElasticsearchMetricQuery = ( // We need to make a timeframe that represents the current timeframe as oppose // to the total timeframe (which includes the last period). - const currentTimeframe = { - ...timeframe, - start: moment(timeframe.end) - .subtract( - metricParams.aggType === Aggregators.RATE - ? metricParams.timeSize * 2 - : metricParams.timeSize, - metricParams.timeUnit - ) - .valueOf(), - }; + const currentTimeframe = calculateCurrentTimeframe(metricParams, timeframe); const metricAggregations = aggType === Aggregators.COUNT @@ -129,38 +164,13 @@ export const getElasticsearchMetricQuery = ( aggs.groupings.composite.after = afterKey; } - const rangeFilters = [ - { - range: { - '@timestamp': { - gte: moment(timeframe.start).toISOString(), - lte: moment(timeframe.end).toISOString(), - }, - }, - }, - ]; - - const metricFieldFilters = metric - ? [ - { - exists: { - field: metric, - }, - }, - ] - : []; - - const parsedFilterQuery = getParsedFilterQuery(filterQuery); + const baseFilters = createBaseFilters(metricParams, timeframe, filterQuery); return { track_total_hits: true, query: { bool: { - filter: [ - ...rangeFilters, - ...metricFieldFilters, - ...(parsedFilterQuery ? [parsedFilterQuery] : []), - ], + filter: baseFilters, }, }, size: 0, diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts index b345a83ab69d1..a9f8ce56c441f 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts @@ -69,7 +69,6 @@ const logger = { } as unknown as Logger; const mockOptions = { - alertId: '', executionId: '', startedAt: new Date(), previousStartedAt: null, @@ -89,11 +88,8 @@ const mockOptions = { }, }, spaceId: '', - name: '', - tags: [], - createdBy: null, - updatedBy: null, rule: { + id: '', name: '', tags: [], consumer: '', @@ -157,6 +153,7 @@ describe('The metric threshold alert type', () => { shouldFire, shouldWarn, isNoData, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -266,6 +263,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -277,6 +275,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -297,6 +296,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -308,6 +308,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -328,6 +329,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -339,6 +341,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -359,6 +362,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -370,6 +374,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -390,6 +395,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -401,6 +407,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, c: { ...baseNonCountCriterion, @@ -412,6 +419,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'c' }, }, }, ]); @@ -429,6 +437,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -440,6 +449,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, c: { ...baseNonCountCriterion, @@ -451,6 +461,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'c' }, }, }, ]); @@ -461,7 +472,9 @@ describe('The metric threshold alert type', () => { 'test.metric.1', stateResult1 ); - expect(stateResult2.missingGroups).toEqual(expect.arrayContaining(['c'])); + expect(stateResult2.missingGroups).toEqual( + expect.arrayContaining([{ key: 'c', bucketKey: { groupBy0: 'c' } }]) + ); setEvaluationResults([ { a: { @@ -474,6 +487,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -485,6 +499,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -535,6 +550,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -546,6 +562,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, c: { ...baseNonCountCriterion, @@ -557,6 +574,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'c' }, }, }, ]); @@ -579,6 +597,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -590,6 +609,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, c: { ...baseNonCountCriterion, @@ -601,6 +621,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'c' }, }, }, ]); @@ -611,7 +632,9 @@ describe('The metric threshold alert type', () => { 'test.metric.1', stateResult1 ); - expect(stateResult2.missingGroups).toEqual(expect.arrayContaining(['c'])); + expect(stateResult2.missingGroups).toEqual( + expect.arrayContaining([{ key: 'c', bucketKey: { groupBy0: 'c' } }]) + ); setEvaluationResults([ { a: { @@ -624,6 +647,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -635,6 +659,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -692,6 +717,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, { @@ -705,6 +731,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -725,6 +752,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, {}, @@ -746,6 +774,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -757,6 +786,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, { @@ -770,6 +800,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -781,6 +812,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -803,6 +835,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, { @@ -816,6 +849,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -867,6 +901,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, }, ]); @@ -884,6 +919,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, }, ]); @@ -929,6 +965,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseCountCriterion, @@ -940,6 +977,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -958,6 +996,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseCountCriterion, @@ -969,6 +1008,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1010,6 +1050,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1027,6 +1068,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1067,6 +1109,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1084,6 +1127,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1124,6 +1168,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1143,6 +1188,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1200,6 +1246,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1217,6 +1264,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1234,6 +1282,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1245,6 +1294,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1270,6 +1320,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1281,6 +1332,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1302,6 +1354,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1313,6 +1366,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, c: { ...baseNonCountCriterion, @@ -1324,6 +1378,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'c' }, }, }, ]); @@ -1344,6 +1399,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1355,6 +1411,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1405,6 +1462,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1422,6 +1480,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1439,6 +1498,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1450,6 +1510,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1473,6 +1534,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1484,6 +1546,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1563,6 +1626,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts index 14b5fe8e75614..6c3a5f2378b6f 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts @@ -26,15 +26,21 @@ import { // buildRecoveredAlertReason, stateToAlertMessage, } from '../common/messages'; -import { UNGROUPED_FACTORY_KEY, getViewInAppUrl, createScopedLogger } from '../common/utils'; -import { LINK_TO_METRICS_EXPLORER } from '../../../../common/alerting/metrics'; +import { + createScopedLogger, + getAlertDetailsUrl, + getViewInMetricsAppUrl, + UNGROUPED_FACTORY_KEY, +} from '../common/utils'; import { EvaluatedRuleParams, evaluateRule } from './lib/evaluate_rule'; +import { MissingGroupsRecord } from './lib/check_missing_group'; +import { convertStringsToMissingGroupsRecord } from './lib/convert_strings_to_missing_groups_record'; export type MetricThresholdRuleParams = Record<string, any>; export type MetricThresholdRuleTypeState = RuleTypeState & { lastRunTimestamp?: number; - missingGroups?: string[]; + missingGroups?: Array<string | MissingGroupsRecord>; groupBy?: string | string[]; filterQuery?: string; }; @@ -67,11 +73,27 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => MetricThresholdAllowedActionGroups >(async function (options) { const startTime = Date.now(); - const { services, params, state, startedAt, alertId, executionId } = options; + + const { + services, + params, + state, + startedAt, + executionId, + spaceId, + rule: { id: ruleId }, + } = options; + const { criteria } = params; if (criteria.length === 0) throw new Error('Cannot execute an alert with 0 conditions'); - const logger = createScopedLogger(libs.logger, 'metricThresholdRule', { alertId, executionId }); - const { alertWithLifecycle, savedObjectsClient } = services; + + const logger = createScopedLogger(libs.logger, 'metricThresholdRule', { + alertId: ruleId, + executionId, + }); + + const { alertWithLifecycle, savedObjectsClient, getAlertUuid } = services; + const alertFactory: MetricThresholdAlertFactory = (id, reason) => alertWithLifecycle({ id, @@ -100,15 +122,19 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => const actionGroupId = FIRED_ACTIONS.id; // Change this to an Error action group when able const reason = buildInvalidQueryAlertReason(params.filterQueryText); const alert = alertFactory(UNGROUPED_FACTORY_KEY, reason); + const alertUuid = getAlertUuid(UNGROUPED_FACTORY_KEY); + alert.scheduleActions(actionGroupId, { - group: UNGROUPED_FACTORY_KEY, + alertDetailsUrl: getAlertDetailsUrl(libs.basePath, spaceId, alertUuid), alertState: stateToAlertMessage[AlertStates.ERROR], + group: UNGROUPED_FACTORY_KEY, + metric: mapToConditionsLookup(criteria, (c) => c.metric), reason, - viewInAppUrl: getViewInAppUrl(libs.basePath, LINK_TO_METRICS_EXPLORER), timestamp, value: null, - metric: mapToConditionsLookup(criteria, (c) => c.metric), + viewInAppUrl: getViewInMetricsAppUrl(libs.basePath, spaceId), }); + return { lastRunTimestamp: startedAt.valueOf(), missingGroups: [], @@ -131,7 +157,9 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => const filterQueryIsSame = isEqual(state.filterQuery, params.filterQuery); const groupByIsSame = isEqual(state.groupBy, params.groupBy); const previousMissingGroups = - alertOnGroupDisappear && filterQueryIsSame && groupByIsSame ? state.missingGroups : []; + alertOnGroupDisappear && filterQueryIsSame && groupByIsSame && state.missingGroups + ? state.missingGroups + : []; const alertResults = await evaluateRule( services.scopedClusterClient.asCurrentUser, @@ -142,7 +170,7 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => logger, state.lastRunTimestamp, { end: startedAt.valueOf() }, - previousMissingGroups + convertStringsToMissingGroupsRecord(previousMissingGroups) ); const resultGroupSet = new Set<string>(); @@ -153,10 +181,11 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => } const groups = [...resultGroupSet]; - const nextMissingGroups = new Set<string>(); + const nextMissingGroups = new Set<MissingGroupsRecord>(); const hasGroups = !isEqual(groups, [UNGROUPED_FACTORY_KEY]); let scheduledActionsCount = 0; + // The key of `groups` is the alert instance ID. for (const group of groups) { // AND logic; all criteria must be across the threshold const shouldAlertFire = alertResults.every((result) => result[group]?.shouldFire); @@ -166,7 +195,7 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => const isNoData = alertResults.some((result) => result[group]?.isNoData); if (isNoData && group !== UNGROUPED_FACTORY_KEY) { - nextMissingGroups.add(group); + nextMissingGroups.add({ key: group, bucketKey: alertResults[0][group].bucketKey }); } const nextState = isNoData @@ -227,40 +256,45 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => ? WARNING_ACTIONS.id : FIRED_ACTIONS.id; const alert = alertFactory(`${group}`, reason); + const alertUuid = getAlertUuid(group); scheduledActionsCount++; + alert.scheduleActions(actionGroupId, { - group, + alertDetailsUrl: getAlertDetailsUrl(libs.basePath, spaceId, alertUuid), alertState: stateToAlertMessage[nextState], + group, + metric: mapToConditionsLookup(criteria, (c) => c.metric), reason, - viewInAppUrl: getViewInAppUrl(libs.basePath, LINK_TO_METRICS_EXPLORER), + threshold: mapToConditionsLookup( + alertResults, + (result) => formatAlertResult(result[group]).threshold + ), timestamp, value: mapToConditionsLookup( alertResults, (result) => formatAlertResult(result[group]).currentValue ), - threshold: mapToConditionsLookup( - alertResults, - (result) => formatAlertResult(result[group]).threshold - ), - metric: mapToConditionsLookup(criteria, (c) => c.metric), + viewInAppUrl: getViewInMetricsAppUrl(libs.basePath, spaceId), }); } } const { getRecoveredAlerts } = services.alertFactory.done(); const recoveredAlerts = getRecoveredAlerts(); + for (const alert of recoveredAlerts) { const recoveredAlertId = alert.getId(); - const viewInAppUrl = getViewInAppUrl(libs.basePath, LINK_TO_METRICS_EXPLORER); - const context = { - group: recoveredAlertId, + const alertUuid = getAlertUuid(recoveredAlertId); + + alert.setContext({ + alertDetailsUrl: getAlertDetailsUrl(libs.basePath, spaceId, alertUuid), alertState: stateToAlertMessage[AlertStates.OK], + group: recoveredAlertId, + metric: mapToConditionsLookup(criteria, (c) => c.metric), timestamp: startedAt.toISOString(), - viewInAppUrl, threshold: mapToConditionsLookup(criteria, (c) => c.threshold), - metric: mapToConditionsLookup(criteria, (c) => c.metric), - }; - alert.setContext(context); + viewInAppUrl: getViewInMetricsAppUrl(libs.basePath, spaceId), + }); } const stopTime = Date.now(); diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts index 0ebb427819f74..6538fb25b6c8c 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts @@ -13,6 +13,7 @@ import { Comparator, METRIC_THRESHOLD_ALERT_TYPE_ID } from '../../../../common/a import { METRIC_EXPLORER_AGGREGATIONS } from '../../../../common/http_api'; import { InfraBackendLibs } from '../../infra_types'; import { + alertDetailUrlActionVariableDescription, alertStateActionVariableDescription, groupActionVariableDescription, metricActionVariableDescription, @@ -22,7 +23,11 @@ import { valueActionVariableDescription, viewInAppUrlActionVariableDescription, } from '../common/messages'; -import { oneOfLiterals, validateIsStringElasticsearchJSONFilter } from '../common/utils'; +import { + getAlertDetailsPageEnabledForApp, + oneOfLiterals, + validateIsStringElasticsearchJSONFilter, +} from '../common/utils'; import { createMetricThresholdExecutor, FIRED_ACTIONS, @@ -41,6 +46,8 @@ export async function registerMetricThresholdRuleType( alertingPlugin: PluginSetupContract, libs: InfraBackendLibs ) { + const config = libs.getAlertDetailsConfig(); + const baseCriterion = { threshold: schema.arrayOf(schema.number()), comparator: oneOfLiterals(Object.values(Comparator)), @@ -93,6 +100,9 @@ export async function registerMetricThresholdRuleType( actionVariables: { context: [ { name: 'group', description: groupActionVariableDescription }, + ...(getAlertDetailsPageEnabledForApp(config, 'metrics') + ? [{ name: 'alertDetailsUrl', description: alertDetailUrlActionVariableDescription }] + : []), { name: 'alertState', description: alertStateActionVariableDescription }, { name: 'reason', description: reasonActionVariableDescription }, { name: 'timestamp', description: timestampActionVariableDescription }, diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts index 37e59700b0488..3d3c7a17cd1dd 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts @@ -4,10 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import * as utils from '../common/utils'; -jest - .spyOn(utils, 'getViewInAppUrl') - .mockReturnValue('http://localhost:5601/eyg/app/metrics/explorer'); const bucketsA = (from: number) => [ { diff --git a/x-pack/plugins/infra/server/lib/infra_types.ts b/x-pack/plugins/infra/server/lib/infra_types.ts index a4636daa7986e..4801fb49651f6 100644 --- a/x-pack/plugins/infra/server/lib/infra_types.ts +++ b/x-pack/plugins/infra/server/lib/infra_types.ts @@ -8,6 +8,7 @@ import { Logger } from '@kbn/logging'; import type { IBasePath } from '@kbn/core/server'; import { handleEsError } from '@kbn/es-ui-shared-plugin/server'; +import { ObservabilityConfig } from '@kbn/observability-plugin/server'; import { RulesServiceSetup } from '../services/rules'; import { InfraConfig, InfraPluginStartServicesAccessor } from '../types'; import { KibanaFramework } from './adapters/framework/kibana_framework_adapter'; @@ -24,14 +25,15 @@ export interface InfraDomainLibs { } export interface InfraBackendLibs extends InfraDomainLibs { + basePath: IBasePath; configuration: InfraConfig; framework: KibanaFramework; - sources: InfraSources; - sourceStatus: InfraSourceStatus; - handleEsError: typeof handleEsError; logsRules: RulesServiceSetup; metricsRules: RulesServiceSetup; + sources: InfraSources; + sourceStatus: InfraSourceStatus; + getAlertDetailsConfig: () => ObservabilityConfig['unsafe']['alertDetails']; getStartServices: InfraPluginStartServicesAccessor; + handleEsError: typeof handleEsError; logger: Logger; - basePath: IBasePath; } diff --git a/x-pack/plugins/infra/server/plugin.ts b/x-pack/plugins/infra/server/plugin.ts index bfd7113ec4dc0..a7fa9ceacd3c9 100644 --- a/x-pack/plugins/infra/server/plugin.ts +++ b/x-pack/plugins/infra/server/plugin.ts @@ -170,6 +170,7 @@ export class InfraServerPlugin logsRules: this.logsRules.setup(core, plugins), metricsRules: this.metricsRules.setup(core, plugins), getStartServices: () => core.getStartServices(), + getAlertDetailsConfig: () => plugins.observability.getAlertDetailsConfig(), logger: this.logger, basePath: core.http.basePath, }; diff --git a/x-pack/plugins/infra/server/services/log_views/log_views_client.test.ts b/x-pack/plugins/infra/server/services/log_views/log_views_client.test.ts index 7b1debf981f8c..e517ae8aef7f0 100644 --- a/x-pack/plugins/infra/server/services/log_views/log_views_client.test.ts +++ b/x-pack/plugins/infra/server/services/log_views/log_views_client.test.ts @@ -239,7 +239,7 @@ describe('LogViewsClient class', () => { }) ); - const resolvedLogView = await logViewsClient.resolveLogView({ + const resolvedLogView = await logViewsClient.resolveLogView('log-view-id', { name: 'LOG VIEW', description: 'LOG VIEW DESCRIPTION', logIndices: { @@ -280,6 +280,64 @@ describe('LogViewsClient class', () => { }, }, ], + "dataViewReference": DataView { + "allowNoIndex": false, + "deleteFieldFormat": [Function], + "fieldAttrs": Object {}, + "fieldFormatMap": Object {}, + "fieldFormats": Object { + "deserialize": [MockFunction], + "getByFieldType": [MockFunction], + "getDefaultConfig": [MockFunction], + "getDefaultInstance": [MockFunction], + "getDefaultInstanceCacheResolver": [MockFunction], + "getDefaultInstancePlain": [MockFunction], + "getDefaultType": [MockFunction], + "getDefaultTypeName": [MockFunction], + "getInstance": [MockFunction], + "getType": [MockFunction], + "getTypeNameByEsTypes": [MockFunction], + "getTypeWithoutMetaParams": [MockFunction], + "has": [MockFunction], + "init": [MockFunction], + "parseDefaultTypeMap": [MockFunction], + "register": [MockFunction], + }, + "fields": FldList [], + "flattenHit": [Function], + "getFieldAttrs": [Function], + "getIndexPattern": [Function], + "getName": [Function], + "getOriginalSavedObjectBody": [Function], + "id": "LOG_DATA_VIEW", + "matchedIndices": Array [], + "metaFields": Array [ + "_id", + "_type", + "_source", + ], + "name": "", + "namespaces": Array [], + "originalSavedObjectBody": Object {}, + "resetOriginalSavedObjectBody": [Function], + "runtimeFieldMap": Object { + "runtime_field": Object { + "script": Object { + "source": "emit(\\"runtime value\\")", + }, + "type": "keyword", + }, + }, + "setFieldFormat": [Function], + "setIndexPattern": [Function], + "shortDotsEnable": false, + "sourceFilters": Array [], + "timeFieldName": "@timestamp", + "title": "log-indices-*", + "type": undefined, + "typeMeta": undefined, + "version": "1", + }, "description": "LOG VIEW DESCRIPTION", "fields": FldList [], "indices": "log-indices-*", diff --git a/x-pack/plugins/infra/server/services/log_views/log_views_client.ts b/x-pack/plugins/infra/server/services/log_views/log_views_client.ts index 57c90235452ba..9f43cee871f73 100644 --- a/x-pack/plugins/infra/server/services/log_views/log_views_client.ts +++ b/x-pack/plugins/infra/server/services/log_views/log_views_client.ts @@ -67,7 +67,7 @@ export class LogViewsClient implements ILogViewsClient { public async getResolvedLogView(logViewId: string): Promise<ResolvedLogView> { const logView = await this.getLogView(logViewId); - const resolvedLogView = await this.resolveLogView(logView.attributes); + const resolvedLogView = await this.resolveLogView(logView.id, logView.attributes); return resolvedLogView; } @@ -98,8 +98,11 @@ export class LogViewsClient implements ILogViewsClient { return getLogViewFromSavedObject(savedObject); } - public async resolveLogView(logViewAttributes: LogViewAttributes): Promise<ResolvedLogView> { - return await resolveLogView(logViewAttributes, await this.dataViews, this.config); + public async resolveLogView( + logViewId: string, + logViewAttributes: LogViewAttributes + ): Promise<ResolvedLogView> { + return await resolveLogView(logViewId, logViewAttributes, await this.dataViews, this.config); } private async getSavedLogView(logViewId: string): Promise<LogView> { diff --git a/x-pack/plugins/infra/server/services/log_views/types.ts b/x-pack/plugins/infra/server/services/log_views/types.ts index 4146b6e2fd7e3..c10bd2002163d 100644 --- a/x-pack/plugins/infra/server/services/log_views/types.ts +++ b/x-pack/plugins/infra/server/services/log_views/types.ts @@ -46,5 +46,5 @@ export interface ILogViewsClient { getLogView(logViewId: string): Promise<LogView>; getResolvedLogView(logViewId: string): Promise<ResolvedLogView>; putLogView(logViewId: string, logViewAttributes: Partial<LogViewAttributes>): Promise<LogView>; - resolveLogView(logViewAttributes: LogViewAttributes): Promise<ResolvedLogView>; + resolveLogView(logViewId: string, logViewAttributes: LogViewAttributes): Promise<ResolvedLogView>; } diff --git a/x-pack/plugins/infra/tsconfig.json b/x-pack/plugins/infra/tsconfig.json index 370644367b441..c092210c7ba68 100644 --- a/x-pack/plugins/infra/tsconfig.json +++ b/x-pack/plugins/infra/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "../../../typings/**/*", @@ -14,7 +13,7 @@ "server/**/*", "types/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/data_views/tsconfig.json" }, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.test.tsx index c5daa1db2ac07..9e31c71e0f275 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.test.tsx @@ -39,7 +39,7 @@ describe('Pipeline Editor', () => { let testBed: SetupResult; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/append.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/append.test.tsx index f35e05b800f14..632dc824dbd1a 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/append.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/append.test.tsx @@ -17,7 +17,7 @@ describe('Processor: Append', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx index d4ac176d6aaf5..44acef642caa5 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx @@ -16,7 +16,7 @@ describe('Processor: Bytes', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/circle.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/circle.test.tsx index 00153471ea65e..01b25bc508bcc 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/circle.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/circle.test.tsx @@ -16,7 +16,7 @@ describe('Processor: Circle', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/common_processor_fields.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/common_processor_fields.test.tsx index ebffd5adf78c1..45781e15eca59 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/common_processor_fields.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/common_processor_fields.test.tsx @@ -16,7 +16,7 @@ describe('Processor: Common Fields For All Processors', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/community_id.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/community_id.test.tsx index e571474576ff2..4ed8ff5b05285 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/community_id.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/community_id.test.tsx @@ -16,7 +16,7 @@ describe('Processor: Community id', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/convert.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/convert.test.tsx index 3090e59b32e0b..d328bb6759b2f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/convert.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/convert.test.tsx @@ -26,7 +26,7 @@ describe('Processor: Convert', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/csv.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/csv.test.tsx index 6414976b56f9a..c3237c1d23259 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/csv.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/csv.test.tsx @@ -29,7 +29,7 @@ describe('Processor: CSV', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date.test.tsx index 22666ebbe2a98..fa1edd6d6cb51 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date.test.tsx @@ -16,7 +16,7 @@ describe('Processor: Date', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date_index.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date_index.test.tsx index b9e990f36c15b..74a49b11821ee 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date_index.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date_index.test.tsx @@ -16,7 +16,7 @@ describe('Processor: Date Index Name', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx index 7ebad2de01a92..c95a254870418 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx @@ -16,7 +16,7 @@ describe('Processor: Dot Expander', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fail.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fail.test.tsx index 9b8148bd0dffd..94a7bc65e65cc 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fail.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fail.test.tsx @@ -15,7 +15,7 @@ describe('Processor: Fail', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fingerprint.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fingerprint.test.tsx index 49d7937fab002..b5b5fa9c9e1d3 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fingerprint.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fingerprint.test.tsx @@ -28,7 +28,7 @@ describe('Processor: Fingerprint', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts index 90ea4ed1a0105..89efc203c0c53 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts @@ -17,7 +17,7 @@ describe('Processor: Grok', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); // disable all react-beautiful-dnd development warnings (window as any)['__react-beautiful-dnd-disable-dev-warnings'] = true; }); diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/network_direction.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/network_direction.test.tsx index 4f92aec06efd3..330b651b5b515 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/network_direction.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/network_direction.test.tsx @@ -30,7 +30,7 @@ describe('Processor: Network Direction', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor_form.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor_form.test.tsx index b2e2fb81f2c86..1b89dbe835a96 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor_form.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor_form.test.tsx @@ -14,7 +14,7 @@ describe('Processor: Bytes', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/registered_domain.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/registered_domain.test.tsx index dcf332912a94b..b4fafe6a47572 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/registered_domain.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/registered_domain.test.tsx @@ -24,7 +24,7 @@ describe('Processor: Registered Domain', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/set.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/set.test.tsx index ebfa678648904..d90c34ee10c8a 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/set.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/set.test.tsx @@ -16,7 +16,7 @@ describe('Processor: Set', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/uri_parts.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/uri_parts.test.tsx index 9062fcc02f7f8..e59dba0aecddf 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/uri_parts.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/uri_parts.test.tsx @@ -22,7 +22,7 @@ describe('Processor: URI parts', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/user_agent.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/user_agent.test.tsx index ed778aa1cc1f3..e2e083715c88e 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/user_agent.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/user_agent.test.tsx @@ -27,7 +27,7 @@ describe('Processor: User Agent', () => { const { httpSetup } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx index b15172185cff2..5bd7d1d30aea5 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx @@ -46,7 +46,7 @@ describe('Test pipeline', () => { }; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/ingest_pipelines/tsconfig.json b/x-pack/plugins/ingest_pipelines/tsconfig.json index 0bb8031adcf77..27d9c33354bae 100644 --- a/x-pack/plugins/ingest_pipelines/tsconfig.json +++ b/x-pack/plugins/ingest_pipelines/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -13,7 +12,7 @@ "__jest__/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../licensing/tsconfig.json" }, { "path": "../features/tsconfig.json" }, diff --git a/x-pack/plugins/kubernetes_security/tsconfig.json b/x-pack/plugins/kubernetes_security/tsconfig.json index b941be57d72ae..3358602dde0bb 100644 --- a/x-pack/plugins/kubernetes_security/tsconfig.json +++ b/x-pack/plugins/kubernetes_security/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ // add all the folders containg files to be compiled @@ -17,7 +16,7 @@ "storybook/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, // add references to other TypeScript projects the plugin depends on diff --git a/x-pack/plugins/lens/common/expressions/collapse/index.ts b/x-pack/plugins/lens/common/expressions/collapse/index.ts index 43874859411fc..2b1e89af08bd4 100644 --- a/x-pack/plugins/lens/common/expressions/collapse/index.ts +++ b/x-pack/plugins/lens/common/expressions/collapse/index.ts @@ -16,6 +16,8 @@ export interface CollapseArgs { fn: CollapseFunction[]; } +export type { CollapseExpressionFunction }; + /** * Collapses multiple rows into a single row using the specified function. * diff --git a/x-pack/plugins/lens/common/expressions/datatable/datatable_column.ts b/x-pack/plugins/lens/common/expressions/datatable/datatable_column.ts index f955cc1dfa2cb..16e76d3baf2e4 100644 --- a/x-pack/plugins/lens/common/expressions/datatable/datatable_column.ts +++ b/x-pack/plugins/lens/common/expressions/datatable/datatable_column.ts @@ -48,13 +48,14 @@ export interface ColumnState { } export type DatatableColumnResult = ColumnState & { type: 'lens_datatable_column' }; - -export const datatableColumn: ExpressionFunctionDefinition< +export type DatatableColumnFunction = ExpressionFunctionDefinition< 'lens_datatable_column', null, ColumnState & { sortingHint?: SortingHint }, DatatableColumnResult -> = { +>; + +export const datatableColumn: DatatableColumnFunction = { name: 'lens_datatable_column', aliases: [], type: 'lens_datatable_column', diff --git a/x-pack/plugins/lens/common/expressions/datatable/index.ts b/x-pack/plugins/lens/common/expressions/datatable/index.ts index 2fa0312360297..7003fd8d486b8 100644 --- a/x-pack/plugins/lens/common/expressions/datatable/index.ts +++ b/x-pack/plugins/lens/common/expressions/datatable/index.ts @@ -8,4 +8,4 @@ export * from './datatable_column'; export * from './datatable'; -export type { DatatableProps } from './types'; +export type { DatatableProps, DatatableExpressionFunction } from './types'; diff --git a/x-pack/plugins/lens/common/types.ts b/x-pack/plugins/lens/common/types.ts index 9056e58eef1eb..3bf19d4d78b5c 100644 --- a/x-pack/plugins/lens/common/types.ts +++ b/x-pack/plugins/lens/common/types.ts @@ -20,11 +20,6 @@ export type { OriginalColumn } from './expressions/map_to_columns'; export type FormatFactory = (mapping?: SerializedFieldFormat) => IFieldFormat; -export interface ExistingFields { - indexPatternTitle: string; - existingFieldNames: string[]; -} - export interface DateRange { fromDate: string; toDate: string; @@ -85,6 +80,7 @@ export interface PieVisualizationState { palette?: PaletteOutput; } export interface LegacyMetricState { + autoScaleMetricAlignment?: 'left' | 'right' | 'center'; layerId: string; accessor?: string; layerType: LayerType; diff --git a/x-pack/plugins/lens/kibana.json b/x-pack/plugins/lens/kibana.json index 5f0b48608dab0..56e1970cc764b 100644 --- a/x-pack/plugins/lens/kibana.json +++ b/x-pack/plugins/lens/kibana.json @@ -31,6 +31,8 @@ "unifiedFieldList" ], "optionalPlugins": [ + "expressionLegacyMetricVis", + "expressionPartitionVis", "usageCollection", "taskManager", "globalSearch", @@ -51,7 +53,7 @@ ], "owner": { "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "githubTeam": "kibana-visualizations" }, "description": "Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana." } diff --git a/x-pack/plugins/lens/public/data_views_service/loader.test.ts b/x-pack/plugins/lens/public/data_views_service/loader.test.ts index 97ded75233cda..e7e2bab166a70 100644 --- a/x-pack/plugins/lens/public/data_views_service/loader.test.ts +++ b/x-pack/plugins/lens/public/data_views_service/loader.test.ts @@ -5,22 +5,10 @@ * 2.0. */ -import { DataViewsContract, DataViewSpec, FieldSpec } from '@kbn/data-views-plugin/public'; -import { IndexPattern, IndexPatternField } from '../types'; -import { - ensureIndexPattern, - loadIndexPatternRefs, - loadIndexPatterns, - syncExistingFields, -} from './loader'; +import { DataViewsContract } from '@kbn/data-views-plugin/public'; +import { ensureIndexPattern, loadIndexPatternRefs, loadIndexPatterns } from './loader'; import { sampleIndexPatterns, mockDataViewsService } from './mocks'; import { documentField } from '../datasources/form_based/document_field'; -import { coreMock } from '@kbn/core/public/mocks'; -import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; -import type { DataView } from '@kbn/data-views-plugin/public'; -import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; -import { UI_SETTINGS } from '@kbn/data-plugin/public'; -import { createHttpFetchError } from '@kbn/core-http-browser-mocks'; describe('loader', () => { describe('loadIndexPatternRefs', () => { @@ -266,218 +254,4 @@ describe('loader', () => { expect(onError).not.toHaveBeenCalled(); }); }); - - describe('syncExistingFields', () => { - const core = coreMock.createStart(); - const dataViews = dataViewPluginMocks.createStartContract(); - const data = dataPluginMock.createStartContract(); - - const dslQuery = { - bool: { - must: [], - filter: [{ match_all: {} }], - should: [], - must_not: [], - }, - }; - - function getIndexPatternList() { - return [ - { - id: '1', - title: '1', - fields: [{ name: 'ip1_field_1' }, { name: 'ip1_field_2' }], - hasRestrictions: false, - }, - { - id: '2', - title: '2', - fields: [{ name: 'ip2_field_1' }, { name: 'ip2_field_2' }], - hasRestrictions: false, - }, - { - id: '3', - title: '3', - fields: [{ name: 'ip3_field_1' }, { name: 'ip3_field_2' }], - hasRestrictions: false, - }, - ] as unknown as IndexPattern[]; - } - - beforeEach(() => { - core.uiSettings.get.mockImplementation((key: string) => { - if (key === UI_SETTINGS.META_FIELDS) { - return []; - } - }); - dataViews.get.mockImplementation((id: string) => - Promise.resolve( - getIndexPatternList().find( - (indexPattern) => indexPattern.id === id - ) as unknown as DataView - ) - ); - }); - - it('should call once for each index pattern', async () => { - const updateIndexPatterns = jest.fn(); - dataViews.getFieldsForIndexPattern.mockImplementation( - (dataView: DataViewSpec | DataView) => - Promise.resolve(dataView.fields) as Promise<FieldSpec[]> - ); - - await syncExistingFields({ - dateRange: { fromDate: '1900-01-01', toDate: '2000-01-01' }, - indexPatternList: getIndexPatternList(), - updateIndexPatterns, - dslQuery, - onNoData: jest.fn(), - currentIndexPatternTitle: 'abc', - isFirstExistenceFetch: false, - existingFields: {}, - core, - data, - dataViews, - }); - - expect(dataViews.get).toHaveBeenCalledTimes(3); - expect(dataViews.getFieldsForIndexPattern).toHaveBeenCalledTimes(3); - expect(updateIndexPatterns).toHaveBeenCalledTimes(1); - - const [newState, options] = updateIndexPatterns.mock.calls[0]; - expect(options).toEqual({ applyImmediately: true }); - - expect(newState).toEqual({ - isFirstExistenceFetch: false, - existingFields: { - '1': { ip1_field_1: true, ip1_field_2: true }, - '2': { ip2_field_1: true, ip2_field_2: true }, - '3': { ip3_field_1: true, ip3_field_2: true }, - }, - }); - }); - - it('should call onNoData callback if current index pattern returns no fields', async () => { - const updateIndexPatterns = jest.fn(); - const onNoData = jest.fn(); - dataViews.getFieldsForIndexPattern.mockImplementation( - async (dataView: DataViewSpec | DataView) => { - return (dataView.title === '1' - ? [{ name: `${dataView.title}_field_1` }, { name: `${dataView.title}_field_2` }] - : []) as unknown as Promise<FieldSpec[]>; - } - ); - - const args = { - dateRange: { fromDate: '1900-01-01', toDate: '2000-01-01' }, - indexPatternList: getIndexPatternList(), - updateIndexPatterns, - dslQuery, - onNoData, - currentIndexPatternTitle: 'abc', - isFirstExistenceFetch: false, - existingFields: {}, - core, - data, - dataViews, - }; - - await syncExistingFields(args); - - expect(onNoData).not.toHaveBeenCalled(); - - await syncExistingFields({ ...args, isFirstExistenceFetch: true }); - expect(onNoData).not.toHaveBeenCalled(); - }); - - it('should set all fields to available and existence error flag if the request fails', async () => { - const updateIndexPatterns = jest.fn(); - dataViews.getFieldsForIndexPattern.mockImplementation(() => { - return new Promise((_, reject) => { - reject(new Error()); - }); - }); - - const args = { - dateRange: { fromDate: '1900-01-01', toDate: '2000-01-01' }, - indexPatternList: [ - { - id: '1', - title: '1', - hasRestrictions: false, - fields: [{ name: 'field1' }, { name: 'field2' }] as IndexPatternField[], - }, - ] as IndexPattern[], - updateIndexPatterns, - dslQuery, - onNoData: jest.fn(), - currentIndexPatternTitle: 'abc', - isFirstExistenceFetch: false, - existingFields: {}, - core, - data, - dataViews, - }; - - await syncExistingFields(args); - - const [newState, options] = updateIndexPatterns.mock.calls[0]; - expect(options).toEqual({ applyImmediately: true }); - - expect(newState.existenceFetchFailed).toEqual(true); - expect(newState.existenceFetchTimeout).toEqual(false); - expect(newState.existingFields['1']).toEqual({ - field1: true, - field2: true, - }); - }); - - it('should set all fields to available and existence error flag if the request times out', async () => { - const updateIndexPatterns = jest.fn(); - dataViews.getFieldsForIndexPattern.mockImplementation(() => { - return new Promise((_, reject) => { - const error = createHttpFetchError( - 'timeout', - 'error', - {} as Request, - { status: 408 } as Response - ); - reject(error); - }); - }); - - const args = { - dateRange: { fromDate: '1900-01-01', toDate: '2000-01-01' }, - indexPatternList: [ - { - id: '1', - title: '1', - hasRestrictions: false, - fields: [{ name: 'field1' }, { name: 'field2' }] as IndexPatternField[], - }, - ] as IndexPattern[], - updateIndexPatterns, - dslQuery, - onNoData: jest.fn(), - currentIndexPatternTitle: 'abc', - isFirstExistenceFetch: false, - existingFields: {}, - core, - data, - dataViews, - }; - - await syncExistingFields(args); - - const [newState, options] = updateIndexPatterns.mock.calls[0]; - expect(options).toEqual({ applyImmediately: true }); - - expect(newState.existenceFetchFailed).toEqual(false); - expect(newState.existenceFetchTimeout).toEqual(true); - expect(newState.existingFields['1']).toEqual({ - field1: true, - field2: true, - }); - }); - }); }); diff --git a/x-pack/plugins/lens/public/data_views_service/loader.ts b/x-pack/plugins/lens/public/data_views_service/loader.ts index f0184d0a11d0b..f33ba8f3d37a9 100644 --- a/x-pack/plugins/lens/public/data_views_service/loader.ts +++ b/x-pack/plugins/lens/public/data_views_service/loader.ts @@ -8,13 +8,8 @@ import { isNestedField } from '@kbn/data-views-plugin/common'; import type { DataViewsContract, DataView, DataViewSpec } from '@kbn/data-views-plugin/public'; import { keyBy } from 'lodash'; -import { CoreStart } from '@kbn/core/public'; -import { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import { loadFieldExisting } from '@kbn/unified-field-list-plugin/public'; import { IndexPattern, IndexPatternField, IndexPatternMap, IndexPatternRef } from '../types'; import { documentField } from '../datasources/form_based/document_field'; -import { DateRange } from '../../common'; -import { DataViewsState } from '../state_management'; type ErrorHandler = (err: Error) => void; type MinimalDataViewsContract = Pick<DataViewsContract, 'get' | 'getIdsWithTitle' | 'create'>; @@ -247,120 +242,3 @@ export async function ensureIndexPattern({ }; return newIndexPatterns; } - -async function refreshExistingFields({ - dateRange, - indexPatternList, - dslQuery, - core, - data, - dataViews, -}: { - dateRange: DateRange; - indexPatternList: IndexPattern[]; - dslQuery: object; - core: Pick<CoreStart, 'http' | 'notifications' | 'uiSettings'>; - data: DataPublicPluginStart; - dataViews: DataViewsContract; -}) { - try { - const emptinessInfo = await Promise.all( - indexPatternList.map(async (pattern) => { - if (pattern.hasRestrictions) { - return { - indexPatternTitle: pattern.title, - existingFieldNames: pattern.fields.map((field) => field.name), - }; - } - - const dataView = await dataViews.get(pattern.id); - return await loadFieldExisting({ - dslQuery, - fromDate: dateRange.fromDate, - toDate: dateRange.toDate, - timeFieldName: pattern.timeFieldName, - data, - uiSettingsClient: core.uiSettings, - dataViewsService: dataViews, - dataView, - }); - }) - ); - return { result: emptinessInfo, status: 200 }; - } catch (e) { - return { result: undefined, status: e.res?.status as number }; - } -} - -type FieldsPropsFromDataViewsState = Pick< - DataViewsState, - 'existingFields' | 'isFirstExistenceFetch' | 'existenceFetchTimeout' | 'existenceFetchFailed' ->; -export async function syncExistingFields({ - updateIndexPatterns, - isFirstExistenceFetch, - currentIndexPatternTitle, - onNoData, - existingFields, - ...requestOptions -}: { - dateRange: DateRange; - indexPatternList: IndexPattern[]; - existingFields: Record<string, Record<string, boolean>>; - updateIndexPatterns: ( - newFieldState: FieldsPropsFromDataViewsState, - options: { applyImmediately: boolean } - ) => void; - isFirstExistenceFetch: boolean; - currentIndexPatternTitle: string; - dslQuery: object; - onNoData?: () => void; - core: Pick<CoreStart, 'http' | 'notifications' | 'uiSettings'>; - data: DataPublicPluginStart; - dataViews: DataViewsContract; -}) { - const { indexPatternList } = requestOptions; - const newExistingFields = { ...existingFields }; - - const { result, status } = await refreshExistingFields(requestOptions); - - if (result) { - if (isFirstExistenceFetch) { - const fieldsCurrentIndexPattern = result.find( - (info) => info.indexPatternTitle === currentIndexPatternTitle - ); - if (fieldsCurrentIndexPattern && fieldsCurrentIndexPattern.existingFieldNames.length === 0) { - onNoData?.(); - } - } - - for (const { indexPatternTitle, existingFieldNames } of result) { - newExistingFields[indexPatternTitle] = booleanMap(existingFieldNames); - } - } else { - for (const { title, fields } of indexPatternList) { - newExistingFields[title] = booleanMap(fields.map((field) => field.name)); - } - } - - updateIndexPatterns( - { - existingFields: newExistingFields, - ...(result - ? { isFirstExistenceFetch: status !== 200 } - : { - isFirstExistenceFetch, - existenceFetchFailed: status !== 408, - existenceFetchTimeout: status === 408, - }), - }, - { applyImmediately: true } - ); -} - -function booleanMap(keys: string[]) { - return keys.reduce((acc, key) => { - acc[key] = true; - return acc; - }, {} as Record<string, boolean>); -} diff --git a/x-pack/plugins/lens/public/data_views_service/mocks.ts b/x-pack/plugins/lens/public/data_views_service/mocks.ts index ed8d6e86e58a4..b4acacbe98b73 100644 --- a/x-pack/plugins/lens/public/data_views_service/mocks.ts +++ b/x-pack/plugins/lens/public/data_views_service/mocks.ts @@ -12,7 +12,7 @@ import { createMockedRestrictedIndexPattern, } from '../datasources/form_based/mocks'; import { DataViewsState } from '../state_management'; -import { ExistingFieldsMap, IndexPattern } from '../types'; +import { IndexPattern } from '../types'; import { getFieldByNameFactory } from './loader'; /** @@ -22,25 +22,13 @@ import { getFieldByNameFactory } from './loader'; export const createMockDataViewsState = ({ indexPatterns, indexPatternRefs, - isFirstExistenceFetch, - existingFields, }: Partial<DataViewsState> = {}): DataViewsState => { const refs = indexPatternRefs ?? Object.values(indexPatterns ?? {}).map(({ id, title, name }) => ({ id, title, name })); - const allFields = - existingFields ?? - refs.reduce((acc, { id, title }) => { - if (indexPatterns && id in indexPatterns) { - acc[title] = Object.fromEntries(indexPatterns[id].fields.map((f) => [f.displayName, true])); - } - return acc; - }, {} as ExistingFieldsMap); return { indexPatterns: indexPatterns ?? {}, indexPatternRefs: refs, - isFirstExistenceFetch: Boolean(isFirstExistenceFetch), - existingFields: allFields, }; }; diff --git a/x-pack/plugins/lens/public/data_views_service/service.ts b/x-pack/plugins/lens/public/data_views_service/service.ts index 28a0d82799992..5192de1d2385e 100644 --- a/x-pack/plugins/lens/public/data_views_service/service.ts +++ b/x-pack/plugins/lens/public/data_views_service/service.ts @@ -14,14 +14,8 @@ import { UPDATE_FILTER_REFERENCES_ACTION, UPDATE_FILTER_REFERENCES_TRIGGER, } from '@kbn/unified-search-plugin/public'; -import type { DateRange } from '../../common'; import type { IndexPattern, IndexPatternMap, IndexPatternRef } from '../types'; -import { - ensureIndexPattern, - loadIndexPatternRefs, - loadIndexPatterns, - syncExistingFields, -} from './loader'; +import { ensureIndexPattern, loadIndexPatternRefs, loadIndexPatterns } from './loader'; import type { DataViewsState } from '../state_management'; import { generateId } from '../id_generator'; @@ -71,18 +65,6 @@ export interface IndexPatternServiceAPI { id: string; cache: IndexPatternMap; }) => Promise<IndexPatternMap | undefined>; - /** - * Loads the existingFields map given the current context - */ - refreshExistingFields: (args: { - dateRange: DateRange; - currentIndexPatternTitle: string; - dslQuery: object; - onNoData?: () => void; - existingFields: Record<string, Record<string, boolean>>; - indexPatternList: IndexPattern[]; - isFirstExistenceFetch: boolean; - }) => Promise<void>; replaceDataViewId: (newDataView: DataView) => Promise<void>; /** @@ -150,14 +132,6 @@ export function createIndexPatternService({ }, ensureIndexPattern: (args) => ensureIndexPattern({ onError: onChangeError, dataViews, ...args }), - refreshExistingFields: (args) => - syncExistingFields({ - updateIndexPatterns, - ...args, - data, - dataViews, - core, - }), loadIndexPatternRefs: async ({ isFullEditor }) => isFullEditor ? loadIndexPatternRefs(dataViews) : [], getDefaultIndex: () => core.uiSettings.get('defaultIndex'), diff --git a/x-pack/plugins/lens/public/datasources/form_based/__mocks__/loader.ts b/x-pack/plugins/lens/public/datasources/form_based/__mocks__/loader.ts index 47af8d816b73f..7ad4172ce3829 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/__mocks__/loader.ts +++ b/x-pack/plugins/lens/public/datasources/form_based/__mocks__/loader.ts @@ -28,11 +28,9 @@ export function loadInitialDataViews() { const restricted = createMockedRestrictedIndexPattern(); return { indexPatternRefs: [], - existingFields: {}, indexPatterns: { [indexPattern.id]: indexPattern, [restricted.id]: restricted, }, - isFirstExistenceFetch: false, }; } diff --git a/x-pack/plugins/lens/public/datasources/form_based/datapanel.scss b/x-pack/plugins/lens/public/datasources/form_based/datapanel.scss index ef68c784100e4..32887d3f9350d 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/datapanel.scss +++ b/x-pack/plugins/lens/public/datasources/form_based/datapanel.scss @@ -14,15 +14,6 @@ margin-bottom: $euiSizeS; } -.lnsInnerIndexPatternDataPanel__titleTooltip { - margin-right: $euiSizeXS; -} - -.lnsInnerIndexPatternDataPanel__fieldItems { - // Quick fix for making sure the shadow and focus rings are visible outside the accordion bounds - padding: $euiSizeXS; -} - .lnsInnerIndexPatternDataPanel__textField { @include euiFormControlLayoutPadding(1, 'right'); @include euiFormControlLayoutPadding(1, 'left'); @@ -60,4 +51,4 @@ .lnsFilterButton .euiFilterButton__textShift { min-width: 0; -} \ No newline at end of file +} diff --git a/x-pack/plugins/lens/public/datasources/form_based/datapanel.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/datapanel.test.tsx index e7b0cd6d457a9..6639484ca6be4 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/datapanel.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/datapanel.test.tsx @@ -13,15 +13,16 @@ import { dataViewPluginMocks, Start as DataViewPublicStart, } from '@kbn/data-views-plugin/public/mocks'; -import { InnerFormBasedDataPanel, FormBasedDataPanel, Props } from './datapanel'; -import { FieldList } from './field_list'; +import { InnerFormBasedDataPanel, FormBasedDataPanel } from './datapanel'; +import { FieldListGrouped } from '@kbn/unified-field-list-plugin/public'; +import * as UseExistingFieldsApi from '@kbn/unified-field-list-plugin/public/hooks/use_existing_fields'; +import * as ExistingFieldsServiceApi from '@kbn/unified-field-list-plugin/public/services/field_existing/load_field_existing'; import { FieldItem } from './field_item'; -import { NoFieldsCallout } from './no_fields_callout'; import { act } from 'react-dom/test-utils'; import { coreMock } from '@kbn/core/public/mocks'; import { FormBasedPrivateState } from './types'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; -import { EuiProgress, EuiLoadingSpinner } from '@elastic/eui'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; +import { EuiCallOut, EuiLoadingSpinner, EuiProgress } from '@elastic/eui'; import { documentField } from './document_field'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { fieldFormatsServiceMock } from '@kbn/field-formats-plugin/public/mocks'; @@ -33,10 +34,9 @@ import { DOCUMENT_FIELD_NAME } from '../../../common'; import { createIndexPatternServiceMock } from '../../mocks/data_views_service_mock'; import { createMockFramePublicAPI } from '../../mocks'; import { DataViewsState } from '../../state_management'; -import { ExistingFieldsMap, FramePublicAPI, IndexPattern } from '../../types'; -import { IndexPatternServiceProps } from '../../data_views_service/service'; -import { FieldSpec, DataView } from '@kbn/data-views-plugin/public'; +import { DataView } from '@kbn/data-views-plugin/public'; import { UI_SETTINGS } from '@kbn/data-plugin/public'; +import { ReactWrapper } from 'enzyme'; const fieldsOne = [ { @@ -162,17 +162,12 @@ const fieldsThree = [ documentField, ]; -function getExistingFields(indexPatterns: Record<string, IndexPattern>) { - const existingFields: ExistingFieldsMap = {}; - for (const { title, fields } of Object.values(indexPatterns)) { - const fieldsMap: Record<string, boolean> = {}; - for (const { displayName, name } of fields) { - fieldsMap[displayName ?? name] = true; - } - existingFields[title] = fieldsMap; - } - return existingFields; -} +jest.spyOn(UseExistingFieldsApi, 'useExistingFieldsFetcher'); +jest.spyOn(UseExistingFieldsApi, 'useExistingFieldsReader'); +jest.spyOn(ExistingFieldsServiceApi, 'loadFieldExisting').mockImplementation(async () => ({ + indexPatternTitle: 'test', + existingFieldNames: [], +})); const initialState: FormBasedPrivateState = { currentIndexPatternId: '1', @@ -234,8 +229,63 @@ const initialState: FormBasedPrivateState = { }, }; -function getFrameAPIMock({ indexPatterns, existingFields, ...rest }: Partial<DataViewsState> = {}) { +function getFrameAPIMock({ + indexPatterns, + ...rest +}: Partial<DataViewsState> & { indexPatterns: DataViewsState['indexPatterns'] }) { const frameAPI = createMockFramePublicAPI(); + + return { + ...frameAPI, + dataViews: { + ...frameAPI.dataViews, + indexPatterns, + ...rest, + }, + }; +} + +const dslQuery = { bool: { must: [], filter: [], should: [], must_not: [] } }; + +// @ts-expect-error Portal mocks are notoriously difficult to type +ReactDOM.createPortal = jest.fn((element) => element); + +async function mountAndWaitForLazyModules(component: React.ReactElement): Promise<ReactWrapper> { + let inst: ReactWrapper; + await act(async () => { + inst = await mountWithIntl(component); + // wait for lazy modules + await new Promise((resolve) => setTimeout(resolve, 0)); + await inst.update(); + }); + + return inst!; +} + +describe('FormBased Data Panel', () => { + const indexPatterns = { + a: { + id: 'a', + title: 'aaa', + timeFieldName: 'atime', + fields: fieldsOne, + getFieldByName: getFieldByNameFactory(fieldsOne), + hasRestrictions: false, + isPersisted: true, + spec: {}, + }, + b: { + id: 'b', + title: 'bbb', + timeFieldName: 'btime', + fields: fieldsTwo, + getFieldByName: getFieldByNameFactory(fieldsTwo), + hasRestrictions: false, + isPersisted: true, + spec: {}, + }, + }; + const defaultIndexPatterns = { '1': { id: '1', @@ -268,42 +318,7 @@ function getFrameAPIMock({ indexPatterns, existingFields, ...rest }: Partial<Dat spec: {}, }, }; - return { - ...frameAPI, - dataViews: { - ...frameAPI.dataViews, - indexPatterns: indexPatterns ?? defaultIndexPatterns, - existingFields: existingFields ?? getExistingFields(indexPatterns ?? defaultIndexPatterns), - isFirstExistenceFetch: false, - ...rest, - }, - }; -} - -const dslQuery = { bool: { must: [], filter: [], should: [], must_not: [] } }; - -// @ts-expect-error Portal mocks are notoriously difficult to type -ReactDOM.createPortal = jest.fn((element) => element); -describe('FormBased Data Panel', () => { - const indexPatterns = { - a: { - id: 'a', - title: 'aaa', - timeFieldName: 'atime', - fields: [{ name: 'aaa_field_1' }, { name: 'aaa_field_2' }], - getFieldByName: getFieldByNameFactory([]), - hasRestrictions: false, - }, - b: { - id: 'b', - title: 'bbb', - timeFieldName: 'btime', - fields: [{ name: 'bbb_field_1' }, { name: 'bbb_field_2' }], - getFieldByName: getFieldByNameFactory([]), - hasRestrictions: false, - }, - }; let defaultProps: Parameters<typeof InnerFormBasedDataPanel>[0] & { showNoDataPopover: () => void; }; @@ -313,9 +328,10 @@ describe('FormBased Data Panel', () => { beforeEach(() => { core = coreMock.createStart(); dataViews = dataViewPluginMocks.createStartContract(); + const frame = getFrameAPIMock({ indexPatterns: defaultIndexPatterns }); defaultProps = { data: dataPluginMock.createStartContract(), - dataViews: dataViewPluginMocks.createStartContract(), + dataViews, fieldFormats: fieldFormatsServiceMock.createStartContract(), indexPatternFieldEditor: indexPatternFieldEditorPluginMock.createStartContract(), onIndexPatternRefresh: jest.fn(), @@ -334,12 +350,34 @@ describe('FormBased Data Panel', () => { hasSuggestionForField: jest.fn(() => false), uiActions: uiActionsPluginMock.createStartContract(), indexPatternService: createIndexPatternServiceMock({ core, dataViews }), - frame: getFrameAPIMock(), + frame, + activeIndexPatterns: [frame.dataViews.indexPatterns['1']], }; + + core.uiSettings.get.mockImplementation((key: string) => { + if (key === UI_SETTINGS.META_FIELDS) { + return []; + } + }); + dataViews.get.mockImplementation(async (id: string) => { + const dataView = [ + indexPatterns.a, + indexPatterns.b, + defaultIndexPatterns['1'], + defaultIndexPatterns['2'], + defaultIndexPatterns['3'], + ].find((indexPattern) => indexPattern.id === id) as unknown as DataView; + dataView.metaFields = ['_id']; + return dataView; + }); + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockClear(); + (UseExistingFieldsApi.useExistingFieldsReader as jest.Mock).mockClear(); + (UseExistingFieldsApi.useExistingFieldsFetcher as jest.Mock).mockClear(); + UseExistingFieldsApi.resetExistingFieldsCache(); }); - it('should render a warning if there are no index patterns', () => { - const wrapper = shallowWithIntl( + it('should render a warning if there are no index patterns', async () => { + const wrapper = await mountAndWaitForLazyModules( <FormBasedDataPanel {...defaultProps} state={{ @@ -354,31 +392,21 @@ describe('FormBased Data Panel', () => { frame={createMockFramePublicAPI()} /> ); - expect(wrapper.find('[data-test-subj="indexPattern-no-indexpatterns"]')).toHaveLength(1); + expect(wrapper.find('[data-test-subj="indexPattern-no-indexpatterns"]').exists()).toBeTruthy(); }); describe('loading existence data', () => { - function testProps(updateIndexPatterns: IndexPatternServiceProps['updateIndexPatterns']) { - core.uiSettings.get.mockImplementation((key: string) => { - if (key === UI_SETTINGS.META_FIELDS) { - return []; - } - }); - dataViews.getFieldsForIndexPattern.mockImplementation((dataView) => { - return Promise.resolve([ - { name: `${dataView.title}_field_1` }, - { name: `${dataView.title}_field_2` }, - ]) as Promise<FieldSpec[]>; - }); - dataViews.get.mockImplementation(async (id: string) => { - return [indexPatterns.a, indexPatterns.b].find( - (indexPattern) => indexPattern.id === id - ) as unknown as DataView; - }); + function testProps({ + currentIndexPatternId, + otherProps, + }: { + currentIndexPatternId: keyof typeof indexPatterns; + otherProps?: object; + }) { return { ...defaultProps, indexPatternService: createIndexPatternServiceMock({ - updateIndexPatterns, + updateIndexPatterns: jest.fn(), core, dataViews, }), @@ -388,290 +416,329 @@ describe('FormBased Data Panel', () => { dragging: { id: '1', humanData: { label: 'Label' } }, }, dateRange: { fromDate: '2019-01-01', toDate: '2020-01-01' }, - frame: { - dataViews: { - indexPatternRefs: [], - existingFields: {}, - isFirstExistenceFetch: false, - indexPatterns, - }, - } as unknown as FramePublicAPI, + frame: getFrameAPIMock({ + indexPatterns: indexPatterns as unknown as DataViewsState['indexPatterns'], + }), state: { - currentIndexPatternId: 'a', + currentIndexPatternId, layers: { 1: { - indexPatternId: 'a', + indexPatternId: currentIndexPatternId, columnOrder: [], columns: {}, }, }, } as FormBasedPrivateState, + ...(otherProps || {}), }; } - async function testExistenceLoading( - props: Props, - stateChanges?: Partial<FormBasedPrivateState>, - propChanges?: Partial<Props> - ) { - const inst = mountWithIntl<Props>(<FormBasedDataPanel {...props} />); + it('loads existence data', async () => { + const props = testProps({ + currentIndexPatternId: 'a', + }); - await act(async () => { - inst.update(); + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: [indexPatterns.a.fields[0].name, indexPatterns.a.fields[1].name], + }; }); - if (stateChanges || propChanges) { - await act(async () => { - inst.setProps({ - ...props, - ...(propChanges || {}), - state: { - ...props.state, - ...(stateChanges || {}), - }, - }); - inst.update(); - }); - } - } + const inst = await mountAndWaitForLazyModules(<FormBasedDataPanel {...props} />); - it('loads existence data', async () => { - const updateIndexPatterns = jest.fn(); - await testExistenceLoading(testProps(updateIndexPatterns)); - - expect(updateIndexPatterns).toHaveBeenCalledWith( - { - existingFields: { - aaa: { - aaa_field_1: true, - aaa_field_2: true, - }, - }, - isFirstExistenceFetch: false, - }, - { applyImmediately: true } + expect(UseExistingFieldsApi.useExistingFieldsFetcher).toHaveBeenCalledWith( + expect.objectContaining({ + dataViews: [indexPatterns.a], + query: props.query, + filters: props.filters, + fromDate: props.dateRange.fromDate, + toDate: props.dateRange.toDate, + }) + ); + expect(UseExistingFieldsApi.useExistingFieldsReader).toHaveBeenCalled(); + expect(inst.find('[data-test-subj="lnsIndexPattern__ariaDescription"]').first().text()).toBe( + '2 available fields. 3 empty fields. 0 meta fields.' ); }); it('loads existence data for current index pattern id', async () => { - const updateIndexPatterns = jest.fn(); - await testExistenceLoading(testProps(updateIndexPatterns), { + const props = testProps({ currentIndexPatternId: 'b', }); - expect(updateIndexPatterns).toHaveBeenCalledWith( - { - existingFields: { - aaa: { - aaa_field_1: true, - aaa_field_2: true, - }, - bbb: { - bbb_field_1: true, - bbb_field_2: true, - }, - }, - isFirstExistenceFetch: false, - }, - { applyImmediately: true } + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: [indexPatterns.b.fields[0].name], + }; + }); + + const inst = await mountAndWaitForLazyModules(<FormBasedDataPanel {...props} />); + + expect(UseExistingFieldsApi.useExistingFieldsFetcher).toHaveBeenCalledWith( + expect.objectContaining({ + dataViews: [indexPatterns.b], + query: props.query, + filters: props.filters, + fromDate: props.dateRange.fromDate, + toDate: props.dateRange.toDate, + }) + ); + expect(UseExistingFieldsApi.useExistingFieldsReader).toHaveBeenCalled(); + expect(inst.find('[data-test-subj="lnsIndexPattern__ariaDescription"]').first().text()).toBe( + '1 available field. 2 empty fields. 0 meta fields.' ); }); it('does not load existence data if date and index pattern ids are unchanged', async () => { - const updateIndexPatterns = jest.fn(); - await testExistenceLoading( - testProps(updateIndexPatterns), - { - currentIndexPatternId: 'a', + const props = testProps({ + currentIndexPatternId: 'a', + otherProps: { + dateRange: { fromDate: '2019-01-01', toDate: '2020-01-01' }, }, - { dateRange: { fromDate: '2019-01-01', toDate: '2020-01-01' } } + }); + + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: [indexPatterns.a.fields[0].name, indexPatterns.a.fields[1].name], + }; + }); + + const inst = await mountAndWaitForLazyModules(<FormBasedDataPanel {...props} />); + + expect(UseExistingFieldsApi.useExistingFieldsFetcher).toHaveBeenCalledWith( + expect.objectContaining({ + dataViews: [indexPatterns.a], + fromDate: props.dateRange.fromDate, + toDate: props.dateRange.toDate, + }) ); + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledTimes(1); - expect(updateIndexPatterns).toHaveBeenCalledTimes(1); + await act(async () => { + await inst.setProps({ dateRange: { fromDate: '2019-01-01', toDate: '2020-01-01' } }); + await inst.update(); + }); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledTimes(1); }); it('loads existence data if date range changes', async () => { - const updateIndexPatterns = jest.fn(); - await testExistenceLoading(testProps(updateIndexPatterns), undefined, { - dateRange: { fromDate: '2019-01-01', toDate: '2020-01-02' }, + const props = testProps({ + currentIndexPatternId: 'a', + otherProps: { + dateRange: { fromDate: '2019-01-01', toDate: '2020-01-01' }, + }, }); - expect(updateIndexPatterns).toHaveBeenCalledTimes(2); - expect(dataViews.getFieldsForIndexPattern).toHaveBeenCalledTimes(2); - expect(dataViews.get).toHaveBeenCalledTimes(2); - - const firstCall = dataViews.getFieldsForIndexPattern.mock.calls[0]; - expect(firstCall[0]).toEqual(indexPatterns.a); - expect(firstCall[1]?.filter?.bool?.filter).toContainEqual(dslQuery); - expect(firstCall[1]?.filter?.bool?.filter).toContainEqual({ - range: { - atime: { - format: 'strict_date_optional_time', - gte: '2019-01-01', - lte: '2020-01-01', - }, - }, + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: [indexPatterns.a.fields[0].name, indexPatterns.a.fields[1].name], + }; }); - const secondCall = dataViews.getFieldsForIndexPattern.mock.calls[1]; - expect(secondCall[0]).toEqual(indexPatterns.a); - expect(secondCall[1]?.filter?.bool?.filter).toContainEqual(dslQuery); - expect(secondCall[1]?.filter?.bool?.filter).toContainEqual({ - range: { - atime: { - format: 'strict_date_optional_time', - gte: '2019-01-01', - lte: '2020-01-02', - }, - }, + const inst = await mountAndWaitForLazyModules(<FormBasedDataPanel {...props} />); + + expect(UseExistingFieldsApi.useExistingFieldsFetcher).toHaveBeenCalledWith( + expect.objectContaining({ + dataViews: [indexPatterns.a], + fromDate: props.dateRange.fromDate, + toDate: props.dateRange.toDate, + }) + ); + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledTimes(1); + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledWith( + expect.objectContaining({ + fromDate: '2019-01-01', + toDate: '2020-01-01', + dslQuery, + dataView: indexPatterns.a, + timeFieldName: indexPatterns.a.timeFieldName, + }) + ); + + await act(async () => { + await inst.setProps({ dateRange: { fromDate: '2019-01-01', toDate: '2020-01-02' } }); + await inst.update(); }); - expect(updateIndexPatterns).toHaveBeenCalledWith( - { - existingFields: { - aaa: { - aaa_field_1: true, - aaa_field_2: true, - }, - }, - isFirstExistenceFetch: false, - }, - { applyImmediately: true } + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledTimes(2); + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledWith( + expect.objectContaining({ + fromDate: '2019-01-01', + toDate: '2020-01-02', + dslQuery, + dataView: indexPatterns.a, + timeFieldName: indexPatterns.a.timeFieldName, + }) ); }); it('loads existence data if layer index pattern changes', async () => { - const updateIndexPatterns = jest.fn(); - await testExistenceLoading(testProps(updateIndexPatterns), { - layers: { - 1: { - indexPatternId: 'b', - columnOrder: [], - columns: {}, - }, + const props = testProps({ + currentIndexPatternId: 'a', + otherProps: { + dateRange: { fromDate: '2019-01-01', toDate: '2020-01-01' }, }, }); - expect(updateIndexPatterns).toHaveBeenCalledTimes(2); - - const secondCall = dataViews.getFieldsForIndexPattern.mock.calls[1]; - expect(secondCall[0]).toEqual(indexPatterns.a); - expect(secondCall[1]?.filter?.bool?.filter).toContainEqual(dslQuery); - expect(secondCall[1]?.filter?.bool?.filter).toContainEqual({ - range: { - atime: { - format: 'strict_date_optional_time', - gte: '2019-01-01', - lte: '2020-01-01', - }, - }, - }); + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation( + async ({ dataView }) => { + return { + existingFieldNames: + dataView === indexPatterns.a + ? [indexPatterns.a.fields[0].name, indexPatterns.a.fields[1].name] + : [indexPatterns.b.fields[0].name], + }; + } + ); - const thirdCall = dataViews.getFieldsForIndexPattern.mock.calls[2]; - expect(thirdCall[0]).toEqual(indexPatterns.b); - expect(thirdCall[1]?.filter?.bool?.filter).toContainEqual(dslQuery); - expect(thirdCall[1]?.filter?.bool?.filter).toContainEqual({ - range: { - btime: { - format: 'strict_date_optional_time', - gte: '2019-01-01', - lte: '2020-01-01', - }, - }, - }); + const inst = await mountAndWaitForLazyModules(<FormBasedDataPanel {...props} />); - expect(updateIndexPatterns).toHaveBeenCalledWith( - { - existingFields: { - aaa: { - aaa_field_1: true, - aaa_field_2: true, - }, - bbb: { - bbb_field_1: true, - bbb_field_2: true, - }, - }, - isFirstExistenceFetch: false, - }, - { applyImmediately: true } + expect(UseExistingFieldsApi.useExistingFieldsFetcher).toHaveBeenCalledWith( + expect.objectContaining({ + dataViews: [indexPatterns.a], + fromDate: props.dateRange.fromDate, + toDate: props.dateRange.toDate, + }) + ); + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledTimes(1); + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledWith( + expect.objectContaining({ + fromDate: '2019-01-01', + toDate: '2020-01-01', + dslQuery, + dataView: indexPatterns.a, + timeFieldName: indexPatterns.a.timeFieldName, + }) ); - }); - it('shows a loading indicator when loading', async () => { - const updateIndexPatterns = jest.fn(); - const load = async () => {}; - const inst = mountWithIntl(<FormBasedDataPanel {...testProps(updateIndexPatterns)} />); - expect(inst.find(EuiProgress).length).toEqual(1); - await act(load); - inst.update(); - expect(inst.find(EuiProgress).length).toEqual(0); - }); + expect(inst.find('[data-test-subj="lnsIndexPattern__ariaDescription"]').first().text()).toBe( + '2 available fields. 3 empty fields. 0 meta fields.' + ); - it('does not perform multiple queries at once', async () => { - const updateIndexPatterns = jest.fn(); - let queryCount = 0; - let overlapCount = 0; - const props = testProps(updateIndexPatterns); + await act(async () => { + await inst.setProps({ + currentIndexPatternId: 'b', + state: { + currentIndexPatternId: 'b', + layers: { + 1: { + indexPatternId: 'b', + columnOrder: [], + columns: {}, + }, + }, + } as FormBasedPrivateState, + }); + await inst.update(); + }); - dataViews.getFieldsForIndexPattern.mockImplementation((dataView) => { - if (queryCount) { - ++overlapCount; - } - ++queryCount; - const result = Promise.resolve([ - { name: `${dataView.title}_field_1` }, - { name: `${dataView.title}_field_2` }, - ]) as Promise<FieldSpec[]>; + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledTimes(2); + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledWith( + expect.objectContaining({ + fromDate: '2019-01-01', + toDate: '2020-01-01', + dslQuery, + dataView: indexPatterns.b, + timeFieldName: indexPatterns.b.timeFieldName, + }) + ); - result.then(() => --queryCount); + expect(inst.find('[data-test-subj="lnsIndexPattern__ariaDescription"]').first().text()).toBe( + '1 available field. 2 empty fields. 0 meta fields.' + ); + }); - return result; + it('shows a loading indicator when loading', async () => { + const props = testProps({ + currentIndexPatternId: 'b', }); - const inst = mountWithIntl(<FormBasedDataPanel {...props} />); + let resolveFunction: (arg: unknown) => void; + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockReset(); + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(() => { + return new Promise((resolve) => { + resolveFunction = resolve; + }); + }); + const inst = await mountAndWaitForLazyModules(<FormBasedDataPanel {...props} />); - inst.update(); + expect(inst.find(EuiProgress).length).toEqual(1); + expect(inst.find('[data-test-subj="lnsIndexPattern__ariaDescription"]').first().text()).toBe( + '' + ); - act(() => { - (inst.setProps as unknown as (props: unknown) => {})({ - ...props, - dateRange: { fromDate: '2019-01-01', toDate: '2020-01-02' }, + await act(async () => { + resolveFunction!({ + existingFieldNames: [indexPatterns.b.fields[0].name], }); - inst.update(); + await inst.update(); }); await act(async () => { - (inst.setProps as unknown as (props: unknown) => {})({ - ...props, - dateRange: { fromDate: '2019-01-01', toDate: '2020-01-03' }, - }); - inst.update(); + await inst.update(); }); - expect(dataViews.getFieldsForIndexPattern).toHaveBeenCalledTimes(2); - expect(overlapCount).toEqual(0); + expect(inst.find(EuiProgress).length).toEqual(0); + expect(inst.find('[data-test-subj="lnsIndexPattern__ariaDescription"]').first().text()).toBe( + '1 available field. 2 empty fields. 0 meta fields.' + ); }); - it("should default to empty dsl if query can't be parsed", async () => { - const updateIndexPatterns = jest.fn(); - const props = { - ...testProps(updateIndexPatterns), - query: { - language: 'kuery', - query: '@timestamp : NOT *', - }, - }; - await testExistenceLoading(props, undefined, undefined); + it("should trigger showNoDataPopover if fields don't have data", async () => { + const props = testProps({ + currentIndexPatternId: 'a', + }); + + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: [], + }; + }); + + const inst = await mountAndWaitForLazyModules(<FormBasedDataPanel {...props} />); - const firstCall = dataViews.getFieldsForIndexPattern.mock.calls[0]; - expect(firstCall[1]?.filter?.bool?.filter).toContainEqual({ - bool: { - must_not: { - match_all: {}, + expect(defaultProps.showNoDataPopover).toHaveBeenCalled(); + + expect(inst.find('[data-test-subj="lnsIndexPattern__ariaDescription"]').first().text()).toBe( + '0 available fields. 5 empty fields. 0 meta fields.' + ); + }); + + it("should default to empty dsl if query can't be parsed", async () => { + const props = testProps({ + currentIndexPatternId: 'a', + otherProps: { + query: { + language: 'kuery', + query: '@timestamp : NOT *', }, }, }); + + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: [indexPatterns.a.fields[0].name, indexPatterns.a.fields[1].name], + }; + }); + + const inst = await mountAndWaitForLazyModules(<FormBasedDataPanel {...props} />); + + expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledWith( + expect.objectContaining({ + dslQuery: { + bool: { + must_not: { + match_all: {}, + }, + }, + }, + }) + ); + + expect(inst.find('[data-test-subj="lnsIndexPattern__ariaDescription"]').first().text()).toBe( + '2 available fields. 3 empty fields. 0 meta fields.' + ); }); }); @@ -680,15 +747,13 @@ describe('FormBased Data Panel', () => { beforeEach(() => { props = { ...defaultProps, - frame: getFrameAPIMock({ - existingFields: { - idx1: { - bytes: true, - memory: true, - }, - }, - }), }; + + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: ['bytes', 'memory'], + }; + }); }); it('should list all selected fields if exist', async () => { @@ -696,7 +761,9 @@ describe('FormBased Data Panel', () => { ...props, layerFields: ['bytes'], }; - const wrapper = mountWithIntl(<InnerFormBasedDataPanel {...newProps} />); + + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...newProps} />); + expect( wrapper .find('[data-test-subj="lnsIndexPatternSelectedFields"]') @@ -706,9 +773,10 @@ describe('FormBased Data Panel', () => { }); it('should not list the selected fields accordion if no fields given', async () => { - const wrapper = mountWithIntl(<InnerFormBasedDataPanel {...props} />); + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); + expect( - wrapper + wrapper! .find('[data-test-subj="lnsIndexPatternSelectedFields"]') .find(FieldItem) .map((fieldItem) => fieldItem.prop('field').name) @@ -716,14 +784,14 @@ describe('FormBased Data Panel', () => { }); it('should list all supported fields in the pattern sorted alphabetically in groups', async () => { - const wrapper = mountWithIntl(<InnerFormBasedDataPanel {...props} />); + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); + expect(wrapper.find(FieldItem).first().prop('field').displayName).toEqual('Records'); + const availableAccordion = wrapper.find('[data-test-subj="lnsIndexPatternAvailableFields"]'); expect( - wrapper - .find('[data-test-subj="lnsIndexPatternAvailableFields"]') - .find(FieldItem) - .map((fieldItem) => fieldItem.prop('field').name) + availableAccordion.find(FieldItem).map((fieldItem) => fieldItem.prop('field').name) ).toEqual(['memory', 'bytes']); + expect(availableAccordion.find(FieldItem).at(0).prop('exists')).toEqual(true); wrapper .find('[data-test-subj="lnsIndexPatternEmptyFields"]') .find('button') @@ -736,10 +804,11 @@ describe('FormBased Data Panel', () => { expect( emptyAccordion.find(FieldItem).map((fieldItem) => fieldItem.prop('field').displayName) ).toEqual(['client', 'source', 'timestampLabel']); + expect(emptyAccordion.find(FieldItem).at(1).prop('exists')).toEqual(false); }); it('should show meta fields accordion', async () => { - const wrapper = mountWithIntl( + const wrapper = await mountAndWaitForLazyModules( <InnerFormBasedDataPanel {...props} frame={getFrameAPIMock({ @@ -762,6 +831,7 @@ describe('FormBased Data Panel', () => { })} /> ); + wrapper .find('[data-test-subj="lnsIndexPatternMetaFields"]') .find('button') @@ -777,13 +847,15 @@ describe('FormBased Data Panel', () => { }); it('should display NoFieldsCallout when all fields are empty', async () => { - const wrapper = mountWithIntl( - <InnerFormBasedDataPanel - {...defaultProps} - frame={getFrameAPIMock({ existingFields: { idx1: {} } })} - /> - ); - expect(wrapper.find(NoFieldsCallout).length).toEqual(2); + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + return { + existingFieldNames: [], + }; + }); + + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); + + expect(wrapper.find(EuiCallOut).length).toEqual(2); expect( wrapper .find('[data-test-subj="lnsIndexPatternAvailableFields"]') @@ -804,52 +876,55 @@ describe('FormBased Data Panel', () => { }); it('should display spinner for available fields accordion if existing fields are not loaded yet', async () => { - const wrapper = mountWithIntl( - <InnerFormBasedDataPanel - {...defaultProps} - frame={getFrameAPIMock({ existingFields: {} })} - /> - ); + let resolveFunction: (arg: unknown) => void; + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockReset(); + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(() => { + return new Promise((resolve) => { + resolveFunction = resolve; + }); + }); + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); + expect( wrapper.find('[data-test-subj="lnsIndexPatternAvailableFields"]').find(EuiLoadingSpinner) .length ).toEqual(1); - wrapper.setProps({ frame: getFrameAPIMock({ existingFields: { idx1: {} } }) }); - expect(wrapper.find(NoFieldsCallout).length).toEqual(2); - }); + expect(wrapper.find(EuiCallOut).length).toEqual(0); - it('should not allow field details when error', () => { - const wrapper = mountWithIntl( - <InnerFormBasedDataPanel - {...props} - frame={getFrameAPIMock({ existenceFetchFailed: true })} - /> - ); + await act(async () => { + resolveFunction!({ + existingFieldNames: [], + }); + }); - expect(wrapper.find(FieldList).prop('fieldGroups')).toEqual( - expect.objectContaining({ - AvailableFields: expect.objectContaining({ hideDetails: true }), - }) - ); + await act(async () => { + await wrapper.update(); + }); + + expect( + wrapper.find('[data-test-subj="lnsIndexPatternAvailableFields"]').find(EuiLoadingSpinner) + .length + ).toEqual(0); + expect(wrapper.find(EuiCallOut).length).toEqual(2); }); - it('should allow field details when timeout', () => { - const wrapper = mountWithIntl( - <InnerFormBasedDataPanel - {...props} - frame={getFrameAPIMock({ existenceFetchTimeout: true })} - /> - ); + it('should not allow field details when error', async () => { + (ExistingFieldsServiceApi.loadFieldExisting as jest.Mock).mockImplementation(async () => { + throw new Error('test'); + }); - expect(wrapper.find(FieldList).prop('fieldGroups')).toEqual( + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); + + expect(wrapper.find(FieldListGrouped).prop('fieldGroups')).toEqual( expect.objectContaining({ - AvailableFields: expect.objectContaining({ hideDetails: false }), + AvailableFields: expect.objectContaining({ hideDetails: true }), }) ); }); - it('should filter down by name', () => { - const wrapper = mountWithIntl(<InnerFormBasedDataPanel {...props} />); + it('should filter down by name', async () => { + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); + act(() => { wrapper.find('[data-test-subj="lnsIndexPatternFieldSearch"]').simulate('change', { target: { value: 'me' }, @@ -867,8 +942,9 @@ describe('FormBased Data Panel', () => { ]); }); - it('should announce filter in live region', () => { - const wrapper = mountWithIntl(<InnerFormBasedDataPanel {...props} />); + it('should announce filter in live region', async () => { + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); + act(() => { wrapper.find('[data-test-subj="lnsIndexPatternFieldSearch"]').simulate('change', { target: { value: 'me' }, @@ -886,8 +962,8 @@ describe('FormBased Data Panel', () => { ); }); - it('should filter down by type', () => { - const wrapper = mountWithIntl(<InnerFormBasedDataPanel {...props} />); + it('should filter down by type', async () => { + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); wrapper.find('[data-test-subj="lnsIndexPatternFiltersToggle"]').first().simulate('click'); @@ -898,8 +974,8 @@ describe('FormBased Data Panel', () => { ).toEqual(['amemory', 'bytes']); }); - it('should display no fields in groups when filtered by type Record', () => { - const wrapper = mountWithIntl(<InnerFormBasedDataPanel {...props} />); + it('should display no fields in groups when filtered by type Record', async () => { + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); wrapper.find('[data-test-subj="lnsIndexPatternFiltersToggle"]').first().simulate('click'); @@ -908,11 +984,12 @@ describe('FormBased Data Panel', () => { expect(wrapper.find(FieldItem).map((fieldItem) => fieldItem.prop('field').name)).toEqual([ DOCUMENT_FIELD_NAME, ]); - expect(wrapper.find(NoFieldsCallout).length).toEqual(3); + expect(wrapper.find(EuiCallOut).length).toEqual(3); }); - it('should toggle type if clicked again', () => { - const wrapper = mountWithIntl(<InnerFormBasedDataPanel {...props} />); + it('should toggle type if clicked again', async () => { + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); + wrapper.find('[data-test-subj="lnsIndexPatternFiltersToggle"]').first().simulate('click'); wrapper.find('[data-test-subj="typeFilter-number"]').first().simulate('click'); @@ -927,8 +1004,9 @@ describe('FormBased Data Panel', () => { ).toEqual(['Records', 'amemory', 'bytes', 'client', 'source', 'timestampLabel']); }); - it('should filter down by type and by name', () => { - const wrapper = mountWithIntl(<InnerFormBasedDataPanel {...props} />); + it('should filter down by type and by name', async () => { + const wrapper = await mountAndWaitForLazyModules(<InnerFormBasedDataPanel {...props} />); + act(() => { wrapper.find('[data-test-subj="lnsIndexPatternFieldSearch"]').simulate('change', { target: { value: 'me' }, diff --git a/x-pack/plugins/lens/public/datasources/form_based/datapanel.tsx b/x-pack/plugins/lens/public/datasources/form_based/datapanel.tsx index 8a7916a01a09a..7da9c57d0123b 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/datapanel.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/datapanel.tsx @@ -6,32 +6,38 @@ */ import './datapanel.scss'; -import { uniq, groupBy } from 'lodash'; -import React, { useState, memo, useCallback, useMemo, useRef, useEffect } from 'react'; +import { uniq } from 'lodash'; +import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { + EuiCallOut, + EuiContextMenuItem, + EuiContextMenuPanel, + EuiFilterButton, EuiFlexGroup, EuiFlexItem, - EuiContextMenuPanel, - EuiContextMenuItem, - EuiPopover, - EuiCallOut, EuiFormControlLayout, - EuiFilterButton, - EuiScreenReaderOnly, EuiIcon, + EuiPopover, + EuiProgress, + htmlIdGenerator, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import type { EsQueryConfig, Query, Filter } from '@kbn/es-query'; import { FormattedMessage } from '@kbn/i18n-react'; import type { CoreStart } from '@kbn/core/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; +import { type DataView } from '@kbn/data-plugin/common'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import { htmlIdGenerator } from '@elastic/eui'; -import { buildEsQuery } from '@kbn/es-query'; -import { getEsQueryConfig } from '@kbn/data-plugin/public'; import { IndexPatternFieldEditorStart } from '@kbn/data-view-field-editor-plugin/public'; import { VISUALIZE_GEO_FIELD_TRIGGER } from '@kbn/ui-actions-plugin/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; +import { + FieldsGroupNames, + FieldListGrouped, + type FieldListGroupedProps, + useExistingFieldsFetcher, + useGroupedFields, + useExistingFieldsReader, +} from '@kbn/unified-field-list-plugin/public'; import { ChartsPluginSetup } from '@kbn/charts-plugin/public'; import type { DatasourceDataPanelProps, @@ -42,12 +48,11 @@ import type { } from '../../types'; import { ChildDragDropProvider, DragContextState } from '../../drag_drop'; import type { FormBasedPrivateState } from './types'; -import { Loader } from '../../loader'; import { LensFieldIcon } from '../../shared_components/field_picker/lens_field_icon'; import { getFieldType } from './pure_utils'; -import { FieldGroups, FieldList } from './field_list'; -import { fieldContainsData, fieldExists } from '../../shared_components'; +import { fieldContainsData } from '../../shared_components'; import { IndexPatternServiceAPI } from '../../data_views_service/service'; +import { FieldItem } from './field_item'; export type Props = Omit< DatasourceDataPanelProps<FormBasedPrivateState>, @@ -65,10 +70,6 @@ export type Props = Omit< layerFields?: string[]; }; -function sortFields(fieldA: IndexPatternField, fieldB: IndexPatternField) { - return fieldA.displayName.localeCompare(fieldB.displayName, undefined, { sensitivity: 'base' }); -} - const supportedFieldTypes = new Set([ 'string', 'number', @@ -104,25 +105,8 @@ const fieldTypeNames: Record<DataType, string> = { murmur3: i18n.translate('xpack.lens.datatypes.murmur3', { defaultMessage: 'murmur3' }), }; -// Wrapper around buildEsQuery, handling errors (e.g. because a query can't be parsed) by -// returning a query dsl object not matching anything -function buildSafeEsQuery( - indexPattern: IndexPattern, - query: Query, - filters: Filter[], - queryConfig: EsQueryConfig -) { - try { - return buildEsQuery(indexPattern, query, filters, queryConfig); - } catch (e) { - return { - bool: { - must_not: { - match_all: {}, - }, - }, - }; - } +function onSupportedFieldFilter(field: IndexPatternField): boolean { + return supportedFieldTypes.has(field.type); } export function FormBasedDataPanel({ @@ -147,51 +131,22 @@ export function FormBasedDataPanel({ usedIndexPatterns, layerFields, }: Props) { - const { indexPatterns, indexPatternRefs, existingFields, isFirstExistenceFetch } = - frame.dataViews; + const { indexPatterns, indexPatternRefs } = frame.dataViews; const { currentIndexPatternId } = state; - const indexPatternList = uniq( - ( - usedIndexPatterns ?? Object.values(state.layers).map(({ indexPatternId }) => indexPatternId) - ).concat(currentIndexPatternId) - ) - .filter((id) => !!indexPatterns[id]) - .sort() - .map((id) => indexPatterns[id]); - - const dslQuery = buildSafeEsQuery( - indexPatterns[currentIndexPatternId], - query, - filters, - getEsQueryConfig(core.uiSettings) - ); + const activeIndexPatterns = useMemo(() => { + return uniq( + ( + usedIndexPatterns ?? Object.values(state.layers).map(({ indexPatternId }) => indexPatternId) + ).concat(currentIndexPatternId) + ) + .filter((id) => !!indexPatterns[id]) + .sort() + .map((id) => indexPatterns[id]); + }, [usedIndexPatterns, indexPatterns, state.layers, currentIndexPatternId]); return ( <> - <Loader - load={() => - indexPatternService.refreshExistingFields({ - dateRange, - currentIndexPatternTitle: indexPatterns[currentIndexPatternId]?.title || '', - onNoData: showNoDataPopover, - dslQuery, - indexPatternList, - isFirstExistenceFetch, - existingFields, - }) - } - loadDeps={[ - query, - filters, - dateRange.fromDate, - dateRange.toDate, - indexPatternList.map((x) => `${x.title}:${x.timeFieldName}`).join(','), - // important here to rerun the fields existence on indexPattern change (i.e. add new fields in place) - frame.dataViews.indexPatterns, - ]} - /> - {Object.keys(indexPatterns).length === 0 && indexPatternRefs.length === 0 ? ( <EuiFlexGroup gutterSize="m" @@ -237,6 +192,8 @@ export function FormBasedDataPanel({ onIndexPatternRefresh={onIndexPatternRefresh} frame={frame} layerFields={layerFields} + showNoDataPopover={showNoDataPopover} + activeIndexPatterns={activeIndexPatterns} /> )} </> @@ -252,18 +209,6 @@ interface DataPanelState { isMetaAccordionOpen: boolean; } -const defaultFieldGroups: { - specialFields: IndexPatternField[]; - availableFields: IndexPatternField[]; - emptyFields: IndexPatternField[]; - metaFields: IndexPatternField[]; -} = { - specialFields: [], - availableFields: [], - emptyFields: [], - metaFields: [], -}; - const htmlId = htmlIdGenerator('datapanel'); const fieldSearchDescriptionId = htmlId(); @@ -286,9 +231,11 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ frame, onIndexPatternRefresh, layerFields, + showNoDataPopover, + activeIndexPatterns, }: Omit< DatasourceDataPanelProps, - 'state' | 'setState' | 'showNoDataPopover' | 'core' | 'onChangeIndexPattern' | 'usedIndexPatterns' + 'state' | 'setState' | 'core' | 'onChangeIndexPattern' | 'usedIndexPatterns' > & { data: DataPublicPluginStart; dataViews: DataViewsPublicPluginStart; @@ -301,6 +248,7 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ indexPatternFieldEditor: IndexPatternFieldEditorStart; onIndexPatternRefresh: () => void; layerFields?: string[]; + activeIndexPatterns: IndexPattern[]; }) { const [localState, setLocalState] = useState<DataPanelState>({ nameFilter: '', @@ -310,10 +258,30 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ isEmptyAccordionOpen: false, isMetaAccordionOpen: false, }); - const { existenceFetchFailed, existenceFetchTimeout, indexPatterns, existingFields } = - frame.dataViews; + const { indexPatterns } = frame.dataViews; const currentIndexPattern = indexPatterns[currentIndexPatternId]; - const existingFieldsForIndexPattern = existingFields[currentIndexPattern?.title]; + + const { refetchFieldsExistenceInfo, isProcessing } = useExistingFieldsFetcher({ + dataViews: activeIndexPatterns as unknown as DataView[], + query, + filters, + fromDate: dateRange.fromDate, + toDate: dateRange.toDate, + services: { + data, + dataViews, + core, + }, + onNoData: (dataViewId) => { + if (dataViewId === currentIndexPatternId) { + showNoDataPopover(); + } + }, + }); + const fieldsExistenceReader = useExistingFieldsReader(); + const fieldsExistenceStatus = + fieldsExistenceReader.getFieldsExistenceStatus(currentIndexPatternId); + const visualizeGeoFieldTrigger = uiActions.getTrigger(VISUALIZE_GEO_FIELD_TRIGGER); const allFields = useMemo(() => { if (!currentIndexPattern) return []; @@ -331,187 +299,74 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ ...localState.typeFilter, ]); - const fieldInfoUnavailable = - existenceFetchFailed || existenceFetchTimeout || currentIndexPattern?.hasRestrictions; - const editPermission = indexPatternFieldEditor.userPermissions.editIndexPattern() || !currentIndexPattern.isPersisted; - const unfilteredFieldGroups: FieldGroups = useMemo(() => { - const containsData = (field: IndexPatternField) => { - const overallField = currentIndexPattern?.getFieldByName(field.name); - return ( - overallField && - existingFieldsForIndexPattern && - fieldExists(existingFieldsForIndexPattern, overallField.name) - ); - }; - - const allSupportedTypesFields = allFields.filter((field) => - supportedFieldTypes.has(field.type) - ); - const usedByLayersFields = allFields.filter((field) => layerFields?.includes(field.name)); - const sorted = allSupportedTypesFields.sort(sortFields); - const groupedFields = { - ...defaultFieldGroups, - ...groupBy(sorted, (field) => { - if (field.type === 'document') { - return 'specialFields'; - } else if (field.meta) { - return 'metaFields'; - } else if (containsData(field)) { - return 'availableFields'; - } else return 'emptyFields'; - }), - }; - - const isUsingSampling = core.uiSettings.get('lens:useFieldExistenceSampling'); - - const fieldGroupDefinitions: FieldGroups = { - SpecialFields: { - fields: groupedFields.specialFields, - fieldCount: 1, - isAffectedByGlobalFilter: false, - isAffectedByTimeFilter: false, - isInitiallyOpen: false, - showInAccordion: false, - title: '', - hideDetails: true, - }, - SelectedFields: { - fields: usedByLayersFields, - fieldCount: usedByLayersFields.length, - isInitiallyOpen: true, - showInAccordion: true, - title: i18n.translate('xpack.lens.indexPattern.selectedFieldsLabel', { - defaultMessage: 'Selected fields', - }), - isAffectedByGlobalFilter: !!filters.length, - isAffectedByTimeFilter: true, - hideDetails: false, - hideIfEmpty: true, - }, - AvailableFields: { - fields: groupedFields.availableFields, - fieldCount: groupedFields.availableFields.length, - isInitiallyOpen: true, - showInAccordion: true, - title: fieldInfoUnavailable - ? i18n.translate('xpack.lens.indexPattern.allFieldsLabel', { - defaultMessage: 'All fields', - }) - : i18n.translate('xpack.lens.indexPattern.availableFieldsLabel', { - defaultMessage: 'Available fields', - }), - helpText: isUsingSampling - ? i18n.translate('xpack.lens.indexPattern.allFieldsSamplingLabelHelp', { - defaultMessage: - 'Available fields contain the data in the first 500 documents that match your filters. To view all fields, expand Empty fields. You are unable to create visualizations with full text, geographic, flattened, and object fields.', - }) - : i18n.translate('xpack.lens.indexPattern.allFieldsLabelHelp', { - defaultMessage: - 'Drag and drop available fields to the workspace and create visualizations. To change the available fields, select a different data view, edit your queries, or use a different time range. Some field types cannot be visualized in Lens, including full text and geographic fields.', - }), - isAffectedByGlobalFilter: !!filters.length, - isAffectedByTimeFilter: true, - // Show details on timeout but not failure - hideDetails: fieldInfoUnavailable && !existenceFetchTimeout, - defaultNoFieldsMessage: i18n.translate('xpack.lens.indexPatterns.noAvailableDataLabel', { - defaultMessage: `There are no available fields that contain data.`, - }), - }, - EmptyFields: { - fields: groupedFields.emptyFields, - fieldCount: groupedFields.emptyFields.length, - isAffectedByGlobalFilter: false, - isAffectedByTimeFilter: false, - isInitiallyOpen: false, - showInAccordion: true, - hideDetails: false, - title: i18n.translate('xpack.lens.indexPattern.emptyFieldsLabel', { - defaultMessage: 'Empty fields', - }), - defaultNoFieldsMessage: i18n.translate('xpack.lens.indexPatterns.noEmptyDataLabel', { - defaultMessage: `There are no empty fields.`, - }), - helpText: i18n.translate('xpack.lens.indexPattern.emptyFieldsLabelHelp', { - defaultMessage: - 'Empty fields did not contain any values in the first 500 documents based on your filters.', - }), - }, - MetaFields: { - fields: groupedFields.metaFields, - fieldCount: groupedFields.metaFields.length, - isAffectedByGlobalFilter: false, - isAffectedByTimeFilter: false, - isInitiallyOpen: false, - showInAccordion: true, - hideDetails: false, - title: i18n.translate('xpack.lens.indexPattern.metaFieldsLabel', { - defaultMessage: 'Meta fields', - }), - defaultNoFieldsMessage: i18n.translate('xpack.lens.indexPatterns.noMetaDataLabel', { - defaultMessage: `There are no meta fields.`, - }), - }, - }; - - // do not show empty field accordion if there is no existence information - if (fieldInfoUnavailable) { - delete fieldGroupDefinitions.EmptyFields; - } - - return fieldGroupDefinitions; - }, [ - allFields, - core.uiSettings, - fieldInfoUnavailable, - filters.length, - existenceFetchTimeout, - currentIndexPattern, - existingFieldsForIndexPattern, - layerFields, - ]); - - const fieldGroups: FieldGroups = useMemo(() => { - const filterFieldGroup = (fieldGroup: IndexPatternField[]) => - fieldGroup.filter((field) => { - if ( - localState.nameFilter.length && - !field.name.toLowerCase().includes(localState.nameFilter.toLowerCase()) && - !field.displayName.toLowerCase().includes(localState.nameFilter.toLowerCase()) - ) { - return false; - } - if (localState.typeFilter.length > 0) { - return localState.typeFilter.includes(getFieldType(field) as DataType); - } - return true; - }); - return Object.fromEntries( - Object.entries(unfilteredFieldGroups).map(([name, group]) => [ - name, - { ...group, fields: filterFieldGroup(group.fields) }, - ]) - ); - }, [unfilteredFieldGroups, localState.nameFilter, localState.typeFilter]); - - const checkFieldExists = useCallback( - (field: IndexPatternField) => - fieldContainsData(field.name, currentIndexPattern, existingFieldsForIndexPattern), - [currentIndexPattern, existingFieldsForIndexPattern] + const onSelectedFieldFilter = useCallback( + (field: IndexPatternField): boolean => { + return Boolean(layerFields?.includes(field.name)); + }, + [layerFields] ); - const { nameFilter, typeFilter } = localState; + const onFilterField = useCallback( + (field: IndexPatternField) => { + if ( + localState.nameFilter.length && + !field.name.toLowerCase().includes(localState.nameFilter.toLowerCase()) && + !field.displayName.toLowerCase().includes(localState.nameFilter.toLowerCase()) + ) { + return false; + } + if (localState.typeFilter.length > 0) { + return localState.typeFilter.includes(getFieldType(field) as DataType); + } + return true; + }, + [localState] + ); - const filter = useMemo( - () => ({ - nameFilter, - typeFilter, - }), - [nameFilter, typeFilter] + const hasFilters = Boolean(filters.length); + const onOverrideFieldGroupDetails = useCallback( + (groupName) => { + if (groupName === FieldsGroupNames.AvailableFields) { + const isUsingSampling = core.uiSettings.get('lens:useFieldExistenceSampling'); + + return { + helpText: isUsingSampling + ? i18n.translate('xpack.lens.indexPattern.allFieldsSamplingLabelHelp', { + defaultMessage: + 'Available fields contain the data in the first 500 documents that match your filters. To view all fields, expand Empty fields. You are unable to create visualizations with full text, geographic, flattened, and object fields.', + }) + : i18n.translate('xpack.lens.indexPattern.allFieldsLabelHelp', { + defaultMessage: + 'Drag and drop available fields to the workspace and create visualizations. To change the available fields, select a different data view, edit your queries, or use a different time range. Some field types cannot be visualized in Lens, including full text and geographic fields.', + }), + isAffectedByGlobalFilter: hasFilters, + }; + } + if (groupName === FieldsGroupNames.SelectedFields) { + return { + isAffectedByGlobalFilter: hasFilters, + }; + } + }, + [core.uiSettings, hasFilters] ); + const { fieldGroups } = useGroupedFields<IndexPatternField>({ + dataViewId: currentIndexPatternId, + allFields, + services: { + dataViews, + }, + fieldsExistenceReader, + onFilterField, + onSupportedFieldFilter, + onSelectedFieldFilter, + onOverrideFieldGroupDetails, + }); + const closeFieldEditor = useRef<() => void | undefined>(); useEffect(() => { @@ -560,6 +415,7 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ onSave: () => { if (indexPatternInstance.isPersisted()) { refreshFieldList(); + refetchFieldsExistenceInfo(indexPatternInstance.id); } else { indexPatternService.replaceDataViewId(indexPatternInstance); } @@ -574,6 +430,7 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ indexPatternFieldEditor, refreshFieldList, indexPatternService, + refetchFieldsExistenceInfo, ] ); @@ -590,6 +447,7 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ onDelete: () => { if (indexPatternInstance.isPersisted()) { refreshFieldList(); + refetchFieldsExistenceInfo(indexPatternInstance.id); } else { indexPatternService.replaceDataViewId(indexPatternInstance); } @@ -604,24 +462,39 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ indexPatternFieldEditor, indexPatternService, refreshFieldList, + refetchFieldsExistenceInfo, ] ); - const fieldProps = useMemo( - () => ({ - core, - data, - fieldFormats, - indexPattern: currentIndexPattern, - highlight: localState.nameFilter.toLowerCase(), - dateRange, - query, - filters, - chartsThemeService: charts.theme, - }), + const renderFieldItem: FieldListGroupedProps<IndexPatternField>['renderFieldItem'] = useCallback( + ({ field, itemIndex, groupIndex, hideDetails }) => ( + <FieldItem + field={field} + exists={fieldContainsData( + field.name, + currentIndexPattern, + fieldsExistenceReader.hasFieldData + )} + hideDetails={hideDetails || field.type === 'document'} + itemIndex={itemIndex} + groupIndex={groupIndex} + dropOntoWorkspace={dropOntoWorkspace} + hasSuggestionForField={hasSuggestionForField} + editField={editField} + removeField={removeField} + uiActions={uiActions} + core={core} + fieldFormats={fieldFormats} + indexPattern={currentIndexPattern} + highlight={localState.nameFilter.toLowerCase()} + dateRange={dateRange} + query={query} + filters={filters} + chartsThemeService={charts.theme} + /> + ), [ core, - data, fieldFormats, currentIndexPattern, dateRange, @@ -629,6 +502,12 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ filters, localState.nameFilter, charts.theme, + fieldsExistenceReader.hasFieldData, + dropOntoWorkspace, + hasSuggestionForField, + editField, + removeField, + uiActions, ] ); @@ -640,6 +519,7 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ direction="column" responsive={false} > + {isProcessing && <EuiProgress size="xs" color="accent" position="absolute" />} <EuiFlexItem grow={false}> <EuiFormControlLayout icon="search" @@ -734,36 +614,14 @@ export const InnerFormBasedDataPanel = function InnerFormBasedDataPanel({ /> </EuiFormControlLayout> </EuiFlexItem> - <EuiScreenReaderOnly> - <div aria-live="polite" id={fieldSearchDescriptionId}> - {i18n.translate('xpack.lens.indexPatterns.fieldSearchLiveRegion', { - defaultMessage: - '{availableFields} available {availableFields, plural, one {field} other {fields}}. {emptyFields} empty {emptyFields, plural, one {field} other {fields}}. {metaFields} meta {metaFields, plural, one {field} other {fields}}.', - values: { - availableFields: fieldGroups.AvailableFields.fields.length, - // empty fields can be undefined if there is no existence information to be fetched - emptyFields: fieldGroups.EmptyFields?.fields.length || 0, - metaFields: fieldGroups.MetaFields.fields.length, - }, - })} - </div> - </EuiScreenReaderOnly> <EuiFlexItem> - <FieldList - exists={checkFieldExists} - fieldProps={fieldProps} + <FieldListGrouped<IndexPatternField> fieldGroups={fieldGroups} - hasSyncedExistingFields={!!existingFieldsForIndexPattern} - filter={filter} - currentIndexPatternId={currentIndexPatternId} - existenceFetchFailed={existenceFetchFailed} - existenceFetchTimeout={existenceFetchTimeout} - existFieldsInIndex={!!allFields.length} - dropOntoWorkspace={dropOntoWorkspace} - hasSuggestionForField={hasSuggestionForField} - editField={editField} - removeField={removeField} - uiActions={uiActions} + fieldsExistenceStatus={fieldsExistenceStatus} + fieldsExistInIndex={!!allFields.length} + renderFieldItem={renderFieldItem} + screenReaderDescriptionForSearchInputId={fieldSearchDescriptionId} + data-test-subj="lnsIndexPattern" /> </EuiFlexItem> </EuiFlexGroup> diff --git a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/dimension_editor.tsx index 330d3285b2951..97dabaca05c03 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/dimension_editor.tsx @@ -606,7 +606,6 @@ export function DimensionEditor(props: DimensionEditorProps) { setIsCloseable, paramEditorCustomProps, ReferenceEditor, - existingFields: props.existingFields, ...services, }; @@ -789,7 +788,6 @@ export function DimensionEditor(props: DimensionEditorProps) { }} validation={validation} currentIndexPattern={currentIndexPattern} - existingFields={props.existingFields} selectionStyle={selectedOperationDefinition.selectionStyle} dateRange={dateRange} labelAppend={selectedOperationDefinition?.getHelpMessage?.({ @@ -815,7 +813,6 @@ export function DimensionEditor(props: DimensionEditorProps) { selectedColumn={selectedColumn as FieldBasedIndexPatternColumn} columnId={columnId} indexPattern={currentIndexPattern} - existingFields={props.existingFields} operationSupportMatrix={operationSupportMatrix} updateLayer={(newLayer) => { if (temporaryQuickFunction) { @@ -845,7 +842,6 @@ export function DimensionEditor(props: DimensionEditorProps) { const customParamEditor = ParamEditor ? ( <> <ParamEditor - existingFields={props.existingFields} layer={state.layers[layerId]} activeData={props.activeData} paramEditorUpdater={ diff --git a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/dimension_panel.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/dimension_panel.test.tsx index 456b1537db97c..2be5bc33835b9 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/dimension_panel.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/dimension_panel.test.tsx @@ -32,6 +32,7 @@ import { CoreStart, } from '@kbn/core/public'; import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; +import { useExistingFieldsReader } from '@kbn/unified-field-list-plugin/public/hooks/use_existing_fields'; import { generateId } from '../../../id_generator'; import { FormBasedPrivateState } from '../types'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; @@ -78,6 +79,16 @@ jest.mock('../operations/definitions/formula/editor/formula_editor', () => { }; }); +jest.mock('@kbn/unified-field-list-plugin/public/hooks/use_existing_fields', () => ({ + useExistingFieldsReader: jest.fn(() => { + return { + hasFieldData: (dataViewId: string, fieldName: string) => { + return ['timestamp', 'bytes', 'memory', 'source'].includes(fieldName); + }, + }; + }), +})); + const fields = [ { name: 'timestamp', @@ -197,14 +208,6 @@ describe('FormBasedDimensionEditor', () => { defaultProps = { indexPatterns: expectedIndexPatterns, - existingFields: { - 'my-fake-index-pattern': { - timestamp: true, - bytes: true, - memory: true, - source: true, - }, - }, state, setState, dateRange: { fromDate: 'now-1d', toDate: 'now' }, @@ -339,16 +342,15 @@ describe('FormBasedDimensionEditor', () => { }); it('should hide fields that have no data', () => { - const props = { - ...defaultProps, - existingFields: { - 'my-fake-index-pattern': { - timestamp: true, - source: true, + (useExistingFieldsReader as jest.Mock).mockImplementationOnce(() => { + return { + hasFieldData: (dataViewId: string, fieldName: string) => { + return ['timestamp', 'source'].includes(fieldName); }, - }, - }; - wrapper = mount(<FormBasedDimensionEditorComponent {...props} />); + }; + }); + + wrapper = mount(<FormBasedDimensionEditorComponent {...defaultProps} />); const options = wrapper .find(EuiComboBox) diff --git a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_input.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_input.test.tsx index 877dc18156cdf..a135b08082c9e 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_input.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_input.test.tsx @@ -112,11 +112,7 @@ function getLayer(col1: GenericIndexPatternColumn = getStringBasedOperationColum }, }; } -function getDefaultOperationSupportMatrix( - layer: FormBasedLayer, - columnId: string, - existingFields: Record<string, Record<string, boolean>> -) { +function getDefaultOperationSupportMatrix(layer: FormBasedLayer, columnId: string) { return getOperationSupportMatrix({ state: { layers: { layer1: layer }, @@ -130,29 +126,36 @@ function getDefaultOperationSupportMatrix( }); } -function getExistingFields() { - const fields: Record<string, boolean> = {}; - for (const field of defaultProps.indexPattern.fields) { - fields[field.name] = true; - } - return { - [defaultProps.indexPattern.title]: fields, - }; -} +const mockedReader = { + hasFieldData: (dataViewId: string, fieldName: string) => { + if (defaultProps.indexPattern.id !== dataViewId) { + return false; + } + + const map: Record<string, boolean> = {}; + for (const field of defaultProps.indexPattern.fields) { + map[field.name] = true; + } + + return map[fieldName]; + }, +}; + +jest.mock('@kbn/unified-field-list-plugin/public/hooks/use_existing_fields', () => ({ + useExistingFieldsReader: jest.fn(() => mockedReader), +})); describe('FieldInput', () => { it('should render a field select box', () => { const updateLayerSpy = jest.fn(); const layer = getLayer(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} /> ); @@ -163,15 +166,13 @@ describe('FieldInput', () => { it('should render an error message when incomplete operation is on', () => { const updateLayerSpy = jest.fn(); const layer = getLayer(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} incompleteOperation={'terms'} selectedColumn={getStringBasedOperationColumn()} @@ -195,19 +196,13 @@ describe('FieldInput', () => { (_, col: ReferenceBasedIndexPatternColumn) => { const updateLayerSpy = jest.fn(); const layer = getLayer(col); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix( - layer, - 'col1', - existingFields - ); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} incompleteOperation={'terms'} /> @@ -234,19 +229,13 @@ describe('FieldInput', () => { (_, col: ReferenceBasedIndexPatternColumn) => { const updateLayerSpy = jest.fn(); const layer = getLayer(col); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix( - layer, - 'col1', - existingFields - ); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={getStringBasedOperationColumn()} incompleteOperation={'terms'} @@ -269,15 +258,13 @@ describe('FieldInput', () => { it('should render an error message for invalid fields', () => { const updateLayerSpy = jest.fn(); const layer = getLayer(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} currentFieldIsInvalid /> @@ -295,15 +282,13 @@ describe('FieldInput', () => { it('should render a help message when passed and no errors are found', () => { const updateLayerSpy = jest.fn(); const layer = getLayer(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} helpMessage={'My help message'} /> @@ -320,15 +305,13 @@ describe('FieldInput', () => { it('should prioritize errors over help messages', () => { const updateLayerSpy = jest.fn(); const layer = getLayer(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} currentFieldIsInvalid helpMessage={'My help message'} @@ -346,15 +329,13 @@ describe('FieldInput', () => { it('should update the layer on field selection', () => { const updateLayerSpy = jest.fn(); const layer = getLayer(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={getStringBasedOperationColumn()} /> @@ -372,15 +353,13 @@ describe('FieldInput', () => { it('should not trigger when the same selected field is selected again', () => { const updateLayerSpy = jest.fn(); const layer = getLayer(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={getStringBasedOperationColumn()} /> @@ -398,15 +377,13 @@ describe('FieldInput', () => { it('should prioritize incomplete fields over selected column field to display', () => { const updateLayerSpy = jest.fn(); const layer = getLayer(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} incompleteField={'dest'} selectedColumn={getStringBasedOperationColumn()} @@ -425,15 +402,13 @@ describe('FieldInput', () => { const updateLayerSpy = jest.fn(); const onDeleteColumn = jest.fn(); const layer = getLayer(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix(layer, 'col1'); const instance = mount( <FieldInput {...defaultProps} layer={layer} columnId={'col1'} updateLayer={updateLayerSpy} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} onDeleteColumn={onDeleteColumn} /> diff --git a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_input.tsx b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_input.tsx index ec471b70de614..462cd0b546f22 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_input.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_input.tsx @@ -22,7 +22,6 @@ export function FieldInput({ selectedColumn, columnId, indexPattern, - existingFields, operationSupportMatrix, updateLayer, onDeleteColumn, @@ -62,7 +61,6 @@ export function FieldInput({ <FieldSelect fieldIsInvalid={currentFieldIsInvalid} currentIndexPattern={indexPattern} - existingFields={existingFields[indexPattern.title]} operationByField={operationSupportMatrix.operationByField} selectedOperationType={ // Allows operation to be selected before creating a valid column diff --git a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_select.tsx b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_select.tsx index 52b2c128af595..012d5edb85680 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_select.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/field_select.tsx @@ -10,6 +10,7 @@ import { partition } from 'lodash'; import React, { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiComboBoxOptionOption, EuiComboBoxProps } from '@elastic/eui'; +import { useExistingFieldsReader } from '@kbn/unified-field-list-plugin/public'; import type { OperationType } from '../form_based'; import type { OperationSupportMatrix } from './operation_support'; import { @@ -18,7 +19,7 @@ import { FieldPicker, } from '../../../shared_components/field_picker'; import { fieldContainsData } from '../../../shared_components'; -import type { ExistingFieldsMap, IndexPattern } from '../../../types'; +import type { IndexPattern } from '../../../types'; import { getFieldType } from '../pure_utils'; export type FieldChoiceWithOperationType = FieldOptionValue & { @@ -33,7 +34,6 @@ export interface FieldSelectProps extends EuiComboBoxProps<EuiComboBoxOptionOpti operationByField: OperationSupportMatrix['operationByField']; onChoose: (choice: FieldChoiceWithOperationType) => void; onDeleteColumn?: () => void; - existingFields: ExistingFieldsMap[string]; fieldIsInvalid: boolean; markAllFieldsCompatible?: boolean; 'data-test-subj'?: string; @@ -47,12 +47,12 @@ export function FieldSelect({ operationByField, onChoose, onDeleteColumn, - existingFields, fieldIsInvalid, markAllFieldsCompatible, ['data-test-subj']: dataTestSub, ...rest }: FieldSelectProps) { + const { hasFieldData } = useExistingFieldsReader(); const memoizedFieldOptions = useMemo(() => { const fields = Object.keys(operationByField).sort(); @@ -67,8 +67,8 @@ export function FieldSelect({ (field) => currentIndexPattern.getFieldByName(field)?.type === 'document' ); - function containsData(field: string) { - return fieldContainsData(field, currentIndexPattern, existingFields); + function containsData(fieldName: string) { + return fieldContainsData(fieldName, currentIndexPattern, hasFieldData); } function fieldNamesToOptions(items: string[]) { @@ -145,7 +145,7 @@ export function FieldSelect({ selectedOperationType, currentIndexPattern, operationByField, - existingFields, + hasFieldData, markAllFieldsCompatible, ]); diff --git a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/reference_editor.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/reference_editor.test.tsx index d46dabf6c12f3..cb50049e3fbec 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/reference_editor.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/reference_editor.test.tsx @@ -28,6 +28,16 @@ import { import { FieldSelect } from './field_select'; import { FormBasedLayer } from '../types'; +jest.mock('@kbn/unified-field-list-plugin/public/hooks/use_existing_fields', () => ({ + useExistingFieldsReader: jest.fn(() => { + return { + hasFieldData: (dataViewId: string, fieldName: string) => { + return ['timestamp', 'bytes', 'memory', 'source'].includes(fieldName); + }, + }; + }), +})); + jest.mock('../operations'); describe('reference editor', () => { @@ -59,14 +69,6 @@ describe('reference editor', () => { paramEditorUpdater, selectionStyle: 'full' as const, currentIndexPattern: createMockedIndexPattern(), - existingFields: { - 'my-fake-index-pattern': { - timestamp: true, - bytes: true, - memory: true, - source: true, - }, - }, dateRange: { fromDate: 'now-1d', toDate: 'now' }, storage: {} as IStorageWrapper, uiSettings: {} as IUiSettingsClient, diff --git a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/reference_editor.tsx b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/reference_editor.tsx index cefee79349087..6b8ecbbfe5246 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/reference_editor.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/reference_editor.tsx @@ -29,12 +29,7 @@ import { import { FieldChoiceWithOperationType, FieldSelect } from './field_select'; import { hasField } from '../pure_utils'; import type { FormBasedLayer } from '../types'; -import type { - ExistingFieldsMap, - IndexPattern, - IndexPatternField, - ParamEditorCustomProps, -} from '../../../types'; +import type { IndexPattern, IndexPatternField, ParamEditorCustomProps } from '../../../types'; import type { FormBasedDimensionEditorProps } from './dimension_panel'; import { FormRow } from '../operations/definitions/shared_components'; @@ -83,7 +78,6 @@ export interface ReferenceEditorProps { fieldLabel?: string; operationDefinitionMap: Record<string, GenericOperationDefinition>; isInline?: boolean; - existingFields: ExistingFieldsMap; dateRange: DateRange; labelAppend?: EuiFormRowProps['labelAppend']; isFullscreen: boolean; @@ -114,7 +108,6 @@ export interface ReferenceEditorProps { export const ReferenceEditor = (props: ReferenceEditorProps) => { const { currentIndexPattern, - existingFields, validation, selectionStyle, labelAppend, @@ -307,7 +300,6 @@ export const ReferenceEditor = (props: ReferenceEditorProps) => { <FieldSelect fieldIsInvalid={showFieldInvalid || showFieldMissingInvalid} currentIndexPattern={currentIndexPattern} - existingFields={existingFields[currentIndexPattern.title]} operationByField={operationSupportMatrix.operationByField} selectedOperationType={ // Allows operation to be selected before creating a valid column diff --git a/x-pack/plugins/lens/public/datasources/form_based/field_item.tsx b/x-pack/plugins/lens/public/datasources/form_based/field_item.tsx index 5ebfecc4cc95a..e2ee0559b3808 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/field_item.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/field_item.tsx @@ -190,6 +190,9 @@ export const InnerFieldItem = function InnerFieldItem(props: FieldItemProps) { initialFocus=".lnsFieldItem__fieldPanel" className="lnsFieldItem__popoverAnchor" data-test-subj="lnsFieldListPanelField" + panelProps={{ + 'data-test-subj': 'lnsFieldListPanelFieldContent', + }} container={document.querySelector<HTMLElement>('.application') || undefined} button={ <DragDrop @@ -331,26 +334,30 @@ function FieldItemPopoverContents( field={dataViewField} data-test-subj="lnsFieldListPanel" overrideMissingContent={(params) => { - if (params?.noDataFound) { + if (params.reason === 'no-data') { // TODO: should we replace this with a default message "Analysis is not available for this field?" const isUsingSampling = core.uiSettings.get('lens:useFieldExistenceSampling'); return ( - <> - <EuiText size="s"> - {isUsingSampling - ? i18n.translate('xpack.lens.indexPattern.fieldStatsSamplingNoData', { - defaultMessage: - 'Lens is unable to create visualizations with this field because it does not contain data in the first 500 documents that match your filters. To create a visualization, drag and drop a different field.', - }) - : i18n.translate('xpack.lens.indexPattern.fieldStatsNoData', { - defaultMessage: - 'Lens is unable to create visualizations with this field because it does not contain data. To create a visualization, drag and drop a different field.', - })} - </EuiText> - </> + <EuiText size="s" data-test-subj="lnsFieldListPanel-missingFieldStats"> + {isUsingSampling + ? i18n.translate('xpack.lens.indexPattern.fieldStatsSamplingNoData', { + defaultMessage: + 'Lens is unable to create visualizations with this field because it does not contain data in the first 500 documents that match your filters. To create a visualization, drag and drop a different field.', + }) + : i18n.translate('xpack.lens.indexPattern.fieldStatsNoData', { + defaultMessage: + 'Lens is unable to create visualizations with this field because it does not contain data. To create a visualization, drag and drop a different field.', + })} + </EuiText> + ); + } + if (params.reason === 'unsupported') { + return ( + <EuiText data-test-subj="lnsFieldListPanel-missingFieldStats"> + {params.element} + </EuiText> ); } - return params.element; }} /> diff --git a/x-pack/plugins/lens/public/datasources/form_based/field_list.scss b/x-pack/plugins/lens/public/datasources/form_based/field_list.scss deleted file mode 100644 index f28581b835b07..0000000000000 --- a/x-pack/plugins/lens/public/datasources/form_based/field_list.scss +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 1. Don't cut off the shadow of the field items - */ - -.lnsIndexPatternFieldList { - @include euiOverflowShadow; - @include euiScrollBar; - margin-left: -$euiSize; /* 1 */ - position: relative; - flex-grow: 1; - overflow: auto; -} - -.lnsIndexPatternFieldList__accordionContainer { - padding-top: $euiSizeS; - position: absolute; - top: 0; - left: $euiSize; /* 1 */ - right: $euiSizeXS; /* 1 */ -} diff --git a/x-pack/plugins/lens/public/datasources/form_based/field_list.tsx b/x-pack/plugins/lens/public/datasources/form_based/field_list.tsx deleted file mode 100644 index 3c33770a62560..0000000000000 --- a/x-pack/plugins/lens/public/datasources/form_based/field_list.tsx +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import './field_list.scss'; -import { partition, throttle } from 'lodash'; -import React, { useState, Fragment, useCallback, useMemo, useEffect } from 'react'; -import { EuiSpacer } from '@elastic/eui'; -import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import { FieldItem } from './field_item'; -import { NoFieldsCallout } from './no_fields_callout'; -import { FieldItemSharedProps, FieldsAccordion } from './fields_accordion'; -import type { DatasourceDataPanelProps, IndexPatternField } from '../../types'; -const PAGINATION_SIZE = 50; - -export type FieldGroups = Record< - string, - { - fields: IndexPatternField[]; - fieldCount: number; - showInAccordion: boolean; - isInitiallyOpen: boolean; - title: string; - helpText?: string; - isAffectedByGlobalFilter: boolean; - isAffectedByTimeFilter: boolean; - hideDetails?: boolean; - defaultNoFieldsMessage?: string; - hideIfEmpty?: boolean; - } ->; - -function getDisplayedFieldsLength( - fieldGroups: FieldGroups, - accordionState: Partial<Record<string, boolean>> -) { - return Object.entries(fieldGroups) - .filter(([key]) => accordionState[key]) - .reduce((allFieldCount, [, { fields }]) => allFieldCount + fields.length, 0); -} - -export const FieldList = React.memo(function FieldList({ - exists, - fieldGroups, - existenceFetchFailed, - existenceFetchTimeout, - fieldProps, - hasSyncedExistingFields, - filter, - currentIndexPatternId, - existFieldsInIndex, - dropOntoWorkspace, - hasSuggestionForField, - editField, - removeField, - uiActions, -}: { - exists: (field: IndexPatternField) => boolean; - fieldGroups: FieldGroups; - fieldProps: FieldItemSharedProps; - hasSyncedExistingFields: boolean; - existenceFetchFailed?: boolean; - existenceFetchTimeout?: boolean; - filter: { - nameFilter: string; - typeFilter: string[]; - }; - currentIndexPatternId: string; - existFieldsInIndex: boolean; - dropOntoWorkspace: DatasourceDataPanelProps['dropOntoWorkspace']; - hasSuggestionForField: DatasourceDataPanelProps['hasSuggestionForField']; - editField?: (name: string) => void; - removeField?: (name: string) => void; - uiActions: UiActionsStart; -}) { - const [fieldGroupsToShow, fieldFroupsToCollapse] = partition( - Object.entries(fieldGroups), - ([, { showInAccordion }]) => showInAccordion - ); - const [pageSize, setPageSize] = useState(PAGINATION_SIZE); - const [scrollContainer, setScrollContainer] = useState<Element | undefined>(undefined); - const [accordionState, setAccordionState] = useState<Partial<Record<string, boolean>>>(() => - Object.fromEntries( - fieldGroupsToShow.map(([key, { isInitiallyOpen }]) => [key, isInitiallyOpen]) - ) - ); - - useEffect(() => { - // Reset the scroll if we have made material changes to the field list - if (scrollContainer) { - scrollContainer.scrollTop = 0; - setPageSize(PAGINATION_SIZE); - } - }, [filter.nameFilter, filter.typeFilter, currentIndexPatternId, scrollContainer]); - - const lazyScroll = useCallback(() => { - if (scrollContainer) { - const nearBottom = - scrollContainer.scrollTop + scrollContainer.clientHeight > - scrollContainer.scrollHeight * 0.9; - if (nearBottom) { - setPageSize( - Math.max( - PAGINATION_SIZE, - Math.min( - pageSize + PAGINATION_SIZE * 0.5, - getDisplayedFieldsLength(fieldGroups, accordionState) - ) - ) - ); - } - } - }, [scrollContainer, pageSize, setPageSize, fieldGroups, accordionState]); - - const paginatedFields = useMemo(() => { - let remainingItems = pageSize; - return Object.fromEntries( - fieldGroupsToShow.map(([key, fieldGroup]) => { - if (!accordionState[key] || remainingItems <= 0) { - return [key, []]; - } - const slicedFieldList = fieldGroup.fields.slice(0, remainingItems); - remainingItems = remainingItems - slicedFieldList.length; - return [key, slicedFieldList]; - }) - ); - }, [pageSize, fieldGroupsToShow, accordionState]); - - return ( - <div - className="lnsIndexPatternFieldList" - ref={(el) => { - if (el && !el.dataset.dynamicScroll) { - el.dataset.dynamicScroll = 'true'; - setScrollContainer(el); - } - }} - onScroll={throttle(lazyScroll, 100)} - > - <div className="lnsIndexPatternFieldList__accordionContainer"> - <ul> - {fieldFroupsToCollapse.flatMap(([, { fields }]) => - fields.map((field, index) => ( - <FieldItem - {...fieldProps} - exists={exists(field)} - field={field} - editField={editField} - removeField={removeField} - hideDetails={true} - key={field.name} - itemIndex={index} - groupIndex={0} - dropOntoWorkspace={dropOntoWorkspace} - hasSuggestionForField={hasSuggestionForField} - uiActions={uiActions} - /> - )) - )} - </ul> - <EuiSpacer size="s" /> - {fieldGroupsToShow.map(([key, fieldGroup], index) => { - if (Boolean(fieldGroup.hideIfEmpty) && !fieldGroup.fields.length) return null; - return ( - <Fragment key={key}> - <FieldsAccordion - dropOntoWorkspace={dropOntoWorkspace} - hasSuggestionForField={hasSuggestionForField} - initialIsOpen={Boolean(accordionState[key])} - key={key} - id={`lnsIndexPattern${key}`} - label={fieldGroup.title} - helpTooltip={fieldGroup.helpText} - exists={exists} - editField={editField} - removeField={removeField} - hideDetails={fieldGroup.hideDetails} - hasLoaded={!!hasSyncedExistingFields} - fieldsCount={fieldGroup.fields.length} - isFiltered={fieldGroup.fieldCount !== fieldGroup.fields.length} - paginatedFields={paginatedFields[key]} - fieldProps={fieldProps} - groupIndex={index + 1} - onToggle={(open) => { - setAccordionState((s) => ({ - ...s, - [key]: open, - })); - const displayedFieldLength = getDisplayedFieldsLength(fieldGroups, { - ...accordionState, - [key]: open, - }); - setPageSize( - Math.max(PAGINATION_SIZE, Math.min(pageSize * 1.5, displayedFieldLength)) - ); - }} - showExistenceFetchError={existenceFetchFailed} - showExistenceFetchTimeout={existenceFetchTimeout} - renderCallout={ - <NoFieldsCallout - isAffectedByGlobalFilter={fieldGroup.isAffectedByGlobalFilter} - isAffectedByTimerange={fieldGroup.isAffectedByTimeFilter} - isAffectedByFieldFilter={fieldGroup.fieldCount !== fieldGroup.fields.length} - existFieldsInIndex={!!existFieldsInIndex} - defaultNoFieldsMessage={fieldGroup.defaultNoFieldsMessage} - /> - } - uiActions={uiActions} - /> - <EuiSpacer size="m" /> - </Fragment> - ); - })} - </div> - </div> - ); -}); diff --git a/x-pack/plugins/lens/public/datasources/form_based/fields_accordion.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/fields_accordion.test.tsx deleted file mode 100644 index a471f8e0fa309..0000000000000 --- a/x-pack/plugins/lens/public/datasources/form_based/fields_accordion.test.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 from 'react'; -import { EuiLoadingSpinner, EuiNotificationBadge } from '@elastic/eui'; -import { coreMock } from '@kbn/core/public/mocks'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; -import { fieldFormatsServiceMock } from '@kbn/field-formats-plugin/public/mocks'; -import { IndexPattern } from '../../types'; -import { FieldItem } from './field_item'; -import { FieldsAccordion, FieldsAccordionProps, FieldItemSharedProps } from './fields_accordion'; -import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; -import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks'; - -describe('Fields Accordion', () => { - let defaultProps: FieldsAccordionProps; - let indexPattern: IndexPattern; - let core: ReturnType<typeof coreMock['createStart']>; - let fieldProps: FieldItemSharedProps; - - beforeEach(() => { - indexPattern = { - id: '1', - title: 'my-fake-index-pattern', - timeFieldName: 'timestamp', - fields: [ - { - name: 'timestamp', - type: 'date', - aggregatable: true, - searchable: true, - }, - { - name: 'bytes', - type: 'number', - aggregatable: true, - searchable: true, - }, - ], - } as IndexPattern; - core = coreMock.createStart(); - core.http.post.mockClear(); - - fieldProps = { - indexPattern, - fieldFormats: fieldFormatsServiceMock.createStartContract(), - core, - highlight: '', - dateRange: { - fromDate: 'now-7d', - toDate: 'now', - }, - query: { query: '', language: 'lucene' }, - filters: [], - chartsThemeService: chartPluginMock.createSetupContract().theme, - }; - - defaultProps = { - initialIsOpen: true, - onToggle: jest.fn(), - id: 'id', - label: 'label', - hasLoaded: true, - fieldsCount: 2, - isFiltered: false, - paginatedFields: indexPattern.fields, - fieldProps, - renderCallout: <div id="lens-test-callout">Callout</div>, - exists: () => true, - groupIndex: 0, - dropOntoWorkspace: () => {}, - hasSuggestionForField: () => false, - uiActions: uiActionsPluginMock.createStartContract(), - }; - }); - - it('renders correct number of Field Items', () => { - const wrapper = mountWithIntl( - <FieldsAccordion {...defaultProps} exists={(field) => field.name === 'timestamp'} /> - ); - expect(wrapper.find(FieldItem).at(0).prop('exists')).toEqual(true); - expect(wrapper.find(FieldItem).at(1).prop('exists')).toEqual(false); - }); - - it('passed correct exists flag to each field', () => { - const wrapper = mountWithIntl(<FieldsAccordion {...defaultProps} />); - expect(wrapper.find(FieldItem).length).toEqual(2); - }); - - it('renders callout if no fields', () => { - const wrapper = shallowWithIntl( - <FieldsAccordion {...defaultProps} fieldsCount={0} paginatedFields={[]} /> - ); - expect(wrapper.find('#lens-test-callout').length).toEqual(1); - }); - - it('renders accented notificationBadge state if isFiltered', () => { - const wrapper = mountWithIntl(<FieldsAccordion {...defaultProps} isFiltered={true} />); - expect(wrapper.find(EuiNotificationBadge).prop('color')).toEqual('accent'); - }); - - it('renders spinner if has not loaded', () => { - const wrapper = mountWithIntl(<FieldsAccordion {...defaultProps} hasLoaded={false} />); - expect(wrapper.find(EuiLoadingSpinner).length).toEqual(1); - }); -}); diff --git a/x-pack/plugins/lens/public/datasources/form_based/fields_accordion.tsx b/x-pack/plugins/lens/public/datasources/form_based/fields_accordion.tsx deleted file mode 100644 index 105c9583e300d..0000000000000 --- a/x-pack/plugins/lens/public/datasources/form_based/fields_accordion.tsx +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import './datapanel.scss'; -import React, { memo, useCallback, useMemo } from 'react'; -import { i18n } from '@kbn/i18n'; -import { - EuiText, - EuiNotificationBadge, - EuiSpacer, - EuiAccordion, - EuiLoadingSpinner, - EuiIconTip, -} from '@elastic/eui'; -import classNames from 'classnames'; -import { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import { Filter } from '@kbn/es-query'; -import type { Query } from '@kbn/es-query'; -import { ChartsPluginSetup } from '@kbn/charts-plugin/public'; -import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import { FieldItem } from './field_item'; -import type { DatasourceDataPanelProps, IndexPattern, IndexPatternField } from '../../types'; - -export interface FieldItemSharedProps { - core: DatasourceDataPanelProps['core']; - fieldFormats: FieldFormatsStart; - chartsThemeService: ChartsPluginSetup['theme']; - indexPattern: IndexPattern; - highlight?: string; - query: Query; - dateRange: DatasourceDataPanelProps['dateRange']; - filters: Filter[]; -} - -export interface FieldsAccordionProps { - initialIsOpen: boolean; - onToggle: (open: boolean) => void; - id: string; - label: string; - helpTooltip?: string; - hasLoaded: boolean; - fieldsCount: number; - isFiltered: boolean; - paginatedFields: IndexPatternField[]; - fieldProps: FieldItemSharedProps; - renderCallout: JSX.Element; - exists: (field: IndexPatternField) => boolean; - showExistenceFetchError?: boolean; - showExistenceFetchTimeout?: boolean; - hideDetails?: boolean; - groupIndex: number; - dropOntoWorkspace: DatasourceDataPanelProps['dropOntoWorkspace']; - hasSuggestionForField: DatasourceDataPanelProps['hasSuggestionForField']; - editField?: (name: string) => void; - removeField?: (name: string) => void; - uiActions: UiActionsStart; -} - -export const FieldsAccordion = memo(function InnerFieldsAccordion({ - initialIsOpen, - onToggle, - id, - label, - helpTooltip, - hasLoaded, - fieldsCount, - isFiltered, - paginatedFields, - fieldProps, - renderCallout, - exists, - hideDetails, - showExistenceFetchError, - showExistenceFetchTimeout, - groupIndex, - dropOntoWorkspace, - hasSuggestionForField, - editField, - removeField, - uiActions, -}: FieldsAccordionProps) { - const renderField = useCallback( - (field: IndexPatternField, index) => ( - <FieldItem - {...fieldProps} - key={field.name} - field={field} - exists={exists(field)} - hideDetails={hideDetails} - itemIndex={index} - groupIndex={groupIndex} - dropOntoWorkspace={dropOntoWorkspace} - hasSuggestionForField={hasSuggestionForField} - editField={editField} - removeField={removeField} - uiActions={uiActions} - /> - ), - [ - fieldProps, - exists, - hideDetails, - dropOntoWorkspace, - hasSuggestionForField, - groupIndex, - editField, - removeField, - uiActions, - ] - ); - - const renderButton = useMemo(() => { - const titleClassname = classNames({ - // eslint-disable-next-line @typescript-eslint/naming-convention - lnsInnerIndexPatternDataPanel__titleTooltip: !!helpTooltip, - }); - return ( - <EuiText size="xs"> - <strong className={titleClassname}>{label}</strong> - {!!helpTooltip && ( - <EuiIconTip - aria-label={helpTooltip} - type="questionInCircle" - color="subdued" - size="s" - position="right" - content={helpTooltip} - iconProps={{ - className: 'eui-alignTop', - }} - /> - )} - </EuiText> - ); - }, [label, helpTooltip]); - - const extraAction = useMemo(() => { - if (showExistenceFetchError) { - return ( - <EuiIconTip - aria-label={i18n.translate('xpack.lens.indexPattern.existenceErrorAriaLabel', { - defaultMessage: 'Existence fetch failed', - })} - type="alert" - color="warning" - content={i18n.translate('xpack.lens.indexPattern.existenceErrorLabel', { - defaultMessage: "Field information can't be loaded", - })} - /> - ); - } - if (showExistenceFetchTimeout) { - return ( - <EuiIconTip - aria-label={i18n.translate('xpack.lens.indexPattern.existenceTimeoutAriaLabel', { - defaultMessage: 'Existence fetch timed out', - })} - type="clock" - color="warning" - content={i18n.translate('xpack.lens.indexPattern.existenceTimeoutLabel', { - defaultMessage: 'Field information took too long', - })} - /> - ); - } - if (hasLoaded) { - return ( - <EuiNotificationBadge size="m" color={isFiltered ? 'accent' : 'subdued'}> - {fieldsCount} - </EuiNotificationBadge> - ); - } - - return <EuiLoadingSpinner size="m" />; - }, [showExistenceFetchError, showExistenceFetchTimeout, hasLoaded, isFiltered, fieldsCount]); - - return ( - <EuiAccordion - initialIsOpen={initialIsOpen} - onToggle={onToggle} - data-test-subj={id} - id={id} - buttonContent={renderButton} - extraAction={extraAction} - > - <EuiSpacer size="s" /> - {hasLoaded && - (!!fieldsCount ? ( - <ul className="lnsInnerIndexPatternDataPanel__fieldItems"> - {paginatedFields && paginatedFields.map(renderField)} - </ul> - ) : ( - renderCallout - ))} - </EuiAccordion> - ); -}); diff --git a/x-pack/plugins/lens/public/datasources/form_based/form_based.test.ts b/x-pack/plugins/lens/public/datasources/form_based/form_based.test.ts index 7c575241ba30b..fdaf1f51c644b 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/form_based.test.ts +++ b/x-pack/plugins/lens/public/datasources/form_based/form_based.test.ts @@ -1789,9 +1789,7 @@ describe('IndexPattern Data Source', () => { }); }); - // FLAKY: https://github.com/elastic/kibana/issues/143908 - // FLAKY: https://github.com/elastic/kibana/issues/143907 - describe.skip('#clearLayer', () => { + describe('#clearLayer', () => { it('should clear a layer', () => { const state = { layers: { @@ -1817,6 +1815,7 @@ describe('IndexPattern Data Source', () => { columnOrder: [], columns: {}, linkToLayers: ['some-layer'], + sampling: 1, }, }, }, @@ -1845,7 +1844,7 @@ describe('IndexPattern Data Source', () => { newState: { ...state, layers: { - first: state.layers.first, + first: { ...state.layers.first, linkToLayers: undefined, sampling: 1 }, }, }, }); diff --git a/x-pack/plugins/lens/public/datasources/form_based/form_based.tsx b/x-pack/plugins/lens/public/datasources/form_based/form_based.tsx index b863c69d7f7a6..95a13d46cdc53 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/form_based.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/form_based.tsx @@ -65,7 +65,7 @@ import { import { getFiltersInLayer, - getTSDBRollupWarningMessages, + getShardFailuresWarningMessages, getVisualDefaultsForLayer, isColumnInvalid, cloneLayer, @@ -89,10 +89,10 @@ import { } from './operations/layer_helpers'; import { FormBasedPrivateState, FormBasedPersistedState, DataViewDragDropOperation } from './types'; import { mergeLayer, mergeLayers } from './state_helpers'; -import { Datasource, VisualizeEditorContext } from '../../types'; +import type { Datasource, VisualizeEditorContext } from '../../types'; import { deleteColumn, isReferenced } from './operations'; import { GeoFieldWorkspacePanel } from '../../editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel'; -import { DraggingIdentifier } from '../../drag_drop'; +import type { DraggingIdentifier } from '../../drag_drop'; import { getStateTimeShiftWarningMessages } from './time_shift_utils'; import { getPrecisionErrorWarningMessages } from './utils'; import { DOCUMENT_FIELD_NAME } from '../../../common/constants'; @@ -897,8 +897,8 @@ export function getFormBasedDatasource({ ), ]; }, - getSearchWarningMessages: (state, warning) => { - return [...getTSDBRollupWarningMessages(state, warning)]; + getSearchWarningMessages: (state, warning, request, response) => { + return [...getShardFailuresWarningMessages(state, warning, request, response, core.theme)]; }, getDeprecationMessages: () => { const deprecatedMessages: React.ReactNode[] = []; diff --git a/x-pack/plugins/lens/public/datasources/form_based/layer_settings.tsx b/x-pack/plugins/lens/public/datasources/form_based/layer_settings.tsx index 7d02ac98f23a4..ec161ef996737 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/layer_settings.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/layer_settings.tsx @@ -5,9 +5,20 @@ * 2.0. */ -import { EuiFormRow, EuiRange, EuiBetaBadge } from '@elastic/eui'; +import { + EuiFormRow, + EuiRange, + EuiFlexGroup, + EuiFlexItem, + EuiBetaBadge, + EuiText, + EuiLink, + EuiSpacer, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { css } from '@emotion/react'; import React from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { DatasourceLayerSettingsProps } from '../../types'; import type { FormBasedPrivateState } from './types'; @@ -22,54 +33,95 @@ export function LayerSettingsPanel({ const currentSamplingIndex = samplingIndex > -1 ? samplingIndex : samplingValue.length - 1; return ( <EuiFormRow - display="columnCompressed" + display="rowCompressed" data-test-subj="lns-indexPattern-random-sampling-row" fullWidth - helpText={i18n.translate('xpack.lens.xyChart.randomSampling.help', { - defaultMessage: 'Change the sampling probability to see how your chart is affected', - })} + helpText={ + <> + <EuiSpacer size="s" /> + <p> + <FormattedMessage + id="xpack.lens.xyChart.randomSampling.help" + defaultMessage="Lower sampling percentages increase speed at the cost of accuracy. It is recommended that lower sampling percentages only be used for large datasets. {link}" + values={{ + link: ( + <EuiLink + href="https://www.elastic.co/guide/en/elasticsearch/reference/master/search-aggregations-random-sampler-aggregation.html" + target="_blank" + external + > + <FormattedMessage + id="xpack.lens.xyChart.randomSampling.learnMore" + defaultMessage="View documentation" + /> + </EuiLink> + ), + }} + /> + </p> + </> + } label={ <> {i18n.translate('xpack.lens.xyChart.randomSampling.label', { - defaultMessage: 'Sampling', + defaultMessage: 'Random sampling', })}{' '} <EuiBetaBadge + css={css` + vertical-align: middle; + `} + iconType="beaker" label={i18n.translate('xpack.lens.randomSampling.experimentalLabel', { defaultMessage: 'Technical preview', })} - color="hollow" - iconType="beaker" size="s" - tooltipContent={i18n.translate('xpack.lens.randomSampling.experimentalLabel', { - defaultMessage: 'Technical preview', - })} /> </> } > - <EuiRange - data-test-subj="lns-indexPattern-random-sampling" - value={currentSamplingIndex} - onChange={(e) => { - setState({ - ...state, - layers: { - ...state.layers, - [layerId]: { - ...state.layers[layerId], - sampling: samplingValue[Number(e.currentTarget.value)], - }, - }, - }); - }} - showInput={false} - showRange={false} - showTicks - step={1} - min={0} - max={samplingValue.length - 1} - ticks={samplingValue.map((v, i) => ({ label: `${v}`, value: i }))} - /> + <EuiFlexGroup gutterSize="none"> + <EuiFlexItem grow={false}> + <EuiText color="subdued" size="xs"> + <FormattedMessage + id="xpack.lens.xyChart.randomSampling.speedLabel" + defaultMessage="Speed" + /> + </EuiText> + </EuiFlexItem> + <EuiFlexItem> + <EuiRange + data-test-subj="lns-indexPattern-random-sampling" + value={currentSamplingIndex} + onChange={(e) => { + setState({ + ...state, + layers: { + ...state.layers, + [layerId]: { + ...state.layers[layerId], + sampling: samplingValue[Number(e.currentTarget.value)], + }, + }, + }); + }} + showInput={false} + showRange={false} + showTicks + step={1} + min={0} + max={samplingValue.length - 1} + ticks={samplingValue.map((v, i) => ({ label: `${v * 100}%`, value: i }))} + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText color="subdued" size="xs"> + <FormattedMessage + id="xpack.lens.xyChart.randomSampling.accuracyLabel" + defaultMessage="Accuracy" + /> + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> </EuiFormRow> ); } diff --git a/x-pack/plugins/lens/public/datasources/form_based/layerpanel.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/layerpanel.test.tsx index defc505f1d9e1..86fd5490f383b 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/layerpanel.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/layerpanel.test.tsx @@ -181,8 +181,6 @@ describe('Layer Data Panel', () => { { id: '2', title: 'my-fake-restricted-pattern' }, { id: '3', title: 'my-compatible-pattern' }, ], - existingFields: {}, - isFirstExistenceFetch: false, indexPatterns: { '1': { id: '1', diff --git a/x-pack/plugins/lens/public/datasources/form_based/layerpanel.tsx b/x-pack/plugins/lens/public/datasources/form_based/layerpanel.tsx index c18b79b28c58c..349139cd41b27 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/layerpanel.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/layerpanel.tsx @@ -29,6 +29,13 @@ export function LayerPanel({ const notFoundTitleLabel = i18n.translate('xpack.lens.layerPanel.missingDataView', { defaultMessage: 'Data view not found', }); + const indexPatternRefs = dataViews.indexPatternRefs.map((ref) => { + const isPersisted = dataViews.indexPatterns[ref.id]?.isPersisted ?? true; + return { + ...ref, + isAdhoc: !isPersisted, + }; + }); return ( <I18nProvider> <ChangeIndexPattern @@ -41,7 +48,7 @@ export function LayerPanel({ fontWeight: 'normal', }} indexPatternId={layer.indexPatternId} - indexPatternRefs={dataViews.indexPatternRefs} + indexPatternRefs={indexPatternRefs} isMissingCurrent={!indexPattern} onChangeIndexPattern={onChangeIndexPattern} /> diff --git a/x-pack/plugins/lens/public/datasources/form_based/no_fields_callout.tsx b/x-pack/plugins/lens/public/datasources/form_based/no_fields_callout.tsx deleted file mode 100644 index 073b21c700ccc..0000000000000 --- a/x-pack/plugins/lens/public/datasources/form_based/no_fields_callout.tsx +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { EuiCallOut } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; - -const defaultNoFieldsMessageCopy = i18n.translate('xpack.lens.indexPatterns.noDataLabel', { - defaultMessage: 'There are no fields.', -}); - -export const NoFieldsCallout = ({ - existFieldsInIndex, - defaultNoFieldsMessage = defaultNoFieldsMessageCopy, - isAffectedByFieldFilter = false, - isAffectedByTimerange = false, - isAffectedByGlobalFilter = false, -}: { - existFieldsInIndex: boolean; - isAffectedByFieldFilter?: boolean; - defaultNoFieldsMessage?: string; - isAffectedByTimerange?: boolean; - isAffectedByGlobalFilter?: boolean; -}) => { - if (!existFieldsInIndex) { - return ( - <EuiCallOut - size="s" - color="warning" - title={i18n.translate('xpack.lens.indexPatterns.noFieldsLabel', { - defaultMessage: 'No fields exist in this data view.', - })} - /> - ); - } - - return ( - <EuiCallOut - size="s" - color="warning" - title={ - isAffectedByFieldFilter - ? i18n.translate('xpack.lens.indexPatterns.noFilteredFieldsLabel', { - defaultMessage: 'No fields match the selected filters.', - }) - : defaultNoFieldsMessage - } - > - {(isAffectedByTimerange || isAffectedByFieldFilter || isAffectedByGlobalFilter) && ( - <> - <strong> - {i18n.translate('xpack.lens.indexPatterns.noFields.tryText', { - defaultMessage: 'Try:', - })} - </strong> - <ul> - {isAffectedByTimerange && ( - <li> - {i18n.translate('xpack.lens.indexPatterns.noFields.extendTimeBullet', { - defaultMessage: 'Extending the time range', - })} - </li> - )} - {isAffectedByFieldFilter && ( - <li> - {i18n.translate('xpack.lens.indexPatterns.noFields.fieldTypeFilterBullet', { - defaultMessage: 'Using different field filters', - })} - </li> - )} - {isAffectedByGlobalFilter && ( - <li> - {i18n.translate('xpack.lens.indexPatterns.noFields.globalFiltersBullet', { - defaultMessage: 'Changing the global filters', - })} - </li> - )} - </ul> - </> - )} - </EuiCallOut> - ); -}; diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/count.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/count.tsx index 0d292b7a3a26e..60c1a0cdf0f5d 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/count.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/count.tsx @@ -235,7 +235,7 @@ export const countOperation: OperationDefinition<CountIndexPatternColumn, 'field }), description: i18n.translate('xpack.lens.indexPattern.count.documentation.markdown', { defaultMessage: ` -The total number of documents. When you provide a field as the first argument, the total number of field values is counted. Use the count function for fields that have multiple values in a single document. +The total number of documents. When you provide a field, the total number of field values is counted. When you use the Count function for fields that have multiple values in a single document, all values are counted. #### Examples @@ -249,7 +249,7 @@ To calculate the number of documents that match a specific filter, use \`count(k }, quickFunctionDocumentation: i18n.translate('xpack.lens.indexPattern.count.documentation.quick', { defaultMessage: ` -The total number of documents. When you provide a field, the total number of field values is counted. Use the count function for fields that have multiple values in a single document. +The total number of documents. When you provide a field, the total number of field values is counted. When you use the Count function for fields that have multiple values in a single document, all values are counted. `, }), shiftable: true, diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/date_histogram.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/date_histogram.test.tsx index c08f8703c723f..d9510256eb92d 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/date_histogram.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/date_histogram.test.tsx @@ -113,14 +113,6 @@ const defaultOptions = { isFullscreen: false, toggleFullscreen: jest.fn(), setIsCloseable: jest.fn(), - existingFields: { - my_index_pattern: { - timestamp: true, - bytes: true, - memory: true, - source: true, - }, - }, }; describe('date_histogram', () => { diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filters.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filters.test.tsx index 2264fa8f185fb..e5199a5295ec6 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filters.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filters.test.tsx @@ -38,14 +38,6 @@ const defaultProps = { toggleFullscreen: jest.fn(), setIsCloseable: jest.fn(), layerId: '1', - existingFields: { - my_index_pattern: { - timestamp: true, - bytes: true, - memory: true, - source: true, - }, - }, }; // mocking random id generator function diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_completion.test.ts b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_completion.test.ts index 76b70ba9a471c..d2237bea0f39e 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_completion.test.ts +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_completion.test.ts @@ -353,7 +353,7 @@ describe('math completion', () => { expect(results.list).toEqual(['bytes', 'memory']); }); - it('should autocomplete only operations that provide numeric output', async () => { + it('should autocomplete only operations that provide numeric or date output', async () => { const results = await suggest({ expression: 'last_value()', zeroIndexedOffset: 11, @@ -366,7 +366,7 @@ describe('math completion', () => { unifiedSearch: unifiedSearchPluginMock.createStartContract(), dataViews: dataViewPluginMocks.createStartContract(), }); - expect(results.list).toEqual(['bytes', 'memory']); + expect(results.list).toEqual(['bytes', 'memory', 'timestamp', 'start_date']); }); }); diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_completion.ts b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_completion.ts index 8d0c9fd4d6b6b..de23e8c4f1bbe 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_completion.ts +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_completion.ts @@ -306,12 +306,14 @@ function getArgumentSuggestions( operationDefinitionMap ); // TODO: This only allow numeric functions, will reject last_value(string) for example. - const validOperation = available.find( + const validOperation = available.filter( ({ operationMetaData }) => - operationMetaData.dataType === 'number' && !operationMetaData.isBucketed + (operationMetaData.dataType === 'number' || operationMetaData.dataType === 'date') && + !operationMetaData.isBucketed ); - if (validOperation) { - const fields = validOperation.operations + if (validOperation.length) { + const fields = validOperation + .flatMap((op) => op.operations) .filter((op) => op.operationType === operation.type) .map((op) => ('field' in op ? op.field : undefined)) .filter(nonNullable); diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_tokenization.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_tokenization.tsx index 17394560f8031..275a540b3c4d8 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_tokenization.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_tokenization.tsx @@ -62,5 +62,7 @@ export const lexerRules = { }, } as monaco.languages.IMonarchLanguage; -monaco.languages.setMonarchTokensProvider(LANGUAGE_ID, lexerRules); -monaco.languages.setLanguageConfiguration(LANGUAGE_ID, languageConfiguration); +monaco.languages.onLanguage(LANGUAGE_ID, () => { + monaco.languages.setMonarchTokensProvider(LANGUAGE_ID, lexerRules); + monaco.languages.setLanguageConfiguration(LANGUAGE_ID, languageConfiguration); +}); diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula.test.tsx index 90ece71627f42..0925b5cbcb0d2 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula.test.tsx @@ -157,7 +157,7 @@ describe('formula', () => { formulaOperation.buildColumn({ previousColumn: { ...layer.columns.col1, - dataType: 'date', + dataType: 'boolean', filter: { language: 'kuery', query: 'ABC: DEF' }, }, layer, diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula.tsx index 9746a25ebf907..577b68b98675d 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula.tsx @@ -139,6 +139,11 @@ export const formulaOperation: OperationDefinition<FormulaIndexPatternColumn, 'm arguments: { id: [columnId], name: [label || defaultLabel], + ...(currentColumn.references.length + ? { + castColumns: [currentColumn.references[0]], + } + : {}), expression: [currentColumn.references.length ? `"${currentColumn.references[0]}"` : ''], }, }, diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.test.ts b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.test.ts index 4c1ba662d1861..a80c039064afd 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.test.ts +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.test.ts @@ -103,4 +103,54 @@ describe('createFormulaPublicApi', () => { { indexPattern: {} } ); }); + + test('should pass over advanced parameters as global params for formula', () => { + const baseLayer = getBaseLayer(); + + publicApiHelper.insertOrReplaceFormulaColumn( + 'col', + { + formula: 'count()', + timeScale: 'd', + filter: { query: 'myField: *', language: 'kuery' }, + reducedTimeRange: '30s', + }, + baseLayer, + dataView + ); + + expect(insertOrReplaceFormulaColumn).toHaveBeenCalledWith( + 'col', + { + customLabel: false, + dataType: 'number', + isBucketed: false, + label: 'count()', + operationType: 'formula', + params: { formula: 'count()', format: undefined }, + filter: { + language: 'kuery', + query: 'myField: *', + }, + timeScale: 'd', + reducedTimeRange: '30s', + references: [], + }, + { + columnOrder: ['col1'], + columns: { + col1: { + dataType: 'date', + isBucketed: true, + label: '@timestamp', + operationType: 'date_histogram', + params: { interval: 'auto' }, + scale: 'interval', + }, + }, + indexPatternId: undefined, + }, + { indexPattern: {} } + ); + }); }); diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.ts b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.ts index ab17fd81e84ef..56469d61ad8f3 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.ts +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula_public_api.ts @@ -10,6 +10,7 @@ import { Query } from '@kbn/es-query'; import { convertDataViewIntoLensIndexPattern } from '../../../../../data_views_service/loader'; import type { IndexPattern } from '../../../../../types'; import type { PersistedIndexPatternLayer } from '../../../types'; +import type { TimeScaleUnit } from '../../../../../../common/expressions'; import { insertOrReplaceFormulaColumn } from './parse'; @@ -33,6 +34,8 @@ export interface FormulaPublicApi { formula: string; label?: string; filter?: Query; + reducedTimeRange?: string; + timeScale?: TimeScaleUnit; format?: { id: string; params?: { @@ -60,7 +63,12 @@ export const createFormulaPublicApi = (): FormulaPublicApi => { }; return { - insertOrReplaceFormulaColumn: (id, { formula, label, format, filter }, layer, dataView) => { + insertOrReplaceFormulaColumn: ( + id, + { formula, label, format, filter, reducedTimeRange, timeScale }, + layer, + dataView + ) => { const indexPattern = getCachedLensIndexPattern(dataView); return insertOrReplaceFormulaColumn( @@ -73,6 +81,8 @@ export const createFormulaPublicApi = (): FormulaPublicApi => { references: [], isBucketed: false, filter, + reducedTimeRange, + timeScale, params: { formula, format, diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/generate.ts b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/generate.ts index 2315d6d164fc8..d860cd11fd594 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/generate.ts +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/generate.ts @@ -54,7 +54,11 @@ export function generateFormula( previousFormula += `${previousColumn.operationType}(${metric.operationType}(${fieldName})`; } } else { - if (previousColumn && 'sourceField' in previousColumn && previousColumn.dataType === 'number') { + if ( + previousColumn && + 'sourceField' in previousColumn && + (previousColumn.dataType === 'number' || previousColumn.dataType === 'date') + ) { previousFormula += `${previousColumn.operationType}(${getSafeFieldName(previousColumn)}`; } else { // couldn't find formula function to call, exit early because adding args is going to fail anyway diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/math.test.ts b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/math.test.ts index c96bff33b5267..5ca43cb125cc8 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/math.test.ts +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/math.test.ts @@ -163,6 +163,7 @@ describe('math operation', () => { arguments: { id: ['myColumnId'], name: ['Math'], + castColumns: [], expression: [ '(((((((((((((((("columnX0" + "columnX1") + "columnX2") + "columnX3") + "columnX4") + "columnX5") + "columnX6") + "columnX7") + "columnX8") + "columnX9") + "columnX10") + "columnX11") + "columnX12") + "columnX13") + "columnX14") + "columnX15") + "columnX16")', ], @@ -243,6 +244,7 @@ describe('math operation', () => { arguments: { id: ['myColumnId'], name: ['Math'], + castColumns: [], expression: [ `("columnX0" + (("columnX1" - "columnX2") / ("columnX3" - ("columnX4" * "columnX5"))))`, ], @@ -298,6 +300,7 @@ describe('math operation', () => { arguments: { id: ['myColumnId'], name: ['Math'], + castColumns: [], expression: [`max(min("columnX0","columnX1"),abs("columnX2"))`], onError: ['null'], }, @@ -342,6 +345,7 @@ describe('math operation', () => { arguments: { id: ['myColumnId'], name: ['Math'], + castColumns: [], expression: [`(5 + (3 / 8))`], onError: ['null'], }, @@ -425,6 +429,7 @@ describe('math operation', () => { arguments: { id: ['myColumnId'], name: ['Math'], + castColumns: [], expression: [ 'ifelse(("columnX0" == 0),ifelse(("columnX1" < 0),ifelse(("columnX2" <= 0),"columnX3","columnX4"),"columnX5"),ifelse(("columnX6" > 0),ifelse(("columnX7" >= 0),"columnX8","columnX9"),"columnX10"))', ], diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/math.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/math.tsx index 4215d727a4c42..4f396cb8ccf5a 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/math.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/math.tsx @@ -46,6 +46,8 @@ export const mathOperation: OperationDefinition<MathIndexPatternColumn, 'managed name: [column.label], expression: [astToString(column.params.tinymathAst)], onError: ['null'], + // cast everything into number + castColumns: column.references, }, }, ]; diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/index.ts b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/index.ts index 5253267b286cd..1ed621b19b8bd 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/index.ts +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/index.ts @@ -198,7 +198,6 @@ export interface ParamEditorProps< activeData?: FormBasedDimensionEditorProps['activeData']; operationDefinitionMap: Record<string, GenericOperationDefinition>; paramEditorCustomProps?: ParamEditorCustomProps; - existingFields: Record<string, Record<string, boolean>>; isReferenced?: boolean; } @@ -215,10 +214,6 @@ export interface FieldInputProps<C> { incompleteParams: Omit<IncompleteColumn, 'sourceField' | 'operationType'>; dimensionGroups: FormBasedDimensionEditorProps['dimensionGroups']; groupId: FormBasedDimensionEditorProps['groupId']; - /** - * indexPatternId -> fieldName -> boolean - */ - existingFields: Record<string, Record<string, boolean>>; operationSupportMatrix: OperationSupportMatrix; helpMessage?: React.ReactNode; operationDefinitionMap: Record<string, GenericOperationDefinition>; diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/last_value.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/last_value.test.tsx index 16c6f2727ea50..104f6da48041f 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/last_value.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/last_value.test.tsx @@ -44,14 +44,6 @@ const defaultProps = { toggleFullscreen: jest.fn(), setIsCloseable: jest.fn(), layerId: '1', - existingFields: { - my_index_pattern: { - timestamp: true, - bytes: true, - memory: true, - source: true, - }, - }, }; describe('last_value', () => { @@ -327,7 +319,7 @@ describe('last_value', () => { ).toEqual({ dataType: 'ip', isBucketed: false, - scale: 'ratio', + scale: 'ordinal', }); }); diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/last_value.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/last_value.tsx index 59b77cd73fc9d..698cdba8da13e 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/last_value.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/last_value.tsx @@ -124,6 +124,16 @@ function getExistsFilter(field: string) { }; } +function getScale(type: string) { + return type === 'string' || + type === 'ip' || + type === 'ip_range' || + type === 'date_range' || + type === 'number_range' + ? 'ordinal' + : 'ratio'; +} + export const lastValueOperation: OperationDefinition< LastValueIndexPatternColumn, 'field', @@ -155,7 +165,7 @@ export const lastValueOperation: OperationDefinition< label: ofName(field.displayName, oldColumn.timeShift, oldColumn.reducedTimeRange), sourceField: field.name, params: newParams, - scale: field.type === 'string' ? 'ordinal' : 'ratio', + scale: getScale(field.type), filter: oldColumn.filter && isEqual(oldColumn.filter, getExistsFilter(oldColumn.sourceField)) ? getExistsFilter(field.name) @@ -167,7 +177,7 @@ export const lastValueOperation: OperationDefinition< return { dataType: type as DataType, isBucketed: false, - scale: type === 'string' ? 'ordinal' : 'ratio', + scale: getScale(type), }; } }, @@ -218,7 +228,7 @@ export const lastValueOperation: OperationDefinition< dataType: field.type as DataType, operationType: 'last_value', isBucketed: false, - scale: field.type === 'string' ? 'ordinal' : 'ratio', + scale: getScale(field.type), sourceField: field.name, filter: getFilter(previousColumn, columnParams) || getExistsFilter(field.name), timeShift: columnParams?.shift || previousColumn?.timeShift, diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/metrics.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/metrics.tsx index e8c8c54c1cefe..bb15831a31854 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/metrics.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/metrics.tsx @@ -318,7 +318,7 @@ export const averageOperation = buildMetricOperation<AvgIndexPatternColumn>({ quickFunctionDocumentation: i18n.translate( 'xpack.lens.indexPattern.avg.quickFunctionDescription', { - defaultMessage: 'The average value of a number field.', + defaultMessage: 'The mean value of a set of number fields.', } ), }); diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/percentile.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/percentile.test.tsx index e78ac9e9360da..59d8602d7c275 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/percentile.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/percentile.test.tsx @@ -60,14 +60,6 @@ const defaultProps = { toggleFullscreen: jest.fn(), setIsCloseable: jest.fn(), layerId: '1', - existingFields: { - my_index_pattern: { - timestamp: true, - bytes: true, - memory: true, - source: true, - }, - }, }; describe('percentile', () => { diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/percentile_ranks.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/percentile_ranks.test.tsx index adb0d8e491fd7..c29e5ca2c1499 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/percentile_ranks.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/percentile_ranks.test.tsx @@ -53,14 +53,6 @@ const defaultProps = { toggleFullscreen: jest.fn(), setIsCloseable: jest.fn(), layerId: '1', - existingFields: { - my_index_pattern: { - timestamp: true, - bytes: true, - memory: true, - source: true, - }, - }, }; describe('percentile ranks', () => { diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/ranges/ranges.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/ranges/ranges.test.tsx index d0dd9f6458612..e5a870985d2c0 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/ranges/ranges.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/ranges/ranges.test.tsx @@ -86,14 +86,6 @@ const defaultOptions = { storage: {} as IStorageWrapper, uiSettings: uiSettingsMock, savedObjectsClient: {} as SavedObjectsClientContract, - existingFields: { - my_index_pattern: { - timestamp: true, - bytes: true, - memory: true, - source: true, - }, - }, dateRange: { fromDate: 'now-1y', toDate: 'now', @@ -187,7 +179,7 @@ describe('ranges', () => { } beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); beforeEach(() => { diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/static_value.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/static_value.test.tsx index 0ed6a60677f73..6d79d19f44a53 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/static_value.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/static_value.test.tsx @@ -52,14 +52,6 @@ const defaultProps = { toggleFullscreen: jest.fn(), setIsCloseable: jest.fn(), layerId: '1', - existingFields: { - my_index_pattern: { - timestamp: true, - bytes: true, - memory: true, - source: true, - }, - }, }; describe('static_value', () => { diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/field_inputs.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/field_inputs.tsx index 17b0e5e475ffd..b7f24e7d3d9c1 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/field_inputs.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/field_inputs.tsx @@ -8,7 +8,7 @@ import React, { useCallback, useMemo } from 'react'; import { htmlIdGenerator } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { ExistingFieldsMap, IndexPattern } from '../../../../../types'; +import { IndexPattern } from '../../../../../types'; import { DragDropBuckets, FieldsBucketContainer, @@ -27,7 +27,6 @@ export const MAX_MULTI_FIELDS_SIZE = 3; export interface FieldInputsProps { column: TermsIndexPatternColumn; indexPattern: IndexPattern; - existingFields: ExistingFieldsMap; invalidFields?: string[]; operationSupportMatrix: Pick<OperationSupportMatrix, 'operationByField'>; onChange: (newValues: string[]) => void; @@ -49,7 +48,6 @@ export function FieldInputs({ column, onChange, indexPattern, - existingFields, operationSupportMatrix, invalidFields, }: FieldInputsProps) { @@ -153,7 +151,6 @@ export function FieldInputs({ <FieldSelect fieldIsInvalid={shouldShowError} currentIndexPattern={indexPattern} - existingFields={existingFields[indexPattern.title]} operationByField={filteredOperationByField} selectedOperationType={column.operationType} selectedField={value} diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/index.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/index.tsx index 57e0688363eed..7400f3cc19c44 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/index.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/index.tsx @@ -426,7 +426,6 @@ export const termsOperation: OperationDefinition< selectedColumn, columnId, indexPattern, - existingFields, operationSupportMatrix, updateLayer, dimensionGroups, @@ -549,7 +548,6 @@ export const termsOperation: OperationDefinition< <FieldInputs column={selectedColumn} indexPattern={indexPattern} - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} onChange={onFieldSelectChange} invalidFields={invalidFields} @@ -568,7 +566,6 @@ The top values of a specified field ranked by the chosen metric. currentColumn, columnId, indexPattern, - existingFields, operationDefinitionMap, ReferenceEditor, paramEditorCustomProps, @@ -808,7 +805,6 @@ The top values of a specified field ranked by the chosen metric. }} column={currentColumn.params.orderAgg} incompleteColumn={incompleteColumn} - existingFields={existingFields} onDeleteColumn={() => { throw new Error('Should not be called'); }} diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/terms.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/terms.test.tsx index 58f2f479f401a..d7a8770111080 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/terms.test.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/terms/terms.test.tsx @@ -50,6 +50,16 @@ jest.mock('@kbn/unified-field-list-plugin/public/services/field_stats', () => ({ }), })); +jest.mock('@kbn/unified-field-list-plugin/public/hooks/use_existing_fields', () => ({ + useExistingFieldsReader: jest.fn(() => { + return { + hasFieldData: (dataViewId: string, fieldName: string) => { + return ['timestamp', 'bytes', 'memory', 'source'].includes(fieldName); + }, + }; + }), +})); + // mocking random id generator function jest.mock('@elastic/eui', () => { const original = jest.requireActual('@elastic/eui'); @@ -93,14 +103,6 @@ const defaultProps = { setIsCloseable: jest.fn(), layerId: '1', ReferenceEditor, - existingFields: { - 'my-fake-index-pattern': { - timestamp: true, - bytes: true, - memory: true, - source: true, - }, - }, }; describe('terms', () => { @@ -1170,20 +1172,7 @@ describe('terms', () => { >, }; - function getExistingFields() { - const fields: Record<string, boolean> = {}; - for (const field of defaultProps.indexPattern.fields) { - fields[field.name] = true; - } - return { - [defaultProps.indexPattern.title]: fields, - }; - } - - function getDefaultOperationSupportMatrix( - columnId: string, - existingFields: Record<string, Record<string, boolean>> - ) { + function getDefaultOperationSupportMatrix(columnId: string) { return getOperationSupportMatrix({ state: { layers: { layer1: layer }, @@ -1199,15 +1188,13 @@ describe('terms', () => { it('should render the default field input for no field (incomplete operation)', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); const instance = mount( <InlineFieldInput {...defaultFieldInputProps} layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} incompleteOperation="terms" /> @@ -1226,8 +1213,7 @@ describe('terms', () => { it('should show an error message when first field is invalid', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); layer.columns.col1 = { label: 'Top value of unsupported', @@ -1247,7 +1233,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} currentFieldIsInvalid /> @@ -1259,8 +1244,7 @@ describe('terms', () => { it('should show an error message when first field is not supported', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); layer.columns.col1 = { label: 'Top value of timestamp', @@ -1280,7 +1264,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} incompleteOperation="terms" @@ -1293,8 +1276,7 @@ describe('terms', () => { it('should show an error message when any field but the first is invalid', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); layer.columns.col1 = { label: 'Top value of geo.src + 1 other', @@ -1315,7 +1297,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1327,8 +1308,7 @@ describe('terms', () => { it('should show an error message when any field but the first is not supported', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); layer.columns.col1 = { label: 'Top value of geo.src + 1 other', @@ -1349,7 +1329,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1361,15 +1340,13 @@ describe('terms', () => { it('should render the an add button for single layer and disabled the remove button', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); const instance = mount( <InlineFieldInput {...defaultFieldInputProps} layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1392,15 +1369,13 @@ describe('terms', () => { it('should switch to the first supported operation when in single term mode and the picked field is not supported', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); const instance = mount( <InlineFieldInput {...defaultFieldInputProps} layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1426,8 +1401,7 @@ describe('terms', () => { it('should render the multi terms specific UI', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); (layer.columns.col1 as TermsIndexPatternColumn).params.secondaryFields = ['bytes']; const instance = mount( @@ -1436,7 +1410,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1457,8 +1430,7 @@ describe('terms', () => { it('should return to single value UI when removing second item of two', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); (layer.columns.col1 as TermsIndexPatternColumn).params.secondaryFields = ['memory']; const instance = mount( @@ -1467,7 +1439,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1489,8 +1460,7 @@ describe('terms', () => { it('should disable remove button and reorder drag when single value and one temporary new field', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); let instance = mount( <InlineFieldInput @@ -1498,7 +1468,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1532,8 +1501,7 @@ describe('terms', () => { it('should accept scripted fields for single value', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); (layer.columns.col1 as TermsIndexPatternColumn).sourceField = 'scripted'; const instance = mount( @@ -1542,7 +1510,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1558,8 +1525,7 @@ describe('terms', () => { it('should mark scripted fields for multiple values', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); (layer.columns.col1 as TermsIndexPatternColumn).sourceField = 'scripted'; (layer.columns.col1 as TermsIndexPatternColumn).params.secondaryFields = ['memory']; @@ -1569,7 +1535,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1588,8 +1553,7 @@ describe('terms', () => { it('should not filter scripted fields when in single value', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); const instance = mount( <InlineFieldInput @@ -1597,7 +1561,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1618,8 +1581,7 @@ describe('terms', () => { it('should filter scripted fields when in multi terms mode', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); (layer.columns.col1 as TermsIndexPatternColumn).params.secondaryFields = ['memory']; const instance = mount( @@ -1628,7 +1590,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1650,8 +1611,7 @@ describe('terms', () => { it('should filter already used fields when displaying fields list', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); (layer.columns.col1 as TermsIndexPatternColumn).params.secondaryFields = ['memory', 'bytes']; let instance = mount( @@ -1660,7 +1620,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1690,8 +1649,7 @@ describe('terms', () => { it('should filter fields with unsupported types when in multi terms mode', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); (layer.columns.col1 as TermsIndexPatternColumn).params.secondaryFields = ['memory']; const instance = mount( @@ -1700,7 +1658,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1722,8 +1679,7 @@ describe('terms', () => { it('should limit the number of multiple fields', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); (layer.columns.col1 as TermsIndexPatternColumn).params.secondaryFields = [ 'memory', @@ -1736,7 +1692,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1757,8 +1712,7 @@ describe('terms', () => { it('should let the user add new empty field up to the limit', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); let instance = mount( <InlineFieldInput @@ -1766,7 +1720,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1793,8 +1746,7 @@ describe('terms', () => { it('should update the parentFormatter on transition between single to multi terms', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); let instance = mount( <InlineFieldInput @@ -1802,7 +1754,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> @@ -1834,8 +1785,7 @@ describe('terms', () => { it('should preserve custom label when set by the user', () => { const updateLayerSpy = jest.fn(); - const existingFields = getExistingFields(); - const operationSupportMatrix = getDefaultOperationSupportMatrix('col1', existingFields); + const operationSupportMatrix = getDefaultOperationSupportMatrix('col1'); layer.columns.col1 = { label: 'MyCustomLabel', @@ -1857,7 +1807,6 @@ describe('terms', () => { layer={layer} updateLayer={updateLayerSpy} columnId="col1" - existingFields={existingFields} operationSupportMatrix={operationSupportMatrix} selectedColumn={layer.columns.col1 as TermsIndexPatternColumn} /> diff --git a/x-pack/plugins/lens/public/datasources/form_based/utils.tsx b/x-pack/plugins/lens/public/datasources/form_based/utils.tsx index dfec3c723d189..bf72776fe42a7 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/utils.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/utils.tsx @@ -8,15 +8,23 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { DocLinksStart } from '@kbn/core/public'; +import type { DocLinksStart, ThemeServiceStart } from '@kbn/core/public'; import type { DatatableUtilitiesService } from '@kbn/data-plugin/common'; import { TimeRange } from '@kbn/es-query'; -import { EuiLink, EuiTextColor, EuiButton, EuiSpacer } from '@elastic/eui'; +import { EuiLink, EuiTextColor, EuiButton, EuiSpacer, EuiText } from '@elastic/eui'; import type { DatatableColumn } from '@kbn/expressions-plugin/common'; import { groupBy, escape, uniq } from 'lodash'; import type { Query } from '@kbn/data-plugin/common'; -import { SearchResponseWarning } from '@kbn/data-plugin/public/search/types'; +import { SearchRequest } from '@kbn/data-plugin/common'; + +import { + SearchResponseWarning, + ShardFailureOpenModalButton, + ShardFailureRequest, +} from '@kbn/data-plugin/public'; + +import { estypes } from '@elastic/elasticsearch'; import type { FramePublicAPI, IndexPattern, StateSetter } from '../../types'; import { renewIDs } from '../../utils'; import type { FormBasedLayer, FormBasedPersistedState, FormBasedPrivateState } from './types'; @@ -162,43 +170,67 @@ const accuracyModeEnabledWarning = (columnName: string, docLink: string) => ( /> ); -export function getTSDBRollupWarningMessages( +export function getShardFailuresWarningMessages( state: FormBasedPersistedState, - warning: SearchResponseWarning -) { + warning: SearchResponseWarning, + request: SearchRequest, + response: estypes.SearchResponse, + theme: ThemeServiceStart +): Array<string | React.ReactNode> { if (state) { - const hasTSDBRollupWarnings = - warning.type === 'shard_failure' && - warning.reason.type === 'unsupported_aggregation_on_downsampled_index'; - if (!hasTSDBRollupWarnings) { - return []; + if (warning.type === 'shard_failure') { + switch (warning.reason.type) { + case 'unsupported_aggregation_on_downsampled_index': + return Object.values(state.layers).flatMap((layer) => + uniq( + Object.values(layer.columns) + .filter((col) => + [ + 'median', + 'percentile', + 'percentile_rank', + 'last_value', + 'unique_count', + 'standard_deviation', + ].includes(col.operationType) + ) + .map((col) => col.label) + ).map((label) => + i18n.translate('xpack.lens.indexPattern.tsdbRollupWarning', { + defaultMessage: + '{label} uses a function that is unsupported by rolled up data. Select a different function or change the time range.', + values: { + label, + }, + }) + ) + ); + default: + return [ + <> + <EuiText size="s"> + <strong>{warning.message}</strong> + <p>{warning.text}</p> + </EuiText> + <EuiSpacer size="s" /> + {warning.text ? ( + <ShardFailureOpenModalButton + theme={theme} + title={warning.message} + size="m" + getRequestMeta={() => ({ + request: request as ShardFailureRequest, + response, + })} + color="primary" + isButtonEmpty={true} + /> + ) : null} + </>, + ]; + } } - return Object.values(state.layers).flatMap((layer) => - uniq( - Object.values(layer.columns) - .filter((col) => - [ - 'median', - 'percentile', - 'percentile_rank', - 'last_value', - 'unique_count', - 'standard_deviation', - ].includes(col.operationType) - ) - .map((col) => col.label) - ).map((label) => - i18n.translate('xpack.lens.indexPattern.tsdbRollupWarning', { - defaultMessage: - '{label} uses a function that is unsupported by rolled up data. Select a different function or change the time range.', - values: { - label, - }, - }) - ) - ); } - return []; } diff --git a/x-pack/plugins/lens/public/datasources/text_based/datapanel.test.tsx b/x-pack/plugins/lens/public/datasources/text_based/datapanel.test.tsx index b5f158ecd453f..cac4fc380cc99 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/datapanel.test.tsx +++ b/x-pack/plugins/lens/public/datasources/text_based/datapanel.test.tsx @@ -8,6 +8,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { act } from 'react-dom/test-utils'; +import { ReactWrapper } from 'enzyme'; import type { Query } from '@kbn/es-query'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; @@ -30,7 +31,6 @@ import { createIndexPatternServiceMock } from '../../mocks/data_views_service_mo import { createMockFramePublicAPI } from '../../mocks'; import { createMockedDragDropContext } from './mocks'; import { DataViewsState } from '../../state_management'; -import { ExistingFieldsMap, IndexPattern } from '../../types'; const fieldsFromQuery = [ { @@ -101,18 +101,6 @@ const fieldsOne = [ }, ]; -function getExistingFields(indexPatterns: Record<string, IndexPattern>) { - const existingFields: ExistingFieldsMap = {}; - for (const { title, fields } of Object.values(indexPatterns)) { - const fieldsMap: Record<string, boolean> = {}; - for (const { displayName, name } of fields) { - fieldsMap[displayName ?? name] = true; - } - existingFields[title] = fieldsMap; - } - return existingFields; -} - const initialState: TextBasedPrivateState = { layers: { first: { @@ -130,27 +118,16 @@ const initialState: TextBasedPrivateState = { fieldList: fieldsFromQuery, }; -function getFrameAPIMock({ indexPatterns, existingFields, ...rest }: Partial<DataViewsState> = {}) { +function getFrameAPIMock({ + indexPatterns, + ...rest +}: Partial<DataViewsState> & { indexPatterns: DataViewsState['indexPatterns'] }) { const frameAPI = createMockFramePublicAPI(); - const defaultIndexPatterns = { - '1': { - id: '1', - title: 'idx1', - timeFieldName: 'timestamp', - hasRestrictions: false, - fields: fieldsOne, - getFieldByName: jest.fn(), - isPersisted: true, - spec: {}, - }, - }; return { ...frameAPI, dataViews: { ...frameAPI.dataViews, - indexPatterns: indexPatterns ?? defaultIndexPatterns, - existingFields: existingFields ?? getExistingFields(indexPatterns ?? defaultIndexPatterns), - isFirstExistenceFetch: false, + indexPatterns, ...rest, }, }; @@ -159,12 +136,39 @@ function getFrameAPIMock({ indexPatterns, existingFields, ...rest }: Partial<Dat // @ts-expect-error Portal mocks are notoriously difficult to type ReactDOM.createPortal = jest.fn((element) => element); +async function mountAndWaitForLazyModules(component: React.ReactElement): Promise<ReactWrapper> { + let inst: ReactWrapper; + await act(async () => { + inst = await mountWithIntl(component); + // wait for lazy modules + await new Promise((resolve) => setTimeout(resolve, 0)); + inst.update(); + }); + + await inst!.update(); + + return inst!; +} + describe('TextBased Query Languages Data Panel', () => { let core: ReturnType<typeof coreMock['createStart']>; let dataViews: DataViewPublicStart; + const defaultIndexPatterns = { + '1': { + id: '1', + title: 'idx1', + timeFieldName: 'timestamp', + hasRestrictions: false, + fields: fieldsOne, + getFieldByName: jest.fn(), + isPersisted: true, + spec: {}, + }, + }; let defaultProps: TextBasedDataPanelProps; const dataViewsMock = dataViewPluginMocks.createStartContract(); + beforeEach(() => { core = coreMock.createStart(); dataViews = dataViewPluginMocks.createStartContract(); @@ -194,7 +198,7 @@ describe('TextBased Query Languages Data Panel', () => { hasSuggestionForField: jest.fn(() => false), uiActions: uiActionsPluginMock.createStartContract(), indexPatternService: createIndexPatternServiceMock({ core, dataViews }), - frame: getFrameAPIMock(), + frame: getFrameAPIMock({ indexPatterns: defaultIndexPatterns }), state: initialState, setState: jest.fn(), onChangeIndexPattern: jest.fn(), @@ -202,23 +206,33 @@ describe('TextBased Query Languages Data Panel', () => { }); it('should render a search box', async () => { - const wrapper = mountWithIntl(<TextBasedDataPanel {...defaultProps} />); - expect(wrapper.find('[data-test-subj="lnsTextBasedLangugesFieldSearch"]').length).toEqual(1); + const wrapper = await mountAndWaitForLazyModules(<TextBasedDataPanel {...defaultProps} />); + + expect(wrapper.find('[data-test-subj="lnsTextBasedLanguagesFieldSearch"]').length).toEqual(1); }); it('should list all supported fields in the pattern', async () => { - const wrapper = mountWithIntl(<TextBasedDataPanel {...defaultProps} />); + const wrapper = await mountAndWaitForLazyModules(<TextBasedDataPanel {...defaultProps} />); + expect( wrapper - .find('[data-test-subj="lnsTextBasedLanguagesPanelFields"]') + .find('[data-test-subj="lnsTextBasedLanguagesAvailableFields"]') .find(FieldButton) .map((fieldItem) => fieldItem.prop('fieldName')) - ).toEqual(['timestamp', 'bytes', 'memory']); + ).toEqual(['bytes', 'memory', 'timestamp']); + + expect(wrapper.find('[data-test-subj="lnsTextBasedLanguagesEmptyFields"]').exists()).toBe( + false + ); + expect(wrapper.find('[data-test-subj="lnsTextBasedLanguagesMetaFields"]').exists()).toBe(false); }); it('should not display the selected fields accordion if there are no fields displayed', async () => { - const wrapper = mountWithIntl(<TextBasedDataPanel {...defaultProps} />); - expect(wrapper.find('[data-test-subj="lnsSelectedFieldsTextBased"]').length).toEqual(0); + const wrapper = await mountAndWaitForLazyModules(<TextBasedDataPanel {...defaultProps} />); + + expect(wrapper.find('[data-test-subj="lnsTextBasedLanguagesSelectedFields"]').length).toEqual( + 0 + ); }); it('should display the selected fields accordion if there are fields displayed', async () => { @@ -226,13 +240,17 @@ describe('TextBased Query Languages Data Panel', () => { ...defaultProps, layerFields: ['memory'], }; - const wrapper = mountWithIntl(<TextBasedDataPanel {...props} />); - expect(wrapper.find('[data-test-subj="lnsSelectedFieldsTextBased"]').length).not.toEqual(0); + const wrapper = await mountAndWaitForLazyModules(<TextBasedDataPanel {...props} />); + + expect( + wrapper.find('[data-test-subj="lnsTextBasedLanguagesSelectedFields"]').length + ).not.toEqual(0); }); it('should list all supported fields in the pattern that match the search input', async () => { - const wrapper = mountWithIntl(<TextBasedDataPanel {...defaultProps} />); - const searchBox = wrapper.find('[data-test-subj="lnsTextBasedLangugesFieldSearch"]'); + const wrapper = await mountAndWaitForLazyModules(<TextBasedDataPanel {...defaultProps} />); + + const searchBox = wrapper.find('[data-test-subj="lnsTextBasedLanguagesFieldSearch"]'); act(() => { searchBox.prop('onChange')!({ @@ -240,10 +258,10 @@ describe('TextBased Query Languages Data Panel', () => { } as React.ChangeEvent<HTMLInputElement>); }); - wrapper.update(); + await wrapper.update(); expect( wrapper - .find('[data-test-subj="lnsTextBasedLanguagesPanelFields"]') + .find('[data-test-subj="lnsTextBasedLanguagesAvailableFields"]') .find(FieldButton) .map((fieldItem) => fieldItem.prop('fieldName')) ).toEqual(['memory']); diff --git a/x-pack/plugins/lens/public/datasources/text_based/datapanel.tsx b/x-pack/plugins/lens/public/datasources/text_based/datapanel.tsx index 1b0699b2eb930..0416d163670fb 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/datapanel.tsx +++ b/x-pack/plugins/lens/public/datasources/text_based/datapanel.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useState, useEffect, useMemo } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiFormControlLayout, htmlIdGenerator } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import usePrevious from 'react-use/lib/usePrevious'; @@ -14,13 +14,22 @@ import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { isOfAggregateQueryType } from '@kbn/es-query'; -import { ExpressionsStart } from '@kbn/expressions-plugin/public'; +import { DatatableColumn, ExpressionsStart } from '@kbn/expressions-plugin/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { + ExistenceFetchStatus, + FieldListGrouped, + FieldListGroupedProps, + FieldsGroupNames, + useGroupedFields, +} from '@kbn/unified-field-list-plugin/public'; +import { FieldButton } from '@kbn/react-field'; import type { DatasourceDataPanelProps } from '../../types'; import type { TextBasedPrivateState } from './types'; import { getStateFromAggregateQuery } from './utils'; -import { ChildDragDropProvider } from '../../drag_drop'; -import { FieldsAccordion } from './fields_accordion'; +import { ChildDragDropProvider, DragDrop } from '../../drag_drop'; +import { DataType } from '../../types'; +import { LensFieldIcon } from '../../shared_components'; export type TextBasedDataPanelProps = DatasourceDataPanelProps<TextBasedPrivateState> & { data: DataPublicPluginStart; @@ -67,8 +76,16 @@ export function TextBasedDataPanel({ }, [data, dataViews, expressions, prevQuery, query, setState, state]); const { fieldList } = state; - const filteredFields = useMemo(() => { - return fieldList.filter((field) => { + + const onSelectedFieldFilter = useCallback( + (field: DatatableColumn): boolean => { + return Boolean(layerFields?.includes(field.name)); + }, + [layerFields] + ); + + const onFilterField = useCallback( + (field: DatatableColumn) => { if ( localState.nameFilter && !field.name.toLowerCase().includes(localState.nameFilter.toLowerCase()) @@ -76,9 +93,57 @@ export function TextBasedDataPanel({ return false; } return true; - }); - }, [fieldList, localState.nameFilter]); - const usedByLayersFields = fieldList.filter((field) => layerFields?.includes(field.name)); + }, + [localState] + ); + + const onOverrideFieldGroupDetails = useCallback((groupName) => { + if (groupName === FieldsGroupNames.AvailableFields) { + return { + helpText: i18n.translate('xpack.lens.indexPattern.allFieldsForTextBasedLabelHelp', { + defaultMessage: + 'Drag and drop available fields to the workspace and create visualizations. To change the available fields, edit your query.', + }), + }; + } + }, []); + + const { fieldGroups } = useGroupedFields<DatatableColumn>({ + dataViewId: null, + allFields: fieldList, + services: { + dataViews, + }, + onFilterField, + onSelectedFieldFilter, + onOverrideFieldGroupDetails, + }); + + const renderFieldItem: FieldListGroupedProps<DatatableColumn>['renderFieldItem'] = useCallback( + ({ field, itemIndex, groupIndex, hideDetails }) => { + return ( + <DragDrop + draggable + order={[itemIndex]} + value={{ + field: field?.name, + id: field.id, + humanData: { label: field?.name }, + }} + dataTestSubj={`lnsFieldListPanelField-${field.name}`} + > + <FieldButton + className={`lnsFieldItem lnsFieldItem--${field?.meta?.type}`} + isActive={false} + onClick={() => {}} + fieldIcon={<LensFieldIcon type={field?.meta.type as DataType} />} + fieldName={field?.name} + /> + </DragDrop> + ); + }, + [] + ); return ( <KibanaContextProvider @@ -111,7 +176,7 @@ export function TextBasedDataPanel({ > <input className="euiFieldText euiFieldText--fullWidth lnsInnerIndexPatternDataPanel__textField" - data-test-subj="lnsTextBasedLangugesFieldSearch" + data-test-subj="lnsTextBasedLanguagesFieldSearch" placeholder={i18n.translate('xpack.lens.indexPatterns.filterByNameLabel', { defaultMessage: 'Search field names', description: 'Search the list of fields in the data view for the provided text', @@ -129,32 +194,16 @@ export function TextBasedDataPanel({ </EuiFormControlLayout> </EuiFlexItem> <EuiFlexItem> - <div className="lnsIndexPatternFieldList"> - <div className="lnsIndexPatternFieldList__accordionContainer"> - {usedByLayersFields.length > 0 && ( - <FieldsAccordion - initialIsOpen={true} - hasLoaded={dataHasLoaded} - isFiltered={Boolean(localState.nameFilter)} - fields={usedByLayersFields} - id="lnsSelectedFieldsTextBased" - label={i18n.translate('xpack.lens.textBased.selectedFieldsLabel', { - defaultMessage: 'Selected fields', - })} - /> - )} - <FieldsAccordion - initialIsOpen={true} - hasLoaded={dataHasLoaded} - isFiltered={Boolean(localState.nameFilter)} - fields={filteredFields} - id="lnsAvailableFieldsTextBased" - label={i18n.translate('xpack.lens.textBased.availableFieldsLabel', { - defaultMessage: 'Available fields', - })} - /> - </div> - </div> + <FieldListGrouped<DatatableColumn> + fieldGroups={fieldGroups} + fieldsExistenceStatus={ + dataHasLoaded ? ExistenceFetchStatus.succeeded : ExistenceFetchStatus.unknown + } + fieldsExistInIndex={Boolean(fieldList.length)} + renderFieldItem={renderFieldItem} + screenReaderDescriptionForSearchInputId={fieldSearchDescriptionId} + data-test-subj="lnsTextBasedLanguages" + /> </EuiFlexItem> </EuiFlexGroup> </ChildDragDropProvider> diff --git a/x-pack/plugins/lens/public/datasources/text_based/field_select.test.tsx b/x-pack/plugins/lens/public/datasources/text_based/field_select.test.tsx index b344131747b1b..2a8e63da1b0e1 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/field_select.test.tsx +++ b/x-pack/plugins/lens/public/datasources/text_based/field_select.test.tsx @@ -6,11 +6,9 @@ */ import React from 'react'; -import type { DatatableColumn } from '@kbn/expressions-plugin/public'; - import { FieldPicker, FieldOptionValue } from '../../shared_components/field_picker'; -import { FieldSelect, FieldSelectProps } from './field_select'; +import { type FieldOptionCompatible, FieldSelect, FieldSelectProps } from './field_select'; import { shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; const fields = [ @@ -20,6 +18,7 @@ const fields = [ meta: { type: 'date', }, + compatible: true, }, { name: 'bytes', @@ -27,6 +26,7 @@ const fields = [ meta: { type: 'number', }, + compatible: true, }, { name: 'memory', @@ -34,8 +34,9 @@ const fields = [ meta: { type: 'number', }, + compatible: true, }, -] as DatatableColumn[]; +] as FieldOptionCompatible[]; describe('Layer Data Panel', () => { let defaultProps: FieldSelectProps; @@ -75,7 +76,7 @@ describe('Layer Data Panel', () => { label: 'Available fields', options: [ { - compatible: true, + compatible: 1, exists: true, label: 'timestamp', value: { @@ -85,7 +86,7 @@ describe('Layer Data Panel', () => { }, }, { - compatible: true, + compatible: 1, exists: true, label: 'bytes', value: { @@ -95,7 +96,7 @@ describe('Layer Data Panel', () => { }, }, { - compatible: true, + compatible: 1, exists: true, label: 'memory', value: { diff --git a/x-pack/plugins/lens/public/datasources/text_based/field_select.tsx b/x-pack/plugins/lens/public/datasources/text_based/field_select.tsx index e7cb5451d31ab..5ca4f1e341ad9 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/field_select.tsx +++ b/x-pack/plugins/lens/public/datasources/text_based/field_select.tsx @@ -13,10 +13,14 @@ import { FieldPicker, FieldOptionValue, FieldOption } from '../../shared_compone import type { TextBasedLayerColumn } from './types'; import type { DataType } from '../../types'; +export interface FieldOptionCompatible extends DatatableColumn { + compatible: boolean; +} + export interface FieldSelectProps extends EuiComboBoxProps<EuiComboBoxOptionOption['value']> { selectedField?: TextBasedLayerColumn; onChoose: (choice: FieldOptionValue) => void; - existingFields: DatatableColumn[]; + existingFields: FieldOptionCompatible[]; } export function FieldSelect({ @@ -26,19 +30,21 @@ export function FieldSelect({ ['data-test-subj']: dataTestSub, }: FieldSelectProps) { const memoizedFieldOptions = useMemo(() => { - const availableFields = existingFields.map((field) => { - const dataType = field?.meta?.type as DataType; - return { - compatible: true, - exists: true, - label: field.name, - value: { - type: 'field' as FieldOptionValue['type'], - field: field.name, - dataType, - }, - }; - }); + const availableFields = existingFields + .map((field) => { + const dataType = field?.meta?.type as DataType; + return { + compatible: field.compatible ? 1 : 0, + exists: true, + label: field.name, + value: { + type: 'field' as FieldOptionValue['type'], + field: field.name, + dataType, + }, + }; + }) + .sort((a, b) => b.compatible - a.compatible); return [ { label: i18n.translate('xpack.lens.indexPattern.availableFieldsLabel', { diff --git a/x-pack/plugins/lens/public/datasources/text_based/fields_accordion.tsx b/x-pack/plugins/lens/public/datasources/text_based/fields_accordion.tsx deleted file mode 100644 index 23f71e991bc82..0000000000000 --- a/x-pack/plugins/lens/public/datasources/text_based/fields_accordion.tsx +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { memo, useMemo } from 'react'; -import type { DatatableColumn } from '@kbn/expressions-plugin/public'; - -import { - EuiText, - EuiNotificationBadge, - EuiAccordion, - EuiLoadingSpinner, - EuiSpacer, -} from '@elastic/eui'; -import { FieldButton } from '@kbn/react-field'; -import { DragDrop } from '../../drag_drop'; -import { LensFieldIcon } from '../../shared_components'; -import type { DataType } from '../../types'; - -export interface FieldsAccordionProps { - initialIsOpen: boolean; - hasLoaded: boolean; - isFiltered: boolean; - // forceState: 'open' | 'closed'; - id: string; - label: string; - fields: DatatableColumn[]; -} - -export const FieldsAccordion = memo(function InnerFieldsAccordion({ - initialIsOpen, - hasLoaded, - isFiltered, - id, - label, - fields, -}: FieldsAccordionProps) { - const renderButton = useMemo(() => { - return ( - <EuiText size="xs"> - <strong>{label}</strong> - </EuiText> - ); - }, [label]); - - const extraAction = useMemo(() => { - if (hasLoaded) { - return ( - <EuiNotificationBadge size="m" color={isFiltered ? 'accent' : 'subdued'}> - {fields.length} - </EuiNotificationBadge> - ); - } - - return <EuiLoadingSpinner size="m" />; - }, [fields.length, hasLoaded, isFiltered]); - - return ( - <> - <EuiAccordion - initialIsOpen={initialIsOpen} - id={id} - buttonContent={renderButton} - extraAction={extraAction} - data-test-subj={id} - > - <ul - className="lnsInnerIndexPatternDataPanel__fieldItems" - data-test-subj="lnsTextBasedLanguagesPanelFields" - > - {fields.length > 0 && - fields.map((field, index) => ( - <li key={field?.name}> - <DragDrop - draggable - order={[index]} - value={{ - field: field?.name, - id: field.id, - humanData: { label: field?.name }, - }} - dataTestSubj={`lnsFieldListPanelField-${field.name}`} - > - <FieldButton - className={`lnsFieldItem lnsFieldItem--${field?.meta?.type}`} - isActive={false} - onClick={() => {}} - fieldIcon={<LensFieldIcon type={field?.meta.type as DataType} />} - fieldName={field?.name} - /> - </DragDrop> - </li> - ))} - </ul> - </EuiAccordion> - <EuiSpacer size="m" /> - </> - ); -}); diff --git a/x-pack/plugins/lens/public/datasources/text_based/layerpanel.test.tsx b/x-pack/plugins/lens/public/datasources/text_based/layerpanel.test.tsx index f0a9d147ddfd6..bc2d64e8ac55d 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/layerpanel.test.tsx +++ b/x-pack/plugins/lens/public/datasources/text_based/layerpanel.test.tsx @@ -68,8 +68,6 @@ describe('Layer Data Panel', () => { { id: '2', title: 'my-fake-restricted-pattern', name: 'my-fake-restricted-pattern' }, { id: '3', title: 'my-compatible-pattern', name: 'my-compatible-pattern' }, ], - existingFields: {}, - isFirstExistenceFetch: false, indexPatterns: {}, } as DataViewsState, }; diff --git a/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.test.ts b/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.test.ts index 25bab766558e3..b7a99c41cf72a 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.test.ts +++ b/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.test.ts @@ -77,7 +77,7 @@ const expectedIndexPatterns = { const indexPatterns = expectedIndexPatterns; -describe('IndexPattern Data Source', () => { +describe('Textbased Data Source', () => { let baseState: TextBasedPrivateState; let TextBasedDatasource: Datasource<TextBasedPrivateState, TextBasedPersistedState>; @@ -189,6 +189,88 @@ describe('IndexPattern Data Source', () => { }); }); + describe('#getDropProps', () => { + it('should return undefined if source is not present', () => { + const props = { + target: { + layerId: 'a', + groupId: 'groupId', + columnId: 'col1', + filterOperations: jest.fn(), + }, + state: baseState, + indexPatterns, + }; + expect(TextBasedDatasource.getDropProps(props)).toBeUndefined(); + }); + + it('should return undefined if target group not allows non numeric fields', () => { + const newState = { + ...baseState, + layers: { + a: { + columns: [], + allColumns: [ + { + columnId: 'col1', + fieldName: 'Test 1', + meta: { + type: 'string', + }, + }, + ], + query: { sql: 'SELECT * FROM foo' }, + index: 'foo', + }, + }, + } as unknown as TextBasedPrivateState; + const props = { + target: { + layerId: 'a', + groupId: 'groupId', + columnId: 'col1', + filterOperations: jest.fn(), + isMetricDimension: true, + }, + source: { + id: 'col1', + field: 'Test 1', + humanData: { + label: 'Test 1', + }, + }, + state: newState, + indexPatterns, + }; + expect(TextBasedDatasource.getDropProps(props)).toBeUndefined(); + }); + + it('should return props if field is allowed to be dropped', () => { + const props = { + target: { + layerId: 'a', + groupId: 'groupId', + columnId: 'col1', + filterOperations: jest.fn(), + isMetricDimension: true, + }, + source: { + id: 'col1', + field: 'Test 1', + humanData: { + label: 'Test 1', + }, + }, + state: baseState, + indexPatterns, + }; + expect(TextBasedDatasource.getDropProps(props)).toStrictEqual({ + dropTypes: ['field_add'], + nextLabel: 'Test 1', + }); + }); + }); + describe('#insertLayer', () => { it('should insert an empty layer into the previous state', () => { expect(TextBasedDatasource.insertLayer(baseState, 'newLayer')).toEqual({ diff --git a/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx b/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx index 368036e3ebd50..ed8931d75f54d 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx +++ b/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx @@ -383,11 +383,9 @@ export function getTextBasedDatasource({ customLabel = selectedField?.fieldName; } - const columnExists = props.state.fieldList.some((f) => f.name === customLabel); - render( <EuiButtonEmpty - color={columnExists ? 'primary' : 'danger'} + color={customLabel ? 'primary' : 'danger'} onClick={() => {}} data-test-subj="lns-dimensionTrigger-textBased" > @@ -412,6 +410,19 @@ export function getTextBasedDatasource({ const selectedField = props.state.layers[props.layerId]?.allColumns?.find( (column) => column.columnId === props.columnId ); + + const updatedFields = fields.map((f) => { + return { + ...f, + compatible: props.isMetricDimension + ? props.filterOperations({ + dataType: f.meta.type as DataType, + isBucketed: Boolean(f?.meta?.type !== 'number'), + scale: 'ordinal', + }) + : true, + }; + }); render( <KibanaThemeProvider theme$={core.theme.theme$}> <EuiFormRow @@ -423,7 +434,7 @@ export function getTextBasedDatasource({ className="lnsIndexPatternDimensionEditor--padded" > <FieldSelect - existingFields={fields} + existingFields={updatedFields} selectedField={selectedField} onChoose={(choice) => { const meta = fields.find((f) => f.name === choice.field)?.meta; @@ -457,12 +468,12 @@ export function getTextBasedDatasource({ columns: props.state.layers[props.layerId].columns.map((col) => col.columnId !== props.columnId ? col - : { ...col, fieldName: choice.field } + : { ...col, fieldName: choice.field, meta } ), allColumns: props.state.layers[props.layerId].allColumns.map((col) => col.columnId !== props.columnId ? col - : { ...col, fieldName: choice.field } + : { ...col, fieldName: choice.field, meta } ), }, }, @@ -522,10 +533,16 @@ export function getTextBasedDatasource({ }, getDropProps: (props) => { - const { source } = props; + const { source, target, state } = props; if (!source) { return; } + if (target && target.isMetricDimension) { + const layerId = target.layerId; + const currentLayer = state.layers[layerId]; + const field = currentLayer.allColumns.find((f) => f.columnId === source.id); + if (field?.meta?.type !== 'number') return; + } const label = source.field as string; return { dropTypes: ['field_add'], nextLabel: label }; }, diff --git a/x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx b/x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx index af680fbc27160..b8c59712b096f 100644 --- a/x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx +++ b/x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx @@ -19,7 +19,7 @@ import { import { act } from 'react-dom/test-utils'; import { DropType } from '../types'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); const dataTransfer = { setData: jest.fn(), diff --git a/x-pack/plugins/lens/public/drag_drop/providers/providers.test.tsx b/x-pack/plugins/lens/public/drag_drop/providers/providers.test.tsx index a8312cc927451..8bbe30e29cb82 100644 --- a/x-pack/plugins/lens/public/drag_drop/providers/providers.test.tsx +++ b/x-pack/plugins/lens/public/drag_drop/providers/providers.test.tsx @@ -9,7 +9,7 @@ import React, { useContext } from 'react'; import { mount } from 'enzyme'; import { RootDragDropProvider, DragContext } from '.'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); describe('RootDragDropProvider', () => { test('reuses contexts for each render', () => { diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx index acbeb79bbe74d..69f661e92fb43 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx @@ -568,7 +568,6 @@ export function LayerPanel( invalid: group.invalid, invalidMessage: group.invalidMessage, indexPatterns: dataViews.indexPatterns, - existingFields: dataViews.existingFields, }} /> ) : ( @@ -606,6 +605,7 @@ export function LayerPanel( filterOperations: group.filterOperations, prioritizedOperation: group.prioritizedOperation, isNewColumn: true, + isMetricDimension: group?.isMetricDimension, indexPatternId: layerDatasource ? layerDatasource.getUsedDataView(layerDatasourceState, layerId) : activeVisualization.getUsedDataView?.(visualizationState, layerId), @@ -718,6 +718,7 @@ export function LayerPanel( groupId: activeGroup.groupId, hideGrouping: activeGroup.hideGrouping, filterOperations: activeGroup.filterOperations, + isMetricDimension: activeGroup?.isMetricDimension, dimensionGroups, toggleFullscreen, isFullscreen, @@ -728,7 +729,6 @@ export function LayerPanel( formatSelectorOptions: activeGroup.formatSelectorOptions, layerType: activeVisualization.getLayerType(layerId, visualizationState), indexPatterns: dataViews.indexPatterns, - existingFields: dataViews.existingFields, activeData: layerVisualizationConfigProps.activeData, }} /> diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx index 2f2003970171a..36399211c92e3 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx @@ -36,6 +36,7 @@ import type { DefaultInspectorAdapters } from '@kbn/expressions-plugin/common'; import type { Datatable } from '@kbn/expressions-plugin/public'; import { DropIllustration } from '@kbn/chart-icons'; import { trackUiCounterEvents } from '../../../lens_ui_telemetry'; +import { getSearchWarningMessages } from '../../../utils'; import { FramePublicAPI, isLensBrushEvent, @@ -231,32 +232,37 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({ (data: unknown, adapters?: Partial<DefaultInspectorAdapters>) => { if (renderDeps.current) { const [defaultLayerId] = Object.keys(renderDeps.current.datasourceLayers); + const datasource = Object.values(renderDeps.current.datasourceMap)[0]; + const datasourceState = Object.values(renderDeps.current.datasourceStates)[0].state; - const requestWarnings: string[] = []; - const datasource = Object.values(renderDeps.current?.datasourceMap)[0]; - const datasourceState = Object.values(renderDeps.current?.datasourceStates)[0].state; - if (adapters?.requests) { - plugins.data.search.showWarnings(adapters.requests, (warning) => { - const warningMessage = datasource.getSearchWarningMessages?.(datasourceState, warning); + let requestWarnings: Array<React.ReactNode | string> = []; - requestWarnings.push(...(warningMessage || [])); - if (warningMessage && warningMessage.length) return true; - }); - } - if (adapters && adapters.tables) { - dispatchLens( - onActiveDataChange({ - activeData: Object.entries(adapters.tables?.tables).reduce<Record<string, Datatable>>( - (acc, [key, value], index, tables) => ({ - ...acc, - [tables.length === 1 ? defaultLayerId : key]: value, - }), - {} - ), - requestWarnings, - }) + if (adapters?.requests) { + requestWarnings = getSearchWarningMessages( + adapters.requests, + datasource, + datasourceState, + { + searchService: plugins.data.search, + } ); } + + dispatchLens( + onActiveDataChange({ + activeData: + adapters && adapters.tables + ? Object.entries(adapters.tables?.tables).reduce<Record<string, Datatable>>( + (acc, [key, value], index, tables) => ({ + ...acc, + [tables.length === 1 ? defaultLayerId : key]: value, + }), + {} + ) + : undefined, + requestWarnings, + }) + ); } }, [dispatchLens, plugins.data.search] diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.tsx index 103c75844f816..aa5c5bba4741c 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.tsx @@ -87,7 +87,12 @@ import { LensAttributeService } from '../lens_attribute_service'; import type { ErrorMessage, TableInspectorAdapter } from '../editor_frame_service/types'; import { getLensInspectorService, LensInspector } from '../lens_inspector_service'; import { SharingSavedObjectProps, VisualizationDisplayOptions } from '../types'; -import { getActiveDatasourceIdFromDoc, getIndexPatternsObjects, inferTimeField } from '../utils'; +import { + getActiveDatasourceIdFromDoc, + getIndexPatternsObjects, + getSearchWarningMessages, + inferTimeField, +} from '../utils'; import { getLayerMetaInfo, combineQueryAndFilters } from '../app_plugin/show_underlying_data'; import { convertDataViewIntoLensIndexPattern } from '../data_views_service/loader'; @@ -531,21 +536,30 @@ export class Embeddable private handleWarnings(adapters?: Partial<DefaultInspectorAdapters>) { const activeDatasourceId = getActiveDatasourceIdFromDoc(this.savedVis); - if (!activeDatasourceId || !adapters?.requests) return; + + if (!activeDatasourceId || !adapters?.requests) { + return; + } + const activeDatasource = this.deps.datasourceMap[activeDatasourceId]; const docDatasourceState = this.savedVis?.state.datasourceStates[activeDatasourceId]; - const warnings: React.ReactNode[] = []; - this.deps.data.search.showWarnings(adapters.requests, (warning) => { - const warningMessage = activeDatasource.getSearchWarningMessages?.( - docDatasourceState, - warning - ); - warnings.push(...(warningMessage || [])); - if (warningMessage && warningMessage.length) return true; - }); - if (warnings && this.warningDomNode) { - render(<Warnings warnings={warnings} />, this.warningDomNode); + const requestWarnings = getSearchWarningMessages( + adapters.requests, + activeDatasource, + docDatasourceState, + { + searchService: this.deps.data.search, + } + ); + + if (requestWarnings.length && this.warningDomNode) { + render( + <KibanaThemeProvider theme$={this.deps.theme.theme$}> + <Warnings warnings={requestWarnings} /> + </KibanaThemeProvider>, + this.warningDomNode + ); } } @@ -631,6 +645,25 @@ export class Embeddable } } + private getError(): Error | undefined { + const message = + typeof this.errors?.[0]?.longMessage === 'string' + ? this.errors[0].longMessage + : this.errors?.[0]?.shortMessage; + + if (message != null) { + return new Error(message); + } + + if (!this.expression) { + return new Error( + i18n.translate('xpack.lens.embeddable.failure', { + defaultMessage: "Visualization couldn't be displayed", + }) + ); + } + } + /** * * @param {HTMLElement} domNode @@ -651,7 +684,7 @@ export class Embeddable this.updateOutput({ ...this.getOutput(), loading: true, - error: undefined, + error: this.getError(), }); this.renderComplete.dispatchInProgress(); @@ -683,7 +716,8 @@ export class Embeddable style={input.style} executionContext={this.getExecutionContext()} canEdit={this.getIsEditable() && input.viewMode === 'edit'} - onRuntimeError={() => { + onRuntimeError={(message) => { + this.updateOutput({ error: new Error(message) }); this.logError('runtime'); }} noPadding={this.visDisplayOptions?.noPadding} diff --git a/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx b/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx index 56939b54299ce..e05f82160b658 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx @@ -62,6 +62,7 @@ export type TypedLensByValueInput = Omit<LensByValueInput, 'attributes'> & { export type EmbeddableComponentProps = (TypedLensByValueInput | LensByReferenceInput) & { withDefaultActions?: boolean; extraActions?: Action[]; + showInspector?: boolean; }; interface PluginsStartDependencies { @@ -89,6 +90,7 @@ export function getEmbeddableComponent(core: CoreStart, plugins: PluginsStartDep input={input} theme={theme} extraActions={input.extraActions} + showInspector={input.showInspector} withDefaultActions={input.withDefaultActions} /> ); @@ -119,6 +121,7 @@ interface EmbeddablePanelWrapperProps { input: EmbeddableComponentProps; theme: ThemeServiceStart; extraActions?: Action[]; + showInspector?: boolean; withDefaultActions?: boolean; } @@ -130,6 +133,7 @@ const EmbeddablePanelWrapper: FC<EmbeddablePanelWrapperProps> = ({ input, theme, extraActions, + showInspector = true, withDefaultActions, }) => { const [embeddable, loading] = useEmbeddableFactory({ factory, input }); @@ -154,7 +158,7 @@ const EmbeddablePanelWrapper: FC<EmbeddablePanelWrapperProps> = ({ return [...(extraActions ?? []), ...actions]; }} - inspector={inspector} + inspector={showInspector ? inspector : undefined} actionPredicate={actionPredicate} showShadow={false} showBadges={false} diff --git a/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts b/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts index cef9e7d698faa..7904ba4c38f14 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts +++ b/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts @@ -79,7 +79,7 @@ export class EmbeddableFactory implements EmbeddableFactoryDefinition { getDisplayName() { return i18n.translate('xpack.lens.embeddableDisplayName', { - defaultMessage: 'lens', + defaultMessage: 'Lens', }); } diff --git a/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx b/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx index 3f10fba310b0c..cbb1fedf75497 100644 --- a/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx +++ b/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx @@ -44,7 +44,7 @@ export interface ExpressionWrapperProps { style?: React.CSSProperties; className?: string; canEdit: boolean; - onRuntimeError: () => void; + onRuntimeError: (message?: string) => void; executionContext?: KibanaExecutionContext; lensInspector: LensInspector; noPadding?: boolean; @@ -148,7 +148,9 @@ export function ExpressionWrapper({ syncCursor={syncCursor} executionContext={executionContext} renderError={(errorMessage, error) => { - onRuntimeError(); + const messages = getOriginalRequestErrorMessages(error); + onRuntimeError(messages[0] ?? errorMessage); + return ( <div data-test-subj="expression-renderer-error"> <EuiFlexGroup direction="column" alignItems="center" justifyContent="center"> @@ -156,7 +158,7 @@ export function ExpressionWrapper({ <EuiIcon type="alert" color="danger" /> </EuiFlexItem> <EuiFlexItem> - {(getOriginalRequestErrorMessages(error) || [errorMessage]).map((message) => ( + {messages.map((message) => ( <EuiText size="s">{message}</EuiText> ))} </EuiFlexItem> diff --git a/x-pack/plugins/lens/public/mocks/store_mocks.tsx b/x-pack/plugins/lens/public/mocks/store_mocks.tsx index 8320f429e9d5a..d4ba2d042b1ca 100644 --- a/x-pack/plugins/lens/public/mocks/store_mocks.tsx +++ b/x-pack/plugins/lens/public/mocks/store_mocks.tsx @@ -59,8 +59,6 @@ export const defaultState = { dataViews: { indexPatterns: {}, indexPatternRefs: [], - existingFields: {}, - isFirstExistenceFetch: false, }, }; diff --git a/x-pack/plugins/lens/public/shared_components/dataview_picker/helpers.ts b/x-pack/plugins/lens/public/shared_components/dataview_picker/helpers.ts index 4f53930fa4973..febf8b1d7c500 100644 --- a/x-pack/plugins/lens/public/shared_components/dataview_picker/helpers.ts +++ b/x-pack/plugins/lens/public/shared_components/dataview_picker/helpers.ts @@ -5,25 +5,17 @@ * 2.0. */ +import { type ExistingFieldsReader } from '@kbn/unified-field-list-plugin/public'; import { IndexPattern } from '../../types'; /** * Checks if the provided field contains data (works for meta field) */ export function fieldContainsData( - field: string, + fieldName: string, indexPattern: IndexPattern, - existingFields: Record<string, boolean> + hasFieldData: ExistingFieldsReader['hasFieldData'] ) { - return ( - indexPattern.getFieldByName(field)?.type === 'document' || fieldExists(existingFields, field) - ); -} - -/** - * Performs an existence check on the existingFields data structure for the provided field. - * Does not work for meta fields. - */ -export function fieldExists(existingFields: Record<string, boolean>, fieldName: string) { - return existingFields[fieldName]; + const field = indexPattern.getFieldByName(fieldName); + return field?.type === 'document' || hasFieldData(indexPattern.id, fieldName); } diff --git a/x-pack/plugins/lens/public/shared_components/dataview_picker/index.ts b/x-pack/plugins/lens/public/shared_components/dataview_picker/index.ts index 4de03b2f8b92c..6bf23c9d414db 100644 --- a/x-pack/plugins/lens/public/shared_components/dataview_picker/index.ts +++ b/x-pack/plugins/lens/public/shared_components/dataview_picker/index.ts @@ -6,4 +6,4 @@ */ export { ChangeIndexPattern } from './dataview_picker'; -export { fieldExists, fieldContainsData } from './helpers'; +export { fieldContainsData } from './helpers'; diff --git a/x-pack/plugins/lens/public/shared_components/index.ts b/x-pack/plugins/lens/public/shared_components/index.ts index a2fcc9c54882d..e57a18b3ee2ee 100644 --- a/x-pack/plugins/lens/public/shared_components/index.ts +++ b/x-pack/plugins/lens/public/shared_components/index.ts @@ -11,7 +11,7 @@ export { LegendSettingsPopover } from './legend_settings_popover'; export { PalettePicker } from './palette_picker'; export { FieldPicker, LensFieldIcon, TruncatedLabel } from './field_picker'; export type { FieldOption, FieldOptionValue } from './field_picker'; -export { ChangeIndexPattern, fieldExists, fieldContainsData } from './dataview_picker'; +export { ChangeIndexPattern, fieldContainsData } from './dataview_picker'; export { QueryInput, isQueryValid, validateQuery } from './query_input'; export { NewBucketButton, diff --git a/x-pack/plugins/lens/public/state_management/__snapshots__/load_initial.test.tsx.snap b/x-pack/plugins/lens/public/state_management/__snapshots__/load_initial.test.tsx.snap index a6759521f562e..d30a68e5e52b0 100644 --- a/x-pack/plugins/lens/public/state_management/__snapshots__/load_initial.test.tsx.snap +++ b/x-pack/plugins/lens/public/state_management/__snapshots__/load_initial.test.tsx.snap @@ -5,10 +5,8 @@ Object { "lens": Object { "activeDatasourceId": "testDatasource", "dataViews": Object { - "existingFields": Object {}, "indexPatternRefs": Array [], "indexPatterns": Object {}, - "isFirstExistenceFetch": true, }, "datasourceStates": Object { "testDatasource": Object { diff --git a/x-pack/plugins/lens/public/state_management/lens_slice.ts b/x-pack/plugins/lens/public/state_management/lens_slice.ts index 3f3490906f88c..e8874fbcda822 100644 --- a/x-pack/plugins/lens/public/state_management/lens_slice.ts +++ b/x-pack/plugins/lens/public/state_management/lens_slice.ts @@ -5,6 +5,7 @@ * 2.0. */ +import type { ReactNode } from 'react'; import { createAction, createReducer, current, PayloadAction } from '@reduxjs/toolkit'; import { VisualizeFieldContext } from '@kbn/ui-actions-plugin/public'; import { mapValues, uniq } from 'lodash'; @@ -49,8 +50,6 @@ export const initialState: LensAppState = { dataViews: { indexPatternRefs: [], indexPatterns: {}, - existingFields: {}, - isFirstExistenceFetch: true, }, }; @@ -98,8 +97,8 @@ export const getPreloadedState = ({ export const setState = createAction<Partial<LensAppState>>('lens/setState'); export const onActiveDataChange = createAction<{ - activeData: TableInspectorAdapter; - requestWarnings?: string[]; + activeData?: TableInspectorAdapter; + requestWarnings?: Array<ReactNode | string>; }>('lens/onActiveDataChange'); export const setSaveable = createAction<boolean>('lens/setSaveable'); export const enableAutoApply = createAction<void>('lens/enableAutoApply'); @@ -265,8 +264,8 @@ export const makeLensReducer = (storeDeps: LensStoreDeps) => { ) => { return { ...state, - activeData, - requestWarnings, + ...(activeData ? { activeData } : {}), + ...(requestWarnings ? { requestWarnings } : {}), }; }, [setSaveable.type]: (state, { payload }: PayloadAction<boolean>) => { diff --git a/x-pack/plugins/lens/public/state_management/types.ts b/x-pack/plugins/lens/public/state_management/types.ts index 9399506f5fca1..4f7500ec20a5e 100644 --- a/x-pack/plugins/lens/public/state_management/types.ts +++ b/x-pack/plugins/lens/public/state_management/types.ts @@ -30,10 +30,6 @@ export interface VisualizationState { export interface DataViewsState { indexPatternRefs: IndexPatternRef[]; indexPatterns: Record<string, IndexPattern>; - existingFields: Record<string, Record<string, boolean>>; - isFirstExistenceFetch: boolean; - existenceFetchFailed?: boolean; - existenceFetchTimeout?: boolean; } export type DatasourceStates = Record<string, { isLoading: boolean; state: unknown }>; diff --git a/x-pack/plugins/lens/public/types.ts b/x-pack/plugins/lens/public/types.ts index 94a0589f78b08..b947c43dd46de 100644 --- a/x-pack/plugins/lens/public/types.ts +++ b/x-pack/plugins/lens/public/types.ts @@ -31,6 +31,9 @@ import type { FieldSpec, DataViewSpec } from '@kbn/data-views-plugin/common'; import type { FieldFormatParams } from '@kbn/field-formats-plugin/common'; import { SearchResponseWarning } from '@kbn/data-plugin/public/search/types'; import type { EuiButtonIconColor } from '@elastic/eui'; +import { SearchRequest } from '@kbn/data-plugin/public'; +import { estypes } from '@elastic/elasticsearch'; +import React from 'react'; import type { DraggingIdentifier, DragDropIdentifier, DragContextState } from './drag_drop'; import type { DateRange, LayerType, SortingHint } from '../common'; import type { @@ -105,7 +108,6 @@ export interface EditorFrameProps { export type VisualizationMap = Record<string, Visualization>; export type DatasourceMap = Record<string, Datasource>; export type IndexPatternMap = Record<string, IndexPattern>; -export type ExistingFieldsMap = Record<string, Record<string, boolean>>; export interface EditorFrameInstance { EditorFrameContainer: (props: EditorFrameProps) => React.ReactElement; @@ -428,7 +430,13 @@ export interface Datasource<T = unknown, P = unknown> { /** * The embeddable calls this function to display warnings about visualization on the dashboard */ - getSearchWarningMessages?: (state: P, warning: SearchResponseWarning) => string[] | undefined; + getSearchWarningMessages?: ( + state: P, + warning: SearchResponseWarning, + request: SearchRequest, + response: estypes.SearchResponse + ) => Array<string | React.ReactNode> | undefined; + /** * Checks if the visualization created is time based, for example date histogram */ @@ -580,7 +588,6 @@ export type DatasourceDimensionProps<T> = SharedDimensionProps & { state: T; activeData?: Record<string, Datatable>; indexPatterns: IndexPatternMap; - existingFields: Record<string, Record<string, boolean>>; hideTooltip?: boolean; invalid?: boolean; invalidMessage?: string; @@ -605,6 +612,7 @@ export type DatasourceDimensionEditorProps<T = unknown> = DatasourceDimensionPro dimensionGroups: VisualizationDimensionGroupConfig[]; toggleFullscreen: () => void; isFullscreen: boolean; + isMetricDimension?: boolean; layerType: LayerType | undefined; supportStaticValue: boolean; paramEditorCustomProps?: ParamEditorCustomProps; @@ -629,6 +637,7 @@ export interface DragDropOperation { filterOperations: (operation: OperationMetadata) => boolean; indexPatternId?: string; isNewColumn?: boolean; + isMetricDimension?: boolean; prioritizedOperation?: string; } @@ -786,6 +795,8 @@ export type VisualizationDimensionGroupConfig = SharedDimensionProps & { // need a special flag to know when to pass the previous column on duplicating requiresPreviousColumnOnDuplicate?: boolean; supportStaticValue?: boolean; + // used by text based datasource to restrict the field selection only to number fields for the metric dimensions + isMetricDimension?: boolean; paramEditorCustomProps?: ParamEditorCustomProps; enableFormatSelector?: boolean; formatSelectorOptions?: FormatSelectorOptions; // only relevant if supportFieldFormat is true diff --git a/x-pack/plugins/lens/public/utils.ts b/x-pack/plugins/lens/public/utils.ts index 5b55dfe2054a8..619c9f7d71f30 100644 --- a/x-pack/plugins/lens/public/utils.ts +++ b/x-pack/plugins/lens/public/utils.ts @@ -14,6 +14,9 @@ import type { IUiSettingsClient, SavedObjectReference } from '@kbn/core/public'; import type { DataView, DataViewsContract } from '@kbn/data-views-plugin/public'; import type { DatatableUtilitiesService } from '@kbn/data-plugin/common'; import { BrushTriggerEvent, ClickTriggerEvent } from '@kbn/charts-plugin/public'; +import { RequestAdapter } from '@kbn/inspector-plugin/common'; +import { ISearchStart } from '@kbn/data-plugin/public'; +import React from 'react'; import type { Document } from './persistence/saved_object_store'; import { Datasource, @@ -77,8 +80,6 @@ export function getInitialDataViewsObject( return { indexPatterns, indexPatternRefs, - existingFields: {}, - isFirstExistenceFetch: true, }; } @@ -104,9 +105,6 @@ export async function refreshIndexPatternsList({ onIndexPatternRefresh: () => onRefreshCallbacks.forEach((fn) => fn()), }); const indexPattern = newlyMappedIndexPattern[indexPatternId]; - // But what about existingFields here? - // When the indexPatterns cache object gets updated, the data panel will - // notice it and refetch the fields list existence map indexPatternService.updateDataViewsState({ indexPatterns: { ...indexPatternsCache, @@ -285,3 +283,36 @@ export const isOperationFromTheSameGroup = (op1?: DraggingIdentifier, op2?: Drag op1.layerId === op2.layerId ); }; + +export const getSearchWarningMessages = ( + adapter: RequestAdapter, + datasource: Datasource, + state: unknown, + deps: { + searchService: ISearchStart; + } +) => { + const warningsMap: Map<string, Array<string | React.ReactNode>> = new Map(); + + deps.searchService.showWarnings(adapter, (warning, meta) => { + const { request, response, requestId } = meta; + + const warningMessages = datasource.getSearchWarningMessages?.( + state, + warning, + request, + response + ); + + if (warningMessages?.length) { + const key = (requestId ?? '') + warning.type + warning.reason?.type ?? ''; + if (!warningsMap.has(key)) { + warningsMap.set(key, warningMessages); + } + return true; + } + return false; + }); + + return [...warningsMap.values()].flat(); +}; 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 e6683aee13499..a38d669d73cd5 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx @@ -550,22 +550,16 @@ describe('Datatable Visualization', () => { expect(columnArgs[0].arguments).toEqual( expect.objectContaining({ columnId: ['c'], - hidden: [], - width: [], - isTransposed: [], + palette: [expect.any(Object)], transposable: [true], - alignment: [], colorMode: ['none'], }) ); expect(columnArgs[1].arguments).toEqual( expect.objectContaining({ columnId: ['b'], - hidden: [], - width: [], - isTransposed: [], + palette: [expect.objectContaining({})], transposable: [true], - alignment: [], colorMode: ['none'], }) ); @@ -592,14 +586,16 @@ describe('Datatable Visualization', () => { }); it('sets pagination based on state', () => { - expect(getDatatableExpressionArgs({ ...defaultExpressionTableState }).pageSize).toEqual([]); + expect(getDatatableExpressionArgs({ ...defaultExpressionTableState }).pageSize).toEqual( + undefined + ); expect( getDatatableExpressionArgs({ ...defaultExpressionTableState, paging: { size: 20, enabled: false }, }).pageSize - ).toEqual([]); + ).toEqual(undefined); expect( getDatatableExpressionArgs({ diff --git a/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx b/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx index 60de4d4d1148c..88bd970b49bb7 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { render } from 'react-dom'; -import { Ast, AstFunction } from '@kbn/interpreter'; +import { Ast } from '@kbn/interpreter'; import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { PaletteRegistry, CUSTOM_PALETTE } from '@kbn/coloring'; @@ -16,6 +16,7 @@ import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { IconChartDatatable } from '@kbn/chart-icons'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; +import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugin/common'; import type { FormBasedPersistedState } from '../../datasources/form_based/types'; import type { SuggestionRequest, @@ -28,7 +29,14 @@ import { TableDimensionEditor } from './components/dimension_editor'; import { TableDimensionEditorAdditionalSection } from './components/dimension_editor_addtional_section'; import type { LayerType } from '../../../common'; import { getDefaultSummaryLabel } from '../../../common/expressions/datatable/summary'; -import type { ColumnState, SortingState, PagingState } from '../../../common/expressions'; +import type { + ColumnState, + SortingState, + PagingState, + CollapseExpressionFunction, + DatatableColumnFunction, + DatatableExpressionFunction, +} from '../../../common/expressions'; import { DataTableToolbar } from './components/toolbar'; export interface DatatableVisualizationState { @@ -291,6 +299,7 @@ export const getDatatableVisualization = ({ }), supportsMoreColumns: true, filterOperations: (op) => !op.isBucketed, + isMetricDimension: true, requiredMinDimensionCount: 1, dataTestSubj: 'lnsDatatable_metrics', enableDimensionEditor: true, @@ -398,108 +407,84 @@ export const getDatatableVisualization = ({ const datasourceExpression = datasourceExpressionsByLayers[state.layerId]; + const lensCollapseFnAsts = columns + .filter((c) => c.collapseFn) + .map((c) => + buildExpressionFunction<CollapseExpressionFunction>('lens_collapse', { + by: columns + .filter( + (col) => + col.columnId !== c.columnId && + datasource!.getOperationForColumnId(col.columnId)?.isBucketed + ) + .map((col) => col.columnId), + metric: columns + .filter((col) => !datasource!.getOperationForColumnId(col.columnId)?.isBucketed) + .map((col) => col.columnId), + fn: [c.collapseFn!], + }).toAst() + ); + + const datatableFnAst = buildExpressionFunction<DatatableExpressionFunction>('lens_datatable', { + title: title || '', + description: description || '', + columns: columns + .filter((c) => !c.collapseFn) + .map((column) => { + const paletteParams = { + ...column.palette?.params, + // rewrite colors and stops as two distinct arguments + colors: (column.palette?.params?.stops || []).map(({ color }) => color), + stops: + column.palette?.params?.name === 'custom' + ? (column.palette?.params?.stops || []).map(({ stop }) => stop) + : [], + reverse: false, // managed at UI level + }; + const sortingHint = datasource!.getOperationForColumnId(column.columnId)!.sortingHint; + + const hasNoSummaryRow = column.summaryRow == null || column.summaryRow === 'none'; + + const canColor = + datasource!.getOperationForColumnId(column.columnId)?.dataType === 'number'; + + const datatableColumnFn = buildExpressionFunction<DatatableColumnFunction>( + 'lens_datatable_column', + { + columnId: column.columnId, + hidden: column.hidden, + oneClickFilter: column.oneClickFilter, + width: column.width, + isTransposed: column.isTransposed, + transposable: !datasource!.getOperationForColumnId(column.columnId)?.isBucketed, + alignment: column.alignment, + colorMode: canColor && column.colorMode ? column.colorMode : 'none', + palette: paletteService.get(CUSTOM_PALETTE).toExpression(paletteParams), + summaryRow: hasNoSummaryRow ? undefined : column.summaryRow!, + summaryLabel: hasNoSummaryRow + ? undefined + : column.summaryLabel ?? getDefaultSummaryLabel(column.summaryRow!), + sortingHint, + } + ); + return buildExpression([datatableColumnFn]).toAst(); + }), + sortingColumnId: state.sorting?.columnId || '', + sortingDirection: state.sorting?.direction || 'none', + fitRowToContent: state.rowHeight === 'auto', + headerRowHeight: state.headerRowHeight ?? 'single', + rowHeightLines: + !state.rowHeight || state.rowHeight === 'single' ? 1 : state.rowHeightLines ?? 2, + headerRowHeightLines: + !state.headerRowHeight || state.headerRowHeight === 'single' + ? 1 + : state.headerRowHeightLines ?? 2, + pageSize: state.paging?.enabled ? state.paging.size : undefined, + }).toAst(); + return { type: 'expression', - chain: [ - ...(datasourceExpression?.chain ?? []), - ...columns - .filter((c) => c.collapseFn) - .map((c) => { - return { - type: 'function', - function: 'lens_collapse', - arguments: { - by: columns - .filter( - (col) => - col.columnId !== c.columnId && - datasource!.getOperationForColumnId(col.columnId)?.isBucketed - ) - .map((col) => col.columnId), - metric: columns - .filter((col) => !datasource!.getOperationForColumnId(col.columnId)?.isBucketed) - .map((col) => col.columnId), - fn: [c.collapseFn!], - }, - } as AstFunction; - }), - { - type: 'function', - function: 'lens_datatable', - arguments: { - title: [title || ''], - description: [description || ''], - columns: columns - .filter((c) => !c.collapseFn) - .map((column) => { - const paletteParams = { - ...column.palette?.params, - // rewrite colors and stops as two distinct arguments - colors: (column.palette?.params?.stops || []).map(({ color }) => color), - stops: - column.palette?.params?.name === 'custom' - ? (column.palette?.params?.stops || []).map(({ stop }) => stop) - : [], - reverse: false, // managed at UI level - }; - const sortingHint = datasource!.getOperationForColumnId( - column.columnId - )!.sortingHint; - - const hasNoSummaryRow = column.summaryRow == null || column.summaryRow === 'none'; - - const canColor = - datasource!.getOperationForColumnId(column.columnId)?.dataType === 'number'; - - return { - type: 'expression', - chain: [ - { - type: 'function', - function: 'lens_datatable_column', - arguments: { - columnId: [column.columnId], - hidden: typeof column.hidden === 'undefined' ? [] : [column.hidden], - oneClickFilter: - typeof column.oneClickFilter === 'undefined' - ? [] - : [column.oneClickFilter], - width: typeof column.width === 'undefined' ? [] : [column.width], - isTransposed: - typeof column.isTransposed === 'undefined' ? [] : [column.isTransposed], - transposable: [ - !datasource!.getOperationForColumnId(column.columnId)?.isBucketed, - ], - alignment: - typeof column.alignment === 'undefined' ? [] : [column.alignment], - colorMode: [canColor && column.colorMode ? column.colorMode : 'none'], - palette: [paletteService.get(CUSTOM_PALETTE).toExpression(paletteParams)], - summaryRow: hasNoSummaryRow ? [] : [column.summaryRow!], - summaryLabel: hasNoSummaryRow - ? [] - : [column.summaryLabel ?? getDefaultSummaryLabel(column.summaryRow!)], - sortingHint: sortingHint ? [sortingHint] : [], - }, - }, - ], - }; - }), - sortingColumnId: [state.sorting?.columnId || ''], - sortingDirection: [state.sorting?.direction || 'none'], - fitRowToContent: [state.rowHeight === 'auto'], - headerRowHeight: [state.headerRowHeight ?? 'single'], - rowHeightLines: [ - !state.rowHeight || state.rowHeight === 'single' ? 1 : state.rowHeightLines ?? 2, - ], - headerRowHeightLines: [ - !state.headerRowHeight || state.headerRowHeight === 'single' - ? 1 - : state.headerRowHeightLines ?? 2, - ], - pageSize: state.paging?.enabled ? [state.paging.size] : [], - }, - }, - ], + chain: [...(datasourceExpression?.chain ?? []), ...lensCollapseFnAsts, datatableFnAst], }; }, diff --git a/x-pack/plugins/lens/public/visualizations/gauge/constants.ts b/x-pack/plugins/lens/public/visualizations/gauge/constants.ts index 3c6ab9f8471b8..29ee228848163 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/constants.ts +++ b/x-pack/plugins/lens/public/visualizations/gauge/constants.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { GaugeState as GaugeStateOriginal } from '@kbn/expression-gauge-plugin/common'; +import type { GaugeState as GaugeStateOriginal } from '@kbn/expression-gauge-plugin/common'; import { LayerType } from '../../../common'; export const LENS_GAUGE_ID = 'lnsGauge'; 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 1ecedc1a63c41..1041a7bb36078 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts @@ -102,6 +102,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.METRIC, groupLabel: 'Metric', + isMetricDimension: true, accessors: [{ columnId: 'metric-accessor', triggerIcon: 'none' }], filterOperations: isNumericDynamicMetric, supportsMoreColumns: false, @@ -118,6 +119,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.MIN, groupLabel: 'Minimum value', + isMetricDimension: true, accessors: [{ columnId: 'min-accessor' }], filterOperations: isNumericMetric, supportsMoreColumns: false, @@ -135,6 +137,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.MAX, groupLabel: 'Maximum value', + isMetricDimension: true, accessors: [{ columnId: 'max-accessor' }], filterOperations: isNumericMetric, supportsMoreColumns: false, @@ -152,6 +155,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.GOAL, groupLabel: 'Goal value', + isMetricDimension: true, accessors: [{ columnId: 'goal-accessor' }], filterOperations: isNumericMetric, supportsMoreColumns: false, @@ -184,6 +188,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.METRIC, groupLabel: 'Metric', + isMetricDimension: true, accessors: [], filterOperations: isNumericDynamicMetric, supportsMoreColumns: true, @@ -200,6 +205,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.MIN, groupLabel: 'Minimum value', + isMetricDimension: true, accessors: [{ columnId: 'min-accessor' }], filterOperations: isNumericMetric, supportsMoreColumns: false, @@ -217,6 +223,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.MAX, groupLabel: 'Maximum value', + isMetricDimension: true, accessors: [], filterOperations: isNumericMetric, supportsMoreColumns: true, @@ -234,6 +241,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.GOAL, groupLabel: 'Goal value', + isMetricDimension: true, accessors: [], filterOperations: isNumericMetric, supportsMoreColumns: true, @@ -272,6 +280,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.METRIC, groupLabel: 'Metric', + isMetricDimension: true, accessors: [{ columnId: 'metric-accessor', triggerIcon: 'none' }], filterOperations: isNumericDynamicMetric, supportsMoreColumns: false, @@ -288,6 +297,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.MIN, groupLabel: 'Minimum value', + isMetricDimension: true, accessors: [{ columnId: 'min-accessor' }], filterOperations: isNumericMetric, supportsMoreColumns: false, @@ -305,6 +315,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.MAX, groupLabel: 'Maximum value', + isMetricDimension: true, accessors: [{ columnId: 'max-accessor' }], filterOperations: isNumericMetric, supportsMoreColumns: false, @@ -322,6 +333,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.GOAL, groupLabel: 'Goal value', + isMetricDimension: true, accessors: [{ columnId: 'goal-accessor' }], filterOperations: isNumericMetric, supportsMoreColumns: false, @@ -365,6 +377,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.METRIC, groupLabel: 'Metric', + isMetricDimension: true, accessors: [{ columnId: 'metric-accessor', triggerIcon: 'none' }], filterOperations: isNumericDynamicMetric, supportsMoreColumns: false, @@ -381,6 +394,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.MIN, groupLabel: 'Minimum value', + isMetricDimension: true, accessors: [{ columnId: 'min-accessor' }], filterOperations: isNumericMetric, supportsMoreColumns: false, @@ -400,6 +414,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.MAX, groupLabel: 'Maximum value', + isMetricDimension: true, accessors: [{ columnId: 'max-accessor' }], filterOperations: isNumericMetric, supportsMoreColumns: false, @@ -419,6 +434,7 @@ describe('gauge', () => { }, groupId: GROUP_ID.GOAL, groupLabel: 'Goal value', + isMetricDimension: true, accessors: [{ columnId: 'goal-accessor' }], filterOperations: isNumericMetric, supportsMoreColumns: false, @@ -570,8 +586,6 @@ describe('gauge', () => { ticksPosition: ['auto'], labelMajorMode: ['auto'], labelMinor: ['Subtitle'], - labelMajor: [], - palette: [], shape: ['horizontalBullet'], }, }, diff --git a/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx b/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx index 803e4e30acb59..7010615dcd8d6 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx @@ -12,10 +12,10 @@ import { ThemeServiceStart } from '@kbn/core/public'; import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { Ast } from '@kbn/interpreter'; -import { DatatableRow } from '@kbn/expressions-plugin/common'; +import { buildExpressionFunction, DatatableRow } from '@kbn/expressions-plugin/common'; import { PaletteRegistry, CustomPaletteParams, CUSTOM_PALETTE } from '@kbn/coloring'; -import type { GaugeArguments } from '@kbn/expression-gauge-plugin/common'; -import { GaugeShapes, EXPRESSION_GAUGE_NAME } from '@kbn/expression-gauge-plugin/common'; +import type { GaugeExpressionFunctionDefinition } from '@kbn/expression-gauge-plugin/common'; +import { GaugeShapes } from '@kbn/expression-gauge-plugin/common'; import { getGoalValue, getMaxValue, @@ -27,12 +27,7 @@ import { LayerTypes } from '@kbn/expression-xy-plugin/public'; import type { FormBasedPersistedState } from '../../datasources/form_based/types'; import type { DatasourceLayers, OperationMetadata, Suggestion, Visualization } from '../../types'; import { getSuggestions } from './suggestions'; -import { - GROUP_ID, - LENS_GAUGE_ID, - GaugeVisualizationState, - GaugeExpressionState, -} from './constants'; +import { GROUP_ID, LENS_GAUGE_ID, GaugeVisualizationState } from './constants'; import { GaugeToolbar } from './toolbar_component'; import { applyPaletteParams } from '../../shared_components'; import { GaugeDimensionEditor } from './dimension_editor'; @@ -116,7 +111,7 @@ const toExpression = ( paletteService: PaletteRegistry, state: GaugeVisualizationState, datasourceLayers: DatasourceLayers, - attributes?: Partial<Omit<GaugeArguments, keyof GaugeExpressionState | 'ariaLabel'>>, + attributes?: unknown, datasourceExpressionsByLayers: Record<string, Ast> | undefined = {} ): Ast | null => { const datasource = datasourceLayers[state.layerId]; @@ -127,36 +122,25 @@ const toExpression = ( return null; } + const gaugeFn = buildExpressionFunction<GaugeExpressionFunctionDefinition>('gauge', { + metric: state.metricAccessor, + min: state.minAccessor, + max: state.maxAccessor, + goal: state.goalAccessor, + shape: state.shape ?? GaugeShapes.HORIZONTAL_BULLET, + colorMode: state?.colorMode ?? 'none', + palette: state.palette?.params + ? paletteService.get(CUSTOM_PALETTE).toExpression(computePaletteParams(state.palette.params)) + : undefined, + ticksPosition: state.ticksPosition ?? 'auto', + labelMinor: state.labelMinor, + labelMajor: state.labelMajor, + labelMajorMode: state.labelMajorMode ?? 'auto', + }); + return { type: 'expression', - chain: [ - ...(datasourceExpression?.chain ?? []), - { - type: 'function', - function: EXPRESSION_GAUGE_NAME, - arguments: { - metric: state.metricAccessor ? [state.metricAccessor] : [], - min: state.minAccessor ? [state.minAccessor] : [], - max: state.maxAccessor ? [state.maxAccessor] : [], - goal: state.goalAccessor ? [state.goalAccessor] : [], - shape: [state.shape ?? GaugeShapes.HORIZONTAL_BULLET], - colorMode: [state?.colorMode ?? 'none'], - palette: state.palette?.params - ? [ - paletteService - .get(CUSTOM_PALETTE) - .toExpression( - computePaletteParams((state.palette?.params || {}) as CustomPaletteParams) - ), - ] - : [], - ticksPosition: state.ticksPosition ? [state.ticksPosition] : ['auto'], - labelMinor: state.labelMinor ? [state.labelMinor] : [], - labelMajor: state.labelMajor ? [state.labelMajor] : [], - labelMajorMode: state.labelMajorMode ? [state.labelMajorMode] : ['auto'], - }, - }, - ], + chain: [...(datasourceExpression?.chain ?? []), gaugeFn.toAst()], }; }; @@ -260,6 +244,7 @@ export const getGaugeVisualization = ({ defaultMessage: 'Value', }), }, + isMetricDimension: true, accessors: metricAccessor ? [ palette @@ -298,6 +283,7 @@ export const getGaugeVisualization = ({ defaultMessage: 'Value', }), }, + isMetricDimension: true, accessors: state.minAccessor ? [{ columnId: state.minAccessor }] : [], filterOperations: isNumericMetric, supportsMoreColumns: !state.minAccessor, @@ -324,6 +310,7 @@ export const getGaugeVisualization = ({ defaultMessage: 'Value', }), }, + isMetricDimension: true, accessors: state.maxAccessor ? [{ columnId: state.maxAccessor }] : [], filterOperations: isNumericMetric, supportsMoreColumns: !state.maxAccessor, @@ -350,6 +337,7 @@ export const getGaugeVisualization = ({ defaultMessage: 'Value', }), }, + isMetricDimension: true, accessors: state.goalAccessor ? [{ columnId: state.goalAccessor }] : [], filterOperations: isNumericMetric, supportsMoreColumns: !state.goalAccessor, diff --git a/x-pack/plugins/lens/public/visualizations/heatmap/types.ts b/x-pack/plugins/lens/public/visualizations/heatmap/types.ts index 08913ad25a7d3..6be8d3b6e8d95 100644 --- a/x-pack/plugins/lens/public/visualizations/heatmap/types.ts +++ b/x-pack/plugins/lens/public/visualizations/heatmap/types.ts @@ -10,7 +10,7 @@ import type { HeatmapArguments } from '@kbn/expression-heatmap-plugin/common'; import type { LayerType } from '../../../common'; export type ChartShapes = 'heatmap'; -export type HeatmapLayerState = HeatmapArguments & { +export type HeatmapLayerState = Omit<HeatmapArguments, 'palette'> & { layerId: string; layerType: LayerType; valueAccessor?: string; diff --git a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.test.ts index 8f958b8fa75ce..e26fe130e8da9 100644 --- a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.test.ts @@ -156,6 +156,7 @@ describe('heatmap', () => { }, groupId: GROUP_ID.CELL, groupLabel: 'Cell value', + isMetricDimension: true, accessors: [ { columnId: 'v-accessor', @@ -214,6 +215,7 @@ describe('heatmap', () => { }, groupId: GROUP_ID.CELL, groupLabel: 'Cell value', + isMetricDimension: true, accessors: [], filterOperations: isCellValueSupported, supportsMoreColumns: true, @@ -270,6 +272,7 @@ describe('heatmap', () => { }, groupId: GROUP_ID.CELL, groupLabel: 'Cell value', + isMetricDimension: true, accessors: [ { columnId: 'v-accessor', @@ -427,7 +430,6 @@ describe('heatmap', () => { arguments: { isVisible: [true], position: [Position.Right], - legendSize: [], }, }, ], @@ -441,11 +443,6 @@ describe('heatmap', () => { type: 'function', function: HEATMAP_GRID_FUNCTION, arguments: { - // grid - strokeWidth: [], - strokeColor: [], - xTitle: [], - yTitle: [], // cells isCellLabelVisible: [false], // Y-axis @@ -505,6 +502,7 @@ describe('heatmap', () => { ...exampleState(), layerId: 'first', xAccessor: 'x-accessor', + valueAccessor: 'value-accessor', }; expect( @@ -521,7 +519,7 @@ describe('heatmap', () => { arguments: { xAccessor: ['x-accessor'], yAccessor: [''], - valueAccessor: [''], + valueAccessor: ['value-accessor'], palette: [ { type: 'expression', @@ -545,7 +543,7 @@ describe('heatmap', () => { function: LEGEND_FUNCTION, arguments: { isVisible: [false], - position: [], + position: ['right'], }, }, ], @@ -565,10 +563,10 @@ describe('heatmap', () => { isCellLabelVisible: [false], // Y-axis isYAxisLabelVisible: [false], - isYAxisTitleVisible: [true], + isYAxisTitleVisible: [false], // X-axis isXAxisLabelVisible: [false], - isXAxisTitleVisible: [true], + isXAxisTitleVisible: [false], xTitle: [''], yTitle: [''], }, diff --git a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx index b8e98d03843a9..82c455077e7cf 100644 --- a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx @@ -17,14 +17,20 @@ import { ThemeServiceStart } from '@kbn/core/public'; import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; -import type { OperationMetadata, Visualization } from '../../types'; +import { HeatmapConfiguration } from '@kbn/visualizations-plugin/common'; +import { + HeatmapExpressionFunctionDefinition, + HeatmapGridExpressionFunctionDefinition, + HeatmapLegendExpressionFunctionDefinition, +} from '@kbn/expression-heatmap-plugin/common'; +import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugin/common'; +import type { OperationMetadata, Suggestion, Visualization } from '../../types'; import type { HeatmapVisualizationState } from './types'; import { getSuggestions } from './suggestions'; import { CHART_NAMES, CHART_SHAPES, DEFAULT_PALETTE_NAME, - FUNCTION_NAME, GROUP_ID, HEATMAP_GRID_FUNCTION, LEGEND_FUNCTION, @@ -33,6 +39,7 @@ import { import { HeatmapToolbar } from './toolbar_component'; import { HeatmapDimensionEditor } from './dimension_editor'; import { getSafePaletteParams } from './utils'; +import { FormBasedPersistedState } from '../..'; const groupLabelForHeatmap = i18n.translate('xpack.lens.heatmapVisualization.heatmapGroupLabel', { defaultMessage: 'Magnitude', @@ -222,6 +229,7 @@ export const getHeatmapVisualization = ({ ] : [], filterOperations: isCellValueSupported, + isMetricDimension: true, supportsMoreColumns: !state.valueAccessor, enableDimensionEditor: true, requiredMinDimensionCount: 1, @@ -319,82 +327,53 @@ export const getHeatmapVisualization = ({ return null; } + const legendFn = buildExpressionFunction<HeatmapLegendExpressionFunctionDefinition>( + 'heatmap_legend', + { + isVisible: state.legend.isVisible, + position: state.legend.position, + legendSize: state.legend.legendSize, + } + ); + + const gridConfigFn = buildExpressionFunction<HeatmapGridExpressionFunctionDefinition>( + 'heatmap_grid', + { + // grid + strokeWidth: state.gridConfig.strokeWidth, + strokeColor: state.gridConfig.strokeColor, + // cells + isCellLabelVisible: state.gridConfig.isCellLabelVisible, + // Y-axis + isYAxisLabelVisible: state.gridConfig.isYAxisLabelVisible, + isYAxisTitleVisible: state.gridConfig.isYAxisTitleVisible ?? false, + yTitle: state.gridConfig.yTitle, + // X-axis + isXAxisLabelVisible: state.gridConfig.isXAxisLabelVisible, + isXAxisTitleVisible: state.gridConfig.isXAxisTitleVisible ?? false, + xTitle: state.gridConfig.xTitle, + } + ); + + const heatmapFn = buildExpressionFunction<HeatmapExpressionFunctionDefinition>('heatmap', { + xAccessor: state.xAccessor ?? '', + yAccessor: state.yAccessor ?? '', + valueAccessor: state.valueAccessor ?? '', + lastRangeIsRightOpen: state.palette?.params?.continuity + ? ['above', 'all'].includes(state.palette.params.continuity) + : true, + palette: state.palette?.params + ? paletteService + .get(CUSTOM_PALETTE) + .toExpression(computePaletteParams(state.palette?.params)) + : paletteService.get(DEFAULT_PALETTE_NAME).toExpression(), + legend: buildExpression([legendFn]), + gridConfig: buildExpression([gridConfigFn]), + }); + return { type: 'expression', - chain: [ - ...(datasourceExpression?.chain ?? []), - { - type: 'function', - function: FUNCTION_NAME, - arguments: { - xAccessor: [state.xAccessor ?? ''], - yAccessor: [state.yAccessor ?? ''], - valueAccessor: [state.valueAccessor ?? ''], - lastRangeIsRightOpen: [ - state.palette?.params?.continuity - ? ['above', 'all'].includes(state.palette.params.continuity) - : true, - ], - palette: state.palette?.params - ? [ - paletteService - .get(CUSTOM_PALETTE) - .toExpression( - computePaletteParams((state.palette?.params || {}) as CustomPaletteParams) - ), - ] - : [paletteService.get(DEFAULT_PALETTE_NAME).toExpression()], - legend: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: LEGEND_FUNCTION, - arguments: { - isVisible: [state.legend.isVisible], - position: [state.legend.position], - legendSize: state.legend.legendSize ? [state.legend.legendSize] : [], - }, - }, - ], - }, - ], - gridConfig: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: HEATMAP_GRID_FUNCTION, - arguments: { - // grid - strokeWidth: state.gridConfig.strokeWidth - ? [state.gridConfig.strokeWidth] - : [], - strokeColor: state.gridConfig.strokeColor - ? [state.gridConfig.strokeColor] - : [], - // cells - isCellLabelVisible: [state.gridConfig.isCellLabelVisible], - // Y-axis - isYAxisLabelVisible: [state.gridConfig.isYAxisLabelVisible], - isYAxisTitleVisible: [state.gridConfig.isYAxisTitleVisible ?? false], - yTitle: state.gridConfig.yTitle ? [state.gridConfig.yTitle] : [], - // X-axis - isXAxisLabelVisible: state.gridConfig.isXAxisLabelVisible - ? [state.gridConfig.isXAxisLabelVisible] - : [], - isXAxisTitleVisible: [state.gridConfig.isXAxisTitleVisible ?? false], - xTitle: state.gridConfig.xTitle ? [state.gridConfig.xTitle] : [], - }, - }, - ], - }, - ], - }, - }, - ], + chain: [...(datasourceExpression?.chain ?? []), heatmapFn.toAst()], }; }, @@ -405,73 +384,52 @@ export const getHeatmapVisualization = ({ const originalOrder = datasource?.getTableSpec().map(({ columnId }) => columnId); // When we add a column it could be empty, and therefore have no order - if (!originalOrder) { + if (!originalOrder || !state.valueAccessor) { return null; } + const legendFn = buildExpressionFunction<HeatmapLegendExpressionFunctionDefinition>( + 'heatmap_legend', + { + isVisible: false, + position: 'right', + } + ); + + const gridConfigFn = buildExpressionFunction<HeatmapGridExpressionFunctionDefinition>( + 'heatmap_grid', + { + // grid + strokeWidth: 1, + // cells + isCellLabelVisible: false, + // Y-axis + isYAxisLabelVisible: false, + isYAxisTitleVisible: false, + yTitle: state.gridConfig.yTitle ?? '', + // X-axis + isXAxisLabelVisible: false, + isXAxisTitleVisible: false, + xTitle: state.gridConfig.xTitle ?? '', + } + ); + + const heatmapFn = buildExpressionFunction<HeatmapExpressionFunctionDefinition>('heatmap', { + xAccessor: state.xAccessor ?? '', + yAccessor: state.yAccessor ?? '', + valueAccessor: state.valueAccessor ?? '', + legend: buildExpression([legendFn]), + gridConfig: buildExpression([gridConfigFn]), + palette: state.palette?.params + ? paletteService + .get(CUSTOM_PALETTE) + .toExpression(computePaletteParams(state.palette?.params)) + : paletteService.get(DEFAULT_PALETTE_NAME).toExpression(), + }); + return { type: 'expression', - chain: [ - ...(datasourceExpression?.chain ?? []), - { - type: 'function', - function: FUNCTION_NAME, - arguments: { - xAccessor: [state.xAccessor ?? ''], - yAccessor: [state.yAccessor ?? ''], - valueAccessor: [state.valueAccessor ?? ''], - legend: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: LEGEND_FUNCTION, - arguments: { - isVisible: [false], - position: [], - }, - }, - ], - }, - ], - palette: state.palette?.params - ? [ - paletteService - .get(CUSTOM_PALETTE) - .toExpression( - computePaletteParams((state.palette?.params || {}) as CustomPaletteParams) - ), - ] - : [paletteService.get(DEFAULT_PALETTE_NAME).toExpression()], - gridConfig: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: HEATMAP_GRID_FUNCTION, - arguments: { - // grid - strokeWidth: [1], - // cells - isCellLabelVisible: [false], - // Y-axis - isYAxisLabelVisible: [false], - isYAxisTitleVisible: [state.gridConfig.isYAxisTitleVisible], - yTitle: [state.gridConfig.yTitle ?? ''], - // X-axis - isXAxisLabelVisible: [false], - isXAxisTitleVisible: [state.gridConfig.isXAxisTitleVisible], - xTitle: [state.gridConfig.xTitle ?? ''], - }, - }, - ], - }, - ], - }, - }, - ], + chain: [...(datasourceExpression?.chain ?? []), heatmapFn.toAst()], }; }, @@ -525,4 +483,28 @@ export const getHeatmapVisualization = ({ ] : undefined; }, + + getSuggestionFromConvertToLensContext({ suggestions, context }) { + const allSuggestions = suggestions as Array< + Suggestion<HeatmapVisualizationState, FormBasedPersistedState> + >; + const suggestion: Suggestion<HeatmapVisualizationState, FormBasedPersistedState> = { + ...allSuggestions[0], + datasourceState: { + ...allSuggestions[0].datasourceState, + layers: allSuggestions.reduce( + (acc, s) => ({ + ...acc, + ...s.datasourceState?.layers, + }), + {} + ), + }, + visualizationState: { + ...allSuggestions[0].visualizationState, + ...(context.configuration as HeatmapConfiguration), + }, + }; + return suggestion; + }, }); 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 517e331634880..6724b9aafa0d1 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 @@ -368,7 +368,9 @@ describe('metric_visualization', () => { "type": "expression", }, ], - "palette": Array [], + "percentageMode": Array [ + false, + ], "showLabels": Array [ true, ], 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 37304e09523a7..8299cf3c3a36b 100644 --- a/x-pack/plugins/lens/public/visualizations/legacy_metric/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/legacy_metric/visualization.tsx @@ -16,6 +16,15 @@ import { ColorMode, CustomPaletteState } from '@kbn/charts-plugin/common'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { IconChartMetric } from '@kbn/chart-icons'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; +import { + buildExpression, + buildExpressionFunction, + ExpressionFunctionFont, + FontWeight, + TextAlignment, +} from '@kbn/expressions-plugin/common'; +import { ExpressionFunctionVisDimension } from '@kbn/visualizations-plugin/common'; +import type { MetricVisExpressionFunctionDefinition } from '@kbn/expression-legacy-metric-vis-plugin/common'; import { getSuggestions } from './metric_suggestions'; import { Visualization, OperationMetadata, DatasourceLayers } from '../../types'; import type { LegacyMetricState } from '../../../common/types'; @@ -97,75 +106,48 @@ const toExpression = ( }; const metricFontSize = labelToMetricFontSizeMap[state?.size || DEFAULT_TITLE_SIZE]; + const fontFn = buildExpressionFunction<ExpressionFunctionFont>('font', { + align: (state?.textAlign || DEFAULT_TEXT_ALIGNMENT) as TextAlignment, + size: metricFontSize, + weight: '600' as FontWeight, + lHeight: metricFontSize * 1.5, + sizeUnit: labelFont.sizeUnit, + }); + + const labelFontFn = buildExpressionFunction<ExpressionFunctionFont>('font', { + align: (state?.textAlign || DEFAULT_TEXT_ALIGNMENT) as TextAlignment, + size: labelFont.size, + lHeight: labelFont.size * 1.5, + sizeUnit: labelFont.sizeUnit, + }); + + const visdimensionFn = buildExpressionFunction<ExpressionFunctionVisDimension>('visdimension', { + accessor: state.accessor, + }); + + const legacyMetricVisFn = buildExpressionFunction<MetricVisExpressionFunctionDefinition>( + 'legacyMetricVis', + { + autoScaleMetricAlignment: state?.autoScaleMetricAlignment, + labelPosition: state?.titlePosition || DEFAULT_TITLE_POSITION, + font: buildExpression([fontFn]), + labelFont: buildExpression([labelFontFn]), + metric: buildExpression([visdimensionFn]), + showLabels: !attributes?.mode || attributes?.mode === 'full', + colorMode: !canColor ? ColorMode.None : state?.colorMode || ColorMode.None, + autoScale: true, + colorFullBackground: true, + palette: + state?.colorMode && state?.colorMode !== ColorMode.None + ? paletteService.get(CUSTOM_PALETTE).toExpression(paletteParams) + : undefined, + percentageMode: false, + } + ); + return { type: 'expression', - chain: [ - ...(datasourceExpression?.chain ?? []), - { - type: 'function', - function: 'legacyMetricVis', - arguments: { - labelPosition: [state?.titlePosition || DEFAULT_TITLE_POSITION], - font: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: 'font', - arguments: { - align: [state?.textAlign || DEFAULT_TEXT_ALIGNMENT], - size: [metricFontSize], - weight: ['600'], - lHeight: [metricFontSize * 1.5], - sizeUnit: [labelFont.sizeUnit], - }, - }, - ], - }, - ], - labelFont: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: 'font', - arguments: { - align: [state?.textAlign || DEFAULT_TEXT_ALIGNMENT], - size: [labelFont.size], - lHeight: [labelFont.size * 1.5], - sizeUnit: [labelFont.sizeUnit], - }, - }, - ], - }, - ], - metric: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: 'visdimension', - arguments: { - accessor: [state.accessor], - }, - }, - ], - }, - ], - showLabels: [!attributes?.mode || attributes?.mode === 'full'], - colorMode: !canColor ? [ColorMode.None] : [state?.colorMode || ColorMode.None], - autoScale: [true], - colorFullBackground: [true], - palette: - state?.colorMode && state?.colorMode !== ColorMode.None - ? [paletteService.get(CUSTOM_PALETTE).toExpression(paletteParams)] - : [], - }, - }, - ], + chain: [...(datasourceExpression?.chain ?? []), legacyMetricVisFn.toAst()], }; }; @@ -241,6 +223,7 @@ export const getLegacyMetricVisualization = ({ defaultMessage: 'Value', }), }, + isMetricDimension: true, groupLabel: i18n.translate('xpack.lens.metric.label', { defaultMessage: 'Metric', }), 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 6114628b3adf4..64b509e5f7a8c 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 @@ -20,6 +20,7 @@ Object { }, "groupId": "metric", "groupLabel": "Primary metric", + "isMetricDimension": true, "paramEditorCustomProps": Object { "headingLabel": "Value", }, @@ -41,6 +42,7 @@ Object { }, "groupId": "secondaryMetric", "groupLabel": "Secondary metric", + "isMetricDimension": true, "paramEditorCustomProps": Object { "headingLabel": "Value", }, 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 97c8a3c995aab..1326f5369cbd2 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/to_expression.ts +++ b/x-pack/plugins/lens/public/visualizations/metric/to_expression.ts @@ -5,12 +5,13 @@ * 2.0. */ +import { LayoutDirection } from '@elastic/charts'; import { CustomPaletteParams, CUSTOM_PALETTE, PaletteRegistry } from '@kbn/coloring'; -import { - EXPRESSION_METRIC_NAME, - EXPRESSION_METRIC_TRENDLINE_NAME, -} from '@kbn/expression-metric-vis-plugin/public'; -import { buildExpressionFunction } from '@kbn/expressions-plugin/common'; +import type { + TrendlineExpressionFunctionDefinition, + MetricVisExpressionFunctionDefinition, +} from '@kbn/expression-metric-vis-plugin/common'; +import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugin/common'; import { Ast } from '@kbn/interpreter'; import { CollapseArgs, CollapseFunction } from '../../../common/expressions'; import { CollapseExpressionFunction } from '../../../common/expressions/collapse/types'; @@ -33,51 +34,47 @@ const getTrendlineExpression = ( state: MetricVisualizationState, datasourceExpressionsByLayers: Record<string, Ast> ): Ast | undefined => { - if (!state.trendlineLayerId || !state.trendlineMetricAccessor || !state.trendlineTimeAccessor) { + const { trendlineLayerId, trendlineMetricAccessor, trendlineTimeAccessor } = state; + if (!trendlineLayerId || !trendlineMetricAccessor || !trendlineTimeAccessor) { return; } - const datasourceExpression = datasourceExpressionsByLayers[state.trendlineLayerId]; + const datasourceExpression = datasourceExpressionsByLayers[trendlineLayerId]; - return { - type: 'expression', - chain: [ - { - type: 'function', - function: EXPRESSION_METRIC_TRENDLINE_NAME, - arguments: { - metric: [state.trendlineMetricAccessor], - timeField: [state.trendlineTimeAccessor], - breakdownBy: - state.trendlineBreakdownByAccessor && !state.collapseFn - ? [state.trendlineBreakdownByAccessor] - : [], - inspectorTableId: [state.trendlineLayerId], - ...(datasourceExpression - ? { - table: [ - { - ...datasourceExpression, - chain: [ - ...datasourceExpression.chain, - ...(state.collapseFn - ? [ - buildExpressionFunction<CollapseExpressionFunction>('lens_collapse', { - by: [state.trendlineTimeAccessor], - metric: [state.trendlineMetricAccessor], - fn: [state.collapseFn], - }).toAst(), - ] - : []), - ], - }, - ], - } - : {}), + if (!datasourceExpression) { + return; + } + + const metricTrendlineFn = buildExpressionFunction<TrendlineExpressionFunctionDefinition>( + 'metricTrendline', + { + metric: trendlineMetricAccessor, + timeField: trendlineTimeAccessor, + breakdownBy: + state.trendlineBreakdownByAccessor && !state.collapseFn + ? state.trendlineBreakdownByAccessor + : undefined, + inspectorTableId: trendlineLayerId, + table: [ + { + ...datasourceExpression, + chain: [ + ...datasourceExpression.chain, + ...(state.collapseFn + ? [ + buildExpressionFunction<CollapseExpressionFunction>('lens_collapse', { + by: [trendlineTimeAccessor], + metric: [trendlineMetricAccessor], + fn: [state.collapseFn], + }).toAst(), + ] + : []), + ], }, - }, - ], - }; + ], + } + ); + return buildExpression([metricTrendlineFn]).toAst(); }; export const toExpression = ( @@ -135,38 +132,35 @@ export const toExpression = ( const trendlineExpression = getTrendlineExpression(state, datasourceExpressionsByLayers); + const metricFn = buildExpressionFunction<MetricVisExpressionFunctionDefinition>('metricVis', { + metric: state.metricAccessor, + secondaryMetric: state.secondaryMetricAccessor, + secondaryPrefix: state.secondaryPrefix, + max: showingBar(state) ? state.maxAccessor : undefined, + breakdownBy: + state.breakdownByAccessor && !state.collapseFn ? state.breakdownByAccessor : undefined, + trendline: trendlineExpression ? [trendlineExpression] : [], + subtitle: state.subtitle ?? undefined, + progressDirection: state.progressDirection as LayoutDirection, + color: state.color || getDefaultColor(state), + palette: state.palette?.params + ? [ + paletteService + .get(CUSTOM_PALETTE) + .toExpression(computePaletteParams(state.palette.params as CustomPaletteParams)), + ] + : [], + maxCols: state.maxCols ?? DEFAULT_MAX_COLUMNS, + minTiles: maxPossibleTiles ?? undefined, + inspectorTableId: state.layerId, + }); + return { type: 'expression', chain: [ ...(datasourceExpression?.chain ?? []), ...(collapseExpressionFunction ? [collapseExpressionFunction] : []), - { - type: 'function', - function: EXPRESSION_METRIC_NAME, - arguments: { - metric: state.metricAccessor ? [state.metricAccessor] : [], - secondaryMetric: state.secondaryMetricAccessor ? [state.secondaryMetricAccessor] : [], - secondaryPrefix: - typeof state.secondaryPrefix !== 'undefined' ? [state.secondaryPrefix] : [], - max: showingBar(state) ? [state.maxAccessor] : [], - breakdownBy: - state.breakdownByAccessor && !state.collapseFn ? [state.breakdownByAccessor] : [], - trendline: trendlineExpression ? [trendlineExpression] : [], - subtitle: state.subtitle ? [state.subtitle] : [], - progressDirection: state.progressDirection ? [state.progressDirection] : [], - color: [state.color || getDefaultColor(state)], - palette: state.palette?.params - ? [ - paletteService - .get(CUSTOM_PALETTE) - .toExpression(computePaletteParams(state.palette.params as CustomPaletteParams)), - ] - : [], - maxCols: [state.maxCols ?? DEFAULT_MAX_COLUMNS], - minTiles: maxPossibleTiles ? [maxPossibleTiles] : [], - inspectorTableId: [state.layerId], - }, - }, + metricFn.toAst(), ], }; }; 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 2a89ef784492d..41e9fab67d4d6 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts @@ -300,21 +300,18 @@ describe('metric visualization', () => { "chain": Array [ Object { "arguments": Object { - "breakdownBy": Array [], "color": Array [ "static-color", ], "inspectorTableId": Array [ "first", ], - "max": Array [], "maxCols": Array [ 5, ], "metric": Array [ "metric-col-id", ], - "minTiles": Array [], "palette": Array [ Object { "chain": Array [ @@ -370,7 +367,6 @@ describe('metric visualization', () => { "inspectorTableId": Array [ "first", ], - "max": Array [], "maxCols": Array [ 5, ], @@ -473,7 +469,6 @@ describe('metric visualization', () => { "chain": Array [ Object { "arguments": Object { - "breakdownBy": Array [], "inspectorTableId": Array [ "second", ], @@ -520,7 +515,6 @@ describe('metric visualization', () => { "chain": Array [ Object { "arguments": Object { - "breakdownBy": Array [], "inspectorTableId": Array [ "second", ], @@ -608,8 +602,8 @@ describe('metric visualization', () => { "type": "function", } `); - expect(ast.chain[1].arguments.minTiles).toHaveLength(0); - expect(ast.chain[1].arguments.breakdownBy).toHaveLength(0); + expect(ast.chain[1].arguments.minTiles).toBeUndefined(); + expect(ast.chain[1].arguments.breakdownBy).toBeUndefined(); }); it('always applies max function to static max dimensions', () => { diff --git a/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx b/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx index eac08b22c9ea4..3b3546655dce3 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx @@ -141,6 +141,7 @@ const getMetricLayerConfiguration = ( : [], supportsMoreColumns: !props.state.metricAccessor, filterOperations: isSupportedDynamicMetric, + isMetricDimension: true, enableDimensionEditor: true, enableFormatSelector: true, formatSelectorOptions: formatterOptions, @@ -166,6 +167,7 @@ const getMetricLayerConfiguration = ( : [], supportsMoreColumns: !props.state.secondaryMetricAccessor, filterOperations: isSupportedDynamicMetric, + isMetricDimension: true, enableDimensionEditor: true, enableFormatSelector: true, formatSelectorOptions: formatterOptions, diff --git a/x-pack/plugins/lens/public/visualizations/partition/to_expression.ts b/x-pack/plugins/lens/public/visualizations/partition/to_expression.ts index 3f66965dc98b6..42371f85e5984 100644 --- a/x-pack/plugins/lens/public/visualizations/partition/to_expression.ts +++ b/x-pack/plugins/lens/public/visualizations/partition/to_expression.ts @@ -5,11 +5,24 @@ * 2.0. */ -import type { Ast, AstFunction } from '@kbn/interpreter'; +import type { Ast } from '@kbn/interpreter'; import { Position } from '@elastic/charts'; import type { PaletteOutput, PaletteRegistry } from '@kbn/coloring'; import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugin/public'; +import type { + LabelPositions, + MosaicVisExpressionFunctionDefinition, + PartitionLabelsExpressionFunctionDefinition, + PieVisExpressionFunctionDefinition, + TreemapVisExpressionFunctionDefinition, + ValueFormats, + LegendDisplay as PartitionVisLegendDisplay, + WaffleVisExpressionFunctionDefinition, +} from '@kbn/expression-partition-vis-plugin/common'; +import { ExpressionFunctionTheme } from '@kbn/expressions-plugin/common'; +import { ExpressionFunctionVisDimension } from '@kbn/visualizations-plugin/common'; +import type { CollapseExpressionFunction } from '../../../common/expressions'; import type { Operation, DatasourcePublicAPI, DatasourceLayers } from '../../types'; import { DEFAULT_PERCENT_DECIMALS } from './constants'; import { shouldShowValuesInLegend } from './render_helpers'; @@ -45,15 +58,6 @@ type GenerateExpressionAstFunction = ( paletteService: PaletteRegistry ) => Ast | null; -type GenerateExpressionAstArguments = ( - state: PieVisualizationState, - attributes: Attributes, - operations: OperationColumnId[], - layer: PieLayerState, - datasourceLayers: DatasourceLayers, - paletteService: PaletteRegistry -) => Ast['chain'][number]['arguments']; - type GenerateLabelsAstArguments = ( state: PieVisualizationState, attributes: Attributes, @@ -74,30 +78,25 @@ export const getSortedGroups = ( return Array.from(new Set(originalOrder?.concat(layer[accessor] ?? []))); }; -const prepareDimension = (accessor: string) => { - const visdimension = buildExpressionFunction('visdimension', { accessor }); - return buildExpression([visdimension]).toAst(); -}; +const prepareDimension = (accessor: string) => + buildExpression([ + buildExpressionFunction<ExpressionFunctionVisDimension>('visdimension', { accessor }), + ]).toAst(); const generateCommonLabelsAstArgs: GenerateLabelsAstArguments = (state, attributes, layer) => { - const show = [!attributes.isPreview && layer.categoryDisplay !== CategoryDisplay.HIDE]; - const position = layer.categoryDisplay !== CategoryDisplay.HIDE ? [layer.categoryDisplay] : []; - const values = [layer.numberDisplay !== NumberDisplay.HIDDEN]; - const valuesFormat = layer.numberDisplay !== NumberDisplay.HIDDEN ? [layer.numberDisplay] : []; - const percentDecimals = [layer.percentDecimals ?? DEFAULT_PERCENT_DECIMALS]; + const show = !attributes.isPreview && layer.categoryDisplay !== CategoryDisplay.HIDE; + const position = + layer.categoryDisplay !== CategoryDisplay.HIDE ? (layer.categoryDisplay as LabelPositions) : []; + const values = layer.numberDisplay !== NumberDisplay.HIDDEN; + const valuesFormat = + layer.numberDisplay !== NumberDisplay.HIDDEN ? (layer.numberDisplay as ValueFormats) : []; + const percentDecimals = layer.percentDecimals ?? DEFAULT_PERCENT_DECIMALS; + const partitionLabelsFn = buildExpressionFunction<PartitionLabelsExpressionFunctionDefinition>( + 'partitionLabels', + { show, position, values, valuesFormat, percentDecimals } + ); - return [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: 'partitionLabels', - arguments: { show, position, values, valuesFormat, percentDecimals }, - }, - ], - }, - ]; + return [buildExpression([partitionLabelsFn]).toAst()]; }; const generateWaffleLabelsAstArguments: GenerateLabelsAstArguments = (...args) => { @@ -117,29 +116,22 @@ const generatePaletteAstArguments = ( ): [Ast] => palette ? [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: 'theme', - arguments: { - variable: ['palette'], - default: [paletteService.get(palette.name).toExpression(palette.params)], - }, - }, - ], - }, + buildExpression([ + buildExpressionFunction<ExpressionFunctionTheme>('theme', { + variable: 'palette', + default: paletteService.get(palette.name).toExpression(palette.params), + }), + ]).toAst(), ] : [paletteService.get('default').toExpression()]; -const generateCommonArguments: GenerateExpressionAstArguments = ( - state, - attributes, - operations, - layer, - datasourceLayers, - paletteService +const generateCommonArguments = ( + state: PieVisualizationState, + attributes: Attributes, + operations: OperationColumnId[], + layer: PieLayerState, + datasourceLayers: DatasourceLayers, + paletteService: PaletteRegistry ) => { return { labels: generateCommonLabelsAstArgs(state, attributes, layer), @@ -147,108 +139,81 @@ const generateCommonArguments: GenerateExpressionAstArguments = ( .filter(({ columnId }) => !isCollapsed(columnId, layer)) .map(({ columnId }) => columnId) .map(prepareDimension), - metric: layer.metric ? [prepareDimension(layer.metric)] : [], - legendDisplay: [attributes.isPreview ? LegendDisplay.HIDE : layer.legendDisplay], - legendPosition: [layer.legendPosition || Position.Right], - maxLegendLines: [layer.legendMaxLines ?? 1], - legendSize: layer.legendSize ? [layer.legendSize] : [], - nestedLegend: [!!layer.nestedLegend], - truncateLegend: [ + metric: layer.metric ? prepareDimension(layer.metric) : '', + legendDisplay: (attributes.isPreview + ? LegendDisplay.HIDE + : layer.legendDisplay) as PartitionVisLegendDisplay, + legendPosition: layer.legendPosition || Position.Right, + maxLegendLines: layer.legendMaxLines ?? 1, + legendSize: layer.legendSize, + nestedLegend: !!layer.nestedLegend, + truncateLegend: layer.truncateLegend ?? getDefaultVisualValuesForLayer(state, datasourceLayers).truncateText, - ], palette: generatePaletteAstArguments(paletteService, state.palette), + addTooltip: false, }; }; -const generatePieVisAst: GenerateExpressionAstFunction = (...rest) => ({ - type: 'expression', - chain: [ - { - type: 'function', - function: 'pieVis', - arguments: { - ...generateCommonArguments(...rest), - respectSourceOrder: [false], - startFromSecondLargestSlice: [true], - }, - }, - ], -}); +const generatePieVisAst: GenerateExpressionAstFunction = (...rest) => + buildExpression([ + buildExpressionFunction<PieVisExpressionFunctionDefinition>('pieVis', { + ...generateCommonArguments(...rest), + respectSourceOrder: false, + startFromSecondLargestSlice: true, + isDonut: false, + }), + ]).toAst(); const generateDonutVisAst: GenerateExpressionAstFunction = (...rest) => { const [, , , layer] = rest; - return { - type: 'expression', - chain: [ - { - type: 'function', - function: 'pieVis', - arguments: { - ...generateCommonArguments(...rest), - respectSourceOrder: [false], - isDonut: [true], - startFromSecondLargestSlice: [true], - emptySizeRatio: [layer.emptySizeRatio ?? EmptySizeRatios.SMALL], - }, - }, - ], - }; + + return buildExpression([ + buildExpressionFunction<PieVisExpressionFunctionDefinition>('pieVis', { + ...generateCommonArguments(...rest), + respectSourceOrder: false, + isDonut: true, + startFromSecondLargestSlice: true, + emptySizeRatio: layer.emptySizeRatio ?? EmptySizeRatios.SMALL, + }), + ]).toAst(); }; const generateTreemapVisAst: GenerateExpressionAstFunction = (...rest) => { const [, , , layer] = rest; - return { - type: 'expression', - chain: [ - { - type: 'function', - function: 'treemapVis', - arguments: { - ...generateCommonArguments(...rest), - nestedLegend: [!!layer.nestedLegend], - }, - }, - ], - }; + + return buildExpression([ + buildExpressionFunction<TreemapVisExpressionFunctionDefinition>('treemapVis', { + ...generateCommonArguments(...rest), + nestedLegend: !!layer.nestedLegend, + }), + ]).toAst(); }; -const generateMosaicVisAst: GenerateExpressionAstFunction = (...rest) => ({ - type: 'expression', - chain: [ - { - type: 'function', - function: 'mosaicVis', - arguments: { - ...generateCommonArguments(...rest), - // flip order of bucket dimensions so the rows are fetched before the columns to keep them stable - buckets: rest[2] - .filter(({ columnId }) => !isCollapsed(columnId, rest[3])) - .reverse() - .map((o) => o.columnId) - .map(prepareDimension), - }, - }, - ], -}); +const generateMosaicVisAst: GenerateExpressionAstFunction = (...rest) => + buildExpression([ + buildExpressionFunction<MosaicVisExpressionFunctionDefinition>('mosaicVis', { + ...generateCommonArguments(...rest), + // flip order of bucket dimensions so the rows are fetched before the columns to keep them stable + buckets: rest[2] + .filter(({ columnId }) => !isCollapsed(columnId, rest[3])) + .reverse() + .map((o) => o.columnId) + .map(prepareDimension), + }), + ]).toAst(); const generateWaffleVisAst: GenerateExpressionAstFunction = (...rest) => { const { buckets, nestedLegend, ...args } = generateCommonArguments(...rest); const [state, attributes, , layer] = rest; - return { - type: 'expression', - chain: [ - { - type: 'function', - function: 'waffleVis', - arguments: { - ...args, - bucket: buckets, - labels: generateWaffleLabelsAstArguments(state, attributes, layer), - showValuesInLegend: [shouldShowValuesInLegend(layer, state.shape)], - }, - }, - ], - }; + + return buildExpression([ + buildExpressionFunction<WaffleVisExpressionFunctionDefinition>('waffleVis', { + ...args, + bucket: buckets, + labels: generateWaffleLabelsAstArguments(state, attributes, layer), + showValuesInLegend: shouldShowValuesInLegend(layer, state.shape), + }), + ]).toAst(); }; const generateExprAst: GenerateExpressionAstFunction = (state, ...restArgs) => @@ -306,15 +271,11 @@ function expressionHelper( ...groups .filter((columnId) => layer.collapseFns?.[columnId]) .map((columnId) => { - return { - type: 'function', - function: 'lens_collapse', - arguments: { - by: groups.filter((chk) => chk !== columnId), - metric: [layer.metric], - fn: [layer.collapseFns![columnId]!], - }, - } as AstFunction; + return buildExpressionFunction<CollapseExpressionFunction>('lens_collapse', { + by: groups.filter((chk) => chk !== columnId), + metric: layer.metric ? [layer.metric] : [], + fn: [layer.collapseFns![columnId]!], + }).toAst(); }), ...(visualizationAst ? visualizationAst.chain : []), ], diff --git a/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx b/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx index 6bff536794e89..57118c04ed721 100644 --- a/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx @@ -272,6 +272,7 @@ export const getPieVisualization = ({ groupLabel: i18n.translate('xpack.lens.pie.groupsizeLabel', { defaultMessage: 'Size by', }), + isMetricDimension: true, dimensionEditorGroupLabel: i18n.translate('xpack.lens.pie.groupSizeLabel', { defaultMessage: 'Size', }), diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx index 6622dd40615c8..47966ea309e3e 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx @@ -347,6 +347,7 @@ export const getXyVisualization = ({ groupLabel: getAxisName('y', { isHorizontal }), accessors: mappedAccessors, filterOperations: isNumericDynamicMetric, + isMetricDimension: true, supportsMoreColumns: true, requiredMinDimensionCount: 1, dataTestSubj: 'lnsXY_yDimensionPanel', diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/annotations_panel.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/annotations_panel.tsx index 480c0773f4520..748217469ce63 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/annotations_panel.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/annotations_panel.tsx @@ -23,6 +23,7 @@ import { QueryPointEventAnnotationConfig, } from '@kbn/event-annotation-plugin/common'; import moment from 'moment'; +import { useExistingFieldsReader } from '@kbn/unified-field-list-plugin/public'; import { FieldOption, FieldOptionValue, @@ -31,7 +32,6 @@ import { import { FormatFactory } from '../../../../../common'; import { DimensionEditorSection, - fieldExists, NameInput, useDebouncedValue, } from '../../../../shared_components'; @@ -58,6 +58,7 @@ export const AnnotationsPanel = ( ) => { const { state, setState, layerId, accessor, frame } = props; const isHorizontal = isHorizontalChart(state.layers); + const { hasFieldData } = useExistingFieldsReader(); const { inputValue: localState, handleInputChange: setLocalState } = useDebouncedValue<XYState>({ value: state, @@ -248,10 +249,7 @@ export const AnnotationsPanel = ( field: field.name, dataType: field.type, }, - exists: fieldExists( - frame.dataViews.existingFields[currentIndexPattern.title], - field.name - ), + exists: hasFieldData(currentIndexPattern.id, field.name), compatible: true, 'data-test-subj': `lnsXY-annotation-fieldOption-${field.name}`, } as FieldOption<FieldOptionValue>) @@ -379,7 +377,6 @@ export const AnnotationsPanel = ( currentConfig={currentAnnotation} setConfig={setAnnotations} indexPattern={frame.dataViews.indexPatterns[localLayer.indexPatternId]} - existingFields={frame.dataViews.existingFields} /> </EuiFormRow> </DimensionEditorSection> diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/query_annotation_panel.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/query_annotation_panel.tsx index 0ee0d1f06d1c8..00f0013c92822 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/query_annotation_panel.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/query_annotation_panel.tsx @@ -10,8 +10,8 @@ import type { Query } from '@kbn/data-plugin/common'; import type { QueryPointEventAnnotationConfig } from '@kbn/event-annotation-plugin/common'; import { i18n } from '@kbn/i18n'; import React from 'react'; +import { useExistingFieldsReader } from '@kbn/unified-field-list-plugin/public'; import { - fieldExists, FieldOption, FieldOptionValue, FieldPicker, @@ -41,7 +41,7 @@ export const ConfigPanelQueryAnnotation = ({ queryInputShouldOpen?: boolean; }) => { const currentIndexPattern = frame.dataViews.indexPatterns[layer.indexPatternId]; - const currentExistingFields = frame.dataViews.existingFields[currentIndexPattern.title]; + const { hasFieldData } = useExistingFieldsReader(); // list only date fields const options = currentIndexPattern.fields .filter((field) => field.type === 'date' && field.displayName) @@ -53,7 +53,7 @@ export const ConfigPanelQueryAnnotation = ({ field: field.name, dataType: field.type, }, - exists: fieldExists(currentExistingFields, field.name), + exists: hasFieldData(currentIndexPattern.id, field.name), compatible: true, 'data-test-subj': `lns-fieldOption-${field.name}`, } as FieldOption<FieldOptionValue>; diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/tooltip_annotation_panel.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/tooltip_annotation_panel.tsx index 20a99e8458fc0..d3f68686c3bac 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/tooltip_annotation_panel.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/tooltip_annotation_panel.tsx @@ -9,9 +9,9 @@ import { htmlIdGenerator, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useCallback, useMemo } from 'react'; import { QueryPointEventAnnotationConfig } from '@kbn/event-annotation-plugin/common'; -import type { ExistingFieldsMap, IndexPattern } from '../../../../types'; +import { useExistingFieldsReader } from '@kbn/unified-field-list-plugin/public'; +import type { IndexPattern } from '../../../../types'; import { - fieldExists, FieldOption, FieldOptionValue, FieldPicker, @@ -31,7 +31,6 @@ export interface FieldInputsProps { currentConfig: QueryPointEventAnnotationConfig; setConfig: (config: QueryPointEventAnnotationConfig) => void; indexPattern: IndexPattern; - existingFields: ExistingFieldsMap; invalidFields?: string[]; } @@ -51,9 +50,9 @@ export function TooltipSection({ currentConfig, setConfig, indexPattern, - existingFields, invalidFields, }: FieldInputsProps) { + const { hasFieldData } = useExistingFieldsReader(); const onChangeWrapped = useCallback( (values: WrappedValue[]) => { setConfig({ @@ -124,7 +123,6 @@ export function TooltipSection({ </> ); } - const currentExistingField = existingFields[indexPattern.title]; const options = indexPattern.fields .filter( @@ -140,7 +138,7 @@ export function TooltipSection({ field: field.name, dataType: field.type, }, - exists: fieldExists(currentExistingField, field.name), + exists: hasFieldData(indexPattern.id, field.name), compatible: true, 'data-test-subj': `lnsXY-annotation-tooltip-fieldOption-${field.name}`, } as FieldOption<FieldOptionValue>) diff --git a/x-pack/plugins/lens/readme.md b/x-pack/plugins/lens/readme.md index d276a45eb00ac..b01f19e4ee8ce 100644 --- a/x-pack/plugins/lens/readme.md +++ b/x-pack/plugins/lens/readme.md @@ -31,7 +31,7 @@ When adding visualizations to a solution page, there are multiple ways to approa * Limited data processing options - if the Lens UI doesn't support it, it can't be used * Limited visualization options - if Lens can't do it, it's not possible * #### **Using custom data fetching and rendering** - In case the disadvantages of using the Lens embeddable heavily affect your use case, it sometimes makes sense to roll your own data fetching and rendering by using the underlying APIs of search service and `elastic-charts` directly. This allows a high degree of flexibility when it comes to data processing, efficiently querying data for multiple charts in a single query and adjusting small details in how charts are rendered. However, do not choose these option lightly as maintenance as well as initial development effort will most likely be much higher than by using the Lens embeddable directly. In this case, almost always an "Open in Lens" button can still be offered to the user to drill down and further explore the data by generating a Lens configuration which is similar to the displayed visualization given the possibilities of Lens. Keep in mind that for the "Open in Lens" flow, the most important property isn't perfect fidelity of the chart but retaining the mental context of the user when switching so they don't have to start over. It's also possible to mix this approach with Lens embeddables on a single page. **Note**: In this situation, please let the VisEditors team know what features you are missing / why you chose not to use Lens. + In case the disadvantages of using the Lens embeddable heavily affect your use case, it sometimes makes sense to roll your own data fetching and rendering by using the underlying APIs of search service and `elastic-charts` directly. This allows a high degree of flexibility when it comes to data processing, efficiently querying data for multiple charts in a single query and adjusting small details in how charts are rendered. However, do not choose these option lightly as maintenance as well as initial development effort will most likely be much higher than by using the Lens embeddable directly. In this case, almost always an "Open in Lens" button can still be offered to the user to drill down and further explore the data by generating a Lens configuration which is similar to the displayed visualization given the possibilities of Lens. Keep in mind that for the "Open in Lens" flow, the most important property isn't perfect fidelity of the chart but retaining the mental context of the user when switching so they don't have to start over. It's also possible to mix this approach with Lens embeddables on a single page. **Note**: In this situation, please let the Visualizations team know what features you are missing / why you chose not to use Lens. Pros: * Full flexibility in data fetching optimization and chart rendering @@ -159,6 +159,14 @@ The Lens embeddable is handling data fetching internally, this means as soon as * When refreshing, simply call `session.start` again and update your state - Lens will discard the existing cache and re-fetch even if the query doesn't change at all * When unmounting your app, call `session.clear` to end the current session +## Performance considerations + +As the Lens embeddable is doing data fetching and processing internally as soon as props are passed to it, it's beneficial to make sure it's not rendered with new props if that's avoidable. Lens is aborting in-flight search requests as soon as the chart configuration changes based on props, but there's still non-trivial work kicked off in multiple parts of the stack. To avoid this, make sure to keep these things in mind: +* Changing the reference of the `attributes` prop will cause the Lens vis to re-initialize from scratch. Try to keep it stable as long as possible, e.g. by using `useMemo` instead of re-constructing it on the fly on every render +* Pass time range and filters in via the dedicated props instead of part of the `attributes` to avoid re-initalization. Changing time range or filters might kick off another search request so it makes sense to keep this stable as well, but this can also be controlled somewhat by the session id (see section above) +* The chart will adjust itself automatically to layout changes, no need to trigger another re-render in this situation + + ## Getting data tables and requests/responses The Lens embeddable is handling both data fetching and rendering - all the user has to do is to supply the configuration. However in some cases the resulting values are necessary for other parts of the UI - to access them pass supply an `onLoad` callback prop to the component. It will be called with an `adapters` object which allows you to access the current data tables and requests/responses: diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json index e29e0d1cb86b4..0cb74b2b1a87a 100644 --- a/x-pack/plugins/lens/tsconfig.json +++ b/x-pack/plugins/lens/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["*.ts", "common/**/*", "public/**/*", "server/**/*", "../../../typings/**/*"], - "references": [ + "kbn_references": [ { "path": "../spaces/tsconfig.json" }, { "path": "../../../src/core/tsconfig.json" }, { "path": "../task_manager/tsconfig.json" }, @@ -32,8 +31,10 @@ { "path": "../../../src/plugins/embeddable/tsconfig.json"}, { "path": "../../../src/plugins/presentation_util/tsconfig.json"}, { "path": "../../../src/plugins/field_formats/tsconfig.json"}, + { "path": "../../../src/plugins/chart_expressions/expression_partition_vis/tsconfig.json"}, { "path": "../../../src/plugins/chart_expressions/expression_heatmap/tsconfig.json"}, { "path": "../../../src/plugins/chart_expressions/expression_gauge/tsconfig.json"}, + { "path": "../../../src/plugins/chart_expressions/expression_legacy_metric/tsconfig.json"}, { "path": "../../../src/plugins/chart_expressions/expression_metric/tsconfig.json"}, { "path": "../../../src/plugins/data_view_editor/tsconfig.json"}, { "path": "../../../src/plugins/event_annotation/tsconfig.json"}, diff --git a/x-pack/plugins/license_api_guard/tsconfig.json b/x-pack/plugins/license_api_guard/tsconfig.json index 123e73a9e8163..a3e855927b83f 100644 --- a/x-pack/plugins/license_api_guard/tsconfig.json +++ b/x-pack/plugins/license_api_guard/tsconfig.json @@ -4,12 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "server/**/*" ], - "references": [ + "kbn_references": [ { "path": "../licensing/tsconfig.json" }, { "path": "../../../src/core/tsconfig.json" } ] diff --git a/x-pack/plugins/license_management/__jest__/api_responses/upload_license.js b/x-pack/plugins/license_management/__jest__/api_responses/upload_license.js index cef30efde47dc..6625611172b09 100644 --- a/x-pack/plugins/license_management/__jest__/api_responses/upload_license.js +++ b/x-pack/plugins/license_management/__jest__/api_responses/upload_license.js @@ -5,12 +5,14 @@ * 2.0. */ +/** @type {[number, Record<string, string>, string]} */ export const UPLOAD_LICENSE_EXPIRED = [ 200, { 'Content-Type': 'application/json' }, '{"acknowledged": "true", "license_status": "expired"}', ]; +/** @type {[number, Record<string, string>, string]} */ export const UPLOAD_LICENSE_REQUIRES_ACK = [ 200, { 'Content-Type': 'application/json' }, @@ -25,18 +27,21 @@ export const UPLOAD_LICENSE_REQUIRES_ACK = [ }`, ]; +/** @type {[number, Record<string, string>, string]} */ export const UPLOAD_LICENSE_SUCCESS = [ 200, { 'Content-Type': 'application/json' }, '{"acknowledged": "true", "license_status": "valid"}', ]; +/** @type {[number, Record<string, string>, string]} */ export const UPLOAD_LICENSE_INVALID = [ 200, { 'Content-Type': 'application/json' }, '{"acknowledged": "true", "license_status": "invalid"}', ]; +/** @type {[number, Record<string, string>, string]} */ export const UPLOAD_LICENSE_TLS_NOT_ENABLED = [ 200, { 'Content-Type': 'application/json' }, diff --git a/x-pack/plugins/license_management/__jest__/upload_license.test.tsx b/x-pack/plugins/license_management/__jest__/upload_license.test.tsx index c24c2bf6a9c6b..d5bc51df521cf 100644 --- a/x-pack/plugins/license_management/__jest__/upload_license.test.tsx +++ b/x-pack/plugins/license_management/__jest__/upload_license.test.tsx @@ -11,13 +11,10 @@ import { LocationDescriptorObject } from 'history'; import { httpServiceMock, scopedHistoryMock } from '@kbn/core/public/mocks'; import { mountWithIntl } from '@kbn/test-jest-helpers'; -// @ts-ignore import { uploadLicense } from '../public/application/store/actions/upload_license'; -// @ts-ignore import { licenseManagementStore } from '../public/application/store/store'; -// @ts-ignore import { UploadLicense } from '../public/application/sections/upload_license'; import { AppContextProvider } from '../public/application/app_context'; @@ -27,7 +24,6 @@ import { UPLOAD_LICENSE_SUCCESS, UPLOAD_LICENSE_TLS_NOT_ENABLED, UPLOAD_LICENSE_INVALID, - // @ts-ignore } from './api_responses'; let store: any = null; diff --git a/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx b/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx index ff01d2ee7739a..dfc33affa3b35 100644 --- a/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx +++ b/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx @@ -28,7 +28,7 @@ import { EXTERNAL_LINKS } from '../../../../../common/constants'; import { AppContextConsumer, AppDependencies } from '../../../app_context'; import { TelemetryPluginStart, shouldShowTelemetryOptIn } from '../../../lib/telemetry'; -interface Props { +export interface Props { loadTrialStatus: () => void; startLicenseTrial: () => void; telemetry?: TelemetryPluginStart; diff --git a/x-pack/plugins/license_management/tsconfig.json b/x-pack/plugins/license_management/tsconfig.json index 4384a9a0efd98..2cca1d4daff61 100644 --- a/x-pack/plugins/license_management/tsconfig.json +++ b/x-pack/plugins/license_management/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", @@ -13,7 +12,7 @@ "__jest__/**/*", "__mocks__/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/telemetry_management_section/tsconfig.json" }, diff --git a/x-pack/plugins/licensing/tsconfig.json b/x-pack/plugins/licensing/tsconfig.json index 355d99fa461b8..0a86901065804 100644 --- a/x-pack/plugins/licensing/tsconfig.json +++ b/x-pack/plugins/licensing/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true, }, "include": [ @@ -12,7 +11,7 @@ "server/**/*", "common/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" } ] diff --git a/x-pack/plugins/lists/server/routes/import_exceptions_route.ts b/x-pack/plugins/lists/server/routes/import_exceptions_route.ts index 78e0d571b2dc2..955e2debdea27 100644 --- a/x-pack/plugins/lists/server/routes/import_exceptions_route.ts +++ b/x-pack/plugins/lists/server/routes/import_exceptions_route.ts @@ -58,6 +58,7 @@ export const importExceptionsRoute = (router: ListsPluginRouter, config: ConfigT const importsSummary = await exceptionListsClient.importExceptionListAndItems({ exceptionsToImport: request.body.file, + generateNewListId: request.query.as_new_list, maxExceptionsImportSize: config.maxExceptionsImportSize, overwrite: request.query.overwrite, }); diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.test.ts b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.test.ts index 043ffcd48fe77..8ad92f5d14bff 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.test.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.test.ts @@ -299,6 +299,7 @@ describe('exception_list_client', () => { (): ReturnType<ExceptionListClient['importExceptionListAndItems']> => { return exceptionListClient.importExceptionListAndItems({ exceptionsToImport: toReadable([getExceptionListItemSchemaMock()]), + generateNewListId: false, maxExceptionsImportSize: 10_000, overwrite: true, }); diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts index baa9d943127f7..ecdaa70d7869b 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts @@ -984,6 +984,7 @@ export class ExceptionListClient { exceptionsToImport, maxExceptionsImportSize, overwrite, + generateNewListId, }: ImportExceptionListAndItemsOptions): Promise<ImportExceptionsResponseSchema> => { const { savedObjectsClient, user } = this; @@ -1004,6 +1005,7 @@ export class ExceptionListClient { return importExceptions({ exceptions: parsedObjects, + generateNewListId, overwrite, savedObjectsClient, user, @@ -1038,6 +1040,7 @@ export class ExceptionListClient { return importExceptions({ exceptions: parsedObjects, + generateNewListId: false, overwrite, savedObjectsClient, user, diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts index 048930e51b93d..35a28c0116035 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts @@ -502,6 +502,7 @@ export interface ImportExceptionListAndItemsOptions { maxExceptionsImportSize: number; /** whether or not to overwrite an exception list with imported list if a matching list_id found */ overwrite: boolean; + generateNewListId: boolean; } /** diff --git a/x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.test.ts b/x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.test.ts index 375e211cabe46..e1181cc656d3e 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.test.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.test.ts @@ -56,6 +56,7 @@ describe('import_exception_list_and_items', () => { getImportExceptionsListSchemaMock('test_list_id'), getImportExceptionsListItemSchemaMock('test_item_id', 'test_list_id'), ]), + generateNewListId: false, maxExceptionsImportSize: 10000, overwrite: false, }); @@ -82,6 +83,7 @@ describe('import_exception_list_and_items', () => { getImportExceptionsListSchemaMock('test_list_id'), getImportExceptionsListItemSchemaMock('test_item_id', 'test_list_id'), ]), + generateNewListId: false, maxExceptionsImportSize: 10000, overwrite: false, }); @@ -102,6 +104,7 @@ describe('import_exception_list_and_items', () => { getImportExceptionsListSchemaMock('test_list_id'), getImportExceptionsListItemSchemaMock('test_item_id', 'test_list_id'), ]), + generateNewListId: false, maxExceptionsImportSize: 10000, overwrite: false, }); diff --git a/x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.ts b/x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.ts index deef7b7b21917..46fe83bccd6dd 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.ts @@ -18,6 +18,7 @@ import { import { createPromiseFromStreams } from '@kbn/utils'; import { SavedObjectsClientContract } from '@kbn/core/server'; import { chunk } from 'lodash/fp'; +import uuid from 'uuid'; import { importExceptionLists } from './utils/import/import_exception_lists'; import { importExceptionListItems } from './utils/import/import_exception_list_items'; @@ -49,6 +50,7 @@ export interface ImportDataResponse { interface ImportExceptionListAndItemsOptions { exceptions: PromiseFromStreams; overwrite: boolean; + generateNewListId: boolean; savedObjectsClient: SavedObjectsClientContract; user: string; } @@ -90,6 +92,7 @@ export const importExceptionsAsStream = async ({ return importExceptions({ exceptions: parsedObjects, + generateNewListId: false, overwrite, savedObjectsClient, user, @@ -99,14 +102,44 @@ export const importExceptionsAsStream = async ({ export const importExceptions = async ({ exceptions, overwrite, + generateNewListId, savedObjectsClient, user, }: ImportExceptionListAndItemsOptions): Promise<ImportExceptionsResponseSchema> => { + let exceptionsToValidate = exceptions; + if (generateNewListId) { + // we need to generate a new list id and update the old list id references + // in each list item to point to the new list id + exceptionsToValidate = exceptions.lists.reduce( + (acc, exceptionList) => { + if (exceptionList instanceof Error) { + return { items: [...acc.items], lists: [...acc.lists] }; + } + const newListId = uuid.v4(); + + return { + items: [ + ...acc.items, + ...exceptions.items + .filter( + (item) => + !(item instanceof Error) && + !(exceptionList instanceof Error) && + item?.list_id === exceptionList?.list_id + ) + .map((item) => ({ ...item, list_id: newListId })), + ], + lists: [...acc.lists, { ...exceptionList, list_id: newListId }], + }; + }, + { items: [], lists: [] } as PromiseFromStreams + ); + } // removal of duplicates const [exceptionListDuplicateErrors, uniqueExceptionLists] = - getTupleErrorsAndUniqueExceptionLists(exceptions.lists); + getTupleErrorsAndUniqueExceptionLists(exceptionsToValidate.lists); const [exceptionListItemsDuplicateErrors, uniqueExceptionListItems] = - getTupleErrorsAndUniqueExceptionListItems(exceptions.items); + getTupleErrorsAndUniqueExceptionListItems(exceptionsToValidate.items); // chunking of validated import stream const chunkParsedListObjects = chunk(CHUNK_PARSED_OBJECT_SIZE, uniqueExceptionLists); @@ -115,6 +148,7 @@ export const importExceptions = async ({ // where the magic happens - purposely importing parent exception // containers first, items second const importExceptionListsResponse = await importExceptionLists({ + generateNewListId, isOverwrite: overwrite, listsChunks: chunkParsedListObjects, savedObjectsClient, diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/import_exception_lists.ts b/x-pack/plugins/lists/server/services/exception_lists/utils/import/import_exception_lists.ts index 13141a7a16400..cd2d730c584f7 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/utils/import/import_exception_lists.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/utils/import/import_exception_lists.ts @@ -26,11 +26,13 @@ import { sortImportResponses } from './sort_import_responses'; */ export const importExceptionLists = async ({ isOverwrite, + generateNewListId, listsChunks, savedObjectsClient, user, }: { isOverwrite: boolean; + generateNewListId: boolean; listsChunks: ImportExceptionListSchemaDecoded[][]; savedObjectsClient: SavedObjectsClientContract; user: string; @@ -56,6 +58,7 @@ export const importExceptionLists = async ({ const { errors, listItemsToDelete, listsToCreate, listsToUpdate } = sortExceptionListsToUpdateOrCreate({ existingLists: foundLists, + generateNewListId, isOverwrite, lists: listChunk, user, diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_or_update.test.ts b/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_or_update.test.ts index a4d1e3d0691ce..54029c53593b9 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_or_update.test.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_or_update.test.ts @@ -169,7 +169,7 @@ describe('sort_exception_lists_items_to_create_update', () => { }); }); - it('assigns error if matching item_id found but differing list_id', () => { + it('assigns no error if matching item_id found but differing list_id', () => { const result = sortExceptionItemsToUpdateOrCreate({ existingItems: { 'item-id-1': { @@ -185,17 +185,7 @@ describe('sort_exception_lists_items_to_create_update', () => { }); expect(result).toEqual({ - errors: [ - { - error: { - message: - 'Error trying to update item_id: "item-id-1" and list_id: "list-id-1". The item already exists under list_id: list-id-2', - status_code: 409, - }, - item_id: 'item-id-1', - list_id: 'list-id-1', - }, - ], + errors: [], itemsToCreate: [], itemsToUpdate: [], }); diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_update.ts b/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_update.ts index 9bfc1a333969e..d9c9b6702fc49 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_update.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_update.ts @@ -131,31 +131,6 @@ export const sortExceptionItemsToUpdateOrCreate = ({ type: savedObjectType, }, ]; - } else { - // If overwrite is true, the list parent container is deleted first along - // with its items, so to get here would mean the user hit a bit of an odd scenario. - // Sample scenario would be as follows: - // In system we have: - // List A ---> with item list_item_id - // Import is: - // List A ---> with item list_item_id_1 - // List B ---> with item list_item_id_1 - // If we just did an update of the item, we would overwrite - // list_item_id_1 of List A, which would be weird behavior - // What happens: - // List A and items are deleted and recreated - // List B is created, but list_item_id_1 already exists under List A and user warned - results.errors = [ - ...results.errors, - { - error: { - message: `Error trying to update item_id: "${itemId}" and list_id: "${listId}". The item already exists under list_id: ${existingItems[itemId].list_id}`, - status_code: 409, - }, - item_id: itemId, - list_id: listId, - }, - ]; } } else if (existingItems[itemId] != null) { results.errors = [ diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_or_update.test.ts b/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_or_update.test.ts index 0e47292e7d4e5..a5b5974772669 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_or_update.test.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_or_update.test.ts @@ -25,6 +25,7 @@ describe('sort_exception_lists_to_create_update', () => { it('assigns list to create if its list_id does not match an existing one', () => { const result = sortExceptionListsToUpdateOrCreate({ existingLists: {}, + generateNewListId: false, isOverwrite: false, lists: [getImportExceptionsListSchemaDecodedMock('list-id-1')], user: 'elastic', @@ -66,6 +67,7 @@ describe('sort_exception_lists_to_create_update', () => { existingLists: { 'list-id-1': { ...getExceptionListSchemaMock(), list_id: 'list-id-1' }, }, + generateNewListId: false, isOverwrite: false, lists: [getImportExceptionsListSchemaDecodedMock('list-id-1')], user: 'elastic', @@ -93,6 +95,7 @@ describe('sort_exception_lists_to_create_update', () => { it('assigns list to be created if its list_id does not match an existing one', () => { const result = sortExceptionListsToUpdateOrCreate({ existingLists: {}, + generateNewListId: false, isOverwrite: true, lists: [getImportExceptionsListSchemaDecodedMock('list-id-1')], user: 'elastic', @@ -134,6 +137,7 @@ describe('sort_exception_lists_to_create_update', () => { existingLists: { 'list-id-1': { ...getExceptionListSchemaMock(), list_id: 'list-id-1' }, }, + generateNewListId: false, isOverwrite: true, lists: [getImportExceptionsListSchemaDecodedMock('list-id-1')], user: 'elastic', diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_update.ts b/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_update.ts index 3c7e6217559e5..da91b04d6acf5 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_update.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_update.ts @@ -21,11 +21,13 @@ export const sortExceptionListsToUpdateOrCreate = ({ lists, existingLists, isOverwrite, + generateNewListId, user, }: { lists: ImportExceptionListSchemaDecoded[]; existingLists: Record<string, ExceptionListSchema>; isOverwrite: boolean; + generateNewListId: boolean; user: string; }): { errors: BulkErrorSchema[]; @@ -102,6 +104,27 @@ export const sortExceptionListsToUpdateOrCreate = ({ type: savedObjectType, }, ]; + } else if (existingLists[listId] != null && generateNewListId) { + const attributes: ExceptionListSoSchema = { + ...existingLists[listId], + comments: undefined, + created_at: dateNow, + created_by: user, + description, + entries: undefined, + immutable: false, + item_id: undefined, + list_type: 'list', + tie_breaker_id: uuid.v4(), + updated_by: user, + }; + results.listsToCreate = [ + ...results.listsToCreate, + { + attributes, + type: savedObjectType, + }, + ]; } else if (existingLists[listId] != null) { results.errors = [ ...results.errors, diff --git a/x-pack/plugins/lists/tsconfig.json b/x-pack/plugins/lists/tsconfig.json index 6cfffbbaa7421..3da969b34db3d 100644 --- a/x-pack/plugins/lists/tsconfig.json +++ b/x-pack/plugins/lists/tsconfig.json @@ -5,7 +5,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -14,7 +13,7 @@ // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 "server/**/*.json", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../spaces/tsconfig.json" }, { "path": "../security/tsconfig.json"}, diff --git a/x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx b/x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx index ef75f0e758a3a..b94774da18921 100644 --- a/x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx +++ b/x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx @@ -13,11 +13,8 @@ import { i18n } from '@kbn/i18n'; import { ToastsStart } from '@kbn/core/public'; import { ManagementAppMountParams } from '@kbn/management-plugin/public'; -// @ts-expect-error import { PipelineEditor } from './components/pipeline_editor'; -// @ts-expect-error import { Pipeline } from '../models/pipeline'; -// @ts-expect-error import * as Breadcrumbs from './breadcrumbs'; const usePipeline = ( diff --git a/x-pack/plugins/logstash/public/models/pipeline/pipeline.js b/x-pack/plugins/logstash/public/models/pipeline/pipeline.js index 92fba509df86e..0c7367d7a0145 100755 --- a/x-pack/plugins/logstash/public/models/pipeline/pipeline.js +++ b/x-pack/plugins/logstash/public/models/pipeline/pipeline.js @@ -24,13 +24,9 @@ const settingsDefaults = { export class Pipeline { /** * Represents the pipeline for the client side editing/creating workflow - * @param {object} props An object used to instantiate a pipeline instance - * @param {string} props.id Named Id of the pipeline - * @param {string} props.description Optional description for the pipeline - * @param {object} props.pipeline The actual LS configuration as a string blob - * @param {string} props.username User who created or updated the pipeline + * @param {import('./props').Props} props} */ - constructor(props) { + constructor(props = undefined) { this.id = get(props, 'id'); this.description = get(props, 'description', ''); this.pipeline = get(props, 'pipeline', emptyPipeline); diff --git a/x-pack/plugins/logstash/public/models/pipeline/props.ts b/x-pack/plugins/logstash/public/models/pipeline/props.ts new file mode 100644 index 0000000000000..3b590e50c8a39 --- /dev/null +++ b/x-pack/plugins/logstash/public/models/pipeline/props.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. + */ + +/** + * An object used to instantiate a pipeline instance + */ +export interface Props { + /** + * Named Id of the pipeline + */ + id: string; + /** + * Optional description for the pipeline + */ + description: string; + /** + * The actual LS configuration as a string blob + */ + pipeline: string; + /** + * User who created or updated the pipeline + */ + username: string; +} diff --git a/x-pack/plugins/logstash/tsconfig.json b/x-pack/plugins/logstash/tsconfig.json index 5a13e8ca71599..96ffd953c3efd 100644 --- a/x-pack/plugins/logstash/tsconfig.json +++ b/x-pack/plugins/logstash/tsconfig.json @@ -5,14 +5,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json"}, { "path": "../../../src/plugins/management/tsconfig.json"}, diff --git a/x-pack/plugins/maps/common/constants.ts b/x-pack/plugins/maps/common/constants.ts index 94ae72a050e21..117bfa0eaaeaf 100644 --- a/x-pack/plugins/maps/common/constants.ts +++ b/x-pack/plugins/maps/common/constants.ts @@ -310,6 +310,7 @@ export const emsWorldLayerId = 'world_countries'; export enum WIZARD_ID { CHOROPLETH = 'choropleth', GEO_FILE = 'uploadGeoFile', + LAYER_GROUP = 'layerGroup', NEW_VECTOR = 'newVectorLayer', OBSERVABILITY = 'observabilityLayer', SECURITY = 'securityLayer', diff --git a/x-pack/plugins/maps/common/telemetry/layer_stats_collector.test.ts b/x-pack/plugins/maps/common/telemetry/layer_stats_collector.test.ts index fbdfad705a0d4..1b9c6adfa2eb5 100644 --- a/x-pack/plugins/maps/common/telemetry/layer_stats_collector.test.ts +++ b/x-pack/plugins/maps/common/telemetry/layer_stats_collector.test.ts @@ -12,14 +12,14 @@ import { MapSavedObjectAttributes } from '../map_saved_object_type'; const expecteds = [ { - layerCount: 3, + layerCount: 4, basemapCounts: { roadmap: 1 }, joinCounts: {}, - layerCounts: { ems_basemap: 1, ems_region: 1, es_agg_clusters: 1 }, + layerCounts: { ems_basemap: 1, ems_region: 1, es_agg_clusters: 1, layer_group: 1 }, resolutionCounts: { coarse: 1 }, scalingCounts: {}, emsFileCounts: { italy_provinces: 1 }, - layerTypeCounts: { TILE: 1, GEOJSON_VECTOR: 2 }, + layerTypeCounts: { GEOJSON_VECTOR: 2, LAYER_GROUP: 1, TILE: 1 }, sourceCount: 3, }, { @@ -93,6 +93,10 @@ describe.each(testsToRun)('LayerStatsCollector %#', (attributes, expected) => { expect(statsCollector.getLayerCounts()).toEqual(expected.layerCounts); }); + test('getLayerTypeCounts', () => { + expect(statsCollector.getLayerTypeCounts()).toEqual(expected.layerTypeCounts); + }); + test('getResolutionCounts', () => { expect(statsCollector.getResolutionCounts()).toEqual(expected.resolutionCounts); }); diff --git a/x-pack/plugins/maps/common/telemetry/layer_stats_collector.ts b/x-pack/plugins/maps/common/telemetry/layer_stats_collector.ts index 0978b3ace87ec..e31f4120194f6 100644 --- a/x-pack/plugins/maps/common/telemetry/layer_stats_collector.ts +++ b/x-pack/plugins/maps/common/telemetry/layer_stats_collector.ts @@ -155,14 +155,18 @@ function getJoinKey(layerDescriptor: LayerDescriptor): JOIN_KEYS | null { } function getLayerKey(layerDescriptor: LayerDescriptor): LAYER_KEYS | null { - if (!layerDescriptor.sourceDescriptor) { - return null; - } - if (layerDescriptor.type === LAYER_TYPE.HEATMAP) { return LAYER_KEYS.ES_AGG_HEATMAP; } + if (layerDescriptor.type === LAYER_TYPE.LAYER_GROUP) { + return LAYER_KEYS.LAYER_GROUP; + } + + if (!layerDescriptor.sourceDescriptor) { + return null; + } + if (layerDescriptor.sourceDescriptor.type === SOURCE_TYPES.EMS_FILE) { return LAYER_KEYS.EMS_REGION; } diff --git a/x-pack/plugins/maps/common/telemetry/test_resources/sample_map_saved_objects.json b/x-pack/plugins/maps/common/telemetry/test_resources/sample_map_saved_objects.json index 908bacb091aea..a8efb534de5c4 100644 --- a/x-pack/plugins/maps/common/telemetry/test_resources/sample_map_saved_objects.json +++ b/x-pack/plugins/maps/common/telemetry/test_resources/sample_map_saved_objects.json @@ -6,7 +6,7 @@ "title": "Italy Map", "description": "", "mapStateJSON": "{\"zoom\":4.82,\"center\":{\"lon\":11.41545,\"lat\":42.0865},\"timeFilters\":{\"from\":\"now-15w\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":false,\"interval\":0},\"query\":{\"language\":\"lucene\",\"query\":\"\"}}", - "layerListJSON": "[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"id\":\"csq5v\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.65,\"visible\":true,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"italy_provinces\"},\"id\":\"0oye8\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#0c1f70\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}}},\"type\":\"GEOJSON_VECTOR\"},{\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"id\":\"053fe296-f5ae-4cb0-9e73-a5752cb9ba74\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"DestLocation\",\"requestType\":\"point\",\"resolution\":\"COARSE\"},\"id\":\"1gx22\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Greens\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"minSize\":4,\"maxSize\":32}}}},\"type\":\"GEOJSON_VECTOR\"}]", + "layerListJSON": "[{\"id\":\"123\",\"label\":\"Layer Group\",\"sourceDescriptor\":null,\"type\":\"LAYER_GROUP\"},{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"id\":\"csq5v\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.65,\"visible\":true,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"italy_provinces\"},\"id\":\"0oye8\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#0c1f70\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}}},\"type\":\"GEOJSON_VECTOR\"},{\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"id\":\"053fe296-f5ae-4cb0-9e73-a5752cb9ba74\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"DestLocation\",\"requestType\":\"point\",\"resolution\":\"COARSE\"},\"id\":\"1gx22\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Greens\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"minSize\":4,\"maxSize\":32}}}},\"type\":\"GEOJSON_VECTOR\"}]", "uiStateJSON": "{}" }, "references": [ diff --git a/x-pack/plugins/maps/common/telemetry/types.ts b/x-pack/plugins/maps/common/telemetry/types.ts index 7b0dfc4eae3bb..b0d740bf4f239 100644 --- a/x-pack/plugins/maps/common/telemetry/types.ts +++ b/x-pack/plugins/maps/common/telemetry/types.ts @@ -29,6 +29,7 @@ export enum LAYER_KEYS { EMS_REGION = 'ems_region', EMS_BASEMAP = 'ems_basemap', KBN_TMS_RASTER = 'kbn_tms_raster', + LAYER_GROUP = 'layer_group', UX_TMS_RASTER = 'ux_tms_raster', // configured in the UX layer wizard of Maps UX_TMS_MVT = 'ux_tms_mvt', // configured in the UX layer wizard of Maps UX_WMS = 'ux_wms', // configured in the UX layer wizard of Maps diff --git a/x-pack/plugins/maps/public/actions/layer_actions.ts b/x-pack/plugins/maps/public/actions/layer_actions.ts index 5ba9edaee58d0..38cadc8d1363a 100644 --- a/x-pack/plugins/maps/public/actions/layer_actions.ts +++ b/x-pack/plugins/maps/public/actions/layer_actions.ts @@ -228,6 +228,9 @@ export function removePreviewLayers() { ) => { getLayerList(getState()).forEach((layer) => { if (layer.isPreviewLayer()) { + if (isLayerGroup(layer)) { + dispatch(ungroupLayer(layer.getId())); + } dispatch(removeLayer(layer.getId())); } }); @@ -613,11 +616,21 @@ export function setLayerQuery(id: string, query: Query) { } export function setLayerParent(id: string, parent: string | undefined) { - return { - type: UPDATE_LAYER_PROP, - id, - propName: 'parent', - newValue: parent, + return ( + dispatch: ThunkDispatch<MapStoreState, void, AnyAction>, + getState: () => MapStoreState + ) => { + dispatch({ + type: UPDATE_LAYER_PROP, + id, + propName: 'parent', + newValue: parent, + }); + + if (parent) { + // Open parent layer details. Without opening parent details, layer disappears from legend and this confuses users + dispatch(showTOCDetails(parent)); + } }; } @@ -863,6 +876,22 @@ export function createLayerGroup(draggedLayerId: string, combineLayerId: string) }; } +function ungroupLayer(layerId: string) { + return ( + dispatch: ThunkDispatch<MapStoreState, void, AnyAction>, + getState: () => MapStoreState + ) => { + const layer = getLayerList(getState()).find((findLayer) => findLayer.getId() === layerId); + if (!layer || !isLayerGroup(layer)) { + return; + } + + (layer as LayerGroup).getChildren().forEach((childLayer) => { + dispatch(setLayerParent(childLayer.getId(), layer.getParent())); + }); + }; +} + export function moveLayerToLeftOfTarget(moveLayerId: string, targetLayerId: string) { return ( dispatch: ThunkDispatch<MapStoreState, void, AnyAction>, diff --git a/x-pack/plugins/maps/public/classes/layers/layer_group/index.ts b/x-pack/plugins/maps/public/classes/layers/layer_group/index.ts index 3b2848d03f5ff..085ea4e8afea6 100644 --- a/x-pack/plugins/maps/public/classes/layers/layer_group/index.ts +++ b/x-pack/plugins/maps/public/classes/layers/layer_group/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { isLayerGroup, LayerGroup } from './layer_group'; +export { DEFAULT_LAYER_GROUP_LABEL, isLayerGroup, LayerGroup } from './layer_group'; diff --git a/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.test.ts b/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.test.ts new file mode 100644 index 0000000000000..19aa122aa9f95 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.test.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 { MAX_ZOOM, MIN_ZOOM } from '../../../../common/constants'; +import { LayerGroup } from './layer_group'; +import { ILayer } from '../layer'; + +describe('getMinZoom', () => { + test('should return MIN_ZOOM when there are no children', async () => { + const layerGroup = new LayerGroup({ layerDescriptor: LayerGroup.createDescriptor({}) }); + expect(layerGroup.getMinZoom()).toBe(MIN_ZOOM); + }); + + test('should return smallest child.getMinZoom()', async () => { + const layerGroup = new LayerGroup({ layerDescriptor: LayerGroup.createDescriptor({}) }); + layerGroup.setChildren([ + { + getMinZoom: () => { + return 1; + }, + } as unknown as ILayer, + { + getMinZoom: () => { + return 4; + }, + } as unknown as ILayer, + ]); + expect(layerGroup.getMinZoom()).toBe(1); + }); +}); + +describe('getMaxZoom', () => { + test('should return MAX_ZOOM when there are no children', async () => { + const layerGroup = new LayerGroup({ layerDescriptor: LayerGroup.createDescriptor({}) }); + expect(layerGroup.getMaxZoom()).toBe(MAX_ZOOM); + }); + + test('should return largest child.getMaxZoom()', async () => { + const layerGroup = new LayerGroup({ layerDescriptor: LayerGroup.createDescriptor({}) }); + layerGroup.setChildren([ + { + getMaxZoom: () => { + return 18; + }, + } as unknown as ILayer, + { + getMaxZoom: () => { + return 20; + }, + } as unknown as ILayer, + ]); + expect(layerGroup.getMaxZoom()).toBe(20); + }); +}); diff --git a/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.tsx b/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.tsx index c0e3c4ee56402..7fa48628ef0db 100644 --- a/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.tsx +++ b/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.tsx @@ -36,6 +36,10 @@ export function isLayerGroup(layer: ILayer) { return layer instanceof LayerGroup; } +export const DEFAULT_LAYER_GROUP_LABEL = i18n.translate('xpack.maps.layerGroup.defaultName', { + defaultMessage: 'Layer group', +}); + export class LayerGroup implements ILayer { protected readonly _descriptor: LayerGroupDescriptor; private _children: ILayer[] = []; @@ -48,9 +52,7 @@ export class LayerGroup implements ILayer { label: typeof options.label === 'string' && options.label.length ? options.label - : i18n.translate('xpack.maps.layerGroup.defaultName', { - defaultMessage: 'Layer group', - }), + : DEFAULT_LAYER_GROUP_LABEL, sourceDescriptor: null, visible: typeof options.visible === 'boolean' ? options.visible : true, }; @@ -207,20 +209,34 @@ export class LayerGroup implements ILayer { return zoom >= this.getMinZoom() && zoom <= this.getMaxZoom(); } + /* + * Returns smallest min from children or MIN_ZOOM when there are no children + */ getMinZoom(): number { - let min = MIN_ZOOM; + let min: number | undefined; this._children.forEach((child) => { - min = Math.max(min, child.getMinZoom()); + if (min !== undefined) { + min = Math.min(min, child.getMinZoom()); + } else { + min = child.getMinZoom(); + } }); - return min; + return min !== undefined ? min : MIN_ZOOM; } + /* + * Returns largest max from children or MAX_ZOOM when there are no children + */ getMaxZoom(): number { - let max = MAX_ZOOM; + let max: number | undefined; this._children.forEach((child) => { - max = Math.min(max, child.getMaxZoom()); + if (max !== undefined) { + max = Math.max(max, child.getMaxZoom()); + } else { + max = child.getMaxZoom(); + } }); - return max; + return max !== undefined ? max : MAX_ZOOM; } getMinSourceZoom(): number { diff --git a/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.ts b/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.ts deleted file mode 100644 index c42b338032f05..0000000000000 --- a/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.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 { RasterTileLayer } from './raster_tile_layer'; -import { SOURCE_TYPES } from '../../../../common/constants'; -import { DataRequestMeta, XYZTMSSourceDescriptor } from '../../../../common/descriptor_types'; -import { AbstractSource } from '../../sources/source'; -import { ILayer } from '../layer'; -import { RasterTileSource } from 'maplibre-gl'; -import { DataRequest } from '../../util/data_request'; -import { IRasterSource, RasterTileSourceData } from '../../sources/raster_source'; - -const sourceDescriptor: XYZTMSSourceDescriptor = { - type: SOURCE_TYPES.EMS_XYZ, - urlTemplate: 'https://example.com/{x}/{y}/{z}.png', - id: 'foobar', -}; - -class MockTileSource extends AbstractSource implements IRasterSource { - readonly _descriptor: XYZTMSSourceDescriptor; - constructor(descriptor: XYZTMSSourceDescriptor) { - super(descriptor); - this._descriptor = descriptor; - } - async canSkipSourceUpdate( - dataRequest: DataRequest, - nextRequestMeta: DataRequestMeta - ): Promise<boolean> { - return true; - } - isSourceStale(mbSource: RasterTileSource, sourceData: RasterTileSourceData): boolean { - return false; - } - - async getDisplayName(): Promise<string> { - return this._descriptor.urlTemplate; - } - - async getUrlTemplate(): Promise<string> { - return 'template/{x}/{y}/{z}.png'; - } -} - -describe('RasterTileLayer', () => { - it('should use display-label from source', async () => { - const source = new MockTileSource(sourceDescriptor); - - const layer: ILayer = new RasterTileLayer({ - source, - layerDescriptor: { id: 'layerid', sourceDescriptor }, - }); - expect(await source.getDisplayName()).toEqual(await layer.getDisplayName()); - }); - - it('should override with custom display-label if present', async () => { - const source = new MockTileSource(sourceDescriptor); - const layer: ILayer = new RasterTileLayer({ - source, - layerDescriptor: { id: 'layerid', sourceDescriptor, label: 'custom' }, - }); - expect('custom').toEqual(await layer.getDisplayName()); - }); -}); diff --git a/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.tsx b/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.tsx new file mode 100644 index 0000000000000..601c4012fae47 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.tsx @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { RasterTileLayer } from './raster_tile_layer'; +import { ReactElement } from 'react'; +import { SOURCE_TYPES } from '../../../../common/constants'; +import { DataRequestMeta, XYZTMSSourceDescriptor } from '../../../../common/descriptor_types'; +import { AbstractSource } from '../../sources/source'; +import { ILayer } from '../layer'; +import { RasterTileSource } from 'maplibre-gl'; +import { DataRequest } from '../../util/data_request'; +import { IRasterSource, RasterTileSourceData } from '../../sources/raster_source'; + +const sourceDescriptor: XYZTMSSourceDescriptor = { + type: SOURCE_TYPES.EMS_XYZ, + urlTemplate: 'https://example.com/{x}/{y}/{z}.png', + id: 'foobar', +}; + +class MockTileSource extends AbstractSource implements IRasterSource { + readonly _descriptor: XYZTMSSourceDescriptor; + constructor(descriptor: XYZTMSSourceDescriptor) { + super(descriptor); + this._descriptor = descriptor; + } + async hasLegendDetails(): Promise<boolean> { + return false; + } + + renderLegendDetails(): ReactElement<any> | null { + return null; + } + async canSkipSourceUpdate( + dataRequest: DataRequest, + nextRequestMeta: DataRequestMeta + ): Promise<boolean> { + return true; + } + + isSourceStale(mbSource: RasterTileSource, sourceData: RasterTileSourceData): boolean { + return false; + } + + async getDisplayName(): Promise<string> { + return this._descriptor.urlTemplate; + } + + async getUrlTemplate(): Promise<string> { + return 'template/{x}/{y}/{z}.png'; + } +} + +describe('RasterTileLayer', () => { + it('should use display-label from source', async () => { + const source = new MockTileSource(sourceDescriptor); + + const layer: ILayer = new RasterTileLayer({ + source, + layerDescriptor: { id: 'layerid', sourceDescriptor }, + }); + expect(await source.getDisplayName()).toEqual(await layer.getDisplayName()); + }); + + it('should override with custom display-label if present', async () => { + const source = new MockTileSource(sourceDescriptor); + const layer: ILayer = new RasterTileLayer({ + source, + layerDescriptor: { id: 'layerid', sourceDescriptor, label: 'custom' }, + }); + expect('custom').toEqual(await layer.getDisplayName()); + }); +}); diff --git a/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.ts b/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.ts index cc13b70d01060..bd1b266d34881 100644 --- a/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.ts @@ -6,6 +6,7 @@ */ import type { Map as MbMap, RasterTileSource } from '@kbn/mapbox-gl'; +import { ReactElement } from 'react'; import _ from 'lodash'; import { AbstractLayer } from '../layer'; import { SOURCE_DATA_REQUEST_ID, LAYER_TYPE, LAYER_STYLE_TYPE } from '../../../../common/constants'; @@ -41,6 +42,17 @@ export class RasterTileLayer extends AbstractLayer { return super.getSource() as IRasterSource; } + async hasLegendDetails(): Promise<boolean> { + const source = this.getSource(); + return await source.hasLegendDetails(); + } + + renderLegendDetails(): ReactElement<any> | null { + const dataRequest = this.getSourceDataRequest(); + const source = this.getSource(); + return source.renderLegendDetails(dataRequest); + } + getStyleForEditing() { return this._style; } diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/config.tsx b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/config.tsx new file mode 100644 index 0000000000000..4418b20cf6613 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/config.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 { i18n } from '@kbn/i18n'; +import React from 'react'; +import { LayerWizard, RenderWizardArguments } from '../layer_wizard_registry'; +import { LayerGroupWizard } from './wizard'; +import { WIZARD_ID } from '../../../../../common/constants'; + +export const layerGroupWizardConfig: LayerWizard = { + id: WIZARD_ID.LAYER_GROUP, + order: 10, + categories: [], + description: i18n.translate('xpack.maps.layerGroupWizard.description', { + defaultMessage: 'Organize related layers in a hierarchy', + }), + icon: 'layers', + renderWizard: (renderWizardArguments: RenderWizardArguments) => { + return <LayerGroupWizard {...renderWizardArguments} />; + }, + title: i18n.translate('xpack.maps.layerGroupWizard.title', { + defaultMessage: 'Layer group', + }), +}; diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/index.ts b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/index.ts new file mode 100644 index 0000000000000..06bd343d84a38 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/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 { layerGroupWizardConfig } from './config'; diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/wizard.tsx b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/wizard.tsx new file mode 100644 index 0000000000000..2668730e694c8 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/wizard.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 { i18n } from '@kbn/i18n'; +import React, { ChangeEvent, Component } from 'react'; +import { EuiFieldText, EuiFormRow, EuiPanel } from '@elastic/eui'; +import { RenderWizardArguments } from '../layer_wizard_registry'; +import { DEFAULT_LAYER_GROUP_LABEL, LayerGroup } from '../../layer_group'; + +interface State { + label: string; +} + +export class LayerGroupWizard extends Component<RenderWizardArguments, State> { + state: State = { + label: DEFAULT_LAYER_GROUP_LABEL, + }; + + componentDidMount() { + this._previewLayer(); + } + + _onLabelChange = (e: ChangeEvent<HTMLInputElement>) => { + this.setState( + { + label: e.target.value, + }, + this._previewLayer + ); + }; + + _previewLayer() { + const layerDescriptor = LayerGroup.createDescriptor({ + label: this.state.label, + }); + + this.props.previewLayers([layerDescriptor]); + } + + render() { + return ( + <EuiPanel> + <EuiFormRow + label={i18n.translate('xpack.maps.layerPanel.settingsPanel.layerNameLabel', { + defaultMessage: 'Name', + })} + > + <EuiFieldText value={this.state.label} onChange={this._onLabelChange} /> + </EuiFormRow> + </EuiPanel> + ); + } +} diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/load_layer_wizards.ts b/x-pack/plugins/maps/public/classes/layers/wizards/load_layer_wizards.ts index aa772d44341e6..fbaba6325bf26 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/load_layer_wizards.ts +++ b/x-pack/plugins/maps/public/classes/layers/wizards/load_layer_wizards.ts @@ -7,6 +7,7 @@ import { registerLayerWizardInternal } from './layer_wizard_registry'; import { uploadLayerWizardConfig } from './file_upload_wizard'; +import { layerGroupWizardConfig } from './layer_group_wizard'; import { esDocumentsLayerWizardConfig, esTopHitsLayerWizardConfig, @@ -36,6 +37,7 @@ export function registerLayerWizards() { } registerLayerWizardInternal(uploadLayerWizardConfig); + registerLayerWizardInternal(layerGroupWizardConfig); registerLayerWizardInternal(esDocumentsLayerWizardConfig); registerLayerWizardInternal(choroplethLayerWizardConfig); registerLayerWizardInternal(clustersLayerWizardConfig); diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/security/create_layer_descriptors.test.ts b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/security/create_layer_descriptors.test.ts index 2006c3eed6c2a..48cd66c47b53d 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/security/create_layer_descriptors.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/security/create_layer_descriptors.test.ts @@ -42,6 +42,7 @@ describe('createLayerDescriptor', () => { label: 'apm-*-transaction* | Source Point', maxZoom: 24, minZoom: 0, + parent: '12345', disableTooltips: false, sourceDescriptor: { applyGlobalQuery: true, @@ -119,6 +120,7 @@ describe('createLayerDescriptor', () => { label: 'apm-*-transaction* | Destination point', maxZoom: 24, minZoom: 0, + parent: '12345', disableTooltips: false, sourceDescriptor: { applyGlobalQuery: true, @@ -196,6 +198,7 @@ describe('createLayerDescriptor', () => { label: 'apm-*-transaction* | Line', maxZoom: 24, minZoom: 0, + parent: '12345', disableTooltips: false, sourceDescriptor: { applyGlobalQuery: true, @@ -248,6 +251,13 @@ describe('createLayerDescriptor', () => { type: 'GEOJSON_VECTOR', visible: true, }, + { + id: '12345', + label: 'apm-*-transaction*', + sourceDescriptor: null, + type: 'LAYER_GROUP', + visible: true, + }, ]); }); @@ -262,6 +272,7 @@ describe('createLayerDescriptor', () => { label: 'filebeat-* | Source Point', maxZoom: 24, minZoom: 0, + parent: '12345', disableTooltips: false, sourceDescriptor: { applyGlobalQuery: true, @@ -339,6 +350,7 @@ describe('createLayerDescriptor', () => { label: 'filebeat-* | Destination point', maxZoom: 24, minZoom: 0, + parent: '12345', disableTooltips: false, sourceDescriptor: { applyGlobalQuery: true, @@ -410,6 +422,7 @@ describe('createLayerDescriptor', () => { label: 'filebeat-* | Line', maxZoom: 24, minZoom: 0, + parent: '12345', disableTooltips: false, sourceDescriptor: { applyGlobalQuery: true, @@ -462,6 +475,13 @@ describe('createLayerDescriptor', () => { type: 'GEOJSON_VECTOR', visible: true, }, + { + id: '12345', + label: 'filebeat-*', + sourceDescriptor: null, + type: 'LAYER_GROUP', + visible: true, + }, ]); }); @@ -476,6 +496,7 @@ describe('createLayerDescriptor', () => { label: 'traces-apm-opbean-node | Source Point', maxZoom: 24, minZoom: 0, + parent: '12345', disableTooltips: false, sourceDescriptor: { applyGlobalQuery: true, @@ -553,6 +574,7 @@ describe('createLayerDescriptor', () => { label: 'traces-apm-opbean-node | Destination point', maxZoom: 24, minZoom: 0, + parent: '12345', disableTooltips: false, sourceDescriptor: { applyGlobalQuery: true, @@ -624,6 +646,7 @@ describe('createLayerDescriptor', () => { label: 'traces-apm-opbean-node | Line', maxZoom: 24, minZoom: 0, + parent: '12345', disableTooltips: false, sourceDescriptor: { applyGlobalQuery: true, @@ -676,6 +699,13 @@ describe('createLayerDescriptor', () => { type: 'GEOJSON_VECTOR', visible: true, }, + { + id: '12345', + label: 'traces-apm-opbean-node', + sourceDescriptor: null, + type: 'LAYER_GROUP', + visible: true, + }, ]); }); }); diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/security/create_layer_descriptors.ts b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/security/create_layer_descriptors.ts index f295464126c96..792d61b08b9b4 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/security/create_layer_descriptors.ts +++ b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/security/create_layer_descriptors.ts @@ -23,6 +23,7 @@ import { VECTOR_STYLES, } from '../../../../../../common/constants'; import { GeoJsonVectorLayer } from '../../../vector_layer'; +import { LayerGroup } from '../../../layer_group'; import { VectorStyle } from '../../../../styles/vector/vector_style'; import { ESSearchSource } from '../../../../sources/es_search_source'; import { ESPewPewSource } from '../../../../sources/es_pew_pew_source'; @@ -48,7 +49,11 @@ function getDestinationField(indexPatternTitle: string) { return isApmIndex(indexPatternTitle) ? 'server.geo.location' : 'destination.geo.location'; } -function createSourceLayerDescriptor(indexPatternId: string, indexPatternTitle: string) { +function createSourceLayerDescriptor( + indexPatternId: string, + indexPatternTitle: string, + parentId: string +) { const sourceDescriptor = ESSearchSource.createDescriptor({ indexPatternId, geoField: getSourceField(indexPatternTitle), @@ -96,12 +101,17 @@ function createSourceLayerDescriptor(indexPatternId: string, indexPatternTitle: defaultMessage: '{indexPatternTitle} | Source Point', values: { indexPatternTitle }, }), + parent: parentId, sourceDescriptor, style: VectorStyle.createDescriptor(styleProperties), }); } -function createDestinationLayerDescriptor(indexPatternId: string, indexPatternTitle: string) { +function createDestinationLayerDescriptor( + indexPatternId: string, + indexPatternTitle: string, + parentId: string +) { const sourceDescriptor = ESSearchSource.createDescriptor({ indexPatternId, geoField: getDestinationField(indexPatternTitle), @@ -149,12 +159,17 @@ function createDestinationLayerDescriptor(indexPatternId: string, indexPatternTi defaultMessage: '{indexPatternTitle} | Destination point', values: { indexPatternTitle }, }), + parent: parentId, sourceDescriptor, style: VectorStyle.createDescriptor(styleProperties), }); } -function createLineLayerDescriptor(indexPatternId: string, indexPatternTitle: string) { +function createLineLayerDescriptor( + indexPatternId: string, + indexPatternTitle: string, + parentId: string +) { const sourceDescriptor = ESPewPewSource.createDescriptor({ indexPatternId, sourceGeoField: getSourceField(indexPatternTitle), @@ -195,6 +210,7 @@ function createLineLayerDescriptor(indexPatternId: string, indexPatternTitle: st defaultMessage: '{indexPatternTitle} | Line', values: { indexPatternTitle }, }), + parent: parentId, sourceDescriptor, style: VectorStyle.createDescriptor(styleProperties), }); @@ -204,9 +220,11 @@ export function createSecurityLayerDescriptors( indexPatternId: string, indexPatternTitle: string ): LayerDescriptor[] { + const layerGroupDescriptor = LayerGroup.createDescriptor({ label: indexPatternTitle }); return [ - createSourceLayerDescriptor(indexPatternId, indexPatternTitle), - createDestinationLayerDescriptor(indexPatternId, indexPatternTitle), - createLineLayerDescriptor(indexPatternId, indexPatternTitle), + createSourceLayerDescriptor(indexPatternId, indexPatternTitle, layerGroupDescriptor.id), + createDestinationLayerDescriptor(indexPatternId, indexPatternTitle, layerGroupDescriptor.id), + createLineLayerDescriptor(indexPatternId, indexPatternTitle, layerGroupDescriptor.id), + layerGroupDescriptor, ]; } diff --git a/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_tilemap_source.js b/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_tilemap_source.js index 9abe2997b4756..72be5aeac830d 100644 --- a/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_tilemap_source.js +++ b/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_tilemap_source.js @@ -41,7 +41,13 @@ export class KibanaTilemapSource extends AbstractSource { }, ]; } + async hasLegendDetails() { + return false; + } + renderLegendDetails() { + return null; + } isSourceStale(mbSource, sourceData) { if (!sourceData.url) { return false; diff --git a/x-pack/plugins/maps/public/classes/sources/raster_source/index.ts b/x-pack/plugins/maps/public/classes/sources/raster_source/index.ts index 53f1b75003ea3..7165db534b417 100644 --- a/x-pack/plugins/maps/public/classes/sources/raster_source/index.ts +++ b/x-pack/plugins/maps/public/classes/sources/raster_source/index.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RasterTileSource } from '@kbn/mapbox-gl'; +import type { RasterTileSource } from '@kbn/mapbox-gl'; +import { ReactElement } from 'react'; import { DataRequest } from '../../util/data_request'; import { ITMSSource } from '../tms_source'; import { DataRequestMeta } from '../../../../common/descriptor_types'; @@ -15,4 +16,6 @@ export interface RasterTileSourceData { export interface IRasterSource extends ITMSSource { canSkipSourceUpdate(dataRequest: DataRequest, nextRequestMeta: DataRequestMeta): Promise<boolean>; isSourceStale(mbSource: RasterTileSource, sourceData: RasterTileSourceData): boolean; + hasLegendDetails(): Promise<boolean>; + renderLegendDetails(dataRequest: DataRequest | undefined): ReactElement<any> | null; } diff --git a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_layer_wizard.tsx b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_layer_wizard.tsx index 3b1f5e728eed0..0f9485d0ec1b0 100644 --- a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_layer_wizard.tsx +++ b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_layer_wizard.tsx @@ -9,13 +9,12 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; // @ts-ignore import { WMSCreateSourceEditor } from './wms_create_source_editor'; -// @ts-ignore import { sourceTitle, WMSSource } from './wms_source'; import { LayerWizard, RenderWizardArguments } from '../../layers'; import { RasterTileLayer } from '../../layers/raster_tile_layer/raster_tile_layer'; import { LAYER_WIZARD_CATEGORY, WIZARD_ID } from '../../../../common/constants'; import { WebMapServiceLayerIcon } from '../../layers/wizards/icons/web_map_service_layer_icon'; - +import { WMSSourceDescriptor } from '../../../../common/descriptor_types'; export const wmsLayerWizardConfig: LayerWizard = { id: WIZARD_ID.WMS_LAYER, order: 10, @@ -25,14 +24,14 @@ export const wmsLayerWizardConfig: LayerWizard = { }), icon: WebMapServiceLayerIcon, renderWizard: ({ previewLayers }: RenderWizardArguments) => { - const onSourceConfigChange = (sourceConfig: unknown) => { + const onSourceConfigChange = (sourceConfig: Partial<WMSSourceDescriptor>) => { if (!sourceConfig) { previewLayers([]); return; } const layerDescriptor = RasterTileLayer.createDescriptor({ - sourceDescriptor: WMSSource.createDescriptor(sourceConfig), + sourceDescriptor: WMSSource.createDescriptor(sourceConfig as Partial<WMSSourceDescriptor>), }); previewLayers([layerDescriptor]); }; diff --git a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.js b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.js deleted file mode 100644 index 3d682a504c2d3..0000000000000 --- a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { AbstractSource } from '../source'; -import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel, getUrlLabel } from '../../../../common/i18n_getters'; -import { WmsClient } from './wms_client'; -import { SOURCE_TYPES } from '../../../../common/constants'; -import { registerSource } from '../source_registry'; - -export const sourceTitle = i18n.translate('xpack.maps.source.wmsTitle', { - defaultMessage: 'Web Map Service', -}); - -export class WMSSource extends AbstractSource { - static type = SOURCE_TYPES.WMS; - - static createDescriptor({ serviceUrl, layers, styles }) { - return { - type: WMSSource.type, - serviceUrl, - layers, - styles, - }; - } - - isSourceStale(mbSource, sourceData) { - if (!sourceData.url) { - return false; - } - return mbSource.tiles?.[0] !== sourceData.url; - } - - async canSkipSourceUpdate() { - return false; - } - - async getImmutableProperties() { - return [ - { label: getDataSourceLabel(), value: sourceTitle }, - { label: getUrlLabel(), value: this._descriptor.serviceUrl }, - { - label: i18n.translate('xpack.maps.source.wms.layersLabel', { - defaultMessage: 'Layers', - }), - value: this._descriptor.layers, - }, - { - label: i18n.translate('xpack.maps.source.wms.stylesLabel', { - defaultMessage: 'Styles', - }), - value: this._descriptor.styles, - }, - ]; - } - - async getDisplayName() { - return this._descriptor.serviceUrl; - } - - getUrlTemplate() { - const client = new WmsClient({ serviceUrl: this._descriptor.serviceUrl }); - return client.getUrlTemplate(this._descriptor.layers, this._descriptor.styles || ''); - } -} - -registerSource({ - ConstructorFunction: WMSSource, - type: SOURCE_TYPES.WMS, -}); diff --git a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.tsx b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.tsx new file mode 100644 index 0000000000000..480b253264e5c --- /dev/null +++ b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.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 { ReactElement } from 'react'; +import { i18n } from '@kbn/i18n'; +import { RasterTileSource } from 'maplibre-gl'; +import { AbstractSource } from '../source'; +import { getDataSourceLabel, getUrlLabel } from '../../../../common/i18n_getters'; +// @ts-ignore +import { WmsClient } from './wms_client'; +import { SOURCE_TYPES } from '../../../../common/constants'; +import { registerSource } from '../source_registry'; +import { IRasterSource, RasterTileSourceData } from '../raster_source'; +import { WMSSourceDescriptor } from '../../../../common/descriptor_types'; +export const sourceTitle = i18n.translate('xpack.maps.source.wmsTitle', { + defaultMessage: 'Web Map Service', +}); + +export class WMSSource extends AbstractSource implements IRasterSource { + static type = SOURCE_TYPES.WMS; + readonly _descriptor: WMSSourceDescriptor; + static createDescriptor({ serviceUrl, layers, styles }: Partial<WMSSourceDescriptor>) { + return { + type: WMSSource.type, + serviceUrl, + layers, + styles, + } as WMSSourceDescriptor; + } + constructor(sourceDescriptor: WMSSourceDescriptor) { + super(sourceDescriptor); + this._descriptor = sourceDescriptor; + } + async hasLegendDetails(): Promise<boolean> { + return false; + } + + renderLegendDetails(): ReactElement<any> | null { + return null; + } + + isSourceStale(mbSource: RasterTileSource, sourceData: RasterTileSourceData) { + if (!sourceData.url) { + return false; + } + return mbSource.tiles?.[0] !== sourceData.url; + } + async canSkipSourceUpdate() { + return false; + } + async getImmutableProperties() { + return [ + { label: getDataSourceLabel(), value: sourceTitle }, + { label: getUrlLabel(), value: this._descriptor.serviceUrl }, + { + label: i18n.translate('xpack.maps.source.wms.layersLabel', { + defaultMessage: 'Layers', + }), + value: this._descriptor.layers, + }, + { + label: i18n.translate('xpack.maps.source.wms.stylesLabel', { + defaultMessage: 'Styles', + }), + value: this._descriptor.styles, + }, + ]; + } + + async getDisplayName() { + return this._descriptor.serviceUrl; + } + + getUrlTemplate() { + const client = new WmsClient({ serviceUrl: this._descriptor.serviceUrl }); + return client.getUrlTemplate(this._descriptor.layers, this._descriptor.styles || ''); + } +} + +registerSource({ + ConstructorFunction: WMSSource, + type: SOURCE_TYPES.WMS, +}); diff --git a/x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.ts b/x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.ts deleted file mode 100644 index c2c5e6404c8f0..0000000000000 --- a/x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.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 { i18n } from '@kbn/i18n'; -import { RasterTileSource } from 'maplibre-gl'; -import { getDataSourceLabel, getUrlLabel } from '../../../../common/i18n_getters'; -import { SOURCE_TYPES } from '../../../../common/constants'; -import { registerSource } from '../source_registry'; -import { - XYZTMSSourceDescriptor, - DataRequestMeta, - Timeslice, -} from '../../../../common/descriptor_types'; -import { AbstractSource, ImmutableSourceProperty } from '../source'; -import { XYZTMSSourceConfig } from './xyz_tms_editor'; -import { canSkipSourceUpdate } from '../../util/can_skip_fetch'; -import { DataRequest } from '../../util/data_request'; -import { IRasterSource, RasterTileSourceData } from '../raster_source'; - -export const sourceTitle = i18n.translate('xpack.maps.source.ems_xyzTitle', { - defaultMessage: 'Tile Map Service', -}); - -export class XYZTMSSource extends AbstractSource implements IRasterSource { - static type = SOURCE_TYPES.EMS_XYZ; - - readonly _descriptor: XYZTMSSourceDescriptor; - - static createDescriptor({ urlTemplate }: XYZTMSSourceConfig): XYZTMSSourceDescriptor { - return { - type: XYZTMSSource.type, - urlTemplate, - }; - } - - constructor(sourceDescriptor: XYZTMSSourceDescriptor) { - super(sourceDescriptor); - this._descriptor = sourceDescriptor; - } - - async getImmutableProperties(): Promise<ImmutableSourceProperty[]> { - return [ - { label: getDataSourceLabel(), value: sourceTitle }, - { label: getUrlLabel(), value: this._descriptor.urlTemplate }, - ]; - } - - async getDisplayName(): Promise<string> { - return this._descriptor.urlTemplate; - } - - async getUrlTemplate(): Promise<string> { - return this._descriptor.urlTemplate; - } - - isSourceStale(mbSource: RasterTileSource, sourceData: RasterTileSourceData): boolean { - if (!sourceData.url) { - return false; - } - return mbSource.tiles?.[0] !== sourceData.url; - } - - async canSkipSourceUpdate( - prevDataRequest: DataRequest, - nextMeta: DataRequestMeta - ): Promise<boolean> { - const prevMeta = prevDataRequest?.getMeta(); - const canSkip = await canSkipSourceUpdate({ - extentAware: false, - source: this, - prevDataRequest, - nextRequestMeta: nextMeta, - getUpdateDueToTimeslice: (timeslice?: Timeslice) => { - if (!prevMeta) return true; - return this.getUpdateDueToTimeslice(prevMeta, timeslice); - }, - }); - return canSkip; - } -} - -registerSource({ - ConstructorFunction: XYZTMSSource, - type: SOURCE_TYPES.EMS_XYZ, -}); diff --git a/x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.tsx b/x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.tsx new file mode 100644 index 0000000000000..64f4734c3d800 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.tsx @@ -0,0 +1,96 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { ReactElement } from 'react'; +import { RasterTileSource } from 'maplibre-gl'; +import { getDataSourceLabel, getUrlLabel } from '../../../../common/i18n_getters'; +import { SOURCE_TYPES } from '../../../../common/constants'; +import { registerSource } from '../source_registry'; +import { + XYZTMSSourceDescriptor, + DataRequestMeta, + Timeslice, +} from '../../../../common/descriptor_types'; +import { AbstractSource, ImmutableSourceProperty } from '../source'; +import { XYZTMSSourceConfig } from './xyz_tms_editor'; +import { canSkipSourceUpdate } from '../../util/can_skip_fetch'; +import { DataRequest } from '../../util/data_request'; +import { IRasterSource, RasterTileSourceData } from '../raster_source'; + +export const sourceTitle = i18n.translate('xpack.maps.source.ems_xyzTitle', { + defaultMessage: 'Tile Map Service', +}); + +export class XYZTMSSource extends AbstractSource implements IRasterSource { + static type = SOURCE_TYPES.EMS_XYZ; + + readonly _descriptor: XYZTMSSourceDescriptor; + + static createDescriptor({ urlTemplate }: XYZTMSSourceConfig): XYZTMSSourceDescriptor { + return { + type: XYZTMSSource.type, + urlTemplate, + }; + } + + constructor(sourceDescriptor: XYZTMSSourceDescriptor) { + super(sourceDescriptor); + this._descriptor = sourceDescriptor; + } + + async getImmutableProperties(): Promise<ImmutableSourceProperty[]> { + return [ + { label: getDataSourceLabel(), value: sourceTitle }, + { label: getUrlLabel(), value: this._descriptor.urlTemplate }, + ]; + } + + async getDisplayName(): Promise<string> { + return this._descriptor.urlTemplate; + } + + async getUrlTemplate(): Promise<string> { + return this._descriptor.urlTemplate; + } + async hasLegendDetails(): Promise<boolean> { + return false; + } + + renderLegendDetails(): ReactElement<any> | null { + return null; + } + isSourceStale(mbSource: RasterTileSource, sourceData: RasterTileSourceData): boolean { + if (!sourceData.url) { + return false; + } + return mbSource.tiles?.[0] !== sourceData.url; + } + + async canSkipSourceUpdate( + prevDataRequest: DataRequest, + nextMeta: DataRequestMeta + ): Promise<boolean> { + const prevMeta = prevDataRequest?.getMeta(); + const canSkip = await canSkipSourceUpdate({ + extentAware: false, + source: this, + prevDataRequest, + nextRequestMeta: nextMeta, + getUpdateDueToTimeslice: (timeslice?: Timeslice) => { + if (!prevMeta) return true; + return this.getUpdateDueToTimeslice(prevMeta, timeslice); + }, + }); + return canSkip; + } +} + +registerSource({ + ConstructorFunction: XYZTMSSource, + type: SOURCE_TYPES.EMS_XYZ, +}); diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/layer_settings.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/layer_settings.tsx index 6d63fc08ef85e..162f43f0911a6 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/layer_settings.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/layer_settings.tsx @@ -7,6 +7,8 @@ import React, { ChangeEvent, Fragment } from 'react'; import { + EuiCallOut, + EuiText, EuiTitle, EuiPanel, EuiFormRow, @@ -242,8 +244,44 @@ export function LayerSettings(props: Props) { ); }; + const renderLayerGroupInstructions = () => { + return isLayerGroup(props.layer) ? ( + <> + <EuiCallOut + title={i18n.translate('xpack.maps.layerPanel.settingsPanel.layerGroupCalloutTitle', { + defaultMessage: 'Drag layers in and out of the group', + })} + iconType="layers" + > + <EuiText> + <ul> + <li> + {i18n.translate('xpack.maps.layerPanel.settingsPanel.layerGroupAddToFront', { + defaultMessage: 'To add your first layer, drag it onto the group name.', + })} + </li> + <li> + {i18n.translate('xpack.maps.layerPanel.settingsPanel.layerGroupAddToPosition', { + defaultMessage: + 'To add another layer, drag it anywhere above the last layer in the group.', + })} + </li> + <li> + {i18n.translate('xpack.maps.layerPanel.settingsPanel.layerGroupRemove', { + defaultMessage: 'To remove a layer, drag it above or below the group.', + })} + </li> + </ul> + </EuiText> + </EuiCallOut> + <EuiSpacer size="m" /> + </> + ) : null; + }; + return ( <Fragment> + {renderLayerGroupInstructions()} <EuiPanel> <EuiTitle size="xs"> <h5> diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx index cc16e408bf7bb..865ad53ebe3da 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx @@ -13,12 +13,17 @@ import { Action, ActionExecutionContext } from '@kbn/ui-actions-plugin/public'; import { maplibregl } from '@kbn/mapbox-gl'; import type { Map as MapboxMap, MapOptions, MapMouseEvent } from '@kbn/mapbox-gl'; import { ResizeChecker } from '@kbn/kibana-utils-plugin/public'; +import { METRIC_TYPE } from '@kbn/analytics'; import { DrawFilterControl } from './draw_control/draw_filter_control'; import { ScaleControl } from './scale_control'; import { TooltipControl } from './tooltip_control'; import { clampToLatBounds, clampToLonBounds } from '../../../common/elasticsearch_util'; import { getInitialView } from './get_initial_view'; -import { getPreserveDrawingBuffer, isScreenshotMode } from '../../kibana_services'; +import { + getPreserveDrawingBuffer, + getUsageCollection, + isScreenshotMode, +} from '../../kibana_services'; import { ILayer } from '../../classes/layers/layer'; import { CustomIcon, @@ -28,6 +33,7 @@ import { Timeslice, } from '../../../common/descriptor_types'; import { + APP_ID, CUSTOM_ICON_SIZE, DECIMAL_DEGREES_PRECISION, MAKI_ICON_SIZE, @@ -149,6 +155,7 @@ export class MbMap extends Component<Props, State> { } async _createMbMapInstance(initialView: MapCenterAndZoom | null): Promise<MapboxMap> { + this._reportUsage(); return new Promise((resolve) => { const mbStyle = { version: 8 as 8, @@ -270,6 +277,24 @@ export class MbMap extends Component<Props, State> { }); } + _reportUsage() { + const usageCollector = getUsageCollection(); + if (!usageCollector) return; + + const webglSupport = maplibregl.supported(); + + usageCollector.reportUiCounter( + APP_ID, + METRIC_TYPE.LOADED, + webglSupport ? 'gl_webglSupported' : 'gl_webglNotSupported' + ); + + // Report low system performance or no hardware GPU + if (webglSupport && !maplibregl.supported({ failIfMajorPerformanceCaveat: true })) { + usageCollector.reportUiCounter(APP_ID, METRIC_TYPE.LOADED, 'gl_majorPerformanceCaveat'); + } + } + async _loadMakiSprites(mbMap: MapboxMap) { if (this._isMounted) { // Math.floor rounds values < 1 to 0. This occurs when browser is zoomed out diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/_layer_toc.scss b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/_layer_toc.scss index 868c120c31691..a3a03097acb06 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/_layer_toc.scss +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/_layer_toc.scss @@ -6,6 +6,10 @@ cursor: alias !important; } +.mapLayerToc-droppable-isCombining { + background-color: $euiColorEmptyShade !important; +} + .mapLayerToc-droppable-isDragging * { cursor: ns-resize !important; } \ No newline at end of file diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/layer_toc.tsx b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/layer_toc.tsx index f152d1686b3bd..54a5d13e7702d 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/layer_toc.tsx +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/layer_toc.tsx @@ -244,6 +244,10 @@ export class LayerTOC extends Component<Props> { dragHandleProps={draggableProvided.dragHandleProps} isDragging={draggableSnapshot.isDragging} isDraggingOver={droppableSnapshot.isDraggingOver} + isCombineLayer={ + this.state.combineLayer !== null && + this.state.combineLayer.getId() === layer.getId() + } /> ); }} diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss index 094d116b78623..959176547dfb2 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss @@ -62,6 +62,11 @@ pointer-events: none !important; } +.mapTocEntry-isCombineLayer { + transition: background-color $euiAnimSpeedExtraSlow ease; + background-color: transparentize($euiColorSuccess, .75); +} + .mapTocEntry-isSelected { background-color: tintOrShade($euiColorLightShade, 60%, 20%); } diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx index 72eb38f07257e..ed426011e995a 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx @@ -49,6 +49,7 @@ export interface OwnProps { dragHandleProps?: DraggableProvidedDragHandleProps; isDragging?: boolean; isDraggingOver?: boolean; + isCombineLayer?: boolean; } type Props = ReduxStateProps & ReduxDispatchProps & OwnProps; @@ -310,13 +311,26 @@ export class TOCEntry extends Component<Props, State> { ); }; + _hightlightAsSelectedLayer() { + if (this.props.isCombineLayer) { + return false; + } + + if (this.props.layer.isPreviewLayer()) { + return true; + } + + return ( + this.props.selectedLayer && this.props.selectedLayer.getId() === this.props.layer.getId() + ); + } + render() { const classes = classNames('mapTocEntry', { 'mapTocEntry-isDragging': this.props.isDragging, 'mapTocEntry-isDraggingOver': this.props.isDraggingOver, - 'mapTocEntry-isSelected': - this.props.layer.isPreviewLayer() || - (this.props.selectedLayer && this.props.selectedLayer.getId() === this.props.layer.getId()), + 'mapTocEntry-isCombineLayer': this.props.isCombineLayer, + 'mapTocEntry-isSelected': this._hightlightAsSelectedLayer(), 'mapTocEntry-isInEditingMode': this.props.isFeatureEditorOpenForLayer, }); diff --git a/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts b/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts index 24b2707064c32..9f2e520c428a2 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts +++ b/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts @@ -166,6 +166,18 @@ export function registerMapsUsageCollector(usageCollection?: UsageCollectionSetu _meta: { description: 'total number of kbn tms layers in cluster' }, }, }, + layer_group: { + min: { type: 'long', _meta: { description: 'min number of layer groups per map' } }, + max: { type: 'long', _meta: { description: 'max number of layer groups per map' } }, + avg: { + type: 'float', + _meta: { description: 'avg number of layer groups per map' }, + }, + total: { + type: 'long', + _meta: { description: 'total number of layer groups in cluster' }, + }, + }, ux_tms_mvt: { min: { type: 'long', _meta: { description: 'min number of ux tms-mvt layers per map' } }, max: { type: 'long', _meta: { description: 'max number of ux tms-mvt layers per map' } }, diff --git a/x-pack/plugins/maps/server/maps_telemetry/map_stats/map_stats_collector.test.ts b/x-pack/plugins/maps/server/maps_telemetry/map_stats/map_stats_collector.test.ts index 48860338ae11f..a4dd0df8e2712 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/map_stats/map_stats_collector.test.ts +++ b/x-pack/plugins/maps/server/maps_telemetry/map_stats/map_stats_collector.test.ts @@ -84,6 +84,12 @@ test('returns expected telemetry data from saved objects', () => { min: 1, total: 1, }, + layer_group: { + avg: 0.2, + max: 1, + min: 1, + total: 1, + }, }, scalingOptions: { limit: { @@ -151,6 +157,11 @@ test('returns expected telemetry data from saved objects', () => { max: 1, min: 1, }, + LAYER_GROUP: { + avg: 0.2, + max: 1, + min: 1, + }, TILE: { avg: 0.6, max: 1, @@ -163,8 +174,8 @@ test('returns expected telemetry data from saved objects', () => { }, }, layersCount: { - avg: 2, - max: 3, + avg: 2.2, + max: 4, min: 1, }, }, diff --git a/x-pack/plugins/maps/tsconfig.json b/x-pack/plugins/maps/tsconfig.json index ee28c2be8d31c..f38cce537f267 100644 --- a/x-pack/plugins/maps/tsconfig.json +++ b/x-pack/plugins/maps/tsconfig.json @@ -4,7 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "common/**/*", @@ -13,7 +17,7 @@ "config.ts", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/maps_ems/tsconfig.json" }, { "path": "../../../src/plugins/dashboard/tsconfig.json" }, diff --git a/x-pack/plugins/ml/common/constants/cloud.ts b/x-pack/plugins/ml/common/constants/cloud.ts index 0fc6c0234c467..331721712b2e7 100644 --- a/x-pack/plugins/ml/common/constants/cloud.ts +++ b/x-pack/plugins/ml/common/constants/cloud.ts @@ -5,4 +5,5 @@ * 2.0. */ +export const PLATINUM_MAX_RAM_FOR_ML_NODES = '1GB'; export const TRIAL_MAX_RAM_FOR_ML_NODES = '2GB'; diff --git a/x-pack/plugins/ml/common/license/ml_license.ts b/x-pack/plugins/ml/common/license/ml_license.ts index a698b8801ef69..43e61cf7da6b0 100644 --- a/x-pack/plugins/ml/common/license/ml_license.ts +++ b/x-pack/plugins/ml/common/license/ml_license.ts @@ -11,6 +11,7 @@ import { PLUGIN_ID } from '../constants/app'; export const MINIMUM_LICENSE = 'basic'; export const MINIMUM_FULL_LICENSE = 'platinum'; +export const TRIAL_LICENSE = 'trial'; export interface LicenseStatus { isValid: boolean; @@ -26,6 +27,7 @@ export class MlLicense { private _isMlEnabled: boolean = false; private _isMinimumLicense: boolean = false; private _isFullLicense: boolean = false; + private _isTrialLicense: boolean = false; private _initialized: boolean = false; public setup( @@ -41,6 +43,7 @@ export class MlLicense { this._isMlEnabled = this._license.getFeature(PLUGIN_ID).isEnabled; this._isMinimumLicense = isMinimumLicense(this._license); this._isFullLicense = isFullLicense(this._license); + this._isTrialLicense = isTrialLicense(this._license); if (this._initialized === false && postInitFunctions !== undefined) { postInitFunctions.forEach((f) => f(this)); @@ -74,12 +77,20 @@ export class MlLicense { public isFullLicense() { return this._isFullLicense; } + + public isTrialLicense() { + return this._isTrialLicense; + } } export function isFullLicense(license: ILicense) { return license.check(PLUGIN_ID, MINIMUM_FULL_LICENSE).state === 'valid'; } +export function isTrialLicense(license: ILicense) { + return license.check(PLUGIN_ID, TRIAL_LICENSE).state === 'valid'; +} + export function isMinimumLicense(license: ILicense) { return license.check(PLUGIN_ID, MINIMUM_LICENSE).state === 'valid'; } diff --git a/x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.test.tsx b/x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.test.tsx index 536cc26888a98..b794e6bbdf2bc 100644 --- a/x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.test.tsx +++ b/x-pack/plugins/ml/public/application/components/navigation_menu/date_picker_wrapper/date_picker_wrapper.test.tsx @@ -104,7 +104,7 @@ const MockedEuiSuperDatePicker = EuiSuperDatePicker as jest.MockedFunction< describe('Navigation Menu: <DatePickerWrapper />', () => { beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); MockedEuiSuperDatePicker.mockClear(); }); diff --git a/x-pack/plugins/ml/public/application/components/node_available_warning/node_available_warning.tsx b/x-pack/plugins/ml/public/application/components/node_available_warning/node_available_warning.tsx index 5aa3d8aad83c5..c474c20a890fe 100644 --- a/x-pack/plugins/ml/public/application/components/node_available_warning/node_available_warning.tsx +++ b/x-pack/plugins/ml/public/application/components/node_available_warning/node_available_warning.tsx @@ -11,13 +11,21 @@ import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { mlNodesAvailable, permissionToViewMlNodeCount } from '../../ml_nodes_check'; import { getCloudDeploymentId, isCloud } from '../../services/ml_server_info'; -import { TRIAL_MAX_RAM_FOR_ML_NODES } from '../../../../common/constants/cloud'; +import { + TRIAL_MAX_RAM_FOR_ML_NODES, + PLATINUM_MAX_RAM_FOR_ML_NODES, +} from '../../../../common/constants/cloud'; +import { isTrialLicense } from '../../license/check_license'; export const NodeAvailableWarning: FC = () => { if (mlNodesAvailable() === true || permissionToViewMlNodeCount() === false) { return null; } + const maxRamForMLNodes = isTrialLicense() + ? TRIAL_MAX_RAM_FOR_ML_NODES + : PLATINUM_MAX_RAM_FOR_ML_NODES; + const id = getCloudDeploymentId(); return ( <Fragment> @@ -57,7 +65,7 @@ export const NodeAvailableWarning: FC = () => { /> </EuiLink> ), - maxRamForMLNodes: TRIAL_MAX_RAM_FOR_ML_NODES, + maxRamForMLNodes, }} /> </div> diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_page_wrapper/exploration_page_wrapper.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_page_wrapper/exploration_page_wrapper.tsx index 482c214f884a3..c10c3e67be443 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_page_wrapper/exploration_page_wrapper.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_page_wrapper/exploration_page_wrapper.tsx @@ -161,7 +161,7 @@ export const ExplorationPageWrapper: FC<Props> = ({ return ( <> - {typeof jobConfig?.description !== 'undefined' && ( + {typeof jobConfig?.description !== 'undefined' && jobConfig?.description !== '' && ( <> <EuiText>{jobConfig?.description}</EuiText> <EuiSpacer size="m" /> diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx index 93ceccf2756dc..67af8f7089210 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx @@ -121,7 +121,7 @@ export const OutlierExploration: FC<ExplorationProps> = React.memo(({ jobId }) = return ( <> - {typeof jobConfig?.description !== 'undefined' && ( + {typeof jobConfig?.description !== 'undefined' && jobConfig?.description !== '' && ( <> <EuiText>{jobConfig?.description}</EuiText> <EuiSpacer size="m" /> diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/page.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/page.tsx index b8ed840397675..0550226599eb1 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/page.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/page.tsx @@ -25,6 +25,7 @@ import { } from '../components/analytics_selector'; import { AnalyticsEmptyPrompt } from '../analytics_management/components/empty_prompt'; import { useUrlState } from '../../../util/url_state'; +import { SavedObjectsWarning } from '../../../components/saved_objects_warning'; export const Page: FC<{ jobId: string; @@ -41,7 +42,9 @@ export const Page: FC<{ } = useMlApiContext(); const helpLink = docLinks.links.ml.dataFrameAnalytics; const jobIdToUse = jobId ?? analyticsId?.job_id; - const analysisTypeToUse = analysisType || analyticsId?.analysis_type; + const [analysisTypeToUse, setAnalysisTypeToUse] = useState< + DataFrameAnalysisConfigType | undefined + >(analysisType || analyticsId?.analysis_type); const [, setGlobalState] = useUrlState('_g'); @@ -55,6 +58,25 @@ export const Page: FC<{ } }; + // The inner components of the results page don't have a concept of reloading the full page. + // Because we might want to refresh though if a user has to fix unsynced saved objects, + // we achieve this here by unmounting the inner pages first by setting `analysisTypeToUse` + // to `undefined`. The `useEffect()` below will then check if `analysisTypeToUse` doesn't + // match the passed in analyis type and will update it once again, the re-mounted + // page will then again fetch the most recent results. + const refresh = () => { + setAnalysisTypeToUse(undefined); + }; + + useEffect( + function checkRefresh() { + if (analysisTypeToUse !== analysisType || analyticsId?.analysis_type) { + setAnalysisTypeToUse(analysisType || analyticsId?.analysis_type); + } + }, + [analyticsId, analysisType, analysisTypeToUse] + ); + useEffect(function checkJobs() { checkJobsExist(); // eslint-disable-next-line react-hooks/exhaustive-deps @@ -126,6 +148,9 @@ export const Page: FC<{ /> </MlPageHeader> )} + + <SavedObjectsWarning onCloseFlyout={refresh} /> + {jobIdToUse && analysisTypeToUse ? ( <div data-test-subj="mlPageDataFrameAnalyticsExploration"> {analysisTypeToUse === ANALYSIS_CONFIG_TYPE.OUTLIER_DETECTION && ( diff --git a/x-pack/plugins/ml/public/application/license/check_license.tsx b/x-pack/plugins/ml/public/application/license/check_license.tsx index ddf59ac1d7e5d..1cab46595007c 100644 --- a/x-pack/plugins/ml/public/application/license/check_license.tsx +++ b/x-pack/plugins/ml/public/application/license/check_license.tsx @@ -84,3 +84,13 @@ export function hasLicenseExpired() { export function isFullLicense() { return mlLicense !== null && mlLicense.isFullLicense(); } + +/** + * Check to see if the current license is trial. + * + * @export + * @returns {boolean} + */ +export function isTrialLicense() { + return mlLicense !== null && mlLicense.isTrialLicense(); +} diff --git a/x-pack/plugins/ml/public/application/routing/use_resolver.test.ts b/x-pack/plugins/ml/public/application/routing/use_resolver.test.ts index 2ff7d4b024800..d174c4c2c7e3f 100644 --- a/x-pack/plugins/ml/public/application/routing/use_resolver.test.ts +++ b/x-pack/plugins/ml/public/application/routing/use_resolver.test.ts @@ -38,7 +38,7 @@ const redirectToJobsManagementPage = jest.fn(() => Promise.resolve()); describe('useResolver', () => { afterEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterEach(() => { jest.advanceTimersByTime(0); diff --git a/x-pack/plugins/ml/public/application/services/anomaly_explorer_charts_service.test.ts b/x-pack/plugins/ml/public/application/services/anomaly_explorer_charts_service.test.ts index a4874b9c13dd1..ad78677ad0f1f 100644 --- a/x-pack/plugins/ml/public/application/services/anomaly_explorer_charts_service.test.ts +++ b/x-pack/plugins/ml/public/application/services/anomaly_explorer_charts_service.test.ts @@ -37,7 +37,7 @@ describe('AnomalyExplorerChartsService', () => { }; beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); mlApiServicesMock.jobs.jobForCloning.mockImplementation(() => Promise.resolve({})); diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/start_deployment_setup.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/start_deployment_setup.tsx index a315da1ca9f8f..ea3f1c7a5705a 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/start_deployment_setup.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/start_deployment_setup.tsx @@ -33,7 +33,6 @@ import type { Observable } from 'rxjs'; import type { CoreTheme, OverlayStart } from '@kbn/core/public'; import { css } from '@emotion/react'; import { numberValidator } from '@kbn/ml-agg-utils'; -import { isCloud } from '../../services/ml_server_info'; import { composeValidators, requiredValidator } from '../../../../common/util/validators'; interface StartDeploymentSetup { @@ -224,30 +223,6 @@ export const StartDeploymentModal: FC<StartDeploymentModalProps> = ({ </EuiModalHeader> <EuiModalBody> - {isCloud() ? ( - <> - <EuiCallOut - size={'s'} - title={ - <FormattedMessage - id="xpack.ml.trainedModels.modelsList.startDeployment.cloudWarningHeader" - defaultMessage="In the future Cloud deployments will autoscale to have the required number of processors." - /> - } - iconType="iInCircle" - color={'warning'} - > - <p> - <FormattedMessage - id="xpack.ml.trainedModels.modelsList.startDeployment.cloudWarningText" - defaultMessage="However, in this release you must increase the size of your ML nodes manually in the Cloud console to get more processors." - /> - </p> - </EuiCallOut> - <EuiSpacer size={'m'} /> - </> - ) : null} - <EuiCallOut size={'s'} title={ diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/selected_model.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/selected_model.tsx index 35f0670646004..6836321395d7d 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/selected_model.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/selected_model.tsx @@ -6,7 +6,7 @@ */ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import React, { FC } from 'react'; +import React, { FC, useMemo } from 'react'; import { NerInference } from './models/ner'; import { QuestionAnsweringInference } from './models/question_answering'; @@ -28,53 +28,41 @@ import { useMlApiContext } from '../../../contexts/kibana'; import { InferenceInputForm } from './models/inference_input_form'; interface Props { - model: estypes.MlTrainedModelConfig | null; + model: estypes.MlTrainedModelConfig; } export const SelectedModel: FC<Props> = ({ model }) => { const { trainedModels } = useMlApiContext(); - if (model === null) { - return null; - } - - if (model.model_type === TRAINED_MODEL_TYPE.PYTORCH) { - if (Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.NER) { - const inferrer = new NerInference(trainedModels, model); - return <InferenceInputForm inferrer={inferrer} />; - } - - if (Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.TEXT_CLASSIFICATION) { - const inferrer = new TextClassificationInference(trainedModels, model); - return <InferenceInputForm inferrer={inferrer} />; - } + const inferrer = useMemo(() => { + if (model.model_type === TRAINED_MODEL_TYPE.PYTORCH) { + const taskType = Object.keys(model.inference_config)[0]; - if ( - Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.ZERO_SHOT_CLASSIFICATION - ) { - const inferrer = new ZeroShotClassificationInference(trainedModels, model); - return <InferenceInputForm inferrer={inferrer} />; - } - - if (Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.TEXT_EMBEDDING) { - const inferrer = new TextEmbeddingInference(trainedModels, model); - return <InferenceInputForm inferrer={inferrer} />; - } + switch (taskType) { + case SUPPORTED_PYTORCH_TASKS.NER: + return new NerInference(trainedModels, model); + case SUPPORTED_PYTORCH_TASKS.TEXT_CLASSIFICATION: + return new TextClassificationInference(trainedModels, model); + case SUPPORTED_PYTORCH_TASKS.ZERO_SHOT_CLASSIFICATION: + return new ZeroShotClassificationInference(trainedModels, model); + case SUPPORTED_PYTORCH_TASKS.TEXT_EMBEDDING: + return new TextEmbeddingInference(trainedModels, model); + case SUPPORTED_PYTORCH_TASKS.FILL_MASK: + return new FillMaskInference(trainedModels, model); + case SUPPORTED_PYTORCH_TASKS.QUESTION_ANSWERING: + return new QuestionAnsweringInference(trainedModels, model); - if (Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.FILL_MASK) { - const inferrer = new FillMaskInference(trainedModels, model); - return <InferenceInputForm inferrer={inferrer} />; + default: + break; + } + } else if (model.model_type === TRAINED_MODEL_TYPE.LANG_IDENT) { + return new LangIdentInference(trainedModels, model); } + }, [model, trainedModels]); - if (Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.QUESTION_ANSWERING) { - const inferrer = new QuestionAnsweringInference(trainedModels, model); - return <InferenceInputForm inferrer={inferrer} />; - } - } - if (model.model_type === TRAINED_MODEL_TYPE.LANG_IDENT) { - const inferrer = new LangIdentInference(trainedModels, model); - return <InferenceInputForm inferrer={inferrer} />; + if (inferrer === undefined) { + return null; } - return null; + return <InferenceInputForm inferrer={inferrer} />; }; diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_charts/use_anomaly_charts_input_resolver.test.ts b/x-pack/plugins/ml/public/embeddables/anomaly_charts/use_anomaly_charts_input_resolver.test.ts index 4231f08b00c45..112863f560df3 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_charts/use_anomaly_charts_input_resolver.test.ts +++ b/x-pack/plugins/ml/public/embeddables/anomaly_charts/use_anomaly_charts_input_resolver.test.ts @@ -48,7 +48,7 @@ describe('useAnomalyChartsInputResolver', () => { }; beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const jobIds = ['test-job']; embeddableInput = new BehaviorSubject({ diff --git a/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts b/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts index 7aa81e7668c0f..442267c2c98d8 100644 --- a/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts +++ b/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts @@ -137,7 +137,7 @@ export function registerAnomalyDetectionAlertType({ minimumLicenseRequired: MINIMUM_FULL_LICENSE, isExportable: true, doesSetRecoveryContext: true, - async executor({ services, params, alertId, state, previousStartedAt, startedAt, name }) { + async executor({ services, params }) { const fakeRequest = {} as KibanaRequest; const { execute } = mlSharedServices.alertingServiceProvider( services.savedObjectsClient, diff --git a/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts b/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts index 7ea087e1239a6..5c75cec536944 100644 --- a/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts +++ b/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts @@ -142,7 +142,10 @@ export function registerJobsMonitoringRuleType({ isExportable: true, doesSetRecoveryContext: true, async executor(options) { - const { services, name } = options; + const { + services, + rule: { name }, + } = options; const fakeRequest = {} as KibanaRequest; const { getTestsResults } = mlServicesProviders.jobsHealthServiceProvider( diff --git a/x-pack/plugins/ml/server/routes/apidoc_scripts/schema_extractor.ts b/x-pack/plugins/ml/server/routes/apidoc_scripts/schema_extractor.ts index 2422feaf895a4..41c31f82f76b0 100644 --- a/x-pack/plugins/ml/server/routes/apidoc_scripts/schema_extractor.ts +++ b/x-pack/plugins/ml/server/routes/apidoc_scripts/schema_extractor.ts @@ -5,6 +5,9 @@ * 2.0. */ +import Path from 'path'; +import { REPO_ROOT } from '@kbn/utils'; + // eslint-disable-next-line import/no-extraneous-dependencies import * as ts from 'typescript'; @@ -17,13 +20,19 @@ export interface DocEntry { } /** Generate documentation for all schema definitions in a set of .ts files */ -export function extractDocumentation( - fileNames: string[], - options: ts.CompilerOptions = { +export function extractDocumentation(fileNames: string[]): Map<string, DocEntry[]> { + const json = ts.readConfigFile(Path.resolve(REPO_ROOT, 'tsconfig.base.json'), ts.sys.readFile); + + if (json.error) { + throw new Error(`Unable to parse tsconfig.base.json file: ${json.error.messageText}`); + } + + const options = { target: ts.ScriptTarget.ES2015, module: ts.ModuleKind.CommonJS, - } -): Map<string, DocEntry[]> { + paths: json.config.compilerOptions.paths, + }; + // Build a program using the set of root file names in fileNames const program = ts.createProgram(fileNames, options); diff --git a/x-pack/plugins/ml/tsconfig.json b/x-pack/plugins/ml/tsconfig.json index a99bc950ca445..ff4bd0825cea9 100644 --- a/x-pack/plugins/ml/tsconfig.json +++ b/x-pack/plugins/ml/tsconfig.json @@ -4,7 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "common/**/*", @@ -16,7 +20,7 @@ "public/**/*.json", "server/**/*.json" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, { "path": "../../../src/plugins/data_views/tsconfig.json" }, diff --git a/x-pack/plugins/monitoring/public/components/renderers/setup_mode.test.js b/x-pack/plugins/monitoring/public/components/renderers/setup_mode.test.js index f2e952c96e88f..7984b8c23cdc5 100644 --- a/x-pack/plugins/monitoring/public/components/renderers/setup_mode.test.js +++ b/x-pack/plugins/monitoring/public/components/renderers/setup_mode.test.js @@ -171,7 +171,7 @@ describe('SetupModeRenderer', () => { it('should use a new product found in the api response', () => { const newProduct = { id: 1 }; - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); jest.doMock('../../lib/setup_mode', () => ({ getSetupModeState: () => ({ supported: true, diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.test.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.test.ts index 7fac9550996d2..c00facef1df78 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.test.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.test.ts @@ -7,6 +7,7 @@ import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; import { fetchIndexShardSize } from './fetch_index_shard_size'; +import { estypes } from '@elastic/elasticsearch'; jest.mock('../../static_globals', () => ({ Globals: { @@ -24,7 +25,6 @@ import { Globals } from '../../static_globals'; describe('fetchIndexShardSize', () => { const esClient = elasticsearchServiceMock.createScopedClusterClient().asCurrentUser; - const clusters = [ { clusterUuid: 'cluster123', @@ -34,7 +34,21 @@ describe('fetchIndexShardSize', () => { const size = 10; const shardIndexPatterns = '*'; const threshold = 0.00000001; - const esRes = { + + const esRes: estypes.SearchResponse = { + took: 1, + timed_out: false, + _shards: { + total: 0, + successful: 0, + failed: 0, + skipped: 0, + }, + hits: { + total: 0, + max_score: 0, + hits: [], + }, aggregations: { clusters: { buckets: [ @@ -48,6 +62,39 @@ describe('fetchIndexShardSize', () => { { key: '.monitoring-es-7-2022.01.27', doc_count: 30, + hits: { + hits: { + total: { + value: 30, + relation: 'eq', + }, + max_score: null, + hits: [ + { + _index: '.monitoring-es-7-2022.01.27', + _id: 'JVkunX4BfK-FILsH9Wr_', + _score: null, + _source: { + index_stats: { + shards: { + primaries: 2, + }, + primaries: { + store: { + size_in_bytes: 2171105970, + }, + }, + }, + }, + sort: [1643314607570], + }, + ], + }, + }, + }, + { + key: '.monitoring-es-7-2022.01.28', + doc_count: 30, hits: { hits: { total: { @@ -67,7 +114,7 @@ describe('fetchIndexShardSize', () => { }, primaries: { store: { - size_in_bytes: 3537949, + size_in_bytes: 1073741823, }, }, }, @@ -118,12 +165,9 @@ describe('fetchIndexShardSize', () => { }, }, }; - it('fetch as expected', async () => { - esClient.search.mockResponse( - // @ts-expect-error not full response interface - esRes - ); + it('fetch as expected', async () => { + esClient.search.mockResponse(esRes); const result = await fetchIndexShardSize( esClient, clusters, @@ -135,7 +179,13 @@ describe('fetchIndexShardSize', () => { { ccs: undefined, shardIndex: '.monitoring-es-7-2022.01.27', - shardSize: 0, + shardSize: 1.01, + clusterUuid: 'NG2d5jHiSBGPE6HLlUN2Bg', + }, + { + ccs: undefined, + shardIndex: '.monitoring-es-7-2022.01.28', + shardSize: 1, clusterUuid: 'NG2d5jHiSBGPE6HLlUN2Bg', }, { @@ -146,6 +196,27 @@ describe('fetchIndexShardSize', () => { }, ]); }); + + it('higher alert threshold', async () => { + esClient.search.mockResponse(esRes); + const oneGBThreshold = 1; + const result = await fetchIndexShardSize( + esClient, + clusters, + oneGBThreshold, + shardIndexPatterns, + size + ); + expect(result).toEqual([ + { + ccs: undefined, + shardIndex: '.monitoring-es-7-2022.01.27', + shardSize: 1.01, + clusterUuid: 'NG2d5jHiSBGPE6HLlUN2Bg', + }, + ]); + }); + it('should call ES with correct query', async () => { await fetchIndexShardSize(esClient, clusters, threshold, shardIndexPatterns, size); expect(esClient.search).toHaveBeenCalledWith({ @@ -201,6 +272,7 @@ describe('fetchIndexShardSize', () => { }, }); }); + it('should call ES with correct query when ccs disabled', async () => { // @ts-ignore Globals.app.config.ui.ccs.enabled = false; diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.ts index f8163f5c35bc6..5c32794cbf212 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.ts @@ -26,7 +26,7 @@ const memoizedIndexPatterns = (globPatterns: string) => { ) as RegExPatterns; }; -const gbMultiplier = 1000000000; +const gbMultiplier = Math.pow(1024, 3); export async function fetchIndexShardSize( esClient: ElasticsearchClient, diff --git a/x-pack/plugins/monitoring/tsconfig.json b/x-pack/plugins/monitoring/tsconfig.json index 79fcff4d840ff..815e1762eba95 100644 --- a/x-pack/plugins/monitoring/tsconfig.json +++ b/x-pack/plugins/monitoring/tsconfig.json @@ -4,14 +4,18 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "common/**/*", "public/**/*", "server/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, diff --git a/x-pack/plugins/monitoring_collection/tsconfig.json b/x-pack/plugins/monitoring_collection/tsconfig.json index c382b243b3fec..14ca8450fed91 100644 --- a/x-pack/plugins/monitoring_collection/tsconfig.json +++ b/x-pack/plugins/monitoring_collection/tsconfig.json @@ -4,12 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "server/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, ] diff --git a/x-pack/plugins/notifications/README.md b/x-pack/plugins/notifications/README.md new file mode 100755 index 0000000000000..75ea13570ec2b --- /dev/null +++ b/x-pack/plugins/notifications/README.md @@ -0,0 +1,70 @@ +# Kibana Notifications Plugin + +The Notifications plugin provides a set of services to help Solutions and plugins send notifications to users. + +## Notifications Plugin public API + +### Start + +The `start` function exposes the following interface: + +- `isEmailServiceAvailable(): boolean`: + A function to check whether the deployment is properly configured and the EmailService can be correctly retrieved. +- `getEmailService(): EmailService`: +- A function to get the basic EmailService, which can be used to send plain text emails. If the EmailService is not available, trying to retrieve it will result in an Exception. + + +### Usage + +To use the exposed plugin start contract: + +1. Make sure `notifications` is in your `optionalPlugins` in the `kibana.json` file: + +```json5 +// <plugin>/kibana.json +{ +"id": "...", +"requiredPlugins": ["notifications"] +} +``` + +2. Use the exposed contract: + +```ts +// <plugin>/server/plugin.ts +import { NotificationsPluginStart } from '../notifications/server`; + +interface MyPluginStartDeps { + notifications?: NotificationsPluginStart; +} + +class MyPlugin { + public start( + core: CoreStart, + { notifications }: MyPluginStartDeps + ) { + if (notifications.isEmailServiceAvailable()) { + const emailService = notifications.getEmailService(); + emailService.sendPlainTextEmail({ + to: 'foo@bar.com', + subject: 'Some subject', + message: 'Hello world!', + }); + } + ... + } +} +``` + +### Requirements + +- This plugin currently depends on the `'actions'` plugin, as it uses `Connectors` under the hood. +- Note also that for each notification channel the corresponding connector must be preconfigured. E.g. to enable email notifications, an `Email` connector must exist in the system. +- Once the appropriate connectors are preconfigured in `kibana.yaml`, you can configure the `'notifications'` plugin by adding: + + ```yaml + notifications: + connectors: + default: + email: elastic-cloud-email # The identifier of the configured connector + ``` diff --git a/x-pack/plugins/notifications/common/index.ts b/x-pack/plugins/notifications/common/index.ts new file mode 100644 index 0000000000000..bc315c3c9e028 --- /dev/null +++ b/x-pack/plugins/notifications/common/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 const PLUGIN_ID = 'notifications'; diff --git a/x-pack/plugins/notifications/jest.config.js b/x-pack/plugins/notifications/jest.config.js new file mode 100644 index 0000000000000..b19a8f2efe334 --- /dev/null +++ b/x-pack/plugins/notifications/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/jest_node', + rootDir: '../../..', + roots: ['<rootDir>/x-pack/plugins/notifications'], + coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/notifications', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['<rootDir>/x-pack/plugins/notifications/{common,server}/**/*.{js,ts,tsx}'], +}; diff --git a/x-pack/plugins/notifications/kibana.json b/x-pack/plugins/notifications/kibana.json new file mode 100755 index 0000000000000..45cf4c4cd47b0 --- /dev/null +++ b/x-pack/plugins/notifications/kibana.json @@ -0,0 +1,12 @@ +{ + "id": "notifications", + "owner": { + "name": "App Services", + "githubTeam": "kibana-app-services" + }, + "version": "kibana", + "server": true, + "ui": false, + "requiredPlugins": ["actions", "licensing"], + "optionalPlugins": [] +} diff --git a/x-pack/plugins/notifications/server/config/config.ts b/x-pack/plugins/notifications/server/config/config.ts new file mode 100644 index 0000000000000..f2dc570adabe9 --- /dev/null +++ b/x-pack/plugins/notifications/server/config/config.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 { schema, type TypeOf } from '@kbn/config-schema'; +import type { PluginConfigDescriptor } from '@kbn/core/server'; + +export const configSchema = schema.object( + { + connectors: schema.maybe( + schema.object({ + default: schema.maybe( + schema.object({ + email: schema.maybe(schema.string()), + }) + ), + }) + ), + }, + { defaultValue: {} } +); +export type NotificationsConfigType = TypeOf<typeof configSchema>; + +export const config: PluginConfigDescriptor<NotificationsConfigType> = { + schema: configSchema, +}; diff --git a/x-pack/plugins/notifications/server/config/index.ts b/x-pack/plugins/notifications/server/config/index.ts new file mode 100644 index 0000000000000..662050c13d2ec --- /dev/null +++ b/x-pack/plugins/notifications/server/config/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 { type NotificationsConfigType, config } from './config'; diff --git a/x-pack/plugins/notifications/server/index.ts b/x-pack/plugins/notifications/server/index.ts new file mode 100755 index 0000000000000..9e8785d680de5 --- /dev/null +++ b/x-pack/plugins/notifications/server/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { PluginInitializerContext } from '@kbn/core/server'; +import { NotificationsPlugin } from './plugin'; +export { config } from './config'; + +// This exports static code and TypeScript types, +// as well as, Kibana Platform `plugin()` initializer. +export type { NotificationsPluginStart } from './types'; + +export function plugin(initializerContext: PluginInitializerContext) { + return new NotificationsPlugin(initializerContext); +} diff --git a/x-pack/plugins/notifications/server/mocks.ts b/x-pack/plugins/notifications/server/mocks.ts new file mode 100644 index 0000000000000..6360e0ece597b --- /dev/null +++ b/x-pack/plugins/notifications/server/mocks.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 { PublicMethodsOf } from '@kbn/utility-types'; +import type { EmailService } from './services'; +import type { NotificationsPluginStart } from './types'; +import type { NotificationsPlugin } from './plugin'; + +const emailServiceMock: jest.Mocked<EmailService> = { + sendPlainTextEmail: jest.fn(), +}; + +const createEmailServiceMock = () => { + return emailServiceMock; +}; + +const startMock: jest.Mocked<NotificationsPluginStart> = { + isEmailServiceAvailable: jest.fn(), + getEmailService: jest.fn(createEmailServiceMock), +}; + +const createStartMock = () => { + return startMock; +}; + +const notificationsPluginMock: jest.Mocked<PublicMethodsOf<NotificationsPlugin>> = { + setup: jest.fn(), + start: jest.fn(createStartMock) as jest.Mock<NotificationsPluginStart>, + stop: jest.fn(), +}; + +const createNotificationsPluginMock = () => { + return notificationsPluginMock; +}; + +export const notificationsMock = { + createNotificationsPlugin: createNotificationsPluginMock, + createEmailService: createEmailServiceMock, + createStart: createStartMock, + clear: () => { + emailServiceMock.sendPlainTextEmail.mockClear(); + startMock.getEmailService.mockClear(); + startMock.isEmailServiceAvailable.mockClear(); + notificationsPluginMock.setup.mockClear(); + notificationsPluginMock.start.mockClear(); + notificationsPluginMock.stop.mockClear(); + }, +}; diff --git a/x-pack/plugins/notifications/server/plugin.test.ts b/x-pack/plugins/notifications/server/plugin.test.ts new file mode 100644 index 0000000000000..687414becb051 --- /dev/null +++ b/x-pack/plugins/notifications/server/plugin.test.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 { coreMock } from '@kbn/core/server/mocks'; +import { actionsMock } from '@kbn/actions-plugin/server/mocks'; +import type { NotificationsConfigType } from './config'; +import { NotificationsPlugin } from './plugin'; +import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; +import { EmailServiceProvider } from './services/connectors_email_service_provider'; +import { EmailServiceStart } from './services'; + +jest.mock('./services/connectors_email_service_provider'); + +const emailServiceProviderMock = EmailServiceProvider as jest.MockedClass< + typeof EmailServiceProvider +>; + +const validConnectorConfig = { + connectors: { + default: { + email: 'validConnectorId', + }, + }, +}; + +const createNotificationsPlugin = (config: NotificationsConfigType) => { + const context = coreMock.createPluginInitializerContext<NotificationsConfigType>(config); + const plugin = new NotificationsPlugin(context); + const coreSetup = coreMock.createSetup(); + const coreStart = coreMock.createStart(); + + const actionsSetup = actionsMock.createSetup(); + actionsSetup.isPreconfiguredConnector.mockImplementationOnce( + (connectorId) => connectorId === 'validConnectorId' + ); + const pluginSetup = { + actions: actionsSetup, + licensing: licensingMock.createSetup(), + }; + + const actionsStart = actionsMock.createStart(); + const pluginStart = { + actions: actionsStart, + licensing: licensingMock.createStart(), + }; + + return { + context, + logger: context.logger.get(), + plugin, + coreSetup, + coreStart, + actionsSetup, + pluginSetup, + actionsStart, + pluginStart, + }; +}; + +describe('Notifications Plugin', () => { + beforeEach(() => emailServiceProviderMock.mockClear()); + + it('should create an EmailServiceProvider passing in the configuration and logger from the initializer context', () => { + const { logger } = createNotificationsPlugin(validConnectorConfig); + expect(emailServiceProviderMock).toHaveBeenCalledTimes(1); + expect(emailServiceProviderMock).toHaveBeenCalledWith(validConnectorConfig, logger); + }); + + describe('setup()', () => { + it('should call setup() on the created EmailServiceProvider, passing in the setup plugin dependencies', () => { + const { plugin, coreSetup, pluginSetup } = createNotificationsPlugin(validConnectorConfig); + plugin.setup(coreSetup, pluginSetup); + expect(emailServiceProviderMock.mock.instances[0].setup).toHaveBeenCalledTimes(1); + expect(emailServiceProviderMock.mock.instances[0].setup).toBeCalledWith(pluginSetup); + }); + }); + + describe('start()', () => { + it('should call start() on the created EmailServiceProvider, passing in the setup plugin dependencies', () => { + const { plugin, coreStart, pluginStart } = createNotificationsPlugin(validConnectorConfig); + plugin.start(coreStart, pluginStart); + expect(emailServiceProviderMock.mock.instances[0].start).toHaveBeenCalledTimes(1); + expect(emailServiceProviderMock.mock.instances[0].start).toBeCalledWith(pluginStart); + }); + + it('should return EmailServiceProvider.start() contract as part of its contract', () => { + const { plugin, coreStart, pluginStart } = createNotificationsPlugin(validConnectorConfig); + + const emailStart: EmailServiceStart = { + getEmailService: jest.fn(), + isEmailServiceAvailable: jest.fn(), + }; + + const providerMock = emailServiceProviderMock.mock + .instances[0] as jest.Mocked<EmailServiceProvider>; + providerMock.start.mockReturnValue(emailStart); + const start = plugin.start(coreStart, pluginStart); + expect(emailServiceProviderMock.mock.instances[0].start).toHaveBeenCalledTimes(1); + expect(emailServiceProviderMock.mock.instances[0].start).toBeCalledWith(pluginStart); + expect(start).toEqual(expect.objectContaining(emailStart)); + }); + }); +}); diff --git a/x-pack/plugins/notifications/server/plugin.ts b/x-pack/plugins/notifications/server/plugin.ts new file mode 100755 index 0000000000000..562db1977a73c --- /dev/null +++ b/x-pack/plugins/notifications/server/plugin.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 { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; +import type { + NotificationsPluginSetupDeps, + NotificationsPluginStartDeps, + NotificationsPluginStart, +} from './types'; +import type { NotificationsConfigType } from './config'; +import { EmailServiceProvider } from './services/connectors_email_service_provider'; + +export class NotificationsPlugin implements Plugin<void, NotificationsPluginStart> { + private emailServiceProvider: EmailServiceProvider; + + constructor(initializerContext: PluginInitializerContext<NotificationsConfigType>) { + this.emailServiceProvider = new EmailServiceProvider( + initializerContext.config.get(), + initializerContext.logger.get() + ); + } + + public setup(_core: CoreSetup, plugins: NotificationsPluginSetupDeps) { + this.emailServiceProvider.setup(plugins); + } + + public start(_core: CoreStart, plugins: NotificationsPluginStartDeps) { + const emailStartContract = this.emailServiceProvider.start(plugins); + + return { + ...emailStartContract, + }; + } + + public stop() {} +} diff --git a/x-pack/plugins/notifications/server/services/connectors_email_service.test.ts b/x-pack/plugins/notifications/server/services/connectors_email_service.test.ts new file mode 100644 index 0000000000000..f07b3a3ab34ae --- /dev/null +++ b/x-pack/plugins/notifications/server/services/connectors_email_service.test.ts @@ -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 { unsecuredActionsClientMock } from '@kbn/actions-plugin/server/unsecured_actions_client/unsecured_actions_client.mock'; +import { ConnectorsEmailService } from './connectors_email_service'; +import type { PlainTextEmail } from './types'; + +const REQUESTER_ID = 'requesterId'; +const CONNECTOR_ID = 'connectorId'; + +describe('sendPlainTextEmail()', () => { + describe('calls the provided ActionsClient#bulkEnqueueExecution() with the appropriate params', () => { + it(`omits the 'relatedSavedObjects' field if no context is provided`, () => { + const actionsClient = unsecuredActionsClientMock.create(); + const email = new ConnectorsEmailService(REQUESTER_ID, CONNECTOR_ID, actionsClient); + const payload: PlainTextEmail = { + to: ['user1@email.com'], + subject: 'This is a notification email', + message: 'With some contents inside.', + }; + + email.sendPlainTextEmail(payload); + + expect(actionsClient.bulkEnqueueExecution).toHaveBeenCalledTimes(1); + expect(actionsClient.bulkEnqueueExecution).toHaveBeenCalledWith(REQUESTER_ID, [ + { + id: CONNECTOR_ID, + params: { + to: ['user1@email.com'], + subject: 'This is a notification email', + message: 'With some contents inside.', + }, + }, + ]); + }); + + it(`populates the 'relatedSavedObjects' field if context is provided`, () => { + const actionsClient = unsecuredActionsClientMock.create(); + const email = new ConnectorsEmailService(REQUESTER_ID, CONNECTOR_ID, actionsClient); + const payload: PlainTextEmail = { + to: ['user1@email.com', 'user2@email.com', 'user3@email.com'], + subject: 'This is a notification email', + message: 'With some contents inside.', + context: { + relatedObjects: [ + { + id: '9c9456a4-c160-46f5-96f7-e9ac734d0d9b', + type: 'cases', + namespace: 'space1', + }, + ], + }, + }; + + email.sendPlainTextEmail(payload); + + expect(actionsClient.bulkEnqueueExecution).toHaveBeenCalledTimes(1); + expect(actionsClient.bulkEnqueueExecution).toHaveBeenCalledWith(REQUESTER_ID, [ + { + id: CONNECTOR_ID, + params: { + to: ['user1@email.com'], + subject: 'This is a notification email', + message: 'With some contents inside.', + }, + relatedSavedObjects: [ + { + id: '9c9456a4-c160-46f5-96f7-e9ac734d0d9b', + type: 'cases', + namespace: 'space1', + }, + ], + }, + { + id: CONNECTOR_ID, + params: { + to: ['user2@email.com'], + subject: 'This is a notification email', + message: 'With some contents inside.', + }, + relatedSavedObjects: [ + { + id: '9c9456a4-c160-46f5-96f7-e9ac734d0d9b', + type: 'cases', + namespace: 'space1', + }, + ], + }, + { + id: CONNECTOR_ID, + params: { + to: ['user3@email.com'], + subject: 'This is a notification email', + message: 'With some contents inside.', + }, + relatedSavedObjects: [ + { + id: '9c9456a4-c160-46f5-96f7-e9ac734d0d9b', + type: 'cases', + namespace: 'space1', + }, + ], + }, + ]); + }); + }); +}); diff --git a/x-pack/plugins/notifications/server/services/connectors_email_service.ts b/x-pack/plugins/notifications/server/services/connectors_email_service.ts new file mode 100755 index 0000000000000..55586dd05b078 --- /dev/null +++ b/x-pack/plugins/notifications/server/services/connectors_email_service.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 type { IUnsecuredActionsClient } from '@kbn/actions-plugin/server'; +import type { EmailService, PlainTextEmail } from './types'; + +export class ConnectorsEmailService implements EmailService { + constructor( + private requesterId: string, + private connectorId: string, + private actionsClient: IUnsecuredActionsClient + ) {} + + async sendPlainTextEmail(params: PlainTextEmail): Promise<void> { + const actions = params.to.map((to) => ({ + id: this.connectorId, + params: { + to: [to], + subject: params.subject, + message: params.message, + }, + relatedSavedObjects: params.context?.relatedObjects, + })); + return await this.actionsClient.bulkEnqueueExecution(this.requesterId, actions); + } +} diff --git a/x-pack/plugins/notifications/server/services/connectors_email_service_provider.test.ts b/x-pack/plugins/notifications/server/services/connectors_email_service_provider.test.ts new file mode 100644 index 0000000000000..6c36f94db1a7c --- /dev/null +++ b/x-pack/plugins/notifications/server/services/connectors_email_service_provider.test.ts @@ -0,0 +1,243 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { loggerMock } from '@kbn/logging-mocks'; +import { actionsMock } from '@kbn/actions-plugin/server/mocks'; +import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; +import { LicensedEmailService } from './licensed_email_service'; +import { EmailServiceProvider } from './connectors_email_service_provider'; +import { ConnectorsEmailService } from './connectors_email_service'; +import { PLUGIN_ID } from '../../common'; + +jest.mock('./licensed_email_service'); +jest.mock('./connectors_email_service'); + +const licensedEmailServiceMock = LicensedEmailService as jest.MockedClass< + typeof LicensedEmailService +>; +const connectorsEmailServiceMock = ConnectorsEmailService as jest.MockedClass< + typeof ConnectorsEmailService +>; + +const missingConnectorConfig = { + connectors: { + default: {}, + }, +}; + +const invalidConnectorConfig = { + connectors: { + default: { + email: 'someUnexistingConnectorId', + }, + }, +}; + +const validConnectorConfig = { + connectors: { + default: { + email: 'validConnectorId', + }, + }, +}; + +describe('ConnectorsEmailServiceProvider', () => { + const logger = loggerMock.create(); + const actionsSetup = actionsMock.createSetup(); + actionsSetup.isPreconfiguredConnector.mockImplementation( + (connectorId) => connectorId === 'validConnectorId' + ); + + beforeEach(() => { + loggerMock.clear(logger); + licensedEmailServiceMock.mockClear(); + connectorsEmailServiceMock.mockClear(); + }); + + it('implements the IEmailServiceProvider interface', () => { + const serviceProvider = new EmailServiceProvider(validConnectorConfig, loggerMock.create()); + expect(serviceProvider.setup).toBeInstanceOf(Function); + expect(serviceProvider.start).toBeInstanceOf(Function); + }); + + describe('setup()', () => { + it('should log a warning if Actions or Licensing plugins are not available', () => { + const serviceProvider = new EmailServiceProvider(validConnectorConfig, logger); + serviceProvider.setup({ + actions: actionsSetup, + }); + + expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledWith( + `Email Service Error: 'actions' and 'licensing' plugins are required.` + ); + // eslint-disable-next-line dot-notation + expect(serviceProvider['setupSuccessful']).toEqual(false); + }); + + it('should log a warning if no default email connector has been defined', () => { + const serviceProvider = new EmailServiceProvider(missingConnectorConfig, logger); + serviceProvider.setup({ + actions: actionsSetup, + licensing: licensingMock.createSetup(), + }); + + expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledWith( + `Email Service Error: Email connector not specified.` + ); + // eslint-disable-next-line dot-notation + expect(serviceProvider['setupSuccessful']).toEqual(false); + }); + + it('should log a warning if the specified email connector is not a preconfigured connector', () => { + const serviceProvider = new EmailServiceProvider(invalidConnectorConfig, logger); + serviceProvider.setup({ + actions: actionsSetup, + licensing: licensingMock.createSetup(), + }); + + expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledWith( + `Email Service Error: Unexisting email connector 'someUnexistingConnectorId' specified.` + ); + // eslint-disable-next-line dot-notation + expect(serviceProvider['setupSuccessful']).toEqual(false); + }); + + it('should not log a warning if required plugins are present and the specified email connector is valid', () => { + const serviceProvider = new EmailServiceProvider(validConnectorConfig, logger); + serviceProvider.setup({ + actions: actionsSetup, + licensing: licensingMock.createSetup(), + }); + + expect(logger.warn).not.toHaveBeenCalled(); + // eslint-disable-next-line dot-notation + expect(serviceProvider['setupSuccessful']).toEqual(true); + }); + }); + + describe('start()', () => { + it('returns an object that implements the EmailServiceStart contract', () => { + const serviceProvider = new EmailServiceProvider(missingConnectorConfig, logger); + const start = serviceProvider.start({}); + expect(start.getEmailService).toBeInstanceOf(Function); + expect(start.isEmailServiceAvailable).toBeInstanceOf(Function); + }); + + describe('if setup has not been run', () => { + it('the start contract methods fail accordingly', () => { + const serviceProvider = new EmailServiceProvider(missingConnectorConfig, logger); + const start = serviceProvider.start({}); + expect(start.isEmailServiceAvailable()).toEqual(false); + expect(() => { + start.getEmailService(); + }).toThrowErrorMatchingInlineSnapshot(`"Email Service Error: setup() has not been run"`); + }); + }); + + describe('if setup() did not complete successfully', () => { + it('the start contract methods fail accordingly', () => { + const serviceProvider = new EmailServiceProvider(invalidConnectorConfig, logger); + serviceProvider.setup({ + actions: actionsSetup, + licensing: licensingMock.createSetup(), + }); + const start = serviceProvider.start({ + actions: actionsMock.createStart(), + licensing: licensingMock.createStart(), + }); + expect(start.isEmailServiceAvailable()).toEqual(false); + expect(() => { + start.getEmailService(); + }).toThrowErrorMatchingInlineSnapshot( + `"Email Service Error: Unexisting email connector 'someUnexistingConnectorId' specified."` + ); + }); + }); + + describe('if setup() did complete successfully and Action and Licensing plugin start contracts are available', () => { + it('attempts to build an UnsecuredActionsClient', () => { + const serviceProvider = new EmailServiceProvider(validConnectorConfig, logger); + const actionsStart = actionsMock.createStart(); + + serviceProvider.setup({ + actions: actionsSetup, + licensing: licensingMock.createSetup(), + }); + serviceProvider.start({ + actions: actionsStart, + licensing: licensingMock.createStart(), + }); + expect(actionsStart.getUnsecuredActionsClient).toHaveBeenCalledTimes(1); + }); + + describe('if getUnsecuredActionsClient() throws an Exception', () => { + it('catches the exception, and the start contract methods fail accordingly', () => { + const serviceProvider = new EmailServiceProvider(validConnectorConfig, logger); + const actionsStart = actionsMock.createStart(); + actionsStart.getUnsecuredActionsClient.mockImplementation(() => { + throw new Error('Something went terribly wrong.'); + }); + + serviceProvider.setup({ + actions: actionsSetup, + licensing: licensingMock.createSetup(), + }); + const start = serviceProvider.start({ + actions: actionsStart, + licensing: licensingMock.createStart(), + }); + + expect(start.isEmailServiceAvailable()).toEqual(false); + expect(() => { + start.getEmailService(); + }).toThrowErrorMatchingInlineSnapshot( + `"Email Service Error: Something went terribly wrong."` + ); + }); + }); + + describe('if getUnsecuredActionsClient() returns an UnsecuredActionsClient', () => { + it('returns a start contract that provides valid EmailService', () => { + const serviceProvider = new EmailServiceProvider(validConnectorConfig, logger); + const licensingStart = licensingMock.createStart(); + const actionsStart = actionsMock.createStart(); + + serviceProvider.setup({ + actions: actionsSetup, + licensing: licensingMock.createSetup(), + }); + const start = serviceProvider.start({ + actions: actionsStart, + licensing: licensingStart, + }); + + expect(start.isEmailServiceAvailable()).toEqual(true); + const email = start.getEmailService(); + expect(email).toBeInstanceOf(LicensedEmailService); + expect(licensedEmailServiceMock).toHaveBeenCalledTimes(1); + + expect(licensedEmailServiceMock).toHaveBeenCalledWith( + connectorsEmailServiceMock.mock.instances[0], + licensingStart.license$, + 'platinum', + expect.objectContaining({ debug: expect.any(Function), warn: expect.any(Function) }) + ); + + expect(connectorsEmailServiceMock).toHaveBeenCalledTimes(1); + expect(connectorsEmailServiceMock).toHaveBeenCalledWith( + PLUGIN_ID, + validConnectorConfig.connectors.default.email, + actionsStart.getUnsecuredActionsClient() + ); + }); + }); + }); + }); +}); diff --git a/x-pack/plugins/notifications/server/services/connectors_email_service_provider.ts b/x-pack/plugins/notifications/server/services/connectors_email_service_provider.ts new file mode 100755 index 0000000000000..f034116eb701c --- /dev/null +++ b/x-pack/plugins/notifications/server/services/connectors_email_service_provider.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 type { Logger } from '@kbn/core/server'; +import { PluginSetupContract, PluginStartContract } from '@kbn/actions-plugin/server'; +import { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; +import type { EmailService, EmailServiceStart, IEmailServiceProvider } from './types'; +import type { NotificationsConfigType } from '../config'; +import { LicensedEmailService } from './licensed_email_service'; +import { ConnectorsEmailService } from './connectors_email_service'; +import { PLUGIN_ID } from '../../common'; + +const MINIMUM_LICENSE = 'platinum'; + +export interface EmailServiceSetupDeps { + actions?: PluginSetupContract; + licensing?: LicensingPluginSetup; +} + +export interface EmailServiceStartDeps { + actions?: PluginStartContract; + licensing?: LicensingPluginStart; +} + +export class EmailServiceProvider + implements IEmailServiceProvider<EmailServiceSetupDeps, EmailServiceStartDeps> +{ + private setupSuccessful: boolean; + private setupError: string; + + constructor(private config: NotificationsConfigType, private logger: Logger) { + this.setupSuccessful = false; + this.setupError = 'Email Service Error: setup() has not been run'; + } + + public setup(plugins: EmailServiceSetupDeps) { + const { actions, licensing } = plugins; + + if (!actions || !licensing) { + return this._registerServiceError(`Error: 'actions' and 'licensing' plugins are required.`); + } + + const emailConnector = this.config.connectors?.default?.email; + if (!emailConnector) { + return this._registerServiceError('Error: Email connector not specified.'); + } + + if (!actions.isPreconfiguredConnector(emailConnector)) { + return this._registerServiceError( + `Error: Unexisting email connector '${emailConnector}' specified.` + ); + } + + this.setupSuccessful = true; + this.setupError = ''; + } + + public start(plugins: EmailServiceStartDeps): EmailServiceStart { + const { actions, licensing } = plugins; + + let email: EmailService; + if (this.setupSuccessful && actions && licensing) { + const emailConnector = this.config.connectors!.default!.email!; + + try { + const unsecuredActionsClient = actions.getUnsecuredActionsClient(); + email = new LicensedEmailService( + new ConnectorsEmailService(PLUGIN_ID, emailConnector, unsecuredActionsClient), + licensing.license$, + MINIMUM_LICENSE, + this.logger + ); + } catch (err) { + this._registerServiceError(err); + } + } + + return { + isEmailServiceAvailable: () => !!email, + getEmailService: () => { + if (!email) { + throw new Error(this.setupError); + } + return email; + }, + }; + } + + private _registerServiceError(error: string) { + const message = `Email Service ${error}`; + this.setupError = message; + this.logger.warn(message); + } +} diff --git a/x-pack/plugins/notifications/server/services/index.ts b/x-pack/plugins/notifications/server/services/index.ts new file mode 100644 index 0000000000000..f0ad8abb4885d --- /dev/null +++ b/x-pack/plugins/notifications/server/services/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 type { EmailService, EmailServiceStart, PlainTextEmail } from './types'; +export type { + EmailServiceSetupDeps, + EmailServiceStartDeps, +} from './connectors_email_service_provider'; diff --git a/x-pack/plugins/notifications/server/services/licensed_email_service.test.ts b/x-pack/plugins/notifications/server/services/licensed_email_service.test.ts new file mode 100644 index 0000000000000..ac196ebb7321b --- /dev/null +++ b/x-pack/plugins/notifications/server/services/licensed_email_service.test.ts @@ -0,0 +1,125 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Subject } from 'rxjs'; +import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; +import { loggerMock } from '@kbn/logging-mocks'; +import { LicensedEmailService } from './licensed_email_service'; +import type { ILicense } from '@kbn/licensing-plugin/server'; +import type { EmailService, PlainTextEmail } from './types'; + +const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +const emailServiceMock: EmailService = { + sendPlainTextEmail: jest.fn(), +}; + +const validLicense = licensingMock.createLicenseMock(); +const invalidLicense = licensingMock.createLicenseMock(); +invalidLicense.type = 'basic'; +invalidLicense.check = jest.fn(() => ({ + state: 'invalid', + message: 'This is an invalid testing license', +})) as unknown as any; + +const someEmail: PlainTextEmail = { + to: ['user1@email.com'], + subject: 'Some subject', + message: 'Some message', +}; + +describe('LicensedEmailService', () => { + const logger = loggerMock.create(); + + beforeEach(() => loggerMock.clear(logger)); + it('observes license$ changes and logs info or warning messages accordingly', () => { + const license$ = new Subject<ILicense>(); + new LicensedEmailService(emailServiceMock, license$, 'platinum', logger); + license$.next(invalidLicense); + + expect(logger.debug).not.toHaveBeenCalled(); + expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledWith('This is an invalid testing license'); + + license$.next(validLicense); + expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.debug).toHaveBeenCalledTimes(1); + expect(logger.debug).toHaveBeenCalledWith( + 'Your current license allows sending email notifications' + ); + }); + + describe('sendPlainTextEmail()', () => { + it('does not call the underlying email service until the license is determined and valid', async () => { + const license$ = new Subject<ILicense>(); + const email = new LicensedEmailService(emailServiceMock, license$, 'platinum', logger); + + email.sendPlainTextEmail(someEmail); + expect(emailServiceMock.sendPlainTextEmail).not.toHaveBeenCalled(); + license$.next(validLicense); + + await delay(1); + + expect(emailServiceMock.sendPlainTextEmail).toHaveBeenCalledTimes(1); + expect(emailServiceMock.sendPlainTextEmail).toHaveBeenCalledWith(someEmail); + }); + + it('does not call the underlying email service if the license is invalid', async () => { + const license$ = new Subject<ILicense>(); + const email = new LicensedEmailService(emailServiceMock, license$, 'platinum', logger); + license$.next(invalidLicense); + + try { + await email.sendPlainTextEmail(someEmail); + } catch (err) { + expect(err.message).toEqual( + 'The current license does not allow sending email notifications' + ); + return; + } + + expect('it should have thrown').toEqual('but it did not'); + }); + + it('does not log a warning for every email attempt, but rather for every license change', async () => { + const license$ = new Subject<ILicense>(); + const email = new LicensedEmailService(emailServiceMock, license$, 'platinum', logger); + license$.next(invalidLicense); + license$.next(validLicense); + license$.next(invalidLicense); + + expect(logger.debug).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledTimes(2); + + let emailsOk = 0; + let emailsKo = 0; + const silentSend = async () => { + try { + await email.sendPlainTextEmail(someEmail); + emailsOk++; + } catch (err) { + emailsKo++; + } + }; + + await silentSend(); + await silentSend(); + await silentSend(); + await silentSend(); + license$.next(validLicense); + await silentSend(); + await silentSend(); + await silentSend(); + await silentSend(); + + expect(logger.debug).toHaveBeenCalledTimes(2); + expect(logger.warn).toHaveBeenCalledTimes(2); + expect(emailsKo).toEqual(4); + expect(emailsOk).toEqual(4); + }); + }); +}); diff --git a/x-pack/plugins/notifications/server/services/licensed_email_service.ts b/x-pack/plugins/notifications/server/services/licensed_email_service.ts new file mode 100644 index 0000000000000..63fc6f8d13df3 --- /dev/null +++ b/x-pack/plugins/notifications/server/services/licensed_email_service.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 type { Logger } from '@kbn/logging'; +import type { ILicense, LicenseType } from '@kbn/licensing-plugin/server'; +import { firstValueFrom, map, type Observable, ReplaySubject, type Subject } from 'rxjs'; +import type { EmailService, PlainTextEmail } from './types'; +import { PLUGIN_ID } from '../../common'; + +export class LicensedEmailService implements EmailService { + private validLicense$: Subject<boolean> = new ReplaySubject(1); + + constructor( + private emailService: EmailService, + license$: Observable<ILicense>, + private minimumLicense: LicenseType, + private logger: Logger + ) { + // no need to explicitly unsubscribe as the license$ observable already completes on stop() + license$.pipe(map((license) => this.checkValidLicense(license))).subscribe(this.validLicense$); + } + + async sendPlainTextEmail(payload: PlainTextEmail): Promise<void> { + if (await firstValueFrom(this.validLicense$, { defaultValue: false })) { + await this.emailService.sendPlainTextEmail(payload); + } else { + throw new Error('The current license does not allow sending email notifications'); + } + } + + private checkValidLicense(license: ILicense): boolean { + const licenseCheck = license.check(PLUGIN_ID, this.minimumLicense); + + if (licenseCheck.state === 'valid') { + this.logger.debug('Your current license allows sending email notifications'); + return true; + } + + this.logger.warn( + licenseCheck.message || 'The current license does not allow sending email notifications' + ); + return false; + } +} diff --git a/x-pack/plugins/notifications/server/services/types.ts b/x-pack/plugins/notifications/server/services/types.ts new file mode 100755 index 0000000000000..798b4d7e24699 --- /dev/null +++ b/x-pack/plugins/notifications/server/services/types.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export interface EmailService { + sendPlainTextEmail(payload: PlainTextEmail): Promise<void>; +} + +export interface EmailServiceStart { + isEmailServiceAvailable(): boolean; + getEmailService(): EmailService; +} + +export interface IEmailServiceProvider<T, U> { + setup(setupDeps: T): void; + start(startDeps: U): EmailServiceStart; +} + +export interface RelatedSavedObject { + id: string; + type: string; + namespace?: string; // namespace is undefined for the spaceId 'default' +} + +export interface PlainTextEmail { + to: string[]; + subject: string; + message: string; + context?: { + relatedObjects?: RelatedSavedObject[]; + }; +} diff --git a/x-pack/plugins/notifications/server/types.ts b/x-pack/plugins/notifications/server/types.ts new file mode 100755 index 0000000000000..e7132a33cbb19 --- /dev/null +++ b/x-pack/plugins/notifications/server/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. + */ + +import type { EmailServiceStart, EmailServiceSetupDeps, EmailServiceStartDeps } from './services'; + +// The 'notifications' plugin is currently only exposing an email service. +// If we want to expose other services in the future, we should update these types accordingly +export type NotificationsPluginSetupDeps = EmailServiceSetupDeps; +export type NotificationsPluginStartDeps = EmailServiceStartDeps; +export type NotificationsPluginStart = EmailServiceStart; diff --git a/x-pack/plugins/notifications/tsconfig.json b/x-pack/plugins/notifications/tsconfig.json new file mode 100644 index 0000000000000..6f2c186803b0c --- /dev/null +++ b/x-pack/plugins/notifications/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "server/**/*", + // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 + "server/**/*.json", + "public/**/*", + "common/**/*" + ], + "kbn_references": [ + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../actions/tsconfig.json" }, + { "path": "../licensing/tsconfig.json" } + ] +} diff --git a/x-pack/plugins/observability/common/index.ts b/x-pack/plugins/observability/common/index.ts index 3c64645f9b1e8..a8332262eda94 100644 --- a/x-pack/plugins/observability/common/index.ts +++ b/x-pack/plugins/observability/common/index.ts @@ -18,7 +18,6 @@ export { enableComparisonByDefault, defaultApmServiceEnvironment, apmProgressiveLoading, - enableServiceGroups, apmServiceInventoryOptimizedSorting, apmServiceGroupMaxNumberOfServices, apmTraceExplorerTab, @@ -27,6 +26,9 @@ export { enableInfrastructureHostsView, enableServiceMetrics, enableAwsLambdaMetrics, + apmAWSLambdaPriceFactor, + apmAWSLambdaRequestCostPerMillion, + enableCriticalPath, } from './ui_settings_keys'; export { diff --git a/x-pack/plugins/observability/common/typings.ts b/x-pack/plugins/observability/common/typings.ts index 9def2c23d0ead..5bf00746f4946 100644 --- a/x-pack/plugins/observability/common/typings.ts +++ b/x-pack/plugins/observability/common/typings.ts @@ -26,12 +26,11 @@ export interface ApmIndicesConfig { apmAgentConfigurationIndex: string; apmCustomLinkIndex: string; } -export type AlertStatusFilterButton = - | typeof ALERT_STATUS_ACTIVE - | typeof ALERT_STATUS_RECOVERED - | ''; + +export type AlertStatus = typeof ALERT_STATUS_ACTIVE | typeof ALERT_STATUS_RECOVERED | ''; + export interface AlertStatusFilter { - status: AlertStatusFilterButton; + status: AlertStatus; query: string; label: string; } diff --git a/x-pack/plugins/observability/common/ui_settings_keys.ts b/x-pack/plugins/observability/common/ui_settings_keys.ts index f41e492d25050..52258c5711d1c 100644 --- a/x-pack/plugins/observability/common/ui_settings_keys.ts +++ b/x-pack/plugins/observability/common/ui_settings_keys.ts @@ -11,7 +11,6 @@ export const maxSuggestions = 'observability:maxSuggestions'; export const enableComparisonByDefault = 'observability:enableComparisonByDefault'; export const defaultApmServiceEnvironment = 'observability:apmDefaultServiceEnvironment'; export const apmProgressiveLoading = 'observability:apmProgressiveLoading'; -export const enableServiceGroups = 'observability:enableServiceGroups'; export const apmServiceInventoryOptimizedSorting = 'observability:apmServiceInventoryOptimizedSorting'; export const apmServiceGroupMaxNumberOfServices = @@ -22,3 +21,6 @@ export const apmLabsButton = 'observability:apmLabsButton'; export const enableInfrastructureHostsView = 'observability:enableInfrastructureHostsView'; export const enableAwsLambdaMetrics = 'observability:enableAwsLambdaMetrics'; export const enableServiceMetrics = 'observability:apmEnableServiceMetrics'; +export const apmAWSLambdaPriceFactor = 'observability:apmAWSLambdaPriceFactor'; +export const apmAWSLambdaRequestCostPerMillion = 'observability:apmAWSLambdaRequestCostPerMillion'; +export const enableCriticalPath = 'observability:apmEnableCriticalPath'; diff --git a/x-pack/plugins/observability/dev_docs/slo.md b/x-pack/plugins/observability/dev_docs/slo.md new file mode 100644 index 0000000000000..62bae550916b4 --- /dev/null +++ b/x-pack/plugins/observability/dev_docs/slo.md @@ -0,0 +1,299 @@ +# SLO + +Add the feature flag: `xpack.observability.unsafe.slo.enabled: true` in your Kibana config to enable the various SLO APIs. + +## Supported SLI + +We currently support the following SLI: +- APM Transaction Error Rate (Availability) +- APM Transaction Duration (Latency) +- Custom KQL + +For the APM SLIs, customer can provide the service, environment, transaction name and type to configure them. For the **Duration** SLI, a threshold in microsecond needs to be provided to discriminate the good and bad responses (events). For the **Error Rate** SLI, a list of good status codes needs to be provided to discriminate the good and bad responses (events). + +The **custom KQL** SLI requires an index pattern, an optional filter query, a numerator query, and denominator query. + +## SLO configuration + +### Time window + +We support **calendar aligned** and **rolling** time windows. Any duration greater than 1 day can be used: days, weeks, months, quarters, years. + +**Rolling time window:** Requires a duration, e.g. `1w` for one week, and `is_rolling: true`. SLOs defined with such time window, will only considere the SLI data from the last duration period as a moving window. + +**Calendar aligned time window:** Requires a duration, e.g. `1M` for one month, and a `calendar.start_time` date in ISO 8601 in UTC, which marks the beginning of the first period. From start time and the duration, the system will compute the different time windows. For example, starting the calendar on the **01/01/2022** with a monthly duration, if today is the **24/10/2022**, the window associated is: `[2022-10-01T00:00:00Z, 2022-11-01T00:00:00Z]` + +### Budgeting method + +An SLO can be configured with an **occurrences** or **timeslices** budgeting method. + +An **occurrences** budgeting method uses the number of **good** and **total** events during the time window. + +A **timeslices** budgeting method uses the number of **good slices** and **total slices** during the time window. A slice is an arbitrary time window (smaller than the overall SLO time window) that is either considered good or bad, calculated from the timeslice threshold and the ratio of good over total events that happened during the slice window. + +For example, defining a **timeslices** budgeting method with a `95%` slice threshold and `5m` slice window means that a 1 week SLO is split in 2,016 slices (`7*24*60 / 5`); for a 99% SLO target there will be approximately 20 minutes of available error budget. Each bucket is either good or bad depending on the ratio of good over total events during that bucket, compared to the slice threshold of 95%. + +### Objective + +The target objective is the value the SLO needs to meet during the time window. +If a **timeslices** budgeting method is used, we also need to define the **timeslice_target** which can be different than the overall SLO target. + + + +## Example + +### Availability + +<details> +<summary>99% availability for GET /api over the last 30 days</summary> + +``` +curl --request POST \ + --url http://localhost:5601/cyp/api/observability/slos \ + --header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \ + --header 'Content-Type: application/json' \ + --header 'kbn-xsrf: oui' \ + --data '{ + "name": "My SLO Name", + "description": "My SLO Description", + "indicator": { + "type": "slo.apm.transaction_error_rate", + "params": { + "environment": "production", + "service": "o11y-app", + "transaction_type": "request", + "transaction_name": "GET /api", + "good_status_codes": ["2xx", "3xx", "4xx"] + } + }, + "time_window": { + "duration": "30d", + "is_rolling": true + }, + "budgeting_method": "occurrences", + "objective": { + "target": 0.99 + } +}' +``` +</details> + +<details> +<summary>95% availability for GET /api quarterly aligned</summary> + +``` +curl --request POST \ + --url http://localhost:5601/cyp/api/observability/slos \ + --header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \ + --header 'Content-Type: application/json' \ + --header 'kbn-xsrf: oui' \ + --data '{ + "name": "My SLO Name", + "description": "My SLO Description", + "indicator": { + "type": "slo.apm.transaction_error_rate", + "params": { + "environment": "production", + "service": "o11y-app", + "transaction_type": "request", + "transaction_name": "GET /api", + "good_status_codes": ["2xx", "3xx", "4xx"] + } + }, + "time_window": { + "duration": "1q", + "calendar": { + "start_time": "2022-06-01T00:00:00.000Z" + } + }, + "budgeting_method": "occurrences", + "objective": { + "target": 0.95 + } +}' +``` +</details> + +<details> +<summary>90% availability for GET /api over the last week (5m timeslices)</summary> + +``` +curl --request POST \ + --url http://localhost:5601/cyp/api/observability/slos \ + --header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \ + --header 'Content-Type: application/json' \ + --header 'kbn-xsrf: oui' \ + --data '{ + "name": "My SLO Name", + "description": "My SLO Description", + "indicator": { + "type": "slo.apm.transaction_error_rate", + "params": { + "environment": "production", + "service": "o11y-app", + "transaction_type": "request", + "transaction_name": "GET /api", + "good_status_codes": ["2xx", "3xx", "4xx"] + } + }, + "time_window": { + "duration": "1w", + "is_rolling": true + }, + "budgeting_method": "timeslices", + "objective": { + "target": 0.90, + "timeslice_target": 0.86, + "timeslice_window": "5m" + } +}' +``` +</details> + +### Latency + +<details> +<summary>99% of GET /api under 500ms over the last week</summary> + +``` +curl --request POST \ + --url http://localhost:5601/cyp/api/observability/slos \ + --header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \ + --header 'Content-Type: application/json' \ + --header 'kbn-xsrf: oui' \ + --data '{ + "name": "My SLO Name", + "description": "My SLO Description", + "indicator": { + "type": "slo.apm.transaction_duration", + "params": { + "environment": "production", + "service": "o11y-app", + "transaction_type": "request", + "transaction_name": "GET /api", + "threshold.us": 500000 + } + }, + "time_window": { + "duration": "7d", + "is_rolling": true + }, + "budgeting_method": "occurrences", + "objective": { + "target": 0.99 + } +}' +``` +</details> + +<details> +<summary>95% of GET /api under 500ms over the last week (1m timeslices)</summary> + +``` +curl --request POST \ + --url http://localhost:5601/cyp/api/observability/slos \ + --header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \ + --header 'Content-Type: application/json' \ + --header 'kbn-xsrf: oui' \ + --data '{ + "name": "My SLO Name", + "description": "My SLO Description", + "indicator": { + "type": "slo.apm.transaction_duration", + "params": { + "environment": "production", + "service": "o11y-app", + "transaction_type": "request", + "transaction_name": "GET /api", + "threshold.us": 500000 + } + }, + "time_window": { + "duration": "7d", + "is_rolling": true + }, + "budgeting_method": "timeslices", + "objective": { + "target": 0.95, + "timeslice_target": 0.90, + "timeslice_window": "1m" + } +}' +``` +</details> + + +<details> +<summary>99.9% of GET /api under 500ms weekly aligned (5m timeslices)</summary> + +``` +curl --request POST \ + --url http://localhost:5601/cyp/api/observability/slos \ + --header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \ + --header 'Content-Type: application/json' \ + --header 'kbn-xsrf: oui' \ + --data '{ + "name": "My SLO Name", + "description": "My SLO Description", + "indicator": { + "type": "slo.apm.transaction_duration", + "params": { + "environment": "production", + "service": "o11y-app", + "transaction_type": "request", + "transaction_name": "GET /api", + "threshold.us": 500000 + } + }, + "time_window": { + "duration": "7d", + "calendar": { + "start_time": "2022-01-01T00:00:00.000Z" + } + }, + "budgeting_method": "timeslices", + "objective": { + "target": 0.999, + "timeslice_target": 0.95, + "timeslice_window": "5m" + } +}' +``` +</details> + + +### Custom + + +<details> +<summary>98.5% of 'logs lantency < 300ms' for 'groupId: group-0' over the last 7 days</summary> + +``` +curl --request POST \ + --url http://localhost:5601/cyp/api/observability/slos \ + --header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \ + --header 'Content-Type: application/json' \ + --header 'kbn-xsrf: oui' \ + --data '{ + "name": "My SLO Name", + "description": "My SLO Description", + "indicator": { + "type": "slo.kql.custom", + "params": { + "index": "high-cardinality-data-fake_logs*", + "numerator": "latency < 300", + "denominator": "", + "query_filter": "labels.groupId: group-0" + } + }, + "time_window": { + "duration": "7d", + "is_rolling": true + }, + "budgeting_method": "occurrences", + "objective": { + "target": 0.985 + } +}' +``` +</details> \ No newline at end of file diff --git a/x-pack/plugins/observability/e2e/tsconfig.json b/x-pack/plugins/observability/e2e/tsconfig.json index 241e4fab48aa2..0f9477b174d33 100644 --- a/x-pack/plugins/observability/e2e/tsconfig.json +++ b/x-pack/plugins/observability/e2e/tsconfig.json @@ -6,7 +6,7 @@ "outDir": "target/types", "types": [ "node"], }, - "references": [ + "kbn_references": [ { "path": "../../apm/tsconfig.json", }, diff --git a/x-pack/plugins/observability/public/application/types.ts b/x-pack/plugins/observability/public/application/types.ts index 4707760c63e39..e0d12548a2822 100644 --- a/x-pack/plugins/observability/public/application/types.ts +++ b/x-pack/plugins/observability/public/application/types.ts @@ -24,6 +24,8 @@ import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { LensPublicStart } from '@kbn/lens-plugin/public'; import { TriggersAndActionsUIPublicPluginStart } from '@kbn/triggers-actions-ui-plugin/public'; import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; + export interface ObservabilityAppServices { application: ApplicationStart; cases: CasesUiStart; @@ -42,5 +44,6 @@ export interface ObservabilityAppServices { theme: ThemeServiceStart; triggersActionsUi: TriggersAndActionsUIPublicPluginStart; uiSettings: IUiSettingsClient; + unifiedSearch: UnifiedSearchPublicPluginStart; isDev?: boolean; } diff --git a/x-pack/plugins/observability/public/components/shared/alert_search_bar/alert_search_bar.tsx b/x-pack/plugins/observability/public/components/shared/alert_search_bar/alert_search_bar.tsx new file mode 100644 index 0000000000000..0155084a3bc92 --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/alert_search_bar.tsx @@ -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 { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; + +import React, { useCallback, useEffect } from 'react'; +import { Query, BoolQuery } from '@kbn/es-query'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { observabilityAlertFeatureIds } from '../../../config'; +import { ObservabilityAppServices } from '../../../application/types'; +import { useAlertSearchBarStateContainer } from './containers'; +import { AlertsStatusFilter } from './components'; +import { ALERT_STATUS_QUERY } from './constants'; +import { buildEsQuery } from '../../../utils/build_es_query'; +import { AlertStatus } from '../../../../common/typings'; + +const getAlertStatusQuery = (status: string): Query[] => { + return status ? [{ query: ALERT_STATUS_QUERY[status], language: 'kuery' }] : []; +}; + +const DEFAULT_QUERIES: Query[] = []; + +export interface AlertSearchBarProps { + appName: string; + setEsQuery: (query: { bool: BoolQuery }) => void; + queries?: Query[]; +} + +export function AlertSearchBar({ + appName, + setEsQuery, + queries = DEFAULT_QUERIES, +}: AlertSearchBarProps) { + const { + data: { + query: { + timefilter: { timefilter: timeFilterService }, + }, + }, + triggersActionsUi: { getAlertsSearchBar: AlertsSearchBar }, + } = useKibana<ObservabilityAppServices>().services; + + const { rangeFrom, setRangeFrom, rangeTo, setRangeTo, kuery, setKuery, status, setStatus } = + useAlertSearchBarStateContainer(); + + const onStatusChange = useCallback( + (alertStatus: AlertStatus) => { + setEsQuery( + buildEsQuery( + { + to: rangeTo, + from: rangeFrom, + }, + kuery, + [...getAlertStatusQuery(alertStatus), ...queries] + ) + ); + }, + [kuery, queries, rangeFrom, rangeTo, setEsQuery] + ); + + useEffect(() => { + onStatusChange(status); + }, [onStatusChange, status]); + + const onSearchBarParamsChange = useCallback( + ({ dateRange, query }) => { + timeFilterService.setTime(dateRange); + setRangeFrom(dateRange.from); + setRangeTo(dateRange.to); + setKuery(query); + setEsQuery( + buildEsQuery( + { + to: rangeTo, + from: rangeFrom, + }, + query, + [...getAlertStatusQuery(status), ...queries] + ) + ); + }, + [ + timeFilterService, + setRangeFrom, + setRangeTo, + setKuery, + setEsQuery, + rangeTo, + rangeFrom, + status, + queries, + ] + ); + + return ( + <EuiFlexGroup direction="column" gutterSize="s"> + <EuiFlexItem> + <AlertsSearchBar + appName={appName} + featureIds={observabilityAlertFeatureIds} + rangeFrom={rangeFrom} + rangeTo={rangeTo} + query={kuery} + onQueryChange={onSearchBarParamsChange} + /> + </EuiFlexItem> + + <EuiFlexItem> + <EuiFlexGroup justifyContent="spaceBetween" alignItems="center"> + <EuiFlexItem grow={false}> + <AlertsStatusFilter + status={status} + onChange={(id) => { + setStatus(id as AlertStatus); + }} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + ); +} diff --git a/x-pack/plugins/observability/public/components/shared/alert_search_bar/alert_search_bar_with_url_sync.tsx b/x-pack/plugins/observability/public/components/shared/alert_search_bar/alert_search_bar_with_url_sync.tsx new file mode 100644 index 0000000000000..dae12ef43571a --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/alert_search_bar_with_url_sync.tsx @@ -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 React from 'react'; +import { alertsPageStateContainer, Provider } from './containers'; +import { AlertSearchBar, AlertSearchBarProps } from './alert_search_bar'; + +export function AlertSearchbarWithUrlSync(props: AlertSearchBarProps) { + return ( + <Provider value={alertsPageStateContainer}> + <AlertSearchBar {...props} /> + </Provider> + ); +} diff --git a/x-pack/plugins/observability/public/components/shared/alert_search_bar/components/alerts_status_filter.tsx b/x-pack/plugins/observability/public/components/shared/alert_search_bar/components/alerts_status_filter.tsx new file mode 100644 index 0000000000000..fa1f362120713 --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/components/alerts_status_filter.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 { EuiButtonGroup, EuiButtonGroupOptionProps } from '@elastic/eui'; +import React from 'react'; +import { ALL_ALERTS, ACTIVE_ALERTS, RECOVERED_ALERTS } from '../constants'; +import { AlertStatusFilterProps } from '../types'; + +const options: EuiButtonGroupOptionProps[] = [ + { + id: ALL_ALERTS.status, + label: ALL_ALERTS.label, + value: ALL_ALERTS.query, + 'data-test-subj': 'alert-status-filter-show-all-button', + }, + { + id: ACTIVE_ALERTS.status, + label: ACTIVE_ALERTS.label, + value: ACTIVE_ALERTS.query, + 'data-test-subj': 'alert-status-filter-active-button', + }, + { + id: RECOVERED_ALERTS.status, + label: RECOVERED_ALERTS.label, + value: RECOVERED_ALERTS.query, + 'data-test-subj': 'alert-status-filter-recovered-button', + }, +]; + +export function AlertsStatusFilter({ status, onChange }: AlertStatusFilterProps) { + return ( + <EuiButtonGroup + legend="Filter by" + color="primary" + options={options} + idSelected={status} + onChange={onChange} + /> + ); +} diff --git a/x-pack/plugins/observability/public/components/shared/alert_search_bar/components/index.ts b/x-pack/plugins/observability/public/components/shared/alert_search_bar/components/index.ts new file mode 100644 index 0000000000000..ceabe0e31ba5a --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/components/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 { AlertsStatusFilter } from './alerts_status_filter'; diff --git a/x-pack/plugins/observability/public/components/shared/alert_search_bar/constants.ts b/x-pack/plugins/observability/public/components/shared/alert_search_bar/constants.ts new file mode 100644 index 0000000000000..cec206b551ccf --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/constants.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 { i18n } from '@kbn/i18n'; +import { ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED, ALERT_STATUS } from '@kbn/rule-data-utils'; +import { AlertStatusFilter } from '../../../../common/typings'; + +export const ALL_ALERTS: AlertStatusFilter = { + status: '', + query: '', + label: i18n.translate('xpack.observability.alerts.alertStatusFilter.showAll', { + defaultMessage: 'Show all', + }), +}; + +export const ACTIVE_ALERTS: AlertStatusFilter = { + status: ALERT_STATUS_ACTIVE, + query: `${ALERT_STATUS}: "${ALERT_STATUS_ACTIVE}"`, + label: i18n.translate('xpack.observability.alerts.alertStatusFilter.active', { + defaultMessage: 'Active', + }), +}; + +export const RECOVERED_ALERTS: AlertStatusFilter = { + status: ALERT_STATUS_RECOVERED, + query: `${ALERT_STATUS}: "${ALERT_STATUS_RECOVERED}"`, + label: i18n.translate('xpack.observability.alerts.alertStatusFilter.recovered', { + defaultMessage: 'Recovered', + }), +}; + +export const ALERT_STATUS_QUERY = { + [ACTIVE_ALERTS.status]: ACTIVE_ALERTS.query, + [RECOVERED_ALERTS.status]: RECOVERED_ALERTS.query, +}; diff --git a/x-pack/plugins/observability/public/components/shared/alert_search_bar/containers/index.tsx b/x-pack/plugins/observability/public/components/shared/alert_search_bar/containers/index.tsx new file mode 100644 index 0000000000000..fc00f88715352 --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/containers/index.tsx @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { Provider, alertsPageStateContainer } from './state_container'; +export { useAlertSearchBarStateContainer } from './use_alert_search_bar_state_container'; diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/state_container/state_container.tsx b/x-pack/plugins/observability/public/components/shared/alert_search_bar/containers/state_container.tsx similarity index 82% rename from x-pack/plugins/observability/public/pages/alerts/containers/state_container/state_container.tsx rename to x-pack/plugins/observability/public/components/shared/alert_search_bar/containers/state_container.tsx index 392340fc80b2d..f596231b22c0c 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/state_container/state_container.tsx +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/containers/state_container.tsx @@ -9,11 +9,14 @@ import { createStateContainer, createStateContainerReactHelpers, } from '@kbn/kibana-utils-plugin/public'; +import { AlertStatus } from '../../../../../common/typings'; +import { ALL_ALERTS } from '../constants'; interface AlertsPageContainerState { rangeFrom: string; rangeTo: string; kuery: string; + status: AlertStatus; } interface AlertsPageStateTransitions { @@ -22,18 +25,21 @@ interface AlertsPageStateTransitions { ) => (rangeFrom: string) => AlertsPageContainerState; setRangeTo: (state: AlertsPageContainerState) => (rangeTo: string) => AlertsPageContainerState; setKuery: (state: AlertsPageContainerState) => (kuery: string) => AlertsPageContainerState; + setStatus: (state: AlertsPageContainerState) => (status: AlertStatus) => AlertsPageContainerState; } const defaultState: AlertsPageContainerState = { rangeFrom: 'now-15m', rangeTo: 'now', kuery: '', + status: ALL_ALERTS.status as AlertStatus, }; const transitions: AlertsPageStateTransitions = { setRangeFrom: (state) => (rangeFrom) => ({ ...state, rangeFrom }), setRangeTo: (state) => (rangeTo) => ({ ...state, rangeTo }), setKuery: (state) => (kuery) => ({ ...state, kuery }), + setStatus: (state) => (status) => ({ ...state, status }), }; const alertsPageStateContainer = createStateContainer(defaultState, transitions); diff --git a/x-pack/plugins/observability/public/components/shared/alert_search_bar/containers/use_alert_search_bar_state_container.tsx b/x-pack/plugins/observability/public/components/shared/alert_search_bar/containers/use_alert_search_bar_state_container.tsx new file mode 100644 index 0000000000000..35d93e4aee5f2 --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/containers/use_alert_search_bar_state_container.tsx @@ -0,0 +1,119 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useEffect } from 'react'; +import { useHistory } from 'react-router-dom'; + +import { TimefilterContract } from '@kbn/data-plugin/public'; +import { + createKbnUrlStateStorage, + syncState, + IKbnUrlStateStorage, + useContainerSelector, +} from '@kbn/kibana-utils-plugin/public'; +import { useTimefilterService } from '../../../../hooks/use_timefilter_service'; + +import { + useContainer, + defaultState, + AlertsPageStateContainer, + AlertsPageContainerState, +} from './state_container'; + +export function useAlertSearchBarStateContainer() { + const stateContainer = useContainer(); + + useUrlStateSyncEffect(stateContainer); + + const { setRangeFrom, setRangeTo, setKuery, setStatus } = stateContainer.transitions; + const { rangeFrom, rangeTo, kuery, status } = useContainerSelector( + stateContainer, + (state) => state + ); + + return { + rangeFrom, + setRangeFrom, + rangeTo, + setRangeTo, + kuery, + setKuery, + status, + setStatus, + }; +} + +function useUrlStateSyncEffect(stateContainer: AlertsPageStateContainer) { + const history = useHistory(); + const timefilterService = useTimefilterService(); + + useEffect(() => { + const urlStateStorage = createKbnUrlStateStorage({ + history, + useHash: false, + useHashQuery: false, + }); + const { start, stop } = setupUrlStateSync(stateContainer, urlStateStorage); + + start(); + + syncUrlStateWithInitialContainerState(timefilterService, stateContainer, urlStateStorage); + + return stop; + }, [stateContainer, history, timefilterService]); +} + +function setupUrlStateSync( + stateContainer: AlertsPageStateContainer, + stateStorage: IKbnUrlStateStorage +) { + // This handles filling the state when an incomplete URL set is provided + const setWithDefaults = (changedState: Partial<AlertsPageContainerState> | null) => { + stateContainer.set({ ...defaultState, ...changedState }); + }; + + return syncState({ + storageKey: '_a', + stateContainer: { + ...stateContainer, + set: setWithDefaults, + }, + stateStorage, + }); +} + +function syncUrlStateWithInitialContainerState( + timefilterService: TimefilterContract, + stateContainer: AlertsPageStateContainer, + urlStateStorage: IKbnUrlStateStorage +) { + const urlState = urlStateStorage.get<Partial<AlertsPageContainerState>>('_a'); + + if (urlState) { + const newState = { + ...defaultState, + ...urlState, + }; + + stateContainer.set(newState); + } else if (timefilterService.isTimeTouched()) { + const { from, to } = timefilterService.getTime(); + const newState = { + ...defaultState, + rangeFrom: from, + rangeTo: to, + }; + + stateContainer.set(newState); + } else { + // Reset the state container when no URL state or timefilter range is set to avoid accidentally + // re-using state set on a previous visit to the page in the same session + stateContainer.set(defaultState); + } + + urlStateStorage.set('_a', stateContainer.get()); +} diff --git a/x-pack/plugins/observability/public/components/shared/alert_search_bar/index.ts b/x-pack/plugins/observability/public/components/shared/alert_search_bar/index.ts new file mode 100644 index 0000000000000..db62f2b3b417a --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/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 { AlertSearchBar as ObservabilityAlertSearchBar } from './alert_search_bar'; +export { AlertSearchbarWithUrlSync as ObservabilityAlertSearchbarWithUrlSync } from './alert_search_bar_with_url_sync'; +export { Provider, alertsPageStateContainer } from './containers'; diff --git a/x-pack/plugins/observability/public/components/shared/alert_search_bar/types.ts b/x-pack/plugins/observability/public/components/shared/alert_search_bar/types.ts new file mode 100644 index 0000000000000..a255e2c6bb3a8 --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/types.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 { AlertStatus } from '../../../../common/typings'; + +export interface AlertStatusFilterProps { + status: AlertStatus; + onChange: (id: string, value: string) => void; +} diff --git a/x-pack/plugins/observability/public/components/shared/date_picker/date_picker.test.tsx b/x-pack/plugins/observability/public/components/shared/date_picker/date_picker.test.tsx index 138018e104c8a..929425d2d150a 100644 --- a/x-pack/plugins/observability/public/components/shared/date_picker/date_picker.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/date_picker/date_picker.test.tsx @@ -133,7 +133,7 @@ describe('DatePicker', () => { }); it('enables auto-refresh when refreshPaused is false', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const { wrapper } = mountDatePicker({ rangeFrom: 'now-15m', rangeTo: 'now', @@ -148,7 +148,7 @@ describe('DatePicker', () => { }); it('disables auto-refresh when refreshPaused is true', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); mountDatePicker({ rangeFrom: 'now-15m', rangeTo: 'now', diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/constants.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/constants.ts index 9f9664602a672..6a925c9b3d99b 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/constants.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/constants.ts @@ -59,6 +59,7 @@ import { EVENT_DATASET_LABEL, MESSAGE_LABEL, SINGLE_METRIC_LABEL, + HEATMAP_LABEL, } from './labels'; import { MONITOR_DURATION_US, @@ -167,6 +168,7 @@ export const DataViewLabels: Record<ReportViewType, string> = { 'core-web-vitals': CORE_WEB_VITALS_LABEL, 'device-data-distribution': DEVICE_DISTRIBUTION_LABEL, 'single-metric': SINGLE_METRIC_LABEL, + heatmap: HEATMAP_LABEL, }; export enum ReportTypes { @@ -175,6 +177,7 @@ export enum ReportTypes { CORE_WEB_VITAL = 'core-web-vitals', DEVICE_DISTRIBUTION = 'device-data-distribution', SINGLE_METRIC = 'single-metric', + HEATMAP = 'heatmap', } export enum DataTypes { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/labels.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/labels.ts index 83c7781f692a7..c15880fb9e5d2 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/labels.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/labels.ts @@ -242,6 +242,10 @@ export const SINGLE_METRIC_LABEL = i18n.translate( } ); +export const HEATMAP_LABEL = i18n.translate('xpack.observability.expView.fieldLabels.heatMap', { + defaultMessage: 'Heatmap', +}); + export const MOBILE_RESPONSE_LABEL = i18n.translate( 'xpack.observability.expView.fieldLabels.mobileResponse', { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts index ecc58776c07f6..8837618d6c759 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts @@ -21,7 +21,7 @@ import { RECORDS_FIELD, REPORT_METRIC_FIELD, PERCENTILE_RANKS, ReportTypes } fro import { obsvReportConfigMap } from '../obsv_exploratory_view'; import { sampleAttributeWithReferenceLines } from './test_data/sample_attribute_with_reference_lines'; import { lensPluginMock } from '@kbn/lens-plugin/public/mocks'; -import { FormulaPublicApi } from '@kbn/lens-plugin/public'; +import { FormulaPublicApi, XYState } from '@kbn/lens-plugin/public'; describe('Lens Attribute', () => { mockAppDataView(); @@ -470,11 +470,9 @@ describe('Lens Attribute', () => { layerConfig: layerConfig1, sourceField: USER_AGENT_NAME, layerId: 'layer0', - indexPattern: mockDataView, - labels: layerConfig.seriesConfig.labels, }); - expect(lnsAttr.visualization?.layers).toEqual([ + expect((lnsAttr.visualization as XYState)?.layers).toEqual([ { accessors: ['y-axis-column-layer0-0'], layerId: 'layer0', @@ -501,7 +499,7 @@ describe('Lens Attribute', () => { 'breakdown-column-layer0': { dataType: 'string', isBucketed: true, - label: 'Top values of Browser family', + label: 'Browser family', operationType: 'terms', params: { missingBucket: false, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts index 9d39286f68998..fe45872bf5a8d 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts @@ -34,6 +34,8 @@ import { XYCurveType, XYState, YAxisMode, + HeatmapVisualizationState, + MetricState, } from '@kbn/lens-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/common'; import { PersistableFilter } from '@kbn/lens-plugin/common'; @@ -58,6 +60,7 @@ import { ParamFilter, SeriesConfig, SupportedOperations, + TermColumnParamsOrderBy, UrlFilter, URLReportDefinition, } from '../types'; @@ -151,7 +154,7 @@ export interface LayerConfig { export class LensAttributes { layers: Record<string, PersistedIndexPatternLayer>; - visualization?: XYState; + visualization?: XYState | HeatmapVisualizationState | MetricState; layerConfigs: LayerConfig[] = []; isMultiSeries?: boolean; seriesReferenceLines: Record< @@ -175,6 +178,7 @@ export class LensAttributes { this.seriesReferenceLines = {}; this.reportType = reportType; this.lensFormulaHelper = lensFormulaHelper; + this.isMultiSeries = layerConfigs.length > 1; layerConfigs.forEach(({ seriesConfig, operationType }) => { if (operationType && reportType !== ReportTypes.SINGLE_METRIC) { @@ -186,14 +190,13 @@ export class LensAttributes { }); } }); + this.layerConfigs = layerConfigs; + this.globalFilter = this.getGlobalFilter(this.isMultiSeries); if (reportType === ReportTypes.SINGLE_METRIC) { return; } - this.layerConfigs = layerConfigs; - this.isMultiSeries = layerConfigs.length > 1; - this.globalFilter = this.getGlobalFilter(this.isMultiSeries); this.layers = this.getLayers(); this.visualization = this.getXyState(); } @@ -217,34 +220,47 @@ export class LensAttributes { getBreakdownColumn({ sourceField, layerId, - labels, - indexPattern, layerConfig, + alphabeticOrder, + size = 10, }: { sourceField: string; layerId: string; - labels: Record<string, string>; - indexPattern: DataView; layerConfig: LayerConfig; + alphabeticOrder?: boolean; + size?: number; }): TermsIndexPatternColumn { - const fieldMeta = indexPattern.getFieldByName(sourceField); + const { dataView, seriesConfig } = layerConfig; + + const fieldMeta = dataView.getFieldByName(sourceField); - const { sourceField: yAxisSourceField } = layerConfig.seriesConfig.yAxisColumns[0]; + const { sourceField: yAxisSourceField } = seriesConfig.yAxisColumns[0]; + + const labels = seriesConfig.labels ?? {}; const isFormulaColumn = yAxisSourceField === RECORDS_PERCENTAGE_FIELD; + let orderBy: TermColumnParamsOrderBy = { + type: 'column', + columnId: `y-axis-column-${layerId}-0`, + }; + + if (isFormulaColumn) { + orderBy = { type: 'custom' }; + } else if (alphabeticOrder) { + orderBy = { type: 'alphabetical', fallback: true }; + } + return { sourceField, - label: `Top values of ${labels[sourceField]}`, + label: labels[sourceField], dataType: fieldMeta?.type as DataType, operationType: 'terms', scale: 'ordinal', isBucketed: true, params: { - orderBy: isFormulaColumn - ? { type: 'custom' } - : { type: 'column', columnId: `y-axis-column-${layerId}-0` }, - size: 10, + orderBy, + size, orderDirection: 'desc', otherBucket: true, missingBucket: false, @@ -504,9 +520,7 @@ export class LensAttributes { return this.getBreakdownColumn({ layerId, layerConfig, - indexPattern: layerConfig.dataView, sourceField: layerConfig.breakdown || layerConfig.seriesConfig.breakdownFields[0], - labels: layerConfig.seriesConfig.labels, }); } @@ -1006,8 +1020,6 @@ export class LensAttributes { ? this.getBreakdownColumn({ layerId, sourceField: breakdown!, - indexPattern: layerConfig.dataView, - labels: layerConfig.seriesConfig.labels, layerConfig, }) : null; @@ -1230,7 +1242,10 @@ export class LensAttributes { return { internalReferences, adHocDataViews }; } - getJSON(lastRefresh?: number): TypedLensByValueInput['attributes'] { + getJSON( + visualizationType: 'lnsXY' | 'lnsLegacyMetric' | 'lnsHeatmap' = 'lnsXY', + lastRefresh?: number + ): TypedLensByValueInput['attributes'] { const query = this.globalFilter || this.layerConfigs[0].seriesConfig.query; const { internalReferences, adHocDataViews } = this.getReferences(); @@ -1238,7 +1253,7 @@ export class LensAttributes { return { title: 'Prefilled from exploratory view app', description: lastRefresh ? `Last refreshed at ${new Date(lastRefresh).toISOString()}` : '', - visualizationType: 'lnsXY', + visualizationType, references: [], state: { internalReferences, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.ts new file mode 100644 index 0000000000000..d62bd8684b48c --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.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 { FormulaPublicApi, HeatmapVisualizationState } from '@kbn/lens-plugin/public'; + +import { euiPaletteNegative } from '@elastic/eui'; +import { ColorStop } from '@kbn/coloring'; +import { LayerConfig } from '../lens_attributes'; +import { SingleMetricLensAttributes } from './single_metric_attributes'; + +export class HeatMapLensAttributes extends SingleMetricLensAttributes { + xColumnId: string; + layerId: string; + breakDownColumnId: string; + + constructor( + layerConfigs: LayerConfig[], + reportType: string, + lensFormulaHelper: FormulaPublicApi + ) { + super(layerConfigs, reportType, lensFormulaHelper); + + this.xColumnId = 'layer-0-column-x-1'; + this.breakDownColumnId = 'layer-0-breakdown-column'; + this.layerId = 'layer0'; + const layer0 = this.getSingleMetricLayer()!; + + layer0.columns[this.xColumnId] = this.getDateHistogramColumn('@timestamp'); + + let columnOrder = [this.xColumnId]; + const layerConfig = layerConfigs[0]; + + if (layerConfig.breakdown) { + columnOrder = [this.breakDownColumnId, ...columnOrder]; + layer0.columns[this.breakDownColumnId] = this.getBreakdownColumn({ + layerConfig, + sourceField: layerConfig.breakdown, + layerId: this.layerId, + alphabeticOrder: true, + }); + } + + layer0.columnOrder = [...columnOrder, ...layer0.columnOrder]; + + this.layers = { layer0 }; + + this.visualization = this.getHeatmapState(); + } + + getHeatmapState() { + const negativePalette = euiPaletteNegative(5); + const layerConfig = this.layerConfigs[0]; + + return { + shape: 'heatmap', + layerId: this.layerId, + layerType: 'data', + legend: { + isVisible: true, + position: 'right', + type: 'heatmap_legend', + }, + gridConfig: { + type: 'heatmap_grid', + isCellLabelVisible: false, + isYAxisLabelVisible: true, + isXAxisLabelVisible: true, + isYAxisTitleVisible: false, + isXAxisTitleVisible: false, + xTitle: '', + }, + valueAccessor: this.columnId, + xAccessor: this.xColumnId, + yAccessor: layerConfig.breakdown ? this.breakDownColumnId : undefined, + palette: { + type: 'palette', + name: 'negative', + params: { + name: 'negative', + continuity: 'above', + reverse: false, + stops: negativePalette.map((nColor, ind) => ({ + color: nColor, + stop: ind === 0 ? 1 : ind * 20, + })) as ColorStop[], + rangeMin: 0, + }, + accessor: this.columnId, + }, + } as HeatmapVisualizationState; + } +} diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts index cec2617feacf0..7897b691e6fc8 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts @@ -57,9 +57,9 @@ describe('SingleMetricAttributes', () => { }); it('returns attributes as expected', () => { - const jsonAttr = lnsAttr.getJSON(); + const jsonAttr = lnsAttr.getJSON('lnsLegacyMetric'); expect(jsonAttr).toEqual({ - description: 'undefined', + description: '', references: [], state: { adHocDataViews: { [mockDataView.title]: mockDataView.toSpec(false) }, @@ -88,6 +88,9 @@ describe('SingleMetricAttributes', () => { operationType: 'median', scale: 'ratio', sourceField: 'transaction.duration.us', + params: { + emptyAsNull: true, + }, }, }, incompleteColumns: {}, @@ -121,9 +124,9 @@ describe('SingleMetricAttributes', () => { formulaHelper ); - const jsonAttr = lnsAttr.getJSON(); + const jsonAttr = lnsAttr.getJSON('lnsLegacyMetric'); expect(jsonAttr).toEqual({ - description: 'undefined', + description: '', references: [], state: { adHocDataViews: { [mockDataView.title]: mockDataView.toSpec(false) }, @@ -206,7 +209,7 @@ describe('SingleMetricAttributes', () => { formulaHelper ); - const jsonAttr = lnsAttr.getJSON(); + const jsonAttr = lnsAttr.getJSON('lnsLegacyMetric'); expect(jsonAttr).toEqual(sampleMetricFormulaAttribute); }); }); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts index 1a7fe32d6c40a..b1bf0782e0d2e 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts @@ -5,12 +5,7 @@ * 2.0. */ -import { - FormulaPublicApi, - MetricState, - OperationType, - TypedLensByValueInput, -} from '@kbn/lens-plugin/public'; +import { FormulaPublicApi, MetricState, OperationType } from '@kbn/lens-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/common'; @@ -44,7 +39,12 @@ export class SingleMetricLensAttributes extends LensAttributes { this.columnId = 'layer-0-column-1'; this.globalFilter = this.getGlobalFilter(this.isMultiSeries); - this.layers = this.getSingleMetricLayer()!; + const layer0 = this.getSingleMetricLayer()!; + + this.layers = { + layer0, + }; + this.visualization = this.getMetricState(); } getSingleMetricLayer() { @@ -100,18 +100,19 @@ export class SingleMetricLensAttributes extends LensAttributes { } return { - layer0: { - columns: { - [this.columnId]: { - ...buildNumberColumn(sourceField), - label: columnLabel ?? '', - operationType: sourceField === RECORDS_FIELD ? 'count' : operationType || 'median', - filter: columnFilter, + columns: { + [this.columnId]: { + ...buildNumberColumn(sourceField), + label: columnLabel ?? '', + operationType: sourceField === RECORDS_FIELD ? 'count' : operationType || 'median', + filter: columnFilter, + params: { + emptyAsNull: true, }, }, - columnOrder: [this.columnId], - incompleteColumns: {}, }, + columnOrder: [this.columnId], + incompleteColumns: {}, }; } } @@ -149,9 +150,7 @@ export class SingleMetricLensAttributes extends LensAttributes { dataView ); - return { - layer0: layer!, - }; + return layer!; } getPercentileLayer({ @@ -168,17 +167,15 @@ export class SingleMetricLensAttributes extends LensAttributes { columnFilter?: ColumnFilter; }) { return { - layer0: { - columns: { - [this.columnId]: { - ...this.getPercentileNumberColumn(sourceField, operationType!, seriesConfig), - label: columnLabel ?? '', - filter: columnFilter, - }, + columns: { + [this.columnId]: { + ...this.getPercentileNumberColumn(sourceField, operationType!, seriesConfig), + label: columnLabel ?? '', + filter: columnFilter, }, - columnOrder: [this.columnId], - incompleteColumns: {}, }, + columnOrder: [this.columnId], + incompleteColumns: {}, }; } @@ -191,31 +188,4 @@ export class SingleMetricLensAttributes extends LensAttributes { size: 's', }; } - - getJSON(refresh?: number): TypedLensByValueInput['attributes'] { - const query = this.globalFilter || this.layerConfigs[0].seriesConfig.query; - - const visualization = this.getMetricState(); - - const { internalReferences, adHocDataViews } = this.getReferences(); - - return { - title: 'Prefilled from exploratory view app', - description: String(refresh), - visualizationType: 'lnsLegacyMetric', - references: [], - state: { - internalReferences, - adHocDataViews, - visualization, - datasourceStates: { - formBased: { - layers: this.layers, - }, - }, - query: query || { query: '', language: 'kuery' }, - filters: [], - }, - }; - } } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.ts new file mode 100644 index 0000000000000..1c41aaa8d4db9 --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.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 { ConfigProps, SeriesConfig } from '../../types'; +import { FieldLabels, RECORDS_FIELD, REPORT_METRIC_FIELD, ReportTypes } from '../constants'; +import { DOWN_LABEL, UP_LABEL } from '../constants/labels'; +import { SYNTHETICS_STEP_NAME } from '../constants/field_names/synthetics'; +import { buildExistsFilter } from '../utils'; + +const SUMMARY_UP = 'summary.up'; +const SUMMARY_DOWN = 'summary.down'; + +export function getSyntheticsHeatmapConfig({ dataView }: ConfigProps): SeriesConfig { + return { + reportType: ReportTypes.HEATMAP, + defaultSeriesType: 'bar_stacked', + seriesTypes: [], + xAxisColumn: { + sourceField: '@timestamp', + }, + yAxisColumns: [ + { + sourceField: REPORT_METRIC_FIELD, + operationType: 'median', + }, + ], + hasOperationType: false, + filterFields: ['observer.geo.name', 'monitor.type', 'tags', 'url.full'], + breakdownFields: ['observer.geo.name', 'monitor.type', 'monitor.name', SYNTHETICS_STEP_NAME], + baseFilters: [], + definitionFields: [ + { field: 'monitor.name' }, + { field: 'url.full', filters: buildExistsFilter('summary.up', dataView) }, + ], + metricOptions: [ + { + label: 'Failed tests', + id: 'failed_tests', + columnFilter: { language: 'kuery', query: 'summary.down > 0' }, + format: 'number', + field: RECORDS_FIELD, + }, + ], + labels: { ...FieldLabels, [SUMMARY_UP]: UP_LABEL, [SUMMARY_DOWN]: DOWN_LABEL }, + }; +} diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts index d87517e761342..e012f04e28ad5 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts @@ -38,7 +38,7 @@ export const sampleAttributeCoreWebVital = { 'x-axis-column-layer0': { dataType: 'string', isBucketed: true, - label: 'Top values of Operating system', + label: 'Operating system', operationType: 'terms', params: { missingBucket: false, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts index 1a3ef129fa94f..d1f63100ecbe8 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts @@ -8,7 +8,7 @@ import { mockDataView } from '../../rtl_helpers'; export const sampleMetricFormulaAttribute = { - description: 'undefined', + description: '', references: [], state: { adHocDataViews: { [mockDataView.title]: mockDataView.toSpec(false) }, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx index f4c438b693d48..04fec072229d7 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx @@ -16,6 +16,7 @@ import { XYState, } from '@kbn/lens-plugin/public'; import { ViewMode } from '@kbn/embeddable-plugin/common'; +import { HeatMapLensAttributes } from '../configurations/lens_attributes/heatmap_attributes'; import { SingleMetricLensAttributes } from '../configurations/lens_attributes/single_metric_attributes'; import { AllSeries, ReportTypes, useTheme } from '../../../..'; import { LayerConfig, LensAttributes } from '../configurations/lens_attributes'; @@ -106,17 +107,44 @@ export default function Embeddable({ ); let lensAttributes; - try { - if (reportType === ReportTypes.SINGLE_METRIC) { - lensAttributes = new SingleMetricLensAttributes(layerConfigs, reportType, lensFormulaHelper!); - } else { - lensAttributes = new LensAttributes(layerConfigs, reportType, lensFormulaHelper); - } - // eslint-disable-next-line no-empty - } catch (error) {} + let attributesJSON = customLensAttrs; + if (!customLensAttrs) { + try { + if (reportType === ReportTypes.SINGLE_METRIC) { + lensAttributes = new SingleMetricLensAttributes( + layerConfigs, + reportType, + lensFormulaHelper! + ); + attributesJSON = lensAttributes?.getJSON('lnsLegacyMetric'); + } else if (reportType === ReportTypes.HEATMAP) { + lensAttributes = new HeatMapLensAttributes(layerConfigs, reportType, lensFormulaHelper!); + attributesJSON = lensAttributes?.getJSON('lnsHeatmap'); + } else { + lensAttributes = new LensAttributes(layerConfigs, reportType, lensFormulaHelper); + attributesJSON = lensAttributes?.getJSON(); + } + // eslint-disable-next-line no-empty + } catch (error) {} + } - const attributesJSON = customLensAttrs ?? lensAttributes?.getJSON(); const timeRange = customTimeRange ?? series?.time; + + const actions = useActions({ + withActions, + attributes, + reportType, + appId, + setIsSaveOpen, + setAddToCaseOpen, + lensAttributes: attributesJSON, + timeRange, + }); + + if (!attributesJSON) { + return null; + } + if (typeof axisTitlesVisibility !== 'undefined') { (attributesJSON.state.visualization as XYState).axisTitlesVisibilitySettings = axisTitlesVisibility; @@ -137,17 +165,6 @@ export default function Embeddable({ }; } - const actions = useActions({ - withActions, - attributes, - reportType, - appId, - setIsSaveOpen, - setAddToCaseOpen, - lensAttributes: attributesJSON, - timeRange, - }); - if (!attributesJSON && layerConfigs.length < 1) { return null; } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts index 1f1997d394846..e65da38494843 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts @@ -9,6 +9,7 @@ import { useMemo } from 'react'; import { isEmpty } from 'lodash'; import { TypedLensByValueInput } from '@kbn/lens-plugin/public'; import { EuiTheme } from '@kbn/kibana-react-plugin/common'; +import { HeatMapLensAttributes } from '../configurations/lens_attributes/heatmap_attributes'; import { useLensFormulaHelper } from './use_lens_formula_helper'; import { ALL_VALUES_SELECTED } from '../configurations/constants/url_constants'; import { LayerConfig, LensAttributes } from '../configurations/lens_attributes'; @@ -130,12 +131,22 @@ export const useLensAttributes = (): TypedLensByValueInput['attributes'] | null lensFormulaHelper ); - return lensAttributes.getJSON(lastRefresh); + return lensAttributes.getJSON('lnsLegacyMetric', lastRefresh); + } + + if (reportTypeT === 'heatmap') { + const lensAttributes = new HeatMapLensAttributes( + layerConfigs, + reportTypeT, + lensFormulaHelper + ); + + return lensAttributes.getJSON('lnsHeatmap', lastRefresh); } const lensAttributes = new LensAttributes(layerConfigs, reportTypeT, lensFormulaHelper); - return lensAttributes.getJSON(lastRefresh); + return lensAttributes.getJSON('lnsXY', lastRefresh); // we also want to check the state on allSeries changes // eslint-disable-next-line react-hooks/exhaustive-deps }, [dataViews, reportType, storage, theme, lastRefresh, allSeries, lensFormulaHelper]); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx index 14d5101a561fb..77655518ac8c5 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx @@ -8,6 +8,7 @@ import * as React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiErrorBoundary } from '@elastic/eui'; +import { getSyntheticsHeatmapConfig } from './configurations/synthetics/heatmap_config'; import { getSyntheticsSingleMetricConfig } from './configurations/synthetics/single_metric_config'; import { ExploratoryViewPage } from '.'; import { ExploratoryViewContextProvider } from './contexts/exploratory_view_config'; @@ -16,6 +17,7 @@ import { AppDataType, ReportViewType } from './types'; import { CORE_WEB_VITALS_LABEL, DEVICE_DISTRIBUTION_LABEL, + HEATMAP_LABEL, KPI_OVER_TIME_LABEL, PERF_DIST_LABEL, SINGLE_METRIC_LABEL, @@ -89,6 +91,7 @@ export const reportTypesList: Array<{ { reportType: 'core-web-vitals', label: CORE_WEB_VITALS_LABEL }, { reportType: 'device-data-distribution', label: DEVICE_DISTRIBUTION_LABEL }, { reportType: 'single-metric', label: SINGLE_METRIC_LABEL }, + { reportType: 'heatmap', label: HEATMAP_LABEL }, ]; export const obsvReportConfigMap = { @@ -102,6 +105,7 @@ export const obsvReportConfigMap = { getSyntheticsKPIConfig, getSyntheticsDistributionConfig, getSyntheticsSingleMetricConfig, + getSyntheticsHeatmapConfig, ], [DataTypes.MOBILE]: [ getMobileKPIConfig, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts index dc195fc08c016..5094088b436fc 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts @@ -32,6 +32,7 @@ export const ReportViewTypes = { cwv: 'core-web-vitals', mdd: 'device-data-distribution', smt: 'single-metric', + htm: 'heatmap', } as const; type ValueOf<T> = T[keyof T]; diff --git a/x-pack/plugins/observability/public/components/shared/index.tsx b/x-pack/plugins/observability/public/components/shared/index.tsx index c8d6771cc4892..fab875ebaf078 100644 --- a/x-pack/plugins/observability/public/components/shared/index.tsx +++ b/x-pack/plugins/observability/public/components/shared/index.tsx @@ -7,6 +7,7 @@ import React, { lazy, Suspense } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; +import { LoadWhenInViewProps } from './load_when_in_view/load_when_in_view'; import type { CoreVitalProps, HeaderMenuPortalProps } from './types'; import type { FieldValueSuggestionsProps, @@ -102,3 +103,13 @@ export function DatePicker(props: DatePickerProps) { </Suspense> ); } + +const LoadWhenInViewLazy = lazy(() => import('./load_when_in_view/load_when_in_view')); + +export function LoadWhenInView(props: LoadWhenInViewProps) { + return ( + <Suspense fallback={<EuiLoadingSpinner />}> + <LoadWhenInViewLazy {...props} /> + </Suspense> + ); +} diff --git a/x-pack/plugins/observability/public/components/shared/load_when_in_view/load_when_in_view.tsx b/x-pack/plugins/observability/public/components/shared/load_when_in_view/load_when_in_view.tsx new file mode 100644 index 0000000000000..16cb8c35b34a6 --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/load_when_in_view/load_when_in_view.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, { useEffect, useState } from 'react'; +import { EuiLoadingContent } from '@elastic/eui'; +import useIntersection from 'react-use/lib/useIntersection'; + +export interface LoadWhenInViewProps { + children: JSX.Element; + initialHeight?: string | number; + placeholderTitle: string; +} + +// eslint-disable-next-line import/no-default-export +export default function LoadWhenInView({ + children, + placeholderTitle, + initialHeight = 100, +}: LoadWhenInViewProps) { + const intersectionRef = React.useRef(null); + const intersection = useIntersection(intersectionRef, { + root: null, + rootMargin: '0px', + threshold: 0.25, + }); + + const [isVisible, setIsVisible] = useState(false); + + useEffect(() => { + if (intersection && intersection.intersectionRatio > 0.25) { + setIsVisible(true); + } + }, [intersection, intersection?.intersectionRatio]); + + return isVisible ? ( + children + ) : ( + <div + data-test-subj="renderOnlyInViewPlaceholderContainer" + ref={intersectionRef} + role="region" + aria-label={placeholderTitle} + style={{ height: initialHeight }} + > + <EuiLoadingContent /> + </div> + ); +} diff --git a/x-pack/plugins/observability/public/config/translations.ts b/x-pack/plugins/observability/public/config/translations.ts index e39dcb338d3a5..042650b94c084 100644 --- a/x-pack/plugins/observability/public/config/translations.ts +++ b/x-pack/plugins/observability/public/config/translations.ts @@ -122,9 +122,4 @@ export const translations = { } ), }, - alertsSearchBar: { - placeholder: i18n.translate('xpack.observability.alerts.searchBarPlaceholder', { - defaultMessage: 'Search alerts (e.g. kibana.alert.evaluation.threshold > 75)', - }), - }, }; diff --git a/x-pack/plugins/observability/public/hooks/use_chart_theme.tsx b/x-pack/plugins/observability/public/hooks/use_chart_theme.tsx index 42ff021679ce0..6b11566b6e5a7 100644 --- a/x-pack/plugins/observability/public/hooks/use_chart_theme.tsx +++ b/x-pack/plugins/observability/public/hooks/use_chart_theme.tsx @@ -7,6 +7,7 @@ import { PartialTheme } from '@elastic/charts'; import { EUI_CHARTS_THEME_DARK, EUI_CHARTS_THEME_LIGHT } from '@elastic/eui/dist/eui_charts_theme'; +import { useMemo } from 'react'; import { useTheme } from './use_theme'; export function useChartTheme(): PartialTheme[] { @@ -15,24 +16,27 @@ export function useChartTheme(): PartialTheme[] { ? EUI_CHARTS_THEME_DARK.theme : EUI_CHARTS_THEME_LIGHT.theme; - return [ - { - chartMargins: { - left: 10, - right: 10, - top: 10, - bottom: 10, + return useMemo( + () => [ + { + chartMargins: { + left: 10, + right: 10, + top: 10, + bottom: 10, + }, + background: { + color: 'transparent', + }, + lineSeriesStyle: { + point: { visible: false }, + }, + areaSeriesStyle: { + point: { visible: false }, + }, }, - background: { - color: 'transparent', - }, - lineSeriesStyle: { - point: { visible: false }, - }, - areaSeriesStyle: { - point: { visible: false }, - }, - }, - baseChartTheme, - ]; + baseChartTheme, + ], + [baseChartTheme] + ); } diff --git a/x-pack/plugins/observability/public/index.ts b/x-pack/plugins/observability/public/index.ts index 9bc1eb7f2a172..dcd7a1cd08c93 100644 --- a/x-pack/plugins/observability/public/index.ts +++ b/x-pack/plugins/observability/public/index.ts @@ -27,7 +27,6 @@ export type { export { enableInspectEsQueries, enableComparisonByDefault, - enableServiceGroups, enableNewSyntheticsView, apmServiceGroupMaxNumberOfServices, enableInfrastructureHostsView, @@ -56,6 +55,7 @@ export { SelectableUrlList, ExploratoryView, DatePicker, + LoadWhenInView, } from './components/shared'; export type { LazyObservabilityPageTemplateProps } from './components/shared'; diff --git a/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout_body.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout_body.tsx index 9a8b97df31939..56daa3a4f8f9b 100644 --- a/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout_body.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout_body.tsx @@ -26,7 +26,7 @@ import { } from '@kbn/rule-data-utils'; import moment from 'moment-timezone'; import { useKibana, useUiSetting } from '@kbn/kibana-react-plugin/public'; -import { RULE_DETAILS_PAGE_ID } from '../../../rule_details/types'; +import { RULE_DETAILS_PAGE_ID } from '../../../rule_details/constants'; import { asDuration } from '../../../../../common/utils/formatters'; import { translations, paths } from '../../../../config'; import { AlertStatusIndicator } from '../../../../components/shared/alert_status_indicator'; diff --git a/x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx index 2cc05ba47ec00..e69de29bb2d1d 100644 --- a/x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx @@ -1,58 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useMemo, useState } from 'react'; -import { TimeHistory } from '@kbn/data-plugin/public'; -import { SearchBar } from '@kbn/unified-search-plugin/public'; -import { Storage } from '@kbn/kibana-utils-plugin/public'; -import type { ValidFeatureId } from '@kbn/rule-data-utils'; -import { translations } from '../../../config'; -import { useAlertDataView } from '../../../hooks/use_alert_data_view'; - -type QueryLanguageType = 'lucene' | 'kuery'; - -export function AlertsSearchBar({ - featureIds, - onQueryChange, - query, - rangeFrom, - rangeTo, -}: { - featureIds: ValidFeatureId[]; - rangeFrom?: string; - rangeTo?: string; - query?: string; - onQueryChange: ({}: { - dateRange: { from: string; to: string; mode?: 'absolute' | 'relative' }; - query?: string; - }) => void; -}) { - const timeHistory = useMemo(() => { - return new TimeHistory(new Storage(localStorage)); - }, []); - const [queryLanguage, setQueryLanguage] = useState<QueryLanguageType>('kuery'); - const { value: dataView, loading, error } = useAlertDataView(featureIds); - - return ( - <SearchBar - indexPatterns={loading || error ? [] : [dataView!]} - placeholder={translations.alertsSearchBar.placeholder} - query={{ query: query ?? '', language: queryLanguage }} - timeHistory={timeHistory} - dateRangeFrom={rangeFrom} - dateRangeTo={rangeTo} - onQuerySubmit={({ dateRange, query: nextQuery }) => { - onQueryChange({ - dateRange, - query: typeof nextQuery?.query === 'string' ? nextQuery.query : '', - }); - setQueryLanguage((nextQuery?.language ?? 'kuery') as QueryLanguageType); - }} - displayStyle="inPage" - /> - ); -} diff --git a/x-pack/plugins/observability/public/pages/alerts/components/alerts_status_filter.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_status_filter.tsx deleted file mode 100644 index 4b64a413b504f..0000000000000 --- a/x-pack/plugins/observability/public/pages/alerts/components/alerts_status_filter.tsx +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiButtonGroup, EuiButtonGroupOptionProps } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React from 'react'; -import { ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED, ALERT_STATUS } from '@kbn/rule-data-utils'; -import { AlertStatusFilterButton } from '../../../../common/typings'; -import { AlertStatusFilter } from '../../../../common/typings'; - -export interface AlertStatusFilterProps { - status: AlertStatusFilterButton; - onChange: (id: string, value: string) => void; -} - -export const ALL_ALERTS: AlertStatusFilter = { - status: '', - query: '', - label: i18n.translate('xpack.observability.alerts.alertStatusFilter.showAll', { - defaultMessage: 'Show all', - }), -}; - -export const ACTIVE_ALERTS: AlertStatusFilter = { - status: ALERT_STATUS_ACTIVE, - query: `${ALERT_STATUS}: "${ALERT_STATUS_ACTIVE}"`, - label: i18n.translate('xpack.observability.alerts.alertStatusFilter.active', { - defaultMessage: 'Active', - }), -}; - -export const RECOVERED_ALERTS: AlertStatusFilter = { - status: ALERT_STATUS_RECOVERED, - query: `${ALERT_STATUS}: "${ALERT_STATUS_RECOVERED}"`, - label: i18n.translate('xpack.observability.alerts.alertStatusFilter.recovered', { - defaultMessage: 'Recovered', - }), -}; - -const options: EuiButtonGroupOptionProps[] = [ - { - id: ALL_ALERTS.status, - label: ALL_ALERTS.label, - value: ALL_ALERTS.query, - 'data-test-subj': 'alert-status-filter-show-all-button', - }, - { - id: ACTIVE_ALERTS.status, - label: ACTIVE_ALERTS.label, - value: ACTIVE_ALERTS.query, - 'data-test-subj': 'alert-status-filter-active-button', - }, - { - id: RECOVERED_ALERTS.status, - label: RECOVERED_ALERTS.label, - value: RECOVERED_ALERTS.query, - 'data-test-subj': 'alert-status-filter-recovered-button', - }, -]; - -export function AlertsStatusFilter({ status, onChange }: AlertStatusFilterProps) { - return ( - <EuiButtonGroup - legend="Filter by" - color="primary" - options={options} - idSelected={status} - onChange={onChange} - /> - ); -} diff --git a/x-pack/plugins/observability/public/pages/alerts/components/index.ts b/x-pack/plugins/observability/public/pages/alerts/components/index.ts index 592ab16ddcadf..1955514d6c7b0 100644 --- a/x-pack/plugins/observability/public/pages/alerts/components/index.ts +++ b/x-pack/plugins/observability/public/pages/alerts/components/index.ts @@ -9,7 +9,5 @@ export * from './alerts_flyout'; export * from './render_cell_value'; export * from './severity_badge'; export * from './workflow_status_filter'; -export * from './alerts_search_bar'; export * from './filter_for_value'; export * from './parse_alert'; -export * from './alerts_status_filter'; diff --git a/x-pack/plugins/observability/public/pages/alerts/components/observability_actions.tsx b/x-pack/plugins/observability/public/pages/alerts/components/observability_actions.tsx index 0583b9a35eb64..b90955dbe93f0 100644 --- a/x-pack/plugins/observability/public/pages/alerts/components/observability_actions.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/observability_actions.tsx @@ -26,7 +26,7 @@ import { parseAlert } from './parse_alert'; import { translations, paths } from '../../../config'; import { ADD_TO_EXISTING_CASE, ADD_TO_NEW_CASE } from '../containers/alerts_table/translations'; import { ObservabilityAppServices } from '../../../application/types'; -import { RULE_DETAILS_PAGE_ID } from '../../rule_details/types'; +import { RULE_DETAILS_PAGE_ID } from '../../rule_details/constants'; import type { TopAlert } from '../containers/alerts_page/types'; import { ObservabilityRuleTypeRegistry } from '../../..'; import { ALERT_DETAILS_PAGE_ID } from '../../alert_details/types'; diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx index 10b0f37a2a8df..7480726177293 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx @@ -7,57 +7,35 @@ import { EuiFlexGroup, EuiFlexItem, EuiFlyoutSize } from '@elastic/eui'; -import React, { useCallback, useEffect, useState } from 'react'; +import React, { useEffect, useState } from 'react'; +import { BoolQuery } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { loadRuleAggregations } from '@kbn/triggers-actions-ui-plugin/public'; -import { AlertConsumers, AlertStatus } from '@kbn/rule-data-utils'; +import { AlertConsumers } from '@kbn/rule-data-utils'; +import { ObservabilityAlertSearchbarWithUrlSync } from '../../../../components/shared/alert_search_bar'; import { observabilityAlertFeatureIds } from '../../../../config'; -import { AlertStatusFilterButton } from '../../../../../common/typings'; import { useGetUserCasesPermissions } from '../../../../hooks/use_get_user_cases_permissions'; import { observabilityFeatureId } from '../../../../../common'; import { useBreadcrumbs } from '../../../../hooks/use_breadcrumbs'; import { useHasData } from '../../../../hooks/use_has_data'; import { usePluginContext } from '../../../../hooks/use_plugin_context'; import { getNoDataConfig } from '../../../../utils/no_data_config'; -import { buildEsQuery } from '../../../../utils/build_es_query'; import { LoadingObservability } from '../../../overview'; -import { - Provider, - alertsPageStateContainer, - useAlertsPageStateContainer, -} from '../state_container'; import './styles.scss'; -import { AlertsStatusFilter, AlertsSearchBar, ALL_ALERTS } from '../../components'; import { renderRuleStats } from '../../components/rule_stats'; import { ObservabilityAppServices } from '../../../../application/types'; -import { - ALERT_STATUS_REGEX, - ALERTS_PER_PAGE, - ALERTS_TABLE_ID, - BASE_ALERT_REGEX, -} from './constants'; +import { ALERTS_PER_PAGE, ALERTS_SEARCH_BAR_ID, ALERTS_TABLE_ID } from './constants'; import { RuleStatsState } from './types'; -function AlertsPage() { +export function AlertsPage() { const { ObservabilityPageTemplate, observabilityRuleTypeRegistry } = usePluginContext(); - const [alertFilterStatus, setAlertFilterStatus] = useState( - ALL_ALERTS.query as AlertStatusFilterButton - ); - const [refreshNow, setRefreshNow] = useState<number>(); - const { rangeFrom, setRangeFrom, rangeTo, setRangeTo, kuery, setKuery } = - useAlertsPageStateContainer(); const { cases, docLinks, http, notifications: { toasts }, triggersActionsUi: { alertsTableConfigurationRegistry, getAlertsStateTable: AlertsStateTable }, - data: { - query: { - timefilter: { timefilter: timeFilterService }, - }, - }, } = useKibana<ObservabilityAppServices>().services; const [ruleStatsLoading, setRuleStatsLoading] = useState<boolean>(false); @@ -68,10 +46,8 @@ function AlertsPage() { error: 0, snoozed: 0, }); - - useEffect(() => { - syncAlertStatusFilterStatus(kuery as string); - }, [kuery]); + const { hasAnyData, isAllRequestsComplete } = useHasData(); + const [esQuery, setEsQuery] = useState<{ bool: BoolQuery }>(); useBreadcrumbs([ { @@ -123,57 +99,6 @@ function AlertsPage() { const manageRulesHref = http.basePath.prepend('/app/observability/alerts/rules'); - const onRefresh = () => { - setRefreshNow(new Date().getTime()); - }; - - const onQueryChange = useCallback( - ({ dateRange, query }) => { - if (rangeFrom === dateRange.from && rangeTo === dateRange.to && kuery === (query ?? '')) { - return onRefresh(); - } - timeFilterService.setTime(dateRange); - setRangeFrom(dateRange.from); - setRangeTo(dateRange.to); - setKuery(query); - syncAlertStatusFilterStatus(query as string); - }, - [rangeFrom, setRangeFrom, rangeTo, setRangeTo, kuery, setKuery, timeFilterService] - ); - - const syncAlertStatusFilterStatus = (query: string) => { - const [, alertStatus] = BASE_ALERT_REGEX.exec(query) || []; - if (!alertStatus) { - setAlertFilterStatus(''); - return; - } - setAlertFilterStatus(alertStatus.toLowerCase() as AlertStatus); - }; - const setAlertStatusFilter = useCallback( - (id: string, query: string) => { - setAlertFilterStatus(id as AlertStatusFilterButton); - // Updating the KQL query bar alongside with user inputs is tricky. - // To avoid issue, this function always remove the AlertFilter and add it - // at the end of the query, each time the filter is added/updated/removed (Show All) - // NOTE: This (query appending) will be changed entirely: https://github.com/elastic/kibana/issues/116135 - let output; - if (kuery === '') { - output = query; - } else { - const queryWithoutAlertFilter = kuery.replace(ALERT_STATUS_REGEX, ''); - output = `${queryWithoutAlertFilter} and ${query}`; - } - onQueryChange({ - dateRange: { from: rangeFrom, to: rangeTo }, - // Clean up the kuery from unwanted trailing/ahead ANDs after appending and removing filters. - query: output.replace(/^\s*and\s*|\s*and\s*$/gm, ''), - }); - }, - [kuery, onQueryChange, rangeFrom, rangeTo] - ); - - const { hasAnyData, isAllRequestsComplete } = useHasData(); - // If there is any data, set hasData to true otherwise we need to wait till all the data is loaded before setting hasData to true or false; undefined indicates the data is still loading. const hasData = hasAnyData === true || (isAllRequestsComplete === false ? undefined : false); @@ -204,57 +129,33 @@ function AlertsPage() { > <EuiFlexGroup direction="column" gutterSize="s"> <EuiFlexItem> - <AlertsSearchBar - featureIds={observabilityAlertFeatureIds} - rangeFrom={rangeFrom} - rangeTo={rangeTo} - query={kuery} - onQueryChange={onQueryChange} + <ObservabilityAlertSearchbarWithUrlSync + appName={ALERTS_SEARCH_BAR_ID} + setEsQuery={setEsQuery} /> </EuiFlexItem> - <EuiFlexItem> - <EuiFlexGroup justifyContent="spaceBetween" alignItems="center"> - <EuiFlexItem grow={false}> - <AlertsStatusFilter status={alertFilterStatus} onChange={setAlertStatusFilter} /> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - <EuiFlexItem> <CasesContext owner={[observabilityFeatureId]} permissions={userCasesPermissions} features={{ alerts: { sync: false } }} > - <AlertsStateTable - alertsTableConfigurationRegistry={alertsTableConfigurationRegistry} - configurationId={AlertConsumers.OBSERVABILITY} - id={ALERTS_TABLE_ID} - flyoutSize={'s' as EuiFlyoutSize} - featureIds={observabilityAlertFeatureIds} - query={buildEsQuery( - { - to: rangeTo, - from: rangeFrom, - }, - kuery - )} - showExpandToDetails={false} - pageSize={ALERTS_PER_PAGE} - refreshNow={refreshNow} - /> + {esQuery && ( + <AlertsStateTable + alertsTableConfigurationRegistry={alertsTableConfigurationRegistry} + configurationId={AlertConsumers.OBSERVABILITY} + id={ALERTS_TABLE_ID} + flyoutSize={'s' as EuiFlyoutSize} + featureIds={observabilityAlertFeatureIds} + query={esQuery} + showExpandToDetails={false} + pageSize={ALERTS_PER_PAGE} + /> + )} </CasesContext> </EuiFlexItem> </EuiFlexGroup> </ObservabilityPageTemplate> ); } - -export function WrappedAlertsPage() { - return ( - <Provider value={alertsPageStateContainer}> - <AlertsPage /> - </Provider> - ); -} diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/constants.ts b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/constants.ts index 83b059b04f5e3..31113bd8221e0 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/constants.ts +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/constants.ts @@ -5,21 +5,7 @@ * 2.0. */ -import { DataViewBase } from '@kbn/es-query'; -import { ALERT_STATUS } from '@kbn/rule-data-utils'; - export const ALERTS_PAGE_ID = 'alerts-o11y'; +export const ALERTS_SEARCH_BAR_ID = 'alerts-search-bar-o11y'; export const ALERTS_PER_PAGE = 50; export const ALERTS_TABLE_ID = 'xpack.observability.alerts.alert.table'; - -const regExpEscape = (str: string) => str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); -export const NO_INDEX_PATTERNS: DataViewBase[] = []; -export const BASE_ALERT_REGEX = new RegExp( - `\\s*${regExpEscape(ALERT_STATUS)}\\s*:\\s*"(.*?|\\*?)"` -); -export const ALERT_STATUS_REGEX = new RegExp( - `\\s*and\\s*${regExpEscape(ALERT_STATUS)}\\s*:\\s*(".+?"|\\*?)|${regExpEscape( - ALERT_STATUS - )}\\s*:\\s*(".+?"|\\*?)`, - 'gm' -); diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/index.ts b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/index.ts index 0be17d63b7291..8f9b6c26b5427 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/index.ts +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/index.ts @@ -5,5 +5,5 @@ * 2.0. */ -export { WrappedAlertsPage as AlertsPage } from './alerts_page'; +export { AlertsPage } from './alerts_page'; export type { TopAlert } from './types'; diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/index.ts b/x-pack/plugins/observability/public/pages/alerts/containers/index.ts index 23b65105b7881..957a0dbdb906d 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/index.ts +++ b/x-pack/plugins/observability/public/pages/alerts/containers/index.ts @@ -6,4 +6,3 @@ */ export * from './alerts_page'; -export * from './state_container'; diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/state_container/index.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/index.tsx deleted file mode 100644 index c057ec901686e..0000000000000 --- a/x-pack/plugins/observability/public/pages/alerts/containers/state_container/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { Provider, alertsPageStateContainer } from './state_container'; -export { useAlertsPageStateContainer } from './use_alerts_page_state_container'; diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/state_container/use_alerts_page_state_container.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/use_alerts_page_state_container.tsx deleted file mode 100644 index 0b9fb864b098e..0000000000000 --- a/x-pack/plugins/observability/public/pages/alerts/containers/state_container/use_alerts_page_state_container.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 { useEffect } from 'react'; -import { useHistory } from 'react-router-dom'; - -import { TimefilterContract } from '@kbn/data-plugin/public'; -import { - createKbnUrlStateStorage, - syncState, - IKbnUrlStateStorage, - useContainerSelector, -} from '@kbn/kibana-utils-plugin/public'; -import { useTimefilterService } from '../../../../hooks/use_timefilter_service'; - -import { - useContainer, - defaultState, - AlertsPageStateContainer, - AlertsPageContainerState, -} from './state_container'; - -export function useAlertsPageStateContainer() { - const stateContainer = useContainer(); - - useUrlStateSyncEffect(stateContainer); - - const { setRangeFrom, setRangeTo, setKuery } = stateContainer.transitions; - const { rangeFrom, rangeTo, kuery } = useContainerSelector(stateContainer, (state) => state); - - return { - rangeFrom, - setRangeFrom, - rangeTo, - setRangeTo, - kuery, - setKuery, - }; -} - -function useUrlStateSyncEffect(stateContainer: AlertsPageStateContainer) { - const history = useHistory(); - const timefilterService = useTimefilterService(); - - useEffect(() => { - const urlStateStorage = createKbnUrlStateStorage({ - history, - useHash: false, - useHashQuery: false, - }); - const { start, stop } = setupUrlStateSync(stateContainer, urlStateStorage); - - start(); - - syncUrlStateWithInitialContainerState(timefilterService, stateContainer, urlStateStorage); - - return stop; - }, [stateContainer, history, timefilterService]); -} - -function setupUrlStateSync( - stateContainer: AlertsPageStateContainer, - stateStorage: IKbnUrlStateStorage -) { - // This handles filling the state when an incomplete URL set is provided - const setWithDefaults = (changedState: Partial<AlertsPageContainerState> | null) => { - stateContainer.set({ ...defaultState, ...changedState }); - }; - - return syncState({ - storageKey: '_a', - stateContainer: { - ...stateContainer, - set: setWithDefaults, - }, - stateStorage, - }); -} - -function syncUrlStateWithInitialContainerState( - timefilterService: TimefilterContract, - stateContainer: AlertsPageStateContainer, - urlStateStorage: IKbnUrlStateStorage -) { - const urlState = urlStateStorage.get<Partial<AlertsPageContainerState>>('_a'); - - if (urlState) { - const newState = { - ...defaultState, - ...urlState, - }; - - stateContainer.set(newState); - } else if (timefilterService.isTimeTouched()) { - const { from, to } = timefilterService.getTime(); - const newState = { - ...defaultState, - rangeFrom: from, - rangeTo: to, - }; - - stateContainer.set(newState); - } else { - // Reset the state container when no URL state or timefilter range is set to avoid accidentally - // re-using state set on a previous visit to the page in the same session - stateContainer.set(defaultState); - } - - urlStateStorage.set('_a', stateContainer.get()); -} diff --git a/x-pack/plugins/observability/public/pages/overview/containers/overview_page/overview_page.tsx b/x-pack/plugins/observability/public/pages/overview/containers/overview_page/overview_page.tsx index 16ccd0e1fdc06..d0420f07b573f 100644 --- a/x-pack/plugins/observability/public/pages/overview/containers/overview_page/overview_page.tsx +++ b/x-pack/plugins/observability/public/pages/overview/containers/overview_page/overview_page.tsx @@ -20,6 +20,7 @@ import { EuiTitle, EuiTourStep, } from '@elastic/eui'; +import { BoolQuery } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; @@ -66,7 +67,6 @@ export function OverviewPage() { }, ]); const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); - const [refreshNow, setRefreshNow] = useState<number>(); const { cases, @@ -77,6 +77,12 @@ export function OverviewPage() { const { ObservabilityPageTemplate } = usePluginContext(); const { relativeStart, relativeEnd, absoluteStart, absoluteEnd } = useDatePickerContext(); + const [esQuery, setEsQuery] = useState<{ bool: BoolQuery }>( + buildEsQuery({ + from: relativeStart, + to: relativeEnd, + }) + ); const { data: newsFeed } = useFetcher(() => getNewsFeed({ http }), [http]); @@ -105,9 +111,14 @@ export function OverviewPage() { }, [trackMetric, isGuidedSetupProgressDismissed, hideGuidedSetupTour]); const onTimeRangeRefresh = useCallback(() => { - setRefreshNow(new Date().getTime()); + setEsQuery( + buildEsQuery({ + from: relativeStart, + to: relativeEnd, + }) + ); return refetch.current && refetch.current(); - }, []); + }, [relativeEnd, relativeStart]); const CasesContext = cases.ui.getCasesContext(); const userCasesPermissions = useGetUserCasesPermissions(); @@ -183,13 +194,9 @@ export function OverviewPage() { AlertConsumers.LOGS, AlertConsumers.UPTIME, ]} - query={buildEsQuery({ - from: relativeStart, - to: relativeEnd, - })} + query={esQuery} showExpandToDetails={false} pageSize={ALERTS_PER_PAGE} - refreshNow={refreshNow} /> </CasesContext> </SectionContainer> diff --git a/x-pack/plugins/observability/public/pages/rule_details/constants.ts b/x-pack/plugins/observability/public/pages/rule_details/constants.ts new file mode 100644 index 0000000000000..f204749427f8c --- /dev/null +++ b/x-pack/plugins/observability/public/pages/rule_details/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 EXECUTION_TAB = 'execution'; +export const ALERTS_TAB = 'alerts'; +export const EVENT_ERROR_LOG_TAB = 'rule_error_log_list'; +export const RULE_DETAILS_PAGE_ID = 'rule-details-alerts-o11y'; +export const RULE_DETAILS_ALERTS_SEARCH_BAR_ID = 'rule-details-alerts-search-bar-o11y'; diff --git a/x-pack/plugins/observability/public/pages/rule_details/index.tsx b/x-pack/plugins/observability/public/pages/rule_details/index.tsx index 27bbc1fc0f4a0..4acf760eb9443 100644 --- a/x-pack/plugins/observability/public/pages/rule_details/index.tsx +++ b/x-pack/plugins/observability/public/pages/rule_details/index.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react'; -import { useParams } from 'react-router-dom'; +import { useHistory, useParams, useLocation } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; import { EuiText, @@ -14,13 +14,14 @@ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, - EuiFlyoutSize, EuiPanel, EuiPopover, EuiTabbedContent, EuiEmptyPrompt, EuiSuperSelectOption, EuiButton, + EuiFlyoutSize, + EuiTabbedContentTab, } from '@elastic/eui'; import { @@ -32,17 +33,21 @@ import { } from '@kbn/triggers-actions-ui-plugin/public'; // TODO: use a Delete modal from triggersActionUI when it's sharable import { ALERTS_FEATURE_ID, RuleExecutionStatusErrorReasons } from '@kbn/alerting-plugin/common'; +import { Query, BoolQuery } from '@kbn/es-query'; import { AlertConsumers } from '@kbn/rule-data-utils'; import { RuleDefinitionProps } from '@kbn/triggers-actions-ui-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { fromQuery, toQuery } from '../../utils/url'; +import { ObservabilityAlertSearchbarWithUrlSync } from '../../components/shared/alert_search_bar'; import { DeleteModalConfirmation } from './components/delete_modal_confirmation'; import { CenterJustifiedSpinner } from './components/center_justified_spinner'; import { - RuleDetailsPathParams, - EVENT_LOG_LIST_TAB, - ALERT_LIST_TAB, + EXECUTION_TAB, + ALERTS_TAB, RULE_DETAILS_PAGE_ID, -} from './types'; + RULE_DETAILS_ALERTS_SEARCH_BAR_ID, +} from './constants'; +import { RuleDetailsPathParams, TabId } from './types'; import { useBreadcrumbs } from '../../hooks/use_breadcrumbs'; import { usePluginContext } from '../../hooks/use_plugin_context'; import { useFetchRule } from '../../hooks/use_fetch_rule'; @@ -63,7 +68,7 @@ export function RuleDetailsPage() { ruleTypeRegistry, getEditAlertFlyout, getRuleEventLogList, - getAlertsStateTable, + getAlertsStateTable: AlertsStateTable, getRuleAlertsSummary, getRuleStatusPanel, getRuleDefinition, @@ -74,6 +79,8 @@ export function RuleDetailsPage() { const { ruleId } = useParams<RuleDetailsPathParams>(); const { ObservabilityPageTemplate, observabilityRuleTypeRegistry } = usePluginContext(); + const history = useHistory(); + const location = useLocation(); const filteredRuleTypes = useMemo( () => observabilityRuleTypeRegistry.list(), @@ -84,12 +91,34 @@ export function RuleDetailsPage() { const { ruleTypes } = useLoadRuleTypes({ filteredRuleTypes, }); + const [tabId, setTabId] = useState<TabId>( + (toQuery(location.search)?.tabId as TabId) || EXECUTION_TAB + ); const [features, setFeatures] = useState<string>(''); const [ruleType, setRuleType] = useState<RuleType<string, string>>(); const [ruleToDelete, setRuleToDelete] = useState<string[]>([]); const [isPageLoading, setIsPageLoading] = useState(false); const [editFlyoutVisible, setEditFlyoutVisible] = useState<boolean>(false); const [isRuleEditPopoverOpen, setIsRuleEditPopoverOpen] = useState(false); + const [esQuery, setEsQuery] = useState<{ bool: BoolQuery }>(); + const ruleQuery = useRef([ + { query: `kibana.alert.rule.uuid: ${ruleId}`, language: 'kuery' }, + ] as Query[]); + + function updateUrl(nextQuery: { tabId: TabId }) { + history.push({ + ...location, + search: fromQuery({ + ...toQuery(location.search), + ...nextQuery, + }), + }); + } + + function onTabIdChange(newTabId: TabId) { + setTabId(newTabId); + updateUrl({ tabId: newTabId }); + } const NOTIFY_WHEN_OPTIONS = useRef<Array<EuiSuperSelectOption<unknown>>>([]); useEffect(() => { @@ -157,40 +186,26 @@ export function RuleDetailsPage() { ? !ruleTypeRegistry.get(rule.ruleTypeId).requiresAppContext : false); - const alertStateProps = { - alertsTableConfigurationRegistry, - configurationId: observabilityFeatureId, - id: RULE_DETAILS_PAGE_ID, - flyoutSize: 's' as EuiFlyoutSize, - featureIds: [features] as AlertConsumers[], - query: { - bool: { - filter: [ - { - term: { - 'kibana.alert.rule.uuid': ruleId, - }, - }, - ], - }, - }, - showExpandToDetails: false, - }; - - const tabs = [ + const tabs: EuiTabbedContentTab[] = [ { - id: EVENT_LOG_LIST_TAB, + id: EXECUTION_TAB, name: i18n.translate('xpack.observability.ruleDetails.rule.eventLogTabText', { defaultMessage: 'Execution history', }), 'data-test-subj': 'eventLogListTab', - content: getRuleEventLogList<'default'>({ - ruleId: rule?.id, - ruleType, - } as RuleEventLogListProps), + content: ( + <EuiFlexGroup style={{ minHeight: 600 }} direction={'column'}> + <EuiFlexItem> + {getRuleEventLogList<'default'>({ + ruleId: rule?.id, + ruleType, + } as RuleEventLogListProps)} + </EuiFlexItem> + </EuiFlexGroup> + ), }, { - id: ALERT_LIST_TAB, + id: ALERTS_TAB, name: i18n.translate('xpack.observability.ruleDetails.rule.alertsTabText', { defaultMessage: 'Alerts', }), @@ -198,7 +213,27 @@ export function RuleDetailsPage() { content: ( <> <EuiSpacer size="m" /> - {getAlertsStateTable(alertStateProps)} + <ObservabilityAlertSearchbarWithUrlSync + appName={RULE_DETAILS_ALERTS_SEARCH_BAR_ID} + setEsQuery={setEsQuery} + queries={ruleQuery.current} + /> + <EuiSpacer size="s" /> + <EuiFlexGroup style={{ minHeight: 450 }} direction={'column'}> + <EuiFlexItem> + {esQuery && ( + <AlertsStateTable + alertsTableConfigurationRegistry={alertsTableConfigurationRegistry} + configurationId={observabilityFeatureId} + id={RULE_DETAILS_PAGE_ID} + flyoutSize={'s' as EuiFlyoutSize} + featureIds={[features] as AlertConsumers[]} + query={esQuery} + showExpandToDetails={false} + /> + )} + </EuiFlexItem> + </EuiFlexGroup> </> ), }, @@ -236,6 +271,8 @@ export function RuleDetailsPage() { ? ALERT_STATUS_LICENSE_ERROR : rulesStatusesTranslationsMapping[rule.executionStatus.status]; + const selectedTab = tabs.find((tab) => tab.id === tabId); + return ( <ObservabilityPageTemplate data-test-subj="ruleDetails" @@ -324,7 +361,14 @@ export function RuleDetailsPage() { </EuiFlexGroup> <EuiSpacer size="l" /> - <EuiTabbedContent data-test-subj="ruleDetailsTabbedContent" tabs={tabs} /> + <EuiTabbedContent + data-test-subj="ruleDetailsTabbedContent" + tabs={tabs} + selectedTab={selectedTab} + onTabClick={(tab) => { + onTabIdChange(tab.id as TabId); + }} + /> {editFlyoutVisible && getEditAlertFlyout({ initialRule: rule, @@ -353,3 +397,11 @@ export function RuleDetailsPage() { </ObservabilityPageTemplate> ); } + +// export function RuleDetailsPage() { +// return ( +// <Provider value={alertsPageStateContainer}> +// <InternalRuleDetailsPage /> +// </Provider> +// ); +// } diff --git a/x-pack/plugins/observability/public/pages/rule_details/types.ts b/x-pack/plugins/observability/public/pages/rule_details/types.ts index 0baaf78ce756b..ead002266e53e 100644 --- a/x-pack/plugins/observability/public/pages/rule_details/types.ts +++ b/x-pack/plugins/observability/public/pages/rule_details/types.ts @@ -6,12 +6,10 @@ */ import { HttpSetup } from '@kbn/core/public'; -import { - Rule, - RuleSummary, - RuleType, - ActionTypeRegistryContract, -} from '@kbn/triggers-actions-ui-plugin/public'; +import { Rule, RuleSummary, RuleType } from '@kbn/triggers-actions-ui-plugin/public'; +import { ALERTS_TAB, EXECUTION_TAB } from './constants'; + +export type TabId = typeof ALERTS_TAB | typeof EXECUTION_TAB; export interface RuleDetailsPathParams { ruleId: string; @@ -36,15 +34,6 @@ export interface FetchRuleSummaryProps { ruleId: string; http: HttpSetup; } -export interface FetchRuleActionConnectorsProps { - http: HttpSetup; - ruleActions: any[]; -} - -export interface FetchRuleExecutionLogProps { - http: HttpSetup; - ruleId: string; -} export interface FetchRuleSummary { isLoadingRuleSummary: boolean; @@ -65,19 +54,3 @@ export interface AlertListItem { isMuted: boolean; sortPriority: number; } -export interface ItemTitleRuleSummaryProps { - children: string; -} -export interface ItemValueRuleSummaryProps { - itemValue: string; - extraSpace?: boolean; -} -export interface ActionsProps { - ruleActions: any[]; - actionTypeRegistry: ActionTypeRegistryContract; -} - -export const EVENT_LOG_LIST_TAB = 'rule_event_log_list'; -export const ALERT_LIST_TAB = 'rule_alert_list'; -export const EVENT_ERROR_LOG_TAB = 'rule_error_log_list'; -export const RULE_DETAILS_PAGE_ID = 'rule-details-alerts-o11y'; diff --git a/x-pack/plugins/observability/public/plugin.ts b/x-pack/plugins/observability/public/plugin.ts index c5152104e3bc3..ec08bbb7bd0d0 100644 --- a/x-pack/plugins/observability/public/plugin.ts +++ b/x-pack/plugins/observability/public/plugin.ts @@ -38,6 +38,7 @@ import { } from '@kbn/triggers-actions-ui-plugin/public'; import { SecurityPluginStart } from '@kbn/security-plugin/public'; import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; +import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import { observabilityAppId, observabilityFeatureId, casesPath } from '../common'; import { createLazyObservabilityPageTemplate } from './components/shared'; import { registerDataHandler } from './data_handler'; @@ -94,6 +95,7 @@ export interface ObservabilityPublicPluginsStart { actionTypeRegistry: ActionTypeRegistryContract; security: SecurityPluginStart; guidedOnboarding: GuidedOnboardingPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; } export type ObservabilityPublicStart = ReturnType<Plugin['start']>; diff --git a/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap b/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap index 8e6559830cd90..118435d5c6968 100644 --- a/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap +++ b/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap @@ -167,35 +167,3 @@ Object { } `; -exports[`buildEsQuery should generate correct es query for {"timeRange":{"from":"now-15min","to":"now"},"kuery":"kibana.alert.status: \\"recovered\\""} 1`] = ` -Object { - "bool": Object { - "filter": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match_phrase": Object { - "kibana.alert.status": "recovered", - }, - }, - ], - }, - }, - Object { - "range": Object { - "@timestamp": Object { - "format": "strict_date_optional_time", - "gte": "now-15min", - "lte": "now", - }, - }, - }, - ], - "must": Array [], - "must_not": Array [], - "should": Array [], - }, -} -`; diff --git a/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.test.ts b/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.test.ts index 39029a03bb267..4bbacaa7bb1ad 100644 --- a/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.test.ts +++ b/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.test.ts @@ -34,13 +34,6 @@ describe('buildEsQuery', () => { timeRange: defaultTimeRange, kuery: 'kibana.alert.status: "recovered" and kibana.alert.duration.us >= 120', }, - { - timeRange: { - from: 'now-15min', - to: 'now', - }, - kuery: 'kibana.alert.status: "recovered"', - }, ]; test.each(testData)('should generate correct es query for %j', ({ kuery, timeRange }) => { diff --git a/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts b/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts index 12711c54f9784..f3f195e0df9bf 100644 --- a/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts +++ b/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts @@ -5,18 +5,19 @@ * 2.0. */ -import { buildEsQuery as kbnBuildEsQuery, TimeRange } from '@kbn/es-query'; +import { buildEsQuery as kbnBuildEsQuery, TimeRange, Query } from '@kbn/es-query'; import { TIMESTAMP } from '@kbn/rule-data-utils'; -import { getRelativeTime } from '@kbn/data-plugin/common'; +import { getTime } from '@kbn/data-plugin/common'; -export function buildEsQuery(timeRange: TimeRange, kuery?: string) { +export function buildEsQuery(timeRange: TimeRange, kuery?: string, queries: Query[] = []) { const timeFilter = timeRange && - getRelativeTime(undefined, timeRange, { + getTime(undefined, timeRange, { fieldName: TIMESTAMP, }); const filtersToUse = timeFilter ? [timeFilter] : []; - const queryToUse = kuery ? { query: kuery, language: 'kuery' } : []; + const kueryFilter = kuery ? [{ query: kuery, language: 'kuery' }] : []; + const queryToUse = [...kueryFilter, ...queries]; return kbnBuildEsQuery(undefined, queryToUse, filtersToUse); } diff --git a/x-pack/plugins/observability/public/utils/get_bucket_size/index.ts b/x-pack/plugins/observability/public/utils/get_bucket_size/index.ts index dd7b3ee109d5a..495fc766cd62f 100644 --- a/x-pack/plugins/observability/public/utils/get_bucket_size/index.ts +++ b/x-pack/plugins/observability/public/utils/get_bucket_size/index.ts @@ -20,7 +20,7 @@ export function getBucketSize({ minInterval: string; }) { const duration = moment.duration(end - start, 'ms'); - const bucketSize = Math.max(calculateAuto.near(100, duration).asSeconds(), 1); + const bucketSize = Math.max(calculateAuto.near(100, duration)?.asSeconds() ?? 0, 1); const intervalString = `${bucketSize}s`; const matches = minInterval && minInterval.match(/^([\d]+)([shmdwMy]|ms)$/); const minBucketSize = matches ? Number(matches[1]) * unitToSeconds(matches[2]) : 0; diff --git a/x-pack/plugins/observability/public/utils/observability_data_views/observability_data_views.ts b/x-pack/plugins/observability/public/utils/observability_data_views/observability_data_views.ts index 241e2ba021f3e..12bbf802538c0 100644 --- a/x-pack/plugins/observability/public/utils/observability_data_views/observability_data_views.ts +++ b/x-pack/plugins/observability/public/utils/observability_data_views/observability_data_views.ts @@ -118,12 +118,23 @@ export class ObservabilityDataViews { async createDataView(app: AppDataType, indices: string) { const appIndicesPattern = getAppIndicesWithPattern(app, indices); - return await this.dataViews.create({ + + const { runtimeFields } = getFieldFormatsForApp(app); + + const dataView = await this.dataViews.create({ title: appIndicesPattern, id: getAppDataViewId(app, indices), timeFieldName: '@timestamp', fieldFormats: this.getFieldFormats(app), }); + + if (runtimeFields !== null) { + runtimeFields.forEach(({ name, field }) => { + dataView.addRuntimeField(name, field); + }); + } + + return dataView; } async createAndSavedDataView(app: AppDataType, indices: string) { diff --git a/x-pack/plugins/observability/public/utils/url.test.ts b/x-pack/plugins/observability/public/utils/url.test.ts new file mode 100644 index 0000000000000..7a28232f09254 --- /dev/null +++ b/x-pack/plugins/observability/public/utils/url.test.ts @@ -0,0 +1,93 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { toQuery, fromQuery } from './url'; + +describe('toQuery', () => { + it('should parse string to object', () => { + expect(toQuery('?foo=bar&name=john%20doe')).toEqual({ + foo: 'bar', + name: 'john doe', + }); + }); +}); + +describe('fromQuery', () => { + it('should not encode the following characters', () => { + expect( + fromQuery({ + a: true, + b: 5000, + c: ':', + }) + ).toEqual('a=true&b=5000&c=:'); + }); + + it('should encode the following characters', () => { + expect( + fromQuery({ + a: '@', + b: '.', + c: ';', + d: ' ', + }) + ).toEqual('a=%40&b=.&c=%3B&d=%20'); + }); + + it('should handle null and undefined', () => { + expect( + fromQuery({ + a: undefined, + b: null, + }) + ).toEqual('a=&b='); + }); + + it('should handle arrays', () => { + expect( + fromQuery({ + arr: ['a', 'b'], + }) + ).toEqual('arr=a%2Cb'); + }); + + it('should parse object to string', () => { + expect( + fromQuery({ + traceId: 'bar', + transactionId: 'john doe', + }) + ).toEqual('traceId=bar&transactionId=john%20doe'); + }); + + it('should not encode range params', () => { + expect( + fromQuery({ + rangeFrom: '2019-03-03T12:00:00.000Z', + rangeTo: '2019-03-05T12:00:00.000Z', + }) + ).toEqual('rangeFrom=2019-03-03T12:00:00.000Z&rangeTo=2019-03-05T12:00:00.000Z'); + }); + + it('should handle undefined, boolean, and number values without throwing errors', () => { + expect( + fromQuery({ + flyoutDetailTab: undefined, + refreshPaused: true, + refreshInterval: 5000, + }) + ).toEqual('flyoutDetailTab=&refreshPaused=true&refreshInterval=5000'); + }); +}); + +describe('fromQuery and toQuery', () => { + it('should encode and decode correctly', () => { + expect( + fromQuery(toQuery('?name=john%20doe&path=a%2Fb&rangeFrom=2019-03-03T12:00:00.000Z')) + ).toEqual('name=john%20doe&path=a%2Fb&rangeFrom=2019-03-03T12:00:00.000Z'); + }); +}); diff --git a/x-pack/plugins/observability/server/assets/component_templates/slo_mappings_template.ts b/x-pack/plugins/observability/server/assets/component_templates/slo_mappings_template.ts index 550a50ba112a8..1611d3ee601bd 100644 --- a/x-pack/plugins/observability/server/assets/component_templates/slo_mappings_template.ts +++ b/x-pack/plugins/observability/server/assets/component_templates/slo_mappings_template.ts @@ -20,6 +20,9 @@ export const getSLOMappingsTemplate = (name: string) => ({ type: 'keyword', ignore_above: 256, }, + revision: { + type: 'long', + }, numerator: { type: 'long', }, @@ -29,6 +32,25 @@ export const getSLOMappingsTemplate = (name: string) => ({ context: { type: 'flattened', }, + _internal: { + properties: { + name: { type: 'keyword', ignore_above: 256 }, + budgeting_method: { type: 'keyword' }, + objective: { + properties: { + target: { type: 'double' }, + timeslice_target: { type: 'double' }, + timeslice_window: { type: 'keyword' }, + }, + }, + time_window: { + properties: { + duration: { type: 'keyword' }, + is_rolling: { type: 'boolean' }, + }, + }, + }, + }, }, }, }, diff --git a/x-pack/plugins/observability/server/domain/services/compute_error_budget.test.ts b/x-pack/plugins/observability/server/domain/services/compute_error_budget.test.ts index 09488f7d577da..eaec5420f1953 100644 --- a/x-pack/plugins/observability/server/domain/services/compute_error_budget.test.ts +++ b/x-pack/plugins/observability/server/domain/services/compute_error_budget.test.ts @@ -5,13 +5,115 @@ * 2.0. */ +import { twoDaysAgo } from '../../services/slo/fixtures/date'; +import { oneMinute } from '../../services/slo/fixtures/duration'; import { createSLO } from '../../services/slo/fixtures/slo'; +import { sevenDaysRolling, weeklyCalendarAligned } from '../../services/slo/fixtures/time_window'; import { computeErrorBudget } from './compute_error_budget'; +import { toDateRange } from './date_range'; describe('computeErrorBudget', () => { + describe('for occurrences based SLO', () => { + describe('with rolling time window', () => { + it('computes the error budget', () => { + const slo = createSLO({ + budgeting_method: 'occurrences', + time_window: sevenDaysRolling(), + objective: { target: 0.95 }, + }); + const dateRange = toDateRange(slo.time_window); + const errorBudget = computeErrorBudget(slo, { + good: 97, + total: 100, + date_range: dateRange, + }); + + expect(errorBudget).toEqual({ + initial: 0.05, + consumed: 0.6, + remaining: 0.4, + }); + }); + }); + + describe('with calendar aligned time window', () => { + it('computes the error budget', () => { + const slo = createSLO({ + budgeting_method: 'occurrences', + time_window: weeklyCalendarAligned(twoDaysAgo()), + objective: { target: 0.95 }, + }); + const dateRange = toDateRange(slo.time_window); + const errorBudget = computeErrorBudget(slo, { + good: 97, + total: 100, + date_range: dateRange, + }); + + expect(errorBudget).toEqual({ + initial: 0.05, + consumed: 0.6, + remaining: 0.4, + }); + }); + }); + }); + + describe('for timeslices based SLO', () => { + describe('with rolling time window', () => { + it('computes the error budget', () => { + const slo = createSLO({ + budgeting_method: 'timeslices', + time_window: sevenDaysRolling(), + objective: { target: 0.95, timeslice_target: 0.95, timeslice_window: oneMinute() }, + }); + const dateRange = toDateRange(slo.time_window); + // 7 days sliced in 1m buckets = 10,080 slices + const errorBudget = computeErrorBudget(slo, { + good: 9987, + total: 10080, + date_range: dateRange, + }); + + expect(errorBudget).toEqual({ + initial: 0.05, + consumed: 0.184524, + remaining: 0.815476, + }); + }); + }); + + describe('with calendar aligned time window', () => { + it('computes the error budget', () => { + const slo = createSLO({ + budgeting_method: 'timeslices', + time_window: weeklyCalendarAligned(twoDaysAgo()), + objective: { target: 0.95, timeslice_target: 0.95, timeslice_window: oneMinute() }, + }); + const dateRange = toDateRange(slo.time_window); + // 2 days sliced in 1m buckets = 2,880 slices (slices we have data for) = total + // 7 days sliced in 1m buckets = 10,080 slices (all slices for the window) = window_total + const errorBudget = computeErrorBudget(slo, { + good: 2823, + total: 2880, + date_range: dateRange, + }); + + // error rate = (total - good) / window_total = (2880 - 2823) / 10080 = 0.00565476 + // consumed = error rate / error budget = 0.00565476 / 0.05 = 0.1130952 + expect(errorBudget).toEqual({ + initial: 0.05, + consumed: 0.113095, + remaining: 0.886905, + }); + }); + }); + }); + it("returns default values when total events is '0'", () => { const slo = createSLO(); - const errorBudget = computeErrorBudget(slo, { good: 100, total: 0 }); + const dateRange = toDateRange(slo.time_window); + const errorBudget = computeErrorBudget(slo, { good: 100, total: 0, date_range: dateRange }); expect(errorBudget).toEqual({ initial: 0.001, // 0.1% @@ -22,7 +124,8 @@ describe('computeErrorBudget', () => { it("computes the error budget when 'good > total' events", () => { const slo = createSLO(); - const errorBudget = computeErrorBudget(slo, { good: 9999, total: 9 }); + const dateRange = toDateRange(slo.time_window); + const errorBudget = computeErrorBudget(slo, { good: 9999, total: 9, date_range: dateRange }); expect(errorBudget).toEqual({ initial: 0.001, @@ -33,7 +136,8 @@ describe('computeErrorBudget', () => { it('computes the error budget with all good events', () => { const slo = createSLO(); - const errorBudget = computeErrorBudget(slo, { good: 100, total: 100 }); + const dateRange = toDateRange(slo.time_window); + const errorBudget = computeErrorBudget(slo, { good: 100, total: 100, date_range: dateRange }); expect(errorBudget).toEqual({ initial: 0.001, @@ -44,7 +148,8 @@ describe('computeErrorBudget', () => { it('computes the error budget when exactly consumed', () => { const slo = createSLO(); - const errorBudget = computeErrorBudget(slo, { good: 999, total: 1000 }); + const dateRange = toDateRange(slo.time_window); + const errorBudget = computeErrorBudget(slo, { good: 999, total: 1000, date_range: dateRange }); expect(errorBudget).toEqual({ initial: 0.001, @@ -55,22 +160,24 @@ describe('computeErrorBudget', () => { it('computes the error budget with rounded values', () => { const slo = createSLO(); - const errorBudget = computeErrorBudget(slo, { good: 333, total: 777 }); + const dateRange = toDateRange(slo.time_window); + const errorBudget = computeErrorBudget(slo, { good: 333, total: 777, date_range: dateRange }); expect(errorBudget).toEqual({ initial: 0.001, - consumed: 571.428571, // i.e. 57142% consumed + consumed: 571.428571, // i.e. 57,142% consumed remaining: 0, }); }); it('computes the error budget with no good events', () => { const slo = createSLO(); - const errorBudget = computeErrorBudget(slo, { good: 0, total: 100 }); + const dateRange = toDateRange(slo.time_window); + const errorBudget = computeErrorBudget(slo, { good: 0, total: 100, date_range: dateRange }); expect(errorBudget).toEqual({ initial: 0.001, - consumed: 1000, // i.e. 100000% consumed + consumed: 1000, // i.e. 100,000% consumed remaining: 0, }); }); diff --git a/x-pack/plugins/observability/server/domain/services/compute_error_budget.ts b/x-pack/plugins/observability/server/domain/services/compute_error_budget.ts index 98ee17962b818..68531d4f4cb0b 100644 --- a/x-pack/plugins/observability/server/domain/services/compute_error_budget.ts +++ b/x-pack/plugins/observability/server/domain/services/compute_error_budget.ts @@ -5,14 +5,19 @@ * 2.0. */ -import { ErrorBudget, IndicatorData, SLO } from '../../types/models'; +import moment from 'moment'; +import { ErrorBudget, IndicatorData, SLO, toMomentUnitOfTime } from '../../types/models'; +import { + calendarAlignedTimeWindowSchema, + timeslicesBudgetingMethodSchema, +} from '../../types/schema'; import { toHighPrecision } from '../../utils/number'; +// More details about calculus: https://github.com/elastic/kibana/issues/143980 export function computeErrorBudget(slo: SLO, sliData: IndicatorData): ErrorBudget { - const goodEvents = sliData.good; - const totalEvents = sliData.total; + const { good, total, date_range: dateRange } = sliData; const initialErrorBudget = toHighPrecision(1 - slo.objective.target); - if (totalEvents === 0 || goodEvents >= totalEvents) { + if (total === 0 || good >= total) { return { initial: initialErrorBudget, consumed: 0, @@ -20,10 +25,28 @@ export function computeErrorBudget(slo: SLO, sliData: IndicatorData): ErrorBudge }; } - const consumedErrorBudget = toHighPrecision( - (totalEvents - goodEvents) / (totalEvents * initialErrorBudget) - ); + if ( + timeslicesBudgetingMethodSchema.is(slo.budgeting_method) && + calendarAlignedTimeWindowSchema.is(slo.time_window) + ) { + const dateRangeDurationInUnit = moment(dateRange.to).diff( + dateRange.from, + toMomentUnitOfTime(slo.objective.timeslice_window!.unit) + ); + const totalSlices = Math.ceil(dateRangeDurationInUnit / slo.objective.timeslice_window!.value); + const consumedErrorBudget = toHighPrecision( + (total - good) / (totalSlices * initialErrorBudget) + ); + const remainingErrorBudget = Math.max(toHighPrecision(1 - consumedErrorBudget), 0); + return { + initial: initialErrorBudget, + consumed: consumedErrorBudget, + remaining: remainingErrorBudget, + }; + } + + const consumedErrorBudget = toHighPrecision((total - good) / (total * initialErrorBudget)); const remainingErrorBudget = Math.max(toHighPrecision(1 - consumedErrorBudget), 0); return { diff --git a/x-pack/plugins/observability/server/domain/services/compute_sli.test.ts b/x-pack/plugins/observability/server/domain/services/compute_sli.test.ts index ba864fc1fea19..9d69539c72f70 100644 --- a/x-pack/plugins/observability/server/domain/services/compute_sli.test.ts +++ b/x-pack/plugins/observability/server/domain/services/compute_sli.test.ts @@ -5,22 +5,24 @@ * 2.0. */ +import { DateRange } from '../../types/models'; import { computeSLI } from './compute_sli'; +const DATE_RANGE: DateRange = { from: new Date(), to: new Date() }; describe('computeSLI', () => { it('returns 0 when no total events', () => { - expect(computeSLI({ good: 100, total: 0 })).toEqual(0); + expect(computeSLI({ good: 100, total: 0, date_range: DATE_RANGE })).toEqual(0); }); it('returns the sli value', () => { - expect(computeSLI({ good: 100, total: 1000 })).toEqual(0.1); + expect(computeSLI({ good: 100, total: 1000, date_range: DATE_RANGE })).toEqual(0.1); }); it('returns 1 when good is greater than total events', () => { - expect(computeSLI({ good: 9999, total: 9 })).toEqual(1); + expect(computeSLI({ good: 9999, total: 9, date_range: DATE_RANGE })).toEqual(1); }); it('returns rounds the value to 6 digits', () => { - expect(computeSLI({ good: 33, total: 90 })).toEqual(0.366667); + expect(computeSLI({ good: 33, total: 90, date_range: DATE_RANGE })).toEqual(0.366667); }); }); diff --git a/x-pack/plugins/observability/server/domain/services/compute_sli.ts b/x-pack/plugins/observability/server/domain/services/compute_sli.ts index 2def35dc37329..6a0f885737633 100644 --- a/x-pack/plugins/observability/server/domain/services/compute_sli.ts +++ b/x-pack/plugins/observability/server/domain/services/compute_sli.ts @@ -9,15 +9,14 @@ import { IndicatorData } from '../../types/models'; import { toHighPrecision } from '../../utils/number'; export function computeSLI(sliData: IndicatorData): number { - const goodEvents = sliData.good; - const totalEvents = sliData.total; - if (totalEvents === 0) { + const { good, total } = sliData; + if (total === 0) { return 0; } - if (goodEvents >= totalEvents) { + if (good >= total) { return 1; } - return toHighPrecision(goodEvents / totalEvents); + return toHighPrecision(good / total); } diff --git a/x-pack/plugins/observability/server/domain/services/date_range.ts b/x-pack/plugins/observability/server/domain/services/date_range.ts index e556d85a09f6f..2c23d0672fa31 100644 --- a/x-pack/plugins/observability/server/domain/services/date_range.ts +++ b/x-pack/plugins/observability/server/domain/services/date_range.ts @@ -7,16 +7,11 @@ import { assertNever } from '@kbn/std'; import moment from 'moment'; -import { toMomentUnitOfTime } from '../../types/models'; +import { DateRange, toMomentUnitOfTime } from '../../types/models'; import type { TimeWindow } from '../../types/models/time_window'; import { calendarAlignedTimeWindowSchema, rollingTimeWindowSchema } from '../../types/schema'; -export interface DateRange { - from: Date; - to: Date; -} - export const toDateRange = (timeWindow: TimeWindow, currentDate: Date = new Date()): DateRange => { if (calendarAlignedTimeWindowSchema.is(timeWindow)) { const unit = toMomentUnitOfTime(timeWindow.duration.unit); diff --git a/x-pack/plugins/observability/server/plugin.ts b/x-pack/plugins/observability/server/plugin.ts index ff5fd246bea1b..dd2a07f848db3 100644 --- a/x-pack/plugins/observability/server/plugin.ts +++ b/x-pack/plugins/observability/server/plugin.ts @@ -157,6 +157,9 @@ export class ObservabilityPlugin implements Plugin<ObservabilityPluginSetup> { }); return { + getAlertDetailsConfig() { + return config.unsafe.alertDetails; + }, getScopedAnnotationsClient: async (...args: Parameters<ScopedAnnotationsClientFactory>) => { const api = await annotationsApiPromise; return api?.getScopedAnnotationsClient(...args); diff --git a/x-pack/plugins/observability/server/saved_objects/slo.ts b/x-pack/plugins/observability/server/saved_objects/slo.ts index a088765a988a3..461896a35f84e 100644 --- a/x-pack/plugins/observability/server/saved_objects/slo.ts +++ b/x-pack/plugins/observability/server/saved_objects/slo.ts @@ -42,8 +42,11 @@ export const slo: SavedObjectsType = { objective: { properties: { target: { type: 'float' }, + timeslice_target: { type: 'float' }, + timeslice_window: { type: 'keyword' }, }, }, + revision: { type: 'short' }, created_at: { type: 'date' }, updated_at: { type: 'date' }, }, diff --git a/x-pack/plugins/observability/server/services/slo/fixtures/date.ts b/x-pack/plugins/observability/server/services/slo/fixtures/date.ts new file mode 100644 index 0000000000000..b62a1fd918e51 --- /dev/null +++ b/x-pack/plugins/observability/server/services/slo/fixtures/date.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. + */ + +const DAYS_IN_MILLISECONDS = 24 * 60 * 60 * 1000; + +export function twoDaysAgo(): Date { + const now = new Date(); + now.setTime(now.getTime() - 2 * DAYS_IN_MILLISECONDS); + return now; +} diff --git a/x-pack/plugins/observability/server/services/slo/fixtures/duration.ts b/x-pack/plugins/observability/server/services/slo/fixtures/duration.ts new file mode 100644 index 0000000000000..be0eb1407145c --- /dev/null +++ b/x-pack/plugins/observability/server/services/slo/fixtures/duration.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 { Duration, DurationUnit } from '../../../types/models'; + +export function sevenDays(): Duration { + return new Duration(7, DurationUnit.d); +} + +export function oneWeek(): Duration { + return new Duration(1, DurationUnit.w); +} + +export function oneMinute(): Duration { + return new Duration(1, DurationUnit.m); +} diff --git a/x-pack/plugins/observability/server/services/slo/fixtures/slo.ts b/x-pack/plugins/observability/server/services/slo/fixtures/slo.ts index 4c4139c0e9120..d1d600c7706e2 100644 --- a/x-pack/plugins/observability/server/services/slo/fixtures/slo.ts +++ b/x-pack/plugins/observability/server/services/slo/fixtures/slo.ts @@ -7,7 +7,6 @@ import { cloneDeep } from 'lodash'; import uuid from 'uuid'; -import { Duration, DurationUnit } from '../../../types/models/duration'; import { APMTransactionDurationIndicator, @@ -17,6 +16,8 @@ import { SLO, } from '../../../types/models'; import { CreateSLOParams } from '../../../types/rest_specs'; +import { sevenDays } from './duration'; +import { sevenDaysRolling } from './time_window'; export const createAPMTransactionErrorRateIndicator = ( params: Partial<APMTransactionErrorRateIndicator['params']> = {} @@ -62,10 +63,7 @@ export const createKQLCustomIndicator = ( const defaultSLO: Omit<SLO, 'id' | 'revision' | 'created_at' | 'updated_at'> = { name: 'irrelevant', description: 'irrelevant', - time_window: { - duration: new Duration(7, DurationUnit.d), - is_rolling: true, - }, + time_window: sevenDaysRolling(), budgeting_method: 'occurrences', objective: { target: 0.999, @@ -93,7 +91,7 @@ export const createSLO = (params: Partial<SLO> = {}): SLO => { export const createSLOWithCalendarTimeWindow = (params: Partial<SLO> = {}): SLO => { return createSLO({ time_window: { - duration: new Duration(7, DurationUnit.d), + duration: sevenDays(), calendar: { start_time: new Date('2022-10-01T00:00:00.000Z') }, }, ...params, diff --git a/x-pack/plugins/observability/server/services/slo/fixtures/time_window.ts b/x-pack/plugins/observability/server/services/slo/fixtures/time_window.ts new file mode 100644 index 0000000000000..6f9228bc9304f --- /dev/null +++ b/x-pack/plugins/observability/server/services/slo/fixtures/time_window.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 { TimeWindow } from '../../../types/models/time_window'; +import { oneWeek, sevenDays } from './duration'; + +export function sevenDaysRolling(): TimeWindow { + return { + duration: sevenDays(), + is_rolling: true, + }; +} + +export function weeklyCalendarAligned(startTime: Date): TimeWindow { + return { + duration: oneWeek(), + calendar: { + start_time: startTime, + }, + }; +} diff --git a/x-pack/plugins/observability/server/services/slo/get_slo.test.ts b/x-pack/plugins/observability/server/services/slo/get_slo.test.ts index f78f04c37f38e..568afe7799ba4 100644 --- a/x-pack/plugins/observability/server/services/slo/get_slo.test.ts +++ b/x-pack/plugins/observability/server/services/slo/get_slo.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { toDateRange } from '../../domain/services'; import { createAPMTransactionErrorRateIndicator, createSLO } from './fixtures/slo'; import { GetSLO } from './get_slo'; import { createSLIClientMock, createSLORepositoryMock } from './mocks'; @@ -26,7 +27,11 @@ describe('GetSLO', () => { it('retrieves the SLO from the repository', async () => { const slo = createSLO({ indicator: createAPMTransactionErrorRateIndicator() }); mockRepository.findById.mockResolvedValueOnce(slo); - mockSLIClient.fetchCurrentSLIData.mockResolvedValueOnce({ good: 9999, total: 10000 }); + mockSLIClient.fetchCurrentSLIData.mockResolvedValueOnce({ + good: 9999, + total: 10000, + date_range: toDateRange(slo.time_window), + }); const result = await getSLO.execute(slo.id); diff --git a/x-pack/plugins/observability/server/services/slo/sli_client.test.ts b/x-pack/plugins/observability/server/services/slo/sli_client.test.ts index 7729bab2f9055..359b74cd58cca 100644 --- a/x-pack/plugins/observability/server/services/slo/sli_client.test.ts +++ b/x-pack/plugins/observability/server/services/slo/sli_client.test.ts @@ -6,6 +6,8 @@ */ import { ElasticsearchClientMock, elasticsearchServiceMock } from '@kbn/core/server/mocks'; +import moment from 'moment'; + import { SLO_DESTINATION_INDEX_NAME } from '../../assets/constants'; import { toDateRange } from '../../domain/services'; import { InternalQueryError } from '../../errors'; @@ -79,7 +81,15 @@ describe('SLIClient', () => { const result = await sliClient.fetchCurrentSLIData(slo); - expect(result).toEqual({ good: 90, total: 100 }); + const expectedDateRange = toDateRange(slo.time_window); + + expect(result).toMatchObject({ + good: 90, + total: 100, + }); + expect(result.date_range.from).toBeClose(expectedDateRange.from); + expect(result.date_range.to).toBeClose(expectedDateRange.to); + expect(esClientMock.search).toHaveBeenCalledWith( expect.objectContaining({ index: `${SLO_DESTINATION_INDEX_NAME}*`, @@ -90,7 +100,7 @@ describe('SLIClient', () => { { term: { 'slo.revision': slo.revision } }, { range: { - '@timestamp': { gte: 'now-7d/m', lt: 'now/m' }, + '@timestamp': { gte: expect.anything(), lt: expect.anything() }, }, }, ], @@ -138,7 +148,9 @@ describe('SLIClient', () => { const expectedDateRange = toDateRange(slo.time_window); - expect(result).toEqual({ good: 90, total: 100 }); + expect(result).toMatchObject({ good: 90, total: 100 }); + expect(result.date_range.from).toBeClose(expectedDateRange.from); + expect(result.date_range.to).toBeClose(expectedDateRange.to); expect(esClientMock.search).toHaveBeenCalledWith( expect.objectContaining({ index: `${SLO_DESTINATION_INDEX_NAME}*`, @@ -239,8 +251,9 @@ describe('SLIClient', () => { const result = await sliClient.fetchCurrentSLIData(slo); const expectedDateRange = toDateRange(slo.time_window); - - expect(result).toEqual({ good: 90, total: 100 }); + expect(result).toMatchObject({ good: 90, total: 100 }); + expect(result.date_range.from).toBeClose(expectedDateRange.from); + expect(result.date_range.to).toBeClose(expectedDateRange.to); expect(esClientMock.search).toHaveBeenCalledWith( expect.objectContaining({ index: `${SLO_DESTINATION_INDEX_NAME}*`, @@ -345,7 +358,10 @@ describe('SLIClient', () => { const result = await sliClient.fetchCurrentSLIData(slo); - expect(result).toEqual({ good: 90, total: 100 }); + const expectedDateRange = toDateRange(slo.time_window); + expect(result).toMatchObject({ good: 90, total: 100 }); + expect(result.date_range.from).toBeClose(expectedDateRange.from); + expect(result.date_range.to).toBeClose(expectedDateRange.to); expect(esClientMock.search).toHaveBeenCalledWith( expect.objectContaining({ index: `${SLO_DESTINATION_INDEX_NAME}*`, @@ -356,10 +372,7 @@ describe('SLIClient', () => { { term: { 'slo.revision': slo.revision } }, { range: { - '@timestamp': { - gte: 'now-1M/m', - lt: 'now/m', - }, + '@timestamp': { gte: expect.anything(), lt: expect.anything() }, }, }, ], @@ -417,3 +430,23 @@ describe('SLIClient', () => { }); }); }); + +expect.extend({ + toBeClose(received: Date | string, actual: Date | string) { + const receivedDate = moment(received); + const actualDate = moment(actual); + return { + message: () => + `expected ${receivedDate.toISOString()} to be close to ${actualDate.toISOString()}`, + pass: Math.abs(receivedDate.diff(actualDate, 'seconds')) <= 120, + }; + }, +}); +declare global { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace jest { + interface Matchers<R> { + toBeClose(actual: Date | string): R; + } + } +} diff --git a/x-pack/plugins/observability/server/services/slo/sli_client.ts b/x-pack/plugins/observability/server/services/slo/sli_client.ts index dc97aa1c651f0..a1cc948a31368 100644 --- a/x-pack/plugins/observability/server/services/slo/sli_client.ts +++ b/x-pack/plugins/observability/server/services/slo/sli_client.ts @@ -11,8 +11,7 @@ import { assertNever } from '@kbn/std'; import { SLO_DESTINATION_INDEX_NAME } from '../../assets/constants'; import { toDateRange } from '../../domain/services/date_range'; import { InternalQueryError } from '../../errors'; -import { Duration, IndicatorData, SLO } from '../../types/models'; -import { calendarAlignedTimeWindowSchema, rollingTimeWindowSchema } from '../../types/schema'; +import { DateRange, Duration, IndicatorData, SLO } from '../../types/models'; import { occurencesBudgetingMethodSchema, timeslicesBudgetingMethodSchema, @@ -28,21 +27,22 @@ export class DefaultSLIClient implements SLIClient { constructor(private esClient: ElasticsearchClient) {} async fetchCurrentSLIData(slo: SLO): Promise<IndicatorData> { + const dateRange = toDateRange(slo.time_window); if (occurencesBudgetingMethodSchema.is(slo.budgeting_method)) { const result = await this.esClient.search<unknown, Record<AggKey, AggregationsSumAggregate>>({ - ...commonQuery(slo), + ...commonQuery(slo, dateRange), aggs: { good: { sum: { field: 'slo.numerator' } }, total: { sum: { field: 'slo.denominator' } }, }, }); - return handleResult(result.aggregations); + return handleResult(result.aggregations, dateRange); } if (timeslicesBudgetingMethodSchema.is(slo.budgeting_method)) { const result = await this.esClient.search<unknown, Record<AggKey, AggregationsSumAggregate>>({ - ...commonQuery(slo), + ...commonQuery(slo, dateRange), aggs: { slices: { date_histogram: { @@ -82,34 +82,14 @@ export class DefaultSLIClient implements SLIClient { }, }); - return handleResult(result.aggregations); + return handleResult(result.aggregations, dateRange); } assertNever(slo.budgeting_method); } } -function fromSLOTimeWindowToEsRange(slo: SLO): { gte: string; lt: string } { - if (calendarAlignedTimeWindowSchema.is(slo.time_window)) { - const dateRange = toDateRange(slo.time_window); - - return { - gte: `${dateRange.from.toISOString()}`, - lt: `${dateRange.to.toISOString()}`, - }; - } - - if (rollingTimeWindowSchema.is(slo.time_window)) { - return { - gte: `now-${slo.time_window.duration.value}${slo.time_window.duration.unit}/m`, - lt: `now/m`, - }; - } - - assertNever(slo.time_window); -} - -function commonQuery(slo: SLO) { +function commonQuery(slo: SLO, dateRange: DateRange) { return { size: 0, index: `${SLO_DESTINATION_INDEX_NAME}*`, @@ -118,7 +98,11 @@ function commonQuery(slo: SLO) { filter: [ { term: { 'slo.id': slo.id } }, { term: { 'slo.revision': slo.revision } }, - { range: { '@timestamp': fromSLOTimeWindowToEsRange(slo) } }, + { + range: { + '@timestamp': { gte: dateRange.from.toISOString(), lt: dateRange.to.toISOString() }, + }, + }, ], }, }, @@ -126,7 +110,8 @@ function commonQuery(slo: SLO) { } function handleResult( - aggregations: Record<AggKey, AggregationsSumAggregate> | undefined + aggregations: Record<AggKey, AggregationsSumAggregate> | undefined, + dateRange: DateRange ): IndicatorData { const good = aggregations?.good; const total = aggregations?.total; @@ -135,6 +120,7 @@ function handleResult( } return { + date_range: dateRange, good: good.value, total: total.value, }; diff --git a/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/apm_transaction_duration.test.ts.snap b/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/apm_transaction_duration.test.ts.snap index 61fadab240ae7..187126b8e8efd 100644 --- a/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/apm_transaction_duration.test.ts.snap +++ b/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/apm_transaction_duration.test.ts.snap @@ -57,6 +57,31 @@ Object { "field": "@timestamp", }, }, + "slo._internal.budgeting_method": Object { + "terms": Object { + "field": "slo._internal.budgeting_method", + }, + }, + "slo._internal.name": Object { + "terms": Object { + "field": "slo._internal.name", + }, + }, + "slo._internal.objective.target": Object { + "terms": Object { + "field": "slo._internal.objective.target", + }, + }, + "slo._internal.time_window.duration": Object { + "terms": Object { + "field": "slo._internal.time_window.duration", + }, + }, + "slo._internal.time_window.is_rolling": Object { + "terms": Object { + "field": "slo._internal.time_window.is_rolling", + }, + }, "slo.id": Object { "terms": Object { "field": "slo.id", @@ -106,6 +131,36 @@ Object { }, }, "runtime_mappings": Object { + "slo._internal.budgeting_method": Object { + "script": Object { + "source": "emit('occurrences')", + }, + "type": "keyword", + }, + "slo._internal.name": Object { + "script": Object { + "source": "emit('irrelevant')", + }, + "type": "keyword", + }, + "slo._internal.objective.target": Object { + "script": Object { + "source": "emit(0.999)", + }, + "type": "double", + }, + "slo._internal.time_window.duration": Object { + "script": Object { + "source": "emit('7d')", + }, + "type": "keyword", + }, + "slo._internal.time_window.is_rolling": Object { + "script": Object { + "source": "emit(true)", + }, + "type": "boolean", + }, "slo.id": Object { "script": Object { "source": Any<String>, diff --git a/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/apm_transaction_error_rate.test.ts.snap b/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/apm_transaction_error_rate.test.ts.snap index 51a0ee31581a2..3a7826cb9d8b5 100644 --- a/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/apm_transaction_error_rate.test.ts.snap +++ b/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/apm_transaction_error_rate.test.ts.snap @@ -62,6 +62,31 @@ Object { "field": "@timestamp", }, }, + "slo._internal.budgeting_method": Object { + "terms": Object { + "field": "slo._internal.budgeting_method", + }, + }, + "slo._internal.name": Object { + "terms": Object { + "field": "slo._internal.name", + }, + }, + "slo._internal.objective.target": Object { + "terms": Object { + "field": "slo._internal.objective.target", + }, + }, + "slo._internal.time_window.duration": Object { + "terms": Object { + "field": "slo._internal.time_window.duration", + }, + }, + "slo._internal.time_window.is_rolling": Object { + "terms": Object { + "field": "slo._internal.time_window.is_rolling", + }, + }, "slo.id": Object { "terms": Object { "field": "slo.id", @@ -111,6 +136,36 @@ Object { }, }, "runtime_mappings": Object { + "slo._internal.budgeting_method": Object { + "script": Object { + "source": "emit('occurrences')", + }, + "type": "keyword", + }, + "slo._internal.name": Object { + "script": Object { + "source": "emit('irrelevant')", + }, + "type": "keyword", + }, + "slo._internal.objective.target": Object { + "script": Object { + "source": "emit(0.999)", + }, + "type": "double", + }, + "slo._internal.time_window.duration": Object { + "script": Object { + "source": "emit('7d')", + }, + "type": "keyword", + }, + "slo._internal.time_window.is_rolling": Object { + "script": Object { + "source": "emit(true)", + }, + "type": "boolean", + }, "slo.id": Object { "script": Object { "source": Any<String>, diff --git a/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/kql_custom.test.ts.snap b/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/kql_custom.test.ts.snap index 4fac897473239..5fed8a8e08977 100644 --- a/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/kql_custom.test.ts.snap +++ b/x-pack/plugins/observability/server/services/slo/transform_generators/__snapshots__/kql_custom.test.ts.snap @@ -141,6 +141,31 @@ Object { "field": "@timestamp", }, }, + "slo._internal.budgeting_method": Object { + "terms": Object { + "field": "slo._internal.budgeting_method", + }, + }, + "slo._internal.name": Object { + "terms": Object { + "field": "slo._internal.name", + }, + }, + "slo._internal.objective.target": Object { + "terms": Object { + "field": "slo._internal.objective.target", + }, + }, + "slo._internal.time_window.duration": Object { + "terms": Object { + "field": "slo._internal.time_window.duration", + }, + }, + "slo._internal.time_window.is_rolling": Object { + "terms": Object { + "field": "slo._internal.time_window.is_rolling", + }, + }, "slo.id": Object { "terms": Object { "field": "slo.id", @@ -171,6 +196,36 @@ Object { }, }, "runtime_mappings": Object { + "slo._internal.budgeting_method": Object { + "script": Object { + "source": "emit('occurrences')", + }, + "type": "keyword", + }, + "slo._internal.name": Object { + "script": Object { + "source": "emit('irrelevant')", + }, + "type": "keyword", + }, + "slo._internal.objective.target": Object { + "script": Object { + "source": "emit(0.999)", + }, + "type": "double", + }, + "slo._internal.time_window.duration": Object { + "script": Object { + "source": "emit('7d')", + }, + "type": "keyword", + }, + "slo._internal.time_window.is_rolling": Object { + "script": Object { + "source": "emit(true)", + }, + "type": "boolean", + }, "slo.id": Object { "script": Object { "source": Any<String>, diff --git a/x-pack/plugins/observability/server/services/slo/transform_generators/apm_transaction_duration.ts b/x-pack/plugins/observability/server/services/slo/transform_generators/apm_transaction_duration.ts index 68848c7f1aa3f..35a9b5088ca70 100644 --- a/x-pack/plugins/observability/server/services/slo/transform_generators/apm_transaction_duration.ts +++ b/x-pack/plugins/observability/server/services/slo/transform_generators/apm_transaction_duration.ts @@ -5,11 +5,7 @@ * 2.0. */ -import { - AggregationsCalendarInterval, - MappingRuntimeFieldType, - TransformPutTransformRequest, -} from '@elastic/elasticsearch/lib/api/types'; +import { TransformPutTransformRequest } from '@elastic/elasticsearch/lib/api/types'; import { InvalidTransformError } from '../../../errors'; import { ALL_VALUE, apmTransactionDurationIndicatorSchema } from '../../../types/schema'; import { @@ -23,7 +19,7 @@ import { TransformGenerator } from '.'; const APM_SOURCE_INDEX = 'metrics-apm*'; -export class ApmTransactionDurationTransformGenerator implements TransformGenerator { +export class ApmTransactionDurationTransformGenerator extends TransformGenerator { public getTransformParams(slo: SLO): TransformPutTransformRequest { if (!apmTransactionDurationIndicatorSchema.is(slo.indicator)) { throw new InvalidTransformError(`Cannot handle SLO of indicator type: ${slo.indicator.type}`); @@ -33,7 +29,7 @@ export class ApmTransactionDurationTransformGenerator implements TransformGenera this.buildTransformId(slo), this.buildSource(slo, slo.indicator), this.buildDestination(), - this.buildGroupBy(), + this.buildCommonGroupBy(slo), this.buildAggregations(slo.indicator) ); } @@ -78,20 +74,7 @@ export class ApmTransactionDurationTransformGenerator implements TransformGenera return { index: APM_SOURCE_INDEX, - runtime_mappings: { - 'slo.id': { - type: 'keyword' as MappingRuntimeFieldType, - script: { - source: `emit('${slo.id}')`, - }, - }, - 'slo.revision': { - type: 'long' as MappingRuntimeFieldType, - script: { - source: `emit(${slo.revision})`, - }, - }, - }, + runtime_mappings: this.buildCommonRuntimeMappings(slo), query: { bool: { filter: [ @@ -114,27 +97,6 @@ export class ApmTransactionDurationTransformGenerator implements TransformGenera }; } - private buildGroupBy() { - return { - 'slo.id': { - terms: { - field: 'slo.id', - }, - }, - 'slo.revision': { - terms: { - field: 'slo.revision', - }, - }, - '@timestamp': { - date_histogram: { - field: '@timestamp', - calendar_interval: '1m' as AggregationsCalendarInterval, - }, - }, - }; - } - private buildAggregations(indicator: APMTransactionDurationIndicator) { const truncatedThreshold = Math.trunc(indicator.params['threshold.us']); diff --git a/x-pack/plugins/observability/server/services/slo/transform_generators/apm_transaction_error_rate.ts b/x-pack/plugins/observability/server/services/slo/transform_generators/apm_transaction_error_rate.ts index 41ab541cdb4b6..0da9f93e8d145 100644 --- a/x-pack/plugins/observability/server/services/slo/transform_generators/apm_transaction_error_rate.ts +++ b/x-pack/plugins/observability/server/services/slo/transform_generators/apm_transaction_error_rate.ts @@ -5,11 +5,7 @@ * 2.0. */ -import { - AggregationsCalendarInterval, - MappingRuntimeFieldType, - TransformPutTransformRequest, -} from '@elastic/elasticsearch/lib/api/types'; +import { TransformPutTransformRequest } from '@elastic/elasticsearch/lib/api/types'; import { InvalidTransformError } from '../../../errors'; import { ALL_VALUE, apmTransactionErrorRateIndicatorSchema } from '../../../types/schema'; import { getSLOTransformTemplate } from '../../../assets/transform_templates/slo_transform_template'; @@ -25,7 +21,7 @@ const APM_SOURCE_INDEX = 'metrics-apm*'; const ALLOWED_STATUS_CODES = ['2xx', '3xx', '4xx', '5xx']; const DEFAULT_GOOD_STATUS_CODES = ['2xx', '3xx', '4xx']; -export class ApmTransactionErrorRateTransformGenerator implements TransformGenerator { +export class ApmTransactionErrorRateTransformGenerator extends TransformGenerator { public getTransformParams(slo: SLO): TransformPutTransformRequest { if (!apmTransactionErrorRateIndicatorSchema.is(slo.indicator)) { throw new InvalidTransformError(`Cannot handle SLO of indicator type: ${slo.indicator.type}`); @@ -35,7 +31,7 @@ export class ApmTransactionErrorRateTransformGenerator implements TransformGener this.buildTransformId(slo), this.buildSource(slo, slo.indicator), this.buildDestination(), - this.buildGroupBy(), + this.buildCommonGroupBy(slo), this.buildAggregations(slo, slo.indicator) ); } @@ -80,20 +76,7 @@ export class ApmTransactionErrorRateTransformGenerator implements TransformGener return { index: APM_SOURCE_INDEX, - runtime_mappings: { - 'slo.id': { - type: 'keyword' as MappingRuntimeFieldType, - script: { - source: `emit('${slo.id}')`, - }, - }, - 'slo.revision': { - type: 'long' as MappingRuntimeFieldType, - script: { - source: `emit(${slo.revision})`, - }, - }, - }, + runtime_mappings: this.buildCommonRuntimeMappings(slo), query: { bool: { filter: [ @@ -116,27 +99,6 @@ export class ApmTransactionErrorRateTransformGenerator implements TransformGener }; } - private buildGroupBy() { - return { - 'slo.id': { - terms: { - field: 'slo.id', - }, - }, - 'slo.revision': { - terms: { - field: 'slo.revision', - }, - }, - '@timestamp': { - date_histogram: { - field: '@timestamp', - calendar_interval: '1m' as AggregationsCalendarInterval, - }, - }, - }; - } - private buildAggregations(slo: SLO, indicator: APMTransactionErrorRateIndicator) { const goodStatusCodesFilter = this.getGoodStatusCodesFilter(indicator.params.good_status_codes); diff --git a/x-pack/plugins/observability/server/services/slo/transform_generators/kql_custom.ts b/x-pack/plugins/observability/server/services/slo/transform_generators/kql_custom.ts index b444a196960d3..c2228b6a3095c 100644 --- a/x-pack/plugins/observability/server/services/slo/transform_generators/kql_custom.ts +++ b/x-pack/plugins/observability/server/services/slo/transform_generators/kql_custom.ts @@ -5,11 +5,7 @@ * 2.0. */ -import { - AggregationsCalendarInterval, - MappingRuntimeFieldType, - TransformPutTransformRequest, -} from '@elastic/elasticsearch/lib/api/types'; +import { TransformPutTransformRequest } from '@elastic/elasticsearch/lib/api/types'; import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query'; import { InvalidTransformError } from '../../../errors'; @@ -23,7 +19,7 @@ import { } from '../../../assets/constants'; import { KQLCustomIndicator, SLO } from '../../../types/models'; -export class KQLCustomTransformGenerator implements TransformGenerator { +export class KQLCustomTransformGenerator extends TransformGenerator { public getTransformParams(slo: SLO): TransformPutTransformRequest { if (!kqlCustomIndicatorSchema.is(slo.indicator)) { throw new InvalidTransformError(`Cannot handle SLO of indicator type: ${slo.indicator.type}`); @@ -33,7 +29,7 @@ export class KQLCustomTransformGenerator implements TransformGenerator { this.buildTransformId(slo), this.buildSource(slo, slo.indicator), this.buildDestination(), - this.buildGroupBy(), + this.buildCommonGroupBy(slo), this.buildAggregations(slo, slo.indicator) ); } @@ -46,20 +42,7 @@ export class KQLCustomTransformGenerator implements TransformGenerator { const filter = getElastichsearchQueryOrThrow(indicator.params.query_filter); return { index: indicator.params.index, - runtime_mappings: { - 'slo.id': { - type: 'keyword' as MappingRuntimeFieldType, - script: { - source: `emit('${slo.id}')`, - }, - }, - 'slo.revision': { - type: 'long' as MappingRuntimeFieldType, - script: { - source: `emit(${slo.revision})`, - }, - }, - }, + runtime_mappings: this.buildCommonRuntimeMappings(slo), query: filter, }; } @@ -71,27 +54,6 @@ export class KQLCustomTransformGenerator implements TransformGenerator { }; } - private buildGroupBy() { - return { - 'slo.id': { - terms: { - field: 'slo.id', - }, - }, - 'slo.revision': { - terms: { - field: 'slo.revision', - }, - }, - '@timestamp': { - date_histogram: { - field: '@timestamp', - calendar_interval: '1m' as AggregationsCalendarInterval, - }, - }, - }; - } - private buildAggregations(slo: SLO, indicator: KQLCustomIndicator) { const numerator = getElastichsearchQueryOrThrow(indicator.params.numerator); const denominator = getElastichsearchQueryOrThrow(indicator.params.denominator); diff --git a/x-pack/plugins/observability/server/services/slo/transform_generators/transform_generator.ts b/x-pack/plugins/observability/server/services/slo/transform_generators/transform_generator.ts index 3965e809373c8..cd0ceaa602c22 100644 --- a/x-pack/plugins/observability/server/services/slo/transform_generators/transform_generator.ts +++ b/x-pack/plugins/observability/server/services/slo/transform_generators/transform_generator.ts @@ -5,9 +5,147 @@ * 2.0. */ -import { TransformPutTransformRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { MappingRuntimeFieldType } from '@elastic/elasticsearch/lib/api/types'; +import { + AggregationsCalendarInterval, + TransformPutTransformRequest, +} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { + calendarAlignedTimeWindowSchema, + rollingTimeWindowSchema, + timeslicesBudgetingMethodSchema, +} from '../../../types/schema'; import { SLO } from '../../../types/models'; -export interface TransformGenerator { - getTransformParams(slo: SLO): TransformPutTransformRequest; +export abstract class TransformGenerator { + public abstract getTransformParams(slo: SLO): TransformPutTransformRequest; + + public buildCommonRuntimeMappings(slo: SLO) { + return { + 'slo.id': { + type: 'keyword' as MappingRuntimeFieldType, + script: { + source: `emit('${slo.id}')`, + }, + }, + 'slo.revision': { + type: 'long' as MappingRuntimeFieldType, + script: { + source: `emit(${slo.revision})`, + }, + }, + 'slo._internal.name': { + type: 'keyword' as MappingRuntimeFieldType, + script: { + source: `emit('${slo.name}')`, + }, + }, + 'slo._internal.budgeting_method': { + type: 'keyword' as MappingRuntimeFieldType, + script: { + source: `emit('${slo.budgeting_method}')`, + }, + }, + 'slo._internal.objective.target': { + type: 'double' as MappingRuntimeFieldType, + script: { + source: `emit(${slo.objective.target})`, + }, + }, + ...(timeslicesBudgetingMethodSchema.is(slo.budgeting_method) && { + 'slo._internal.objective.timeslice_target': { + type: 'double' as MappingRuntimeFieldType, + script: { + source: `emit(${slo.objective.timeslice_target})`, + }, + }, + 'slo._internal.objective.timeslice_window': { + type: 'keyword' as MappingRuntimeFieldType, + script: { + source: `emit('${slo.objective.timeslice_window?.format()}')`, + }, + }, + }), + 'slo._internal.time_window.duration': { + type: 'keyword' as MappingRuntimeFieldType, + script: { + source: `emit('${slo.time_window.duration.format()}')`, + }, + }, + ...(calendarAlignedTimeWindowSchema.is(slo.time_window) && { + 'slo._internal.time_window.is_rolling': { + type: 'boolean' as MappingRuntimeFieldType, + script: { + source: `emit(false)`, + }, + }, + }), + ...(rollingTimeWindowSchema.is(slo.time_window) && { + 'slo._internal.time_window.is_rolling': { + type: 'boolean' as MappingRuntimeFieldType, + script: { + source: `emit(true)`, + }, + }, + }), + }; + } + + public buildCommonGroupBy(slo: SLO) { + return { + 'slo.id': { + terms: { + field: 'slo.id', + }, + }, + 'slo.revision': { + terms: { + field: 'slo.revision', + }, + }, + 'slo._internal.name': { + terms: { + field: 'slo._internal.name', + }, + }, + 'slo._internal.budgeting_method': { + terms: { + field: 'slo._internal.budgeting_method', + }, + }, + 'slo._internal.objective.target': { + terms: { + field: 'slo._internal.objective.target', + }, + }, + 'slo._internal.time_window.duration': { + terms: { + field: 'slo._internal.time_window.duration', + }, + }, + 'slo._internal.time_window.is_rolling': { + terms: { + field: 'slo._internal.time_window.is_rolling', + }, + }, + ...(timeslicesBudgetingMethodSchema.is(slo.budgeting_method) && { + 'slo._internal.objective.timeslice_target': { + terms: { + field: 'slo._internal.objective.timeslice_target', + }, + }, + 'slo._internal.objective.timeslice_window': { + terms: { + field: 'slo._internal.objective.timeslice_window', + }, + }, + }), + '@timestamp': { + date_histogram: { + field: '@timestamp', + calendar_interval: '1m' as AggregationsCalendarInterval, + }, + }, + }; + } } diff --git a/x-pack/plugins/observability/server/services/slo/transform_manager.test.ts b/x-pack/plugins/observability/server/services/slo/transform_manager.test.ts index 1951888d734fd..696e04f5c13bc 100644 --- a/x-pack/plugins/observability/server/services/slo/transform_manager.test.ts +++ b/x-pack/plugins/observability/server/services/slo/transform_manager.test.ts @@ -138,13 +138,13 @@ describe('TransformManager', () => { }); }); -class DummyTransformGenerator implements TransformGenerator { +class DummyTransformGenerator extends TransformGenerator { getTransformParams(slo: SLO): TransformPutTransformRequest { return {} as TransformPutTransformRequest; } } -class FailTransformGenerator implements TransformGenerator { +class FailTransformGenerator extends TransformGenerator { getTransformParams(slo: SLO): TransformPutTransformRequest { throw new Error('Some error'); } diff --git a/x-pack/plugins/observability/server/types/models/common.ts b/x-pack/plugins/observability/server/types/models/common.ts new file mode 100644 index 0000000000000..7f672136c9194 --- /dev/null +++ b/x-pack/plugins/observability/server/types/models/common.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import * as t from 'io-ts'; +import { dateRangeSchema } from '../schema'; + +type DateRange = t.TypeOf<typeof dateRangeSchema>; + +export type { DateRange }; diff --git a/x-pack/plugins/observability/server/types/models/duration.test.ts b/x-pack/plugins/observability/server/types/models/duration.test.ts index 4383c8e3ddd79..6f6b2dcb0c2d3 100644 --- a/x-pack/plugins/observability/server/types/models/duration.test.ts +++ b/x-pack/plugins/observability/server/types/models/duration.test.ts @@ -20,6 +20,18 @@ describe('Duration', () => { expect(() => new Duration(1, 'z' as DurationUnit)).toThrow('invalid duration unit'); }); + describe('format', () => { + it('formats the duration correctly', () => { + expect(new Duration(1, DurationUnit.m).format()).toBe('1m'); + expect(new Duration(1, DurationUnit.h).format()).toBe('1h'); + expect(new Duration(1, DurationUnit.d).format()).toBe('1d'); + expect(new Duration(1, DurationUnit.w).format()).toBe('1w'); + expect(new Duration(1, DurationUnit.M).format()).toBe('1M'); + expect(new Duration(1, DurationUnit.Q).format()).toBe('1Q'); + expect(new Duration(1, DurationUnit.Y).format()).toBe('1Y'); + }); + }); + describe('isShorterThan', () => { it('returns true when the current duration is shorter than the other duration', () => { const short = new Duration(1, DurationUnit.m); diff --git a/x-pack/plugins/observability/server/types/models/duration.ts b/x-pack/plugins/observability/server/types/models/duration.ts index e34a748e30ba6..aafed067f0bae 100644 --- a/x-pack/plugins/observability/server/types/models/duration.ts +++ b/x-pack/plugins/observability/server/types/models/duration.ts @@ -33,6 +33,10 @@ class Duration { const currentDurationMoment = moment.duration(this.value, toMomentUnitOfTime(this.unit)); return currentDurationMoment.asSeconds() < otherDurationMoment.asSeconds(); } + + format(): string { + return `${this.value}${this.unit}`; + } } const toMomentUnitOfTime = (unit: DurationUnit): moment.unitOfTime.Diff => { diff --git a/x-pack/plugins/observability/server/types/models/index.ts b/x-pack/plugins/observability/server/types/models/index.ts index d27c9f27c868b..443dea8f09d6d 100644 --- a/x-pack/plugins/observability/server/types/models/index.ts +++ b/x-pack/plugins/observability/server/types/models/index.ts @@ -9,3 +9,4 @@ export * from './slo'; export * from './indicators'; export * from './error_budget'; export * from './duration'; +export * from './common'; diff --git a/x-pack/plugins/observability/server/types/schema/common.ts b/x-pack/plugins/observability/server/types/schema/common.ts index d565b0eb5f31f..b3265178d5260 100644 --- a/x-pack/plugins/observability/server/types/schema/common.ts +++ b/x-pack/plugins/observability/server/types/schema/common.ts @@ -29,4 +29,6 @@ const errorBudgetSchema = t.type({ remaining: t.number, }); -export { allOrAnyString, ALL_VALUE, dateType, errorBudgetSchema }; +const dateRangeSchema = t.type({ from: dateType, to: dateType }); + +export { allOrAnyString, ALL_VALUE, dateType, errorBudgetSchema, dateRangeSchema }; diff --git a/x-pack/plugins/observability/server/types/schema/duration.ts b/x-pack/plugins/observability/server/types/schema/duration.ts index b4fa5065063f3..c7a3815140a6a 100644 --- a/x-pack/plugins/observability/server/types/schema/duration.ts +++ b/x-pack/plugins/observability/server/types/schema/duration.ts @@ -24,7 +24,7 @@ const durationType = new t.Type<Duration, string, unknown>( return t.failure(input, context); } }), - (duration: Duration): string => `${duration.value}${duration.unit}` + (duration: Duration): string => duration.format() ); export { durationType }; diff --git a/x-pack/plugins/observability/server/types/schema/indicators.ts b/x-pack/plugins/observability/server/types/schema/indicators.ts index ab343e5b7b995..46d3e8694e684 100644 --- a/x-pack/plugins/observability/server/types/schema/indicators.ts +++ b/x-pack/plugins/observability/server/types/schema/indicators.ts @@ -6,7 +6,7 @@ */ import * as t from 'io-ts'; -import { allOrAnyString } from './common'; +import { allOrAnyString, dateRangeSchema } from './common'; const apmTransactionDurationIndicatorTypeSchema = t.literal('slo.apm.transaction_duration'); const apmTransactionDurationIndicatorSchema = t.type({ @@ -49,7 +49,11 @@ const kqlCustomIndicatorSchema = t.type({ }), }); -const indicatorDataSchema = t.type({ good: t.number, total: t.number }); +const indicatorDataSchema = t.type({ + date_range: dateRangeSchema, + good: t.number, + total: t.number, +}); const indicatorTypesSchema = t.union([ apmTransactionDurationIndicatorTypeSchema, diff --git a/x-pack/plugins/observability/server/ui_settings.ts b/x-pack/plugins/observability/server/ui_settings.ts index a5b111569e311..6f2bfb27a1613 100644 --- a/x-pack/plugins/observability/server/ui_settings.ts +++ b/x-pack/plugins/observability/server/ui_settings.ts @@ -15,7 +15,6 @@ import { maxSuggestions, defaultApmServiceEnvironment, apmProgressiveLoading, - enableServiceGroups, apmServiceInventoryOptimizedSorting, enableNewSyntheticsView, apmServiceGroupMaxNumberOfServices, @@ -25,6 +24,9 @@ import { enableInfrastructureHostsView, enableServiceMetrics, enableAwsLambdaMetrics, + apmAWSLambdaPriceFactor, + apmAWSLambdaRequestCostPerMillion, + enableCriticalPath, } from '../common/ui_settings_keys'; const technicalPreviewLabel = i18n.translate( @@ -39,7 +41,7 @@ function feedbackLink({ href }: { href: string }) { )}</a>`; } -type UiSettings = UiSettingsParams<boolean | number | string> & { showInLabs?: boolean }; +type UiSettings = UiSettingsParams<boolean | number | string | object> & { showInLabs?: boolean }; /** * uiSettings definitions for Observability. @@ -161,24 +163,6 @@ export const uiSettings: Record<string, UiSettings> = { }, showInLabs: true, }, - [enableServiceGroups]: { - category: [observabilityFeatureId], - name: i18n.translate('xpack.observability.enableServiceGroups', { - defaultMessage: 'Service groups feature', - }), - value: false, - description: i18n.translate('xpack.observability.enableServiceGroupsDescription', { - defaultMessage: - '{technicalPreviewLabel} Enable the Service groups feature on APM UI. {feedbackLink}.', - values: { - technicalPreviewLabel: `<em>[${technicalPreviewLabel}]</em>`, - feedbackLink: feedbackLink({ href: 'https://ela.st/feedback-service-groups' }), - }, - }), - schema: schema.boolean(), - requiresPageReload: true, - showInLabs: true, - }, [enableServiceMetrics]: { category: [observabilityFeatureId], name: i18n.translate('xpack.observability.apmEnableServiceMetrics', { @@ -197,13 +181,13 @@ export const uiSettings: Record<string, UiSettings> = { [apmServiceInventoryOptimizedSorting]: { category: [observabilityFeatureId], name: i18n.translate('xpack.observability.apmServiceInventoryOptimizedSorting', { - defaultMessage: 'Optimize APM Service Inventory page load performance', + defaultMessage: 'Optimize services list load performance in APM', }), description: i18n.translate( 'xpack.observability.apmServiceInventoryOptimizedSortingDescription', { defaultMessage: - '{technicalPreviewLabel} Default APM Service Inventory page sort (for Services without Machine Learning applied) to sort by Service Name. {feedbackLink}.', + '{technicalPreviewLabel} Default APM Service Inventory and Storage Explorer pages sort (for Services without Machine Learning applied) to sort by Service Name. {feedbackLink}.', values: { technicalPreviewLabel: `<em>[${technicalPreviewLabel}]</em>`, feedbackLink: feedbackLink({ href: 'https://ela.st/feedback-apm-page-performance' }), @@ -309,4 +293,44 @@ export const uiSettings: Record<string, UiSettings> = { type: 'boolean', showInLabs: true, }, + [apmAWSLambdaPriceFactor]: { + category: [observabilityFeatureId], + name: i18n.translate('xpack.observability.apmAWSLambdaPricePerGbSeconds', { + defaultMessage: 'AWS lambda price factor', + }), + type: 'json', + value: JSON.stringify({ x86_64: 0.0000166667, arm: 0.0000133334 }, null, 2), + description: i18n.translate('xpack.observability.apmAWSLambdaPricePerGbSecondsDescription', { + defaultMessage: 'Price per Gb-second.', + }), + schema: schema.object({ + arm: schema.number(), + x86_64: schema.number(), + }), + }, + [apmAWSLambdaRequestCostPerMillion]: { + category: [observabilityFeatureId], + name: i18n.translate('xpack.observability.apmAWSLambdaRequestCostPerMillion', { + defaultMessage: 'AWS lambda price per 1M requests', + }), + value: 0.2, + schema: schema.number({ min: 0 }), + }, + [enableCriticalPath]: { + category: [observabilityFeatureId], + name: i18n.translate('xpack.observability.enableCriticalPath', { + defaultMessage: 'Critical path', + }), + description: i18n.translate('xpack.observability.enableCriticalPathDescription', { + defaultMessage: '{technicalPreviewLabel} Optionally display the critical path of a trace.', + values: { + technicalPreviewLabel: `<em>[${technicalPreviewLabel}]</em>`, + }, + }), + schema: schema.boolean(), + value: false, + requiresPageReload: true, + type: 'boolean', + showInLabs: true, + }, }; diff --git a/x-pack/plugins/observability/server/utils/queries.ts b/x-pack/plugins/observability/server/utils/queries.ts index 008b8720de7cd..f6a5a02d8e415 100644 --- a/x-pack/plugins/observability/server/utils/queries.ts +++ b/x-pack/plugins/observability/server/utils/queries.ts @@ -13,11 +13,16 @@ function isUndefinedOrNull(value: any): value is undefined | null { return value === undefined || value === null; } +interface TermQueryOpts { + queryEmptyString: boolean; +} + export function termQuery<T extends string>( field: T, - value: string | boolean | number | undefined | null + value: string | boolean | number | undefined | null, + opts: TermQueryOpts = { queryEmptyString: true } ): QueryDslQueryContainer[] { - if (isUndefinedOrNull(value)) { + if (isUndefinedOrNull(value) || (!opts.queryEmptyString && value === '')) { return []; } diff --git a/x-pack/plugins/observability/tsconfig.json b/x-pack/plugins/observability/tsconfig.json index 163160f555669..4f9d89cd2b3cd 100644 --- a/x-pack/plugins/observability/tsconfig.json +++ b/x-pack/plugins/observability/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -14,7 +13,7 @@ "typings/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, diff --git a/x-pack/plugins/osquery/cypress/e2e/all/discover.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/discover.cy.ts index 3e47b983dcda4..4494757128a64 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/discover.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/discover.cy.ts @@ -12,28 +12,54 @@ import { ROLES } from '../../test'; // TODO: So far just one test, but this is a good place to start. Move tests from pack view into here. describe('ALL - Discover', () => { - beforeEach(() => { - login(ROLES.soc_manager); - navigateTo('/app/osquery'); + before(() => { + login(ROLES.admin); + cy.request({ + method: 'POST', + url: '/api/spaces/space', + body: { + id: 'custom-space', + name: 'custom-space', + }, + headers: { 'kbn-xsrf': 'create-space' }, + }); }); - it('should be opened in new tab in results table', () => { - cy.contains('New live query').click(); - selectAllAgents(); - inputQuery('select * from uptime; '); - submitQuery(); - checkResults(); - cy.contains('View in Lens').should('exist'); - cy.contains('View in Discover') - .should('exist') - .should('have.attr', 'href') - .then(($href) => { - // @ts-expect-error-next-line href string - check types - cy.visit($href); - cy.getBySel('breadcrumbs').contains('Discover').should('exist'); - cy.getBySel('discoverDocTable', { timeout: 60000 }).contains( - 'action_data.queryselect * from uptime' - ); + after(() => { + login(ROLES.admin); + cy.request({ + method: 'DELETE', + url: '/api/spaces/space/custom-space', + headers: { 'kbn-xsrf': 'delete-space' }, + }); + }); + + ['default', 'custom-space'].forEach((space) => { + describe(`[${space}]`, () => { + beforeEach(() => { + login(ROLES.soc_manager); + navigateTo(`/s/${space}/app/osquery`); + }); + + it('should be opened in new tab in results table', () => { + cy.contains('New live query').click(); + selectAllAgents(); + inputQuery('select * from uptime; '); + submitQuery(); + checkResults(); + cy.contains('View in Lens').should('exist'); + cy.contains('View in Discover') + .should('exist') + .should('have.attr', 'href') + .then(($href) => { + // @ts-expect-error-next-line href string - check types + cy.visit($href); + cy.getBySel('breadcrumbs').contains('Discover').should('exist'); + cy.getBySel('discoverDocTable', { timeout: 60000 }).contains( + 'action_data.queryselect * from uptime' + ); + }); }); + }); }); }); diff --git a/x-pack/plugins/osquery/cypress/e2e/all/packs.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/packs.cy.ts index 0d77b7f4ff5f1..7dc3d1e646075 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/packs.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/packs.cy.ts @@ -17,7 +17,7 @@ import { ArchiverMethod, runKbnArchiverScript } from '../../tasks/archiver'; import { preparePack } from '../../tasks/packs'; import { addIntegration, closeModalIfVisible } from '../../tasks/integrations'; import { DEFAULT_POLICY } from '../../screens/fleet'; -import { getSavedQueriesDropdown } from '../../screens/live_query'; +import { getIdFormField, getSavedQueriesDropdown } from '../../screens/live_query'; import { ROLES } from '../../test'; import { getRandomInt } from '../../tasks/helpers'; @@ -47,6 +47,104 @@ describe('ALL - Packs', () => { runKbnArchiverScript(ArchiverMethod.UNLOAD, 'ecs_mapping_3'); }); + it('Check if result type is correct', () => { + cy.contains('Packs').click(); + findAndClickButton('Add pack'); + findFormFieldByRowsLabelAndType('Name', 'ResultType'); + findAndClickButton('Add query'); + cy.contains('Attach next query'); + getIdFormField().type('Query1'); + inputQuery('select * from uptime;'); + cy.wait(500); // wait for the validation to trigger - cypress is way faster than users ;) + cy.react('EuiFlyoutFooter').react('EuiButton').contains('Save').click(); + findAndClickButton('Add query'); + cy.contains('Attach next query'); + getIdFormField().type('Query2'); + inputQuery('select * from uptime;'); + + cy.getBySel('resultsTypeField').click(); + cy.contains('Differential').click(); + cy.wait(500); // wait for the validation to trigger - cypress is way faster than users ;) + + cy.react('EuiFlyoutFooter').react('EuiButton').contains('Save').click(); + findAndClickButton('Add query'); + cy.contains('Attach next query'); + getIdFormField().type('Query3'); + inputQuery('select * from uptime;'); + cy.getBySel('resultsTypeField').click(); + cy.contains('Differential (Ignore removals)').click(); + cy.wait(500); // wait for the validation to trigger - cypress is way faster than users ;) + + cy.react('EuiFlyoutFooter').react('EuiButton').contains('Save').click(); + findAndClickButton('Save pack'); + cy.react('ScheduledQueryNameComponent', { + props: { + name: 'ResultType', + }, + }).click(); + + findAndClickButton('Edit'); + cy.contains('Query1'); + cy.contains('Query2'); + cy.contains('Query3'); + cy.react('CustomItemAction', { + props: { index: 0, item: { id: 'Query1' } }, + }).click(); + cy.getBySel('resultsTypeField').contains('Snapshot').click(); + cy.contains('Differential').click(); + + cy.react('EuiFlyoutFooter').react('EuiButton').contains('Save').click(); + + cy.react('CustomItemAction', { + props: { index: 0, item: { id: 'Query2' } }, + }).click(); + cy.getBySel('resultsTypeField').contains('Differential').click(); + cy.contains('Differential (Ignore removals)').click(); + + cy.react('EuiFlyoutFooter').react('EuiButton').contains('Save').click(); + cy.react('CustomItemAction', { + props: { index: 0, item: { id: 'Query3' } }, + }).click(); + cy.getBySel('resultsTypeField').contains('(Ignore removals)').click(); + cy.contains('Snapshot').click(); + + cy.react('EuiFlyoutFooter').react('EuiButton').contains('Save').click(); + findFormFieldByRowsLabelAndType( + 'Scheduled agent policies (optional)', + 'fleet server {downArrow} {enter}' + ); + findAndClickButton('Update pack'); + closeModalIfVisible(); + + cy.contains( + 'Create packs to organize sets of queries and to schedule queries for agent policies.' + ); + const queries = { + Query1: { + interval: 3600, + query: 'select * from uptime;', + removed: true, + snapshot: false, + }, + Query2: { + interval: 3600, + query: 'select * from uptime;', + removed: false, + snapshot: false, + }, + Query3: { + interval: 3600, + query: 'select * from uptime;', + }, + }; + cy.request('/internal/osquery/fleet_wrapper/package_policies').then((response) => { + const item = response.body.items.find( + (policy: { policy_id: string }) => policy.policy_id === 'fleet-server-policy' + ); + + expect(item.inputs[0].config.osquery.value.packs.ResultType.queries).to.deep.equal(queries); + }); + }); it('should add a pack from a saved query', () => { cy.contains('Packs').click(); findAndClickButton('Add pack'); diff --git a/x-pack/plugins/osquery/cypress/screens/live_query.ts b/x-pack/plugins/osquery/cypress/screens/live_query.ts index d3be652c24c2c..32d3a54881b1d 100644 --- a/x-pack/plugins/osquery/cypress/screens/live_query.ts +++ b/x-pack/plugins/osquery/cypress/screens/live_query.ts @@ -17,3 +17,8 @@ export const getSavedQueriesDropdown = () => cy.react('EuiComboBox', { props: { placeholder: 'Search for a query to run, or write a new query below' }, }); + +export const getIdFormField = () => + cy.react('EuiFormRow', { + props: { label: 'ID' }, + }); diff --git a/x-pack/plugins/osquery/public/cases/add_to_cases_button.tsx b/x-pack/plugins/osquery/public/cases/add_to_cases_button.tsx index 03b5bcebfed40..cbc3589df597c 100644 --- a/x-pack/plugins/osquery/public/cases/add_to_cases_button.tsx +++ b/x-pack/plugins/osquery/public/cases/add_to_cases_button.tsx @@ -5,12 +5,13 @@ * 2.0. */ -import React, { useCallback } from 'react'; +import React, { useCallback, useContext, useMemo } from 'react'; import { CommentType, ExternalReferenceStorageType } from '@kbn/cases-plugin/common'; import { EuiButtonEmpty, EuiButtonIcon, EuiFlexItem, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import type { CaseAttachmentsWithoutOwner } from '@kbn/cases-plugin/public'; import { useKibana } from '../common/lib/kibana'; +import { AlertAttachmentContext } from '../common/contexts'; const ADD_TO_CASE = i18n.translate( 'xpack.osquery.pack.queriesTable.addToCaseResultsActionAriaLabel', @@ -37,6 +38,24 @@ export const AddToCaseButton: React.FC<AddToCaseButtonProps> = ({ iconProps, }) => { const { cases } = useKibana().services; + const ecsData = useContext(AlertAttachmentContext); + const alertAttachments = useMemo( + () => + ecsData?._id + ? [ + { + alertId: ecsData?._id ?? '', + index: ecsData?._index ?? '', + rule: cases.helpers.getRuleIdFromEvent({ + ecs: ecsData, + data: [], + }), + type: CommentType.alert as const, + }, + ] + : [], + [cases.helpers, ecsData] + ); const casePermissions = cases.helpers.canUseCases(); const hasCasesPermissions = @@ -45,6 +64,7 @@ export const AddToCaseButton: React.FC<AddToCaseButtonProps> = ({ const handleClick = useCallback(() => { const attachments: CaseAttachmentsWithoutOwner = [ + ...alertAttachments, { type: CommentType.externalReference, externalReferenceId: actionId, @@ -58,7 +78,7 @@ export const AddToCaseButton: React.FC<AddToCaseButtonProps> = ({ if (hasCasesPermissions) { selectCaseModal.open({ attachments }); } - }, [actionId, agentIds, hasCasesPermissions, queryId, selectCaseModal]); + }, [actionId, agentIds, alertAttachments, hasCasesPermissions, queryId, selectCaseModal]); if (isIcon) { return ( diff --git a/x-pack/plugins/osquery/public/common/contexts.tsx b/x-pack/plugins/osquery/public/common/contexts.tsx new file mode 100644 index 0000000000000..e035e08710a91 --- /dev/null +++ b/x-pack/plugins/osquery/public/common/contexts.tsx @@ -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 React from 'react'; + +export interface AlertEcsData { + _id: string; + _index?: string; +} + +export const AlertAttachmentContext = React.createContext<AlertEcsData | null>(null); diff --git a/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx b/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx index cf5a9e42d8911..8af764e6c8399 100644 --- a/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx +++ b/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx @@ -16,6 +16,11 @@ export interface LogsDataView extends DataView { interface UseLogsDataView { skip?: boolean; + /* + this flag is used to retrieve the persistent logs data view + and should be used only for external links, eg. discover, lens + */ + checkOnly?: boolean; } export const useLogsDataView = (payload?: UseLogsDataView) => { @@ -24,34 +29,35 @@ export const useLogsDataView = (payload?: UseLogsDataView) => { return useQuery<LogsDataView | undefined>( ['logsDataView'], async () => { - try { - await dataViews.getFieldsForWildcard({ - pattern: 'logs-osquery_manager.result*', - }); - } catch (e) { - return undefined; - } - let dataView; try { const data = await dataViews.find('logs-osquery_manager.result*', 1); if (data.length) { dataView = data[0]; + } else { + throw new Error('No data view found'); } - } catch (e) { - if (dataViews.getCanSaveSync()) { + // eslint-disable-next-line no-empty + } catch (e) {} + + if (!dataView && dataViews.getCanSaveSync()) { + try { dataView = await dataViews.createAndSave({ title: 'logs-osquery_manager.result*', timeFieldName: '@timestamp', }); - } + // eslint-disable-next-line no-empty + } catch (e) {} } - if (!dataView) { - dataView = await dataViews.create({ - title: 'logs-osquery_manager.result*', - timeFieldName: '@timestamp', - }); + if (!dataView && !payload?.checkOnly) { + try { + dataView = await dataViews.create({ + title: 'logs-osquery_manager.result*', + timeFieldName: '@timestamp', + }); + // eslint-disable-next-line no-empty + } catch (e) {} } return dataView as LogsDataView; diff --git a/x-pack/plugins/osquery/public/common/schemas/osquery/v5.4.0.json b/x-pack/plugins/osquery/public/common/schemas/osquery/v5.4.0.json deleted file mode 100644 index 779a57c90a784..0000000000000 --- a/x-pack/plugins/osquery/public/common/schemas/osquery/v5.4.0.json +++ /dev/null @@ -1 +0,0 @@ -[{"name":"account_policy_data","description":"Additional macOS user account data from the AccountPolicy section of OpenDirectory.","platforms":["darwin"],"columns":[{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"creation_time","description":"When the account was first created","type":"double","hidden":false,"required":false,"index":false},{"name":"failed_login_count","description":"The number of failed login attempts using an incorrect password. Count resets after a correct password is entered.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"failed_login_timestamp","description":"The time of the last failed login attempt. Resets after a correct password is entered","type":"double","hidden":false,"required":false,"index":false},{"name":"password_last_set_time","description":"The time the password was last changed","type":"double","hidden":false,"required":false,"index":false}]},{"name":"acpi_tables","description":"Firmware ACPI functional table common metadata and content.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"ACPI table name","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of compiled table data","type":"integer","hidden":false,"required":false,"index":false},{"name":"md5","description":"MD5 hash of table content","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ad_config","description":"macOS Active Directory configuration.","platforms":["darwin"],"columns":[{"name":"name","description":"The macOS-specific configuration name","type":"text","hidden":false,"required":false,"index":false},{"name":"domain","description":"Active Directory trust domain","type":"text","hidden":false,"required":false,"index":false},{"name":"option","description":"Canonical name of option","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Variable typed option value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"alf","description":"macOS application layer firewall (ALF) service details.","platforms":["darwin"],"columns":[{"name":"allow_signed_enabled","description":"1 If allow signed mode is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"firewall_unload","description":"1 If firewall unloading enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"global_state","description":"1 If the firewall is enabled with exceptions, 2 if the firewall is configured to block all incoming connections, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"logging_enabled","description":"1 If logging mode is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"logging_option","description":"Firewall logging option","type":"integer","hidden":false,"required":false,"index":false},{"name":"stealth_enabled","description":"1 If stealth mode is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"version","description":"Application Layer Firewall version","type":"text","hidden":false,"required":false,"index":false}]},{"name":"alf_exceptions","description":"macOS application layer firewall (ALF) service exceptions.","platforms":["darwin"],"columns":[{"name":"path","description":"Path to the executable that is excepted","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Firewall exception state","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"alf_explicit_auths","description":"ALF services explicitly allowed to perform networking.","platforms":["darwin"],"columns":[{"name":"process","description":"Process name explicitly allowed","type":"text","hidden":false,"required":false,"index":false}]},{"name":"app_schemes","description":"macOS application schemes and handlers (e.g., http, file, mailto).","platforms":["darwin"],"columns":[{"name":"scheme","description":"Name of the scheme/protocol","type":"text","hidden":false,"required":false,"index":false},{"name":"handler","description":"Application label for the handler","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"1 if this handler is the OS default, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"external","description":"1 if this handler does NOT exist on macOS by default, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"protected","description":"1 if this handler is protected (reserved) by macOS, else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"apparmor_events","description":"Track AppArmor events.","platforms":["linux"],"columns":[{"name":"type","description":"Event type","type":"text","hidden":false,"required":false,"index":false},{"name":"message","description":"Raw audit message","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false},{"name":"apparmor","description":"Apparmor Status like ALLOWED, DENIED etc.","type":"text","hidden":false,"required":false,"index":false},{"name":"operation","description":"Permission requested by the process","type":"text","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent process PID","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"profile","description":"Apparmor profile name","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Process name","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"comm","description":"Command-line name of the command that was used to invoke the analyzed process","type":"text","hidden":false,"required":false,"index":false},{"name":"denied_mask","description":"Denied permissions for the process","type":"text","hidden":false,"required":false,"index":false},{"name":"capname","description":"Capability requested by the process","type":"text","hidden":false,"required":false,"index":false},{"name":"fsuid","description":"Filesystem user ID","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"ouid","description":"Object owner's user ID","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"capability","description":"Capability number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"requested_mask","description":"Requested access mask","type":"text","hidden":false,"required":false,"index":false},{"name":"info","description":"Additional information","type":"text","hidden":false,"required":false,"index":false},{"name":"error","description":"Error information","type":"text","hidden":false,"required":false,"index":false},{"name":"namespace","description":"AppArmor namespace","type":"text","hidden":false,"required":false,"index":false},{"name":"label","description":"AppArmor label","type":"text","hidden":false,"required":false,"index":false}]},{"name":"apparmor_profiles","description":"Track active AppArmor profiles.","platforms":["linux"],"columns":[{"name":"path","description":"Unique, aa-status compatible, policy identifier.","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Policy name.","type":"text","hidden":false,"required":false,"index":false},{"name":"attach","description":"Which executable(s) a profile will attach to.","type":"text","hidden":false,"required":false,"index":false},{"name":"mode","description":"How the policy is applied.","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1","description":"A unique hash that identifies this policy.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"appcompat_shims","description":"Application Compatibility shims are a way to persist malware. This table presents the AppCompat Shim information from the registry in a nice format. See http://files.brucon.org/2015/Tomczak_and_Ballenthin_Shims_for_the_Win.pdf for more details.","platforms":["windows"],"columns":[{"name":"executable","description":"Name of the executable that is being shimmed. This is pulled from the registry.","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"This is the path to the SDB database.","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Description of the SDB.","type":"text","hidden":false,"required":false,"index":false},{"name":"install_time","description":"Install time of the SDB","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of the SDB database.","type":"text","hidden":false,"required":false,"index":false},{"name":"sdb_id","description":"Unique GUID of the SDB.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"apps","description":"macOS applications installed in known search paths (e.g., /Applications).","platforms":["darwin"],"columns":[{"name":"name","description":"Name of the Name.app folder","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Absolute and full Name.app path","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_executable","description":"Info properties CFBundleExecutable label","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_identifier","description":"Info properties CFBundleIdentifier label","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_name","description":"Info properties CFBundleName label","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_short_version","description":"Info properties CFBundleShortVersionString label","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_version","description":"Info properties CFBundleVersion label","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_package_type","description":"Info properties CFBundlePackageType label","type":"text","hidden":false,"required":false,"index":false},{"name":"environment","description":"Application-set environment variables","type":"text","hidden":false,"required":false,"index":false},{"name":"element","description":"Does the app identify as a background agent","type":"text","hidden":false,"required":false,"index":false},{"name":"compiler","description":"Info properties DTCompiler label","type":"text","hidden":false,"required":false,"index":false},{"name":"development_region","description":"Info properties CFBundleDevelopmentRegion label","type":"text","hidden":false,"required":false,"index":false},{"name":"display_name","description":"Info properties CFBundleDisplayName label","type":"text","hidden":false,"required":false,"index":false},{"name":"info_string","description":"Info properties CFBundleGetInfoString label","type":"text","hidden":false,"required":false,"index":false},{"name":"minimum_system_version","description":"Minimum version of macOS required for the app to run","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"The UTI that categorizes the app for the App Store","type":"text","hidden":false,"required":false,"index":false},{"name":"applescript_enabled","description":"Info properties NSAppleScriptEnabled label","type":"text","hidden":false,"required":false,"index":false},{"name":"copyright","description":"Info properties NSHumanReadableCopyright label","type":"text","hidden":false,"required":false,"index":false},{"name":"last_opened_time","description":"The time that the app was last used","type":"double","hidden":false,"required":false,"index":false}]},{"name":"apt_sources","description":"Current list of APT repositories or software channels.","platforms":["linux"],"columns":[{"name":"name","description":"Repository name","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Source file","type":"text","hidden":false,"required":false,"index":false},{"name":"base_uri","description":"Repository base URI","type":"text","hidden":false,"required":false,"index":false},{"name":"release","description":"Release name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Repository source version","type":"text","hidden":false,"required":false,"index":false},{"name":"maintainer","description":"Repository maintainer","type":"text","hidden":false,"required":false,"index":false},{"name":"components","description":"Repository components","type":"text","hidden":false,"required":false,"index":false},{"name":"architectures","description":"Repository architectures","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"arp_cache","description":"Address resolution cache, both static and dynamic (from ARP, NDP).","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"address","description":"IPv4 address target","type":"text","hidden":false,"required":false,"index":false},{"name":"mac","description":"MAC address of broadcasted address","type":"text","hidden":false,"required":false,"index":false},{"name":"interface","description":"Interface of the network for the MAC","type":"text","hidden":false,"required":false,"index":false},{"name":"permanent","description":"1 for true, 0 for false","type":"text","hidden":false,"required":false,"index":false}]},{"name":"asl","description":"Queries the Apple System Log data structure for system events.","platforms":["darwin"],"columns":[{"name":"time","description":"Unix timestamp. Set automatically","type":"integer","hidden":false,"required":false,"index":false},{"name":"time_nano_sec","description":"Nanosecond time.","type":"integer","hidden":false,"required":false,"index":false},{"name":"host","description":"Sender's address (set by the server).","type":"text","hidden":false,"required":false,"index":false},{"name":"sender","description":"Sender's identification string. Default is process name.","type":"text","hidden":false,"required":false,"index":false},{"name":"facility","description":"Sender's facility. Default is 'user'.","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Sending process ID encoded as a string. Set automatically.","type":"integer","hidden":false,"required":false,"index":false},{"name":"gid","description":"GID that sent the log message (set by the server).","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"UID that sent the log message (set by the server).","type":"bigint","hidden":false,"required":false,"index":false},{"name":"level","description":"Log level number. See levels in asl.h.","type":"integer","hidden":false,"required":false,"index":false},{"name":"message","description":"Message text.","type":"text","hidden":false,"required":false,"index":false},{"name":"ref_pid","description":"Reference PID for messages proxied by launchd","type":"integer","hidden":false,"required":false,"index":false},{"name":"ref_proc","description":"Reference process for messages proxied by launchd","type":"text","hidden":false,"required":false,"index":false},{"name":"extra","description":"Extra columns, in JSON format. Queries against this column are performed entirely in SQLite, so do not benefit from efficient querying via asl.h.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"atom_packages","description":"Lists all atom packages in a directory or globally installed in a system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Package display name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Package supplied description","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Package's package.json path","type":"text","hidden":false,"required":false,"index":false},{"name":"license","description":"License for package","type":"text","hidden":false,"required":false,"index":false},{"name":"homepage","description":"Package supplied homepage","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"The local user that owns the plugin","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"augeas","description":"Configuration files parsed by augeas.","platforms":["darwin","linux"],"columns":[{"name":"node","description":"The node path of the configuration item","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"The value of the configuration item","type":"text","hidden":false,"required":false,"index":false},{"name":"label","description":"The label of the configuration item","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"The path to the configuration file","type":"text","hidden":false,"required":false,"index":false}]},{"name":"authenticode","description":"File (executable, bundle, installer, disk) code signing status.","platforms":["windows"],"columns":[{"name":"path","description":"Must provide a path or directory","type":"text","hidden":false,"required":true,"index":false},{"name":"original_program_name","description":"The original program name that the publisher has signed","type":"text","hidden":false,"required":false,"index":false},{"name":"serial_number","description":"The certificate serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer_name","description":"The certificate issuer name","type":"text","hidden":false,"required":false,"index":false},{"name":"subject_name","description":"The certificate subject name","type":"text","hidden":false,"required":false,"index":false},{"name":"result","description":"The signature check result","type":"text","hidden":false,"required":false,"index":false}]},{"name":"authorization_mechanisms","description":"macOS Authorization mechanisms database.","platforms":["darwin"],"columns":[{"name":"label","description":"Label of the authorization right","type":"text","hidden":false,"required":false,"index":false},{"name":"plugin","description":"Authorization plugin name","type":"text","hidden":false,"required":false,"index":false},{"name":"mechanism","description":"Name of the mechanism that will be called","type":"text","hidden":false,"required":false,"index":false},{"name":"privileged","description":"If privileged it will run as root, else as an anonymous user","type":"text","hidden":false,"required":false,"index":false},{"name":"entry","description":"The whole string entry","type":"text","hidden":false,"required":false,"index":false}]},{"name":"authorizations","description":"macOS Authorization rights database.","platforms":["darwin"],"columns":[{"name":"label","description":"Item name, usually in reverse domain format","type":"text","hidden":false,"required":false,"index":false},{"name":"modified","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"allow_root","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"timeout","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"tries","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"authenticate_user","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"shared","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"session_owner","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false}]},{"name":"authorized_keys","description":"A line-delimited authorized_keys table.","platforms":["darwin","linux"],"columns":[{"name":"uid","description":"The local owner of authorized_keys file","type":"bigint","hidden":false,"required":false,"index":false},{"name":"algorithm","description":"algorithm of key","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"parsed authorized keys line","type":"text","hidden":false,"required":false,"index":false},{"name":"key_file","description":"Path to the authorized_keys file","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"autoexec","description":"Aggregate of executables that will automatically execute on the target machine. This is an amalgamation of other tables like services, scheduled_tasks, startup_items and more.","platforms":["windows"],"columns":[{"name":"path","description":"Path to the executable","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the program","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Source table of the autoexec item","type":"text","hidden":false,"required":false,"index":false}]},{"name":"azure_instance_metadata","description":"Azure instance metadata.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"location","description":"Azure Region the VM is running in","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"offer","description":"Offer information for the VM image (Azure image gallery VMs only)","type":"text","hidden":false,"required":false,"index":false},{"name":"publisher","description":"Publisher of the VM image","type":"text","hidden":false,"required":false,"index":false},{"name":"sku","description":"SKU for the VM image","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Version of the VM image","type":"text","hidden":false,"required":false,"index":false},{"name":"os_type","description":"Linux or Windows","type":"text","hidden":false,"required":false,"index":false},{"name":"platform_update_domain","description":"Update domain the VM is running in","type":"text","hidden":false,"required":false,"index":false},{"name":"platform_fault_domain","description":"Fault domain the VM is running in","type":"text","hidden":false,"required":false,"index":false},{"name":"vm_id","description":"Unique identifier for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"vm_size","description":"VM size","type":"text","hidden":false,"required":false,"index":false},{"name":"subscription_id","description":"Azure subscription for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"resource_group_name","description":"Resource group for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"placement_group_id","description":"Placement group for the VM scale set","type":"text","hidden":false,"required":false,"index":false},{"name":"vm_scale_set_name","description":"VM scale set name","type":"text","hidden":false,"required":false,"index":false},{"name":"zone","description":"Availability zone of the VM","type":"text","hidden":false,"required":false,"index":false}]},{"name":"azure_instance_tags","description":"Azure instance tags.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"vm_id","description":"Unique identifier for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"The tag key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"The tag value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"background_activities_moderator","description":"Background Activities Moderator (BAM) tracks application execution.","platforms":["windows"],"columns":[{"name":"path","description":"Application file path.","type":"text","hidden":false,"required":false,"index":false},{"name":"last_execution_time","description":"Most recent time application was executed.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sid","description":"User SID.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"battery","description":"Provides information about the internal battery of a Macbook.","platforms":["darwin"],"columns":[{"name":"manufacturer","description":"The battery manufacturer's name","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacture_date","description":"The date the battery was manufactured UNIX Epoch","type":"integer","hidden":false,"required":false,"index":false},{"name":"model","description":"The battery's model number","type":"text","hidden":false,"required":false,"index":false},{"name":"serial_number","description":"The battery's unique serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"cycle_count","description":"The number of charge/discharge cycles","type":"integer","hidden":false,"required":false,"index":false},{"name":"health","description":"One of the following: \"Good\" describes a well-performing battery, \"Fair\" describes a functional battery with limited capacity, or \"Poor\" describes a battery that's not capable of providing power","type":"text","hidden":false,"required":false,"index":false},{"name":"condition","description":"One of the following: \"Normal\" indicates the condition of the battery is within normal tolerances, \"Service Needed\" indicates that the battery should be checked out by a licensed Mac repair service, \"Permanent Failure\" indicates the battery needs replacement","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"One of the following: \"AC Power\" indicates the battery is connected to an external power source, \"Battery Power\" indicates that the battery is drawing internal power, \"Off Line\" indicates the battery is off-line or no longer connected","type":"text","hidden":false,"required":false,"index":false},{"name":"charging","description":"1 if the battery is currently being charged by a power source. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"charged","description":"1 if the battery is currently completely charged. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"designed_capacity","description":"The battery's designed capacity in mAh","type":"integer","hidden":false,"required":false,"index":false},{"name":"max_capacity","description":"The battery's actual capacity when it is fully charged in mAh","type":"integer","hidden":false,"required":false,"index":false},{"name":"current_capacity","description":"The battery's current charged capacity in mAh","type":"integer","hidden":false,"required":false,"index":false},{"name":"percent_remaining","description":"The percentage of battery remaining before it is drained","type":"integer","hidden":false,"required":false,"index":false},{"name":"amperage","description":"The battery's current amperage in mA","type":"integer","hidden":false,"required":false,"index":false},{"name":"voltage","description":"The battery's current voltage in mV","type":"integer","hidden":false,"required":false,"index":false},{"name":"minutes_until_empty","description":"The number of minutes until the battery is fully depleted. This value is -1 if this time is still being calculated","type":"integer","hidden":false,"required":false,"index":false},{"name":"minutes_to_full_charge","description":"The number of minutes until the battery is fully charged. This value is -1 if this time is still being calculated","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"bitlocker_info","description":"Retrieve bitlocker status of the machine.","platforms":["windows"],"columns":[{"name":"device_id","description":"ID of the encrypted drive.","type":"text","hidden":false,"required":false,"index":false},{"name":"drive_letter","description":"Drive letter of the encrypted drive.","type":"text","hidden":false,"required":false,"index":false},{"name":"persistent_volume_id","description":"Persistent ID of the drive.","type":"text","hidden":false,"required":false,"index":false},{"name":"conversion_status","description":"The bitlocker conversion status of the drive.","type":"integer","hidden":false,"required":false,"index":false},{"name":"protection_status","description":"The bitlocker protection status of the drive.","type":"integer","hidden":false,"required":false,"index":false},{"name":"encryption_method","description":"The encryption type of the device.","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"The FVE metadata version of the drive.","type":"integer","hidden":false,"required":false,"index":false},{"name":"percentage_encrypted","description":"The percentage of the drive that is encrypted.","type":"integer","hidden":false,"required":false,"index":false},{"name":"lock_status","description":"The accessibility status of the drive from Windows.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"block_devices","description":"Block (buffered access) device file nodes: disks, ramdisks, and DMG containers.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"Block device name","type":"text","hidden":false,"required":false,"index":false},{"name":"parent","description":"Block device parent name","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor","description":"Block device vendor string","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"Block device model string identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Block device size in blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"block_size","description":"Block size in bytes","type":"integer","hidden":false,"required":false,"index":false},{"name":"uuid","description":"Block device Universally Unique Identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Block device type string","type":"text","hidden":false,"required":false,"index":false},{"name":"label","description":"Block device label string","type":"text","hidden":false,"required":false,"index":false}]},{"name":"bpf_process_events","description":"Track time/action process executions.","platforms":["linux"],"columns":[{"name":"tid","description":"Thread ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cid","description":"Cgroup ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"exit_code","description":"Exit code of the system call","type":"text","hidden":false,"required":false,"index":false},{"name":"probe_error","description":"Set to 1 if one or more buffers could not be captured","type":"integer","hidden":false,"required":false,"index":false},{"name":"syscall","description":"System call name","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Binary path","type":"text","hidden":false,"required":false,"index":false},{"name":"cwd","description":"Current working directory","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Command line arguments","type":"text","hidden":false,"required":false,"index":false},{"name":"duration","description":"How much time was spent inside the syscall (nsecs)","type":"integer","hidden":false,"required":false,"index":false},{"name":"json_cmdline","description":"Command line arguments, in JSON format","type":"text","hidden":true,"required":false,"index":false},{"name":"ntime","description":"The nsecs uptime timestamp as obtained from BPF","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":true,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"bpf_socket_events","description":"Track network socket opens and closes.","platforms":["linux"],"columns":[{"name":"tid","description":"Thread ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cid","description":"Cgroup ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"exit_code","description":"Exit code of the system call","type":"text","hidden":false,"required":false,"index":false},{"name":"probe_error","description":"Set to 1 if one or more buffers could not be captured","type":"integer","hidden":false,"required":false,"index":false},{"name":"syscall","description":"System call name","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of executed file","type":"text","hidden":false,"required":false,"index":false},{"name":"fd","description":"The file description for the process socket","type":"text","hidden":false,"required":false,"index":false},{"name":"family","description":"The Internet protocol family ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"The socket type","type":"integer","hidden":false,"required":false,"index":false},{"name":"protocol","description":"The network protocol ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"local_address","description":"Local address associated with socket","type":"text","hidden":false,"required":false,"index":false},{"name":"remote_address","description":"Remote address associated with socket","type":"text","hidden":false,"required":false,"index":false},{"name":"local_port","description":"Local network protocol port number","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_port","description":"Remote network protocol port number","type":"integer","hidden":false,"required":false,"index":false},{"name":"duration","description":"How much time was spent inside the syscall (nsecs)","type":"integer","hidden":false,"required":false,"index":false},{"name":"ntime","description":"The nsecs uptime timestamp as obtained from BPF","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":true,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"browser_plugins","description":"All C/NPAPI browser plugin details for all users. C/NPAPI has been deprecated on all major browsers. To query for plugins on modern browsers, try: `chrome_extensions` `firefox_addons` `safari_extensions`.","platforms":["darwin"],"columns":[{"name":"uid","description":"The local user that owns the plugin","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Plugin display name","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Plugin identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Plugin short version","type":"text","hidden":false,"required":false,"index":false},{"name":"sdk","description":"Build SDK used to compile plugin","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Plugin description text","type":"text","hidden":false,"required":false,"index":false},{"name":"development_region","description":"Plugin language-localization","type":"text","hidden":false,"required":false,"index":false},{"name":"native","description":"Plugin requires native execution","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to plugin bundle","type":"text","hidden":false,"required":false,"index":false},{"name":"disabled","description":"Is the plugin disabled. 1 = Disabled","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"carbon_black_info","description":"Returns info about a Carbon Black sensor install.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"sensor_id","description":"Sensor ID of the Carbon Black sensor","type":"integer","hidden":false,"required":false,"index":false},{"name":"config_name","description":"Sensor group","type":"text","hidden":false,"required":false,"index":false},{"name":"collect_store_files","description":"If the sensor is configured to send back binaries to the Carbon Black server","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_module_loads","description":"If the sensor is configured to capture module loads","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_module_info","description":"If the sensor is configured to collect metadata of binaries","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_file_mods","description":"If the sensor is configured to collect file modification events","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_reg_mods","description":"If the sensor is configured to collect registry modification events","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_net_conns","description":"If the sensor is configured to collect network connections","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_processes","description":"If the sensor is configured to process events","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_cross_processes","description":"If the sensor is configured to cross process events","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_emet_events","description":"If the sensor is configured to EMET events","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_data_file_writes","description":"If the sensor is configured to collect non binary file writes","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_process_user_context","description":"If the sensor is configured to collect the user running a process","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_sensor_operations","description":"Unknown","type":"integer","hidden":false,"required":false,"index":false},{"name":"log_file_disk_quota_mb","description":"Event file disk quota in MB","type":"integer","hidden":false,"required":false,"index":false},{"name":"log_file_disk_quota_percentage","description":"Event file disk quota in a percentage","type":"integer","hidden":false,"required":false,"index":false},{"name":"protection_disabled","description":"If the sensor is configured to report tamper events","type":"integer","hidden":false,"required":false,"index":false},{"name":"sensor_ip_addr","description":"IP address of the sensor","type":"text","hidden":false,"required":false,"index":false},{"name":"sensor_backend_server","description":"Carbon Black server","type":"text","hidden":false,"required":false,"index":false},{"name":"event_queue","description":"Size in bytes of Carbon Black event files on disk","type":"integer","hidden":false,"required":false,"index":false},{"name":"binary_queue","description":"Size in bytes of binaries waiting to be sent to Carbon Black server","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"carves","description":"List the set of completed and in-progress carves. If carve=1 then the query is treated as a new carve request.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"time","description":"Time at which the carve was kicked off","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sha256","description":"A SHA256 sum of the carved archive","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of the carved archive","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"The path of the requested carve","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Status of the carve, can be STARTING, PENDING, SUCCESS, or FAILED","type":"text","hidden":false,"required":false,"index":false},{"name":"carve_guid","description":"Identifying value of the carve session","type":"text","hidden":false,"required":false,"index":false},{"name":"request_id","description":"Identifying value of the carve request (e.g., scheduled query name, distributed request, etc)","type":"text","hidden":false,"required":false,"index":false},{"name":"carve","description":"Set this value to '1' to start a file carve","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"certificates","description":"Certificate Authorities installed in Keychains/ca-bundles.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"common_name","description":"Certificate CommonName","type":"text","hidden":false,"required":false,"index":false},{"name":"subject","description":"Certificate distinguished name (deprecated, use subject2)","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer","description":"Certificate issuer distinguished name (deprecated, use issuer2)","type":"text","hidden":false,"required":false,"index":false},{"name":"ca","description":"1 if CA: true (certificate is an authority) else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"self_signed","description":"1 if self-signed, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"not_valid_before","description":"Lower bound of valid date","type":"text","hidden":false,"required":false,"index":false},{"name":"not_valid_after","description":"Certificate expiration data","type":"text","hidden":false,"required":false,"index":false},{"name":"signing_algorithm","description":"Signing algorithm used","type":"text","hidden":false,"required":false,"index":false},{"name":"key_algorithm","description":"Key algorithm used","type":"text","hidden":false,"required":false,"index":false},{"name":"key_strength","description":"Key size used for RSA/DSA, or curve name","type":"text","hidden":false,"required":false,"index":false},{"name":"key_usage","description":"Certificate key usage and extended key usage","type":"text","hidden":false,"required":false,"index":false},{"name":"subject_key_id","description":"SKID an optionally included SHA1","type":"text","hidden":false,"required":false,"index":false},{"name":"authority_key_id","description":"AKID an optionally included SHA1","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1","description":"SHA1 hash of the raw certificate contents","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to Keychain or PEM bundle","type":"text","hidden":false,"required":false,"index":false},{"name":"serial","description":"Certificate serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"sid","description":"SID","type":"text","hidden":true,"required":false,"index":false},{"name":"store_location","description":"Certificate system store location","type":"text","hidden":true,"required":false,"index":false},{"name":"store","description":"Certificate system store","type":"text","hidden":true,"required":false,"index":false},{"name":"username","description":"Username","type":"text","hidden":true,"required":false,"index":false},{"name":"store_id","description":"Exists for service/user stores. Contains raw store id provided by WinAPI.","type":"text","hidden":true,"required":false,"index":false},{"name":"issuer2","description":"Certificate issuer distinguished name","type":"text","hidden":true,"required":false,"index":false},{"name":"subject2","description":"Certificate distinguished name","type":"text","hidden":true,"required":false,"index":false}]},{"name":"chassis_info","description":"Display information pertaining to the chassis and its security status.","platforms":["windows"],"columns":[{"name":"audible_alarm","description":"If TRUE, the frame is equipped with an audible alarm.","type":"text","hidden":false,"required":false,"index":false},{"name":"breach_description","description":"If provided, gives a more detailed description of a detected security breach.","type":"text","hidden":false,"required":false,"index":false},{"name":"chassis_types","description":"A comma-separated list of chassis types, such as Desktop or Laptop.","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"An extended description of the chassis if available.","type":"text","hidden":false,"required":false,"index":false},{"name":"lock","description":"If TRUE, the frame is equipped with a lock.","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"The manufacturer of the chassis.","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"The model of the chassis.","type":"text","hidden":false,"required":false,"index":false},{"name":"security_breach","description":"The physical status of the chassis such as Breach Successful, Breach Attempted, etc.","type":"text","hidden":false,"required":false,"index":false},{"name":"serial","description":"The serial number of the chassis.","type":"text","hidden":false,"required":false,"index":false},{"name":"smbios_tag","description":"The assigned asset tag number of the chassis.","type":"text","hidden":false,"required":false,"index":false},{"name":"sku","description":"The Stock Keeping Unit number if available.","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"If available, gives various operational or nonoperational statuses such as OK, Degraded, and Pred Fail.","type":"text","hidden":false,"required":false,"index":false},{"name":"visible_alarm","description":"If TRUE, the frame is equipped with a visual alarm.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"chocolatey_packages","description":"Chocolatey packages installed in a system.","platforms":["windows"],"columns":[{"name":"name","description":"Package display name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package-supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"summary","description":"Package-supplied summary","type":"text","hidden":false,"required":false,"index":false},{"name":"author","description":"Optional package author","type":"text","hidden":false,"required":false,"index":false},{"name":"license","description":"License under which package is launched","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path at which this package resides","type":"text","hidden":false,"required":false,"index":false}]},{"name":"chrome_extension_content_scripts","description":"Chrome browser extension content scripts.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"browser_type","description":"The browser type (Valid values: chrome, chromium, opera, yandex, brave)","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"The local user that owns the extension","type":"bigint","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Extension identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Extension-supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"script","description":"The content script used by the extension","type":"text","hidden":false,"required":false,"index":false},{"name":"match","description":"The pattern that the script is matched against","type":"text","hidden":false,"required":false,"index":false},{"name":"profile_path","description":"The profile path","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to extension folder","type":"text","hidden":false,"required":false,"index":false},{"name":"referenced","description":"1 if this extension is referenced by the Preferences file of the profile","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"chrome_extensions","description":"Chrome-based browser extensions.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"browser_type","description":"The browser type (Valid values: chrome, chromium, opera, yandex, brave, edge, edge_beta)","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"The local user that owns the extension","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Extension display name","type":"text","hidden":false,"required":false,"index":false},{"name":"profile","description":"The name of the Chrome profile that contains this extension","type":"text","hidden":false,"required":false,"index":false},{"name":"profile_path","description":"The profile path","type":"text","hidden":false,"required":false,"index":false},{"name":"referenced_identifier","description":"Extension identifier, as specified by the preferences file. Empty if the extension is not in the profile.","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Extension identifier, computed from its manifest. Empty in case of error.","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Extension-supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Extension-optional description","type":"text","hidden":false,"required":false,"index":false},{"name":"default_locale","description":"Default locale supported by extension","type":"text","hidden":false,"required":false,"index":false},{"name":"current_locale","description":"Current locale supported by extension","type":"text","hidden":false,"required":false,"index":false},{"name":"update_url","description":"Extension-supplied update URI","type":"text","hidden":false,"required":false,"index":false},{"name":"author","description":"Optional extension author","type":"text","hidden":false,"required":false,"index":false},{"name":"persistent","description":"1 If extension is persistent across all tabs else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to extension folder","type":"text","hidden":false,"required":false,"index":false},{"name":"permissions","description":"The permissions required by the extension","type":"text","hidden":false,"required":false,"index":false},{"name":"permissions_json","description":"The JSON-encoded permissions required by the extension","type":"text","hidden":true,"required":false,"index":false},{"name":"optional_permissions","description":"The permissions optionally required by the extensions","type":"text","hidden":false,"required":false,"index":false},{"name":"optional_permissions_json","description":"The JSON-encoded permissions optionally required by the extensions","type":"text","hidden":true,"required":false,"index":false},{"name":"manifest_hash","description":"The SHA256 hash of the manifest.json file","type":"text","hidden":false,"required":false,"index":false},{"name":"referenced","description":"1 if this extension is referenced by the Preferences file of the profile","type":"bigint","hidden":false,"required":false,"index":false},{"name":"from_webstore","description":"True if this extension was installed from the web store","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"1 if this extension is enabled","type":"text","hidden":false,"required":false,"index":false},{"name":"install_time","description":"Extension install time, in its original Webkit format","type":"text","hidden":false,"required":false,"index":false},{"name":"install_timestamp","description":"Extension install time, converted to unix time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"manifest_json","description":"The manifest file of the extension","type":"text","hidden":true,"required":false,"index":false},{"name":"key","description":"The extension key, from the manifest file","type":"text","hidden":true,"required":false,"index":false}]},{"name":"connectivity","description":"Provides the overall system's network state.","platforms":["windows"],"columns":[{"name":"disconnected","description":"True if the all interfaces are not connected to any network","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_no_traffic","description":"True if any interface is connected via IPv4, but has seen no traffic","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv6_no_traffic","description":"True if any interface is connected via IPv6, but has seen no traffic","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_subnet","description":"True if any interface is connected to the local subnet via IPv4","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_local_network","description":"True if any interface is connected to a routed network via IPv4","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_internet","description":"True if any interface is connected to the Internet via IPv4","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv6_subnet","description":"True if any interface is connected to the local subnet via IPv6","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv6_local_network","description":"True if any interface is connected to a routed network via IPv6","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv6_internet","description":"True if any interface is connected to the Internet via IPv6","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"cpu_info","description":"Retrieve cpu hardware info of the machine.","platforms":["linux","windows"],"columns":[{"name":"device_id","description":"The DeviceID of the CPU.","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"The model of the CPU.","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"The manufacturer of the CPU.","type":"text","hidden":false,"required":false,"index":false},{"name":"processor_type","description":"The processor type, such as Central, Math, or Video.","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu_status","description":"The current operating status of the CPU.","type":"integer","hidden":false,"required":false,"index":false},{"name":"number_of_cores","description":"The number of cores of the CPU.","type":"text","hidden":false,"required":false,"index":false},{"name":"logical_processors","description":"The number of logical processors of the CPU.","type":"integer","hidden":false,"required":false,"index":false},{"name":"address_width","description":"The width of the CPU address bus.","type":"text","hidden":false,"required":false,"index":false},{"name":"current_clock_speed","description":"The current frequency of the CPU.","type":"integer","hidden":false,"required":false,"index":false},{"name":"max_clock_speed","description":"The maximum possible frequency of the CPU.","type":"integer","hidden":false,"required":false,"index":false},{"name":"socket_designation","description":"The assigned socket on the board for the given CPU.","type":"text","hidden":false,"required":false,"index":false},{"name":"availability","description":"The availability and status of the CPU.","type":"text","hidden":true,"required":false,"index":false}]},{"name":"cpu_time","description":"Displays information from /proc/stat file about the time the cpu cores spent in different parts of the system.","platforms":["darwin","linux"],"columns":[{"name":"core","description":"Name of the cpu (core)","type":"integer","hidden":false,"required":false,"index":false},{"name":"user","description":"Time spent in user mode","type":"bigint","hidden":false,"required":false,"index":false},{"name":"nice","description":"Time spent in user mode with low priority (nice)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"system","description":"Time spent in system mode","type":"bigint","hidden":false,"required":false,"index":false},{"name":"idle","description":"Time spent in the idle task","type":"bigint","hidden":false,"required":false,"index":false},{"name":"iowait","description":"Time spent waiting for I/O to complete","type":"bigint","hidden":false,"required":false,"index":false},{"name":"irq","description":"Time spent servicing interrupts","type":"bigint","hidden":false,"required":false,"index":false},{"name":"softirq","description":"Time spent servicing softirqs","type":"bigint","hidden":false,"required":false,"index":false},{"name":"steal","description":"Time spent in other operating systems when running in a virtualized environment","type":"bigint","hidden":false,"required":false,"index":false},{"name":"guest","description":"Time spent running a virtual CPU for a guest OS under the control of the Linux kernel","type":"bigint","hidden":false,"required":false,"index":false},{"name":"guest_nice","description":"Time spent running a niced guest ","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"cpuid","description":"Useful CPU features from the cpuid ASM call.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"feature","description":"Present feature flags","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Bit value or string","type":"text","hidden":false,"required":false,"index":false},{"name":"output_register","description":"Register used to for feature value","type":"text","hidden":false,"required":false,"index":false},{"name":"output_bit","description":"Bit in register value for feature value","type":"integer","hidden":false,"required":false,"index":false},{"name":"input_eax","description":"Value of EAX used","type":"text","hidden":false,"required":false,"index":false}]},{"name":"crashes","description":"Application, System, and Mobile App crash logs.","platforms":["darwin"],"columns":[{"name":"type","description":"Type of crash log","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID of the crashed process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"crash_path","description":"Location of log file","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Identifier of the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Version info of the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent PID of the crashed process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"responsible","description":"Process responsible for the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID of the crashed process","type":"integer","hidden":false,"required":false,"index":false},{"name":"datetime","description":"Date/Time at which the crash occurred","type":"text","hidden":false,"required":false,"index":false},{"name":"crashed_thread","description":"Thread ID which crashed","type":"bigint","hidden":false,"required":false,"index":false},{"name":"stack_trace","description":"Most recent frame from the stack trace","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_type","description":"Exception type of the crash","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_codes","description":"Exception codes from the crash","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_notes","description":"Exception notes from the crash","type":"text","hidden":false,"required":false,"index":false},{"name":"registers","description":"The value of the system registers","type":"text","hidden":false,"required":false,"index":false}]},{"name":"crontab","description":"Line parsed values from system and user cron/tab.","platforms":["darwin","linux"],"columns":[{"name":"event","description":"The job @event name (rare)","type":"text","hidden":false,"required":false,"index":false},{"name":"minute","description":"The exact minute for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"hour","description":"The hour of the day for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"day_of_month","description":"The day of the month for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"month","description":"The month of the year for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"day_of_week","description":"The day of the week for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"command","description":"Raw command string","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"File parsed","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"cups_destinations","description":"Returns all configured printers.","platforms":["darwin"],"columns":[{"name":"name","description":"Name of the printer","type":"text","hidden":false,"required":false,"index":false},{"name":"option_name","description":"Option name","type":"text","hidden":false,"required":false,"index":false},{"name":"option_value","description":"Option value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"cups_jobs","description":"Returns all completed print jobs from cups.","platforms":["darwin"],"columns":[{"name":"title","description":"Title of the printed job","type":"text","hidden":false,"required":false,"index":false},{"name":"destination","description":"The printer the job was sent to","type":"text","hidden":false,"required":false,"index":false},{"name":"user","description":"The user who printed the job","type":"text","hidden":false,"required":false,"index":false},{"name":"format","description":"The format of the print job","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"The size of the print job","type":"integer","hidden":false,"required":false,"index":false},{"name":"completed_time","description":"When the job completed printing","type":"integer","hidden":false,"required":false,"index":false},{"name":"processing_time","description":"How long the job took to process","type":"integer","hidden":false,"required":false,"index":false},{"name":"creation_time","description":"When the print request was initiated","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"curl","description":"Perform an http request and return stats about it.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"url","description":"The url for the request","type":"text","hidden":false,"required":true,"index":false},{"name":"method","description":"The HTTP method for the request","type":"text","hidden":false,"required":false,"index":false},{"name":"user_agent","description":"The user-agent string to use for the request","type":"text","hidden":false,"required":false,"index":false},{"name":"response_code","description":"The HTTP status code for the response","type":"integer","hidden":false,"required":false,"index":false},{"name":"round_trip_time","description":"Time taken to complete the request","type":"bigint","hidden":false,"required":false,"index":false},{"name":"bytes","description":"Number of bytes in the response","type":"bigint","hidden":false,"required":false,"index":false},{"name":"result","description":"The HTTP response body","type":"text","hidden":false,"required":false,"index":false}]},{"name":"curl_certificate","description":"Inspect TLS certificates by connecting to input hostnames.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"hostname","description":"Hostname (domain[:port]) to CURL","type":"text","hidden":false,"required":true,"index":false},{"name":"common_name","description":"Common name of company issued to","type":"text","hidden":false,"required":false,"index":false},{"name":"organization","description":"Organization issued to","type":"text","hidden":false,"required":false,"index":false},{"name":"organization_unit","description":"Organization unit issued to","type":"text","hidden":false,"required":false,"index":false},{"name":"serial_number","description":"Certificate serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer_common_name","description":"Issuer common name","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer_organization","description":"Issuer organization","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer_organization_unit","description":"Issuer organization unit","type":"text","hidden":false,"required":false,"index":false},{"name":"valid_from","description":"Period of validity start date","type":"text","hidden":false,"required":false,"index":false},{"name":"valid_to","description":"Period of validity end date","type":"text","hidden":false,"required":false,"index":false},{"name":"sha256_fingerprint","description":"SHA-256 fingerprint","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1_fingerprint","description":"SHA1 fingerprint","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Version Number","type":"integer","hidden":false,"required":false,"index":false},{"name":"signature_algorithm","description":"Signature Algorithm","type":"text","hidden":false,"required":false,"index":false},{"name":"signature","description":"Signature","type":"text","hidden":false,"required":false,"index":false},{"name":"subject_key_identifier","description":"Subject Key Identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"authority_key_identifier","description":"Authority Key Identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"key_usage","description":"Usage of key in certificate","type":"text","hidden":false,"required":false,"index":false},{"name":"extended_key_usage","description":"Extended usage of key in certificate","type":"text","hidden":false,"required":false,"index":false},{"name":"policies","description":"Certificate Policies","type":"text","hidden":false,"required":false,"index":false},{"name":"subject_alternative_names","description":"Subject Alternative Name","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer_alternative_names","description":"Issuer Alternative Name","type":"text","hidden":false,"required":false,"index":false},{"name":"info_access","description":"Authority Information Access","type":"text","hidden":false,"required":false,"index":false},{"name":"subject_info_access","description":"Subject Information Access","type":"text","hidden":false,"required":false,"index":false},{"name":"policy_mappings","description":"Policy Mappings","type":"text","hidden":false,"required":false,"index":false},{"name":"has_expired","description":"1 if the certificate has expired, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"basic_constraint","description":"Basic Constraints","type":"text","hidden":false,"required":false,"index":false},{"name":"name_constraints","description":"Name Constraints","type":"text","hidden":false,"required":false,"index":false},{"name":"policy_constraints","description":"Policy Constraints","type":"text","hidden":false,"required":false,"index":false},{"name":"dump_certificate","description":"Set this value to '1' to dump certificate","type":"integer","hidden":true,"required":false,"index":false},{"name":"timeout","description":"Set this value to the timeout in seconds to complete the TLS handshake (default 4s, use 0 for no timeout)","type":"integer","hidden":true,"required":false,"index":false},{"name":"pem","description":"Certificate PEM format","type":"text","hidden":false,"required":false,"index":false}]},{"name":"deb_packages","description":"The installed DEB package database.","platforms":["linux"],"columns":[{"name":"name","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package version","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Package source","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Package size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"arch","description":"Package architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"revision","description":"Package revision","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Package status","type":"text","hidden":false,"required":false,"index":false},{"name":"maintainer","description":"Package maintainer","type":"text","hidden":false,"required":false,"index":false},{"name":"section","description":"Package section","type":"text","hidden":false,"required":false,"index":false},{"name":"priority","description":"Package priority","type":"text","hidden":false,"required":false,"index":false},{"name":"admindir","description":"libdpkg admindir. Defaults to /var/lib/dpkg","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"default_environment","description":"Default environment variables and values.","platforms":["windows"],"columns":[{"name":"variable","description":"Name of the environment variable","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Value of the environment variable","type":"text","hidden":false,"required":false,"index":false},{"name":"expand","description":"1 if the variable needs expanding, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"device_file","description":"Similar to the file table, but use TSK and allow block address access.","platforms":["darwin","linux"],"columns":[{"name":"device","description":"Absolute file path to device node","type":"text","hidden":false,"required":true,"index":false},{"name":"partition","description":"A partition number","type":"text","hidden":false,"required":true,"index":false},{"name":"path","description":"A logical path within the device node","type":"text","hidden":false,"required":false,"index":false},{"name":"filename","description":"Name portion of file path","type":"text","hidden":false,"required":false,"index":false},{"name":"inode","description":"Filesystem inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"Owning user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Owning group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mode","description":"Permission bits","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of file in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"block_size","description":"Block size of filesystem","type":"integer","hidden":false,"required":false,"index":false},{"name":"atime","description":"Last access time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mtime","description":"Last modification time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ctime","description":"Creation time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"hard_links","description":"Number of hard links","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"File status","type":"text","hidden":false,"required":false,"index":false}]},{"name":"device_firmware","description":"A best-effort list of discovered firmware versions.","platforms":["darwin"],"columns":[{"name":"type","description":"Type of device","type":"text","hidden":false,"required":false,"index":false},{"name":"device","description":"The device name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Firmware version","type":"text","hidden":false,"required":false,"index":false}]},{"name":"device_hash","description":"Similar to the hash table, but use TSK and allow block address access.","platforms":["darwin","linux"],"columns":[{"name":"device","description":"Absolute file path to device node","type":"text","hidden":false,"required":true,"index":false},{"name":"partition","description":"A partition number","type":"text","hidden":false,"required":true,"index":false},{"name":"inode","description":"Filesystem inode number","type":"bigint","hidden":false,"required":true,"index":false},{"name":"md5","description":"MD5 hash of provided inode data","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1","description":"SHA1 hash of provided inode data","type":"text","hidden":false,"required":false,"index":false},{"name":"sha256","description":"SHA256 hash of provided inode data","type":"text","hidden":false,"required":false,"index":false}]},{"name":"device_partitions","description":"Use TSK to enumerate details about partitions on a disk device.","platforms":["darwin","linux"],"columns":[{"name":"device","description":"Absolute file path to device node","type":"text","hidden":false,"required":true,"index":false},{"name":"partition","description":"A partition number or description","type":"integer","hidden":false,"required":false,"index":false},{"name":"label","description":"","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"","type":"text","hidden":false,"required":false,"index":false},{"name":"offset","description":"","type":"bigint","hidden":false,"required":false,"index":false},{"name":"blocks_size","description":"Byte size of each block","type":"bigint","hidden":false,"required":false,"index":false},{"name":"blocks","description":"Number of blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inodes","description":"Number of meta nodes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"flags","description":"","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"disk_encryption","description":"Disk encryption status and information.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"Disk name","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"Disk Universally Unique Identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"encrypted","description":"1 If encrypted: true (disk is encrypted), else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Description of cipher type and mode if available","type":"text","hidden":false,"required":false,"index":false},{"name":"encryption_status","description":"Disk encryption status with one of following values: encrypted | not encrypted | undefined","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"Currently authenticated user if available","type":"text","hidden":false,"required":false,"index":false},{"name":"user_uuid","description":"UUID of authenticated user if available","type":"text","hidden":false,"required":false,"index":false},{"name":"filevault_status","description":"FileVault status with one of following values: on | off | unknown","type":"text","hidden":false,"required":false,"index":false}]},{"name":"disk_events","description":"Track DMG disk image events (appearance/disappearance) when opened.","platforms":["darwin"],"columns":[{"name":"action","description":"Appear or disappear","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of the DMG file accessed","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Disk event name","type":"text","hidden":false,"required":false,"index":false},{"name":"device","description":"Disk event BSD name","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"UUID of the volume inside DMG if available","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of partition in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ejectable","description":"1 if ejectable, 0 if not","type":"integer","hidden":false,"required":false,"index":false},{"name":"mountable","description":"1 if mountable, 0 if not","type":"integer","hidden":false,"required":false,"index":false},{"name":"writable","description":"1 if writable, 0 if not","type":"integer","hidden":false,"required":false,"index":false},{"name":"content","description":"Disk event content","type":"text","hidden":false,"required":false,"index":false},{"name":"media_name","description":"Disk event media name string","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor","description":"Disk event vendor string","type":"text","hidden":false,"required":false,"index":false},{"name":"filesystem","description":"Filesystem if available","type":"text","hidden":false,"required":false,"index":false},{"name":"checksum","description":"UDIF Master checksum if available (CRC32)","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of appearance/disappearance in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"disk_info","description":"Retrieve basic information about the physical disks of a system.","platforms":["windows"],"columns":[{"name":"partitions","description":"Number of detected partitions on disk.","type":"integer","hidden":false,"required":false,"index":false},{"name":"disk_index","description":"Physical drive number of the disk.","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"The interface type of the disk.","type":"text","hidden":false,"required":false,"index":false},{"name":"id","description":"The unique identifier of the drive on the system.","type":"text","hidden":false,"required":false,"index":false},{"name":"pnp_device_id","description":"The unique identifier of the drive on the system.","type":"text","hidden":false,"required":false,"index":false},{"name":"disk_size","description":"Size of the disk.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"The manufacturer of the disk.","type":"text","hidden":false,"required":false,"index":false},{"name":"hardware_model","description":"Hard drive model.","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"The label of the disk object.","type":"text","hidden":false,"required":false,"index":false},{"name":"serial","description":"The serial number of the disk.","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"The OS's description of the disk.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"dns_cache","description":"Enumerate the DNS cache using the undocumented DnsGetCacheDataTable function in dnsapi.dll.","platforms":["windows"],"columns":[{"name":"name","description":"DNS record name","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"DNS record type","type":"text","hidden":false,"required":false,"index":false},{"name":"flags","description":"DNS record flags","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"dns_resolvers","description":"Resolvers used by this host.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Address type index or order","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Address type: sortlist, nameserver, search","type":"text","hidden":false,"required":false,"index":false},{"name":"address","description":"Resolver IP/IPv6 address","type":"text","hidden":false,"required":false,"index":false},{"name":"netmask","description":"Address (sortlist) netmask length","type":"text","hidden":false,"required":false,"index":false},{"name":"options","description":"Resolver options","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"docker_container_envs","description":"Docker container environment variables.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Environment variable name","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Environment variable value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_container_fs_changes","description":"Changes to files or directories on container's filesystem.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":true,"index":false},{"name":"path","description":"FIle or directory path relative to rootfs","type":"text","hidden":false,"required":false,"index":false},{"name":"change_type","description":"Type of change: C:Modified, A:Added, D:Deleted","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_container_labels","description":"Docker container labels.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Label key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Optional label value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_container_mounts","description":"Docker container mounts.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of mount (bind, volume)","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Optional mount name","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Source path on host","type":"text","hidden":false,"required":false,"index":false},{"name":"destination","description":"Destination path inside container","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"Driver providing the mount","type":"text","hidden":false,"required":false,"index":false},{"name":"mode","description":"Mount options (rw, ro)","type":"text","hidden":false,"required":false,"index":false},{"name":"rw","description":"1 if read/write. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"propagation","description":"Mount propagation","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_container_networks","description":"Docker container networks.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Network name","type":"text","hidden":false,"required":false,"index":false},{"name":"network_id","description":"Network ID","type":"text","hidden":false,"required":false,"index":false},{"name":"endpoint_id","description":"Endpoint ID","type":"text","hidden":false,"required":false,"index":false},{"name":"gateway","description":"Gateway","type":"text","hidden":false,"required":false,"index":false},{"name":"ip_address","description":"IP address","type":"text","hidden":false,"required":false,"index":false},{"name":"ip_prefix_len","description":"IP subnet prefix length","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv6_gateway","description":"IPv6 gateway","type":"text","hidden":false,"required":false,"index":false},{"name":"ipv6_address","description":"IPv6 address","type":"text","hidden":false,"required":false,"index":false},{"name":"ipv6_prefix_len","description":"IPv6 subnet prefix length","type":"integer","hidden":false,"required":false,"index":false},{"name":"mac_address","description":"MAC address","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_container_ports","description":"Docker container ports.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Protocol (tcp, udp)","type":"text","hidden":false,"required":false,"index":false},{"name":"port","description":"Port inside the container","type":"integer","hidden":false,"required":false,"index":false},{"name":"host_ip","description":"Host IP address on which public port is listening","type":"text","hidden":false,"required":false,"index":false},{"name":"host_port","description":"Host port","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"docker_container_processes","description":"Docker container processes.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":true,"index":false},{"name":"pid","description":"Process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"The process path or shorthand argv[0]","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Complete argv","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Process state","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"euid","description":"Effective user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"egid","description":"Effective group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"suid","description":"Saved user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sgid","description":"Saved group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"wired_size","description":"Bytes of unpageable memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"resident_size","description":"Bytes of private memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"total_size","description":"Total virtual memory size","type":"bigint","hidden":false,"required":false,"index":false},{"name":"start_time","description":"Process start in seconds since boot (non-sleeping)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Process parent's PID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pgroup","description":"Process group","type":"bigint","hidden":false,"required":false,"index":false},{"name":"threads","description":"Number of threads used by process","type":"integer","hidden":false,"required":false,"index":false},{"name":"nice","description":"Process nice level (-20 to 20, default 0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"user","description":"User name","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Cumulative CPU time. [DD-]HH:MM:SS format","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu","description":"CPU utilization as percentage","type":"double","hidden":false,"required":false,"index":false},{"name":"mem","description":"Memory utilization as percentage","type":"double","hidden":false,"required":false,"index":false}]},{"name":"docker_container_stats","description":"Docker container statistics. Queries on this table take at least one second.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":true,"index":false},{"name":"name","description":"Container name","type":"text","hidden":false,"required":false,"index":false},{"name":"pids","description":"Number of processes","type":"integer","hidden":false,"required":false,"index":false},{"name":"read","description":"UNIX time when stats were read","type":"bigint","hidden":false,"required":false,"index":false},{"name":"preread","description":"UNIX time when stats were last read","type":"bigint","hidden":false,"required":false,"index":false},{"name":"interval","description":"Difference between read and preread in nano-seconds","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_read","description":"Total disk read bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_write","description":"Total disk write bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"num_procs","description":"Number of processors","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_total_usage","description":"Total CPU usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cpu_kernelmode_usage","description":"CPU kernel mode usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cpu_usermode_usage","description":"CPU user mode usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"system_cpu_usage","description":"CPU system usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"online_cpus","description":"Online CPUs","type":"integer","hidden":false,"required":false,"index":false},{"name":"pre_cpu_total_usage","description":"Last read total CPU usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pre_cpu_kernelmode_usage","description":"Last read CPU kernel mode usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pre_cpu_usermode_usage","description":"Last read CPU user mode usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pre_system_cpu_usage","description":"Last read CPU system usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pre_online_cpus","description":"Last read online CPUs","type":"integer","hidden":false,"required":false,"index":false},{"name":"memory_usage","description":"Memory usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"memory_max_usage","description":"Memory maximum usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"memory_limit","description":"Memory limit","type":"bigint","hidden":false,"required":false,"index":false},{"name":"network_rx_bytes","description":"Total network bytes read","type":"bigint","hidden":false,"required":false,"index":false},{"name":"network_tx_bytes","description":"Total network bytes transmitted","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"docker_containers","description":"Docker containers information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Container name","type":"text","hidden":false,"required":false,"index":false},{"name":"image","description":"Docker image (name) used to launch this container","type":"text","hidden":false,"required":false,"index":false},{"name":"image_id","description":"Docker image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"command","description":"Command with arguments","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Time of creation as UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"state","description":"Container state (created, restarting, running, removing, paused, exited, dead)","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Container status information","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Identifier of the initial process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Container path","type":"text","hidden":false,"required":false,"index":false},{"name":"config_entrypoint","description":"Container entrypoint(s)","type":"text","hidden":false,"required":false,"index":false},{"name":"started_at","description":"Container start time as string","type":"text","hidden":false,"required":false,"index":false},{"name":"finished_at","description":"Container finish time as string","type":"text","hidden":false,"required":false,"index":false},{"name":"privileged","description":"Is the container privileged","type":"integer","hidden":false,"required":false,"index":false},{"name":"security_options","description":"List of container security options","type":"text","hidden":false,"required":false,"index":false},{"name":"env_variables","description":"Container environmental variables","type":"text","hidden":false,"required":false,"index":false},{"name":"readonly_rootfs","description":"Is the root filesystem mounted as read only","type":"integer","hidden":false,"required":false,"index":false},{"name":"cgroup_namespace","description":"cgroup namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"ipc_namespace","description":"IPC namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"mnt_namespace","description":"Mount namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"net_namespace","description":"Network namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"pid_namespace","description":"PID namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"user_namespace","description":"User namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"uts_namespace","description":"UTS namespace","type":"text","hidden":true,"required":false,"index":false}]},{"name":"docker_image_history","description":"Docker image history information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Time of creation as UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of instruction in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"created_by","description":"Created by instruction","type":"text","hidden":false,"required":false,"index":false},{"name":"tags","description":"Comma-separated list of tags","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Instruction comment","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_image_labels","description":"Docker image labels.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Label key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Optional label value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_image_layers","description":"Docker image layers information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"layer_id","description":"Layer ID","type":"text","hidden":false,"required":false,"index":false},{"name":"layer_order","description":"Layer Order (1 = base layer)","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"docker_images","description":"Docker images information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Time of creation as UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"size_bytes","description":"Size of image in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"tags","description":"Comma-separated list of repository tags","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_info","description":"Docker system information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Docker system ID","type":"text","hidden":false,"required":false,"index":false},{"name":"containers","description":"Total number of containers","type":"integer","hidden":false,"required":false,"index":false},{"name":"containers_running","description":"Number of containers currently running","type":"integer","hidden":false,"required":false,"index":false},{"name":"containers_paused","description":"Number of containers in paused state","type":"integer","hidden":false,"required":false,"index":false},{"name":"containers_stopped","description":"Number of containers in stopped state","type":"integer","hidden":false,"required":false,"index":false},{"name":"images","description":"Number of images","type":"integer","hidden":false,"required":false,"index":false},{"name":"storage_driver","description":"Storage driver","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_limit","description":"1 if memory limit support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"swap_limit","description":"1 if swap limit support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"kernel_memory","description":"1 if kernel memory limit support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_cfs_period","description":"1 if CPU Completely Fair Scheduler (CFS) period support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_cfs_quota","description":"1 if CPU Completely Fair Scheduler (CFS) quota support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_shares","description":"1 if CPU share weighting support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_set","description":"1 if CPU set selection support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_forwarding","description":"1 if IPv4 forwarding is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"bridge_nf_iptables","description":"1 if bridge netfilter iptables is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"bridge_nf_ip6tables","description":"1 if bridge netfilter ip6tables is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"oom_kill_disable","description":"1 if Out-of-memory kill is disabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"logging_driver","description":"Logging driver","type":"text","hidden":false,"required":false,"index":false},{"name":"cgroup_driver","description":"Control groups driver","type":"text","hidden":false,"required":false,"index":false},{"name":"kernel_version","description":"Kernel version","type":"text","hidden":false,"required":false,"index":false},{"name":"os","description":"Operating system","type":"text","hidden":false,"required":false,"index":false},{"name":"os_type","description":"Operating system type","type":"text","hidden":false,"required":false,"index":false},{"name":"architecture","description":"Hardware architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"cpus","description":"Number of CPUs","type":"integer","hidden":false,"required":false,"index":false},{"name":"memory","description":"Total memory","type":"bigint","hidden":false,"required":false,"index":false},{"name":"http_proxy","description":"HTTP proxy","type":"text","hidden":false,"required":false,"index":false},{"name":"https_proxy","description":"HTTPS proxy","type":"text","hidden":false,"required":false,"index":false},{"name":"no_proxy","description":"Comma-separated list of domain extensions proxy should not be used for","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the docker host","type":"text","hidden":false,"required":false,"index":false},{"name":"server_version","description":"Server version","type":"text","hidden":false,"required":false,"index":false},{"name":"root_dir","description":"Docker root directory","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_network_labels","description":"Docker network labels.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Network ID","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Label key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Optional label value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_networks","description":"Docker networks information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Network ID","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Network name","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"Network driver","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Time of creation as UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"enable_ipv6","description":"1 if IPv6 is enabled on this network. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"subnet","description":"Network subnet","type":"text","hidden":false,"required":false,"index":false},{"name":"gateway","description":"Network gateway","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_version","description":"Docker version information.","platforms":["darwin","linux"],"columns":[{"name":"version","description":"Docker version","type":"text","hidden":false,"required":false,"index":false},{"name":"api_version","description":"API version","type":"text","hidden":false,"required":false,"index":false},{"name":"min_api_version","description":"Minimum API version supported","type":"text","hidden":false,"required":false,"index":false},{"name":"git_commit","description":"Docker build git commit","type":"text","hidden":false,"required":false,"index":false},{"name":"go_version","description":"Go version","type":"text","hidden":false,"required":false,"index":false},{"name":"os","description":"Operating system","type":"text","hidden":false,"required":false,"index":false},{"name":"arch","description":"Hardware architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"kernel_version","description":"Kernel version","type":"text","hidden":false,"required":false,"index":false},{"name":"build_time","description":"Build time","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_volume_labels","description":"Docker volume labels.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"Volume name","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Label key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Optional label value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_volumes","description":"Docker volumes information.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"Volume name","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"Volume driver","type":"text","hidden":false,"required":false,"index":false},{"name":"mount_point","description":"Mount point","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Volume type","type":"text","hidden":false,"required":false,"index":false}]},{"name":"drivers","description":"Details for in-use Windows device drivers. This does not display installed but unused drivers.","platforms":["windows"],"columns":[{"name":"device_id","description":"Device ID","type":"text","hidden":false,"required":false,"index":false},{"name":"device_name","description":"Device name","type":"text","hidden":false,"required":false,"index":false},{"name":"image","description":"Path to driver image file","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Driver description","type":"text","hidden":false,"required":false,"index":false},{"name":"service","description":"Driver service name, if one exists","type":"text","hidden":false,"required":false,"index":false},{"name":"service_key","description":"Driver service registry key","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Driver version","type":"text","hidden":false,"required":false,"index":false},{"name":"inf","description":"Associated inf file","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"Device/driver class name","type":"text","hidden":false,"required":false,"index":false},{"name":"provider","description":"Driver provider","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"Device manufacturer","type":"text","hidden":false,"required":false,"index":false},{"name":"driver_key","description":"Driver key","type":"text","hidden":false,"required":false,"index":false},{"name":"date","description":"Driver date","type":"bigint","hidden":false,"required":false,"index":false},{"name":"signed","description":"Whether the driver is signed or not","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"ec2_instance_metadata","description":"EC2 instance metadata.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"instance_id","description":"EC2 instance ID","type":"text","hidden":false,"required":false,"index":false},{"name":"instance_type","description":"EC2 instance type","type":"text","hidden":false,"required":false,"index":false},{"name":"architecture","description":"Hardware architecture of this EC2 instance","type":"text","hidden":false,"required":false,"index":false},{"name":"region","description":"AWS region in which this instance launched","type":"text","hidden":false,"required":false,"index":false},{"name":"availability_zone","description":"Availability zone in which this instance launched","type":"text","hidden":false,"required":false,"index":false},{"name":"local_hostname","description":"Private IPv4 DNS hostname of the first interface of this instance","type":"text","hidden":false,"required":false,"index":false},{"name":"local_ipv4","description":"Private IPv4 address of the first interface of this instance","type":"text","hidden":false,"required":false,"index":false},{"name":"mac","description":"MAC address for the first network interface of this EC2 instance","type":"text","hidden":false,"required":false,"index":false},{"name":"security_groups","description":"Comma separated list of security group names","type":"text","hidden":false,"required":false,"index":false},{"name":"iam_arn","description":"If there is an IAM role associated with the instance, contains instance profile ARN","type":"text","hidden":false,"required":false,"index":false},{"name":"ami_id","description":"AMI ID used to launch this EC2 instance","type":"text","hidden":false,"required":false,"index":false},{"name":"reservation_id","description":"ID of the reservation","type":"text","hidden":false,"required":false,"index":false},{"name":"account_id","description":"AWS account ID which owns this EC2 instance","type":"text","hidden":false,"required":false,"index":false},{"name":"ssh_public_key","description":"SSH public key. Only available if supplied at instance launch time","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ec2_instance_tags","description":"EC2 instance tag key value pairs.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"instance_id","description":"EC2 instance ID","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Tag key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Tag value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"es_process_events","description":"Process execution events from EndpointSecurity.","platforms":["darwin"],"columns":[{"name":"version","description":"Version of EndpointSecurity event","type":"integer","hidden":false,"required":false,"index":false},{"name":"seq_num","description":"Per event sequence number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"global_seq_num","description":"Global sequence number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of executed file","type":"text","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"original_parent","description":"Original parent process ID in case of reparenting","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Command line arguments (argv)","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline_count","description":"Number of command line arguments","type":"bigint","hidden":false,"required":false,"index":false},{"name":"env","description":"Environment variables delimited by spaces","type":"text","hidden":false,"required":false,"index":false},{"name":"env_count","description":"Number of environment variables","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cwd","description":"The process current working directory","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID of the process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"euid","description":"Effective User ID of the process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID of the process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"egid","description":"Effective Group ID of the process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"username","description":"Username","type":"text","hidden":false,"required":false,"index":false},{"name":"signing_id","description":"Signature identifier of the process","type":"text","hidden":false,"required":false,"index":false},{"name":"team_id","description":"Team identifier of thd process","type":"text","hidden":false,"required":false,"index":false},{"name":"cdhash","description":"Codesigning hash of the process","type":"text","hidden":false,"required":false,"index":false},{"name":"platform_binary","description":"Indicates if the binary is Apple signed binary (1) or not (0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"exit_code","description":"Exit code of a process in case of an exit event","type":"integer","hidden":false,"required":false,"index":false},{"name":"child_pid","description":"Process ID of a child process in case of a fork event","type":"bigint","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"event_type","description":"Type of EndpointSecurity event","type":"text","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"es_process_file_events","description":"Process execution events from EndpointSecurity.","platforms":["darwin"],"columns":[{"name":"version","description":"Version of EndpointSecurity event","type":"integer","hidden":false,"required":false,"index":false},{"name":"seq_num","description":"Per event sequence number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"global_seq_num","description":"Global sequence number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of executed file","type":"text","hidden":false,"required":false,"index":false},{"name":"filename","description":"The source or target filename for the event","type":"text","hidden":false,"required":false,"index":false},{"name":"dest_filename","description":"Destination filename for the event","type":"text","hidden":false,"required":false,"index":false},{"name":"event_type","description":"Type of EndpointSecurity event","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"etc_hosts","description":"Line-parsed /etc/hosts.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"address","description":"IP address mapping","type":"text","hidden":false,"required":false,"index":false},{"name":"hostnames","description":"Raw hosts mapping","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"etc_protocols","description":"Line-parsed /etc/protocols.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Protocol name","type":"text","hidden":false,"required":false,"index":false},{"name":"number","description":"Protocol number","type":"integer","hidden":false,"required":false,"index":false},{"name":"alias","description":"Protocol alias","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Comment with protocol description","type":"text","hidden":false,"required":false,"index":false}]},{"name":"etc_services","description":"Line-parsed /etc/services.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Service name","type":"text","hidden":false,"required":false,"index":false},{"name":"port","description":"Service port number","type":"integer","hidden":false,"required":false,"index":false},{"name":"protocol","description":"Transport protocol (TCP/UDP)","type":"text","hidden":false,"required":false,"index":false},{"name":"aliases","description":"Optional space separated list of other names for a service","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Optional comment for a service.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"event_taps","description":"Returns information about installed event taps.","platforms":["darwin"],"columns":[{"name":"enabled","description":"Is the Event Tap enabled","type":"integer","hidden":false,"required":false,"index":false},{"name":"event_tap_id","description":"Unique ID for the Tap","type":"integer","hidden":false,"required":false,"index":false},{"name":"event_tapped","description":"The mask that identifies the set of events to be observed.","type":"text","hidden":false,"required":false,"index":false},{"name":"process_being_tapped","description":"The process ID of the target application","type":"integer","hidden":false,"required":false,"index":false},{"name":"tapping_process","description":"The process ID of the application that created the event tap.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"extended_attributes","description":"Returns the extended attributes for files (similar to Windows ADS).","platforms":["darwin","linux"],"columns":[{"name":"path","description":"Absolute file path","type":"text","hidden":false,"required":true,"index":false},{"name":"directory","description":"Directory of file(s)","type":"text","hidden":false,"required":true,"index":false},{"name":"key","description":"Name of the value generated from the extended attribute","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"The parsed information from the attribute","type":"text","hidden":false,"required":false,"index":false},{"name":"base64","description":"1 if the value is base64 encoded else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"fan_speed_sensors","description":"Fan speeds.","platforms":["darwin"],"columns":[{"name":"fan","description":"Fan number","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Fan name","type":"text","hidden":false,"required":false,"index":false},{"name":"actual","description":"Actual speed","type":"integer","hidden":false,"required":false,"index":false},{"name":"min","description":"Minimum speed","type":"integer","hidden":false,"required":false,"index":false},{"name":"max","description":"Maximum speed","type":"integer","hidden":false,"required":false,"index":false},{"name":"target","description":"Target speed","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"fbsd_kmods","description":"Loaded FreeBSD kernel modules.","platforms":["freebsd"],"columns":[{"name":"name","description":"Module name","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of module content","type":"integer","hidden":false,"required":false,"index":false},{"name":"refs","description":"Module reverse dependencies","type":"integer","hidden":false,"required":false,"index":false},{"name":"address","description":"Kernel module address","type":"text","hidden":false,"required":false,"index":false}]},{"name":"file","description":"Interactive filesystem attributes and metadata.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"path","description":"Absolute file path","type":"text","hidden":false,"required":true,"index":false},{"name":"directory","description":"Directory of file(s)","type":"text","hidden":false,"required":true,"index":false},{"name":"filename","description":"Name portion of file path","type":"text","hidden":false,"required":false,"index":false},{"name":"inode","description":"Filesystem inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"Owning user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Owning group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mode","description":"Permission bits","type":"text","hidden":false,"required":false,"index":false},{"name":"device","description":"Device ID (optional)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of file in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"block_size","description":"Block size of filesystem","type":"integer","hidden":false,"required":false,"index":false},{"name":"atime","description":"Last access time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mtime","description":"Last modification time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ctime","description":"Last status change time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"btime","description":"(B)irth or (cr)eate time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"hard_links","description":"Number of hard links","type":"integer","hidden":false,"required":false,"index":false},{"name":"symlink","description":"1 if the path is a symlink, otherwise 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"File status","type":"text","hidden":false,"required":false,"index":false},{"name":"attributes","description":"File attrib string. See: https://ss64.com/nt/attrib.html","type":"text","hidden":true,"required":false,"index":false},{"name":"volume_serial","description":"Volume serial number","type":"text","hidden":true,"required":false,"index":false},{"name":"file_id","description":"file ID","type":"text","hidden":true,"required":false,"index":false},{"name":"file_version","description":"File version","type":"text","hidden":true,"required":false,"index":false},{"name":"product_version","description":"File product version","type":"text","hidden":true,"required":false,"index":false},{"name":"original_filename","description":"(Executable files only) Original filename","type":"text","hidden":true,"required":false,"index":false},{"name":"bsd_flags","description":"The BSD file flags (chflags). Possible values: NODUMP, UF_IMMUTABLE, UF_APPEND, OPAQUE, HIDDEN, ARCHIVED, SF_IMMUTABLE, SF_APPEND","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"file_events","description":"Track time/action changes to files specified in configuration data.","platforms":["darwin","linux"],"columns":[{"name":"target_path","description":"The path associated with the event","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"The category of the file defined in the config","type":"text","hidden":false,"required":false,"index":false},{"name":"action","description":"Change action (UPDATE, REMOVE, etc)","type":"text","hidden":false,"required":false,"index":false},{"name":"transaction_id","description":"ID used during bulk update","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inode","description":"Filesystem inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"Owning user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Owning group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mode","description":"Permission bits","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of file in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"atime","description":"Last access time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mtime","description":"Last modification time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ctime","description":"Last status change time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"md5","description":"The MD5 of the file after change","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1","description":"The SHA1 of the file after change","type":"text","hidden":false,"required":false,"index":false},{"name":"sha256","description":"The SHA256 of the file after change","type":"text","hidden":false,"required":false,"index":false},{"name":"hashed","description":"1 if the file was hashed, 0 if not, -1 if hashing failed","type":"integer","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of file event","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"firefox_addons","description":"Firefox browser extensions, webapps, and addons.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"The local user that owns the addon","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Addon display name","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Addon identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"creator","description":"Addon-supported creator string","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Extension, addon, webapp","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Addon-supplied version string","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Addon-supplied description string","type":"text","hidden":false,"required":false,"index":false},{"name":"source_url","description":"URL that installed the addon","type":"text","hidden":false,"required":false,"index":false},{"name":"visible","description":"1 If the addon is shown in browser else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"active","description":"1 If the addon is active else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"disabled","description":"1 If the addon is application-disabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"autoupdate","description":"1 If the addon applies background updates else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"native","description":"1 If the addon includes binary components else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"location","description":"Global, profile location","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to plugin bundle","type":"text","hidden":false,"required":false,"index":false}]},{"name":"gatekeeper","description":"macOS Gatekeeper Details.","platforms":["darwin"],"columns":[{"name":"assessments_enabled","description":"1 If a Gatekeeper is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"dev_id_enabled","description":"1 If a Gatekeeper allows execution from identified developers else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"version","description":"Version of Gatekeeper's gke.bundle","type":"text","hidden":false,"required":false,"index":false},{"name":"opaque_version","description":"Version of Gatekeeper's gkopaque.bundle","type":"text","hidden":false,"required":false,"index":false}]},{"name":"gatekeeper_approved_apps","description":"Gatekeeper apps a user has allowed to run.","platforms":["darwin"],"columns":[{"name":"path","description":"Path of executable allowed to run","type":"text","hidden":false,"required":false,"index":false},{"name":"requirement","description":"Code signing requirement language","type":"text","hidden":false,"required":false,"index":false},{"name":"ctime","description":"Last change time","type":"double","hidden":false,"required":false,"index":false},{"name":"mtime","description":"Last modification time","type":"double","hidden":false,"required":false,"index":false}]},{"name":"groups","description":"Local system groups.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"gid","description":"Unsigned int64 group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid_signed","description":"A signed int64 version of gid","type":"bigint","hidden":false,"required":false,"index":false},{"name":"groupname","description":"Canonical local group name","type":"text","hidden":false,"required":false,"index":false},{"name":"group_sid","description":"Unique group ID","type":"text","hidden":true,"required":false,"index":false},{"name":"comment","description":"Remarks or comments associated with the group","type":"text","hidden":true,"required":false,"index":false},{"name":"is_hidden","description":"IsHidden attribute set in OpenDirectory","type":"integer","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"hardware_events","description":"Hardware (PCI/USB/HID) events from UDEV or IOKit.","platforms":["darwin","linux"],"columns":[{"name":"action","description":"Remove, insert, change properties, etc","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Local device path assigned (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of hardware and hardware event","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"Driver claiming the device","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor","description":"Hardware device vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor_id","description":"Hex encoded Hardware vendor identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"Hardware device model","type":"text","hidden":false,"required":false,"index":false},{"name":"model_id","description":"Hex encoded Hardware model identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"serial","description":"Device serial (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"revision","description":"Device revision (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of hardware event","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"hash","description":"Filesystem hash data.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"path","description":"Must provide a path or directory","type":"text","hidden":false,"required":true,"index":false},{"name":"directory","description":"Must provide a path or directory","type":"text","hidden":false,"required":true,"index":false},{"name":"md5","description":"MD5 hash of provided filesystem data","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1","description":"SHA1 hash of provided filesystem data","type":"text","hidden":false,"required":false,"index":false},{"name":"sha256","description":"SHA256 hash of provided filesystem data","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"homebrew_packages","description":"The installed homebrew package database.","platforms":["darwin"],"columns":[{"name":"name","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Package install path","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Current 'linked' version","type":"text","hidden":false,"required":false,"index":false},{"name":"prefix","description":"Homebrew install prefix","type":"text","hidden":true,"required":false,"index":false}]},{"name":"hvci_status","description":"Retrieve HVCI info of the machine.","platforms":["windows"],"columns":[{"name":"version","description":"The version number of the Device Guard build.","type":"text","hidden":false,"required":false,"index":false},{"name":"instance_identifier","description":"The instance ID of Device Guard.","type":"text","hidden":false,"required":false,"index":false},{"name":"vbs_status","description":"The status of the virtualization based security settings. Returns UNKNOWN if an error is encountered.","type":"text","hidden":false,"required":false,"index":false},{"name":"code_integrity_policy_enforcement_status","description":"The status of the code integrity policy enforcement settings. Returns UNKNOWN if an error is encountered.","type":"text","hidden":false,"required":false,"index":false},{"name":"umci_policy_status","description":"The status of the User Mode Code Integrity security settings. Returns UNKNOWN if an error is encountered.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ibridge_info","description":"Information about the Apple iBridge hardware controller.","platforms":["darwin"],"columns":[{"name":"boot_uuid","description":"Boot UUID of the iBridge controller","type":"text","hidden":false,"required":false,"index":false},{"name":"coprocessor_version","description":"The manufacturer and chip version","type":"text","hidden":false,"required":false,"index":false},{"name":"firmware_version","description":"The build version of the firmware","type":"text","hidden":false,"required":false,"index":false},{"name":"unique_chip_id","description":"Unique id of the iBridge controller","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ie_extensions","description":"Internet Explorer browser extensions.","platforms":["windows"],"columns":[{"name":"name","description":"Extension display name","type":"text","hidden":false,"required":false,"index":false},{"name":"registry_path","description":"Extension identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Version of the executable","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to executable","type":"text","hidden":false,"required":false,"index":false}]},{"name":"intel_me_info","description":"Intel ME/CSE Info.","platforms":["linux","windows"],"columns":[{"name":"version","description":"Intel ME version","type":"text","hidden":false,"required":false,"index":false}]},{"name":"interface_addresses","description":"Network interfaces and relevant metadata.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"interface","description":"Interface name","type":"text","hidden":false,"required":false,"index":false},{"name":"address","description":"Specific address for interface","type":"text","hidden":false,"required":false,"index":false},{"name":"mask","description":"Interface netmask","type":"text","hidden":false,"required":false,"index":false},{"name":"broadcast","description":"Broadcast address for the interface","type":"text","hidden":false,"required":false,"index":false},{"name":"point_to_point","description":"PtP address for the interface","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of address. One of dhcp, manual, auto, other, unknown","type":"text","hidden":false,"required":false,"index":false},{"name":"friendly_name","description":"The friendly display name of the interface.","type":"text","hidden":true,"required":false,"index":false}]},{"name":"interface_details","description":"Detailed information and stats of network interfaces.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"interface","description":"Interface name","type":"text","hidden":false,"required":false,"index":false},{"name":"mac","description":"MAC of interface (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Interface type (includes virtual)","type":"integer","hidden":false,"required":false,"index":false},{"name":"mtu","description":"Network MTU","type":"integer","hidden":false,"required":false,"index":false},{"name":"metric","description":"Metric based on the speed of the interface","type":"integer","hidden":false,"required":false,"index":false},{"name":"flags","description":"Flags (netdevice) for the device","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipackets","description":"Input packets","type":"bigint","hidden":false,"required":false,"index":false},{"name":"opackets","description":"Output packets","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ibytes","description":"Input bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"obytes","description":"Output bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ierrors","description":"Input errors","type":"bigint","hidden":false,"required":false,"index":false},{"name":"oerrors","description":"Output errors","type":"bigint","hidden":false,"required":false,"index":false},{"name":"idrops","description":"Input drops","type":"bigint","hidden":false,"required":false,"index":false},{"name":"odrops","description":"Output drops","type":"bigint","hidden":false,"required":false,"index":false},{"name":"collisions","description":"Packet Collisions detected","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_change","description":"Time of last device modification (optional)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"link_speed","description":"Interface speed in Mb/s","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pci_slot","description":"PCI slot number","type":"text","hidden":true,"required":false,"index":false},{"name":"friendly_name","description":"The friendly display name of the interface.","type":"text","hidden":true,"required":false,"index":false},{"name":"description","description":"Short description of the object a one-line string.","type":"text","hidden":true,"required":false,"index":false},{"name":"manufacturer","description":"Name of the network adapter's manufacturer.","type":"text","hidden":true,"required":false,"index":false},{"name":"connection_id","description":"Name of the network connection as it appears in the Network Connections Control Panel program.","type":"text","hidden":true,"required":false,"index":false},{"name":"connection_status","description":"State of the network adapter connection to the network.","type":"text","hidden":true,"required":false,"index":false},{"name":"enabled","description":"Indicates whether the adapter is enabled or not.","type":"integer","hidden":true,"required":false,"index":false},{"name":"physical_adapter","description":"Indicates whether the adapter is a physical or a logical adapter.","type":"integer","hidden":true,"required":false,"index":false},{"name":"speed","description":"Estimate of the current bandwidth in bits per second.","type":"integer","hidden":true,"required":false,"index":false},{"name":"service","description":"The name of the service the network adapter uses.","type":"text","hidden":true,"required":false,"index":false},{"name":"dhcp_enabled","description":"If TRUE, the dynamic host configuration protocol (DHCP) server automatically assigns an IP address to the computer system when establishing a network connection.","type":"integer","hidden":true,"required":false,"index":false},{"name":"dhcp_lease_expires","description":"Expiration date and time for a leased IP address that was assigned to the computer by the dynamic host configuration protocol (DHCP) server.","type":"text","hidden":true,"required":false,"index":false},{"name":"dhcp_lease_obtained","description":"Date and time the lease was obtained for the IP address assigned to the computer by the dynamic host configuration protocol (DHCP) server.","type":"text","hidden":true,"required":false,"index":false},{"name":"dhcp_server","description":"IP address of the dynamic host configuration protocol (DHCP) server.","type":"text","hidden":true,"required":false,"index":false},{"name":"dns_domain","description":"Organization name followed by a period and an extension that indicates the type of organization, such as 'microsoft.com'.","type":"text","hidden":true,"required":false,"index":false},{"name":"dns_domain_suffix_search_order","description":"Array of DNS domain suffixes to be appended to the end of host names during name resolution.","type":"text","hidden":true,"required":false,"index":false},{"name":"dns_host_name","description":"Host name used to identify the local computer for authentication by some utilities.","type":"text","hidden":true,"required":false,"index":false},{"name":"dns_server_search_order","description":"Array of server IP addresses to be used in querying for DNS servers.","type":"text","hidden":true,"required":false,"index":false}]},{"name":"interface_ipv6","description":"IPv6 configuration and stats of network interfaces.","platforms":["darwin","linux"],"columns":[{"name":"interface","description":"Interface name","type":"text","hidden":false,"required":false,"index":false},{"name":"hop_limit","description":"Current Hop Limit","type":"integer","hidden":false,"required":false,"index":false},{"name":"forwarding_enabled","description":"Enable IP forwarding","type":"integer","hidden":false,"required":false,"index":false},{"name":"redirect_accept","description":"Accept ICMP redirect messages","type":"integer","hidden":false,"required":false,"index":false},{"name":"rtadv_accept","description":"Accept ICMP Router Advertisement","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"iokit_devicetree","description":"The IOKit registry matching the DeviceTree plane.","platforms":["darwin"],"columns":[{"name":"name","description":"Device node name","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"Best matching device class (most-specific category)","type":"text","hidden":false,"required":false,"index":false},{"name":"id","description":"IOKit internal registry ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent device registry ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"device_path","description":"Device tree path","type":"text","hidden":false,"required":false,"index":false},{"name":"service","description":"1 if the device conforms to IOService else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"busy_state","description":"1 if the device is in a busy state else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"retain_count","description":"The device reference count","type":"integer","hidden":false,"required":false,"index":false},{"name":"depth","description":"Device nested depth","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"iokit_registry","description":"The full IOKit registry without selecting a plane.","platforms":["darwin"],"columns":[{"name":"name","description":"Default name of the node","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"Best matching device class (most-specific category)","type":"text","hidden":false,"required":false,"index":false},{"name":"id","description":"IOKit internal registry ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent registry ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"busy_state","description":"1 if the node is in a busy state else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"retain_count","description":"The node reference count","type":"integer","hidden":false,"required":false,"index":false},{"name":"depth","description":"Node nested depth","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"iptables","description":"Linux IP packet filtering and NAT tool.","platforms":["linux"],"columns":[{"name":"filter_name","description":"Packet matching filter table name.","type":"text","hidden":false,"required":false,"index":false},{"name":"chain","description":"Size of module content.","type":"text","hidden":false,"required":false,"index":false},{"name":"policy","description":"Policy that applies for this rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"target","description":"Target that applies for this rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"protocol","description":"Protocol number identification.","type":"integer","hidden":false,"required":false,"index":false},{"name":"src_port","description":"Protocol source port(s).","type":"text","hidden":false,"required":false,"index":false},{"name":"dst_port","description":"Protocol destination port(s).","type":"text","hidden":false,"required":false,"index":false},{"name":"src_ip","description":"Source IP address.","type":"text","hidden":false,"required":false,"index":false},{"name":"src_mask","description":"Source IP address mask.","type":"text","hidden":false,"required":false,"index":false},{"name":"iniface","description":"Input interface for the rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"iniface_mask","description":"Input interface mask for the rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"dst_ip","description":"Destination IP address.","type":"text","hidden":false,"required":false,"index":false},{"name":"dst_mask","description":"Destination IP address mask.","type":"text","hidden":false,"required":false,"index":false},{"name":"outiface","description":"Output interface for the rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"outiface_mask","description":"Output interface mask for the rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"match","description":"Matching rule that applies.","type":"text","hidden":false,"required":false,"index":false},{"name":"packets","description":"Number of matching packets for this rule.","type":"integer","hidden":false,"required":false,"index":false},{"name":"bytes","description":"Number of matching bytes for this rule.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"kernel_extensions","description":"macOS's kernel extensions, both loaded and within the load search path.","platforms":["darwin"],"columns":[{"name":"idx","description":"Extension load tag or index","type":"integer","hidden":false,"required":false,"index":false},{"name":"refs","description":"Reference count","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Bytes of wired memory used by extension","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Extension label","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Extension version","type":"text","hidden":false,"required":false,"index":false},{"name":"linked_against","description":"Indexes of extensions this extension is linked against","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Optional path to extension bundle","type":"text","hidden":false,"required":false,"index":false}]},{"name":"kernel_info","description":"Basic active kernel information.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"version","description":"Kernel version","type":"text","hidden":false,"required":false,"index":false},{"name":"arguments","description":"Kernel arguments","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Kernel path","type":"text","hidden":false,"required":false,"index":false},{"name":"device","description":"Kernel device identifier","type":"text","hidden":false,"required":false,"index":false}]},{"name":"kernel_modules","description":"Linux kernel modules both loaded and within the load search path.","platforms":["linux"],"columns":[{"name":"name","description":"Module name","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of module content","type":"bigint","hidden":false,"required":false,"index":false},{"name":"used_by","description":"Module reverse dependencies","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Kernel module status","type":"text","hidden":false,"required":false,"index":false},{"name":"address","description":"Kernel module address","type":"text","hidden":false,"required":false,"index":false}]},{"name":"kernel_panics","description":"System kernel panic logs.","platforms":["darwin"],"columns":[{"name":"path","description":"Location of log file","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Formatted time of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"registers","description":"A space delimited line of register:value pairs","type":"text","hidden":false,"required":false,"index":false},{"name":"frame_backtrace","description":"Backtrace of the crashed module","type":"text","hidden":false,"required":false,"index":false},{"name":"module_backtrace","description":"Modules appearing in the crashed module's backtrace","type":"text","hidden":false,"required":false,"index":false},{"name":"dependencies","description":"Module dependencies existing in crashed module's backtrace","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Process name corresponding to crashed thread","type":"text","hidden":false,"required":false,"index":false},{"name":"os_version","description":"Version of the operating system","type":"text","hidden":false,"required":false,"index":false},{"name":"kernel_version","description":"Version of the system kernel","type":"text","hidden":false,"required":false,"index":false},{"name":"system_model","description":"Physical system model, for example 'MacBookPro12,1 (Mac-E43C1C25D4880AD6)'","type":"text","hidden":false,"required":false,"index":false},{"name":"uptime","description":"System uptime at kernel panic in nanoseconds","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_loaded","description":"Last loaded module before panic","type":"text","hidden":false,"required":false,"index":false},{"name":"last_unloaded","description":"Last unloaded module before panic","type":"text","hidden":false,"required":false,"index":false}]},{"name":"keychain_acls","description":"Applications that have ACL entries in the keychain.","platforms":["darwin"],"columns":[{"name":"keychain_path","description":"The path of the keychain","type":"text","hidden":false,"required":false,"index":false},{"name":"authorizations","description":"A space delimited set of authorization attributes","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"The path of the authorized application","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"The description included with the ACL entry","type":"text","hidden":false,"required":false,"index":false},{"name":"label","description":"An optional label tag that may be included with the keychain entry","type":"text","hidden":false,"required":false,"index":false}]},{"name":"keychain_items","description":"Generic details about keychain items.","platforms":["darwin"],"columns":[{"name":"label","description":"Generic item name","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Optional item description","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Optional keychain comment","type":"text","hidden":false,"required":false,"index":false},{"name":"account","description":"Optional item account","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Data item was created","type":"text","hidden":false,"required":false,"index":false},{"name":"modified","description":"Date of last modification","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Keychain item type (class)","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to keychain containing item","type":"text","hidden":false,"required":false,"index":false}]},{"name":"known_hosts","description":"A line-delimited known_hosts table.","platforms":["darwin","linux"],"columns":[{"name":"uid","description":"The local user that owns the known_hosts file","type":"bigint","hidden":false,"required":false,"index":false},{"name":"key","description":"parsed authorized keys line","type":"text","hidden":false,"required":false,"index":false},{"name":"key_file","description":"Path to known_hosts file","type":"text","hidden":false,"required":false,"index":false}]},{"name":"kva_speculative_info","description":"Display kernel virtual address and speculative execution information for the system.","platforms":["windows"],"columns":[{"name":"kva_shadow_enabled","description":"Kernel Virtual Address shadowing is enabled.","type":"integer","hidden":false,"required":false,"index":false},{"name":"kva_shadow_user_global","description":"User pages are marked as global.","type":"integer","hidden":false,"required":false,"index":false},{"name":"kva_shadow_pcid","description":"Kernel VA PCID flushing optimization is enabled.","type":"integer","hidden":false,"required":false,"index":false},{"name":"kva_shadow_inv_pcid","description":"Kernel VA INVPCID is enabled.","type":"integer","hidden":false,"required":false,"index":false},{"name":"bp_mitigations","description":"Branch Prediction mitigations are enabled.","type":"integer","hidden":false,"required":false,"index":false},{"name":"bp_system_pol_disabled","description":"Branch Predictions are disabled via system policy.","type":"integer","hidden":false,"required":false,"index":false},{"name":"bp_microcode_disabled","description":"Branch Predictions are disabled due to lack of microcode update.","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_spec_ctrl_supported","description":"SPEC_CTRL MSR supported by CPU Microcode.","type":"integer","hidden":false,"required":false,"index":false},{"name":"ibrs_support_enabled","description":"Windows uses IBRS.","type":"integer","hidden":false,"required":false,"index":false},{"name":"stibp_support_enabled","description":"Windows uses STIBP.","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_pred_cmd_supported","description":"PRED_CMD MSR supported by CPU Microcode.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"last","description":"System logins and logouts.","platforms":["darwin","linux"],"columns":[{"name":"username","description":"Entry username","type":"text","hidden":false,"required":false,"index":false},{"name":"tty","description":"Entry terminal","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Entry type, according to ut_type types (utmp.h)","type":"integer","hidden":false,"required":false,"index":false},{"name":"type_name","description":"Entry type name, according to ut_type types (utmp.h)","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Entry timestamp","type":"integer","hidden":false,"required":false,"index":false},{"name":"host","description":"Entry hostname","type":"text","hidden":false,"required":false,"index":false}]},{"name":"launchd","description":"LaunchAgents and LaunchDaemons from default search paths.","platforms":["darwin"],"columns":[{"name":"path","description":"Path to daemon or agent plist","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"File name of plist (used by launchd)","type":"text","hidden":false,"required":false,"index":false},{"name":"label","description":"Daemon or agent service name","type":"text","hidden":false,"required":false,"index":false},{"name":"program","description":"Path to target program","type":"text","hidden":false,"required":false,"index":false},{"name":"run_at_load","description":"Should the program run on launch load","type":"text","hidden":false,"required":false,"index":false},{"name":"keep_alive","description":"Should the process be restarted if killed","type":"text","hidden":false,"required":false,"index":false},{"name":"on_demand","description":"Deprecated key, replaced by keep_alive","type":"text","hidden":false,"required":false,"index":false},{"name":"disabled","description":"Skip loading this daemon or agent on boot","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"Run this daemon or agent as this username","type":"text","hidden":false,"required":false,"index":false},{"name":"groupname","description":"Run this daemon or agent as this group","type":"text","hidden":false,"required":false,"index":false},{"name":"stdout_path","description":"Pipe stdout to a target path","type":"text","hidden":false,"required":false,"index":false},{"name":"stderr_path","description":"Pipe stderr to a target path","type":"text","hidden":false,"required":false,"index":false},{"name":"start_interval","description":"Frequency to run in seconds","type":"text","hidden":false,"required":false,"index":false},{"name":"program_arguments","description":"Command line arguments passed to program","type":"text","hidden":false,"required":false,"index":false},{"name":"watch_paths","description":"Key that launches daemon or agent if path is modified","type":"text","hidden":false,"required":false,"index":false},{"name":"queue_directories","description":"Similar to watch_paths but only with non-empty directories","type":"text","hidden":false,"required":false,"index":false},{"name":"inetd_compatibility","description":"Run this daemon or agent as it was launched from inetd","type":"text","hidden":false,"required":false,"index":false},{"name":"start_on_mount","description":"Run daemon or agent every time a filesystem is mounted","type":"text","hidden":false,"required":false,"index":false},{"name":"root_directory","description":"Key used to specify a directory to chroot to before launch","type":"text","hidden":false,"required":false,"index":false},{"name":"working_directory","description":"Key used to specify a directory to chdir to before launch","type":"text","hidden":false,"required":false,"index":false},{"name":"process_type","description":"Key describes the intended purpose of the job","type":"text","hidden":false,"required":false,"index":false}]},{"name":"launchd_overrides","description":"Override keys, per user, for LaunchDaemons and Agents.","platforms":["darwin"],"columns":[{"name":"label","description":"Daemon or agent service name","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Name of the override key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Overridden value","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID applied to the override, 0 applies to all","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to daemon or agent plist","type":"text","hidden":false,"required":false,"index":false}]},{"name":"listening_ports","description":"Processes with listening (bound) network sockets/ports.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"port","description":"Transport layer port","type":"integer","hidden":false,"required":false,"index":false},{"name":"protocol","description":"Transport protocol (TCP/UDP)","type":"integer","hidden":false,"required":false,"index":false},{"name":"family","description":"Network protocol (IPv4, IPv6)","type":"integer","hidden":false,"required":false,"index":false},{"name":"address","description":"Specific address for bind","type":"text","hidden":false,"required":false,"index":false},{"name":"fd","description":"Socket file descriptor number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"socket","description":"Socket handle or inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path for UNIX domain sockets","type":"text","hidden":false,"required":false,"index":false},{"name":"net_namespace","description":"The inode number of the network namespace","type":"text","hidden":true,"required":false,"index":false}]},{"name":"load_average","description":"Displays information about the system wide load averages.","platforms":["darwin","linux"],"columns":[{"name":"period","description":"Period over which the average is calculated.","type":"text","hidden":false,"required":false,"index":false},{"name":"average","description":"Load average over the specified period.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"location_services","description":"Reports the status of the Location Services feature of the OS.","platforms":["darwin"],"columns":[{"name":"enabled","description":"1 if Location Services are enabled, else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"logged_in_users","description":"Users with an active shell on the system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"type","description":"Login type","type":"text","hidden":false,"required":false,"index":false},{"name":"user","description":"User login name","type":"text","hidden":false,"required":false,"index":false},{"name":"tty","description":"Device name","type":"text","hidden":false,"required":false,"index":false},{"name":"host","description":"Remote hostname","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time entry was made","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"sid","description":"The user's unique security identifier","type":"text","hidden":true,"required":false,"index":false},{"name":"registry_hive","description":"HKEY_USERS registry hive","type":"text","hidden":true,"required":false,"index":false}]},{"name":"logical_drives","description":"Details for logical drives on the system. A logical drive generally represents a single partition.","platforms":["windows"],"columns":[{"name":"device_id","description":"The drive id, usually the drive name, e.g., 'C:'.","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Deprecated (always 'Unknown').","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"The canonical description of the drive, e.g. 'Logical Fixed Disk', 'CD-ROM Disk'.","type":"text","hidden":false,"required":false,"index":false},{"name":"free_space","description":"The amount of free space, in bytes, of the drive (-1 on failure).","type":"bigint","hidden":false,"required":false,"index":false},{"name":"size","description":"The total amount of space, in bytes, of the drive (-1 on failure).","type":"bigint","hidden":false,"required":false,"index":false},{"name":"file_system","description":"The file system of the drive.","type":"text","hidden":false,"required":false,"index":false},{"name":"boot_partition","description":"True if Windows booted from this drive.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"logon_sessions","description":"Windows Logon Session.","platforms":["windows"],"columns":[{"name":"logon_id","description":"A locally unique identifier (LUID) that identifies a logon session.","type":"integer","hidden":false,"required":false,"index":false},{"name":"user","description":"The account name of the security principal that owns the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"logon_domain","description":"The name of the domain used to authenticate the owner of the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"authentication_package","description":"The authentication package used to authenticate the owner of the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"logon_type","description":"The logon method.","type":"text","hidden":false,"required":false,"index":false},{"name":"session_id","description":"The Terminal Services session identifier.","type":"integer","hidden":false,"required":false,"index":false},{"name":"logon_sid","description":"The user's security identifier (SID).","type":"text","hidden":false,"required":false,"index":false},{"name":"logon_time","description":"The time the session owner logged on.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"logon_server","description":"The name of the server used to authenticate the owner of the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"dns_domain_name","description":"The DNS name for the owner of the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"upn","description":"The user principal name (UPN) for the owner of the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"logon_script","description":"The script used for logging on.","type":"text","hidden":false,"required":false,"index":false},{"name":"profile_path","description":"The home directory for the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"home_directory","description":"The home directory for the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"home_directory_drive","description":"The drive location of the home directory of the logon session.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_certificates","description":"LXD certificates information.","platforms":["linux"],"columns":[{"name":"name","description":"Name of the certificate","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of the certificate","type":"text","hidden":false,"required":false,"index":false},{"name":"fingerprint","description":"SHA256 hash of the certificate","type":"text","hidden":false,"required":false,"index":false},{"name":"certificate","description":"Certificate content","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_cluster","description":"LXD cluster information.","platforms":["linux"],"columns":[{"name":"server_name","description":"Name of the LXD server node","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"Whether clustering enabled (1) or not (0) on this node","type":"integer","hidden":false,"required":false,"index":false},{"name":"member_config_entity","description":"Type of configuration parameter for this node","type":"text","hidden":false,"required":false,"index":false},{"name":"member_config_name","description":"Name of configuration parameter","type":"text","hidden":false,"required":false,"index":false},{"name":"member_config_key","description":"Config key","type":"text","hidden":false,"required":false,"index":false},{"name":"member_config_value","description":"Config value","type":"text","hidden":false,"required":false,"index":false},{"name":"member_config_description","description":"Config description","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_cluster_members","description":"LXD cluster members information.","platforms":["linux"],"columns":[{"name":"server_name","description":"Name of the LXD server node","type":"text","hidden":false,"required":false,"index":false},{"name":"url","description":"URL of the node","type":"text","hidden":false,"required":false,"index":false},{"name":"database","description":"Whether the server is a database node (1) or not (0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"status","description":"Status of the node (Online/Offline)","type":"text","hidden":false,"required":false,"index":false},{"name":"message","description":"Message from the node (Online/Offline)","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_images","description":"LXD images information.","platforms":["linux"],"columns":[{"name":"id","description":"Image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"architecture","description":"Target architecture for the image","type":"text","hidden":false,"required":false,"index":false},{"name":"os","description":"OS on which image is based","type":"text","hidden":false,"required":false,"index":false},{"name":"release","description":"OS release version on which the image is based","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Image description","type":"text","hidden":false,"required":false,"index":false},{"name":"aliases","description":"Comma-separated list of image aliases","type":"text","hidden":false,"required":false,"index":false},{"name":"filename","description":"Filename of the image file","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of image in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"auto_update","description":"Whether the image auto-updates (1) or not (0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"cached","description":"Whether image is cached (1) or not (0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"public","description":"Whether image is public (1) or not (0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"created_at","description":"ISO time of image creation","type":"text","hidden":false,"required":false,"index":false},{"name":"expires_at","description":"ISO time of image expiration","type":"text","hidden":false,"required":false,"index":false},{"name":"uploaded_at","description":"ISO time of image upload","type":"text","hidden":false,"required":false,"index":false},{"name":"last_used_at","description":"ISO time for the most recent use of this image in terms of container spawn","type":"text","hidden":false,"required":false,"index":false},{"name":"update_source_server","description":"Server for image update","type":"text","hidden":false,"required":false,"index":false},{"name":"update_source_protocol","description":"Protocol used for image information update and image import from source server","type":"text","hidden":false,"required":false,"index":false},{"name":"update_source_certificate","description":"Certificate for update source server","type":"text","hidden":false,"required":false,"index":false},{"name":"update_source_alias","description":"Alias of image at update source server","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_instance_config","description":"LXD instance configuration information.","platforms":["linux"],"columns":[{"name":"name","description":"Instance name","type":"text","hidden":false,"required":true,"index":false},{"name":"key","description":"Configuration parameter name","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Configuration parameter value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_instance_devices","description":"LXD instance devices information.","platforms":["linux"],"columns":[{"name":"name","description":"Instance name","type":"text","hidden":false,"required":true,"index":false},{"name":"device","description":"Name of the device","type":"text","hidden":false,"required":false,"index":false},{"name":"device_type","description":"Device type","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Device info param name","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Device info param value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_instances","description":"LXD instances information.","platforms":["linux"],"columns":[{"name":"name","description":"Instance name","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Instance state (running, stopped, etc.)","type":"text","hidden":false,"required":false,"index":false},{"name":"stateful","description":"Whether the instance is stateful(1) or not(0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"ephemeral","description":"Whether the instance is ephemeral(1) or not(0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"created_at","description":"ISO time of creation","type":"text","hidden":false,"required":false,"index":false},{"name":"base_image","description":"ID of image used to launch this instance","type":"text","hidden":false,"required":false,"index":false},{"name":"architecture","description":"Instance architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"os","description":"The OS of this instance","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Instance description","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Instance's process ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"processes","description":"Number of processes running inside this instance","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"lxd_networks","description":"LXD network information.","platforms":["linux"],"columns":[{"name":"name","description":"Name of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of network","type":"text","hidden":false,"required":false,"index":false},{"name":"managed","description":"1 if network created by LXD, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_address","description":"IPv4 address","type":"text","hidden":false,"required":false,"index":false},{"name":"ipv6_address","description":"IPv6 address","type":"text","hidden":false,"required":false,"index":false},{"name":"used_by","description":"URLs for containers using this network","type":"text","hidden":false,"required":false,"index":false},{"name":"bytes_received","description":"Number of bytes received on this network","type":"bigint","hidden":false,"required":false,"index":false},{"name":"bytes_sent","description":"Number of bytes sent on this network","type":"bigint","hidden":false,"required":false,"index":false},{"name":"packets_received","description":"Number of packets received on this network","type":"bigint","hidden":false,"required":false,"index":false},{"name":"packets_sent","description":"Number of packets sent on this network","type":"bigint","hidden":false,"required":false,"index":false},{"name":"hwaddr","description":"Hardware address for this network","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Network status","type":"text","hidden":false,"required":false,"index":false},{"name":"mtu","description":"MTU size","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"lxd_storage_pools","description":"LXD storage pool information.","platforms":["linux"],"columns":[{"name":"name","description":"Name of the storage pool","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"Storage driver","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Storage pool source","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of the storage pool","type":"text","hidden":false,"required":false,"index":false},{"name":"space_used","description":"Storage space used in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"space_total","description":"Total available storage space in bytes for this storage pool","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inodes_used","description":"Number of inodes used","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inodes_total","description":"Total number of inodes available in this storage pool","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"magic","description":"Magic number recognition library table.","platforms":["darwin","linux"],"columns":[{"name":"path","description":"Absolute path to target file","type":"text","hidden":false,"required":true,"index":false},{"name":"magic_db_files","description":"Colon(:) separated list of files where the magic db file can be found. By default one of the following is used: /usr/share/file/magic/magic, /usr/share/misc/magic or /usr/share/misc/magic.mgc","type":"text","hidden":false,"required":false,"index":false},{"name":"data","description":"Magic number data from libmagic","type":"text","hidden":false,"required":false,"index":false},{"name":"mime_type","description":"MIME type data from libmagic","type":"text","hidden":false,"required":false,"index":false},{"name":"mime_encoding","description":"MIME encoding data from libmagic","type":"text","hidden":false,"required":false,"index":false}]},{"name":"managed_policies","description":"The managed configuration policies from AD, MDM, MCX, etc.","platforms":["darwin"],"columns":[{"name":"domain","description":"System or manager-chosen domain key","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"Optional UUID assigned to policy set","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Policy key name","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Policy value","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"Policy applies only this user","type":"text","hidden":false,"required":false,"index":false},{"name":"manual","description":"1 if policy was loaded manually, otherwise 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"md_devices","description":"Software RAID array settings.","platforms":["linux"],"columns":[{"name":"device_name","description":"md device name","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Current state of the array","type":"text","hidden":false,"required":false,"index":false},{"name":"raid_level","description":"Current raid level of the array","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"size of the array in blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"chunk_size","description":"chunk size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"raid_disks","description":"Number of configured RAID disks in array","type":"integer","hidden":false,"required":false,"index":false},{"name":"nr_raid_disks","description":"Number of partitions or disk devices to comprise the array","type":"integer","hidden":false,"required":false,"index":false},{"name":"working_disks","description":"Number of working disks in array","type":"integer","hidden":false,"required":false,"index":false},{"name":"active_disks","description":"Number of active disks in array","type":"integer","hidden":false,"required":false,"index":false},{"name":"failed_disks","description":"Number of failed disks in array","type":"integer","hidden":false,"required":false,"index":false},{"name":"spare_disks","description":"Number of idle disks in array","type":"integer","hidden":false,"required":false,"index":false},{"name":"superblock_state","description":"State of the superblock","type":"text","hidden":false,"required":false,"index":false},{"name":"superblock_version","description":"Version of the superblock","type":"text","hidden":false,"required":false,"index":false},{"name":"superblock_update_time","description":"Unix timestamp of last update","type":"bigint","hidden":false,"required":false,"index":false},{"name":"bitmap_on_mem","description":"Pages allocated in in-memory bitmap, if enabled","type":"text","hidden":false,"required":false,"index":false},{"name":"bitmap_chunk_size","description":"Bitmap chunk size","type":"text","hidden":false,"required":false,"index":false},{"name":"bitmap_external_file","description":"External referenced bitmap file","type":"text","hidden":false,"required":false,"index":false},{"name":"recovery_progress","description":"Progress of the recovery activity","type":"text","hidden":false,"required":false,"index":false},{"name":"recovery_finish","description":"Estimated duration of recovery activity","type":"text","hidden":false,"required":false,"index":false},{"name":"recovery_speed","description":"Speed of recovery activity","type":"text","hidden":false,"required":false,"index":false},{"name":"resync_progress","description":"Progress of the resync activity","type":"text","hidden":false,"required":false,"index":false},{"name":"resync_finish","description":"Estimated duration of resync activity","type":"text","hidden":false,"required":false,"index":false},{"name":"resync_speed","description":"Speed of resync activity","type":"text","hidden":false,"required":false,"index":false},{"name":"reshape_progress","description":"Progress of the reshape activity","type":"text","hidden":false,"required":false,"index":false},{"name":"reshape_finish","description":"Estimated duration of reshape activity","type":"text","hidden":false,"required":false,"index":false},{"name":"reshape_speed","description":"Speed of reshape activity","type":"text","hidden":false,"required":false,"index":false},{"name":"check_array_progress","description":"Progress of the check array activity","type":"text","hidden":false,"required":false,"index":false},{"name":"check_array_finish","description":"Estimated duration of the check array activity","type":"text","hidden":false,"required":false,"index":false},{"name":"check_array_speed","description":"Speed of the check array activity","type":"text","hidden":false,"required":false,"index":false},{"name":"unused_devices","description":"Unused devices","type":"text","hidden":false,"required":false,"index":false},{"name":"other","description":"Other information associated with array from /proc/mdstat","type":"text","hidden":false,"required":false,"index":false}]},{"name":"md_drives","description":"Drive devices used for Software RAID.","platforms":["linux"],"columns":[{"name":"md_device_name","description":"md device name","type":"text","hidden":false,"required":false,"index":false},{"name":"drive_name","description":"Drive device name","type":"text","hidden":false,"required":false,"index":false},{"name":"slot","description":"Slot position of disk","type":"integer","hidden":false,"required":false,"index":false},{"name":"state","description":"State of the drive","type":"text","hidden":false,"required":false,"index":false}]},{"name":"md_personalities","description":"Software RAID setting supported by the kernel.","platforms":["linux"],"columns":[{"name":"name","description":"Name of personality supported by kernel","type":"text","hidden":false,"required":false,"index":false}]},{"name":"mdfind","description":"Run searches against the spotlight database.","platforms":["darwin"],"columns":[{"name":"path","description":"Path of the file returned from spotlight","type":"text","hidden":false,"required":false,"index":false},{"name":"query","description":"The query that was run to find the file","type":"text","hidden":false,"required":true,"index":false}]},{"name":"mdls","description":"Query file metadata in the Spotlight database.","platforms":["darwin"],"columns":[{"name":"path","description":"Path of the file","type":"text","hidden":false,"required":true,"index":false},{"name":"key","description":"Name of the metadata key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Value stored in the metadata key","type":"text","hidden":false,"required":false,"index":false},{"name":"valuetype","description":"CoreFoundation type of data stored in value","type":"text","hidden":true,"required":false,"index":false}]},{"name":"memory_array_mapped_addresses","description":"Data associated for address mapping of physical memory arrays.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the structure","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_array_handle","description":"Handle of the memory array associated with this structure","type":"text","hidden":false,"required":false,"index":false},{"name":"starting_address","description":"Physical stating address, in kilobytes, of a range of memory mapped to physical memory array","type":"text","hidden":false,"required":false,"index":false},{"name":"ending_address","description":"Physical ending address of last kilobyte of a range of memory mapped to physical memory array","type":"text","hidden":false,"required":false,"index":false},{"name":"partition_width","description":"Number of memory devices that form a single row of memory for the address partition of this structure","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"memory_arrays","description":"Data associated with collection of memory devices that operate to form a memory address.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the array","type":"text","hidden":false,"required":false,"index":false},{"name":"location","description":"Physical location of the memory array","type":"text","hidden":false,"required":false,"index":false},{"name":"use","description":"Function for which the array is used","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_error_correction","description":"Primary hardware error correction or detection method supported","type":"text","hidden":false,"required":false,"index":false},{"name":"max_capacity","description":"Maximum capacity of array in gigabytes","type":"integer","hidden":false,"required":false,"index":false},{"name":"memory_error_info_handle","description":"Handle, or instance number, associated with any error that was detected for the array","type":"text","hidden":false,"required":false,"index":false},{"name":"number_memory_devices","description":"Number of memory devices on array","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"memory_device_mapped_addresses","description":"Data associated for address mapping of physical memory devices.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the structure","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_device_handle","description":"Handle of the memory device structure associated with this structure","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_array_mapped_address_handle","description":"Handle of the memory array mapped address to which this device range is mapped to","type":"text","hidden":false,"required":false,"index":false},{"name":"starting_address","description":"Physical stating address, in kilobytes, of a range of memory mapped to physical memory array","type":"text","hidden":false,"required":false,"index":false},{"name":"ending_address","description":"Physical ending address of last kilobyte of a range of memory mapped to physical memory array","type":"text","hidden":false,"required":false,"index":false},{"name":"partition_row_position","description":"Identifies the position of the referenced memory device in a row of the address partition","type":"integer","hidden":false,"required":false,"index":false},{"name":"interleave_position","description":"The position of the device in a interleave, i.e. 0 indicates non-interleave, 1 indicates 1st interleave, 2 indicates 2nd interleave, etc.","type":"integer","hidden":false,"required":false,"index":false},{"name":"interleave_data_depth","description":"The max number of consecutive rows from memory device that are accessed in a single interleave transfer; 0 indicates device is non-interleave","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"memory_devices","description":"Physical memory device (type 17) information retrieved from SMBIOS.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the structure in SMBIOS","type":"text","hidden":false,"required":false,"index":false},{"name":"array_handle","description":"The memory array that the device is attached to","type":"text","hidden":false,"required":false,"index":false},{"name":"form_factor","description":"Implementation form factor for this memory device","type":"text","hidden":false,"required":false,"index":false},{"name":"total_width","description":"Total width, in bits, of this memory device, including any check or error-correction bits","type":"integer","hidden":false,"required":false,"index":false},{"name":"data_width","description":"Data width, in bits, of this memory device","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of memory device in Megabyte","type":"integer","hidden":false,"required":false,"index":false},{"name":"set","description":"Identifies if memory device is one of a set of devices. A value of 0 indicates no set affiliation.","type":"integer","hidden":false,"required":false,"index":false},{"name":"device_locator","description":"String number of the string that identifies the physically-labeled socket or board position where the memory device is located","type":"text","hidden":false,"required":false,"index":false},{"name":"bank_locator","description":"String number of the string that identifies the physically-labeled bank where the memory device is located","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_type","description":"Type of memory used","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_type_details","description":"Additional details for memory device","type":"text","hidden":false,"required":false,"index":false},{"name":"max_speed","description":"Max speed of memory device in megatransfers per second (MT/s)","type":"integer","hidden":false,"required":false,"index":false},{"name":"configured_clock_speed","description":"Configured speed of memory device in megatransfers per second (MT/s)","type":"integer","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"Manufacturer ID string","type":"text","hidden":false,"required":false,"index":false},{"name":"serial_number","description":"Serial number of memory device","type":"text","hidden":false,"required":false,"index":false},{"name":"asset_tag","description":"Manufacturer specific asset tag of memory device","type":"text","hidden":false,"required":false,"index":false},{"name":"part_number","description":"Manufacturer specific serial number of memory device","type":"text","hidden":false,"required":false,"index":false},{"name":"min_voltage","description":"Minimum operating voltage of device in millivolts","type":"integer","hidden":false,"required":false,"index":false},{"name":"max_voltage","description":"Maximum operating voltage of device in millivolts","type":"integer","hidden":false,"required":false,"index":false},{"name":"configured_voltage","description":"Configured operating voltage of device in millivolts","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"memory_error_info","description":"Data associated with errors of a physical memory array.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the structure","type":"text","hidden":false,"required":false,"index":false},{"name":"error_type","description":"type of error associated with current error status for array or device","type":"text","hidden":false,"required":false,"index":false},{"name":"error_granularity","description":"Granularity to which the error can be resolved","type":"text","hidden":false,"required":false,"index":false},{"name":"error_operation","description":"Memory access operation that caused the error","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor_syndrome","description":"Vendor specific ECC syndrome or CRC data associated with the erroneous access","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_array_error_address","description":"32 bit physical address of the error based on the addressing of the bus to which the memory array is connected","type":"text","hidden":false,"required":false,"index":false},{"name":"device_error_address","description":"32 bit physical address of the error relative to the start of the failing memory address, in bytes","type":"text","hidden":false,"required":false,"index":false},{"name":"error_resolution","description":"Range, in bytes, within which this error can be determined, when an error address is given","type":"text","hidden":false,"required":false,"index":false}]},{"name":"memory_info","description":"Main memory information in bytes.","platforms":["linux"],"columns":[{"name":"memory_total","description":"Total amount of physical RAM, in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"memory_free","description":"The amount of physical RAM, in bytes, left unused by the system","type":"bigint","hidden":false,"required":false,"index":false},{"name":"memory_available","description":"The amount of physical RAM, in bytes, available for starting new applications, without swapping","type":"bigint","hidden":false,"required":false,"index":false},{"name":"buffers","description":"The amount of physical RAM, in bytes, used for file buffers","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cached","description":"The amount of physical RAM, in bytes, used as cache memory","type":"bigint","hidden":false,"required":false,"index":false},{"name":"swap_cached","description":"The amount of swap, in bytes, used as cache memory","type":"bigint","hidden":false,"required":false,"index":false},{"name":"active","description":"The total amount of buffer or page cache memory, in bytes, that is in active use","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inactive","description":"The total amount of buffer or page cache memory, in bytes, that are free and available","type":"bigint","hidden":false,"required":false,"index":false},{"name":"swap_total","description":"The total amount of swap available, in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"swap_free","description":"The total amount of swap free, in bytes","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"memory_map","description":"OS memory region map.","platforms":["linux"],"columns":[{"name":"name","description":"Region name","type":"text","hidden":false,"required":false,"index":false},{"name":"start","description":"Start address of memory region","type":"text","hidden":false,"required":false,"index":false},{"name":"end","description":"End address of memory region","type":"text","hidden":false,"required":false,"index":false}]},{"name":"mounts","description":"System mounted devices and filesystems (not process specific).","platforms":["darwin","linux"],"columns":[{"name":"device","description":"Mounted device","type":"text","hidden":false,"required":false,"index":false},{"name":"device_alias","description":"Mounted device alias","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Mounted device path","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Mounted device type","type":"text","hidden":false,"required":false,"index":false},{"name":"blocks_size","description":"Block size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"blocks","description":"Mounted device used blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"blocks_free","description":"Mounted device free blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"blocks_available","description":"Mounted device available blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inodes","description":"Mounted device used inodes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inodes_free","description":"Mounted device free inodes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"flags","description":"Mounted device flags","type":"text","hidden":false,"required":false,"index":false}]},{"name":"msr","description":"Various pieces of data stored in the model specific register per processor. NOTE: the msr kernel module must be enabled, and osquery must be run as root.","platforms":["linux"],"columns":[{"name":"processor_number","description":"The processor number as reported in /proc/cpuinfo","type":"bigint","hidden":false,"required":false,"index":false},{"name":"turbo_disabled","description":"Whether the turbo feature is disabled.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"turbo_ratio_limit","description":"The turbo feature ratio limit.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"platform_info","description":"Platform information.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"perf_ctl","description":"Performance setting for the processor.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"perf_status","description":"Performance status for the processor.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"feature_control","description":"Bitfield controlling enabled features.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"rapl_power_limit","description":"Run Time Average Power Limiting power limit.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"rapl_energy_status","description":"Run Time Average Power Limiting energy status.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"rapl_power_units","description":"Run Time Average Power Limiting power units.","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"nfs_shares","description":"NFS shares exported by the host.","platforms":["darwin"],"columns":[{"name":"share","description":"Filesystem path to the share","type":"text","hidden":false,"required":false,"index":false},{"name":"options","description":"Options string set on the export share","type":"text","hidden":false,"required":false,"index":false},{"name":"readonly","description":"1 if the share is exported readonly else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"npm_packages","description":"Node packages installed in a system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Package display name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package-supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Package-supplied description","type":"text","hidden":false,"required":false,"index":false},{"name":"author","description":"Package-supplied author","type":"text","hidden":false,"required":false,"index":false},{"name":"license","description":"License under which package is launched","type":"text","hidden":false,"required":false,"index":false},{"name":"homepage","description":"Package supplied homepage","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path at which this module resides","type":"text","hidden":false,"required":false,"index":false},{"name":"directory","description":"Directory where node_modules are located","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"ntdomains","description":"Display basic NT domain information of a Windows machine.","platforms":["windows"],"columns":[{"name":"name","description":"The label by which the object is known.","type":"text","hidden":false,"required":false,"index":false},{"name":"client_site_name","description":"The name of the site where the domain controller is configured.","type":"text","hidden":false,"required":false,"index":false},{"name":"dc_site_name","description":"The name of the site where the domain controller is located.","type":"text","hidden":false,"required":false,"index":false},{"name":"dns_forest_name","description":"The name of the root of the DNS tree.","type":"text","hidden":false,"required":false,"index":false},{"name":"domain_controller_address","description":"The IP Address of the discovered domain controller..","type":"text","hidden":false,"required":false,"index":false},{"name":"domain_controller_name","description":"The name of the discovered domain controller.","type":"text","hidden":false,"required":false,"index":false},{"name":"domain_name","description":"The name of the domain.","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"The current status of the domain object.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ntfs_acl_permissions","description":"Retrieve NTFS ACL permission information for files and directories.","platforms":["windows"],"columns":[{"name":"path","description":"Path to the file or directory.","type":"text","hidden":false,"required":true,"index":false},{"name":"type","description":"Type of access mode for the access control entry.","type":"text","hidden":false,"required":false,"index":false},{"name":"principal","description":"User or group to which the ACE applies.","type":"text","hidden":false,"required":false,"index":false},{"name":"access","description":"Specific permissions that indicate the rights described by the ACE.","type":"text","hidden":false,"required":false,"index":false},{"name":"inherited_from","description":"The inheritance policy of the ACE.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ntfs_journal_events","description":"Track time/action changes to files specified in configuration data.","platforms":["windows"],"columns":[{"name":"action","description":"Change action (Write, Delete, etc)","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"The category that the event originated from","type":"text","hidden":false,"required":false,"index":false},{"name":"old_path","description":"Old path (renames only)","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path","type":"text","hidden":false,"required":false,"index":false},{"name":"record_timestamp","description":"Journal record timestamp","type":"text","hidden":false,"required":false,"index":false},{"name":"record_usn","description":"The update sequence number that identifies the journal record","type":"text","hidden":false,"required":false,"index":false},{"name":"node_ref_number","description":"The ordinal that associates a journal record with a filename","type":"text","hidden":false,"required":false,"index":false},{"name":"parent_ref_number","description":"The ordinal that associates a journal record with a filename's parent directory","type":"text","hidden":false,"required":false,"index":false},{"name":"drive_letter","description":"The drive letter identifying the source journal","type":"text","hidden":false,"required":false,"index":false},{"name":"file_attributes","description":"File attributes","type":"text","hidden":false,"required":false,"index":false},{"name":"partial","description":"Set to 1 if either path or old_path only contains the file or folder name","type":"bigint","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of file event","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"nvram","description":"Apple NVRAM variable listing.","platforms":["darwin"],"columns":[{"name":"name","description":"Variable name","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Data type (CFData, CFString, etc)","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Raw variable data","type":"text","hidden":false,"required":false,"index":false}]},{"name":"oem_strings","description":"OEM defined strings retrieved from SMBIOS.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the Type 11 structure","type":"text","hidden":false,"required":false,"index":false},{"name":"number","description":"The string index of the structure","type":"integer","hidden":false,"required":false,"index":false},{"name":"value","description":"The value of the OEM string","type":"text","hidden":false,"required":false,"index":false}]},{"name":"office_mru","description":"View recently opened Office documents.","platforms":["windows"],"columns":[{"name":"application","description":"Associated Office application","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Office application version number","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"File path","type":"text","hidden":false,"required":false,"index":false},{"name":"last_opened_time","description":"Most recent opened time file was opened","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sid","description":"User SID","type":"text","hidden":false,"required":false,"index":false}]},{"name":"os_version","description":"A single row containing the operating system name and version.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Distribution or product name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Pretty, suitable for presentation, OS version","type":"text","hidden":false,"required":false,"index":false},{"name":"major","description":"Major release version","type":"integer","hidden":false,"required":false,"index":false},{"name":"minor","description":"Minor release version","type":"integer","hidden":false,"required":false,"index":false},{"name":"patch","description":"Optional patch release","type":"integer","hidden":false,"required":false,"index":false},{"name":"build","description":"Optional build-specific or variant string","type":"text","hidden":false,"required":false,"index":false},{"name":"platform","description":"OS Platform or ID","type":"text","hidden":false,"required":false,"index":false},{"name":"platform_like","description":"Closely related platforms","type":"text","hidden":false,"required":false,"index":false},{"name":"codename","description":"OS version codename","type":"text","hidden":false,"required":false,"index":false},{"name":"arch","description":"OS Architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"install_date","description":"The install date of the OS.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"osquery_events","description":"Information about the event publishers and subscribers.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"name","description":"Event publisher or subscriber name","type":"text","hidden":false,"required":false,"index":false},{"name":"publisher","description":"Name of the associated publisher","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Either publisher or subscriber","type":"text","hidden":false,"required":false,"index":false},{"name":"subscriptions","description":"Number of subscriptions the publisher received or subscriber used","type":"integer","hidden":false,"required":false,"index":false},{"name":"events","description":"Number of events emitted or received since osquery started","type":"integer","hidden":false,"required":false,"index":false},{"name":"refreshes","description":"Publisher only: number of runloop restarts","type":"integer","hidden":false,"required":false,"index":false},{"name":"active","description":"1 if the publisher or subscriber is active else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"osquery_extensions","description":"List of active osquery extensions.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"uuid","description":"The transient ID assigned for communication","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Extension's name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Extension's version","type":"text","hidden":false,"required":false,"index":false},{"name":"sdk_version","description":"osquery SDK version used to build the extension","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of the extension's Thrift connection or library path","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"SDK extension type: extension or module","type":"text","hidden":false,"required":false,"index":false}]},{"name":"osquery_flags","description":"Configurable flags that modify osquery's behavior.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"name","description":"Flag name","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Flag type","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Flag description","type":"text","hidden":false,"required":false,"index":false},{"name":"default_value","description":"Flag default value","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Flag value","type":"text","hidden":false,"required":false,"index":false},{"name":"shell_only","description":"Is the flag shell only?","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"osquery_info","description":"Top level information about the running version of osquery.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"pid","description":"Process (or thread/handle) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"uuid","description":"Unique ID provided by the system","type":"text","hidden":false,"required":false,"index":false},{"name":"instance_id","description":"Unique, long-lived ID per instance of osquery","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"osquery toolkit version","type":"text","hidden":false,"required":false,"index":false},{"name":"config_hash","description":"Hash of the working configuration state","type":"text","hidden":false,"required":false,"index":false},{"name":"config_valid","description":"1 if the config was loaded and considered valid, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"extensions","description":"osquery extensions status","type":"text","hidden":false,"required":false,"index":false},{"name":"build_platform","description":"osquery toolkit build platform","type":"text","hidden":false,"required":false,"index":false},{"name":"build_distro","description":"osquery toolkit platform distribution name (os version)","type":"text","hidden":false,"required":false,"index":false},{"name":"start_time","description":"UNIX time in seconds when the process started","type":"integer","hidden":false,"required":false,"index":false},{"name":"watcher","description":"Process (or thread/handle) ID of optional watcher process","type":"integer","hidden":false,"required":false,"index":false},{"name":"platform_mask","description":"The osquery platform bitmask","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"osquery_packs","description":"Information about the current query packs that are loaded in osquery.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"name","description":"The given name for this query pack","type":"text","hidden":false,"required":false,"index":false},{"name":"platform","description":"Platforms this query is supported on","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Minimum osquery version that this query will run on","type":"text","hidden":false,"required":false,"index":false},{"name":"shard","description":"Shard restriction limit, 1-100, 0 meaning no restriction","type":"integer","hidden":false,"required":false,"index":false},{"name":"discovery_cache_hits","description":"The number of times that the discovery query used cached values since the last time the config was reloaded","type":"integer","hidden":false,"required":false,"index":false},{"name":"discovery_executions","description":"The number of times that the discovery queries have been executed since the last time the config was reloaded","type":"integer","hidden":false,"required":false,"index":false},{"name":"active","description":"Whether this pack is active (the version, platform and discovery queries match) yes=1, no=0.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"osquery_registry","description":"List the osquery registry plugins.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"registry","description":"Name of the osquery registry","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the plugin item","type":"text","hidden":false,"required":false,"index":false},{"name":"owner_uuid","description":"Extension route UUID (0 for core)","type":"integer","hidden":false,"required":false,"index":false},{"name":"internal","description":"1 If the plugin is internal else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"active","description":"1 If this plugin is active else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"osquery_schedule","description":"Information about the current queries that are scheduled in osquery.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"name","description":"The given name for this query","type":"text","hidden":false,"required":false,"index":false},{"name":"query","description":"The exact query to run","type":"text","hidden":false,"required":false,"index":false},{"name":"interval","description":"The interval in seconds to run this query, not an exact interval","type":"integer","hidden":false,"required":false,"index":false},{"name":"executions","description":"Number of times the query was executed","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_executed","description":"UNIX time stamp in seconds of the last completed execution","type":"bigint","hidden":false,"required":false,"index":false},{"name":"denylisted","description":"1 if the query is denylisted else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"output_size","description":"Cumulative total number of bytes generated by the resultant rows of the query","type":"bigint","hidden":false,"required":false,"index":false},{"name":"wall_time","description":"Total wall time in seconds spent executing (deprecated), hidden=True","type":"bigint","hidden":false,"required":false,"index":false},{"name":"wall_time_ms","description":"Total wall time in milliseconds spent executing","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_wall_time_ms","description":"Wall time in milliseconds of the latest execution","type":"bigint","hidden":false,"required":false,"index":false},{"name":"user_time","description":"Total user time in milliseconds spent executing","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_user_time","description":"User time in milliseconds of the latest execution","type":"bigint","hidden":false,"required":false,"index":false},{"name":"system_time","description":"Total system time in milliseconds spent executing","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_system_time","description":"System time in milliseconds of the latest execution","type":"bigint","hidden":false,"required":false,"index":false},{"name":"average_memory","description":"Average of the bytes of resident memory left allocated after collecting results","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_memory","description":"Resident memory in bytes left allocated after collecting results of the latest execution","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"package_bom","description":"macOS package bill of materials (BOM) file list.","platforms":["darwin"],"columns":[{"name":"filepath","description":"Package file or directory","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"Expected user of file or directory","type":"integer","hidden":false,"required":false,"index":false},{"name":"gid","description":"Expected group of file or directory","type":"integer","hidden":false,"required":false,"index":false},{"name":"mode","description":"Expected permissions","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Expected file size","type":"bigint","hidden":false,"required":false,"index":false},{"name":"modified_time","description":"Timestamp the file was installed","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of package bom","type":"text","hidden":false,"required":true,"index":false}]},{"name":"package_install_history","description":"macOS package install history.","platforms":["darwin"],"columns":[{"name":"package_id","description":"Label packageIdentifiers","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Label date as UNIX timestamp","type":"integer","hidden":false,"required":false,"index":false},{"name":"name","description":"Package display name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package display version","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Install source: usually the installer process name","type":"text","hidden":false,"required":false,"index":false},{"name":"content_type","description":"Package content_type (optional)","type":"text","hidden":false,"required":false,"index":false}]},{"name":"package_receipts","description":"macOS package receipt details.","platforms":["darwin"],"columns":[{"name":"package_id","description":"Package domain identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"package_filename","description":"Filename of original .pkg file","type":"text","hidden":true,"required":false,"index":false},{"name":"version","description":"Installed package version","type":"text","hidden":false,"required":false,"index":false},{"name":"location","description":"Optional relative install path on volume","type":"text","hidden":false,"required":false,"index":false},{"name":"install_time","description":"Timestamp of install time","type":"double","hidden":false,"required":false,"index":false},{"name":"installer_name","description":"Name of installer process","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of receipt plist","type":"text","hidden":false,"required":false,"index":false}]},{"name":"password_policy","description":"Password Policies for macOS.","platforms":["darwin"],"columns":[{"name":"uid","description":"User ID for the policy if available","type":"bigint","hidden":false,"required":false,"index":false},{"name":"policy_identifier","description":"Policy Identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"policy_content","description":"Policy content","type":"text","hidden":false,"required":false,"index":false},{"name":"policy_description","description":"Policy description","type":"text","hidden":false,"required":false,"index":false}]},{"name":"patches","description":"Lists all the patches applied. Note: This does not include patches applied via MSI or downloaded from Windows Update (e.g. Service Packs).","platforms":["windows"],"columns":[{"name":"csname","description":"The name of the host the patch is installed on.","type":"text","hidden":false,"required":false,"index":false},{"name":"hotfix_id","description":"The KB ID of the patch.","type":"text","hidden":false,"required":false,"index":false},{"name":"caption","description":"Short description of the patch.","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Fuller description of the patch.","type":"text","hidden":false,"required":false,"index":false},{"name":"fix_comments","description":"Additional comments about the patch.","type":"text","hidden":false,"required":false,"index":false},{"name":"installed_by","description":"The system context in which the patch as installed.","type":"text","hidden":false,"required":false,"index":false},{"name":"install_date","description":"Indicates when the patch was installed. Lack of a value does not indicate that the patch was not installed.","type":"text","hidden":false,"required":false,"index":false},{"name":"installed_on","description":"The date when the patch was installed.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"pci_devices","description":"PCI devices active on the host system.","platforms":["darwin","linux"],"columns":[{"name":"pci_slot","description":"PCI Device used slot","type":"text","hidden":false,"required":false,"index":false},{"name":"pci_class","description":"PCI Device class","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"PCI Device used driver","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor","description":"PCI Device vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor_id","description":"Hex encoded PCI Device vendor identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"PCI Device model","type":"text","hidden":false,"required":false,"index":false},{"name":"model_id","description":"Hex encoded PCI Device model identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"pci_class_id","description":"PCI Device class ID in hex format","type":"text","hidden":true,"required":false,"index":false},{"name":"pci_subclass_id","description":"PCI Device subclass in hex format","type":"text","hidden":true,"required":false,"index":false},{"name":"pci_subclass","description":"PCI Device subclass","type":"text","hidden":true,"required":false,"index":false},{"name":"subsystem_vendor_id","description":"Vendor ID of PCI device subsystem","type":"text","hidden":true,"required":false,"index":false},{"name":"subsystem_vendor","description":"Vendor of PCI device subsystem","type":"text","hidden":true,"required":false,"index":false},{"name":"subsystem_model_id","description":"Model ID of PCI device subsystem","type":"text","hidden":true,"required":false,"index":false},{"name":"subsystem_model","description":"Device description of PCI device subsystem","type":"text","hidden":true,"required":false,"index":false}]},{"name":"physical_disk_performance","description":"Provides provides raw data from performance counters that monitor hard or fixed disk drives on the system.","platforms":["windows"],"columns":[{"name":"name","description":"Name of the physical disk","type":"text","hidden":false,"required":false,"index":false},{"name":"avg_disk_bytes_per_read","description":"Average number of bytes transferred from the disk during read operations","type":"bigint","hidden":false,"required":false,"index":false},{"name":"avg_disk_bytes_per_write","description":"Average number of bytes transferred to the disk during write operations","type":"bigint","hidden":false,"required":false,"index":false},{"name":"avg_disk_read_queue_length","description":"Average number of read requests that were queued for the selected disk during the sample interval","type":"bigint","hidden":false,"required":false,"index":false},{"name":"avg_disk_write_queue_length","description":"Average number of write requests that were queued for the selected disk during the sample interval","type":"bigint","hidden":false,"required":false,"index":false},{"name":"avg_disk_sec_per_read","description":"Average time, in seconds, of a read operation of data from the disk","type":"integer","hidden":false,"required":false,"index":false},{"name":"avg_disk_sec_per_write","description":"Average time, in seconds, of a write operation of data to the disk","type":"integer","hidden":false,"required":false,"index":false},{"name":"current_disk_queue_length","description":"Number of requests outstanding on the disk at the time the performance data is collected","type":"integer","hidden":false,"required":false,"index":false},{"name":"percent_disk_read_time","description":"Percentage of elapsed time that the selected disk drive is busy servicing read requests","type":"bigint","hidden":false,"required":false,"index":false},{"name":"percent_disk_write_time","description":"Percentage of elapsed time that the selected disk drive is busy servicing write requests","type":"bigint","hidden":false,"required":false,"index":false},{"name":"percent_disk_time","description":"Percentage of elapsed time that the selected disk drive is busy servicing read or write requests","type":"bigint","hidden":false,"required":false,"index":false},{"name":"percent_idle_time","description":"Percentage of time during the sample interval that the disk was idle","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"pipes","description":"Named and Anonymous pipes.","platforms":["windows"],"columns":[{"name":"pid","description":"Process ID of the process to which the pipe belongs","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the pipe","type":"text","hidden":false,"required":false,"index":false},{"name":"instances","description":"Number of instances of the named pipe","type":"integer","hidden":false,"required":false,"index":false},{"name":"max_instances","description":"The maximum number of instances creatable for this pipe","type":"integer","hidden":false,"required":false,"index":false},{"name":"flags","description":"The flags indicating whether this pipe connection is a server or client end, and if the pipe for sending messages or bytes","type":"text","hidden":false,"required":false,"index":false}]},{"name":"pkg_packages","description":"pkgng packages that are currently installed on the host system.","platforms":["freebsd"],"columns":[{"name":"name","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package version","type":"text","hidden":false,"required":false,"index":false},{"name":"flatsize","description":"Package size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"arch","description":"Architecture(s) supported","type":"text","hidden":false,"required":false,"index":false}]},{"name":"platform_info","description":"Information about EFI/UEFI/ROM and platform/boot.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"vendor","description":"Platform code vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Platform code version","type":"text","hidden":false,"required":false,"index":false},{"name":"date","description":"Self-reported platform code update date","type":"text","hidden":false,"required":false,"index":false},{"name":"revision","description":"BIOS major and minor revision","type":"text","hidden":false,"required":false,"index":false},{"name":"address","description":"Relative address of firmware mapping","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size in bytes of firmware","type":"text","hidden":false,"required":false,"index":false},{"name":"volume_size","description":"(Optional) size of firmware volume","type":"integer","hidden":false,"required":false,"index":false},{"name":"extra","description":"Platform-specific additional information","type":"text","hidden":false,"required":false,"index":false}]},{"name":"plist","description":"Read and parse a plist file.","platforms":["darwin"],"columns":[{"name":"key","description":"Preference top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"subkey","description":"Intermediate key path, includes lists/dicts","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"String value of most CF types","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"(required) read preferences from a plist","type":"text","hidden":false,"required":true,"index":false}]},{"name":"portage_keywords","description":"A summary about portage configurations like keywords, mask and unmask.","platforms":["linux"],"columns":[{"name":"package","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"The version which are affected by the use flags, empty means all","type":"text","hidden":false,"required":false,"index":false},{"name":"keyword","description":"The keyword applied to the package","type":"text","hidden":false,"required":false,"index":false},{"name":"mask","description":"If the package is masked","type":"integer","hidden":false,"required":false,"index":false},{"name":"unmask","description":"If the package is unmasked","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"portage_packages","description":"List of currently installed packages.","platforms":["linux"],"columns":[{"name":"package","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"The version which are affected by the use flags, empty means all","type":"text","hidden":false,"required":false,"index":false},{"name":"slot","description":"The slot used by package","type":"text","hidden":false,"required":false,"index":false},{"name":"build_time","description":"Unix time when package was built","type":"bigint","hidden":false,"required":false,"index":false},{"name":"repository","description":"From which repository the ebuild was used","type":"text","hidden":false,"required":false,"index":false},{"name":"eapi","description":"The eapi for the ebuild","type":"bigint","hidden":false,"required":false,"index":false},{"name":"size","description":"The size of the package","type":"bigint","hidden":false,"required":false,"index":false},{"name":"world","description":"If package is in the world file","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"portage_use","description":"List of enabled portage USE values for specific package.","platforms":["linux"],"columns":[{"name":"package","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"The version of the installed package","type":"text","hidden":false,"required":false,"index":false},{"name":"use","description":"USE flag which has been enabled for package","type":"text","hidden":false,"required":false,"index":false}]},{"name":"power_sensors","description":"Machine power (currents, voltages, wattages, etc) sensors.","platforms":["darwin"],"columns":[{"name":"key","description":"The SMC key on macOS","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"The sensor category: currents, voltage, wattage","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of power source","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Power in Watts","type":"text","hidden":false,"required":false,"index":false}]},{"name":"powershell_events","description":"Powershell script blocks reconstructed to their full script content, this table requires script block logging to be enabled.","platforms":["windows"],"columns":[{"name":"time","description":"Timestamp the event was received by the osquery event publisher","type":"bigint","hidden":false,"required":false,"index":false},{"name":"datetime","description":"System time at which the Powershell script event occurred","type":"text","hidden":false,"required":false,"index":false},{"name":"script_block_id","description":"The unique GUID of the powershell script to which this block belongs","type":"text","hidden":false,"required":false,"index":false},{"name":"script_block_count","description":"The total number of script blocks for this script","type":"integer","hidden":false,"required":false,"index":false},{"name":"script_text","description":"The text content of the Powershell script","type":"text","hidden":false,"required":false,"index":false},{"name":"script_name","description":"The name of the Powershell script","type":"text","hidden":false,"required":false,"index":false},{"name":"script_path","description":"The path for the Powershell script","type":"text","hidden":false,"required":false,"index":false},{"name":"cosine_similarity","description":"How similar the Powershell script is to a provided 'normal' character frequency","type":"double","hidden":false,"required":false,"index":false}]},{"name":"preferences","description":"macOS defaults and managed preferences.","platforms":["darwin"],"columns":[{"name":"domain","description":"Application ID usually in com.name.product format","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Preference top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"subkey","description":"Intemediate key path, includes lists/dicts","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"String value of most CF types","type":"text","hidden":false,"required":false,"index":false},{"name":"forced","description":"1 if the value is forced/managed, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"username","description":"(optional) read preferences for a specific user","type":"text","hidden":false,"required":false,"index":false},{"name":"host","description":"'current' or 'any' host, where 'current' takes precedence","type":"text","hidden":false,"required":false,"index":false}]},{"name":"prefetch","description":"Prefetch files show metadata related to file execution.","platforms":["windows"],"columns":[{"name":"path","description":"Prefetch file path.","type":"text","hidden":false,"required":false,"index":false},{"name":"filename","description":"Executable filename.","type":"text","hidden":false,"required":false,"index":false},{"name":"hash","description":"Prefetch CRC hash.","type":"text","hidden":false,"required":false,"index":false},{"name":"last_run_time","description":"Most recent time application was run.","type":"integer","hidden":false,"required":false,"index":false},{"name":"other_run_times","description":"Other execution times in prefetch file.","type":"text","hidden":false,"required":false,"index":false},{"name":"run_count","description":"Number of times the application has been run.","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Application file size.","type":"integer","hidden":false,"required":false,"index":false},{"name":"volume_serial","description":"Volume serial number.","type":"text","hidden":false,"required":false,"index":false},{"name":"volume_creation","description":"Volume creation time.","type":"text","hidden":false,"required":false,"index":false},{"name":"accessed_files_count","description":"Number of files accessed.","type":"integer","hidden":false,"required":false,"index":false},{"name":"accessed_directories_count","description":"Number of directories accessed.","type":"integer","hidden":false,"required":false,"index":false},{"name":"accessed_files","description":"Files accessed by application within ten seconds of launch.","type":"text","hidden":false,"required":false,"index":false},{"name":"accessed_directories","description":"Directories accessed by application within ten seconds of launch.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"process_envs","description":"A key/value table of environment variables for each process.","platforms":["darwin","linux"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"key","description":"Environment variable name","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Environment variable value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"process_events","description":"Track time/action process executions.","platforms":["darwin","linux"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of executed file","type":"text","hidden":false,"required":false,"index":false},{"name":"mode","description":"File mode permissions","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Command line arguments (argv)","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline_size","description":"Actual size (bytes) of command line arguments","type":"bigint","hidden":true,"required":false,"index":false},{"name":"env","description":"Environment variables delimited by spaces","type":"text","hidden":true,"required":false,"index":false},{"name":"env_count","description":"Number of environment variables","type":"bigint","hidden":true,"required":false,"index":false},{"name":"env_size","description":"Actual size (bytes) of environment list","type":"bigint","hidden":true,"required":false,"index":false},{"name":"cwd","description":"The process current working directory","type":"text","hidden":false,"required":false,"index":false},{"name":"auid","description":"Audit User ID at process start","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID at process start","type":"bigint","hidden":false,"required":false,"index":false},{"name":"euid","description":"Effective user ID at process start","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID at process start","type":"bigint","hidden":false,"required":false,"index":false},{"name":"egid","description":"Effective group ID at process start","type":"bigint","hidden":false,"required":false,"index":false},{"name":"owner_uid","description":"File owner user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"owner_gid","description":"File owner group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"atime","description":"File last access in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mtime","description":"File modification in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ctime","description":"File last metadata change in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"btime","description":"File creation in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"overflows","description":"List of structures that overflowed","type":"text","hidden":true,"required":false,"index":false},{"name":"parent","description":"Process parent's PID, or -1 if cannot be determined.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false},{"name":"status","description":"OpenBSM Attribute: Status of the process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"fsuid","description":"Filesystem user ID at process start","type":"bigint","hidden":true,"required":false,"index":false},{"name":"suid","description":"Saved user ID at process start","type":"bigint","hidden":true,"required":false,"index":false},{"name":"fsgid","description":"Filesystem group ID at process start","type":"bigint","hidden":true,"required":false,"index":false},{"name":"sgid","description":"Saved group ID at process start","type":"bigint","hidden":true,"required":false,"index":false},{"name":"syscall","description":"Syscall name: fork, vfork, clone, execve, execveat","type":"text","hidden":true,"required":false,"index":false}]},{"name":"process_file_events","description":"A File Integrity Monitor implementation using the audit service.","platforms":["linux"],"columns":[{"name":"operation","description":"Operation type","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ppid","description":"Parent process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"executable","description":"The executable path","type":"text","hidden":false,"required":false,"index":false},{"name":"partial","description":"True if this is a partial event (i.e.: this process existed before we started osquery)","type":"text","hidden":false,"required":false,"index":false},{"name":"cwd","description":"The current working directory of the process","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"The path associated with the event","type":"text","hidden":false,"required":false,"index":false},{"name":"dest_path","description":"The canonical path associated with the event","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"The uid of the process performing the action","type":"text","hidden":false,"required":false,"index":false},{"name":"gid","description":"The gid of the process performing the action","type":"text","hidden":false,"required":false,"index":false},{"name":"auid","description":"Audit user ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"euid","description":"Effective user ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"egid","description":"Effective group ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"fsuid","description":"Filesystem user ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"fsgid","description":"Filesystem group ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"suid","description":"Saved user ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"sgid","description":"Saved group ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"process_memory_map","description":"Process memory mapped files and pseudo device/regions.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"start","description":"Virtual start address (hex)","type":"text","hidden":false,"required":false,"index":false},{"name":"end","description":"Virtual end address (hex)","type":"text","hidden":false,"required":false,"index":false},{"name":"permissions","description":"r=read, w=write, x=execute, p=private (cow)","type":"text","hidden":false,"required":false,"index":false},{"name":"offset","description":"Offset into mapped path","type":"bigint","hidden":false,"required":false,"index":false},{"name":"device","description":"MA:MI Major/minor device ID","type":"text","hidden":false,"required":false,"index":false},{"name":"inode","description":"Mapped path inode, 0 means uninitialized (BSS)","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to mapped file or mapped type","type":"text","hidden":false,"required":false,"index":false},{"name":"pseudo","description":"1 If path is a pseudo path, else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"process_namespaces","description":"Linux namespaces for processes running on the host system.","platforms":["linux"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"cgroup_namespace","description":"cgroup namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"ipc_namespace","description":"ipc namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"mnt_namespace","description":"mnt namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"net_namespace","description":"net namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_namespace","description":"pid namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"user_namespace","description":"user namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"uts_namespace","description":"uts namespace inode","type":"text","hidden":false,"required":false,"index":false}]},{"name":"process_open_files","description":"File descriptors for each process.","platforms":["darwin","linux"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"fd","description":"Process-specific file descriptor number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Filesystem path of descriptor","type":"text","hidden":false,"required":false,"index":false}]},{"name":"process_open_pipes","description":"Pipes and partner processes for each process.","platforms":["linux"],"columns":[{"name":"pid","description":"Process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"fd","description":"File descriptor","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mode","description":"Pipe open mode (r/w)","type":"text","hidden":false,"required":false,"index":false},{"name":"inode","description":"Pipe inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"type","description":"Pipe Type: named vs unnamed/anonymous","type":"text","hidden":false,"required":false,"index":false},{"name":"partner_pid","description":"Process ID of partner process sharing a particular pipe","type":"bigint","hidden":false,"required":false,"index":false},{"name":"partner_fd","description":"File descriptor of shared pipe at partner's end","type":"bigint","hidden":false,"required":false,"index":false},{"name":"partner_mode","description":"Mode of shared pipe at partner's end","type":"text","hidden":false,"required":false,"index":false}]},{"name":"process_open_sockets","description":"Processes which have open network sockets on the system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"fd","description":"Socket file descriptor number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"socket","description":"Socket handle or inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"family","description":"Network protocol (IPv4, IPv6)","type":"integer","hidden":false,"required":false,"index":false},{"name":"protocol","description":"Transport protocol (TCP/UDP)","type":"integer","hidden":false,"required":false,"index":false},{"name":"local_address","description":"Socket local address","type":"text","hidden":false,"required":false,"index":false},{"name":"remote_address","description":"Socket remote address","type":"text","hidden":false,"required":false,"index":false},{"name":"local_port","description":"Socket local port","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_port","description":"Socket remote port","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"For UNIX sockets (family=AF_UNIX), the domain path","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"TCP socket state","type":"text","hidden":false,"required":false,"index":false},{"name":"net_namespace","description":"The inode number of the network namespace","type":"text","hidden":true,"required":false,"index":false}]},{"name":"processes","description":"All running processes on the host system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"The process path or shorthand argv[0]","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to executed binary","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Complete argv","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Process state","type":"text","hidden":false,"required":false,"index":false},{"name":"cwd","description":"Process current working directory","type":"text","hidden":false,"required":false,"index":false},{"name":"root","description":"Process virtual root directory","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"Unsigned user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Unsigned group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"euid","description":"Unsigned effective user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"egid","description":"Unsigned effective group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"suid","description":"Unsigned saved user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sgid","description":"Unsigned saved group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"on_disk","description":"The process path exists yes=1, no=0, unknown=-1","type":"integer","hidden":false,"required":false,"index":false},{"name":"wired_size","description":"Bytes of unpageable memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"resident_size","description":"Bytes of private memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"total_size","description":"Total virtual memory size","type":"bigint","hidden":false,"required":false,"index":false},{"name":"user_time","description":"CPU time in milliseconds spent in user space","type":"bigint","hidden":false,"required":false,"index":false},{"name":"system_time","description":"CPU time in milliseconds spent in kernel space","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_bytes_read","description":"Bytes read from disk","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_bytes_written","description":"Bytes written to disk","type":"bigint","hidden":false,"required":false,"index":false},{"name":"start_time","description":"Process start time in seconds since Epoch, in case of error -1","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Process parent's PID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pgroup","description":"Process group","type":"bigint","hidden":false,"required":false,"index":false},{"name":"threads","description":"Number of threads used by process","type":"integer","hidden":false,"required":false,"index":false},{"name":"nice","description":"Process nice level (-20 to 20, default 0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"elevated_token","description":"Process uses elevated token yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"secure_process","description":"Process is secure (IUM) yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"protection_type","description":"The protection type of the process","type":"text","hidden":true,"required":false,"index":false},{"name":"virtual_process","description":"Process is virtual (e.g. System, Registry, vmmem) yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"elapsed_time","description":"Elapsed time in seconds this process has been running.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"handle_count","description":"Total number of handles that the process has open. This number is the sum of the handles currently opened by each thread in the process.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"percent_processor_time","description":"Returns elapsed time that all of the threads of this process used the processor to execute instructions in 100 nanoseconds ticks.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"upid","description":"A 64bit pid that is never reused. Returns -1 if we couldn't gather them from the system.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uppid","description":"The 64bit parent pid that is never reused. Returns -1 if we couldn't gather them from the system.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cpu_type","description":"Indicates the specific processor designed for installation.","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_subtype","description":"Indicates the specific processor on which an entry may be used.","type":"integer","hidden":false,"required":false,"index":false},{"name":"translated","description":"Indicates whether the process is running under the Rosetta Translation Environment, yes=1, no=0, error=-1.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"programs","description":"Represents products as they are installed by Windows Installer. A product generally correlates to one installation package on Windows. Some fields may be blank as Windows installation details are left to the discretion of the product author.","platforms":["windows"],"columns":[{"name":"name","description":"Commonly used product name.","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Product version information.","type":"text","hidden":false,"required":false,"index":false},{"name":"install_location","description":"The installation location directory of the product.","type":"text","hidden":false,"required":false,"index":false},{"name":"install_source","description":"The installation source of the product.","type":"text","hidden":false,"required":false,"index":false},{"name":"language","description":"The language of the product.","type":"text","hidden":false,"required":false,"index":false},{"name":"publisher","description":"Name of the product supplier.","type":"text","hidden":false,"required":false,"index":false},{"name":"uninstall_string","description":"Path and filename of the uninstaller.","type":"text","hidden":false,"required":false,"index":false},{"name":"install_date","description":"Date that this product was installed on the system. ","type":"text","hidden":false,"required":false,"index":false},{"name":"identifying_number","description":"Product identification such as a serial number on software, or a die number on a hardware chip.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"prometheus_metrics","description":"Retrieve metrics from a Prometheus server.","platforms":["darwin","linux"],"columns":[{"name":"target_name","description":"Address of prometheus target","type":"text","hidden":false,"required":false,"index":false},{"name":"metric_name","description":"Name of collected Prometheus metric","type":"text","hidden":false,"required":false,"index":false},{"name":"metric_value","description":"Value of collected Prometheus metric","type":"double","hidden":false,"required":false,"index":false},{"name":"timestamp_ms","description":"Unix timestamp of collected data in MS","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"python_packages","description":"Python packages installed in a system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Package display name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package-supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"summary","description":"Package-supplied summary","type":"text","hidden":false,"required":false,"index":false},{"name":"author","description":"Optional package author","type":"text","hidden":false,"required":false,"index":false},{"name":"license","description":"License under which package is launched","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path at which this module resides","type":"text","hidden":false,"required":false,"index":false},{"name":"directory","description":"Directory where Python modules are located","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"quicklook_cache","description":"Files and thumbnails within macOS's Quicklook Cache.","platforms":["darwin"],"columns":[{"name":"path","description":"Path of file","type":"text","hidden":false,"required":false,"index":false},{"name":"rowid","description":"Quicklook file rowid key","type":"integer","hidden":false,"required":false,"index":false},{"name":"fs_id","description":"Quicklook file fs_id key","type":"text","hidden":false,"required":false,"index":false},{"name":"volume_id","description":"Parsed volume ID from fs_id","type":"integer","hidden":false,"required":false,"index":false},{"name":"inode","description":"Parsed file ID (inode) from fs_id","type":"integer","hidden":false,"required":false,"index":false},{"name":"mtime","description":"Parsed version date field","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Parsed version size field","type":"bigint","hidden":false,"required":false,"index":false},{"name":"label","description":"Parsed version 'gen' field","type":"text","hidden":false,"required":false,"index":false},{"name":"last_hit_date","description":"Apple date format for last thumbnail cache hit","type":"integer","hidden":false,"required":false,"index":false},{"name":"hit_count","description":"Number of cache hits on thumbnail","type":"text","hidden":false,"required":false,"index":false},{"name":"icon_mode","description":"Thumbnail icon mode","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cache_path","description":"Path to cache data","type":"text","hidden":false,"required":false,"index":false}]},{"name":"registry","description":"All of the Windows registry hives.","platforms":["windows"],"columns":[{"name":"key","description":"Name of the key to search for","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Full path to the value","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the registry value entry","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of the registry value, or 'subkey' if item is a subkey","type":"text","hidden":false,"required":false,"index":false},{"name":"data","description":"Data content of registry value","type":"text","hidden":false,"required":false,"index":false},{"name":"mtime","description":"timestamp of the most recent registry write","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"routes","description":"The active route table for the host system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"destination","description":"Destination IP address","type":"text","hidden":false,"required":false,"index":false},{"name":"netmask","description":"Netmask length","type":"integer","hidden":false,"required":false,"index":false},{"name":"gateway","description":"Route gateway","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Route source","type":"text","hidden":false,"required":false,"index":false},{"name":"flags","description":"Flags to describe route","type":"integer","hidden":false,"required":false,"index":false},{"name":"interface","description":"Route local interface","type":"text","hidden":false,"required":false,"index":false},{"name":"mtu","description":"Maximum Transmission Unit for the route","type":"integer","hidden":false,"required":false,"index":false},{"name":"metric","description":"Cost of route. Lowest is preferred","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of route","type":"text","hidden":false,"required":false,"index":false},{"name":"hopcount","description":"Max hops expected","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"rpm_package_files","description":"RPM packages that are currently installed on the host system.","platforms":["linux"],"columns":[{"name":"package","description":"RPM package name","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"File path within the package","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"File default username from info DB","type":"text","hidden":false,"required":false,"index":false},{"name":"groupname","description":"File default groupname from info DB","type":"text","hidden":false,"required":false,"index":false},{"name":"mode","description":"File permissions mode from info DB","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Expected file size in bytes from RPM info DB","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sha256","description":"SHA256 file digest from RPM info DB","type":"text","hidden":false,"required":false,"index":false}]},{"name":"rpm_packages","description":"RPM packages that are currently installed on the host system.","platforms":["linux"],"columns":[{"name":"name","description":"RPM package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package version","type":"text","hidden":false,"required":false,"index":false},{"name":"release","description":"Package release","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Source RPM package name (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Package size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sha1","description":"SHA1 hash of the package contents","type":"text","hidden":false,"required":false,"index":false},{"name":"arch","description":"Architecture(s) supported","type":"text","hidden":false,"required":false,"index":false},{"name":"epoch","description":"Package epoch value","type":"integer","hidden":false,"required":false,"index":false},{"name":"install_time","description":"When the package was installed","type":"integer","hidden":false,"required":false,"index":false},{"name":"vendor","description":"Package vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"package_group","description":"Package group","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"running_apps","description":"macOS applications currently running on the host system.","platforms":["darwin"],"columns":[{"name":"pid","description":"The pid of the application","type":"integer","hidden":false,"required":false,"index":false},{"name":"bundle_identifier","description":"The bundle identifier of the application","type":"text","hidden":false,"required":false,"index":false},{"name":"is_active","description":"1 if the application is in focus, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"safari_extensions","description":"Safari browser extension details for all users.","platforms":["darwin"],"columns":[{"name":"uid","description":"The local user that owns the extension","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Extension display name","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Extension identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Extension long version","type":"text","hidden":false,"required":false,"index":false},{"name":"sdk","description":"Bundle SDK used to compile extension","type":"text","hidden":false,"required":false,"index":false},{"name":"update_url","description":"Extension-supplied update URI","type":"text","hidden":false,"required":false,"index":false},{"name":"author","description":"Optional extension author","type":"text","hidden":false,"required":false,"index":false},{"name":"developer_id","description":"Optional developer identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Optional extension description text","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to extension XAR bundle","type":"text","hidden":false,"required":false,"index":false}]},{"name":"sandboxes","description":"macOS application sandboxes container details.","platforms":["darwin"],"columns":[{"name":"label","description":"UTI-format bundle or label ID","type":"text","hidden":false,"required":false,"index":false},{"name":"user","description":"Sandbox owner","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"Application sandboxings enabled on container","type":"integer","hidden":false,"required":false,"index":false},{"name":"build_id","description":"Sandbox-specific identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_path","description":"Application bundle used by the sandbox","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to sandbox container directory","type":"text","hidden":false,"required":false,"index":false}]},{"name":"scheduled_tasks","description":"Lists all of the tasks in the Windows task scheduler.","platforms":["windows"],"columns":[{"name":"name","description":"Name of the scheduled task","type":"text","hidden":false,"required":false,"index":false},{"name":"action","description":"Actions executed by the scheduled task","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to the executable to be run","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"Whether or not the scheduled task is enabled","type":"integer","hidden":false,"required":false,"index":false},{"name":"state","description":"State of the scheduled task","type":"text","hidden":false,"required":false,"index":false},{"name":"hidden","description":"Whether or not the task is visible in the UI","type":"integer","hidden":false,"required":false,"index":false},{"name":"last_run_time","description":"Timestamp the task last ran","type":"bigint","hidden":false,"required":false,"index":false},{"name":"next_run_time","description":"Timestamp the task is scheduled to run next","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_run_message","description":"Exit status message of the last task run","type":"text","hidden":false,"required":false,"index":false},{"name":"last_run_code","description":"Exit status code of the last task run","type":"text","hidden":false,"required":false,"index":false}]},{"name":"screenlock","description":"macOS screenlock status for the current logged in user context.","platforms":["darwin"],"columns":[{"name":"enabled","description":"1 If a password is required after sleep or the screensaver begins; else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"grace_period","description":"The amount of time in seconds the screen must be asleep or the screensaver on before a password is required on-wake. 0 = immediately; -1 = no password is required on-wake","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"seccomp_events","description":"A virtual table that tracks seccomp events.","platforms":["linux"],"columns":[{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"auid","description":"Audit user ID (loginuid) of the user who started the analyzed process","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID of the user who started the analyzed process","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID of the user who started the analyzed process","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"ses","description":"Session ID of the session from which the analyzed process was invoked","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"comm","description":"Command-line name of the command that was used to invoke the analyzed process","type":"text","hidden":false,"required":false,"index":false},{"name":"exe","description":"The path to the executable that was used to invoke the analyzed process","type":"text","hidden":false,"required":false,"index":false},{"name":"sig","description":"Signal value sent to process by seccomp","type":"bigint","hidden":false,"required":false,"index":false},{"name":"arch","description":"Information about the CPU architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"syscall","description":"Type of the system call","type":"text","hidden":false,"required":false,"index":false},{"name":"compat","description":"Is system call in compatibility mode","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ip","description":"Instruction pointer value","type":"text","hidden":false,"required":false,"index":false},{"name":"code","description":"The seccomp action","type":"text","hidden":false,"required":false,"index":false}]},{"name":"secureboot","description":"Secure Boot UEFI Settings.","platforms":["linux","windows"],"columns":[{"name":"secure_boot","description":"Whether secure boot is enabled","type":"integer","hidden":false,"required":false,"index":false},{"name":"setup_mode","description":"Whether setup mode is enabled","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"selinux_events","description":"Track SELinux events.","platforms":["linux"],"columns":[{"name":"type","description":"Event type","type":"text","hidden":false,"required":false,"index":false},{"name":"message","description":"Message","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"selinux_settings","description":"Track active SELinux settings.","platforms":["linux"],"columns":[{"name":"scope","description":"Where the key is located inside the SELinuxFS mount point.","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Key or class name.","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Active value.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"services","description":"Lists all installed Windows services and their relevant data.","platforms":["windows"],"columns":[{"name":"name","description":"Service name","type":"text","hidden":false,"required":false,"index":false},{"name":"service_type","description":"Service Type: OWN_PROCESS, SHARE_PROCESS and maybe Interactive (can interact with the desktop)","type":"text","hidden":false,"required":false,"index":false},{"name":"display_name","description":"Service Display name","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Service Current status: STOPPED, START_PENDING, STOP_PENDING, RUNNING, CONTINUE_PENDING, PAUSE_PENDING, PAUSED","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"the Process ID of the service","type":"integer","hidden":false,"required":false,"index":false},{"name":"start_type","description":"Service start type: BOOT_START, SYSTEM_START, AUTO_START, DEMAND_START, DISABLED","type":"text","hidden":false,"required":false,"index":false},{"name":"win32_exit_code","description":"The error code that the service uses to report an error that occurs when it is starting or stopping","type":"integer","hidden":false,"required":false,"index":false},{"name":"service_exit_code","description":"The service-specific error code that the service returns when an error occurs while the service is starting or stopping","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to Service Executable","type":"text","hidden":false,"required":false,"index":false},{"name":"module_path","description":"Path to ServiceDll","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Service Description","type":"text","hidden":false,"required":false,"index":false},{"name":"user_account","description":"The name of the account that the service process will be logged on as when it runs. This name can be of the form Domain\\UserName. If the account belongs to the built-in domain, the name can be of the form .\\UserName.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"shadow","description":"Local system users encrypted passwords and related information. Please note, that you usually need superuser rights to access `/etc/shadow`.","platforms":["linux"],"columns":[{"name":"password_status","description":"Password status","type":"text","hidden":false,"required":false,"index":false},{"name":"hash_alg","description":"Password hashing algorithm","type":"text","hidden":false,"required":false,"index":false},{"name":"last_change","description":"Date of last password change (starting from UNIX epoch date)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"min","description":"Minimal number of days between password changes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"max","description":"Maximum number of days between password changes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"warning","description":"Number of days before password expires to warn user about it","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inactive","description":"Number of days after password expires until account is blocked","type":"bigint","hidden":false,"required":false,"index":false},{"name":"expire","description":"Number of days since UNIX epoch date until account is disabled","type":"bigint","hidden":false,"required":false,"index":false},{"name":"flag","description":"Reserved","type":"bigint","hidden":false,"required":false,"index":false},{"name":"username","description":"Username","type":"text","hidden":false,"required":false,"index":false}]},{"name":"shared_folders","description":"Folders available to others via SMB or AFP.","platforms":["darwin"],"columns":[{"name":"name","description":"The shared name of the folder as it appears to other users","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Absolute path of shared folder on the local system","type":"text","hidden":false,"required":false,"index":false}]},{"name":"shared_memory","description":"OS shared memory regions.","platforms":["linux"],"columns":[{"name":"shmid","description":"Shared memory segment ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"owner_uid","description":"User ID of owning process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"creator_uid","description":"User ID of creator process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID to last use the segment","type":"bigint","hidden":false,"required":false,"index":false},{"name":"creator_pid","description":"Process ID that created the segment","type":"bigint","hidden":false,"required":false,"index":false},{"name":"atime","description":"Attached time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"dtime","description":"Detached time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ctime","description":"Changed time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"permissions","description":"Memory segment permissions","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"attached","description":"Number of attached processes","type":"integer","hidden":false,"required":false,"index":false},{"name":"status","description":"Destination/attach status","type":"text","hidden":false,"required":false,"index":false},{"name":"locked","description":"1 if segment is locked else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"shared_resources","description":"Displays shared resources on a computer system running Windows. This may be a disk drive, printer, interprocess communication, or other sharable device.","platforms":["windows"],"columns":[{"name":"description","description":"A textual description of the object","type":"text","hidden":false,"required":false,"index":false},{"name":"install_date","description":"Indicates when the object was installed. Lack of a value does not indicate that the object is not installed.","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"String that indicates the current status of the object.","type":"text","hidden":false,"required":false,"index":false},{"name":"allow_maximum","description":"Number of concurrent users for this resource has been limited. If True, the value in the MaximumAllowed property is ignored.","type":"integer","hidden":false,"required":false,"index":false},{"name":"maximum_allowed","description":"Limit on the maximum number of users allowed to use this resource concurrently. The value is only valid if the AllowMaximum property is set to FALSE.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Alias given to a path set up as a share on a computer system running Windows.","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Local path of the Windows share.","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of resource being shared. Types include: disk drives, print queues, interprocess communications (IPC), and general devices.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"type_name","description":"Human readable value for the 'type' column","type":"text","hidden":false,"required":false,"index":false}]},{"name":"sharing_preferences","description":"macOS Sharing preferences.","platforms":["darwin"],"columns":[{"name":"screen_sharing","description":"1 If screen sharing is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"file_sharing","description":"1 If file sharing is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"printer_sharing","description":"1 If printer sharing is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_login","description":"1 If remote login is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_management","description":"1 If remote management is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_apple_events","description":"1 If remote apple events are enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"internet_sharing","description":"1 If internet sharing is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"bluetooth_sharing","description":"1 If bluetooth sharing is enabled for any user else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"disc_sharing","description":"1 If CD or DVD sharing is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"content_caching","description":"1 If content caching is enabled else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"shell_history","description":"A line-delimited (command) table of per-user .*_history data.","platforms":["darwin","linux"],"columns":[{"name":"uid","description":"Shell history owner","type":"bigint","hidden":false,"required":false,"index":false},{"name":"time","description":"Entry timestamp. It could be absent, default value is 0.","type":"integer","hidden":false,"required":false,"index":false},{"name":"command","description":"Unparsed date/line/command history line","type":"text","hidden":false,"required":false,"index":false},{"name":"history_file","description":"Path to the .*_history for this user","type":"text","hidden":false,"required":false,"index":false}]},{"name":"shellbags","description":"Shows directories accessed via Windows Explorer.","platforms":["windows"],"columns":[{"name":"sid","description":"User SID","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Shellbags source Registry file","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Directory name.","type":"text","hidden":false,"required":false,"index":false},{"name":"modified_time","description":"Directory Modified time.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"created_time","description":"Directory Created time.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"accessed_time","description":"Directory Accessed time.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mft_entry","description":"Directory master file table entry.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mft_sequence","description":"Directory master file table sequence.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"shimcache","description":"Application Compatibility Cache, contains artifacts of execution.","platforms":["windows"],"columns":[{"name":"entry","description":"Execution order.","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"This is the path to the executed file.","type":"text","hidden":false,"required":false,"index":false},{"name":"modified_time","description":"File Modified time.","type":"integer","hidden":false,"required":false,"index":false},{"name":"execution_flag","description":"Boolean Execution flag, 1 for execution, 0 for no execution, -1 for missing (this flag does not exist on Windows 10 and higher).","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"signature","description":"File (executable, bundle, installer, disk) code signing status.","platforms":["darwin"],"columns":[{"name":"path","description":"Must provide a path or directory","type":"text","hidden":false,"required":true,"index":false},{"name":"hash_resources","description":"Set to 1 to also hash resources, or 0 otherwise. Default is 1","type":"integer","hidden":false,"required":false,"index":false},{"name":"arch","description":"If applicable, the arch of the signed code","type":"text","hidden":false,"required":false,"index":false},{"name":"signed","description":"1 If the file is signed else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"identifier","description":"The signing identifier sealed into the signature","type":"text","hidden":false,"required":false,"index":false},{"name":"cdhash","description":"Hash of the application Code Directory","type":"text","hidden":false,"required":false,"index":false},{"name":"team_identifier","description":"The team signing identifier sealed into the signature","type":"text","hidden":false,"required":false,"index":false},{"name":"authority","description":"Certificate Common Name","type":"text","hidden":false,"required":false,"index":false}]},{"name":"sip_config","description":"Apple's System Integrity Protection (rootless) status.","platforms":["darwin"],"columns":[{"name":"config_flag","description":"The System Integrity Protection config flag","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"1 if this configuration is enabled, otherwise 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"enabled_nvram","description":"1 if this configuration is enabled, otherwise 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"smbios_tables","description":"BIOS (DMI) structure common details and content.","platforms":["darwin","linux"],"columns":[{"name":"number","description":"Table entry number","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Table entry type","type":"integer","hidden":false,"required":false,"index":false},{"name":"description","description":"Table entry description","type":"text","hidden":false,"required":false,"index":false},{"name":"handle","description":"Table entry handle","type":"integer","hidden":false,"required":false,"index":false},{"name":"header_size","description":"Header size in bytes","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Table entry size in bytes","type":"integer","hidden":false,"required":false,"index":false},{"name":"md5","description":"MD5 hash of table entry","type":"text","hidden":false,"required":false,"index":false}]},{"name":"smc_keys","description":"Apple's system management controller keys.","platforms":["darwin"],"columns":[{"name":"key","description":"4-character key","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"SMC-reported type literal type","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Reported size of data in bytes","type":"integer","hidden":false,"required":false,"index":false},{"name":"value","description":"A type-encoded representation of the key value","type":"text","hidden":false,"required":false,"index":false},{"name":"hidden","description":"1 if this key is normally hidden, otherwise 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"socket_events","description":"Track network socket opens and closes.","platforms":["darwin","linux"],"columns":[{"name":"action","description":"The socket action (bind, listen, close)","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of executed file","type":"text","hidden":false,"required":false,"index":false},{"name":"fd","description":"The file description for the process socket","type":"text","hidden":false,"required":false,"index":false},{"name":"auid","description":"Audit User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"status","description":"Either 'succeeded', 'failed', 'in_progress' (connect() on non-blocking socket) or 'no_client' (null accept() on non-blocking socket)","type":"text","hidden":false,"required":false,"index":false},{"name":"family","description":"The Internet protocol family ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"protocol","description":"The network protocol ID","type":"integer","hidden":true,"required":false,"index":false},{"name":"local_address","description":"Local address associated with socket","type":"text","hidden":false,"required":false,"index":false},{"name":"remote_address","description":"Remote address associated with socket","type":"text","hidden":false,"required":false,"index":false},{"name":"local_port","description":"Local network protocol port number","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_port","description":"Remote network protocol port number","type":"integer","hidden":false,"required":false,"index":false},{"name":"socket","description":"The local path (UNIX domain socket only)","type":"text","hidden":true,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false},{"name":"success","description":"Deprecated. Use the 'status' column instead","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"ssh_configs","description":"A table of parsed ssh_configs.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"The local owner of the ssh_config file","type":"bigint","hidden":false,"required":false,"index":false},{"name":"block","description":"The host or match block","type":"text","hidden":false,"required":false,"index":false},{"name":"option","description":"The option and value","type":"text","hidden":false,"required":false,"index":false},{"name":"ssh_config_file","description":"Path to the ssh_config file","type":"text","hidden":false,"required":false,"index":false}]},{"name":"startup_items","description":"Applications and binaries set as user/login startup items.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Name of startup item","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of startup item","type":"text","hidden":false,"required":false,"index":false},{"name":"args","description":"Arguments provided to startup executable","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Startup Item or Login Item","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Directory or plist containing startup item","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Startup status; either enabled or disabled","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"The user associated with the startup item","type":"text","hidden":false,"required":false,"index":false}]},{"name":"sudoers","description":"Rules for running commands as other users via sudo.","platforms":["darwin","linux"],"columns":[{"name":"source","description":"Source file containing the given rule","type":"text","hidden":false,"required":false,"index":false},{"name":"header","description":"Symbol for given rule","type":"text","hidden":false,"required":false,"index":false},{"name":"rule_details","description":"Rule definition","type":"text","hidden":false,"required":false,"index":false}]},{"name":"suid_bin","description":"suid binaries in common locations.","platforms":["darwin","linux"],"columns":[{"name":"path","description":"Binary path","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"Binary owner username","type":"text","hidden":false,"required":false,"index":false},{"name":"groupname","description":"Binary owner group","type":"text","hidden":false,"required":false,"index":false},{"name":"permissions","description":"Binary permissions","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"syslog_events","description":"","platforms":["linux"],"columns":[{"name":"time","description":"Current unix epoch time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"datetime","description":"Time known to syslog","type":"text","hidden":false,"required":false,"index":false},{"name":"host","description":"Hostname configured for syslog","type":"text","hidden":false,"required":false,"index":false},{"name":"severity","description":"Syslog severity","type":"integer","hidden":false,"required":false,"index":false},{"name":"facility","description":"Syslog facility","type":"text","hidden":false,"required":false,"index":false},{"name":"tag","description":"The syslog tag","type":"text","hidden":false,"required":false,"index":false},{"name":"message","description":"The syslog message","type":"text","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"system_controls","description":"sysctl names, values, and settings information.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"Full sysctl MIB name","type":"text","hidden":false,"required":false,"index":false},{"name":"oid","description":"Control MIB","type":"text","hidden":false,"required":false,"index":false},{"name":"subsystem","description":"Subsystem ID, control type","type":"text","hidden":false,"required":false,"index":false},{"name":"current_value","description":"Value of setting","type":"text","hidden":false,"required":false,"index":false},{"name":"config_value","description":"The MIB value set in /etc/sysctl.conf","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Data type","type":"text","hidden":false,"required":false,"index":false},{"name":"field_name","description":"Specific attribute of opaque type","type":"text","hidden":false,"required":false,"index":false}]},{"name":"system_extensions","description":"macOS (>= 10.15) system extension table.","platforms":["darwin"],"columns":[{"name":"path","description":"Original path of system extension","type":"text","hidden":false,"required":false,"index":false},{"name":"UUID","description":"Extension unique id","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"System extension state","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Identifier name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"System extension version","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"System extension category","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_path","description":"System extension bundle path","type":"text","hidden":false,"required":false,"index":false},{"name":"team","description":"Signing team ID","type":"text","hidden":false,"required":false,"index":false},{"name":"mdm_managed","description":"1 if managed by MDM system extension payload configuration, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"system_info","description":"System information for identification.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"hostname","description":"Network hostname including domain","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"Unique ID provided by the system","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu_type","description":"CPU type","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu_subtype","description":"CPU subtype","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu_brand","description":"CPU brand string, contains vendor and model","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu_physical_cores","description":"Number of physical CPU cores in to the system","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_logical_cores","description":"Number of logical CPU cores available to the system","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_microcode","description":"Microcode version","type":"text","hidden":false,"required":false,"index":false},{"name":"physical_memory","description":"Total physical memory in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"hardware_vendor","description":"Hardware vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"hardware_model","description":"Hardware model","type":"text","hidden":false,"required":false,"index":false},{"name":"hardware_version","description":"Hardware version","type":"text","hidden":false,"required":false,"index":false},{"name":"hardware_serial","description":"Device serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"board_vendor","description":"Board vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"board_model","description":"Board model","type":"text","hidden":false,"required":false,"index":false},{"name":"board_version","description":"Board version","type":"text","hidden":false,"required":false,"index":false},{"name":"board_serial","description":"Board serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"computer_name","description":"Friendly computer name (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"local_hostname","description":"Local hostname (optional)","type":"text","hidden":false,"required":false,"index":false}]},{"name":"systemd_units","description":"Track systemd units.","platforms":["linux"],"columns":[{"name":"id","description":"Unique unit identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Unit description","type":"text","hidden":false,"required":false,"index":false},{"name":"load_state","description":"Reflects whether the unit definition was properly loaded","type":"text","hidden":false,"required":false,"index":false},{"name":"active_state","description":"The high-level unit activation state, i.e. generalization of SUB","type":"text","hidden":false,"required":false,"index":false},{"name":"sub_state","description":"The low-level unit activation state, values depend on unit type","type":"text","hidden":false,"required":false,"index":false},{"name":"following","description":"The name of another unit that this unit follows in state","type":"text","hidden":false,"required":false,"index":false},{"name":"object_path","description":"The object path for this unit","type":"text","hidden":false,"required":false,"index":false},{"name":"job_id","description":"Next queued job id","type":"bigint","hidden":false,"required":false,"index":false},{"name":"job_type","description":"Job type","type":"text","hidden":false,"required":false,"index":false},{"name":"job_path","description":"The object path for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"fragment_path","description":"The unit file path this unit was read from, if there is any","type":"text","hidden":false,"required":false,"index":false},{"name":"user","description":"The configured user, if any","type":"text","hidden":false,"required":false,"index":false},{"name":"source_path","description":"Path to the (possibly generated) unit configuration file","type":"text","hidden":false,"required":false,"index":false}]},{"name":"temperature_sensors","description":"Machine's temperature sensors.","platforms":["darwin"],"columns":[{"name":"key","description":"The SMC key on macOS","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of temperature source","type":"text","hidden":false,"required":false,"index":false},{"name":"celsius","description":"Temperature in Celsius","type":"double","hidden":false,"required":false,"index":false},{"name":"fahrenheit","description":"Temperature in Fahrenheit","type":"double","hidden":false,"required":false,"index":false}]},{"name":"time","description":"Track current date and time in UTC.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"weekday","description":"Current weekday in UTC","type":"text","hidden":false,"required":false,"index":false},{"name":"year","description":"Current year in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"month","description":"Current month in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"day","description":"Current day in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"hour","description":"Current hour in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"minutes","description":"Current minutes in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"seconds","description":"Current seconds in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"timezone","description":"Timezone for reported time (hardcoded to UTC)","type":"text","hidden":false,"required":false,"index":false},{"name":"local_timezone","description":"Current local timezone in of the system","type":"text","hidden":false,"required":false,"index":false},{"name":"unix_time","description":"Current UNIX time in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"timestamp","description":"Current timestamp (log format) in UTC","type":"text","hidden":false,"required":false,"index":false},{"name":"datetime","description":"Current date and time (ISO format) in UTC","type":"text","hidden":false,"required":false,"index":false},{"name":"iso_8601","description":"Current time (ISO format) in UTC","type":"text","hidden":false,"required":false,"index":false},{"name":"win_timestamp","description":"Timestamp value in 100 nanosecond units","type":"bigint","hidden":true,"required":false,"index":false}]},{"name":"time_machine_backups","description":"Backups to drives using TimeMachine.","platforms":["darwin"],"columns":[{"name":"destination_id","description":"Time Machine destination ID","type":"text","hidden":false,"required":false,"index":false},{"name":"backup_date","description":"Backup Date","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"time_machine_destinations","description":"Locations backed up to using Time Machine.","platforms":["darwin"],"columns":[{"name":"alias","description":"Human readable name of drive","type":"text","hidden":false,"required":false,"index":false},{"name":"destination_id","description":"Time Machine destination ID","type":"text","hidden":false,"required":false,"index":false},{"name":"consistency_scan_date","description":"Consistency scan date","type":"integer","hidden":false,"required":false,"index":false},{"name":"root_volume_uuid","description":"Root UUID of backup volume","type":"text","hidden":false,"required":false,"index":false},{"name":"bytes_available","description":"Bytes available on volume","type":"integer","hidden":false,"required":false,"index":false},{"name":"bytes_used","description":"Bytes used on volume","type":"integer","hidden":false,"required":false,"index":false},{"name":"encryption","description":"Last known encrypted state","type":"text","hidden":false,"required":false,"index":false}]},{"name":"tpm_info","description":"A table that lists the TPM related information.","platforms":["windows"],"columns":[{"name":"activated","description":"TPM is activated","type":"integer","hidden":false,"required":false,"index":false},{"name":"enabled","description":"TPM is enabled","type":"integer","hidden":false,"required":false,"index":false},{"name":"owned","description":"TPM is owned","type":"integer","hidden":false,"required":false,"index":false},{"name":"manufacturer_version","description":"TPM version","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacturer_id","description":"TPM manufacturers ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"manufacturer_name","description":"TPM manufacturers name","type":"text","hidden":false,"required":false,"index":false},{"name":"product_name","description":"Product name of the TPM","type":"text","hidden":false,"required":false,"index":false},{"name":"physical_presence_version","description":"Version of the Physical Presence Interface","type":"text","hidden":false,"required":false,"index":false},{"name":"spec_version","description":"Trusted Computing Group specification that the TPM supports","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ulimit_info","description":"System resource usage limits.","platforms":["darwin","linux"],"columns":[{"name":"type","description":"System resource to be limited","type":"text","hidden":false,"required":false,"index":false},{"name":"soft_limit","description":"Current limit value","type":"text","hidden":false,"required":false,"index":false},{"name":"hard_limit","description":"Maximum limit value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"uptime","description":"Track time passed since last boot. Some systems track this as calendar time, some as runtime.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"days","description":"Days of uptime","type":"integer","hidden":false,"required":false,"index":false},{"name":"hours","description":"Hours of uptime","type":"integer","hidden":false,"required":false,"index":false},{"name":"minutes","description":"Minutes of uptime","type":"integer","hidden":false,"required":false,"index":false},{"name":"seconds","description":"Seconds of uptime","type":"integer","hidden":false,"required":false,"index":false},{"name":"total_seconds","description":"Total uptime seconds","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"usb_devices","description":"USB devices that are actively plugged into the host system.","platforms":["darwin","linux"],"columns":[{"name":"usb_address","description":"USB Device used address","type":"integer","hidden":false,"required":false,"index":false},{"name":"usb_port","description":"USB Device used port","type":"integer","hidden":false,"required":false,"index":false},{"name":"vendor","description":"USB Device vendor string","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor_id","description":"Hex encoded USB Device vendor identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"USB Device version number","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"USB Device model string","type":"text","hidden":false,"required":false,"index":false},{"name":"model_id","description":"Hex encoded USB Device model identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"serial","description":"USB Device serial connection","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"USB Device class","type":"text","hidden":false,"required":false,"index":false},{"name":"subclass","description":"USB Device subclass","type":"text","hidden":false,"required":false,"index":false},{"name":"protocol","description":"USB Device protocol","type":"text","hidden":false,"required":false,"index":false},{"name":"removable","description":"1 If USB device is removable else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"user_events","description":"Track user events from the audit framework.","platforms":["darwin","linux"],"columns":[{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"auid","description":"Audit User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"message","description":"Message from the event","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"The file description for the process socket","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Supplied path from event","type":"text","hidden":false,"required":false,"index":false},{"name":"address","description":"The Internet protocol address or family ID","type":"text","hidden":false,"required":false,"index":false},{"name":"terminal","description":"The network protocol ID","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"user_groups","description":"Local system user group relationships.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"user_interaction_events","description":"Track user interaction events from macOS' event tapping framework.","platforms":["darwin"],"columns":[{"name":"time","description":"Time","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"user_ssh_keys","description":"Returns the private keys in the users ~/.ssh directory and whether or not they are encrypted.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"The local user that owns the key file","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to key file","type":"text","hidden":false,"required":false,"index":false},{"name":"encrypted","description":"1 if key is encrypted, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"key_type","description":"The type of the private key. One of [rsa, dsa, dh, ec, hmac, cmac], or the empty string.","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"userassist","description":"UserAssist Registry Key tracks when a user executes an application from Windows Explorer.","platforms":["windows"],"columns":[{"name":"path","description":"Application file path.","type":"text","hidden":false,"required":false,"index":false},{"name":"last_execution_time","description":"Most recent time application was executed.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"count","description":"Number of times the application has been executed.","type":"integer","hidden":false,"required":false,"index":false},{"name":"sid","description":"User SID.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"users","description":"Local user accounts (including domain accounts that have logged on locally (Windows)).","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID (unsigned)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid_signed","description":"User ID as int64 signed (Apple)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid_signed","description":"Default group ID as int64 signed (Apple)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"username","description":"Username","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Optional user description","type":"text","hidden":false,"required":false,"index":false},{"name":"directory","description":"User's home directory","type":"text","hidden":false,"required":false,"index":false},{"name":"shell","description":"User's configured default shell","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"User's UUID (Apple) or SID (Windows)","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Whether the account is roaming (domain), local, or a system profile","type":"text","hidden":true,"required":false,"index":false},{"name":"is_hidden","description":"IsHidden attribute set in OpenDirectory","type":"integer","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"video_info","description":"Retrieve video card information of the machine.","platforms":["windows"],"columns":[{"name":"color_depth","description":"The amount of bits per pixel to represent color.","type":"integer","hidden":false,"required":false,"index":false},{"name":"driver","description":"The driver of the device.","type":"text","hidden":false,"required":false,"index":false},{"name":"driver_date","description":"The date listed on the installed driver.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"driver_version","description":"The version of the installed driver.","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"The manufacturer of the gpu.","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"The model of the gpu.","type":"text","hidden":false,"required":false,"index":false},{"name":"series","description":"The series of the gpu.","type":"text","hidden":false,"required":false,"index":false},{"name":"video_mode","description":"The current resolution of the display.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"virtual_memory_info","description":"Darwin Virtual Memory statistics.","platforms":["darwin"],"columns":[{"name":"free","description":"Total number of free pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"active","description":"Total number of active pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inactive","description":"Total number of inactive pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"speculative","description":"Total number of speculative pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"throttled","description":"Total number of throttled pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"wired","description":"Total number of wired down pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"purgeable","description":"Total number of purgeable pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"faults","description":"Total number of calls to vm_faults.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"copy","description":"Total number of copy-on-write pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"zero_fill","description":"Total number of zero filled pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"reactivated","description":"Total number of reactivated pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"purged","description":"Total number of purged pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"file_backed","description":"Total number of file backed pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"anonymous","description":"Total number of anonymous pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uncompressed","description":"Total number of uncompressed pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"compressor","description":"The number of pages used to store compressed VM pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"decompressed","description":"The total number of pages that have been decompressed by the VM compressor.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"compressed","description":"The total number of pages that have been compressed by the VM compressor.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"page_ins","description":"The total number of requests for pages from a pager.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"page_outs","description":"Total number of pages paged out.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"swap_ins","description":"The total number of compressed pages that have been swapped out to disk.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"swap_outs","description":"The total number of compressed pages that have been swapped back in from disk.","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"wifi_networks","description":"macOS known/remembered Wi-Fi networks list.","platforms":["darwin"],"columns":[{"name":"ssid","description":"SSID octets of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"network_name","description":"Name of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"security_type","description":"Type of security on this network","type":"text","hidden":false,"required":false,"index":false},{"name":"last_connected","description":"Last time this network was connected to as a unix_time","type":"integer","hidden":true,"required":false,"index":false},{"name":"passpoint","description":"1 if Passpoint is supported, 0 otherwise","type":"integer","hidden":true,"required":false,"index":false},{"name":"possibly_hidden","description":"1 if network is possibly a hidden network, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"roaming","description":"1 if roaming is supported, 0 otherwise","type":"integer","hidden":true,"required":false,"index":false},{"name":"roaming_profile","description":"Describe the roaming profile, usually one of Single, Dual or Multi","type":"text","hidden":false,"required":false,"index":false},{"name":"auto_login","description":"1 if auto login is enabled, 0 otherwise","type":"integer","hidden":true,"required":false,"index":false},{"name":"temporarily_disabled","description":"1 if this network is temporarily disabled, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"disabled","description":"1 if this network is disabled, 0 otherwise","type":"integer","hidden":true,"required":false,"index":false},{"name":"add_reason","description":"Shows why this network was added, via menubar or command line or something else ","type":"text","hidden":false,"required":false,"index":false},{"name":"added_at","description":"Time this network was added as a unix_time","type":"integer","hidden":false,"required":false,"index":false},{"name":"captive_portal","description":"1 if this network has a captive portal, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"captive_login_date","description":"Time this network logged in to a captive portal as unix_time","type":"integer","hidden":false,"required":false,"index":false},{"name":"was_captive_network","description":"1 if this network was previously a captive network, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"auto_join","description":"1 if this network set to join automatically, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"personal_hotspot","description":"1 if this network is a personal hotspot, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"wifi_status","description":"macOS current WiFi status.","platforms":["darwin"],"columns":[{"name":"interface","description":"Name of the interface","type":"text","hidden":false,"required":false,"index":false},{"name":"ssid","description":"SSID octets of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"bssid","description":"The current basic service set identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"network_name","description":"Name of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"country_code","description":"The country code (ISO/IEC 3166-1:1997) for the network","type":"text","hidden":false,"required":false,"index":false},{"name":"security_type","description":"Type of security on this network","type":"text","hidden":false,"required":false,"index":false},{"name":"rssi","description":"The current received signal strength indication (dbm)","type":"integer","hidden":false,"required":false,"index":false},{"name":"noise","description":"The current noise measurement (dBm)","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel","description":"Channel number","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel_width","description":"Channel width","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel_band","description":"Channel band","type":"integer","hidden":false,"required":false,"index":false},{"name":"transmit_rate","description":"The current transmit rate","type":"text","hidden":false,"required":false,"index":false},{"name":"mode","description":"The current operating mode for the Wi-Fi interface","type":"text","hidden":false,"required":false,"index":false}]},{"name":"wifi_survey","description":"Scan for nearby WiFi networks.","platforms":["darwin"],"columns":[{"name":"interface","description":"Name of the interface","type":"text","hidden":false,"required":false,"index":false},{"name":"ssid","description":"SSID octets of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"bssid","description":"The current basic service set identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"network_name","description":"Name of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"country_code","description":"The country code (ISO/IEC 3166-1:1997) for the network","type":"text","hidden":false,"required":false,"index":false},{"name":"rssi","description":"The current received signal strength indication (dbm)","type":"integer","hidden":false,"required":false,"index":false},{"name":"noise","description":"The current noise measurement (dBm)","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel","description":"Channel number","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel_width","description":"Channel width","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel_band","description":"Channel band","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"winbaseobj","description":"Lists named Windows objects in the default object directories, across all terminal services sessions. Example Windows ojbect types include Mutexes, Events, Jobs and Semaphors.","platforms":["windows"],"columns":[{"name":"session_id","description":"Terminal Services Session Id","type":"integer","hidden":false,"required":false,"index":false},{"name":"object_name","description":"Object Name","type":"text","hidden":false,"required":false,"index":false},{"name":"object_type","description":"Object Type","type":"text","hidden":false,"required":false,"index":false}]},{"name":"windows_crashes","description":"Extracted information from Windows crash logs (Minidumps).","platforms":["windows"],"columns":[{"name":"datetime","description":"Timestamp (log format) of the crash","type":"text","hidden":false,"required":false,"index":false},{"name":"module","description":"Path of the crashed module within the process","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of the executable file for the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID of the crashed process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"tid","description":"Thread ID of the crashed thread","type":"bigint","hidden":false,"required":false,"index":false},{"name":"version","description":"File version info of the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"process_uptime","description":"Uptime of the process in seconds","type":"bigint","hidden":false,"required":false,"index":false},{"name":"stack_trace","description":"Multiple stack frames from the stack trace","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_code","description":"The Windows exception code","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_message","description":"The NTSTATUS error message associated with the exception code","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_address","description":"Address (in hex) where the exception occurred","type":"text","hidden":false,"required":false,"index":false},{"name":"registers","description":"The values of the system registers","type":"text","hidden":false,"required":false,"index":false},{"name":"command_line","description":"Command-line string passed to the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"current_directory","description":"Current working directory of the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"Username of the user who ran the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"machine_name","description":"Name of the machine where the crash happened","type":"text","hidden":false,"required":false,"index":false},{"name":"major_version","description":"Windows major version of the machine","type":"integer","hidden":false,"required":false,"index":false},{"name":"minor_version","description":"Windows minor version of the machine","type":"integer","hidden":false,"required":false,"index":false},{"name":"build_number","description":"Windows build number of the crashing machine","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of crash log","type":"text","hidden":false,"required":false,"index":false},{"name":"crash_path","description":"Path of the log file","type":"text","hidden":false,"required":false,"index":false}]},{"name":"windows_eventlog","description":"Table for querying all recorded Windows event logs.","platforms":["windows"],"columns":[{"name":"channel","description":"Source or channel of the event","type":"text","hidden":false,"required":true,"index":false},{"name":"datetime","description":"System time at which the event occurred","type":"text","hidden":false,"required":false,"index":false},{"name":"task","description":"Task value associated with the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"level","description":"Severity level associated with the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"provider_name","description":"Provider name of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"provider_guid","description":"Provider guid of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"computer_name","description":"Hostname of system where event was generated","type":"text","hidden":false,"required":false,"index":false},{"name":"eventid","description":"Event ID of the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"keywords","description":"A bitmask of the keywords defined in the event","type":"text","hidden":false,"required":false,"index":false},{"name":"data","description":"Data associated with the event","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID which emitted the event record","type":"integer","hidden":false,"required":false,"index":false},{"name":"tid","description":"Thread ID which emitted the event record","type":"integer","hidden":false,"required":false,"index":false},{"name":"time_range","description":"System time to selectively filter the events","type":"text","hidden":true,"required":false,"index":false},{"name":"timestamp","description":"Timestamp to selectively filter the events","type":"text","hidden":true,"required":false,"index":false},{"name":"xpath","description":"The custom query to filter events","type":"text","hidden":true,"required":true,"index":false}]},{"name":"windows_events","description":"Windows Event logs.","platforms":["windows"],"columns":[{"name":"time","description":"Timestamp the event was received","type":"bigint","hidden":false,"required":false,"index":false},{"name":"datetime","description":"System time at which the event occurred","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Source or channel of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"provider_name","description":"Provider name of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"provider_guid","description":"Provider guid of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"computer_name","description":"Hostname of system where event was generated","type":"text","hidden":false,"required":false,"index":false},{"name":"eventid","description":"Event ID of the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"task","description":"Task value associated with the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"level","description":"The severity level associated with the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"keywords","description":"A bitmask of the keywords defined in the event","type":"text","hidden":false,"required":false,"index":false},{"name":"data","description":"Data associated with the event","type":"text","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"windows_firewall_rules","description":"Provides the list of Windows firewall rules.","platforms":["windows"],"columns":[{"name":"name","description":"Friendly name of the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"app_name","description":"Friendly name of the application to which the rule applies","type":"text","hidden":false,"required":false,"index":false},{"name":"action","description":"Action for the rule or default setting","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"1 if the rule is enabled","type":"integer","hidden":false,"required":false,"index":false},{"name":"grouping","description":"Group to which an individual rule belongs","type":"text","hidden":false,"required":false,"index":false},{"name":"direction","description":"Direction of traffic for which the rule applies","type":"text","hidden":false,"required":false,"index":false},{"name":"protocol","description":"IP protocol of the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"local_addresses","description":"Local addresses for the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"remote_addresses","description":"Remote addresses for the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"local_ports","description":"Local ports for the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"remote_ports","description":"Remote ports for the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"icmp_types_codes","description":"ICMP types and codes for the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"profile_domain","description":"1 if the rule profile type is domain","type":"integer","hidden":false,"required":false,"index":false},{"name":"profile_private","description":"1 if the rule profile type is private","type":"integer","hidden":false,"required":false,"index":false},{"name":"profile_public","description":"1 if the rule profile type is public","type":"integer","hidden":false,"required":false,"index":false},{"name":"service_name","description":"Service name property of the application","type":"text","hidden":false,"required":false,"index":false}]},{"name":"windows_optional_features","description":"Lists names and installation states of windows features. Maps to Win32_OptionalFeature WMI class.","platforms":["windows"],"columns":[{"name":"name","description":"Name of the feature","type":"text","hidden":false,"required":false,"index":false},{"name":"caption","description":"Caption of feature in settings UI","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Installation state value. 1 == Enabled, 2 == Disabled, 3 == Absent","type":"integer","hidden":false,"required":false,"index":false},{"name":"statename","description":"Installation state name. 'Enabled','Disabled','Absent'","type":"text","hidden":false,"required":false,"index":false}]},{"name":"windows_security_center","description":"The health status of Window Security features. Health values can be \"Good\", \"Poor\". \"Snoozed\", \"Not Monitored\", and \"Error\".","platforms":["windows"],"columns":[{"name":"firewall","description":"The health of the monitored Firewall (see windows_security_products)","type":"text","hidden":false,"required":false,"index":false},{"name":"autoupdate","description":"The health of the Windows Autoupdate feature","type":"text","hidden":false,"required":false,"index":false},{"name":"antivirus","description":"The health of the monitored Antivirus solution (see windows_security_products)","type":"text","hidden":false,"required":false,"index":false},{"name":"antispyware","description":"Deprecated (always 'Good').","type":"text","hidden":true,"required":false,"index":false},{"name":"internet_settings","description":"The health of the Internet Settings","type":"text","hidden":false,"required":false,"index":false},{"name":"windows_security_center_service","description":"The health of the Windows Security Center Service","type":"text","hidden":false,"required":false,"index":false},{"name":"user_account_control","description":"The health of the User Account Control (UAC) capability in Windows","type":"text","hidden":false,"required":false,"index":false}]},{"name":"windows_security_products","description":"Enumeration of registered Windows security products.","platforms":["windows"],"columns":[{"name":"type","description":"Type of security product","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of product","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"State of protection","type":"text","hidden":false,"required":false,"index":false},{"name":"state_timestamp","description":"Timestamp for the product state","type":"text","hidden":false,"required":false,"index":false},{"name":"remediation_path","description":"Remediation path","type":"text","hidden":false,"required":false,"index":false},{"name":"signatures_up_to_date","description":"1 if product signatures are up to date, else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"windows_update_history","description":"Provides the history of the windows update events.","platforms":["windows"],"columns":[{"name":"client_app_id","description":"Identifier of the client application that processed an update","type":"text","hidden":false,"required":false,"index":false},{"name":"date","description":"Date and the time an update was applied","type":"bigint","hidden":false,"required":false,"index":false},{"name":"description","description":"Description of an update","type":"text","hidden":false,"required":false,"index":false},{"name":"hresult","description":"HRESULT value that is returned from the operation on an update","type":"bigint","hidden":false,"required":false,"index":false},{"name":"operation","description":"Operation on an update","type":"text","hidden":false,"required":false,"index":false},{"name":"result_code","description":"Result of an operation on an update","type":"text","hidden":false,"required":false,"index":false},{"name":"server_selection","description":"Value that indicates which server provided an update","type":"text","hidden":false,"required":false,"index":false},{"name":"service_id","description":"Service identifier of an update service that is not a Windows update","type":"text","hidden":false,"required":false,"index":false},{"name":"support_url","description":"Hyperlink to the language-specific support information for an update","type":"text","hidden":false,"required":false,"index":false},{"name":"title","description":"Title of an update","type":"text","hidden":false,"required":false,"index":false},{"name":"update_id","description":"Revision-independent identifier of an update","type":"text","hidden":false,"required":false,"index":false},{"name":"update_revision","description":"Revision number of an update","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"wmi_bios_info","description":"Lists important information from the system bios.","platforms":["windows"],"columns":[{"name":"name","description":"Name of the Bios setting","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Value of the Bios setting","type":"text","hidden":false,"required":false,"index":false}]},{"name":"wmi_cli_event_consumers","description":"WMI CommandLineEventConsumer, which can be used for persistence on Windows. See https://www.blackhat.com/docs/us-15/materials/us-15-Graeber-Abusing-Windows-Management-Instrumentation-WMI-To-Build-A-Persistent%20Asynchronous-And-Fileless-Backdoor-wp.pdf for more details.","platforms":["windows"],"columns":[{"name":"name","description":"Unique name of a consumer.","type":"text","hidden":false,"required":false,"index":false},{"name":"command_line_template","description":"Standard string template that specifies the process to be started. This property can be NULL, and the ExecutablePath property is used as the command line.","type":"text","hidden":false,"required":false,"index":false},{"name":"executable_path","description":"Module to execute. The string can specify the full path and file name of the module to execute, or it can specify a partial name. If a partial name is specified, the current drive and current directory are assumed.","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"The name of the class.","type":"text","hidden":false,"required":false,"index":false},{"name":"relative_path","description":"Relative path to the class or instance.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"wmi_event_filters","description":"Lists WMI event filters.","platforms":["windows"],"columns":[{"name":"name","description":"Unique identifier of an event filter.","type":"text","hidden":false,"required":false,"index":false},{"name":"query","description":"Windows Management Instrumentation Query Language (WQL) event query that specifies the set of events for consumer notification, and the specific conditions for notification.","type":"text","hidden":false,"required":false,"index":false},{"name":"query_language","description":"Query language that the query is written in.","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"The name of the class.","type":"text","hidden":false,"required":false,"index":false},{"name":"relative_path","description":"Relative path to the class or instance.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"wmi_filter_consumer_binding","description":"Lists the relationship between event consumers and filters.","platforms":["windows"],"columns":[{"name":"consumer","description":"Reference to an instance of __EventConsumer that represents the object path to a logical consumer, the recipient of an event.","type":"text","hidden":false,"required":false,"index":false},{"name":"filter","description":"Reference to an instance of __EventFilter that represents the object path to an event filter which is a query that specifies the type of event to be received.","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"The name of the class.","type":"text","hidden":false,"required":false,"index":false},{"name":"relative_path","description":"Relative path to the class or instance.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"wmi_script_event_consumers","description":"WMI ActiveScriptEventConsumer, which can be used for persistence on Windows. See https://www.blackhat.com/docs/us-15/materials/us-15-Graeber-Abusing-Windows-Management-Instrumentation-WMI-To-Build-A-Persistent%20Asynchronous-And-Fileless-Backdoor-wp.pdf for more details.","platforms":["windows"],"columns":[{"name":"name","description":"Unique identifier for the event consumer. ","type":"text","hidden":false,"required":false,"index":false},{"name":"scripting_engine","description":"Name of the scripting engine to use, for example, 'VBScript'. This property cannot be NULL.","type":"text","hidden":false,"required":false,"index":false},{"name":"script_file_name","description":"Name of the file from which the script text is read, intended as an alternative to specifying the text of the script in the ScriptText property.","type":"text","hidden":false,"required":false,"index":false},{"name":"script_text","description":"Text of the script that is expressed in a language known to the scripting engine. This property must be NULL if the ScriptFileName property is not NULL.","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"The name of the class.","type":"text","hidden":false,"required":false,"index":false},{"name":"relative_path","description":"Relative path to the class or instance.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"xprotect_entries","description":"Database of the machine's XProtect signatures.","platforms":["darwin"],"columns":[{"name":"name","description":"Description of XProtected malware","type":"text","hidden":false,"required":false,"index":false},{"name":"launch_type","description":"Launch services content type","type":"text","hidden":false,"required":false,"index":false},{"name":"identity","description":"XProtect identity (SHA1) of content","type":"text","hidden":false,"required":false,"index":false},{"name":"filename","description":"Use this file name to match","type":"text","hidden":false,"required":false,"index":false},{"name":"filetype","description":"Use this file type to match","type":"text","hidden":false,"required":false,"index":false},{"name":"optional","description":"Match any of the identities/patterns for this XProtect name","type":"integer","hidden":false,"required":false,"index":false},{"name":"uses_pattern","description":"Uses a match pattern instead of identity","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"xprotect_meta","description":"Database of the machine's XProtect browser-related signatures.","platforms":["darwin"],"columns":[{"name":"identifier","description":"Browser plugin or extension identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Either plugin or extension","type":"text","hidden":false,"required":false,"index":false},{"name":"developer_id","description":"Developer identity (SHA1) of extension","type":"text","hidden":false,"required":false,"index":false},{"name":"min_version","description":"The minimum allowed plugin version.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"xprotect_reports","description":"Database of XProtect matches (if user generated/sent an XProtect report).","platforms":["darwin"],"columns":[{"name":"name","description":"Description of XProtected malware","type":"text","hidden":false,"required":false,"index":false},{"name":"user_action","description":"Action taken by user after prompted","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Quarantine alert time","type":"text","hidden":false,"required":false,"index":false}]},{"name":"yara","description":"Track YARA matches for files or PIDs.","platforms":["darwin","linux","windows"],"columns":[{"name":"path","description":"The path scanned","type":"text","hidden":false,"required":true,"index":false},{"name":"matches","description":"List of YARA matches","type":"text","hidden":false,"required":false,"index":false},{"name":"count","description":"Number of YARA matches","type":"integer","hidden":false,"required":false,"index":false},{"name":"sig_group","description":"Signature group used","type":"text","hidden":false,"required":false,"index":false},{"name":"sigfile","description":"Signature file used","type":"text","hidden":false,"required":false,"index":false},{"name":"sigrule","description":"Signature strings used","type":"text","hidden":true,"required":false,"index":false},{"name":"strings","description":"Matching strings","type":"text","hidden":false,"required":false,"index":false},{"name":"tags","description":"Matching tags","type":"text","hidden":false,"required":false,"index":false},{"name":"sigurl","description":"Signature url","type":"text","hidden":true,"required":false,"index":false}]},{"name":"yara_events","description":"Track YARA matches for files specified in configuration data.","platforms":["darwin","linux","windows"],"columns":[{"name":"target_path","description":"The path scanned","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"The category of the file","type":"text","hidden":false,"required":false,"index":false},{"name":"action","description":"Change action (UPDATE, REMOVE, etc)","type":"text","hidden":false,"required":false,"index":false},{"name":"transaction_id","description":"ID used during bulk update","type":"bigint","hidden":false,"required":false,"index":false},{"name":"matches","description":"List of YARA matches","type":"text","hidden":false,"required":false,"index":false},{"name":"count","description":"Number of YARA matches","type":"integer","hidden":false,"required":false,"index":false},{"name":"strings","description":"Matching strings","type":"text","hidden":false,"required":false,"index":false},{"name":"tags","description":"Matching tags","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of the scan","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"ycloud_instance_metadata","description":"Yandex.Cloud instance metadata.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"instance_id","description":"Unique identifier for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"folder_id","description":"Folder identifier for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Description of the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"hostname","description":"Hostname of the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"zone","description":"Availability zone of the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"ssh_public_key","description":"SSH public key. Only available if supplied at instance launch time","type":"text","hidden":false,"required":false,"index":false},{"name":"serial_port_enabled","description":"Indicates if serial port is enabled for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"metadata_endpoint","description":"Endpoint used to fetch VM metadata","type":"text","hidden":false,"required":false,"index":false}]},{"name":"yum_sources","description":"Current list of Yum repositories or software channels.","platforms":["linux"],"columns":[{"name":"name","description":"Repository name","type":"text","hidden":false,"required":false,"index":false},{"name":"baseurl","description":"Repository base URL","type":"text","hidden":false,"required":false,"index":false},{"name":"mirrorlist","description":"Mirrorlist URL","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"Whether the repository is used","type":"text","hidden":false,"required":false,"index":false},{"name":"gpgcheck","description":"Whether packages are GPG checked","type":"text","hidden":false,"required":false,"index":false},{"name":"gpgkey","description":"URL to GPG key","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"host_users","description":"Local user accounts (including domain accounts that have logged on locally (Windows)).","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID (unsigned)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid_signed","description":"User ID as int64 signed (Apple)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid_signed","description":"Default group ID as int64 signed (Apple)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"username","description":"Username","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Optional user description","type":"text","hidden":false,"required":false,"index":false},{"name":"directory","description":"User's home directory","type":"text","hidden":false,"required":false,"index":false},{"name":"shell","description":"User's configured default shell","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"User's UUID (Apple) or SID (Windows)","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Whether the account is roaming (domain), local, or a system profile","type":"text","hidden":true,"required":false,"index":false},{"name":"is_hidden","description":"IsHidden attribute set in OpenDirectory","type":"integer","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"host_groups","description":"Local system groups.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"gid","description":"Unsigned int64 group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid_signed","description":"A signed int64 version of gid","type":"bigint","hidden":false,"required":false,"index":false},{"name":"groupname","description":"Canonical local group name","type":"text","hidden":false,"required":false,"index":false},{"name":"group_sid","description":"Unique group ID","type":"text","hidden":true,"required":false,"index":false},{"name":"comment","description":"Remarks or comments associated with the group","type":"text","hidden":true,"required":false,"index":false},{"name":"is_hidden","description":"IsHidden attribute set in OpenDirectory","type":"integer","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"host_processes","description":"All running processes on the host system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"The process path or shorthand argv[0]","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to executed binary","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Complete argv","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Process state","type":"text","hidden":false,"required":false,"index":false},{"name":"cwd","description":"Process current working directory","type":"text","hidden":false,"required":false,"index":false},{"name":"root","description":"Process virtual root directory","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"Unsigned user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Unsigned group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"euid","description":"Unsigned effective user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"egid","description":"Unsigned effective group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"suid","description":"Unsigned saved user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sgid","description":"Unsigned saved group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"on_disk","description":"The process path exists yes=1, no=0, unknown=-1","type":"integer","hidden":false,"required":false,"index":false},{"name":"wired_size","description":"Bytes of unpageable memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"resident_size","description":"Bytes of private memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"total_size","description":"Total virtual memory size","type":"bigint","hidden":false,"required":false,"index":false},{"name":"user_time","description":"CPU time in milliseconds spent in user space","type":"bigint","hidden":false,"required":false,"index":false},{"name":"system_time","description":"CPU time in milliseconds spent in kernel space","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_bytes_read","description":"Bytes read from disk","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_bytes_written","description":"Bytes written to disk","type":"bigint","hidden":false,"required":false,"index":false},{"name":"start_time","description":"Process start time in seconds since Epoch, in case of error -1","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Process parent's PID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pgroup","description":"Process group","type":"bigint","hidden":false,"required":false,"index":false},{"name":"threads","description":"Number of threads used by process","type":"integer","hidden":false,"required":false,"index":false},{"name":"nice","description":"Process nice level (-20 to 20, default 0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"elevated_token","description":"Process uses elevated token yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"secure_process","description":"Process is secure (IUM) yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"protection_type","description":"The protection type of the process","type":"text","hidden":true,"required":false,"index":false},{"name":"virtual_process","description":"Process is virtual (e.g. System, Registry, vmmem) yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"elapsed_time","description":"Elapsed time in seconds this process has been running.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"handle_count","description":"Total number of handles that the process has open. This number is the sum of the handles currently opened by each thread in the process.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"percent_processor_time","description":"Returns elapsed time that all of the threads of this process used the processor to execute instructions in 100 nanoseconds ticks.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"upid","description":"A 64bit pid that is never reused. Returns -1 if we couldn't gather them from the system.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uppid","description":"The 64bit parent pid that is never reused. Returns -1 if we couldn't gather them from the system.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cpu_type","description":"Indicates the specific processor designed for installation.","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_subtype","description":"Indicates the specific processor on which an entry may be used.","type":"integer","hidden":false,"required":false,"index":false},{"name":"translated","description":"Indicates whether the process is running under the Rosetta Translation Environment, yes=1, no=0, error=-1.","type":"integer","hidden":false,"required":false,"index":false}]}] \ No newline at end of file diff --git a/x-pack/plugins/osquery/public/common/schemas/osquery/v5.5.1.json b/x-pack/plugins/osquery/public/common/schemas/osquery/v5.5.1.json new file mode 100644 index 0000000000000..046fd2e7a6a39 --- /dev/null +++ b/x-pack/plugins/osquery/public/common/schemas/osquery/v5.5.1.json @@ -0,0 +1 @@ +[{"name":"account_policy_data","description":"Additional macOS user account data from the AccountPolicy section of OpenDirectory.","platforms":["darwin"],"columns":[{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"creation_time","description":"When the account was first created","type":"double","hidden":false,"required":false,"index":false},{"name":"failed_login_count","description":"The number of failed login attempts using an incorrect password. Count resets after a correct password is entered.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"failed_login_timestamp","description":"The time of the last failed login attempt. Resets after a correct password is entered","type":"double","hidden":false,"required":false,"index":false},{"name":"password_last_set_time","description":"The time the password was last changed","type":"double","hidden":false,"required":false,"index":false}]},{"name":"acpi_tables","description":"Firmware ACPI functional table common metadata and content.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"ACPI table name","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of compiled table data","type":"integer","hidden":false,"required":false,"index":false},{"name":"md5","description":"MD5 hash of table content","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ad_config","description":"macOS Active Directory configuration.","platforms":["darwin"],"columns":[{"name":"name","description":"The macOS-specific configuration name","type":"text","hidden":false,"required":false,"index":false},{"name":"domain","description":"Active Directory trust domain","type":"text","hidden":false,"required":false,"index":false},{"name":"option","description":"Canonical name of option","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Variable typed option value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"alf","description":"macOS application layer firewall (ALF) service details.","platforms":["darwin"],"columns":[{"name":"allow_signed_enabled","description":"1 If allow signed mode is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"firewall_unload","description":"1 If firewall unloading enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"global_state","description":"1 If the firewall is enabled with exceptions, 2 if the firewall is configured to block all incoming connections, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"logging_enabled","description":"1 If logging mode is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"logging_option","description":"Firewall logging option","type":"integer","hidden":false,"required":false,"index":false},{"name":"stealth_enabled","description":"1 If stealth mode is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"version","description":"Application Layer Firewall version","type":"text","hidden":false,"required":false,"index":false}]},{"name":"alf_exceptions","description":"macOS application layer firewall (ALF) service exceptions.","platforms":["darwin"],"columns":[{"name":"path","description":"Path to the executable that is excepted","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Firewall exception state","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"alf_explicit_auths","description":"ALF services explicitly allowed to perform networking.","platforms":["darwin"],"columns":[{"name":"process","description":"Process name explicitly allowed","type":"text","hidden":false,"required":false,"index":false}]},{"name":"app_schemes","description":"macOS application schemes and handlers (e.g., http, file, mailto).","platforms":["darwin"],"columns":[{"name":"scheme","description":"Name of the scheme/protocol","type":"text","hidden":false,"required":false,"index":false},{"name":"handler","description":"Application label for the handler","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"1 if this handler is the OS default, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"external","description":"1 if this handler does NOT exist on macOS by default, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"protected","description":"1 if this handler is protected (reserved) by macOS, else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"apparmor_events","description":"Track AppArmor events.","platforms":["linux"],"columns":[{"name":"type","description":"Event type","type":"text","hidden":false,"required":false,"index":false},{"name":"message","description":"Raw audit message","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false},{"name":"apparmor","description":"Apparmor Status like ALLOWED, DENIED etc.","type":"text","hidden":false,"required":false,"index":false},{"name":"operation","description":"Permission requested by the process","type":"text","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent process PID","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"profile","description":"Apparmor profile name","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Process name","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"comm","description":"Command-line name of the command that was used to invoke the analyzed process","type":"text","hidden":false,"required":false,"index":false},{"name":"denied_mask","description":"Denied permissions for the process","type":"text","hidden":false,"required":false,"index":false},{"name":"capname","description":"Capability requested by the process","type":"text","hidden":false,"required":false,"index":false},{"name":"fsuid","description":"Filesystem user ID","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"ouid","description":"Object owner's user ID","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"capability","description":"Capability number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"requested_mask","description":"Requested access mask","type":"text","hidden":false,"required":false,"index":false},{"name":"info","description":"Additional information","type":"text","hidden":false,"required":false,"index":false},{"name":"error","description":"Error information","type":"text","hidden":false,"required":false,"index":false},{"name":"namespace","description":"AppArmor namespace","type":"text","hidden":false,"required":false,"index":false},{"name":"label","description":"AppArmor label","type":"text","hidden":false,"required":false,"index":false}]},{"name":"apparmor_profiles","description":"Track active AppArmor profiles.","platforms":["linux"],"columns":[{"name":"path","description":"Unique, aa-status compatible, policy identifier.","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Policy name.","type":"text","hidden":false,"required":false,"index":false},{"name":"attach","description":"Which executable(s) a profile will attach to.","type":"text","hidden":false,"required":false,"index":false},{"name":"mode","description":"How the policy is applied.","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1","description":"A unique hash that identifies this policy.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"appcompat_shims","description":"Application Compatibility shims are a way to persist malware. This table presents the AppCompat Shim information from the registry in a nice format. See http://files.brucon.org/2015/Tomczak_and_Ballenthin_Shims_for_the_Win.pdf for more details.","platforms":["windows"],"columns":[{"name":"executable","description":"Name of the executable that is being shimmed. This is pulled from the registry.","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"This is the path to the SDB database.","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Description of the SDB.","type":"text","hidden":false,"required":false,"index":false},{"name":"install_time","description":"Install time of the SDB","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of the SDB database.","type":"text","hidden":false,"required":false,"index":false},{"name":"sdb_id","description":"Unique GUID of the SDB.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"apps","description":"macOS applications installed in known search paths (e.g., /Applications).","platforms":["darwin"],"columns":[{"name":"name","description":"Name of the Name.app folder","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Absolute and full Name.app path","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_executable","description":"Info properties CFBundleExecutable label","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_identifier","description":"Info properties CFBundleIdentifier label","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_name","description":"Info properties CFBundleName label","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_short_version","description":"Info properties CFBundleShortVersionString label","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_version","description":"Info properties CFBundleVersion label","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_package_type","description":"Info properties CFBundlePackageType label","type":"text","hidden":false,"required":false,"index":false},{"name":"environment","description":"Application-set environment variables","type":"text","hidden":false,"required":false,"index":false},{"name":"element","description":"Does the app identify as a background agent","type":"text","hidden":false,"required":false,"index":false},{"name":"compiler","description":"Info properties DTCompiler label","type":"text","hidden":false,"required":false,"index":false},{"name":"development_region","description":"Info properties CFBundleDevelopmentRegion label","type":"text","hidden":false,"required":false,"index":false},{"name":"display_name","description":"Info properties CFBundleDisplayName label","type":"text","hidden":false,"required":false,"index":false},{"name":"info_string","description":"Info properties CFBundleGetInfoString label","type":"text","hidden":false,"required":false,"index":false},{"name":"minimum_system_version","description":"Minimum version of macOS required for the app to run","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"The UTI that categorizes the app for the App Store","type":"text","hidden":false,"required":false,"index":false},{"name":"applescript_enabled","description":"Info properties NSAppleScriptEnabled label","type":"text","hidden":false,"required":false,"index":false},{"name":"copyright","description":"Info properties NSHumanReadableCopyright label","type":"text","hidden":false,"required":false,"index":false},{"name":"last_opened_time","description":"The time that the app was last used","type":"double","hidden":false,"required":false,"index":false}]},{"name":"apt_sources","description":"Current list of APT repositories or software channels.","platforms":["linux"],"columns":[{"name":"name","description":"Repository name","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Source file","type":"text","hidden":false,"required":false,"index":false},{"name":"base_uri","description":"Repository base URI","type":"text","hidden":false,"required":false,"index":false},{"name":"release","description":"Release name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Repository source version","type":"text","hidden":false,"required":false,"index":false},{"name":"maintainer","description":"Repository maintainer","type":"text","hidden":false,"required":false,"index":false},{"name":"components","description":"Repository components","type":"text","hidden":false,"required":false,"index":false},{"name":"architectures","description":"Repository architectures","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"arp_cache","description":"Address resolution cache, both static and dynamic (from ARP, NDP).","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"address","description":"IPv4 address target","type":"text","hidden":false,"required":false,"index":false},{"name":"mac","description":"MAC address of broadcasted address","type":"text","hidden":false,"required":false,"index":false},{"name":"interface","description":"Interface of the network for the MAC","type":"text","hidden":false,"required":false,"index":false},{"name":"permanent","description":"1 for true, 0 for false","type":"text","hidden":false,"required":false,"index":false}]},{"name":"asl","description":"Queries the Apple System Log data structure for system events.","platforms":["darwin"],"columns":[{"name":"time","description":"Unix timestamp. Set automatically","type":"integer","hidden":false,"required":false,"index":false},{"name":"time_nano_sec","description":"Nanosecond time.","type":"integer","hidden":false,"required":false,"index":false},{"name":"host","description":"Sender's address (set by the server).","type":"text","hidden":false,"required":false,"index":false},{"name":"sender","description":"Sender's identification string. Default is process name.","type":"text","hidden":false,"required":false,"index":false},{"name":"facility","description":"Sender's facility. Default is 'user'.","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Sending process ID encoded as a string. Set automatically.","type":"integer","hidden":false,"required":false,"index":false},{"name":"gid","description":"GID that sent the log message (set by the server).","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"UID that sent the log message (set by the server).","type":"bigint","hidden":false,"required":false,"index":false},{"name":"level","description":"Log level number. See levels in asl.h.","type":"integer","hidden":false,"required":false,"index":false},{"name":"message","description":"Message text.","type":"text","hidden":false,"required":false,"index":false},{"name":"ref_pid","description":"Reference PID for messages proxied by launchd","type":"integer","hidden":false,"required":false,"index":false},{"name":"ref_proc","description":"Reference process for messages proxied by launchd","type":"text","hidden":false,"required":false,"index":false},{"name":"extra","description":"Extra columns, in JSON format. Queries against this column are performed entirely in SQLite, so do not benefit from efficient querying via asl.h.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"atom_packages","description":"Lists all atom packages in a directory or globally installed in a system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Package display name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Package supplied description","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Package's package.json path","type":"text","hidden":false,"required":false,"index":false},{"name":"license","description":"License for package","type":"text","hidden":false,"required":false,"index":false},{"name":"homepage","description":"Package supplied homepage","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"The local user that owns the plugin","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"augeas","description":"Configuration files parsed by augeas.","platforms":["darwin","linux"],"columns":[{"name":"node","description":"The node path of the configuration item","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"The value of the configuration item","type":"text","hidden":false,"required":false,"index":false},{"name":"label","description":"The label of the configuration item","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"The path to the configuration file","type":"text","hidden":false,"required":false,"index":false}]},{"name":"authenticode","description":"File (executable, bundle, installer, disk) code signing status.","platforms":["windows"],"columns":[{"name":"path","description":"Must provide a path or directory","type":"text","hidden":false,"required":true,"index":false},{"name":"original_program_name","description":"The original program name that the publisher has signed","type":"text","hidden":false,"required":false,"index":false},{"name":"serial_number","description":"The certificate serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer_name","description":"The certificate issuer name","type":"text","hidden":false,"required":false,"index":false},{"name":"subject_name","description":"The certificate subject name","type":"text","hidden":false,"required":false,"index":false},{"name":"result","description":"The signature check result","type":"text","hidden":false,"required":false,"index":false}]},{"name":"authorization_mechanisms","description":"macOS Authorization mechanisms database.","platforms":["darwin"],"columns":[{"name":"label","description":"Label of the authorization right","type":"text","hidden":false,"required":false,"index":false},{"name":"plugin","description":"Authorization plugin name","type":"text","hidden":false,"required":false,"index":false},{"name":"mechanism","description":"Name of the mechanism that will be called","type":"text","hidden":false,"required":false,"index":false},{"name":"privileged","description":"If privileged it will run as root, else as an anonymous user","type":"text","hidden":false,"required":false,"index":false},{"name":"entry","description":"The whole string entry","type":"text","hidden":false,"required":false,"index":false}]},{"name":"authorizations","description":"macOS Authorization rights database.","platforms":["darwin"],"columns":[{"name":"label","description":"Item name, usually in reverse domain format","type":"text","hidden":false,"required":false,"index":false},{"name":"modified","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"allow_root","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"timeout","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"tries","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"authenticate_user","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"shared","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"session_owner","description":"Label top-level key","type":"text","hidden":false,"required":false,"index":false}]},{"name":"authorized_keys","description":"A line-delimited authorized_keys table.","platforms":["darwin","linux"],"columns":[{"name":"uid","description":"The local owner of authorized_keys file","type":"bigint","hidden":false,"required":false,"index":false},{"name":"algorithm","description":"Key type","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Key encoded as base64","type":"text","hidden":false,"required":false,"index":false},{"name":"options","description":"Optional list of login options","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Optional comment","type":"text","hidden":false,"required":false,"index":false},{"name":"key_file","description":"Path to the authorized_keys file","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"autoexec","description":"Aggregate of executables that will automatically execute on the target machine. This is an amalgamation of other tables like services, scheduled_tasks, startup_items and more.","platforms":["windows"],"columns":[{"name":"path","description":"Path to the executable","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the program","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Source table of the autoexec item","type":"text","hidden":false,"required":false,"index":false}]},{"name":"azure_instance_metadata","description":"Azure instance metadata.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"location","description":"Azure Region the VM is running in","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"offer","description":"Offer information for the VM image (Azure image gallery VMs only)","type":"text","hidden":false,"required":false,"index":false},{"name":"publisher","description":"Publisher of the VM image","type":"text","hidden":false,"required":false,"index":false},{"name":"sku","description":"SKU for the VM image","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Version of the VM image","type":"text","hidden":false,"required":false,"index":false},{"name":"os_type","description":"Linux or Windows","type":"text","hidden":false,"required":false,"index":false},{"name":"platform_update_domain","description":"Update domain the VM is running in","type":"text","hidden":false,"required":false,"index":false},{"name":"platform_fault_domain","description":"Fault domain the VM is running in","type":"text","hidden":false,"required":false,"index":false},{"name":"vm_id","description":"Unique identifier for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"vm_size","description":"VM size","type":"text","hidden":false,"required":false,"index":false},{"name":"subscription_id","description":"Azure subscription for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"resource_group_name","description":"Resource group for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"placement_group_id","description":"Placement group for the VM scale set","type":"text","hidden":false,"required":false,"index":false},{"name":"vm_scale_set_name","description":"VM scale set name","type":"text","hidden":false,"required":false,"index":false},{"name":"zone","description":"Availability zone of the VM","type":"text","hidden":false,"required":false,"index":false}]},{"name":"azure_instance_tags","description":"Azure instance tags.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"vm_id","description":"Unique identifier for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"The tag key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"The tag value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"background_activities_moderator","description":"Background Activities Moderator (BAM) tracks application execution.","platforms":["windows"],"columns":[{"name":"path","description":"Application file path.","type":"text","hidden":false,"required":false,"index":false},{"name":"last_execution_time","description":"Most recent time application was executed.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sid","description":"User SID.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"battery","description":"Provides information about the internal battery of a Macbook.","platforms":["darwin"],"columns":[{"name":"manufacturer","description":"The battery manufacturer's name","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacture_date","description":"The date the battery was manufactured UNIX Epoch","type":"integer","hidden":false,"required":false,"index":false},{"name":"model","description":"The battery's model number","type":"text","hidden":false,"required":false,"index":false},{"name":"serial_number","description":"The battery's unique serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"cycle_count","description":"The number of charge/discharge cycles","type":"integer","hidden":false,"required":false,"index":false},{"name":"health","description":"One of the following: \"Good\" describes a well-performing battery, \"Fair\" describes a functional battery with limited capacity, or \"Poor\" describes a battery that's not capable of providing power","type":"text","hidden":false,"required":false,"index":false},{"name":"condition","description":"One of the following: \"Normal\" indicates the condition of the battery is within normal tolerances, \"Service Needed\" indicates that the battery should be checked out by a licensed Mac repair service, \"Permanent Failure\" indicates the battery needs replacement","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"One of the following: \"AC Power\" indicates the battery is connected to an external power source, \"Battery Power\" indicates that the battery is drawing internal power, \"Off Line\" indicates the battery is off-line or no longer connected","type":"text","hidden":false,"required":false,"index":false},{"name":"charging","description":"1 if the battery is currently being charged by a power source. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"charged","description":"1 if the battery is currently completely charged. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"designed_capacity","description":"The battery's designed capacity in mAh","type":"integer","hidden":false,"required":false,"index":false},{"name":"max_capacity","description":"The battery's actual capacity when it is fully charged in mAh","type":"integer","hidden":false,"required":false,"index":false},{"name":"current_capacity","description":"The battery's current charged capacity in mAh","type":"integer","hidden":false,"required":false,"index":false},{"name":"percent_remaining","description":"The percentage of battery remaining before it is drained","type":"integer","hidden":false,"required":false,"index":false},{"name":"amperage","description":"The battery's current amperage in mA","type":"integer","hidden":false,"required":false,"index":false},{"name":"voltage","description":"The battery's current voltage in mV","type":"integer","hidden":false,"required":false,"index":false},{"name":"minutes_until_empty","description":"The number of minutes until the battery is fully depleted. This value is -1 if this time is still being calculated","type":"integer","hidden":false,"required":false,"index":false},{"name":"minutes_to_full_charge","description":"The number of minutes until the battery is fully charged. This value is -1 if this time is still being calculated","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"bitlocker_info","description":"Retrieve bitlocker status of the machine.","platforms":["windows"],"columns":[{"name":"device_id","description":"ID of the encrypted drive.","type":"text","hidden":false,"required":false,"index":false},{"name":"drive_letter","description":"Drive letter of the encrypted drive.","type":"text","hidden":false,"required":false,"index":false},{"name":"persistent_volume_id","description":"Persistent ID of the drive.","type":"text","hidden":false,"required":false,"index":false},{"name":"conversion_status","description":"The bitlocker conversion status of the drive.","type":"integer","hidden":false,"required":false,"index":false},{"name":"protection_status","description":"The bitlocker protection status of the drive.","type":"integer","hidden":false,"required":false,"index":false},{"name":"encryption_method","description":"The encryption type of the device.","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"The FVE metadata version of the drive.","type":"integer","hidden":false,"required":false,"index":false},{"name":"percentage_encrypted","description":"The percentage of the drive that is encrypted.","type":"integer","hidden":false,"required":false,"index":false},{"name":"lock_status","description":"The accessibility status of the drive from Windows.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"block_devices","description":"Block (buffered access) device file nodes: disks, ramdisks, and DMG containers.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"Block device name","type":"text","hidden":false,"required":false,"index":false},{"name":"parent","description":"Block device parent name","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor","description":"Block device vendor string","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"Block device model string identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Block device size in blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"block_size","description":"Block size in bytes","type":"integer","hidden":false,"required":false,"index":false},{"name":"uuid","description":"Block device Universally Unique Identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Block device type string","type":"text","hidden":false,"required":false,"index":false},{"name":"label","description":"Block device label string","type":"text","hidden":false,"required":false,"index":false}]},{"name":"bpf_process_events","description":"Track time/action process executions.","platforms":["linux"],"columns":[{"name":"tid","description":"Thread ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cid","description":"Cgroup ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"exit_code","description":"Exit code of the system call","type":"text","hidden":false,"required":false,"index":false},{"name":"probe_error","description":"Set to 1 if one or more buffers could not be captured","type":"integer","hidden":false,"required":false,"index":false},{"name":"syscall","description":"System call name","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Binary path","type":"text","hidden":false,"required":false,"index":false},{"name":"cwd","description":"Current working directory","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Command line arguments","type":"text","hidden":false,"required":false,"index":false},{"name":"duration","description":"How much time was spent inside the syscall (nsecs)","type":"integer","hidden":false,"required":false,"index":false},{"name":"json_cmdline","description":"Command line arguments, in JSON format","type":"text","hidden":true,"required":false,"index":false},{"name":"ntime","description":"The nsecs uptime timestamp as obtained from BPF","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":true,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"bpf_socket_events","description":"Track network socket opens and closes.","platforms":["linux"],"columns":[{"name":"tid","description":"Thread ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cid","description":"Cgroup ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"exit_code","description":"Exit code of the system call","type":"text","hidden":false,"required":false,"index":false},{"name":"probe_error","description":"Set to 1 if one or more buffers could not be captured","type":"integer","hidden":false,"required":false,"index":false},{"name":"syscall","description":"System call name","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of executed file","type":"text","hidden":false,"required":false,"index":false},{"name":"fd","description":"The file description for the process socket","type":"text","hidden":false,"required":false,"index":false},{"name":"family","description":"The Internet protocol family ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"The socket type","type":"integer","hidden":false,"required":false,"index":false},{"name":"protocol","description":"The network protocol ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"local_address","description":"Local address associated with socket","type":"text","hidden":false,"required":false,"index":false},{"name":"remote_address","description":"Remote address associated with socket","type":"text","hidden":false,"required":false,"index":false},{"name":"local_port","description":"Local network protocol port number","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_port","description":"Remote network protocol port number","type":"integer","hidden":false,"required":false,"index":false},{"name":"duration","description":"How much time was spent inside the syscall (nsecs)","type":"integer","hidden":false,"required":false,"index":false},{"name":"ntime","description":"The nsecs uptime timestamp as obtained from BPF","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":true,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"browser_plugins","description":"All C/NPAPI browser plugin details for all users. C/NPAPI has been deprecated on all major browsers. To query for plugins on modern browsers, try: `chrome_extensions` `firefox_addons` `safari_extensions`.","platforms":["darwin"],"columns":[{"name":"uid","description":"The local user that owns the plugin","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Plugin display name","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Plugin identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Plugin short version","type":"text","hidden":false,"required":false,"index":false},{"name":"sdk","description":"Build SDK used to compile plugin","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Plugin description text","type":"text","hidden":false,"required":false,"index":false},{"name":"development_region","description":"Plugin language-localization","type":"text","hidden":false,"required":false,"index":false},{"name":"native","description":"Plugin requires native execution","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to plugin bundle","type":"text","hidden":false,"required":false,"index":false},{"name":"disabled","description":"Is the plugin disabled. 1 = Disabled","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"carbon_black_info","description":"Returns info about a Carbon Black sensor install.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"sensor_id","description":"Sensor ID of the Carbon Black sensor","type":"integer","hidden":false,"required":false,"index":false},{"name":"config_name","description":"Sensor group","type":"text","hidden":false,"required":false,"index":false},{"name":"collect_store_files","description":"If the sensor is configured to send back binaries to the Carbon Black server","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_module_loads","description":"If the sensor is configured to capture module loads","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_module_info","description":"If the sensor is configured to collect metadata of binaries","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_file_mods","description":"If the sensor is configured to collect file modification events","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_reg_mods","description":"If the sensor is configured to collect registry modification events","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_net_conns","description":"If the sensor is configured to collect network connections","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_processes","description":"If the sensor is configured to process events","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_cross_processes","description":"If the sensor is configured to cross process events","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_emet_events","description":"If the sensor is configured to EMET events","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_data_file_writes","description":"If the sensor is configured to collect non binary file writes","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_process_user_context","description":"If the sensor is configured to collect the user running a process","type":"integer","hidden":false,"required":false,"index":false},{"name":"collect_sensor_operations","description":"Unknown","type":"integer","hidden":false,"required":false,"index":false},{"name":"log_file_disk_quota_mb","description":"Event file disk quota in MB","type":"integer","hidden":false,"required":false,"index":false},{"name":"log_file_disk_quota_percentage","description":"Event file disk quota in a percentage","type":"integer","hidden":false,"required":false,"index":false},{"name":"protection_disabled","description":"If the sensor is configured to report tamper events","type":"integer","hidden":false,"required":false,"index":false},{"name":"sensor_ip_addr","description":"IP address of the sensor","type":"text","hidden":false,"required":false,"index":false},{"name":"sensor_backend_server","description":"Carbon Black server","type":"text","hidden":false,"required":false,"index":false},{"name":"event_queue","description":"Size in bytes of Carbon Black event files on disk","type":"integer","hidden":false,"required":false,"index":false},{"name":"binary_queue","description":"Size in bytes of binaries waiting to be sent to Carbon Black server","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"carves","description":"List the set of completed and in-progress carves. If carve=1 then the query is treated as a new carve request.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"time","description":"Time at which the carve was kicked off","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sha256","description":"A SHA256 sum of the carved archive","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of the carved archive","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"The path of the requested carve","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Status of the carve, can be STARTING, PENDING, SUCCESS, or FAILED","type":"text","hidden":false,"required":false,"index":false},{"name":"carve_guid","description":"Identifying value of the carve session","type":"text","hidden":false,"required":false,"index":false},{"name":"request_id","description":"Identifying value of the carve request (e.g., scheduled query name, distributed request, etc)","type":"text","hidden":false,"required":false,"index":false},{"name":"carve","description":"Set this value to '1' to start a file carve","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"certificates","description":"Certificate Authorities installed in Keychains/ca-bundles.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"common_name","description":"Certificate CommonName","type":"text","hidden":false,"required":false,"index":false},{"name":"subject","description":"Certificate distinguished name (deprecated, use subject2)","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer","description":"Certificate issuer distinguished name (deprecated, use issuer2)","type":"text","hidden":false,"required":false,"index":false},{"name":"ca","description":"1 if CA: true (certificate is an authority) else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"self_signed","description":"1 if self-signed, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"not_valid_before","description":"Lower bound of valid date","type":"text","hidden":false,"required":false,"index":false},{"name":"not_valid_after","description":"Certificate expiration data","type":"text","hidden":false,"required":false,"index":false},{"name":"signing_algorithm","description":"Signing algorithm used","type":"text","hidden":false,"required":false,"index":false},{"name":"key_algorithm","description":"Key algorithm used","type":"text","hidden":false,"required":false,"index":false},{"name":"key_strength","description":"Key size used for RSA/DSA, or curve name","type":"text","hidden":false,"required":false,"index":false},{"name":"key_usage","description":"Certificate key usage and extended key usage","type":"text","hidden":false,"required":false,"index":false},{"name":"subject_key_id","description":"SKID an optionally included SHA1","type":"text","hidden":false,"required":false,"index":false},{"name":"authority_key_id","description":"AKID an optionally included SHA1","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1","description":"SHA1 hash of the raw certificate contents","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to Keychain or PEM bundle","type":"text","hidden":false,"required":false,"index":false},{"name":"serial","description":"Certificate serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"sid","description":"SID","type":"text","hidden":true,"required":false,"index":false},{"name":"store_location","description":"Certificate system store location","type":"text","hidden":true,"required":false,"index":false},{"name":"store","description":"Certificate system store","type":"text","hidden":true,"required":false,"index":false},{"name":"username","description":"Username","type":"text","hidden":true,"required":false,"index":false},{"name":"store_id","description":"Exists for service/user stores. Contains raw store id provided by WinAPI.","type":"text","hidden":true,"required":false,"index":false},{"name":"issuer2","description":"Certificate issuer distinguished name","type":"text","hidden":true,"required":false,"index":false},{"name":"subject2","description":"Certificate distinguished name","type":"text","hidden":true,"required":false,"index":false}]},{"name":"chassis_info","description":"Display information pertaining to the chassis and its security status.","platforms":["windows"],"columns":[{"name":"audible_alarm","description":"If TRUE, the frame is equipped with an audible alarm.","type":"text","hidden":false,"required":false,"index":false},{"name":"breach_description","description":"If provided, gives a more detailed description of a detected security breach.","type":"text","hidden":false,"required":false,"index":false},{"name":"chassis_types","description":"A comma-separated list of chassis types, such as Desktop or Laptop.","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"An extended description of the chassis if available.","type":"text","hidden":false,"required":false,"index":false},{"name":"lock","description":"If TRUE, the frame is equipped with a lock.","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"The manufacturer of the chassis.","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"The model of the chassis.","type":"text","hidden":false,"required":false,"index":false},{"name":"security_breach","description":"The physical status of the chassis such as Breach Successful, Breach Attempted, etc.","type":"text","hidden":false,"required":false,"index":false},{"name":"serial","description":"The serial number of the chassis.","type":"text","hidden":false,"required":false,"index":false},{"name":"smbios_tag","description":"The assigned asset tag number of the chassis.","type":"text","hidden":false,"required":false,"index":false},{"name":"sku","description":"The Stock Keeping Unit number if available.","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"If available, gives various operational or nonoperational statuses such as OK, Degraded, and Pred Fail.","type":"text","hidden":false,"required":false,"index":false},{"name":"visible_alarm","description":"If TRUE, the frame is equipped with a visual alarm.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"chocolatey_packages","description":"Chocolatey packages installed in a system.","platforms":["windows"],"columns":[{"name":"name","description":"Package display name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package-supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"summary","description":"Package-supplied summary","type":"text","hidden":false,"required":false,"index":false},{"name":"author","description":"Optional package author","type":"text","hidden":false,"required":false,"index":false},{"name":"license","description":"License under which package is launched","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path at which this package resides","type":"text","hidden":false,"required":false,"index":false}]},{"name":"chrome_extension_content_scripts","description":"Chrome browser extension content scripts.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"browser_type","description":"The browser type (Valid values: chrome, chromium, opera, yandex, brave)","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"The local user that owns the extension","type":"bigint","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Extension identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Extension-supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"script","description":"The content script used by the extension","type":"text","hidden":false,"required":false,"index":false},{"name":"match","description":"The pattern that the script is matched against","type":"text","hidden":false,"required":false,"index":false},{"name":"profile_path","description":"The profile path","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to extension folder","type":"text","hidden":false,"required":false,"index":false},{"name":"referenced","description":"1 if this extension is referenced by the Preferences file of the profile","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"chrome_extensions","description":"Chrome-based browser extensions.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"browser_type","description":"The browser type (Valid values: chrome, chromium, opera, yandex, brave, edge, edge_beta)","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"The local user that owns the extension","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Extension display name","type":"text","hidden":false,"required":false,"index":false},{"name":"profile","description":"The name of the Chrome profile that contains this extension","type":"text","hidden":false,"required":false,"index":false},{"name":"profile_path","description":"The profile path","type":"text","hidden":false,"required":false,"index":false},{"name":"referenced_identifier","description":"Extension identifier, as specified by the preferences file. Empty if the extension is not in the profile.","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Extension identifier, computed from its manifest. Empty in case of error.","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Extension-supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Extension-optional description","type":"text","hidden":false,"required":false,"index":false},{"name":"default_locale","description":"Default locale supported by extension","type":"text","hidden":false,"required":false,"index":false},{"name":"current_locale","description":"Current locale supported by extension","type":"text","hidden":false,"required":false,"index":false},{"name":"update_url","description":"Extension-supplied update URI","type":"text","hidden":false,"required":false,"index":false},{"name":"author","description":"Optional extension author","type":"text","hidden":false,"required":false,"index":false},{"name":"persistent","description":"1 If extension is persistent across all tabs else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to extension folder","type":"text","hidden":false,"required":false,"index":false},{"name":"permissions","description":"The permissions required by the extension","type":"text","hidden":false,"required":false,"index":false},{"name":"permissions_json","description":"The JSON-encoded permissions required by the extension","type":"text","hidden":true,"required":false,"index":false},{"name":"optional_permissions","description":"The permissions optionally required by the extensions","type":"text","hidden":false,"required":false,"index":false},{"name":"optional_permissions_json","description":"The JSON-encoded permissions optionally required by the extensions","type":"text","hidden":true,"required":false,"index":false},{"name":"manifest_hash","description":"The SHA256 hash of the manifest.json file","type":"text","hidden":false,"required":false,"index":false},{"name":"referenced","description":"1 if this extension is referenced by the Preferences file of the profile","type":"bigint","hidden":false,"required":false,"index":false},{"name":"from_webstore","description":"True if this extension was installed from the web store","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"1 if this extension is enabled","type":"text","hidden":false,"required":false,"index":false},{"name":"install_time","description":"Extension install time, in its original Webkit format","type":"text","hidden":false,"required":false,"index":false},{"name":"install_timestamp","description":"Extension install time, converted to unix time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"manifest_json","description":"The manifest file of the extension","type":"text","hidden":true,"required":false,"index":false},{"name":"key","description":"The extension key, from the manifest file","type":"text","hidden":true,"required":false,"index":false}]},{"name":"connectivity","description":"Provides the overall system's network state.","platforms":["windows"],"columns":[{"name":"disconnected","description":"True if the all interfaces are not connected to any network","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_no_traffic","description":"True if any interface is connected via IPv4, but has seen no traffic","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv6_no_traffic","description":"True if any interface is connected via IPv6, but has seen no traffic","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_subnet","description":"True if any interface is connected to the local subnet via IPv4","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_local_network","description":"True if any interface is connected to a routed network via IPv4","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_internet","description":"True if any interface is connected to the Internet via IPv4","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv6_subnet","description":"True if any interface is connected to the local subnet via IPv6","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv6_local_network","description":"True if any interface is connected to a routed network via IPv6","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv6_internet","description":"True if any interface is connected to the Internet via IPv6","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"cpu_info","description":"Retrieve cpu hardware info of the machine.","platforms":["linux","windows"],"columns":[{"name":"device_id","description":"The DeviceID of the CPU.","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"The model of the CPU.","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"The manufacturer of the CPU.","type":"text","hidden":false,"required":false,"index":false},{"name":"processor_type","description":"The processor type, such as Central, Math, or Video.","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu_status","description":"The current operating status of the CPU.","type":"integer","hidden":false,"required":false,"index":false},{"name":"number_of_cores","description":"The number of cores of the CPU.","type":"text","hidden":false,"required":false,"index":false},{"name":"logical_processors","description":"The number of logical processors of the CPU.","type":"integer","hidden":false,"required":false,"index":false},{"name":"address_width","description":"The width of the CPU address bus.","type":"text","hidden":false,"required":false,"index":false},{"name":"current_clock_speed","description":"The current frequency of the CPU.","type":"integer","hidden":false,"required":false,"index":false},{"name":"max_clock_speed","description":"The maximum possible frequency of the CPU.","type":"integer","hidden":false,"required":false,"index":false},{"name":"socket_designation","description":"The assigned socket on the board for the given CPU.","type":"text","hidden":false,"required":false,"index":false},{"name":"availability","description":"The availability and status of the CPU.","type":"text","hidden":true,"required":false,"index":false}]},{"name":"cpu_time","description":"Displays information from /proc/stat file about the time the cpu cores spent in different parts of the system.","platforms":["darwin","linux"],"columns":[{"name":"core","description":"Name of the cpu (core)","type":"integer","hidden":false,"required":false,"index":false},{"name":"user","description":"Time spent in user mode","type":"bigint","hidden":false,"required":false,"index":false},{"name":"nice","description":"Time spent in user mode with low priority (nice)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"system","description":"Time spent in system mode","type":"bigint","hidden":false,"required":false,"index":false},{"name":"idle","description":"Time spent in the idle task","type":"bigint","hidden":false,"required":false,"index":false},{"name":"iowait","description":"Time spent waiting for I/O to complete","type":"bigint","hidden":false,"required":false,"index":false},{"name":"irq","description":"Time spent servicing interrupts","type":"bigint","hidden":false,"required":false,"index":false},{"name":"softirq","description":"Time spent servicing softirqs","type":"bigint","hidden":false,"required":false,"index":false},{"name":"steal","description":"Time spent in other operating systems when running in a virtualized environment","type":"bigint","hidden":false,"required":false,"index":false},{"name":"guest","description":"Time spent running a virtual CPU for a guest OS under the control of the Linux kernel","type":"bigint","hidden":false,"required":false,"index":false},{"name":"guest_nice","description":"Time spent running a niced guest ","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"cpuid","description":"Useful CPU features from the cpuid ASM call.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"feature","description":"Present feature flags","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Bit value or string","type":"text","hidden":false,"required":false,"index":false},{"name":"output_register","description":"Register used to for feature value","type":"text","hidden":false,"required":false,"index":false},{"name":"output_bit","description":"Bit in register value for feature value","type":"integer","hidden":false,"required":false,"index":false},{"name":"input_eax","description":"Value of EAX used","type":"text","hidden":false,"required":false,"index":false}]},{"name":"crashes","description":"Application, System, and Mobile App crash logs.","platforms":["darwin"],"columns":[{"name":"type","description":"Type of crash log","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID of the crashed process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"crash_path","description":"Location of log file","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Identifier of the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Version info of the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent PID of the crashed process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"responsible","description":"Process responsible for the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID of the crashed process","type":"integer","hidden":false,"required":false,"index":false},{"name":"datetime","description":"Date/Time at which the crash occurred","type":"text","hidden":false,"required":false,"index":false},{"name":"crashed_thread","description":"Thread ID which crashed","type":"bigint","hidden":false,"required":false,"index":false},{"name":"stack_trace","description":"Most recent frame from the stack trace","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_type","description":"Exception type of the crash","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_codes","description":"Exception codes from the crash","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_notes","description":"Exception notes from the crash","type":"text","hidden":false,"required":false,"index":false},{"name":"registers","description":"The value of the system registers","type":"text","hidden":false,"required":false,"index":false}]},{"name":"crontab","description":"Line parsed values from system and user cron/tab.","platforms":["darwin","linux"],"columns":[{"name":"event","description":"The job @event name (rare)","type":"text","hidden":false,"required":false,"index":false},{"name":"minute","description":"The exact minute for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"hour","description":"The hour of the day for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"day_of_month","description":"The day of the month for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"month","description":"The month of the year for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"day_of_week","description":"The day of the week for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"command","description":"Raw command string","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"File parsed","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"cups_destinations","description":"Returns all configured printers.","platforms":["darwin"],"columns":[{"name":"name","description":"Name of the printer","type":"text","hidden":false,"required":false,"index":false},{"name":"option_name","description":"Option name","type":"text","hidden":false,"required":false,"index":false},{"name":"option_value","description":"Option value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"cups_jobs","description":"Returns all completed print jobs from cups.","platforms":["darwin"],"columns":[{"name":"title","description":"Title of the printed job","type":"text","hidden":false,"required":false,"index":false},{"name":"destination","description":"The printer the job was sent to","type":"text","hidden":false,"required":false,"index":false},{"name":"user","description":"The user who printed the job","type":"text","hidden":false,"required":false,"index":false},{"name":"format","description":"The format of the print job","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"The size of the print job","type":"integer","hidden":false,"required":false,"index":false},{"name":"completed_time","description":"When the job completed printing","type":"integer","hidden":false,"required":false,"index":false},{"name":"processing_time","description":"How long the job took to process","type":"integer","hidden":false,"required":false,"index":false},{"name":"creation_time","description":"When the print request was initiated","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"curl","description":"Perform an http request and return stats about it.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"url","description":"The url for the request","type":"text","hidden":false,"required":true,"index":false},{"name":"method","description":"The HTTP method for the request","type":"text","hidden":false,"required":false,"index":false},{"name":"user_agent","description":"The user-agent string to use for the request","type":"text","hidden":false,"required":false,"index":false},{"name":"response_code","description":"The HTTP status code for the response","type":"integer","hidden":false,"required":false,"index":false},{"name":"round_trip_time","description":"Time taken to complete the request","type":"bigint","hidden":false,"required":false,"index":false},{"name":"bytes","description":"Number of bytes in the response","type":"bigint","hidden":false,"required":false,"index":false},{"name":"result","description":"The HTTP response body","type":"text","hidden":false,"required":false,"index":false}]},{"name":"curl_certificate","description":"Inspect TLS certificates by connecting to input hostnames.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"hostname","description":"Hostname to CURL (domain[:port], e.g. osquery.io)","type":"text","hidden":false,"required":true,"index":false},{"name":"common_name","description":"Common name of company issued to","type":"text","hidden":false,"required":false,"index":false},{"name":"organization","description":"Organization issued to","type":"text","hidden":false,"required":false,"index":false},{"name":"organization_unit","description":"Organization unit issued to","type":"text","hidden":false,"required":false,"index":false},{"name":"serial_number","description":"Certificate serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer_common_name","description":"Issuer common name","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer_organization","description":"Issuer organization","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer_organization_unit","description":"Issuer organization unit","type":"text","hidden":false,"required":false,"index":false},{"name":"valid_from","description":"Period of validity start date","type":"text","hidden":false,"required":false,"index":false},{"name":"valid_to","description":"Period of validity end date","type":"text","hidden":false,"required":false,"index":false},{"name":"sha256_fingerprint","description":"SHA-256 fingerprint","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1_fingerprint","description":"SHA1 fingerprint","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Version Number","type":"integer","hidden":false,"required":false,"index":false},{"name":"signature_algorithm","description":"Signature Algorithm","type":"text","hidden":false,"required":false,"index":false},{"name":"signature","description":"Signature","type":"text","hidden":false,"required":false,"index":false},{"name":"subject_key_identifier","description":"Subject Key Identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"authority_key_identifier","description":"Authority Key Identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"key_usage","description":"Usage of key in certificate","type":"text","hidden":false,"required":false,"index":false},{"name":"extended_key_usage","description":"Extended usage of key in certificate","type":"text","hidden":false,"required":false,"index":false},{"name":"policies","description":"Certificate Policies","type":"text","hidden":false,"required":false,"index":false},{"name":"subject_alternative_names","description":"Subject Alternative Name","type":"text","hidden":false,"required":false,"index":false},{"name":"issuer_alternative_names","description":"Issuer Alternative Name","type":"text","hidden":false,"required":false,"index":false},{"name":"info_access","description":"Authority Information Access","type":"text","hidden":false,"required":false,"index":false},{"name":"subject_info_access","description":"Subject Information Access","type":"text","hidden":false,"required":false,"index":false},{"name":"policy_mappings","description":"Policy Mappings","type":"text","hidden":false,"required":false,"index":false},{"name":"has_expired","description":"1 if the certificate has expired, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"basic_constraint","description":"Basic Constraints","type":"text","hidden":false,"required":false,"index":false},{"name":"name_constraints","description":"Name Constraints","type":"text","hidden":false,"required":false,"index":false},{"name":"policy_constraints","description":"Policy Constraints","type":"text","hidden":false,"required":false,"index":false},{"name":"dump_certificate","description":"Set this value to '1' to dump certificate","type":"integer","hidden":true,"required":false,"index":false},{"name":"timeout","description":"Set this value to the timeout in seconds to complete the TLS handshake (default 4s, use 0 for no timeout)","type":"integer","hidden":true,"required":false,"index":false},{"name":"pem","description":"Certificate PEM format","type":"text","hidden":false,"required":false,"index":false}]},{"name":"deb_packages","description":"The installed DEB package database.","platforms":["linux"],"columns":[{"name":"name","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package version","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Package source","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Package size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"arch","description":"Package architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"revision","description":"Package revision","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Package status","type":"text","hidden":false,"required":false,"index":false},{"name":"maintainer","description":"Package maintainer","type":"text","hidden":false,"required":false,"index":false},{"name":"section","description":"Package section","type":"text","hidden":false,"required":false,"index":false},{"name":"priority","description":"Package priority","type":"text","hidden":false,"required":false,"index":false},{"name":"admindir","description":"libdpkg admindir. Defaults to /var/lib/dpkg","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"default_environment","description":"Default environment variables and values.","platforms":["windows"],"columns":[{"name":"variable","description":"Name of the environment variable","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Value of the environment variable","type":"text","hidden":false,"required":false,"index":false},{"name":"expand","description":"1 if the variable needs expanding, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"device_file","description":"Similar to the file table, but use TSK and allow block address access.","platforms":["darwin","linux"],"columns":[{"name":"device","description":"Absolute file path to device node","type":"text","hidden":false,"required":true,"index":false},{"name":"partition","description":"A partition number","type":"text","hidden":false,"required":true,"index":false},{"name":"path","description":"A logical path within the device node","type":"text","hidden":false,"required":false,"index":false},{"name":"filename","description":"Name portion of file path","type":"text","hidden":false,"required":false,"index":false},{"name":"inode","description":"Filesystem inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"Owning user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Owning group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mode","description":"Permission bits","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of file in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"block_size","description":"Block size of filesystem","type":"integer","hidden":false,"required":false,"index":false},{"name":"atime","description":"Last access time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mtime","description":"Last modification time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ctime","description":"Creation time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"hard_links","description":"Number of hard links","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"File status","type":"text","hidden":false,"required":false,"index":false}]},{"name":"device_firmware","description":"A best-effort list of discovered firmware versions.","platforms":["darwin"],"columns":[{"name":"type","description":"Type of device","type":"text","hidden":false,"required":false,"index":false},{"name":"device","description":"The device name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Firmware version","type":"text","hidden":false,"required":false,"index":false}]},{"name":"device_hash","description":"Similar to the hash table, but use TSK and allow block address access.","platforms":["darwin","linux"],"columns":[{"name":"device","description":"Absolute file path to device node","type":"text","hidden":false,"required":true,"index":false},{"name":"partition","description":"A partition number","type":"text","hidden":false,"required":true,"index":false},{"name":"inode","description":"Filesystem inode number","type":"bigint","hidden":false,"required":true,"index":false},{"name":"md5","description":"MD5 hash of provided inode data","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1","description":"SHA1 hash of provided inode data","type":"text","hidden":false,"required":false,"index":false},{"name":"sha256","description":"SHA256 hash of provided inode data","type":"text","hidden":false,"required":false,"index":false}]},{"name":"device_partitions","description":"Use TSK to enumerate details about partitions on a disk device.","platforms":["darwin","linux"],"columns":[{"name":"device","description":"Absolute file path to device node","type":"text","hidden":false,"required":true,"index":false},{"name":"partition","description":"A partition number or description","type":"integer","hidden":false,"required":false,"index":false},{"name":"label","description":"","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"","type":"text","hidden":false,"required":false,"index":false},{"name":"offset","description":"","type":"bigint","hidden":false,"required":false,"index":false},{"name":"blocks_size","description":"Byte size of each block","type":"bigint","hidden":false,"required":false,"index":false},{"name":"blocks","description":"Number of blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inodes","description":"Number of meta nodes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"flags","description":"","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"disk_encryption","description":"Disk encryption status and information.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"Disk name","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"Disk Universally Unique Identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"encrypted","description":"1 If encrypted: true (disk is encrypted), else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Description of cipher type and mode if available","type":"text","hidden":false,"required":false,"index":false},{"name":"encryption_status","description":"Disk encryption status with one of following values: encrypted | not encrypted | undefined","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"Currently authenticated user if available","type":"text","hidden":false,"required":false,"index":false},{"name":"user_uuid","description":"UUID of authenticated user if available","type":"text","hidden":false,"required":false,"index":false},{"name":"filevault_status","description":"FileVault status with one of following values: on | off | unknown","type":"text","hidden":false,"required":false,"index":false}]},{"name":"disk_events","description":"Track DMG disk image events (appearance/disappearance) when opened.","platforms":["darwin"],"columns":[{"name":"action","description":"Appear or disappear","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of the DMG file accessed","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Disk event name","type":"text","hidden":false,"required":false,"index":false},{"name":"device","description":"Disk event BSD name","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"UUID of the volume inside DMG if available","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of partition in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ejectable","description":"1 if ejectable, 0 if not","type":"integer","hidden":false,"required":false,"index":false},{"name":"mountable","description":"1 if mountable, 0 if not","type":"integer","hidden":false,"required":false,"index":false},{"name":"writable","description":"1 if writable, 0 if not","type":"integer","hidden":false,"required":false,"index":false},{"name":"content","description":"Disk event content","type":"text","hidden":false,"required":false,"index":false},{"name":"media_name","description":"Disk event media name string","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor","description":"Disk event vendor string","type":"text","hidden":false,"required":false,"index":false},{"name":"filesystem","description":"Filesystem if available","type":"text","hidden":false,"required":false,"index":false},{"name":"checksum","description":"UDIF Master checksum if available (CRC32)","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of appearance/disappearance in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"disk_info","description":"Retrieve basic information about the physical disks of a system.","platforms":["windows"],"columns":[{"name":"partitions","description":"Number of detected partitions on disk.","type":"integer","hidden":false,"required":false,"index":false},{"name":"disk_index","description":"Physical drive number of the disk.","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"The interface type of the disk.","type":"text","hidden":false,"required":false,"index":false},{"name":"id","description":"The unique identifier of the drive on the system.","type":"text","hidden":false,"required":false,"index":false},{"name":"pnp_device_id","description":"The unique identifier of the drive on the system.","type":"text","hidden":false,"required":false,"index":false},{"name":"disk_size","description":"Size of the disk.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"The manufacturer of the disk.","type":"text","hidden":false,"required":false,"index":false},{"name":"hardware_model","description":"Hard drive model.","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"The label of the disk object.","type":"text","hidden":false,"required":false,"index":false},{"name":"serial","description":"The serial number of the disk.","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"The OS's description of the disk.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"dns_cache","description":"Enumerate the DNS cache using the undocumented DnsGetCacheDataTable function in dnsapi.dll.","platforms":["windows"],"columns":[{"name":"name","description":"DNS record name","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"DNS record type","type":"text","hidden":false,"required":false,"index":false},{"name":"flags","description":"DNS record flags","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"dns_resolvers","description":"Resolvers used by this host.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Address type index or order","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Address type: sortlist, nameserver, search","type":"text","hidden":false,"required":false,"index":false},{"name":"address","description":"Resolver IP/IPv6 address","type":"text","hidden":false,"required":false,"index":false},{"name":"netmask","description":"Address (sortlist) netmask length","type":"text","hidden":false,"required":false,"index":false},{"name":"options","description":"Resolver options","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"docker_container_envs","description":"Docker container environment variables.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Environment variable name","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Environment variable value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_container_fs_changes","description":"Changes to files or directories on container's filesystem.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":true,"index":false},{"name":"path","description":"FIle or directory path relative to rootfs","type":"text","hidden":false,"required":false,"index":false},{"name":"change_type","description":"Type of change: C:Modified, A:Added, D:Deleted","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_container_labels","description":"Docker container labels.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Label key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Optional label value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_container_mounts","description":"Docker container mounts.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of mount (bind, volume)","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Optional mount name","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Source path on host","type":"text","hidden":false,"required":false,"index":false},{"name":"destination","description":"Destination path inside container","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"Driver providing the mount","type":"text","hidden":false,"required":false,"index":false},{"name":"mode","description":"Mount options (rw, ro)","type":"text","hidden":false,"required":false,"index":false},{"name":"rw","description":"1 if read/write. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"propagation","description":"Mount propagation","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_container_networks","description":"Docker container networks.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Network name","type":"text","hidden":false,"required":false,"index":false},{"name":"network_id","description":"Network ID","type":"text","hidden":false,"required":false,"index":false},{"name":"endpoint_id","description":"Endpoint ID","type":"text","hidden":false,"required":false,"index":false},{"name":"gateway","description":"Gateway","type":"text","hidden":false,"required":false,"index":false},{"name":"ip_address","description":"IP address","type":"text","hidden":false,"required":false,"index":false},{"name":"ip_prefix_len","description":"IP subnet prefix length","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv6_gateway","description":"IPv6 gateway","type":"text","hidden":false,"required":false,"index":false},{"name":"ipv6_address","description":"IPv6 address","type":"text","hidden":false,"required":false,"index":false},{"name":"ipv6_prefix_len","description":"IPv6 subnet prefix length","type":"integer","hidden":false,"required":false,"index":false},{"name":"mac_address","description":"MAC address","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_container_ports","description":"Docker container ports.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Protocol (tcp, udp)","type":"text","hidden":false,"required":false,"index":false},{"name":"port","description":"Port inside the container","type":"integer","hidden":false,"required":false,"index":false},{"name":"host_ip","description":"Host IP address on which public port is listening","type":"text","hidden":false,"required":false,"index":false},{"name":"host_port","description":"Host port","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"docker_container_processes","description":"Docker container processes.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":true,"index":false},{"name":"pid","description":"Process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"The process path or shorthand argv[0]","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Complete argv","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Process state","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"euid","description":"Effective user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"egid","description":"Effective group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"suid","description":"Saved user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sgid","description":"Saved group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"wired_size","description":"Bytes of unpageable memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"resident_size","description":"Bytes of private memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"total_size","description":"Total virtual memory size","type":"bigint","hidden":false,"required":false,"index":false},{"name":"start_time","description":"Process start in seconds since boot (non-sleeping)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Process parent's PID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pgroup","description":"Process group","type":"bigint","hidden":false,"required":false,"index":false},{"name":"threads","description":"Number of threads used by process","type":"integer","hidden":false,"required":false,"index":false},{"name":"nice","description":"Process nice level (-20 to 20, default 0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"user","description":"User name","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Cumulative CPU time. [DD-]HH:MM:SS format","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu","description":"CPU utilization as percentage","type":"double","hidden":false,"required":false,"index":false},{"name":"mem","description":"Memory utilization as percentage","type":"double","hidden":false,"required":false,"index":false}]},{"name":"docker_container_stats","description":"Docker container statistics. Queries on this table take at least one second.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":true,"index":false},{"name":"name","description":"Container name","type":"text","hidden":false,"required":false,"index":false},{"name":"pids","description":"Number of processes","type":"integer","hidden":false,"required":false,"index":false},{"name":"read","description":"UNIX time when stats were read","type":"bigint","hidden":false,"required":false,"index":false},{"name":"preread","description":"UNIX time when stats were last read","type":"bigint","hidden":false,"required":false,"index":false},{"name":"interval","description":"Difference between read and preread in nano-seconds","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_read","description":"Total disk read bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_write","description":"Total disk write bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"num_procs","description":"Number of processors","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_total_usage","description":"Total CPU usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cpu_kernelmode_usage","description":"CPU kernel mode usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cpu_usermode_usage","description":"CPU user mode usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"system_cpu_usage","description":"CPU system usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"online_cpus","description":"Online CPUs","type":"integer","hidden":false,"required":false,"index":false},{"name":"pre_cpu_total_usage","description":"Last read total CPU usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pre_cpu_kernelmode_usage","description":"Last read CPU kernel mode usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pre_cpu_usermode_usage","description":"Last read CPU user mode usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pre_system_cpu_usage","description":"Last read CPU system usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pre_online_cpus","description":"Last read online CPUs","type":"integer","hidden":false,"required":false,"index":false},{"name":"memory_usage","description":"Memory usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"memory_max_usage","description":"Memory maximum usage","type":"bigint","hidden":false,"required":false,"index":false},{"name":"memory_limit","description":"Memory limit","type":"bigint","hidden":false,"required":false,"index":false},{"name":"network_rx_bytes","description":"Total network bytes read","type":"bigint","hidden":false,"required":false,"index":false},{"name":"network_tx_bytes","description":"Total network bytes transmitted","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"docker_containers","description":"Docker containers information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Container ID","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Container name","type":"text","hidden":false,"required":false,"index":false},{"name":"image","description":"Docker image (name) used to launch this container","type":"text","hidden":false,"required":false,"index":false},{"name":"image_id","description":"Docker image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"command","description":"Command with arguments","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Time of creation as UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"state","description":"Container state (created, restarting, running, removing, paused, exited, dead)","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Container status information","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Identifier of the initial process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Container path","type":"text","hidden":false,"required":false,"index":false},{"name":"config_entrypoint","description":"Container entrypoint(s)","type":"text","hidden":false,"required":false,"index":false},{"name":"started_at","description":"Container start time as string","type":"text","hidden":false,"required":false,"index":false},{"name":"finished_at","description":"Container finish time as string","type":"text","hidden":false,"required":false,"index":false},{"name":"privileged","description":"Is the container privileged","type":"integer","hidden":false,"required":false,"index":false},{"name":"security_options","description":"List of container security options","type":"text","hidden":false,"required":false,"index":false},{"name":"env_variables","description":"Container environmental variables","type":"text","hidden":false,"required":false,"index":false},{"name":"readonly_rootfs","description":"Is the root filesystem mounted as read only","type":"integer","hidden":false,"required":false,"index":false},{"name":"cgroup_namespace","description":"cgroup namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"ipc_namespace","description":"IPC namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"mnt_namespace","description":"Mount namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"net_namespace","description":"Network namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"pid_namespace","description":"PID namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"user_namespace","description":"User namespace","type":"text","hidden":true,"required":false,"index":false},{"name":"uts_namespace","description":"UTS namespace","type":"text","hidden":true,"required":false,"index":false}]},{"name":"docker_image_history","description":"Docker image history information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Time of creation as UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of instruction in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"created_by","description":"Created by instruction","type":"text","hidden":false,"required":false,"index":false},{"name":"tags","description":"Comma-separated list of tags","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Instruction comment","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_image_labels","description":"Docker image labels.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Label key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Optional label value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_image_layers","description":"Docker image layers information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"layer_id","description":"Layer ID","type":"text","hidden":false,"required":false,"index":false},{"name":"layer_order","description":"Layer Order (1 = base layer)","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"docker_images","description":"Docker images information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Time of creation as UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"size_bytes","description":"Size of image in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"tags","description":"Comma-separated list of repository tags","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_info","description":"Docker system information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Docker system ID","type":"text","hidden":false,"required":false,"index":false},{"name":"containers","description":"Total number of containers","type":"integer","hidden":false,"required":false,"index":false},{"name":"containers_running","description":"Number of containers currently running","type":"integer","hidden":false,"required":false,"index":false},{"name":"containers_paused","description":"Number of containers in paused state","type":"integer","hidden":false,"required":false,"index":false},{"name":"containers_stopped","description":"Number of containers in stopped state","type":"integer","hidden":false,"required":false,"index":false},{"name":"images","description":"Number of images","type":"integer","hidden":false,"required":false,"index":false},{"name":"storage_driver","description":"Storage driver","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_limit","description":"1 if memory limit support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"swap_limit","description":"1 if swap limit support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"kernel_memory","description":"1 if kernel memory limit support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_cfs_period","description":"1 if CPU Completely Fair Scheduler (CFS) period support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_cfs_quota","description":"1 if CPU Completely Fair Scheduler (CFS) quota support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_shares","description":"1 if CPU share weighting support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_set","description":"1 if CPU set selection support is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_forwarding","description":"1 if IPv4 forwarding is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"bridge_nf_iptables","description":"1 if bridge netfilter iptables is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"bridge_nf_ip6tables","description":"1 if bridge netfilter ip6tables is enabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"oom_kill_disable","description":"1 if Out-of-memory kill is disabled. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"logging_driver","description":"Logging driver","type":"text","hidden":false,"required":false,"index":false},{"name":"cgroup_driver","description":"Control groups driver","type":"text","hidden":false,"required":false,"index":false},{"name":"kernel_version","description":"Kernel version","type":"text","hidden":false,"required":false,"index":false},{"name":"os","description":"Operating system","type":"text","hidden":false,"required":false,"index":false},{"name":"os_type","description":"Operating system type","type":"text","hidden":false,"required":false,"index":false},{"name":"architecture","description":"Hardware architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"cpus","description":"Number of CPUs","type":"integer","hidden":false,"required":false,"index":false},{"name":"memory","description":"Total memory","type":"bigint","hidden":false,"required":false,"index":false},{"name":"http_proxy","description":"HTTP proxy","type":"text","hidden":false,"required":false,"index":false},{"name":"https_proxy","description":"HTTPS proxy","type":"text","hidden":false,"required":false,"index":false},{"name":"no_proxy","description":"Comma-separated list of domain extensions proxy should not be used for","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the docker host","type":"text","hidden":false,"required":false,"index":false},{"name":"server_version","description":"Server version","type":"text","hidden":false,"required":false,"index":false},{"name":"root_dir","description":"Docker root directory","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_network_labels","description":"Docker network labels.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Network ID","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Label key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Optional label value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_networks","description":"Docker networks information.","platforms":["darwin","linux"],"columns":[{"name":"id","description":"Network ID","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Network name","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"Network driver","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Time of creation as UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"enable_ipv6","description":"1 if IPv6 is enabled on this network. 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"subnet","description":"Network subnet","type":"text","hidden":false,"required":false,"index":false},{"name":"gateway","description":"Network gateway","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_version","description":"Docker version information.","platforms":["darwin","linux"],"columns":[{"name":"version","description":"Docker version","type":"text","hidden":false,"required":false,"index":false},{"name":"api_version","description":"API version","type":"text","hidden":false,"required":false,"index":false},{"name":"min_api_version","description":"Minimum API version supported","type":"text","hidden":false,"required":false,"index":false},{"name":"git_commit","description":"Docker build git commit","type":"text","hidden":false,"required":false,"index":false},{"name":"go_version","description":"Go version","type":"text","hidden":false,"required":false,"index":false},{"name":"os","description":"Operating system","type":"text","hidden":false,"required":false,"index":false},{"name":"arch","description":"Hardware architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"kernel_version","description":"Kernel version","type":"text","hidden":false,"required":false,"index":false},{"name":"build_time","description":"Build time","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_volume_labels","description":"Docker volume labels.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"Volume name","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Label key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Optional label value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"docker_volumes","description":"Docker volumes information.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"Volume name","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"Volume driver","type":"text","hidden":false,"required":false,"index":false},{"name":"mount_point","description":"Mount point","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Volume type","type":"text","hidden":false,"required":false,"index":false}]},{"name":"drivers","description":"Details for in-use Windows device drivers. This does not display installed but unused drivers.","platforms":["windows"],"columns":[{"name":"device_id","description":"Device ID","type":"text","hidden":false,"required":false,"index":false},{"name":"device_name","description":"Device name","type":"text","hidden":false,"required":false,"index":false},{"name":"image","description":"Path to driver image file","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Driver description","type":"text","hidden":false,"required":false,"index":false},{"name":"service","description":"Driver service name, if one exists","type":"text","hidden":false,"required":false,"index":false},{"name":"service_key","description":"Driver service registry key","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Driver version","type":"text","hidden":false,"required":false,"index":false},{"name":"inf","description":"Associated inf file","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"Device/driver class name","type":"text","hidden":false,"required":false,"index":false},{"name":"provider","description":"Driver provider","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"Device manufacturer","type":"text","hidden":false,"required":false,"index":false},{"name":"driver_key","description":"Driver key","type":"text","hidden":false,"required":false,"index":false},{"name":"date","description":"Driver date","type":"bigint","hidden":false,"required":false,"index":false},{"name":"signed","description":"Whether the driver is signed or not","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"ec2_instance_metadata","description":"EC2 instance metadata.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"instance_id","description":"EC2 instance ID","type":"text","hidden":false,"required":false,"index":false},{"name":"instance_type","description":"EC2 instance type","type":"text","hidden":false,"required":false,"index":false},{"name":"architecture","description":"Hardware architecture of this EC2 instance","type":"text","hidden":false,"required":false,"index":false},{"name":"region","description":"AWS region in which this instance launched","type":"text","hidden":false,"required":false,"index":false},{"name":"availability_zone","description":"Availability zone in which this instance launched","type":"text","hidden":false,"required":false,"index":false},{"name":"local_hostname","description":"Private IPv4 DNS hostname of the first interface of this instance","type":"text","hidden":false,"required":false,"index":false},{"name":"local_ipv4","description":"Private IPv4 address of the first interface of this instance","type":"text","hidden":false,"required":false,"index":false},{"name":"mac","description":"MAC address for the first network interface of this EC2 instance","type":"text","hidden":false,"required":false,"index":false},{"name":"security_groups","description":"Comma separated list of security group names","type":"text","hidden":false,"required":false,"index":false},{"name":"iam_arn","description":"If there is an IAM role associated with the instance, contains instance profile ARN","type":"text","hidden":false,"required":false,"index":false},{"name":"ami_id","description":"AMI ID used to launch this EC2 instance","type":"text","hidden":false,"required":false,"index":false},{"name":"reservation_id","description":"ID of the reservation","type":"text","hidden":false,"required":false,"index":false},{"name":"account_id","description":"AWS account ID which owns this EC2 instance","type":"text","hidden":false,"required":false,"index":false},{"name":"ssh_public_key","description":"SSH public key. Only available if supplied at instance launch time","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ec2_instance_tags","description":"EC2 instance tag key value pairs.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"instance_id","description":"EC2 instance ID","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Tag key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Tag value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"es_process_events","description":"Process execution events from EndpointSecurity.","platforms":["darwin"],"columns":[{"name":"version","description":"Version of EndpointSecurity event","type":"integer","hidden":false,"required":false,"index":false},{"name":"seq_num","description":"Per event sequence number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"global_seq_num","description":"Global sequence number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of executed file","type":"text","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"original_parent","description":"Original parent process ID in case of reparenting","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Command line arguments (argv)","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline_count","description":"Number of command line arguments","type":"bigint","hidden":false,"required":false,"index":false},{"name":"env","description":"Environment variables delimited by spaces","type":"text","hidden":false,"required":false,"index":false},{"name":"env_count","description":"Number of environment variables","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cwd","description":"The process current working directory","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID of the process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"euid","description":"Effective User ID of the process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID of the process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"egid","description":"Effective Group ID of the process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"username","description":"Username","type":"text","hidden":false,"required":false,"index":false},{"name":"signing_id","description":"Signature identifier of the process","type":"text","hidden":false,"required":false,"index":false},{"name":"team_id","description":"Team identifier of thd process","type":"text","hidden":false,"required":false,"index":false},{"name":"cdhash","description":"Codesigning hash of the process","type":"text","hidden":false,"required":false,"index":false},{"name":"platform_binary","description":"Indicates if the binary is Apple signed binary (1) or not (0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"exit_code","description":"Exit code of a process in case of an exit event","type":"integer","hidden":false,"required":false,"index":false},{"name":"child_pid","description":"Process ID of a child process in case of a fork event","type":"bigint","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"event_type","description":"Type of EndpointSecurity event","type":"text","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"es_process_file_events","description":"Process execution events from EndpointSecurity.","platforms":["darwin"],"columns":[{"name":"version","description":"Version of EndpointSecurity event","type":"integer","hidden":false,"required":false,"index":false},{"name":"seq_num","description":"Per event sequence number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"global_seq_num","description":"Global sequence number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of executed file","type":"text","hidden":false,"required":false,"index":false},{"name":"filename","description":"The source or target filename for the event","type":"text","hidden":false,"required":false,"index":false},{"name":"dest_filename","description":"Destination filename for the event","type":"text","hidden":false,"required":false,"index":false},{"name":"event_type","description":"Type of EndpointSecurity event","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"etc_hosts","description":"Line-parsed /etc/hosts.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"address","description":"IP address mapping","type":"text","hidden":false,"required":false,"index":false},{"name":"hostnames","description":"Raw hosts mapping","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"etc_protocols","description":"Line-parsed /etc/protocols.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Protocol name","type":"text","hidden":false,"required":false,"index":false},{"name":"number","description":"Protocol number","type":"integer","hidden":false,"required":false,"index":false},{"name":"alias","description":"Protocol alias","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Comment with protocol description","type":"text","hidden":false,"required":false,"index":false}]},{"name":"etc_services","description":"Line-parsed /etc/services.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Service name","type":"text","hidden":false,"required":false,"index":false},{"name":"port","description":"Service port number","type":"integer","hidden":false,"required":false,"index":false},{"name":"protocol","description":"Transport protocol (TCP/UDP)","type":"text","hidden":false,"required":false,"index":false},{"name":"aliases","description":"Optional space separated list of other names for a service","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Optional comment for a service.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"event_taps","description":"Returns information about installed event taps.","platforms":["darwin"],"columns":[{"name":"enabled","description":"Is the Event Tap enabled","type":"integer","hidden":false,"required":false,"index":false},{"name":"event_tap_id","description":"Unique ID for the Tap","type":"integer","hidden":false,"required":false,"index":false},{"name":"event_tapped","description":"The mask that identifies the set of events to be observed.","type":"text","hidden":false,"required":false,"index":false},{"name":"process_being_tapped","description":"The process ID of the target application","type":"integer","hidden":false,"required":false,"index":false},{"name":"tapping_process","description":"The process ID of the application that created the event tap.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"extended_attributes","description":"Returns the extended attributes for files (similar to Windows ADS).","platforms":["darwin","linux"],"columns":[{"name":"path","description":"Absolute file path","type":"text","hidden":false,"required":true,"index":false},{"name":"directory","description":"Directory of file(s)","type":"text","hidden":false,"required":true,"index":false},{"name":"key","description":"Name of the value generated from the extended attribute","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"The parsed information from the attribute","type":"text","hidden":false,"required":false,"index":false},{"name":"base64","description":"1 if the value is base64 encoded else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"fan_speed_sensors","description":"Fan speeds.","platforms":["darwin"],"columns":[{"name":"fan","description":"Fan number","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Fan name","type":"text","hidden":false,"required":false,"index":false},{"name":"actual","description":"Actual speed","type":"integer","hidden":false,"required":false,"index":false},{"name":"min","description":"Minimum speed","type":"integer","hidden":false,"required":false,"index":false},{"name":"max","description":"Maximum speed","type":"integer","hidden":false,"required":false,"index":false},{"name":"target","description":"Target speed","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"fbsd_kmods","description":"Loaded FreeBSD kernel modules.","platforms":["freebsd"],"columns":[{"name":"name","description":"Module name","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of module content","type":"integer","hidden":false,"required":false,"index":false},{"name":"refs","description":"Module reverse dependencies","type":"integer","hidden":false,"required":false,"index":false},{"name":"address","description":"Kernel module address","type":"text","hidden":false,"required":false,"index":false}]},{"name":"file","description":"Interactive filesystem attributes and metadata.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"path","description":"Absolute file path","type":"text","hidden":false,"required":true,"index":false},{"name":"directory","description":"Directory of file(s)","type":"text","hidden":false,"required":true,"index":false},{"name":"filename","description":"Name portion of file path","type":"text","hidden":false,"required":false,"index":false},{"name":"inode","description":"Filesystem inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"Owning user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Owning group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mode","description":"Permission bits","type":"text","hidden":false,"required":false,"index":false},{"name":"device","description":"Device ID (optional)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of file in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"block_size","description":"Block size of filesystem","type":"integer","hidden":false,"required":false,"index":false},{"name":"atime","description":"Last access time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mtime","description":"Last modification time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ctime","description":"Last status change time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"btime","description":"(B)irth or (cr)eate time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"hard_links","description":"Number of hard links","type":"integer","hidden":false,"required":false,"index":false},{"name":"symlink","description":"1 if the path is a symlink, otherwise 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"File status","type":"text","hidden":false,"required":false,"index":false},{"name":"attributes","description":"File attrib string. See: https://ss64.com/nt/attrib.html","type":"text","hidden":true,"required":false,"index":false},{"name":"volume_serial","description":"Volume serial number","type":"text","hidden":true,"required":false,"index":false},{"name":"file_id","description":"file ID","type":"text","hidden":true,"required":false,"index":false},{"name":"file_version","description":"File version","type":"text","hidden":true,"required":false,"index":false},{"name":"product_version","description":"File product version","type":"text","hidden":true,"required":false,"index":false},{"name":"original_filename","description":"(Executable files only) Original filename","type":"text","hidden":true,"required":false,"index":false},{"name":"bsd_flags","description":"The BSD file flags (chflags). Possible values: NODUMP, UF_IMMUTABLE, UF_APPEND, OPAQUE, HIDDEN, ARCHIVED, SF_IMMUTABLE, SF_APPEND","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"file_events","description":"Track time/action changes to files specified in configuration data.","platforms":["darwin","linux"],"columns":[{"name":"target_path","description":"The path associated with the event","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"The category of the file defined in the config","type":"text","hidden":false,"required":false,"index":false},{"name":"action","description":"Change action (UPDATE, REMOVE, etc)","type":"text","hidden":false,"required":false,"index":false},{"name":"transaction_id","description":"ID used during bulk update","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inode","description":"Filesystem inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"Owning user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Owning group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mode","description":"Permission bits","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of file in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"atime","description":"Last access time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mtime","description":"Last modification time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ctime","description":"Last status change time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"md5","description":"The MD5 of the file after change","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1","description":"The SHA1 of the file after change","type":"text","hidden":false,"required":false,"index":false},{"name":"sha256","description":"The SHA256 of the file after change","type":"text","hidden":false,"required":false,"index":false},{"name":"hashed","description":"1 if the file was hashed, 0 if not, -1 if hashing failed","type":"integer","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of file event","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"firefox_addons","description":"Firefox browser extensions, webapps, and addons.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"The local user that owns the addon","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Addon display name","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Addon identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"creator","description":"Addon-supported creator string","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Extension, addon, webapp","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Addon-supplied version string","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Addon-supplied description string","type":"text","hidden":false,"required":false,"index":false},{"name":"source_url","description":"URL that installed the addon","type":"text","hidden":false,"required":false,"index":false},{"name":"visible","description":"1 If the addon is shown in browser else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"active","description":"1 If the addon is active else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"disabled","description":"1 If the addon is application-disabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"autoupdate","description":"1 If the addon applies background updates else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"native","description":"1 If the addon includes binary components else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"location","description":"Global, profile location","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to plugin bundle","type":"text","hidden":false,"required":false,"index":false}]},{"name":"gatekeeper","description":"macOS Gatekeeper Details.","platforms":["darwin"],"columns":[{"name":"assessments_enabled","description":"1 If a Gatekeeper is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"dev_id_enabled","description":"1 If a Gatekeeper allows execution from identified developers else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"version","description":"Version of Gatekeeper's gke.bundle","type":"text","hidden":false,"required":false,"index":false},{"name":"opaque_version","description":"Version of Gatekeeper's gkopaque.bundle","type":"text","hidden":false,"required":false,"index":false}]},{"name":"gatekeeper_approved_apps","description":"Gatekeeper apps a user has allowed to run.","platforms":["darwin"],"columns":[{"name":"path","description":"Path of executable allowed to run","type":"text","hidden":false,"required":false,"index":false},{"name":"requirement","description":"Code signing requirement language","type":"text","hidden":false,"required":false,"index":false},{"name":"ctime","description":"Last change time","type":"double","hidden":false,"required":false,"index":false},{"name":"mtime","description":"Last modification time","type":"double","hidden":false,"required":false,"index":false}]},{"name":"groups","description":"Local system groups.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"gid","description":"Unsigned int64 group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid_signed","description":"A signed int64 version of gid","type":"bigint","hidden":false,"required":false,"index":false},{"name":"groupname","description":"Canonical local group name","type":"text","hidden":false,"required":false,"index":false},{"name":"group_sid","description":"Unique group ID","type":"text","hidden":true,"required":false,"index":false},{"name":"comment","description":"Remarks or comments associated with the group","type":"text","hidden":true,"required":false,"index":false},{"name":"is_hidden","description":"IsHidden attribute set in OpenDirectory","type":"integer","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"hardware_events","description":"Hardware (PCI/USB/HID) events from UDEV or IOKit.","platforms":["darwin","linux"],"columns":[{"name":"action","description":"Remove, insert, change properties, etc","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Local device path assigned (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of hardware and hardware event","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"Driver claiming the device","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor","description":"Hardware device vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor_id","description":"Hex encoded Hardware vendor identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"Hardware device model","type":"text","hidden":false,"required":false,"index":false},{"name":"model_id","description":"Hex encoded Hardware model identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"serial","description":"Device serial (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"revision","description":"Device revision (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of hardware event","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"hash","description":"Filesystem hash data.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"path","description":"Must provide a path or directory","type":"text","hidden":false,"required":true,"index":false},{"name":"directory","description":"Must provide a path or directory","type":"text","hidden":false,"required":true,"index":false},{"name":"md5","description":"MD5 hash of provided filesystem data","type":"text","hidden":false,"required":false,"index":false},{"name":"sha1","description":"SHA1 hash of provided filesystem data","type":"text","hidden":false,"required":false,"index":false},{"name":"sha256","description":"SHA256 hash of provided filesystem data","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"homebrew_packages","description":"The installed homebrew package database.","platforms":["darwin"],"columns":[{"name":"name","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Package install path","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Current 'linked' version","type":"text","hidden":false,"required":false,"index":false},{"name":"prefix","description":"Homebrew install prefix","type":"text","hidden":true,"required":false,"index":false}]},{"name":"hvci_status","description":"Retrieve HVCI info of the machine.","platforms":["windows"],"columns":[{"name":"version","description":"The version number of the Device Guard build.","type":"text","hidden":false,"required":false,"index":false},{"name":"instance_identifier","description":"The instance ID of Device Guard.","type":"text","hidden":false,"required":false,"index":false},{"name":"vbs_status","description":"The status of the virtualization based security settings. Returns UNKNOWN if an error is encountered.","type":"text","hidden":false,"required":false,"index":false},{"name":"code_integrity_policy_enforcement_status","description":"The status of the code integrity policy enforcement settings. Returns UNKNOWN if an error is encountered.","type":"text","hidden":false,"required":false,"index":false},{"name":"umci_policy_status","description":"The status of the User Mode Code Integrity security settings. Returns UNKNOWN if an error is encountered.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ibridge_info","description":"Information about the Apple iBridge hardware controller.","platforms":["darwin"],"columns":[{"name":"boot_uuid","description":"Boot UUID of the iBridge controller","type":"text","hidden":false,"required":false,"index":false},{"name":"coprocessor_version","description":"The manufacturer and chip version","type":"text","hidden":false,"required":false,"index":false},{"name":"firmware_version","description":"The build version of the firmware","type":"text","hidden":false,"required":false,"index":false},{"name":"unique_chip_id","description":"Unique id of the iBridge controller","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ie_extensions","description":"Internet Explorer browser extensions.","platforms":["windows"],"columns":[{"name":"name","description":"Extension display name","type":"text","hidden":false,"required":false,"index":false},{"name":"registry_path","description":"Extension identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Version of the executable","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to executable","type":"text","hidden":false,"required":false,"index":false}]},{"name":"intel_me_info","description":"Intel ME/CSE Info.","platforms":["linux","windows"],"columns":[{"name":"version","description":"Intel ME version","type":"text","hidden":false,"required":false,"index":false}]},{"name":"interface_addresses","description":"Network interfaces and relevant metadata.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"interface","description":"Interface name","type":"text","hidden":false,"required":false,"index":false},{"name":"address","description":"Specific address for interface","type":"text","hidden":false,"required":false,"index":false},{"name":"mask","description":"Interface netmask","type":"text","hidden":false,"required":false,"index":false},{"name":"broadcast","description":"Broadcast address for the interface","type":"text","hidden":false,"required":false,"index":false},{"name":"point_to_point","description":"PtP address for the interface","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of address. One of dhcp, manual, auto, other, unknown","type":"text","hidden":false,"required":false,"index":false},{"name":"friendly_name","description":"The friendly display name of the interface.","type":"text","hidden":true,"required":false,"index":false}]},{"name":"interface_details","description":"Detailed information and stats of network interfaces.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"interface","description":"Interface name","type":"text","hidden":false,"required":false,"index":false},{"name":"mac","description":"MAC of interface (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Interface type (includes virtual)","type":"integer","hidden":false,"required":false,"index":false},{"name":"mtu","description":"Network MTU","type":"integer","hidden":false,"required":false,"index":false},{"name":"metric","description":"Metric based on the speed of the interface","type":"integer","hidden":false,"required":false,"index":false},{"name":"flags","description":"Flags (netdevice) for the device","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipackets","description":"Input packets","type":"bigint","hidden":false,"required":false,"index":false},{"name":"opackets","description":"Output packets","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ibytes","description":"Input bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"obytes","description":"Output bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ierrors","description":"Input errors","type":"bigint","hidden":false,"required":false,"index":false},{"name":"oerrors","description":"Output errors","type":"bigint","hidden":false,"required":false,"index":false},{"name":"idrops","description":"Input drops","type":"bigint","hidden":false,"required":false,"index":false},{"name":"odrops","description":"Output drops","type":"bigint","hidden":false,"required":false,"index":false},{"name":"collisions","description":"Packet Collisions detected","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_change","description":"Time of last device modification (optional)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"link_speed","description":"Interface speed in Mb/s","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pci_slot","description":"PCI slot number","type":"text","hidden":true,"required":false,"index":false},{"name":"friendly_name","description":"The friendly display name of the interface.","type":"text","hidden":true,"required":false,"index":false},{"name":"description","description":"Short description of the object a one-line string.","type":"text","hidden":true,"required":false,"index":false},{"name":"manufacturer","description":"Name of the network adapter's manufacturer.","type":"text","hidden":true,"required":false,"index":false},{"name":"connection_id","description":"Name of the network connection as it appears in the Network Connections Control Panel program.","type":"text","hidden":true,"required":false,"index":false},{"name":"connection_status","description":"State of the network adapter connection to the network.","type":"text","hidden":true,"required":false,"index":false},{"name":"enabled","description":"Indicates whether the adapter is enabled or not.","type":"integer","hidden":true,"required":false,"index":false},{"name":"physical_adapter","description":"Indicates whether the adapter is a physical or a logical adapter.","type":"integer","hidden":true,"required":false,"index":false},{"name":"speed","description":"Estimate of the current bandwidth in bits per second.","type":"integer","hidden":true,"required":false,"index":false},{"name":"service","description":"The name of the service the network adapter uses.","type":"text","hidden":true,"required":false,"index":false},{"name":"dhcp_enabled","description":"If TRUE, the dynamic host configuration protocol (DHCP) server automatically assigns an IP address to the computer system when establishing a network connection.","type":"integer","hidden":true,"required":false,"index":false},{"name":"dhcp_lease_expires","description":"Expiration date and time for a leased IP address that was assigned to the computer by the dynamic host configuration protocol (DHCP) server.","type":"text","hidden":true,"required":false,"index":false},{"name":"dhcp_lease_obtained","description":"Date and time the lease was obtained for the IP address assigned to the computer by the dynamic host configuration protocol (DHCP) server.","type":"text","hidden":true,"required":false,"index":false},{"name":"dhcp_server","description":"IP address of the dynamic host configuration protocol (DHCP) server.","type":"text","hidden":true,"required":false,"index":false},{"name":"dns_domain","description":"Organization name followed by a period and an extension that indicates the type of organization, such as 'microsoft.com'.","type":"text","hidden":true,"required":false,"index":false},{"name":"dns_domain_suffix_search_order","description":"Array of DNS domain suffixes to be appended to the end of host names during name resolution.","type":"text","hidden":true,"required":false,"index":false},{"name":"dns_host_name","description":"Host name used to identify the local computer for authentication by some utilities.","type":"text","hidden":true,"required":false,"index":false},{"name":"dns_server_search_order","description":"Array of server IP addresses to be used in querying for DNS servers.","type":"text","hidden":true,"required":false,"index":false}]},{"name":"interface_ipv6","description":"IPv6 configuration and stats of network interfaces.","platforms":["darwin","linux"],"columns":[{"name":"interface","description":"Interface name","type":"text","hidden":false,"required":false,"index":false},{"name":"hop_limit","description":"Current Hop Limit","type":"integer","hidden":false,"required":false,"index":false},{"name":"forwarding_enabled","description":"Enable IP forwarding","type":"integer","hidden":false,"required":false,"index":false},{"name":"redirect_accept","description":"Accept ICMP redirect messages","type":"integer","hidden":false,"required":false,"index":false},{"name":"rtadv_accept","description":"Accept ICMP Router Advertisement","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"iokit_devicetree","description":"The IOKit registry matching the DeviceTree plane.","platforms":["darwin"],"columns":[{"name":"name","description":"Device node name","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"Best matching device class (most-specific category)","type":"text","hidden":false,"required":false,"index":false},{"name":"id","description":"IOKit internal registry ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent device registry ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"device_path","description":"Device tree path","type":"text","hidden":false,"required":false,"index":false},{"name":"service","description":"1 if the device conforms to IOService else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"busy_state","description":"1 if the device is in a busy state else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"retain_count","description":"The device reference count","type":"integer","hidden":false,"required":false,"index":false},{"name":"depth","description":"Device nested depth","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"iokit_registry","description":"The full IOKit registry without selecting a plane.","platforms":["darwin"],"columns":[{"name":"name","description":"Default name of the node","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"Best matching device class (most-specific category)","type":"text","hidden":false,"required":false,"index":false},{"name":"id","description":"IOKit internal registry ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Parent registry ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"busy_state","description":"1 if the node is in a busy state else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"retain_count","description":"The node reference count","type":"integer","hidden":false,"required":false,"index":false},{"name":"depth","description":"Node nested depth","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"iptables","description":"Linux IP packet filtering and NAT tool.","platforms":["linux"],"columns":[{"name":"filter_name","description":"Packet matching filter table name.","type":"text","hidden":false,"required":false,"index":false},{"name":"chain","description":"Size of module content.","type":"text","hidden":false,"required":false,"index":false},{"name":"policy","description":"Policy that applies for this rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"target","description":"Target that applies for this rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"protocol","description":"Protocol number identification.","type":"integer","hidden":false,"required":false,"index":false},{"name":"src_port","description":"Protocol source port(s).","type":"text","hidden":false,"required":false,"index":false},{"name":"dst_port","description":"Protocol destination port(s).","type":"text","hidden":false,"required":false,"index":false},{"name":"src_ip","description":"Source IP address.","type":"text","hidden":false,"required":false,"index":false},{"name":"src_mask","description":"Source IP address mask.","type":"text","hidden":false,"required":false,"index":false},{"name":"iniface","description":"Input interface for the rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"iniface_mask","description":"Input interface mask for the rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"dst_ip","description":"Destination IP address.","type":"text","hidden":false,"required":false,"index":false},{"name":"dst_mask","description":"Destination IP address mask.","type":"text","hidden":false,"required":false,"index":false},{"name":"outiface","description":"Output interface for the rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"outiface_mask","description":"Output interface mask for the rule.","type":"text","hidden":false,"required":false,"index":false},{"name":"match","description":"Matching rule that applies.","type":"text","hidden":false,"required":false,"index":false},{"name":"packets","description":"Number of matching packets for this rule.","type":"integer","hidden":false,"required":false,"index":false},{"name":"bytes","description":"Number of matching bytes for this rule.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"kernel_extensions","description":"macOS's kernel extensions, both loaded and within the load search path.","platforms":["darwin"],"columns":[{"name":"idx","description":"Extension load tag or index","type":"integer","hidden":false,"required":false,"index":false},{"name":"refs","description":"Reference count","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Bytes of wired memory used by extension","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Extension label","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Extension version","type":"text","hidden":false,"required":false,"index":false},{"name":"linked_against","description":"Indexes of extensions this extension is linked against","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Optional path to extension bundle","type":"text","hidden":false,"required":false,"index":false}]},{"name":"kernel_info","description":"Basic active kernel information.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"version","description":"Kernel version","type":"text","hidden":false,"required":false,"index":false},{"name":"arguments","description":"Kernel arguments","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Kernel path","type":"text","hidden":false,"required":false,"index":false},{"name":"device","description":"Kernel device identifier","type":"text","hidden":false,"required":false,"index":false}]},{"name":"kernel_modules","description":"Linux kernel modules both loaded and within the load search path.","platforms":["linux"],"columns":[{"name":"name","description":"Module name","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of module content","type":"bigint","hidden":false,"required":false,"index":false},{"name":"used_by","description":"Module reverse dependencies","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Kernel module status","type":"text","hidden":false,"required":false,"index":false},{"name":"address","description":"Kernel module address","type":"text","hidden":false,"required":false,"index":false}]},{"name":"kernel_panics","description":"System kernel panic logs.","platforms":["darwin"],"columns":[{"name":"path","description":"Location of log file","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Formatted time of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"registers","description":"A space delimited line of register:value pairs","type":"text","hidden":false,"required":false,"index":false},{"name":"frame_backtrace","description":"Backtrace of the crashed module","type":"text","hidden":false,"required":false,"index":false},{"name":"module_backtrace","description":"Modules appearing in the crashed module's backtrace","type":"text","hidden":false,"required":false,"index":false},{"name":"dependencies","description":"Module dependencies existing in crashed module's backtrace","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Process name corresponding to crashed thread","type":"text","hidden":false,"required":false,"index":false},{"name":"os_version","description":"Version of the operating system","type":"text","hidden":false,"required":false,"index":false},{"name":"kernel_version","description":"Version of the system kernel","type":"text","hidden":false,"required":false,"index":false},{"name":"system_model","description":"Physical system model, for example 'MacBookPro12,1 (Mac-E43C1C25D4880AD6)'","type":"text","hidden":false,"required":false,"index":false},{"name":"uptime","description":"System uptime at kernel panic in nanoseconds","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_loaded","description":"Last loaded module before panic","type":"text","hidden":false,"required":false,"index":false},{"name":"last_unloaded","description":"Last unloaded module before panic","type":"text","hidden":false,"required":false,"index":false}]},{"name":"keychain_acls","description":"Applications that have ACL entries in the keychain.","platforms":["darwin"],"columns":[{"name":"keychain_path","description":"The path of the keychain","type":"text","hidden":false,"required":false,"index":false},{"name":"authorizations","description":"A space delimited set of authorization attributes","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"The path of the authorized application","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"The description included with the ACL entry","type":"text","hidden":false,"required":false,"index":false},{"name":"label","description":"An optional label tag that may be included with the keychain entry","type":"text","hidden":false,"required":false,"index":false}]},{"name":"keychain_items","description":"Generic details about keychain items.","platforms":["darwin"],"columns":[{"name":"label","description":"Generic item name","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Optional item description","type":"text","hidden":false,"required":false,"index":false},{"name":"comment","description":"Optional keychain comment","type":"text","hidden":false,"required":false,"index":false},{"name":"account","description":"Optional item account","type":"text","hidden":false,"required":false,"index":false},{"name":"created","description":"Data item was created","type":"text","hidden":false,"required":false,"index":false},{"name":"modified","description":"Date of last modification","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Keychain item type (class)","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to keychain containing item","type":"text","hidden":false,"required":false,"index":false}]},{"name":"known_hosts","description":"A line-delimited known_hosts table.","platforms":["darwin","linux"],"columns":[{"name":"uid","description":"The local user that owns the known_hosts file","type":"bigint","hidden":false,"required":false,"index":false},{"name":"key","description":"parsed authorized keys line","type":"text","hidden":false,"required":false,"index":false},{"name":"key_file","description":"Path to known_hosts file","type":"text","hidden":false,"required":false,"index":false}]},{"name":"kva_speculative_info","description":"Display kernel virtual address and speculative execution information for the system.","platforms":["windows"],"columns":[{"name":"kva_shadow_enabled","description":"Kernel Virtual Address shadowing is enabled.","type":"integer","hidden":false,"required":false,"index":false},{"name":"kva_shadow_user_global","description":"User pages are marked as global.","type":"integer","hidden":false,"required":false,"index":false},{"name":"kva_shadow_pcid","description":"Kernel VA PCID flushing optimization is enabled.","type":"integer","hidden":false,"required":false,"index":false},{"name":"kva_shadow_inv_pcid","description":"Kernel VA INVPCID is enabled.","type":"integer","hidden":false,"required":false,"index":false},{"name":"bp_mitigations","description":"Branch Prediction mitigations are enabled.","type":"integer","hidden":false,"required":false,"index":false},{"name":"bp_system_pol_disabled","description":"Branch Predictions are disabled via system policy.","type":"integer","hidden":false,"required":false,"index":false},{"name":"bp_microcode_disabled","description":"Branch Predictions are disabled due to lack of microcode update.","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_spec_ctrl_supported","description":"SPEC_CTRL MSR supported by CPU Microcode.","type":"integer","hidden":false,"required":false,"index":false},{"name":"ibrs_support_enabled","description":"Windows uses IBRS.","type":"integer","hidden":false,"required":false,"index":false},{"name":"stibp_support_enabled","description":"Windows uses STIBP.","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_pred_cmd_supported","description":"PRED_CMD MSR supported by CPU Microcode.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"last","description":"System logins and logouts.","platforms":["darwin","linux"],"columns":[{"name":"username","description":"Entry username","type":"text","hidden":false,"required":false,"index":false},{"name":"tty","description":"Entry terminal","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Entry type, according to ut_type types (utmp.h)","type":"integer","hidden":false,"required":false,"index":false},{"name":"type_name","description":"Entry type name, according to ut_type types (utmp.h)","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Entry timestamp","type":"integer","hidden":false,"required":false,"index":false},{"name":"host","description":"Entry hostname","type":"text","hidden":false,"required":false,"index":false}]},{"name":"launchd","description":"LaunchAgents and LaunchDaemons from default search paths.","platforms":["darwin"],"columns":[{"name":"path","description":"Path to daemon or agent plist","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"File name of plist (used by launchd)","type":"text","hidden":false,"required":false,"index":false},{"name":"label","description":"Daemon or agent service name","type":"text","hidden":false,"required":false,"index":false},{"name":"program","description":"Path to target program","type":"text","hidden":false,"required":false,"index":false},{"name":"run_at_load","description":"Should the program run on launch load","type":"text","hidden":false,"required":false,"index":false},{"name":"keep_alive","description":"Should the process be restarted if killed","type":"text","hidden":false,"required":false,"index":false},{"name":"on_demand","description":"Deprecated key, replaced by keep_alive","type":"text","hidden":false,"required":false,"index":false},{"name":"disabled","description":"Skip loading this daemon or agent on boot","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"Run this daemon or agent as this username","type":"text","hidden":false,"required":false,"index":false},{"name":"groupname","description":"Run this daemon or agent as this group","type":"text","hidden":false,"required":false,"index":false},{"name":"stdout_path","description":"Pipe stdout to a target path","type":"text","hidden":false,"required":false,"index":false},{"name":"stderr_path","description":"Pipe stderr to a target path","type":"text","hidden":false,"required":false,"index":false},{"name":"start_interval","description":"Frequency to run in seconds","type":"text","hidden":false,"required":false,"index":false},{"name":"program_arguments","description":"Command line arguments passed to program","type":"text","hidden":false,"required":false,"index":false},{"name":"watch_paths","description":"Key that launches daemon or agent if path is modified","type":"text","hidden":false,"required":false,"index":false},{"name":"queue_directories","description":"Similar to watch_paths but only with non-empty directories","type":"text","hidden":false,"required":false,"index":false},{"name":"inetd_compatibility","description":"Run this daemon or agent as it was launched from inetd","type":"text","hidden":false,"required":false,"index":false},{"name":"start_on_mount","description":"Run daemon or agent every time a filesystem is mounted","type":"text","hidden":false,"required":false,"index":false},{"name":"root_directory","description":"Key used to specify a directory to chroot to before launch","type":"text","hidden":false,"required":false,"index":false},{"name":"working_directory","description":"Key used to specify a directory to chdir to before launch","type":"text","hidden":false,"required":false,"index":false},{"name":"process_type","description":"Key describes the intended purpose of the job","type":"text","hidden":false,"required":false,"index":false}]},{"name":"launchd_overrides","description":"Override keys, per user, for LaunchDaemons and Agents.","platforms":["darwin"],"columns":[{"name":"label","description":"Daemon or agent service name","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Name of the override key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Overridden value","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID applied to the override, 0 applies to all","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to daemon or agent plist","type":"text","hidden":false,"required":false,"index":false}]},{"name":"listening_ports","description":"Processes with listening (bound) network sockets/ports.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"port","description":"Transport layer port","type":"integer","hidden":false,"required":false,"index":false},{"name":"protocol","description":"Transport protocol (TCP/UDP)","type":"integer","hidden":false,"required":false,"index":false},{"name":"family","description":"Network protocol (IPv4, IPv6)","type":"integer","hidden":false,"required":false,"index":false},{"name":"address","description":"Specific address for bind","type":"text","hidden":false,"required":false,"index":false},{"name":"fd","description":"Socket file descriptor number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"socket","description":"Socket handle or inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path for UNIX domain sockets","type":"text","hidden":false,"required":false,"index":false},{"name":"net_namespace","description":"The inode number of the network namespace","type":"text","hidden":true,"required":false,"index":false}]},{"name":"load_average","description":"Displays information about the system wide load averages.","platforms":["darwin","linux"],"columns":[{"name":"period","description":"Period over which the average is calculated.","type":"text","hidden":false,"required":false,"index":false},{"name":"average","description":"Load average over the specified period.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"location_services","description":"Reports the status of the Location Services feature of the OS.","platforms":["darwin"],"columns":[{"name":"enabled","description":"1 if Location Services are enabled, else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"logged_in_users","description":"Users with an active shell on the system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"type","description":"Login type","type":"text","hidden":false,"required":false,"index":false},{"name":"user","description":"User login name","type":"text","hidden":false,"required":false,"index":false},{"name":"tty","description":"Device name","type":"text","hidden":false,"required":false,"index":false},{"name":"host","description":"Remote hostname","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time entry was made","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"sid","description":"The user's unique security identifier","type":"text","hidden":true,"required":false,"index":false},{"name":"registry_hive","description":"HKEY_USERS registry hive","type":"text","hidden":true,"required":false,"index":false}]},{"name":"logical_drives","description":"Details for logical drives on the system. A logical drive generally represents a single partition.","platforms":["windows"],"columns":[{"name":"device_id","description":"The drive id, usually the drive name, e.g., 'C:'.","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Deprecated (always 'Unknown').","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"The canonical description of the drive, e.g. 'Logical Fixed Disk', 'CD-ROM Disk'.","type":"text","hidden":false,"required":false,"index":false},{"name":"free_space","description":"The amount of free space, in bytes, of the drive (-1 on failure).","type":"bigint","hidden":false,"required":false,"index":false},{"name":"size","description":"The total amount of space, in bytes, of the drive (-1 on failure).","type":"bigint","hidden":false,"required":false,"index":false},{"name":"file_system","description":"The file system of the drive.","type":"text","hidden":false,"required":false,"index":false},{"name":"boot_partition","description":"True if Windows booted from this drive.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"logon_sessions","description":"Windows Logon Session.","platforms":["windows"],"columns":[{"name":"logon_id","description":"A locally unique identifier (LUID) that identifies a logon session.","type":"integer","hidden":false,"required":false,"index":false},{"name":"user","description":"The account name of the security principal that owns the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"logon_domain","description":"The name of the domain used to authenticate the owner of the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"authentication_package","description":"The authentication package used to authenticate the owner of the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"logon_type","description":"The logon method.","type":"text","hidden":false,"required":false,"index":false},{"name":"session_id","description":"The Terminal Services session identifier.","type":"integer","hidden":false,"required":false,"index":false},{"name":"logon_sid","description":"The user's security identifier (SID).","type":"text","hidden":false,"required":false,"index":false},{"name":"logon_time","description":"The time the session owner logged on.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"logon_server","description":"The name of the server used to authenticate the owner of the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"dns_domain_name","description":"The DNS name for the owner of the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"upn","description":"The user principal name (UPN) for the owner of the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"logon_script","description":"The script used for logging on.","type":"text","hidden":false,"required":false,"index":false},{"name":"profile_path","description":"The home directory for the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"home_directory","description":"The home directory for the logon session.","type":"text","hidden":false,"required":false,"index":false},{"name":"home_directory_drive","description":"The drive location of the home directory of the logon session.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_certificates","description":"LXD certificates information.","platforms":["linux"],"columns":[{"name":"name","description":"Name of the certificate","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of the certificate","type":"text","hidden":false,"required":false,"index":false},{"name":"fingerprint","description":"SHA256 hash of the certificate","type":"text","hidden":false,"required":false,"index":false},{"name":"certificate","description":"Certificate content","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_cluster","description":"LXD cluster information.","platforms":["linux"],"columns":[{"name":"server_name","description":"Name of the LXD server node","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"Whether clustering enabled (1) or not (0) on this node","type":"integer","hidden":false,"required":false,"index":false},{"name":"member_config_entity","description":"Type of configuration parameter for this node","type":"text","hidden":false,"required":false,"index":false},{"name":"member_config_name","description":"Name of configuration parameter","type":"text","hidden":false,"required":false,"index":false},{"name":"member_config_key","description":"Config key","type":"text","hidden":false,"required":false,"index":false},{"name":"member_config_value","description":"Config value","type":"text","hidden":false,"required":false,"index":false},{"name":"member_config_description","description":"Config description","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_cluster_members","description":"LXD cluster members information.","platforms":["linux"],"columns":[{"name":"server_name","description":"Name of the LXD server node","type":"text","hidden":false,"required":false,"index":false},{"name":"url","description":"URL of the node","type":"text","hidden":false,"required":false,"index":false},{"name":"database","description":"Whether the server is a database node (1) or not (0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"status","description":"Status of the node (Online/Offline)","type":"text","hidden":false,"required":false,"index":false},{"name":"message","description":"Message from the node (Online/Offline)","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_images","description":"LXD images information.","platforms":["linux"],"columns":[{"name":"id","description":"Image ID","type":"text","hidden":false,"required":false,"index":false},{"name":"architecture","description":"Target architecture for the image","type":"text","hidden":false,"required":false,"index":false},{"name":"os","description":"OS on which image is based","type":"text","hidden":false,"required":false,"index":false},{"name":"release","description":"OS release version on which the image is based","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Image description","type":"text","hidden":false,"required":false,"index":false},{"name":"aliases","description":"Comma-separated list of image aliases","type":"text","hidden":false,"required":false,"index":false},{"name":"filename","description":"Filename of the image file","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of image in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"auto_update","description":"Whether the image auto-updates (1) or not (0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"cached","description":"Whether image is cached (1) or not (0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"public","description":"Whether image is public (1) or not (0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"created_at","description":"ISO time of image creation","type":"text","hidden":false,"required":false,"index":false},{"name":"expires_at","description":"ISO time of image expiration","type":"text","hidden":false,"required":false,"index":false},{"name":"uploaded_at","description":"ISO time of image upload","type":"text","hidden":false,"required":false,"index":false},{"name":"last_used_at","description":"ISO time for the most recent use of this image in terms of container spawn","type":"text","hidden":false,"required":false,"index":false},{"name":"update_source_server","description":"Server for image update","type":"text","hidden":false,"required":false,"index":false},{"name":"update_source_protocol","description":"Protocol used for image information update and image import from source server","type":"text","hidden":false,"required":false,"index":false},{"name":"update_source_certificate","description":"Certificate for update source server","type":"text","hidden":false,"required":false,"index":false},{"name":"update_source_alias","description":"Alias of image at update source server","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_instance_config","description":"LXD instance configuration information.","platforms":["linux"],"columns":[{"name":"name","description":"Instance name","type":"text","hidden":false,"required":true,"index":false},{"name":"key","description":"Configuration parameter name","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Configuration parameter value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_instance_devices","description":"LXD instance devices information.","platforms":["linux"],"columns":[{"name":"name","description":"Instance name","type":"text","hidden":false,"required":true,"index":false},{"name":"device","description":"Name of the device","type":"text","hidden":false,"required":false,"index":false},{"name":"device_type","description":"Device type","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Device info param name","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Device info param value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"lxd_instances","description":"LXD instances information.","platforms":["linux"],"columns":[{"name":"name","description":"Instance name","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Instance state (running, stopped, etc.)","type":"text","hidden":false,"required":false,"index":false},{"name":"stateful","description":"Whether the instance is stateful(1) or not(0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"ephemeral","description":"Whether the instance is ephemeral(1) or not(0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"created_at","description":"ISO time of creation","type":"text","hidden":false,"required":false,"index":false},{"name":"base_image","description":"ID of image used to launch this instance","type":"text","hidden":false,"required":false,"index":false},{"name":"architecture","description":"Instance architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"os","description":"The OS of this instance","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Instance description","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Instance's process ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"processes","description":"Number of processes running inside this instance","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"lxd_networks","description":"LXD network information.","platforms":["linux"],"columns":[{"name":"name","description":"Name of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of network","type":"text","hidden":false,"required":false,"index":false},{"name":"managed","description":"1 if network created by LXD, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"ipv4_address","description":"IPv4 address","type":"text","hidden":false,"required":false,"index":false},{"name":"ipv6_address","description":"IPv6 address","type":"text","hidden":false,"required":false,"index":false},{"name":"used_by","description":"URLs for containers using this network","type":"text","hidden":false,"required":false,"index":false},{"name":"bytes_received","description":"Number of bytes received on this network","type":"bigint","hidden":false,"required":false,"index":false},{"name":"bytes_sent","description":"Number of bytes sent on this network","type":"bigint","hidden":false,"required":false,"index":false},{"name":"packets_received","description":"Number of packets received on this network","type":"bigint","hidden":false,"required":false,"index":false},{"name":"packets_sent","description":"Number of packets sent on this network","type":"bigint","hidden":false,"required":false,"index":false},{"name":"hwaddr","description":"Hardware address for this network","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Network status","type":"text","hidden":false,"required":false,"index":false},{"name":"mtu","description":"MTU size","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"lxd_storage_pools","description":"LXD storage pool information.","platforms":["linux"],"columns":[{"name":"name","description":"Name of the storage pool","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"Storage driver","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Storage pool source","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of the storage pool","type":"text","hidden":false,"required":false,"index":false},{"name":"space_used","description":"Storage space used in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"space_total","description":"Total available storage space in bytes for this storage pool","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inodes_used","description":"Number of inodes used","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inodes_total","description":"Total number of inodes available in this storage pool","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"magic","description":"Magic number recognition library table.","platforms":["darwin","linux"],"columns":[{"name":"path","description":"Absolute path to target file","type":"text","hidden":false,"required":true,"index":false},{"name":"magic_db_files","description":"Colon(:) separated list of files where the magic db file can be found. By default one of the following is used: /usr/share/file/magic/magic, /usr/share/misc/magic or /usr/share/misc/magic.mgc","type":"text","hidden":false,"required":false,"index":false},{"name":"data","description":"Magic number data from libmagic","type":"text","hidden":false,"required":false,"index":false},{"name":"mime_type","description":"MIME type data from libmagic","type":"text","hidden":false,"required":false,"index":false},{"name":"mime_encoding","description":"MIME encoding data from libmagic","type":"text","hidden":false,"required":false,"index":false}]},{"name":"managed_policies","description":"The managed configuration policies from AD, MDM, MCX, etc.","platforms":["darwin"],"columns":[{"name":"domain","description":"System or manager-chosen domain key","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"Optional UUID assigned to policy set","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Policy key name","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Policy value","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"Policy applies only this user","type":"text","hidden":false,"required":false,"index":false},{"name":"manual","description":"1 if policy was loaded manually, otherwise 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"md_devices","description":"Software RAID array settings.","platforms":["linux"],"columns":[{"name":"device_name","description":"md device name","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Current state of the array","type":"text","hidden":false,"required":false,"index":false},{"name":"raid_level","description":"Current raid level of the array","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"size of the array in blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"chunk_size","description":"chunk size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"raid_disks","description":"Number of configured RAID disks in array","type":"integer","hidden":false,"required":false,"index":false},{"name":"nr_raid_disks","description":"Number of partitions or disk devices to comprise the array","type":"integer","hidden":false,"required":false,"index":false},{"name":"working_disks","description":"Number of working disks in array","type":"integer","hidden":false,"required":false,"index":false},{"name":"active_disks","description":"Number of active disks in array","type":"integer","hidden":false,"required":false,"index":false},{"name":"failed_disks","description":"Number of failed disks in array","type":"integer","hidden":false,"required":false,"index":false},{"name":"spare_disks","description":"Number of idle disks in array","type":"integer","hidden":false,"required":false,"index":false},{"name":"superblock_state","description":"State of the superblock","type":"text","hidden":false,"required":false,"index":false},{"name":"superblock_version","description":"Version of the superblock","type":"text","hidden":false,"required":false,"index":false},{"name":"superblock_update_time","description":"Unix timestamp of last update","type":"bigint","hidden":false,"required":false,"index":false},{"name":"bitmap_on_mem","description":"Pages allocated in in-memory bitmap, if enabled","type":"text","hidden":false,"required":false,"index":false},{"name":"bitmap_chunk_size","description":"Bitmap chunk size","type":"text","hidden":false,"required":false,"index":false},{"name":"bitmap_external_file","description":"External referenced bitmap file","type":"text","hidden":false,"required":false,"index":false},{"name":"recovery_progress","description":"Progress of the recovery activity","type":"text","hidden":false,"required":false,"index":false},{"name":"recovery_finish","description":"Estimated duration of recovery activity","type":"text","hidden":false,"required":false,"index":false},{"name":"recovery_speed","description":"Speed of recovery activity","type":"text","hidden":false,"required":false,"index":false},{"name":"resync_progress","description":"Progress of the resync activity","type":"text","hidden":false,"required":false,"index":false},{"name":"resync_finish","description":"Estimated duration of resync activity","type":"text","hidden":false,"required":false,"index":false},{"name":"resync_speed","description":"Speed of resync activity","type":"text","hidden":false,"required":false,"index":false},{"name":"reshape_progress","description":"Progress of the reshape activity","type":"text","hidden":false,"required":false,"index":false},{"name":"reshape_finish","description":"Estimated duration of reshape activity","type":"text","hidden":false,"required":false,"index":false},{"name":"reshape_speed","description":"Speed of reshape activity","type":"text","hidden":false,"required":false,"index":false},{"name":"check_array_progress","description":"Progress of the check array activity","type":"text","hidden":false,"required":false,"index":false},{"name":"check_array_finish","description":"Estimated duration of the check array activity","type":"text","hidden":false,"required":false,"index":false},{"name":"check_array_speed","description":"Speed of the check array activity","type":"text","hidden":false,"required":false,"index":false},{"name":"unused_devices","description":"Unused devices","type":"text","hidden":false,"required":false,"index":false},{"name":"other","description":"Other information associated with array from /proc/mdstat","type":"text","hidden":false,"required":false,"index":false}]},{"name":"md_drives","description":"Drive devices used for Software RAID.","platforms":["linux"],"columns":[{"name":"md_device_name","description":"md device name","type":"text","hidden":false,"required":false,"index":false},{"name":"drive_name","description":"Drive device name","type":"text","hidden":false,"required":false,"index":false},{"name":"slot","description":"Slot position of disk","type":"integer","hidden":false,"required":false,"index":false},{"name":"state","description":"State of the drive","type":"text","hidden":false,"required":false,"index":false}]},{"name":"md_personalities","description":"Software RAID setting supported by the kernel.","platforms":["linux"],"columns":[{"name":"name","description":"Name of personality supported by kernel","type":"text","hidden":false,"required":false,"index":false}]},{"name":"mdfind","description":"Run searches against the spotlight database.","platforms":["darwin"],"columns":[{"name":"path","description":"Path of the file returned from spotlight","type":"text","hidden":false,"required":false,"index":false},{"name":"query","description":"The query that was run to find the file","type":"text","hidden":false,"required":true,"index":false}]},{"name":"mdls","description":"Query file metadata in the Spotlight database.","platforms":["darwin"],"columns":[{"name":"path","description":"Path of the file","type":"text","hidden":false,"required":true,"index":false},{"name":"key","description":"Name of the metadata key","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Value stored in the metadata key","type":"text","hidden":false,"required":false,"index":false},{"name":"valuetype","description":"CoreFoundation type of data stored in value","type":"text","hidden":true,"required":false,"index":false}]},{"name":"memory_array_mapped_addresses","description":"Data associated for address mapping of physical memory arrays.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the structure","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_array_handle","description":"Handle of the memory array associated with this structure","type":"text","hidden":false,"required":false,"index":false},{"name":"starting_address","description":"Physical stating address, in kilobytes, of a range of memory mapped to physical memory array","type":"text","hidden":false,"required":false,"index":false},{"name":"ending_address","description":"Physical ending address of last kilobyte of a range of memory mapped to physical memory array","type":"text","hidden":false,"required":false,"index":false},{"name":"partition_width","description":"Number of memory devices that form a single row of memory for the address partition of this structure","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"memory_arrays","description":"Data associated with collection of memory devices that operate to form a memory address.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the array","type":"text","hidden":false,"required":false,"index":false},{"name":"location","description":"Physical location of the memory array","type":"text","hidden":false,"required":false,"index":false},{"name":"use","description":"Function for which the array is used","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_error_correction","description":"Primary hardware error correction or detection method supported","type":"text","hidden":false,"required":false,"index":false},{"name":"max_capacity","description":"Maximum capacity of array in gigabytes","type":"integer","hidden":false,"required":false,"index":false},{"name":"memory_error_info_handle","description":"Handle, or instance number, associated with any error that was detected for the array","type":"text","hidden":false,"required":false,"index":false},{"name":"number_memory_devices","description":"Number of memory devices on array","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"memory_device_mapped_addresses","description":"Data associated for address mapping of physical memory devices.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the structure","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_device_handle","description":"Handle of the memory device structure associated with this structure","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_array_mapped_address_handle","description":"Handle of the memory array mapped address to which this device range is mapped to","type":"text","hidden":false,"required":false,"index":false},{"name":"starting_address","description":"Physical stating address, in kilobytes, of a range of memory mapped to physical memory array","type":"text","hidden":false,"required":false,"index":false},{"name":"ending_address","description":"Physical ending address of last kilobyte of a range of memory mapped to physical memory array","type":"text","hidden":false,"required":false,"index":false},{"name":"partition_row_position","description":"Identifies the position of the referenced memory device in a row of the address partition","type":"integer","hidden":false,"required":false,"index":false},{"name":"interleave_position","description":"The position of the device in a interleave, i.e. 0 indicates non-interleave, 1 indicates 1st interleave, 2 indicates 2nd interleave, etc.","type":"integer","hidden":false,"required":false,"index":false},{"name":"interleave_data_depth","description":"The max number of consecutive rows from memory device that are accessed in a single interleave transfer; 0 indicates device is non-interleave","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"memory_devices","description":"Physical memory device (type 17) information retrieved from SMBIOS.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the structure in SMBIOS","type":"text","hidden":false,"required":false,"index":false},{"name":"array_handle","description":"The memory array that the device is attached to","type":"text","hidden":false,"required":false,"index":false},{"name":"form_factor","description":"Implementation form factor for this memory device","type":"text","hidden":false,"required":false,"index":false},{"name":"total_width","description":"Total width, in bits, of this memory device, including any check or error-correction bits","type":"integer","hidden":false,"required":false,"index":false},{"name":"data_width","description":"Data width, in bits, of this memory device","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Size of memory device in Megabyte","type":"integer","hidden":false,"required":false,"index":false},{"name":"set","description":"Identifies if memory device is one of a set of devices. A value of 0 indicates no set affiliation.","type":"integer","hidden":false,"required":false,"index":false},{"name":"device_locator","description":"String number of the string that identifies the physically-labeled socket or board position where the memory device is located","type":"text","hidden":false,"required":false,"index":false},{"name":"bank_locator","description":"String number of the string that identifies the physically-labeled bank where the memory device is located","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_type","description":"Type of memory used","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_type_details","description":"Additional details for memory device","type":"text","hidden":false,"required":false,"index":false},{"name":"max_speed","description":"Max speed of memory device in megatransfers per second (MT/s)","type":"integer","hidden":false,"required":false,"index":false},{"name":"configured_clock_speed","description":"Configured speed of memory device in megatransfers per second (MT/s)","type":"integer","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"Manufacturer ID string","type":"text","hidden":false,"required":false,"index":false},{"name":"serial_number","description":"Serial number of memory device","type":"text","hidden":false,"required":false,"index":false},{"name":"asset_tag","description":"Manufacturer specific asset tag of memory device","type":"text","hidden":false,"required":false,"index":false},{"name":"part_number","description":"Manufacturer specific serial number of memory device","type":"text","hidden":false,"required":false,"index":false},{"name":"min_voltage","description":"Minimum operating voltage of device in millivolts","type":"integer","hidden":false,"required":false,"index":false},{"name":"max_voltage","description":"Maximum operating voltage of device in millivolts","type":"integer","hidden":false,"required":false,"index":false},{"name":"configured_voltage","description":"Configured operating voltage of device in millivolts","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"memory_error_info","description":"Data associated with errors of a physical memory array.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the structure","type":"text","hidden":false,"required":false,"index":false},{"name":"error_type","description":"type of error associated with current error status for array or device","type":"text","hidden":false,"required":false,"index":false},{"name":"error_granularity","description":"Granularity to which the error can be resolved","type":"text","hidden":false,"required":false,"index":false},{"name":"error_operation","description":"Memory access operation that caused the error","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor_syndrome","description":"Vendor specific ECC syndrome or CRC data associated with the erroneous access","type":"text","hidden":false,"required":false,"index":false},{"name":"memory_array_error_address","description":"32 bit physical address of the error based on the addressing of the bus to which the memory array is connected","type":"text","hidden":false,"required":false,"index":false},{"name":"device_error_address","description":"32 bit physical address of the error relative to the start of the failing memory address, in bytes","type":"text","hidden":false,"required":false,"index":false},{"name":"error_resolution","description":"Range, in bytes, within which this error can be determined, when an error address is given","type":"text","hidden":false,"required":false,"index":false}]},{"name":"memory_info","description":"Main memory information in bytes.","platforms":["linux"],"columns":[{"name":"memory_total","description":"Total amount of physical RAM, in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"memory_free","description":"The amount of physical RAM, in bytes, left unused by the system","type":"bigint","hidden":false,"required":false,"index":false},{"name":"memory_available","description":"The amount of physical RAM, in bytes, available for starting new applications, without swapping","type":"bigint","hidden":false,"required":false,"index":false},{"name":"buffers","description":"The amount of physical RAM, in bytes, used for file buffers","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cached","description":"The amount of physical RAM, in bytes, used as cache memory","type":"bigint","hidden":false,"required":false,"index":false},{"name":"swap_cached","description":"The amount of swap, in bytes, used as cache memory","type":"bigint","hidden":false,"required":false,"index":false},{"name":"active","description":"The total amount of buffer or page cache memory, in bytes, that is in active use","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inactive","description":"The total amount of buffer or page cache memory, in bytes, that are free and available","type":"bigint","hidden":false,"required":false,"index":false},{"name":"swap_total","description":"The total amount of swap available, in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"swap_free","description":"The total amount of swap free, in bytes","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"memory_map","description":"OS memory region map.","platforms":["linux"],"columns":[{"name":"name","description":"Region name","type":"text","hidden":false,"required":false,"index":false},{"name":"start","description":"Start address of memory region","type":"text","hidden":false,"required":false,"index":false},{"name":"end","description":"End address of memory region","type":"text","hidden":false,"required":false,"index":false}]},{"name":"mounts","description":"System mounted devices and filesystems (not process specific).","platforms":["darwin","linux"],"columns":[{"name":"device","description":"Mounted device","type":"text","hidden":false,"required":false,"index":false},{"name":"device_alias","description":"Mounted device alias","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Mounted device path","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Mounted device type","type":"text","hidden":false,"required":false,"index":false},{"name":"blocks_size","description":"Block size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"blocks","description":"Mounted device used blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"blocks_free","description":"Mounted device free blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"blocks_available","description":"Mounted device available blocks","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inodes","description":"Mounted device used inodes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inodes_free","description":"Mounted device free inodes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"flags","description":"Mounted device flags","type":"text","hidden":false,"required":false,"index":false}]},{"name":"msr","description":"Various pieces of data stored in the model specific register per processor. NOTE: the msr kernel module must be enabled, and osquery must be run as root.","platforms":["linux"],"columns":[{"name":"processor_number","description":"The processor number as reported in /proc/cpuinfo","type":"bigint","hidden":false,"required":false,"index":false},{"name":"turbo_disabled","description":"Whether the turbo feature is disabled.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"turbo_ratio_limit","description":"The turbo feature ratio limit.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"platform_info","description":"Platform information.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"perf_ctl","description":"Performance setting for the processor.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"perf_status","description":"Performance status for the processor.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"feature_control","description":"Bitfield controlling enabled features.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"rapl_power_limit","description":"Run Time Average Power Limiting power limit.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"rapl_energy_status","description":"Run Time Average Power Limiting energy status.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"rapl_power_units","description":"Run Time Average Power Limiting power units.","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"nfs_shares","description":"NFS shares exported by the host.","platforms":["darwin"],"columns":[{"name":"share","description":"Filesystem path to the share","type":"text","hidden":false,"required":false,"index":false},{"name":"options","description":"Options string set on the export share","type":"text","hidden":false,"required":false,"index":false},{"name":"readonly","description":"1 if the share is exported readonly else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"npm_packages","description":"Node packages installed in a system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Package display name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package-supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Package-supplied description","type":"text","hidden":false,"required":false,"index":false},{"name":"author","description":"Package-supplied author","type":"text","hidden":false,"required":false,"index":false},{"name":"license","description":"License under which package is launched","type":"text","hidden":false,"required":false,"index":false},{"name":"homepage","description":"Package supplied homepage","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path at which this module resides","type":"text","hidden":false,"required":false,"index":false},{"name":"directory","description":"Directory where node_modules are located","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"ntdomains","description":"Display basic NT domain information of a Windows machine.","platforms":["windows"],"columns":[{"name":"name","description":"The label by which the object is known.","type":"text","hidden":false,"required":false,"index":false},{"name":"client_site_name","description":"The name of the site where the domain controller is configured.","type":"text","hidden":false,"required":false,"index":false},{"name":"dc_site_name","description":"The name of the site where the domain controller is located.","type":"text","hidden":false,"required":false,"index":false},{"name":"dns_forest_name","description":"The name of the root of the DNS tree.","type":"text","hidden":false,"required":false,"index":false},{"name":"domain_controller_address","description":"The IP Address of the discovered domain controller..","type":"text","hidden":false,"required":false,"index":false},{"name":"domain_controller_name","description":"The name of the discovered domain controller.","type":"text","hidden":false,"required":false,"index":false},{"name":"domain_name","description":"The name of the domain.","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"The current status of the domain object.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ntfs_acl_permissions","description":"Retrieve NTFS ACL permission information for files and directories.","platforms":["windows"],"columns":[{"name":"path","description":"Path to the file or directory.","type":"text","hidden":false,"required":true,"index":false},{"name":"type","description":"Type of access mode for the access control entry.","type":"text","hidden":false,"required":false,"index":false},{"name":"principal","description":"User or group to which the ACE applies.","type":"text","hidden":false,"required":false,"index":false},{"name":"access","description":"Specific permissions that indicate the rights described by the ACE.","type":"text","hidden":false,"required":false,"index":false},{"name":"inherited_from","description":"The inheritance policy of the ACE.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ntfs_journal_events","description":"Track time/action changes to files specified in configuration data.","platforms":["windows"],"columns":[{"name":"action","description":"Change action (Write, Delete, etc)","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"The category that the event originated from","type":"text","hidden":false,"required":false,"index":false},{"name":"old_path","description":"Old path (renames only)","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path","type":"text","hidden":false,"required":false,"index":false},{"name":"record_timestamp","description":"Journal record timestamp","type":"text","hidden":false,"required":false,"index":false},{"name":"record_usn","description":"The update sequence number that identifies the journal record","type":"text","hidden":false,"required":false,"index":false},{"name":"node_ref_number","description":"The ordinal that associates a journal record with a filename","type":"text","hidden":false,"required":false,"index":false},{"name":"parent_ref_number","description":"The ordinal that associates a journal record with a filename's parent directory","type":"text","hidden":false,"required":false,"index":false},{"name":"drive_letter","description":"The drive letter identifying the source journal","type":"text","hidden":false,"required":false,"index":false},{"name":"file_attributes","description":"File attributes","type":"text","hidden":false,"required":false,"index":false},{"name":"partial","description":"Set to 1 if either path or old_path only contains the file or folder name","type":"bigint","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of file event","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"nvram","description":"Apple NVRAM variable listing.","platforms":["darwin"],"columns":[{"name":"name","description":"Variable name","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Data type (CFData, CFString, etc)","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Raw variable data","type":"text","hidden":false,"required":false,"index":false}]},{"name":"oem_strings","description":"OEM defined strings retrieved from SMBIOS.","platforms":["darwin","linux"],"columns":[{"name":"handle","description":"Handle, or instance number, associated with the Type 11 structure","type":"text","hidden":false,"required":false,"index":false},{"name":"number","description":"The string index of the structure","type":"integer","hidden":false,"required":false,"index":false},{"name":"value","description":"The value of the OEM string","type":"text","hidden":false,"required":false,"index":false}]},{"name":"office_mru","description":"View recently opened Office documents.","platforms":["windows"],"columns":[{"name":"application","description":"Associated Office application","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Office application version number","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"File path","type":"text","hidden":false,"required":false,"index":false},{"name":"last_opened_time","description":"Most recent opened time file was opened","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sid","description":"User SID","type":"text","hidden":false,"required":false,"index":false}]},{"name":"os_version","description":"A single row containing the operating system name and version.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Distribution or product name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Pretty, suitable for presentation, OS version","type":"text","hidden":false,"required":false,"index":false},{"name":"major","description":"Major release version","type":"integer","hidden":false,"required":false,"index":false},{"name":"minor","description":"Minor release version","type":"integer","hidden":false,"required":false,"index":false},{"name":"patch","description":"Optional patch release","type":"integer","hidden":false,"required":false,"index":false},{"name":"build","description":"Optional build-specific or variant string","type":"text","hidden":false,"required":false,"index":false},{"name":"platform","description":"OS Platform or ID","type":"text","hidden":false,"required":false,"index":false},{"name":"platform_like","description":"Closely related platforms","type":"text","hidden":false,"required":false,"index":false},{"name":"codename","description":"OS version codename","type":"text","hidden":false,"required":false,"index":false},{"name":"arch","description":"OS Architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"install_date","description":"The install date of the OS.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"osquery_events","description":"Information about the event publishers and subscribers.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"name","description":"Event publisher or subscriber name","type":"text","hidden":false,"required":false,"index":false},{"name":"publisher","description":"Name of the associated publisher","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Either publisher or subscriber","type":"text","hidden":false,"required":false,"index":false},{"name":"subscriptions","description":"Number of subscriptions the publisher received or subscriber used","type":"integer","hidden":false,"required":false,"index":false},{"name":"events","description":"Number of events emitted or received since osquery started","type":"integer","hidden":false,"required":false,"index":false},{"name":"refreshes","description":"Publisher only: number of runloop restarts","type":"integer","hidden":false,"required":false,"index":false},{"name":"active","description":"1 if the publisher or subscriber is active else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"osquery_extensions","description":"List of active osquery extensions.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"uuid","description":"The transient ID assigned for communication","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Extension's name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Extension's version","type":"text","hidden":false,"required":false,"index":false},{"name":"sdk_version","description":"osquery SDK version used to build the extension","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of the extension's Thrift connection or library path","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"SDK extension type: core, extension, or module","type":"text","hidden":false,"required":false,"index":false}]},{"name":"osquery_flags","description":"Configurable flags that modify osquery's behavior.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"name","description":"Flag name","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Flag type","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Flag description","type":"text","hidden":false,"required":false,"index":false},{"name":"default_value","description":"Flag default value","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Flag value","type":"text","hidden":false,"required":false,"index":false},{"name":"shell_only","description":"Is the flag shell only?","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"osquery_info","description":"Top level information about the running version of osquery.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"pid","description":"Process (or thread/handle) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"uuid","description":"Unique ID provided by the system","type":"text","hidden":false,"required":false,"index":false},{"name":"instance_id","description":"Unique, long-lived ID per instance of osquery","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"osquery toolkit version","type":"text","hidden":false,"required":false,"index":false},{"name":"config_hash","description":"Hash of the working configuration state","type":"text","hidden":false,"required":false,"index":false},{"name":"config_valid","description":"1 if the config was loaded and considered valid, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"extensions","description":"osquery extensions status","type":"text","hidden":false,"required":false,"index":false},{"name":"build_platform","description":"osquery toolkit build platform","type":"text","hidden":false,"required":false,"index":false},{"name":"build_distro","description":"osquery toolkit platform distribution name (os version)","type":"text","hidden":false,"required":false,"index":false},{"name":"start_time","description":"UNIX time in seconds when the process started","type":"integer","hidden":false,"required":false,"index":false},{"name":"watcher","description":"Process (or thread/handle) ID of optional watcher process","type":"integer","hidden":false,"required":false,"index":false},{"name":"platform_mask","description":"The osquery platform bitmask","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"osquery_packs","description":"Information about the current query packs that are loaded in osquery.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"name","description":"The given name for this query pack","type":"text","hidden":false,"required":false,"index":false},{"name":"platform","description":"Platforms this query is supported on","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Minimum osquery version that this query will run on","type":"text","hidden":false,"required":false,"index":false},{"name":"shard","description":"Shard restriction limit, 1-100, 0 meaning no restriction","type":"integer","hidden":false,"required":false,"index":false},{"name":"discovery_cache_hits","description":"The number of times that the discovery query used cached values since the last time the config was reloaded","type":"integer","hidden":false,"required":false,"index":false},{"name":"discovery_executions","description":"The number of times that the discovery queries have been executed since the last time the config was reloaded","type":"integer","hidden":false,"required":false,"index":false},{"name":"active","description":"Whether this pack is active (the version, platform and discovery queries match) yes=1, no=0.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"osquery_registry","description":"List the osquery registry plugins.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"registry","description":"Name of the osquery registry","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the plugin item","type":"text","hidden":false,"required":false,"index":false},{"name":"owner_uuid","description":"Extension route UUID (0 for core)","type":"integer","hidden":false,"required":false,"index":false},{"name":"internal","description":"1 If the plugin is internal else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"active","description":"1 If this plugin is active else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"osquery_schedule","description":"Information about the current queries that are scheduled in osquery.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"name","description":"The given name for this query","type":"text","hidden":false,"required":false,"index":false},{"name":"query","description":"The exact query to run","type":"text","hidden":false,"required":false,"index":false},{"name":"interval","description":"The interval in seconds to run this query, not an exact interval","type":"integer","hidden":false,"required":false,"index":false},{"name":"executions","description":"Number of times the query was executed","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_executed","description":"UNIX time stamp in seconds of the last completed execution","type":"bigint","hidden":false,"required":false,"index":false},{"name":"denylisted","description":"1 if the query is denylisted else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"output_size","description":"Cumulative total number of bytes generated by the resultant rows of the query","type":"bigint","hidden":false,"required":false,"index":false},{"name":"wall_time","description":"Total wall time in seconds spent executing (deprecated), hidden=True","type":"bigint","hidden":false,"required":false,"index":false},{"name":"wall_time_ms","description":"Total wall time in milliseconds spent executing","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_wall_time_ms","description":"Wall time in milliseconds of the latest execution","type":"bigint","hidden":false,"required":false,"index":false},{"name":"user_time","description":"Total user time in milliseconds spent executing","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_user_time","description":"User time in milliseconds of the latest execution","type":"bigint","hidden":false,"required":false,"index":false},{"name":"system_time","description":"Total system time in milliseconds spent executing","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_system_time","description":"System time in milliseconds of the latest execution","type":"bigint","hidden":false,"required":false,"index":false},{"name":"average_memory","description":"Average of the bytes of resident memory left allocated after collecting results","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_memory","description":"Resident memory in bytes left allocated after collecting results of the latest execution","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"package_bom","description":"macOS package bill of materials (BOM) file list.","platforms":["darwin"],"columns":[{"name":"filepath","description":"Package file or directory","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"Expected user of file or directory","type":"integer","hidden":false,"required":false,"index":false},{"name":"gid","description":"Expected group of file or directory","type":"integer","hidden":false,"required":false,"index":false},{"name":"mode","description":"Expected permissions","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Expected file size","type":"bigint","hidden":false,"required":false,"index":false},{"name":"modified_time","description":"Timestamp the file was installed","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of package bom","type":"text","hidden":false,"required":true,"index":false}]},{"name":"package_install_history","description":"macOS package install history.","platforms":["darwin"],"columns":[{"name":"package_id","description":"Label packageIdentifiers","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Label date as UNIX timestamp","type":"integer","hidden":false,"required":false,"index":false},{"name":"name","description":"Package display name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package display version","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Install source: usually the installer process name","type":"text","hidden":false,"required":false,"index":false},{"name":"content_type","description":"Package content_type (optional)","type":"text","hidden":false,"required":false,"index":false}]},{"name":"package_receipts","description":"macOS package receipt details.","platforms":["darwin"],"columns":[{"name":"package_id","description":"Package domain identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"package_filename","description":"Filename of original .pkg file","type":"text","hidden":true,"required":false,"index":false},{"name":"version","description":"Installed package version","type":"text","hidden":false,"required":false,"index":false},{"name":"location","description":"Optional relative install path on volume","type":"text","hidden":false,"required":false,"index":false},{"name":"install_time","description":"Timestamp of install time","type":"double","hidden":false,"required":false,"index":false},{"name":"installer_name","description":"Name of installer process","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of receipt plist","type":"text","hidden":false,"required":false,"index":false}]},{"name":"password_policy","description":"Password Policies for macOS.","platforms":["darwin"],"columns":[{"name":"uid","description":"User ID for the policy, -1 for policies that are global","type":"bigint","hidden":false,"required":false,"index":false},{"name":"policy_identifier","description":"Policy Identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"policy_content","description":"Policy content","type":"text","hidden":false,"required":false,"index":false},{"name":"policy_description","description":"Policy description","type":"text","hidden":false,"required":false,"index":false}]},{"name":"patches","description":"Lists all the patches applied. Note: This does not include patches applied via MSI or downloaded from Windows Update (e.g. Service Packs).","platforms":["windows"],"columns":[{"name":"csname","description":"The name of the host the patch is installed on.","type":"text","hidden":false,"required":false,"index":false},{"name":"hotfix_id","description":"The KB ID of the patch.","type":"text","hidden":false,"required":false,"index":false},{"name":"caption","description":"Short description of the patch.","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Fuller description of the patch.","type":"text","hidden":false,"required":false,"index":false},{"name":"fix_comments","description":"Additional comments about the patch.","type":"text","hidden":false,"required":false,"index":false},{"name":"installed_by","description":"The system context in which the patch as installed.","type":"text","hidden":false,"required":false,"index":false},{"name":"install_date","description":"Indicates when the patch was installed. Lack of a value does not indicate that the patch was not installed.","type":"text","hidden":false,"required":false,"index":false},{"name":"installed_on","description":"The date when the patch was installed.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"pci_devices","description":"PCI devices active on the host system.","platforms":["darwin","linux"],"columns":[{"name":"pci_slot","description":"PCI Device used slot","type":"text","hidden":false,"required":false,"index":false},{"name":"pci_class","description":"PCI Device class","type":"text","hidden":false,"required":false,"index":false},{"name":"driver","description":"PCI Device used driver","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor","description":"PCI Device vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor_id","description":"Hex encoded PCI Device vendor identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"PCI Device model","type":"text","hidden":false,"required":false,"index":false},{"name":"model_id","description":"Hex encoded PCI Device model identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"pci_class_id","description":"PCI Device class ID in hex format","type":"text","hidden":true,"required":false,"index":false},{"name":"pci_subclass_id","description":"PCI Device subclass in hex format","type":"text","hidden":true,"required":false,"index":false},{"name":"pci_subclass","description":"PCI Device subclass","type":"text","hidden":true,"required":false,"index":false},{"name":"subsystem_vendor_id","description":"Vendor ID of PCI device subsystem","type":"text","hidden":true,"required":false,"index":false},{"name":"subsystem_vendor","description":"Vendor of PCI device subsystem","type":"text","hidden":true,"required":false,"index":false},{"name":"subsystem_model_id","description":"Model ID of PCI device subsystem","type":"text","hidden":true,"required":false,"index":false},{"name":"subsystem_model","description":"Device description of PCI device subsystem","type":"text","hidden":true,"required":false,"index":false}]},{"name":"physical_disk_performance","description":"Provides provides raw data from performance counters that monitor hard or fixed disk drives on the system.","platforms":["windows"],"columns":[{"name":"name","description":"Name of the physical disk","type":"text","hidden":false,"required":false,"index":false},{"name":"avg_disk_bytes_per_read","description":"Average number of bytes transferred from the disk during read operations","type":"bigint","hidden":false,"required":false,"index":false},{"name":"avg_disk_bytes_per_write","description":"Average number of bytes transferred to the disk during write operations","type":"bigint","hidden":false,"required":false,"index":false},{"name":"avg_disk_read_queue_length","description":"Average number of read requests that were queued for the selected disk during the sample interval","type":"bigint","hidden":false,"required":false,"index":false},{"name":"avg_disk_write_queue_length","description":"Average number of write requests that were queued for the selected disk during the sample interval","type":"bigint","hidden":false,"required":false,"index":false},{"name":"avg_disk_sec_per_read","description":"Average time, in seconds, of a read operation of data from the disk","type":"integer","hidden":false,"required":false,"index":false},{"name":"avg_disk_sec_per_write","description":"Average time, in seconds, of a write operation of data to the disk","type":"integer","hidden":false,"required":false,"index":false},{"name":"current_disk_queue_length","description":"Number of requests outstanding on the disk at the time the performance data is collected","type":"integer","hidden":false,"required":false,"index":false},{"name":"percent_disk_read_time","description":"Percentage of elapsed time that the selected disk drive is busy servicing read requests","type":"bigint","hidden":false,"required":false,"index":false},{"name":"percent_disk_write_time","description":"Percentage of elapsed time that the selected disk drive is busy servicing write requests","type":"bigint","hidden":false,"required":false,"index":false},{"name":"percent_disk_time","description":"Percentage of elapsed time that the selected disk drive is busy servicing read or write requests","type":"bigint","hidden":false,"required":false,"index":false},{"name":"percent_idle_time","description":"Percentage of time during the sample interval that the disk was idle","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"pipes","description":"Named and Anonymous pipes.","platforms":["windows"],"columns":[{"name":"pid","description":"Process ID of the process to which the pipe belongs","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the pipe","type":"text","hidden":false,"required":false,"index":false},{"name":"instances","description":"Number of instances of the named pipe","type":"integer","hidden":false,"required":false,"index":false},{"name":"max_instances","description":"The maximum number of instances creatable for this pipe","type":"integer","hidden":false,"required":false,"index":false},{"name":"flags","description":"The flags indicating whether this pipe connection is a server or client end, and if the pipe for sending messages or bytes","type":"text","hidden":false,"required":false,"index":false}]},{"name":"pkg_packages","description":"pkgng packages that are currently installed on the host system.","platforms":["freebsd"],"columns":[{"name":"name","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package version","type":"text","hidden":false,"required":false,"index":false},{"name":"flatsize","description":"Package size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"arch","description":"Architecture(s) supported","type":"text","hidden":false,"required":false,"index":false}]},{"name":"platform_info","description":"Information about EFI/UEFI/ROM and platform/boot.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"vendor","description":"Platform code vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Platform code version","type":"text","hidden":false,"required":false,"index":false},{"name":"date","description":"Self-reported platform code update date","type":"text","hidden":false,"required":false,"index":false},{"name":"revision","description":"BIOS major and minor revision","type":"text","hidden":false,"required":false,"index":false},{"name":"extra","description":"Platform-specific additional information","type":"text","hidden":false,"required":false,"index":false},{"name":"firmware_type","description":"The type of firmware (Uefi, Bios, Unknown).","type":"text","hidden":true,"required":false,"index":false},{"name":"address","description":"Relative address of firmware mapping","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size in bytes of firmware","type":"text","hidden":false,"required":false,"index":false},{"name":"volume_size","description":"(Optional) size of firmware volume","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"plist","description":"Read and parse a plist file.","platforms":["darwin"],"columns":[{"name":"key","description":"Preference top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"subkey","description":"Intermediate key path, includes lists/dicts","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"String value of most CF types","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"(required) read preferences from a plist","type":"text","hidden":false,"required":true,"index":false}]},{"name":"portage_keywords","description":"A summary about portage configurations like keywords, mask and unmask.","platforms":["linux"],"columns":[{"name":"package","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"The version which are affected by the use flags, empty means all","type":"text","hidden":false,"required":false,"index":false},{"name":"keyword","description":"The keyword applied to the package","type":"text","hidden":false,"required":false,"index":false},{"name":"mask","description":"If the package is masked","type":"integer","hidden":false,"required":false,"index":false},{"name":"unmask","description":"If the package is unmasked","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"portage_packages","description":"List of currently installed packages.","platforms":["linux"],"columns":[{"name":"package","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"The version which are affected by the use flags, empty means all","type":"text","hidden":false,"required":false,"index":false},{"name":"slot","description":"The slot used by package","type":"text","hidden":false,"required":false,"index":false},{"name":"build_time","description":"Unix time when package was built","type":"bigint","hidden":false,"required":false,"index":false},{"name":"repository","description":"From which repository the ebuild was used","type":"text","hidden":false,"required":false,"index":false},{"name":"eapi","description":"The eapi for the ebuild","type":"bigint","hidden":false,"required":false,"index":false},{"name":"size","description":"The size of the package","type":"bigint","hidden":false,"required":false,"index":false},{"name":"world","description":"If package is in the world file","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"portage_use","description":"List of enabled portage USE values for specific package.","platforms":["linux"],"columns":[{"name":"package","description":"Package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"The version of the installed package","type":"text","hidden":false,"required":false,"index":false},{"name":"use","description":"USE flag which has been enabled for package","type":"text","hidden":false,"required":false,"index":false}]},{"name":"power_sensors","description":"Machine power (currents, voltages, wattages, etc) sensors.","platforms":["darwin"],"columns":[{"name":"key","description":"The SMC key on macOS","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"The sensor category: currents, voltage, wattage","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of power source","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Power in Watts","type":"text","hidden":false,"required":false,"index":false}]},{"name":"powershell_events","description":"Powershell script blocks reconstructed to their full script content, this table requires script block logging to be enabled.","platforms":["windows"],"columns":[{"name":"time","description":"Timestamp the event was received by the osquery event publisher","type":"bigint","hidden":false,"required":false,"index":false},{"name":"datetime","description":"System time at which the Powershell script event occurred","type":"text","hidden":false,"required":false,"index":false},{"name":"script_block_id","description":"The unique GUID of the powershell script to which this block belongs","type":"text","hidden":false,"required":false,"index":false},{"name":"script_block_count","description":"The total number of script blocks for this script","type":"integer","hidden":false,"required":false,"index":false},{"name":"script_text","description":"The text content of the Powershell script","type":"text","hidden":false,"required":false,"index":false},{"name":"script_name","description":"The name of the Powershell script","type":"text","hidden":false,"required":false,"index":false},{"name":"script_path","description":"The path for the Powershell script","type":"text","hidden":false,"required":false,"index":false},{"name":"cosine_similarity","description":"How similar the Powershell script is to a provided 'normal' character frequency","type":"double","hidden":false,"required":false,"index":false}]},{"name":"preferences","description":"macOS defaults and managed preferences.","platforms":["darwin"],"columns":[{"name":"domain","description":"Application ID usually in com.name.product format","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Preference top-level key","type":"text","hidden":false,"required":false,"index":false},{"name":"subkey","description":"Intemediate key path, includes lists/dicts","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"String value of most CF types","type":"text","hidden":false,"required":false,"index":false},{"name":"forced","description":"1 if the value is forced/managed, else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"username","description":"(optional) read preferences for a specific user","type":"text","hidden":false,"required":false,"index":false},{"name":"host","description":"'current' or 'any' host, where 'current' takes precedence","type":"text","hidden":false,"required":false,"index":false}]},{"name":"prefetch","description":"Prefetch files show metadata related to file execution.","platforms":["windows"],"columns":[{"name":"path","description":"Prefetch file path.","type":"text","hidden":false,"required":false,"index":false},{"name":"filename","description":"Executable filename.","type":"text","hidden":false,"required":false,"index":false},{"name":"hash","description":"Prefetch CRC hash.","type":"text","hidden":false,"required":false,"index":false},{"name":"last_run_time","description":"Most recent time application was run.","type":"integer","hidden":false,"required":false,"index":false},{"name":"other_run_times","description":"Other execution times in prefetch file.","type":"text","hidden":false,"required":false,"index":false},{"name":"run_count","description":"Number of times the application has been run.","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Application file size.","type":"integer","hidden":false,"required":false,"index":false},{"name":"volume_serial","description":"Volume serial number.","type":"text","hidden":false,"required":false,"index":false},{"name":"volume_creation","description":"Volume creation time.","type":"text","hidden":false,"required":false,"index":false},{"name":"accessed_files_count","description":"Number of files accessed.","type":"integer","hidden":false,"required":false,"index":false},{"name":"accessed_directories_count","description":"Number of directories accessed.","type":"integer","hidden":false,"required":false,"index":false},{"name":"accessed_files","description":"Files accessed by application within ten seconds of launch.","type":"text","hidden":false,"required":false,"index":false},{"name":"accessed_directories","description":"Directories accessed by application within ten seconds of launch.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"process_envs","description":"A key/value table of environment variables for each process.","platforms":["darwin","linux"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"key","description":"Environment variable name","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Environment variable value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"process_events","description":"Track time/action process executions.","platforms":["darwin","linux"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of executed file","type":"text","hidden":false,"required":false,"index":false},{"name":"mode","description":"File mode permissions","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Command line arguments (argv)","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline_size","description":"Actual size (bytes) of command line arguments","type":"bigint","hidden":true,"required":false,"index":false},{"name":"env","description":"Environment variables delimited by spaces","type":"text","hidden":true,"required":false,"index":false},{"name":"env_count","description":"Number of environment variables","type":"bigint","hidden":true,"required":false,"index":false},{"name":"env_size","description":"Actual size (bytes) of environment list","type":"bigint","hidden":true,"required":false,"index":false},{"name":"cwd","description":"The process current working directory","type":"text","hidden":false,"required":false,"index":false},{"name":"auid","description":"Audit User ID at process start","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID at process start","type":"bigint","hidden":false,"required":false,"index":false},{"name":"euid","description":"Effective user ID at process start","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID at process start","type":"bigint","hidden":false,"required":false,"index":false},{"name":"egid","description":"Effective group ID at process start","type":"bigint","hidden":false,"required":false,"index":false},{"name":"owner_uid","description":"File owner user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"owner_gid","description":"File owner group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"atime","description":"File last access in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mtime","description":"File modification in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ctime","description":"File last metadata change in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"btime","description":"File creation in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"overflows","description":"List of structures that overflowed","type":"text","hidden":true,"required":false,"index":false},{"name":"parent","description":"Process parent's PID, or -1 if cannot be determined.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false},{"name":"status","description":"OpenBSM Attribute: Status of the process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"fsuid","description":"Filesystem user ID at process start","type":"bigint","hidden":true,"required":false,"index":false},{"name":"suid","description":"Saved user ID at process start","type":"bigint","hidden":true,"required":false,"index":false},{"name":"fsgid","description":"Filesystem group ID at process start","type":"bigint","hidden":true,"required":false,"index":false},{"name":"sgid","description":"Saved group ID at process start","type":"bigint","hidden":true,"required":false,"index":false},{"name":"syscall","description":"Syscall name: fork, vfork, clone, execve, execveat","type":"text","hidden":true,"required":false,"index":false}]},{"name":"process_file_events","description":"A File Integrity Monitor implementation using the audit service.","platforms":["linux"],"columns":[{"name":"operation","description":"Operation type","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ppid","description":"Parent process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"executable","description":"The executable path","type":"text","hidden":false,"required":false,"index":false},{"name":"partial","description":"True if this is a partial event (i.e.: this process existed before we started osquery)","type":"text","hidden":false,"required":false,"index":false},{"name":"cwd","description":"The current working directory of the process","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"The path associated with the event","type":"text","hidden":false,"required":false,"index":false},{"name":"dest_path","description":"The canonical path associated with the event","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"The uid of the process performing the action","type":"text","hidden":false,"required":false,"index":false},{"name":"gid","description":"The gid of the process performing the action","type":"text","hidden":false,"required":false,"index":false},{"name":"auid","description":"Audit user ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"euid","description":"Effective user ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"egid","description":"Effective group ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"fsuid","description":"Filesystem user ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"fsgid","description":"Filesystem group ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"suid","description":"Saved user ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"sgid","description":"Saved group ID of the process using the file","type":"text","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"process_memory_map","description":"Process memory mapped files and pseudo device/regions.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"start","description":"Virtual start address (hex)","type":"text","hidden":false,"required":false,"index":false},{"name":"end","description":"Virtual end address (hex)","type":"text","hidden":false,"required":false,"index":false},{"name":"permissions","description":"r=read, w=write, x=execute, p=private (cow)","type":"text","hidden":false,"required":false,"index":false},{"name":"offset","description":"Offset into mapped path","type":"bigint","hidden":false,"required":false,"index":false},{"name":"device","description":"MA:MI Major/minor device ID","type":"text","hidden":false,"required":false,"index":false},{"name":"inode","description":"Mapped path inode, 0 means uninitialized (BSS)","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to mapped file or mapped type","type":"text","hidden":false,"required":false,"index":false},{"name":"pseudo","description":"1 If path is a pseudo path, else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"process_namespaces","description":"Linux namespaces for processes running on the host system.","platforms":["linux"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"cgroup_namespace","description":"cgroup namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"ipc_namespace","description":"ipc namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"mnt_namespace","description":"mnt namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"net_namespace","description":"net namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_namespace","description":"pid namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"user_namespace","description":"user namespace inode","type":"text","hidden":false,"required":false,"index":false},{"name":"uts_namespace","description":"uts namespace inode","type":"text","hidden":false,"required":false,"index":false}]},{"name":"process_open_files","description":"File descriptors for each process.","platforms":["darwin","linux"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"fd","description":"Process-specific file descriptor number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Filesystem path of descriptor","type":"text","hidden":false,"required":false,"index":false}]},{"name":"process_open_pipes","description":"Pipes and partner processes for each process.","platforms":["linux"],"columns":[{"name":"pid","description":"Process ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"fd","description":"File descriptor","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mode","description":"Pipe open mode (r/w)","type":"text","hidden":false,"required":false,"index":false},{"name":"inode","description":"Pipe inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"type","description":"Pipe Type: named vs unnamed/anonymous","type":"text","hidden":false,"required":false,"index":false},{"name":"partner_pid","description":"Process ID of partner process sharing a particular pipe","type":"bigint","hidden":false,"required":false,"index":false},{"name":"partner_fd","description":"File descriptor of shared pipe at partner's end","type":"bigint","hidden":false,"required":false,"index":false},{"name":"partner_mode","description":"Mode of shared pipe at partner's end","type":"text","hidden":false,"required":false,"index":false}]},{"name":"process_open_sockets","description":"Processes which have open network sockets on the system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"fd","description":"Socket file descriptor number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"socket","description":"Socket handle or inode number","type":"bigint","hidden":false,"required":false,"index":false},{"name":"family","description":"Network protocol (IPv4, IPv6)","type":"integer","hidden":false,"required":false,"index":false},{"name":"protocol","description":"Transport protocol (TCP/UDP)","type":"integer","hidden":false,"required":false,"index":false},{"name":"local_address","description":"Socket local address","type":"text","hidden":false,"required":false,"index":false},{"name":"remote_address","description":"Socket remote address","type":"text","hidden":false,"required":false,"index":false},{"name":"local_port","description":"Socket local port","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_port","description":"Socket remote port","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"For UNIX sockets (family=AF_UNIX), the domain path","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"TCP socket state","type":"text","hidden":false,"required":false,"index":false},{"name":"net_namespace","description":"The inode number of the network namespace","type":"text","hidden":true,"required":false,"index":false}]},{"name":"processes","description":"All running processes on the host system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"The process path or shorthand argv[0]","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to executed binary","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Complete argv","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Process state","type":"text","hidden":false,"required":false,"index":false},{"name":"cwd","description":"Process current working directory","type":"text","hidden":false,"required":false,"index":false},{"name":"root","description":"Process virtual root directory","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"Unsigned user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Unsigned group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"euid","description":"Unsigned effective user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"egid","description":"Unsigned effective group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"suid","description":"Unsigned saved user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sgid","description":"Unsigned saved group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"on_disk","description":"The process path exists yes=1, no=0, unknown=-1","type":"integer","hidden":false,"required":false,"index":false},{"name":"wired_size","description":"Bytes of unpageable memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"resident_size","description":"Bytes of private memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"total_size","description":"Total virtual memory size","type":"bigint","hidden":false,"required":false,"index":false},{"name":"user_time","description":"CPU time in milliseconds spent in user space","type":"bigint","hidden":false,"required":false,"index":false},{"name":"system_time","description":"CPU time in milliseconds spent in kernel space","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_bytes_read","description":"Bytes read from disk","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_bytes_written","description":"Bytes written to disk","type":"bigint","hidden":false,"required":false,"index":false},{"name":"start_time","description":"Process start time in seconds since Epoch, in case of error -1","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Process parent's PID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pgroup","description":"Process group","type":"bigint","hidden":false,"required":false,"index":false},{"name":"threads","description":"Number of threads used by process","type":"integer","hidden":false,"required":false,"index":false},{"name":"nice","description":"Process nice level (-20 to 20, default 0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"elevated_token","description":"Process uses elevated token yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"secure_process","description":"Process is secure (IUM) yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"protection_type","description":"The protection type of the process","type":"text","hidden":true,"required":false,"index":false},{"name":"virtual_process","description":"Process is virtual (e.g. System, Registry, vmmem) yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"elapsed_time","description":"Elapsed time in seconds this process has been running.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"handle_count","description":"Total number of handles that the process has open. This number is the sum of the handles currently opened by each thread in the process.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"percent_processor_time","description":"Returns elapsed time that all of the threads of this process used the processor to execute instructions in 100 nanoseconds ticks.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"upid","description":"A 64bit pid that is never reused. Returns -1 if we couldn't gather them from the system.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uppid","description":"The 64bit parent pid that is never reused. Returns -1 if we couldn't gather them from the system.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cpu_type","description":"Indicates the specific processor designed for installation.","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_subtype","description":"Indicates the specific processor on which an entry may be used.","type":"integer","hidden":false,"required":false,"index":false},{"name":"translated","description":"Indicates whether the process is running under the Rosetta Translation Environment, yes=1, no=0, error=-1.","type":"integer","hidden":false,"required":false,"index":false},{"name":"cgroup_path","description":"The full hierarchical path of the process's control group","type":"text","hidden":true,"required":false,"index":false}]},{"name":"programs","description":"Represents products as they are installed by Windows Installer. A product generally correlates to one installation package on Windows. Some fields may be blank as Windows installation details are left to the discretion of the product author.","platforms":["windows"],"columns":[{"name":"name","description":"Commonly used product name.","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Product version information.","type":"text","hidden":false,"required":false,"index":false},{"name":"install_location","description":"The installation location directory of the product.","type":"text","hidden":false,"required":false,"index":false},{"name":"install_source","description":"The installation source of the product.","type":"text","hidden":false,"required":false,"index":false},{"name":"language","description":"The language of the product.","type":"text","hidden":false,"required":false,"index":false},{"name":"publisher","description":"Name of the product supplier.","type":"text","hidden":false,"required":false,"index":false},{"name":"uninstall_string","description":"Path and filename of the uninstaller.","type":"text","hidden":false,"required":false,"index":false},{"name":"install_date","description":"Date that this product was installed on the system. ","type":"text","hidden":false,"required":false,"index":false},{"name":"identifying_number","description":"Product identification such as a serial number on software, or a die number on a hardware chip.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"prometheus_metrics","description":"Retrieve metrics from a Prometheus server.","platforms":["darwin","linux"],"columns":[{"name":"target_name","description":"Address of prometheus target","type":"text","hidden":false,"required":false,"index":false},{"name":"metric_name","description":"Name of collected Prometheus metric","type":"text","hidden":false,"required":false,"index":false},{"name":"metric_value","description":"Value of collected Prometheus metric","type":"double","hidden":false,"required":false,"index":false},{"name":"timestamp_ms","description":"Unix timestamp of collected data in MS","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"python_packages","description":"Python packages installed in a system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Package display name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package-supplied version","type":"text","hidden":false,"required":false,"index":false},{"name":"summary","description":"Package-supplied summary","type":"text","hidden":false,"required":false,"index":false},{"name":"author","description":"Optional package author","type":"text","hidden":false,"required":false,"index":false},{"name":"license","description":"License under which package is launched","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path at which this module resides","type":"text","hidden":false,"required":false,"index":false},{"name":"directory","description":"Directory where Python modules are located","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"quicklook_cache","description":"Files and thumbnails within macOS's Quicklook Cache.","platforms":["darwin"],"columns":[{"name":"path","description":"Path of file","type":"text","hidden":false,"required":false,"index":false},{"name":"rowid","description":"Quicklook file rowid key","type":"integer","hidden":false,"required":false,"index":false},{"name":"fs_id","description":"Quicklook file fs_id key","type":"text","hidden":false,"required":false,"index":false},{"name":"volume_id","description":"Parsed volume ID from fs_id","type":"integer","hidden":false,"required":false,"index":false},{"name":"inode","description":"Parsed file ID (inode) from fs_id","type":"integer","hidden":false,"required":false,"index":false},{"name":"mtime","description":"Parsed version date field","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Parsed version size field","type":"bigint","hidden":false,"required":false,"index":false},{"name":"label","description":"Parsed version 'gen' field","type":"text","hidden":false,"required":false,"index":false},{"name":"last_hit_date","description":"Apple date format for last thumbnail cache hit","type":"integer","hidden":false,"required":false,"index":false},{"name":"hit_count","description":"Number of cache hits on thumbnail","type":"text","hidden":false,"required":false,"index":false},{"name":"icon_mode","description":"Thumbnail icon mode","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cache_path","description":"Path to cache data","type":"text","hidden":false,"required":false,"index":false}]},{"name":"registry","description":"All of the Windows registry hives.","platforms":["windows"],"columns":[{"name":"key","description":"Name of the key to search for","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Full path to the value","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the registry value entry","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of the registry value, or 'subkey' if item is a subkey","type":"text","hidden":false,"required":false,"index":false},{"name":"data","description":"Data content of registry value","type":"text","hidden":false,"required":false,"index":false},{"name":"mtime","description":"timestamp of the most recent registry write","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"routes","description":"The active route table for the host system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"destination","description":"Destination IP address","type":"text","hidden":false,"required":false,"index":false},{"name":"netmask","description":"Netmask length","type":"integer","hidden":false,"required":false,"index":false},{"name":"gateway","description":"Route gateway","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Route source","type":"text","hidden":false,"required":false,"index":false},{"name":"flags","description":"Flags to describe route","type":"integer","hidden":false,"required":false,"index":false},{"name":"interface","description":"Route local interface","type":"text","hidden":false,"required":false,"index":false},{"name":"mtu","description":"Maximum Transmission Unit for the route","type":"integer","hidden":false,"required":false,"index":false},{"name":"metric","description":"Cost of route. Lowest is preferred","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of route","type":"text","hidden":false,"required":false,"index":false},{"name":"hopcount","description":"Max hops expected","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"rpm_package_files","description":"RPM packages that are currently installed on the host system.","platforms":["linux"],"columns":[{"name":"package","description":"RPM package name","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"File path within the package","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"File default username from info DB","type":"text","hidden":false,"required":false,"index":false},{"name":"groupname","description":"File default groupname from info DB","type":"text","hidden":false,"required":false,"index":false},{"name":"mode","description":"File permissions mode from info DB","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Expected file size in bytes from RPM info DB","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sha256","description":"SHA256 file digest from RPM info DB","type":"text","hidden":false,"required":false,"index":false}]},{"name":"rpm_packages","description":"RPM packages that are currently installed on the host system.","platforms":["linux"],"columns":[{"name":"name","description":"RPM package name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Package version","type":"text","hidden":false,"required":false,"index":false},{"name":"release","description":"Package release","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Source RPM package name (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Package size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sha1","description":"SHA1 hash of the package contents","type":"text","hidden":false,"required":false,"index":false},{"name":"arch","description":"Architecture(s) supported","type":"text","hidden":false,"required":false,"index":false},{"name":"epoch","description":"Package epoch value","type":"integer","hidden":false,"required":false,"index":false},{"name":"install_time","description":"When the package was installed","type":"integer","hidden":false,"required":false,"index":false},{"name":"vendor","description":"Package vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"package_group","description":"Package group","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false},{"name":"mount_namespace_id","description":"Mount namespace id","type":"text","hidden":true,"required":false,"index":false}]},{"name":"running_apps","description":"macOS applications currently running on the host system.","platforms":["darwin"],"columns":[{"name":"pid","description":"The pid of the application","type":"integer","hidden":false,"required":false,"index":false},{"name":"bundle_identifier","description":"The bundle identifier of the application","type":"text","hidden":false,"required":false,"index":false},{"name":"is_active","description":"1 if the application is in focus, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"safari_extensions","description":"Safari browser extension details for all users.","platforms":["darwin"],"columns":[{"name":"uid","description":"The local user that owns the extension","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Extension display name","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Extension identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"Extension long version","type":"text","hidden":false,"required":false,"index":false},{"name":"sdk","description":"Bundle SDK used to compile extension","type":"text","hidden":false,"required":false,"index":false},{"name":"update_url","description":"Extension-supplied update URI","type":"text","hidden":false,"required":false,"index":false},{"name":"author","description":"Optional extension author","type":"text","hidden":false,"required":false,"index":false},{"name":"developer_id","description":"Optional developer identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Optional extension description text","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to extension XAR bundle","type":"text","hidden":false,"required":false,"index":false}]},{"name":"sandboxes","description":"macOS application sandboxes container details.","platforms":["darwin"],"columns":[{"name":"label","description":"UTI-format bundle or label ID","type":"text","hidden":false,"required":false,"index":false},{"name":"user","description":"Sandbox owner","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"Application sandboxings enabled on container","type":"integer","hidden":false,"required":false,"index":false},{"name":"build_id","description":"Sandbox-specific identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_path","description":"Application bundle used by the sandbox","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to sandbox container directory","type":"text","hidden":false,"required":false,"index":false}]},{"name":"scheduled_tasks","description":"Lists all of the tasks in the Windows task scheduler.","platforms":["windows"],"columns":[{"name":"name","description":"Name of the scheduled task","type":"text","hidden":false,"required":false,"index":false},{"name":"action","description":"Actions executed by the scheduled task","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to the executable to be run","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"Whether or not the scheduled task is enabled","type":"integer","hidden":false,"required":false,"index":false},{"name":"state","description":"State of the scheduled task","type":"text","hidden":false,"required":false,"index":false},{"name":"hidden","description":"Whether or not the task is visible in the UI","type":"integer","hidden":false,"required":false,"index":false},{"name":"last_run_time","description":"Timestamp the task last ran","type":"bigint","hidden":false,"required":false,"index":false},{"name":"next_run_time","description":"Timestamp the task is scheduled to run next","type":"bigint","hidden":false,"required":false,"index":false},{"name":"last_run_message","description":"Exit status message of the last task run","type":"text","hidden":false,"required":false,"index":false},{"name":"last_run_code","description":"Exit status code of the last task run","type":"text","hidden":false,"required":false,"index":false}]},{"name":"screenlock","description":"macOS screenlock status. Note: only fetches results for osquery's current logged-in user context. The user must also have recently logged in.","platforms":["darwin"],"columns":[{"name":"enabled","description":"1 If a password is required after sleep or the screensaver begins; else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"grace_period","description":"The amount of time in seconds the screen must be asleep or the screensaver on before a password is required on-wake. 0 = immediately; -1 = no password is required on-wake","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"seccomp_events","description":"A virtual table that tracks seccomp events.","platforms":["linux"],"columns":[{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"auid","description":"Audit user ID (loginuid) of the user who started the analyzed process","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"uid","description":"User ID of the user who started the analyzed process","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID of the user who started the analyzed process","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"ses","description":"Session ID of the session from which the analyzed process was invoked","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID","type":"unsigned_bigint","hidden":false,"required":false,"index":false},{"name":"comm","description":"Command-line name of the command that was used to invoke the analyzed process","type":"text","hidden":false,"required":false,"index":false},{"name":"exe","description":"The path to the executable that was used to invoke the analyzed process","type":"text","hidden":false,"required":false,"index":false},{"name":"sig","description":"Signal value sent to process by seccomp","type":"bigint","hidden":false,"required":false,"index":false},{"name":"arch","description":"Information about the CPU architecture","type":"text","hidden":false,"required":false,"index":false},{"name":"syscall","description":"Type of the system call","type":"text","hidden":false,"required":false,"index":false},{"name":"compat","description":"Is system call in compatibility mode","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ip","description":"Instruction pointer value","type":"text","hidden":false,"required":false,"index":false},{"name":"code","description":"The seccomp action","type":"text","hidden":false,"required":false,"index":false}]},{"name":"secureboot","description":"Secure Boot UEFI Settings.","platforms":["linux","windows"],"columns":[{"name":"secure_boot","description":"Whether secure boot is enabled","type":"integer","hidden":false,"required":false,"index":false},{"name":"setup_mode","description":"Whether setup mode is enabled","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"selinux_events","description":"Track SELinux events.","platforms":["linux"],"columns":[{"name":"type","description":"Event type","type":"text","hidden":false,"required":false,"index":false},{"name":"message","description":"Message","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"selinux_settings","description":"Track active SELinux settings.","platforms":["linux"],"columns":[{"name":"scope","description":"Where the key is located inside the SELinuxFS mount point.","type":"text","hidden":false,"required":false,"index":false},{"name":"key","description":"Key or class name.","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Active value.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"services","description":"Lists all installed Windows services and their relevant data.","platforms":["windows"],"columns":[{"name":"name","description":"Service name","type":"text","hidden":false,"required":false,"index":false},{"name":"service_type","description":"Service Type: OWN_PROCESS, SHARE_PROCESS and maybe Interactive (can interact with the desktop)","type":"text","hidden":false,"required":false,"index":false},{"name":"display_name","description":"Service Display name","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Service Current status: STOPPED, START_PENDING, STOP_PENDING, RUNNING, CONTINUE_PENDING, PAUSE_PENDING, PAUSED","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"the Process ID of the service","type":"integer","hidden":false,"required":false,"index":false},{"name":"start_type","description":"Service start type: BOOT_START, SYSTEM_START, AUTO_START, DEMAND_START, DISABLED","type":"text","hidden":false,"required":false,"index":false},{"name":"win32_exit_code","description":"The error code that the service uses to report an error that occurs when it is starting or stopping","type":"integer","hidden":false,"required":false,"index":false},{"name":"service_exit_code","description":"The service-specific error code that the service returns when an error occurs while the service is starting or stopping","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to Service Executable","type":"text","hidden":false,"required":false,"index":false},{"name":"module_path","description":"Path to ServiceDll","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Service Description","type":"text","hidden":false,"required":false,"index":false},{"name":"user_account","description":"The name of the account that the service process will be logged on as when it runs. This name can be of the form Domain\\UserName. If the account belongs to the built-in domain, the name can be of the form .\\UserName.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"shadow","description":"Local system users encrypted passwords and related information. Please note, that you usually need superuser rights to access `/etc/shadow`.","platforms":["linux"],"columns":[{"name":"password_status","description":"Password status","type":"text","hidden":false,"required":false,"index":false},{"name":"hash_alg","description":"Password hashing algorithm","type":"text","hidden":false,"required":false,"index":false},{"name":"last_change","description":"Date of last password change (starting from UNIX epoch date)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"min","description":"Minimal number of days between password changes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"max","description":"Maximum number of days between password changes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"warning","description":"Number of days before password expires to warn user about it","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inactive","description":"Number of days after password expires until account is blocked","type":"bigint","hidden":false,"required":false,"index":false},{"name":"expire","description":"Number of days since UNIX epoch date until account is disabled","type":"bigint","hidden":false,"required":false,"index":false},{"name":"flag","description":"Reserved","type":"bigint","hidden":false,"required":false,"index":false},{"name":"username","description":"Username","type":"text","hidden":false,"required":false,"index":false}]},{"name":"shared_folders","description":"Folders available to others via SMB or AFP.","platforms":["darwin"],"columns":[{"name":"name","description":"The shared name of the folder as it appears to other users","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Absolute path of shared folder on the local system","type":"text","hidden":false,"required":false,"index":false}]},{"name":"shared_memory","description":"OS shared memory regions.","platforms":["linux"],"columns":[{"name":"shmid","description":"Shared memory segment ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"owner_uid","description":"User ID of owning process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"creator_uid","description":"User ID of creator process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID to last use the segment","type":"bigint","hidden":false,"required":false,"index":false},{"name":"creator_pid","description":"Process ID that created the segment","type":"bigint","hidden":false,"required":false,"index":false},{"name":"atime","description":"Attached time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"dtime","description":"Detached time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"ctime","description":"Changed time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"permissions","description":"Memory segment permissions","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Size in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"attached","description":"Number of attached processes","type":"integer","hidden":false,"required":false,"index":false},{"name":"status","description":"Destination/attach status","type":"text","hidden":false,"required":false,"index":false},{"name":"locked","description":"1 if segment is locked else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"shared_resources","description":"Displays shared resources on a computer system running Windows. This may be a disk drive, printer, interprocess communication, or other sharable device.","platforms":["windows"],"columns":[{"name":"description","description":"A textual description of the object","type":"text","hidden":false,"required":false,"index":false},{"name":"install_date","description":"Indicates when the object was installed. Lack of a value does not indicate that the object is not installed.","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"String that indicates the current status of the object.","type":"text","hidden":false,"required":false,"index":false},{"name":"allow_maximum","description":"Number of concurrent users for this resource has been limited. If True, the value in the MaximumAllowed property is ignored.","type":"integer","hidden":false,"required":false,"index":false},{"name":"maximum_allowed","description":"Limit on the maximum number of users allowed to use this resource concurrently. The value is only valid if the AllowMaximum property is set to FALSE.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"Alias given to a path set up as a share on a computer system running Windows.","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Local path of the Windows share.","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of resource being shared. Types include: disk drives, print queues, interprocess communications (IPC), and general devices.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"type_name","description":"Human readable value for the 'type' column","type":"text","hidden":false,"required":false,"index":false}]},{"name":"sharing_preferences","description":"macOS Sharing preferences.","platforms":["darwin"],"columns":[{"name":"screen_sharing","description":"1 If screen sharing is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"file_sharing","description":"1 If file sharing is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"printer_sharing","description":"1 If printer sharing is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_login","description":"1 If remote login is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_management","description":"1 If remote management is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_apple_events","description":"1 If remote apple events are enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"internet_sharing","description":"1 If internet sharing is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"bluetooth_sharing","description":"1 If bluetooth sharing is enabled for any user else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"disc_sharing","description":"1 If CD or DVD sharing is enabled else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"content_caching","description":"1 If content caching is enabled else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"shell_history","description":"A line-delimited (command) table of per-user .*_history data.","platforms":["darwin","linux"],"columns":[{"name":"uid","description":"Shell history owner","type":"bigint","hidden":false,"required":false,"index":false},{"name":"time","description":"Entry timestamp. It could be absent, default value is 0.","type":"integer","hidden":false,"required":false,"index":false},{"name":"command","description":"Unparsed date/line/command history line","type":"text","hidden":false,"required":false,"index":false},{"name":"history_file","description":"Path to the .*_history for this user","type":"text","hidden":false,"required":false,"index":false}]},{"name":"shellbags","description":"Shows directories accessed via Windows Explorer.","platforms":["windows"],"columns":[{"name":"sid","description":"User SID","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Shellbags source Registry file","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Directory name.","type":"text","hidden":false,"required":false,"index":false},{"name":"modified_time","description":"Directory Modified time.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"created_time","description":"Directory Created time.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"accessed_time","description":"Directory Accessed time.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mft_entry","description":"Directory master file table entry.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"mft_sequence","description":"Directory master file table sequence.","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"shimcache","description":"Application Compatibility Cache, contains artifacts of execution.","platforms":["windows"],"columns":[{"name":"entry","description":"Execution order.","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"This is the path to the executed file.","type":"text","hidden":false,"required":false,"index":false},{"name":"modified_time","description":"File Modified time.","type":"integer","hidden":false,"required":false,"index":false},{"name":"execution_flag","description":"Boolean Execution flag, 1 for execution, 0 for no execution, -1 for missing (this flag does not exist on Windows 10 and higher).","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"signature","description":"File (executable, bundle, installer, disk) code signing status.","platforms":["darwin"],"columns":[{"name":"path","description":"Must provide a path or directory","type":"text","hidden":false,"required":true,"index":false},{"name":"hash_resources","description":"Set to 1 to also hash resources, or 0 otherwise. Default is 1","type":"integer","hidden":false,"required":false,"index":false},{"name":"arch","description":"If applicable, the arch of the signed code","type":"text","hidden":false,"required":false,"index":false},{"name":"signed","description":"1 If the file is signed else 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"identifier","description":"The signing identifier sealed into the signature","type":"text","hidden":false,"required":false,"index":false},{"name":"cdhash","description":"Hash of the application Code Directory","type":"text","hidden":false,"required":false,"index":false},{"name":"team_identifier","description":"The team signing identifier sealed into the signature","type":"text","hidden":false,"required":false,"index":false},{"name":"authority","description":"Certificate Common Name","type":"text","hidden":false,"required":false,"index":false}]},{"name":"sip_config","description":"Apple's System Integrity Protection (rootless) status.","platforms":["darwin"],"columns":[{"name":"config_flag","description":"The System Integrity Protection config flag","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"1 if this configuration is enabled, otherwise 0","type":"integer","hidden":false,"required":false,"index":false},{"name":"enabled_nvram","description":"1 if this configuration is enabled, otherwise 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"smbios_tables","description":"BIOS (DMI) structure common details and content.","platforms":["darwin","linux"],"columns":[{"name":"number","description":"Table entry number","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Table entry type","type":"integer","hidden":false,"required":false,"index":false},{"name":"description","description":"Table entry description","type":"text","hidden":false,"required":false,"index":false},{"name":"handle","description":"Table entry handle","type":"integer","hidden":false,"required":false,"index":false},{"name":"header_size","description":"Header size in bytes","type":"integer","hidden":false,"required":false,"index":false},{"name":"size","description":"Table entry size in bytes","type":"integer","hidden":false,"required":false,"index":false},{"name":"md5","description":"MD5 hash of table entry","type":"text","hidden":false,"required":false,"index":false}]},{"name":"smc_keys","description":"Apple's system management controller keys.","platforms":["darwin"],"columns":[{"name":"key","description":"4-character key","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"SMC-reported type literal type","type":"text","hidden":false,"required":false,"index":false},{"name":"size","description":"Reported size of data in bytes","type":"integer","hidden":false,"required":false,"index":false},{"name":"value","description":"A type-encoded representation of the key value","type":"text","hidden":false,"required":false,"index":false},{"name":"hidden","description":"1 if this key is normally hidden, otherwise 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"socket_events","description":"Track network socket opens and closes.","platforms":["darwin","linux"],"columns":[{"name":"action","description":"The socket action (bind, listen, close)","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of executed file","type":"text","hidden":false,"required":false,"index":false},{"name":"fd","description":"The file description for the process socket","type":"text","hidden":false,"required":false,"index":false},{"name":"auid","description":"Audit User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"status","description":"Either 'succeeded', 'failed', 'in_progress' (connect() on non-blocking socket) or 'no_client' (null accept() on non-blocking socket)","type":"text","hidden":false,"required":false,"index":false},{"name":"family","description":"The Internet protocol family ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"protocol","description":"The network protocol ID","type":"integer","hidden":true,"required":false,"index":false},{"name":"local_address","description":"Local address associated with socket","type":"text","hidden":false,"required":false,"index":false},{"name":"remote_address","description":"Remote address associated with socket","type":"text","hidden":false,"required":false,"index":false},{"name":"local_port","description":"Local network protocol port number","type":"integer","hidden":false,"required":false,"index":false},{"name":"remote_port","description":"Remote network protocol port number","type":"integer","hidden":false,"required":false,"index":false},{"name":"socket","description":"The local path (UNIX domain socket only)","type":"text","hidden":true,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false},{"name":"success","description":"Deprecated. Use the 'status' column instead","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"ssh_configs","description":"A table of parsed ssh_configs.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"The local owner of the ssh_config file","type":"bigint","hidden":false,"required":false,"index":false},{"name":"block","description":"The host or match block","type":"text","hidden":false,"required":false,"index":false},{"name":"option","description":"The option and value","type":"text","hidden":false,"required":false,"index":false},{"name":"ssh_config_file","description":"Path to the ssh_config file","type":"text","hidden":false,"required":false,"index":false}]},{"name":"startup_items","description":"Applications and binaries set as user/login startup items.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"name","description":"Name of startup item","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of startup item","type":"text","hidden":false,"required":false,"index":false},{"name":"args","description":"Arguments provided to startup executable","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Startup Item or Login Item","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Directory or plist containing startup item","type":"text","hidden":false,"required":false,"index":false},{"name":"status","description":"Startup status; either enabled or disabled","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"The user associated with the startup item","type":"text","hidden":false,"required":false,"index":false}]},{"name":"sudoers","description":"Rules for running commands as other users via sudo.","platforms":["darwin","linux"],"columns":[{"name":"source","description":"Source file containing the given rule","type":"text","hidden":false,"required":false,"index":false},{"name":"header","description":"Symbol for given rule","type":"text","hidden":false,"required":false,"index":false},{"name":"rule_details","description":"Rule definition","type":"text","hidden":false,"required":false,"index":false}]},{"name":"suid_bin","description":"suid binaries in common locations.","platforms":["darwin","linux"],"columns":[{"name":"path","description":"Binary path","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"Binary owner username","type":"text","hidden":false,"required":false,"index":false},{"name":"groupname","description":"Binary owner group","type":"text","hidden":false,"required":false,"index":false},{"name":"permissions","description":"Binary permissions","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"syslog_events","description":"","platforms":["linux"],"columns":[{"name":"time","description":"Current unix epoch time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"datetime","description":"Time known to syslog","type":"text","hidden":false,"required":false,"index":false},{"name":"host","description":"Hostname configured for syslog","type":"text","hidden":false,"required":false,"index":false},{"name":"severity","description":"Syslog severity","type":"integer","hidden":false,"required":false,"index":false},{"name":"facility","description":"Syslog facility","type":"text","hidden":false,"required":false,"index":false},{"name":"tag","description":"The syslog tag","type":"text","hidden":false,"required":false,"index":false},{"name":"message","description":"The syslog message","type":"text","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"system_controls","description":"sysctl names, values, and settings information.","platforms":["darwin","linux"],"columns":[{"name":"name","description":"Full sysctl MIB name","type":"text","hidden":false,"required":false,"index":false},{"name":"oid","description":"Control MIB","type":"text","hidden":false,"required":false,"index":false},{"name":"subsystem","description":"Subsystem ID, control type","type":"text","hidden":false,"required":false,"index":false},{"name":"current_value","description":"Value of setting","type":"text","hidden":false,"required":false,"index":false},{"name":"config_value","description":"The MIB value set in /etc/sysctl.conf","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Data type","type":"text","hidden":false,"required":false,"index":false},{"name":"field_name","description":"Specific attribute of opaque type","type":"text","hidden":false,"required":false,"index":false}]},{"name":"system_extensions","description":"macOS (>= 10.15) system extension table.","platforms":["darwin"],"columns":[{"name":"path","description":"Original path of system extension","type":"text","hidden":false,"required":false,"index":false},{"name":"UUID","description":"Extension unique id","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"System extension state","type":"text","hidden":false,"required":false,"index":false},{"name":"identifier","description":"Identifier name","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"System extension version","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"System extension category","type":"text","hidden":false,"required":false,"index":false},{"name":"bundle_path","description":"System extension bundle path","type":"text","hidden":false,"required":false,"index":false},{"name":"team","description":"Signing team ID","type":"text","hidden":false,"required":false,"index":false},{"name":"mdm_managed","description":"1 if managed by MDM system extension payload configuration, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"system_info","description":"System information for identification.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"hostname","description":"Network hostname including domain","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"Unique ID provided by the system","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu_type","description":"CPU type","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu_subtype","description":"CPU subtype","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu_brand","description":"CPU brand string, contains vendor and model","type":"text","hidden":false,"required":false,"index":false},{"name":"cpu_physical_cores","description":"Number of physical CPU cores in to the system","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_logical_cores","description":"Number of logical CPU cores available to the system","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_microcode","description":"Microcode version","type":"text","hidden":false,"required":false,"index":false},{"name":"physical_memory","description":"Total physical memory in bytes","type":"bigint","hidden":false,"required":false,"index":false},{"name":"hardware_vendor","description":"Hardware vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"hardware_model","description":"Hardware model","type":"text","hidden":false,"required":false,"index":false},{"name":"hardware_version","description":"Hardware version","type":"text","hidden":false,"required":false,"index":false},{"name":"hardware_serial","description":"Device serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"board_vendor","description":"Board vendor","type":"text","hidden":false,"required":false,"index":false},{"name":"board_model","description":"Board model","type":"text","hidden":false,"required":false,"index":false},{"name":"board_version","description":"Board version","type":"text","hidden":false,"required":false,"index":false},{"name":"board_serial","description":"Board serial number","type":"text","hidden":false,"required":false,"index":false},{"name":"computer_name","description":"Friendly computer name (optional)","type":"text","hidden":false,"required":false,"index":false},{"name":"local_hostname","description":"Local hostname (optional)","type":"text","hidden":false,"required":false,"index":false}]},{"name":"systemd_units","description":"Track systemd units.","platforms":["linux"],"columns":[{"name":"id","description":"Unique unit identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Unit description","type":"text","hidden":false,"required":false,"index":false},{"name":"load_state","description":"Reflects whether the unit definition was properly loaded","type":"text","hidden":false,"required":false,"index":false},{"name":"active_state","description":"The high-level unit activation state, i.e. generalization of SUB","type":"text","hidden":false,"required":false,"index":false},{"name":"sub_state","description":"The low-level unit activation state, values depend on unit type","type":"text","hidden":false,"required":false,"index":false},{"name":"following","description":"The name of another unit that this unit follows in state","type":"text","hidden":false,"required":false,"index":false},{"name":"object_path","description":"The object path for this unit","type":"text","hidden":false,"required":false,"index":false},{"name":"job_id","description":"Next queued job id","type":"bigint","hidden":false,"required":false,"index":false},{"name":"job_type","description":"Job type","type":"text","hidden":false,"required":false,"index":false},{"name":"job_path","description":"The object path for the job","type":"text","hidden":false,"required":false,"index":false},{"name":"fragment_path","description":"The unit file path this unit was read from, if there is any","type":"text","hidden":false,"required":false,"index":false},{"name":"user","description":"The configured user, if any","type":"text","hidden":false,"required":false,"index":false},{"name":"source_path","description":"Path to the (possibly generated) unit configuration file","type":"text","hidden":false,"required":false,"index":false}]},{"name":"temperature_sensors","description":"Machine's temperature sensors.","platforms":["darwin"],"columns":[{"name":"key","description":"The SMC key on macOS","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of temperature source","type":"text","hidden":false,"required":false,"index":false},{"name":"celsius","description":"Temperature in Celsius","type":"double","hidden":false,"required":false,"index":false},{"name":"fahrenheit","description":"Temperature in Fahrenheit","type":"double","hidden":false,"required":false,"index":false}]},{"name":"time","description":"Track current date and time in UTC.","platforms":["darwin","linux","freebsd","windows"],"columns":[{"name":"weekday","description":"Current weekday in UTC","type":"text","hidden":false,"required":false,"index":false},{"name":"year","description":"Current year in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"month","description":"Current month in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"day","description":"Current day in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"hour","description":"Current hour in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"minutes","description":"Current minutes in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"seconds","description":"Current seconds in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"timezone","description":"Timezone for reported time (hardcoded to UTC)","type":"text","hidden":false,"required":false,"index":false},{"name":"local_timezone","description":"Current local timezone in of the system","type":"text","hidden":false,"required":false,"index":false},{"name":"unix_time","description":"Current UNIX time in UTC","type":"integer","hidden":false,"required":false,"index":false},{"name":"timestamp","description":"Current timestamp (log format) in UTC","type":"text","hidden":false,"required":false,"index":false},{"name":"datetime","description":"Current date and time (ISO format) in UTC","type":"text","hidden":false,"required":false,"index":false},{"name":"iso_8601","description":"Current time (ISO format) in UTC","type":"text","hidden":false,"required":false,"index":false},{"name":"win_timestamp","description":"Timestamp value in 100 nanosecond units","type":"bigint","hidden":true,"required":false,"index":false}]},{"name":"time_machine_backups","description":"Backups to drives using TimeMachine.","platforms":["darwin"],"columns":[{"name":"destination_id","description":"Time Machine destination ID","type":"text","hidden":false,"required":false,"index":false},{"name":"backup_date","description":"Backup Date","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"time_machine_destinations","description":"Locations backed up to using Time Machine.","platforms":["darwin"],"columns":[{"name":"alias","description":"Human readable name of drive","type":"text","hidden":false,"required":false,"index":false},{"name":"destination_id","description":"Time Machine destination ID","type":"text","hidden":false,"required":false,"index":false},{"name":"consistency_scan_date","description":"Consistency scan date","type":"integer","hidden":false,"required":false,"index":false},{"name":"root_volume_uuid","description":"Root UUID of backup volume","type":"text","hidden":false,"required":false,"index":false},{"name":"bytes_available","description":"Bytes available on volume","type":"integer","hidden":false,"required":false,"index":false},{"name":"bytes_used","description":"Bytes used on volume","type":"integer","hidden":false,"required":false,"index":false},{"name":"encryption","description":"Last known encrypted state","type":"text","hidden":false,"required":false,"index":false}]},{"name":"tpm_info","description":"A table that lists the TPM related information.","platforms":["windows"],"columns":[{"name":"activated","description":"TPM is activated","type":"integer","hidden":false,"required":false,"index":false},{"name":"enabled","description":"TPM is enabled","type":"integer","hidden":false,"required":false,"index":false},{"name":"owned","description":"TPM is owned","type":"integer","hidden":false,"required":false,"index":false},{"name":"manufacturer_version","description":"TPM version","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacturer_id","description":"TPM manufacturers ID","type":"integer","hidden":false,"required":false,"index":false},{"name":"manufacturer_name","description":"TPM manufacturers name","type":"text","hidden":false,"required":false,"index":false},{"name":"product_name","description":"Product name of the TPM","type":"text","hidden":false,"required":false,"index":false},{"name":"physical_presence_version","description":"Version of the Physical Presence Interface","type":"text","hidden":false,"required":false,"index":false},{"name":"spec_version","description":"Trusted Computing Group specification that the TPM supports","type":"text","hidden":false,"required":false,"index":false}]},{"name":"ulimit_info","description":"System resource usage limits.","platforms":["darwin","linux"],"columns":[{"name":"type","description":"System resource to be limited","type":"text","hidden":false,"required":false,"index":false},{"name":"soft_limit","description":"Current limit value","type":"text","hidden":false,"required":false,"index":false},{"name":"hard_limit","description":"Maximum limit value","type":"text","hidden":false,"required":false,"index":false}]},{"name":"unified_log","description":"Queries the OSLog framework for entries in the system log. The maximum number of rows returned is limited for performance issues. This table introduces a new idiom for extracting sequential data in batches using multiple queries, ordered by timestamp. To trigger it, the user should include the condition \"timestamp > -1\", and the table will handle pagination.","platforms":["darwin"],"columns":[{"name":"timestamp","description":"unix timestamp associated with the entry","type":"bigint","hidden":false,"required":false,"index":false},{"name":"storage","description":"the storage category for the entry","type":"integer","hidden":false,"required":false,"index":false},{"name":"message","description":"composed message","type":"text","hidden":false,"required":false,"index":false},{"name":"activity","description":"the activity ID associate with the entry","type":"bigint","hidden":false,"required":false,"index":false},{"name":"process","description":"the name of the process that made the entry","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"the pid of the process that made the entry","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sender","description":"the name of the binary image that made the entry","type":"text","hidden":false,"required":false,"index":false},{"name":"tid","description":"the tid of the thread that made the entry","type":"bigint","hidden":false,"required":false,"index":false},{"name":"category","description":"the category of the os_log_t used","type":"text","hidden":false,"required":false,"index":false},{"name":"subsystem","description":"the subsystem of the os_log_t used","type":"text","hidden":false,"required":false,"index":false},{"name":"level","description":"the severity level of the entry","type":"text","hidden":false,"required":false,"index":false},{"name":"max_rows","description":"the max number of rows returned (defaults to 100)","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"uptime","description":"Track time passed since last boot. Some systems track this as calendar time, some as runtime.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"days","description":"Days of uptime","type":"integer","hidden":false,"required":false,"index":false},{"name":"hours","description":"Hours of uptime","type":"integer","hidden":false,"required":false,"index":false},{"name":"minutes","description":"Minutes of uptime","type":"integer","hidden":false,"required":false,"index":false},{"name":"seconds","description":"Seconds of uptime","type":"integer","hidden":false,"required":false,"index":false},{"name":"total_seconds","description":"Total uptime seconds","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"usb_devices","description":"USB devices that are actively plugged into the host system.","platforms":["darwin","linux"],"columns":[{"name":"usb_address","description":"USB Device used address","type":"integer","hidden":false,"required":false,"index":false},{"name":"usb_port","description":"USB Device used port","type":"integer","hidden":false,"required":false,"index":false},{"name":"vendor","description":"USB Device vendor string","type":"text","hidden":false,"required":false,"index":false},{"name":"vendor_id","description":"Hex encoded USB Device vendor identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"version","description":"USB Device version number","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"USB Device model string","type":"text","hidden":false,"required":false,"index":false},{"name":"model_id","description":"Hex encoded USB Device model identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"serial","description":"USB Device serial connection","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"USB Device class","type":"text","hidden":false,"required":false,"index":false},{"name":"subclass","description":"USB Device subclass","type":"text","hidden":false,"required":false,"index":false},{"name":"protocol","description":"USB Device protocol","type":"text","hidden":false,"required":false,"index":false},{"name":"removable","description":"1 If USB device is removable else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"user_events","description":"Track user events from the audit framework.","platforms":["darwin","linux"],"columns":[{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"auid","description":"Audit User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"message","description":"Message from the event","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"The file description for the process socket","type":"integer","hidden":false,"required":false,"index":false},{"name":"path","description":"Supplied path from event","type":"text","hidden":false,"required":false,"index":false},{"name":"address","description":"The Internet protocol address or family ID","type":"text","hidden":false,"required":false,"index":false},{"name":"terminal","description":"The network protocol ID","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of execution in UNIX time","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uptime","description":"Time of execution in system uptime","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"user_groups","description":"Local system user group relationships.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"user_interaction_events","description":"Track user interaction events from macOS' event tapping framework.","platforms":["darwin"],"columns":[{"name":"time","description":"Time","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"user_ssh_keys","description":"Returns the private keys in the users ~/.ssh directory and whether or not they are encrypted.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"The local user that owns the key file","type":"bigint","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to key file","type":"text","hidden":false,"required":false,"index":false},{"name":"encrypted","description":"1 if key is encrypted, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"key_type","description":"The type of the private key. One of [rsa, dsa, dh, ec, hmac, cmac], or the empty string.","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"userassist","description":"UserAssist Registry Key tracks when a user executes an application from Windows Explorer.","platforms":["windows"],"columns":[{"name":"path","description":"Application file path.","type":"text","hidden":false,"required":false,"index":false},{"name":"last_execution_time","description":"Most recent time application was executed.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"count","description":"Number of times the application has been executed.","type":"integer","hidden":false,"required":false,"index":false},{"name":"sid","description":"User SID.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"users","description":"Local user accounts (including domain accounts that have logged on locally (Windows)).","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID (unsigned)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid_signed","description":"User ID as int64 signed (Apple)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid_signed","description":"Default group ID as int64 signed (Apple)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"username","description":"Username","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Optional user description","type":"text","hidden":false,"required":false,"index":false},{"name":"directory","description":"User's home directory","type":"text","hidden":false,"required":false,"index":false},{"name":"shell","description":"User's configured default shell","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"User's UUID (Apple) or SID (Windows)","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Whether the account is roaming (domain), local, or a system profile","type":"text","hidden":true,"required":false,"index":false},{"name":"is_hidden","description":"IsHidden attribute set in OpenDirectory","type":"integer","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"video_info","description":"Retrieve video card information of the machine.","platforms":["windows"],"columns":[{"name":"color_depth","description":"The amount of bits per pixel to represent color.","type":"integer","hidden":false,"required":false,"index":false},{"name":"driver","description":"The driver of the device.","type":"text","hidden":false,"required":false,"index":false},{"name":"driver_date","description":"The date listed on the installed driver.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"driver_version","description":"The version of the installed driver.","type":"text","hidden":false,"required":false,"index":false},{"name":"manufacturer","description":"The manufacturer of the gpu.","type":"text","hidden":false,"required":false,"index":false},{"name":"model","description":"The model of the gpu.","type":"text","hidden":false,"required":false,"index":false},{"name":"series","description":"The series of the gpu.","type":"text","hidden":false,"required":false,"index":false},{"name":"video_mode","description":"The current resolution of the display.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"virtual_memory_info","description":"Darwin Virtual Memory statistics.","platforms":["darwin"],"columns":[{"name":"free","description":"Total number of free pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"active","description":"Total number of active pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"inactive","description":"Total number of inactive pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"speculative","description":"Total number of speculative pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"throttled","description":"Total number of throttled pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"wired","description":"Total number of wired down pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"purgeable","description":"Total number of purgeable pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"faults","description":"Total number of calls to vm_faults.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"copy","description":"Total number of copy-on-write pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"zero_fill","description":"Total number of zero filled pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"reactivated","description":"Total number of reactivated pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"purged","description":"Total number of purged pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"file_backed","description":"Total number of file backed pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"anonymous","description":"Total number of anonymous pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uncompressed","description":"Total number of uncompressed pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"compressor","description":"The number of pages used to store compressed VM pages.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"decompressed","description":"The total number of pages that have been decompressed by the VM compressor.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"compressed","description":"The total number of pages that have been compressed by the VM compressor.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"page_ins","description":"The total number of requests for pages from a pager.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"page_outs","description":"Total number of pages paged out.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"swap_ins","description":"The total number of compressed pages that have been swapped out to disk.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"swap_outs","description":"The total number of compressed pages that have been swapped back in from disk.","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"wifi_networks","description":"macOS known/remembered Wi-Fi networks list.","platforms":["darwin"],"columns":[{"name":"ssid","description":"SSID octets of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"network_name","description":"Name of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"security_type","description":"Type of security on this network","type":"text","hidden":false,"required":false,"index":false},{"name":"last_connected","description":"Last time this network was connected to as a unix_time","type":"integer","hidden":true,"required":false,"index":false},{"name":"passpoint","description":"1 if Passpoint is supported, 0 otherwise","type":"integer","hidden":true,"required":false,"index":false},{"name":"possibly_hidden","description":"1 if network is possibly a hidden network, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"roaming","description":"1 if roaming is supported, 0 otherwise","type":"integer","hidden":true,"required":false,"index":false},{"name":"roaming_profile","description":"Describe the roaming profile, usually one of Single, Dual or Multi","type":"text","hidden":false,"required":false,"index":false},{"name":"auto_login","description":"1 if auto login is enabled, 0 otherwise","type":"integer","hidden":true,"required":false,"index":false},{"name":"temporarily_disabled","description":"1 if this network is temporarily disabled, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"disabled","description":"1 if this network is disabled, 0 otherwise","type":"integer","hidden":true,"required":false,"index":false},{"name":"add_reason","description":"Shows why this network was added, via menubar or command line or something else ","type":"text","hidden":false,"required":false,"index":false},{"name":"added_at","description":"Time this network was added as a unix_time","type":"integer","hidden":false,"required":false,"index":false},{"name":"captive_portal","description":"1 if this network has a captive portal, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"captive_login_date","description":"Time this network logged in to a captive portal as unix_time","type":"integer","hidden":false,"required":false,"index":false},{"name":"was_captive_network","description":"1 if this network was previously a captive network, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"auto_join","description":"1 if this network set to join automatically, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false},{"name":"personal_hotspot","description":"1 if this network is a personal hotspot, 0 otherwise","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"wifi_status","description":"macOS current WiFi status.","platforms":["darwin"],"columns":[{"name":"interface","description":"Name of the interface","type":"text","hidden":false,"required":false,"index":false},{"name":"ssid","description":"SSID octets of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"bssid","description":"The current basic service set identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"network_name","description":"Name of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"country_code","description":"The country code (ISO/IEC 3166-1:1997) for the network","type":"text","hidden":false,"required":false,"index":false},{"name":"security_type","description":"Type of security on this network","type":"text","hidden":false,"required":false,"index":false},{"name":"rssi","description":"The current received signal strength indication (dbm)","type":"integer","hidden":false,"required":false,"index":false},{"name":"noise","description":"The current noise measurement (dBm)","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel","description":"Channel number","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel_width","description":"Channel width","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel_band","description":"Channel band","type":"integer","hidden":false,"required":false,"index":false},{"name":"transmit_rate","description":"The current transmit rate","type":"text","hidden":false,"required":false,"index":false},{"name":"mode","description":"The current operating mode for the Wi-Fi interface","type":"text","hidden":false,"required":false,"index":false}]},{"name":"wifi_survey","description":"Scan for nearby WiFi networks.","platforms":["darwin"],"columns":[{"name":"interface","description":"Name of the interface","type":"text","hidden":false,"required":false,"index":false},{"name":"ssid","description":"SSID octets of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"bssid","description":"The current basic service set identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"network_name","description":"Name of the network","type":"text","hidden":false,"required":false,"index":false},{"name":"country_code","description":"The country code (ISO/IEC 3166-1:1997) for the network","type":"text","hidden":false,"required":false,"index":false},{"name":"rssi","description":"The current received signal strength indication (dbm)","type":"integer","hidden":false,"required":false,"index":false},{"name":"noise","description":"The current noise measurement (dBm)","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel","description":"Channel number","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel_width","description":"Channel width","type":"integer","hidden":false,"required":false,"index":false},{"name":"channel_band","description":"Channel band","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"winbaseobj","description":"Lists named Windows objects in the default object directories, across all terminal services sessions. Example Windows ojbect types include Mutexes, Events, Jobs and Semaphors.","platforms":["windows"],"columns":[{"name":"session_id","description":"Terminal Services Session Id","type":"integer","hidden":false,"required":false,"index":false},{"name":"object_name","description":"Object Name","type":"text","hidden":false,"required":false,"index":false},{"name":"object_type","description":"Object Type","type":"text","hidden":false,"required":false,"index":false}]},{"name":"windows_crashes","description":"Extracted information from Windows crash logs (Minidumps).","platforms":["windows"],"columns":[{"name":"datetime","description":"Timestamp (log format) of the crash","type":"text","hidden":false,"required":false,"index":false},{"name":"module","description":"Path of the crashed module within the process","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path of the executable file for the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID of the crashed process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"tid","description":"Thread ID of the crashed thread","type":"bigint","hidden":false,"required":false,"index":false},{"name":"version","description":"File version info of the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"process_uptime","description":"Uptime of the process in seconds","type":"bigint","hidden":false,"required":false,"index":false},{"name":"stack_trace","description":"Multiple stack frames from the stack trace","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_code","description":"The Windows exception code","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_message","description":"The NTSTATUS error message associated with the exception code","type":"text","hidden":false,"required":false,"index":false},{"name":"exception_address","description":"Address (in hex) where the exception occurred","type":"text","hidden":false,"required":false,"index":false},{"name":"registers","description":"The values of the system registers","type":"text","hidden":false,"required":false,"index":false},{"name":"command_line","description":"Command-line string passed to the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"current_directory","description":"Current working directory of the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"username","description":"Username of the user who ran the crashed process","type":"text","hidden":false,"required":false,"index":false},{"name":"machine_name","description":"Name of the machine where the crash happened","type":"text","hidden":false,"required":false,"index":false},{"name":"major_version","description":"Windows major version of the machine","type":"integer","hidden":false,"required":false,"index":false},{"name":"minor_version","description":"Windows minor version of the machine","type":"integer","hidden":false,"required":false,"index":false},{"name":"build_number","description":"Windows build number of the crashing machine","type":"integer","hidden":false,"required":false,"index":false},{"name":"type","description":"Type of crash log","type":"text","hidden":false,"required":false,"index":false},{"name":"crash_path","description":"Path of the log file","type":"text","hidden":false,"required":false,"index":false}]},{"name":"windows_eventlog","description":"Table for querying all recorded Windows event logs.","platforms":["windows"],"columns":[{"name":"channel","description":"Source or channel of the event","type":"text","hidden":false,"required":true,"index":false},{"name":"datetime","description":"System time at which the event occurred","type":"text","hidden":false,"required":false,"index":false},{"name":"task","description":"Task value associated with the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"level","description":"Severity level associated with the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"provider_name","description":"Provider name of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"provider_guid","description":"Provider guid of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"computer_name","description":"Hostname of system where event was generated","type":"text","hidden":false,"required":false,"index":false},{"name":"eventid","description":"Event ID of the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"keywords","description":"A bitmask of the keywords defined in the event","type":"text","hidden":false,"required":false,"index":false},{"name":"data","description":"Data associated with the event","type":"text","hidden":false,"required":false,"index":false},{"name":"pid","description":"Process ID which emitted the event record","type":"integer","hidden":false,"required":false,"index":false},{"name":"tid","description":"Thread ID which emitted the event record","type":"integer","hidden":false,"required":false,"index":false},{"name":"time_range","description":"System time to selectively filter the events","type":"text","hidden":true,"required":false,"index":false},{"name":"timestamp","description":"Timestamp to selectively filter the events","type":"text","hidden":true,"required":false,"index":false},{"name":"xpath","description":"The custom query to filter events","type":"text","hidden":true,"required":true,"index":false}]},{"name":"windows_events","description":"Windows Event logs.","platforms":["windows"],"columns":[{"name":"time","description":"Timestamp the event was received","type":"bigint","hidden":false,"required":false,"index":false},{"name":"datetime","description":"System time at which the event occurred","type":"text","hidden":false,"required":false,"index":false},{"name":"source","description":"Source or channel of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"provider_name","description":"Provider name of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"provider_guid","description":"Provider guid of the event","type":"text","hidden":false,"required":false,"index":false},{"name":"computer_name","description":"Hostname of system where event was generated","type":"text","hidden":false,"required":false,"index":false},{"name":"eventid","description":"Event ID of the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"task","description":"Task value associated with the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"level","description":"The severity level associated with the event","type":"integer","hidden":false,"required":false,"index":false},{"name":"keywords","description":"A bitmask of the keywords defined in the event","type":"text","hidden":false,"required":false,"index":false},{"name":"data","description":"Data associated with the event","type":"text","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"windows_firewall_rules","description":"Provides the list of Windows firewall rules.","platforms":["windows"],"columns":[{"name":"name","description":"Friendly name of the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"app_name","description":"Friendly name of the application to which the rule applies","type":"text","hidden":false,"required":false,"index":false},{"name":"action","description":"Action for the rule or default setting","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"1 if the rule is enabled","type":"integer","hidden":false,"required":false,"index":false},{"name":"grouping","description":"Group to which an individual rule belongs","type":"text","hidden":false,"required":false,"index":false},{"name":"direction","description":"Direction of traffic for which the rule applies","type":"text","hidden":false,"required":false,"index":false},{"name":"protocol","description":"IP protocol of the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"local_addresses","description":"Local addresses for the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"remote_addresses","description":"Remote addresses for the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"local_ports","description":"Local ports for the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"remote_ports","description":"Remote ports for the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"icmp_types_codes","description":"ICMP types and codes for the rule","type":"text","hidden":false,"required":false,"index":false},{"name":"profile_domain","description":"1 if the rule profile type is domain","type":"integer","hidden":false,"required":false,"index":false},{"name":"profile_private","description":"1 if the rule profile type is private","type":"integer","hidden":false,"required":false,"index":false},{"name":"profile_public","description":"1 if the rule profile type is public","type":"integer","hidden":false,"required":false,"index":false},{"name":"service_name","description":"Service name property of the application","type":"text","hidden":false,"required":false,"index":false}]},{"name":"windows_optional_features","description":"Lists names and installation states of windows features. Maps to Win32_OptionalFeature WMI class.","platforms":["windows"],"columns":[{"name":"name","description":"Name of the feature","type":"text","hidden":false,"required":false,"index":false},{"name":"caption","description":"Caption of feature in settings UI","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Installation state value. 1 == Enabled, 2 == Disabled, 3 == Absent","type":"integer","hidden":false,"required":false,"index":false},{"name":"statename","description":"Installation state name. 'Enabled','Disabled','Absent'","type":"text","hidden":false,"required":false,"index":false}]},{"name":"windows_security_center","description":"The health status of Window Security features. Health values can be \"Good\", \"Poor\". \"Snoozed\", \"Not Monitored\", and \"Error\".","platforms":["windows"],"columns":[{"name":"firewall","description":"The health of the monitored Firewall (see windows_security_products)","type":"text","hidden":false,"required":false,"index":false},{"name":"autoupdate","description":"The health of the Windows Autoupdate feature","type":"text","hidden":false,"required":false,"index":false},{"name":"antivirus","description":"The health of the monitored Antivirus solution (see windows_security_products)","type":"text","hidden":false,"required":false,"index":false},{"name":"antispyware","description":"Deprecated (always 'Good').","type":"text","hidden":true,"required":false,"index":false},{"name":"internet_settings","description":"The health of the Internet Settings","type":"text","hidden":false,"required":false,"index":false},{"name":"windows_security_center_service","description":"The health of the Windows Security Center Service","type":"text","hidden":false,"required":false,"index":false},{"name":"user_account_control","description":"The health of the User Account Control (UAC) capability in Windows","type":"text","hidden":false,"required":false,"index":false}]},{"name":"windows_security_products","description":"Enumeration of registered Windows security products.","platforms":["windows"],"columns":[{"name":"type","description":"Type of security product","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of product","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"State of protection","type":"text","hidden":false,"required":false,"index":false},{"name":"state_timestamp","description":"Timestamp for the product state","type":"text","hidden":false,"required":false,"index":false},{"name":"remediation_path","description":"Remediation path","type":"text","hidden":false,"required":false,"index":false},{"name":"signatures_up_to_date","description":"1 if product signatures are up to date, else 0","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"windows_update_history","description":"Provides the history of the windows update events.","platforms":["windows"],"columns":[{"name":"client_app_id","description":"Identifier of the client application that processed an update","type":"text","hidden":false,"required":false,"index":false},{"name":"date","description":"Date and the time an update was applied","type":"bigint","hidden":false,"required":false,"index":false},{"name":"description","description":"Description of an update","type":"text","hidden":false,"required":false,"index":false},{"name":"hresult","description":"HRESULT value that is returned from the operation on an update","type":"bigint","hidden":false,"required":false,"index":false},{"name":"operation","description":"Operation on an update","type":"text","hidden":false,"required":false,"index":false},{"name":"result_code","description":"Result of an operation on an update","type":"text","hidden":false,"required":false,"index":false},{"name":"server_selection","description":"Value that indicates which server provided an update","type":"text","hidden":false,"required":false,"index":false},{"name":"service_id","description":"Service identifier of an update service that is not a Windows update","type":"text","hidden":false,"required":false,"index":false},{"name":"support_url","description":"Hyperlink to the language-specific support information for an update","type":"text","hidden":false,"required":false,"index":false},{"name":"title","description":"Title of an update","type":"text","hidden":false,"required":false,"index":false},{"name":"update_id","description":"Revision-independent identifier of an update","type":"text","hidden":false,"required":false,"index":false},{"name":"update_revision","description":"Revision number of an update","type":"bigint","hidden":false,"required":false,"index":false}]},{"name":"wmi_bios_info","description":"Lists important information from the system bios.","platforms":["windows"],"columns":[{"name":"name","description":"Name of the Bios setting","type":"text","hidden":false,"required":false,"index":false},{"name":"value","description":"Value of the Bios setting","type":"text","hidden":false,"required":false,"index":false}]},{"name":"wmi_cli_event_consumers","description":"WMI CommandLineEventConsumer, which can be used for persistence on Windows. See https://www.blackhat.com/docs/us-15/materials/us-15-Graeber-Abusing-Windows-Management-Instrumentation-WMI-To-Build-A-Persistent%20Asynchronous-And-Fileless-Backdoor-wp.pdf for more details.","platforms":["windows"],"columns":[{"name":"name","description":"Unique name of a consumer.","type":"text","hidden":false,"required":false,"index":false},{"name":"command_line_template","description":"Standard string template that specifies the process to be started. This property can be NULL, and the ExecutablePath property is used as the command line.","type":"text","hidden":false,"required":false,"index":false},{"name":"executable_path","description":"Module to execute. The string can specify the full path and file name of the module to execute, or it can specify a partial name. If a partial name is specified, the current drive and current directory are assumed.","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"The name of the class.","type":"text","hidden":false,"required":false,"index":false},{"name":"relative_path","description":"Relative path to the class or instance.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"wmi_event_filters","description":"Lists WMI event filters.","platforms":["windows"],"columns":[{"name":"name","description":"Unique identifier of an event filter.","type":"text","hidden":false,"required":false,"index":false},{"name":"query","description":"Windows Management Instrumentation Query Language (WQL) event query that specifies the set of events for consumer notification, and the specific conditions for notification.","type":"text","hidden":false,"required":false,"index":false},{"name":"query_language","description":"Query language that the query is written in.","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"The name of the class.","type":"text","hidden":false,"required":false,"index":false},{"name":"relative_path","description":"Relative path to the class or instance.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"wmi_filter_consumer_binding","description":"Lists the relationship between event consumers and filters.","platforms":["windows"],"columns":[{"name":"consumer","description":"Reference to an instance of __EventConsumer that represents the object path to a logical consumer, the recipient of an event.","type":"text","hidden":false,"required":false,"index":false},{"name":"filter","description":"Reference to an instance of __EventFilter that represents the object path to an event filter which is a query that specifies the type of event to be received.","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"The name of the class.","type":"text","hidden":false,"required":false,"index":false},{"name":"relative_path","description":"Relative path to the class or instance.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"wmi_script_event_consumers","description":"WMI ActiveScriptEventConsumer, which can be used for persistence on Windows. See https://www.blackhat.com/docs/us-15/materials/us-15-Graeber-Abusing-Windows-Management-Instrumentation-WMI-To-Build-A-Persistent%20Asynchronous-And-Fileless-Backdoor-wp.pdf for more details.","platforms":["windows"],"columns":[{"name":"name","description":"Unique identifier for the event consumer. ","type":"text","hidden":false,"required":false,"index":false},{"name":"scripting_engine","description":"Name of the scripting engine to use, for example, 'VBScript'. This property cannot be NULL.","type":"text","hidden":false,"required":false,"index":false},{"name":"script_file_name","description":"Name of the file from which the script text is read, intended as an alternative to specifying the text of the script in the ScriptText property.","type":"text","hidden":false,"required":false,"index":false},{"name":"script_text","description":"Text of the script that is expressed in a language known to the scripting engine. This property must be NULL if the ScriptFileName property is not NULL.","type":"text","hidden":false,"required":false,"index":false},{"name":"class","description":"The name of the class.","type":"text","hidden":false,"required":false,"index":false},{"name":"relative_path","description":"Relative path to the class or instance.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"xprotect_entries","description":"Database of the machine's XProtect signatures.","platforms":["darwin"],"columns":[{"name":"name","description":"Description of XProtected malware","type":"text","hidden":false,"required":false,"index":false},{"name":"launch_type","description":"Launch services content type","type":"text","hidden":false,"required":false,"index":false},{"name":"identity","description":"XProtect identity (SHA1) of content","type":"text","hidden":false,"required":false,"index":false},{"name":"filename","description":"Use this file name to match","type":"text","hidden":false,"required":false,"index":false},{"name":"filetype","description":"Use this file type to match","type":"text","hidden":false,"required":false,"index":false},{"name":"optional","description":"Match any of the identities/patterns for this XProtect name","type":"integer","hidden":false,"required":false,"index":false},{"name":"uses_pattern","description":"Uses a match pattern instead of identity","type":"integer","hidden":false,"required":false,"index":false}]},{"name":"xprotect_meta","description":"Database of the machine's XProtect browser-related signatures.","platforms":["darwin"],"columns":[{"name":"identifier","description":"Browser plugin or extension identifier","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Either plugin or extension","type":"text","hidden":false,"required":false,"index":false},{"name":"developer_id","description":"Developer identity (SHA1) of extension","type":"text","hidden":false,"required":false,"index":false},{"name":"min_version","description":"The minimum allowed plugin version.","type":"text","hidden":false,"required":false,"index":false}]},{"name":"xprotect_reports","description":"Database of XProtect matches (if user generated/sent an XProtect report).","platforms":["darwin"],"columns":[{"name":"name","description":"Description of XProtected malware","type":"text","hidden":false,"required":false,"index":false},{"name":"user_action","description":"Action taken by user after prompted","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Quarantine alert time","type":"text","hidden":false,"required":false,"index":false}]},{"name":"yara","description":"Track YARA matches for files or PIDs.","platforms":["darwin","linux","windows"],"columns":[{"name":"path","description":"The path scanned","type":"text","hidden":false,"required":true,"index":false},{"name":"matches","description":"List of YARA matches","type":"text","hidden":false,"required":false,"index":false},{"name":"count","description":"Number of YARA matches","type":"integer","hidden":false,"required":false,"index":false},{"name":"sig_group","description":"Signature group used","type":"text","hidden":false,"required":false,"index":false},{"name":"sigfile","description":"Signature file used","type":"text","hidden":false,"required":false,"index":false},{"name":"sigrule","description":"Signature strings used","type":"text","hidden":true,"required":false,"index":false},{"name":"strings","description":"Matching strings","type":"text","hidden":false,"required":false,"index":false},{"name":"tags","description":"Matching tags","type":"text","hidden":false,"required":false,"index":false},{"name":"sigurl","description":"Signature url","type":"text","hidden":true,"required":false,"index":false}]},{"name":"yara_events","description":"Track YARA matches for files specified in configuration data.","platforms":["darwin","linux","windows"],"columns":[{"name":"target_path","description":"The path scanned","type":"text","hidden":false,"required":false,"index":false},{"name":"category","description":"The category of the file","type":"text","hidden":false,"required":false,"index":false},{"name":"action","description":"Change action (UPDATE, REMOVE, etc)","type":"text","hidden":false,"required":false,"index":false},{"name":"transaction_id","description":"ID used during bulk update","type":"bigint","hidden":false,"required":false,"index":false},{"name":"matches","description":"List of YARA matches","type":"text","hidden":false,"required":false,"index":false},{"name":"count","description":"Number of YARA matches","type":"integer","hidden":false,"required":false,"index":false},{"name":"strings","description":"Matching strings","type":"text","hidden":false,"required":false,"index":false},{"name":"tags","description":"Matching tags","type":"text","hidden":false,"required":false,"index":false},{"name":"time","description":"Time of the scan","type":"bigint","hidden":false,"required":false,"index":false},{"name":"eid","description":"Event ID","type":"text","hidden":true,"required":false,"index":false}]},{"name":"ycloud_instance_metadata","description":"Yandex.Cloud instance metadata.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"instance_id","description":"Unique identifier for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"folder_id","description":"Folder identifier for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"name","description":"Name of the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Description of the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"hostname","description":"Hostname of the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"zone","description":"Availability zone of the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"ssh_public_key","description":"SSH public key. Only available if supplied at instance launch time","type":"text","hidden":false,"required":false,"index":false},{"name":"serial_port_enabled","description":"Indicates if serial port is enabled for the VM","type":"text","hidden":false,"required":false,"index":false},{"name":"metadata_endpoint","description":"Endpoint used to fetch VM metadata","type":"text","hidden":false,"required":false,"index":false}]},{"name":"yum_sources","description":"Current list of Yum repositories or software channels.","platforms":["linux"],"columns":[{"name":"name","description":"Repository name","type":"text","hidden":false,"required":false,"index":false},{"name":"baseurl","description":"Repository base URL","type":"text","hidden":false,"required":false,"index":false},{"name":"mirrorlist","description":"Mirrorlist URL","type":"text","hidden":false,"required":false,"index":false},{"name":"enabled","description":"Whether the repository is used","type":"text","hidden":false,"required":false,"index":false},{"name":"gpgcheck","description":"Whether packages are GPG checked","type":"text","hidden":false,"required":false,"index":false},{"name":"gpgkey","description":"URL to GPG key","type":"text","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"host_users","description":"Local user accounts (including domain accounts that have logged on locally (Windows)).","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"uid","description":"User ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Group ID (unsigned)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uid_signed","description":"User ID as int64 signed (Apple)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid_signed","description":"Default group ID as int64 signed (Apple)","type":"bigint","hidden":false,"required":false,"index":false},{"name":"username","description":"Username","type":"text","hidden":false,"required":false,"index":false},{"name":"description","description":"Optional user description","type":"text","hidden":false,"required":false,"index":false},{"name":"directory","description":"User's home directory","type":"text","hidden":false,"required":false,"index":false},{"name":"shell","description":"User's configured default shell","type":"text","hidden":false,"required":false,"index":false},{"name":"uuid","description":"User's UUID (Apple) or SID (Windows)","type":"text","hidden":false,"required":false,"index":false},{"name":"type","description":"Whether the account is roaming (domain), local, or a system profile","type":"text","hidden":true,"required":false,"index":false},{"name":"is_hidden","description":"IsHidden attribute set in OpenDirectory","type":"integer","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"host_groups","description":"Local system groups.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"gid","description":"Unsigned int64 group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid_signed","description":"A signed int64 version of gid","type":"bigint","hidden":false,"required":false,"index":false},{"name":"groupname","description":"Canonical local group name","type":"text","hidden":false,"required":false,"index":false},{"name":"group_sid","description":"Unique group ID","type":"text","hidden":true,"required":false,"index":false},{"name":"comment","description":"Remarks or comments associated with the group","type":"text","hidden":true,"required":false,"index":false},{"name":"is_hidden","description":"IsHidden attribute set in OpenDirectory","type":"integer","hidden":false,"required":false,"index":false},{"name":"pid_with_namespace","description":"Pids that contain a namespace","type":"integer","hidden":true,"required":false,"index":false}]},{"name":"host_processes","description":"All running processes on the host system.","platforms":["darwin","linux","windows","freebsd"],"columns":[{"name":"pid","description":"Process (or thread) ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"name","description":"The process path or shorthand argv[0]","type":"text","hidden":false,"required":false,"index":false},{"name":"path","description":"Path to executed binary","type":"text","hidden":false,"required":false,"index":false},{"name":"cmdline","description":"Complete argv","type":"text","hidden":false,"required":false,"index":false},{"name":"state","description":"Process state","type":"text","hidden":false,"required":false,"index":false},{"name":"cwd","description":"Process current working directory","type":"text","hidden":false,"required":false,"index":false},{"name":"root","description":"Process virtual root directory","type":"text","hidden":false,"required":false,"index":false},{"name":"uid","description":"Unsigned user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"gid","description":"Unsigned group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"euid","description":"Unsigned effective user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"egid","description":"Unsigned effective group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"suid","description":"Unsigned saved user ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"sgid","description":"Unsigned saved group ID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"on_disk","description":"The process path exists yes=1, no=0, unknown=-1","type":"integer","hidden":false,"required":false,"index":false},{"name":"wired_size","description":"Bytes of unpageable memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"resident_size","description":"Bytes of private memory used by process","type":"bigint","hidden":false,"required":false,"index":false},{"name":"total_size","description":"Total virtual memory size","type":"bigint","hidden":false,"required":false,"index":false},{"name":"user_time","description":"CPU time in milliseconds spent in user space","type":"bigint","hidden":false,"required":false,"index":false},{"name":"system_time","description":"CPU time in milliseconds spent in kernel space","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_bytes_read","description":"Bytes read from disk","type":"bigint","hidden":false,"required":false,"index":false},{"name":"disk_bytes_written","description":"Bytes written to disk","type":"bigint","hidden":false,"required":false,"index":false},{"name":"start_time","description":"Process start time in seconds since Epoch, in case of error -1","type":"bigint","hidden":false,"required":false,"index":false},{"name":"parent","description":"Process parent's PID","type":"bigint","hidden":false,"required":false,"index":false},{"name":"pgroup","description":"Process group","type":"bigint","hidden":false,"required":false,"index":false},{"name":"threads","description":"Number of threads used by process","type":"integer","hidden":false,"required":false,"index":false},{"name":"nice","description":"Process nice level (-20 to 20, default 0)","type":"integer","hidden":false,"required":false,"index":false},{"name":"elevated_token","description":"Process uses elevated token yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"secure_process","description":"Process is secure (IUM) yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"protection_type","description":"The protection type of the process","type":"text","hidden":true,"required":false,"index":false},{"name":"virtual_process","description":"Process is virtual (e.g. System, Registry, vmmem) yes=1, no=0","type":"integer","hidden":true,"required":false,"index":false},{"name":"elapsed_time","description":"Elapsed time in seconds this process has been running.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"handle_count","description":"Total number of handles that the process has open. This number is the sum of the handles currently opened by each thread in the process.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"percent_processor_time","description":"Returns elapsed time that all of the threads of this process used the processor to execute instructions in 100 nanoseconds ticks.","type":"bigint","hidden":true,"required":false,"index":false},{"name":"upid","description":"A 64bit pid that is never reused. Returns -1 if we couldn't gather them from the system.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"uppid","description":"The 64bit parent pid that is never reused. Returns -1 if we couldn't gather them from the system.","type":"bigint","hidden":false,"required":false,"index":false},{"name":"cpu_type","description":"Indicates the specific processor designed for installation.","type":"integer","hidden":false,"required":false,"index":false},{"name":"cpu_subtype","description":"Indicates the specific processor on which an entry may be used.","type":"integer","hidden":false,"required":false,"index":false},{"name":"translated","description":"Indicates whether the process is running under the Rosetta Translation Environment, yes=1, no=0, error=-1.","type":"integer","hidden":false,"required":false,"index":false},{"name":"cgroup_path","description":"The full hierarchical path of the process's control group","type":"text","hidden":true,"required":false,"index":false}]}] \ No newline at end of file diff --git a/x-pack/plugins/osquery/public/discover/view_results_in_discover.tsx b/x-pack/plugins/osquery/public/discover/view_results_in_discover.tsx index 2106f11b89220..127b01b5259f9 100644 --- a/x-pack/plugins/osquery/public/discover/view_results_in_discover.tsx +++ b/x-pack/plugins/osquery/public/discover/view_results_in_discover.tsx @@ -32,7 +32,7 @@ const ViewResultsInDiscoverActionComponent: React.FC<ViewResultsInDiscoverAction const { discover, application } = useKibana().services; const locator = discover?.locator; const discoverPermissions = application.capabilities.discover; - const { data: logsDataView } = useLogsDataView({ skip: !actionId }); + const { data: logsDataView } = useLogsDataView({ skip: !actionId, checkOnly: true }); const [discoverUrl, setDiscoverUrl] = useState<string>(''); @@ -125,7 +125,7 @@ const ViewResultsInDiscoverActionComponent: React.FC<ViewResultsInDiscoverAction aria-label={VIEW_IN_DISCOVER} href={discoverUrl} target="_blank" - isDisabled={!actionId} + isDisabled={!actionId || !discoverUrl.length} /> </EuiToolTip> ); diff --git a/x-pack/plugins/osquery/public/editor/osquery_tables.ts b/x-pack/plugins/osquery/public/editor/osquery_tables.ts index 9a1912479d56e..fbbdcac1834c0 100644 --- a/x-pack/plugins/osquery/public/editor/osquery_tables.ts +++ b/x-pack/plugins/osquery/public/editor/osquery_tables.ts @@ -17,7 +17,7 @@ let osqueryTables: TablesJSON | null = null; export const getOsqueryTables = () => { if (!osqueryTables) { // eslint-disable-next-line @typescript-eslint/no-var-requires - osqueryTables = normalizeTables(require('../common/schemas/osquery/v5.4.0.json')); + osqueryTables = normalizeTables(require('../common/schemas/osquery/v5.5.1.json')); } return osqueryTables; diff --git a/x-pack/plugins/osquery/public/form/results_type_field.tsx b/x-pack/plugins/osquery/public/form/results_type_field.tsx index ccc1961259c38..37fe9d9ceee38 100644 --- a/x-pack/plugins/osquery/public/form/results_type_field.tsx +++ b/x-pack/plugins/osquery/public/form/results_type_field.tsx @@ -14,7 +14,7 @@ import { EuiFlexItem, EuiText, } from '@elastic/eui'; -import { useController } from 'react-hook-form'; +import { useController, useFormState } from 'react-hook-form'; import { FormattedMessage } from '@kbn/i18n-react'; import deepEqual from 'fast-deep-equal'; import { i18n } from '@kbn/i18n'; @@ -57,18 +57,20 @@ interface ResultsTypeFieldProps { const ResultsTypeFieldComponent: React.FC<ResultsTypeFieldProps> = ({ euiFieldProps = {} }) => { const [selectedOption, setSelectedOption] = useState(SNAPSHOT_OPTION.value); + const { defaultValues } = useFormState(); + const { field: { onChange: onSnapshotChange, value: snapshotValue }, } = useController({ name: 'snapshot', - defaultValue: true, + defaultValue: defaultValues?.snapshot, }); const { field: { onChange: onRemovedChange, value: removedValue }, } = useController({ name: 'removed', - defaultValue: false, + defaultValue: defaultValues?.removed, }); const handleChange = useCallback( @@ -142,6 +144,7 @@ const ResultsTypeFieldComponent: React.FC<ResultsTypeFieldProps> = ({ euiFieldPr fullWidth > <EuiSuperSelect + data-test-subj={'resultsTypeField'} options={FIELD_OPTIONS} fullWidth valueOfSelected={selectedOption} diff --git a/x-pack/plugins/osquery/public/lens/view_results_in_lens.tsx b/x-pack/plugins/osquery/public/lens/view_results_in_lens.tsx index a61e986fd1201..247255d9ffba3 100644 --- a/x-pack/plugins/osquery/public/lens/view_results_in_lens.tsx +++ b/x-pack/plugins/osquery/public/lens/view_results_in_lens.tsx @@ -39,7 +39,8 @@ const ViewResultsInLensActionComponent: React.FC<ViewResultsInLensActionProps> = mode, }) => { const lensService = useKibana().services.lens; - const { data: logsDataView } = useLogsDataView({ skip: !actionId }); + const isLensAvailable = lensService?.canUseEditor(); + const { data: logsDataView } = useLogsDataView({ skip: !actionId, checkOnly: true }); const handleClick = useCallback( (event) => { @@ -68,6 +69,10 @@ const ViewResultsInLensActionComponent: React.FC<ViewResultsInLensActionProps> = const isDisabled = useMemo(() => !actionId || !logsDataView, [actionId, logsDataView]); + if (!isLensAvailable) { + return null; + } + if (buttonType === ViewResultsActionButtonType.button) { return ( <EuiButtonEmpty size="xs" iconType="lensApp" onClick={handleClick} isDisabled={isDisabled}> diff --git a/x-pack/plugins/osquery/public/live_queries/form/live_query_query_field.tsx b/x-pack/plugins/osquery/public/live_queries/form/live_query_query_field.tsx index 4c762ee3b1a8e..c2d5286e92a83 100644 --- a/x-pack/plugins/osquery/public/live_queries/form/live_query_query_field.tsx +++ b/x-pack/plugins/osquery/public/live_queries/form/live_query_query_field.tsx @@ -101,8 +101,7 @@ const LiveQueryQueryFieldComponent: React.FC<LiveQueryQueryFieldProps> = ({ () => !( permissions.writeLiveQueries || - permissions.runSavedQueries || - permissions.readSavedQueries + (permissions.runSavedQueries && permissions.readSavedQueries) ), [permissions.readSavedQueries, permissions.runSavedQueries, permissions.writeLiveQueries] ); diff --git a/x-pack/plugins/osquery/public/live_queries/form/pack_queries_status_table.tsx b/x-pack/plugins/osquery/public/live_queries/form/pack_queries_status_table.tsx index 52f5f0897cb31..1f38bd3d65dcb 100644 --- a/x-pack/plugins/osquery/public/live_queries/form/pack_queries_status_table.tsx +++ b/x-pack/plugins/osquery/public/live_queries/form/pack_queries_status_table.tsx @@ -49,6 +49,17 @@ const EMPTY_ARRAY: PackQueryStatusItem[] = []; const StyledEuiBasicTable = styled(EuiBasicTable)` .euiTableRow.euiTableRow-isExpandedRow > td > div { padding: 0; + border: 1px solid #d3dae6; + } + div.euiDataGrid__virtualized::-webkit-scrollbar { + display: none; + } + .euiDataGrid > div { + .euiDataGrid__scrollOverlay { + box-shadow: none; + } + border-left: 0px; + border-right: 0px; } `; diff --git a/x-pack/plugins/osquery/public/packs/form/queries_field.tsx b/x-pack/plugins/osquery/public/packs/form/queries_field.tsx index 03ab8de199269..e9456b18d5416 100644 --- a/x-pack/plugins/osquery/public/packs/form/queries_field.tsx +++ b/x-pack/plugins/osquery/public/packs/form/queries_field.tsx @@ -97,12 +97,8 @@ const QueriesFieldComponent: React.FC<QueriesFieldProps> = ({ euiFieldProps }) = draft.ecs_mapping = updatedQuery.ecs_mapping; } - if (updatedQuery.snapshot === false) { - draft.snapshot = updatedQuery.snapshot; - if (updatedQuery.removed !== undefined) { - draft.removed = updatedQuery.removed; - } - } + draft.snapshot = updatedQuery.snapshot; + draft.removed = updatedQuery.removed; return draft; }) diff --git a/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx b/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx index df08fa6d1bf9b..c9a323d1c4a5a 100644 --- a/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx +++ b/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx @@ -211,7 +211,7 @@ const ViewResultsInLensActionComponent: React.FC<ViewResultsInDiscoverActionProp }) => { const lensService = useKibana().services.lens; const isLensAvailable = lensService?.canUseEditor(); - const { data: logsDataView } = useLogsDataView({ skip: !actionId }); + const { data: logsDataView } = useLogsDataView({ skip: !actionId, checkOnly: true }); const handleClick = useCallback( (event) => { @@ -274,7 +274,7 @@ const ViewResultsInDiscoverActionComponent: React.FC<ViewResultsInDiscoverAction const { discover, application } = useKibana().services; const locator = discover?.locator; const discoverPermissions = application.capabilities.discover; - const { data: logsDataView } = useLogsDataView({ skip: !actionId }); + const { data: logsDataView } = useLogsDataView({ skip: !actionId, checkOnly: true }); const [discoverUrl, setDiscoverUrl] = useState<string>(''); diff --git a/x-pack/plugins/osquery/public/packs/queries/ecs_mapping_editor_field.tsx b/x-pack/plugins/osquery/public/packs/queries/ecs_mapping_editor_field.tsx index d8cc8f93e56ed..147150e7fb6b6 100644 --- a/x-pack/plugins/osquery/public/packs/queries/ecs_mapping_editor_field.tsx +++ b/x-pack/plugins/osquery/public/packs/queries/ecs_mapping_editor_field.tsx @@ -50,7 +50,7 @@ import { convertECSMappingToObject, } from '../../../common/schemas/common/utils'; import ECSSchema from '../../common/schemas/ecs/v8.5.0.json'; -import osquerySchema from '../../common/schemas/osquery/v5.4.0.json'; +import osquerySchema from '../../common/schemas/osquery/v5.5.1.json'; import { FieldIcon } from '../../common/lib/kibana'; import { OsqueryIcon } from '../../components/osquery_icon'; @@ -588,10 +588,10 @@ const OsqueryColumnFieldComponent: React.FC<OsqueryColumnFieldProps> = ({ rowHeight={32} isClearable singleSelection={isSingleSelection ? SINGLE_SELECTION : false} - options={(resultTypeField.value === 'field' && euiFieldProps.options) || EMPTY_ARRAY} idAria={idAria} helpText={selectedOptions[0]?.value?.description} {...euiFieldProps} + options={(resultTypeField.value === 'field' && euiFieldProps.options) || EMPTY_ARRAY} /> </EuiFlexItem> </EuiFlexGroup> diff --git a/x-pack/plugins/osquery/public/results/results_table.tsx b/x-pack/plugins/osquery/public/results/results_table.tsx index c8912328fa463..23dca7ea1e019 100644 --- a/x-pack/plugins/osquery/public/results/results_table.tsx +++ b/x-pack/plugins/osquery/public/results/results_table.tsx @@ -28,6 +28,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import React, { createContext, useEffect, useState, useCallback, useContext, useMemo } from 'react'; import type { ECSMapping } from '@kbn/osquery-io-ts-types'; import { pagePathGetters } from '@kbn/fleet-plugin/public'; +import styled from 'styled-components'; import { AddToTimelineButton } from '../timelines/add_to_timeline_button'; import { useAllResults } from './use_all_results'; import type { ResultEdges } from '../../common/search_strategy'; @@ -46,6 +47,10 @@ import { AddToCaseWrapper } from '../cases/add_to_cases'; const DataContext = createContext<ResultEdges>([]); +const StyledEuiDataGrid = styled(EuiDataGrid)` + max-height: 500px; +`; + export interface ResultsTableComponentProps { actionId: string; selectedAgent?: string; @@ -419,7 +424,7 @@ const ResultsTableComponent: React.FC<ResultsTableComponentProps> = ({ </EuiPanel> ) : ( <DataContext.Provider value={allResultsData?.edges}> - <EuiDataGrid + <StyledEuiDataGrid data-test-subj="osqueryResultsTable" aria-label="Osquery results" columns={columns} @@ -429,7 +434,6 @@ const ResultsTableComponent: React.FC<ResultsTableComponentProps> = ({ leadingControlColumns={leadingControlColumns} sorting={tableSorting} pagination={tablePagination} - height="500px" toolbarVisibility={toolbarVisibility} /> </DataContext.Provider> diff --git a/x-pack/plugins/osquery/public/routes/saved_queries/edit/tabs.tsx b/x-pack/plugins/osquery/public/routes/saved_queries/edit/tabs.tsx index 2cf2b75b8e744..81ccb30d65e10 100644 --- a/x-pack/plugins/osquery/public/routes/saved_queries/edit/tabs.tsx +++ b/x-pack/plugins/osquery/public/routes/saved_queries/edit/tabs.tsx @@ -9,9 +9,16 @@ import { EuiTabbedContent, EuiNotificationBadge } from '@elastic/eui'; import React, { useMemo } from 'react'; import type { ECSMapping } from '@kbn/osquery-io-ts-types'; +import styled from 'styled-components'; import { ResultsTable } from '../../../results/results_table'; import { ActionResultsSummary } from '../../../action_results/action_results_summary'; +const StyledEuiTabbedContent = styled(EuiTabbedContent)` + div.euiTabs { + padding-left: 8px; + } +`; + interface ResultTabsProps { actionId: string; agentIds?: string[]; @@ -64,7 +71,7 @@ const ResultTabsComponent: React.FC<ResultTabsProps> = ({ ); return ( - <EuiTabbedContent + <StyledEuiTabbedContent // TODO: extend the EuiTabbedContent component to support EuiTabs props // bottomBorder={false} tabs={tabs} diff --git a/x-pack/plugins/osquery/public/shared_components/lazy_osquery_action.tsx b/x-pack/plugins/osquery/public/shared_components/lazy_osquery_action.tsx index ff464e7782bb7..15ffbdee14c4a 100644 --- a/x-pack/plugins/osquery/public/shared_components/lazy_osquery_action.tsx +++ b/x-pack/plugins/osquery/public/shared_components/lazy_osquery_action.tsx @@ -5,21 +5,35 @@ * 2.0. */ -import React, { lazy, Suspense } from 'react'; +import React, { lazy, Suspense, useMemo } from 'react'; import ServicesWrapper from './services_wrapper'; import type { ServicesWrapperProps } from './services_wrapper'; import type { OsqueryActionProps } from './osquery_action'; +import type { AlertEcsData } from '../common/contexts'; +import { AlertAttachmentContext } from '../common/contexts'; export const getLazyOsqueryAction = + (services: ServicesWrapperProps['services']) => // eslint-disable-next-line react/display-name - (services: ServicesWrapperProps['services']) => (props: OsqueryActionProps) => { + (props: OsqueryActionProps & { ecsData?: AlertEcsData }) => { const OsqueryAction = lazy(() => import('./osquery_action')); + const { ecsData, ...restProps } = props; + const renderAction = useMemo(() => { + if (ecsData && ecsData?._id) { + return ( + <AlertAttachmentContext.Provider value={ecsData}> + <OsqueryAction {...restProps} /> + </AlertAttachmentContext.Provider> + ); + } + + return <OsqueryAction {...restProps} />; + }, [OsqueryAction, ecsData, restProps]); + return ( <Suspense fallback={null}> - <ServicesWrapper services={services}> - <OsqueryAction {...props} /> - </ServicesWrapper> + <ServicesWrapper services={services}>{renderAction}</ServicesWrapper> </Suspense> ); }; diff --git a/x-pack/plugins/osquery/public/shared_components/osquery_results/index.tsx b/x-pack/plugins/osquery/public/shared_components/osquery_results/index.tsx index 84dc4203b2924..36c09a2bce188 100644 --- a/x-pack/plugins/osquery/public/shared_components/osquery_results/index.tsx +++ b/x-pack/plugins/osquery/public/shared_components/osquery_results/index.tsx @@ -24,6 +24,7 @@ const OsqueryActionResultsComponent: React.FC<OsqueryActionResultsProps> = ({ agentIds, ruleName, alertId, + ecsData, }) => { const { data: actionsData } = useAllLiveQueries({ filterQuery: { term: { alert_ids: alertId } }, @@ -49,6 +50,7 @@ const OsqueryActionResultsComponent: React.FC<OsqueryActionResultsProps> = ({ startDate={startDate} ruleName={ruleName} agentIds={agentIds} + ecsData={ecsData} /> ); })} diff --git a/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_result.test.tsx b/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_result.test.tsx index 772df753c8978..d4573eb291d89 100644 --- a/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_result.test.tsx +++ b/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_result.test.tsx @@ -41,6 +41,9 @@ const defaultProps = { actionId: 'test-action-id', startDate: DETAILS_TIMESTAMP, queryId: '', + ecsData: { + _id: 'test', + }, }; const mockKibana = (permissionType: unknown = defaultPermissions) => { const mockedKibana = getMockedKibanaConfig(permissionType); diff --git a/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_result.tsx b/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_result.tsx index 333e09efce1fb..c48e75c44ba82 100644 --- a/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_result.tsx +++ b/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_result.tsx @@ -13,6 +13,7 @@ import type { OsqueryActionResultsProps } from './types'; import { useLiveQueryDetails } from '../../actions/use_live_query_details'; import { ATTACHED_QUERY } from '../../agents/translations'; import { PackQueriesStatusTable } from '../../live_queries/form/pack_queries_status_table'; +import { AlertAttachmentContext } from '../../common/contexts'; interface OsqueryResultProps extends Omit<OsqueryActionResultsProps, 'alertId'> { actionId: string; @@ -21,13 +22,13 @@ interface OsqueryResultProps extends Omit<OsqueryActionResultsProps, 'alertId'> } export const OsqueryResult = React.memo<OsqueryResultProps>( - ({ actionId, ruleName, agentIds, startDate }) => { + ({ actionId, ruleName, agentIds, startDate, ecsData }) => { const { data } = useLiveQueryDetails({ actionId, }); return ( - <div> + <AlertAttachmentContext.Provider value={ecsData}> <EuiSpacer size="s" /> <EuiComment username={ruleName && ruleName[0]} @@ -45,7 +46,7 @@ export const OsqueryResult = React.memo<OsqueryResultProps>( /> </EuiComment> <EuiSpacer size="s" /> - </div> + </AlertAttachmentContext.Provider> ); } ); diff --git a/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_results.test.tsx b/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_results.test.tsx index 5190d10dc1c7e..fcfa6b1a720a3 100644 --- a/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_results.test.tsx +++ b/x-pack/plugins/osquery/public/shared_components/osquery_results/osquery_results.test.tsx @@ -36,6 +36,9 @@ const defaultProps = { ruleName: ['Test-rule'], ruleActions: [{ action_type_id: 'action1' }, { action_type_id: 'action2' }], alertId: 'test-alert-id', + ecsData: { + _id: 'test', + }, }; const defaultPermissions = { diff --git a/x-pack/plugins/osquery/public/shared_components/osquery_results/test_utils.tsx b/x-pack/plugins/osquery/public/shared_components/osquery_results/test_utils.tsx index c1c991becc8ac..262a68a0b259c 100644 --- a/x-pack/plugins/osquery/public/shared_components/osquery_results/test_utils.tsx +++ b/x-pack/plugins/osquery/public/shared_components/osquery_results/test_utils.tsx @@ -52,6 +52,7 @@ export const getMockedKibanaConfig = (permissionType: unknown) => update: true, push: true, })), + getRuleIdFromEvent: jest.fn(), }, ui: { getCasesContext: jest.fn().mockImplementation(() => mockCasesContext), diff --git a/x-pack/plugins/osquery/public/shared_components/osquery_results/types.ts b/x-pack/plugins/osquery/public/shared_components/osquery_results/types.ts index 7d8d268be2830..cb4b11651ee45 100644 --- a/x-pack/plugins/osquery/public/shared_components/osquery_results/types.ts +++ b/x-pack/plugins/osquery/public/shared_components/osquery_results/types.ts @@ -5,8 +5,11 @@ * 2.0. */ +import type { AlertEcsData } from '../../common/contexts'; + export interface OsqueryActionResultsProps { agentIds?: string[]; ruleName?: string[]; alertId: string; + ecsData: AlertEcsData; } diff --git a/x-pack/plugins/osquery/public/timelines/add_to_timeline_button.tsx b/x-pack/plugins/osquery/public/timelines/add_to_timeline_button.tsx index 3d6e476bf02f1..48cd3a0ff71c1 100644 --- a/x-pack/plugins/osquery/public/timelines/add_to_timeline_button.tsx +++ b/x-pack/plugins/osquery/public/timelines/add_to_timeline_button.tsx @@ -28,7 +28,7 @@ export const AddToTimelineButton = (props: AddToTimelineButtonProps) => { const queryIds = isArray(value) ? value : [value]; const TimelineIconComponent = useCallback( (timelineComponentProps) => ( - <EuiButtonIcon iconType={'timelines'} {...timelineComponentProps} size="xs" {...iconProps} /> + <EuiButtonIcon iconType="timelines" {...timelineComponentProps} size="xs" {...iconProps} /> ), [iconProps] ); diff --git a/x-pack/plugins/osquery/scripts/roles_users/soc_manager/role.json b/x-pack/plugins/osquery/scripts/roles_users/soc_manager/role.json index adfd538923418..332a06db68314 100644 --- a/x-pack/plugins/osquery/scripts/roles_users/soc_manager/role.json +++ b/x-pack/plugins/osquery/scripts/roles_users/soc_manager/role.json @@ -17,6 +17,7 @@ "feature": { "discover": ["all"], "infrastructure": ["read"], + "indexPatterns": ["all"], "observabilityCases": ["all"], "securitySolutionCases": ["all"], "ml": ["all"], diff --git a/x-pack/plugins/osquery/server/routes/pack/create_pack_route.ts b/x-pack/plugins/osquery/server/routes/pack/create_pack_route.ts index 3dda3cdb36b0d..2726355d23dcd 100644 --- a/x-pack/plugins/osquery/server/routes/pack/create_pack_route.ts +++ b/x-pack/plugins/osquery/server/routes/pack/create_pack_route.ts @@ -19,7 +19,7 @@ import type { OsqueryAppContext } from '../../lib/osquery_app_context_services'; import { OSQUERY_INTEGRATION_NAME } from '../../../common'; import { PLUGIN_ID } from '../../../common'; import { packSavedObjectType } from '../../../common/types'; -import { convertPackQueriesToSO, convertSOQueriesToPack } from './utils'; +import { convertPackQueriesToSO, convertSOQueriesToPackConfig } from './utils'; import { getInternalSavedObjectsClient } from '../utils'; import type { PackSavedObjectAttributes } from '../../common/types'; @@ -144,10 +144,7 @@ export const createPackRoute = (router: IRouter, osqueryContext: OsqueryAppConte } set(draft, `inputs[0].config.osquery.value.packs.${packSO.attributes.name}`, { - queries: convertSOQueriesToPack(queries, { - removeMultiLines: true, - removeResultType: true, - }), + queries: convertSOQueriesToPackConfig(queries), }); return draft; diff --git a/x-pack/plugins/osquery/server/routes/pack/update_pack_route.ts b/x-pack/plugins/osquery/server/routes/pack/update_pack_route.ts index 5b0d76131ee28..984f59bb51a29 100644 --- a/x-pack/plugins/osquery/server/routes/pack/update_pack_route.ts +++ b/x-pack/plugins/osquery/server/routes/pack/update_pack_route.ts @@ -20,7 +20,11 @@ import { OSQUERY_INTEGRATION_NAME } from '../../../common'; import { packSavedObjectType } from '../../../common/types'; import type { OsqueryAppContext } from '../../lib/osquery_app_context_services'; import { PLUGIN_ID } from '../../../common'; -import { convertSOQueriesToPack, convertPackQueriesToSO } from './utils'; +import { + convertSOQueriesToPack, + convertPackQueriesToSO, + convertSOQueriesToPackConfig, +} from './utils'; import { getInternalSavedObjectsClient } from '../utils'; import type { PackSavedObjectAttributes } from '../../common/types'; @@ -283,10 +287,7 @@ export const updatePackRoute = (router: IRouter, osqueryContext: OsqueryAppConte draft, `inputs[0].config.osquery.value.packs.${updatedPackSO.attributes.name}`, { - queries: convertSOQueriesToPack(updatedPackSO.attributes.queries, { - removeMultiLines: true, - removeResultType: true, - }), + queries: convertSOQueriesToPackConfig(updatedPackSO.attributes.queries), } ); @@ -316,9 +317,7 @@ export const updatePackRoute = (router: IRouter, osqueryContext: OsqueryAppConte draft, `inputs[0].config.osquery.value.packs.${updatedPackSO.attributes.name}`, { - queries: convertSOQueriesToPack(updatedPackSO.attributes.queries, { - removeResultType: true, - }), + queries: convertSOQueriesToPackConfig(updatedPackSO.attributes.queries), } ); diff --git a/x-pack/plugins/osquery/server/routes/pack/utils.test.ts b/x-pack/plugins/osquery/server/routes/pack/utils.test.ts index 3ddb074a6edbd..662bd5aa9824c 100644 --- a/x-pack/plugins/osquery/server/routes/pack/utils.test.ts +++ b/x-pack/plugins/osquery/server/routes/pack/utils.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { convertSOQueriesToPack } from './utils'; +import { convertSOQueriesToPack, convertSOQueriesToPackConfig } from './utils'; const getTestQueries = (additionalFields?: Record<string, unknown>, packName = 'default') => ({ [packName]: { @@ -31,12 +31,13 @@ const getTestQueries = (additionalFields?: Record<string, unknown>, packName = ' }, }); -const oneLiner = { +const getOneLiner = (additionParams: Record<string, unknown>) => ({ default: { interval: 3600, query: `select u.username, p.pid, p.name, pos.local_address, pos.local_port, p.path, p.cmdline, pos.remote_address, pos.remote_port from processes as p join users as u on u.uid=p.uid join process_open_sockets as pos on pos.pid=p.pid where pos.remote_port !='0' limit 1000;`, + ...additionParams, }, -}; +}); describe('Pack utils', () => { describe('convertSOQueriesToPack', () => { @@ -44,43 +45,59 @@ describe('Pack utils', () => { const convertedQueries = convertSOQueriesToPack(getTestQueries()); expect(convertedQueries).toStrictEqual(getTestQueries()); }); - test('converts to pack with converting query to single line', () => { - const convertedQueries = convertSOQueriesToPack(getTestQueries(), { removeMultiLines: true }); - expect(convertedQueries).toStrictEqual({ - ...oneLiner, - }); - }); test('converts to object with pack names after query.id', () => { const convertedQueries = convertSOQueriesToPack(getTestQueries({ id: 'testId' })); expect(convertedQueries).toStrictEqual(getTestQueries({}, 'testId')); }); - test('converts with results snapshot set false', () => { - const convertedQueries = convertSOQueriesToPack( - getTestQueries({ snapshot: false, removed: true }), - { removeResultType: true } - ); - expect(convertedQueries).toStrictEqual(getTestQueries({ removed: true, snapshot: false })); - }); - test('converts with results snapshot set true and removed false', () => { + + test('converts with results snapshot set true and removed true', () => { const convertedQueries = convertSOQueriesToPack( - getTestQueries({ snapshot: true, removed: true }), - { removeResultType: true } + getTestQueries({ snapshot: true, removed: true }) ); - expect(convertedQueries).toStrictEqual(getTestQueries({})); + expect(convertedQueries).toStrictEqual(getTestQueries({ snapshot: true, removed: true })); }); test('converts with results snapshot set true but removed false', () => { const convertedQueries = convertSOQueriesToPack( - getTestQueries({ snapshot: true, removed: false }), - { removeResultType: true } + getTestQueries({ snapshot: true, removed: false }) ); - expect(convertedQueries).toStrictEqual(getTestQueries({})); + expect(convertedQueries).toStrictEqual(getTestQueries({ snapshot: true, removed: false })); }); test('converts with both results set to false', () => { const convertedQueries = convertSOQueriesToPack( - getTestQueries({ snapshot: false, removed: false }), - { removeResultType: true } + getTestQueries({ snapshot: false, removed: false }) ); expect(convertedQueries).toStrictEqual(getTestQueries({ removed: false, snapshot: false })); }); }); + describe('convertSOQueriesToPackConfig', () => { + test('converts to pack with converting query to single line', () => { + const convertedQueries = convertSOQueriesToPackConfig(getTestQueries()); + expect(convertedQueries).toStrictEqual(getOneLiner({})); + }); + + test('if snapshot true and removed true - return empty {}', () => { + const convertedQueries = convertSOQueriesToPackConfig( + getTestQueries({ snapshot: true, removed: true }) + ); + expect(convertedQueries).toStrictEqual(getOneLiner({})); + }); + test('if snapshot true and removed false - return empty {}', () => { + const convertedQueries = convertSOQueriesToPackConfig( + getTestQueries({ snapshot: true, removed: false }) + ); + expect(convertedQueries).toStrictEqual(getOneLiner({})); + }); + test('converts with results snapshot set false', () => { + const convertedQueries = convertSOQueriesToPackConfig( + getTestQueries({ snapshot: false, removed: true }) + ); + expect(convertedQueries).toStrictEqual(getOneLiner({ snapshot: false, removed: true })); + }); + test('converts with both results set to false', () => { + const convertedQueries = convertSOQueriesToPackConfig( + getTestQueries({ snapshot: false, removed: false }) + ); + expect(convertedQueries).toStrictEqual(getOneLiner({ removed: false, snapshot: false })); + }); + }); }); diff --git a/x-pack/plugins/osquery/server/routes/pack/utils.ts b/x-pack/plugins/osquery/server/routes/pack/utils.ts index 4342cdb3ead8e..1630f303d4f79 100644 --- a/x-pack/plugins/osquery/server/routes/pack/utils.ts +++ b/x-pack/plugins/osquery/server/routes/pack/utils.ts @@ -18,9 +18,7 @@ export const convertPackQueriesToSO = (queries) => const ecsMapping = value.ecs_mapping && convertECSMappingToArray(value.ecs_mapping); acc.push({ id: key, - ...pick(value, ['name', 'query', 'interval', 'platform', 'version']), - ...(value.snapshot !== undefined ? { snapshot: value.snapshot } : {}), - ...(value.removed !== undefined ? { removed: value.removed } : {}), + ...pick(value, ['name', 'query', 'interval', 'platform', 'version', 'snapshot', 'removed']), ...(ecsMapping ? { ecs_mapping: ecsMapping } : {}), }); @@ -39,27 +37,50 @@ export const convertPackQueriesToSO = (queries) => export const convertSOQueriesToPack = ( // @ts-expect-error update types - queries, - options?: { removeMultiLines?: boolean; removeResultType?: boolean } + queries +) => + reduce( + queries, + // eslint-disable-next-line @typescript-eslint/naming-convention + (acc, { id: queryId, ecs_mapping, query, platform, ...rest }, key) => { + const index = queryId ? queryId : key; + acc[index] = { + ...rest, + query, + ...(!isEmpty(ecs_mapping) + ? isArray(ecs_mapping) + ? { ecs_mapping: convertECSMappingToObject(ecs_mapping) } + : { ecs_mapping } + : {}), + ...(platform === DEFAULT_PLATFORM || platform === undefined ? {} : { platform }), + }; + + return acc; + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + {} as Record<string, any> + ); + +export const convertSOQueriesToPackConfig = ( + // @ts-expect-error update types + queries ) => reduce( queries, // eslint-disable-next-line @typescript-eslint/naming-convention (acc, { id: queryId, ecs_mapping, query, platform, removed, snapshot, ...rest }, key) => { - const resultType = !snapshot ? { removed, snapshot } : {}; + const resultType = snapshot === false ? { removed, snapshot } : {}; const index = queryId ? queryId : key; acc[index] = { ...rest, - query: options?.removeMultiLines ? removeMultilines(query) : query, + query: removeMultilines(query), ...(!isEmpty(ecs_mapping) ? isArray(ecs_mapping) ? { ecs_mapping: convertECSMappingToObject(ecs_mapping) } : { ecs_mapping } : {}), ...(platform === DEFAULT_PLATFORM || platform === undefined ? {} : { platform }), - ...(options?.removeResultType - ? resultType - : { ...(snapshot ? { snapshot } : {}), ...(removed ? { removed } : {}) }), + ...resultType, }; return acc; diff --git a/x-pack/plugins/osquery/tsconfig.json b/x-pack/plugins/osquery/tsconfig.json index 37070a7af748d..9d1944afbafa7 100644 --- a/x-pack/plugins/osquery/tsconfig.json +++ b/x-pack/plugins/osquery/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "exclude": ["cypress.config.ts"], "include": [ @@ -19,8 +18,9 @@ // ECS and Osquery schema files "public/common/schemas/*/**.json", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/setup_node_env/tsconfig.json" }, // add references to other TypeScript projects the plugin depends on // requiredPlugins from ./kibana.json diff --git a/x-pack/plugins/painless_lab/tsconfig.json b/x-pack/plugins/painless_lab/tsconfig.json index e0cf386193bb4..d917b78df9992 100644 --- a/x-pack/plugins/painless_lab/tsconfig.json +++ b/x-pack/plugins/painless_lab/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/dev_tools/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, diff --git a/x-pack/plugins/profiling/public/utils/formatters/as_number.ts b/x-pack/plugins/profiling/public/utils/formatters/as_number.ts index f7b67bafbf7f7..365cd876ad69e 100644 --- a/x-pack/plugins/profiling/public/utils/formatters/as_number.ts +++ b/x-pack/plugins/profiling/public/utils/formatters/as_number.ts @@ -11,18 +11,18 @@ export function asNumber(value: number): string { } value = Math.round(value * 100) / 100; - if (value < 0.01) { + if (Math.abs(value) < 0.01) { return '~0.00'; } - if (value < 1e3) { + if (Math.abs(value) < 1e3) { return value.toString(); } - if (value < 1e6) { + if (Math.abs(value) < 1e6) { return `${asNumber(value / 1e3)}k`; } - if (value < 1e9) { + if (Math.abs(value) < 1e9) { return `${asNumber(value / 1e6)}m`; } diff --git a/x-pack/plugins/profiling/server/routes/stacktrace.ts b/x-pack/plugins/profiling/server/routes/stacktrace.ts index 8c5b668e25351..1dc040c3d3f19 100644 --- a/x-pack/plugins/profiling/server/routes/stacktrace.ts +++ b/x-pack/plugins/profiling/server/routes/stacktrace.ts @@ -36,6 +36,9 @@ import { ProjectTimeQuery } from './query'; const BASE64_FRAME_ID_LENGTH = 32; +const CACHE_MAX_ITEMS = 100000; +const CACHE_TTL_MILLISECONDS = 1000 * 60 * 5; + export type EncodedStackTrace = DedotObject<{ // This field is a base64-encoded byte string. The string represents a // serialized list of frame IDs in which the order of frames are @@ -270,7 +273,10 @@ export async function mgetStackTraces({ return { stackTraces, totalFrames, stackFrameDocIDs, executableDocIDs }; } -const frameLRU = new LRUCache<StackFrameID, StackFrame>({ max: 100000 }); +const frameLRU = new LRUCache<StackFrameID, StackFrame>({ + max: CACHE_MAX_ITEMS, + maxAge: CACHE_TTL_MILLISECONDS, +}); export async function mgetStackFrames({ logger, @@ -339,7 +345,10 @@ export async function mgetStackFrames({ return stackFrames; } -const executableLRU = new LRUCache<FileID, Executable>({ max: 100000 }); +const executableLRU = new LRUCache<FileID, Executable>({ + max: CACHE_MAX_ITEMS, + maxAge: CACHE_TTL_MILLISECONDS, +}); export async function mgetExecutables({ logger, diff --git a/x-pack/plugins/profiling/tsconfig.json b/x-pack/plugins/profiling/tsconfig.json index 5b8daabf46cbe..35b9870406304 100644 --- a/x-pack/plugins/profiling/tsconfig.json +++ b/x-pack/plugins/profiling/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, }, "include": [ // add all the folders containing files to be compiled @@ -14,7 +13,7 @@ "public/**/*.tsx", "server/**/*.ts" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, diff --git a/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.test.js b/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.test.js index 63367cfd6d001..4f404ee653496 100644 --- a/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.test.js +++ b/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.test.js @@ -34,7 +34,7 @@ describe('<RemoteClusterList />', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/connection_status/connection_status.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/connection_status/connection_status.js index 5202683e3417f..73dc09898ba2c 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/connection_status/connection_status.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/connection_status/connection_status.js @@ -41,11 +41,15 @@ export function ConnectionStatus({ isConnected, mode }) { return ( <EuiFlexGroup gutterSize="s" alignItems="center"> <EuiFlexItem grow={false}> - <span className="eui-displayBlock">{icon}</span> + <span data-test-subj="remoteClusterConnectionStatusIcon" className="eui-displayBlock"> + {icon} + </span> </EuiFlexItem> <EuiFlexItem grow={false} className="remoteClustersConnectionStatus__message"> - <EuiText size="s">{message}</EuiText> + <EuiText data-test-subj="remoteClusterConnectionStatusMessage" size="s"> + {message} + </EuiText> </EuiFlexItem> {!isConnected && mode === SNIFF_MODE && ( diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js index 35c51268f71e8..83b85aaefd785 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js @@ -19,6 +19,7 @@ import { EuiInMemoryTable, EuiLink, EuiToolTip, + EuiText, } from '@elastic/eui'; import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public'; import { UIM_SHOW_DETAILS_CLICK } from '../../../constants'; @@ -205,24 +206,47 @@ export class RemoteClusterTable extends Component { defaultMessage: 'Mode', }), sortable: true, - render: (mode) => + render: (mode) => { + let modeMessage; mode === PROXY_MODE - ? mode - : i18n.translate('xpack.remoteClusters.remoteClusterList.table.sniffModeDescription', { - defaultMessage: 'default', - }), + ? (modeMessage = mode) + : (modeMessage = i18n.translate( + 'xpack.remoteClusters.remoteClusterList.table.sniffModeDescription', + { + defaultMessage: 'default', + } + )); + const modeMessageComponent = ( + <EuiFlexItem grow={false} className="remoteClustersConnectionMode__message"> + <EuiText + id="xpack.remoteClusters.remoteClusterList.table.sniffModeDescription" + data-test-subj="remoteClusterConnectionModeMessage" + size="s" + > + {modeMessage} + </EuiText> + </EuiFlexItem> + ); + return modeMessageComponent; + }, }, { field: 'mode', name: i18n.translate('xpack.remoteClusters.remoteClusterList.table.addressesColumnTitle', { defaultMessage: 'Addresses', }), + dataTestSubj: 'remoteClustersAddress', truncateText: true, render: (mode, { seeds, proxyAddress }) => { - if (mode === PROXY_MODE) { - return proxyAddress; - } - return seeds.join(', '); + const clusterAddressString = mode === PROXY_MODE ? proxyAddress : seeds.join(', '); + const connectionMode = ( + <EuiFlexItem grow={false} className="remoteClustersConnectionAddress__message"> + <EuiText data-test-subj="remoteClusterConnectionAddressMessage" size="s"> + {clusterAddressString} + </EuiText> + </EuiFlexItem> + ); + return connectionMode; }, }, { @@ -236,10 +260,16 @@ export class RemoteClusterTable extends Component { sortable: true, width: '160px', render: (mode, { connectedNodesCount, connectedSocketsCount }) => { - if (mode === PROXY_MODE) { - return connectedSocketsCount; - } - return connectedNodesCount; + const remoteNodesCount = + mode === PROXY_MODE ? connectedSocketsCount : connectedNodesCount; + const connectionMode = ( + <EuiFlexItem grow={false} className="remoteClustersNodeCount__message"> + <EuiText data-test-subj="remoteClusterNodeCountMessage" size="s"> + {remoteNodesCount} + </EuiText> + </EuiFlexItem> + ); + return connectionMode; }, }, { diff --git a/x-pack/plugins/remote_clusters/tsconfig.json b/x-pack/plugins/remote_clusters/tsconfig.json index 006c3c53c1be4..ec75eaa23f831 100644 --- a/x-pack/plugins/remote_clusters/tsconfig.json +++ b/x-pack/plugins/remote_clusters/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "__jest__/**/*", @@ -14,7 +13,7 @@ "server/**/*", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, // required plugins { "path": "../licensing/tsconfig.json" }, diff --git a/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts b/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts index eb62c4d114640..d287ec58530b9 100644 --- a/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts @@ -164,11 +164,16 @@ export class CsvGenerator { cell = '-'; } - try { - // expected values are a string of JSON where the value(s) is in an array - cell = JSON.parse(cell); - } catch (e) { - // ignore + const isIdField = tableColumn === '_id'; // _id field can not be formatted or mutated + if (!isIdField) { + try { + // unwrap the value + // expected values are a string of JSON where the value(s) is in an array + // examples: "[""Jan 1, 2020 @ 04:00:00.000""]","[""username""]" + cell = JSON.parse(cell); + } catch (e) { + // ignore + } } // We have to strip singular array values out of their array wrapper, @@ -381,6 +386,7 @@ export class CsvGenerator { break; // empty report with just the header } + // FIXME: make tabifyDocs handle the formatting, to get the same formatting logic as Discover? const formatters = this.getFormatters(table); await this.generateRows(columns, table, builder, formatters, settings); diff --git a/x-pack/plugins/reporting/server/routes/lib/get_document_payload.test.ts b/x-pack/plugins/reporting/server/routes/lib/get_document_payload.test.ts index d2ed0b86e2cce..b342b52cdb9bb 100644 --- a/x-pack/plugins/reporting/server/routes/lib/get_document_payload.test.ts +++ b/x-pack/plugins/reporting/server/routes/lib/get_document_payload.test.ts @@ -58,8 +58,8 @@ describe('getDocumentPayload', () => { contentType: 'application/pdf', content: expect.any(Readable), headers: expect.objectContaining({ - 'Content-Disposition': 'inline; filename="Some PDF report.pdf"', - 'Content-Length': 1024, + 'Content-Disposition': 'attachment; filename="Some PDF report.pdf"', + 'Content-Length': '1024', }), statusCode: 200, }) @@ -86,8 +86,8 @@ describe('getDocumentPayload', () => { contentType: 'text/csv', content: expect.any(Readable), headers: expect.objectContaining({ - 'Content-Disposition': 'inline; filename="Some CSV report.csv"', - 'Content-Length': 1024, + 'Content-Disposition': 'attachment; filename="Some CSV report.csv"', + 'Content-Length': '1024', 'kbn-csv-contains-formulas': true, 'kbn-max-size-reached': true, }), @@ -137,7 +137,7 @@ describe('getDocumentPayload', () => { contentType: 'text/plain', content: 'pending', headers: { - 'retry-after': 30, + 'retry-after': '30', }, statusCode: 503, }) diff --git a/x-pack/plugins/reporting/server/routes/lib/get_document_payload.ts b/x-pack/plugins/reporting/server/routes/lib/get_document_payload.ts index 02f1eb5dee12e..3840905f73c8b 100644 --- a/x-pack/plugins/reporting/server/routes/lib/get_document_payload.ts +++ b/x-pack/plugins/reporting/server/routes/lib/get_document_payload.ts @@ -5,12 +5,11 @@ * 2.0. */ +import { ResponseHeaders } from '@kbn/core-http-server'; import { Stream } from 'stream'; -// @ts-ignore -import contentDisposition from 'content-disposition'; +import { ReportingCore } from '../..'; import { CSV_JOB_TYPE, CSV_JOB_TYPE_DEPRECATED } from '../../../common/constants'; import { ReportApiJSON } from '../../../common/types'; -import { ReportingCore } from '../..'; import { getContentStream, statuses } from '../../lib'; import { ExportTypeDefinition } from '../../types'; import { jobsQueryFactory } from './jobs_query'; @@ -24,7 +23,7 @@ interface Payload { statusCode: number; content: string | Stream | ErrorFromPayload; contentType: string | null; - headers: Record<string, string | number>; + headers: ResponseHeaders; } type TaskRunResult = Required<ReportApiJSON>['output']; @@ -65,15 +64,16 @@ export function getDocumentPayloadFactory(reporting: ReportingCore) { const content = await getContentStream(reporting, { id, index }, { encoding }); const filename = getTitle(exportType, title); const headers = getReportingHeaders(output, exportType); + const contentType = output.content_type ?? 'text/plain'; return { content, statusCode: 200, - contentType: output.content_type, + contentType, headers: { ...headers, - 'Content-Disposition': contentDisposition(filename, { type: 'inline' }), - 'Content-Length': output.size, + 'Content-Disposition': `attachment; filename="${filename}"`, + 'Content-Length': `${output.size ?? ''}`, }, }; } @@ -99,7 +99,7 @@ export function getDocumentPayloadFactory(reporting: ReportingCore) { statusCode: 503, content: status, contentType: 'text/plain', - headers: { 'retry-after': 30 }, + headers: { 'retry-after': '30' }, }; } diff --git a/x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts b/x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts index 379454de7a0a8..fb5edc6b25f71 100644 --- a/x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts +++ b/x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts @@ -54,7 +54,7 @@ export async function downloadJobResponseHandler( statusCode: payload.statusCode, headers: { ...payload.headers, - 'content-type': payload.contentType || '', + 'content-type': payload.contentType, }, }); } catch (err) { diff --git a/x-pack/plugins/reporting/server/routes/management/integration_tests/jobs.test.ts b/x-pack/plugins/reporting/server/routes/management/integration_tests/jobs.test.ts index f46ce228fa826..dce551209c05f 100644 --- a/x-pack/plugins/reporting/server/routes/management/integration_tests/jobs.test.ts +++ b/x-pack/plugins/reporting/server/routes/management/integration_tests/jobs.test.ts @@ -268,7 +268,7 @@ describe('GET /api/reporting/jobs/download', () => { .get('/api/reporting/jobs/download/dank') .expect(200) .expect('Content-Type', 'text/plain; charset=utf-8') - .expect('content-disposition', 'inline; filename="report.csv"'); + .expect('content-disposition', 'attachment; filename="report.csv"'); }); it('succeeds when security is not there or disabled', async () => { @@ -285,7 +285,7 @@ describe('GET /api/reporting/jobs/download', () => { .get('/api/reporting/jobs/download/dope') .expect(200) .expect('Content-Type', 'text/plain; charset=utf-8') - .expect('content-disposition', 'inline; filename="report.csv"'); + .expect('content-disposition', 'attachment; filename="report.csv"'); }); it('forwards job content stream', async () => { diff --git a/x-pack/plugins/reporting/tsconfig.json b/x-pack/plugins/reporting/tsconfig.json index cb22a7d9e719a..48a0d127af970 100644 --- a/x-pack/plugins/reporting/tsconfig.json +++ b/x-pack/plugins/reporting/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*", "../../../typings/**/*"], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/discover/tsconfig.json" }, diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js index 3b2588b6d0200..1a10c9e00b64c 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js @@ -24,7 +24,7 @@ import { import { ConfirmDeleteModal } from './confirm_delete_modal'; import { flattenPanelTree } from '../../../services'; -class JobActionMenuUi extends Component { +export class JobActionMenuUi extends Component { static propTypes = { startJobs: PropTypes.func.isRequired, stopJobs: PropTypes.func.isRequired, diff --git a/x-pack/plugins/rollup/public/test/client_integration/job_create_clone.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_clone.test.js index 7a4eae8d0841f..a087cabe64d96 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/job_create_clone.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_clone.test.js @@ -26,7 +26,7 @@ describe('Cloning a rollup job through create job wizard', () => { let startMock; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); startMock = coreMock.createStart(); setHttp(startMock.http); initDocumentation(docLinksServiceMock.createStartContract()); diff --git a/x-pack/plugins/rollup/public/test/client_integration/job_create_date_histogram.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_date_histogram.test.js index 565badc85403e..be3c1f09b6257 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/job_create_date_histogram.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_date_histogram.test.js @@ -23,7 +23,7 @@ describe('Create Rollup Job, step 2: Date histogram', () => { let startMock; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); startMock = coreMock.createStart(); setHttp(startMock.http); initDocumentation(docLinksServiceMock.createStartContract()); diff --git a/x-pack/plugins/rollup/public/test/client_integration/job_create_histogram.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_histogram.test.js index 1166462a833de..af35dc9063c1a 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/job_create_histogram.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_histogram.test.js @@ -23,7 +23,7 @@ describe('Create Rollup Job, step 4: Histogram', () => { let startMock; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); startMock = coreMock.createStart(); setHttp(startMock.http); initDocumentation(docLinksServiceMock.createStartContract()); diff --git a/x-pack/plugins/rollup/public/test/client_integration/job_create_logistics.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_logistics.test.js index 540b9b7bb0dbc..c22da0d2fa476 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/job_create_logistics.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_logistics.test.js @@ -23,7 +23,7 @@ describe('Create Rollup Job, step 1: Logistics', () => { let startMock; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); startMock = coreMock.createStart(); setHttp(startMock.http); initDocumentation(docLinksServiceMock.createStartContract()); diff --git a/x-pack/plugins/rollup/public/test/client_integration/job_create_metrics.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_metrics.test.js index 9f8b108049e23..6e4ffea0367a9 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/job_create_metrics.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_metrics.test.js @@ -23,7 +23,7 @@ describe('Create Rollup Job, step 5: Metrics', () => { let startMock; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); startMock = coreMock.createStart(); setHttp(startMock.http); initDocumentation(docLinksServiceMock.createStartContract()); diff --git a/x-pack/plugins/rollup/public/test/client_integration/job_create_review.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_review.test.js index 4927233b958b9..36d33d6ab1874 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/job_create_review.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_review.test.js @@ -35,7 +35,7 @@ describe('Create Rollup Job, step 6: Review', () => { let component; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); startMock = coreMock.createStart(); setHttp(startMock.http); }); diff --git a/x-pack/plugins/rollup/public/test/client_integration/job_create_terms.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_terms.test.js index e4998d7e41ca7..6535b88311dbc 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/job_create_terms.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_terms.test.js @@ -22,7 +22,7 @@ describe('Create Rollup Job, step 3: Terms', () => { let startMock; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); startMock = coreMock.createStart(); setHttp(startMock.http); initDocumentation(docLinksServiceMock.createStartContract()); diff --git a/x-pack/plugins/rollup/public/test/client_integration/job_list.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_list.test.js index ccb177c17a14b..5cd82054ce0e4 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/job_list.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_list.test.js @@ -38,7 +38,7 @@ describe('<JobList />', () => { let startMock; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); startMock = coreMock.createStart(); setHttp(startMock.http); initDocumentation(docLinksServiceMock.createStartContract()); diff --git a/x-pack/plugins/rollup/public/test/client_integration/job_list_clone.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_list_clone.test.js index 03833cb3a02e8..20728477de7fc 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/job_list_clone.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_list_clone.test.js @@ -31,7 +31,7 @@ describe('Smoke test cloning an existing rollup job from job list', () => { let startMock; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); startMock = coreMock.createStart(); setHttp(startMock.http); }); diff --git a/x-pack/plugins/rollup/tsconfig.json b/x-pack/plugins/rollup/tsconfig.json index 252c27a66fba2..c798f98f1bed6 100644 --- a/x-pack/plugins/rollup/tsconfig.json +++ b/x-pack/plugins/rollup/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,7 +11,7 @@ "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, // required plugins { "path": "../../../src/plugins/management/tsconfig.json" }, diff --git a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts index 160e06d03e92a..abf5ec53b537c 100644 --- a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts +++ b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts @@ -68,7 +68,8 @@ export interface LifecycleAlertServices< ActionGroupIds extends string = never > { alertWithLifecycle: LifecycleAlertService<InstanceState, InstanceContext, ActionGroupIds>; - getAlertStartedDate: (alertId: string) => string | null; + getAlertStartedDate: (alertInstanceId: string) => string | null; + getAlertUuid: (alertInstanceId: string) => string | null; } export type LifecycleRuleExecutor< @@ -159,6 +160,8 @@ export const createLifecycleExecutor = const currentAlerts: Record<string, ExplicitAlertFields> = {}; + const newAlertUuids: Record<string, string> = {}; + const lifecycleAlertServices: LifecycleAlertServices< InstanceState, InstanceContext, @@ -169,6 +172,15 @@ export const createLifecycleExecutor = return alertFactory.create(id); }, getAlertStartedDate: (alertId: string) => state.trackedAlerts[alertId]?.started ?? null, + getAlertUuid: (alertId: string) => { + if (!state.trackedAlerts[alertId]) { + const alertUuid = v4(); + newAlertUuids[alertId] = alertUuid; + return alertUuid; + } + + return state.trackedAlerts[alertId].alertUuid; + }, }; const nextWrappedState = await wrappedExecutor({ @@ -203,9 +215,9 @@ export const createLifecycleExecutor = commonRuleFields ); result.forEach((hit) => { - const alertId = hit._source ? hit._source[ALERT_INSTANCE_ID] : void 0; - if (alertId && hit._source) { - trackedAlertsDataMap[alertId] = { + const alertInstanceId = hit._source ? hit._source[ALERT_INSTANCE_ID] : void 0; + if (alertInstanceId && hit._source) { + trackedAlertsDataMap[alertInstanceId] = { indexName: hit._index, fields: hit._source, }; @@ -226,10 +238,12 @@ export const createLifecycleExecutor = const isRecovered = !currentAlerts[alertId]; const isActive = !isRecovered; - const { alertUuid, started } = state.trackedAlerts[alertId] ?? { - alertUuid: v4(), - started: commonRuleFields[TIMESTAMP], - }; + const { alertUuid, started } = !isNew + ? state.trackedAlerts[alertId] + : { + alertUuid: newAlertUuids[alertId] || v4(), + started: commonRuleFields[TIMESTAMP], + }; const event: ParsedTechnicalFields & ParsedExperimentalFields = { ...alertData?.fields, @@ -249,8 +263,8 @@ export const createLifecycleExecutor = [ALERT_WORKFLOW_STATUS]: alertData?.fields[ALERT_WORKFLOW_STATUS] ?? 'open', [EVENT_KIND]: 'signal', [EVENT_ACTION]: isNew ? 'open' : isActive ? 'active' : 'close', + [TAGS]: options.rule.tags, [VERSION]: ruleDataClient.kibanaVersion, - [TAGS]: options.tags, ...(isRecovered ? { [ALERT_END]: commonRuleFields[TIMESTAMP] } : {}), }; diff --git a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts index f71c7391cec77..74f79751dd57b 100644 --- a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts +++ b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts @@ -40,6 +40,11 @@ function createRule(shouldWriteAlerts: boolean = true) { name: 'warning', }, ], + actionVariables: { + context: [], + params: [], + state: [], + }, defaultActionGroupId: 'warning', executor: async ({ services }) => { nextAlerts.forEach((alert) => { @@ -48,17 +53,17 @@ function createRule(shouldWriteAlerts: boolean = true) { nextAlerts = []; }, id: 'ruleTypeId', - minimumLicenseRequired: 'basic', isExportable: true, + minimumLicenseRequired: 'basic', name: 'ruleTypeName', producer: 'producer', - actionVariables: { - context: [], - params: [], - state: [], - }, validate: { - params: schema.object({}, { unknowns: 'allow' }), + params: schema.object( + {}, + { + unknowns: 'allow', + } + ), }, }); @@ -90,13 +95,13 @@ function createRule(shouldWriteAlerts: boolean = true) { scheduleActions.mockClear(); state = ((await type.executor({ - alertId: 'alertId', - createdBy: 'createdBy', - name: 'name', + executionId: 'b33f65d7-6e8b-4aae-8d20-c93613dec9f9', + logger: loggerMock.create(), + namespace: 'namespace', params: {}, previousStartedAt, - startedAt, rule: { + id: 'alertId', actions: [], consumer: 'consumer', createdAt, @@ -118,20 +123,16 @@ function createRule(shouldWriteAlerts: boolean = true) { services: { alertFactory, savedObjectsClient: {} as any, - uiSettingsClient: {} as any, scopedClusterClient: {} as any, - shouldWriteAlerts: () => shouldWriteAlerts, - shouldStopExecution: () => false, search: {} as any, searchSourceClient: {} as ISearchStartSearchSource, + shouldStopExecution: () => false, + shouldWriteAlerts: () => shouldWriteAlerts, + uiSettingsClient: {} as any, }, spaceId: 'spaceId', + startedAt, state, - tags: ['tags'], - updatedBy: 'updatedBy', - namespace: 'namespace', - executionId: 'b33f65d7-6e8b-4aae-8d20-c93613dec9f9', - logger: loggerMock.create(), })) ?? {}) as Record<string, any>; previousStartedAt = startedAt; diff --git a/x-pack/plugins/rule_registry/server/utils/get_common_alert_fields.ts b/x-pack/plugins/rule_registry/server/utils/get_common_alert_fields.ts index be611d8e959b2..7401186fa59e7 100644 --- a/x-pack/plugins/rule_registry/server/utils/get_common_alert_fields.ts +++ b/x-pack/plugins/rule_registry/server/utils/get_common_alert_fields.ts @@ -31,9 +31,9 @@ export const getCommonAlertFields = ( [ALERT_RULE_NAME]: options.rule.name, [ALERT_RULE_PRODUCER]: options.rule.producer, [ALERT_RULE_TYPE_ID]: options.rule.ruleTypeId, - [ALERT_RULE_UUID]: options.alertId, + [ALERT_RULE_UUID]: options.rule.id, [SPACE_IDS]: [options.spaceId], - [ALERT_RULE_TAGS]: options.tags, + [ALERT_RULE_TAGS]: options.rule.tags, [TIMESTAMP]: options.startedAt.toISOString(), }; }; diff --git a/x-pack/plugins/rule_registry/server/utils/lifecycle_alert_services.mock.ts b/x-pack/plugins/rule_registry/server/utils/lifecycle_alert_services.mock.ts index 5465e7a7922c5..a383110394da7 100644 --- a/x-pack/plugins/rule_registry/server/utils/lifecycle_alert_services.mock.ts +++ b/x-pack/plugins/rule_registry/server/utils/lifecycle_alert_services.mock.ts @@ -36,4 +36,5 @@ export const createLifecycleAlertServicesMock = < ): LifecycleAlertServices<InstanceState, InstanceContext, ActionGroupIds> => ({ alertWithLifecycle: ({ id }) => alertServices.alertFactory.create(id), getAlertStartedDate: jest.fn((id: string) => null), + getAlertUuid: jest.fn((id: string) => null), }); diff --git a/x-pack/plugins/rule_registry/server/utils/rule_executor.test_helpers.ts b/x-pack/plugins/rule_registry/server/utils/rule_executor.test_helpers.ts index 4a9ab6652ec6e..70c827942ade3 100644 --- a/x-pack/plugins/rule_registry/server/utils/rule_executor.test_helpers.ts +++ b/x-pack/plugins/rule_registry/server/utils/rule_executor.test_helpers.ts @@ -47,15 +47,13 @@ export const createDefaultAlertExecutorOptions = < updatedAt?: Date; shouldWriteAlerts?: boolean; }): RuleExecutorOptions<Params, State, InstanceState, InstanceContext, ActionGroupIds> => ({ - alertId, - createdBy: 'CREATED_BY', startedAt, - name: ruleName, rule: { + id: alertId, updatedBy: null, tags: [], name: ruleName, - createdBy: null, + createdBy: 'CREATED_BY', actions: [], enabled: true, consumer: 'CONSUMER', @@ -68,7 +66,6 @@ export const createDefaultAlertExecutorOptions = < ruleTypeId: 'RULE_TYPE_ID', ruleTypeName: 'RULE_TYPE_NAME', }, - tags: [], params, spaceId: 'SPACE_ID', services: { @@ -82,7 +79,6 @@ export const createDefaultAlertExecutorOptions = < searchSourceClient: searchSourceCommonMock, }, state, - updatedBy: null, previousStartedAt: null, namespace: undefined, executionId: 'b33f65d7-6e8b-4aae-8d20-c93613deb33f', diff --git a/x-pack/plugins/rule_registry/tsconfig.json b/x-pack/plugins/rule_registry/tsconfig.json index 810524a7a8122..e24270edc4d4b 100644 --- a/x-pack/plugins/rule_registry/tsconfig.json +++ b/x-pack/plugins/rule_registry/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -14,7 +13,7 @@ "public/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../alerting/tsconfig.json" }, diff --git a/x-pack/plugins/runtime_fields/public/components/runtime_field_editor/runtime_field_editor.test.tsx b/x-pack/plugins/runtime_fields/public/components/runtime_field_editor/runtime_field_editor.test.tsx index 4a7f8d07db7e1..7dece57a4ea10 100644 --- a/x-pack/plugins/runtime_fields/public/components/runtime_field_editor/runtime_field_editor.test.tsx +++ b/x-pack/plugins/runtime_fields/public/components/runtime_field_editor/runtime_field_editor.test.tsx @@ -37,7 +37,7 @@ describe('Runtime field editor', () => { const lastOnChangeCall = (): FormState[] => onChange.mock.calls[onChange.mock.calls.length - 1]; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/runtime_fields/tsconfig.json b/x-pack/plugins/runtime_fields/tsconfig.json index 321854e2d7bbe..6ca831aa51fdc 100644 --- a/x-pack/plugins/runtime_fields/tsconfig.json +++ b/x-pack/plugins/runtime_fields/tsconfig.json @@ -4,13 +4,12 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "public/**/*", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/es_ui_shared/tsconfig.json" }, ] diff --git a/x-pack/plugins/saved_objects_tagging/tsconfig.json b/x-pack/plugins/saved_objects_tagging/tsconfig.json index 608cdb2c793cd..7d7495aac26c7 100644 --- a/x-pack/plugins/saved_objects_tagging/tsconfig.json +++ b/x-pack/plugins/saved_objects_tagging/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, }, "include": [ "common/**/*", "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, { "path": "../../../src/plugins/management/tsconfig.json" }, diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/paths.ts b/x-pack/plugins/screenshotting/server/browsers/chromium/paths.ts index a04308c27dd8e..8ac6469696612 100644 --- a/x-pack/plugins/screenshotting/server/browsers/chromium/paths.ts +++ b/x-pack/plugins/screenshotting/server/browsers/chromium/paths.ts @@ -45,7 +45,7 @@ export class ChromiumArchivePaths { platform: 'darwin', architecture: 'x64', archiveFilename: 'chrome-mac.zip', - archiveChecksum: '5afc0d49865d55b69ea1ff65b9cc5794', + archiveChecksum: 'dd4d44ad97ba2fef5dc47d7f2a39ccaa', binaryChecksum: '4a7a663b2656d66ce975b00a30df3ab4', binaryRelativePath: 'chrome-mac/Chromium.app/Contents/MacOS/Chromium', location: 'common', diff --git a/x-pack/plugins/screenshotting/tsconfig.json b/x-pack/plugins/screenshotting/tsconfig.json index af98e0fcc3244..3d53836a43244 100644 --- a/x-pack/plugins/screenshotting/tsconfig.json +++ b/x-pack/plugins/screenshotting/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -12,8 +11,9 @@ "server/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/setup_node_env/tsconfig.json" }, { "path": "../../../src/plugins/expressions/tsconfig.json" }, { "path": "../../../src/plugins/screenshot_mode/tsconfig.json" }, { "path": "../cloud/tsconfig.json" }, diff --git a/x-pack/plugins/searchprofiler/tsconfig.json b/x-pack/plugins/searchprofiler/tsconfig.json index c53c65b812a44..9b5a054e4f4da 100644 --- a/x-pack/plugins/searchprofiler/tsconfig.json +++ b/x-pack/plugins/searchprofiler/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", "public/**/*", "server/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/es_ui_shared/tsconfig.json" }, { "path": "../../../src/plugins/dev_tools/tsconfig.json" }, diff --git a/x-pack/plugins/security/public/analytics/analytics_service.test.ts b/x-pack/plugins/security/public/analytics/analytics_service.test.ts index be13fa25c1c8d..19643e68b4203 100644 --- a/x-pack/plugins/security/public/analytics/analytics_service.test.ts +++ b/x-pack/plugins/security/public/analytics/analytics_service.test.ts @@ -57,7 +57,7 @@ describe('AnalyticsService', () => { }); it('throttle reporting of the authentication type events', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const mockCore = coreMock.createStart(); mockCore.http.post.mockResolvedValue({ signature: 'some-signature', timestamp: 1234 }); diff --git a/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts b/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts index 282bf7beb68be..f33b8659fb27f 100644 --- a/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts +++ b/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts @@ -226,4 +226,31 @@ export const kibanaFeatures = [ }, ], }), + createFeature({ + id: 'with_require_all_spaces_sub_features', + name: 'Require all spaces Sub Features', + subFeatures: [ + { + name: 'Require all spaces Sub Feature', + requireAllSpaces: true, + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + id: 'cool_toggle_1', + name: 'Cool toggle 1', + includeIn: 'read', + savedObject: { + all: [], + read: [], + }, + ui: ['cool_toggle_1-ui'], + }, + ], + }, + ], + }, + ], + }), ]; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx index 429d4f1c925d2..e6d6403460e50 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx @@ -13,6 +13,7 @@ import type { Capabilities } from '@kbn/core/public'; import { coreMock, scopedHistoryMock } from '@kbn/core/public/mocks'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { KibanaFeature } from '@kbn/features-plugin/public'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import type { Space } from '@kbn/spaces-plugin/public'; import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; @@ -186,20 +187,63 @@ function getProps({ } describe('<EditRolePage />', () => { + const coreStart = coreMock.createStart(); + + beforeEach(() => { + coreStart.application.capabilities = { + ...coreStart.application.capabilities, + roles: { + save: true, + }, + }; + }); + describe('with spaces enabled', () => { + it('can render readonly view when not enough privileges', async () => { + coreStart.application.capabilities = { + ...coreStart.application.capabilities, + roles: { + save: false, + }, + }; + + const wrapper = mountWithIntl( + <KibanaContextProvider services={coreStart}> + <EditRolePage + {...getProps({ + action: 'edit', + role: { + name: 'my custom role', + metadata: {}, + elasticsearch: { cluster: ['all'], indices: [], run_as: ['*'] }, + kibana: [{ spaces: ['*'], base: ['all'], feature: {} }], + }, + })} + /> + </KibanaContextProvider> + ); + + await waitForRender(wrapper); + + expect(wrapper.find('input[data-test-subj="roleFormNameInput"]').prop('disabled')).toBe(true); + expectReadOnlyFormButtons(wrapper); + }); + it('can render a reserved role', async () => { const wrapper = mountWithIntl( - <EditRolePage - {...getProps({ - action: 'edit', - role: { - name: 'superuser', - metadata: { _reserved: true }, - elasticsearch: { cluster: ['all'], indices: [], run_as: ['*'] }, - kibana: [{ spaces: ['*'], base: ['all'], feature: {} }], - }, - })} - /> + <KibanaContextProvider services={coreStart}> + <EditRolePage + {...getProps({ + action: 'edit', + role: { + name: 'superuser', + metadata: { _reserved: true }, + elasticsearch: { cluster: ['all'], indices: [], run_as: ['*'] }, + kibana: [{ spaces: ['*'], base: ['all'], feature: {} }], + }, + })} + /> + </KibanaContextProvider> ); await waitForRender(wrapper); @@ -207,22 +251,25 @@ describe('<EditRolePage />', () => { expect(wrapper.find('[data-test-subj="reservedRoleBadgeTooltip"]')).toHaveLength(1); expect(wrapper.find(SpaceAwarePrivilegeSection)).toHaveLength(1); expect(wrapper.find('[data-test-subj="userCannotManageSpacesCallout"]')).toHaveLength(0); + expect(wrapper.find('input[data-test-subj="roleFormNameInput"]').prop('disabled')).toBe(true); expectReadOnlyFormButtons(wrapper); }); it('can render a user defined role', async () => { const wrapper = mountWithIntl( - <EditRolePage - {...getProps({ - action: 'edit', - role: { - name: 'my custom role', - metadata: {}, - elasticsearch: { cluster: ['all'], indices: [], run_as: ['*'] }, - kibana: [{ spaces: ['*'], base: ['all'], feature: {} }], - }, - })} - /> + <KibanaContextProvider services={coreStart}> + <EditRolePage + {...getProps({ + action: 'edit', + role: { + name: 'my custom role', + metadata: {}, + elasticsearch: { cluster: ['all'], indices: [], run_as: ['*'] }, + kibana: [{ spaces: ['*'], base: ['all'], feature: {} }], + }, + })} + /> + </KibanaContextProvider> ); await waitForRender(wrapper); @@ -230,65 +277,100 @@ describe('<EditRolePage />', () => { expect(wrapper.find('[data-test-subj="reservedRoleBadgeTooltip"]')).toHaveLength(0); expect(wrapper.find(SpaceAwarePrivilegeSection)).toHaveLength(1); expect(wrapper.find('[data-test-subj="userCannotManageSpacesCallout"]')).toHaveLength(0); + expect(wrapper.find('input[data-test-subj="roleFormNameInput"]').prop('disabled')).toBe(true); expectSaveFormButtons(wrapper); }); it('can render when creating a new role', async () => { - const wrapper = mountWithIntl(<EditRolePage {...getProps({ action: 'edit' })} />); + const wrapper = mountWithIntl( + <KibanaContextProvider services={coreStart}> + <EditRolePage {...getProps({ action: 'edit' })} /> + </KibanaContextProvider> + ); await waitForRender(wrapper); expect(wrapper.find(SpaceAwarePrivilegeSection)).toHaveLength(1); expect(wrapper.find('[data-test-subj="userCannotManageSpacesCallout"]')).toHaveLength(0); + expect(wrapper.find('input[data-test-subj="roleFormNameInput"]').prop('disabled')).toBe( + false + ); expectSaveFormButtons(wrapper); }); + it('redirects back to roles when creating a new role without privileges', async () => { + coreStart.application.capabilities = { + ...coreStart.application.capabilities, + roles: { + save: false, + }, + }; + + const props = getProps({ action: 'edit' }); + const wrapper = mountWithIntl( + <KibanaContextProvider services={coreStart}> + <EditRolePage {...props} /> + </KibanaContextProvider> + ); + + await waitForRender(wrapper); + + expect(props.history.push).toHaveBeenCalledWith('/'); + }); + it('can render when cloning an existing role', async () => { const wrapper = mountWithIntl( - <EditRolePage - {...getProps({ - action: 'edit', - role: { - name: '', - metadata: { _reserved: false }, - elasticsearch: { - cluster: ['all', 'manage'], - indices: [ - { - names: ['foo*'], - privileges: ['all'], - field_security: { except: ['f'], grant: ['b*'] }, - }, - ], - run_as: ['elastic'], + <KibanaContextProvider services={coreStart}> + <EditRolePage + {...getProps({ + action: 'edit', + role: { + name: '', + metadata: { _reserved: false }, + elasticsearch: { + cluster: ['all', 'manage'], + indices: [ + { + names: ['foo*'], + privileges: ['all'], + field_security: { except: ['f'], grant: ['b*'] }, + }, + ], + run_as: ['elastic'], + }, + kibana: [{ spaces: ['*'], base: ['all'], feature: {} }], }, - kibana: [{ spaces: ['*'], base: ['all'], feature: {} }], - }, - })} - /> + })} + /> + </KibanaContextProvider> ); await waitForRender(wrapper); expect(wrapper.find(SpaceAwarePrivilegeSection)).toHaveLength(1); expect(wrapper.find('[data-test-subj="userCannotManageSpacesCallout"]')).toHaveLength(0); + expect(wrapper.find('input[data-test-subj="roleFormNameInput"]').prop('disabled')).toBe( + false + ); expectSaveFormButtons(wrapper); }); it('renders an auth error when not authorized to manage spaces', async () => { const wrapper = mountWithIntl( - <EditRolePage - {...getProps({ - action: 'edit', - canManageSpaces: false, - role: { - name: 'my custom role', - metadata: {}, - elasticsearch: { cluster: ['all'], indices: [], run_as: ['*'] }, - kibana: [{ spaces: ['*'], base: ['all'], feature: {} }], - }, - })} - /> + <KibanaContextProvider services={coreStart}> + <EditRolePage + {...getProps({ + action: 'edit', + canManageSpaces: false, + role: { + name: 'my custom role', + metadata: {}, + elasticsearch: { cluster: ['all'], indices: [], run_as: ['*'] }, + kibana: [{ spaces: ['*'], base: ['all'], feature: {} }], + }, + })} + /> + </KibanaContextProvider> ); await waitForRender(wrapper); @@ -305,19 +387,21 @@ describe('<EditRolePage />', () => { it('renders a partial read-only view when there is a transform error', async () => { const wrapper = mountWithIntl( - <EditRolePage - {...getProps({ - action: 'edit', - canManageSpaces: false, - role: { - name: 'my custom role', - metadata: {}, - elasticsearch: { cluster: ['all'], indices: [], run_as: ['*'] }, - kibana: [], - _transform_error: ['kibana'], - }, - })} - /> + <KibanaContextProvider services={coreStart}> + <EditRolePage + {...getProps({ + action: 'edit', + canManageSpaces: false, + role: { + name: 'my custom role', + metadata: {}, + elasticsearch: { cluster: ['all'], indices: [], run_as: ['*'] }, + kibana: [], + _transform_error: ['kibana'], + }, + })} + /> + </KibanaContextProvider> ); await waitForRender(wrapper); @@ -331,7 +415,11 @@ describe('<EditRolePage />', () => { const error = { response: { status: 500 } }; const getFeatures = jest.fn().mockRejectedValue(error); const props = getProps({ action: 'edit' }); - const wrapper = mountWithIntl(<EditRolePage {...props} getFeatures={getFeatures} />); + const wrapper = mountWithIntl( + <KibanaContextProvider services={coreStart}> + <EditRolePage {...props} getFeatures={getFeatures} /> + </KibanaContextProvider> + ); await waitForRender(wrapper); expect(props.fatalErrors.add).toHaveBeenLastCalledWith(error); @@ -342,7 +430,11 @@ describe('<EditRolePage />', () => { const error = { response: { status: 403 } }; const getFeatures = jest.fn().mockRejectedValue(error); const props = getProps({ action: 'edit' }); - const wrapper = mountWithIntl(<EditRolePage {...props} getFeatures={getFeatures} />); + const wrapper = mountWithIntl( + <KibanaContextProvider services={coreStart}> + <EditRolePage {...props} getFeatures={getFeatures} /> + </KibanaContextProvider> + ); await waitForRender(wrapper); expect(props.fatalErrors.add).not.toHaveBeenCalled(); @@ -356,7 +448,9 @@ describe('<EditRolePage />', () => { dataViews.getTitles = jest.fn().mockRejectedValue({ response: { status: 403 } }); const wrapper = mountWithIntl( - <EditRolePage {...{ ...getProps({ action: 'edit' }), dataViews }} /> + <KibanaContextProvider services={coreStart}> + <EditRolePage {...{ ...getProps({ action: 'edit' }), dataViews }} /> + </KibanaContextProvider> ); await waitForRender(wrapper); @@ -369,7 +463,11 @@ describe('<EditRolePage />', () => { describe('in create mode', () => { it('renders an error for existing role name', async () => { const props = getProps({ action: 'edit' }); - const wrapper = mountWithIntl(<EditRolePage {...props} />); + const wrapper = mountWithIntl( + <KibanaContextProvider services={coreStart}> + <EditRolePage {...props} /> + </KibanaContextProvider> + ); await waitForRender(wrapper); @@ -389,7 +487,11 @@ describe('<EditRolePage />', () => { it('renders an error on save of existing role name', async () => { const props = getProps({ action: 'edit' }); - const wrapper = mountWithIntl(<EditRolePage {...props} />); + const wrapper = mountWithIntl( + <KibanaContextProvider services={coreStart}> + <EditRolePage {...props} /> + </KibanaContextProvider> + ); props.rolesAPIClient.saveRole.mockRejectedValue({ body: { @@ -420,7 +522,11 @@ describe('<EditRolePage />', () => { it('does not render an error for new role name', async () => { const props = getProps({ action: 'edit' }); - const wrapper = mountWithIntl(<EditRolePage {...props} />); + const wrapper = mountWithIntl( + <KibanaContextProvider services={coreStart}> + <EditRolePage {...props} /> + </KibanaContextProvider> + ); props.rolesAPIClient.getRole.mockRejectedValue(new Error('not found')); @@ -440,7 +546,11 @@ describe('<EditRolePage />', () => { it('does not render a notification on save of new role name', async () => { const props = getProps({ action: 'edit' }); - const wrapper = mountWithIntl(<EditRolePage {...props} />); + const wrapper = mountWithIntl( + <KibanaContextProvider services={coreStart}> + <EditRolePage {...props} /> + </KibanaContextProvider> + ); props.rolesAPIClient.getRole.mockRejectedValue(new Error('not found')); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx index 9b35c7b1558f8..36d6815493c98 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx @@ -55,6 +55,7 @@ import { getExtendedRoleDeprecationNotice, prepareRoleClone, } from '../../../../common/model'; +import { useCapabilities } from '../../../components/use_capabilities'; import type { UserAPIClient } from '../../users'; import type { IndicesAPIClient } from '../indices_api_client'; import { KibanaPrivileges } from '../model'; @@ -124,7 +125,6 @@ function useIndexPatternsTitles( } fatalErrors.add(err); - throw err; }) .then((titles) => setIndexPatternsTitles(titles.filter(Boolean))); }, [fatalErrors, dataViews, notifications]); @@ -297,6 +297,7 @@ export const EditRolePage: FunctionComponent<Props> = ({ throw new Error('The dataViews plugin is required for this page, but it is not available'); } const backToRoleList = useCallback(() => history.push('/'), [history]); + const hasReadOnlyPrivileges = !useCapabilities('roles').save; // We should keep the same mutable instance of Validator for every re-render since we'll // eventually enable validation after the first time user tries to save a role. @@ -319,12 +320,19 @@ export const EditRolePage: FunctionComponent<Props> = ({ roleName ); + const isEditingExistingRole = !!roleName && action === 'edit'; + + useEffect(() => { + if (hasReadOnlyPrivileges && !isEditingExistingRole) { + backToRoleList(); + } + }, [hasReadOnlyPrivileges, isEditingExistingRole]); // eslint-disable-line react-hooks/exhaustive-deps + if (!role || !runAsUsers || !indexPatternsTitles || !privileges || !spaces || !features) { return null; } - const isEditingExistingRole = !!roleName && action === 'edit'; - const isRoleReadOnly = checkIfRoleReadOnly(role); + const isRoleReadOnly = hasReadOnlyPrivileges || checkIfRoleReadOnly(role); const isRoleReserved = checkIfRoleReserved(role); const isDeprecatedRole = checkIfRoleDeprecated(role); @@ -335,7 +343,7 @@ export const EditRolePage: FunctionComponent<Props> = ({ const props: HTMLProps<HTMLDivElement> = { tabIndex: 0, }; - if (isRoleReserved) { + if (isRoleReserved || isRoleReadOnly) { titleText = ( <FormattedMessage id="xpack.security.management.editRole.viewingRoleTitle" @@ -410,7 +418,7 @@ export const EditRolePage: FunctionComponent<Props> = ({ onChange={onNameChange} onBlur={onNameBlur} data-test-subj={'roleFormNameInput'} - readOnly={isRoleReserved || isEditingExistingRole} + disabled={isRoleReserved || isEditingExistingRole || isRoleReadOnly} isInvalid={creatingRoleAlreadyExists} /> </EuiFormRow> @@ -491,10 +499,14 @@ export const EditRolePage: FunctionComponent<Props> = ({ const getReturnToRoleListButton = () => { return ( - <EuiButton {...reactRouterNavigate(history, '')} data-test-subj="roleFormReturnButton"> + <EuiButton + {...reactRouterNavigate(history, '')} + iconType="arrowLeft" + data-test-subj="roleFormReturnButton" + > <FormattedMessage id="xpack.security.management.editRole.returnToRoleListButtonLabel" - defaultMessage="Return to role list" + defaultMessage="Back to roles" /> </EuiButton> ); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/__snapshots__/elasticsearch_privileges.test.tsx.snap b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/__snapshots__/elasticsearch_privileges.test.tsx.snap index 2c47d70b94100..e7cfef55274c0 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/__snapshots__/elasticsearch_privileges.test.tsx.snap +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/__snapshots__/elasticsearch_privileges.test.tsx.snap @@ -52,6 +52,7 @@ exports[`it renders without crashing 1`] = ` "monitor", ] } + editable={true} onChange={[Function]} role={ Object { @@ -170,6 +171,7 @@ exports[`it renders without crashing 1`] = ` "index", ] } + editable={true} indexPatterns={Array []} indicesAPIClient={ Object { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.test.tsx index 816e3f43c9ddc..b9b653e108738 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.test.tsx @@ -34,6 +34,28 @@ test('it renders without crashing', () => { expect(wrapper).toMatchSnapshot(); }); +test('it renders fields as disabled when not editable', () => { + const role: Role = { + name: '', + elasticsearch: { + cluster: [], + indices: [], + run_as: [], + }, + kibana: [], + }; + + const wrapper = shallow( + <ClusterPrivileges + role={role} + onChange={jest.fn()} + builtinClusterPrivileges={['all', 'manage', 'monitor']} + editable={false} + /> + ); + expect(wrapper.find('EuiComboBox').prop('isDisabled')).toBe(true); +}); + test('it allows for custom cluster privileges', () => { const role: Role = { name: '', diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.tsx index 6d2643c4b6998..0e44970d8ef7a 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.tsx @@ -16,16 +16,21 @@ interface Props { role: Role; builtinClusterPrivileges: string[]; onChange: (privs: string[]) => void; + editable?: boolean; } export class ClusterPrivileges extends Component<Props, {}> { + static defaultProps: Partial<Props> = { + editable: true, + }; + public render() { const availableClusterPrivileges = this.getAvailableClusterPrivileges(); return <EuiFlexGroup>{this.buildComboBox(availableClusterPrivileges)}</EuiFlexGroup>; } public buildComboBox = (items: string[]) => { - const role = this.props.role; + const { role, editable } = this.props; const options = items.map((i) => ({ label: i, @@ -41,7 +46,7 @@ export class ClusterPrivileges extends Component<Props, {}> { selectedOptions={selectedOptions} onChange={this.onClusterPrivilegesChange} onCreateOption={this.onCreateCustomPrivilege} - isDisabled={isRoleReadOnly(role)} + isDisabled={isRoleReadOnly(role) || !editable} /> </EuiFlexItem> ); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.test.tsx index 717700cc82278..52feba5ae83ad 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.test.tsx @@ -66,3 +66,10 @@ test('it renders IndexPrivileges', () => { mountWithIntl(<ElasticsearchPrivileges {...getProps()} />).find(IndexPrivileges) ).toHaveLength(1); }); + +test('it renders fields as disabled when not editable', () => { + const wrapper = shallowWithIntl(<ElasticsearchPrivileges {...getProps()} editable={false} />); + expect(wrapper.find('EuiComboBox').prop('isDisabled')).toBe(true); + expect(wrapper.find('ClusterPrivileges').prop('editable')).toBe(false); + expect(wrapper.find('IndexPrivileges').prop('editable')).toBe(false); +}); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx index 55b89d8832c75..045c4d924c426 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx @@ -66,16 +66,6 @@ export class ElasticsearchPrivileges extends Component<Props, {}> { builtinESPrivileges, } = this.props; - const indexProps = { - role, - indicesAPIClient, - validator, - indexPatterns, - license, - onChange, - availableIndexPrivileges: builtinESPrivileges.index, - }; - return ( <Fragment> <EuiDescribedFormGroup @@ -102,6 +92,7 @@ export class ElasticsearchPrivileges extends Component<Props, {}> { role={this.props.role} onChange={this.onClusterPrivilegesChange} builtinClusterPrivileges={builtinESPrivileges.cluster} + editable={editable} /> </EuiFormRow> </EuiDescribedFormGroup> @@ -171,17 +162,27 @@ export class ElasticsearchPrivileges extends Component<Props, {}> { </p> </EuiText> - <IndexPrivileges {...indexProps} /> - - <EuiHorizontalRule /> + <IndexPrivileges + role={role} + indicesAPIClient={indicesAPIClient} + validator={validator} + indexPatterns={indexPatterns} + license={license} + onChange={onChange} + availableIndexPrivileges={builtinESPrivileges.index} + editable={editable} + /> - {this.props.editable && ( - <EuiButton iconType={'plusInCircle'} onClick={this.addIndexPrivilege}> - <FormattedMessage - id="xpack.security.management.editRole.elasticSearchPrivileges.addIndexPrivilegesButtonLabel" - defaultMessage="Add index privilege" - /> - </EuiButton> + {editable && ( + <> + <EuiHorizontalRule /> + <EuiButton iconType={'plusInCircle'} onClick={this.addIndexPrivilege}> + <FormattedMessage + id="xpack.security.management.editRole.elasticSearchPrivileges.addIndexPrivilegesButtonLabel" + defaultMessage="Add index privilege" + /> + </EuiButton> + </> )} </Fragment> ); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.test.tsx index af5ef0a0ccb00..7c81bb4a00de8 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.test.tsx @@ -259,7 +259,7 @@ describe('field level security', () => { }); test('does not query for available fields when a request is already in flight', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const testProps = { ...props, diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.test.tsx index cdc8ac71fd38d..91f761d1157fa 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.test.tsx @@ -100,3 +100,49 @@ test('it renders a IndexPrivilegeForm for each privilege on the role', async () await flushPromises(); expect(wrapper.find(IndexPrivilegeForm)).toHaveLength(1); }); + +test('it renders fields as disabled when not editable', async () => { + const license = licenseMock.create(); + license.getFeatures.mockReturnValue({ + allowRoleFieldLevelSecurity: true, + allowRoleDocumentLevelSecurity: true, + } as any); + + const indicesAPIClient = indicesAPIClientMock.create(); + indicesAPIClient.getFields.mockResolvedValue(['foo']); + + const props = { + role: { + name: '', + kibana: [], + elasticsearch: { + cluster: [], + indices: [ + { + names: ['foo*'], + privileges: ['all'], + query: '*', + field_security: { + grant: ['some_field'], + }, + }, + ], + run_as: [], + }, + }, + onChange: jest.fn(), + indexPatterns: [], + editable: false, + validator: new RoleValidator(), + availableIndexPrivileges: ['all', 'read', 'write', 'index'], + indicesAPIClient, + license, + }; + const wrapper = mountWithIntl( + <KibanaContextProvider services={coreMock.createStart()}> + <IndexPrivileges {...props} /> + </KibanaContextProvider> + ); + await flushPromises(); + expect(wrapper.find('IndexPrivilegeForm').prop('isRoleReadOnly')).toBe(true); +}); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.tsx index d761992c275c9..8c8eafa6d6a2b 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.tsx @@ -24,6 +24,7 @@ interface Props { license: SecurityLicense; onChange: (role: Role) => void; validator: RoleValidator; + editable?: boolean; } interface State { @@ -33,6 +34,10 @@ interface State { } export class IndexPrivileges extends Component<Props, State> { + static defaultProps: Partial<Props> = { + editable: true, + }; + constructor(props: Props) { super(props); this.state = { @@ -54,7 +59,7 @@ export class IndexPrivileges extends Component<Props, State> { // doesn't permit FLS/DLS). allowDocumentLevelSecurity: allowRoleDocumentLevelSecurity || !isRoleEnabled(this.props.role), allowFieldLevelSecurity: allowRoleFieldLevelSecurity || !isRoleEnabled(this.props.role), - isRoleReadOnly: isRoleReadOnly(this.props.role), + isRoleReadOnly: !this.props.editable || isRoleReadOnly(this.props.role), }; const forms = indices.map((indexPrivilege: RoleIndexPrivilege, idx) => ( diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx index f3b63bf32b5ff..7f5ac97e41edf 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx @@ -107,6 +107,10 @@ describe('FeatureTable', () => { primaryFeaturePrivilege: 'none', subFeaturePrivileges: [], }, + with_require_all_spaces_sub_features: { + primaryFeaturePrivilege: 'none', + subFeaturePrivileges: [], + }, }); }); @@ -157,6 +161,14 @@ describe('FeatureTable', () => { } : { subFeaturePrivileges: [] }), }, + with_require_all_spaces_sub_features: { + primaryFeaturePrivilege: 'all', + ...(canCustomizeSubFeaturePrivileges + ? { + subFeaturePrivileges: ['cool_toggle_1'], + } + : { subFeaturePrivileges: [] }), + }, }); }); @@ -208,6 +220,10 @@ describe('FeatureTable', () => { } : { subFeaturePrivileges: [] }), }, + with_require_all_spaces_sub_features: { + primaryFeaturePrivilege: 'none', + subFeaturePrivileges: [], + }, }); }); @@ -302,6 +318,10 @@ describe('FeatureTable', () => { primaryFeaturePrivilege: 'read', subFeaturePrivileges: ['cool_all'], }, + with_require_all_spaces_sub_features: { + primaryFeaturePrivilege: 'none', + subFeaturePrivileges: [], + }, }); }); @@ -684,6 +704,10 @@ describe('FeatureTable', () => { 'cool_all', ], }, + with_require_all_spaces_sub_features: { + primaryFeaturePrivilege: 'none', + subFeaturePrivileges: [], + }, }); }); @@ -722,6 +746,10 @@ describe('FeatureTable', () => { primaryFeaturePrivilege: 'all', subFeaturePrivileges: [], }, + with_require_all_spaces_sub_features: { + primaryFeaturePrivilege: 'none', + subFeaturePrivileges: [], + }, }); }); @@ -760,6 +788,10 @@ describe('FeatureTable', () => { primaryFeaturePrivilege: 'read', subFeaturePrivileges: [], }, + with_require_all_spaces_sub_features: { + primaryFeaturePrivilege: 'none', + subFeaturePrivileges: [], + }, }); }); @@ -888,6 +920,10 @@ describe('FeatureTable', () => { primaryFeaturePrivilege: 'none', subFeaturePrivileges: [], }, + with_require_all_spaces_sub_features: { + primaryFeaturePrivilege: 'none', + subFeaturePrivileges: [], + }, }); }); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx index 505dd8e70024e..33f9f2879b4f7 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx @@ -250,6 +250,7 @@ export class FeatureTable extends Component<Props, State> { selectedFeaturePrivileges={ this.props.role.kibana[this.props.privilegeIndex].feature[feature.id] ?? [] } + allSpacesSelected={this.props.allSpacesSelected} disabled={this.props.disabled} licenseAllowsSubFeatPrivCustomization={ this.props.canCustomizeSubFeaturePrivileges diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx index 8e435dc43ef20..c7ab5a2be7890 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx @@ -49,6 +49,7 @@ describe('FeatureTableExpandedRow', () => { selectedFeaturePrivileges={['minimal_read']} onChange={jest.fn()} licenseAllowsSubFeatPrivCustomization={false} + allSpacesSelected={false} /> ); @@ -86,6 +87,7 @@ describe('FeatureTableExpandedRow', () => { selectedFeaturePrivileges={['none']} onChange={jest.fn()} licenseAllowsSubFeatPrivCustomization={true} + allSpacesSelected={false} /> ); @@ -118,6 +120,7 @@ describe('FeatureTableExpandedRow', () => { selectedFeaturePrivileges={['minimal_read']} onChange={jest.fn()} licenseAllowsSubFeatPrivCustomization={true} + allSpacesSelected={false} /> ); @@ -153,6 +156,7 @@ describe('FeatureTableExpandedRow', () => { selectedFeaturePrivileges={['read']} onChange={jest.fn()} licenseAllowsSubFeatPrivCustomization={true} + allSpacesSelected={false} /> ); @@ -186,6 +190,7 @@ describe('FeatureTableExpandedRow', () => { selectedFeaturePrivileges={['read']} onChange={jest.fn()} licenseAllowsSubFeatPrivCustomization={true} + allSpacesSelected={false} /> ); @@ -223,6 +228,7 @@ describe('FeatureTableExpandedRow', () => { selectedFeaturePrivileges={['read']} onChange={onChange} licenseAllowsSubFeatPrivCustomization={true} + allSpacesSelected={false} /> ); @@ -263,6 +269,7 @@ describe('FeatureTableExpandedRow', () => { selectedFeaturePrivileges={['minimal_read', 'cool_read', 'cool_toggle_2']} onChange={onChange} licenseAllowsSubFeatPrivCustomization={true} + allSpacesSelected={false} /> ); @@ -272,4 +279,76 @@ describe('FeatureTableExpandedRow', () => { expect(onChange).toHaveBeenCalledWith('with_sub_features', ['read']); }); + + it('require all spaces enabled and allSpacesSelected is false: option is disabled', () => { + const role = createRole([ + { + base: [], + feature: { + with_require_all_spaces_sub_features: ['cool_toggle_1'], + }, + spaces: ['foo'], + }, + ]); + + const kibanaPrivileges = createKibanaPrivileges(kibanaFeatures); + const calculator = new PrivilegeFormCalculator(kibanaPrivileges, role); + const feature = kibanaPrivileges.getSecuredFeature('with_require_all_spaces_sub_features'); + const onChange = jest.fn(); + + const wrapper = mountWithIntl( + <FeatureTableExpandedRow + feature={feature} + privilegeIndex={0} + privilegeCalculator={calculator} + selectedFeaturePrivileges={['minimal_all']} + onChange={onChange} + licenseAllowsSubFeatPrivCustomization={true} + allSpacesSelected={false} + /> + ); + + act(() => { + findTestSubject(wrapper, 'customizeSubFeaturePrivileges').simulate('click'); + }); + + const object = wrapper.find('SubFeatureForm'); + expect(object.props()).toMatchObject({ disabled: true }); + }); + + it('require all spaces enabled and allSpacesSelected is true: option is enabled', () => { + const role = createRole([ + { + base: [], + feature: { + with_require_all_spaces_sub_features: ['cool_toggle_1'], + }, + spaces: ['foo'], + }, + ]); + + const kibanaPrivileges = createKibanaPrivileges(kibanaFeatures); + const calculator = new PrivilegeFormCalculator(kibanaPrivileges, role); + const feature = kibanaPrivileges.getSecuredFeature('with_require_all_spaces_sub_features'); + const onChange = jest.fn(); + + const wrapper = mountWithIntl( + <FeatureTableExpandedRow + feature={feature} + privilegeIndex={0} + privilegeCalculator={calculator} + selectedFeaturePrivileges={['minimal_all']} + onChange={onChange} + licenseAllowsSubFeatPrivCustomization={true} + allSpacesSelected={true} + /> + ); + + act(() => { + findTestSubject(wrapper, 'customizeSubFeaturePrivileges').simulate('click'); + }); + + const object = wrapper.find('SubFeatureForm'); + expect(object.props()).toMatchObject({ disabled: false }); + }); }); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx index a0726ad2ef566..e5e28c4547374 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx @@ -21,6 +21,7 @@ interface Props { privilegeCalculator: PrivilegeFormCalculator; privilegeIndex: number; selectedFeaturePrivileges: string[]; + allSpacesSelected: boolean; disabled?: boolean; licenseAllowsSubFeatPrivCustomization: boolean; onChange: (featureId: string, featurePrivileges: string[]) => void; @@ -32,6 +33,7 @@ export const FeatureTableExpandedRow = ({ privilegeIndex, privilegeCalculator, selectedFeaturePrivileges, + allSpacesSelected, disabled, licenseAllowsSubFeatPrivCustomization, }: Props) => { @@ -110,6 +112,8 @@ export const FeatureTableExpandedRow = ({ </div> </EuiFlexItem> {feature.getSubFeatures().map((subFeature) => { + const isDisabledDueToSpaceSelection = subFeature.requireAllSpaces && !allSpacesSelected; + return ( <EuiFlexItem key={subFeature.name}> <SubFeatureForm @@ -119,7 +123,7 @@ export const FeatureTableExpandedRow = ({ subFeature={subFeature} onChange={(updatedPrivileges) => onChange(feature.id, updatedPrivileges)} selectedFeaturePrivileges={selectedFeaturePrivileges} - disabled={disabled || !isCustomizing} + disabled={disabled || !isCustomizing || isDisabledDueToSpaceSelection} /> </EuiFlexItem> ); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.tsx index d123773fed1c7..8af3bcdb2fef3 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.tsx @@ -5,7 +5,14 @@ * 2.0. */ -import { EuiButtonGroup, EuiCheckbox, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { + EuiButtonGroup, + EuiCheckbox, + EuiFlexGroup, + EuiFlexItem, + EuiIconTip, + EuiText, +} from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; @@ -33,6 +40,27 @@ export const SubFeatureForm = (props: Props) => { .getPrivilegeGroups() .filter((group) => group.privileges.length > 0); + const getTooltip = () => { + if (!props.subFeature.privilegesTooltip) { + return null; + } + const tooltipContent = ( + <EuiText> + <p>{props.subFeature.privilegesTooltip}</p> + </EuiText> + ); + return ( + <EuiIconTip + iconProps={{ + className: 'eui-alignTop', + }} + type="iInCircle" + color="subdued" + content={tooltipContent} + /> + ); + }; + if (groupsWithPrivileges.length === 0) { return null; } @@ -40,7 +68,9 @@ export const SubFeatureForm = (props: Props) => { return ( <EuiFlexGroup> <EuiFlexItem> - <EuiText size="s">{props.subFeature.name}</EuiText> + <EuiText size="s"> + {props.subFeature.name} {getTooltip()} + </EuiText> </EuiFlexItem> <EuiFlexItem>{groupsWithPrivileges.map(renderPrivilegeGroup)}</EuiFlexItem> </EuiFlexGroup> diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_calculator.test.ts b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_calculator.test.ts index a6714cb7a2d83..61be3af6eb1c8 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_calculator.test.ts +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_calculator.test.ts @@ -53,6 +53,11 @@ describe('PrivilegeSummaryCalculator', () => { primary: undefined, subFeature: [], }, + with_require_all_spaces_sub_features: { + hasCustomizedSubFeaturePrivileges: false, + primary: undefined, + subFeature: [], + }, }); }); @@ -99,6 +104,13 @@ describe('PrivilegeSummaryCalculator', () => { }), subFeature: ['cool_all', 'cool_read', 'cool_toggle_1', 'cool_toggle_2'], }, + with_require_all_spaces_sub_features: { + hasCustomizedSubFeaturePrivileges: false, + primary: expect.objectContaining({ + id: 'all', + }), + subFeature: ['cool_toggle_1'], + }, }); }); @@ -155,6 +167,13 @@ describe('PrivilegeSummaryCalculator', () => { 'cool_excluded_toggle', ], }, + with_require_all_spaces_sub_features: { + hasCustomizedSubFeaturePrivileges: false, + primary: expect.objectContaining({ + id: 'all', + }), + subFeature: ['cool_toggle_1'], + }, }); }); @@ -214,6 +233,13 @@ describe('PrivilegeSummaryCalculator', () => { 'cool_excluded_toggle', ], }, + with_require_all_spaces_sub_features: { + hasCustomizedSubFeaturePrivileges: false, + primary: expect.objectContaining({ + id: 'all', + }), + subFeature: ['cool_toggle_1'], + }, }); }); @@ -255,6 +281,13 @@ describe('PrivilegeSummaryCalculator', () => { }), subFeature: ['cool_all', 'cool_read', 'cool_toggle_1', 'cool_toggle_2'], }, + with_require_all_spaces_sub_features: { + hasCustomizedSubFeaturePrivileges: false, + primary: expect.objectContaining({ + id: 'all', + }), + subFeature: ['cool_toggle_1'], + }, }); }); @@ -294,6 +327,11 @@ describe('PrivilegeSummaryCalculator', () => { primary: undefined, subFeature: [], }, + with_require_all_spaces_sub_features: { + hasCustomizedSubFeaturePrivileges: false, + primary: undefined, + subFeature: [], + }, }); }); @@ -333,6 +371,11 @@ describe('PrivilegeSummaryCalculator', () => { primary: undefined, subFeature: [], }, + with_require_all_spaces_sub_features: { + hasCustomizedSubFeaturePrivileges: false, + primary: undefined, + subFeature: [], + }, }); }); }); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.test.tsx index d54866c88f7ef..62ad9bc83b1cc 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.test.tsx @@ -90,6 +90,15 @@ const expectNoPrivileges = (displayedPrivileges: any, expectSubFeatures: boolean }), }, }, + with_require_all_spaces_sub_features: { + '*': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'None', + ...maybeExpectSubFeaturePrivileges(expectSubFeatures, { + 'Require all spaces Sub Feature': [], + }), + }, + }, }); }; @@ -248,6 +257,15 @@ describe('PrivilegeSummaryTable', () => { }), }, }, + with_require_all_spaces_sub_features: { + '*': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'All', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + }, }); }); @@ -310,6 +328,15 @@ describe('PrivilegeSummaryTable', () => { }), }, }, + with_require_all_spaces_sub_features: { + '*': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'All', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + }, }); }); @@ -370,6 +397,15 @@ describe('PrivilegeSummaryTable', () => { }), }, }, + with_require_all_spaces_sub_features: { + 'default, space-1': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'All', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + }, }); }); @@ -432,6 +468,15 @@ describe('PrivilegeSummaryTable', () => { }), }, }, + with_require_all_spaces_sub_features: { + 'default, space-1': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'None', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': [], + }), + }, + }, }); }); @@ -522,6 +567,22 @@ describe('PrivilegeSummaryTable', () => { }), }, }, + with_require_all_spaces_sub_features: { + '*': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'Read', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + 'default, space-1': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'All', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + }, }); }); @@ -614,6 +675,22 @@ describe('PrivilegeSummaryTable', () => { }), }, }, + with_require_all_spaces_sub_features: { + '*': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'Read', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + 'default, space-1': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'Read', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + }, }); }); @@ -706,6 +783,22 @@ describe('PrivilegeSummaryTable', () => { }), }, }, + with_require_all_spaces_sub_features: { + '*': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'None', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': [], + }), + }, + 'default, space-1': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'Read', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + }, }); }); @@ -800,6 +893,22 @@ describe('PrivilegeSummaryTable', () => { }), }, }, + with_require_all_spaces_sub_features: { + '*': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'None', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': [], + }), + }, + 'default, space-1': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'None', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': [], + }), + }, + }, }); }); @@ -925,6 +1034,29 @@ describe('PrivilegeSummaryTable', () => { }), }, }, + with_require_all_spaces_sub_features: { + '*': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'Read', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + default: { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'All', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + 'space-1, space-2': { + hasCustomizedSubFeaturePrivileges: false, + primaryFeaturePrivilege: 'Read', + ...maybeExpectSubFeaturePrivileges(allowSubFeaturePrivileges, { + 'Require all spaces Sub Feature': ['Cool toggle 1'], + }), + }, + }, }); }); }); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.test.tsx index 8f10acb2403aa..71876eeed963d 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.test.tsx @@ -79,6 +79,10 @@ describe('PrivilegeSpaceForm', () => { "primaryFeaturePrivilege": "none", "subFeaturePrivileges": Array [], }, + "with_require_all_spaces_sub_features": Object { + "primaryFeaturePrivilege": "none", + "subFeaturePrivileges": Array [], + }, "with_sub_features": Object { "primaryFeaturePrivilege": "none", "subFeaturePrivileges": Array [], @@ -129,6 +133,12 @@ describe('PrivilegeSpaceForm', () => { "primaryFeaturePrivilege": "all", "subFeaturePrivileges": Array [], }, + "with_require_all_spaces_sub_features": Object { + "primaryFeaturePrivilege": "all", + "subFeaturePrivileges": Array [ + "cool_toggle_1", + ], + }, "with_sub_features": Object { "primaryFeaturePrivilege": "all", "subFeaturePrivileges": Array [ @@ -185,6 +195,10 @@ describe('PrivilegeSpaceForm', () => { "primaryFeaturePrivilege": "none", "subFeaturePrivileges": Array [], }, + "with_require_all_spaces_sub_features": Object { + "primaryFeaturePrivilege": "none", + "subFeaturePrivileges": Array [], + }, "with_sub_features": Object { "primaryFeaturePrivilege": "read", "subFeaturePrivileges": Array [ @@ -286,6 +300,10 @@ describe('PrivilegeSpaceForm', () => { "primaryFeaturePrivilege": "none", "subFeaturePrivileges": Array [], }, + "with_require_all_spaces_sub_features": Object { + "primaryFeaturePrivilege": "none", + "subFeaturePrivileges": Array [], + }, "with_sub_features": Object { "primaryFeaturePrivilege": "read", "subFeaturePrivileges": Array [ @@ -346,6 +364,7 @@ describe('PrivilegeSpaceForm', () => { with_excluded_sub_features: ['read'], no_sub_features: ['read'], with_sub_features: ['read'], + with_require_all_spaces_sub_features: ['read'], }, spaces: ['foo'], }, @@ -451,6 +470,7 @@ describe('PrivilegeSpaceForm', () => { with_excluded_sub_features: ['read'], no_sub_features: ['read'], with_sub_features: ['read'], + with_require_all_spaces_sub_features: ['read'], }, spaces: ['foo'], }, @@ -493,6 +513,7 @@ describe('PrivilegeSpaceForm', () => { no_sub_features: ['all'], no_sub_features_disabled_read: ['all'], with_sub_features: ['all'], + with_require_all_spaces_sub_features: ['all'], }, spaces: ['foo'], }, @@ -569,6 +590,7 @@ describe('PrivilegeSpaceForm', () => { no_sub_features: ['read'], no_sub_features_require_all_space: ['read'], with_sub_features: ['read'], + with_require_all_spaces_sub_features: ['read'], }, spaces: ['foo'], }, @@ -613,6 +635,7 @@ describe('PrivilegeSpaceForm', () => { with_excluded_sub_features: ['all'], no_sub_features: ['all'], with_sub_features: ['all'], + with_require_all_spaces_sub_features: ['all'], }, spaces: ['foo'], }, @@ -671,6 +694,7 @@ describe('PrivilegeSpaceForm', () => { no_sub_features: ['all'], no_sub_features_require_all_space: ['all'], with_sub_features: ['all'], + with_require_all_spaces_sub_features: ['all'], }, spaces: ['*'], }, diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.tsx index a26b9587d450a..d0120d64fa5ed 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.tsx @@ -24,6 +24,7 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; +import { remove } from 'lodash'; import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; @@ -472,9 +473,22 @@ export class PrivilegeSpaceForm extends Component<Props, State> { const primaryFeaturePrivilege = securedFeature ?.getPrimaryFeaturePrivileges({ includeMinimalFeaturePrivileges: true }) .find((pfp) => privileges.includes(pfp.id)) ?? { disabled: false, requireAllSpaces: false }; + + const areAllSpacesSelected = selectedSpaceIds.includes(ALL_SPACES_ID); + if (securedFeature) { + securedFeature.getSubFeatures().forEach((subFeature) => { + subFeature.privileges.forEach((currentPrivilege) => { + if (privileges.includes(currentPrivilege.id)) { + if (subFeature.requireAllSpaces && !areAllSpacesSelected) { + remove(privileges, (privilege) => privilege === currentPrivilege.id); + } + } + }); + }); + } const newFeaturePrivileges = primaryFeaturePrivilege?.disabled || - (primaryFeaturePrivilege?.requireAllSpaces && !selectedSpaceIds.includes(ALL_SPACES_ID)) + (primaryFeaturePrivilege?.requireAllSpaces && !areAllSpacesSelected) ? [] // The primary feature privilege cannot be selected; remove that and any selected sub-feature privileges, too : privileges; return { @@ -536,7 +550,12 @@ export class PrivilegeSpaceForm extends Component<Props, State> { newPrivileges = [nextFeaturePrivilege.id]; feature.getSubFeaturePrivileges().forEach((psf) => { if (Array.isArray(privileges) && privileges.includes(psf.id)) { - newPrivileges.push(psf.id); + if ( + !psf.requireAllSpaces || + (psf.requireAllSpaces && this.state.selectedSpaceIds.includes(ALL_SPACES_ID)) + ) { + newPrivileges.push(psf.id); + } } }); } diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.test.tsx index beaaf783f2f4d..8152a21bd931c 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.test.tsx @@ -87,6 +87,13 @@ describe('<SpaceAwarePrivilegeSection>', () => { expect(table).toHaveLength(0); }); + it('hides "Add space privilege" button if not editable', () => { + const props = buildProps(); + + const wrapper = mountWithIntl(<SpaceAwarePrivilegeSection {...props} editable={false} />); + expect(wrapper.find('button[data-test-subj="addSpacePrivilegeButton"]')).toHaveLength(0); + }); + it('Renders flyout after clicking "Add space privilege" button', () => { const props = buildProps({ role: { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.tsx index 84ba0c7020efb..b01f71e9aa4de 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.tsx @@ -180,7 +180,7 @@ export class SpaceAwarePrivilegeSection extends Component<Props, State> { /> </h2> } - titleSize={'s'} + titleSize="xs" actions={this.getAvailablePrivilegeButtons(false)} /> ); @@ -194,20 +194,21 @@ export class SpaceAwarePrivilegeSection extends Component<Props, State> { return null; } - const addPrivilegeButton = ( - <EuiButton - color="primary" - onClick={this.addSpacePrivilege} - iconType={'plusInCircle'} - data-test-subj={'addSpacePrivilegeButton'} - isDisabled={!hasAvailableSpaces || !this.props.editable} - > - <FormattedMessage - id="xpack.security.management.editRole.spacePrivilegeSection.addSpacePrivilegeButton" - defaultMessage="Add Kibana privilege" - /> - </EuiButton> - ); + const addPrivilegeButton = + !hasAvailableSpaces || !this.props.editable ? null : ( + <EuiButton + color="primary" + onClick={this.addSpacePrivilege} + iconType={'plusInCircle'} + data-test-subj={'addSpacePrivilegeButton'} + isDisabled={!hasAvailableSpaces || !this.props.editable} + > + <FormattedMessage + id="xpack.security.management.editRole.spacePrivilegeSection.addSpacePrivilegeButton" + defaultMessage="Add Kibana privilege" + /> + </EuiButton> + ); if (!hasPrivilegesAssigned) { return addPrivilegeButton; diff --git a/x-pack/plugins/security/public/management/roles/model/secured_sub_feature.ts b/x-pack/plugins/security/public/management/roles/model/secured_sub_feature.ts index 1f76b17a39e59..8c312ee7ea772 100644 --- a/x-pack/plugins/security/public/management/roles/model/secured_sub_feature.ts +++ b/x-pack/plugins/security/public/management/roles/model/secured_sub_feature.ts @@ -13,6 +13,7 @@ import { SubFeaturePrivilegeGroup } from './sub_feature_privilege_group'; export class SecuredSubFeature extends SubFeature { public readonly privileges: SubFeaturePrivilege[]; + public readonly privilegesTooltip: string; constructor( config: SubFeatureConfig, @@ -20,6 +21,8 @@ export class SecuredSubFeature extends SubFeature { ) { super(config); + this.privilegesTooltip = config.privilegesTooltip || ''; + this.privileges = []; for (const privilege of this.privilegeIterator()) { this.privileges.push(privilege); diff --git a/x-pack/plugins/security/public/management/roles/model/sub_feature_privilege.ts b/x-pack/plugins/security/public/management/roles/model/sub_feature_privilege.ts index 45a51a45533c1..b5897654a6a38 100644 --- a/x-pack/plugins/security/public/management/roles/model/sub_feature_privilege.ts +++ b/x-pack/plugins/security/public/management/roles/model/sub_feature_privilege.ts @@ -20,4 +20,8 @@ export class SubFeaturePrivilege extends KibanaPrivilege { public get name() { return this.subPrivilegeConfig.name; } + + public get requireAllSpaces() { + return this.subPrivilegeConfig.requireAllSpaces ?? false; + } } diff --git a/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.test.tsx b/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.test.tsx index ac0ce12aac3d9..57a3a5aa8ad03 100644 --- a/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.test.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.test.tsx @@ -234,4 +234,22 @@ describe('<RolesGridPage />', () => { }, ]); }); + + it('hides controls when `readOnly` is enabled', async () => { + const wrapper = mountWithIntl( + <RolesGridPage + rolesAPIClient={apiClientMock} + history={history} + notifications={coreMock.createStart().notifications} + readOnly + /> + ); + const initialIconCount = wrapper.find(EuiIcon).length; + + await waitForRender(wrapper, (updatedWrapper) => { + return updatedWrapper.find(EuiIcon).length > initialIconCount; + }); + + expect(findTestSubject(wrapper, 'createRoleButton')).toHaveLength(0); + }); }); diff --git a/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.tsx b/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.tsx index 89b7dea7cad1e..8b5631328f6f7 100644 --- a/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.tsx @@ -46,6 +46,7 @@ interface Props { notifications: NotificationsStart; rolesAPIClient: PublicMethodsOf<RolesAPIClient>; history: ScopedHistory; + readOnly?: boolean; } interface State { @@ -63,6 +64,10 @@ const getRoleManagementHref = (action: 'edit' | 'clone', roleName?: string) => { }; export class RolesGridPage extends Component<Props, State> { + static defaultProps: Partial<Props> = { + readOnly: false, + }; + private tableRef: React.RefObject<EuiInMemoryTable<Role>>; constructor(props: Props) { super(props); @@ -106,19 +111,23 @@ export class RolesGridPage extends Component<Props, State> { defaultMessage="Apply roles to groups of users and manage permissions across the stack." /> } - rightSideItems={[ - <EuiButton - data-test-subj="createRoleButton" - {...reactRouterNavigate(this.props.history, getRoleManagementHref('edit'))} - fill - iconType="plusInCircleFilled" - > - <FormattedMessage - id="xpack.security.management.roles.createRoleButtonLabel" - defaultMessage="Create role" - /> - </EuiButton>, - ]} + rightSideItems={ + this.props.readOnly + ? undefined + : [ + <EuiButton + data-test-subj="createRoleButton" + {...reactRouterNavigate(this.props.history, getRoleManagementHref('edit'))} + fill + iconType="plusInCircleFilled" + > + <FormattedMessage + id="xpack.security.management.roles.createRoleButtonLabel" + defaultMessage="Create role" + /> + </EuiButton>, + ] + } /> <EuiSpacer size="l" /> @@ -139,11 +148,16 @@ export class RolesGridPage extends Component<Props, State> { responsive={false} columns={this.getColumnConfig()} hasActions={true} - selection={{ - selectable: (role: Role) => !role.metadata || !role.metadata._reserved, - selectableMessage: (selectable: boolean) => (!selectable ? 'Role is reserved' : ''), - onSelectionChange: (selection: Role[]) => this.setState({ selection }), - }} + selection={ + this.props.readOnly + ? undefined + : { + selectable: (role: Role) => !role.metadata || !role.metadata._reserved, + selectableMessage: (selectable: boolean) => + !selectable ? 'Role is reserved' : '', + onSelectionChange: (selection: Role[]) => this.setState({ selection }), + } + } pagination={{ initialPageSize: 20, pageSizeOptions: [10, 20, 30, 50, 100], @@ -188,7 +202,7 @@ export class RolesGridPage extends Component<Props, State> { }; private getColumnConfig = () => { - return [ + const config: Array<EuiBasicTableColumn<Role>> = [ { field: 'name', name: i18n.translate('xpack.security.management.roles.nameColumnName', { @@ -218,7 +232,10 @@ export class RolesGridPage extends Component<Props, State> { return this.getRoleStatusBadges(record); }, }, - { + ]; + + if (!this.props.readOnly) { + config.push({ name: i18n.translate('xpack.security.management.roles.actionsColumnName', { defaultMessage: 'Actions', }), @@ -289,7 +306,7 @@ export class RolesGridPage extends Component<Props, State> { }, { available: (role: Role) => !isRoleReadOnly(role), - enable: () => this.state.selection.length === 0, + enabled: () => this.state.selection.length === 0, isPrimary: true, render: (role: Role) => { const title = i18n.translate('xpack.security.management.roles.editRoleActionName', { @@ -321,8 +338,10 @@ export class RolesGridPage extends Component<Props, State> { }, }, ], - }, - ] as Array<EuiBasicTableColumn<Role>>; + }); + } + + return config; }; private getVisibleRoles = (roles: Role[], filter: string, includeReservedRoles: boolean) => { diff --git a/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx b/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx index a6e06351f38c9..f1536631a66e7 100644 --- a/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx @@ -32,6 +32,12 @@ async function mountApp(basePath: string, pathname: string) { const featuresStart = featuresPluginMock.createStart(); const coreStart = coreMock.createStart(); + coreStart.application.capabilities = { + ...coreStart.application.capabilities, + roles: { + save: true, + }, + }; let unmount: Unmount = noop; await act(async () => { @@ -84,7 +90,7 @@ describe('rolesManagementApp', () => { expect(docTitle.reset).not.toHaveBeenCalled(); expect(container).toMatchInlineSnapshot(` <div> - Roles Page: {"notifications":{"toasts":{}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/","search":"","hash":""}}} + Roles Page: {"notifications":{"toasts":{}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/","search":"","hash":""}},"readOnly":false} </div> `); @@ -106,7 +112,7 @@ describe('rolesManagementApp', () => { expect(docTitle.reset).not.toHaveBeenCalled(); expect(container).toMatchInlineSnapshot(` <div> - Role Edit Page: {"action":"edit","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"fieldCache":{},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit","search":"","hash":""}}} + Role Edit Page: {"action":"edit","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"fieldCache":{},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{},"roles":{"save":true}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit","search":"","hash":""}}} </div> `); @@ -133,7 +139,7 @@ describe('rolesManagementApp', () => { expect(docTitle.reset).not.toHaveBeenCalled(); expect(container).toMatchInlineSnapshot(` <div> - Role Edit Page: {"action":"edit","roleName":"role@name","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"fieldCache":{},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit/role@name","search":"","hash":""}}} + Role Edit Page: {"action":"edit","roleName":"role@name","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"fieldCache":{},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{},"roles":{"save":true}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit/role@name","search":"","hash":""}}} </div> `); @@ -160,7 +166,7 @@ describe('rolesManagementApp', () => { expect(docTitle.reset).not.toHaveBeenCalled(); expect(container).toMatchInlineSnapshot(` <div> - Role Edit Page: {"action":"clone","roleName":"someRoleName","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"fieldCache":{},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/clone/someRoleName","search":"","hash":""}}} + Role Edit Page: {"action":"clone","roleName":"someRoleName","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"fieldCache":{},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{},"roles":{"save":true}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/clone/someRoleName","search":"","hash":""}}} </div> `); diff --git a/x-pack/plugins/security/public/management/roles/roles_management_app.tsx b/x-pack/plugins/security/public/management/roles/roles_management_app.tsx index e0939d5cbf48b..30ddeb590042a 100644 --- a/x-pack/plugins/security/public/management/roles/roles_management_app.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_management_app.tsx @@ -21,6 +21,7 @@ import { createBreadcrumbsChangeHandler, } from '../../components/breadcrumb'; import type { PluginStartDependencies } from '../../plugin'; +import { ReadonlyBadge } from '../badges/readonly_badge'; import { tryDecodeURIComponent } from '../url_utils'; interface CreateParams { @@ -118,6 +119,12 @@ export const rolesManagementApp = Object.freeze({ <i18nStart.Context> <KibanaThemeProvider theme$={theme$}> <Router history={history}> + <ReadonlyBadge + featureId="roles" + tooltip={i18n.translate('xpack.security.management.roles.readonlyTooltip', { + defaultMessage: 'Unable to create or edit roles', + })} + /> <BreadcrumbsProvider onChange={createBreadcrumbsChangeHandler(chrome, setBreadcrumbs)} > @@ -127,6 +134,7 @@ export const rolesManagementApp = Object.freeze({ notifications={notifications} rolesAPIClient={rolesAPIClient} history={history} + readOnly={!startServices.application.capabilities.roles.save} /> </Route> <Route path="/edit/:roleName?"> diff --git a/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx b/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx index 0649de83749cd..fa4fb04099b72 100644 --- a/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx +++ b/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx @@ -74,6 +74,7 @@ export class UsersGridPage extends Component<Props, State> { isTableLoading: false, }; } + public componentDidMount() { this.loadUsersAndRoles(); } diff --git a/x-pack/plugins/security/public/session/session_timeout.test.ts b/x-pack/plugins/security/public/session/session_timeout.test.ts index e43c1af6ac9c7..41e8907390296 100644 --- a/x-pack/plugins/security/public/session/session_timeout.test.ts +++ b/x-pack/plugins/security/public/session/session_timeout.test.ts @@ -25,7 +25,7 @@ import type { SessionInfo } from '../../common/types'; import { createSessionExpiredMock } from './session_expired.mock'; import { SessionTimeout, startTimer } from './session_timeout'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); jest.spyOn(window, 'addEventListener'); jest.spyOn(window, 'removeEventListener'); diff --git a/x-pack/plugins/security/server/audit/audit_service.test.ts b/x-pack/plugins/security/server/audit/audit_service.test.ts index dfd42c2260c5e..2cef6908355d0 100644 --- a/x-pack/plugins/security/server/audit/audit_service.test.ts +++ b/x-pack/plugins/security/server/audit/audit_service.test.ts @@ -25,7 +25,7 @@ import { RECORD_USAGE_INTERVAL, } from './audit_service'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); const logger = loggingSystemMock.createLogger(); const license = licenseMock.create(); diff --git a/x-pack/plugins/security/server/authorization/check_privileges.test.ts b/x-pack/plugins/security/server/authorization/check_privileges.test.ts index a0109eb46f7dc..6bdca9dd23d89 100644 --- a/x-pack/plugins/security/server/authorization/check_privileges.test.ts +++ b/x-pack/plugins/security/server/authorization/check_privileges.test.ts @@ -3109,14 +3109,25 @@ describe('#checkUserProfilesPrivileges.atSpace', () => { ], esHasPrivilegesResponse: Promise.resolve({ has_privilege_uids: ['uid-1', 'uid-2'], - error_uids: ['uid-3'], + errors: { + count: 1, + details: { + 'uid-3': { type: 'Not Found', reason: 'UID not found' }, + }, + }, }), }) ).resolves.toMatchInlineSnapshot(` Object { - "errorUids": Array [ - "uid-3", - ], + "errors": Object { + "count": 1, + "details": Object { + "uid-3": Object { + "reason": "UID not found", + "type": "Not Found", + }, + }, + }, "hasPrivilegeUids": Array [ "uid-1", "uid-2", diff --git a/x-pack/plugins/security/server/authorization/check_privileges.ts b/x-pack/plugins/security/server/authorization/check_privileges.ts index ffcb466c0b1c6..d121a4787b416 100644 --- a/x-pack/plugins/security/server/authorization/check_privileges.ts +++ b/x-pack/plugins/security/server/authorization/check_privileges.ts @@ -78,7 +78,10 @@ export function checkPrivilegesFactory( const response = await clusterClient.asInternalUser.transport.request<{ has_privilege_uids: string[]; - error_uids?: string[]; + errors: { + count: number; + details: Record<string, { type: string; reason: string }>; + }; }>({ method: 'POST', path: '_security/profile/_has_privileges', @@ -90,7 +93,7 @@ export function checkPrivilegesFactory( return { hasPrivilegeUids: response.has_privilege_uids, - errorUids: response.error_uids ?? [], + ...(response.errors && { errors: response.errors }), }; }; diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.test.ts b/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.test.ts index cd18a28e0d373..ceb0dab8a7f70 100644 --- a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.test.ts +++ b/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.test.ts @@ -233,6 +233,7 @@ describe(`feature_privilege_builder`, () => { "alerting:1.0.0-zeta1:alert-type/my-feature/rule/unmuteAlert", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/snooze", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/bulkEdit", + "alerting:1.0.0-zeta1:alert-type/my-feature/rule/bulkDelete", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/unsnooze", ] `); @@ -332,6 +333,7 @@ describe(`feature_privilege_builder`, () => { "alerting:1.0.0-zeta1:alert-type/my-feature/rule/unmuteAlert", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/snooze", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/bulkEdit", + "alerting:1.0.0-zeta1:alert-type/my-feature/rule/bulkDelete", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/unsnooze", "alerting:1.0.0-zeta1:alert-type/my-feature/alert/get", "alerting:1.0.0-zeta1:alert-type/my-feature/alert/find", @@ -391,6 +393,7 @@ describe(`feature_privilege_builder`, () => { "alerting:1.0.0-zeta1:alert-type/my-feature/rule/unmuteAlert", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/snooze", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/bulkEdit", + "alerting:1.0.0-zeta1:alert-type/my-feature/rule/bulkDelete", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/unsnooze", "alerting:1.0.0-zeta1:readonly-alert-type/my-feature/rule/get", "alerting:1.0.0-zeta1:readonly-alert-type/my-feature/rule/getRuleState", @@ -499,6 +502,7 @@ describe(`feature_privilege_builder`, () => { "alerting:1.0.0-zeta1:alert-type/my-feature/rule/unmuteAlert", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/snooze", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/bulkEdit", + "alerting:1.0.0-zeta1:alert-type/my-feature/rule/bulkDelete", "alerting:1.0.0-zeta1:alert-type/my-feature/rule/unsnooze", "alerting:1.0.0-zeta1:readonly-alert-type/my-feature/rule/get", "alerting:1.0.0-zeta1:readonly-alert-type/my-feature/rule/getRuleState", diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.ts b/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.ts index a11a4fa77bcdd..19dcd2d3a38cb 100644 --- a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.ts +++ b/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.ts @@ -42,6 +42,7 @@ const writeOperations: Record<AlertingEntity, string[]> = { 'unmuteAlert', 'snooze', 'bulkEdit', + 'bulkDelete', 'unsnooze', ], alert: ['update'], diff --git a/x-pack/plugins/security/server/authorization/types.ts b/x-pack/plugins/security/server/authorization/types.ts index 20b52dbd3bc0f..7d8258c0bd8b8 100644 --- a/x-pack/plugins/security/server/authorization/types.ts +++ b/x-pack/plugins/security/server/authorization/types.ts @@ -139,9 +139,14 @@ export interface CheckUserProfilesPrivilegesResponse { * The subset of the requested profile IDs of the users that have all the requested privileges. */ hasPrivilegeUids: string[]; + /** - * The subset of the requested profile IDs for which an error was encountered. It does not include the missing profile - * IDs or the profile IDs of the users that do not have all the requested privileges. + * An errors object that may be returned from ES that contains a `count` of UIDs that have errors in the `details` property. + * + * Each entry in `details` will contain an error `type`, e.g 'resource_not_found_exception', and a `reason` message, e.g. 'profile document not found' */ - errorUids: string[]; + errors?: { + count: number; + details: Record<string, { type: string; reason: string }>; + }; } diff --git a/x-pack/plugins/security/server/elasticsearch/elasticsearch_service.test.ts b/x-pack/plugins/security/server/elasticsearch/elasticsearch_service.test.ts index 219158bdda472..224ffeab0a0f4 100644 --- a/x-pack/plugins/security/server/elasticsearch/elasticsearch_service.test.ts +++ b/x-pack/plugins/security/server/elasticsearch/elasticsearch_service.test.ts @@ -88,7 +88,7 @@ describe('ElasticsearchService', () => { }); it('`watchOnlineStatus$` allows to schedule retry', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); // Both ES and license are available. mockLicense.isEnabled.mockReturnValue(true); @@ -146,7 +146,7 @@ describe('ElasticsearchService', () => { }); it('`watchOnlineStatus$` cancels scheduled retry if status changes before retry timeout fires', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); // Both ES and license are available. mockLicense.isEnabled.mockReturnValue(true); diff --git a/x-pack/plugins/security/server/features/security_features.ts b/x-pack/plugins/security/server/features/security_features.ts index 396f2d1640e1f..46184a845b66c 100644 --- a/x-pack/plugins/security/server/features/security_features.ts +++ b/x-pack/plugins/security/server/features/security_features.ts @@ -34,6 +34,10 @@ const rolesManagementFeature: ElasticsearchFeatureConfig = { privileges: [ { requiredClusterPrivileges: ['manage_security'], + ui: ['save'], + }, + { + requiredClusterPrivileges: ['read_security'], ui: [], }, ], diff --git a/x-pack/plugins/security/server/lib/role_utils.ts b/x-pack/plugins/security/server/lib/role_utils.ts index c852079081821..3ec3247bf61a7 100644 --- a/x-pack/plugins/security/server/lib/role_utils.ts +++ b/x-pack/plugins/security/server/lib/role_utils.ts @@ -101,6 +101,22 @@ export const validateKibanaPrivileges = ( } } + kibanaFeature.subFeatures.forEach((subFeature) => { + if ( + subFeature.requireAllSpaces && + !forAllSpaces && + subFeature.privilegeGroups.some((group) => + group.privileges.some((privilege) => feature.includes(privilege.id)) + ) + ) { + errors.push( + `Sub-feature privilege [${kibanaFeature.name} - ${ + subFeature.name + }] requires all spaces to be selected but received [${priv.spaces.join(',')}]` + ); + } + }); + return errors; }); }); diff --git a/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts index 842a3b74853b7..ed1648c069d4a 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/model/put_payload.test.ts @@ -466,4 +466,86 @@ describe('validateKibanaPrivileges', () => { `Feature [foo] does not support privilege [read].`, ]); }); + + const fooSubFeature = new KibanaFeature({ + id: 'foo', + name: 'Foo', + privileges: { + all: { + savedObject: { + all: [], + read: [], + }, + ui: [], + }, + read: { + disabled: true, + savedObject: { + all: [], + read: [], + }, + ui: [], + }, + }, + subFeatures: [ + { + name: 'Require All Spaces Enabled', + requireAllSpaces: true, + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + id: 'test', + name: 'foo', + includeIn: 'none', + ui: ['test-ui'], + savedObject: { + all: [], + read: [], + }, + }, + ], + }, + ], + }, + ], + app: [], + category: { id: 'foo', label: 'foo' }, + }); + + test('returns no error when subfeature requireAllSpaces enabled and all spaces selected', () => { + expect( + validateKibanaPrivileges( + [fooSubFeature], + [ + { + spaces: ['*'], + base: [], + feature: { + foo: ['all', 'test'], + }, + }, + ] + ).validationErrors + ).toEqual([]); + }); + test('returns error when subfeature requireAllSpaces enabled but not all spaces selected', () => { + expect( + validateKibanaPrivileges( + [fooSubFeature], + [ + { + spaces: ['foo-space'], + base: [], + feature: { + foo: ['all', 'test'], + }, + }, + ] + ).validationErrors + ).toEqual([ + 'Sub-feature privilege [Foo - Require All Spaces Enabled] requires all spaces to be selected but received [foo-space]', + ]); + }); }); diff --git a/x-pack/plugins/security/server/user_profile/user_profile_service.test.ts b/x-pack/plugins/security/server/user_profile/user_profile_service.test.ts index 76d90f23a2e83..883fe8d1c8e97 100644 --- a/x-pack/plugins/security/server/user_profile/user_profile_service.test.ts +++ b/x-pack/plugins/security/server/user_profile/user_profile_service.test.ts @@ -405,7 +405,7 @@ describe('UserProfileService', () => { }); it('retries activation if initially fails with 409 error', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const failureReason = new errors.ResponseError( securityMock.createApiResponse({ statusCode: 409, body: 'some message' }) @@ -449,7 +449,7 @@ describe('UserProfileService', () => { }); it('fails if activation max retries exceeded', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const failureReason = new errors.ResponseError( securityMock.createApiResponse({ statusCode: 409, body: 'some message' }) @@ -816,7 +816,6 @@ describe('UserProfileService', () => { const mockAtSpacePrivilegeCheck = { atSpace: jest.fn() }; mockAtSpacePrivilegeCheck.atSpace.mockResolvedValue({ hasPrivilegeUids: ['UID-0', 'UID-1', 'UID-8'], - errorUids: [], }); mockAuthz.checkUserProfilesPrivileges.mockReturnValue(mockAtSpacePrivilegeCheck); @@ -911,15 +910,12 @@ describe('UserProfileService', () => { mockAtSpacePrivilegeCheck.atSpace .mockResolvedValueOnce({ hasPrivilegeUids: ['UID-0'], - errorUids: [], }) .mockResolvedValueOnce({ hasPrivilegeUids: ['UID-20'], - errorUids: [], }) .mockResolvedValueOnce({ hasPrivilegeUids: [], - errorUids: [], }); mockAuthz.checkUserProfilesPrivileges.mockReturnValue(mockAtSpacePrivilegeCheck); @@ -1020,7 +1016,6 @@ describe('UserProfileService', () => { const mockAtSpacePrivilegeCheck = { atSpace: jest.fn() }; mockAtSpacePrivilegeCheck.atSpace.mockResolvedValue({ hasPrivilegeUids: ['UID-0', 'UID-1', 'UID-8'], - errorUids: [], }); mockAuthz.checkUserProfilesPrivileges.mockReturnValue(mockAtSpacePrivilegeCheck); @@ -1084,6 +1079,109 @@ describe('UserProfileService', () => { kibana: ['privilege-1', 'privilege-2'], }); }); + + it('properly handles privileges checks and logs errors when errors with reasons are returned from the privilege check', async () => { + // In this test we'd like to simulate the following case: + // 1. User requests 2 results with privileges check + // 2. Kibana will fetch 10 (min batch) results + // 3. Only UID-0, UID-1 and UID-8 profiles will have necessary privileges + mockStartParams.clusterClient.asInternalUser.security.suggestUserProfiles.mockResolvedValue({ + profiles: Array.from({ length: 10 }).map((_, index) => + userProfileMock.createWithSecurity({ + uid: `UID-${index}`, + data: { some: 'data', kibana: { some: `kibana-data-${index}` } }, + }) + ), + } as unknown as SecuritySuggestUserProfilesResponse); + + const mockAtSpacePrivilegeCheck = { atSpace: jest.fn() }; + + mockAtSpacePrivilegeCheck.atSpace.mockResolvedValue({ + hasPrivilegeUids: ['UID-0', 'UID-1', 'UID-8'], + errors: { + count: 2, + details: { + 'UID-3': { type: 'some type 3', reason: 'some reason 3' }, + 'UID-4': { type: 'some type 4', reason: 'some reason 4' }, + }, + }, + }); + + mockAuthz.checkUserProfilesPrivileges.mockReturnValue(mockAtSpacePrivilegeCheck); + + const startContract = userProfileService.start(mockStartParams); + + await expect( + startContract.suggest({ + name: 'some', + size: 2, + dataPath: 'one,two', + requiredPrivileges: { + spaceId: 'some-space', + privileges: { kibana: ['privilege-1', 'privilege-2'] }, + }, + }) + ).resolves.toMatchInlineSnapshot(` + Array [ + Object { + "data": Object { + "some": "kibana-data-0", + }, + "enabled": true, + "uid": "UID-0", + "user": Object { + "email": "some@email", + "full_name": undefined, + "username": "some-username", + }, + }, + Object { + "data": Object { + "some": "kibana-data-1", + }, + "enabled": true, + "uid": "UID-1", + "user": Object { + "email": "some@email", + "full_name": undefined, + "username": "some-username", + }, + }, + ] + `); + + expect( + mockStartParams.clusterClient.asInternalUser.security.suggestUserProfiles + ).toHaveBeenCalledTimes(1); + + expect( + mockStartParams.clusterClient.asInternalUser.security.suggestUserProfiles + ).toHaveBeenCalledWith({ + name: 'some', + size: 10, + data: 'kibana.one,kibana.two', + }); + + expect(mockAuthz.checkUserProfilesPrivileges).toHaveBeenCalledTimes(1); + + expect(mockAuthz.checkUserProfilesPrivileges).toHaveBeenCalledWith( + new Set(Array.from({ length: 10 }).map((_, index) => `UID-${index}`)) + ); + + expect(mockAtSpacePrivilegeCheck.atSpace).toHaveBeenCalledTimes(1); + + expect(mockAtSpacePrivilegeCheck.atSpace).toHaveBeenCalledWith('some-space', { + kibana: ['privilege-1', 'privilege-2'], + }); + + expect(logger.error).toHaveBeenCalledWith( + 'Privileges check API failed for UID UID-3 because some reason 3.' + ); + + expect(logger.error).toHaveBeenCalledWith( + 'Privileges check API failed for UID UID-4 because some reason 4.' + ); + }); }); }); diff --git a/x-pack/plugins/security/server/user_profile/user_profile_service.ts b/x-pack/plugins/security/server/user_profile/user_profile_service.ts index 8babcaae4f90a..888b0a2a47866 100644 --- a/x-pack/plugins/security/server/user_profile/user_profile_service.ts +++ b/x-pack/plugins/security/server/user_profile/user_profile_service.ts @@ -506,11 +506,15 @@ export class UserProfileService { this.logger.error(`Privileges check API returned unknown profile UIDs: ${unknownUids}.`); } - // Log profile UIDs for which an error was encountered. - if (response.errorUids.length > 0) { - this.logger.error( - `Privileges check API failed for the following user profiles: ${response.errorUids}.` - ); + // Log profile UIDs and reason for which an error was encountered. + if (response.errors?.count) { + const uids = Object.keys(response.errors.details); + + for (const uid of uids) { + this.logger.error( + `Privileges check API failed for UID ${uid} because ${response.errors.details[uid].reason}.` + ); + } } } diff --git a/x-pack/plugins/security/tsconfig.json b/x-pack/plugins/security/tsconfig.json index 68c43cf64e6b6..988cf4d550c92 100644 --- a/x-pack/plugins/security/tsconfig.json +++ b/x-pack/plugins/security/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../cloud/tsconfig.json" }, { "path": "../features/tsconfig.json" }, { "path": "../licensing/tsconfig.json" }, diff --git a/x-pack/plugins/security_solution/common/constants.ts b/x-pack/plugins/security_solution/common/constants.ts index 65c5757a1b1bb..1847be23dbe9b 100644 --- a/x-pack/plugins/security_solution/common/constants.ts +++ b/x-pack/plugins/security_solution/common/constants.ts @@ -277,7 +277,6 @@ export const DETECTION_ENGINE_RULES_BULK_UPDATE = `${DETECTION_ENGINE_RULES_URL}/_bulk_update` as const; export const INTERNAL_RISK_SCORE_URL = '/internal/risk_score' as const; -export const RISK_SCORE_RESTART_TRANSFORMS = `${INTERNAL_RISK_SCORE_URL}/transforms/restart`; export const DEV_TOOL_PREBUILT_CONTENT = `${INTERNAL_RISK_SCORE_URL}/prebuilt_content/dev_tool/{console_id}` as const; export const devToolPrebuiltContentUrl = (spaceId: string, consoleId: string) => diff --git a/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.mock.ts b/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.mock.ts index 548d8b571660e..fd210ad99680f 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.mock.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.mock.ts @@ -5,18 +5,18 @@ * 2.0. */ -import { BulkAction, BulkActionEditType } from './request_schema'; +import { BulkActionType, BulkActionEditType } from './request_schema'; import type { PerformBulkActionRequestBody } from './request_schema'; export const getPerformBulkActionSchemaMock = (): PerformBulkActionRequestBody => ({ query: '', ids: undefined, - action: BulkAction.disable, + action: BulkActionType.disable, }); export const getPerformBulkActionEditSchemaMock = (): PerformBulkActionRequestBody => ({ query: '', ids: undefined, - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.add_tags, value: ['tag1'] }], + action: BulkActionType.edit, + [BulkActionType.edit]: [{ type: BulkActionEditType.add_tags, value: ['tag1'] }], }); diff --git a/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.test.ts index 63de1d45ec3cb..99f5413e6688b 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.test.ts @@ -7,7 +7,7 @@ import { left } from 'fp-ts/lib/Either'; import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { PerformBulkActionRequestBody, BulkAction, BulkActionEditType } from './request_schema'; +import { PerformBulkActionRequestBody, BulkActionType, BulkActionEditType } from './request_schema'; const retrieveValidationMessage = (payload: unknown) => { const decoded = PerformBulkActionRequestBody.decode(payload); @@ -21,7 +21,7 @@ describe('Perform bulk action request schema', () => { test('valid request: missing query', () => { const payload: PerformBulkActionRequestBody = { query: undefined, - action: BulkAction.enable, + action: BulkActionType.enable, }; const message = retrieveValidationMessage(payload); @@ -59,7 +59,7 @@ describe('Perform bulk action request schema', () => { test('invalid request: unknown property', () => { const payload = { query: 'name: test', - action: BulkAction.enable, + action: BulkActionType.enable, mock: ['id'], }; const message = retrieveValidationMessage(payload); @@ -71,7 +71,7 @@ describe('Perform bulk action request schema', () => { test('invalid request: wrong type for ids', () => { const payload = { ids: 'mock', - action: BulkAction.enable, + action: BulkActionType.enable, }; const message = retrieveValidationMessage(payload); @@ -84,7 +84,7 @@ describe('Perform bulk action request schema', () => { test('valid request', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.enable, + action: BulkActionType.enable, }; const message = retrieveValidationMessage(payload); expect(getPaths(left(message.errors))).toEqual([]); @@ -96,7 +96,7 @@ describe('Perform bulk action request schema', () => { test('valid request', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.disable, + action: BulkActionType.disable, }; const message = retrieveValidationMessage(payload); expect(getPaths(left(message.errors))).toEqual([]); @@ -108,7 +108,7 @@ describe('Perform bulk action request schema', () => { test('valid request', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.export, + action: BulkActionType.export, }; const message = retrieveValidationMessage(payload); expect(getPaths(left(message.errors))).toEqual([]); @@ -120,7 +120,7 @@ describe('Perform bulk action request schema', () => { test('valid request', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.delete, + action: BulkActionType.delete, }; const message = retrieveValidationMessage(payload); expect(getPaths(left(message.errors))).toEqual([]); @@ -132,7 +132,7 @@ describe('Perform bulk action request schema', () => { test('valid request', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.duplicate, + action: BulkActionType.duplicate, }; const message = retrieveValidationMessage(payload); expect(getPaths(left(message.errors))).toEqual([]); @@ -145,7 +145,7 @@ describe('Perform bulk action request schema', () => { test('invalid request: missing edit payload', () => { const payload = { query: 'name: test', - action: BulkAction.edit, + action: BulkActionType.edit, }; const message = retrieveValidationMessage(payload); @@ -160,8 +160,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: specified edit payload for another action', () => { const payload = { query: 'name: test', - action: BulkAction.enable, - [BulkAction.edit]: [{ type: BulkActionEditType.set_tags, value: ['test-tag'] }], + action: BulkActionType.enable, + [BulkActionType.edit]: [{ type: BulkActionEditType.set_tags, value: ['test-tag'] }], }; const message = retrieveValidationMessage(payload); @@ -175,8 +175,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: wrong type for edit payload', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: { type: BulkActionEditType.set_tags, value: ['test-tag'] }, + action: BulkActionType.edit, + [BulkActionType.edit]: { type: BulkActionEditType.set_tags, value: ['test-tag'] }, }; const message = retrieveValidationMessage(payload); @@ -193,8 +193,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: wrong tags type', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.set_tags, value: 'test-tag' }], + action: BulkActionType.edit, + [BulkActionType.edit]: [{ type: BulkActionEditType.set_tags, value: 'test-tag' }], }; const message = retrieveValidationMessage(payload); @@ -210,8 +210,8 @@ describe('Perform bulk action request schema', () => { test('valid request: add_tags edit action', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.add_tags, value: ['test-tag'] }], + action: BulkActionType.edit, + [BulkActionType.edit]: [{ type: BulkActionEditType.add_tags, value: ['test-tag'] }], }; const message = retrieveValidationMessage(payload); @@ -223,8 +223,8 @@ describe('Perform bulk action request schema', () => { test('valid request: set_tags edit action', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.set_tags, value: ['test-tag'] }], + action: BulkActionType.edit, + [BulkActionType.edit]: [{ type: BulkActionEditType.set_tags, value: ['test-tag'] }], }; const message = retrieveValidationMessage(payload); @@ -236,8 +236,8 @@ describe('Perform bulk action request schema', () => { test('valid request: delete_tags edit action', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.delete_tags, value: ['test-tag'] }], + action: BulkActionType.edit, + [BulkActionType.edit]: [{ type: BulkActionEditType.delete_tags, value: ['test-tag'] }], }; const message = retrieveValidationMessage(payload); @@ -251,8 +251,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: wrong index_patterns type', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.set_tags, value: 'logs-*' }], + action: BulkActionType.edit, + [BulkActionType.edit]: [{ type: BulkActionEditType.set_tags, value: 'logs-*' }], }; const message = retrieveValidationMessage(payload); @@ -268,8 +268,10 @@ describe('Perform bulk action request schema', () => { test('valid request: set_index_patterns edit action', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.set_index_patterns, value: ['logs-*'] }], + action: BulkActionType.edit, + [BulkActionType.edit]: [ + { type: BulkActionEditType.set_index_patterns, value: ['logs-*'] }, + ], }; const message = retrieveValidationMessage(payload); @@ -281,8 +283,10 @@ describe('Perform bulk action request schema', () => { test('valid request: add_index_patterns edit action', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.add_index_patterns, value: ['logs-*'] }], + action: BulkActionType.edit, + [BulkActionType.edit]: [ + { type: BulkActionEditType.add_index_patterns, value: ['logs-*'] }, + ], }; const message = retrieveValidationMessage(payload); @@ -294,8 +298,8 @@ describe('Perform bulk action request schema', () => { test('valid request: delete_index_patterns edit action', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.delete_index_patterns, value: ['logs-*'] }, ], }; @@ -311,8 +315,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: wrong timeline payload type', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.set_timeline, value: [] }], + action: BulkActionType.edit, + [BulkActionType.edit]: [{ type: BulkActionEditType.set_timeline, value: [] }], }; const message = retrieveValidationMessage(payload); @@ -328,8 +332,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: missing timeline_id', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_timeline, value: { @@ -353,8 +357,8 @@ describe('Perform bulk action request schema', () => { test('valid request: set_timeline edit action', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_timeline, value: { @@ -376,8 +380,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: wrong schedules payload type', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.set_schedule, value: [] }], + action: BulkActionType.edit, + [BulkActionType.edit]: [{ type: BulkActionEditType.set_schedule, value: [] }], }; const message = retrieveValidationMessage(payload); @@ -393,8 +397,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: wrong type of payload data', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_schedule, value: { @@ -420,8 +424,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: missing interval', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_schedule, value: { @@ -446,8 +450,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: missing lookback', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_schedule, value: { @@ -472,8 +476,8 @@ describe('Perform bulk action request schema', () => { test('valid request: set_schedule edit action', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_schedule, value: { @@ -495,8 +499,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: invalid rule actions payload', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [{ type: BulkActionEditType.add_rule_actions, value: [] }], + action: BulkActionType.edit, + [BulkActionType.edit]: [{ type: BulkActionEditType.add_rule_actions, value: [] }], }; const message = retrieveValidationMessage(payload); @@ -510,8 +514,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: missing throttle in payload', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_rule_actions, value: { @@ -532,8 +536,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: missing actions in payload', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_rule_actions, value: { @@ -554,8 +558,8 @@ describe('Perform bulk action request schema', () => { test('invalid request: invalid action_type_id property in actions array', () => { const payload = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_rule_actions, value: { @@ -587,8 +591,8 @@ describe('Perform bulk action request schema', () => { test('valid request: add_rule_actions edit action', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_rule_actions, value: { @@ -618,8 +622,8 @@ describe('Perform bulk action request schema', () => { test('valid request: set_rule_actions edit action', () => { const payload: PerformBulkActionRequestBody = { query: 'name: test', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_rule_actions, value: { diff --git a/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.ts b/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.ts index 6e5248075b7dc..c09a2c27ea576 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema.ts @@ -22,7 +22,7 @@ import { TimelineTemplateTitle, } from '../../../../rule_schema'; -export enum BulkAction { +export enum BulkActionType { 'enable' = 'enable', 'disable' = 'disable', 'export' = 'export', @@ -162,18 +162,18 @@ export const PerformBulkActionRequestBody = t.intersection([ t.exact( t.type({ action: t.union([ - t.literal(BulkAction.delete), - t.literal(BulkAction.disable), - t.literal(BulkAction.duplicate), - t.literal(BulkAction.enable), - t.literal(BulkAction.export), + t.literal(BulkActionType.delete), + t.literal(BulkActionType.disable), + t.literal(BulkActionType.duplicate), + t.literal(BulkActionType.enable), + t.literal(BulkActionType.export), ]), }) ), t.exact( t.type({ - action: t.literal(BulkAction.edit), - [BulkAction.edit]: NonEmptyArray(BulkActionEditPayload), + action: t.literal(BulkActionType.edit), + [BulkActionType.edit]: NonEmptyArray(BulkActionEditPayload), }) ), ]), diff --git a/x-pack/plugins/security_solution/common/endpoint/constants.ts b/x-pack/plugins/security_solution/common/endpoint/constants.ts index 3aa4fe007a959..078adada6d2b6 100644 --- a/x-pack/plugins/security_solution/common/endpoint/constants.ts +++ b/x-pack/plugins/security_solution/common/endpoint/constants.ts @@ -42,8 +42,8 @@ export const policyIndexPattern = 'metrics-endpoint.policy-*'; export const telemetryIndexPattern = 'metrics-endpoint.telemetry-*'; // File storage indexes supporting endpoint Upload/download -export const FILE_STORAGE_METADATA_INDEX = '.fleet-files'; -export const FILE_STORAGE_DATA_INDEX = '.fleet-file_data'; +export const FILE_STORAGE_METADATA_INDEX = '.fleet-endpoint-files'; +export const FILE_STORAGE_DATA_INDEX = '.fleet-endpoint-file-data'; // Endpoint API routes export const BASE_ENDPOINT_ROUTE = '/api/endpoint'; @@ -73,6 +73,7 @@ export const GET_FILE_ROUTE = `${BASE_ENDPOINT_ACTION_ROUTE}/get_file`; export const ENDPOINT_ACTION_LOG_ROUTE = `${BASE_ENDPOINT_ROUTE}/action_log/{agent_id}`; export const ACTION_STATUS_ROUTE = `${BASE_ENDPOINT_ROUTE}/action_status`; export const ACTION_DETAILS_ROUTE = `${BASE_ENDPOINT_ACTION_ROUTE}/{action_id}`; +export const ACTION_AGENT_FILE_INFO_ROUTE = `${BASE_ENDPOINT_ACTION_ROUTE}/{action_id}/{agent_id}/file`; export const ACTION_AGENT_FILE_DOWNLOAD_ROUTE = `${BASE_ENDPOINT_ACTION_ROUTE}/{action_id}/{agent_id}/file/download`; export const ENDPOINTS_ACTION_LIST_ROUTE = `${BASE_ENDPOINT_ROUTE}/action`; diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/base_data_generator.ts b/x-pack/plugins/security_solution/common/endpoint/data_generators/base_data_generator.ts index 868129f3a6737..01ecc95524b27 100644 --- a/x-pack/plugins/security_solution/common/endpoint/data_generators/base_data_generator.ts +++ b/x-pack/plugins/security_solution/common/endpoint/data_generators/base_data_generator.ts @@ -68,6 +68,41 @@ const USERS = [ 'Genevieve', ]; +const toEsSearchHit = <T extends object = object>( + hitSource: T, + index: string = 'some-index' +): estypes.SearchHit<T> => { + return { + _index: index, + _id: '123', + _score: 1.0, + _source: hitSource, + }; +}; + +const toEsSearchResponse = <T extends object = object>( + hitsSource: Array<estypes.SearchHit<T>> +): estypes.SearchResponse<T> => { + return { + took: 3, + timed_out: false, + _shards: { + total: 2, + successful: 2, + skipped: 0, + failed: 0, + }, + hits: { + total: { + value: hitsSource.length, + relation: 'eq', + }, + max_score: 0, + hits: hitsSource, + }, + }; +}; + /** * A generic base class to assist in creating domain specific data generators. It includes * several general purpose random data generators for use within the class and exposes one @@ -193,12 +228,17 @@ export class BaseDataGenerator<GeneratedDoc extends {} = {}> { hitSource: T, index: string = 'some-index' ): estypes.SearchHit<T> { - return { - _index: index, - _id: this.seededUUIDv4(), - _score: 1.0, - _source: hitSource, - }; + const hit = toEsSearchHit<T>(hitSource, index); + hit._id = this.seededUUIDv4(); + + return hit; + } + + static toEsSearchHit<T extends object = object>( + hitSource: T, + index: string = 'some-index' + ): estypes.SearchHit<T> { + return toEsSearchHit<T>(hitSource, index); } /** @@ -209,23 +249,12 @@ export class BaseDataGenerator<GeneratedDoc extends {} = {}> { toEsSearchResponse<T extends object = object>( hitsSource: Array<estypes.SearchHit<T>> ): estypes.SearchResponse<T> { - return { - took: 3, - timed_out: false, - _shards: { - total: 2, - successful: 2, - skipped: 0, - failed: 0, - }, - hits: { - total: { - value: hitsSource.length, - relation: 'eq', - }, - max_score: 0, - hits: hitsSource, - }, - }; + return toEsSearchResponse<T>(hitsSource); + } + + static toEsSearchResponse<T extends object = object>( + hitsSource: Array<estypes.SearchHit<T>> + ): estypes.SearchResponse<T> { + return toEsSearchResponse<T>(hitsSource); } } diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_action_generator.ts b/x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_action_generator.ts index e9531e48d0784..538efd053611a 100644 --- a/x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_action_generator.ts +++ b/x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_action_generator.ts @@ -88,7 +88,7 @@ export class EndpointActionGenerator extends BaseDataGenerator { output = { type: 'json', content: { - code: 'ra_get-file_success', + code: 'ra_get-file_success_done', path: '/some/path/bad_file.txt', size: 1234, zip_size: 123, @@ -193,6 +193,21 @@ export class EndpointActionGenerator extends BaseDataGenerator { return details as unknown as ActionDetails<TOutputType, TParameters>; } + randomGetFileFailureCode(): string { + return this.randomChoice([ + 'ra_get-file_error_not-found', + 'ra_get-file_error_is-directory', + 'ra_get-file_error_invalid-input', + 'ra_get-file_error_not-permitted', + 'ra_get-file_error_too-big', + 'ra_get-file_error_disk-quota', + 'ra_get-file_error_processing', + 'ra_get-file_error_upload-api-unreachable', + 'ra_get-file_error_upload-timeout', + 'ra_get-file_error_queue-timeout', + ]); + } + generateActivityLogAction( overrides: DeepPartial<EndpointActivityLogAction> ): EndpointActivityLogAction { diff --git a/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts b/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts index 1b3c3105121e5..eb5389586b2a8 100644 --- a/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts +++ b/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts @@ -200,7 +200,7 @@ export const policyFactoryWithoutPaidFeatures = ( ...policy.windows.popup, malware: { message: '', - enabled: true, + enabled: true, // disabling/configuring malware popup is a paid feature }, ransomware: { message: '', @@ -230,7 +230,7 @@ export const policyFactoryWithoutPaidFeatures = ( ...policy.mac.popup, malware: { message: '', - enabled: true, + enabled: true, // disabling/configuring malware popup is a paid feature }, memory_protection: { message: '', @@ -256,7 +256,7 @@ export const policyFactoryWithoutPaidFeatures = ( ...policy.linux.popup, malware: { message: '', - enabled: true, + enabled: true, // disabling/configuring malware popup is a paid feature }, memory_protection: { message: '', @@ -272,7 +272,7 @@ export const policyFactoryWithoutPaidFeatures = ( }; /** - * Strips paid features from an existing or new `PolicyConfig` for gold and below license + * Enables support for paid features for an existing or new `PolicyConfig` for platinum and above license */ export const policyFactoryWithSupportedFeatures = ( policy: PolicyConfig = policyFactory() diff --git a/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts b/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts new file mode 100644 index 0000000000000..d5ba6d03cd430 --- /dev/null +++ b/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.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 type { PolicyConfig } from '../types'; +import { ProtectionModes } from '../types'; +import { policyFactory } from './policy_config'; +import { disableProtections } from './policy_config_helpers'; + +describe('Policy Config helpers', () => { + describe('disableProtections', () => { + it('disables all the protections in the default policy', () => { + expect(disableProtections(policyFactory())).toEqual<PolicyConfig>(eventsOnlyPolicy); + }); + + it('does not enable supported fields', () => { + const defaultPolicy: PolicyConfig = policyFactory(); + + const notSupported: PolicyConfig['windows']['memory_protection'] = { + mode: ProtectionModes.off, + supported: false, + }; + + const inputPolicyWithoutSupportedProtections: PolicyConfig = { + ...defaultPolicy, + windows: { + ...defaultPolicy.windows, + memory_protection: notSupported, + behavior_protection: notSupported, + ransomware: notSupported, + }, + mac: { + ...defaultPolicy.mac, + memory_protection: notSupported, + behavior_protection: notSupported, + }, + linux: { + ...defaultPolicy.linux, + memory_protection: notSupported, + behavior_protection: notSupported, + }, + }; + + const expectedPolicyWithoutSupportedProtections: PolicyConfig = { + ...eventsOnlyPolicy, + windows: { + ...eventsOnlyPolicy.windows, + memory_protection: notSupported, + behavior_protection: notSupported, + ransomware: notSupported, + }, + mac: { + ...eventsOnlyPolicy.mac, + memory_protection: notSupported, + behavior_protection: notSupported, + }, + linux: { + ...eventsOnlyPolicy.linux, + memory_protection: notSupported, + behavior_protection: notSupported, + }, + }; + + const policy = disableProtections(inputPolicyWithoutSupportedProtections); + + expect(policy).toEqual<PolicyConfig>(expectedPolicyWithoutSupportedProtections); + }); + + it('does not enable events', () => { + const defaultPolicy: PolicyConfig = policyFactory(); + + const windowsEvents: typeof defaultPolicy.windows.events = { + dll_and_driver_load: false, + dns: false, + file: false, + network: false, + process: false, + registry: false, + security: false, + }; + + const macEvents: typeof defaultPolicy.mac.events = { + file: false, + process: false, + network: false, + }; + + const linuxEvents: typeof defaultPolicy.linux.events = { + file: false, + process: false, + network: false, + session_data: false, + tty_io: false, + }; + + const expectedPolicy: PolicyConfig = { + ...eventsOnlyPolicy, + windows: { ...eventsOnlyPolicy.windows, events: { ...windowsEvents } }, + mac: { ...eventsOnlyPolicy.mac, events: { ...macEvents } }, + linux: { ...eventsOnlyPolicy.linux, events: { ...linuxEvents } }, + }; + + const inputPolicy = { + ...defaultPolicy, + windows: { ...defaultPolicy.windows, events: { ...windowsEvents } }, + mac: { ...defaultPolicy.mac, events: { ...macEvents } }, + linux: { ...defaultPolicy.linux, events: { ...linuxEvents } }, + }; + + expect(disableProtections(inputPolicy)).toEqual<PolicyConfig>(expectedPolicy); + }); + }); +}); + +// This constant makes sure that if the type `PolicyConfig` is ever modified, +// the logic for disabling protections is also modified due to type check. +export const eventsOnlyPolicy: PolicyConfig = { + windows: { + events: { + dll_and_driver_load: true, + dns: true, + file: true, + network: true, + process: true, + registry: true, + security: true, + }, + malware: { mode: ProtectionModes.off, blocklist: false }, + ransomware: { mode: ProtectionModes.off, supported: true }, + memory_protection: { mode: ProtectionModes.off, supported: true }, + behavior_protection: { mode: ProtectionModes.off, supported: true }, + popup: { + malware: { message: '', enabled: false }, + ransomware: { message: '', enabled: false }, + memory_protection: { message: '', enabled: false }, + behavior_protection: { message: '', enabled: false }, + }, + logging: { file: 'info' }, + antivirus_registration: { enabled: false }, + attack_surface_reduction: { credential_hardening: { enabled: false } }, + }, + mac: { + events: { process: true, file: true, network: true }, + malware: { mode: ProtectionModes.off, blocklist: false }, + behavior_protection: { mode: ProtectionModes.off, supported: true }, + memory_protection: { mode: ProtectionModes.off, supported: true }, + popup: { + malware: { message: '', enabled: false }, + behavior_protection: { message: '', enabled: false }, + memory_protection: { message: '', enabled: false }, + }, + logging: { file: 'info' }, + }, + linux: { + events: { + process: true, + file: true, + network: true, + session_data: false, + tty_io: false, + }, + malware: { mode: ProtectionModes.off, blocklist: false }, + behavior_protection: { mode: ProtectionModes.off, supported: true }, + memory_protection: { mode: ProtectionModes.off, supported: true }, + popup: { + malware: { message: '', enabled: false }, + behavior_protection: { message: '', enabled: false }, + memory_protection: { message: '', enabled: false }, + }, + logging: { file: 'info' }, + }, +}; diff --git a/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.ts b/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.ts new file mode 100644 index 0000000000000..27a15e0be5401 --- /dev/null +++ b/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.ts @@ -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 type { PolicyConfig } from '../types'; +import { ProtectionModes } from '../types'; + +/** + * Returns a copy of the passed `PolicyConfig` with all protections set to disabled. + * + * @param policy + * @returns + */ +export const disableProtections = (policy: PolicyConfig): PolicyConfig => { + const result = disableCommonProtections(policy); + + return { + ...result, + windows: { + ...result.windows, + ...getDisabledWindowsSpecificProtections(result), + popup: { + ...result.windows.popup, + ...getDisabledWindowsSpecificPopups(result), + }, + }, + }; +}; + +const disableCommonProtections = (policy: PolicyConfig) => { + let policyOutput = policy; + + for (const key in policyOutput) { + if (Object.prototype.hasOwnProperty.call(policyOutput, key)) { + const os = key as keyof PolicyConfig; + + policyOutput = { + ...policyOutput, + [os]: { + ...policyOutput[os], + ...getDisabledCommonProtectionsForOS(policyOutput, os), + popup: { + ...policyOutput[os].popup, + ...getDisabledCommonPopupsForOS(policyOutput, os), + }, + }, + }; + } + } + return policyOutput; +}; + +const getDisabledCommonProtectionsForOS = (policy: PolicyConfig, os: keyof PolicyConfig) => ({ + behavior_protection: { + ...policy[os].behavior_protection, + mode: ProtectionModes.off, + }, + memory_protection: { + ...policy[os].memory_protection, + mode: ProtectionModes.off, + }, + malware: { + ...policy[os].malware, + blocklist: false, + mode: ProtectionModes.off, + }, +}); + +const getDisabledCommonPopupsForOS = (policy: PolicyConfig, os: keyof PolicyConfig) => ({ + behavior_protection: { + ...policy[os].popup.behavior_protection, + enabled: false, + }, + malware: { + ...policy[os].popup.malware, + enabled: false, + }, + memory_protection: { + ...policy[os].popup.memory_protection, + enabled: false, + }, +}); + +const getDisabledWindowsSpecificProtections = (policy: PolicyConfig) => ({ + ransomware: { + ...policy.windows.ransomware, + mode: ProtectionModes.off, + }, + attack_surface_reduction: { + ...policy.windows.attack_surface_reduction, + credential_hardening: { + enabled: false, + }, + }, +}); + +const getDisabledWindowsSpecificPopups = (policy: PolicyConfig) => ({ + ransomware: { + ...policy.windows.popup.ransomware, + enabled: false, + }, +}); diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/actions.ts b/x-pack/plugins/security_solution/common/endpoint/schema/actions.ts index cb9a1d98eb326..310fbcbea326b 100644 --- a/x-pack/plugins/security_solution/common/endpoint/schema/actions.ts +++ b/x-pack/plugins/security_solution/common/endpoint/schema/actions.ts @@ -139,3 +139,13 @@ export const EndpointActionFileDownloadSchema = { export type EndpointActionFileDownloadParams = TypeOf< typeof EndpointActionFileDownloadSchema.params >; + +/** Schema that validates the file info API */ +export const EndpointActionFileInfoSchema = { + params: schema.object({ + action_id: schema.string({ minLength: 1 }), + agent_id: schema.string({ minLength: 1 }), + }), +}; + +export type EndpointActionFileInfoParams = TypeOf<typeof EndpointActionFileInfoSchema.params>; diff --git a/x-pack/plugins/security_solution/common/endpoint/service/authz/authz.test.ts b/x-pack/plugins/security_solution/common/endpoint/service/authz/authz.test.ts index e00434559b9ca..7ee477e3076c8 100644 --- a/x-pack/plugins/security_solution/common/endpoint/service/authz/authz.test.ts +++ b/x-pack/plugins/security_solution/common/endpoint/service/authz/authz.test.ts @@ -115,6 +115,10 @@ describe('Endpoint Authz service', () => { }); describe('and endpoint rbac is enabled', () => { + beforeEach(() => { + userRoles = []; + }); + it.each<[EndpointAuthzKeyList[number], string]>([ ['canWriteEndpointList', 'writeEndpointList'], ['canReadEndpointList', 'readEndpointList'], diff --git a/x-pack/plugins/security_solution/common/endpoint/service/authz/authz.ts b/x-pack/plugins/security_solution/common/endpoint/service/authz/authz.ts index 93b5289bdc391..0bf21e4734ba2 100644 --- a/x-pack/plugins/security_solution/common/endpoint/service/authz/authz.ts +++ b/x-pack/plugins/security_solution/common/endpoint/service/authz/authz.ts @@ -25,9 +25,18 @@ function hasPermission( hasEndpointManagementAccess: boolean, privilege: typeof ENDPOINT_PRIVILEGES[number] ): boolean { - return isEndpointRbacEnabled - ? fleetAuthz.packagePrivileges?.endpoint?.actions[privilege].executePackageAction ?? false - : hasEndpointManagementAccess; + // user is superuser, always return true + if (hasEndpointManagementAccess) { + return true; + } + + // not superuser and FF not enabled, no access + if (!isEndpointRbacEnabled) { + return false; + } + + // FF enabled, access based on privileges + return fleetAuthz.packagePrivileges?.endpoint?.actions[privilege].executePackageAction ?? false; } /** 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 2d455bb6a839f..8ac8745a5d35b 100644 --- a/x-pack/plugins/security_solution/common/endpoint/types/actions.ts +++ b/x-pack/plugins/security_solution/common/endpoint/types/actions.ts @@ -6,6 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; +import type { FileJSON } from '@kbn/files-plugin/common'; import type { ActionStatusRequestSchema, NoParametersRequestSchema, @@ -360,3 +361,12 @@ export interface ActionListApiResponse { statuses: ResponseActionStatus[] | undefined; total: number; } + +export type UploadedFileInfo = Pick< + FileJSON, + 'name' | 'id' | 'mimeType' | 'size' | 'status' | 'created' +>; + +export interface ActionFileInfoApiResponse { + data: UploadedFileInfo; +} diff --git a/x-pack/plugins/security_solution/common/endpoint/types/file_storage.ts b/x-pack/plugins/security_solution/common/endpoint/types/file_storage.ts deleted file mode 100644 index 9ed8065197921..0000000000000 --- a/x-pack/plugins/security_solution/common/endpoint/types/file_storage.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/** - * The Metadata information about a file that was uploaded by Endpoint - * as a result of a `get-file` response action - */ -export interface UploadedFile { - file: { - /** The chunk size used for each chunk in this file */ - ChunkSize?: number; - /** - * - `AWAITING_UPLOAD`: file metadata has been created. File is ready to be uploaded. - * - `UPLOADING`: file contents are being uploaded. - * - `READY`: file has been uploaded, successfully, without errors. - * - `UPLOAD_ERROR`: an error happened while the file was being uploaded, file contents - * are most likely corrupted. - * - `DELETED`: file is deleted. Files can be marked as deleted before the actual deletion - * of the contents and metadata happens. Deleted files should be treated as if they don’t - * exist. Only files in READY state can transition into DELETED state. - */ - Status: 'AWAITING_UPLOAD' | 'UPLOADING' | 'READY' | 'UPLOAD_ERROR' | 'DELETED'; - /** File extension (if any) */ - extension?: string; - hash?: { - md5?: string; - sha1?: string; - sha256?: string; - sha384?: string; - sha512?: string; - ssdeep?: string; - tlsh?: string; - }; - mime_type?: string; - mode?: string; - /** File name */ - name: string; - /** The full path to the file on the host machine */ - path: string; - /** The total size in bytes */ - size: number; - created?: string; - type: string; - }; -} diff --git a/x-pack/plugins/security_solution/common/experimental_features.ts b/x-pack/plugins/security_solution/common/experimental_features.ts index aa581971e5f09..ab5a9bdf9638a 100644 --- a/x-pack/plugins/security_solution/common/experimental_features.ts +++ b/x-pack/plugins/security_solution/common/experimental_features.ts @@ -64,6 +64,22 @@ export const allowedExperimentalValues = Object.freeze({ * Enables endpoint package level rbac */ endpointRbacEnabled: false, + + /** + * Enables endpoint package level rbac for response actions only. + * if endpointRbacEnabled is enabled, it will take precedence. + */ + endpointRbacV1Enabled: false, + + /** + * Enables the Guided Onboarding tour in security + */ + guidedOnboarding: false, + + /** + * Enables the alert details page currently only accessible via the alert details flyout and alert table context menu + */ + alertDetailsPageEnabled: false, }); type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts index ab2c2d4d7c948..15e2d99772af8 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts @@ -32,6 +32,7 @@ export interface EndpointFields { /** A count of pending endpoint actions against the host */ pendingActions?: Maybe<EndpointPendingActions['pending_actions']>; elasticAgentStatus?: Maybe<HostStatus>; + fleetAgentId?: Maybe<string>; id?: Maybe<string>; } diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts index cefd43fe5f99e..b35a6aa154999 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts @@ -9,10 +9,13 @@ import type { IEsSearchRequest, IEsSearchResponse } from '@kbn/data-plugin/commo import type { ESQuery } from '../../../../typed_json'; import type { Inspect, Maybe, SortField, TimerangeInput } from '../../../common'; +import type { RiskScoreEntity } from '../common'; export interface RiskScoreRequestOptions extends IEsSearchRequest { defaultIndex: string[]; + riskScoreEntity: RiskScoreEntity; timerange?: TimerangeInput; + includeAlertsCount?: boolean; onlyLatest?: boolean; pagination?: { cursorStart: number; @@ -47,6 +50,8 @@ export interface HostRiskScore { name: string; risk: RiskStats; }; + alertsCount?: number; + oldestAlertTimestamp?: string; } export interface UserRiskScore { @@ -55,6 +60,8 @@ export interface UserRiskScore { name: string; risk: RiskStats; }; + alertsCount?: number; + oldestAlertTimestamp?: string; } export interface RuleRisk { @@ -73,6 +80,7 @@ export const enum RiskScoreFields { userName = 'user.name', userRiskScore = 'user.risk.calculated_score_norm', userRisk = 'user.risk.calculated_level', + alertsCount = 'alertsCount', } export interface RiskScoreItem { @@ -85,6 +93,8 @@ export interface RiskScoreItem { [RiskScoreFields.hostRiskScore]: Maybe<number>; [RiskScoreFields.userRiskScore]: Maybe<number>; + + [RiskScoreFields.alertsCount]: Maybe<number>; } export const enum RiskSeverity { diff --git a/x-pack/plugins/security_solution/common/types/timeline/index.ts b/x-pack/plugins/security_solution/common/types/timeline/index.ts index 64621f0a0598d..706283288f58c 100644 --- a/x-pack/plugins/security_solution/common/types/timeline/index.ts +++ b/x-pack/plugins/security_solution/common/types/timeline/index.ts @@ -319,6 +319,7 @@ export enum TimelineId { active = 'timeline-1', casePage = 'timeline-case', test = 'timeline-test', // Reserved for testing purposes + detectionsAlertDetailsPage = 'detections-alert-details-page', } export enum TableId { diff --git a/x-pack/plugins/security_solution/cypress/e2e/cases/attach_alert_to_case.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/cases/attach_alert_to_case.cy.ts index 8a6d3d9a5fed1..bc6d279e979eb 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/cases/attach_alert_to_case.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/cases/attach_alert_to_case.cy.ts @@ -15,7 +15,7 @@ import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { login, visit, waitForPageWithoutDateRange } from '../../tasks/login'; import { ALERTS_URL } from '../../urls/navigation'; -import { ATTACH_ALERT_TO_CASE_BUTTON, TIMELINE_CONTEXT_MENU_BTN } from '../../screens/alerts'; +import { ATTACH_ALERT_TO_CASE_BUTTON, ATTACH_TO_NEW_CASE_BUTTON } from '../../screens/alerts'; import { LOADING_INDICATOR } from '../../screens/security_header'; const loadDetectionsPage = (role: ROLES) => { @@ -40,9 +40,16 @@ describe('Alerts timeline', () => { waitForPageToBeLoaded(); }); - it('should not allow user with read only privileges to attach alerts to cases', () => { - // Disabled actions for read only users are hidden, so actions button should not show - cy.get(TIMELINE_CONTEXT_MENU_BTN).should('not.exist'); + it('should not allow user with read only privileges to attach alerts to existing cases', () => { + // Disabled actions for read only users are hidden, so only open alert details button should show + expandFirstAlertActions(); + cy.get(ATTACH_ALERT_TO_CASE_BUTTON).should('not.exist'); + }); + + it('should not allow user with read only privileges to attach alerts to a new case', () => { + // Disabled actions for read only users are hidden, so only open alert details button should show + expandFirstAlertActions(); + cy.get(ATTACH_TO_NEW_CASE_BUTTON).should('not.exist'); }); }); diff --git a/x-pack/plugins/security_solution/cypress/e2e/dashboards/entity_analytics.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/dashboards/entity_analytics.cy.ts index 93b3a4594f166..b5c2b07dc72b6 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/dashboards/entity_analytics.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/dashboards/entity_analytics.cy.ts @@ -7,10 +7,10 @@ import { login, visit } from '../../tasks/login'; -import { ENTITY_ANALYTICS_URL } from '../../urls/navigation'; +import { ALERTS_URL, ENTITY_ANALYTICS_URL } from '../../urls/navigation'; import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver'; -import { cleanKibana } from '../../tasks/common'; +import { cleanKibana, deleteAlertsAndRules } from '../../tasks/common'; import { ANOMALIES_TABLE, ANOMALIES_TABLE_ROWS, @@ -26,8 +26,19 @@ import { USERS_TABLE, USERS_TABLE_ROWS, USER_RISK_SCORE_NO_DATA_DETECTED, + USERS_TABLE_ALERT_CELL, + HOSTS_TABLE_ALERT_CELL, } from '../../screens/entity_analytics'; import { openRiskTableFilterAndSelectTheLowOption } from '../../tasks/host_risk'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; +import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; +import { getNewRule } from '../../objects/rule'; +import { QUERY_TAB_BUTTON } from '../../screens/timeline'; +import { closeTimeline } from '../../tasks/timeline'; +import { clickOnFirstHostsAlerts, clickOnFirstUsersAlerts } from '../../tasks/risk_scores'; + +const TEST_USER_ALERTS = 2; +const SIEM_KIBANA_HOST_ALERTS = 2; describe('Entity Analytics Dashboard', () => { before(() => { @@ -62,11 +73,11 @@ describe('Entity Analytics Dashboard', () => { esArchiverUnload('risk_users_no_data'); }); - it('shows no data detected propmpt for host risk score module', () => { + it('shows no data detected prompt for host risk score module', () => { cy.get(HOST_RISK_SCORE_NO_DATA_DETECTED).should('be.visible'); }); - it('shows no data detected propmpt for user risk score module', () => { + it('shows no data detected prompt for user risk score module', () => { cy.get(USER_RISK_SCORE_NO_DATA_DETECTED).should('be.visible'); }); }); @@ -112,12 +123,39 @@ describe('Entity Analytics Dashboard', () => { cy.get(HOSTS_TABLE_ROWS).should('have.length', 5); }); + it('renders alerts column', () => { + cy.get(HOSTS_TABLE_ALERT_CELL).should('have.length', 5); + }); + it('filters by risk classification', () => { openRiskTableFilterAndSelectTheLowOption(); cy.get(HOSTS_DONUT_CHART).should('include.text', '1Total'); cy.get(HOSTS_TABLE_ROWS).should('have.length', 1); }); + + describe('With alerts data', () => { + before(() => { + createCustomRuleEnabled(getNewRule()); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + visit(ENTITY_ANALYTICS_URL); + }); + + after(() => { + deleteAlertsAndRules(); + }); + + it('populates alerts column', () => { + cy.get(HOSTS_TABLE_ALERT_CELL).first().should('include.text', SIEM_KIBANA_HOST_ALERTS); + }); + + it('opens timeline when alerts count is clicked', () => { + clickOnFirstHostsAlerts(); + cy.get(QUERY_TAB_BUTTON).should('contain.text', SIEM_KIBANA_HOST_ALERTS); + closeTimeline(); + }); + }); }); describe('With user risk data', () => { @@ -139,12 +177,39 @@ describe('Entity Analytics Dashboard', () => { cy.get(USERS_TABLE_ROWS).should('have.length', 5); }); + it('renders alerts column', () => { + cy.get(USERS_TABLE_ALERT_CELL).should('have.length', 5); + }); + it('filters by risk classification', () => { openRiskTableFilterAndSelectTheLowOption(); cy.get(USERS_DONUT_CHART).should('include.text', '2Total'); cy.get(USERS_TABLE_ROWS).should('have.length', 2); }); + + describe('With alerts data', () => { + before(() => { + createCustomRuleEnabled(getNewRule()); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + visit(ENTITY_ANALYTICS_URL); + }); + + after(() => { + deleteAlertsAndRules(); + }); + + it('populates alerts column', () => { + cy.get(USERS_TABLE_ALERT_CELL).first().should('include.text', TEST_USER_ALERTS); + }); + + it('opens timeline when alerts count is clicked', () => { + clickOnFirstUsersAlerts(); + cy.get(QUERY_TAB_BUTTON).should('contain.text', TEST_USER_ALERTS); + closeTimeline(); + }); + }); }); describe('With anomalies data', () => { diff --git a/x-pack/plugins/security_solution/cypress/e2e/dashboards/upgrade_risk_score.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/dashboards/upgrade_risk_score.cy.ts index 5fcaca256656c..bcbc85849c166 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/dashboards/upgrade_risk_score.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/dashboards/upgrade_risk_score.cy.ts @@ -11,7 +11,7 @@ import { UPGRADE_HOST_RISK_SCORE_BUTTON, UPGRADE_USER_RISK_SCORE_BUTTON, UPGRADE_CANCELLATION_BUTTON, - UPGRADE_CONFIRMARION_MODAL, + UPGRADE_CONFIRMATION_MODAL, RISK_SCORE_DASHBOARDS_INSTALLATION_SUCCESS_TOAST, } from '../../screens/entity_analytics'; import { deleteRiskScore, installLegacyRiskScoreModule } from '../../tasks/api_calls/risk_scores'; @@ -61,14 +61,14 @@ describe('Upgrade risk scores', () => { it('should show a confirmation modal for upgrading host risk score', () => { clickUpgradeRiskScore(RiskScoreEntity.host); - cy.get(UPGRADE_CONFIRMARION_MODAL(RiskScoreEntity.host)).should('exist'); + cy.get(UPGRADE_CONFIRMATION_MODAL(RiskScoreEntity.host)).should('exist'); }); it('display a link to host risk score Elastic doc', () => { clickUpgradeRiskScore(RiskScoreEntity.host); cy.get(UPGRADE_CANCELLATION_BUTTON) - .get(`${UPGRADE_CONFIRMARION_MODAL(RiskScoreEntity.host)} a`) + .get(`${UPGRADE_CONFIRMATION_MODAL(RiskScoreEntity.host)} a`) .then((link) => { expect(link.prop('href')).to.eql( `https://www.elastic.co/guide/en/security/current/${RiskScoreEntity.host}-risk-score.html` @@ -116,14 +116,14 @@ describe('Upgrade risk scores', () => { it('should show a confirmation modal for upgrading user risk score', () => { clickUpgradeRiskScore(RiskScoreEntity.user); - cy.get(UPGRADE_CONFIRMARION_MODAL(RiskScoreEntity.user)).should('exist'); + cy.get(UPGRADE_CONFIRMATION_MODAL(RiskScoreEntity.user)).should('exist'); }); it('display a link to user risk score Elastic doc', () => { clickUpgradeRiskScore(RiskScoreEntity.user); cy.get(UPGRADE_CANCELLATION_BUTTON) - .get(`${UPGRADE_CONFIRMARION_MODAL(RiskScoreEntity.user)} a`) + .get(`${UPGRADE_CONFIRMATION_MODAL(RiskScoreEntity.user)} a`) .then((link) => { expect(link.prop('href')).to.eql( `https://www.elastic.co/guide/en/security/current/${RiskScoreEntity.user}-risk-score.html` diff --git a/x-pack/plugins/security_solution/cypress/e2e/detection_alert_details/navigation.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/detection_alert_details/navigation.cy.ts new file mode 100644 index 0000000000000..4e9953b88e495 --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/e2e/detection_alert_details/navigation.cy.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 { expandFirstAlert, waitForAlertsPanelToBeLoaded } from '../../tasks/alerts'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; +import { cleanKibana } from '../../tasks/common'; +import { login, visit } from '../../tasks/login'; + +import { getNewRule } from '../../objects/rule'; +import type { CustomRule } from '../../objects/rule'; + +import { ALERTS_URL } from '../../urls/navigation'; +import { + OPEN_ALERT_DETAILS_PAGE_CONTEXT_MENU_BTN, + TIMELINE_CONTEXT_MENU_BTN, +} from '../../screens/alerts'; +import { PAGE_TITLE } from '../../screens/common/page'; +import { OPEN_ALERT_DETAILS_PAGE } from '../../screens/alerts_details'; + +describe('Alert Details Page Navigation', () => { + describe('navigating to alert details page', () => { + let rule: CustomRule; + before(() => { + rule = getNewRule(); + cleanKibana(); + login(); + createCustomRuleEnabled(rule, 'rule1'); + visit(ALERTS_URL); + waitForAlertsPanelToBeLoaded(); + }); + + describe('context menu', () => { + it('should navigate to the details page from the alert context menu', () => { + cy.get(TIMELINE_CONTEXT_MENU_BTN).first().click({ force: true }); + cy.get(OPEN_ALERT_DETAILS_PAGE_CONTEXT_MENU_BTN).click({ force: true }); + cy.get(PAGE_TITLE).should('contain.text', rule.name); + cy.url().should('include', '/summary'); + }); + }); + + describe('flyout', () => { + beforeEach(() => { + visit(ALERTS_URL); + waitForAlertsPanelToBeLoaded(); + }); + + it('should navigate to the details page from the alert flyout', () => { + expandFirstAlert(); + cy.get(OPEN_ALERT_DETAILS_PAGE).click({ force: true }); + cy.get(PAGE_TITLE).should('contain.text', rule.name); + cy.url().should('include', '/summary'); + }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/cypress/e2e/detection_rules/bulk_edit_rules.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/detection_rules/bulk_edit_rules.cy.ts index 0819581e14815..13a6fa0333779 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/detection_rules/bulk_edit_rules.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/detection_rules/bulk_edit_rules.cy.ts @@ -289,6 +289,32 @@ describe('Detection rules, bulk edit', () => { checkTagsInTagsFilter(resultingTagsInFilter); }); + it('Display success toast after adding tags', () => { + const tagsToBeAdded = ['tag-to-add-1', 'tag-to-add-2']; + + // check if only pre-populated tags exist in the tags filter + checkTagsInTagsFilter(prePopulatedTags); + + cy.get(EUI_FILTER_SELECT_ITEM) + .should('have.length', prePopulatedTags.length) + .each(($el, index) => { + cy.wrap($el).should('have.text', prePopulatedTags[index]); + }); + + selectNumberOfRules(expectedNumberOfCustomRulesToBeEdited); + + // open add tags form and add 2 new tags + openBulkEditAddTagsForm(); + typeTags(tagsToBeAdded); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ rulesCount: expectedNumberOfCustomRulesToBeEdited }); + + cy.get(TOASTER_BODY).should( + 'have.text', + `You've successfully updated ${expectedNumberOfCustomRulesToBeEdited} rules` + ); + }); + it('Overwrite tags in custom rules', () => { const tagsToOverwrite = ['overwrite-tag-1']; @@ -392,6 +418,25 @@ describe('Detection rules, bulk edit', () => { hasIndexPatterns(resultingIndexPatterns.join('')); }); + it('Display success toast after editing the index pattern', () => { + const indexPattersToBeAdded = ['index-to-add-1-*', 'index-to-add-2-*']; + + // select only rules that are not ML + selectNumberOfRules(expectedNumberOfCustomRulesToBeEdited); + unselectRuleByName(getMachineLearningRule().name); + + openBulkEditAddIndexPatternsForm(); + typeIndexPatterns(indexPattersToBeAdded); + submitBulkEditForm(); + + waitForBulkEditActionToFinish({ rulesCount: expectedNumberOfNotMLRules }); + + cy.get(TOASTER_BODY).should( + 'have.text', + `You've successfully updated ${expectedNumberOfNotMLRules} rules. If you did not select to apply changes to rules using Kibana data views, those rules were not updated and will continue using data views.` + ); + }); + it('Overwrite index patterns in custom rules', () => { const indexPattersToWrite = ['index-to-write-1-*', 'index-to-write-2-*']; diff --git a/x-pack/plugins/security_solution/cypress/e2e/detection_rules/import_rules.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/detection_rules/import_rules.cy.ts index 48f3ffaf18412..7ee3a7e40647f 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/detection_rules/import_rules.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/detection_rules/import_rules.cy.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TOASTER } from '../../screens/alerts_detection_rules'; +import { RULES_ROW, RULES_TABLE, TOASTER } from '../../screens/alerts_detection_rules'; import { importRules, importRulesWithOverwriteAll } from '../../tasks/alerts_detection_rules'; import { cleanKibana, deleteAlertsAndRules, reload } from '../../tasks/common'; import { login, visitWithoutDateRange } from '../../tasks/login'; @@ -24,6 +24,9 @@ describe('Import rules', () => { }); it('Imports a custom rule with exceptions', function () { + const expectedNumberOfRules = 1; + const expectedImportedRuleName = 'Test Custom Rule'; + importRules('7_16_rules.ndjson'); cy.wait('@import').then(({ response }) => { @@ -32,6 +35,13 @@ describe('Import rules', () => { 'have.text', 'Successfully imported 1 ruleSuccessfully imported 2 exceptions.' ); + + cy.get(RULES_TABLE).then(($table) => { + const rulesRow = cy.wrap($table.find(RULES_ROW)); + + rulesRow.should('have.length', expectedNumberOfRules); + rulesRow.should('include.text', expectedImportedRuleName); + }); }); }); diff --git a/x-pack/plugins/security_solution/cypress/e2e/exceptions/exceptions_management_flow/exceptions_table.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/exceptions/exceptions_management_flow/exceptions_table.cy.ts index 213ea64fc4ceb..4a806eae4d53d 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/exceptions/exceptions_management_flow/exceptions_table.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/exceptions/exceptions_management_flow/exceptions_table.cy.ts @@ -20,6 +20,7 @@ import { searchForExceptionList, waitForExceptionsTableToBeLoaded, clearSearchSelection, + expandExceptionActions, } from '../../../tasks/exceptions_table'; import { EXCEPTIONS_TABLE_DELETE_BTN, @@ -67,16 +68,11 @@ describe('Exceptions Table', () => { ); visitWithoutDateRange(EXCEPTIONS_URL); - - // Using cy.contains because we do not care about the exact text, - // just checking number of lists shown - cy.contains(EXCEPTIONS_TABLE_SHOWING_LISTS, '3'); }); it('Exports exception list', function () { cy.intercept(/(\/api\/exception_lists\/_export)/).as('export'); - visitWithoutDateRange(EXCEPTIONS_URL); waitForExceptionsTableToBeLoaded(); exportExceptionList(); @@ -91,7 +87,6 @@ describe('Exceptions Table', () => { }); it('Filters exception lists on search', () => { - visitWithoutDateRange(EXCEPTIONS_URL); waitForExceptionsTableToBeLoaded(); // Using cy.contains because we do not care about the exact text, @@ -142,7 +137,6 @@ describe('Exceptions Table', () => { }); it('Deletes exception list without rule reference', () => { - visitWithoutDateRange(EXCEPTIONS_URL); waitForExceptionsTableToBeLoaded(); // Using cy.contains because we do not care about the exact text, @@ -189,6 +183,7 @@ describe('Exceptions Table - read only', () => { }); it('Delete icon is not shown', () => { - cy.get(EXCEPTIONS_TABLE_DELETE_BTN).should('not.exist'); + expandExceptionActions(); + cy.get(EXCEPTIONS_TABLE_DELETE_BTN).should('be.disabled'); }); }); diff --git a/x-pack/plugins/security_solution/cypress/e2e/guided_onboarding/tour.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/guided_onboarding/tour.cy.ts index 41e77e8aeac29..0339445bc8240 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/guided_onboarding/tour.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/guided_onboarding/tour.cy.ts @@ -7,7 +7,6 @@ import { login, visit } from '../../tasks/login'; import { completeTour, goToNextStep, skipTour } from '../../tasks/guided_onboarding'; -import { SECURITY_TOUR_ACTIVE_KEY } from '../../../public/common/components/guided_onboarding'; import { OVERVIEW_URL } from '../../urls/navigation'; import { WELCOME_STEP, @@ -21,11 +20,11 @@ before(() => { login(); }); -describe('Guided onboarding tour', () => { +// need to redo these tests for new implementation +describe.skip('Guided onboarding tour', () => { describe('Tour is enabled', () => { beforeEach(() => { visit(OVERVIEW_URL); - window.localStorage.setItem(SECURITY_TOUR_ACTIVE_KEY, 'true'); }); it('can be completed', () => { diff --git a/x-pack/plugins/security_solution/cypress/e2e/urls/not_found.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/urls/not_found.cy.ts index 8bd3e6a9ed93b..4dc7d5231dcdd 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/urls/not_found.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/urls/not_found.cy.ts @@ -30,7 +30,8 @@ describe('Display not found page', () => { visit(TIMELINES_URL); }); - it('navigates to the alerts page with incorrect link', () => { + // TODO: We need to determine what we want the behavior to be here + it.skip('navigates to the alerts page with incorrect link', () => { visit(`${ALERTS_URL}/randomUrl`); cy.get(NOT_FOUND).should('exist'); }); diff --git a/x-pack/plugins/security_solution/cypress/screens/alerts.ts b/x-pack/plugins/security_solution/cypress/screens/alerts.ts index 2434b713a6452..acb2f47bcf27c 100644 --- a/x-pack/plugins/security_solution/cypress/screens/alerts.ts +++ b/x-pack/plugins/security_solution/cypress/screens/alerts.ts @@ -71,6 +71,9 @@ export const OPEN_ALERT_BTN = '[data-test-subj="open-alert-status"]'; export const OPENED_ALERTS_FILTER_BTN = '[data-test-subj="openAlerts"]'; +export const OPEN_ALERT_DETAILS_PAGE_CONTEXT_MENU_BTN = + '[data-test-subj="open-alert-details-page-menu-item"]'; + export const PROCESS_NAME_COLUMN = '[data-test-subj="dataGridHeaderCell-process.name"]'; export const PROCESS_NAME = '[data-test-subj="formatted-field-process.name"]'; @@ -103,6 +106,8 @@ export const USER_NAME = '[data-test-subj^=formatted-field][data-test-subj$=user export const ATTACH_ALERT_TO_CASE_BUTTON = '[data-test-subj="add-to-existing-case-action"]'; +export const ATTACH_TO_NEW_CASE_BUTTON = '[data-test-subj="add-to-new-case-action"]'; + export const USER_COLUMN = '[data-gridcell-column-id="user.name"]'; export const HOST_RISK_HEADER_COLIMN = diff --git a/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts b/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts index 5963307075113..9a1ac0b8d08f1 100644 --- a/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts +++ b/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts @@ -81,3 +81,5 @@ export const INSIGHTS_RELATED_ALERTS_BY_ANCESTRY = `[data-test-subj='related-ale export const INSIGHTS_INVESTIGATE_ANCESTRY_ALERTS_IN_TIMELINE_BUTTON = `[data-test-subj='investigate-ancestry-in-timeline']`; export const ENRICHED_DATA_ROW = `[data-test-subj='EnrichedDataRow']`; + +export const OPEN_ALERT_DETAILS_PAGE = `[data-test-subj="open-alert-details-page"]`; diff --git a/x-pack/plugins/security_solution/cypress/screens/entity_analytics.ts b/x-pack/plugins/security_solution/cypress/screens/entity_analytics.ts index 4d60556173fd9..6095151fee57b 100644 --- a/x-pack/plugins/security_solution/cypress/screens/entity_analytics.ts +++ b/x-pack/plugins/security_solution/cypress/screens/entity_analytics.ts @@ -47,9 +47,15 @@ export const ANOMALIES_TABLE = export const ANOMALIES_TABLE_ROWS = '[data-test-subj="entity_analytics_anomalies"] .euiTableRow'; -export const UPGRADE_CONFIRMARION_MODAL = (riskScoreEntity: RiskScoreEntity) => +export const UPGRADE_CONFIRMATION_MODAL = (riskScoreEntity: RiskScoreEntity) => `[data-test-subj="${riskScoreEntity}-risk-score-upgrade-confirmation-modal"]`; export const UPGRADE_CONFIRMATION_BUTTON = '[data-test-subj="confirmModalConfirmButton"]'; export const UPGRADE_CANCELLATION_BUTTON = '[data-test-subj="confirmModalCancelButton"]'; + +export const USERS_TABLE_ALERT_CELL = + '[data-test-subj="entity_analytics_users"] [data-test-subj="risk-score-alerts"]'; + +export const HOSTS_TABLE_ALERT_CELL = + '[data-test-subj="entity_analytics_hosts"] [data-test-subj="risk-score-alerts"]'; diff --git a/x-pack/plugins/security_solution/cypress/screens/exceptions.ts b/x-pack/plugins/security_solution/cypress/screens/exceptions.ts index bf97d3e2e2039..00f06777bd111 100644 --- a/x-pack/plugins/security_solution/cypress/screens/exceptions.ts +++ b/x-pack/plugins/security_solution/cypress/screens/exceptions.ts @@ -34,7 +34,10 @@ export const ENTRY_DELETE_BTN = '[data-test-subj="builderItemEntryDeleteButton"] export const CANCEL_BTN = '[data-test-subj="cancelExceptionAddButton"]'; -export const EXCEPTIONS_TABLE = '[data-test-subj="exceptions-table"]'; +export const EXCEPTIONS_OVERFLOW_ACTIONS_BTN = + '[data-test-subj="exceptionsListCardOverflowActions"]'; + +export const EXCEPTIONS_TABLE = '[data-test-subj="pageContainer"]'; export const EXCEPTIONS_TABLE_SEARCH = '[data-test-subj="exceptionsHeaderSearchInput"]'; @@ -47,7 +50,7 @@ export const EXCEPTIONS_TABLE_EXPORT_BTN = '[data-test-subj="exceptionsTableExpo export const EXCEPTIONS_TABLE_SEARCH_CLEAR = '[data-test-subj="allExceptionListsPanel"] button.euiFormControlLayoutClearButton'; -export const EXCEPTIONS_TABLE_LIST_NAME = '[data-test-subj="exceptionsTableName"]'; +export const EXCEPTIONS_TABLE_LIST_NAME = '[data-test-subj="exception-list-name"]'; export const EXCEPTIONS_TABLE_MODAL = '[data-test-subj="referenceErrorModal"]'; diff --git a/x-pack/plugins/security_solution/cypress/tasks/exceptions_table.ts b/x-pack/plugins/security_solution/cypress/tasks/exceptions_table.ts index f2bc0c1f7e6ed..cee6929b3887d 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/exceptions_table.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/exceptions_table.ts @@ -13,37 +13,45 @@ import { EXCEPTIONS_TABLE_MODAL, EXCEPTIONS_TABLE_MODAL_CONFIRM_BTN, EXCEPTIONS_TABLE_EXPORT_BTN, + EXCEPTIONS_OVERFLOW_ACTIONS_BTN, } from '../screens/exceptions'; -export const waitForExceptionsTableToBeLoaded = () => { - cy.get(EXCEPTIONS_TABLE).should('exist'); - cy.get(EXCEPTIONS_TABLE_SEARCH).should('exist'); +export const clearSearchSelection = () => { + cy.get(EXCEPTIONS_TABLE_SEARCH_CLEAR).first().click(); }; -export const searchForExceptionList = (searchText: string) => { - if (Cypress.browser.name === 'firefox') { - cy.get(EXCEPTIONS_TABLE_SEARCH).type(`${searchText}{enter}`, { force: true }); - } else { - cy.get(EXCEPTIONS_TABLE_SEARCH).type(searchText, { force: true }).trigger('search'); - } +export const expandExceptionActions = () => { + cy.get(EXCEPTIONS_OVERFLOW_ACTIONS_BTN).first().click(); +}; + +export const exportExceptionList = () => { + cy.get(EXCEPTIONS_OVERFLOW_ACTIONS_BTN).first().click(); + cy.get(EXCEPTIONS_TABLE_EXPORT_BTN).first().click(); }; export const deleteExceptionListWithoutRuleReference = () => { + cy.get(EXCEPTIONS_OVERFLOW_ACTIONS_BTN).first().click(); cy.get(EXCEPTIONS_TABLE_DELETE_BTN).first().click(); cy.get(EXCEPTIONS_TABLE_MODAL).should('not.exist'); }; export const deleteExceptionListWithRuleReference = () => { + cy.get(EXCEPTIONS_OVERFLOW_ACTIONS_BTN).first().click(); cy.get(EXCEPTIONS_TABLE_DELETE_BTN).first().click(); cy.get(EXCEPTIONS_TABLE_MODAL).should('exist'); cy.get(EXCEPTIONS_TABLE_MODAL_CONFIRM_BTN).first().click(); cy.get(EXCEPTIONS_TABLE_MODAL).should('not.exist'); }; -export const exportExceptionList = () => { - cy.get(EXCEPTIONS_TABLE_EXPORT_BTN).first().click(); +export const searchForExceptionList = (searchText: string) => { + if (Cypress.browser.name === 'firefox') { + cy.get(EXCEPTIONS_TABLE_SEARCH).type(`${searchText}{enter}`, { force: true }); + } else { + cy.get(EXCEPTIONS_TABLE_SEARCH).type(searchText, { force: true }).trigger('search'); + } }; -export const clearSearchSelection = () => { - cy.get(EXCEPTIONS_TABLE_SEARCH_CLEAR).first().click(); +export const waitForExceptionsTableToBeLoaded = () => { + cy.get(EXCEPTIONS_TABLE).should('exist'); + cy.get(EXCEPTIONS_TABLE_SEARCH).should('exist'); }; diff --git a/x-pack/plugins/security_solution/cypress/tasks/risk_scores/index.ts b/x-pack/plugins/security_solution/cypress/tasks/risk_scores/index.ts index ab80122de1dd0..4b81e4d728990 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/risk_scores/index.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/risk_scores/index.ts @@ -8,9 +8,11 @@ import { ENABLE_HOST_RISK_SCORE_BUTTON, ENABLE_USER_RISK_SCORE_BUTTON, + HOSTS_TABLE_ALERT_CELL, UPGRADE_CONFIRMATION_BUTTON, UPGRADE_HOST_RISK_SCORE_BUTTON, UPGRADE_USER_RISK_SCORE_BUTTON, + USERS_TABLE_ALERT_CELL, } from '../../screens/entity_analytics'; import { INGEST_PIPELINES_URL, @@ -73,3 +75,11 @@ export const clickUpgradeRiskScore = (riskScoreEntity: RiskScoreEntity) => { export const clickUpgradeRiskScoreConfirmed = () => { cy.get(UPGRADE_CONFIRMATION_BUTTON).click(); }; + +export const clickOnFirstUsersAlerts = () => { + cy.get(USERS_TABLE_ALERT_CELL).first().click(); +}; + +export const clickOnFirstHostsAlerts = () => { + cy.get(HOSTS_TABLE_ALERT_CELL).first().click(); +}; diff --git a/x-pack/plugins/security_solution/cypress/tasks/rule_details.ts b/x-pack/plugins/security_solution/cypress/tasks/rule_details.ts index 3d4f25d248e6a..339dd8f9e46c1 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/rule_details.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/rule_details.ts @@ -40,7 +40,7 @@ import { addsFields, closeFieldsBrowser, filterFieldsBrowser } from './fields_br export const enablesRule = () => { // Rules get enabled via _bulk_action endpoint - cy.intercept('POST', '/api/detection_engine/rules/_bulk_action').as('bulk_action'); + cy.intercept('POST', '/api/detection_engine/rules/_bulk_action?dry_run=false').as('bulk_action'); cy.get(RULE_SWITCH).should('be.visible'); cy.get(RULE_SWITCH).click(); cy.wait('@bulk_action').then(({ response }) => { diff --git a/x-pack/plugins/security_solution/cypress/tsconfig.json b/x-pack/plugins/security_solution/cypress/tsconfig.json index 55ba3de538060..a0d03c742d07c 100644 --- a/x-pack/plugins/security_solution/cypress/tsconfig.json +++ b/x-pack/plugins/security_solution/cypress/tsconfig.json @@ -17,7 +17,7 @@ "node", ], }, - "references": [ + "kbn_references": [ { "path": "../tsconfig.json" } ] } diff --git a/x-pack/plugins/security_solution/kibana.json b/x-pack/plugins/security_solution/kibana.json index 4a6e3a105ee72..bddfc36c7d61d 100644 --- a/x-pack/plugins/security_solution/kibana.json +++ b/x-pack/plugins/security_solution/kibana.json @@ -19,6 +19,7 @@ "embeddable", "eventLog", "features", + "guidedOnboarding", "inspector", "kubernetesSecurity", "lens", diff --git a/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx b/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx index 37efdce430317..c5d86011226c3 100644 --- a/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx @@ -10,7 +10,7 @@ import { EuiHeaderSection, EuiHeaderSectionItem, } from '@elastic/eui'; -import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; import { useLocation } from 'react-router-dom'; import { createHtmlPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; import { i18n } from '@kbn/i18n'; @@ -28,7 +28,6 @@ import { timelineDefaults } from '../../../timelines/store/timeline/defaults'; import { timelineSelectors } from '../../../timelines/store/timeline'; import { useShallowEqualSelector } from '../../../common/hooks/use_selector'; import { getScopeFromPath, showSourcererByPath } from '../../../common/containers/sourcerer'; -import { useTourContext } from '../../../common/components/guided_onboarding'; const BUTTON_ADD_DATA = i18n.translate('xpack.securitySolution.globalHeader.buttonAddData', { defaultMessage: 'Add integrations', @@ -83,12 +82,6 @@ export const GlobalHeader = React.memo( }; }, [portalNode, setHeaderActionMenu, theme.theme$]); - const { isTourShown, endTour } = useTourContext(); - const closeOnboardingTourIfShown = useCallback(() => { - if (isTourShown) { - endTour(); - } - }, [isTourShown, endTour]); return ( <InPortal node={portalNode}> <EuiHeaderSection side="right"> @@ -105,7 +98,6 @@ export const GlobalHeader = React.memo( data-test-subj="add-data" href={href} iconType="indexOpen" - onClick={closeOnboardingTourIfShown} > {BUTTON_ADD_DATA} </EuiHeaderLink> diff --git a/x-pack/plugins/security_solution/public/app/home/index.tsx b/x-pack/plugins/security_solution/public/app/home/index.tsx index 36940cc055645..3711a990ef726 100644 --- a/x-pack/plugins/security_solution/public/app/home/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/index.tsx @@ -22,7 +22,7 @@ import { useUpgradeSecurityPackages } from '../../common/hooks/use_upgrade_secur import { GlobalHeader } from './global_header'; import { ConsoleManager } from '../../management/components/console/components/console_manager'; -import { TourContextProvider } from '../../common/components/guided_onboarding'; +import { TourContextProvider } from '../../common/components/guided_onboarding_tour'; import { useUrlState } from '../../common/hooks/use_url_state'; import { useUpdateBrowserTitle } from '../../common/hooks/use_update_browser_title'; diff --git a/x-pack/plugins/security_solution/public/app/translations.ts b/x-pack/plugins/security_solution/public/app/translations.ts index 0e74f701eefdf..e7c4e3eeb3003 100644 --- a/x-pack/plugins/security_solution/public/app/translations.ts +++ b/x-pack/plugins/security_solution/public/app/translations.ts @@ -54,7 +54,7 @@ export const RULES = i18n.translate('xpack.securitySolution.navigation.rules', { }); export const EXCEPTIONS = i18n.translate('xpack.securitySolution.navigation.exceptions', { - defaultMessage: 'Exception lists', + defaultMessage: 'Rule Exceptions', }); export const ALERTS = i18n.translate('xpack.securitySolution.navigation.alerts', { diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx index 67d9be1817549..2be5960d92a32 100644 --- a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx @@ -58,7 +58,7 @@ describe('DraggableWrapper', () => { const mount = useMountAppended(); beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterEach(() => { @@ -66,7 +66,9 @@ describe('DraggableWrapper', () => { if (portal != null) { portal.innerHTML = ''; } + }); + afterAll(() => { jest.useRealTimers(); }); diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx index a0ef3b8904e3f..38cdaf583fa13 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx @@ -7,19 +7,22 @@ import type { EuiTabbedContentTab } from '@elastic/eui'; import { - EuiHorizontalRule, - EuiTabbedContent, - EuiSpacer, - EuiLoadingContent, - EuiNotificationBadge, EuiFlexGroup, EuiFlexItem, + EuiHorizontalRule, + EuiLoadingContent, EuiLoadingSpinner, + EuiNotificationBadge, + EuiSpacer, + EuiTabbedContent, } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; import { isEmpty } from 'lodash'; +import { GuidedOnboardingTourStep } from '../guided_onboarding_tour/tour_step'; +import { isDetectionsAlertsTable } from '../top_n/helpers'; +import { getTourAnchor, SecurityStepId } from '../guided_onboarding_tour/tour_config'; import type { AlertRawEventData } from './osquery_tab'; import { useOsqueryTab } from './osquery_tab'; import { EventFieldsBrowser } from './event_fields_browser'; @@ -179,6 +182,8 @@ const EventDetailsComponent: React.FC<Props> = ({ [detailsEcsData] ); + const isTourAnchor = useMemo(() => isDetectionsAlertsTable(scopeId), [scopeId]); + const showThreatSummary = useMemo(() => { const hasEnrichments = enrichmentCount > 0; const hasRiskInfoWithLicense = isLicenseValid && (hostRisk || userRisk); @@ -388,6 +393,7 @@ const EventDetailsComponent: React.FC<Props> = ({ const osqueryTab = useOsqueryTab({ rawEventData: rawEventData as AlertRawEventData, + ...(detailsEcsData !== null ? { ecsData: detailsEcsData } : {}), }); const tabs = useMemo(() => { @@ -401,14 +407,26 @@ const EventDetailsComponent: React.FC<Props> = ({ [tabs, selectedTabId] ); + const tourAnchor = useMemo( + () => (isTourAnchor ? { 'tour-step': getTourAnchor(3, SecurityStepId.alertsCases) } : {}), + [isTourAnchor] + ); + return ( - <StyledEuiTabbedContent - data-test-subj="eventDetails" - tabs={tabs} - selectedTab={selectedTab} - onTabClick={handleTabClick} - key="event-summary-tabs" - /> + <GuidedOnboardingTourStep + isTourAnchor={isTourAnchor} + step={3} + stepId={SecurityStepId.alertsCases} + > + <StyledEuiTabbedContent + {...tourAnchor} + data-test-subj="eventDetails" + tabs={tabs} + selectedTab={selectedTab} + onTabClick={handleTabClick} + key="event-summary-tabs" + /> + </GuidedOnboardingTourStep> ); }; EventDetailsComponent.displayName = 'EventDetailsComponent'; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/osquery_tab.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/osquery_tab.tsx index ed2551b94422a..acadbd6746d70 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/osquery_tab.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/osquery_tab.tsx @@ -15,6 +15,7 @@ import { import React, { useMemo } from 'react'; import styled from 'styled-components'; import { FormattedMessage } from '@kbn/i18n-react'; +import type { Ecs } from '../../../../common/ecs'; import { PERMISSION_DENIED } from '../../../detection_engine/rule_response_actions/osquery/translations'; import { expandDottedObject } from '../../../../common/utils/expand_dotted'; import { RESPONSE_ACTION_TYPES } from '../../../../common/detection_engine/rule_response_actions/schemas'; @@ -59,7 +60,13 @@ interface ExpandedEventFieldsObject { }; } -export const useOsqueryTab = ({ rawEventData }: { rawEventData?: AlertRawEventData }) => { +export const useOsqueryTab = ({ + rawEventData, + ecsData, +}: { + rawEventData?: AlertRawEventData; + ecsData?: Ecs; +}) => { const { services: { osquery, application }, } = useKibana(); @@ -87,7 +94,7 @@ export const useOsqueryTab = ({ rawEventData }: { rawEventData?: AlertRawEventDa [] ); - if (!osquery || !rawEventData || !responseActionsEnabled) { + if (!osquery || !rawEventData || !responseActionsEnabled || !ecsData) { return; } @@ -137,7 +144,12 @@ export const useOsqueryTab = ({ rawEventData }: { rawEventData?: AlertRawEventDa {!application?.capabilities?.osquery?.read ? ( emptyPrompt ) : ( - <OsqueryResults agentIds={agentIds} ruleName={ruleName} alertId={alertId} /> + <OsqueryResults + agentIds={agentIds} + ruleName={ruleName} + alertId={alertId} + ecsData={ecsData} + /> )} </TabContentWrapper> </> diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding/index.ts b/x-pack/plugins/security_solution/public/common/components/guided_onboarding/index.ts deleted file mode 100644 index ed0dfa6c76339..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/guided_onboarding/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { - useTourContext, - TourContextProvider, - SECURITY_TOUR_ACTIVE_KEY, - SECURITY_TOUR_STEP_KEY, -} from './tour'; diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding/tour.test.tsx b/x-pack/plugins/security_solution/public/common/components/guided_onboarding/tour.test.tsx deleted file mode 100644 index e2cf3be0ae07d..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/guided_onboarding/tour.test.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 { act, renderHook } from '@testing-library/react-hooks'; - -import { - SECURITY_TOUR_ACTIVE_KEY, - SECURITY_TOUR_STEP_KEY, - TourContextProvider, - useTourContext, -} from './tour'; - -describe('useTourContext', () => { - describe('localStorage', () => { - let localStorageTourActive: string | null; - let localStorageTourStep: string | null; - - beforeAll(() => { - localStorageTourActive = localStorage.getItem(SECURITY_TOUR_ACTIVE_KEY); - localStorage.removeItem(SECURITY_TOUR_ACTIVE_KEY); - localStorageTourStep = localStorage.getItem(SECURITY_TOUR_STEP_KEY); - localStorage.removeItem(SECURITY_TOUR_STEP_KEY); - }); - - afterAll(() => { - if (localStorageTourActive) { - localStorage.setItem(SECURITY_TOUR_ACTIVE_KEY, localStorageTourActive); - } - if (localStorageTourStep) { - localStorage.setItem(SECURITY_TOUR_STEP_KEY, localStorageTourStep); - } - }); - - test('tour is disabled', () => { - localStorage.setItem(SECURITY_TOUR_ACTIVE_KEY, JSON.stringify(false)); - const { result } = renderHook(() => useTourContext(), { - wrapper: TourContextProvider, - }); - expect(result.current.isTourShown).toBe(false); - }); - - test('tour is enabled', () => { - localStorage.setItem(SECURITY_TOUR_ACTIVE_KEY, JSON.stringify(true)); - const { result } = renderHook(() => useTourContext(), { - wrapper: TourContextProvider, - }); - expect(result.current.isTourShown).toBe(true); - }); - test('endTour callback', () => { - localStorage.setItem(SECURITY_TOUR_ACTIVE_KEY, JSON.stringify(true)); - let { result } = renderHook(() => useTourContext(), { - wrapper: TourContextProvider, - }); - expect(result.current.isTourShown).toBe(true); - act(() => { - result.current.endTour(); - }); - const localStorageValue = JSON.parse(localStorage.getItem(SECURITY_TOUR_ACTIVE_KEY)!); - expect(localStorageValue).toBe(false); - - ({ result } = renderHook(() => useTourContext(), { - wrapper: TourContextProvider, - })); - expect(result.current.isTourShown).toBe(false); - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding/tour.tsx b/x-pack/plugins/security_solution/public/common/components/guided_onboarding/tour.tsx deleted file mode 100644 index 27288bb8a7145..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/guided_onboarding/tour.tsx +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { ReactChild } from 'react'; -import React, { createContext, useContext, useState, useCallback } from 'react'; - -import type { EuiTourStepProps } from '@elastic/eui'; -import { - EuiButton, - EuiButtonEmpty, - EuiFlexGroup, - EuiFlexItem, - EuiTourStep, - EuiText, - EuiSpacer, - EuiImage, - useIsWithinBreakpoints, -} from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; - -import type { StepConfig } from './tour_config'; -import { tourConfig } from './tour_config'; - -export const SECURITY_TOUR_ACTIVE_KEY = 'guidedOnboarding.security.tourActive'; -export const SECURITY_TOUR_STEP_KEY = 'guidedOnboarding.security.tourStep'; -const getIsTourActiveFromLocalStorage = (): boolean => { - const localStorageValue = localStorage.getItem(SECURITY_TOUR_ACTIVE_KEY); - return localStorageValue ? JSON.parse(localStorageValue) : false; -}; -export const saveIsTourActiveToLocalStorage = (isTourActive: boolean): void => { - localStorage.setItem(SECURITY_TOUR_ACTIVE_KEY, JSON.stringify(isTourActive)); -}; - -export const getTourStepFromLocalStorage = (): number => { - return Number(localStorage.getItem(SECURITY_TOUR_STEP_KEY) ?? 1); -}; -const saveTourStepToLocalStorage = (step: number): void => { - localStorage.setItem(SECURITY_TOUR_STEP_KEY, JSON.stringify(step)); -}; - -const minWidth: EuiTourStepProps['minWidth'] = 360; -const maxWidth: EuiTourStepProps['maxWidth'] = 360; -const offset: EuiTourStepProps['offset'] = 20; -const repositionOnScroll: EuiTourStepProps['repositionOnScroll'] = true; - -const getSteps = (tourControls: { - activeStep: number; - incrementStep: () => void; - resetTour: () => void; -}) => { - const { activeStep, incrementStep, resetTour } = tourControls; - const footerAction = ( - <EuiFlexGroup alignItems="center"> - <EuiFlexItem> - <EuiButtonEmpty - size="xs" - color="text" - onClick={() => resetTour()} - data-test-subj="onboarding--securityTourSkipButton" - > - <FormattedMessage - id="xpack.securitySolution.guided_onboarding.skipTour.buttonLabel" - defaultMessage="Skip tour" - /> - </EuiButtonEmpty> - </EuiFlexItem> - <EuiFlexItem> - <EuiButton - size="s" - onClick={() => incrementStep()} - color="success" - data-test-subj="onboarding--securityTourNextStepButton" - > - <FormattedMessage - id="xpack.securitySolution.guided_onboarding.nextStep.buttonLabel" - defaultMessage="Next" - /> - </EuiButton> - </EuiFlexItem> - </EuiFlexGroup> - ); - const lastStepFooter = ( - <EuiButtonEmpty - size="xs" - color="text" - onClick={() => resetTour()} - data-test-subj="onboarding--securityTourEndButton" - > - <FormattedMessage - id="xpack.securitySolution.guided_onboarding.endTour.buttonLabel" - defaultMessage="End tour" - /> - </EuiButtonEmpty> - ); - return tourConfig.map((stepConfig: StepConfig) => { - const { content, imageConfig, dataTestSubj, ...rest } = stepConfig; - return ( - <EuiTourStep - {...rest} - minWidth={minWidth} - maxWidth={maxWidth} - offset={offset} - repositionOnScroll={repositionOnScroll} - stepsTotal={tourConfig.length} - isStepOpen={stepConfig.step === activeStep} - onFinish={() => resetTour()} - panelProps={{ - 'data-test-subj': dataTestSubj, - }} - content={ - <> - <EuiText size="xs"> - <p>{content}</p> - </EuiText> - {imageConfig && ( - <> - <EuiSpacer size="m" /> - <EuiImage alt={imageConfig.altText} src={imageConfig.src} size="fullWidth" /> - </> - )} - </> - } - footerAction={activeStep === tourConfig.length ? lastStepFooter : footerAction} - /> - ); - }); -}; - -export interface TourContextValue { - isTourShown: boolean; - endTour: () => void; -} - -const TourContext = createContext<TourContextValue>({ - isTourShown: false, - endTour: () => {}, -} as TourContextValue); - -export const TourContextProvider = ({ children }: { children: ReactChild }) => { - const [isTourActive, _setIsTourActive] = useState<boolean>(getIsTourActiveFromLocalStorage()); - const setIsTourActive = useCallback((value: boolean) => { - _setIsTourActive(value); - saveIsTourActiveToLocalStorage(value); - }, []); - - const [activeStep, _setActiveStep] = useState<number>(getTourStepFromLocalStorage()); - - const incrementStep = useCallback(() => { - _setActiveStep((prevState) => { - const nextStep = (prevState >= tourConfig.length ? 0 : prevState) + 1; - saveTourStepToLocalStorage(nextStep); - return nextStep; - }); - }, []); - - const resetStep = useCallback(() => { - _setActiveStep(1); - saveTourStepToLocalStorage(1); - }, []); - - const resetTour = useCallback(() => { - setIsTourActive(false); - resetStep(); - }, [setIsTourActive, resetStep]); - - const isSmallScreen = useIsWithinBreakpoints(['xs', 's']); - const showTour = isTourActive && !isSmallScreen; - const context: TourContextValue = { isTourShown: showTour, endTour: resetTour }; - return ( - <TourContext.Provider value={context}> - <> - {children} - {showTour && <>{getSteps({ activeStep, incrementStep, resetTour })}</>} - </> - </TourContext.Provider> - ); -}; - -export const useTourContext = (): TourContextValue => { - const ctx = useContext(TourContext); - if (!ctx) { - throw new Error('useTourContext can only be called inside of TourContext!'); - } - return ctx; -}; diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding/tour_config.ts b/x-pack/plugins/security_solution/public/common/components/guided_onboarding/tour_config.ts deleted file mode 100644 index 5a0f6f30daadc..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/guided_onboarding/tour_config.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { EuiTourStepProps } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import alertsGif from '../../images/onboarding_tour_step_alerts.gif'; -import casesGif from '../../images/onboarding_tour_step_cases.gif'; - -export type StepConfig = Pick<EuiTourStepProps, 'step' | 'content' | 'anchorPosition' | 'title'> & { - anchor: string; - dataTestSubj: string; - imageConfig?: { - altText: string; - src: string; - }; -}; - -type TourConfig = StepConfig[]; - -export const tourConfig: TourConfig = [ - { - step: 1, - title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.overviewStep.tourTitle', { - defaultMessage: 'Welcome to Elastic Security', - }), - content: i18n.translate( - 'xpack.securitySolution.guided_onboarding.tour.overviewStep.tourContent', - { - defaultMessage: - 'Take a quick tour to explore a unified workflow for investigating suspicious activity.', - } - ), - anchor: `[id^="SolutionNav"]`, - anchorPosition: 'rightUp', - dataTestSubj: 'welcomeStep', - }, - { - step: 2, - title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.manageStep.tourTitle', { - defaultMessage: 'Protect your ecosystem', - }), - content: i18n.translate( - 'xpack.securitySolution.guided_onboarding.tour.manageStep.tourContent', - { - defaultMessage: - 'Decide what matters to you and your environment and create rules to detect and prevent malicious activity. ', - } - ), - anchor: `[data-test-subj="groupedNavItemLink-administration"]`, - anchorPosition: 'rightUp', - dataTestSubj: 'manageStep', - }, - { - step: 3, - title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.alertsStep.tourTitle', { - defaultMessage: 'Get notified when something changes', - }), - content: i18n.translate( - 'xpack.securitySolution.guided_onboarding.tour.alertsStep.tourContent', - { - defaultMessage: - "Know when a rule's conditions are met, so you can start your investigation right away. Set up notifications with third-party platforms like Slack, PagerDuty, and ServiceNow.", - } - ), - anchor: `[data-test-subj="groupedNavItemLink-alerts"]`, - anchorPosition: 'rightUp', - imageConfig: { - src: alertsGif, - altText: i18n.translate( - 'xpack.securitySolution.guided_onboarding.tour.alertsStep.imageAltText', - { - defaultMessage: 'Alerts demonstration', - } - ), - }, - dataTestSubj: 'alertsStep', - }, - { - step: 4, - title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.casesStep.tourTitle', { - defaultMessage: 'Create a case to track your investigation', - }), - content: i18n.translate('xpack.securitySolution.guided_onboarding.tour.casesStep.tourContent', { - defaultMessage: - 'Collect evidence, add more collaborators, and even push case details to third-party case management systems.', - }), - anchor: `[data-test-subj="groupedNavItemLink-cases"]`, - anchorPosition: 'rightUp', - imageConfig: { - src: casesGif, - altText: i18n.translate( - 'xpack.securitySolution.guided_onboarding.tour.casesStep.imageAltText', - { - defaultMessage: 'Cases demonstration', - } - ), - }, - dataTestSubj: 'casesStep', - }, - { - step: 5, - title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.dataStep.tourTitle', { - defaultMessage: `Start gathering your data!`, - }), - content: i18n.translate('xpack.securitySolution.guided_onboarding.tour.dataStep.tourContent', { - defaultMessage: `Collect data from your endpoints using the Elastic Agent and a variety of third-party integrations.`, - }), - anchor: `[data-test-subj="add-data"]`, - anchorPosition: 'rightUp', - dataTestSubj: 'dataStep', - }, -]; diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md new file mode 100644 index 0000000000000..483d9c30cb82c --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md @@ -0,0 +1,140 @@ +## Security Guided Onboarding Tour +This work required some creativity for reasons. Allow me to explain some weirdness + +The [`EuiTourStep`](https://elastic.github.io/eui/#/display/tour) component needs an **anchor** to attach on in the DOM. This can be defined in 2 ways: +``` +type EuiTourStepAnchorProps = ExclusiveUnion<{ + //Element to which the tour step popover attaches when open + children: ReactElement; + // Selector or reference to the element to which the tour step popover attaches when open + anchor?: never; +}, { + children?: never; + anchor: ElementTarget; +}>; +``` + +It was important that the `EuiTourStep` **anchor** is in the DOM when the tour step becomes active. Additionally, when the **anchor** leaves the DOM, we need `EuiTourStep` to leave the DOM as well. + +## How to use components (for OLM/D&R step engineers) + +- Define your steps in [`./tour_config.ts`](https://github.com/elastic/kibana/pull/143598/files#diff-2c0372fc996eadbff00dddb92101432bf38cc1613895cb9a208abd8eb2e12930R136) in the `securityTourConfig` const +- For each step, implement the `GuidedOnboardingTourStep` component at the location of the **anchor**. As stated in the previous section, there are two ways to define the **anchor**. I will explain examples of both methods: + +1. **Method 1 - as children.** Looking at step 1 of the `SecurityStepId.alertsCases` tour. In the `alertsCasesConfig` you can see the config for this step looks like: + + ``` + { + ...defaultConfig, + step: 1, + title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.ruleNameStep.tourTitle', { + defaultMessage: 'Test alert for practice', + }), + content: i18n.translate( + 'xpack.securitySolution.guided_onboarding.tour.ruleNameStep.tourContent', + { + defaultMessage: + 'To help you practice triaging alerts, we enabled a rule to create your first alert.', + } + ), + anchorPosition: 'downCenter', + dataTestSubj: getTourAnchor(1, SecurityStepId.alertsCases), + } + ``` + + Notice that **no anchor prop is defined** in the step 1 config. + As you can see pictured below, the tour step anchor is the Rule name of the first alert. + + <img width="1332" alt="1" src="https://user-images.githubusercontent.com/6935300/197848717-47c1959d-5dd5-4d72-a81d-786987000360.png"> + + The component for this anchor is `RenderCellValue` which returns `DefaultCellRenderer`. We wrap `DefaultCellRenderer` with `GuidedOnboardingTourStep`, passing `step={1} stepId={SecurityStepId.alertsCases}` to indicate the step. Since there are many other iterations of this component on the page, we also need to pass the `isTourAnchor` property to determine which of these components should be the anchor. In the code, this looks something like: + + ``` + export const RenderCellValue = (props) => { + const { columnId, rowIndex, scopeId } = props; + const isTourAnchor = useMemo( + () => + columnId === SIGNAL_RULE_NAME_FIELD_NAME && + isDetectionsAlertsTable(scopeId) && + rowIndex === 0, + [columnId, rowIndex, scopeId] + ); + + return ( + <GuidedOnboardingTourStep + isTourAnchor={isTourAnchor} + step={1} + stepId={SecurityStepId.alertsCases} + > + <DefaultCellRenderer {...props} /> + </GuidedOnboardingTourStep> + ); + }; + ``` + +2. **Method 2 - as anchor props.** Looking at step 5 of the `SecurityStepId.alertsCases` tour. In the `alertsCasesConfig` you can see the config for this step looks like: + + ``` + { + ...defaultConfig, + step: 5, + title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.createCase.tourTitle', { + defaultMessage: `Add details`, + }), + content: i18n.translate( + 'xpack.securitySolution.guided_onboarding.tour.createCase.tourContent', + { + defaultMessage: `In addition to the alert, you can add any relevant information you need to the case.`, + } + ), + anchor: `[data-test-subj="create-case-flyout"]`, + anchorPosition: 'leftUp', + dataTestSubj: getTourAnchor(5, SecurityStepId.alertsCases), + hideNextButton: true, + } + ``` + + Notice that the **anchor prop is defined** as `[data-test-subj="create-case-flyout"]` in the step 5 config. There is also a `hideNextButton` boolean utilized here. + As you can see pictured below, the tour step anchor is the create case flyout and the next button is hidden. + + <img width="1336" alt="5" src="https://user-images.githubusercontent.com/6935300/197848670-09a6fa58-7417-4c9b-9be0-fb58224c2dc8.png"> + + + Since cases is its own plugin and we are using a method to generate the flyout, we cannot wrap the flyout as children of the `GuidedOnboardingTourStep`. We do however need the `EuiTourStep` component to mount in the same location as the anchor. Therefore, I had to pass a new optional property to the case component called `headerContent` that simply accepts and renders ` React.ReactNode` at the top of the flyout. In the code, this looks something like: + + ``` + createCaseFlyout.open({ + attachments: caseAttachments, + ...(isTourShown(SecurityStepId.alertsCases) && activeStep === AlertsCasesTourSteps.addAlertToCase + ? { + headerContent: ( + // isTourAnchor=true no matter what in order to + // force active guide step outside of security solution (cases) + <GuidedOnboardingTourStep isTourAnchor step={5} stepId={SecurityStepId.alertsCases} /> + ), + } + : {}), + }); + ``` + +- The **`useTourContext`** is used within anchor components, returning the state of the security tour + ``` + export interface TourContextValue { + activeStep: number; + endTourStep: (stepId: SecurityStepId) => void; + incrementStep: (stepId: SecurityStepId, step?: number) => void; + isTourShown: (stepId: SecurityStepId) => boolean; + } + ``` + When the tour step does not have a next button, the anchor component will need to call `incrementStep` after an action is taken. For example, in `SecurityStepId.alertsCases` step 4, the user needs to click the "Add to case" button to advance the tour. + + <img width="1332" alt="4" src="https://user-images.githubusercontent.com/6935300/197850270-f08b9fe9-6f47-446d-b607-2b7295c8d35f.png"> + + So we utilize the `useTourContext` to do the following check and increment the step in `handleAddToNewCaseClick`: + ``` + if (isTourShown(SecurityStepId.alertsCases) && activeStep === AlertsCasesTourSteps.addAlertToCase) { + incrementStep(SecurityStepId.alertsCases); + } + ``` + + In `SecurityStepId.alertsCases` step 5, the user needs to fill out the form and hit the "Create case" button in order to end the `alertsCases` portion the tour, so with the `afterCaseCreated` method we call `endTourStep(SecurityStepId.alertsCases)`. \ No newline at end of file diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/index.ts b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/index.ts new file mode 100644 index 0000000000000..2bb68dff4646f --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/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 { useTourContext, TourContextProvider } from './tour'; diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.test.tsx b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.test.tsx new file mode 100644 index 0000000000000..faea94a1c37ec --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.test.tsx @@ -0,0 +1,100 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { act, renderHook } from '@testing-library/react-hooks'; +import { of } from 'rxjs'; +import { TourContextProvider, useTourContext } from './tour'; +import { SecurityStepId, securityTourConfig } from './tour_config'; +import { useKibana } from '../../lib/kibana'; + +jest.mock('../../lib/kibana'); +jest.mock('../../hooks/use_experimental_features', () => ({ + useIsExperimentalFeatureEnabled: () => true, +})); + +jest.mock('react-router-dom', () => { + const original = jest.requireActual('react-router-dom'); + + return { + ...original, + useLocation: jest.fn().mockReturnValue({ pathname: '/alerts' }), + }; +}); + +describe('useTourContext', () => { + const mockCompleteGuideStep = jest.fn(); + beforeEach(() => { + (useKibana as jest.Mock).mockReturnValue({ + services: { + guidedOnboarding: { + guidedOnboardingApi: { + isGuideStepActive$: () => of(true), + completeGuideStep: mockCompleteGuideStep, + }, + }, + }, + }); + jest.clearAllMocks(); + }); + // @ts-ignore + const stepIds = Object.values(SecurityStepId); + describe.each(stepIds)('%s', (stepId) => { + it('if guidedOnboardingApi?.isGuideStepActive$ is false, isTourShown should be false', () => { + (useKibana as jest.Mock).mockReturnValue({ + services: { + guidedOnboarding: { + guidedOnboardingApi: { + isGuideStepActive$: () => of(false), + }, + }, + }, + }); + const { result } = renderHook(() => useTourContext(), { + wrapper: TourContextProvider, + }); + expect(result.current.isTourShown(stepId)).toBe(false); + }); + it('if guidedOnboardingApi?.isGuideStepActive$ is true, isTourShown should be true', () => { + const { result } = renderHook(() => useTourContext(), { + wrapper: TourContextProvider, + }); + expect(result.current.isTourShown(stepId)).toBe(true); + }); + it('endTourStep calls completeGuideStep with correct stepId', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => useTourContext(), { + wrapper: TourContextProvider, + }); + await waitForNextUpdate(); + result.current.endTourStep(stepId); + expect(mockCompleteGuideStep).toHaveBeenCalledWith('security', stepId); + }); + }); + it('activeStep is initially 1', () => { + const { result } = renderHook(() => useTourContext(), { + wrapper: TourContextProvider, + }); + expect(result.current.activeStep).toBe(1); + }); + it('increment step properly increments for each stepId, and if attempted to increment beyond length of tour config steps resets activeStep to 1', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => useTourContext(), { + wrapper: TourContextProvider, + }); + await waitForNextUpdate(); + const stepCount = securityTourConfig[stepId].length; + for (let i = 0; i < stepCount - 1; i++) { + result.current.incrementStep(stepId); + } + const lastStep = stepCount ? stepCount : 1; + expect(result.current.activeStep).toBe(lastStep); + result.current.incrementStep(stepId); + expect(result.current.activeStep).toBe(1); + }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx new file mode 100644 index 0000000000000..80cadec5d04be --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx @@ -0,0 +1,130 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ReactChild } from 'react'; +import React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react'; + +import useObservable from 'react-use/lib/useObservable'; +import { catchError, of, timeout } from 'rxjs'; +import { useLocation } from 'react-router-dom'; +import { useIsExperimentalFeatureEnabled } from '../../hooks/use_experimental_features'; +import { isDetectionsPath } from '../../../helpers'; +import { useKibana } from '../../lib/kibana'; +import { securityTourConfig, SecurityStepId } from './tour_config'; + +export interface TourContextValue { + activeStep: number; + endTourStep: (stepId: SecurityStepId) => void; + incrementStep: (stepId: SecurityStepId) => void; + isTourShown: (stepId: SecurityStepId) => boolean; +} + +const initialState: TourContextValue = { + activeStep: 0, + endTourStep: () => {}, + incrementStep: () => {}, + isTourShown: () => false, +}; + +const TourContext = createContext<TourContextValue>(initialState); + +export const RealTourContextProvider = ({ children }: { children: ReactChild }) => { + const { guidedOnboardingApi } = useKibana().services.guidedOnboarding; + + const isRulesTourActive = useObservable( + guidedOnboardingApi?.isGuideStepActive$('security', SecurityStepId.rules).pipe( + // if no result after 30s the observable will error, but the error handler will just emit false + timeout(30000), + catchError((error) => of(false)) + ) ?? of(false), + false + ); + const isAlertsCasesTourActive = useObservable( + guidedOnboardingApi?.isGuideStepActive$('security', SecurityStepId.alertsCases).pipe( + // if no result after 30s the observable will error, but the error handler will just emit false + timeout(30000), + catchError((error) => of(false)) + ) ?? of(false), + false + ); + + const tourStatus = useMemo( + () => ({ + [SecurityStepId.rules]: isRulesTourActive, + [SecurityStepId.alertsCases]: isAlertsCasesTourActive, + }), + [isRulesTourActive, isAlertsCasesTourActive] + ); + + const isTourShown = useCallback((stepId: SecurityStepId) => tourStatus[stepId], [tourStatus]); + const [activeStep, _setActiveStep] = useState<number>(1); + + const incrementStep = useCallback((stepId: SecurityStepId) => { + _setActiveStep( + (prevState) => (prevState >= securityTourConfig[stepId].length ? 0 : prevState) + 1 + ); + }, []); + + // TODO: @Steph figure out if we're allowing user to skip tour or not, implement this if so + // const onSkipTour = useCallback((stepId: SecurityStepId) => { + // // active state means the user is on this step but has not yet begun. so when the user hits skip, + // // the tour will go back to this step until they "re-start it" + // // guidedOnboardingApi.idkSetStepTo(stepId, 'active') + // }, []); + + const [completeStep, setCompleteStep] = useState<null | SecurityStepId>(null); + + useEffect(() => { + if (!completeStep || !guidedOnboardingApi) { + return; + } + let ignore = false; + const complete = async () => { + await guidedOnboardingApi.completeGuideStep('security', completeStep); + if (!ignore) { + setCompleteStep(null); + _setActiveStep(1); + } + }; + complete(); + return () => { + ignore = true; + }; + }, [completeStep, guidedOnboardingApi]); + + const endTourStep = useCallback((stepId: SecurityStepId) => { + setCompleteStep(stepId); + }, []); + + const context = { + activeStep, + endTourStep, + incrementStep, + isTourShown, + }; + + return <TourContext.Provider value={context}>{children}</TourContext.Provider>; +}; + +export const TourContextProvider = ({ children }: { children: ReactChild }) => { + const { pathname } = useLocation(); + const isTourEnabled = useIsExperimentalFeatureEnabled('guidedOnboarding'); + + if (isDetectionsPath(pathname) && isTourEnabled) { + return <RealTourContextProvider>{children}</RealTourContextProvider>; + } + + return <TourContext.Provider value={initialState}>{children}</TourContext.Provider>; +}; + +export const useTourContext = (): TourContextValue => { + const ctx = useContext(TourContext); + if (!ctx) { + throw new Error('useTourContext can only be called inside of TourContext!'); + } + return ctx; +}; diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts new file mode 100644 index 0000000000000..0a00c25417f83 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts @@ -0,0 +1,154 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { EuiTourStepProps } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import type { ElementTarget } from '@elastic/eui/src/services/findElement'; + +export const enum SecurityStepId { + rules = 'rules', + alertsCases = 'alertsCases', +} + +export const enum AlertsCasesTourSteps { + none = 0, + pointToAlertName = 1, + expandEvent = 2, + reviewAlertDetailsFlyout = 3, + addAlertToCase = 4, + createCase = 5, +} + +export type StepConfig = Pick< + EuiTourStepProps, + 'step' | 'content' | 'anchorPosition' | 'title' | 'initialFocus' | 'anchor' +> & { + anchor?: ElementTarget; + dataTestSubj: string; + hideNextButton?: boolean; + imageConfig?: { + altText: string; + src: string; + }; +}; + +const defaultConfig = { + minWidth: 360, + maxWidth: 360, + offset: 10, + repositionOnScroll: true, +}; + +export const getTourAnchor = (step: number, stepId: SecurityStepId) => + `tourStepAnchor-${stepId}-${step}`; + +const alertsCasesConfig: StepConfig[] = [ + { + ...defaultConfig, + step: AlertsCasesTourSteps.pointToAlertName, + title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.ruleNameStep.tourTitle', { + defaultMessage: 'Test alert for practice', + }), + content: i18n.translate( + 'xpack.securitySolution.guided_onboarding.tour.ruleNameStep.tourContent', + { + defaultMessage: + 'To help you practice triaging alerts, we enabled a rule to create your first alert.', + } + ), + anchorPosition: 'downCenter', + dataTestSubj: getTourAnchor(AlertsCasesTourSteps.pointToAlertName, SecurityStepId.alertsCases), + initialFocus: `button[tour-step="nextButton"]`, + }, + { + ...defaultConfig, + step: AlertsCasesTourSteps.expandEvent, + title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.openFlyout.tourTitle', { + defaultMessage: 'Review the alert details', + }), + content: i18n.translate( + 'xpack.securitySolution.guided_onboarding.tour.openFlyout.tourContent', + { + defaultMessage: + "Some information is provided at-a-glance in the table, but for full details, you'll want to open the alert.", + } + ), + anchorPosition: 'rightUp', + dataTestSubj: getTourAnchor(AlertsCasesTourSteps.expandEvent, SecurityStepId.alertsCases), + hideNextButton: true, + }, + { + ...defaultConfig, + step: AlertsCasesTourSteps.reviewAlertDetailsFlyout, + title: i18n.translate( + 'xpack.securitySolution.guided_onboarding.tour.flyoutOverview.tourTitle', + { + defaultMessage: 'Explore alert details', + } + ), + content: i18n.translate( + 'xpack.securitySolution.guided_onboarding.tour.flyoutOverview.tourContent', + { + defaultMessage: + 'Learn more about alerts by checking out all the information available on each tab.', + } + ), + // needs to use anchor to properly place tour step + anchor: `[tour-step="${getTourAnchor( + AlertsCasesTourSteps.reviewAlertDetailsFlyout, + SecurityStepId.alertsCases + )}"] .euiTabs`, + anchorPosition: 'leftUp', + dataTestSubj: getTourAnchor( + AlertsCasesTourSteps.reviewAlertDetailsFlyout, + SecurityStepId.alertsCases + ), + }, + { + ...defaultConfig, + step: AlertsCasesTourSteps.addAlertToCase, + title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.addToCase.tourTitle', { + defaultMessage: 'Create a case', + }), + content: i18n.translate('xpack.securitySolution.guided_onboarding.tour.addToCase.tourContent', { + defaultMessage: 'From the Take action menu, add the alert to a new case.', + }), + anchorPosition: 'upRight', + dataTestSubj: getTourAnchor(AlertsCasesTourSteps.addAlertToCase, SecurityStepId.alertsCases), + hideNextButton: true, + }, + { + ...defaultConfig, + step: AlertsCasesTourSteps.createCase, + title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.createCase.tourTitle', { + defaultMessage: `Add details`, + }), + content: i18n.translate( + 'xpack.securitySolution.guided_onboarding.tour.createCase.tourContent', + { + defaultMessage: `In addition to the alert, you can add any relevant information you need to the case.`, + } + ), + anchor: `[data-test-subj="create-case-flyout"]`, + anchorPosition: 'leftUp', + dataTestSubj: getTourAnchor(AlertsCasesTourSteps.createCase, SecurityStepId.alertsCases), + hideNextButton: true, + }, +]; + +interface SecurityTourConfig { + [SecurityStepId.rules]: StepConfig[]; + [SecurityStepId.alertsCases]: StepConfig[]; +} + +export const securityTourConfig: SecurityTourConfig = { + /** + * D&R team implement your tour config here + */ + [SecurityStepId.rules]: [], + [SecurityStepId.alertsCases]: alertsCasesConfig, +}; diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx new file mode 100644 index 0000000000000..90f8b6de7c2f8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx @@ -0,0 +1,278 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import { render } from '@testing-library/react'; +import { GuidedOnboardingTourStep, SecurityTourStep } from './tour_step'; +import { SecurityStepId } from './tour_config'; +import { useTourContext } from './tour'; +import { mockGlobalState, SUB_PLUGINS_REDUCER, TestProviders } from '../../mock'; +import { TimelineId } from '../../../../common/types'; +import { createStore } from '../../store'; +import { tGridReducer } from '@kbn/timelines-plugin/public'; +import { kibanaObservable } from '@kbn/timelines-plugin/public/mock'; +import { createSecuritySolutionStorageMock } from '@kbn/timelines-plugin/public/mock/mock_local_storage'; + +jest.mock('./tour'); +const mockTourStep = jest + .fn() + .mockImplementation(({ children }: { children: React.ReactNode }) => ( + <span data-test-subj="tourStepMock">{children}</span> + )); +jest.mock('@elastic/eui', () => { + const original = jest.requireActual('@elastic/eui'); + return { + ...original, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + EuiTourStep: (props: any) => mockTourStep(props), + }; +}); +const defaultProps = { + isTourAnchor: true, + step: 1, + stepId: SecurityStepId.alertsCases, +}; + +const mockChildren = <h1 data-test-subj="h1">{'random child element'}</h1>; + +describe('GuidedOnboardingTourStep', () => { + beforeEach(() => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 1, + incrementStep: jest.fn(), + isTourShown: () => true, + }); + jest.clearAllMocks(); + }); + it('renders as a tour step', () => { + const { getByTestId } = render( + <GuidedOnboardingTourStep {...defaultProps}>{mockChildren}</GuidedOnboardingTourStep>, + { wrapper: TestProviders } + ); + const tourStep = getByTestId('tourStepMock'); + const header = getByTestId('h1'); + expect(tourStep).toBeInTheDocument(); + expect(header).toBeInTheDocument(); + }); + it('isTourAnchor={false}, just render children', () => { + const { getByTestId, queryByTestId } = render( + <GuidedOnboardingTourStep {...defaultProps} isTourAnchor={false}> + {mockChildren} + </GuidedOnboardingTourStep>, + { wrapper: TestProviders } + ); + const tourStep = queryByTestId('tourStepMock'); + const header = getByTestId('h1'); + expect(tourStep).not.toBeInTheDocument(); + expect(header).toBeInTheDocument(); + }); +}); + +describe('SecurityTourStep', () => { + const { isTourAnchor: _, ...securityTourStepDefaultProps } = defaultProps; + beforeEach(() => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 1, + incrementStep: jest.fn(), + isTourShown: () => true, + }); + jest.clearAllMocks(); + }); + + it('does not render if tour step does not exist', () => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 99, + incrementStep: jest.fn(), + isTourShown: () => true, + }); + render( + <SecurityTourStep {...securityTourStepDefaultProps} step={99}> + {mockChildren} + </SecurityTourStep>, + { wrapper: TestProviders } + ); + expect(mockTourStep).not.toHaveBeenCalled(); + }); + + it('does not render if tour step does not equal active step', () => { + render( + <SecurityTourStep {...securityTourStepDefaultProps} step={4}> + {mockChildren} + </SecurityTourStep>, + { wrapper: TestProviders } + ); + expect(mockTourStep).not.toHaveBeenCalled(); + }); + + it('does not render if security tour step is not shown', () => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 1, + incrementStep: jest.fn(), + isTourShown: () => false, + }); + render(<SecurityTourStep {...securityTourStepDefaultProps}>{mockChildren}</SecurityTourStep>, { + wrapper: TestProviders, + }); + expect(mockTourStep).not.toHaveBeenCalled(); + }); + + it('renders tour step with correct number of steppers', () => { + render(<SecurityTourStep {...securityTourStepDefaultProps}>{mockChildren}</SecurityTourStep>, { + wrapper: TestProviders, + }); + const mockCall = { ...mockTourStep.mock.calls[0][0] }; + expect(mockCall.step).toEqual(1); + expect(mockCall.stepsTotal).toEqual(5); + }); + + it('forces the render for step 5 of the SecurityStepId.alertsCases tour step', () => { + render( + <SecurityTourStep {...securityTourStepDefaultProps} step={5}> + {mockChildren} + </SecurityTourStep>, + { wrapper: TestProviders } + ); + const mockCall = { ...mockTourStep.mock.calls[0][0] }; + expect(mockCall.step).toEqual(5); + expect(mockCall.stepsTotal).toEqual(5); + }); + + it('does render next button if step hideNextButton=false ', () => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 3, + incrementStep: jest.fn(), + isTourShown: () => true, + }); + render( + <SecurityTourStep {...securityTourStepDefaultProps} step={3}> + {mockChildren} + </SecurityTourStep>, + { wrapper: TestProviders } + ); + const mockCall = { ...mockTourStep.mock.calls[0][0] }; + expect(mockCall.footerAction).toMatchInlineSnapshot(` + <EuiButton + color="success" + data-test-subj="onboarding--securityTourNextStepButton" + onClick={[Function]} + size="s" + tour-step="nextButton" + > + <FormattedMessage + defaultMessage="Next" + id="xpack.securitySolution.guided_onboarding.nextStep.buttonLabel" + values={Object {}} + /> + </EuiButton> + `); + }); + + it('if a step has an anchor declared, the tour step should be a sibling of the mockChildren', () => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 3, + incrementStep: jest.fn(), + isTourShown: () => true, + }); + const { container } = render( + <SecurityTourStep {...securityTourStepDefaultProps} step={3}> + {mockChildren} + </SecurityTourStep>, + { wrapper: TestProviders } + ); + const selectParent = container.querySelector( + `[data-test-subj="tourStepMock"] [data-test-subj="h1"]` + ); + const selectSibling = container.querySelector( + `[data-test-subj="tourStepMock"]+[data-test-subj="h1"]` + ); + expect(selectSibling).toBeInTheDocument(); + expect(selectParent).not.toBeInTheDocument(); + }); + + it('if a step does not an anchor declared, the tour step should be the parent of the mockChildren', () => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 2, + incrementStep: jest.fn(), + isTourShown: () => true, + }); + const { container } = render( + <SecurityTourStep {...securityTourStepDefaultProps} step={2}> + {mockChildren} + </SecurityTourStep>, + { wrapper: TestProviders } + ); + const selectParent = container.querySelector( + `[data-test-subj="tourStepMock"] [data-test-subj="h1"]` + ); + const selectSibling = container.querySelector( + `[data-test-subj="tourStepMock"]+[data-test-subj="h1"]` + ); + expect(selectParent).toBeInTheDocument(); + expect(selectSibling).not.toBeInTheDocument(); + }); + + it('if a tour step does not have children and has anchor, only render tour step', () => { + const { getByTestId } = render( + <SecurityTourStep {...securityTourStepDefaultProps} step={5} />, + { wrapper: TestProviders } + ); + expect(getByTestId('tourStepMock')).toBeInTheDocument(); + }); + + it('if a tour step does not have children and does not have anchor, render nothing', () => { + const { queryByTestId } = render( + <SecurityTourStep {...securityTourStepDefaultProps} step={1} />, + { wrapper: TestProviders } + ); + expect(queryByTestId('tourStepMock')).not.toBeInTheDocument(); + }); + + it('does not render next button if step hideNextButton=true ', () => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 4, + incrementStep: jest.fn(), + isTourShown: () => true, + }); + render( + <SecurityTourStep {...securityTourStepDefaultProps} step={4}> + {mockChildren} + </SecurityTourStep>, + { wrapper: TestProviders } + ); + const mockCall = { ...mockTourStep.mock.calls[0][0] }; + expect(mockCall.footerAction).toMatchInlineSnapshot(`<React.Fragment />`); + }); + + it('does not render step if timeline is open', () => { + const mockstate = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + [TimelineId.active]: { + ...mockGlobalState.timeline.timelineById.test, + show: true, + }, + }, + }, + }; + const { storage } = createSecuritySolutionStorageMock(); + const mockStore = createStore( + mockstate, + SUB_PLUGINS_REDUCER, + { dataTable: tGridReducer }, + kibanaObservable, + storage + ); + + render( + <TestProviders store={mockStore}> + <SecurityTourStep {...securityTourStepDefaultProps}>{mockChildren}</SecurityTourStep> + </TestProviders> + ); + expect(mockTourStep).not.toHaveBeenCalled(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx new file mode 100644 index 0000000000000..b7ade00021bad --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx @@ -0,0 +1,146 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { EuiTourStepProps } from '@elastic/eui'; +import { EuiButton, EuiImage, EuiSpacer, EuiText, EuiTourStep } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import styled from 'styled-components'; +import { useShallowEqualSelector } from '../../hooks/use_selector'; +import { TimelineId } from '../../../../common/types'; +import { timelineDefaults } from '../../../timelines/store/timeline/defaults'; +import { timelineSelectors } from '../../../timelines/store/timeline'; +import { useTourContext } from './tour'; +import { AlertsCasesTourSteps, SecurityStepId, securityTourConfig } from './tour_config'; + +interface SecurityTourStep { + children?: React.ReactElement; + step: number; + stepId: SecurityStepId; +} + +const isStepExternallyMounted = (stepId: SecurityStepId, step: number) => + step === AlertsCasesTourSteps.createCase && stepId === SecurityStepId.alertsCases; + +const StyledTourStep = styled(EuiTourStep)<EuiTourStepProps & { stepId: SecurityStepId }>` + &.euiPopover__panel[data-popover-open] { + z-index: ${({ step, stepId }) => + isStepExternallyMounted(stepId, step) ? '9000 !important' : '1000 !important'}; + } +`; + +export const SecurityTourStep = ({ children, step, stepId }: SecurityTourStep) => { + const { activeStep, incrementStep, isTourShown } = useTourContext(); + const tourStep = useMemo( + () => securityTourConfig[stepId].find((config) => config.step === step), + [step, stepId] + ); + + const getTimeline = useMemo(() => timelineSelectors.getTimelineByIdSelector(), []); + const showTimeline = useShallowEqualSelector( + (state) => (getTimeline(state, TimelineId.active) ?? timelineDefaults).show + ); + + const onClick = useCallback(() => incrementStep(stepId), [incrementStep, stepId]); + + // step === AlertsCasesTourSteps.createCase && stepId === SecurityStepId.alertsCases is in Cases app and out of context. + // If we mount this step, we know we need to render it + // we are also managing the context on the siem end in the background + const overrideContext = isStepExternallyMounted(stepId, step); + + if ( + tourStep == null || + ((step !== activeStep || !isTourShown(stepId)) && !overrideContext) || + showTimeline + ) { + return children ? children : null; + } + + const { anchor, content, imageConfig, dataTestSubj, hideNextButton = false, ...rest } = tourStep; + + const footerAction: EuiTourStepProps['footerAction'] = !hideNextButton ? ( + <EuiButton + size="s" + onClick={onClick} + color="success" + data-test-subj="onboarding--securityTourNextStepButton" + tour-step="nextButton" + > + <FormattedMessage + id="xpack.securitySolution.guided_onboarding.nextStep.buttonLabel" + defaultMessage="Next" + /> + </EuiButton> + ) : ( + <> + {/* Passing empty element instead of undefined. If undefined "Skip tour" button is shown, we do not want that*/} + </> + ); + + const commonProps = { + ...rest, + content: ( + <> + <EuiText size="xs"> + <p>{content}</p> + </EuiText> + {imageConfig && ( + <> + <EuiSpacer size="m" /> + <EuiImage alt={imageConfig.altText} src={imageConfig.src} size="fullWidth" /> + </> + )} + </> + ), + footerAction, + // we would not have mounted this component if it was not open + isStepOpen: true, + // guided onboarding does not allow skipping tour through the steps + onFinish: () => null, + stepsTotal: securityTourConfig[stepId].length, + // TODO: re-add panelProps + // EUI has a bug https://github.com/elastic/eui/issues/6297 + // where any panelProps overwrite their panelProps, + // so we lose cool things like the EuiBeacon + // panelProps: { + // 'data-test-subj': dataTestSubj, + // } + }; + + // tour step either needs children or an anchor element + // see type EuiTourStepAnchorProps + return anchor != null ? ( + <> + <StyledTourStep stepId={stepId} {...commonProps} anchor={anchor} /> + <>{children}</> + </> + ) : children != null ? ( + <StyledTourStep stepId={stepId} {...commonProps}> + {children} + </StyledTourStep> + ) : null; +}; + +interface GuidedOnboardingTourStep extends SecurityTourStep { + // can be false if the anchor is an iterative element + // do not use this as an "is tour active" check, the SecurityTourStep checks that anyway + isTourAnchor?: boolean; +} + +// wraps tour anchor component +// and gives the tour step itself a place to mount once it is active +// mounts the tour step with a delay to ensure the anchor will render first +export const GuidedOnboardingTourStep = ({ + children, + // can be false if the anchor is an iterative element + // do not use this as an "is tour active" check, the SecurityTourStep checks that anyway + isTourAnchor = true, + ...props +}: GuidedOnboardingTourStep) => + isTourAnchor ? <SecurityTourStep {...props}>{children}</SecurityTourStep> : <>{children}</>; diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/header_page/index.test.tsx index eef91978bba2d..762ce80c7c6a5 100644 --- a/x-pack/plugins/security_solution/public/common/components/header_page/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/header_page/index.test.tsx @@ -138,4 +138,17 @@ describe('HeaderPage', () => { ); expect(securitySolutionHeaderPage).not.toHaveStyleRule('padding-bottom', euiDarkVars.euiSizeL); }); + + test('it renders the right side items', () => { + const wrapper = mount( + <TestProviders> + <HeaderPage + title="Test title" + rightSideItems={[<div data-test-subj="right-side-item">{'Right side item'}</div>]} + /> + </TestProviders> + ); + + expect(wrapper.find('[data-test-subj="right-side-item"]').exists()).toBe(true); + }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx b/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx index 0e6a51fdb268e..4b79d36dfef80 100644 --- a/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx @@ -65,6 +65,7 @@ export interface HeaderPageProps extends HeaderProps { badgeOptions?: BadgeOptions; children?: React.ReactNode; draggableArguments?: DraggableArguments; + rightSideItems?: React.ReactNode[]; subtitle?: SubtitleProps['items']; subtitle2?: SubtitleProps['items']; title: TitleProp; @@ -104,13 +105,14 @@ const HeaderPageComponent: React.FC<HeaderPageProps> = ({ children, draggableArguments, isLoading, + rightSideItems, subtitle, subtitle2, title, titleNode, }) => ( <> - <EuiPageHeader alignItems="center" bottomBorder={border}> + <EuiPageHeader alignItems="center" bottomBorder={border} rightSideItems={rightSideItems}> <HeaderSection> {backOptions && <HeaderLinkBack backOptions={backOptions} />} {!backOptions && backComponent && <>{backComponent}</>} diff --git a/x-pack/plugins/security_solution/public/common/components/hover_actions/index.tsx b/x-pack/plugins/security_solution/public/common/components/hover_actions/index.tsx index af9d206a35dbc..4e31d2b64f837 100644 --- a/x-pack/plugins/security_solution/public/common/components/hover_actions/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/hover_actions/index.tsx @@ -6,7 +6,7 @@ */ import { EuiFocusTrap, EuiScreenReaderOnly } from '@elastic/eui'; -import React, { useCallback, useEffect, useRef, useState } from 'react'; +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import type { DraggableId } from 'react-beautiful-dnd'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; @@ -35,7 +35,7 @@ AdditionalContent.displayName = 'AdditionalContent'; const StyledHoverActionsContainer = styled.div<{ $showTopN: boolean; $showOwnFocus: boolean; - $hideTopN: boolean; + $hiddenActionsCount: number; $isActive: boolean; }>` display: flex; @@ -82,7 +82,7 @@ const StyledHoverActionsContainer = styled.div<{ `; const StyledHoverActionsContainerWithPaddingsAndMinWidth = styled(StyledHoverActionsContainer)` - min-width: ${({ $hideTopN }) => `${$hideTopN ? '112px' : '138px'}`}; + min-width: ${({ $hiddenActionsCount }) => `${138 - $hiddenActionsCount * 26}px`}; padding: ${(props) => `0 ${props.theme.eui.euiSizeS}`}; position: relative; `; @@ -161,7 +161,6 @@ export const HoverActions: React.FC<Props> = React.memo( setIsActive((prev) => !prev); setIsOverflowPopoverOpen(!isOverflowPopoverOpen); }, [isOverflowPopoverOpen, setIsOverflowPopoverOpen]); - const handleHoverActionClicked = useCallback(() => { if (closeTopN) { closeTopN(); @@ -216,6 +215,20 @@ export const HoverActions: React.FC<Props> = React.memo( ); const isCaseView = scopeId === TimelineId.casePage; + const isTimelineView = scopeId === TimelineId.active; + const isAlertDetailsView = scopeId === TimelineId.detectionsAlertDetailsPage; + + const hideFilters = useMemo( + () => isAlertDetailsView && !isTimelineView, + [isTimelineView, isAlertDetailsView] + ); + + const hiddenActionsCount = useMemo(() => { + const hiddenTopNActions = hideTopN ? 1 : 0; // hides the `Top N` button + const hiddenFilterActions = hideFilters ? 2 : 0; // hides both the `Filter In` and `Filter out` buttons + + return hiddenTopNActions + hiddenFilterActions; + }, [hideFilters, hideTopN]); const { overflowActionItems, allActionItems } = useHoverActionItems({ dataProvider, @@ -225,6 +238,7 @@ export const HoverActions: React.FC<Props> = React.memo( enableOverflowButton: enableOverflowButton && !isCaseView, field, fieldType, + hideFilters, isAggregatable, handleHoverActionClicked, hideAddToTimeline, @@ -258,7 +272,7 @@ export const HoverActions: React.FC<Props> = React.memo( onKeyDown={onKeyDown} $showTopN={showTopN} $showOwnFocus={showOwnFocus} - $hideTopN={hideTopN} + $hiddenActionsCount={hiddenActionsCount} $isActive={isActive} className={isActive ? 'hoverActions-active' : ''} > diff --git a/x-pack/plugins/security_solution/public/common/components/hover_actions/use_hover_action_items.tsx b/x-pack/plugins/security_solution/public/common/components/hover_actions/use_hover_action_items.tsx index 97c096329a944..9aa2e27d0716a 100644 --- a/x-pack/plugins/security_solution/public/common/components/hover_actions/use_hover_action_items.tsx +++ b/x-pack/plugins/security_solution/public/common/components/hover_actions/use_hover_action_items.tsx @@ -33,6 +33,7 @@ export interface UseHoverActionItemsProps { isAggregatable: boolean; handleHoverActionClicked: () => void; hideAddToTimeline: boolean; + hideFilters?: boolean; hideTopN: boolean; isCaseView: boolean; isObjectArray: boolean; @@ -64,6 +65,7 @@ export const useHoverActionItems = ({ fieldType, isAggregatable, handleHoverActionClicked, + hideFilters, hideTopN, hideAddToTimeline, isCaseView, @@ -132,12 +134,18 @@ export const useHoverActionItems = ({ OnAddToTimeline(); }, [handleHoverActionClicked, OnAddToTimeline]); - /* - * In the case of `DisableOverflowButton`, we show filters only when topN is NOT opened. As after topN button is clicked, the chart panel replace current hover actions in the hover actions' popover, so we have to hide all the actions. - * in the case of `EnableOverflowButton`, we only need to hide all the items in the overflow popover as the chart's panel opens in the overflow popover, so non-overflowed actions are not affected. - */ - const showFilters = - values != null && (enableOverflowButton || (!showTopN && !enableOverflowButton)) && !isCaseView; + const showFilters = useMemo(() => { + if (hideFilters) return false; + /* + * In the case of `DisableOverflowButton`, we show filters only when topN is NOT opened. As after topN button is clicked, the chart panel replace current hover actions in the hover actions' popover, so we have to hide all the actions. + * in the case of `EnableOverflowButton`, we only need to hide all the items in the overflow popover as the chart's panel opens in the overflow popover, so non-overflowed actions are not affected. + */ + return ( + values != null && + (enableOverflowButton || (!showTopN && !enableOverflowButton)) && + !isCaseView + ); + }, [enableOverflowButton, hideFilters, isCaseView, showTopN, values]); const shouldDisableColumnToggle = (isObjectArray && field !== 'geo_point') || isCaseView; const showTopNBtn = useMemo( diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts b/x-pack/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts index 52ed72dc1a2bd..b7bfb751e4fa8 100644 --- a/x-pack/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts @@ -12,6 +12,7 @@ export { getAppLandingUrl } from '../redirect_to_landing'; export { getHostDetailsUrl, getHostsUrl } from '../redirect_to_hosts'; export { getNetworkUrl, getNetworkDetailsUrl } from '../redirect_to_network'; export { getTimelineTabsUrl, getTimelineUrl } from '../redirect_to_timelines'; +export { getAlertDetailsUrl, getAlertDetailsTabUrl } from '../redirect_to_alerts'; export { getCaseDetailsUrl, getCaseUrl, diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/index.ts b/x-pack/plugins/security_solution/public/common/components/link_to/index.ts index 1d03747116211..4630ae0f6f71e 100644 --- a/x-pack/plugins/security_solution/public/common/components/link_to/index.ts +++ b/x-pack/plugins/security_solution/public/common/components/link_to/index.ts @@ -12,6 +12,7 @@ import { useAppUrl } from '../../lib/kibana/hooks'; import type { SecurityPageName } from '../../../app/types'; import { needsUrlState } from '../../links'; +export { getAlertDetailsUrl, getAlertDetailsTabUrl } from './redirect_to_alerts'; export { getDetectionEngineUrl, getRuleDetailsUrl } from './redirect_to_detection_engine'; export { getHostDetailsUrl, getTabsOnHostDetailsUrl, getHostsUrl } from './redirect_to_hosts'; export { getKubernetesUrl, getKubernetesDetailsUrl } from './redirect_to_kubernetes'; diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_alerts.tsx b/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_alerts.tsx new file mode 100644 index 0000000000000..d29530f2cdfca --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_alerts.tsx @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ALERTS_PATH } from '../../../../common/constants'; +import type { AlertDetailRouteType } from '../../../detections/pages/alert_details/types'; +import { appendSearch } from './helpers'; + +export const getAlertDetailsUrl = (alertId: string, search?: string) => + `/${alertId}/summary${appendSearch(search)}`; + +export const getAlertDetailsTabUrl = ( + detailName: string, + tabName: AlertDetailRouteType, + search?: string +) => `${ALERTS_PATH}/${detailName}/${tabName}${appendSearch(search)}`; diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx b/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx index 9483c549485de..ee16179c9c735 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx @@ -165,7 +165,7 @@ export const MlPopover = React.memo(() => { rel="noopener noreferrer" target="_blank" > - {'Anomaly Detection with Machine Learning'} + {i18n.ANOMALY_DETECTION_DOCS} </a> ), }} diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/translations.ts b/x-pack/plugins/security_solution/public/common/components/ml_popover/translations.ts index 2fa1178060005..960734936c1dd 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml_popover/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml_popover/translations.ts @@ -39,5 +39,12 @@ export const MODULE_NOT_COMPATIBLE_TITLE = (incompatibleJobCount: number) => i18n.translate('xpack.securitySolution.components.mlPopup.moduleNotCompatibleTitle', { values: { incompatibleJobCount }, defaultMessage: - '{incompatibleJobCount} {incompatibleJobCount, plural, =1 {job} other {jobs}} are currently unavailable', + '{incompatibleJobCount} {incompatibleJobCount, plural, =1 {job is} other {jobs are}} currently unavailable', }); + +export const ANOMALY_DETECTION_DOCS = i18n.translate( + 'xpack.securitySolution.entityAnalytics.anomalies.AnomalyDetectionDocsTitle', + { + defaultMessage: 'Anomaly Detection with Machine Learning', + } +); diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.test.ts b/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.test.ts index e0b200d94012b..84aec14891328 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.test.ts @@ -304,7 +304,7 @@ describe('Navigation Breadcrumbs', () => { expect(breadcrumbs).toEqual([ securityBreadCrumb, { - text: 'Exception lists', + text: 'Rule Exceptions', href: '', }, ]); @@ -623,7 +623,7 @@ describe('Navigation Breadcrumbs', () => { securityBreadCrumb, manageBreadcrumbs, { - text: 'Exception lists', + text: 'Rule Exceptions', href: '', }, ]); diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts b/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts index fa2178c52d94c..afcaff3f3d065 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts +++ b/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts @@ -15,6 +15,7 @@ import { getTrailingBreadcrumbs as getIPDetailsBreadcrumbs } from '../../../../n import { getTrailingBreadcrumbs as getDetectionRulesBreadcrumbs } from '../../../../detections/pages/detection_engine/rules/utils'; import { getTrailingBreadcrumbs as getUsersBreadcrumbs } from '../../../../users/pages/details/utils'; import { getTrailingBreadcrumbs as getKubernetesBreadcrumbs } from '../../../../kubernetes/pages/utils/breadcrumbs'; +import { getTrailingBreadcrumbs as getAlertDetailBreadcrumbs } from '../../../../detections/pages/alert_details/utils/breadcrumbs'; import { SecurityPageName } from '../../../../app/types'; import type { RouteSpyState, @@ -22,6 +23,7 @@ import type { NetworkRouteSpyState, AdministrationRouteSpyState, UsersRouteSpyState, + AlertDetailRouteSpyState, } from '../../../utils/route/types'; import { timelineActions } from '../../../../timelines/store/timeline'; import { TimelineId } from '../../../../../common/types/timeline'; @@ -132,6 +134,9 @@ const getTrailingBreadcrumbsForRoutes = ( if (isKubernetesRoutes(spyState)) { return getKubernetesBreadcrumbs(spyState, getSecuritySolutionUrl); } + if (isAlertRoutes(spyState)) { + return getAlertDetailBreadcrumbs(spyState, getSecuritySolutionUrl); + } return []; }; @@ -150,6 +155,9 @@ const isCaseRoutes = (spyState: RouteSpyState) => spyState.pageName === Security const isKubernetesRoutes = (spyState: RouteSpyState) => spyState.pageName === SecurityPageName.kubernetes; +const isAlertRoutes = (spyState: RouteSpyState): spyState is AlertDetailRouteSpyState => + spyState.pageName === SecurityPageName.alerts; + const isRulesRoutes = (spyState: RouteSpyState): spyState is AdministrationRouteSpyState => spyState.pageName === SecurityPageName.rules || spyState.pageName === SecurityPageName.rulesCreate; diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/__snapshots__/index.test.tsx.snap index ec824632e1aee..c4639b8ff8a82 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/__snapshots__/index.test.tsx.snap @@ -97,7 +97,7 @@ Object { "href": "securitySolutionUI/exceptions", "id": "exceptions", "isSelected": false, - "name": "Exception lists", + "name": "Rule Exceptions", "onClick": [Function], }, ], diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.test.tsx index 5a99df01e5328..1d13d100b4d88 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.test.tsx @@ -16,7 +16,7 @@ import { useIsExperimentalFeatureEnabled } from '../../../hooks/use_experimental import { TestProviders } from '../../../mock'; import { CASES_FEATURE_ID } from '../../../../../common/constants'; import { useCanSeeHostIsolationExceptionsMenu } from '../../../../management/pages/host_isolation_exceptions/view/hooks'; -import { useTourContext } from '../../guided_onboarding'; +import { useTourContext } from '../../guided_onboarding_tour'; import { useUserPrivileges } from '../../user_privileges'; import { noCasesPermissions, @@ -38,7 +38,7 @@ jest.mock('../../../hooks/use_selector'); jest.mock('../../../hooks/use_experimental_features'); jest.mock('../../../utils/route/use_route_spy'); jest.mock('../../../../management/pages/host_isolation_exceptions/view/hooks'); -jest.mock('../../guided_onboarding'); +jest.mock('../../guided_onboarding_tour'); jest.mock('../../user_privileges'); const mockUseUserPrivileges = useUserPrivileges as jest.Mock; @@ -187,25 +187,4 @@ describe('useSecuritySolutionNavigation', () => { }); }); }); - - describe('Guided onboarding tour', () => { - it('nav can be collapsed if tour is not shown', () => { - const { result } = renderHook<{}, KibanaPageTemplateProps['solutionNav']>( - () => useSecuritySolutionNavigation(), - { wrapper: TestProviders } - ); - - expect(result.current?.canBeCollapsed).toBe(true); - }); - it(`nav can't be collapsed if tour is shown`, () => { - (useTourContext as jest.Mock).mockReturnValue({ isTourShown: true }); - - const { result } = renderHook<{}, KibanaPageTemplateProps['solutionNav']>( - () => useSecuritySolutionNavigation(), - { wrapper: TestProviders } - ); - - expect(result.current?.canBeCollapsed).toBe(false); - }); - }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_primary_navigation.tsx b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_primary_navigation.tsx index 9e83ae9339dcd..647193357b66b 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_primary_navigation.tsx +++ b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_primary_navigation.tsx @@ -13,7 +13,6 @@ import type { PrimaryNavigationProps } from './types'; import { usePrimaryNavigationItems } from './use_navigation_items'; import { useIsGroupedNavigationEnabled } from '../helpers'; import { SecuritySideNav } from '../security_side_nav'; -import { useTourContext } from '../../guided_onboarding'; const translatedNavTitle = i18n.translate('xpack.securitySolution.navigation.mainLabel', { defaultMessage: 'Security', @@ -31,8 +30,6 @@ export const usePrimaryNavigation = ({ const [selectedTabId, setSelectedTabId] = useState(mapLocationToTab()); - const { isTourShown } = useTourContext(); - useEffect(() => { const currentTabSelected = mapLocationToTab(); @@ -49,7 +46,7 @@ export const usePrimaryNavigation = ({ }); return { - canBeCollapsed: !isTourShown, + canBeCollapsed: true, name: translatedNavTitle, icon: 'logoSecurity', ...(isGroupedNavigationEnabled diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/helpers.test.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/helpers.test.tsx index 6712782b5d7b1..b40130c0a3433 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/helpers.test.tsx @@ -18,25 +18,22 @@ import { rawEvents, removeIgnoredAlertFilters, shouldIgnoreAlertFilters, + detectionAlertsTables, } from './helpers'; import { SourcererScopeName } from '../../store/sourcerer/model'; -/** the following `TimelineId`s are detection alert tables */ -const detectionAlertsTimelines = [TableId.alertsOnAlertsPage, TableId.alertsOnRuleDetailsPage]; - -/** the following `TimelineId`s are NOT detection alert tables */ -const otherTimelines = [ +/** the following scopes are NOT detection alert tables */ +const otherScopes = [ TableId.hostsPageEvents, TableId.hostsPageSessions, TableId.networkPageEvents, TimelineId.active, - TimelineId.casePage, TimelineId.test, TableId.alternateTest, TableId.kubernetesPageSessions, ]; -const othersWithoutActive = otherTimelines.filter((x) => x !== TimelineId.active); +const othersWithoutActive = otherScopes.filter((x) => x !== TimelineId.active); const hostNameFilter: Filter = { meta: { @@ -169,13 +166,13 @@ describe('getOptions', () => { }); describe('isDetectionsAlertsTable', () => { - detectionAlertsTimelines.forEach((tableId) => + detectionAlertsTables.forEach((tableId) => test(`it returns true for detections alerts table '${tableId}'`, () => { expect(isDetectionsAlertsTable(tableId)).toEqual(true); }) ); - otherTimelines.forEach((tableId) => + otherScopes.forEach((tableId) => test(`it returns false for (NON alert table) timeline '${tableId}'`, () => { expect(isDetectionsAlertsTable(tableId)).toEqual(false); }) @@ -183,7 +180,7 @@ describe('isDetectionsAlertsTable', () => { }); describe('shouldIgnoreAlertFilters', () => { - detectionAlertsTimelines.forEach((tableId) => { + detectionAlertsTables.forEach((tableId) => { test(`it returns true when the view is 'raw' for detections alerts table '${tableId}'`, () => { const view = 'raw'; expect(shouldIgnoreAlertFilters({ tableId, view })).toEqual(true); @@ -195,7 +192,7 @@ describe('shouldIgnoreAlertFilters', () => { }); }); - otherTimelines.forEach((tableId) => { + otherScopes.forEach((tableId) => { test(`it returns false when the view is 'raw' for (NON alert table) timeline'${tableId}'`, () => { const view = 'raw'; expect(shouldIgnoreAlertFilters({ tableId, view })).toEqual(false); @@ -209,7 +206,7 @@ describe('shouldIgnoreAlertFilters', () => { }); describe('removeIgnoredAlertFilters', () => { - detectionAlertsTimelines.forEach((tableId) => { + detectionAlertsTables.forEach((tableId) => { test(`it removes the ignored alert filters when the view is 'raw' for detections alerts table '${tableId}'`, () => { const view = 'raw'; expect(removeIgnoredAlertFilters({ filters: allFilters, tableId, view })).toEqual([ @@ -223,7 +220,7 @@ describe('removeIgnoredAlertFilters', () => { }); }); - otherTimelines.forEach((tableId) => { + otherScopes.forEach((tableId) => { test(`it does NOT remove any filters when the view is 'raw' for (NON alert table) '${tableId}'`, () => { const view = 'alert'; expect(removeIgnoredAlertFilters({ filters: allFilters, tableId, view })).toEqual(allFilters); @@ -237,7 +234,7 @@ describe('removeIgnoredAlertFilters', () => { }); describe('getSourcererScopeName', () => { - detectionAlertsTimelines.forEach((tableId) => { + detectionAlertsTables.forEach((tableId) => { test(`it returns the 'default' SourcererScopeName when the view is 'raw' for detections alerts table '${tableId}'`, () => { const view = 'raw'; expect(getSourcererScopeName({ scopeId: tableId, view })).toEqual(SourcererScopeName.default); diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/helpers.ts b/x-pack/plugins/security_solution/public/common/components/top_n/helpers.ts index 75d22f475b68a..170714df654ec 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/helpers.ts +++ b/x-pack/plugins/security_solution/public/common/components/top_n/helpers.ts @@ -65,6 +65,13 @@ export interface TopNOption { 'data-test-subj': string; } +/** the following scopes are detection alert tables */ +export const detectionAlertsTables: string[] = [ + TableId.alertsOnAlertsPage, + TableId.alertsOnRuleDetailsPage, + TimelineId.casePage, +]; + /** A (stable) array containing only the 'All events' option */ export const allEvents: TopNOption[] = [ { @@ -117,8 +124,8 @@ export const getOptions = (activeTimelineEventsType?: TimelineEventsType): TopNO }; /** returns true if the specified timelineId is a detections alert table */ -export const isDetectionsAlertsTable = (tableId: string | undefined): boolean => - tableId === TableId.alertsOnAlertsPage || tableId === TableId.alertsOnRuleDetailsPage; +export const isDetectionsAlertsTable = (scopeId: string | undefined): boolean => + scopeId ? detectionAlertsTables.includes(scopeId) : false; /** * The following fields are used to filter alerts tables, (i.e. tables in the diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx index 7a5b4a351a988..f493cbc64f537 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx @@ -26,6 +26,7 @@ import type { Props } from './top_n'; import { StatefulTopN } from '.'; import { TableId, TimelineId } from '../../../../common/types/timeline'; import { tGridReducer } from '@kbn/timelines-plugin/public'; +import { detectionAlertsTables } from './helpers'; jest.mock('react-router-dom', () => { const original = jest.requireActual('react-router-dom'); @@ -158,7 +159,7 @@ const store = createStore( storage ); -let testProps = { +const testProps = { browserFields: mockBrowserFields, field, indexPattern: mockIndexPattern, @@ -361,21 +362,24 @@ describe('StatefulTopN', () => { expect(props.to).toEqual('2020-04-15T03:46:09.047Z'); }); }); - describe('rendering in a NON-active timeline context', () => { - test(`defaults to the 'Alert events' option when rendering in a NON-active timeline context (e.g. the Alerts table on the Detections page) when 'documentType' from 'useTimelineTypeContext()' is 'alerts'`, async () => { - testProps = { - ...testProps, - scopeId: TableId.alertsOnAlertsPage, - }; - const wrapper = mount( - <TestProviders store={store}> - <StatefulTopN {...testProps} /> - </TestProviders> - ); - await waitFor(() => { - const props = wrapper.find('[data-test-subj="top-n"]').first().props() as Props; - expect(props.defaultView).toEqual('alert'); + describe('rendering in alerts context', () => { + detectionAlertsTables.forEach((tableId) => { + test(`defaults to the 'Alert events' option when rendering in Alerts`, async () => { + const wrapper = mount( + <TestProviders store={store}> + <StatefulTopN + {...{ + ...testProps, + scopeId: tableId, + }} + /> + </TestProviders> + ); + await waitFor(() => { + const props = wrapper.find('[data-test-subj="top-n"]').first().props() as Props; + expect(props.defaultView).toEqual('alert'); + }); }); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx index 155ff517119b6..1e43949cd26c3 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx @@ -10,7 +10,6 @@ import { mount } from 'enzyme'; import React from 'react'; import { waitFor } from '@testing-library/react'; -import { TableId, TimelineId } from '../../../../common/types'; import '../../mock/match_media'; import { TestProviders, mockIndexPattern } from '../../mock'; @@ -136,56 +135,6 @@ describe('TopN', () => { }); }); - describe('view selection', () => { - const detectionAlertsTimelines = [TableId.alertsOnAlertsPage, TableId.alertsOnRuleDetailsPage]; - - const nonDetectionAlertTables = [ - TableId.hostsPageEvents, - TableId.networkPageEvents, - TimelineId.casePage, - ]; - - test('it disables view selection when scopeId is undefined', () => { - const wrapper = mount( - <TestProviders> - <TopN {...testProps} scopeId={undefined} /> - </TestProviders> - ); - expect(wrapper.find('[data-test-subj="view-select"]').first().props().disabled).toBe(true); - }); - - test('it disables view selection when timelineId is `active`', () => { - const wrapper = mount( - <TestProviders> - <TopN {...testProps} scopeId={TimelineId.active} /> - </TestProviders> - ); - expect(wrapper.find('[data-test-subj="view-select"]').first().props().disabled).toBe(true); - }); - - detectionAlertsTimelines.forEach((tableId) => { - test(`it enables view selection for detection alert table '${tableId}'`, () => { - const wrapper = mount( - <TestProviders> - <TopN {...testProps} scopeId={tableId} /> - </TestProviders> - ); - expect(wrapper.find('[data-test-subj="view-select"]').first().props().disabled).toBe(false); - }); - }); - - nonDetectionAlertTables.forEach((tableId) => { - test(`it disables view selection for NON detection alert table '${tableId}'`, () => { - const wrapper = mount( - <TestProviders> - <TopN {...testProps} scopeId={tableId} /> - </TestProviders> - ); - expect(wrapper.find('[data-test-subj="view-select"]').first().props().disabled).toBe(true); - }); - }); - }); - describe('events view', () => { let wrapper: ReactWrapper; diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx index 75e4901facb4a..365435ff24d28 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx @@ -17,11 +17,7 @@ import type { InputsModelId } from '../../store/inputs/constants'; import type { TimelineEventsType } from '../../../../common/types/timeline'; import { useSourcererDataView } from '../../containers/sourcerer'; import type { TopNOption } from './helpers'; -import { - isDetectionsAlertsTable, - getSourcererScopeName, - removeIgnoredAlertFilters, -} from './helpers'; +import { getSourcererScopeName, removeIgnoredAlertFilters } from './helpers'; import * as i18n from './translations'; import type { AlertsStackByField } from '../../../detections/components/alerts_kpis/common/types'; @@ -38,11 +34,12 @@ const CloseButton = styled(EuiButtonIcon)` const ViewSelect = styled(EuiSuperSelect)` z-index: 999999; - width: 155px; + width: 170px; `; const TopNContent = styled.div` margin-top: 4px; + margin-right: ${({ theme }) => theme.eui.euiSizeXS}; .euiPanel { border: none; @@ -101,13 +98,13 @@ const TopNComponent: React.FC<Props> = ({ () => ( <ViewSelect data-test-subj="view-select" - disabled={!isDetectionsAlertsTable(scopeId)} + disabled={options.length === 1} onChange={onViewSelected} options={options} valueOfSelected={view} /> ), - [onViewSelected, options, scopeId, view] + [onViewSelected, options, view] ); // alert workflow statuses (e.g. open | closed) and other alert-specific diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/translations.ts b/x-pack/plugins/security_solution/public/common/components/top_n/translations.ts index e482f4cd7b16d..058e0a8cf2c63 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/top_n/translations.ts @@ -12,7 +12,7 @@ export const CLOSE = i18n.translate('xpack.securitySolution.topN.closeButtonLabe }); export const ALL_EVENTS = i18n.translate('xpack.securitySolution.topN.allEventsSelectLabel', { - defaultMessage: 'All events', + defaultMessage: 'Alerts and events', }); export const RAW_EVENTS = i18n.translate('xpack.securitySolution.topN.rawEventsSelectLabel', { @@ -20,5 +20,5 @@ export const RAW_EVENTS = i18n.translate('xpack.securitySolution.topN.rawEventsS }); export const ALERT_EVENTS = i18n.translate('xpack.securitySolution.topN.alertEventsSelectLabel', { - defaultMessage: 'Detection Alerts', + defaultMessage: 'Detection alerts', }); diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.ts b/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.ts index 17de09113df9a..483bf2192efc5 100644 --- a/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.ts +++ b/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.ts @@ -44,6 +44,7 @@ export const useEndpointPrivileges = (): Immutable<EndpointPrivileges> => { const fleetServices = fleetServicesFromUseKibana ?? fleetServicesFromPluginStart; const isEndpointRbacEnabled = useIsExperimentalFeatureEnabled('endpointRbacEnabled'); + const isEndpointRbacV1Enabled = useIsExperimentalFeatureEnabled('endpointRbacV1Enabled'); const endpointPermissions = calculatePermissionsFromCapabilities( useKibana().services.application.capabilities @@ -57,7 +58,7 @@ export const useEndpointPrivileges = (): Immutable<EndpointPrivileges> => { licenseService, fleetAuthz, userRoles, - isEndpointRbacEnabled, + isEndpointRbacEnabled || isEndpointRbacV1Enabled, endpointPermissions ) : getEndpointAuthzInitialState()), @@ -72,6 +73,7 @@ export const useEndpointPrivileges = (): Immutable<EndpointPrivileges> => { licenseService, userRoles, isEndpointRbacEnabled, + isEndpointRbacV1Enabled, endpointPermissions, ]); diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_dns_queries.test.ts.snap b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_dns_queries.test.ts.snap index 34bc6f13f8004..11d7e4f53ede4 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_dns_queries.test.ts.snap +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_dns_queries.test.ts.snap @@ -158,6 +158,7 @@ Object { }, "visualization": Object { "accessor": "0374e520-eae0-4ac1-bcfe-37565e7fc9e3", + "autoScaleMetricAlignment": "left", "colorMode": "None", "layerId": "cea37c70-8f91-43bf-b9fe-72d8c049f6a3", "layerType": "data", diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_network_events.test.ts.snap b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_network_events.test.ts.snap index b29761bbf8a74..f91197d152584 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_network_events.test.ts.snap +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_network_events.test.ts.snap @@ -163,6 +163,7 @@ Object { }, "visualization": Object { "accessor": "370ebd07-5ce0-4f46-a847-0e363c50d037", + "autoScaleMetricAlignment": "left", "layerId": "eaadfec7-deaa-4aeb-a403-3b4e516416d2", "layerType": "data", }, diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_tls_handshakes.test.ts.snap b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_tls_handshakes.test.ts.snap index b8ed38aa918c4..1ee417328f194 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_tls_handshakes.test.ts.snap +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_tls_handshakes.test.ts.snap @@ -182,6 +182,7 @@ Object { }, "visualization": Object { "accessor": "21052b6b-5504-4084-a2e2-c17f772345cf", + "autoScaleMetricAlignment": "left", "layerId": "1f48a633-8eee-45ae-9471-861227e9ca03", "layerType": "data", }, diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_flow_ids.test.ts.snap b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_flow_ids.test.ts.snap index 06daf745e0345..d971cfa0cd7ce 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_flow_ids.test.ts.snap +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_flow_ids.test.ts.snap @@ -146,6 +146,7 @@ Object { }, "visualization": Object { "accessor": "a27f3503-9c73-4fc1-86bb-12461dae4b70", + "autoScaleMetricAlignment": "left", "layerId": "5d46d48f-6ce8-46be-a797-17ad50642564", "layerType": "data", }, diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.ts b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.ts index c4691a4797b5b..4f759160aebb8 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.ts +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.ts @@ -17,6 +17,7 @@ export const kpiDnsQueriesLensAttributes: LensAttributes = { accessor: '0374e520-eae0-4ac1-bcfe-37565e7fc9e3', layerType: 'data', colorMode: 'None', + autoScaleMetricAlignment: 'left', }, query: { query: '', diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.ts b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.ts index bb88ceb732c66..bdaa099a95dac 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.ts +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.ts @@ -16,6 +16,7 @@ export const kpiNetworkEventsLensAttributes: LensAttributes = { layerId: 'eaadfec7-deaa-4aeb-a403-3b4e516416d2', accessor: '370ebd07-5ce0-4f46-a847-0e363c50d037', layerType: 'data', + autoScaleMetricAlignment: 'left', }, query: { query: '', diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.ts b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.ts index b7b651bf56362..8b4e8c6b5e43e 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.ts +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.ts @@ -15,6 +15,7 @@ export const kpiTlsHandshakesLensAttributes: LensAttributes = { layerId: '1f48a633-8eee-45ae-9471-861227e9ca03', accessor: '21052b6b-5504-4084-a2e2-c17f772345cf', layerType: 'data', + autoScaleMetricAlignment: 'left', }, query: { query: diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.ts b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.ts index 3660f2ff6ad06..01d59b68ad800 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.ts +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.ts @@ -16,6 +16,7 @@ export const kpiUniqueFlowIdsLensAttributes: LensAttributes = { layerId: '5d46d48f-6ce8-46be-a797-17ad50642564', accessor: 'a27f3503-9c73-4fc1-86bb-12461dae4b70', layerType: 'data', + autoScaleMetricAlignment: 'left', }, query: { query: 'source.ip: * or destination.ip: * ', diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_area.test.ts.snap b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_area.test.ts.snap index 1dcaab239de8e..e6560a8f2c33d 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_area.test.ts.snap +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_area.test.ts.snap @@ -7,17 +7,17 @@ Object { Object { "id": "security-solution-my-test", "name": "indexpattern-datasource-current-indexpattern", - "type": "{dataViewId}", + "type": "index-pattern", }, Object { "id": "security-solution-my-test", "name": "indexpattern-datasource-layer-31213ae3-905b-4e88-b987-0cccb1f3209f", - "type": "{dataViewId}", + "type": "index-pattern", }, Object { "id": "security-solution-my-test", "name": "indexpattern-datasource-layer-4590dafb-4ac7-45aa-8641-47a3ff0b817c", - "type": "{dataViewId}", + "type": "index-pattern", }, ], "state": Object { diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.ts b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.ts index da6bdf139a1ca..ce7be2aa9f369 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.ts +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.ts @@ -183,18 +183,18 @@ export const kpiUserAuthenticationsAreaLensAttributes: LensAttributes = { }, references: [ { - type: '{dataViewId}', - id: 'security-solution-default', + type: 'index-pattern', + id: '{dataViewId}', name: 'indexpattern-datasource-current-indexpattern', }, { - type: '{dataViewId}', - id: 'security-solution-default', + type: 'index-pattern', + id: '{dataViewId}', name: 'indexpattern-datasource-layer-31213ae3-905b-4e88-b987-0cccb1f3209f', }, { - type: '{dataViewId}', - id: 'security-solution-default', + type: 'index-pattern', + id: '{dataViewId}', name: 'indexpattern-datasource-layer-4590dafb-4ac7-45aa-8641-47a3ff0b817c', }, ], diff --git a/x-pack/plugins/security_solution/public/common/containers/cases/use_get_related_cases_by_event.ts b/x-pack/plugins/security_solution/public/common/containers/cases/use_get_related_cases_by_event.ts new file mode 100644 index 0000000000000..e032c2d63c403 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/containers/cases/use_get_related_cases_by_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 { useCallback, useState, useEffect } from 'react'; +import { useKibana, useToasts } from '../../lib/kibana'; +import { CASES_ERROR_TOAST } from '../../components/event_details/insights/translations'; +import { APP_ID } from '../../../../common/constants'; + +type RelatedCases = Array<{ id: string; title: string }>; + +export const useGetRelatedCasesByEvent = (eventId: string) => { + const { + services: { cases }, + } = useKibana(); + const toasts = useToasts(); + + const [relatedCases, setRelatedCases] = useState<RelatedCases | undefined>(undefined); + const [loading, setLoading] = useState(false); + const [error, setError] = useState<null | unknown>(null); + + const getRelatedCases = useCallback(async () => { + setLoading(true); + let relatedCasesResponse: RelatedCases = []; + try { + if (eventId) { + relatedCasesResponse = + (await cases.api.getRelatedCases(eventId, { + owner: APP_ID, + })) ?? []; + } + } catch (err) { + setError(err); + toasts.addWarning(CASES_ERROR_TOAST(err)); + } finally { + setRelatedCases(relatedCasesResponse); + setLoading(false); + } + }, [eventId, cases.api, toasts]); + + useEffect(() => { + getRelatedCases(); + }, [eventId, getRelatedCases]); + + return { + loading, + error, + relatedCases, + refetchRelatedCases: getRelatedCases, + }; +}; diff --git a/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.test.ts b/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.test.ts index bb65e5def2792..dba14afd0ff2e 100644 --- a/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.test.ts +++ b/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.test.ts @@ -10,8 +10,16 @@ import { useKibana } from '../../lib/kibana'; import { useMatrixHistogram, useMatrixHistogramCombined } from '.'; import { MatrixHistogramType } from '../../../../common/search_strategy'; import { TestProviders } from '../../mock/test_providers'; +import { useTrackHttpRequest } from '../../lib/apm/use_track_http_request'; jest.mock('../../lib/kibana'); +jest.mock('../../lib/apm/use_track_http_request'); + +const mockEndTracking = jest.fn(); +const mockStartTracking = jest.fn(() => ({ endTracking: mockEndTracking })); +(useTrackHttpRequest as jest.Mock).mockReturnValue({ + startTracking: mockStartTracking, +}); const basicResponse = { isPartial: false, @@ -42,7 +50,7 @@ describe('useMatrixHistogram', () => { }; afterEach(() => { - (useKibana().services.data.search.search as jest.Mock).mockClear(); + jest.clearAllMocks(); }); it('should update request when props has changed', async () => { @@ -156,6 +164,58 @@ describe('useMatrixHistogram', () => { act(() => rerender()); expect(abortSpy).toHaveBeenCalledTimes(3); }); + + describe('trackHttpRequest', () => { + it('should start tracking when request starts', () => { + renderHook(useMatrixHistogram, { + initialProps: props, + wrapper: TestProviders, + }); + + expect(mockStartTracking).toHaveBeenCalledWith({ + name: `securitySolutionUI matrixHistogram ${MatrixHistogramType.events}`, + }); + }); + + it('should end tracking success when the request succeeds', () => { + (useKibana().services.data.search.search as jest.Mock).mockReturnValueOnce({ + subscribe: ({ next }: { next: Function }) => next(basicResponse), + }); + + renderHook(useMatrixHistogram, { + initialProps: props, + wrapper: TestProviders, + }); + + expect(mockEndTracking).toHaveBeenCalledWith('success'); + }); + + it('should end tracking error when the partial request is invalid', () => { + (useKibana().services.data.search.search as jest.Mock).mockReturnValueOnce({ + subscribe: ({ next }: { next: Function }) => next(null), + }); + + renderHook(useMatrixHistogram, { + initialProps: props, + wrapper: TestProviders, + }); + + expect(mockEndTracking).toHaveBeenCalledWith('invalid'); + }); + + it('should end tracking error when the request fails', () => { + (useKibana().services.data.search.search as jest.Mock).mockReturnValueOnce({ + subscribe: ({ error }: { error: Function }) => error('some error'), + }); + + renderHook(useMatrixHistogram, { + initialProps: props, + wrapper: TestProviders, + }); + + expect(mockEndTracking).toHaveBeenCalledWith('error'); + }); + }); }); describe('useMatrixHistogramCombined', () => { diff --git a/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.ts b/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.ts index c770713b602b7..85512855580c3 100644 --- a/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.ts +++ b/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.ts @@ -28,6 +28,8 @@ import { getInspectResponse } from '../../../helpers'; import type { InspectResponse } from '../../../types'; import * as i18n from './translations'; import { useAppToasts } from '../../hooks/use_app_toasts'; +import { useTrackHttpRequest } from '../../lib/apm/use_track_http_request'; +import { APP_UI_ID } from '../../../../common/constants'; export type Buckets = Array<{ key: string; @@ -71,6 +73,7 @@ export const useMatrixHistogram = ({ const abortCtrl = useRef(new AbortController()); const searchSubscription$ = useRef(new Subscription()); const [loading, setLoading] = useState(false); + const { startTracking } = useTrackHttpRequest(); const [matrixHistogramRequest, setMatrixHistogramRequest] = useState<MatrixHistogramRequestOptions>({ @@ -102,11 +105,14 @@ export const useMatrixHistogram = ({ buckets: [], }); - const hostsSearch = useCallback( + const search = useCallback( (request: MatrixHistogramRequestOptions) => { const asyncSearch = async () => { abortCtrl.current = new AbortController(); setLoading(true); + const { endTracking } = startTracking({ + name: `${APP_UI_ID} matrixHistogram ${histogramType}`, + }); searchSubscription$.current = data.search .search<MatrixHistogramRequestOptions, MatrixHistogramStrategyResponse>(request, { @@ -130,10 +136,12 @@ export const useMatrixHistogram = ({ totalCount: histogramBuckets.reduce((acc, bucket) => bucket.doc_count + acc, 0), buckets: histogramBuckets, })); + endTracking('success'); searchSubscription$.current.unsubscribe(); } else if (isErrorResponse(response)) { setLoading(false); addWarning(i18n.ERROR_MATRIX_HISTOGRAM); + endTracking('invalid'); searchSubscription$.current.unsubscribe(); } }, @@ -142,6 +150,7 @@ export const useMatrixHistogram = ({ addError(msg, { title: errorMessage ?? i18n.FAIL_MATRIX_HISTOGRAM, }); + endTracking('error'); searchSubscription$.current.unsubscribe(); }, }); @@ -151,7 +160,7 @@ export const useMatrixHistogram = ({ asyncSearch(); refetch.current = asyncSearch; }, - [data.search, errorMessage, addError, addWarning, histogramType] + [data.search, histogramType, addWarning, addError, errorMessage, startTracking] ); useEffect(() => { @@ -189,13 +198,13 @@ export const useMatrixHistogram = ({ useEffect(() => { // We want to search if it is not skipped, stackByField ends with ip and include missing data if (!skip) { - hostsSearch(matrixHistogramRequest); + search(matrixHistogramRequest); } return () => { searchSubscription$.current.unsubscribe(); abortCtrl.current.abort(); }; - }, [matrixHistogramRequest, hostsSearch, skip]); + }, [matrixHistogramRequest, search, skip]); useEffect(() => { if (skip) { @@ -207,7 +216,7 @@ export const useMatrixHistogram = ({ const runMatrixHistogramSearch = useCallback( (to: string, from: string) => { - hostsSearch({ + search({ ...matrixHistogramRequest, timerange: { interval: '12h', @@ -216,7 +225,7 @@ export const useMatrixHistogram = ({ }, }); }, - [matrixHistogramRequest, hostsSearch] + [matrixHistogramRequest, search] ); return [loading, matrixHistogramResponse, runMatrixHistogramSearch]; diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_get_fields_data.ts b/x-pack/plugins/security_solution/public/common/hooks/use_get_fields_data.ts new file mode 100644 index 0000000000000..4190010301a4e --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/hooks/use_get_fields_data.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 { useCallback, useMemo } from 'react'; +import { getOr } from 'lodash/fp'; +import type { SearchHit } from '../../../common/search_strategy'; + +/** + * Since the fields api may return a string array as well as an object array + * Getting the nestedPath of an object array would require first getting the top level `fields` key + * The field api keys do not provide an index value for the original order of each object + * for example, we might expect fields to reference kibana.alert.parameters.0.index, but the index information is represented by the array position. + * 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` + */ +const getAllDotIndicesInReverse = (dotField: string): number[] => { + const dotRegx = RegExp('[.]', 'g'); + const indicesOfAllDotsInString = []; + let result = dotRegx.exec(dotField); + while (result) { + indicesOfAllDotsInString.push(result.index); + result = dotRegx.exec(dotField); + } + /** + * Put in reverse so we start look up from the most likely to be found; + * [[kibana.alert.parameters, index], ['kibana.alert', 'parameters.index'], ['kibana', 'alert.parameters.index']] + */ + return indicesOfAllDotsInString.reverse(); +}; + +/** + * We get the dot paths so we can look up each path to see if any of the nested fields exist + * */ + +const getAllPotentialDotPaths = (dotField: string): string[][] => { + const reverseDotIndices = getAllDotIndicesInReverse(dotField); + + // The nested array paths seem to be at most a tuple (i.e.: `kibana.alert.parameters`, `some.nested.parameters.field`) + const pathTuples = reverseDotIndices.map((dotIndex: number) => { + return [dotField.slice(0, dotIndex), dotField.slice(dotIndex + 1)]; + }); + + return pathTuples; +}; + +const getNestedValue = (startPath: string, endPath: string, data: Record<string, unknown>) => { + const foundPrimaryPath = data[startPath]; + if (Array.isArray(foundPrimaryPath)) { + // If the nested path points to an array of objects return the nested value of every object in the array + return foundPrimaryPath + .map((nestedObj) => getOr(null, endPath, nestedObj)) // TODO:QUESTION: does it make sense to leave undefined or null values as array position could be important? + .filter((val) => val !== null); + } else { + // The nested path is just a nested object, so use getOr + return getOr(undefined, endPath, foundPrimaryPath); + } +}; + +/** + * we get the field value from a fields response and by breaking down to look at each individual path, + * we're able to get both top level fields as well as nested fields that don't provide index information. + * In the case where a user enters kibana.alert.parameters.someField, a mapped array of the subfield value will be returned + */ +const getFieldsValue = ( + dotField: string, + data: SearchHit['fields'] | undefined, + cacheNestedField: (fullPath: string, value: unknown) => void +) => { + if (!dotField || !data) return undefined; + + // If the dotField exists and is not a nested object return it + if (Object.hasOwn(data, dotField)) return data[dotField]; + else { + const pathTuples = getAllPotentialDotPaths(dotField); + for (const [startPath, endPath] of pathTuples) { + const foundPrimaryPath = Object.hasOwn(data, startPath) ? data[startPath] : null; + if (foundPrimaryPath) { + const nestedValue = getNestedValue(startPath, endPath, data); + // We cache only the values that need extra work to find. This can be an array of values or a single value + cacheNestedField(dotField, nestedValue); + return nestedValue; + } + } + } + + // Return undefined if nothing is found + return undefined; +}; + +export type GetFieldsDataValue = string | string[] | null | undefined; +export type GetFieldsData = (field: string) => GetFieldsDataValue; + +export const useGetFieldsData = (fieldsData: SearchHit['fields'] | undefined): GetFieldsData => { + // TODO: Move cache to top level container such as redux or context. Make it store type agnostic if possible + // TODO: Handle updates where data is re-requested and the cache is reset. + const cachedOriginalData = useMemo(() => fieldsData, [fieldsData]); + const cachedExpensiveNestedValues: Record<string, unknown> = useMemo(() => ({}), []); + + // Speed up any lookups elsewhere by caching the field. + const cacheNestedValues = useCallback( + (fullPath: string, value: unknown) => { + cachedExpensiveNestedValues[fullPath] = value; + }, + [cachedExpensiveNestedValues] + ); + + return useCallback( + (field: string) => { + let fieldsValue; + // Get an expensive value from the cache if it exists, otherwise search for the value + if (Object.hasOwn(cachedExpensiveNestedValues, field)) { + fieldsValue = cachedExpensiveNestedValues[field]; + } else { + fieldsValue = cachedOriginalData + ? getFieldsValue(field, cachedOriginalData, cacheNestedValues) + : undefined; + } + + if (Array.isArray(fieldsValue)) { + // Return the value if it's singular, otherwise return an expected array of values + if (fieldsValue.length === 0) return undefined; + else return fieldsValue; + } + // Otherwise return the given fieldsValue if it isn't an array + return fieldsValue; + }, + [cacheNestedValues, cachedExpensiveNestedValues, cachedOriginalData] + ); +}; diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts b/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts index 5d2fed9fc6241..efa9ce4831be7 100644 --- a/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts +++ b/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts @@ -44,6 +44,7 @@ import { noCasesPermissions } from '../../../cases_test_utils'; import { triggersActionsUiMock } from '@kbn/triggers-actions-ui-plugin/public/mocks'; import { mockApm } from '../apm/service.mock'; import { cloudExperimentsMock } from '@kbn/cloud-experiments-plugin/common/mocks'; +import { guidedOnboardingMock } from '@kbn/guided-onboarding-plugin/public/mocks'; const mockUiSettings: Record<string, unknown> = { [DEFAULT_TIME_RANGE]: { from: 'now-15m', to: 'now', mode: 'quick' }, @@ -106,6 +107,7 @@ export const createStartServicesMock = ( cases.helpers.getUICapabilities.mockReturnValue(noCasesPermissions()); const triggersActionsUi = triggersActionsUiMock.createStart(); const cloudExperiments = cloudExperimentsMock.createStartMock(); + const guidedOnboarding = guidedOnboardingMock.createStart(); return { ...core, @@ -173,6 +175,7 @@ export const createStartServicesMock = ( }, triggersActionsUi, cloudExperiments, + guidedOnboarding, } as unknown as StartServices; }; diff --git a/x-pack/plugins/security_solution/public/common/mock/global_state.ts b/x-pack/plugins/security_solution/public/common/mock/global_state.ts index 967eca53bce1b..20191f7ce312a 100644 --- a/x-pack/plugins/security_solution/public/common/mock/global_state.ts +++ b/x-pack/plugins/security_solution/public/common/mock/global_state.ts @@ -346,24 +346,26 @@ export const mockGlobalState: State = { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z', }, - sessionViewConfig: null, - show: false, + resolveTimelineConfig: undefined, pinnedEventIds: {}, pinnedEventsSaveObject: {}, - itemsPerPageOptions: [5, 10, 20], + sessionViewConfig: null, + show: false, sort: [ { columnId: '@timestamp', columnType: 'date', esTypes: ['date'], - sortDirection: Direction.desc, + sortDirection: 'desc', }, ], - isSaving: false, + status: TimelineStatus.draft, version: null, - status: TimelineStatus.active, - isSelectAllChecked: false, selectedEventIds: {}, + isSelectAllChecked: false, + filters: [], + isSaving: false, + itemsPerPageOptions: [10, 25, 50, 100], }, }, insertTimeline: null, diff --git a/x-pack/plugins/security_solution/public/common/utils/resolve_path_variables.ts b/x-pack/plugins/security_solution/public/common/utils/resolve_path_variables.ts index 89067e575665d..585cfb61aafe2 100644 --- a/x-pack/plugins/security_solution/public/common/utils/resolve_path_variables.ts +++ b/x-pack/plugins/security_solution/public/common/utils/resolve_path_variables.ts @@ -5,7 +5,10 @@ * 2.0. */ -export const resolvePathVariables = (path: string, variables: { [K: string]: string | number }) => +export const resolvePathVariables = ( + path: string, + variables: { [K: string]: string | number } +): string => Object.keys(variables).reduce((acc, paramName) => { return acc.replace(new RegExp(`\{${paramName}\}`, 'g'), String(variables[paramName])); }, path); diff --git a/x-pack/plugins/security_solution/public/common/utils/route/types.ts b/x-pack/plugins/security_solution/public/common/utils/route/types.ts index 71d58f487da66..168c918545844 100644 --- a/x-pack/plugins/security_solution/public/common/utils/route/types.ts +++ b/x-pack/plugins/security_solution/public/common/utils/route/types.ts @@ -13,6 +13,7 @@ import type { TimelineType } from '../../../../common/types/timeline'; import type { HostsTableType } from '../../../hosts/store/model'; import type { NetworkRouteType } from '../../../network/pages/navigation/types'; +import type { AlertDetailRouteType } from '../../../detections/pages/alert_details/types'; import type { AdministrationSubTab as AdministrationType } from '../../../management/types'; import type { FlowTarget } from '../../../../common/search_strategy'; import type { UsersTableType } from '../../../users/store/model'; @@ -21,6 +22,7 @@ import type { SecurityPageName } from '../../../app/types'; export type SiemRouteType = | HostsTableType | NetworkRouteType + | AlertDetailRouteType | TimelineType | AdministrationType | UsersTableType; @@ -47,6 +49,10 @@ export interface NetworkRouteSpyState extends RouteSpyState { tabName: NetworkRouteType | undefined; } +export interface AlertDetailRouteSpyState extends RouteSpyState { + tabName: AlertDetailRouteType | undefined; +} + export interface AdministrationRouteSpyState extends RouteSpyState { tabName: AdministrationType | undefined; } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/columns.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/columns.tsx deleted file mode 100644 index 4b196968de008..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/columns.tsx +++ /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 React from 'react'; -import type { EuiBasicTableColumn } from '@elastic/eui'; -import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; - -import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; -import { DEFAULT_RELATIVE_DATE_THRESHOLD } from '../../../../../common/constants'; -import type { FormatUrl } from '../../../../common/components/link_to'; -import { PopoverItems } from '../../../../common/components/popover_items'; -import { FormattedRelativePreferenceDate } from '../../../../common/components/formatted_date'; -import { getRuleDetailsUrl } from '../../../../common/components/link_to/redirect_to_detection_engine'; -import { LinkAnchor } from '../../../../common/components/links'; -import * as i18n from './translations'; -import type { ExceptionListInfo } from './use_all_exception_lists'; -import type { ExceptionsTableItem } from './types'; - -export type AllExceptionListsColumns = EuiBasicTableColumn<ExceptionsTableItem>; - -const RULES_TO_DISPLAY = 1; - -export const getAllExceptionListsColumns = ( - onExport: (arg: { id: string; listId: string; namespaceType: NamespaceType }) => () => void, - onDelete: (arg: { id: string; listId: string; namespaceType: NamespaceType }) => () => void, - formatUrl: FormatUrl, - navigateToUrl: (url: string) => Promise<void>, - isKibanaReadOnly: boolean -): AllExceptionListsColumns[] => [ - { - align: 'left', - field: 'list_id', - name: i18n.EXCEPTION_LIST_ID_TITLE, - truncateText: true, - dataType: 'string', - width: '20%', - render: (value: ExceptionListInfo['list_id']) => ( - <EuiToolTip content={value} anchorClassName="eui-textTruncate"> - <span data-test-subj="exceptionsTableListId">{value}</span> - </EuiToolTip> - ), - }, - { - align: 'left', - field: 'name', - name: i18n.EXCEPTION_LIST_NAME, - truncateText: true, - dataType: 'string', - width: '20%', - render: (value: ExceptionListInfo['name']) => ( - <EuiToolTip content={value} anchorClassName="eui-textTruncate"> - <span data-test-subj="exceptionsTableName">{value}</span> - </EuiToolTip> - ), - }, - { - field: 'rules', - name: i18n.RULES_ASSIGNED_TO_TITLE, - dataType: 'string', - width: '30%', - render: (rules: ExceptionListInfo['rules']) => { - const renderItem = <T extends ExceptionListInfo['rules'][number]>( - { id, name }: T, - index: number, - items: T[] - ) => { - const ruleHref = formatUrl(getRuleDetailsUrl(id)); - const isSeparator = index !== items.length - 1; - return ( - <> - <EuiToolTip content={name} anchorClassName="eui-textTruncate"> - <> - <LinkAnchor - key={id} - data-test-subj="ruleNameLink" - onClick={(ev: { preventDefault: () => void }) => { - ev.preventDefault(); - navigateToUrl(ruleHref); - }} - href={ruleHref} - > - {name} - {isSeparator && ','} - </LinkAnchor> - </> - </EuiToolTip> - {isSeparator && ' '} - </> - ); - }; - - return ( - <PopoverItems - items={rules} - numberOfItemsToDisplay={RULES_TO_DISPLAY} - popoverTitle={i18n.RULES_ASSIGNED_TO_TITLE} - popoverButtonTitle={i18n.showMoreRules(rules.length - 1)} - renderItem={renderItem} - dataTestPrefix="rules" - /> - ); - }, - }, - { - align: 'left', - field: 'created_at', - name: i18n.LIST_DATE_CREATED_TITLE, - truncateText: true, - dataType: 'date', - width: '15%', - render: (value: ExceptionListInfo['created_at']) => ( - <FormattedRelativePreferenceDate - relativeThresholdInHrs={DEFAULT_RELATIVE_DATE_THRESHOLD} - value={value} - tooltipFieldName={i18n.LIST_DATE_CREATED_TITLE} - tooltipAnchorClassName="eui-textTruncate" - /> - ), - }, - { - align: 'left', - field: 'updated_at', - name: i18n.LIST_DATE_UPDATED_TITLE, - truncateText: true, - width: '15%', - render: (value: ExceptionListInfo['updated_at']) => ( - <FormattedRelativePreferenceDate - relativeThresholdInHrs={DEFAULT_RELATIVE_DATE_THRESHOLD} - value={value} - tooltipFieldName={i18n.LIST_DATE_UPDATED_TITLE} - tooltipAnchorClassName="eui-textTruncate" - /> - ), - }, - { - align: 'left', - width: '76px', - name: i18n.EXCEPTION_LIST_ACTIONS, - actions: [ - { - render: ({ id, list_id: listId, namespace_type: namespaceType }: ExceptionListInfo) => ( - <EuiButtonIcon - onClick={onExport({ - id, - listId, - namespaceType, - })} - aria-label="Export exception list" - iconType="exportAction" - data-test-subj="exceptionsTableExportButton" - /> - ), - }, - { - render: ({ id, list_id: listId, namespace_type: namespaceType }: ExceptionListInfo) => { - return listId === 'endpoint_list' || isKibanaReadOnly ? ( - <></> - ) : ( - <EuiButtonIcon - color="danger" - onClick={onDelete({ id, listId, namespaceType })} - aria-label="Delete exception list" - iconType="trash" - data-test-subj="exceptionsTableDeleteButton" - /> - ); - }, - }, - ], - }, -]; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table.test.tsx deleted file mode 100644 index c443968c14015..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table.test.tsx +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { mount } from 'enzyme'; - -import { TestProviders } from '../../../../common/mock'; -import { getExceptionListSchemaMock } from '@kbn/lists-plugin/common/schemas/response/exception_list_schema.mock'; -import { useUserData } from '../../../../detections/components/user_info'; - -import { ExceptionListsTable } from './exceptions_table'; -import { useApi, useExceptionLists } from '@kbn/securitysolution-list-hooks'; -import { useAllExceptionLists } from './use_all_exception_lists'; -import { useHistory } from 'react-router-dom'; -import { generateHistoryMock } from '../../../../common/utils/route/mocks'; - -jest.mock('../../../../detections/components/user_info'); -jest.mock('../../../../common/lib/kibana'); -jest.mock('./use_all_exception_lists'); -jest.mock('@kbn/securitysolution-list-hooks'); -jest.mock('react-router-dom', () => { - const originalModule = jest.requireActual('react-router-dom'); - return { - ...originalModule, - useHistory: jest.fn(), - }; -}); -jest.mock('@kbn/i18n-react', () => { - const originalModule = jest.requireActual('@kbn/i18n-react'); - const FormattedRelative = jest.fn().mockImplementation(() => '20 hours ago'); - - return { - ...originalModule, - FormattedRelative, - }; -}); - -jest.mock('../../../../detections/containers/detection_engine/lists/use_lists_config', () => ({ - useListsConfig: jest.fn().mockReturnValue({ loading: false }), -})); - -describe('ExceptionListsTable', () => { - const mockHistory = generateHistoryMock(); - const exceptionList1 = getExceptionListSchemaMock(); - const exceptionList2 = { ...getExceptionListSchemaMock(), list_id: 'not_endpoint_list', id: '2' }; - - beforeAll(() => { - (useHistory as jest.Mock).mockReturnValue(mockHistory); - }); - - beforeEach(() => { - (useApi as jest.Mock).mockReturnValue({ - deleteExceptionList: jest.fn(), - exportExceptionList: jest.fn(), - }); - - (useExceptionLists as jest.Mock).mockReturnValue([ - false, - [exceptionList1, exceptionList2], - { - page: 1, - perPage: 20, - total: 2, - }, - jest.fn(), - ]); - - (useAllExceptionLists as jest.Mock).mockReturnValue([ - false, - [ - { ...exceptionList1, rules: [] }, - { ...exceptionList2, rules: [] }, - ], - { - not_endpoint_list: exceptionList2, - endpoint_list: exceptionList1, - }, - ]); - - (useUserData as jest.Mock).mockReturnValue([ - { - loading: false, - canUserCRUD: false, - canUserREAD: false, - }, - ]); - }); - - it('does not render delete option if list is "endpoint_list"', async () => { - const wrapper = mount( - <TestProviders> - <ExceptionListsTable /> - </TestProviders> - ); - expect(wrapper.find('[data-test-subj="exceptionsTableListId"]').at(0).text()).toEqual( - 'endpoint_list' - ); - - expect(wrapper.find('[data-test-subj="exceptionsTableListId"]').at(1).text()).toEqual( - 'not_endpoint_list' - ); - expect(wrapper.find('[data-test-subj="exceptionsTableDeleteButton"] button')).toHaveLength(1); - expect( - wrapper.find('[data-test-subj="exceptionsTableDeleteButton"] button').at(0).prop('disabled') - ).toBeFalsy(); - }); - - it('does not render delete option if user is read only', async () => { - (useUserData as jest.Mock).mockReturnValue([ - { - loading: false, - canUserCRUD: false, - canUserREAD: true, - }, - ]); - - const wrapper = mount( - <TestProviders> - <ExceptionListsTable /> - </TestProviders> - ); - - expect(wrapper.find('[data-test-subj="exceptionsTableListId"]').at(1).text()).toEqual( - 'not_endpoint_list' - ); - expect(wrapper.find('[data-test-subj="exceptionsTableDeleteButton"] button')).toHaveLength(0); - }); -}); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table.tsx deleted file mode 100644 index b2d3d078abb54..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table.tsx +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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, useEffect, useCallback, useState } from 'react'; -import type { CriteriaWithPagination, EuiSearchBarProps } from '@elastic/eui'; -import { - EuiBasicTable, - EuiEmptyPrompt, - EuiLoadingContent, - EuiProgress, - EuiSpacer, - EuiPageHeader, - EuiHorizontalRule, -} from '@elastic/eui'; - -import type { NamespaceType, ExceptionListFilter } from '@kbn/securitysolution-io-ts-list-types'; -import { useApi, useExceptionLists } from '@kbn/securitysolution-list-hooks'; - -import { AutoDownload } from '../../../../common/components/auto_download/auto_download'; -import { useFormatUrl } from '../../../../common/components/link_to'; -import { Loader } from '../../../../common/components/loader'; -import { useKibana } from '../../../../common/lib/kibana'; -import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; -import { hasUserCRUDPermission } from '../../../../common/utils/privileges'; - -import * as i18n from './translations'; -import { ExceptionsTableUtilityBar } from './exceptions_table_utility_bar'; -import type { AllExceptionListsColumns } from './columns'; -import { getAllExceptionListsColumns } from './columns'; -import { useAllExceptionLists } from './use_all_exception_lists'; -import { ReferenceErrorModal } from '../../../../detections/components/value_lists_management_flyout/reference_error_modal'; -import { patchRule } from '../../../rule_management/api/api'; -import { ExceptionsSearchBar } from './exceptions_search_bar'; -import { getSearchFilters } from '../../../rule_management_ui/components/rules_table/helpers'; -import { SecurityPageName } from '../../../../../common/constants'; -import { useUserData } from '../../../../detections/components/user_info'; -import { useListsConfig } from '../../../../detections/containers/detection_engine/lists/use_lists_config'; -import type { ExceptionsTableItem } from './types'; -import { MissingPrivilegesCallOut } from '../../../../detections/components/callouts/missing_privileges_callout'; -import { ALL_ENDPOINT_ARTIFACT_LIST_IDS } from '../../../../../common/endpoint/service/artifacts/constants'; - -export type Func = () => Promise<void>; - -interface ReferenceModalState { - contentText: string; - rulesReferences: string[]; - isLoading: boolean; - listId: string; - listNamespaceType: NamespaceType; -} - -const exceptionReferenceModalInitialState: ReferenceModalState = { - contentText: '', - rulesReferences: [], - isLoading: false, - listId: '', - listNamespaceType: 'single', -}; - -export const ExceptionListsTable = React.memo(() => { - const { formatUrl } = useFormatUrl(SecurityPageName.rules); - const [{ loading: userInfoLoading, canUserCRUD, canUserREAD }] = useUserData(); - const hasPermissions = hasUserCRUDPermission(canUserCRUD); - - const { loading: listsConfigLoading } = useListsConfig(); - const loading = userInfoLoading || listsConfigLoading; - - const { - services: { http, notifications, timelines, application }, - } = useKibana(); - const { exportExceptionList, deleteExceptionList } = useApi(http); - - const [showReferenceErrorModal, setShowReferenceErrorModal] = useState(false); - const [referenceModalState, setReferenceModalState] = useState<ReferenceModalState>( - exceptionReferenceModalInitialState - ); - const [filters, setFilters] = useState<ExceptionListFilter | undefined>(undefined); - const [loadingExceptions, exceptions, pagination, setPagination, refreshExceptions] = - useExceptionLists({ - errorMessage: i18n.ERROR_EXCEPTION_LISTS, - filterOptions: filters, - http, - namespaceTypes: ['single', 'agnostic'], - notifications, - hideLists: ALL_ENDPOINT_ARTIFACT_LIST_IDS, - }); - const [loadingTableInfo, exceptionListsWithRuleRefs, exceptionsListsRef] = useAllExceptionLists({ - exceptionLists: exceptions ?? [], - }); - const [initLoading, setInitLoading] = useState(true); - const [lastUpdated, setLastUpdated] = useState(Date.now()); - const [deletingListIds, setDeletingListIds] = useState<string[]>([]); - const [exportingListIds, setExportingListIds] = useState<string[]>([]); - const [exportDownload, setExportDownload] = useState<{ name?: string; blob?: Blob }>({}); - const { navigateToUrl } = application; - const { addError, addSuccess } = useAppToasts(); - - const handleDeleteSuccess = useCallback( - (listId?: string) => () => { - notifications.toasts.addSuccess({ - title: i18n.exceptionDeleteSuccessMessage(listId ?? referenceModalState.listId), - }); - }, - [notifications.toasts, referenceModalState.listId] - ); - - const handleDeleteError = useCallback( - (err: Error & { body?: { message: string } }): void => { - addError(err, { - title: i18n.EXCEPTION_DELETE_ERROR, - }); - }, - [addError] - ); - - const handleDelete = useCallback( - ({ id, listId, namespaceType }: { id: string; listId: string; namespaceType: NamespaceType }) => - async () => { - try { - setDeletingListIds((ids) => [...ids, id]); - if (refreshExceptions != null) { - refreshExceptions(); - } - - if (exceptionsListsRef[id] != null && exceptionsListsRef[id].rules.length === 0) { - await deleteExceptionList({ - id, - namespaceType, - onError: handleDeleteError, - onSuccess: handleDeleteSuccess(listId), - }); - - if (refreshExceptions != null) { - refreshExceptions(); - } - } else { - setReferenceModalState({ - contentText: i18n.referenceErrorMessage(exceptionsListsRef[id].rules.length), - rulesReferences: exceptionsListsRef[id].rules.map(({ name }) => name), - isLoading: true, - listId: id, - listNamespaceType: namespaceType, - }); - setShowReferenceErrorModal(true); - } - // route to patch rules with associated exception list - } catch (error) { - handleDeleteError(error); - } finally { - setDeletingListIds((ids) => ids.filter((_id) => _id !== id)); - } - }, - [ - deleteExceptionList, - exceptionsListsRef, - handleDeleteError, - handleDeleteSuccess, - refreshExceptions, - ] - ); - - const handleExportSuccess = useCallback( - (listId: string) => - (blob: Blob): void => { - addSuccess(i18n.EXCEPTION_EXPORT_SUCCESS); - setExportDownload({ name: listId, blob }); - }, - [addSuccess] - ); - - const handleExportError = useCallback( - (err: Error) => { - addError(err, { title: i18n.EXCEPTION_EXPORT_ERROR }); - }, - [addError] - ); - - const handleExport = useCallback( - ({ id, listId, namespaceType }: { id: string; listId: string; namespaceType: NamespaceType }) => - async () => { - setExportingListIds((ids) => [...ids, id]); - await exportExceptionList({ - id, - listId, - namespaceType, - onError: handleExportError, - onSuccess: handleExportSuccess(listId), - }); - }, - [exportExceptionList, handleExportError, handleExportSuccess] - ); - - const exceptionsColumns = useMemo((): AllExceptionListsColumns[] => { - // Defaulting to true to default to the lower privilege first - const isKibanaReadOnly = (canUserREAD && !canUserCRUD) ?? true; - return getAllExceptionListsColumns( - handleExport, - handleDelete, - formatUrl, - navigateToUrl, - isKibanaReadOnly - ); - }, [handleExport, handleDelete, formatUrl, navigateToUrl, canUserREAD, canUserCRUD]); - - const handleRefresh = useCallback((): void => { - if (refreshExceptions != null) { - setLastUpdated(Date.now()); - refreshExceptions(); - } - }, [refreshExceptions]); - - useEffect(() => { - if (initLoading && !loading && !loadingExceptions && !loadingTableInfo) { - setInitLoading(false); - } - }, [initLoading, loading, loadingExceptions, loadingTableInfo]); - - const emptyPrompt = useMemo((): JSX.Element => { - return ( - <EuiEmptyPrompt - title={<h3>{i18n.NO_EXCEPTION_LISTS}</h3>} - titleSize="xs" - body={i18n.NO_LISTS_BODY} - /> - ); - }, []); - - const handleSearch = useCallback( - async ({ - query, - queryText, - }: Parameters<NonNullable<EuiSearchBarProps['onChange']>>[0]): Promise<void> => { - const filterOptions = { - name: null, - list_id: null, - created_by: null, - type: null, - tags: null, - }; - const searchTerms = getSearchFilters({ - defaultSearchTerm: 'name', - filterOptions, - query, - searchValue: queryText, - }); - setFilters(searchTerms); - }, - [] - ); - - const handleCloseReferenceErrorModal = useCallback((): void => { - setDeletingListIds([]); - setShowReferenceErrorModal(false); - setReferenceModalState({ - contentText: '', - rulesReferences: [], - isLoading: false, - listId: '', - listNamespaceType: 'single', - }); - }, []); - - const handleReferenceDelete = useCallback(async (): Promise<void> => { - const exceptionListId = referenceModalState.listId; - const exceptionListNamespaceType = referenceModalState.listNamespaceType; - const relevantRules = exceptionsListsRef[exceptionListId].rules; - - try { - await Promise.all( - relevantRules.map((rule) => { - const abortCtrl = new AbortController(); - const exceptionLists = (rule.exceptions_list ?? []).filter( - ({ id }) => id !== exceptionListId - ); - - return patchRule({ - ruleProperties: { - rule_id: rule.rule_id, - exceptions_list: exceptionLists, - }, - signal: abortCtrl.signal, - }); - }) - ); - - await deleteExceptionList({ - id: exceptionListId, - namespaceType: exceptionListNamespaceType, - onError: handleDeleteError, - onSuccess: handleDeleteSuccess(), - }); - } catch (err) { - handleDeleteError(err); - } finally { - setReferenceModalState(exceptionReferenceModalInitialState); - setDeletingListIds([]); - setShowReferenceErrorModal(false); - if (refreshExceptions != null) { - refreshExceptions(); - } - } - }, [ - referenceModalState.listId, - referenceModalState.listNamespaceType, - exceptionsListsRef, - deleteExceptionList, - handleDeleteError, - handleDeleteSuccess, - refreshExceptions, - ]); - - const paginationMemo = useMemo( - () => ({ - pageIndex: pagination.page - 1, - pageSize: pagination.perPage, - totalItemCount: pagination.total || 0, - pageSizeOptions: [5, 10, 20, 50, 100, 200, 300], - }), - [pagination] - ); - - const handleOnDownload = useCallback(() => { - setExportDownload({}); - }, []); - - const tableItems = useMemo<ExceptionsTableItem[]>( - () => - (exceptionListsWithRuleRefs ?? []).map((item) => ({ - ...item, - isDeleting: deletingListIds.includes(item.id), - isExporting: exportingListIds.includes(item.id), - })), - [deletingListIds, exceptionListsWithRuleRefs, exportingListIds] - ); - - const handlePaginationChange = useCallback( - (criteria: CriteriaWithPagination<ExceptionsTableItem>) => { - const { index, size } = criteria.page; - setPagination((currentPagination) => ({ - ...currentPagination, - perPage: size, - page: index + 1, - })); - }, - [setPagination] - ); - - return ( - <> - <MissingPrivilegesCallOut /> - <EuiPageHeader - pageTitle={i18n.ALL_EXCEPTIONS} - description={ - <p>{timelines.getLastUpdated({ showUpdating: loading, updatedAt: lastUpdated })}</p> - } - /> - <EuiHorizontalRule /> - <div data-test-subj="allExceptionListsPanel"> - {loadingTableInfo && ( - <EuiProgress - data-test-subj="loadingRulesInfoProgress" - size="xs" - position="absolute" - color="accent" - /> - )} - {!initLoading && <ExceptionsSearchBar onSearch={handleSearch} />} - <EuiSpacer size="m" /> - - {loadingTableInfo && !initLoading && !showReferenceErrorModal && ( - <Loader data-test-subj="loadingPanelAllRulesTable" overlay size="xl" /> - )} - - {initLoading ? ( - <EuiLoadingContent data-test-subj="initialLoadingPanelAllRulesTable" lines={10} /> - ) : ( - <> - <ExceptionsTableUtilityBar - totalExceptionLists={exceptionListsWithRuleRefs.length} - onRefresh={handleRefresh} - /> - <EuiBasicTable<ExceptionsTableItem> - data-test-subj="exceptions-table" - columns={exceptionsColumns} - isSelectable={hasPermissions} - itemId="id" - items={tableItems} - noItemsMessage={emptyPrompt} - onChange={handlePaginationChange} - pagination={paginationMemo} - /> - </> - )} - - <AutoDownload - blob={exportDownload.blob} - name={`${exportDownload.name}.ndjson`} - onDownload={handleOnDownload} - /> - <ReferenceErrorModal - cancelText={i18n.REFERENCE_MODAL_CANCEL_BUTTON} - confirmText={i18n.REFERENCE_MODAL_CONFIRM_BUTTON} - contentText={referenceModalState.contentText} - onCancel={handleCloseReferenceErrorModal} - onClose={handleCloseReferenceErrorModal} - onConfirm={handleReferenceDelete} - references={referenceModalState.rulesReferences} - showModal={showReferenceErrorModal} - titleText={i18n.REFERENCE_MODAL_TITLE} - /> - </div> - </> - ); -}); - -ExceptionListsTable.displayName = 'ExceptionListsTable'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/translations.ts deleted file mode 100644 index 3d817adb2605c..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/translations.ts +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 EXCEPTION_LIST_ID_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.idTitle', - { - defaultMessage: 'List ID', - } -); - -export const EXCEPTION_LIST_NAME = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.listName', - { - defaultMessage: 'Name', - } -); - -export const EXCEPTION_LIST_ACTIONS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.actionsTitle', - { - defaultMessage: 'Actions', - } -); - -export const SHOWING_EXCEPTION_LISTS = (totalLists: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.showingExceptionLists', - { - values: { totalLists }, - defaultMessage: 'Showing {totalLists} {totalLists, plural, =1 {list} other {lists}}', - } - ); - -export const RULES_ASSIGNED_TO_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.rulesAssignedTitle', - { - defaultMessage: 'Rules assigned to', - } -); - -export const showMoreRules = (rulesCount: number) => - i18n.translate('xpack.securitySolution.detectionEngine.rules.all.exceptions.rulesPopoverButton', { - defaultMessage: '+{rulesCount} {rulesCount, plural, =1 {Rule} other {Rules}}', - values: { rulesCount }, - }); - -export const LIST_DATE_CREATED_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.dateCreatedTitle', - { - defaultMessage: 'Date created', - } -); - -export const LIST_DATE_UPDATED_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.dateUpdatedTitle', - { - defaultMessage: 'Last edited', - } -); - -export const ERROR_EXCEPTION_LISTS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.errorFetching', - { - defaultMessage: 'Error fetching exception lists', - } -); - -export const NO_EXCEPTION_LISTS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allExceptionLists.filters.noExceptionsTitle', - { - defaultMessage: 'No exception lists found', - } -); - -export const EXCEPTIONS_LISTS_SEARCH_PLACEHOLDER = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allExceptionLists.search.placeholder', - { - defaultMessage: 'Search exception lists', - } -); - -export const ALL_EXCEPTIONS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allExceptions.tableTitle', - { - defaultMessage: 'Exception lists', - } -); - -export const NO_LISTS_BODY = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allExceptions.filters.noListsBody', - { - defaultMessage: "We weren't able to find any exception lists.", - } -); - -export const EXCEPTION_EXPORT_SUCCESS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.exportSuccess', - { - defaultMessage: 'Exception list export success', - } -); - -export const EXCEPTION_EXPORT_ERROR = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.exportError', - { - defaultMessage: 'Exception list export error', - } -); - -export const EXCEPTION_DELETE_ERROR = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.deleteError', - { - defaultMessage: 'Error occurred deleting exception list', - } -); - -export const exceptionDeleteSuccessMessage = (listId: string) => - i18n.translate('xpack.securitySolution.exceptions.referenceModalSuccessDescription', { - defaultMessage: 'Exception list - {listId} - deleted successfully.', - values: { listId }, - }); - -export const REFERENCE_MODAL_TITLE = i18n.translate( - 'xpack.securitySolution.exceptions.referenceModalTitle', - { - defaultMessage: 'Remove exception list', - } -); - -export const REFERENCE_MODAL_CANCEL_BUTTON = i18n.translate( - 'xpack.securitySolution.exceptions.referenceModalCancelButton', - { - defaultMessage: 'Cancel', - } -); - -export const REFERENCE_MODAL_CONFIRM_BUTTON = i18n.translate( - 'xpack.securitySolution.exceptions.referenceModalDeleteButton', - { - defaultMessage: 'Remove exception list', - } -); - -export const referenceErrorMessage = (referenceCount: number) => - i18n.translate('xpack.securitySolution.exceptions.referenceModalDescription', { - defaultMessage: - 'This exception list is associated with ({referenceCount}) {referenceCount, plural, =1 {rule} other {rules}}. Removing this exception list will also remove its reference from the associated rules.', - values: { referenceCount }, - }); - -export const EXCEPTION_LIST_SEARCH_PLACEHOLDER = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.searchPlaceholder', - { - defaultMessage: 'Search by name or list id', - } -); - -export const REFRESH_EXCEPTIONS_TABLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.all.exceptions.refresh', - { - defaultMessage: 'Refresh', - } -); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/types.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/types.ts deleted file mode 100644 index 316ad93ad8183..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/types.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { ExceptionListInfo } from './use_all_exception_lists'; - -export interface ExceptionsTableItem extends ExceptionListInfo { - isDeleting: boolean; - isExporting: boolean; -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts index ca84045e06c65..265cf9d42e9d2 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts @@ -15,7 +15,10 @@ import { getUpdateRulesSchemaMock, getRulesSchemaMock, } from '../../../../common/detection_engine/rule_schema/mocks'; - +import { + BulkActionType, + BulkActionEditType, +} from '../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import { rulesMock } from '../logic/mock'; import type { FindRulesReferencedByExceptionsListProp } from '../logic/types'; @@ -32,6 +35,7 @@ import { getPrePackagedRulesStatus, previewRule, findRuleExceptionReferences, + performBulkAction, } from './api'; const abortCtrl = new AbortController(); @@ -701,4 +705,96 @@ describe('Detections Rules API', () => { }); }); }); + + describe('performBulkAction', () => { + const fetchMockResult = {}; + + beforeEach(() => { + fetchMock.mockClear(); + fetchMock.mockResolvedValue(fetchMockResult); + }); + + test('passes a query', async () => { + await performBulkAction({ bulkAction: { type: BulkActionType.enable, query: 'some query' } }); + + expect(fetchMock).toHaveBeenCalledWith('/api/detection_engine/rules/_bulk_action', { + method: 'POST', + body: JSON.stringify({ + action: 'enable', + query: 'some query', + }), + query: { + dry_run: false, + }, + }); + }); + + test('passes ids', async () => { + await performBulkAction({ + bulkAction: { type: BulkActionType.disable, ids: ['ruleId1', 'ruleId2'] }, + }); + + expect(fetchMock).toHaveBeenCalledWith('/api/detection_engine/rules/_bulk_action', { + method: 'POST', + body: JSON.stringify({ + action: 'disable', + ids: ['ruleId1', 'ruleId2'], + }), + query: { + dry_run: false, + }, + }); + }); + + test('passes edit payload', async () => { + await performBulkAction({ + bulkAction: { + type: BulkActionType.edit, + ids: ['ruleId1'], + editPayload: [ + { type: BulkActionEditType.add_index_patterns, value: ['some-index-pattern'] }, + ], + }, + }); + + expect(fetchMock).toHaveBeenCalledWith('/api/detection_engine/rules/_bulk_action', { + method: 'POST', + body: JSON.stringify({ + action: 'edit', + ids: ['ruleId1'], + edit: [{ type: 'add_index_patterns', value: ['some-index-pattern'] }], + }), + query: { + dry_run: false, + }, + }); + }); + + test('executes dry run', async () => { + await performBulkAction({ + bulkAction: { type: BulkActionType.disable, query: 'some query' }, + dryRun: true, + }); + + expect(fetchMock).toHaveBeenCalledWith('/api/detection_engine/rules/_bulk_action', { + method: 'POST', + body: JSON.stringify({ + action: 'disable', + query: 'some query', + }), + query: { dry_run: true }, + }); + }); + + test('returns result', async () => { + const result = await performBulkAction({ + bulkAction: { + type: BulkActionType.disable, + query: 'some query', + }, + }); + + expect(result).toBe(fetchMockResult); + }); + }); }); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.ts index 3fd5fd65bb639..40a00178c31b8 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.ts @@ -29,7 +29,7 @@ import type { RulesReferencedByExceptionListsSchema } from '../../../../common/d import { DETECTION_ENGINE_RULES_EXCEPTIONS_REFERENCE_URL } from '../../../../common/detection_engine/rule_exceptions'; import type { BulkActionEditPayload } from '../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; -import { BulkAction } from '../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { BulkActionType } from '../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import type { RuleResponse, @@ -213,48 +213,45 @@ export interface BulkActionResponse { }; } -export interface BulkActionProps { - action: Exclude<BulkAction, BulkAction.export>; - query?: string; - ids?: string[]; - edit?: BulkActionEditPayload[]; - isDryRun?: boolean; +export type QueryOrIds = { query: string; ids?: undefined } | { query?: undefined; ids: string[] }; +type PlainBulkAction = { + type: Exclude<BulkActionType, BulkActionType.edit | BulkActionType.export>; +} & QueryOrIds; +type EditBulkAction = { + type: BulkActionType.edit; + editPayload: BulkActionEditPayload[]; +} & QueryOrIds; +export type BulkAction = PlainBulkAction | EditBulkAction; + +export interface PerformBulkActionProps { + bulkAction: BulkAction; + dryRun?: boolean; } /** * Perform bulk action with rules selected by a filter query * - * @param query filter query to select rules to perform bulk action with - * @param ids string[] rule ids to select rules to perform bulk action with - * @param edit BulkEditActionPayload edit action payload - * @param action bulk action to perform - * @param isDryRun enables dry run mode for bulk actions + * @param bulkAction bulk action which contains type, query or ids and edit fields + * @param dryRun enables dry run mode for bulk actions * * @throws An error if response is not OK */ -export const performBulkAction = async ({ - action, - query, - edit, - ids, - isDryRun, -}: BulkActionProps): Promise<BulkActionResponse> => - KibanaServices.get().http.fetch<BulkActionResponse>(DETECTION_ENGINE_RULES_BULK_ACTION, { +export async function performBulkAction({ + bulkAction, + dryRun = false, +}: PerformBulkActionProps): Promise<BulkActionResponse> { + const params = { + action: bulkAction.type, + query: bulkAction.query, + ids: bulkAction.ids, + edit: bulkAction.type === BulkActionType.edit ? bulkAction.editPayload : undefined, + }; + + return KibanaServices.get().http.fetch<BulkActionResponse>(DETECTION_ENGINE_RULES_BULK_ACTION, { method: 'POST', - body: JSON.stringify({ - action, - ...(edit ? { edit } : {}), - ...(ids ? { ids } : {}), - ...(query !== undefined ? { query } : {}), - }), - query: { - ...(isDryRun ? { dry_run: isDryRun } : {}), - }, + body: JSON.stringify(params), + query: { dry_run: dryRun }, }); - -export interface BulkExportProps { - query?: string; - ids?: string[]; } export type BulkExportResponse = Blob; @@ -262,23 +259,22 @@ export type BulkExportResponse = Blob; /** * Bulk export rules selected by a filter query * - * @param query filter query to select rules to perform bulk action with - * @param ids string[] rule ids to select rules to perform bulk action with + * @param queryOrIds filter query to select rules to perform bulk action with or rule ids to select rules to perform bulk action with * * @throws An error if response is not OK */ -export const bulkExportRules = async ({ - query, - ids, -}: BulkExportProps): Promise<BulkExportResponse> => - KibanaServices.get().http.fetch<BulkExportResponse>(DETECTION_ENGINE_RULES_BULK_ACTION, { +export async function bulkExportRules(queryOrIds: QueryOrIds): Promise<BulkExportResponse> { + const params = { + action: BulkActionType.export, + query: queryOrIds.query, + ids: queryOrIds.ids, + }; + + return KibanaServices.get().http.fetch<BulkExportResponse>(DETECTION_ENGINE_RULES_BULK_ACTION, { method: 'POST', - body: JSON.stringify({ - action: BulkAction.export, - ...(ids ? { ids } : {}), - ...(query !== undefined ? { query } : {}), - }), + body: JSON.stringify(params), }); +} export interface CreatePrepackagedRulesResponse { rules_installed: number; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts index e52a5cd8e0618..866ce74e3c323 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts @@ -6,16 +6,19 @@ */ import type { UseMutationOptions } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query'; -import { BulkAction } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; -import type { BulkActionProps, BulkActionResponse } from '../api'; +import { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import type { BulkActionResponse, PerformBulkActionProps } from '../api'; import { performBulkAction } from '../api'; import { useInvalidateFetchPrebuiltRulesStatusQuery } from './use_fetch_prebuilt_rules_status_query'; import { useInvalidateFindRulesQuery, useUpdateRulesCache } from './use_find_rules_query'; import { useInvalidateFetchTagsQuery } from './use_fetch_tags_query'; import { useInvalidateFetchRuleByIdQuery } from './use_fetch_rule_by_id_query'; +import { DETECTION_ENGINE_RULES_BULK_ACTION } from '../../../../../common/constants'; + +export const BULK_ACTION_MUTATION_KEY = ['POST', DETECTION_ENGINE_RULES_BULK_ACTION]; export const useBulkActionMutation = ( - options?: UseMutationOptions<BulkActionResponse, Error, BulkActionProps> + options?: UseMutationOptions<BulkActionResponse, Error, PerformBulkActionProps> ) => { const invalidateFindRulesQuery = useInvalidateFindRulesQuery(); const invalidateFetchRuleByIdQuery = useInvalidateFetchRuleByIdQuery(); @@ -23,31 +26,37 @@ export const useBulkActionMutation = ( const invalidateFetchPrebuiltRulesStatusQuery = useInvalidateFetchPrebuiltRulesStatusQuery(); const updateRulesCache = useUpdateRulesCache(); - return useMutation<BulkActionResponse, Error, BulkActionProps>( - (action: BulkActionProps) => performBulkAction(action), + return useMutation<BulkActionResponse, Error, PerformBulkActionProps>( + (bulkActionProps: PerformBulkActionProps) => performBulkAction(bulkActionProps), { ...options, + mutationKey: BULK_ACTION_MUTATION_KEY, onSuccess: (...args) => { - const [res, { action }] = args; - switch (action) { - case BulkAction.enable: - case BulkAction.disable: { + const [ + res, + { + bulkAction: { type: actionType }, + }, + ] = args; + switch (actionType) { + case BulkActionType.enable: + case BulkActionType.disable: { invalidateFetchRuleByIdQuery(); // This action doesn't affect rule content, no need for invalidation updateRulesCache(res?.attributes?.results?.updated ?? []); break; } - case BulkAction.delete: + case BulkActionType.delete: invalidateFindRulesQuery(); invalidateFetchRuleByIdQuery(); invalidateFetchTagsQuery(); invalidateFetchPrebuiltRulesStatusQuery(); break; - case BulkAction.duplicate: + case BulkActionType.duplicate: invalidateFindRulesQuery(); invalidateFetchPrebuiltRulesStatusQuery(); break; - case BulkAction.edit: + case BulkActionType.edit: updateRulesCache(res?.attributes?.results?.updated ?? []); invalidateFetchRuleByIdQuery(); invalidateFetchTagsQuery(); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts index bcc5fbcdbb18e..dbd3a0b9fac3c 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts @@ -6,14 +6,20 @@ */ import type { UseMutationOptions } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query'; -import type { BulkExportProps, BulkExportResponse } from '../api'; +import { DETECTION_ENGINE_RULES_BULK_ACTION } from '../../../../../common/constants'; +import type { BulkExportResponse, QueryOrIds } from '../api'; import { bulkExportRules } from '../api'; +export const BULK_ACTION_MUTATION_KEY = ['POST', DETECTION_ENGINE_RULES_BULK_ACTION]; + export const useBulkExportMutation = ( - options?: UseMutationOptions<BulkExportResponse, Error, BulkExportProps> + options?: UseMutationOptions<BulkExportResponse, Error, QueryOrIds> ) => { - return useMutation<BulkExportResponse, Error, BulkExportProps>( - (action: BulkExportProps) => bulkExportRules(action), - options + return useMutation<BulkExportResponse, Error, QueryOrIds>( + (action: QueryOrIds) => bulkExportRules(action), + { + ...options, + mutationKey: BULK_ACTION_MUTATION_KEY, + } ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_prebuilt_rules_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_prebuilt_rules_mutation.ts index 2559be0609d08..86c6efbd50f85 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_prebuilt_rules_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_prebuilt_rules_mutation.ts @@ -11,6 +11,9 @@ import { createPrepackagedRules } from '../api'; import { useInvalidateFetchPrebuiltRulesStatusQuery } from './use_fetch_prebuilt_rules_status_query'; import { useInvalidateFindRulesQuery } from './use_find_rules_query'; import { useInvalidateFetchTagsQuery } from './use_fetch_tags_query'; +import { PREBUILT_RULES_URL } from '../../../../../common/detection_engine/prebuilt_rules/api/urls'; + +export const CREATE_PREBUILT_RULES_MUTATION_KEY = ['PUT', PREBUILT_RULES_URL]; export const useCreatePrebuiltRulesMutation = ( options?: UseMutationOptions<CreatePrepackagedRulesResponse> @@ -21,6 +24,7 @@ export const useCreatePrebuiltRulesMutation = ( return useMutation(() => createPrepackagedRules(), { ...options, + mutationKey: CREATE_PREBUILT_RULES_MUTATION_KEY, onSuccess: (...args) => { // Always invalidate all rules and the prepackaged rules status cache as // the number of rules might change after the installation diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts index 8d62927a6261f..56a3d67492713 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts @@ -6,6 +6,7 @@ */ import type { UseMutationOptions } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import type { RuleCreateProps, RuleResponse, @@ -16,6 +17,8 @@ import { useInvalidateFetchPrebuiltRulesStatusQuery } from './use_fetch_prebuilt import { useInvalidateFetchTagsQuery } from './use_fetch_tags_query'; import { useInvalidateFindRulesQuery } from './use_find_rules_query'; +export const CREATE_RULE_MUTATION_KEY = ['POST', DETECTION_ENGINE_RULES_URL]; + export const useCreateRuleMutation = ( options?: UseMutationOptions<RuleResponse, Error, RuleCreateProps> ) => { @@ -27,6 +30,7 @@ export const useCreateRuleMutation = ( (rule: RuleCreateProps) => createRule({ rule: transformOutput(rule) }), { ...options, + mutationKey: CREATE_RULE_MUTATION_KEY, onSuccess: (...args) => { invalidateFetchPrePackagedRulesStatusQuery(); invalidateFindRulesQuery(); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_prebuilt_rules_status_query.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_prebuilt_rules_status_query.ts index a0344386ffe04..5fd22fae143cb 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_prebuilt_rules_status_query.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_prebuilt_rules_status_query.ts @@ -10,14 +10,15 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'; import { getPrePackagedRulesStatus } from '../api'; import { DEFAULT_QUERY_OPTIONS } from './constants'; import type { PrePackagedRulesStatusResponse } from '../../logic'; +import { PREBUILT_RULES_STATUS_URL } from '../../../../../common/detection_engine/prebuilt_rules/api/urls'; -export const PREBUILT_RULES_STATUS_QUERY_KEY = 'prePackagedRulesStatus'; +export const PREBUILT_RULES_STATUS_QUERY_KEY = ['GET', PREBUILT_RULES_STATUS_URL]; export const useFetchPrebuiltRulesStatusQuery = ( - options: UseQueryOptions<PrePackagedRulesStatusResponse> + options?: UseQueryOptions<PrePackagedRulesStatusResponse> ) => { return useQuery<PrePackagedRulesStatusResponse>( - [PREBUILT_RULES_STATUS_QUERY_KEY], + PREBUILT_RULES_STATUS_QUERY_KEY, async ({ signal }) => { const response = await getPrePackagedRulesStatus({ signal }); return response; @@ -40,7 +41,7 @@ export const useInvalidateFetchPrebuiltRulesStatusQuery = () => { const queryClient = useQueryClient(); return useCallback(() => { - queryClient.invalidateQueries([PREBUILT_RULES_STATUS_QUERY_KEY], { + queryClient.invalidateQueries(PREBUILT_RULES_STATUS_QUERY_KEY, { refetchType: 'active', }); }, [queryClient]); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts index 03fe7c6e2df17..66539807787ff 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts @@ -8,12 +8,13 @@ import type { UseQueryOptions } from '@tanstack/react-query'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { transformInput } from '../../../../detections/containers/detection_engine/rules/transforms'; import type { Rule } from '../../logic'; import { fetchRuleById } from '../api'; import { DEFAULT_QUERY_OPTIONS } from './constants'; -const FIND_ONE_RULE_QUERY_KEY = 'findOneRule'; +const FIND_ONE_RULE_QUERY_KEY = ['GET', DETECTION_ENGINE_RULES_URL]; /** * A wrapper around useQuery provides default values to the underlying query, @@ -23,9 +24,9 @@ const FIND_ONE_RULE_QUERY_KEY = 'findOneRule'; * @param options - react-query options * @returns useQuery result */ -export const useFetchRuleByIdQuery = (id: string, options: UseQueryOptions<Rule>) => { +export const useFetchRuleByIdQuery = (id: string, options?: UseQueryOptions<Rule>) => { return useQuery<Rule>( - [FIND_ONE_RULE_QUERY_KEY, id], + [...FIND_ONE_RULE_QUERY_KEY, id], async ({ signal }) => { const response = await fetchRuleById({ signal, id }); @@ -49,7 +50,7 @@ export const useInvalidateFetchRuleByIdQuery = () => { const queryClient = useQueryClient(); return useCallback(() => { - queryClient.invalidateQueries([FIND_ONE_RULE_QUERY_KEY], { + queryClient.invalidateQueries(FIND_ONE_RULE_QUERY_KEY, { refetchType: 'active', }); }, [queryClient]); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_tags_query.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_tags_query.ts index 1be43f992f07f..c09ae5d6cb56d 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_tags_query.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_tags_query.ts @@ -8,12 +8,12 @@ import type { UseQueryOptions } from '@tanstack/react-query'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; +import { DETECTION_ENGINE_TAGS_URL } from '../../../../../common/constants'; import type { FetchTagsResponse } from '../api'; import { fetchTags } from '../api'; import { DEFAULT_QUERY_OPTIONS } from './constants'; -// TODO: https://github.com/elastic/kibana/pull/142950 Let's use more detailed cache keys, e.g. ['GET', DETECTION_ENGINE_TAGS_URL] -const TAGS_QUERY_KEY = 'tags'; +const TAGS_QUERY_KEY = ['GET', DETECTION_ENGINE_TAGS_URL]; /** * Hook for using the list of Tags from the Detection Engine API @@ -21,7 +21,7 @@ const TAGS_QUERY_KEY = 'tags'; */ export const useFetchTagsQuery = (options?: UseQueryOptions<FetchTagsResponse>) => { return useQuery<FetchTagsResponse>( - [TAGS_QUERY_KEY], + TAGS_QUERY_KEY, async ({ signal }) => { return fetchTags({ signal }); }, @@ -36,7 +36,7 @@ export const useInvalidateFetchTagsQuery = () => { const queryClient = useQueryClient(); return useCallback(() => { - queryClient.invalidateQueries([TAGS_QUERY_KEY], { + queryClient.invalidateQueries(TAGS_QUERY_KEY, { refetchType: 'active', }); }, [queryClient]); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts index ad50ab471a7fd..35b6430a51172 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts @@ -8,6 +8,7 @@ import type { UseQueryOptions } from '@tanstack/react-query'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; +import { DETECTION_ENGINE_RULES_URL_FIND } from '../../../../../common/constants'; import type { FilterOptions, PaginationOptions, Rule, SortingOptions } from '../../logic'; import { fetchRules } from '../api'; import { DEFAULT_QUERY_OPTIONS } from './constants'; @@ -18,7 +19,7 @@ export interface FindRulesQueryArgs { pagination?: Pick<PaginationOptions, 'page' | 'perPage'>; } -const FIND_RULES_QUERY_KEY = 'findRules'; +const FIND_RULES_QUERY_KEY = ['GET', DETECTION_ENGINE_RULES_URL_FIND]; export interface RulesQueryResponse { rules: Rule[]; @@ -37,7 +38,7 @@ export interface RulesQueryResponse { */ export const useFindRulesQuery = ( queryArgs: FindRulesQueryArgs, - queryOptions: UseQueryOptions< + queryOptions?: UseQueryOptions< RulesQueryResponse, Error, RulesQueryResponse, @@ -45,7 +46,7 @@ export const useFindRulesQuery = ( > ) => { return useQuery( - [FIND_RULES_QUERY_KEY, queryArgs], + [...FIND_RULES_QUERY_KEY, queryArgs], async ({ signal }) => { const response = await fetchRules({ signal, ...queryArgs }); @@ -73,7 +74,7 @@ export const useInvalidateFindRulesQuery = () => { * Invalidate all queries that start with FIND_RULES_QUERY_KEY. This * includes the in-memory query cache and paged query cache. */ - queryClient.invalidateQueries([FIND_RULES_QUERY_KEY], { + queryClient.invalidateQueries(FIND_RULES_QUERY_KEY, { refetchType: 'active', }); }, [queryClient]); @@ -98,7 +99,7 @@ export const useUpdateRulesCache = () => { return useCallback( (newRules: Rule[]) => { queryClient.setQueriesData<ReturnType<typeof useFindRulesQuery>['data']>( - [FIND_RULES_QUERY_KEY], + FIND_RULES_QUERY_KEY, (currentData) => currentData ? { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts index 6f15fb4fdd8ce..d0b60ccb9b89a 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts @@ -15,6 +15,9 @@ import { updateRule } from '../api'; import { useInvalidateFindRulesQuery } from './use_find_rules_query'; import { useInvalidateFetchTagsQuery } from './use_fetch_tags_query'; import { useInvalidateFetchRuleByIdQuery } from './use_fetch_rule_by_id_query'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; + +export const UPDATE_RULE_MUTATION_KEY = ['PUT', DETECTION_ENGINE_RULES_URL]; export const useUpdateRuleMutation = ( options?: UseMutationOptions<RuleResponse, Error, RuleUpdateProps> @@ -27,6 +30,7 @@ export const useUpdateRuleMutation = ( (rule: RuleUpdateProps) => updateRule({ rule: transformOutput(rule) }), { ...options, + mutationKey: UPDATE_RULE_MUTATION_KEY, onSuccess: (...args) => { invalidateFindRulesQuery(); invalidateFetchRuleByIdQuery(); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/translations.ts index 314811d0b142d..f637a4d8970ba 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/translations.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/translations.ts @@ -5,92 +5,128 @@ * 2.0. */ -import type { ErrorToastOptions } from '@kbn/core-notifications-browser'; -import { BulkAction } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import type { HTTPError } from '../../../../../common/detection_engine/types'; +import type { BulkActionEditPayload } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { + BulkActionEditType, + BulkActionType, +} from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import * as i18n from '../../../../detections/pages/detection_engine/rules/translations'; -import type { BulkActionSummary } from '../../api/api'; - -export function getErrorToastContent( - action: BulkAction, - summary: BulkActionSummary -): ErrorToastOptions { - let title: string; - let toastMessage: string | undefined; +import type { BulkActionResponse, BulkActionSummary } from '../../api/api'; +export function summarizeBulkSuccess(action: BulkActionType): string { switch (action) { - case BulkAction.export: - title = i18n.RULES_BULK_EXPORT_FAILURE; - if (summary) { - toastMessage = i18n.RULES_BULK_EXPORT_FAILURE_DESCRIPTION(summary.failed); - } - break; - case BulkAction.duplicate: - title = i18n.RULES_BULK_DUPLICATE_FAILURE; - if (summary) { - toastMessage = i18n.RULES_BULK_DUPLICATE_FAILURE_DESCRIPTION(summary.failed); - } - break; - case BulkAction.delete: - title = i18n.RULES_BULK_DELETE_FAILURE; - if (summary) { - toastMessage = i18n.RULES_BULK_DELETE_FAILURE_DESCRIPTION(summary.failed); - } - break; - case BulkAction.enable: - title = i18n.RULES_BULK_ENABLE_FAILURE; - if (summary) { - toastMessage = i18n.RULES_BULK_ENABLE_FAILURE_DESCRIPTION(summary.failed); - } - break; - case BulkAction.disable: - title = i18n.RULES_BULK_DISABLE_FAILURE; - if (summary) { - toastMessage = i18n.RULES_BULK_DISABLE_FAILURE_DESCRIPTION(summary.failed); - } - break; - case BulkAction.edit: - title = i18n.RULES_BULK_EDIT_FAILURE; - if (summary) { - toastMessage = i18n.RULES_BULK_EDIT_FAILURE_DESCRIPTION(summary.failed); - } - break; + case BulkActionType.export: + return i18n.RULES_BULK_EXPORT_SUCCESS; + + case BulkActionType.duplicate: + return i18n.RULES_BULK_DUPLICATE_SUCCESS; + + case BulkActionType.delete: + return i18n.RULES_BULK_DELETE_SUCCESS; + + case BulkActionType.enable: + return i18n.RULES_BULK_ENABLE_SUCCESS; + + case BulkActionType.disable: + return i18n.RULES_BULK_DISABLE_SUCCESS; + + case BulkActionType.edit: + return i18n.RULES_BULK_EDIT_SUCCESS; } +} + +export function explainBulkSuccess( + action: Exclude<BulkActionType, BulkActionType.edit>, + summary: BulkActionSummary +): string { + switch (action) { + case BulkActionType.export: + return getExportSuccessToastMessage(summary.succeeded, summary.total); + + case BulkActionType.duplicate: + return i18n.RULES_BULK_DUPLICATE_SUCCESS_DESCRIPTION(summary.succeeded); + + case BulkActionType.delete: + return i18n.RULES_BULK_DELETE_SUCCESS_DESCRIPTION(summary.succeeded); + + case BulkActionType.enable: + return i18n.RULES_BULK_ENABLE_SUCCESS_DESCRIPTION(summary.succeeded); - return { title, toastMessage }; + case BulkActionType.disable: + return i18n.RULES_BULK_DISABLE_SUCCESS_DESCRIPTION(summary.succeeded); + } } -export function getSuccessToastContent(action: BulkAction, summary: BulkActionSummary) { - let title: string; - let text: string | undefined; +export function explainBulkEditSuccess( + editPayload: BulkActionEditPayload[], + summary: BulkActionSummary +): string { + if ( + editPayload.some( + (x) => + x.type === BulkActionEditType.add_index_patterns || + x.type === BulkActionEditType.set_index_patterns || + x.type === BulkActionEditType.delete_index_patterns + ) + ) { + return `${i18n.RULES_BULK_EDIT_SUCCESS_DESCRIPTION(summary.succeeded)}. ${ + i18n.RULES_BULK_EDIT_SUCCESS_INDEX_EDIT_DESCRIPTION + }`; + } + return i18n.RULES_BULK_EDIT_SUCCESS_DESCRIPTION(summary.succeeded); +} + +export function summarizeBulkError(action: BulkActionType): string { switch (action) { - case BulkAction.export: - title = i18n.RULES_BULK_EXPORT_SUCCESS; - text = getExportSuccessToastMessage(summary.succeeded, summary.total); - break; - case BulkAction.duplicate: - title = i18n.RULES_BULK_DUPLICATE_SUCCESS; - text = i18n.RULES_BULK_DUPLICATE_SUCCESS_DESCRIPTION(summary.succeeded); - break; - case BulkAction.delete: - title = i18n.RULES_BULK_DELETE_SUCCESS; - text = i18n.RULES_BULK_DELETE_SUCCESS_DESCRIPTION(summary.succeeded); - break; - case BulkAction.enable: - title = i18n.RULES_BULK_ENABLE_SUCCESS; - text = i18n.RULES_BULK_ENABLE_SUCCESS_DESCRIPTION(summary.succeeded); - break; - case BulkAction.disable: - title = i18n.RULES_BULK_DISABLE_SUCCESS; - text = i18n.RULES_BULK_DISABLE_SUCCESS_DESCRIPTION(summary.succeeded); - break; - case BulkAction.edit: - title = i18n.RULES_BULK_EDIT_SUCCESS; - text = i18n.RULES_BULK_EDIT_SUCCESS_DESCRIPTION(summary.succeeded); - break; + case BulkActionType.export: + return i18n.RULES_BULK_EXPORT_FAILURE; + + case BulkActionType.duplicate: + return i18n.RULES_BULK_DUPLICATE_FAILURE; + + case BulkActionType.delete: + return i18n.RULES_BULK_DELETE_FAILURE; + + case BulkActionType.enable: + return i18n.RULES_BULK_ENABLE_FAILURE; + + case BulkActionType.disable: + return i18n.RULES_BULK_DISABLE_FAILURE; + + case BulkActionType.edit: + return i18n.RULES_BULK_EDIT_FAILURE; } +} - return { title, text }; +export function explainBulkError(action: BulkActionType, error: HTTPError): string { + // if response doesn't have number of failed rules, it means the whole bulk action failed + const summary = (error.body as BulkActionResponse)?.attributes?.summary; + + if (!summary) { + return ''; + } + + switch (action) { + case BulkActionType.export: + return i18n.RULES_BULK_EXPORT_FAILURE_DESCRIPTION(summary.failed); + + case BulkActionType.duplicate: + return i18n.RULES_BULK_DUPLICATE_FAILURE_DESCRIPTION(summary.failed); + + case BulkActionType.delete: + return i18n.RULES_BULK_DELETE_FAILURE_DESCRIPTION(summary.failed); + + case BulkActionType.enable: + return i18n.RULES_BULK_ENABLE_FAILURE_DESCRIPTION(summary.failed); + + case BulkActionType.disable: + return i18n.RULES_BULK_DISABLE_FAILURE_DESCRIPTION(summary.failed); + + case BulkActionType.edit: + return i18n.RULES_BULK_EDIT_FAILURE_DESCRIPTION(summary.failed); + } } const getExportSuccessToastMessage = (succeeded: number, total: number) => { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.test.ts new file mode 100644 index 0000000000000..001a2815fa02e --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.test.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 { renderHook } from '@testing-library/react-hooks'; +import { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; +import { useRulesTableContextOptional } from '../../../rule_management_ui/components/rules_table/rules_table/rules_table_context'; +import { useBulkExportMutation } from '../../api/hooks/use_bulk_export_mutation'; +import type { QueryOrIds } from '../../api/api'; +import { useBulkExport } from './use_bulk_export'; + +jest.mock('../../../../common/hooks/use_app_toasts'); +jest.mock('../../api/hooks/use_bulk_export_mutation'); +jest.mock('../../../rule_management_ui/components/rules_table/rules_table/rules_table_context'); + +async function bulkExport(queryOrIds: QueryOrIds): Promise<void> { + const { + result: { + current: { bulkExport: bulkExportFn }, + }, + } = renderHook(() => useBulkExport()); + + await bulkExportFn(queryOrIds); +} + +describe('useBulkExport', () => { + let mutateAsync: jest.Mock; + let toasts: Record<string, jest.Mock>; + + beforeEach(() => { + jest.clearAllMocks(); + + mutateAsync = jest.fn().mockResolvedValue({ + attributes: { + results: { + updated: [{ immutable: true }, { immutable: false }], + }, + summary: { + total: 2, + succeeded: 2, + }, + }, + }); + (useBulkExportMutation as jest.Mock).mockReturnValue({ mutateAsync }); + + toasts = { + addSuccess: jest.fn(), + addError: jest.fn(), + }; + (useAppToasts as jest.Mock).mockReturnValue(toasts); + }); + + it('executes bulk export action', async () => { + await bulkExport({ query: 'some query' }); + + expect(mutateAsync).toHaveBeenCalledWith({ query: 'some query' }); + }); + + describe('state handlers', () => { + it('shows error toast upon failure', async () => { + (useBulkExportMutation as jest.Mock).mockReturnValue({ + mutateAsync: jest.fn().mockRejectedValue(new Error()), + }); + + await bulkExport({ ids: ['ruleId1'] }); + + expect(toasts.addError).toHaveBeenCalled(); + }); + }); + + describe('when rules table context is available', () => { + let setLoadingRules: jest.Mock; + + beforeEach(() => { + setLoadingRules = jest.fn(); + (useRulesTableContextOptional as jest.Mock).mockReturnValue({ + actions: { + setLoadingRules, + }, + state: { + isAllSelected: false, + }, + }); + }); + + it('sets the loading state before execution', async () => { + await bulkExport({ ids: ['ruleId1', 'ruleId2'] }); + + expect(setLoadingRules).toHaveBeenCalledWith({ + ids: ['ruleId1', 'ruleId2'], + action: BulkActionType.export, + }); + }); + + it('sets the empty loading state before execution when query is set', async () => { + await bulkExport({ query: 'some query' }); + + expect(setLoadingRules).toHaveBeenCalledWith({ + ids: [], + action: BulkActionType.export, + }); + }); + + it('clears loading state for the processing rules after execution', async () => { + await bulkExport({ ids: ['ruleId1', 'ruleId2'] }); + + expect(setLoadingRules).toHaveBeenCalledWith({ ids: [], action: null }); + }); + + it('clears loading state for the processing rules after execution failure', async () => { + (useBulkExportMutation as jest.Mock).mockReturnValue({ + mutateAsync: jest.fn().mockRejectedValue(new Error()), + }); + + await bulkExport({ ids: ['ruleId1', 'ruleId2'] }); + + expect(setLoadingRules).toHaveBeenCalledWith({ ids: [], action: null }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.ts index 793580e5d3be0..38a0fbcf50234 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.ts @@ -6,74 +6,36 @@ */ import { useCallback } from 'react'; -import type { BulkActionResponse, BulkActionSummary } from '..'; -import { BulkAction } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; -import type { HTTPError } from '../../../../../common/detection_engine/types'; -import type { UseAppToasts } from '../../../../common/hooks/use_app_toasts'; -import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; -import { downloadBlob } from '../../../../common/utils/download_blob'; -import * as i18n from '../../../../detections/pages/detection_engine/rules/translations'; -import { getExportedRulesCounts } from '../../../rule_management_ui/components/rules_table/helpers'; -import type { RulesTableActions } from '../../../rule_management_ui/components/rules_table/rules_table/rules_table_context'; +import { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { useRulesTableContextOptional } from '../../../rule_management_ui/components/rules_table/rules_table/rules_table_context'; import { useBulkExportMutation } from '../../api/hooks/use_bulk_export_mutation'; -import { getErrorToastContent, getSuccessToastContent } from './translations'; +import { useShowBulkErrorToast } from './use_show_bulk_error_toast'; +import type { QueryOrIds } from '../../api/api'; +import { useGuessRuleIdsForBulkAction } from './use_guess_rule_ids_for_bulk_action'; -interface RulesBulkActionArgs { - visibleRuleIds?: string[]; - search: { query: string } | { ids: string[] }; - setLoadingRules?: RulesTableActions['setLoadingRules']; -} - -export const useBulkExport = () => { - const toasts = useAppToasts(); +export function useBulkExport() { const { mutateAsync } = useBulkExportMutation(); + const showBulkErrorToast = useShowBulkErrorToast(); + const guessRuleIdsForBulkAction = useGuessRuleIdsForBulkAction(); + const rulesTableContext = useRulesTableContextOptional(); + const setLoadingRules = rulesTableContext?.actions.setLoadingRules; const bulkExport = useCallback( - async ({ visibleRuleIds = [], setLoadingRules, search }: RulesBulkActionArgs) => { + async (queryOrIds: QueryOrIds) => { try { - setLoadingRules?.({ ids: visibleRuleIds, action: BulkAction.export }); - return await mutateAsync(search); + setLoadingRules?.({ + ids: queryOrIds.ids ?? guessRuleIdsForBulkAction(BulkActionType.export), + action: BulkActionType.export, + }); + return await mutateAsync(queryOrIds); } catch (error) { - defaultErrorHandler(toasts, error); + showBulkErrorToast({ actionType: BulkActionType.export, error }); } finally { setLoadingRules?.({ ids: [], action: null }); } }, - [mutateAsync, toasts] + [guessRuleIdsForBulkAction, setLoadingRules, mutateAsync, showBulkErrorToast] ); return { bulkExport }; -}; - -/** - * downloads exported rules, received from export action - * @param params.response - Blob results with exported rules - * @param params.toasts - {@link UseAppToasts} toasts service - * @param params.onSuccess - {@link OnActionSuccessCallback} optional toast to display when action successful - * @param params.onError - {@link OnActionErrorCallback} optional toast to display when action failed - */ -export async function downloadExportedRules({ - response, - toasts, -}: { - response: Blob; - toasts: UseAppToasts; -}) { - try { - downloadBlob(response, `${i18n.EXPORT_FILENAME}.ndjson`); - defaultSuccessHandler(toasts, await getExportedRulesCounts(response)); - } catch (error) { - defaultErrorHandler(toasts, error); - } -} - -function defaultErrorHandler(toasts: UseAppToasts, error: HTTPError): void { - const summary = (error?.body as BulkActionResponse)?.attributes?.summary; - error.stack = JSON.stringify(error.body, null, 2); - - toasts.addError(error, getErrorToastContent(BulkAction.export, summary)); -} - -function defaultSuccessHandler(toasts: UseAppToasts, summary: BulkActionSummary): void { - toasts.addSuccess(getSuccessToastContent(BulkAction.export, summary)); } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_download_exported_rules.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_download_exported_rules.ts new file mode 100644 index 0000000000000..bf607aeb0473e --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_download_exported_rules.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 { useCallback } from 'react'; +import { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { downloadBlob } from '../../../../common/utils/download_blob'; +import * as i18n from '../../../../detections/pages/detection_engine/rules/translations'; +import { getExportedRulesCounts } from '../../../rule_management_ui/components/rules_table/helpers'; +import { useShowBulkErrorToast } from './use_show_bulk_error_toast'; +import { useShowBulkSuccessToast } from './use_show_bulk_success_toast'; + +const DEFAULT_EXPORT_FILENAME = `${i18n.EXPORT_FILENAME}.ndjson`; + +/** + * downloads exported rules, received from export action + */ +export function useDownloadExportedRules() { + const showBulkSuccessToast = useShowBulkSuccessToast(); + const showBulkErrorToast = useShowBulkErrorToast(); + + return useCallback( + async (response: Blob) => { + try { + downloadBlob(response, DEFAULT_EXPORT_FILENAME); + showBulkSuccessToast({ + actionType: BulkActionType.export, + summary: await getExportedRulesCounts(response), + }); + } catch (error) { + showBulkErrorToast({ actionType: BulkActionType.export, error }); + } + }, + [showBulkSuccessToast, showBulkErrorToast] + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.test.ts new file mode 100644 index 0000000000000..aa2648bf633e1 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.test.ts @@ -0,0 +1,195 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; +import { METRIC_TYPE, TELEMETRY_EVENT, track } from '../../../../common/lib/telemetry'; +import { useBulkActionMutation } from '../../api/hooks/use_bulk_action_mutation'; +import { useRulesTableContextOptional } from '../../../rule_management_ui/components/rules_table/rules_table/rules_table_context'; +import { useExecuteBulkAction } from './use_execute_bulk_action'; +import type { BulkAction } from '../../api/api'; + +jest.mock('../../../../common/hooks/use_app_toasts'); +jest.mock('../../../../common/lib/telemetry'); +jest.mock('../../api/hooks/use_bulk_action_mutation'); +jest.mock('../../../rule_management_ui/components/rules_table/rules_table/rules_table_context'); + +async function executeBulkAction( + bulkAction: BulkAction, + options?: Parameters<typeof useExecuteBulkAction>[0] +): Promise<void> { + const { + result: { + current: { executeBulkAction: executeBulkActionFn }, + }, + } = renderHook(() => useExecuteBulkAction(options)); + + await executeBulkActionFn(bulkAction); +} + +describe('useExecuteBulkAction', () => { + let mutateAsync: jest.Mock; + let toasts: Record<string, jest.Mock>; + + beforeEach(() => { + jest.clearAllMocks(); + + mutateAsync = jest.fn().mockResolvedValue({ + attributes: { + results: { + updated: [{ immutable: true }, { immutable: false }], + }, + summary: { + total: 2, + succeeded: 2, + }, + }, + }); + (useBulkActionMutation as jest.Mock).mockReturnValue({ mutateAsync }); + + toasts = { + addSuccess: jest.fn(), + addError: jest.fn(), + }; + (useAppToasts as jest.Mock).mockReturnValue(toasts); + }); + + it('executes bulk action', async () => { + const bulkAction = { + type: BulkActionType.enable, + query: 'some query', + } as const; + + await executeBulkAction(bulkAction); + + expect(mutateAsync).toHaveBeenCalledWith({ bulkAction }); + }); + + describe('state handlers', () => { + it('shows success toast upon completion', async () => { + await executeBulkAction({ + type: BulkActionType.enable, + ids: ['ruleId1'], + }); + + expect(toasts.addSuccess).toHaveBeenCalled(); + expect(toasts.addError).not.toHaveBeenCalled(); + }); + + it('does not shows success toast upon completion if suppressed', async () => { + await executeBulkAction( + { + type: BulkActionType.enable, + ids: ['ruleId1'], + }, + { suppressSuccessToast: true } + ); + + expect(toasts.addSuccess).not.toHaveBeenCalled(); + expect(toasts.addError).not.toHaveBeenCalled(); + }); + + it('shows error toast upon failure', async () => { + (useBulkActionMutation as jest.Mock).mockReturnValue({ + mutateAsync: jest.fn().mockRejectedValue(new Error()), + }); + + await executeBulkAction({ + type: BulkActionType.enable, + ids: ['ruleId1'], + }); + + expect(toasts.addError).toHaveBeenCalled(); + expect(toasts.addSuccess).not.toHaveBeenCalled(); + }); + }); + + describe('when rules table context is available', () => { + let setLoadingRules: jest.Mock; + + beforeEach(() => { + setLoadingRules = jest.fn(); + (useRulesTableContextOptional as jest.Mock).mockReturnValue({ + actions: { + setLoadingRules, + }, + state: { + isAllSelected: false, + }, + }); + }); + + it('sets the loading state before execution', async () => { + await executeBulkAction({ + type: BulkActionType.enable, + ids: ['ruleId1', 'ruleId2'], + }); + + expect(setLoadingRules).toHaveBeenCalledWith({ + ids: ['ruleId1', 'ruleId2'], + action: BulkActionType.enable, + }); + }); + + it('sets the empty loading state before execution when query is set', async () => { + await executeBulkAction({ + type: BulkActionType.enable, + query: 'some query', + }); + + expect(setLoadingRules).toHaveBeenCalledWith({ + ids: [], + action: BulkActionType.enable, + }); + }); + + it('clears loading state for the processing rules after execution', async () => { + await executeBulkAction({ + type: BulkActionType.enable, + ids: ['ruleId1', 'ruleId2'], + }); + + expect(setLoadingRules).toHaveBeenCalledWith({ ids: [], action: null }); + }); + + it('clears loading state for the processing rules after execution failure', async () => { + (useBulkActionMutation as jest.Mock).mockReturnValue({ + mutateAsync: jest.fn().mockRejectedValue(new Error()), + }); + + await executeBulkAction({ + type: BulkActionType.enable, + ids: ['ruleId1', 'ruleId2'], + }); + + expect(setLoadingRules).toHaveBeenCalledWith({ ids: [], action: null }); + }); + }); + + describe('telemetry', () => { + it('sends for enable action', async () => { + await executeBulkAction({ + type: BulkActionType.enable, + query: 'some query', + }); + + expect(track).toHaveBeenCalledWith(METRIC_TYPE.COUNT, TELEMETRY_EVENT.SIEM_RULE_ENABLED); + expect(track).toHaveBeenCalledWith(METRIC_TYPE.COUNT, TELEMETRY_EVENT.CUSTOM_RULE_ENABLED); + }); + + it('sends for disable action', async () => { + await executeBulkAction({ + type: BulkActionType.disable, + query: 'some query', + }); + + expect(track).toHaveBeenCalledWith(METRIC_TYPE.COUNT, TELEMETRY_EVENT.SIEM_RULE_DISABLED); + expect(track).toHaveBeenCalledWith(METRIC_TYPE.COUNT, TELEMETRY_EVENT.CUSTOM_RULE_DISABLED); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.ts index 3ba9e353f3fcd..a74708879ca21 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.ts @@ -7,19 +7,18 @@ import type { NavigateToAppOptions } from '@kbn/core/public'; import { useCallback } from 'react'; -import type { BulkActionResponse, BulkActionSummary } from '..'; +import type { BulkActionResponse } from '..'; import { APP_UI_ID } from '../../../../../common/constants'; -import type { BulkActionEditPayload } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; -import { BulkAction } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; -import type { HTTPError } from '../../../../../common/detection_engine/types'; +import { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import { SecurityPageName } from '../../../../app/types'; import { getEditRuleUrl } from '../../../../common/components/link_to/redirect_to_detection_engine'; -import type { UseAppToasts } from '../../../../common/hooks/use_app_toasts'; -import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { METRIC_TYPE, TELEMETRY_EVENT, track } from '../../../../common/lib/telemetry'; -import type { RulesTableActions } from '../../../rule_management_ui/components/rules_table/rules_table/rules_table_context'; +import { useRulesTableContextOptional } from '../../../rule_management_ui/components/rules_table/rules_table/rules_table_context'; +import type { BulkAction } from '../../api/api'; import { useBulkActionMutation } from '../../api/hooks/use_bulk_action_mutation'; -import { getErrorToastContent, getSuccessToastContent } from './translations'; +import { useShowBulkErrorToast } from './use_show_bulk_error_toast'; +import { useShowBulkSuccessToast } from './use_show_bulk_success_toast'; +import { useGuessRuleIdsForBulkAction } from './use_guess_rule_ids_for_bulk_action'; export const goToRuleEditPage = ( ruleId: string, @@ -31,92 +30,78 @@ export const goToRuleEditPage = ( }); }; -type OnActionSuccessCallback = ( - toasts: UseAppToasts, - action: BulkAction, - summary: BulkActionSummary -) => void; - -type OnActionErrorCallback = (toasts: UseAppToasts, action: BulkAction, error: HTTPError) => void; - -interface RulesBulkActionArgs { - action: Exclude<BulkAction, BulkAction.export>; - visibleRuleIds?: string[]; - search: { query: string } | { ids: string[] }; - payload?: { edit?: BulkActionEditPayload[] }; - onError?: OnActionErrorCallback; - onFinish?: () => void; - onSuccess?: OnActionSuccessCallback; - setLoadingRules?: RulesTableActions['setLoadingRules']; +interface UseExecuteBulkActionOptions { + suppressSuccessToast?: boolean; } -export const useExecuteBulkAction = () => { - const toasts = useAppToasts(); +export const useExecuteBulkAction = (options?: UseExecuteBulkActionOptions) => { const { mutateAsync } = useBulkActionMutation(); + const showBulkSuccessToast = useShowBulkSuccessToast(); + const showBulkErrorToast = useShowBulkErrorToast(); + const guessRuleIdsForBulkAction = useGuessRuleIdsForBulkAction(); + const rulesTableContext = useRulesTableContextOptional(); + const setLoadingRules = rulesTableContext?.actions.setLoadingRules; const executeBulkAction = useCallback( - async ({ - visibleRuleIds = [], - action, - setLoadingRules, - search, - payload, - onSuccess = defaultSuccessHandler, - onError = defaultErrorHandler, - onFinish, - }: RulesBulkActionArgs) => { + async (bulkAction: BulkAction) => { try { - setLoadingRules?.({ ids: visibleRuleIds, action }); - const response = await mutateAsync({ ...search, action, edit: payload?.edit }); - sendTelemetry(action, response); - onSuccess(toasts, action, response.attributes.summary); + setLoadingRules?.({ + ids: bulkAction.ids ?? guessRuleIdsForBulkAction(bulkAction.type), + action: bulkAction.type, + }); + + const response = await mutateAsync({ bulkAction }); + sendTelemetry(bulkAction.type, response); + + if (!options?.suppressSuccessToast) { + showBulkSuccessToast({ + actionType: bulkAction.type, + summary: response.attributes.summary, + editPayload: + bulkAction.type === BulkActionType.edit ? bulkAction.editPayload : undefined, + }); + } return response; } catch (error) { - onError(toasts, action, error); + showBulkErrorToast({ actionType: bulkAction.type, error }); } finally { setLoadingRules?.({ ids: [], action: null }); - onFinish?.(); } }, - [mutateAsync, toasts] + [ + options?.suppressSuccessToast, + guessRuleIdsForBulkAction, + setLoadingRules, + mutateAsync, + showBulkSuccessToast, + showBulkErrorToast, + ] ); return { executeBulkAction }; }; -function defaultErrorHandler(toasts: UseAppToasts, action: BulkAction, error: HTTPError) { - const summary = (error?.body as BulkActionResponse)?.attributes?.summary; - error.stack = JSON.stringify(error.body, null, 2); - - toasts.addError(error, getErrorToastContent(action, summary)); -} +function sendTelemetry(action: BulkActionType, response: BulkActionResponse): void { + if (action !== BulkActionType.disable && action !== BulkActionType.enable) { + return; + } -async function defaultSuccessHandler( - toasts: UseAppToasts, - action: BulkAction, - summary: BulkActionSummary -) { - toasts.addSuccess(getSuccessToastContent(action, summary)); -} + if (response.attributes.results.updated.some((rule) => rule.immutable)) { + track( + METRIC_TYPE.COUNT, + action === BulkActionType.enable + ? TELEMETRY_EVENT.SIEM_RULE_ENABLED + : TELEMETRY_EVENT.SIEM_RULE_DISABLED + ); + } -function sendTelemetry(action: BulkAction, response: BulkActionResponse) { - if (action === BulkAction.disable || action === BulkAction.enable) { - if (response.attributes.results.updated.some((rule) => rule.immutable)) { - track( - METRIC_TYPE.COUNT, - action === BulkAction.enable - ? TELEMETRY_EVENT.SIEM_RULE_ENABLED - : TELEMETRY_EVENT.SIEM_RULE_DISABLED - ); - } - if (response.attributes.results.updated.some((rule) => !rule.immutable)) { - track( - METRIC_TYPE.COUNT, - action === BulkAction.disable - ? TELEMETRY_EVENT.CUSTOM_RULE_ENABLED - : TELEMETRY_EVENT.CUSTOM_RULE_DISABLED - ); - } + if (response.attributes.results.updated.some((rule) => !rule.immutable)) { + track( + METRIC_TYPE.COUNT, + action === BulkActionType.disable + ? TELEMETRY_EVENT.CUSTOM_RULE_DISABLED + : TELEMETRY_EVENT.CUSTOM_RULE_ENABLED + ); } } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_guess_rule_ids_for_bulk_action.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_guess_rule_ids_for_bulk_action.ts new file mode 100644 index 0000000000000..af2e1515d6fe1 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_guess_rule_ids_for_bulk_action.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 { useCallback } from 'react'; +import { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { useRulesTableContextOptional } from '../../../rule_management_ui/components/rules_table/rules_table/rules_table_context'; + +export function useGuessRuleIdsForBulkAction(): (bulkActionType: BulkActionType) => string[] { + const rulesTableContext = useRulesTableContextOptional(); + + return useCallback( + (bulkActionType: BulkActionType) => { + const allRules = rulesTableContext?.state.isAllSelected ? rulesTableContext.state.rules : []; + const processingRules = + bulkActionType === BulkActionType.enable + ? allRules.filter((x) => !x.enabled) + : bulkActionType === BulkActionType.disable + ? allRules.filter((x) => x.enabled) + : allRules; + + return processingRules.map((r) => r.id); + }, + [rulesTableContext] + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_error_toast.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_error_toast.ts new file mode 100644 index 0000000000000..70ea504a76159 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_error_toast.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 { useCallback } from 'react'; +import type { HTTPError } from '../../../../../common/detection_engine/types'; +import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; +import type { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { explainBulkError, summarizeBulkError } from './translations'; + +interface ShowBulkErrorToastProps { + actionType: BulkActionType; + error: HTTPError; +} + +export function useShowBulkErrorToast() { + const toasts = useAppToasts(); + + return useCallback( + ({ actionType, error }: ShowBulkErrorToastProps) => { + toasts.addError(populateErrorStack(error), { + title: summarizeBulkError(actionType), + toastMessage: explainBulkError(actionType, error), + }); + }, + [toasts] + ); +} + +function populateErrorStack(error: HTTPError): HTTPError { + error.stack = JSON.stringify(error.body, null, 2); + + return error; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_success_toast.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_success_toast.ts new file mode 100644 index 0000000000000..0fd2acc1cdf4b --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_success_toast.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 { useCallback } from 'react'; +import type { BulkActionSummary } from '..'; +import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; +import type { BulkActionEditPayload } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { explainBulkEditSuccess, explainBulkSuccess, summarizeBulkSuccess } from './translations'; + +interface ShowBulkSuccessToastProps { + actionType: BulkActionType; + summary: BulkActionSummary; + editPayload?: BulkActionEditPayload[]; +} + +export function useShowBulkSuccessToast() { + const toasts = useAppToasts(); + + return useCallback( + ({ actionType, summary, editPayload }: ShowBulkSuccessToastProps) => { + const text = + actionType === BulkActionType.edit + ? explainBulkEditSuccess(editPayload ?? [], summary) + : explainBulkSuccess(actionType, summary); + + toasts.addSuccess({ + title: summarizeBulkSuccess(actionType), + text, + }); + }, + [toasts] + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/rules_management_tour.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/rules_management_tour.tsx new file mode 100644 index 0000000000000..1fcb56a009edb --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/rules_management_tour.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 type { EuiTourActions, EuiTourStepProps } from '@elastic/eui'; +import { EuiTourStep } from '@elastic/eui'; +import { noop } from 'lodash'; +import React, { useEffect, useMemo } from 'react'; +import useObservable from 'react-use/lib/useObservable'; +import { of } from 'rxjs'; +import { useKibana } from '../../../../common/lib/kibana'; +import { useFindRulesQuery } from '../../../rule_management/api/hooks/use_find_rules_query'; +import * as i18n from './translations'; +import { useIsElementMounted } from './use_is_element_mounted'; + +export const INSTALL_PREBUILT_RULES_ANCHOR = 'install-prebuilt-rules-anchor'; +export const SEARCH_FIRST_RULE_ANCHOR = 'search-first-rule-anchor'; + +export interface RulesFeatureTourContextType { + steps: EuiTourStepProps[]; + actions: EuiTourActions; +} + +const GUIDED_ONBOARDING_RULES_FILTER = { + filter: '', + showCustomRules: false, + showElasticRules: true, + tags: ['Guided Onboarding'], +}; + +export enum GuidedOnboardingRulesStatus { + 'inactive' = 'inactive', + 'installRules' = 'installRules', + 'activateRules' = 'activateRules', + 'completed' = 'completed', +} + +export const RulesManagementTour = () => { + const { guidedOnboardingApi } = useKibana().services.guidedOnboarding; + + const isRulesStepActive = useObservable( + guidedOnboardingApi?.isGuideStepActive$('security', 'rules') ?? of(false), + false + ); + + const { data: onboardingRules } = useFindRulesQuery( + { filterOptions: GUIDED_ONBOARDING_RULES_FILTER }, + { enabled: isRulesStepActive } + ); + + const tourStatus = useMemo(() => { + if (!isRulesStepActive || !onboardingRules) { + return GuidedOnboardingRulesStatus.inactive; + } + + if (onboardingRules.total === 0) { + // Onboarding rules are not installed - show the install/update rules step + return GuidedOnboardingRulesStatus.installRules; + } + + if (!onboardingRules.rules.some((rule) => rule.enabled)) { + // None of the onboarding rules is active - show the activate step + return GuidedOnboardingRulesStatus.activateRules; + } + + // Rules are installed and enabled - the tour is completed + return GuidedOnboardingRulesStatus.completed; + }, [isRulesStepActive, onboardingRules]); + + // Synchronize the current "internal" tour step with the global one + useEffect(() => { + if (isRulesStepActive && tourStatus === GuidedOnboardingRulesStatus.completed) { + guidedOnboardingApi?.completeGuideStep('security', 'rules'); + } + }, [guidedOnboardingApi, isRulesStepActive, tourStatus]); + + /** + * Wait until the tour target elements are visible on the page and mount + * EuiTourStep components only after that. Otherwise, the tours would never + * show up on the page. + */ + const isInstallRulesAnchorMounted = useIsElementMounted(INSTALL_PREBUILT_RULES_ANCHOR); + const isSearchFirstRuleAnchorMounted = useIsElementMounted(SEARCH_FIRST_RULE_ANCHOR); + + return ( + <> + {isInstallRulesAnchorMounted && ( + <EuiTourStep + title={i18n.INSTALL_PREBUILT_RULES_TITLE} + content={i18n.INSTALL_PREBUILT_RULES_CONTENT} + onFinish={noop} + step={1} + stepsTotal={2} + isOpen={tourStatus === GuidedOnboardingRulesStatus.installRules} + anchor={`#${INSTALL_PREBUILT_RULES_ANCHOR}`} + anchorPosition="downCenter" + footerAction={<div />} // Replace "Skip tour" with an empty element + /> + )} + {isSearchFirstRuleAnchorMounted && ( + <EuiTourStep + title={i18n.SEARCH_FIRST_RULE_TITLE} + content={i18n.SEARCH_FIRST_RULE_CONTENT} + onFinish={noop} + step={2} + stepsTotal={2} + isOpen={tourStatus === GuidedOnboardingRulesStatus.activateRules} + anchor={`#${SEARCH_FIRST_RULE_ANCHOR}`} + anchorPosition="upCenter" + footerAction={<div />} // Replace "Skip tour" with an empty element + /> + )} + </> + ); +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/translations.ts new file mode 100644 index 0000000000000..6c8a2880801a6 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/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 INSTALL_PREBUILT_RULES_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.guidedOnboarding.installPrebuiltRules.title', + { + defaultMessage: 'Load the Elastic prebuilt rules', + } +); + +export const INSTALL_PREBUILT_RULES_CONTENT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.guidedOnboarding.installPrebuiltRules.content', + { + defaultMessage: 'To get started you need to load the Elastic prebuilt rules.', + } +); + +export const SEARCH_FIRST_RULE_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.guidedOnboarding.searchFirstRule.title', + { + defaultMessage: 'Search for Elastic Defend rules', + } +); + +export const SEARCH_FIRST_RULE_CONTENT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.guidedOnboarding.searchFirstRule.content', + { + defaultMessage: 'Find the My First Alert rule and enable it.', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/use_is_element_mounted.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/use_is_element_mounted.ts new file mode 100644 index 0000000000000..b3be0184e1a3e --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/use_is_element_mounted.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useEffect, useState } from 'react'; + +export const useIsElementMounted = (elementId: string) => { + const [isElementMounted, setIsElementMounted] = useState(false); + + useEffect(() => { + const observer = new MutationObserver(() => { + const isElementFound = !!document.getElementById(elementId); + + if (isElementFound && !isElementMounted) { + setIsElementMounted(true); + } + + if (!isElementFound && isElementMounted) { + setIsElementMounted(false); + } + }); + + observer.observe(document.body, { + childList: true, + subtree: true, + }); + + return () => observer.disconnect(); + }, [isElementMounted, elementId]); + + return isElementMounted; +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_dry_run_confirmation.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_dry_run_confirmation.tsx index 941339be4fa31..26ec4db023ba4 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_dry_run_confirmation.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_dry_run_confirmation.tsx @@ -10,7 +10,7 @@ import { EuiConfirmModal } from '@elastic/eui'; import * as i18n from '../../../../../detections/pages/detection_engine/rules/translations'; import { BulkActionRuleErrorsList } from './bulk_action_rule_errors_list'; -import { BulkAction } from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { BulkActionType } from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import { assertUnreachable } from '../../../../../../common/utility_types'; import type { BulkActionForConfirmation, DryRunResult } from './types'; @@ -20,9 +20,9 @@ const getActionRejectedTitle = ( failedRulesCount: number ) => { switch (bulkAction) { - case BulkAction.edit: + case BulkActionType.edit: return i18n.BULK_EDIT_CONFIRMATION_REJECTED_TITLE(failedRulesCount); - case BulkAction.export: + case BulkActionType.export: return i18n.BULK_EXPORT_CONFIRMATION_REJECTED_TITLE(failedRulesCount); default: assertUnreachable(bulkAction); @@ -34,9 +34,9 @@ const getActionConfirmLabel = ( succeededRulesCount: number ) => { switch (bulkAction) { - case BulkAction.edit: + case BulkActionType.edit: return i18n.BULK_EDIT_CONFIRMATION_CONFIRM(succeededRulesCount); - case BulkAction.export: + case BulkActionType.export: return i18n.BULK_EXPORT_CONFIRMATION_CONFIRM(succeededRulesCount); default: assertUnreachable(bulkAction); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.test.tsx index 758ccf0893e36..fd19e01bcde65 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.test.tsx @@ -13,7 +13,7 @@ import { render, screen } from '@testing-library/react'; import { BulkActionRuleErrorsList } from './bulk_action_rule_errors_list'; import { BulkActionsDryRunErrCode } from '../../../../../../common/constants'; import type { DryRunResult } from './types'; -import { BulkAction } from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { BulkActionType } from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; const Wrapper: FC = ({ children }) => { return ( @@ -26,7 +26,7 @@ const Wrapper: FC = ({ children }) => { describe('Component BulkEditRuleErrorsList', () => { test('should not render component if no errors present', () => { const { container } = render( - <BulkActionRuleErrorsList bulkAction={BulkAction.edit} ruleErrors={[]} />, + <BulkActionRuleErrorsList bulkAction={BulkActionType.edit} ruleErrors={[]} />, { wrapper: Wrapper, } @@ -46,7 +46,7 @@ describe('Component BulkEditRuleErrorsList', () => { ruleIds: ['rule:1'], }, ]; - render(<BulkActionRuleErrorsList bulkAction={BulkAction.edit} ruleErrors={ruleErrors} />, { + render(<BulkActionRuleErrorsList bulkAction={BulkActionType.edit} ruleErrors={ruleErrors} />, { wrapper: Wrapper, }); @@ -76,7 +76,7 @@ describe('Component BulkEditRuleErrorsList', () => { ruleIds: ['rule:1', 'rule:2'], }, ]; - render(<BulkActionRuleErrorsList bulkAction={BulkAction.edit} ruleErrors={ruleErrors} />, { + render(<BulkActionRuleErrorsList bulkAction={BulkActionType.edit} ruleErrors={ruleErrors} />, { wrapper: Wrapper, }); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.tsx index 9789377f13ef3..8b908e207daee 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.tsx @@ -10,7 +10,7 @@ import { EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { BulkActionsDryRunErrCode } from '../../../../../../common/constants'; -import { BulkAction } from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { BulkActionType } from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import type { DryRunResult, BulkActionForConfirmation } from './types'; @@ -122,7 +122,7 @@ const BulkActionRuleErrorsListComponent = ({ {ruleErrors.map(({ message, errorCode, ruleIds }) => { const rulesCount = ruleIds.length; switch (bulkAction) { - case BulkAction.edit: + case BulkActionType.edit: return ( <BulkEditRuleErrorItem message={message} @@ -131,7 +131,7 @@ const BulkActionRuleErrorsListComponent = ({ /> ); - case BulkAction.export: + case BulkActionType.export: return ( <BulkExportRuleErrorItem message={message} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/types.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/types.ts index c8250269dbe61..f773147b60a5d 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/types.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/types.ts @@ -6,14 +6,14 @@ */ import type { BulkActionsDryRunErrCode } from '../../../../../../common/constants'; -import type { BulkAction } from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import type { BulkActionType } from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; /** * Only 2 bulk actions are supported for for confirmation dry run modal: * * export * * edit */ -export type BulkActionForConfirmation = BulkAction.export | BulkAction.edit; +export type BulkActionForConfirmation = BulkActionType.export | BulkActionType.edit; /** * transformed results of dry run diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions.tsx index 48e45e144e479..74c2471b00f7e 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions.tsx @@ -14,7 +14,7 @@ import { euiThemeVars } from '@kbn/ui-theme'; import React, { useCallback } from 'react'; import type { BulkActionEditPayload } from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import { - BulkAction, + BulkActionType, BulkActionEditType, } from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import { isMlRule } from '../../../../../../common/machine_learning/helpers'; @@ -24,11 +24,9 @@ import { useStartTransaction } from '../../../../../common/lib/apm/use_start_tra import { canEditRuleWithActions } from '../../../../../common/utils/privileges'; import * as i18n from '../../../../../detections/pages/detection_engine/rules/translations'; import * as detectionI18n from '../../../../../detections/pages/detection_engine/translations'; -import { - downloadExportedRules, - useBulkExport, -} from '../../../../rule_management/logic/bulk_actions/use_bulk_export'; +import { useBulkExport } from '../../../../rule_management/logic/bulk_actions/use_bulk_export'; import { useExecuteBulkAction } from '../../../../rule_management/logic/bulk_actions/use_execute_bulk_action'; +import { useDownloadExportedRules } from '../../../../rule_management/logic/bulk_actions/use_download_exported_rules'; import type { FilterOptions } from '../../../../rule_management/logic/types'; import { convertRulesFilterToKQL } from '../../../../rule_management/logic/utils'; import { getExportedRulesDetails } from '../helpers'; @@ -37,6 +35,7 @@ import { useHasActionsPrivileges } from '../use_has_actions_privileges'; import { useHasMlPermissions } from '../use_has_ml_permissions'; import type { BulkActionForConfirmation, DryRunResult } from './types'; import type { ExecuteBulkActionsDryRun } from './use_bulk_actions_dry_run'; +import { computeDryRunEditPayload } from './utils/compute_dry_run_edit_payload'; import { transformExportDetailsToDryRunResult } from './utils/dry_run_result'; import { prepareSearchParams } from './utils/prepare_search_params'; @@ -68,10 +67,11 @@ export const useBulkActions = ({ const { startTransaction } = useStartTransaction(); const { executeBulkAction } = useExecuteBulkAction(); const { bulkExport } = useBulkExport(); + const downloadExportedRules = useDownloadExportedRules(); const { state: { isAllSelected, rules, loadingRuleIds, selectedRuleIds }, - actions: { setLoadingRules, clearRulesSelection }, + actions: { clearRulesSelection }, } = rulesTableContext; const getBulkItemsPopoverContent = useCallback( @@ -104,10 +104,8 @@ export const useBulkActions = ({ : disabledRulesNoML.map(({ id }) => id); await executeBulkAction({ - visibleRuleIds: ruleIds, - action: BulkAction.enable, - setLoadingRules, - search: isAllSelected ? { query: filterQuery } : { ids: ruleIds }, + type: BulkActionType.enable, + ...(isAllSelected ? { query: filterQuery } : { ids: ruleIds }), }); }; @@ -118,10 +116,8 @@ export const useBulkActions = ({ const enabledIds = selectedRules.filter(({ enabled }) => enabled).map(({ id }) => id); await executeBulkAction({ - visibleRuleIds: enabledIds, - action: BulkAction.disable, - setLoadingRules, - search: isAllSelected ? { query: filterQuery } : { ids: enabledIds }, + type: BulkActionType.disable, + ...(isAllSelected ? { query: filterQuery } : { ids: enabledIds }), }); }; @@ -130,10 +126,8 @@ export const useBulkActions = ({ closePopover(); await executeBulkAction({ - visibleRuleIds: selectedRuleIds, - action: BulkAction.duplicate, - setLoadingRules, - search: isAllSelected ? { query: filterQuery } : { ids: selectedRuleIds }, + type: BulkActionType.duplicate, + ...(isAllSelected ? { query: filterQuery } : { ids: selectedRuleIds }), }); clearRulesSelection(); }; @@ -151,10 +145,8 @@ export const useBulkActions = ({ startTransaction({ name: BULK_RULE_ACTIONS.DELETE }); await executeBulkAction({ - visibleRuleIds: selectedRuleIds, - action: BulkAction.delete, - setLoadingRules, - search: isAllSelected ? { query: filterQuery } : { ids: selectedRuleIds }, + type: BulkActionType.delete, + ...(isAllSelected ? { query: filterQuery } : { ids: selectedRuleIds }), }); }; @@ -162,11 +154,9 @@ export const useBulkActions = ({ closePopover(); startTransaction({ name: BULK_RULE_ACTIONS.EXPORT }); - const response = await bulkExport({ - visibleRuleIds: selectedRuleIds, - setLoadingRules, - search: isAllSelected ? { query: filterQuery } : { ids: selectedRuleIds }, - }); + const response = await bulkExport( + isAllSelected ? { query: filterQuery } : { ids: selectedRuleIds } + ); // if response null, likely network error happened and export rules haven't been received if (!response) { @@ -179,13 +169,13 @@ export const useBulkActions = ({ // they can either cancel action or proceed with export of succeeded rules const hasActionBeenConfirmed = await showBulkActionConfirmation( transformExportDetailsToDryRunResult(details), - BulkAction.export + BulkActionType.export ); if (hasActionBeenConfirmed === false) { return; } - await downloadExportedRules({ response, toasts }); + await downloadExportedRules(response); }; const handleBulkEdit = (bulkEditActionType: BulkActionEditType) => async () => { @@ -195,17 +185,17 @@ export const useBulkActions = ({ closePopover(); const dryRunResult = await executeBulkActionsDryRun({ - action: BulkAction.edit, - editAction: bulkEditActionType, - searchParams: isAllSelected + type: BulkActionType.edit, + ...(isAllSelected ? { query: convertRulesFilterToKQL(filterOptions) } - : { ids: selectedRuleIds }, + : { ids: selectedRuleIds }), + editPayload: computeDryRunEditPayload(bulkEditActionType), }); // User has cancelled edit action or there are no custom rules to proceed const hasActionBeenConfirmed = await showBulkActionConfirmation( dryRunResult, - BulkAction.edit + BulkActionType.edit ); if (hasActionBeenConfirmed === false) { return; @@ -256,17 +246,16 @@ export const useBulkActions = ({ }, 5 * 1000); await executeBulkAction({ - visibleRuleIds: selectedRuleIds, - action: BulkAction.edit, - setLoadingRules, - payload: { edit: [editPayload] }, - onFinish: () => hideWarningToast(), - search: prepareSearchParams({ + type: BulkActionType.edit, + ...prepareSearchParams({ ...(isAllSelected ? { filterOptions } : { selectedRuleIds }), dryRunResult, }), + editPayload: [editPayload], }); + hideWarningToast(); + isBulkEditFinished = true; }; @@ -462,7 +451,6 @@ export const useBulkActions = ({ startTransaction, hasMlPermissions, executeBulkAction, - setLoadingRules, filterQuery, toasts, clearRulesSelection, @@ -472,6 +460,7 @@ export const useBulkActions = ({ executeBulkActionsDryRun, filterOptions, completeBulkEditForm, + downloadExportedRules, ] ); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_dry_run.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_dry_run.ts index d11a2d6c167b8..00e6ef3ad7814 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_dry_run.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_dry_run.ts @@ -8,13 +8,8 @@ import type { UseMutateAsyncFunction } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query'; -import type { - BulkAction, - BulkActionEditType, -} from '../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; -import type { BulkActionResponse } from '../../../../rule_management/logic'; +import type { BulkAction, BulkActionResponse } from '../../../../rule_management/logic'; import { performBulkAction } from '../../../../rule_management/logic'; -import { computeDryRunPayload } from './utils/compute_dry_run_payload'; import { processDryRunResult } from './utils/dry_run_result'; import type { DryRunResult } from './types'; @@ -24,7 +19,7 @@ const BULK_ACTIONS_DRY_RUN_QUERY_KEY = 'bulkActionsDryRun'; export type ExecuteBulkActionsDryRun = UseMutateAsyncFunction< DryRunResult | undefined, unknown, - BulkActionsDryRunVariables + BulkAction >; export type UseBulkActionsDryRun = () => { @@ -33,30 +28,16 @@ export type UseBulkActionsDryRun = () => { executeBulkActionsDryRun: ExecuteBulkActionsDryRun; }; -interface BulkActionsDryRunVariables { - action?: Exclude<BulkAction, BulkAction.export>; - editAction?: BulkActionEditType; - searchParams: { query?: string } | { ids?: string[] }; -} - export const useBulkActionsDryRun: UseBulkActionsDryRun = () => { const { data, mutateAsync, isLoading } = useMutation< DryRunResult | undefined, unknown, - BulkActionsDryRunVariables - >([BULK_ACTIONS_DRY_RUN_QUERY_KEY], async ({ searchParams, action, editAction }) => { - if (!action) { - return undefined; - } - + BulkAction + >([BULK_ACTIONS_DRY_RUN_QUERY_KEY], async (bulkAction) => { let result: BulkActionResponse; + try { - result = await performBulkAction({ - ...searchParams, - action, - edit: computeDryRunPayload(action, editAction), - isDryRun: true, - }); + result = await performBulkAction({ bulkAction, dryRun: true }); } catch (err) { // if body doesn't have summary data, action failed altogether and no data available for dry run if ((err.body as BulkActionResponse)?.attributes?.summary?.total === undefined) { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.test.ts new file mode 100644 index 0000000000000..a1344dcc53ad5 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.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 { BulkActionEditType } from '../../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; + +import { computeDryRunEditPayload } from './compute_dry_run_edit_payload'; + +describe('computeDryRunEditPayload', () => { + test.each([ + [BulkActionEditType.set_index_patterns, []], + [BulkActionEditType.delete_index_patterns, []], + [BulkActionEditType.add_index_patterns, []], + [BulkActionEditType.add_tags, []], + [BulkActionEditType.delete_index_patterns, []], + [BulkActionEditType.set_tags, []], + [BulkActionEditType.set_timeline, { timeline_id: '', timeline_title: '' }], + ])('should return correct payload for bulk edit action %s', (editAction, value) => { + const payload = computeDryRunEditPayload(editAction); + expect(payload).toHaveLength(1); + expect(payload?.[0].type).toEqual(editAction); + expect(payload?.[0].value).toEqual(value); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.ts new file mode 100644 index 0000000000000..c8f49ebe4a6c6 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.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 type { BulkActionEditPayload } from '../../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { BulkActionEditType } from '../../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { assertUnreachable } from '../../../../../../../common/utility_types'; + +/** + * helper utility that creates payload for _bulk_action API in dry mode + * @param {BulkAction} action + * @param {BulkActionEditType | undefined} editAction + * @returns {BulkActionEditPayload[] | undefined} + */ +export function computeDryRunEditPayload(editAction: BulkActionEditType): BulkActionEditPayload[] { + switch (editAction) { + case BulkActionEditType.add_index_patterns: + case BulkActionEditType.delete_index_patterns: + case BulkActionEditType.set_index_patterns: + return [ + { + type: editAction, + value: [], + }, + ]; + + case BulkActionEditType.add_tags: + case BulkActionEditType.delete_tags: + case BulkActionEditType.set_tags: + return [ + { + type: editAction, + value: [], + }, + ]; + + case BulkActionEditType.set_timeline: + return [ + { + type: editAction, + value: { timeline_id: '', timeline_title: '' }, + }, + ]; + + case BulkActionEditType.add_rule_actions: + case BulkActionEditType.set_rule_actions: + return [ + { + type: editAction, + value: { throttle: '1h', actions: [] }, + }, + ]; + case BulkActionEditType.set_schedule: + return [ + { + type: editAction, + value: { interval: '5m', lookback: '1m' }, + }, + ]; + + default: + assertUnreachable(editAction); + } + + return [ + { + type: editAction, + value: [], + }, + ]; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_payload.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_payload.test.ts deleted file mode 100644 index b3fe47dd214a0..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_payload.test.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 { - BulkAction, - BulkActionEditType, -} from '../../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; - -import { computeDryRunPayload } from './compute_dry_run_payload'; - -describe('computeDryRunPayload', () => { - test.each([ - [BulkAction.export], - [BulkAction.duplicate], - [BulkAction.delete], - [BulkAction.enable], - [BulkAction.disable], - ])('should return payload undefined if action is %s', (action) => { - expect(computeDryRunPayload(action)).toBeUndefined(); - }); - - test('should return payload undefined if bulkEdit action is not defined', () => { - expect(computeDryRunPayload(BulkAction.edit)).toBeUndefined(); - }); - - test.each([ - [BulkActionEditType.set_index_patterns, []], - [BulkActionEditType.delete_index_patterns, []], - [BulkActionEditType.add_index_patterns, []], - [BulkActionEditType.add_tags, []], - [BulkActionEditType.delete_index_patterns, []], - [BulkActionEditType.set_tags, []], - [BulkActionEditType.set_timeline, { timeline_id: '', timeline_title: '' }], - ])('should return correct payload for bulk edit action %s', (editAction, value) => { - const payload = computeDryRunPayload(BulkAction.edit, editAction); - expect(payload).toHaveLength(1); - expect(payload?.[0].type).toEqual(editAction); - expect(payload?.[0].value).toEqual(value); - }); -}); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_payload.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_payload.ts deleted file mode 100644 index 36ebb0d5a644d..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_payload.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { BulkActionEditPayload } from '../../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; -import { - BulkAction, - BulkActionEditType, -} from '../../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; -import { assertUnreachable } from '../../../../../../../common/utility_types'; - -/** - * helper utility that creates payload for _bulk_action API in dry mode - * @param {BulkAction} action - * @param {BulkActionEditType | undefined} editAction - * @returns {BulkActionEditPayload[] | undefined} - */ -export const computeDryRunPayload = ( - action: BulkAction, - editAction?: BulkActionEditType -): BulkActionEditPayload[] | undefined => { - if (action !== BulkAction.edit || !editAction) { - return undefined; - } - - switch (editAction) { - case BulkActionEditType.add_index_patterns: - case BulkActionEditType.delete_index_patterns: - case BulkActionEditType.set_index_patterns: - return [ - { - type: editAction, - value: [], - }, - ]; - - case BulkActionEditType.add_tags: - case BulkActionEditType.delete_tags: - case BulkActionEditType.set_tags: - return [ - { - type: editAction, - value: [], - }, - ]; - - case BulkActionEditType.set_timeline: - return [ - { - type: editAction, - value: { timeline_id: '', timeline_title: '' }, - }, - ]; - - case BulkActionEditType.add_rule_actions: - case BulkActionEditType.set_rule_actions: - return [ - { - type: editAction, - value: { throttle: '1h', actions: [] }, - }, - ]; - case BulkActionEditType.set_schedule: - return [ - { - type: editAction, - value: { interval: '5m', lookback: '1m' }, - }, - ]; - - default: - assertUnreachable(editAction); - } -}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.test.ts index 3c5dc13ffab66..4a88d19e53970 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.test.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.test.ts @@ -39,7 +39,7 @@ describe('prepareSearchParams', () => { dryRunResult, }); - expect(result.ids).toEqual(['rule:1']); + expect(result).toEqual({ ids: ['rule:1'] }); }); test.each([ @@ -105,7 +105,7 @@ describe('prepareSearchParams', () => { }); expect(mockConvertRulesFilterToKQL).toHaveBeenCalledWith(value); - expect(result.query).toEqual(expect.any(String)); + expect(result).toEqual({ query: expect.any(String) }); } ); }); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.ts index c761e56f4bfef..9b0986d1d68d3 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.ts @@ -5,6 +5,7 @@ * 2.0. */ +import type { QueryOrIds } from '../../../../../rule_management/logic'; import type { DryRunResult } from '../types'; import type { FilterOptions } from '../../../../../rule_management/logic/types'; @@ -23,7 +24,10 @@ type PrepareSearchFilterProps = * @param filterOptions {@link FilterOptions} find filter * @returns either list of ids or KQL search query */ -export const prepareSearchParams = ({ dryRunResult, ...props }: PrepareSearchFilterProps) => { +export const prepareSearchParams = ({ + dryRunResult, + ...props +}: PrepareSearchFilterProps): QueryOrIds => { // if selectedRuleIds present, filter out rules that failed during dry run if ('selectedRuleIds' in props) { const failedRuleIdsSet = new Set(dryRunResult?.ruleErrors.flatMap(({ ruleIds }) => ruleIds)); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.test.ts index babedf3c14905..1ef07451103e6 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.test.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.test.ts @@ -6,7 +6,7 @@ */ import { Query } from '@elastic/eui'; -import { EXCEPTIONS_SEARCH_SCHEMA } from '../../../rule_exceptions_ui/pages/exceptions/exceptions_search_bar'; +import { EXCEPTIONS_SEARCH_SCHEMA } from '../../../../exceptions/manage_exceptions/exceptions_search_bar'; import { caseInsensitiveSort, getSearchFilters } from './helpers'; describe('AllRulesTable Helpers', () => { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx index 784d3dfc62427..143ae37a694d1 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx @@ -22,6 +22,7 @@ import * as i18n from '../../../../../detections/pages/detection_engine/rules/tr import { useRulesTableContext } from '../rules_table/rules_table_context'; import { TagsFilterPopover } from './tags_filter_popover'; import { useTags } from '../../../../rule_management/logic/use_tags'; +import { SEARCH_FIRST_RULE_ANCHOR } from '../../guided_onboarding/rules_management_tour'; const FilterWrapper = styled(EuiFlexGroup)` margin-bottom: ${({ theme }) => theme.eui.euiSizeXS}; @@ -85,6 +86,7 @@ const RulesTableFiltersComponent = () => { <FilterWrapper gutterSize="m" justifyContent="flexEnd"> <SearchBarWrapper grow> <EuiFieldSearch + id={SEARCH_FIRST_RULE_ANCHOR} aria-label={i18n.SEARCH_RULES} fullWidth incremental={false} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rules_table_actions.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rules_table_actions.tsx index 6e0e2bb761007..185ca7040fe21 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rules_table_actions.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rules_table_actions.tsx @@ -8,33 +8,28 @@ import type { DefaultItemAction } from '@elastic/eui'; import { EuiToolTip } from '@elastic/eui'; import React from 'react'; -import { BulkAction } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; -import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; +import { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import { SINGLE_RULE_ACTIONS } from '../../../../common/lib/apm/user_actions'; import { useStartTransaction } from '../../../../common/lib/apm/use_start_transaction'; import { useKibana } from '../../../../common/lib/kibana'; import { canEditRuleWithActions } from '../../../../common/utils/privileges'; import * as i18n from '../../../../detections/pages/detection_engine/rules/translations'; import type { Rule } from '../../../rule_management/logic'; -import { - downloadExportedRules, - useBulkExport, -} from '../../../rule_management/logic/bulk_actions/use_bulk_export'; +import { useBulkExport } from '../../../rule_management/logic/bulk_actions/use_bulk_export'; import { goToRuleEditPage, useExecuteBulkAction, } from '../../../rule_management/logic/bulk_actions/use_execute_bulk_action'; -import { useRulesTableContext } from './rules_table/rules_table_context'; +import { useDownloadExportedRules } from '../../../rule_management/logic/bulk_actions/use_download_exported_rules'; import { useHasActionsPrivileges } from './use_has_actions_privileges'; export const useRulesTableActions = (): Array<DefaultItemAction<Rule>> => { const { navigateToApp } = useKibana().services.application; const hasActionsPrivileges = useHasActionsPrivileges(); - const toasts = useAppToasts(); - const { setLoadingRules } = useRulesTableContext().actions; const { startTransaction } = useStartTransaction(); const { executeBulkAction } = useExecuteBulkAction(); const { bulkExport } = useBulkExport(); + const downloadExportedRules = useDownloadExportedRules(); return [ { @@ -69,10 +64,8 @@ export const useRulesTableActions = (): Array<DefaultItemAction<Rule>> => { onClick: async (rule: Rule) => { startTransaction({ name: SINGLE_RULE_ACTIONS.DUPLICATE }); const result = await executeBulkAction({ - action: BulkAction.duplicate, - setLoadingRules, - visibleRuleIds: [rule.id], - search: { ids: [rule.id] }, + type: BulkActionType.duplicate, + ids: [rule.id], }); const createdRules = result?.attributes.results.created; if (createdRules?.length) { @@ -88,16 +81,9 @@ export const useRulesTableActions = (): Array<DefaultItemAction<Rule>> => { name: i18n.EXPORT_RULE, onClick: async (rule: Rule) => { startTransaction({ name: SINGLE_RULE_ACTIONS.EXPORT }); - const response = await bulkExport({ - setLoadingRules, - visibleRuleIds: [rule.id], - search: { ids: [rule.id] }, - }); + const response = await bulkExport({ ids: [rule.id] }); if (response) { - await downloadExportedRules({ - response, - toasts, - }); + await downloadExportedRules(response); } }, enabled: (rule: Rule) => !rule.immutable, @@ -111,10 +97,8 @@ export const useRulesTableActions = (): Array<DefaultItemAction<Rule>> => { onClick: async (rule: Rule) => { startTransaction({ name: SINGLE_RULE_ACTIONS.DELETE }); await executeBulkAction({ - action: BulkAction.delete, - setLoadingRules, - visibleRuleIds: [rule.id], - search: { ids: [rule.id] }, + type: BulkActionType.delete, + ids: [rule.id], }); }, }, diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/rule_management/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/rule_management/index.tsx index 194e16fdb8e4b..16a30acb29651 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/rule_management/index.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/rule_management/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React from 'react'; +import React, { useCallback } from 'react'; import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; import { APP_UI_ID } from '../../../../../common/constants'; @@ -32,6 +32,7 @@ import { useListsConfig } from '../../../../detections/containers/detection_engi import { redirectToDetections } from '../../../../detections/pages/detection_engine/rules/helpers'; import { useInvalidateFindRulesQuery } from '../../../rule_management/api/hooks/use_find_rules_query'; +import { useInvalidateFetchPrebuiltRulesStatusQuery } from '../../../rule_management/api/hooks/use_fetch_prebuilt_rules_status_query'; import { importRules } from '../../../rule_management/logic'; import { usePrePackagedRulesInstallationStatus } from '../../../rule_management/logic/use_pre_packaged_rules_installation_status'; import { usePrePackagedTimelinesInstallationStatus } from '../../../rule_management/logic/use_pre_packaged_timelines_installation_status'; @@ -40,12 +41,18 @@ import { AllRules } from '../../components/rules_table'; import { RulesTableContextProvider } from '../../components/rules_table/rules_table/rules_table_context'; import * as i18n from '../../../../detections/pages/detection_engine/rules/translations'; +import { RulesManagementTour } from '../../components/guided_onboarding/rules_management_tour'; const RulesPageComponent: React.FC = () => { const [isImportModalVisible, showImportModal, hideImportModal] = useBoolState(); const [isValueListFlyoutVisible, showValueListFlyout, hideValueListFlyout] = useBoolState(); const { navigateToApp } = useKibana().services.application; const invalidateFindRulesQuery = useInvalidateFindRulesQuery(); + const invalidateFetchPrebuiltRulesStatusQuery = useInvalidateFetchPrebuiltRulesStatusQuery(); + const invalidateRules = useCallback(() => { + invalidateFindRulesQuery(); + invalidateFetchPrebuiltRulesStatusQuery(); + }, [invalidateFindRulesQuery, invalidateFetchPrebuiltRulesStatusQuery]); const [ { @@ -85,6 +92,7 @@ const RulesPageComponent: React.FC = () => { <NeedAdminForUpdateRulesCallOut /> <MissingPrivilegesCallOut /> <MlJobCompatibilityCallout /> + <RulesManagementTour /> <ValueListsFlyout showFlyout={isValueListFlyoutVisible} onClose={hideValueListFlyout} /> <ImportDataModal checkBoxLabel={i18n.OVERWRITE_WITH_SAME_NAME} @@ -92,7 +100,7 @@ const RulesPageComponent: React.FC = () => { description={i18n.SELECT_RULE} errorMessage={i18n.IMPORT_FAILED} failedDetailed={i18n.IMPORT_FAILED_DETAILED} - importComplete={invalidateFindRulesQuery} + importComplete={invalidateRules} importData={importRules} successMessage={i18n.SUCCESSFULLY_IMPORTED_RULES} showModal={isImportModalVisible} diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.test.tsx index ec4fdb5cb6e8d..9155415165c5e 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.test.tsx @@ -11,7 +11,7 @@ import { render, screen, fireEvent } from '@testing-library/react'; import { AdditionalFiltersAction } from '.'; import { TestProviders } from '../../../../common/mock/test_providers'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); jest.mock('../../../../common/lib/kibana'); describe('AdditionalFiltersAction', () => { diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx index 76d3c979ffb03..a0fa1f6683964 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx @@ -18,6 +18,15 @@ import { useUserPrivileges } from '../../../../common/components/user_privileges jest.mock('../../../../common/components/user_privileges'); +const testSecuritySolutionLinkHref = 'test-url'; +jest.mock('../../../../common/components/links', () => ({ + useGetSecuritySolutionLinkProps: () => () => ({ href: testSecuritySolutionLinkHref }), +})); + +jest.mock('../../../../common/hooks/use_experimental_features', () => ({ + useIsExperimentalFeatureEnabled: jest.fn().mockReturnValue(true), +})); + const ecsRowData: Ecs = { _id: '1', agent: { type: ['blah'] }, @@ -83,182 +92,232 @@ const markAsOpenButton = '[data-test-subj="open-alert-status"]'; const markAsAcknowledgedButton = '[data-test-subj="acknowledged-alert-status"]'; const markAsClosedButton = '[data-test-subj="close-alert-status"]'; const addEndpointEventFilterButton = '[data-test-subj="add-event-filter-menu-item"]'; +const openAlertDetailsPageButton = '[data-test-subj="open-alert-details-page-menu-item"]'; -describe('InvestigateInResolverAction', () => { - test('it render AddToCase context menu item if timelineId === TableId.alertsOnAlertsPage', () => { - const wrapper = mount(<AlertContextMenu {...props} scopeId={TableId.alertsOnAlertsPage} />, { - wrappingComponent: TestProviders, +describe('Alert table context menu', () => { + describe('Case actions', () => { + test('it render AddToCase context menu item if timelineId === TimelineId.detectionsPage', () => { + const wrapper = mount(<AlertContextMenu {...props} scopeId={TableId.alertsOnAlertsPage} />, { + wrappingComponent: TestProviders, + }); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); + expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); }); - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); - expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); - }); + test('it render AddToCase context menu item if timelineId === TimelineId.detectionsRulesDetailsPage', () => { + const wrapper = mount( + <AlertContextMenu {...props} scopeId={TableId.alertsOnRuleDetailsPage} />, + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); + expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); + }); - test('it render AddToCase context menu item if timelineId === TableId.alertsOnRuleDetailsPage', () => { - const wrapper = mount( - <AlertContextMenu {...props} scopeId={TableId.alertsOnRuleDetailsPage} />, - { + test('it render AddToCase context menu item if timelineId === TimelineId.active', () => { + const wrapper = mount(<AlertContextMenu {...props} scopeId={TimelineId.active} />, { wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); - expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); - }); + }); - test('it render AddToCase context menu item if timelineId === TimelineId.active', () => { - const wrapper = mount(<AlertContextMenu {...props} scopeId={TimelineId.active} />, { - wrappingComponent: TestProviders, + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); + expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); }); - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); - expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); + test('it does NOT render AddToCase context menu item when timelineId is not in the allowed list', () => { + const wrapper = mount(<AlertContextMenu {...props} scopeId="timeline-test" />, { + wrappingComponent: TestProviders, + }); + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(false); + expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(false); + }); }); - test('it does NOT render AddToCase context menu item when timelineId is not in the allowed list', () => { - const wrapper = mount(<AlertContextMenu {...props} scopeId="timeline-test" />, { - wrappingComponent: TestProviders, + describe('Alert status actions', () => { + test('it renders the correct status action buttons', () => { + const wrapper = mount(<AlertContextMenu {...props} scopeId={TimelineId.active} />, { + wrappingComponent: TestProviders, + }); + + wrapper.find(actionMenuButton).simulate('click'); + + expect(wrapper.find(markAsOpenButton).first().exists()).toEqual(false); + expect(wrapper.find(markAsAcknowledgedButton).first().exists()).toEqual(true); + expect(wrapper.find(markAsClosedButton).first().exists()).toEqual(true); }); - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(false); - expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(false); }); - test('it renders the correct status action buttons', () => { - const wrapper = mount(<AlertContextMenu {...props} scopeId={TimelineId.active} />, { - wrappingComponent: TestProviders, - }); + describe('Endpoint event filter actions', () => { + describe('AddEndpointEventFilter', () => { + const endpointEventProps = { + ...props, + ecsRowData: { ...ecsRowData, agent: { type: ['endpoint'] }, event: { kind: ['event'] } }, + }; + + describe('when users can access endpoint management', () => { + beforeEach(() => { + (useUserPrivileges as jest.Mock).mockReturnValue({ + ...mockInitialUserPrivilegesState(), + endpointPrivileges: { loading: false, canAccessEndpointManagement: true }, + }); + }); - wrapper.find(actionMenuButton).simulate('click'); + test('it disables AddEndpointEventFilter when timeline id is not host events page', () => { + const wrapper = mount( + <AlertContextMenu {...endpointEventProps} scopeId={TimelineId.active} />, + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); + }); - expect(wrapper.find(markAsOpenButton).first().exists()).toEqual(false); - expect(wrapper.find(markAsAcknowledgedButton).first().exists()).toEqual(true); - expect(wrapper.find(markAsClosedButton).first().exists()).toEqual(true); - }); + test('it enables AddEndpointEventFilter when timeline id is host events page', () => { + const wrapper = mount( + <AlertContextMenu {...endpointEventProps} scopeId={TableId.hostsPageEvents} />, + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual( + false + ); + }); - describe('AddEndpointEventFilter', () => { - const endpointEventProps = { - ...props, - ecsRowData: { ...ecsRowData, agent: { type: ['endpoint'] }, event: { kind: ['event'] } }, - }; - - describe('when users can access endpoint management', () => { - beforeEach(() => { - (useUserPrivileges as jest.Mock).mockReturnValue({ - ...mockInitialUserPrivilegesState(), - endpointPrivileges: { loading: false, canAccessEndpointManagement: true }, + test('it disables AddEndpointEventFilter when timeline id is host events page but is not from endpoint', () => { + const customProps = { + ...props, + ecsRowData: { ...ecsRowData, agent: { type: ['other'] }, event: { kind: ['event'] } }, + }; + const wrapper = mount( + <AlertContextMenu {...customProps} scopeId={TableId.hostsPageEvents} />, + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); }); - }); - test('it disables AddEndpointEventFilter when timeline id is not host events page', () => { - const wrapper = mount( - <AlertContextMenu {...endpointEventProps} scopeId={TimelineId.active} />, - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); - }); + test('it enables AddEndpointEventFilter when timeline id is user events page', () => { + const wrapper = mount( + <AlertContextMenu {...endpointEventProps} scopeId={TableId.usersPageEvents} />, + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual( + false + ); + }); - test('it enables AddEndpointEventFilter when timeline id is host events page', () => { - const wrapper = mount( - <AlertContextMenu {...endpointEventProps} scopeId={TableId.hostsPageEvents} />, - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(false); + test('it disables AddEndpointEventFilter when timeline id is user events page but is not from endpoint', () => { + const customProps = { + ...props, + ecsRowData: { ...ecsRowData, agent: { type: ['other'] }, event: { kind: ['event'] } }, + }; + const wrapper = mount( + <AlertContextMenu {...customProps} scopeId={TableId.usersPageEvents} />, + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); + }); }); - test('it disables AddEndpointEventFilter when timeline id is host events page but is not from endpoint', () => { - const customProps = { - ...props, - ecsRowData: { ...ecsRowData, agent: { type: ['other'] }, event: { kind: ['event'] } }, - }; - const wrapper = mount( - <AlertContextMenu {...customProps} scopeId={TableId.hostsPageEvents} />, - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); - }); + describe('when users can NOT access endpoint management', () => { + beforeEach(() => { + (useUserPrivileges as jest.Mock).mockReturnValue({ + ...mockInitialUserPrivilegesState(), + endpointPrivileges: { loading: false, canAccessEndpointManagement: false }, + }); + }); - test('it enables AddEndpointEventFilter when timeline id is user events page', () => { - const wrapper = mount( - <AlertContextMenu {...endpointEventProps} scopeId={TableId.usersPageEvents} />, - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(false); - }); + test('it disables AddEndpointEventFilter when timeline id is host events page but cannot acces endpoint management', () => { + const wrapper = mount( + <AlertContextMenu {...endpointEventProps} scopeId={TableId.hostsPageEvents} />, + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); + }); - test('it disables AddEndpointEventFilter when timeline id is user events page but is not from endpoint', () => { - const customProps = { - ...props, - ecsRowData: { ...ecsRowData, agent: { type: ['other'] }, event: { kind: ['event'] } }, - }; - const wrapper = mount( - <AlertContextMenu {...customProps} scopeId={TableId.usersPageEvents} />, - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); - }); - }); - describe('when users can NOT access endpoint management', () => { - beforeEach(() => { - (useUserPrivileges as jest.Mock).mockReturnValue({ - ...mockInitialUserPrivilegesState(), - endpointPrivileges: { loading: false, canAccessEndpointManagement: false }, + test('it disables AddEndpointEventFilter when timeline id is user events page but cannot acces endpoint management', () => { + const wrapper = mount( + <AlertContextMenu {...endpointEventProps} scopeId={TableId.usersPageEvents} />, + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); }); }); + }); + }); - test('it disables AddEndpointEventFilter when timeline id is host events page but cannot acces endpoint management', () => { - const wrapper = mount( - <AlertContextMenu {...endpointEventProps} scopeId={TableId.hostsPageEvents} />, - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); + describe('Open alert details action', () => { + test('it does not render the open alert details page action if kibana.alert.rule.uuid is not set', () => { + const nonAlertProps = { + ...props, + ecsRowData: { + ...ecsRowData, + kibana: { + alert: { + workflow_status: ['open'], + rule: { + parameters: {}, + uuid: [], + }, + }, + }, + }, + }; + + const wrapper = mount(<AlertContextMenu {...nonAlertProps} scopeId={TimelineId.active} />, { + wrappingComponent: TestProviders, }); - test('it disables AddEndpointEventFilter when timeline id is user events page but cannot acces endpoint management', () => { - const wrapper = mount( - <AlertContextMenu {...endpointEventProps} scopeId={TableId.usersPageEvents} />, - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); + wrapper.find(actionMenuButton).simulate('click'); + + expect(wrapper.find(openAlertDetailsPageButton).first().exists()).toEqual(false); + }); + + test('it renders the open alert details action button', () => { + const wrapper = mount(<AlertContextMenu {...props} scopeId={TimelineId.active} />, { + wrappingComponent: TestProviders, }); + + wrapper.find(actionMenuButton).simulate('click'); + + expect(wrapper.find(openAlertDetailsPageButton).first().exists()).toEqual(true); }); }); }); diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx index 842cdfe82fffb..31a548e2ced9c 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx @@ -43,6 +43,7 @@ import { useEventFilterAction } from './use_event_filter_action'; import { useAddToCaseActions } from './use_add_to_case_actions'; import { isAlertFromEndpointAlert } from '../../../../common/utils/endpoint_alert_check'; import type { Rule } from '../../../../detection_engine/rule_management/logic/types'; +import { useOpenAlertDetailsAction } from './use_open_alert_details'; interface AlertContextMenuProps { ariaLabel?: string; @@ -50,7 +51,6 @@ interface AlertContextMenuProps { columnValues: string; disabled: boolean; ecsRowData: Ecs; - refetch: inputsModel.Refetch; onRuleChange?: () => void; scopeId: string; } @@ -61,7 +61,6 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps & PropsFromRedux columnValues, disabled, ecsRowData, - refetch, onRuleChange, scopeId, globalQuery, @@ -75,7 +74,8 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps & PropsFromRedux setPopover(false); }, []); - const alertId = ecsRowData?.kibana?.alert ? ecsRowData?._id : null; + const getAlertId = () => (ecsRowData?.kibana?.alert ? ecsRowData?._id : null); + const alertId = getAlertId(); const ruleId = get(0, ecsRowData?.kibana?.alert?.rule?.uuid); const ruleName = get(0, ecsRowData?.kibana?.alert?.rule?.name); const isInDetections = [TableId.alertsOnAlertsPage, TableId.alertsOnRuleDetailsPage].includes( @@ -209,6 +209,12 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps & PropsFromRedux const { osqueryActionItems } = useOsqueryContextActionItem({ handleClick: handleOnOsqueryClick }); + const { alertDetailsActionItems } = useOpenAlertDetailsAction({ + alertId, + closePopover, + ruleId, + }); + const items: React.ReactElement[] = useMemo( () => !isEvent && ruleId @@ -217,6 +223,7 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps & PropsFromRedux ...statusActionItems, ...exceptionActionItems, ...(agentId ? osqueryActionItems : []), + ...alertDetailsActionItems, ] : [ ...addToCaseActionItems, @@ -231,6 +238,7 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps & PropsFromRedux exceptionActionItems, agentId, osqueryActionItems, + alertDetailsActionItems, eventFilterActionItems, ] ); @@ -275,6 +283,7 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps & PropsFromRedux agentId={agentId} defaultValues={alertId ? { alertIds: [alertId] } : undefined} onClose={handleOnOsqueryClick} + ecsData={ecsRowData} /> )} </> diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx index 538ae5b4ba211..9f6fd3dd56104 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx @@ -9,6 +9,12 @@ import React, { useCallback, useMemo } from 'react'; import { EuiContextMenuItem } from '@elastic/eui'; import { CommentType } from '@kbn/cases-plugin/common'; import type { CaseAttachmentsWithoutOwner } from '@kbn/cases-plugin/public'; +import { GuidedOnboardingTourStep } from '../../../../common/components/guided_onboarding_tour/tour_step'; +import { + AlertsCasesTourSteps, + SecurityStepId, +} from '../../../../common/components/guided_onboarding_tour/tour_config'; +import { useTourContext } from '../../../../common/components/guided_onboarding_tour'; import { useGetUserCasesPermissions, useKibana } from '../../../../common/lib/kibana'; import type { TimelineNonEcsData } from '../../../../../common/search_strategy'; import type { Ecs } from '../../../../../common/ecs'; @@ -53,9 +59,18 @@ export const useAddToCaseActions = ({ : []; }, [casesUi.helpers, ecsData, nonEcsData]); + const { activeStep, endTourStep, incrementStep, isTourShown } = useTourContext(); + + const afterCaseCreated = useCallback(async () => { + if (isTourShown(SecurityStepId.alertsCases)) { + endTourStep(SecurityStepId.alertsCases); + } + }, [endTourStep, isTourShown]); + const createCaseFlyout = casesUi.hooks.getUseCasesAddToNewCaseFlyout({ onClose: onMenuItemClick, onSuccess, + afterCaseCreated, }); const selectCaseModal = casesUi.hooks.getUseCasesAddToExistingCaseModal({ @@ -66,8 +81,29 @@ export const useAddToCaseActions = ({ const handleAddToNewCaseClick = useCallback(() => { // TODO rename this, this is really `closePopover()` onMenuItemClick(); - createCaseFlyout.open({ attachments: caseAttachments }); - }, [onMenuItemClick, createCaseFlyout, caseAttachments]); + createCaseFlyout.open({ + attachments: caseAttachments, + // activeStep will be 4 on first render because not yet incremented + // if the user closes the flyout without completing the form and comes back, we will be at step 5 + ...(isTourShown(SecurityStepId.alertsCases) && + (activeStep === AlertsCasesTourSteps.addAlertToCase || + activeStep === AlertsCasesTourSteps.createCase) + ? { + headerContent: ( + // isTourAnchor=true no matter what in order to + // force active guide step outside of security solution (cases) + <GuidedOnboardingTourStep isTourAnchor step={5} stepId={SecurityStepId.alertsCases} /> + ), + } + : {}), + }); + if ( + isTourShown(SecurityStepId.alertsCases) && + activeStep === AlertsCasesTourSteps.addAlertToCase + ) { + incrementStep(SecurityStepId.alertsCases); + } + }, [onMenuItemClick, createCaseFlyout, caseAttachments, isTourShown, activeStep, incrementStep]); const handleAddToExistingCaseClick = useCallback(() => { // TODO rename this, this is really `closePopover()` diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_open_alert_details.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_open_alert_details.tsx new file mode 100644 index 0000000000000..c999de499cbf8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_open_alert_details.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 { EuiContextMenuItem } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { useGetSecuritySolutionLinkProps } from '../../../../common/components/links'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; +import { getAlertDetailsUrl } from '../../../../common/components/link_to'; +import { SecurityPageName } from '../../../../../common/constants'; + +interface Props { + ruleId?: string; + closePopover: () => void; + alertId: string | null; +} + +export const ACTION_OPEN_ALERT_DETAILS_PAGE = i18n.translate( + 'xpack.securitySolution.detectionEngine.alerts.actions.openAlertDetails', + { + defaultMessage: 'Open alert details page', + } +); + +export const useOpenAlertDetailsAction = ({ ruleId, closePopover, alertId }: Props) => { + const isAlertDetailsPageEnabled = useIsExperimentalFeatureEnabled('alertDetailsPageEnabled'); + const alertDetailsActionItems = []; + const { onClick } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.alerts, + path: alertId ? getAlertDetailsUrl(alertId) : '', + }); + + // We check ruleId to confirm this is an alert, as this page does not support events as of 8.6 + if (ruleId && alertId && isAlertDetailsPageEnabled) { + alertDetailsActionItems.push( + <EuiContextMenuItem + key="open-alert-details-item" + icon="popout" + data-test-subj="open-alert-details-page-menu-item" + onClick={onClick} + > + {ACTION_OPEN_ALERT_DETAILS_PAGE} + </EuiContextMenuItem> + ); + } + + return { + alertDetailsActionItems, + }; +}; diff --git a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_action_button.tsx b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_action_button.tsx new file mode 100644 index 0000000000000..6701d6e5cb36a --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_action_button.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 { EuiButton, EuiToolTip } from '@elastic/eui'; +import React, { memo } from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + type ResponderContextMenuItemProps, + useResponderActionData, +} from './use_responder_action_data'; +import { useUserPrivileges } from '../../../common/components/user_privileges'; + +export const ResponderActionButton = memo<ResponderContextMenuItemProps>( + ({ endpointId, onClick }) => { + const { handleResponseActionsClick, isDisabled, tooltip } = useResponderActionData({ + endpointId, + onClick, + }); + const endpointPrivileges = useUserPrivileges().endpointPrivileges; + + if (!endpointPrivileges.canAccessResponseConsole) { + return null; + } + + const actionButtonKey = 'endpointResponseActions-action-button'; + + return ( + <EuiToolTip position="top" content={tooltip}> + <EuiButton + fill + key={actionButtonKey} + data-test-subj={actionButtonKey} + disabled={isDisabled} + onClick={handleResponseActionsClick} + > + <FormattedMessage + id="xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.buttonLabel" + defaultMessage="Respond" + /> + </EuiButton> + </EuiToolTip> + ); + } +); +ResponderActionButton.displayName = 'ResponderActionButton'; diff --git a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_context_menu_item.tsx b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_context_menu_item.tsx index 9a6428b183d6e..9d50884b68643 100644 --- a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_context_menu_item.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_context_menu_item.tsx @@ -6,78 +6,19 @@ */ import { EuiContextMenuItem } from '@elastic/eui'; -import type { ReactNode } from 'react'; -import React, { memo, useCallback, useMemo } from 'react'; +import React, { memo } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; -import { i18n } from '@kbn/i18n'; -import { useGetEndpointDetails, useWithShowEndpointResponder } from '../../../management/hooks'; -import { HostStatus } from '../../../../common/endpoint/types'; - -export const NOT_FROM_ENDPOINT_HOST_TOOLTIP = i18n.translate( - 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.notSupportedTooltip', - { - defaultMessage: 'Add the Elastic Defend integration via Elastic Agent to enable this feature', - } -); -export const HOST_ENDPOINT_UNENROLLED_TOOLTIP = i18n.translate( - 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.unenrolledTooltip', - { defaultMessage: 'Host is no longer enrolled with the Elastic Defend integration' } -); -export const LOADING_ENDPOINT_DATA_TOOLTIP = i18n.translate( - 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.loadingTooltip', - { defaultMessage: 'Loading' } -); -export const METADATA_API_ERROR_TOOLTIP = i18n.translate( - 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.generalMetadataErrorTooltip', - { defaultMessage: 'Failed to retrieve Endpoint metadata' } -); - -export interface ResponderContextMenuItemProps { - endpointId: string; - onClick?: () => void; -} +import { + type ResponderContextMenuItemProps, + useResponderActionData, +} from './use_responder_action_data'; export const ResponderContextMenuItem = memo<ResponderContextMenuItemProps>( ({ endpointId, onClick }) => { - const showEndpointResponseActionsConsole = useWithShowEndpointResponder(); - const { - data: endpointHostInfo, - isFetching, - error, - } = useGetEndpointDetails(endpointId, { enabled: Boolean(endpointId) }); - - const [isDisabled, tooltip]: [disabled: boolean, tooltip: ReactNode] = useMemo(() => { - if (!endpointId) { - return [true, NOT_FROM_ENDPOINT_HOST_TOOLTIP]; - } - - // Still loading Endpoint host info - if (isFetching) { - return [true, LOADING_ENDPOINT_DATA_TOOLTIP]; - } - - // if we got an error and it's a 400 with unenrolled in the error message (alerts can exist for endpoint that are no longer around) - // or, - // the Host status is `unenrolled` - if ( - (error && error.body?.statusCode === 400 && error.body?.message.includes('unenrolled')) || - endpointHostInfo?.host_status === HostStatus.UNENROLLED - ) { - return [true, HOST_ENDPOINT_UNENROLLED_TOOLTIP]; - } - - // return general error tooltip - if (error) { - return [true, METADATA_API_ERROR_TOOLTIP]; - } - - return [false, undefined]; - }, [endpointHostInfo, endpointId, error, isFetching]); - - const handleResponseActionsClick = useCallback(() => { - if (endpointHostInfo) showEndpointResponseActionsConsole(endpointHostInfo.metadata); - if (onClick) onClick(); - }, [endpointHostInfo, onClick, showEndpointResponseActionsConsole]); + const { handleResponseActionsClick, isDisabled, tooltip } = useResponderActionData({ + endpointId, + onClick, + }); return ( <EuiContextMenuItem diff --git a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/translations.ts b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/translations.ts new file mode 100644 index 0000000000000..3df858b9673f1 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/translations.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 { i18n } from '@kbn/i18n'; + +export const NOT_FROM_ENDPOINT_HOST_TOOLTIP = i18n.translate( + 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.notSupportedTooltip', + { + defaultMessage: 'Add the Elastic Defend integration via Elastic Agent to enable this feature', + } +); +export const HOST_ENDPOINT_UNENROLLED_TOOLTIP = i18n.translate( + 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.unenrolledTooltip', + { defaultMessage: 'Host is no longer enrolled with the Elastic Defend integration' } +); +export const LOADING_ENDPOINT_DATA_TOOLTIP = i18n.translate( + 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.loadingTooltip', + { defaultMessage: 'Loading' } +); +export const METADATA_API_ERROR_TOOLTIP = i18n.translate( + 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.generalMetadataErrorTooltip', + { defaultMessage: 'Failed to retrieve Endpoint metadata' } +); diff --git a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_data.ts b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_data.ts new file mode 100644 index 0000000000000..1485e9434e8bf --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_data.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 { ReactNode } from 'react'; +import { useCallback, useMemo } from 'react'; +import { useGetEndpointDetails, useWithShowEndpointResponder } from '../../../management/hooks'; +import { HostStatus } from '../../../../common/endpoint/types'; +import { + NOT_FROM_ENDPOINT_HOST_TOOLTIP, + LOADING_ENDPOINT_DATA_TOOLTIP, + HOST_ENDPOINT_UNENROLLED_TOOLTIP, + METADATA_API_ERROR_TOOLTIP, +} from './translations'; + +export interface ResponderContextMenuItemProps { + endpointId: string; + onClick?: () => void; +} + +export const useResponderActionData = ({ + endpointId, + onClick, +}: ResponderContextMenuItemProps): { + handleResponseActionsClick: () => void; + isDisabled: boolean; + tooltip: ReactNode; +} => { + const showEndpointResponseActionsConsole = useWithShowEndpointResponder(); + const { + data: endpointHostInfo, + isFetching, + error, + } = useGetEndpointDetails(endpointId, { enabled: Boolean(endpointId) }); + + const [isDisabled, tooltip]: [disabled: boolean, tooltip: ReactNode] = useMemo(() => { + if (!endpointId) { + return [true, NOT_FROM_ENDPOINT_HOST_TOOLTIP]; + } + + // Still loading Endpoint host info + if (isFetching) { + return [true, LOADING_ENDPOINT_DATA_TOOLTIP]; + } + + // if we got an error and it's a 400 with unenrolled in the error message (alerts can exist for endpoint that are no longer around) + // or, + // the Host status is `unenrolled` + if ( + (error && error.body?.statusCode === 400 && error.body?.message.includes('unenrolled')) || + endpointHostInfo?.host_status === HostStatus.UNENROLLED + ) { + return [true, HOST_ENDPOINT_UNENROLLED_TOOLTIP]; + } + + // return general error tooltip + if (error) { + return [true, METADATA_API_ERROR_TOOLTIP]; + } + + return [false, undefined]; + }, [endpointHostInfo, endpointId, error, isFetching]); + + const handleResponseActionsClick = useCallback(() => { + if (endpointHostInfo) showEndpointResponseActionsConsole(endpointHostInfo.metadata); + if (onClick) onClick(); + }, [endpointHostInfo, onClick, showEndpointResponseActionsConsole]); + + return { handleResponseActionsClick, isDisabled, tooltip }; +}; diff --git a/x-pack/plugins/security_solution/public/detections/components/osquery/osquery_flyout.tsx b/x-pack/plugins/security_solution/public/detections/components/osquery/osquery_flyout.tsx index cd35752d56310..00dbe210e7026 100644 --- a/x-pack/plugins/security_solution/public/detections/components/osquery/osquery_flyout.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/osquery/osquery_flyout.tsx @@ -8,6 +8,7 @@ import React from 'react'; import styled from 'styled-components'; import { EuiFlyout, EuiFlyoutFooter, EuiFlyoutBody, EuiFlyoutHeader, EuiTitle } from '@elastic/eui'; +import type { Ecs } from '../../../../common/ecs'; import { useKibana } from '../../../common/lib/kibana'; import { OsqueryEventDetailsFooter } from './osquery_flyout_footer'; import { ACTION_OSQUERY } from './translations'; @@ -20,11 +21,14 @@ export interface OsqueryFlyoutProps { agentId?: string; defaultValues?: {}; onClose: () => void; + ecsData?: Ecs; } -export const OsqueryFlyoutComponent: React.FC<OsqueryFlyoutProps> = ({ + +const OsqueryFlyoutComponent: React.FC<OsqueryFlyoutProps> = ({ agentId, defaultValues, onClose, + ecsData, }) => { const { services: { osquery }, @@ -49,6 +53,7 @@ export const OsqueryFlyoutComponent: React.FC<OsqueryFlyoutProps> = ({ agentId={agentId} formType="steps" defaultValues={defaultValues} + ecsData={ecsData} /> </OsqueryActionWrapper> </EuiFlyoutBody> diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/validators.test.ts b/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/validators.test.ts index 74f1bb89bb8c5..a4e7baf3c30be 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/validators.test.ts +++ b/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/validators.test.ts @@ -7,7 +7,7 @@ import { debounceAsync } from './validators'; -jest.useFakeTimers(); +jest.useFakeTimers('legacy'); describe('debounceAsync', () => { let fn: jest.Mock; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/load_prepackaged_rules_button.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/load_prepackaged_rules_button.tsx index 996bbc386be37..5fa24b9fac5f4 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/load_prepackaged_rules_button.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/load_prepackaged_rules_button.tsx @@ -10,6 +10,7 @@ import React from 'react'; import { usePrePackagedRulesInstallationStatus } from '../../../../detection_engine/rule_management/logic/use_pre_packaged_rules_installation_status'; import { usePrePackagedRulesStatus } from '../../../../detection_engine/rule_management/logic/use_pre_packaged_rules_status'; import { usePrePackagedTimelinesInstallationStatus } from '../../../../detection_engine/rule_management/logic/use_pre_packaged_timelines_installation_status'; +import { INSTALL_PREBUILT_RULES_ANCHOR } from '../../../../detection_engine/rule_management_ui/components/guided_onboarding/rules_management_tour'; import type { PrePackagedRuleInstallationStatus, PrePackagedTimelineInstallationStatus, @@ -62,17 +63,23 @@ export const LoadPrePackagedRulesButton = ({ prePackagedAssetsStatus !== 'someRuleUninstall'; if (showInstallButton) { + // Without the outer div EuiStepTour crashes with Uncaught DOMException: + // Failed to execute 'removeChild' on 'Node': The node to be removed is not + // a child of this node. return ( - <EuiButton - fill={fill} - iconType="indexOpen" - isLoading={isLoading} - isDisabled={isDisabled} - onClick={onClick} - data-test-subj={dataTestSubj} - > - {getLoadRulesOrTimelinesButtonTitle(prePackagedAssetsStatus, prePackagedTimelineStatus)} - </EuiButton> + <div> + <EuiButton + id={INSTALL_PREBUILT_RULES_ANCHOR} + fill={fill} + iconType="indexOpen" + isLoading={isLoading} + isDisabled={isDisabled} + onClick={onClick} + data-test-subj={dataTestSubj} + > + {getLoadRulesOrTimelinesButtonTitle(prePackagedAssetsStatus, prePackagedTimelineStatus)} + </EuiButton> + </div> ); } @@ -81,20 +88,26 @@ export const LoadPrePackagedRulesButton = ({ prePackagedTimelineStatus === 'someTimelineUninstall'; if (showUpdateButton) { + // Without the outer div EuiStepTour crashes with Uncaught DOMException: + // Failed to execute 'removeChild' on 'Node': The node to be removed is not + // a child of this node. return ( - <EuiButton - fill={fill} - iconType="plusInCircle" - isLoading={isLoading} - isDisabled={isDisabled} - onClick={onClick} - data-test-subj={dataTestSubj} - > - {getMissingRulesOrTimelinesButtonTitle( - prePackagedRulesStatus?.rules_not_installed ?? 0, - prePackagedRulesStatus?.timelines_not_installed ?? 0 - )} - </EuiButton> + <div> + <EuiButton + id={INSTALL_PREBUILT_RULES_ANCHOR} + fill={fill} + iconType="plusInCircle" + isLoading={isLoading} + isDisabled={isDisabled} + onClick={onClick} + data-test-subj={dataTestSubj} + > + {getMissingRulesOrTimelinesButtonTitle( + prePackagedRulesStatus?.rules_not_installed ?? 0, + prePackagedRulesStatus?.timelines_not_installed ?? 0 + )} + </EuiButton> + </div> ); } diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx index ce265ffb8382c..816c2963779f9 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx @@ -120,7 +120,7 @@ describe('RuleActionsOverflow', () => { fireEvent.click(getByTestId('rules-details-duplicate-rule')); expect(executeBulkAction).toHaveBeenCalledWith( - expect.objectContaining({ action: 'duplicate' }) + expect.objectContaining({ type: 'duplicate' }) ); }); @@ -139,9 +139,7 @@ describe('RuleActionsOverflow', () => { fireEvent.click(getByTestId('rules-details-popover-button-icon')); fireEvent.click(getByTestId('rules-details-duplicate-rule')); - expect(executeBulkAction).toHaveBeenCalledWith( - expect.objectContaining({ action: 'duplicate', search: { ids: ['id'] } }) - ); + expect(executeBulkAction).toHaveBeenCalledWith({ type: 'duplicate', ids: ['id'] }); }); }); @@ -213,7 +211,7 @@ describe('RuleActionsOverflow', () => { fireEvent.click(getByTestId('rules-details-popover-button-icon')); fireEvent.click(getByTestId('rules-details-delete-rule')); - expect(executeBulkAction).toHaveBeenCalledWith(expect.objectContaining({ action: 'delete' })); + expect(executeBulkAction).toHaveBeenCalledWith(expect.objectContaining({ type: 'delete' })); }); test('it calls deleteRulesAction with the rule.id when rules-details-delete-rule is clicked', () => { @@ -228,9 +226,7 @@ describe('RuleActionsOverflow', () => { fireEvent.click(getByTestId('rules-details-popover-button-icon')); fireEvent.click(getByTestId('rules-details-delete-rule')); - expect(executeBulkAction).toHaveBeenCalledWith( - expect.objectContaining({ action: 'delete', search: { ids: ['id'] } }) - ); + expect(executeBulkAction).toHaveBeenCalledWith({ type: 'delete', ids: ['id'] }); }); }); }); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.tsx index c2fc45d53e1d6..1281e67a49b71 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.tsx @@ -12,27 +12,23 @@ import { EuiPopover, EuiToolTip, } from '@elastic/eui'; -import { noop } from 'lodash'; import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; import { APP_UI_ID, SecurityPageName } from '../../../../../common/constants'; -import { BulkAction } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import { getRulesUrl } from '../../../../common/components/link_to/redirect_to_detection_engine'; -import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { useBoolState } from '../../../../common/hooks/use_bool_state'; import { SINGLE_RULE_ACTIONS } from '../../../../common/lib/apm/user_actions'; import { useStartTransaction } from '../../../../common/lib/apm/use_start_transaction'; import { useKibana } from '../../../../common/lib/kibana'; import { canEditRuleWithActions } from '../../../../common/utils/privileges'; import type { Rule } from '../../../../detection_engine/rule_management/logic'; -import { - downloadExportedRules, - useBulkExport, -} from '../../../../detection_engine/rule_management/logic/bulk_actions/use_bulk_export'; +import { useBulkExport } from '../../../../detection_engine/rule_management/logic/bulk_actions/use_bulk_export'; import { goToRuleEditPage, useExecuteBulkAction, } from '../../../../detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action'; +import { useDownloadExportedRules } from '../../../../detection_engine/rule_management/logic/bulk_actions/use_download_exported_rules'; import * as i18nActions from '../../../pages/detection_engine/rules/translations'; import * as i18n from './translations'; @@ -63,10 +59,10 @@ const RuleActionsOverflowComponent = ({ }: RuleActionsOverflowComponentProps) => { const [isPopoverOpen, , closePopover, togglePopover] = useBoolState(); const { navigateToApp } = useKibana().services.application; - const toasts = useAppToasts(); const { startTransaction } = useStartTransaction(); - const { executeBulkAction } = useExecuteBulkAction(); + const { executeBulkAction } = useExecuteBulkAction({ suppressSuccessToast: true }); const { bulkExport } = useBulkExport(); + const downloadExportedRules = useDownloadExportedRules(); const onRuleDeletedCallback = useCallback(() => { navigateToApp(APP_UI_ID, { @@ -88,9 +84,8 @@ const RuleActionsOverflowComponent = ({ startTransaction({ name: SINGLE_RULE_ACTIONS.DUPLICATE }); closePopover(); const result = await executeBulkAction({ - action: BulkAction.duplicate, - onSuccess: noop, - search: { ids: [rule.id] }, + type: BulkActionType.duplicate, + ids: [rule.id], }); const createdRules = result?.attributes.results.created; if (createdRules?.length) { @@ -117,12 +112,9 @@ const RuleActionsOverflowComponent = ({ onClick={async () => { startTransaction({ name: SINGLE_RULE_ACTIONS.EXPORT }); closePopover(); - const response = await bulkExport({ search: { ids: [rule.id] } }); + const response = await bulkExport({ ids: [rule.id] }); if (response) { - await downloadExportedRules({ - response, - toasts, - }); + await downloadExportedRules(response); } }} > @@ -137,10 +129,11 @@ const RuleActionsOverflowComponent = ({ startTransaction({ name: SINGLE_RULE_ACTIONS.DELETE }); closePopover(); await executeBulkAction({ - action: BulkAction.delete, - onSuccess: onRuleDeletedCallback, - search: { ids: [rule.id] }, + type: BulkActionType.delete, + ids: [rule.id], }); + + onRuleDeletedCallback(); }} > {i18nActions.DELETE_RULE} @@ -156,8 +149,8 @@ const RuleActionsOverflowComponent = ({ onRuleDeletedCallback, rule, startTransaction, - toasts, userHasPermissions, + downloadExportedRules, ] ); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/preview_histogram.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/preview_histogram.tsx index a16482c043343..af47d8db9cb6a 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/preview_histogram.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/preview_histogram.tsx @@ -85,6 +85,13 @@ export const PreviewHistogram = ({ [timeframeOptions] ); const endDate = useMemo(() => timeframeOptions.timeframeEnd.toISOString(), [timeframeOptions]); + // It seems like the Table/Grid component uses end date value as a non-inclusive one, + // thus the alerts which have timestamp equal to the end date value are not displayed in the table. + // To fix that, we extend end date value by 1s to make sure all alerts are included in the table. + const extendedEndDate = useMemo( + () => timeframeOptions.timeframeEnd.add('1', 's').toISOString(), + [timeframeOptions] + ); const isEqlRule = useMemo(() => ruleType === 'eql', [ruleType]); const isMlRule = useMemo(() => ruleType === 'machine_learning', [ruleType]); @@ -204,12 +211,8 @@ export const PreviewHistogram = ({ columns, deletedEventIds, disabledCellActions: FIELDS_WITHOUT_CELL_ACTIONS, - // Fix for https://github.com/elastic/kibana/issues/135511, until we start writing proper - // simulated @timestamp values to the preview alerts. The preview alerts will have @timestamp values - // close to the server's `now` time, but the client clock could be out of sync with the server. So we - // avoid computing static dates for this time range filter and instead pass in a small relative time window. - end: 'now+5m', - start: 'now-5m', + end: extendedEndDate, + start: startDate, entityType: 'events', filters: [], globalFullScreen, diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/index.tsx index bcd0e74d6ef9f..32db7db2d5093 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/index.tsx @@ -7,10 +7,9 @@ import type { EuiSwitchEvent } from '@elastic/eui'; import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiSwitch } from '@elastic/eui'; -import { noop } from 'lodash'; import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { BulkAction } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; +import { BulkActionType } from '../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import { SINGLE_RULE_ACTIONS } from '../../../../common/lib/apm/user_actions'; import { useStartTransaction } from '../../../../common/lib/apm/use_start_transaction'; import { useExecuteBulkAction } from '../../../../detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action'; @@ -46,7 +45,7 @@ export const RuleSwitchComponent = ({ const [myIsLoading, setMyIsLoading] = useState(false); const rulesTableContext = useRulesTableContextOptional(); const { startTransaction } = useStartTransaction(); - const { executeBulkAction } = useExecuteBulkAction(); + const { executeBulkAction } = useExecuteBulkAction({ suppressSuccessToast: !rulesTableContext }); const onRuleStateChange = useCallback( async (event: EuiSwitchEvent) => { @@ -55,11 +54,8 @@ export const RuleSwitchComponent = ({ name: enabled ? SINGLE_RULE_ACTIONS.DISABLE : SINGLE_RULE_ACTIONS.ENABLE, }); const bulkActionResponse = await executeBulkAction({ - setLoadingRules: rulesTableContext?.actions.setLoadingRules, - onSuccess: rulesTableContext ? undefined : noop, - action: event.target.checked ? BulkAction.enable : BulkAction.disable, - search: { ids: [id] }, - visibleRuleIds: [], + type: event.target.checked ? BulkActionType.enable : BulkActionType.disable, + ids: [id], }); if (bulkActionResponse?.attributes.results.updated.length) { // The rule was successfully updated @@ -67,7 +63,7 @@ export const RuleSwitchComponent = ({ } setMyIsLoading(false); }, - [enabled, executeBulkAction, id, onChange, rulesTableContext, startTransaction] + [enabled, executeBulkAction, id, onChange, startTransaction] ); const showLoader = useMemo((): boolean => { diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx index 01569edd6907d..52e96c088c200 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx @@ -18,7 +18,6 @@ import { isNewTermsRule, } from '../../../../../common/detection_engine/utils'; import type { FieldHook } from '../../../../shared_imports'; -import { useKibana } from '../../../../common/lib/kibana'; import * as i18n from './translations'; import { MlCardDescription } from './ml_card_description'; @@ -50,9 +49,6 @@ export const SelectRuleType: React.FC<SelectRuleTypeProps> = ({ const setThreshold = useCallback(() => setType('threshold'), [setType]); const setThreatMatch = useCallback(() => setType('threat_match'), [setType]); const setNewTerms = useCallback(() => setType('new_terms'), [setType]); - const licensingUrl = useKibana().services.application.getUrlForApp('kibana', { - path: '#/management/stack/license_management', - }); const eqlSelectableConfig = useMemo( () => ({ @@ -130,12 +126,7 @@ export const SelectRuleType: React.FC<SelectRuleTypeProps> = ({ data-test-subj="machineLearningRuleType" title={i18n.ML_TYPE_TITLE} titleSize="xs" - description={ - <MlCardDescription - subscriptionUrl={licensingUrl} - hasValidLicense={hasValidLicense} - /> - } + description={<MlCardDescription hasValidLicense={hasValidLicense} />} icon={<EuiIcon size="l" type="machineLearningApp" />} isDisabled={mlSelectableConfig.isDisabled && !mlSelectableConfig.isSelected} selectable={mlSelectableConfig} diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/ml_card_description.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/ml_card_description.tsx index 51ad3e1d83e96..f017bc2d52a8d 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/ml_card_description.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/ml_card_description.tsx @@ -13,7 +13,6 @@ import React from 'react'; import { ML_TYPE_DESCRIPTION } from './translations'; interface MlCardDescriptionProps { - subscriptionUrl: string; hasValidLicense?: boolean; } @@ -22,7 +21,6 @@ const SmallText = styled.span` `; const MlCardDescriptionComponent: React.FC<MlCardDescriptionProps> = ({ - subscriptionUrl, hasValidLicense = false, }) => ( <SmallText> @@ -34,7 +32,7 @@ const MlCardDescriptionComponent: React.FC<MlCardDescriptionProps> = ({ defaultMessage="Access to ML requires a {subscriptionsLink}." values={{ subscriptionsLink: ( - <EuiLink href={subscriptionUrl} target="_blank"> + <EuiLink href="https://www.elastic.co/subscriptions" target="_blank"> <FormattedMessage id="xpack.securitySolution.components.stepDefineRule.ruleTypeField.subscriptionsLink" defaultMessage="Platinum subscription" diff --git a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx index e6aa1b8efd1b6..6d93f5645b6e5 100644 --- a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx @@ -26,7 +26,7 @@ import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_exper import { NOT_FROM_ENDPOINT_HOST_TOOLTIP, HOST_ENDPOINT_UNENROLLED_TOOLTIP, -} from '../endpoint_responder/responder_context_menu_item'; +} from '../endpoint_responder/translations'; import { endpointMetadataHttpMocks } from '../../../management/pages/endpoint_hosts/mocks'; import type { HttpSetup } from '@kbn/core/public'; import { diff --git a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.tsx b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.tsx index f4364443a6dfa..f9d5a5bc998c0 100644 --- a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.tsx @@ -8,6 +8,8 @@ import React, { useCallback, useMemo, useState } from 'react'; import { EuiButton, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; import type { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; +import { GuidedOnboardingTourStep } from '../../../common/components/guided_onboarding_tour/tour_step'; +import { SecurityStepId } from '../../../common/components/guided_onboarding_tour/tour_config'; import { isActiveTimeline } from '../../../helpers'; import { TableId } from '../../../../common/types'; import { useResponderActionItem } from '../endpoint_responder'; @@ -252,19 +254,24 @@ export const TakeActionDropdown = React.memo( ] ); - const takeActionButton = useMemo(() => { - return ( - <EuiButton - data-test-subj="take-action-dropdown-btn" - fill - iconSide="right" - iconType="arrowDown" - onClick={togglePopoverHandler} - > - {TAKE_ACTION} - </EuiButton> - ); - }, [togglePopoverHandler]); + const takeActionButton = useMemo( + () => ( + <GuidedOnboardingTourStep step={4} stepId={SecurityStepId.alertsCases}> + <EuiButton + data-test-subj="take-action-dropdown-btn" + fill + iconSide="right" + iconType="arrowDown" + onClick={togglePopoverHandler} + > + {TAKE_ACTION} + </EuiButton> + </GuidedOnboardingTourStep> + ), + + [togglePopoverHandler] + ); + return items.length && !loadingEventDetails && ecsData ? ( <EuiPopover id="AlertTakeActionPanel" diff --git a/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.tsx b/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.tsx index 55a4c001685de..c5472cad9e7b0 100644 --- a/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.tsx +++ b/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.tsx @@ -6,7 +6,11 @@ */ import type { EuiDataGridCellValueElementProps } from '@elastic/eui'; -import React from 'react'; +import React, { useMemo } from 'react'; +import { GuidedOnboardingTourStep } from '../../../common/components/guided_onboarding_tour/tour_step'; +import { isDetectionsAlertsTable } from '../../../common/components/top_n/helpers'; +import { SecurityStepId } from '../../../common/components/guided_onboarding_tour/tour_config'; +import { SIGNAL_RULE_NAME_FIELD_NAME } from '../../../timelines/components/timeline/body/renderers/constants'; import { TimelineId } from '../../../../common/types'; import { useSourcererDataView } from '../../../common/containers/sourcerer'; import { SourcererScopeName } from '../../../common/store/sourcerer/model'; @@ -19,49 +23,28 @@ import { DefaultCellRenderer } from '../../../timelines/components/timeline/cell * accepts `EuiDataGridCellValueElementProps`, plus `data` * from the TGrid */ -export const RenderCellValue: React.FC< - EuiDataGridCellValueElementProps & CellValueElementProps -> = ({ - browserFields, - columnId, - data, - ecsData, - eventId, - globalFilters, - header, - isDetails, - isDraggable, - isExpandable, - isExpanded, - linkValues, - rowIndex, - colIndex, - rowRenderers, - setCellProps, - scopeId, - truncate, -}) => ( - <DefaultCellRenderer - browserFields={browserFields} - columnId={columnId} - data={data} - ecsData={ecsData} - eventId={eventId} - globalFilters={globalFilters} - header={header} - isDetails={isDetails} - isDraggable={isDraggable} - isExpandable={isExpandable} - isExpanded={isExpanded} - linkValues={linkValues} - rowIndex={rowIndex} - colIndex={colIndex} - rowRenderers={rowRenderers} - setCellProps={setCellProps} - scopeId={scopeId} - truncate={truncate} - /> -); +export const RenderCellValue: React.FC<EuiDataGridCellValueElementProps & CellValueElementProps> = ( + props +) => { + const { columnId, rowIndex, scopeId } = props; + const isTourAnchor = useMemo( + () => + columnId === SIGNAL_RULE_NAME_FIELD_NAME && + isDetectionsAlertsTable(scopeId) && + rowIndex === 0, + [columnId, rowIndex, scopeId] + ); + + return ( + <GuidedOnboardingTourStep + isTourAnchor={isTourAnchor} + step={1} + stepId={SecurityStepId.alertsCases} + > + <DefaultCellRenderer {...props} /> + </GuidedOnboardingTourStep> + ); +}; export const useRenderCellValue = ({ setFlyoutAlert, diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/alert_details_response.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/alert_details_response.ts new file mode 100644 index 0000000000000..67c5415fb2b26 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/alert_details_response.ts @@ -0,0 +1,2020 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { Ecs } from '../../../../../common/ecs'; + +// This data was generated using the endpoint test alert generator +export const getMockAlertDetailsFieldsResponse = () => ({ + _index: '.internal.alerts-security.alerts-default-000001', + _id: 'f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325', + _score: 1, + fields: { + 'kibana.alert.severity': ['medium'], + 'process.hash.md5': ['fake md5'], + 'kibana.alert.rule.updated_by': ['elastic'], + 'signal.ancestors.depth': [0], + 'event.category': ['malware'], + 'kibana.alert.rule.rule_name_override': ['message'], + 'Endpoint.capabilities': ['isolation', 'kill_process', 'suspend_process', 'running_processes'], + 'process.parent.pid': [1], + 'process.hash.sha256': ['fake sha256'], + 'host.hostname': ['Host-4cfuh42w7g'], + 'kibana.alert.rule.tags': ['Elastic', 'Endpoint Security'], + 'host.mac': ['f2-32-1b-dc-ec-80'], + 'elastic.agent.id': ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + 'dll.hash.sha256': ['8ad40c90a611d36eb8f9eb24fa04f7dbca713db383ff55a03aa0f382e92061a2'], + 'kibana.alert.ancestors.depth': [0], + 'signal.rule.enabled': ['true'], + 'signal.rule.max_signals': [10000], + 'host.os.version': ['10.0'], + 'signal.rule.updated_at': ['2022-09-29T19:39:38.137Z'], + 'kibana.alert.risk_score': [47], + 'Endpoint.policy.applied.id': ['C2A9093E-E289-4C0A-AA44-8C32A414FA7A'], + 'kibana.alert.rule.severity_mapping.severity': ['low', 'medium', 'high', 'critical'], + 'event.agent_id_status': ['auth_metadata_missing'], + 'kibana.alert.original_event.id': ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + 'kibana.alert.rule.risk_score_mapping.value': [''], + 'process.Ext.ancestry': ['kj0le842x0', '1r4s9i1br4'], + 'signal.original_event.code': ['memory_signature'], + 'kibana.alert.original_event.module': ['endpoint'], + 'kibana.alert.rule.interval': ['5m'], + 'kibana.alert.rule.type': ['query'], + 'signal.original_event.sequence': [1232], + 'Endpoint.state.isolation': [true], + 'host.architecture': ['x7n6yt4fol'], + 'kibana.alert.rule.immutable': ['true'], + 'kibana.alert.original_event.type': ['info'], + 'event.code': ['memory_signature'], + 'agent.id': ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + 'signal.original_event.module': ['endpoint'], + 'kibana.alert.rule.exceptions_list.list_id': ['endpoint_list'], + 'signal.rule.from': ['now-10m'], + 'kibana.alert.rule.exceptions_list.type': ['endpoint'], + 'process.group_leader.entity_id': ['b74mw1jkrm'], + 'dll.Ext.malware_classification.version': ['3.0.0'], + 'kibana.alert.rule.enabled': ['true'], + 'kibana.alert.rule.version': ['100'], + 'kibana.alert.ancestors.type': ['event'], + 'process.entry_leader.name': ['fake entry'], + 'dll.Ext.compile_time': [1534424710], + 'signal.ancestors.index': ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + 'dll.Ext.malware_classification.score': [0], + 'process.entity_id': ['d3v4to81q9'], + 'host.ip': ['10.184.3.36', '10.170.218.86'], + 'agent.type': ['endpoint'], + 'signal.original_event.category': ['malware'], + 'signal.original_event.id': ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + 'process.uptime': [0], + 'Endpoint.policy.applied.name': ['With Eventing'], + 'host.id': ['04794e4e-59cb-4c4a-a8ee-3e6c5b65743c'], + 'process.Ext.code_signature.subject_name': ['bad signer'], + 'process.Ext.token.integrity_level_name': ['high'], + 'signal.original_event.type': ['info'], + 'kibana.alert.rule.max_signals': [10000], + 'signal.rule.author': ['Elastic'], + 'kibana.alert.rule.risk_score': [47], + 'dll.Ext.malware_classification.identifier': ['Whitelisted'], + 'dll.Ext.mapped_address': [5362483200], + 'signal.original_event.dataset': ['endpoint'], + 'kibana.alert.rule.consumer': ['siem'], + 'kibana.alert.rule.indices': ['logs-endpoint.alerts-*'], + 'kibana.alert.rule.category': ['Custom Query Rule'], + 'host.os.Ext.variant': ['Windows Server'], + 'event.ingested': ['2022-09-29T19:37:00.000Z'], + 'event.action': ['start'], + 'signal.rule.updated_by': ['elastic'], + '@timestamp': ['2022-09-29T19:40:26.051Z'], + 'kibana.alert.original_event.action': ['start'], + 'host.os.platform': ['Windows'], + 'process.session_leader.entity_id': ['b74mw1jkrm'], + 'kibana.alert.rule.severity': ['medium'], + 'kibana.alert.original_event.agent_id_status': ['auth_metadata_missing'], + 'Endpoint.status': ['enrolled'], + 'data_stream.dataset': ['endpoint.alerts'], + 'signal.rule.timestamp_override': ['event.ingested'], + 'kibana.alert.rule.execution.uuid': ['abf39d36-0f1c-4bf9-ae42-1039285380b5'], + 'kibana.alert.uuid': ['f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325'], + 'kibana.version': ['8.6.0'], + 'process.hash.sha1': ['fake sha1'], + 'event.id': ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + 'process.entry_leader.pid': [865], + 'signal.rule.license': ['Elastic License v2'], + 'signal.ancestors.type': ['event'], + 'kibana.alert.rule.rule_id': ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + 'process.session_leader.pid': [745], + 'signal.rule.type': ['query'], + 'Endpoint.policy.applied.version': [5], + 'dll.hash.md5': ['1f2d082566b0fc5f2c238a5180db7451'], + 'kibana.alert.ancestors.id': ['7L3AioMBWJvcpv7vlX2O'], + 'user.name': ['root'], + 'source.ip': ['10.184.3.46'], + 'signal.rule.rule_name_override': ['message'], + 'process.group_leader.name': ['fake leader'], + 'host.os.full': ['Windows Server 2016'], + 'kibana.alert.original_event.code': ['memory_signature'], + 'kibana.alert.rule.risk_score_mapping.field': ['event.risk_score'], + 'kibana.alert.rule.description': [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + 'process.pid': [2], + 'kibana.alert.rule.producer': ['siem'], + 'kibana.alert.rule.to': ['now'], + 'signal.rule.interval': ['5m'], + 'signal.rule.created_by': ['elastic'], + 'kibana.alert.rule.created_by': ['elastic'], + 'kibana.alert.rule.timestamp_override': ['event.ingested'], + 'kibana.alert.original_event.ingested': ['2022-09-29T19:37:00.000Z'], + 'signal.rule.id': ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + 'process.parent.entity_id': ['kj0le842x0'], + 'signal.rule.risk_score': [47], + 'signal.reason': [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + 'host.os.name': ['Windows'], + 'kibana.alert.rule.name': ['Endpoint Security'], + 'host.name': ['Host-4cfuh42w7g'], + 'signal.status': ['open'], + 'event.kind': ['signal'], + 'kibana.alert.rule.severity_mapping.value': ['21', '47', '73', '99'], + 'signal.rule.tags': ['Elastic', 'Endpoint Security'], + 'signal.rule.created_at': ['2022-09-29T19:39:38.137Z'], + 'kibana.alert.workflow_status': ['open'], + 'Endpoint.policy.applied.status': ['warning'], + 'kibana.alert.rule.uuid': ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + 'kibana.alert.original_event.category': ['malware'], + 'dll.Ext.malware_classification.threshold': [0], + 'kibana.alert.reason': [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + 'dll.pe.architecture': ['x64'], + 'data_stream.type': ['logs'], + 'signal.original_time': ['2022-10-09T07:14:42.194Z'], + 'signal.ancestors.id': ['7L3AioMBWJvcpv7vlX2O'], + 'process.name': ['explorer.exe'], + 'ecs.version': ['1.6.0'], + 'signal.rule.severity': ['medium'], + 'kibana.alert.ancestors.index': ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + 'Endpoint.configuration.isolation': [true], + 'Memory_protection.feature': ['signature'], + 'dll.code_signature.trusted': [true], + 'process.Ext.code_signature.trusted': [false], + 'kibana.alert.depth': [1], + 'agent.version': ['8.6.0'], + 'kibana.alert.rule.risk_score_mapping.operator': ['equals'], + 'host.os.family': ['windows'], + 'kibana.alert.rule.from': ['now-10m'], + 'Memory_protection.self_injection': [true], + 'process.start': ['2022-10-09T07:14:42.194Z'], + 'kibana.alert.rule.parameters': [ + { + severity_mapping: [ + { + severity: 'low', + field: 'event.severity', + value: '21', + operator: 'equals', + }, + { + severity: 'medium', + field: 'event.severity', + value: '47', + operator: 'equals', + }, + { + severity: 'high', + field: 'event.severity', + value: '73', + operator: 'equals', + }, + { + severity: 'critical', + field: 'event.severity', + value: '99', + operator: 'equals', + }, + ], + references: [], + description: + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + language: 'kuery', + type: 'query', + rule_name_override: 'message', + exceptions_list: [ + { + list_id: 'endpoint_list', + namespace_type: 'agnostic', + id: 'endpoint_list', + type: 'endpoint', + }, + ], + timestamp_override: 'event.ingested', + from: 'now-10m', + severity: 'medium', + max_signals: 10000, + risk_score: 47, + risk_score_mapping: [ + { + field: 'event.risk_score', + value: '', + operator: 'equals', + }, + ], + author: ['Elastic'], + query: 'event.kind:alert and event.module:(endpoint and not endgame)\n', + index: ['logs-endpoint.alerts-*'], + version: 100, + rule_id: '9a1a2dae-0b5f-4c3d-8305-a268d404c306', + license: 'Elastic License v2', + required_fields: [ + { + ecs: true, + name: 'event.kind', + type: 'keyword', + }, + { + ecs: true, + name: 'event.module', + type: 'keyword', + }, + ], + immutable: true, + related_integrations: [], + setup: '', + false_positives: [], + threat: [], + to: 'now', + }, + ], + 'signal.rule.version': ['100'], + 'signal.original_event.kind': ['alert'], + 'kibana.alert.status': ['active'], + 'kibana.alert.rule.severity_mapping.field': [ + 'event.severity', + 'event.severity', + 'event.severity', + 'event.severity', + ], + 'kibana.alert.original_event.dataset': ['endpoint'], + 'signal.depth': [1], + 'signal.rule.immutable': ['true'], + 'process.group_leader.pid': [116], + 'event.sequence': [1232], + 'kibana.alert.rule.rule_type_id': ['siem.queryRule'], + 'process.session_leader.name': ['fake session'], + 'signal.rule.name': ['Endpoint Security'], + 'signal.rule.rule_id': ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + 'event.module': ['endpoint'], + 'dll.hash.sha1': ['ca85243c0af6a6471bdaa560685c51eefd6dbc0d'], + 'kibana.alert.rule.severity_mapping.operator': ['equals', 'equals', 'equals', 'equals'], + 'process.Ext.malware_signature.all_names': ['Windows.Trojan.FakeAgent'], + 'kibana.alert.rule.license': ['Elastic License v2'], + 'kibana.alert.original_event.kind': ['alert'], + 'process.executable': ['C:/fake/explorer.exe'], + 'kibana.alert.rule.updated_at': ['2022-09-29T19:39:38.137Z'], + 'signal.rule.description': [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + 'dll.Ext.mapped_size': [0], + 'data_stream.namespace': ['default'], + 'kibana.alert.rule.author': ['Elastic'], + 'dll.code_signature.subject_name': ['Cybereason Inc'], + 'Endpoint.policy.applied.endpoint_policy_version': [3], + 'kibana.alert.original_event.sequence': [1232], + 'dll.path': ['C:\\Program Files\\Cybereason ActiveProbe\\AmSvc.exe'], + 'process.Ext.user': ['SYSTEM'], + 'signal.original_event.action': ['start'], + 'signal.rule.to': ['now'], + 'kibana.alert.rule.created_at': ['2022-09-29T19:39:38.137Z'], + 'process.Ext.malware_signature.identifier': ['diagnostic-malware-signature-v1-fake'], + 'kibana.alert.rule.exceptions_list.namespace_type': ['agnostic'], + 'event.type': ['info'], + 'kibana.space_ids': ['default'], + 'process.entry_leader.entity_id': ['b74mw1jkrm'], + 'kibana.alert.rule.exceptions_list.id': ['endpoint_list'], + 'event.dataset': ['endpoint'], + 'kibana.alert.original_time': ['2022-10-09T07:14:42.194Z'], + }, +}); + +export const getMockAlertDetailsTimelineResponse = () => [ + { + category: 'kibana', + field: 'kibana.alert.severity', + values: ['medium'], + originalValue: ['medium'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.hash.md5', + values: ['fake md5'], + originalValue: ['fake md5'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.updated_by', + values: ['elastic'], + originalValue: ['elastic'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.ancestors.depth', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.category', + values: ['malware'], + originalValue: ['malware'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.rule_name_override', + values: ['message'], + originalValue: ['message'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.capabilities', + values: ['isolation', 'kill_process', 'suspend_process', 'running_processes'], + originalValue: ['isolation', 'kill_process', 'suspend_process', 'running_processes'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.parent.pid', + values: ['1'], + originalValue: ['1'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.hash.sha256', + values: ['fake sha256'], + originalValue: ['fake sha256'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.hostname', + values: ['Host-4cfuh42w7g'], + originalValue: ['Host-4cfuh42w7g'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.tags', + values: ['Elastic', 'Endpoint Security'], + originalValue: ['Elastic', 'Endpoint Security'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.mac', + values: ['f2-32-1b-dc-ec-80'], + originalValue: ['f2-32-1b-dc-ec-80'], + isObjectArray: false, + }, + { + category: 'elastic', + field: 'elastic.agent.id', + values: ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + originalValue: ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.hash.sha256', + values: ['8ad40c90a611d36eb8f9eb24fa04f7dbca713db383ff55a03aa0f382e92061a2'], + originalValue: ['8ad40c90a611d36eb8f9eb24fa04f7dbca713db383ff55a03aa0f382e92061a2'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.ancestors.depth', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.enabled', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.max_signals', + values: ['10000'], + originalValue: ['10000'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.version', + values: ['10.0'], + originalValue: ['10.0'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.updated_at', + values: ['2022-09-29T19:39:38.137Z'], + originalValue: ['2022-09-29T19:39:38.137Z'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.risk_score', + values: ['47'], + originalValue: ['47'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.policy.applied.id', + values: ['C2A9093E-E289-4C0A-AA44-8C32A414FA7A'], + originalValue: ['C2A9093E-E289-4C0A-AA44-8C32A414FA7A'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.severity_mapping.severity', + values: ['low', 'medium', 'high', 'critical'], + originalValue: ['low', 'medium', 'high', 'critical'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.agent_id_status', + values: ['auth_metadata_missing'], + originalValue: ['auth_metadata_missing'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.id', + values: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + originalValue: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.risk_score_mapping.value', + values: [''], + originalValue: [''], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.ancestry', + values: ['kj0le842x0', '1r4s9i1br4'], + originalValue: ['kj0le842x0', '1r4s9i1br4'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.code', + values: ['memory_signature'], + originalValue: ['memory_signature'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.module', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.interval', + values: ['5m'], + originalValue: ['5m'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.type', + values: ['query'], + originalValue: ['query'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.sequence', + values: ['1232'], + originalValue: ['1232'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.state.isolation', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.architecture', + values: ['x7n6yt4fol'], + originalValue: ['x7n6yt4fol'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.immutable', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.type', + values: ['info'], + originalValue: ['info'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.code', + values: ['memory_signature'], + originalValue: ['memory_signature'], + isObjectArray: false, + }, + { + category: 'agent', + field: 'agent.id', + values: ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + originalValue: ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.module', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.exceptions_list.list_id', + values: ['endpoint_list'], + originalValue: ['endpoint_list'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.from', + values: ['now-10m'], + originalValue: ['now-10m'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.exceptions_list.type', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.group_leader.entity_id', + values: ['b74mw1jkrm'], + originalValue: ['b74mw1jkrm'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.malware_classification.version', + values: ['3.0.0'], + originalValue: ['3.0.0'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.enabled', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.version', + values: ['100'], + originalValue: ['100'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.ancestors.type', + values: ['event'], + originalValue: ['event'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.entry_leader.name', + values: ['fake entry'], + originalValue: ['fake entry'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.compile_time', + values: ['1534424710'], + originalValue: ['1534424710'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.ancestors.index', + values: ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + originalValue: ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.malware_classification.score', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.entity_id', + values: ['d3v4to81q9'], + originalValue: ['d3v4to81q9'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.ip', + values: ['10.184.3.36', '10.170.218.86'], + originalValue: ['10.184.3.36', '10.170.218.86'], + isObjectArray: false, + }, + { + category: 'agent', + field: 'agent.type', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.category', + values: ['malware'], + originalValue: ['malware'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.id', + values: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + originalValue: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.uptime', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.policy.applied.name', + values: ['With Eventing'], + originalValue: ['With Eventing'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.id', + values: ['04794e4e-59cb-4c4a-a8ee-3e6c5b65743c'], + originalValue: ['04794e4e-59cb-4c4a-a8ee-3e6c5b65743c'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.code_signature.subject_name', + values: ['bad signer'], + originalValue: ['bad signer'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.token.integrity_level_name', + values: ['high'], + originalValue: ['high'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.type', + values: ['info'], + originalValue: ['info'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.max_signals', + values: ['10000'], + originalValue: ['10000'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.author', + values: ['Elastic'], + originalValue: ['Elastic'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.risk_score', + values: ['47'], + originalValue: ['47'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.malware_classification.identifier', + values: ['Whitelisted'], + originalValue: ['Whitelisted'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.mapped_address', + values: ['5362483200'], + originalValue: ['5362483200'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.dataset', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.consumer', + values: ['siem'], + originalValue: ['siem'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.indices', + values: ['logs-endpoint.alerts-*'], + originalValue: ['logs-endpoint.alerts-*'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.category', + values: ['Custom Query Rule'], + originalValue: ['Custom Query Rule'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.Ext.variant', + values: ['Windows Server'], + originalValue: ['Windows Server'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.ingested', + values: ['2022-09-29T19:37:00.000Z'], + originalValue: ['2022-09-29T19:37:00.000Z'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.action', + values: ['start'], + originalValue: ['start'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.updated_by', + values: ['elastic'], + originalValue: ['elastic'], + isObjectArray: false, + }, + { + category: 'base', + field: '@timestamp', + values: ['2022-09-29T19:40:26.051Z'], + originalValue: ['2022-09-29T19:40:26.051Z'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.action', + values: ['start'], + originalValue: ['start'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.platform', + values: ['Windows'], + originalValue: ['Windows'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.session_leader.entity_id', + values: ['b74mw1jkrm'], + originalValue: ['b74mw1jkrm'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.severity', + values: ['medium'], + originalValue: ['medium'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.agent_id_status', + values: ['auth_metadata_missing'], + originalValue: ['auth_metadata_missing'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.status', + values: ['enrolled'], + originalValue: ['enrolled'], + isObjectArray: false, + }, + { + category: 'data_stream', + field: 'data_stream.dataset', + values: ['endpoint.alerts'], + originalValue: ['endpoint.alerts'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.timestamp_override', + values: ['event.ingested'], + originalValue: ['event.ingested'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.execution.uuid', + values: ['abf39d36-0f1c-4bf9-ae42-1039285380b5'], + originalValue: ['abf39d36-0f1c-4bf9-ae42-1039285380b5'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.uuid', + values: ['f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325'], + originalValue: ['f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.version', + values: ['8.6.0'], + originalValue: ['8.6.0'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.hash.sha1', + values: ['fake sha1'], + originalValue: ['fake sha1'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.id', + values: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + originalValue: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.entry_leader.pid', + values: ['865'], + originalValue: ['865'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.license', + values: ['Elastic License v2'], + originalValue: ['Elastic License v2'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.ancestors.type', + values: ['event'], + originalValue: ['event'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.rule_id', + values: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + originalValue: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.session_leader.pid', + values: ['745'], + originalValue: ['745'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.type', + values: ['query'], + originalValue: ['query'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.policy.applied.version', + values: ['5'], + originalValue: ['5'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.hash.md5', + values: ['1f2d082566b0fc5f2c238a5180db7451'], + originalValue: ['1f2d082566b0fc5f2c238a5180db7451'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.ancestors.id', + values: ['7L3AioMBWJvcpv7vlX2O'], + originalValue: ['7L3AioMBWJvcpv7vlX2O'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.rule_name_override', + values: ['message'], + originalValue: ['message'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.group_leader.name', + values: ['fake leader'], + originalValue: ['fake leader'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.full', + values: ['Windows Server 2016'], + originalValue: ['Windows Server 2016'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.code', + values: ['memory_signature'], + originalValue: ['memory_signature'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.risk_score_mapping.field', + values: ['event.risk_score'], + originalValue: ['event.risk_score'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.description', + values: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + originalValue: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.pid', + values: ['2'], + originalValue: ['2'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.producer', + values: ['siem'], + originalValue: ['siem'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.to', + values: ['now'], + originalValue: ['now'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.interval', + values: ['5m'], + originalValue: ['5m'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.created_by', + values: ['elastic'], + originalValue: ['elastic'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.created_by', + values: ['elastic'], + originalValue: ['elastic'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.timestamp_override', + values: ['event.ingested'], + originalValue: ['event.ingested'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.ingested', + values: ['2022-09-29T19:37:00.000Z'], + originalValue: ['2022-09-29T19:37:00.000Z'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.id', + values: ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + originalValue: ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.parent.entity_id', + values: ['kj0le842x0'], + originalValue: ['kj0le842x0'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.risk_score', + values: ['47'], + originalValue: ['47'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.reason', + values: [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + originalValue: [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.name', + values: ['Windows'], + originalValue: ['Windows'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.name', + values: ['Endpoint Security'], + originalValue: ['Endpoint Security'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.name', + values: ['Host-4cfuh42w7g'], + originalValue: ['Host-4cfuh42w7g'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.status', + values: ['open'], + originalValue: ['open'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.kind', + values: ['signal'], + originalValue: ['signal'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.severity_mapping.value', + values: ['21', '47', '73', '99'], + originalValue: ['21', '47', '73', '99'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.tags', + values: ['Elastic', 'Endpoint Security'], + originalValue: ['Elastic', 'Endpoint Security'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.created_at', + values: ['2022-09-29T19:39:38.137Z'], + originalValue: ['2022-09-29T19:39:38.137Z'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.workflow_status', + values: ['open'], + originalValue: ['open'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.policy.applied.status', + values: ['warning'], + originalValue: ['warning'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.uuid', + values: ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + originalValue: ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.category', + values: ['malware'], + originalValue: ['malware'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.malware_classification.threshold', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.reason', + values: [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + originalValue: [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.pe.architecture', + values: ['x64'], + originalValue: ['x64'], + isObjectArray: false, + }, + { + category: 'data_stream', + field: 'data_stream.type', + values: ['logs'], + originalValue: ['logs'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_time', + values: ['2022-10-09T07:14:42.194Z'], + originalValue: ['2022-10-09T07:14:42.194Z'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.ancestors.id', + values: ['7L3AioMBWJvcpv7vlX2O'], + originalValue: ['7L3AioMBWJvcpv7vlX2O'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.name', + values: ['explorer.exe'], + originalValue: ['explorer.exe'], + isObjectArray: false, + }, + { + category: 'ecs', + field: 'ecs.version', + values: ['1.6.0'], + originalValue: ['1.6.0'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.severity', + values: ['medium'], + originalValue: ['medium'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.ancestors.index', + values: ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + originalValue: ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.configuration.isolation', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'Memory_protection', + field: 'Memory_protection.feature', + values: ['signature'], + originalValue: ['signature'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.code_signature.trusted', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.code_signature.trusted', + values: ['false'], + originalValue: ['false'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.depth', + values: ['1'], + originalValue: ['1'], + isObjectArray: false, + }, + { + category: 'agent', + field: 'agent.version', + values: ['8.6.0'], + originalValue: ['8.6.0'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.risk_score_mapping.operator', + values: ['equals'], + originalValue: ['equals'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.family', + values: ['windows'], + originalValue: ['windows'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.from', + values: ['now-10m'], + originalValue: ['now-10m'], + isObjectArray: false, + }, + { + category: 'Memory_protection', + field: 'Memory_protection.self_injection', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.start', + values: ['2022-10-09T07:14:42.194Z'], + originalValue: ['2022-10-09T07:14:42.194Z'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.severity_mapping.severity', + values: ['low', 'medium', 'high', 'critical'], + originalValue: ['low', 'medium', 'high', 'critical'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.severity_mapping.field', + values: ['event.severity'], + originalValue: ['event.severity'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.severity_mapping.value', + values: ['21', '47', '73', '99'], + originalValue: ['21', '47', '73', '99'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.severity_mapping.operator', + values: ['equals'], + originalValue: ['equals'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.references', + values: [], + originalValue: [], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.description', + values: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + originalValue: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.language', + values: ['kuery'], + originalValue: ['kuery'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.type', + values: ['query'], + originalValue: ['query'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.rule_name_override', + values: ['message'], + originalValue: ['message'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.exceptions_list.list_id', + values: ['endpoint_list'], + originalValue: ['endpoint_list'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.exceptions_list.namespace_type', + values: ['agnostic'], + originalValue: ['agnostic'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.exceptions_list.id', + values: ['endpoint_list'], + originalValue: ['endpoint_list'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.exceptions_list.type', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.timestamp_override', + values: ['event.ingested'], + originalValue: ['event.ingested'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.from', + values: ['now-10m'], + originalValue: ['now-10m'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.severity', + values: ['medium'], + originalValue: ['medium'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.max_signals', + values: ['10000'], + originalValue: ['10000'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.risk_score', + values: ['47'], + originalValue: ['47'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.risk_score_mapping.field', + values: ['event.risk_score'], + originalValue: ['event.risk_score'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.risk_score_mapping.value', + values: [''], + originalValue: [''], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.risk_score_mapping.operator', + values: ['equals'], + originalValue: ['equals'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.author', + values: ['Elastic'], + originalValue: ['Elastic'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.query', + values: ['event.kind:alert and event.module:(endpoint and not endgame)\n'], + originalValue: ['event.kind:alert and event.module:(endpoint and not endgame)\n'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.index', + values: ['logs-endpoint.alerts-*'], + originalValue: ['logs-endpoint.alerts-*'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.version', + values: ['100'], + originalValue: ['100'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.rule_id', + values: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + originalValue: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.license', + values: ['Elastic License v2'], + originalValue: ['Elastic License v2'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.required_fields.ecs', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.required_fields.name', + values: ['event.kind', 'event.module'], + originalValue: ['event.kind', 'event.module'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.required_fields.type', + values: ['keyword'], + originalValue: ['keyword'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.immutable', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.related_integrations', + values: [], + originalValue: [], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.setup', + values: [''], + originalValue: [''], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.false_positives', + values: [], + originalValue: [], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.threat', + values: [], + originalValue: [], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.to', + values: ['now'], + originalValue: ['now'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.version', + values: ['100'], + originalValue: ['100'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.kind', + values: ['alert'], + originalValue: ['alert'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.status', + values: ['active'], + originalValue: ['active'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.severity_mapping.field', + values: ['event.severity', 'event.severity', 'event.severity', 'event.severity'], + originalValue: ['event.severity', 'event.severity', 'event.severity', 'event.severity'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.dataset', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.depth', + values: ['1'], + originalValue: ['1'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.immutable', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.group_leader.pid', + values: ['116'], + originalValue: ['116'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.sequence', + values: ['1232'], + originalValue: ['1232'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.rule_type_id', + values: ['siem.queryRule'], + originalValue: ['siem.queryRule'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.session_leader.name', + values: ['fake session'], + originalValue: ['fake session'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.name', + values: ['Endpoint Security'], + originalValue: ['Endpoint Security'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.rule_id', + values: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + originalValue: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.module', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.hash.sha1', + values: ['ca85243c0af6a6471bdaa560685c51eefd6dbc0d'], + originalValue: ['ca85243c0af6a6471bdaa560685c51eefd6dbc0d'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.severity_mapping.operator', + values: ['equals', 'equals', 'equals', 'equals'], + originalValue: ['equals', 'equals', 'equals', 'equals'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.malware_signature.all_names', + values: ['Windows.Trojan.FakeAgent'], + originalValue: ['Windows.Trojan.FakeAgent'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.license', + values: ['Elastic License v2'], + originalValue: ['Elastic License v2'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.kind', + values: ['alert'], + originalValue: ['alert'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.executable', + values: ['C:/fake/explorer.exe'], + originalValue: ['C:/fake/explorer.exe'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.updated_at', + values: ['2022-09-29T19:39:38.137Z'], + originalValue: ['2022-09-29T19:39:38.137Z'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.description', + values: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + originalValue: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.mapped_size', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'data_stream', + field: 'data_stream.namespace', + values: ['default'], + originalValue: ['default'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.author', + values: ['Elastic'], + originalValue: ['Elastic'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.code_signature.subject_name', + values: ['Cybereason Inc'], + originalValue: ['Cybereason Inc'], + isObjectArray: false, + }, + { + category: 'user', + field: 'user.name', + values: ['root'], + originalValue: ['root'], + isObjectArray: false, + }, + { + category: 'source', + field: 'source.ip', + values: ['10.184.3.46'], + originalValue: ['10.184.3.46'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.policy.applied.endpoint_policy_version', + values: ['3'], + originalValue: ['3'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.sequence', + values: ['1232'], + originalValue: ['1232'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.path', + values: ['C:\\Program Files\\Cybereason ActiveProbe\\AmSvc.exe'], + originalValue: ['C:\\Program Files\\Cybereason ActiveProbe\\AmSvc.exe'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.user', + values: ['SYSTEM'], + originalValue: ['SYSTEM'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.action', + values: ['start'], + originalValue: ['start'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.to', + values: ['now'], + originalValue: ['now'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.created_at', + values: ['2022-09-29T19:39:38.137Z'], + originalValue: ['2022-09-29T19:39:38.137Z'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.malware_signature.identifier', + values: ['diagnostic-malware-signature-v1-fake'], + originalValue: ['diagnostic-malware-signature-v1-fake'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.exceptions_list.namespace_type', + values: ['agnostic'], + originalValue: ['agnostic'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.type', + values: ['info'], + originalValue: ['info'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.space_ids', + values: ['default'], + originalValue: ['default'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.entry_leader.entity_id', + values: ['b74mw1jkrm'], + originalValue: ['b74mw1jkrm'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.exceptions_list.id', + values: ['endpoint_list'], + originalValue: ['endpoint_list'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.dataset', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_time', + values: ['2022-10-09T07:14:42.194Z'], + originalValue: ['2022-10-09T07:14:42.194Z'], + isObjectArray: false, + }, + { + category: '_index', + field: '_index', + values: ['.internal.alerts-security.alerts-default-000001'], + originalValue: ['.internal.alerts-security.alerts-default-000001'], + isObjectArray: false, + }, + { + category: '_id', + field: '_id', + values: ['f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325'], + originalValue: ['f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325'], + isObjectArray: false, + }, + { + category: '_score', + field: '_score', + values: ['1'], + originalValue: ['1'], + isObjectArray: false, + }, +]; + +export const getMockAlertNestedDetailsTimelineResponse = (): Ecs => ({ + _id: 'f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325', + timestamp: '2022-09-29T19:40:26.051Z', + _index: '.internal.alerts-security.alerts-default-000001', + kibana: { + alert: { + rule: { + from: ['now-10m'], + name: ['Endpoint Security'], + to: ['now'], + uuid: ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + type: ['query'], + version: ['100'], + parameters: {}, + }, + workflow_status: ['open'], + original_time: ['2022-10-09T07:14:42.194Z'], + severity: ['medium'], + }, + }, + event: { + code: ['memory_signature'], + module: ['endpoint'], + action: ['start'], + category: ['malware'], + dataset: ['endpoint'], + id: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + kind: ['signal'], + type: ['info'], + }, + host: { + name: ['Host-4cfuh42w7g'], + os: { + family: ['windows'], + name: ['Windows'], + }, + id: ['04794e4e-59cb-4c4a-a8ee-3e6c5b65743c'], + ip: ['10.184.3.36', '10.170.218.86'], + }, + source: { + ip: ['10.184.3.46'], + }, + agent: { + type: ['endpoint'], + id: ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + }, + process: { + hash: { + md5: ['fake md5'], + sha1: ['fake sha1'], + sha256: ['fake sha256'], + }, + parent: { + pid: [1], + }, + pid: [2], + name: ['explorer.exe'], + entity_id: ['d3v4to81q9'], + executable: ['C:/fake/explorer.exe'], + entry_leader: { + entity_id: ['b74mw1jkrm'], + name: ['fake entry'], + pid: ['865'], + }, + session_leader: { + entity_id: ['b74mw1jkrm'], + name: ['fake session'], + pid: ['745'], + }, + group_leader: { + entity_id: ['b74mw1jkrm'], + name: ['fake leader'], + pid: ['116'], + }, + }, + user: { + name: ['root'], + }, +}); + +export const mockAlertDetailsFieldsResponse = getMockAlertDetailsFieldsResponse(); + +export const mockAlertDetailsTimelineResponse = getMockAlertDetailsTimelineResponse(); + +export const mockAlertNestedDetailsTimelineResponse = getMockAlertNestedDetailsTimelineResponse(); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/index.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/index.ts new file mode 100644 index 0000000000000..0771ffa5ccf9f --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/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 './alert_details_response'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/error_page.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/error_page.tsx new file mode 100644 index 0000000000000..c050118a848d3 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/error_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 { EuiCode, EuiEmptyPrompt } from '@elastic/eui'; +import { ERROR_PAGE_TITLE, ERROR_PAGE_BODY } from '../translations'; + +export const AlertDetailsErrorPage = memo(({ eventId }: { eventId: string }) => { + return ( + <EuiEmptyPrompt + color="danger" + data-test-subj="alert-details-page-error" + iconType="alert" + title={<h2>{ERROR_PAGE_TITLE}</h2>} + body={ + <div> + <p>{ERROR_PAGE_BODY}</p> + <p> + <EuiCode + style={{ wordWrap: 'break-word', overflowWrap: 'break-word' }} + >{`_id: ${eventId}`}</EuiCode> + </p> + </div> + } + /> + ); +}); + +AlertDetailsErrorPage.displayName = 'AlertDetailsErrorPage'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/header.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/header.tsx new file mode 100644 index 0000000000000..f87162eba4533 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/header.tsx @@ -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 React from 'react'; +import { PreferenceFormattedDate } from '../../../../common/components/formatted_date'; +import { HeaderPage } from '../../../../common/components/header_page'; + +interface AlertDetailsHeaderProps { + loading: boolean; + ruleName?: string; + timestamp?: string; +} + +export const AlertDetailsHeader = React.memo( + ({ loading, ruleName, timestamp }: AlertDetailsHeaderProps) => { + return ( + <HeaderPage + badgeOptions={{ beta: true, text: 'Beta' }} + border + isLoading={loading} + subtitle={timestamp ? <PreferenceFormattedDate value={new Date(timestamp)} /> : ''} + title={ruleName} + /> + ); + } +); + +AlertDetailsHeader.displayName = 'AlertDetailsHeader'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/loading_page.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/loading_page.tsx new file mode 100644 index 0000000000000..ee24b2e636874 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/loading_page.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, { memo } from 'react'; +import { EuiEmptyPrompt, EuiLoadingSpinner } from '@elastic/eui'; +import { LOADING_PAGE_MESSAGE } from '../translations'; + +export const AlertDetailsLoadingPage = memo(({ eventId }: { eventId: string }) => ( + <EuiEmptyPrompt + data-test-subj="alert-details-page-loading" + color="subdued" + icon={<EuiLoadingSpinner data-test-subj="loading-spinner" size="l" />} + body={<p>{LOADING_PAGE_MESSAGE}</p>} + /> +)); + +AlertDetailsLoadingPage.displayName = 'AlertDetailsLoadingPage'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.test.tsx new file mode 100644 index 0000000000000..bee3abe3bc156 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.test.tsx @@ -0,0 +1,144 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { Router, useParams } from 'react-router-dom'; +import { render } from '@testing-library/react'; +import { AlertDetailsPage } from '.'; +import { TestProviders } from '../../../common/mock'; +import { + mockAlertDetailsFieldsResponse, + mockAlertDetailsTimelineResponse, + mockAlertNestedDetailsTimelineResponse, +} from './__mocks__'; +import { ALERT_RULE_NAME } from '@kbn/rule-data-utils'; +import { useTimelineEventsDetails } from '../../../timelines/containers/details'; + +// Node modules mocks +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useParams: jest.fn(), +})); + +const mockDispatch = jest.fn(); +jest.mock('react-redux', () => ({ + ...jest.requireActual('react-redux'), + useDispatch: () => mockDispatch, +})); + +(useParams as jest.Mock).mockReturnValue(mockAlertDetailsFieldsResponse._id); + +// Internal Mocks +jest.mock('../../../timelines/containers/details'); +jest.mock('../../../timelines/store/timeline', () => ({ + ...jest.requireActual('../../../timelines/store/timeline'), + timelineActions: { + createTimeline: jest.fn().mockReturnValue('new-timeline'), + }, +})); + +jest.mock('../../../common/containers/sourcerer', () => { + const mockSourcererReturn = { + browserFields: {}, + loading: true, + indexPattern: {}, + selectedPatterns: [], + missingPatterns: [], + }; + return { + useSourcererDataView: jest.fn().mockReturnValue(mockSourcererReturn), + }; +}); + +type Action = 'PUSH' | 'POP' | 'REPLACE'; +const pop: Action = 'POP'; +const getMockHistory = () => ({ + length: 1, + location: { + pathname: `/alerts/${mockAlertDetailsFieldsResponse._id}/summary`, + search: '', + state: '', + hash: '', + }, + action: pop, + push: jest.fn(), + replace: jest.fn(), + go: jest.fn(), + goBack: jest.fn(), + goForward: jest.fn(), + block: jest.fn(), + createHref: jest.fn(), + listen: jest.fn(), +}); + +describe('Alert Details Page', () => { + it('should render the loading page', () => { + (useTimelineEventsDetails as jest.Mock).mockReturnValue([true, null, null, null, jest.fn()]); + const { getByTestId } = render( + <TestProviders> + <Router history={getMockHistory()}> + <AlertDetailsPage /> + </Router> + </TestProviders> + ); + + expect(getByTestId('alert-details-page-loading')).toBeVisible(); + }); + + it('should render the error page', () => { + (useTimelineEventsDetails as jest.Mock).mockReturnValue([false, null, null, null, jest.fn()]); + const { getByTestId } = render( + <TestProviders> + <Router history={getMockHistory()}> + <AlertDetailsPage /> + </Router> + </TestProviders> + ); + + expect(getByTestId('alert-details-page-error')).toBeVisible(); + }); + + it('should render the header', () => { + (useTimelineEventsDetails as jest.Mock).mockReturnValue([ + false, + mockAlertDetailsTimelineResponse, + mockAlertDetailsFieldsResponse, + mockAlertNestedDetailsTimelineResponse, + jest.fn(), + ]); + const { getByTestId } = render( + <TestProviders> + <Router history={getMockHistory()}> + <AlertDetailsPage /> + </Router> + </TestProviders> + ); + + expect(getByTestId('header-page-title')).toHaveTextContent( + mockAlertDetailsFieldsResponse.fields[ALERT_RULE_NAME][0] + ); + }); + + it('should create a timeline', () => { + (useTimelineEventsDetails as jest.Mock).mockReturnValue([ + false, + mockAlertDetailsTimelineResponse, + mockAlertDetailsFieldsResponse, + mockAlertNestedDetailsTimelineResponse, + jest.fn(), + ]); + render( + <TestProviders> + <Router history={getMockHistory()}> + <AlertDetailsPage /> + </Router> + </TestProviders> + ); + + expect(mockDispatch).toHaveBeenCalledWith('new-timeline'); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.tsx new file mode 100644 index 0000000000000..530c00532bbb5 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.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 React, { memo, useEffect, useMemo } from 'react'; +import { Switch, useParams } from 'react-router-dom'; +import { Route } from '@kbn/kibana-react-plugin/public'; +import { ALERT_RULE_NAME, TIMESTAMP } from '@kbn/rule-data-utils'; +import { EuiSpacer } from '@elastic/eui'; +import { useDispatch } from 'react-redux'; +import { timelineActions } from '../../../timelines/store/timeline'; +import { TimelineId } from '../../../../common/types'; +import { useGetFieldsData } from '../../../common/hooks/use_get_fields_data'; +import { useSourcererDataView } from '../../../common/containers/sourcerer'; +import { SourcererScopeName } from '../../../common/store/sourcerer/model'; +import { SpyRoute } from '../../../common/utils/route/spy_routes'; +import { getAlertDetailsTabUrl } from '../../../common/components/link_to'; +import { AlertDetailRouteType } from './types'; +import { SecuritySolutionTabNavigation } from '../../../common/components/navigation'; +import { getAlertDetailsNavTabs } from './utils/navigation'; +import { SecurityPageName } from '../../../../common/constants'; +import { eventID } from '../../../../common/endpoint/models/event'; +import { useTimelineEventsDetails } from '../../../timelines/containers/details'; +import { AlertDetailsLoadingPage } from './components/loading_page'; +import { AlertDetailsErrorPage } from './components/error_page'; +import { AlertDetailsHeader } from './components/header'; +import { DetailsSummaryTab } from './tabs/summary'; + +export const AlertDetailsPage = memo(() => { + const { detailName: eventId } = useParams<{ detailName: string }>(); + const dispatch = useDispatch(); + const sourcererDataView = useSourcererDataView(SourcererScopeName.detections); + const indexName = useMemo( + () => sourcererDataView.selectedPatterns.join(','), + [sourcererDataView.selectedPatterns] + ); + + const [loading, detailsData, searchHit, dataAsNestedObject] = useTimelineEventsDetails({ + indexName, + eventId, + runtimeMappings: sourcererDataView.runtimeMappings, + skip: !eventID, + }); + const dataNotFound = !loading && !detailsData; + const hasData = !loading && detailsData; + + // Example of using useGetFieldsData. Only place it is used currently + const getFieldsData = useGetFieldsData(searchHit?.fields); + const timestamp = getFieldsData(TIMESTAMP) as string | undefined; + const ruleName = getFieldsData(ALERT_RULE_NAME) as string | undefined; + + useEffect(() => { + // TODO: move detail panel to it's own redux state + dispatch( + timelineActions.createTimeline({ + id: TimelineId.detectionsAlertDetailsPage, + columns: [], + dataViewId: null, + indexNames: [], + expandedDetail: {}, + show: false, + }) + ); + }, [dispatch]); + + return ( + <> + {loading && <AlertDetailsLoadingPage eventId={eventId} />} + {dataNotFound && <AlertDetailsErrorPage eventId={eventId} />} + {hasData && ( + <> + <AlertDetailsHeader loading={loading} ruleName={ruleName} timestamp={timestamp} /> + <SecuritySolutionTabNavigation navTabs={getAlertDetailsNavTabs(eventId)} /> + <EuiSpacer size="l" /> + <Switch> + <Route exact path={getAlertDetailsTabUrl(eventId, AlertDetailRouteType.summary)}> + <DetailsSummaryTab + eventId={eventId} + dataAsNestedObject={dataAsNestedObject} + detailsData={detailsData} + sourcererDataView={sourcererDataView} + /> + </Route> + </Switch> + </> + )} + <SpyRoute pageName={SecurityPageName.alerts} state={{ ruleName }} /> + </> + ); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/alert_render_panel.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/alert_render_panel.test.tsx new file mode 100644 index 0000000000000..c3952801e5ca4 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/alert_render_panel.test.tsx @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { get } from 'lodash/fp'; +import { render } from '@testing-library/react'; +import { AlertRendererPanel } from '.'; +import { TestProviders } from '../../../../../../common/mock'; +import { mockAlertNestedDetailsTimelineResponse } from '../../../__mocks__'; +import { ALERT_RENDERER_FIELDS } from '../../../../../../timelines/components/timeline/body/renderers/alert_renderer'; + +describe('AlertDetailsPage - SummaryTab - AlertRendererPanel', () => { + it('should render the reason renderer', () => { + const { getByTestId } = render( + <TestProviders> + <AlertRendererPanel dataAsNestedObject={mockAlertNestedDetailsTimelineResponse} /> + </TestProviders> + ); + + expect(getByTestId('alert-renderer-panel')).toBeVisible(); + }); + + it('should render the render the expected values', () => { + const { getByTestId } = render( + <TestProviders> + <AlertRendererPanel dataAsNestedObject={mockAlertNestedDetailsTimelineResponse} /> + </TestProviders> + ); + const alertRendererPanelPanel = getByTestId('alert-renderer-panel'); + + ALERT_RENDERER_FIELDS.forEach((rendererField) => { + const fieldValues: string[] | null = get( + rendererField, + mockAlertNestedDetailsTimelineResponse + ); + if (fieldValues && fieldValues.length > 0) { + fieldValues.forEach((value) => { + expect(alertRendererPanelPanel).toHaveTextContent(value); + }); + } + }); + }); + + it('should not render the reason renderer if data is not provided', () => { + const { queryByTestId } = render( + <TestProviders> + <AlertRendererPanel dataAsNestedObject={null} /> + </TestProviders> + ); + + expect(queryByTestId('alert-renderer-panel')).toBeNull(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/index.tsx new file mode 100644 index 0000000000000..b5de487aa587b --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/index.tsx @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import styled from 'styled-components'; +import { defaultRowRenderers } from '../../../../../../timelines/components/timeline/body/renderers'; +import { getRowRenderer } from '../../../../../../timelines/components/timeline/body/renderers/get_row_renderer'; +import { TimelineId } from '../../../../../../../common/types'; +import { SummaryPanel } from '../wrappers'; +import { ALERT_REASON_PANEL_TITLE } from '../translation'; +import type { Ecs } from '../../../../../../../common/ecs'; + +export interface AlertRendererPanelProps { + dataAsNestedObject: Ecs | null; +} + +const RendererContainer = styled.div` + overflow-x: auto; + + & .euiFlexGroup { + justify-content: flex-start; + } +`; + +export const AlertRendererPanel = React.memo(({ dataAsNestedObject }: AlertRendererPanelProps) => { + const renderer = useMemo( + () => + dataAsNestedObject != null + ? getRowRenderer({ data: dataAsNestedObject, rowRenderers: defaultRowRenderers }) + : null, + [dataAsNestedObject] + ); + + return ( + <SummaryPanel title={ALERT_REASON_PANEL_TITLE}> + {renderer != null && dataAsNestedObject != null && ( + <div> + <RendererContainer data-test-subj="alert-renderer-panel"> + {renderer.renderRow({ + data: dataAsNestedObject, + isDraggable: false, + scopeId: TimelineId.detectionsAlertDetailsPage, + })} + </RendererContainer> + </div> + )} + </SummaryPanel> + ); +}); + +AlertRendererPanel.displayName = 'AlertRendererPanel'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel.test.tsx new file mode 100644 index 0000000000000..51e4f084b02ec --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel.test.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 from 'react'; +import { render } from '@testing-library/react'; +import { CasesPanel } from '.'; +import { TestProviders } from '../../../../../../common/mock'; +import { + mockAlertDetailsTimelineResponse, + mockAlertNestedDetailsTimelineResponse, +} from '../../../__mocks__'; +import { ERROR_LOADING_CASES, LOADING_CASES } from '../translation'; +import { useGetRelatedCasesByEvent } from '../../../../../../common/containers/cases/use_get_related_cases_by_event'; +import { useGetUserCasesPermissions } from '../../../../../../common/lib/kibana'; + +jest.mock('../../../../../../common/containers/cases/use_get_related_cases_by_event'); +jest.mock('../../../../../../common/lib/kibana'); + +const defaultPanelProps = { + eventId: mockAlertNestedDetailsTimelineResponse._id, + dataAsNestedObject: mockAlertNestedDetailsTimelineResponse, + detailsData: mockAlertDetailsTimelineResponse, +}; + +describe('AlertDetailsPage - SummaryTab - CasesPanel', () => { + describe('No data', () => { + beforeEach(() => { + (useGetUserCasesPermissions as jest.Mock).mockReturnValue({ + create: true, + update: true, + }); + }); + it('should render the loading panel', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: true, + }); + const { getByText } = render( + <TestProviders> + <CasesPanel {...defaultPanelProps} /> + </TestProviders> + ); + expect(getByText(LOADING_CASES)).toBeVisible(); + }); + + it('should render the error panel if an error is returned', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + error: true, + }); + const { getByText } = render( + <TestProviders> + <CasesPanel {...defaultPanelProps} /> + </TestProviders> + ); + + expect(getByText(ERROR_LOADING_CASES)).toBeVisible(); + }); + + it('should render the error panel if data is undefined', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + error: false, + relatedCases: undefined, + }); + const { getByText } = render( + <TestProviders> + <CasesPanel {...defaultPanelProps} /> + </TestProviders> + ); + + expect(getByText(ERROR_LOADING_CASES)).toBeVisible(); + }); + + describe('Partial permissions', () => { + it('should only render the add to new case button', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + relatedCases: [], + }); + (useGetUserCasesPermissions as jest.Mock).mockReturnValue({ + create: true, + update: false, + }); + const { getByTestId, queryByTestId } = render( + <TestProviders> + <CasesPanel {...defaultPanelProps} /> + </TestProviders> + ); + + expect(getByTestId('add-to-new-case-button')).toBeVisible(); + expect(queryByTestId('add-to-existing-case-button')).toBe(null); + }); + + it('should only render the add to existing case button', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + relatedCases: [], + }); + (useGetUserCasesPermissions as jest.Mock).mockReturnValue({ + create: false, + update: true, + }); + const { getByTestId, queryByTestId } = render( + <TestProviders> + <CasesPanel {...defaultPanelProps} /> + </TestProviders> + ); + + expect(getByTestId('add-to-existing-case-button')).toBeVisible(); + expect(queryByTestId('add-to-new-case-button')).toBe(null); + }); + + it('should render both add to new case and add to existing case buttons', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + relatedCases: [], + }); + (useGetUserCasesPermissions as jest.Mock).mockReturnValue({ + create: true, + update: true, + }); + const { getByTestId, queryByTestId } = render( + <TestProviders> + <CasesPanel {...defaultPanelProps} /> + </TestProviders> + ); + + expect(getByTestId('add-to-new-case-button')).toBeVisible(); + expect(queryByTestId('add-to-existing-case-button')).toBeVisible(); + }); + }); + }); + describe('has related cases', () => { + const mockRelatedCase = { + title: 'test case', + id: 'test-case-id', + }; + + beforeEach(() => { + (useGetUserCasesPermissions as jest.Mock).mockReturnValue({ + create: true, + update: true, + }); + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + relatedCases: [mockRelatedCase], + }); + }); + + it('should show the related case', () => { + const { getByTestId } = render( + <TestProviders> + <CasesPanel {...defaultPanelProps} /> + </TestProviders> + ); + + expect(getByTestId('case-panel')).toHaveTextContent(mockRelatedCase.title); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel_actions.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel_actions.tsx new file mode 100644 index 0000000000000..4ffc16603cb0b --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel_actions.tsx @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; +import type { CasesPermissions } from '@kbn/cases-plugin/common'; +import React, { useCallback, useMemo, useState } from 'react'; +import type { CasesPanelProps } from '.'; +import { + ADD_TO_EXISTING_CASE_BUTTON, + ADD_TO_NEW_CASE_BUTTON, + SUMMARY_PANEL_ACTIONS, +} from '../translation'; + +export const CASES_PANEL_ACTIONS_CLASS = 'cases-panel-actions-trigger'; + +export interface CasesPanelActionsProps extends CasesPanelProps { + addToNewCase: () => void; + addToExistingCase: () => void; + className?: string; + userCasesPermissions: CasesPermissions; +} + +export const CasesPanelActions = React.memo( + ({ + addToNewCase, + addToExistingCase, + className, + userCasesPermissions, + }: CasesPanelActionsProps) => { + const [isPopoverOpen, setPopover] = useState(false); + + const onButtonClick = useCallback(() => { + setPopover(!isPopoverOpen); + }, [isPopoverOpen]); + + const closePopover = () => { + setPopover(false); + }; + + const items = useMemo(() => { + const options = []; + + if (userCasesPermissions.create) { + options.push( + <EuiContextMenuItem + key="casesActionsAddToNewCase" + onClick={addToNewCase} + data-test-subj="cases-panel-actions-add-to-new-case" + > + {ADD_TO_NEW_CASE_BUTTON} + </EuiContextMenuItem> + ); + } + + if (userCasesPermissions.update) { + options.push( + <EuiContextMenuItem + key="caseActionsAddToExistingCase" + data-test-subj="cases-panel-actions-add-to-existing-case" + onClick={addToExistingCase} + target="_blank" + > + {ADD_TO_EXISTING_CASE_BUTTON} + </EuiContextMenuItem> + ); + } + return options; + }, [addToExistingCase, addToNewCase, userCasesPermissions.create, userCasesPermissions.update]); + + const button = useMemo( + () => ( + <EuiButtonIcon + aria-label={SUMMARY_PANEL_ACTIONS} + className={CASES_PANEL_ACTIONS_CLASS} + iconType="boxesHorizontal" + onClick={onButtonClick} + /> + ), + [onButtonClick] + ); + + return ( + <div className={className}> + <EuiPopover + button={button} + isOpen={isPopoverOpen} + closePopover={closePopover} + panelPaddingSize="none" + anchorPosition="downLeft" + panelClassName="withHoverActions__popover" + > + <EuiContextMenuPanel data-test-subj="cases-actions-panel" size="s" items={items} /> + </EuiPopover> + </div> + ); + } +); + +CasesPanelActions.displayName = 'CasesPanelActions'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/index.tsx new file mode 100644 index 0000000000000..e54d7a6c4d58e --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/index.tsx @@ -0,0 +1,179 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { + EuiButton, + EuiEmptyPrompt, + EuiFlexGroup, + EuiFlexItem, + EuiLoadingSpinner, +} from '@elastic/eui'; +import type { Ecs } from '@kbn/cases-plugin/common'; +import { CommentType } from '@kbn/cases-plugin/common'; +import type { CaseAttachmentsWithoutOwner } from '@kbn/cases-plugin/public'; +import type { TimelineEventsDetailsItem } from '../../../../../../../common/search_strategy'; +import { useGetUserCasesPermissions, useKibana } from '../../../../../../common/lib/kibana'; +import { CaseDetailsLink } from '../../../../../../common/components/links'; +import { useGetRelatedCasesByEvent } from '../../../../../../common/containers/cases/use_get_related_cases_by_event'; +import { + ADD_TO_EXISTING_CASE_BUTTON, + ADD_TO_NEW_CASE_BUTTON, + CASES_PANEL_TITLE, + CASE_NO_READ_PERMISSIONS, + ERROR_LOADING_CASES, + LOADING_CASES, + NO_RELATED_CASES_FOUND, +} from '../translation'; +import { SummaryPanel } from '../wrappers'; +import { CasesPanelActions, CASES_PANEL_ACTIONS_CLASS } from './cases_panel_actions'; + +export interface CasesPanelProps { + eventId: string; + dataAsNestedObject: Ecs | null; + detailsData: TimelineEventsDetailsItem[]; +} + +const CasesPanelLoading = () => ( + <EuiEmptyPrompt + icon={<EuiLoadingSpinner size="l" />} + title={<h2>{LOADING_CASES}</h2>} + titleSize="xxs" + /> +); + +const CasesPanelError = () => <>{ERROR_LOADING_CASES}</>; + +export const CasesPanelNoReadPermissions = () => <EuiEmptyPrompt body={CASE_NO_READ_PERMISSIONS} />; + +export const CasesPanel = React.memo<CasesPanelProps>( + ({ eventId, dataAsNestedObject, detailsData }) => { + const { cases: casesUi } = useKibana().services; + const { loading, error, relatedCases, refetchRelatedCases } = + useGetRelatedCasesByEvent(eventId); + const userCasesPermissions = useGetUserCasesPermissions(); + + const caseAttachments: CaseAttachmentsWithoutOwner = useMemo(() => { + return dataAsNestedObject + ? [ + { + alertId: eventId, + index: dataAsNestedObject._index ?? '', + type: CommentType.alert, + rule: casesUi.helpers.getRuleIdFromEvent({ + ecs: dataAsNestedObject, + data: detailsData, + }), + }, + ] + : []; + }, [casesUi.helpers, dataAsNestedObject, detailsData, eventId]); + + const createCaseFlyout = casesUi.hooks.getUseCasesAddToNewCaseFlyout({ + onSuccess: refetchRelatedCases, + }); + + const selectCaseModal = casesUi.hooks.getUseCasesAddToExistingCaseModal({ + onRowClick: refetchRelatedCases, + }); + + const addToNewCase = useCallback(() => { + if (userCasesPermissions.create) { + createCaseFlyout.open({ attachments: caseAttachments }); + } + }, [userCasesPermissions.create, createCaseFlyout, caseAttachments]); + + const addToExistingCase = useCallback(() => { + if (userCasesPermissions.update) { + selectCaseModal.open({ attachments: caseAttachments }); + } + }, [caseAttachments, selectCaseModal, userCasesPermissions.update]); + + const renderCasesActions = useCallback( + () => ( + <CasesPanelActions + addToNewCase={addToNewCase} + addToExistingCase={addToExistingCase} + eventId={eventId} + dataAsNestedObject={dataAsNestedObject} + detailsData={detailsData} + userCasesPermissions={userCasesPermissions} + /> + ), + [ + addToExistingCase, + addToNewCase, + dataAsNestedObject, + detailsData, + eventId, + userCasesPermissions, + ] + ); + + if (loading) return <CasesPanelLoading />; + + if (error || relatedCases === undefined) return <CasesPanelError />; + + const hasRelatedCases = relatedCases && relatedCases.length > 0; + + return ( + <SummaryPanel + actionsClassName={CASES_PANEL_ACTIONS_CLASS} + title={CASES_PANEL_TITLE} + renderActionsPopover={hasRelatedCases ? renderCasesActions : undefined} + > + {hasRelatedCases ? ( + <EuiFlexGroup direction="column" data-test-subj="case-panel"> + {relatedCases?.map(({ id, title }) => ( + <EuiFlexItem key={id}> + <CaseDetailsLink detailName={id} title={title}> + {title} + </CaseDetailsLink> + </EuiFlexItem> + ))} + </EuiFlexGroup> + ) : ( + <EuiEmptyPrompt + iconColor="default" + body={NO_RELATED_CASES_FOUND} + actions={ + <EuiFlexGroup> + {userCasesPermissions.update && ( + <EuiFlexItem> + <EuiButton + size="s" + data-test-subj="add-to-existing-case-button" + color="primary" + onClick={addToExistingCase} + > + {ADD_TO_EXISTING_CASE_BUTTON} + </EuiButton> + </EuiFlexItem> + )} + {userCasesPermissions.create && ( + <EuiFlexItem> + <EuiButton + size="s" + data-test-subj="add-to-new-case-button" + color="primary" + fill + onClick={addToNewCase} + > + {ADD_TO_NEW_CASE_BUTTON} + </EuiButton> + </EuiFlexItem> + )} + </EuiFlexGroup> + } + /> + )} + </SummaryPanel> + ); + } +); + +CasesPanel.displayName = 'CasesPanel'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/get_mitre_threat_component.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/get_mitre_threat_component.ts new file mode 100644 index 0000000000000..32a6e1b32df1b --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/get_mitre_threat_component.ts @@ -0,0 +1,123 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { + Threat, + Threats, + ThreatSubtechnique, +} from '@kbn/securitysolution-io-ts-alerting-types'; +import { find } from 'lodash/fp'; +import { + ALERT_THREAT_FRAMEWORK, + ALERT_THREAT_TACTIC_ID, + ALERT_THREAT_TACTIC_NAME, + ALERT_THREAT_TACTIC_REFERENCE, + ALERT_THREAT_TECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_REFERENCE, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE, + KIBANA_NAMESPACE, +} from '@kbn/rule-data-utils'; +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import { buildThreatDescription } from '../../../../components/rules/description_step/helpers'; + +// TODO - it may make more sense to query source here for this information rather than piecing it together from the fields api +export const getMitreTitleAndDescription = (data: TimelineEventsDetailsItem[] | null) => { + const threatFrameworks = [ + ...(find({ field: ALERT_THREAT_FRAMEWORK, category: KIBANA_NAMESPACE }, data)?.values ?? []), + ]; + + const tacticIdValues = [ + ...(find({ field: ALERT_THREAT_TACTIC_ID, category: KIBANA_NAMESPACE }, data)?.values ?? []), + ]; + const tacticNameValues = [ + ...(find({ field: ALERT_THREAT_TACTIC_NAME, category: KIBANA_NAMESPACE }, data)?.values ?? []), + ]; + const tacticReferenceValues = [ + ...(find({ field: ALERT_THREAT_TACTIC_REFERENCE, category: KIBANA_NAMESPACE }, data)?.values ?? + []), + ]; + + const techniqueIdValues = [ + ...(find({ field: ALERT_THREAT_TECHNIQUE_ID, category: KIBANA_NAMESPACE }, data)?.values ?? []), + ]; + const techniqueNameValues = [ + ...(find({ field: ALERT_THREAT_TECHNIQUE_NAME, category: KIBANA_NAMESPACE }, data)?.values ?? + []), + ]; + const techniqueReferenceValues = [ + ...(find({ field: ALERT_THREAT_TECHNIQUE_REFERENCE, category: KIBANA_NAMESPACE }, data) + ?.values ?? []), + ]; + + const subTechniqueIdValues = [ + ...(find({ field: ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID, category: KIBANA_NAMESPACE }, data) + ?.values ?? []), + ]; + const subTechniqueNameValues = [ + ...(find({ field: ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME, category: KIBANA_NAMESPACE }, data) + ?.values ?? []), + ]; + const subTechniqueReferenceValues = [ + ...(find( + { field: ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE, category: KIBANA_NAMESPACE }, + data + )?.values ?? []), + ]; + + const threatData: Threats = + // Use the top level framework as every threat should have a framework + threatFrameworks?.map((framework, index) => { + const threat: Threat = { + framework, + tactic: { + id: tacticIdValues[index], + name: tacticNameValues[index], + reference: tacticReferenceValues[index], + }, + technique: [], + }; + + // TODO: + // Fields api doesn't provide null entries to keep the same length of values for flattend objects + // So for the time being rather than showing incorrect data, we'll only show tactic information when the length of both line up + // We can replace this with a _source request and just pass that. + if (tacticIdValues.length === techniqueIdValues.length) { + const subtechnique: ThreatSubtechnique[] = []; + const techniqueId = techniqueIdValues[index]; + subTechniqueIdValues.forEach((subId, subIndex) => { + // TODO: see above comment. Without this matching, a subtechnique can be incorrectly matched with a higher level technique + if (subId.includes(techniqueId)) { + subtechnique.push({ + id: subTechniqueIdValues[subIndex], + name: subTechniqueNameValues[subIndex], + reference: subTechniqueReferenceValues[subIndex], + }); + } + }); + + threat.technique?.push({ + id: techniqueId, + name: techniqueNameValues[index], + reference: techniqueReferenceValues[index], + subtechnique, + }); + } + + return threat; + }) ?? []; + + // TODO: discuss moving buildThreatDescription to a shared common folder + return threatData && threatData.length > 0 + ? buildThreatDescription({ + label: threatData[0].framework, + threat: threatData, + }) + : null; +}; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel.test.tsx new file mode 100644 index 0000000000000..407a604bc9e43 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel.test.tsx @@ -0,0 +1,133 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { find } from 'lodash/fp'; +import { TestProviders } from '../../../../../../common/mock'; +import { + mockAlertDetailsTimelineResponse, + mockAlertNestedDetailsTimelineResponse, +} from '../../../__mocks__'; +import type { HostPanelProps } from '.'; +import { HostPanel } from '.'; +import { mockBrowserFields } from '../../../../../../common/containers/source/mock'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { RiskSeverity } from '../../../../../../../common/search_strategy'; +import { useRiskScore } from '../../../../../../risk_score/containers'; + +jest.mock('../../../../../../risk_score/containers'); +const mockUseRiskScore = useRiskScore as jest.Mock; + +jest.mock('../../../../../containers/detection_engine/alerts/use_host_isolation_status', () => { + return { + useHostIsolationStatus: jest.fn().mockReturnValue({ + loading: false, + isIsolated: false, + agentStatus: 'healthy', + }), + }; +}); + +describe('AlertDetailsPage - SummaryTab - HostPanel', () => { + const defaultRiskReturnValues = { + inspect: null, + refetch: () => {}, + isModuleEnabled: true, + isLicenseValid: true, + loading: false, + }; + const HostPanelWithDefaultProps = (propOverrides: Partial<HostPanelProps>) => ( + <TestProviders> + <HostPanel + data={mockAlertDetailsTimelineResponse} + openHostDetailsPanel={jest.fn} + id={mockAlertNestedDetailsTimelineResponse._id} + browserFields={mockBrowserFields} + selectedPatterns={['random-pattern']} + {...propOverrides} + /> + </TestProviders> + ); + + beforeEach(() => { + mockUseRiskScore.mockReturnValue({ ...defaultRiskReturnValues }); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('should render basic host fields', () => { + const { getByTestId } = render(<HostPanelWithDefaultProps />); + const simpleHostFields = ['host.name', 'host.os.name']; + + simpleHostFields.forEach((simpleHostField) => { + expect(getByTestId('host-panel')).toHaveTextContent( + getTimelineEventData(simpleHostField, mockAlertDetailsTimelineResponse) + ); + }); + }); + + describe('Agent status', () => { + it('should show healthy', () => { + const { getByTestId } = render(<HostPanelWithDefaultProps />); + expect(getByTestId('host-panel-agent-status')).toHaveTextContent('Healthy'); + }); + }); + + describe('host risk', () => { + it('should not show risk if the license is not valid', () => { + mockUseRiskScore.mockReturnValue({ + ...defaultRiskReturnValues, + isLicenseValid: false, + data: null, + }); + const { queryByTestId } = render(<HostPanelWithDefaultProps />); + expect(queryByTestId('host-panel-risk')).toBe(null); + }); + + it('should render risk fields', () => { + const calculatedScoreNorm = 98.9; + const calculatedLevel = RiskSeverity.critical; + + mockUseRiskScore.mockReturnValue({ + ...defaultRiskReturnValues, + isLicenseValid: true, + data: [ + { + host: { + name: mockAlertNestedDetailsTimelineResponse.host?.name, + risk: { + calculated_score_norm: calculatedScoreNorm, + calculated_level: calculatedLevel, + }, + }, + }, + ], + }); + const { getByTestId } = render(<HostPanelWithDefaultProps />); + + expect(getByTestId('host-panel-risk')).toHaveTextContent( + `${Math.round(calculatedScoreNorm)}` + ); + expect(getByTestId('host-panel-risk')).toHaveTextContent(calculatedLevel); + }); + }); + + describe('host ip', () => { + it('should render all the ip fields', () => { + const { getByTestId } = render(<HostPanelWithDefaultProps />); + const ipFields = find( + { field: 'host.ip', category: 'host' }, + mockAlertDetailsTimelineResponse + )?.values as string[]; + expect(getByTestId('host-panel-ip')).toHaveTextContent(ipFields[0]); + expect(getByTestId('host-panel-ip')).toHaveTextContent('+1 More'); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel_actions.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel_actions.tsx new file mode 100644 index 0000000000000..d078785bf93f8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel_actions.tsx @@ -0,0 +1,99 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; +import React, { useCallback, useMemo, useState } from 'react'; +import { SecurityPageName } from '../../../../../../app/types'; +import { useGetSecuritySolutionLinkProps } from '../../../../../../common/components/links'; +import { getHostDetailsUrl } from '../../../../../../common/components/link_to'; + +import { OPEN_HOST_DETAILS_PAGE, SUMMARY_PANEL_ACTIONS, VIEW_HOST_SUMMARY } from '../translation'; + +export const HOST_PANEL_ACTIONS_CLASS = 'host-panel-actions-trigger'; + +export const HostPanelActions = React.memo( + ({ + className, + openHostDetailsPanel, + hostName, + }: { + className?: string; + hostName: string; + openHostDetailsPanel: (hostName: string) => void; + }) => { + const [isPopoverOpen, setPopover] = useState(false); + const { href } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.hosts, + path: getHostDetailsUrl(hostName), + }); + + const onButtonClick = useCallback(() => { + setPopover(!isPopoverOpen); + }, [isPopoverOpen]); + + const closePopover = () => { + setPopover(false); + }; + + const handleOpenHostDetailsPanel = useCallback(() => { + openHostDetailsPanel(hostName); + closePopover(); + }, [hostName, openHostDetailsPanel]); + + const items = useMemo( + () => [ + <EuiContextMenuItem + icon="expand" + key="hostActionsViewHostSummary" + onClick={handleOpenHostDetailsPanel} + data-test-subj="host-panel-actions-view-summary" + > + {VIEW_HOST_SUMMARY} + </EuiContextMenuItem>, + <EuiContextMenuItem + icon="popout" + key="hostActionsOpenHostDetailsPage" + data-test-subj="host-panel-actions-open-host-details" + onClick={closePopover} + href={href} + target="_blank" + > + {OPEN_HOST_DETAILS_PAGE} + </EuiContextMenuItem>, + ], + [handleOpenHostDetailsPanel, href] + ); + + const button = useMemo( + () => ( + <EuiButtonIcon + aria-label={SUMMARY_PANEL_ACTIONS} + className={HOST_PANEL_ACTIONS_CLASS} + iconType="boxesHorizontal" + onClick={onButtonClick} + /> + ), + [onButtonClick] + ); + + return ( + <div className={className}> + <EuiPopover + button={button} + isOpen={isPopoverOpen} + closePopover={closePopover} + panelPaddingSize="none" + anchorPosition="downLeft" + panelClassName="withHoverActions__popover" + > + <EuiContextMenuPanel data-test-subj="host-actions-panel" size="s" items={items} /> + </EuiPopover> + </div> + ); + } +); + +HostPanelActions.displayName = 'HostPanelActions'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/index.tsx new file mode 100644 index 0000000000000..f1df3cf0f97d6 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/index.tsx @@ -0,0 +1,195 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiTitle, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import React, { useCallback, useMemo } from 'react'; +import { find } from 'lodash/fp'; +import type { FlexItemGrowSize } from '@elastic/eui/src/components/flex/flex_item'; +import { TimelineId } from '../../../../../../../common/types'; +import { isAlertFromEndpointEvent } from '../../../../../../common/utils/endpoint_alert_check'; +import { SummaryValueCell } from '../../../../../../common/components/event_details/table/summary_value_cell'; +import { useRiskScore } from '../../../../../../risk_score/containers'; +import { RiskScoreEntity } from '../../../../../../../common/search_strategy'; +import { getEmptyTagValue } from '../../../../../../common/components/empty_value'; +import { RiskScore } from '../../../../../../common/components/severity/common'; +import { + FirstLastSeen, + FirstLastSeenType, +} from '../../../../../../common/components/first_last_seen'; +import { DefaultFieldRenderer } from '../../../../../../timelines/components/field_renderers/field_renderers'; +import { HostDetailsLink, NetworkDetailsLink } from '../../../../../../common/components/links'; +import type { SelectedDataView } from '../../../../../../common/store/sourcerer/model'; +import { getEnrichedFieldInfo } from '../../../../../../common/components/event_details/helpers'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { + AGENT_STATUS_TITLE, + HOST_NAME_TITLE, + HOST_PANEL_TITLE, + HOST_RISK_CLASSIFICATION, + HOST_RISK_SCORE, + IP_ADDRESSES_TITLE, + LAST_SEEN_TITLE, + OPERATING_SYSTEM_TITLE, +} from '../translation'; +import { SummaryPanel } from '../wrappers'; +import { HostPanelActions, HOST_PANEL_ACTIONS_CLASS } from './host_panel_actions'; + +export interface HostPanelProps { + data: TimelineEventsDetailsItem[]; + id: string; + openHostDetailsPanel: (hostName: string, onClose?: (() => void) | undefined) => void; + selectedPatterns: SelectedDataView['selectedPatterns']; + browserFields: SelectedDataView['browserFields']; +} + +const HostPanelSection: React.FC<{ + title?: string | React.ReactElement; + grow?: FlexItemGrowSize; +}> = ({ grow, title, children }) => + children ? ( + <EuiFlexItem grow={grow}> + {title && ( + <> + <EuiTitle size="xxs"> + <h5>{title}</h5> + </EuiTitle> + <EuiSpacer size="xs" /> + </> + )} + {children} + </EuiFlexItem> + ) : null; + +export const HostPanel = React.memo( + ({ data, id, browserFields, openHostDetailsPanel, selectedPatterns }: HostPanelProps) => { + const hostName = getTimelineEventData('host.name', data); + const hostOs = getTimelineEventData('host.os.name', data); + + const enrichedAgentStatus = useMemo(() => { + const item = find({ field: 'agent.id', category: 'agent' }, data); + if (!data || !isAlertFromEndpointEvent({ data })) return null; + return ( + item && + getEnrichedFieldInfo({ + eventId: id, + contextId: TimelineId.detectionsAlertDetailsPage, + scopeId: TimelineId.detectionsAlertDetailsPage, + browserFields, + item, + field: { id: 'agent.id', overrideField: 'agent.status' }, + linkValueField: undefined, + }) + ); + }, [browserFields, data, id]); + + const { data: hostRisk, isLicenseValid: isRiskLicenseValid } = useRiskScore({ + riskEntity: RiskScoreEntity.host, + skip: hostName == null, + }); + + const [hostRiskScore, hostRiskLevel] = useMemo(() => { + const hostRiskData = hostRisk && hostRisk.length > 0 ? hostRisk[0] : undefined; + const hostRiskValue = hostRiskData + ? Math.round(hostRiskData.host.risk.calculated_score_norm) + : getEmptyTagValue(); + const hostRiskSeverity = hostRiskData ? ( + <RiskScore severity={hostRiskData.host.risk.calculated_level} hideBackgroundColor /> + ) : ( + getEmptyTagValue() + ); + + return [hostRiskValue, hostRiskSeverity]; + }, [hostRisk]); + + const hostIpFields = useMemo( + () => find({ field: 'host.ip', category: 'host' }, data)?.values ?? [], + [data] + ); + + const renderHostIp = useCallback( + (ip: string) => (ip != null ? <NetworkDetailsLink ip={ip} /> : getEmptyTagValue()), + [] + ); + + const renderHostActions = useCallback( + () => <HostPanelActions openHostDetailsPanel={openHostDetailsPanel} hostName={hostName} />, + [hostName, openHostDetailsPanel] + ); + + return ( + <SummaryPanel + actionsClassName={HOST_PANEL_ACTIONS_CLASS} + grow + renderActionsPopover={hostName ? renderHostActions : undefined} + title={HOST_PANEL_TITLE} + > + <EuiFlexGroup data-test-subj="host-panel"> + <EuiFlexItem grow={2}> + <EuiFlexGroup> + <HostPanelSection grow={false}> + <EuiIcon type="storage" size="xl" /> + </HostPanelSection> + <HostPanelSection title={HOST_NAME_TITLE}> + <HostDetailsLink hostName={hostName} /> + </HostPanelSection> + </EuiFlexGroup> + <EuiSpacer size="l" /> + <EuiFlexGroup data-test-subj="host-panel-agent-status"> + <HostPanelSection title={OPERATING_SYSTEM_TITLE}>{hostOs}</HostPanelSection> + {enrichedAgentStatus && ( + <HostPanelSection title={AGENT_STATUS_TITLE}> + <SummaryValueCell {...enrichedAgentStatus} /> + </HostPanelSection> + )} + </EuiFlexGroup> + <EuiSpacer size="l" /> + {isRiskLicenseValid && ( + <> + <EuiFlexGroup data-test-subj="host-panel-risk"> + {hostRiskScore && ( + <HostPanelSection title={HOST_RISK_SCORE}>{hostRiskScore}</HostPanelSection> + )} + {hostRiskLevel && ( + <HostPanelSection title={HOST_RISK_CLASSIFICATION}> + {hostRiskLevel} + </HostPanelSection> + )} + </EuiFlexGroup> + <EuiSpacer size="l" /> + </> + )} + <EuiFlexGroup data-test-subj="host-panel-ip"> + <HostPanelSection title={IP_ADDRESSES_TITLE} grow={2}> + <DefaultFieldRenderer + rowItems={hostIpFields} + attrName={'host.ip'} + idPrefix="alert-details-page-user" + render={renderHostIp} + /> + </HostPanelSection> + </EuiFlexGroup> + <EuiSpacer size="l" /> + <EuiFlexGroup> + <HostPanelSection title={LAST_SEEN_TITLE} grow={2}> + <FirstLastSeen + indexPatterns={selectedPatterns} + field={'host.name'} + value={hostName} + type={FirstLastSeenType.LAST_SEEN} + /> + </HostPanelSection> + </EuiFlexGroup> + <EuiSpacer /> + </EuiFlexItem> + </EuiFlexGroup> + </SummaryPanel> + ); + } +); + +HostPanel.displayName = 'HostPanel'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/index.tsx new file mode 100644 index 0000000000000..1b63b778453a8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/index.tsx @@ -0,0 +1,84 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFlexGroup } from '@elastic/eui'; +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import { TimelineId } from '../../../../../../common/types'; +import { useDetailPanel } from '../../../../../timelines/components/side_panel/hooks/use_detail_panel'; +import { useGetUserCasesPermissions } from '../../../../../common/lib/kibana'; +import type { SelectedDataView } from '../../../../../common/store/sourcerer/model'; +import { SourcererScopeName } from '../../../../../common/store/sourcerer/model'; +import type { Ecs } from '../../../../../../common/ecs'; +import { AlertRendererPanel } from './alert_renderer_panel'; +import { RulePanel } from './rule_panel'; +import { CasesPanel, CasesPanelNoReadPermissions } from './cases_panel'; +import { HostPanel } from './host_panel'; +import { UserPanel } from './user_panel'; +import { SummaryColumn, SummaryRow } from './wrappers'; + +export interface DetailsSummaryTabProps { + eventId: string; + dataAsNestedObject: Ecs | null; + detailsData: TimelineEventsDetailsItem[]; + sourcererDataView: SelectedDataView; +} + +export const DetailsSummaryTab = React.memo( + ({ dataAsNestedObject, detailsData, eventId, sourcererDataView }: DetailsSummaryTabProps) => { + const userCasesPermissions = useGetUserCasesPermissions(); + + const { DetailsPanel, openHostDetailsPanel, openUserDetailsPanel } = useDetailPanel({ + isFlyoutView: true, + sourcererScope: SourcererScopeName.detections, + scopeId: TimelineId.detectionsAlertDetailsPage, + }); + + return ( + <> + <EuiFlexGroup data-test-subj="alert-details-page-summary-tab" direction="row" wrap> + <SummaryColumn grow={2}> + <AlertRendererPanel dataAsNestedObject={dataAsNestedObject} /> + <RulePanel + id={eventId} + data={detailsData} + browserFields={sourcererDataView.browserFields} + /> + <SummaryRow> + <HostPanel + id={eventId} + data={detailsData} + openHostDetailsPanel={openHostDetailsPanel} + selectedPatterns={sourcererDataView.selectedPatterns} + browserFields={sourcererDataView.browserFields} + /> + <UserPanel + data={detailsData} + selectedPatterns={sourcererDataView.selectedPatterns} + openUserDetailsPanel={openUserDetailsPanel} + /> + </SummaryRow> + </SummaryColumn> + <SummaryColumn grow={1}> + {userCasesPermissions.read ? ( + <CasesPanel + eventId={eventId} + dataAsNestedObject={dataAsNestedObject} + detailsData={detailsData} + /> + ) : ( + <CasesPanelNoReadPermissions /> + )} + </SummaryColumn> + </EuiFlexGroup> + {DetailsPanel} + </> + ); + } +); + +DetailsSummaryTab.displayName = 'DetailsSummaryTab'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/index.tsx new file mode 100644 index 0000000000000..362939b89b418 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/index.tsx @@ -0,0 +1,156 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiTitle, EuiSpacer, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import type { Severity } from '@kbn/securitysolution-io-ts-alerting-types'; +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import React, { useCallback, useMemo } from 'react'; +import { css } from '@emotion/react'; +import { find } from 'lodash/fp'; +import type { FlexItemGrowSize } from '@elastic/eui/src/components/flex/flex_item'; +import { + ALERT_RISK_SCORE, + ALERT_RULE_DESCRIPTION, + ALERT_RULE_NAME, + ALERT_RULE_UUID, + ALERT_SEVERITY, + KIBANA_NAMESPACE, +} from '@kbn/rule-data-utils'; +import { TimelineId } from '../../../../../../../common/types'; +import { SeverityBadge } from '../../../../../components/rules/severity_badge'; +import { getEnrichedFieldInfo } from '../../../../../../common/components/event_details/helpers'; +import type { SelectedDataView } from '../../../../../../common/store/sourcerer/model'; +import { FormattedFieldValue } from '../../../../../../timelines/components/timeline/body/renderers/formatted_field'; +import { + RISK_SCORE_TITLE, + RULE_DESCRIPTION_TITLE, + RULE_NAME_TITLE, + RULE_PANEL_TITLE, + SEVERITY_TITLE, +} from '../translation'; +import { getMitreTitleAndDescription } from '../get_mitre_threat_component'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { SummaryPanel } from '../wrappers'; +import { RulePanelActions, RULE_PANEL_ACTIONS_CLASS } from './rule_panel_actions'; + +export interface RulePanelProps { + data: TimelineEventsDetailsItem[]; + id: string; + browserFields: SelectedDataView['browserFields']; +} + +const threatTacticContainerStyles = css` + flex-wrap: nowrap; + & .euiFlexGroup { + flex-wrap: nowrap; + } +`; + +interface RuleSectionProps { + ['data-test-subj']?: string; + title: string; + grow?: FlexItemGrowSize; +} +const RuleSection: React.FC<RuleSectionProps> = ({ + grow, + title, + children, + 'data-test-subj': dataTestSubj, +}) => ( + <EuiFlexItem grow={grow} data-test-subj={dataTestSubj}> + <EuiTitle size="xxs"> + <h5>{title}</h5> + </EuiTitle> + <EuiSpacer size="xs" /> + {children} + </EuiFlexItem> +); + +export const RulePanel = React.memo(({ data, id, browserFields }: RulePanelProps) => { + const ruleUuid = useMemo(() => getTimelineEventData(ALERT_RULE_UUID, data), [data]); + const threatDetails = useMemo(() => getMitreTitleAndDescription(data), [data]); + const alertRiskScore = useMemo(() => getTimelineEventData(ALERT_RISK_SCORE, data), [data]); + const alertSeverity = useMemo( + () => getTimelineEventData(ALERT_SEVERITY, data) as Severity, + [data] + ); + const alertRuleDescription = useMemo( + () => getTimelineEventData(ALERT_RULE_DESCRIPTION, data), + [data] + ); + const shouldShowThreatDetails = !!threatDetails && threatDetails?.length > 0; + + const renderRuleActions = useCallback(() => <RulePanelActions ruleUuid={ruleUuid} />, [ruleUuid]); + const ruleNameData = useMemo(() => { + const item = find({ field: ALERT_RULE_NAME, category: KIBANA_NAMESPACE }, data); + const linkValueField = find({ field: ALERT_RULE_UUID, category: KIBANA_NAMESPACE }, data); + return ( + item && + getEnrichedFieldInfo({ + eventId: id, + contextId: TimelineId.detectionsAlertDetailsPage, + scopeId: TimelineId.detectionsAlertDetailsPage, + browserFields, + item, + linkValueField, + }) + ); + }, [browserFields, data, id]); + + return ( + <SummaryPanel + actionsClassName={RULE_PANEL_ACTIONS_CLASS} + renderActionsPopover={renderRuleActions} + title={RULE_PANEL_TITLE} + > + <EuiFlexGroup data-test-subj="rule-panel"> + <EuiFlexItem grow={2}> + <EuiFlexGroup> + <RuleSection title={RULE_NAME_TITLE} grow={2}> + <FormattedFieldValue + contextId={TimelineId.active} + eventId={id} + value={ruleNameData?.values?.[0]} + fieldName={ruleNameData?.data.field ?? ''} + linkValue={ruleNameData?.linkValue} + fieldType={ruleNameData?.data.type} + fieldFormat={ruleNameData?.data.format} + isDraggable={false} + truncate={false} + /> + </RuleSection> + <RuleSection title={RISK_SCORE_TITLE}>{alertRiskScore}</RuleSection> + <RuleSection data-test-subj="rule-panel-severity" title={SEVERITY_TITLE}> + <SeverityBadge value={alertSeverity} /> + </RuleSection> + </EuiFlexGroup> + <EuiSpacer size="l" /> + <EuiFlexGroup> + <RuleSection title={RULE_DESCRIPTION_TITLE} grow={2}> + {alertRuleDescription} + </RuleSection> + </EuiFlexGroup> + <EuiSpacer size="l" /> + <EuiFlexGroup + data-test-subj="rule-panel-threat-tactic" + wrap={false} + css={threatTacticContainerStyles} + > + {shouldShowThreatDetails && ( + <RuleSection title={threatDetails[0].title as string} grow={2}> + {threatDetails[0].description} + </RuleSection> + )} + </EuiFlexGroup> + <EuiSpacer /> + </EuiFlexItem> + </EuiFlexGroup> + </SummaryPanel> + ); +}); + +RulePanel.displayName = 'RulePanel'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel.test.tsx new file mode 100644 index 0000000000000..a41659fd2bcf6 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel.test.tsx @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { ALERT_RISK_SCORE, ALERT_RULE_DESCRIPTION, ALERT_RULE_NAME } from '@kbn/rule-data-utils'; +import { TestProviders } from '../../../../../../common/mock'; +import { + mockAlertDetailsTimelineResponse, + mockAlertNestedDetailsTimelineResponse, +} from '../../../__mocks__'; +import type { RulePanelProps } from '.'; +import { RulePanel } from '.'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { mockBrowserFields } from '../../../../../../common/containers/source/mock'; + +describe('AlertDetailsPage - SummaryTab - RulePanel', () => { + const RulePanelWithDefaultProps = (propOverrides: Partial<RulePanelProps>) => ( + <TestProviders> + <RulePanel + data={mockAlertDetailsTimelineResponse} + id={mockAlertNestedDetailsTimelineResponse._id} + browserFields={mockBrowserFields} + {...propOverrides} + /> + </TestProviders> + ); + it('should render basic rule fields', () => { + const { getByTestId } = render(<RulePanelWithDefaultProps />); + const simpleRuleFields = [ALERT_RISK_SCORE, ALERT_RULE_DESCRIPTION]; + + simpleRuleFields.forEach((simpleRuleField) => { + expect(getByTestId('rule-panel')).toHaveTextContent( + getTimelineEventData(simpleRuleField, mockAlertDetailsTimelineResponse) + ); + }); + }); + + it('should render the expected severity', () => { + const { getByTestId } = render(<RulePanelWithDefaultProps />); + expect(getByTestId('rule-panel-severity')).toHaveTextContent('Medium'); + }); + + describe('Rule name link', () => { + it('should render the rule name as a link button', () => { + const { getByTestId } = render(<RulePanelWithDefaultProps />); + const ruleName = getTimelineEventData(ALERT_RULE_NAME, mockAlertDetailsTimelineResponse); + expect(getByTestId('ruleName')).toHaveTextContent(ruleName); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel_actions.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel_actions.tsx new file mode 100644 index 0000000000000..a2eec20864a2b --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel_actions.tsx @@ -0,0 +1,78 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; +import React, { useCallback, useMemo, useState } from 'react'; +import { getRuleDetailsUrl } from '../../../../../../common/components/link_to'; +import { SecurityPageName } from '../../../../../../app/types'; +import { useGetSecuritySolutionLinkProps } from '../../../../../../common/components/links'; + +import { SUMMARY_PANEL_ACTIONS, OPEN_RULE_DETAILS_PAGE } from '../translation'; + +export const RULE_PANEL_ACTIONS_CLASS = 'rule-panel-actions-trigger'; + +export const RulePanelActions = React.memo( + ({ className, ruleUuid }: { className?: string; ruleUuid: string }) => { + const [isPopoverOpen, setPopover] = useState(false); + const { href } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.rules, + path: getRuleDetailsUrl(ruleUuid), + }); + + const onButtonClick = useCallback(() => { + setPopover(!isPopoverOpen); + }, [isPopoverOpen]); + + const closePopover = () => { + setPopover(false); + }; + + const items = useMemo( + () => [ + <EuiContextMenuItem + icon="popout" + key="ruleActionsOpenRuleDetailsPage" + data-test-subj="rule-panel-actions-open-rule-details" + onClick={closePopover} + href={href} + target="_blank" + > + {OPEN_RULE_DETAILS_PAGE} + </EuiContextMenuItem>, + ], + [href] + ); + + const button = useMemo( + () => ( + <EuiButtonIcon + aria-label={SUMMARY_PANEL_ACTIONS} + className={RULE_PANEL_ACTIONS_CLASS} + iconType="boxesHorizontal" + onClick={onButtonClick} + /> + ), + [onButtonClick] + ); + + return ( + <div className={className}> + <EuiPopover + button={button} + isOpen={isPopoverOpen} + closePopover={closePopover} + panelPaddingSize="none" + anchorPosition="downLeft" + panelClassName="withHoverActions__popover" + > + <EuiContextMenuPanel data-test-subj="rule-actions-panel" size="s" items={items} /> + </EuiPopover> + </div> + ); + } +); + +RulePanelActions.displayName = 'RulePanelActions'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/translation.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/translation.ts new file mode 100644 index 0000000000000..a0b4246b7c271 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/translation.ts @@ -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 { i18n } from '@kbn/i18n'; + +export const CASES_PANEL_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.cases.title', + { + defaultMessage: 'Cases', + } +); + +export const ALERT_REASON_PANEL_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.alertReason.title', + { + defaultMessage: 'Alert reason', + } +); + +export const RULE_PANEL_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.title', + { + defaultMessage: 'Rule', + } +); + +export const HOST_PANEL_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.title', + { + defaultMessage: 'Host', + } +); + +export const USER_PANEL_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.title', + { + defaultMessage: 'User', + } +); + +export const RULE_NAME_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.name', + { + defaultMessage: 'Rule name', + } +); + +export const RISK_SCORE_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.riskScore', + { + defaultMessage: 'Risk score', + } +); + +export const SEVERITY_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.severity', + { + defaultMessage: 'Severity', + } +); + +export const RULE_DESCRIPTION_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.description', + { + defaultMessage: 'Rule description', + } +); + +export const OPEN_RULE_DETAILS_PAGE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.action.openRuleDetailsPage', + { + defaultMessage: 'Open rule details page', + } +); + +export const NO_RELATED_CASES_FOUND = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.noCasesFound', + { + defaultMessage: 'Related cases were not found for this alert', + } +); + +export const LOADING_CASES = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.loading', + { + defaultMessage: 'Loading related cases...', + } +); + +export const ERROR_LOADING_CASES = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.error', + { + defaultMessage: 'Error loading related cases', + } +); + +export const CASE_NO_READ_PERMISSIONS = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.noRead', + { + defaultMessage: + 'You do not have the required permissions to view related cases. If you need to view cases, contact your Kibana administrator', + } +); + +export const ADD_TO_EXISTING_CASE_BUTTON = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.addToExistingCase', + { + defaultMessage: 'Add to existing case', + } +); + +export const ADD_TO_NEW_CASE_BUTTON = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.addToNewCase', + { + defaultMessage: 'Add to new case', + } +); + +export const HOST_NAME_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.hostName.title', + { + defaultMessage: 'Host name', + } +); + +export const OPERATING_SYSTEM_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.osName.title', + { + defaultMessage: 'Operating system', + } +); + +export const AGENT_STATUS_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.agentStatus.title', + { + defaultMessage: 'Agent status', + } +); + +export const IP_ADDRESSES_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.ipAddresses.title', + { + defaultMessage: 'IP addresses', + } +); + +export const LAST_SEEN_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.lastSeen.title', + { + defaultMessage: 'Last seen', + } +); + +export const VIEW_HOST_SUMMARY = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.action.viewHostSummary', + { + defaultMessage: 'View host summary', + } +); + +export const OPEN_HOST_DETAILS_PAGE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.action.openHostDetailsPage', + { + defaultMessage: 'Open host details page', + } +); + +export const HOST_RISK_SCORE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.riskScore', + { + defaultMessage: 'Host risk score', + } +); + +export const HOST_RISK_CLASSIFICATION = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.riskClassification', + { + defaultMessage: 'Host risk classification', + } +); + +export const USER_NAME_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.userName.title', + { + defaultMessage: 'User name', + } +); + +export const USER_RISK_SCORE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.riskScore', + { + defaultMessage: 'User risk score', + } +); + +export const USER_RISK_CLASSIFICATION = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.riskClassification', + { + defaultMessage: 'User risk classification', + } +); + +export const VIEW_USER_SUMMARY = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.action.viewUserSummary', + { + defaultMessage: 'View user summary', + } +); + +export const OPEN_USER_DETAILS_PAGE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.action.openUserDetailsPage', + { + defaultMessage: 'Open user details page', + } +); + +export const SUMMARY_PANEL_ACTIONS = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.panelMoreActions', + { + defaultMessage: 'More actions', + } +); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/index.tsx new file mode 100644 index 0000000000000..ab58623467933 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/index.tsx @@ -0,0 +1,160 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiTitle, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import React, { useCallback, useMemo } from 'react'; +import { find } from 'lodash/fp'; +import type { FlexItemGrowSize } from '@elastic/eui/src/components/flex/flex_item'; +import { useRiskScore } from '../../../../../../risk_score/containers'; +import { RiskScoreEntity } from '../../../../../../../common/search_strategy'; +import { getEmptyTagValue } from '../../../../../../common/components/empty_value'; +import { RiskScore } from '../../../../../../common/components/severity/common'; +import { + FirstLastSeen, + FirstLastSeenType, +} from '../../../../../../common/components/first_last_seen'; +import { DefaultFieldRenderer } from '../../../../../../timelines/components/field_renderers/field_renderers'; +import { NetworkDetailsLink, UserDetailsLink } from '../../../../../../common/components/links'; +import type { SelectedDataView } from '../../../../../../common/store/sourcerer/model'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { + IP_ADDRESSES_TITLE, + LAST_SEEN_TITLE, + USER_NAME_TITLE, + USER_PANEL_TITLE, + USER_RISK_CLASSIFICATION, + USER_RISK_SCORE, +} from '../translation'; +import { SummaryPanel } from '../wrappers'; +import { UserPanelActions, USER_PANEL_ACTIONS_CLASS } from './user_panel_actions'; + +export interface UserPanelProps { + data: TimelineEventsDetailsItem[] | null; + selectedPatterns: SelectedDataView['selectedPatterns']; + openUserDetailsPanel: (userName: string, onClose?: (() => void) | undefined) => void; +} + +const UserPanelSection: React.FC<{ + title?: string | React.ReactElement; + grow?: FlexItemGrowSize; +}> = ({ grow, title, children }) => + children ? ( + <EuiFlexItem grow={grow}> + {title && ( + <> + <EuiTitle size="xxs"> + <h5>{title}</h5> + </EuiTitle> + <EuiSpacer size="xs" /> + </> + )} + {children} + </EuiFlexItem> + ) : null; + +export const UserPanel = React.memo( + ({ data, selectedPatterns, openUserDetailsPanel }: UserPanelProps) => { + const userName = useMemo(() => getTimelineEventData('user.name', data), [data]); + + const { data: userRisk, isLicenseValid: isRiskLicenseValid } = useRiskScore({ + riskEntity: RiskScoreEntity.user, + skip: userName == null, + }); + + const renderUserActions = useCallback( + () => <UserPanelActions openUserDetailsPanel={openUserDetailsPanel} userName={userName} />, + [openUserDetailsPanel, userName] + ); + + const [userRiskScore, userRiskLevel] = useMemo(() => { + const userRiskData = userRisk && userRisk.length > 0 ? userRisk[0] : undefined; + const userRiskValue = userRiskData + ? Math.round(userRiskData.user.risk.calculated_score_norm) + : getEmptyTagValue(); + const userRiskSeverity = userRiskData ? ( + <RiskScore severity={userRiskData.user.risk.calculated_level} hideBackgroundColor /> + ) : ( + getEmptyTagValue() + ); + + return [userRiskValue, userRiskSeverity]; + }, [userRisk]); + + const sourceIpFields = useMemo( + () => find({ field: 'source.ip', category: 'source' }, data)?.values ?? [], + [data] + ); + + const renderSourceIp = useCallback( + (ip: string) => (ip != null ? <NetworkDetailsLink ip={ip} /> : getEmptyTagValue()), + [] + ); + + return ( + <SummaryPanel + actionsClassName={USER_PANEL_ACTIONS_CLASS} + grow + renderActionsPopover={userName ? renderUserActions : undefined} + title={USER_PANEL_TITLE} + > + <EuiFlexGroup data-test-subj="user-panel"> + <EuiFlexItem grow={2}> + <EuiFlexGroup> + <UserPanelSection grow={false}> + <EuiIcon type="userAvatar" size="xl" /> + </UserPanelSection> + <UserPanelSection title={USER_NAME_TITLE}> + {userName ? <UserDetailsLink userName={userName} /> : getEmptyTagValue()} + </UserPanelSection> + </EuiFlexGroup> + <EuiSpacer size="l" /> + {isRiskLicenseValid && ( + <> + <EuiFlexGroup data-test-subj="user-panel-risk"> + {userRiskScore && ( + <UserPanelSection title={USER_RISK_SCORE}>{userRiskScore}</UserPanelSection> + )} + {userRiskLevel && ( + <UserPanelSection title={USER_RISK_CLASSIFICATION}> + {userRiskLevel} + </UserPanelSection> + )} + </EuiFlexGroup> + <EuiSpacer size="l" /> + </> + )} + <EuiFlexGroup data-test-subj="user-panel-ip"> + <UserPanelSection title={IP_ADDRESSES_TITLE} grow={2}> + <DefaultFieldRenderer + rowItems={sourceIpFields} + attrName={'source.ip'} + idPrefix="alert-details-page-user" + render={renderSourceIp} + /> + </UserPanelSection> + </EuiFlexGroup> + <EuiSpacer size="l" /> + <EuiFlexGroup> + <UserPanelSection title={LAST_SEEN_TITLE} grow={2}> + <FirstLastSeen + indexPatterns={selectedPatterns} + field={'user.name'} + value={userName} + type={FirstLastSeenType.LAST_SEEN} + /> + </UserPanelSection> + </EuiFlexGroup> + <EuiSpacer /> + </EuiFlexItem> + </EuiFlexGroup> + </SummaryPanel> + ); + } +); + +UserPanel.displayName = 'UserPanel'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel.test.tsx new file mode 100644 index 0000000000000..aa93253993338 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel.test.tsx @@ -0,0 +1,112 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { TestProviders } from '../../../../../../common/mock'; +import { + mockAlertDetailsTimelineResponse, + mockAlertNestedDetailsTimelineResponse, +} from '../../../__mocks__'; +import type { UserPanelProps } from '.'; +import { UserPanel } from '.'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { RiskSeverity } from '../../../../../../../common/search_strategy'; +import { useRiskScore } from '../../../../../../risk_score/containers'; +import { find } from 'lodash/fp'; + +jest.mock('../../../../../../risk_score/containers'); +const mockUseRiskScore = useRiskScore as jest.Mock; + +describe('AlertDetailsPage - SummaryTab - UserPanel', () => { + const defaultRiskReturnValues = { + inspect: null, + refetch: () => {}, + isModuleEnabled: true, + isLicenseValid: true, + loading: false, + }; + const UserPanelWithDefaultProps = (propOverrides: Partial<UserPanelProps>) => ( + <TestProviders> + <UserPanel + openUserDetailsPanel={jest.fn} + data={mockAlertDetailsTimelineResponse} + selectedPatterns={['random-pattern']} + {...propOverrides} + /> + </TestProviders> + ); + + beforeEach(() => { + mockUseRiskScore.mockReturnValue({ ...defaultRiskReturnValues }); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('should render basic user fields', () => { + const { getByTestId } = render(<UserPanelWithDefaultProps />); + const simpleUserFields = ['user.name']; + + simpleUserFields.forEach((simpleUserField) => { + expect(getByTestId('user-panel')).toHaveTextContent( + getTimelineEventData(simpleUserField, mockAlertDetailsTimelineResponse) + ); + }); + }); + + describe('user risk', () => { + it('should not show risk if the license is not valid', () => { + mockUseRiskScore.mockReturnValue({ + ...defaultRiskReturnValues, + isLicenseValid: false, + data: null, + }); + const { queryByTestId } = render(<UserPanelWithDefaultProps />); + expect(queryByTestId('user-panel-risk')).toBe(null); + }); + + it('should render risk fields', () => { + const calculatedScoreNorm = 98.9; + const calculatedLevel = RiskSeverity.critical; + + mockUseRiskScore.mockReturnValue({ + ...defaultRiskReturnValues, + isLicenseValid: true, + data: [ + { + user: { + name: mockAlertNestedDetailsTimelineResponse.user?.name, + risk: { + calculated_score_norm: calculatedScoreNorm, + calculated_level: calculatedLevel, + }, + }, + }, + ], + }); + const { getByTestId } = render(<UserPanelWithDefaultProps />); + + expect(getByTestId('user-panel-risk')).toHaveTextContent( + `${Math.round(calculatedScoreNorm)}` + ); + expect(getByTestId('user-panel-risk')).toHaveTextContent(calculatedLevel); + }); + }); + + describe('source ip', () => { + it('should render all the ip fields', () => { + const { getByTestId } = render(<UserPanelWithDefaultProps />); + const ipFields = find( + { field: 'source.ip', category: 'source' }, + mockAlertDetailsTimelineResponse + )?.values as string[]; + expect(getByTestId('user-panel-ip')).toHaveTextContent(ipFields[0]); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel_actions.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel_actions.tsx new file mode 100644 index 0000000000000..575673a494a2f --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel_actions.tsx @@ -0,0 +1,99 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; +import React, { useCallback, useMemo, useState } from 'react'; +import { getUsersDetailsUrl } from '../../../../../../common/components/link_to/redirect_to_users'; +import { SecurityPageName } from '../../../../../../app/types'; +import { useGetSecuritySolutionLinkProps } from '../../../../../../common/components/links'; + +import { OPEN_USER_DETAILS_PAGE, SUMMARY_PANEL_ACTIONS, VIEW_USER_SUMMARY } from '../translation'; + +export const USER_PANEL_ACTIONS_CLASS = 'user-panel-actions-trigger'; + +export const UserPanelActions = React.memo( + ({ + className, + openUserDetailsPanel, + userName, + }: { + className?: string; + userName: string; + openUserDetailsPanel: (userName: string) => void; + }) => { + const [isPopoverOpen, setPopover] = useState(false); + const { href } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.users, + path: getUsersDetailsUrl(userName), + }); + + const onButtonClick = useCallback(() => { + setPopover(!isPopoverOpen); + }, [isPopoverOpen]); + + const closePopover = () => { + setPopover(false); + }; + + const handleopenUserDetailsPanel = useCallback(() => { + openUserDetailsPanel(userName); + closePopover(); + }, [userName, openUserDetailsPanel]); + + const items = useMemo( + () => [ + <EuiContextMenuItem + icon="expand" + key="userActionsViewUserSummary" + onClick={handleopenUserDetailsPanel} + data-test-subj="user-panel-actions-view-summary" + > + {VIEW_USER_SUMMARY} + </EuiContextMenuItem>, + <EuiContextMenuItem + icon="popout" + key="userActionsOpenUserDetailsPage" + data-test-subj="user-panel-actions-open-user-details" + onClick={closePopover} + href={href} + target="_blank" + > + {OPEN_USER_DETAILS_PAGE} + </EuiContextMenuItem>, + ], + [handleopenUserDetailsPanel, href] + ); + + const button = useMemo( + () => ( + <EuiButtonIcon + aria-label={SUMMARY_PANEL_ACTIONS} + className={USER_PANEL_ACTIONS_CLASS} + iconType="boxesHorizontal" + onClick={onButtonClick} + /> + ), + [onButtonClick] + ); + + return ( + <div className={className}> + <EuiPopover + button={button} + isOpen={isPopoverOpen} + closePopover={closePopover} + panelPaddingSize="none" + anchorPosition="downLeft" + panelClassName="withHoverActions__popover" + > + <EuiContextMenuPanel data-test-subj="user-actions-panel" size="s" items={items} /> + </EuiPopover> + </div> + ); + } +); + +UserPanelActions.displayName = 'UserPanelActions'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/wrappers.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/wrappers.tsx new file mode 100644 index 0000000000000..af3b33d9b0be0 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/wrappers.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 from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui'; +import { css } from '@emotion/react'; +import type { FlexItemGrowSize } from '@elastic/eui/src/components/flex/flex_item'; +import { HoverVisibilityContainer } from '../../../../../common/components/hover_visibility_container'; + +export const SummaryColumn: React.FC<{ grow?: FlexItemGrowSize }> = ({ children, grow }) => ( + <EuiFlexItem grow={grow}> + <EuiFlexGroup + direction="column" + wrap={false} + css={css` + flex-wrap: nowrap; + `} + > + {children} + </EuiFlexGroup> + </EuiFlexItem> +); + +export const SummaryRow: React.FC<{ grow?: FlexItemGrowSize }> = ({ children, grow }) => ( + <EuiFlexItem grow={grow}> + <EuiFlexGroup direction="row" wrap> + {children} + </EuiFlexGroup> + </EuiFlexItem> +); + +export const SummaryPanel: React.FC<{ + grow?: FlexItemGrowSize; + title: string; + actionsClassName?: string; + renderActionsPopover?: () => JSX.Element; +}> = ({ actionsClassName, children, grow = false, renderActionsPopover, title }) => ( + <EuiFlexItem grow={grow}> + <EuiPanel hasShadow={false} hasBorder> + <HoverVisibilityContainer targetClassNames={[actionsClassName ?? '']}> + <EuiFlexGroup direction="row" justifyContent="spaceBetween"> + <EuiFlexItem> + <EuiTitle size="s"> + <h3>{title}</h3> + </EuiTitle> + </EuiFlexItem> + {actionsClassName && renderActionsPopover ? ( + <EuiFlexItem grow={false}>{renderActionsPopover()}</EuiFlexItem> + ) : null} + </EuiFlexGroup> + </HoverVisibilityContainer> + <EuiSpacer size="l" /> + {children} + </EuiPanel> + </EuiFlexItem> +); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/translations.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/translations.ts new file mode 100644 index 0000000000000..cc95a183cb5ac --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/translations.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 { i18n } from '@kbn/i18n'; + +export const SUMMARY_PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.navigation.summary', + { + defaultMessage: 'Summary', + } +); + +export const BACK_TO_ALERTS_LINK = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.header.backToAlerts', + { + defaultMessage: 'Back to alerts', + } +); + +export const LOADING_PAGE_MESSAGE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.loadingPage.message', + { + defaultMessage: 'Loading details page...', + } +); + +export const ERROR_PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.errorPage.title', + { + defaultMessage: 'Unable to load the details page', + } +); + +export const ERROR_PAGE_BODY = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.errorPage.message', + { + defaultMessage: + 'There was an error loading the details page. Please confirm the following id points to a valid document', + } +); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/types.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/types.ts new file mode 100644 index 0000000000000..3b4138a9d3d7d --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/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. + */ + +import type { NavTab } from '../../../common/components/navigation/types'; + +export enum AlertDetailRouteType { + summary = 'summary', +} + +export type AlertDetailNavTabs = Record<`${AlertDetailRouteType}`, NavTab>; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/breadcrumbs.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/breadcrumbs.ts new file mode 100644 index 0000000000000..632c40816476b --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/breadcrumbs.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 type { ChromeBreadcrumb } from '@kbn/core/public'; +import type { GetSecuritySolutionUrl } from '../../../../common/components/link_to'; +import { getAlertDetailsUrl } from '../../../../common/components/link_to'; +import { SecurityPageName } from '../../../../../common/constants'; +import type { AlertDetailRouteSpyState } from '../../../../common/utils/route/types'; +import { AlertDetailRouteType } from '../types'; +import * as i18n from '../translations'; + +const TabNameMappedToI18nKey: Record<AlertDetailRouteType, string> = { + [AlertDetailRouteType.summary]: i18n.SUMMARY_PAGE_TITLE, +}; + +export const getTrailingBreadcrumbs = ( + params: AlertDetailRouteSpyState, + getSecuritySolutionUrl: GetSecuritySolutionUrl +): ChromeBreadcrumb[] => { + let breadcrumb: ChromeBreadcrumb[] = []; + + if (params.detailName != null) { + breadcrumb = [ + ...breadcrumb, + { + text: params.state?.ruleName ?? params.detailName, + href: getSecuritySolutionUrl({ + path: getAlertDetailsUrl(params.detailName, ''), + deepLinkId: SecurityPageName.alerts, + }), + }, + ]; + } + if (params.tabName != null) { + breadcrumb = [ + ...breadcrumb, + { + text: TabNameMappedToI18nKey[params.tabName], + href: '', + }, + ]; + } + return breadcrumb; +}; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/get_timeline_event_data.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/get_timeline_event_data.ts new file mode 100644 index 0000000000000..7d5dbc5440087 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/get_timeline_event_data.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 { TimelineEventsDetailsItem } from '../../../../../common/search_strategy'; + +export const getTimelineEventData = (field: string, data: TimelineEventsDetailsItem[] | null) => { + const valueArray = data?.find((datum) => datum.field === field)?.values; + return valueArray && valueArray.length > 0 ? valueArray[0] : ''; +}; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/navigation.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/navigation.ts new file mode 100644 index 0000000000000..540cd99ad9bde --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/navigation.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 type { AlertDetailNavTabs } from '../types'; +import { ALERTS_PATH } from '../../../../../common/constants'; +import { AlertDetailRouteType } from '../types'; +import * as i18n from '../translations'; + +export const getAlertDetailsTabUrl = (alertId: string, tabName: AlertDetailRouteType) => + `${ALERTS_PATH}/${alertId}/${tabName}`; + +export const getAlertDetailsNavTabs = (alertId: string): AlertDetailNavTabs => ({ + [AlertDetailRouteType.summary]: { + id: AlertDetailRouteType.summary, + name: i18n.SUMMARY_PAGE_TITLE, + href: getAlertDetailsTabUrl(alertId, AlertDetailRouteType.summary), + disabled: false, + }, +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx index 288b389215e48..d9ac9813ec72e 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx @@ -6,16 +6,20 @@ */ import React from 'react'; -import { Switch } from 'react-router-dom'; +import { Redirect, Switch } from 'react-router-dom'; import { Route } from '@kbn/kibana-react-plugin/public'; import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; +import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_experimental_features'; import { ALERTS_PATH, SecurityPageName } from '../../../../common/constants'; import { NotFoundPage } from '../../../app/404'; import * as i18n from './translations'; import { DetectionEnginePage } from '../detection_engine/detection_engine'; import { SpyRoute } from '../../../common/utils/route/spy_routes'; import { useReadonlyHeader } from '../../../use_readonly_header'; +import { AlertDetailsPage } from '../alert_details'; +import { AlertDetailRouteType } from '../alert_details/types'; +import { getAlertDetailsTabUrl } from '../alert_details/utils/navigation'; const AlertsRoute = () => ( <TrackApplicationView viewId={SecurityPageName.alerts}> @@ -24,12 +28,40 @@ const AlertsRoute = () => ( </TrackApplicationView> ); +const AlertDetailsRoute = () => ( + <TrackApplicationView viewId={SecurityPageName.alerts}> + <AlertDetailsPage /> + </TrackApplicationView> +); + const AlertsContainerComponent: React.FC = () => { useReadonlyHeader(i18n.READ_ONLY_BADGE_TOOLTIP); - + const isAlertDetailsPageEnabled = useIsExperimentalFeatureEnabled('alertDetailsPageEnabled'); return ( <Switch> <Route path={ALERTS_PATH} exact component={AlertsRoute} /> + {isAlertDetailsPageEnabled && ( + <> + {/* Redirect to the summary page if only the detail name is provided */} + <Route + path={`${ALERTS_PATH}/:detailName`} + render={({ + match: { + params: { detailName }, + }, + location: { search = '' }, + }) => ( + <Redirect + to={{ + pathname: getAlertDetailsTabUrl(detailName, AlertDetailRouteType.summary), + search, + }} + /> + )} + /> + <Route path={`${ALERTS_PATH}/:detailName/:tabName`} component={AlertDetailsRoute} /> + </> + )} <Route component={NotFoundPage} /> </Switch> ); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts index b9948ca90578b..c96ac7f576874 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts @@ -1071,10 +1071,18 @@ export const RULES_BULK_EDIT_SUCCESS_DESCRIPTION = (rulesCount: number) => { values: { rulesCount }, defaultMessage: - "You've successfully updated {rulesCount, plural, =1 {# rule} other {# rules}}. If you did not select to apply changes to rules using Kibana data views, those rules were not updated and will continue using data views.", + "You've successfully updated {rulesCount, plural, =1 {# rule} other {# rules}}", } ); +export const RULES_BULK_EDIT_SUCCESS_INDEX_EDIT_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.successIndexEditToastDescription', + { + defaultMessage: + 'If you did not select to apply changes to rules using Kibana data views, those rules were not updated and will continue using data views.', + } +); + export const RULES_BULK_EDIT_FAILURE = i18n.translate( 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.errorToastTitle', { diff --git a/x-pack/plugins/security_solution/public/exceptions/jest.config.js b/x-pack/plugins/security_solution/public/exceptions/jest.config.js new file mode 100644 index 0000000000000..f4b96b3f07e7a --- /dev/null +++ b/x-pack/plugins/security_solution/public/exceptions/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 = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/plugins/security_solution/public/exceptions'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/exceptions', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/plugins/security_solution/public/exceptions/**/*.{ts,tsx}', + ], + // See: https://github.com/elastic/kibana/issues/117255, the moduleNameMapper creates mocks to avoid memory leaks from kibana core. + moduleNameMapper: { + 'core/server$': '<rootDir>/x-pack/plugins/security_solution/server/__mocks__/core.mock.ts', + 'task_manager/server$': + '<rootDir>/x-pack/plugins/security_solution/server/__mocks__/task_manager.mock.ts', + 'alerting/server$': '<rootDir>/x-pack/plugins/security_solution/server/__mocks__/alert.mock.ts', + 'actions/server$': '<rootDir>/x-pack/plugins/security_solution/server/__mocks__/action.mock.ts', + }, +}; diff --git a/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_list_card.tsx b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_list_card.tsx new file mode 100644 index 0000000000000..cc2552b4f9fd7 --- /dev/null +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_list_card.tsx @@ -0,0 +1,150 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { memo, useState } from 'react'; + +import { + EuiLink, + EuiButtonIcon, + EuiContextMenuItem, + EuiContextMenuPanel, + EuiFlexGroup, + EuiFlexItem, + EuiTextColor, + EuiPanel, + EuiPopover, + EuiText, +} from '@elastic/eui'; +import type { HttpSetup } from '@kbn/core-http-browser'; +import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; +import type { ExceptionListInfo } from './use_all_exception_lists'; +import { TitleBadge } from './title_badge'; +import * as i18n from './translations'; + +interface ExceptionsListCardProps { + exceptionsList: ExceptionListInfo; + http: HttpSetup; + handleDelete: ({ + id, + listId, + namespaceType, + }: { + id: string; + listId: string; + namespaceType: NamespaceType; + }) => () => Promise<void>; + handleExport: ({ + id, + listId, + namespaceType, + }: { + id: string; + listId: string; + namespaceType: NamespaceType; + }) => () => Promise<void>; + readOnly: boolean; +} + +export const ExceptionsListCard = memo<ExceptionsListCardProps>( + ({ exceptionsList, http, handleDelete, handleExport, readOnly }) => { + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + + const onItemActionsClick = () => setIsPopoverOpen((isOpen) => !isOpen); + const onClosePopover = () => setIsPopoverOpen(false); + + return ( + <EuiFlexGroup> + <EuiFlexItem> + <EuiPanel> + <EuiFlexGroup key={exceptionsList.list_id} alignItems="center" gutterSize="l"> + <EuiFlexItem grow={true}> + <EuiFlexGroup gutterSize="none"> + <EuiFlexItem grow={true}> + <EuiFlexGroup direction="column" alignItems="flexStart"> + <EuiFlexItem grow={false} component={'span'}> + <EuiLink data-test-subj="exception-list-name"> + {exceptionsList.name.toString()} + </EuiLink> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText size="xs"> + <EuiTextColor color="subdued">{exceptionsList.description}</EuiTextColor> + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiFlexGroup gutterSize="s" alignItems="center"> + <TitleBadge title={i18n.CREATED_BY} badgeString={exceptionsList.created_by} /> + <TitleBadge title={i18n.CREATED_AT} badgeString={exceptionsList.created_at} /> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiPopover + data-test-subj="exceptionsListCardOverflowActions" + button={ + <EuiButtonIcon + isDisabled={false} + data-test-subj="exceptionsListCardOverflowActions" + aria-label="Exception item actions menu" + iconType="boxesHorizontal" + onClick={onItemActionsClick} + /> + } + panelPaddingSize="none" + isOpen={isPopoverOpen} + closePopover={onClosePopover} + > + <EuiContextMenuPanel + size="s" + items={[ + <EuiContextMenuItem + key={'delete'} + disabled={exceptionsList.list_id === 'endpoint_list' || readOnly} + data-test-subj="exceptionsTableDeleteButton" + icon={'trash'} + onClick={() => { + onClosePopover(); + handleDelete({ + id: exceptionsList.id, + listId: exceptionsList.list_id, + namespaceType: exceptionsList.namespace_type, + })(); + }} + > + {i18n.DELETE_EXCEPTION_LIST} + </EuiContextMenuItem>, + <EuiContextMenuItem + key={'export'} + icon={'exportAction'} + data-test-subj="exceptionsTableExportButton" + onClick={() => { + onClosePopover(); + handleExport({ + id: exceptionsList.id, + listId: exceptionsList.list_id, + namespaceType: exceptionsList.namespace_type, + })(); + }} + > + {i18n.EXPORT_EXCEPTION_LIST} + </EuiContextMenuItem>, + ]} + /> + </EuiPopover> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + </EuiFlexItem> + </EuiFlexGroup> + ); + } +); + +ExceptionsListCard.displayName = 'ExceptionsListCard'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_search_bar.tsx b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_search_bar.tsx similarity index 95% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_search_bar.tsx rename to x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_search_bar.tsx index 0a348a28a0a38..bcd9e99498f58 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_search_bar.tsx +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_search_bar.tsx @@ -9,7 +9,7 @@ import React from 'react'; import type { EuiSearchBarProps } from '@elastic/eui'; import { EuiSearchBar } from '@elastic/eui'; -import * as i18n from './translations'; +import * as i18n from './translations_exceptions_table'; interface ExceptionListsTableSearchProps { onSearch: (args: Parameters<NonNullable<EuiSearchBarProps['onChange']>>[0]) => void; diff --git a/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table.test.tsx b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table.test.tsx new file mode 100644 index 0000000000000..03196264b79c2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table.test.tsx @@ -0,0 +1,133 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { mount } from 'enzyme'; + +import { TestProviders } from '../../common/mock'; +import { getExceptionListSchemaMock } from '@kbn/lists-plugin/common/schemas/response/exception_list_schema.mock'; +import { useUserData } from '../../detections/components/user_info'; + +import { ExceptionListsTable } from './exceptions_table'; +import { useApi, useExceptionLists } from '@kbn/securitysolution-list-hooks'; +import { useAllExceptionLists } from './use_all_exception_lists'; +import { useHistory } from 'react-router-dom'; +import { generateHistoryMock } from '../../common/utils/route/mocks'; + +jest.mock('../../detections/components/user_info'); +jest.mock('../../common/lib/kibana'); +jest.mock('./use_all_exception_lists'); +jest.mock('@kbn/securitysolution-list-hooks'); +jest.mock('react-router-dom', () => { + const originalModule = jest.requireActual('react-router-dom'); + return { + ...originalModule, + useHistory: jest.fn(), + }; +}); +jest.mock('@kbn/i18n-react', () => { + const originalModule = jest.requireActual('@kbn/i18n-react'); + const FormattedRelative = jest.fn().mockImplementation(() => '20 hours ago'); + + return { + ...originalModule, + FormattedRelative, + }; +}); + +jest.mock('../../detections/containers/detection_engine/lists/use_lists_config', () => ({ + useListsConfig: jest.fn().mockReturnValue({ loading: false }), +})); + +describe('ExceptionListsTable', () => { + const mockHistory = generateHistoryMock(); + const exceptionList1 = getExceptionListSchemaMock(); + const exceptionList2 = { ...getExceptionListSchemaMock(), list_id: 'not_endpoint_list', id: '2' }; + + beforeAll(() => { + (useHistory as jest.Mock).mockReturnValue(mockHistory); + }); + + beforeEach(() => { + (useApi as jest.Mock).mockReturnValue({ + deleteExceptionList: jest.fn(), + exportExceptionList: jest.fn(), + }); + + (useExceptionLists as jest.Mock).mockReturnValue([ + false, + [exceptionList1, exceptionList2], + { + page: 1, + perPage: 20, + total: 2, + }, + jest.fn(), + ]); + + (useAllExceptionLists as jest.Mock).mockReturnValue([ + false, + [ + { ...exceptionList1, rules: [] }, + { ...exceptionList2, rules: [] }, + ], + { + not_endpoint_list: exceptionList2, + endpoint_list: exceptionList1, + }, + ]); + + (useUserData as jest.Mock).mockReturnValue([ + { + loading: false, + canUserCRUD: false, + canUserREAD: false, + }, + ]); + }); + + it('renders delete option as disabled if list is "endpoint_list"', async () => { + const wrapper = mount( + <TestProviders> + <ExceptionListsTable /> + </TestProviders> + ); + + wrapper + .find('[data-test-subj="exceptionsListCardOverflowActions"] button') + .at(0) + .simulate('click'); + + expect(wrapper.find('[data-test-subj="exceptionsTableDeleteButton"] button')).toHaveLength(1); + expect( + wrapper.find('[data-test-subj="exceptionsTableDeleteButton"] button').at(0).prop('disabled') + ).toBeTruthy(); + }); + + it('renders delete option as disabled if user is read only', async () => { + (useUserData as jest.Mock).mockReturnValue([ + { + loading: false, + canUserCRUD: false, + canUserREAD: true, + }, + ]); + + const wrapper = mount( + <TestProviders> + <ExceptionListsTable /> + </TestProviders> + ); + wrapper + .find('[data-test-subj="exceptionsListCardOverflowActions"] button') + .at(0) + .simulate('click'); + expect( + wrapper.find('[data-test-subj="exceptionsTableDeleteButton"] button').at(0).prop('disabled') + ).toBeTruthy(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table.tsx b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table.tsx new file mode 100644 index 0000000000000..3eb7b0bdd2889 --- /dev/null +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table.tsx @@ -0,0 +1,480 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, useCallback, useState } from 'react'; +import type { EuiSearchBarProps } from '@elastic/eui'; + +import { + EuiButtonEmpty, + EuiContextMenuItem, + EuiContextMenuPanel, + EuiPagination, + EuiPopover, + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiLoadingContent, + EuiProgress, + EuiSpacer, + EuiPageHeader, + EuiHorizontalRule, +} from '@elastic/eui'; + +import type { NamespaceType, ExceptionListFilter } from '@kbn/securitysolution-io-ts-list-types'; +import { useApi, useExceptionLists } from '@kbn/securitysolution-list-hooks'; + +import { AutoDownload } from '../../common/components/auto_download/auto_download'; +import { Loader } from '../../common/components/loader'; +import { useKibana } from '../../common/lib/kibana'; +import { useAppToasts } from '../../common/hooks/use_app_toasts'; + +import * as i18n from './translations_exceptions_table'; +import { ExceptionsTableUtilityBar } from './exceptions_table_utility_bar'; +import { useAllExceptionLists } from './use_all_exception_lists'; +import { ReferenceErrorModal } from '../../detections/components/value_lists_management_flyout/reference_error_modal'; +import { patchRule } from '../../detection_engine/rule_management/api/api'; +import { ExceptionsSearchBar } from './exceptions_search_bar'; +import { getSearchFilters } from '../../detection_engine/rule_management_ui/components/rules_table/helpers'; +import { useUserData } from '../../detections/components/user_info'; +import { useListsConfig } from '../../detections/containers/detection_engine/lists/use_lists_config'; +import { MissingPrivilegesCallOut } from '../../detections/components/callouts/missing_privileges_callout'; +import { ALL_ENDPOINT_ARTIFACT_LIST_IDS } from '../../../common/endpoint/service/artifacts/constants'; +import { ExceptionsListCard } from './exceptions_list_card'; + +import { ImportExceptionListFlyout } from './import_exceptions_list_flyout'; + +export type Func = () => Promise<void>; + +interface ReferenceModalState { + contentText: string; + rulesReferences: string[]; + isLoading: boolean; + listId: string; + listNamespaceType: NamespaceType; +} + +const exceptionReferenceModalInitialState: ReferenceModalState = { + contentText: '', + rulesReferences: [], + isLoading: false, + listId: '', + listNamespaceType: 'single', +}; + +export const ExceptionListsTable = React.memo(() => { + const [{ loading: userInfoLoading, canUserCRUD, canUserREAD }] = useUserData(); + + const { loading: listsConfigLoading } = useListsConfig(); + const loading = userInfoLoading || listsConfigLoading; + + const { + services: { http, notifications, timelines }, + } = useKibana(); + const { exportExceptionList, deleteExceptionList } = useApi(http); + + const [showReferenceErrorModal, setShowReferenceErrorModal] = useState(false); + const [referenceModalState, setReferenceModalState] = useState<ReferenceModalState>( + exceptionReferenceModalInitialState + ); + const [filters, setFilters] = useState<ExceptionListFilter | undefined>(undefined); + const [loadingExceptions, exceptions, pagination, setPagination, refreshExceptions] = + useExceptionLists({ + errorMessage: i18n.ERROR_EXCEPTION_LISTS, + filterOptions: filters, + http, + namespaceTypes: ['single', 'agnostic'], + notifications, + hideLists: ALL_ENDPOINT_ARTIFACT_LIST_IDS, + }); + const [loadingTableInfo, exceptionListsWithRuleRefs, exceptionsListsRef] = useAllExceptionLists({ + exceptionLists: exceptions ?? [], + }); + + const [initLoading, setInitLoading] = useState(true); + const [lastUpdated, setLastUpdated] = useState(Date.now()); + + const [exportDownload, setExportDownload] = useState<{ name?: string; blob?: Blob }>({}); + const [displayImportListFlyout, setDisplayImportListFlyout] = useState(false); + const { addError, addSuccess } = useAppToasts(); + + const handleDeleteSuccess = useCallback( + (listId?: string) => () => { + notifications.toasts.addSuccess({ + title: i18n.exceptionDeleteSuccessMessage(listId ?? referenceModalState.listId), + }); + }, + [notifications.toasts, referenceModalState.listId] + ); + + const handleDeleteError = useCallback( + (err: Error & { body?: { message: string } }): void => { + addError(err, { + title: i18n.EXCEPTION_DELETE_ERROR, + }); + }, + [addError] + ); + + const handleDelete = useCallback( + ({ id, listId, namespaceType }: { id: string; listId: string; namespaceType: NamespaceType }) => + async () => { + try { + if (exceptionsListsRef[id] != null && exceptionsListsRef[id].rules.length === 0) { + await deleteExceptionList({ + id, + namespaceType, + onError: handleDeleteError, + onSuccess: handleDeleteSuccess(listId), + }); + + if (refreshExceptions != null) { + refreshExceptions(); + } + } else { + setReferenceModalState({ + contentText: i18n.referenceErrorMessage(exceptionsListsRef[id].rules.length), + rulesReferences: exceptionsListsRef[id].rules.map(({ name }) => name), + isLoading: true, + listId: id, + listNamespaceType: namespaceType, + }); + setShowReferenceErrorModal(true); + } + // route to patch rules with associated exception list + } catch (error) { + handleDeleteError(error); + } + }, + [ + deleteExceptionList, + exceptionsListsRef, + handleDeleteError, + handleDeleteSuccess, + refreshExceptions, + ] + ); + + const handleExportSuccess = useCallback( + (listId: string) => + (blob: Blob): void => { + addSuccess(i18n.EXCEPTION_EXPORT_SUCCESS); + setExportDownload({ name: listId, blob }); + }, + [addSuccess] + ); + + const handleExportError = useCallback( + (err: Error) => { + addError(err, { title: i18n.EXCEPTION_EXPORT_ERROR }); + }, + [addError] + ); + + const handleExport = useCallback( + ({ id, listId, namespaceType }: { id: string; listId: string; namespaceType: NamespaceType }) => + async () => { + await exportExceptionList({ + id, + listId, + namespaceType, + onError: handleExportError, + onSuccess: handleExportSuccess(listId), + }); + }, + [exportExceptionList, handleExportError, handleExportSuccess] + ); + + const handleRefresh = useCallback((): void => { + if (refreshExceptions != null) { + setLastUpdated(Date.now()); + refreshExceptions(); + } + }, [refreshExceptions]); + + useEffect(() => { + if (initLoading && !loading && !loadingExceptions && !loadingTableInfo) { + setInitLoading(false); + } + }, [initLoading, loading, loadingExceptions, loadingTableInfo]); + + const handleSearch = useCallback( + async ({ + query, + queryText, + }: Parameters<NonNullable<EuiSearchBarProps['onChange']>>[0]): Promise<void> => { + const filterOptions = { + name: null, + list_id: null, + created_by: null, + type: null, + tags: null, + }; + const searchTerms = getSearchFilters({ + defaultSearchTerm: 'name', + filterOptions, + query, + searchValue: queryText, + }); + setFilters(searchTerms); + }, + [] + ); + + const handleCloseReferenceErrorModal = useCallback((): void => { + setShowReferenceErrorModal(false); + setReferenceModalState({ + contentText: '', + rulesReferences: [], + isLoading: false, + listId: '', + listNamespaceType: 'single', + }); + }, []); + + const handleReferenceDelete = useCallback(async (): Promise<void> => { + const exceptionListId = referenceModalState.listId; + const exceptionListNamespaceType = referenceModalState.listNamespaceType; + const relevantRules = exceptionsListsRef[exceptionListId].rules; + + try { + await Promise.all( + relevantRules.map((rule) => { + const abortCtrl = new AbortController(); + const exceptionLists = (rule.exceptions_list ?? []).filter( + ({ id }) => id !== exceptionListId + ); + + return patchRule({ + ruleProperties: { + rule_id: rule.rule_id, + exceptions_list: exceptionLists, + }, + signal: abortCtrl.signal, + }); + }) + ); + + await deleteExceptionList({ + id: exceptionListId, + namespaceType: exceptionListNamespaceType, + onError: handleDeleteError, + onSuccess: handleDeleteSuccess(), + }); + } catch (err) { + handleDeleteError(err); + } finally { + setReferenceModalState(exceptionReferenceModalInitialState); + setShowReferenceErrorModal(false); + if (refreshExceptions != null) { + refreshExceptions(); + } + } + }, [ + referenceModalState.listId, + referenceModalState.listNamespaceType, + exceptionsListsRef, + deleteExceptionList, + handleDeleteError, + handleDeleteSuccess, + refreshExceptions, + ]); + + const handleOnDownload = useCallback(() => { + setExportDownload({}); + }, []); + + const [activePage, setActivePage] = useState(0); + const [rowSize, setRowSize] = useState(5); + const [isRowSizePopoverOpen, setIsRowSizePopoverOpen] = useState(false); + const onRowSizeButtonClick = () => setIsRowSizePopoverOpen((val) => !val); + const closeRowSizePopover = () => setIsRowSizePopoverOpen(false); + + const rowSizeButton = ( + <EuiButtonEmpty + size="xs" + color="text" + iconType="arrowDown" + iconSide="right" + onClick={onRowSizeButtonClick} + > + {`Rows per page: ${rowSize}`} + </EuiButtonEmpty> + ); + + const getIconType = (size: number) => { + return size === rowSize ? 'check' : 'empty'; + }; + + const rowSizeItems = [ + <EuiContextMenuItem + key="5 rows" + icon={getIconType(5)} + onClick={() => { + closeRowSizePopover(); + setRowSize(5); + }} + > + {'5 rows'} + </EuiContextMenuItem>, + <EuiContextMenuItem + key="10 rows" + icon={getIconType(10)} + onClick={() => { + closeRowSizePopover(); + setRowSize(10); + }} + > + {'10 rows'} + </EuiContextMenuItem>, + <EuiContextMenuItem + key="25 rows" + icon={getIconType(25)} + onClick={() => { + closeRowSizePopover(); + setRowSize(25); + }} + > + {'25 rows'} + </EuiContextMenuItem>, + ]; + + useEffect(() => { + setPagination({ + // off-by-one error + // we should really update the api to be zero-index based + // the same way the pagination component in EUI is zero based. + page: activePage + 1, + perPage: rowSize, + total: 0, + }); + }, [activePage, rowSize, setPagination]); + + const goToPage = (pageNumber: number) => setActivePage(pageNumber); + + return ( + <> + <MissingPrivilegesCallOut /> + <EuiFlexGroup> + <EuiFlexItem> + <EuiPageHeader + pageTitle={i18n.ALL_EXCEPTIONS} + description={timelines.getLastUpdated({ + showUpdating: loading, + updatedAt: lastUpdated, + })} + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButton iconType={'importAction'} onClick={() => setDisplayImportListFlyout(true)}> + {i18n.IMPORT_EXCEPTION_LIST} + </EuiButton> + </EuiFlexItem> + </EuiFlexGroup> + + {displayImportListFlyout && ( + <ImportExceptionListFlyout + handleRefresh={handleRefresh} + http={http} + addSuccess={addSuccess} + addError={addError} + setDisplayImportListFlyout={setDisplayImportListFlyout} + /> + )} + + <EuiHorizontalRule /> + <div data-test-subj="allExceptionListsPanel"> + {loadingTableInfo && ( + <EuiProgress + data-test-subj="loadingRulesInfoProgress" + size="xs" + position="absolute" + color="accent" + /> + )} + {!initLoading && <ExceptionsSearchBar onSearch={handleSearch} />} + <EuiSpacer size="m" /> + + {loadingTableInfo && !initLoading && !showReferenceErrorModal && ( + <Loader data-test-subj="loadingPanelAllRulesTable" overlay size="xl" /> + )} + + {initLoading || loadingTableInfo ? ( + <EuiLoadingContent data-test-subj="initialLoadingPanelAllRulesTable" lines={10} /> + ) : ( + <> + <ExceptionsTableUtilityBar + totalExceptionLists={exceptionListsWithRuleRefs.length} + onRefresh={handleRefresh} + /> + <EuiSpacer size="m" /> + {exceptionListsWithRuleRefs.length > 0 && canUserCRUD !== null && canUserREAD !== null && ( + <React.Fragment data-test-subj="exceptionsTable"> + {exceptionListsWithRuleRefs.map((excList) => ( + <ExceptionsListCard + key={excList.list_id} + data-test-subj="exceptionsListCard" + readOnly={canUserREAD && !canUserCRUD} + http={http} + exceptionsList={excList} + handleDelete={handleDelete} + handleExport={handleExport} + /> + ))} + </React.Fragment> + )} + </> + )} + <EuiFlexGroup> + <EuiFlexItem style={{ flex: '1 1 auto' }}> + <EuiFlexGroup alignItems="flexStart"> + <EuiFlexItem> + <EuiPopover + button={rowSizeButton} + isOpen={isRowSizePopoverOpen} + closePopover={closeRowSizePopover} + > + <EuiContextMenuPanel items={rowSizeItems} /> + </EuiPopover> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem style={{ alignItems: 'flex-end' }}> + <EuiFlexGroup alignItems="flexEnd"> + <EuiFlexItem> + <EuiPagination + aria-label={'Custom pagination example'} + pageCount={pagination.total ? Math.ceil(pagination.total / rowSize) : 0} + activePage={activePage} + onPageClick={goToPage} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + + <AutoDownload + blob={exportDownload.blob} + name={`${exportDownload.name}.ndjson`} + onDownload={handleOnDownload} + /> + <ReferenceErrorModal + cancelText={i18n.REFERENCE_MODAL_CANCEL_BUTTON} + confirmText={i18n.REFERENCE_MODAL_CONFIRM_BUTTON} + contentText={referenceModalState.contentText} + onCancel={handleCloseReferenceErrorModal} + onClose={handleCloseReferenceErrorModal} + onConfirm={handleReferenceDelete} + references={referenceModalState.rulesReferences} + showModal={showReferenceErrorModal} + titleText={i18n.REFERENCE_MODAL_TITLE} + /> + </div> + </> + ); +}); + +ExceptionListsTable.displayName = 'ExceptionListsTable'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table_utility_bar.test.tsx b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table_utility_bar.test.tsx similarity index 96% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table_utility_bar.test.tsx rename to x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table_utility_bar.test.tsx index f40e0d66cb492..7d71fe78989a4 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table_utility_bar.test.tsx +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table_utility_bar.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { TestProviders } from '../../../../common/mock'; +import { TestProviders } from '../../common/mock'; import { render, screen, within } from '@testing-library/react'; import { ExceptionsTableUtilityBar } from './exceptions_table_utility_bar'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table_utility_bar.tsx b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table_utility_bar.tsx similarity index 92% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table_utility_bar.tsx rename to x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table_utility_bar.tsx index 98ac0bf25d8ec..d42b3e7c89a4e 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table_utility_bar.tsx +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/exceptions_table_utility_bar.tsx @@ -13,8 +13,8 @@ import { UtilityBarGroup, UtilityBarSection, UtilityBarText, -} from '../../../../common/components/utility_bar'; -import * as i18n from './translations'; +} from '../../common/components/utility_bar'; +import * as i18n from './translations_exceptions_table'; interface ExceptionsTableUtilityBarProps { onRefresh?: () => void; diff --git a/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/import_exceptions_list_flyout.tsx b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/import_exceptions_list_flyout.tsx new file mode 100644 index 0000000000000..ab19d153181b7 --- /dev/null +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/import_exceptions_list_flyout.tsx @@ -0,0 +1,201 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { SetStateAction, Dispatch } from 'react'; +import React, { useEffect, useRef, useCallback, useState } from 'react'; + +import { + useGeneratedHtmlId, + EuiButton, + EuiButtonEmpty, + EuiCheckbox, + EuiFilePicker, + EuiFlexGroup, + EuiFlexItem, + EuiFlyoutBody, + EuiFlyoutHeader, + EuiSpacer, + EuiText, + EuiTitle, + EuiFlyoutFooter, + EuiTextColor, + EuiFlyout, +} from '@elastic/eui'; +import type { + BulkErrorSchema, + ImportExceptionsResponseSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import type { HttpSetup } from '@kbn/core-http-browser'; +import type { ToastInput, Toast, ErrorToastOptions } from '@kbn/core-notifications-browser'; + +import { useImportExceptionList } from './use_import_exception_list'; + +import * as i18n from './translations'; + +export const ImportExceptionListFlyout = React.memo( + ({ + handleRefresh, + http, + addSuccess, + addError, + setDisplayImportListFlyout, + }: { + handleRefresh: () => void; + http: HttpSetup; + addSuccess: (toastOrTitle: ToastInput, options?: unknown) => Toast; + addError: (error: unknown, options: ErrorToastOptions) => Toast; + setDisplayImportListFlyout: Dispatch<SetStateAction<boolean>>; + }) => { + const filePickerRef = useRef<EuiFilePicker | null>(null); + + const filePickerId = useGeneratedHtmlId({ prefix: 'filePicker' }); + const [file, setFile] = useState<File | null>(null); + const [overwrite, setOverwrite] = useState(false); + const [asNewList, setAsNewList] = useState(false); + + const resetForm = useCallback(() => { + if (filePickerRef.current?.fileInput) { + filePickerRef.current.fileInput.value = ''; + filePickerRef.current.handleChange(); + } + setFile(null); + setAlreadyExistingItem(false); + setAsNewList(false); + setOverwrite(false); + }, []); + const { start: importExceptionList, ...importExceptionListState } = useImportExceptionList(); + const ctrl = useRef(new AbortController()); + + const handleImportExceptionList = useCallback(() => { + if (!importExceptionListState.loading && file) { + ctrl.current = new AbortController(); + + importExceptionList({ + file, + http, + signal: ctrl.current.signal, + overwrite, + overwriteExceptions: overwrite, + asNewList, + }); + } + }, [asNewList, file, http, importExceptionList, importExceptionListState.loading, overwrite]); + + const handleImportSuccess = useCallback( + (response: ImportExceptionsResponseSchema) => { + resetForm(); + addSuccess({ + text: i18n.uploadSuccessMessage(file?.name ?? ''), + title: i18n.UPLOAD_SUCCESS_TITLE, + }); + handleRefresh(); + }, + // looking for file.name but we don't wan't to render success every time file name changes. + // eslint-disable-next-line react-hooks/exhaustive-deps + [resetForm, addSuccess, handleRefresh] + ); + const handleImportError = useCallback( + (errors: BulkErrorSchema[]) => { + errors.forEach((error) => { + if (!error.error.message.includes('AbortError')) { + addError(error.error.message, { title: i18n.UPLOAD_ERROR }); + } + }); + }, + [addError] + ); + const [alreadyExistingItem, setAlreadyExistingItem] = useState(false); + + useEffect(() => { + if (!importExceptionListState.loading) { + if (importExceptionListState?.result?.success) { + handleImportSuccess(importExceptionListState?.result); + } else if (importExceptionListState?.result?.errors) { + handleImportError(importExceptionListState?.result?.errors); + } + } + }, [ + handleImportError, + handleImportSuccess, + importExceptionListState.error, + importExceptionListState.loading, + importExceptionListState.result, + setAlreadyExistingItem, + ]); + const handleFileChange = useCallback((files: FileList | null) => { + setFile(files?.item(0) ?? null); + }, []); + return ( + <EuiFlyout ownFocus size="s" onClose={() => setDisplayImportListFlyout(false)}> + <EuiFlyoutHeader hasBorder> + <EuiTitle size="m"> + <h2>{i18n.IMPORT_EXCEPTION_LIST_HEADER}</h2> + </EuiTitle> + </EuiFlyoutHeader> + <EuiFlyoutBody> + <EuiText>{i18n.IMPORT_EXCEPTION_LIST_BODY}</EuiText> + <EuiFilePicker + id={filePickerId} + multiple + ref={filePickerRef} + initialPromptText={i18n.IMPORT_PROMPT} + onChange={handleFileChange} + display={'large'} + aria-label="Use aria labels when no actual label is in use" + /> + + {alreadyExistingItem && ( + <> + <EuiSpacer /> + <EuiTextColor color={'danger'}>{i18n.IMPORT_EXCEPTION_LIST_WARNING}</EuiTextColor> + <EuiSpacer /> + <EuiCheckbox + id={'basicCheckboxId'} + label={i18n.IMPORT_EXCEPTION_LIST_OVERWRITE} + checked={overwrite} + onChange={(e) => { + setOverwrite(!overwrite); + setAsNewList(false); + }} + /> + <EuiCheckbox + id={'createNewListCheckbox'} + label={i18n.IMPORT_EXCEPTION_LIST_AS_NEW_LIST} + checked={asNewList} + onChange={(e) => { + setAsNewList(!asNewList); + setOverwrite(false); + }} + /> + </> + )} + </EuiFlyoutBody> + <EuiFlyoutFooter> + <EuiFlexGroup justifyContent="spaceBetween"> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + iconType="cross" + onClick={() => setDisplayImportListFlyout(false)} + flush="left" + > + {i18n.CLOSE_FLYOUT} + </EuiButtonEmpty> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButton + data-test-subj="exception-lists-form-import-action" + onClick={handleImportExceptionList} + disabled={file == null || importExceptionListState.loading} + > + {i18n.UPLOAD_BUTTON} + </EuiButton> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlyoutFooter> + </EuiFlyout> + ); + } +); diff --git a/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/title_badge.tsx b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/title_badge.tsx new file mode 100644 index 0000000000000..a4572cc65788b --- /dev/null +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/title_badge.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, { memo } from 'react'; +import styled from 'styled-components'; + +import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; + +interface TitleBadgeProps { + title: string; + badgeString: string; +} + +const StyledFlexItem = styled(EuiFlexItem)` + border-right: 1px solid #d3dae6; + padding: 4px 12px 4px 0; +`; +export const TitleBadge = memo<TitleBadgeProps>(({ title, badgeString }) => { + return ( + <EuiFlexItem style={{ flex: '1 1 auto' }}> + <EuiFlexGroup gutterSize="xs" alignItems="center"> + <EuiFlexItem grow={false}> + <EuiText>{title}</EuiText> + </EuiFlexItem> + <StyledFlexItem grow={false}> + <EuiBadge>{badgeString}</EuiBadge>{' '} + </StyledFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + ); +}); + +TitleBadge.displayName = 'TitleBadge'; diff --git a/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/translations.ts b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/translations.ts new file mode 100644 index 0000000000000..ada66d4e9b602 --- /dev/null +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/translations.ts @@ -0,0 +1,106 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const uploadSuccessMessage = (fileName: string) => + i18n.translate('xpack.securitySolution.lists.exceptionListImportSuccess', { + defaultMessage: "Exception list '{fileName}' was imported", + values: { fileName }, + }); + +export const CREATED_BY = i18n.translate('xpack.securitySolution.exceptionsTable.createdBy', { + defaultMessage: 'Created By', +}); + +export const CREATED_AT = i18n.translate('xpack.securitySolution.exceptionsTable.createdAt', { + defaultMessage: 'Created At', +}); + +export const DELETE_EXCEPTION_LIST = i18n.translate( + 'xpack.securitySolution.exceptionsTable.deleteExceptionList', + { + defaultMessage: 'Delete Exception List', + } +); + +export const EXPORT_EXCEPTION_LIST = i18n.translate( + 'xpack.securitySolution.exceptionsTable.exportExceptionList', + { + defaultMessage: 'Export Exception List', + } +); + +export const IMPORT_EXCEPTION_LIST_HEADER = i18n.translate( + 'xpack.securitySolution.exceptionsTable.importExceptionListFlyoutHeader', + { + defaultMessage: 'Import shared exception list', + } +); + +export const IMPORT_EXCEPTION_LIST_BODY = i18n.translate( + 'xpack.securitySolution.exceptionsTable.importExceptionListFlyoutBody', + { + defaultMessage: 'Select shared exception lists to import', + } +); + +export const IMPORT_EXCEPTION_LIST_WARNING = i18n.translate( + 'xpack.securitySolution.exceptionsTable.importExceptionListWarning', + { + defaultMessage: 'We found a pre-existing list with that id', + } +); + +export const IMPORT_EXCEPTION_LIST_OVERWRITE = i18n.translate( + 'xpack.securitySolution.exceptionsTable.importExceptionListOverwrite', + { + defaultMessage: 'Overwrite the existing list', + } +); + +export const IMPORT_EXCEPTION_LIST_AS_NEW_LIST = i18n.translate( + 'xpack.securitySolution.exceptionsTable.importExceptionListAsNewList', + { + defaultMessage: 'Create new list', + } +); + +export const UPLOAD_SUCCESS_TITLE = i18n.translate( + 'xpack.securitySolution.lists.exceptionListImportSuccessTitle', + { + defaultMessage: 'Exception list imported', + } +); + +export const UPLOAD_ERROR = i18n.translate( + 'xpack.securitySolution.lists.exceptionListUploadError', + { + defaultMessage: 'There was an error uploading the exception list.', + } +); + +export const UPLOAD_BUTTON = i18n.translate( + 'xpack.securitySolution.exceptions.exceptionListsImportButton', + { + defaultMessage: 'Import list', + } +); + +export const CLOSE_FLYOUT = i18n.translate( + 'xpack.securitySolution.exceptions.exceptionListsCloseImportFlyout', + { + defaultMessage: 'Close', + } +); + +export const IMPORT_PROMPT = i18n.translate( + 'xpack.securitySolution.exceptions.exceptionListsFilePickerPrompt', + { + defaultMessage: 'Select or drag and drop multiple files', + } +); diff --git a/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/translations_exceptions_table.ts b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/translations_exceptions_table.ts new file mode 100644 index 0000000000000..a862a25b2d773 --- /dev/null +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/translations_exceptions_table.ts @@ -0,0 +1,203 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 EXCEPTION_LIST_ID_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.idTitle', + { + defaultMessage: 'List ID', + } +); + +export const EXCEPTION_LIST_NAME = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.listName', + { + defaultMessage: 'Name', + } +); + +export const EXCEPTION_LIST_ACTIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.actionsTitle', + { + defaultMessage: 'Actions', + } +); + +export const SHOWING_EXCEPTION_LISTS = (totalLists: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.showingExceptionLists', + { + values: { totalLists }, + defaultMessage: 'Showing {totalLists} {totalLists, plural, =1 {list} other {lists}}', + } + ); + +export const RULES_ASSIGNED_TO_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.rulesAssignedTitle', + { + defaultMessage: 'Rules assigned to', + } +); + +export const showMoreRules = (rulesCount: number) => + i18n.translate('xpack.securitySolution.detectionEngine.rules.all.exceptions.rulesPopoverButton', { + defaultMessage: '+{rulesCount} {rulesCount, plural, =1 {Rule} other {Rules}}', + values: { rulesCount }, + }); + +export const LIST_DATE_CREATED_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.dateCreatedTitle', + { + defaultMessage: 'Date created', + } +); + +export const LIST_DATE_UPDATED_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.dateUpdatedTitle', + { + defaultMessage: 'Last edited', + } +); + +export const ERROR_EXCEPTION_LISTS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.errorFetching', + { + defaultMessage: 'Error fetching exception lists', + } +); + +export const NO_EXCEPTION_LISTS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allExceptionLists.filters.noExceptionsTitle', + { + defaultMessage: 'No exception lists found', + } +); + +export const EXCEPTIONS_LISTS_SEARCH_PLACEHOLDER = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allExceptionLists.search.placeholder', + { + defaultMessage: 'Search exception lists', + } +); + +export const ALL_EXCEPTIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allExceptions.tableTitle', + { + defaultMessage: 'Rule Exceptions', + } +); + +export const NO_LISTS_BODY = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allExceptions.filters.noListsBody', + { + defaultMessage: "We weren't able to find any exception lists.", + } +); + +export const EXCEPTION_EXPORT_SUCCESS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.exportSuccess', + { + defaultMessage: 'Exception list export success', + } +); + +export const EXCEPTION_EXPORT_ERROR = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.exportError', + { + defaultMessage: 'Exception list export error', + } +); + +export const EXCEPTION_DELETE_ERROR = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.deleteError', + { + defaultMessage: 'Error occurred deleting exception list', + } +); + +export const exceptionDeleteSuccessMessage = (listId: string) => + i18n.translate('xpack.securitySolution.exceptions.referenceModalSuccessDescription', { + defaultMessage: 'Exception list - {listId} - deleted successfully.', + values: { listId }, + }); + +export const REFERENCE_MODAL_TITLE = i18n.translate( + 'xpack.securitySolution.exceptions.referenceModalTitle', + { + defaultMessage: 'Remove exception list', + } +); + +export const REFERENCE_MODAL_CANCEL_BUTTON = i18n.translate( + 'xpack.securitySolution.exceptions.referenceModalCancelButton', + { + defaultMessage: 'Cancel', + } +); + +export const REFERENCE_MODAL_CONFIRM_BUTTON = i18n.translate( + 'xpack.securitySolution.exceptions.referenceModalDeleteButton', + { + defaultMessage: 'Remove exception list', + } +); + +export const referenceErrorMessage = (referenceCount: number) => + i18n.translate('xpack.securitySolution.exceptions.referenceModalDescription', { + defaultMessage: + 'This exception list is associated with ({referenceCount}) {referenceCount, plural, =1 {rule} other {rules}}. Removing this exception list will also remove its reference from the associated rules.', + values: { referenceCount }, + }); + +export const EXCEPTION_LIST_SEARCH_PLACEHOLDER = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.searchPlaceholder', + { + defaultMessage: 'Search by name or list id', + } +); + +export const REFRESH_EXCEPTIONS_TABLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.refresh', + { + defaultMessage: 'Refresh', + } +); + +export const UPLOAD_BUTTON = i18n.translate( + 'xpack.securitySolution.exceptions.exceptionListsImportButton', + { + defaultMessage: 'Import list', + } +); + +export const uploadSuccessMessage = (fileName: string) => + i18n.translate('xpack.securitySolution.lists.exceptionListImportSuccess', { + defaultMessage: "Exception list '{fileName}' was imported", + values: { fileName }, + }); + +export const UPLOAD_SUCCESS_TITLE = i18n.translate( + 'xpack.securitySolution.lists.exceptionListImportSuccessTitle', + { + defaultMessage: 'Exception list imported', + } +); + +export const UPLOAD_ERROR = i18n.translate( + 'xpack.securitySolution.lists.exceptionListUploadError', + { + defaultMessage: 'There was an error uploading the exception list.', + } +); + +export const IMPORT_EXCEPTION_LIST = i18n.translate( + 'xpack.securitySolution.lists.importExceptionListButton', + { + defaultMessage: 'Import exception list', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/use_all_exception_lists.tsx b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/use_all_exception_lists.tsx similarity index 95% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/use_all_exception_lists.tsx rename to x-pack/plugins/security_solution/public/exceptions/manage_exceptions/use_all_exception_lists.tsx index cd77e72722132..688ad352a147f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui/pages/exceptions/use_all_exception_lists.tsx +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/use_all_exception_lists.tsx @@ -8,8 +8,8 @@ import { useCallback, useEffect, useState } from 'react'; import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types'; -import type { Rule } from '../../../rule_management/logic'; -import { fetchRules } from '../../../rule_management/api/api'; +import type { Rule } from '../../detection_engine/rule_management/logic'; +import { fetchRules } from '../../detection_engine/rule_management/api/api'; export interface ExceptionListInfo extends ExceptionListSchema { rules: Rule[]; } diff --git a/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/use_import_exception_list.tsx b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/use_import_exception_list.tsx new file mode 100644 index 0000000000000..ca766c102efd3 --- /dev/null +++ b/x-pack/plugins/security_solution/public/exceptions/manage_exceptions/use_import_exception_list.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 { EXCEPTION_LIST_URL } from '@kbn/securitysolution-list-constants'; + +import type { ImportExceptionsResponseSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import type { HttpStart } from '@kbn/core/public'; +import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +export const importExceptionList = async ({ + file, + http, + signal, + overwrite, + overwriteExceptions, + asNewList, +}: { + // TODO: Replace these with kbn packaged versions once we have those available to us + // These originally came from this location below before moving them to this hacked "any" types: + // import { HttpStart, NotificationsStart } from '../../../../../src/core/public'; + http: HttpStart; + signal: AbortSignal; + file: File; + overwrite: boolean; + overwriteExceptions: boolean; + asNewList: boolean; +}): Promise<ImportExceptionsResponseSchema> => { + const formData = new FormData(); + formData.append('file', file as Blob); + + const res = await http.post<ImportExceptionsResponseSchema>(`${EXCEPTION_LIST_URL}/_import`, { + body: formData, + query: { overwrite, overwrite_exceptions: overwriteExceptions, as_new_list: asNewList }, + headers: { 'Content-Type': undefined }, + method: 'POST', + signal, + }); + return res; +}; + +const importListWithOptionalSignal = withOptionalSignal(importExceptionList); + +export const useImportExceptionList = () => useAsync(importListWithOptionalSignal); diff --git a/x-pack/plugins/security_solution/public/exceptions/routes.tsx b/x-pack/plugins/security_solution/public/exceptions/routes.tsx index b977a98722444..367474aa12ae7 100644 --- a/x-pack/plugins/security_solution/public/exceptions/routes.tsx +++ b/x-pack/plugins/security_solution/public/exceptions/routes.tsx @@ -11,7 +11,7 @@ import { Route } from '@kbn/kibana-react-plugin/public'; import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; import * as i18n from './translations'; import { EXCEPTIONS_PATH, SecurityPageName } from '../../common/constants'; -import { ExceptionListsTable } from '../detection_engine/rule_exceptions_ui/pages/exceptions/exceptions_table'; +import { ExceptionListsTable } from './manage_exceptions/exceptions_table'; import { SpyRoute } from '../common/utils/route/spy_routes'; import { NotFoundPage } from '../app/404'; import { useReadonlyHeader } from '../use_readonly_header'; diff --git a/x-pack/plugins/security_solution/public/helpers.tsx b/x-pack/plugins/security_solution/public/helpers.tsx index 0187e50d195d7..e691155256308 100644 --- a/x-pack/plugins/security_solution/public/helpers.tsx +++ b/x-pack/plugins/security_solution/public/helpers.tsx @@ -168,6 +168,14 @@ export const isDetectionsPath = (pathname: string): boolean => { }); }; +export const isAlertDetailsPage = (pathname: string): boolean => { + return !!matchPath(pathname, { + path: `${ALERTS_PATH}/:detailName/:tabName`, + strict: false, + exact: true, + }); +}; + export const isThreatIntelligencePath = (pathname: string): boolean => { return !!matchPath(pathname, { path: `(${THREAT_INTELLIGENCE_PATH})`, diff --git a/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx b/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx index 9d430654c7748..7f09845c51084 100644 --- a/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx +++ b/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx @@ -64,6 +64,7 @@ import { useSourcererDataView } from '../../../common/containers/sourcerer'; import { LandingPageComponent } from '../../../common/components/landing_page'; import { AlertCountByRuleByStatus } from '../../../common/components/alert_count_by_status'; import { useLicense } from '../../../common/hooks/use_license'; +import { ResponderActionButton } from '../../../detections/components/endpoint_responder/responder_action_button'; const ES_HOST_FIELD = 'host.hostname'; const HostOverviewManage = manageQuery(HostOverview); @@ -187,6 +188,11 @@ const HostDetailsComponent: React.FC<HostDetailsProps> = ({ detailName, hostDeta /> } title={detailName} + rightSideItems={[ + hostOverview.endpoint?.fleetAgentId && ( + <ResponderActionButton endpointId={hostOverview.endpoint?.fleetAgentId} /> + ), + ]} /> <AnomalyTableProvider diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_execution_output.test.tsx b/x-pack/plugins/security_solution/public/management/components/console/components/command_execution_output.test.tsx index 55ab4a17ec5a5..255b4108a42e2 100644 --- a/x-pack/plugins/security_solution/public/management/components/console/components/command_execution_output.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/console/components/command_execution_output.test.tsx @@ -42,7 +42,7 @@ describe('When using CommandExecutionOutput component', () => { }); it('should show long running hint message if pending and >15s have passed', () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); render(); expect(renderResult.queryByTestId('test-longRunningCommandHint')).toBeNull(); @@ -55,7 +55,7 @@ describe('When using CommandExecutionOutput component', () => { }); it('should remove long running hint message if command completes', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); render(); act(() => { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx index 1e2745cb03e60..6a197890b4bf6 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx @@ -9,7 +9,7 @@ import React, { memo, useMemo } from 'react'; import { EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; -import { endpointActionResponseCodes } from '../endpoint_responder/endpoint_action_response_codes'; +import { endpointActionResponseCodes } from '../endpoint_responder/lib/endpoint_action_response_codes'; import type { ActionDetails, MaybeImmutable } from '../../../../common/endpoint/types'; interface EndpointActionFailureMessageProps { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_file_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_file_action.tsx similarity index 84% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_file_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_file_action.tsx index d0f090e6595c6..b65e13003c263 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_file_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_file_action.tsx @@ -7,11 +7,11 @@ import React, { memo, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { useSendGetFileRequest } from '../../hooks/endpoint/use_send_get_file_request'; -import type { ResponseActionGetFileRequestBody } from '../../../../common/endpoint/schema/actions'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; -import type { ActionRequestComponentProps } from './types'; -import { ResponseActionFileDownloadLink } from '../response_action_file_download_link'; +import { useSendGetFileRequest } from '../../../hooks/response_actions/use_send_get_file_request'; +import type { ResponseActionGetFileRequestBody } from '../../../../../common/endpoint/schema/actions'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; +import type { ActionRequestComponentProps } from '../types'; +import { ResponseActionFileDownloadLink } from '../../response_action_file_download_link'; export const GetFileActionResult = memo< ActionRequestComponentProps<{ diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_processes_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx similarity index 91% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_processes_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx index d7b05ae721abd..81ded3d02094e 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_processes_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx @@ -9,13 +9,13 @@ import React, { memo, useMemo } from 'react'; import styled from 'styled-components'; import { EuiBasicTable } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; import type { GetProcessesActionOutputContent, ProcessesRequestBody, -} from '../../../../common/endpoint/types'; -import { useSendGetEndpointProcessesRequest } from '../../hooks/endpoint/use_send_get_endpoint_processes_request'; -import type { ActionRequestComponentProps } from './types'; +} from '../../../../../common/endpoint/types'; +import { useSendGetEndpointProcessesRequest } from '../../../hooks/response_actions/use_send_get_endpoint_processes_request'; +import type { ActionRequestComponentProps } from '../types'; // @ts-expect-error TS2769 const StyledEuiBasicTable = styled(EuiBasicTable)` diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx new file mode 100644 index 0000000000000..d6cb46de63698 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx @@ -0,0 +1,201 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { + ConsoleManagerTestComponent, + getConsoleManagerMockRenderResultQueriesAndActions, +} from '../../../console/components/console_manager/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import React from 'react'; +import { enterConsoleCommand } from '../../../console/mocks'; +import { waitFor } from '@testing-library/react'; +import { GET_FILE_ROUTE } from '../../../../../../common/endpoint/constants'; +import { getEndpointAuthzInitialStateMock } from '../../../../../../common/endpoint/service/authz/mocks'; +import type { + ActionDetailsApiResponse, + EndpointPrivileges, + ResponseActionGetFileOutputContent, +} from '../../../../../../common/endpoint/types'; +import { INSUFFICIENT_PRIVILEGES_FOR_COMMAND } from '../../../../../common/translations'; +import type { HttpFetchOptionsWithPath } from '@kbn/core-http-browser'; +import { endpointActionResponseCodes } from '../../lib/endpoint_action_response_codes'; + +jest.mock('../../../../../common/components/user_privileges'); + +describe('When using get-file action from response actions console', () => { + let render: ( + capabilities?: EndpointCapabilities[] + ) => Promise<ReturnType<AppContextTestRender['render']>>; + let renderResult: ReturnType<AppContextTestRender['render']>; + let apiMocks: ReturnType<typeof responseActionsHttpMocks>; + let consoleManagerMockAccess: ReturnType< + typeof getConsoleManagerMockRenderResultQueriesAndActions + >; + let endpointPrivileges: EndpointPrivileges; + + beforeEach(() => { + const mockedContext = createAppRootMockRenderer(); + + apiMocks = responseActionsHttpMocks(mockedContext.coreStart.http); + endpointPrivileges = { ...getEndpointAuthzInitialStateMock(), loading: false }; + + render = async (capabilities: EndpointCapabilities[] = [...ENDPOINT_CAPABILITIES]) => { + renderResult = mockedContext.render( + <ConsoleManagerTestComponent + registerConsoleProps={() => { + return { + consoleProps: { + 'data-test-subj': 'test', + commands: getEndpointConsoleCommands({ + endpointAgentId: 'a.b.c', + endpointCapabilities: [...capabilities], + endpointPrivileges, + }), + }, + }; + }} + /> + ); + + consoleManagerMockAccess = getConsoleManagerMockRenderResultQueriesAndActions(renderResult); + + await consoleManagerMockAccess.clickOnRegisterNewConsole(); + await consoleManagerMockAccess.openRunningConsole(); + + return renderResult; + }; + }); + + it('should show an error if the `get_file` capability is not present in the endpoint', async () => { + await render([]); + enterConsoleCommand(renderResult, 'get-file --path="one/two"'); + + expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual( + 'The current version of the Agent does not support this feature. Upgrade your Agent through Fleet to use this feature and new response actions such as killing and suspending processes.' + ); + }); + + it('should show an error if the `get-file` is not authorized', async () => { + endpointPrivileges.canWriteFileOperations = false; + await render(); + enterConsoleCommand(renderResult, 'get-file --path="one/two"'); + + expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual( + INSUFFICIENT_PRIVILEGES_FOR_COMMAND + ); + }); + + it('should show an error if `get-file` is entered without `--path` argument', async () => { + await render([]); + enterConsoleCommand(renderResult, 'get-file'); + + expect(renderResult.getByTestId('test-badArgument-message').textContent).toEqual( + 'Missing required arguments: --path' + ); + }); + + it('should show error if `--path` is empty string', async () => { + await render(); + enterConsoleCommand(renderResult, 'get-file --path=""'); + + expect(renderResult.getByTestId('test-badArgument-message').textContent).toEqual( + 'Invalid argument value: --path. Argument cannot be empty' + ); + }); + + it('should call the `get_file` api with the expected payload', async () => { + await render(); + enterConsoleCommand(renderResult, 'get-file --path="one/two"'); + + await waitFor(() => { + expect(apiMocks.responseProvider.getFile).toHaveBeenCalledWith({ + body: '{"endpoint_ids":["a.b.c"],"parameters":{"path":"one/two"}}', + path: GET_FILE_ROUTE, + }); + }); + }); + + it('should only accept one `--comment`', async () => { + await render(); + enterConsoleCommand(renderResult, 'get-file --path="one/two" --comment "one" --comment "two"'); + + expect(renderResult.getByTestId('test-badArgument-message').textContent).toEqual( + 'Argument can only be used once: --comment' + ); + }); + + it('should display download link once action completes', async () => { + const actionDetailsApiResponseMock: ReturnType<typeof apiMocks.responseProvider.actionDetails> = + { + data: { + ...apiMocks.responseProvider.actionDetails({ + path: '/1', + } as HttpFetchOptionsWithPath).data, + + completedAt: new Date().toISOString(), + command: 'get-file', + }, + }; + apiMocks.responseProvider.actionDetails.mockReturnValue(actionDetailsApiResponseMock); + + await render(); + enterConsoleCommand(renderResult, 'get-file --path="one/two"'); + + await waitFor(() => { + expect(apiMocks.responseProvider.actionDetails).toHaveBeenCalled(); + }); + + await waitFor(() => { + expect(renderResult.getByTestId('getFileSuccess').textContent).toEqual( + 'File retrieved from the host.Click here to download(ZIP file passcode: elastic)' + ); + }); + }); + + it.each([ + 'ra_get-file_error_not-found', + 'ra_get-file_error_is-directory', + 'ra_get-file_error_invalid-input', + 'ra_get-file_error_not-permitted', + 'ra_get-file_error_too-big', + 'ra_get-file_error_disk-quota', + 'ra_get-file_error_processing', + 'ra_get-file_error_upload-api-unreachable', + 'ra_get-file_error_upload-timeout', + 'ra_get-file_error_queue-timeout', + ])('should show detailed error if get-file failure returned code: %s', async (outputCode) => { + const pendingDetailResponse = apiMocks.responseProvider.actionDetails({ + path: '/api/endpoint/action/a.b.c', + }) as ActionDetailsApiResponse<ResponseActionGetFileOutputContent>; + pendingDetailResponse.data.agents = ['a.b.c']; + pendingDetailResponse.data.wasSuccessful = false; + pendingDetailResponse.data.errors = ['not found']; + pendingDetailResponse.data.outputs = { + 'a.b.c': { + type: 'json', + content: { + code: outputCode, + } as unknown as ResponseActionGetFileOutputContent, + }, + }; + apiMocks.responseProvider.actionDetails.mockReturnValue(pendingDetailResponse); + await render(); + enterConsoleCommand(renderResult, 'get-file --path one'); + + await waitFor(() => { + expect(renderResult.getByTestId('getFile-actionFailure').textContent).toMatch( + // RegExp below taken from: https://github.com/sindresorhus/escape-string-regexp/blob/main/index.js + new RegExp(endpointActionResponseCodes[outputCode].replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')) + ); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_processes_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_processes_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx index e39cea0b7ce1c..a99e8cdd17ef7 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_processes_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx @@ -5,20 +5,20 @@ * 2.0. */ -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; +} from '../../../console/components/console_manager/mocks'; import React from 'react'; -import { getEndpointResponseActionsConsoleCommands } from '../endpoint_response_actions_console_commands'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { enterConsoleCommand } from '../../console/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { getEndpointAuthzInitialState } from '../../../../../common/endpoint/service/authz'; -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; +import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; describe('When using processes action from response actions console', () => { let render: ( @@ -42,7 +42,7 @@ describe('When using processes action from response actions console', () => { return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges: { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/isolate_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/isolate_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx index f111b7aafbff6..ab98acc5bd390 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/isolate_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx @@ -5,21 +5,21 @@ * 2.0. */ -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; +} from '../../../console/components/console_manager/mocks'; import React from 'react'; -import { getEndpointResponseActionsConsoleCommands } from '../endpoint_response_actions_console_commands'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { enterConsoleCommand } from '../../console/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { getDeferred } from '../../../mocks/utils'; -import { getEndpointAuthzInitialState } from '../../../../../common/endpoint/service/authz'; -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; +import { getDeferred } from '../../../../mocks/utils'; +import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; describe('When using isolate action from response actions console', () => { let render: ( @@ -43,7 +43,7 @@ describe('When using isolate action from response actions console', () => { return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges: { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/kill_process_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx similarity index 83% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/kill_process_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx index 631da12cc1d3a..e65a8d8e751e4 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/kill_process_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx @@ -5,20 +5,25 @@ * 2.0. */ -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; +} from '../../../console/components/console_manager/mocks'; import React from 'react'; -import { getEndpointResponseActionsConsoleCommands } from '../endpoint_response_actions_console_commands'; -import { enterConsoleCommand } from '../../console/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { getEndpointAuthzInitialState } from '../../../../../common/endpoint/service/authz'; -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; +import type { + ActionDetailsApiResponse, + KillProcessActionOutputContent, +} from '../../../../../../common/endpoint/types'; +import { endpointActionResponseCodes } from '../../lib/endpoint_action_response_codes'; describe('When using the kill-process action from response actions console', () => { let render: ( @@ -42,7 +47,7 @@ describe('When using the kill-process action from response actions console', () return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges: { @@ -233,6 +238,35 @@ describe('When using the kill-process action from response actions console', () }); }); + it.each([['ra_kill-process_error_not-found'], ['ra_kill-process_error_not-permitted']])( + 'should show detailed error if kill-process failure returned code: %s', + async (outputCode) => { + const pendingDetailResponse = apiMocks.responseProvider.actionDetails({ + path: '/api/endpoint/action/a.b.c', + }) as ActionDetailsApiResponse<KillProcessActionOutputContent>; + pendingDetailResponse.data.agents = ['a.b.c']; + pendingDetailResponse.data.wasSuccessful = false; + pendingDetailResponse.data.errors = ['not found']; + pendingDetailResponse.data.outputs = { + 'a.b.c': { + type: 'json', + content: { + code: outputCode, + }, + }, + }; + apiMocks.responseProvider.actionDetails.mockReturnValue(pendingDetailResponse); + await render(); + enterConsoleCommand(renderResult, 'kill-process --pid 123'); + + await waitFor(() => { + expect(renderResult.getByTestId('killProcess-actionFailure').textContent).toMatch( + new RegExp(endpointActionResponseCodes[outputCode]) + ); + }); + } + ); + it('should show error if kill-process API fails', async () => { apiMocks.responseProvider.killProcess.mockRejectedValueOnce({ status: 500, diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/release_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/release_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx index e377d23c2c145..633c82a47897f 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/release_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx @@ -5,21 +5,21 @@ * 2.0. */ -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; +} from '../../../console/components/console_manager/mocks'; import React from 'react'; -import { getEndpointResponseActionsConsoleCommands } from '../endpoint_response_actions_console_commands'; -import { enterConsoleCommand } from '../../console/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { getDeferred } from '../../../mocks/utils'; -import { getEndpointAuthzInitialState } from '../../../../../common/endpoint/service/authz'; -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { getDeferred } from '../../../../mocks/utils'; +import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; describe('When using the release action from response actions console', () => { let render: ( @@ -43,7 +43,7 @@ describe('When using the release action from response actions console', () => { return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges: { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/suspend_process_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx similarity index 82% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/suspend_process_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx index a41ed9fe3d6eb..e02bbcb689c57 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/suspend_process_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx @@ -5,20 +5,25 @@ * 2.0. */ -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; +} from '../../../console/components/console_manager/mocks'; import React from 'react'; -import { getEndpointResponseActionsConsoleCommands } from '../endpoint_response_actions_console_commands'; -import { enterConsoleCommand } from '../../console/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { getEndpointAuthzInitialState } from '../../../../../common/endpoint/service/authz'; -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; +import type { + ActionDetailsApiResponse, + KillProcessActionOutputContent, +} from '../../../../../../common/endpoint/types'; +import { endpointActionResponseCodes } from '../../lib/endpoint_action_response_codes'; describe('When using the suspend-process action from response actions console', () => { let render: ( @@ -42,7 +47,7 @@ describe('When using the suspend-process action from response actions console', return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges: { @@ -239,6 +244,35 @@ describe('When using the suspend-process action from response actions console', }); }); + it.each([['ra_suspend-process_error_not-found'], ['ra_suspend-process_error_not-permitted']])( + 'should show detailed error if suspend-process failure returned code: %s', + async (outputCode) => { + const pendingDetailResponse = apiMocks.responseProvider.actionDetails({ + path: '/api/endpoint/action/a.b.c', + }) as ActionDetailsApiResponse<KillProcessActionOutputContent>; + pendingDetailResponse.data.agents = ['a.b.c']; + pendingDetailResponse.data.wasSuccessful = false; + pendingDetailResponse.data.errors = ['not found']; + pendingDetailResponse.data.outputs = { + 'a.b.c': { + type: 'json', + content: { + code: outputCode, + }, + }, + }; + apiMocks.responseProvider.actionDetails.mockReturnValue(pendingDetailResponse); + await render(); + enterConsoleCommand(renderResult, 'suspend-process --pid 123'); + + await waitFor(() => { + expect(renderResult.getByTestId('suspendProcess-actionFailure').textContent).toMatch( + new RegExp(endpointActionResponseCodes[outputCode]) + ); + }); + } + ); + describe('and when console is closed (not terminated) and then reopened', () => { beforeEach(() => { const _render = render; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/isolate_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx similarity index 81% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/isolate_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx index 8df7692cf3ac2..84bc9b9a6cae9 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/isolate_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx @@ -6,9 +6,9 @@ */ import { memo, useMemo } from 'react'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; -import type { ActionRequestComponentProps } from './types'; -import { useSendIsolateEndpointRequest } from '../../hooks/endpoint/use_send_isolate_endpoint_request'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; +import type { ActionRequestComponentProps } from '../types'; +import { useSendIsolateEndpointRequest } from '../../../hooks/response_actions/use_send_isolate_endpoint_request'; export const IsolateActionResult = memo<ActionRequestComponentProps>( ({ command, setStore, store, status, setStatus, ResultComponent }) => { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/kill_process_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/kill_process_action.tsx similarity index 79% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/kill_process_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/kill_process_action.tsx index bf501c31b9e85..657b6847e7839 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/kill_process_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/kill_process_action.tsx @@ -6,11 +6,11 @@ */ import { memo, useMemo } from 'react'; -import type { KillOrSuspendProcessRequestBody } from '../../../../common/endpoint/types'; -import { parsedPidOrEntityIdParameter } from './utils'; -import { useSendKillProcessRequest } from '../../hooks/endpoint/use_send_kill_process_endpoint_request'; -import type { ActionRequestComponentProps } from './types'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; +import type { KillOrSuspendProcessRequestBody } from '../../../../../common/endpoint/types'; +import { parsedPidOrEntityIdParameter } from '../lib/utils'; +import { useSendKillProcessRequest } from '../../../hooks/response_actions/use_send_kill_process_endpoint_request'; +import type { ActionRequestComponentProps } from '../types'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; export const KillProcessActionResult = memo< ActionRequestComponentProps<{ pid?: string[]; entityId?: string[] }> diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/release_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx similarity index 81% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/release_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx index 9b0f371ca003f..b0f2db75b7986 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/release_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx @@ -6,9 +6,9 @@ */ import { memo, useMemo } from 'react'; -import type { ActionRequestComponentProps } from './types'; -import { useSendReleaseEndpointRequest } from '../../hooks/endpoint/use_send_release_endpoint_request'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; +import type { ActionRequestComponentProps } from '../types'; +import { useSendReleaseEndpointRequest } from '../../../hooks/response_actions/use_send_release_endpoint_request'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; export const ReleaseActionResult = memo<ActionRequestComponentProps>( ({ command, setStore, store, status, setStatus, ResultComponent }) => { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/status_action.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/status_action.tsx index b75a480765844..342e7654ec390 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/status_action.tsx @@ -7,20 +7,20 @@ import React, { memo, useEffect, useMemo, useCallback } from 'react'; import { EuiDescriptionList } from '@elastic/eui'; +import { v4 as uuidV4 } from 'uuid'; import { i18n } from '@kbn/i18n'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import { v4 as uuidV4 } from 'uuid'; -import type { HostInfo, PendingActionsResponse } from '../../../../common/endpoint/types'; -import type { EndpointCommandDefinitionMeta } from './types'; -import type { EndpointHostIsolationStatusProps } from '../../../common/components/endpoint/host_isolation'; -import { useGetEndpointPendingActionsSummary } from '../../hooks/endpoint/use_get_endpoint_pending_actions_summary'; -import { FormattedDate } from '../../../common/components/formatted_date'; -import { useGetEndpointDetails } from '../../hooks'; -import type { CommandExecutionComponentProps } from '../console/types'; -import { FormattedError } from '../formatted_error'; -import { ConsoleCodeBlock } from '../console/components/console_code_block'; -import { POLICY_STATUS_TO_TEXT } from '../../pages/endpoint_hosts/view/host_constants'; -import { getAgentStatusText } from '../../../common/components/endpoint/agent_status_text'; +import type { HostInfo, PendingActionsResponse } from '../../../../../common/endpoint/types'; +import type { EndpointCommandDefinitionMeta } from '../types'; +import type { EndpointHostIsolationStatusProps } from '../../../../common/components/endpoint/host_isolation'; +import { useGetEndpointPendingActionsSummary } from '../../../hooks/response_actions/use_get_endpoint_pending_actions_summary'; +import { FormattedDate } from '../../../../common/components/formatted_date'; +import { useGetEndpointDetails } from '../../../hooks'; +import type { CommandExecutionComponentProps } from '../../console/types'; +import { FormattedError } from '../../formatted_error'; +import { ConsoleCodeBlock } from '../../console/components/console_code_block'; +import { POLICY_STATUS_TO_TEXT } from '../../../pages/endpoint_hosts/view/host_constants'; +import { getAgentStatusText } from '../../../../common/components/endpoint/agent_status_text'; export const EndpointStatusActionResult = memo< CommandExecutionComponentProps< diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/suspend_process_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx similarity index 79% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/suspend_process_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx index f8401a81fa114..02b125294a66a 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/suspend_process_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx @@ -6,14 +6,14 @@ */ import { memo, useMemo } from 'react'; -import { parsedPidOrEntityIdParameter } from './utils'; +import { parsedPidOrEntityIdParameter } from '../lib/utils'; import type { SuspendProcessActionOutputContent, KillOrSuspendProcessRequestBody, -} from '../../../../common/endpoint/types'; -import { useSendSuspendProcessRequest } from '../../hooks/endpoint/use_send_suspend_process_endpoint_request'; -import type { ActionRequestComponentProps } from './types'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; +} from '../../../../../common/endpoint/types'; +import { useSendSuspendProcessRequest } from '../../../hooks/response_actions/use_send_suspend_process_endpoint_request'; +import type { ActionRequestComponentProps } from '../types'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; export const SuspendProcessActionResult = memo< ActionRequestComponentProps<{ pid?: string[]; entityId?: string[] }> diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_error.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_error.tsx similarity index 78% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_error.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_error.tsx index 3060f76247cb9..ed3fa1928fbcd 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_error.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_error.tsx @@ -6,9 +6,9 @@ */ import React, { memo } from 'react'; -import { EndpointActionFailureMessage } from '../endpoint_action_failure_message'; -import type { CommandExecutionResultComponent } from '../console/components/command_execution_result'; -import type { ActionDetails, MaybeImmutable } from '../../../../common/endpoint/types'; +import { EndpointActionFailureMessage } from '../../endpoint_action_failure_message'; +import type { CommandExecutionResultComponent } from '../../console/components/command_execution_result'; +import type { ActionDetails, MaybeImmutable } from '../../../../../common/endpoint/types'; export const ActionError = memo<{ action: MaybeImmutable<ActionDetails>; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_log_button.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx similarity index 90% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_log_button.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx index 655bc0a6c8911..79307689033dd 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_log_button.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx @@ -8,9 +8,9 @@ import React, { memo, useCallback, useState } from 'react'; import { EuiButton, EuiFlyout, EuiFlyoutBody, EuiFlyoutHeader, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { EndpointResponderExtensionComponentProps } from './types'; -import { ResponseActionsLog } from '../endpoint_response_actions_list/response_actions_log'; -import { UX_MESSAGES } from '../endpoint_response_actions_list/translations'; +import type { EndpointResponderExtensionComponentProps } from '../types'; +import { ResponseActionsLog } from '../../endpoint_response_actions_list/response_actions_log'; +import { UX_MESSAGES } from '../../endpoint_response_actions_list/translations'; export const ActionLogButton = memo<EndpointResponderExtensionComponentProps>((props) => { const [showActionLogFlyout, setShowActionLogFlyout] = useState<boolean>(false); diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_success.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_success.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_success.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_success.tsx index 183fb2fe5d67b..9f7a22ece8721 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_success.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_success.tsx @@ -6,9 +6,9 @@ */ import React, { memo, useMemo } from 'react'; -import { endpointActionResponseCodes } from './endpoint_action_response_codes'; -import type { ActionDetails, MaybeImmutable } from '../../../../common/endpoint/types'; -import type { CommandExecutionResultComponent, CommandExecutionResultProps } from '../console'; +import { endpointActionResponseCodes } from '../lib/endpoint_action_response_codes'; +import type { ActionDetails, MaybeImmutable } from '../../../../../common/endpoint/types'; +import type { CommandExecutionResultComponent, CommandExecutionResultProps } from '../../console'; export interface ActionSuccessProps extends CommandExecutionResultProps { action: MaybeImmutable<ActionDetails<{ code?: string }>>; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.test.tsx new file mode 100644 index 0000000000000..78667399f04d9 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.test.tsx @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EndpointActionGenerator } from '../../../../../common/endpoint/data_generators/endpoint_action_generator'; +import type { HostInfo } from '../../../../../common/endpoint/types'; +import type { AppContextTestRender } from '../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import { useGetEndpointDetails } from '../../../hooks/endpoint/use_get_endpoint_details'; +import { useGetEndpointPendingActionsSummary } from '../../../hooks/response_actions/use_get_endpoint_pending_actions_summary'; +import { mockEndpointDetailsApiResult } from '../../../pages/endpoint_hosts/store/mock_endpoint_result_list'; +import { HeaderEndpointInfo } from './header_endpoint_info'; + +jest.mock('../../../hooks/endpoint/use_get_endpoint_details'); +jest.mock('../../../hooks/response_actions/use_get_endpoint_pending_actions_summary'); + +const getEndpointDetails = useGetEndpointDetails as jest.Mock; +const getPendingActions = useGetEndpointPendingActionsSummary as jest.Mock; + +describe('Responder header endpoint info', () => { + let render: () => ReturnType<AppContextTestRender['render']>; + let renderResult: ReturnType<typeof render>; + let mockedContext: AppContextTestRender; + let endpointDetails: HostInfo; + + beforeEach(() => { + mockedContext = createAppRootMockRenderer(); + render = () => + (renderResult = mockedContext.render(<HeaderEndpointInfo endpointId={'1234'} />)); + endpointDetails = mockEndpointDetailsApiResult(); + getEndpointDetails.mockReturnValue({ data: endpointDetails }); + getPendingActions.mockReturnValue({ + data: { + data: [ + new EndpointActionGenerator('seed').generateAgentPendingActionsSummary({ + agent_id: '1234', + }), + ], + }, + }); + render(); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + it('should show endpoint name', async () => { + const name = await renderResult.findByTestId('responderHeaderEndpointName'); + expect(name.textContent).toBe(`${endpointDetails.metadata.host.name}`); + }); + it('should show agent and isolation status', async () => { + const agentStatus = await renderResult.findByTestId( + 'responderHeaderEndpointAgentIsolationStatus' + ); + expect(agentStatus.textContent).toBe(`UnhealthyIsolating`); + }); + it('should show last updated time', async () => { + const lastUpdated = await renderResult.findByTestId('responderHeaderLastSeen'); + expect(lastUpdated).toBeTruthy(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.tsx similarity index 90% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.tsx index 296b98d2e9fbb..37bfb77ce8a96 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.tsx @@ -15,10 +15,10 @@ import { EuiSpacer, } from '@elastic/eui'; import { FormattedMessage, FormattedRelative } from '@kbn/i18n-react'; -import { useGetEndpointDetails } from '../../hooks/endpoint/use_get_endpoint_details'; -import { useGetEndpointPendingActionsSummary } from '../../hooks/endpoint/use_get_endpoint_pending_actions_summary'; -import type { EndpointHostIsolationStatusProps } from '../../../common/components/endpoint/host_isolation'; -import { EndpointAgentAndIsolationStatus } from '../endpoint_agent_and_isolation_status'; +import { useGetEndpointDetails } from '../../../hooks/endpoint/use_get_endpoint_details'; +import type { EndpointHostIsolationStatusProps } from '../../../../common/components/endpoint/host_isolation'; +import { EndpointAgentAndIsolationStatus } from '../../endpoint_agent_and_isolation_status'; +import { useGetEndpointPendingActionsSummary } from '../../../hooks/response_actions/use_get_endpoint_pending_actions_summary'; interface HeaderEndpointInfoProps { endpointId: string; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.test.tsx new file mode 100644 index 0000000000000..b5124eaae1228 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.test.tsx @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import type { HostInfo } from '../../../../../common/endpoint/types'; +import { HostStatus } from '../../../../../common/endpoint/types'; +import type { AppContextTestRender } from '../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import { useGetEndpointDetails } from '../../../hooks/endpoint/use_get_endpoint_details'; +import { mockEndpointDetailsApiResult } from '../../../pages/endpoint_hosts/store/mock_endpoint_result_list'; +import { OfflineCallout } from './offline_callout'; + +jest.mock('../../../hooks/endpoint/use_get_endpoint_details'); + +const getEndpointDetails = useGetEndpointDetails as jest.Mock; + +describe('Responder offline callout', () => { + let render: () => ReturnType<AppContextTestRender['render']>; + let renderResult: ReturnType<typeof render>; + let mockedContext: AppContextTestRender; + let endpointDetails: HostInfo; + + beforeEach(() => { + mockedContext = createAppRootMockRenderer(); + render = () => (renderResult = mockedContext.render(<OfflineCallout endpointId={'1234'} />)); + endpointDetails = mockEndpointDetailsApiResult(); + getEndpointDetails.mockReturnValue({ data: endpointDetails }); + render(); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + it('should be visible when endpoint is offline', () => { + getEndpointDetails.mockReturnValue({ + data: { ...endpointDetails, host_status: HostStatus.OFFLINE }, + }); + render(); + const callout = renderResult.queryByTestId('offlineCallout'); + expect(callout).toBeTruthy(); + }); + it('should not be visible when endpoint is online', () => { + getEndpointDetails.mockReturnValue({ + data: { ...endpointDetails, host_status: HostStatus.HEALTHY }, + }); + render(); + const callout = renderResult.queryByTestId('offlineCallout'); + expect(callout).toBeFalsy(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.tsx similarity index 92% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.tsx index 70d89c6b66a4d..ed00a3c5ac338 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.tsx @@ -9,8 +9,8 @@ import React, { memo } from 'react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; -import { useGetEndpointDetails } from '../../hooks'; -import { HostStatus } from '../../../../common/endpoint/types'; +import { useGetEndpointDetails } from '../../../hooks'; +import { HostStatus } from '../../../../../common/endpoint/types'; interface OfflineCalloutProps { endpointId: string; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_action_response_codes.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_action_response_codes.ts deleted file mode 100644 index 6694601cd8930..0000000000000 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_action_response_codes.ts +++ /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 { i18n } from '@kbn/i18n'; - -const CODES = Object.freeze({ - // ----------------------------------------------------------------- - // SUSPEND-PROCESS CODES - // ----------------------------------------------------------------- - /** - * Code will be used whenever you provide an entity_id or pid that isn't found. - * suspend_process will always be an error because the process was not found to be suspended - */ - 'ra_suspend-process_error_not-found': i18n.translate( - 'xpack.securitySolution.endpointActionResponseCodes.suspendProcess.notFoundError', - { defaultMessage: 'The provided process was not found' } - ), - - /** - * Code will be used when the provided process can not be killed (for stability reasons). - * Example: This occurs if you try to kill Endpoint Security - */ - 'ra_suspend-process_error_not-permitted': i18n.translate( - 'xpack.securitySolution.endpointActionResponseCodes.suspendProcess.notPermittedSuccess', - { defaultMessage: 'The provided process cannot be suspended' } - ), - - // ----------------------------------------------------------------- - // KILL-PROCESS CODES - // ----------------------------------------------------------------- - /** - * Code will be used whenever you provide an entity_id that isn't found. Since entity_id is - * unique, we can guarantee that it was legitimately not found and not just that the process - * was already killed. - */ - 'ra_kill-process_error_not-found': i18n.translate( - 'xpack.securitySolution.endpointActionResponseCodes.killProcess.notFoundError', - { defaultMessage: 'The provided process was not found' } - ), - - /** - * Code will be used whenever you provide a pid that isn't found. Since pid is reused, we aren't - * sure if the process was already killed or just wasn't found. In either case, a process with - * that pid will no longer be running. - */ - 'ra_kill-process_success_no-action': i18n.translate( - 'xpack.securitySolution.endpointActionResponseCodes.killProcess.noActionSuccess', - { defaultMessage: 'Action completed. The provided process was not found or already killed' } - ), - - /** - * Code will be used when the provided process can not be killed (for stability reasons). - * Example: This occurs if you try to kill Endpoint Security - */ - 'ra_kill-process_error_not-permitted': i18n.translate( - 'xpack.securitySolution.endpointActionResponseCodes.killProcess.notPermittedSuccess', - { defaultMessage: 'The provided process cannot be killed' } - ), -}); - -/** - * A map of possible code's that can be returned from the endpoint for response actions - */ -export const endpointActionResponseCodes: Readonly<Record<string | keyof typeof CODES, string>> = - CODES; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_response_actions_console_commands.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_response_actions_console_commands.ts deleted file mode 100644 index 5269306424a84..0000000000000 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_response_actions_console_commands.ts +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import type { - EndpointCapabilities, - ConsoleResponseActionCommands, -} from '../../../../common/endpoint/service/response_actions/constants'; -import { GetFileActionResult } from './get_file_action'; -import type { Command, CommandDefinition } from '../console'; -import { IsolateActionResult } from './isolate_action'; -import { ReleaseActionResult } from './release_action'; -import { KillProcessActionResult } from './kill_process_action'; -import { SuspendProcessActionResult } from './suspend_process_action'; -import { EndpointStatusActionResult } from './status_action'; -import { GetProcessesActionResult } from './get_processes_action'; -import type { ParsedArgData } from '../console/service/parsed_command_input'; -import type { EndpointPrivileges, ImmutableArray } from '../../../../common/endpoint/types'; -import { - INSUFFICIENT_PRIVILEGES_FOR_COMMAND, - UPGRADE_ENDPOINT_FOR_RESPONDER, -} from '../../../common/translations'; -import { getCommandAboutInfo } from './get_command_about_info'; - -const emptyArgumentValidator = (argData: ParsedArgData): true | string => { - if (argData?.length > 0 && typeof argData[0] === 'string' && argData[0]?.trim().length > 0) { - return true; - } else { - return i18n.translate('xpack.securitySolution.endpointConsoleCommands.emptyArgumentMessage', { - defaultMessage: 'Argument cannot be empty', - }); - } -}; - -const pidValidator = (argData: ParsedArgData): true | string => { - const emptyResult = emptyArgumentValidator(argData); - if (emptyResult !== true) { - return emptyResult; - } else if (Number.isSafeInteger(Number(argData)) && Number(argData) > 0) { - return true; - } else { - return i18n.translate('xpack.securitySolution.endpointConsoleCommands.invalidPidMessage', { - defaultMessage: 'Argument must be a positive number representing the PID of a process', - }); - } -}; - -const commandToCapabilitiesMap = new Map<ConsoleResponseActionCommands, EndpointCapabilities>([ - ['isolate', 'isolation'], - ['release', 'isolation'], - ['kill-process', 'kill_process'], - ['suspend-process', 'suspend_process'], - ['processes', 'running_processes'], - ['get-file', 'get_file'], -]); - -const getRbacControl = ({ - commandName, - privileges, -}: { - commandName: ConsoleResponseActionCommands; - privileges: EndpointPrivileges; -}): boolean => { - const commandToPrivilegeMap = new Map<ConsoleResponseActionCommands, boolean>([ - ['isolate', privileges.canIsolateHost], - ['release', privileges.canUnIsolateHost], - ['kill-process', privileges.canKillProcess], - ['suspend-process', privileges.canSuspendProcess], - ['processes', privileges.canGetRunningProcesses], - ['get-file', privileges.canWriteFileOperations], - ]); - return commandToPrivilegeMap.get(commandName as ConsoleResponseActionCommands) ?? false; -}; - -const capabilitiesAndPrivilegesValidator = (command: Command): true | string => { - const privileges = command.commandDefinition.meta.privileges; - const endpointCapabilities: EndpointCapabilities[] = command.commandDefinition.meta.capabilities; - const commandName = command.commandDefinition.name as ConsoleResponseActionCommands; - const responderCapability = commandToCapabilitiesMap.get(commandName); - let errorMessage = ''; - if (!responderCapability) { - errorMessage = errorMessage.concat(UPGRADE_ENDPOINT_FOR_RESPONDER); - } - if (responderCapability) { - if (!endpointCapabilities.includes(responderCapability)) { - errorMessage = errorMessage.concat(UPGRADE_ENDPOINT_FOR_RESPONDER); - } - } - if (getRbacControl({ commandName, privileges }) !== true) { - errorMessage = errorMessage.concat(INSUFFICIENT_PRIVILEGES_FOR_COMMAND); - } - - if (errorMessage.length) { - return errorMessage; - } - - return true; -}; - -const HELP_GROUPS = Object.freeze({ - responseActions: { - position: 0, - label: i18n.translate('xpack.securitySolution.endpointConsoleCommands.groups.responseActions', { - defaultMessage: 'Response actions', - }), - }, -}); - -const ENTER_PID_OR_ENTITY_ID_INSTRUCTION = i18n.translate( - 'xpack.securitySolution.endpointResponseActionsConsoleCommands.enterPidOrEntityId', - { defaultMessage: 'Enter a pid or an entity id to execute' } -); - -const ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION = i18n.translate( - 'xpack.securitySolution.endpointResponseActionsConsoleCommands.enterOrAddOptionalComment', - { defaultMessage: 'Hit enter to execute or add an optional comment' } -); - -const COMMENT_ARG_ABOUT = i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.commandArgAbout', - { defaultMessage: 'A comment to go along with the action' } -); - -export const getEndpointResponseActionsConsoleCommands = ({ - endpointAgentId, - endpointCapabilities, - endpointPrivileges, -}: { - endpointAgentId: string; - endpointCapabilities: ImmutableArray<string>; - endpointPrivileges: EndpointPrivileges; -}): CommandDefinition[] => { - const doesEndpointSupportCommand = (commandName: ConsoleResponseActionCommands) => { - const responderCapability = commandToCapabilitiesMap.get(commandName); - if (responderCapability) { - return endpointCapabilities.includes(responderCapability); - } - return false; - }; - - return [ - { - name: 'isolate', - about: getCommandAboutInfo({ - aboutInfo: i18n.translate('xpack.securitySolution.endpointConsoleCommands.isolate.about', { - defaultMessage: 'Isolate the host', - }), - isSupported: doesEndpointSupportCommand('isolate'), - }), - RenderComponent: IsolateActionResult, - meta: { - endpointId: endpointAgentId, - capabilities: endpointCapabilities, - privileges: endpointPrivileges, - }, - exampleUsage: 'isolate --comment "isolate this host"', - exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION, - validate: capabilitiesAndPrivilegesValidator, - args: { - comment: { - required: false, - allowMultiples: false, - about: COMMENT_ARG_ABOUT, - }, - }, - helpGroupLabel: HELP_GROUPS.responseActions.label, - helpGroupPosition: HELP_GROUPS.responseActions.position, - helpCommandPosition: 0, - helpDisabled: doesEndpointSupportCommand('isolate') === false, - helpHidden: !getRbacControl({ commandName: 'isolate', privileges: endpointPrivileges }), - }, - { - name: 'release', - about: getCommandAboutInfo({ - aboutInfo: i18n.translate('xpack.securitySolution.endpointConsoleCommands.release.about', { - defaultMessage: 'Release the host', - }), - isSupported: doesEndpointSupportCommand('release'), - }), - RenderComponent: ReleaseActionResult, - meta: { - endpointId: endpointAgentId, - capabilities: endpointCapabilities, - privileges: endpointPrivileges, - }, - exampleUsage: 'release --comment "release this host"', - exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION, - validate: capabilitiesAndPrivilegesValidator, - args: { - comment: { - required: false, - allowMultiples: false, - about: COMMENT_ARG_ABOUT, - }, - }, - helpGroupLabel: HELP_GROUPS.responseActions.label, - helpGroupPosition: HELP_GROUPS.responseActions.position, - helpCommandPosition: 1, - helpDisabled: doesEndpointSupportCommand('release') === false, - helpHidden: !getRbacControl({ commandName: 'release', privileges: endpointPrivileges }), - }, - { - name: 'kill-process', - about: getCommandAboutInfo({ - aboutInfo: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.killProcess.about', - { - defaultMessage: 'Kill/terminate a process', - } - ), - isSupported: doesEndpointSupportCommand('kill-process'), - }), - RenderComponent: KillProcessActionResult, - meta: { - endpointId: endpointAgentId, - capabilities: endpointCapabilities, - privileges: endpointPrivileges, - }, - exampleUsage: 'kill-process --pid 123 --comment "kill this process"', - exampleInstruction: ENTER_PID_OR_ENTITY_ID_INSTRUCTION, - validate: capabilitiesAndPrivilegesValidator, - mustHaveArgs: true, - args: { - comment: { - required: false, - allowMultiples: false, - about: COMMENT_ARG_ABOUT, - }, - pid: { - required: false, - allowMultiples: false, - exclusiveOr: true, - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.pid.arg.comment', { - defaultMessage: 'A PID representing the process to kill', - }), - validate: pidValidator, - }, - entityId: { - required: false, - allowMultiples: false, - exclusiveOr: true, - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.entityId.arg.comment', - { - defaultMessage: 'An entity id representing the process to kill', - } - ), - validate: emptyArgumentValidator, - }, - }, - helpGroupLabel: HELP_GROUPS.responseActions.label, - helpGroupPosition: HELP_GROUPS.responseActions.position, - helpCommandPosition: 4, - helpDisabled: doesEndpointSupportCommand('kill-process') === false, - helpHidden: !getRbacControl({ commandName: 'kill-process', privileges: endpointPrivileges }), - }, - { - name: 'suspend-process', - about: getCommandAboutInfo({ - aboutInfo: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.about', - { - defaultMessage: 'Temporarily suspend a process', - } - ), - isSupported: doesEndpointSupportCommand('suspend-process'), - }), - RenderComponent: SuspendProcessActionResult, - meta: { - endpointId: endpointAgentId, - capabilities: endpointCapabilities, - privileges: endpointPrivileges, - }, - exampleUsage: 'suspend-process --pid 123 --comment "suspend this process"', - exampleInstruction: ENTER_PID_OR_ENTITY_ID_INSTRUCTION, - validate: capabilitiesAndPrivilegesValidator, - mustHaveArgs: true, - args: { - comment: { - required: false, - allowMultiples: false, - about: COMMENT_ARG_ABOUT, - }, - pid: { - required: false, - allowMultiples: false, - exclusiveOr: true, - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.pid.arg.comment', - { - defaultMessage: 'A PID representing the process to suspend', - } - ), - validate: pidValidator, - }, - entityId: { - required: false, - allowMultiples: false, - exclusiveOr: true, - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.entityId.arg.comment', - { - defaultMessage: 'An entity id representing the process to suspend', - } - ), - validate: emptyArgumentValidator, - }, - }, - helpGroupLabel: HELP_GROUPS.responseActions.label, - helpGroupPosition: HELP_GROUPS.responseActions.position, - helpCommandPosition: 5, - helpDisabled: doesEndpointSupportCommand('suspend-process') === false, - helpHidden: !getRbacControl({ - commandName: 'suspend-process', - privileges: endpointPrivileges, - }), - }, - { - name: 'status', - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.status.about', { - defaultMessage: 'Show host status information', - }), - RenderComponent: EndpointStatusActionResult, - meta: { - endpointId: endpointAgentId, - }, - helpGroupLabel: HELP_GROUPS.responseActions.label, - helpGroupPosition: HELP_GROUPS.responseActions.position, - helpCommandPosition: 2, - }, - { - name: 'processes', - about: getCommandAboutInfo({ - aboutInfo: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.processes.about', - { - defaultMessage: 'Show all running processes', - } - ), - isSupported: doesEndpointSupportCommand('processes'), - }), - RenderComponent: GetProcessesActionResult, - meta: { - endpointId: endpointAgentId, - capabilities: endpointCapabilities, - privileges: endpointPrivileges, - }, - exampleUsage: 'processes --comment "get the processes"', - exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION, - validate: capabilitiesAndPrivilegesValidator, - args: { - comment: { - required: false, - allowMultiples: false, - about: COMMENT_ARG_ABOUT, - }, - }, - helpGroupLabel: HELP_GROUPS.responseActions.label, - helpGroupPosition: HELP_GROUPS.responseActions.position, - helpCommandPosition: 3, - helpDisabled: doesEndpointSupportCommand('processes') === false, - helpHidden: !getRbacControl({ commandName: 'processes', privileges: endpointPrivileges }), - }, - { - name: 'get-file', - about: getCommandAboutInfo({ - aboutInfo: i18n.translate('xpack.securitySolution.endpointConsoleCommands.getFile.about', { - defaultMessage: 'Retrieve a file from the host', - }), - isSupported: doesEndpointSupportCommand('processes'), - }), - RenderComponent: GetFileActionResult, - meta: { - endpointId: endpointAgentId, - capabilities: endpointCapabilities, - privileges: endpointPrivileges, - }, - exampleUsage: 'get-file path "/full/path/to/file.txt" --comment "Possible malware"', - exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION, - validate: capabilitiesAndPrivilegesValidator, - mustHaveArgs: true, - args: { - path: { - required: true, - allowMultiples: false, - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.getFile.pathArgAbout', - { - defaultMessage: 'The full file path to be retrieved', - } - ), - validate: (argData) => { - return emptyArgumentValidator(argData); - }, - }, - comment: { - required: false, - allowMultiples: false, - about: COMMENT_ARG_ABOUT, - }, - }, - helpGroupLabel: HELP_GROUPS.responseActions.label, - helpGroupPosition: HELP_GROUPS.responseActions.position, - helpCommandPosition: 6, - helpDisabled: !doesEndpointSupportCommand('get-file'), - helpHidden: !getRbacControl({ - commandName: 'get-file', - privileges: endpointPrivileges, - }), - }, - ]; -}; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.test.tsx deleted file mode 100644 index 550b677d4d938..0000000000000 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.test.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 { EndpointActionGenerator } from '../../../../common/endpoint/data_generators/endpoint_action_generator'; -import type { HostInfo } from '../../../../common/endpoint/types'; -import type { AppContextTestRender } from '../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; -import { useGetEndpointDetails } from '../../hooks/endpoint/use_get_endpoint_details'; -import { useGetEndpointPendingActionsSummary } from '../../hooks/endpoint/use_get_endpoint_pending_actions_summary'; -import { mockEndpointDetailsApiResult } from '../../pages/endpoint_hosts/store/mock_endpoint_result_list'; -import { HeaderEndpointInfo } from './header_endpoint_info'; - -jest.mock('../../hooks/endpoint/use_get_endpoint_details'); -jest.mock('../../hooks/endpoint/use_get_endpoint_pending_actions_summary'); - -const getEndpointDetails = useGetEndpointDetails as jest.Mock; -const getPendingActions = useGetEndpointPendingActionsSummary as jest.Mock; - -describe('Responder header endpoint info', () => { - let render: () => ReturnType<AppContextTestRender['render']>; - let renderResult: ReturnType<typeof render>; - let mockedContext: AppContextTestRender; - let endpointDetails: HostInfo; - - beforeEach(() => { - mockedContext = createAppRootMockRenderer(); - render = () => - (renderResult = mockedContext.render(<HeaderEndpointInfo endpointId={'1234'} />)); - endpointDetails = mockEndpointDetailsApiResult(); - getEndpointDetails.mockReturnValue({ data: endpointDetails }); - getPendingActions.mockReturnValue({ - data: { - data: [ - new EndpointActionGenerator('seed').generateAgentPendingActionsSummary({ - agent_id: '1234', - }), - ], - }, - }); - render(); - }); - - afterEach(() => { - jest.clearAllMocks(); - }); - it('should show endpoint name', async () => { - const name = await renderResult.findByTestId('responderHeaderEndpointName'); - expect(name.textContent).toBe(`${endpointDetails.metadata.host.name}`); - }); - it('should show agent and isolation status', async () => { - const agentStatus = await renderResult.findByTestId( - 'responderHeaderEndpointAgentIsolationStatus' - ); - expect(agentStatus.textContent).toBe(`UnhealthyIsolating`); - }); - it('should show last updated time', async () => { - const lastUpdated = await renderResult.findByTestId('responderHeaderLastSeen'); - expect(lastUpdated).toBeTruthy(); - }); -}); diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx index 98f8954f0dd65..17cffff683411 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx @@ -12,11 +12,11 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { useIsMounted } from '@kbn/securitysolution-hook-utils'; import { useTestIdGenerator } from '../../../hooks/use_test_id_generator'; import type { BaseActionRequestBody } from '../../../../../common/endpoint/schema/actions'; -import { ActionSuccess } from '../action_success'; -import { ActionError } from '../action_error'; +import { ActionSuccess } from '../components/action_success'; +import { ActionError } from '../components/action_error'; import { FormattedError } from '../../formatted_error'; -import { useGetActionDetails } from '../../../hooks/endpoint/use_get_action_details'; -import { ACTION_DETAILS_REFRESH_INTERVAL } from '../constants'; +import { useGetActionDetails } from '../../../hooks/response_actions/use_get_action_details'; +import { ACTION_DETAILS_REFRESH_INTERVAL } from '../lib/constants'; import type { ActionDetails, Immutable, diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts index 35b632d1ea4ee..2fb9c4fd76941 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts @@ -5,5 +5,7 @@ * 2.0. */ -export { getEndpointResponseActionsConsoleCommands } from './endpoint_response_actions_console_commands'; -export { ActionLogButton } from './action_log_button'; +export { getEndpointConsoleCommands } from './lib/console_commands_definition'; +export { ActionLogButton } from './components/action_log_button'; +export { HeaderEndpointInfo } from './components/header_endpoint_info'; +export { OfflineCallout } from './components/offline_callout'; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_file_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_file_action.test.tsx deleted file mode 100644 index 2f8b84c81e038..0000000000000 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_file_action.test.tsx +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { - ConsoleManagerTestComponent, - getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; -import { getEndpointResponseActionsConsoleCommands } from '..'; -import React from 'react'; -import { enterConsoleCommand } from '../../console/mocks'; -import { waitFor } from '@testing-library/react'; -import { GET_FILE_ROUTE } from '../../../../../common/endpoint/constants'; -import { getEndpointAuthzInitialStateMock } from '../../../../../common/endpoint/service/authz/mocks'; -import type { EndpointPrivileges } from '../../../../../common/endpoint/types'; -import { INSUFFICIENT_PRIVILEGES_FOR_COMMAND } from '../../../../common/translations'; - -jest.mock('../../../../common/components/user_privileges'); - -describe('When using get-file action from response actions console', () => { - let render: ( - capabilities?: EndpointCapabilities[] - ) => Promise<ReturnType<AppContextTestRender['render']>>; - let renderResult: ReturnType<AppContextTestRender['render']>; - let apiMocks: ReturnType<typeof responseActionsHttpMocks>; - let consoleManagerMockAccess: ReturnType< - typeof getConsoleManagerMockRenderResultQueriesAndActions - >; - let endpointPrivileges: EndpointPrivileges; - - beforeEach(() => { - const mockedContext = createAppRootMockRenderer(); - - apiMocks = responseActionsHttpMocks(mockedContext.coreStart.http); - endpointPrivileges = { ...getEndpointAuthzInitialStateMock(), loading: false }; - - render = async (capabilities: EndpointCapabilities[] = [...ENDPOINT_CAPABILITIES]) => { - renderResult = mockedContext.render( - <ConsoleManagerTestComponent - registerConsoleProps={() => { - return { - consoleProps: { - 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ - endpointAgentId: 'a.b.c', - endpointCapabilities: [...capabilities], - endpointPrivileges, - }), - }, - }; - }} - /> - ); - - consoleManagerMockAccess = getConsoleManagerMockRenderResultQueriesAndActions(renderResult); - - await consoleManagerMockAccess.clickOnRegisterNewConsole(); - await consoleManagerMockAccess.openRunningConsole(); - - return renderResult; - }; - }); - - it('should show an error if the `get_file` capability is not present in the endpoint', async () => { - await render([]); - enterConsoleCommand(renderResult, 'get-file --path="one/two"'); - - expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual( - 'The current version of the Agent does not support this feature. Upgrade your Agent through Fleet to use this feature and new response actions such as killing and suspending processes.' - ); - }); - - it('should show an error if the `get-file` is not authorized', async () => { - endpointPrivileges.canWriteFileOperations = false; - await render(); - enterConsoleCommand(renderResult, 'get-file --path="one/two"'); - - expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual( - INSUFFICIENT_PRIVILEGES_FOR_COMMAND - ); - }); - - it('should show an error if `get-file` is entered without `--path` argument', async () => { - await render([]); - enterConsoleCommand(renderResult, 'get-file'); - - expect(renderResult.getByTestId('test-badArgument-message').textContent).toEqual( - 'Missing required arguments: --path' - ); - }); - - it('should show error if `--path` is empty string', async () => { - await render(); - enterConsoleCommand(renderResult, 'get-file --path=""'); - - expect(renderResult.getByTestId('test-badArgument-message').textContent).toEqual( - 'Invalid argument value: --path. Argument cannot be empty' - ); - }); - - it('should call the `get_file` api with the expected payload', async () => { - await render(); - enterConsoleCommand(renderResult, 'get-file --path="one/two"'); - - await waitFor(() => { - expect(apiMocks.responseProvider.getFile).toHaveBeenCalledWith({ - body: '{"endpoint_ids":["a.b.c"],"parameters":{"path":"one/two"}}', - path: GET_FILE_ROUTE, - }); - }); - }); - - it('should only accept one `--comment`', async () => { - await render(); - enterConsoleCommand(renderResult, 'get-file --path="one/two" --comment "one" --comment "two"'); - - expect(renderResult.getByTestId('test-badArgument-message').textContent).toEqual( - 'Argument can only be used once: --comment' - ); - }); - - it('should display download link once action completes', async () => { - await render(); - enterConsoleCommand(renderResult, 'get-file --path="one/two"'); - - await waitFor(() => { - expect(apiMocks.responseProvider.actionDetails).toHaveBeenCalled(); - }); - - expect(renderResult.getByTestId('getFileSuccess').textContent).toEqual( - 'File retrieved from the host.Click here to download(ZIP file passcode: elastic)' - ); - }); -}); 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 new file mode 100644 index 0000000000000..b74304a21280a --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts @@ -0,0 +1,416 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { + EndpointCapabilities, + ConsoleResponseActionCommands, +} from '../../../../../common/endpoint/service/response_actions/constants'; +import { GetFileActionResult } from '../command_render_components/get_file_action'; +import type { Command, CommandDefinition } from '../../console'; +import { IsolateActionResult } from '../command_render_components/isolate_action'; +import { ReleaseActionResult } from '../command_render_components/release_action'; +import { KillProcessActionResult } from '../command_render_components/kill_process_action'; +import { SuspendProcessActionResult } from '../command_render_components/suspend_process_action'; +import { EndpointStatusActionResult } from '../command_render_components/status_action'; +import { GetProcessesActionResult } from '../command_render_components/get_processes_action'; +import type { ParsedArgData } from '../../console/service/parsed_command_input'; +import type { EndpointPrivileges, ImmutableArray } from '../../../../../common/endpoint/types'; +import { + INSUFFICIENT_PRIVILEGES_FOR_COMMAND, + UPGRADE_ENDPOINT_FOR_RESPONDER, +} from '../../../../common/translations'; +import { getCommandAboutInfo } from './get_command_about_info'; + +const emptyArgumentValidator = (argData: ParsedArgData): true | string => { + if (argData?.length > 0 && typeof argData[0] === 'string' && argData[0]?.trim().length > 0) { + return true; + } else { + return i18n.translate('xpack.securitySolution.endpointConsoleCommands.emptyArgumentMessage', { + defaultMessage: 'Argument cannot be empty', + }); + } +}; + +const pidValidator = (argData: ParsedArgData): true | string => { + const emptyResult = emptyArgumentValidator(argData); + if (emptyResult !== true) { + return emptyResult; + } else if (Number.isSafeInteger(Number(argData)) && Number(argData) > 0) { + return true; + } else { + return i18n.translate('xpack.securitySolution.endpointConsoleCommands.invalidPidMessage', { + defaultMessage: 'Argument must be a positive number representing the PID of a process', + }); + } +}; + +const commandToCapabilitiesMap = new Map<ConsoleResponseActionCommands, EndpointCapabilities>([ + ['isolate', 'isolation'], + ['release', 'isolation'], + ['kill-process', 'kill_process'], + ['suspend-process', 'suspend_process'], + ['processes', 'running_processes'], + ['get-file', 'get_file'], +]); + +const getRbacControl = ({ + commandName, + privileges, +}: { + commandName: ConsoleResponseActionCommands; + privileges: EndpointPrivileges; +}): boolean => { + const commandToPrivilegeMap = new Map<ConsoleResponseActionCommands, boolean>([ + ['isolate', privileges.canIsolateHost], + ['release', privileges.canUnIsolateHost], + ['kill-process', privileges.canKillProcess], + ['suspend-process', privileges.canSuspendProcess], + ['processes', privileges.canGetRunningProcesses], + ['get-file', privileges.canWriteFileOperations], + ]); + return commandToPrivilegeMap.get(commandName as ConsoleResponseActionCommands) ?? false; +}; + +const capabilitiesAndPrivilegesValidator = (command: Command): true | string => { + const privileges = command.commandDefinition.meta.privileges; + const endpointCapabilities: EndpointCapabilities[] = command.commandDefinition.meta.capabilities; + const commandName = command.commandDefinition.name as ConsoleResponseActionCommands; + const responderCapability = commandToCapabilitiesMap.get(commandName); + let errorMessage = ''; + if (!responderCapability) { + errorMessage = errorMessage.concat(UPGRADE_ENDPOINT_FOR_RESPONDER); + } + if (responderCapability) { + if (!endpointCapabilities.includes(responderCapability)) { + errorMessage = errorMessage.concat(UPGRADE_ENDPOINT_FOR_RESPONDER); + } + } + if (getRbacControl({ commandName, privileges }) !== true) { + errorMessage = errorMessage.concat(INSUFFICIENT_PRIVILEGES_FOR_COMMAND); + } + + if (errorMessage.length) { + return errorMessage; + } + + return true; +}; + +const HELP_GROUPS = Object.freeze({ + responseActions: { + position: 0, + label: i18n.translate('xpack.securitySolution.endpointConsoleCommands.groups.responseActions', { + defaultMessage: 'Response actions', + }), + }, +}); + +const ENTER_PID_OR_ENTITY_ID_INSTRUCTION = i18n.translate( + 'xpack.securitySolution.endpointResponseActionsConsoleCommands.enterPidOrEntityId', + { defaultMessage: 'Enter a pid or an entity id to execute' } +); + +const ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION = i18n.translate( + 'xpack.securitySolution.endpointResponseActionsConsoleCommands.enterOrAddOptionalComment', + { defaultMessage: 'Hit enter to execute or add an optional comment' } +); + +const COMMENT_ARG_ABOUT = i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.commandArgAbout', + { defaultMessage: 'A comment to go along with the action' } +); + +export const getEndpointConsoleCommands = ({ + endpointAgentId, + endpointCapabilities, + endpointPrivileges, +}: { + endpointAgentId: string; + endpointCapabilities: ImmutableArray<string>; + endpointPrivileges: EndpointPrivileges; +}): CommandDefinition[] => { + const doesEndpointSupportCommand = (commandName: ConsoleResponseActionCommands) => { + const responderCapability = commandToCapabilitiesMap.get(commandName); + if (responderCapability) { + return endpointCapabilities.includes(responderCapability); + } + return false; + }; + + return [ + { + name: 'isolate', + about: getCommandAboutInfo({ + aboutInfo: i18n.translate('xpack.securitySolution.endpointConsoleCommands.isolate.about', { + defaultMessage: 'Isolate the host', + }), + isSupported: doesEndpointSupportCommand('isolate'), + }), + RenderComponent: IsolateActionResult, + meta: { + endpointId: endpointAgentId, + capabilities: endpointCapabilities, + privileges: endpointPrivileges, + }, + exampleUsage: 'isolate --comment "isolate this host"', + exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION, + validate: capabilitiesAndPrivilegesValidator, + args: { + comment: { + required: false, + allowMultiples: false, + about: COMMENT_ARG_ABOUT, + }, + }, + helpGroupLabel: HELP_GROUPS.responseActions.label, + helpGroupPosition: HELP_GROUPS.responseActions.position, + helpCommandPosition: 0, + helpDisabled: doesEndpointSupportCommand('isolate') === false, + helpHidden: !getRbacControl({ commandName: 'isolate', privileges: endpointPrivileges }), + }, + { + name: 'release', + about: getCommandAboutInfo({ + aboutInfo: i18n.translate('xpack.securitySolution.endpointConsoleCommands.release.about', { + defaultMessage: 'Release the host', + }), + isSupported: doesEndpointSupportCommand('release'), + }), + RenderComponent: ReleaseActionResult, + meta: { + endpointId: endpointAgentId, + capabilities: endpointCapabilities, + privileges: endpointPrivileges, + }, + exampleUsage: 'release --comment "release this host"', + exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION, + validate: capabilitiesAndPrivilegesValidator, + args: { + comment: { + required: false, + allowMultiples: false, + about: COMMENT_ARG_ABOUT, + }, + }, + helpGroupLabel: HELP_GROUPS.responseActions.label, + helpGroupPosition: HELP_GROUPS.responseActions.position, + helpCommandPosition: 1, + helpDisabled: doesEndpointSupportCommand('release') === false, + helpHidden: !getRbacControl({ commandName: 'release', privileges: endpointPrivileges }), + }, + { + name: 'kill-process', + about: getCommandAboutInfo({ + aboutInfo: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.killProcess.about', + { + defaultMessage: 'Kill/terminate a process', + } + ), + isSupported: doesEndpointSupportCommand('kill-process'), + }), + RenderComponent: KillProcessActionResult, + meta: { + endpointId: endpointAgentId, + capabilities: endpointCapabilities, + privileges: endpointPrivileges, + }, + exampleUsage: 'kill-process --pid 123 --comment "kill this process"', + exampleInstruction: ENTER_PID_OR_ENTITY_ID_INSTRUCTION, + validate: capabilitiesAndPrivilegesValidator, + mustHaveArgs: true, + args: { + comment: { + required: false, + allowMultiples: false, + about: COMMENT_ARG_ABOUT, + }, + pid: { + required: false, + allowMultiples: false, + exclusiveOr: true, + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.pid.arg.comment', { + defaultMessage: 'A PID representing the process to kill', + }), + validate: pidValidator, + }, + entityId: { + required: false, + allowMultiples: false, + exclusiveOr: true, + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.entityId.arg.comment', + { + defaultMessage: 'An entity id representing the process to kill', + } + ), + validate: emptyArgumentValidator, + }, + }, + helpGroupLabel: HELP_GROUPS.responseActions.label, + helpGroupPosition: HELP_GROUPS.responseActions.position, + helpCommandPosition: 4, + helpDisabled: doesEndpointSupportCommand('kill-process') === false, + helpHidden: !getRbacControl({ commandName: 'kill-process', privileges: endpointPrivileges }), + }, + { + name: 'suspend-process', + about: getCommandAboutInfo({ + aboutInfo: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.about', + { + defaultMessage: 'Temporarily suspend a process', + } + ), + isSupported: doesEndpointSupportCommand('suspend-process'), + }), + RenderComponent: SuspendProcessActionResult, + meta: { + endpointId: endpointAgentId, + capabilities: endpointCapabilities, + privileges: endpointPrivileges, + }, + exampleUsage: 'suspend-process --pid 123 --comment "suspend this process"', + exampleInstruction: ENTER_PID_OR_ENTITY_ID_INSTRUCTION, + validate: capabilitiesAndPrivilegesValidator, + mustHaveArgs: true, + args: { + comment: { + required: false, + allowMultiples: false, + about: COMMENT_ARG_ABOUT, + }, + pid: { + required: false, + allowMultiples: false, + exclusiveOr: true, + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.pid.arg.comment', + { + defaultMessage: 'A PID representing the process to suspend', + } + ), + validate: pidValidator, + }, + entityId: { + required: false, + allowMultiples: false, + exclusiveOr: true, + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.entityId.arg.comment', + { + defaultMessage: 'An entity id representing the process to suspend', + } + ), + validate: emptyArgumentValidator, + }, + }, + helpGroupLabel: HELP_GROUPS.responseActions.label, + helpGroupPosition: HELP_GROUPS.responseActions.position, + helpCommandPosition: 5, + helpDisabled: doesEndpointSupportCommand('suspend-process') === false, + helpHidden: !getRbacControl({ + commandName: 'suspend-process', + privileges: endpointPrivileges, + }), + }, + { + name: 'status', + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.status.about', { + defaultMessage: 'Show host status information', + }), + RenderComponent: EndpointStatusActionResult, + meta: { + endpointId: endpointAgentId, + }, + helpGroupLabel: HELP_GROUPS.responseActions.label, + helpGroupPosition: HELP_GROUPS.responseActions.position, + helpCommandPosition: 2, + }, + { + name: 'processes', + about: getCommandAboutInfo({ + aboutInfo: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.processes.about', + { + defaultMessage: 'Show all running processes', + } + ), + isSupported: doesEndpointSupportCommand('processes'), + }), + RenderComponent: GetProcessesActionResult, + meta: { + endpointId: endpointAgentId, + capabilities: endpointCapabilities, + privileges: endpointPrivileges, + }, + exampleUsage: 'processes --comment "get the processes"', + exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION, + validate: capabilitiesAndPrivilegesValidator, + args: { + comment: { + required: false, + allowMultiples: false, + about: COMMENT_ARG_ABOUT, + }, + }, + helpGroupLabel: HELP_GROUPS.responseActions.label, + helpGroupPosition: HELP_GROUPS.responseActions.position, + helpCommandPosition: 3, + helpDisabled: doesEndpointSupportCommand('processes') === false, + helpHidden: !getRbacControl({ commandName: 'processes', privileges: endpointPrivileges }), + }, + { + name: 'get-file', + about: getCommandAboutInfo({ + aboutInfo: i18n.translate('xpack.securitySolution.endpointConsoleCommands.getFile.about', { + defaultMessage: 'Retrieve a file from the host', + }), + isSupported: doesEndpointSupportCommand('processes'), + }), + RenderComponent: GetFileActionResult, + meta: { + endpointId: endpointAgentId, + capabilities: endpointCapabilities, + privileges: endpointPrivileges, + }, + exampleUsage: 'get-file --path "/full/path/to/file.txt" --comment "Possible malware"', + exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION, + validate: capabilitiesAndPrivilegesValidator, + mustHaveArgs: true, + args: { + path: { + required: true, + allowMultiples: false, + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.getFile.pathArgAbout', + { + defaultMessage: 'The full file path to be retrieved', + } + ), + validate: (argData) => { + return emptyArgumentValidator(argData); + }, + }, + comment: { + required: false, + allowMultiples: false, + about: COMMENT_ARG_ABOUT, + }, + }, + helpGroupLabel: HELP_GROUPS.responseActions.label, + helpGroupPosition: HELP_GROUPS.responseActions.position, + helpCommandPosition: 6, + helpDisabled: !doesEndpointSupportCommand('get-file'), + helpHidden: !getRbacControl({ + commandName: 'get-file', + privileges: endpointPrivileges, + }), + }, + ]; +}; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/constants.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/constants.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/constants.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/constants.tsx 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 new file mode 100644 index 0000000000000..746b9201cd200 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts @@ -0,0 +1,132 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +const CODES = Object.freeze({ + // ----------------------------------------------------------------- + // GET-FILE CODES + // ----------------------------------------------------------------- + /** file not found */ + 'ra_get-file_error_not-found': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.getFile.notFound', + { defaultMessage: 'The file specified was not found' } + ), + + /** path is reachable but does not point to a file */ + 'ra_get-file_error_is-directory': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.getFile.isDirectory', + { defaultMessage: 'The path defined is not a file' } + ), + + /** path did not pass basic validation: malformed path, unix instead of windows, invalid characters, not full path, etc */ + 'ra_get-file_error_invalid-input': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.getFile.invalidPath', + { defaultMessage: 'The path defined is not valid' } + ), + + /** Maybe: possible to be able to list the file but not read it's content */ + 'ra_get-file_error_not-permitted': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.getFile.notPermitted', + { defaultMessage: 'Endpoint unable to read file requested (not permitted)' } + ), + + /** file size exceeds hard coded limit (100MB) */ + 'ra_get-file_error_too-big': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.getFile.tooBig', + { defaultMessage: 'The file requested is too large and can not be retrieved' } + ), + + /** Endpoint ran out of file upload queue size */ + 'ra_get-file_error_disk-quota': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.getFile.diskQuota', + { defaultMessage: 'Endpoint ran out of disk quota while attempting to retrieve file' } + ), + + /** Something interrupted preparing the zip: file read error, zip error */ + 'ra_get-file_error_processing': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.getFile.errorProcessing', + { defaultMessage: 'File retrieval was interrupted' } + ), + + /** The fleet upload API was unreachable (not just busy) */ + 'ra_get-file_error_upload-api-unreachable': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.getFile.uploadApiUnreachable', + { defaultMessage: 'File upload api (fleet-server) is unreachable' } + ), + + /** Perhaps internet connection was too slow or unstable to upload all chunks before unique upload-id expired. Endpoint will re-try a bit (3 times?). */ + 'ra_get-file_error_upload-timeout': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.getFile.uploadTimeout', + { defaultMessage: 'File upload timed out' } + ), + + /** Upload API could be busy, endpoint should periodically re-try */ + 'ra_get-file_error_queue-timeout': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.getFile.queueTimeout', + { defaultMessage: 'Endpoint timed out while attempting to connect to upload API' } + ), + + // ----------------------------------------------------------------- + // SUSPEND-PROCESS CODES + // ----------------------------------------------------------------- + /** + * Code will be used whenever you provide an entity_id or pid that isn't found. + * suspend_process will always be an error because the process was not found to be suspended + */ + 'ra_suspend-process_error_not-found': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.suspendProcess.notFoundError', + { defaultMessage: 'The provided process was not found' } + ), + + /** + * Code will be used when the provided process can not be killed (for stability reasons). + * Example: This occurs if you try to kill Endpoint Security + */ + 'ra_suspend-process_error_not-permitted': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.suspendProcess.notPermittedSuccess', + { defaultMessage: 'The provided process cannot be suspended' } + ), + + // ----------------------------------------------------------------- + // KILL-PROCESS CODES + // ----------------------------------------------------------------- + /** + * Code will be used whenever you provide an entity_id that isn't found. Since entity_id is + * unique, we can guarantee that it was legitimately not found and not just that the process + * was already killed. + */ + 'ra_kill-process_error_not-found': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.killProcess.notFoundError', + { defaultMessage: 'The provided process was not found' } + ), + + /** + * Code will be used whenever you provide a pid that isn't found. Since pid is reused, we aren't + * sure if the process was already killed or just wasn't found. In either case, a process with + * that pid will no longer be running. + */ + 'ra_kill-process_success_no-action': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.killProcess.noActionSuccess', + { defaultMessage: 'Action completed. The provided process was not found or already killed' } + ), + + /** + * Code will be used when the provided process can not be killed (for stability reasons). + * Example: This occurs if you try to kill Endpoint Security + */ + 'ra_kill-process_error_not-permitted': i18n.translate( + 'xpack.securitySolution.endpointActionResponseCodes.killProcess.notPermittedSuccess', + { defaultMessage: 'The provided process cannot be killed' } + ), +}); + +/** + * A map of possible code's that can be returned from the endpoint for response actions + */ +export const endpointActionResponseCodes: Readonly<Record<string | keyof typeof CODES, string>> = + CODES; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_command_about_info.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/get_command_about_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_command_about_info.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/get_command_about_info.tsx index 3a973defa2d0c..5f3261d312d2b 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_command_about_info.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/get_command_about_info.tsx @@ -6,8 +6,8 @@ */ import React from 'react'; -import { i18n } from '@kbn/i18n'; import { EuiIconTip } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; const UNSUPPORTED_COMMAND_INFO = i18n.translate( 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.unsupportedCommandInfo', diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.test.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.test.ts rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.ts new file mode 100644 index 0000000000000..d1d16b72a426c --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/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. + */ +import type { ResponseActionParametersWithPidOrEntityId } from '../../../../../common/endpoint/types'; + +export const parsedPidOrEntityIdParameter = (parameters: { + pid?: string[]; + entityId?: string[]; +}): ResponseActionParametersWithPidOrEntityId => { + if (parameters.pid) { + return { pid: Number(parameters.pid[0]) }; + } + + return { + entity_id: parameters?.entityId?.[0] ?? '', + }; +}; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.test.tsx deleted file mode 100644 index 2b71c4f6e74b4..0000000000000 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import type { HostInfo } from '../../../../common/endpoint/types'; -import { HostStatus } from '../../../../common/endpoint/types'; -import type { AppContextTestRender } from '../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; -import { useGetEndpointDetails } from '../../hooks/endpoint/use_get_endpoint_details'; -import { mockEndpointDetailsApiResult } from '../../pages/endpoint_hosts/store/mock_endpoint_result_list'; -import { OfflineCallout } from './offline_callout'; - -jest.mock('../../hooks/endpoint/use_get_endpoint_details'); - -const getEndpointDetails = useGetEndpointDetails as jest.Mock; - -describe('Responder offline callout', () => { - let render: () => ReturnType<AppContextTestRender['render']>; - let renderResult: ReturnType<typeof render>; - let mockedContext: AppContextTestRender; - let endpointDetails: HostInfo; - - beforeEach(() => { - mockedContext = createAppRootMockRenderer(); - render = () => (renderResult = mockedContext.render(<OfflineCallout endpointId={'1234'} />)); - endpointDetails = mockEndpointDetailsApiResult(); - getEndpointDetails.mockReturnValue({ data: endpointDetails }); - render(); - }); - - afterEach(() => { - jest.clearAllMocks(); - }); - it('should be visible when endpoint is offline', () => { - getEndpointDetails.mockReturnValue({ - data: { ...endpointDetails, host_status: HostStatus.OFFLINE }, - }); - render(); - const callout = renderResult.queryByTestId('offlineCallout'); - expect(callout).toBeTruthy(); - }); - it('should not be visible when endpoint is online', () => { - getEndpointDetails.mockReturnValue({ - data: { ...endpointDetails, host_status: HostStatus.HEALTHY }, - }); - render(); - const callout = renderResult.queryByTestId('offlineCallout'); - expect(callout).toBeFalsy(); - }); -}); diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.ts deleted file mode 100644 index 0b8e59d0353f7..0000000000000 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import type { ResponseActionParametersWithPidOrEntityId } from '../../../../common/endpoint/types'; - -export const parsedPidOrEntityIdParameter = (parameters: { - pid?: string[]; - entityId?: string[]; -}): ResponseActionParametersWithPidOrEntityId => { - if (parameters.pid) { - return { pid: Number(parameters.pid[0]) }; - } - - return { - entity_id: parameters?.entityId?.[0] ?? '', - }; -}; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx index 65b40d9a924ea..05b3fec8cd967 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx @@ -7,7 +7,10 @@ import uuid from 'uuid'; import type { ActionListApiResponse } from '../../../../common/endpoint/types'; -import type { ResponseActionStatus } from '../../../../common/endpoint/service/response_actions/constants'; +import type { + ResponseActionsApiCommandNames, + ResponseActionStatus, +} from '../../../../common/endpoint/service/response_actions/constants'; import { EndpointActionGenerator } from '../../../../common/endpoint/data_generators/endpoint_action_generator'; export const getActionListMock = async ({ @@ -49,6 +52,7 @@ export const getActionListMock = async ({ const actionDetails: ActionListApiResponse['data'] = actionIds.map((actionId) => { return endpointActionGenerator.generateActionDetails({ agents: [id], + command: (commands?.[0] ?? 'isolate') as ResponseActionsApiCommandNames, id: actionId, isCompleted, isExpired, diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx index 09d201c171e9e..8d9c2ae8ec60c 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx @@ -15,12 +15,18 @@ import { type AppContextTestRender, } from '../../../common/mock/endpoint'; import { ResponseActionsLog } from './response_actions_log'; -import type { ActionListApiResponse } from '../../../../common/endpoint/types'; +import type { + ActionFileInfoApiResponse, + ActionListApiResponse, +} from '../../../../common/endpoint/types'; import { MANAGEMENT_PATH } from '../../../../common/constants'; import { getActionListMock } from './mocks'; import { useGetEndpointsList } from '../../hooks/endpoint/use_get_endpoints_list'; import uuid from 'uuid'; import { RESPONSE_ACTION_API_COMMANDS_NAMES } from '../../../../common/endpoint/service/response_actions/constants'; +import { useUserPrivileges as _useUserPrivileges } from '../../../common/components/user_privileges'; +import { responseActionsHttpMocks } from '../../mocks/response_actions_http_mocks'; +import { waitFor } from '@testing-library/react'; let mockUseGetEndpointActionList: { isFetched?: boolean; @@ -29,8 +35,8 @@ let mockUseGetEndpointActionList: { data?: ActionListApiResponse; refetch: () => unknown; }; -jest.mock('../../hooks/endpoint/use_get_endpoint_action_list', () => { - const original = jest.requireActual('../../hooks/endpoint/use_get_endpoint_action_list'); +jest.mock('../../hooks/response_actions/use_get_endpoint_action_list', () => { + const original = jest.requireActual('../../hooks/response_actions/use_get_endpoint_action_list'); return { ...original, useGetEndpointActionList: () => mockUseGetEndpointActionList, @@ -113,9 +119,28 @@ jest.mock('@kbn/kibana-react-plugin/public', () => { jest.mock('../../hooks/endpoint/use_get_endpoints_list'); +jest.mock('../../../common/components/user_privileges'); + +let mockUseGetFileInfo: { + isFetching?: boolean; + error?: Partial<IHttpFetchError> | null; + data?: ActionFileInfoApiResponse; +}; +jest.mock('../../hooks/response_actions/use_get_file_info', () => { + const original = jest.requireActual('../../hooks/response_actions/use_get_file_info'); + return { + ...original, + useGetFileInfo: () => mockUseGetFileInfo, + }; +}); + const mockUseGetEndpointsList = useGetEndpointsList as jest.Mock; describe('Response actions history', () => { + const useUserPrivilegesMock = _useUserPrivileges as jest.Mock< + ReturnType<typeof _useUserPrivileges> + >; + const testPrefix = 'response-actions-list'; let render: ( @@ -124,6 +149,7 @@ describe('Response actions history', () => { let renderResult: ReturnType<typeof render>; let history: AppContextTestRender['history']; let mockedContext: AppContextTestRender; + let apiMocks: ReturnType<typeof responseActionsHttpMocks>; const refetchFunction = jest.fn(); const baseMockedActionList = { @@ -212,6 +238,10 @@ describe('Response actions history', () => { }); describe('With Data', () => { + beforeEach(() => { + apiMocks = responseActionsHttpMocks(mockedContext.coreStart.http); + }); + it('should show table when there is data', async () => { render(); @@ -409,6 +439,97 @@ describe('Response actions history', () => { ); }); + it('should contain download link in expanded row for `get-file` action WITH file operation permission', async () => { + mockUseGetEndpointActionList = { + ...baseMockedActionList, + data: await getActionListMock({ actionCount: 1, commands: ['get-file'] }), + }; + + mockUseGetFileInfo = { + isFetching: false, + error: null, + data: apiMocks.responseProvider.fileInfo(), + }; + + render(); + + const { getByTestId } = renderResult; + const expandButton = getByTestId(`${testPrefix}-expand-button`); + userEvent.click(expandButton); + + await waitFor(() => { + expect(apiMocks.responseProvider.fileInfo).toHaveBeenCalled(); + }); + + const downloadLink = getByTestId(`${testPrefix}-getFileDownloadLink`); + expect(downloadLink).toBeTruthy(); + expect(downloadLink.textContent).toEqual( + 'Click here to download(ZIP file passcode: elastic)' + ); + }); + + it('should show file unavailable for download for `get-file` action WITH file operation permission when file is deleted', async () => { + mockUseGetEndpointActionList = { + ...baseMockedActionList, + data: await getActionListMock({ actionCount: 1, commands: ['get-file'] }), + }; + + const fileInfo = apiMocks.responseProvider.fileInfo(); + fileInfo.data.status = 'DELETED'; + + apiMocks.responseProvider.fileInfo.mockReturnValue(fileInfo); + + mockUseGetFileInfo = { + isFetching: false, + error: null, + data: apiMocks.responseProvider.fileInfo(), + }; + + render(); + + const { getByTestId } = renderResult; + const expandButton = getByTestId(`${testPrefix}-expand-button`); + userEvent.click(expandButton); + + await waitFor(() => { + expect(apiMocks.responseProvider.fileInfo).toHaveBeenCalled(); + }); + + const unavailableText = getByTestId( + `${testPrefix}-getFileDownloadLink-fileNoLongerAvailable` + ); + expect(unavailableText).toBeTruthy(); + }); + + it('should not contain download link in expanded row for `get-file` action when NO file operation permission', async () => { + const privileges = useUserPrivilegesMock(); + + useUserPrivilegesMock.mockImplementationOnce(() => { + return { + ...privileges, + endpointPrivileges: { + ...privileges.endpointPrivileges, + canWriteFileOperations: false, + }, + }; + }); + + mockUseGetEndpointActionList = { + ...baseMockedActionList, + data: await getActionListMock({ actionCount: 1, commands: ['get-file'] }), + }; + + render(); + const { getByTestId, queryByTestId } = renderResult; + + const expandButton = getByTestId(`${testPrefix}-expand-button`); + userEvent.click(expandButton); + const output = getByTestId(`${testPrefix}-details-tray-output`); + expect(output).toBeTruthy(); + expect(output.textContent).toEqual('get-file completed successfully'); + expect(queryByTestId(`${testPrefix}-getFileDownloadLink`)).toBeNull(); + }); + it('should refresh data when autoRefresh is toggled on', async () => { render(); const { getByTestId } = renderResult; @@ -552,17 +673,22 @@ describe('Response actions history', () => { it('should show a list of actions when opened', () => { render(); - const { getByTestId } = renderResult; + const { getByTestId, getAllByTestId } = renderResult; userEvent.click(getByTestId(`${testPrefix}-${filterPrefix}-popoverButton`)); const filterList = getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); expect(filterList).toBeTruthy(); - expect(filterList.querySelectorAll('ul>li').length).toEqual( + expect(getAllByTestId(`${filterPrefix}-option`).length).toEqual( RESPONSE_ACTION_API_COMMANDS_NAMES.length ); - expect( - Array.from(filterList.querySelectorAll('ul>li')).map((option) => option.textContent) - ).toEqual(['isolate', 'release', 'kill-process', 'suspend-process', 'processes', 'get-file']); + expect(getAllByTestId(`${filterPrefix}-option`).map((option) => option.textContent)).toEqual([ + 'isolate', + 'release', + 'kill-process', + 'suspend-process', + 'processes', + 'get-file', + ]); }); it('should have `clear all` button `disabled` when no selected values', () => { @@ -580,15 +706,17 @@ describe('Response actions history', () => { it('should show a list of statuses when opened', () => { render(); - const { getByTestId } = renderResult; + const { getByTestId, getAllByTestId } = renderResult; userEvent.click(getByTestId(`${testPrefix}-${filterPrefix}-popoverButton`)); const filterList = getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); expect(filterList).toBeTruthy(); - expect(filterList.querySelectorAll('ul>li').length).toEqual(3); - expect( - Array.from(filterList.querySelectorAll('ul>li')).map((option) => option.textContent) - ).toEqual(['Failed', 'Pending', 'Successful']); + expect(getAllByTestId(`${filterPrefix}-option`).length).toEqual(3); + expect(getAllByTestId(`${filterPrefix}-option`).map((option) => option.textContent)).toEqual([ + 'Failed', + 'Pending', + 'Successful', + ]); }); it('should have `clear all` button `disabled` when no selected values', () => { @@ -623,13 +751,13 @@ describe('Response actions history', () => { it('should show a list of host names when opened', () => { render({ showHostNames: true }); - const { getByTestId } = renderResult; + const { getByTestId, getAllByTestId } = renderResult; const popoverButton = getByTestId(`${testPrefix}-${filterPrefix}-popoverButton`); userEvent.click(popoverButton); const filterList = getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); expect(filterList).toBeTruthy(); - expect(filterList.querySelectorAll('ul>li').length).toEqual(9); + expect(getAllByTestId(`${filterPrefix}-option`).length).toEqual(9); expect( getByTestId(`${testPrefix}-${filterPrefix}-popoverButton`).querySelector( '.euiNotificationBadge' @@ -652,16 +780,15 @@ describe('Response actions history', () => { } }); - const filterList = renderResult.getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); - - const selectedFilterOptions = Array.from(filterList.querySelectorAll('ul>li')).reduce< - number[] - >((acc, curr, i) => { - if (curr.getAttribute('aria-checked') === 'true') { - acc.push(i); - } - return acc; - }, []); + const selectedFilterOptions = getAllByTestId(`${filterPrefix}-option`).reduce<number[]>( + (acc, curr, i) => { + if (curr.getAttribute('aria-checked') === 'true') { + acc.push(i); + } + return acc; + }, + [] + ); expect(selectedFilterOptions).toEqual([1, 3, 5]); }); @@ -686,16 +813,16 @@ describe('Response actions history', () => { // re-open userEvent.click(popoverButton); - const filterList = renderResult.getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); - const selectedFilterOptions = Array.from(filterList.querySelectorAll('ul>li')).reduce< - number[] - >((acc, curr, i) => { - if (curr.getAttribute('aria-checked') === 'true') { - acc.push(i); - } - return acc; - }, []); + const selectedFilterOptions = getAllByTestId(`${filterPrefix}-option`).reduce<number[]>( + (acc, curr, i) => { + if (curr.getAttribute('aria-checked') === 'true') { + acc.push(i); + } + return acc; + }, + [] + ); expect(selectedFilterOptions).toEqual([0, 1, 2]); }); @@ -730,15 +857,15 @@ describe('Response actions history', () => { } }); - const filterList = renderResult.getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); - const selectedFilterOptions = Array.from(filterList.querySelectorAll('ul>li')).reduce< - number[] - >((acc, curr, i) => { - if (curr.getAttribute('aria-checked') === 'true') { - acc.push(i); - } - return acc; - }, []); + const selectedFilterOptions = getAllByTestId(`${filterPrefix}-option`).reduce<number[]>( + (acc, curr, i) => { + if (curr.getAttribute('aria-checked') === 'true') { + acc.push(i); + } + return acc; + }, + [] + ); expect(selectedFilterOptions).toEqual([0, 1, 2, 4, 6, 8]); }); diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/use_response_actions_log_table.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/use_response_actions_log_table.tsx index 443eac84c6b18..8d38b22508be2 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/use_response_actions_log_table.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/use_response_actions_log_table.tsx @@ -5,7 +5,6 @@ * 2.0. */ import React, { useCallback, useMemo, useState } from 'react'; -import type { HorizontalAlignment } from '@elastic/eui'; import { EuiI18nNumber, @@ -20,6 +19,7 @@ import { EuiScreenReaderOnly, EuiText, EuiToolTip, + type HorizontalAlignment, } from '@elastic/eui'; import { css, euiStyled } from '@kbn/kibana-react-plugin/common'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -33,6 +33,7 @@ import { getEmptyValue } from '../../../common/components/empty_value'; import { StatusBadge } from './components/status_badge'; import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; import { MANAGEMENT_PAGE_SIZE_OPTIONS } from '../../common/constants'; +import { ResponseActionFileDownloadLink } from '../response_action_file_download_link'; const emptyValue = getEmptyValue(); @@ -137,6 +138,7 @@ export const useResponseActionsLogTable = ({ : undefined; const command = getUiCommand(_command); + const isGetFileCommand = command === 'get-file'; const dataList = [ { title: OUTPUT_MESSAGES.expandSection.placedAt, @@ -169,6 +171,35 @@ export const useResponseActionsLogTable = ({ }; }); + const getOutputContent = () => { + if (isExpired) { + return OUTPUT_MESSAGES.hasExpired(command); + } + + if (!isCompleted) { + return OUTPUT_MESSAGES.isPending(command); + } + + if (!wasSuccessful) { + return OUTPUT_MESSAGES.hasFailed(command); + } + + if (isGetFileCommand) { + return ( + <> + {OUTPUT_MESSAGES.wasSuccessful(command)} + <ResponseActionFileDownloadLink + action={item} + textSize="xs" + data-test-subj={getTestId('getFileDownloadLink')} + /> + </> + ); + } + + return OUTPUT_MESSAGES.wasSuccessful(command); + }; + const outputList = [ { title: ( @@ -177,13 +208,7 @@ export const useResponseActionsLogTable = ({ description: ( // codeblock for output <StyledEuiCodeBlock data-test-subj={getTestId('details-tray-output')}> - {isExpired - ? OUTPUT_MESSAGES.hasExpired(command) - : isCompleted - ? wasSuccessful - ? OUTPUT_MESSAGES.wasSuccessful(command) - : OUTPUT_MESSAGES.hasFailed(command) - : OUTPUT_MESSAGES.isPending(command)} + {getOutputContent()} </StyledEuiCodeBlock> ), }, diff --git a/x-pack/plugins/security_solution/public/management/components/package_action_item/package_action.formatter.test.ts b/x-pack/plugins/security_solution/public/management/components/package_action_item/package_action.formatter.test.ts new file mode 100644 index 0000000000000..dc5c443e15e2e --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/package_action_item/package_action.formatter.test.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { FleetServerAgentComponentUnit } from '@kbn/fleet-plugin/common/types'; + +import { PackageActionFormatter, titles, descriptions } from './package_action_formatter'; +import { ENDPOINT_ERROR_CODES } from '../../../../common/endpoint/constants'; + +describe('PackageActionFormatter', () => { + it('correctly formats es connection error', () => { + const unit: FleetServerAgentComponentUnit = { + id: 'test-id', + type: 'input', + status: 'failed', + message: 'test message', + payload: { + error: { + code: ENDPOINT_ERROR_CODES.ES_CONNECTION_ERROR, + message: 'an error message', + }, + }, + }; + const docLinks = { es_connection: 'somedoclink' }; + const formatter = new PackageActionFormatter(unit, docLinks); + expect(formatter.key).toBe('es_connection'); + expect(formatter.title).toBe(titles.get('es_connection')); + expect(formatter.description).toBe(descriptions.get('es_connection')); + expect(formatter.linkUrl).toBe(docLinks.es_connection); + }); + + it('correct formats generic error', () => { + const unit: FleetServerAgentComponentUnit = { + id: 'test-id', + type: 'input', + status: 'failed', + message: 'test message', + }; + const docLinks = { es_connection: 'somedoclink' }; + const formatter = new PackageActionFormatter(unit, docLinks); + expect(formatter.key).toBe('policy_failure'); + expect(formatter.title).toBe(titles.get('policy_failure')); + expect(formatter.description).toBe(descriptions.get('policy_failure')); + }); +}); diff --git a/x-pack/plugins/security_solution/public/management/components/package_action_item/package_action_formatter.ts b/x-pack/plugins/security_solution/public/management/components/package_action_item/package_action_formatter.ts index ac4aebf65c496..9af6983ecfcdb 100644 --- a/x-pack/plugins/security_solution/public/management/components/package_action_item/package_action_formatter.ts +++ b/x-pack/plugins/security_solution/public/management/components/package_action_item/package_action_formatter.ts @@ -7,6 +7,10 @@ import { i18n } from '@kbn/i18n'; import type { DocLinks } from '@kbn/doc-links'; +import type { + FleetServerAgentComponentUnit, + FleetServerAgentComponentStatus, +} from '@kbn/fleet-plugin/common/types'; import { ENDPOINT_ERROR_CODES } from '../../../../common/endpoint/constants'; @@ -78,13 +82,12 @@ export class PackageActionFormatter { public linkText?: string; constructor( - code: number, - message: string, + unit: FleetServerAgentComponentUnit, private docLinks: DocLinks['securitySolution']['packageActionTroubleshooting'] ) { - this.key = this.getKeyFromErrorCode(code); + this.key = this.getKeyFromErrorCode(unit.payload?.error?.code, unit.status); this.title = titles.get(this.key) ?? this.key; - this.description = descriptions.get(this.key) || message; + this.description = descriptions.get(this.key) || unit.payload?.error?.message; this.linkText = linkTexts.get(this.key); } @@ -94,10 +97,13 @@ export class PackageActionFormatter { ]; } - private getKeyFromErrorCode(code: number): PackageActions { + private getKeyFromErrorCode( + code: number, + status: FleetServerAgentComponentStatus + ): PackageActions { if (code === ENDPOINT_ERROR_CODES.ES_CONNECTION_ERROR) { return 'es_connection'; - } else if (code === 124) { + } else if (status === 'failed') { return 'policy_failure'; } else { throw new Error(`Invalid error code ${code}`); diff --git a/x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.test.tsx b/x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.test.tsx index d508fa0cf7504..3898582466106 100644 --- a/x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.test.tsx @@ -5,24 +5,158 @@ * 2.0. */ +import React from 'react'; +import type { AppContextTestRender } from '../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; +import type { PageOverlayProps } from './page_overlay'; +import { + PAGE_OVERLAY_DOCUMENT_BODY_FULLSCREEN_CLASSNAME, + PAGE_OVERLAY_DOCUMENT_BODY_IS_VISIBLE_CLASSNAME, + PAGE_OVERLAY_DOCUMENT_BODY_LOCK_CLASSNAME, + PageOverlay, +} from './page_overlay'; +import { act, waitFor } from '@testing-library/react'; + describe('When using PageOverlay component', () => { - it.todo('should display the overlay using minimal props'); + let render: () => ReturnType<AppContextTestRender['render']>; + let renderResult: ReturnType<AppContextTestRender['render']>; + let reRender: () => ReturnType<AppContextTestRender['render']>; + let renderProps: jest.Mocked<PageOverlayProps>; + let historyMock: AppContextTestRender['history']; + + beforeEach(() => { + const appTestContext = createAppRootMockRenderer(); + + historyMock = appTestContext.history; + + renderProps = { + children: <div data-test-subj="test-body">{'page content here'}</div>, + onHide: jest.fn(), + 'data-test-subj': 'test', + }; + + render = () => { + renderResult = appTestContext.render(<PageOverlay {...renderProps} />); + return renderResult; + }; + + reRender = () => { + renderResult.rerender(<PageOverlay {...renderProps} />); + return renderResult; + }; + + historyMock.push('/foo'); + }); + + it('should display the overlay using minimal props', () => { + render(); + + const overlay = renderResult.getByTestId('test'); + + expect(overlay.textContent).toEqual('page content here'); + expect(overlay.classList.contains('eui-scrollBar')).toBe(true); + expect(overlay.classList.contains('scrolling')).toBe(true); + expect(overlay.classList.contains('hidden')).toBe(false); + }); + + it('should set classname on `<body>` when visible', () => { + render(); + + const bodyClasslist = window.document.body.classList; + + expect(bodyClasslist.contains(PAGE_OVERLAY_DOCUMENT_BODY_IS_VISIBLE_CLASSNAME)).toBe(true); + expect(bodyClasslist.contains(PAGE_OVERLAY_DOCUMENT_BODY_LOCK_CLASSNAME)).toBe(true); + expect(bodyClasslist.contains(PAGE_OVERLAY_DOCUMENT_BODY_FULLSCREEN_CLASSNAME)).toBe(false); + }); + + it('should all browser window scrolling when `lockDocumentBody` is `false`', () => { + renderProps.lockDocumentBody = false; + render(); + + expect(window.document.body.classList.contains(PAGE_OVERLAY_DOCUMENT_BODY_LOCK_CLASSNAME)).toBe( + false + ); + }); + + it('should remove all classnames from `<body>` when hidden/unmounted', () => { + renderProps.isHidden = true; + render(); + + const bodyClasslist = window.document.body.classList; + + expect(bodyClasslist.contains(PAGE_OVERLAY_DOCUMENT_BODY_IS_VISIBLE_CLASSNAME)).toBe(false); + expect(bodyClasslist.contains(PAGE_OVERLAY_DOCUMENT_BODY_LOCK_CLASSNAME)).toBe(false); + }); + + it('should move the overlay to be the last child of `<body>` if `appendAsBodyLastNode` prop is `true`', async () => { + renderProps.isHidden = true; + render(); + + expect(renderResult.getByTestId('test')).not.toBeVisible(); + + const myDiv = document.createElement('div'); + myDiv.classList.add('my-div'); + document.body.appendChild(myDiv); + + expect(document.body.querySelector('[data-euiportal]')!.nextElementSibling).toBe(myDiv); + + renderProps.isHidden = false; + reRender(); + + await waitFor(() => { + const portalEle = document.body.querySelector('[data-euiportal]')!; + + expect(portalEle.nextElementSibling).toBe(null); + expect(portalEle.previousElementSibling).toBe(myDiv); + }); + }); + + it('should call `onHide` when `hideOnUrlPathnameChange` is `true` and url changes', () => { + render(); + + expect(renderResult.getByTestId('test')).toBeVisible(); + + act(() => { + historyMock.push('/bar'); + }); + + expect(renderProps.onHide).toHaveBeenCalled(); + }); + + it('should NOT call `onHide` when `hideOnUrlPathnameChange` is `false` and url changes', () => { + renderProps.hideOnUrlPathnameChange = false; + render(); - it.todo('should call `onHide` callback when done button is clicked'); + expect(renderResult.getByTestId('test')).toBeVisible(); - it.todo('should set classname on `<body>` when visible'); + act(() => { + historyMock.push('/bar'); + }); - it.todo('should prevent browser window scrolling when `lockDocumentBody` is `true`'); + expect(renderProps.onHide).not.toHaveBeenCalled(); + }); - it.todo('should remove all classnames from `<body>` when hidden/unmounted'); + it('should disable content scrolling inside of overlay', () => { + renderProps.enableScrolling = false; + render(); - it.todo( - 'should move the overlay to be the last child of `<body>` if `appendAsBodyLastNode` prop is `true`' - ); + const overlay = renderResult.getByTestId('test'); - it.todo('should call `onHide` when `hideOnUrlPathnameChange` is `true` and url changes'); + expect(overlay.classList.contains('eui-scrollBar')).toBe(false); + expect(overlay.classList.contains('scrolling')).toBe(false); + }); - it.todo('should NOT call `onHide` when `hideOnUrlPathnameChange` is `false` and url changes'); + it.each` + size | className + ${'xs'} | ${'padding-xs'} + ${'s'} | ${'padding-s'} + ${'m'} | ${'padding-m'} + ${'l'} | ${'padding-l'} + ${'xl'} | ${'padding-xl'} + `('should add padding class names when `paddingSize` of $size is used', ({ size, className }) => { + renderProps.paddingSize = size; + render(); - it.todo('should add padding class names when `paddingSize` prop is defined'); + expect(renderResult.getByTestId('test')).toHaveClass(className); + }); }); diff --git a/x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx b/x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx index 2d3a9c9cb7f07..59e5286167bc5 100644 --- a/x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx +++ b/x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx @@ -77,9 +77,9 @@ const OverlayRootContainer = styled.div` `; const PAGE_OVERLAY_CSS_CLASSNAME = 'securitySolution-pageOverlay'; -const PAGE_OVERLAY_DOCUMENT_BODY_IS_VISIBLE_CLASSNAME = `${PAGE_OVERLAY_CSS_CLASSNAME}-isVisible`; -const PAGE_OVERLAY_DOCUMENT_BODY_LOCK_CLASSNAME = `${PAGE_OVERLAY_CSS_CLASSNAME}-lock`; -const PAGE_OVERLAY_DOCUMENT_BODY_FULLSCREEN_CLASSNAME = `${PAGE_OVERLAY_CSS_CLASSNAME}-fullScreen`; +export const PAGE_OVERLAY_DOCUMENT_BODY_IS_VISIBLE_CLASSNAME = `${PAGE_OVERLAY_CSS_CLASSNAME}-isVisible`; +export const PAGE_OVERLAY_DOCUMENT_BODY_LOCK_CLASSNAME = `${PAGE_OVERLAY_CSS_CLASSNAME}-lock`; +export const PAGE_OVERLAY_DOCUMENT_BODY_FULLSCREEN_CLASSNAME = `${PAGE_OVERLAY_CSS_CLASSNAME}-fullScreen`; const PageOverlayGlobalStyles = createGlobalStyle<{ theme: EuiTheme }>` body.${PAGE_OVERLAY_DOCUMENT_BODY_LOCK_CLASSNAME} { @@ -154,7 +154,7 @@ export interface PageOverlayProps { isHidden?: boolean; /** - * Setting this to `true` (defualt) will enable scrolling inside of the overlay + * Setting this to `true` (default) will enable scrolling inside of the overlay */ enableScrolling?: boolean; @@ -194,7 +194,8 @@ export interface PageOverlayProps { /** * A generic component for taking over the entire Kibana UI main content area (everything below the - * top header that includes the breadcrumbs). + * top header that includes the breadcrumbs). This component adds nothing more than a blank page - its up + * to the `children` pass to actually display any type of intractable UI for the user. */ export const PageOverlay = memo<PageOverlayProps>( ({ diff --git a/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.test.tsx b/x-pack/plugins/security_solution/public/management/components/policy_response/integration_tests/policy_response_wrapper.test.tsx similarity index 93% rename from x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.test.tsx rename to x-pack/plugins/security_solution/public/management/components/policy_response/integration_tests/policy_response_wrapper.test.tsx index 3c6d4f66d59cb..f23e3bb005fba 100644 --- a/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/policy_response/integration_tests/policy_response_wrapper.test.tsx @@ -7,28 +7,26 @@ import React from 'react'; import userEvent from '@testing-library/user-event'; -import type { AppContextTestRender } from '../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; -import type { PolicyResponseWrapperProps } from './policy_response_wrapper'; -import { PolicyResponseWrapper } from './policy_response_wrapper'; -import { HostPolicyResponseActionStatus } from '../../../../common/search_strategy'; -import { useGetEndpointPolicyResponse } from '../../hooks/endpoint/use_get_endpoint_policy_response'; +import type { AppContextTestRender } from '../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { PolicyResponseWrapperProps } from '../policy_response_wrapper'; +import { PolicyResponseWrapper } from '../policy_response_wrapper'; +import { HostPolicyResponseActionStatus } from '../../../../../common/search_strategy'; +import { useGetEndpointPolicyResponse } from '../../../hooks/endpoint/use_get_endpoint_policy_response'; import type { HostPolicyResponse, HostPolicyResponseAppliedAction, -} from '../../../../common/endpoint/types'; -import { EndpointDocGenerator } from '../../../../common/endpoint/generate_data'; -import { useGetEndpointDetails } from '../../hooks'; +} from '../../../../../common/endpoint/types'; +import { EndpointDocGenerator } from '../../../../../common/endpoint/generate_data'; +import { useGetEndpointDetails } from '../../../hooks'; import { descriptions, LINUX_DEADLOCK_MESSAGE, policyResponseTitles, -} from './policy_response_friendly_names'; +} from '../policy_response_friendly_names'; -jest.setTimeout(10000); - -jest.mock('../../hooks/endpoint/use_get_endpoint_policy_response'); -jest.mock('../../hooks/endpoint/use_get_endpoint_details'); +jest.mock('../../../hooks/endpoint/use_get_endpoint_policy_response'); +jest.mock('../../../hooks/endpoint/use_get_endpoint_details'); describe('when on the policy response', () => { const docGenerator = new EndpointDocGenerator(); diff --git a/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.test.tsx b/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.test.tsx new file mode 100644 index 0000000000000..83f314c0d9857 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.test.tsx @@ -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 type { AppContextTestRender } from '../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; +import type { + ActionDetails, + ResponseActionGetFileOutputContent, + ResponseActionGetFileParameters, +} from '../../../../common/endpoint/types'; +import React from 'react'; +import type { ResponseActionFileDownloadLinkProps } from './response_action_file_download_link'; +import { EndpointActionGenerator } from '../../../../common/endpoint/data_generators/endpoint_action_generator'; +import { + FILE_NO_LONGER_AVAILABLE_MESSAGE, + ResponseActionFileDownloadLink, +} from './response_action_file_download_link'; +import { responseActionsHttpMocks } from '../../mocks/response_actions_http_mocks'; +import { useUserPrivileges as _useUserPrivileges } from '../../../common/components/user_privileges'; +import { getDeferred } from '../../mocks/utils'; +import { waitFor } from '@testing-library/react'; +import type { IHttpFetchError } from '@kbn/core-http-browser'; + +jest.mock('../../../common/components/user_privileges'); + +describe('When using the `ResponseActionFileDownloadLink` component', () => { + const useUserPrivilegesMock = _useUserPrivileges as jest.Mock< + ReturnType<typeof _useUserPrivileges> + >; + + let render: () => ReturnType<AppContextTestRender['render']>; + let renderResult: ReturnType<AppContextTestRender['render']>; + let renderProps: ResponseActionFileDownloadLinkProps; + let apiMocks: ReturnType<typeof responseActionsHttpMocks>; + + beforeEach(() => { + const appTestContext = createAppRootMockRenderer(); + + apiMocks = responseActionsHttpMocks(appTestContext.coreStart.http); + + renderProps = { + action: new EndpointActionGenerator('seed').generateActionDetails< + ResponseActionGetFileOutputContent, + ResponseActionGetFileParameters + >({ command: 'get-file' }), + 'data-test-subj': 'test', + }; + + render = () => { + renderResult = appTestContext.render(<ResponseActionFileDownloadLink {...renderProps} />); + return renderResult; + }; + }); + + it('should show download button if file is available', async () => { + render(); + await waitFor(() => { + expect(apiMocks.responseProvider.fileInfo).toHaveBeenCalled(); + }); + + expect(renderResult.getByTestId('test-downloadButton')).not.toBeNull(); + expect(renderResult.getByTestId('test-passcodeMessage')).toHaveTextContent( + '(ZIP file passcode: elastic)' + ); + }); + + it('should display custom button label', async () => { + renderProps.buttonTitle = 'hello'; + render(); + await waitFor(() => { + expect(apiMocks.responseProvider.fileInfo).toHaveBeenCalled(); + }); + + expect(renderResult.getByTestId('test-downloadButton')).toHaveTextContent('hello'); + }); + + it('should show loading indicator while calling file info api', async () => { + const deferred = getDeferred(); + + apiMocks.responseProvider.fileInfo.mockDelay.mockReturnValue(deferred.promise); + (renderProps.action as ActionDetails).completedAt = '2021-04-15T16:08:47.449Z'; + + render(); + + expect(renderResult.getByTestId('test-loading')).not.toBeNull(); + + // Release the `file info` api + deferred.resolve(); + + await waitFor(() => { + expect(apiMocks.responseProvider.fileInfo).toHaveBeenCalledWith({ + path: '/api/endpoint/action/123/agent-a/file', + }); + }); + + expect(renderResult.getByTestId('test-downloadButton')).not.toBeNull(); + }); + + it('should show file no longer available message if status is DELETED', async () => { + const fileInfoApiResponseMock = apiMocks.responseProvider.fileInfo(); + + fileInfoApiResponseMock.data.status = 'DELETED'; + apiMocks.responseProvider.fileInfo.mockReturnValue(fileInfoApiResponseMock); + + (renderProps.action as ActionDetails).completedAt = '2021-04-15T16:08:47.449Z'; + + render(); + + await waitFor(() => { + expect(renderResult.getByTestId('test-fileNoLongerAvailable')).toHaveTextContent( + FILE_NO_LONGER_AVAILABLE_MESSAGE + ); + }); + }); + + it('should show file no longer available message if file info api returns 404', async () => { + const error = { message: 'not found', response: { status: 404 } } as IHttpFetchError; + + (renderProps.action as ActionDetails).completedAt = '2021-04-15T16:08:47.449Z'; + apiMocks.responseProvider.fileInfo.mockImplementation(() => { + throw error; + }); + + render(); + + await waitFor(() => { + expect(renderResult.getByTestId('test-fileNoLongerAvailable')).toHaveTextContent( + FILE_NO_LONGER_AVAILABLE_MESSAGE + ); + }); + }); + + it('should show file info API error if one was encountered', async () => { + const error = { message: 'server error', response: { status: 500 } } as IHttpFetchError; + + (renderProps.action as ActionDetails).completedAt = '2021-04-15T16:08:47.449Z'; + apiMocks.responseProvider.fileInfo.mockImplementation(() => { + throw error; + }); + + render(); + + await waitFor(() => { + expect(renderResult.getByTestId('test-apiError')).toHaveTextContent('server error'); + }); + }); + + it('should show nothing if user does not have authz', () => { + const privileges = useUserPrivilegesMock(); + + useUserPrivilegesMock.mockImplementationOnce(() => { + return { + ...privileges, + endpointPrivileges: { + ...privileges.endpointPrivileges, + canWriteFileOperations: false, + }, + }; + }); + + render(); + + expect(apiMocks.responseProvider.fileInfo).not.toHaveBeenCalled(); + expect(renderResult.container.children.length).toBe(0); + }); + + it('should show nothing if action is not complete', () => { + const action = renderProps.action as ActionDetails; + action.completedAt = undefined; + action.isCompleted = false; + + render(); + + expect(apiMocks.responseProvider.fileInfo).not.toHaveBeenCalled(); + expect(renderResult.container.children.length).toBe(0); + }); + + it('should show nothing if action was not successful', () => { + const action = renderProps.action as ActionDetails; + action.wasSuccessful = false; + + render(); + + expect(apiMocks.responseProvider.fileInfo).not.toHaveBeenCalled(); + expect(renderResult.container.children.length).toBe(0); + }); +}); diff --git a/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx b/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx index 6c01b2284e997..66b12604a160d 100644 --- a/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx +++ b/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx @@ -5,16 +5,24 @@ * 2.0. */ -import type { CSSProperties } from 'react'; -import React, { memo } from 'react'; -import { EuiButtonEmpty, EuiText } from '@elastic/eui'; +import React, { memo, useMemo, type CSSProperties } from 'react'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiButtonEmpty, + EuiLoadingContent, + EuiText, +} from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; +import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; +import { FormattedError } from '../formatted_error'; +import { useGetFileInfo } from '../../hooks/response_actions/use_get_file_info'; import { useUserPrivileges } from '../../../common/components/user_privileges'; import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; import type { MaybeImmutable } from '../../../../common/endpoint/types'; -import { getHostActionFileDownloadUrl } from '../../services/response_actions/get_host_action_file_download_url'; import type { ActionDetails } from '../../../../common/endpoint/types/actions'; +import { ACTION_AGENT_FILE_DOWNLOAD_ROUTE } from '../../../../common/endpoint/constants'; const STYLE_INHERIT_FONT_FAMILY = Object.freeze<CSSProperties>({ fontFamily: 'inherit', @@ -25,10 +33,18 @@ const DEFAULT_BUTTON_TITLE = i18n.translate( { defaultMessage: 'Click here to download' } ); +export const FILE_NO_LONGER_AVAILABLE_MESSAGE = i18n.translate( + 'xpack.securitySolution.responseActionFileDownloadLink.fileNoLongerAvailable', + { defaultMessage: 'File has expired and is no longer available for download.' } +); + export interface ResponseActionFileDownloadLinkProps { action: MaybeImmutable<ActionDetails>; + /** If left undefined, the first agent that the action was sent to will be used */ + agentId?: string; buttonTitle?: string; 'data-test-subj'?: string; + textSize?: 's' | 'xs'; } /** @@ -38,40 +54,81 @@ export interface ResponseActionFileDownloadLinkProps { * NOTE: Currently displays only the link for the first host in the Action */ export const ResponseActionFileDownloadLink = memo<ResponseActionFileDownloadLinkProps>( - ({ action, buttonTitle = DEFAULT_BUTTON_TITLE, 'data-test-subj': dataTestSubj }) => { + ({ + action, + agentId, + buttonTitle = DEFAULT_BUTTON_TITLE, + 'data-test-subj': dataTestSubj, + textSize = 's', + }) => { const getTestId = useTestIdGenerator(dataTestSubj); const { canWriteFileOperations } = useUserPrivileges().endpointPrivileges; - if (!canWriteFileOperations) { + const shouldFetchFileInfo: boolean = useMemo(() => { + return action.isCompleted && action.wasSuccessful; + }, [action.isCompleted, action.wasSuccessful]); + + const downloadUrl: string = useMemo(() => { + return resolvePathVariables(ACTION_AGENT_FILE_DOWNLOAD_ROUTE, { + action_id: action.id, + agent_id: agentId ?? action.agents[0], + }); + }, [action.agents, action.id, agentId]); + + const { + isFetching, + data: fileInfo, + error, + } = useGetFileInfo(action, undefined, { + enabled: canWriteFileOperations && shouldFetchFileInfo, + }); + + if (!canWriteFileOperations || !action.isCompleted || !action.wasSuccessful) { return null; } - return ( - <> - <EuiButtonEmpty - href={getHostActionFileDownloadUrl(action)} - iconType="download" - data-test-subj={getTestId('downloadButton')} - flush="left" - style={STYLE_INHERIT_FONT_FAMILY} - download - > - <EuiText size="s">{buttonTitle}</EuiText> - </EuiButtonEmpty> - <EuiText - size="s" - className="eui-displayInline" - data-test-subj={getTestId('passcodeMessage')} - > - <FormattedMessage - id="xpack.securitySolution.responseActionFileDownloadLink.passcodeInfo" - defaultMessage="(ZIP file passcode: {passcode})" - values={{ - passcode: 'elastic', - }} - /> + if (isFetching) { + return <EuiLoadingContent lines={1} data-test-subj={getTestId('loading')} />; + } + + // Check if file is no longer available + if ((error && error?.response?.status === 404) || fileInfo?.data.status === 'DELETED') { + return ( + <EuiText size={textSize} data-test-subj={getTestId('fileNoLongerAvailable')}> + {FILE_NO_LONGER_AVAILABLE_MESSAGE} </EuiText> - </> + ); + } else if (error) { + return <FormattedError error={error} data-test-subj={getTestId('apiError')} />; + } + + return ( + <EuiFlexGroup alignItems="center" gutterSize="none" data-test-subj={dataTestSubj}> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + href={downloadUrl} + iconType="download" + data-test-subj={getTestId('downloadButton')} + flush="left" + style={STYLE_INHERIT_FONT_FAMILY} + download + size={textSize} + > + <EuiText size={textSize}>{buttonTitle}</EuiText> + </EuiButtonEmpty> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText size={textSize} data-test-subj={getTestId('passcodeMessage')}> + <FormattedMessage + id="xpack.securitySolution.responseActionFileDownloadLink.passcodeInfo" + defaultMessage="(ZIP file passcode: {passcode})" + values={{ + passcode: 'elastic', + }} + /> + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> ); } ); diff --git a/x-pack/plugins/security_solution/public/management/hooks/index.ts b/x-pack/plugins/security_solution/public/management/hooks/index.ts index cf4e99180f0ca..b439bcffb8874 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/index.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/index.ts @@ -6,5 +6,5 @@ */ export { useGetEndpointDetails } from './endpoint/use_get_endpoint_details'; -export { useWithShowEndpointResponder } from './endpoint/use_with_show_endpoint_responder'; -export { useGetEndpointActionList } from './endpoint/use_get_endpoint_action_list'; +export { useWithShowEndpointResponder } from './use_with_show_endpoint_responder'; +export { useGetEndpointActionList } from './response_actions/use_get_endpoint_action_list'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.test.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.test.ts new file mode 100644 index 0000000000000..bef446eca27b3 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.test.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 type { AppContextTestRender, ReactQueryHookRenderer } from '../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; +import { responseActionsHttpMocks } from '../../mocks/response_actions_http_mocks'; +import { useGetFileInfo } from './use_get_file_info'; +import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; +import { ACTION_AGENT_FILE_INFO_ROUTE } from '../../../../common/endpoint/constants'; +import type { + ActionDetails, + ResponseActionGetFileOutputContent, + ResponseActionGetFileParameters, +} from '../../../../common/endpoint/types'; +import { EndpointActionGenerator } from '../../../../common/endpoint/data_generators/endpoint_action_generator'; +import { useQuery as _useQuery } from '@tanstack/react-query'; + +const useQueryMock = _useQuery as jest.Mock; + +jest.mock('@tanstack/react-query', () => { + const actualReactQueryModule = jest.requireActual('@tanstack/react-query'); + + return { + ...actualReactQueryModule, + useQuery: jest.fn((...args) => actualReactQueryModule.useQuery(...args)), + }; +}); + +describe('When using the `useGetFileInfo()` hook', () => { + let renderReactQueryHook: ReactQueryHookRenderer< + Parameters<typeof useGetFileInfo>, + ReturnType<typeof useGetFileInfo> + >; + let http: AppContextTestRender['coreStart']['http']; + let apiMocks: ReturnType<typeof responseActionsHttpMocks>; + let actionDetailsMock: ActionDetails; + + beforeEach(() => { + const testContext = createAppRootMockRenderer(); + + renderReactQueryHook = testContext.renderReactQueryHook as typeof renderReactQueryHook; + http = testContext.coreStart.http; + + apiMocks = responseActionsHttpMocks(http); + + actionDetailsMock = new EndpointActionGenerator('seed').generateActionDetails< + ResponseActionGetFileOutputContent, + ResponseActionGetFileParameters + >({ + command: 'get-file', + }); + }); + + it('should call the correct API', async () => { + await renderReactQueryHook(() => useGetFileInfo(actionDetailsMock)); + + expect(apiMocks.responseProvider.fileInfo).toHaveBeenCalledWith({ + path: resolvePathVariables(ACTION_AGENT_FILE_INFO_ROUTE, { + action_id: '123', + agent_id: 'agent-a', + }), + }); + }); + + it('should allow specific agent id to be set on input', async () => { + await renderReactQueryHook(() => useGetFileInfo(actionDetailsMock, 'abc')); + + expect(apiMocks.responseProvider.fileInfo).toHaveBeenCalledWith({ + path: resolvePathVariables(ACTION_AGENT_FILE_INFO_ROUTE, { + action_id: '123', + agent_id: 'abc', + }), + }); + }); + + it('should allow custom options ot be used', async () => { + await renderReactQueryHook(() => + useGetFileInfo(actionDetailsMock, undefined, { + queryKey: ['a', 'b'], + enabled: true, + retry: false, + }) + ); + + expect(useQueryMock).toHaveBeenCalledWith( + expect.objectContaining({ + queryKey: ['a', 'b'], + enabled: true, + retry: false, + }) + ); + }); +}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.ts new file mode 100644 index 0000000000000..c4c2905bfd1f8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.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 type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import type { IHttpFetchError } from '@kbn/core-http-browser'; +import { useQuery } from '@tanstack/react-query'; +import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; +import { useHttp } from '../../../common/lib/kibana/hooks'; +import type { + ActionDetails, + ActionFileInfoApiResponse, + MaybeImmutable, +} from '../../../../common/endpoint/types'; +import { ACTION_AGENT_FILE_INFO_ROUTE } from '../../../../common/endpoint/constants'; + +/** + * Retrieves information about a file that was uploaded by the endpoint as a result of a `get-file` action + * @param action + * @param [agentId] If left undefined, the first agent that the action was sent to will be used + * @param [options] + */ +export const useGetFileInfo = ( + action: MaybeImmutable<ActionDetails>, + agentId?: string, + options: UseQueryOptions<ActionFileInfoApiResponse, IHttpFetchError> = {} +): UseQueryResult<ActionFileInfoApiResponse, IHttpFetchError> => { + const http = useHttp(); + + return useQuery<ActionFileInfoApiResponse, IHttpFetchError>({ + queryKey: ['get-action-file-info', action.id, agentId ?? action.agents[0]], + ...options, + queryFn: () => { + const apiUrl = resolvePathVariables(ACTION_AGENT_FILE_INFO_ROUTE, { + action_id: action.id, + agent_id: agentId ?? action.agents[0], + }); + + return http.get<ActionFileInfoApiResponse>(apiUrl); + }, + }); +}; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_endpoint_processes_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_endpoint_processes_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_file_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_file_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_file_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_file_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_isolate_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_isolate_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_kill_process_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_kill_process_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_release_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_release_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_suspend_process_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_suspend_process_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_with_show_endpoint_responder.tsx b/x-pack/plugins/security_solution/public/management/hooks/use_with_show_endpoint_responder.tsx similarity index 80% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_with_show_endpoint_responder.tsx rename to x-pack/plugins/security_solution/public/management/hooks/use_with_show_endpoint_responder.tsx index 3ad37c76c7ffc..bfd6749608603 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_with_show_endpoint_responder.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/use_with_show_endpoint_responder.tsx @@ -7,15 +7,15 @@ import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { useUserPrivileges } from '../../../common/components/user_privileges'; +import { useUserPrivileges } from '../../common/components/user_privileges'; import { ActionLogButton, - getEndpointResponseActionsConsoleCommands, -} from '../../components/endpoint_responder'; -import { useConsoleManager } from '../../components/console'; -import type { HostMetadata } from '../../../../common/endpoint/types'; -import { HeaderEndpointInfo } from '../../components/endpoint_responder/header_endpoint_info'; -import { OfflineCallout } from '../../components/endpoint_responder/offline_callout'; + getEndpointConsoleCommands, + HeaderEndpointInfo, + OfflineCallout, +} from '../components/endpoint_responder'; +import { useConsoleManager } from '../components/console'; +import type { HostMetadata } from '../../../common/endpoint/types'; type ShowEndpointResponseActionsConsole = (endpointMetadata: HostMetadata) => void; @@ -48,7 +48,7 @@ export const useWithShowEndpointResponder = (): ShowEndpointResponseActionsConso endpoint: endpointMetadata, }, consoleProps: { - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId, endpointCapabilities: endpointMetadata.Endpoint.capabilities ?? [], endpointPrivileges, diff --git a/x-pack/plugins/security_solution/public/management/links.ts b/x-pack/plugins/security_solution/public/management/links.ts index 0eaa0202bd0d1..22ad1a374a11b 100644 --- a/x-pack/plugins/security_solution/public/management/links.ts +++ b/x-pack/plugins/security_solution/public/management/links.ts @@ -244,7 +244,7 @@ export const getManagementFilteredLinks = async ( plugins: StartPlugins ): Promise<LinkItem> => { const fleetAuthz = plugins.fleet?.authz; - const isEndpointRbacEnabled = ExperimentalFeaturesService.get().endpointRbacEnabled; + const { endpointRbacEnabled, endpointRbacV1Enabled } = ExperimentalFeaturesService.get(); const endpointPermissions = calculatePermissionsFromCapabilities(core.application.capabilities); const linksToExclude: SecurityPageName[] = []; @@ -255,7 +255,7 @@ export const getManagementFilteredLinks = async ( licenseService, fleetAuthz, currentUserResponse.roles, - isEndpointRbacEnabled, + endpointRbacEnabled || endpointRbacV1Enabled, endpointPermissions ) : getEndpointAuthzInitialState(); diff --git a/x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts b/x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts index bc23427631fb9..52aa80b35586b 100644 --- a/x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts +++ b/x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts @@ -17,6 +17,7 @@ import { KILL_PROCESS_ROUTE, SUSPEND_PROCESS_ROUTE, GET_FILE_ROUTE, + ACTION_AGENT_FILE_INFO_ROUTE, } from '../../../common/endpoint/constants'; import type { ResponseProvidersInterface } from '../../common/mock/endpoint/http_handler_mock_factory'; import { httpHandlerMockFactory } from '../../common/mock/endpoint/http_handler_mock_factory'; @@ -29,6 +30,7 @@ import type { GetProcessesActionOutputContent, ResponseActionGetFileOutputContent, ResponseActionGetFileParameters, + ActionFileInfoApiResponse, } from '../../../common/endpoint/types'; export type ResponseActionsHttpMocksInterface = ResponseProvidersInterface<{ @@ -49,6 +51,8 @@ export type ResponseActionsHttpMocksInterface = ResponseProvidersInterface<{ processes: () => ActionDetailsApiResponse<GetProcessesActionOutputContent>; getFile: () => ActionDetailsApiResponse<ResponseActionGetFileOutputContent>; + + fileInfo: () => ActionFileInfoApiResponse; }>; export const responseActionsHttpMocks = httpHandlerMockFactory<ResponseActionsHttpMocksInterface>([ @@ -175,4 +179,21 @@ export const responseActionsHttpMocks = httpHandlerMockFactory<ResponseActionsHt return { data: response }; }, }, + { + id: 'fileInfo', + path: ACTION_AGENT_FILE_INFO_ROUTE, + method: 'get', + handler: (): ActionFileInfoApiResponse => { + return { + data: { + created: '2022-10-10T14:57:30.682Z', + id: '123', + mimeType: 'text/plain', + name: 'test.txt', + size: 1234, + status: 'READY', + }, + }; + }, + }, ]); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_generic_errors_list.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_generic_errors_list.tsx index cac9c2a7d0c2c..babb4c78af147 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_generic_errors_list.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_generic_errors_list.tsx @@ -23,11 +23,10 @@ export const EndpointGenericErrorsList = memo<PackageGenericErrorsListProps>( const globalEndpointErrors = useMemo(() => { const errors: PackageActionFormatter[] = []; packageErrors.forEach((unit) => { - if (unit.payload && unit.payload.error) { + if (unit.status === 'failed') { errors.push( new PackageActionFormatter( - unit.payload.error.code, - unit.payload.error.message, + unit, docLinks.links.securitySolution.packageActionTroubleshooting ) ); diff --git a/x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx b/x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx index d42585485bb94..a0b3b9050b7ab 100644 --- a/x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx @@ -27,8 +27,10 @@ let mockUseGetEndpointActionList: { data?: ActionListApiResponse; refetch: () => unknown; }; -jest.mock('../../../hooks/endpoint/use_get_endpoint_action_list', () => { - const original = jest.requireActual('../../../hooks/endpoint/use_get_endpoint_action_list'); +jest.mock('../../../hooks/response_actions/use_get_endpoint_action_list', () => { + const original = jest.requireActual( + '../../../hooks/response_actions/use_get_endpoint_action_list' + ); return { ...original, useGetEndpointActionList: () => mockUseGetEndpointActionList, diff --git a/x-pack/plugins/security_solution/public/management/services/response_actions/get_host_action_file_download_url.ts b/x-pack/plugins/security_solution/public/management/services/response_actions/get_host_action_file_download_url.ts deleted file mode 100644 index 5061c6cd36457..0000000000000 --- a/x-pack/plugins/security_solution/public/management/services/response_actions/get_host_action_file_download_url.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; -import { ACTION_AGENT_FILE_DOWNLOAD_ROUTE } from '../../../../common/endpoint/constants'; -import type { ActionDetails, MaybeImmutable } from '../../../../common/endpoint/types'; - -/** - * get the download URL for a `get-file` action - * @param action - * @param agentId - */ -export const getHostActionFileDownloadUrl = ( - action: MaybeImmutable<ActionDetails>, - agentId?: string -): string => { - return resolvePathVariables(ACTION_AGENT_FILE_DOWNLOAD_ROUTE, { - action_id: action.id, - agent_id: agentId ?? action.agents[0], - }); -}; diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/__mocks__/mock.ts b/x-pack/plugins/security_solution/public/network/components/embeddables/__mocks__/mock.ts index abcaa079d3b20..e63fff5009152 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/__mocks__/mock.ts +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/__mocks__/mock.ts @@ -18,6 +18,14 @@ export const mockAPMIndexPatternIds: IndexPatternMapping[] = [ { title: 'traces-apm*,logs-apm*,metrics-apm*,apm-*', id: '8c7323ac-97ad-4b53-ac0a-40f8f691a918' }, ]; +export const mockLayerGroup = { + id: 'uuid.v4()', + label: 'filebeat-*', + sourceDescriptor: null, + type: LAYER_TYPE.LAYER_GROUP, + visible: true, +}; + export const mockSourceLayer = { sourceDescriptor: { id: 'uuid.v4()', @@ -64,6 +72,7 @@ export const mockSourceLayer = { }, }, id: 'uuid.v4()', + parent: 'uuid.v4()', label: `filebeat-* | Source Point`, minZoom: 0, maxZoom: 24, @@ -121,6 +130,7 @@ export const mockDestinationLayer = { }, }, id: 'uuid.v4()', + parent: 'uuid.v4()', label: `filebeat-* | Destination Point`, minZoom: 0, maxZoom: 24, @@ -176,6 +186,7 @@ export const mockClientLayer = { }, }, id: 'uuid.v4()', + parent: 'uuid.v4()', label: `apm-* | Client Point`, minZoom: 0, maxZoom: 24, @@ -238,6 +249,7 @@ export const mockServerLayer = { }, }, id: 'uuid.v4()', + parent: 'uuid.v4()', label: `apm-* | Server Point`, minZoom: 0, maxZoom: 24, @@ -307,6 +319,7 @@ export const mockLineLayer = { }, }, id: 'uuid.v4()', + parent: 'uuid.v4()', label: `filebeat-* | Line`, minZoom: 0, maxZoom: 24, @@ -371,6 +384,7 @@ export const mockClientServerLineLayer = { }, }, id: 'uuid.v4()', + parent: 'uuid.v4()', label: `apm-* | Line`, minZoom: 0, maxZoom: 24, @@ -399,6 +413,7 @@ export const mockLayerList = [ mockLineLayer, mockDestinationLayer, mockSourceLayer, + mockLayerGroup, ]; export const mockLayerListDouble = [ @@ -416,9 +431,11 @@ export const mockLayerListDouble = [ mockLineLayer, mockDestinationLayer, mockSourceLayer, + mockLayerGroup, mockLineLayer, mockDestinationLayer, mockSourceLayer, + mockLayerGroup, ]; export const mockLayerListMixed = [ @@ -436,12 +453,21 @@ export const mockLayerListMixed = [ mockLineLayer, mockDestinationLayer, mockSourceLayer, + mockLayerGroup, mockClientServerLineLayer, mockServerLayer, mockClientLayer, + { + ...mockLayerGroup, + label: 'apm-*', + }, mockApmDataStreamClientServerLineLayer, mockApmDataStreamServerLayer, mockApmDataStreamClientLayer, + { + ...mockLayerGroup, + label: 'traces-apm*,logs-apm*,metrics-apm*,apm-*', + }, ]; export const mockAPMIndexPattern: IndexPatternSavedObject = { diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/map_config.test.ts b/x-pack/plugins/security_solution/public/network/components/embeddables/map_config.test.ts index f122d0a93ce90..d476840e91063 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/map_config.test.ts +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/map_config.test.ts @@ -15,6 +15,7 @@ import { mockLayerList, mockLayerListDouble, mockLayerListMixed, + mockLayerGroup, mockLineLayer, mockServerLayer, mockSourceLayer, @@ -50,6 +51,7 @@ describe('map_config', () => { const layerList = getSourceLayer( mockIndexPatternIds[0].title, mockIndexPatternIds[0].id, + mockLayerGroup.id, lmc.default.source ); expect(layerList).toStrictEqual(mockSourceLayer); @@ -59,6 +61,7 @@ describe('map_config', () => { const layerList = getSourceLayer( mockAPMIndexPatternIds[0].title, mockAPMIndexPatternIds[0].id, + mockLayerGroup.id, lmc[mockAPMIndexPatternIds[0].title].source ); expect(layerList).toStrictEqual(mockClientLayer); @@ -70,6 +73,7 @@ describe('map_config', () => { const layerList = getDestinationLayer( mockIndexPatternIds[0].title, mockIndexPatternIds[0].id, + mockLayerGroup.id, lmc.default.destination ); expect(layerList).toStrictEqual(mockDestinationLayer); @@ -79,6 +83,7 @@ describe('map_config', () => { const layerList = getDestinationLayer( mockAPMIndexPatternIds[0].title, mockAPMIndexPatternIds[0].id, + mockLayerGroup.id, lmc[mockAPMIndexPatternIds[0].title].destination ); expect(layerList).toStrictEqual(mockServerLayer); @@ -90,6 +95,7 @@ describe('map_config', () => { const layerList = getLineLayer( mockIndexPatternIds[0].title, mockIndexPatternIds[0].id, + mockLayerGroup.id, lmc.default ); expect(layerList).toStrictEqual(mockLineLayer); @@ -99,6 +105,7 @@ describe('map_config', () => { const layerList = getLineLayer( mockAPMIndexPatternIds[0].title, mockAPMIndexPatternIds[0].id, + mockLayerGroup.id, lmc[mockAPMIndexPatternIds[0].title] ); expect(layerList).toStrictEqual(mockClientServerLineLayer); diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/map_config.ts b/x-pack/plugins/security_solution/public/network/components/embeddables/map_config.ts index 0a0e926840035..701631d585169 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/map_config.ts +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/map_config.ts @@ -117,11 +117,29 @@ export const getLayerList = (indexPatternIds: IndexPatternMapping[]) => { type: LAYER_TYPE.EMS_VECTOR_TILE, }, ...indexPatternIds.reduce((acc: object[], { title, id }) => { + const layerGroupDescriptor = { + id: uuid.v4(), + label: title, + sourceDescriptor: null, + type: LAYER_TYPE.LAYER_GROUP, + visible: true, + }; return [ ...acc, - getLineLayer(title, id, lmc[title] ?? lmc.default), - getDestinationLayer(title, id, lmc[title]?.destination ?? lmc.default.destination), - getSourceLayer(title, id, lmc[title]?.source ?? lmc.default.source), + getLineLayer(title, id, layerGroupDescriptor.id, lmc[title] ?? lmc.default), + getDestinationLayer( + title, + id, + layerGroupDescriptor.id, + lmc[title]?.destination ?? lmc.default.destination + ), + getSourceLayer( + title, + id, + layerGroupDescriptor.id, + lmc[title]?.source ?? lmc.default.source + ), + layerGroupDescriptor, ]; }, []), ]; @@ -133,11 +151,13 @@ export const getLayerList = (indexPatternIds: IndexPatternMapping[]) => { * * @param indexPatternTitle used as layer name in LayerToC UI: "${indexPatternTitle} | Source point" * @param indexPatternId used as layer's indexPattern to query for data + * @param parentId * @param layerDetails layer-specific field details */ export const getSourceLayer = ( indexPatternTitle: string, indexPatternId: string, + parentId: string, layerDetails: LayerMappingDetails ) => ({ sourceDescriptor: { @@ -179,6 +199,7 @@ export const getSourceLayer = ( }, }, id: uuid.v4(), + parent: parentId, label: `${indexPatternTitle} | ${layerDetails.label}`, minZoom: 0, maxZoom: 24, @@ -195,12 +216,14 @@ export const getSourceLayer = ( * * @param indexPatternTitle used as layer name in LayerToC UI: "${indexPatternTitle} | Destination point" * @param indexPatternId used as layer's indexPattern to query for data + * @param parentId used as layer's indexPattern to query for data * @param layerDetails layer-specific field details * */ export const getDestinationLayer = ( indexPatternTitle: string, indexPatternId: string, + parentId: string, layerDetails: LayerMappingDetails ) => ({ sourceDescriptor: { @@ -243,6 +266,7 @@ export const getDestinationLayer = ( }, }, id: uuid.v4(), + parent: parentId, label: `${indexPatternTitle} | ${layerDetails.label}`, minZoom: 0, maxZoom: 24, @@ -258,11 +282,13 @@ export const getDestinationLayer = ( * * @param indexPatternTitle used as layer name in LayerToC UI: "${indexPatternTitle} | Line" * @param indexPatternId used as layer's indexPattern to query for data + * @param parentId * @param layerDetails layer-specific field details */ export const getLineLayer = ( indexPatternTitle: string, indexPatternId: string, + parentId: string, layerDetails: LayerMapping ) => ({ sourceDescriptor: { @@ -327,6 +353,7 @@ export const getLineLayer = ( }, }, id: uuid.v4(), + parent: parentId, label: `${indexPatternTitle} | ${i18n.LINE_LAYER}`, minZoom: 0, maxZoom: 24, diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx index d3fcb33ef9ef8..705375d48ec3e 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useMemo } from 'react'; +import { useCallback, useMemo } from 'react'; import { useDispatch } from 'react-redux'; import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; @@ -17,6 +17,7 @@ import { TimelineId, TimelineType } from '../../../../../common/types/timeline'; import { useCreateTimeline } from '../../../../timelines/components/timeline/properties/use_create_timeline'; import { updateProviders } from '../../../../timelines/store/timeline/actions'; import { sourcererSelectors } from '../../../../common/store'; +import type { TimeRange } from '../../../../common/store/inputs/model'; export interface Filter { field: string; @@ -39,25 +40,28 @@ export const useNavigateToTimeline = () => { timelineType: TimelineType.default, }); - const navigateToTimeline = (dataProviders: DataProvider[]) => { - // Reset the current timeline - clearTimeline(); - // Update the timeline's providers to match the current prevalence field query - dispatch( - updateProviders({ - id: TimelineId.active, - providers: dataProviders, - }) - ); - - dispatch( - sourcererActions.setSelectedDataView({ - id: SourcererScopeName.timeline, - selectedDataViewId: defaultDataView.id, - selectedPatterns: [signalIndexName || ''], - }) - ); - }; + const navigateToTimeline = useCallback( + (dataProviders: DataProvider[], timeRange?: TimeRange) => { + // Reset the current timeline + clearTimeline({ timeRange }); + // Update the timeline's providers to match the current prevalence field query + dispatch( + updateProviders({ + id: TimelineId.active, + providers: dataProviders, + }) + ); + + dispatch( + sourcererActions.setSelectedDataView({ + id: SourcererScopeName.timeline, + selectedDataViewId: defaultDataView.id, + selectedPatterns: [signalIndexName || ''], + }) + ); + }, + [clearTimeline, defaultDataView.id, dispatch, signalIndexName] + ); /** * * Open a timeline with the given filters prepopulated. @@ -65,56 +69,30 @@ export const useNavigateToTimeline = () => { * * [[filter1 & filter2] OR [filter3 & filter4]] * + * @param timeRange Defines the timeline time range field and removes the time range lock */ - const openTimelineWithFilters = (filters: Array<[...Filter[]]>) => { - const dataProviders = []; + const openTimelineWithFilters = useCallback( + (filters: Array<[...Filter[]]>, timeRange?: TimeRange) => { + const dataProviders = []; - for (const orFilterGroup of filters) { - const mainFilter = orFilterGroup[0]; + for (const orFilterGroup of filters) { + const mainFilter = orFilterGroup[0]; - if (mainFilter) { - const dataProvider = getDataProvider(mainFilter.field, '', mainFilter.value); + if (mainFilter) { + const dataProvider = getDataProvider(mainFilter.field, '', mainFilter.value); - for (const filter of orFilterGroup.slice(1)) { - dataProvider.and.push(getDataProvider(filter.field, '', filter.value)); + for (const filter of orFilterGroup.slice(1)) { + dataProvider.and.push(getDataProvider(filter.field, '', filter.value)); + } + dataProviders.push(dataProvider); } - dataProviders.push(dataProvider); } - } - navigateToTimeline(dataProviders); - }; - - // TODO: Replace the usage of functions with openTimelineWithFilters - - const openHostInTimeline = ({ hostName, severity }: { hostName: string; severity?: string }) => { - const dataProvider = getDataProvider('host.name', '', hostName); - - if (severity) { - dataProvider.and.push(getDataProvider('kibana.alert.severity', '', severity)); - } - - navigateToTimeline([dataProvider]); - }; - - const openUserInTimeline = ({ userName, severity }: { userName: string; severity?: string }) => { - const dataProvider = getDataProvider('user.name', '', userName); - - if (severity) { - dataProvider.and.push(getDataProvider('kibana.alert.severity', '', severity)); - } - navigateToTimeline([dataProvider]); - }; - - const openRuleInTimeline = (ruleName: string) => { - const dataProvider = getDataProvider('kibana.alert.rule.name', '', ruleName); - - navigateToTimeline([dataProvider]); - }; + navigateToTimeline(dataProviders, timeRange); + }, + [navigateToTimeline] + ); return { openTimelineWithFilters, - openHostInTimeline, - openRuleInTimeline, - openUserInTimeline, }; }; diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.test.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.test.tsx index e4cabce7780b9..cbd4e0c59b224 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.test.tsx @@ -13,6 +13,7 @@ import { TestProviders } from '../../../../common/mock'; import { parsedVulnerableHostsAlertsResult } from './mock_data'; import type { UseHostAlertsItems } from './use_host_alerts_items'; import { HostAlertsTable } from './host_alerts_table'; +import { openAlertsFilter } from '../utils'; const mockGetAppUrl = jest.fn(); jest.mock('../../../../common/lib/kibana/hooks', () => { @@ -25,6 +26,15 @@ jest.mock('../../../../common/lib/kibana/hooks', () => { }; }); +const mockOpenTimelineWithFilters = jest.fn(); +jest.mock('../hooks/use_navigate_to_timeline', () => { + return { + useNavigateToTimeline: () => ({ + openTimelineWithFilters: mockOpenTimelineWithFilters, + }), + }; +}); + type UseHostAlertsItemsReturn = ReturnType<UseHostAlertsItems>; const defaultUseHostAlertsItemsReturn: UseHostAlertsItemsReturn = { items: [], @@ -124,4 +134,42 @@ describe('HostAlertsTable', () => { fireEvent.click(page3); expect(mockSetPage).toHaveBeenCalledWith(2); }); + + it('should open timeline with filters when total alerts is clicked', () => { + mockUseHostAlertsItemsReturn({ items: [parsedVulnerableHostsAlertsResult[0]] }); + const { getByTestId } = renderComponent(); + + fireEvent.click(getByTestId('hostSeverityAlertsTable-totalAlertsLink')); + + expect(mockOpenTimelineWithFilters).toHaveBeenCalledWith([ + [ + { + field: 'host.name', + value: 'Host-342m5gl1g2', + }, + openAlertsFilter, + ], + ]); + }); + + it('should open timeline with filters when critical alert count is clicked', () => { + mockUseHostAlertsItemsReturn({ items: [parsedVulnerableHostsAlertsResult[0]] }); + const { getByTestId } = renderComponent(); + + fireEvent.click(getByTestId('hostSeverityAlertsTable-criticalLink')); + + expect(mockOpenTimelineWithFilters).toHaveBeenCalledWith([ + [ + { + field: 'host.name', + value: 'Host-342m5gl1g2', + }, + openAlertsFilter, + { + field: 'kibana.alert.severity', + value: 'critical', + }, + ], + ]); + }); }); diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx index b5ec1de73fa39..c090277fc1786 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import type { EuiBasicTableColumn } from '@elastic/eui'; import { @@ -28,7 +28,7 @@ import { HostDetailsLink } from '../../../../common/components/links'; import { useQueryToggle } from '../../../../common/containers/query_toggle'; import { useNavigateToTimeline } from '../hooks/use_navigate_to_timeline'; import * as i18n from '../translations'; -import { ITEMS_PER_PAGE, SEVERITY_COLOR } from '../utils'; +import { ITEMS_PER_PAGE, openAlertsFilter, SEVERITY_COLOR } from '../utils'; import type { HostAlertsItem } from './use_host_alerts_items'; import { useHostAlertsItems } from './use_host_alerts_items'; @@ -43,7 +43,24 @@ type GetTableColumns = ( const DETECTION_RESPONSE_HOST_SEVERITY_QUERY_ID = 'vulnerableHostsBySeverityQuery'; export const HostAlertsTable = React.memo(({ signalIndexName }: HostAlertsTableProps) => { - const { openHostInTimeline } = useNavigateToTimeline(); + const { openTimelineWithFilters } = useNavigateToTimeline(); + + const openHostInTimeline = useCallback( + ({ hostName, severity }: { hostName: string; severity?: string }) => { + const hostNameFilter = { field: 'host.name', value: hostName }; + const severityFilter = severity + ? { field: 'kibana.alert.severity', value: severity } + : undefined; + + openTimelineWithFilters( + severityFilter + ? [[hostNameFilter, openAlertsFilter, severityFilter]] + : [[hostNameFilter, openAlertsFilter]] + ); + }, + [openTimelineWithFilters] + ); + const { toggleStatus, setToggleStatus } = useQueryToggle( DETECTION_RESPONSE_HOST_SEVERITY_QUERY_ID ); @@ -118,7 +135,11 @@ const getTableColumns: GetTableColumns = (handleClick) => [ name: i18n.ALERTS_TEXT, 'data-test-subj': 'hostSeverityAlertsTable-totalAlerts', render: (totalAlerts: number, { hostName }) => ( - <EuiLink disabled={totalAlerts === 0} onClick={() => handleClick({ hostName })}> + <EuiLink + data-test-subj="hostSeverityAlertsTable-totalAlertsLink" + disabled={totalAlerts === 0} + onClick={() => handleClick({ hostName })} + > <FormattedCount count={totalAlerts} /> </EuiLink> ), @@ -129,6 +150,7 @@ const getTableColumns: GetTableColumns = (handleClick) => [ render: (count: number, { hostName }) => ( <EuiHealth data-test-subj="hostSeverityAlertsTable-critical" color={SEVERITY_COLOR.critical}> <EuiLink + data-test-subj="hostSeverityAlertsTable-criticalLink" disabled={count === 0} onClick={() => handleClick({ hostName, severity: 'critical' })} > diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.test.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.test.tsx index 0776b69e96b27..fca9b4cd8e479 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.test.tsx @@ -8,13 +8,14 @@ import moment from 'moment'; import React from 'react'; -import { render } from '@testing-library/react'; +import { fireEvent, render } from '@testing-library/react'; import { SecurityPageName } from '../../../../../common/constants'; import { TestProviders } from '../../../../common/mock'; import type { RuleAlertsTableProps } from './rule_alerts_table'; import { RuleAlertsTable } from './rule_alerts_table'; import type { RuleAlertsItem, UseRuleAlertsItems } from './use_rule_alerts_items'; +import { openAlertsFilter } from '../utils'; const mockGetAppUrl = jest.fn(); jest.mock('../../../../common/lib/kibana/hooks', () => { @@ -27,6 +28,15 @@ jest.mock('../../../../common/lib/kibana/hooks', () => { }; }); +const mockOpenTimelineWithFilters = jest.fn(); +jest.mock('../hooks/use_navigate_to_timeline', () => { + return { + useNavigateToTimeline: () => ({ + openTimelineWithFilters: mockOpenTimelineWithFilters, + }), + }; +}); + type UseRuleAlertsItemsReturn = ReturnType<UseRuleAlertsItems>; const defaultUseRuleAlertsItemsReturn: UseRuleAlertsItemsReturn = { items: [], @@ -44,10 +54,11 @@ jest.mock('./use_rule_alerts_items', () => ({ const defaultProps: RuleAlertsTableProps = { signalIndexName: '', }; +const ruleName = 'ruleName'; const items: RuleAlertsItem[] = [ { id: 'ruleId', - name: 'ruleName', + name: ruleName, last_alert_at: moment().subtract(1, 'day').format(), alert_count: 10, severity: 'high', @@ -144,4 +155,25 @@ describe('RuleAlertsTable', () => { expect(result.getByTestId('severityRuleAlertsTable-name')).toHaveAttribute('href', linkUrl); }); + + it('should open timeline with filters when total alerts is clicked', () => { + mockUseRuleAlertsItemsReturn({ items }); + const { getByTestId } = render( + <TestProviders> + <RuleAlertsTable {...defaultProps} /> + </TestProviders> + ); + + fireEvent.click(getByTestId('severityRuleAlertsTable-alertCountLink')); + + expect(mockOpenTimelineWithFilters).toHaveBeenCalledWith([ + [ + { + field: 'kibana.alert.rule.name', + value: ruleName, + }, + openAlertsFilter, + ], + ]); + }); }); diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx index 59a92896ddb85..82ec2837e77b7 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx @@ -22,7 +22,7 @@ import { FormattedRelative } from '@kbn/i18n-react'; import type { Severity } from '@kbn/securitysolution-io-ts-alerting-types'; import { HeaderSection } from '../../../../common/components/header_section'; -import { SEVERITY_COLOR } from '../utils'; +import { openAlertsFilter, SEVERITY_COLOR } from '../utils'; import * as i18n from '../translations'; import type { RuleAlertsItem } from './use_rule_alerts_items'; import { useRuleAlertsItems } from './use_rule_alerts_items'; @@ -90,7 +90,11 @@ export const getTableColumns: GetTableColumns = ({ getAppUrl, navigateTo, openRu name: i18n.RULE_ALERTS_COLUMN_ALERT_COUNT, 'data-test-subj': 'severityRuleAlertsTable-alertCount', render: (alertCount: number, { name }) => ( - <EuiLink disabled={alertCount === 0} onClick={() => openRuleInTimeline(name)}> + <EuiLink + data-test-subj="severityRuleAlertsTable-alertCountLink" + disabled={alertCount === 0} + onClick={() => openRuleInTimeline(name)} + > <FormattedCount count={alertCount} /> </EuiLink> ), @@ -114,7 +118,16 @@ export const RuleAlertsTable = React.memo<RuleAlertsTableProps>(({ signalIndexNa skip: !toggleStatus, }); - const { openRuleInTimeline } = useNavigateToTimeline(); + const { openTimelineWithFilters } = useNavigateToTimeline(); + + const openRuleInTimeline = useCallback( + (ruleName: string) => { + openTimelineWithFilters([ + [{ field: 'kibana.alert.rule.name', value: ruleName }, openAlertsFilter], + ]); + }, + [openTimelineWithFilters] + ); const navigateToAlerts = useCallback(() => { navigateTo({ deepLinkId: SecurityPageName.alerts }); diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.test.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.test.tsx index 9b6ed807e34e6..1d7cb38b864ac 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.test.tsx @@ -13,7 +13,9 @@ import { TestProviders } from '../../../../common/mock'; import { parsedVulnerableUserAlertsResult } from './mock_data'; import type { UseUserAlertsItems } from './use_user_alerts_items'; import { UserAlertsTable } from './user_alerts_table'; +import { openAlertsFilter } from '../utils'; +const userName = 'crffn20qcs'; const mockGetAppUrl = jest.fn(); jest.mock('../../../../common/lib/kibana/hooks', () => { const original = jest.requireActual('../../../../common/lib/kibana/hooks'); @@ -25,6 +27,15 @@ jest.mock('../../../../common/lib/kibana/hooks', () => { }; }); +const mockOpenTimelineWithFilters = jest.fn(); +jest.mock('../hooks/use_navigate_to_timeline', () => { + return { + useNavigateToTimeline: () => ({ + openTimelineWithFilters: mockOpenTimelineWithFilters, + }), + }; +}); + type UseUserAlertsItemsReturn = ReturnType<UseUserAlertsItems>; const defaultUseUserAlertsItemsReturn: UseUserAlertsItemsReturn = { items: [], @@ -98,7 +109,7 @@ describe('UserAlertsTable', () => { mockUseUserAlertsItemsReturn({ items: [parsedVulnerableUserAlertsResult[0]] }); const { queryByTestId } = renderComponent(); - expect(queryByTestId('userSeverityAlertsTable-userName')).toHaveTextContent('crffn20qcs'); + expect(queryByTestId('userSeverityAlertsTable-userName')).toHaveTextContent(userName); expect(queryByTestId('userSeverityAlertsTable-totalAlerts')).toHaveTextContent('4'); expect(queryByTestId('userSeverityAlertsTable-critical')).toHaveTextContent('4'); expect(queryByTestId('userSeverityAlertsTable-high')).toHaveTextContent('1'); @@ -124,4 +135,42 @@ describe('UserAlertsTable', () => { fireEvent.click(page3); expect(mockSetPage).toHaveBeenCalledWith(2); }); + + it('should open timeline with filters when total alerts is clicked', () => { + mockUseUserAlertsItemsReturn({ items: [parsedVulnerableUserAlertsResult[0]] }); + const { getByTestId } = renderComponent(); + + fireEvent.click(getByTestId('userSeverityAlertsTable-totalAlertsLink')); + + expect(mockOpenTimelineWithFilters).toHaveBeenCalledWith([ + [ + { + field: 'user.name', + value: userName, + }, + openAlertsFilter, + ], + ]); + }); + + it('should open timeline with filters when critical alerts link is clicked', () => { + mockUseUserAlertsItemsReturn({ items: [parsedVulnerableUserAlertsResult[0]] }); + const { getByTestId } = renderComponent(); + + fireEvent.click(getByTestId('userSeverityAlertsTable-criticalLink')); + + expect(mockOpenTimelineWithFilters).toHaveBeenCalledWith([ + [ + { + field: 'user.name', + value: userName, + }, + openAlertsFilter, + { + field: 'kibana.alert.severity', + value: 'critical', + }, + ], + ]); + }); }); diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx index c50f5976360ed..e4a2c29caa475 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import type { EuiBasicTableColumn } from '@elastic/eui'; import { @@ -28,7 +28,7 @@ import { UserDetailsLink } from '../../../../common/components/links'; import { useQueryToggle } from '../../../../common/containers/query_toggle'; import { useNavigateToTimeline } from '../hooks/use_navigate_to_timeline'; import * as i18n from '../translations'; -import { ITEMS_PER_PAGE, SEVERITY_COLOR } from '../utils'; +import { ITEMS_PER_PAGE, openAlertsFilter, SEVERITY_COLOR } from '../utils'; import type { UserAlertsItem } from './use_user_alerts_items'; import { useUserAlertsItems } from './use_user_alerts_items'; @@ -43,7 +43,23 @@ type GetTableColumns = ( const DETECTION_RESPONSE_USER_SEVERITY_QUERY_ID = 'vulnerableUsersBySeverityQuery'; export const UserAlertsTable = React.memo(({ signalIndexName }: UserAlertsTableProps) => { - const { openUserInTimeline } = useNavigateToTimeline(); + const { openTimelineWithFilters } = useNavigateToTimeline(); + + const openUserInTimeline = useCallback( + ({ userName, severity }: { userName: string; severity?: string }) => { + const userNameFilter = { field: 'user.name', value: userName }; + const severityFilter = severity + ? { field: 'kibana.alert.severity', value: severity } + : undefined; + + openTimelineWithFilters( + severityFilter + ? [[userNameFilter, openAlertsFilter, severityFilter]] + : [[userNameFilter, openAlertsFilter]] + ); + }, + [openTimelineWithFilters] + ); const { toggleStatus, setToggleStatus } = useQueryToggle( DETECTION_RESPONSE_USER_SEVERITY_QUERY_ID ); @@ -118,7 +134,11 @@ const getTableColumns: GetTableColumns = (handleClick) => [ name: i18n.ALERTS_TEXT, 'data-test-subj': 'userSeverityAlertsTable-totalAlerts', render: (totalAlerts: number, { userName }) => ( - <EuiLink disabled={totalAlerts === 0} onClick={() => handleClick({ userName })}> + <EuiLink + data-test-subj="userSeverityAlertsTable-totalAlertsLink" + disabled={totalAlerts === 0} + onClick={() => handleClick({ userName })} + > <FormattedCount count={totalAlerts} /> </EuiLink> ), @@ -129,6 +149,7 @@ const getTableColumns: GetTableColumns = (handleClick) => [ render: (count: number, { userName }) => ( <EuiHealth data-test-subj="userSeverityAlertsTable-critical" color={SEVERITY_COLOR.critical}> <EuiLink + data-test-subj="userSeverityAlertsTable-criticalLink" disabled={count === 0} onClick={() => handleClick({ userName, severity: 'critical' })} > diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/utils.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/utils.tsx index 76b690e0fbf0a..b82108c50e0e2 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/utils.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/utils.tsx @@ -21,3 +21,5 @@ const MAX_ALLOWED_RESULTS = 100; * */ export const getPageCount = (count: number = 0) => Math.ceil(Math.min(count || 0, MAX_ALLOWED_RESULTS) / ITEMS_PER_PAGE); + +export const openAlertsFilter = { field: 'kibana.alert.workflow_status', value: 'open' }; diff --git a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/index.test.tsx b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/index.test.tsx index 37d5cabca6ce4..b47741a219107 100644 --- a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/index.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/index.test.tsx @@ -204,4 +204,32 @@ describe('EntityAnalyticsAnomalies', () => { expect(getByTestId('anomalies-table-column-count').textContent).toEqual('Count'); // 'Count' is always rendered by only displayed on mobile }); + + it('renders a warning message when jobs are incompatible', () => { + const jobCount: AnomaliesCount = { + job: { + isInstalled: true, + datafeedState: 'started', + jobState: 'opened', + isCompatible: false, + } as SecurityJob, + name: 'v3_windows_anomalous_script', + count: 0, + entity: AnomalyEntity.User, + }; + + mockUseNotableAnomaliesSearch.mockReturnValue({ + isLoading: false, + data: [jobCount], + refetch: jest.fn(), + }); + + const { getByTestId } = render( + <TestProviders> + <EntityAnalyticsAnomalies /> + </TestProviders> + ); + + expect(getByTestId('incompatible_jobs_warnings')).toBeInTheDocument(); + }); }); diff --git a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/index.tsx b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/index.tsx index beeae25f64b2a..c3333a3e13957 100644 --- a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/index.tsx @@ -5,9 +5,17 @@ * 2.0. */ import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiInMemoryTable, EuiPanel } from '@elastic/eui'; +import { + EuiCallOut, + EuiFlexGroup, + EuiFlexItem, + EuiInMemoryTable, + EuiPanel, + EuiSpacer, +} from '@elastic/eui'; import { MLJobsAwaitingNodeWarning, ML_PAGES, useMlHref } from '@kbn/ml-plugin/public'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HeaderSection } from '../../../../common/components/header_section'; import { useQueryToggle } from '../../../../common/containers/query_toggle'; import { LastUpdatedAt } from '../../../../common/components/last_updated_at'; @@ -43,7 +51,7 @@ export const ENTITY_ANALYTICS_ANOMALIES_PANEL = 'entity_analytics_anomalies'; export const EntityAnalyticsAnomalies = () => { const { - services: { ml, http }, + services: { ml, http, docLinks }, } = useKibana(); const jobsUrl = useMlHref(ml, http.basePath.get(), { @@ -112,6 +120,11 @@ export const EntityAnalyticsAnomalies = () => { [data] ); + const incompatibleJobCount = useMemo( + () => data.filter(({ job }) => job && !job.isCompatible).length, + [data] + ); + return ( <EuiPanel hasBorder data-test-subj={ENTITY_ANALYTICS_ANOMALIES_PANEL}> <HeaderSection @@ -149,6 +162,34 @@ export const EntityAnalyticsAnomalies = () => { </EuiFlexItem> </EuiFlexGroup> </HeaderSection> + + {incompatibleJobCount > 0 && ( + <> + <EuiCallOut + title={i18n.MODULE_NOT_COMPATIBLE_TITLE(incompatibleJobCount)} + data-test-subj="incompatible_jobs_warnings" + color="warning" + iconType="alert" + size="s" + > + <p> + <FormattedMessage + defaultMessage="We could not find any data, see {mlDocs} for more information on Machine Learning job requirements." + id="xpack.securitySolution.components.mlPopup.moduleNotCompatibleDescription" + values={{ + mlDocs: ( + <a href={`${docLinks.links.siem.ml}`} rel="noopener noreferrer" target="_blank"> + {i18n.ANOMALY_DETECTION_DOCS} + </a> + ), + }} + /> + </p> + </EuiCallOut> + + <EuiSpacer size="m" /> + </> + )} <MLJobsAwaitingNodeWarning jobIds={installedJobsIds} /> {toggleStatus && ( <EuiInMemoryTable diff --git a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/translations.ts b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/translations.ts index 59d5a5ce37244..fdef8b65baddf 100644 --- a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/translations.ts +++ b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/anomalies/translations.ts @@ -76,3 +76,17 @@ export const JOB_STATUS_FAILED = i18n.translate( defaultMessage: 'failed', } ); + +export const MODULE_NOT_COMPATIBLE_TITLE = (incompatibleJobCount: number) => + i18n.translate('xpack.securitySolution.entityAnalytics.anomalies.moduleNotCompatibleTitle', { + values: { incompatibleJobCount }, + defaultMessage: + '{incompatibleJobCount} {incompatibleJobCount, plural, =1 {job is} other {jobs are}} currently unavailable', + }); + +export const ANOMALY_DETECTION_DOCS = i18n.translate( + 'xpack.securitySolution.entityAnalytics.anomalies.AnomalyDetectionDocsTitle', + { + defaultMessage: 'Anomaly Detection with Machine Learning', + } +); diff --git a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/columns.tsx b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/columns.tsx index 055a172e54b73..e9fd68dabd4d2 100644 --- a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/columns.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/columns.tsx @@ -7,19 +7,28 @@ import React from 'react'; import type { EuiBasicTableColumn } from '@elastic/eui'; -import { EuiIcon, EuiToolTip } from '@elastic/eui'; +import { EuiLink, EuiIcon, EuiToolTip } from '@elastic/eui'; +import { get } from 'lodash/fp'; import { UsersTableType } from '../../../../users/store/model'; import { getEmptyTagValue } from '../../../../common/components/empty_value'; import { HostDetailsLink, UserDetailsLink } from '../../../../common/components/links'; import { HostsTableType } from '../../../../hosts/store/model'; import { RiskScore } from '../../../../common/components/severity/common'; -import type { HostRiskScore, RiskSeverity } from '../../../../../common/search_strategy'; +import type { + HostRiskScore, + RiskSeverity, + UserRiskScore, +} from '../../../../../common/search_strategy'; import { RiskScoreEntity, RiskScoreFields } from '../../../../../common/search_strategy'; import * as i18n from './translations'; +import { FormattedCount } from '../../../../common/components/formatted_number'; -type HostRiskScoreColumns = Array<EuiBasicTableColumn<HostRiskScore>>; +type HostRiskScoreColumns = Array<EuiBasicTableColumn<HostRiskScore & UserRiskScore>>; -export const getRiskScoreColumns = (riskEntity: RiskScoreEntity): HostRiskScoreColumns => [ +export const getRiskScoreColumns = ( + riskEntity: RiskScoreEntity, + openEntityInTimeline: (entityName: string, oldestAlertTimestamp?: string) => void +): HostRiskScoreColumns => [ { field: riskEntity === RiskScoreEntity.host ? 'host.name' : 'user.name', name: i18n.ENTITY_NAME(riskEntity), @@ -75,4 +84,25 @@ export const getRiskScoreColumns = (riskEntity: RiskScoreEntity): HostRiskScoreC return getEmptyTagValue(); }, }, + { + field: RiskScoreFields.alertsCount, + width: '15%', + name: i18n.ALERTS, + truncateText: false, + mobileOptions: { show: true }, + render: (alertCount: number, risk) => ( + <EuiLink + data-test-subj="risk-score-alerts" + disabled={alertCount === 0} + onClick={() => + openEntityInTimeline( + get('host.name', risk) ?? get('user.name', risk), + risk.oldestAlertTimestamp + ) + } + > + <FormattedCount count={alertCount} /> + </EuiLink> + ), + }, ]; diff --git a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.test.tsx b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.test.tsx index 89011082a2f81..2222fbebf2dfa 100644 --- a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.test.tsx @@ -5,13 +5,15 @@ * 2.0. */ -import { render } from '@testing-library/react'; +import { render, fireEvent } from '@testing-library/react'; import React from 'react'; import { TestProviders } from '../../../../common/mock'; import { EntityAnalyticsRiskScores } from '.'; +import type { UserRiskScore } from '../../../../../common/search_strategy'; import { RiskScoreEntity, RiskSeverity } from '../../../../../common/search_strategy'; import type { SeverityCount } from '../../../../common/components/severity/types'; import { useRiskScore, useRiskScoreKpi } from '../../../../risk_score/containers'; +import { openAlertsFilter } from '../../detection_response/utils'; const mockSeverityCount: SeverityCount = { [RiskSeverity.low]: 1, @@ -41,6 +43,15 @@ const mockUseRiskScore = useRiskScore as jest.Mock; const mockUseRiskScoreKpi = useRiskScoreKpi as jest.Mock; jest.mock('../../../../risk_score/containers'); +const mockOpenTimelineWithFilters = jest.fn(); +jest.mock('../../detection_response/hooks/use_navigate_to_timeline', () => { + return { + useNavigateToTimeline: () => ({ + openTimelineWithFilters: mockOpenTimelineWithFilters, + }), + }; +}); + describe.each([RiskScoreEntity.host, RiskScoreEntity.user])( 'EntityAnalyticsRiskScores entityType: %s', (riskEntity) => { @@ -116,5 +127,81 @@ describe.each([RiskScoreEntity.host, RiskScoreEntity.user])( expect(queryByTestId('entity_analytics_content')).not.toBeInTheDocument(); }); + + it('renders alerts count', () => { + mockUseQueryToggle.mockReturnValue({ toggleStatus: true, setToggleStatus: jest.fn() }); + mockUseRiskScoreKpi.mockReturnValue({ + severityCount: mockSeverityCount, + loading: false, + }); + const alertsCount = 999; + const data: UserRiskScore[] = [ + { + '@timestamp': '1234567899', + user: { + name: 'testUsermame', + risk: { + rule_risks: [], + calculated_level: RiskSeverity.high, + calculated_score_norm: 75, + multipliers: [], + }, + }, + alertsCount, + }, + ]; + mockUseRiskScore.mockReturnValue({ ...defaultProps, data }); + + const { queryByTestId } = render( + <TestProviders> + <EntityAnalyticsRiskScores riskEntity={riskEntity} /> + </TestProviders> + ); + + expect(queryByTestId('risk-score-alerts')).toHaveTextContent(alertsCount.toString()); + }); + + it('navigates to timeline with filters when alerts count is clicked', () => { + mockUseQueryToggle.mockReturnValue({ toggleStatus: true, setToggleStatus: jest.fn() }); + mockUseRiskScoreKpi.mockReturnValue({ + severityCount: mockSeverityCount, + loading: false, + }); + const name = 'testName'; + const data = [ + { + '@timestamp': '1234567899', + [riskEntity]: { + name, + risk: { + rule_risks: [], + calculated_level: RiskSeverity.high, + calculated_score_norm: 75, + multipliers: [], + }, + }, + alertsCount: 999, + }, + ]; + mockUseRiskScore.mockReturnValue({ ...defaultProps, data }); + + const { getByTestId } = render( + <TestProviders> + <EntityAnalyticsRiskScores riskEntity={riskEntity} /> + </TestProviders> + ); + + fireEvent.click(getByTestId('risk-score-alerts')); + + expect(mockOpenTimelineWithFilters.mock.calls[0][0]).toEqual([ + [ + { + field: riskEntity === RiskScoreEntity.host ? 'host.name' : 'user.name', + value: name, + }, + openAlertsFilter, + ], + ]); + }); } ); diff --git a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.tsx b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.tsx index 066c4f29d2787..f3410e7e7b4b1 100644 --- a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useEffect, useMemo, useState } from 'react'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { useDispatch } from 'react-redux'; @@ -40,6 +40,9 @@ import { Loader } from '../../../../common/components/loader'; import { Panel } from '../../../../common/components/panel'; import * as commonI18n from '../common/translations'; import { usersActions } from '../../../../users/store'; +import { useNavigateToTimeline } from '../../detection_response/hooks/use_navigate_to_timeline'; +import type { TimeRange } from '../../../../common/store/inputs/model'; +import { openAlertsFilter } from '../../detection_response/utils'; const HOST_RISK_TABLE_QUERY_ID = 'hostRiskDashboardTable'; const HOST_RISK_KPI_QUERY_ID = 'headerHostRiskScoreKpiQuery'; @@ -90,8 +93,34 @@ const EntityAnalyticsRiskScoresComponent = ({ riskEntity }: { riskEntity: RiskSc [dispatch, riskEntity] ); + const { openTimelineWithFilters } = useNavigateToTimeline(); + + const openEntityInTimeline = useCallback( + (entityName: string, oldestAlertTimestamp?: string) => { + const timeRange: TimeRange | undefined = oldestAlertTimestamp + ? { + kind: 'relative', + from: oldestAlertTimestamp ?? '', + fromStr: oldestAlertTimestamp ?? '', + to: new Date().toISOString(), + toStr: 'now', + } + : undefined; + + const filter = { + field: riskEntity === RiskScoreEntity.host ? 'host.name' : 'user.name', + value: entityName, + }; + openTimelineWithFilters([[filter, openAlertsFilter]], timeRange); + }, + [riskEntity, openTimelineWithFilters] + ); + const { toggleStatus, setToggleStatus } = useQueryToggle(entity.tableQueryId); - const columns = useMemo(() => getRiskScoreColumns(riskEntity), [riskEntity]); + const columns = useMemo( + () => getRiskScoreColumns(riskEntity, openEntityInTimeline), + [riskEntity, openEntityInTimeline] + ); const [selectedSeverity, setSelectedSeverity] = useState<RiskSeverity[]>([]); const getSecuritySolutionLinkProps = useGetSecuritySolutionLinkProps(); @@ -146,6 +175,7 @@ const EntityAnalyticsRiskScoresComponent = ({ riskEntity }: { riskEntity: RiskSc }, timerange, riskEntity, + includeAlertsCount: true, }); useQueryInspector({ diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts b/x-pack/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts index 7bb7180712c99..64977ffd5c065 100644 --- a/x-pack/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts +++ b/x-pack/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts @@ -5,6 +5,8 @@ * 2.0. */ +import type { MatcherHintOptions } from 'jest-matcher-utils'; + /** * Typescript won't allow global namespace stuff unless you're in a module. * This wouldn't otherwise be a module. The code runs as soon as it's imported. @@ -36,7 +38,7 @@ expect.extend({ ): Promise<{ pass: boolean; message: () => string }> { // Used in printing out the pass or fail message const matcherName = 'toYieldEqualTo'; - const options: jest.MatcherHintOptions = { + const options: MatcherHintOptions = { comment: 'deep equality with any yielded value', isNot: this.isNot, promise: this.promise, @@ -102,7 +104,7 @@ expect.extend({ ): Promise<{ pass: boolean; message: () => string }> { // Used in printing out the pass or fail message const matcherName = 'toYieldObjectEqualTo'; - const options: jest.MatcherHintOptions = { + const options: MatcherHintOptions = { comment: 'subset equality with any yielded value', isNot: this.isNot, promise: this.promise, diff --git a/x-pack/plugins/security_solution/public/risk_score/components/translations.ts b/x-pack/plugins/security_solution/public/risk_score/components/translations.ts index 2016dd1d57990..8d845c6d99987 100644 --- a/x-pack/plugins/security_solution/public/risk_score/components/translations.ts +++ b/x-pack/plugins/security_solution/public/risk_score/components/translations.ts @@ -50,3 +50,7 @@ export const getRiskEntityTranslation = ( return riskEntity === RiskScoreEntity.host ? HOST : USER; }; + +export const ALERTS = i18n.translate('xpack.securitySolution.riskScore.overview.alerts', { + defaultMessage: 'Alerts', +}); diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/all/index.test.tsx b/x-pack/plugins/security_solution/public/risk_score/containers/all/index.test.tsx index c9a8f448c352d..dc2b8dac58493 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/all/index.test.tsx +++ b/x-pack/plugins/security_solution/public/risk_score/containers/all/index.test.tsx @@ -168,6 +168,8 @@ describe.each([RiskScoreEntity.host, RiskScoreEntity.user])( expect(mockSearch).toHaveBeenCalledWith({ defaultIndex: [`ml_${riskEntity}_risk_score_latest_default`], factoryQueryType: `${riskEntity}sRiskScore`, + riskScoreEntity: riskEntity, + includeAlertsCount: false, }); }); diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/all/index.tsx b/x-pack/plugins/security_solution/public/risk_score/containers/all/index.tsx index b700f83f7f702..977bc10caecc5 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/all/index.tsx +++ b/x-pack/plugins/security_solution/public/risk_score/containers/all/index.tsx @@ -45,6 +45,7 @@ export interface RiskScoreState<T extends RiskScoreEntity.host | RiskScoreEntity export interface UseRiskScoreParams { filterQuery?: ESQuery | string; onlyLatest?: boolean; + includeAlertsCount?: boolean; pagination?: | { cursorStart: number; @@ -76,6 +77,7 @@ export const useRiskScore = <T extends RiskScoreEntity.host | RiskScoreEntity.us skip = false, pagination, riskEntity, + includeAlertsCount = false, }: UseRiskScore<T>): RiskScoreState<T> => { const spaceId = useSpaceId(); const defaultIndex = spaceId @@ -158,6 +160,8 @@ export const useRiskScore = <T extends RiskScoreEntity.host | RiskScoreEntity.us ? { defaultIndex: [defaultIndex], factoryQueryType, + riskScoreEntity: riskEntity, + includeAlertsCount, filterQuery: createFilter(filterQuery), pagination: cursorStart !== undefined && querySize !== undefined @@ -179,6 +183,8 @@ export const useRiskScore = <T extends RiskScoreEntity.host | RiskScoreEntity.us sort, requestTimerange, onlyLatest, + riskEntity, + includeAlertsCount, ] ); diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/index.ts b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/index.ts index cc25b1c874a89..3223e9c7c3726 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/index.ts +++ b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/index.ts @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -export * from './indices'; export * from './ingest_pipelines'; export * from './transforms'; export * from './stored_scripts'; diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/indices.test.ts b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/indices.test.ts deleted file mode 100644 index b738e2e029e5c..0000000000000 --- a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/indices.test.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { HttpSetup } from '@kbn/core-http-browser'; -import type { NotificationsStart } from '@kbn/securitysolution-io-ts-list-types'; -import { createIndices, deleteIndices } from './indices'; - -const mockRequest = jest.fn(); -const mockHttp = { - put: mockRequest, - post: mockRequest, -} as unknown as HttpSetup; - -const mockAddDanger = jest.fn(); -const mockAddError = jest.fn(); -const mockNotification = { - toasts: { - addDanger: mockAddDanger, - addError: mockAddError, - }, -} as NotificationsStart; - -const mockRenderDocLink = jest.fn(); - -describe('createIndices', () => { - const mockOptions = { index: 'test', mappings: {} }; - - beforeAll(async () => { - mockRequest.mockRejectedValue({ body: { message: 'test error' } }); - await createIndices({ - http: mockHttp, - notifications: mockNotification, - options: mockOptions, - renderDocLink: mockRenderDocLink, - }); - }); - - afterAll(() => { - jest.clearAllMocks(); - }); - it('create index', () => { - expect(mockRequest.mock.calls[0][0]).toEqual(`/internal/risk_score/indices/create`); - }); - - it('handles error', () => { - expect(mockAddDanger.mock.calls[0][0].title).toEqual('Failed to create index'); - expect(mockRenderDocLink.mock.calls[0][0]).toEqual('test error'); - }); -}); - -describe('deleteIndices', () => { - const mockOptions = { indices: ['test', 'abc'] }; - - beforeAll(async () => { - mockRequest.mockRejectedValue({ body: { message: 'test error' } }); - await deleteIndices({ - http: mockHttp, - notifications: mockNotification, - options: mockOptions, - renderDocLink: mockRenderDocLink, - }); - }); - - afterAll(() => { - jest.clearAllMocks(); - }); - - it('delete index', () => { - expect(mockRequest.mock.calls[0][0]).toEqual(`/internal/risk_score/indices/delete`); - }); - - it('handles error', () => { - expect(mockAddDanger.mock.calls[0][0].title).toEqual('Failed to delete indices'); - expect(mockRenderDocLink.mock.calls[0][0]).toEqual('test error'); - }); -}); diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/indices.ts b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/indices.ts deleted file mode 100644 index d5a7b6145e2ce..0000000000000 --- a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/indices.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 { toMountPoint } from '@kbn/kibana-react-plugin/public'; -import { INDICES_CREATION_ERROR_MESSAGE, INDICES_DELETION_ERROR_MESSAGE } from './translations'; -import type { CreateIndices, DeleteIndices } from './types'; -import { - RISK_SCORE_CREATE_INDEX, - RISK_SCORE_DELETE_INDICES, -} from '../../../../../common/constants'; - -export async function createIndices({ - errorMessage, - http, - notifications, - options, - renderDocLink, - signal, - theme, -}: CreateIndices) { - const res = await http - .put(RISK_SCORE_CREATE_INDEX, { - body: JSON.stringify(options), - signal, - }) - .catch((e) => { - notifications?.toasts?.addDanger({ - title: errorMessage ?? INDICES_CREATION_ERROR_MESSAGE, - text: toMountPoint( - renderDocLink && e?.body?.message != null - ? renderDocLink(e?.body?.message) - : e?.body?.message, - { - theme$: theme?.theme$, - } - ), - }); - }); - - return res; -} - -export async function deleteIndices({ - errorMessage, - http, - notifications, - options, - renderDocLink, - signal, - theme, -}: DeleteIndices) { - const count = options.indices.length; - const res = await http - .post(RISK_SCORE_DELETE_INDICES, { - body: JSON.stringify(options), - signal, - }) - .catch((e) => { - notifications?.toasts?.addDanger({ - title: errorMessage ?? INDICES_DELETION_ERROR_MESSAGE(count), - text: toMountPoint( - renderDocLink && e?.body?.message ? renderDocLink(e?.body?.message) : e?.body?.message, - { - theme$: theme?.theme$, - } - ), - }); - }); - - return res; -} diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/ingest_pipelines.test.ts b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/ingest_pipelines.test.ts index a1c5318c4b830..0e24ecf96edc8 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/ingest_pipelines.test.ts +++ b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/ingest_pipelines.test.ts @@ -6,7 +6,7 @@ */ import type { HttpSetup } from '@kbn/core-http-browser'; -import type { NotificationsStart } from '@kbn/securitysolution-io-ts-list-types'; +import type { NotificationsStart } from '@kbn/core-notifications-browser'; import { createIngestPipeline, deleteIngestPipelines } from './ingest_pipelines'; const mockRequest = jest.fn(); @@ -23,7 +23,7 @@ const mockNotification = { addDanger: mockAddDanger, addError: mockAddError, }, -} as NotificationsStart; +} as unknown as NotificationsStart; const mockRenderDocLink = jest.fn(); diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/stored_scripts.test.ts b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/stored_scripts.test.ts index 95c8b3b3e5346..057a2927c6a96 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/stored_scripts.test.ts +++ b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/stored_scripts.test.ts @@ -6,7 +6,7 @@ */ import type { HttpSetup } from '@kbn/core-http-browser'; -import type { NotificationsStart } from '@kbn/securitysolution-io-ts-list-types'; +import type { NotificationsStart } from '@kbn/core-notifications-browser'; import { createStoredScript, deleteStoredScript } from './stored_scripts'; const mockRequest = jest.fn(); @@ -23,7 +23,7 @@ const mockNotification = { addDanger: mockAddDanger, addError: mockAddError, }, -} as NotificationsStart; +} as unknown as NotificationsStart; const mockRenderDocLink = jest.fn(); diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/transforms.test.ts b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/transforms.test.ts index e121bd5e9c434..90f6b67950c65 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/transforms.test.ts +++ b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/transforms.test.ts @@ -6,7 +6,7 @@ */ import type { HttpSetup } from '@kbn/core-http-browser'; -import type { NotificationsStart } from '@kbn/securitysolution-io-ts-list-types'; +import type { NotificationsStart } from '@kbn/core-notifications-browser'; import { createTransform, deleteTransforms, getTransformState, stopTransforms } from './transforms'; const mockRequest = jest.fn(); @@ -24,7 +24,7 @@ const mockNotification = { addDanger: mockAddDanger, addError: mockAddError, }, -} as NotificationsStart; +} as unknown as NotificationsStart; const mockRenderDocLink = jest.fn(); diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/transforms.ts b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/transforms.ts index f237ee82af87d..da6dd0d7ddf6c 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/transforms.ts +++ b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/transforms.ts @@ -5,11 +5,9 @@ * 2.0. */ -import { RISK_SCORE_RESTART_TRANSFORMS } from '../../../../../common/constants'; import { GET_TRANSFORM_STATE_ERROR_MESSAGE, GET_TRANSFORM_STATE_NOT_FOUND_MESSAGE, - RESTART_TRANSFORMS_ERROR_MESSAGE, START_TRANSFORMS_ERROR_MESSAGE, STOP_TRANSFORMS_ERROR_MESSAGE, TRANSFORM_CREATION_ERROR_MESSAGE, @@ -22,8 +20,6 @@ import type { DeleteTransformsResult, GetTransformsState, GetTransformState, - RestartTransforms, - RestartTransformResult, StartTransforms, StartTransformsResult, StopTransforms, @@ -322,49 +318,3 @@ export async function deleteTransforms({ return res; } - -export async function restartTransforms({ - http, - notifications, - renderDocLink, - signal, - errorMessage, - riskScoreEntity, -}: RestartTransforms) { - const res = await http - .post<RestartTransformResult[]>(`${RISK_SCORE_RESTART_TRANSFORMS}`, { - body: JSON.stringify({ riskScoreEntity }), - signal, - }) - .then((result) => { - const failedIds = result.reduce<string[]>((acc, curr) => { - const [[key, val]] = Object.entries(curr); - return !val.success - ? [...acc, val?.error?.message ? `${key}: ${val?.error?.message}` : key] - : acc; - }, []); - const errorMessageTitle = errorMessage ?? RESTART_TRANSFORMS_ERROR_MESSAGE(failedIds.length); - - if (failedIds.length > 0) { - notifications?.toasts?.addError(new Error(errorMessageTitle), { - title: errorMessageTitle, - toastMessage: getErrorToastMessage({ - messageBody: failedIds.join(', '), - renderDocLink, - }), - toastLifeTimeMs, - }); - } - - return result; - }) - .catch((e) => { - notifications?.toasts?.addError(e, { - title: errorMessage ?? RESTART_TRANSFORMS_ERROR_MESSAGE(), - toastMessage: getErrorToastMessage({ messageBody: e?.body?.message, renderDocLink }), - toastLifeTimeMs, - }); - }); - - return res; -} diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/translations.ts b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/translations.ts index 830614f25e466..4af4a3f373ef1 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/translations.ts +++ b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/translations.ts @@ -20,19 +20,6 @@ export const INGEST_PIPELINE_DELETION_ERROR_MESSAGE = (totalCount: number) => defaultMessage: `Failed to delete Ingest {totalCount, plural, =1 {pipeline} other {pipelines}}`, }); -export const INDICES_CREATION_ERROR_MESSAGE = i18n.translate( - 'xpack.securitySolution.riskScore.api.indices.create.errorMessageTitle', - { - defaultMessage: 'Failed to create index', - } -); - -export const INDICES_DELETION_ERROR_MESSAGE = (totalCount: number) => - i18n.translate('xpack.securitySolution.riskScore.api.indices.delete.errorMessageTitle', { - values: { totalCount }, - defaultMessage: `Failed to delete {totalCount, plural, =1 {index} other {indices}}`, - }); - export const STORED_SCRIPT_CREATION_ERROR_MESSAGE = i18n.translate( 'xpack.securitySolution.riskScore.api.storedScript.create.errorMessageTitle', { @@ -80,12 +67,6 @@ export const START_TRANSFORMS_ERROR_MESSAGE = (totalCount: number) => defaultMessage: `Failed to start {totalCount, plural, =1 {Transform} other {Transforms}}`, }); -export const RESTART_TRANSFORMS_ERROR_MESSAGE = (totalCount?: number) => - i18n.translate('xpack.securitySolution.riskScore.api.transforms.start.errorMessageTitle', { - values: { totalCount }, - defaultMessage: `Failed to start {totalCount, plural, =1 {Transform} other {Transforms}}`, - }); - export const STOP_TRANSFORMS_ERROR_MESSAGE = (totalCount: number) => i18n.translate('xpack.securitySolution.riskScore.api.transforms.stop.errorMessageTitle', { values: { totalCount }, diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/types.ts b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/types.ts index 1f95545258260..e2888772e7b57 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/types.ts +++ b/x-pack/plugins/security_solution/public/risk_score/containers/onboarding/api/types.ts @@ -5,8 +5,6 @@ * 2.0. */ import type { HttpSetup, NotificationsStart, ThemeServiceStart } from '@kbn/core/public'; -import type { OutputError } from '@kbn/securitysolution-es-utils'; -import type { RiskScoreEntity } from '../../../../../common/search_strategy/security_solution/risk_score/common'; interface RiskyScoreApiBase { errorMessage?: string; @@ -27,14 +25,6 @@ export interface DeleteIngestPipeline extends RiskyScoreApiBase { names: string; } -export interface CreateIndices extends RiskyScoreApiBase { - options: { index: string; mappings: string | Record<string, unknown> }; -} - -export interface DeleteIndices extends RiskyScoreApiBase { - options: { indices: string[] }; -} - export interface CreateStoredScript extends RiskyScoreApiBase { options: { id: string; @@ -73,10 +63,6 @@ export interface StartTransforms extends RiskyScoreApiBase { transformIds: string[]; } -export interface RestartTransforms extends RiskyScoreApiBase { - riskScoreEntity: RiskScoreEntity; -} - interface TransformResult { success: boolean; error?: { root_cause?: unknown; type?: string; reason?: string }; @@ -84,11 +70,6 @@ interface TransformResult { export type StartTransformsResult = Record<string, TransformResult>; -export type RestartTransformResult = Record< - string, - { success: boolean; error: OutputError | null } ->; - export interface StopTransforms extends RiskyScoreApiBase { transformIds: string[]; } diff --git a/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap index df6539a20c74e..94d8b5146b961 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap @@ -109,7 +109,7 @@ exports[`Flyout rendering it renders correctly against snapshot 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > <span - color="success" + color="warning" data-euiicon-type="dot" /> </div> diff --git a/x-pack/plugins/security_solution/public/timelines/components/flyout/pane/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/flyout/pane/index.test.tsx index 59579924e3d88..0195e4d5c62f6 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/flyout/pane/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/flyout/pane/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { render } from '@testing-library/react'; +import { render, waitFor } from '@testing-library/react'; import React from 'react'; import { TestProviders } from '../../../../common/mock'; @@ -15,6 +15,15 @@ import { useGetUserCasesPermissions } from '../../../../common/lib/kibana'; jest.mock('../../../../common/lib/kibana'); const originalKibanaLib = jest.requireActual('../../../../common/lib/kibana'); +jest.mock('@kbn/i18n-react', () => { + const originalModule = jest.requireActual('@kbn/i18n-react'); + const FormattedRelative = jest.fn().mockImplementation(() => '20 hours ago'); + + return { + ...originalModule, + FormattedRelative, + }; +}); // Restore the useGetUserCasesPermissions so the calling functions can receive a valid permissions object // The returned permissions object will indicate that the user does not have permissions by default @@ -30,21 +39,25 @@ jest.mock('../../../../common/hooks/use_resolve_conflict', () => { }); describe('Pane', () => { - test('renders with display block by default', () => { + test('renders with display block by default', async () => { const EmptyComponent = render( <TestProviders> <Pane timelineId={TimelineId.test} /> </TestProviders> ); - expect(EmptyComponent.getByTestId('flyout-pane')).toHaveStyle('display: block'); + await waitFor(() => { + expect(EmptyComponent.getByTestId('flyout-pane')).toHaveStyle('display: block'); + }); }); - test('renders with display none when visibility is set to false', () => { + test('renders with display none when visibility is set to false', async () => { const EmptyComponent = render( <TestProviders> <Pane timelineId={TimelineId.test} visible={false} /> </TestProviders> ); - expect(EmptyComponent.getByTestId('flyout-pane')).toHaveStyle('display: none'); + await waitFor(() => { + expect(EmptyComponent.getByTestId('flyout-pane')).toHaveStyle('display: none'); + }); }); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/expandable_event.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/expandable_event.tsx index acf74257c862a..7270e7a65f9f2 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/expandable_event.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/expandable_event.tsx @@ -18,6 +18,12 @@ import { import React from 'react'; import styled from 'styled-components'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; +import { getAlertDetailsUrl } from '../../../../common/components/link_to'; +import { + SecuritySolutionLinkAnchor, + useGetSecuritySolutionLinkProps, +} from '../../../../common/components/links'; import type { Ecs } from '../../../../../common/ecs'; import type { TimelineTabs } from '../../../../../common/types/timeline'; import type { BrowserFields } from '../../../../common/containers/source'; @@ -25,6 +31,7 @@ import { EventDetails } from '../../../../common/components/event_details/event_ import type { TimelineEventsDetailsItem } from '../../../../../common/search_strategy/timeline'; import * as i18n from './translations'; import { PreferenceFormattedDate } from '../../../../common/components/formatted_date'; +import { SecurityPageName } from '../../../../../common/constants'; export type HandleOnEventClosed = () => void; interface Props { @@ -44,6 +51,7 @@ interface Props { } interface ExpandableEventTitleProps { + eventId: string; isAlert: boolean; loading: boolean; ruleName?: string; @@ -68,31 +76,50 @@ const StyledEuiFlexItem = styled(EuiFlexItem)` `; export const ExpandableEventTitle = React.memo<ExpandableEventTitleProps>( - ({ isAlert, loading, handleOnEventClosed, ruleName, timestamp }) => ( - <StyledEuiFlexGroup gutterSize="none" justifyContent="spaceBetween" wrap={true}> - <EuiFlexItem grow={false}> - {!loading && ( - <> - <EuiTitle size="s"> - <h4>{isAlert && !isEmpty(ruleName) ? ruleName : i18n.EVENT_DETAILS}</h4> - </EuiTitle> - {timestamp && ( - <> - <EuiSpacer size="s" /> - <PreferenceFormattedDate value={new Date(timestamp)} /> - </> - )} - <EuiSpacer size="m" /> - </> - )} - </EuiFlexItem> - {handleOnEventClosed && ( + ({ eventId, isAlert, loading, handleOnEventClosed, ruleName, timestamp }) => { + const isAlertDetailsPageEnabled = useIsExperimentalFeatureEnabled('alertDetailsPageEnabled'); + const { onClick } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.alerts, + path: eventId && isAlert ? getAlertDetailsUrl(eventId) : '', + }); + return ( + <StyledEuiFlexGroup gutterSize="none" justifyContent="spaceBetween" wrap={true}> <EuiFlexItem grow={false}> - <EuiButtonIcon iconType="cross" aria-label={i18n.CLOSE} onClick={handleOnEventClosed} /> + {!loading && ( + <> + <EuiTitle size="s"> + <h4>{isAlert && !isEmpty(ruleName) ? ruleName : i18n.EVENT_DETAILS}</h4> + </EuiTitle> + {timestamp && ( + <> + <EuiSpacer size="s" /> + <PreferenceFormattedDate value={new Date(timestamp)} /> + </> + )} + {isAlert && eventId && isAlertDetailsPageEnabled && ( + <> + <EuiSpacer size="l" /> + <SecuritySolutionLinkAnchor + data-test-subj="open-alert-details-page" + deepLinkId={SecurityPageName.alerts} + onClick={onClick} + > + {i18n.OPEN_ALERT_DETAILS_PAGE} + </SecuritySolutionLinkAnchor> + <EuiSpacer size="m" /> + </> + )} + </> + )} </EuiFlexItem> - )} - </StyledEuiFlexGroup> - ) + {handleOnEventClosed && ( + <EuiFlexItem grow={false}> + <EuiButtonIcon iconType="cross" aria-label={i18n.CLOSE} onClick={handleOnEventClosed} /> + </EuiFlexItem> + )} + </StyledEuiFlexGroup> + ); + } ); ExpandableEventTitle.displayName = 'ExpandableEventTitle'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/footer.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/footer.tsx index d372c8bca2de5..5a7b0c9530213 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/footer.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/footer.tsx @@ -195,6 +195,7 @@ export const FlyoutFooterComponent = React.memo( agentId={isOsqueryFlyoutOpenWithAgentId} defaultValues={alertId ? { alertIds: [alertId] } : undefined} onClose={closeOsqueryFlyout} + ecsData={detailsEcsData} /> )} </> diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/header.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/header.tsx index 39a4899dbc33c..bc9af3fa85461 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/header.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/header.tsx @@ -12,6 +12,7 @@ import { ExpandableEventTitle } from '../expandable_event'; import { BackToAlertDetailsLink } from './back_to_alert_details_link'; interface FlyoutHeaderComponentProps { + eventId: string; isAlert: boolean; isHostIsolationPanelOpen: boolean; isolateAction: 'isolateHost' | 'unisolateHost'; @@ -22,6 +23,7 @@ interface FlyoutHeaderComponentProps { } const FlyoutHeaderContentComponent = ({ + eventId, isAlert, isHostIsolationPanelOpen, isolateAction, @@ -36,6 +38,7 @@ const FlyoutHeaderContentComponent = ({ <BackToAlertDetailsLink isolateAction={isolateAction} showAlertDetails={showAlertDetails} /> ) : ( <ExpandableEventTitle + eventId={eventId} isAlert={isAlert} loading={loading} ruleName={ruleName} @@ -48,6 +51,7 @@ const FlyoutHeaderContentComponent = ({ const FlyoutHeaderContent = React.memo(FlyoutHeaderContentComponent); const FlyoutHeaderComponent = ({ + eventId, isAlert, isHostIsolationPanelOpen, isolateAction, @@ -59,6 +63,7 @@ const FlyoutHeaderComponent = ({ return ( <EuiFlyoutHeader hasBorder={isHostIsolationPanelOpen}> <FlyoutHeaderContentComponent + eventId={eventId} isAlert={isAlert} isHostIsolationPanelOpen={isHostIsolationPanelOpen} isolateAction={isolateAction} diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/index.tsx index c2bc15bcc5a89..58f73c4683f9e 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/index.tsx @@ -107,6 +107,7 @@ export const useToGetInternalFlyout = () => { <FlyoutHeaderContent isHostIsolationPanelOpen={isHostIsolationPanelOpen} isAlert={isAlert} + eventId={alertId} isolateAction={isolateAction} loading={isLoading || loading} ruleName={ruleName} @@ -117,6 +118,7 @@ export const useToGetInternalFlyout = () => { }, [ isAlert, + alertId, isHostIsolationPanelOpen, isolateAction, loading, diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.tsx index 9067443f6dea3..29a1940413dad 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.tsx @@ -80,6 +80,7 @@ const EventDetailsPanelComponent: React.FC<EventDetailsPanelProps> = ({ () => isFlyoutView || isHostIsolationPanelOpen ? ( <FlyoutHeader + eventId={expandedEvent.eventId} isHostIsolationPanelOpen={isHostIsolationPanelOpen} isAlert={isAlert} isolateAction={isolateAction} @@ -90,6 +91,7 @@ const EventDetailsPanelComponent: React.FC<EventDetailsPanelProps> = ({ /> ) : ( <ExpandableEventTitle + eventId={expandedEvent.eventId} isAlert={isAlert} loading={loading} ruleName={ruleName} @@ -97,6 +99,7 @@ const EventDetailsPanelComponent: React.FC<EventDetailsPanelProps> = ({ /> ), [ + expandedEvent.eventId, handleOnEventClosed, isAlert, isFlyoutView, diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/translations.ts b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/translations.ts index 2910e04747e39..39292052cf8d8 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/translations.ts +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/translations.ts @@ -14,6 +14,13 @@ export const MESSAGE = i18n.translate( } ); +export const OPEN_ALERT_DETAILS_PAGE = i18n.translate( + 'xpack.securitySolution.timeline.expandableEvent.openAlertDetails', + { + defaultMessage: 'Open alert details page', + } +); + export const CLOSE = i18n.translate( 'xpack.securitySolution.timeline.expandableEvent.closeEventDetailsLabel', { diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx index 02013a7af6bff..3c77300cf060a 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx @@ -11,6 +11,7 @@ import { timelineActions } from '../../../store/timeline'; import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; import { SourcererScopeName } from '../../../../common/store/sourcerer/model'; import { TimelineId, TimelineTabs } from '../../../../../common/types'; +import { FlowTargetSourceDest } from '../../../../../common/search_strategy'; const mockDispatch = jest.fn(); jest.mock('../../../../common/lib/kibana'); @@ -51,71 +52,237 @@ describe('useDetailPanel', () => { (useDeepEqualSelector as jest.Mock).mockClear(); }); - test('should return openDetailsPanel fn, handleOnDetailsPanelClosed fn, shouldShowDetailsPanel, and the DetailsPanel component', async () => { + test('should return open fns (event, host, network, user), handleOnDetailsPanelClosed fn, shouldShowDetailsPanel, and the DetailsPanel component', async () => { await act(async () => { const { result, waitForNextUpdate } = renderHook(() => { return useDetailPanel(defaultProps); }); await waitForNextUpdate(); - expect(result.current.openDetailsPanel).toBeDefined(); + expect(result.current.openEventDetailsPanel).toBeDefined(); + expect(result.current.openHostDetailsPanel).toBeDefined(); + expect(result.current.openNetworkDetailsPanel).toBeDefined(); + expect(result.current.openUserDetailsPanel).toBeDefined(); expect(result.current.handleOnDetailsPanelClosed).toBeDefined(); expect(result.current.shouldShowDetailsPanel).toBe(false); expect(result.current.DetailsPanel).toBeNull(); }); }); - test('should fire redux action to open details panel', async () => { + describe('open event details', () => { const testEventId = '123'; - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => { - return useDetailPanel(defaultProps); + test('should fire redux action to open event details panel', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + result.current?.openEventDetailsPanel(testEventId); + + expect(mockDispatch).toHaveBeenCalled(); + expect(timelineActions.toggleDetailPanel).toHaveBeenCalled(); }); - await waitForNextUpdate(); + }); - result.current?.openDetailsPanel(testEventId); + test('should call provided onClose callback provided to openEventDetailsPanel fn', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); - expect(mockDispatch).toHaveBeenCalled(); - expect(timelineActions.toggleDetailPanel).toHaveBeenCalled(); + const mockOnClose = jest.fn(); + result.current?.openEventDetailsPanel(testEventId, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + }); + }); + + test('should call the last onClose callback provided to openEventDetailsPanel fn', async () => { + // Test that the onClose ref is properly updated + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + const secondMockOnClose = jest.fn(); + result.current?.openEventDetailsPanel(testEventId, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + + result.current?.openEventDetailsPanel(testEventId, secondMockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(secondMockOnClose).toHaveBeenCalled(); + }); }); }); - test('should call provided onClose callback provided to openDetailsPanel fn', async () => { - const testEventId = '123'; - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => { - return useDetailPanel(defaultProps); + describe('open host details', () => { + const hostName = 'my-host'; + test('should fire redux action to open host details panel', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + result.current?.openHostDetailsPanel(hostName); + + expect(mockDispatch).toHaveBeenCalled(); + expect(timelineActions.toggleDetailPanel).toHaveBeenCalled(); }); - await waitForNextUpdate(); + }); + + test('should call provided onClose callback provided to openEventDetailsPanel fn', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + result.current?.openHostDetailsPanel(hostName, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + }); + }); + + test('should call the last onClose callback provided to openEventDetailsPanel fn', async () => { + // Test that the onClose ref is properly updated + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + const secondMockOnClose = jest.fn(); + result.current?.openHostDetailsPanel(hostName, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + + result.current?.openEventDetailsPanel(hostName, secondMockOnClose); + result.current?.handleOnDetailsPanelClosed(); - const mockOnClose = jest.fn(); - result.current?.openDetailsPanel(testEventId, mockOnClose); - result.current?.handleOnDetailsPanelClosed(); + expect(secondMockOnClose).toHaveBeenCalled(); + }); + }); + }); + + describe('open network details', () => { + const ip = '1.2.3.4'; + const flowTarget = FlowTargetSourceDest.source; + test('should fire redux action to open host details panel', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + result.current?.openNetworkDetailsPanel(ip, flowTarget); - expect(mockOnClose).toHaveBeenCalled(); + expect(mockDispatch).toHaveBeenCalled(); + expect(timelineActions.toggleDetailPanel).toHaveBeenCalled(); + }); + }); + + test('should call provided onClose callback provided to openEventDetailsPanel fn', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + result.current?.openNetworkDetailsPanel(ip, flowTarget, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + }); + }); + + test('should call the last onClose callback provided to openEventDetailsPanel fn', async () => { + // Test that the onClose ref is properly updated + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + const secondMockOnClose = jest.fn(); + result.current?.openNetworkDetailsPanel(ip, flowTarget, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + + result.current?.openNetworkDetailsPanel(ip, flowTarget, secondMockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(secondMockOnClose).toHaveBeenCalled(); + }); }); }); - test('should call the last onClose callback provided to openDetailsPanel fn', async () => { - // Test that the onClose ref is properly updated - const testEventId = '123'; - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => { - return useDetailPanel(defaultProps); + describe('open user details', () => { + const userName = 'IAmBatman'; + test('should fire redux action to open host details panel', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + result.current?.openUserDetailsPanel(userName); + + expect(mockDispatch).toHaveBeenCalled(); + expect(timelineActions.toggleDetailPanel).toHaveBeenCalled(); }); - await waitForNextUpdate(); + }); + + test('should call provided onClose callback provided to openEventDetailsPanel fn', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + result.current?.openUserDetailsPanel(userName, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + }); + }); - const mockOnClose = jest.fn(); - const secondMockOnClose = jest.fn(); - result.current?.openDetailsPanel(testEventId, mockOnClose); - result.current?.handleOnDetailsPanelClosed(); + test('should call the last onClose callback provided to openEventDetailsPanel fn', async () => { + // Test that the onClose ref is properly updated + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); - expect(mockOnClose).toHaveBeenCalled(); + const mockOnClose = jest.fn(); + const secondMockOnClose = jest.fn(); + result.current?.openUserDetailsPanel(userName, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); - result.current?.openDetailsPanel(testEventId, secondMockOnClose); - result.current?.handleOnDetailsPanelClosed(); + expect(mockOnClose).toHaveBeenCalled(); - expect(secondMockOnClose).toHaveBeenCalled(); + result.current?.openUserDetailsPanel(userName, secondMockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(secondMockOnClose).toHaveBeenCalled(); + }); }); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx index e98bcfdcc37e7..a43036e2d8a14 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx @@ -9,12 +9,13 @@ import React, { useMemo, useCallback, useRef } from 'react'; import { useDispatch } from 'react-redux'; import type { EntityType } from '@kbn/timelines-plugin/common'; import { getScopedActions, isInTableScope, isTimelineScope } from '../../../../helpers'; +import type { FlowTargetSourceDest } from '../../../../../common/search_strategy'; import { timelineSelectors } from '../../../store/timeline'; import { useSourcererDataView } from '../../../../common/containers/sourcerer'; import type { SourcererScopeName } from '../../../../common/store/sourcerer/model'; import { activeTimeline } from '../../../containers/active_timeline_context'; -import type { TimelineTabs } from '../../../../../common/types/timeline'; -import { TimelineId } from '../../../../../common/types/timeline'; +import type { TimelineExpandedDetailType } from '../../../../../common/types/timeline'; +import { TimelineTabs, TimelineId } from '../../../../../common/types/timeline'; import { timelineDefaults } from '../../../store/timeline/defaults'; import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; import { DetailsPanel as DetailsPanelComponent } from '..'; @@ -28,7 +29,14 @@ export interface UseDetailPanelConfig { tabType?: TimelineTabs; } export interface UseDetailPanelReturn { - openDetailsPanel: (eventId?: string, onClose?: () => void) => void; + openEventDetailsPanel: (eventId?: string, onClose?: () => void) => void; + openHostDetailsPanel: (hostName: string, onClose?: () => void) => void; + openNetworkDetailsPanel: ( + ip: string, + flowTarget: FlowTargetSourceDest, + onClose?: () => void + ) => void; + openUserDetailsPanel: (userName: string, onClose?: () => void) => void; handleOnDetailsPanelClosed: () => void; DetailsPanel: JSX.Element | null; shouldShowDetailsPanel: boolean; @@ -39,7 +47,7 @@ export const useDetailPanel = ({ isFlyoutView, sourcererScope, scopeId, - tabType, + tabType = TimelineTabs.query, }: UseDetailPanelConfig): UseDetailPanelReturn => { const { browserFields, selectedPatterns, runtimeMappings } = useSourcererDataView(sourcererScope); const dispatch = useDispatch(); @@ -50,11 +58,13 @@ export const useDetailPanel = ({ return dataTableSelectors.getTableByIdSelector(); } }, [scopeId]); + const eventDetailsIndex = useMemo(() => selectedPatterns.join(','), [selectedPatterns]); const expandedDetail = useDeepEqualSelector( (state) => ((getScope && getScope(state, scopeId)) ?? timelineDefaults)?.expandedDetail ); const onPanelClose = useRef(() => {}); + const noopPanelClose = () => {}; const shouldShowDetailsPanel = useMemo(() => { if ( @@ -68,31 +78,59 @@ export const useDetailPanel = ({ return false; }, [expandedDetail, tabType]); const scopedActions = getScopedActions(scopeId); + + // We could just surface load details panel, but rather than have users be concerned + // of the config for a panel, they can just pass the base necessary values to a panel specific function const loadDetailsPanel = useCallback( - (eventId?: string) => { - if (eventId && scopedActions) { + (panelConfig?: TimelineExpandedDetailType) => { + if (panelConfig && scopedActions) { if (isTimelineScope(scopeId)) { dispatch( scopedActions.toggleDetailPanel({ - panelView: 'eventDetail', + ...panelConfig, tabType, id: scopeId, - params: { - eventId, - indexName: selectedPatterns.join(','), - }, }) ); } } }, - [scopedActions, scopeId, dispatch, tabType, selectedPatterns] + [scopedActions, scopeId, dispatch, tabType] ); - const openDetailsPanel = useCallback( + const openEventDetailsPanel = useCallback( (eventId?: string, onClose?: () => void) => { - loadDetailsPanel(eventId); - onPanelClose.current = onClose ?? (() => {}); + if (eventId) { + loadDetailsPanel({ + panelView: 'eventDetail', + params: { eventId, indexName: eventDetailsIndex }, + }); + } + onPanelClose.current = onClose ?? noopPanelClose; + }, + [loadDetailsPanel, eventDetailsIndex] + ); + + const openHostDetailsPanel = useCallback( + (hostName: string, onClose?: () => void) => { + loadDetailsPanel({ panelView: 'hostDetail', params: { hostName } }); + onPanelClose.current = onClose ?? noopPanelClose; + }, + [loadDetailsPanel] + ); + + const openNetworkDetailsPanel = useCallback( + (ip: string, flowTarget: FlowTargetSourceDest, onClose?: () => void) => { + loadDetailsPanel({ panelView: 'networkDetail', params: { ip, flowTarget } }); + onPanelClose.current = onClose ?? noopPanelClose; + }, + [loadDetailsPanel] + ); + + const openUserDetailsPanel = useCallback( + (userName: string, onClose?: () => void) => { + loadDetailsPanel({ panelView: 'userDetail', params: { userName } }); + onPanelClose.current = onClose ?? noopPanelClose; }, [loadDetailsPanel] ); @@ -139,7 +177,10 @@ export const useDetailPanel = ({ ); return { - openDetailsPanel, + openEventDetailsPanel, + openHostDetailsPanel, + openNetworkDetailsPanel, + openUserDetailsPanel, handleOnDetailsPanelClosed, shouldShowDetailsPanel, DetailsPanel, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/header_actions.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/header_actions.test.tsx index cd90f1cfb8e7e..a851c90405994 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/header_actions.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/header_actions.test.tsx @@ -15,7 +15,7 @@ import type { ColumnHeaderOptions, HeaderActionProps, } from '../../../../../../common/types/timeline'; -import { TimelineTabs } from '../../../../../../common/types/timeline'; +import { TimelineId, TimelineTabs } from '../../../../../../common/types/timeline'; import { timelineActions } from '../../../../store/timeline'; import { getColumnHeader } from '../column_headers/helpers'; @@ -35,7 +35,7 @@ jest.mock('../../../../../common/hooks/use_selector', () => ({ })); const columnId = 'test-field'; -const timelineId = 'test-timeline'; +const timelineId = TimelineId.test; /* eslint-disable jsx-a11y/click-events-have-key-events */ mockTriggersActionsUi.getFieldBrowser.mockImplementation( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx index 08484bdb34c95..e34227f0bfe8f 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx @@ -7,14 +7,21 @@ import { mount } from 'enzyme'; import React from 'react'; -import { TableId } from '../../../../../../common/types/timeline'; +import { TableId, TimelineId } from '../../../../../../common/types/timeline'; import { TestProviders, mockTimelineModel, mockTimelineData } from '../../../../../common/mock'; import { Actions, isAlert } from '.'; import { useIsExperimentalFeatureEnabled } from '../../../../../common/hooks/use_experimental_features'; import { mockCasesContract } from '@kbn/cases-plugin/public/mocks'; import { useShallowEqualSelector } from '../../../../../common/hooks/use_selector'; import { licenseService } from '../../../../../common/hooks/use_license'; - +import { useTourContext } from '../../../../../common/components/guided_onboarding_tour'; +import { + GuidedOnboardingTourStep, + SecurityTourStep, +} from '../../../../../common/components/guided_onboarding_tour/tour_step'; +import { SecurityStepId } from '../../../../../common/components/guided_onboarding_tour/tour_config'; + +jest.mock('../../../../../common/components/guided_onboarding_tour'); jest.mock('../../../../../detections/components/user_info', () => ({ useUserData: jest.fn().mockReturnValue([{ canUserCRUD: true, hasIndexWrite: true }]), })); @@ -60,6 +67,9 @@ jest.mock('../../../../../common/lib/kibana', () => { addSuccess: jest.fn(), addWarning: jest.fn(), }), + useNavigateTo: jest.fn().mockReturnValue({ + navigateTo: jest.fn(), + }), useGetUserCasesPermissions: originalKibanaLib.useGetUserCasesPermissions, }; }); @@ -97,12 +107,17 @@ const defaultProps = { setEventsLoading: () => {}, showCheckboxes: true, showNotes: false, - timelineId: 'test', + timelineId: TimelineId.test, toggleShowNotes: () => {}, }; describe('Actions', () => { beforeAll(() => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 1, + incrementStep: () => null, + isTourShown: () => false, + }); (useShallowEqualSelector as jest.Mock).mockReturnValue(mockTimelineModel); }); @@ -137,6 +152,121 @@ describe('Actions', () => { expect(wrapper.find('[data-test-subj="select-event"]').exists()).toBe(false); }); + describe('Guided Onboarding Step', () => { + const incrementStepMock = jest.fn(); + beforeEach(() => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 2, + incrementStep: incrementStepMock, + isTourShown: () => true, + }); + jest.clearAllMocks(); + }); + + const ecsData = { + ...mockTimelineData[0].ecs, + kibana: { alert: { rule: { uuid: ['123'], parameters: {} } } }, + }; + const isTourAnchorConditions: { [key: string]: unknown } = { + ecsData, + timelineId: TableId.alertsOnAlertsPage, + ariaRowindex: 1, + }; + + test('if isTourShown is false [isTourAnchor=false], SecurityTourStep is not active', () => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 2, + incrementStep: jest.fn(), + isTourShown: () => false, + }); + + const wrapper = mount( + <TestProviders> + <Actions {...defaultProps} {...isTourAnchorConditions} /> + </TestProviders> + ); + + expect(wrapper.find(GuidedOnboardingTourStep).exists()).toEqual(true); + expect(wrapper.find(SecurityTourStep).exists()).toEqual(false); + }); + + test('if all conditions make isTourAnchor=true, SecurityTourStep is active', () => { + const wrapper = mount( + <TestProviders> + <Actions {...defaultProps} {...isTourAnchorConditions} /> + </TestProviders> + ); + + expect(wrapper.find(GuidedOnboardingTourStep).exists()).toEqual(true); + expect(wrapper.find(SecurityTourStep).exists()).toEqual(true); + }); + + test('on expand event click and SecurityTourStep is active, incrementStep', () => { + const wrapper = mount( + <TestProviders> + <Actions {...defaultProps} {...isTourAnchorConditions} /> + </TestProviders> + ); + + wrapper.find('[data-test-subj="expand-event"]').first().simulate('click'); + + expect(incrementStepMock).toHaveBeenCalledWith(SecurityStepId.alertsCases); + }); + + test('on expand event click and SecurityTourStep is active, but step is not 2, do not incrementStep', () => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 1, + incrementStep: incrementStepMock, + isTourShown: () => true, + }); + + const wrapper = mount( + <TestProviders> + <Actions {...defaultProps} {...isTourAnchorConditions} /> + </TestProviders> + ); + + wrapper.find('[data-test-subj="expand-event"]').first().simulate('click'); + + expect(incrementStepMock).not.toHaveBeenCalled(); + }); + + test('on expand event click and SecurityTourStep is not active, do not incrementStep', () => { + const wrapper = mount( + <TestProviders> + <Actions {...defaultProps} /> + </TestProviders> + ); + + wrapper.find('[data-test-subj="expand-event"]').first().simulate('click'); + + expect(incrementStepMock).not.toHaveBeenCalled(); + }); + + test('if isTourAnchor=false, SecurityTourStep is not active', () => { + const wrapper = mount( + <TestProviders> + <Actions {...defaultProps} /> + </TestProviders> + ); + + expect(wrapper.find(GuidedOnboardingTourStep).exists()).toEqual(true); + expect(wrapper.find(SecurityTourStep).exists()).toEqual(false); + }); + describe.each(Object.keys(isTourAnchorConditions))('tour condition true: %s', (key: string) => { + it('Single condition does not make tour step exist', () => { + const wrapper = mount( + <TestProviders> + <Actions {...defaultProps} {...{ [key]: isTourAnchorConditions[key] }} /> + </TestProviders> + ); + + expect(wrapper.find(GuidedOnboardingTourStep).exists()).toEqual(true); + expect(wrapper.find(SecurityTourStep).exists()).toEqual(false); + }); + }); + }); + describe('Alert context menu enabled?', () => { test('it disables for eventType=raw', () => { const wrapper = mount( @@ -271,7 +401,7 @@ describe('Actions', () => { <Actions {...defaultProps} ecsData={ecsData} - timelineId={TableId.kubernetesPageSessions} + timelineId={TableId.kubernetesPageSessions} // not a bug, this needs to be fixed by providing a generic interface for actions registry /> </TestProviders> ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx index 2c1b5b06a284e..26ffd4ea8e28e 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx @@ -8,10 +8,13 @@ import React, { useCallback, useMemo } from 'react'; import { useDispatch } from 'react-redux'; import { EuiButtonIcon, EuiCheckbox, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui'; -import { noop } from 'lodash/fp'; import styled from 'styled-components'; import { DEFAULT_ACTION_BUTTON_WIDTH } from '@kbn/timelines-plugin/public'; +import { GuidedOnboardingTourStep } from '../../../../../common/components/guided_onboarding_tour/tour_step'; +import { isDetectionsAlertsTable } from '../../../../../common/components/top_n/helpers'; +import { useTourContext } from '../../../../../common/components/guided_onboarding_tour'; +import { SecurityStepId } from '../../../../../common/components/guided_onboarding_tour/tour_config'; import { getScopedActions, isTimelineScope } from '../../../../../helpers'; import { useIsExperimentalFeatureEnabled } from '../../../../../common/hooks/use_experimental_features'; import { eventHasNotes, getEventType, getPinOnClick } from '../helpers'; @@ -61,7 +64,6 @@ const ActionsComponent: React.FC<ActionProps> = ({ onEventDetailsPanelOpened, onRowSelected, onRuleChange, - refetch, showCheckboxes, showNotes, timelineId, @@ -201,6 +203,25 @@ const ActionsComponent: React.FC<ActionProps> = ({ scopedActions, ]); + const { activeStep, isTourShown, incrementStep } = useTourContext(); + + const isTourAnchor = useMemo( + () => + isTourShown(SecurityStepId.alertsCases) && + eventType === 'signal' && + isDetectionsAlertsTable(timelineId) && + ariaRowindex === 1, + [isTourShown, ariaRowindex, eventType, timelineId] + ); + + const onExpandEvent = useCallback(() => { + const isStep2Active = activeStep === 2 && isTourShown(SecurityStepId.alertsCases); + if (isTourAnchor && isStep2Active) { + incrementStep(SecurityStepId.alertsCases); + } + onEventDetailsPanelOpened(); + }, [activeStep, incrementStep, isTourAnchor, isTourShown, onEventDetailsPanelOpened]); + return ( <ActionsContainer> {showCheckboxes && !tGridEnabled && ( @@ -220,19 +241,25 @@ const ActionsComponent: React.FC<ActionProps> = ({ </EventsTdContent> </div> )} - <div key="expand-event"> - <EventsTdContent textAlign="center" width={DEFAULT_ACTION_BUTTON_WIDTH}> - <EuiToolTip data-test-subj="expand-event-tool-tip" content={i18n.VIEW_DETAILS}> - <EuiButtonIcon - aria-label={i18n.VIEW_DETAILS_FOR_ROW({ ariaRowindex, columnValues })} - data-test-subj="expand-event" - iconType="expand" - onClick={onEventDetailsPanelOpened} - size="s" - /> - </EuiToolTip> - </EventsTdContent> - </div> + <GuidedOnboardingTourStep + isTourAnchor={isTourAnchor} + step={2} + stepId={SecurityStepId.alertsCases} + > + <div key="expand-event"> + <EventsTdContent textAlign="center" width={DEFAULT_ACTION_BUTTON_WIDTH}> + <EuiToolTip data-test-subj="expand-event-tool-tip" content={i18n.VIEW_DETAILS}> + <EuiButtonIcon + aria-label={i18n.VIEW_DETAILS_FOR_ROW({ ariaRowindex, columnValues })} + data-test-subj="expand-event" + iconType="expand" + onClick={onExpandEvent} + size="s" + /> + </EuiToolTip> + </EventsTdContent> + </div> + </GuidedOnboardingTourStep> <> {timelineId !== TimelineId.active && ( <InvestigateInTimelineAction @@ -270,7 +297,6 @@ const ActionsComponent: React.FC<ActionProps> = ({ ecsRowData={ecsData} scopeId={timelineId} disabled={isContextMenuDisabled} - refetch={refetch ?? noop} onRuleChange={onRuleChange} /> {isDisabled === false ? ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/header/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/header/index.test.tsx index 227327fd8e856..e2be31e9d5dd6 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/header/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/header/index.test.tsx @@ -19,6 +19,7 @@ import { HeaderComponent } from '.'; import { getNewSortDirectionOnClick, getNextSortDirection, getSortDirection } from './helpers'; import { Direction } from '../../../../../../../common/search_strategy'; import { useDeepEqualSelector } from '../../../../../../common/hooks/use_selector'; +import { TimelineId } from '../../../../../../../common/types'; const mockDispatch = jest.fn(); jest.mock('react-redux', () => { @@ -48,7 +49,7 @@ describe('Header', () => { sortDirection: Direction.desc, }, ]; - const timelineId = 'test'; + const timelineId = TimelineId.test; beforeEach(() => { (useDeepEqualSelector as jest.Mock).mockReturnValue({ isLoading: false }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.test.tsx index 6d329034650f3..199c79c3ac583 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.test.tsx @@ -58,6 +58,9 @@ jest.mock('../../../../../common/lib/kibana', () => { cases: mockCasesContract(), }, }), + useNavigateTo: () => ({ + navigateTo: jest.fn(), + }), useToasts: jest.fn().mockReturnValue({ addError: jest.fn(), addSuccess: jest.fn(), diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx index cffa38e3435b5..32251df6318f2 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx @@ -18,7 +18,6 @@ import { kibanaObservable, mockGlobalState, mockTimelineData, - mockTimelineModel, SUB_PLUGINS_REDUCER, } from '../../../../common/mock'; import { TestProviders } from '../../../../common/mock/test_providers'; @@ -29,13 +28,14 @@ import type { Props } from '.'; import { StatefulBody } from '.'; import type { Sort } from './sort'; import { getDefaultControlColumn } from './control_columns'; -import { useMountAppended } from '../../../../common/utils/use_mount_appended'; import { timelineActions } from '../../../store/timeline'; import { TimelineId, TimelineTabs } from '../../../../../common/types/timeline'; import { defaultRowRenderers } from './renderers'; import type { State } from '../../../../common/store'; import { createStore } from '../../../../common/store'; import { tGridReducer } from '@kbn/timelines-plugin/public'; +import { mount } from 'enzyme'; +import type { UseFieldBrowserOptionsProps } from '../../fields_browser'; jest.mock('../../../../common/hooks/use_app_toasts'); jest.mock('../../../../common/components/user_privileges', () => { @@ -49,6 +49,11 @@ jest.mock('../../../../common/components/user_privileges', () => { }; }); +const mockUseFieldBrowserOptions = jest.fn(); +jest.mock('../../fields_browser', () => ({ + useFieldBrowserOptions: (props: UseFieldBrowserOptionsProps) => mockUseFieldBrowserOptions(props), +})); + jest.mock('../../../../common/lib/kibana', () => { const originalModule = jest.requireActual('../../../../common/lib/kibana'); const mockCasesContract = jest.requireActual('@kbn/cases-plugin/public/mocks'); @@ -67,6 +72,7 @@ jest.mock('../../../../common/lib/kibana', () => { data: { search: jest.fn(), query: jest.fn(), + dataViews: jest.fn(), }, uiSettings: { get: jest.fn(), @@ -108,11 +114,6 @@ jest.mock('react-redux', () => { }; }); -jest.mock('../../../../common/hooks/use_selector', () => ({ - useShallowEqualSelector: () => mockTimelineModel, - useDeepEqualSelector: () => mockTimelineModel, -})); - jest.mock('../../../../common/components/link_to'); // Prevent Resolver from rendering @@ -129,9 +130,61 @@ jest.mock('../../fields_browser/create_field_button', () => ({ useCreateFieldButton: () => <></>, })); -// SKIP: https://github.com/elastic/kibana/issues/143718 -describe.skip('Body', () => { - const mount = useMountAppended(); +jest.mock('@elastic/eui', () => { + const original = jest.requireActual('@elastic/eui'); + return { + ...original, + EuiScreenReaderOnly: () => <></>, + }; +}); +jest.mock('suricata-sid-db', () => { + return { + db: [], + }; +}); +jest.mock('react-beautiful-dnd', () => { + const original = jest.requireActual('react-beautiful-dnd'); + return { + ...original, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Droppable: ({ children }: { children: any }) => + children( + { + draggableProps: { + style: {}, + }, + innerRef: jest.fn(), + }, + {} + ), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Draggable: ({ children }: { children: any }) => + children( + { + draggableProps: { + style: {}, + }, + innerRef: jest.fn(), + }, + {} + ), + DraggableProvided: () => <></>, + DraggableStateSnapshot: () => <></>, + DraggingStyle: () => <></>, + NotDraggingStyle: () => <></>, + }; +}); + +describe('Body', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const getWrapper = async (childrenComponent: JSX.Element, store?: any) => { + const wrapper = mount(childrenComponent, { + wrappingComponent: TestProviders, + wrappingComponentProps: store ?? {}, + }); + await waitFor(() => wrapper.find('[data-test-subj="suricataRefs"]').exists()); + return wrapper; + }; const mockRefetch = jest.fn(); let appToastsMock: jest.Mocked<ReturnType<typeof useAppToastsMock.create>>; @@ -145,8 +198,8 @@ describe.skip('Body', () => { const props: Props = { activePage: 0, browserFields: mockBrowserFields, - data: mockTimelineData, - id: 'timeline-test', + data: [mockTimelineData[0]], + id: TimelineId.test, refetch: mockRefetch, renderCellValue: DefaultCellRenderer, rowRenderers: defaultRowRenderers, @@ -162,58 +215,58 @@ describe.skip('Body', () => { mockDispatch.mockClear(); }); - test('it renders the column headers', () => { - const wrapper = mount( - <TestProviders> - <StatefulBody {...props} /> - </TestProviders> - ); - + test('it renders the column headers', async () => { + const wrapper = await getWrapper(<StatefulBody {...props} />); expect(wrapper.find('[data-test-subj="column-headers"]').first().exists()).toEqual(true); }); - test('it renders the scroll container', () => { - const wrapper = mount( - <TestProviders> - <StatefulBody {...props} /> - </TestProviders> - ); - + test('it renders the scroll container', async () => { + const wrapper = await getWrapper(<StatefulBody {...props} />); expect(wrapper.find('[data-test-subj="timeline-body"]').first().exists()).toEqual(true); }); - test('it renders events', () => { - const wrapper = mount( - <TestProviders> - <StatefulBody {...props} /> - </TestProviders> - ); - + test('it renders events', async () => { + const wrapper = await getWrapper(<StatefulBody {...props} />); expect(wrapper.find('[data-test-subj="events"]').first().exists()).toEqual(true); }); test('it renders a tooltip for timestamp', async () => { + const { storage } = createSecuritySolutionStorageMock(); const headersJustTimestamp = defaultHeaders.filter((h) => h.id === '@timestamp'); - const testProps = { ...props, columnHeaders: headersJustTimestamp }; - const wrapper = mount( - <TestProviders> - <StatefulBody {...testProps} /> - </TestProviders> + const state: State = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + ...mockGlobalState.timeline.timelineById, + [TimelineId.test]: { + ...mockGlobalState.timeline.timelineById[TimelineId.test], + id: TimelineId.test, + columns: headersJustTimestamp, + }, + }, + }, + }; + + const store = createStore( + state, + SUB_PLUGINS_REDUCER, + { dataTable: tGridReducer }, + kibanaObservable, + storage ); - wrapper.update(); - await waitFor(() => { - wrapper.update(); - headersJustTimestamp.forEach(() => { - expect( - wrapper - .find('[data-test-subj="data-driven-columns"]') - .first() - .find('[data-test-subj="localized-date-tool-tip"]') - .exists() - ).toEqual(true); - }); + const wrapper = await getWrapper(<StatefulBody {...props} />, { store }); + + headersJustTimestamp.forEach(() => { + expect( + wrapper + .find('[data-test-subj="data-driven-columns"]') + .first() + .find('[data-test-subj="localized-date-tool-tip"]') + .exists() + ).toEqual(true); }); - }, 20000); + }); }); describe('action on event', () => { const addaNoteToEvent = (wrapper: ReturnType<typeof mount>, note: string) => { @@ -231,14 +284,11 @@ describe.skip('Body', () => { mockDispatch.mockClear(); }); - test('Add a note to an event', () => { - const wrapper = mount( - <TestProviders> - <StatefulBody {...props} /> - </TestProviders> - ); - addaNoteToEvent(wrapper, 'hello world'); + test('Add a note to an event', async () => { + const wrapper = await getWrapper(<StatefulBody {...props} />); + addaNoteToEvent(wrapper, 'hello world'); + wrapper.update(); expect(mockDispatch).toHaveBeenNthCalledWith( 3, expect.objectContaining({ @@ -263,7 +313,7 @@ describe.skip('Body', () => { ); }); - test('Add two notes to an event', () => { + test('Add two notes to an event', async () => { const { storage } = createSecuritySolutionStorageMock(); const state: State = { ...mockGlobalState, @@ -288,13 +338,10 @@ describe.skip('Body', () => { storage ); - const Proxy = (proxyProps: Props) => ( - <TestProviders store={store}> - <StatefulBody {...proxyProps} /> - </TestProviders> - ); + const Proxy = (proxyProps: Props) => <StatefulBody {...proxyProps} />; + + const wrapper = await getWrapper(<Proxy {...props} />, { store }); - const wrapper = mount(<Proxy {...props} />); addaNoteToEvent(wrapper, 'hello world'); mockDispatch.mockClear(); addaNoteToEvent(wrapper, 'new hello world'); @@ -328,11 +375,7 @@ describe.skip('Body', () => { mockDispatch.mockReset(); }); test('call the right reduce action to show event details for query tab', async () => { - const wrapper = mount( - <TestProviders> - <StatefulBody {...props} /> - </TestProviders> - ); + const wrapper = await getWrapper(<StatefulBody {...props} />); wrapper.find(`[data-test-subj="expand-event"]`).first().simulate('click'); wrapper.update(); @@ -353,11 +396,7 @@ describe.skip('Body', () => { }); test('call the right reduce action to show event details for pinned tab', async () => { - const wrapper = mount( - <TestProviders> - <StatefulBody {...props} tabType={TimelineTabs.pinned} /> - </TestProviders> - ); + const wrapper = await getWrapper(<StatefulBody {...props} tabType={TimelineTabs.pinned} />); wrapper.find(`[data-test-subj="expand-event"]`).first().simulate('click'); wrapper.update(); @@ -378,11 +417,7 @@ describe.skip('Body', () => { }); test('call the right reduce action to show event details for notes tab', async () => { - const wrapper = mount( - <TestProviders> - <StatefulBody {...props} tabType={TimelineTabs.notes} /> - </TestProviders> - ); + const wrapper = await getWrapper(<StatefulBody {...props} tabType={TimelineTabs.notes} />); wrapper.find(`[data-test-subj="expand-event"]`).first().simulate('click'); wrapper.update(); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx index 2ac4f756ffe2c..b8af8c0f09482 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx @@ -37,6 +37,21 @@ import * as i18n from './translations'; export const DEFAULT_CONTEXT_ID = 'alert-renderer'; +export const ALERT_RENDERER_FIELDS = [ + DESTINATION_IP, + DESTINATION_PORT, + EVENT_CATEGORY, + FILE_NAME, + HOST_NAME, + KIBANA_ALERT_RULE_NAME, + KIBANA_ALERT_SEVERITY, + PROCESS_NAME, + PROCESS_PARENT_NAME, + SOURCE_IP, + SOURCE_PORT, + USER_NAME, +]; + const AlertRendererFlexGroup = styled(EuiFlexGroup)` gap: ${({ theme }) => theme.eui.euiSizeXS}; `; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx index 10d196596b7ba..ea06fd70bbbf2 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { render, screen } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { shallow } from 'enzyme'; import { cloneDeep } from 'lodash'; import React from 'react'; @@ -48,6 +48,11 @@ describe('get_column_renderer', () => { let auditd: Ecs; const mount = useMountAppended(); + const getWrapper = async (childrenComponent: JSX.Element) => { + const wrapper = mount(childrenComponent); + await waitFor(() => wrapper.find('[data-test-subj="suricataRefs"]').exists()); + return wrapper; + }; beforeEach(() => { nonSuricata = cloneDeep(mockTimelineData[0].ecs); suricata = cloneDeep(mockTimelineData[2].ecs); @@ -68,14 +73,15 @@ describe('get_column_renderer', () => { expect(wrapper).toMatchSnapshot(); }); - test('should render plain row data when it is a non suricata row', () => { + test('should render plain row data when it is a non suricata row', async () => { const rowRenderer = getRowRenderer({ data: nonSuricata, rowRenderers: defaultRowRenderers }); const row = rowRenderer?.renderRow({ data: nonSuricata, isDraggable: true, scopeId: TimelineId.test, }); - const wrapper = mount( + + const wrapper = await getWrapper( <TestProviders> <span>{row}</span> </TestProviders> @@ -83,14 +89,14 @@ describe('get_column_renderer', () => { expect(wrapper.text()).toEqual(''); }); - test('should render a suricata row data when it is a suricata row', () => { + test('should render a suricata row data when it is a suricata row', async () => { const rowRenderer = getRowRenderer({ data: suricata, rowRenderers: defaultRowRenderers }); const row = rowRenderer?.renderRow({ data: suricata, isDraggable: true, scopeId: TimelineId.test, }); - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <span>{row}</span> </TestProviders> @@ -100,7 +106,7 @@ describe('get_column_renderer', () => { ); }); - test('should render a suricata row data if event.category is network_traffic', () => { + test('should render a suricata row data if event.category is network_traffic', async () => { suricata.event = { ...suricata.event, ...{ category: ['network_traffic'] } }; const rowRenderer = getRowRenderer({ data: suricata, rowRenderers: defaultRowRenderers }); const row = rowRenderer?.renderRow({ @@ -108,7 +114,7 @@ describe('get_column_renderer', () => { isDraggable: true, scopeId: TimelineId.test, }); - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <span>{row}</span> </TestProviders> @@ -118,7 +124,7 @@ describe('get_column_renderer', () => { ); }); - test('should render a zeek row data if event.category is network_traffic', () => { + test('should render a zeek row data if event.category is network_traffic', async () => { zeek.event = { ...zeek.event, ...{ category: ['network_traffic'] } }; const rowRenderer = getRowRenderer({ data: zeek, rowRenderers: defaultRowRenderers }); const row = rowRenderer?.renderRow({ @@ -126,7 +132,7 @@ describe('get_column_renderer', () => { isDraggable: true, scopeId: TimelineId.test, }); - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <span>{row}</span> </TestProviders> @@ -136,7 +142,7 @@ describe('get_column_renderer', () => { ); }); - test('should render a system row data if event.category is network_traffic', () => { + test('should render a system row data if event.category is network_traffic', async () => { system.event = { ...system.event, ...{ category: ['network_traffic'] } }; const rowRenderer = getRowRenderer({ data: system, rowRenderers: defaultRowRenderers }); const row = rowRenderer?.renderRow({ @@ -144,7 +150,7 @@ describe('get_column_renderer', () => { isDraggable: true, scopeId: TimelineId.test, }); - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <span>{row}</span> </TestProviders> @@ -154,7 +160,7 @@ describe('get_column_renderer', () => { ); }); - test('should render a auditd row data if event.category is network_traffic', () => { + test('should render a auditd row data if event.category is network_traffic', async () => { auditd.event = { ...auditd.event, ...{ category: ['network_traffic'] } }; const rowRenderer = getRowRenderer({ data: auditd, rowRenderers: defaultRowRenderers }); const row = rowRenderer?.renderRow({ @@ -162,7 +168,7 @@ describe('get_column_renderer', () => { isDraggable: true, scopeId: TimelineId.test, }); - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <span>{row}</span> </TestProviders> diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap index ad1cff9cdee67..4d54f7b8fb796 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap @@ -2,7 +2,12 @@ exports[`netflowRowRenderer renders correctly against snapshot 1`] = ` <DocumentFragment> - .c0 { + .c15 svg { + position: relative; + top: -1px; +} + +.c0 { display: inline-block; font-size: 12px; line-height: 1.5; @@ -16,11 +21,6 @@ exports[`netflowRowRenderer renders correctly against snapshot 1`] = ` border-radius: 4px; } -.c15 svg { - position: relative; - top: -1px; -} - .c13, .c13 * { display: inline-block; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx index 2a4e82a183999..38155bad81a83 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx @@ -14,6 +14,7 @@ import '../../../../../../common/mock/match_media'; import { TestProviders } from '../../../../../../common/mock/test_providers'; import { useMountAppended } from '../../../../../../common/utils/use_mount_appended'; import { SuricataDetails } from './suricata_details'; +import { waitFor } from '@testing-library/react'; jest.mock('../../../../../../common/lib/kibana'); @@ -30,14 +31,19 @@ jest.mock('../../../../../../common/components/link_to'); describe('SuricataDetails', () => { const mount = useMountAppended(); + const getWrapper = async (childrenComponent: JSX.Element) => { + const wrapper = mount(childrenComponent); + await waitFor(() => wrapper.find('[data-test-subj="suricataRefs"]').exists()); // check for presence of query input + return wrapper; + }; describe('rendering', () => { test('it renders the default SuricataDetails', () => { const wrapper = shallow(<SuricataDetails data={mockTimelineData[2].ecs} timelineId="test" />); expect(wrapper).toMatchSnapshot(); }); - test('it returns text if the data does contain suricata data', () => { - const wrapper = mount( + test('it returns text if the data does contain suricata data', async () => { + const wrapper = await getWrapper( <TestProviders> <SuricataDetails data={mockTimelineData[2].ecs} timelineId="test" /> </TestProviders> diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_refs.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_refs.tsx index 2300bcfaa5bc2..602ca3ebbd577 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_refs.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_refs.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; -import React from 'react'; +import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; import { getLinksFromSignature } from './suricata_links'; @@ -18,21 +18,41 @@ const LinkEuiFlexItem = styled(EuiFlexItem)` LinkEuiFlexItem.displayName = 'LinkEuiFlexItem'; export const SuricataRefs = React.memo<{ signatureId: number }>(({ signatureId }) => { - let comp = <></>; - getLinksFromSignature(signatureId).then((links) => { - comp = ( - <EuiFlexGroup gutterSize="none" justifyContent="center" wrap> - {links.map((link) => ( + const [linksFromSignature, setLinksFromSignature] = useState<string[] | undefined>(undefined); + useEffect(() => { + let isSubscribed = true; + async function getLinks() { + if (signatureId != null) { + try { + const links = await getLinksFromSignature(signatureId); + if (isSubscribed && links != null) { + setLinksFromSignature(links); + } + } catch (exc) { + setLinksFromSignature(undefined); + } + } else if (isSubscribed) { + setLinksFromSignature(undefined); + } + } + getLinks(); + return () => { + isSubscribed = false; + }; + }, [signatureId]); + + return ( + <EuiFlexGroup data-test-subj="suricataRefs" gutterSize="none" justifyContent="center" wrap> + {linksFromSignature && + linksFromSignature.map((link) => ( <LinkEuiFlexItem key={link} grow={false}> <EuiLink href={link} color="subdued" target="_blank"> {link} </EuiLink> </LinkEuiFlexItem> ))} - </EuiFlexGroup> - ); - }); - return comp; + </EuiFlexGroup> + ); }); SuricataRefs.displayName = 'SuricataRefs'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx index 833fd2cff9666..67fb4fe5dfce8 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx @@ -8,6 +8,7 @@ import { shallow } from 'enzyme'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; +import { waitFor } from '@testing-library/react'; import { removeExternalLinkText } from '@kbn/securitysolution-io-ts-utils'; import type { Ecs } from '../../../../../../../common/ecs'; @@ -31,16 +32,22 @@ jest.mock('@elastic/eui', () => { jest.mock('../../../../../../common/components/link_to'); describe('suricata_row_renderer', () => { - const mount = useMountAppended(); let nonSuricata: Ecs; let suricata: Ecs; + const mount = useMountAppended(); + + const getWrapper = async (childrenComponent: JSX.Element) => { + const wrapper = mount(childrenComponent); + await waitFor(() => wrapper.find('[data-test-subj="suricataRefs"]').exists()); + return wrapper; + }; beforeEach(() => { nonSuricata = cloneDeep(mockTimelineData[0].ecs); suricata = cloneDeep(mockTimelineData[2].ecs); }); - test('renders correctly against snapshot', () => { + test('renders correctly against snapshot', async () => { const children = suricataRowRenderer.renderRow({ data: nonSuricata, isDraggable: true, @@ -59,13 +66,14 @@ describe('suricata_row_renderer', () => { expect(suricataRowRenderer.isInstance(suricata)).toBe(true); }); - test('should render a suricata row', () => { + test('should render a suricata row', async () => { const children = suricataRowRenderer.renderRow({ data: suricata, isDraggable: true, scopeId: TimelineId.test, }); - const wrapper = mount( + + const wrapper = await getWrapper( <TestProviders> <span>{children}</span> </TestProviders> @@ -80,14 +88,14 @@ describe('suricata_row_renderer', () => { ); }); - test('should render a suricata row even if it does not have a suricata signature', () => { + test('should render a suricata row even if it does not have a suricata signature', async () => { delete suricata?.suricata?.eve?.alert?.signature; const children = suricataRowRenderer.renderRow({ data: suricata, isDraggable: true, scopeId: TimelineId.test, }); - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <span>{children}</span> </TestProviders> diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/index.test.tsx index ddcc2df231a00..e27871d4c9018 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/index.test.tsx @@ -11,6 +11,7 @@ import { TestProviders } from '../../../../common/mock/test_providers'; import { useMountAppended } from '../../../../common/utils/use_mount_appended'; import { DataProviders } from '.'; +import { TimelineId } from '../../../../../common/types'; describe('DataProviders', () => { const mount = useMountAppended(); @@ -54,7 +55,7 @@ describe('DataProviders', () => { test('it may be resized vertically via a resize handle', () => { const wrapper = mount( <TestProviders> - <DataProviders timelineId="test" /> + <DataProviders timelineId={TimelineId.test} /> </TestProviders> ); @@ -67,7 +68,7 @@ describe('DataProviders', () => { test('it never grows taller than one third (33%) of the view height', () => { const wrapper = mount( <TestProviders> - <DataProviders timelineId="test" /> + <DataProviders timelineId={TimelineId.test} /> </TestProviders> ); @@ -80,7 +81,7 @@ describe('DataProviders', () => { test('it automatically displays scroll bars when the width or height of the data providers exceeds the drop target', () => { const wrapper = mount( <TestProviders> - <DataProviders timelineId="test" /> + <DataProviders timelineId={TimelineId.test} /> </TestProviders> ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/header/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/header/index.test.tsx index 196c2655e6ab0..eeb383f6a2298 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/header/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/header/index.test.tsx @@ -17,6 +17,7 @@ import { useMountAppended } from '../../../../common/utils/use_mount_appended'; import { TimelineHeader } from '.'; import { TimelineStatus, TimelineType } from '../../../../../common/types/timeline'; +import { waitFor } from '@testing-library/react'; const mockUiSettingsForFilterManager = coreMock.createStart().uiSettings; @@ -25,6 +26,11 @@ jest.mock('../../../../common/lib/kibana'); describe('Header', () => { const indexPattern = mockIndexPattern; const mount = useMountAppended(); + const getWrapper = async (childrenComponent: JSX.Element) => { + const wrapper = mount(childrenComponent); + await waitFor(() => wrapper.find('[data-test-subj="timelineCallOutUnauthorized"]').exists()); + return wrapper; + }; const props = { browserFields: {}, dataProviders: mockDataProviders, @@ -48,9 +54,9 @@ describe('Header', () => { expect(wrapper).toMatchSnapshot(); }); - test('it renders the data providers when show is true', () => { + test('it renders the data providers when show is true', async () => { const testProps = { ...props, show: true }; - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <TimelineHeader {...testProps} /> </TestProviders> @@ -59,14 +65,14 @@ describe('Header', () => { expect(wrapper.find('[data-test-subj="dataProviders"]').exists()).toEqual(true); }); - test('it renders the unauthorized call out providers', () => { + test('it renders the unauthorized call out providers', async () => { const testProps = { ...props, filterManager: new FilterManager(mockUiSettingsForFilterManager), showCallOutUnauthorizedMsg: true, }; - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <TimelineHeader {...testProps} /> </TestProviders> @@ -75,14 +81,14 @@ describe('Header', () => { expect(wrapper.find('[data-test-subj="timelineCallOutUnauthorized"]').exists()).toEqual(true); }); - test('it renders the unauthorized call out with correct icon', () => { + test('it renders the unauthorized call out with correct icon', async () => { const testProps = { ...props, filterManager: new FilterManager(mockUiSettingsForFilterManager), showCallOutUnauthorizedMsg: true, }; - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <TimelineHeader {...testProps} /> </TestProviders> @@ -93,14 +99,14 @@ describe('Header', () => { ).toEqual('alert'); }); - test('it renders the unauthorized call out with correct message', () => { + test('it renders the unauthorized call out with correct message', async () => { const testProps = { ...props, filterManager: new FilterManager(mockUiSettingsForFilterManager), showCallOutUnauthorizedMsg: true, }; - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <TimelineHeader {...testProps} /> </TestProviders> @@ -113,7 +119,7 @@ describe('Header', () => { ); }); - test('it renders the immutable timeline call out providers', () => { + test('it renders the immutable timeline call out providers', async () => { const testProps = { ...props, filterManager: new FilterManager(mockUiSettingsForFilterManager), @@ -121,7 +127,7 @@ describe('Header', () => { status: TimelineStatus.immutable, }; - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <TimelineHeader {...testProps} /> </TestProviders> @@ -130,7 +136,7 @@ describe('Header', () => { expect(wrapper.find('[data-test-subj="timelineImmutableCallOut"]').exists()).toEqual(true); }); - test('it renders the immutable timeline call out with correct icon', () => { + test('it renders the immutable timeline call out with correct icon', async () => { const testProps = { ...props, filterManager: new FilterManager(mockUiSettingsForFilterManager), @@ -138,7 +144,7 @@ describe('Header', () => { status: TimelineStatus.immutable, }; - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <TimelineHeader {...testProps} /> </TestProviders> @@ -149,7 +155,7 @@ describe('Header', () => { ).toEqual('alert'); }); - test('it renders the immutable timeline call out with correct message', () => { + test('it renders the immutable timeline call out with correct message', async () => { const testProps = { ...props, filterManager: new FilterManager(mockUiSettingsForFilterManager), @@ -157,7 +163,7 @@ describe('Header', () => { status: TimelineStatus.immutable, }; - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <TimelineHeader {...testProps} /> </TestProviders> diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx index 4926b11cd9b13..ff129689fb5f9 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx @@ -14,7 +14,7 @@ import { AddToFavoritesButton, NewTimeline } from './helpers'; import { useCreateTimelineButton } from './use_create_timeline'; import { kibanaObservable, TestProviders } from '../../../../common/mock/test_providers'; import { timelineActions } from '../../../store/timeline'; -import { TimelineStatus, TimelineType } from '../../../../../common/types/timeline'; +import { TimelineId, TimelineStatus, TimelineType } from '../../../../../common/types/timeline'; import { createSecuritySolutionStorageMock, mockGlobalState, @@ -100,7 +100,7 @@ describe('Favorite Button', () => { test('should render favorite button', () => { const wrapper = mount( <TestProviders> - <AddToFavoritesButton timelineId="test" /> + <AddToFavoritesButton timelineId={TimelineId.test} /> </TestProviders> ); @@ -110,7 +110,7 @@ describe('Favorite Button', () => { test('Favorite button should be enabled ', () => { const wrapper = mount( <TestProviders> - <AddToFavoritesButton timelineId="test" /> + <AddToFavoritesButton timelineId={TimelineId.test} /> </TestProviders> ); @@ -123,7 +123,7 @@ describe('Favorite Button', () => { const spy = jest.spyOn(timelineActions, 'updateIsFavorite'); const wrapper = mount( <TestProviders> - <AddToFavoritesButton timelineId="test" /> + <AddToFavoritesButton timelineId={TimelineId.test} /> </TestProviders> ); @@ -142,8 +142,8 @@ describe('Favorite Button', () => { timeline: { ...mockGlobalState.timeline, timelineById: { - test: { - ...mockGlobalState.timeline.timelineById.test, + [TimelineId.test]: { + ...mockGlobalState.timeline.timelineById[TimelineId.test], isFavorite: true, }, }, @@ -156,7 +156,7 @@ describe('Favorite Button', () => { ); const wrapper = mount( <TestProviders store={store}> - <AddToFavoritesButton timelineId="test" /> + <AddToFavoritesButton timelineId={TimelineId.test} /> </TestProviders> ); @@ -176,8 +176,8 @@ describe('Favorite Button', () => { timeline: { ...mockGlobalState.timeline, timelineById: { - test: { - ...mockGlobalState.timeline.timelineById.test, + [TimelineId.test]: { + ...mockGlobalState.timeline.timelineById[TimelineId.test], status: TimelineStatus.immutable, timelineType: TimelineType.template, templateTimelineId: 'mock-template-timeline-id', @@ -193,7 +193,7 @@ describe('Favorite Button', () => { ); const wrapper = mount( <TestProviders store={store}> - <AddToFavoritesButton timelineId="test" /> + <AddToFavoritesButton timelineId={TimelineId.test} /> </TestProviders> ); expect( @@ -212,8 +212,8 @@ describe('Favorite Button', () => { timeline: { ...mockGlobalState.timeline, timelineById: { - test: { - ...mockGlobalState.timeline.timelineById.test, + [TimelineId.test]: { + ...mockGlobalState.timeline.timelineById[TimelineId.test], status: TimelineStatus.active, timelineType: TimelineType.template, templateTimelineId: 'mock-template-timeline-id', diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx index 7c83007858ae0..f3d5b61e91292 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx @@ -20,11 +20,13 @@ import { inputsActions, inputsSelectors } from '../../../../common/store/inputs' import { sourcererActions, sourcererSelectors } from '../../../../common/store/sourcerer'; import { SourcererScopeName } from '../../../../common/store/sourcerer/model'; import { appActions } from '../../../../common/store/app'; +import type { TimeRange } from '../../../../common/store/inputs/model'; interface Props { timelineId?: string; timelineType: TimelineTypeLiteral; closeGearMenu?: () => void; + timeRange?: TimeRange; } export const useCreateTimeline = ({ timelineId, timelineType, closeGearMenu }: Props) => { @@ -35,8 +37,11 @@ export const useCreateTimeline = ({ timelineId, timelineType, closeGearMenu }: P const { timelineFullScreen, setTimelineFullScreen } = useTimelineFullScreen(); const globalTimeRange = useDeepEqualSelector(inputsSelectors.globalTimeRangeSelector); + const createTimeline = useCallback( - ({ id, show }) => { + ({ id, show, timeRange: timeRangeParam }) => { + const timerange = timeRangeParam ?? globalTimeRange; + if (id === TimelineId.active && timelineFullScreen) { setTimelineFullScreen(false); } @@ -66,17 +71,22 @@ export const useCreateTimeline = ({ timelineId, timelineType, closeGearMenu }: P ); dispatch(inputsActions.addLinkTo([InputsModelId.global, InputsModelId.timeline])); dispatch(appActions.addNotes({ notes: [] })); - if (globalTimeRange.kind === 'absolute') { + + if (timeRangeParam) { + dispatch(inputsActions.removeLinkTo([InputsModelId.timeline, InputsModelId.global])); + } + + if (timerange.kind === 'absolute') { dispatch( inputsActions.setAbsoluteRangeDatePicker({ - ...globalTimeRange, + ...timerange, id: InputsModelId.timeline, }) ); - } else if (globalTimeRange.kind === 'relative') { + } else if (timerange.kind === 'relative') { dispatch( inputsActions.setRelativeRangeDatePicker({ - ...globalTimeRange, + ...timerange, id: InputsModelId.timeline, }) ); @@ -93,16 +103,23 @@ export const useCreateTimeline = ({ timelineId, timelineType, closeGearMenu }: P ] ); - const handleCreateNewTimeline = useCallback(() => { - createTimeline({ id: timelineId, show: true, timelineType }); - if (typeof closeGearMenu === 'function') { - closeGearMenu(); - } - }, [createTimeline, timelineId, timelineType, closeGearMenu]); + const handleCreateNewTimeline = useCallback( + (options?: CreateNewTimelineOptions) => { + createTimeline({ id: timelineId, show: true, timelineType, timeRange: options?.timeRange }); + if (typeof closeGearMenu === 'function') { + closeGearMenu(); + } + }, + [createTimeline, timelineId, timelineType, closeGearMenu] + ); return handleCreateNewTimeline; }; +interface CreateNewTimelineOptions { + timeRange?: TimeRange; +} + export const useCreateTimelineButton = ({ timelineId, timelineType, closeGearMenu }: Props) => { const handleCreateNewTimeline = useCreateTimeline({ timelineId, @@ -126,7 +143,7 @@ export const useCreateTimelineButton = ({ timelineId, timelineType, closeGearMen }) => { const buttonProps = { iconType, - onClick: handleCreateNewTimeline, + onClick: () => handleCreateNewTimeline(), fill, }; const dataTestSubjPrefix = diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.test.tsx index cc48a58717eee..c53360cb9168c 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.test.tsx @@ -28,6 +28,7 @@ import { mockSourcererScope } from '../../../../common/containers/sourcerer/mock import { Direction } from '../../../../../common/search_strategy'; import { mockCasesContext } from '@kbn/cases-plugin/public/mocks/mock_cases_context'; import * as helpers from '../../../../common/lib/kuery'; +import { waitFor } from '@testing-library/react'; jest.mock('../../../containers', () => ({ useTimelineEvents: jest.fn(), @@ -109,7 +110,11 @@ describe('Timeline', () => { const endDate = '2018-03-24T03:33:52.253Z'; const mount = useMountAppended(); - + const getWrapper = async (childrenComponent: JSX.Element) => { + const wrapper = mount(childrenComponent); + await waitFor(() => wrapper.find('[data-test-subj="timelineHeader"]').exists()); + return wrapper; + }; beforeEach(() => { (useTimelineEvents as jest.Mock).mockReturnValue([ false, @@ -162,8 +167,8 @@ describe('Timeline', () => { spyCombineQueries.mockClear(); }); - test('should trim kqlQueryExpression', () => { - mount( + test('should trim kqlQueryExpression', async () => { + await getWrapper( <TestProviders> <QueryTabContentComponent {...props} /> </TestProviders> @@ -184,8 +189,8 @@ describe('Timeline', () => { expect(wrapper.find('QueryTabContentComponent')).toMatchSnapshot(); }); - test('it renders the timeline header', () => { - const wrapper = mount( + test('it renders the timeline header', async () => { + const wrapper = await getWrapper( <TestProviders> <QueryTabContentComponent {...props} /> </TestProviders> @@ -194,8 +199,8 @@ describe('Timeline', () => { expect(wrapper.find('[data-test-subj="timelineHeader"]').exists()).toEqual(true); }); - test('it renders the timeline table', () => { - const wrapper = mount( + test('it renders the timeline table', async () => { + const wrapper = await getWrapper( <TestProviders> <QueryTabContentComponent {...props} /> </TestProviders> @@ -206,7 +211,7 @@ describe('Timeline', () => { ).toEqual(true); }); - test('it does render the timeline table when the source is loading with no events', () => { + test('it does render the timeline table when the source is loading with no events', async () => { (useSourcererDataView as jest.Mock).mockReturnValue({ browserFields: {}, loading: true, @@ -214,7 +219,7 @@ describe('Timeline', () => { selectedPatterns: [], missingPatterns: [], }); - const wrapper = mount( + const wrapper = await getWrapper( <TestProviders> <QueryTabContentComponent {...props} /> </TestProviders> @@ -226,8 +231,8 @@ describe('Timeline', () => { expect(wrapper.find('[data-test-subj="events"]').exists()).toEqual(false); }); - test('it does NOT render the timeline table when start is empty', () => { - const wrapper = mount( + test('it does NOT render the timeline table when start is empty', async () => { + const wrapper = await getWrapper( <TestProviders> <QueryTabContentComponent {...props} start={''} /> </TestProviders> @@ -239,8 +244,8 @@ describe('Timeline', () => { expect(wrapper.find('[data-test-subj="events"]').exists()).toEqual(false); }); - test('it does NOT render the timeline table when end is empty', () => { - const wrapper = mount( + test('it does NOT render the timeline table when end is empty', async () => { + const wrapper = await getWrapper( <TestProviders> <QueryTabContentComponent {...props} end={''} /> </TestProviders> @@ -252,8 +257,8 @@ describe('Timeline', () => { expect(wrapper.find('[data-test-subj="events"]').exists()).toEqual(false); }); - test('it does NOT render the paging footer when you do NOT have any data providers', () => { - const wrapper = mount( + test('it does NOT render the paging footer when you do NOT have any data providers', async () => { + const wrapper = await getWrapper( <TestProviders> <QueryTabContentComponent {...props} /> </TestProviders> @@ -262,8 +267,8 @@ describe('Timeline', () => { expect(wrapper.find('[data-test-subj="table-pagination"]').exists()).toEqual(false); }); - it('it shows the timeline footer', () => { - const wrapper = mount( + it('it shows the timeline footer', async () => { + const wrapper = await getWrapper( <TestProviders> <QueryTabContentComponent {...props} /> </TestProviders> diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.test.tsx index 773790b4da652..b24663b81122b 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.test.tsx @@ -71,12 +71,12 @@ jest.mock('../../../../common/lib/kibana', () => { }), }; }); -const mockDetails = () => {}; +const mockOpenDetailFn = jest.fn(); jest.mock('../../side_panel/hooks/use_detail_panel', () => { return { useDetailPanel: () => ({ - openDetailsPanel: mockDetails, + openEventDetailsPanel: mockOpenDetailFn, handleOnDetailsPanelClosed: () => {}, DetailsPanel: () => <div />, shouldShowDetailsPanel: false, @@ -161,7 +161,8 @@ describe('useSessionView with active timeline and a session id and graph event i expect(kibana.services.sessionView.getSessionView).toHaveBeenCalledWith({ height: 1000, sessionEntityId: 'test', - loadAlertDetails: mockDetails, + loadAlertDetails: mockOpenDetailFn, + canAccessEndpointManagement: false, }); }); @@ -240,7 +241,7 @@ describe('useSessionView with active timeline and a session id and graph event i ); expect(kibana.services.sessionView.getSessionView).toHaveBeenCalled(); - expect(result.current).toHaveProperty('openDetailsPanel'); + expect(result.current).toHaveProperty('openEventDetailsPanel'); expect(result.current).toHaveProperty('shouldShowDetailsPanel'); expect(result.current).toHaveProperty('SessionView'); expect(result.current).toHaveProperty('DetailsPanel'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.tsx index 8b5add5ae73b1..6015477624d82 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.tsx @@ -34,6 +34,7 @@ import { useGlobalFullScreen, } from '../../../../common/containers/use_full_screen'; import { detectionsTimelineIds } from '../../../containers/helpers'; +import { useUserPrivileges } from '../../../../common/components/user_privileges'; import { timelineActions, timelineSelectors } from '../../../store/timeline'; import { timelineDefaults } from '../../../store/timeline/defaults'; import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; @@ -266,6 +267,7 @@ export const useSessionView = ({ }, [scopeId]); const { globalFullScreen } = useGlobalFullScreen(); const { timelineFullScreen } = useTimelineFullScreen(); + const { canAccessEndpointManagement } = useUserPrivileges().endpointPrivileges; const defaults = isTimelineScope(scopeId) ? timelineDefaults : tableDefaults; const { sessionViewConfig, activeTab } = useDeepEqualSelector((state) => ({ @@ -293,7 +295,7 @@ export const useSessionView = ({ return SourcererScopeName.default; } }, [scopeId]); - const { openDetailsPanel, shouldShowDetailsPanel, DetailsPanel } = useDetailPanel({ + const { openEventDetailsPanel, shouldShowDetailsPanel, DetailsPanel } = useDetailPanel({ isFlyoutView: !isActiveTimeline(scopeId), entityType, sourcererScope, @@ -307,15 +309,23 @@ export const useSessionView = ({ return sessionViewConfig !== null ? sessionView.getSessionView({ ...sessionViewConfig, - loadAlertDetails: openDetailsPanel, + loadAlertDetails: openEventDetailsPanel, isFullScreen: fullScreen, height: heightMinusSearchBar, + canAccessEndpointManagement, }) : null; - }, [fullScreen, openDetailsPanel, sessionView, sessionViewConfig, height]); + }, [ + height, + sessionViewConfig, + sessionView, + openEventDetailsPanel, + fullScreen, + canAccessEndpointManagement, + ]); return { - openDetailsPanel, + openEventDetailsPanel, shouldShowDetailsPanel, SessionView: sessionViewComponent, DetailsPanel, diff --git a/x-pack/plugins/security_solution/public/timelines/containers/details/index.tsx b/x-pack/plugins/security_solution/public/timelines/containers/details/index.tsx index ddb25b0c00372..0444510776d67 100644 --- a/x-pack/plugins/security_solution/public/timelines/containers/details/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/containers/details/index.tsx @@ -16,6 +16,7 @@ import { isCompleteResponse, isErrorResponse } from '@kbn/data-plugin/common'; import { EntityType } from '@kbn/timelines-plugin/common'; import { useKibana } from '../../../common/lib/kibana'; import type { + SearchHit, TimelineEventsDetailsItem, TimelineEventsDetailsRequestOptions, TimelineEventsDetailsStrategyResponse, @@ -47,7 +48,7 @@ export const useTimelineEventsDetails = ({ }: UseTimelineEventsDetailsProps): [ boolean, EventsArgs['detailsData'], - object | undefined, + SearchHit | undefined, EventsArgs['ecs'], () => Promise<void> ] => { @@ -56,7 +57,9 @@ export const useTimelineEventsDetails = ({ const refetch = useRef<() => Promise<void>>(asyncNoop); const abortCtrl = useRef(new AbortController()); const searchSubscription$ = useRef(new Subscription()); - const [loading, setLoading] = useState(false); + + // loading = false initial state causes flashes of empty tables + const [loading, setLoading] = useState(true); const [timelineDetailsRequest, setTimelineDetailsRequest] = useState<TimelineEventsDetailsRequestOptions | null>(null); const { addError, addWarning } = useAppToasts(); @@ -65,7 +68,7 @@ export const useTimelineEventsDetails = ({ useState<EventsArgs['detailsData']>(null); const [ecsData, setEcsData] = useState<EventsArgs['ecs']>(null); - const [rawEventData, setRawEventData] = useState<object | undefined>(undefined); + const [rawEventData, setRawEventData] = useState<SearchHit | undefined>(undefined); const timelineDetailsSearch = useCallback( (request: TimelineEventsDetailsRequestOptions | null) => { if (request == null || skip || isEmpty(request.eventId)) { diff --git a/x-pack/plugins/security_solution/public/types.ts b/x-pack/plugins/security_solution/public/types.ts index a5f8e5897230d..70a5de2c00af6 100644 --- a/x-pack/plugins/security_solution/public/types.ts +++ b/x-pack/plugins/security_solution/public/types.ts @@ -41,6 +41,7 @@ import type { } from '@kbn/saved-objects-tagging-oss-plugin/public'; import type { ThreatIntelligencePluginStart } from '@kbn/threat-intelligence-plugin/public'; import type { CloudExperimentsPluginStart } from '@kbn/cloud-experiments-plugin/common'; +import type { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; import type { ResolverPluginSetup } from './resolver/types'; import type { Inspect } from '../common/search_strategy'; import type { Detections } from './detections'; @@ -76,6 +77,7 @@ export interface StartPlugins { embeddable: EmbeddableStart; inspector: InspectorStart; fleet?: FleetStart; + guidedOnboarding: GuidedOnboardingPluginStart; kubernetesSecurity: KubernetesSecurityStart; lens: LensPublicStart; lists?: ListsPluginStart; diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts b/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts index 8daeae3a28767..c4113f0132c05 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts @@ -9,8 +9,8 @@ import type { KbnClient } from '@kbn/test'; import type { Client } from '@elastic/elasticsearch'; import { AGENT_ACTIONS_RESULTS_INDEX } from '@kbn/fleet-plugin/common'; import * as cborx from 'cbor-x'; +import { basename } from 'path'; import { getFileDownloadId } from '../../../../common/endpoint/service/response_actions/get_file_download_id'; -import type { UploadedFile } from '../../../../common/endpoint/types/file_storage'; import { checkInFleetAgent } from '../../common/fleet_services'; import { sendEndpointMetadataUpdate } from '../../common/endpoint_metadata_services'; import { FleetActionGenerator } from '../../../../common/endpoint/data_generators/fleet_action_generator'; @@ -133,6 +133,12 @@ export const sendEndpointActionResponse = async ( endpointResponse.error = { message: 'Endpoint encountered an error and was unable to apply action to host', }; + + if (endpointResponse.EndpointActions.data.command === 'get-file') { + ( + endpointResponse.EndpointActions.data.output?.content as ResponseActionGetFileOutputContent + ).code = endpointActionGenerator.randomGetFileFailureCode(); + } } await esClient.index({ @@ -181,29 +187,52 @@ export const sendEndpointActionResponse = async ( // For `get-file`, upload a file to ES if (action.command === 'get-file' && !endpointResponse.error) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const filePath = ( + action as ActionDetails<ResponseActionGetFileOutputContent, ResponseActionGetFileParameters> + )?.parameters?.path!; + + const fileName = basename(filePath.replace(/\\/g, '/')); + // Index the file's metadata - const fileMeta = await esClient.index<UploadedFile>({ + const fileMeta = await esClient.index({ index: FILE_STORAGE_METADATA_INDEX, id: getFileDownloadId(action, action.agents[0]), body: { + action_id: action.id, + agent_id: action.agents[0], + contents: [ + { + hash: { + sha256: '8d61673c9d782297b3c774ded4e3d88f31a8869a8f25cf5cdd402ba6822d1d28', + }, + name: fileName ?? 'bad_file.txt', + path: filePath, + size: 4, + type: 'file', + }, + ], file: { - created: new Date().toISOString(), - extension: 'zip', - path: '/some/path/bad_file.txt', - type: 'file', - size: 221, - name: 'bad_file.txt.zip', + attributes: ['archive', 'compressed'], + ChunkSize: 4194304, + Compression: 'deflate', + hash: { + sha256: '8d61673c9d782297b3c774ded4e3d88f31a8869a8f25cf5cdd402ba6822d1d28', + }, mime_type: 'application/zip', + name: 'upload.zip', + size: 125, Status: 'READY', - ChunkSize: 4194304, + type: 'file', }, + source: 'endpoint', }, refresh: 'wait_for', }); // Index the file content (just one chunk) // call to `.index()` copied from File plugin here: - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts#L195 + // https://github.com/elastic/kibana/blob/main/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts#L195 await esClient.index( { index: FILE_STORAGE_DATA_INDEX, diff --git a/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts b/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts index 6b6baf163dc90..21c083ac77129 100644 --- a/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts +++ b/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts @@ -167,7 +167,7 @@ export class EndpointAppContextService { public async getEndpointAuthz(request: KibanaRequest): Promise<EndpointAuthz> { const fleetAuthz = await this.getFleetAuthzService().fromRequest(request); const userRoles = this.security?.authc.getCurrentUser(request)?.roles ?? []; - const isEndpointRbacEnabled = this.experimentalFeatures.endpointRbacEnabled; + const { endpointRbacEnabled, endpointRbacV1Enabled } = this.experimentalFeatures; let endpointPermissions = defaultEndpointPermissions(); if (this.security) { @@ -185,7 +185,7 @@ export class EndpointAppContextService { this.getLicenseService(), fleetAuthz, userRoles, - isEndpointRbacEnabled, + endpointRbacEnabled || endpointRbacV1Enabled, endpointPermissions ); } diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.test.ts new file mode 100644 index 0000000000000..fa3c7e392d91e --- /dev/null +++ b/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.test.ts @@ -0,0 +1,141 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getActionDetailsById as _getActionDetailsById } from '../../services'; +import type { HttpApiTestSetupMock } from '../../mocks'; +import { createHttpApiTestSetupMock } from '../../mocks'; +import type { EndpointActionFileDownloadParams } from '../../../../common/endpoint/schema/actions'; +import { getActionFileInfoRouteHandler, registerActionFileInfoRoute } from './file_info_handler'; +import { ACTION_AGENT_FILE_INFO_ROUTE } from '../../../../common/endpoint/constants'; +import { EndpointAuthorizationError, NotFoundError } from '../../errors'; +import type { ActionDetails } from '../../../../common/endpoint/types'; +import { EndpointActionGenerator } from '../../../../common/endpoint/data_generators/endpoint_action_generator'; +import { getFileInfo as _getFileInfo } from '../../services/actions/action_files'; +import { CustomHttpRequestError } from '../../../utils/custom_http_request_error'; + +jest.mock('../../services'); +jest.mock('../../services/actions/action_files'); + +describe('Response Action file info API', () => { + const getActionDetailsById = _getActionDetailsById as jest.Mock; + const getFileInfo = _getFileInfo as jest.Mock; + + let apiTestSetup: HttpApiTestSetupMock; + let httpRequestMock: ReturnType< + HttpApiTestSetupMock<EndpointActionFileDownloadParams>['createRequestMock'] + >; + let httpHandlerContextMock: HttpApiTestSetupMock<EndpointActionFileDownloadParams>['httpHandlerContextMock']; + let httpResponseMock: HttpApiTestSetupMock<EndpointActionFileDownloadParams>['httpResponseMock']; + + beforeEach(() => { + apiTestSetup = createHttpApiTestSetupMock<EndpointActionFileDownloadParams>(); + + ({ httpHandlerContextMock, httpResponseMock } = apiTestSetup); + httpRequestMock = apiTestSetup.createRequestMock({ + params: { action_id: '111', agent_id: '222' }, + }); + }); + + describe('#registerActionFileInfoRoute()', () => { + beforeEach(() => { + registerActionFileInfoRoute(apiTestSetup.routerMock, apiTestSetup.endpointAppContextMock); + }); + + it('should register the route', () => { + expect( + apiTestSetup.getRegisteredRouteHandler('get', ACTION_AGENT_FILE_INFO_ROUTE) + ).toBeDefined(); + }); + + it('should error if user has no authz to api', async () => { + const authz = (await httpHandlerContextMock.securitySolution).endpointAuthz; + authz.canWriteFileOperations = false; + + await apiTestSetup.getRegisteredRouteHandler('get', ACTION_AGENT_FILE_INFO_ROUTE)( + httpHandlerContextMock, + httpRequestMock, + httpResponseMock + ); + + expect(httpResponseMock.forbidden).toHaveBeenCalledWith({ + body: expect.any(EndpointAuthorizationError), + }); + }); + }); + + describe('Route handler', () => { + let fileInfoHandler: ReturnType<typeof getActionFileInfoRouteHandler>; + let esClientMock: ReturnType<HttpApiTestSetupMock['getEsClientMock']>; + let action: ActionDetails; + + beforeEach(() => { + esClientMock = apiTestSetup.getEsClientMock(); + action = new EndpointActionGenerator().generateActionDetails({ + id: '111', + agents: ['222'], + }); + fileInfoHandler = getActionFileInfoRouteHandler(apiTestSetup.endpointAppContextMock); + + getActionDetailsById.mockImplementation(async () => { + return action; + }); + + getFileInfo.mockImplementation(async () => { + return { + created: '2022-10-10T14:57:30.682Z', + id: '123', + mimeType: 'text/plain', + name: 'test.txt', + size: 1234, + status: 'READY', + }; + }); + }); + + it('should error if action ID is invalid', async () => { + getActionDetailsById.mockImplementationOnce(async () => { + throw new NotFoundError('not found'); + }); + await fileInfoHandler(httpHandlerContextMock, httpRequestMock, httpResponseMock); + + expect(httpResponseMock.notFound).toHaveBeenCalled(); + }); + + it('should error if agent id is not in the action', async () => { + action.agents = ['333']; + await fileInfoHandler(httpHandlerContextMock, httpRequestMock, httpResponseMock); + + expect(httpResponseMock.customError).toHaveBeenCalledWith({ + statusCode: 400, + body: expect.any(CustomHttpRequestError), + }); + }); + + it('should retrieve the file info with correct file id', async () => { + await fileInfoHandler(httpHandlerContextMock, httpRequestMock, httpResponseMock); + + expect(getFileInfo).toHaveBeenCalledWith(esClientMock, expect.anything(), '111.222'); + }); + + it('should respond with expected output', async () => { + await fileInfoHandler(httpHandlerContextMock, httpRequestMock, httpResponseMock); + + expect(httpResponseMock.ok).toHaveBeenCalledWith({ + body: { + data: { + created: '2022-10-10T14:57:30.682Z', + id: '123', + mimeType: 'text/plain', + name: 'test.txt', + size: 1234, + status: 'READY', + }, + }, + }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts b/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts new file mode 100644 index 0000000000000..e8290d1c3d3b1 --- /dev/null +++ b/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { RequestHandler } from '@kbn/core/server'; +import { getFileInfo } from '../../services/actions/action_files'; +import { getActionDetailsById } from '../../services'; +import { ACTION_AGENT_FILE_INFO_ROUTE } from '../../../../common/endpoint/constants'; +import type { EndpointAppContext } from '../../types'; +import type { EndpointActionFileInfoParams } from '../../../../common/endpoint/schema/actions'; +import type { + SecuritySolutionRequestHandlerContext, + SecuritySolutionPluginRouter, +} from '../../../types'; +import { EndpointActionFileInfoSchema } from '../../../../common/endpoint/schema/actions'; +import { withEndpointAuthz } from '../with_endpoint_authz'; +import { CustomHttpRequestError } from '../../../utils/custom_http_request_error'; +import { getFileDownloadId } from '../../../../common/endpoint/service/response_actions/get_file_download_id'; +import { errorHandler } from '../error_handler'; + +export const getActionFileInfoRouteHandler = ( + endpointContext: EndpointAppContext +): RequestHandler< + EndpointActionFileInfoParams, + unknown, + unknown, + SecuritySolutionRequestHandlerContext +> => { + const logger = endpointContext.logFactory.get('actionFileInfo'); + + return async (context, req, res) => { + const { action_id: actionId, agent_id: agentId } = req.params; + const esClient = (await context.core).elasticsearch.client.asInternalUser; + const endpointMetadataService = endpointContext.service.getEndpointMetadataService(); + + try { + // Ensure action id is valid and that it was sent to the Agent ID requested. + const actionDetails = await getActionDetailsById(esClient, endpointMetadataService, actionId); + + if (!actionDetails.agents.includes(agentId)) { + throw new CustomHttpRequestError(`Action was not sent to agent id [${agentId}]`, 400); + } + + const fileId = getFileDownloadId(actionDetails, agentId); + + return res.ok({ + body: { + data: await getFileInfo(esClient, logger, fileId), + }, + }); + } catch (error) { + return errorHandler(logger, res, error); + } + }; +}; + +export const registerActionFileInfoRoute = ( + router: SecuritySolutionPluginRouter, + endpointContext: EndpointAppContext +) => { + router.get( + { + path: ACTION_AGENT_FILE_INFO_ROUTE, + validate: EndpointActionFileInfoSchema, + options: { authRequired: true, tags: ['access:securitySolution'] }, + }, + withEndpointAuthz( + { all: ['canWriteFileOperations'] }, + endpointContext.logFactory.get('actionFileInfo'), + getActionFileInfoRouteHandler(endpointContext) + ) + ); +}; diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/index.ts b/x-pack/plugins/security_solution/server/endpoint/routes/actions/index.ts index a801360772b28..e5b3e90de8878 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/actions/index.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/actions/index.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { registerActionFileInfoRoute } from './file_info_handler'; import { registerActionFileDownloadRoutes } from './file_download_handler'; import { registerActionDetailsRoutes } from './details'; import type { SecuritySolutionPluginRouter } from '../../../types'; @@ -26,4 +27,5 @@ export function registerActionRoutes( registerActionDetailsRoutes(router, endpointContext); registerActionFileDownloadRoutes(router, endpointContext); registerResponseActionRoutes(router, endpointContext); + registerActionFileInfoRoute(router, endpointContext); } diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts index 8624bc375cd9f..545c4f31c3650 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts @@ -66,6 +66,7 @@ import { import { legacyMetadataSearchResponseMock } from '../metadata/support/test_support'; import { registerResponseActionRoutes } from './response_actions'; import * as ActionDetailsService from '../../services/actions/action_details_by_id'; +import { CaseStatuses } from '@kbn/cases-components'; interface CallRouteInterface { body?: ResponseActionRequestBody; @@ -694,6 +695,13 @@ describe('Response actions', () => { { id: `case-${counter++}`, title: 'case', + createdAt: '2022-10-31T11:49:48.806Z', + description: 'a description', + status: CaseStatuses.open, + totals: { + userComments: 1, + alerts: 1, + }, }, ]; }); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_files.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/action_files.test.ts index 288c8ba043693..ffbe39f0435a5 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_files.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/actions/action_files.test.ts @@ -10,27 +10,30 @@ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mo import type { Logger } from '@kbn/core/server'; import { createEsFileClient as _createEsFileClient } from '@kbn/files-plugin/server'; import { createFileClientMock } from '@kbn/files-plugin/server/mocks'; -import { getFileDownloadStream } from './action_files'; +import { getFileDownloadStream, getFileInfo } from './action_files'; import type { DiagnosticResult } from '@elastic/elasticsearch'; import { errors } from '@elastic/elasticsearch'; import { NotFoundError } from '../../errors'; +import { FILE_STORAGE_DATA_INDEX } from '../../../../common/endpoint/constants'; +import { BaseDataGenerator } from '../../../../common/endpoint/data_generators/base_data_generator'; +import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; jest.mock('@kbn/files-plugin/server'); const createEsFileClient = _createEsFileClient as jest.Mock; describe('Action Files service', () => { - describe('#getFileDownloadStream()', () => { - let loggerMock: Logger; - let esClientMock: ElasticsearchClientMock; - let fileClientMock: ReturnType<typeof createFileClientMock>; + let loggerMock: Logger; + let esClientMock: ElasticsearchClientMock; + let fileClientMock: ReturnType<typeof createFileClientMock>; - beforeEach(() => { - loggerMock = loggingSystemMock.create().get('mock'); - esClientMock = elasticsearchServiceMock.createElasticsearchClient(); - fileClientMock = createFileClientMock(); - createEsFileClient.mockReturnValue(fileClientMock); - }); + beforeEach(() => { + loggerMock = loggingSystemMock.create().get('mock'); + esClientMock = elasticsearchServiceMock.createElasticsearchClient(); + fileClientMock = createFileClientMock(); + createEsFileClient.mockReturnValue(fileClientMock); + }); + describe('#getFileDownloadStream()', () => { it('should return expected output', async () => { await expect(getFileDownloadStream(esClientMock, loggerMock, '123')).resolves.toEqual({ stream: expect.anything(), @@ -51,4 +54,62 @@ describe('Action Files service', () => { ); }); }); + + describe('#getFileInfo()', () => { + let fileChunksEsResponseMock: estypes.SearchResponse; + + beforeEach(() => { + fileChunksEsResponseMock = BaseDataGenerator.toEsSearchResponse([ + BaseDataGenerator.toEsSearchHit({}), + ]); + + esClientMock.search.mockImplementation(async (searchRequest) => { + if (searchRequest && searchRequest.index === FILE_STORAGE_DATA_INDEX) { + return fileChunksEsResponseMock; + } + + return BaseDataGenerator.toEsSearchResponse([]); + }); + }); + + it('should return expected output', async () => { + await expect(getFileInfo(esClientMock, loggerMock, '123')).resolves.toEqual({ + created: '2022-10-10T14:57:30.682Z', + id: '123', + mimeType: 'text/plain', + name: 'test.txt', + size: 1234, + status: 'READY', + }); + }); + + it('should check if file has chunks if status is `READY`', async () => { + fileChunksEsResponseMock = BaseDataGenerator.toEsSearchResponse([]); + + await expect(getFileInfo(esClientMock, loggerMock, '123')).resolves.toEqual({ + created: '2022-10-10T14:57:30.682Z', + id: '123', + mimeType: 'text/plain', + name: 'test.txt', + size: 1234, + status: 'DELETED', + }); + + expect(loggerMock.debug).toHaveBeenCalledWith( + 'File with id [123] has no data chunks. Status will be adjusted to DELETED' + ); + }); + + it('should return a `NotFoundError` if file id is not found', async () => { + fileClientMock.get.mockRejectedValue( + new errors.ResponseError({ + statusCode: 404, + } as DiagnosticResult) + ); + + await expect(getFileInfo(esClientMock, loggerMock, '123')).rejects.toBeInstanceOf( + NotFoundError + ); + }); + }); }); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_files.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/action_files.ts index 5db82681c3572..cb161ac189d59 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_files.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/actions/action_files.ts @@ -7,8 +7,11 @@ import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import type { Readable } from 'stream'; +import type { FileClient } from '@kbn/files-plugin/server'; import { createEsFileClient } from '@kbn/files-plugin/server'; import { errors } from '@elastic/elasticsearch'; +import type { SearchTotalHits } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type { UploadedFileInfo } from '../../../../common/endpoint/types'; import { NotFoundError } from '../../errors'; import { FILE_STORAGE_DATA_INDEX, @@ -16,6 +19,32 @@ import { } from '../../../../common/endpoint/constants'; import { EndpointError } from '../../../../common/endpoint/errors'; +const getFileClient = (esClient: ElasticsearchClient, logger: Logger): FileClient => { + return createEsFileClient({ + metadataIndex: FILE_STORAGE_METADATA_INDEX, + blobStorageIndex: FILE_STORAGE_DATA_INDEX, + elasticsearchClient: esClient, + logger, + }); +}; + +const getFileRetrievalError = ( + error: Error | errors.ResponseError, + fileId: string +): EndpointError => { + if (error instanceof errors.ResponseError) { + const statusCode = error.statusCode; + + // 404 will be returned if file id is not found -or- index does not exist yet. + // Using the `NotFoundError` error class will result in the API returning a 404 + if (statusCode === 404) { + return new NotFoundError(`File with id [${fileId}] not found`, error); + } + } + + return new EndpointError(`Failed to get file using id [${fileId}]: ${error.message}`, error); +}; + /** * Returns a NodeJS `Readable` data stream to a file * @param esClient @@ -27,14 +56,8 @@ export const getFileDownloadStream = async ( logger: Logger, fileId: string ): Promise<{ stream: Readable; fileName: string; mimeType?: string }> => { - const fileClient = createEsFileClient({ - metadataIndex: FILE_STORAGE_METADATA_INDEX, - blobStorageIndex: FILE_STORAGE_DATA_INDEX, - elasticsearchClient: esClient, - logger, - }); - try { + const fileClient = getFileClient(esClient, logger); const file = await fileClient.get({ id: fileId }); const { name: fileName, mimeType } = file.data; @@ -44,16 +67,69 @@ export const getFileDownloadStream = async ( mimeType, }; } catch (error) { - if (error instanceof errors.ResponseError) { - const statusCode = error.statusCode; + throw getFileRetrievalError(error, fileId); + } +}; - // 404 will be returned if file id is not found -or- index does not exist yet. - // Using the `NotFoundError` error class will result in the API returning a 404 - if (statusCode === 404) { - throw new NotFoundError(`File with id [${fileId}] not found`, error); +/** + * Retrieve information about a file + * + * @param esClient + * @param logger + * @param fileId + */ +export const getFileInfo = async ( + esClient: ElasticsearchClient, + logger: Logger, + fileId: string +): Promise<UploadedFileInfo> => { + try { + const fileClient = getFileClient(esClient, logger); + const file = await fileClient.get({ id: fileId }); + const { name, id, mimeType, size, status, created } = file.data; + let fileHasChunks: boolean = true; + + if (status === 'READY') { + fileHasChunks = await doesFileHaveChunks(esClient, fileId); + + if (!fileHasChunks) { + logger.debug( + `File with id [${fileId}] has no data chunks. Status will be adjusted to DELETED` + ); } } - throw new EndpointError(`Failed to get file using id [${fileId}]: ${error.message}`, error); + // TODO: add `ttl` to the return payload by retrieving the value from ILM? + + return { + name, + id, + mimeType, + size, + created, + status: fileHasChunks ? status : 'DELETED', + }; + } catch (error) { + throw getFileRetrievalError(error, fileId); } }; + +const doesFileHaveChunks = async ( + esClient: ElasticsearchClient, + fileId: string +): Promise<boolean> => { + const chunks = await esClient.search({ + index: FILE_STORAGE_DATA_INDEX, + body: { + query: { + term: { + 'bid.keyword': fileId, + }, + }, + // Setting `_source` to false - we don't need the actual document to be returned + _source: false, + }, + }); + + return Boolean((chunks.hits?.total as SearchTotalHits)?.value); +}; diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/utils.test.ts index 377c9bc3caf74..920540fd30082 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/actions/utils.test.ts @@ -444,7 +444,7 @@ describe('When using Actions service utilities', () => { outputs: { '456': { content: { - code: 'ra_get-file_success', + code: 'ra_get-file_success_done', path: '/some/path/bad_file.txt', size: 1234, zip_size: 123, diff --git a/x-pack/plugins/security_solution/server/features.ts b/x-pack/plugins/security_solution/server/features.ts index fc3307a650097..8dd4b56f655b6 100644 --- a/x-pack/plugins/security_solution/server/features.ts +++ b/x-pack/plugins/security_solution/server/features.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; -import type { KibanaFeatureConfig } from '@kbn/features-plugin/common'; +import type { KibanaFeatureConfig, SubFeatureConfig } from '@kbn/features-plugin/common'; import { DEFAULT_APP_CATEGORIES } from '@kbn/core/server'; import { DATA_VIEW_SAVED_OBJECT_TYPE } from '@kbn/data-views-plugin/common'; import { createUICapabilities } from '@kbn/cases-plugin/common'; @@ -101,6 +101,411 @@ const CLOUD_POSTURE_APP_ID = 'csp'; // Same as the saved-object type for rules defined by Cloud Security Posture const CLOUD_POSTURE_SAVED_OBJECT_RULE_TYPE = 'csp_rule'; +const responseActionSubFeatures: SubFeatureConfig[] = [ + { + requireAllSpaces: true, + privilegesTooltip: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.actionsLogManagement.privilegesTooltip', + { + defaultMessage: 'All Spaces is required for Actions Log Management access.', + } + ), + name: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.actionsLogManagement', + { + defaultMessage: 'Actions Log Management', + } + ), + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + api: [`${APP_ID}-writeActionsLogManagement`, `${APP_ID}-readActionsLogManagement`], + id: 'actions_log_management_all', + includeIn: 'none', + name: 'All', + savedObject: { + all: [], + read: [], + }, + ui: ['writeActionsLogManagement', 'readActionsLogManagement'], + }, + { + api: [`${APP_ID}-readActionsLogManagement`], + id: 'actions_log_management_read', + includeIn: 'none', + name: 'Read', + savedObject: { + all: [], + read: [], + }, + ui: ['readActionsLogManagement'], + }, + ], + }, + ], + }, + { + requireAllSpaces: true, + privilegesTooltip: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.hostIsolation.privilegesTooltip', + { + defaultMessage: 'All Spaces is required for Host Isolation access.', + } + ), + name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.hostIsolation', { + defaultMessage: 'Host Isolation', + }), + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + api: [`${APP_ID}-writeHostIsolation`], + id: 'host_isolation_all', + includeIn: 'none', + name: 'All', + savedObject: { + all: [], + read: [], + }, + ui: ['writeHostIsolation'], + }, + ], + }, + ], + }, + { + requireAllSpaces: true, + privilegesTooltip: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.processOperations.privilegesTooltip', + { + defaultMessage: 'All Spaces is required for Process Operations access.', + } + ), + name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.processOperations', { + defaultMessage: 'Process Operations', + }), + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + api: [`${APP_ID}-writeProcessOperations`], + id: 'process_operations_all', + includeIn: 'none', + name: 'All', + savedObject: { + all: [], + read: [], + }, + ui: ['writeProcessOperations'], + }, + ], + }, + ], + }, + { + requireAllSpaces: true, + privilegesTooltip: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.fileOperations.privilegesTooltip', + { + defaultMessage: 'All Spaces is required for File Operations access.', + } + ), + name: i18n.translate('xpack.securitySolution.featureRegistr.subFeatures.fileOperations', { + defaultMessage: 'File Operations', + }), + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + api: [`${APP_ID}-writeFileOperations`], + id: 'file_operations_all', + includeIn: 'none', + name: 'All', + savedObject: { + all: [], + read: [], + }, + ui: ['writeFileOperations'], + }, + ], + }, + ], + }, +]; + +const subFeatures: SubFeatureConfig[] = [ + { + requireAllSpaces: true, + privilegesTooltip: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.endpointList.privilegesTooltip', + { + defaultMessage: 'All Spaces is required for Endpoint List access.', + } + ), + name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.endpointList', { + defaultMessage: 'Endpoint List', + }), + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + api: [`${APP_ID}-writeEndpointList`, `${APP_ID}-readEndpointList`], + id: 'endpoint_list_all', + includeIn: 'none', + name: 'All', + savedObject: { + all: [], + read: [], + }, + ui: ['writeEndpointList', 'readEndpointList'], + }, + { + api: [`${APP_ID}-readEndpointList`], + id: 'endpoint_list_read', + includeIn: 'none', + name: 'Read', + savedObject: { + all: [], + read: [], + }, + ui: ['readEndpointList'], + }, + ], + }, + ], + }, + { + requireAllSpaces: true, + privilegesTooltip: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.trustedApplications.privilegesTooltip', + { + defaultMessage: 'All Spaces is required for Trusted Applications access.', + } + ), + name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.trustedApplications', { + defaultMessage: 'Trusted Applications', + }), + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + api: [`${APP_ID}-writeTrustedApplications`, `${APP_ID}-readTrustedApplications`], + id: 'trusted_applications_all', + includeIn: 'none', + name: 'All', + savedObject: { + all: [], + read: [], + }, + ui: ['writeTrustedApplications', 'readTrustedApplications'], + }, + { + api: [`${APP_ID}-readTrustedApplications`], + id: 'trusted_applications_read', + includeIn: 'none', + name: 'Read', + savedObject: { + all: [], + read: [], + }, + ui: ['readTrustedApplications'], + }, + ], + }, + ], + }, + { + requireAllSpaces: true, + privilegesTooltip: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.hostIsolationExceptions.privilegesTooltip', + { + defaultMessage: 'All Spaces is required for Host Isolation Exceptions access.', + } + ), + name: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.hostIsolationExceptions', + { + defaultMessage: 'Host Isolation Exceptions', + } + ), + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + api: [ + `${APP_ID}-writeHostIsolationExceptions`, + `${APP_ID}-readHostIsolationExceptions`, + ], + id: 'host_isolation_exceptions_all', + includeIn: 'none', + name: 'All', + savedObject: { + all: [], + read: [], + }, + ui: ['writeHostIsolationExceptions', 'readHostIsolationExceptions'], + }, + { + api: [`${APP_ID}-readHostIsolationExceptions`], + id: 'host_isolation_exceptions_read', + includeIn: 'none', + name: 'Read', + savedObject: { + all: [], + read: [], + }, + ui: ['readHostIsolationExceptions'], + }, + ], + }, + ], + }, + { + requireAllSpaces: true, + privilegesTooltip: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.blockList.privilegesTooltip', + { + defaultMessage: 'All Spaces is required for Blocklist access.', + } + ), + name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.blockList', { + defaultMessage: 'Blocklist', + }), + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + api: [`${APP_ID}-writeBlocklist`, `${APP_ID}-readBlocklist`], + id: 'blocklist_all', + includeIn: 'none', + name: 'All', + savedObject: { + all: [], + read: [], + }, + ui: ['writeBlocklist', 'readBlocklist'], + }, + { + api: [`${APP_ID}-readBlocklist`], + id: 'blocklist_read', + includeIn: 'none', + name: 'Read', + savedObject: { + all: [], + read: [], + }, + ui: ['readBlocklist'], + }, + ], + }, + ], + }, + { + requireAllSpaces: true, + privilegesTooltip: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.eventFilters.privilegesTooltip', + { + defaultMessage: 'All Spaces is required for Event Filters access.', + } + ), + name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.eventFilters', { + defaultMessage: 'Event Filters', + }), + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + api: [`${APP_ID}-writeEventFilters`, `${APP_ID}-readEventFilters`], + id: 'event_filters_all', + includeIn: 'none', + name: 'All', + savedObject: { + all: [], + read: [], + }, + ui: ['writeEventFilters', 'readEventFilters'], + }, + { + api: [`${APP_ID}-readEventFilters`], + id: 'event_filters_read', + includeIn: 'none', + name: 'Read', + savedObject: { + all: [], + read: [], + }, + ui: ['readEventFilters'], + }, + ], + }, + ], + }, + { + requireAllSpaces: true, + privilegesTooltip: i18n.translate( + 'xpack.securitySolution.featureRegistry.subFeatures.policyManagement.privilegesTooltip', + { + defaultMessage: 'All Spaces is required for Policy Management access.', + } + ), + name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.policyManagement', { + defaultMessage: 'Policy Management', + }), + privilegeGroups: [ + { + groupType: 'mutually_exclusive', + privileges: [ + { + api: [`${APP_ID}-writePolicyManagement`, `${APP_ID}-readPolicyManagement`], + id: 'policy_management_all', + includeIn: 'none', + name: 'All', + savedObject: { + all: [], + read: [], + }, + ui: ['writePolicyManagement', 'readPolicyManagement'], + }, + { + api: [`${APP_ID}-readPolicyManagement`], + id: 'policy_management_read', + includeIn: 'none', + name: 'Read', + savedObject: { + all: [], + read: [], + }, + ui: ['readPolicyManagement'], + }, + ], + }, + ], + }, + ...responseActionSubFeatures, +]; + +function getSubFeatures(experimentalFeatures: ConfigType['experimentalFeatures']) { + if (experimentalFeatures.endpointRbacEnabled) { + return subFeatures; + } + + if (experimentalFeatures.endpointRbacV1Enabled) { + return responseActionSubFeatures; + } + + return []; +} + export const getKibanaPrivilegesFeaturePrivileges = ( ruleTypes: string[], experimentalFeatures: ConfigType['experimentalFeatures'] @@ -182,336 +587,5 @@ export const getKibanaPrivilegesFeaturePrivileges = ( ui: ['show'], }, }, - subFeatures: experimentalFeatures.endpointRbacEnabled - ? [ - { - name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.endpointList', { - defaultMessage: 'Endpoint List', - }), - privilegeGroups: [ - { - groupType: 'mutually_exclusive', - privileges: [ - { - api: [`${APP_ID}-writeEndpointList`, `${APP_ID}-readEndpointList`], - id: 'endpoint_list_all', - includeIn: 'all', - name: 'All', - savedObject: { - all: [], - read: [], - }, - ui: ['writeEndpointList', 'readEndpointList'], - }, - { - api: [`${APP_ID}-readEndpointList`], - id: 'endpoint_list_read', - includeIn: 'read', - name: 'Read', - savedObject: { - all: [], - read: [], - }, - ui: ['readEndpointList'], - }, - ], - }, - ], - }, - { - name: i18n.translate( - 'xpack.securitySolution.featureRegistry.subFeatures.trustedApplications', - { - defaultMessage: 'Trusted Applications', - } - ), - privilegeGroups: [ - { - groupType: 'mutually_exclusive', - privileges: [ - { - api: [`${APP_ID}-writeTrustedApplications`, `${APP_ID}-readTrustedApplications`], - id: 'trusted_applications_all', - includeIn: 'all', - name: 'All', - savedObject: { - all: [], - read: [], - }, - ui: ['writeTrustedApplications', 'readTrustedApplications'], - }, - { - api: [`${APP_ID}-readTrustedApplications`], - id: 'trusted_applications_read', - includeIn: 'read', - name: 'Read', - savedObject: { - all: [], - read: [], - }, - ui: ['readTrustedApplications'], - }, - ], - }, - ], - }, - { - name: i18n.translate( - 'xpack.securitySolution.featureRegistry.subFeatures.hostIsolationExceptions', - { - defaultMessage: 'Host Isolation Exceptions', - } - ), - privilegeGroups: [ - { - groupType: 'mutually_exclusive', - privileges: [ - { - api: [ - `${APP_ID}-writeHostIsolationExceptions`, - `${APP_ID}-readHostIsolationExceptions`, - ], - id: 'host_isolation_exceptions_all', - includeIn: 'all', - name: 'All', - savedObject: { - all: [], - read: [], - }, - ui: ['writeHostIsolationExceptions', 'readHostIsolationExceptions'], - }, - { - api: [`${APP_ID}-readHostIsolationExceptions`], - id: 'host_isolation_exceptions_read', - includeIn: 'read', - name: 'Read', - savedObject: { - all: [], - read: [], - }, - ui: ['readHostIsolationExceptions'], - }, - ], - }, - ], - }, - { - name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.blockList', { - defaultMessage: 'Blocklist', - }), - privilegeGroups: [ - { - groupType: 'mutually_exclusive', - privileges: [ - { - api: [`${APP_ID}-writeBlocklist`, `${APP_ID}-readBlocklist`], - id: 'blocklist_all', - includeIn: 'all', - name: 'All', - savedObject: { - all: [], - read: [], - }, - ui: ['writeBlocklist', 'readBlocklist'], - }, - { - api: [`${APP_ID}-readBlocklist`], - id: 'blocklist_read', - includeIn: 'read', - name: 'Read', - savedObject: { - all: [], - read: [], - }, - ui: ['readBlocklist'], - }, - ], - }, - ], - }, - { - name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.eventFilters', { - defaultMessage: 'Event Filters', - }), - privilegeGroups: [ - { - groupType: 'mutually_exclusive', - privileges: [ - { - api: [`${APP_ID}-writeEventFilters`, `${APP_ID}-readEventFilters`], - id: 'event_filters_all', - includeIn: 'all', - name: 'All', - savedObject: { - all: [], - read: [], - }, - ui: ['writeEventFilters', 'readEventFilters'], - }, - { - api: [`${APP_ID}-readEventFilters`], - id: 'event_filters_read', - includeIn: 'read', - name: 'Read', - savedObject: { - all: [], - read: [], - }, - ui: ['readEventFilters'], - }, - ], - }, - ], - }, - { - name: i18n.translate( - 'xpack.securitySolution.featureRegistry.subFeatures.policyManagement', - { - defaultMessage: 'Policy Management', - } - ), - privilegeGroups: [ - { - groupType: 'mutually_exclusive', - privileges: [ - { - api: [`${APP_ID}-writePolicyManagement`, `${APP_ID}-readPolicyManagement`], - id: 'policy_management_all', - includeIn: 'all', - name: 'All', - savedObject: { - all: [], - read: [], - }, - ui: ['writePolicyManagement', 'readPolicyManagement'], - }, - { - api: [`${APP_ID}-readPolicyManagement`], - id: 'policy_management_read', - includeIn: 'read', - name: 'Read', - savedObject: { - all: [], - read: [], - }, - ui: ['readPolicyManagement'], - }, - ], - }, - ], - }, - { - name: i18n.translate( - 'xpack.securitySolution.featureRegistry.subFeatures.actionsLogManagement', - { - defaultMessage: 'Actions Log Management', - } - ), - privilegeGroups: [ - { - groupType: 'mutually_exclusive', - privileges: [ - { - api: [ - `${APP_ID}-writeActionsLogManagement`, - `${APP_ID}-readActionsLogManagement`, - ], - id: 'actions_log_management_all', - includeIn: 'all', - name: 'All', - savedObject: { - all: [], - read: [], - }, - ui: ['writeActionsLogManagement', 'readActionsLogManagement'], - }, - { - api: [`${APP_ID}-readActionsLogManagement`], - id: 'actions_log_management_read', - includeIn: 'read', - name: 'Read', - savedObject: { - all: [], - read: [], - }, - ui: ['readActionsLogManagement'], - }, - ], - }, - ], - }, - { - name: i18n.translate('xpack.securitySolution.featureRegistry.subFeatures.hostIsolation', { - defaultMessage: 'Host Isolation', - }), - privilegeGroups: [ - { - groupType: 'mutually_exclusive', - privileges: [ - { - api: [`${APP_ID}-writeHostIsolation`], - id: 'host_isolation_all', - includeIn: 'all', - name: 'All', - savedObject: { - all: [], - read: [], - }, - ui: ['writeHostIsolation'], - }, - ], - }, - ], - }, - { - name: i18n.translate( - 'xpack.securitySolution.featureRegistry.subFeatures.processOperations', - { - defaultMessage: 'Process Operations', - } - ), - privilegeGroups: [ - { - groupType: 'mutually_exclusive', - privileges: [ - { - api: [`${APP_ID}-writeProcessOperations`], - id: 'process_operations_all', - includeIn: 'all', - name: 'All', - savedObject: { - all: [], - read: [], - }, - ui: ['writeProcessOperations'], - }, - ], - }, - ], - }, - { - name: i18n.translate('xpack.securitySolution.featureRegistr.subFeatures.fileOperations', { - defaultMessage: 'File Operations', - }), - privilegeGroups: [ - { - groupType: 'mutually_exclusive', - privileges: [ - { - api: [`${APP_ID}-writeFileOperations`], - id: 'file_operations_all', - includeIn: 'all', - name: 'All', - savedObject: { - all: [], - read: [], - }, - ui: ['writeFileOperations'], - }, - ], - }, - ], - }, - ] - : [], + subFeatures: getSubFeatures(experimentalFeatures), }); diff --git a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts b/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts index 17d1d8f9a9295..44f9a8bafae3d 100644 --- a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts +++ b/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts @@ -47,6 +47,7 @@ import type { DeletePackagePoliciesResponse } from '@kbn/fleet-plugin/common'; import { createMockPolicyData } from '../endpoint/services/feature_usage/mocks'; import { ALL_ENDPOINT_ARTIFACT_LIST_IDS } from '../../common/endpoint/service/artifacts/constants'; import { ENDPOINT_EVENT_FILTERS_LIST_ID } from '@kbn/securitysolution-list-constants'; +import { disableProtections } from '../../common/endpoint/models/policy_config_helpers'; jest.mock('uuid', () => ({ v4: (): string => 'NEW_UUID', @@ -89,7 +90,7 @@ describe('ingest_integration tests ', () => { streams: [], config: { integration_config: {}, - policy: { value: policyFactory() }, + policy: { value: disableProtections(policyFactory()) }, artifact_manifest: { value: manifest }, }, }); diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts b/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts index 73440a310b625..916d3adbe96ae 100644 --- a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts +++ b/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts @@ -9,11 +9,9 @@ import type { ILicense } from '@kbn/licensing-plugin/common/types'; import { licenseMock } from '@kbn/licensing-plugin/common/licensing.mock'; import { LicenseService } from '../../../common/license'; import { createDefaultPolicy } from './create_default_policy'; +import { ProtectionModes } from '../../../common/endpoint/types'; import type { PolicyConfig } from '../../../common/endpoint/types'; -import { - policyFactory as policyConfigFactory, - policyFactoryWithoutPaidFeatures as policyConfigFactoryWithoutPaidFeatures, -} from '../../../common/endpoint/models/policy_config'; +import { policyFactory } from '../../../common/endpoint/models/policy_config'; import type { AnyPolicyCreateConfig, PolicyCreateCloudConfig, @@ -37,16 +35,52 @@ describe('Create Default Policy tests ', () => { licenseEmitter.next(Platinum); // set license level to platinum }); describe('When no config is set', () => { - it('Should return the Default Policy Config when license is at least platinum', () => { + it('Should return PolicyConfig for events only when license is at least platinum', () => { + const defaultPolicy = policyFactory(); + const policy = createDefaultPolicyCallback(undefined); - expect(policy).toEqual(policyConfigFactory()); + + // events are the same + expect(policy.windows.events).toEqual(defaultPolicy.windows.events); + expect(policy.linux.events).toEqual(defaultPolicy.linux.events); + expect(policy.mac.events).toEqual(defaultPolicy.mac.events); + + // check some of the protections to be disabled + const disabledButSupported = { mode: ProtectionModes.off, supported: true }; + expect(policy.windows.behavior_protection).toEqual(disabledButSupported); + expect(policy.mac.memory_protection).toEqual(disabledButSupported); + expect(policy.linux.behavior_protection).toEqual(disabledButSupported); + + // malware popups should be disabled + expect(policy.windows.popup.malware.enabled).toBeFalsy(); + expect(policy.mac.popup.malware.enabled).toBeFalsy(); + expect(policy.linux.popup.malware.enabled).toBeFalsy(); }); - it('Should return the Default Policy Config without paid features when license is below platinum', () => { + + it('Should return PolicyConfig for events only without paid features when license is below platinum', () => { + const defaultPolicy = policyFactory(); licenseEmitter.next(Gold); + const policy = createDefaultPolicyCallback(undefined); - expect(policy).toEqual(policyConfigFactoryWithoutPaidFeatures()); + + // events are the same + expect(policy.windows.events).toEqual(defaultPolicy.windows.events); + expect(policy.linux.events).toEqual(defaultPolicy.linux.events); + expect(policy.mac.events).toEqual(defaultPolicy.mac.events); + + // check some of the protections to be disabled and unsupported + const disabledAndUnsupported = { mode: ProtectionModes.off, supported: false }; + expect(policy.windows.behavior_protection).toEqual(disabledAndUnsupported); + expect(policy.mac.memory_protection).toEqual(disabledAndUnsupported); + expect(policy.linux.behavior_protection).toEqual(disabledAndUnsupported); + + // malware popups are enabled on unpaid license + expect(policy.windows.popup.malware.enabled).toBeTruthy(); + expect(policy.mac.popup.malware.enabled).toBeTruthy(); + expect(policy.linux.popup.malware.enabled).toBeTruthy(); }); }); + describe('When endpoint config is set', () => { const createEndpointConfig = ( endpointConfig: PolicyCreateEndpointConfig['endpointConfig'] @@ -112,8 +146,8 @@ describe('Create Default Policy tests ', () => { it('Should return the default config when preset is EDR Complete', () => { const config = createEndpointConfig({ preset: 'EDRComplete' }); const policy = createDefaultPolicyCallback(config); - const policyFactory = policyConfigFactory(); - expect(policy).toMatchObject(policyFactory); + const defaultPolicy = policyFactory(); + expect(policy).toMatchObject(defaultPolicy); }); }); describe('When cloud config is set', () => { diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts b/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts index a2da989a9c08d..d74cc6b0973e0 100644 --- a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts +++ b/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts @@ -10,11 +10,14 @@ import { policyFactoryWithoutPaidFeatures as policyConfigFactoryWithoutPaidFeatures, } from '../../../common/endpoint/models/policy_config'; import type { LicenseService } from '../../../common/license/license'; -import { isAtLeast } from '../../../common/license/license'; -import { ProtectionModes } from '../../../common/endpoint/types'; import type { PolicyConfig } from '../../../common/endpoint/types'; import type { AnyPolicyCreateConfig, PolicyCreateEndpointConfig } from '../types'; -import { ENDPOINT_CONFIG_PRESET_EDR_ESSENTIAL, ENDPOINT_CONFIG_PRESET_NGAV } from '../constants'; +import { + ENDPOINT_CONFIG_PRESET_EDR_COMPLETE, + ENDPOINT_CONFIG_PRESET_EDR_ESSENTIAL, + ENDPOINT_CONFIG_PRESET_NGAV, +} from '../constants'; +import { disableProtections } from '../../../common/endpoint/models/policy_config_helpers'; /** * Create the default endpoint policy based on the current license and configuration type @@ -23,19 +26,21 @@ export const createDefaultPolicy = ( licenseService: LicenseService, config: AnyPolicyCreateConfig | undefined ): PolicyConfig => { - const policy = isAtLeast(licenseService.getLicenseInformation(), 'platinum') - ? policyConfigFactory() - : policyConfigFactoryWithoutPaidFeatures(); + const factoryPolicy = policyConfigFactory(); - if (config?.type === 'cloud') { - return getCloudPolicyConfig(policy); - } + const defaultPolicyPerType = + config?.type === 'cloud' + ? getCloudPolicyConfig(factoryPolicy) + : getEndpointPolicyWithIntegrationConfig(factoryPolicy, config); - return getEndpointPolicyWithIntegrationConfig(policy, config); + // Apply license limitations in the final step, so it's not overriden (see malware popup) + return licenseService.isPlatinumPlus() + ? defaultPolicyPerType + : policyConfigFactoryWithoutPaidFeatures(defaultPolicyPerType); }; /** - * Set all keys of the given object to false + * Create a copy of an object with all keys set to false */ const falsyObjectKeys = <T extends Record<string, boolean>>(obj: T): T => { return Object.keys(obj).reduce((accumulator, key) => { @@ -43,6 +48,14 @@ const falsyObjectKeys = <T extends Record<string, boolean>>(obj: T): T => { }, {} as T); }; +const getEndpointPolicyConfigPreset = (config: PolicyCreateEndpointConfig | undefined) => { + const isNGAV = config?.endpointConfig?.preset === ENDPOINT_CONFIG_PRESET_NGAV; + const isEDREssential = config?.endpointConfig?.preset === ENDPOINT_CONFIG_PRESET_EDR_ESSENTIAL; + const isEDRComplete = config?.endpointConfig?.preset === ENDPOINT_CONFIG_PRESET_EDR_COMPLETE; + + return { isNGAV, isEDREssential, isEDRComplete }; +}; + /** * Retrieve policy for endpoint based on the preset selected in the endpoint integration config */ @@ -50,9 +63,11 @@ const getEndpointPolicyWithIntegrationConfig = ( policy: PolicyConfig, config: PolicyCreateEndpointConfig | undefined ): PolicyConfig => { - const isEDREssential = config?.endpointConfig?.preset === ENDPOINT_CONFIG_PRESET_EDR_ESSENTIAL; + const { isNGAV, isEDREssential, isEDRComplete } = getEndpointPolicyConfigPreset(config); - if (config?.endpointConfig?.preset === ENDPOINT_CONFIG_PRESET_NGAV || isEDREssential) { + if (isEDRComplete) { + return policy; + } else if (isNGAV || isEDREssential) { const events = { process: true, file: isEDREssential, @@ -85,7 +100,8 @@ const getEndpointPolicyWithIntegrationConfig = ( }; } - return policy; + // data collection by default + return disableProtections(policy); }; /** @@ -93,43 +109,16 @@ const getEndpointPolicyWithIntegrationConfig = ( */ const getCloudPolicyConfig = (policy: PolicyConfig): PolicyConfig => { // Disabling all protections, since it's not yet supported on Cloud integrations - const protections = { - memory_protection: { - supported: false, - mode: ProtectionModes.off, - }, - malware: { - ...policy.linux.malware, - mode: ProtectionModes.off, - }, - behavior_protection: { - ...policy.linux.behavior_protection, - mode: ProtectionModes.off, - }, - }; + const policyWithDisabledProtections = disableProtections(policy); return { - ...policy, + ...policyWithDisabledProtections, linux: { - ...policy.linux, - ...protections, + ...policyWithDisabledProtections.linux, events: { - ...policy.linux.events, + ...policyWithDisabledProtections.linux.events, session_data: true, }, }, - windows: { - ...policy.windows, - ...protections, - // Disabling ransomware protection, since it's not supported on Cloud integrations - ransomware: { - supported: false, - mode: ProtectionModes.off, - }, - }, - mac: { - ...policy.mac, - ...protections, - }, }; }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/guided_onborading_sample_rule.json b/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/guided_onborading_sample_rule.json new file mode 100644 index 0000000000000..7c8258984e306 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/guided_onborading_sample_rule.json @@ -0,0 +1,60 @@ +{ + "author": [ + "Elastic" + ], + "description": "This rule helps you test and practice using alerts with Elastic Security as you get set up. It\u2019s not a sign of threat activity.", + "enabled": false, + "false_positives": [ + "This rule is not looking for threat activity. Disable the rule if you're already familiar with alerts." + ], + "from": "now-24h", + "index": [ + "apm-*-transaction*", + "auditbeat-*", + "endgame-*", + "filebeat-*", + "logs-*", + "packetbeat-*", + "traces-apm*", + "winlogbeat-*", + "-*elastic-cloud-logs-*" + ], + "interval": "24h", + "language": "kuery", + "license": "Elastic License v2", + "max_signals": 1, + "name": "My First Alert", + "note": " \nThis is a test alert.\n\nThis alert does not show threat activity. Elastic created this alert to help you understand how alerts work.\n\nFor normal rules, the Investigation Guide will help analysts investigate alerts.\n\nThis alert will show once every 24 hours for each host. It is safe to disable this rule.\n", + "query": "event.kind:\"event\"\n", + "references": [ + "https://www.elastic.co/guide/en/security/current/prebuilt-rules.html" + ], + "required_fields": [ + { + "ecs": true, + "name": "event.kind", + "type": "keyword" + } + ], + "risk_score": 21, + "rule_id": "a198fbbd-9413-45ec-a269-47ae4ccf59ce", + "severity": "low", + "tags": [ + "Elastic", + "Example", + "Guided Onboarding", + "Network", + "APM", + "Windows", + "Elastic Endgame" + ], + "threshold": { + "field": [ + "host.name" + ], + "value": 1 + }, + "timestamp_override": "event.ingested", + "type": "threshold", + "version": 1 +} diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/index.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/index.ts index 97878f9eb2e0b..5d2cbf2aa963f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/index.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/index.ts @@ -10,713 +10,713 @@ // - detection-rules repo using CLI command build-release // Do not hand edit. Run script/command to regenerate package information instead -import rule1 from './credential_access_access_to_browser_credentials_procargs.json'; -import rule2 from './defense_evasion_tcc_bypass_mounted_apfs_access.json'; -import rule3 from './persistence_enable_root_account.json'; -import rule4 from './defense_evasion_unload_endpointsecurity_kext.json'; -import rule5 from './persistence_account_creation_hide_at_logon.json'; -import rule6 from './persistence_creation_hidden_login_item_osascript.json'; -import rule7 from './persistence_evasion_hidden_launch_agent_deamon_creation.json'; -import rule8 from './privilege_escalation_local_user_added_to_admin.json'; -import rule9 from './credential_access_keychain_pwd_retrieval_security_cmd.json'; -import rule10 from './credential_access_systemkey_dumping.json'; -import rule11 from './execution_defense_evasion_electron_app_childproc_node_js.json'; -import rule12 from './execution_revershell_via_shell_cmd.json'; -import rule13 from './persistence_defense_evasion_hidden_launch_agent_deamon_logonitem_process.json'; -import rule14 from './privilege_escalation_persistence_phantom_dll.json'; -import rule15 from './defense_evasion_privilege_escalation_privacy_pref_sshd_fulldiskaccess.json'; -import rule16 from './lateral_movement_credential_access_kerberos_bifrostconsole.json'; -import rule17 from './lateral_movement_vpn_connection_attempt.json'; -import rule18 from './apm_403_response_to_a_post.json'; -import rule19 from './apm_405_response_method_not_allowed.json'; -import rule20 from './apm_sqlmap_user_agent.json'; -import rule21 from './command_and_control_linux_iodine_activity.json'; -import rule22 from './command_and_control_nat_traversal_port_activity.json'; -import rule23 from './command_and_control_port_26_activity.json'; -import rule24 from './command_and_control_rdp_remote_desktop_protocol_from_the_internet.json'; -import rule25 from './command_and_control_telnet_port_activity.json'; -import rule26 from './command_and_control_vnc_virtual_network_computing_from_the_internet.json'; -import rule27 from './command_and_control_vnc_virtual_network_computing_to_the_internet.json'; -import rule28 from './credential_access_endgame_cred_dumping_detected.json'; -import rule29 from './credential_access_endgame_cred_dumping_prevented.json'; -import rule30 from './defense_evasion_adding_the_hidden_file_attribute_with_via_attribexe.json'; -import rule31 from './defense_evasion_clearing_windows_event_logs.json'; -import rule32 from './defense_evasion_delete_volume_usn_journal_with_fsutil.json'; -import rule33 from './defense_evasion_disable_windows_firewall_rules_with_netsh.json'; -import rule34 from './defense_evasion_misc_lolbin_connecting_to_the_internet.json'; -import rule35 from './defense_evasion_msbuild_making_network_connections.json'; -import rule36 from './defense_evasion_suspicious_certutil_commands.json'; -import rule37 from './defense_evasion_unusual_network_connection_via_rundll32.json'; -import rule38 from './defense_evasion_unusual_process_network_connection.json'; -import rule39 from './defense_evasion_via_filter_manager.json'; -import rule40 from './discovery_linux_hping_activity.json'; -import rule41 from './discovery_linux_nping_activity.json'; -import rule42 from './discovery_whoami_command_activity.json'; -import rule43 from './endgame_adversary_behavior_detected.json'; -import rule44 from './endgame_malware_detected.json'; -import rule45 from './endgame_malware_prevented.json'; -import rule46 from './endgame_ransomware_detected.json'; -import rule47 from './endgame_ransomware_prevented.json'; -import rule48 from './execution_command_prompt_connecting_to_the_internet.json'; -import rule49 from './execution_command_shell_started_by_svchost.json'; -import rule50 from './execution_endgame_exploit_detected.json'; -import rule51 from './execution_endgame_exploit_prevented.json'; -import rule52 from './execution_html_help_executable_program_connecting_to_the_internet.json'; -import rule53 from './execution_linux_netcat_network_connection.json'; -import rule54 from './execution_psexec_lateral_movement_command.json'; -import rule55 from './execution_register_server_program_connecting_to_the_internet.json'; -import rule56 from './execution_via_compiled_html_file.json'; -import rule57 from './impact_deleting_backup_catalogs_with_wbadmin.json'; -import rule58 from './impact_volume_shadow_copy_deletion_or_resized_via_vssadmin.json'; -import rule59 from './impact_volume_shadow_copy_deletion_via_wmic.json'; -import rule60 from './initial_access_rpc_remote_procedure_call_from_the_internet.json'; -import rule61 from './initial_access_rpc_remote_procedure_call_to_the_internet.json'; -import rule62 from './initial_access_script_executing_powershell.json'; -import rule63 from './initial_access_smb_windows_file_sharing_activity_to_the_internet.json'; -import rule64 from './initial_access_suspicious_ms_office_child_process.json'; -import rule65 from './initial_access_suspicious_ms_outlook_child_process.json'; -import rule66 from './lateral_movement_direct_outbound_smb_connection.json'; -import rule67 from './lateral_movement_service_control_spawned_script_int.json'; -import rule68 from './persistence_adobe_hijack_persistence.json'; -import rule69 from './persistence_local_scheduled_task_creation.json'; -import rule70 from './persistence_priv_escalation_via_accessibility_features.json'; -import rule71 from './persistence_shell_activity_by_web_server.json'; -import rule72 from './persistence_system_shells_via_services.json'; -import rule73 from './persistence_user_account_creation.json'; -import rule74 from './persistence_via_application_shimming.json'; -import rule75 from './privilege_escalation_endgame_cred_manipulation_detected.json'; -import rule76 from './privilege_escalation_endgame_cred_manipulation_prevented.json'; -import rule77 from './privilege_escalation_endgame_permission_theft_detected.json'; -import rule78 from './privilege_escalation_endgame_permission_theft_prevented.json'; -import rule79 from './privilege_escalation_endgame_process_injection_detected.json'; -import rule80 from './privilege_escalation_endgame_process_injection_prevented.json'; -import rule81 from './privilege_escalation_unusual_parentchild_relationship.json'; -import rule82 from './impact_modification_of_boot_config.json'; -import rule83 from './privilege_escalation_uac_bypass_event_viewer.json'; -import rule84 from './defense_evasion_msxsl_network.json'; -import rule85 from './discovery_command_system_account.json'; -import rule86 from './command_and_control_certutil_network_connection.json'; -import rule87 from './defense_evasion_cve_2020_0601.json'; -import rule88 from './command_and_control_ml_packetbeat_dns_tunneling.json'; -import rule89 from './command_and_control_ml_packetbeat_rare_dns_question.json'; -import rule90 from './command_and_control_ml_packetbeat_rare_urls.json'; -import rule91 from './command_and_control_ml_packetbeat_rare_user_agent.json'; -import rule92 from './credential_access_credential_dumping_msbuild.json'; -import rule93 from './credential_access_ml_suspicious_login_activity.json'; -import rule94 from './defense_evasion_execution_msbuild_started_by_office_app.json'; -import rule95 from './defense_evasion_execution_msbuild_started_by_script.json'; -import rule96 from './defense_evasion_execution_msbuild_started_by_system_process.json'; -import rule97 from './defense_evasion_execution_msbuild_started_renamed.json'; -import rule98 from './defense_evasion_execution_msbuild_started_unusal_process.json'; -import rule99 from './defense_evasion_injection_msbuild.json'; -import rule100 from './execution_ml_windows_anomalous_script.json'; -import rule101 from './initial_access_ml_linux_anomalous_user_name.json'; -import rule102 from './initial_access_ml_windows_anomalous_user_name.json'; -import rule103 from './initial_access_ml_windows_rare_user_type10_remote_login.json'; -import rule104 from './ml_linux_anomalous_network_activity.json'; -import rule105 from './ml_linux_anomalous_network_port_activity.json'; -import rule106 from './ml_packetbeat_rare_server_domain.json'; -import rule107 from './ml_windows_anomalous_network_activity.json'; -import rule108 from './persistence_ml_linux_anomalous_process_all_hosts.json'; -import rule109 from './persistence_ml_rare_process_by_host_linux.json'; -import rule110 from './persistence_ml_rare_process_by_host_windows.json'; -import rule111 from './persistence_ml_windows_anomalous_path_activity.json'; -import rule112 from './persistence_ml_windows_anomalous_process_all_hosts.json'; -import rule113 from './persistence_ml_windows_anomalous_process_creation.json'; -import rule114 from './persistence_ml_windows_anomalous_service.json'; -import rule115 from './privilege_escalation_ml_windows_rare_user_runas_event.json'; -import rule116 from './execution_suspicious_pdf_reader.json'; -import rule117 from './privilege_escalation_sudoers_file_mod.json'; -import rule118 from './defense_evasion_iis_httplogging_disabled.json'; -import rule119 from './execution_python_tty_shell.json'; -import rule120 from './execution_perl_tty_shell.json'; -import rule121 from './defense_evasion_base16_or_base32_encoding_or_decoding_activity.json'; -import rule122 from './defense_evasion_file_mod_writable_dir.json'; -import rule123 from './defense_evasion_disable_selinux_attempt.json'; -import rule124 from './discovery_kernel_module_enumeration.json'; -import rule125 from './lateral_movement_telnet_network_activity_external.json'; -import rule126 from './lateral_movement_telnet_network_activity_internal.json'; -import rule127 from './privilege_escalation_setuid_setgid_bit_set_via_chmod.json'; -import rule128 from './defense_evasion_kernel_module_removal.json'; -import rule129 from './defense_evasion_attempt_to_disable_syslog_service.json'; -import rule130 from './defense_evasion_file_deletion_via_shred.json'; -import rule131 from './discovery_virtual_machine_fingerprinting.json'; -import rule132 from './defense_evasion_hidden_file_dir_tmp.json'; -import rule133 from './defense_evasion_deletion_of_bash_command_line_history.json'; -import rule134 from './impact_cloudwatch_log_group_deletion.json'; -import rule135 from './impact_cloudwatch_log_stream_deletion.json'; -import rule136 from './impact_rds_instance_cluster_stoppage.json'; -import rule137 from './persistence_attempt_to_deactivate_mfa_for_okta_user_account.json'; -import rule138 from './persistence_rds_cluster_creation.json'; -import rule139 from './credential_access_attempted_bypass_of_okta_mfa.json'; -import rule140 from './defense_evasion_okta_attempt_to_deactivate_okta_policy.json'; -import rule141 from './defense_evasion_okta_attempt_to_deactivate_okta_policy_rule.json'; -import rule142 from './defense_evasion_okta_attempt_to_modify_okta_network_zone.json'; -import rule143 from './defense_evasion_okta_attempt_to_modify_okta_policy.json'; -import rule144 from './defense_evasion_okta_attempt_to_modify_okta_policy_rule.json'; -import rule145 from './defense_evasion_waf_acl_deletion.json'; -import rule146 from './impact_attempt_to_revoke_okta_api_token.json'; -import rule147 from './impact_iam_group_deletion.json'; -import rule148 from './impact_possible_okta_dos_attack.json'; -import rule149 from './impact_rds_instance_cluster_deletion.json'; -import rule150 from './initial_access_suspicious_activity_reported_by_okta_user.json'; -import rule151 from './okta_threat_detected_by_okta_threatinsight.json'; -import rule152 from './persistence_administrator_privileges_assigned_to_okta_group.json'; -import rule153 from './persistence_attempt_to_create_okta_api_token.json'; -import rule154 from './persistence_attempt_to_reset_mfa_factors_for_okta_user_account.json'; -import rule155 from './defense_evasion_cloudtrail_logging_deleted.json'; -import rule156 from './defense_evasion_ec2_network_acl_deletion.json'; -import rule157 from './impact_iam_deactivate_mfa_device.json'; -import rule158 from './defense_evasion_s3_bucket_configuration_deletion.json'; -import rule159 from './defense_evasion_guardduty_detector_deletion.json'; -import rule160 from './defense_evasion_okta_attempt_to_delete_okta_policy.json'; -import rule161 from './credential_access_iam_user_addition_to_group.json'; -import rule162 from './persistence_ec2_network_acl_creation.json'; -import rule163 from './impact_ec2_disable_ebs_encryption.json'; -import rule164 from './persistence_iam_group_creation.json'; -import rule165 from './defense_evasion_waf_rule_or_rule_group_deletion.json'; -import rule166 from './collection_cloudtrail_logging_created.json'; -import rule167 from './defense_evasion_cloudtrail_logging_suspended.json'; -import rule168 from './impact_cloudtrail_logging_updated.json'; -import rule169 from './initial_access_console_login_root.json'; -import rule170 from './defense_evasion_cloudwatch_alarm_deletion.json'; -import rule171 from './defense_evasion_ec2_flow_log_deletion.json'; -import rule172 from './defense_evasion_configuration_recorder_stopped.json'; -import rule173 from './exfiltration_ec2_snapshot_change_activity.json'; -import rule174 from './defense_evasion_config_service_rule_deletion.json'; -import rule175 from './persistence_okta_attempt_to_modify_or_delete_application_sign_on_policy.json'; -import rule176 from './command_and_control_download_rar_powershell_from_internet.json'; -import rule177 from './initial_access_password_recovery.json'; -import rule178 from './command_and_control_cobalt_strike_beacon.json'; -import rule179 from './command_and_control_fin7_c2_behavior.json'; -import rule180 from './command_and_control_halfbaked_beacon.json'; -import rule181 from './credential_access_secretsmanager_getsecretvalue.json'; -import rule182 from './initial_access_via_system_manager.json'; -import rule183 from './privilege_escalation_root_login_without_mfa.json'; -import rule184 from './privilege_escalation_updateassumerolepolicy.json'; -import rule185 from './impact_hosts_file_modified.json'; -import rule186 from './elastic_endpoint_security.json'; -import rule187 from './external_alerts.json'; -import rule188 from './ml_cloudtrail_error_message_spike.json'; -import rule189 from './ml_cloudtrail_rare_error_code.json'; -import rule190 from './ml_cloudtrail_rare_method_by_city.json'; -import rule191 from './ml_cloudtrail_rare_method_by_country.json'; -import rule192 from './ml_cloudtrail_rare_method_by_user.json'; -import rule193 from './credential_access_aws_iam_assume_role_brute_force.json'; -import rule194 from './credential_access_okta_brute_force_or_password_spraying.json'; -import rule195 from './initial_access_unusual_dns_service_children.json'; -import rule196 from './initial_access_unusual_dns_service_file_writes.json'; -import rule197 from './lateral_movement_dns_server_overflow.json'; -import rule198 from './credential_access_root_console_failure_brute_force.json'; -import rule199 from './initial_access_unsecure_elasticsearch_node.json'; -import rule200 from './impact_virtual_network_device_modified.json'; -import rule201 from './credential_access_domain_backup_dpapi_private_keys.json'; -import rule202 from './persistence_gpo_schtask_service_creation.json'; -import rule203 from './credential_access_credentials_keychains.json'; -import rule204 from './credential_access_kerberosdump_kcc.json'; -import rule205 from './defense_evasion_attempt_del_quarantine_attrib.json'; -import rule206 from './execution_suspicious_psexesvc.json'; -import rule207 from './execution_via_xp_cmdshell_mssql_stored_procedure.json'; -import rule208 from './privilege_escalation_printspooler_service_suspicious_file.json'; -import rule209 from './privilege_escalation_printspooler_suspicious_spl_file.json'; -import rule210 from './defense_evasion_azure_diagnostic_settings_deletion.json'; -import rule211 from './execution_command_virtual_machine.json'; -import rule212 from './execution_via_hidden_shell_conhost.json'; -import rule213 from './impact_resource_group_deletion.json'; -import rule214 from './persistence_via_telemetrycontroller_scheduledtask_hijack.json'; -import rule215 from './persistence_via_update_orchestrator_service_hijack.json'; -import rule216 from './collection_update_event_hub_auth_rule.json'; -import rule217 from './credential_access_iis_apppoolsa_pwd_appcmd.json'; -import rule218 from './credential_access_iis_connectionstrings_dumping.json'; -import rule219 from './defense_evasion_event_hub_deletion.json'; -import rule220 from './defense_evasion_firewall_policy_deletion.json'; -import rule221 from './defense_evasion_sdelete_like_filename_rename.json'; -import rule222 from './lateral_movement_remote_ssh_login_enabled.json'; -import rule223 from './persistence_azure_automation_account_created.json'; -import rule224 from './persistence_azure_automation_runbook_created_or_modified.json'; -import rule225 from './persistence_azure_automation_webhook_created.json'; -import rule226 from './privilege_escalation_uac_bypass_diskcleanup_hijack.json'; -import rule227 from './credential_access_attempts_to_brute_force_okta_user_account.json'; -import rule228 from './credential_access_storage_account_key_regenerated.json'; -import rule229 from './defense_evasion_suspicious_okta_user_password_reset_or_unlock_attempts.json'; -import rule230 from './defense_evasion_system_critical_proc_abnormal_file_activity.json'; -import rule231 from './defense_evasion_unusual_system_vp_child_program.json'; -import rule232 from './discovery_blob_container_access_mod.json'; -import rule233 from './persistence_mfa_disabled_for_azure_user.json'; -import rule234 from './persistence_user_added_as_owner_for_azure_application.json'; -import rule235 from './persistence_user_added_as_owner_for_azure_service_principal.json'; -import rule236 from './defense_evasion_dotnet_compiler_parent_process.json'; -import rule237 from './defense_evasion_suspicious_managedcode_host_process.json'; -import rule238 from './execution_command_shell_started_by_unusual_process.json'; -import rule239 from './defense_evasion_masquerading_as_elastic_endpoint_process.json'; -import rule240 from './defense_evasion_masquerading_suspicious_werfault_childproc.json'; -import rule241 from './defense_evasion_masquerading_werfault.json'; -import rule242 from './credential_access_bruteforce_admin_account.json'; -import rule243 from './credential_access_bruteforce_multiple_logon_failure_followed_by_success.json'; -import rule244 from './credential_access_bruteforce_multiple_logon_failure_same_srcip.json'; -import rule245 from './credential_access_key_vault_modified.json'; -import rule246 from './credential_access_mimikatz_memssp_default_logs.json'; -import rule247 from './defense_evasion_network_watcher_deletion.json'; -import rule248 from './initial_access_external_guest_user_invite.json'; -import rule249 from './defense_evasion_azure_automation_runbook_deleted.json'; -import rule250 from './defense_evasion_masquerading_renamed_autoit.json'; -import rule251 from './initial_access_consent_grant_attack_via_azure_registered_application.json'; -import rule252 from './persistence_azure_conditional_access_policy_modified.json'; -import rule253 from './persistence_azure_privileged_identity_management_role_modified.json'; -import rule254 from './command_and_control_teamviewer_remote_file_copy.json'; -import rule255 from './defense_evasion_installutil_beacon.json'; -import rule256 from './defense_evasion_mshta_beacon.json'; -import rule257 from './defense_evasion_network_connection_from_windows_binary.json'; -import rule258 from './defense_evasion_rundll32_no_arguments.json'; -import rule259 from './defense_evasion_suspicious_scrobj_load.json'; -import rule260 from './defense_evasion_suspicious_wmi_script.json'; -import rule261 from './execution_ms_office_written_file.json'; -import rule262 from './execution_pdf_written_file.json'; -import rule263 from './lateral_movement_cmd_service.json'; -import rule264 from './persistence_app_compat_shim.json'; -import rule265 from './command_and_control_remote_file_copy_desktopimgdownldr.json'; -import rule266 from './command_and_control_remote_file_copy_mpcmdrun.json'; -import rule267 from './defense_evasion_execution_suspicious_explorer_winword.json'; -import rule268 from './defense_evasion_suspicious_zoom_child_process.json'; -import rule269 from './discovery_ml_linux_system_information_discovery.json'; -import rule270 from './discovery_ml_linux_system_network_configuration_discovery.json'; -import rule271 from './discovery_ml_linux_system_network_connection_discovery.json'; -import rule272 from './discovery_ml_linux_system_process_discovery.json'; -import rule273 from './discovery_ml_linux_system_user_discovery.json'; -import rule274 from './privilege_escalation_ml_linux_anomalous_sudo_activity.json'; -import rule275 from './resource_development_ml_linux_anomalous_compiler_activity.json'; -import rule276 from './discovery_post_exploitation_external_ip_lookup.json'; -import rule277 from './initial_access_zoom_meeting_with_no_passcode.json'; -import rule278 from './defense_evasion_gcp_logging_sink_deletion.json'; -import rule279 from './defense_evasion_gcp_pub_sub_topic_deletion.json'; -import rule280 from './defense_evasion_gcp_firewall_rule_created.json'; -import rule281 from './defense_evasion_gcp_firewall_rule_deleted.json'; -import rule282 from './defense_evasion_gcp_firewall_rule_modified.json'; -import rule283 from './defense_evasion_gcp_logging_bucket_deletion.json'; -import rule284 from './defense_evasion_gcp_storage_bucket_permissions_modified.json'; -import rule285 from './impact_gcp_storage_bucket_deleted.json'; -import rule286 from './initial_access_gcp_iam_custom_role_creation.json'; -import rule287 from './persistence_gcp_iam_service_account_key_deletion.json'; -import rule288 from './persistence_gcp_key_created_for_service_account.json'; -import rule289 from './credential_access_ml_linux_anomalous_metadata_process.json'; -import rule290 from './credential_access_ml_linux_anomalous_metadata_user.json'; -import rule291 from './credential_access_ml_windows_anomalous_metadata_process.json'; -import rule292 from './credential_access_ml_windows_anomalous_metadata_user.json'; -import rule293 from './defense_evasion_gcp_storage_bucket_configuration_modified.json'; -import rule294 from './defense_evasion_gcp_virtual_private_cloud_network_deleted.json'; -import rule295 from './defense_evasion_gcp_virtual_private_cloud_route_created.json'; -import rule296 from './defense_evasion_gcp_virtual_private_cloud_route_deleted.json'; -import rule297 from './exfiltration_gcp_logging_sink_modification.json'; -import rule298 from './impact_gcp_iam_role_deletion.json'; -import rule299 from './impact_gcp_service_account_deleted.json'; -import rule300 from './impact_gcp_service_account_disabled.json'; -import rule301 from './persistence_gcp_service_account_created.json'; -import rule302 from './collection_gcp_pub_sub_subscription_creation.json'; -import rule303 from './collection_gcp_pub_sub_topic_creation.json'; -import rule304 from './defense_evasion_gcp_pub_sub_subscription_deletion.json'; -import rule305 from './persistence_azure_pim_user_added_global_admin.json'; -import rule306 from './command_and_control_cobalt_strike_default_teamserver_cert.json'; -import rule307 from './defense_evasion_enable_inbound_rdp_with_netsh.json'; -import rule308 from './defense_evasion_execution_lolbas_wuauclt.json'; -import rule309 from './privilege_escalation_unusual_svchost_childproc_childless.json'; -import rule310 from './command_and_control_rdp_tunnel_plink.json'; -import rule311 from './privilege_escalation_uac_bypass_winfw_mmc_hijack.json'; -import rule312 from './discovery_privileged_localgroup_membership.json'; -import rule313 from './persistence_ms_office_addins_file.json'; -import rule314 from './discovery_adfind_command_activity.json'; -import rule315 from './discovery_security_software_wmic.json'; -import rule316 from './execution_command_shell_via_rundll32.json'; -import rule317 from './execution_suspicious_cmd_wmi.json'; -import rule318 from './lateral_movement_via_startup_folder_rdp_smb.json'; -import rule319 from './privilege_escalation_uac_bypass_com_interface_icmluautil.json'; -import rule320 from './privilege_escalation_uac_bypass_mock_windir.json'; -import rule321 from './defense_evasion_potential_processherpaderping.json'; -import rule322 from './privilege_escalation_uac_bypass_dll_sideloading.json'; -import rule323 from './execution_shared_modules_local_sxs_dll.json'; -import rule324 from './privilege_escalation_uac_bypass_com_clipup.json'; -import rule325 from './initial_access_via_explorer_suspicious_child_parent_args.json'; -import rule326 from './defense_evasion_from_unusual_directory.json'; -import rule327 from './execution_from_unusual_path_cmdline.json'; -import rule328 from './credential_access_kerberoasting_unusual_process.json'; -import rule329 from './discovery_peripheral_device.json'; -import rule330 from './lateral_movement_mount_hidden_or_webdav_share_net.json'; -import rule331 from './defense_evasion_deleting_websvr_access_logs.json'; -import rule332 from './defense_evasion_log_files_deleted.json'; -import rule333 from './defense_evasion_timestomp_touch.json'; -import rule334 from './lateral_movement_dcom_hta.json'; -import rule335 from './lateral_movement_execution_via_file_shares_sequence.json'; -import rule336 from './privilege_escalation_uac_bypass_com_ieinstal.json'; -import rule337 from './command_and_control_common_webservices.json'; -import rule338 from './command_and_control_encrypted_channel_freesslcert.json'; -import rule339 from './defense_evasion_process_termination_followed_by_deletion.json'; -import rule340 from './lateral_movement_remote_file_copy_hidden_share.json'; -import rule341 from './defense_evasion_attempt_to_deactivate_okta_network_zone.json'; -import rule342 from './defense_evasion_attempt_to_delete_okta_network_zone.json'; -import rule343 from './defense_evasion_okta_attempt_to_delete_okta_policy_rule.json'; -import rule344 from './impact_okta_attempt_to_deactivate_okta_application.json'; -import rule345 from './impact_okta_attempt_to_delete_okta_application.json'; -import rule346 from './impact_okta_attempt_to_modify_okta_application.json'; -import rule347 from './lateral_movement_dcom_mmc20.json'; -import rule348 from './lateral_movement_dcom_shellwindow_shellbrowserwindow.json'; -import rule349 from './persistence_administrator_role_assigned_to_okta_user.json'; -import rule350 from './lateral_movement_executable_tool_transfer_smb.json'; -import rule351 from './command_and_control_dns_tunneling_nslookup.json'; -import rule352 from './lateral_movement_execution_from_tsclient_mup.json'; -import rule353 from './lateral_movement_rdp_sharprdp_target.json'; -import rule354 from './defense_evasion_clearing_windows_security_logs.json'; -import rule355 from './persistence_google_workspace_api_access_granted_via_domain_wide_delegation_of_authority.json'; -import rule356 from './defense_evasion_suspicious_short_program_name.json'; -import rule357 from './lateral_movement_incoming_wmi.json'; -import rule358 from './persistence_via_hidden_run_key_valuename.json'; -import rule359 from './credential_access_potential_macos_ssh_bruteforce.json'; -import rule360 from './credential_access_promt_for_pwd_via_osascript.json'; -import rule361 from './lateral_movement_remote_services.json'; -import rule362 from './defense_evasion_domain_added_to_google_workspace_trusted_domains.json'; -import rule363 from './execution_suspicious_image_load_wmi_ms_office.json'; -import rule364 from './execution_suspicious_powershell_imgload.json'; -import rule365 from './impact_google_workspace_admin_role_deletion.json'; -import rule366 from './impact_google_workspace_mfa_enforcement_disabled.json'; -import rule367 from './persistence_application_added_to_google_workspace_domain.json'; -import rule368 from './persistence_evasion_registry_ifeo_injection.json'; -import rule369 from './persistence_google_workspace_admin_role_assigned_to_user.json'; -import rule370 from './persistence_google_workspace_custom_admin_role_created.json'; -import rule371 from './persistence_google_workspace_policy_modified.json'; -import rule372 from './persistence_google_workspace_role_modified.json'; -import rule373 from './persistence_mfa_disabled_for_google_workspace_organization.json'; -import rule374 from './persistence_suspicious_image_load_scheduled_task_ms_office.json'; -import rule375 from './defense_evasion_masquerading_trusted_directory.json'; -import rule376 from './exfiltration_microsoft_365_exchange_transport_rule_creation.json'; -import rule377 from './initial_access_microsoft_365_exchange_safelinks_disabled.json'; -import rule378 from './persistence_appcertdlls_registry.json'; -import rule379 from './persistence_appinitdlls_registry.json'; -import rule380 from './persistence_microsoft_365_exchange_dkim_signing_config_disabled.json'; -import rule381 from './persistence_registry_uncommon.json'; -import rule382 from './persistence_run_key_and_startup_broad.json'; -import rule383 from './persistence_services_registry.json'; -import rule384 from './persistence_startup_folder_file_written_by_suspicious_process.json'; -import rule385 from './persistence_startup_folder_scripts.json'; -import rule386 from './persistence_suspicious_com_hijack_registry.json'; -import rule387 from './persistence_via_lsa_security_support_provider_registry.json'; -import rule388 from './defense_evasion_microsoft_365_exchange_malware_filter_policy_deletion.json'; -import rule389 from './defense_evasion_microsoft_365_exchange_malware_filter_rule_mod.json'; -import rule390 from './defense_evasion_microsoft_365_exchange_safe_attach_rule_disabled.json'; -import rule391 from './exfiltration_microsoft_365_exchange_transport_rule_mod.json'; -import rule392 from './initial_access_microsoft_365_exchange_anti_phish_policy_deletion.json'; -import rule393 from './initial_access_microsoft_365_exchange_anti_phish_rule_mod.json'; -import rule394 from './lateral_movement_suspicious_rdp_client_imageload.json'; -import rule395 from './persistence_runtime_run_key_startup_susp_procs.json'; -import rule396 from './persistence_suspicious_scheduled_task_runtime.json'; -import rule397 from './defense_evasion_microsoft_365_exchange_dlp_policy_removed.json'; -import rule398 from './lateral_movement_scheduled_task_target.json'; -import rule399 from './persistence_microsoft_365_exchange_management_role_assignment.json'; -import rule400 from './persistence_microsoft_365_teams_guest_access_enabled.json'; -import rule401 from './credential_access_dump_registry_hives.json'; -import rule402 from './defense_evasion_scheduledjobs_at_protocol_enabled.json'; -import rule403 from './persistence_ms_outlook_vba_template.json'; -import rule404 from './persistence_suspicious_service_created_registry.json'; -import rule405 from './privilege_escalation_named_pipe_impersonation.json'; -import rule406 from './credential_access_cmdline_dump_tool.json'; -import rule407 from './credential_access_copy_ntds_sam_volshadowcp_cmdline.json'; -import rule408 from './credential_access_lsass_memdump_file_created.json'; -import rule409 from './lateral_movement_incoming_winrm_shell_execution.json'; -import rule410 from './lateral_movement_powershell_remoting_target.json'; -import rule411 from './command_and_control_port_forwarding_added_registry.json'; -import rule412 from './defense_evasion_hide_encoded_executable_registry.json'; -import rule413 from './lateral_movement_rdp_enabled_registry.json'; -import rule414 from './privilege_escalation_printspooler_registry_copyfiles.json'; -import rule415 from './privilege_escalation_rogue_windir_environment_var.json'; -import rule416 from './initial_access_scripts_process_started_via_wmi.json'; -import rule417 from './command_and_control_iexplore_via_com.json'; -import rule418 from './command_and_control_remote_file_copy_scripts.json'; -import rule419 from './persistence_local_scheduled_task_scripting.json'; -import rule420 from './persistence_startup_folder_file_written_by_unsigned_process.json'; -import rule421 from './command_and_control_remote_file_copy_powershell.json'; -import rule422 from './credential_access_microsoft_365_brute_force_user_account_attempt.json'; -import rule423 from './persistence_microsoft_365_teams_custom_app_interaction_allowed.json'; -import rule424 from './persistence_microsoft_365_teams_external_access_enabled.json'; -import rule425 from './credential_access_microsoft_365_potential_password_spraying_attack.json'; -import rule426 from './impact_stop_process_service_threshold.json'; -import rule427 from './collection_winrar_encryption.json'; -import rule428 from './defense_evasion_unusual_dir_ads.json'; -import rule429 from './discovery_admin_recon.json'; -import rule430 from './discovery_net_view.json'; -import rule431 from './discovery_remote_system_discovery_commands_windows.json'; -import rule432 from './persistence_via_windows_management_instrumentation_event_subscription.json'; -import rule433 from './credential_access_mimikatz_powershell_module.json'; -import rule434 from './execution_scripting_osascript_exec_followed_by_netcon.json'; -import rule435 from './execution_shell_execution_via_apple_scripting.json'; -import rule436 from './persistence_creation_change_launch_agents_file.json'; -import rule437 from './persistence_creation_modif_launch_deamon_sequence.json'; -import rule438 from './persistence_folder_action_scripts_runtime.json'; -import rule439 from './persistence_login_logout_hooks_defaults.json'; -import rule440 from './privilege_escalation_explicit_creds_via_scripting.json'; -import rule441 from './command_and_control_sunburst_c2_activity_detected.json'; -import rule442 from './defense_evasion_azure_application_credential_modification.json'; -import rule443 from './defense_evasion_azure_service_principal_addition.json'; -import rule444 from './defense_evasion_solarwinds_backdoor_service_disabled_via_registry.json'; -import rule445 from './execution_apt_solarwinds_backdoor_child_cmd_powershell.json'; -import rule446 from './execution_apt_solarwinds_backdoor_unusual_child_processes.json'; -import rule447 from './initial_access_azure_active_directory_powershell_signin.json'; -import rule448 from './collection_email_powershell_exchange_mailbox.json'; -import rule449 from './execution_scheduled_task_powershell_source.json'; -import rule450 from './persistence_powershell_exch_mailbox_activesync_add_device.json'; -import rule451 from './persistence_docker_shortcuts_plist_modification.json'; -import rule452 from './persistence_evasion_hidden_local_account_creation.json'; -import rule453 from './persistence_finder_sync_plugin_pluginkit.json'; -import rule454 from './discovery_security_software_grep.json'; -import rule455 from './credential_access_cookies_chromium_browsers_debugging.json'; -import rule456 from './credential_access_ssh_backdoor_log.json'; -import rule457 from './persistence_credential_access_modify_auth_module_or_config.json'; -import rule458 from './persistence_credential_access_modify_ssh_binaries.json'; -import rule459 from './credential_access_collection_sensitive_files.json'; -import rule460 from './persistence_ssh_authorized_keys_modification.json'; -import rule461 from './defense_evasion_defender_disabled_via_registry.json'; -import rule462 from './defense_evasion_privacy_controls_tcc_database_modification.json'; -import rule463 from './execution_initial_access_suspicious_browser_childproc.json'; -import rule464 from './execution_script_via_automator_workflows.json'; -import rule465 from './persistence_modification_sublime_app_plugin_or_script.json'; -import rule466 from './privilege_escalation_applescript_with_admin_privs.json'; -import rule467 from './credential_access_dumping_keychain_security.json'; -import rule468 from './initial_access_azure_active_directory_high_risk_signin.json'; -import rule469 from './initial_access_suspicious_mac_ms_office_child_process.json'; -import rule470 from './credential_access_mitm_localhost_webproxy.json'; -import rule471 from './persistence_kde_autostart_modification.json'; -import rule472 from './persistence_user_account_added_to_privileged_group_ad.json'; -import rule473 from './defense_evasion_attempt_to_disable_gatekeeper.json'; -import rule474 from './defense_evasion_sandboxed_office_app_suspicious_zip_file.json'; -import rule475 from './persistence_emond_rules_file_creation.json'; -import rule476 from './persistence_emond_rules_process_execution.json'; -import rule477 from './discovery_users_domain_built_in_commands.json'; -import rule478 from './execution_pentest_eggshell_remote_admin_tool.json'; -import rule479 from './defense_evasion_install_root_certificate.json'; -import rule480 from './persistence_credential_access_authorization_plugin_creation.json'; -import rule481 from './persistence_directory_services_plugins_modification.json'; -import rule482 from './defense_evasion_modify_environment_launchctl.json'; -import rule483 from './defense_evasion_safari_config_change.json'; -import rule484 from './defense_evasion_apple_softupdates_modification.json'; -import rule485 from './credential_access_mod_wdigest_security_provider.json'; -import rule486 from './credential_access_saved_creds_vaultcmd.json'; -import rule487 from './defense_evasion_file_creation_mult_extension.json'; -import rule488 from './execution_enumeration_via_wmiprvse.json'; -import rule489 from './execution_suspicious_jar_child_process.json'; -import rule490 from './persistence_shell_profile_modification.json'; -import rule491 from './persistence_suspicious_calendar_modification.json'; -import rule492 from './persistence_time_provider_mod.json'; -import rule493 from './privilege_escalation_exploit_adobe_acrobat_updater.json'; -import rule494 from './defense_evasion_sip_provider_mod.json'; -import rule495 from './execution_com_object_xwizard.json'; -import rule496 from './privilege_escalation_disable_uac_registry.json'; -import rule497 from './defense_evasion_unusual_ads_file_creation.json'; -import rule498 from './persistence_loginwindow_plist_modification.json'; -import rule499 from './persistence_periodic_tasks_file_mdofiy.json'; -import rule500 from './persistence_via_atom_init_file_modification.json'; -import rule501 from './privilege_escalation_lsa_auth_package.json'; -import rule502 from './privilege_escalation_port_monitor_print_pocessor_abuse.json'; -import rule503 from './credential_access_dumping_hashes_bi_cmds.json'; -import rule504 from './lateral_movement_mounting_smb_share.json'; -import rule505 from './privilege_escalation_echo_nopasswd_sudoers.json'; -import rule506 from './privilege_escalation_ld_preload_shared_object_modif.json'; -import rule507 from './privilege_escalation_root_crontab_filemod.json'; -import rule508 from './defense_evasion_create_mod_root_certificate.json'; -import rule509 from './privilege_escalation_sudo_buffer_overflow.json'; -import rule510 from './execution_installer_package_spawned_network_event.json'; -import rule511 from './initial_access_suspicious_ms_exchange_files.json'; -import rule512 from './initial_access_suspicious_ms_exchange_process.json'; -import rule513 from './initial_access_suspicious_ms_exchange_worker_child_process.json'; -import rule514 from './persistence_evasion_registry_startup_shell_folder_modified.json'; -import rule515 from './persistence_local_scheduled_job_creation.json'; -import rule516 from './persistence_via_wmi_stdregprov_run_services.json'; -import rule517 from './credential_access_persistence_network_logon_provider_modification.json'; -import rule518 from './lateral_movement_defense_evasion_lanman_nullsessionpipe_modification.json'; -import rule519 from './collection_microsoft_365_new_inbox_rule.json'; -import rule520 from './ml_high_count_network_denies.json'; -import rule521 from './ml_high_count_network_events.json'; -import rule522 from './ml_rare_destination_country.json'; -import rule523 from './ml_spike_in_traffic_to_a_country.json'; -import rule524 from './command_and_control_tunneling_via_earthworm.json'; -import rule525 from './lateral_movement_evasion_rdp_shadowing.json'; -import rule526 from './threat_intel_fleet_integrations.json'; -import rule527 from './exfiltration_ec2_vm_export_failure.json'; -import rule528 from './exfiltration_ec2_full_network_packet_capture_detected.json'; -import rule529 from './impact_azure_service_principal_credentials_added.json'; -import rule530 from './persistence_ec2_security_group_configuration_change_detection.json'; -import rule531 from './defense_evasion_disabling_windows_logs.json'; -import rule532 from './persistence_route_53_domain_transfer_lock_disabled.json'; -import rule533 from './persistence_route_53_domain_transferred_to_another_account.json'; -import rule534 from './initial_access_okta_user_attempted_unauthorized_access.json'; -import rule535 from './credential_access_user_excessive_sso_logon_errors.json'; -import rule536 from './persistence_exchange_suspicious_mailbox_right_delegation.json'; -import rule537 from './privilege_escalation_new_or_modified_federation_domain.json'; -import rule538 from './privilege_escalation_sts_assumerole_usage.json'; -import rule539 from './privilege_escalation_sts_getsessiontoken_abuse.json'; -import rule540 from './defense_evasion_suspicious_execution_from_mounted_device.json'; -import rule541 from './defense_evasion_unusual_network_connection_via_dllhost.json'; -import rule542 from './defense_evasion_amsienable_key_mod.json'; -import rule543 from './impact_rds_group_deletion.json'; -import rule544 from './persistence_rds_group_creation.json'; -import rule545 from './persistence_route_table_created.json'; -import rule546 from './persistence_route_table_modified_or_deleted.json'; -import rule547 from './exfiltration_rds_snapshot_export.json'; -import rule548 from './persistence_rds_instance_creation.json'; -import rule549 from './privilege_escalation_gcp_kubernetes_rolebindings_created_or_patched.json'; -import rule550 from './credential_access_ml_auth_spike_in_failed_logon_events.json'; -import rule551 from './credential_access_ml_auth_spike_in_logon_events.json'; -import rule552 from './credential_access_ml_auth_spike_in_logon_events_from_a_source_ip.json'; -import rule553 from './initial_access_ml_auth_rare_hour_for_a_user_to_logon.json'; -import rule554 from './initial_access_ml_auth_rare_source_ip_for_a_user.json'; -import rule555 from './initial_access_ml_auth_rare_user_logon.json'; -import rule556 from './privilege_escalation_cyberarkpas_error_audit_event_promotion.json'; -import rule557 from './privilege_escalation_cyberarkpas_recommended_events_to_monitor_promotion.json'; -import rule558 from './defense_evasion_kubernetes_events_deleted.json'; -import rule559 from './impact_kubernetes_pod_deleted.json'; -import rule560 from './exfiltration_rds_snapshot_restored.json'; -import rule561 from './privilege_escalation_printspooler_suspicious_file_deletion.json'; -import rule562 from './privilege_escalation_unusual_printspooler_childprocess.json'; -import rule563 from './defense_evasion_disabling_windows_defender_powershell.json'; -import rule564 from './defense_evasion_enable_network_discovery_with_netsh.json'; -import rule565 from './defense_evasion_execution_windefend_unusual_path.json'; -import rule566 from './defense_evasion_agent_spoofing_mismatched_id.json'; -import rule567 from './defense_evasion_agent_spoofing_multiple_hosts.json'; -import rule568 from './defense_evasion_parent_process_pid_spoofing.json'; -import rule569 from './impact_microsoft_365_potential_ransomware_activity.json'; -import rule570 from './impact_microsoft_365_unusual_volume_of_file_deletion.json'; -import rule571 from './initial_access_microsoft_365_user_restricted_from_sending_email.json'; -import rule572 from './defense_evasion_elasticache_security_group_creation.json'; -import rule573 from './defense_evasion_elasticache_security_group_modified_or_deleted.json'; -import rule574 from './impact_volume_shadow_copy_deletion_via_powershell.json'; -import rule575 from './persistence_route_53_hosted_zone_associated_with_a_vpc.json'; -import rule576 from './defense_evasion_defender_exclusion_via_powershell.json'; -import rule577 from './defense_evasion_dns_over_https_enabled.json'; -import rule578 from './defense_evasion_frontdoor_firewall_policy_deletion.json'; -import rule579 from './credential_access_azure_full_network_packet_capture_detected.json'; -import rule580 from './persistence_webshell_detection.json'; -import rule581 from './defense_evasion_suppression_rule_created.json'; -import rule582 from './impact_efs_filesystem_or_mount_deleted.json'; -import rule583 from './defense_evasion_execution_control_panel_suspicious_args.json'; -import rule584 from './defense_evasion_azure_blob_permissions_modified.json'; -import rule585 from './privilege_escalation_aws_suspicious_saml_activity.json'; -import rule586 from './credential_access_potential_lsa_memdump_via_mirrordump.json'; -import rule587 from './discovery_virtual_machine_fingerprinting_grep.json'; -import rule588 from './impact_backup_file_deletion.json'; -import rule589 from './credential_access_posh_minidump.json'; -import rule590 from './persistence_screensaver_engine_unexpected_child_process.json'; -import rule591 from './persistence_screensaver_plist_file_modification.json'; -import rule592 from './credential_access_suspicious_lsass_access_memdump.json'; -import rule593 from './defense_evasion_suspicious_process_access_direct_syscall.json'; -import rule594 from './discovery_posh_suspicious_api_functions.json'; -import rule595 from './privilege_escalation_via_rogue_named_pipe.json'; -import rule596 from './credential_access_suspicious_lsass_access_via_snapshot.json'; -import rule597 from './defense_evasion_posh_process_injection.json'; -import rule598 from './collection_posh_keylogger.json'; -import rule599 from './defense_evasion_posh_assembly_load.json'; -import rule600 from './defense_evasion_powershell_windows_firewall_disabled.json'; -import rule601 from './execution_posh_portable_executable.json'; -import rule602 from './execution_posh_psreflect.json'; -import rule603 from './credential_access_suspicious_comsvcs_imageload.json'; -import rule604 from './impact_aws_eventbridge_rule_disabled_or_deleted.json'; -import rule605 from './defense_evasion_microsoft_defender_tampering.json'; -import rule606 from './initial_access_azure_active_directory_high_risk_signin_atrisk_or_confirmed.json'; -import rule607 from './persistence_remote_password_reset.json'; -import rule608 from './privilege_escalation_azure_kubernetes_rolebinding_created.json'; -import rule609 from './collection_posh_audio_capture.json'; -import rule610 from './collection_posh_screen_grabber.json'; -import rule611 from './defense_evasion_posh_compressed.json'; -import rule612 from './defense_evasion_suspicious_process_creation_calltrace.json'; -import rule613 from './privilege_escalation_group_policy_iniscript.json'; -import rule614 from './privilege_escalation_group_policy_privileged_groups.json'; -import rule615 from './privilege_escalation_group_policy_scheduled_task.json'; -import rule616 from './defense_evasion_clearing_windows_console_history.json'; -import rule617 from './threat_intel_filebeat8x.json'; -import rule618 from './privilege_escalation_installertakeover.json'; -import rule619 from './credential_access_via_snapshot_lsass_clone_creation.json'; -import rule620 from './persistence_via_bits_job_notify_command.json'; -import rule621 from './execution_suspicious_java_netcon_childproc.json'; -import rule622 from './privilege_escalation_samaccountname_spoofing_attack.json'; -import rule623 from './credential_access_symbolic_link_to_shadow_copy_created.json'; -import rule624 from './credential_access_mfa_push_brute_force.json'; -import rule625 from './persistence_azure_global_administrator_role_assigned.json'; -import rule626 from './persistence_microsoft_365_global_administrator_role_assign.json'; -import rule627 from './lateral_movement_malware_uploaded_onedrive.json'; -import rule628 from './lateral_movement_malware_uploaded_sharepoint.json'; -import rule629 from './defense_evasion_ms_office_suspicious_regmod.json'; -import rule630 from './initial_access_o365_user_reported_phish_malware.json'; -import rule631 from './defense_evasion_microsoft_365_mailboxauditbypassassociation.json'; -import rule632 from './credential_access_disable_kerberos_preauth.json'; -import rule633 from './credential_access_posh_request_ticket.json'; -import rule634 from './credential_access_shadow_credentials.json'; -import rule635 from './privilege_escalation_pkexec_envar_hijack.json'; -import rule636 from './credential_access_seenabledelegationprivilege_assigned_to_user.json'; -import rule637 from './persistence_msds_alloweddelegateto_krbtgt.json'; -import rule638 from './defense_evasion_disable_posh_scriptblocklogging.json'; -import rule639 from './persistence_ad_adminsdholder.json'; -import rule640 from './privilege_escalation_windows_service_via_unusual_client.json'; -import rule641 from './credential_access_dcsync_replication_rights.json'; -import rule642 from './credential_access_lsass_memdump_handle_access.json'; -import rule643 from './credential_access_moving_registry_hive_via_smb.json'; -import rule644 from './credential_access_suspicious_winreg_access_via_sebackup_priv.json'; -import rule645 from './credential_access_spn_attribute_modified.json'; -import rule646 from './persistence_dontexpirepasswd_account.json'; -import rule647 from './persistence_sdprop_exclusion_dsheuristics.json'; -import rule648 from './credential_access_remote_sam_secretsdump.json'; -import rule649 from './defense_evasion_workfolders_control_execution.json'; -import rule650 from './credential_access_user_impersonation_access.json'; -import rule651 from './persistence_redshift_instance_creation.json'; -import rule652 from './persistence_crontab_creation.json'; -import rule653 from './privilege_escalation_krbrelayup_service_creation.json'; -import rule654 from './credential_access_relay_ntlm_auth_via_http_spoolss.json'; -import rule655 from './execution_shell_evasion_linux_binary.json'; -import rule656 from './execution_process_started_in_shared_memory_directory.json'; -import rule657 from './execution_abnormal_process_id_file_created.json'; -import rule658 from './execution_process_started_from_process_id_file.json'; -import rule659 from './privilege_escalation_suspicious_dnshostname_update.json'; -import rule660 from './command_and_control_connection_attempt_by_non_ssh_root_session.json'; -import rule661 from './execution_user_exec_to_pod.json'; -import rule662 from './defense_evasion_elastic_agent_service_terminated.json'; -import rule663 from './defense_evasion_proxy_execution_via_msdt.json'; -import rule664 from './discovery_enumerating_domain_trusts_via_nltest.json'; -import rule665 from './credential_access_lsass_handle_via_malseclogon.json'; -import rule666 from './discovery_suspicious_self_subject_review.json'; -import rule667 from './initial_access_evasion_suspicious_htm_file_creation.json'; -import rule668 from './persistence_exposed_service_created_with_type_nodeport.json'; -import rule669 from './privilege_escalation_pod_created_with_hostipc.json'; -import rule670 from './privilege_escalation_pod_created_with_hostnetwork.json'; -import rule671 from './privilege_escalation_pod_created_with_hostpid.json'; -import rule672 from './privilege_escalation_privileged_pod_created.json'; -import rule673 from './execution_tc_bpf_filter.json'; -import rule674 from './persistence_insmod_kernel_module_load.json'; -import rule675 from './privilege_escalation_pod_created_with_sensitive_hospath_volume.json'; -import rule676 from './persistence_dynamic_linker_backup.json'; -import rule677 from './defense_evasion_hidden_shared_object.json'; -import rule678 from './defense_evasion_chattr_immutable_file.json'; -import rule679 from './persistence_chkconfig_service_add.json'; -import rule680 from './persistence_etc_file_creation.json'; -import rule681 from './impact_process_kill_threshold.json'; -import rule682 from './discovery_posh_invoke_sharefinder.json'; -import rule683 from './privilege_escalation_posh_token_impersonation.json'; -import rule684 from './collection_google_drive_ownership_transferred_via_google_workspace.json'; -import rule685 from './persistence_google_workspace_user_group_access_modified_to_allow_external_access.json'; -import rule686 from './defense_evasion_application_removed_from_blocklist_in_google_workspace.json'; -import rule687 from './defense_evasion_google_workspace_restrictions_for_google_marketplace_changed_to_allow_any_app.json'; -import rule688 from './persistence_google_workspace_2sv_policy_disabled.json'; -import rule689 from './credential_access_generic_localdumps.json'; -import rule690 from './defense_evasion_persistence_temp_scheduled_task.json'; -import rule691 from './lateral_movement_remote_task_creation_winlog.json'; -import rule692 from './persistence_scheduled_task_creation_winlog.json'; -import rule693 from './persistence_scheduled_task_updated.json'; -import rule694 from './credential_access_saved_creds_vault_winlog.json'; -import rule695 from './privilege_escalation_create_process_as_different_user.json'; -import rule696 from './privilege_escalation_unshare_namesapce_manipulation.json'; -import rule697 from './privilege_escalation_shadow_file_read.json'; -import rule698 from './defense_evasion_google_workspace_bitlocker_setting_disabled.json'; -import rule699 from './persistence_google_workspace_user_organizational_unit_changed.json'; -import rule700 from './collection_google_workspace_custom_gmail_route_created_or_modified.json'; -import rule701 from './discovery_denied_service_account_request.json'; -import rule702 from './initial_access_anonymous_request_authorized.json'; -import rule703 from './privilege_escalation_suspicious_assignment_of_controller_service_account.json'; -import rule704 from './credential_access_bruteforce_passowrd_guessing.json'; -import rule705 from './credential_access_potential_linux_ssh_bruteforce.json'; -import rule706 from './credential_access_potential_linux_ssh_bruteforce_root.json'; - +import rule1 from './apm_403_response_to_a_post.json'; +import rule2 from './apm_405_response_method_not_allowed.json'; +import rule3 from './apm_sqlmap_user_agent.json'; +import rule4 from './collection_cloudtrail_logging_created.json'; +import rule5 from './collection_email_powershell_exchange_mailbox.json'; +import rule6 from './collection_gcp_pub_sub_subscription_creation.json'; +import rule7 from './collection_gcp_pub_sub_topic_creation.json'; +import rule8 from './collection_google_drive_ownership_transferred_via_google_workspace.json'; +import rule9 from './collection_google_workspace_custom_gmail_route_created_or_modified.json'; +import rule10 from './collection_microsoft_365_new_inbox_rule.json'; +import rule11 from './collection_posh_audio_capture.json'; +import rule12 from './collection_posh_keylogger.json'; +import rule13 from './collection_posh_screen_grabber.json'; +import rule14 from './collection_update_event_hub_auth_rule.json'; +import rule15 from './collection_winrar_encryption.json'; +import rule16 from './command_and_control_certutil_network_connection.json'; +import rule17 from './command_and_control_cobalt_strike_beacon.json'; +import rule18 from './command_and_control_cobalt_strike_default_teamserver_cert.json'; +import rule19 from './command_and_control_common_webservices.json'; +import rule20 from './command_and_control_connection_attempt_by_non_ssh_root_session.json'; +import rule21 from './command_and_control_dns_tunneling_nslookup.json'; +import rule22 from './command_and_control_download_rar_powershell_from_internet.json'; +import rule23 from './command_and_control_encrypted_channel_freesslcert.json'; +import rule24 from './command_and_control_fin7_c2_behavior.json'; +import rule25 from './command_and_control_halfbaked_beacon.json'; +import rule26 from './command_and_control_iexplore_via_com.json'; +import rule27 from './command_and_control_linux_iodine_activity.json'; +import rule28 from './command_and_control_ml_packetbeat_dns_tunneling.json'; +import rule29 from './command_and_control_ml_packetbeat_rare_dns_question.json'; +import rule30 from './command_and_control_ml_packetbeat_rare_urls.json'; +import rule31 from './command_and_control_ml_packetbeat_rare_user_agent.json'; +import rule32 from './command_and_control_nat_traversal_port_activity.json'; +import rule33 from './command_and_control_port_26_activity.json'; +import rule34 from './command_and_control_port_forwarding_added_registry.json'; +import rule35 from './command_and_control_rdp_remote_desktop_protocol_from_the_internet.json'; +import rule36 from './command_and_control_rdp_tunnel_plink.json'; +import rule37 from './command_and_control_remote_file_copy_desktopimgdownldr.json'; +import rule38 from './command_and_control_remote_file_copy_mpcmdrun.json'; +import rule39 from './command_and_control_remote_file_copy_powershell.json'; +import rule40 from './command_and_control_remote_file_copy_scripts.json'; +import rule41 from './command_and_control_sunburst_c2_activity_detected.json'; +import rule42 from './command_and_control_teamviewer_remote_file_copy.json'; +import rule43 from './command_and_control_telnet_port_activity.json'; +import rule44 from './command_and_control_tunneling_via_earthworm.json'; +import rule45 from './command_and_control_vnc_virtual_network_computing_from_the_internet.json'; +import rule46 from './command_and_control_vnc_virtual_network_computing_to_the_internet.json'; +import rule47 from './credential_access_access_to_browser_credentials_procargs.json'; +import rule48 from './credential_access_attempted_bypass_of_okta_mfa.json'; +import rule49 from './credential_access_attempts_to_brute_force_okta_user_account.json'; +import rule50 from './credential_access_aws_iam_assume_role_brute_force.json'; +import rule51 from './credential_access_azure_full_network_packet_capture_detected.json'; +import rule52 from './credential_access_bruteforce_admin_account.json'; +import rule53 from './credential_access_bruteforce_multiple_logon_failure_followed_by_success.json'; +import rule54 from './credential_access_bruteforce_multiple_logon_failure_same_srcip.json'; +import rule55 from './credential_access_bruteforce_passowrd_guessing.json'; +import rule56 from './credential_access_cmdline_dump_tool.json'; +import rule57 from './credential_access_collection_sensitive_files.json'; +import rule58 from './credential_access_cookies_chromium_browsers_debugging.json'; +import rule59 from './credential_access_copy_ntds_sam_volshadowcp_cmdline.json'; +import rule60 from './credential_access_credential_dumping_msbuild.json'; +import rule61 from './credential_access_credentials_keychains.json'; +import rule62 from './credential_access_dcsync_replication_rights.json'; +import rule63 from './credential_access_disable_kerberos_preauth.json'; +import rule64 from './credential_access_domain_backup_dpapi_private_keys.json'; +import rule65 from './credential_access_dump_registry_hives.json'; +import rule66 from './credential_access_dumping_hashes_bi_cmds.json'; +import rule67 from './credential_access_dumping_keychain_security.json'; +import rule68 from './credential_access_endgame_cred_dumping_detected.json'; +import rule69 from './credential_access_endgame_cred_dumping_prevented.json'; +import rule70 from './credential_access_generic_localdumps.json'; +import rule71 from './credential_access_iam_user_addition_to_group.json'; +import rule72 from './credential_access_iis_apppoolsa_pwd_appcmd.json'; +import rule73 from './credential_access_iis_connectionstrings_dumping.json'; +import rule74 from './credential_access_kerberoasting_unusual_process.json'; +import rule75 from './credential_access_kerberosdump_kcc.json'; +import rule76 from './credential_access_key_vault_modified.json'; +import rule77 from './credential_access_keychain_pwd_retrieval_security_cmd.json'; +import rule78 from './credential_access_lsass_handle_via_malseclogon.json'; +import rule79 from './credential_access_lsass_memdump_file_created.json'; +import rule80 from './credential_access_lsass_memdump_handle_access.json'; +import rule81 from './credential_access_mfa_push_brute_force.json'; +import rule82 from './credential_access_microsoft_365_brute_force_user_account_attempt.json'; +import rule83 from './credential_access_microsoft_365_potential_password_spraying_attack.json'; +import rule84 from './credential_access_mimikatz_memssp_default_logs.json'; +import rule85 from './credential_access_mimikatz_powershell_module.json'; +import rule86 from './credential_access_mitm_localhost_webproxy.json'; +import rule87 from './credential_access_ml_auth_spike_in_failed_logon_events.json'; +import rule88 from './credential_access_ml_auth_spike_in_logon_events.json'; +import rule89 from './credential_access_ml_auth_spike_in_logon_events_from_a_source_ip.json'; +import rule90 from './credential_access_ml_linux_anomalous_metadata_process.json'; +import rule91 from './credential_access_ml_linux_anomalous_metadata_user.json'; +import rule92 from './credential_access_ml_suspicious_login_activity.json'; +import rule93 from './credential_access_ml_windows_anomalous_metadata_process.json'; +import rule94 from './credential_access_ml_windows_anomalous_metadata_user.json'; +import rule95 from './credential_access_mod_wdigest_security_provider.json'; +import rule96 from './credential_access_moving_registry_hive_via_smb.json'; +import rule97 from './credential_access_okta_brute_force_or_password_spraying.json'; +import rule98 from './credential_access_persistence_network_logon_provider_modification.json'; +import rule99 from './credential_access_posh_minidump.json'; +import rule100 from './credential_access_posh_request_ticket.json'; +import rule101 from './credential_access_potential_linux_ssh_bruteforce.json'; +import rule102 from './credential_access_potential_linux_ssh_bruteforce_root.json'; +import rule103 from './credential_access_potential_lsa_memdump_via_mirrordump.json'; +import rule104 from './credential_access_potential_macos_ssh_bruteforce.json'; +import rule105 from './credential_access_promt_for_pwd_via_osascript.json'; +import rule106 from './credential_access_relay_ntlm_auth_via_http_spoolss.json'; +import rule107 from './credential_access_remote_sam_secretsdump.json'; +import rule108 from './credential_access_root_console_failure_brute_force.json'; +import rule109 from './credential_access_saved_creds_vault_winlog.json'; +import rule110 from './credential_access_saved_creds_vaultcmd.json'; +import rule111 from './credential_access_secretsmanager_getsecretvalue.json'; +import rule112 from './credential_access_seenabledelegationprivilege_assigned_to_user.json'; +import rule113 from './credential_access_shadow_credentials.json'; +import rule114 from './credential_access_spn_attribute_modified.json'; +import rule115 from './credential_access_ssh_backdoor_log.json'; +import rule116 from './credential_access_storage_account_key_regenerated.json'; +import rule117 from './credential_access_suspicious_comsvcs_imageload.json'; +import rule118 from './credential_access_suspicious_lsass_access_memdump.json'; +import rule119 from './credential_access_suspicious_lsass_access_via_snapshot.json'; +import rule120 from './credential_access_suspicious_winreg_access_via_sebackup_priv.json'; +import rule121 from './credential_access_symbolic_link_to_shadow_copy_created.json'; +import rule122 from './credential_access_systemkey_dumping.json'; +import rule123 from './credential_access_user_excessive_sso_logon_errors.json'; +import rule124 from './credential_access_user_impersonation_access.json'; +import rule125 from './credential_access_via_snapshot_lsass_clone_creation.json'; +import rule126 from './defense_evasion_adding_the_hidden_file_attribute_with_via_attribexe.json'; +import rule127 from './defense_evasion_agent_spoofing_mismatched_id.json'; +import rule128 from './defense_evasion_agent_spoofing_multiple_hosts.json'; +import rule129 from './defense_evasion_amsienable_key_mod.json'; +import rule130 from './defense_evasion_apple_softupdates_modification.json'; +import rule131 from './defense_evasion_application_removed_from_blocklist_in_google_workspace.json'; +import rule132 from './defense_evasion_attempt_del_quarantine_attrib.json'; +import rule133 from './defense_evasion_attempt_to_deactivate_okta_network_zone.json'; +import rule134 from './defense_evasion_attempt_to_delete_okta_network_zone.json'; +import rule135 from './defense_evasion_attempt_to_disable_gatekeeper.json'; +import rule136 from './defense_evasion_attempt_to_disable_syslog_service.json'; +import rule137 from './defense_evasion_azure_application_credential_modification.json'; +import rule138 from './defense_evasion_azure_automation_runbook_deleted.json'; +import rule139 from './defense_evasion_azure_blob_permissions_modified.json'; +import rule140 from './defense_evasion_azure_diagnostic_settings_deletion.json'; +import rule141 from './defense_evasion_azure_service_principal_addition.json'; +import rule142 from './defense_evasion_base16_or_base32_encoding_or_decoding_activity.json'; +import rule143 from './defense_evasion_chattr_immutable_file.json'; +import rule144 from './defense_evasion_clearing_windows_console_history.json'; +import rule145 from './defense_evasion_clearing_windows_event_logs.json'; +import rule146 from './defense_evasion_clearing_windows_security_logs.json'; +import rule147 from './defense_evasion_cloudtrail_logging_deleted.json'; +import rule148 from './defense_evasion_cloudtrail_logging_suspended.json'; +import rule149 from './defense_evasion_cloudwatch_alarm_deletion.json'; +import rule150 from './defense_evasion_config_service_rule_deletion.json'; +import rule151 from './defense_evasion_configuration_recorder_stopped.json'; +import rule152 from './defense_evasion_create_mod_root_certificate.json'; +import rule153 from './defense_evasion_cve_2020_0601.json'; +import rule154 from './defense_evasion_defender_disabled_via_registry.json'; +import rule155 from './defense_evasion_defender_exclusion_via_powershell.json'; +import rule156 from './defense_evasion_delete_volume_usn_journal_with_fsutil.json'; +import rule157 from './defense_evasion_deleting_websvr_access_logs.json'; +import rule158 from './defense_evasion_deletion_of_bash_command_line_history.json'; +import rule159 from './defense_evasion_disable_posh_scriptblocklogging.json'; +import rule160 from './defense_evasion_disable_selinux_attempt.json'; +import rule161 from './defense_evasion_disable_windows_firewall_rules_with_netsh.json'; +import rule162 from './defense_evasion_disabling_windows_defender_powershell.json'; +import rule163 from './defense_evasion_disabling_windows_logs.json'; +import rule164 from './defense_evasion_dns_over_https_enabled.json'; +import rule165 from './defense_evasion_domain_added_to_google_workspace_trusted_domains.json'; +import rule166 from './defense_evasion_dotnet_compiler_parent_process.json'; +import rule167 from './defense_evasion_ec2_flow_log_deletion.json'; +import rule168 from './defense_evasion_ec2_network_acl_deletion.json'; +import rule169 from './defense_evasion_elastic_agent_service_terminated.json'; +import rule170 from './defense_evasion_elasticache_security_group_creation.json'; +import rule171 from './defense_evasion_elasticache_security_group_modified_or_deleted.json'; +import rule172 from './defense_evasion_enable_inbound_rdp_with_netsh.json'; +import rule173 from './defense_evasion_enable_network_discovery_with_netsh.json'; +import rule174 from './defense_evasion_event_hub_deletion.json'; +import rule175 from './defense_evasion_execution_control_panel_suspicious_args.json'; +import rule176 from './defense_evasion_execution_lolbas_wuauclt.json'; +import rule177 from './defense_evasion_execution_msbuild_started_by_office_app.json'; +import rule178 from './defense_evasion_execution_msbuild_started_by_script.json'; +import rule179 from './defense_evasion_execution_msbuild_started_by_system_process.json'; +import rule180 from './defense_evasion_execution_msbuild_started_renamed.json'; +import rule181 from './defense_evasion_execution_msbuild_started_unusal_process.json'; +import rule182 from './defense_evasion_execution_suspicious_explorer_winword.json'; +import rule183 from './defense_evasion_execution_windefend_unusual_path.json'; +import rule184 from './defense_evasion_file_creation_mult_extension.json'; +import rule185 from './defense_evasion_file_deletion_via_shred.json'; +import rule186 from './defense_evasion_file_mod_writable_dir.json'; +import rule187 from './defense_evasion_firewall_policy_deletion.json'; +import rule188 from './defense_evasion_from_unusual_directory.json'; +import rule189 from './defense_evasion_frontdoor_firewall_policy_deletion.json'; +import rule190 from './defense_evasion_gcp_firewall_rule_created.json'; +import rule191 from './defense_evasion_gcp_firewall_rule_deleted.json'; +import rule192 from './defense_evasion_gcp_firewall_rule_modified.json'; +import rule193 from './defense_evasion_gcp_logging_bucket_deletion.json'; +import rule194 from './defense_evasion_gcp_logging_sink_deletion.json'; +import rule195 from './defense_evasion_gcp_pub_sub_subscription_deletion.json'; +import rule196 from './defense_evasion_gcp_pub_sub_topic_deletion.json'; +import rule197 from './defense_evasion_gcp_storage_bucket_configuration_modified.json'; +import rule198 from './defense_evasion_gcp_storage_bucket_permissions_modified.json'; +import rule199 from './defense_evasion_gcp_virtual_private_cloud_network_deleted.json'; +import rule200 from './defense_evasion_gcp_virtual_private_cloud_route_created.json'; +import rule201 from './defense_evasion_gcp_virtual_private_cloud_route_deleted.json'; +import rule202 from './defense_evasion_google_workspace_bitlocker_setting_disabled.json'; +import rule203 from './defense_evasion_google_workspace_restrictions_for_google_marketplace_changed_to_allow_any_app.json'; +import rule204 from './defense_evasion_guardduty_detector_deletion.json'; +import rule205 from './defense_evasion_hidden_file_dir_tmp.json'; +import rule206 from './defense_evasion_hidden_shared_object.json'; +import rule207 from './defense_evasion_hide_encoded_executable_registry.json'; +import rule208 from './defense_evasion_iis_httplogging_disabled.json'; +import rule209 from './defense_evasion_injection_msbuild.json'; +import rule210 from './defense_evasion_install_root_certificate.json'; +import rule211 from './defense_evasion_installutil_beacon.json'; +import rule212 from './defense_evasion_kernel_module_removal.json'; +import rule213 from './defense_evasion_kubernetes_events_deleted.json'; +import rule214 from './defense_evasion_log_files_deleted.json'; +import rule215 from './defense_evasion_masquerading_as_elastic_endpoint_process.json'; +import rule216 from './defense_evasion_masquerading_renamed_autoit.json'; +import rule217 from './defense_evasion_masquerading_suspicious_werfault_childproc.json'; +import rule218 from './defense_evasion_masquerading_trusted_directory.json'; +import rule219 from './defense_evasion_masquerading_werfault.json'; +import rule220 from './defense_evasion_microsoft_365_exchange_dlp_policy_removed.json'; +import rule221 from './defense_evasion_microsoft_365_exchange_malware_filter_policy_deletion.json'; +import rule222 from './defense_evasion_microsoft_365_exchange_malware_filter_rule_mod.json'; +import rule223 from './defense_evasion_microsoft_365_exchange_safe_attach_rule_disabled.json'; +import rule224 from './defense_evasion_microsoft_365_mailboxauditbypassassociation.json'; +import rule225 from './defense_evasion_microsoft_defender_tampering.json'; +import rule226 from './defense_evasion_misc_lolbin_connecting_to_the_internet.json'; +import rule227 from './defense_evasion_modify_environment_launchctl.json'; +import rule228 from './defense_evasion_ms_office_suspicious_regmod.json'; +import rule229 from './defense_evasion_msbuild_making_network_connections.json'; +import rule230 from './defense_evasion_mshta_beacon.json'; +import rule231 from './defense_evasion_msxsl_network.json'; +import rule232 from './defense_evasion_network_connection_from_windows_binary.json'; +import rule233 from './defense_evasion_network_watcher_deletion.json'; +import rule234 from './defense_evasion_okta_attempt_to_deactivate_okta_policy.json'; +import rule235 from './defense_evasion_okta_attempt_to_deactivate_okta_policy_rule.json'; +import rule236 from './defense_evasion_okta_attempt_to_delete_okta_policy.json'; +import rule237 from './defense_evasion_okta_attempt_to_delete_okta_policy_rule.json'; +import rule238 from './defense_evasion_okta_attempt_to_modify_okta_network_zone.json'; +import rule239 from './defense_evasion_okta_attempt_to_modify_okta_policy.json'; +import rule240 from './defense_evasion_okta_attempt_to_modify_okta_policy_rule.json'; +import rule241 from './defense_evasion_parent_process_pid_spoofing.json'; +import rule242 from './defense_evasion_persistence_temp_scheduled_task.json'; +import rule243 from './defense_evasion_posh_assembly_load.json'; +import rule244 from './defense_evasion_posh_compressed.json'; +import rule245 from './defense_evasion_posh_process_injection.json'; +import rule246 from './defense_evasion_potential_processherpaderping.json'; +import rule247 from './defense_evasion_powershell_windows_firewall_disabled.json'; +import rule248 from './defense_evasion_privacy_controls_tcc_database_modification.json'; +import rule249 from './defense_evasion_privilege_escalation_privacy_pref_sshd_fulldiskaccess.json'; +import rule250 from './defense_evasion_process_termination_followed_by_deletion.json'; +import rule251 from './defense_evasion_proxy_execution_via_msdt.json'; +import rule252 from './defense_evasion_rundll32_no_arguments.json'; +import rule253 from './defense_evasion_s3_bucket_configuration_deletion.json'; +import rule254 from './defense_evasion_safari_config_change.json'; +import rule255 from './defense_evasion_sandboxed_office_app_suspicious_zip_file.json'; +import rule256 from './defense_evasion_scheduledjobs_at_protocol_enabled.json'; +import rule257 from './defense_evasion_sdelete_like_filename_rename.json'; +import rule258 from './defense_evasion_sip_provider_mod.json'; +import rule259 from './defense_evasion_solarwinds_backdoor_service_disabled_via_registry.json'; +import rule260 from './defense_evasion_suppression_rule_created.json'; +import rule261 from './defense_evasion_suspicious_certutil_commands.json'; +import rule262 from './defense_evasion_suspicious_execution_from_mounted_device.json'; +import rule263 from './defense_evasion_suspicious_managedcode_host_process.json'; +import rule264 from './defense_evasion_suspicious_okta_user_password_reset_or_unlock_attempts.json'; +import rule265 from './defense_evasion_suspicious_process_access_direct_syscall.json'; +import rule266 from './defense_evasion_suspicious_process_creation_calltrace.json'; +import rule267 from './defense_evasion_suspicious_scrobj_load.json'; +import rule268 from './defense_evasion_suspicious_short_program_name.json'; +import rule269 from './defense_evasion_suspicious_wmi_script.json'; +import rule270 from './defense_evasion_suspicious_zoom_child_process.json'; +import rule271 from './defense_evasion_system_critical_proc_abnormal_file_activity.json'; +import rule272 from './defense_evasion_tcc_bypass_mounted_apfs_access.json'; +import rule273 from './defense_evasion_timestomp_touch.json'; +import rule274 from './defense_evasion_unload_endpointsecurity_kext.json'; +import rule275 from './defense_evasion_unusual_ads_file_creation.json'; +import rule276 from './defense_evasion_unusual_dir_ads.json'; +import rule277 from './defense_evasion_unusual_network_connection_via_dllhost.json'; +import rule278 from './defense_evasion_unusual_network_connection_via_rundll32.json'; +import rule279 from './defense_evasion_unusual_process_network_connection.json'; +import rule280 from './defense_evasion_unusual_system_vp_child_program.json'; +import rule281 from './defense_evasion_via_filter_manager.json'; +import rule282 from './defense_evasion_waf_acl_deletion.json'; +import rule283 from './defense_evasion_waf_rule_or_rule_group_deletion.json'; +import rule284 from './defense_evasion_workfolders_control_execution.json'; +import rule285 from './discovery_adfind_command_activity.json'; +import rule286 from './discovery_admin_recon.json'; +import rule287 from './discovery_blob_container_access_mod.json'; +import rule288 from './discovery_command_system_account.json'; +import rule289 from './discovery_denied_service_account_request.json'; +import rule290 from './discovery_enumerating_domain_trusts_via_nltest.json'; +import rule291 from './discovery_kernel_module_enumeration.json'; +import rule292 from './discovery_linux_hping_activity.json'; +import rule293 from './discovery_linux_nping_activity.json'; +import rule294 from './discovery_ml_linux_system_information_discovery.json'; +import rule295 from './discovery_ml_linux_system_network_configuration_discovery.json'; +import rule296 from './discovery_ml_linux_system_network_connection_discovery.json'; +import rule297 from './discovery_ml_linux_system_process_discovery.json'; +import rule298 from './discovery_ml_linux_system_user_discovery.json'; +import rule299 from './discovery_net_view.json'; +import rule300 from './discovery_peripheral_device.json'; +import rule301 from './discovery_posh_invoke_sharefinder.json'; +import rule302 from './discovery_posh_suspicious_api_functions.json'; +import rule303 from './discovery_post_exploitation_external_ip_lookup.json'; +import rule304 from './discovery_privileged_localgroup_membership.json'; +import rule305 from './discovery_remote_system_discovery_commands_windows.json'; +import rule306 from './discovery_security_software_grep.json'; +import rule307 from './discovery_security_software_wmic.json'; +import rule308 from './discovery_suspicious_self_subject_review.json'; +import rule309 from './discovery_users_domain_built_in_commands.json'; +import rule310 from './discovery_virtual_machine_fingerprinting.json'; +import rule311 from './discovery_virtual_machine_fingerprinting_grep.json'; +import rule312 from './discovery_whoami_command_activity.json'; +import rule313 from './elastic_endpoint_security.json'; +import rule314 from './endgame_adversary_behavior_detected.json'; +import rule315 from './endgame_malware_detected.json'; +import rule316 from './endgame_malware_prevented.json'; +import rule317 from './endgame_ransomware_detected.json'; +import rule318 from './endgame_ransomware_prevented.json'; +import rule319 from './execution_abnormal_process_id_file_created.json'; +import rule320 from './execution_apt_solarwinds_backdoor_child_cmd_powershell.json'; +import rule321 from './execution_apt_solarwinds_backdoor_unusual_child_processes.json'; +import rule322 from './execution_com_object_xwizard.json'; +import rule323 from './execution_command_prompt_connecting_to_the_internet.json'; +import rule324 from './execution_command_shell_started_by_svchost.json'; +import rule325 from './execution_command_shell_started_by_unusual_process.json'; +import rule326 from './execution_command_shell_via_rundll32.json'; +import rule327 from './execution_command_virtual_machine.json'; +import rule328 from './execution_defense_evasion_electron_app_childproc_node_js.json'; +import rule329 from './execution_endgame_exploit_detected.json'; +import rule330 from './execution_endgame_exploit_prevented.json'; +import rule331 from './execution_enumeration_via_wmiprvse.json'; +import rule332 from './execution_from_unusual_path_cmdline.json'; +import rule333 from './execution_html_help_executable_program_connecting_to_the_internet.json'; +import rule334 from './execution_initial_access_suspicious_browser_childproc.json'; +import rule335 from './execution_installer_package_spawned_network_event.json'; +import rule336 from './execution_linux_netcat_network_connection.json'; +import rule337 from './execution_ml_windows_anomalous_script.json'; +import rule338 from './execution_ms_office_written_file.json'; +import rule339 from './execution_pdf_written_file.json'; +import rule340 from './execution_pentest_eggshell_remote_admin_tool.json'; +import rule341 from './execution_perl_tty_shell.json'; +import rule342 from './execution_posh_portable_executable.json'; +import rule343 from './execution_posh_psreflect.json'; +import rule344 from './execution_process_started_from_process_id_file.json'; +import rule345 from './execution_process_started_in_shared_memory_directory.json'; +import rule346 from './execution_psexec_lateral_movement_command.json'; +import rule347 from './execution_python_tty_shell.json'; +import rule348 from './execution_register_server_program_connecting_to_the_internet.json'; +import rule349 from './execution_revershell_via_shell_cmd.json'; +import rule350 from './execution_scheduled_task_powershell_source.json'; +import rule351 from './execution_script_via_automator_workflows.json'; +import rule352 from './execution_scripting_osascript_exec_followed_by_netcon.json'; +import rule353 from './execution_shared_modules_local_sxs_dll.json'; +import rule354 from './execution_shell_evasion_linux_binary.json'; +import rule355 from './execution_shell_execution_via_apple_scripting.json'; +import rule356 from './execution_suspicious_cmd_wmi.json'; +import rule357 from './execution_suspicious_image_load_wmi_ms_office.json'; +import rule358 from './execution_suspicious_jar_child_process.json'; +import rule359 from './execution_suspicious_java_netcon_childproc.json'; +import rule360 from './execution_suspicious_pdf_reader.json'; +import rule361 from './execution_suspicious_powershell_imgload.json'; +import rule362 from './execution_suspicious_psexesvc.json'; +import rule363 from './execution_tc_bpf_filter.json'; +import rule364 from './execution_user_exec_to_pod.json'; +import rule365 from './execution_via_compiled_html_file.json'; +import rule366 from './execution_via_hidden_shell_conhost.json'; +import rule367 from './execution_via_xp_cmdshell_mssql_stored_procedure.json'; +import rule368 from './exfiltration_ec2_full_network_packet_capture_detected.json'; +import rule369 from './exfiltration_ec2_snapshot_change_activity.json'; +import rule370 from './exfiltration_ec2_vm_export_failure.json'; +import rule371 from './exfiltration_gcp_logging_sink_modification.json'; +import rule372 from './exfiltration_microsoft_365_exchange_transport_rule_creation.json'; +import rule373 from './exfiltration_microsoft_365_exchange_transport_rule_mod.json'; +import rule374 from './exfiltration_rds_snapshot_export.json'; +import rule375 from './exfiltration_rds_snapshot_restored.json'; +import rule376 from './external_alerts.json'; +import rule377 from './guided_onborading_sample_rule.json'; +import rule378 from './impact_attempt_to_revoke_okta_api_token.json'; +import rule379 from './impact_aws_eventbridge_rule_disabled_or_deleted.json'; +import rule380 from './impact_azure_service_principal_credentials_added.json'; +import rule381 from './impact_backup_file_deletion.json'; +import rule382 from './impact_cloudtrail_logging_updated.json'; +import rule383 from './impact_cloudwatch_log_group_deletion.json'; +import rule384 from './impact_cloudwatch_log_stream_deletion.json'; +import rule385 from './impact_deleting_backup_catalogs_with_wbadmin.json'; +import rule386 from './impact_ec2_disable_ebs_encryption.json'; +import rule387 from './impact_efs_filesystem_or_mount_deleted.json'; +import rule388 from './impact_gcp_iam_role_deletion.json'; +import rule389 from './impact_gcp_service_account_deleted.json'; +import rule390 from './impact_gcp_service_account_disabled.json'; +import rule391 from './impact_gcp_storage_bucket_deleted.json'; +import rule392 from './impact_google_workspace_admin_role_deletion.json'; +import rule393 from './impact_google_workspace_mfa_enforcement_disabled.json'; +import rule394 from './impact_hosts_file_modified.json'; +import rule395 from './impact_iam_deactivate_mfa_device.json'; +import rule396 from './impact_iam_group_deletion.json'; +import rule397 from './impact_kubernetes_pod_deleted.json'; +import rule398 from './impact_microsoft_365_potential_ransomware_activity.json'; +import rule399 from './impact_microsoft_365_unusual_volume_of_file_deletion.json'; +import rule400 from './impact_modification_of_boot_config.json'; +import rule401 from './impact_okta_attempt_to_deactivate_okta_application.json'; +import rule402 from './impact_okta_attempt_to_delete_okta_application.json'; +import rule403 from './impact_okta_attempt_to_modify_okta_application.json'; +import rule404 from './impact_possible_okta_dos_attack.json'; +import rule405 from './impact_process_kill_threshold.json'; +import rule406 from './impact_rds_group_deletion.json'; +import rule407 from './impact_rds_instance_cluster_deletion.json'; +import rule408 from './impact_rds_instance_cluster_stoppage.json'; +import rule409 from './impact_resource_group_deletion.json'; +import rule410 from './impact_stop_process_service_threshold.json'; +import rule411 from './impact_virtual_network_device_modified.json'; +import rule412 from './impact_volume_shadow_copy_deletion_or_resized_via_vssadmin.json'; +import rule413 from './impact_volume_shadow_copy_deletion_via_powershell.json'; +import rule414 from './impact_volume_shadow_copy_deletion_via_wmic.json'; +import rule415 from './initial_access_anonymous_request_authorized.json'; +import rule416 from './initial_access_azure_active_directory_high_risk_signin.json'; +import rule417 from './initial_access_azure_active_directory_high_risk_signin_atrisk_or_confirmed.json'; +import rule418 from './initial_access_azure_active_directory_powershell_signin.json'; +import rule419 from './initial_access_consent_grant_attack_via_azure_registered_application.json'; +import rule420 from './initial_access_console_login_root.json'; +import rule421 from './initial_access_evasion_suspicious_htm_file_creation.json'; +import rule422 from './initial_access_external_guest_user_invite.json'; +import rule423 from './initial_access_gcp_iam_custom_role_creation.json'; +import rule424 from './initial_access_microsoft_365_exchange_anti_phish_policy_deletion.json'; +import rule425 from './initial_access_microsoft_365_exchange_anti_phish_rule_mod.json'; +import rule426 from './initial_access_microsoft_365_exchange_safelinks_disabled.json'; +import rule427 from './initial_access_microsoft_365_user_restricted_from_sending_email.json'; +import rule428 from './initial_access_ml_auth_rare_hour_for_a_user_to_logon.json'; +import rule429 from './initial_access_ml_auth_rare_source_ip_for_a_user.json'; +import rule430 from './initial_access_ml_auth_rare_user_logon.json'; +import rule431 from './initial_access_ml_linux_anomalous_user_name.json'; +import rule432 from './initial_access_ml_windows_anomalous_user_name.json'; +import rule433 from './initial_access_ml_windows_rare_user_type10_remote_login.json'; +import rule434 from './initial_access_o365_user_reported_phish_malware.json'; +import rule435 from './initial_access_okta_user_attempted_unauthorized_access.json'; +import rule436 from './initial_access_password_recovery.json'; +import rule437 from './initial_access_rpc_remote_procedure_call_from_the_internet.json'; +import rule438 from './initial_access_rpc_remote_procedure_call_to_the_internet.json'; +import rule439 from './initial_access_script_executing_powershell.json'; +import rule440 from './initial_access_scripts_process_started_via_wmi.json'; +import rule441 from './initial_access_smb_windows_file_sharing_activity_to_the_internet.json'; +import rule442 from './initial_access_suspicious_activity_reported_by_okta_user.json'; +import rule443 from './initial_access_suspicious_mac_ms_office_child_process.json'; +import rule444 from './initial_access_suspicious_ms_exchange_files.json'; +import rule445 from './initial_access_suspicious_ms_exchange_process.json'; +import rule446 from './initial_access_suspicious_ms_exchange_worker_child_process.json'; +import rule447 from './initial_access_suspicious_ms_office_child_process.json'; +import rule448 from './initial_access_suspicious_ms_outlook_child_process.json'; +import rule449 from './initial_access_unsecure_elasticsearch_node.json'; +import rule450 from './initial_access_unusual_dns_service_children.json'; +import rule451 from './initial_access_unusual_dns_service_file_writes.json'; +import rule452 from './initial_access_via_explorer_suspicious_child_parent_args.json'; +import rule453 from './initial_access_via_system_manager.json'; +import rule454 from './initial_access_zoom_meeting_with_no_passcode.json'; +import rule455 from './lateral_movement_cmd_service.json'; +import rule456 from './lateral_movement_credential_access_kerberos_bifrostconsole.json'; +import rule457 from './lateral_movement_dcom_hta.json'; +import rule458 from './lateral_movement_dcom_mmc20.json'; +import rule459 from './lateral_movement_dcom_shellwindow_shellbrowserwindow.json'; +import rule460 from './lateral_movement_defense_evasion_lanman_nullsessionpipe_modification.json'; +import rule461 from './lateral_movement_direct_outbound_smb_connection.json'; +import rule462 from './lateral_movement_dns_server_overflow.json'; +import rule463 from './lateral_movement_evasion_rdp_shadowing.json'; +import rule464 from './lateral_movement_executable_tool_transfer_smb.json'; +import rule465 from './lateral_movement_execution_from_tsclient_mup.json'; +import rule466 from './lateral_movement_execution_via_file_shares_sequence.json'; +import rule467 from './lateral_movement_incoming_winrm_shell_execution.json'; +import rule468 from './lateral_movement_incoming_wmi.json'; +import rule469 from './lateral_movement_malware_uploaded_onedrive.json'; +import rule470 from './lateral_movement_malware_uploaded_sharepoint.json'; +import rule471 from './lateral_movement_mount_hidden_or_webdav_share_net.json'; +import rule472 from './lateral_movement_mounting_smb_share.json'; +import rule473 from './lateral_movement_powershell_remoting_target.json'; +import rule474 from './lateral_movement_rdp_enabled_registry.json'; +import rule475 from './lateral_movement_rdp_sharprdp_target.json'; +import rule476 from './lateral_movement_remote_file_copy_hidden_share.json'; +import rule477 from './lateral_movement_remote_services.json'; +import rule478 from './lateral_movement_remote_ssh_login_enabled.json'; +import rule479 from './lateral_movement_remote_task_creation_winlog.json'; +import rule480 from './lateral_movement_scheduled_task_target.json'; +import rule481 from './lateral_movement_service_control_spawned_script_int.json'; +import rule482 from './lateral_movement_suspicious_rdp_client_imageload.json'; +import rule483 from './lateral_movement_telnet_network_activity_external.json'; +import rule484 from './lateral_movement_telnet_network_activity_internal.json'; +import rule485 from './lateral_movement_via_startup_folder_rdp_smb.json'; +import rule486 from './lateral_movement_vpn_connection_attempt.json'; +import rule487 from './ml_cloudtrail_error_message_spike.json'; +import rule488 from './ml_cloudtrail_rare_error_code.json'; +import rule489 from './ml_cloudtrail_rare_method_by_city.json'; +import rule490 from './ml_cloudtrail_rare_method_by_country.json'; +import rule491 from './ml_cloudtrail_rare_method_by_user.json'; +import rule492 from './ml_high_count_network_denies.json'; +import rule493 from './ml_high_count_network_events.json'; +import rule494 from './ml_linux_anomalous_network_activity.json'; +import rule495 from './ml_linux_anomalous_network_port_activity.json'; +import rule496 from './ml_packetbeat_rare_server_domain.json'; +import rule497 from './ml_rare_destination_country.json'; +import rule498 from './ml_spike_in_traffic_to_a_country.json'; +import rule499 from './ml_windows_anomalous_network_activity.json'; +import rule500 from './okta_threat_detected_by_okta_threatinsight.json'; +import rule501 from './persistence_account_creation_hide_at_logon.json'; +import rule502 from './persistence_ad_adminsdholder.json'; +import rule503 from './persistence_administrator_privileges_assigned_to_okta_group.json'; +import rule504 from './persistence_administrator_role_assigned_to_okta_user.json'; +import rule505 from './persistence_adobe_hijack_persistence.json'; +import rule506 from './persistence_app_compat_shim.json'; +import rule507 from './persistence_appcertdlls_registry.json'; +import rule508 from './persistence_appinitdlls_registry.json'; +import rule509 from './persistence_application_added_to_google_workspace_domain.json'; +import rule510 from './persistence_attempt_to_create_okta_api_token.json'; +import rule511 from './persistence_attempt_to_deactivate_mfa_for_okta_user_account.json'; +import rule512 from './persistence_attempt_to_reset_mfa_factors_for_okta_user_account.json'; +import rule513 from './persistence_azure_automation_account_created.json'; +import rule514 from './persistence_azure_automation_runbook_created_or_modified.json'; +import rule515 from './persistence_azure_automation_webhook_created.json'; +import rule516 from './persistence_azure_conditional_access_policy_modified.json'; +import rule517 from './persistence_azure_global_administrator_role_assigned.json'; +import rule518 from './persistence_azure_pim_user_added_global_admin.json'; +import rule519 from './persistence_azure_privileged_identity_management_role_modified.json'; +import rule520 from './persistence_chkconfig_service_add.json'; +import rule521 from './persistence_creation_change_launch_agents_file.json'; +import rule522 from './persistence_creation_hidden_login_item_osascript.json'; +import rule523 from './persistence_creation_modif_launch_deamon_sequence.json'; +import rule524 from './persistence_credential_access_authorization_plugin_creation.json'; +import rule525 from './persistence_credential_access_modify_auth_module_or_config.json'; +import rule526 from './persistence_credential_access_modify_ssh_binaries.json'; +import rule527 from './persistence_crontab_creation.json'; +import rule528 from './persistence_defense_evasion_hidden_launch_agent_deamon_logonitem_process.json'; +import rule529 from './persistence_directory_services_plugins_modification.json'; +import rule530 from './persistence_docker_shortcuts_plist_modification.json'; +import rule531 from './persistence_dontexpirepasswd_account.json'; +import rule532 from './persistence_dynamic_linker_backup.json'; +import rule533 from './persistence_ec2_network_acl_creation.json'; +import rule534 from './persistence_ec2_security_group_configuration_change_detection.json'; +import rule535 from './persistence_emond_rules_file_creation.json'; +import rule536 from './persistence_emond_rules_process_execution.json'; +import rule537 from './persistence_enable_root_account.json'; +import rule538 from './persistence_etc_file_creation.json'; +import rule539 from './persistence_evasion_hidden_launch_agent_deamon_creation.json'; +import rule540 from './persistence_evasion_hidden_local_account_creation.json'; +import rule541 from './persistence_evasion_registry_ifeo_injection.json'; +import rule542 from './persistence_evasion_registry_startup_shell_folder_modified.json'; +import rule543 from './persistence_exchange_suspicious_mailbox_right_delegation.json'; +import rule544 from './persistence_exposed_service_created_with_type_nodeport.json'; +import rule545 from './persistence_finder_sync_plugin_pluginkit.json'; +import rule546 from './persistence_folder_action_scripts_runtime.json'; +import rule547 from './persistence_gcp_iam_service_account_key_deletion.json'; +import rule548 from './persistence_gcp_key_created_for_service_account.json'; +import rule549 from './persistence_gcp_service_account_created.json'; +import rule550 from './persistence_google_workspace_2sv_policy_disabled.json'; +import rule551 from './persistence_google_workspace_admin_role_assigned_to_user.json'; +import rule552 from './persistence_google_workspace_api_access_granted_via_domain_wide_delegation_of_authority.json'; +import rule553 from './persistence_google_workspace_custom_admin_role_created.json'; +import rule554 from './persistence_google_workspace_policy_modified.json'; +import rule555 from './persistence_google_workspace_role_modified.json'; +import rule556 from './persistence_google_workspace_user_group_access_modified_to_allow_external_access.json'; +import rule557 from './persistence_google_workspace_user_organizational_unit_changed.json'; +import rule558 from './persistence_gpo_schtask_service_creation.json'; +import rule559 from './persistence_iam_group_creation.json'; +import rule560 from './persistence_insmod_kernel_module_load.json'; +import rule561 from './persistence_kde_autostart_modification.json'; +import rule562 from './persistence_local_scheduled_job_creation.json'; +import rule563 from './persistence_local_scheduled_task_creation.json'; +import rule564 from './persistence_local_scheduled_task_scripting.json'; +import rule565 from './persistence_login_logout_hooks_defaults.json'; +import rule566 from './persistence_loginwindow_plist_modification.json'; +import rule567 from './persistence_mfa_disabled_for_azure_user.json'; +import rule568 from './persistence_mfa_disabled_for_google_workspace_organization.json'; +import rule569 from './persistence_microsoft_365_exchange_dkim_signing_config_disabled.json'; +import rule570 from './persistence_microsoft_365_exchange_management_role_assignment.json'; +import rule571 from './persistence_microsoft_365_global_administrator_role_assign.json'; +import rule572 from './persistence_microsoft_365_teams_custom_app_interaction_allowed.json'; +import rule573 from './persistence_microsoft_365_teams_external_access_enabled.json'; +import rule574 from './persistence_microsoft_365_teams_guest_access_enabled.json'; +import rule575 from './persistence_ml_linux_anomalous_process_all_hosts.json'; +import rule576 from './persistence_ml_rare_process_by_host_linux.json'; +import rule577 from './persistence_ml_rare_process_by_host_windows.json'; +import rule578 from './persistence_ml_windows_anomalous_path_activity.json'; +import rule579 from './persistence_ml_windows_anomalous_process_all_hosts.json'; +import rule580 from './persistence_ml_windows_anomalous_process_creation.json'; +import rule581 from './persistence_ml_windows_anomalous_service.json'; +import rule582 from './persistence_modification_sublime_app_plugin_or_script.json'; +import rule583 from './persistence_ms_office_addins_file.json'; +import rule584 from './persistence_ms_outlook_vba_template.json'; +import rule585 from './persistence_msds_alloweddelegateto_krbtgt.json'; +import rule586 from './persistence_okta_attempt_to_modify_or_delete_application_sign_on_policy.json'; +import rule587 from './persistence_periodic_tasks_file_mdofiy.json'; +import rule588 from './persistence_powershell_exch_mailbox_activesync_add_device.json'; +import rule589 from './persistence_priv_escalation_via_accessibility_features.json'; +import rule590 from './persistence_rds_cluster_creation.json'; +import rule591 from './persistence_rds_group_creation.json'; +import rule592 from './persistence_rds_instance_creation.json'; +import rule593 from './persistence_redshift_instance_creation.json'; +import rule594 from './persistence_registry_uncommon.json'; +import rule595 from './persistence_remote_password_reset.json'; +import rule596 from './persistence_route_53_domain_transfer_lock_disabled.json'; +import rule597 from './persistence_route_53_domain_transferred_to_another_account.json'; +import rule598 from './persistence_route_53_hosted_zone_associated_with_a_vpc.json'; +import rule599 from './persistence_route_table_created.json'; +import rule600 from './persistence_route_table_modified_or_deleted.json'; +import rule601 from './persistence_run_key_and_startup_broad.json'; +import rule602 from './persistence_runtime_run_key_startup_susp_procs.json'; +import rule603 from './persistence_scheduled_task_creation_winlog.json'; +import rule604 from './persistence_scheduled_task_updated.json'; +import rule605 from './persistence_screensaver_engine_unexpected_child_process.json'; +import rule606 from './persistence_screensaver_plist_file_modification.json'; +import rule607 from './persistence_sdprop_exclusion_dsheuristics.json'; +import rule608 from './persistence_services_registry.json'; +import rule609 from './persistence_shell_activity_by_web_server.json'; +import rule610 from './persistence_shell_profile_modification.json'; +import rule611 from './persistence_ssh_authorized_keys_modification.json'; +import rule612 from './persistence_startup_folder_file_written_by_suspicious_process.json'; +import rule613 from './persistence_startup_folder_file_written_by_unsigned_process.json'; +import rule614 from './persistence_startup_folder_scripts.json'; +import rule615 from './persistence_suspicious_calendar_modification.json'; +import rule616 from './persistence_suspicious_com_hijack_registry.json'; +import rule617 from './persistence_suspicious_image_load_scheduled_task_ms_office.json'; +import rule618 from './persistence_suspicious_scheduled_task_runtime.json'; +import rule619 from './persistence_suspicious_service_created_registry.json'; +import rule620 from './persistence_system_shells_via_services.json'; +import rule621 from './persistence_time_provider_mod.json'; +import rule622 from './persistence_user_account_added_to_privileged_group_ad.json'; +import rule623 from './persistence_user_account_creation.json'; +import rule624 from './persistence_user_added_as_owner_for_azure_application.json'; +import rule625 from './persistence_user_added_as_owner_for_azure_service_principal.json'; +import rule626 from './persistence_via_application_shimming.json'; +import rule627 from './persistence_via_atom_init_file_modification.json'; +import rule628 from './persistence_via_bits_job_notify_command.json'; +import rule629 from './persistence_via_hidden_run_key_valuename.json'; +import rule630 from './persistence_via_lsa_security_support_provider_registry.json'; +import rule631 from './persistence_via_telemetrycontroller_scheduledtask_hijack.json'; +import rule632 from './persistence_via_update_orchestrator_service_hijack.json'; +import rule633 from './persistence_via_windows_management_instrumentation_event_subscription.json'; +import rule634 from './persistence_via_wmi_stdregprov_run_services.json'; +import rule635 from './persistence_webshell_detection.json'; +import rule636 from './privilege_escalation_applescript_with_admin_privs.json'; +import rule637 from './privilege_escalation_aws_suspicious_saml_activity.json'; +import rule638 from './privilege_escalation_azure_kubernetes_rolebinding_created.json'; +import rule639 from './privilege_escalation_create_process_as_different_user.json'; +import rule640 from './privilege_escalation_cyberarkpas_error_audit_event_promotion.json'; +import rule641 from './privilege_escalation_cyberarkpas_recommended_events_to_monitor_promotion.json'; +import rule642 from './privilege_escalation_disable_uac_registry.json'; +import rule643 from './privilege_escalation_echo_nopasswd_sudoers.json'; +import rule644 from './privilege_escalation_endgame_cred_manipulation_detected.json'; +import rule645 from './privilege_escalation_endgame_cred_manipulation_prevented.json'; +import rule646 from './privilege_escalation_endgame_permission_theft_detected.json'; +import rule647 from './privilege_escalation_endgame_permission_theft_prevented.json'; +import rule648 from './privilege_escalation_endgame_process_injection_detected.json'; +import rule649 from './privilege_escalation_endgame_process_injection_prevented.json'; +import rule650 from './privilege_escalation_explicit_creds_via_scripting.json'; +import rule651 from './privilege_escalation_exploit_adobe_acrobat_updater.json'; +import rule652 from './privilege_escalation_gcp_kubernetes_rolebindings_created_or_patched.json'; +import rule653 from './privilege_escalation_group_policy_iniscript.json'; +import rule654 from './privilege_escalation_group_policy_privileged_groups.json'; +import rule655 from './privilege_escalation_group_policy_scheduled_task.json'; +import rule656 from './privilege_escalation_installertakeover.json'; +import rule657 from './privilege_escalation_krbrelayup_service_creation.json'; +import rule658 from './privilege_escalation_ld_preload_shared_object_modif.json'; +import rule659 from './privilege_escalation_local_user_added_to_admin.json'; +import rule660 from './privilege_escalation_lsa_auth_package.json'; +import rule661 from './privilege_escalation_ml_linux_anomalous_sudo_activity.json'; +import rule662 from './privilege_escalation_ml_windows_rare_user_runas_event.json'; +import rule663 from './privilege_escalation_named_pipe_impersonation.json'; +import rule664 from './privilege_escalation_new_or_modified_federation_domain.json'; +import rule665 from './privilege_escalation_persistence_phantom_dll.json'; +import rule666 from './privilege_escalation_pkexec_envar_hijack.json'; +import rule667 from './privilege_escalation_pod_created_with_hostipc.json'; +import rule668 from './privilege_escalation_pod_created_with_hostnetwork.json'; +import rule669 from './privilege_escalation_pod_created_with_hostpid.json'; +import rule670 from './privilege_escalation_pod_created_with_sensitive_hospath_volume.json'; +import rule671 from './privilege_escalation_port_monitor_print_pocessor_abuse.json'; +import rule672 from './privilege_escalation_posh_token_impersonation.json'; +import rule673 from './privilege_escalation_printspooler_registry_copyfiles.json'; +import rule674 from './privilege_escalation_printspooler_service_suspicious_file.json'; +import rule675 from './privilege_escalation_printspooler_suspicious_file_deletion.json'; +import rule676 from './privilege_escalation_printspooler_suspicious_spl_file.json'; +import rule677 from './privilege_escalation_privileged_pod_created.json'; +import rule678 from './privilege_escalation_rogue_windir_environment_var.json'; +import rule679 from './privilege_escalation_root_crontab_filemod.json'; +import rule680 from './privilege_escalation_root_login_without_mfa.json'; +import rule681 from './privilege_escalation_samaccountname_spoofing_attack.json'; +import rule682 from './privilege_escalation_setuid_setgid_bit_set_via_chmod.json'; +import rule683 from './privilege_escalation_shadow_file_read.json'; +import rule684 from './privilege_escalation_sts_assumerole_usage.json'; +import rule685 from './privilege_escalation_sts_getsessiontoken_abuse.json'; +import rule686 from './privilege_escalation_sudo_buffer_overflow.json'; +import rule687 from './privilege_escalation_sudoers_file_mod.json'; +import rule688 from './privilege_escalation_suspicious_assignment_of_controller_service_account.json'; +import rule689 from './privilege_escalation_suspicious_dnshostname_update.json'; +import rule690 from './privilege_escalation_uac_bypass_com_clipup.json'; +import rule691 from './privilege_escalation_uac_bypass_com_ieinstal.json'; +import rule692 from './privilege_escalation_uac_bypass_com_interface_icmluautil.json'; +import rule693 from './privilege_escalation_uac_bypass_diskcleanup_hijack.json'; +import rule694 from './privilege_escalation_uac_bypass_dll_sideloading.json'; +import rule695 from './privilege_escalation_uac_bypass_event_viewer.json'; +import rule696 from './privilege_escalation_uac_bypass_mock_windir.json'; +import rule697 from './privilege_escalation_uac_bypass_winfw_mmc_hijack.json'; +import rule698 from './privilege_escalation_unshare_namesapce_manipulation.json'; +import rule699 from './privilege_escalation_unusual_parentchild_relationship.json'; +import rule700 from './privilege_escalation_unusual_printspooler_childprocess.json'; +import rule701 from './privilege_escalation_unusual_svchost_childproc_childless.json'; +import rule702 from './privilege_escalation_updateassumerolepolicy.json'; +import rule703 from './privilege_escalation_via_rogue_named_pipe.json'; +import rule704 from './privilege_escalation_windows_service_via_unusual_client.json'; +import rule705 from './resource_development_ml_linux_anomalous_compiler_activity.json'; +import rule706 from './threat_intel_filebeat8x.json'; +import rule707 from './threat_intel_fleet_integrations.json'; export const rawRules = [ rule1, rule2, @@ -1424,4 +1424,5 @@ export const rawRules = [ rule704, rule705, rule706, + rule707, ]; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_alert_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_alert_type.test.ts index ddfca67279074..2ffbde91145c8 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_alert_type.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_alert_type.test.ts @@ -39,19 +39,15 @@ describe('legacyRules_notification_alert_type', () => { logger = loggingSystemMock.createLogger(); payload = { - alertId: '1111', executionId: 'b33f65d7-b33f-4aae-8d20-c93613dec9f9', services: alertServices, params: { ruleAlertId: '2222' }, state: {}, spaceId: '', - name: 'name', - tags: [], startedAt: new Date('2019-12-14T16:40:33.400Z'), previousStartedAt: new Date('2019-12-13T16:40:33.400Z'), - createdBy: 'elastic', - updatedBy: 'elastic', rule: { + id: '1111', name: 'name', tags: [], consumer: 'foo', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_alert_type.ts index 7e76c2c1158d2..2bb349f6f070b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_alert_type.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_alert_type.ts @@ -50,7 +50,14 @@ export const legacyRulesNotificationAlertType = ({ }, minimumLicenseRequired: 'basic', isExportable: false, - async executor({ startedAt, previousStartedAt, alertId, services, params, spaceId }) { + async executor({ + startedAt, + previousStartedAt, + rule: { id: ruleId }, + services, + params, + spaceId, + }) { const ruleAlertSavedObject = await services.savedObjectsClient.get<AlertAttributes>( 'alert', params.ruleAlertId @@ -60,7 +67,7 @@ export const legacyRulesNotificationAlertType = ({ logger.error( [ `Security Solution notification (Legacy) saved object for alert ${params.ruleAlertId} was not found with`, - `id: "${alertId}".`, + `id: "${ruleId}".`, `space id: "${spaceId}"`, 'This indicates a dangling (Legacy) notification alert.', 'You should delete this rule through "Kibana UI -> Stack Management -> Rules and Connectors" to remove this error message.', @@ -118,7 +125,7 @@ export const legacyRulesNotificationAlertType = ({ ); if (signalsCount !== 0) { - const alertInstance = services.alertFactory.create(alertId); + const alertInstance = services.alertFactory.create(ruleId); scheduleNotificationActions({ alertInstance, signalsCount, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts index 67a9a233eb807..c3bd79322c318 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts @@ -22,7 +22,7 @@ import { RULES_TABLE_MAX_PAGE_SIZE, } from '../../../../../../../common/constants'; import { - BulkAction, + BulkActionType, PerformBulkActionRequestBody, PerformBulkActionRequestQuery, } from '../../../../../../../common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; @@ -298,7 +298,7 @@ export const performBulkActionRoute = ( const isDryRun = request.query.dry_run === 'true'; // dry run is not supported for export, as it doesn't change ES state and has different response format(exported JSON file) - if (isDryRun && body.action === BulkAction.export) { + if (isDryRun && body.action === BulkActionType.export) { return siemResponse.error({ body: `Export action doesn't support dry_run mode`, statusCode: 400, @@ -335,7 +335,7 @@ export const performBulkActionRoute = ( // handling this action before switch statement as bulkEditRules fetch rules within // rulesClient method, hence there is no need to use fetchRulesByQueryOrIds utility - if (body.action === BulkAction.edit && !isDryRun) { + if (body.action === BulkActionType.edit && !isDryRun) { const { rules, errors } = await bulkEditRules({ rulesClient, filter: query, @@ -385,7 +385,7 @@ export const performBulkActionRoute = ( let deleted: RuleAlertType[] = []; switch (body.action) { - case BulkAction.enable: + case BulkActionType.enable: bulkActionOutcome = await initPromisePool({ concurrency: MAX_RULES_TO_UPDATE_IN_PARALLEL, items: rules, @@ -418,7 +418,7 @@ export const performBulkActionRoute = ( .map(({ result }) => result) .filter((rule): rule is RuleAlertType => rule !== null); break; - case BulkAction.disable: + case BulkActionType.disable: bulkActionOutcome = await initPromisePool({ concurrency: MAX_RULES_TO_UPDATE_IN_PARALLEL, items: rules, @@ -452,7 +452,7 @@ export const performBulkActionRoute = ( .filter((rule): rule is RuleAlertType => rule !== null); break; - case BulkAction.delete: + case BulkActionType.delete: bulkActionOutcome = await initPromisePool({ concurrency: MAX_RULES_TO_UPDATE_IN_PARALLEL, items: rules, @@ -483,7 +483,7 @@ export const performBulkActionRoute = ( .filter((rule): rule is RuleAlertType => rule !== null); break; - case BulkAction.duplicate: + case BulkActionType.duplicate: bulkActionOutcome = await initPromisePool({ concurrency: MAX_RULES_TO_UPDATE_IN_PARALLEL, items: rules, @@ -514,7 +514,7 @@ export const performBulkActionRoute = ( .filter((rule): rule is RuleAlertType => rule !== null); break; - case BulkAction.export: + case BulkActionType.export: const exported = await getExportByObjectIds( rulesClient, exceptionsClient, @@ -535,7 +535,7 @@ export const performBulkActionRoute = ( // will be processed only when isDryRun === true // during dry run only validation is getting performed and rule is not saved in ES - case BulkAction.edit: + case BulkActionType.edit: bulkActionOutcome = await initPromisePool({ concurrency: MAX_RULES_TO_UPDATE_IN_PARALLEL, items: rules, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.test.ts index 797c45ea45fa2..5f903386ab012 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.test.ts @@ -10,72 +10,274 @@ import { savedObjectsClientMock } from '@kbn/core/server/mocks'; import { findExceptionList } from '@kbn/lists-plugin/server/services/exception_lists/find_exception_list'; import { getExceptionListSchemaMock } from '@kbn/lists-plugin/common/schemas/response/exception_list_schema.mock'; import { getImportRulesSchemaMock } from '../../../../../../common/detection_engine/rule_management/mocks'; -import { getReferencedExceptionLists } from './gather_referenced_exceptions'; +import { + getReferencedExceptionLists, + parseReferencedExceptionsLists, +} from './gather_referenced_exceptions'; jest.mock('@kbn/lists-plugin/server/services/exception_lists/find_exception_list'); -describe('getReferencedExceptionLists', () => { - let savedObjectsClient: jest.Mocked<SavedObjectsClientContract>; +describe('get referenced exceptions', () => { + describe('getReferencedExceptions', () => { + let savedObjectsClient: jest.Mocked<SavedObjectsClientContract>; - beforeEach(() => { - savedObjectsClient = savedObjectsClientMock.create(); + beforeEach(() => { + savedObjectsClient = savedObjectsClientMock.create(); - (findExceptionList as jest.Mock).mockResolvedValue({ - data: [ - { + (findExceptionList as jest.Mock).mockResolvedValue({ + data: [ + { + ...getExceptionListSchemaMock(), + id: '123', + list_id: 'my-list', + namespace_type: 'single', + type: 'detection', + }, + ], + page: 1, + per_page: 20, + total: 1, + }); + jest.clearAllMocks(); + }); + + it('returns empty object if no rules to search', async () => { + const result = await getReferencedExceptionLists({ + rules: [], + savedObjectsClient, + }); + + expect(result).toEqual({}); + }); + + it('returns found referenced exception lists', async () => { + const result = await getReferencedExceptionLists({ + rules: [ + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection' }, + ], + }, + ], + savedObjectsClient, + }); + + expect(result).toEqual({ + 'my-list': { ...getExceptionListSchemaMock(), id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection', }, - ], - page: 1, - per_page: 20, - total: 1, + }); }); - jest.clearAllMocks(); - }); - it('returns empty object if no rules to search', async () => { - const result = await getReferencedExceptionLists({ - rules: [], - savedObjectsClient, + it('returns found referenced exception lists when first exceptions list is empty array and second list has a value', async () => { + const result = await getReferencedExceptionLists({ + rules: [ + { + ...getImportRulesSchemaMock(), + exceptions_list: [], + }, + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection' }, + ], + }, + ], + savedObjectsClient, + }); + + expect(result).toEqual({ + 'my-list': { + ...getExceptionListSchemaMock(), + id: '123', + list_id: 'my-list', + namespace_type: 'single', + type: 'detection', + }, + }); }); - expect(result).toEqual({}); - }); + it('returns found referenced exception lists when two rules reference same list', async () => { + const result = await getReferencedExceptionLists({ + rules: [ + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection' }, + ], + }, + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection' }, + ], + }, + ], + savedObjectsClient, + }); + + expect(result).toEqual({ + 'my-list': { + ...getExceptionListSchemaMock(), + id: '123', + list_id: 'my-list', + namespace_type: 'single', + type: 'detection', + }, + }); + }); + + it('returns two found referenced exception lists when two rules reference different lists', async () => { + (findExceptionList as jest.Mock).mockResolvedValue({ + data: [ + { + ...getExceptionListSchemaMock(), + id: '123', + list_id: 'my-list', + namespace_type: 'single', + type: 'detection', + }, + { + ...getExceptionListSchemaMock(), + id: '456', + list_id: 'other-list', + namespace_type: 'single', + type: 'detection', + }, + ], + page: 1, + per_page: 20, + total: 2, + }); + + const result = await getReferencedExceptionLists({ + rules: [ + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '456', list_id: 'other-list', namespace_type: 'single', type: 'detection' }, + ], + }, + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection' }, + ], + }, + ], + savedObjectsClient, + }); + + // the problem with these tests is that they are entirely dependent on + // the result from the saved objects client matching what we put here + // so it essentially just bypasses the code that is not interacting with + // the saved objects client. + expect(result).toEqual({ + 'my-list': { + ...getExceptionListSchemaMock(), + id: '123', + list_id: 'my-list', + namespace_type: 'single', + type: 'detection', + }, + 'other-list': { + ...getExceptionListSchemaMock(), + id: '456', + list_id: 'other-list', + namespace_type: 'single', + type: 'detection', + }, + }); + }); - it('returns found referenced exception lists', async () => { - const result = await getReferencedExceptionLists({ - rules: [ + it('returns empty object if no referenced exception lists found', async () => { + const result = await getReferencedExceptionLists({ + rules: [], + savedObjectsClient, + }); + + expect(result).toEqual({}); + }); + }); + describe('parseReferencdedExceptionsLists', () => { + it('should return parsed lists when exception lists are not empty', () => { + const res = parseReferencedExceptionsLists([ { ...getImportRulesSchemaMock(), exceptions_list: [ { id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection' }, ], }, - ], - savedObjectsClient, + ]); + expect(res).toEqual([[], [{ listId: 'my-list', namespaceType: 'single' }]]); }); - - expect(result).toEqual({ - 'my-list': { - ...getExceptionListSchemaMock(), - id: '123', - list_id: 'my-list', - namespace_type: 'single', - type: 'detection', - }, + it('should return parsed lists when one empty exception list and one non-empty list', () => { + const res = parseReferencedExceptionsLists([ + { + ...getImportRulesSchemaMock(), + exceptions_list: [], + }, + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection' }, + ], + }, + ]); + expect(res).toEqual([[], [{ listId: 'my-list', namespaceType: 'single' }]]); }); - }); - it('returns empty object if no referenced exception lists found', async () => { - const result = await getReferencedExceptionLists({ - rules: [], - savedObjectsClient, + it('should return parsed lists when two non-empty exception lists reference same list', () => { + const res = parseReferencedExceptionsLists([ + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection' }, + ], + }, + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection' }, + ], + }, + ]); + expect(res).toEqual([ + [], + [ + { listId: 'my-list', namespaceType: 'single' }, + { listId: 'my-list', namespaceType: 'single' }, + ], + ]); }); - expect(result).toEqual({}); + it('should return parsed lists when two non-empty exception lists reference differet lists', () => { + const res = parseReferencedExceptionsLists([ + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '123', list_id: 'my-list', namespace_type: 'single', type: 'detection' }, + ], + }, + { + ...getImportRulesSchemaMock(), + exceptions_list: [ + { id: '456', list_id: 'other-list', namespace_type: 'single', type: 'detection' }, + ], + }, + ]); + expect(res).toEqual([ + [], + [ + { listId: 'my-list', namespaceType: 'single' }, + { listId: 'other-list', namespaceType: 'single' }, + ], + ]); + }); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.ts index cbf6050b10b1c..6653e8ad54a6e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.ts @@ -11,29 +11,28 @@ import { getAllListTypes } from '@kbn/lists-plugin/server/services/exception_lis import type { RuleToImport } from '../../../../../../common/detection_engine/rule_management'; /** - * Helper that takes rules, goes through their referenced exception lists and - * searches for them, returning an object with all those found, using list_id as keys - * @param rules {array} - * @param savedObjectsClient {object} - * @returns {Promise} an object with all referenced lists found, using list_id as keys + * splitting out the parsing of the lists from the fetching + * for easier and more compartmentalized testing + * @param rules Array<RuleToImport | Error> + * @returns [ExceptionListQueryInfo[], ExceptionListQueryInfo[]] */ -export const getReferencedExceptionLists = async ({ - rules, - savedObjectsClient, -}: { - rules: Array<RuleToImport | Error>; - savedObjectsClient: SavedObjectsClientContract; -}): Promise<Record<string, ExceptionListSchema>> => { - const [lists] = rules.reduce<ListArray[]>((acc, rule) => { - if (!(rule instanceof Error) && rule.exceptions_list != null) { - return [...acc, rule.exceptions_list]; +export const parseReferencedExceptionsLists = ( + rules: Array<RuleToImport | Error> +): [ExceptionListQueryInfo[], ExceptionListQueryInfo[]] => { + const lists = rules.reduce<ListArray>((acc, rule) => { + if ( + !(rule instanceof Error) && + rule.exceptions_list != null && + rule.exceptions_list.length > 0 + ) { + return [...acc, ...rule.exceptions_list]; } else { return acc; } }, []); - if (lists == null) { - return {}; + if (lists == null || lists.length === 0) { + return [[], []]; } const [agnosticLists, nonAgnosticLists] = lists.reduce< @@ -49,6 +48,23 @@ export const getReferencedExceptionLists = async ({ }, [[], []] ); + return [agnosticLists, nonAgnosticLists]; +}; +/** + * Helper that takes rules, goes through their referenced exception lists and + * searches for them, returning an object with all those found, using list_id as keys + * @param rules {array} + * @param savedObjectsClient {object} + * @returns {Promise} an object with all referenced lists found, using list_id as keys + */ +export const getReferencedExceptionLists = async ({ + rules, + savedObjectsClient, +}: { + rules: Array<RuleToImport | Error>; + savedObjectsClient: SavedObjectsClientContract; +}): Promise<Record<string, ExceptionListSchema>> => { + const [agnosticLists, nonAgnosticLists] = parseReferencedExceptionsLists(rules); return getAllListTypes(agnosticLists, nonAgnosticLists, savedObjectsClient); }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts index 1c82dc1194cef..01bc55bf12467 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts @@ -161,6 +161,7 @@ export const previewRulesRoute = async ( ...securityRuleTypeOptions, ruleDataClient: previewRuleDataClient, ruleExecutionLoggerFactory: previewRuleExecutionLogger.factory, + isPreview: true, }); const runExecutors = async < @@ -216,6 +217,7 @@ export const previewRulesRoute = async ( const rule = { ...internalRule, + id: previewId, createdAt: new Date(), createdBy: username ?? 'preview-created-by', producer: 'preview-producer', @@ -231,10 +233,7 @@ export const previewRulesRoute = async ( invocationStartTime = moment(); statePreview = (await executor({ - alertId: previewId, - createdBy: rule.createdBy, executionId: uuid.v4(), - name: rule.name, params, previousStartedAt, rule, @@ -256,8 +255,6 @@ export const previewRulesRoute = async ( spaceId, startedAt: startedAt.toDate(), state: statePreview, - tags: [], - updatedBy: rule.updatedBy, logger, })) as TState; @@ -406,7 +403,9 @@ export const previewRulesRoute = async ( ); break; case 'new_terms': - const newTermsAlertType = previewRuleTypeWrapper(createNewTermsAlertType(ruleOptions)); + const newTermsAlertType = previewRuleTypeWrapper( + createNewTermsAlertType(ruleOptions, true) + ); await runExecutors( newTermsAlertType.executor, newTermsAlertType.id, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.test.ts index 551562c6b6e9f..88410e8db204d 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.test.ts @@ -15,7 +15,7 @@ const esQuery = { describe('wrapScopedClusterClient', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts index 371e49d26db96..4376b8785e0e3 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts @@ -25,7 +25,7 @@ const createSearchSourceClientMock = () => { describe('wrapSearchSourceClient', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.mock.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.mock.ts index f41494cf5fed4..04cec44000f78 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.mock.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.mock.ts @@ -195,6 +195,7 @@ export const getThreatRuleParams = (): ThreatRuleParams => { }; export const getRuleConfigMock = (type: string = 'rule-type'): SanitizedRuleConfig => ({ + id: sampleRuleGuid, actions: [], enabled: true, name: 'rule-name', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts index bd630b1a71107..8ee773bb91cf7 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts @@ -46,7 +46,7 @@ import { buildTimestampRuntimeMapping } from './utils/build_timestamp_runtime_ma /* eslint-disable complexity */ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = - ({ lists, logger, config, ruleDataClient, ruleExecutionLoggerFactory, version }) => + ({ lists, logger, config, ruleDataClient, ruleExecutionLoggerFactory, version, isPreview }) => (type) => { const { alertIgnoreFields: ignoreFields, alertMergeStrategy: mergeStrategy } = config; const persistenceRuleType = createPersistenceRuleTypeWrapper({ ruleDataClient, logger }); @@ -62,7 +62,6 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = agent.setTransactionName(`${options.rule.ruleTypeId} execution`); return withSecuritySpan('securityRuleTypeExecutor', async () => { const { - alertId, executionId, params, previousStartedAt, @@ -70,7 +69,6 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = services, spaceId, state, - updatedBy: updatedByUser, rule, } = options; let runState = state; @@ -99,7 +97,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = savedObjectsClient, context: { executionId, - ruleId: alertId, + ruleId: rule.id, ruleUuid: params.ruleId, ruleName: rule.name, ruleType: rule.ruleTypeId, @@ -110,7 +108,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = const completeRule = { ruleConfig: rule, ruleParams: params, - alertId, + alertId: rule.id, }; const { @@ -135,7 +133,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = const notificationRuleParams: NotificationRuleTypeParams = { ...params, name, - id: alertId, + id: rule.id, }; const primaryTimestamp = timestampOverride ?? TIMESTAMP; @@ -270,7 +268,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = try { const { listClient, exceptionsClient } = getListClient({ esClient: services.scopedClusterClient.asCurrentUser, - updatedByUser, + updatedByUser: rule.updatedBy, spaceId, lists, savedObjectClient: options.services.savedObjectsClient, @@ -287,6 +285,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = ruleExecutionLogger ); + const alertTimestampOverride = isPreview ? startedAt : undefined; const legacySignalFields: string[] = Object.keys(aadFieldConversion); const wrapHits = wrapHitsFactory({ ignoreFields: [...ignoreFields, ...legacySignalFields], @@ -294,6 +293,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = completeRule, spaceId, indicesToQuery: inputIndex, + alertTimestampOverride, }); const wrapSequences = wrapSequencesFactory({ @@ -303,6 +303,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = completeRule, spaceId, indicesToQuery: inputIndex, + alertTimestampOverride, }); const { filter: exceptionFilter, unprocessedExceptions } = await buildExceptionFilter({ @@ -390,7 +391,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = const resultsLink = getNotificationResultsLink({ from: fromInMs, to: toInMs, - id: alertId, + id: rule.id, kibanaSiemAppUrl: (meta as { kibana_siem_app_url?: string } | undefined) ?.kibana_siem_app_url, }); @@ -400,10 +401,10 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = if (completeRule.ruleConfig.throttle != null) { // NOTE: Since this is throttled we have to call it even on an error condition, otherwise it will "reset" the throttle and fire early await scheduleThrottledNotificationActions({ - alertInstance: services.alertFactory.create(alertId), + alertInstance: services.alertFactory.create(rule.id), throttle: completeRule.ruleConfig.throttle ?? '', startedAt, - id: alertId, + id: rule.id, kibanaSiemAppUrl: (meta as { kibana_siem_app_url?: string } | undefined) ?.kibana_siem_app_url, outputIndex: ruleDataClient.indexNameWithNamespace(spaceId), @@ -414,7 +415,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = logger, }); } else if (createdSignalsCount) { - const alertInstance = services.alertFactory.create(alertId); + const alertInstance = services.alertFactory.create(rule.id); scheduleNotificationActions({ alertInstance, signalsCount: createdSignalsCount, @@ -479,7 +480,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper = // NOTE: Since this is throttled we have to call it even on an error condition, otherwise it will "reset" the throttle and fire early if (actions.length && completeRule.ruleConfig.throttle != null) { await scheduleThrottledNotificationActions({ - alertInstance: services.alertFactory.create(alertId), + alertInstance: services.alertFactory.create(rule.id), throttle: completeRule.ruleConfig.throttle ?? '', startedAt, id: completeRule.alertId, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.test.ts index 5e6cccd11e037..685d85d40a6b4 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.test.ts @@ -65,7 +65,8 @@ describe('buildAlert', () => { completeRule, SPACE_ID, reason, - completeRule.ruleParams.index as string[] + completeRule.ruleParams.index as string[], + undefined ), ...additionalAlertFields(doc), }; @@ -245,7 +246,8 @@ describe('buildAlert', () => { completeRule, SPACE_ID, reason, - completeRule.ruleParams.index as string[] + completeRule.ruleParams.index as string[], + undefined ), ...additionalAlertFields(doc), }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.ts index c716af17361ec..cbc1d2cc89f96 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.ts @@ -136,6 +136,7 @@ export const buildAlert = ( spaceId: string | null | undefined, reason: string, indicesToQuery: string[], + alertTimestampOverride: Date | undefined, overrides?: { nameOverride: string; severityOverride: string; @@ -179,7 +180,7 @@ export const buildAlert = ( }); return { - [TIMESTAMP]: new Date().toISOString(), + [TIMESTAMP]: alertTimestampOverride?.toISOString() ?? new Date().toISOString(), [SPACE_IDS]: spaceId != null ? [spaceId] : [], [EVENT_KIND]: 'signal', [ALERT_ORIGINAL_TIME]: originalTime?.toISOString(), diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts index e047c86e75473..6a10dac0637d5 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts @@ -59,7 +59,8 @@ describe('buildAlert', () => { 'allFields', SPACE_ID, jest.fn(), - completeRule.ruleParams.index as string[] + completeRule.ruleParams.index as string[], + undefined ); expect(alertGroup.length).toEqual(3); expect(alertGroup[0]).toEqual( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts index 700986198468c..22728c8f248df 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts @@ -43,7 +43,8 @@ export const buildAlertGroupFromSequence = ( mergeStrategy: ConfigType['alertMergeStrategy'], spaceId: string | null | undefined, buildReasonMessage: BuildReasonMessage, - indicesToQuery: string[] + indicesToQuery: string[], + alertTimestampOverride: Date | undefined ): Array<WrappedFieldsLatest<EqlBuildingBlockFieldsLatest | EqlShellFieldsLatest>> => { const ancestors: Ancestor[] = sequence.events.flatMap((event) => buildAncestors(event)); if (ancestors.some((ancestor) => ancestor?.rule === completeRule.alertId)) { @@ -63,7 +64,8 @@ export const buildAlertGroupFromSequence = ( [], false, buildReasonMessage, - indicesToQuery + indicesToQuery, + alertTimestampOverride ) ); } catch (error) { @@ -93,7 +95,8 @@ export const buildAlertGroupFromSequence = ( completeRule, spaceId, buildReasonMessage, - indicesToQuery + indicesToQuery, + alertTimestampOverride ); const sequenceAlert: WrappedFieldsLatest<EqlShellFieldsLatest> = { _id: shellAlert[ALERT_UUID], @@ -122,7 +125,8 @@ export const buildAlertRoot = ( completeRule: CompleteRule<RuleParams>, spaceId: string | null | undefined, buildReasonMessage: BuildReasonMessage, - indicesToQuery: string[] + indicesToQuery: string[], + alertTimestampOverride: Date | undefined ): EqlShellFieldsLatest => { const mergedAlerts = objectArrayIntersection(wrappedBuildingBlocks.map((alert) => alert._source)); const reason = buildReasonMessage({ @@ -130,7 +134,14 @@ export const buildAlertRoot = ( severity: completeRule.ruleParams.severity, mergedDoc: mergedAlerts as SignalSourceHit, }); - const doc = buildAlert(wrappedBuildingBlocks, completeRule, spaceId, reason, indicesToQuery); + const doc = buildAlert( + wrappedBuildingBlocks, + completeRule, + spaceId, + reason, + indicesToQuery, + alertTimestampOverride + ); const alertId = generateAlertId(doc); return { ...mergedAlerts, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_bulk_body.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_bulk_body.ts index 4d63f5c848484..c887d51df3ee5 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_bulk_body.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_bulk_body.ts @@ -51,7 +51,8 @@ export const buildBulkBody = ( ignoreFields: ConfigType['alertIgnoreFields'], applyOverrides: boolean, buildReasonMessage: BuildReasonMessage, - indicesToQuery: string[] + indicesToQuery: string[], + alertTimestampOverride: Date | undefined ): BaseFieldsLatest => { const mergedDoc = getMergeStrategy(mergeStrategy)({ doc, ignoreFields }); const eventFields = buildEventTypeAlert(mergedDoc); @@ -87,7 +88,15 @@ export const buildBulkBody = ( return { ...filteredSource, ...eventFields, - ...buildAlert([mergedDoc], completeRule, spaceId, reason, indicesToQuery, overrides), + ...buildAlert( + [mergedDoc], + completeRule, + spaceId, + reason, + indicesToQuery, + alertTimestampOverride, + overrides + ), ...additionalAlertFields({ ...mergedDoc, _source: { ...mergedDoc._source, ...eventFields } }), }; } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.test.ts index 6742f21759648..cfa696d71c47f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.test.ts @@ -22,6 +22,7 @@ describe('wrapNewTermsAlerts', () => { mergeStrategy: 'missingFields', completeRule, indicesToQuery: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], + alertTimestampOverride: undefined, }); expect(alerts[0]._id).toEqual('a36d9fe6fe4b2f65058fb1a487733275f811af58'); @@ -38,6 +39,7 @@ describe('wrapNewTermsAlerts', () => { mergeStrategy: 'missingFields', completeRule, indicesToQuery: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], + alertTimestampOverride: undefined, }); expect(alerts[0]._id).toEqual('f7877a31b1cc83373dbc9ba5939ebfab1db66545'); @@ -54,6 +56,7 @@ describe('wrapNewTermsAlerts', () => { mergeStrategy: 'missingFields', completeRule, indicesToQuery: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], + alertTimestampOverride: undefined, }); expect(alerts[0]._id).toEqual('75e5a507a4bc48bcd983820c7fd2d9621ff4e2ea'); @@ -70,6 +73,7 @@ describe('wrapNewTermsAlerts', () => { mergeStrategy: 'missingFields', completeRule, indicesToQuery: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], + alertTimestampOverride: undefined, }); expect(alerts[0]._id).toEqual('86a216cfa4884767d9bb26d2b8db911cb4aa85ce'); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.ts index 38ae5b1be75ae..e39bcf67909ae 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/wrap_new_terms_alerts.ts @@ -31,12 +31,14 @@ export const wrapNewTermsAlerts = ({ completeRule, mergeStrategy, indicesToQuery, + alertTimestampOverride, }: { eventsAndTerms: EventsAndTerms[]; spaceId: string | null | undefined; completeRule: CompleteRule<RuleParams>; mergeStrategy: ConfigType['alertMergeStrategy']; indicesToQuery: string[]; + alertTimestampOverride: Date | undefined; }): Array<WrappedFieldsLatest<NewTermsFieldsLatest>> => { return eventsAndTerms.map((eventAndTerms) => { const id = objectHash([ @@ -54,7 +56,8 @@ export const wrapNewTermsAlerts = ({ [], true, buildReasonMessageForNewTermsAlert, - indicesToQuery + indicesToQuery, + alertTimestampOverride ); return { _id: id, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts index 75d55a5756680..123374eeb32de 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts @@ -26,12 +26,14 @@ export const wrapHitsFactory = mergeStrategy, spaceId, indicesToQuery, + alertTimestampOverride, }: { completeRule: CompleteRule<RuleParams>; ignoreFields: ConfigType['alertIgnoreFields']; mergeStrategy: ConfigType['alertMergeStrategy']; spaceId: string | null | undefined; indicesToQuery: string[]; + alertTimestampOverride: Date | undefined; }) => ( events: Array<estypes.SearchHit<SignalSource>>, @@ -56,7 +58,8 @@ export const wrapHitsFactory = ignoreFields, true, buildReasonMessage, - indicesToQuery + indicesToQuery, + alertTimestampOverride ), [ALERT_UUID]: id, }, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_sequences_factory.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_sequences_factory.ts index b700c31cf7c72..d4de6c1537f48 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_sequences_factory.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_sequences_factory.ts @@ -24,6 +24,7 @@ export const wrapSequencesFactory = mergeStrategy, spaceId, indicesToQuery, + alertTimestampOverride, }: { logger: Logger; completeRule: CompleteRule<RuleParams>; @@ -31,6 +32,7 @@ export const wrapSequencesFactory = mergeStrategy: ConfigType['alertMergeStrategy']; spaceId: string | null | undefined; indicesToQuery: string[]; + alertTimestampOverride: Date | undefined; }): WrapSequences => (sequences, buildReasonMessage) => sequences.reduce( @@ -43,7 +45,8 @@ export const wrapSequencesFactory = mergeStrategy, spaceId, buildReasonMessage, - indicesToQuery + indicesToQuery, + alertTimestampOverride ), ], [] diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts index 630553bc4d78c..8fce33897bd0f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts @@ -37,7 +37,8 @@ import { import { createEnrichEventsFunction } from '../../signals/enrichments'; export const createNewTermsAlertType = ( - createOptions: CreateRuleOptions + createOptions: CreateRuleOptions, + isPreview?: boolean ): SecurityAlertType<NewTermsRuleParams, {}, {}, 'default'> => { const { logger } = createOptions; return { @@ -105,6 +106,7 @@ export const createNewTermsAlertType = ( params, spaceId, state, + startedAt, } = execOptions; // Validate the history window size compared to `from` at runtime as well as in the `validate` @@ -276,12 +278,14 @@ export const createNewTermsAlertType = ( newTerms: [bucket.key], })); + const alertTimestampOverride = isPreview ? startedAt : undefined; const wrappedAlerts = wrapNewTermsAlerts({ eventsAndTerms, spaceId, completeRule, mergeStrategy, indicesToQuery: inputIndex, + alertTimestampOverride, }); const bulkCreateResult = await bulkCreate( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/types.ts index 03634c19b0ba0..ffd9e587361e9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/types.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/types.ts @@ -108,6 +108,7 @@ export interface CreateSecurityRuleTypeWrapperProps { ruleDataClient: IRuleDataClient; ruleExecutionLoggerFactory: IRuleExecutionLogService['createClientForExecutors']; version: string; + isPreview?: boolean; } export type CreateSecurityRuleTypeWrapper = ( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts index 489237ea1b2c9..e49c86ae2de48 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts @@ -104,6 +104,7 @@ describe('searchAfterAndBulkCreate', () => { ignoreFields: [], spaceId: 'default', indicesToQuery: inputIndexPattern, + alertTimestampOverride: undefined, }); }); diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/readme.md b/x-pack/plugins/security_solution/server/lib/risk_score/readme.md index e6f452cefdc95..e2bc1c280affc 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/readme.md +++ b/x-pack/plugins/security_solution/server/lib/risk_score/readme.md @@ -2,21 +2,477 @@ ### API usage -The risk score API has one route with one method - -1. GET - `getRiskScoreIndexStatusRoute` -2. REQUEST: - ```typescript - GET /internal/risk_score/index_status - { - indexName: 'ml_host_risk_score_latest' +#### 1. GET /internal/risk_score/index_status - `getRiskScoreIndexStatusRoute` +##### REQUEST: +```typescript + GET /internal/risk_score/index_status + { + indexName: 'ml_host_risk_score_latest' + } +``` +##### RESPONSE: +```typescript + { + isDeprecated: boolean; + isEnabled: boolean; + } +``` +##### This route is called from `useRiskScore` hook. + +#### 2. PUT - /internal/risk_score/indices/create + +example: +##### REQUEST: + +``` +PUT /internal/risk_score/indices/create +{ + "index": "ml_host_risk_score_latest_default-test", + "mappings": { + "properties": { + "host.name": { + "type": "keyword" + }, + "@timestamp": { + "type": "date" + }, + "ingest_timestamp": { + "type": "date" + }, + "risk": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword" + } + } + }, + "risk_stats": { + "properties": { + "risk_score": { + "type": "float" + } + } + } } - ``` -3. RESPONSE: - ```typescript - { - isDeprecated: boolean; - isEnabled: boolean; - } - ``` -4. This route is called from `useRiskScore` hook. \ No newline at end of file + } +} +``` + + +##### RESPONSE: +``` +{ + "index": "ml_host_risk_score_latest_default-test", + "mappings": { + "properties": { + "host.name": { + "type": "keyword" + }, + "@timestamp": { + "type": "date" + }, + "ingest_timestamp": { + "type": "date" + }, + "risk": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword" + } + } + }, + "risk_stats": { + "properties": { + "risk_score": { + "type": "float" + } + } + } + } + } +} +``` + +#### 3. POST - /internal/risk_score/indices/delete + +example: + +##### REQUEST: +``` + POST /internal/risk_score/indices/delete + { + "indices": ["ml_host_risk_score_latest_default-test"] + } +``` + +##### RESPONSE: +``` + { + "deleted": [ + "ml_host_risk_score_latest_default-test" + ] + } +``` + +#### 4. POST - /internal/risk_score + +Onboard host or user risk score. +##### Option: + +|Body|description| +|--|--| +|riskScoreEntity|value: `host` or `user`| + +example: + +##### REQUEST: +``` + POST /internal/risk_score + { + "riskScoreEntity": host + } +``` +##### RESPONSE: + +``` +[ + { + "ml_hostriskscore_levels_script_default": { + "success": true, + "error": null + } + }, + { + "ml_hostriskscore_ingest_pipeline_default": { + "success": true, + "error": null + } + }, + { + "ml_hostriskscore_init_script_default": { + "success": true, + "error": null + } + }, + { + "ml_hostriskscore_map_script_default": { + "success": true, + "error": null + } + }, + { + "ml_hostriskscore_reduce_script_default": { + "success": true, + "error": null + } + }, + { + "ml_host_risk_score_default": { + "success": true, + "error": null + } + }, + { + "ml_host_risk_score_latest_default": { + "success": true, + "error": null + } + }, + { + "ml_hostriskscore_pivot_transform_default": { + "success": true, + "error": null + } + }, + { + "ml_hostriskscore_latest_transform_default": { + "success": true, + "error": null + } + } +] +``` + +#### 5. GET - /internal/risk_score/prebuilt_content/dev_tool/{console_id} + +Get scripts for onboarding host or user risk score + +##### Option: + +|Param|description| +|--|--| +|console_id|value: `enable_host_risk_score` or `enable_user_risk_score`| + +example: + +##### REQUEST: + +``` +GET /internal/risk_score/prebuilt_content/dev_tool/enable_host_risk_score +``` + +##### RESPONSE: + +``` +# Click the run button of each step to enable the module +# Upload scripts +# 1. Script to assign risk level based on risk score +PUT _scripts/ml_hostriskscore_levels_script_default +{ +"script": { +"lang": "painless", +"source": "double risk_score = (def)ctx.getByPath(params.risk_score);\nif (risk_score < 20) {\n + ctx['host']['risk']['calculated_level']='Unknown' \n}\nelse if (risk_score>= 20 && risk_score < 40) {\n + ctx['host']['risk']['calculated_level']='Low' \n}\nelse if (risk_score>= 40 && risk_score < 70) {\n + ctx['host']['risk']['calculated_level']='Moderate' \n}\nelse if (risk_score>= 70 && risk_score < 90) {\n + ctx['host']['risk']['calculated_level']='High' \n}\nelse if (risk_score>= 90) {\n + ctx['host']['risk']['calculated_level'] = 'Critical'\n}" + } + } + + # 2. Script to setup initial state for the Host Risk Score scripted metric aggregation + PUT _scripts/ml_hostriskscore_init_script_default + { + "script": { + "lang": "painless", + "source": "state.rule_risk_stats = new HashMap();\nstate.host_variant_set = false;\nstate.host_variant = + new String();\nstate.tactic_ids = new HashSet();" + } + } + + # 3. Map script for the Host Risk Score transform + PUT _scripts/ml_hostriskscore_map_script_default + { + "script": { + "lang": "painless", + "source": "// Get the host variant\nif (state.host_variant_set == false) {\n if + (doc.containsKey(\"host.os.full\") && doc[\"host.os.full\"].size() != 0) {\n state.host_variant = + doc[\"host.os.full\"].value;\n state.host_variant_set = true;\n }\n}\n// Aggregate all the tactics seen + on the host\nif (doc.containsKey(\"signal.rule.threat.tactic.id\") && + doc[\"signal.rule.threat.tactic.id\"].size() != 0) {\n + state.tactic_ids.add(doc[\"signal.rule.threat.tactic.id\"].value);\n}\n// Get running sum of + time-decayed risk score per rule name per shard\nString rule_name = + doc[\"signal.rule.name\"].value;\ndef stats = state.rule_risk_stats.getOrDefault(rule_name, + [0.0,\"\",false]);\nint time_diff = (int)((System.currentTimeMillis() - + doc[\"@timestamp\"].value.toInstant().toEpochMilli()) / (1000.0 * 60.0 * 60.0));\ndouble risk_derate = + Math.min(1, Math.exp((params.lookback_time - time_diff) / params.time_decay_constant));\nstats[0] = + Math.max(stats[0], doc[\"signal.rule.risk_score\"].value * risk_derate);\nif (stats[2] == false) {\n + stats[1] = doc[\"kibana.alert.rule.uuid\"].value;\n stats[2] = + true;\n}\nstate.rule_risk_stats.put(rule_name, stats);" + } + } + + # 4. Reduce script for the Host Risk Score transform + PUT _scripts/ml_hostriskscore_reduce_script_default + { + "script": { + "lang": "painless", + "source": "// Consolidating time decayed risks and tactics from across all shards\nMap total_risk_stats + = new HashMap();\nString host_variant = new String();\ndef tactic_ids = new HashSet();\nfor (state in + states) {\n for (key in state.rule_risk_stats.keySet()) {\n def rule_stats = + state.rule_risk_stats.get(key);\n def stats = total_risk_stats.getOrDefault(key, [0.0,\"\",false]);\n + stats[0] = Math.max(stats[0], rule_stats[0]);\n if (stats[2] == false) {\n stats[1] = rule_stats[1];\n + stats[2] = true;\n } \n total_risk_stats.put(key, stats);\n }\n if (host_variant.length() == 0) {\n + host_variant = state.host_variant;\n }\n tactic_ids.addAll(state.tactic_ids);\n}\n// Consolidating + individual rule risks and arranging them in decreasing order\nList risks = new ArrayList();\nfor (key in + total_risk_stats.keySet()) {\n risks.add(total_risk_stats[key][0])\n}\nCollections.sort(risks, + Collections.reverseOrder());\n// Calculating total host risk score\ndouble total_risk = 0.0;\ndouble + risk_cap = params.max_risk * params.zeta_constant;\nfor (int i=0;i<risks.length;i++) {\n total_risk + +=risks[i] / Math.pow((1+i), params.p);\n}\n// Normalizing the host risk score\ndouble + total_norm_risk=100 * total_risk / risk_cap;\nif (total_norm_risk < 40) {\n total_norm_risk=2.125 * + total_norm_risk;\n}\nelse if (total_norm_risk>= 40 && total_norm_risk < 50) {\n total_norm_risk=85 + + (total_norm_risk - 40);\n}\nelse {\n total_norm_risk=95 + (total_norm_risk - 50) / 10;\n}\n// + Calculating multipliers to the host risk score\ndouble risk_multiplier=1.0;\nList + multipliers=new ArrayList();\n// Add a multiplier if host is a server\nif + (host_variant.toLowerCase().contains(\"server\")) {\n risk_multiplier + *=params.server_multiplier;\n multipliers.add(\"Host is a server\");\n}\n// Add multipliers + based on number and diversity of tactics seen on the host\nfor (String tactic : tactic_ids) {\n + multipliers.add(\"Tactic \"+tactic);\n risk_multiplier *=1 + params.tactic_base_multiplier * + params.tactic_weights.getOrDefault(tactic, 0);\n}\n// Calculating final risk\ndouble + final_risk=total_norm_risk;\nif (risk_multiplier> 1.0) {\n double prior_odds = (total_norm_risk) + / (100 - total_norm_risk);\n double updated_odds = prior_odds * risk_multiplier; \n final_risk = + 100 * updated_odds / (1 + updated_odds);\n}\n// Adding additional metadata\nList rule_stats = + new ArrayList();\nfor (key in total_risk_stats.keySet()) {\n Map temp = new HashMap();\n + temp[\"rule_name\"] = key;\n temp[\"rule_risk\"] = total_risk_stats[key][0];\n temp[\"rule_id\"] + = total_risk_stats[key][1];\n rule_stats.add(temp);\n}\n\nreturn [\"calculated_score_norm\": + final_risk, \"rule_risks\": rule_stats, \"multipliers\": multipliers];" + } + } + + # 5. Upload the ingest pipeline + # Ingest pipeline to add ingest timestamp and risk level to documents + PUT _ingest/pipeline/ml_hostriskscore_ingest_pipeline_default + { + "processors": + [{"set":{"field":"ingest_timestamp","value":"{{_ingest.timestamp}}"}},{"fingerprint":{"fields":["@timestamp","_id"],"method":"SHA-256","target_field":"_id"}},{"script":{"id":"ml_hostriskscore_levels_script_default","params":{"risk_score":"host.risk.calculated_score_norm"}}}] + } + + # 6. Create mappings for the destination index of the Host Risk Score pivot transform + PUT ml_host_risk_score_default + { + "mappings": + {"properties":{"host":{"properties":{"name":{"type":"keyword"},"risk":{"properties":{"calculated_score_norm":{"type":"float"},"calculated_level":{"type":"keyword"},"multipliers":{"type":"keyword"},"rule_risks":{"properties":{"rule_name":{"type":"text","fields":{"keyword":{"type":"keyword"}}},"rule_risk":{"type":"float"},"rule_id":{"type":"keyword"}}}}}}},"ingest_timestamp":{"type":"date"},"@timestamp":{"type":"date"}}} + } + + # 7. Upload the Host Risk Score pivot transform + # This transform runs hourly and calculates a risk score and risk level for hosts in a Kibana + space + PUT _transform/ml_hostriskscore_pivot_transform_default + {"dest":{"index":"ml_host_risk_score_default","pipeline":"ml_hostriskscore_ingest_pipeline_default"},"frequency":"1h","pivot":{"aggregations":{"@timestamp":{"max":{"field":"@timestamp"}},"host.risk":{"scripted_metric":{"combine_script":"return + state","init_script":{"id":"ml_hostriskscore_init_script_default"},"map_script":{"id":"ml_hostriskscore_map_script_default"},"params":{"lookback_time":72,"max_risk":100,"p":1.5,"server_multiplier":1.5,"tactic_base_multiplier":0.25,"tactic_weights":{"TA0001":1,"TA0002":2,"TA0003":3,"TA0004":4,"TA0005":4,"TA0006":4,"TA0007":4,"TA0008":5,"TA0009":6,"TA0010":7,"TA0011":6,"TA0040":8,"TA0042":1,"TA0043":1},"time_decay_constant":6,"zeta_constant":2.612},"reduce_script":{"id":"ml_hostriskscore_reduce_script_default"}}}},"group_by":{"host.name":{"terms":{"field":"host.name"}}}},"source":{"index":[".alerts-security.alerts-default"],"query":{"bool":{"filter":[{"range":{"@timestamp":{"gte":"now-5d"}}}]}}},"sync":{"time":{"delay":"120s","field":"@timestamp"}}} + + + # 8. Start the pivot transform + POST _transform/ml_hostriskscore_pivot_transform_default/_start + + # 9. Create mappings for the destination index of the Host Risk Score latest transform + PUT ml_host_risk_score_latest_default + { + "mappings": + {"properties":{"host":{"properties":{"name":{"type":"keyword"},"risk":{"properties":{"calculated_score_norm":{"type":"float"},"calculated_level":{"type":"keyword"},"multipliers":{"type":"keyword"},"rule_risks":{"properties":{"rule_name":{"type":"text","fields":{"keyword":{"type":"keyword"}}},"rule_risk":{"type":"float"},"rule_id":{"type":"keyword"}}}}}}},"ingest_timestamp":{"type":"date"},"@timestamp":{"type":"date"}}} + } + + # 10. Upload the latest transform + # This transform gets the latest risk information about hosts in a Kibana space + PUT _transform/ml_hostriskscore_latest_transform_default + {"dest":{"index":"ml_host_risk_score_latest_default"},"frequency":"1h","latest":{"sort":"@timestamp","unique_key":["host.name"]},"source":{"index":["ml_host_risk_score_default"]},"sync":{"time":{"delay":"2s","field":"ingest_timestamp"}}} + + # 11. Start the latest transform + POST _transform/ml_hostriskscore_latest_transform_default/_start + + # Hint: If you don't see data after running any of the transforms, stop and restart the + transforms + # Stop the pivot transform + POST _transform/ml_hostriskscore_pivot_transform_default/_stop + + # Start the pivot transform + POST _transform/ml_hostriskscore_pivot_transform_default/_start + + # Stop the latest transform + POST _transform/ml_hostriskscore_latest_transform_default/_stop + + # Start the latest transform + POST _transform/ml_hostriskscore_latest_transform_default/_start +``` + +#### 6. POST - /internal/risk_score/prebuilt_content/saved_objects/_bulk_create/{template_name} + +Import saved objects for host or user risk score +##### Option: + +|Param|description| +|--|--| +|template_name|value: `hostRiskScoreDashboards` or `userRiskScoreDashboards`| + +example: + +##### REQUEST: + +``` +POST /internal/risk_score/prebuilt_content/saved_objects/_bulk_create/hostRiskScoreDashboards +``` + +##### RESPONSE: + +``` +{ + "hostRiskScoreDashboards": { + "success": true, + "error": null, + "body": [ + { + "id": "259ef77a-0ea2-4ba2-bb77-f33fae4ec8aa", + "type": "index-pattern", + "title": "ml_host_risk_score_default" + }, + { + "id": "0adfc3b7-efa0-470e-ac31-27b1d8e01c48", + "type": "lens", + "title": "Host Risk Score (Max Risk Score Histogram)" + }, + { + "id": "e1a4d5f1-e59f-4ee6-918b-a1a1b48bf8de", + "type": "index-pattern", + "title": ".alerts-security.alerts-default" + }, + { + "id": "7799bfdf-9318-4f85-b840-678ccfbd9f79", + "type": "visualization", + "title": "Host Risk Score (Rule Breakdown)" + }, + { + "id": "acbc71e9-de52-47cd-ade6-33be0efdb1dc", + "type": "visualization", + "title": "Associated Users (Rule Breakdown)" + }, + { + "id": "0fb7224d-5e32-4f3d-b408-ee6acfd3f0c6", + "type": "visualization", + "title": "Host Risk Score (Tactic Breakdown)- Verbose" + }, + { + "id": "53e4c2cd-9f34-48dd-ab87-f48b8c5dec22", + "type": "tag", + "name": "experimental" + }, + { + "id": "2175ffc6-c53c-46ac-b15d-be9b849881ac", + "type": "dashboard", + "title": "Drilldown of Host Risk Score" + }, + { + "id": "d9d560b4-beed-4c27-9989-95187e64d79b", + "type": "index-pattern", + "title": "ml_host_risk_score_latest_default" + }, + { + "id": "927a8467-ccc6-4374-85a4-0aab6c1c0613", + "type": "lens", + "title": "Current Risk Score for Hosts" + }, + { + "id": "aa7acd4e-b4e1-4730-acac-f73992034b0d", + "type": "dashboard", + "title": "Current Risk Score for Hosts" + } + ] + } +} +``` + +#### 7. POST - /internal/risk_score/prebuilt_content/saved_objects/_bulk_delete/{template_name} + +Import saved objects for host or user risk score +##### Option: + +|Param|description| +|--|--| +|template_name|value: `hostRiskScoreDashboards` or `userRiskScoreDashboards`| + +example: + +##### REQUEST: + +``` +POST /internal/risk_score/prebuilt_content/saved_objects/_bulk_delete/hostRiskScoreDashboards +``` + +##### RESPONSE: + +``` +[ + "Saved object [index-pattern/ml-host-risk-score-default-index-pattern] not found", + "Saved object [lens/d3f72670-d3a0-11eb-bd37-7bb50422e346] not found", + "Saved object [index-pattern/alerts-default-index-pattern] not found", + "Saved object [visualization/42371d00-cf7a-11eb-9a96-05d89f94ad96] not found", + "Saved object [visualization/a62d3ed0-cf92-11eb-a0ff-1763d16cbda7] not found", + "Saved object [visualization/b2dbc9b0-cf94-11eb-bd37-7bb50422e346] not found", + "Saved object [tag/1d00ebe0-f3b2-11eb-beb2-b91666445a94] not found", + "Saved object [dashboard/6f05c8c0-cf77-11eb-9a96-05d89f94ad96] not found", + "Saved object [index-pattern/ml-host-risk-score-latest-default-index-pattern] not found", + "Saved object [lens/dc289c10-d4ff-11eb-a0ff-1763d16cbda7] not found", + "Saved object [dashboard/27b483b0-d500-11eb-a0ff-1763d16cbda7] not found" +] +``` \ No newline at end of file diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/routes/index.ts b/x-pack/plugins/security_solution/server/lib/risk_score/routes/index.ts index c55c9086bb447..886e1fddeed2e 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/routes/index.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/routes/index.ts @@ -18,4 +18,3 @@ export { deleteStoredScriptRoute } from '../stored_scripts/delete_script_route'; export { getRiskScoreIndexStatusRoute } from '../index_status'; export { installRiskScoresRoute } from '../onboarding/routes/install_risk_scores'; -export { restartTransformRoute } from '../transform/restart_transform'; diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/transform/helpers/transforms.ts b/x-pack/plugins/security_solution/server/lib/risk_score/transform/helpers/transforms.ts index eddd6e52251e9..c79bff0206ea2 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/transform/helpers/transforms.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/transform/helpers/transforms.ts @@ -180,62 +180,3 @@ export const startTransformIfNotStarted = async ( }; } }; - -const stopTransform = async ( - esClient: ElasticsearchClient, - transformId: string, - logger: Logger -) => { - const fetchedTransformStats = await checkTransformState(esClient, transformId, logger); - if (fetchedTransformStats.state) { - try { - await esClient.transform.stopTransform({ - transform_id: transformId, - force: fetchedTransformStats.state === TRANSFORM_STATE.FAILED, - wait_for_completion: true, - }); - return { [transformId]: { success: true, error: null } }; - } catch (startErr) { - const startError = transformError(startErr); - - logger.error(`Failed stopping transform ${transformId}: ${startError.message}`); - return { - [transformId]: { - success: false, - error: startError, - }, - }; - } - } else { - logger.error( - `Not stopping transform ${transformId} since it's state is: ${fetchedTransformStats.state}` - ); - return { - [transformId]: { - success: false, - error: transformError( - new Error( - i18n.translate('xpack.securitySolution.riskScore.transform.stop.stateConflictTitle', { - values: { transformId, state: fetchedTransformStats.state }, - defaultMessage: `Not stopping transform {transformId} since it's state is: {state}`, - }) - ) - ), - }, - }; - } -}; - -export const restartTransform = ( - esClient: ElasticsearchClient, - transformId: string, - logger: Logger -) => { - return stopTransform(esClient, transformId, logger).then((result) => { - if (result[transformId].success) { - return startTransformIfNotStarted(esClient, transformId, logger); - } else { - return result; - } - }); -}; diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/transform/restart_transform.ts b/x-pack/plugins/security_solution/server/lib/risk_score/transform/restart_transform.ts deleted file mode 100644 index 9b08ea40da9bc..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/risk_score/transform/restart_transform.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { transformError } from '@kbn/securitysolution-es-utils'; -import type { Logger } from '@kbn/core/server'; -import { schema } from '@kbn/config-schema'; - -import { RISK_SCORE_RESTART_TRANSFORMS } from '../../../../common/constants'; -import type { SecuritySolutionPluginRouter } from '../../../types'; - -import { buildSiemResponse } from '../../detection_engine/routes/utils'; - -import { RiskScoreEntity } from '../../../../common/search_strategy'; -import { restartTransform } from './helpers/transforms'; -import { - getRiskScoreLatestTransformId, - getRiskScorePivotTransformId, -} from '../../../../common/utils/risk_score_modules'; - -const restartRiskScoreTransformsSchema = { - body: schema.object({ - riskScoreEntity: schema.oneOf([ - schema.literal(RiskScoreEntity.host), - schema.literal(RiskScoreEntity.user), - ]), - }), -}; - -export const restartTransformRoute = (router: SecuritySolutionPluginRouter, logger: Logger) => { - router.post( - { - path: RISK_SCORE_RESTART_TRANSFORMS, - validate: restartRiskScoreTransformsSchema, - options: { - tags: ['access:securitySolution'], - }, - }, - async (context, request, response) => { - const siemResponse = buildSiemResponse(response); - const { riskScoreEntity } = request.body; - - try { - const securitySolution = await context.securitySolution; - - const spaceId = securitySolution?.getSpaceId(); - - const { client } = (await context.core).elasticsearch; - const esClient = client.asCurrentUser; - const restartPivotTransformResult = await restartTransform( - esClient, - getRiskScorePivotTransformId(riskScoreEntity, spaceId), - logger - ); - - const restartLatestTransformResult = await restartTransform( - esClient, - getRiskScoreLatestTransformId(riskScoreEntity, spaceId), - logger - ); - - return response.ok({ - body: [restartPivotTransformResult, restartLatestTransformResult], - }); - } catch (err) { - const error = transformError(err); - return siemResponse.error({ - body: error.message, - statusCode: error.statusCode, - }); - } - } - ); -}; diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip b/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip new file mode 100644 index 0000000000000..779e8d257b7b0 Binary files /dev/null and b/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip differ diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts b/x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts index c8307b3dd3d74..b624336be51bf 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts @@ -6,12 +6,66 @@ */ import { createMockTelemetryReceiver } from './__mocks__'; -import { artifactService } from './artifact'; +import { Artifact } from './artifact'; +import axios from 'axios'; +import type { TelemetryConfiguration } from './types'; + +jest.mock('axios'); +const mockedAxios = axios as jest.Mocked<typeof axios>; describe('telemetry artifact test', () => { - test('diagnostics telemetry task should query and enqueue events', async () => { + test('start should retrieve cluster information', async () => { const mockTelemetryReceiver = createMockTelemetryReceiver(); - await artifactService.start(mockTelemetryReceiver); + const artifact = new Artifact(); + await artifact.start(mockTelemetryReceiver); expect(mockTelemetryReceiver.fetchClusterInfo).toHaveBeenCalled(); }); + + test('getArtifact should throw an error if manifest url is null', async () => { + const artifact = new Artifact(); + await expect(async () => artifact.getArtifact('test')).rejects.toThrow('No manifest url'); + }); + + test('getArtifact should throw an error if relative url is null', async () => { + const mockTelemetryReceiver = createMockTelemetryReceiver(); + const artifact = new Artifact(); + await artifact.start(mockTelemetryReceiver); + const axiosResponse = { + data: 'x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', + }; + mockedAxios.get.mockImplementationOnce(() => Promise.resolve(axiosResponse)); + await expect(async () => artifact.getArtifact('artifactThatDoesNotExist')).rejects.toThrow( + 'No artifact for name artifactThatDoesNotExist' + ); + }); + + test('getArtifact should return respective artifact', async () => { + const mockTelemetryReceiver = createMockTelemetryReceiver(); + const artifact = new Artifact(); + await artifact.start(mockTelemetryReceiver); + const axiosResponse = { + data: 'x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', + }; + mockedAxios.get + .mockImplementationOnce(() => Promise.resolve(axiosResponse)) + .mockImplementationOnce(() => + Promise.resolve({ + data: { + telemetry_max_buffer_size: 100, + max_security_list_telemetry_batch: 100, + max_endpoint_telemetry_batch: 300, + max_detection_rule_telemetry_batch: 1_000, + max_detection_alerts_batch: 50, + }, + }) + ); + const artifactObject: TelemetryConfiguration = (await artifact.getArtifact( + 'telemetry-buffer-and-batch-sizes-v1' + )) as unknown as TelemetryConfiguration; + expect(artifactObject.telemetry_max_buffer_size).toEqual(100); + expect(artifactObject.max_security_list_telemetry_batch).toEqual(100); + expect(artifactObject.max_endpoint_telemetry_batch).toEqual(300); + expect(artifactObject.max_detection_rule_telemetry_batch).toEqual(1_000); + expect(artifactObject.max_detection_alerts_batch).toEqual(50); + }); }); diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.ts b/x-pack/plugins/security_solution/server/lib/telemetry/artifact.ts index 07ec2b6f2e49a..f531db6a5d6d7 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/artifact.ts @@ -15,7 +15,7 @@ export interface IArtifact { getArtifact(name: string): Promise<unknown>; } -class Artifact implements IArtifact { +export class Artifact implements IArtifact { private manifestUrl?: string; private readonly CDN_URL = 'https://artifacts.security.elastic.co'; private readonly AXIOS_TIMEOUT_MS = 10_000; diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.ts b/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.ts index 7c64a29da8f11..38ee5f1324656 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.ts @@ -6,6 +6,9 @@ */ import type { AllowlistFields } from './types'; import type { TelemetryEvent } from '../types'; +import { endpointAllowlistFields } from './endpoint_alerts'; +import { exceptionListAllowlistFields } from './exception_lists'; +import { prebuiltRuleAllowlistFields } from './prebuilt_rules_alerts'; /** * Filters out Key/Values not required for downstream analysis @@ -38,6 +41,40 @@ export function copyAllowlistedFields( }, {}); } -export { endpointAllowlistFields } from './endpoint_alerts'; -export { exceptionListAllowlistFields } from './exception_lists'; -export { prebuiltRuleAllowlistFields } from './prebuilt_rules_alerts'; +export class FilterList { + private _endpointAlerts = endpointAllowlistFields; + private _exceptionLists = exceptionListAllowlistFields; + private _prebuiltRulesAlerts = prebuiltRuleAllowlistFields; + + public get endpointAlerts(): AllowlistFields { + return this._endpointAlerts; + } + + public set endpointAlerts(list: AllowlistFields) { + this._endpointAlerts = list; + } + + public get exceptionLists(): AllowlistFields { + return this._exceptionLists; + } + + public set exceptionLists(list: AllowlistFields) { + this._exceptionLists = list; + } + + public get prebuiltRulesAlerts(): AllowlistFields { + return this._prebuiltRulesAlerts; + } + + public set prebuiltRulesAlerts(list: AllowlistFields) { + this._prebuiltRulesAlerts = list; + } + + public resetAllToDefault() { + this._endpointAlerts = endpointAllowlistFields; + this._exceptionLists = exceptionListAllowlistFields; + this._prebuiltRulesAlerts = prebuiltRuleAllowlistFields; + } +} + +export const filterList = new FilterList(); diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/helpers.ts b/x-pack/plugins/security_solution/server/lib/telemetry/helpers.ts index 0fd7a0f6604c9..9b3a847b63e28 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/helpers.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/helpers.ts @@ -10,7 +10,7 @@ import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-t import type { PackagePolicy } from '@kbn/fleet-plugin/common/types/models/package_policy'; import { merge } from 'lodash'; import type { Logger } from '@kbn/core/server'; -import { copyAllowlistedFields, exceptionListAllowlistFields } from './filterlists'; +import { copyAllowlistedFields, filterList } from './filterlists'; import type { PolicyConfig, PolicyData } from '../../../common/endpoint/types'; import type { ExceptionListItem, @@ -191,7 +191,7 @@ export const templateExceptionList = ( // cast exception list type to a TelemetryEvent for allowlist filtering const filteredListItem = copyAllowlistedFields( - exceptionListAllowlistFields, + filterList.exceptionLists, item as unknown as TelemetryEvent ); diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts b/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts index 1ff8d31ecd7f7..848f66c3aaf0a 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts @@ -19,7 +19,7 @@ import type { TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; import type { ITelemetryReceiver } from './receiver'; -import { copyAllowlistedFields, endpointAllowlistFields } from './filterlists'; +import { copyAllowlistedFields, filterList } from './filterlists'; import { createTelemetryTaskConfigs } from './tasks'; import { createUsageCounterLabel, tlog } from './helpers'; import type { TelemetryEvent } from './types'; @@ -299,7 +299,7 @@ export class TelemetryEventsSender implements ITelemetryEventsSender { public processEvents(events: TelemetryEvent[]): TelemetryEvent[] { return events.map(function (obj: TelemetryEvent): TelemetryEvent { - return copyAllowlistedFields(endpointAllowlistFields, obj); + return copyAllowlistedFields(filterList.endpointAlerts, obj); }); } diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts index d266d2f1c7699..27dd32f5d48f1 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts @@ -18,7 +18,7 @@ export function createTelemetryConfigurationTaskConfig() { return { type: 'security:telemetry-configuration', title: 'Security Solution Telemetry Configuration Task', - interval: '45m', + interval: '1h', timeout: '1m', version: '1.0.0', runTask: async ( diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/filterlists.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/filterlists.ts new file mode 100644 index 0000000000000..67a6c4d270b6f --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/filterlists.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 type { Logger } from '@kbn/core/server'; +import type { ITelemetryEventsSender } from '../sender'; +import type { TelemetryFilterListArtifact } from '../types'; +import type { ITelemetryReceiver } from '../receiver'; +import type { TaskExecutionPeriod } from '../task'; +import { artifactService } from '../artifact'; +import { filterList } from '../filterlists'; +import { tlog } from '../helpers'; + +export function createTelemetryFilterListArtifactTaskConfig() { + return { + type: 'security:telemetry-filterlist-artifact', + title: 'Security Solution Telemetry Filter List Artifact Task', + interval: '45m', + timeout: '1m', + version: '1.0.0', + runTask: async ( + taskId: string, + logger: Logger, + receiver: ITelemetryReceiver, + sender: ITelemetryEventsSender, + taskExecutionPeriod: TaskExecutionPeriod + ) => { + try { + const artifactName = 'telemetry-filterlists-v1'; + const artifact = (await artifactService.getArtifact( + artifactName + )) as unknown as TelemetryFilterListArtifact; + filterList.endpointAlerts = artifact.endpoint_alerts; + filterList.exceptionLists = artifact.exception_lists; + filterList.prebuiltRulesAlerts = artifact.prebuilt_rules_alerts; + return 0; + } catch (err) { + tlog(logger, `Failed to set telemetry filterlist artifact due to ${err.message}`); + filterList.resetAllToDefault(); + return 0; + } + }, + }; +} diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/index.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/index.ts index d56a4eb54be45..e25b3690ee88d 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/index.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/index.ts @@ -14,6 +14,7 @@ import { createTelemetryPrebuiltRuleAlertsTaskConfig } from './prebuilt_rule_ale import { createTelemetryTimelineTaskConfig } from './timelines'; import { createTelemetryConfigurationTaskConfig } from './configuration'; import { telemetryConfiguration } from '../configuration'; +import { createTelemetryFilterListArtifactTaskConfig } from './filterlists'; export function createTelemetryTaskConfigs(): SecurityTelemetryTaskConfig[] { return [ @@ -26,5 +27,6 @@ export function createTelemetryTaskConfigs(): SecurityTelemetryTaskConfig[] { createTelemetryPrebuiltRuleAlertsTaskConfig(telemetryConfiguration.max_detection_alerts_batch), createTelemetryTimelineTaskConfig(), createTelemetryConfigurationTaskConfig(), + createTelemetryFilterListArtifactTaskConfig(), ]; } diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts index 33d33924fcf36..68b5ca6b01ce9 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts @@ -12,7 +12,7 @@ import type { ESClusterInfo, ESLicense, TelemetryEvent } from '../types'; import type { TaskExecutionPeriod } from '../task'; import { TELEMETRY_CHANNEL_DETECTION_ALERTS, TASK_METRICS_CHANNEL } from '../constants'; import { batchTelemetryRecords, tlog, createTaskMetric } from '../helpers'; -import { copyAllowlistedFields, prebuiltRuleAllowlistFields } from '../filterlists'; +import { copyAllowlistedFields, filterList } from '../filterlists'; export function createTelemetryPrebuiltRuleAlertsTaskConfig(maxTelemetryBatch: number) { return { @@ -64,7 +64,7 @@ export function createTelemetryPrebuiltRuleAlertsTaskConfig(maxTelemetryBatch: n const processedAlerts = telemetryEvents.map( (event: TelemetryEvent): TelemetryEvent => - copyAllowlistedFields(prebuiltRuleAllowlistFields, event) + copyAllowlistedFields(filterList.prebuiltRulesAlerts, event) ); const enrichedAlerts = processedAlerts.map( diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/types.ts b/x-pack/plugins/security_solution/server/lib/telemetry/types.ts index 36462773b8e7d..51396684bf3b2 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/types.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/types.ts @@ -6,6 +6,7 @@ */ import type { AlertEvent, ResolverNode, SafeResolverEvent } from '../../../common/endpoint/types'; +import type { AllowlistFields } from './filterlists/types'; type BaseSearchTypes = string | number | boolean | object; export type SearchTypes = BaseSearchTypes | BaseSearchTypes[] | undefined; @@ -429,3 +430,9 @@ export interface TelemetryConfiguration { max_detection_rule_telemetry_batch: number; max_detection_alerts_batch: number; } + +export interface TelemetryFilterListArtifact { + endpoint_alerts: AllowlistFields; + exception_lists: AllowlistFields; + prebuilt_rules_alerts: AllowlistFields; +} diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/blocklist_validator.ts b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/blocklist_validator.ts index eaad3e6fb09f8..0a7c29bb67c2b 100644 --- a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/blocklist_validator.ts +++ b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/blocklist_validator.ts @@ -213,10 +213,18 @@ export class BlocklistValidator extends BaseValidator { return item.listId === ENDPOINT_BLOCKLISTS_LIST_ID; } + protected async validateHasWritePrivilege(): Promise<void> { + return super.validateHasPrivilege('canWriteBlocklist'); + } + + protected async validateHasReadPrivilege(): Promise<void> { + return super.validateHasPrivilege('canReadBlocklist'); + } + async validatePreCreateItem( item: CreateExceptionListItemOptions ): Promise<CreateExceptionListItemOptions> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasWritePrivilege(); item.entries = removeDuplicateEntryValues(item.entries as BlocklistConditionEntry[]); @@ -228,27 +236,27 @@ export class BlocklistValidator extends BaseValidator { } async validatePreDeleteItem(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasWritePrivilege(); } async validatePreGetOneItem(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreMultiListFind(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreExport(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreSingleListFind(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreGetListSummary(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreUpdateItem( @@ -257,7 +265,7 @@ export class BlocklistValidator extends BaseValidator { ): Promise<UpdateExceptionListItemOptions> { const updatedItem = _updatedItem as ExceptionItemLikeOptions; - await this.validateCanManageEndpointArtifacts(); + await this.validateHasWritePrivilege(); _updatedItem.entries = removeDuplicateEntryValues( _updatedItem.entries as BlocklistConditionEntry[] diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts index 7759caa20e1f9..d448ee0fb1f75 100644 --- a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts +++ b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts @@ -48,8 +48,16 @@ export class EventFilterValidator extends BaseValidator { return item.listId === ENDPOINT_EVENT_FILTERS_LIST_ID; } + protected async validateHasWritePrivilege(): Promise<void> { + return super.validateHasPrivilege('canWriteEventFilters'); + } + + protected async validateHasReadPrivilege(): Promise<void> { + return super.validateHasPrivilege('canReadEventFilters'); + } + async validatePreCreateItem(item: CreateExceptionListItemOptions) { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasWritePrivilege(); await this.validateEventFilterData(item); // user can always create a global entry so additional checks not needed @@ -67,7 +75,7 @@ export class EventFilterValidator extends BaseValidator { ): Promise<UpdateExceptionListItemOptions> { const updatedItem = _updatedItem as ExceptionItemLikeOptions; - await this.validateCanManageEndpointArtifacts(); + await this.validateHasWritePrivilege(); await this.validateEventFilterData(updatedItem); try { @@ -96,27 +104,27 @@ export class EventFilterValidator extends BaseValidator { } async validatePreGetOneItem(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreSummary(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreDeleteItem(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasWritePrivilege(); } async validatePreExport(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreSingleListFind(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreMultiListFind(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreImport(): Promise<void> { diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts index 39e86e7104fae..b20a6db4c046c 100644 --- a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts +++ b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts @@ -60,9 +60,18 @@ export class HostIsolationExceptionsValidator extends BaseValidator { return item.listId === ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID; } + protected async validateHasWritePrivilege(): Promise<void> { + return super.validateHasPrivilege('canWriteHostIsolationExceptions'); + } + + protected async validateHasReadPrivilege(): Promise<void> { + return super.validateHasPrivilege('canReadHostIsolationExceptions'); + } + async validatePreCreateItem( item: CreateExceptionListItemOptions ): Promise<CreateExceptionListItemOptions> { + await this.validateHasWritePrivilege(); await this.validateCanIsolateHosts(); await this.validateHostIsolationData(item); await this.validateByPolicyItem(item); @@ -75,6 +84,7 @@ export class HostIsolationExceptionsValidator extends BaseValidator { ): Promise<UpdateExceptionListItemOptions> { const updatedItem = _updatedItem as ExceptionItemLikeOptions; + await this.validateHasWritePrivilege(); await this.validateCanIsolateHosts(); await this.validateHostIsolationData(updatedItem); await this.validateByPolicyItem(updatedItem); @@ -83,27 +93,27 @@ export class HostIsolationExceptionsValidator extends BaseValidator { } async validatePreGetOneItem(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreSummary(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreDeleteItem(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasWritePrivilege(); } async validatePreExport(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreSingleListFind(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreMultiListFind(): Promise<void> { - await this.validateCanManageEndpointArtifacts(); + await this.validateHasReadPrivilege(); } async validatePreImport(): Promise<void> { diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/trusted_app_validator.ts b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/trusted_app_validator.ts index 86b11249af9bd..38dd3442f3b4f 100644 --- a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/trusted_app_validator.ts +++ b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/trusted_app_validator.ts @@ -207,7 +207,7 @@ export class TrustedAppValidator extends BaseValidator { } async validatePreExport(): Promise<void> { - await this.validateHasWritePrivilege(); + await this.validateHasReadPrivilege(); } async validatePreSingleListFind(): Promise<void> { diff --git a/x-pack/plugins/security_solution/server/plugin.ts b/x-pack/plugins/security_solution/server/plugin.ts index df584c8d64e96..dd4993807f7c3 100644 --- a/x-pack/plugins/security_solution/server/plugin.ts +++ b/x-pack/plugins/security_solution/server/plugin.ts @@ -343,7 +343,8 @@ export class Plugin implements ISecuritySolutionPlugin { const securitySolutionSearchStrategy = securitySolutionSearchStrategyProvider( depsStart.data, endpointContext, - depsStart.spaces?.spacesService?.getSpaceId + depsStart.spaces?.spacesService?.getSpaceId, + ruleDataClient ); plugins.data.search.registerSearchStrategy( diff --git a/x-pack/plugins/security_solution/server/request_context_factory.ts b/x-pack/plugins/security_solution/server/request_context_factory.ts index ecf56a988636d..5eab776e217fe 100644 --- a/x-pack/plugins/security_solution/server/request_context_factory.ts +++ b/x-pack/plugins/security_solution/server/request_context_factory.ts @@ -106,14 +106,14 @@ export class RequestContextFactory implements IRequestContextFactory { if (!startPlugins.fleet) { endpointAuthz = getEndpointAuthzInitialState(); } else { - const isEndpointRbacEnabled = - endpointAppContextService.experimentalFeatures.endpointRbacEnabled; + const { endpointRbacEnabled, endpointRbacV1Enabled } = + endpointAppContextService.experimentalFeatures; const userRoles = security?.authc.getCurrentUser(request)?.roles ?? []; endpointAuthz = calculateEndpointAuthz( licenseService, fleetAuthz, userRoles, - isEndpointRbacEnabled, + endpointRbacEnabled || endpointRbacV1Enabled, endpointPermissions ); } diff --git a/x-pack/plugins/security_solution/server/routes/index.ts b/x-pack/plugins/security_solution/server/routes/index.ts index df67c6ddce423..001bdfb59ead5 100644 --- a/x-pack/plugins/security_solution/server/routes/index.ts +++ b/x-pack/plugins/security_solution/server/routes/index.ts @@ -70,7 +70,6 @@ import { getRiskScoreIndexStatusRoute, installRiskScoresRoute, readPrebuiltDevToolContentRoute, - restartTransformRoute, } from '../lib/risk_score/routes'; export const initRoutes = ( @@ -161,7 +160,6 @@ export const initRoutes = ( deletePrebuiltSavedObjectsRoute(router, security); getRiskScoreIndexStatusRoute(router); installRiskScoresRoute(router, logger, security); - restartTransformRoute(router, logger); const { previewTelemetryUrlEnabled } = config.experimentalFeatures; if (previewTelemetryUrlEnabled) { // telemetry preview endpoint for e2e integration tests only at the moment. diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.test.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.test.ts index 4208ea44937bc..7abc747eb0c82 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.test.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.test.ts @@ -8,6 +8,7 @@ import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; import type { HostsRequestOptions } from '../../../../../../common/search_strategy/security_solution'; +import { RiskScoreEntity } from '../../../../../../common/search_strategy/security_solution'; import * as buildQuery from './query.all_hosts.dsl'; import * as buildRiskQuery from '../../risk_score/all/query.risk_score.dsl'; import { allHosts } from '.'; @@ -128,6 +129,7 @@ describe('allHosts search strategy', () => { expect(buildHostsRiskQuery).toHaveBeenCalledWith({ defaultIndex: ['ml_host_risk_score_latest_test-space'], filterQuery: { terms: { 'host.name': [hostName] } }, + riskScoreEntity: RiskScoreEntity.host, }); }); diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts index fb4a4aa27353b..86a3cfae8b4f3 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts @@ -19,7 +19,11 @@ import type { } from '../../../../../../common/search_strategy/security_solution/hosts'; import type { HostRiskScore } from '../../../../../../common/search_strategy'; -import { getHostRiskIndex, buildHostNamesFilter } from '../../../../../../common/search_strategy'; +import { + RiskScoreEntity, + getHostRiskIndex, + buildHostNamesFilter, +} from '../../../../../../common/search_strategy'; import { inspectStringifyObject } from '../../../../../utils/build_query'; import type { SecuritySolutionFactory } from '../../types'; @@ -116,6 +120,7 @@ async function getHostRiskData( buildRiskScoreQuery({ defaultIndex: [getHostRiskIndex(spaceId)], filterQuery: buildHostNamesFilter(hostNames), + riskScoreEntity: RiskScoreEntity.host, }) ); return hostRiskResponse; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts index df1ddf9a8d9ab..eba0c0917564d 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts @@ -206,6 +206,7 @@ export const getHostEndpoint = async ( sensorVersion: endpointData.metadata.agent.version, elasticAgentStatus: endpointData.host_status, isolation: endpointData.metadata.Endpoint.state?.isolation ?? false, + fleetAgentId: endpointData.metadata.elastic.agent.id, pendingActions, }; } catch (err) { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/__mocks__/index.ts index e45c68999acf7..5f0b69ba6dc87 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/__mocks__/index.ts @@ -2121,7 +2121,7 @@ export const formattedPreviewStrategyResponse = { aggs: { preview: { date_histogram: { - field: 'signal.original_time', + field: '@timestamp', fixed_interval: '2700000ms', min_doc_count: 0, extended_bounds: { min: 1599574984482, max: 1599661384482 }, @@ -2157,7 +2157,7 @@ export const formattedPreviewStrategyResponse = { }, { range: { - 'signal.original_time': { + '@timestamp': { gte: '2020-09-08T14:23:04.482Z', lte: '2020-09-09T14:23:04.482Z', format: 'strict_date_optional_time', diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/preview/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/preview/__mocks__/index.ts index 12d46c4be2282..95f5bccb18303 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/preview/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/preview/__mocks__/index.ts @@ -33,7 +33,7 @@ export const expectedDsl = { aggs: { preview: { date_histogram: { - field: 'signal.original_time', + field: '@timestamp', fixed_interval: '2700000ms', min_doc_count: 0, extended_bounds: { min: 1599574984482, max: 1599661384482 }, @@ -69,7 +69,7 @@ export const expectedDsl = { }, { range: { - 'signal.original_time': { + '@timestamp': { gte: '2020-09-08T14:23:04.482Z', lte: '2020-09-09T14:23:04.482Z', format: 'strict_date_optional_time', diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/preview/query.preview_histogram.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/preview/query.preview_histogram.dsl.ts index 1703b6839ba70..2854ee25f9c43 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/preview/query.preview_histogram.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/preview/query.preview_histogram.dsl.ts @@ -7,6 +7,7 @@ import moment from 'moment'; +import { TIMESTAMP } from '@kbn/rule-data-utils'; import { createQueryFilterClauses, calculateTimeSeriesInterval, @@ -23,7 +24,7 @@ export const buildPreviewHistogramQuery = ({ ...createQueryFilterClauses(filterQuery), { range: { - 'signal.original_time': { + [TIMESTAMP]: { gte: from, lte: to, format: 'strict_date_optional_time', @@ -34,7 +35,7 @@ export const buildPreviewHistogramQuery = ({ const getHistogramAggregation = () => { const interval = calculateTimeSeriesInterval(from, to); - const histogramTimestampField = 'signal.original_time'; + const histogramTimestampField = TIMESTAMP; const dateHistogram = { date_histogram: { field: histogramTimestampField, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts new file mode 100644 index 0000000000000..b114b283d624a --- /dev/null +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts @@ -0,0 +1,170 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; +import type { KibanaRequest } from '@kbn/core-http-server'; +import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import { riskScore } from '.'; +import type { IEsSearchResponse } from '@kbn/data-plugin/public'; +import { allowedExperimentalValues } from '../../../../../../common/experimental_features'; +import type { + HostRiskScore, + RiskScoreRequestOptions, +} from '../../../../../../common/search_strategy'; +import { RiskScoreEntity, RiskSeverity } from '../../../../../../common/search_strategy'; +import type { EndpointAppContextService } from '../../../../../endpoint/endpoint_app_context_services'; +import type { EndpointAppContext } from '../../../../../endpoint/types'; +import * as buildQuery from './query.risk_score.dsl'; +import { get } from 'lodash/fp'; +import { ruleRegistryMocks } from '@kbn/rule-registry-plugin/server/mocks'; +import type { IRuleDataClient } from '@kbn/rule-registry-plugin/server'; + +export const mockSearchStrategyResponse: IEsSearchResponse<HostRiskScore> = { + rawResponse: { + took: 1, + timed_out: false, + _shards: { + total: 2, + successful: 2, + skipped: 1, + failed: 0, + }, + hits: { + max_score: null, + hits: [ + { + _id: '4', + _index: 'index', + _source: { + '@timestamp': '1234567899', + host: { + name: 'testUsername', + risk: { + rule_risks: [], + calculated_level: RiskSeverity.high, + calculated_score_norm: 75, + multipliers: [], + }, + }, + }, + }, + ], + }, + }, + isPartial: false, + isRunning: false, + total: 2, + loaded: 2, +}; + +const searchMock = jest.fn(); + +const mockDeps = { + esClient: {} as IScopedClusterClient, + ruleDataClient: { + ...(ruleRegistryMocks.createRuleDataClient('.alerts-security.alerts') as IRuleDataClient), + getReader: jest.fn((_options?: { namespace?: string }) => ({ + search: searchMock, + getDynamicIndexPattern: jest.fn(), + })), + }, + savedObjectsClient: {} as SavedObjectsClientContract, + endpointContext: { + logFactory: { + get: jest.fn().mockReturnValue({ + warn: jest.fn(), + }), + }, + config: jest.fn().mockResolvedValue({}), + experimentalFeatures: { + ...allowedExperimentalValues, + }, + service: {} as EndpointAppContextService, + } as EndpointAppContext, + request: {} as KibanaRequest, +}; + +export const mockOptions: RiskScoreRequestOptions = { + defaultIndex: ['logs-*'], + riskScoreEntity: RiskScoreEntity.host, + includeAlertsCount: true, +}; + +describe('buildRiskScoreQuery search strategy', () => { + const buildKpiRiskScoreQuery = jest.spyOn(buildQuery, 'buildRiskScoreQuery'); + + describe('buildDsl', () => { + test('should build dsl query', () => { + riskScore.buildDsl(mockOptions); + expect(buildKpiRiskScoreQuery).toHaveBeenCalledWith(mockOptions); + }); + }); + + test('should not enhance data when includeAlertsCount is false', async () => { + const result = await riskScore.parse( + { ...mockOptions, includeAlertsCount: false }, + mockSearchStrategyResponse, + mockDeps + ); + + expect(get('data[0].alertsCount', result)).toBeUndefined(); + }); + + test('should enhance data with alerts count', async () => { + const alertsCunt = 9999; + searchMock.mockReturnValue({ + aggregations: { + alertsByEntity: { + buckets: [ + { + key: 'testUsername', + doc_count: alertsCunt, + oldestAlertTimestamp: { + value_as_string: '12345566', + }, + }, + ], + }, + }, + }); + + const result = await riskScore.parse(mockOptions, mockSearchStrategyResponse, mockDeps); + + expect(get('data[0].alertsCount', result)).toBe(alertsCunt); + }); + + test('should enhance data with alerts oldest timestamp', async () => { + const oldestAlertTimestamp = 'oldestTimestamp_test'; + searchMock.mockReturnValue({ + aggregations: { + oldestAlertTimestamp: { + value_as_string: oldestAlertTimestamp, + }, + }, + }); + + searchMock.mockReturnValue({ + aggregations: { + alertsByEntity: { + buckets: [ + { + key: 'testUsername', + doc_count: 1, + oldestAlertTimestamp: { + value_as_string: oldestAlertTimestamp, + }, + }, + ], + }, + }, + }); + + const result = await riskScore.parse(mockOptions, mockSearchStrategyResponse, mockDeps); + + expect(get('data[0].oldestAlertTimestamp', result)).toBe(oldestAlertTimestamp); + }); +}); diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts index 0d2c01b735a5f..96bcb5c426d1a 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts @@ -5,12 +5,20 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse, SearchRequest } from '@kbn/data-plugin/common'; +import { get, getOr } from 'lodash/fp'; + +import type { IRuleDataClient } from '@kbn/rule-registry-plugin/server'; +import type { AggregationsMinAggregate } from '@elastic/elasticsearch/lib/api/types'; import type { SecuritySolutionFactory } from '../../types'; import type { RiskScoreRequestOptions, RiskQueries, + BucketItem, + HostRiskScore, + UserRiskScore, } from '../../../../../../common/search_strategy'; +import { RiskScoreEntity } from '../../../../../../common/search_strategy'; import { inspectStringifyObject } from '../../../../../utils/build_query'; import { buildRiskScoreQuery } from './query.risk_score.dsl'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; @@ -26,7 +34,14 @@ export const riskScore: SecuritySolutionFactory< return buildRiskScoreQuery(options); }, - parse: async (options: RiskScoreRequestOptions, response: IEsSearchResponse) => { + parse: async ( + options: RiskScoreRequestOptions, + response: IEsSearchResponse, + deps?: { + spaceId?: string; + ruleDataClient?: IRuleDataClient | null; + } + ) => { const inspect = { dsl: [inspectStringifyObject(buildRiskScoreQuery(options))], }; @@ -34,11 +49,78 @@ export const riskScore: SecuritySolutionFactory< const totalCount = getTotalCount(response.rawResponse.hits.total); const hits = response?.rawResponse?.hits?.hits; const data = hits?.map((hit) => hit._source) ?? []; + const nameField = options.riskScoreEntity === RiskScoreEntity.host ? 'host.name' : 'user.name'; + const names = data.map((risk) => get(nameField, risk) ?? ''); + + const enhancedData = + deps && options.includeAlertsCount + ? await enhanceData(data, names, nameField, deps.ruleDataClient, deps.spaceId) + : data; + return { ...response, inspect, totalCount, - data, + data: enhancedData, }; }, }; + +export type EnhancedDataBucket = { + oldestAlertTimestamp: AggregationsMinAggregate; +} & BucketItem; + +async function enhanceData( + data: Array<HostRiskScore | UserRiskScore>, + names: string[], + nameField: string, + ruleDataClient?: IRuleDataClient | null, + spaceId?: string +): Promise<Array<HostRiskScore | UserRiskScore>> { + const ruleDataReader = ruleDataClient?.getReader({ namespace: spaceId }); + const query = getAlertsQueryForEntity(names, nameField); + const response = await ruleDataReader?.search(query); + const buckets: EnhancedDataBucket[] = getOr([], 'aggregations.alertsByEntity.buckets', response); + + const enhancedAlertsDataByEntityName: Record< + string, + { count: number; oldestAlertTimestamp: string } + > = buckets.reduce( + (acc, { key, doc_count: count, oldestAlertTimestamp }) => ({ + ...acc, + [key]: { count, oldestAlertTimestamp: oldestAlertTimestamp.value_as_string }, + }), + {} + ); + + return data.map((risk) => ({ + ...risk, + alertsCount: enhancedAlertsDataByEntityName[get(nameField, risk)]?.count ?? 0, + oldestAlertTimestamp: + enhancedAlertsDataByEntityName[get(nameField, risk)]?.oldestAlertTimestamp ?? 0, + })); +} + +const getAlertsQueryForEntity = (names: string[], nameField: string): SearchRequest => ({ + size: 0, + query: { + bool: { + filter: [ + { term: { 'kibana.alert.workflow_status': 'open' } }, + { terms: { [nameField]: names } }, + ], + }, + }, + aggs: { + alertsByEntity: { + terms: { + field: nameField, + }, + aggs: { + oldestAlertTimestamp: { + min: { field: '@timestamp' }, + }, + }, + }, + }, +}); diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts index 51529bc21d801..f222e2130ee26 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts @@ -11,6 +11,7 @@ import type { SavedObjectsClientContract, } from '@kbn/core/server'; import type { IEsSearchResponse, ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { IRuleDataClient } from '@kbn/rule-registry-plugin/server'; import type { FactoryQueryTypes, StrategyRequestType, @@ -29,6 +30,7 @@ export interface SecuritySolutionFactory<T extends FactoryQueryTypes> { endpointContext: EndpointAppContext; request: KibanaRequest; spaceId?: string; + ruleDataClient?: IRuleDataClient | null; } ) => Promise<StrategyResponseType<T>>; } diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.test.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.test.ts index 1f17bbfc870fc..18bc75edb5304 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.test.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.test.ts @@ -14,6 +14,7 @@ import type { UsersRequestOptions } from '../../../../../../common/search_strate import * as buildRiskQuery from '../../risk_score/all/query.risk_score.dsl'; import { get } from 'lodash/fp'; +import { RiskScoreEntity } from '../../../../../../common/search_strategy'; class IndexNotFoundException extends Error { meta: { body: { error: { type: string } } }; @@ -115,6 +116,7 @@ describe('allHosts search strategy', () => { expect(buildHostsRiskQuery).toHaveBeenCalledWith({ defaultIndex: ['ml_user_risk_score_latest_test-space'], filterQuery: { terms: { 'user.name': userName } }, + riskScoreEntity: RiskScoreEntity.user, }); }); diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts index d5c13e0d2b52e..c936ad85f79e0 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts @@ -23,7 +23,11 @@ import type { import type { AllUsersAggEsItem } from '../../../../../../common/search_strategy/security_solution/users/common'; import { buildRiskScoreQuery } from '../../risk_score/all/query.risk_score.dsl'; import type { RiskSeverity, UserRiskScore } from '../../../../../../common/search_strategy'; -import { buildUserNamesFilter, getUserRiskIndex } from '../../../../../../common/search_strategy'; +import { + RiskScoreEntity, + buildUserNamesFilter, + getUserRiskIndex, +} from '../../../../../../common/search_strategy'; export const allUsers: SecuritySolutionFactory<UsersQueries.users> = { buildDsl: (options: UsersRequestOptions) => { @@ -123,6 +127,7 @@ async function getUserRiskData( buildRiskScoreQuery({ defaultIndex: [getUserRiskIndex(spaceId)], filterQuery: buildUserNamesFilter(userNames), + riskScoreEntity: RiskScoreEntity.user, }) ); return userRiskResponse; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/index.ts index faee7d6b6d8f3..1acb6687b8ace 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/index.ts @@ -10,6 +10,7 @@ import type { ISearchStrategy, PluginStart } from '@kbn/data-plugin/server'; import { shimHitsTotal } from '@kbn/data-plugin/server'; import { ENHANCED_ES_SEARCH_STRATEGY } from '@kbn/data-plugin/common'; import type { KibanaRequest } from '@kbn/core/server'; +import type { IRuleDataClient } from '@kbn/rule-registry-plugin/server'; import type { FactoryQueryTypes, StrategyResponseType, @@ -33,7 +34,8 @@ function assertValidRequestType<T extends FactoryQueryTypes>( export const securitySolutionSearchStrategyProvider = <T extends FactoryQueryTypes>( data: PluginStart, endpointContext: EndpointAppContext, - getSpaceId?: (request: KibanaRequest) => string + getSpaceId?: (request: KibanaRequest) => string, + ruleDataClient?: IRuleDataClient | null ): ISearchStrategy<StrategyRequestType<T>, StrategyResponseType<T>> => { const es = data.search.getSearchStrategy(ENHANCED_ES_SEARCH_STRATEGY); @@ -60,6 +62,7 @@ export const securitySolutionSearchStrategyProvider = <T extends FactoryQueryTyp endpointContext, request: deps.request, spaceId: getSpaceId && getSpaceId(deps.request), + ruleDataClient, }) ) ); diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index f69973fdac74f..65e831a8bfc1e 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -16,10 +15,12 @@ "public/**/*.json", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/setup_node_env/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, + { "path": "../../../src/plugins/files/tsconfig.json"}, { "path": "../../../src/plugins/home/tsconfig.json" }, { "path": "../../../src/plugins/inspector/tsconfig.json" }, { "path": "../../../src/plugins/ui_actions/tsconfig.json" }, @@ -47,7 +48,6 @@ { "path": "../security/tsconfig.json" }, { "path": "../spaces/tsconfig.json" }, { "path": "../threat_intelligence/tsconfig.json" }, - { "path": "../timelines/tsconfig.json" }, - { "path": "../files/tsconfig.json"} + { "path": "../timelines/tsconfig.json" } ] } diff --git a/x-pack/plugins/session_view/common/constants.ts b/x-pack/plugins/session_view/common/constants.ts index e7efb0b1f11f6..9938076a6c9e1 100644 --- a/x-pack/plugins/session_view/common/constants.ts +++ b/x-pack/plugins/session_view/common/constants.ts @@ -5,6 +5,8 @@ * 2.0. */ +export const SESSION_VIEW_APP_ID = 'sessionView'; + // routes export const PROCESS_EVENTS_ROUTE = '/internal/session_view/process_events'; export const ALERTS_ROUTE = '/internal/session_view/alerts'; @@ -12,6 +14,9 @@ export const ALERT_STATUS_ROUTE = '/internal/session_view/alert_status'; export const IO_EVENTS_ROUTE = '/internal/session_view/io_events'; export const GET_TOTAL_IO_BYTES_ROUTE = '/internal/session_view/get_total_io_bytes'; +export const SECURITY_APP_ID = 'security'; +export const POLICIES_PAGE_PATH = '/administration/policy'; + // index patterns export const PROCESS_EVENTS_INDEX = '*:logs-endpoint.events.process*,logs-endpoint.events.process*'; // match on both cross cluster and local indices export const PREVIEW_ALERTS_INDEX = '.preview.alerts-security.alerts-default'; diff --git a/x-pack/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts b/x-pack/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts index 23cf1ede0d9a3..c8be02c00bbed 100644 --- a/x-pack/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts +++ b/x-pack/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts @@ -282,6 +282,7 @@ export const sessionViewIOEventsMock: ProcessEventResults = { total_bytes_captured: 1024, total_bytes_skipped: 0, bytes_skipped: [], + max_bytes_per_process_exceeded: true, text: '\u001b[38;5;130m 84 \n 85 \u001b[mif [[ $KILL_IMMEDIATELY == 1 ]]; then\n\u001b[38;5;130m 86 \u001b[m echo "WARNING: Not waiting for connections to close gracefully"\n\u001b[38;5;130m 87 \u001b[m echo "Press any key to continue... wsrep_reject_queries will be set to \'ALL_KILL\'"\n\u001b[38;5;130m 88 \u001b[m read a\n\u001b[38;5;130m 89 \u001b[m mysql -h127.0.0.1 -P3306 -uroot -e "set global wsrep_reject_queries=\'ALL_KILL\'"\n\u001b[38;5;130m 90 \u001b[melse\n\u001b[38;5;130m 91 \u001b[m # Stop accepting queries in mariadb, do not kill opened connections\n\u001b[38;5;130m 92 \u001b[m mysql -h127.0.0.1 -P3306 -uroot -e "set global wsrep_reject_queries=\'ALL\'"\n\u001b[38;5;130m 93 \u001b[mfi\n\u001b[38;5;130m 94 \n 95 \u001b[mexit_code=$?\n\u001b[38;5;130m 96 \u001b[mif [[ $exit_code != 0 ]]; then\n\u001b[38;5;130m 97 \u001b[m >&2 echo "Failed to set the reject of queries on Mysql node, exiting."\n\u001b[38;5;130m 98 \u001b[m exit $exit_code\n\u001b[38;5;130m 99 \u001b[melse\n\u001b[38;5;130m 100 \u001b[m echo "Successfully stopped accepting queries."\n\u001b[38;5;130m 101 \u001b[m if [[ $KILL_IMMEDIATELY == 1 ]]; then\n\u001b[38;5;130m 102 \u001b[m\u001b[8Cexit\n\u001b[38;5;130m 103 \u001b[m fi\n\u001b[38;5;130m 104 \u001b[mfi\n\u001b[38;5;130m 105 \n 106 \u001b[mif [[ $GRACE_PERIOD == -1 ]]; then\n\u001b[38;5;130m 107 \u001b[m set_number_grace_seconds\n\u001b[38;5;130m 108 \u001b[mfi\n\u001b[38;5;130m 109 \n 110 \u001b[mwait_for_connections\n\u001b[38;5;130m 111 \u001b[mif [[ $DB_CONNECTIONS_NUMBER != 0 ]]; then\n\u001b[38;5;130m 112 \u001b[m get_number_db_connections\n\u001b[38;5;130m 113 \u001b[m >&2 echo "ERROR: There are still $DB_CONNECTIONS_NUMBER opened DB connections."\n\u001b[38;5;130m 114 \u001b[m exit 3\n\u001b[38;5;130m 115 \u001b[mfi\b\b\u001b[?25h\u001b[?25l\nType :qa! and press <Enter> to abandon all changes and exit Vim\u0007\u001b[58;9H\u001b[?25h\u0007\u001b[?25l\u001b[59;1H\u001b[K\u001b[59;1H:\u001b[?2004h\u001b[?25hqa!\r\u001b[?25l\u001b[?2004l\u001b[59;1H\u001b[K\u001b[59;1H\u001b[?2004l\u001b[?1l\u001b>\u001b[?25h\u001b[?1049l\u001b[23;0;0t,\u001bkroot@staging-host:~\u001b\\\n', }, tty: { diff --git a/x-pack/plugins/session_view/common/types/process_tree/index.ts b/x-pack/plugins/session_view/common/types/process_tree/index.ts index 68f8924abd702..b228502f61a54 100644 --- a/x-pack/plugins/session_view/common/types/process_tree/index.ts +++ b/x-pack/plugins/session_view/common/types/process_tree/index.ts @@ -72,6 +72,7 @@ export interface IOLine { export interface ProcessStartMarker { event: ProcessEvent; line: number; + maxBytesExceeded?: boolean; } export interface IOFields { diff --git a/x-pack/plugins/session_view/public/components/session_view/index.tsx b/x-pack/plugins/session_view/public/components/session_view/index.tsx index 32cc5dffdea5d..18296992de65f 100644 --- a/x-pack/plugins/session_view/public/components/session_view/index.tsx +++ b/x-pack/plugins/session_view/public/components/session_view/index.tsx @@ -53,6 +53,7 @@ export const SessionView = ({ jumpToCursor, investigatedAlertId, loadAlertDetails, + canAccessEndpointManagement, }: SessionViewDeps) => { // don't engage jumpTo if jumping to session leader. if (jumpToEntityId === sessionEntityId) { @@ -422,6 +423,7 @@ export const SessionView = ({ isFullscreen={isFullScreen} onJumpToEvent={onJumpToEvent} autoSeekToEntityId={currentJumpToOutputEntityId} + canAccessEndpointManagement={canAccessEndpointManagement} /> </div> ); diff --git a/x-pack/plugins/session_view/public/components/tty_player/ansi_helpers.ts b/x-pack/plugins/session_view/public/components/tty_player/ansi_helpers.ts new file mode 100644 index 0000000000000..e5ad54f7e5269 --- /dev/null +++ b/x-pack/plugins/session_view/public/components/tty_player/ansi_helpers.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 { Teletype } from '../../../common/types/process_tree'; +import { + PROCESS_DATA_LIMIT_EXCEEDED_START, + PROCESS_DATA_LIMIT_EXCEEDED_END, + VIEW_POLICIES, +} from './translations'; + +export const renderTruncatedMsg = (tty?: Teletype, policiesUrl?: string, processName?: string) => { + if (tty?.columns) { + const lineBreak = '-'.repeat(tty.columns); + const message = ` ⚠ ${PROCESS_DATA_LIMIT_EXCEEDED_START} \x1b[1m${processName}.\x1b[22m ${PROCESS_DATA_LIMIT_EXCEEDED_END}`; + const link = policiesUrl + ? `\x1b[${Math.min( + message.length + 2, + tty.columns - VIEW_POLICIES.length - 4 + )}G\x1b[1m\x1b]8;;${policiesUrl}\x1b\\[ ${VIEW_POLICIES} ]\x1b]8;;\x1b\\\x1b[22m` + : ''; + + return `\n\x1b[33m${lineBreak}\n${message}${link}\n${lineBreak}\x1b[0m\n\n`; + } +}; diff --git a/x-pack/plugins/session_view/public/components/tty_player/hooks.test.tsx b/x-pack/plugins/session_view/public/components/tty_player/hooks.test.tsx index 9f7201492520c..b40605ad2cdba 100644 --- a/x-pack/plugins/session_view/public/components/tty_player/hooks.test.tsx +++ b/x-pack/plugins/session_view/public/components/tty_player/hooks.test.tsx @@ -30,7 +30,7 @@ describe('TTYPlayer/hooks', () => { })), }); - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); describe('useIOLines', () => { diff --git a/x-pack/plugins/session_view/public/components/tty_player/hooks.ts b/x-pack/plugins/session_view/public/components/tty_player/hooks.ts index b6891f1dd1d49..30b40beaa094f 100644 --- a/x-pack/plugins/session_view/public/components/tty_player/hooks.ts +++ b/x-pack/plugins/session_view/public/components/tty_player/hooks.ts @@ -12,6 +12,7 @@ import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { SearchAddon } from './xterm_search'; import { useEuiTheme } from '../../hooks'; +import { renderTruncatedMsg } from './ansi_helpers'; import { IOLine, @@ -103,6 +104,15 @@ export const useIOLines = (pages: ProcessEventsPage[] | undefined) => { newMarkers.push(processLineInfo); } + if (process.io.max_bytes_per_process_exceeded) { + const marker = newMarkers.find( + (item) => item.event.process?.entity_id === process.entity_id + ); + if (marker) { + marker.maxBytesExceeded = true; + } + } + const splitLines = process.io.text.split(TTY_LINE_SPLITTER_REGEX); const combinedLines = [splitLines[0]]; @@ -158,6 +168,7 @@ export interface XtermPlayerDeps { hasNextPage?: boolean; fetchNextPage?: () => void; isFetching?: boolean; + policiesUrl?: string; } export const useXtermPlayer = ({ @@ -169,17 +180,20 @@ export const useXtermPlayer = ({ hasNextPage, fetchNextPage, isFetching, + policiesUrl, }: XtermPlayerDeps) => { const { euiTheme } = useEuiTheme(); const { font, colors } = euiTheme; const [currentLine, setCurrentLine] = useState(0); const [playSpeed] = useState(DEFAULT_TTY_PLAYSPEED_MS); // potentially configurable const tty = lines?.[currentLine]?.event.process?.tty; - + const processName = lines?.[currentLine]?.event.process?.name; const [terminal, searchAddon] = useMemo(() => { const term = new Terminal({ theme: { - selection: colors.warning, + selectionBackground: colors.warning, + selectionForeground: colors.ink, + yellow: colors.warning, }, fontFamily: font.familyCode, fontSize: DEFAULT_TTY_FONT_SIZE, @@ -187,6 +201,8 @@ export const useXtermPlayer = ({ convertEol: true, rows: DEFAULT_TTY_ROWS, cols: DEFAULT_TTY_COLS, + allowProposedApi: true, + allowTransparency: true, }); const searchInstance = new SearchAddon(); @@ -203,7 +219,7 @@ export const useXtermPlayer = ({ // even though we set scrollback: 0 above, xterm steals the wheel events and prevents the outer container from scrolling // this handler fixes that const onScroll = (event: WheelEvent) => { - if ((event?.target as HTMLDivElement)?.className === 'xterm-cursor-layer') { + if ((event?.target as HTMLDivElement)?.offsetParent?.classList.contains('xterm-screen')) { event.stopImmediatePropagation(); } }; @@ -212,6 +228,7 @@ export const useXtermPlayer = ({ return () => { window.removeEventListener('wheel', onScroll, true); + terminal.dispose(); }; }, [terminal, ref]); @@ -241,17 +258,30 @@ export const useXtermPlayer = ({ if (line?.value !== undefined) { terminal.write(line.value); } + + const nextLine = lines[lineNumber + index + 1]; + const maxBytesExceeded = line.event.process?.io?.max_bytes_per_process_exceeded; + + // if next line is start of next event + // and process has exceeded max bytes + // render msg + if (!clear && (!nextLine || nextLine.event !== line.event) && maxBytesExceeded) { + const msg = renderTruncatedMsg(tty, policiesUrl, processName); + if (msg) { + terminal.write(msg); + } + } }); }, - [lines, terminal] + [lines, policiesUrl, processName, terminal, tty] ); useEffect(() => { - const fontChanged = terminal.getOption('fontSize') !== fontSize; + const fontChanged = terminal.options.fontSize !== fontSize; const ttyChanged = tty && (terminal.rows !== tty?.rows || terminal.cols !== tty?.columns); if (fontChanged) { - terminal.setOption('fontSize', fontSize); + terminal.options.fontSize = fontSize; } if (tty?.rows && tty?.columns && ttyChanged) { diff --git a/x-pack/plugins/session_view/public/components/tty_player/index.test.tsx b/x-pack/plugins/session_view/public/components/tty_player/index.test.tsx index f3332ae5bb7f8..ba56931b4a99b 100644 --- a/x-pack/plugins/session_view/public/components/tty_player/index.test.tsx +++ b/x-pack/plugins/session_view/public/components/tty_player/index.test.tsx @@ -6,10 +6,11 @@ */ import React from 'react'; -import { waitFor } from '@testing-library/react'; +import { waitFor, act } from '@testing-library/react'; import { sessionViewIOEventsMock } from '../../../common/mocks/responses/session_view_io_events.mock'; import { AppContextTestRender, createAppRootMockRenderer } from '../../test'; import { TTYPlayerDeps, TTYPlayer } from '.'; +import userEvent from '@testing-library/user-event'; describe('TTYPlayer component', () => { beforeAll(() => { @@ -81,5 +82,38 @@ describe('TTYPlayer component', () => { await waitForApiCall(); }); + + it('renders a message warning when max_bytes exceeded', async () => { + renderResult = mockedContext.render(<TTYPlayer {...props} />); + + await waitForApiCall(); + await new Promise((r) => setTimeout(r, 10)); + + const seekToEndBtn = renderResult.getByTestId('sessionView:TTYPlayerControlsEnd'); + + act(() => { + userEvent.click(seekToEndBtn); + }); + + waitFor(() => expect(renderResult.queryAllByText('Data limit reached')).toHaveLength(1)); + expect(renderResult.queryByText('[ VIEW POLICIES ]')).toBeFalsy(); + }); + + it('renders a message warning when max_bytes exceeded with link to policies page', async () => { + renderResult = mockedContext.render( + <TTYPlayer {...props} canAccessEndpointManagement={true} /> + ); + + await waitForApiCall(); + await new Promise((r) => setTimeout(r, 10)); + + const seekToEndBtn = renderResult.getByTestId('sessionView:TTYPlayerControlsEnd'); + + act(() => { + userEvent.click(seekToEndBtn); + }); + + waitFor(() => expect(renderResult.queryAllByText('[ VIEW POLICIES ]')).toHaveLength(1)); + }); }); }); diff --git a/x-pack/plugins/session_view/public/components/tty_player/index.tsx b/x-pack/plugins/session_view/public/components/tty_player/index.tsx index c77efc9d8c152..434805ac689db 100644 --- a/x-pack/plugins/session_view/public/components/tty_player/index.tsx +++ b/x-pack/plugins/session_view/public/components/tty_player/index.tsx @@ -13,6 +13,8 @@ import { EuiButton, EuiBetaBadge, } from '@elastic/eui'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { CoreStart } from '@kbn/core/public'; import useResizeObserver from 'use-resize-observer'; import { throttle } from 'lodash'; import { ProcessEvent } from '../../../common/types/process_tree'; @@ -23,6 +25,8 @@ import { DEFAULT_TTY_ROWS, DEFAULT_TTY_COLS, DEFAULT_TTY_FONT_SIZE, + POLICIES_PAGE_PATH, + SECURITY_APP_ID, } from '../../../common/constants'; import { useFetchIOEvents, useIOLines, useXtermPlayer } from './hooks'; import { TTYPlayerControls } from '../tty_player_controls'; @@ -35,6 +39,7 @@ export interface TTYPlayerDeps { isFullscreen: boolean; onJumpToEvent(event: ProcessEvent): void; autoSeekToEntityId?: string; + canAccessEndpointManagement?: boolean; } export const TTYPlayer = ({ @@ -44,6 +49,7 @@ export const TTYPlayer = ({ isFullscreen, onJumpToEvent, autoSeekToEntityId, + canAccessEndpointManagement, }: TTYPlayerDeps) => { const ref = useRef<HTMLDivElement>(null); const { ref: scrollRef, height: containerHeight = 1 } = useResizeObserver<HTMLDivElement>({}); @@ -53,7 +59,16 @@ export const TTYPlayer = ({ const { lines, processStartMarkers } = useIOLines(data?.pages); const [fontSize, setFontSize] = useState(DEFAULT_TTY_FONT_SIZE); const [isPlaying, setIsPlaying] = useState(false); + const [searchQuery, setSearchQuery] = useState(''); const [currentAutoSeekEntityId, setCurrentAutoSeekEntityId] = useState(''); + const { getUrlForApp } = useKibana<CoreStart>().services.application; + const policiesUrl = useMemo( + () => + canAccessEndpointManagement + ? getUrlForApp(SECURITY_APP_ID, { path: POLICIES_PAGE_PATH }) + : '', + [canAccessEndpointManagement, getUrlForApp] + ); const { search, currentLine, seekToLine } = useXtermPlayer({ ref, @@ -64,6 +79,7 @@ export const TTYPlayer = ({ hasNextPage, fetchNextPage, isFetching, + policiesUrl, }); const currentProcessEvent = lines[Math.min(lines.length - 1, currentLine)]?.event; @@ -113,11 +129,18 @@ export const TTYPlayer = ({ const styles = useStyles(tty, show); + const clearSearch = useCallback(() => { + if (searchQuery) { + setSearchQuery(''); + } + }, [searchQuery]); + const onSeekLine = useMemo(() => { return throttle((line: number) => { + clearSearch(); seekToLine(line); }, 100); - }, [seekToLine]); + }, [clearSearch, seekToLine]); const onTogglePlayback = useCallback(() => { // if at the end, seek to beginning @@ -127,6 +150,12 @@ export const TTYPlayer = ({ setIsPlaying(!isPlaying); }, [currentLine, isPlaying, lines.length, seekToLine]); + useEffect(() => { + if (isPlaying) { + clearSearch(); + } + }, [clearSearch, isPlaying]); + return ( <div css={styles.container}> <EuiPanel hasShadow={false} borderRadius="none" hasBorder={false} css={styles.header}> @@ -140,6 +169,8 @@ export const TTYPlayer = ({ seekToLine={seekToLine} xTermSearchFn={search} setIsPlaying={setIsPlaying} + searchQuery={searchQuery} + setSearchQuery={setSearchQuery} /> </EuiFlexItem> @@ -157,11 +188,17 @@ export const TTYPlayer = ({ </EuiFlexItem> <EuiFlexItem grow={false}> - <EuiButtonIcon iconType="refresh" display="empty" size="m" disabled={true} /> + <EuiButtonIcon + iconType="refresh" + display="empty" + size="m" + disabled={true} + aria-label="disabled" + /> </EuiFlexItem> <EuiFlexItem grow={false}> - <EuiButtonIcon iconType="eye" disabled={true} size="m" /> + <EuiButtonIcon iconType="eye" disabled={true} size="m" aria-label="disabled" /> </EuiFlexItem> <EuiFlexItem grow={false}> diff --git a/x-pack/plugins/session_view/public/components/tty_player/translations.ts b/x-pack/plugins/session_view/public/components/tty_player/translations.ts new file mode 100644 index 0000000000000..8d1dfd7497410 --- /dev/null +++ b/x-pack/plugins/session_view/public/components/tty_player/translations.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 { i18n } from '@kbn/i18n'; + +export const PROCESS_DATA_LIMIT_EXCEEDED_START = i18n.translate( + 'xpack.sessionView.processDataLimitExceededStart', + { + defaultMessage: 'Data limit reached for', + } +); + +export const PROCESS_DATA_LIMIT_EXCEEDED_END = i18n.translate( + 'xpack.sessionView.processDataLimitExceededEnd', + { + defaultMessage: 'See "max_kilobytes_per_process" in advanced policy configuration.', + } +); + +export const VIEW_POLICIES = i18n.translate('xpack.sessionView.viewPoliciesLink', { + defaultMessage: 'VIEW POLICIES', +}); diff --git a/x-pack/plugins/session_view/public/components/tty_player/xterm_search.ts b/x-pack/plugins/session_view/public/components/tty_player/xterm_search.ts index 3c430d691e3f7..fee2aff4b5458 100644 --- a/x-pack/plugins/session_view/public/components/tty_player/xterm_search.ts +++ b/x-pack/plugins/session_view/public/components/tty_player/xterm_search.ts @@ -9,7 +9,7 @@ * Copyright (c) 2017 The xterm.js authors. All rights reserved. * @license MIT */ -import { Terminal, IDisposable, ITerminalAddon, ISelectionPosition } from 'xterm'; +import { Terminal, IDisposable, ITerminalAddon, IBufferRange } from 'xterm'; export interface ISearchOptions { regex?: boolean; @@ -83,14 +83,14 @@ export class SearchAddon implements ITerminalAddon { let startCol = 0; let startRow = 0; - let currentSelection: ISelectionPosition | undefined; + let currentSelection: IBufferRange | undefined; if (this._terminal.hasSelection()) { const incremental = searchOptions ? searchOptions.incremental : false; // Start from the selection end if there is a selection // For incremental search, use existing row currentSelection = this._terminal.getSelectionPosition()!; - startRow = incremental ? currentSelection.startRow : currentSelection.endRow; - startCol = incremental ? currentSelection.startColumn : currentSelection.endColumn; + startRow = incremental ? currentSelection.start.y : currentSelection.end.y; + startCol = incremental ? currentSelection.start.x : currentSelection.end.x; } if (searchOptions?.lastLineOnly) { @@ -139,7 +139,7 @@ export class SearchAddon implements ITerminalAddon { // If there is only one result, wrap back and return selection if it exists. if (!result && currentSelection) { - searchPosition.startRow = currentSelection.startRow; + searchPosition.startRow = currentSelection.start.y; searchPosition.startCol = 0; result = this._findInLine(term, searchPosition, searchOptions); } @@ -170,12 +170,12 @@ export class SearchAddon implements ITerminalAddon { let startCol = this._terminal.cols; let result: ISearchResult | undefined; const incremental = searchOptions ? searchOptions.incremental : false; - let currentSelection: ISelectionPosition | undefined; + let currentSelection: IBufferRange | undefined; if (this._terminal.hasSelection()) { currentSelection = this._terminal.getSelectionPosition()!; // Start from selection start if there is a selection - startRow = currentSelection.startRow; - startCol = currentSelection.startColumn; + startRow = currentSelection.start.y; + startCol = currentSelection.start.x; } else if (searchOptions?.lastLineOnly) { startRow = this._terminal.buffer.active.cursorY - 1; startCol = this._terminal.cols; @@ -194,8 +194,8 @@ export class SearchAddon implements ITerminalAddon { if (!isOldResultHighlighted) { // If selection was not able to be expanded to the right, then try reverse search if (currentSelection) { - searchPosition.startRow = currentSelection.endRow; - searchPosition.startCol = currentSelection.endColumn; + searchPosition.startRow = currentSelection.end.y; + searchPosition.startCol = currentSelection.end.x; } result = this._findInLine(term, searchPosition, searchOptions, true); } diff --git a/x-pack/plugins/session_view/public/components/tty_player_controls/index.test.tsx b/x-pack/plugins/session_view/public/components/tty_player_controls/index.test.tsx index 8a536e1ae0228..61a3958c1b88d 100644 --- a/x-pack/plugins/session_view/public/components/tty_player_controls/index.test.tsx +++ b/x-pack/plugins/session_view/public/components/tty_player_controls/index.test.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { AppContextTestRender, createAppRootMockRenderer } from '../../test'; import { ProcessEvent } from '../../../common/types/process_tree'; import { TTYPlayerControls, TTYPlayerControlsDeps } from '.'; +import { TTYPlayerLineMarkerType } from './tty_player_controls_markers'; const MOCK_PROCESS_EVENT_START: ProcessEvent = { process: { @@ -100,11 +101,11 @@ describe('TTYPlayerControls component', () => { expect(props.onSeekLine).toHaveBeenCalledWith(9); }); - it('render output markers', async () => { + it('render process_changed markers', async () => { renderResult = mockedContext.render(<TTYPlayerControls {...props} />); expect( renderResult.queryAllByRole('button', { - name: 'output', + name: TTYPlayerLineMarkerType.ProcessChanged, }) ).toHaveLength(props.processStartMarkers.length); }); @@ -115,12 +116,10 @@ describe('TTYPlayerControls component', () => { event: { process: { ...MOCK_PROCESS_EVENT_MIDDLE, - io: { - max_bytes_per_process_exceeded: true, - }, }, }, line: 2, + maxBytesExceeded: true, }, { event: MOCK_PROCESS_EVENT_END, line: 4 }, ]; @@ -129,12 +128,12 @@ describe('TTYPlayerControls component', () => { ); expect( renderResult.queryAllByRole('button', { - name: 'output', + name: TTYPlayerLineMarkerType.ProcessChanged, }) ).toHaveLength(2); expect( renderResult.queryAllByRole('button', { - name: 'data_limited', + name: TTYPlayerLineMarkerType.ProcessDataLimitReached, }) ).toHaveLength(1); }); diff --git a/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/index.tsx b/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/index.tsx index b10ba00e1fc2a..e84ed7fcf34a9 100644 --- a/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/index.tsx +++ b/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/index.tsx @@ -19,9 +19,14 @@ type Props = { onSeekLine(line: number): void; }; +export enum TTYPlayerLineMarkerType { + ProcessChanged = 'process_changed', + ProcessDataLimitReached = 'data_limited', +} + type TTYPlayerLineMarker = { line: number; - type: 'output' | 'data_limited'; + type: TTYPlayerLineMarkerType; name: string; }; @@ -44,10 +49,11 @@ export const TTYPlayerControlsMarkers = ({ return []; } return processStartMarkers.map( - ({ event, line }) => + ({ event, line, maxBytesExceeded }) => ({ - type: - event.process?.io?.max_bytes_per_process_exceeded === true ? 'data_limited' : 'output', + type: maxBytesExceeded + ? TTYPlayerLineMarkerType.ProcessDataLimitReached + : TTYPlayerLineMarkerType.ProcessChanged, line, name: event.process?.name, } as TTYPlayerLineMarker) diff --git a/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/styles.ts b/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/styles.ts index f48cfd3795eb0..48c7c67128c64 100644 --- a/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/styles.ts +++ b/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/styles.ts @@ -9,7 +9,7 @@ import { useMemo } from 'react'; import { CSSObject } from '@emotion/react'; import { useEuiTheme } from '../../../hooks'; -type TTYPlayerLineMarkerType = 'output' | 'data_limited'; +import { TTYPlayerLineMarkerType } from '.'; export const useStyles = (progress: number) => { const { euiTheme, euiVars } = useEuiTheme(); @@ -30,7 +30,7 @@ export const useStyles = (progress: number) => { }; const getMarkerBackgroundColor = (type: TTYPlayerLineMarkerType, selected: boolean) => { - if (type === 'data_limited') { + if (type === TTYPlayerLineMarkerType.ProcessDataLimitReached) { return euiVars.terminalOutputMarkerWarning; } if (selected) { @@ -105,7 +105,7 @@ export const useStyles = (progress: number) => { left: progress + '%', top: 16, fill: - type === 'data_limited' + type === TTYPlayerLineMarkerType.ProcessDataLimitReached ? euiVars.terminalOutputMarkerWarning : euiVars.terminalOutputMarkerAccent, }); diff --git a/x-pack/plugins/session_view/public/components/tty_search_bar/index.test.tsx b/x-pack/plugins/session_view/public/components/tty_search_bar/index.test.tsx index 06fa17a6c151c..7b8adbc47d52d 100644 --- a/x-pack/plugins/session_view/public/components/tty_search_bar/index.test.tsx +++ b/x-pack/plugins/session_view/public/components/tty_search_bar/index.test.tsx @@ -7,7 +7,6 @@ import React from 'react'; import { renderHook } from '@testing-library/react-hooks'; import userEvent from '@testing-library/user-event'; -import { fireEvent } from '@testing-library/dom'; import { AppContextTestRender, createAppRootMockRenderer } from '../../test'; import { sessionViewIOEventsMock } from '../../../common/mocks/responses/session_view_io_events.mock'; import { useIOLines } from '../tty_player/hooks'; @@ -35,6 +34,8 @@ describe('TTYSearchBar component', () => { seekToLine: jest.fn(), xTermSearchFn: jest.fn(), setIsPlaying: jest.fn(), + searchQuery: '', + setSearchQuery: jest.fn(), }; }); @@ -44,33 +45,20 @@ describe('TTYSearchBar component', () => { }); it('does a search when a user enters text and hits enter', async () => { - renderResult = mockedContext.render(<TTYSearchBar {...props} />); - - const searchInput = renderResult.queryByTestId('sessionView:searchBar')?.querySelector('input'); - if (searchInput) { - userEvent.type(searchInput, '-h'); - fireEvent.keyUp(searchInput, { key: 'Enter', code: 'Enter' }); - } + renderResult = mockedContext.render(<TTYSearchBar {...props} searchQuery="-h" />); expect(props.seekToLine).toHaveBeenCalledTimes(1); // there is a slight delay in the seek in xtermjs, so we wait 100ms before trying to highlight a result. await new Promise((r) => setTimeout(r, 100)); - expect(props.xTermSearchFn).toHaveBeenCalledTimes(2); - expect(props.xTermSearchFn).toHaveBeenNthCalledWith(1, '', 0); - expect(props.xTermSearchFn).toHaveBeenNthCalledWith(2, '-h', 6); + expect(props.xTermSearchFn).toHaveBeenCalledTimes(1); + expect(props.xTermSearchFn).toHaveBeenNthCalledWith(1, '-h', 6); expect(props.setIsPlaying).toHaveBeenCalledWith(false); }); it('calls seekToline and xTermSearchFn when currentMatch changes', async () => { - renderResult = mockedContext.render(<TTYSearchBar {...props} />); - - const searchInput = renderResult.queryByTestId('sessionView:searchBar')?.querySelector('input'); - if (searchInput) { - userEvent.type(searchInput, '-h'); - fireEvent.keyUp(searchInput, { key: 'Enter', code: 'Enter' }); - } + renderResult = mockedContext.render(<TTYSearchBar {...props} searchQuery="-h" />); await new Promise((r) => setTimeout(r, 100)); @@ -83,27 +71,23 @@ describe('TTYSearchBar component', () => { expect(props.seekToLine).toHaveBeenNthCalledWith(1, 26); expect(props.seekToLine).toHaveBeenNthCalledWith(2, 100); - expect(props.xTermSearchFn).toHaveBeenCalledTimes(3); - expect(props.xTermSearchFn).toHaveBeenNthCalledWith(1, '', 0); - expect(props.xTermSearchFn).toHaveBeenNthCalledWith(2, '-h', 6); - expect(props.xTermSearchFn).toHaveBeenNthCalledWith(3, '-h', 13); - expect(props.setIsPlaying).toHaveBeenCalledTimes(3); + expect(props.xTermSearchFn).toHaveBeenCalledTimes(2); + expect(props.xTermSearchFn).toHaveBeenNthCalledWith(1, '-h', 6); + expect(props.xTermSearchFn).toHaveBeenNthCalledWith(2, '-h', 13); + expect(props.setIsPlaying).toHaveBeenCalledTimes(2); }); it('calls xTermSearchFn with empty query when search is cleared', async () => { - renderResult = mockedContext.render(<TTYSearchBar {...props} />); - - const searchInput = renderResult.queryByTestId('sessionView:searchBar')?.querySelector('input'); - if (searchInput) { - userEvent.type(searchInput, '-h'); - fireEvent.keyUp(searchInput, { key: 'Enter', code: 'Enter' }); - } + renderResult = mockedContext.render(<TTYSearchBar {...props} searchQuery="-h" />); await new Promise((r) => setTimeout(r, 100)); userEvent.click(renderResult.getByTestId('clearSearchButton')); await new Promise((r) => setTimeout(r, 100)); - expect(props.xTermSearchFn).toHaveBeenNthCalledWith(3, '', 0); + renderResult.rerender(<TTYSearchBar {...props} />); + + expect(props.setSearchQuery).toHaveBeenNthCalledWith(1, ''); + expect(props.xTermSearchFn).toHaveBeenNthCalledWith(2, '', 0); expect(props.setIsPlaying).toHaveBeenCalledWith(false); }); }); diff --git a/x-pack/plugins/session_view/public/components/tty_search_bar/index.tsx b/x-pack/plugins/session_view/public/components/tty_search_bar/index.tsx index 18b829127ab2d..47d166167bb2a 100644 --- a/x-pack/plugins/session_view/public/components/tty_search_bar/index.tsx +++ b/x-pack/plugins/session_view/public/components/tty_search_bar/index.tsx @@ -20,6 +20,8 @@ export interface TTYSearchBarDeps { seekToLine(index: number): void; xTermSearchFn(query: string, index: number): void; setIsPlaying(value: boolean): void; + searchQuery: string; + setSearchQuery(value: string): void; } const STRIP_NEWLINES_REGEX = /^(\r\n|\r|\n|\n\r)/; @@ -29,9 +31,10 @@ export const TTYSearchBar = ({ seekToLine, xTermSearchFn, setIsPlaying, + searchQuery, + setSearchQuery, }: TTYSearchBarDeps) => { const [currentMatch, setCurrentMatch] = useState<SearchResult | null>(null); - const [searchQuery, setSearchQuery] = useState(''); const jumpToMatch = useCallback( (match) => { @@ -105,7 +108,7 @@ export const TTYSearchBar = ({ setSearchQuery(query); setCurrentMatch(null); }, - [setIsPlaying] + [setIsPlaying, setSearchQuery] ); const onSetCurrentMatch = useCallback( diff --git a/x-pack/plugins/session_view/public/test/index.tsx b/x-pack/plugins/session_view/public/test/index.tsx index 244560d366ac4..6ccc8ca2b1991 100644 --- a/x-pack/plugins/session_view/public/test/index.tsx +++ b/x-pack/plugins/session_view/public/test/index.tsx @@ -17,6 +17,7 @@ import { CoreStart } from '@kbn/core/public'; import { coreMock } from '@kbn/core/public/mocks'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; +import { SECURITY_APP_ID, SESSION_VIEW_APP_ID } from '../../common/constants'; type UiRender = (ui: React.ReactElement, options?: RenderOptions) => RenderResult; @@ -46,8 +47,10 @@ const createCoreStartMock = ( // Mock the certain APP Ids returned by `application.getUrlForApp()` coreStart.application.getUrlForApp.mockImplementation((appId) => { switch (appId) { - case 'sessionView': + case SESSION_VIEW_APP_ID: return '/app/sessionView'; + case SECURITY_APP_ID: + return '/app/security'; default: return `${appId} not mocked!`; } diff --git a/x-pack/plugins/session_view/public/types.ts b/x-pack/plugins/session_view/public/types.ts index d276f0e9518a9..fa5f9d1ebb04d 100644 --- a/x-pack/plugins/session_view/public/types.ts +++ b/x-pack/plugins/session_view/public/types.ts @@ -27,6 +27,7 @@ export interface SessionViewDeps { // Callback used when alert flyout panel is closed handleOnAlertDetailsClosed: () => void ) => void; + canAccessEndpointManagement?: boolean; } export interface EuiTabProps { diff --git a/x-pack/plugins/session_view/tsconfig.json b/x-pack/plugins/session_view/tsconfig.json index 0a21d320dfb29..33de77da0c6c4 100644 --- a/x-pack/plugins/session_view/tsconfig.json +++ b/x-pack/plugins/session_view/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ // add all the folders containg files to be compiled @@ -17,7 +16,7 @@ "storybook/**/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, // add references to other TypeScript projects the plugin depends on diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/home.test.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/home.test.ts index 2b13553d4e604..ea71e64f2258a 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/home.test.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/home.test.ts @@ -58,7 +58,7 @@ describe('<SnapshotRestoreHome />', () => { /** * TODO: investigate why we need to skip this test. * My guess is a change in the useRequest() hook and maybe a setTimout() that hasn't been - * mocked with jest.useFakeTimers(); + * mocked with jest.useFakeTimers('legacy'); * I tested locally and the loading spinner is present in the UI so skipping this test for now. */ test.skip('should display a loading while fetching the repositories', () => { diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/repository_add.test.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/repository_add.test.ts index 3a34926272e07..c9da67b98d622 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/repository_add.test.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/repository_add.test.ts @@ -37,7 +37,7 @@ describe('<RepositoryAdd />', () => { /** * TODO: investigate why we need to skip this test. * My guess is a change in the useRequest() hook and maybe a setTimout() that hasn't been - * mocked with jest.useFakeTimers(); + * mocked with jest.useFakeTimers('legacy'); * I tested locally and the loading spinner is present in the UI so skipping this test for now. */ test.skip('should indicate that the repository types are loading', () => { diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/snapshot_list.test.tsx b/x-pack/plugins/snapshot_restore/__jest__/client_integration/snapshot_list.test.tsx index bc6eae3fcd573..a94d0fdcd371d 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/snapshot_list.test.tsx +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/snapshot_list.test.tsx @@ -55,7 +55,7 @@ describe('<SnapshotList />', () => { let getSearchErrorText: SnapshotListTestBed['actions']['getSearchErrorText']; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const snapshot = fixtures.getSnapshot({ repository: REPOSITORY_NAME, snapshot: getRandomString(), diff --git a/x-pack/plugins/snapshot_restore/tsconfig.json b/x-pack/plugins/snapshot_restore/tsconfig.json index 82f0e86df3683..79c5bd269fc5c 100644 --- a/x-pack/plugins/snapshot_restore/tsconfig.json +++ b/x-pack/plugins/snapshot_restore/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "__jest__/**/*", @@ -14,7 +13,7 @@ "test/**/*", "../../../typings/**/*", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../licensing/tsconfig.json" }, { "path": "../features/tsconfig.json" }, diff --git a/x-pack/plugins/spaces/server/default_space/default_space_service.test.ts b/x-pack/plugins/spaces/server/default_space/default_space_service.test.ts index 5aaeb97ae76c4..8250a993192bb 100644 --- a/x-pack/plugins/spaces/server/default_space/default_space_service.test.ts +++ b/x-pack/plugins/spaces/server/default_space/default_space_service.test.ts @@ -214,7 +214,7 @@ test('maintains unavailable status if default space cannot be created', async () }); test('retries operation', async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const { repository, serviceStatus$ } = setup({ elasticsearchStatus: ServiceStatusLevels.available, diff --git a/x-pack/plugins/spaces/tsconfig.json b/x-pack/plugins/spaces/tsconfig.json index bf2c6e7fc8694..a0dec9464b8f8 100644 --- a/x-pack/plugins/spaces/tsconfig.json +++ b/x-pack/plugins/spaces/tsconfig.json @@ -4,10 +4,9 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "references": [ + "kbn_references": [ { "path": "../features/tsconfig.json" }, { "path": "../licensing/tsconfig.json" }, { "path": "../../../src/plugins/es_ui_shared/tsconfig.json" }, diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/expression.test.tsx b/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/expression.test.tsx deleted file mode 100644 index 78660fc2547b3..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/expression.test.tsx +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { mountWithIntl } from '@kbn/test-jest-helpers'; -import 'brace'; -import React, { useState } from 'react'; -import { docLinksServiceMock } from '@kbn/core/public/mocks'; -import { httpServiceMock } from '@kbn/core/public/mocks'; -import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; -import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; -import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; -import { CommonAlertParams, EsQueryAlertParams, SearchType } from '../types'; -import { EsQueryAlertTypeExpression } from './expression'; -import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; -import { Subject } from 'rxjs'; -import { ISearchSource } from '@kbn/data-plugin/common'; -import { IUiSettingsClient } from '@kbn/core/public'; -import { findTestSubject } from '@elastic/eui/lib/test'; -import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { act } from 'react-dom/test-utils'; -import { ReactWrapper } from 'enzyme'; - -jest.mock('@kbn/kibana-react-plugin/public', () => { - const original = jest.requireActual('@kbn/kibana-react-plugin/public'); - return { - ...original, - // Mocking CodeEditor - // eslint-disable-next-line @typescript-eslint/no-explicit-any - CodeEditor: (props: any) => ( - <input - data-test-subj="mockCodeEditor" - // eslint-disable-next-line @typescript-eslint/no-explicit-any - onChange={(syntheticEvent: any) => { - props.onChange(syntheticEvent.jsonString); - }} - /> - ), - }; -}); - -const defaultEsQueryRuleParams: EsQueryAlertParams<SearchType.esQuery> = { - size: 100, - thresholdComparator: '>', - threshold: [0], - timeWindowSize: 15, - timeWindowUnit: 's', - index: ['test-index'], - timeField: '@timestamp', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - searchType: SearchType.esQuery, - excludeHitsFromPreviousRun: true, -}; -const defaultSearchSourceRuleParams: EsQueryAlertParams<SearchType.searchSource> = { - size: 100, - thresholdComparator: '>', - threshold: [0], - timeWindowSize: 15, - timeWindowUnit: 's', - index: ['test-index'], - timeField: '@timestamp', - searchType: SearchType.searchSource, - searchConfiguration: {}, - excludeHitsFromPreviousRun: true, -}; - -const dataViewPluginMock = dataViewPluginMocks.createStartContract(); -const chartsStartMock = chartPluginMock.createStartContract(); -const unifiedSearchMock = unifiedSearchPluginMock.createStartContract(); -const httpMock = httpServiceMock.createStartContract(); -const docLinksMock = docLinksServiceMock.createStartContract(); -export const uiSettingsMock = { - get: jest.fn(), -} as unknown as IUiSettingsClient; - -const mockSearchResult = new Subject(); -const searchSourceFieldsMock = { - query: { - query: '', - language: 'kuery', - }, - filter: [], - index: { - id: '90943e30-9a47-11e8-b64d-95841ca0b247', - title: 'kibana_sample_data_logs', - fields: [], - }, -}; - -const searchSourceMock = { - id: 'data_source6', - fields: searchSourceFieldsMock, - getField: (name: string) => { - return (searchSourceFieldsMock as Record<string, object>)[name] || ''; - }, - setField: jest.fn(), - createCopy: jest.fn(() => { - return searchSourceMock; - }), - setParent: jest.fn(() => { - return searchSourceMock; - }), - fetch$: jest.fn(() => { - return mockSearchResult; - }), -} as unknown as ISearchSource; - -const savedQueryMock = { - id: 'test-id', - attributes: { - title: 'test-filter-set', - description: '', - query: { - query: 'category.keyword : "Men\'s Shoes" ', - language: 'kuery', - }, - filters: [], - }, -}; - -const dataMock = dataPluginMock.createStartContract(); -(dataMock.search.searchSource.create as jest.Mock).mockImplementation(() => - Promise.resolve(searchSourceMock) -); -(dataMock.dataViews.getIdsWithTitle as jest.Mock).mockImplementation(() => Promise.resolve([])); -dataMock.dataViews.getDefaultDataView = jest.fn(() => Promise.resolve(null)); -(dataMock.query.savedQueries.getSavedQuery as jest.Mock).mockImplementation(() => - Promise.resolve(savedQueryMock) -); -dataMock.query.savedQueries.findSavedQueries = jest.fn(() => - Promise.resolve({ total: 0, queries: [] }) -); -(httpMock.post as jest.Mock).mockImplementation(() => Promise.resolve({ fields: [] })); - -const Wrapper: React.FC<{ - ruleParams: EsQueryAlertParams<SearchType.searchSource> | EsQueryAlertParams<SearchType.esQuery>; -}> = ({ ruleParams }) => { - const [currentRuleParams, setCurrentRuleParams] = useState<CommonAlertParams>(ruleParams); - const errors = { - index: [], - esQuery: [], - size: [], - timeField: [], - timeWindowSize: [], - searchConfiguration: [], - searchType: [], - }; - - return ( - <EsQueryAlertTypeExpression - ruleInterval="1m" - ruleThrottle="1m" - alertNotifyWhen="onThrottleInterval" - ruleParams={currentRuleParams} - setRuleParams={(name, value) => { - setCurrentRuleParams((params) => ({ ...params, [name]: value })); - }} - setRuleProperty={(name, params) => { - if (name === 'params') { - setCurrentRuleParams(params as CommonAlertParams); - } - }} - errors={errors} - unifiedSearch={unifiedSearchMock} - data={dataMock} - dataViews={dataViewPluginMock} - defaultActionGroupId="" - actionGroups={[]} - charts={chartsStartMock} - /> - ); -}; - -const setup = ( - ruleParams: EsQueryAlertParams<SearchType.searchSource> | EsQueryAlertParams<SearchType.esQuery> -) => { - return mountWithIntl( - <KibanaContextProvider - services={{ - data: dataMock, - uiSettings: uiSettingsMock, - docLinks: docLinksMock, - http: httpMock, - }} - > - <Wrapper ruleParams={ruleParams} /> - </KibanaContextProvider> - ); -}; - -describe('EsQueryAlertTypeExpression', () => { - test('should render options by default', async () => { - const wrapper = setup({} as EsQueryAlertParams<SearchType.esQuery>); - expect(findTestSubject(wrapper, 'queryFormTypeChooserTitle').exists()).toBeTruthy(); - expect(findTestSubject(wrapper, 'queryFormType_searchSource').exists()).toBeTruthy(); - expect(findTestSubject(wrapper, 'queryFormType_esQuery').exists()).toBeTruthy(); - expect(findTestSubject(wrapper, 'queryFormTypeChooserCancel').exists()).toBeFalsy(); - }); - - test('should switch to QueryDSL form type on selection and return back on cancel', async () => { - let wrapper = setup({} as EsQueryAlertParams<SearchType.esQuery>); - await act(async () => { - findTestSubject(wrapper, 'queryFormType_esQuery').simulate('click'); - }); - wrapper = await wrapper.update(); - - expect(findTestSubject(wrapper, 'queryFormTypeChooserTitle').exists()).toBeFalsy(); - expect(wrapper.exists('[data-test-subj="queryJsonEditor"]')).toBeTruthy(); - expect(findTestSubject(wrapper, 'selectIndexExpression').exists()).toBeTruthy(); - - await act(async () => { - findTestSubject(wrapper, 'queryFormTypeChooserCancel').simulate('click'); - }); - wrapper = await wrapper.update(); - expect(findTestSubject(wrapper, 'selectIndexExpression').exists()).toBeFalsy(); - expect(findTestSubject(wrapper, 'queryFormTypeChooserTitle').exists()).toBeTruthy(); - }); - - test('should switch to KQL or Lucene form type on selection and return back on cancel', async () => { - let wrapper = setup({} as EsQueryAlertParams<SearchType.searchSource>); - await act(async () => { - findTestSubject(wrapper, 'queryFormType_searchSource').simulate('click'); - }); - wrapper = await wrapper.update(); - expect(findTestSubject(wrapper, 'queryFormTypeChooserTitle').exists()).toBeFalsy(); - expect(findTestSubject(wrapper, 'selectDataViewExpression').exists()).toBeTruthy(); - - await act(async () => { - findTestSubject(wrapper, 'queryFormTypeChooserCancel').simulate('click'); - }); - wrapper = await wrapper.update(); - expect(findTestSubject(wrapper, 'selectDataViewExpression').exists()).toBeFalsy(); - expect(findTestSubject(wrapper, 'queryFormTypeChooserTitle').exists()).toBeTruthy(); - }); - - test('should render QueryDSL view without the form type chooser if some rule params were passed', async () => { - let wrapper: ReactWrapper; - await act(async () => { - wrapper = setup(defaultEsQueryRuleParams); - wrapper = await wrapper.update(); - }); - expect(findTestSubject(wrapper!, 'queryFormTypeChooserTitle').exists()).toBeFalsy(); - expect(findTestSubject(wrapper!, 'queryFormTypeChooserCancel').exists()).toBeFalsy(); - expect(findTestSubject(wrapper!, 'selectIndexExpression').exists()).toBeTruthy(); - }); - - test('should render KQL and Lucene view without the form type chooser if some rule params were passed', async () => { - let wrapper: ReactWrapper; - await act(async () => { - wrapper = setup(defaultSearchSourceRuleParams); - wrapper = await wrapper.update(); - }); - wrapper = await wrapper!.update(); - expect(findTestSubject(wrapper!, 'queryFormTypeChooserTitle').exists()).toBeFalsy(); - expect(findTestSubject(wrapper!, 'queryFormTypeChooserCancel').exists()).toBeFalsy(); - expect(findTestSubject(wrapper!, 'selectDataViewExpression').exists()).toBeTruthy(); - }); -}); diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/expression.tsx b/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/expression.tsx deleted file mode 100644 index 8a56fdc4f41e3..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/expression.tsx +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { memo, PropsWithChildren, useCallback, useRef } from 'react'; -import deepEqual from 'fast-deep-equal'; -import 'brace/theme/github'; -import { EuiCallOut, EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { RuleTypeParamsExpressionProps } from '@kbn/triggers-actions-ui-plugin/public'; -import { EsQueryAlertParams, SearchType } from '../types'; -import { SearchSourceExpression, SearchSourceExpressionProps } from './search_source_expression'; -import { EsQueryExpression } from './es_query_expression'; -import { QueryFormTypeChooser } from './query_form_type_chooser'; -import { isSearchSourceAlert } from '../util'; -import { EXPRESSION_ERROR_KEYS } from '../constants'; - -function areSearchSourceExpressionPropsEqual( - prevProps: Readonly<PropsWithChildren<SearchSourceExpressionProps>>, - nextProps: Readonly<PropsWithChildren<SearchSourceExpressionProps>> -) { - const areErrorsEqual = deepEqual(prevProps.errors, nextProps.errors); - const areRuleParamsEqual = deepEqual(prevProps.ruleParams, nextProps.ruleParams); - return areErrorsEqual && areRuleParamsEqual; -} - -const SearchSourceExpressionMemoized = memo<SearchSourceExpressionProps>( - SearchSourceExpression, - areSearchSourceExpressionPropsEqual -); - -export const EsQueryAlertTypeExpression: React.FunctionComponent< - RuleTypeParamsExpressionProps<EsQueryAlertParams> -> = (props) => { - const { ruleParams, errors, setRuleProperty, setRuleParams } = props; - const isSearchSource = isSearchSourceAlert(ruleParams); - const isManagementPage = useRef(!Object.keys(ruleParams).length).current; - - const formTypeSelected = useCallback( - (searchType: SearchType | null) => { - if (!searchType) { - // @ts-expect-error Reset rule params regardless of their type - setRuleProperty('params', {}); - return; - } - setRuleParams('searchType', searchType); - }, - [setRuleParams, setRuleProperty] - ); - - const expressionGenericErrorMessage = i18n.translate( - 'xpack.stackAlerts.esQuery.ui.alertParams.fixErrorInExpressionBelowValidationMessage', - { - defaultMessage: 'Expression contains errors.', - } - ); - - const errorParam = EXPRESSION_ERROR_KEYS.find((errorKey) => { - return errors[errorKey]?.length >= 1 && ruleParams[errorKey] !== undefined; - }); - - const expressionError = !!errorParam && ( - <> - <EuiCallOut - color="danger" - size="s" - title={ - ['index', 'searchType'].includes(errorParam) - ? errors[errorParam] - : expressionGenericErrorMessage - } - /> - <EuiSpacer /> - </> - ); - - return ( - <> - {expressionError} - - {/* Showing the selected type */} - {isManagementPage && ( - <QueryFormTypeChooser - searchType={ruleParams.searchType as SearchType} - onFormTypeSelect={formTypeSelected} - /> - )} - - {ruleParams.searchType && isSearchSource && ( - <SearchSourceExpressionMemoized {...props} ruleParams={ruleParams} /> - )} - - {ruleParams.searchType && !isSearchSource && ( - <EsQueryExpression {...props} ruleParams={ruleParams} /> - )} - - <EuiHorizontalRule /> - </> - ); -}; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/index.ts b/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/index.ts deleted file mode 100644 index ee3eb83299748..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/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. - */ - -import { EsQueryAlertTypeExpression } from './expression'; - -// eslint-disable-next-line import/no-default-export -export default EsQueryAlertTypeExpression; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/index.ts b/x-pack/plugins/stack_alerts/public/alert_types/es_query/index.ts deleted file mode 100644 index fe57801150526..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { lazy } from 'react'; -import { i18n } from '@kbn/i18n'; -import { RuleTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; -import { PluginSetupContract as AlertingSetup } from '@kbn/alerting-plugin/public'; -import { SanitizedRule } from '@kbn/alerting-plugin/common'; -import { EsQueryAlertParams, SearchType } from './types'; -import { validateExpression } from './validation'; - -const PLUGIN_ID = 'discover'; -const ES_QUERY_ALERT_TYPE = '.es-query'; - -export function getAlertType(alerting: AlertingSetup): RuleTypeModel<EsQueryAlertParams> { - registerNavigation(alerting); - - return { - id: ES_QUERY_ALERT_TYPE, - description: i18n.translate('xpack.stackAlerts.esQuery.ui.alertType.descriptionText', { - defaultMessage: 'Alert when matches are found during the latest query run.', - }), - iconClass: 'logoElastic', - documentationUrl: (docLinks) => docLinks.links.alerting.esQuery, - ruleParamsExpression: lazy(() => import('./expression')), - validate: validateExpression, - defaultActionMessage: i18n.translate( - 'xpack.stackAlerts.esQuery.ui.alertType.defaultActionMessage', - { - defaultMessage: `Elasticsearch query alert '\\{\\{alertName\\}\\}' is active: - -- Value: \\{\\{context.value\\}\\} -- Conditions Met: \\{\\{context.conditions\\}\\} over \\{\\{params.timeWindowSize\\}\\}\\{\\{params.timeWindowUnit\\}\\} -- Timestamp: \\{\\{context.date\\}\\} -- Link: \\{\\{context.link\\}\\}`, - } - ), - requiresAppContext: false, - }; -} - -function registerNavigation(alerting: AlertingSetup) { - alerting.registerNavigation( - PLUGIN_ID, - ES_QUERY_ALERT_TYPE, - (alert: SanitizedRule<EsQueryAlertParams<SearchType.searchSource>>) => { - return `#/viewAlert/${alert.id}`; - } - ); -} diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/types.ts b/x-pack/plugins/stack_alerts/public/alert_types/es_query/types.ts deleted file mode 100644 index 1430b8e3076ae..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/types.ts +++ /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 { RuleTypeParams } from '@kbn/alerting-plugin/common'; -import { SerializedSearchSourceFields } from '@kbn/data-plugin/common'; -import { EuiComboBoxOptionOption } from '@elastic/eui'; -import { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; -import { EXPRESSION_ERRORS } from './constants'; - -export interface Comparator { - text: string; - value: string; - requiredValues: number; -} - -export enum SearchType { - esQuery = 'esQuery', - searchSource = 'searchSource', -} - -export interface CommonAlertParams extends RuleTypeParams { - size: number; - thresholdComparator?: string; - threshold: number[]; - timeWindowSize: number; - timeWindowUnit: string; - excludeHitsFromPreviousRun: boolean; -} - -export type EsQueryAlertParams<T = SearchType> = T extends SearchType.searchSource - ? CommonAlertParams & OnlySearchSourceAlertParams - : CommonAlertParams & OnlyEsQueryAlertParams; - -export interface OnlyEsQueryAlertParams { - esQuery: string; - index: string[]; - timeField: string; -} - -export interface OnlySearchSourceAlertParams { - searchType?: 'searchSource'; - searchConfiguration?: SerializedSearchSourceFields; - savedQueryId?: string; -} - -export type DataViewOption = EuiComboBoxOptionOption<string>; - -export type ExpressionErrors = typeof EXPRESSION_ERRORS; - -export type ErrorKey = keyof ExpressionErrors & unknown; - -export interface TriggersAndActionsUiDeps { - data: DataPublicPluginStart; - dataViewEditor: DataViewEditorStart; -} diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/util.ts b/x-pack/plugins/stack_alerts/public/alert_types/es_query/util.ts deleted file mode 100644 index 1f57a133fa65a..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/util.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { EsQueryAlertParams, SearchType, TriggersAndActionsUiDeps } from './types'; - -export const isSearchSourceAlert = ( - ruleParams: EsQueryAlertParams -): ruleParams is EsQueryAlertParams<SearchType.searchSource> => { - return ruleParams.searchType === 'searchSource'; -}; - -export const useTriggersAndActionsUiDeps = () => useKibana<TriggersAndActionsUiDeps>().services; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/validation.test.ts b/x-pack/plugins/stack_alerts/public/alert_types/es_query/validation.test.ts deleted file mode 100644 index 4df44f445f1b3..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/validation.test.ts +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EsQueryAlertParams, SearchType } from './types'; -import { validateExpression, hasExpressionValidationErrors } from './validation'; - -describe('expression params validation', () => { - test('if params are not set should return a proper error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = - {} as EsQueryAlertParams<SearchType.esQuery>; - expect(validateExpression(initialParams).errors.searchType.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.searchType[0]).toBe('Query type is required.'); - }); - - test('if index property is invalid should return proper error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: [], - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 1, - timeWindowUnit: 's', - threshold: [0], - timeField: '', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.index.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.index[0]).toBe('Index is required.'); - }); - - test('if timeField property is not defined should return proper error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: ['test'], - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 1, - timeWindowUnit: 's', - threshold: [0], - timeField: '', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.timeField.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.timeField[0]).toBe('Time field is required.'); - }); - - test('if esQuery property is invalid JSON should return proper error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: ['test'], - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n`, - size: 100, - timeWindowSize: 1, - timeWindowUnit: 's', - threshold: [0], - timeField: '', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.esQuery.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.esQuery[0]).toBe('Query must be valid JSON.'); - }); - - test('if esQuery property is invalid should return proper error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: ['test'], - esQuery: `{\n \"aggs\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 1, - timeWindowUnit: 's', - threshold: [0], - timeField: '', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.esQuery.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.esQuery[0]).toBe(`Query field is required.`); - expect(hasExpressionValidationErrors(initialParams)).toBe(true); - }); - - test('if searchConfiguration property is not set should return proper error message', () => { - const initialParams = { - size: 100, - timeWindowSize: 1, - timeWindowUnit: 's', - threshold: [0], - searchType: SearchType.searchSource, - } as EsQueryAlertParams<SearchType.searchSource>; - expect(validateExpression(initialParams).errors.searchConfiguration.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.searchConfiguration[0]).toBe( - `Search source configuration is required.` - ); - }); - - test('if threshold0 property is not set should return proper error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: ['test'], - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - threshold: [], - timeWindowSize: 1, - timeWindowUnit: 's', - thresholdComparator: '<', - timeField: '', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.threshold0.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.threshold0[0]).toBe('Threshold 0 is required.'); - }); - - test('if threshold1 property is needed by thresholdComparator but not set should return proper error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: ['test'], - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - threshold: [1], - timeWindowSize: 1, - timeWindowUnit: 's', - thresholdComparator: 'between', - timeField: '', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.threshold1.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.threshold1[0]).toBe('Threshold 1 is required.'); - }); - - test('if threshold0 property greater than threshold1 property should return proper error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: ['test'], - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - threshold: [10, 1], - timeWindowSize: 1, - timeWindowUnit: 's', - thresholdComparator: 'between', - timeField: '', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.threshold1.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.threshold1[0]).toBe( - 'Threshold 1 must be > Threshold 0.' - ); - }); - - test('if size property is < 0 should return proper error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: ['test'], - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n`, - size: -1, - timeWindowSize: 1, - timeWindowUnit: 's', - threshold: [0], - timeField: '', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.size.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.size[0]).toBe( - 'Size must be between 0 and 10,000.' - ); - }); - - test('if size property is 0 should not return error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: ['test'], - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n`, - size: 0, - timeWindowSize: 1, - timeWindowUnit: 's', - threshold: [0], - timeField: '', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.size.length).toBe(0); - }); - - test('if size property is > 10000 should return proper error message', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: ['test'], - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n`, - size: 25000, - timeWindowSize: 1, - timeWindowUnit: 's', - threshold: [0], - timeField: '', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.size.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.size[0]).toBe( - 'Size must be between 0 and 10,000.' - ); - }); - - test('should not return error messages if all is correct', () => { - const initialParams: EsQueryAlertParams<SearchType.esQuery> = { - index: ['test'], - esQuery: '{"query":{"match_all":{}}}', - size: 250, - timeWindowSize: 100, - timeWindowUnit: 's', - threshold: [0], - timeField: '@timestamp', - excludeHitsFromPreviousRun: true, - }; - expect(validateExpression(initialParams).errors.size.length).toBe(0); - expect(hasExpressionValidationErrors(initialParams)).toBe(false); - }); -}); diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/validation.ts b/x-pack/plugins/stack_alerts/public/alert_types/es_query/validation.ts deleted file mode 100644 index 70466070b3515..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/validation.ts +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { defaultsDeep, isNil } from 'lodash'; -import { i18n } from '@kbn/i18n'; -import { ValidationResult, builtInComparators } from '@kbn/triggers-actions-ui-plugin/public'; -import { EsQueryAlertParams, ExpressionErrors } from './types'; -import { isSearchSourceAlert } from './util'; -import { EXPRESSION_ERRORS } from './constants'; - -export const validateExpression = (ruleParams: EsQueryAlertParams): ValidationResult => { - const { size, threshold, timeWindowSize, thresholdComparator } = ruleParams; - const validationResult = { errors: {} }; - const errors: ExpressionErrors = defaultsDeep({}, EXPRESSION_ERRORS); - validationResult.errors = errors; - - if (!('index' in ruleParams) && !ruleParams.searchType) { - errors.searchType.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredSearchType', { - defaultMessage: 'Query type is required.', - }) - ); - - return validationResult; - } - - if (!threshold || threshold.length === 0 || threshold[0] === undefined) { - errors.threshold0.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredThreshold0Text', { - defaultMessage: 'Threshold 0 is required.', - }) - ); - } - if ( - thresholdComparator && - builtInComparators[thresholdComparator].requiredValues > 1 && - (!threshold || - threshold[1] === undefined || - (threshold && threshold.length < builtInComparators[thresholdComparator!].requiredValues)) - ) { - errors.threshold1.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredThreshold1Text', { - defaultMessage: 'Threshold 1 is required.', - }) - ); - } - if (threshold && threshold.length === 2 && threshold[0] > threshold[1]) { - errors.threshold1.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.greaterThenThreshold0Text', { - defaultMessage: 'Threshold 1 must be > Threshold 0.', - }) - ); - } - if (!timeWindowSize) { - errors.timeWindowSize.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredTimeWindowSizeText', { - defaultMessage: 'Time window size is required.', - }) - ); - } - - if (isNil(size)) { - errors.size.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredSizeText', { - defaultMessage: 'Size is required.', - }) - ); - } - if ((size && size < 0) || size > 10000) { - errors.size.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.invalidSizeRangeText', { - defaultMessage: 'Size must be between 0 and {max, number}.', - values: { max: 10000 }, - }) - ); - } - - /** - * Skip esQuery and index params check if it is search source alert, - * since it should contain searchConfiguration instead of esQuery and index. - */ - const isSearchSource = isSearchSourceAlert(ruleParams); - if (isSearchSource) { - if (!ruleParams.searchConfiguration) { - errors.searchConfiguration.push( - i18n.translate( - 'xpack.stackAlerts.esQuery.ui.validation.error.requiredSearchConfiguration', - { - defaultMessage: 'Search source configuration is required.', - } - ) - ); - } else if (!ruleParams.searchConfiguration.index) { - errors.index.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredDataViewText', { - defaultMessage: 'Data view is required.', - }) - ); - } - return validationResult; - } - - if (!ruleParams.index || ruleParams.index.length === 0) { - errors.index.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredIndexText', { - defaultMessage: 'Index is required.', - }) - ); - } - - if (!ruleParams.timeField) { - errors.timeField.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredTimeFieldText', { - defaultMessage: 'Time field is required.', - }) - ); - } - - if (!ruleParams.esQuery) { - errors.esQuery.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredQueryText', { - defaultMessage: 'Elasticsearch query is required.', - }) - ); - } else { - try { - const parsedQuery = JSON.parse(ruleParams.esQuery); - if (!parsedQuery.query) { - errors.esQuery.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredEsQueryText', { - defaultMessage: `Query field is required.`, - }) - ); - } - } catch (err) { - errors.esQuery.push( - i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.jsonQueryText', { - defaultMessage: 'Query must be valid JSON.', - }) - ); - } - } - - return validationResult; -}; - -export const hasExpressionValidationErrors = (ruleParams: EsQueryAlertParams) => { - const { errors: validationErrors } = validateExpression(ruleParams); - return Object.keys(validationErrors).some( - (key) => validationErrors[key] && validationErrors[key].length - ); -}; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/index.ts b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/index.ts deleted file mode 100644 index fad11da20940a..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { lazy } from 'react'; -import { i18n } from '@kbn/i18n'; -import { RuleTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; -import { validateExpression } from './validation'; -import { GeoContainmentAlertParams } from './types'; - -export function getAlertType(): RuleTypeModel<GeoContainmentAlertParams> { - return { - id: '.geo-containment', - description: i18n.translate('xpack.stackAlerts.geoContainment.descriptionText', { - defaultMessage: 'Alert when an entity is contained within a geo boundary.', - }), - iconClass: 'globe', - documentationUrl: null, - ruleParamsExpression: lazy(() => import('./query_builder')), - validate: validateExpression, - requiresAppContext: false, - }; -} diff --git a/x-pack/plugins/stack_alerts/public/alert_types/index.ts b/x-pack/plugins/stack_alerts/public/alert_types/index.ts deleted file mode 100644 index ff474ff9c6562..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { TriggersAndActionsUIPublicPluginSetup } from '@kbn/triggers-actions-ui-plugin/public'; -import { PluginSetupContract as AlertingSetup } from '@kbn/alerting-plugin/public'; -import { getAlertType as getGeoContainmentAlertType } from './geo_containment'; -import { getAlertType as getThresholdAlertType } from './threshold'; -import { getAlertType as getEsQueryAlertType } from './es_query'; -import { Config } from '../../common'; - -export function registerAlertTypes({ - ruleTypeRegistry, - config, - alerting, -}: { - ruleTypeRegistry: TriggersAndActionsUIPublicPluginSetup['ruleTypeRegistry']; - config: Config; - alerting: AlertingSetup; -}) { - ruleTypeRegistry.register(getGeoContainmentAlertType()); - ruleTypeRegistry.register(getThresholdAlertType()); - ruleTypeRegistry.register(getEsQueryAlertType(alerting)); -} diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.test.tsx b/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.test.tsx deleted file mode 100644 index 4b79a68f2125c..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.test.tsx +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; -import { act } from 'react-dom/test-utils'; -import IndexThresholdAlertTypeExpression, { DEFAULT_VALUES } from './expression'; -import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; -import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; -import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; -import { IndexThresholdAlertParams } from './types'; -import { validateExpression } from './validation'; -import { - builtInAggregationTypes, - builtInComparators, - getTimeUnitLabel, - TIME_UNITS, -} from '@kbn/triggers-actions-ui-plugin/public'; - -jest.mock('@kbn/triggers-actions-ui-plugin/public', () => { - const original = jest.requireActual('@kbn/triggers-actions-ui-plugin/public'); - return { - ...original, - getIndexPatterns: () => { - return ['index1', 'index2']; - }, - getTimeFieldOptions: () => { - return [ - { - text: '@timestamp', - value: '@timestamp', - }, - ]; - }, - getFields: () => { - return Promise.resolve([ - { - name: '@timestamp', - type: 'date', - }, - { - name: 'field', - type: 'text', - }, - ]); - }, - getIndexOptions: () => { - return Promise.resolve([ - { - label: 'indexOption', - options: [ - { - label: 'index1', - value: 'index1', - }, - { - label: 'index2', - value: 'index2', - }, - ], - }, - ]); - }, - }; -}); - -const dataMock = dataPluginMock.createStartContract(); -const dataViewMock = dataViewPluginMocks.createStartContract(); -const chartsStartMock = chartPluginMock.createStartContract(); - -describe('IndexThresholdAlertTypeExpression', () => { - function getAlertParams(overrides = {}) { - return { - index: 'test-index', - aggType: 'count', - thresholdComparator: '>', - threshold: [0], - timeWindowSize: 15, - timeWindowUnit: 's', - ...overrides, - }; - } - async function setup(ruleParams: IndexThresholdAlertParams) { - const { errors } = validateExpression(ruleParams); - - const wrapper = mountWithIntl( - <IndexThresholdAlertTypeExpression - ruleInterval="1m" - ruleThrottle="1m" - alertNotifyWhen="onThrottleInterval" - ruleParams={ruleParams} - setRuleParams={() => {}} - setRuleProperty={() => {}} - errors={errors} - data={dataMock} - dataViews={dataViewMock} - defaultActionGroupId="" - actionGroups={[]} - charts={chartsStartMock} - /> - ); - - await act(async () => { - await nextTick(); - wrapper.update(); - }); - return wrapper; - } - - test(`should render IndexThresholdAlertTypeExpression with expected components when aggType doesn't require field`, async () => { - const wrapper = await setup(getAlertParams()); - expect(wrapper.find('[data-test-subj="indexSelectPopover"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="whenExpression"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="groupByExpression"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="aggTypeExpression"]').exists()).toBeFalsy(); - expect(wrapper.find('[data-test-subj="thresholdExpression"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="forLastExpression"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="visualizationPlaceholder"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="thresholdVisualization"]').exists()).toBeFalsy(); - expect(wrapper.find('[data-test-subj="filterKuery"]').exists()).toBeTruthy(); - }); - - test(`should render IndexThresholdAlertTypeExpression with expected components when aggType does require field`, async () => { - const wrapper = await setup(getAlertParams({ aggType: 'avg' })); - expect(wrapper.find('[data-test-subj="indexSelectPopover"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="whenExpression"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="groupByExpression"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="aggTypeExpression"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="thresholdExpression"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="forLastExpression"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="visualizationPlaceholder"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="thresholdVisualization"]').exists()).toBeFalsy(); - expect(wrapper.find('[data-test-subj="filterKuery"]').exists()).toBeTruthy(); - }); - - test(`should render IndexThresholdAlertTypeExpression with visualization when there are no expression errors`, async () => { - const wrapper = await setup(getAlertParams({ timeField: '@timestamp' })); - expect(wrapper.find('[data-test-subj="visualizationPlaceholder"]').exists()).toBeFalsy(); - expect(wrapper.find('[data-test-subj="thresholdVisualization"]').exists()).toBeTruthy(); - }); - - test(`should set default alert params when params are undefined`, async () => { - const wrapper = await setup( - getAlertParams({ - aggType: undefined, - thresholdComparator: undefined, - timeWindowSize: undefined, - timeWindowUnit: undefined, - groupBy: undefined, - threshold: undefined, - }) - ); - - expect(wrapper.find('button[data-test-subj="selectIndexExpression"]').text()).toEqual( - 'index test-index' - ); - expect(wrapper.find('button[data-test-subj="whenExpression"]').text()).toEqual( - `when ${builtInAggregationTypes[DEFAULT_VALUES.AGGREGATION_TYPE].text}` - ); - expect(wrapper.find('button[data-test-subj="groupByExpression"]').text()).toEqual( - `over ${DEFAULT_VALUES.GROUP_BY} documents ` - ); - expect(wrapper.find('[data-test-subj="aggTypeExpression"]').exists()).toBeFalsy(); - expect(wrapper.find('button[data-test-subj="thresholdPopover"]').text()).toEqual( - `${builtInComparators[DEFAULT_VALUES.THRESHOLD_COMPARATOR].text} ` - ); - expect(wrapper.find('button[data-test-subj="forLastExpression"]').text()).toEqual( - `for the last ${DEFAULT_VALUES.TIME_WINDOW_SIZE} ${getTimeUnitLabel( - DEFAULT_VALUES.TIME_WINDOW_UNIT as TIME_UNITS, - DEFAULT_VALUES.TIME_WINDOW_SIZE.toString() - )}` - ); - expect( - wrapper.find('EuiEmptyPrompt[data-test-subj="visualizationPlaceholder"]').text() - ).toEqual(`Complete the expression to generate a preview.`); - expect(wrapper.find('input[data-test-subj="filterKuery"]').text()).toEqual(''); - }); - - test(`should use alert params when params are defined`, async () => { - const aggType = 'avg'; - const thresholdComparator = 'between'; - const timeWindowSize = 987; - const timeWindowUnit = 's'; - const threshold = [3, 1003]; - const groupBy = 'top'; - const termSize = '27'; - const termField = 'host.name'; - - const wrapper = await setup( - getAlertParams({ - aggType, - thresholdComparator, - timeWindowSize, - timeWindowUnit, - termSize, - termField, - groupBy, - threshold, - }) - ); - - expect(wrapper.find('button[data-test-subj="whenExpression"]').text()).toEqual( - `when ${builtInAggregationTypes[aggType].text}` - ); - expect(wrapper.find('button[data-test-subj="groupByExpression"]').text()).toEqual( - `grouped over ${groupBy} ${termSize} '${termField}'` - ); - - expect(wrapper.find('button[data-test-subj="thresholdPopover"]').text()).toEqual( - `${builtInComparators[thresholdComparator].text} ${threshold[0]} AND ${threshold[1]}` - ); - expect(wrapper.find('button[data-test-subj="forLastExpression"]').text()).toEqual( - `for the last ${timeWindowSize} ${getTimeUnitLabel( - timeWindowUnit as TIME_UNITS, - timeWindowSize.toString() - )}` - ); - expect( - wrapper.find('EuiEmptyPrompt[data-test-subj="visualizationPlaceholder"]').text() - ).toEqual(`Complete the expression to generate a preview.`); - }); -}); diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx b/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx deleted file mode 100644 index 37ad715aae18b..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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, Fragment, useEffect, useCallback, ChangeEvent } from 'react'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiSpacer, - EuiCallOut, - EuiEmptyPrompt, - EuiText, - EuiTitle, - EuiFieldSearch, - EuiFormRow, -} from '@elastic/eui'; -import { HttpSetup } from '@kbn/core/public'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { - getFields, - COMPARATORS, - builtInComparators, - OfExpression, - ThresholdExpression, - ForLastExpression, - GroupByExpression, - WhenExpression, - builtInAggregationTypes, - RuleTypeParamsExpressionProps, -} from '@kbn/triggers-actions-ui-plugin/public'; -import { ThresholdVisualization } from './visualization'; -import { IndexThresholdAlertParams } from './types'; -import './expression.scss'; -import { IndexSelectPopover } from '../components/index_select_popover'; - -export const DEFAULT_VALUES = { - AGGREGATION_TYPE: 'count', - TERM_SIZE: 5, - THRESHOLD_COMPARATOR: COMPARATORS.GREATER_THAN, - TIME_WINDOW_SIZE: 5, - TIME_WINDOW_UNIT: 'm', - THRESHOLD: [1000], - GROUP_BY: 'all', -}; - -const expressionFieldsWithValidation = [ - 'index', - 'timeField', - 'aggField', - 'termSize', - 'termField', - 'threshold0', - 'threshold1', - 'timeWindowSize', -]; - -interface KibanaDeps { - http: HttpSetup; -} - -function isString(value: unknown): value is string { - return typeof value === 'string'; -} - -// normalize the `index` parameter to be a string array -function indexParamToArray(index: string | string[]): string[] { - if (!index) return []; - return isString(index) ? [index] : index; -} - -export const IndexThresholdAlertTypeExpression: React.FunctionComponent< - Omit<RuleTypeParamsExpressionProps<IndexThresholdAlertParams>, 'unifiedSearch'> -> = ({ ruleParams, ruleInterval, setRuleParams, setRuleProperty, errors, charts, data }) => { - const { - index, - timeField, - aggType, - aggField, - groupBy, - termSize, - termField, - thresholdComparator, - threshold, - timeWindowSize, - timeWindowUnit, - filterKuery, - } = ruleParams; - - const indexArray = indexParamToArray(index); - const { http } = useKibana<KibanaDeps>().services; - - const [esFields, setEsFields] = useState< - Array<{ - name: string; - type: string; - normalizedType: string; - searchable: boolean; - aggregatable: boolean; - }> - >([]); - - const hasExpressionErrors = !!Object.keys(errors).find( - (errorKey) => - expressionFieldsWithValidation.includes(errorKey) && - errors[errorKey].length >= 1 && - ruleParams[errorKey as keyof IndexThresholdAlertParams] !== undefined - ); - - const cannotShowVisualization = !!Object.keys(errors).find( - (errorKey) => expressionFieldsWithValidation.includes(errorKey) && errors[errorKey].length >= 1 - ); - - const expressionErrorMessage = i18n.translate( - 'xpack.stackAlerts.threshold.ui.alertParams.fixErrorInExpressionBelowValidationMessage', - { - defaultMessage: 'Expression contains errors.', - } - ); - - const setDefaultExpressionValues = async () => { - setRuleProperty('params', { - ...ruleParams, - aggType: aggType ?? DEFAULT_VALUES.AGGREGATION_TYPE, - termSize: termSize ?? DEFAULT_VALUES.TERM_SIZE, - thresholdComparator: thresholdComparator ?? DEFAULT_VALUES.THRESHOLD_COMPARATOR, - timeWindowSize: timeWindowSize ?? DEFAULT_VALUES.TIME_WINDOW_SIZE, - timeWindowUnit: timeWindowUnit ?? DEFAULT_VALUES.TIME_WINDOW_UNIT, - groupBy: groupBy ?? DEFAULT_VALUES.GROUP_BY, - threshold: threshold ?? DEFAULT_VALUES.THRESHOLD, - }); - - if (indexArray.length > 0) { - await refreshEsFields(indexArray); - } - }; - - const refreshEsFields = async (indices: string[]) => { - const currentEsFields = await getFields(http, indices); - setEsFields(currentEsFields); - }; - - const handleFilterChange = useCallback( - (e: ChangeEvent<HTMLInputElement>) => { - setRuleParams('filterKuery', e.target.value || undefined); - }, - [setRuleParams] - ); - - useEffect(() => { - setDefaultExpressionValues(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - return ( - <Fragment> - {hasExpressionErrors ? ( - <Fragment> - <EuiSpacer /> - <EuiCallOut color="danger" size="s" title={expressionErrorMessage} /> - <EuiSpacer /> - </Fragment> - ) : null} - <EuiTitle size="xs"> - <h5> - <FormattedMessage - id="xpack.stackAlerts.threshold.ui.selectIndex" - defaultMessage="Select an index" - /> - </h5> - </EuiTitle> - <EuiSpacer size="s" /> - <IndexSelectPopover - index={indexArray} - data-test-subj="indexSelectPopover" - esFields={esFields} - timeField={timeField} - errors={errors} - onIndexChange={async (indices: string[]) => { - setRuleParams('index', indices); - - // reset expression fields if indices are deleted - if (indices.length === 0) { - setRuleProperty('params', { - ...ruleParams, - index: indices, - aggType: DEFAULT_VALUES.AGGREGATION_TYPE, - termSize: DEFAULT_VALUES.TERM_SIZE, - thresholdComparator: DEFAULT_VALUES.THRESHOLD_COMPARATOR, - timeWindowSize: DEFAULT_VALUES.TIME_WINDOW_SIZE, - timeWindowUnit: DEFAULT_VALUES.TIME_WINDOW_UNIT, - groupBy: DEFAULT_VALUES.GROUP_BY, - threshold: DEFAULT_VALUES.THRESHOLD, - timeField: '', - }); - } else { - await refreshEsFields(indices); - } - }} - onTimeFieldChange={(updatedTimeField: string) => - setRuleParams('timeField', updatedTimeField) - } - /> - <WhenExpression - display="fullWidth" - data-test-subj="whenExpression" - aggType={aggType ?? DEFAULT_VALUES.AGGREGATION_TYPE} - onChangeSelectedAggType={(selectedAggType: string) => - setRuleParams('aggType', selectedAggType) - } - /> - {aggType && builtInAggregationTypes[aggType].fieldRequired ? ( - <OfExpression - aggField={aggField} - data-test-subj="aggTypeExpression" - fields={esFields} - aggType={aggType} - errors={errors} - display="fullWidth" - onChangeSelectedAggField={(selectedAggField?: string) => - setRuleParams('aggField', selectedAggField) - } - /> - ) : null} - <GroupByExpression - groupBy={groupBy || DEFAULT_VALUES.GROUP_BY} - data-test-subj="groupByExpression" - termField={termField} - termSize={termSize} - errors={errors} - fields={esFields} - display="fullWidth" - onChangeSelectedGroupBy={(selectedGroupBy) => setRuleParams('groupBy', selectedGroupBy)} - onChangeSelectedTermField={(selectedTermField) => - setRuleParams('termField', selectedTermField) - } - onChangeSelectedTermSize={(selectedTermSize) => setRuleParams('termSize', selectedTermSize)} - /> - <EuiSpacer /> - <EuiTitle size="xs"> - <h5> - <FormattedMessage - id="xpack.stackAlerts.threshold.ui.conditionPrompt" - defaultMessage="Define the condition" - /> - </h5> - </EuiTitle> - <EuiSpacer size="s" /> - <ThresholdExpression - thresholdComparator={thresholdComparator ?? DEFAULT_VALUES.THRESHOLD_COMPARATOR} - threshold={threshold} - data-test-subj="thresholdExpression" - errors={errors} - display="fullWidth" - popupPosition={'upLeft'} - onChangeSelectedThreshold={(selectedThresholds) => - setRuleParams('threshold', selectedThresholds) - } - onChangeSelectedThresholdComparator={(selectedThresholdComparator) => - setRuleParams('thresholdComparator', selectedThresholdComparator) - } - /> - <ForLastExpression - data-test-subj="forLastExpression" - popupPosition={'upLeft'} - timeWindowSize={timeWindowSize ?? DEFAULT_VALUES.TIME_WINDOW_SIZE} - timeWindowUnit={timeWindowUnit ?? DEFAULT_VALUES.TIME_WINDOW_UNIT} - display="fullWidth" - errors={errors} - onChangeWindowSize={(selectedWindowSize: number | undefined) => - setRuleParams('timeWindowSize', selectedWindowSize) - } - onChangeWindowUnit={(selectedWindowUnit: string) => - setRuleParams('timeWindowUnit', selectedWindowUnit) - } - /> - <EuiSpacer /> - <EuiTitle size="xs"> - <h5> - <FormattedMessage - id="xpack.stackAlerts.threshold.ui.filterTitle" - defaultMessage="Filter (Optional)" - /> - </h5> - </EuiTitle> - <EuiSpacer size="s" /> - <EuiFormRow - helpText={i18n.translate('xpack.stackAlerts.threshold.ui.filterKQLHelpText', { - defaultMessage: 'Use a KQL expression to limit the scope of your alert trigger.', - })} - fullWidth - display="rowCompressed" - isInvalid={errors.filterKuery.length > 0} - error={errors.filterKuery} - > - <EuiFieldSearch - data-test-subj="filterKuery" - onChange={handleFilterChange} - value={filterKuery} - fullWidth - isInvalid={errors.filterKuery.length > 0} - /> - </EuiFormRow> - <EuiSpacer /> - <div className="actAlertVisualization__chart"> - {cannotShowVisualization ? ( - <Fragment> - <EuiEmptyPrompt - data-test-subj="visualizationPlaceholder" - iconType="visBarVertical" - body={ - <EuiText color="subdued"> - <FormattedMessage - id="xpack.stackAlerts.threshold.ui.previewAlertVisualizationDescription" - defaultMessage="Complete the expression to generate a preview." - /> - </EuiText> - } - /> - </Fragment> - ) : ( - <Fragment> - <ThresholdVisualization - data-test-subj="thresholdVisualization" - ruleParams={ruleParams} - alertInterval={ruleInterval} - aggregationTypes={builtInAggregationTypes} - comparators={builtInComparators} - charts={charts} - dataFieldsFormats={data!.fieldFormats} - /> - </Fragment> - )} - </div> - </Fragment> - ); -}; - -// eslint-disable-next-line import/no-default-export -export { IndexThresholdAlertTypeExpression as default }; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/index.ts b/x-pack/plugins/stack_alerts/public/alert_types/threshold/index.ts deleted file mode 100644 index f41856d7a5bc8..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { lazy } from 'react'; -import { i18n } from '@kbn/i18n'; -import { RuleTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; -import { validateExpression } from './validation'; -import { IndexThresholdAlertParams } from './types'; - -export function getAlertType(): RuleTypeModel<IndexThresholdAlertParams> { - return { - id: '.index-threshold', - description: i18n.translate('xpack.stackAlerts.threshold.ui.alertType.descriptionText', { - defaultMessage: 'Alert when an aggregated query meets the threshold.', - }), - iconClass: 'alert', - documentationUrl: (docLinks) => docLinks.links.alerting.indexThreshold, - ruleParamsExpression: lazy(() => import('./expression')), - validate: validateExpression, - defaultActionMessage: i18n.translate( - 'xpack.stackAlerts.threshold.ui.alertType.defaultActionMessage', - { - defaultMessage: `alert '\\{\\{alertName\\}\\}' is active for group '\\{\\{context.group\\}\\}': - -- Value: \\{\\{context.value\\}\\} -- Conditions Met: \\{\\{context.conditions\\}\\} over \\{\\{params.timeWindowSize\\}\\}\\{\\{params.timeWindowUnit\\}\\} -- Timestamp: \\{\\{context.date\\}\\}`, - } - ), - requiresAppContext: false, - }; -} diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/types.ts b/x-pack/plugins/stack_alerts/public/alert_types/threshold/types.ts deleted file mode 100644 index 20a4bd5c6a2c0..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/types.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { RuleTypeParams } from '@kbn/alerting-plugin/common'; - -export interface Comparator { - text: string; - value: string; - requiredValues: number; -} - -export interface AggregationType { - text: string; - fieldRequired: boolean; - value: string; - validNormalizedTypes: string[]; -} - -export interface GroupByType { - text: string; - sizeRequired: boolean; - value: string; - validNormalizedTypes: string[]; -} - -export interface IndexThresholdAlertParams extends RuleTypeParams { - index: string | string[]; - timeField?: string; - aggType: string; - aggField?: string; - groupBy?: string; - termSize?: number; - termField?: string; - thresholdComparator?: string; - threshold: number[]; - timeWindowSize: number; - timeWindowUnit: string; - filterKuery?: string; -} diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/validation.test.ts b/x-pack/plugins/stack_alerts/public/alert_types/threshold/validation.test.ts deleted file mode 100644 index d02afc87ad4f4..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/validation.test.ts +++ /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 { IndexThresholdAlertParams } from './types'; -import { validateExpression } from './validation'; - -describe('expression params validation', () => { - test('if index property is invalid should return proper error message', () => { - const initialParams: IndexThresholdAlertParams = { - index: [], - aggType: 'count', - threshold: [], - timeWindowSize: 1, - timeWindowUnit: 's', - }; - expect(validateExpression(initialParams).errors.index.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.index[0]).toBe('Index is required.'); - }); - test('if timeField property is not defined should return proper error message', () => { - const initialParams: IndexThresholdAlertParams = { - index: ['test'], - aggType: 'count', - threshold: [], - timeWindowSize: 1, - timeWindowUnit: 's', - }; - expect(validateExpression(initialParams).errors.timeField.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.timeField[0]).toBe('Time field is required.'); - }); - test('if aggField property is invalid should return proper error message', () => { - const initialParams: IndexThresholdAlertParams = { - index: 'test', - aggType: 'avg', - threshold: [], - timeWindowSize: 1, - timeWindowUnit: 's', - }; - expect(validateExpression(initialParams).errors.aggField.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.aggField[0]).toBe( - 'Aggregation field is required.' - ); - }); - test('if termSize property is not set should return proper error message', () => { - const initialParams: IndexThresholdAlertParams = { - index: ['test'], - aggType: 'count', - groupBy: 'top', - threshold: [], - timeWindowSize: 1, - timeWindowUnit: 's', - }; - expect(validateExpression(initialParams).errors.termSize.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.termSize[0]).toBe('Term size is required.'); - }); - test('if termField property is not set should return proper error message', () => { - const initialParams: IndexThresholdAlertParams = { - index: ['test'], - aggType: 'count', - groupBy: 'top', - threshold: [], - timeWindowSize: 1, - timeWindowUnit: 's', - }; - expect(validateExpression(initialParams).errors.termField.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.termField[0]).toBe('Term field is required.'); - }); - test('if threshold0 property is not set should return proper error message', () => { - const initialParams: IndexThresholdAlertParams = { - index: ['test'], - aggType: 'count', - groupBy: 'top', - threshold: [], - timeWindowSize: 1, - timeWindowUnit: 's', - thresholdComparator: '<', - }; - expect(validateExpression(initialParams).errors.threshold0.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.threshold0[0]).toBe('Threshold0 is required.'); - }); - test('if threshold1 property is not set should return proper error message', () => { - const initialParams: IndexThresholdAlertParams = { - index: ['test'], - aggType: 'count', - groupBy: 'top', - threshold: [1], - timeWindowSize: 1, - timeWindowUnit: 's', - thresholdComparator: 'between', - }; - expect(validateExpression(initialParams).errors.threshold1.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.threshold1[0]).toBe('Threshold1 is required.'); - }); - - test('if filterKuery is invalid should return proper error message', () => { - const initialParams: IndexThresholdAlertParams = { - index: ['test'], - aggType: 'count', - groupBy: 'top', - threshold: [1], - timeWindowSize: 1, - timeWindowUnit: 's', - thresholdComparator: 'between', - filterKuery: 'group:', - }; - expect(validateExpression(initialParams).errors.filterKuery.length).toBeGreaterThan(0); - expect(validateExpression(initialParams).errors.filterKuery[0]).toBe( - 'Filter query is invalid.' - ); - }); -}); diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/validation.ts b/x-pack/plugins/stack_alerts/public/alert_types/threshold/validation.ts deleted file mode 100644 index 3b92fe8ae2dbf..0000000000000 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/validation.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { toElasticsearchQuery, fromKueryExpression } from '@kbn/es-query'; -import { i18n } from '@kbn/i18n'; -import { - ValidationResult, - builtInGroupByTypes, - builtInAggregationTypes, - builtInComparators, -} from '@kbn/triggers-actions-ui-plugin/public'; -import { IndexThresholdAlertParams } from './types'; - -export const validateExpression = (alertParams: IndexThresholdAlertParams): ValidationResult => { - const { - index, - timeField, - aggType, - aggField, - groupBy, - termSize, - termField, - threshold, - timeWindowSize, - thresholdComparator, - filterKuery, - } = alertParams; - const validationResult = { errors: {} }; - const errors = { - aggField: new Array<string>(), - termSize: new Array<string>(), - termField: new Array<string>(), - timeWindowSize: new Array<string>(), - threshold0: new Array<string>(), - threshold1: new Array<string>(), - index: new Array<string>(), - timeField: new Array<string>(), - filterKuery: new Array<string>(), - }; - validationResult.errors = errors; - - if (!!filterKuery) { - try { - toElasticsearchQuery(fromKueryExpression(filterKuery as string)); - } catch (e) { - errors.filterKuery.push( - i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.invalidKql', { - defaultMessage: 'Filter query is invalid.', - }) - ); - } - } - - if (!index || index.length === 0) { - errors.index.push( - i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredIndexText', { - defaultMessage: 'Index is required.', - }) - ); - } - if (!timeField) { - errors.timeField.push( - i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredTimeFieldText', { - defaultMessage: 'Time field is required.', - }) - ); - } - if (aggType && builtInAggregationTypes[aggType].fieldRequired && !aggField) { - errors.aggField.push( - i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredAggFieldText', { - defaultMessage: 'Aggregation field is required.', - }) - ); - } - if ( - groupBy && - builtInGroupByTypes[groupBy] && - builtInGroupByTypes[groupBy].sizeRequired && - !termSize - ) { - errors.termSize.push( - i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredTermSizedText', { - defaultMessage: 'Term size is required.', - }) - ); - } - if ( - groupBy && - builtInGroupByTypes[groupBy].validNormalizedTypes && - builtInGroupByTypes[groupBy].validNormalizedTypes.length > 0 && - !termField - ) { - errors.termField.push( - i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredTermFieldText', { - defaultMessage: 'Term field is required.', - }) - ); - } - if (!timeWindowSize) { - errors.timeWindowSize.push( - i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredTimeWindowSizeText', { - defaultMessage: 'Time window size is required.', - }) - ); - } - if (!threshold || threshold.length === 0 || threshold[0] === undefined) { - errors.threshold0.push( - i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredThreshold0Text', { - defaultMessage: 'Threshold0 is required.', - }) - ); - } - if ( - thresholdComparator && - builtInComparators[thresholdComparator].requiredValues > 1 && - (!threshold || - threshold[1] === undefined || - (threshold && threshold.length < builtInComparators[thresholdComparator!].requiredValues)) - ) { - errors.threshold1.push( - i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredThreshold1Text', { - defaultMessage: 'Threshold1 is required.', - }) - ); - } - if (threshold && threshold.length === 2 && threshold[0] > threshold[1]) { - errors.threshold1.push( - i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.greaterThenThreshold0Text', { - defaultMessage: 'Threshold1 should be > Threshold0.', - }) - ); - } - return validationResult; -}; diff --git a/x-pack/plugins/stack_alerts/public/index.ts b/x-pack/plugins/stack_alerts/public/index.ts index f7dc42da7e50c..d043883d6e248 100644 --- a/x-pack/plugins/stack_alerts/public/index.ts +++ b/x-pack/plugins/stack_alerts/public/index.ts @@ -5,7 +5,6 @@ * 2.0. */ -import { PluginInitializerContext } from '@kbn/core/public'; import { StackAlertsPublicPlugin } from './plugin'; -export const plugin = (ctx: PluginInitializerContext) => new StackAlertsPublicPlugin(ctx); +export const plugin = () => new StackAlertsPublicPlugin(); diff --git a/x-pack/plugins/stack_alerts/public/plugin.tsx b/x-pack/plugins/stack_alerts/public/plugin.tsx index b7a81e1b0f6bb..88b1f9e06723e 100644 --- a/x-pack/plugins/stack_alerts/public/plugin.tsx +++ b/x-pack/plugins/stack_alerts/public/plugin.tsx @@ -5,11 +5,10 @@ * 2.0. */ -import { CoreSetup, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import { CoreSetup, Plugin } from '@kbn/core/public'; import { TriggersAndActionsUIPublicPluginSetup } from '@kbn/triggers-actions-ui-plugin/public'; import { PluginSetupContract as AlertingSetup } from '@kbn/alerting-plugin/public'; -import { registerAlertTypes } from './alert_types'; -import { Config } from '../common'; +import { registerRuleTypes } from './rule_types'; export type Setup = void; export type Start = void; @@ -20,16 +19,9 @@ export interface StackAlertsPublicSetupDeps { } export class StackAlertsPublicPlugin implements Plugin<Setup, Start, StackAlertsPublicSetupDeps> { - private initializerContext: PluginInitializerContext; - - constructor(initializerContext: PluginInitializerContext) { - this.initializerContext = initializerContext; - } - public setup(core: CoreSetup, { triggersActionsUi, alerting }: StackAlertsPublicSetupDeps) { - registerAlertTypes({ + registerRuleTypes({ ruleTypeRegistry: triggersActionsUi.ruleTypeRegistry, - config: this.initializerContext.config.get<Config>(), alerting, }); } diff --git a/x-pack/plugins/stack_alerts/public/alert_types/components/data_view_select_popover.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.test.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/components/data_view_select_popover.test.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.test.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/components/data_view_select_popover.tsx b/x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/components/data_view_select_popover.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/components/index_select_popover.test.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.test.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/components/index_select_popover.test.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.tsx b/x-pack/plugins/stack_alerts/public/rule_types/components/index_select_popover.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/components/index_select_popover.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/constants.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/constants.ts similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/constants.ts rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/constants.ts diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/es_query_expression.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/es_query_expression.test.tsx similarity index 95% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/es_query_expression.test.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/es_query_expression.test.tsx index 082d29e05eb5b..c613fcfc76bed 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/es_query_expression.test.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/es_query_expression.test.tsx @@ -20,7 +20,7 @@ import { ISearchStart, } from '@kbn/data-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { EsQueryAlertParams, SearchType } from '../types'; +import { EsQueryRuleParams, SearchType } from '../types'; import { EsQueryExpression } from './es_query_expression'; jest.mock('@kbn/kibana-react-plugin/public', () => ({ @@ -106,7 +106,7 @@ const dataViewMock = dataViewPluginMocks.createStartContract(); const unifiedSearchMock = unifiedSearchPluginMock.createStartContract(); const chartsStartMock = chartPluginMock.createStartContract(); -const defaultEsQueryExpressionParams: EsQueryAlertParams<SearchType.esQuery> = { +const defaultEsQueryExpressionParams: EsQueryRuleParams<SearchType.esQuery> = { size: 100, thresholdComparator: '>', threshold: [0], @@ -118,7 +118,7 @@ const defaultEsQueryExpressionParams: EsQueryAlertParams<SearchType.esQuery> = { excludeHitsFromPreviousRun: true, }; -describe('EsQueryAlertTypeExpression', () => { +describe('EsQueryRuleTypeExpression', () => { beforeAll(() => { (useKibana as jest.Mock).mockReturnValue({ services: { @@ -135,7 +135,7 @@ describe('EsQueryAlertTypeExpression', () => { }); }); - async function setup(alertParams: EsQueryAlertParams<SearchType.esQuery>) { + async function setup(alertParams: EsQueryRuleParams<SearchType.esQuery>) { const errors = { index: [], esQuery: [], @@ -172,7 +172,7 @@ describe('EsQueryAlertTypeExpression', () => { return wrapper; } - test('should render EsQueryAlertTypeExpression with expected components', async () => { + test('should render EsQueryRuleTypeExpression with expected components', async () => { const wrapper = await setup(defaultEsQueryExpressionParams); expect(wrapper.find('[data-test-subj="indexSelectPopover"]').exists()).toBeTruthy(); expect(wrapper.find('[data-test-subj="sizeValueExpression"]').exists()).toBeTruthy(); @@ -197,7 +197,7 @@ describe('EsQueryAlertTypeExpression', () => { const wrapper = await setup({ ...defaultEsQueryExpressionParams, timeField: null, - } as unknown as EsQueryAlertParams<SearchType.esQuery>); + } as unknown as EsQueryRuleParams<SearchType.esQuery>); const testQueryButton = wrapper.find('EuiButton[data-test-subj="testQuery"]'); expect(testQueryButton.exists()).toBeTruthy(); expect(testQueryButton.prop('disabled')).toBe(true); diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/es_query_expression.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/es_query_expression.tsx similarity index 91% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/es_query_expression.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/es_query_expression.tsx index 37369d60335a5..e98c547a6120c 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/es_query_expression.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/es_query_expression.tsx @@ -19,7 +19,7 @@ import { getFields, RuleTypeParamsExpressionProps } from '@kbn/triggers-actions- import { parseDuration } from '@kbn/alerting-plugin/common'; import { hasExpressionValidationErrors } from '../validation'; import { buildSortedEventsQuery } from '../../../../common/build_sorted_events_query'; -import { EsQueryAlertParams, SearchType } from '../types'; +import { EsQueryRuleParams, SearchType } from '../types'; import { IndexSelectPopover } from '../../components/index_select_popover'; import { DEFAULT_VALUES } from '../constants'; import { RuleCommonExpressions } from '../rule_common_expressions'; @@ -33,7 +33,7 @@ interface KibanaDeps { } export const EsQueryExpression: React.FC< - RuleTypeParamsExpressionProps<EsQueryAlertParams<SearchType.esQuery>> + RuleTypeParamsExpressionProps<EsQueryRuleParams<SearchType.esQuery>> > = ({ ruleParams, setRuleParams, setRuleProperty, errors, data }) => { const { index, @@ -47,19 +47,20 @@ export const EsQueryExpression: React.FC< excludeHitsFromPreviousRun, } = ruleParams; - const [currentRuleParams, setCurrentRuleParams] = useState< - EsQueryAlertParams<SearchType.esQuery> - >({ - ...ruleParams, - timeWindowSize: timeWindowSize ?? DEFAULT_VALUES.TIME_WINDOW_SIZE, - timeWindowUnit: timeWindowUnit ?? DEFAULT_VALUES.TIME_WINDOW_UNIT, - threshold: threshold ?? DEFAULT_VALUES.THRESHOLD, - thresholdComparator: thresholdComparator ?? DEFAULT_VALUES.THRESHOLD_COMPARATOR, - size: size ?? DEFAULT_VALUES.SIZE, - esQuery: esQuery ?? DEFAULT_VALUES.QUERY, - searchType: SearchType.esQuery, - excludeHitsFromPreviousRun: excludeHitsFromPreviousRun ?? DEFAULT_VALUES.EXCLUDE_PREVIOUS_HITS, - }); + const [currentRuleParams, setCurrentRuleParams] = useState<EsQueryRuleParams<SearchType.esQuery>>( + { + ...ruleParams, + timeWindowSize: timeWindowSize ?? DEFAULT_VALUES.TIME_WINDOW_SIZE, + timeWindowUnit: timeWindowUnit ?? DEFAULT_VALUES.TIME_WINDOW_UNIT, + threshold: threshold ?? DEFAULT_VALUES.THRESHOLD, + thresholdComparator: thresholdComparator ?? DEFAULT_VALUES.THRESHOLD_COMPARATOR, + size: size ?? DEFAULT_VALUES.SIZE, + esQuery: esQuery ?? DEFAULT_VALUES.QUERY, + searchType: SearchType.esQuery, + excludeHitsFromPreviousRun: + excludeHitsFromPreviousRun ?? DEFAULT_VALUES.EXCLUDE_PREVIOUS_HITS, + } + ); const setParam = useCallback( (paramField: string, paramValue: unknown) => { @@ -178,7 +179,6 @@ export const EsQueryExpression: React.FC< }} onTimeFieldChange={(updatedTimeField: string) => setParam('timeField', updatedTimeField)} /> - <EuiSpacer size="s" /> <EuiTitle size="xs"> diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/expression.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/expression.test.tsx new file mode 100644 index 0000000000000..b21646496f14a --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/expression.test.tsx @@ -0,0 +1,261 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { mountWithIntl } from '@kbn/test-jest-helpers'; +import 'brace'; +import React, { useState } from 'react'; +import { docLinksServiceMock } from '@kbn/core/public/mocks'; +import { httpServiceMock } from '@kbn/core/public/mocks'; +import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; +import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; +import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; +import { CommonRuleParams, EsQueryRuleParams, SearchType } from '../types'; +import { EsQueryRuleTypeExpression } from './expression'; +import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; +import { Subject } from 'rxjs'; +import { ISearchSource } from '@kbn/data-plugin/common'; +import { IUiSettingsClient } from '@kbn/core/public'; +import { findTestSubject } from '@elastic/eui/lib/test'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { act } from 'react-dom/test-utils'; +import { ReactWrapper } from 'enzyme'; + +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + // Mocking CodeEditor + // eslint-disable-next-line @typescript-eslint/no-explicit-any + CodeEditor: (props: any) => ( + <input + data-test-subj="mockCodeEditor" + // eslint-disable-next-line @typescript-eslint/no-explicit-any + onChange={(syntheticEvent: any) => { + props.onChange(syntheticEvent.jsonString); + }} + /> + ), + }; +}); + +const defaultEsQueryRuleParams: EsQueryRuleParams<SearchType.esQuery> = { + size: 100, + thresholdComparator: '>', + threshold: [0], + timeWindowSize: 15, + timeWindowUnit: 's', + index: ['test-index'], + timeField: '@timestamp', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + searchType: SearchType.esQuery, + excludeHitsFromPreviousRun: true, +}; +const defaultSearchSourceRuleParams: EsQueryRuleParams<SearchType.searchSource> = { + size: 100, + thresholdComparator: '>', + threshold: [0], + timeWindowSize: 15, + timeWindowUnit: 's', + index: ['test-index'], + timeField: '@timestamp', + searchType: SearchType.searchSource, + searchConfiguration: {}, + excludeHitsFromPreviousRun: true, +}; + +const dataViewPluginMock = dataViewPluginMocks.createStartContract(); +const chartsStartMock = chartPluginMock.createStartContract(); +const unifiedSearchMock = unifiedSearchPluginMock.createStartContract(); +const httpMock = httpServiceMock.createStartContract(); +const docLinksMock = docLinksServiceMock.createStartContract(); +export const uiSettingsMock = { + get: jest.fn(), +} as unknown as IUiSettingsClient; + +const mockSearchResult = new Subject(); +const searchSourceFieldsMock = { + query: { + query: '', + language: 'kuery', + }, + filter: [], + index: { + id: '90943e30-9a47-11e8-b64d-95841ca0b247', + title: 'kibana_sample_data_logs', + fields: [], + }, +}; + +const searchSourceMock = { + id: 'data_source6', + fields: searchSourceFieldsMock, + getField: (name: string) => { + return (searchSourceFieldsMock as Record<string, object>)[name] || ''; + }, + setField: jest.fn(), + createCopy: jest.fn(() => { + return searchSourceMock; + }), + setParent: jest.fn(() => { + return searchSourceMock; + }), + fetch$: jest.fn(() => { + return mockSearchResult; + }), +} as unknown as ISearchSource; + +const savedQueryMock = { + id: 'test-id', + attributes: { + title: 'test-filter-set', + description: '', + query: { + query: 'category.keyword : "Men\'s Shoes" ', + language: 'kuery', + }, + filters: [], + }, +}; + +const dataMock = dataPluginMock.createStartContract(); +(dataMock.search.searchSource.create as jest.Mock).mockImplementation(() => + Promise.resolve(searchSourceMock) +); +(dataMock.dataViews.getIdsWithTitle as jest.Mock).mockImplementation(() => Promise.resolve([])); +dataMock.dataViews.getDefaultDataView = jest.fn(() => Promise.resolve(null)); +(dataMock.query.savedQueries.getSavedQuery as jest.Mock).mockImplementation(() => + Promise.resolve(savedQueryMock) +); +dataMock.query.savedQueries.findSavedQueries = jest.fn(() => + Promise.resolve({ total: 0, queries: [] }) +); +(httpMock.post as jest.Mock).mockImplementation(() => Promise.resolve({ fields: [] })); + +const Wrapper: React.FC<{ + ruleParams: EsQueryRuleParams<SearchType.searchSource> | EsQueryRuleParams<SearchType.esQuery>; +}> = ({ ruleParams }) => { + const [currentRuleParams, setCurrentRuleParams] = useState<CommonRuleParams>(ruleParams); + const errors = { + index: [], + esQuery: [], + size: [], + timeField: [], + timeWindowSize: [], + searchConfiguration: [], + searchType: [], + }; + + return ( + <EsQueryRuleTypeExpression + ruleInterval="1m" + ruleThrottle="1m" + alertNotifyWhen="onThrottleInterval" + ruleParams={currentRuleParams} + setRuleParams={(name, value) => { + setCurrentRuleParams((params) => ({ ...params, [name]: value })); + }} + setRuleProperty={(name, params) => { + if (name === 'params') { + setCurrentRuleParams(params as CommonRuleParams); + } + }} + errors={errors} + unifiedSearch={unifiedSearchMock} + data={dataMock} + dataViews={dataViewPluginMock} + defaultActionGroupId="" + actionGroups={[]} + charts={chartsStartMock} + /> + ); +}; + +const setup = ( + ruleParams: EsQueryRuleParams<SearchType.searchSource> | EsQueryRuleParams<SearchType.esQuery> +) => { + return mountWithIntl( + <KibanaContextProvider + services={{ + data: dataMock, + uiSettings: uiSettingsMock, + docLinks: docLinksMock, + http: httpMock, + }} + > + <Wrapper ruleParams={ruleParams} /> + </KibanaContextProvider> + ); +}; + +describe('EsQueryRuleTypeExpression', () => { + test('should render options by default', async () => { + const wrapper = setup({} as EsQueryRuleParams<SearchType.esQuery>); + expect(findTestSubject(wrapper, 'queryFormTypeChooserTitle').exists()).toBeTruthy(); + expect(findTestSubject(wrapper, 'queryFormType_searchSource').exists()).toBeTruthy(); + expect(findTestSubject(wrapper, 'queryFormType_esQuery').exists()).toBeTruthy(); + expect(findTestSubject(wrapper, 'queryFormTypeChooserCancel').exists()).toBeFalsy(); + }); + + test('should switch to QueryDSL form type on selection and return back on cancel', async () => { + let wrapper = setup({} as EsQueryRuleParams<SearchType.esQuery>); + await act(async () => { + findTestSubject(wrapper, 'queryFormType_esQuery').simulate('click'); + }); + wrapper = await wrapper.update(); + + expect(findTestSubject(wrapper, 'queryFormTypeChooserTitle').exists()).toBeFalsy(); + expect(wrapper.exists('[data-test-subj="queryJsonEditor"]')).toBeTruthy(); + expect(findTestSubject(wrapper, 'selectIndexExpression').exists()).toBeTruthy(); + + await act(async () => { + findTestSubject(wrapper, 'queryFormTypeChooserCancel').simulate('click'); + }); + wrapper = await wrapper.update(); + expect(findTestSubject(wrapper, 'selectIndexExpression').exists()).toBeFalsy(); + expect(findTestSubject(wrapper, 'queryFormTypeChooserTitle').exists()).toBeTruthy(); + }); + + test('should switch to KQL or Lucene form type on selection and return back on cancel', async () => { + let wrapper = setup({} as EsQueryRuleParams<SearchType.searchSource>); + await act(async () => { + findTestSubject(wrapper, 'queryFormType_searchSource').simulate('click'); + }); + wrapper = await wrapper.update(); + expect(findTestSubject(wrapper, 'queryFormTypeChooserTitle').exists()).toBeFalsy(); + expect(findTestSubject(wrapper, 'selectDataViewExpression').exists()).toBeTruthy(); + + await act(async () => { + findTestSubject(wrapper, 'queryFormTypeChooserCancel').simulate('click'); + }); + wrapper = await wrapper.update(); + expect(findTestSubject(wrapper, 'selectDataViewExpression').exists()).toBeFalsy(); + expect(findTestSubject(wrapper, 'queryFormTypeChooserTitle').exists()).toBeTruthy(); + }); + + test('should render QueryDSL view without the form type chooser if some rule params were passed', async () => { + let wrapper: ReactWrapper; + await act(async () => { + wrapper = setup(defaultEsQueryRuleParams); + wrapper = await wrapper.update(); + }); + expect(findTestSubject(wrapper!, 'queryFormTypeChooserTitle').exists()).toBeFalsy(); + expect(findTestSubject(wrapper!, 'queryFormTypeChooserCancel').exists()).toBeFalsy(); + expect(findTestSubject(wrapper!, 'selectIndexExpression').exists()).toBeTruthy(); + }); + + test('should render KQL and Lucene view without the form type chooser if some rule params were passed', async () => { + let wrapper: ReactWrapper; + await act(async () => { + wrapper = setup(defaultSearchSourceRuleParams); + wrapper = await wrapper.update(); + }); + wrapper = await wrapper!.update(); + expect(findTestSubject(wrapper!, 'queryFormTypeChooserTitle').exists()).toBeFalsy(); + expect(findTestSubject(wrapper!, 'queryFormTypeChooserCancel').exists()).toBeFalsy(); + expect(findTestSubject(wrapper!, 'selectDataViewExpression').exists()).toBeTruthy(); + }); +}); diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/expression.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/expression.tsx new file mode 100644 index 0000000000000..4fde89d994c9e --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/expression.tsx @@ -0,0 +1,103 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { memo, PropsWithChildren, useCallback, useRef } from 'react'; +import deepEqual from 'fast-deep-equal'; +import 'brace/theme/github'; +import { EuiCallOut, EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { RuleTypeParamsExpressionProps } from '@kbn/triggers-actions-ui-plugin/public'; +import { EsQueryRuleParams, SearchType } from '../types'; +import { SearchSourceExpression, SearchSourceExpressionProps } from './search_source_expression'; +import { EsQueryExpression } from './es_query_expression'; +import { QueryFormTypeChooser } from './query_form_type_chooser'; +import { isSearchSourceRule } from '../util'; +import { EXPRESSION_ERROR_KEYS } from '../constants'; + +function areSearchSourceExpressionPropsEqual( + prevProps: Readonly<PropsWithChildren<SearchSourceExpressionProps>>, + nextProps: Readonly<PropsWithChildren<SearchSourceExpressionProps>> +) { + const areErrorsEqual = deepEqual(prevProps.errors, nextProps.errors); + const areRuleParamsEqual = deepEqual(prevProps.ruleParams, nextProps.ruleParams); + return areErrorsEqual && areRuleParamsEqual; +} + +const SearchSourceExpressionMemoized = memo<SearchSourceExpressionProps>( + SearchSourceExpression, + areSearchSourceExpressionPropsEqual +); + +export const EsQueryRuleTypeExpression: React.FunctionComponent< + RuleTypeParamsExpressionProps<EsQueryRuleParams> +> = (props) => { + const { ruleParams, errors, setRuleProperty, setRuleParams } = props; + const isSearchSource = isSearchSourceRule(ruleParams); + const isManagementPage = useRef(!Object.keys(ruleParams).length).current; + + const formTypeSelected = useCallback( + (searchType: SearchType | null) => { + if (!searchType) { + // @ts-expect-error Reset rule params regardless of their type + setRuleProperty('params', {}); + return; + } + setRuleParams('searchType', searchType); + }, + [setRuleParams, setRuleProperty] + ); + + const expressionGenericErrorMessage = i18n.translate( + 'xpack.stackAlerts.esQuery.ui.alertParams.fixErrorInExpressionBelowValidationMessage', + { + defaultMessage: 'Expression contains errors.', + } + ); + + const errorParam = EXPRESSION_ERROR_KEYS.find((errorKey) => { + return errors[errorKey]?.length >= 1 && ruleParams[errorKey] !== undefined; + }); + + const expressionError = !!errorParam && ( + <> + <EuiCallOut + color="danger" + size="s" + title={ + ['index', 'searchType'].includes(errorParam) + ? errors[errorParam] + : expressionGenericErrorMessage + } + /> + <EuiSpacer /> + </> + ); + + return ( + <> + {expressionError} + + {/* Showing the selected type */} + {isManagementPage && ( + <QueryFormTypeChooser + searchType={ruleParams.searchType as SearchType} + onFormTypeSelect={formTypeSelected} + /> + )} + + {ruleParams.searchType && isSearchSource && ( + <SearchSourceExpressionMemoized {...props} ruleParams={ruleParams} /> + )} + + {ruleParams.searchType && !isSearchSource && ( + <EsQueryExpression {...props} ruleParams={ruleParams} /> + )} + + <EuiHorizontalRule /> + </> + ); +}; diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/index.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/index.ts new file mode 100644 index 0000000000000..a0df53489cfb2 --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/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. + */ + +import { EsQueryRuleTypeExpression } from './expression'; + +// eslint-disable-next-line import/no-default-export +export default EsQueryRuleTypeExpression; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/query_form_type_chooser.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/query_form_type_chooser.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/query_form_type_chooser.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/query_form_type_chooser.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.scss b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression.scss similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.scss rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression.scss diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression.test.tsx similarity index 97% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.test.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression.test.tsx index 5bae70f96659f..924b93907b8b4 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.test.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; -import { EsQueryAlertParams, SearchType } from '../types'; +import { EsQueryRuleParams, SearchType } from '../types'; import { SearchSourceExpression } from './search_source_expression'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { act } from 'react-dom/test-utils'; @@ -38,7 +38,7 @@ export const uiSettingsMock = { get: jest.fn(), } as unknown as IUiSettingsClient; -const defaultSearchSourceExpressionParams: EsQueryAlertParams<SearchType.searchSource> = { +const defaultSearchSourceExpressionParams: EsQueryRuleParams<SearchType.searchSource> = { size: 100, thresholdComparator: '>', threshold: [0], @@ -191,7 +191,7 @@ dataMock.query.savedQueries.findSavedQueries = jest.fn(() => Promise.resolve({ total: 0, queries: [] }) ); -const setup = (alertParams: EsQueryAlertParams<SearchType.searchSource>) => { +const setup = (alertParams: EsQueryRuleParams<SearchType.searchSource>) => { const errors = { size: [], timeField: [], diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression.tsx similarity index 97% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression.tsx index 2e5d2d6e7b18d..5c3fe1d0d4d28 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression.tsx @@ -11,13 +11,13 @@ import { EuiSpacer, EuiLoadingSpinner, EuiEmptyPrompt, EuiCallOut } from '@elast import { ISearchSource } from '@kbn/data-plugin/common'; import { RuleTypeParamsExpressionProps } from '@kbn/triggers-actions-ui-plugin/public'; import { SavedQuery } from '@kbn/data-plugin/public'; -import { EsQueryAlertParams, SearchType } from '../types'; +import { EsQueryRuleParams, SearchType } from '../types'; import { useTriggersAndActionsUiDeps } from '../util'; import { SearchSourceExpressionForm } from './search_source_expression_form'; import { DEFAULT_VALUES } from '../constants'; export type SearchSourceExpressionProps = RuleTypeParamsExpressionProps< - EsQueryAlertParams<SearchType.searchSource> + EsQueryRuleParams<SearchType.searchSource> >; export const SearchSourceExpression = ({ diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx similarity index 95% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx index 6274a4dcdba95..eacbd169dfed8 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/search_source_expression_form.tsx @@ -16,7 +16,7 @@ import { IErrorObject } from '@kbn/triggers-actions-ui-plugin/public'; import { SearchBar, SearchBarProps } from '@kbn/unified-search-plugin/public'; import { mapAndFlattenFilters, SavedQuery, TimeHistory } from '@kbn/data-plugin/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; -import { CommonAlertParams, EsQueryAlertParams, SearchType } from '../types'; +import { CommonRuleParams, EsQueryRuleParams, SearchType } from '../types'; import { DEFAULT_VALUES } from '../constants'; import { DataViewSelectPopover } from '../../components/data_view_select_popover'; import { useTriggersAndActionsUiDeps } from '../util'; @@ -33,12 +33,12 @@ interface LocalState { index: DataView; filter: Filter[]; query: Query; - thresholdComparator: CommonAlertParams['thresholdComparator']; - threshold: CommonAlertParams['threshold']; - timeWindowSize: CommonAlertParams['timeWindowSize']; - timeWindowUnit: CommonAlertParams['timeWindowUnit']; - size: CommonAlertParams['size']; - excludeHitsFromPreviousRun: CommonAlertParams['excludeHitsFromPreviousRun']; + thresholdComparator: CommonRuleParams['thresholdComparator']; + threshold: CommonRuleParams['threshold']; + timeWindowSize: CommonRuleParams['timeWindowSize']; + timeWindowUnit: CommonRuleParams['timeWindowUnit']; + size: CommonRuleParams['size']; + excludeHitsFromPreviousRun: CommonRuleParams['excludeHitsFromPreviousRun']; } interface LocalStateAction { @@ -64,7 +64,7 @@ interface SearchSourceParamsAction { interface SearchSourceExpressionFormProps { searchSource: ISearchSource; - ruleParams: EsQueryAlertParams<SearchType.searchSource>; + ruleParams: EsQueryRuleParams<SearchType.searchSource>; errors: IErrorObject; initialSavedQuery?: SavedQuery; setParam: (paramField: string, paramValue: unknown) => void; diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/index.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/index.ts new file mode 100644 index 0000000000000..87be947c22f90 --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/index.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 { lazy } from 'react'; +import { i18n } from '@kbn/i18n'; +import { RuleTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; +import { PluginSetupContract as AlertingSetup } from '@kbn/alerting-plugin/public'; +import { SanitizedRule } from '@kbn/alerting-plugin/common'; +import { EsQueryRuleParams, SearchType } from './types'; +import { validateExpression } from './validation'; + +const PLUGIN_ID = 'discover'; +const ES_QUERY_ALERT_TYPE = '.es-query'; + +export function getRuleType(alerting: AlertingSetup): RuleTypeModel<EsQueryRuleParams> { + registerNavigation(alerting); + + return { + id: ES_QUERY_ALERT_TYPE, + description: i18n.translate('xpack.stackAlerts.esQuery.ui.alertType.descriptionText', { + defaultMessage: 'Alert when matches are found during the latest query run.', + }), + iconClass: 'logoElastic', + documentationUrl: (docLinks) => docLinks.links.alerting.esQuery, + ruleParamsExpression: lazy(() => import('./expression')), + validate: validateExpression, + defaultActionMessage: i18n.translate( + 'xpack.stackAlerts.esQuery.ui.alertType.defaultActionMessage', + { + defaultMessage: `Elasticsearch query alert '\\{\\{alertName\\}\\}' is active: + +- Value: \\{\\{context.value\\}\\} +- Conditions Met: \\{\\{context.conditions\\}\\} over \\{\\{params.timeWindowSize\\}\\}\\{\\{params.timeWindowUnit\\}\\} +- Timestamp: \\{\\{context.date\\}\\} +- Link: \\{\\{context.link\\}\\}`, + } + ), + requiresAppContext: false, + }; +} + +function registerNavigation(alerting: AlertingSetup) { + alerting.registerNavigation( + PLUGIN_ID, + ES_QUERY_ALERT_TYPE, + (alert: SanitizedRule<EsQueryRuleParams<SearchType.searchSource>>) => { + return `#/viewAlert/${alert.id}`; + } + ); +} diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/rule_common_expressions/index.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/rule_common_expressions/index.ts similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/rule_common_expressions/index.ts rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/rule_common_expressions/index.ts diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/rule_common_expressions/rule_common_expressions.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/rule_common_expressions/rule_common_expressions.tsx similarity index 93% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/rule_common_expressions/rule_common_expressions.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/rule_common_expressions/rule_common_expressions.tsx index 0c0fc9a9a3c0b..4db7a17abeae3 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/rule_common_expressions/rule_common_expressions.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/rule_common_expressions/rule_common_expressions.tsx @@ -23,18 +23,18 @@ import { ThresholdExpression, ValueExpression, } from '@kbn/triggers-actions-ui-plugin/public'; -import { CommonAlertParams } from '../types'; +import { CommonRuleParams } from '../types'; import { DEFAULT_VALUES } from '../constants'; import { TestQueryRow, TestQueryRowProps } from '../test_query_row'; import { QueryThresholdHelpPopover } from './threshold_help_popover'; export interface RuleCommonExpressionsProps { - thresholdComparator?: CommonAlertParams['thresholdComparator']; - threshold?: CommonAlertParams['threshold']; - timeWindowSize: CommonAlertParams['timeWindowSize']; - timeWindowUnit: CommonAlertParams['timeWindowUnit']; - size: CommonAlertParams['size']; - excludeHitsFromPreviousRun: CommonAlertParams['excludeHitsFromPreviousRun']; + thresholdComparator?: CommonRuleParams['thresholdComparator']; + threshold?: CommonRuleParams['threshold']; + timeWindowSize: CommonRuleParams['timeWindowSize']; + timeWindowUnit: CommonRuleParams['timeWindowUnit']; + size: CommonRuleParams['size']; + excludeHitsFromPreviousRun: CommonRuleParams['excludeHitsFromPreviousRun']; errors: IErrorObject; hasValidationErrors: boolean; onChangeThreshold: Parameters<typeof ThresholdExpression>[0]['onChangeSelectedThreshold']; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/rule_common_expressions/threshold_help_popover.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/rule_common_expressions/threshold_help_popover.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/rule_common_expressions/threshold_help_popover.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/rule_common_expressions/threshold_help_popover.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/test_query_row/index.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/test_query_row/index.ts similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/test_query_row/index.ts rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/test_query_row/index.ts diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/test_query_row/test_query_row.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/test_query_row/test_query_row.test.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/test_query_row/test_query_row.test.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/test_query_row/test_query_row.test.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/test_query_row/test_query_row.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/test_query_row/test_query_row.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/test_query_row/test_query_row.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/test_query_row/test_query_row.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/test_query_row/use_test_query.test.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/test_query_row/use_test_query.test.ts similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/test_query_row/use_test_query.test.ts rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/test_query_row/use_test_query.test.ts diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/test_query_row/use_test_query.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/test_query_row/use_test_query.ts similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/es_query/test_query_row/use_test_query.ts rename to x-pack/plugins/stack_alerts/public/rule_types/es_query/test_query_row/use_test_query.ts diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/types.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/types.ts new file mode 100644 index 0000000000000..5de99ff16feb5 --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/types.ts @@ -0,0 +1,60 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { RuleTypeParams } from '@kbn/alerting-plugin/common'; +import { SerializedSearchSourceFields } from '@kbn/data-plugin/common'; +import { EuiComboBoxOptionOption } from '@elastic/eui'; +import { DataPublicPluginStart } from '@kbn/data-plugin/public'; +import { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; +import { EXPRESSION_ERRORS } from './constants'; + +export interface Comparator { + text: string; + value: string; + requiredValues: number; +} + +export enum SearchType { + esQuery = 'esQuery', + searchSource = 'searchSource', +} + +export interface CommonRuleParams extends RuleTypeParams { + size: number; + thresholdComparator?: string; + threshold: number[]; + timeWindowSize: number; + timeWindowUnit: string; + excludeHitsFromPreviousRun: boolean; +} + +export type EsQueryRuleParams<T = SearchType> = T extends SearchType.searchSource + ? CommonRuleParams & OnlySearchSourceRuleParams + : CommonRuleParams & OnlyEsQueryRuleParams; + +export interface OnlyEsQueryRuleParams { + esQuery: string; + index: string[]; + timeField: string; +} + +export interface OnlySearchSourceRuleParams { + searchType?: 'searchSource'; + searchConfiguration?: SerializedSearchSourceFields; + savedQueryId?: string; +} + +export type DataViewOption = EuiComboBoxOptionOption<string>; + +export type ExpressionErrors = typeof EXPRESSION_ERRORS; + +export type ErrorKey = keyof ExpressionErrors & unknown; + +export interface TriggersAndActionsUiDeps { + data: DataPublicPluginStart; + dataViewEditor: DataViewEditorStart; +} diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/util.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/util.ts new file mode 100644 index 0000000000000..f38f1df137d13 --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/util.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { EsQueryRuleParams, SearchType, TriggersAndActionsUiDeps } from './types'; + +export const isSearchSourceRule = ( + ruleParams: EsQueryRuleParams +): ruleParams is EsQueryRuleParams<SearchType.searchSource> => { + return ruleParams.searchType === 'searchSource'; +}; + +export const useTriggersAndActionsUiDeps = () => useKibana<TriggersAndActionsUiDeps>().services; diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/validation.test.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/validation.test.ts new file mode 100644 index 0000000000000..f1918f88d24fd --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/validation.test.ts @@ -0,0 +1,206 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EsQueryRuleParams, SearchType } from './types'; +import { validateExpression, hasExpressionValidationErrors } from './validation'; + +describe('expression params validation', () => { + test('if params are not set should return a proper error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = + {} as EsQueryRuleParams<SearchType.esQuery>; + expect(validateExpression(initialParams).errors.searchType.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.searchType[0]).toBe('Query type is required.'); + }); + + test('if index property is invalid should return proper error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: [], + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 1, + timeWindowUnit: 's', + threshold: [0], + timeField: '', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.index.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.index[0]).toBe('Index is required.'); + }); + + test('if timeField property is not defined should return proper error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: ['test'], + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 1, + timeWindowUnit: 's', + threshold: [0], + timeField: '', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.timeField.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.timeField[0]).toBe('Time field is required.'); + }); + + test('if esQuery property is invalid JSON should return proper error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: ['test'], + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n`, + size: 100, + timeWindowSize: 1, + timeWindowUnit: 's', + threshold: [0], + timeField: '', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.esQuery.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.esQuery[0]).toBe('Query must be valid JSON.'); + }); + + test('if esQuery property is invalid should return proper error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: ['test'], + esQuery: `{\n \"aggs\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 1, + timeWindowUnit: 's', + threshold: [0], + timeField: '', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.esQuery.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.esQuery[0]).toBe(`Query field is required.`); + expect(hasExpressionValidationErrors(initialParams)).toBe(true); + }); + + test('if searchConfiguration property is not set should return proper error message', () => { + const initialParams = { + size: 100, + timeWindowSize: 1, + timeWindowUnit: 's', + threshold: [0], + searchType: SearchType.searchSource, + } as EsQueryRuleParams<SearchType.searchSource>; + expect(validateExpression(initialParams).errors.searchConfiguration.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.searchConfiguration[0]).toBe( + `Search source configuration is required.` + ); + }); + + test('if threshold0 property is not set should return proper error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: ['test'], + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + threshold: [], + timeWindowSize: 1, + timeWindowUnit: 's', + thresholdComparator: '<', + timeField: '', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.threshold0.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.threshold0[0]).toBe('Threshold 0 is required.'); + }); + + test('if threshold1 property is needed by thresholdComparator but not set should return proper error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: ['test'], + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + threshold: [1], + timeWindowSize: 1, + timeWindowUnit: 's', + thresholdComparator: 'between', + timeField: '', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.threshold1.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.threshold1[0]).toBe('Threshold 1 is required.'); + }); + + test('if threshold0 property greater than threshold1 property should return proper error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: ['test'], + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + threshold: [10, 1], + timeWindowSize: 1, + timeWindowUnit: 's', + thresholdComparator: 'between', + timeField: '', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.threshold1.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.threshold1[0]).toBe( + 'Threshold 1 must be > Threshold 0.' + ); + }); + + test('if size property is < 0 should return proper error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: ['test'], + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n`, + size: -1, + timeWindowSize: 1, + timeWindowUnit: 's', + threshold: [0], + timeField: '', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.size.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.size[0]).toBe( + 'Size must be between 0 and 10,000.' + ); + }); + + test('if size property is 0 should not return error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: ['test'], + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n`, + size: 0, + timeWindowSize: 1, + timeWindowUnit: 's', + threshold: [0], + timeField: '', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.size.length).toBe(0); + }); + + test('if size property is > 10000 should return proper error message', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: ['test'], + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n`, + size: 25000, + timeWindowSize: 1, + timeWindowUnit: 's', + threshold: [0], + timeField: '', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.size.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.size[0]).toBe( + 'Size must be between 0 and 10,000.' + ); + }); + + test('should not return error messages if all is correct', () => { + const initialParams: EsQueryRuleParams<SearchType.esQuery> = { + index: ['test'], + esQuery: '{"query":{"match_all":{}}}', + size: 250, + timeWindowSize: 100, + timeWindowUnit: 's', + threshold: [0], + timeField: '@timestamp', + excludeHitsFromPreviousRun: true, + }; + expect(validateExpression(initialParams).errors.size.length).toBe(0); + expect(hasExpressionValidationErrors(initialParams)).toBe(false); + }); +}); diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/validation.ts b/x-pack/plugins/stack_alerts/public/rule_types/es_query/validation.ts new file mode 100644 index 0000000000000..7ae70ac891029 --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/validation.ts @@ -0,0 +1,156 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { defaultsDeep, isNil } from 'lodash'; +import { i18n } from '@kbn/i18n'; +import { ValidationResult, builtInComparators } from '@kbn/triggers-actions-ui-plugin/public'; +import { EsQueryRuleParams, ExpressionErrors } from './types'; +import { isSearchSourceRule } from './util'; +import { EXPRESSION_ERRORS } from './constants'; + +export const validateExpression = (ruleParams: EsQueryRuleParams): ValidationResult => { + const { size, threshold, timeWindowSize, thresholdComparator } = ruleParams; + const validationResult = { errors: {} }; + const errors: ExpressionErrors = defaultsDeep({}, EXPRESSION_ERRORS); + validationResult.errors = errors; + + if (!('index' in ruleParams) && !ruleParams.searchType) { + errors.searchType.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredSearchType', { + defaultMessage: 'Query type is required.', + }) + ); + + return validationResult; + } + + if (!threshold || threshold.length === 0 || threshold[0] === undefined) { + errors.threshold0.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredThreshold0Text', { + defaultMessage: 'Threshold 0 is required.', + }) + ); + } + if ( + thresholdComparator && + builtInComparators[thresholdComparator].requiredValues > 1 && + (!threshold || + threshold[1] === undefined || + (threshold && threshold.length < builtInComparators[thresholdComparator!].requiredValues)) + ) { + errors.threshold1.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredThreshold1Text', { + defaultMessage: 'Threshold 1 is required.', + }) + ); + } + if (threshold && threshold.length === 2 && threshold[0] > threshold[1]) { + errors.threshold1.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.greaterThenThreshold0Text', { + defaultMessage: 'Threshold 1 must be > Threshold 0.', + }) + ); + } + if (!timeWindowSize) { + errors.timeWindowSize.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredTimeWindowSizeText', { + defaultMessage: 'Time window size is required.', + }) + ); + } + + if (isNil(size)) { + errors.size.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredSizeText', { + defaultMessage: 'Size is required.', + }) + ); + } + if ((size && size < 0) || size > 10000) { + errors.size.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.invalidSizeRangeText', { + defaultMessage: 'Size must be between 0 and {max, number}.', + values: { max: 10000 }, + }) + ); + } + + /** + * Skip esQuery and index params check if it is search source rule, + * since it should contain searchConfiguration instead of esQuery and index. + */ + const isSearchSource = isSearchSourceRule(ruleParams); + if (isSearchSource) { + if (!ruleParams.searchConfiguration) { + errors.searchConfiguration.push( + i18n.translate( + 'xpack.stackAlerts.esQuery.ui.validation.error.requiredSearchConfiguration', + { + defaultMessage: 'Search source configuration is required.', + } + ) + ); + } else if (!ruleParams.searchConfiguration.index) { + errors.index.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredDataViewText', { + defaultMessage: 'Data view is required.', + }) + ); + } + return validationResult; + } + + if (!ruleParams.index || ruleParams.index.length === 0) { + errors.index.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredIndexText', { + defaultMessage: 'Index is required.', + }) + ); + } + + if (!ruleParams.timeField) { + errors.timeField.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredTimeFieldText', { + defaultMessage: 'Time field is required.', + }) + ); + } + + if (!ruleParams.esQuery) { + errors.esQuery.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredQueryText', { + defaultMessage: 'Elasticsearch query is required.', + }) + ); + } else { + try { + const parsedQuery = JSON.parse(ruleParams.esQuery); + if (!parsedQuery.query) { + errors.esQuery.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.requiredEsQueryText', { + defaultMessage: `Query field is required.`, + }) + ); + } + } catch (err) { + errors.esQuery.push( + i18n.translate('xpack.stackAlerts.esQuery.ui.validation.error.jsonQueryText', { + defaultMessage: 'Query must be valid JSON.', + }) + ); + } + } + + return validationResult; +}; + +export const hasExpressionValidationErrors = (ruleParams: EsQueryRuleParams) => { + const { errors: validationErrors } = validateExpression(ruleParams); + return Object.keys(validationErrors).some( + (key) => validationErrors[key] && validationErrors[key].length + ); +}; diff --git a/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/index.ts b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/index.ts new file mode 100644 index 0000000000000..0ed978e6edd0e --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/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 { lazy } from 'react'; +import { i18n } from '@kbn/i18n'; +import { RuleTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; +import { validateExpression } from './validation'; +import { GeoContainmentAlertParams } from './types'; + +export function getRuleType(): RuleTypeModel<GeoContainmentAlertParams> { + return { + id: '.geo-containment', + description: i18n.translate('xpack.stackAlerts.geoContainment.descriptionText', { + defaultMessage: 'Alert when an entity is contained within a geo boundary.', + }), + iconClass: 'globe', + documentationUrl: null, + ruleParamsExpression: lazy(() => import('./query_builder')), + validate: validateExpression, + requiresAppContext: false, + }; +} diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/__snapshots__/geo_containment_alert_type_expression.test.tsx.snap b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/__snapshots__/geo_containment_alert_type_expression.test.tsx.snap similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/__snapshots__/geo_containment_alert_type_expression.test.tsx.snap rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/__snapshots__/geo_containment_alert_type_expression.test.tsx.snap diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/__snapshots__/entity_by_expression.test.tsx.snap b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/__snapshots__/entity_by_expression.test.tsx.snap similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/__snapshots__/entity_by_expression.test.tsx.snap rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/__snapshots__/entity_by_expression.test.tsx.snap diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_by_expression.test.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.test.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_by_expression.test.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_by_expression.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_by_expression.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/expressions/entity_index_expression.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/geo_containment_alert_type_expression.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/geo_containment_alert_type_expression.test.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/geo_containment_alert_type_expression.test.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/geo_containment_alert_type_expression.test.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/index.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/__snapshots__/geo_index_pattern_select.test.tsx.snap b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/util_components/__snapshots__/geo_index_pattern_select.test.tsx.snap similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/__snapshots__/geo_index_pattern_select.test.tsx.snap rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/util_components/__snapshots__/geo_index_pattern_select.test.tsx.snap diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/expression_with_popover.tsx b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/util_components/expression_with_popover.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/expression_with_popover.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/util_components/expression_with_popover.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/util_components/geo_index_pattern_select.test.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.test.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/util_components/geo_index_pattern_select.test.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/util_components/single_field_select.tsx similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/query_builder/util_components/single_field_select.tsx diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/readme.md b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/readme.md similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/readme.md rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/readme.md diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/types.ts b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/types.ts similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/types.ts rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/types.ts diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/validation.test.ts b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/validation.test.ts similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/validation.test.ts rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/validation.test.ts diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/validation.ts b/x-pack/plugins/stack_alerts/public/rule_types/geo_containment/validation.ts similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/geo_containment/validation.ts rename to x-pack/plugins/stack_alerts/public/rule_types/geo_containment/validation.ts diff --git a/x-pack/plugins/stack_alerts/public/rule_types/index.ts b/x-pack/plugins/stack_alerts/public/rule_types/index.ts new file mode 100644 index 0000000000000..e5dae6ff1982c --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/index.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { TriggersAndActionsUIPublicPluginSetup } from '@kbn/triggers-actions-ui-plugin/public'; +import { PluginSetupContract as AlertingSetup } from '@kbn/alerting-plugin/public'; +import { getRuleType as getGeoContainmentRuleType } from './geo_containment'; +import { getRuleType as getThresholdRuleType } from './threshold'; +import { getRuleType as getEsQueryRuleType } from './es_query'; + +export function registerRuleTypes({ + ruleTypeRegistry, + alerting, +}: { + ruleTypeRegistry: TriggersAndActionsUIPublicPluginSetup['ruleTypeRegistry']; + alerting: AlertingSetup; +}) { + ruleTypeRegistry.register(getGeoContainmentRuleType()); + ruleTypeRegistry.register(getThresholdRuleType()); + ruleTypeRegistry.register(getEsQueryRuleType(alerting)); +} diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.scss b/x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.scss similarity index 100% rename from x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.scss rename to x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.scss diff --git a/x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.test.tsx new file mode 100644 index 0000000000000..e960ff6b980d6 --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.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 React from 'react'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; +import { act } from 'react-dom/test-utils'; +import IndexThresholdRuleTypeExpression, { DEFAULT_VALUES } from './expression'; +import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; +import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; +import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; +import { IndexThresholdRuleParams } from './types'; +import { validateExpression } from './validation'; +import { + builtInAggregationTypes, + builtInComparators, + getTimeUnitLabel, + TIME_UNITS, +} from '@kbn/triggers-actions-ui-plugin/public'; + +jest.mock('@kbn/triggers-actions-ui-plugin/public', () => { + const original = jest.requireActual('@kbn/triggers-actions-ui-plugin/public'); + return { + ...original, + getIndexPatterns: () => { + return ['index1', 'index2']; + }, + getTimeFieldOptions: () => { + return [ + { + text: '@timestamp', + value: '@timestamp', + }, + ]; + }, + getFields: () => { + return Promise.resolve([ + { + name: '@timestamp', + type: 'date', + }, + { + name: 'field', + type: 'text', + }, + ]); + }, + getIndexOptions: () => { + return Promise.resolve([ + { + label: 'indexOption', + options: [ + { + label: 'index1', + value: 'index1', + }, + { + label: 'index2', + value: 'index2', + }, + ], + }, + ]); + }, + }; +}); + +const dataMock = dataPluginMock.createStartContract(); +const dataViewMock = dataViewPluginMocks.createStartContract(); +const chartsStartMock = chartPluginMock.createStartContract(); + +describe('IndexThresholdRuleTypeExpression', () => { + function getAlertParams(overrides = {}) { + return { + index: 'test-index', + aggType: 'count', + thresholdComparator: '>', + threshold: [0], + timeWindowSize: 15, + timeWindowUnit: 's', + ...overrides, + }; + } + async function setup(ruleParams: IndexThresholdRuleParams) { + const { errors } = validateExpression(ruleParams); + + const wrapper = mountWithIntl( + <IndexThresholdRuleTypeExpression + ruleInterval="1m" + ruleThrottle="1m" + alertNotifyWhen="onThrottleInterval" + ruleParams={ruleParams} + setRuleParams={() => {}} + setRuleProperty={() => {}} + errors={errors} + data={dataMock} + dataViews={dataViewMock} + defaultActionGroupId="" + actionGroups={[]} + charts={chartsStartMock} + /> + ); + + await act(async () => { + await nextTick(); + wrapper.update(); + }); + return wrapper; + } + + test(`should render IndexThresholdRuleTypeExpression with expected components when aggType doesn't require field`, async () => { + const wrapper = await setup(getAlertParams()); + expect(wrapper.find('[data-test-subj="indexSelectPopover"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="whenExpression"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="groupByExpression"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="aggTypeExpression"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="thresholdExpression"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="forLastExpression"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="visualizationPlaceholder"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="thresholdVisualization"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="filterKuery"]').exists()).toBeTruthy(); + }); + + test(`should render IndexThresholdRuleTypeExpression with expected components when aggType does require field`, async () => { + const wrapper = await setup(getAlertParams({ aggType: 'avg' })); + expect(wrapper.find('[data-test-subj="indexSelectPopover"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="whenExpression"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="groupByExpression"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="aggTypeExpression"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="thresholdExpression"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="forLastExpression"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="visualizationPlaceholder"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="thresholdVisualization"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="filterKuery"]').exists()).toBeTruthy(); + }); + + test(`should render IndexThresholdRuleTypeExpression with visualization when there are no expression errors`, async () => { + const wrapper = await setup(getAlertParams({ timeField: '@timestamp' })); + expect(wrapper.find('[data-test-subj="visualizationPlaceholder"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="thresholdVisualization"]').exists()).toBeTruthy(); + }); + + test(`should set default alert params when params are undefined`, async () => { + const wrapper = await setup( + getAlertParams({ + aggType: undefined, + thresholdComparator: undefined, + timeWindowSize: undefined, + timeWindowUnit: undefined, + groupBy: undefined, + threshold: undefined, + }) + ); + + expect(wrapper.find('button[data-test-subj="selectIndexExpression"]').text()).toEqual( + 'index test-index' + ); + expect(wrapper.find('button[data-test-subj="whenExpression"]').text()).toEqual( + `when ${builtInAggregationTypes[DEFAULT_VALUES.AGGREGATION_TYPE].text}` + ); + expect(wrapper.find('button[data-test-subj="groupByExpression"]').text()).toEqual( + `over ${DEFAULT_VALUES.GROUP_BY} documents ` + ); + expect(wrapper.find('[data-test-subj="aggTypeExpression"]').exists()).toBeFalsy(); + expect(wrapper.find('button[data-test-subj="thresholdPopover"]').text()).toEqual( + `${builtInComparators[DEFAULT_VALUES.THRESHOLD_COMPARATOR].text} ` + ); + expect(wrapper.find('button[data-test-subj="forLastExpression"]').text()).toEqual( + `for the last ${DEFAULT_VALUES.TIME_WINDOW_SIZE} ${getTimeUnitLabel( + DEFAULT_VALUES.TIME_WINDOW_UNIT as TIME_UNITS, + DEFAULT_VALUES.TIME_WINDOW_SIZE.toString() + )}` + ); + expect( + wrapper.find('EuiEmptyPrompt[data-test-subj="visualizationPlaceholder"]').text() + ).toEqual(`Complete the expression to generate a preview.`); + expect(wrapper.find('input[data-test-subj="filterKuery"]').text()).toEqual(''); + }); + + test(`should use alert params when params are defined`, async () => { + const aggType = 'avg'; + const thresholdComparator = 'between'; + const timeWindowSize = 987; + const timeWindowUnit = 's'; + const threshold = [3, 1003]; + const groupBy = 'top'; + const termSize = '27'; + const termField = 'host.name'; + + const wrapper = await setup( + getAlertParams({ + aggType, + thresholdComparator, + timeWindowSize, + timeWindowUnit, + termSize, + termField, + groupBy, + threshold, + }) + ); + + expect(wrapper.find('button[data-test-subj="whenExpression"]').text()).toEqual( + `when ${builtInAggregationTypes[aggType].text}` + ); + expect(wrapper.find('button[data-test-subj="groupByExpression"]').text()).toEqual( + `grouped over ${groupBy} ${termSize} '${termField}'` + ); + + expect(wrapper.find('button[data-test-subj="thresholdPopover"]').text()).toEqual( + `${builtInComparators[thresholdComparator].text} ${threshold[0]} AND ${threshold[1]}` + ); + expect(wrapper.find('button[data-test-subj="forLastExpression"]').text()).toEqual( + `for the last ${timeWindowSize} ${getTimeUnitLabel( + timeWindowUnit as TIME_UNITS, + timeWindowSize.toString() + )}` + ); + expect( + wrapper.find('EuiEmptyPrompt[data-test-subj="visualizationPlaceholder"]').text() + ).toEqual(`Complete the expression to generate a preview.`); + }); +}); diff --git a/x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.tsx b/x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.tsx new file mode 100644 index 0000000000000..9348c97e98673 --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.tsx @@ -0,0 +1,342 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, Fragment, useEffect, useCallback, ChangeEvent } from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + EuiSpacer, + EuiCallOut, + EuiEmptyPrompt, + EuiText, + EuiTitle, + EuiFieldSearch, + EuiFormRow, +} from '@elastic/eui'; +import { HttpSetup } from '@kbn/core/public'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { + getFields, + COMPARATORS, + builtInComparators, + OfExpression, + ThresholdExpression, + ForLastExpression, + GroupByExpression, + WhenExpression, + builtInAggregationTypes, + RuleTypeParamsExpressionProps, +} from '@kbn/triggers-actions-ui-plugin/public'; +import { ThresholdVisualization } from './visualization'; +import { IndexThresholdRuleParams } from './types'; +import './expression.scss'; +import { IndexSelectPopover } from '../components/index_select_popover'; + +export const DEFAULT_VALUES = { + AGGREGATION_TYPE: 'count', + TERM_SIZE: 5, + THRESHOLD_COMPARATOR: COMPARATORS.GREATER_THAN, + TIME_WINDOW_SIZE: 5, + TIME_WINDOW_UNIT: 'm', + THRESHOLD: [1000], + GROUP_BY: 'all', +}; + +const expressionFieldsWithValidation = [ + 'index', + 'timeField', + 'aggField', + 'termSize', + 'termField', + 'threshold0', + 'threshold1', + 'timeWindowSize', +]; + +interface KibanaDeps { + http: HttpSetup; +} + +function isString(value: unknown): value is string { + return typeof value === 'string'; +} + +// normalize the `index` parameter to be a string array +function indexParamToArray(index: string | string[]): string[] { + if (!index) return []; + return isString(index) ? [index] : index; +} + +export const IndexThresholdRuleTypeExpression: React.FunctionComponent< + Omit<RuleTypeParamsExpressionProps<IndexThresholdRuleParams>, 'unifiedSearch'> +> = ({ ruleParams, ruleInterval, setRuleParams, setRuleProperty, errors, charts, data }) => { + const { + index, + timeField, + aggType, + aggField, + groupBy, + termSize, + termField, + thresholdComparator, + threshold, + timeWindowSize, + timeWindowUnit, + filterKuery, + } = ruleParams; + + const indexArray = indexParamToArray(index); + const { http } = useKibana<KibanaDeps>().services; + + const [esFields, setEsFields] = useState< + Array<{ + name: string; + type: string; + normalizedType: string; + searchable: boolean; + aggregatable: boolean; + }> + >([]); + + const hasExpressionErrors = !!Object.keys(errors).find( + (errorKey) => + expressionFieldsWithValidation.includes(errorKey) && + errors[errorKey].length >= 1 && + ruleParams[errorKey as keyof IndexThresholdRuleParams] !== undefined + ); + + const cannotShowVisualization = !!Object.keys(errors).find( + (errorKey) => expressionFieldsWithValidation.includes(errorKey) && errors[errorKey].length >= 1 + ); + + const expressionErrorMessage = i18n.translate( + 'xpack.stackAlerts.threshold.ui.alertParams.fixErrorInExpressionBelowValidationMessage', + { + defaultMessage: 'Expression contains errors.', + } + ); + + const setDefaultExpressionValues = async () => { + setRuleProperty('params', { + ...ruleParams, + aggType: aggType ?? DEFAULT_VALUES.AGGREGATION_TYPE, + termSize: termSize ?? DEFAULT_VALUES.TERM_SIZE, + thresholdComparator: thresholdComparator ?? DEFAULT_VALUES.THRESHOLD_COMPARATOR, + timeWindowSize: timeWindowSize ?? DEFAULT_VALUES.TIME_WINDOW_SIZE, + timeWindowUnit: timeWindowUnit ?? DEFAULT_VALUES.TIME_WINDOW_UNIT, + groupBy: groupBy ?? DEFAULT_VALUES.GROUP_BY, + threshold: threshold ?? DEFAULT_VALUES.THRESHOLD, + }); + + if (indexArray.length > 0) { + await refreshEsFields(indexArray); + } + }; + + const refreshEsFields = async (indices: string[]) => { + const currentEsFields = await getFields(http, indices); + setEsFields(currentEsFields); + }; + + const handleFilterChange = useCallback( + (e: ChangeEvent<HTMLInputElement>) => { + setRuleParams('filterKuery', e.target.value || undefined); + }, + [setRuleParams] + ); + + useEffect(() => { + setDefaultExpressionValues(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + return ( + <Fragment> + {hasExpressionErrors ? ( + <Fragment> + <EuiSpacer /> + <EuiCallOut color="danger" size="s" title={expressionErrorMessage} /> + <EuiSpacer /> + </Fragment> + ) : null} + <EuiTitle size="xs"> + <h5> + <FormattedMessage + id="xpack.stackAlerts.threshold.ui.selectIndex" + defaultMessage="Select an index" + /> + </h5> + </EuiTitle> + <EuiSpacer size="s" /> + <IndexSelectPopover + index={indexArray} + data-test-subj="indexSelectPopover" + esFields={esFields} + timeField={timeField} + errors={errors} + onIndexChange={async (indices: string[]) => { + setRuleParams('index', indices); + + // reset expression fields if indices are deleted + if (indices.length === 0) { + setRuleProperty('params', { + ...ruleParams, + index: indices, + aggType: DEFAULT_VALUES.AGGREGATION_TYPE, + termSize: DEFAULT_VALUES.TERM_SIZE, + thresholdComparator: DEFAULT_VALUES.THRESHOLD_COMPARATOR, + timeWindowSize: DEFAULT_VALUES.TIME_WINDOW_SIZE, + timeWindowUnit: DEFAULT_VALUES.TIME_WINDOW_UNIT, + groupBy: DEFAULT_VALUES.GROUP_BY, + threshold: DEFAULT_VALUES.THRESHOLD, + timeField: '', + }); + } else { + await refreshEsFields(indices); + } + }} + onTimeFieldChange={(updatedTimeField: string) => + setRuleParams('timeField', updatedTimeField) + } + /> + <WhenExpression + display="fullWidth" + data-test-subj="whenExpression" + aggType={aggType ?? DEFAULT_VALUES.AGGREGATION_TYPE} + onChangeSelectedAggType={(selectedAggType: string) => + setRuleParams('aggType', selectedAggType) + } + /> + {aggType && builtInAggregationTypes[aggType].fieldRequired ? ( + <OfExpression + aggField={aggField} + data-test-subj="aggTypeExpression" + fields={esFields} + aggType={aggType} + errors={errors} + display="fullWidth" + onChangeSelectedAggField={(selectedAggField?: string) => + setRuleParams('aggField', selectedAggField) + } + /> + ) : null} + <GroupByExpression + groupBy={groupBy || DEFAULT_VALUES.GROUP_BY} + data-test-subj="groupByExpression" + termField={termField} + termSize={termSize} + errors={errors} + fields={esFields} + display="fullWidth" + onChangeSelectedGroupBy={(selectedGroupBy) => setRuleParams('groupBy', selectedGroupBy)} + onChangeSelectedTermField={(selectedTermField) => + setRuleParams('termField', selectedTermField) + } + onChangeSelectedTermSize={(selectedTermSize) => setRuleParams('termSize', selectedTermSize)} + /> + <EuiSpacer /> + <EuiTitle size="xs"> + <h5> + <FormattedMessage + id="xpack.stackAlerts.threshold.ui.conditionPrompt" + defaultMessage="Define the condition" + /> + </h5> + </EuiTitle> + <EuiSpacer size="s" /> + <ThresholdExpression + thresholdComparator={thresholdComparator ?? DEFAULT_VALUES.THRESHOLD_COMPARATOR} + threshold={threshold} + data-test-subj="thresholdExpression" + errors={errors} + display="fullWidth" + popupPosition={'upLeft'} + onChangeSelectedThreshold={(selectedThresholds) => + setRuleParams('threshold', selectedThresholds) + } + onChangeSelectedThresholdComparator={(selectedThresholdComparator) => + setRuleParams('thresholdComparator', selectedThresholdComparator) + } + /> + <ForLastExpression + data-test-subj="forLastExpression" + popupPosition={'upLeft'} + timeWindowSize={timeWindowSize ?? DEFAULT_VALUES.TIME_WINDOW_SIZE} + timeWindowUnit={timeWindowUnit ?? DEFAULT_VALUES.TIME_WINDOW_UNIT} + display="fullWidth" + errors={errors} + onChangeWindowSize={(selectedWindowSize: number | undefined) => + setRuleParams('timeWindowSize', selectedWindowSize) + } + onChangeWindowUnit={(selectedWindowUnit: string) => + setRuleParams('timeWindowUnit', selectedWindowUnit) + } + /> + <EuiSpacer /> + <EuiTitle size="xs"> + <h5> + <FormattedMessage + id="xpack.stackAlerts.threshold.ui.filterTitle" + defaultMessage="Filter (Optional)" + /> + </h5> + </EuiTitle> + <EuiSpacer size="s" /> + <EuiFormRow + helpText={i18n.translate('xpack.stackAlerts.threshold.ui.filterKQLHelpText', { + defaultMessage: 'Use a KQL expression to limit the scope of your alert trigger.', + })} + fullWidth + display="rowCompressed" + isInvalid={errors.filterKuery.length > 0} + error={errors.filterKuery} + > + <EuiFieldSearch + data-test-subj="filterKuery" + onChange={handleFilterChange} + value={filterKuery} + fullWidth + isInvalid={errors.filterKuery.length > 0} + /> + </EuiFormRow> + <EuiSpacer /> + <div className="actAlertVisualization__chart"> + {cannotShowVisualization ? ( + <Fragment> + <EuiEmptyPrompt + data-test-subj="visualizationPlaceholder" + iconType="visBarVertical" + body={ + <EuiText color="subdued"> + <FormattedMessage + id="xpack.stackAlerts.threshold.ui.previewAlertVisualizationDescription" + defaultMessage="Complete the expression to generate a preview." + /> + </EuiText> + } + /> + </Fragment> + ) : ( + <Fragment> + <ThresholdVisualization + data-test-subj="thresholdVisualization" + ruleParams={ruleParams} + alertInterval={ruleInterval} + aggregationTypes={builtInAggregationTypes} + comparators={builtInComparators} + charts={charts} + dataFieldsFormats={data!.fieldFormats} + /> + </Fragment> + )} + </div> + </Fragment> + ); +}; + +// eslint-disable-next-line import/no-default-export +export { IndexThresholdRuleTypeExpression as default }; diff --git a/x-pack/plugins/stack_alerts/public/rule_types/threshold/index.ts b/x-pack/plugins/stack_alerts/public/rule_types/threshold/index.ts new file mode 100644 index 0000000000000..3d793173bc8e0 --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/threshold/index.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 { lazy } from 'react'; +import { i18n } from '@kbn/i18n'; +import { RuleTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; +import { validateExpression } from './validation'; +import { IndexThresholdRuleParams } from './types'; + +export function getRuleType(): RuleTypeModel<IndexThresholdRuleParams> { + return { + id: '.index-threshold', + description: i18n.translate('xpack.stackAlerts.threshold.ui.alertType.descriptionText', { + defaultMessage: 'Alert when an aggregated query meets the threshold.', + }), + iconClass: 'alert', + documentationUrl: (docLinks) => docLinks.links.alerting.indexThreshold, + ruleParamsExpression: lazy(() => import('./expression')), + validate: validateExpression, + defaultActionMessage: i18n.translate( + 'xpack.stackAlerts.threshold.ui.alertType.defaultActionMessage', + { + defaultMessage: `alert '\\{\\{alertName\\}\\}' is active for group '\\{\\{context.group\\}\\}': + +- Value: \\{\\{context.value\\}\\} +- Conditions Met: \\{\\{context.conditions\\}\\} over \\{\\{params.timeWindowSize\\}\\}\\{\\{params.timeWindowUnit\\}\\} +- Timestamp: \\{\\{context.date\\}\\}`, + } + ), + requiresAppContext: false, + }; +} diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/index_threshold_api.ts b/x-pack/plugins/stack_alerts/public/rule_types/threshold/index_threshold_api.ts similarity index 82% rename from x-pack/plugins/stack_alerts/public/alert_types/threshold/index_threshold_api.ts rename to x-pack/plugins/stack_alerts/public/rule_types/threshold/index_threshold_api.ts index 9dfcfa0bffc31..44f44ce88e86b 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/index_threshold_api.ts +++ b/x-pack/plugins/stack_alerts/public/rule_types/threshold/index_threshold_api.ts @@ -7,12 +7,12 @@ import { HttpSetup } from '@kbn/core/public'; import { TimeSeriesResult } from '@kbn/triggers-actions-ui-plugin/common'; -import { IndexThresholdAlertParams } from './types'; +import { IndexThresholdRuleParams } from './types'; const INDEX_THRESHOLD_DATA_API_ROOT = '/internal/triggers_actions_ui/data'; -export interface GetThresholdAlertVisualizationDataParams { - model: IndexThresholdAlertParams; +export interface GetThresholdRuleVisualizationDataParams { + model: IndexThresholdRuleParams; visualizeOptions: { rangeFrom: string; rangeTo: string; @@ -21,11 +21,11 @@ export interface GetThresholdAlertVisualizationDataParams { http: HttpSetup; } -export async function getThresholdAlertVisualizationData({ +export async function getThresholdRuleVisualizationData({ model, visualizeOptions, http, -}: GetThresholdAlertVisualizationDataParams): Promise<TimeSeriesResult> { +}: GetThresholdRuleVisualizationDataParams): Promise<TimeSeriesResult> { const timeSeriesQueryParams = { index: model.index, timeField: model.timeField, diff --git a/x-pack/plugins/stack_alerts/public/rule_types/threshold/types.ts b/x-pack/plugins/stack_alerts/public/rule_types/threshold/types.ts new file mode 100644 index 0000000000000..83679f34fbb53 --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/threshold/types.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 { RuleTypeParams } from '@kbn/alerting-plugin/common'; + +export interface Comparator { + text: string; + value: string; + requiredValues: number; +} + +export interface AggregationType { + text: string; + fieldRequired: boolean; + value: string; + validNormalizedTypes: string[]; +} + +export interface GroupByType { + text: string; + sizeRequired: boolean; + value: string; + validNormalizedTypes: string[]; +} + +export interface IndexThresholdRuleParams extends RuleTypeParams { + index: string | string[]; + timeField?: string; + aggType: string; + aggField?: string; + groupBy?: string; + termSize?: number; + termField?: string; + thresholdComparator?: string; + threshold: number[]; + timeWindowSize: number; + timeWindowUnit: string; + filterKuery?: string; +} diff --git a/x-pack/plugins/stack_alerts/public/rule_types/threshold/validation.test.ts b/x-pack/plugins/stack_alerts/public/rule_types/threshold/validation.test.ts new file mode 100644 index 0000000000000..5ac1466c794ec --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/threshold/validation.test.ts @@ -0,0 +1,114 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IndexThresholdRuleParams } from './types'; +import { validateExpression } from './validation'; + +describe('expression params validation', () => { + test('if index property is invalid should return proper error message', () => { + const initialParams: IndexThresholdRuleParams = { + index: [], + aggType: 'count', + threshold: [], + timeWindowSize: 1, + timeWindowUnit: 's', + }; + expect(validateExpression(initialParams).errors.index.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.index[0]).toBe('Index is required.'); + }); + test('if timeField property is not defined should return proper error message', () => { + const initialParams: IndexThresholdRuleParams = { + index: ['test'], + aggType: 'count', + threshold: [], + timeWindowSize: 1, + timeWindowUnit: 's', + }; + expect(validateExpression(initialParams).errors.timeField.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.timeField[0]).toBe('Time field is required.'); + }); + test('if aggField property is invalid should return proper error message', () => { + const initialParams: IndexThresholdRuleParams = { + index: 'test', + aggType: 'avg', + threshold: [], + timeWindowSize: 1, + timeWindowUnit: 's', + }; + expect(validateExpression(initialParams).errors.aggField.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.aggField[0]).toBe( + 'Aggregation field is required.' + ); + }); + test('if termSize property is not set should return proper error message', () => { + const initialParams: IndexThresholdRuleParams = { + index: ['test'], + aggType: 'count', + groupBy: 'top', + threshold: [], + timeWindowSize: 1, + timeWindowUnit: 's', + }; + expect(validateExpression(initialParams).errors.termSize.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.termSize[0]).toBe('Term size is required.'); + }); + test('if termField property is not set should return proper error message', () => { + const initialParams: IndexThresholdRuleParams = { + index: ['test'], + aggType: 'count', + groupBy: 'top', + threshold: [], + timeWindowSize: 1, + timeWindowUnit: 's', + }; + expect(validateExpression(initialParams).errors.termField.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.termField[0]).toBe('Term field is required.'); + }); + test('if threshold0 property is not set should return proper error message', () => { + const initialParams: IndexThresholdRuleParams = { + index: ['test'], + aggType: 'count', + groupBy: 'top', + threshold: [], + timeWindowSize: 1, + timeWindowUnit: 's', + thresholdComparator: '<', + }; + expect(validateExpression(initialParams).errors.threshold0.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.threshold0[0]).toBe('Threshold0 is required.'); + }); + test('if threshold1 property is not set should return proper error message', () => { + const initialParams: IndexThresholdRuleParams = { + index: ['test'], + aggType: 'count', + groupBy: 'top', + threshold: [1], + timeWindowSize: 1, + timeWindowUnit: 's', + thresholdComparator: 'between', + }; + expect(validateExpression(initialParams).errors.threshold1.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.threshold1[0]).toBe('Threshold1 is required.'); + }); + + test('if filterKuery is invalid should return proper error message', () => { + const initialParams: IndexThresholdRuleParams = { + index: ['test'], + aggType: 'count', + groupBy: 'top', + threshold: [1], + timeWindowSize: 1, + timeWindowUnit: 's', + thresholdComparator: 'between', + filterKuery: 'group:', + }; + expect(validateExpression(initialParams).errors.filterKuery.length).toBeGreaterThan(0); + expect(validateExpression(initialParams).errors.filterKuery[0]).toBe( + 'Filter query is invalid.' + ); + }); +}); diff --git a/x-pack/plugins/stack_alerts/public/rule_types/threshold/validation.ts b/x-pack/plugins/stack_alerts/public/rule_types/threshold/validation.ts new file mode 100644 index 0000000000000..bae66659da5ff --- /dev/null +++ b/x-pack/plugins/stack_alerts/public/rule_types/threshold/validation.ts @@ -0,0 +1,138 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { toElasticsearchQuery, fromKueryExpression } from '@kbn/es-query'; +import { i18n } from '@kbn/i18n'; +import { + ValidationResult, + builtInGroupByTypes, + builtInAggregationTypes, + builtInComparators, +} from '@kbn/triggers-actions-ui-plugin/public'; +import { IndexThresholdRuleParams } from './types'; + +export const validateExpression = (alertParams: IndexThresholdRuleParams): ValidationResult => { + const { + index, + timeField, + aggType, + aggField, + groupBy, + termSize, + termField, + threshold, + timeWindowSize, + thresholdComparator, + filterKuery, + } = alertParams; + const validationResult = { errors: {} }; + const errors = { + aggField: new Array<string>(), + termSize: new Array<string>(), + termField: new Array<string>(), + timeWindowSize: new Array<string>(), + threshold0: new Array<string>(), + threshold1: new Array<string>(), + index: new Array<string>(), + timeField: new Array<string>(), + filterKuery: new Array<string>(), + }; + validationResult.errors = errors; + + if (!!filterKuery) { + try { + toElasticsearchQuery(fromKueryExpression(filterKuery as string)); + } catch (e) { + errors.filterKuery.push( + i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.invalidKql', { + defaultMessage: 'Filter query is invalid.', + }) + ); + } + } + + if (!index || index.length === 0) { + errors.index.push( + i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredIndexText', { + defaultMessage: 'Index is required.', + }) + ); + } + if (!timeField) { + errors.timeField.push( + i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredTimeFieldText', { + defaultMessage: 'Time field is required.', + }) + ); + } + if (aggType && builtInAggregationTypes[aggType].fieldRequired && !aggField) { + errors.aggField.push( + i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredAggFieldText', { + defaultMessage: 'Aggregation field is required.', + }) + ); + } + if ( + groupBy && + builtInGroupByTypes[groupBy] && + builtInGroupByTypes[groupBy].sizeRequired && + !termSize + ) { + errors.termSize.push( + i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredTermSizedText', { + defaultMessage: 'Term size is required.', + }) + ); + } + if ( + groupBy && + builtInGroupByTypes[groupBy].validNormalizedTypes && + builtInGroupByTypes[groupBy].validNormalizedTypes.length > 0 && + !termField + ) { + errors.termField.push( + i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredTermFieldText', { + defaultMessage: 'Term field is required.', + }) + ); + } + if (!timeWindowSize) { + errors.timeWindowSize.push( + i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredTimeWindowSizeText', { + defaultMessage: 'Time window size is required.', + }) + ); + } + if (!threshold || threshold.length === 0 || threshold[0] === undefined) { + errors.threshold0.push( + i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredThreshold0Text', { + defaultMessage: 'Threshold0 is required.', + }) + ); + } + if ( + thresholdComparator && + builtInComparators[thresholdComparator].requiredValues > 1 && + (!threshold || + threshold[1] === undefined || + (threshold && threshold.length < builtInComparators[thresholdComparator!].requiredValues)) + ) { + errors.threshold1.push( + i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.requiredThreshold1Text', { + defaultMessage: 'Threshold1 is required.', + }) + ); + } + if (threshold && threshold.length === 2 && threshold[0] > threshold[1]) { + errors.threshold1.push( + i18n.translate('xpack.stackAlerts.threshold.ui.validation.error.greaterThenThreshold0Text', { + defaultMessage: 'Threshold1 should be > Threshold0.', + }) + ); + } + return validationResult; +}; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/threshold/visualization.test.tsx similarity index 90% rename from x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.test.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/threshold/visualization.test.tsx index 643d6c79afc7d..7a9a07ad93b37 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.test.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/threshold/visualization.test.tsx @@ -22,7 +22,7 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; jest.mock('@kbn/kibana-react-plugin/public'); jest.mock('./index_threshold_api', () => ({ - getThresholdAlertVisualizationData: jest.fn(() => + getThresholdRuleVisualizationData: jest.fn(() => Promise.resolve({ results: [ { group: 'a', metrics: [['b', 2]] }, @@ -32,7 +32,7 @@ jest.mock('./index_threshold_api', () => ({ ), })); -const { getThresholdAlertVisualizationData } = jest.requireMock('./index_threshold_api'); +const { getThresholdRuleVisualizationData } = jest.requireMock('./index_threshold_api'); const dataMock = dataPluginMock.createStartContract(); const chartsStartMock = chartPluginMock.createStartContract(); @@ -81,7 +81,7 @@ describe('ThresholdVisualization', () => { test('periodically requests visualization data', async () => { const refreshRate = 10; - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); const wrapper = mountWithIntl( <ThresholdVisualization @@ -99,7 +99,7 @@ describe('ThresholdVisualization', () => { await nextTick(); wrapper.update(); }); - expect(getThresholdAlertVisualizationData).toHaveBeenCalledTimes(1); + expect(getThresholdRuleVisualizationData).toHaveBeenCalledTimes(1); for (let i = 1; i <= 5; i++) { await act(async () => { @@ -107,7 +107,7 @@ describe('ThresholdVisualization', () => { await nextTick(); wrapper.update(); }); - expect(getThresholdAlertVisualizationData).toHaveBeenCalledTimes(i + 1); + expect(getThresholdRuleVisualizationData).toHaveBeenCalledTimes(i + 1); } }); @@ -130,7 +130,7 @@ describe('ThresholdVisualization', () => { }); expect(wrapper.find('[data-test-subj="firstLoad"]').exists()).toBeFalsy(); - expect(getThresholdAlertVisualizationData).toHaveBeenCalled(); + expect(getThresholdRuleVisualizationData).toHaveBeenCalled(); }); test('renders chart when visualization results are available', async () => { @@ -144,7 +144,7 @@ describe('ThresholdVisualization', () => { }); test('renders multiple line series chart when visualization results contain multiple groups', async () => { - getThresholdAlertVisualizationData.mockImplementation(() => + getThresholdRuleVisualizationData.mockImplementation(() => Promise.resolve({ results: [ { group: 'a', metrics: [['b', 2]] }, @@ -165,7 +165,7 @@ describe('ThresholdVisualization', () => { test('renders error callout with message when getting visualization fails', async () => { const errorMessage = 'oh no'; - getThresholdAlertVisualizationData.mockImplementation(() => + getThresholdRuleVisualizationData.mockImplementation(() => Promise.reject(new Error(errorMessage)) ); const wrapper = await setup(); @@ -182,7 +182,7 @@ describe('ThresholdVisualization', () => { }); test('renders error callout even when unable to get message from error', async () => { - getThresholdAlertVisualizationData.mockImplementation(() => + getThresholdRuleVisualizationData.mockImplementation(() => Promise.reject(new Error(undefined)) ); const wrapper = await setup(); @@ -199,7 +199,7 @@ describe('ThresholdVisualization', () => { }); test('renders no data message when visualization results are empty', async () => { - getThresholdAlertVisualizationData.mockImplementation(() => Promise.resolve({ results: [] })); + getThresholdRuleVisualizationData.mockImplementation(() => Promise.resolve({ results: [] })); const wrapper = await setup(); expect(wrapper.find('[data-test-subj="alertVisualizationChart"]').exists()).toBeTruthy(); diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.tsx b/x-pack/plugins/stack_alerts/public/rule_types/threshold/visualization.tsx similarity index 96% rename from x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.tsx rename to x-pack/plugins/stack_alerts/public/rule_types/threshold/visualization.tsx index e1d2ec285f39c..052936509564d 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/threshold/visualization.tsx @@ -35,10 +35,10 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import { AggregationType, Comparator } from '@kbn/triggers-actions-ui-plugin/public'; import { parseDuration } from '@kbn/alerting-plugin/common/parse_duration'; import { - getThresholdAlertVisualizationData, - GetThresholdAlertVisualizationDataParams, + getThresholdRuleVisualizationData, + GetThresholdRuleVisualizationDataParams, } from './index_threshold_api'; -import { IndexThresholdAlertParams } from './types'; +import { IndexThresholdRuleParams } from './types'; const customTheme = () => { return { @@ -87,7 +87,7 @@ const getDomain = (alertInterval: string, startAt: Date) => { }; interface Props { - ruleParams: IndexThresholdAlertParams; + ruleParams: IndexThresholdRuleParams; alertInterval: string; aggregationTypes: { [key: string]: AggregationType }; comparators: { @@ -336,11 +336,11 @@ export const ThresholdVisualization: React.FunctionComponent<Props> = ({ // convert the data from the visualization API into something easier to digest with charts async function getVisualizationData( - model: IndexThresholdAlertParams, - visualizeOptions: GetThresholdAlertVisualizationDataParams['visualizeOptions'], + model: IndexThresholdRuleParams, + visualizeOptions: GetThresholdRuleVisualizationDataParams['visualizeOptions'], http: HttpSetup ) { - const vizData = await getThresholdAlertVisualizationData({ + const vizData = await getThresholdRuleVisualizationData({ model, visualizeOptions, http, diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/action_context.test.ts b/x-pack/plugins/stack_alerts/server/alert_types/es_query/action_context.test.ts deleted file mode 100644 index c19d4ed5c3d1f..0000000000000 --- a/x-pack/plugins/stack_alerts/server/alert_types/es_query/action_context.test.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 { EsQueryRuleActionContext, addMessages } from './action_context'; -import { EsQueryRuleParamsSchema } from './rule_type_params'; -import { OnlyEsQueryRuleParams } from './types'; - -describe('ActionContext', () => { - it('generates expected properties', async () => { - const params = EsQueryRuleParamsSchema.validate({ - index: ['[index]'], - timeField: '[timeField]', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: '>', - threshold: [4], - searchType: 'esQuery', - }) as OnlyEsQueryRuleParams; - const base: EsQueryRuleActionContext = { - date: '2020-01-01T00:00:00.000Z', - value: 42, - conditions: 'count greater than 4', - hits: [], - link: 'link-mock', - }; - const context = addMessages({ name: '[rule-name]' }, base, params); - expect(context.title).toMatchInlineSnapshot(`"rule '[rule-name]' matched query"`); - expect(context.message).toEqual( - `rule '[rule-name]' is active: - -- Value: 42 -- Conditions Met: count greater than 4 over 5m -- Timestamp: 2020-01-01T00:00:00.000Z -- Link: link-mock` - ); - }); - - it('generates expected properties when isRecovered is true', async () => { - const params = EsQueryRuleParamsSchema.validate({ - index: ['[index]'], - timeField: '[timeField]', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: '>', - threshold: [4], - searchType: 'esQuery', - }) as OnlyEsQueryRuleParams; - const base: EsQueryRuleActionContext = { - date: '2020-01-01T00:00:00.000Z', - value: 42, - conditions: 'count not greater than 4', - hits: [], - link: 'link-mock', - }; - const context = addMessages({ name: '[rule-name]' }, base, params, true); - expect(context.title).toMatchInlineSnapshot(`"rule '[rule-name]' recovered"`); - expect(context.message).toEqual( - `rule '[rule-name]' is recovered: - -- Value: 42 -- Conditions Met: count not greater than 4 over 5m -- Timestamp: 2020-01-01T00:00:00.000Z -- Link: link-mock` - ); - }); - - it('generates expected properties if comparator is between', async () => { - const params = EsQueryRuleParamsSchema.validate({ - index: ['[index]'], - timeField: '[timeField]', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: 'between', - threshold: [4, 5], - searchType: 'esQuery', - }) as OnlyEsQueryRuleParams; - const base: EsQueryRuleActionContext = { - date: '2020-01-01T00:00:00.000Z', - value: 4, - conditions: 'count between 4 and 5', - hits: [], - link: 'link-mock', - }; - const context = addMessages({ name: '[rule-name]' }, base, params); - expect(context.title).toMatchInlineSnapshot(`"rule '[rule-name]' matched query"`); - expect(context.message).toEqual( - `rule '[rule-name]' is active: - -- Value: 4 -- Conditions Met: count between 4 and 5 over 5m -- Timestamp: 2020-01-01T00:00:00.000Z -- Link: link-mock` - ); - }); -}); diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/action_context.ts b/x-pack/plugins/stack_alerts/server/alert_types/es_query/action_context.ts deleted file mode 100644 index f25b35c6c63d6..0000000000000 --- a/x-pack/plugins/stack_alerts/server/alert_types/es_query/action_context.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 { i18n } from '@kbn/i18n'; -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { RuleExecutorOptions, AlertInstanceContext } from '@kbn/alerting-plugin/server'; -import { OnlyEsQueryRuleParams, OnlySearchSourceRuleParams } from './types'; - -// rule type context provided to actions - -type RuleInfo = Pick<RuleExecutorOptions, 'name'>; - -export interface ActionContext extends EsQueryRuleActionContext { - // a short pre-constructed message which may be used in an action field - title: string; - // a longer pre-constructed message which may be used in an action field - message: string; -} - -export interface EsQueryRuleActionContext extends AlertInstanceContext { - // the date the rule was run as an ISO date - date: string; - // the value that met the threshold - value: number; - // threshold conditions - conditions: string; - // query matches - hits: estypes.SearchHit[]; - // a link to see records that triggered the rule for Discover rule - // a link which navigates to stack management in case of Elastic query rule - link: string; -} - -export function addMessages( - ruleInfo: RuleInfo, - baseContext: EsQueryRuleActionContext, - params: OnlyEsQueryRuleParams | OnlySearchSourceRuleParams, - isRecovered: boolean = false -): ActionContext { - const title = i18n.translate('xpack.stackAlerts.esQuery.alertTypeContextSubjectTitle', { - defaultMessage: `rule '{name}' {verb}`, - values: { - name: ruleInfo.name, - verb: isRecovered ? 'recovered' : 'matched query', - }, - }); - - const window = `${params.timeWindowSize}${params.timeWindowUnit}`; - const message = i18n.translate('xpack.stackAlerts.esQuery.alertTypeContextMessageDescription', { - defaultMessage: `rule '{name}' is {verb}: - -- Value: {value} -- Conditions Met: {conditions} over {window} -- Timestamp: {date} -- Link: {link}`, - values: { - name: ruleInfo.name, - value: baseContext.value, - conditions: baseContext.conditions, - window, - date: baseContext.date, - link: baseContext.link, - verb: isRecovered ? 'recovered' : 'active', - }, - }); - - return { ...baseContext, title, message }; -} diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts b/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts deleted file mode 100644 index b647531222407..0000000000000 --- a/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts +++ /dev/null @@ -1,683 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import uuid from 'uuid'; -import type { Writable } from '@kbn/utility-types'; -import { RuleExecutorServices } from '@kbn/alerting-plugin/server'; -import { - RuleExecutorServicesMock, - alertsMock, - AlertInstanceMock, -} from '@kbn/alerting-plugin/server/mocks'; -import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { getRuleType } from './rule_type'; -import { EsQueryRuleParams, EsQueryRuleState } from './rule_type_params'; -import { ActionContext } from './action_context'; -import type { ESSearchResponse, ESSearchRequest } from '@kbn/es-types'; -import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; -import { coreMock } from '@kbn/core/server/mocks'; -import { ActionGroupId, ConditionMetAlertInstanceId } from './constants'; -import { OnlyEsQueryRuleParams, OnlySearchSourceRuleParams } from './types'; -import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; -import { Comparator } from '../../../common/comparator_types'; - -const logger = loggingSystemMock.create().get(); -const coreSetup = coreMock.createSetup(); -const ruleType = getRuleType(coreSetup); - -describe('ruleType', () => { - it('rule type creation structure is the expected value', async () => { - expect(ruleType.id).toBe('.es-query'); - expect(ruleType.name).toBe('Elasticsearch query'); - expect(ruleType.actionGroups).toEqual([{ id: 'query matched', name: 'Query matched' }]); - - expect(ruleType.actionVariables).toMatchInlineSnapshot(` - Object { - "context": Array [ - Object { - "description": "A message for the alert.", - "name": "message", - }, - Object { - "description": "A title for the alert.", - "name": "title", - }, - Object { - "description": "The date that the alert met the threshold condition.", - "name": "date", - }, - Object { - "description": "The value that met the threshold condition.", - "name": "value", - }, - Object { - "description": "The documents that met the threshold condition.", - "name": "hits", - }, - Object { - "description": "A string that describes the threshold condition.", - "name": "conditions", - }, - Object { - "description": "Navigate to Discover and show the records that triggered - the alert when the rule is created in Discover. Otherwise, navigate to the status page for the rule.", - "name": "link", - }, - ], - "params": Array [ - Object { - "description": "The number of hits to retrieve for each query.", - "name": "size", - }, - Object { - "description": "An array of values to use as the threshold. 'between' and 'notBetween' require two values.", - "name": "threshold", - }, - Object { - "description": "A function to determine if the threshold was met.", - "name": "thresholdComparator", - }, - Object { - "description": "Serialized search source fields used to fetch the documents from Elasticsearch.", - "name": "searchConfiguration", - }, - Object { - "description": "The string representation of the Elasticsearch query.", - "name": "esQuery", - }, - Object { - "description": "The index the query was run against.", - "name": "index", - }, - ], - } - `); - }); - - describe('elasticsearch query', () => { - it('validator succeeds with valid es query params', async () => { - const params: Partial<Writable<OnlyEsQueryRuleParams>> = { - index: ['index-name'], - timeField: 'time-field', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.LT, - threshold: [0], - searchType: 'esQuery', - }; - - expect(ruleType.validate?.params?.validate(params)).toBeTruthy(); - }); - - it('validator fails with invalid es query params - threshold', async () => { - const paramsSchema = ruleType.validate?.params; - if (!paramsSchema) throw new Error('params validator not set'); - - const params: Partial<Writable<OnlyEsQueryRuleParams>> = { - index: ['index-name'], - timeField: 'time-field', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.BETWEEN, - threshold: [0], - searchType: 'esQuery', - }; - - expect(() => paramsSchema.validate(params)).toThrowErrorMatchingInlineSnapshot( - `"[threshold]: must have two elements for the \\"between\\" comparator"` - ); - }); - - it('rule executor handles no documents returned by ES', async () => { - const params: OnlyEsQueryRuleParams = { - index: ['index-name'], - timeField: 'time-field', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.BETWEEN, - threshold: [0], - searchType: 'esQuery', - excludeHitsFromPreviousRun: true, - }; - const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - const searchResult: ESSearchResponse<unknown, {}> = generateResults([]); - ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( - elasticsearchClientMock.createSuccessTransportRequestPromise(searchResult) - ); - - const result = await invokeExecutor({ params, ruleServices }); - - expect(ruleServices.alertFactory.create).not.toHaveBeenCalled(); - - expect(result).toMatchInlineSnapshot(` - Object { - "latestTimestamp": undefined, - } - `); - }); - - it('rule executor returns the latestTimestamp of the newest detected document', async () => { - const params: OnlyEsQueryRuleParams = { - index: ['index-name'], - timeField: 'time-field', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.GT, - threshold: [0], - searchType: 'esQuery', - excludeHitsFromPreviousRun: true, - }; - const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - const newestDocumentTimestamp = Date.now(); - - const searchResult: ESSearchResponse<unknown, {}> = generateResults([ - { - 'time-field': newestDocumentTimestamp, - }, - { - 'time-field': newestDocumentTimestamp - 1000, - }, - { - 'time-field': newestDocumentTimestamp - 2000, - }, - ]); - ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( - elasticsearchClientMock.createSuccessTransportRequestPromise(searchResult) - ); - - const result = await invokeExecutor({ params, ruleServices }); - - expect(ruleServices.alertFactory.create).toHaveBeenCalledWith(ConditionMetAlertInstanceId); - const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; - expect(instance.replaceState).toHaveBeenCalledWith({ - latestTimestamp: undefined, - dateStart: expect.any(String), - dateEnd: expect.any(String), - }); - - expect(result).toMatchObject({ - latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), - }); - }); - - it('rule executor correctly handles numeric time fields that were stored by legacy rules prior to v7.12.1', async () => { - const params: OnlyEsQueryRuleParams = { - index: ['index-name'], - timeField: 'time-field', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.GT, - threshold: [0], - searchType: 'esQuery', - excludeHitsFromPreviousRun: true, - }; - const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - const previousTimestamp = Date.now(); - const newestDocumentTimestamp = previousTimestamp + 1000; - - ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( - elasticsearchClientMock.createSuccessTransportRequestPromise( - generateResults([ - { - 'time-field': newestDocumentTimestamp, - }, - ]) - ) - ); - - const result = await invokeExecutor({ - params, - ruleServices, - state: { - // @ts-expect-error previousTimestamp is numeric, but should be string (this was a bug prior to v7.12.1) - latestTimestamp: previousTimestamp, - }, - }); - - const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; - expect(instance.replaceState).toHaveBeenCalledWith({ - // ensure the invalid "latestTimestamp" in the state is stored as an ISO string going forward - latestTimestamp: new Date(previousTimestamp).toISOString(), - dateStart: expect.any(String), - dateEnd: expect.any(String), - }); - - expect(result).toMatchObject({ - latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), - }); - }); - - it('rule executor ignores previous invalid latestTimestamp values stored by legacy rules prior to v7.12.1', async () => { - const params: OnlyEsQueryRuleParams = { - index: ['index-name'], - timeField: 'time-field', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.GT, - threshold: [0], - searchType: 'esQuery', - excludeHitsFromPreviousRun: true, - }; - const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - const oldestDocumentTimestamp = Date.now(); - - ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( - elasticsearchClientMock.createSuccessTransportRequestPromise( - generateResults([ - { - 'time-field': oldestDocumentTimestamp, - }, - { - 'time-field': oldestDocumentTimestamp - 1000, - }, - ]) - ) - ); - - const result = await invokeExecutor({ params, ruleServices }); - - const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; - expect(instance.replaceState).toHaveBeenCalledWith({ - latestTimestamp: undefined, - dateStart: expect.any(String), - dateEnd: expect.any(String), - }); - - expect(result).toMatchObject({ - latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), - }); - }); - - it('rule executor carries over the queried latestTimestamp in the rule state', async () => { - const params: OnlyEsQueryRuleParams = { - index: ['index-name'], - timeField: 'time-field', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.GT, - threshold: [0], - searchType: 'esQuery', - excludeHitsFromPreviousRun: true, - }; - const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - const oldestDocumentTimestamp = Date.now(); - - ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( - elasticsearchClientMock.createSuccessTransportRequestPromise( - generateResults([ - { - 'time-field': oldestDocumentTimestamp, - }, - ]) - ) - ); - - const result = await invokeExecutor({ params, ruleServices }); - - const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; - expect(instance.replaceState).toHaveBeenCalledWith({ - latestTimestamp: undefined, - dateStart: expect.any(String), - dateEnd: expect.any(String), - }); - - expect(result).toMatchObject({ - latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), - }); - - const newestDocumentTimestamp = oldestDocumentTimestamp + 5000; - ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( - elasticsearchClientMock.createSuccessTransportRequestPromise( - generateResults([ - { - 'time-field': newestDocumentTimestamp, - }, - { - 'time-field': newestDocumentTimestamp - 1000, - }, - ]) - ) - ); - - const secondResult = await invokeExecutor({ - params, - ruleServices, - state: result as EsQueryRuleState, - }); - - const existingInstance: AlertInstanceMock = - ruleServices.alertFactory.create.mock.results[1].value; - expect(existingInstance.replaceState).toHaveBeenCalledWith({ - latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), - dateStart: expect.any(String), - dateEnd: expect.any(String), - }); - - expect(secondResult).toMatchObject({ - latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), - }); - }); - - it('rule executor ignores tie breaker sort values', async () => { - const params: OnlyEsQueryRuleParams = { - index: ['index-name'], - timeField: 'time-field', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.GT, - threshold: [0], - searchType: 'esQuery', - excludeHitsFromPreviousRun: true, - }; - const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - const oldestDocumentTimestamp = Date.now(); - - ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( - elasticsearchClientMock.createSuccessTransportRequestPromise( - generateResults( - [ - { - 'time-field': oldestDocumentTimestamp, - }, - { - 'time-field': oldestDocumentTimestamp - 1000, - }, - ], - true - ) - ) - ); - - const result = await invokeExecutor({ params, ruleServices }); - - const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; - expect(instance.replaceState).toHaveBeenCalledWith({ - latestTimestamp: undefined, - dateStart: expect.any(String), - dateEnd: expect.any(String), - }); - - expect(result).toMatchObject({ - latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), - }); - }); - - it('rule executor ignores results with no sort values', async () => { - const params: OnlyEsQueryRuleParams = { - index: ['index-name'], - timeField: 'time-field', - esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.GT, - threshold: [0], - searchType: 'esQuery', - excludeHitsFromPreviousRun: true, - }; - const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - const oldestDocumentTimestamp = Date.now(); - - ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( - elasticsearchClientMock.createSuccessTransportRequestPromise( - generateResults( - [ - { - 'time-field': oldestDocumentTimestamp, - }, - { - 'time-field': oldestDocumentTimestamp - 1000, - }, - ], - true, - true - ) - ) - ); - - const result = await invokeExecutor({ params, ruleServices }); - - const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; - expect(instance.replaceState).toHaveBeenCalledWith({ - latestTimestamp: undefined, - dateStart: expect.any(String), - dateEnd: expect.any(String), - }); - - expect(result).toMatchObject({ - latestTimestamp: new Date(oldestDocumentTimestamp - 1000).toISOString(), - }); - }); - }); - - describe('search source query', () => { - const dataViewMock = { - id: 'test-id', - title: 'test-title', - timeFieldName: 'time-field', - fields: [ - { - name: 'message', - type: 'string', - displayName: 'message', - scripted: false, - filterable: false, - aggregatable: false, - }, - { - name: 'timestamp', - type: 'date', - displayName: 'timestamp', - scripted: false, - filterable: false, - aggregatable: false, - }, - ], - }; - const defaultParams: OnlySearchSourceRuleParams = { - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.LT, - threshold: [0], - searchConfiguration: {}, - searchType: 'searchSource', - excludeHitsFromPreviousRun: true, - }; - - afterAll(() => { - jest.resetAllMocks(); - }); - - it('validator succeeds with valid search source params', async () => { - expect(ruleType.validate?.params?.validate(defaultParams)).toBeTruthy(); - }); - - it('validator fails with invalid search source params - esQuery provided', async () => { - const paramsSchema = ruleType.validate?.params!; - const params: Partial<Writable<EsQueryRuleParams>> = { - size: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.LT, - threshold: [0], - esQuery: '', - searchType: 'searchSource', - }; - - expect(() => paramsSchema.validate(params)).toThrowErrorMatchingInlineSnapshot( - `"[esQuery]: a value wasn't expected to be present"` - ); - }); - - it('rule executor handles no documents returned by ES', async () => { - const params = defaultParams; - const searchResult: ESSearchResponse<unknown, {}> = generateResults([]); - const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - (searchSourceInstanceMock.getField as jest.Mock).mockImplementationOnce((name: string) => { - if (name === 'index') { - return dataViewMock; - } - }); - (searchSourceInstanceMock.fetch as jest.Mock).mockResolvedValueOnce(searchResult); - - await invokeExecutor({ params, ruleServices }); - - expect(ruleServices.alertFactory.create).not.toHaveBeenCalled(); - }); - - it('rule executor throws an error when index does not have time field', async () => { - const params = defaultParams; - const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - (searchSourceInstanceMock.getField as jest.Mock).mockImplementationOnce((name: string) => { - if (name === 'index') { - return { dataViewMock, timeFieldName: undefined }; - } - }); - - await expect(invokeExecutor({ params, ruleServices })).rejects.toThrow( - 'Invalid data view without timeFieldName.' - ); - }); - - it('rule executor schedule actions when condition met', async () => { - const params = { ...defaultParams, thresholdComparator: Comparator.GT_OR_EQ, threshold: [3] }; - const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - (searchSourceInstanceMock.getField as jest.Mock).mockImplementationOnce((name: string) => { - if (name === 'index') { - return dataViewMock; - } - }); - - (searchSourceInstanceMock.fetch as jest.Mock).mockResolvedValueOnce({ - hits: { total: 3, hits: [{}, {}, {}] }, - }); - - await invokeExecutor({ params, ruleServices }); - - const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; - expect(instance.scheduleActions).toHaveBeenCalled(); - }); - }); -}); - -function generateResults( - docs: Array<{ 'time-field': unknown; [key: string]: unknown }>, - includeTieBreaker: boolean = false, - skipSortOnFirst: boolean = false -): ESSearchResponse<unknown, ESSearchRequest> { - const hits = docs.map((doc, index) => ({ - _index: 'foo', - _type: '_doc', - _id: `${index}`, - _score: 0, - ...(skipSortOnFirst && index === 0 - ? {} - : { - sort: (includeTieBreaker - ? ['FaslK3QBySSL_rrj9zM5', doc['time-field']] - : [doc['time-field']]) as string[], - }), - _source: doc, - })); - return { - took: 10, - timed_out: false, - _shards: { - total: 10, - successful: 10, - failed: 0, - skipped: 0, - }, - hits: { - total: { - value: docs.length, - relation: 'eq', - }, - max_score: 100, - hits, - }, - }; -} - -async function invokeExecutor({ - params, - ruleServices, - state, -}: { - params: OnlySearchSourceRuleParams | OnlyEsQueryRuleParams; - ruleServices: RuleExecutorServicesMock; - state?: EsQueryRuleState; -}) { - return await ruleType.executor({ - alertId: uuid.v4(), - executionId: uuid.v4(), - startedAt: new Date(), - previousStartedAt: new Date(), - services: ruleServices as unknown as RuleExecutorServices< - EsQueryRuleState, - ActionContext, - typeof ActionGroupId - >, - params: params as EsQueryRuleParams, - state: { - latestTimestamp: undefined, - ...state, - }, - spaceId: uuid.v4(), - name: uuid.v4(), - tags: [], - createdBy: null, - updatedBy: null, - rule: { - name: uuid.v4(), - tags: [], - consumer: '', - producer: '', - ruleTypeId: '', - ruleTypeName: '', - enabled: true, - schedule: { - interval: '1h', - }, - actions: [], - createdBy: null, - updatedBy: null, - createdAt: new Date(), - updatedAt: new Date(), - throttle: null, - notifyWhen: null, - }, - logger, - }); -} diff --git a/x-pack/plugins/stack_alerts/server/alert_types/index.ts b/x-pack/plugins/stack_alerts/server/alert_types/index.ts deleted file mode 100644 index 93a3b679ab0f1..0000000000000 --- a/x-pack/plugins/stack_alerts/server/alert_types/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CoreSetup, Logger } from '@kbn/core/server'; -import { AlertingSetup, StackAlertsStartDeps } from '../types'; -import { register as registerIndexThreshold } from './index_threshold'; -import { register as registerGeoContainment } from './geo_containment'; -import { register as registerEsQuery } from './es_query'; -interface RegisterAlertTypesParams { - logger: Logger; - data: Promise<StackAlertsStartDeps['triggersActionsUi']['data']>; - alerting: AlertingSetup; - core: CoreSetup; -} - -export function registerBuiltInAlertTypes(params: RegisterAlertTypesParams) { - registerIndexThreshold(params); - registerGeoContainment(params); - registerEsQuery(params); -} diff --git a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/action_context.test.ts b/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/action_context.test.ts deleted file mode 100644 index 0df74bb2f89c5..0000000000000 --- a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/action_context.test.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { BaseActionContext, addMessages } from './action_context'; -import { ParamsSchema } from './rule_type_params'; - -describe('ActionContext', () => { - it('generates expected properties if aggField is null', async () => { - const params = ParamsSchema.validate({ - index: '[index]', - timeField: '[timeField]', - aggType: 'count', - groupBy: 'top', - termField: 'x', - termSize: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: '>', - threshold: [4], - }); - const base: BaseActionContext = { - date: '2020-01-01T00:00:00.000Z', - group: '[group]', - value: 42, - conditions: 'count greater than 4', - }; - const context = addMessages({ name: '[rule-name]' }, base, params); - expect(context.title).toMatchInlineSnapshot(`"alert [rule-name] group [group] met threshold"`); - expect(context.message).toEqual( - `alert '[rule-name]' is active for group '[group]': - -- Value: 42 -- Conditions Met: count greater than 4 over 5m -- Timestamp: 2020-01-01T00:00:00.000Z` - ); - }); - - it('generates expected properties if aggField is not null', async () => { - const params = ParamsSchema.validate({ - index: '[index]', - timeField: '[timeField]', - aggType: 'avg', - groupBy: 'top', - termField: 'x', - termSize: 100, - aggField: '[aggField]', - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: '>', - threshold: [4.2], - }); - const base: BaseActionContext = { - date: '2020-01-01T00:00:00.000Z', - group: '[group]', - value: 42, - conditions: 'avg([aggField]) greater than 4.2', - }; - const context = addMessages({ name: '[rule-name]' }, base, params); - expect(context.title).toMatchInlineSnapshot(`"alert [rule-name] group [group] met threshold"`); - expect(context.message).toEqual( - `alert '[rule-name]' is active for group '[group]': - -- Value: 42 -- Conditions Met: avg([aggField]) greater than 4.2 over 5m -- Timestamp: 2020-01-01T00:00:00.000Z` - ); - }); - - it('generates expected properties if comparator is between', async () => { - const params = ParamsSchema.validate({ - index: '[index]', - timeField: '[timeField]', - aggType: 'count', - groupBy: 'top', - termField: 'x', - termSize: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: 'between', - threshold: [4, 5], - }); - const base: BaseActionContext = { - date: '2020-01-01T00:00:00.000Z', - group: '[group]', - value: 4, - conditions: 'count between 4 and 5', - }; - const context = addMessages({ name: '[rule-name]' }, base, params); - expect(context.title).toMatchInlineSnapshot(`"alert [rule-name] group [group] met threshold"`); - expect(context.message).toEqual( - `alert '[rule-name]' is active for group '[group]': - -- Value: 4 -- Conditions Met: count between 4 and 5 over 5m -- Timestamp: 2020-01-01T00:00:00.000Z` - ); - }); - - it('generates expected properties if value is string', async () => { - const params = ParamsSchema.validate({ - index: '[index]', - timeField: '[timeField]', - aggType: 'count', - groupBy: 'top', - termField: 'x', - termSize: 100, - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: 'between', - threshold: [4, 5], - }); - const base: BaseActionContext = { - date: '2020-01-01T00:00:00.000Z', - group: '[group]', - value: 'unknown', - conditions: 'count between 4 and 5', - }; - const context = addMessages({ name: '[rule-name]' }, base, params); - expect(context.title).toMatchInlineSnapshot(`"alert [rule-name] group [group] met threshold"`); - expect(context.message).toEqual( - `alert '[rule-name]' is active for group '[group]': - -- Value: unknown -- Conditions Met: count between 4 and 5 over 5m -- Timestamp: 2020-01-01T00:00:00.000Z` - ); - }); -}); diff --git a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/action_context.ts b/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/action_context.ts deleted file mode 100644 index 36ed27d8a7391..0000000000000 --- a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/action_context.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { RuleExecutorOptions, AlertInstanceContext } from '@kbn/alerting-plugin/server'; -import { Params } from './rule_type_params'; - -// rule type context provided to actions - -type RuleInfo = Pick<RuleExecutorOptions, 'name'>; - -export interface ActionContext extends BaseActionContext { - // a short pre-constructed message which may be used in an action field - title: string; - // a longer pre-constructed message which may be used in an action field - message: string; -} - -export interface BaseActionContext extends AlertInstanceContext { - // the aggType used in the rule - // the value of the aggField, if used, otherwise 'all documents' - group: string; - // the date the rule was run as an ISO date - date: string; - // the value that met the threshold - value: number | string; - // threshold conditions - conditions: string; -} - -const DEFAULT_TITLE = (name: string, group: string) => - i18n.translate('xpack.stackAlerts.indexThreshold.alertTypeContextSubjectTitle', { - defaultMessage: 'alert {name} group {group} met threshold', - values: { name, group }, - }); - -const RECOVERY_TITLE = (name: string, group: string) => - i18n.translate('xpack.stackAlerts.indexThreshold.alertTypeRecoveryContextSubjectTitle', { - defaultMessage: 'alert {name} group {group} recovered', - values: { name, group }, - }); - -const DEFAULT_MESSAGE = (name: string, context: BaseActionContext, window: string) => - i18n.translate('xpack.stackAlerts.indexThreshold.alertTypeContextMessageDescription', { - defaultMessage: `alert '{name}' is active for group '{group}': - -- Value: {value} -- Conditions Met: {conditions} over {window} -- Timestamp: {date}`, - values: { - name, - group: context.group, - value: context.value, - conditions: context.conditions, - window, - date: context.date, - }, - }); - -const RECOVERY_MESSAGE = (name: string, context: BaseActionContext, window: string) => - i18n.translate('xpack.stackAlerts.indexThreshold.alertTypeRecoveryContextMessageDescription', { - defaultMessage: `alert '{name}' is recovered for group '{group}': - -- Value: {value} -- Conditions Met: {conditions} over {window} -- Timestamp: {date}`, - values: { - name, - group: context.group, - value: context.value, - conditions: context.conditions, - window, - date: context.date, - }, - }); - -export function addMessages( - ruleInfo: RuleInfo, - baseContext: BaseActionContext, - params: Params, - isRecoveryMessage?: boolean -): ActionContext { - const title = isRecoveryMessage - ? RECOVERY_TITLE(ruleInfo.name, baseContext.group) - : DEFAULT_TITLE(ruleInfo.name, baseContext.group); - - const window = `${params.timeWindowSize}${params.timeWindowUnit}`; - - const message = isRecoveryMessage - ? RECOVERY_MESSAGE(ruleInfo.name, baseContext, window) - : DEFAULT_MESSAGE(ruleInfo.name, baseContext, window); - - return { ...baseContext, title, message }; -} diff --git a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type.test.ts b/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type.test.ts deleted file mode 100644 index f7704e4699930..0000000000000 --- a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type.test.ts +++ /dev/null @@ -1,449 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import uuid from 'uuid'; -import sinon from 'sinon'; -import type { Writable } from '@kbn/utility-types'; -import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { RuleExecutorServices } from '@kbn/alerting-plugin/server'; -import { getRuleType, ActionGroupId } from './rule_type'; -import { ActionContext } from './action_context'; -import { Params } from './rule_type_params'; -import { TIME_SERIES_BUCKET_SELECTOR_FIELD } from '@kbn/triggers-actions-ui-plugin/server'; -import { RuleExecutorServicesMock, alertsMock } from '@kbn/alerting-plugin/server/mocks'; -import { Comparator } from '../../../common/comparator_types'; - -let fakeTimer: sinon.SinonFakeTimers; - -describe('ruleType', () => { - const logger = loggingSystemMock.create().get(); - const data = { - timeSeriesQuery: jest.fn(), - }; - const alertServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - - const ruleType = getRuleType(Promise.resolve(data)); - - beforeAll(() => { - fakeTimer = sinon.useFakeTimers(); - }); - - afterEach(() => { - data.timeSeriesQuery.mockReset(); - }); - - afterAll(() => fakeTimer.restore()); - - it('rule type creation structure is the expected value', async () => { - expect(ruleType.id).toBe('.index-threshold'); - expect(ruleType.name).toBe('Index threshold'); - expect(ruleType.actionGroups).toEqual([{ id: 'threshold met', name: 'Threshold met' }]); - - expect(ruleType.actionVariables).toMatchInlineSnapshot(` - Object { - "context": Array [ - Object { - "description": "A pre-constructed message for the alert.", - "name": "message", - }, - Object { - "description": "A pre-constructed title for the alert.", - "name": "title", - }, - Object { - "description": "The group that exceeded the threshold.", - "name": "group", - }, - Object { - "description": "The date the alert exceeded the threshold.", - "name": "date", - }, - Object { - "description": "The value that exceeded the threshold.", - "name": "value", - }, - Object { - "description": "A string describing the threshold comparator and threshold", - "name": "conditions", - }, - ], - "params": Array [ - Object { - "description": "An array of values to use as the threshold; 'between' and 'notBetween' require two values, the others require one.", - "name": "threshold", - }, - Object { - "description": "A comparison function to use to determine if the threshold as been met.", - "name": "thresholdComparator", - }, - Object { - "description": "index", - "name": "index", - }, - Object { - "description": "timeField", - "name": "timeField", - }, - Object { - "description": "aggType", - "name": "aggType", - }, - Object { - "description": "aggField", - "name": "aggField", - }, - Object { - "description": "groupBy", - "name": "groupBy", - }, - Object { - "description": "termField", - "name": "termField", - }, - Object { - "description": "filterKuery", - "name": "filterKuery", - }, - Object { - "description": "termSize", - "name": "termSize", - }, - Object { - "description": "timeWindowSize", - "name": "timeWindowSize", - }, - Object { - "description": "timeWindowUnit", - "name": "timeWindowUnit", - }, - ], - } - `); - }); - - it('validator succeeds with valid params', async () => { - const params: Partial<Writable<Params>> = { - index: 'index-name', - timeField: 'time-field', - aggType: 'count', - groupBy: 'all', - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.LT, - threshold: [0], - }; - - expect(ruleType.validate?.params?.validate(params)).toBeTruthy(); - }); - - it('validator fails with invalid params', async () => { - const paramsSchema = ruleType.validate?.params; - if (!paramsSchema) throw new Error('params validator not set'); - - const params: Partial<Writable<Params>> = { - index: 'index-name', - timeField: 'time-field', - aggType: 'foo', - groupBy: 'all', - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.GT, - threshold: [0], - }; - - expect(() => paramsSchema.validate(params)).toThrowErrorMatchingInlineSnapshot( - `"[aggType]: invalid aggType: \\"foo\\""` - ); - }); - - it('should ensure 0 results fires actions if it passes the comparator check', async () => { - data.timeSeriesQuery.mockImplementation((...args) => { - return { - results: [ - { - group: 'all documents', - metrics: [['2021-07-14T14:49:30.978Z', 0]], - }, - ], - }; - }); - const params: Params = { - index: 'index-name', - timeField: 'time-field', - aggType: 'foo', - groupBy: 'all', - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.LT, - threshold: [1], - }; - - await ruleType.executor({ - alertId: uuid.v4(), - executionId: uuid.v4(), - startedAt: new Date(), - previousStartedAt: new Date(), - services: alertServices as unknown as RuleExecutorServices< - {}, - ActionContext, - typeof ActionGroupId - >, - params, - state: { - latestTimestamp: undefined, - }, - spaceId: uuid.v4(), - name: uuid.v4(), - tags: [], - createdBy: null, - updatedBy: null, - rule: { - name: uuid.v4(), - tags: [], - consumer: '', - producer: '', - ruleTypeId: '', - ruleTypeName: '', - enabled: true, - schedule: { - interval: '1h', - }, - actions: [], - createdBy: null, - updatedBy: null, - createdAt: new Date(), - updatedAt: new Date(), - throttle: null, - notifyWhen: null, - }, - logger, - }); - - expect(alertServices.alertFactory.create).toHaveBeenCalledWith('all documents'); - }); - - it('should ensure a null result does not fire actions', async () => { - const customAlertServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - data.timeSeriesQuery.mockImplementation((...args) => { - return { - results: [ - { - group: 'all documents', - metrics: [['2021-07-14T14:49:30.978Z', null]], - }, - ], - }; - }); - const params: Params = { - index: 'index-name', - timeField: 'time-field', - aggType: 'foo', - groupBy: 'all', - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.LT, - threshold: [1], - }; - - await ruleType.executor({ - alertId: uuid.v4(), - executionId: uuid.v4(), - startedAt: new Date(), - previousStartedAt: new Date(), - services: customAlertServices as unknown as RuleExecutorServices< - {}, - ActionContext, - typeof ActionGroupId - >, - params, - state: { - latestTimestamp: undefined, - }, - spaceId: uuid.v4(), - name: uuid.v4(), - tags: [], - createdBy: null, - updatedBy: null, - rule: { - name: uuid.v4(), - tags: [], - consumer: '', - producer: '', - ruleTypeId: '', - ruleTypeName: '', - enabled: true, - schedule: { - interval: '1h', - }, - actions: [], - createdBy: null, - updatedBy: null, - createdAt: new Date(), - updatedAt: new Date(), - throttle: null, - notifyWhen: null, - }, - logger, - }); - - expect(customAlertServices.alertFactory.create).not.toHaveBeenCalled(); - }); - - it('should ensure an undefined result does not fire actions', async () => { - const customAlertServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); - data.timeSeriesQuery.mockImplementation((...args) => { - return { - results: [ - { - group: 'all documents', - metrics: [['2021-07-14T14:49:30.978Z', undefined]], - }, - ], - }; - }); - const params: Params = { - index: 'index-name', - timeField: 'time-field', - aggType: 'foo', - groupBy: 'all', - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.LT, - threshold: [1], - }; - - await ruleType.executor({ - alertId: uuid.v4(), - executionId: uuid.v4(), - startedAt: new Date(), - previousStartedAt: new Date(), - services: customAlertServices as unknown as RuleExecutorServices< - {}, - ActionContext, - typeof ActionGroupId - >, - params, - state: { - latestTimestamp: undefined, - }, - spaceId: uuid.v4(), - name: uuid.v4(), - tags: [], - createdBy: null, - updatedBy: null, - rule: { - name: uuid.v4(), - tags: [], - consumer: '', - producer: '', - ruleTypeId: '', - ruleTypeName: '', - enabled: true, - schedule: { - interval: '1h', - }, - actions: [], - createdBy: null, - updatedBy: null, - createdAt: new Date(), - updatedAt: new Date(), - throttle: null, - notifyWhen: null, - }, - logger, - }); - - expect(customAlertServices.alertFactory.create).not.toHaveBeenCalled(); - }); - - it('should correctly pass comparator script to timeSeriesQuery', async () => { - data.timeSeriesQuery.mockImplementation((...args) => { - return { - results: [ - { - group: 'all documents', - metrics: [['2021-07-14T14:49:30.978Z', 0]], - }, - ], - }; - }); - const params: Params = { - index: 'index-name', - timeField: 'time-field', - aggType: 'foo', - groupBy: 'all', - timeWindowSize: 5, - timeWindowUnit: 'm', - thresholdComparator: Comparator.LT, - threshold: [1], - }; - - await ruleType.executor({ - alertId: uuid.v4(), - executionId: uuid.v4(), - startedAt: new Date(), - previousStartedAt: new Date(), - services: alertServices as unknown as RuleExecutorServices< - {}, - ActionContext, - typeof ActionGroupId - >, - params, - state: { - latestTimestamp: undefined, - }, - spaceId: uuid.v4(), - name: uuid.v4(), - tags: [], - createdBy: null, - updatedBy: null, - rule: { - name: uuid.v4(), - tags: [], - consumer: '', - producer: '', - ruleTypeId: '', - ruleTypeName: '', - enabled: true, - schedule: { - interval: '1h', - }, - actions: [], - createdBy: null, - updatedBy: null, - createdAt: new Date(), - updatedAt: new Date(), - throttle: null, - notifyWhen: null, - }, - logger, - }); - - expect(data.timeSeriesQuery).toHaveBeenCalledWith( - expect.objectContaining({ - query: { - aggField: undefined, - aggType: 'foo', - dateEnd: '1970-01-01T00:00:00.000Z', - dateStart: '1970-01-01T00:00:00.000Z', - groupBy: 'all', - index: 'index-name', - interval: undefined, - termField: undefined, - termSize: undefined, - timeField: 'time-field', - timeWindowSize: 5, - timeWindowUnit: 'm', - }, - condition: { - conditionScript: `${TIME_SERIES_BUCKET_SELECTOR_FIELD} < 1L`, - resultLimit: 1000, - }, - }) - ); - }); -}); diff --git a/x-pack/plugins/stack_alerts/server/feature.ts b/x-pack/plugins/stack_alerts/server/feature.ts index 9005a8435657b..85dac89bcfb81 100644 --- a/x-pack/plugins/stack_alerts/server/feature.ts +++ b/x-pack/plugins/stack_alerts/server/feature.ts @@ -9,9 +9,9 @@ import { i18n } from '@kbn/i18n'; import { KibanaFeatureConfig } from '@kbn/features-plugin/common'; import { DEFAULT_APP_CATEGORIES } from '@kbn/core/server'; import { TRANSFORM_RULE_TYPE } from '@kbn/transform-plugin/common'; -import { ID as IndexThreshold } from './alert_types/index_threshold/rule_type'; -import { GEO_CONTAINMENT_ID as GeoContainment } from './alert_types/geo_containment/alert_type'; -import { ES_QUERY_ID as ElasticsearchQuery } from './alert_types/es_query/constants'; +import { ID as IndexThreshold } from './rule_types/index_threshold/rule_type'; +import { GEO_CONTAINMENT_ID as GeoContainment } from './rule_types/geo_containment/alert_type'; +import { ES_QUERY_ID as ElasticsearchQuery } from './rule_types/es_query/constants'; import { STACK_ALERTS_FEATURE_ID } from '../common'; const TransformHealth = TRANSFORM_RULE_TYPE.TRANSFORM_HEALTH; diff --git a/x-pack/plugins/stack_alerts/server/index.ts b/x-pack/plugins/stack_alerts/server/index.ts index 5483124209028..36423a6c1acbc 100644 --- a/x-pack/plugins/stack_alerts/server/index.ts +++ b/x-pack/plugins/stack_alerts/server/index.ts @@ -8,7 +8,7 @@ import { get } from 'lodash'; import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; import { AlertingBuiltinsPlugin } from './plugin'; import { configSchema, Config } from '../common/config'; -export { ID as INDEX_THRESHOLD_ID } from './alert_types/index_threshold/rule_type'; +export { ID as INDEX_THRESHOLD_ID } from './rule_types/index_threshold/rule_type'; export const config: PluginConfigDescriptor<Config> = { exposeToBrowser: {}, diff --git a/x-pack/plugins/stack_alerts/server/plugin.ts b/x-pack/plugins/stack_alerts/server/plugin.ts index 6473e8405dda7..b4b25bb983195 100644 --- a/x-pack/plugins/stack_alerts/server/plugin.ts +++ b/x-pack/plugins/stack_alerts/server/plugin.ts @@ -8,7 +8,7 @@ import { Plugin, Logger, CoreSetup, PluginInitializerContext } from '@kbn/core/server'; import { StackAlertsDeps, StackAlertsStartDeps } from './types'; -import { registerBuiltInAlertTypes } from './alert_types'; +import { registerBuiltInRuleTypes } from './rule_types'; import { BUILT_IN_ALERTS_FEATURE } from './feature'; export class AlertingBuiltinsPlugin @@ -23,7 +23,7 @@ export class AlertingBuiltinsPlugin public setup(core: CoreSetup<StackAlertsStartDeps>, { alerting, features }: StackAlertsDeps) { features.registerKibanaFeature(BUILT_IN_ALERTS_FEATURE); - registerBuiltInAlertTypes({ + registerBuiltInRuleTypes({ logger: this.logger, data: core .getStartServices() diff --git a/x-pack/plugins/stack_alerts/server/rule_types/es_query/action_context.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/action_context.test.ts new file mode 100644 index 0000000000000..5aa40290c2f44 --- /dev/null +++ b/x-pack/plugins/stack_alerts/server/rule_types/es_query/action_context.test.ts @@ -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 { EsQueryRuleActionContext, addMessages } from './action_context'; +import { EsQueryRuleParamsSchema } from './rule_type_params'; +import { OnlyEsQueryRuleParams } from './types'; + +describe('ActionContext', () => { + it('generates expected properties', async () => { + const params = EsQueryRuleParamsSchema.validate({ + index: ['[index]'], + timeField: '[timeField]', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: '>', + threshold: [4], + searchType: 'esQuery', + }) as OnlyEsQueryRuleParams; + const base: EsQueryRuleActionContext = { + date: '2020-01-01T00:00:00.000Z', + value: 42, + conditions: 'count greater than 4', + hits: [], + link: 'link-mock', + }; + const context = addMessages('[rule-name]', base, params); + expect(context.title).toMatchInlineSnapshot(`"rule '[rule-name]' matched query"`); + expect(context.message).toEqual( + `rule '[rule-name]' is active: + +- Value: 42 +- Conditions Met: count greater than 4 over 5m +- Timestamp: 2020-01-01T00:00:00.000Z +- Link: link-mock` + ); + }); + + it('generates expected properties when isRecovered is true', async () => { + const params = EsQueryRuleParamsSchema.validate({ + index: ['[index]'], + timeField: '[timeField]', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: '>', + threshold: [4], + searchType: 'esQuery', + }) as OnlyEsQueryRuleParams; + const base: EsQueryRuleActionContext = { + date: '2020-01-01T00:00:00.000Z', + value: 42, + conditions: 'count not greater than 4', + hits: [], + link: 'link-mock', + }; + const context = addMessages('[rule-name]', base, params, true); + expect(context.title).toMatchInlineSnapshot(`"rule '[rule-name]' recovered"`); + expect(context.message).toEqual( + `rule '[rule-name]' is recovered: + +- Value: 42 +- Conditions Met: count not greater than 4 over 5m +- Timestamp: 2020-01-01T00:00:00.000Z +- Link: link-mock` + ); + }); + + it('generates expected properties if comparator is between', async () => { + const params = EsQueryRuleParamsSchema.validate({ + index: ['[index]'], + timeField: '[timeField]', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: 'between', + threshold: [4, 5], + searchType: 'esQuery', + }) as OnlyEsQueryRuleParams; + const base: EsQueryRuleActionContext = { + date: '2020-01-01T00:00:00.000Z', + value: 4, + conditions: 'count between 4 and 5', + hits: [], + link: 'link-mock', + }; + const context = addMessages('[rule-name]', base, params); + expect(context.title).toMatchInlineSnapshot(`"rule '[rule-name]' matched query"`); + expect(context.message).toEqual( + `rule '[rule-name]' is active: + +- Value: 4 +- Conditions Met: count between 4 and 5 over 5m +- Timestamp: 2020-01-01T00:00:00.000Z +- Link: link-mock` + ); + }); +}); diff --git a/x-pack/plugins/stack_alerts/server/rule_types/es_query/action_context.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/action_context.ts new file mode 100644 index 0000000000000..1dc5b5422e121 --- /dev/null +++ b/x-pack/plugins/stack_alerts/server/rule_types/es_query/action_context.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 { i18n } from '@kbn/i18n'; +import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { AlertInstanceContext } from '@kbn/alerting-plugin/server'; +import { OnlyEsQueryRuleParams, OnlySearchSourceRuleParams } from './types'; + +// rule type context provided to actions +export interface ActionContext extends EsQueryRuleActionContext { + // a short pre-constructed message which may be used in an action field + title: string; + // a longer pre-constructed message which may be used in an action field + message: string; +} + +export interface EsQueryRuleActionContext extends AlertInstanceContext { + // the date the rule was run as an ISO date + date: string; + // the value that met the threshold + value: number; + // threshold conditions + conditions: string; + // query matches + hits: estypes.SearchHit[]; + // a link to see records that triggered the rule for Discover rule + // a link which navigates to stack management in case of Elastic query rule + link: string; +} + +export function addMessages( + ruleName: string, + baseContext: EsQueryRuleActionContext, + params: OnlyEsQueryRuleParams | OnlySearchSourceRuleParams, + isRecovered: boolean = false +): ActionContext { + const title = i18n.translate('xpack.stackAlerts.esQuery.alertTypeContextSubjectTitle', { + defaultMessage: `rule '{name}' {verb}`, + values: { + name: ruleName, + verb: isRecovered ? 'recovered' : 'matched query', + }, + }); + + const window = `${params.timeWindowSize}${params.timeWindowUnit}`; + const message = i18n.translate('xpack.stackAlerts.esQuery.alertTypeContextMessageDescription', { + defaultMessage: `rule '{name}' is {verb}: + +- Value: {value} +- Conditions Met: {conditions} over {window} +- Timestamp: {date} +- Link: {link}`, + values: { + name: ruleName, + value: baseContext.value, + conditions: baseContext.conditions, + window, + date: baseContext.date, + link: baseContext.link, + verb: isRecovered ? 'recovered' : 'active', + }, + }); + + return { ...baseContext, title, message }; +} diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/constants.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/constants.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/constants.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/constants.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/executor.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/executor.test.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/executor.test.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/executor.test.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/executor.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/executor.ts similarity index 96% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/executor.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/executor.ts index f50368f29ae76..ae110adbfaa5f 100644 --- a/x-pack/plugins/stack_alerts/server/alert_types/es_query/executor.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/es_query/executor.ts @@ -20,7 +20,14 @@ import { isEsQueryRule } from './util'; export async function executor(core: CoreSetup, options: ExecutorOptions<EsQueryRuleParams>) { const esQueryRule = isEsQueryRule(options.params.searchType); - const { alertId: ruleId, name, services, params, state, spaceId, logger } = options; + const { + rule: { id: ruleId, name }, + services, + params, + state, + spaceId, + logger, + } = options; const { alertFactory, scopedClusterClient, searchSourceClient } = services; const currentTimestamp = new Date().toISOString(); const publicBaseUrl = core.http.basePath.publicBaseUrl ?? ''; @@ -75,7 +82,7 @@ export async function executor(core: CoreSetup, options: ExecutorOptions<EsQuery conditions: getContextConditionsDescription(params.thresholdComparator, params.threshold), } as EsQueryRuleActionContext; - const actionContext = addMessages(options, baseActiveContext, params); + const actionContext = addMessages(name, baseActiveContext, params); const alertInstance = alertFactory.create(ConditionMetAlertInstanceId); alertInstance // store the params we would need to recreate the query that led to this alert instance @@ -107,7 +114,7 @@ export async function executor(core: CoreSetup, options: ExecutorOptions<EsQuery true ), } as EsQueryRuleActionContext; - const recoveryContext = addMessages(options, baseRecoveryContext, params, true); + const recoveryContext = addMessages(name, baseRecoveryContext, params, true); alert.setContext(recoveryContext); } diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/index.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/index.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/index.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/index.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_es_query.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_es_query.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_es_query.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_es_query.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_search_source_query.test.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.test.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_search_source_query.test.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_search_source_query.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_search_source_query.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/get_search_params.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/get_search_params.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/get_search_params.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/get_search_params.ts diff --git a/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts new file mode 100644 index 0000000000000..b6f9136d0076e --- /dev/null +++ b/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.test.ts @@ -0,0 +1,679 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import uuid from 'uuid'; +import type { Writable } from '@kbn/utility-types'; +import { RuleExecutorServices } from '@kbn/alerting-plugin/server'; +import { + RuleExecutorServicesMock, + alertsMock, + AlertInstanceMock, +} from '@kbn/alerting-plugin/server/mocks'; +import { loggingSystemMock } from '@kbn/core/server/mocks'; +import { getRuleType } from './rule_type'; +import { EsQueryRuleParams, EsQueryRuleState } from './rule_type_params'; +import { ActionContext } from './action_context'; +import type { ESSearchResponse, ESSearchRequest } from '@kbn/es-types'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; +import { coreMock } from '@kbn/core/server/mocks'; +import { ActionGroupId, ConditionMetAlertInstanceId } from './constants'; +import { OnlyEsQueryRuleParams, OnlySearchSourceRuleParams } from './types'; +import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; +import { Comparator } from '../../../common/comparator_types'; + +const logger = loggingSystemMock.create().get(); +const coreSetup = coreMock.createSetup(); +const ruleType = getRuleType(coreSetup); + +describe('ruleType', () => { + it('rule type creation structure is the expected value', async () => { + expect(ruleType.id).toBe('.es-query'); + expect(ruleType.name).toBe('Elasticsearch query'); + expect(ruleType.actionGroups).toEqual([{ id: 'query matched', name: 'Query matched' }]); + + expect(ruleType.actionVariables).toMatchInlineSnapshot(` + Object { + "context": Array [ + Object { + "description": "A message for the alert.", + "name": "message", + }, + Object { + "description": "A title for the alert.", + "name": "title", + }, + Object { + "description": "The date that the alert met the threshold condition.", + "name": "date", + }, + Object { + "description": "The value that met the threshold condition.", + "name": "value", + }, + Object { + "description": "The documents that met the threshold condition.", + "name": "hits", + }, + Object { + "description": "A string that describes the threshold condition.", + "name": "conditions", + }, + Object { + "description": "Navigate to Discover and show the records that triggered + the alert when the rule is created in Discover. Otherwise, navigate to the status page for the rule.", + "name": "link", + }, + ], + "params": Array [ + Object { + "description": "The number of hits to retrieve for each query.", + "name": "size", + }, + Object { + "description": "An array of values to use as the threshold. 'between' and 'notBetween' require two values.", + "name": "threshold", + }, + Object { + "description": "A function to determine if the threshold was met.", + "name": "thresholdComparator", + }, + Object { + "description": "Serialized search source fields used to fetch the documents from Elasticsearch.", + "name": "searchConfiguration", + }, + Object { + "description": "The string representation of the Elasticsearch query.", + "name": "esQuery", + }, + Object { + "description": "The index the query was run against.", + "name": "index", + }, + ], + } + `); + }); + + describe('elasticsearch query', () => { + it('validator succeeds with valid es query params', async () => { + const params: Partial<Writable<OnlyEsQueryRuleParams>> = { + index: ['index-name'], + timeField: 'time-field', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.LT, + threshold: [0], + searchType: 'esQuery', + }; + + expect(ruleType.validate?.params?.validate(params)).toBeTruthy(); + }); + + it('validator fails with invalid es query params - threshold', async () => { + const paramsSchema = ruleType.validate?.params; + if (!paramsSchema) throw new Error('params validator not set'); + + const params: Partial<Writable<OnlyEsQueryRuleParams>> = { + index: ['index-name'], + timeField: 'time-field', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.BETWEEN, + threshold: [0], + searchType: 'esQuery', + }; + + expect(() => paramsSchema.validate(params)).toThrowErrorMatchingInlineSnapshot( + `"[threshold]: must have two elements for the \\"between\\" comparator"` + ); + }); + + it('rule executor handles no documents returned by ES', async () => { + const params: OnlyEsQueryRuleParams = { + index: ['index-name'], + timeField: 'time-field', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.BETWEEN, + threshold: [0], + searchType: 'esQuery', + excludeHitsFromPreviousRun: true, + }; + const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + const searchResult: ESSearchResponse<unknown, {}> = generateResults([]); + ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise(searchResult) + ); + + const result = await invokeExecutor({ params, ruleServices }); + + expect(ruleServices.alertFactory.create).not.toHaveBeenCalled(); + + expect(result).toMatchInlineSnapshot(` + Object { + "latestTimestamp": undefined, + } + `); + }); + + it('rule executor returns the latestTimestamp of the newest detected document', async () => { + const params: OnlyEsQueryRuleParams = { + index: ['index-name'], + timeField: 'time-field', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.GT, + threshold: [0], + searchType: 'esQuery', + excludeHitsFromPreviousRun: true, + }; + const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + const newestDocumentTimestamp = Date.now(); + + const searchResult: ESSearchResponse<unknown, {}> = generateResults([ + { + 'time-field': newestDocumentTimestamp, + }, + { + 'time-field': newestDocumentTimestamp - 1000, + }, + { + 'time-field': newestDocumentTimestamp - 2000, + }, + ]); + ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise(searchResult) + ); + + const result = await invokeExecutor({ params, ruleServices }); + + expect(ruleServices.alertFactory.create).toHaveBeenCalledWith(ConditionMetAlertInstanceId); + const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; + expect(instance.replaceState).toHaveBeenCalledWith({ + latestTimestamp: undefined, + dateStart: expect.any(String), + dateEnd: expect.any(String), + }); + + expect(result).toMatchObject({ + latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), + }); + }); + + it('rule executor correctly handles numeric time fields that were stored by legacy rules prior to v7.12.1', async () => { + const params: OnlyEsQueryRuleParams = { + index: ['index-name'], + timeField: 'time-field', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.GT, + threshold: [0], + searchType: 'esQuery', + excludeHitsFromPreviousRun: true, + }; + const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + const previousTimestamp = Date.now(); + const newestDocumentTimestamp = previousTimestamp + 1000; + + ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise( + generateResults([ + { + 'time-field': newestDocumentTimestamp, + }, + ]) + ) + ); + + const result = await invokeExecutor({ + params, + ruleServices, + state: { + // @ts-expect-error previousTimestamp is numeric, but should be string (this was a bug prior to v7.12.1) + latestTimestamp: previousTimestamp, + }, + }); + + const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; + expect(instance.replaceState).toHaveBeenCalledWith({ + // ensure the invalid "latestTimestamp" in the state is stored as an ISO string going forward + latestTimestamp: new Date(previousTimestamp).toISOString(), + dateStart: expect.any(String), + dateEnd: expect.any(String), + }); + + expect(result).toMatchObject({ + latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), + }); + }); + + it('rule executor ignores previous invalid latestTimestamp values stored by legacy rules prior to v7.12.1', async () => { + const params: OnlyEsQueryRuleParams = { + index: ['index-name'], + timeField: 'time-field', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.GT, + threshold: [0], + searchType: 'esQuery', + excludeHitsFromPreviousRun: true, + }; + const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + const oldestDocumentTimestamp = Date.now(); + + ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise( + generateResults([ + { + 'time-field': oldestDocumentTimestamp, + }, + { + 'time-field': oldestDocumentTimestamp - 1000, + }, + ]) + ) + ); + + const result = await invokeExecutor({ params, ruleServices }); + + const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; + expect(instance.replaceState).toHaveBeenCalledWith({ + latestTimestamp: undefined, + dateStart: expect.any(String), + dateEnd: expect.any(String), + }); + + expect(result).toMatchObject({ + latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), + }); + }); + + it('rule executor carries over the queried latestTimestamp in the rule state', async () => { + const params: OnlyEsQueryRuleParams = { + index: ['index-name'], + timeField: 'time-field', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.GT, + threshold: [0], + searchType: 'esQuery', + excludeHitsFromPreviousRun: true, + }; + const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + const oldestDocumentTimestamp = Date.now(); + + ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise( + generateResults([ + { + 'time-field': oldestDocumentTimestamp, + }, + ]) + ) + ); + + const result = await invokeExecutor({ params, ruleServices }); + + const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; + expect(instance.replaceState).toHaveBeenCalledWith({ + latestTimestamp: undefined, + dateStart: expect.any(String), + dateEnd: expect.any(String), + }); + + expect(result).toMatchObject({ + latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), + }); + + const newestDocumentTimestamp = oldestDocumentTimestamp + 5000; + ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise( + generateResults([ + { + 'time-field': newestDocumentTimestamp, + }, + { + 'time-field': newestDocumentTimestamp - 1000, + }, + ]) + ) + ); + + const secondResult = await invokeExecutor({ + params, + ruleServices, + state: result as EsQueryRuleState, + }); + + const existingInstance: AlertInstanceMock = + ruleServices.alertFactory.create.mock.results[1].value; + expect(existingInstance.replaceState).toHaveBeenCalledWith({ + latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), + dateStart: expect.any(String), + dateEnd: expect.any(String), + }); + + expect(secondResult).toMatchObject({ + latestTimestamp: new Date(newestDocumentTimestamp).toISOString(), + }); + }); + + it('rule executor ignores tie breaker sort values', async () => { + const params: OnlyEsQueryRuleParams = { + index: ['index-name'], + timeField: 'time-field', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.GT, + threshold: [0], + searchType: 'esQuery', + excludeHitsFromPreviousRun: true, + }; + const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + const oldestDocumentTimestamp = Date.now(); + + ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise( + generateResults( + [ + { + 'time-field': oldestDocumentTimestamp, + }, + { + 'time-field': oldestDocumentTimestamp - 1000, + }, + ], + true + ) + ) + ); + + const result = await invokeExecutor({ params, ruleServices }); + + const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; + expect(instance.replaceState).toHaveBeenCalledWith({ + latestTimestamp: undefined, + dateStart: expect.any(String), + dateEnd: expect.any(String), + }); + + expect(result).toMatchObject({ + latestTimestamp: new Date(oldestDocumentTimestamp).toISOString(), + }); + }); + + it('rule executor ignores results with no sort values', async () => { + const params: OnlyEsQueryRuleParams = { + index: ['index-name'], + timeField: 'time-field', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.GT, + threshold: [0], + searchType: 'esQuery', + excludeHitsFromPreviousRun: true, + }; + const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + const oldestDocumentTimestamp = Date.now(); + + ruleServices.scopedClusterClient.asCurrentUser.search.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise( + generateResults( + [ + { + 'time-field': oldestDocumentTimestamp, + }, + { + 'time-field': oldestDocumentTimestamp - 1000, + }, + ], + true, + true + ) + ) + ); + + const result = await invokeExecutor({ params, ruleServices }); + + const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; + expect(instance.replaceState).toHaveBeenCalledWith({ + latestTimestamp: undefined, + dateStart: expect.any(String), + dateEnd: expect.any(String), + }); + + expect(result).toMatchObject({ + latestTimestamp: new Date(oldestDocumentTimestamp - 1000).toISOString(), + }); + }); + }); + + describe('search source query', () => { + const dataViewMock = { + id: 'test-id', + title: 'test-title', + timeFieldName: 'time-field', + fields: [ + { + name: 'message', + type: 'string', + displayName: 'message', + scripted: false, + filterable: false, + aggregatable: false, + }, + { + name: 'timestamp', + type: 'date', + displayName: 'timestamp', + scripted: false, + filterable: false, + aggregatable: false, + }, + ], + }; + const defaultParams: OnlySearchSourceRuleParams = { + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.LT, + threshold: [0], + searchConfiguration: {}, + searchType: 'searchSource', + excludeHitsFromPreviousRun: true, + }; + + afterAll(() => { + jest.resetAllMocks(); + }); + + it('validator succeeds with valid search source params', async () => { + expect(ruleType.validate?.params?.validate(defaultParams)).toBeTruthy(); + }); + + it('validator fails with invalid search source params - esQuery provided', async () => { + const paramsSchema = ruleType.validate?.params!; + const params: Partial<Writable<EsQueryRuleParams>> = { + size: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.LT, + threshold: [0], + esQuery: '', + searchType: 'searchSource', + }; + + expect(() => paramsSchema.validate(params)).toThrowErrorMatchingInlineSnapshot( + `"[esQuery]: a value wasn't expected to be present"` + ); + }); + + it('rule executor handles no documents returned by ES', async () => { + const params = defaultParams; + const searchResult: ESSearchResponse<unknown, {}> = generateResults([]); + const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + (searchSourceInstanceMock.getField as jest.Mock).mockImplementationOnce((name: string) => { + if (name === 'index') { + return dataViewMock; + } + }); + (searchSourceInstanceMock.fetch as jest.Mock).mockResolvedValueOnce(searchResult); + + await invokeExecutor({ params, ruleServices }); + + expect(ruleServices.alertFactory.create).not.toHaveBeenCalled(); + }); + + it('rule executor throws an error when index does not have time field', async () => { + const params = defaultParams; + const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + (searchSourceInstanceMock.getField as jest.Mock).mockImplementationOnce((name: string) => { + if (name === 'index') { + return { dataViewMock, timeFieldName: undefined }; + } + }); + + await expect(invokeExecutor({ params, ruleServices })).rejects.toThrow( + 'Invalid data view without timeFieldName.' + ); + }); + + it('rule executor schedule actions when condition met', async () => { + const params = { ...defaultParams, thresholdComparator: Comparator.GT_OR_EQ, threshold: [3] }; + const ruleServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + (searchSourceInstanceMock.getField as jest.Mock).mockImplementationOnce((name: string) => { + if (name === 'index') { + return dataViewMock; + } + }); + + (searchSourceInstanceMock.fetch as jest.Mock).mockResolvedValueOnce({ + hits: { total: 3, hits: [{}, {}, {}] }, + }); + + await invokeExecutor({ params, ruleServices }); + + const instance: AlertInstanceMock = ruleServices.alertFactory.create.mock.results[0].value; + expect(instance.scheduleActions).toHaveBeenCalled(); + }); + }); +}); + +function generateResults( + docs: Array<{ 'time-field': unknown; [key: string]: unknown }>, + includeTieBreaker: boolean = false, + skipSortOnFirst: boolean = false +): ESSearchResponse<unknown, ESSearchRequest> { + const hits = docs.map((doc, index) => ({ + _index: 'foo', + _type: '_doc', + _id: `${index}`, + _score: 0, + ...(skipSortOnFirst && index === 0 + ? {} + : { + sort: (includeTieBreaker + ? ['FaslK3QBySSL_rrj9zM5', doc['time-field']] + : [doc['time-field']]) as string[], + }), + _source: doc, + })); + return { + took: 10, + timed_out: false, + _shards: { + total: 10, + successful: 10, + failed: 0, + skipped: 0, + }, + hits: { + total: { + value: docs.length, + relation: 'eq', + }, + max_score: 100, + hits, + }, + }; +} + +async function invokeExecutor({ + params, + ruleServices, + state, +}: { + params: OnlySearchSourceRuleParams | OnlyEsQueryRuleParams; + ruleServices: RuleExecutorServicesMock; + state?: EsQueryRuleState; +}) { + return await ruleType.executor({ + executionId: uuid.v4(), + startedAt: new Date(), + previousStartedAt: new Date(), + services: ruleServices as unknown as RuleExecutorServices< + EsQueryRuleState, + ActionContext, + typeof ActionGroupId + >, + params: params as EsQueryRuleParams, + state: { + latestTimestamp: undefined, + ...state, + }, + spaceId: uuid.v4(), + rule: { + id: uuid.v4(), + name: uuid.v4(), + tags: [], + consumer: '', + producer: '', + ruleTypeId: '', + ruleTypeName: '', + enabled: true, + schedule: { + interval: '1h', + }, + actions: [], + createdBy: null, + updatedBy: null, + createdAt: new Date(), + updatedAt: new Date(), + throttle: null, + notifyWhen: null, + }, + logger, + }); +} diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type_params.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.test.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type_params.test.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.test.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type_params.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type_params.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/types.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/types.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/types.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/types.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/util.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/util.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/es_query/util.ts rename to x-pack/plugins/stack_alerts/server/rule_types/es_query/util.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/alert_type.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/alert_type.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/alert_type.ts rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/alert_type.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/es_query_builder.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/es_query_builder.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/geo_containment.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/geo_containment.ts similarity index 98% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/geo_containment.ts rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/geo_containment.ts index fd86dc3d3800d..1d6c58af8c0bf 100644 --- a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/geo_containment.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/geo_containment.ts @@ -143,7 +143,7 @@ export const getGeoContainmentExecutor = (): GeoContainmentAlertType['executor'] startedAt: windowEnd, services, params, - alertId, + rule: { id: ruleId }, state, logger, }): Promise<GeoContainmentState> { @@ -155,7 +155,7 @@ export const getGeoContainmentExecutor = (): GeoContainmentAlertType['executor'] params.geoField, services.scopedClusterClient.asCurrentUser, logger, - alertId, + ruleId, params.boundaryNameField, params.boundaryIndexQuery ); @@ -170,7 +170,7 @@ export const getGeoContainmentExecutor = (): GeoContainmentAlertType['executor'] // Start collecting data only on the first cycle let currentIntervalResults: estypes.SearchResponse<unknown> | undefined; if (!windowStart) { - logger.debug(`alert ${GEO_CONTAINMENT_ID}:${alertId} alert initialized. Collecting data`); + logger.debug(`alert ${GEO_CONTAINMENT_ID}:${ruleId} alert initialized. Collecting data`); // Consider making first time window configurable? const START_TIME_WINDOW = 1; const tempPreviousEndTime = new Date(windowEnd); diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/get_context.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/get_context.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/get_context.ts rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/get_context.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/index.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/index.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/index.ts rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/index.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/__snapshots__/alert_type.test.ts.snap b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/__snapshots__/alert_type.test.ts.snap similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/__snapshots__/alert_type.test.ts.snap rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/__snapshots__/alert_type.test.ts.snap diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/alert_type.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/alert_type.test.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/alert_type.test.ts rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/alert_type.test.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/es_query_builder.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/es_query_builder.test.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/es_query_builder.test.ts rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/es_query_builder.test.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/es_sample_response.json b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/es_sample_response.json similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/es_sample_response.json rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/es_sample_response.json diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/es_sample_response_shapes.json b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/es_sample_response_shapes.json similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/es_sample_response_shapes.json rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/es_sample_response_shapes.json diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/es_sample_response_with_nesting.json b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/es_sample_response_with_nesting.json similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/es_sample_response_with_nesting.json rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/es_sample_response_with_nesting.json diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/geo_containment.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/geo_containment.test.ts similarity index 98% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/geo_containment.test.ts rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/geo_containment.test.ts index e4d4e49036f4e..fe7ed6c1cf424 100644 --- a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/geo_containment.test.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/geo_containment.test.ts @@ -518,7 +518,7 @@ describe('geo_containment', () => { boundaryIndexId: 'testBoundaryIndexId', boundaryGeoField: 'testBoundaryGeoField', }; - const alertId = 'testAlertId'; + const ruleId = 'testAlertId'; const geoContainmentState = { shapesFilters: { testShape: 'thisIsAShape', @@ -567,7 +567,10 @@ describe('geo_containment', () => { // @ts-ignore services: alertServicesWithSearchMock, params: geoContainmentParams, - alertId, + // @ts-ignore + rule: { + id: ruleId, + }, // @ts-ignore state: {}, }); @@ -587,7 +590,10 @@ describe('geo_containment', () => { // @ts-ignore services: alertServicesWithSearchMock, params: geoContainmentParams, - alertId, + // @ts-ignore + rule: { + id: ruleId, + }, state: geoContainmentState, }); if (executionResult && executionResult.shapesFilters) { @@ -606,7 +612,10 @@ describe('geo_containment', () => { // @ts-ignore services: alertServicesWithSearchMock, params: geoContainmentParams, - alertId, + // @ts-ignore + rule: { + id: ruleId, + }, state: geoContainmentState, }); if (executionResult && executionResult.shapesFilters) { @@ -642,7 +651,10 @@ describe('geo_containment', () => { // @ts-ignore services: alertServicesWithSearchMock, params: geoContainmentParams, - alertId, + // @ts-ignore + rule: { + id: ruleId, + }, state: geoContainmentState, }); if (executionResult && executionResult.prevLocationMap) { diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/get_context.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/get_context.test.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/get_context.test.ts rename to x-pack/plugins/stack_alerts/server/rule_types/geo_containment/tests/get_context.test.ts diff --git a/x-pack/plugins/stack_alerts/server/rule_types/index.ts b/x-pack/plugins/stack_alerts/server/rule_types/index.ts new file mode 100644 index 0000000000000..a9a2e15dbcb1c --- /dev/null +++ b/x-pack/plugins/stack_alerts/server/rule_types/index.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { CoreSetup, Logger } from '@kbn/core/server'; +import { AlertingSetup, StackAlertsStartDeps } from '../types'; +import { register as registerIndexThreshold } from './index_threshold'; +import { register as registerGeoContainment } from './geo_containment'; +import { register as registerEsQuery } from './es_query'; +interface RegisterRuleTypesParams { + logger: Logger; + data: Promise<StackAlertsStartDeps['triggersActionsUi']['data']>; + alerting: AlertingSetup; + core: CoreSetup; +} + +export function registerBuiltInRuleTypes(params: RegisterRuleTypesParams) { + registerIndexThreshold(params); + registerGeoContainment(params); + registerEsQuery(params); +} diff --git a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/README.md b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/README.md similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/index_threshold/README.md rename to x-pack/plugins/stack_alerts/server/rule_types/index_threshold/README.md diff --git a/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/action_context.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/action_context.test.ts new file mode 100644 index 0000000000000..ce1bcb035c778 --- /dev/null +++ b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/action_context.test.ts @@ -0,0 +1,132 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { BaseActionContext, addMessages } from './action_context'; +import { ParamsSchema } from './rule_type_params'; + +describe('ActionContext', () => { + it('generates expected properties if aggField is null', async () => { + const params = ParamsSchema.validate({ + index: '[index]', + timeField: '[timeField]', + aggType: 'count', + groupBy: 'top', + termField: 'x', + termSize: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: '>', + threshold: [4], + }); + const base: BaseActionContext = { + date: '2020-01-01T00:00:00.000Z', + group: '[group]', + value: 42, + conditions: 'count greater than 4', + }; + const context = addMessages('[rule-name]', base, params); + expect(context.title).toMatchInlineSnapshot(`"alert [rule-name] group [group] met threshold"`); + expect(context.message).toEqual( + `alert '[rule-name]' is active for group '[group]': + +- Value: 42 +- Conditions Met: count greater than 4 over 5m +- Timestamp: 2020-01-01T00:00:00.000Z` + ); + }); + + it('generates expected properties if aggField is not null', async () => { + const params = ParamsSchema.validate({ + index: '[index]', + timeField: '[timeField]', + aggType: 'avg', + groupBy: 'top', + termField: 'x', + termSize: 100, + aggField: '[aggField]', + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: '>', + threshold: [4.2], + }); + const base: BaseActionContext = { + date: '2020-01-01T00:00:00.000Z', + group: '[group]', + value: 42, + conditions: 'avg([aggField]) greater than 4.2', + }; + const context = addMessages('[rule-name]', base, params); + expect(context.title).toMatchInlineSnapshot(`"alert [rule-name] group [group] met threshold"`); + expect(context.message).toEqual( + `alert '[rule-name]' is active for group '[group]': + +- Value: 42 +- Conditions Met: avg([aggField]) greater than 4.2 over 5m +- Timestamp: 2020-01-01T00:00:00.000Z` + ); + }); + + it('generates expected properties if comparator is between', async () => { + const params = ParamsSchema.validate({ + index: '[index]', + timeField: '[timeField]', + aggType: 'count', + groupBy: 'top', + termField: 'x', + termSize: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: 'between', + threshold: [4, 5], + }); + const base: BaseActionContext = { + date: '2020-01-01T00:00:00.000Z', + group: '[group]', + value: 4, + conditions: 'count between 4 and 5', + }; + const context = addMessages('[rule-name]', base, params); + expect(context.title).toMatchInlineSnapshot(`"alert [rule-name] group [group] met threshold"`); + expect(context.message).toEqual( + `alert '[rule-name]' is active for group '[group]': + +- Value: 4 +- Conditions Met: count between 4 and 5 over 5m +- Timestamp: 2020-01-01T00:00:00.000Z` + ); + }); + + it('generates expected properties if value is string', async () => { + const params = ParamsSchema.validate({ + index: '[index]', + timeField: '[timeField]', + aggType: 'count', + groupBy: 'top', + termField: 'x', + termSize: 100, + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: 'between', + threshold: [4, 5], + }); + const base: BaseActionContext = { + date: '2020-01-01T00:00:00.000Z', + group: '[group]', + value: 'unknown', + conditions: 'count between 4 and 5', + }; + const context = addMessages('[rule-name]', base, params); + expect(context.title).toMatchInlineSnapshot(`"alert [rule-name] group [group] met threshold"`); + expect(context.message).toEqual( + `alert '[rule-name]' is active for group '[group]': + +- Value: unknown +- Conditions Met: count between 4 and 5 over 5m +- Timestamp: 2020-01-01T00:00:00.000Z` + ); + }); +}); diff --git a/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/action_context.ts b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/action_context.ts new file mode 100644 index 0000000000000..83cac7ada57f4 --- /dev/null +++ b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/action_context.ts @@ -0,0 +1,95 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { AlertInstanceContext } from '@kbn/alerting-plugin/server'; +import { Params } from './rule_type_params'; + +// rule type context provided to actions +export interface ActionContext extends BaseActionContext { + // a short pre-constructed message which may be used in an action field + title: string; + // a longer pre-constructed message which may be used in an action field + message: string; +} + +export interface BaseActionContext extends AlertInstanceContext { + // the aggType used in the rule + // the value of the aggField, if used, otherwise 'all documents' + group: string; + // the date the rule was run as an ISO date + date: string; + // the value that met the threshold + value: number | string; + // threshold conditions + conditions: string; +} + +const DEFAULT_TITLE = (name: string, group: string) => + i18n.translate('xpack.stackAlerts.indexThreshold.alertTypeContextSubjectTitle', { + defaultMessage: 'alert {name} group {group} met threshold', + values: { name, group }, + }); + +const RECOVERY_TITLE = (name: string, group: string) => + i18n.translate('xpack.stackAlerts.indexThreshold.alertTypeRecoveryContextSubjectTitle', { + defaultMessage: 'alert {name} group {group} recovered', + values: { name, group }, + }); + +const DEFAULT_MESSAGE = (name: string, context: BaseActionContext, window: string) => + i18n.translate('xpack.stackAlerts.indexThreshold.alertTypeContextMessageDescription', { + defaultMessage: `alert '{name}' is active for group '{group}': + +- Value: {value} +- Conditions Met: {conditions} over {window} +- Timestamp: {date}`, + values: { + name, + group: context.group, + value: context.value, + conditions: context.conditions, + window, + date: context.date, + }, + }); + +const RECOVERY_MESSAGE = (name: string, context: BaseActionContext, window: string) => + i18n.translate('xpack.stackAlerts.indexThreshold.alertTypeRecoveryContextMessageDescription', { + defaultMessage: `alert '{name}' is recovered for group '{group}': + +- Value: {value} +- Conditions Met: {conditions} over {window} +- Timestamp: {date}`, + values: { + name, + group: context.group, + value: context.value, + conditions: context.conditions, + window, + date: context.date, + }, + }); + +export function addMessages( + ruleName: string, + baseContext: BaseActionContext, + params: Params, + isRecoveryMessage?: boolean +): ActionContext { + const title = isRecoveryMessage + ? RECOVERY_TITLE(ruleName, baseContext.group) + : DEFAULT_TITLE(ruleName, baseContext.group); + + const window = `${params.timeWindowSize}${params.timeWindowUnit}`; + + const message = isRecoveryMessage + ? RECOVERY_MESSAGE(ruleName, baseContext, window) + : DEFAULT_MESSAGE(ruleName, baseContext, window); + + return { ...baseContext, title, message }; +} diff --git a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/index.ts b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/index.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/index_threshold/index.ts rename to x-pack/plugins/stack_alerts/server/rule_types/index_threshold/index.ts diff --git a/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.test.ts new file mode 100644 index 0000000000000..12991ec5c94aa --- /dev/null +++ b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.test.ts @@ -0,0 +1,433 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import uuid from 'uuid'; +import sinon from 'sinon'; +import type { Writable } from '@kbn/utility-types'; +import { loggingSystemMock } from '@kbn/core/server/mocks'; +import { RuleExecutorServices } from '@kbn/alerting-plugin/server'; +import { getRuleType, ActionGroupId } from './rule_type'; +import { ActionContext } from './action_context'; +import { Params } from './rule_type_params'; +import { TIME_SERIES_BUCKET_SELECTOR_FIELD } from '@kbn/triggers-actions-ui-plugin/server'; +import { RuleExecutorServicesMock, alertsMock } from '@kbn/alerting-plugin/server/mocks'; +import { Comparator } from '../../../common/comparator_types'; + +let fakeTimer: sinon.SinonFakeTimers; + +describe('ruleType', () => { + const logger = loggingSystemMock.create().get(); + const data = { + timeSeriesQuery: jest.fn(), + }; + const alertServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + + const ruleType = getRuleType(Promise.resolve(data)); + + beforeAll(() => { + fakeTimer = sinon.useFakeTimers(); + }); + + afterEach(() => { + data.timeSeriesQuery.mockReset(); + }); + + afterAll(() => fakeTimer.restore()); + + it('rule type creation structure is the expected value', async () => { + expect(ruleType.id).toBe('.index-threshold'); + expect(ruleType.name).toBe('Index threshold'); + expect(ruleType.actionGroups).toEqual([{ id: 'threshold met', name: 'Threshold met' }]); + + expect(ruleType.actionVariables).toMatchInlineSnapshot(` + Object { + "context": Array [ + Object { + "description": "A pre-constructed message for the alert.", + "name": "message", + }, + Object { + "description": "A pre-constructed title for the alert.", + "name": "title", + }, + Object { + "description": "The group that exceeded the threshold.", + "name": "group", + }, + Object { + "description": "The date the alert exceeded the threshold.", + "name": "date", + }, + Object { + "description": "The value that exceeded the threshold.", + "name": "value", + }, + Object { + "description": "A string describing the threshold comparator and threshold", + "name": "conditions", + }, + ], + "params": Array [ + Object { + "description": "An array of values to use as the threshold; 'between' and 'notBetween' require two values, the others require one.", + "name": "threshold", + }, + Object { + "description": "A comparison function to use to determine if the threshold as been met.", + "name": "thresholdComparator", + }, + Object { + "description": "index", + "name": "index", + }, + Object { + "description": "timeField", + "name": "timeField", + }, + Object { + "description": "aggType", + "name": "aggType", + }, + Object { + "description": "aggField", + "name": "aggField", + }, + Object { + "description": "groupBy", + "name": "groupBy", + }, + Object { + "description": "termField", + "name": "termField", + }, + Object { + "description": "filterKuery", + "name": "filterKuery", + }, + Object { + "description": "termSize", + "name": "termSize", + }, + Object { + "description": "timeWindowSize", + "name": "timeWindowSize", + }, + Object { + "description": "timeWindowUnit", + "name": "timeWindowUnit", + }, + ], + } + `); + }); + + it('validator succeeds with valid params', async () => { + const params: Partial<Writable<Params>> = { + index: 'index-name', + timeField: 'time-field', + aggType: 'count', + groupBy: 'all', + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.LT, + threshold: [0], + }; + + expect(ruleType.validate?.params?.validate(params)).toBeTruthy(); + }); + + it('validator fails with invalid params', async () => { + const paramsSchema = ruleType.validate?.params; + if (!paramsSchema) throw new Error('params validator not set'); + + const params: Partial<Writable<Params>> = { + index: 'index-name', + timeField: 'time-field', + aggType: 'foo', + groupBy: 'all', + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.GT, + threshold: [0], + }; + + expect(() => paramsSchema.validate(params)).toThrowErrorMatchingInlineSnapshot( + `"[aggType]: invalid aggType: \\"foo\\""` + ); + }); + + it('should ensure 0 results fires actions if it passes the comparator check', async () => { + data.timeSeriesQuery.mockImplementation((...args) => { + return { + results: [ + { + group: 'all documents', + metrics: [['2021-07-14T14:49:30.978Z', 0]], + }, + ], + }; + }); + const params: Params = { + index: 'index-name', + timeField: 'time-field', + aggType: 'foo', + groupBy: 'all', + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.LT, + threshold: [1], + }; + + await ruleType.executor({ + executionId: uuid.v4(), + startedAt: new Date(), + previousStartedAt: new Date(), + services: alertServices as unknown as RuleExecutorServices< + {}, + ActionContext, + typeof ActionGroupId + >, + params, + state: { + latestTimestamp: undefined, + }, + spaceId: uuid.v4(), + rule: { + id: uuid.v4(), + name: uuid.v4(), + tags: [], + consumer: '', + producer: '', + ruleTypeId: '', + ruleTypeName: '', + enabled: true, + schedule: { + interval: '1h', + }, + actions: [], + createdBy: null, + updatedBy: null, + createdAt: new Date(), + updatedAt: new Date(), + throttle: null, + notifyWhen: null, + }, + logger, + }); + + expect(alertServices.alertFactory.create).toHaveBeenCalledWith('all documents'); + }); + + it('should ensure a null result does not fire actions', async () => { + const customAlertServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + data.timeSeriesQuery.mockImplementation((...args) => { + return { + results: [ + { + group: 'all documents', + metrics: [['2021-07-14T14:49:30.978Z', null]], + }, + ], + }; + }); + const params: Params = { + index: 'index-name', + timeField: 'time-field', + aggType: 'foo', + groupBy: 'all', + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.LT, + threshold: [1], + }; + + await ruleType.executor({ + executionId: uuid.v4(), + startedAt: new Date(), + previousStartedAt: new Date(), + services: customAlertServices as unknown as RuleExecutorServices< + {}, + ActionContext, + typeof ActionGroupId + >, + params, + state: { + latestTimestamp: undefined, + }, + spaceId: uuid.v4(), + rule: { + id: uuid.v4(), + name: uuid.v4(), + tags: [], + consumer: '', + producer: '', + ruleTypeId: '', + ruleTypeName: '', + enabled: true, + schedule: { + interval: '1h', + }, + actions: [], + createdBy: null, + updatedBy: null, + createdAt: new Date(), + updatedAt: new Date(), + throttle: null, + notifyWhen: null, + }, + logger, + }); + + expect(customAlertServices.alertFactory.create).not.toHaveBeenCalled(); + }); + + it('should ensure an undefined result does not fire actions', async () => { + const customAlertServices: RuleExecutorServicesMock = alertsMock.createRuleExecutorServices(); + data.timeSeriesQuery.mockImplementation((...args) => { + return { + results: [ + { + group: 'all documents', + metrics: [['2021-07-14T14:49:30.978Z', undefined]], + }, + ], + }; + }); + const params: Params = { + index: 'index-name', + timeField: 'time-field', + aggType: 'foo', + groupBy: 'all', + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.LT, + threshold: [1], + }; + + await ruleType.executor({ + executionId: uuid.v4(), + startedAt: new Date(), + previousStartedAt: new Date(), + services: customAlertServices as unknown as RuleExecutorServices< + {}, + ActionContext, + typeof ActionGroupId + >, + params, + state: { + latestTimestamp: undefined, + }, + spaceId: uuid.v4(), + rule: { + id: uuid.v4(), + name: uuid.v4(), + tags: [], + consumer: '', + producer: '', + ruleTypeId: '', + ruleTypeName: '', + enabled: true, + schedule: { + interval: '1h', + }, + actions: [], + createdBy: null, + updatedBy: null, + createdAt: new Date(), + updatedAt: new Date(), + throttle: null, + notifyWhen: null, + }, + logger, + }); + + expect(customAlertServices.alertFactory.create).not.toHaveBeenCalled(); + }); + + it('should correctly pass comparator script to timeSeriesQuery', async () => { + data.timeSeriesQuery.mockImplementation((...args) => { + return { + results: [ + { + group: 'all documents', + metrics: [['2021-07-14T14:49:30.978Z', 0]], + }, + ], + }; + }); + const params: Params = { + index: 'index-name', + timeField: 'time-field', + aggType: 'foo', + groupBy: 'all', + timeWindowSize: 5, + timeWindowUnit: 'm', + thresholdComparator: Comparator.LT, + threshold: [1], + }; + + await ruleType.executor({ + executionId: uuid.v4(), + startedAt: new Date(), + previousStartedAt: new Date(), + services: alertServices as unknown as RuleExecutorServices< + {}, + ActionContext, + typeof ActionGroupId + >, + params, + state: { + latestTimestamp: undefined, + }, + spaceId: uuid.v4(), + rule: { + id: uuid.v4(), + name: uuid.v4(), + tags: [], + consumer: '', + producer: '', + ruleTypeId: '', + ruleTypeName: '', + enabled: true, + schedule: { + interval: '1h', + }, + actions: [], + createdBy: null, + updatedBy: null, + createdAt: new Date(), + updatedAt: new Date(), + throttle: null, + notifyWhen: null, + }, + logger, + }); + + expect(data.timeSeriesQuery).toHaveBeenCalledWith( + expect.objectContaining({ + query: { + aggField: undefined, + aggType: 'foo', + dateEnd: '1970-01-01T00:00:00.000Z', + dateStart: '1970-01-01T00:00:00.000Z', + groupBy: 'all', + index: 'index-name', + interval: undefined, + termField: undefined, + termSize: undefined, + timeField: 'time-field', + timeWindowSize: 5, + timeWindowUnit: 'm', + }, + condition: { + conditionScript: `${TIME_SERIES_BUCKET_SELECTOR_FIELD} < 1L`, + resultLimit: 1000, + }, + }) + ); + }); +}); diff --git a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type.ts b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts similarity index 97% rename from x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type.ts rename to x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts index 2fcb36b267d6d..8b347d58de18c 100644 --- a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts @@ -134,7 +134,12 @@ export function getRuleType( async function executor( options: RuleExecutorOptions<Params, {}, {}, ActionContext, typeof ActionGroupId> ) { - const { alertId: ruleId, name, services, params, logger } = options; + const { + rule: { id: ruleId, name }, + services, + params, + logger, + } = options; const { alertFactory, scopedClusterClient } = services; const alertLimit = alertFactory.alertLimit.getValue(); @@ -229,7 +234,7 @@ export function getRuleType( value, conditions: humanFn, }; - const actionContext = addMessages(options, baseContext, params); + const actionContext = addMessages(name, baseContext, params); const alert = alertFactory.create(alertId); alert.scheduleActions(ActionGroupId, actionContext); logger.debug(`scheduled actionGroup: ${JSON.stringify(actionContext)}`); @@ -249,7 +254,7 @@ export function getRuleType( params.thresholdComparator )} ${params.threshold.join(' and ')}`, }; - const recoveryContext = addMessages(options, baseContext, params, true); + const recoveryContext = addMessages(name, baseContext, params, true); recoveredAlert.setContext(recoveryContext); } } diff --git a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type_params.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type_params.test.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type_params.test.ts rename to x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type_params.test.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type_params.ts b/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type_params.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/index_threshold/rule_type_params.ts rename to x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type_params.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/lib/comparator.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/lib/comparator.test.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/lib/comparator.test.ts rename to x-pack/plugins/stack_alerts/server/rule_types/lib/comparator.test.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/lib/comparator.ts b/x-pack/plugins/stack_alerts/server/rule_types/lib/comparator.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/lib/comparator.ts rename to x-pack/plugins/stack_alerts/server/rule_types/lib/comparator.ts diff --git a/x-pack/plugins/stack_alerts/server/alert_types/lib/index.ts b/x-pack/plugins/stack_alerts/server/rule_types/lib/index.ts similarity index 100% rename from x-pack/plugins/stack_alerts/server/alert_types/lib/index.ts rename to x-pack/plugins/stack_alerts/server/rule_types/lib/index.ts diff --git a/x-pack/plugins/stack_alerts/tsconfig.json b/x-pack/plugins/stack_alerts/tsconfig.json index 9df9ddd06cfe5..1aadefdb18304 100644 --- a/x-pack/plugins/stack_alerts/tsconfig.json +++ b/x-pack/plugins/stack_alerts/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "server/**/*", @@ -12,7 +11,7 @@ "public/**/*", "common/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../alerting/tsconfig.json" }, { "path": "../features/tsconfig.json" }, diff --git a/x-pack/plugins/stack_connectors/public/connector_types/cases/jira/logo.tsx b/x-pack/plugins/stack_connectors/public/connector_types/cases/jira/logo.tsx index 945dc955e4b20..5ce3e292690c1 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/cases/jira/logo.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/cases/jira/logo.tsx @@ -10,26 +10,39 @@ import { LogoProps } from '../../types'; const Logo = (props: LogoProps) => ( <svg + version="1.2" + baseProfile="tiny-ps" + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 1588 1588" width="32" height="32" - viewBox="0 0 32 32" - fill="none" - xmlns="http://www.w3.org/2000/svg" - xmlnsXlink="http://www.w3.org/1999/xlink" {...props} > - <rect width="32" height="32" fill="url(#pattern0)" /> <defs> - <pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1"> - <use xlinkHref="#image0" transform="translate(-0.0625 -0.0625) scale(0.0028125)" /> - </pattern> - <image - id="image0" - width="400" - height="400" - xlinkHref="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAgAElEQVR4Ae29C7AtV3nf+V/d+5z7vtJ9SLq6uhhJCMlIYDE8BALZkqGUKGEiLNBFICGwwfIjDmLkIcEPJjqqMinjmXKqQlK4aqbGk3gmsU0m44mTSuKZcimOExITKiPLkvVCKNZFgJCAi6R77zln715T33r1Wt29z9nnnP3o3vu/QWev/tZa3/rWb+37ffvr1d0b4IsESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAESIAEukxAddl42k4CYydwUuevuQZHljK8qt/DfgBrgwLPvbqPrz+4ovpjH48KSaDDBBhAOrx4NH2MBLRWl30WP5ADn8mAdwK4GMAeCSAAvq0V/kxpfPaJh/AVfFENxjgyVZFAZwkwgHR26Wj42Ais6Oy1Cu9WOX4DwGUAmv5daBNIgM+/0sevP7eizoxtfCoigY4SyDpqN80mgbERuGIZb1M5/iGAy4cEDxlLgsqFCvjM3hyfuGlF98ZmABWRQEcJMIB0dOFo9ngIvGZFX5gV+HV3ymoUpbsyhV/+ZoZrR2nMNiQwzwQYQOZ5dTm3DQlIFpHluAPAmzdsWK/cXyh86sR9z8oeCV8ksLAEGEAWduk58ecyXKMUfhHA0hZpKKVw6/5DJ67eYj82J4G5IsAAMlfLycmMSuCqz+kDOsPfBHBs1D5xOw3sHWS474pP6F2xnGUSWCQCDCCLtNqcqyWgtRqs4xYF3L7BpvmmtBRwa3YBfnDThmxAAnNKgAFkTheW0xpOQO73yIAHAOw0ezigMnzy+IreO3w01pDA/BJgAJnfteXMGgjIKae8KO4FxpM5aOD2vcu8IqsBNUULQIABZAEWmVMsCWQX4dosy+7ZyamrUpspHUCBj8meSkXOQxKYewIMIHO/xJygJ+Cc/KcAjNXZZ8Adep1ZiOfM98UhwACyOGu98DNVfbwDwK0TALG/AD7KLGQCZKmy1QQYQFq9PDRuXASuWtHHC43PjGHjvMkkxSykCQtl806AAWTeV5jzA7RWWMItAN42QRz7FbgXMkG+VN1CAgwgLVwUmjReApc/gNdqjV/exh3nWzFEHrbIvZCtEGPbzhNgAOn8EnICGxFwz7u6DcClG7UbR52W3w/RuId7IeOgSR1dIMAA0oVVoo3bJiDPu8oUPglgGp91eUbW7bwia9vLxY4dIzCNf1QdQ0Jz54WA3CGuFT603eddbYeDZCG8Ims75NiniwQYQLq4arR5JAL7e3i9UvjJMd40OMq4Kgfu1Ot43SiN2YYEukyAAaTLq0fbhxKQ7KMoCvmtj8NDG02oQrIQpXhF1oTwUm2LCDCAtGgxaMr4CEj2kWXZx6ecffgJKK1NFsJfLfRE+D6XBBhA5nJZF3tSUfZxcIYk9gP4EK/ImuEKcOiJE2AAmThiDjBtAgczvC7Lso/NKPvw05X7Qu4aDPAmL+A7CcwbAQaQeVvRBZ/P1St6ucjM867OawGKg1mBDzALacFK0ISJEGAAmQhWKp0VgTWsXQFgnI9r38lUmIXshB77tp4AA0jrl4gGjkzgpM5VvvxuABeN3GfyDU0Wcvmv6jZkRJOfLUdYKAIMIAu13PM92cuvwWuUws9O6a7zUWFKFnK3WuVeyKjA2K47BBhAurNWtHQjAis6W1rCDQDkFFbbXvtVjjsvXdHnt80w2kMCOyHAALITeuzbGgKX9fAqrc3ex1JrjCoNMb8XsryEN5tHy5dylkig0wQYQDq9fDTeENBaLQNvVMAPtZiI/F7IyUsfAPdCWrxING1rBBhAtsaLrVtI4PLPQW4YfK8G9rbQPG+SuTu9t8zfTvdA+N59Agwg3V/DxZ6B1iorcLUG3tMBEAfkvhBekdWBlaKJIxFgABkJExu1lcBNDyBXBeTS3aNttbFi111ZgTdWZDwkgU4SYADp5LLRaE/gL4DLFfATLbt015vX9H4w03g/r8hqQkNZ1wgwgHRtxWhvSWBFZ3mGtwB4VSlsfUlB4+5c4b9pvaU0kAQ2IcAAsgkgVreXwKXAQWT4qwDaeOnuRuDOy3Pczr2QjRCxrgsEGEC6sEq0sZFAbxmvU8AtjZXtFsrd6Xf0BngL7wtp90LRuo0JMIBszIe1bSVwUueZxjsAHGqriZvYdVjuC3GXIG/SlNUk0E4CDCDtXBdatQmBq67BRdDmse1d/QzLfSG3MwvZZKFZ3WoCXf3H12qoNG7CBLRWesnckNf1jehDvDt9wp8Vqp8oAQaQieKl8kkQuPoBLEHj7QD2TUL/FHVmWuOO3Ut4G/dCpkidQ42NAAPI2FBS0bQInO3h4kKbq6/m4fN7sK9xO5+RNa1PD8cZJ4F5+Ac4Th7U1XYC7sGJmcJVbTd1RPuyDLidWciItNisVQQYQFq1HDRmMwJX3IvlQuP6OTh9FU/1vELjVmYhMRKWu0CAAaQLq0QbA4HBRTimYZ59NU+fXbkv5E7+XkhYZhY6QmCe/hF2BDnN3DYBrVVP4w2Zwmu3raO9Hc0j6XlfSHsXiJbVCTCA1JlQ0lICcvpKKbwV7f7dj+3Sy6BxZ76K63hF1nYRst+0CTCATJs4x9s2gfwIjgD4SwB621bS7o6Hsh7ezyyk3YtE60oCDCAlC5baTGBFZ4NdeD2AywHInsE8vuS+kNt4d/o8Lu18zokBZD7Xde5mdROQZQXe0OFnX426Jkf5jKxRUbHdrAkwgMx6BTj+SASeAfZr4Efm+PSV52CyELMXsqL579NT4XsrCfAD2sploVEJAbl5MMOrlTansOb19FU85aM6xwfM753EUpZJoGUEGEBatiA0p4HAB5CpHG8GcEFD7TyK5O70W5eXcD2Yhczj+s7NnBhA5mYp53ciVxxDryhw5Zzdfb7Zgh1VGieZhWyGifWzJMAAMkv6HHskAvoIzlMKN87x1VdNHDIN3LqU4wZmIU14KGsDAQaQNqwCbRhOQGullvG6Ob98d9j8D2mF916+GweGNaCcBGZJgAFklvQ59qYEbnoAea7xGgXs37Tx/DWQvRC5L+QdvDt9/hZ3HmbEADIPqzjHczj1InLZ/9DA7jme5kZTk18tfO9Vv7aQAXQjLqxrAQEGkBYsAk0YTqB3Mfa7518t6mdV7gu5fXCuzyxk+MeENTMisKj/KGeEm8NulUBR4DVQ5gqsrXadp/YH817vNmYh87Sk8zEXBpD5WMf5nMVJnesCV0DjvPmc4MizWpJnZBXn8HZekTUyMzacAgEGkClA5hDbIyD3fyAzD09c1P2PGNyhLMeHeEVWjITlWRNgAJn1CnD8oQTyE1jWwKsX4PlXQxlEFUsaeI95Ui/vTo+wsDhLAgwgs6TPsTcmcBYHlDY/ILUIz7/amIWtPaQ07mIWMgoqtpkGAQaQaVDmGNsiMFjGa5XChdvqPJ+dJAu5hVnIfC5uF2fFANLFVVsEm09qfwPhom+gV1dbnpF111V7sK9awWMSmDYBBpBpE+d4IxEwD1DUOK6BpZE6LE4jsxdSrOFGXpG1OIve1pkygLR1ZRbcLtlAz+zP1+YLjqJp+uZXC5mFNKGhbJoEGECmSZtjjUygfxZ7CuAyAPyM1qllULjFZCFa8wKDOh9KpkSA/zinBJrDbIGA1irPcLECfmALvRat6dFM4X3HH8CeRZs459seAgwg7VkLWuIJPAClMlwKLPwd6J5I07v8Xsh79i/hRj6ptwkPZdMgwAAyDcocY2sEHoEqgIuxmI9w3wqro4VmFrIVYGw7XgIMIOPlSW1jICBXYCkbQPj53Jin/F4Is5CNGbF2ggT4D3SCcKl6ewTkCqwCOL693gvX6yL57XQ+qXfh1r0VE2YAacUy0IiYgBqYS3j5DKwYyvCy7IXcMihwPe8LGQ6JNZMhwAAyGa7UugMCeg27AJwAwEtUR+N4Udbn3emjoWKrcRJgABknTeraOQGtle7hBBQO7FzZwmiQ+0Ju1n1cxyuyFmbNWzFRBpBWLAONCATkEl7ZQNe8vyEwGa1wEQp8hHsho8Fiq/EQYAAZD0dqGReBR6CgcATA8rhULoieDBnepfu4gVnIgqx4C6bJANKCRaAJJYGbroHSwCEA/BXCEstoJXn4pMZdvDt9NFxstXMCDCA7Z0gNYyRw6kXk0Dg4RpWLpCpTwLsO9HAzs5BFWvbZzZUBZHbsOXIDAbkHRClcBIBP4W3gM4LoogI4eeLnTzGDGwEWm+yMAAPIzvix95gJyD0gGrhgzGoXSV2mFG7cc/jEu5mFLNKyz2auDCCz4c5RhxBYX0OuNQ4PqaZ4FAIax6HwwSvu5YUIo+Bim+0TYADZPjv2nACBHtCDNpvovIlw+3xNFpIdw7u2r4I9SWBzAgwgmzNiiykSWAf2K3sTIQPITri7K7Ku+ISWu/r5IoGJEGAAmQhWKt0ugeUMB6B46mW7/KJ+JgvB0f5N3AuJqLA4VgIMIGPFSWU7IqC1WpdLeDWvwNoRR99Z47jKe3fziiwPhO/jJsAAMm6i1Ld9Ag9AZRn28S707SOs9LRXZJ1/gnenV8DwcDwEGEDGw5FaxkHgESitzDOweA/IOHiKDo1LVIaPMQsZF1DqiQkwgMQ0WJ45gZwb6ONeA4UMN+w/euJHxq2Y+kiAAYSfgdYQkOdgFdpsoPNzOc5V0bik0Pg4r8gaJ1TqEgL8h8rPQbsIaCwpPsZk3GsiTzi+Xl2Im8etmPoWmwADyGKvf+tmrzLzKBPugYx7ZexeyE8wCxk32MXWxwCy2OvfutkXBXqtM2o+DJIbM6/j3enzsZhtmQUDSFtWgnaQwKQJaFwC4CdvWtEM0pNmvSD6GUAWZKG7Mk2lsNQVWztop4LG9ad28RlZHVy7VprMANLKZVlMo54vL+rg53JyH4Fj2YBZyOTwLpZm/kNdrPVu/WwVmIFMeJFkL+SGryv86ITHofoFIMAAsgCLzCmSQIXAMZXjHu6FVKjwcMsEGEC2jIwdJklAA+uT1E/dhoDJQp5bwo3kQQI7IcAAshN67DtWAhcChdYmgBRjVUxlTQSOQeOneV9IExrKRiXAADIqKbYjgfkiYLKQ7BhumK9pcTbTJMAAMk3aHGtTAlmG/qaN2GBcBI4B+OvMQsaFc/H0MIAs3pq3fsYKGLTeyPkw0NwXguPcC5mP5Zz+LBhAps+cI25AQBdY26CaVeMncEwV+LmrV/Ty+FVT47wTYACZ9xXu2PyyDK9oZiDTXDWlNN6+rpiFTBP6vIzFADIvKzkH83jwEehigHNgAJn2al6AHv4G7wuZNvbuj8cA0v01nJ8ZXAMtGQgDyNSX1GQhzyr88NRH5oCdJsAA0unlmz/jBznOMoDMZF0vyHr475iFzIR9ZwdlAOns0s2h4fdDZwOcYQCZydqaLOS5Ht4+k9E5aCcJMIB0ctnm1GhxYQVe0lrzcSazWeILtcLfZBYyG/hdHJUBpIurNsc2r2f4nlJK9kH4mgEBuSKLWcgMwHd0SAaQji7cvJqd9c0eyIsA9LzOseXzugDAvbwvpOWr1BLzGEBashA0wxJYWsZAK3yHAWRmnwh5RtaN/R6um5kFHLgzBBhAOrNUi2GozrGmCnxvMWbb2lmaLITPyGrt+rTGMAaQ1iwFDRECL53FABlO80qsmX4eTBaSXYS3ztQKDt56AgwgrV+ixTLwSmBNazy/WLNu5WwvgMJ9zEJauTatMYoBpDVLQUOEgDzOBMALir9MOOsPhDyp90ZczPtCZr0QbR6fAaTNq7OgtmngRQ0+lbcFy39Yafw8r8hqwUq01IReS+2iWTMnoBVOIju8/NS+s2uvHBBzDl1z7XefewSr+KKa3O91XAONDM+jMJfznj9zDIttgNza+c61ZbwZwJcWGwVn30RANsv4IoGEgHzjfObpp645d+7szVoXPwqtD0kDlamvFYP+H+3etfxv3n7lG/7iwRU1/l8P1Fpd/gBe2+vhXwG4PDGMB7MgoLXC71+yjvdPZL1nMSOOOTYCDCBjQzknij70+NFssPoxXQw+Ca0vApBXZibZx1d37d39K0ePHvinp/7uq+Thh2N9vWZFX5j38H8DPP8+VrDbVyaXVf/lJz6j/mT7KthzHglwD2QeV3Wbczp815MHs8HZz+tB/+9A6+MNwUM0S0C5cvXMud889Rff+vET9z27Z5vDDe02kP0PjWcAFEMbsWKaBM7XCr/MZ2RNE3k3xmIA6cY6TdxKcQ6vZIMH9KA4OSRwVG3Ilcr/xxdeeOn2cW+y9k+fWtXAf+W9IFXkszuWvZBvZrh2dhZw5DYSYABp46rMwKb/8OSjVw7W1u5SmcpVpmS/Y3MrtN63enb1C0899mfvGWcQueK8E+sqw7eZgWy+BFNscaTI8UvjXOcp2s6hJkSAAWRCYLukVrKP/vr6/1AUA3mERXiNGkTW+/2///TTf/4j4zrF8SBQ6AG+AV7KG9aiFQWNG90VWa0wh0bMngADyOzXYOYWSPaRqezdSinIf/FrpGxE6+Orr5z7B3/y9FNvwIre+Wfqfmjdw9cBvBzbwvLMCRzJBriXd6fPfB1aY8DO/7G3Zio0ZHsEtNKF/ltaFyH7qAYR0TtCNnLl2TMvf2H3Ew9fCug0Cm3DsHwNT/KRJtsAN+kuCjfjYrxp0sNQfzcIMIB0Y50mZuXyXY++ThfFX0U189hONqL1W9b6xWfxoSeO7MhgpfT6bryiFJ7gY913RHISnQ8zC5kE1m7qZADp5rqNxWrZs1DI7tXQNvuQILKzQJLLVVzZ4JWf3enlvWvfOiUPVXwawPhvVhwLvYVVoqBwC7OQhV3/ZOIMIAmOxTowV171199XO2U1JJBU6QzZH8l1oT79rW+c/vBOrtiRK7EAfJ0PVaxSb8XxeUrjF7gX0oq1mKkRDCAzxT+7wcW5S/YBBZN91IKImFYJJNLG/xdbXtsf0Xpfv7++Ildm4aSu3skedx1afvB+DDKFv+BDFYcimmWFPCPrR7OLeF/ILBehDWMzgLRhFWZgw1NPPnrFoL/+vnjopuBg6iuntURWDTi1bESuzDqz+it78NCxbW2qK6UH/bUnAfPztrGZLLeDwH65O30nWWY7pkErdkKAAWQn9Dra12cfKlMXNAWNJlk1G5GpN7XzgcRkJVq/pd/rffbwXU+Zp/luFVcfy89phT/baj+2nwoBk4X0M7xuKqNxkFYSYABp5bJM1qhh2Ud11GqWYeqHZCNNbeWu9v76+u3fOXf6ru18U+29iLMo8Oe8I726Mq05PoAcf3tcN5C2ZlY0ZGQCDCAjo5qPhj77yPLMZB/xrBoziobLeZuyEdHTGEQU9imVf8bsh2zxJsMTRzCAwjMKOBfbyXKLCGjc/FyGa1pkEU2ZIgEGkCnCbsNQ1ezDBA2k9/3tJJA094XZD8HjTxzeyn6IbKQrhf+qYX5cqg34aEOdwAFk3AupY1kMCQPIYqyzmaVkH3LXedbLL0AcNMztH3J5/wQDidZv6Q1W7z1x36ndIyNXSqt1PATg+ZH7sOEsCNxcZHjDLAbmmLMlwAAyW/5THV2yj95S76+ZQSVWVPczXCCpGtWcVdSfm1XTF53Wkv0QKPzM89/43i1bubT3JeB7BfDveUd6dVVadXz+IMN9vC+kVWsyFWMYQKaCuQWDnNS5ZB9FURxOrDFBpCHzqGQj0kcCSfVVk0mbSjsfgOR5W+v9/qfRe+LQqKeyrgTWMoXHeEd6lXy7jhXwHt6d3q41mYY1DCDToNyCMXYvPfxqn314hx7MCtlIFCAmcFpLxst7+ZvkVNbVK1gK429QkEe7K42nALyyQTNWzZ7A+dkAP7PTR9jMfhq0YCsEGEC2QqurbSX7yJc/Uc0+thJIqlOvZR4uQ6nJKxmJLoqlQTH4uPwI1UinslZUsQb8f4D5fZCqGTxuEwGF9+49coJ7IW1akwnbwgAyYcBtUL+8/OhVmcJHagHDGVd3+vX9kaa+TTJRWdNnhQFFlqnj64PBT416Kmt5Cd+Bxpe5DxIQtrVwEBr3HV/Re9tqIO0aLwEGkPHybJ02c99Hlt+jtQ57H02Ov0lm9zKi01pDsoymvk0yo89nJFr/cDZY/dgop7IuPouzGvjP3Adp3cerapBcyPee/T28vlrB4/kkwAAyn+saZiVXXoXso7Ix3uTka7Km/REfSLajz1mW5dk+Peh//Jmnn7pmsw11sw+S4VEA3w0TY6GtBPYD+BT3Qtq6POO1iwFkvDxbpc1nHwBs9iEb4xWnLwZL0Ki+arKmQLLBRnuTvqrOfKl32WDQ/+lN7w1ZUYVaN480kd8H0VXdPG4VAfmk3LL/0ImrW2UVjZkIAQaQiWBth1KffYz3pkGZWyXgNASmWibjkMRBRGu9JE8EHuXekMGLeFFr/FsGkHZ8tjaxYn+h8CneF7IJpTmoZgCZg0VsmoKcQlBZfo9S6rBNMEwKUTbdIHuInbx0qAWDLWYjw/SJXH4NUTbUDy8/ta80rl566gjWofGnvJy3zqaFErMXkl2AH2yhbTRpjAQYQMYIs02qnn/++5fJ3ofPFvzetT8OtrrsoXpqqxY0JhBIxAYTXLT+4ZcGq3dseFnv/dC6WJPLeb8dbGehzQQOQOHnmYW0eYl2bhsDyM4Ztk6DyT6Q3auy7LA921SecrKBxGcjTu4Oq0FEJlbNHhplpr/X6XC4DKcKp0lf3svlFww/bi/rrfbw+pTO9yw/WwB/yMe7D2HUNrHCbcxC2rYo47WHAWS8PFuh7TsvnvvBvJd/OBjT4OAbM5KdnNaSwcI4YeT66a+mTMbdoW4v69XLZe+09Ph/xplc4Ut8vHvKpcVHB1SGT/K+kBav0A5NYwDZIcC2dZcrr+TKJpWpfZJRJFlFcPBSsK80I/FCt+9R2Swf6bSWqBClW++71OvlH3z6iYdPDL2s93dR6AG+ooFvOkv51nICGnjf3mX+dnrLl2nb5jGAbBtdOzuaK69yddJY5/x4YyCpOXjpUQYW37/Wd0gGUQsuZuyKPt+3Mo7vWxSD16/1+3cNvblQKd1fxjMa+BKvxmrn56/BqvNQ4GPMQhrIzIGIAWQOFtFPQbKP3bv3fDzPe4frmYeEh8ihBwdfyoZlI9It6esGbNrPqMkashGjz8i95fZdKbXU6+26baMs5Omv4GUAfwxgLe3No7YSyIA7mIW0dXV2ZhcDyM74taq3ZB9Q2UdMnGi6umqIrHrKaVggMZlCHIR8RlEJBj6jCHAagpXUNemTLKTfx48PzUK+qAZ5gS9D8WqswLf9hf3MQtq/SNuxkAFkO9Ra2Ecul5TsoygGR8OpKOO4bfYQMogmmczHJCKu0s3PxoVU5rOHoC+0rf/A1EiBpLJxL1lI1sv/WxMMh3DWu/CEAv4lT2MNAdQ+sZIsZH8Pb2qfabRoJwQYQHZCr0V9nzv91NWSfdjsQQwzEcFa6GJA4vQjWZCHWBEK4fmHiT6nPvSLONSChs804izFqC/HMN19IFEKkoUU64MPyim5SHUoPn4WrxQD/BFPYwUkXSjsh8Y9V31OH+iCsbRxNAIMIKNxanUrue+jt5R/WOviqDfUBpIhTnrE4BIHjVSf6LUxquk0lKmKA4ZtXb+nxKip2AggyzKThdi9ENc5fltRxaAwT+f9eixmudUE5KNy+2DAJ/W2epW2aBwDyBaBtbG53PcR9j5McHAO3nz7F4srTtp/268EEskokqzCdEv72kDidToaTfqaMo8mWVAvheiV4eq1Pm4fdnf62ulTzxZF8Xs8jRUxa3lRA3vyAvfwiqyWL9QWzGMA2QKsNjaV7GPXvj23A8VR44KDHw6euXIaKjQwcaUeMEQctZFJm8NSnxE1yKRdra8LGlV2tVNdRn00RqF3LS8v3Trs7vRT551YRZb9R57GqpJt9bEssOyF8PdCWr1MoxvHADI6q1a2lOxjsN7/Kevlrfs2Z4+CL5aCfZVnlUqZcfpK+m0uKwNJqc/q3KRvU+YRbIr6ikwOnaEFircs6fXbGm8slNNYwJ9ojcecKr51gIAG9irF+0I6sFQjmcgAMhKmdjbyex9Q+qh1vGKn8cDpYXkUshHJAGxbNzeXPYwWSNK+oqpRXzUwmdgwwtVaZhoKKLBrUPTfdXwFe5pW4GsP4ZTK8Ft8NlYTnfbKtMadBzO8rr0W0rJRCTCAjEqqhe3OrurXmyuvTP4gTj3Ej1Awrj74+1CwTU2XSOaKNh8xlUFnk8xmCmW7sQcSBezaveeGFx77s79sDan8/aIaFAr/AcALlRoetpvA/iLDx3hFVrsXadF9wZsAACAASURBVBTrGEBGodTCNrIRub7a/6DKYLMPEzKsmzfmhrhgC+ZvIrOTsk5fyqEyFJOg4aoTme8W9xVN0rYik0Oz72HkdmzTSrIU2yEITTsnGwz6J9TS0o8Mu6S3v4Y/d/eEhP4stJ6AfELu1ut8RlbrV2oTAxlANgHU1urV55+9Jl9e/mg4DZX4f+PBremhaAvmr/wxDjpUhlNbQZ/0Nu3krWy3kSzuK+ptDIj6Op2JPgc4DhpOFAKLHgxuHHZJ7zPA9wfAvwKw6vvxvRME5LfTP8QspBNrNdRIBpChaNpbIXsfkn3oYnDEumfn6cVkV0wyhVBtC8mh7+CmWzp9aeWFNogkjn/InklzYAojWoVDshGpbMpG4C/pXdH1z6vbTC80Hvbm8r0TBORDcedgwLvTO7FaQ4ys/4Mc0pDi9hAwv/dhsg8bMMpv+5GNzmfXAolpYivlbxk/zJGtbcoehukbFkhKxUFnnKF4M0zmYdoaiWubntZSULt2791z3eEnn5JvrbXX1/p4VgH/CMB6rZKCNhM4LyvwAWYhbV6ijW1jANmYT+tq/X0fWhdHIu9v7CyDRRkMvG8O2YMLBFZupaZ1+OMb2FNQNiMwlZaFqw76RLqBLFSa7MJnGOUYzvD0NJkdKclGdFG87Uy+ft2wS3qVxh9B4VuuK9+6QUA+CHcxC+nGYjVZyQDSRKXFMnPXOfDTxkT55xcXvCN3WUH4xu/l8dVa0s/0t5Xmr2tXyp32qJ2V2L617KHp1JTXaZVaa4dkOF5fHJyMTCn5QfQTWmfvGfaU3uLbeAwa/ysv6Q0r1JXCwVzjQ5f/qj6vKwbTzpIAA0jJovUln30A+khwsomDNp7eziMUQ4OQDEjfYf1Da9M/HIVN9qaMJNEnow8NJKU+08y1C4HO9TX9o4BjJwQord/6tUceusAfx+9PfV7JJvr/A+C7sZzl1hNQcl+IWuVeSOtXqsFABpAGKG0Vmfs+ouwjBAEx2Dj8pGCdfphM5LxdMXH8odoWzN+KzKuqbbS7dok+Z0qTbLsb7Vmev1HvXn5X42ksAP0eHi6A/8vbyffOENjf6+GOS1f0+Z2xmIYaAgwgHfkgSPZR6OzHFHAkmCzf4DfIJkw70yb0SAvi+E3scQV74IKRlZm/oToUQkYSRS5bdDZZzS6wVWV+nDLqmea1wOTayRzlVRSDfbpQ7xx2GuvpX1CnM4XfVsAZ04F/ukLAZCE9/nZ6V9Yr2MkAElC0uxCyj6ozdj7dO1kzi+DnQ2WUjYTKZMJJIJIa00z+WM3GuUcy33kzp+/bib7ExmSM0MomJ+YwsjPqq3Vx3bB7QqTbYB0Pa4V/XWpkqSME9ssVWdwL6chqOTMZQDqwXnLXuck+lArZR+LwrZ8fLRsJztg5aNfXY0icfPDhtmD+VmTSzwYRU/JqTADym+JB6MaujVFGJ9NUDsvA5HobmUJvaenKQZG9e9hprK/ej28rzUt6A/PuFOSTdXevjzd0x2RaygDSgc/A4Pvf+SEAPx2cqvxTc468FkhCzuAmFtqGgnPuUp/KYp0BS2giBdcjkTl54vStzHeo2TgskMT2yFguaITJyo9/6GIfFN554r5Tu4ONcUEpjT6+DODfxWKWO0HgABTvC+nESjkjGUBavlqH73ry4KAo3p9lZfYRHGpw5CKx//M+2B/Lu3kFnx4KzkFLbSkL/d2TdNP+0s7+Z3r4w6j/sOxBmnibgj1DZH4Ma3g1GzE3Gf7Qi6dePOzrq++P349vFMBv8MbCKpkOHGvczftCOrBOzkQGkJav1a7jR64drK7+hHfyqYM2bjzxt4nDD9Wh4NR4z2/lRqePHBvxSLrZkYyG8Mc3aM4e/BDBRhnLdWmShcokG4E5jWWvxhpirFI67+PfA/jSkBYUt5fAeZnG+3l3ensXKLaMASSm0bKyZB/r64Nb8zxzex9VBy0GlzJfFGccHHLkoKsyO11pYNVIINlUn21tm7kBzRBuHCOyf6zaqs4wVmTjBrJmfdpdjaWXvTnVd5eF/H1mIVUyrT9W0HxGVutXyRnIANLilVq66PDVPvswzt04YzHYe2t/eieVef9tXbTrFN4ixx3UhELltFboZIb0+uTdvEI3W0gOKzbWgpMz2eu0Cn0gi2x07eI5G5HC6x99/ImDoV+1UGYh/6laxePWEzjMZ2S1fo2MgQwgLV0nufJq7ezZv5b38pB9GActf8LLHphTUEHuCvIWiqFQl4kuVx0VbCAx44TKuDpYEJqYZrZtKIaCbV7aadvFfUNQ8prd/og/LOORGyPLXr17afDGUN9QkCxEF/gCs5AGOO0WySLf0T+Ht0Dr6MPSbqMX0ToGkJauuvzex9KuXR83jlX+CZl/Rraw5WxkyGZ18u2/MobBIv2icb1MbEn6eoZR20Rd6f2tCqM3tLC9m3S6dklwMd0Usjw/1uvtusEP3fiulM4KPMi9kEY6bRceznPcfvnnMDzLbPsMFsA+BpAWLrK/70MXhXnuU3CgxkGLwc59Jz7YHpTf8m27kDa4vonjd/2bZLaf7eR1WjuCItPE97V1LtCZJla5+WuLcaWhPnJwagguWhe9oiheL3fob7SE3AvZiE6r6+RTc0dvwCykzavEANLC1ZH7PiT7AHRmMw8bMoypwRnLkXPpFZmRm2/vfnKuQdTOO/6gM2hzfULbULABQw7jjCKptlqDzqitaRbahsJIey6xvtjuLM+u2uhyXttPad3Hv+V9IYZG1/4cVsDJSx8An9Tb0pVjAGnZwkj2Ifd92OzDeGDrr52DDw40+GBbMH+DTCYlB/5yWj9JK0v9v3P6rq/XL+9WQaVvotO1kSauv7x7HfX+Tqtv68fYRGdNnxuj6A8uG+T5dd7CYe/m7nTg73EvZBih1srlGVl3LCm8lXsh7VwjBpCWrYtkHxlwt1Jwa+O8bXC61uBmB2+l5tSQtA9ePQ4kkaKkaDrEXVx+E6uJOninH40RUAZVoWD1mgbORm9epb89XZaO45uEObu+Kst27d637wY0/dRtMMYYqvt9c08I7wuJuXSjfFDl+DFmIe1cLAaQFq1LNfvwew/WROdUI98qDtU41UjmI4CIjOM1ncsGdt/BV5pWoV3QF1U3yfwYXrXVWY7h5TL+Rv1Nj9AtFGx3OfSRw0jsYaJPHuE+GLz6xOlTu3yTYe8uC/l1ZiHDCLVWLj7qzuUlvLm1Fi6wYQwgrVl8rcrsQ0XZR5w9iLHGs4Y3K4lkrmhdt7uKKpKZ9rX9kdRXi5MOr6C6LouNMMHOdIramcFKx5/oNM3kjxvNFhNDygAa6XTtbC/dk32QF7713YuD7mEFpXwW8pVhTShvLQHZA3kvn9TbvvVhAGnJmlz1OeyXvQ8lT9wNzlSMKw9q2YOvavqmb+ZlG5i/8ieSSTF10K6B7dKYOSTf/l272D4x1QaSUOnGtNNI+hsD3PRcEDEWhK7myFqcVlidZiyFTOXH0OtdPuzpvKUBgGQhBcAsJIbSjbK5O52/Wti+xWIAacWaaPX9F777Rtn7gNa94GiDMxUj7UHp9EuZmYLzt5v1NWpCB9upFpgi1UHfJjJvn1dtdfoJBONMs0Sn1+vnV8aUMGfTJGRNXqcZCYNB/3xzP8hKOTNb0/BXhSuymIU04Gm56FDew23MQtq1SgwgLViPw3c9dUCeeRWyD2dTcLSJz7QHjYEkajesr5FH7bzjb9Qndkhb82Y1uoN6IAg6QyFkOEa3CxCj9jdagqpQCDq93aJP7ge5GugZ3Zv8YRayCaD2VmfyjCzeF9KuBWIAacF6yBN3zZVXgMk+gq8Vv+mctytYQTiQR5u7fY5IFvpX+zp94nyNSy79sosUo+mzvV2XeAyxIegMBWtzsDOSu6INTXJQ72+ahC6hEOatlOrlvd7FGz4Xy2p2+pmFxDg6Vj4Ejffx7vT2rBoDyIzXQh5bXc0+ag7VOWnjuEsf6iwXQRxEzJGts1X1/Qzbw2l1fV1bGwHcXkZFVgYHH4JKh5/YHJng9VmDnN4wvpNGdvp2ZqyonWkif0LBtpQA2l9b+4G9S9mrQt9NCpKF6AKfB7C6SVNWt4uA+KvbmYW0Z1EYQGa8Ft/71neusfd9qJ7xjs6ZilkmYNhC8MPBUQdnWjYYJRupByGryPwNY5fKRad9lTLv3IMt3gRnc91u39cp20k2EsbyOiUoqUP9tXOXjrKRbuailC4K/L8A/oudG/92iMBRuTudWUg7VowBZIbrIPd9KKVuy/P8aGmGeFf/TdsGkcQhu4aJzPllH2VKpy+NS6ddFq3rj8fx7UzfBn2lTmece7Mj1PVZSTR2mGBQHk5D2bGjtgaB0+mnYKrlj8jjrElBbihc3rv32ptWkIdhNikwC9kEUHurM61xG7OQdiwQA8gM10Hu+8jz/G4AuTjo8Thp52SdPqvTysxUpehe1hW7GGPkrm/FQcfBJbUx7utd+yayaJxEr7EpMc5UBxul3prnCq63AvI86/WWly59Hv7ufT/DDd7l90J6+DeA+f30DRqyqoUEjhYaH+Td6bNfGQaQGa2Bzz6KweBCa4Jz3jsJJMHBisbyIHX65ut9qLbf86Vt8Muhr9HgqkIHqQ02lmP44Wr6zHBWagcJ6t1hObbR6xX5xkP727G9eYP+4LXffPKp3b7bKO+P/SK+o4D/iXsho9BqVZssA25bXsL1mz7GplVmz58xDCCzWFNt7zqX7EMplRufGexwjjE4aamwMv9mJc4pu6phMt+3dPqRPl80I9T1xX1LG8sBa4HJ66s6/WC+Dy8iKKflx/Eyq7ccx8/b97adXX9XqXVx8Iw+G50KDK2GF5TSq/ZJvdwLGU6prTWHCo33XQr+XsgsF4gBZAb0jz+APbL3AQ3j8IxjtF+/I2usky2dtFRFjte1DE7VVdlWVuodr21a6it1RvpCsbmvtbE0wTt9Y3YYWwpBkRk22GcNi6rdOF7uWvsGpd6KziHBqbwj3Sga+c8z9+O01vgsn5E1MrK2NCyzEP5q4czWhAFk2uij7EOjWPL+VswQl1p3+pvfm9Hc1+mzlW6WpTNOg0jq9IM+39dVe42mbyQzzWoZk4slQXXokMzRzLlhHBHJywQSW7ICI7TF0FfaZeogNDZ/JlapxSlRen2APy40HqpW8bj1BA4p4L1X/Rr2t97SOTWQAWTKCyvZx9Ly8gcl+7DfwV3QcHY0ybzHLZ2+NBaHnAacpr6JLPhw29c454rMq7Uj2N7GtEo7c1iRmT4NMqPTWBvpS6YQyaV/UO6UueAkrVxlNP2yb29p12twUo98JZaZF4BnVtT3coVfYRbiiXTmXa7Iun1Q4Hr+Xshs1owBZJrctVb6le++WRfFB6D0kh/aOMbIN4q8SWakymYkvm/kSYMo6Rt8cCiEdr7vKIHEdEpstI67qW+TLPX9rm8ZWZx6K0/HigYNWU4q82rkSqyrrxn9Ut4IBGQvRGs8GstY7gSBQ9mAWcisVooBZIrkJdXO86X3272PDbKH4OudQ438pTW3elpLpM36RIN3sN5tm+NEpx1QHH/5cgeune8b9IW2tmD6NshKna5S3kI7Kdr/BZtc8DTjuGlZm8pOZYAqZYBeVio7+v3Tp7acgYh+yUK04l5Iuf6dKYkPu6M4h7czC5n+mjGATIu5tk/cLfqDu5TCknV98rfZ8Tc6VNfcmmwPSmcq0ro+Kx0yhu9iFKb6rOOPBpSieyXO3chdX7EgdAmFDS/7NSa7oGHUl91sFibCIPMFeff7I14G9NfXD515/lzI7EyjLfzpZfhD7oVsAVh7mh7Meng/90KmvyAMIFNi7rMPpdR5fme4dH2uZP2isSj5Zu5sTGShre27WSBp6tski7y1DQbOmqGBTuqrtjjnbs229plmEsdM21KWqrcWbSYr9dqxzdyhsK1Lea0y8/exX1IvKo2/y/tCIijdKC7J3em6j+t4X8h0F4wBZBq8XfYhex8qU+4bsvOmLjmwZqSZgsjEpZbfwH0r57Hdm5ea1g2y0sE7fVax1evGCONYZdYzy+jOzHiM2B7Tr6LPG2yCRbBHCvbABpG4k2sU3iqBJLYx7pYaYn5cKuvtkV+v2/bL3Z3O+0K2TXBmHeW+kA9evhsHZmbBAg7MADKFRZcrr2TvI8vzo6Xz9APbABG5V+tonTOVVtadpoGkSWY1Vp2+1ZD62rqD9uPE7bw+UxfZ4wOBbxtscUPZfvbAzKucXBJEUhZugKit6DWvJplVb+tdu3yppwqsH3HCbb1JFsIn9W4L3aw7LWXAreZXC1c0/dqUVoOgJw3a3fdhrrzScuWVOHjr5Muh3df8JEaUMt8uOGrnV0WeyILcelxx0KWTdl44tGnuu2V91ghj4oZ9xdYwtrPFyUo7S/nQ4GQY2ZHcoC6eKRSDwYFt3QtiFJV/JAspNB4uJSx1hMAhlePOq/ZgX0fs7byZDCATXkJ/34dkH/4LtR1yWCCxX9JLV5pEFdPVuE/jdUvjE+cdxFZL6bilItIn1UbiHLI7rsmCvNRX6rQy7/BH6VtycH2NFc0BxrcN87MDuGk4u70MwOELj239ZkI3vn+TZ2RB4de4F+KJdObdZiF9vIN7IdNZMwaQSXL2d533eicV5Mor57yTMaunnLxDtm3lyH7Fjhy/6x/02UauZb2d9E+zHu+4U3sSfU6nkXkT3LjenjJz8A3SsZO+wUYrbexr7GwIJN7cONj5ISuys2fOnLdj5yG/F9LDH/D3QsKCd6lwSGvcwSxkOkvGADJBzj77KAaDC/ww4j7Fmftv1lZuPWT5rb5sbWJOaO48aZND3UTmx0kdt0jrTj9x/LGD9mPIu3nZQmq3q3RtzXzdiTYzZ1PtKkV3WazpLPWaTj5uuZGt5lKn7T5YW9t901Ye6+5Grb49/Wl8XwG/yiykSqb1x0saeE+xhht3/EWi9VOdvYEMIJNagxWd7e/h9blkH0rZZ145PyhDDgskaaZgW3onX/paVyoFzkWHSGNm5Z23cbJhnrZTGkg20SfV3mavzMm8V2/UZzvZzq6/U2S7Oe9vRg/6fCcrKPWaVlZXUnQdFZDl2XK21Duypd8FCdZVCkrp9R4e1BqPVWp42H4CR7XCe5mFTH6hGEAmxPg4sPvMyy/fCa2T3/uw18WWgw4PJGUbWyozhdJ/upLzodKuSZ/InK+OlNpO5bd829s0rOrz/V3vJDCFtqW+UqfI0rFDXz+c0WnbhWBR0WmaJjJ3EN6sVmm3dm51/9qLZrZG807+SBbCu9N3QnBmfeVJvbfqPm7g3emTXQMGkEnwjbIPQPfEzwX/Z8ZLMwURBScf7KnuW9hWwSEnOlMnneirOtnEGHsQHHc0tjE4MjrYV5V5s0zfUnmq03Ua1jfIbX8TDmzRzdI2GKrT9Zd+u/bs2X2ud2o8n2u3F8JnZIUPRpcK8tvp75XTyF0yumu2jucfWtdmPWF7JftYX139qM0+xLlbBx98ohm/lHtzrON0wcALJbSMetmv/7bv+hp9XhY5WZGnAcJaVnfQabut6hMzRKd9udm7N2uC1WjqQ7uyvWnq20cGl3aGymQ+xXknatq81q2+P/0L6jS0uSJrfat92X6mBMxvp+/dxSxkkqvAADJuulqrvct4a6H1jymFXqneBYzoO7X1ck4euTzjVl3QifuXjtNLy76lKy1lZSvnqKtjbDWQOIVbDSSp3aWlJiYYHpF9vtrYag/MX3MsBliZKQWkpWxpeWnPuSefirh7Ctt/HyzjXzIL2T6/GfY8lBd4H7OQya0AA8iY2cqHdXB29QM++6hlD96bOocY/KJ35pE99UBiHWVNp+8rDtW5WFMqD4zWuj5pFTnvMLYfJwisVq9P3quO3zVN9Ll23io/dd+7amPo63SZyZhyZE9Fp1SLXvtSGPQHY/9xIclCsgx/j1dkec6deZdnZN26X347nb9aOJFFYwAZJ1at1R6Ft9nsQ0XfguU0VHWgMlOw7lHqS1ncWhxr6Ux9jdVZ6nVajJf2zb3Mqo562gaRTWGMSCaN0mDl9DlTN9VXaecHNSaGcZzORHWo9F3cUMZKyzI0sR1Tnd6y8b2vruOf8e708fGcoqajSuMuPql3MsQZQMbI9cTPn9pd9Fdvz7LswnrEqDpjP3AZNEofWsrKVrZ/GkhK5+nb2XcbcBJ9lSAUvu2XjdJsROThNSxYlYFpq/pEdRn8zJEdzY3r9dmQUY7jI4oxO7LdyoPBYy+YXy3M8AUFnBm7ciqcJAG5L+SW/jm8hfeFjB8zA8gYme6+4MQbJfuAdldepR7SjeQCQW3cMmiUvtsGgjhoGIdaNkh0psNtQZ9oiXR65x3LguOO2nmZaefkicOPZHW7pXLzwGRNC4oiO13/JBC5djW24xGs5/g/NfCn49FGLVMkcFEvx928L2T8xBlAxsT0ik/oXYOzqx+22Uep1J4Cqjs2L0+dvvQbMXuQjjW11iGXo0f6QnPreM3Xf9c/CRiRzuD0I1nd6bsxnN32yGsMgxqTEn1Bpy2kHETm+oZiRWdD/1SHGXKsf8zd6Qr/M7OQsWKdhrJMK9zM3wsZP2oGkHEw1VplF+FalWV/RUGuvBLnV3Ge5jh4vWhUm5Gkzq/s7/ync6gVnW6PIg0kQ/Q5h1zqExOcPmeWd9FG3wYy06+WPdT1WcmQMVxzeavqK1k4I3wT29icaou6hf5Wj2s0iTe5O51ZyCTITl6nxnEU+AizkPGiZgAZA88r7sWy3PehtX6VqCvdXhkIvFwyj8rJf2fBEMdv2g/XafXavtHAxop0A9xZEOmzdspf5+RLS6yTdlVhDN8uTNA2SKcU6XPtthqYzHiVMYKNQb3VakwObd0EJvhm7k4v8HlmIROEPBnVGRRuNs/I4hVZYyPMALJTlHH2oVTPZh7i3BqcvhvL1KVeN7JCgkF0aIo26HidtjoNTtLMuFQXIEoNmwemDfX5oOEUNgUDO1Nrd2m7s9Yqd7NwTt9VBZv9GKGtbVBHlHQcqtOZOpk3pXS2C78/0Hh0MgNQ6wQJXKSAk7wvZHyEGUB2yFKuvDJ3nSv1A4kq58gjl1c/rSVO39xlHjynU9Hk9E3jEJXKHmn2IApM+EoGdlIXc0o7Xd9ERSnz7Zr0GZlV65uZkY2oNM7KKrbYMJIM2nBaqlTeHEjccG4srzPv5S/vfu0V/ciosRcf/1t4WX47nVnI2NFOWqHJQvbleBfvCxkPagaQnXCUu86PnHiD2/vIzempRJ84SevhSh9ayuKmzae2mgKJ6+/8b9DuApbX6R2qSYW80OVFziQndZZV9fmsILSyGmN9yRjWkODVU6dfjlHt70wyowR9clTRZ0QJOqczbqtUYRRN+o/LQgqNJyc9FPWPnYDJQuSL39g1L6BCBpAdLLrsfQD4KKLso77vIM7QeefELybe0FhhXGLqeZ11wwKJrS5dqdMZnK/NRmxwiie6gT5nqlUxmr7g+KNxbQSQcUIMDcGlMWiUk7Cn4qRRJCsPNtAJYH1t/Ww800mVH/+0eol3p0+K7kT1Zsjwrr1HT9w00VEWRDkDyHYX2u59vLW/vv5XMqXy8huzKPQOOvaopTNO/aJzlJEdpl48b+1l9ZZir9PqKHs06azLSju9RmeZC3g1faWg8TSZCSSur9foHX86HT9OGVGlr3m5Kik3ByZbY22vBidgec/u72WnT2mrbMJ/e/gify9kwownoV7juNI4KZfeT0L9IulkANnmakv2UQAfzbLsMlERnGdFXz0j8U7fu1bbO2QpsZNu3B8Rp2m/hadDlUHEqijH8e2CjdEYtm4DfSHuOM8eBYjEwUc6RZ5mD3aOpmvULjRyMq8v9HeGh2Nngo81tn8cRIDVM2f6B887MfBznuS77IVA4Te4FzJJyhPRbe4LwXHcyL2QnfFlANkmP30U71Ba/yW/x+HVWOeeeMmQkfg29r108N4vlg41eG3T1J6CatZZ+2bvHHyiM3L6otA46orMSGuByWmpxYNU4B1/HDSaZH5+ZuhkOqk+b2OjPgvPqrJ0HF9b0du959sXAlPbCxn08E94d7pflA69axzP+riLeyE7WzMGkG3wu3pFL8ujEaC1vfJKPGLl1RRImmTGE7r+qRZxqs6xGhdpM49qwBrq+F3fUmeqT8zdUiCJ9Fmd8re0L+jzMjdwEkgCI9vXTdtJI31NfSsy0RsHGDnI8rwYrK6uPbiCqWQgYri5LwT4h8xCwuJ2peD3Qt7BLGT7S8YAsg12/R6uK7R+t3R1bs85e+flIp02e4gE0qf2Td8Igz8OOk23qpN2gSRVaSxJHbI0sH030mdbVZ2xk4o4mVLZrhSXMm+Sce5u+ESWGuJsrp4+c5rLAUygM3oimVVvw5NfBF0U63v27j0NqOnsgRgjlF7v47eZhfiV7tC7uzud94Vsf80YQLbI7qYV3ZO9D6XUCZshWK8WfJv5ph6OjHbj5lJPHJxnOnzqsUstTl4KTBCqePegMx2q7CvdrYpS5se3rljkXiLvtkdNn8hd06DPC1z3RJ/T2SSzzW0QKcex47rhTZPhfcUUNwCAwWDwrDNham/P3I/TmlnI1HiPcSCThchPMDAL2R5VBpAtcnuuhzdlwLu01iU78XySVQQHLQUri9UPz0ZKB2jaR30TncZJl21NXdS2HEsccsM3e9PWhwVp7WwsVe78tJYbw9uSOH4nTGRhbDObCjYri8E293VBRKnvZ0v5KT/21N6V0twLmRrt8Q4keyE5Ps69kO1hLZ3g9vovVC+XfdwD4FLjoKuzF+cZvre7yoqDNw7QOPfgOW2fmsP3Qcj5eafXNU7OLRk3WxnHjj4skPhaG0x2HkiqNo4WmJJgYE1ys9xeRtJbWjqzb9++F4OqKRb8XgiAl6Y4LIfaOYFMKdxo7gvhM7K2TJMBZAvIfPYBwHJzgSAJBZEjN47d63fBxR/Kez0j8Q4/1ui0GL3W4YdaJ/M6TcuGccz3OWNqXQAAEVBJREFU80TuHby8W51WR3JgROLkTQbgB/HSJODVbUz0BYONJVZfRdbEwrSO2oWObjgZoxKEXtJYfiExdVoHcnf6Ev4PAA9Na0iOMyYCGpfIk3rdjcFjUroYahhARlxnufKqAEz2UesyaiAxDj/xiOUpo4rS+ikoaSDO3Dr00oeWMq/C9k3HMb0Tpx9aW7Xuu388RtnCBrbmQOJb+Xdnn31zWlMbE6cfmRmCVSQzIcJ19yMYGxsCW39t9YWzwMtlu+mWzDOyFH6TWch0uY9hNIUMN6gLcfMYdC2UCgaQEZe738MbZe8jZB9N/VwgSaqioBH8YiTzbevfwKXGOW7fKLyXHlV0Wr2lzDezOsOoTuyzHN9K3ksHX9MXdTeO3wWwsvcQfc7Bl/r8OElPE0DdBExFc3CxWurYxG4PQPVVnn9j74vTu4S3nIkrKaVfWsdvA3ikVkdBuwloXKIUPsK707e2TAwgI/CS7EMBPyN7HyM0txvY1Ybi/ZyvsyU5CCVX1/xNvzkbSZUFTRUHL3ITSKr2mOBUFTqH7FTb2thJe0ldZoNddUplu2BfFKz86E2Zh5FJg7JjOEixmRkaVUplXz9xZIYBBMBz9+Msr8jyK9upd/nIXd87Bj4jawvLxgAyAizJPjRw44bZR1XP2E9rNWUjznm6oBG50nCqy5u142zEOH6vzYSLMnsITt5a0Ojgy1jilKSCpsyjSeZTDjPlMK5VmeW9Jx68f7YBBG4vhL8XUn5WOlPSuKQo8ONysUxnbJ6xoQwgmyyA+TBp/BwA88yrTZrXq0cIJKZTg0e0mUfqJZtkdlBxyLZt2cPJnEDedhxIjJ3lNBMnH8RDTmu5vsYOO2mbVZQGm6AkOk3mEey2o8Qy38DyAPK8971c6VPiwIMZMyqYvRDgH3EvZEYLsP1hzV7Ic0vmy+L2tSxQTwaQTRb7uR7erqElrY3c3Cadmqo32B8pHarx8CEQeDXW6fsj+z40kLhAlOg0Drk039S5dhWtDae7yiBU6ixlvr9x8ZXgIsi8g/ftDMamQFLp2xSYElk5HQcEz/UOHHysHGeGJclClvG/cS9khmuw3aHtFVk/ySxkNIAMIBtw8tmHUsr81vkGTUeuMg612lqcp4tQwS8ahxqO7DfzhiBUd9BOuXRNv8i701qxzuaMxAcnZ1ap0HV1qt0AbpDQqmkfZ1ggqdo4WmBKAokZV0GuwFrt49vOjJm/SRaiNf4xs5CZL8VWDTBZyLMKP7zVjovYngFkg1U/tYx3yuV9zrdv0HKLVSOc1gpuPvXiZiBx8OlriIP2mUdjICk1GG01nVIvest2cfZga31dGkRcT9Pct7DvVl+pU5SXxpVDlTLfX4KG/N/854QmkFhlA7kC63xgoj9l620Z6V0pvT7Ab/G+kJFotauRxiV5hp+Si2faZVj7rGEAGbYmJ3WuCtwDSWkn9RoWSNx4waGKkyy9rqn1WUJqmg0kqUyOyv5BZyRzLSazP2Jsjy2yUSCdjosMSYwoZb53knmUE0GW5UWusj99tE0BBIB5RpbG7zIL8SvYmXeThawt4/rOWDwjQxlAhoC/8lq8GVpLGhu5qiGNdyqWQBLriLzrMLlvXs9G3Gkp36DhXXQGvRUHb+qi8cvuTcHJBSbn+G3b5MCImrIHscAGwXKEEOgSFe4gGGx6hqGkoLU+nffyh7Aypd9Ej03eqMwsZCM67a7TuCQb4Gd4X8jGy8QA0sTnpM6h8XPj3PtoGiaRNQUR58hrDj/p6PcxUmFjhlIJFmUPcdKJ13bOPfLarnHd6UuF7VvameqyLZyumkp7Wqu0JdVn5fW+lWykPRvo6USYhVR4dOjQZCHyw3EdsnnqpjKANCD/wTfIfR9juPKqQfeGomGntKqBxDj71BMbh1oJAjJW3eGXwUI0pFrqAulffw13+mZM06Ecxw+SOP1EqdWXDuWCUohFztrKHEVnluVP7+njG4nKthyUWch/aYtJtGNEArIXkuNnmYUM58UAUmEjV14VCvdONfuo2CDZgHH8sdw4TuvMnSt1WUPq4EMgifu600WJyGQNzkmHuOGddBCYLiaIpN7dNBgtOEU6nQHBxjARqbAH6TBl36Spsd3bqNb7/fUnHn1kxjcQpnCTI/d7If8EwOmkggdtJyAfuxt4d/rwZWIAqbD5ZoZrZ5J9VOwwhyMEEt9ulE126/Dl30T8cpmC98emqnTcZfbgT5XV+48cSBqyBwkmfgxrlQueyTDORtfUVlkbZf9jqZf/IX53Sr+DHqMbtcwn9Y5Kqo3tjg2Av84rspqXhgEk4tKK7COyJxRdIAnHUnAZiXWjrsbJ4nY2e4gl/rRW4qGb9RnPXgYYM6wZOpVZ7dbxV0ZyeuMYUQYD3zbJSLxwhE12MwOF5/buOfhwG+5AD6Y3FNx9If+UWUgDnHaL5NkGb11XvDu9aZkYQCIqrco+Irt80XzT9wf+3Z3zqQUSX28yiybn7gNJ1FCKLktI9Bm5URQam3o3dhC64FIX29Qh1WllSd9aNmIHNiZJ5/ByfZX8hG3/4YuB50NVWwvyq4VL5vEmD7fVRNo1lMAx9PA3eHd6nQ8DiGPS2uyjumYbZCPSNPjZutc1+yplA6+4Kbi4LMHpszpT9x96N4wjVuzotJbR6UfwsxKdqUwXWJf7P2b+AMXYrA3K5lcLeV/IBoRaWyVZyNvNjcWtNXE2hjGAOO7ya4PIzO99JG5qNsuy+ahbykYiz+tPF5lTW9EwdYdv0okQkQIUHzASnTabqXh4E37qesvMowxJLmCFQUwIagh4aWDS0Kd2Hzj0e20/fRUwl1dk8VcLA5TOFC7INO5lFpKuFwMIAPeh+NRE7zpPuY/naIRN9uCTI4fvBzdBJDQQqXfQsbB07iKNa9IDW1cNTHYsq9ePa1qaQGQVljrL4OLbhk32slGwM8vyh9ZOn3rWt+3Cu1yRBYXf493pXVitxEYFjevl4aqJdMEPGEAAnFrGW+Vyvap/7MxnY9RA4rOHaGI+I6kFA6MzaigNnNMvA0kpi/vbrCPx+EZRYzZi9LrgY1uFcbxOY6NrFyxSar3or3/p1K+fOBdkXSjIFVnKPKmX94V0Yb1SG49B4T5mISWUhQ8g8mHIND4F4OISS0dL4wgkydSrmYNUlkEjCSSR3KuwGU41kPgsx7faTGfZLg52g37/1N4D+/5FZ05fldPAY7+I72gNuSLrpUjMYvsJSBZyA7OQcqEWPoCYvQ9tso+SStdLEkiq6VSUfQSXHsn8lJuyhyZZCCTVcXwgcQqNHQ3jSP/GjGSjLCfoNHefP3QGy894uzv1rpQuBvgdDXxFHuXVKdtp7AUA7uXd6faDsNgBZEVnGrgXgHwo5uvlnHYIFn52IndOP9Q5mW9i6ofIamIR2P+boBV0OLk/NmPVOpuR6nvvXmESnNwg1uOa01fPAd06feVhAPjq/fg2NP4ZgJcjMYvtJyAf5Ruzi8xp7/ZbO2ELFzqAXNbDq6b2xN0JL+RQ9SOc1jJ9jcMPIcWJmk9hmVNTyYD101pWUymX5iIzfWuBZGvZyKDf//Ndhw79Tuuevpsw2eSAWcgmgFpdfYECPsa9EGChA8iywruVUt3f+xjl35oLJElTFzSMY/cVQwJJml7YQDA0kDhdZThygSSSbxRIvCn2vQxCLgD1d+3e/cetfXhiavyGR18FXgDwO7w7fUNMbaxUhcabngH2t9G4adq00AGkKHAlgHyawGc9ljju0rE7a1xGsFEg8RvY1aBh9FUVmiBkdW+sszkjsTolK4lpSSAxKczz/bXVf/7o/ViPaztZXlFFnuGLAL7MvZBuraDKcCQDLuyW1eO3dqEDiMqwd/xIO6BxhNNawXenXtxMzgSR0EBE/hRULPSZg3X8xvd7NFGAsb1dIPH14b16Ck1hsN7/k6VDB/9jF6++CtOKCo+t4bsaZi+ET+qNuLS+qJFnWOu13s4JG7jQAUTrDjxDaZIfgFEDiXH4cXAwIaPhTnF/aqtqtA8mLokw1aXMt/aZhz/27z7LyXtLpwut/8XT5+bo8ldmIX6Zu/Z+dtBbfqVrRo/b3oUOIAp4UHX4Sp6xfRg22B+RMULo2CiQJMZUMwdf6YJGrFO0V7Icm+GEUV1nhWIw+MqevQd+v9Ob5x5F9O7uC/l9XpEVQWl3US69fi7/Fr7ZbjMnb91iB5AlPDTQeHTymLsxgvmmXzXVOffaKahKO+v0U6HPHFKp2ccwQaOmM4oZpi4KLFneO93btesPvvoIXqzp67pAKZ3n+MfuvpCuz2YR7F/TGr/71JE52Ifb4WotdACR32jIM3xBAWd2yHF+uo/jtFZCw++P1BINK5AEJGQkw09rSfahB/hNfFENEvVzciB7Ie6KrPY/mn5OmG9zGpJ9fFkC/rxlwtvhsdABRDZi83X871D4LQCr2wE4t31GCCRm7k2ntZpOibkwYTKVBFoZNMoEpJRJU5VlX1ta2vWr7rLXpPfcHKyo4pI+/het8Zu8rLe1qyrB42sA/vvHfknNXya8Dezlv9ltdJ6XLuaxBBcUfyfLsg8DOIoFvz+maV21bnjihpMlNZV2Wp7UkTSw2hv1SVWqs99bWn5EF/1PP/W3e38wL1deNfH1shP3Pbtn75ETvwDgHgDHQnLmG/B9FgTkE7wGQB6A+cknfhlfXoTP4iigGUAcJbmrVJ7Kax6sqPE6AEcALLvqmFPsDmO5NB1WN0y+0z7jGH9LNhRFYZBkmTwFBiiKomqDqR/2pxjY/sPqRT4Y9F9Z2rX7Oejij3SRfc489kN+0mdBXvJZlF/HLBQ+BYVro89ilXXMROrk2L97Wpv18e2qurxc3n3dRrqkXVzv+1Tlsb5q3Tj77FSX2CYzehkapwD8waCPf/DVFcVTjJaMwxMdLHxRa3XTA8i/AVyoe7hcD7An76V36/ez8I8JvSL5B4NhdcPkwntY3TB53Kc6/kZ1Xt+4+5jPzFo/OA4lVNxLy+zcS+TxsZfLe9zHHOc43e/hcXO57ooK+uI+i1CWQPIscDjv4cqtfBb9Wguj6noPqxsm95ylvqpL6ny/at0wedynap/vU5Vvp884dBVAHwO8oHbh6cfP4hXuechK8EUCJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJEACJDA1Av8/CxV7KAQmBkgAAAAASUVORK5CYII=" - /> + <linearGradient + id="grd1" + gradientUnits="userSpaceOnUse" + x1="683.501" + y1="852.856" + x2="272.73" + y2="1564.343" + > + <stop offset="0" stopColor="#0052cc" /> + <stop offset="0.923" stopColor="#2684ff" /> + </linearGradient> </defs> + <g id="Layer_2"> + <g id="Blue"> + <path + fill="url(#grd1)" + d="M470.2 732.75C465.49 726.58 459.27 721.73 452.14 718.67C445.01 715.61 437.21 714.44 429.5 715.28C421.79 716.12 414.42 718.94 408.12 723.46C401.81 727.98 396.77 734.06 393.5 741.1L4.86 1519.33C1.32 1526.42 -0.35 1534.3 0 1542.22C0.36 1550.15 2.73 1557.85 6.89 1564.59C11.05 1571.34 16.87 1576.9 23.78 1580.77C30.7 1584.63 38.49 1586.65 46.4 1586.66L587.56 1586.66C591.87 1586.76 596.18 1586.23 600.34 1585.1C604.5 1583.97 608.48 1582.24 612.14 1579.97C615.81 1577.7 619.13 1574.91 622 1571.69C624.88 1568.46 627.27 1564.84 629.11 1560.94C745.84 1319.35 675.09 952.01 470.2 732.75Z" + /> + <path + fill="#2684ff" + d="M755.24 24.92C707.03 99.22 668.62 179.46 640.98 263.64C613.34 347.83 596.7 435.24 591.48 523.7C586.26 612.16 592.49 700.93 610.03 787.79C627.57 874.64 656.27 958.86 695.41 1038.34L956.3 1560.94C958.22 1564.78 960.67 1568.34 963.56 1571.52C966.46 1574.69 969.78 1577.45 973.43 1579.71C977.08 1581.97 981.03 1583.71 985.15 1584.88C989.28 1586.06 993.55 1586.66 997.85 1586.66L1538.91 1586.66C1546.83 1586.65 1554.61 1584.63 1561.53 1580.77C1568.44 1576.9 1574.26 1571.34 1578.42 1564.59C1582.58 1557.85 1584.95 1550.15 1585.31 1542.22C1585.67 1534.3 1583.99 1526.42 1580.45 1519.33C1576.91 1512.24 852.54 61.1 834.25 24.62C830.63 17.2 825 10.95 817.99 6.58C810.99 2.22 802.9 -0.08 794.65 -0.05C786.41 -0.02 778.33 2.34 771.36 6.76C764.39 11.17 758.8 17.47 755.24 24.92L755.24 24.92Z" + /> + </g> + </g> </svg> ); diff --git a/x-pack/plugins/stack_connectors/server/connector_types/stack/email/send_email.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/stack/email/send_email.test.ts index 9aa780788bc10..a439a7e16d6d9 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/stack/email/send_email.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/stack/email/send_email.test.ts @@ -178,6 +178,7 @@ describe('send_email module', () => { "fatal": [MockFunction], "get": [MockFunction], "info": [MockFunction], + "isLevelEnabled": [MockFunction], "log": [MockFunction], "trace": [MockFunction], "warn": [MockFunction], diff --git a/x-pack/plugins/stack_connectors/server/connector_types/stack/teams/index.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/stack/teams/index.test.ts index 6d1cbb2bfbbbe..0b144bceb05c7 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/stack/teams/index.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/stack/teams/index.test.ts @@ -194,6 +194,7 @@ describe('execute()', () => { "fatal": [MockFunction], "get": [MockFunction], "info": [MockFunction], + "isLevelEnabled": [MockFunction], "log": [MockFunction], "trace": [MockFunction], "warn": [MockFunction], @@ -249,6 +250,7 @@ describe('execute()', () => { "fatal": [MockFunction], "get": [MockFunction], "info": [MockFunction], + "isLevelEnabled": [MockFunction], "log": [MockFunction], "trace": [MockFunction], "warn": [MockFunction], diff --git a/x-pack/plugins/stack_connectors/server/connector_types/stack/webhook/index.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/stack/webhook/index.test.ts index 4e3369af35c56..222463711a2a5 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/stack/webhook/index.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/stack/webhook/index.test.ts @@ -303,6 +303,7 @@ describe('execute()', () => { "fatal": [MockFunction], "get": [MockFunction], "info": [MockFunction], + "isLevelEnabled": [MockFunction], "log": [MockFunction], "trace": [MockFunction], "warn": [MockFunction], @@ -389,6 +390,7 @@ describe('execute()', () => { "fatal": [MockFunction], "get": [MockFunction], "info": [MockFunction], + "isLevelEnabled": [MockFunction], "log": [MockFunction], "trace": [MockFunction], "warn": [MockFunction], diff --git a/x-pack/plugins/stack_connectors/tsconfig.json b/x-pack/plugins/stack_connectors/tsconfig.json index 1cf8281670d0a..3262f96e0f15e 100644 --- a/x-pack/plugins/stack_connectors/tsconfig.json +++ b/x-pack/plugins/stack_connectors/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "server/**/*", @@ -13,7 +12,7 @@ "common/**/*", "public/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../actions/tsconfig.json" }, { "path": "../triggers_actions_ui/tsconfig.json" } diff --git a/x-pack/plugins/synthetics/common/constants/monitor_defaults.ts b/x-pack/plugins/synthetics/common/constants/monitor_defaults.ts index 9f40d49d7086b..71db982ef750d 100644 --- a/x-pack/plugins/synthetics/common/constants/monitor_defaults.ts +++ b/x-pack/plugins/synthetics/common/constants/monitor_defaults.ts @@ -48,9 +48,7 @@ export const DEFAULT_COMMON_FIELDS: CommonFields = { [ConfigKey.MONITOR_SOURCE_TYPE]: SourceType.UI, [ConfigKey.JOURNEY_ID]: '', [ConfigKey.CONFIG_HASH]: '', - - // Deprecated, slated to be removed in a future version - [ConfigKey.ID]: '', + [ConfigKey.MONITOR_QUERY_ID]: '', }; export const DEFAULT_BROWSER_ADVANCED_FIELDS: BrowserAdvancedFields = { diff --git a/x-pack/plugins/synthetics/common/constants/monitor_management.ts b/x-pack/plugins/synthetics/common/constants/monitor_management.ts index bdf5dc6548f20..63f4a64447b3b 100644 --- a/x-pack/plugins/synthetics/common/constants/monitor_management.ts +++ b/x-pack/plugins/synthetics/common/constants/monitor_management.ts @@ -78,9 +78,7 @@ export enum ConfigKey { ZIP_URL_TLS_KEY_PASSPHRASE = 'source.zip_url.ssl.key_passphrase', ZIP_URL_TLS_VERIFICATION_MODE = 'source.zip_url.ssl.verification_mode', ZIP_URL_TLS_VERSION = 'source.zip_url.ssl.supported_protocols', - - // deprecated, slated to be removed in a future version - ID = 'id', + MONITOR_QUERY_ID = 'id', } export const secretKeys = [ diff --git a/x-pack/plugins/synthetics/common/constants/rest_api.ts b/x-pack/plugins/synthetics/common/constants/rest_api.ts index 33bd608d8f5ec..eaf3ba8c36b14 100644 --- a/x-pack/plugins/synthetics/common/constants/rest_api.ts +++ b/x-pack/plugins/synthetics/common/constants/rest_api.ts @@ -49,5 +49,7 @@ export enum API_URLS { // Project monitor public endpoint SYNTHETICS_MONITORS_PROJECT = '/api/synthetics/project/{projectName}/monitors', + SYNTHETICS_MONITORS_PROJECT_UPDATE = '/api/synthetics/project/{projectName}/monitors/_bulk_update', + SYNTHETICS_MONITORS_PROJECT_DELETE = '/api/synthetics/project/{projectName}/monitors/_bulk_delete', SYNTHETICS_MONITORS_PROJECT_LEGACY = '/api/synthetics/service/project/monitors', } diff --git a/x-pack/plugins/synthetics/common/formatters/common/formatters.ts b/x-pack/plugins/synthetics/common/formatters/common/formatters.ts index ab7c3bc9cfa29..794de9a6b62a4 100644 --- a/x-pack/plugins/synthetics/common/formatters/common/formatters.ts +++ b/x-pack/plugins/synthetics/common/formatters/common/formatters.ts @@ -33,9 +33,7 @@ export const commonFormatters: CommonFormatMap = { [ConfigKey.CUSTOM_HEARTBEAT_ID]: null, [ConfigKey.ORIGINAL_SPACE]: null, [ConfigKey.CONFIG_HASH]: null, - - // Deprecated, slated to be removed in a later release - [ConfigKey.ID]: null, + [ConfigKey.MONITOR_QUERY_ID]: null, }; export const arrayToJsonFormatter = (value: string[] = []) => diff --git a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/locations.ts b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/locations.ts index 9f27becbbb023..30ab08b880c20 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/locations.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/locations.ts @@ -82,8 +82,8 @@ export const MonitorServiceLocationCodec = t.intersection([ label: t.string, geo: LocationGeoCodec, url: t.string, - isInvalid: t.boolean, isServiceManaged: t.boolean, + status: t.string, }), ]); diff --git a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts index 78bca7a681461..f05729e29b49c 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts @@ -75,19 +75,19 @@ export const CommonFieldsCodec = t.intersection([ [ConfigKey.APM_SERVICE_NAME]: t.string, [ConfigKey.TAGS]: t.array(t.string), [ConfigKey.LOCATIONS]: t.array(t.union([MonitorServiceLocationCodec, PrivateLocationCodec])), + [ConfigKey.MONITOR_QUERY_ID]: t.string, + [ConfigKey.CONFIG_ID]: t.string, }), t.partial({ [ConfigKey.FORM_MONITOR_TYPE]: FormMonitorTypeCodec, [ConfigKey.TIMEOUT]: t.union([t.string, t.null]), [ConfigKey.REVISION]: t.number, [ConfigKey.MONITOR_SOURCE_TYPE]: SourceTypeCodec, - [ConfigKey.CONFIG_ID]: t.string, [ConfigKey.CONFIG_HASH]: t.string, [ConfigKey.JOURNEY_ID]: t.string, [ConfigKey.PROJECT_ID]: t.string, [ConfigKey.ORIGINAL_SPACE]: t.string, [ConfigKey.CUSTOM_HEARTBEAT_ID]: t.string, - [ConfigKey.ID]: t.string, }), ]); @@ -400,7 +400,7 @@ export type MonitorOverviewItem = t.TypeOf<typeof MonitorOverviewItemCodec>; export const MonitorOverviewResultCodec = t.type({ total: t.number, allMonitorIds: t.array(t.string), - pages: t.record(t.string, t.array(MonitorOverviewItemCodec)), + monitors: t.array(MonitorOverviewItemCodec), }); export type MonitorOverviewResult = t.TypeOf<typeof MonitorOverviewResultCodec>; diff --git a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types_project.ts b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types_project.ts index ef5f6a23b4413..b5ce7c06200fc 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types_project.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types_project.ts @@ -45,6 +45,10 @@ export const ProjectMonitorCodec = t.intersection([ ]); export const ProjectMonitorsRequestCodec = t.interface({ + monitors: t.array(ProjectMonitorCodec), +}); + +export const LegacyProjectMonitorsRequestCodec = t.interface({ project: t.string, keep_stale: t.boolean, monitors: t.array(ProjectMonitorCodec), @@ -69,6 +73,8 @@ export type ProjectMonitorThrottlingConfig = t.TypeOf<typeof ProjectMonitorThrot export type ProjectMonitor = t.TypeOf<typeof ProjectMonitorCodec>; +export type LegacyProjectMonitorsRequest = t.TypeOf<typeof LegacyProjectMonitorsRequestCodec>; + export type ProjectMonitorsRequest = t.TypeOf<typeof ProjectMonitorsRequestCodec>; export type ProjectMonitorsResponse = t.TypeOf<typeof ProjectMonitorsResponseCodec>; diff --git a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_overview_status.ts b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_overview_status.ts index afd6579788a99..7d85b1c2278df 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_overview_status.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_overview_status.ts @@ -7,10 +7,19 @@ import * as t from 'io-ts'; +export const OverviewStatusMetaDataCodec = t.interface({ + heartbeatId: t.string, + configId: t.string, + location: t.string, +}); + export const OverviewStatusType = t.type({ up: t.number, down: t.number, disabledCount: t.number, + upConfigs: t.array(OverviewStatusMetaDataCodec), + downConfigs: t.array(OverviewStatusMetaDataCodec), }); export type OverviewStatus = t.TypeOf<typeof OverviewStatusType>; +export type OverviewStatusMetaData = t.TypeOf<typeof OverviewStatusMetaDataCodec>; diff --git a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts index 556f1e56ed102..822b59741f844 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts @@ -16,6 +16,7 @@ export const PrivateLocationCodec = t.intersection([ }), t.partial({ isServiceManaged: t.boolean, + isInvalid: t.boolean, /* Empty Lat lon was accidentally saved as an empty string instead of undefined or null * Need a migration to fix */ geo: t.interface({ lat: t.union([t.string, t.number]), lon: t.union([t.string, t.number]) }), diff --git a/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts b/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts index ebfe80c3a57e2..598a62265f1c2 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts @@ -94,12 +94,12 @@ export const MonitorType = t.intersection([ id: t.string, status: t.string, type: t.string, + check_group: t.string, }), t.partial({ duration: t.type({ us: t.number, }), - check_group: t.string, ip: t.string, name: t.string, timespan: t.type({ @@ -268,6 +268,7 @@ export const makePing = (f: { status: f.status || 'up', duration: { us: f.duration || 100000 }, name: f.name, + check_group: 'myCheckGroup', }, ...(f.location ? { observer: { geo: { name: f.location } } } : {}), ...(f.url ? { url: { full: f.url } } : {}), @@ -289,6 +290,7 @@ export const GetPingsParamsType = t.intersection([ excludedLocations: t.string, index: t.number, size: t.number, + pageIndex: t.number, locations: t.string, monitorId: t.string, sort: t.string, diff --git a/x-pack/plugins/synthetics/e2e/journeys/data_view_permissions.ts b/x-pack/plugins/synthetics/e2e/journeys/data_view_permissions.ts index 5aa7ee96f25b1..648337218979c 100644 --- a/x-pack/plugins/synthetics/e2e/journeys/data_view_permissions.ts +++ b/x-pack/plugins/synthetics/e2e/journeys/data_view_permissions.ts @@ -48,10 +48,10 @@ journey('DataViewPermissions', async ({ page, params }) => { step('Click explore data button', async () => { await page.click(byTestId('uptimeExploreDataButton')); await waitForLoadingToFinish({ page }); - await page.waitForSelector(`text=${permissionError}`, TIMEOUT_60_SEC); - expect(await page.$(`text=${permissionError}`)).toBeTruthy(); }); -}); -const permissionError = - "Unable to create Data View. You don't have the required permission, please contact your admin."; + step('it renders for viewer user as well', async () => { + await page.waitForSelector(`text=browser`, TIMEOUT_60_SEC); + expect(await page.$(`text=Monitor duration`)).toBeTruthy(); + }); +}); diff --git a/x-pack/plugins/synthetics/e2e/journeys/synthetics/getting_started.journey.ts b/x-pack/plugins/synthetics/e2e/journeys/synthetics/getting_started.journey.ts index 2d9f1f888a936..bffc68911b2f6 100644 --- a/x-pack/plugins/synthetics/e2e/journeys/synthetics/getting_started.journey.ts +++ b/x-pack/plugins/synthetics/e2e/journeys/synthetics/getting_started.journey.ts @@ -7,6 +7,7 @@ import { journey, step, expect, before, Page } from '@elastic/synthetics'; import { syntheticsAppPageProvider } from '../../page_objects/synthetics_app'; +import { cleanTestMonitors } from './services/add_monitor'; journey(`Getting Started Page`, async ({ page, params }: { page: Page; params: any }) => { const syntheticsApp = syntheticsAppPageProvider({ page, kibanaUrl: params.kibanaUrl }); @@ -19,6 +20,7 @@ journey(`Getting Started Page`, async ({ page, params }: { page: Page; params: a }; before(async () => { + await cleanTestMonitors(params); await syntheticsApp.waitForLoadingToFinish(); }); diff --git a/x-pack/plugins/synthetics/e2e/journeys/synthetics/index.ts b/x-pack/plugins/synthetics/e2e/journeys/synthetics/index.ts index 1b74aa6a05b42..5affc2796c28a 100644 --- a/x-pack/plugins/synthetics/e2e/journeys/synthetics/index.ts +++ b/x-pack/plugins/synthetics/e2e/journeys/synthetics/index.ts @@ -8,3 +8,5 @@ export * from './getting_started.journey'; export * from './add_monitor.journey'; export * from './monitor_selector.journey'; +export * from './overview_sorting.journey'; +export * from './overview_scrolling.journey'; diff --git a/x-pack/plugins/synthetics/e2e/journeys/synthetics/monitor_selector.journey.ts b/x-pack/plugins/synthetics/e2e/journeys/synthetics/monitor_selector.journey.ts index 866df48d97e78..ab22de07846fc 100644 --- a/x-pack/plugins/synthetics/e2e/journeys/synthetics/monitor_selector.journey.ts +++ b/x-pack/plugins/synthetics/e2e/journeys/synthetics/monitor_selector.journey.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { journey, step, expect, before } from '@elastic/synthetics'; +import { journey, step, expect, before, after } from '@elastic/synthetics'; import { addTestMonitor, cleanTestMonitors, @@ -28,6 +28,10 @@ journey(`MonitorSelector`, async ({ page, params }) => { await addTestMonitor(params.kibanaUrl, testMonitor3); }); + after(async () => { + await cleanTestMonitors(params); + }); + step('Go to monitor-management', async () => { await syntheticsApp.navigateToMonitorManagement(); }); diff --git a/x-pack/plugins/synthetics/e2e/journeys/synthetics/overview_scrolling.journey.ts b/x-pack/plugins/synthetics/e2e/journeys/synthetics/overview_scrolling.journey.ts new file mode 100644 index 0000000000000..448bc2f106896 --- /dev/null +++ b/x-pack/plugins/synthetics/e2e/journeys/synthetics/overview_scrolling.journey.ts @@ -0,0 +1,63 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { before, after, expect, journey, step } from '@elastic/synthetics'; +import { + addTestMonitor, + cleanTestMonitors, + enableMonitorManagedViaApi, +} from './services/add_monitor'; +import { syntheticsAppPageProvider } from '../../page_objects/synthetics_app'; + +journey('Overview Scrolling', async ({ page, params }) => { + const syntheticsApp = syntheticsAppPageProvider({ page, kibanaUrl: params.kibanaUrl }); + + before(async () => { + await enableMonitorManagedViaApi(params.kibanaUrl); + await cleanTestMonitors(params); + + for (let i = 0; i < 100; i++) { + await addTestMonitor(params.kibanaUrl, `test monitor ${i}`); + } + + await syntheticsApp.waitForLoadingToFinish(); + }); + + after(async () => { + await cleanTestMonitors(params); + }); + + step('Go to overview', async () => { + await syntheticsApp.navigateToOverview(); + }); + + step('login to Kibana', async () => { + await syntheticsApp.loginToKibana(); + const invalid = await page.locator(`text=Username or password is incorrect. Please try again.`); + expect(await invalid.isVisible()).toBeFalsy(); + }); + + step('scroll until you see showing all monitors', async () => { + let showingAllMonitorsNode; + + const gridItems = await page.locator(`[data-test-subj="syntheticsOverviewGridItem"]`); + await page.waitForSelector(`text="test monitor 0"`); + let count = await gridItems.count(); + + expect(count).toBe(32); + + while (!showingAllMonitorsNode) { + await page.mouse.wheel(0, 100); + showingAllMonitorsNode = await page.$(`text="Showing all monitors"`); + } + + expect(await showingAllMonitorsNode.isVisible()).toBe(true); + + count = await gridItems.count(); + expect(count).toBe(100); + }); +}); diff --git a/x-pack/plugins/synthetics/e2e/journeys/synthetics/overview_sorting.journey.ts b/x-pack/plugins/synthetics/e2e/journeys/synthetics/overview_sorting.journey.ts new file mode 100644 index 0000000000000..27c6355de3c09 --- /dev/null +++ b/x-pack/plugins/synthetics/e2e/journeys/synthetics/overview_sorting.journey.ts @@ -0,0 +1,130 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { before, expect, journey, step } from '@elastic/synthetics'; +import { + addTestMonitor, + cleanTestMonitors, + enableMonitorManagedViaApi, +} from './services/add_monitor'; +import { syntheticsAppPageProvider } from '../../page_objects/synthetics_app'; + +journey('Overview Sorting', async ({ page, params }) => { + const syntheticsApp = syntheticsAppPageProvider({ page, kibanaUrl: params.kibanaUrl }); + const testMonitor1 = 'acb'; // second alpha, first created + const testMonitor2 = 'aCd'; // third alpha, second created + const testMonitor3 = 'Abc'; // first alpha, last created + + before(async () => { + await enableMonitorManagedViaApi(params.kibanaUrl); + await cleanTestMonitors(params); + + await addTestMonitor(params.kibanaUrl, testMonitor1); + await addTestMonitor(params.kibanaUrl, testMonitor2); + await addTestMonitor(params.kibanaUrl, testMonitor3); + + await syntheticsApp.waitForLoadingToFinish(); + }); + + step('Go to monitor-management', async () => { + await syntheticsApp.navigateToOverview(); + }); + + step('login to Kibana', async () => { + await syntheticsApp.loginToKibana(); + const invalid = await page.locator(`text=Username or password is incorrect. Please try again.`); + expect(await invalid.isVisible()).toBeFalsy(); + }); + + step('sort alpbhaetical asc', async () => { + await syntheticsApp.navigateToOverview(); + await page.waitForSelector(`[data-test-subj="syntheticsOverviewGridItem"]`); + await page.click('[data-test-subj="syntheticsOverviewSortButton"]'); + await page.click('button:has-text("Alphabetical")'); + await page.waitForSelector('text=Loading'); + await page.waitForSelector(`text=${testMonitor1}`); + await page.waitForSelector(`text=${testMonitor2}`); + await page.waitForSelector(`text=${testMonitor3}`); + const gridItems = await page.locator(`[data-test-subj="syntheticsOverviewGridItem"]`); + const first = await gridItems.nth(0); + const second = await gridItems.nth(1); + const third = await gridItems.nth(2); + const correctFirstMonitor = await first.locator(`button:has-text('${testMonitor3}')`); + const correctSecondMonitor = await second.locator(`button:has-text('${testMonitor1}')`); + const correctThirdMonitor = await third.locator(`button:has-text('${testMonitor2}')`); + expect(await correctFirstMonitor.count()).toBe(1); + expect(await correctSecondMonitor.count()).toBe(1); + expect(await correctThirdMonitor.count()).toBe(1); + }); + + step('sort alpbhaetical desc', async () => { + await page.waitForSelector(`[data-test-subj="syntheticsOverviewGridItem"]`); + await page.click('[data-test-subj="syntheticsOverviewSortButton"]'); + await page.click('button:has-text("Z -> A")'); + await page.waitForSelector('text=Loading'); + await page.waitForSelector(`text=${testMonitor1}`); + await page.waitForSelector(`text=${testMonitor2}`); + await page.waitForSelector(`text=${testMonitor3}`); + const gridItems = await page.locator(`[data-test-subj="syntheticsOverviewGridItem"]`); + const first = await gridItems.nth(0); + const second = await gridItems.nth(1); + const third = await gridItems.nth(2); + const correctFirstMonitor = await first.locator(`button:has-text('${testMonitor2}')`); + const correctSecondMonitor = await second.locator(`button:has-text('${testMonitor1}')`); + const correctThirdMonitor = await third.locator(`button:has-text('${testMonitor3}')`); + expect(await correctFirstMonitor.count()).toBe(1); + expect(await correctSecondMonitor.count()).toBe(1); + expect(await correctThirdMonitor.count()).toBe(1); + }); + + step('sort last updated asc', async () => { + await page.waitForSelector(`[data-test-subj="syntheticsOverviewGridItem"]`); + await page.click('[data-test-subj="syntheticsOverviewSortButton"]'); + await page.click('button:has-text("Last modified")'); + await page.waitForSelector('text=Loading'); + await page.waitForSelector(`text=${testMonitor1}`); + await page.waitForSelector(`text=${testMonitor2}`); + await page.waitForSelector(`text=${testMonitor3}`); + const gridItems = await page.locator(`[data-test-subj="syntheticsOverviewGridItem"]`); + const first = await gridItems.nth(0); + const second = await gridItems.nth(1); + const third = await gridItems.nth(2); + const correctFirstMonitor = await first.locator(`button:has-text('${testMonitor3}')`); + const correctSecondMonitor = await second.locator(`button:has-text('${testMonitor2}')`); + const correctThirdMonitor = await third.locator(`button:has-text('${testMonitor1}')`); + expect(await correctFirstMonitor.count()).toBe(1); + expect(await correctSecondMonitor.count()).toBe(1); + expect(await correctThirdMonitor.count()).toBe(1); + await page.waitForTimeout(30000); + }); + + step('sort last updated desc', async () => { + await page.waitForSelector(`[data-test-subj="syntheticsOverviewGridItem"]`); + await page.click('[data-test-subj="syntheticsOverviewSortButton"]'); + await page.click('button:has-text("Oldest first")'); + await page.waitForSelector('text=Loading'); + await page.waitForSelector(`text=${testMonitor1}`); + await page.waitForSelector(`text=${testMonitor2}`); + await page.waitForSelector(`text=${testMonitor3}`); + const gridItems = await page.locator(`[data-test-subj="syntheticsOverviewGridItem"]`); + const first = await gridItems.nth(0); + const second = await gridItems.nth(1); + const third = await gridItems.nth(2); + const correctFirstMonitor = await first.locator(`button:has-text('${testMonitor1}')`); + const correctSecondMonitor = await second.locator(`button:has-text('${testMonitor2}')`); + const correctThirdMonitor = await third.locator(`button:has-text('${testMonitor3}')`); + expect(await correctFirstMonitor.count()).toBe(1); + expect(await correctSecondMonitor.count()).toBe(1); + expect(await correctThirdMonitor.count()).toBe(1); + await page.waitForTimeout(30000); + }); + + step('delete monitors', async () => { + await syntheticsApp.navigateToMonitorManagement(); + expect(await syntheticsApp.deleteMonitors()).toBeTruthy(); + }); +}); diff --git a/x-pack/plugins/synthetics/e2e/page_objects/monitor_management.tsx b/x-pack/plugins/synthetics/e2e/page_objects/monitor_management.tsx index 0046326bad612..3791aa8068176 100644 --- a/x-pack/plugins/synthetics/e2e/page_objects/monitor_management.tsx +++ b/x-pack/plugins/synthetics/e2e/page_objects/monitor_management.tsx @@ -5,7 +5,7 @@ * 2.0. */ import { expect, Page } from '@elastic/synthetics'; -import { getQuerystring } from '@kbn/observability-plugin/e2e/utils'; +import { getQuerystring, TIMEOUT_60_SEC } from '@kbn/observability-plugin/e2e/utils'; import { DataStream } from '../../common/runtime_types/monitor_management'; import { loginPageProvider } from './login'; import { utilsPageProvider } from './utils'; @@ -162,7 +162,7 @@ export function monitorManagementPageProvider({ async selectLocations({ locations }: { locations: string[] }) { for (let i = 0; i < locations.length; i++) { - await page.check(`text=${locations[i]}`); + await page.check(`text=${locations[i]}`, TIMEOUT_60_SEC); } }, diff --git a/x-pack/plugins/synthetics/e2e/page_objects/synthetics_app.tsx b/x-pack/plugins/synthetics/e2e/page_objects/synthetics_app.tsx index fc365abd823b9..71c4dafe5f07f 100644 --- a/x-pack/plugins/synthetics/e2e/page_objects/synthetics_app.tsx +++ b/x-pack/plugins/synthetics/e2e/page_objects/synthetics_app.tsx @@ -21,6 +21,7 @@ export function syntheticsAppPageProvider({ page, kibanaUrl }: { page: Page; kib const basePath = isRemote ? remoteKibanaUrl : kibanaUrl; const monitorManagement = `${basePath}/app/synthetics/monitors`; const addMonitor = `${basePath}/app/synthetics/add-monitor`; + const overview = `${basePath}/app/synthetics`; return { ...loginPageProvider({ page, @@ -37,6 +38,10 @@ export function syntheticsAppPageProvider({ page, kibanaUrl }: { page: Page; kib await this.waitForMonitorManagementLoadingToFinish(); }, + async navigateToOverview() { + await page.goto(overview, { waitUntil: 'networkidle' }); + }, + async waitForMonitorManagementLoadingToFinish() { while (true) { if ((await page.$(this.byTestId('uptimeLoader'))) === null) break; @@ -82,7 +87,7 @@ export function syntheticsAppPageProvider({ page, kibanaUrl }: { page: Page; kib async navigateToEditMonitor() { await this.clickByTestSubj('syntheticsMonitorListActions'); - await page.click('text=Edit'); + await page.click('text=Edit', { timeout: 2 * 60 * 1000, delay: 800 }); await this.findByText('Edit monitor'); }, diff --git a/x-pack/plugins/synthetics/e2e/tsconfig.json b/x-pack/plugins/synthetics/e2e/tsconfig.json index b4368ae13b9e4..c62e73d4df121 100644 --- a/x-pack/plugins/synthetics/e2e/tsconfig.json +++ b/x-pack/plugins/synthetics/e2e/tsconfig.json @@ -6,7 +6,7 @@ "outDir": "target/types", "types": [ "node"], }, - "references": [ + "kbn_references": [ { "path": "../../apm/tsconfig.json", }, diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx index 81ecb7dc60027..ebc6cc265dfa5 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx @@ -103,7 +103,7 @@ export const BrowserStepsList = ({ steps, error, loading, showStepNumber = false aria-label={VIEW_DETAILS} title={VIEW_DETAILS} size="s" - href={`${basePath}/app/uptime/journey/${item.monitor.check_group}/step/${item.synthetics?.step?.index}`} + href={`${basePath}/app/synthetics/journey/${item.monitor.check_group}/step/${item.synthetics?.step?.index}`} target="_self" iconType="apmTrace" /> diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/empty_thumbnail.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/empty_thumbnail.tsx index bfc5851ade619..38ab5c66acbae 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/empty_thumbnail.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/empty_thumbnail.tsx @@ -15,7 +15,7 @@ export const THUMBNAIL_HEIGHT = 64; export const thumbnailStyle = css` padding: 0; - margin: 0; + margin: auto; width: ${THUMBNAIL_WIDTH}px; height: ${THUMBNAIL_HEIGHT}px; object-fit: contain; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_image_popover.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_image_popover.tsx index 48ff7237223fb..dda8c5343eb08 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_image_popover.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_image_popover.tsx @@ -9,10 +9,13 @@ import React from 'react'; import { css } from '@emotion/react'; import { EuiImage, EuiPopover, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { useRouteMatch } from 'react-router-dom'; +import { EmptyImage } from '../screenshot/empty_image'; import { ScreenshotRefImageData } from '../../../../../../common/runtime_types'; import { useCompositeImage } from '../../../hooks/use_composite_image'; import { EmptyThumbnail, thumbnailStyle } from './empty_thumbnail'; +import { STEP_DETAIL_ROUTE } from '../../../../../../common/constants'; const POPOVER_IMG_HEIGHT = 360; const POPOVER_IMG_WIDTH = 640; @@ -22,6 +25,7 @@ interface ScreenshotImageProps { imageCaption: JSX.Element; isStepFailed: boolean; isLoading: boolean; + asThumbnail?: boolean; } const ScreenshotThumbnail: React.FC<ScreenshotImageProps & { imageData?: string }> = ({ @@ -30,6 +34,7 @@ const ScreenshotThumbnail: React.FC<ScreenshotImageProps & { imageData?: string imageData, isStepFailed, isLoading, + asThumbnail = true, }) => { return imageData ? ( <EuiImage @@ -39,11 +44,13 @@ const ScreenshotThumbnail: React.FC<ScreenshotImageProps & { imageData?: string data-test-subj="stepScreenshotThumbnail" hasShadow url={imageData} - size="s" + size="l" className="syntheticsStepImage" /> - ) : ( + ) : asThumbnail ? ( <EmptyThumbnail isLoading={isLoading} /> + ) : ( + <EmptyImage isLoading={isLoading} /> ); }; /** @@ -64,6 +71,7 @@ const RecomposedScreenshotImage: React.FC< setImageData, isStepFailed, isLoading, + asThumbnail, }) => { // initially an undefined URL value is passed to the image display, and a loading spinner is rendered. // `useCompositeImage` will call `setImageData` when the image is composited, and the updated `imageData` will display. @@ -76,6 +84,7 @@ const RecomposedScreenshotImage: React.FC< imageData={imageData} isStepFailed={isStepFailed} isLoading={isLoading} + asThumbnail={asThumbnail} /> ); }; @@ -88,6 +97,7 @@ export interface StepImagePopoverProps { isImagePopoverOpen: boolean; isStepFailed: boolean; isLoading: boolean; + asThumbnail?: boolean; } const JourneyStepImage: React.FC< @@ -104,6 +114,7 @@ const JourneyStepImage: React.FC< setImageData, isStepFailed, isLoading, + asThumbnail = true, }) => { if (imgSrc) { return ( @@ -113,6 +124,7 @@ const JourneyStepImage: React.FC< imageData={imageData} isStepFailed={isStepFailed} isLoading={isLoading} + asThumbnail={asThumbnail} /> ); } else if (imgRef) { @@ -125,6 +137,7 @@ const JourneyStepImage: React.FC< setImageData={setImageData} isStepFailed={isStepFailed} isLoading={isLoading} + asThumbnail={asThumbnail} /> ); } @@ -139,6 +152,7 @@ export const JourneyStepImagePopover: React.FC<StepImagePopoverProps> = ({ isImagePopoverOpen, isStepFailed, isLoading, + asThumbnail = true, }) => { const { euiTheme } = useEuiTheme(); @@ -158,12 +172,16 @@ export const JourneyStepImagePopover: React.FC<StepImagePopoverProps> = ({ const isImageLoading = isLoading || (!!imgRef && !imageData); + const isStepDetailPage = useRouteMatch(STEP_DETAIL_ROUTE)?.isExact; + + const thumbnailS = isStepDetailPage ? null : thumbnailStyle; + return ( <EuiPopover css={css` figure { img { - ${thumbnailStyle}; + ${thumbnailS}; border: ${euiTheme.border.thin}; ${isStepFailed ? `border-color: ${euiTheme.colors.danger}` : ``}; } @@ -180,6 +198,7 @@ export const JourneyStepImagePopover: React.FC<StepImagePopoverProps> = ({ imageData={imageData} isStepFailed={isStepFailed} isLoading={isImageLoading} + asThumbnail={asThumbnail} /> } isOpen={isImagePopoverOpen} @@ -195,12 +214,10 @@ export const JourneyStepImagePopover: React.FC<StepImagePopoverProps> = ({ object-fit: contain; `} /> + ) : asThumbnail ? ( + <EmptyThumbnail isLoading={isLoading} /> ) : ( - <EmptyThumbnail - isLoading={isLoading} - width={POPOVER_IMG_WIDTH} - height={POPOVER_IMG_HEIGHT} - /> + <EmptyImage isLoading={isLoading} /> )} </EuiPopover> ); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_with_label.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_with_label.tsx index 12dcd4db95f00..f153aa07f2f4f 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_with_label.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_with_label.tsx @@ -8,7 +8,7 @@ import React, { CSSProperties } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiText, useEuiTheme } from '@elastic/eui'; import { JourneyStep } from '../../../../../../common/runtime_types'; -import { JourneyStepScreenshotContainer } from './journey_step_screenshot_container'; +import { JourneyStepScreenshotContainer } from '../screenshot/journey_step_screenshot_container'; import { getTextColorForMonitorStatus, parseBadgeStatus } from './status_badge'; interface Props { diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx index bb0666abbab26..cf6e0f00ff570 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx @@ -16,7 +16,7 @@ import { i18n } from '@kbn/i18n'; import { Ping } from '../../../../../../common/runtime_types'; import { formatTestDuration } from '../../../utils/monitor_test_result/test_time_formats'; -export const SinglePingResult = ({ ping, loading }: { ping: Ping; loading: boolean }) => { +export const SinglePingResult = ({ ping, loading }: { ping?: Ping; loading: boolean }) => { const ip = !loading ? ping?.resolve?.ip : undefined; const durationUs = !loading ? ping?.monitor?.duration?.us ?? NaN : NaN; const rtt = !loading ? ping?.resolve?.rtt?.us ?? NaN : NaN; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts new file mode 100644 index 0000000000000..62b8c94333e2b --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { letBrowserHandleEvent } from './link_events'; +export { + ReactRouterEuiLink, + ReactRouterEuiButton, + ReactRouterEuiButtonEmpty, +} from './link_for_eui'; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts new file mode 100644 index 0000000000000..1046f47f8f380 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts @@ -0,0 +1,103 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { letBrowserHandleEvent } from '.'; + +describe('letBrowserHandleEvent', () => { + const event = { + defaultPrevented: false, + metaKey: false, + altKey: false, + ctrlKey: false, + shiftKey: false, + button: 0, + target: { + getAttribute: () => '_self', + }, + } as any; + + describe('the browser should handle the link when', () => { + it('default is prevented', () => { + expect(letBrowserHandleEvent({ ...event, defaultPrevented: true })).toBe(true); + }); + + it('is modified with metaKey', () => { + expect(letBrowserHandleEvent({ ...event, metaKey: true })).toBe(true); + }); + + it('is modified with altKey', () => { + expect(letBrowserHandleEvent({ ...event, altKey: true })).toBe(true); + }); + + it('is modified with ctrlKey', () => { + expect(letBrowserHandleEvent({ ...event, ctrlKey: true })).toBe(true); + }); + + it('is modified with shiftKey', () => { + expect(letBrowserHandleEvent({ ...event, shiftKey: true })).toBe(true); + }); + + it('it is not a left click event', () => { + expect(letBrowserHandleEvent({ ...event, button: 2 })).toBe(true); + }); + + it('the target is anything value other than _self', () => { + expect( + letBrowserHandleEvent({ + ...event, + target: targetValue('_blank'), + }) + ).toBe(true); + }); + }); + + describe('the browser should NOT handle the link when', () => { + it('default is not prevented', () => { + expect(letBrowserHandleEvent({ ...event, defaultPrevented: false })).toBe(false); + }); + + it('is not modified', () => { + expect( + letBrowserHandleEvent({ + ...event, + metaKey: false, + altKey: false, + ctrlKey: false, + shiftKey: false, + }) + ).toBe(false); + }); + + it('it is a left click event', () => { + expect(letBrowserHandleEvent({ ...event, button: 0 })).toBe(false); + }); + + it('the target is a value of _self', () => { + expect( + letBrowserHandleEvent({ + ...event, + target: targetValue('_self'), + }) + ).toBe(false); + }); + + it('the target has no value', () => { + expect( + letBrowserHandleEvent({ + ...event, + target: targetValue(null), + }) + ).toBe(false); + }); + }); +}); + +const targetValue = (value: string | null) => { + return { + getAttribute: () => value, + }; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.ts new file mode 100644 index 0000000000000..089a41b0795c7 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.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 { MouseEvent } from 'react'; + +/** + * Helper functions for determining which events we should + * let browsers handle natively, e.g. new tabs/windows + */ + +type THandleEvent = (event: MouseEvent) => boolean; + +export const letBrowserHandleEvent: THandleEvent = (event) => + event.defaultPrevented || + isModifiedEvent(event) || + !isLeftClickEvent(event) || + isTargetBlank(event); + +const isModifiedEvent: THandleEvent = (event) => + !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); + +const isLeftClickEvent: THandleEvent = (event) => event.button === 0; + +const isTargetBlank: THandleEvent = (event) => { + const element = event.target as HTMLElement; + const target = element.getAttribute('target'); + return !!target && target !== '_self'; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx new file mode 100644 index 0000000000000..4ab605b159c73 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx @@ -0,0 +1,78 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { shallow, mount } from 'enzyme'; +import { EuiLink, EuiButton } from '@elastic/eui'; + +import '../../../utils/testing/__mocks__/ut_router_history.mock'; + +import { ReactRouterEuiLink, ReactRouterEuiButton } from './link_for_eui'; +import { mockHistory } from '../../../utils/testing/__mocks__/ut_router_history.mock'; + +describe('EUI & React Router Component Helpers', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('renders', () => { + const wrapper = shallow(<ReactRouterEuiLink to="/" />); + + expect(wrapper.find(EuiLink)).toHaveLength(1); + }); + + it('renders an EuiButton', () => { + const wrapper = shallow(<ReactRouterEuiButton to="/" />); + + expect(wrapper.find(EuiButton)).toHaveLength(1); + }); + + it('passes down all ...rest props', () => { + const wrapper = shallow(<ReactRouterEuiLink to="/" data-test-subj="foo" external={true} />); + const link = wrapper.find(EuiLink); + + expect(link.prop('external')).toEqual(true); + expect(link.prop('data-test-subj')).toEqual('foo'); + }); + + it('renders with the correct href and onClick props', () => { + const wrapper = mount(<ReactRouterEuiLink to="/foo/bar" />); + const link = wrapper.find(EuiLink); + + expect(link.prop('onClick')).toBeInstanceOf(Function); + expect(link.prop('href')).toEqual('/enterprise_search/foo/bar'); + expect(mockHistory.createHref).toHaveBeenCalled(); + }); + + describe('onClick', () => { + it('prevents default navigation and uses React Router history', () => { + const wrapper = mount(<ReactRouterEuiLink to="/bar/baz" />); + + const simulatedEvent = { + button: 0, + target: { getAttribute: () => '_self' }, + preventDefault: jest.fn(), + }; + wrapper.find(EuiLink).find('a').simulate('click', simulatedEvent); + + expect(simulatedEvent.preventDefault).toHaveBeenCalled(); + expect(mockHistory.push).toHaveBeenCalled(); + }); + + it('does not prevent default browser behavior on new tab/window clicks', () => { + const wrapper = mount(<ReactRouterEuiLink to="/bar/baz" />); + + const simulatedEvent = { + shiftKey: true, + target: { getAttribute: () => '_blank' }, + }; + wrapper.find(EuiLink).find('a').simulate('click', simulatedEvent); + + expect(mockHistory.push).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.tsx new file mode 100644 index 0000000000000..a9b06d18938da --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.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 from 'react'; +import { useHistory } from 'react-router-dom'; +import { + EuiLink, + EuiButton, + EuiButtonProps, + EuiButtonEmptyProps, + EuiLinkAnchorProps, + EuiButtonEmpty, +} from '@elastic/eui'; + +import { letBrowserHandleEvent } from './link_events'; + +/** + * Generates either an EuiLink or EuiButton with a React-Router-ified link + * + * Based off of EUI's recommendations for handling React Router: + * https://github.com/elastic/eui/blob/master/wiki/react-router.md#react-router-51 + */ + +interface IEuiReactRouterProps { + to: string; +} + +export const ReactRouterHelperForEui: React.FC<IEuiReactRouterProps> = ({ to, children }) => { + const history = useHistory(); + + const onClick = (event: React.MouseEvent) => { + if (letBrowserHandleEvent(event)) return; + + // Prevent regular link behavior, which causes a browser refresh. + event.preventDefault(); + + // Push the route to the history. + history.push(to); + }; + + // Generate the correct link href (with basename etc. accounted for) + const href = history.createHref({ pathname: to }); + + const reactRouterProps = { href, onClick }; + return React.cloneElement(children as React.ReactElement, reactRouterProps); +}; + +type TEuiReactRouterLinkProps = EuiLinkAnchorProps & IEuiReactRouterProps; +type TEuiReactRouterButtonProps = EuiButtonProps & IEuiReactRouterProps; +type TEuiReactRouterButtonEmptyProps = EuiButtonEmptyProps & IEuiReactRouterProps; + +export const ReactRouterEuiLink: React.FC<TEuiReactRouterLinkProps> = ({ to, ...rest }) => ( + <ReactRouterHelperForEui to={to}> + <EuiLink {...rest} /> + </ReactRouterHelperForEui> +); + +export const ReactRouterEuiButton: React.FC<TEuiReactRouterButtonProps> = ({ to, ...rest }) => ( + <ReactRouterHelperForEui to={to}> + <EuiButton {...rest} /> + </ReactRouterHelperForEui> +); + +export const ReactRouterEuiButtonEmpty: React.FC<TEuiReactRouterButtonEmptyProps> = ({ + to, + ...rest +}) => ( + <ReactRouterHelperForEui to={to}> + <EuiButtonEmpty {...rest} /> + </ReactRouterHelperForEui> +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_image.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_image.tsx new file mode 100644 index 0000000000000..57295b3e1daf2 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_image.tsx @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { css } from '@emotion/react'; +import { i18n } from '@kbn/i18n'; +import { + useEuiTheme, + useEuiBackgroundColor, + EuiIcon, + EuiLoadingContent, + EuiText, +} from '@elastic/eui'; + +export const IMAGE_WIDTH = 360; +export const IMAGE_HEIGHT = 203; + +export const imageStyle = css` + padding: 0; + margin: auto; + width: ${IMAGE_WIDTH}px; + height: ${IMAGE_HEIGHT}px; + object-fit: contain; + overflow: hidden; + display: flex; + align-items: center; + justify-content: center; +`; + +export const EmptyImage = ({ + isLoading = false, + width = IMAGE_WIDTH, + height = IMAGE_HEIGHT, +}: { + isLoading: boolean; + width?: number; + height?: number; +}) => { + const { euiTheme } = useEuiTheme(); + + return ( + <div + data-test-subj="stepScreenshotPlaceholder" + role="img" + aria-label={isLoading ? SCREENSHOT_LOADING_ARIA_LABEL : SCREENSHOT_NOT_AVAILABLE} + title={isLoading ? SCREENSHOT_LOADING_ARIA_LABEL : SCREENSHOT_NOT_AVAILABLE} + css={css` + ${imageStyle}; + width: ${width}px; + height: ${height}px; + background: ${useEuiBackgroundColor('subdued')}; + border: ${euiTheme.border.thin}; + `} + > + {isLoading ? ( + <EuiLoadingContent + lines={1} + data-test-subj="stepScreenshotPlaceholderLoading" + css={css` + width: 100%; + height: 8%; + transform: scale(1, 13); // To create a skeleton loading effect + `} + /> + ) : ( + <div> + <EuiIcon + data-test-subj="stepScreenshotNotAvailable" + type="eyeClosed" + color={euiTheme.colors.disabledText} + /> + <EuiText color={euiTheme.colors.disabledText}>{IMAGE_UN_AVAILABLE}</EuiText> + </div> + )} + </div> + ); +}; + +export const SCREENSHOT_LOADING_ARIA_LABEL = i18n.translate( + 'xpack.synthetics.monitor.step.screenshot.ariaLabel', + { + defaultMessage: 'Step screenshot is being loaded.', + } +); + +export const SCREENSHOT_NOT_AVAILABLE = i18n.translate( + 'xpack.synthetics.monitor.step.screenshot.notAvailable', + { + defaultMessage: 'Step screenshot is not available.', + } +); + +export const IMAGE_UN_AVAILABLE = i18n.translate( + 'xpack.synthetics.monitor.step.screenshot.unAvailable', + { + defaultMessage: 'Image unavailable', + } +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot.tsx new file mode 100644 index 0000000000000..9199c3f7db7e8 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot.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 React, { useMemo } from 'react'; +import { useJourneySteps } from '../../monitor_details/hooks/use_journey_steps'; +import { parseBadgeStatus } from '../monitor_test_result/status_badge'; +import { JourneyStepScreenshotContainer } from './journey_step_screenshot_container'; + +export const JourneyScreenshot = ({ checkGroupId }: { checkGroupId: string }) => { + const { loading: stepsLoading, stepEnds } = useJourneySteps(checkGroupId); + const stepLabels = stepEnds.map((stepEnd) => stepEnd?.synthetics?.step?.name ?? ''); + + const lastSignificantStep = useMemo(() => { + const copy = [...stepEnds]; + // Sort desc by timestamp + copy.sort( + (stepA, stepB) => + Number(new Date(stepB['@timestamp'])) - Number(new Date(stepA['@timestamp'])) + ); + return copy.find( + (stepEnd) => parseBadgeStatus(stepEnd?.synthetics?.step?.status ?? 'skipped') !== 'skipped' + ); + }, [stepEnds]); + + return ( + <JourneyStepScreenshotContainer + checkGroup={lastSignificantStep?.monitor.check_group} + initialStepNo={lastSignificantStep?.synthetics?.step?.index} + stepStatus={lastSignificantStep?.synthetics.payload?.status} + allStepsLoaded={!stepsLoading} + stepLabels={stepLabels} + retryFetchOnRevisit={false} + /> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.test.tsx rename to x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.test.tsx index 4c95fade23d1a..61219b57ae86d 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.test.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.test.tsx @@ -14,7 +14,7 @@ import * as observabilityPublic from '@kbn/observability-plugin/public'; import { getShortTimeStamp } from '../../../utils/monitor_test_result/timestamp'; import '../../../utils/testing/__mocks__/use_composite_image.mock'; import { mockRef } from '../../../utils/testing/__mocks__/screenshot_ref.mock'; -import * as retrieveHooks from './use_retrieve_step_image'; +import * as retrieveHooks from '../monitor_test_result/use_retrieve_step_image'; jest.mock('@kbn/observability-plugin/public'); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.tsx similarity index 89% rename from x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.tsx rename to x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.tsx index 6c2653f7efaa6..24045d5ac458a 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.tsx @@ -10,6 +10,7 @@ import { css } from '@emotion/react'; import useIntersection from 'react-use/lib/useIntersection'; import { i18n } from '@kbn/i18n'; +import { EmptyImage } from './empty_image'; import { isScreenshotImageBlob, isScreenshotRef, @@ -18,10 +19,10 @@ import { import { SyntheticsSettingsContext } from '../../../contexts'; -import { useRetrieveStepImage } from './use_retrieve_step_image'; -import { ScreenshotOverlayFooter } from './screenshot_overlay_footer'; -import { JourneyStepImagePopover } from './journey_step_image_popover'; -import { EmptyThumbnail } from './empty_thumbnail'; +import { useRetrieveStepImage } from '../monitor_test_result/use_retrieve_step_image'; +import { ScreenshotOverlayFooter } from '../monitor_test_result/screenshot_overlay_footer'; +import { JourneyStepImagePopover } from '../monitor_test_result/journey_step_image_popover'; +import { EmptyThumbnail } from '../monitor_test_result/empty_thumbnail'; interface Props { checkGroup?: string; @@ -29,6 +30,7 @@ interface Props { stepStatus?: string; initialStepNo?: number; allStepsLoaded?: boolean; + asThumbnail?: boolean; retryFetchOnRevisit?: boolean; // Set to `true` fro "Run Once" / "Test Now" modes } @@ -39,6 +41,7 @@ export const JourneyStepScreenshotContainer = ({ allStepsLoaded, initialStepNo = 1, retryFetchOnRevisit = false, + asThumbnail = true, }: Props) => { const [stepNumber, setStepNumber] = useState(initialStepNo); const [isImagePopoverOpen, setIsImagePopoverOpen] = useState(false); @@ -135,9 +138,12 @@ export const JourneyStepScreenshotContainer = ({ isImagePopoverOpen={isImagePopoverOpen} isStepFailed={stepStatus === 'failed'} isLoading={Boolean(loading)} + asThumbnail={asThumbnail} /> - ) : ( + ) : asThumbnail ? ( <EmptyThumbnail isLoading={loading || !allStepsLoaded} /> + ) : ( + <EmptyImage isLoading={loading || !allStepsLoaded} /> )} </div> ); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx new file mode 100644 index 0000000000000..37e354ccfd129 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '../../../utils/testing'; +import { getLast48Intervals, StepFieldTrend } from './step_field_trend'; +import { JourneyStep } from '../../../../../../common/runtime_types'; + +const step: JourneyStep = { + _id: 'docID', + monitor: { + check_group: 'check_group', + duration: { + us: 123, + }, + id: 'id', + status: 'up', + type: 'browser', + timespan: { + gte: '2021-12-01T12:54:28.098Z', + lt: '2021-12-01T12:55:28.098Z', + }, + }, + synthetics: { + step: { + index: 4, + status: 'succeeded', + name: 'STEP_NAME', + duration: { + us: 9999, + }, + }, + type: 'step/end', + }, + '@timestamp': '2021-12-03T15:23:41.072Z', +}; + +describe('StepFieldTrend', () => { + it('it renders embeddable', async () => { + const { findByText } = render( + <StepFieldTrend step={step} field="step.duration.us" title="Step duration" /> + ); + + expect(await findByText('Embeddable exploratory view')).toBeInTheDocument(); + }); +}); + +describe('getLast48Intervals', () => { + it('it returns expected values', () => { + // 48 minutes difference + expect(getLast48Intervals(step)).toEqual({ + from: '2021-12-03T14:35:41.072Z', + to: '2021-12-03T15:23:41.072Z', + }); + step.monitor.timespan = { + gte: '2021-12-01T12:55:38.098Z', + lt: '2021-12-01T12:55:48.098Z', + }; + // 8 minutes difference + expect(getLast48Intervals(step)).toEqual({ + from: '2021-12-03T15:15:41.072Z', + to: '2021-12-03T15:23:41.072Z', + }); + step.monitor.timespan = { + gte: '2021-12-01T12:54:28.098Z', + lt: '2021-12-01T13:55:28.098Z', + }; + + // 48h difference + expect(getLast48Intervals(step)).toEqual({ + from: '2021-12-01T14:35:41.072Z', + to: '2021-12-03T15:23:41.072Z', + }); + step.monitor.timespan = { + gte: '2021-12-01T12:54:28.098Z', + lt: '2021-12-02T12:55:28.098Z', + }; + + // 48d difference + expect(getLast48Intervals(step)).toEqual({ + from: '2021-10-16T14:35:41.072Z', + to: '2021-12-03T15:23:41.072Z', + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.tsx new file mode 100644 index 0000000000000..0f29cbe23b2cb --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.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 from 'react'; + +import { EuiButton } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import moment from 'moment'; +import { AllSeries, createExploratoryViewUrl } from '@kbn/observability-plugin/public'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { JourneyStep } from '../../../../../../common/runtime_types'; +import { useSyntheticsStartPlugins } from '../../../contexts'; + +export const getLast48Intervals = (activeStep: JourneyStep) => { + const timestamp = activeStep['@timestamp']; + const { lt, gte } = activeStep.monitor.timespan!; + const difference = moment(lt).diff(moment(gte), 'millisecond') * 48; + + return { + to: timestamp, + from: moment(timestamp).subtract(difference, 'millisecond').toISOString(), + }; +}; + +export function StepFieldTrend({ + title, + field, + step: activeStep, +}: { + title: string; + field: string; + step: JourneyStep; +}) { + const { observability } = useSyntheticsStartPlugins(); + + const EmbeddableExpView = observability!.ExploratoryViewEmbeddable; + + const basePath = useKibana().services.http?.basePath?.get(); + + const allSeries: AllSeries = [ + { + name: `${title}(${activeStep.synthetics.step?.name!})`, + selectedMetricField: field, + time: getLast48Intervals(activeStep), + seriesType: 'area', + dataType: 'synthetics', + reportDefinitions: { + 'monitor.name': [activeStep.monitor.name!], + 'synthetics.step.name.keyword': [activeStep.synthetics.step?.name!], + }, + operationType: 'last_value', + }, + ]; + + const href = createExploratoryViewUrl( + { + reportType: 'kpi-over-time', + allSeries, + }, + basePath + ); + + return ( + <Wrapper> + <EmbeddableExpView + title={title} + appendTitle={ + <EuiButton iconType={'visArea'} href={href} target="_blank" size="s"> + {EXPLORE_LABEL} + </EuiButton> + } + reportType={'kpi-over-time'} + attributes={allSeries} + axisTitlesVisibility={{ x: false, yLeft: false, yRight: false }} + legendIsVisible={false} + dataTypesIndexPatterns={{ + synthetics: 'synthetics-*', + }} + withActions={false} + /> + </Wrapper> + ); +} + +export const EXPLORE_LABEL = i18n.translate('xpack.synthetics.synthetics.markers.explore', { + defaultMessage: 'Explore', +}); + +const Wrapper = euiStyled.div` + height: 200px; + width: 400px; + &&& { + .expExpressionRenderer__expression { + padding-bottom: 0 !important; + } + } +`; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx index ce849f586a93c..68499e7612652 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx @@ -45,7 +45,7 @@ export const SimpleMonitorForm = () => { setMonitorData(data); }; - const { loading } = useSimpleMonitor({ monitorData }); + const { loading, data: newMonitor } = useSimpleMonitor({ monitorData }); const hasURLError = !!errors?.[ConfigKey.URLS]; @@ -53,7 +53,7 @@ export const SimpleMonitorForm = () => { <EuiForm onSubmit={handleSubmit(onSubmit)} component="form" - isInvalid={isSubmitted && !isValid && !loading} + isInvalid={isSubmitted && !isValid && !loading && !newMonitor?.id} noValidate > <EuiFormRow @@ -92,13 +92,6 @@ export const SimpleMonitorForm = () => { ); }; -export const MY_FIRST_MONITOR = i18n.translate( - 'xpack.synthetics.monitorManagement.myFirstMonitor', - { - defaultMessage: 'My first monitor', - } -); - export const WEBSITE_URL_LABEL = i18n.translate( 'xpack.synthetics.monitorManagement.websiteUrlLabel', { diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/getting_started/use_simple_monitor.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/getting_started/use_simple_monitor.ts index ec4c4e6507358..5a7d4a186fbaa 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/getting_started/use_simple_monitor.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/getting_started/use_simple_monitor.ts @@ -9,6 +9,7 @@ import { useFetcher } from '@kbn/observability-plugin/public'; import { useEffect } from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { useSelector } from 'react-redux'; +import { useSyntheticsRefreshContext } from '../../contexts'; import { selectServiceLocationsState } from '../../state'; import { showSyncErrors } from '../monitors_page/management/show_sync_errors'; import { fetchCreateMonitor } from '../../state'; @@ -19,13 +20,15 @@ import { ServiceLocationErrors, SyntheticsMonitorWithId, } from '../../../../../common/runtime_types'; -import { MONITOR_SUCCESS_LABEL, MY_FIRST_MONITOR, SimpleFormData } from './simple_monitor_form'; +import { MONITOR_SUCCESS_LABEL, SimpleFormData } from './simple_monitor_form'; import { kibanaService } from '../../../../utils/kibana_service'; export const useSimpleMonitor = ({ monitorData }: { monitorData?: SimpleFormData }) => { const { application } = useKibana().services; const { locations: serviceLocations } = useSelector(selectServiceLocationsState); + const { refreshApp } = useSyntheticsRefreshContext(); + const { data, loading } = useFetcher(() => { if (!monitorData) { return new Promise<undefined>((resolve) => resolve(undefined)); @@ -39,7 +42,7 @@ export const useSimpleMonitor = ({ monitorData }: { monitorData?: SimpleFormData await page.goto('${urls}'); });`, [ConfigKey.MONITOR_TYPE]: DataStream.BROWSER, - [ConfigKey.NAME]: MY_FIRST_MONITOR, + [ConfigKey.NAME]: urls, [ConfigKey.LOCATIONS]: locations, [ConfigKey.URLS]: urls, }, @@ -62,9 +65,10 @@ export const useSimpleMonitor = ({ monitorData }: { monitorData?: SimpleFormData title: MONITOR_SUCCESS_LABEL, toastLifeTimeMs: 3000, }); - application?.navigateToApp('synthetics', { path: `` }); + refreshApp(); + application?.navigateToApp('synthetics', { path: 'monitors' }); } - }, [application, data, loading, serviceLocations]); + }, [application, data, loading, refreshApp, serviceLocations]); - return { data, loading }; + return { data: data as SyntheticsMonitorWithId, loading }; }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.test.tsx index 192c76e414b07..dcb009c809a5e 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.test.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.test.tsx @@ -72,10 +72,13 @@ describe('defaults', () => { type: 'browser', 'url.port': null, urls: '', + id: '', + config_id: '', } as SyntheticsMonitor; it('correctly formats monitor type to form type', () => { expect(formatDefaultFormValues(monitorValues)).toEqual({ + ...monitorValues, __ui: { script_source: { file_name: '', diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx index 950d439173004..10de9f5a4c629 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; -import { EuiButtonEmpty } from '@elastic/eui'; +import { EuiLink, EuiIcon } from '@elastic/eui'; import { InPortal } from 'react-reverse-portal'; import { MonitorDetailsLinkPortalNode } from './portals'; @@ -25,8 +25,8 @@ export const MonitorDetailsLink = ({ name, id }: { name: string; id: string }) = pathname: `monitor/${id}`, }); return ( - <EuiButtonEmpty href={href} iconType="arrowLeft" flush="left"> - {name} - </EuiButtonEmpty> + <EuiLink href={href}> + <EuiIcon type="arrowLeft" /> {name} + </EuiLink> ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_earliest_start_data.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_earliest_start_data.ts new file mode 100644 index 0000000000000..decb2a5294cc1 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_earliest_start_data.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useFetcher } from '@kbn/observability-plugin/public'; +import { useParams } from 'react-router-dom'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { useMemo } from 'react'; +import moment from 'moment'; +import { useMonitorQueryId } from './use_monitor_query_id'; + +export const useEarliestStartDate = () => { + const monitorId = useMonitorQueryId(); + + const { monitorId: soId } = useParams<{ monitorId: string }>(); + + const { savedObjects } = useKibana().services; + + const { data: dataFromSO, loading } = useFetcher(async () => { + return savedObjects?.client?.get('synthetics-monitor', soId); + }, [monitorId]); + + return useMemo(() => { + if (dataFromSO?.createdAt) { + const diff = moment(dataFromSO?.createdAt).diff(moment().subtract(30, 'day'), 'days'); + if (diff > 0) { + return { from: dataFromSO?.createdAt, loading }; + } + } + return { from: 'now-30d/d', loading }; + }, [dataFromSO?.createdAt, loading]); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx index a6d2070d0e96a..13f3d24594707 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx @@ -6,10 +6,14 @@ */ import { useFetcher } from '@kbn/observability-plugin/public'; -import { SyntheticsJourneyApiResponse } from '../../../../../../common/runtime_types'; +import { useParams } from 'react-router-dom'; +import { isStepEnd } from '../../common/monitor_test_result/browser_steps_list'; +import { JourneyStep, SyntheticsJourneyApiResponse } from '../../../../../../common/runtime_types'; import { fetchJourneySteps } from '../../../state'; export const useJourneySteps = (checkGroup: string | undefined) => { + const { stepIndex } = useParams<{ stepIndex: string }>(); + const { data, loading } = useFetcher(() => { if (!checkGroup) { return Promise.resolve(null); @@ -18,5 +22,24 @@ export const useJourneySteps = (checkGroup: string | undefined) => { return fetchJourneySteps({ checkGroup }); }, [checkGroup]); - return { data: data as SyntheticsJourneyApiResponse, loading: loading ?? false }; + const isFailed = + data?.steps.some( + (step) => + step.synthetics?.step?.status === 'failed' || step.synthetics?.step?.status === 'skipped' + ) ?? false; + + const stepEnds: JourneyStep[] = (data?.steps ?? []).filter(isStepEnd); + + const stepLabels = stepEnds.map((stepEnd) => stepEnd?.synthetics?.step?.name ?? ''); + + return { + data: data as SyntheticsJourneyApiResponse, + loading: loading ?? false, + isFailed, + stepEnds, + stepLabels, + currentStep: stepIndex + ? data?.steps.find((step) => step.synthetics?.step?.index === Number(stepIndex)) + : undefined, + }; }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx index 6b9ab1442b9eb..2c989121d5ad9 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx @@ -8,7 +8,7 @@ import { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { ConfigKey } from '../../../../../../common/runtime_types'; -import { getMonitorRecentPingsAction, selectLatestPing, selectPingsLoading } from '../../../state'; +import { getMonitorLastRunAction, selectLastRunMetadata } from '../../../state'; import { useSelectedLocation } from './use_selected_location'; import { useSelectedMonitor } from './use_selected_monitor'; @@ -26,8 +26,7 @@ export const useMonitorLatestPing = (params?: UseMonitorLatestPingParams) => { const monitorId = params?.monitorId ?? monitor?.id; const locationLabel = params?.locationLabel ?? location?.label; - const latestPing = useSelector(selectLatestPing); - const pingsLoading = useSelector(selectPingsLoading); + const { data: latestPing, loading } = useSelector(selectLastRunMetadata); const latestPingId = latestPing?.monitor.id; @@ -40,21 +39,21 @@ export const useMonitorLatestPing = (params?: UseMonitorLatestPingParams) => { useEffect(() => { if (monitorId && locationLabel && !isUpToDate) { - dispatch(getMonitorRecentPingsAction.get({ monitorId, locationId: locationLabel })); + dispatch(getMonitorLastRunAction.get({ monitorId, locationId: locationLabel })); } }, [dispatch, monitorId, locationLabel, isUpToDate]); if (!monitorId || !locationLabel) { - return { loading: pingsLoading, latestPing: null }; + return { loading, latestPing: undefined }; } if (!latestPing) { - return { loading: pingsLoading, latestPing: null }; + return { loading, latestPing: undefined }; } if (!isIdSame || !isLocationSame) { - return { loading: pingsLoading, latestPing: null }; + return { loading, latestPing: undefined }; } - return { loading: pingsLoading, latestPing }; + return { loading, latestPing }; }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.tsx new file mode 100644 index 0000000000000..f4095892b5ad2 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.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 { useEffect } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; + +import { useSelectedMonitor } from './use_selected_monitor'; +import { useSelectedLocation } from './use_selected_location'; +import { getMonitorRecentPingsAction, selectMonitorPingsMetadata } from '../../../state'; + +interface UseMonitorPingsProps { + pageSize?: number; + pageIndex?: number; + from?: string; + to?: string; +} + +export const useMonitorPings = (props?: UseMonitorPingsProps) => { + const dispatch = useDispatch(); + + const { monitor } = useSelectedMonitor(); + const location = useSelectedLocation(); + + const monitorId = monitor?.id; + const locationLabel = location?.label; + + useEffect(() => { + if (monitorId && locationLabel) { + dispatch( + getMonitorRecentPingsAction.get({ + monitorId, + locationId: locationLabel, + size: props?.pageSize, + pageIndex: props?.pageIndex, + from: props?.from, + to: props?.to, + }) + ); + } + }, [ + dispatch, + monitorId, + locationLabel, + props?.pageSize, + props?.pageIndex, + props?.from, + props?.to, + ]); + + const { total, data: pings, loading } = useSelector(selectMonitorPingsMetadata); + + return { + loading, + total, + pings, + }; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.tsx new file mode 100644 index 0000000000000..8db063f50d63a --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.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 React from 'react'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { useParams } from 'react-router-dom'; +import { ClientPluginsStart } from '../../../../../plugin'; + +export const MonitorFailedTests = ({ time }: { time: { to: string; from: string } }) => { + const { observability } = useKibana<ClientPluginsStart>().services; + + const { ExploratoryViewEmbeddable } = observability; + + const { monitorId } = useParams<{ monitorId: string }>(); + + return ( + <ExploratoryViewEmbeddable + customHeight={'120px'} + reportType="heatmap" + axisTitlesVisibility={{ x: false, yRight: false, yLeft: false }} + legendIsVisible={false} + attributes={[ + { + time, + reportDefinitions: { + 'monitor.id': [monitorId], + }, + dataType: 'synthetics', + selectedMetricField: 'failed_tests', + name: 'synthetics-series-1', + }, + ]} + /> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx index fba0664f0ef07..f062a6ab7b10f 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx @@ -12,19 +12,25 @@ import { EuiTitle, useEuiTheme, } from '@elastic/eui'; -import React from 'react'; +import React, { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { FailedTestsCount } from './failed_tests_count'; import { useGetUrlParams } from '../../../hooks'; import { SyntheticsDatePicker } from '../../common/date_picker/synthetics_date_picker'; import { MonitorErrorsCount } from '../monitor_summary/monitor_errors_count'; import { ErrorsList } from './errors_list'; +import { MonitorFailedTests } from './failed_tests'; export const MonitorErrors = () => { const { euiTheme } = useEuiTheme(); const { dateRangeStart, dateRangeEnd } = useGetUrlParams(); + const time = useMemo( + () => ({ from: dateRangeStart, to: dateRangeEnd }), + [dateRangeEnd, dateRangeStart] + ); + return ( <> <SyntheticsDatePicker fullWidth={true} /> @@ -50,6 +56,7 @@ export const MonitorErrors = () => { <EuiTitle size="xs"> <h3 css={{ margin: euiTheme.size.s, marginBottom: 0 }}>{FAILED_TESTS_LABEL}</h3> </EuiTitle> + <MonitorFailedTests time={time} /> </EuiPanel> </EuiFlexItem> </EuiFlexGroup> diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_panel.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_panel.tsx index 7838bc3dd616a..eaab0dfb92eff 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_panel.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_panel.tsx @@ -8,10 +8,10 @@ import React from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { ReportTypes } from '@kbn/observability-plugin/public'; -import { useParams } from 'react-router-dom'; import { ClientPluginsStart } from '../../../../../plugin'; import { KpiWrapper } from './kpi_wrapper'; +import { useMonitorQueryId } from '../hooks/use_monitor_query_id'; interface AvailabilityPanelprops { from: string; @@ -24,7 +24,8 @@ export const AvailabilityPanel = (props: AvailabilityPanelprops) => { observability: { ExploratoryViewEmbeddable }, }, } = useKibana<ClientPluginsStart>(); - const { monitorId } = useParams<{ monitorId: string }>(); + + const monitorId = useMonitorQueryId(); return ( <KpiWrapper> @@ -37,7 +38,7 @@ export const AvailabilityPanel = (props: AvailabilityPanelprops) => { name: 'Monitor availability', dataType: 'synthetics', selectedMetricField: 'monitor_availability', - reportDefinitions: { config_id: [monitorId] }, + reportDefinitions: { 'monitor.id': [monitorId] }, }, ]} /> diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_ten_test_runs.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_ten_test_runs.tsx deleted file mode 100644 index eddf40739e55d..0000000000000 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_ten_test_runs.tsx +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { useSelector } from 'react-redux'; -import { i18n } from '@kbn/i18n'; -import { - EuiBasicTable, - EuiBasicTableColumn, - EuiButtonEmpty, - EuiFlexGroup, - EuiFlexItem, - EuiLink, - EuiPanel, - EuiText, - EuiTitle, - useEuiTheme, -} from '@elastic/eui'; -import { Criteria } from '@elastic/eui/src/components/basic_table/basic_table'; -import { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; - -import { ConfigKey, DataStream, JourneyStep, Ping } from '../../../../../../common/runtime_types'; -import { - formatTestDuration, - formatTestRunAt, -} from '../../../utils/monitor_test_result/test_time_formats'; -import { useSyntheticsSettingsContext } from '../../../contexts/synthetics_settings_context'; - -import { sortPings } from '../../../utils/monitor_test_result/sort_pings'; -import { selectPingsLoading, selectMonitorRecentPings, selectPingsError } from '../../../state'; -import { parseBadgeStatus, StatusBadge } from '../../common/monitor_test_result/status_badge'; -import { isStepEnd } from '../../common/monitor_test_result/browser_steps_list'; -import { JourneyStepScreenshotContainer } from '../../common/monitor_test_result/journey_step_screenshot_container'; - -import { useKibanaDateFormat } from '../../../../../hooks/use_kibana_date_format'; -import { useSelectedMonitor } from '../hooks/use_selected_monitor'; -import { useJourneySteps } from '../hooks/use_journey_steps'; - -type SortableField = 'timestamp' | 'monitor.status' | 'monitor.duration.us'; - -export const LastTenTestRuns = () => { - const { basePath } = useSyntheticsSettingsContext(); - - const [sortField, setSortField] = useState<SortableField>('timestamp'); - const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('desc'); - const pings = useSelector(selectMonitorRecentPings); - const sortedPings = useMemo(() => { - return sortPings(pings, sortField, sortDirection); - }, [pings, sortField, sortDirection]); - const pingsLoading = useSelector(selectPingsLoading); - const pingsError = useSelector(selectPingsError); - const { monitor } = useSelectedMonitor(); - - const isBrowserMonitor = monitor?.[ConfigKey.MONITOR_TYPE] === DataStream.BROWSER; - - const sorting: EuiTableSortingType<Ping> = { - sort: { - field: sortField as keyof Ping, - direction: sortDirection as 'asc' | 'desc', - }, - }; - - const handleTableChange = ({ page, sort }: Criteria<Ping>) => { - if (sort !== undefined) { - setSortField(sort.field as SortableField); - setSortDirection(sort.direction); - } - }; - - const columns: Array<EuiBasicTableColumn<Ping>> = [ - ...((isBrowserMonitor - ? [ - { - align: 'left', - field: 'timestamp', - name: SCREENSHOT_LABEL, - render: (_timestamp: string, item) => <JourneyScreenshot ping={item} />, - }, - ] - : []) as Array<EuiBasicTableColumn<Ping>>), - { - align: 'left', - valign: 'middle', - field: 'timestamp', - name: '@timestamp', - sortable: true, - render: (timestamp: string, ping: Ping) => ( - <TestDetailsLink isBrowserMonitor={isBrowserMonitor} timestamp={timestamp} ping={ping} /> - ), - }, - { - align: 'left', - valign: 'middle', - field: 'monitor.status', - name: RESULT_LABEL, - sortable: true, - render: (status: string) => <StatusBadge status={parseBadgeStatus(status ?? 'skipped')} />, - }, - { - align: 'left', - field: 'error.message', - name: MESSAGE_LABEL, - textOnly: true, - render: (errorMessage: string) => ( - <EuiText size="s">{errorMessage?.length > 0 ? errorMessage : '-'}</EuiText> - ), - }, - { - align: 'right', - valign: 'middle', - field: 'monitor.duration.us', - name: DURATION_LABEL, - sortable: true, - render: (durationUs: number) => <EuiText size="s">{formatTestDuration(durationUs)}</EuiText>, - }, - ]; - - const historyIdParam = monitor?.[ConfigKey.CUSTOM_HEARTBEAT_ID] ?? monitor?.[ConfigKey.ID]; - return ( - <EuiPanel hasShadow={false} hasBorder css={{ minHeight: 200 }}> - <EuiFlexGroup alignItems="center" gutterSize="s"> - <EuiFlexItem grow={false}> - <EuiTitle size="xs"> - <h3>{pings?.length >= 10 ? LAST_10_TEST_RUNS : TEST_RUNS}</h3> - </EuiTitle> - </EuiFlexItem> - <EuiFlexItem grow={true} /> - <EuiFlexItem grow={false}> - <EuiButtonEmpty - size="xs" - iconType="list" - iconSide="left" - data-test-subj="monitorSummaryViewLastTestRun" - disabled={!historyIdParam} - href={`${basePath}/app/uptime/monitor/${btoa(historyIdParam ?? '')}`} - > - {i18n.translate('xpack.synthetics.monitorDetails.summary.viewHistory', { - defaultMessage: 'View History', - })} - </EuiButtonEmpty> - </EuiFlexItem> - </EuiFlexGroup> - <EuiBasicTable - compressed={false} - loading={pingsLoading} - columns={columns} - error={pingsError?.body?.message} - items={sortedPings} - noItemsMessage={ - pingsLoading - ? i18n.translate('xpack.synthetics.monitorDetails.loadingTestRuns', { - defaultMessage: 'Loading test runs...', - }) - : i18n.translate('xpack.synthetics.monitorDetails.noDataFound', { - defaultMessage: 'No data found', - }) - } - tableLayout={'auto'} - sorting={sorting} - onChange={handleTableChange} - /> - </EuiPanel> - ); -}; - -const JourneyScreenshot = ({ ping }: { ping: Ping }) => { - const { data: stepsData, loading: stepsLoading } = useJourneySteps(ping?.monitor?.check_group); - const stepEnds: JourneyStep[] = (stepsData?.steps ?? []).filter(isStepEnd); - const stepLabels = stepEnds.map((stepEnd) => stepEnd?.synthetics?.step?.name ?? ''); - - const lastSignificantStep = useMemo(() => { - const copy = [...stepEnds]; - // Sort desc by timestamp - copy.sort( - (stepA, stepB) => - Number(new Date(stepB['@timestamp'])) - Number(new Date(stepA['@timestamp'])) - ); - return copy.find( - (stepEnd) => parseBadgeStatus(stepEnd?.synthetics?.step?.status ?? 'skipped') !== 'skipped' - ); - }, [stepEnds]); - - return ( - <JourneyStepScreenshotContainer - checkGroup={lastSignificantStep?.monitor.check_group} - initialStepNo={lastSignificantStep?.synthetics?.step?.index} - stepStatus={lastSignificantStep?.synthetics.payload?.status} - allStepsLoaded={!stepsLoading} - stepLabels={stepLabels} - retryFetchOnRevisit={false} - /> - ); -}; - -const TestDetailsLink = ({ - isBrowserMonitor, - timestamp, - ping, -}: { - isBrowserMonitor: boolean; - timestamp: string; - ping: Ping; -}) => { - const { euiTheme } = useEuiTheme(); - const { basePath } = useSyntheticsSettingsContext(); - - const format = useKibanaDateFormat(); - const timestampText = ( - <EuiText size="s" css={{ fontWeight: euiTheme.font.weight.medium }}> - {formatTestRunAt(timestamp, format)} - </EuiText> - ); - - return isBrowserMonitor ? ( - <EuiLink href={`${basePath}/app/uptime/journey/${ping?.monitor?.check_group ?? ''}/steps`}> - {timestampText} - </EuiLink> - ) : ( - timestampText - ); -}; - -const TEST_RUNS = i18n.translate('xpack.synthetics.monitorDetails.summary.testRuns', { - defaultMessage: 'Test Runs', -}); - -const LAST_10_TEST_RUNS = i18n.translate( - 'xpack.synthetics.monitorDetails.summary.lastTenTestRuns', - { - defaultMessage: 'Last 10 Test Runs', - } -); - -const SCREENSHOT_LABEL = i18n.translate('xpack.synthetics.monitorDetails.summary.screenshot', { - defaultMessage: 'Screenshot', -}); - -const RESULT_LABEL = i18n.translate('xpack.synthetics.monitorDetails.summary.result', { - defaultMessage: 'Result', -}); - -const MESSAGE_LABEL = i18n.translate('xpack.synthetics.monitorDetails.summary.message', { - defaultMessage: 'Message', -}); - -const DURATION_LABEL = i18n.translate('xpack.synthetics.monitorDetails.summary.duration', { - defaultMessage: 'Duration', -}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx index a3e2bb6796d3b..9fd35bc60cd0d 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx @@ -19,7 +19,6 @@ import { EuiTitle, useEuiTheme, } from '@elastic/eui'; -import { useSelector } from 'react-redux'; import { i18n } from '@kbn/i18n'; import { @@ -31,7 +30,6 @@ import { import { formatTestRunAt } from '../../../utils/monitor_test_result/test_time_formats'; import { useSyntheticsSettingsContext } from '../../../contexts'; -import { selectLatestPing, selectPingsLoading } from '../../../state'; import { BrowserStepsList } from '../../common/monitor_test_result/browser_steps_list'; import { SinglePingResult } from '../../common/monitor_test_result/single_ping_result'; import { parseBadgeStatus, StatusBadge } from '../../common/monitor_test_result/status_badge'; @@ -39,11 +37,11 @@ import { parseBadgeStatus, StatusBadge } from '../../common/monitor_test_result/ import { useKibanaDateFormat } from '../../../../../hooks/use_kibana_date_format'; import { useJourneySteps } from '../hooks/use_journey_steps'; import { useSelectedMonitor } from '../hooks/use_selected_monitor'; +import { useMonitorLatestPing } from '../hooks/use_monitor_latest_ping'; export const LastTestRun = () => { const { euiTheme } = useEuiTheme(); - const latestPing = useSelector(selectLatestPing); - const pingsLoading = useSelector(selectPingsLoading); + const { latestPing, loading: pingsLoading } = useMonitorLatestPing(); const { monitor } = useSelectedMonitor(); const { data: stepsData, loading: stepsLoading } = useJourneySteps( @@ -97,7 +95,7 @@ const PanelHeader = ({ loading, }: { monitor: EncryptedSyntheticsSavedMonitor | null; - latestPing: Ping; + latestPing?: Ping; loading: boolean; }) => { const { euiTheme } = useEuiTheme(); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel.tsx index 2fd702a187e36..3186715fc03b2 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel.tsx @@ -19,18 +19,19 @@ import { } from '@elastic/eui'; import { capitalize } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { useDispatch, useSelector } from 'react-redux'; +import { useDispatch } from 'react-redux'; import { useParams } from 'react-router-dom'; import { useSelectedMonitor } from '../hooks/use_selected_monitor'; import { MonitorTags } from './monitor_tags'; import { MonitorEnabled } from '../../monitors_page/management/monitor_list_table/monitor_enabled'; import { LocationsStatus } from './locations_status'; -import { getMonitorAction, selectLatestPing } from '../../../state'; +import { getMonitorAction } from '../../../state'; import { ConfigKey } from '../../../../../../common/runtime_types'; +import { useMonitorLatestPing } from '../hooks/use_monitor_latest_ping'; export const MonitorDetailsPanel = () => { const { euiTheme } = useEuiTheme(); - const latestPing = useSelector(selectLatestPing); + const { latestPing } = useMonitorLatestPing(); const { monitorId } = useParams<{ monitorId: string }>(); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_error_sparklines.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_error_sparklines.tsx index 731b623c65e1b..515d338b4c33a 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_error_sparklines.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_error_sparklines.tsx @@ -11,7 +11,11 @@ import { useParams } from 'react-router-dom'; import { useEuiTheme } from '@elastic/eui'; import { ClientPluginsStart } from '../../../../../plugin'; -export const MonitorErrorSparklines = () => { +interface Props { + from: string; + to: string; +} +export const MonitorErrorSparklines = (props: Props) => { const { observability } = useKibana<ClientPluginsStart>().services; const { ExploratoryViewEmbeddable } = observability; @@ -29,10 +33,7 @@ export const MonitorErrorSparklines = () => { attributes={[ { seriesType: 'area', - time: { - from: 'now-30d/d', - to: 'now', - }, + time: props, reportDefinitions: { 'monitor.id': [monitorId] }, dataType: 'synthetics', selectedMetricField: 'state.id', diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_errors_count.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_errors_count.tsx index 30a220f3f10b8..850aec1a9d4a1 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_errors_count.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_errors_count.tsx @@ -32,7 +32,7 @@ export const MonitorErrorsCount = (props: MonitorErrorsCountProps) => { attributes={[ { time: props, - reportDefinitions: { config_id: [monitorId] }, + reportDefinitions: { 'monitor.id': [monitorId] }, dataType: 'synthetics', selectedMetricField: 'monitor_errors', name: 'synthetics-series-1', diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx index 4cdaa6bd49570..03ccc403d0b30 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx @@ -13,10 +13,12 @@ import { EuiFlexItem, EuiText, EuiSpacer, - useEuiTheme, + EuiLoadingSpinner, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { LoadWhenInView } from '@kbn/observability-plugin/public'; +import { useEarliestStartDate } from '../hooks/use_earliest_start_data'; import { MonitorErrorSparklines } from './monitor_error_sparklines'; import { DurationSparklines } from './duration_sparklines'; import { MonitorDurationTrend } from './duration_trend'; @@ -26,21 +28,24 @@ import { DurationPanel } from './duration_panel'; import { MonitorDetailsPanel } from './monitor_details_panel'; import { AvailabilitySparklines } from './availability_sparklines'; import { LastTestRun } from './last_test_run'; -import { LastTenTestRuns } from './last_ten_test_runs'; +import { LAST_10_TEST_RUNS, TestRunsTable } from './test_runs_table'; import { MonitorErrorsCount } from './monitor_errors_count'; export const MonitorSummary = () => { - const { euiTheme } = useEuiTheme(); - - // TODO this range needs to be adjusted dynamically https://github.com/elastic/kibana/issues/143472 - const from = 'now-30d/d'; + const { from, loading } = useEarliestStartDate(); const to = 'now'; + if (loading) { + return <EuiLoadingSpinner size="xl" />; + } + + const dateLabel = from === 'now-30d/d' ? LAST_30_DAYS_LABEL : TO_DATE_LABEL; + return ( <> <EuiFlexGroup gutterSize="m"> <EuiFlexItem grow={1}> - <EuiPanel hasShadow={false} hasBorder> + <EuiPanel hasShadow={false} hasBorder paddingSize="m"> <EuiTitle size="xs"> <h3>{MONITOR_DETAILS_LABEL}</h3> </EuiTitle> @@ -48,10 +53,20 @@ export const MonitorSummary = () => { </EuiPanel> </EuiFlexItem> <EuiFlexItem grow={2}> - <EuiPanel hasShadow={false} hasBorder paddingSize="s" css={{ height: 158 }}> - <EuiTitle size="xs"> - <h3 css={{ margin: euiTheme.size.s, marginBottom: 0 }}>{LAST_30DAYS_LABEL}</h3> - </EuiTitle> + <EuiPanel hasShadow={false} hasBorder paddingSize="m" css={{ height: 158 }}> + <EuiFlexGroup alignItems="center" gutterSize="m"> + <EuiFlexItem grow={false}> + <EuiTitle size="xs"> + <h3>{SUMMARY_LABEL}</h3> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem> + <EuiText color="subdued" size="s"> + {dateLabel} + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup gutterSize="s"> <EuiFlexItem> <AvailabilityPanel from={from} to={to} /> @@ -69,15 +84,15 @@ export const MonitorSummary = () => { <MonitorErrorsCount from={from} to={to} /> </EuiFlexItem> <EuiFlexItem> - <MonitorErrorSparklines /> + <MonitorErrorSparklines from={from} to={to} /> </EuiFlexItem> </EuiFlexGroup> </EuiPanel> <EuiSpacer size="m" /> <EuiFlexGroup gutterSize="m"> <EuiFlexItem> - <EuiPanel hasShadow={false} hasBorder> - <EuiFlexGroup alignItems="center"> + <EuiPanel hasShadow={false} paddingSize="m" hasBorder> + <EuiFlexGroup alignItems="center" gutterSize="m"> <EuiFlexItem grow={false}> <EuiTitle size="xs"> <h3>{DURATION_TREND_LABEL}</h3> @@ -85,7 +100,7 @@ export const MonitorSummary = () => { </EuiFlexItem> <EuiFlexItem> <EuiText color="subdued" size="s"> - {LAST_30_DAYS_LABEL} + {dateLabel} </EuiText> </EuiFlexItem> </EuiFlexGroup> @@ -107,7 +122,9 @@ export const MonitorSummary = () => { </EuiFlexItem> </EuiFlexGroup> <EuiSpacer size="m" /> - <LastTenTestRuns /> + <LoadWhenInView placeholderTitle={LAST_10_TEST_RUNS}> + <TestRunsTable paginable={false} from={from} to={to} /> + </LoadWhenInView> </> ); }; @@ -116,8 +133,12 @@ const MONITOR_DETAILS_LABEL = i18n.translate('xpack.synthetics.detailsPanel.moni defaultMessage: 'Monitor details', }); -const LAST_30DAYS_LABEL = i18n.translate('xpack.synthetics.detailsPanel.last30Days', { - defaultMessage: 'Last 30 days', +const SUMMARY_LABEL = i18n.translate('xpack.synthetics.detailsPanel.summary', { + defaultMessage: 'Summary', +}); + +const TO_DATE_LABEL = i18n.translate('xpack.synthetics.detailsPanel.toDate', { + defaultMessage: 'To date', }); const DURATION_TREND_LABEL = i18n.translate('xpack.synthetics.detailsPanel.durationTrends', { diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx new file mode 100644 index 0000000000000..f49d116f48798 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx @@ -0,0 +1,254 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo, useState } from 'react'; +import { useSelector } from 'react-redux'; +import { i18n } from '@kbn/i18n'; +import { + EuiBasicTable, + EuiBasicTableColumn, + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, + EuiLink, + EuiPanel, + EuiText, + EuiTitle, + useEuiTheme, +} from '@elastic/eui'; +import { Criteria } from '@elastic/eui/src/components/basic_table/basic_table'; +import { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; + +import { ConfigKey, DataStream, Ping } from '../../../../../../common/runtime_types'; +import { + formatTestDuration, + formatTestRunAt, +} from '../../../utils/monitor_test_result/test_time_formats'; +import { useSyntheticsSettingsContext } from '../../../contexts/synthetics_settings_context'; + +import { sortPings } from '../../../utils/monitor_test_result/sort_pings'; +import { selectPingsError } from '../../../state'; +import { parseBadgeStatus, StatusBadge } from '../../common/monitor_test_result/status_badge'; + +import { useKibanaDateFormat } from '../../../../../hooks/use_kibana_date_format'; +import { useSelectedMonitor } from '../hooks/use_selected_monitor'; +import { useMonitorPings } from '../hooks/use_monitor_pings'; +import { JourneyScreenshot } from '../../common/screenshot/journey_screenshot'; + +type SortableField = 'timestamp' | 'monitor.status' | 'monitor.duration.us'; + +interface TestRunsTableProps { + from: string; + to: string; + paginable?: boolean; +} + +export const TestRunsTable = ({ paginable = true, from, to }: TestRunsTableProps) => { + const { basePath } = useSyntheticsSettingsContext(); + const [page, setPage] = useState({ index: 0, size: 10 }); + + const [sortField, setSortField] = useState<SortableField>('timestamp'); + const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('desc'); + const { + pings, + total, + loading: pingsLoading, + } = useMonitorPings({ + from, + to, + pageSize: page.size, + pageIndex: page.index, + }); + const sortedPings = useMemo(() => { + return sortPings(pings, sortField, sortDirection); + }, [pings, sortField, sortDirection]); + + const pingsError = useSelector(selectPingsError); + const { monitor } = useSelectedMonitor(); + + const isBrowserMonitor = monitor?.[ConfigKey.MONITOR_TYPE] === DataStream.BROWSER; + + const sorting: EuiTableSortingType<Ping> = { + sort: { + field: sortField as keyof Ping, + direction: sortDirection as 'asc' | 'desc', + }, + }; + + const handleTableChange = ({ page: newPage, sort }: Criteria<Ping>) => { + if (newPage !== undefined) { + setPage(newPage); + } + if (sort !== undefined) { + setSortField(sort.field as SortableField); + setSortDirection(sort.direction); + } + }; + + const columns: Array<EuiBasicTableColumn<Ping>> = [ + ...((isBrowserMonitor + ? [ + { + align: 'left', + field: 'timestamp', + name: SCREENSHOT_LABEL, + render: (_timestamp: string, item) => ( + <JourneyScreenshot checkGroupId={item.monitor.check_group} /> + ), + }, + ] + : []) as Array<EuiBasicTableColumn<Ping>>), + { + align: 'left', + valign: 'middle', + field: 'timestamp', + name: '@timestamp', + sortable: true, + render: (timestamp: string, ping: Ping) => ( + <TestDetailsLink isBrowserMonitor={isBrowserMonitor} timestamp={timestamp} ping={ping} /> + ), + }, + { + align: 'left', + valign: 'middle', + field: 'monitor.status', + name: RESULT_LABEL, + sortable: true, + render: (status: string) => <StatusBadge status={parseBadgeStatus(status ?? 'skipped')} />, + }, + { + align: 'left', + field: 'error.message', + name: MESSAGE_LABEL, + textOnly: true, + render: (errorMessage: string) => ( + <EuiText size="s">{errorMessage?.length > 0 ? errorMessage : '-'}</EuiText> + ), + }, + { + align: 'right', + valign: 'middle', + field: 'monitor.duration.us', + name: DURATION_LABEL, + sortable: true, + render: (durationUs: number) => <EuiText size="s">{formatTestDuration(durationUs)}</EuiText>, + }, + ]; + + const historyIdParam = + monitor?.[ConfigKey.CUSTOM_HEARTBEAT_ID] ?? monitor?.[ConfigKey.MONITOR_QUERY_ID]; + return ( + <EuiPanel hasShadow={false} hasBorder css={{ minHeight: 200 }}> + <EuiFlexGroup alignItems="center" gutterSize="s"> + <EuiFlexItem grow={false}> + <EuiTitle size="xs"> + <h3>{paginable || pings?.length < 10 ? TEST_RUNS : LAST_10_TEST_RUNS}</h3> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem grow={true} /> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + size="xs" + iconType="list" + iconSide="left" + data-test-subj="monitorSummaryViewLastTestRun" + disabled={!historyIdParam} + href={`${basePath}/app/uptime/monitor/${btoa(historyIdParam ?? '')}`} + > + {i18n.translate('xpack.synthetics.monitorDetails.summary.viewHistory', { + defaultMessage: 'View History', + })} + </EuiButtonEmpty> + </EuiFlexItem> + </EuiFlexGroup> + <EuiBasicTable + compressed={false} + loading={pingsLoading} + columns={columns} + error={pingsError?.body?.message} + items={sortedPings} + noItemsMessage={ + pingsLoading + ? i18n.translate('xpack.synthetics.monitorDetails.loadingTestRuns', { + defaultMessage: 'Loading test runs...', + }) + : i18n.translate('xpack.synthetics.monitorDetails.noDataFound', { + defaultMessage: 'No data found', + }) + } + tableLayout={'auto'} + sorting={sorting} + onChange={handleTableChange} + pagination={ + paginable + ? { + pageIndex: page.index, + pageSize: page.size, + totalItemCount: total, + pageSizeOptions: [10, 20, 50], // TODO Confirm with Henry, + } + : undefined + } + /> + </EuiPanel> + ); +}; + +const TestDetailsLink = ({ + isBrowserMonitor, + timestamp, + ping, +}: { + isBrowserMonitor: boolean; + timestamp: string; + ping: Ping; +}) => { + const { euiTheme } = useEuiTheme(); + const { basePath } = useSyntheticsSettingsContext(); + + const format = useKibanaDateFormat(); + const timestampText = ( + <EuiText size="s" css={{ fontWeight: euiTheme.font.weight.medium }}> + {formatTestRunAt(timestamp, format)} + </EuiText> + ); + + return isBrowserMonitor ? ( + <EuiLink href={`${basePath}/app/uptime/journey/${ping?.monitor?.check_group ?? ''}/steps`}> + {timestampText} + </EuiLink> + ) : ( + timestampText + ); +}; + +const TEST_RUNS = i18n.translate('xpack.synthetics.monitorDetails.summary.testRuns', { + defaultMessage: 'Test Runs', +}); + +export const LAST_10_TEST_RUNS = i18n.translate( + 'xpack.synthetics.monitorDetails.summary.lastTenTestRuns', + { + defaultMessage: 'Last 10 Test Runs', + } +); + +const SCREENSHOT_LABEL = i18n.translate('xpack.synthetics.monitorDetails.summary.screenshot', { + defaultMessage: 'Screenshot', +}); + +const RESULT_LABEL = i18n.translate('xpack.synthetics.monitorDetails.summary.result', { + defaultMessage: 'Result', +}); + +const MESSAGE_LABEL = i18n.translate('xpack.synthetics.monitorDetails.summary.message', { + defaultMessage: 'Message', +}); + +const DURATION_LABEL = i18n.translate('xpack.synthetics.monitorDetails.summary.duration', { + defaultMessage: 'Duration', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx index 755777bad04ea..bf93da5a6adea 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx @@ -7,13 +7,14 @@ import { i18n } from '@kbn/i18n'; import React, { useState } from 'react'; import { Chart, Settings, Metric, MetricTrendShape } from '@elastic/charts'; -import { EuiPanel, EuiLoadingChart } from '@elastic/eui'; +import { EuiPanel } from '@elastic/eui'; import { DARK_THEME } from '@elastic/charts'; import { useTheme } from '@kbn/observability-plugin/public'; import { useLocationName, useStatusByLocation } from '../../../../hooks'; import { formatDuration } from '../../../../utils/formatting'; import { MonitorOverviewItem, Ping } from '../../../../../../../common/runtime_types'; import { ActionsPopover } from './actions_popover'; +import { OverviewGridItemLoader } from './overview_grid_item_loader'; export const getColor = (theme: ReturnType<typeof useTheme>, isEnabled: boolean, ping?: Ping) => { if (!isEnabled) { @@ -101,7 +102,7 @@ export const MetricItem = ({ )} </EuiPanel> ) : ( - <EuiLoadingChart mono /> + <OverviewGridItemLoader /> )} </div> ); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.test.tsx index 0e566856364bc..9514bba4258ed 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.test.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.test.tsx @@ -48,22 +48,64 @@ describe('Overview Grid', () => { return hits; }; + const perPage = 20; + it('renders correctly', async () => { jest .spyOn(hooks, 'useLast50DurationChart') .mockReturnValue({ data: getMockChart(), averageDuration: 30000, loading: false }); - const { getByText, getAllByTestId } = render(<OverviewGrid />, { + const { getByText, getAllByTestId, queryByText } = render(<OverviewGrid />, { state: { overview: { pageState: { - perPage: 20, + perPage, }, data: { - pages: { - 0: getMockData().slice(0, 20), - 1: getMockData().slice(20, 40), + monitors: getMockData(), + allMonitorIds: [], // not critical for this test + total: getMockData().length, + }, + loaded: true, + loading: false, + }, + serviceLocations: { + locations: [ + { + id: 'us_central', + label: 'Us Central', + }, + { + id: 'us_east', + label: 'US East', }, + ], + locationsLoaded: true, + loading: false, + }, + }, + }); + + expect(getByText('Showing')).toBeInTheDocument(); + expect(getByText('40')).toBeInTheDocument(); + expect(getByText('Monitors')).toBeInTheDocument(); + expect(queryByText('Showing all monitors')).not.toBeInTheDocument(); + expect(getAllByTestId('syntheticsOverviewGridItem').length).toEqual(perPage); + }); + + it('displays showing all monitors label when reaching the end of the list', async () => { + jest + .spyOn(hooks, 'useLast50DurationChart') + .mockReturnValue({ data: getMockChart(), averageDuration: 30000, loading: false }); + + const { getByText } = render(<OverviewGrid />, { + state: { + overview: { + pageState: { + perPage, + }, + data: { + monitors: getMockData().slice(0, 16), allMonitorIds: [], // not critical for this test total: getMockData().length, }, @@ -87,9 +129,6 @@ describe('Overview Grid', () => { }, }); - expect(getByText(/1-20/)).toBeInTheDocument(); - expect(getByText(/of 40/)).toBeInTheDocument(); - expect(getByText('Rows per page: 20')).toBeInTheDocument(); - expect(getAllByTestId('syntheticsOverviewGridItem').length).toEqual(20); + expect(getByText('Showing all monitors')).toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx index 359f292079fdb..cf3163052bd73 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx @@ -4,40 +4,77 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useState } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; +import React, { useEffect, useState, useRef } from 'react'; import { i18n } from '@kbn/i18n'; +import useThrottle from 'react-use/lib/useThrottle'; +import { useSelector } from 'react-redux'; +import useIntersection from 'react-use/lib/useIntersection'; import { + EuiFlexGroup, EuiFlexItem, EuiFlexGrid, EuiSpacer, - EuiTablePagination, - EuiFlexGroup, + EuiButtonEmpty, + EuiText, } from '@elastic/eui'; -import { selectOverviewState, setOverviewPerPageAction } from '../../../../state/overview'; +import { selectOverviewState } from '../../../../state/overview'; +import { MonitorOverviewItem } from '../../../../../../../common/runtime_types'; import { OverviewPaginationInfo } from './overview_pagination_info'; import { OverviewGridItem } from './overview_grid_item'; +import { SortFields } from './sort_fields'; +import { useMonitorsSortedByStatus } from '../../../../hooks/use_monitors_sorted_by_status'; +import { OverviewLoader } from './overview_loader'; import { OverviewStatus } from './overview_status'; export const OverviewGrid = () => { const { - data: { pages }, + data: { monitors }, loaded, - pageState: { perPage }, + pageState, } = useSelector(selectOverviewState); - const dispatch = useDispatch(); - const [page, setPage] = useState(0); - const currentMonitors = pages[page] || []; + const { perPage, sortField } = pageState; + const [loadNextPage, setLoadNextPage] = useState(false); + const [page, setPage] = useState(1); + + const { monitorsSortedByStatus } = useMonitorsSortedByStatus( + sortField === 'status' && monitors.length !== 0 + ); + const currentMonitors = getCurrentMonitors({ + monitors, + monitorsSortedByStatus, + perPage, + page, + sortField, + }); + + const intersectionRef = useRef(null); + const intersection = useIntersection(intersectionRef, { + root: null, + rootMargin: '640px', // Height of 4 rows of monitors, minus the gutters + threshold: 0.1, + }); + const hasIntersected = intersection && intersection.intersectionRatio > 0; - const goToPage = (pageNumber: number) => { - setPage(pageNumber); - }; + useThrottle(() => { + if ( + hasIntersected && + currentMonitors.length === page * perPage && + currentMonitors.length !== monitors.length + ) { + setLoadNextPage(true); + } else { + setLoadNextPage(false); + } + }, 1000); - const changeItemsPerPage = (itemsPerPage: number) => { - dispatch(setOverviewPerPageAction(itemsPerPage)); - }; + useEffect(() => { + if (loadNextPage) { + setPage((p) => p + 1); + setLoadNextPage(false); + } + }, [loadNextPage]); - return loaded ? ( + return ( <> <EuiFlexGroup gutterSize="none"> <EuiFlexItem grow={false}> @@ -45,29 +82,82 @@ export const OverviewGrid = () => { </EuiFlexItem> </EuiFlexGroup> <EuiSpacer /> - <OverviewPaginationInfo page={page} /> + <EuiFlexGroup justifyContent="spaceBetween" alignItems="center"> + <EuiFlexItem grow={false}> + <OverviewPaginationInfo page={page} loading={!loaded} /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <SortFields onSortChange={() => setPage(1)} /> + </EuiFlexItem> + </EuiFlexGroup> <EuiSpacer /> - <EuiFlexGrid columns={4}> - {currentMonitors.map((monitor) => ( - <EuiFlexItem - key={`${monitor.id}-${monitor.location?.id}`} - data-test-subj="syntheticsOverviewGridItem" - > - <OverviewGridItem monitor={monitor} /> + {loaded && currentMonitors.length ? ( + <EuiFlexGrid columns={4} data-test-subj="syntheticsOverviewGridItemContainer"> + {currentMonitors.map((monitor) => ( + <EuiFlexItem + key={`${monitor.id}-${monitor.location?.id}`} + data-test-subj="syntheticsOverviewGridItem" + > + <OverviewGridItem monitor={monitor} /> + </EuiFlexItem> + ))} + </EuiFlexGrid> + ) : ( + <OverviewLoader /> + )} + <span ref={intersectionRef}> + <EuiSpacer size="l" /> + </span> + <EuiFlexGroup justifyContent="spaceBetween" alignItems="center"> + {currentMonitors.length === monitors.length && ( + <EuiFlexItem grow={false}> + <EuiText size="xs">{SHOWING_ALL_MONITORS_LABEL}</EuiText> + </EuiFlexItem> + )} + {currentMonitors.length === monitors.length && currentMonitors.length > perPage && ( + <EuiFlexItem grow={false}> + <EuiButtonEmpty + onClick={() => window.scrollTo(0, 0)} + iconType="sortUp" + iconSide="right" + size="xs" + > + {SCROLL_TO_TOP_LABEL} + </EuiButtonEmpty> </EuiFlexItem> - ))} - </EuiFlexGrid> - <EuiTablePagination - aria-label={i18n.translate('xpack.synthetics.overview.pagination.ariaLabel', { - defaultMessage: 'Pagination for monitor overview', - })} - pageCount={Object.keys(pages).length} - activePage={page} - onChangePage={goToPage} - itemsPerPage={perPage} - onChangeItemsPerPage={changeItemsPerPage} - itemsPerPageOptions={[10, 20, 40]} - /> + )} + </EuiFlexGroup> </> - ) : null; + ); }; + +const getCurrentMonitors = ({ + sortField, + perPage, + page, + monitors, + monitorsSortedByStatus, +}: { + sortField: string; + perPage: number; + page: number; + monitors: MonitorOverviewItem[]; + monitorsSortedByStatus: MonitorOverviewItem[]; +}) => { + if (sortField === 'status') { + return monitorsSortedByStatus.slice(0, perPage * page); + } else { + return monitors.slice(0, perPage * page); + } +}; + +const SHOWING_ALL_MONITORS_LABEL = i18n.translate( + 'xpack.synthetics.overview.grid.showingAllMonitors.label', + { + defaultMessage: 'Showing all monitors', + } +); + +const SCROLL_TO_TOP_LABEL = i18n.translate('xpack.synthetics.overview.grid.scrollToTop.label', { + defaultMessage: 'Back to top', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item_loader.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item_loader.tsx new file mode 100644 index 0000000000000..71a369ad44db5 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item_loader.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 { EuiPanel, EuiLoadingContent } from '@elastic/eui'; + +export const OverviewGridItemLoader = () => { + return ( + <EuiPanel + style={{ + height: '160px', + }} + hasBorder={true} + > + <EuiLoadingContent lines={2} /> + </EuiPanel> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_loader.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_loader.tsx new file mode 100644 index 0000000000000..92cb67187b5bb --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_loader.tsx @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFlexGrid, EuiFlexItem } from '@elastic/eui'; +import { OverviewGridItemLoader } from './overview_grid_item_loader'; + +export const OverviewLoader = () => { + const ROWS = 4; + const COLUMNS = 4; + const loaders = Array(ROWS * COLUMNS).fill(null); + return ( + <> + <EuiFlexGrid columns={COLUMNS}> + {loaders.map((_, i) => ( + <EuiFlexItem key={i}> + <OverviewGridItemLoader /> + </EuiFlexItem> + ))} + </EuiFlexGrid> + </> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx index a00f9f9d1692e..d684e4aa41e88 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx @@ -5,42 +5,88 @@ * 2.0. */ import React from 'react'; -import { EuiText } from '@elastic/eui'; +import { EuiText, EuiLoadingSpinner, EuiI18nNumber, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { useSelector } from 'react-redux'; import { FormattedMessage } from '@kbn/i18n-react'; import { selectOverviewState } from '../../../../state/overview'; -export const OverviewPaginationInfo = ({ page }: { page: number }) => { +export const OverviewPaginationInfo = ({ + page, + loading, + startRange, + endRange, +}: { + page: number; + loading: boolean; + startRange?: number; + endRange?: number; +}) => { const { - data: { total, pages }, + data: { total, monitors }, loaded, - pageState: { perPage }, } = useSelector(selectOverviewState); - const startRange = (page + 1) * perPage - perPage + 1; - const endRange = startRange + (pages[`${page}`]?.length || 0) - 1; - if (loaded && !Object.keys(pages).length) { + if (loaded && !monitors.length) { return null; } return loaded ? ( <EuiText size="xs"> - <FormattedMessage - id="xpack.synthetics.overview.pagination.description" - defaultMessage="Showing {currentCount} of {total} {monitors}" - values={{ - currentCount: <strong>{`${startRange}-${endRange}`}</strong>, - total, - monitors: ( - <strong> - <FormattedMessage - id="xpack.synthetics.overview.monitors.label" - defaultMessage="Monitors" - /> - </strong> - ), - }} - /> + {startRange && endRange ? ( + <FormattedMessage + id="xpack.synthetics.overview.pagination.description" + defaultMessage="Showing {currentCount} of {total} {monitors}" + values={{ + currentCount: <strong>{`${startRange}-${endRange}`}</strong>, + total, + monitors: ( + <strong> + <FormattedMessage + id="xpack.synthetics.overview.monitors.label" + defaultMessage="Monitors" + /> + </strong> + ), + }} + /> + ) : ( + <FormattedMessage + id="xpack.synthetics.management.monitorList.recordTotal" + defaultMessage="Showing {total} {monitorsLabel}" + values={{ + total: ( + <strong> + <EuiI18nNumber value={total} /> + </strong> + ), + monitorsLabel: ( + <strong> + <FormattedMessage + id="xpack.synthetics.management.monitorList.recordRangeLabel" + defaultMessage="{monitorCount, plural, one {Monitor} other {Monitors}}" + values={{ + monitorCount: total, + }} + /> + </strong> + ), + }} + /> + )} </EuiText> - ) : null; + ) : ( + <EuiText size="xs"> + <EuiFlexGroup alignItems="center" gutterSize="s"> + <EuiFlexItem grow={false}> + <EuiLoadingSpinner size="m" /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <FormattedMessage + id="xpack.synthetics.overview.pagination.loading" + defaultMessage="Loading Monitors..." + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiText> + ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_fields.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_fields.tsx new file mode 100644 index 0000000000000..5bd3dfd44dd33 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_fields.tsx @@ -0,0 +1,211 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { PayloadAction } from '@reduxjs/toolkit'; +import { useDispatch, useSelector } from 'react-redux'; +import { i18n } from '@kbn/i18n'; +import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; +import { ConfigKey } from '../../../../../../../common/runtime_types'; + +import { selectOverviewState, setOverviewPageStateAction } from '../../../../state/overview'; +import { SortMenu } from './sort_menu'; + +export const SortFields = ({ onSortChange }: { onSortChange?: () => void }) => { + const { + pageState: { sortOrder, sortField }, + } = useSelector(selectOverviewState); + const dispatch = useDispatch(); + const { asc, desc, label } = getOrderContent(sortField); + const handleSortChange = (payloadAction: PayloadAction<unknown>) => { + if (onSortChange) { + onSortChange(); + } + dispatch(payloadAction); + }; + + const orderByOptions = [ + { + label: asc, + value: 'asc', + checked: sortOrder === 'asc', + onClick: () => { + handleSortChange( + setOverviewPageStateAction({ + sortOrder: 'asc', + }) + ); + }, + }, + { + label: desc, + value: 'desc', + checked: sortOrder === 'desc', + onClick: () => { + handleSortChange( + setOverviewPageStateAction({ + sortOrder: 'desc', + }) + ); + }, + }, + ]; + const sortByOptions = [ + { + label: STATUS_LABEL, + value: 'status', + checked: sortField === 'status', + defaultSortOrder: 'asc', + onClick: () => { + handleSortChange( + setOverviewPageStateAction({ + sortField: 'status', + sortOrder: 'asc', + }) + ); + }, + }, + { + label: ALPHABETICAL_LABEL, + value: `${ConfigKey.NAME}.keyword`, + checked: sortField === `${ConfigKey.NAME}.keyword`, + defaultSortOrder: 'asc', + onClick: () => { + handleSortChange( + setOverviewPageStateAction({ + sortField: `${ConfigKey.NAME}.keyword`, + sortOrder: 'asc', + }) + ); + }, + }, + { + label: LAST_MODIFIED_LABEL, + value: 'updated_at', + checked: sortField === 'updated_at', + defaultSortOrder: 'desc', + onClick: () => { + handleSortChange( + setOverviewPageStateAction({ + sortField: 'updated_at', + sortOrder: 'desc', + }) + ); + }, + }, + ]; + + return ( + <EuiFlexGroup gutterSize="s" alignItems="center"> + <EuiFlexItem grow={false}> + <EuiFlexGroup responsive={false} gutterSize="none" alignItems="center"> + <EuiFlexItem grow={false}> + <EuiTitle size="xxxs"> + <span>{SORT_TITLE}</span> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem grow={false} data-test-subj="syntheticsOverviewSortButton"> + <SortMenu sortOptions={sortByOptions} orderOptions={orderByOptions} sortField={label} /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + ); +}; + +const getOrderContent = (sortField: string) => { + switch (sortField) { + case `${ConfigKey.NAME}.keyword`: + return { + asc: SORT_ALPHABETICAL_ASC, + desc: SORT_ALPHABETICAL_DESC, + label: ALPHABETICAL_LABEL, + }; + case 'updated_at': + return { + asc: SORT_UPDATED_ASC, + desc: SORT_UPDATED_DESC, + label: LAST_MODIFIED_LABEL, + }; + case 'status': + return { + asc: SORT_STATUS_ASC, + desc: SORT_STATUS_DESC, + label: STATUS_LABEL, + }; + default: + return { + asc: ASCENDING_LABEL, + desc: DESCENDING_LABEL, + label: '', + }; + } +}; + +const SORT_TITLE = i18n.translate('xpack.synthetics.overview.sortPopover.sort.title', { + defaultMessage: 'Sort', +}); + +const SORT_ALPHABETICAL_ASC = i18n.translate( + 'xpack.synthetics.overview.sortPopover.alphabetical.asc', + { + defaultMessage: 'A -> Z', + description: 'Describes ascending alphabetical sort order', + } +); + +const SORT_ALPHABETICAL_DESC = i18n.translate( + 'xpack.synthetics.overview.sortPopover.alphabetical.desc', + { + defaultMessage: 'Z -> A', + description: 'Describes descending alphabetical sort order', + } +); + +const SORT_UPDATED_ASC = i18n.translate('xpack.synthetics.overview.sortPopover.lastModified.asc', { + defaultMessage: 'Oldest first', +}); + +const SORT_UPDATED_DESC = i18n.translate( + 'xpack.synthetics.overview.sortPopover.lastModified.desc', + { + defaultMessage: 'Newest first', + } +); + +const SORT_STATUS_ASC = i18n.translate('xpack.synthetics.overview.sortPopover.status.asc', { + defaultMessage: 'Down first', +}); + +const SORT_STATUS_DESC = i18n.translate('xpack.synthetics.overview.sortPopover.status.desc', { + defaultMessage: 'Up first', +}); + +const ASCENDING_LABEL = i18n.translate('xpack.synthetics.overview.sortPopover.ascending.label', { + defaultMessage: 'Ascending', +}); + +const DESCENDING_LABEL = i18n.translate('xpack.synthetics.overview.sortPopover.descending.label', { + defaultMessage: 'Descending', +}); + +const STATUS_LABEL = i18n.translate('xpack.synthetics.overview.sortPopover.status.label', { + defaultMessage: 'Status', +}); + +const ALPHABETICAL_LABEL = i18n.translate( + 'xpack.synthetics.overview.sortPopover.alphabetical.label', + { + defaultMessage: 'Alphabetical', + } +); + +const LAST_MODIFIED_LABEL = i18n.translate( + 'xpack.synthetics.overview.sortPopover.lastModified.label', + { + defaultMessage: 'Last modified', + } +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_menu.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_menu.tsx new file mode 100644 index 0000000000000..c512fcb0bf388 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_menu.tsx @@ -0,0 +1,126 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState } from 'react'; +import { i18n } from '@kbn/i18n'; +import { + EuiButtonEmpty, + EuiContextMenuPanel, + EuiContextMenuItem, + EuiPopover, + useGeneratedHtmlId, + EuiText, + EuiPanel, + EuiHorizontalRule, +} from '@elastic/eui'; + +interface Option { + label: string; + value: string; + checked: boolean; + defaultSortOrder?: string; + onClick: () => void; +} + +interface Props { + sortOptions: Option[]; + orderOptions: Option[]; + sortField: string; +} + +export const SortMenu = ({ sortOptions, orderOptions, sortField }: Props) => { + const [isPopoverOpen, setPopover] = useState(false); + + const singleContextMenuPopoverId = useGeneratedHtmlId({ + prefix: 'singleContextMenuPopover', + }); + + const onButtonClick = () => { + setPopover(!isPopoverOpen); + }; + + const closePopover = () => { + setPopover(false); + }; + + const button = ( + <EuiButtonEmpty size="xs" iconType="arrowDown" iconSide="right" onClick={onButtonClick}> + {sortField} + </EuiButtonEmpty> + ); + + const items = [ + <EuiPanel paddingSize="s" hasShadow={false}> + <EuiText size="xs"> + <h4>{SORT_BY_TITLE}</h4> + </EuiText> + </EuiPanel>, + ...sortOptions.map((option) => ( + <ContextMenuItem option={option} onClosePopover={closePopover} /> + )), + <EuiHorizontalRule key="hr" margin="none" />, + + <EuiPanel paddingSize="s" hasShadow={false}> + <EuiText size="xs"> + <h4>{ORDER_BY_TITLE}</h4> + </EuiText> + </EuiPanel>, + + ...orderOptions.map((option) => ( + <ContextMenuItem option={option} onClosePopover={closePopover} /> + )), + ]; + + return ( + <EuiPopover + id={singleContextMenuPopoverId} + button={button} + isOpen={isPopoverOpen} + closePopover={closePopover} + panelPaddingSize="none" + anchorPosition="downLeft" + > + <EuiContextMenuPanel size="s" items={items} /> + </EuiPopover> + ); +}; + +const ContextMenuItem = ({ + option, + onClosePopover, +}: { + option: Option; + onClosePopover: () => void; +}) => { + const getIconType = (checked: boolean) => { + return checked ? 'check' : 'empty'; + }; + + return ( + <EuiContextMenuItem + key={option.value} + icon={getIconType(option.checked)} + onClick={() => { + onClosePopover(); + option.onClick(); + }} + style={{ + marginRight: 24, + }} + > + {option.label} + </EuiContextMenuItem> + ); +}; + +const SORT_BY_TITLE = i18n.translate('xpack.synthetics.overview.sortPopover.sortBy.title', { + defaultMessage: 'Sort by', +}); + +const ORDER_BY_TITLE = i18n.translate('xpack.synthetics.overview.sortPopover.orderBy.title', { + defaultMessage: 'Order', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx index 4eb864e7a2a3c..7b15883b79f3e 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx @@ -7,13 +7,13 @@ import React, { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { EuiLoadingElastic, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { useTrackPageview } from '@kbn/observability-plugin/public'; import { Redirect } from 'react-router-dom'; import { useEnablement } from '../../../hooks'; import { useSyntheticsRefreshContext } from '../../../contexts/synthetics_refresh_context'; import { fetchMonitorOverviewAction, + quietFetchOverviewAction, selectOverviewState, selectServiceLocationsState, } from '../../../state'; @@ -32,9 +32,9 @@ export const OverviewPage: React.FC = () => { const dispatch = useDispatch(); - const { refreshApp } = useSyntheticsRefreshContext(); + const { refreshApp, lastRefresh } = useSyntheticsRefreshContext(); - const { loading, pageState } = useSelector(selectOverviewState); + const { pageState } = useSelector(selectOverviewState); const { loading: locationsLoading, locationsLoaded } = useSelector(selectServiceLocationsState); useEffect(() => { @@ -48,12 +48,16 @@ export const OverviewPage: React.FC = () => { if (!locationsLoading && !locationsLoaded) { dispatch(getServiceLocations()); } - }, [dispatch, locationsLoaded, locationsLoading, pageState]); + }, [dispatch, locationsLoaded, locationsLoading]); useEffect(() => { dispatch(fetchMonitorOverviewAction.get(pageState)); }, [dispatch, pageState]); + useEffect(() => { + dispatch(quietFetchOverviewAction.get(pageState)); + }, [dispatch, pageState, lastRefresh]); + const { enablement: { isEnabled }, loading: enablementLoading, @@ -69,14 +73,5 @@ export const OverviewPage: React.FC = () => { return <Redirect to={MONITORS_ROUTE} />; } - return !loading ? ( - <OverviewGrid /> - ) : ( - <EuiFlexGroup alignItems="center" justifyContent="center"> - <EuiSpacer size="xxl" /> - <EuiFlexItem grow={false}> - <EuiLoadingElastic size="xxl" /> - </EuiFlexItem> - </EuiFlexGroup> - ); + return <OverviewGrid />; }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/color_palette.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/color_palette.tsx new file mode 100644 index 0000000000000..be6bc97a1fcae --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/color_palette.tsx @@ -0,0 +1,108 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { EuiFlexGroup, EuiFlexItem, EuiText, EuiLoadingContent } from '@elastic/eui'; +import { useTheme } from '@kbn/observability-plugin/public'; +import styled from 'styled-components'; +import { colourPalette } from './network_waterfall/step_detail/waterfall/data_formatting'; + +export const ColorPalette = ({ + label, + mimeType, + percent, + value, + loading, + labelWidth = 40, + valueWidth = 60, +}: { + label: string; + mimeType: string; + percent: number; + value: string; + loading: boolean; + labelWidth?: number; + valueWidth?: number; +}) => { + return ( + <EuiFlexGroup gutterSize="s"> + <EuiFlexItem grow={false} style={{ width: labelWidth }}> + <EuiText size="s">{label}</EuiText> + </EuiFlexItem> + <EuiFlexItem grow={true}> + <ColorPaletteFlexItem + mimeType={mimeType} + percent={isNaN(percent) ? 0 : percent} + loading={loading} + /> + </EuiFlexItem> + <EuiFlexItem grow={false} style={{ width: valueWidth, justifySelf: 'flex-end' }}> + <EuiText + size="s" + style={{ fontWeight: 'bold', whiteSpace: 'nowrap' }} + className="eui-textRight" + > + {value} + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> + ); +}; + +export const ColorPaletteFlexItem = ({ + mimeType, + percent, + loading, +}: { + mimeType: string; + percent: number; + loading: boolean; +}) => { + const { eui } = useTheme(); + + const [value, setVal] = useState(0); + + useEffect(() => { + setTimeout(() => { + if (value < percent) { + setVal(value + 1); + } + }, 10); + }, [percent, value]); + + if (loading) { + return <LoadingLine lines={1} />; + } + + return ( + <EuiFlexGroup + gutterSize="none" + style={{ + borderRadius: 8, + overflow: 'hidden', + }} + > + <EuiFlexItem grow={true} style={{ backgroundColor: eui.euiColorLightShade }}> + <span + style={{ + backgroundColor: (colourPalette as Record<string, string>)[mimeType], + height: 20, + width: `${value}%`, + }} + /> + </EuiFlexItem> + </EuiFlexGroup> + ); +}; + +const LoadingLine = styled(EuiLoadingContent)` + &&& { + > span { + height: 20px; + } + } +`; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_timings_donut.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_timings_donut.tsx new file mode 100644 index 0000000000000..62e5219c68105 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_timings_donut.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 { + Chart, + Partition, + Settings, + PartitionLayout, + Datum, + LIGHT_THEME, + PartialTheme, +} from '@elastic/charts'; +import React from 'react'; +import { useTheme } from '@kbn/observability-plugin/public'; + +import { EuiLoadingSpinner, EuiSpacer, EuiTitle } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { useNetworkTimings } from '../hooks/use_network_timings'; + +const themeOverrides: PartialTheme = { + chartMargins: { top: 0, bottom: 0, left: 0, right: 0 }, + partition: { + linkLabel: { + maximumSection: Infinity, + maxCount: 0, + }, + idealFontSizeJump: 1.1, + outerSizeRatio: 0.9, + emptySizeRatio: 0.6, + circlePadding: 5, + }, +}; + +export const NetworkTimingsDonut = () => { + const networkTimings = useNetworkTimings(); + + const theme = useTheme(); + + if (!networkTimings) { + return <EuiLoadingSpinner size="xl" />; + } + + return ( + <> + <EuiTitle size="xs"> + <h3>{TIMINGS_BREAKDOWN}</h3> + </EuiTitle> + <EuiSpacer size="m" /> + <Chart size={{ height: 180 }}> + <Settings theme={[themeOverrides, LIGHT_THEME ?? {}]} showLegend={false} /> + <Partition + id="spec_1" + data={networkTimings.timingsWithLabels} + layout={PartitionLayout.sunburst} + valueAccessor={(d: Datum) => d?.value} + valueFormatter={(d: number) => formatMillisecond(d)} + layers={[ + { + groupByRollup: (d: Datum) => d.label, + nodeLabel: (d: Datum) => d, + shape: { + fillColor: (d: Datum, index: number) => { + return (theme.eui as unknown as Record<string, string>)[ + `euiColorVis${index + 1}` + ]; + }, + }, + }, + ]} + /> + </Chart> + </> + ); +}; + +const TIMINGS_BREAKDOWN = i18n.translate('xpack.synthetics.stepDetailsRoute.timingsBreakdown', { + defaultMessage: 'Timings breakdown', +}); + +export const formatMillisecond = (ms: number) => { + if (ms < 1000) { + return `${ms.toFixed(0)} ms`; + } + return `${(ms / 1000).toFixed(1)} s`; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_detail_container.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_detail_container.tsx new file mode 100644 index 0000000000000..3035bebf95879 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_detail_container.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 { EuiFlexGroup, EuiFlexItem, EuiText, EuiLoadingSpinner } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { useStepDetailPage } from '../../../hooks/use_step_detail_page'; +import { useMonitorBreadcrumb } from './use_monitor_breadcrumb'; +import { WaterfallChartContainer } from './waterfall/waterfall_chart_container'; + +export const NO_STEP_DATA = i18n.translate('xpack.synthetics.synthetics.stepDetail.noData', { + defaultMessage: 'No data could be found for this step', +}); + +interface Props { + checkGroup: string; + stepIndex: number; +} + +export const StepDetailContainer: React.FC<Props> = ({ checkGroup, stepIndex }) => { + const { activeStep, journey } = useStepDetailPage(); + + useMonitorBreadcrumb({ details: journey?.details, activeStep, performanceBreakDownView: true }); + + return ( + <> + {!journey && ( + <EuiFlexGroup justifyContent="center"> + <EuiFlexItem grow={false}> + <EuiLoadingSpinner size="xl" /> + </EuiFlexItem> + </EuiFlexGroup> + )} + {journey && !activeStep && ( + <EuiFlexGroup justifyContent="center"> + <EuiFlexItem> + <EuiText textAlign="center"> + <p>{NO_STEP_DATA}</p> + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> + )} + {journey && activeStep && ( + <WaterfallChartContainer + checkGroup={checkGroup} + stepIndex={Number(stepIndex)} + activeStep={activeStep} + /> + )} + </> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_nav.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_nav.tsx new file mode 100644 index 0000000000000..bddad0132def2 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_nav.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 React from 'react'; +import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import moment from 'moment'; +import { i18n } from '@kbn/i18n'; + +export const PREVIOUS_CHECK_BUTTON_TEXT = i18n.translate( + 'xpack.synthetics.synthetics.stepDetail.previousCheckButtonText', + { + defaultMessage: 'Previous check', + } +); + +export const NEXT_CHECK_BUTTON_TEXT = i18n.translate( + 'xpack.synthetics.synthetics.stepDetail.nextCheckButtonText', + { + defaultMessage: 'Next check', + } +); + +interface Props { + previousCheckGroup?: string; + dateFormat: string; + checkTimestamp?: string; + nextCheckGroup?: string; + handlePreviousRun: () => void; + handleNextRun: () => void; +} +export const StepPageNavigation = ({ + previousCheckGroup, + dateFormat, + handleNextRun, + handlePreviousRun, + checkTimestamp, + nextCheckGroup, +}: Props) => { + return ( + <EuiFlexGroup alignItems="center" justifyContent="flexEnd" responsive={false}> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + onClick={handlePreviousRun} + disabled={!previousCheckGroup} + iconType="arrowLeft" + aria-label={PREVIOUS_CHECK_BUTTON_TEXT} + > + {PREVIOUS_CHECK_BUTTON_TEXT} + </EuiButtonEmpty> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText size="s">{moment(checkTimestamp).format(dateFormat)}</EuiText> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + onClick={handleNextRun} + disabled={!nextCheckGroup} + iconType="arrowRight" + iconSide="right" + aria-label={NEXT_CHECK_BUTTON_TEXT} + > + {NEXT_CHECK_BUTTON_TEXT} + </EuiButtonEmpty> + </EuiFlexItem> + </EuiFlexGroup> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_title.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_title.tsx new file mode 100644 index 0000000000000..2e90fc3299ba1 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_title.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 { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +interface Props { + stepName: string; + stepIndex: number; + totalSteps: number; + hasPreviousStep: boolean; + hasNextStep: boolean; + handlePreviousStep: () => void; + handleNextStep: () => void; +} + +export const StepPageTitleContent = ({ + stepIndex, + totalSteps, + handleNextStep, + handlePreviousStep, + hasNextStep, + hasPreviousStep, +}: Props) => { + return ( + <EuiFlexGroup alignItems="center" responsive={false}> + <EuiFlexItem> + <EuiFlexGroup alignItems="center" responsive={false}> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + onClick={handlePreviousStep} + disabled={!hasPreviousStep} + iconType="arrowLeft" + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText size="s"> + <FormattedMessage + id="xpack.synthetics.synthetics.stepDetail.totalSteps" + defaultMessage="Step {stepIndex} of {totalSteps}" + values={{ + stepIndex, + totalSteps, + }} + /> + </EuiText> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + onClick={handleNextStep} + disabled={!hasNextStep} + iconType="arrowRight" + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumb.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumb.tsx new file mode 100644 index 0000000000000..e30039280b307 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumb.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 moment from 'moment'; +import { i18n } from '@kbn/i18n'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { getShortTimeStamp } from '../../../../../utils/monitor_test_result/timestamp'; +import { PLUGIN } from '../../../../../../../../common/constants/plugin'; +import { useBreadcrumbs } from '../../../../../hooks'; +import { SyntheticsJourneyApiResponse } from '../../../../../../../../common/runtime_types'; + +interface ActiveStep { + monitor: { + id: string; + name?: string; + }; +} + +interface Props { + details: SyntheticsJourneyApiResponse['details']; + activeStep?: ActiveStep; + performanceBreakDownView?: boolean; +} + +export const useMonitorBreadcrumb = ({ + details, + activeStep, + performanceBreakDownView = false, +}: Props) => { + const kibana = useKibana(); + const appPath = kibana.services.application?.getUrlForApp(PLUGIN.ID) ?? ''; + + useBreadcrumbs([ + ...(activeStep?.monitor + ? [ + { + text: activeStep?.monitor?.name || activeStep?.monitor.id, + href: `${appPath}/monitor/${btoa(activeStep?.monitor.id)}`, + }, + ] + : []), + ...(details?.journey?.monitor?.check_group + ? [ + { + text: getShortTimeStamp(moment(details?.timestamp)), + href: `${appPath}/journey/${details.journey.monitor.check_group}/steps`, + }, + ] + : []), + ...(performanceBreakDownView + ? [ + { + text: i18n.translate('xpack.synthetics.synthetics.performanceBreakDown.label', { + defaultMessage: 'Performance breakdown', + }), + }, + ] + : []), + ]); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumbs.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumbs.test.tsx new file mode 100644 index 0000000000000..416b5c3ca10c6 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumbs.test.tsx @@ -0,0 +1,160 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ChromeBreadcrumb } from '@kbn/core/public'; +import React from 'react'; +import { Route } from 'react-router-dom'; +import { of } from 'rxjs'; +import { chromeServiceMock, uiSettingsServiceMock } from '@kbn/core/public/mocks'; +import { useMonitorBreadcrumb } from './use_monitor_breadcrumb'; +import { Ping, SyntheticsJourneyApiResponse } from '../../../../../../../../common/runtime_types'; +import { render } from '../../../../../utils/testing'; +import { OVERVIEW_ROUTE } from '../../../../../../../../common/constants'; + +describe('useMonitorBreadcrumbs', () => { + it('sets the given breadcrumbs for steps list view', () => { + let breadcrumbObj: ChromeBreadcrumb[] = []; + const getBreadcrumbs = () => { + return breadcrumbObj; + }; + + const core = { + chrome: { + ...chromeServiceMock.createStartContract(), + setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => { + breadcrumbObj = newBreadcrumbs; + }, + }, + uiSettings: { + ...uiSettingsServiceMock.createSetupContract(), + get(key: string, defaultOverride?: any): any { + return `MMM D, YYYY @ HH:mm:ss.SSS` || defaultOverride; + }, + get$(key: string, defaultOverride?: any): any { + return of(`MMM D, YYYY @ HH:mm:ss.SSS`) || of(defaultOverride); + }, + }, + }; + + const Component = () => { + useMonitorBreadcrumb({ + activeStep: { monitor: { id: 'test-monitor', check_group: 'fake-test-group' } } as Ping, + details: { + timestamp: '2021-01-04T11:25:19.104Z', + journey: { + monitor: { id: 'test-monitor', check_group: 'fake-test-group' }, + }, + } as SyntheticsJourneyApiResponse['details'], + }); + return <>Step Water Fall</>; + }; + + render( + <Route path={OVERVIEW_ROUTE}> + <Component /> + </Route>, + { core } + ); + + expect(getBreadcrumbs()).toMatchInlineSnapshot(` + Array [ + Object { + "href": "", + "text": "Observability", + }, + Object { + "href": "/app/synthetics", + "onClick": [Function], + "text": "Synthetics", + }, + Object { + "href": "/app/uptime/monitor/dGVzdC1tb25pdG9y", + "onClick": [Function], + "text": "test-monitor", + }, + Object { + "href": "/app/uptime/journey/fake-test-group/steps", + "onClick": [Function], + "text": "Jan 4, 2021 6:25:19 AM", + }, + ] + `); + }); + + it('sets the given breadcrumbs for performance breakdown page', () => { + let breadcrumbObj: ChromeBreadcrumb[] = []; + const getBreadcrumbs = () => { + return breadcrumbObj; + }; + + const core = { + chrome: { + ...chromeServiceMock.createStartContract(), + setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => { + breadcrumbObj = newBreadcrumbs; + }, + }, + uiSettings: { + ...uiSettingsServiceMock.createSetupContract(), + get(key: string, defaultOverride?: any): any { + return `MMM D, YYYY @ HH:mm:ss.SSS` || defaultOverride; + }, + get$(key: string, defaultOverride?: any): any { + return of(`MMM D, YYYY @ HH:mm:ss.SSS`) || of(defaultOverride); + }, + }, + }; + + const Component = () => { + useMonitorBreadcrumb({ + activeStep: { monitor: { id: 'test-monitor', check_group: 'fake-test-group' } } as Ping, + details: { + timestamp: '2021-01-04T11:25:19.104Z', + journey: { + monitor: { id: 'test-monitor', check_group: 'fake-test-group' }, + }, + } as SyntheticsJourneyApiResponse['details'], + performanceBreakDownView: true, + }); + return <>Step Water Fall</>; + }; + + render( + <Route path={OVERVIEW_ROUTE}> + <Component /> + </Route>, + { core } + ); + + expect(getBreadcrumbs()).toMatchInlineSnapshot(` + Array [ + Object { + "href": "", + "text": "Observability", + }, + Object { + "href": "/app/synthetics", + "onClick": [Function], + "text": "Synthetics", + }, + Object { + "href": "/app/uptime/monitor/dGVzdC1tb25pdG9y", + "onClick": [Function], + "text": "test-monitor", + }, + Object { + "href": "/app/uptime/journey/fake-test-group/steps", + "onClick": [Function], + "text": "Jan 4, 2021 6:25:19 AM", + }, + Object { + "text": "Performance breakdown", + }, + ] + `); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.test.tsx new file mode 100644 index 0000000000000..ff1494b0ed713 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.test.tsx @@ -0,0 +1,103 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { renderHook } from '@testing-library/react-hooks'; +import { + BROWSER_TRACE_NAME, + BROWSER_TRACE_START, + BROWSER_TRACE_TYPE, + useStepWaterfallMetrics, +} from './use_step_waterfall_metrics'; +import * as reduxHooks from 'react-redux'; +import * as searchHooks from '@kbn/observability-plugin/public/hooks/use_es_search'; + +describe('useStepWaterfallMetrics', () => { + jest + .spyOn(reduxHooks, 'useSelector') + .mockReturnValue({ settings: { heartbeatIndices: 'heartbeat-*' } }); + + it('returns result as expected', () => { + // @ts-ignore + const searchHook = jest.spyOn(searchHooks, 'useEsSearch').mockReturnValue({ + loading: false, + data: { + hits: { + total: { value: 2, relation: 'eq' }, + hits: [ + { + fields: { + [BROWSER_TRACE_TYPE]: ['mark'], + [BROWSER_TRACE_NAME]: ['navigationStart'], + [BROWSER_TRACE_START]: [3456789], + }, + }, + { + fields: { + [BROWSER_TRACE_TYPE]: ['mark'], + [BROWSER_TRACE_NAME]: ['domContentLoaded'], + [BROWSER_TRACE_START]: [4456789], + }, + }, + ], + }, + } as any, + }); + + const { result } = renderHook( + (props) => + useStepWaterfallMetrics({ + checkGroup: '44D-444FFF-444-FFF-3333', + hasNavigationRequest: true, + stepIndex: 1, + }), + {} + ); + + expect(searchHook).toHaveBeenCalledWith( + { + body: { + _source: false, + fields: ['browser.*'], + query: { + bool: { + filter: [ + { + term: { + 'synthetics.step.index': 1, + }, + }, + { + term: { + 'monitor.check_group': '44D-444FFF-444-FFF-3333', + }, + }, + { + term: { + 'synthetics.type': 'step/metrics', + }, + }, + ], + }, + }, + size: 1000, + }, + index: 'synthetics-*', + }, + ['44D-444FFF-444-FFF-3333', true], + { name: 'getWaterfallStepMetrics' } + ); + expect(result.current).toEqual({ + loading: false, + metrics: [ + { + id: 'domContentLoaded', + offset: 1000, + }, + ], + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.ts new file mode 100644 index 0000000000000..290bf7efbb020 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.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 { createEsParams, useEsSearch } from '@kbn/observability-plugin/public'; +import { MarkerItems } from '../waterfall/context/waterfall_chart'; + +export interface Props { + checkGroup: string; + stepIndex: number; + hasNavigationRequest?: boolean; +} +export const BROWSER_TRACE_TYPE = 'browser.relative_trace.type'; +export const BROWSER_TRACE_NAME = 'browser.relative_trace.name'; +export const BROWSER_TRACE_START = 'browser.relative_trace.start.us'; +export const NAVIGATION_START = 'navigationStart'; + +export const useStepWaterfallMetrics = ({ checkGroup, hasNavigationRequest, stepIndex }: Props) => { + const { data, loading } = useEsSearch( + hasNavigationRequest + ? createEsParams({ + index: 'synthetics-*', + body: { + query: { + bool: { + filter: [ + { + term: { + 'synthetics.step.index': stepIndex, + }, + }, + { + term: { + 'monitor.check_group': checkGroup, + }, + }, + { + term: { + 'synthetics.type': 'step/metrics', + }, + }, + ], + }, + }, + fields: ['browser.*'], + size: 1000, + _source: false, + }, + }) + : {}, + [checkGroup, hasNavigationRequest], + { + name: 'getWaterfallStepMetrics', + } + ); + + if (!hasNavigationRequest) { + return { metrics: [], loading: false }; + } + + const metrics: MarkerItems = []; + + if (data && hasNavigationRequest) { + const metricDocs = data.hits.hits as unknown as Array<{ fields: any }>; + let navigationStart = 0; + let navigationStartExist = false; + + metricDocs.forEach(({ fields }) => { + if (fields[BROWSER_TRACE_TYPE]?.[0] === 'mark') { + const { [BROWSER_TRACE_NAME]: metricType, [BROWSER_TRACE_START]: metricValue } = fields; + if (metricType?.[0] === NAVIGATION_START) { + navigationStart = metricValue?.[0]; + navigationStartExist = true; + } + } + }); + + if (navigationStartExist) { + metricDocs.forEach(({ fields }) => { + if (fields[BROWSER_TRACE_TYPE]?.[0] === 'mark') { + const { [BROWSER_TRACE_NAME]: metricType, [BROWSER_TRACE_START]: metricValue } = fields; + if (metricType?.[0] !== NAVIGATION_START) { + metrics.push({ + id: metricType?.[0], + offset: (metricValue?.[0] - navigationStart) / 1000, + }); + } + } + }); + } + } + + return { metrics, loading }; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.test.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.test.ts new file mode 100644 index 0000000000000..aea92647dfe60 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.test.ts @@ -0,0 +1,743 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { + colourPalette, + formatTooltipHeading, + getConnectingTime, + getSeriesAndDomain, + getSidebarItems, +} from './data_formatting'; +import { + NetworkItems, + MimeType, + FriendlyFlyoutLabels, + FriendlyTimingLabels, + Timings, + Metadata, +} from './types'; +import { WaterfallDataEntry } from '../../waterfall/types'; +import { mockMoment } from '../../../../../../utils/formatting/test_helpers'; + +export const networkItems: NetworkItems = [ + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'https://unpkg.com/todomvc-app-css@2.0.4/index.css', + status: 200, + mimeType: 'text/css', + requestSentTime: 18098833.175, + loadEndTime: 18098957.145, + timings: { + connect: 81.10800000213203, + wait: 34.577999998873565, + receive: 0.5520000013348181, + send: 0.3600000018195715, + total: 123.97000000055414, + proxy: -1, + blocked: 0.8540000017092098, + queueing: 2.263999998831423, + ssl: 55.38700000033714, + dns: 3.559999997378327, + }, + resourceSize: 1000, + transferSize: 1000, + requestHeaders: { + sample_request_header: 'sample request header', + }, + responseHeaders: { + sample_response_header: 'sample response header', + }, + certificates: { + issuer: 'Sample Issuer', + validFrom: '2021-02-22T18:35:26.000Z', + validTo: '2021-04-05T22:28:43.000Z', + subjectName: '*.elastic.co', + }, + ip: '104.18.8.22', + }, + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'https://unpkg.com/director@1.2.8/build/director.js', + status: 200, + mimeType: 'application/javascript', + requestSentTime: 18098833.537, + loadEndTime: 18098977.648000002, + timings: { + blocked: 84.54599999822676, + receive: 3.068000001803739, + queueing: 3.69700000010198, + proxy: -1, + total: 144.1110000014305, + wait: 52.56100000042352, + connect: -1, + send: 0.2390000008745119, + ssl: -1, + dns: -1, + }, + }, +]; + +export const networkItemsWithoutFullTimings: NetworkItems = [ + networkItems[0], + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'file:///Users/dominiqueclarke/dev/synthetics/examples/todos/app/app.js', + status: 0, + mimeType: 'text/javascript', + requestSentTime: 18098834.097, + loadEndTime: 18098836.889999997, + timings: { + total: 2.7929999996558763, + blocked: -1, + ssl: -1, + wait: -1, + connect: -1, + dns: -1, + queueing: -1, + send: -1, + proxy: -1, + receive: -1, + }, + }, +]; + +export const networkItemsWithoutAnyTimings: NetworkItems = [ + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'file:///Users/dominiqueclarke/dev/synthetics/examples/todos/app/app.js', + status: 0, + mimeType: 'text/javascript', + requestSentTime: 18098834.097, + loadEndTime: 18098836.889999997, + timings: { + total: -1, + blocked: -1, + ssl: -1, + wait: -1, + connect: -1, + dns: -1, + queueing: -1, + send: -1, + proxy: -1, + receive: -1, + }, + }, +]; + +export const networkItemsWithoutTimingsObject: NetworkItems = [ + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'file:///Users/dominiqueclarke/dev/synthetics/examples/todos/app/app.js', + status: 0, + mimeType: 'text/javascript', + requestSentTime: 18098834.097, + loadEndTime: 18098836.889999997, + }, +]; + +export const networkItemsWithUncommonMimeType: NetworkItems = [ + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'https://unpkg.com/director@1.2.8/build/director.js', + status: 200, + mimeType: 'application/x-javascript', + requestSentTime: 18098833.537, + loadEndTime: 18098977.648000002, + timings: { + blocked: 84.54599999822676, + receive: 3.068000001803739, + queueing: 3.69700000010198, + proxy: -1, + total: 144.1110000014305, + wait: 52.56100000042352, + connect: -1, + send: 0.2390000008745119, + ssl: -1, + dns: -1, + }, + }, +]; + +describe('getConnectingTime', () => { + it('returns `connect` value if `ssl` is undefined', () => { + expect(getConnectingTime(10)).toBe(10); + }); + + it('returns `undefined` if `connect` is not defined', () => { + expect(getConnectingTime(undefined, 23)).toBeUndefined(); + }); + + it('returns `connect` value if `ssl` is 0', () => { + expect(getConnectingTime(10, 0)).toBe(10); + }); + + it('returns `connect` value if `ssl` is -1', () => { + expect(getConnectingTime(10, 0)).toBe(10); + }); + + it('reduces `connect` value by `ssl` value if both are defined', () => { + expect(getConnectingTime(10, 3)).toBe(7); + }); +}); + +describe('Palettes', () => { + it('A colour palette comprising timing and mime type colours is correctly generated', () => { + expect(colourPalette).toEqual({ + blocked: '#dcd4c4', + connect: '#da8b45', + dns: '#54b399', + font: '#aa6556', + html: '#f3b3a6', + media: '#d6bf57', + other: '#e7664c', + receive: '#54b399', + script: '#9170b8', + send: '#d36086', + ssl: '#edc5a2', + stylesheet: '#ca8eae', + wait: '#b0c9e0', + xhr: '#e7664c', + }); + }); +}); + +describe('getSeriesAndDomain', () => { + beforeEach(() => { + mockMoment(); + }); + + it('formats series timings', () => { + const actual = getSeriesAndDomain(networkItems); + expect(actual.series).toMatchInlineSnapshot(` + Array [ + Object { + "config": Object { + "colour": "#dcd4c4", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#dcd4c4", + "value": "Queued / Blocked: 0.854ms", + }, + }, + "x": 0, + "y": 0.8540000017092098, + "y0": 0, + }, + Object { + "config": Object { + "colour": "#54b399", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#54b399", + "value": "DNS: 3.560ms", + }, + }, + "x": 0, + "y": 4.413999999087537, + "y0": 0.8540000017092098, + }, + Object { + "config": Object { + "colour": "#da8b45", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#da8b45", + "value": "Connecting: 25.721ms", + }, + }, + "x": 0, + "y": 30.135000000882428, + "y0": 4.413999999087537, + }, + Object { + "config": Object { + "colour": "#edc5a2", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#edc5a2", + "value": "TLS: 55.387ms", + }, + }, + "x": 0, + "y": 85.52200000121957, + "y0": 30.135000000882428, + }, + Object { + "config": Object { + "colour": "#d36086", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#d36086", + "value": "Sending request: 0.360ms", + }, + }, + "x": 0, + "y": 85.88200000303914, + "y0": 85.52200000121957, + }, + Object { + "config": Object { + "colour": "#b0c9e0", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#b0c9e0", + "value": "Waiting (TTFB): 34.578ms", + }, + }, + "x": 0, + "y": 120.4600000019127, + "y0": 85.88200000303914, + }, + Object { + "config": Object { + "colour": "#ca8eae", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#ca8eae", + "value": "Content downloading (CSS): 0.552ms", + }, + }, + "x": 0, + "y": 121.01200000324752, + "y0": 120.4600000019127, + }, + Object { + "config": Object { + "colour": "#dcd4c4", + "id": 1, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#dcd4c4", + "value": "Queued / Blocked: 84.546ms", + }, + }, + "x": 1, + "y": 84.90799999795854, + "y0": 0.3619999997317791, + }, + Object { + "config": Object { + "colour": "#d36086", + "id": 1, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#d36086", + "value": "Sending request: 0.239ms", + }, + }, + "x": 1, + "y": 85.14699999883305, + "y0": 84.90799999795854, + }, + Object { + "config": Object { + "colour": "#b0c9e0", + "id": 1, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#b0c9e0", + "value": "Waiting (TTFB): 52.561ms", + }, + }, + "x": 1, + "y": 137.70799999925657, + "y0": 85.14699999883305, + }, + Object { + "config": Object { + "colour": "#9170b8", + "id": 1, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#9170b8", + "value": "Content downloading (JS): 3.068ms", + }, + }, + "x": 1, + "y": 140.7760000010603, + "y0": 137.70799999925657, + }, + ] + `); + }); + + it('handles series formatting when only total timing values are available', () => { + const { series } = getSeriesAndDomain(networkItemsWithoutFullTimings); + expect(series).toMatchInlineSnapshot(` + Array [ + Object { + "config": Object { + "colour": "#dcd4c4", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#dcd4c4", + "value": "Queued / Blocked: 0.854ms", + }, + }, + "x": 0, + "y": 0.8540000017092098, + "y0": 0, + }, + Object { + "config": Object { + "colour": "#54b399", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#54b399", + "value": "DNS: 3.560ms", + }, + }, + "x": 0, + "y": 4.413999999087537, + "y0": 0.8540000017092098, + }, + Object { + "config": Object { + "colour": "#da8b45", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#da8b45", + "value": "Connecting: 25.721ms", + }, + }, + "x": 0, + "y": 30.135000000882428, + "y0": 4.413999999087537, + }, + Object { + "config": Object { + "colour": "#edc5a2", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#edc5a2", + "value": "TLS: 55.387ms", + }, + }, + "x": 0, + "y": 85.52200000121957, + "y0": 30.135000000882428, + }, + Object { + "config": Object { + "colour": "#d36086", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#d36086", + "value": "Sending request: 0.360ms", + }, + }, + "x": 0, + "y": 85.88200000303914, + "y0": 85.52200000121957, + }, + Object { + "config": Object { + "colour": "#b0c9e0", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#b0c9e0", + "value": "Waiting (TTFB): 34.578ms", + }, + }, + "x": 0, + "y": 120.4600000019127, + "y0": 85.88200000303914, + }, + Object { + "config": Object { + "colour": "#ca8eae", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#ca8eae", + "value": "Content downloading (CSS): 0.552ms", + }, + }, + "x": 0, + "y": 121.01200000324752, + "y0": 120.4600000019127, + }, + Object { + "config": Object { + "colour": "#9170b8", + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#9170b8", + "value": "Content downloading (JS): 2.793ms", + }, + }, + "x": 1, + "y": 3.714999998046551, + "y0": 0.9219999983906746, + }, + ] + `); + }); + + it('handles series formatting when there is no timing information available', () => { + const { series } = getSeriesAndDomain(networkItemsWithoutAnyTimings); + expect(series).toMatchInlineSnapshot(` + Array [ + Object { + "config": Object { + "colour": "", + "isHighlighted": true, + "showTooltip": false, + "tooltipProps": undefined, + }, + "x": 0, + "y": 0, + "y0": 0, + }, + ] + `); + }); + + it('handles formatting when there is no timing information available', () => { + const actual = getSeriesAndDomain(networkItemsWithoutAnyTimings); + expect(actual).toMatchInlineSnapshot(` + Object { + "domain": Object { + "max": 0, + "min": 0, + }, + "metadata": Array [ + Object { + "certificates": undefined, + "details": Array [ + Object { + "name": "Status", + "value": undefined, + }, + Object { + "name": "Content type", + "value": "text/javascript", + }, + Object { + "name": "Request start", + "value": "0.000 ms", + }, + Object { + "name": "DNS", + "value": undefined, + }, + Object { + "name": "Connecting", + "value": undefined, + }, + Object { + "name": "TLS", + "value": undefined, + }, + Object { + "name": "Waiting (TTFB)", + "value": undefined, + }, + Object { + "name": "Content downloading", + "value": undefined, + }, + Object { + "name": "Resource size", + "value": undefined, + }, + Object { + "name": "Transfer size", + "value": undefined, + }, + Object { + "name": "IP", + "value": undefined, + }, + ], + "requestHeaders": undefined, + "responseHeaders": undefined, + "url": "file:///Users/dominiqueclarke/dev/synthetics/examples/todos/app/app.js", + "x": 0, + }, + ], + "series": Array [ + Object { + "config": Object { + "colour": "", + "isHighlighted": true, + "showTooltip": false, + "tooltipProps": undefined, + }, + "x": 0, + "y": 0, + "y0": 0, + }, + ], + "totalHighlightedRequests": 1, + } + `); + }); + + it('handles formatting when the timings object is undefined', () => { + const { series } = getSeriesAndDomain(networkItemsWithoutTimingsObject); + expect(series).toMatchInlineSnapshot(` + Array [ + Object { + "config": Object { + "isHighlighted": true, + "showTooltip": false, + }, + "x": 0, + "y": 0, + "y0": 0, + }, + ] + `); + }); + + it('handles formatting when mime type is not mapped to a specific mime type bucket', () => { + const { series } = getSeriesAndDomain(networkItemsWithUncommonMimeType); + /* verify that raw mime type appears in the tooltip config and that + * the colour is mapped to mime type other */ + const contentDownloadedingConfigItem = series.find((item: WaterfallDataEntry) => { + const { tooltipProps } = item.config; + if (tooltipProps && typeof tooltipProps.value === 'string') { + return ( + tooltipProps.value.includes('application/x-javascript') && + tooltipProps.colour === colourPalette[MimeType.Other] + ); + } + return false; + }); + expect(contentDownloadedingConfigItem).toBeDefined(); + }); + + it.each([ + [FriendlyFlyoutLabels[Metadata.Status], '200'], + [FriendlyFlyoutLabels[Metadata.MimeType], 'text/css'], + [FriendlyFlyoutLabels[Metadata.RequestStart], '0.000 ms'], + [FriendlyTimingLabels[Timings.Dns], '3.560 ms'], + [FriendlyTimingLabels[Timings.Connect], '25.721 ms'], + [FriendlyTimingLabels[Timings.Ssl], '55.387 ms'], + [FriendlyTimingLabels[Timings.Wait], '34.578 ms'], + [FriendlyTimingLabels[Timings.Receive], '0.552 ms'], + [FriendlyFlyoutLabels[Metadata.TransferSize], '1.000 KB'], + [FriendlyFlyoutLabels[Metadata.ResourceSize], '1.000 KB'], + [FriendlyFlyoutLabels[Metadata.IP], '104.18.8.22'], + ])('handles metadata details formatting', (name, value) => { + const { metadata } = getSeriesAndDomain(networkItems); + const metadataEntry = metadata[0]; + expect( + metadataEntry.details.find((item) => item.value === value && item.name === name) + ).toBeDefined(); + }); + + it('handles metadata headers formatting', () => { + const { metadata } = getSeriesAndDomain(networkItems); + const metadataEntry = metadata[0]; + metadataEntry.requestHeaders?.forEach((header) => { + expect(header).toEqual({ name: header.name, value: header.value }); + }); + metadataEntry.responseHeaders?.forEach((header) => { + expect(header).toEqual({ name: header.name, value: header.value }); + }); + }); + + it('handles certificate formatting', () => { + const { metadata } = getSeriesAndDomain([networkItems[0]]); + const metadataEntry = metadata[0]; + expect(metadataEntry.certificates).toEqual([ + { name: 'Issuer', value: networkItems[0].certificates?.issuer }, + { name: 'Valid from', value: moment(networkItems[0].certificates?.validFrom).format('L LT') }, + { name: 'Valid until', value: moment(networkItems[0].certificates?.validTo).format('L LT') }, + { name: 'Common name', value: networkItems[0].certificates?.subjectName }, + ]); + metadataEntry.responseHeaders?.forEach((header) => { + expect(header).toEqual({ name: header.name, value: header.value }); + }); + }); + it('counts the total number of highlighted items', () => { + // only one CSS file in this array of network Items + const actual = getSeriesAndDomain(networkItems, false, '', ['stylesheet']); + expect(actual.totalHighlightedRequests).toBe(1); + }); + + it('adds isHighlighted to waterfall entry when filter matches', () => { + // only one CSS file in this array of network Items + const { series } = getSeriesAndDomain(networkItems, false, '', ['stylesheet']); + series.forEach((item) => { + if (item.x === 0) { + expect(item.config.isHighlighted).toBe(true); + } else { + expect(item.config.isHighlighted).toBe(false); + } + }); + }); + + it('adds isHighlighted to waterfall entry when query matches', () => { + // only the second item matches this query + const { series } = getSeriesAndDomain(networkItems, false, 'director', []); + series.forEach((item) => { + if (item.x === 1) { + expect(item.config.isHighlighted).toBe(true); + } else { + expect(item.config.isHighlighted).toBe(false); + } + }); + }); +}); + +describe('getSidebarItems', () => { + it('passes the item index offset by 1 to offsetIndex for visual display', () => { + const actual = getSidebarItems(networkItems, false, '', []); + expect(actual[0].offsetIndex).toBe(1); + }); +}); + +describe('formatTooltipHeading', () => { + it('puts index and URL text together', () => { + expect(formatTooltipHeading(1, 'http://www.elastic.co/')).toEqual('1. http://www.elastic.co/'); + }); + + it('returns only the text if `index` is NaN', () => { + expect(formatTooltipHeading(NaN, 'http://www.elastic.co/')).toEqual('http://www.elastic.co/'); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.ts new file mode 100644 index 0000000000000..8b7a29af3030e --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.ts @@ -0,0 +1,456 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { euiPaletteColorBlind } from '@elastic/eui'; +import moment from 'moment'; + +import { NetworkEvent } from '../../../../../../../../../common/runtime_types'; +import { + NetworkItems, + NetworkItem, + FriendlyFlyoutLabels, + FriendlyTimingLabels, + FriendlyMimetypeLabels, + MimeType, + MimeTypesMap, + Timings, + Metadata, + TIMING_ORDER, + SidebarItems, + LegendItems, +} from './types'; +import { WaterfallData, WaterfallMetadata } from '../../waterfall'; + +export const extractItems = (data: NetworkEvent[]): NetworkItems => { + // NOTE: This happens client side as the "payload" property is mapped + // in such a way it can't be queried (or sorted on) via ES. + return data.sort((a: NetworkItem, b: NetworkItem) => { + return a.requestSentTime - b.requestSentTime; + }); +}; + +const formatValueForDisplay = (value: number, points: number = 3) => { + return Number(value).toFixed(points); +}; + +const getColourForMimeType = (mimeType?: string) => { + const key = mimeType && MimeTypesMap[mimeType] ? MimeTypesMap[mimeType] : MimeType.Other; + return colourPalette[key]; +}; + +const getFriendlyTooltipValue = ({ + value, + timing, + mimeType, +}: { + value: number; + timing: Timings; + mimeType?: string; +}) => { + let label = FriendlyTimingLabels[timing]; + if (timing === Timings.Receive && mimeType) { + const formattedMimeType: MimeType = MimeTypesMap[mimeType]; + label += ` (${FriendlyMimetypeLabels[formattedMimeType] || mimeType})`; + } + return `${label}: ${formatValueForDisplay(value)}ms`; +}; +export const isHighlightedItem = ( + item: NetworkItem, + query?: string, + activeFilters: string[] = [] +) => { + if (!query && activeFilters?.length === 0) { + return true; + } + + const matchQuery = query ? item.url?.includes(query) : true; + const matchFilters = + activeFilters.length > 0 ? activeFilters.includes(MimeTypesMap[item.mimeType!]) : true; + + return !!(matchQuery && matchFilters); +}; + +const getFriendlyMetadataValue = ({ value, postFix }: { value?: number; postFix?: string }) => { + // value === -1 indicates timing data cannot be extracted + if (value === undefined || value === -1) { + return undefined; + } + + let formattedValue = formatValueForDisplay(value); + + if (postFix) { + formattedValue = `${formattedValue} ${postFix}`; + } + + return formattedValue; +}; + +export const getConnectingTime = (connect?: number, ssl?: number) => { + if (ssl && connect && ssl > 0) { + return connect - ssl; + } else { + return connect; + } +}; + +export const getSeriesAndDomain = ( + items: NetworkItems, + onlyHighlighted = false, + query?: string, + activeFilters?: string[] +) => { + const getValueForOffset = (item: NetworkItem) => { + return item.requestSentTime; + }; + // The earliest point in time a request is sent or started. This will become our notion of "0". + let zeroOffset = Infinity; + items.forEach((i) => (zeroOffset = Math.min(zeroOffset, getValueForOffset(i)))); + + const getValue = (timings: NetworkEvent['timings'], timing: Timings) => { + if (!timings) return; + + // SSL is a part of the connect timing + if (timing === Timings.Connect) { + return getConnectingTime(timings.connect, timings.ssl); + } + return timings[timing]; + }; + + const series: WaterfallData = []; + const metadata: WaterfallMetadata = []; + let totalHighlightedRequests = 0; + + items.forEach((item, index) => { + const mimeTypeColour = getColourForMimeType(item.mimeType); + const offsetValue = getValueForOffset(item); + let currentOffset = offsetValue - zeroOffset; + metadata.push(formatMetadata({ item, index, requestStart: currentOffset })); + const isHighlighted = isHighlightedItem(item, query, activeFilters); + if (isHighlighted) { + totalHighlightedRequests++; + } + + if (!item.timings) { + series.push({ + x: index, + y0: 0, + y: 0, + config: { + isHighlighted, + showTooltip: false, + }, + }); + return; + } + + let timingValueFound = false; + + TIMING_ORDER.forEach((timing) => { + const value = getValue(item.timings, timing); + if (value && value >= 0) { + timingValueFound = true; + const colour = timing === Timings.Receive ? mimeTypeColour : colourPalette[timing]; + const y = currentOffset + value; + + series.push({ + x: index, + y0: currentOffset, + y, + config: { + id: index, + colour, + isHighlighted, + showTooltip: true, + tooltipProps: { + value: getFriendlyTooltipValue({ + value: y - currentOffset, + timing, + mimeType: item.mimeType, + }), + colour, + }, + }, + }); + currentOffset = y; + } + }); + + /* if no specific timing values are found, use the total time + * if total time is not available use 0, set showTooltip to false, + * and omit tooltip props */ + if (!timingValueFound) { + const total = item.timings.total; + const hasTotal = total !== -1; + series.push({ + x: index, + y0: hasTotal ? currentOffset : 0, + y: hasTotal ? currentOffset + item.timings.total : 0, + config: { + isHighlighted, + colour: hasTotal ? mimeTypeColour : '', + showTooltip: hasTotal, + tooltipProps: hasTotal + ? { + value: getFriendlyTooltipValue({ + value: total, + timing: Timings.Receive, + mimeType: item.mimeType, + }), + colour: mimeTypeColour, + } + : undefined, + }, + }); + } + }); + + const yValues = series.map((serie) => serie.y); + const domain = { min: 0, max: Math.max(...yValues) }; + + let filteredSeries = series; + if (onlyHighlighted) { + filteredSeries = series.filter((item) => item.config.isHighlighted); + } + + return { series: filteredSeries, domain, metadata, totalHighlightedRequests }; +}; + +const formatHeaders = (headers?: Record<string, unknown>) => { + if (typeof headers === 'undefined') { + return undefined; + } + return Object.keys(headers).map((key) => ({ + name: key, + value: `${headers[key]}`, + })); +}; + +const formatMetadata = ({ + item, + index, + requestStart, +}: { + item: NetworkItem; + index: number; + requestStart: number; +}) => { + const { + certificates, + ip, + mimeType, + requestHeaders, + responseHeaders, + url, + resourceSize, + transferSize, + status, + } = item; + const { dns, connect, ssl, wait, receive, total } = item.timings || {}; + const contentDownloaded = receive && receive > 0 ? receive : total; + return { + x: index, + url, + requestHeaders: formatHeaders(requestHeaders), + responseHeaders: formatHeaders(responseHeaders), + certificates: certificates + ? [ + { + name: FriendlyFlyoutLabels[Metadata.CertificateIssuer], + value: certificates.issuer, + }, + { + name: FriendlyFlyoutLabels[Metadata.CertificateIssueDate], + value: certificates.validFrom + ? moment(certificates.validFrom).format('L LT') + : undefined, + }, + { + name: FriendlyFlyoutLabels[Metadata.CertificateExpiryDate], + value: certificates.validTo ? moment(certificates.validTo).format('L LT') : undefined, + }, + { + name: FriendlyFlyoutLabels[Metadata.CertificateSubject], + value: certificates.subjectName, + }, + ] + : undefined, + details: [ + { name: FriendlyFlyoutLabels[Metadata.Status], value: status ? `${status}` : undefined }, + { name: FriendlyFlyoutLabels[Metadata.MimeType], value: mimeType }, + { + name: FriendlyFlyoutLabels[Metadata.RequestStart], + value: getFriendlyMetadataValue({ value: requestStart, postFix: 'ms' }), + }, + { + name: FriendlyTimingLabels[Timings.Dns], + value: getFriendlyMetadataValue({ value: dns, postFix: 'ms' }), + }, + { + name: FriendlyTimingLabels[Timings.Connect], + value: getFriendlyMetadataValue({ value: getConnectingTime(connect, ssl), postFix: 'ms' }), + }, + { + name: FriendlyTimingLabels[Timings.Ssl], + value: getFriendlyMetadataValue({ value: ssl, postFix: 'ms' }), + }, + { + name: FriendlyTimingLabels[Timings.Wait], + value: getFriendlyMetadataValue({ value: wait, postFix: 'ms' }), + }, + { + name: FriendlyTimingLabels[Timings.Receive], + value: getFriendlyMetadataValue({ + value: contentDownloaded, + postFix: 'ms', + }), + }, + { + name: FriendlyFlyoutLabels[Metadata.ResourceSize], + value: getFriendlyMetadataValue({ + value: resourceSize ? resourceSize / 1000 : undefined, + postFix: 'KB', + }), + }, + { + name: FriendlyFlyoutLabels[Metadata.TransferSize], + value: getFriendlyMetadataValue({ + value: transferSize ? transferSize / 1000 : undefined, + postFix: 'KB', + }), + }, + { + name: FriendlyFlyoutLabels[Metadata.IP], + value: ip, + }, + ], + }; +}; + +export const getSidebarItems = ( + items: NetworkItems, + onlyHighlighted: boolean, + query: string, + activeFilters: string[] +): SidebarItems => { + const sideBarItems = items.map((item, index) => { + const isHighlighted = isHighlightedItem(item, query, activeFilters); + const offsetIndex = index + 1; + const { url, status, method } = item; + return { url, status, method, isHighlighted, offsetIndex, index }; + }); + if (onlyHighlighted) { + return sideBarItems.filter((item) => item.isHighlighted); + } + return sideBarItems; +}; + +export const getLegendItems = (): LegendItems => { + let timingItems: LegendItems = []; + Object.values(Timings).forEach((timing) => { + // The "receive" timing is mapped to a mime type colour, so we don't need to show this in the legend + if (timing === Timings.Receive) { + return; + } + timingItems = [ + ...timingItems, + { name: FriendlyTimingLabels[timing], colour: TIMING_PALETTE[timing] }, + ]; + }); + + let mimeTypeItems: LegendItems = []; + Object.values(MimeType).forEach((mimeType) => { + mimeTypeItems = [ + ...mimeTypeItems, + { name: FriendlyMimetypeLabels[mimeType], colour: MIME_TYPE_PALETTE[mimeType] }, + ]; + }); + + return [...timingItems, ...mimeTypeItems]; +}; + +// Timing colour palette +type TimingColourPalette = { + [K in Timings]: string; +}; + +const SAFE_PALETTE = euiPaletteColorBlind({ rotations: 2 }); + +const buildTimingPalette = (): TimingColourPalette => { + const palette = Object.values(Timings).reduce<Partial<TimingColourPalette>>((acc, value) => { + switch (value) { + case Timings.Blocked: + acc[value] = SAFE_PALETTE[16]; + break; + case Timings.Dns: + acc[value] = SAFE_PALETTE[0]; + break; + case Timings.Connect: + acc[value] = SAFE_PALETTE[7]; + break; + case Timings.Ssl: + acc[value] = SAFE_PALETTE[17]; + break; + case Timings.Send: + acc[value] = SAFE_PALETTE[2]; + break; + case Timings.Wait: + acc[value] = SAFE_PALETTE[11]; + break; + case Timings.Receive: + acc[value] = SAFE_PALETTE[0]; + break; + } + return acc; + }, {}); + + return palette as TimingColourPalette; +}; + +const TIMING_PALETTE = buildTimingPalette(); + +// MimeType colour palette +type MimeTypeColourPalette = { + [K in MimeType]: string; +}; + +const buildMimeTypePalette = (): MimeTypeColourPalette => { + const palette = Object.values(MimeType).reduce<Partial<MimeTypeColourPalette>>((acc, value) => { + switch (value) { + case MimeType.Html: + acc[value] = SAFE_PALETTE[19]; + break; + case MimeType.Script: + acc[value] = SAFE_PALETTE[3]; + break; + case MimeType.Stylesheet: + acc[value] = SAFE_PALETTE[4]; + break; + case MimeType.Media: + acc[value] = SAFE_PALETTE[5]; + break; + case MimeType.Font: + acc[value] = SAFE_PALETTE[8]; + break; + case MimeType.XHR: + case MimeType.Other: + acc[value] = SAFE_PALETTE[9]; + break; + } + return acc; + }, {}); + + return palette as MimeTypeColourPalette; +}; + +const MIME_TYPE_PALETTE = buildMimeTypePalette(); + +type ColourPalette = TimingColourPalette & MimeTypeColourPalette; + +export const colourPalette: ColourPalette = { ...TIMING_PALETTE, ...MIME_TYPE_PALETTE }; + +export const formatTooltipHeading = (index: number, fullText: string): string => + isNaN(index) ? fullText : `${index}. ${fullText}`; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/types.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/types.ts new file mode 100644 index 0000000000000..ad4c635f31d3b --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/types.ts @@ -0,0 +1,262 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { NetworkEvent } from '../../../../../../../../../common/runtime_types'; + +export enum Timings { + Blocked = 'blocked', + Dns = 'dns', + Connect = 'connect', + Ssl = 'ssl', + Send = 'send', + Wait = 'wait', + Receive = 'receive', +} + +export enum Metadata { + Status = 'status', + ResourceSize = 'resourceSize', + TransferSize = 'transferSize', + CertificateIssuer = 'certificateIssuer', + CertificateIssueDate = 'certificateIssueDate', + CertificateExpiryDate = 'certificateExpiryDate', + CertificateSubject = 'certificateSubject', + IP = 'ip', + MimeType = 'mimeType', + RequestStart = 'requestStart', +} + +export const FriendlyTimingLabels = { + [Timings.Blocked]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.timings.blocked', + { + defaultMessage: 'Queued / Blocked', + } + ), + [Timings.Dns]: i18n.translate('xpack.synthetics.synthetics.waterfallChart.labels.timings.dns', { + defaultMessage: 'DNS', + }), + [Timings.Connect]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.timings.connect', + { + defaultMessage: 'Connecting', + } + ), + [Timings.Ssl]: i18n.translate('xpack.synthetics.synthetics.waterfallChart.labels.timings.ssl', { + defaultMessage: 'TLS', + }), + [Timings.Send]: i18n.translate('xpack.synthetics.synthetics.waterfallChart.labels.timings.send', { + defaultMessage: 'Sending request', + }), + [Timings.Wait]: i18n.translate('xpack.synthetics.synthetics.waterfallChart.labels.timings.wait', { + defaultMessage: 'Waiting (TTFB)', + }), + [Timings.Receive]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.timings.receive', + { + defaultMessage: 'Content downloading', + } + ), +}; + +export const FriendlyFlyoutLabels = { + [Metadata.Status]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.status', + { + defaultMessage: 'Status', + } + ), + [Metadata.MimeType]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.contentType', + { + defaultMessage: 'Content type', + } + ), + [Metadata.RequestStart]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.requestStart', + { + defaultMessage: 'Request start', + } + ), + [Metadata.ResourceSize]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.resourceSize', + { + defaultMessage: 'Resource size', + } + ), + [Metadata.TransferSize]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.transferSize', + { + defaultMessage: 'Transfer size', + } + ), + [Metadata.CertificateIssuer]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.certificateIssuer', + { + defaultMessage: 'Issuer', + } + ), + [Metadata.CertificateIssueDate]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.certificateIssueDate', + { + defaultMessage: 'Valid from', + } + ), + [Metadata.CertificateExpiryDate]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.certificateExpiryDate', + { + defaultMessage: 'Valid until', + } + ), + [Metadata.CertificateSubject]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.certificateSubject', + { + defaultMessage: 'Common name', + } + ), + [Metadata.IP]: i18n.translate('xpack.synthetics.synthetics.waterfallChart.labels.metadata.ip', { + defaultMessage: 'IP', + }), +}; + +export const TIMING_ORDER = [ + Timings.Blocked, + Timings.Dns, + Timings.Connect, + Timings.Ssl, + Timings.Send, + Timings.Wait, + Timings.Receive, +] as const; + +export const META_DATA_ORDER_FLYOUT = [ + Metadata.MimeType, + Timings.Dns, + Timings.Connect, + Timings.Ssl, + Timings.Wait, + Timings.Receive, +] as const; + +export type CalculatedTimings = { + [K in Timings]?: number; +}; + +export enum MimeType { + Html = 'html', + Script = 'script', + Stylesheet = 'stylesheet', + Media = 'media', + Font = 'font', + XHR = 'xhr', + Other = 'other', +} + +export const FriendlyMimetypeLabels = { + [MimeType.Html]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.html', + { + defaultMessage: 'HTML', + } + ), + [MimeType.Script]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.script', + { + defaultMessage: 'JS', + } + ), + [MimeType.Stylesheet]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.stylesheet', + { + defaultMessage: 'CSS', + } + ), + [MimeType.Media]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.media', + { + defaultMessage: 'Media', + } + ), + [MimeType.Font]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.font', + { + defaultMessage: 'Font', + } + ), + [MimeType.XHR]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.xhr', + { + defaultMessage: 'XHR', + } + ), + [MimeType.Other]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.other', + { + defaultMessage: 'Other', + } + ), +}; + +// NOTE: This list tries to cover the standard spec compliant mime types, +// and a few popular non-standard ones, but it isn't exhaustive. +export const MimeTypesMap: Record<string, MimeType> = { + 'text/html': MimeType.Html, + 'application/javascript': MimeType.Script, + 'text/javascript': MimeType.Script, + 'text/css': MimeType.Stylesheet, + // Images + 'image/apng': MimeType.Media, + 'image/bmp': MimeType.Media, + 'image/gif': MimeType.Media, + 'image/x-icon': MimeType.Media, + 'image/jpeg': MimeType.Media, + 'image/png': MimeType.Media, + 'image/svg+xml': MimeType.Media, + 'image/tiff': MimeType.Media, + 'image/webp': MimeType.Media, + // Common audio / video formats + 'audio/wave': MimeType.Media, + 'audio/wav': MimeType.Media, + 'audio/x-wav': MimeType.Media, + 'audio/x-pn-wav': MimeType.Media, + 'audio/webm': MimeType.Media, + 'video/webm': MimeType.Media, + 'video/mp4': MimeType.Media, + 'audio/ogg': MimeType.Media, + 'video/ogg': MimeType.Media, + 'application/ogg': MimeType.Media, + // Fonts + 'font/otf': MimeType.Font, + 'font/ttf': MimeType.Font, + 'font/woff': MimeType.Font, + 'font/woff2': MimeType.Font, + 'application/x-font-opentype': MimeType.Font, + 'application/font-woff': MimeType.Font, + 'application/font-woff2': MimeType.Font, + 'application/vnd.ms-fontobject': MimeType.Font, + 'application/font-sfnt': MimeType.Font, + + // XHR + 'application/json': MimeType.XHR, +}; + +export type NetworkItem = NetworkEvent; +export type NetworkItems = NetworkItem[]; + +export type SidebarItem = Pick<NetworkItem, 'url' | 'status' | 'method'> & { + isHighlighted: boolean; + index: number; + offsetIndex: number; +}; +export type SidebarItems = SidebarItem[]; + +export interface LegendItem { + name: string; + colour: string; +} +export type LegendItems = LegendItem[]; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.test.tsx new file mode 100644 index 0000000000000..3802ace38f453 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.test.tsx @@ -0,0 +1,204 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { screen } from '@testing-library/react'; +import { WaterfallChartContainer } from './waterfall_chart_container'; +import { render } from '../../../../../../utils/testing'; + +const networkEvents = { + events: [ + { + timestamp: '2021-01-21T10:31:21.537Z', + method: 'GET', + url: 'https://apv-static.minute.ly/videos/v-c2a526c7-450d-428e-1244649-a390-fb639ffead96-s45.746-54.421m.mp4', + status: 206, + mimeType: 'video/mp4', + requestSentTime: 241114127.474, + loadEndTime: 241116573.402, + timings: { + total: 2445.928000001004, + queueing: 1.7399999778717756, + blocked: 0.391999987186864, + receive: 2283.964000031119, + connect: 91.5709999972023, + wait: 28.795999998692423, + proxy: -1, + dns: 36.952000024029985, + send: 0.10000000474974513, + ssl: 64.28900000173599, + }, + }, + { + timestamp: '2021-01-21T10:31:22.174Z', + method: 'GET', + url: 'https://dpm.demdex.net/ibs:dpid=73426&dpuuid=31597189268188866891125449924942215949', + status: 200, + mimeType: 'image/gif', + requestSentTime: 241114749.202, + loadEndTime: 241114805.541, + timings: { + queueing: 1.2240000069141388, + receive: 2.218999987235293, + proxy: -1, + dns: -1, + send: 0.14200000441633165, + blocked: 1.033000007737428, + total: 56.33900000248104, + wait: 51.72099999617785, + ssl: -1, + connect: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.679Z', + method: 'GET', + url: 'https://dapi.cms.mlbinfra.com/v2/content/en-us/sel-t119-homepage-mediawall', + status: 200, + mimeType: 'application/json', + requestSentTime: 241114268.04299998, + loadEndTime: 241114665.609, + timings: { + total: 397.5659999996424, + dns: 29.5429999823682, + wait: 221.6830000106711, + queueing: 2.1410000044852495, + connect: 106.95499999565072, + ssl: 69.06899999012239, + receive: 2.027999988058582, + blocked: 0.877000013133511, + send: 23.719999997410923, + proxy: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.740Z', + method: 'GET', + url: 'https://platform.twitter.com/embed/embed.runtime.b313577971db9c857801.js', + status: 200, + mimeType: 'application/javascript', + requestSentTime: 241114303.84899998, + loadEndTime: 241114370.361, + timings: { + send: 1.357000001007691, + wait: 40.12299998430535, + receive: 16.78500001435168, + ssl: -1, + queueing: 2.5670000177342445, + total: 66.51200001942925, + connect: -1, + blocked: 5.680000002030283, + proxy: -1, + dns: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.740Z', + method: 'GET', + url: 'https://platform.twitter.com/embed/embed.modules.7a266e7acfd42f2581a5.js', + status: 200, + mimeType: 'application/javascript', + requestSentTime: 241114305.939, + loadEndTime: 241114938.264, + timings: { + wait: 51.61500000394881, + dns: -1, + ssl: -1, + receive: 506.5750000067055, + proxy: -1, + connect: -1, + blocked: 69.51599998865277, + queueing: 4.453999979887158, + total: 632.324999984121, + send: 0.16500000492669642, + }, + }, + ], +}; + +const defaultState = { + networkEvents: { + test: { + '1': { + ...networkEvents, + total: 100, + isWaterfallSupported: true, + loading: false, + }, + }, + }, +}; + +describe('WaterfallChartContainer', () => { + beforeAll(() => { + jest.useFakeTimers(); + }); + + it('does not display waterfall chart unavailable when isWaterfallSupported is true', () => { + render(<WaterfallChartContainer checkGroup="test" stepIndex={1} />, { + state: defaultState, + }); + expect(screen.queryByText('Waterfall chart unavailable')).not.toBeInTheDocument(); + }); + + it('displays waterfall chart unavailable when isWaterfallSupported is false', () => { + const state = { + networkEvents: { + test: { + '1': { + ...networkEvents, + total: 100, + isWaterfallSupported: false, + loading: false, + }, + }, + }, + }; + render(<WaterfallChartContainer checkGroup="test" stepIndex={1} />, { + state, + }); + expect(screen.getByText('Waterfall chart unavailable')).toBeInTheDocument(); + }); + + it('displays loading bar when loading', () => { + const state = { + networkEvents: { + test: { + '1': { + ...networkEvents, + total: 100, + isWaterfallSupported: false, + loading: true, + }, + }, + }, + }; + render(<WaterfallChartContainer checkGroup="test" stepIndex={1} />, { + state, + }); + expect(screen.getByLabelText('Waterfall chart loading')).toBeInTheDocument(); + }); + + it('displays no data available message when no events are available', () => { + const state = { + networkEvents: { + test: { + '1': { + events: [], + total: 0, + isWaterfallSupported: true, + loading: false, + }, + }, + }, + }; + render(<WaterfallChartContainer checkGroup="test" stepIndex={1} />, { + state, + }); + expect(screen.getByText('No waterfall data could be found for this step')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.tsx new file mode 100644 index 0000000000000..effe2c2ed42ca --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.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, EuiText, EuiLoadingChart, EuiCallOut } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import React, { useEffect } from 'react'; +import { useSelector, useDispatch } from 'react-redux'; +import { networkEventsSelector } from '../../../../../../state/network_events/selectors'; +import { getNetworkEvents } from '../../../../../../state/network_events/actions'; +import { JourneyStep } from '../../../../../../../../../common/runtime_types'; +import { WaterfallChartWrapper } from './waterfall_chart_wrapper'; +import { extractItems } from './data_formatting'; +import { useStepWaterfallMetrics } from '../use_step_waterfall_metrics'; + +export const NO_DATA_TEXT = i18n.translate( + 'xpack.synthetics.synthetics.stepDetail.waterfallNoData', + { + defaultMessage: 'No waterfall data could be found for this step', + } +); + +interface Props { + checkGroup: string; + activeStep?: JourneyStep; + stepIndex: number; +} + +export const WaterfallChartContainer: React.FC<Props> = ({ checkGroup, stepIndex, activeStep }) => { + const dispatch = useDispatch(); + + useEffect(() => { + if (checkGroup && stepIndex) { + dispatch( + getNetworkEvents({ + checkGroup, + stepIndex, + }) + ); + } + }, [dispatch, stepIndex, checkGroup]); + + const _networkEvents = useSelector(networkEventsSelector); + const networkEvents = _networkEvents[checkGroup ?? '']?.[stepIndex]; + const waterfallLoaded = networkEvents && !networkEvents.loading; + const isWaterfallSupported = networkEvents?.isWaterfallSupported; + const hasEvents = networkEvents?.events?.length > 0; + + const { metrics } = useStepWaterfallMetrics({ + checkGroup, + stepIndex, + hasNavigationRequest: networkEvents?.hasNavigationRequest, + }); + + return ( + <> + {!waterfallLoaded && ( + <EuiFlexGroup justifyContent="center"> + <EuiFlexItem grow={false}> + <EuiLoadingChart + size="xl" + aria-label={i18n.translate( + 'xpack.synthetics.synthetics.stepDetail.waterfall.loading', + { + defaultMessage: 'Waterfall chart loading', + } + )} + /> + </EuiFlexItem> + </EuiFlexGroup> + )} + {waterfallLoaded && !hasEvents && ( + <EuiFlexGroup justifyContent="center"> + <EuiFlexItem> + <EuiText textAlign="center"> + <p>{NO_DATA_TEXT}</p> + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> + )} + {waterfallLoaded && hasEvents && isWaterfallSupported && ( + <WaterfallChartWrapper + data={extractItems(networkEvents.events)} + markerItems={metrics} + total={networkEvents.total} + activeStep={activeStep} + /> + )} + {waterfallLoaded && hasEvents && !isWaterfallSupported && ( + <EuiCallOut + title={ + <FormattedMessage + id="xpack.synthetics.synthetics.stepDetail.waterfallUnsupported.title" + defaultMessage="Waterfall chart unavailable" + /> + } + color="warning" + iconType="help" + > + <FormattedMessage + id="xpack.synthetics.synthetics.stepDetail.waterfallUnsupported.description" + defaultMessage="The waterfall chart cannot be shown. You may be using an older version of the Synthetic Agent. Please check the version and consider upgrading." + /> + </EuiCallOut> + )} + </> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.test.tsx new file mode 100644 index 0000000000000..94df6a4e2e698 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.test.tsx @@ -0,0 +1,311 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { act, fireEvent, waitFor } from '@testing-library/react'; +import { WaterfallChartWrapper } from './waterfall_chart_wrapper'; +import { networkItems as mockNetworkItems } from './data_formatting.test'; + +import { extractItems, isHighlightedItem } from './data_formatting'; +import { BAR_HEIGHT } from '../../waterfall/components/constants'; +import { MimeType } from './types'; +import { + FILTER_POPOVER_OPEN_LABEL, + FILTER_REQUESTS_LABEL, + FILTER_COLLAPSE_REQUESTS_LABEL, +} from '../../waterfall/components/translations'; +import { render } from '../../../../../../utils/testing'; + +const getHighLightedItems = (query: string, filters: string[]) => { + return NETWORK_EVENTS.events.filter((item) => isHighlightedItem(item, query, filters)); +}; + +describe('WaterfallChartWrapper', () => { + beforeAll(() => { + jest.useFakeTimers(); + }); + + it('renders the correct sidebar items', () => { + const { getAllByTestId } = render( + <WaterfallChartWrapper + data={extractItems(NETWORK_EVENTS.events)} + total={1000} + markerItems={[{ id: 'domContentLoaded', offset: 2352353 }]} + /> + ); + + const sideBarItems = getAllByTestId('middleTruncatedTextSROnly'); + + expect(sideBarItems).toHaveLength(5); + }); + + it('search by query works', () => { + const { getAllByTestId, getByTestId, getByLabelText } = render( + <WaterfallChartWrapper data={extractItems(NETWORK_EVENTS.events)} total={1000} /> + ); + + const filterInput = getByLabelText(FILTER_REQUESTS_LABEL); + + const searchText = '.js'; + + fireEvent.change(filterInput, { target: { value: searchText } }); + + // inout has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + const highlightedItemsLength = getHighLightedItems(searchText, []).length; + expect(getAllByTestId('sideBarHighlightedItem')).toHaveLength(highlightedItemsLength); + + expect(getAllByTestId('sideBarDimmedItem')).toHaveLength( + NETWORK_EVENTS.events.length - highlightedItemsLength + ); + + const SIDE_BAR_ITEMS_HEIGHT = NETWORK_EVENTS.events.length * BAR_HEIGHT; + expect(getByTestId('wfSidebarContainer')).toHaveAttribute('height', `${SIDE_BAR_ITEMS_HEIGHT}`); + + expect(getByTestId('wfDataOnlyBarChart')).toHaveAttribute('height', `${SIDE_BAR_ITEMS_HEIGHT}`); + }); + + it('search by mime type works', () => { + const { getAllByTestId, getByLabelText, getAllByText } = render( + <WaterfallChartWrapper data={extractItems(NETWORK_EVENTS.events)} total={1000} /> + ); + + const sideBarItems = getAllByTestId('middleTruncatedTextSROnly'); + + expect(sideBarItems).toHaveLength(5); + + fireEvent.click(getByLabelText(FILTER_POPOVER_OPEN_LABEL)); + + fireEvent.click(getAllByText('XHR')[1]); + + // inout has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + const highlightedItemsLength = getHighLightedItems('', [MimeType.XHR]).length; + + expect(getAllByTestId('sideBarHighlightedItem')).toHaveLength(highlightedItemsLength); + expect(getAllByTestId('sideBarDimmedItem')).toHaveLength( + NETWORK_EVENTS.events.length - highlightedItemsLength + ); + }); + + it('renders sidebar even when filter matches 0 resources', () => { + const { getAllByTestId, getByLabelText, getAllByText, queryAllByTestId } = render( + <WaterfallChartWrapper data={extractItems(NETWORK_EVENTS.events)} total={1000} /> + ); + + const sideBarItems = getAllByTestId('middleTruncatedTextSROnly'); + + expect(sideBarItems).toHaveLength(5); + + fireEvent.click(getByLabelText(FILTER_POPOVER_OPEN_LABEL)); + + fireEvent.click(getAllByText('CSS')[1]); + + // inout has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + const highlightedItemsLength = getHighLightedItems('', [MimeType.Stylesheet]).length; + + // no CSS items found + expect(queryAllByTestId('sideBarHighlightedItem')).toHaveLength(0); + expect(getAllByTestId('sideBarDimmedItem')).toHaveLength( + NETWORK_EVENTS.events.length - highlightedItemsLength + ); + + fireEvent.click(getByLabelText(FILTER_COLLAPSE_REQUESTS_LABEL)); + + // filter bar is still accessible even when no resources match filter + expect(getByLabelText(FILTER_REQUESTS_LABEL)).toBeInTheDocument(); + + // no resources items are in the chart as none match filter + expect(queryAllByTestId('sideBarHighlightedItem')).toHaveLength(0); + expect(queryAllByTestId('sideBarDimmedItem')).toHaveLength(0); + }); + + it('opens flyout on sidebar click and closes on flyout close button', async () => { + const { getByText, getByTestId, queryByText, getByRole } = render( + <WaterfallChartWrapper total={mockNetworkItems.length} data={mockNetworkItems} /> + ); + + expect(getByText(`${mockNetworkItems[0].url}`)).toBeInTheDocument(); + expect(getByText(`1.`)).toBeInTheDocument(); + expect(queryByText('Content type')).not.toBeInTheDocument(); + expect(queryByText(`${mockNetworkItems[0]?.mimeType}`)).not.toBeInTheDocument(); + + // open flyout + // selector matches both button and accessible text. Button is the second element in the array; + const sidebarButton = getByTestId(`middleTruncatedTextButton1`); + fireEvent.click(sidebarButton); + + // check for sample flyout items + await waitFor(() => { + const waterfallFlyout = getByRole('dialog'); + expect(waterfallFlyout).toBeInTheDocument(); + expect(getByText('Content type')).toBeInTheDocument(); + expect(getByText(`${mockNetworkItems[0]?.mimeType}`)).toBeInTheDocument(); + // close flyout + const closeButton = getByTestId('euiFlyoutCloseButton'); + fireEvent.click(closeButton); + }); + + /* check that sample flyout items are gone from the DOM */ + await waitFor(() => { + expect(queryByText('Content type')).not.toBeInTheDocument(); + expect(queryByText(`${mockNetworkItems[0]?.mimeType}`)).not.toBeInTheDocument(); + }); + }); + + it('opens flyout on sidebar click and closes on second sidebar click', async () => { + const { getByText, getByTestId, queryByText } = render( + <WaterfallChartWrapper total={mockNetworkItems.length} data={mockNetworkItems} /> + ); + + expect(getByText(`${mockNetworkItems[0].url}`)).toBeInTheDocument(); + expect(getByText(`1.`)).toBeInTheDocument(); + expect(queryByText('Content type')).not.toBeInTheDocument(); + expect(queryByText(`${mockNetworkItems[0]?.mimeType}`)).not.toBeInTheDocument(); + + // open flyout + // selector matches both button and accessible text. Button is the second element in the array; + const sidebarButton = getByTestId(`middleTruncatedTextButton1`); + fireEvent.click(sidebarButton); + + // check for sample flyout items and that the flyout is focused + await waitFor(() => { + const waterfallFlyout = getByTestId('waterfallFlyout'); + expect(waterfallFlyout).toBeInTheDocument(); + expect(getByText('Content type')).toBeInTheDocument(); + expect(getByText(`${mockNetworkItems[0]?.mimeType}`)).toBeInTheDocument(); + }); + + fireEvent.click(sidebarButton); + + /* check that sample flyout items are gone from the DOM */ + await waitFor(() => { + expect(queryByText('Content type')).not.toBeInTheDocument(); + expect(queryByText(`${mockNetworkItems[0]?.mimeType}`)).not.toBeInTheDocument(); + }); + }); +}); + +const NETWORK_EVENTS = { + events: [ + { + timestamp: '2021-01-21T10:31:21.537Z', + method: 'GET', + url: 'https://apv-static.minute.ly/videos/v-c2a526c7-450d-428e-1244649-a390-fb639ffead96-s45.746-54.421m.mp4', + status: 206, + mimeType: 'video/mp4', + requestSentTime: 241114127.474, + loadEndTime: 241116573.402, + timings: { + total: 2445.928000001004, + queueing: 1.7399999778717756, + blocked: 0.391999987186864, + receive: 2283.964000031119, + connect: 91.5709999972023, + wait: 28.795999998692423, + proxy: -1, + dns: 36.952000024029985, + send: 0.10000000474974513, + ssl: 64.28900000173599, + }, + }, + { + timestamp: '2021-01-21T10:31:22.174Z', + method: 'GET', + url: 'https://dpm.demdex.net/ibs:dpid=73426&dpuuid=31597189268188866891125449924942215949', + status: 200, + mimeType: 'image/gif', + requestSentTime: 241114749.202, + loadEndTime: 241114805.541, + timings: { + queueing: 1.2240000069141388, + receive: 2.218999987235293, + proxy: -1, + dns: -1, + send: 0.14200000441633165, + blocked: 1.033000007737428, + total: 56.33900000248104, + wait: 51.72099999617785, + ssl: -1, + connect: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.679Z', + method: 'GET', + url: 'https://dapi.cms.mlbinfra.com/v2/content/en-us/sel-t119-homepage-mediawall', + status: 200, + mimeType: 'application/json', + requestSentTime: 241114268.04299998, + loadEndTime: 241114665.609, + timings: { + total: 397.5659999996424, + dns: 29.5429999823682, + wait: 221.6830000106711, + queueing: 2.1410000044852495, + connect: 106.95499999565072, + ssl: 69.06899999012239, + receive: 2.027999988058582, + blocked: 0.877000013133511, + send: 23.719999997410923, + proxy: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.740Z', + method: 'GET', + url: 'https://platform.twitter.com/embed/embed.runtime.b313577971db9c857801.js', + status: 200, + mimeType: 'application/javascript', + requestSentTime: 241114303.84899998, + loadEndTime: 241114370.361, + timings: { + send: 1.357000001007691, + wait: 40.12299998430535, + receive: 16.78500001435168, + ssl: -1, + queueing: 2.5670000177342445, + total: 66.51200001942925, + connect: -1, + blocked: 5.680000002030283, + proxy: -1, + dns: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.740Z', + method: 'GET', + url: 'https://platform.twitter.com/embed/embed.modules.7a266e7acfd42f2581a5.js', + status: 200, + mimeType: 'application/javascript', + requestSentTime: 241114305.939, + loadEndTime: 241114938.264, + timings: { + wait: 51.61500000394881, + dns: -1, + ssl: -1, + receive: 506.5750000067055, + proxy: -1, + connect: -1, + blocked: 69.51599998865277, + queueing: 4.453999979887158, + total: 632.324999984121, + send: 0.16500000492669642, + }, + }, + ], +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.tsx new file mode 100644 index 0000000000000..724b06167ca3c --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.tsx @@ -0,0 +1,158 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback, useMemo, useState } from 'react'; +import { EuiHealth } from '@elastic/eui'; +import { useTrackMetric, METRIC_TYPE } from '@kbn/observability-plugin/public'; +import { JourneyStep } from '../../../../../../../../../common/runtime_types'; +import { getSeriesAndDomain, getSidebarItems, getLegendItems } from './data_formatting'; +import { SidebarItem, LegendItem, NetworkItems } from './types'; +import { WaterfallProvider, WaterfallChart, RenderItem, useFlyout } from '../../waterfall'; +import { WaterfallFilter } from './waterfall_filter'; +import { WaterfallFlyout } from './waterfall_flyout'; +import { WaterfallSidebarItem } from './waterfall_sidebar_item'; +import { MarkerItems } from '../../waterfall/context/waterfall_chart'; + +export const renderLegendItem: RenderItem<LegendItem> = (item) => { + return ( + <EuiHealth color={item.colour} className="eui-textNoWrap"> + {item.name} + </EuiHealth> + ); +}; + +interface Props { + total: number; + activeStep?: JourneyStep; + data: NetworkItems; + markerItems?: MarkerItems; +} + +export const WaterfallChartWrapper: React.FC<Props> = ({ + data, + total, + markerItems, + activeStep, +}) => { + const [query, setQuery] = useState<string>(''); + const [activeFilters, setActiveFilters] = useState<string[]>([]); + const [onlyHighlighted, setOnlyHighlighted] = useState(false); + + const [networkData] = useState<NetworkItems>(data); + + const hasFilters = activeFilters.length > 0; + + const { series, domain, metadata, totalHighlightedRequests } = useMemo(() => { + return getSeriesAndDomain(networkData, onlyHighlighted, query, activeFilters); + }, [networkData, query, activeFilters, onlyHighlighted]); + + const sidebarItems = useMemo(() => { + return getSidebarItems(networkData, onlyHighlighted, query, activeFilters); + }, [networkData, query, activeFilters, onlyHighlighted]); + + const legendItems = useMemo(() => { + return getLegendItems(); + }, []); + + const { + flyoutData, + onBarClick, + onProjectionClick, + onSidebarClick, + isFlyoutVisible, + onFlyoutClose, + } = useFlyout(metadata); + + const renderFilter = useCallback(() => { + return ( + <WaterfallFilter + query={query} + setQuery={setQuery} + activeFilters={activeFilters} + setActiveFilters={setActiveFilters} + onlyHighlighted={onlyHighlighted} + setOnlyHighlighted={setOnlyHighlighted} + /> + ); + }, [activeFilters, setActiveFilters, onlyHighlighted, setOnlyHighlighted, query, setQuery]); + + const renderFlyout = useCallback(() => { + return ( + <WaterfallFlyout + flyoutData={flyoutData} + onFlyoutClose={onFlyoutClose} + isFlyoutVisible={isFlyoutVisible} + /> + ); + }, [flyoutData, isFlyoutVisible, onFlyoutClose]); + + const highestSideBarIndex = Math.max(...series.map((sr) => sr.x)); + + const renderSidebarItem: RenderItem<SidebarItem> = useCallback( + (item) => { + return ( + <WaterfallSidebarItem + item={item} + renderFilterScreenReaderText={hasFilters && !onlyHighlighted} + onClick={onSidebarClick} + highestIndex={highestSideBarIndex} + /> + ); + }, + [hasFilters, onlyHighlighted, onSidebarClick, highestSideBarIndex] + ); + + useTrackMetric({ app: 'uptime', metric: 'waterfall_chart_view', metricType: METRIC_TYPE.COUNT }); + useTrackMetric({ + app: 'uptime', + metric: 'waterfall_chart_view', + metricType: METRIC_TYPE.COUNT, + delay: 15000, + }); + + return ( + <WaterfallProvider + activeStep={activeStep} + markerItems={markerItems} + totalNetworkRequests={total} + fetchedNetworkRequests={networkData.length} + highlightedNetworkRequests={totalHighlightedRequests} + data={series} + onElementClick={useCallback(onBarClick, [onBarClick])} + onProjectionClick={useCallback(onProjectionClick, [onProjectionClick])} + onSidebarClick={onSidebarClick} + showOnlyHighlightedNetworkRequests={onlyHighlighted} + sidebarItems={sidebarItems} + legendItems={legendItems} + metadata={metadata} + renderTooltipItem={useCallback((tooltipProps) => { + return <EuiHealth color={String(tooltipProps?.colour)}>{tooltipProps?.value}</EuiHealth>; + }, [])} + > + <WaterfallChart + tickFormat={useCallback((d: number) => `${Number(d).toFixed(0)} ms`, [])} + domain={domain} + barStyleAccessor={useCallback(({ datum }) => { + if (!datum.config?.isHighlighted) { + return { + rect: { + fill: datum.config?.colour, + opacity: '0.1', + }, + }; + } + return datum.config.colour; + }, [])} + renderSidebarItem={renderSidebarItem} + renderLegendItem={renderLegendItem} + renderFlyout={renderFlyout} + renderFilter={renderFilter} + fullHeight={true} + /> + </WaterfallProvider> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.test.tsx new file mode 100644 index 0000000000000..0a85cf4d13bc3 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.test.tsx @@ -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 React, { useState } from 'react'; +import { act, fireEvent } from '@testing-library/react'; +import 'jest-canvas-mock'; +import { MIME_FILTERS, WaterfallFilter } from './waterfall_filter'; +import { + FILTER_REQUESTS_LABEL, + FILTER_COLLAPSE_REQUESTS_LABEL, + FILTER_POPOVER_OPEN_LABEL, +} from '../../waterfall/components/translations'; +import { render } from '../../../../../../utils/testing'; + +describe('waterfall filter', () => { + jest.useFakeTimers(); + + it('renders correctly', () => { + const { getByLabelText, getByTitle } = render( + <WaterfallFilter + query={''} + setQuery={jest.fn()} + activeFilters={[]} + onlyHighlighted={false} + setActiveFilters={jest.fn()} + setOnlyHighlighted={jest.fn()} + /> + ); + + fireEvent.click(getByLabelText(FILTER_POPOVER_OPEN_LABEL)); + + MIME_FILTERS.forEach((filter) => { + expect(getByTitle(filter.label)); + }); + }); + + it('filter icon changes color on active/inactive filters', () => { + const Component = () => { + const [activeFilters, setActiveFilters] = useState<string[]>([]); + + return ( + <WaterfallFilter + query={''} + setQuery={jest.fn()} + activeFilters={activeFilters} + onlyHighlighted={false} + setActiveFilters={setActiveFilters} + setOnlyHighlighted={jest.fn()} + /> + ); + }; + const { getByLabelText, getByTitle } = render(<Component />); + + fireEvent.click(getByLabelText(FILTER_POPOVER_OPEN_LABEL)); + + fireEvent.click(getByTitle('XHR')); + + expect(getByLabelText(FILTER_POPOVER_OPEN_LABEL)).toHaveAttribute( + 'class', + 'euiButtonIcon euiButtonIcon--primary euiButtonIcon--empty euiButtonIcon--xSmall' + ); + + // toggle it back to inactive + fireEvent.click(getByTitle('XHR')); + + expect(getByLabelText(FILTER_POPOVER_OPEN_LABEL)).toHaveAttribute( + 'class', + 'euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall' + ); + }); + + it('search input is working properly', () => { + const setQuery = jest.fn(); + + const Component = () => { + return ( + <WaterfallFilter + query={''} + setQuery={setQuery} + activeFilters={[]} + onlyHighlighted={false} + setActiveFilters={jest.fn()} + setOnlyHighlighted={jest.fn()} + /> + ); + }; + const { getByLabelText } = render(<Component />); + + const testText = 'js'; + + fireEvent.change(getByLabelText(FILTER_REQUESTS_LABEL), { target: { value: testText } }); + + // inout has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + expect(setQuery).toHaveBeenCalledWith(testText); + }); + + it('resets checkbox when filters are removed', () => { + const Component = () => { + const [onlyHighlighted, setOnlyHighlighted] = useState<boolean>(false); + const [query, setQuery] = useState<string>(''); + const [activeFilters, setActiveFilters] = useState<string[]>([]); + return ( + <WaterfallFilter + query={query} + setQuery={setQuery} + activeFilters={activeFilters} + onlyHighlighted={onlyHighlighted} + setActiveFilters={setActiveFilters} + setOnlyHighlighted={setOnlyHighlighted} + /> + ); + }; + const { getByLabelText, getByTitle } = render(<Component />); + const input = getByLabelText(FILTER_REQUESTS_LABEL); + // apply filters + const testText = 'js'; + fireEvent.change(input, { target: { value: testText } }); + fireEvent.click(getByLabelText(FILTER_POPOVER_OPEN_LABEL)); + const filterGroupButton = getByTitle('XHR'); + fireEvent.click(filterGroupButton); + + // input has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + const collapseCheckbox = getByLabelText(FILTER_COLLAPSE_REQUESTS_LABEL) as HTMLInputElement; + expect(collapseCheckbox).not.toBeDisabled(); + fireEvent.click(collapseCheckbox); + expect(collapseCheckbox).toBeChecked(); + + // remove filters + fireEvent.change(input, { target: { value: '' } }); + fireEvent.click(filterGroupButton); + + // input has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + // expect the checkbox to reset to disabled and unchecked + expect(collapseCheckbox).not.toBeChecked(); + expect(collapseCheckbox).toBeDisabled(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.tsx new file mode 100644 index 0000000000000..5531dafd4542b --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.tsx @@ -0,0 +1,192 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, { Dispatch, SetStateAction, useEffect, useState } from 'react'; +import { + EuiButtonIcon, + EuiCheckbox, + EuiFieldSearch, + EuiFilterButton, + EuiFilterGroup, + EuiFlexGroup, + EuiFlexItem, + EuiPopover, + EuiSpacer, +} from '@elastic/eui'; +import useDebounce from 'react-use/lib/useDebounce'; +import { METRIC_TYPE, useUiTracker } from '@kbn/observability-plugin/public'; +import { + FILTER_REQUESTS_LABEL, + FILTER_SCREENREADER_LABEL, + FILTER_REMOVE_SCREENREADER_LABEL, + FILTER_POPOVER_OPEN_LABEL, + FILTER_COLLAPSE_REQUESTS_LABEL, +} from '../../waterfall/components/translations'; +import { MimeType, FriendlyMimetypeLabels } from './types'; + +interface Props { + query: string; + activeFilters: string[]; + setActiveFilters: Dispatch<SetStateAction<string[]>>; + setQuery: (val: string) => void; + onlyHighlighted: boolean; + setOnlyHighlighted: (val: boolean) => void; +} + +export const MIME_FILTERS = [ + { + label: FriendlyMimetypeLabels[MimeType.XHR], + mimeType: MimeType.XHR, + }, + { + label: FriendlyMimetypeLabels[MimeType.Html], + mimeType: MimeType.Html, + }, + { + label: FriendlyMimetypeLabels[MimeType.Script], + mimeType: MimeType.Script, + }, + { + label: FriendlyMimetypeLabels[MimeType.Stylesheet], + mimeType: MimeType.Stylesheet, + }, + { + label: FriendlyMimetypeLabels[MimeType.Font], + mimeType: MimeType.Font, + }, + { + label: FriendlyMimetypeLabels[MimeType.Media], + mimeType: MimeType.Media, + }, + { + label: FriendlyMimetypeLabels[MimeType.Other], + mimeType: MimeType.Other, + }, +]; + +export const WaterfallFilter = ({ + query, + setQuery, + activeFilters, + setActiveFilters, + onlyHighlighted, + setOnlyHighlighted, +}: Props) => { + const [value, setValue] = useState(query); + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + + const trackMetric = useUiTracker({ app: 'uptime' }); + + const toggleFilters = (val: string) => { + setActiveFilters((prevState) => + prevState.includes(val) ? prevState.filter((filter) => filter !== val) : [...prevState, val] + ); + }; + useDebounce( + () => { + setQuery(value); + }, + 250, + [value] + ); + + /* reset checkbox when there is no query or active filters + * this prevents the checkbox from being checked in a disabled state */ + useEffect(() => { + if (!(query || activeFilters.length > 0)) { + setOnlyHighlighted(false); + } + }, [activeFilters.length, setOnlyHighlighted, query]); + + // indicates use of the query input box + useEffect(() => { + if (query) { + trackMetric({ metric: 'waterfall_filter_input_changed', metricType: METRIC_TYPE.CLICK }); + } + }, [query, trackMetric]); + + // indicates the collapse to show only highlighted checkbox has been clicked + useEffect(() => { + if (onlyHighlighted) { + trackMetric({ + metric: 'waterfall_filter_collapse_checked', + metricType: METRIC_TYPE.CLICK, + }); + } + }, [onlyHighlighted, trackMetric]); + + // indicates filters have been applied or changed + useEffect(() => { + if (activeFilters.length > 0) { + trackMetric({ + metric: `waterfall_filters_applied_changed`, + metricType: METRIC_TYPE.CLICK, + }); + } + }, [activeFilters, trackMetric]); + + return ( + <EuiFlexGroup gutterSize="xs" alignItems="center"> + <EuiFlexItem> + <EuiFieldSearch + fullWidth + aria-label={FILTER_REQUESTS_LABEL} + placeholder={FILTER_REQUESTS_LABEL} + onChange={(evt) => { + setValue(evt.target.value); + }} + value={value} + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiPopover + button={ + <EuiButtonIcon + aria-label={FILTER_POPOVER_OPEN_LABEL} + iconType="filter" + onClick={() => setIsPopoverOpen((prevState) => !prevState)} + color={activeFilters.length > 0 ? 'primary' : 'text'} + isSelected={activeFilters.length > 0} + /> + } + isOpen={isPopoverOpen} + closePopover={() => setIsPopoverOpen(false)} + anchorPosition="rightCenter" + > + <EuiFilterGroup> + {MIME_FILTERS.map(({ label, mimeType }) => ( + <EuiFilterButton + hasActiveFilters={activeFilters.includes(mimeType)} + onClick={() => toggleFilters(mimeType)} + key={label} + withNext={true} + aria-label={`${ + activeFilters.includes(mimeType) + ? FILTER_REMOVE_SCREENREADER_LABEL + : FILTER_SCREENREADER_LABEL + } ${label}`} + > + {label} + </EuiFilterButton> + ))} + </EuiFilterGroup> + <EuiSpacer size="xs" /> + <EuiCheckbox + compressed={true} + disabled={!(query || activeFilters.length > 0)} + id="onlyHighlighted" + label={FILTER_COLLAPSE_REQUESTS_LABEL} + checked={onlyHighlighted} + onChange={(e) => { + setOnlyHighlighted(e.target.checked); + }} + /> + </EuiPopover> + </EuiFlexItem> + </EuiFlexGroup> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.test.tsx new file mode 100644 index 0000000000000..278ac92bd915b --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.test.tsx @@ -0,0 +1,139 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { + WaterfallFlyout, + DETAILS, + CERTIFICATES, + REQUEST_HEADERS, + RESPONSE_HEADERS, +} from './waterfall_flyout'; +import { WaterfallMetadataEntry } from '../../waterfall/types'; +import { render } from '../../../../../../utils/testing'; + +describe('WaterfallFlyout', () => { + const flyoutData: WaterfallMetadataEntry = { + x: 0, + url: 'http://elastic.co', + requestHeaders: undefined, + responseHeaders: undefined, + certificates: undefined, + details: [ + { + name: 'Content type', + value: 'text/html', + }, + ], + }; + + const defaultProps = { + flyoutData, + isFlyoutVisible: true, + onFlyoutClose: () => null, + }; + + it('displays flyout information and omits sections that are undefined', () => { + const { getByText, queryByText } = render(<WaterfallFlyout {...defaultProps} />); + + expect(getByText(flyoutData.url)).toBeInTheDocument(); + expect(queryByText(DETAILS)).toBeInTheDocument(); + flyoutData.details.forEach((detail) => { + expect(getByText(detail.name)).toBeInTheDocument(); + expect(getByText(`${detail.value}`)).toBeInTheDocument(); + }); + + expect(queryByText(CERTIFICATES)).not.toBeInTheDocument(); + expect(queryByText(REQUEST_HEADERS)).not.toBeInTheDocument(); + expect(queryByText(RESPONSE_HEADERS)).not.toBeInTheDocument(); + }); + + it('displays flyout certificates information', () => { + const certificates = [ + { + name: 'Issuer', + value: 'Sample Issuer', + }, + { + name: 'Valid From', + value: 'January 1, 2020 7:00PM', + }, + { + name: 'Valid Until', + value: 'January 31, 2020 7:00PM', + }, + { + name: 'Common Name', + value: '*.elastic.co', + }, + ]; + const flyoutDataWithCertificates = { + ...flyoutData, + certificates, + }; + + const { getByText } = render( + <WaterfallFlyout {...defaultProps} flyoutData={flyoutDataWithCertificates} /> + ); + + expect(getByText(flyoutData.url)).toBeInTheDocument(); + expect(getByText(DETAILS)).toBeInTheDocument(); + expect(getByText(CERTIFICATES)).toBeInTheDocument(); + flyoutData.certificates?.forEach((detail) => { + expect(getByText(detail.name)).toBeInTheDocument(); + expect(getByText(`${detail.value}`)).toBeInTheDocument(); + }); + }); + + it('displays flyout request and response headers information', () => { + const requestHeaders = [ + { + name: 'sample_request_header', + value: 'Sample Request Header value', + }, + ]; + const responseHeaders = [ + { + name: 'sample_response_header', + value: 'sample response header value', + }, + ]; + const flyoutDataWithHeaders = { + ...flyoutData, + requestHeaders, + responseHeaders, + }; + const { getByText } = render( + <WaterfallFlyout {...defaultProps} flyoutData={flyoutDataWithHeaders} /> + ); + + expect(getByText(flyoutData.url)).toBeInTheDocument(); + expect(getByText(DETAILS)).toBeInTheDocument(); + expect(getByText(REQUEST_HEADERS)).toBeInTheDocument(); + expect(getByText(RESPONSE_HEADERS)).toBeInTheDocument(); + flyoutData.requestHeaders?.forEach((detail) => { + expect(getByText(detail.name)).toBeInTheDocument(); + expect(getByText(`${detail.value}`)).toBeInTheDocument(); + }); + flyoutData.responseHeaders?.forEach((detail) => { + expect(getByText(detail.name)).toBeInTheDocument(); + expect(getByText(`${detail.value}`)).toBeInTheDocument(); + }); + }); + + it('renders null when isFlyoutVisible is false', () => { + const { queryByText } = render(<WaterfallFlyout {...defaultProps} isFlyoutVisible={false} />); + + expect(queryByText(flyoutData.url)).not.toBeInTheDocument(); + }); + + it('renders null when flyoutData is undefined', () => { + const { queryByText } = render(<WaterfallFlyout {...defaultProps} flyoutData={undefined} />); + + expect(queryByText(flyoutData.url)).not.toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.tsx new file mode 100644 index 0000000000000..4c78010e9c4e6 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.tsx @@ -0,0 +1,131 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect, useRef } from 'react'; + +import styled from 'styled-components'; + +import { + EuiFlyout, + EuiFlyoutHeader, + EuiFlyoutBody, + EuiTitle, + EuiSpacer, + EuiFlexItem, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { METRIC_TYPE, useUiTracker } from '@kbn/observability-plugin/public'; +import { Table } from '../../waterfall/components/waterfall_flyout_table'; +import { MiddleTruncatedText } from '../../waterfall'; +import { WaterfallMetadataEntry } from '../../waterfall/types'; +import { OnFlyoutClose } from '../../waterfall/components/use_flyout'; + +export const DETAILS = i18n.translate('xpack.synthetics.synthetics.waterfall.flyout.details', { + defaultMessage: 'Details', +}); + +export const CERTIFICATES = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.flyout.certificates', + { + defaultMessage: 'Certificate headers', + } +); + +export const REQUEST_HEADERS = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.flyout.requestHeaders', + { + defaultMessage: 'Request headers', + } +); + +export const RESPONSE_HEADERS = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.flyout.responseHeaders', + { + defaultMessage: 'Response headers', + } +); + +const FlyoutContainer = styled(EuiFlyout)` + z-index: ${(props) => props.theme.eui.euiZLevel5}; +`; + +export interface WaterfallFlyoutProps { + flyoutData?: WaterfallMetadataEntry; + onFlyoutClose: OnFlyoutClose; + isFlyoutVisible?: boolean; +} + +export const WaterfallFlyout = ({ + flyoutData, + isFlyoutVisible, + onFlyoutClose, +}: WaterfallFlyoutProps) => { + const flyoutRef = useRef<HTMLDivElement>(null); + const trackMetric = useUiTracker({ app: 'uptime' }); + + useEffect(() => { + if (isFlyoutVisible && flyoutData && flyoutRef.current) { + flyoutRef.current?.focus(); + } + }, [flyoutData, isFlyoutVisible, flyoutRef]); + + if (!flyoutData || !isFlyoutVisible) { + return null; + } + + const { x, url, details, certificates, requestHeaders, responseHeaders } = flyoutData; + + trackMetric({ metric: 'waterfall_flyout', metricType: METRIC_TYPE.CLICK }); + + return ( + <div + tab-index={-1} + ref={flyoutRef} + data-test-subj="waterfallFlyout" + aria-labelledby="flyoutTitle" + > + <FlyoutContainer size="s" onClose={onFlyoutClose}> + <EuiFlyoutHeader hasBorder> + <EuiTitle size="s"> + <h2 id="flyoutTitle"> + <EuiFlexItem> + <MiddleTruncatedText + index={x + 1} + text={url} + url={url} + ariaLabel={url} + highestIndex={x + 1} + /> + </EuiFlexItem> + </h2> + </EuiTitle> + </EuiFlyoutHeader> + <EuiFlyoutBody> + <Table rows={details} title={DETAILS} /> + {!!requestHeaders && ( + <> + <EuiSpacer size="m" /> + <Table rows={requestHeaders} title={REQUEST_HEADERS} /> + </> + )} + {!!responseHeaders && ( + <> + <EuiSpacer size="m" /> + <Table rows={responseHeaders} title={RESPONSE_HEADERS} /> + </> + )} + {!!certificates && ( + <> + <EuiSpacer size="m" /> + <Table rows={certificates} title={CERTIFICATES} /> + </> + )} + </EuiFlyoutBody> + </FlyoutContainer> + </div> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.test.tsx new file mode 100644 index 0000000000000..c9fbcd2244252 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.test.tsx @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import 'jest-canvas-mock'; +import { fireEvent } from '@testing-library/react'; + +import { SidebarItem } from './types'; +import { WaterfallSidebarItem } from './waterfall_sidebar_item'; +import { SIDEBAR_FILTER_MATCHES_SCREENREADER_LABEL } from '../../waterfall/components/translations'; +import { getChunks } from '../../waterfall/components/middle_truncated_text'; +import { render } from '../../../../../../utils/testing'; + +describe('waterfall filter', () => { + const url = 'http://www.elastic.co/observability/uptime'; + const index = 0; + const offsetIndex = index + 1; + const item: SidebarItem = { + url, + isHighlighted: true, + index, + offsetIndex, + }; + + it('renders sidebar item', () => { + const { getByText } = render(<WaterfallSidebarItem item={item} highestIndex={10} />); + + const chunks = getChunks(url.replace('http://www.', '')); + + expect(getByText(`${offsetIndex}. ${chunks.first}`)); + expect(getByText(`${chunks.last}`)); + }); + + it('render screen reader text when renderFilterScreenReaderText is true', () => { + const { getByLabelText } = render( + <WaterfallSidebarItem item={item} renderFilterScreenReaderText={true} highestIndex={10} /> + ); + + expect( + getByLabelText(`${SIDEBAR_FILTER_MATCHES_SCREENREADER_LABEL} ${url}`) + ).toBeInTheDocument(); + }); + + it('does not render screen reader text when renderFilterScreenReaderText is false', () => { + const onClick = jest.fn(); + const { getByRole } = render( + <WaterfallSidebarItem + item={item} + renderFilterScreenReaderText={false} + onClick={onClick} + highestIndex={10} + /> + ); + const button = getByRole('button'); + fireEvent.click(button); + + expect(button).toBeInTheDocument(); + expect(onClick).toBeCalled(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.tsx new file mode 100644 index 0000000000000..193fe33121636 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.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, { RefObject, useMemo, useCallback, useState } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiBadge } from '@elastic/eui'; +import { SidebarItem } from './types'; +import { MiddleTruncatedText } from '../../waterfall'; +import { SideBarItemHighlighter } from '../../waterfall/components/styles'; +import { SIDEBAR_FILTER_MATCHES_SCREENREADER_LABEL } from '../../waterfall/components/translations'; +import { OnSidebarClick } from '../../waterfall/components/use_flyout'; + +interface SidebarItemProps { + item: SidebarItem; + renderFilterScreenReaderText?: boolean; + onClick?: OnSidebarClick; + highestIndex: number; +} + +export const WaterfallSidebarItem = ({ + item, + highestIndex, + renderFilterScreenReaderText, + onClick, +}: SidebarItemProps) => { + const [buttonRef, setButtonRef] = useState<RefObject<HTMLButtonElement | null>>(); + const { status, offsetIndex, index, isHighlighted, url } = item; + + const handleSidebarClick = useMemo(() => { + if (onClick) { + return () => onClick({ buttonRef, networkItemIndex: index }); + } + }, [buttonRef, index, onClick]); + + const setRef = useCallback((ref) => setButtonRef(ref), [setButtonRef]); + + const isErrorStatusCode = (statusCode: number) => { + const is400 = statusCode >= 400 && statusCode <= 499; + const is500 = statusCode >= 500 && statusCode <= 599; + const isSpecific300 = statusCode === 301 || statusCode === 307 || statusCode === 308; + return is400 || is500 || isSpecific300; + }; + + const text = item.url; + + const ariaLabel = `${ + isHighlighted && renderFilterScreenReaderText + ? `${SIDEBAR_FILTER_MATCHES_SCREENREADER_LABEL} ` + : '' + }${text}`; + + return ( + <SideBarItemHighlighter + isHighlighted={isHighlighted} + data-test-subj={isHighlighted ? 'sideBarHighlightedItem' : 'sideBarDimmedItem'} + > + {!status || !isErrorStatusCode(status) ? ( + <EuiFlexGroup> + <EuiFlexItem grow={false} style={{ minWidth: 0 }}> + <MiddleTruncatedText + index={offsetIndex} + text={text} + url={url} + ariaLabel={ariaLabel} + onClick={handleSidebarClick} + setButtonRef={setRef} + highestIndex={highestIndex} + /> + </EuiFlexItem> + </EuiFlexGroup> + ) : ( + <EuiFlexGroup justifyContent="spaceBetween" alignItems="center"> + <EuiFlexItem grow={false} style={{ minWidth: 0 }}> + <MiddleTruncatedText + index={offsetIndex} + text={text} + url={url} + ariaLabel={ariaLabel} + onClick={handleSidebarClick} + setButtonRef={setRef} + highestIndex={highestIndex} + /> + </EuiFlexItem> + <EuiFlexItem component="span" grow={false}> + <EuiBadge color="danger">{status}</EuiBadge> + </EuiFlexItem> + </EuiFlexGroup> + )} + </SideBarItemHighlighter> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/translations.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/translations.ts new file mode 100644 index 0000000000000..cf7ab30c8867d --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/translations.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const VIEW_PERFORMANCE = i18n.translate( + 'xpack.synthetics.pingList.synthetics.performanceBreakDown', + { + defaultMessage: 'View performance breakdown', + } +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/README.md b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/README.md new file mode 100644 index 0000000000000..cf8d3b5345eaa --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/README.md @@ -0,0 +1,123 @@ +# Waterfall chart + +## Introduction + +The waterfall chart component aims to be agnostic in it's approach, so that a variety of consumers / solutions can use it. Some of Elastic Chart's features are used in a non-standard way to facilitate this flexibility, this README aims to cover some of the things that might be less obvious, and also provides a high level overview of implementation. + +## Requirements for usage + +The waterfall chart component asssumes that the consumer is making use of `KibanaReactContext`, and as such things like `useKibana` can be called. + +Consumers are also expected to be using the `<EuiThemeProvider />` so that the waterfall chart can apply styled-component styles based on the EUI theme. + +These are the two hard requirements, but almost all plugins will be using these. + +## Rendering + +At it's core the watefall chart is a stacked bar chart that has been rotated through 90 degrees. As such it's important to understand that `x` is now represented as `y` and vice versa. + +## Flexibility + +This section aims to cover some things that are non-standard. + +### Tooltip + +By default the formatting of tooltip values is very basic, but for a waterfall chart there needs to be a great deal of flexibility to represent whatever breakdown you're trying to show. + +As such a custom tooltip component is used. This custom component would usually only have access to some basic props that pertain to the values of the hovered bar. The waterfall chart component extends this by making us of a waterfall chart context. + +The custom tooltip component can use the context to access the full set of chart data, find the relevant items (those with the same `x` value) and call a custom `renderTooltipItem` for each item, `renderTooltipItem` will be passed `item.config.tooltipProps`. Every consumer can choose what they use for their `tooltipProps`. + +Some consumers might need colours, some might need iconography and so on. The waterfall chart doesn't make assumptions, and will render out the React content returned by `renderTooltipItem`. + +IMPORTANT: `renderTooltipItem` is provided via context and not as a direct prop due to the fact the custom tooltip component would usually only have access to the props provided directly to it from Elastic Charts. + +### Colours + +The easiest way to facilitate specific colours for each stack (let's say your colours are mapped to a constraint like mime type) is to assign the colour directly on your datum `config` property, and then access this directly in the `barStyleAccessor` function, e.g. + +``` +barStyleAccessor={(datum) => { + return datum.datum.config.colour; +}) +``` + +### Config + +The notion of `config` has been mentioned already. But this is a place that consumers can store their solution specific properties. `renderTooltipItem` will make use of `config.tooltipProps`, and `barStyleAccessor` can make use of anything on `config`. + +### Sticky top axis + +By default there is no "sticky" axis functionality in Elastic Charts, therefore a second chart is rendered, this contains a replica of the top axis, and renders one empty data point (as a chart can't only have an axis). This second chart is then positioned in such a way that it covers the top of the real axis, and remains fixed. + +## Data + +The waterfall chart expects data in a relatively simple format, there are the usual plot properties (`x`, `y0`, and `y`) and then `config`. E.g. + +``` +const series = [ + {x: 0, y: 0, y: 100, config: { tooltipProps: { type: 'dns' }}}, + {x: 0, y0: 300, y: 500, config: { tooltipProps: { type: 'ssl' }}}, + {x: 1, y0: 250, y: 300, config: { tooltipProps: { propA: 'somethingBreakdownRelated' }}}, + {x: 1, y0: 500, y: 600, config: { tooltipProps: { propA: 'anotherBreakdown' }}}, +] +``` + +Gaps in bars are fine, and to be expected for certain solutions. + +## Sidebar items + +The waterfall chart component again doesn't make assumptions about consumer's sidebar items' content, but the waterfall chart does handle the rendering so the sidebar can be aligned and rendered properly alongside the chart itself. + +`sidebarItems` should be provided to the context, and a `renderSidebarItem` prop should be provided to the chart. + +A sidebar is optional. + +There is a great deal of flexibility here so that solutions can make use of this in the way they need. For example, if you'd like to add a toggle functionality, so that clicking an item shows / hides it's children, this would involve rendering your toggle in `renderSidebarItem` and then when clicked you can handle adjusting your data as necessary. + +IMPORTANT: It is important to understand that the chart itself makes use of a fixed height. The sidebar will create a space that has a matching height. Each item is assigned equal space vertically via Flexbox, so that the items align with the relevant bar to the right (these are two totally different rendering contexts, with the chart itself sitting within a `canvas` element). So it's important that whatever content you choose to render here doesn't exceed the available height available to each item. The chart's height is calculated as `numberOfBars * 32`, so content should be kept within that `32px` threshold. + +## Legend items + +Much the same as with the sidebar items, no assumptions are made here, solutions will have different aims. + +`legendItems` should be provided to the context, and a `renderLegendItem` prop should be provided to the chart. + +A legend is optional. + +## Overall usage + +Pulling all of this together, things look like this (for a specific solution): + +``` +const renderSidebarItem: RenderItem<SidebarItem> = (item, index) => { + return <MiddleTruncatedText text={`${index + 1}. ${item.url}`} />; +}; + +const renderLegendItem: RenderItem<LegendItem> = (item) => { + return <EuiHealth color={item.colour}>{item.name}</EuiHealth>; +}; + +<WaterfallProvider + data={series} + sidebarItems={sidebarItems} + legendItems={legendItems} + renderTooltipItem={(tooltipProps) => { + return <EuiHealth color={String(tooltipProps.colour)}>{tooltipProps.value}</EuiHealth>; + }} +> + <WaterfallChart + tickFormat={(d: number) => `${Number(d).toFixed(0)} ms`} + domain={{ min: domain.min, max: domain.max }} + barStyleAccessor={(datum) => { + return datum.datum.config.colour; + }} + renderSidebarItem={renderSidebarItem} + renderLegendItem={renderLegendItem} + /> +</WaterfallProvider> +``` + +A solution could easily forego a sidebar and legend for a more minimalistic view, e.g. maybe a mini waterfall within a table column. + + diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/constants.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/constants.ts new file mode 100644 index 0000000000000..d36cb025f3c2b --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/constants.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. + */ + +// Pixel value +export const BAR_HEIGHT = 24; +// Flex grow value +export const MAIN_GROW_SIZE = 8; +// Flex grow value +export const SIDEBAR_GROW_SIZE = 2; +// Axis height +// NOTE: This isn't a perfect solution - changes in font size etc within charts could change the ideal height here. +export const FIXED_AXIS_HEIGHT = 24; + +// number of items to display in canvas, since canvas can only have limited size +export const CANVAS_MAX_ITEMS = 150; + +export const CHART_LEGEND_PADDING = 33; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/legend.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/legend.tsx new file mode 100644 index 0000000000000..3fdfe2c65f0ad --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/legend.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 { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { IWaterfallContext } from '../context/waterfall_chart'; +import { WaterfallChartProps } from './waterfall_chart'; + +interface LegendProps { + items: Required<IWaterfallContext>['legendItems']; + render: Required<WaterfallChartProps>['renderLegendItem']; +} + +const StyledFlexItem = euiStyled(EuiFlexItem)` + margin-right: ${(props) => props.theme.eui.euiSizeM}; + max-width: 7%; + min-width: 160px; +`; + +export const Legend: React.FC<LegendProps> = ({ items, render }) => { + return ( + <EuiFlexGroup gutterSize="s" wrap> + {items.map((item, index) => ( + <StyledFlexItem key={index}>{render(item, index)}</StyledFlexItem> + ))} + </EuiFlexGroup> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.test.tsx new file mode 100644 index 0000000000000..707a561043b4f --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.test.tsx @@ -0,0 +1,99 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { within, fireEvent, waitFor } from '@testing-library/react'; +import { getChunks, MiddleTruncatedText } from './middle_truncated_text'; +import { render } from '../../../../../../utils/testing'; + +const longString = + 'this-is-a-really-really-really-really-really-really-really-really-long-string.madeup.extension'; +const first = 'this-is-a-really-really-really-really-really-really-really-really-long-string.made'; +const last = 'up.extension'; + +describe('getChunks', () => { + it('Calculates chunks correctly', () => { + const result = getChunks(longString); + expect(result).toEqual({ + first, + last, + }); + }); +}); + +describe('Component', () => { + const url = 'http://www.elastic.co'; + it('renders truncated text and aria label', () => { + const { getByText, getByLabelText } = render( + <MiddleTruncatedText + index={1} + text={longString} + ariaLabel={longString} + url={url} + onClick={jest.fn()} + highestIndex={10} + /> + ); + + expect(getByText(first)).toBeInTheDocument(); + expect(getByText(last)).toBeInTheDocument(); + + expect(getByLabelText(longString)).toBeInTheDocument(); + }); + + it('renders screen reader only text', () => { + const { getByTestId } = render( + <MiddleTruncatedText + index={1} + text={longString} + ariaLabel={longString} + url={url} + highestIndex={10} + /> + ); + + const { getByText } = within(getByTestId('middleTruncatedTextSROnly')); + + expect(getByText(longString)).toBeInTheDocument(); + }); + + it('renders external link', () => { + const { getByText } = render( + <MiddleTruncatedText + index={1} + text={longString} + ariaLabel={longString} + url={url} + highestIndex={10} + /> + ); + const link = getByText('Open resource in new tab').closest('a'); + + expect(link).toHaveAttribute('href', url); + expect(link).toHaveAttribute('target', '_blank'); + }); + + it('renders a button when onClick function is passed', async () => { + const handleClick = jest.fn(); + const { getByTestId } = render( + <MiddleTruncatedText + index={1} + text={longString} + ariaLabel={longString} + url={url} + onClick={handleClick} + highestIndex={10} + /> + ); + const button = getByTestId('middleTruncatedTextButton1'); + fireEvent.click(button); + + await waitFor(() => { + expect(handleClick).toBeCalled(); + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.tsx new file mode 100644 index 0000000000000..7da52b2ce9bc2 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.tsx @@ -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 React, { useMemo } from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + EuiButtonEmpty, + EuiScreenReaderOnly, + EuiToolTip, + EuiLink, + EuiText, + EuiIcon, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { WaterfallTooltipContent } from './waterfall_tooltip_content'; +import { WaterfallChartTooltip } from './styles'; +import { FIXED_AXIS_HEIGHT } from './constants'; +import { formatTooltipHeading } from '../../step_detail/waterfall/data_formatting'; + +interface Props { + index: number; + highestIndex: number; + ariaLabel: string; + text: string; + onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; + setButtonRef?: (ref: HTMLButtonElement | HTMLAnchorElement | null) => void; + url: string; +} + +const OuterContainer = euiStyled.span` + position: relative; + display: inline-flex; + align-items: center; + .euiToolTipAnchor { + min-width: 0; + } +`; // NOTE: min-width: 0 ensures flexbox and no-wrap children can co-exist + +const InnerContainer = euiStyled.span` + overflow: hidden; + display: flex; + align-items: center; +`; + +const IndexNumber = euiStyled(EuiText)` + font-family: ${(props) => props.theme.eui.euiCodeFontFamily}; + margin-right: ${(props) => props.theme.eui.euiSizeXS}; + line-height: ${FIXED_AXIS_HEIGHT}px; + text-align: right; + background-color: ${(props) => props.theme.eui.euiColorLightestShade}; +`; + +const FirstChunk = euiStyled.span` + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + line-height: ${FIXED_AXIS_HEIGHT}px; + text-align: left; +`; // safari doesn't auto align text left in some cases + +const LastChunk = euiStyled.span` + flex-shrink: 0; + line-height: ${FIXED_AXIS_HEIGHT}px; + text-align: left; +`; // safari doesn't auto align text left in some cases + +const StyledButton = euiStyled(EuiButtonEmpty)` + &&& { + border: none; + + .euiButtonContent { + display: inline-block; + padding: 0; + } + } +`; + +const SecureIcon = euiStyled(EuiIcon)` + margin-right: ${(props) => props.theme.eui.euiSizeXS}; +`; + +export const getChunks = (text: string = '') => { + const END_CHARS = 12; + const chars = text.split(''); + const splitPoint = chars.length - END_CHARS > 0 ? chars.length - END_CHARS : null; + const endChars = splitPoint ? chars.splice(splitPoint) : []; + return { first: chars.join(''), last: endChars.join('') }; +}; + +// Helper component for adding middle text truncation, e.g. +// really-really-really-long....ompressed.js +// Can be used to accomodate content in sidebar item rendering. +export const MiddleTruncatedText = ({ + index, + ariaLabel, + text: fullText, + onClick, + setButtonRef, + url, + highestIndex, +}: Props) => { + const secureHttps = fullText.startsWith('https://'); + const text = fullText.replace(/https:\/\/www.|http:\/\/www.|http:\/\/|https:\/\//, ''); + + const chunks = useMemo(() => { + return getChunks(text); + }, [text]); + + return ( + <OuterContainer aria-label={ariaLabel} data-test-subj="middleTruncatedTextContainer"> + <EuiScreenReaderOnly> + <span data-test-subj="middleTruncatedTextSROnly">{fullText}</span> + </EuiScreenReaderOnly> + <WaterfallChartTooltip + as={EuiToolTip} + content={ + <WaterfallTooltipContent {...{ text: formatTooltipHeading(index, fullText), url }} /> + } + data-test-subj="middleTruncatedTextToolTip" + delay="long" + position="top" + > + <> + {onClick ? ( + <StyledButton + onClick={onClick} + data-test-subj={`middleTruncatedTextButton${index}`} + buttonRef={setButtonRef} + flush={'left'} + > + <InnerContainer> + <IndexNumber + color="subdued" + size="s" + style={{ minWidth: String(highestIndex).length + 1 + 'ch' }} + > + {index + '.'} + </IndexNumber> + {secureHttps && ( + <SecureIcon + type="lock" + size="s" + color="success" + aria-label={i18n.translate( + 'xpack.synthetics.waterfallChart.sidebar.url.https', + { + defaultMessage: 'https', + } + )} + /> + )} + <FirstChunk>{chunks.first}</FirstChunk> + <LastChunk>{chunks.last}</LastChunk> + </InnerContainer> + </StyledButton> + ) : ( + <InnerContainer aria-hidden={true}> + <FirstChunk> + {index}. {chunks.first} + </FirstChunk> + <LastChunk>{chunks.last}</LastChunk> + </InnerContainer> + )} + </> + </WaterfallChartTooltip> + <span> + <EuiLink href={url} external target="_blank"> + <EuiScreenReaderOnly> + <span> + <FormattedMessage + id="xpack.synthetics.synthetics.waterfall.resource.externalLink" + defaultMessage="Open resource in new tab" + /> + </span> + </EuiScreenReaderOnly> + </EuiLink> + </span> + </OuterContainer> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.test.tsx new file mode 100644 index 0000000000000..e332be22d3da1 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.test.tsx @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { NetworkRequestsTotal } from './network_requests_total'; +import { render } from '../../../../../../utils/testing'; + +describe('NetworkRequestsTotal', () => { + it('message in case total is greater than fetched', () => { + const { getByText } = render( + <NetworkRequestsTotal + fetchedNetworkRequests={1000} + totalNetworkRequests={1100} + highlightedNetworkRequests={1000} + /> + ); + + expect(getByText('First 1000/1100 network requests')).toBeInTheDocument(); + expect(getByText('Info')).toBeInTheDocument(); + }); + + it('message in case total is equal to fetched requests', () => { + const { getByText } = render( + <NetworkRequestsTotal + fetchedNetworkRequests={500} + totalNetworkRequests={500} + highlightedNetworkRequests={1000} + /> + ); + + expect(getByText('500 network requests')).toBeInTheDocument(); + }); + + it('does not show highlighted item message when showHighlightedNetworkEvents is false', () => { + const { queryByText } = render( + <NetworkRequestsTotal + fetchedNetworkRequests={500} + totalNetworkRequests={500} + highlightedNetworkRequests={0} + showHighlightedNetworkRequests={false} + /> + ); + + expect(queryByText(/match the filter/)).not.toBeInTheDocument(); + }); + + it('does not show highlighted item message when highlightedNetworkEvents is less than 0', () => { + const { queryByText } = render( + <NetworkRequestsTotal + fetchedNetworkRequests={500} + totalNetworkRequests={500} + highlightedNetworkRequests={-1} + showHighlightedNetworkRequests={false} + /> + ); + + expect(queryByText(/match the filter/)).not.toBeInTheDocument(); + }); + + it('show highlighted item message when highlightedNetworkEvents is greater than 0 and showHighlightedNetworkEvents is true', () => { + const { getByText } = render( + <NetworkRequestsTotal + fetchedNetworkRequests={500} + totalNetworkRequests={500} + highlightedNetworkRequests={20} + showHighlightedNetworkRequests={true} + /> + ); + + expect(getByText(/\(20 match the filter\)/)).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.tsx new file mode 100644 index 0000000000000..4fac0b3cd00d2 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.tsx @@ -0,0 +1,69 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; +import { EuiIconTip } from '@elastic/eui'; +import { NetworkRequestsTotalStyle } from './styles'; + +interface Props { + totalNetworkRequests: number; + fetchedNetworkRequests: number; + highlightedNetworkRequests: number; + showHighlightedNetworkRequests?: boolean; +} + +export const NetworkRequestsTotal = ({ + totalNetworkRequests, + fetchedNetworkRequests, + highlightedNetworkRequests, + showHighlightedNetworkRequests, +}: Props) => { + return ( + <NetworkRequestsTotalStyle size="xs" color="subdued"> + <strong> + <FormattedMessage + id="xpack.synthetics.synthetics.waterfall.requestsTotalMessage" + defaultMessage="{numNetworkRequests} network requests" + values={{ + numNetworkRequests: + totalNetworkRequests > fetchedNetworkRequests ? ( + <FormattedMessage + id="xpack.synthetics.synthetics.waterfall.requestsTotalMessage.first" + defaultMessage="First {count}" + values={{ count: `${fetchedNetworkRequests}/${totalNetworkRequests}` }} + /> + ) : ( + totalNetworkRequests + ), + }} + />{' '} + {showHighlightedNetworkRequests && highlightedNetworkRequests >= 0 && ( + <FormattedMessage + id="xpack.synthetics.synthetics.waterfall.requestsHighlightedMessage" + defaultMessage="({numHighlightedRequests} match the filter)" + values={{ + numHighlightedRequests: highlightedNetworkRequests, + }} + /> + )} + </strong> + {totalNetworkRequests > fetchedNetworkRequests && ( + <EuiIconTip + type={'iInCircle'} + content={i18n.translate( + 'xpack.synthetics.synthetics.waterfall.requestsTotalMessage.info', + { + defaultMessage: 'Waterfall view only shows up to 1000 requests', + } + )} + /> + )} + </NetworkRequestsTotalStyle> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/sidebar.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/sidebar.tsx new file mode 100644 index 0000000000000..6edab485b9606 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/sidebar.tsx @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import { FIXED_AXIS_HEIGHT, SIDEBAR_GROW_SIZE } from './constants'; +import { IWaterfallContext, useWaterfallContext } from '../context/waterfall_chart'; +import { + WaterfallChartSidebarContainer, + WaterfallChartSidebarContainerInnerPanel, + WaterfallChartSidebarContainerFlexGroup, + WaterfallChartSidebarFlexItem, + WaterfallChartSidebarWrapper, +} from './styles'; +import { WaterfallChartProps } from './waterfall_chart'; + +interface SidebarProps { + items: Required<IWaterfallContext>['sidebarItems']; + render: Required<WaterfallChartProps>['renderSidebarItem']; +} + +export const Sidebar: React.FC<SidebarProps> = ({ items, render }) => { + const { onSidebarClick } = useWaterfallContext(); + const handleSidebarClick = useMemo(() => onSidebarClick, [onSidebarClick]); + + return ( + <WaterfallChartSidebarWrapper grow={SIDEBAR_GROW_SIZE}> + <WaterfallChartSidebarContainer + height={items.length * FIXED_AXIS_HEIGHT} + data-test-subj="wfSidebarContainer" + > + <WaterfallChartSidebarContainerInnerPanel + paddingSize="none" + hasBorder={false} + hasShadow={false} + > + <WaterfallChartSidebarContainerFlexGroup + direction="column" + gutterSize="none" + responsive={false} + > + {items.map((item, index) => { + return ( + <WaterfallChartSidebarFlexItem key={index}> + {render(item, index, handleSidebarClick)} + </WaterfallChartSidebarFlexItem> + ); + })} + </WaterfallChartSidebarContainerFlexGroup> + </WaterfallChartSidebarContainerInnerPanel> + </WaterfallChartSidebarContainer> + </WaterfallChartSidebarWrapper> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/styles.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/styles.ts new file mode 100644 index 0000000000000..a48ce1f7c09b5 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/styles.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 { FunctionComponent } from 'react'; +import { StyledComponent } from 'styled-components'; +import { EuiPanel, EuiFlexGroup, EuiFlexItem, EuiText, EuiPanelProps } from '@elastic/eui'; +import { rgba } from 'polished'; +import { euiStyled, EuiTheme } from '@kbn/kibana-react-plugin/common'; +import { FIXED_AXIS_HEIGHT } from './constants'; + +interface WaterfallChartOuterContainerProps { + height?: string; +} + +const StyledScrollDiv = euiStyled.div` + &::-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 const WaterfallChartOuterContainer = euiStyled( + StyledScrollDiv +)<WaterfallChartOuterContainerProps>` + height: ${(props) => (props.height ? `${props.height}` : 'auto')}; + overflow-y: ${(props) => (props.height ? 'scroll' : 'visible')}; + overflow-x: hidden; +`; + +export const WaterfallChartFixedTopContainer = euiStyled(StyledScrollDiv)` + position: sticky; + top: 0; + z-index: ${(props) => props.theme.eui.euiZLevel4}; + overflow-y: scroll; + overflow-x: hidden; +`; + +export const WaterfallChartAxisOnlyContainer = euiStyled(EuiFlexItem)` + margin-left: -16px; +`; + +export const WaterfallChartTopContainer = euiStyled(EuiFlexGroup)` +`; + +export const WaterfallChartFixedTopContainerSidebarCover: StyledComponent< + FunctionComponent<EuiPanelProps>, + EuiTheme +> = euiStyled(EuiPanel)` + height: 100%; + border-radius: 0 !important; + border: none; +`; // NOTE: border-radius !important is here as the "border" prop isn't working + +export const WaterfallChartFilterContainer = euiStyled.div` + && { + padding: 16px; + z-index: ${(props) => props.theme.eui.euiZLevel5}; + border-bottom: 0.3px solid ${(props) => props.theme.eui.euiColorLightShade}; + } +`; // NOTE: border-radius !important is here as the "border" prop isn't working + +export const WaterfallChartFixedAxisContainer = euiStyled.div` + z-index: ${(props) => props.theme.eui.euiZLevel4}; + height: 100%; + &&& { + .echAnnotation__icon { + top: 8px; + } + } +`; + +interface WaterfallChartSidebarContainer { + height: number; +} + +export const WaterfallChartSidebarWrapper = euiStyled(EuiFlexItem)` + z-index: ${(props) => props.theme.eui.euiZLevel5}; + min-width: 0; +`; // NOTE: min-width: 0 ensures flexbox and no-wrap children can co-exist + +export const WaterfallChartSidebarContainer = euiStyled.div<WaterfallChartSidebarContainer>` + height: ${(props) => `${props.height}px`}; + overflow-y: hidden; + overflow-x: hidden; +`; + +export const WaterfallChartSidebarContainerInnerPanel: StyledComponent< + FunctionComponent<EuiPanelProps>, + EuiTheme +> = euiStyled(EuiPanel)` + border: 0; + height: 100%; +`; + +export const WaterfallChartSidebarContainerFlexGroup = euiStyled(EuiFlexGroup)` + height: 100%; +`; + +// Ensures flex items honour no-wrap of children, rather than trying to extend to the full width of children. +export const WaterfallChartSidebarFlexItem = euiStyled(EuiFlexItem)` + min-width: 0; + padding-right: ${(props) => props.theme.eui.euiSizeS}; + justify-content: space-around; +`; + +export const SideBarItemHighlighter = euiStyled(EuiFlexItem)<{ isHighlighted: boolean }>` + opacity: ${(props) => (props.isHighlighted ? 1 : 0.4)}; + height: 100%; + .euiButtonEmpty { + height: ${FIXED_AXIS_HEIGHT}px; + font-size:${({ theme }) => theme.eui.euiFontSizeM}; + } +`; + +interface WaterfallChartChartContainer { + height: number; + chartIndex: number; +} + +export const WaterfallChartChartContainer = euiStyled.div<WaterfallChartChartContainer>` + width: 100%; + height: ${(props) => `${props.height + FIXED_AXIS_HEIGHT + 4}px`}; + margin-top: -${FIXED_AXIS_HEIGHT + 4}px; + z-index: ${(props) => Math.round(props.theme.eui.euiZLevel3 / (props.chartIndex + 1))}; + background-color: ${(props) => props.theme.eui.euiColorEmptyShade}; + + &&& { + .echCanvasRenderer { + height: calc(100% + 0px) !important; + } + } +`; + +export const WaterfallChartLegendContainer = euiStyled.div` + position: sticky; + bottom: 0; + z-index: ${(props) => props.theme.eui.euiZLevel5}; + background-color: ${(props) => props.theme.eui.euiColorLightestShade}; + padding: ${(props) => props.theme.eui.euiSizeXS}; + font-size: ${(props) => props.theme.eui.euiFontSizeXS}; + box-shadow: 0px -1px 4px 0px ${(props) => props.theme.eui.euiColorLightShade}; +`; // NOTE: EuiShadowColor is a little too dark to work with the background-color + +export const WaterfallTooltipResponsiveMaxWidth = euiStyled.div` + margin-top: 16px; + max-width: 90vw; +`; + +export const WaterfallChartTooltip = euiStyled(WaterfallTooltipResponsiveMaxWidth)` + background-color: ${(props) => props.theme.eui.euiColorDarkestShade}; + border-radius: ${(props) => props.theme.eui.euiBorderRadius}; + color: ${(props) => props.theme.eui.euiColorLightestShade}; + padding: ${(props) => props.theme.eui.euiSizeS}; + .euiToolTip__arrow { + background-color: ${(props) => props.theme.eui.euiColorDarkestShade}; + } +`; + +export const NetworkRequestsTotalStyle = euiStyled(EuiText)` + line-height: 28px; + padding: 0 ${(props) => props.theme.eui.euiSizeM}; + border-bottom: 0.3px solid ${(props) => props.theme.eui.euiColorLightShade}; + z-index: ${(props) => props.theme.eui.euiZLevel5}; +`; + +export const RelativeContainer = euiStyled.div` + position: relative; +`; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/translations.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/translations.ts new file mode 100644 index 0000000000000..6bb0c03f7b99e --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/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 FILTER_REQUESTS_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.searchBox.placeholder', + { + defaultMessage: 'Filter network requests', + } +); + +export const FILTER_SCREENREADER_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.filterGroup.filterScreenreaderLabel', + { + defaultMessage: 'Filter by', + } +); + +export const FILTER_REMOVE_SCREENREADER_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.filterGroup.removeFilterScreenReaderLabel', + { + defaultMessage: 'Remove filter by', + } +); + +export const FILTER_POPOVER_OPEN_LABEL = i18n.translate( + 'xpack.synthetics.pingList.synthetics.waterfall.filters.popover', + { + defaultMessage: 'Click to open waterfall filters', + } +); + +export const FILTER_COLLAPSE_REQUESTS_LABEL = i18n.translate( + 'xpack.synthetics.pingList.synthetics.waterfall.filters.collapseRequestsLabel', + { + defaultMessage: 'Collapse to only show matching requests', + } +); + +export const SIDEBAR_FILTER_MATCHES_SCREENREADER_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.sidebar.filterMatchesScreenReaderLabel', + { + defaultMessage: 'Resource matches filter', + } +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.test.tsx new file mode 100644 index 0000000000000..a963fb1e2939c --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.test.tsx @@ -0,0 +1,109 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useBarCharts } from './use_bar_charts'; +import { renderHook } from '@testing-library/react-hooks'; +import { IWaterfallContext } from '../context/waterfall_chart'; +import { CANVAS_MAX_ITEMS } from './constants'; + +const generateTestData = ( + { + xMultiplier, + }: { + xMultiplier: number; + } = { xMultiplier: 1 } +): IWaterfallContext['data'] => { + const numberOfItems = 1000; + const data: IWaterfallContext['data'] = []; + const testItem = { + x: 0, + y0: 0, + y: 4.345000023022294, + config: { + colour: '#b9a888', + showTooltip: true, + tooltipProps: { value: 'Queued / Blocked: 4.345ms', colour: '#b9a888' }, + }, + }; + + for (let i = 0; i < numberOfItems; i++) { + data.push( + { + ...testItem, + x: xMultiplier * i, + }, + { + ...testItem, + x: xMultiplier * i, + y0: 7, + y: 25, + } + ); + } + + return data; +}; + +describe('useBarChartsHooks', () => { + it('returns result as expected for non filtered data', () => { + const { result, rerender } = renderHook((props) => useBarCharts(props), { + initialProps: { data: [] as IWaterfallContext['data'] }, + }); + + expect(result.current).toHaveLength(0); + const newData = generateTestData(); + + rerender({ data: newData }); + + // Thousands items will result in 7 Canvas + expect(result.current.length).toBe(7); + + const firstChartItems = result.current[0]; + const lastChartItems = result.current[4]; + + // first chart items last item should be x 149, since we only display 150 items + expect(firstChartItems[firstChartItems.length - 1].x).toBe(CANVAS_MAX_ITEMS - 1); + + // first chart will only contain x values from 0 - 149; + expect(firstChartItems.find((item) => item.x > 149)).toBe(undefined); + + // since here are 5 charts, last chart first item should be x 600 + expect(lastChartItems[0].x).toBe(CANVAS_MAX_ITEMS * 4); + expect(lastChartItems[lastChartItems.length - 1].x).toBe(CANVAS_MAX_ITEMS * 5 - 1); + }); + + it('returns result as expected for filtered data', () => { + /* multiply x values to simulate filtered data, where x values can have gaps in the + * sequential order */ + const xMultiplier = 2; + const { result, rerender } = renderHook((props) => useBarCharts(props), { + initialProps: { data: [] as IWaterfallContext['data'] }, + }); + + expect(result.current).toHaveLength(0); + const newData = generateTestData({ xMultiplier }); + + rerender({ data: newData }); + + // Thousands items will result in 7 Canvas + expect(result.current.length).toBe(7); + + const firstChartItems = result.current[0]; + const lastChartItems = result.current[4]; + + // first chart items last item should be x 149, since we only display 150 items + expect(firstChartItems[firstChartItems.length - 1].x).toBe( + (CANVAS_MAX_ITEMS - 1) * xMultiplier + ); + + // since here are 5 charts, last chart first item should be x 600 + expect(lastChartItems[0].x).toBe(CANVAS_MAX_ITEMS * 4 * xMultiplier); + expect(lastChartItems[lastChartItems.length - 1].x).toBe( + (CANVAS_MAX_ITEMS * 5 - 1) * xMultiplier + ); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.ts new file mode 100644 index 0000000000000..2baf895504911 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.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 { useEffect, useState } from 'react'; +import { IWaterfallContext } from '../context/waterfall_chart'; +import { CANVAS_MAX_ITEMS } from './constants'; + +export interface UseBarHookProps { + data: IWaterfallContext['data']; +} + +export const useBarCharts = ({ data }: UseBarHookProps) => { + const [charts, setCharts] = useState<Array<IWaterfallContext['data']>>([]); + + useEffect(() => { + const chartsN: Array<IWaterfallContext['data']> = []; + + if (data?.length > 0) { + let chartIndex = 0; + /* We want at most CANVAS_MAX_ITEMS **RESOURCES** per array. + * Resources !== individual timing items, but are comprised of many individual timing + * items. The X value of each item can be used as an id for the resource. + * We must keep track of the number of unique resources added to the each array. */ + const uniqueResources = new Set(); + let lastIndex: number; + data.forEach((item) => { + if (uniqueResources.size === CANVAS_MAX_ITEMS && item.x > lastIndex) { + chartIndex++; + uniqueResources.clear(); + } + uniqueResources.add(item.x); + lastIndex = item.x; + if (!chartsN[chartIndex]) { + chartsN.push([item]); + return; + } + chartsN[chartIndex].push(item); + }); + } + + setCharts(chartsN); + }, [data]); + + return charts; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.test.tsx new file mode 100644 index 0000000000000..5b388874d508e --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.test.tsx @@ -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 { renderHook, act } from '@testing-library/react-hooks'; +import { useFlyout } from './use_flyout'; +import { IWaterfallContext } from '../context/waterfall_chart'; + +import { ProjectedValues, XYChartElementEvent } from '@elastic/charts'; + +describe('useFlyoutHook', () => { + const metadata: IWaterfallContext['metadata'] = [ + { + x: 0, + url: 'http://elastic.co', + requestHeaders: undefined, + responseHeaders: undefined, + certificates: undefined, + details: [ + { + name: 'Content type', + value: 'text/html', + }, + ], + }, + ]; + + it('sets isFlyoutVisible to true and sets flyoutData when calling onSidebarClick', () => { + const index = 0; + const { result } = renderHook((props) => useFlyout(props.metadata), { + initialProps: { metadata }, + }); + + expect(result.current.isFlyoutVisible).toBe(false); + + act(() => { + result.current.onSidebarClick({ buttonRef: { current: null }, networkItemIndex: index }); + }); + + expect(result.current.isFlyoutVisible).toBe(true); + expect(result.current.flyoutData).toEqual(metadata[index]); + }); + + it('sets isFlyoutVisible to true and sets flyoutData when calling onBarClick', () => { + const index = 0; + const elementData = [ + { + datum: { + config: { + id: index, + }, + }, + }, + {}, + ]; + + const { result } = renderHook((props) => useFlyout(props.metadata), { + initialProps: { metadata }, + }); + + expect(result.current.isFlyoutVisible).toBe(false); + + act(() => { + result.current.onBarClick([elementData as XYChartElementEvent]); + }); + + expect(result.current.isFlyoutVisible).toBe(true); + expect(result.current.flyoutData).toEqual(metadata[0]); + }); + + it('sets isFlyoutVisible to true and sets flyoutData when calling onProjectionClick', () => { + const index = 0; + const geometry = { x: index }; + + const { result } = renderHook((props) => useFlyout(props.metadata), { + initialProps: { metadata }, + }); + + expect(result.current.isFlyoutVisible).toBe(false); + + act(() => { + result.current.onProjectionClick(geometry as ProjectedValues); + }); + + expect(result.current.isFlyoutVisible).toBe(true); + expect(result.current.flyoutData).toEqual(metadata[0]); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.ts new file mode 100644 index 0000000000000..6e1795c4933ec --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.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 { RefObject, useCallback, useState } from 'react'; + +import { + ElementClickListener, + ProjectionClickListener, + ProjectedValues, + XYChartElementEvent, +} from '@elastic/charts'; + +import { WaterfallMetadata, WaterfallMetadataEntry } from '../types'; + +interface OnSidebarClickParams { + buttonRef?: ButtonRef; + networkItemIndex: number; +} + +export type ButtonRef = RefObject<HTMLButtonElement | null>; +export type OnSidebarClick = (params: OnSidebarClickParams) => void; +export type OnProjectionClick = ProjectionClickListener; +export type OnElementClick = ElementClickListener; +export type OnFlyoutClose = () => void; + +export const useFlyout = (metadata: WaterfallMetadata) => { + const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); + const [flyoutData, setFlyoutData] = useState<WaterfallMetadataEntry | undefined>(undefined); + const [currentSidebarItemRef, setCurrentSidebarItemRef] = + useState<RefObject<HTMLButtonElement | null>>(); + + const handleFlyout = useCallback( + (flyoutEntry: WaterfallMetadataEntry) => { + setFlyoutData(flyoutEntry); + setIsFlyoutVisible(true); + }, + [setIsFlyoutVisible, setFlyoutData] + ); + + const onFlyoutClose = useCallback(() => { + setIsFlyoutVisible(false); + currentSidebarItemRef?.current?.focus(); + }, [currentSidebarItemRef, setIsFlyoutVisible]); + + const onBarClick: ElementClickListener = useCallback( + ([elementData]) => { + setIsFlyoutVisible(false); + const { datum } = (elementData as XYChartElementEvent)[0]; + const metadataEntry = metadata[datum.config.id]; + handleFlyout(metadataEntry); + }, + [metadata, handleFlyout] + ); + + const onProjectionClick: ProjectionClickListener = useCallback( + (projectionData) => { + setIsFlyoutVisible(false); + const { x } = projectionData as ProjectedValues; + if (typeof x === 'number' && x >= 0) { + const metadataEntry = metadata[x]; + handleFlyout(metadataEntry); + } + }, + [metadata, handleFlyout] + ); + + const onSidebarClick: OnSidebarClick = useCallback( + ({ buttonRef, networkItemIndex }) => { + if (isFlyoutVisible && buttonRef === currentSidebarItemRef) { + setIsFlyoutVisible(false); + } else { + const metadataEntry = metadata[networkItemIndex]; + setCurrentSidebarItemRef(buttonRef); + handleFlyout(metadataEntry); + } + }, + [currentSidebarItemRef, handleFlyout, isFlyoutVisible, metadata, setIsFlyoutVisible] + ); + + return { + flyoutData, + onBarClick, + onProjectionClick, + onSidebarClick, + isFlyoutVisible, + onFlyoutClose, + }; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall.test.tsx new file mode 100644 index 0000000000000..c1937764214e4 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall.test.tsx @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { WaterfallChart } from './waterfall_chart'; +import { renderLegendItem } from '../../step_detail/waterfall/waterfall_chart_wrapper'; + +import 'jest-canvas-mock'; +import { waitFor } from '@testing-library/dom'; +import { render } from '../../../../../../utils/testing'; + +describe('waterfall', () => { + it('sets the correct height in case of full height', () => { + const Component = () => { + return ( + <div style={{ height: 768, width: 1366 }}> + <WaterfallChart + tickFormat={(d: number) => `${Number(d).toFixed(0)} ms`} + domain={{ + max: 3371, + min: 0, + }} + barStyleAccessor={(datum) => { + return datum.datum.config.colour; + }} + renderSidebarItem={undefined} + renderLegendItem={renderLegendItem} + fullHeight={true} + /> + </div> + ); + }; + + const { getByTestId } = render(<Component />); + + const chartWrapper = getByTestId('waterfallOuterContainer'); + + waitFor(() => { + expect(chartWrapper).toHaveStyleRule('height', 'calc(100vh - 62px)'); + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_bar_chart.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_bar_chart.tsx new file mode 100644 index 0000000000000..3c9baed0dd3d6 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_bar_chart.tsx @@ -0,0 +1,128 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo, useCallback } from 'react'; +import { + Axis, + BarSeries, + BarStyleAccessor, + Chart, + DomainRange, + Position, + ScaleType, + Settings, + TickFormatter, + TooltipInfo, +} from '@elastic/charts'; +import { useChartTheme } from '../../../../../../../../hooks/use_chart_theme'; +import { BAR_HEIGHT } from './constants'; +import { WaterfallChartChartContainer, WaterfallChartTooltip } from './styles'; +import { useWaterfallContext, WaterfallData } from '..'; +import { WaterfallTooltipContent } from './waterfall_tooltip_content'; +import { formatTooltipHeading } from '../../step_detail/waterfall/data_formatting'; +import { WaterfallChartMarkers } from './waterfall_markers'; + +const getChartHeight = (data: WaterfallData): number => { + // We get the last item x(number of bars) and adds 1 to cater for 0 index + const noOfXBars = new Set(data.map((item) => item.x)).size; + + return noOfXBars * BAR_HEIGHT; +}; + +const Tooltip = (tooltipInfo: TooltipInfo) => { + const { data, sidebarItems } = useWaterfallContext(); + return useMemo(() => { + const sidebarItem = sidebarItems?.find((item) => item.index === tooltipInfo.header?.value); + const relevantItems = data.filter((item) => { + return ( + item.x === tooltipInfo.header?.value && item.config.showTooltip && item.config.tooltipProps + ); + }); + return relevantItems.length ? ( + <WaterfallChartTooltip> + {sidebarItem && ( + <WaterfallTooltipContent + text={formatTooltipHeading(sidebarItem.index + 1, sidebarItem.url)} + url={sidebarItem.url} + /> + )} + </WaterfallChartTooltip> + ) : null; + }, [data, sidebarItems, tooltipInfo.header?.value]); +}; + +interface Props { + index: number; + chartData: WaterfallData; + tickFormat: TickFormatter; + domain: DomainRange; + barStyleAccessor: BarStyleAccessor; +} + +export const WaterfallBarChart = ({ + chartData, + tickFormat, + domain, + barStyleAccessor, + index, +}: Props) => { + const theme = useChartTheme(); + const { onElementClick, onProjectionClick } = useWaterfallContext(); + const handleElementClick = useMemo(() => onElementClick, [onElementClick]); + const handleProjectionClick = useMemo(() => onProjectionClick, [onProjectionClick]); + const memoizedTickFormat = useCallback(tickFormat, [tickFormat]); + + return ( + <WaterfallChartChartContainer + height={getChartHeight(chartData)} + chartIndex={index} + data-test-subj="wfDataOnlyBarChart" + > + <Chart className="data-chart"> + <Settings + showLegend={false} + rotation={90} + tooltip={{ + // this is done to prevent the waterfall tooltip from rendering behind Kibana's + // stacked header when the user highlights an item at the top of the chart + boundary: document.getElementById('app-fixed-viewport') ?? undefined, + customTooltip: Tooltip, + }} + theme={theme} + onProjectionClick={handleProjectionClick} + onElementClick={handleElementClick} + /> + + <Axis + aria-hidden={true} + id="time" + position={Position.Top} + tickFormat={memoizedTickFormat} + domain={domain} + showGridLines={true} + style={{ + axisLine: { + visible: false, + }, + }} + /> + + <BarSeries + id="waterfallItems" + xScaleType={ScaleType.Ordinal} + yScaleType={ScaleType.Linear} + xAccessor="x" + yAccessors={['y']} + y0Accessors={['y0']} + styleAccessor={barStyleAccessor} + data={chartData} + /> + <WaterfallChartMarkers /> + </Chart> + </WaterfallChartChartContainer> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart.tsx new file mode 100644 index 0000000000000..8e69e57616bff --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart.tsx @@ -0,0 +1,156 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, useRef, useState } from 'react'; +import { EuiFlexGroup } from '@elastic/eui'; +import { TickFormatter, DomainRange, BarStyleAccessor } from '@elastic/charts'; +import useWindowSize from 'react-use/lib/useWindowSize'; +import { useWaterfallContext } from '../context/waterfall_chart'; +import { + WaterfallChartOuterContainer, + WaterfallChartFixedTopContainer, + WaterfallChartFixedTopContainerSidebarCover, + WaterfallChartSidebarWrapper, + WaterfallChartTopContainer, + RelativeContainer, + WaterfallChartFilterContainer, + WaterfallChartAxisOnlyContainer, + WaterfallChartLegendContainer, +} from './styles'; +import { CHART_LEGEND_PADDING, MAIN_GROW_SIZE, SIDEBAR_GROW_SIZE } from './constants'; +import { Sidebar } from './sidebar'; +import { Legend } from './legend'; +import { useBarCharts } from './use_bar_charts'; +import { WaterfallBarChart } from './waterfall_bar_chart'; +import { WaterfallChartFixedAxis } from './waterfall_chart_fixed_axis'; +import { NetworkRequestsTotal } from './network_requests_total'; + +export type RenderItem<I = any> = ( + item: I, + index: number, + onClick?: (event: any) => void +) => JSX.Element; +export type RenderElement = () => JSX.Element; + +export interface WaterfallChartProps { + tickFormat: TickFormatter; + domain: DomainRange; + barStyleAccessor: BarStyleAccessor; + renderSidebarItem?: RenderItem; + renderLegendItem?: RenderItem; + renderFilter?: RenderElement; + renderFlyout?: RenderElement; + maxHeight?: string; + fullHeight?: boolean; +} + +export const WaterfallChart = ({ + tickFormat, + domain, + barStyleAccessor, + renderSidebarItem, + renderLegendItem, + renderFilter, + renderFlyout, + maxHeight = '800px', + fullHeight = false, +}: WaterfallChartProps) => { + const { + data, + showOnlyHighlightedNetworkRequests, + sidebarItems, + legendItems, + totalNetworkRequests, + highlightedNetworkRequests, + fetchedNetworkRequests, + } = useWaterfallContext(); + + const { width } = useWindowSize(); + + const chartWrapperDivRef = useRef<HTMLDivElement | null>(null); + const legendDivRef = useRef<HTMLDivElement | null>(null); + + const [height, setHeight] = useState<string>(maxHeight); + + const shouldRenderSidebar = !!(sidebarItems && renderSidebarItem); + const shouldRenderLegend = !!(legendItems && legendItems.length > 0 && renderLegendItem); + + useEffect(() => { + if (fullHeight && chartWrapperDivRef.current && legendDivRef.current) { + const chartOffset = chartWrapperDivRef.current.getBoundingClientRect().top; + const legendOffset = legendDivRef.current.getBoundingClientRect().height; + setHeight(`calc(190vh - ${chartOffset + CHART_LEGEND_PADDING + legendOffset}px)`); + } + }, [chartWrapperDivRef, fullHeight, legendDivRef, width]); + + const chartsToDisplay = useBarCharts({ data }); + + return ( + <RelativeContainer> + <WaterfallChartFixedTopContainer> + <WaterfallChartTopContainer gutterSize="none" responsive={false}> + {shouldRenderSidebar && ( + <WaterfallChartSidebarWrapper grow={SIDEBAR_GROW_SIZE}> + <WaterfallChartFixedTopContainerSidebarCover paddingSize="none" hasShadow={false} /> + <NetworkRequestsTotal + totalNetworkRequests={totalNetworkRequests} + highlightedNetworkRequests={highlightedNetworkRequests} + fetchedNetworkRequests={fetchedNetworkRequests} + showHighlightedNetworkRequests={showOnlyHighlightedNetworkRequests} + /> + {renderFilter && ( + <WaterfallChartFilterContainer>{renderFilter()}</WaterfallChartFilterContainer> + )} + </WaterfallChartSidebarWrapper> + )} + + <WaterfallChartAxisOnlyContainer + grow={shouldRenderSidebar ? MAIN_GROW_SIZE : true} + data-test-subj="axisOnlyWrapper" + > + <WaterfallChartFixedAxis + domain={domain} + barStyleAccessor={barStyleAccessor} + tickFormat={tickFormat} + /> + </WaterfallChartAxisOnlyContainer> + </WaterfallChartTopContainer> + </WaterfallChartFixedTopContainer> + <WaterfallChartOuterContainer + height={height} + data-test-subj="waterfallOuterContainer" + ref={chartWrapperDivRef} + > + <EuiFlexGroup gutterSize="none" responsive={false}> + {shouldRenderSidebar && <Sidebar items={sidebarItems!} render={renderSidebarItem!} />} + + <WaterfallChartAxisOnlyContainer + grow={shouldRenderSidebar ? MAIN_GROW_SIZE : true} + data-test-subj="dataOnlyWrapper" + > + {chartsToDisplay.map((chartData, ind) => ( + <WaterfallBarChart + index={ind} + key={ind} + chartData={chartData} + domain={domain} + barStyleAccessor={barStyleAccessor} + tickFormat={tickFormat} + /> + ))} + </WaterfallChartAxisOnlyContainer> + </EuiFlexGroup> + </WaterfallChartOuterContainer> + {shouldRenderLegend && ( + <WaterfallChartLegendContainer ref={legendDivRef}> + <Legend items={legendItems!} render={renderLegendItem!} /> + </WaterfallChartLegendContainer> + )} + {renderFlyout && renderFlyout()} + </RelativeContainer> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart_fixed_axis.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart_fixed_axis.tsx new file mode 100644 index 0000000000000..15b29beb19759 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart_fixed_axis.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 { + Axis, + BarSeries, + BarStyleAccessor, + Chart, + DomainRange, + Position, + ScaleType, + Settings, + TickFormatter, + TooltipType, +} from '@elastic/charts'; +import { useChartTheme } from '../../../../../../../../hooks/use_chart_theme'; +import { WaterfallChartFixedAxisContainer } from './styles'; +import { WaterfallChartMarkers } from './waterfall_markers'; + +interface Props { + tickFormat: TickFormatter; + domain: DomainRange; + barStyleAccessor: BarStyleAccessor; +} + +export const WaterfallChartFixedAxis = ({ tickFormat, domain, barStyleAccessor }: Props) => { + const theme = useChartTheme(); + + return ( + <WaterfallChartFixedAxisContainer> + <Chart className="axis-only-chart" data-test-subj="axisOnlyChart"> + <Settings + showLegend={false} + rotation={90} + tooltip={{ type: TooltipType.None }} + theme={theme} + /> + + <Axis + id="time" + position={Position.Top} + tickFormat={tickFormat} + domain={domain} + showGridLines={true} + /> + + <BarSeries + aria-hidden={true} + id="waterfallItems" + xScaleType={ScaleType.Ordinal} + yScaleType={ScaleType.Linear} + xAccessor="x" + yAccessors={['y']} + y0Accessors={['y0']} + styleAccessor={barStyleAccessor} + data={[ + { x: 0, y0: 0, y1: 1 }, + { x: 1, y0: 0, y1: 1 }, + ]} + /> + <WaterfallChartMarkers /> + </Chart> + </WaterfallChartFixedAxisContainer> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_flyout_table.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_flyout_table.tsx new file mode 100644 index 0000000000000..8f723eb92fd94 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_flyout_table.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, { useMemo } from 'react'; +import styled from 'styled-components'; + +import { EuiText, EuiBasicTable, EuiSpacer } from '@elastic/eui'; + +interface Row { + name: string; + value?: string; +} + +interface Props { + rows: Row[]; + title: string; +} + +const StyledText = styled(EuiText)` + width: 100%; +`; + +class TableWithoutHeader extends EuiBasicTable { + renderTableHead() { + return <></>; + } +} + +export const Table = (props: Props) => { + const { rows, title } = props; + const columns = useMemo( + () => [ + { + field: 'name', + name: '', + sortable: false, + render: (_name: string, item: Row) => ( + <EuiText size="xs"> + <strong>{item.name}</strong> + </EuiText> + ), + }, + { + field: 'value', + name: '', + sortable: false, + render: (_name: string, item: Row) => { + return ( + <StyledText size="xs" textAlign="right"> + {item.value ?? '--'} + </StyledText> + ); + }, + }, + ], + [] + ); + + return ( + <> + <EuiText> + <h4>{title}</h4> + </EuiText> + <EuiSpacer size="s" /> + <TableWithoutHeader + tableLayout={'fixed'} + compressed + responsive={false} + columns={columns} + items={rows} + /> + </> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.test.tsx new file mode 100644 index 0000000000000..222f152c01b1b --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.test.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 from 'react'; +import { fireEvent, waitFor } from '@testing-library/dom'; +import { WaterfallMarkerIcon } from './waterfall_marker_icon'; +import { TestWrapper } from './waterfall_marker_test_helper'; +import { render } from '../../../../../../utils/testing'; + +describe('<WaterfallMarkerIcon />', () => { + it('renders a dot icon when `field` is an empty string', () => { + const { getByText } = render(<WaterfallMarkerIcon field="" label="" />); + expect(getByText('An icon indicating that this marker has no field associated with it')); + }); + + it('renders an embeddable when opened', async () => { + const { getByLabelText, getByText } = render( + <TestWrapper + activeStep={{ + '@timestamp': '123', + _id: 'id', + synthetics: { + type: 'step/end', + step: { + index: 0, + status: 'succeeded', + name: 'test-name', + duration: { + us: 9999, + }, + }, + }, + monitor: { + id: 'mon-id', + check_group: 'group', + timespan: { + gte: '1988-10-09T12:00:00.000Z', + lt: '1988-10-10T12:00:00.000Z', + }, + }, + }} + basePath="xyz" + > + <WaterfallMarkerIcon field="testField" label="Test Field" /> + </TestWrapper> + ); + + const expandButton = getByLabelText( + 'Use this icon button to show metrics for this annotation marker.' + ); + + fireEvent.click(expandButton); + + await waitFor(() => { + getByText('Test Field'); + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.tsx new file mode 100644 index 0000000000000..675224bfa8f79 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.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, { useState } from 'react'; +import { i18n } from '@kbn/i18n'; +import { EuiButtonIcon, EuiIcon, EuiPopover } from '@elastic/eui'; +import { WaterfallMarkerTrend } from './waterfall_marker_trend'; + +export function WaterfallMarkerIcon({ field, label }: { field: string; label: string }) { + const [isOpen, setIsOpen] = useState(false); + + if (!field) { + return ( + <EuiIcon + aria-label={i18n.translate('xpack.synthetics.synthetics.markers.noFieldIcon.label', { + defaultMessage: 'An icon indicating that this marker has no field associated with it', + })} + type="dot" + size="l" + /> + ); + } + + return ( + <EuiPopover + isOpen={isOpen} + closePopover={() => setIsOpen(false)} + anchorPosition="downLeft" + panelStyle={{ paddingBottom: 0, paddingLeft: 4 }} + zIndex={100} + button={ + <EuiButtonIcon + aria-label={i18n.translate( + 'xpack.synthetics.synthetics.markers.openEmbeddableButton.label', + { + defaultMessage: 'Use this icon button to show metrics for this annotation marker.', + } + )} + iconType="dot" + iconSize="l" + color="text" + onClick={() => setIsOpen((prevState) => !prevState)} + /> + } + > + <WaterfallMarkerTrend title={label} field={field} /> + </EuiPopover> + ); +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_test_helper.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_test_helper.tsx new file mode 100644 index 0000000000000..ce033b6f2ef2b --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_test_helper.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 from 'react'; +import { SyntheticsStartupPluginsContext } from '../../../../../../contexts'; +import { JourneyStep } from '../../../../../../../../../common/runtime_types'; +import { WaterfallContext } from '../context/waterfall_chart'; + +const EmbeddableMock = ({ + title, + appendTitle, + reportType, + attributes, +}: { + title: string; + appendTitle: JSX.Element | undefined; + reportType: string; + attributes: unknown; + axisTitlesVisibility: { x: boolean; yLeft: boolean; yRight: boolean }; + legendIsVisible: boolean; +}) => ( + <div> + <h1>{title}</h1> + <div aria-label="append title">{appendTitle}</div> + <div>{reportType}</div> + <div aria-label="attributes">{JSON.stringify(attributes)}</div> + </div> +); + +export const TestWrapper = ({ + basePath, + activeStep, + children, +}: { + basePath: string; + activeStep?: JourneyStep; + children: JSX.Element; +}) => ( + <SyntheticsStartupPluginsContext.Provider + value={{ + // @ts-expect-error incomplete implementation for test purposes + observability: { + ExploratoryViewEmbeddable: jest.fn((props: any) => <EmbeddableMock {...props} />), + }, + }} + > + <WaterfallContext.Provider + value={{ + activeStep, + }} + > + {children} + </WaterfallContext.Provider> + </SyntheticsStartupPluginsContext.Provider> +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.test.tsx new file mode 100644 index 0000000000000..f75b25b056e0d --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.test.tsx @@ -0,0 +1,128 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { WaterfallMarkerTrend } from './waterfall_marker_trend'; +import moment from 'moment'; +import { TestWrapper } from './waterfall_marker_test_helper'; +import { render } from '../../../../../../utils/testing'; +import { JourneyStep } from '../../../../../../../../../common/runtime_types'; + +describe('<WaterfallMarkerTrend />', () => { + const mockDiff = jest.fn(); + + jest.spyOn(moment.prototype, 'diff').mockImplementation(mockDiff); + + const timestamp = '2021-12-03T14:35:41.072Z'; + + let activeStep: JourneyStep | undefined; + beforeEach(() => { + activeStep = { + '@timestamp': timestamp, + _id: 'id', + synthetics: { + type: 'step/end', + step: { + index: 0, + status: 'succeeded', + name: 'test-name', + duration: { + us: 9999, + }, + }, + }, + monitor: { + id: 'mon-id', + check_group: 'group', + timespan: { + gte: '1988-10-09T12:00:00.000Z', + lt: '1988-10-10T12:00:00.000Z', + }, + }, + }; + // value diff in milliseconds + mockDiff.mockReturnValue(10 * 1000); + }); + + const BASE_PATH = 'xyz'; + + it('supplies props', () => { + const { getByLabelText, getByText, getByRole } = render( + <TestWrapper activeStep={activeStep} basePath={BASE_PATH}> + <WaterfallMarkerTrend title="test title" field="field" /> + </TestWrapper>, + { + core: { + http: { + basePath: { + get: () => BASE_PATH, + }, + }, + }, + } + ); + const heading = getByRole('heading'); + expect(heading.innerHTML).toEqual('test title'); + expect(getByLabelText('append title').innerHTML.indexOf(BASE_PATH)).not.toBe(-1); + expect(getByText('kpi-over-time')); + const attributesText = getByLabelText('attributes').innerHTML; + + expect(attributesText.includes('"2021-12-03T14:35:41.072Z"')).toBeTruthy(); + const attributes = JSON.parse(attributesText); + expect( + moment(attributes[0].time.from) + .add(10 * 1000 * 48, 'millisecond') + .toISOString() + ).toBe(timestamp); + }); + + it('handles timespan difference', () => { + const oneMinDiff = 60 * 1000; + mockDiff.mockReturnValue(oneMinDiff); + const { getByLabelText } = render( + <TestWrapper activeStep={activeStep} basePath={BASE_PATH}> + <WaterfallMarkerTrend title="test title" field="field" /> + </TestWrapper> + ); + + const attributesText = getByLabelText('attributes').innerHTML; + + expect(attributesText).toBe( + JSON.stringify([ + { + name: 'test title(test-name)', + selectedMetricField: 'field', + time: { to: '2021-12-03T14:35:41.072Z', from: '2021-12-03T13:47:41.072Z' }, + seriesType: 'area', + dataType: 'synthetics', + reportDefinitions: { + 'monitor.name': [null], + 'synthetics.step.name.keyword': ['test-name'], + }, + operationType: 'last_value', + }, + ]) + ); + + const attributes = JSON.parse(attributesText); + expect( + moment(attributes[0].time.from) + .add(oneMinDiff * 48, 'millisecond') + .toISOString() + ).toBe(timestamp); + }); + + it('returns null for missing active step', () => { + activeStep = undefined; + const { container } = render( + <TestWrapper activeStep={activeStep} basePath={BASE_PATH}> + <WaterfallMarkerTrend title="test title" field="field" /> + </TestWrapper> + ); + expect(container.innerHTML).toBe(''); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.tsx new file mode 100644 index 0000000000000..5ab0196701083 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.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 { StepFieldTrend } from '../../../../../common/step_field_trend/step_field_trend'; +import { useWaterfallContext } from '../context/waterfall_chart'; + +export function WaterfallMarkerTrend({ title, field }: { title: string; field: string }) { + const { activeStep } = useWaterfallContext(); + + if (!activeStep) { + return null; + } + + return <StepFieldTrend field={field} title={title} step={activeStep} />; +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_markers.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_markers.tsx new file mode 100644 index 0000000000000..1a8e5dd1d51b4 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_markers.tsx @@ -0,0 +1,179 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { AnnotationDomainType, LineAnnotation } from '@elastic/charts'; +import { i18n } from '@kbn/i18n'; +import { useTheme } from '@kbn/observability-plugin/public'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { useWaterfallContext } from '..'; +import { MarkerItems } from '../context/waterfall_chart'; +import { WaterfallMarkerIcon } from './waterfall_marker_icon'; + +export const FIELD_SYNTHETICS_LCP = 'browser.experience.lcp.us'; +export const FIELD_SYNTHETICS_FCP = 'browser.experience.fcp.us'; +export const FIELD_SYNTHETICS_DOCUMENT_ONLOAD = 'browser.experience.load.us'; +export const FIELD_SYNTHETICS_DCL = 'browser.experience.dcl.us'; +export const LAYOUT_SHIFT = 'layoutShift'; + +export function WaterfallChartMarkers() { + const { markerItems } = useWaterfallContext(); + + const theme = useTheme(); + + const markerItemsByOffset = useMemo( + () => + (markerItems ?? []).reduce((acc, cur) => { + acc.set(cur.offset, [...(acc.get(cur.offset) ?? []), cur]); + return acc; + }, new Map<number, MarkerItems>()), + [markerItems] + ); + + const annotations = useMemo(() => { + return Array.from(markerItemsByOffset.entries()).map(([offset, items]) => { + let uniqueIds = (items ?? []) + .map(({ id }) => id) + .filter((id, index, arr) => arr.indexOf(id) === index); + + // Omit coinciding layoutShift's with other vital marks + if (uniqueIds.length > 1) { + uniqueIds = uniqueIds.filter((id) => id !== LAYOUT_SHIFT); + } + + const label = uniqueIds.map((id) => getMarkersInfo(id, theme)?.label ?? id).join(' / '); + const id = uniqueIds[0]; + const markersInfo = getMarkersInfo(id, theme); + + return { + id, + offset, + label, + field: markersInfo?.field ?? '', + color: markersInfo?.color ?? theme.eui.euiColorMediumShade, + strokeWidth: markersInfo?.strokeWidth ?? 1, + }; + }); + }, [markerItemsByOffset, theme]); + + if (!markerItems) { + return null; + } + + return ( + <Wrapper> + {annotations.map(({ id, offset, label, field, color, strokeWidth }) => { + const key = `${id}-${offset}`; + + return ( + <LineAnnotation + key={key} + id={key} + domainType={AnnotationDomainType.YDomain} + dataValues={[ + { + dataValue: offset, + details: label, + header: i18n.translate('xpack.synthetics.synthetics.waterfall.offsetUnit', { + defaultMessage: '{offset} ms', + values: { offset }, + }), + }, + ]} + marker={<WaterfallMarkerIcon field={field} label={label} />} + style={{ + line: { + strokeWidth, + stroke: color, + opacity: 1, + }, + }} + /> + ); + })} + </Wrapper> + ); +} + +function getMarkersInfo(id: string, theme: ReturnType<typeof useTheme>) { + switch (id) { + case 'domContentLoaded': + return { + label: DOCUMENT_CONTENT_LOADED_LABEL, + color: theme.eui.euiColorVis0, + field: FIELD_SYNTHETICS_DCL, + strokeWidth: 2, + }; + case 'firstContentfulPaint': + return { + label: FCP_LABEL, + color: theme.eui.euiColorVis1, + field: FIELD_SYNTHETICS_FCP, + strokeWidth: 2, + }; + case 'largestContentfulPaint': + return { + label: LCP_LABEL, + color: theme.eui.euiColorVis2, + field: FIELD_SYNTHETICS_LCP, + strokeWidth: 2, + }; + case 'layoutShift': + return { + label: LAYOUT_SHIFT_LABEL, + color: theme.eui.euiColorVis6, + field: '', + strokeWidth: 1, + }; + case 'loadEvent': + return { + label: LOAD_EVENT_LABEL, + color: theme.eui.euiColorVis9, + field: FIELD_SYNTHETICS_DOCUMENT_ONLOAD, + strokeWidth: 2, + }; + } + + return undefined; +} + +const Wrapper = euiStyled.span` + &&& { + > .echAnnotation__icon { + top: 8px; + } + } +`; + +export const FCP_LABEL = i18n.translate('xpack.synthetics.synthetics.waterfall.fcpLabel', { + defaultMessage: 'First contentful paint', +}); + +export const LCP_LABEL = i18n.translate('xpack.synthetics.synthetics.waterfall.lcpLabel', { + defaultMessage: 'Largest contentful paint', +}); + +export const LAYOUT_SHIFT_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.layoutShiftLabel', + { + defaultMessage: 'Layout shift', + } +); + +export const LOAD_EVENT_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.loadEventLabel', + { + defaultMessage: 'Load event', + } +); + +export const DOCUMENT_CONTENT_LOADED_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.domContentLabel', + { + defaultMessage: 'DOM Content Loaded', + } +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.test.tsx new file mode 100644 index 0000000000000..0df81cca48df3 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.test.tsx @@ -0,0 +1,84 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { WaterfallTooltipContent } from './waterfall_tooltip_content'; +import { render } from '../../../../../../utils/testing'; + +jest.mock('../context/waterfall_chart', () => ({ + useWaterfallContext: jest.fn().mockReturnValue({ + data: [ + { + x: 0, + config: { + url: 'https://www.elastic.co', + tooltipProps: { + colour: '#000000', + value: 'test-val', + }, + showTooltip: true, + }, + }, + { + x: 0, + config: { + url: 'https://www.elastic.co/with/missing/tooltip.props', + showTooltip: true, + }, + }, + { + x: 1, + config: { + url: 'https://www.elastic.co/someresource.path', + tooltipProps: { + colour: '#010000', + value: 'test-val-missing', + }, + showTooltip: true, + }, + }, + ], + renderTooltipItem: (props: any) => ( + <div aria-label="tooltip item"> + <div>{props.colour}</div> + <div>{props.value}</div> + </div> + ), + sidebarItems: [ + { + isHighlighted: true, + index: 0, + offsetIndex: 1, + url: 'https://www.elastic.co', + status: 200, + method: 'GET', + }, + ], + }), +})); + +describe('WaterfallTooltipContent', () => { + it('renders tooltip', () => { + const { getByText, queryByText } = render( + <WaterfallTooltipContent text="1. https://www.elastic.co" url="https://www.elastic.co" /> + ); + expect(getByText('#000000')).toBeInTheDocument(); + expect(getByText('test-val')).toBeInTheDocument(); + expect(getByText('1. https://www.elastic.co')).toBeInTheDocument(); + expect(queryByText('#010000')).toBeNull(); + expect(queryByText('test-val-missing')).toBeNull(); + }); + + it(`doesn't render metric if tooltip props missing`, () => { + const { getAllByLabelText, getByText } = render( + <WaterfallTooltipContent text="1. https://www.elastic.co" url="https://www.elastic.co" /> + ); + const metricElements = getAllByLabelText('tooltip item'); + expect(metricElements).toHaveLength(1); + expect(getByText('test-val')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.tsx new file mode 100644 index 0000000000000..b9f385c29b9f8 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.tsx @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiText } from '@elastic/eui'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { useWaterfallContext } from '../context/waterfall_chart'; + +interface Props { + text: string; + url: string; +} + +const StyledText = euiStyled(EuiText)` + font-weight: bold; +`; + +const StyledHorizontalRule = euiStyled(EuiHorizontalRule)` + background-color: ${(props) => props.theme.eui.euiColorDarkShade}; +`; + +export const WaterfallTooltipContent: React.FC<Props> = ({ text, url }) => { + const { data, renderTooltipItem, sidebarItems } = useWaterfallContext(); + + const tooltipMetrics = data.filter( + (datum) => + datum.x === sidebarItems?.find((sidebarItem) => sidebarItem.url === url)?.index && + datum.config.tooltipProps && + datum.config.showTooltip + ); + return ( + <> + <StyledText>{text}</StyledText> + <StyledHorizontalRule margin="none" /> + <EuiFlexGroup direction="column" gutterSize="none"> + {tooltipMetrics.map((item, idx) => ( + <EuiFlexItem key={idx}>{renderTooltipItem(item.config.tooltipProps)}</EuiFlexItem> + ))} + </EuiFlexGroup> + </> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/context/waterfall_chart.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/context/waterfall_chart.tsx new file mode 100644 index 0000000000000..115dd15b416fc --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/context/waterfall_chart.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, { createContext, useContext, Context } from 'react'; +import { JourneyStep } from '../../../../../../../../../common/runtime_types'; +import { WaterfallData, WaterfallDataEntry, WaterfallMetadata } from '../types'; +import { OnSidebarClick, OnElementClick, OnProjectionClick } from '../components/use_flyout'; +import { SidebarItems } from '../../step_detail/waterfall/types'; + +export type MarkerItems = Array<{ + id: + | 'domContentLoaded' + | 'firstContentfulPaint' + | 'largestContentfulPaint' + | 'layoutShift' + | 'loadEvent' + | 'navigationStart'; + offset: number; +}>; + +export interface IWaterfallContext { + totalNetworkRequests: number; + highlightedNetworkRequests: number; + fetchedNetworkRequests: number; + data: WaterfallData; + onElementClick?: OnElementClick; + onProjectionClick?: OnProjectionClick; + onSidebarClick?: OnSidebarClick; + showOnlyHighlightedNetworkRequests: boolean; + sidebarItems?: SidebarItems; + legendItems?: unknown[]; + metadata: WaterfallMetadata; + renderTooltipItem: ( + item: WaterfallDataEntry['config']['tooltipProps'], + index?: number + ) => JSX.Element; + markerItems?: MarkerItems; + activeStep?: JourneyStep; +} + +export const WaterfallContext = createContext<Partial<IWaterfallContext>>({}); + +interface ProviderProps { + totalNetworkRequests: number; + highlightedNetworkRequests: number; + fetchedNetworkRequests: number; + data: IWaterfallContext['data']; + onElementClick?: IWaterfallContext['onElementClick']; + onProjectionClick?: IWaterfallContext['onProjectionClick']; + onSidebarClick?: IWaterfallContext['onSidebarClick']; + showOnlyHighlightedNetworkRequests: IWaterfallContext['showOnlyHighlightedNetworkRequests']; + sidebarItems?: IWaterfallContext['sidebarItems']; + legendItems?: IWaterfallContext['legendItems']; + metadata: IWaterfallContext['metadata']; + renderTooltipItem: IWaterfallContext['renderTooltipItem']; + markerItems?: MarkerItems; + activeStep?: JourneyStep; +} + +export const WaterfallProvider: React.FC<ProviderProps> = ({ + children, + data, + markerItems, + onElementClick, + onProjectionClick, + onSidebarClick, + showOnlyHighlightedNetworkRequests, + sidebarItems, + legendItems, + metadata, + renderTooltipItem, + totalNetworkRequests, + highlightedNetworkRequests, + fetchedNetworkRequests, + activeStep, +}) => { + return ( + <WaterfallContext.Provider + value={{ + data, + activeStep, + markerItems, + showOnlyHighlightedNetworkRequests, + sidebarItems, + legendItems, + metadata, + onElementClick, + onProjectionClick, + onSidebarClick, + renderTooltipItem, + totalNetworkRequests, + highlightedNetworkRequests, + fetchedNetworkRequests, + }} + > + {children} + </WaterfallContext.Provider> + ); +}; + +export const useWaterfallContext = () => + useContext(WaterfallContext as unknown as Context<IWaterfallContext>); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/index.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/index.tsx new file mode 100644 index 0000000000000..b83cb630aaa79 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/index.tsx @@ -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 type { RenderItem, WaterfallChartProps } from './components/waterfall_chart'; +export { WaterfallChart } from './components/waterfall_chart'; +export { WaterfallProvider, useWaterfallContext } from './context/waterfall_chart'; +export { MiddleTruncatedText } from './components/middle_truncated_text'; +export { useFlyout } from './components/use_flyout'; +export type { + WaterfallData, + WaterfallDataEntry, + WaterfallMetadata, + WaterfallMetadataEntry, +} from './types'; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/types.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/types.ts new file mode 100644 index 0000000000000..f1775a6fd1892 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/types.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. + */ + +interface PlotProperties { + x: number; + y: number; + y0: number; +} + +export interface WaterfallDataSeriesConfigProperties { + tooltipProps?: Record<string, string | number>; + showTooltip: boolean; +} + +export interface WaterfallMetadataItem { + name: string; + value?: string; +} + +export interface WaterfallMetadataEntry { + x: number; + url: string; + requestHeaders?: WaterfallMetadataItem[]; + responseHeaders?: WaterfallMetadataItem[]; + certificates?: WaterfallMetadataItem[]; + details: WaterfallMetadataItem[]; +} + +export type WaterfallDataEntry = PlotProperties & { + config: WaterfallDataSeriesConfigProperties & Record<string, unknown>; +}; + +export type WaterfallMetadata = WaterfallMetadataEntry[]; + +export type WaterfallData = WaterfallDataEntry[]; + +export type RenderItem<I = any> = (item: I, index: number) => JSX.Element; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/object_count_list.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/object_count_list.tsx new file mode 100644 index 0000000000000..dbd21773a0e77 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/object_count_list.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, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { ColorPalette } from './color_palette'; +import { useObjectMetrics } from '../hooks/use_object_metrics'; + +export const ObjectCountList = () => { + const objectMetrics = useObjectMetrics(); + + return ( + <> + <EuiFlexGroup> + <EuiFlexItem grow> + <EuiTitle size="xs"> + <h3>{OBJECT_COUNT_LABEL}</h3> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText> + {TOTAL_LABEL}: <span style={{ fontWeight: 'bold' }}> {objectMetrics.totalObjects}</span> + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> + <EuiSpacer size="s" /> + <div> + {objectMetrics.items.map(({ label, mimeType, percent, count }) => ( + <> + <ColorPalette + label={label} + mimeType={mimeType} + percent={percent} + value={String(count)} + valueWidth={30} + loading={objectMetrics.loading} + /> + <EuiSpacer size="m" /> + </> + ))} + </div> + </> + ); +}; + +const OBJECT_COUNT_LABEL = i18n.translate('xpack.synthetics.stepDetails.objectCount', { + defaultMessage: 'Object count', +}); + +const TOTAL_LABEL = i18n.translate('xpack.synthetics.stepDetails.total', { + defaultMessage: 'Total', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/object_weight_list.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/object_weight_list.tsx new file mode 100644 index 0000000000000..6fd10b6545196 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/object_weight_list.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, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { ColorPalette } from './color_palette'; +import { useObjectMetrics } from '../hooks/use_object_metrics'; + +export const ObjectWeightList = () => { + const objectMetrics = useObjectMetrics(); + + return ( + <> + <EuiFlexGroup> + <EuiFlexItem grow> + <EuiTitle size="xs"> + <h3>{OBJECT_WEIGHT_LABEL}</h3> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText size="s"> + {TOTAL_SIZE_LABEL}:{' '} + <span style={{ fontWeight: 'bold' }}>{objectMetrics.totalObjectsWeight}</span> + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> + <EuiSpacer size="s" /> + <div> + {objectMetrics.items.map(({ label, mimeType, weightPercent, weight }) => ( + <> + <ColorPalette + label={label} + mimeType={mimeType} + percent={weightPercent} + value={weight} + loading={objectMetrics.loading} + /> + <EuiSpacer size="m" />{' '} + </> + ))} + </div> + </> + ); +}; + +const OBJECT_WEIGHT_LABEL = i18n.translate('xpack.synthetics.stepDetails.objectWeight', { + defaultMessage: 'Object weight', +}); + +const TOTAL_SIZE_LABEL = i18n.translate('xpack.synthetics.stepDetails.totalSize', { + defaultMessage: 'Total size', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/last_successful_screenshot.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/last_successful_screenshot.tsx new file mode 100644 index 0000000000000..3874d29197d3c --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/last_successful_screenshot.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 { useFetcher } from '@kbn/observability-plugin/public'; +import { EuiSpacer } from '@elastic/eui'; +import React from 'react'; +import { useParams } from 'react-router-dom'; +import { fetchLastSuccessfulCheck } from '../../../../state'; +import { JourneyStep } from '../../../../../../../common/runtime_types'; +import { EmptyImage } from '../../../common/screenshot/empty_image'; +import { JourneyStepScreenshotContainer } from '../../../common/screenshot/journey_step_screenshot_container'; + +export const LastSuccessfulScreenshot = ({ step }: { step: JourneyStep }) => { + const { stepIndex } = useParams<{ checkGroupId: string; stepIndex: string }>(); + + const { data, loading } = useFetcher(() => { + return fetchLastSuccessfulCheck({ + timestamp: step['@timestamp'], + monitorId: step.monitor.id, + stepIndex: Number(stepIndex), + location: step.observer?.geo?.name, + }); + }, [step._id, step['@timestamp']]); + + if (loading || !data) { + return <EmptyImage isLoading={Boolean(loading)} />; + } + + return ( + <> + <JourneyStepScreenshotContainer + checkGroup={data?.monitor.check_group} + initialStepNo={data?.synthetics?.step?.index} + stepStatus={data?.synthetics?.payload?.status} + allStepsLoaded={true} + stepLabels={[]} + retryFetchOnRevisit={false} + asThumbnail={false} + /> + <EuiSpacer size="xs" /> + </> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/screenshot_link.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/screenshot_link.tsx new file mode 100644 index 0000000000000..803c1fcc53121 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/screenshot_link.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 { FormattedMessage } from '@kbn/i18n-react'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { ReactRouterEuiLink } from '../../../common/react_router_helpers'; +import { Ping } from '../../../../../../../common/runtime_types'; + +const LabelLink = euiStyled.div` + margin-bottom: ${(props) => props.theme.eui.euiSizeXS}; + font-size: ${({ theme }) => theme.eui.euiFontSizeS}; +`; + +interface Props { + lastSuccessfulCheck: Ping; +} + +export const ScreenshotLink = ({ lastSuccessfulCheck }: Props) => { + return ( + <span> + <FormattedMessage + id="xpack.synthetics.synthetics.executedStep.screenshot.successfulLink" + defaultMessage="Screenshot from {link}" + values={{ + link: ( + <ReactRouterEuiLink + to={`/journey/${lastSuccessfulCheck?.monitor?.check_group}/steps`} + className="eui-displayInlineBlock" + > + <LabelLink> + <FormattedMessage + id="xpack.synthetics.synthetics.executedStep.screenshot.success" + defaultMessage="last successful check" + /> + </LabelLink> + </ReactRouterEuiLink> + ), + }} + /> + </span> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.test.tsx new file mode 100644 index 0000000000000..7a275527de3c6 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.test.tsx @@ -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 React from 'react'; +import { StepScreenshotDisplay } from './step_screenshot_display'; +import * as observabilityPublic from '@kbn/observability-plugin/public'; +import { mockRef } from '../../../../utils/testing/__mocks__/screenshot_ref.mock'; +import { render } from '../../../../utils/testing'; +import '../../../../utils/testing/__mocks__/use_composite_image.mock'; +jest.mock('@kbn/observability-plugin/public'); + +jest.mock('react-use/lib/useIntersection', () => () => ({ + isIntersecting: true, +})); + +describe('StepScreenshotDisplayProps', () => { + beforeAll(() => { + jest.spyOn(observabilityPublic, 'useFetcher').mockReturnValue({ + data: null, + status: observabilityPublic.FETCH_STATUS.SUCCESS, + refetch: () => {}, + }); + }); + + afterAll(() => { + (observabilityPublic.useFetcher as any).mockClear(); + }); + it('displays screenshot thumbnail when present', () => { + const { getByAltText } = render( + <StepScreenshotDisplay + checkGroup="check_group" + isFullScreenshot={true} + isScreenshotRef={false} + stepIndex={1} + stepName="STEP_NAME" + /> + ); + + expect(getByAltText('Screenshot for step with name "STEP_NAME"')).toBeInTheDocument(); + }); + + it('uses alternative text when step name not available', () => { + const { getByAltText } = render( + <StepScreenshotDisplay + checkGroup="check_group" + isFullScreenshot={true} + isScreenshotRef={false} + stepIndex={1} + /> + ); + + expect(getByAltText('Screenshot')).toBeInTheDocument(); + }); + + it('displays No Image message when screenshot does not exist', () => { + const { getByTestId } = render( + <StepScreenshotDisplay + checkGroup="check_group" + isFullScreenshot={false} + isScreenshotRef={false} + stepIndex={1} + stepName="STEP_NAME" + /> + ); + expect(getByTestId('stepScreenshotImageUnavailable')).toBeInTheDocument(); + }); + + it('displays screenshot thumbnail for ref', () => { + jest.spyOn(observabilityPublic, 'useFetcher').mockReturnValue({ + status: observabilityPublic.FETCH_STATUS.SUCCESS, + data: { ...mockRef }, + refetch: () => null, + }); + + const { getByAltText } = render( + <StepScreenshotDisplay + checkGroup="check_group" + isFullScreenshot={false} + isScreenshotRef={true} + stepIndex={1} + stepName="STEP_NAME" + /> + ); + + expect(getByAltText('Screenshot for step with name "STEP_NAME"')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.tsx new file mode 100644 index 0000000000000..1dbfe9595cc44 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.tsx @@ -0,0 +1,197 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, + EuiImage, + EuiLoadingSpinner, + EuiText, +} from '@elastic/eui'; +import styled from 'styled-components'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import React, { useEffect, useMemo, useRef, useState, FC } from 'react'; +import useIntersection from 'react-use/lib/useIntersection'; +import { useFetcher } from '@kbn/observability-plugin/public'; +import { getJourneyScreenshot } from '../../../../state'; +import { useCompositeImage } from '../../../../hooks'; +import { + useSyntheticsRefreshContext, + useSyntheticsSettingsContext, + useSyntheticsThemeContext, +} from '../../../../contexts'; +import { + isScreenshotRef as isAScreenshotRef, + ScreenshotRefImageData, +} from '../../../../../../../common/runtime_types'; + +interface StepScreenshotDisplayProps { + isFullScreenshot: boolean; + isScreenshotRef: boolean; + checkGroup?: string; + stepIndex?: number; + stepName?: string; + lazyLoad?: boolean; +} + +const IMAGE_MAX_WIDTH = 640; + +const StepImage = styled(EuiImage)` + &&& { + figcaption { + display: none; + } + objectFit: 'cover', + objectPosition: 'center top', + } +`; + +const BaseStepImage = ({ + stepIndex, + stepName, + url, +}: Pick<StepScreenshotDisplayProps, 'stepIndex' | 'stepName'> & { url?: string }) => { + if (!url) return <EuiLoadingSpinner size="l" />; + return ( + <StepImage + allowFullScreen={true} + alt={ + stepName + ? i18n.translate('xpack.synthetics.synthetics.screenshotDisplay.altText', { + defaultMessage: 'Screenshot for step with name "{stepName}"', + values: { + stepName, + }, + }) + : i18n.translate('xpack.synthetics.synthetics.screenshotDisplay.altTextWithoutName', { + defaultMessage: 'Screenshot', + }) + } + caption={`Step:${stepIndex} ${stepName}`} + hasShadow + url={url} + /> + ); +}; + +type ComposedStepImageProps = Pick<StepScreenshotDisplayProps, 'stepIndex' | 'stepName'> & { + url: string | undefined; + imgRef: ScreenshotRefImageData; + setUrl: React.Dispatch<string | undefined>; +}; + +const ComposedStepImage = ({ + stepIndex, + stepName, + url, + imgRef, + setUrl, +}: ComposedStepImageProps) => { + useCompositeImage(imgRef, setUrl, url); + if (!url) return <EuiLoadingSpinner size="l" />; + return <BaseStepImage stepIndex={stepIndex} stepName={stepName} url={url} />; +}; + +export const StepScreenshotDisplay: FC<StepScreenshotDisplayProps> = ({ + checkGroup, + isFullScreenshot: isScreenshotBlob, + isScreenshotRef, + stepIndex, + stepName, + lazyLoad = true, +}) => { + const containerRef = useRef(null); + const { + colors: { lightestShade: pageBackground }, + } = useSyntheticsThemeContext(); + + const { basePath } = useSyntheticsSettingsContext(); + + const intersection = useIntersection(containerRef, { + root: null, + rootMargin: '0px', + threshold: 1, + }); + const { lastRefresh } = useSyntheticsRefreshContext(); + + const [hasIntersected, setHasIntersected] = useState<boolean>(false); + const isIntersecting = intersection?.isIntersecting; + useEffect(() => { + if (hasIntersected === false && isIntersecting === true) { + setHasIntersected(true); + } + }, [hasIntersected, isIntersecting, setHasIntersected]); + + const imgSrc = basePath + `/internal/uptime/journey/screenshot/${checkGroup}/${stepIndex}`; + + // When loading a legacy screenshot, set `url` to full-size screenshot path. + // Otherwise, we first need to composite the image. + const [url, setUrl] = useState<string | undefined>(isScreenshotBlob ? imgSrc : undefined); + + // when the image is a composite, we need to fetch the data since we cannot specify a blob URL + const { data: screenshotRef } = useFetcher(() => { + if (isScreenshotRef) { + return getJourneyScreenshot(imgSrc); + } + }, [basePath, checkGroup, imgSrc, stepIndex, isScreenshotRef, lastRefresh]); + + const refDimensions = useMemo(() => { + if (isAScreenshotRef(screenshotRef)) { + const { height, width } = screenshotRef.ref.screenshotRef.screenshot_ref; + return { height, width }; + } + }, [screenshotRef]); + + const shouldRenderImage = hasIntersected || !lazyLoad; + return ( + <div + ref={containerRef} + style={{ + backgroundColor: pageBackground, + maxWidth: Math.min(IMAGE_MAX_WIDTH, refDimensions?.width ?? Number.MAX_VALUE), + maxHeight: refDimensions?.height ?? undefined, + }} + > + {shouldRenderImage && isScreenshotBlob && ( + <BaseStepImage stepName={stepName} stepIndex={stepIndex} url={url} /> + )} + {shouldRenderImage && isScreenshotRef && isAScreenshotRef(screenshotRef) && ( + <ComposedStepImage + imgRef={screenshotRef} + stepName={stepName} + stepIndex={stepIndex} + setUrl={setUrl} + url={url} + /> + )} + {!isScreenshotBlob && !isScreenshotRef && ( + <EuiFlexGroup + alignItems="center" + direction="column" + style={{ paddingTop: '32px' }} + data-test-subj="stepScreenshotImageUnavailable" + > + <EuiFlexItem grow={false}> + <EuiIcon color="subdued" size="xxl" type="image" /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText> + <strong> + <FormattedMessage + id="xpack.synthetics.synthetics.screenshot.noImageMessage" + defaultMessage="No image available" + /> + </strong> + </EuiText> + </EuiFlexItem> + </EuiFlexGroup> + )} + </div> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/step_image.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/step_image.tsx new file mode 100644 index 0000000000000..a08ba79444ccb --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/step_image.tsx @@ -0,0 +1,90 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState } from 'react'; +import { EuiButtonGroup, EuiSpacer, EuiTitle } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { LastSuccessfulScreenshot } from './screenshot/last_successful_screenshot'; +import { JourneyStep } from '../../../../../../common/runtime_types'; +import { JourneyStepScreenshotContainer } from '../../common/screenshot/journey_step_screenshot_container'; + +export const StepImage = ({ + step, + ping, + isFailed, + stepLabels, +}: { + ping: JourneyStep; + step: JourneyStep; + isFailed?: boolean; + stepLabels?: string[]; +}) => { + const toggleButtons = [ + { + id: `received`, + label: RECEIVED_LABEL, + }, + { + id: `expected`, + label: EXPECTED_LABEL, + }, + ]; + + const [idSelected, setIdSelected] = useState(`received`); + + const onChangeDisabled = (optionId: string) => { + setIdSelected(optionId); + }; + + return ( + <> + <EuiTitle size="xs"> + <h3>{SCREENSHOT_LABEL}</h3> + </EuiTitle> + <EuiSpacer size="m" /> + <div className="eui-textCenter"> + {idSelected === 'received' ? ( + <JourneyStepScreenshotContainer + checkGroup={step?.monitor.check_group} + initialStepNo={step?.synthetics?.step?.index} + stepStatus={step?.synthetics.payload?.status} + allStepsLoaded={true} + stepLabels={stepLabels} + retryFetchOnRevisit={false} + asThumbnail={false} + /> + ) : ( + <LastSuccessfulScreenshot step={ping} /> + )} + + <EuiSpacer size="l" /> + {isFailed && ( + <EuiButtonGroup + legend="" + options={toggleButtons} + idSelected={idSelected} + onChange={(id) => onChangeDisabled(id)} + buttonSize="s" + isFullWidth + /> + )} + </div> + </> + ); +}; + +const SCREENSHOT_LABEL = i18n.translate('xpack.synthetics.stepDetails.screenshot', { + defaultMessage: 'Screenshot', +}); + +const EXPECTED_LABEL = i18n.translate('xpack.synthetics.stepDetails.expected', { + defaultMessage: 'Expected', +}); + +const RECEIVED_LABEL = i18n.translate('xpack.synthetics.stepDetails.received', { + defaultMessage: 'Received', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/timings_breakdown/breakdown_legend.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/timings_breakdown/breakdown_legend.tsx new file mode 100644 index 0000000000000..323bd98a4f758 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/timings_breakdown/breakdown_legend.tsx @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiSpacer, EuiText } from '@elastic/eui'; +import React from 'react'; +import { useTheme } from '@kbn/observability-plugin/public'; +import { formatMillisecond } from '../network_timings_donut'; +import { useNetworkTimings } from '../../hooks/use_network_timings'; + +export const BreakdownLegend = () => { + const networkTimings = useNetworkTimings(); + + const theme = useTheme(); + + return ( + <> + <EuiSpacer size="xxl" /> + <EuiFlexGroup direction="column" gutterSize="s"> + {networkTimings.timingsWithLabels.map(({ label, value }, index) => ( + <EuiFlexGroup gutterSize="s"> + <EuiFlexItem grow={true}> + <EuiHealth + color={(theme.eui as unknown as Record<string, string>)[`euiColorVis${index + 1}`]} + > + {label} + </EuiHealth> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText size="s">{formatMillisecond(value)}</EuiText> + </EuiFlexItem> + </EuiFlexGroup> + ))} + </EuiFlexGroup> + </> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings.ts new file mode 100644 index 0000000000000..911e5a54f05f7 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings.ts @@ -0,0 +1,204 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useEsSearch } from '@kbn/observability-plugin/public'; +import { + NETWORK_TIMINGS_FIELDS, + SYNTHETICS_BLOCKED_TIMINGS, + SYNTHETICS_CONNECT_TIMINGS, + SYNTHETICS_DNS_TIMINGS, + SYNTHETICS_RECEIVE_TIMINGS, + SYNTHETICS_SEND_TIMINGS, + SYNTHETICS_SSL_TIMINGS, + SYNTHETICS_STEP_DURATION, + SYNTHETICS_TOTAL_TIMINGS, + SYNTHETICS_WAIT_TIMINGS, +} from '@kbn/observability-plugin/common'; +import { useParams } from 'react-router-dom'; +import { i18n } from '@kbn/i18n'; + +export const useStepFilters = (prevCheckGroupId?: string) => { + const { checkGroupId, stepIndex } = useParams<{ checkGroupId: string; stepIndex: string }>(); + return [ + { + term: { + 'monitor.check_group': prevCheckGroupId ?? checkGroupId, + }, + }, + { + term: { + 'synthetics.step.index': Number(stepIndex), + }, + }, + ]; +}; + +export const useNetworkTimings = () => { + const runTimeMappings = NETWORK_TIMINGS_FIELDS.reduce( + (acc, field) => ({ + ...acc, + [field]: { + type: 'double', + }, + }), + {} + ); + + const networkAggs = NETWORK_TIMINGS_FIELDS.reduce( + (acc, field) => ({ + ...acc, + [field]: { + sum: { + field, + }, + }, + }), + {} + ); + + const { data } = useEsSearch( + { + index: 'synthetics-*', + body: { + size: 0, + runtime_mappings: runTimeMappings, + query: { + bool: { + filter: [ + { + term: { + 'synthetics.type': 'journey/network_info', + }, + }, + ...useStepFilters(), + ], + }, + }, + aggs: { + ...networkAggs, + totalDuration: { + sum: { + field: SYNTHETICS_STEP_DURATION, + }, + }, + dns: { + sum: { + field: SYNTHETICS_DNS_TIMINGS, + }, + }, + ssl: { + sum: { + field: SYNTHETICS_SSL_TIMINGS, + }, + }, + blocked: { + sum: { + field: SYNTHETICS_BLOCKED_TIMINGS, + }, + }, + connect: { + sum: { + field: SYNTHETICS_CONNECT_TIMINGS, + }, + }, + receive: { + sum: { + field: SYNTHETICS_RECEIVE_TIMINGS, + }, + }, + send: { + sum: { + field: SYNTHETICS_SEND_TIMINGS, + }, + }, + wait: { + sum: { + field: SYNTHETICS_WAIT_TIMINGS, + }, + }, + total: { + sum: { + field: SYNTHETICS_TOTAL_TIMINGS, + }, + }, + }, + }, + }, + [], + { name: 'networkTimings' } + ); + + const aggs = data?.aggregations; + + const timings = { + dns: aggs?.dns.value ?? 0, + connect: aggs?.connect.value ?? 0, + receive: aggs?.receive.value ?? 0, + send: aggs?.send.value ?? 0, + wait: aggs?.wait.value ?? 0, + blocked: aggs?.blocked.value ?? 0, + ssl: aggs?.ssl.value ?? 0, + }; + + return { + timings, + timingsWithLabels: [ + { + value: timings.dns, + label: SYNTHETICS_DNS_TIMINGS_LABEL, + }, + { + value: timings.ssl, + label: SYNTHETICS_SSL_TIMINGS_LABEL, + }, + { + value: timings.blocked, + label: SYNTHETICS_BLOCKED_TIMINGS_LABEL, + }, + { + value: timings.connect, + label: SYNTHETICS_CONNECT_TIMINGS_LABEL, + }, + { + value: timings.receive, + label: SYNTHETICS_RECEIVE_TIMINGS_LABEL, + }, + { + value: timings.send, + label: SYNTHETICS_SEND_TIMINGS_LABEL, + }, + { + value: timings.wait, + label: SYNTHETICS_WAIT_TIMINGS_LABEL, + }, + ].sort((a, b) => b.value - a.value), + totalDuration: aggs?.totalDuration.value ?? 0, + }; +}; + +const SYNTHETICS_CONNECT_TIMINGS_LABEL = i18n.translate('xpack.synthetics.connect.label', { + defaultMessage: 'Connect', +}); +const SYNTHETICS_DNS_TIMINGS_LABEL = i18n.translate('xpack.synthetics.dns', { + defaultMessage: 'DNS', +}); +const SYNTHETICS_WAIT_TIMINGS_LABEL = i18n.translate('xpack.synthetics.wait', { + defaultMessage: 'Wait', +}); + +const SYNTHETICS_SSL_TIMINGS_LABEL = i18n.translate('xpack.synthetics.ssl', { + defaultMessage: 'SSL', +}); +const SYNTHETICS_BLOCKED_TIMINGS_LABEL = i18n.translate('xpack.synthetics.blocked', { + defaultMessage: 'Blocked', +}); +const SYNTHETICS_SEND_TIMINGS_LABEL = i18n.translate('xpack.synthetics.send', { + defaultMessage: 'Send', +}); +const SYNTHETICS_RECEIVE_TIMINGS_LABEL = i18n.translate('xpack.synthetics.receive', { + defaultMessage: 'Receive', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_object_metrics.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_object_metrics.ts new file mode 100644 index 0000000000000..c80d57af30766 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_object_metrics.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 { useSelector } from 'react-redux'; +import { useParams } from 'react-router-dom'; +import { MIME_FILTERS } from '../components/network_waterfall/step_detail/waterfall/waterfall_filter'; +import { + MimeType, + MimeTypesMap, +} from '../components/network_waterfall/step_detail/waterfall/types'; +import { networkEventsSelector } from '../../../state/network_events/selectors'; + +export const useObjectMetrics = () => { + const { checkGroupId, stepIndex } = useParams<{ checkGroupId: string; stepIndex: string }>(); + + const _networkEvents = useSelector(networkEventsSelector); + const networkEvents = _networkEvents[checkGroupId ?? '']?.[Number(stepIndex)]; + + const objectTypeCounts: Record<string, number> = {}; + const objectTypeWeights: Record<string, number> = {}; + + networkEvents?.events.forEach((event) => { + if (event.mimeType) { + objectTypeCounts[MimeTypesMap[event.mimeType] ?? MimeType.Other] = + (objectTypeCounts[MimeTypesMap[event.mimeType] ?? MimeType.Other] ?? 0) + 1; + objectTypeWeights[MimeTypesMap[event.mimeType] ?? MimeType.Other] = + (objectTypeWeights[MimeTypesMap[event.mimeType] ?? MimeType.Other] ?? 0) + + (event.transferSize || 0); + } + }); + + const totalObjects = Object.values(objectTypeCounts).reduce((acc, val) => acc + val, 0); + + const totalObjectsWeight = Object.values(objectTypeWeights).reduce((acc, val) => acc + val, 0); + + return { + loading: networkEvents?.loading ?? true, + totalObjects, + totalObjectsWeight: formatBytes(totalObjectsWeight), + items: MIME_FILTERS.map(({ label, mimeType }) => ({ + label, + count: objectTypeCounts[mimeType] ?? 0, + total: totalObjects, + mimeType, + percent: ((objectTypeCounts[mimeType] ?? 0) / totalObjects) * 100, + weight: formatBytes(objectTypeWeights[mimeType] ?? 0), + weightPercent: ((objectTypeWeights[mimeType] ?? 0) / totalObjectsWeight) * 100, + })), + }; +}; + +const formatBytes = (bytes: number, decimals = 0) => { + if (bytes === 0) return '0 Bytes'; + + const k = 1024; + const dm = decimals < 0 ? 0 : decimals; + const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + + const i = Math.floor(Math.log(bytes) / Math.log(k)); + + return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.ts new file mode 100644 index 0000000000000..4c79502ce665f --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.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 { useParams } from 'react-router-dom'; +import { useMemo } from 'react'; +import { useSyntheticsSettingsContext } from '../../../contexts'; +import { useJourneySteps } from '../../monitor_details/hooks/use_journey_steps'; +import { JourneyStep, SyntheticsJourneyApiResponse } from '../../../../../../common/runtime_types'; + +export const useStepDetailPage = (): { + activeStep?: JourneyStep; + checkGroupId: string; + handleNextStepHref: string; + handlePreviousStepHref: string; + handleNextRunHref: string; + handlePreviousRunHref: string; + hasNextStep: boolean; + hasPreviousStep: boolean; + journey?: SyntheticsJourneyApiResponse; + stepIndex: number; +} => { + const { checkGroupId, stepIndex: stepIndexString } = useParams<{ + checkGroupId: string; + stepIndex: string; + }>(); + + const stepIndex = Number(stepIndexString); + + const { data: journey } = useJourneySteps(checkGroupId); + + const memoized = useMemo( + () => ({ + hasPreviousStep: stepIndex > 1 ? true : false, + activeStep: journey?.steps?.find((step) => step.synthetics?.step?.index === stepIndex), + hasNextStep: journey && journey.steps && stepIndex < journey.steps.length ? true : false, + }), + [journey, stepIndex] + ); + + const { basePath } = useSyntheticsSettingsContext(); + + const handleNextStepHref = `${basePath}/app/synthetics/journey/${checkGroupId}/step/${ + stepIndex + 1 + }`; + + const handlePreviousStepHref = `${basePath}/app/synthetics/journey/${checkGroupId}/step/${ + stepIndex - 1 + }`; + + const handleNextRunHref = `${basePath}/app/synthetics/journey/${journey?.details?.next?.checkGroup}/step/1`; + + const handlePreviousRunHref = `${basePath}/app/synthetics/journey/${journey?.details?.previous?.checkGroup}/step/1`; + + return { + checkGroupId, + journey, + stepIndex, + ...memoized, + handleNextStepHref, + handlePreviousStepHref, + handleNextRunHref, + handlePreviousRunHref, + }; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts new file mode 100644 index 0000000000000..b42417083cc3a --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.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 { i18n } from '@kbn/i18n'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { useBreadcrumbs } from '../../../hooks/use_breadcrumbs'; +import { MONITORS_ROUTE } from '../../../../../../common/constants'; +import { PLUGIN } from '../../../../../../common/constants/plugin'; + +export const useStepDetailsBreadcrumbs = (extraCrumbs?: Array<{ text: string; href?: string }>) => { + const kibana = useKibana(); + const appPath = kibana.services.application?.getUrlForApp(PLUGIN.SYNTHETICS_PLUGIN_ID) ?? ''; + + useBreadcrumbs([ + { + text: MONITOR_MANAGEMENT_CRUMB, + href: `${appPath}/${MONITORS_ROUTE}`, + }, + ...(extraCrumbs ?? []), + ]); +}; + +const MONITOR_MANAGEMENT_CRUMB = i18n.translate('xpack.synthetics.monitorsPage.monitorsMCrumb', { + defaultMessage: 'Monitors', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/network_timings_breakdown.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/network_timings_breakdown.tsx new file mode 100644 index 0000000000000..27ec3e6deffbb --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/network_timings_breakdown.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 from 'react'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { useParams } from 'react-router-dom'; +import { ReportTypes } from '@kbn/observability-plugin/public'; +import { EuiSpacer, EuiTitle } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { ClientPluginsStart } from '../../../../plugin'; + +export const NetworkTimingsBreakdown = ({ monitorId }: { monitorId: string }) => { + const { observability } = useKibana<ClientPluginsStart>().services; + + const ExploratoryViewEmbeddable = observability.ExploratoryViewEmbeddable; + + const { stepIndex } = useParams<{ checkGroupId: string; stepIndex: string }>(); + + return ( + <> + <EuiTitle size="xs"> + <h3>{LAST_24_HOURS}</h3> + </EuiTitle> + <EuiSpacer size="xs" /> + <ExploratoryViewEmbeddable + customHeight="250px" + reportType={ReportTypes.KPI} + legendIsVisible={false} + axisTitlesVisibility={{ x: false, yLeft: false, yRight: false }} + attributes={[ + { + operationType: 'last_value', + seriesType: 'area_stacked', + dataType: 'synthetics', + name: 'Network timings', + selectedMetricField: 'network_timings', + reportDefinitions: { 'monitor.id': [monitorId] }, + time: { + from: 'now-24h/h', + to: 'now', + }, + filters: [ + { + field: 'synthetics.step.index', + values: [stepIndex], + }, + ], + }, + ]} + /> + </> + ); +}; + +const LAST_24_HOURS = i18n.translate('xpack.synthetics.stepDetailsRoute.last24Hours', { + defaultMessage: 'Last 24 hours', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx new file mode 100644 index 0000000000000..af7e8dfe9ced2 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx @@ -0,0 +1,122 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { useParams } from 'react-router-dom'; +import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiHorizontalRule, + EuiPanel, + EuiLoadingSpinner, + EuiSpacer, +} from '@elastic/eui'; +import { BreakdownLegend } from './components/timings_breakdown/breakdown_legend'; +import { WaterfallChartContainer } from './components/network_waterfall/step_detail/waterfall/waterfall_chart_container'; +import { ObjectWeightList } from './components/object_weight_list'; +import { NetworkTimingsDonut } from './components/network_timings_donut'; +import { NetworkTimingsBreakdown } from './network_timings_breakdown'; +import { ObjectCountList } from './components/object_count_list'; +import { StepImage } from './components/step_image'; +import { useJourneySteps } from '../monitor_details/hooks/use_journey_steps'; +import { MonitorDetailsLinkPortal } from '../monitor_add_edit/monitor_details_portal'; + +import { useStepDetailsBreadcrumbs } from './hooks/use_step_details_breadcrumbs'; + +export const StepDetailPage = () => { + const { checkGroupId, stepIndex } = useParams<{ checkGroupId: string; stepIndex: string }>(); + + useTrackPageview({ app: 'synthetics', path: 'stepDetail' }); + useTrackPageview({ app: 'synthetics', path: 'stepDetail', delay: 15000 }); + + const { data, loading, isFailed, currentStep, stepLabels } = useJourneySteps(checkGroupId); + + const activeStep = data?.steps?.find( + (step) => step.synthetics?.step?.index === Number(stepIndex) + ); + + useStepDetailsBreadcrumbs([{ text: data?.details?.journey.monitor.name ?? '' }]); + + if (loading) { + return ( + <div className="eui-textCenter"> + <EuiLoadingSpinner size="xxl" /> + </div> + ); + } + + return ( + <> + {data?.details?.journey && ( + <MonitorDetailsLinkPortal + id={data.details.journey.monitor.id} + name={data.details.journey.monitor.name!} + /> + )} + <EuiFlexGroup gutterSize="m"> + <EuiFlexItem grow={1}> + <EuiPanel hasShadow={false} hasBorder> + {data?.details?.journey && currentStep && ( + <StepImage + ping={data?.details?.journey} + step={currentStep} + isFailed={isFailed} + stepLabels={stepLabels} + /> + )} + </EuiPanel> + </EuiFlexItem> + <EuiFlexItem grow={2}> + <EuiPanel hasShadow={false} hasBorder> + <EuiFlexGroup> + <EuiFlexItem grow={1}> + <NetworkTimingsDonut /> + </EuiFlexItem> + <EuiFlexItem grow={1}> + <BreakdownLegend /> + </EuiFlexItem> + <EuiFlexItem grow={2}> + <NetworkTimingsBreakdown monitorId={data?.details?.journey.monitor.id!} /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + </EuiFlexItem> + </EuiFlexGroup> + <EuiSpacer size="m" /> + <EuiFlexGroup gutterSize="m"> + <EuiFlexItem grow={1}> + <EuiPanel hasShadow={false} hasBorder> + {/* TODO: Add step metrics*/}{' '} + </EuiPanel> + </EuiFlexItem> + <EuiFlexItem grow={2}> + <EuiPanel hasShadow={false} hasBorder> + <EuiFlexGroup> + <EuiFlexItem grow={1}> + <ObjectWeightList /> + </EuiFlexItem> + <EuiFlexItem grow={1}> + <ObjectCountList /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + </EuiFlexItem> + </EuiFlexGroup> + <EuiHorizontalRule margin="s" /> + {data && ( + <div> + <WaterfallChartContainer + checkGroup={checkGroupId} + stepIndex={Number(stepIndex)} + activeStep={activeStep} + /> + </div> + )} + </> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx new file mode 100644 index 0000000000000..658ad28890a91 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.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 React from 'react'; +import { useParams } from 'react-router-dom'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { useJourneySteps } from '../monitor_details/hooks/use_journey_steps'; + +export const StepTitle = () => { + const { checkGroupId, stepIndex } = useParams<{ checkGroupId: string; stepIndex: string }>(); + + const { data } = useJourneySteps(checkGroupId); + + const currentStep = data?.steps.find((step) => step.synthetics.step?.index === Number(stepIndex)); + + return ( + <EuiFlexGroup gutterSize="xs"> + <EuiFlexItem grow>{currentStep?.synthetics?.step?.name}</EuiFlexItem> + </EuiFlexGroup> + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/contexts/synthetics_theme_context.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/contexts/synthetics_theme_context.tsx index 32844de9d04c2..1415b1076cdd9 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/contexts/synthetics_theme_context.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/contexts/synthetics_theme_context.tsx @@ -6,7 +6,7 @@ */ import { euiLightVars, euiDarkVars } from '@kbn/ui-theme'; -import React, { createContext, useMemo } from 'react'; +import React, { createContext, useContext, useMemo } from 'react'; import { EUI_CHARTS_THEME_DARK, EUI_CHARTS_THEME_LIGHT } from '@elastic/eui/dist/eui_charts_theme'; import { DARK_THEME, LIGHT_THEME, PartialTheme, Theme } from '@elastic/charts'; @@ -96,3 +96,5 @@ export const SyntheticsThemeContextProvider: React.FC<ThemeContextProps> = ({ return <SyntheticsThemeContext.Provider value={value} children={children} />; }; + +export const useSyntheticsThemeContext = () => useContext(SyntheticsThemeContext); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_location_names.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_location_names.test.tsx new file mode 100644 index 0000000000000..26d808ca5ef7c --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_location_names.test.tsx @@ -0,0 +1,53 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import { renderHook } from '@testing-library/react-hooks'; +import { useLocationNames } from './use_location_names'; +import { WrappedHelper } from '../utils/testing'; + +describe('useMonitorListFilters', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('returns map of id to name', () => { + const WrapperWithState = ({ children }: { children: React.ReactElement }) => { + return ( + <WrappedHelper + state={{ + serviceLocations: { + locationsLoaded: true, + loading: false, + locations: [ + { + url: 'mockUrl', + id: 'us_central', + label: 'US Central', + isServiceManaged: true, + }, + { + url: 'mockUrl', + id: 'us_east', + label: 'US East', + isServiceManaged: true, + }, + ], + }, + }} + > + {children} + </WrappedHelper> + ); + }; + + const { result } = renderHook(() => useLocationNames(), { wrapper: WrapperWithState }); + expect(result.current).toEqual({ + us_central: 'US Central', + us_east: 'US East', + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_location_names.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_location_names.tsx new file mode 100644 index 0000000000000..1911719a093e3 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_location_names.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 { useMemo, useEffect } from 'react'; +import { useSelector, useDispatch } from 'react-redux'; +import { selectServiceLocationsState, getServiceLocations } from '../state'; + +export function useLocationNames() { + const dispatch = useDispatch(); + const { locationsLoaded, locations } = useSelector(selectServiceLocationsState); + useEffect(() => { + if (!locationsLoaded) { + dispatch(getServiceLocations()); + } + }); + + return useMemo( + () => + locations.reduce<Record<string, string>>((acc, location) => { + acc[location.id] = location.label; + return acc; + }, {}), + [locations] + ); +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.test.tsx new file mode 100644 index 0000000000000..844eb04649f8e --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.test.tsx @@ -0,0 +1,244 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { renderHook } from '@testing-library/react-hooks'; +import { useMonitorsSortedByStatus } from './use_monitors_sorted_by_status'; +import { WrappedHelper } from '../utils/testing'; + +describe('useMonitorsSortedByStatus', () => { + const location1 = { + url: 'mockUrl', + id: 'us_central', + label: 'US Central', + isServiceManaged: true, + }; + + const location2 = { + url: 'mockUrl', + id: 'us_east', + label: 'US East', + isServiceManaged: true, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + const WrapperWithState = ({ + children, + sortOrder = 'asc', + }: { + children: React.ReactElement; + sortOrder: 'asc' | 'desc'; + }) => { + return ( + <WrappedHelper + state={{ + serviceLocations: { + locationsLoaded: true, + loading: false, + locations: [location1, location2], + }, + overview: { + pageState: { + perPage: 10, + sortOrder, + sortField: 'name.keyword', + }, + status: { + upConfigs: [ + { + configId: 'test-monitor-1', + heartbeatId: 'test-monitor-1', + location: location2.label, + }, + { + configId: 'test-monitor-2', + heartbeatId: 'test-monitor-2', + location: location2.label, + }, + { + configId: 'test-monitor-3', + heartbeatId: 'test-monitor-3', + location: location2.label, + }, + ], + downConfigs: [ + { + configId: 'test-monitor-1', + heartbeatId: 'test-monitor-1', + location: location1.label, + }, + { + configId: 'test-monitor-2', + heartbeatId: 'test-monitor-2', + location: location1.label, + }, + { + configId: 'test-monitor-3', + heartbeatId: 'test-monitor-3', + location: location1.label, + }, + ], + }, + data: { + total: 0, + allMonitorIds: [], + monitors: [ + { + id: 'test-monitor-1', + name: 'Test monitor 1', + location: location1, + isEnabled: false, + }, + { + id: 'test-monitor-1', + name: 'Test monitor 1', + location: location2, + isEnabled: true, + }, + { + id: 'test-monitor-2', + name: 'Test monitor 2', + location: location1, + isEnabled: true, + }, + { + id: 'test-monitor-2', + name: 'Test monitor 2', + location: location2, + isEnabled: true, + }, + { + id: 'test-monitor-3', + name: 'Test monitor 3', + location: location1, + isEnabled: true, + }, + { + id: 'test-monitor-3', + name: 'Test monitor 3', + location: location2, + isEnabled: true, + }, + ], + }, + error: null, + loaded: false, + loading: false, + }, + }} + > + {children} + </WrappedHelper> + ); + }; + + it('returns monitors down first when sort order is asc', () => { + const { result } = renderHook(() => useMonitorsSortedByStatus(true), { + wrapper: WrapperWithState, + }); + expect(result.current).toEqual({ + monitorsSortedByStatus: [ + { + id: 'test-monitor-2', + name: 'Test monitor 2', + location: location1, + isEnabled: true, + }, + { + id: 'test-monitor-3', + name: 'Test monitor 3', + location: location1, + isEnabled: true, + }, + { + id: 'test-monitor-1', + name: 'Test monitor 1', + location: location2, + isEnabled: true, + }, + { + id: 'test-monitor-2', + name: 'Test monitor 2', + location: location2, + isEnabled: true, + }, + { + id: 'test-monitor-3', + name: 'Test monitor 3', + location: location2, + isEnabled: true, + }, + { + id: 'test-monitor-1', + name: 'Test monitor 1', + location: location1, + isEnabled: false, + }, + ], + downMonitors: { + 'test-monitor-1': ['US Central'], + 'test-monitor-2': ['US Central'], + 'test-monitor-3': ['US Central'], + }, + }); + }); + + it('returns monitors up first when sort order is desc', () => { + const { result } = renderHook(() => useMonitorsSortedByStatus(true), { + wrapper: ({ children }: { children: React.ReactElement }) => ( + <WrapperWithState sortOrder="desc">{children}</WrapperWithState> + ), + }); + expect(result.current).toEqual({ + monitorsSortedByStatus: [ + { + id: 'test-monitor-1', + name: 'Test monitor 1', + location: location2, + isEnabled: true, + }, + { + id: 'test-monitor-2', + name: 'Test monitor 2', + location: location2, + isEnabled: true, + }, + { + id: 'test-monitor-3', + name: 'Test monitor 3', + location: location2, + isEnabled: true, + }, + { + id: 'test-monitor-2', + name: 'Test monitor 2', + location: location1, + isEnabled: true, + }, + { + id: 'test-monitor-3', + name: 'Test monitor 3', + location: location1, + isEnabled: true, + }, + { + id: 'test-monitor-1', + name: 'Test monitor 1', + location: location1, + isEnabled: false, + }, + ], + downMonitors: { + 'test-monitor-1': ['US Central'], + 'test-monitor-2': ['US Central'], + 'test-monitor-3': ['US Central'], + }, + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.tsx new file mode 100644 index 0000000000000..0227722d7092a --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.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 { useEffect, useMemo, useState, useRef } from 'react'; +import { isEqual } from 'lodash'; +import { useSelector } from 'react-redux'; +import { MonitorOverviewItem } from '../../../../common/runtime_types'; +import { selectOverviewState } from '../state/overview'; +import { useLocationNames } from './use_location_names'; + +export function useMonitorsSortedByStatus(shouldUpdate: boolean) { + const { + pageState: { sortOrder }, + data: { monitors }, + status, + } = useSelector(selectOverviewState); + const [monitorsSortedByStatus, setMonitorsSortedByStatus] = useState< + Record<string, MonitorOverviewItem[]> + >({ up: [], down: [], disabled: [] }); + const downMonitors = useRef<Record<string, string[]> | null>(null); + const currentMonitors = useRef<MonitorOverviewItem[] | null>(monitors); + const locationNames = useLocationNames(); + + useEffect(() => { + if (!status) { + return; + } + const { downConfigs } = status; + const downMonitorMap: Record<string, string[]> = {}; + downConfigs.forEach(({ location, configId }) => { + if (downMonitorMap[configId]) { + downMonitorMap[configId].push(location); + } else { + downMonitorMap[configId] = [location]; + } + }); + + if ( + !isEqual(downMonitorMap, downMonitors.current) || + !isEqual(monitors, currentMonitors.current) + ) { + const orderedDownMonitors: MonitorOverviewItem[] = []; + const orderedUpMonitors: MonitorOverviewItem[] = []; + const orderedDisabledMonitors: MonitorOverviewItem[] = []; + monitors.forEach((monitor) => { + const monitorLocation = locationNames[monitor.location.id]; + if (!monitor.isEnabled) { + orderedDisabledMonitors.push(monitor); + } else if ( + Object.keys(downMonitorMap).includes(monitor.id) && + downMonitorMap[monitor.id].includes(monitorLocation) + ) { + orderedDownMonitors.push(monitor); + } else { + orderedUpMonitors.push(monitor); + } + }); + downMonitors.current = downMonitorMap; + currentMonitors.current = monitors; + setMonitorsSortedByStatus({ + down: orderedDownMonitors, + up: orderedUpMonitors, + disabled: orderedDisabledMonitors, + }); + } + }, [monitors, locationNames, downMonitors, status]); + + return useMemo(() => { + const upAndDownMonitors = + sortOrder === 'asc' + ? [...monitorsSortedByStatus.down, ...monitorsSortedByStatus.up] + : [...monitorsSortedByStatus.up, ...monitorsSortedByStatus.down]; + + return { + monitorsSortedByStatus: [...upAndDownMonitors, ...monitorsSortedByStatus.disabled], + downMonitors: downMonitors.current, + }; + }, [downMonitors, monitorsSortedByStatus, sortOrder]); +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx index 21930e1d559c6..5271f532a5c7d 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx @@ -11,7 +11,6 @@ import { useMemo } from 'react'; import { Ping } from '../../../../common/runtime_types'; import { EXCLUDE_RUN_ONCE_FILTER, - getTimeSpanFilter, SUMMARY_FILTER, } from '../../../../common/constants/client_defaults'; import { SYNTHETICS_INDEX_PATTERN, UNNAMED_LOCATION } from '../../../../common/constants'; @@ -32,7 +31,6 @@ export function useStatusByLocation(monitorIdArg?: string) { filter: [ SUMMARY_FILTER, EXCLUDE_RUN_ONCE_FILTER, - getTimeSpanFilter(), { term: { config_id: monitorIdArg ?? monitorId, diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/routes.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/routes.tsx index 6319610f8e8c7..8f9253cf984a6 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/routes.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/routes.tsx @@ -24,6 +24,7 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import { useInspectorContext } from '@kbn/observability-plugin/public'; import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public'; import { ErrorDetailsPage } from './components/error_details/error_details_page'; +import { StepTitle } from './components/step_details_page/step_title'; import { MonitorAddPage } from './components/monitor_add_edit/monitor_add_page'; import { MonitorEditPage } from './components/monitor_add_edit/monitor_edit_page'; import { MonitorDetailsPageTitle } from './components/monitor_details/monitor_details_page_title'; @@ -47,6 +48,7 @@ import { MONITOR_HISTORY_ROUTE, MONITOR_ROUTE, ERROR_DETAILS_ROUTE, + STEP_DETAIL_ROUTE, OVERVIEW_ROUTE, } from '../../../common/constants'; import { PLUGIN } from '../../../common/constants/plugin'; @@ -59,6 +61,7 @@ import { MonitorDetailsLastRun } from './components/monitor_details/monitor_deta import { MonitorSummary } from './components/monitor_details/monitor_summary/monitor_summary'; import { MonitorHistory } from './components/monitor_details/monitor_history/monitor_history'; import { MonitorErrors } from './components/monitor_details/monitor_errors/monitor_errors'; +import { StepDetailPage } from './components/step_details_page/step_detail_page'; type RouteProps = LazyObservabilityPageTemplateProps & { path: string; @@ -109,7 +112,7 @@ const getRoutes = ( </MonitorDetailsPage> ), dataTestSubj: 'syntheticsMonitorDetailsPage', - pageHeader: getMonitorSummaryHeader(history, syntheticsPath, 'summary'), + pageHeader: getMonitorSummaryHeader(history, syntheticsPath, 'overview'), }, { title: i18n.translate('xpack.synthetics.monitorHistory.title', { @@ -145,7 +148,7 @@ const getRoutes = ( values: { baseTitle }, }), path: OVERVIEW_ROUTE, - component: () => <OverviewPage />, + component: OverviewPage, dataTestSubj: 'syntheticsOverviewPage', pageHeader: { pageTitle: ( @@ -285,6 +288,24 @@ const getRoutes = ( ], }, }, + { + title: i18n.translate('xpack.synthetics.stepDetailsRoute.title', { + defaultMessage: 'Step details | {baseTitle}', + values: { baseTitle }, + }), + path: STEP_DETAIL_ROUTE, + component: () => <StepDetailPage />, + dataTestSubj: 'syntheticsMonitorEditPage', + pageHeader: { + pageTitle: <StepTitle />, + rightSideItems: [], + breadcrumbs: [ + { + text: <OutPortal node={MonitorDetailsLinkPortalNode} />, + }, + ], + }, + }, { title: i18n.translate('xpack.synthetics.errorDetailsRoute.title', { defaultMessage: 'Error details | {baseTitle}', @@ -308,7 +329,7 @@ const getRoutes = ( const getMonitorSummaryHeader = ( history: ReturnType<typeof useHistory>, syntheticsPath: string, - selectedTab: 'summary' | 'history' | 'errors' + selectedTab: 'overview' | 'history' | 'errors' ): EuiPageHeaderProps => { // Not a component, but it doesn't matter. Hooks are just functions const match = useRouteMatch<{ monitorId: string }>(MONITOR_ROUTE); // eslint-disable-line react-hooks/rules-of-hooks @@ -346,10 +367,10 @@ const getMonitorSummaryHeader = ( ], tabs: [ { - label: i18n.translate('xpack.synthetics.monitorSummaryTab.title', { - defaultMessage: 'Summary', + label: i18n.translate('xpack.synthetics.monitorOverviewTab.title', { + defaultMessage: 'Overview', }), - isSelected: selectedTab === 'summary', + isSelected: selectedTab === 'overview', href: `${syntheticsPath}${MONITOR_ROUTE.replace(':monitorId?', monitorId)}${search}`, }, { diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts index a80196275a759..b80598bf877c6 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts @@ -25,7 +25,19 @@ export const getMonitorAction = createAsyncAction< EncryptedSyntheticsSavedMonitor >('[MONITOR DETAILS] GET MONITOR'); -export const getMonitorRecentPingsAction = createAsyncAction< +export const getMonitorLastRunAction = createAsyncAction< { monitorId: string; locationId: string }, PingsResponse +>('[MONITOR DETAILS] GET LAST RUN'); + +export const getMonitorRecentPingsAction = createAsyncAction< + { + monitorId: string; + locationId: string; + size?: number; + pageIndex?: number; + from?: string; + to?: string; + }, + PingsResponse >('[MONITOR DETAILS] GET RECENT PINGS'); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts index 80713e587cefa..c0c8d9ac6dbc4 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts @@ -21,22 +21,45 @@ export interface QueryParams { dateEnd: string; } +export const fetchMonitorLastRun = async ({ + monitorId, + locationId, +}: { + monitorId: string; + locationId: string; +}): Promise<PingsResponse> => { + return fetchMonitorRecentPings({ monitorId, locationId, size: 1 }); +}; + export const fetchMonitorRecentPings = async ({ monitorId, locationId, + from, + to, + size = 10, + pageIndex = 0, }: { monitorId: string; locationId: string; + from?: string; + to?: string; + size?: number; + pageIndex?: number; }): Promise<PingsResponse> => { - const from = new Date(0).toISOString(); - const to = new Date().toISOString(); const locations = JSON.stringify([locationId]); const sort = 'desc'; - const size = 10; return await apiService.get( SYNTHETICS_API_URLS.PINGS, - { monitorId, from, to, locations, sort, size }, + { + monitorId, + from: from ?? new Date(0).toISOString(), + to: to ?? new Date().toISOString(), + locations, + sort, + size, + pageIndex, + }, PingsResponseType ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/effects.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/effects.ts index 1b1b686400d88..5330212b4b3a8 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/effects.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/effects.ts @@ -7,8 +7,8 @@ import { takeLeading } from 'redux-saga/effects'; import { fetchEffectFactory } from '../utils/fetch_effect'; -import { getMonitorRecentPingsAction, getMonitorAction } from './actions'; -import { fetchSyntheticsMonitor, fetchMonitorRecentPings } from './api'; +import { getMonitorLastRunAction, getMonitorRecentPingsAction, getMonitorAction } from './actions'; +import { fetchSyntheticsMonitor, fetchMonitorRecentPings, fetchMonitorLastRun } from './api'; export function* fetchSyntheticsMonitorEffect() { yield takeLeading( @@ -20,6 +20,14 @@ export function* fetchSyntheticsMonitorEffect() { ) ); + yield takeLeading( + getMonitorLastRunAction.get, + fetchEffectFactory( + fetchMonitorLastRun, + getMonitorLastRunAction.success, + getMonitorLastRunAction.fail + ) + ); yield takeLeading( getMonitorAction.get, fetchEffectFactory(fetchSyntheticsMonitor, getMonitorAction.success, getMonitorAction.fail) diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts index 1c9df0c866ad2..5661f4eb9cc37 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts @@ -12,14 +12,22 @@ import { checkIsStalePing } from '../../utils/monitor_test_result/check_pings'; import { IHttpSerializedFetchError } from '../utils/http_error'; import { + getMonitorLastRunAction, getMonitorRecentPingsAction, setMonitorDetailsLocationAction, getMonitorAction, } from './actions'; export interface MonitorDetailsState { - pings: Ping[]; - loading: boolean; + pings: { + total: number; + data: Ping[]; + loading: boolean; + }; + lastRun: { + data?: Ping; + loading: boolean; + }; syntheticsMonitorLoading: boolean; syntheticsMonitor: EncryptedSyntheticsSavedMonitor | null; error: IHttpSerializedFetchError | null; @@ -27,8 +35,8 @@ export interface MonitorDetailsState { } const initialState: MonitorDetailsState = { - pings: [], - loading: false, + pings: { total: 0, data: [], loading: false }, + lastRun: { loading: false }, syntheticsMonitor: null, syntheticsMonitorLoading: false, error: null, @@ -40,18 +48,34 @@ export const monitorDetailsReducer = createReducer(initialState, (builder) => { .addCase(setMonitorDetailsLocationAction, (state, action) => { state.selectedLocationId = action.payload; }) - + .addCase(getMonitorLastRunAction.get, (state, action) => { + state.lastRun.loading = true; + if (checkIsStalePing(action.payload.monitorId, state.lastRun.data)) { + state.lastRun.data = undefined; + } + }) + .addCase(getMonitorLastRunAction.success, (state, action) => { + state.lastRun.loading = false; + state.lastRun.data = action.payload.pings[0]; + }) + .addCase(getMonitorLastRunAction.fail, (state, action) => { + state.lastRun.loading = false; + state.error = action.payload; + }) .addCase(getMonitorRecentPingsAction.get, (state, action) => { - state.loading = true; - state.pings = state.pings.filter((ping) => !checkIsStalePing(action.payload.monitorId, ping)); + state.pings.loading = true; + state.pings.data = state.pings.data.filter( + (ping) => !checkIsStalePing(action.payload.monitorId, ping) + ); }) .addCase(getMonitorRecentPingsAction.success, (state, action) => { - state.pings = action.payload.pings; - state.loading = false; + state.pings.total = action.payload.total; + state.pings.data = action.payload.pings; + state.pings.loading = false; }) .addCase(getMonitorRecentPingsAction.fail, (state, action) => { state.error = action.payload; - state.loading = false; + state.pings.loading = false; }) .addCase(getMonitorAction.get, (state) => { diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts index 5c6ba75e8cd6d..0948802a6a94a 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts @@ -17,10 +17,10 @@ export const selectSelectedLocationId = createSelector( (state) => state.selectedLocationId ); -export const selectLatestPing = createSelector(getState, (state) => state.pings?.[0] ?? null); +export const selectLastRunMetadata = createSelector(getState, (state) => state.lastRun); -export const selectPingsLoading = createSelector(getState, (state) => state.loading); +export const selectPingsLoading = createSelector(getState, (state) => state.pings.loading); -export const selectMonitorRecentPings = createSelector(getState, (state) => state.pings); +export const selectMonitorPingsMetadata = createSelector(getState, (state) => state.pings); export const selectPingsError = createSelector(getState, (state) => state.error); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/actions.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/actions.ts new file mode 100644 index 0000000000000..f391484d3920a --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/actions.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 { createAction } from 'redux-actions'; +import { SyntheticsNetworkEventsApiResponse } from '../../../../../common/runtime_types'; + +export interface FetchNetworkEventsParams { + checkGroup: string; + stepIndex: number; +} + +export interface FetchNetworkEventsFailPayload { + checkGroup: string; + stepIndex: number; + error: Error; +} + +export const getNetworkEvents = createAction<FetchNetworkEventsParams>('GET_NETWORK_EVENTS'); +export const getNetworkEventsSuccess = createAction< + Pick<FetchNetworkEventsParams, 'checkGroup' | 'stepIndex'> & SyntheticsNetworkEventsApiResponse +>('GET_NETWORK_EVENTS_SUCCESS'); +export const getNetworkEventsFail = + createAction<FetchNetworkEventsFailPayload>('GET_NETWORK_EVENTS_FAIL'); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/api.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/api.ts new file mode 100644 index 0000000000000..8c52ebba47dad --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/api.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + SyntheticsNetworkEventsApiResponse, + SyntheticsNetworkEventsApiResponseType, +} from '../../../../../common/runtime_types'; +import { API_URLS } from '../../../../../common/constants'; +import { apiService } from '../../../../utils/api_service'; +import { FetchNetworkEventsParams } from './actions'; + +export async function fetchNetworkEvents( + params: FetchNetworkEventsParams +): Promise<SyntheticsNetworkEventsApiResponse> { + return (await apiService.get( + API_URLS.NETWORK_EVENTS, + { + checkGroup: params.checkGroup, + stepIndex: params.stepIndex, + }, + SyntheticsNetworkEventsApiResponseType + )) as SyntheticsNetworkEventsApiResponse; +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/effects.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/effects.ts new file mode 100644 index 0000000000000..1736619eb6185 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/effects.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 type { Action } from 'redux-actions'; +import { call, put, takeLatest } from 'redux-saga/effects'; +import { fetchNetworkEvents } from './api'; +import { SyntheticsNetworkEventsApiResponse } from '../../../../../common/runtime_types'; +import { + FetchNetworkEventsParams, + getNetworkEvents, + getNetworkEventsFail, + getNetworkEventsSuccess, +} from './actions'; + +export function* fetchNetworkEventsEffect() { + yield takeLatest( + getNetworkEvents, + function* (action: Action<FetchNetworkEventsParams>): Generator { + try { + const response = (yield call( + fetchNetworkEvents, + action.payload + )) as SyntheticsNetworkEventsApiResponse; + + yield put( + getNetworkEventsSuccess({ + checkGroup: action.payload.checkGroup, + stepIndex: action.payload.stepIndex, + ...response, + }) + ); + } catch (e) { + yield put( + getNetworkEventsFail({ + checkGroup: action.payload.checkGroup, + stepIndex: action.payload.stepIndex, + error: e, + }) + ); + } + } + ); +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/index.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/index.ts new file mode 100644 index 0000000000000..a3a5cc00c9bcf --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/index.ts @@ -0,0 +1,157 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { handleActions, Action } from 'redux-actions'; +import { + NetworkEvent, + SyntheticsNetworkEventsApiResponse, +} from '../../../../../common/runtime_types'; +import { + FetchNetworkEventsFailPayload, + FetchNetworkEventsParams, + getNetworkEvents, + getNetworkEventsFail, + getNetworkEventsSuccess, +} from './actions'; + +export interface NetworkEventsState { + [checkGroup: string]: { + [stepIndex: number]: { + events: NetworkEvent[]; + total: number; + loading: boolean; + error?: Error; + isWaterfallSupported: boolean; + hasNavigationRequest?: boolean; + }; + }; +} + +const initialState: NetworkEventsState = {}; + +type Payload = FetchNetworkEventsParams & + SyntheticsNetworkEventsApiResponse & + FetchNetworkEventsFailPayload & + string[]; + +export const networkEventsReducer = handleActions<NetworkEventsState, Payload>( + { + [String(getNetworkEvents)]: ( + state: NetworkEventsState, + { payload: { checkGroup, stepIndex } }: Action<FetchNetworkEventsParams> + ) => ({ + ...state, + [checkGroup]: state[checkGroup] + ? { + [stepIndex]: state[checkGroup][stepIndex] + ? { + ...state[checkGroup][stepIndex], + loading: true, + events: [], + total: 0, + isWaterfallSupported: true, + } + : { + loading: true, + events: [], + total: 0, + isWaterfallSupported: true, + }, + } + : { + [stepIndex]: { + loading: true, + events: [], + total: 0, + isWaterfallSupported: true, + }, + }, + }), + + [String(getNetworkEventsSuccess)]: ( + state: NetworkEventsState, + { + payload: { + events, + total, + checkGroup, + stepIndex, + isWaterfallSupported, + hasNavigationRequest, + }, + }: Action<SyntheticsNetworkEventsApiResponse & FetchNetworkEventsParams> + ) => { + return { + ...state, + [checkGroup]: state[checkGroup] + ? { + [stepIndex]: state[checkGroup][stepIndex] + ? { + ...state[checkGroup][stepIndex], + loading: false, + events, + total, + isWaterfallSupported, + hasNavigationRequest, + } + : { + loading: false, + events, + total, + isWaterfallSupported, + hasNavigationRequest, + }, + } + : { + [stepIndex]: { + loading: false, + events, + total, + isWaterfallSupported, + hasNavigationRequest, + }, + }, + }; + }, + + [String(getNetworkEventsFail)]: ( + state: NetworkEventsState, + { payload: { checkGroup, stepIndex, error } }: Action<FetchNetworkEventsFailPayload> + ) => ({ + ...state, + [checkGroup]: state[checkGroup] + ? { + [stepIndex]: state[checkGroup][stepIndex] + ? { + ...state[checkGroup][stepIndex], + loading: false, + events: [], + total: 0, + error, + isWaterfallSupported: true, + } + : { + loading: false, + events: [], + total: 0, + error, + isWaterfallSupported: true, + }, + } + : { + [stepIndex]: { + loading: false, + events: [], + total: 0, + error, + isWaterfallSupported: true, + }, + }, + }), + }, + initialState +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/selectors.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/selectors.ts new file mode 100644 index 0000000000000..eae3b3e56d2b2 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/selectors.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { SyntheticsAppState } from '../root_reducer'; + +export const networkEventsSelector = ({ networkEvents }: SyntheticsAppState) => networkEvents; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/actions.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/actions.ts index c89179a41806e..d94ab2d965216 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/actions.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/actions.ts @@ -15,7 +15,9 @@ export const fetchMonitorOverviewAction = createAsyncAction< MonitorOverviewResult >('fetchMonitorOverviewAction'); -export const setOverviewPerPageAction = createAction<number>('setOverviewPerPageAction'); +export const setOverviewPageStateAction = createAction<Partial<MonitorOverviewPageState>>( + 'setOverviewPageStateAction' +); export const quietFetchOverviewAction = createAsyncAction< MonitorOverviewPageState, diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/api.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/api.ts index ecd91b16bb940..db470a18b0423 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/api.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/api.ts @@ -21,7 +21,7 @@ export const fetchMonitorOverview = async ( ): Promise<MonitorOverviewResult> => { return await apiService.get( SYNTHETICS_API_URLS.SYNTHETICS_OVERVIEW, - { perPage: pageState.perPage }, + { perPage: pageState.perPage, sortOrder: pageState.sortOrder, sortField: pageState.sortField }, MonitorOverviewResultCodec ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/effects.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/effects.ts index 56b056a93110c..0e880dca5a387 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/effects.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/effects.ts @@ -17,7 +17,7 @@ import { fetchMonitorOverview, fetchOverviewStatus } from './api'; export function* fetchMonitorOverviewEffect() { yield takeLeading( - fetchMonitorOverviewAction.get, + [fetchMonitorOverviewAction.get, quietFetchOverviewAction.get], fetchEffectFactory( fetchMonitorOverview, fetchMonitorOverviewAction.success, @@ -26,17 +26,6 @@ export function* fetchMonitorOverviewEffect() { ); } -export function* quietFetchOverviewEffect() { - yield takeLeading( - quietFetchOverviewAction.get, - fetchEffectFactory( - fetchMonitorOverview, - quietFetchOverviewAction.success, - quietFetchOverviewAction.fail - ) - ); -} - export function* fetchOverviewStatusEffect() { yield takeLatest( [fetchOverviewStatusAction.get, fetchUpsertSuccessAction], diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/index.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/index.ts index 82272638ffb11..8f2031480f115 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/index.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/index.ts @@ -17,7 +17,7 @@ import { fetchMonitorOverviewAction, fetchOverviewStatusAction, quietFetchOverviewAction, - setOverviewPerPageAction, + setOverviewPageStateAction, } from './actions'; export interface MonitorOverviewState { @@ -34,10 +34,12 @@ const initialState: MonitorOverviewState = { data: { total: 0, allMonitorIds: [], - pages: {}, + monitors: [], }, pageState: { - perPage: 20, + perPage: 16, + sortOrder: 'asc', + sortField: 'status', }, loading: false, loaded: false, @@ -68,10 +70,10 @@ export const monitorOverviewReducer = createReducer(initialState, (builder) => { .addCase(quietFetchOverviewAction.fail, (state, action) => { state.error = action.payload; }) - .addCase(setOverviewPerPageAction, (state, action) => { + .addCase(setOverviewPageStateAction, (state, action) => { state.pageState = { ...state.pageState, - perPage: action.payload, + ...action.payload, }; state.loaded = false; }) diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/models.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/models.ts index d7dcaafeba917..6cc423a3bddda 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/models.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/overview/models.ts @@ -7,4 +7,6 @@ export interface MonitorOverviewPageState { perPage: number; + sortOrder: 'asc' | 'desc'; + sortField: string; } diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts index 50b94bd670838..7a5c55d72fd24 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts @@ -6,15 +6,12 @@ */ import { all, fork } from 'redux-saga/effects'; +import { fetchNetworkEventsEffect } from './network_events/effects'; import { fetchSyntheticsMonitorEffect } from './monitor_details'; import { fetchIndexStatusEffect } from './index_status'; import { fetchSyntheticsEnablementEffect } from './synthetics_enablement'; import { fetchMonitorListEffect, upsertMonitorEffect } from './monitor_list'; -import { - fetchMonitorOverviewEffect, - quietFetchOverviewEffect, - fetchOverviewStatusEffect, -} from './overview'; +import { fetchMonitorOverviewEffect, fetchOverviewStatusEffect } from './overview'; import { fetchServiceLocationsEffect } from './service_locations'; import { browserJourneyEffects } from './browser_journey'; @@ -27,8 +24,8 @@ export const rootEffect = function* root(): Generator { fork(fetchMonitorListEffect), fork(fetchSyntheticsMonitorEffect), fork(fetchMonitorOverviewEffect), - fork(quietFetchOverviewEffect), fork(browserJourneyEffects), fork(fetchOverviewStatusEffect), + fork(fetchNetworkEventsEffect), ]); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/root_reducer.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/root_reducer.ts index c83605ffad1f8..b9c7b6ec8db51 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/root_reducer.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/root_reducer.ts @@ -7,6 +7,7 @@ import { combineReducers } from '@reduxjs/toolkit'; +import { networkEventsReducer, NetworkEventsState } from './network_events'; import { monitorDetailsReducer, MonitorDetailsState } from './monitor_details'; import { uiReducer, UiState } from './ui'; import { indexStatusReducer, IndexStatusState } from './index_status'; @@ -26,6 +27,7 @@ export interface SyntheticsAppState { monitorDetails: MonitorDetailsState; overview: MonitorOverviewState; browserJourney: BrowserJourneyState; + networkEvents: NetworkEventsState; } export const rootReducer = combineReducers<SyntheticsAppState>({ @@ -37,4 +39,5 @@ export const rootReducer = combineReducers<SyntheticsAppState>({ monitorDetails: monitorDetailsReducer, overview: monitorOverviewReducer, browserJourney: browserJourneyReducer, + networkEvents: networkEventsReducer, }); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/format.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/format.ts index 2fd43d198b8b4..5dab17f55ad68 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/format.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/format.ts @@ -5,6 +5,8 @@ * 2.0. */ import { i18n } from '@kbn/i18n'; +import moment, { Moment } from 'moment'; +import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE } from '../../../../../common/constants'; // one second = 1 million micros const ONE_SECOND_AS_MICROS = 1000000; @@ -37,3 +39,39 @@ export const formatDuration = (durationMicros: number) => { defaultMessage: '{seconds} s', }); }; + +export const getShortTimeStamp = (timeStamp: moment.Moment, relative = false) => { + if (relative) { + const prevLocale: string = moment.locale() ?? 'en'; + + const shortLocale = moment.locale(SHORT_TS_LOCALE) === SHORT_TS_LOCALE; + + if (!shortLocale) { + moment.defineLocale(SHORT_TS_LOCALE, SHORT_TIMESPAN_LOCALE); + } + + let shortTimestamp; + if (typeof timeStamp === 'string') { + shortTimestamp = parseTimestamp(timeStamp).fromNow(); + } else { + shortTimestamp = timeStamp.fromNow(); + } + + // Reset it so, it doesn't impact other part of the app + moment.locale(prevLocale); + return shortTimestamp; + } else { + if (moment().diff(timeStamp, 'd') >= 1) { + return timeStamp.format('ll LTS'); + } + return timeStamp.format('LTS'); + } +}; + +export const parseTimestamp = (tsValue: string): Moment => { + let parsed = Date.parse(tsValue); + if (isNaN(parsed)) { + parsed = parseInt(tsValue, 10); + } + return moment(parsed); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts new file mode 100644 index 0000000000000..0b32c4a2420e8 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts @@ -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 moment from 'moment'; +import { Moment } from 'moment-timezone'; +import * as redux from 'react-redux'; +import * as reactRouterDom from 'react-router-dom'; + +export function mockMoment() { + // avoid timezone issues + jest.spyOn(moment.prototype, 'format').mockImplementation(function (this: Moment) { + return `Sept 4, 2020 9:31:38 AM`; + }); + + // convert relative time to absolute time to avoid timing issues + jest.spyOn(moment.prototype, 'fromNow').mockImplementation(function (this: Moment) { + return `15 minutes ago`; + }); + + // use static locale string to avoid issues + jest.spyOn(moment.prototype, 'toLocaleString').mockImplementation(function (this: Moment) { + return `Thu May 09 2019 10:15:11 GMT-0400`; + }); +} + +export function mockMomentTimezone() { + jest.mock('moment-timezone', () => { + return function () { + return { tz: { guess: () => 'America/New_York' } }; + }; + }); +} + +export function mockDate() { + // use static date string to avoid CI timing issues + jest.spyOn(Date.prototype, 'toString').mockImplementation(function (this: Date) { + return `Tue, 01 Jan 2019 00:00:00 GMT`; + }); +} + +export function mockDataPlugin() { + jest.mock('@kbn/data-plugin/public', () => { + return function () { + return { + esKuery: { + fromKueryExpression: () => 'an ast', + toElasticsearchQuery: () => 'an es query', + }, + }; + }; + }); +} + +export function mockReduxHooks(response?: any) { + jest.spyOn(redux, 'useDispatch').mockReturnValue(jest.fn()); + + jest.spyOn(redux, 'useSelector').mockReturnValue(response); +} + +export function mockDispatch() { + jest.spyOn(redux, 'useDispatch').mockReturnValue(jest.fn()); +} + +export function mockReactRouterDomHooks({ useParamsResponse }: { useParamsResponse: any }) { + jest.spyOn(reactRouterDom, 'useParams').mockReturnValue(useParamsResponse); +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts index 6031707c1fd19..7bf845deee9a6 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts @@ -87,11 +87,13 @@ export const mockState: SyntheticsAppState = { overview: { pageState: { perPage: 10, + sortOrder: 'asc', + sortField: 'name.keyword', }, data: { total: 0, allMonitorIds: [], - pages: {}, + monitors: [], }, error: null, loaded: false, @@ -102,6 +104,7 @@ export const mockState: SyntheticsAppState = { syntheticsEnablement: { loading: false, error: null, enablement: null }, monitorDetails: getMonitorDetailsMockSlice(), browserJourney: getBrowserJourneyMockSlice(), + networkEvents: {}, }; function getBrowserJourneyMockSlice() { @@ -132,8 +135,9 @@ function getBrowserJourneyMockSlice() { function getMonitorDetailsMockSlice() { return { - pings: [ - { + lastRun: { + loading: false, + data: { summary: { up: 1, down: 0 }, agent: { name: 'cron-b010e1cc9518984e-27644714-4pd4h', @@ -187,118 +191,178 @@ function getMonitorDetailsMockSlice() { timestamp: '2022-07-24T17:14:05.079Z', docId: 'AkYzMYIBqL6WCtugsFck', }, - { - summary: { up: 1, down: 0 }, - agent: { - name: 'cron-b010e1cc9518984e-27644704-zs98t', - id: 'a9620214-591d-48e7-9e5d-10b7a9fb1a03', - type: 'heartbeat', - ephemeral_id: 'c5110885-81b4-4e9a-8747-690d19fbd225', - version: '8.3.0', - }, - synthetics: { - journey: { name: 'inline', id: 'inline', tags: null }, - type: 'heartbeat/summary', - }, - monitor: { - duration: { us: 227326 }, - origin: SourceType.UI, - name: 'One pixel monitor', - id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', - check_group: '9eb87e53-0b72-11ed-b34f-aa618b4334ae', - timespan: { lt: '2022-07-24T17:14:05.020Z', gte: '2022-07-24T17:04:05.020Z' }, - type: DataStream.BROWSER, - status: 'up', - }, - url: { - scheme: 'data', - domain: '', - full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', - }, - observer: { - geo: { - continent_name: 'North America', - city_name: 'Iowa', - country_iso_code: 'US', - name: 'North America - US Central', - location: '41.8780, 93.0977', + }, + pings: { + total: 3, + data: [ + { + summary: { up: 1, down: 0 }, + agent: { + name: 'cron-b010e1cc9518984e-27644714-4pd4h', + id: 'f8721d90-5aec-4815-a6f1-f4d4a6fb7482', + type: 'heartbeat', + ephemeral_id: 'd6a60494-5e52-418f-922b-8e90f0b4013c', + version: '8.3.0', }, - hostname: 'cron-b010e1cc9518984e-27644704-zs98t', - ip: ['10.1.9.133'], - mac: ['aa:61:8b:43:34:ae'], - }, - '@timestamp': '2022-07-24T17:04:03.769Z', - ecs: { version: '8.0.0' }, - config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', - data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, - 'event.type': 'journey/end', - event: { - agent_id_status: 'auth_metadata_missing', - ingested: '2022-07-24T17:04:06Z', - type: 'heartbeat/summary', - dataset: 'browser', - }, - timestamp: '2022-07-24T17:04:03.769Z', - docId: 'mkYqMYIBqL6WCtughFUq', - }, - { - summary: { up: 1, down: 0 }, - agent: { - name: 'job-b010e1cc9518984e-dkw5k', - id: 'e3a4e3a8-bdd1-44fe-86f5-e451b80f80c5', - type: 'heartbeat', - ephemeral_id: 'f41a13ab-a85d-4614-89c0-8dbad6a32868', - version: '8.3.0', - }, - synthetics: { - journey: { name: 'inline', id: 'inline', tags: null }, - type: 'heartbeat/summary', - }, - monitor: { - duration: { us: 207700 }, - origin: SourceType.UI, - name: 'One pixel monitor', - timespan: { lt: '2022-07-24T17:11:49.702Z', gte: '2022-07-24T17:01:49.702Z' }, - check_group: '4e00ac5a-0b72-11ed-a97e-5203642c687d', - id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', - type: DataStream.BROWSER, - status: 'up', - }, - url: { - scheme: 'data', - domain: '', - full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', + synthetics: { + journey: { name: 'inline', id: 'inline', tags: null }, + type: 'heartbeat/summary', + }, + monitor: { + duration: { us: 269722 }, + origin: SourceType.UI, + name: 'One pixel monitor', + check_group: '051aba1c-0b74-11ed-9f0e-ba4e6fa109d5', + id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + timespan: { lt: '2022-07-24T17:24:06.094Z', gte: '2022-07-24T17:14:06.094Z' }, + type: DataStream.BROWSER, + status: 'up', + }, + url: { + scheme: 'data', + domain: '', + full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', + }, + observer: { + geo: { + continent_name: 'North America', + city_name: 'Iowa', + country_iso_code: 'US', + name: 'North America - US Central', + location: '41.8780, 93.0977', + }, + hostname: 'cron-b010e1cc9518984e-27644714-4pd4h', + ip: ['10.1.11.162'], + mac: ['ba:4e:6f:a1:09:d5'], + }, + '@timestamp': '2022-07-24T17:14:05.079Z', + ecs: { version: '8.0.0' }, + config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, + 'event.type': 'journey/end', + event: { + agent_id_status: 'auth_metadata_missing', + ingested: '2022-07-24T17:14:07Z', + type: 'heartbeat/summary', + dataset: 'browser', + }, + timestamp: '2022-07-24T17:14:05.079Z', + docId: 'AkYzMYIBqL6WCtugsFck', }, - observer: { - geo: { - continent_name: 'North America', - city_name: 'Iowa', - country_iso_code: 'US', - name: 'North America - US Central', - location: '41.8780, 93.0977', + { + summary: { up: 1, down: 0 }, + agent: { + name: 'cron-b010e1cc9518984e-27644704-zs98t', + id: 'a9620214-591d-48e7-9e5d-10b7a9fb1a03', + type: 'heartbeat', + ephemeral_id: 'c5110885-81b4-4e9a-8747-690d19fbd225', + version: '8.3.0', + }, + synthetics: { + journey: { name: 'inline', id: 'inline', tags: null }, + type: 'heartbeat/summary', + }, + monitor: { + duration: { us: 227326 }, + origin: SourceType.UI, + name: 'One pixel monitor', + id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + check_group: '9eb87e53-0b72-11ed-b34f-aa618b4334ae', + timespan: { lt: '2022-07-24T17:14:05.020Z', gte: '2022-07-24T17:04:05.020Z' }, + type: DataStream.BROWSER, + status: 'up', + }, + url: { + scheme: 'data', + domain: '', + full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', + }, + observer: { + geo: { + continent_name: 'North America', + city_name: 'Iowa', + country_iso_code: 'US', + name: 'North America - US Central', + location: '41.8780, 93.0977', + }, + hostname: 'cron-b010e1cc9518984e-27644704-zs98t', + ip: ['10.1.9.133'], + mac: ['aa:61:8b:43:34:ae'], + }, + '@timestamp': '2022-07-24T17:04:03.769Z', + ecs: { version: '8.0.0' }, + config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, + 'event.type': 'journey/end', + event: { + agent_id_status: 'auth_metadata_missing', + ingested: '2022-07-24T17:04:06Z', + type: 'heartbeat/summary', + dataset: 'browser', }, - hostname: 'job-b010e1cc9518984e-dkw5k', - ip: ['10.1.9.132'], - mac: ['52:03:64:2c:68:7d'], + timestamp: '2022-07-24T17:04:03.769Z', + docId: 'mkYqMYIBqL6WCtughFUq', }, - '@timestamp': '2022-07-24T17:01:48.326Z', - ecs: { version: '8.0.0' }, - config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', - data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, - 'event.type': 'journey/end', - event: { - agent_id_status: 'auth_metadata_missing', - ingested: '2022-07-24T17:01:50Z', - type: 'heartbeat/summary', - dataset: 'browser', + { + summary: { up: 1, down: 0 }, + agent: { + name: 'job-b010e1cc9518984e-dkw5k', + id: 'e3a4e3a8-bdd1-44fe-86f5-e451b80f80c5', + type: 'heartbeat', + ephemeral_id: 'f41a13ab-a85d-4614-89c0-8dbad6a32868', + version: '8.3.0', + }, + synthetics: { + journey: { name: 'inline', id: 'inline', tags: null }, + type: 'heartbeat/summary', + }, + monitor: { + duration: { us: 207700 }, + origin: SourceType.UI, + name: 'One pixel monitor', + timespan: { lt: '2022-07-24T17:11:49.702Z', gte: '2022-07-24T17:01:49.702Z' }, + check_group: '4e00ac5a-0b72-11ed-a97e-5203642c687d', + id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + type: DataStream.BROWSER, + status: 'up', + }, + url: { + scheme: 'data', + domain: '', + full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', + }, + observer: { + geo: { + continent_name: 'North America', + city_name: 'Iowa', + country_iso_code: 'US', + name: 'North America - US Central', + location: '41.8780, 93.0977', + }, + hostname: 'job-b010e1cc9518984e-dkw5k', + ip: ['10.1.9.132'], + mac: ['52:03:64:2c:68:7d'], + }, + '@timestamp': '2022-07-24T17:01:48.326Z', + ecs: { version: '8.0.0' }, + config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, + 'event.type': 'journey/end', + event: { + agent_id_status: 'auth_metadata_missing', + ingested: '2022-07-24T17:01:50Z', + type: 'heartbeat/summary', + dataset: 'browser', + }, + timestamp: '2022-07-24T17:01:48.326Z', + docId: 'kUYoMYIBqL6WCtugc1We', }, - timestamp: '2022-07-24T17:01:48.326Z', - docId: 'kUYoMYIBqL6WCtugc1We', - }, - ], - loading: false, + ], + loading: false, + }, syntheticsMonitor: { id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', type: DataStream.BROWSER, enabled: true, schedule: { unit: ScheduleUnit.MINUTES, number: '10' }, diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.ts new file mode 100644 index 0000000000000..bf6fb576dd8f5 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.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. + */ + +/** + * NOTE: This variable name MUST start with 'mock*' in order for + * Jest to accept its use within a jest.mock() + */ +export const mockHistory = { + createHref: jest.fn(({ pathname }) => `/enterprise_search${pathname}`), + push: jest.fn(), + location: { + pathname: '/current-path', + }, +}; + +jest.mock('react-router-dom', () => ({ + useHistory: jest.fn(() => mockHistory), +})); + +/** + * For example usage, @see public/applications/shared/react_router_helpers/eui_link.test.tsx + */ diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx index 55ae549a032b3..3168c1b07ee33 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx @@ -95,6 +95,7 @@ const createMockStore = () => { const mockAppUrls: Record<string, string> = { uptime: '/app/uptime', + synthetics: '/app/synthetics', observability: '/app/observability', '/home#/tutorial/uptimeMonitors': '/home#/tutorial/uptimeMonitors', }; diff --git a/x-pack/plugins/synthetics/public/hooks/use_chart_theme.ts b/x-pack/plugins/synthetics/public/hooks/use_chart_theme.ts new file mode 100644 index 0000000000000..f9faca7927d9d --- /dev/null +++ b/x-pack/plugins/synthetics/public/hooks/use_chart_theme.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 { EUI_CHARTS_THEME_DARK, EUI_CHARTS_THEME_LIGHT } from '@elastic/eui/dist/eui_charts_theme'; +import { useMemo } from 'react'; +import { useUiSetting$ } from '@kbn/kibana-react-plugin/public'; + +export const useChartTheme = () => { + const [darkMode] = useUiSetting$<boolean>('theme:darkMode'); + + const theme = useMemo(() => { + return darkMode ? EUI_CHARTS_THEME_DARK.theme : EUI_CHARTS_THEME_LIGHT.theme; + }, [darkMode]); + + return theme; +}; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/normalizers.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/normalizers.ts index f4678b5569872..79e50bf8a9d96 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/normalizers.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/normalizers.ts @@ -97,7 +97,5 @@ export const commonNormalizers: CommonNormalizerMap = { [ConfigKey.CUSTOM_HEARTBEAT_ID]: getCommonNormalizer(ConfigKey.CUSTOM_HEARTBEAT_ID), [ConfigKey.ORIGINAL_SPACE]: getCommonNormalizer(ConfigKey.ORIGINAL_SPACE), [ConfigKey.CONFIG_HASH]: getCommonNormalizer(ConfigKey.CONFIG_HASH), - - // Deprecated, slated to be removed in a future release - [ConfigKey.ID]: getCommonNormalizer(ConfigKey.ID), + [ConfigKey.MONITOR_QUERY_ID]: getCommonNormalizer(ConfigKey.MONITOR_QUERY_ID), }; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx index f9e3572ead511..e4594e8c60630 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx @@ -42,6 +42,7 @@ describe('MonitorTitle component', () => { id: defaultMonitorId, status: 'up', type: 'http', + check_group: 'test-group', }, url: { full: 'https://www.elastic.co/', @@ -58,6 +59,7 @@ describe('MonitorTitle component', () => { id: 'browser', status: 'up', type: 'browser', + check_group: 'test-group', }, url: { full: 'https://www.elastic.co/', diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx index ddb33e4dd5fea..f0e60b2902828 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx @@ -32,6 +32,7 @@ describe('PingList component', () => { name: '', status: 'down', type: 'tcp', + check_group: 'test-group', }, }, { @@ -47,6 +48,7 @@ describe('PingList component', () => { name: '', status: 'down', type: 'tcp', + check_group: 'test-group', }, }, ]; @@ -120,6 +122,7 @@ describe('PingList component', () => { "type": "io", }, "monitor": Object { + "check_group": "test-group", "duration": Object { "us": 1430, }, @@ -160,6 +163,7 @@ describe('PingList component', () => { "type": "io", }, "monitor": Object { + "check_group": "test-group", "id": "auto-tcp-0X81440A68E839814D", "ip": "255.255.255.0", "name": "", diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx index 640d207fbb138..af5df91160026 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx @@ -28,6 +28,7 @@ describe('MonitorStatusBar component', () => { id: 'id1', status: 'up', type: 'http', + check_group: 'test-group', }, url: { full: 'https://www.example.com/', diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx index 3580df2c317a7..6d8b0b455a5f2 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx @@ -135,7 +135,7 @@ const defaultState = { describe('WaterfallChartContainer', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); it('does not display waterfall chart unavailable when isWaterfallSupported is true', () => { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx index 81ed2d024340c..ba26366644dbd 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx @@ -26,7 +26,7 @@ const getHighLightedItems = (query: string, filters: string[]) => { describe('WaterfallChartWrapper', () => { beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); it('renders the correct sidebar items', () => { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx index 42cb46427011c..c36e46b9d999b 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx @@ -19,7 +19,7 @@ import { } from '../../waterfall/components/translations'; describe('waterfall filter', () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); it('renders correctly', () => { const { getByLabelText, getByTitle } = render( diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx index a69ebb3d349fd..7869125014b02 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx @@ -37,6 +37,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -58,6 +59,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -79,6 +81,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -103,6 +106,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -124,6 +128,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -145,6 +150,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -169,6 +175,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -190,6 +197,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -211,6 +219,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap index a07a55df6dbfa..0c037492bbc6b 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap @@ -111,6 +111,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there are Object { "docId": "foo", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 121, }, @@ -125,6 +126,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there are Object { "docId": "foo-0", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -139,6 +141,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there are Object { "docId": "foo-1", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 1, }, @@ -153,6 +156,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there are Object { "docId": "foo-2", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 2, }, @@ -289,6 +293,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there is o Object { "docId": "foo", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 121, }, diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx index f1a9d1b2629a6..7318fc5188af8 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx @@ -29,6 +29,7 @@ describe('MonitorStatusList component', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: {}, @@ -44,6 +45,7 @@ describe('MonitorStatusList component', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: {}, @@ -59,6 +61,7 @@ describe('MonitorStatusList component', () => { id: 'myUpMonitor', type: 'icmp', duration: { us: 234 }, + check_group: 'test-group', }, observer: { geo: { @@ -165,6 +168,7 @@ describe('MonitorStatusList component', () => { id: 'myMonitor', type: 'icmp', duration: { us: 234 }, + check_group: 'test-group', }, observer: { geo: { @@ -182,6 +186,7 @@ describe('MonitorStatusList component', () => { id: 'myMonitor', type: 'icmp', duration: { us: 234 }, + check_group: 'test-group', }, observer: { geo: { @@ -199,6 +204,7 @@ describe('MonitorStatusList component', () => { id: 'myMonitor', type: 'icmp', duration: { us: 234 }, + check_group: 'test-group', }, observer: { geo: { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.test.ts index f6c637e5fdb1b..c7675d9607772 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.test.ts @@ -25,6 +25,7 @@ describe('selectedFiltersReducer', () => { us: 1, }, type: 'browser', + check_group: 'test-group', }, }, }; @@ -42,6 +43,7 @@ describe('selectedFiltersReducer', () => { us: 1, }, type: 'browser', + check_group: 'test-group', }, }; expect( diff --git a/x-pack/plugins/synthetics/server/common/pings/query_pings.ts b/x-pack/plugins/synthetics/server/common/pings/query_pings.ts index b6d1b42923928..872336767aec8 100644 --- a/x-pack/plugins/synthetics/server/common/pings/query_pings.ts +++ b/x-pack/plugins/synthetics/server/common/pings/query_pings.ts @@ -68,6 +68,7 @@ export const queryPings: UMElasticsearchQueryFn<GetPingsParams, PingsResponse> = status, sort, size: sizeParam, + pageIndex, locations, excludedLocations, }) => { @@ -75,6 +76,7 @@ export const queryPings: UMElasticsearchQueryFn<GetPingsParams, PingsResponse> = const searchBody = { size, + from: pageIndex !== undefined ? pageIndex * size : 0, ...(index ? { from: index * size } : {}), query: { bool: { diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/adapters/framework/adapter_types.ts index 90f12b7368120..b5c41eb0c50b4 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/adapters/framework/adapter_types.ts @@ -57,7 +57,7 @@ export interface UptimeServerSetup { savedObjectsClient?: SavedObjectsClientContract; authSavedObjectsClient?: SavedObjectsClientContract; encryptedSavedObjects: EncryptedSavedObjectsPluginStart; - kibanaVersion: string; + stackVersion: string; logger: Logger; telemetry: TelemetryEventsSender; uptimeEsClient: UptimeEsClient; diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor.ts index 9b92463f78641..c085e5c7d7158 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor.ts @@ -12,7 +12,7 @@ import { EncryptedSyntheticsMonitor, SyntheticsMonitor, } from '../../../../common/runtime_types'; -import { syntheticsMonitor, syntheticsMonitorType } from '../saved_objects/synthetics_monitor'; +import { syntheticsMonitorType } from '../saved_objects/synthetics_monitor'; import { normalizeSecrets } from '../../../synthetics_service/utils/secrets'; export const getSyntheticsMonitor = async ({ @@ -32,7 +32,7 @@ export const getSyntheticsMonitor = async ({ const decryptedMonitor = await encryptedSavedObjectsClient.getDecryptedAsInternalUser<SyntheticsMonitorWithSecrets>( - syntheticsMonitor.name, + syntheticsMonitorType, monitorId, { namespace: encryptedMonitor.namespaces?.[0], diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts index d84c4025d5dd0..7069cfce17740 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts @@ -411,6 +411,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -432,6 +433,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -453,6 +455,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -542,6 +545,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -563,6 +567,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -584,6 +589,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -605,6 +611,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/migrations/monitors/8.6.0.test.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/migrations/monitors/8.6.0.test.ts new file mode 100644 index 0000000000000..68e3416174c8f --- /dev/null +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/migrations/monitors/8.6.0.test.ts @@ -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 { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; +import { migration860 } from './8.6.0'; +import { migrationMocks } from '@kbn/core/server/mocks'; +import { + ConfigKey, + LocationStatus, + SyntheticsMonitorWithSecrets, +} from '../../../../../../common/runtime_types'; + +const context = migrationMocks.createContext(); +const encryptedSavedObjectsSetup = encryptedSavedObjectsMock.createSetup(); + +const monitor850UI = { + id: 'ac38d021-515b-425c-9f92-e6212dadef9a', + type: 'synthetics-monitor', + namespaces: ['default'], + updated_at: '2022-10-24T14:17:01.875Z', + version: 'WzgzOCwyQr==', + attributes: { + type: 'http', + form_monitor_type: 'http', + enabled: true, + schedule: { number: '3', unit: 'm' }, + 'service.name': '', + config_id: '', + tags: [], + timeout: '16', + name: 'Dominique Clarke', + locations: [{ id: 'us_central', isServiceManaged: true }], + namespace: 'default', + origin: 'ui', + journey_id: '', + id: '', + __ui: { is_tls_enabled: false, is_zip_url_tls_enabled: false }, + urls: 'https://elastic.co', + max_redirects: '0', + 'url.port': null, + proxy_url: '', + 'response.include_body': 'on_error', + 'response.include_headers': true, + 'check.response.status': [], + 'check.request.method': 'GET', + 'ssl.certificate_authorities': '', + 'ssl.certificate': '', + 'ssl.verification_mode': 'full', + 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], + revision: 1, + secrets: + '{"password":"","check.request.body":{"type":"text","value":""},"check.request.headers":{},"check.response.body.negative":[],"check.response.body.positive":[],"check.response.headers":{},"ssl.key":"","ssl.key_passphrase":"","username":""}', + } as SyntheticsMonitorWithSecrets, + references: [], + coreMigrationVersion: '8.5.0', +}; + +const monitor850Project = { + id: '3ab5c90f-aa7f-4370-ada2-b559191398f0', + type: 'synthetics-monitor', + namespaces: ['default'], + updated_at: '2022-10-24T15:39:41.510Z', + version: 'WzE2OSwxXQ==', + attributes: { + type: 'browser', + form_monitor_type: 'multistep', + enabled: true, + schedule: { number: '3', unit: 'm' }, + 'service.name': '', + config_id: '', + tags: [], + timeout: null, + name: 'a', + locations: [ + { + id: 'us_central', + label: 'North America - US Central', + geo: { lat: 41.25, lon: -95.86 }, + url: 'https://us-central.synthetics.elastic.dev', + isServiceManaged: true, + status: LocationStatus.GA, + isInvalid: false, + }, + ], + namespace: 'default', + origin: 'project', + journey_id: 'a', + id: '', + project_id: 'test2', + playwright_options: '{"ignoreHTTPSErrors":true,"headless":true}', + __ui: { + script_source: { is_generated_script: false, file_name: '' }, + is_zip_url_tls_enabled: false, + }, + 'url.port': null, + 'source.zip_url.url': '', + 'source.zip_url.folder': '', + 'source.zip_url.proxy_url': '', + playwright_text_assertion: '', + urls: '', + screenshots: 'on', + 'filter_journeys.match': 'a', + 'filter_journeys.tags': [], + ignore_https_errors: false, + 'throttling.is_enabled': true, + 'throttling.download_speed': '10', + 'throttling.upload_speed': '5', + 'throttling.latency': '10', + 'throttling.config': '10d/5u/10l', + 'ssl.certificate_authorities': '', + 'ssl.certificate': '', + 'ssl.verification_mode': 'full', + 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], + original_space: 'default', + custom_heartbeat_id: 'a-test2-default', + revision: 1, + secrets: + '{"params":"{\\"url\\":\\"https://elastic.github.io/synthetics-demo/\\"}","source.inline.script":"","source.project.content":"UEsDBBQACAAIAAAAIQAAAAAAAAAAAAAAAAAXAAAAam91cm5leXMvb25lLmpvdXJuZXkudHNVkL1uwzAMhHc/BeFJAQyrLdAlQYouXbp3KjqwMhMrlUVVohMYgd+9in+AdCHED6c7kloDpkSy1R+JYtINd9bb356Mw/hDuqGzToOXlsSapIWSPOkT99HTkDR7qpemllTYLnAUuMLCKkhCoYKOvRWOMMIhcgflKzlM2e/OudwVZ4xgIqHQ+/wd9qA8drSB/QtcC1h96j6RuvUA0kYWcdYftzATgIYv3jE2W3h8qBbWh5k8r8DlGG+Gm2YiY67jZpfrMvuUXIG6QsBjfgSM2KWsWYeBaTlVOuy9aQFDcNagWPZllW86eAPqTgyAF7QyudVHFlazY91HN+Wu+bc67orPErNP+V1+1QeOb2hapXDy+3ejzLL+D1BLBwgqc7lrFgEAAMYBAABQSwECLQMUAAgACAAAACEAKnO5axYBAADGAQAAFwAAAAAAAAAAACAApIEAAAAAam91cm5leXMvb25lLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBFAAAAWwEAAAAA","source.zip_url.username":"","source.zip_url.password":"","synthetics_args":[],"ssl.key":"","ssl.key_passphrase":""}', + } as SyntheticsMonitorWithSecrets, + references: [], + coreMigrationVersion: '8.5.0', +}; + +describe('Case migrations v8.5.0 -> v8.6.0', () => { + beforeEach(() => { + jest.resetAllMocks(); + encryptedSavedObjectsSetup.createMigration.mockImplementation(({ migration }) => migration); + }); + + it('UI monitors - adds saved object id to the id field', () => { + expect(migration860(encryptedSavedObjectsSetup)(monitor850UI, context)).toEqual({ + ...monitor850UI, + attributes: { + ...monitor850UI.attributes, + [ConfigKey.MONITOR_QUERY_ID]: monitor850UI.id, + [ConfigKey.CONFIG_ID]: monitor850UI.id, + }, + }); + }); + + it('project monitors - adds custom heartbeat id to id field', () => { + expect(migration860(encryptedSavedObjectsSetup)(monitor850Project, context)).toEqual({ + ...monitor850Project, + attributes: { + ...monitor850Project.attributes, + [ConfigKey.MONITOR_QUERY_ID]: monitor850Project.attributes[ConfigKey.CUSTOM_HEARTBEAT_ID], + [ConfigKey.CONFIG_ID]: monitor850Project.id, + }, + }); + }); + + it('handles empty custom heartbeat id string', () => { + const attributes = { ...monitor850UI.attributes, [ConfigKey.CUSTOM_HEARTBEAT_ID]: '' }; + expect( + migration860(encryptedSavedObjectsSetup)( + { + ...monitor850UI, + attributes, + }, + context + ) + ).toEqual({ + ...monitor850UI, + attributes: { + ...attributes, + [ConfigKey.MONITOR_QUERY_ID]: monitor850UI.id, + [ConfigKey.CONFIG_ID]: monitor850UI.id, + }, + }); + }); + + it('handles null custom heartbeat id string', () => { + const attributes = { ...monitor850UI.attributes, [ConfigKey.CUSTOM_HEARTBEAT_ID]: null }; + + expect( + migration860(encryptedSavedObjectsSetup)( + { + ...monitor850UI, + // @ts-ignore + attributes, + }, + context + ) + ).toEqual({ + ...monitor850UI, + attributes: { + ...attributes, + [ConfigKey.MONITOR_QUERY_ID]: monitor850UI.id, + [ConfigKey.CONFIG_ID]: monitor850UI.id, + }, + }); + }); + + it('handles undefined custom heartbeat id string', () => { + const attributes = { ...monitor850UI.attributes, [ConfigKey.CUSTOM_HEARTBEAT_ID]: undefined }; + expect( + migration860(encryptedSavedObjectsSetup)( + { + ...monitor850UI, + attributes, + }, + context + ) + ).toEqual({ + ...monitor850UI, + attributes: { + ...attributes, + [ConfigKey.MONITOR_QUERY_ID]: monitor850UI.id, + [ConfigKey.CONFIG_ID]: monitor850UI.id, + }, + }); + }); +}); diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/migrations/monitors/8.6.0.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/migrations/monitors/8.6.0.ts new file mode 100644 index 0000000000000..d4bea87a45bb4 --- /dev/null +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/migrations/monitors/8.6.0.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import { SavedObjectUnsanitizedDoc } from '@kbn/core/server'; +import { ConfigKey, SyntheticsMonitorWithSecrets } from '../../../../../../common/runtime_types'; + +export const migration860 = (encryptedSavedObjects: EncryptedSavedObjectsPluginSetup) => { + return encryptedSavedObjects.createMigration< + SyntheticsMonitorWithSecrets, + SyntheticsMonitorWithSecrets + >({ + isMigrationNeededPredicate: function shouldBeMigrated( + doc + ): doc is SavedObjectUnsanitizedDoc<SyntheticsMonitorWithSecrets> { + return true; + }, + migration: ( + doc: SavedObjectUnsanitizedDoc<SyntheticsMonitorWithSecrets> + ): SavedObjectUnsanitizedDoc<SyntheticsMonitorWithSecrets> => { + const { attributes, id } = doc; + return { + ...doc, + attributes: { + ...attributes, + [ConfigKey.MONITOR_QUERY_ID]: attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] || id, + [ConfigKey.CONFIG_ID]: id, + }, + }; + }, + }); +}; diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/migrations/monitors/index.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/migrations/monitors/index.ts new file mode 100644 index 0000000000000..bb26f51a603e6 --- /dev/null +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/migrations/monitors/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. + */ + +import { migration860 } from './8.6.0'; + +export const monitorMigrations = { + '8.6.0': migration860, +}; diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/saved_objects.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/saved_objects.ts index 0a06d1926a855..24d3cc03b6ca2 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/saved_objects.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/saved_objects.ts @@ -15,7 +15,7 @@ import { DynamicSettings } from '../../../../common/runtime_types'; import { UMSavedObjectsQueryFn } from '../adapters'; import { UptimeConfig } from '../../../../common/config'; import { settingsObjectId, umDynamicSettings } from './uptime_settings'; -import { syntheticsMonitor } from './synthetics_monitor'; +import { syntheticsMonitorType, getSyntheticsMonitorSavedObjectType } from './synthetics_monitor'; import { syntheticsServiceApiKey } from './service_api_key'; export const registerUptimeSavedObjects = ( @@ -25,7 +25,7 @@ export const registerUptimeSavedObjects = ( savedObjectsService.registerType(umDynamicSettings); savedObjectsService.registerType(privateLocationsSavedObject); - savedObjectsService.registerType(syntheticsMonitor); + savedObjectsService.registerType(getSyntheticsMonitorSavedObjectType(encryptedSavedObjects)); savedObjectsService.registerType(syntheticsServiceApiKey); encryptedSavedObjects.registerType({ @@ -34,7 +34,7 @@ export const registerUptimeSavedObjects = ( }); encryptedSavedObjects.registerType({ - type: syntheticsMonitor.name, + type: syntheticsMonitorType, attributesToEncrypt: new Set([ 'secrets', /* adding secretKeys to the list of attributes to encrypt ensures diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/synthetics_monitor.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/synthetics_monitor.ts index 94a8a0085e170..72715091c06de 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/synthetics_monitor.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/saved_objects/synthetics_monitor.ts @@ -4,95 +4,103 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { SavedObjectsType } from '@kbn/core/server'; import { i18n } from '@kbn/i18n'; +import { monitorMigrations } from './migrations/monitors'; export const syntheticsMonitorType = 'synthetics-monitor'; -export const syntheticsMonitor: SavedObjectsType = { - name: syntheticsMonitorType, - hidden: false, - namespaceType: 'single', - mappings: { - dynamic: false, - properties: { - name: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, - normalizer: 'lowercase', +export const getSyntheticsMonitorSavedObjectType = ( + encryptedSavedObjects: EncryptedSavedObjectsPluginSetup +): SavedObjectsType => { + return { + name: syntheticsMonitorType, + hidden: false, + namespaceType: 'single', + migrations: { + '8.6.0': monitorMigrations['8.6.0'](encryptedSavedObjects), + }, + mappings: { + dynamic: false, + properties: { + name: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + normalizer: 'lowercase', + }, }, }, - }, - type: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, + type: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, }, }, - }, - urls: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, + urls: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, }, }, - }, - journey_id: { - type: 'keyword', - }, - project_id: { - type: 'keyword', - }, - origin: { - type: 'keyword', - }, - hash: { - type: 'keyword', - }, - locations: { - properties: { - id: { - type: 'keyword', - ignore_above: 256, - fields: { - text: { - type: 'text', + journey_id: { + type: 'keyword', + }, + project_id: { + type: 'keyword', + }, + origin: { + type: 'keyword', + }, + hash: { + type: 'keyword', + }, + locations: { + properties: { + id: { + type: 'keyword', + ignore_above: 256, + fields: { + text: { + type: 'text', + }, }, }, }, }, - }, - custom_heartbeat_id: { - type: 'keyword', - }, - tags: { - type: 'keyword', - }, - schedule: { - properties: { - number: { - type: 'integer', + custom_heartbeat_id: { + type: 'keyword', + }, + tags: { + type: 'keyword', + }, + schedule: { + properties: { + number: { + type: 'integer', + }, }, }, }, }, - }, - management: { - importableAndExportable: false, - icon: 'uptimeApp', - getTitle: (savedObject) => - savedObject.attributes.name + - ' - ' + - i18n.translate('xpack.synthetics.syntheticsMonitors', { - defaultMessage: 'Uptime - Monitor', - }), - }, + management: { + importableAndExportable: false, + icon: 'uptimeApp', + getTitle: (savedObject) => + savedObject.attributes.name + + ' - ' + + i18n.translate('xpack.synthetics.syntheticsMonitors', { + defaultMessage: 'Uptime - Monitor', + }), + }, + }; }; diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/telemetry/types.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/telemetry/types.ts index b9178c2d8ad6b..69030bcdbf9f3 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/telemetry/types.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/telemetry/types.ts @@ -41,7 +41,7 @@ export interface MonitorErrorEvent { code?: string; status?: number; url?: string; - kibanaVersion: string; + stackVersion: string; } export interface MonitorUpdateTelemetryChannelEvents { diff --git a/x-pack/plugins/synthetics/server/plugin.ts b/x-pack/plugins/synthetics/server/plugin.ts index 209ff9e57face..8871b387eb62d 100644 --- a/x-pack/plugins/synthetics/server/plugin.ts +++ b/x-pack/plugins/synthetics/server/plugin.ts @@ -81,7 +81,7 @@ export class Plugin implements PluginType { config, router: core.http.createRouter(), cloud: plugins.cloud, - kibanaVersion: this.initContext.env.packageInfo.version, + stackVersion: this.initContext.env.packageInfo.version, basePath: core.http.basePath, logger: this.logger, telemetry: this.telemetryEventsSender, diff --git a/x-pack/plugins/synthetics/server/routes/index.ts b/x-pack/plugins/synthetics/server/routes/index.ts index c1c06215c8c16..546dda039ba22 100644 --- a/x-pack/plugins/synthetics/server/routes/index.ts +++ b/x-pack/plugins/synthetics/server/routes/index.ts @@ -27,6 +27,7 @@ import { installIndexTemplatesRoute } from './synthetics_service/install_index_t import { editSyntheticsMonitorRoute } from './monitor_cruds/edit_monitor'; import { addSyntheticsMonitorRoute } from './monitor_cruds/add_monitor'; import { addSyntheticsProjectMonitorRoute } from './monitor_cruds/add_monitor_project'; +import { addSyntheticsProjectMonitorRouteLegacy } from './monitor_cruds/add_monitor_project_legacy'; import { syntheticsGetPingsRoute } from './pings'; import { createGetCurrentStatusRoute } from './status/current_status'; import { @@ -37,6 +38,7 @@ import { getHasZipUrlMonitorRoute } from './fleet/get_has_zip_url_monitors'; export const syntheticsAppRestApiRoutes: SyntheticsRestApiRouteFactory[] = [ addSyntheticsMonitorRoute, + addSyntheticsProjectMonitorRoute, getSyntheticsEnablementRoute, deleteSyntheticsMonitorRoute, deleteSyntheticsMonitorProjectRoute, @@ -59,5 +61,5 @@ export const syntheticsAppRestApiRoutes: SyntheticsRestApiRouteFactory[] = [ ]; export const syntheticsAppStreamingApiRoutes: SyntheticsStreamingRouteFactory[] = [ - addSyntheticsProjectMonitorRoute, + addSyntheticsProjectMonitorRouteLegacy, ]; diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts index 1f9a55e347618..138224a5a11ea 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts @@ -118,7 +118,7 @@ export const createNewSavedObjectMonitor = async ({ savedObjectsClient, normalizedMonitor, }: { - id?: string; + id: string; savedObjectsClient: SavedObjectsClientContract; normalizedMonitor: SyntheticsMonitor; }) => { @@ -126,6 +126,8 @@ export const createNewSavedObjectMonitor = async ({ syntheticsMonitorType, formatSecrets({ ...normalizedMonitor, + [ConfigKey.MONITOR_QUERY_ID]: normalizedMonitor[ConfigKey.CUSTOM_HEARTBEAT_ID] || id, + [ConfigKey.CONFIG_ID]: id, revision: 1, }), id @@ -199,7 +201,7 @@ export const syncNewMonitor = async ({ errors: syncErrors, monitor: monitorSavedObject, isInlineScript: Boolean((normalizedMonitor as MonitorFields)[ConfigKey.SOURCE_INLINE]), - kibanaVersion: server.kibanaVersion, + stackVersion: server.stackVersion, }) ); diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor_project.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor_project.ts index 533690de30bed..0d1eea6cf419d 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor_project.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor_project.ts @@ -5,25 +5,24 @@ * 2.0. */ import { schema } from '@kbn/config-schema'; -import { UMServerLibs } from '../../legacy_uptime/lib/lib'; +import { i18n } from '@kbn/i18n'; import { ProjectMonitor } from '../../../common/runtime_types'; -import { SyntheticsStreamingRouteFactory } from '../../legacy_uptime/routes/types'; +import { SyntheticsRestApiRouteFactory } from '../../legacy_uptime/routes/types'; import { API_URLS } from '../../../common/constants'; import { getAllLocations } from '../../synthetics_service/get_all_locations'; import { ProjectMonitorFormatter } from '../../synthetics_service/project_monitor/project_monitor_formatter'; const MAX_PAYLOAD_SIZE = 1048576 * 20; // 20MiB -export const addSyntheticsProjectMonitorRoute: SyntheticsStreamingRouteFactory = ( - libs: UMServerLibs -) => ({ +export const addSyntheticsProjectMonitorRoute: SyntheticsRestApiRouteFactory = () => ({ method: 'PUT', - path: API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY, + path: API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE, validate: { + params: schema.object({ + projectName: schema.string(), + }), body: schema.object({ - project: schema.string(), - keep_stale: schema.boolean(), monitors: schema.arrayOf(schema.any()), }), }, @@ -34,15 +33,25 @@ export const addSyntheticsProjectMonitorRoute: SyntheticsStreamingRouteFactory = }, handler: async ({ request, + response, savedObjectsClient, server, syntheticsMonitorClient, - subject, }): Promise<any> => { + const { projectName } = request.params; + const decodedProjectName = decodeURI(projectName); + const monitors = (request.body?.monitors as ProjectMonitor[]) || []; + const spaceId = server.spaces.spacesService.getSpaceId(request); + + if (monitors.length > 250) { + return response.badRequest({ + body: { + message: REQUEST_TOO_LARGE, + }, + }); + } + try { - const monitors = (request.body?.monitors as ProjectMonitor[]) || []; - const spaceId = server.spaces.spacesService.getSpaceId(request); - const { keep_stale: keepStale, project: projectId } = request.body || {}; const { publicLocations, privateLocations } = await getAllLocations( server, syntheticsMonitorClient, @@ -51,9 +60,8 @@ export const addSyntheticsProjectMonitorRoute: SyntheticsStreamingRouteFactory = const encryptedSavedObjectsClient = server.encryptedSavedObjects.getClient(); const pushMonitorFormatter = new ProjectMonitorFormatter({ - projectId, + projectId: decodedProjectName, spaceId, - keepStale, locations: publicLocations, privateLocations, encryptedSavedObjectsClient, @@ -62,23 +70,23 @@ export const addSyntheticsProjectMonitorRoute: SyntheticsStreamingRouteFactory = server, syntheticsMonitorClient, request, - subject, }); await pushMonitorFormatter.configureAllProjectMonitors(); - subject?.next({ + return { createdMonitors: pushMonitorFormatter.createdMonitors, updatedMonitors: pushMonitorFormatter.updatedMonitors, - staleMonitors: pushMonitorFormatter.staleMonitors, - deletedMonitors: pushMonitorFormatter.deletedMonitors, failedMonitors: pushMonitorFormatter.failedMonitors, - failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, - }); + }; } catch (error) { - subject?.error(error); - } finally { - subject?.complete(); + server.logger.error(`Error adding monitors to project ${decodedProjectName}`); + throw error; } }, }); + +export const REQUEST_TOO_LARGE = i18n.translate('xpack.synthetics.server.project.delete.toolarge', { + defaultMessage: + 'Delete request payload is too large. Please send a max of 250 monitors to delete per request', +}); diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor_project_legacy.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor_project_legacy.ts new file mode 100644 index 0000000000000..f8f29e46c1fad --- /dev/null +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor_project_legacy.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 { schema } from '@kbn/config-schema'; +import { UMServerLibs } from '../../legacy_uptime/lib/lib'; +import { ProjectMonitor } from '../../../common/runtime_types'; + +import { SyntheticsStreamingRouteFactory } from '../../legacy_uptime/routes/types'; +import { API_URLS } from '../../../common/constants'; +import { getAllLocations } from '../../synthetics_service/get_all_locations'; +import { ProjectMonitorFormatterLegacy } from '../../synthetics_service/project_monitor/project_monitor_formatter_legacy'; + +const MAX_PAYLOAD_SIZE = 1048576 * 20; // 20MiB + +export const addSyntheticsProjectMonitorRouteLegacy: SyntheticsStreamingRouteFactory = ( + libs: UMServerLibs +) => ({ + method: 'PUT', + path: API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY, + validate: { + body: schema.object({ + project: schema.string(), + keep_stale: schema.boolean(), + monitors: schema.arrayOf(schema.any()), + }), + }, + options: { + body: { + maxBytes: MAX_PAYLOAD_SIZE, + }, + }, + handler: async ({ + request, + savedObjectsClient, + server, + syntheticsMonitorClient, + subject, + }): Promise<any> => { + try { + const monitors = (request.body?.monitors as ProjectMonitor[]) || []; + const spaceId = server.spaces.spacesService.getSpaceId(request); + const { keep_stale: keepStale, project: projectId } = request.body || {}; + const { publicLocations, privateLocations } = await getAllLocations( + server, + syntheticsMonitorClient, + savedObjectsClient + ); + const encryptedSavedObjectsClient = server.encryptedSavedObjects.getClient(); + + const pushMonitorFormatter = new ProjectMonitorFormatterLegacy({ + projectId, + spaceId, + keepStale, + locations: publicLocations, + privateLocations, + encryptedSavedObjectsClient, + savedObjectsClient, + monitors, + server, + syntheticsMonitorClient, + request, + subject, + }); + + await pushMonitorFormatter.configureAllProjectMonitors(); + + subject?.next({ + createdMonitors: pushMonitorFormatter.createdMonitors, + updatedMonitors: pushMonitorFormatter.updatedMonitors, + staleMonitors: pushMonitorFormatter.staleMonitors, + deletedMonitors: pushMonitorFormatter.deletedMonitors, + failedMonitors: pushMonitorFormatter.failedMonitors, + failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, + }); + } catch (error) { + subject?.error(error); + } finally { + subject?.complete(); + } + }, +}); diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts index 0f32882974279..1d8ed3dc9eb67 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts @@ -35,6 +35,8 @@ export const createNewSavedObjectMonitorBulk = async ({ type: syntheticsMonitorType, attributes: formatSecrets({ ...monitor, + [ConfigKey.MONITOR_QUERY_ID]: monitor[ConfigKey.CUSTOM_HEARTBEAT_ID] || id, + [ConfigKey.CONFIG_ID]: id, revision: 1, }), })); @@ -138,7 +140,7 @@ const sendNewMonitorTelemetry = ( errors, monitor, isInlineScript: Boolean((monitor.attributes as MonitorFields)[ConfigKey.SOURCE_INLINE]), - kibanaVersion: server.kibanaVersion, + stackVersion: server.stackVersion, }) ); } diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts index 862bab6915f36..3c83514155747 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts @@ -34,7 +34,7 @@ export const deleteMonitorBulk = async ({ syntheticsMonitorClient: SyntheticsMonitorClient; request: KibanaRequest; }) => { - const { logger, telemetry, kibanaVersion } = server; + const { logger, telemetry, stackVersion } = server; const spaceId = server.spaces.spacesService.getSpaceId(request); try { @@ -60,7 +60,7 @@ export const deleteMonitorBulk = async ({ telemetry, formatTelemetryDeleteEvent( monitor, - kibanaVersion, + stackVersion, new Date().toISOString(), Boolean((monitor.attributes as MonitorFields)[ConfigKey.SOURCE_INLINE]), errors diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts index 5c28bdab9d3d1..3f89aab5f1cc2 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts @@ -106,7 +106,7 @@ export const syncEditedMonitorBulk = async ({ formatTelemetryUpdateEvent( editedMonitorSavedObject as SavedObjectsUpdateResponse<EncryptedSyntheticsMonitor>, previousMonitor, - server.kibanaVersion, + server.stackVersion, Boolean((normalizedMonitor as MonitorFields)[ConfigKey.SOURCE_INLINE]), errors ) diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor.ts index de1b0b90ef95c..831f4b2c341e8 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor.ts @@ -19,10 +19,7 @@ import { } from '../../../common/runtime_types'; import { SyntheticsRestApiRouteFactory } from '../../legacy_uptime/routes/types'; import { API_URLS } from '../../../common/constants'; -import { - syntheticsMonitorType, - syntheticsMonitor, -} from '../../legacy_uptime/lib/saved_objects/synthetics_monitor'; +import { syntheticsMonitorType } from '../../legacy_uptime/lib/saved_objects/synthetics_monitor'; import { getMonitorNotFoundResponse } from '../synthetics_service/service_errors'; import { sendTelemetryEvents, @@ -87,7 +84,7 @@ export const deleteMonitor = async ({ syntheticsMonitorClient: SyntheticsMonitorClient; request: KibanaRequest; }) => { - const { logger, telemetry, kibanaVersion, encryptedSavedObjects } = server; + const { logger, telemetry, stackVersion, encryptedSavedObjects } = server; const spaceId = server.spaces.spacesService.getSpaceId(request); const encryptedSavedObjectsClient = encryptedSavedObjects.getClient(); @@ -100,7 +97,7 @@ export const deleteMonitor = async ({ const monitor = await encryptedSavedObjectsClient.getDecryptedAsInternalUser<SyntheticsMonitorWithSecrets>( - syntheticsMonitor.name, + syntheticsMonitorType, monitorId, { namespace: encryptedMonitor.namespaces?.[0], @@ -131,7 +128,7 @@ export const deleteMonitor = async ({ telemetry, formatTelemetryDeleteEvent( monitor, - kibanaVersion, + stackVersion, new Date().toISOString(), Boolean((normalizedMonitor.attributes as MonitorFields)[ConfigKey.SOURCE_INLINE]), errors diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts index 3deb7a1be2170..67c937fb78a7b 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts @@ -16,7 +16,7 @@ import { deleteMonitorBulk } from './bulk_cruds/delete_monitor_bulk'; export const deleteSyntheticsMonitorProjectRoute: SyntheticsRestApiRouteFactory = () => ({ method: 'DELETE', - path: API_URLS.SYNTHETICS_MONITORS_PROJECT, + path: API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE, validate: { body: schema.object({ monitors: schema.arrayOf(schema.string()), diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts index 9f4492ce2dc70..88a60907baf34 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts @@ -28,7 +28,7 @@ describe('syncEditedMonitor', () => { const serverMock: UptimeServerSetup = { uptimeEsClient: { search: jest.fn() }, - kibanaVersion: null, + stackVersion: null, authSavedObjectsClient: { bulkUpdate: jest.fn(), get: jest.fn(), diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts index d6b50880ed350..086ce90744ca9 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts @@ -24,10 +24,7 @@ import { } from '../../../common/runtime_types'; import { SyntheticsRestApiRouteFactory } from '../../legacy_uptime/routes/types'; import { API_URLS } from '../../../common/constants'; -import { - syntheticsMonitorType, - syntheticsMonitor, -} from '../../legacy_uptime/lib/saved_objects/synthetics_monitor'; +import { syntheticsMonitorType } from '../../legacy_uptime/lib/saved_objects/synthetics_monitor'; import { validateMonitor } from './monitor_validation'; import { getMonitorNotFoundResponse } from '../synthetics_service/service_errors'; import { @@ -72,7 +69,7 @@ export const editSyntheticsMonitorRoute: SyntheticsRestApiRouteFactory = () => ( * on the monitor list table. We do not decrypt monitors in bulk for the monitor list table */ const decryptedPreviousMonitor = await encryptedSavedObjectsClient.getDecryptedAsInternalUser<SyntheticsMonitorWithSecrets>( - syntheticsMonitor.name, + syntheticsMonitorType, monitorId, { namespace: previousMonitor.namespaces?.[0], @@ -175,7 +172,7 @@ export const syncEditedMonitor = async ({ formatTelemetryUpdateEvent( editedMonitorSavedObject as SavedObjectsUpdateResponse<EncryptedSyntheticsMonitor>, previousMonitor, - server.kibanaVersion, + server.stackVersion, Boolean((normalizedMonitor as MonitorFields)[ConfigKey.SOURCE_INLINE]), errors ) diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/get_monitor.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/get_monitor.ts index 1d02454ce04ba..0a3ece38ee788 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/get_monitor.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/get_monitor.ts @@ -6,7 +6,7 @@ */ import { schema } from '@kbn/config-schema'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; -import { ConfigKey } from '../../../common/runtime_types'; +import { ConfigKey, MonitorOverviewItem, SyntheticsMonitor } from '../../../common/runtime_types'; import { UMServerLibs } from '../../legacy_uptime/lib/lib'; import { SyntheticsRestApiRouteFactory } from '../../legacy_uptime/routes/types'; import { API_URLS, SYNTHETICS_API_URLS } from '../../../common/constants'; @@ -112,55 +112,42 @@ export const getSyntheticsMonitorOverviewRoute: SyntheticsRestApiRouteFactory = query: querySchema, }, handler: async ({ request, savedObjectsClient, syntheticsMonitorClient }): Promise<any> => { - const { perPage = 5 } = request.query; - const { saved_objects: monitors } = await getMonitors( - { - perPage: 1000, - sortField: 'name.keyword', - sortOrder: 'asc', - page: 1, - }, - syntheticsMonitorClient.syntheticsService, - savedObjectsClient - ); + const { sortField, sortOrder } = request.query; + const finder = savedObjectsClient.createPointInTimeFinder<SyntheticsMonitor>({ + type: syntheticsMonitorType, + sortField: sortField === 'status' ? `${ConfigKey.NAME}.keyword` : sortField, + sortOrder, + perPage: 500, + }); const allMonitorIds: string[] = []; - const pages: Record<number, unknown[]> = {}; - let currentPage = 0; - let currentItem = 0; let total = 0; + const allMonitors: MonitorOverviewItem[] = []; - monitors.forEach((monitor) => { + for await (const result of finder.find()) { /* collect all monitor ids for use * in filtering overview requests */ - const id = monitor.id; - allMonitorIds.push(id); + result.saved_objects.forEach((monitor) => { + const id = monitor.id; + allMonitorIds.push(id); - /* for reach location, add a config item */ - const locations = monitor.attributes[ConfigKey.LOCATIONS]; - locations.forEach((location) => { - const config = { - id, - name: monitor.attributes[ConfigKey.NAME], - location, - isEnabled: monitor.attributes[ConfigKey.ENABLED], - }; - if (!pages[currentPage]) { - pages[currentPage] = [config]; - } else { - pages[currentPage].push(config); - } - currentItem++; - total++; - if (currentItem % perPage === 0) { - currentPage++; - currentItem = 0; - } + /* for reach location, add a config item */ + const locations = monitor.attributes[ConfigKey.LOCATIONS]; + locations.forEach((location) => { + const config = { + id, + name: monitor.attributes[ConfigKey.NAME], + location, + isEnabled: monitor.attributes[ConfigKey.ENABLED], + }; + allMonitors.push(config); + total++; + }); }); - }); + } return { - pages, + monitors: allMonitors, total, allMonitorIds, }; diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/monitor_validation.test.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/monitor_validation.test.ts index 76bda0f4a2f12..b927e1a37e21a 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/monitor_validation.test.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/monitor_validation.test.ts @@ -58,6 +58,7 @@ describe('validateMonitor', () => { [ConfigKey.MONITOR_TYPE]: DataStream.ICMP, [ConfigKey.NAME]: 'test-monitor-name', [ConfigKey.CONFIG_ID]: 'test-monitor-id', + [ConfigKey.MONITOR_QUERY_ID]: '', [ConfigKey.ENABLED]: true, [ConfigKey.TAGS]: testTags, [ConfigKey.SCHEDULE]: testSchedule, @@ -445,6 +446,7 @@ function getJsonPayload() { ' ],' + ' "name": "test-monitor-name",' + ' "config_id": "test-monitor-id",' + + ' "id": "test-id",' + ' "namespace": "testnamespace",' + ' "locations": [{' + ' "id": "eu-west-01",' + diff --git a/x-pack/plugins/synthetics/server/routes/pings/get_pings.ts b/x-pack/plugins/synthetics/server/routes/pings/get_pings.ts index e94c928caed53..def868e404db5 100644 --- a/x-pack/plugins/synthetics/server/routes/pings/get_pings.ts +++ b/x-pack/plugins/synthetics/server/routes/pings/get_pings.ts @@ -23,13 +23,24 @@ export const syntheticsGetPingsRoute: UMRestApiRouteFactory = (libs: UMServerLib monitorId: schema.maybe(schema.string()), index: schema.maybe(schema.number()), size: schema.maybe(schema.number()), + pageIndex: schema.maybe(schema.number()), sort: schema.maybe(schema.string()), status: schema.maybe(schema.string()), }), }, handler: async ({ uptimeEsClient, request, response }): Promise<any> => { - const { from, to, index, monitorId, status, sort, size, locations, excludedLocations } = - request.query; + const { + from, + to, + index, + monitorId, + status, + sort, + size, + pageIndex, + locations, + excludedLocations, + } = request.query; return await queryPings({ uptimeEsClient, @@ -39,6 +50,7 @@ export const syntheticsGetPingsRoute: UMRestApiRouteFactory = (libs: UMServerLib status, sort, size, + pageIndex, locations: locations ? JSON.parse(locations) : [], excludedLocations, }); diff --git a/x-pack/plugins/synthetics/server/routes/status/current_status.test.ts b/x-pack/plugins/synthetics/server/routes/status/current_status.test.ts index 12fdea5b9fd4d..3a03d96f14db7 100644 --- a/x-pack/plugins/synthetics/server/routes/status/current_status.test.ts +++ b/x-pack/plugins/synthetics/server/routes/status/current_status.test.ts @@ -78,11 +78,18 @@ describe('current status route', () => { '@timestamp': '2022-09-15T16:08:16.724Z', monitor: { status: 'up', + id: 'id1', }, summary: { up: 1, down: 0, }, + config_id: 'id1', + observer: { + geo: { + name: 'test-location', + }, + }, }, }, ], @@ -106,11 +113,18 @@ describe('current status route', () => { '@timestamp': '2022-09-15T16:09:16.724Z', monitor: { status: 'up', + id: 'id2', }, summary: { up: 1, down: 0, }, + config_id: 'id2', + observer: { + geo: { + name: 'test-location', + }, + }, }, }, ], @@ -127,11 +141,18 @@ describe('current status route', () => { '@timestamp': '2022-09-15T16:19:16.724Z', monitor: { status: 'down', + id: 'id2', }, summary: { down: 1, up: 0, }, + config_id: 'id2', + observer: { + geo: { + name: 'test-location', + }, + }, }, }, ], @@ -146,6 +167,25 @@ describe('current status route', () => { expect(await queryMonitorStatus(uptimeEsClient, 3, 140000, ['id1', 'id2'])).toEqual({ down: 1, up: 2, + upConfigs: [ + { + configId: 'id1', + heartbeatId: 'id1', + location: 'test-location', + }, + { + configId: 'id2', + heartbeatId: 'id2', + location: 'test-location', + }, + ], + downConfigs: [ + { + configId: 'id2', + heartbeatId: 'id2', + location: 'test-location', + }, + ], }); }); @@ -167,11 +207,18 @@ describe('current status route', () => { '@timestamp': '2022-09-15T16:08:16.724Z', monitor: { status: 'up', + id: 'id1', }, summary: { up: 1, down: 0, }, + config_id: 'id1', + observer: { + geo: { + name: 'test-location', + }, + }, }, }, ], @@ -195,11 +242,18 @@ describe('current status route', () => { '@timestamp': '2022-09-15T16:09:16.724Z', monitor: { status: 'up', + id: 'id2', }, summary: { up: 1, down: 0, }, + config_id: 'id2', + observer: { + geo: { + name: 'test-location', + }, + }, }, }, ], @@ -216,11 +270,18 @@ describe('current status route', () => { '@timestamp': '2022-09-15T16:19:16.724Z', monitor: { status: 'down', + id: 'id2', }, summary: { up: 0, down: 1, }, + config_id: 'id2', + observer: { + geo: { + name: 'test-location', + }, + }, }, }, ], @@ -242,6 +303,25 @@ describe('current status route', () => { expect(await queryMonitorStatus(uptimeEsClient, 10000, 2500, ['id1', 'id2'])).toEqual({ down: 1, up: 2, + upConfigs: [ + { + configId: 'id1', + heartbeatId: 'id1', + location: 'test-location', + }, + { + configId: 'id2', + heartbeatId: 'id2', + location: 'test-location', + }, + ], + downConfigs: [ + { + configId: 'id2', + heartbeatId: 'id2', + location: 'test-location', + }, + ], }); expect(esClient.search).toHaveBeenCalledTimes(2); // These assertions are to ensure that we are paginating through the IDs we use for filtering diff --git a/x-pack/plugins/synthetics/server/routes/status/current_status.ts b/x-pack/plugins/synthetics/server/routes/status/current_status.ts index 0de4de69776af..5770ab5b9d625 100644 --- a/x-pack/plugins/synthetics/server/routes/status/current_status.ts +++ b/x-pack/plugins/synthetics/server/routes/status/current_status.ts @@ -15,7 +15,7 @@ import { SyntheticsRestApiRouteFactory } from '../../legacy_uptime/routes'; import { getMonitors } from '../common'; import { UptimeEsClient } from '../../legacy_uptime/lib/lib'; import { SyntheticsMonitorClient } from '../../synthetics_service/synthetics_monitor/synthetics_monitor_client'; -import { ConfigKey, OverviewStatus } from '../../../common/runtime_types'; +import { ConfigKey, OverviewStatus, OverviewStatusMetaData } from '../../../common/runtime_types'; /** * Helper function that converts a monitor's schedule to a value to use to generate @@ -36,7 +36,7 @@ export async function queryMonitorStatus( maxLocations: number, maxPeriod: number, ids: Array<string | undefined> -): Promise<Pick<OverviewStatus, 'up' | 'down'>> { +): Promise<Omit<OverviewStatus, 'disabledCount'>> { const idSize = Math.trunc(DEFAULT_MAX_ES_BUCKET_SIZE / maxLocations); const pageCount = Math.ceil(ids.length / idSize); const promises: Array<Promise<any>> = []; @@ -92,7 +92,7 @@ export async function queryMonitorStatus( }, ], _source: { - includes: ['@timestamp', 'summary'], + includes: ['@timestamp', 'summary', 'monitor', 'observer', 'config_id'], }, }, }, @@ -107,20 +107,35 @@ export async function queryMonitorStatus( } let up = 0; let down = 0; + const upConfigs: OverviewStatusMetaData[] = []; + const downConfigs: OverviewStatusMetaData[] = []; for await (const response of promises) { response.aggregations?.id.buckets.forEach(({ location }: { key: string; location: any }) => { location.buckets.forEach(({ status }: { key: string; status: any }) => { const downCount = status.hits.hits[0]._source.summary.down; const upCount = status.hits.hits[0]._source.summary.up; + const configId = status.hits.hits[0]._source.config_id; + const heartbeatId = status.hits.hits[0]._source.monitor.id; + const locationName = status.hits.hits[0]._source.observer?.geo?.name; if (upCount > 0) { up += 1; + upConfigs.push({ + configId, + heartbeatId, + location: locationName, + }); } else if (downCount > 0) { down += 1; + downConfigs.push({ + configId, + heartbeatId, + location: locationName, + }); } }); }); } - return { up, down }; + return { up, down, upConfigs, downConfigs }; } /** @@ -169,7 +184,7 @@ export async function getStatus( }); } while (monitors.saved_objects.length === monitors.per_page); - const { up, down } = await queryMonitorStatus( + const { up, down, upConfigs, downConfigs } = await queryMonitorStatus( uptimeEsClient, maxLocations, maxPeriod, @@ -180,6 +195,8 @@ export async function getStatus( disabledCount, up, down, + upConfigs, + downConfigs, }; } diff --git a/x-pack/plugins/synthetics/server/routes/synthetics_service/test_now_monitor.ts b/x-pack/plugins/synthetics/server/routes/synthetics_service/test_now_monitor.ts index 0a2c3f599ff62..1c6d6548c575d 100644 --- a/x-pack/plugins/synthetics/server/routes/synthetics_service/test_now_monitor.ts +++ b/x-pack/plugins/synthetics/server/routes/synthetics_service/test_now_monitor.ts @@ -14,10 +14,7 @@ import { } from '../../../common/runtime_types'; import { SyntheticsRestApiRouteFactory } from '../../legacy_uptime/routes/types'; import { API_URLS } from '../../../common/constants'; -import { - syntheticsMonitor, - syntheticsMonitorType, -} from '../../legacy_uptime/lib/saved_objects/synthetics_monitor'; +import { syntheticsMonitorType } from '../../legacy_uptime/lib/saved_objects/synthetics_monitor'; import { formatHeartbeatRequest } from '../../synthetics_service/formatters/format_configs'; import { normalizeSecrets } from '../../synthetics_service/utils/secrets'; @@ -45,7 +42,7 @@ export const testNowMonitorRoute: SyntheticsRestApiRouteFactory = () => ({ const monitorWithSecrets = await encryptedClient.getDecryptedAsInternalUser<SyntheticsMonitorWithSecrets>( - syntheticsMonitor.name, + syntheticsMonitorType, monitorId ); const normalizedMonitor = normalizeSecrets(monitorWithSecrets); diff --git a/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts b/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts index 692f55d87297f..65ee31dbb08aa 100644 --- a/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts +++ b/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts @@ -32,7 +32,7 @@ import { sendTelemetryEvents, } from './monitor_upgrade_sender'; -const kibanaVersion = '8.2.0'; +const stackVersion = '8.2.0'; const id = '123456'; const errors = [ { @@ -91,12 +91,12 @@ describe('monitor upgrade telemetry helpers', () => { it('formats telemetry events', () => { const actual = formatTelemetryEvent({ monitor: testConfig, - kibanaVersion, + stackVersion, isInlineScript: false, errors, }); expect(actual).toEqual({ - stackVersion: kibanaVersion, + stackVersion, configId: sha256.create().update(testConfig.id).hex(), locations: ['us_central', 'other'], locationsCount: 2, @@ -131,11 +131,11 @@ describe('monitor upgrade telemetry helpers', () => { }, }), isInlineScript, - kibanaVersion, + stackVersion, errors, }); expect(actual).toEqual({ - stackVersion: kibanaVersion, + stackVersion, configId: sha256.create().update(testConfig.id).hex(), locations: ['us_central', 'other'], locationsCount: 2, @@ -157,12 +157,12 @@ describe('monitor upgrade telemetry helpers', () => { const actual = formatTelemetryUpdateEvent( createTestConfig({}, '2011-10-05T16:48:00.000Z'), testConfig, - kibanaVersion, + stackVersion, false, errors ); expect(actual).toEqual({ - stackVersion: kibanaVersion, + stackVersion, configId: sha256.create().update(testConfig.id).hex(), locations: ['us_central', 'other'], locationsCount: 2, @@ -182,13 +182,13 @@ describe('monitor upgrade telemetry helpers', () => { it('handles formatting delete events', () => { const actual = formatTelemetryDeleteEvent( testConfig, - kibanaVersion, + stackVersion, '2011-10-05T16:48:00.000Z', false, errors ); expect(actual).toEqual({ - stackVersion: kibanaVersion, + stackVersion, configId: sha256.create().update(testConfig.id).hex(), locations: ['us_central', 'other'], locationsCount: 2, @@ -218,7 +218,7 @@ describe('sendTelemetryEvents', () => { it('should queue telemetry events with generic error', () => { const event = formatTelemetryEvent({ monitor: testConfig, - kibanaVersion, + stackVersion, isInlineScript: true, errors, }); diff --git a/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts b/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts index 1cb4659359f5e..d86792a7967c3 100644 --- a/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts +++ b/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts @@ -65,7 +65,7 @@ export function sendErrorTelemetryEvents( export function formatTelemetryEvent({ monitor, - kibanaVersion, + stackVersion, isInlineScript, lastUpdatedAt, durationSinceLastUpdated, @@ -73,7 +73,7 @@ export function formatTelemetryEvent({ errors, }: { monitor: SavedObject<EncryptedSyntheticsMonitor>; - kibanaVersion: string; + stackVersion: string; isInlineScript: boolean; lastUpdatedAt?: string; durationSinceLastUpdated?: number; @@ -83,6 +83,7 @@ export function formatTelemetryEvent({ const { attributes } = monitor; return { + stackVersion, updatedAt: deletedAt || monitor.updated_at, lastUpdatedAt, durationSinceLastUpdated, @@ -94,7 +95,6 @@ export function formatTelemetryEvent({ locationsCount: attributes[ConfigKey.LOCATIONS].length, monitorNameLength: attributes[ConfigKey.NAME].length, monitorInterval: scheduleToMilli(attributes[ConfigKey.SCHEDULE]), - stackVersion: kibanaVersion, scriptType: getScriptType(attributes as Partial<MonitorFields>, isInlineScript), errors: errors && errors?.length @@ -115,7 +115,7 @@ export function formatTelemetryEvent({ export function formatTelemetryUpdateEvent( currentMonitor: SavedObjectsUpdateResponse<EncryptedSyntheticsMonitor>, previousMonitor: SavedObject<EncryptedSyntheticsMonitor>, - kibanaVersion: string, + stackVersion: string, isInlineScript: boolean, errors?: ServiceLocationErrors | null ) { @@ -127,8 +127,8 @@ export function formatTelemetryUpdateEvent( } return formatTelemetryEvent({ + stackVersion, monitor: currentMonitor as SavedObject<EncryptedSyntheticsMonitor>, - kibanaVersion, durationSinceLastUpdated, lastUpdatedAt: previousMonitor.updated_at, isInlineScript, @@ -138,7 +138,7 @@ export function formatTelemetryUpdateEvent( export function formatTelemetryDeleteEvent( previousMonitor: SavedObject<EncryptedSyntheticsMonitor>, - kibanaVersion: string, + stackVersion: string, deletedAt: string, isInlineScript: boolean, errors?: ServiceLocationErrors | null @@ -150,8 +150,8 @@ export function formatTelemetryDeleteEvent( } return formatTelemetryEvent({ + stackVersion, monitor: previousMonitor as SavedObject<EncryptedSyntheticsMonitor>, - kibanaVersion, durationSinceLastUpdated, lastUpdatedAt: previousMonitor.updated_at, deletedAt, diff --git a/x-pack/plugins/synthetics/server/synthetics_service/formatters/common.ts b/x-pack/plugins/synthetics/server/synthetics_service/formatters/common.ts index f88f23ca38037..5db57ee5fdeb8 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/formatters/common.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/formatters/common.ts @@ -35,9 +35,7 @@ export const commonFormatters: CommonFormatMap = { [ConfigKey.CUSTOM_HEARTBEAT_ID]: null, [ConfigKey.ORIGINAL_SPACE]: null, [ConfigKey.CONFIG_HASH]: null, - - // Deprecated, slated to be removed in a later releae - [ConfigKey.ID]: null, + [ConfigKey.MONITOR_QUERY_ID]: null, }; export const arrayFormatter = (value: string[] = []) => (value.length ? value : null); diff --git a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.ts b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.ts index 8eba2cd2651db..778a801e3a00c 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.ts @@ -54,7 +54,7 @@ export const getNormalizeBrowserFields = ({ monitor.throttling?.upload || defaultFields[ConfigKey.UPLOAD_SPEED] }`, [ConfigKey.IS_THROTTLING_ENABLED]: - Boolean(monitor.throttling) || defaultFields[ConfigKey.IS_THROTTLING_ENABLED], + Boolean(monitor.throttling) ?? defaultFields[ConfigKey.IS_THROTTLING_ENABLED], [ConfigKey.LATENCY]: `${monitor.throttling?.latency || defaultFields[ConfigKey.LATENCY]}`, [ConfigKey.IGNORE_HTTPS_ERRORS]: monitor.ignoreHTTPSErrors || defaultFields[ConfigKey.IGNORE_HTTPS_ERRORS], diff --git a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.test.ts b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.test.ts index 5892f53344d48..28de75ed511d3 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.test.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.test.ts @@ -10,7 +10,7 @@ import { INSUFFICIENT_FLEET_PERMISSIONS, ProjectMonitorFormatter, } from './project_monitor_formatter'; -import { DataStream, LocationStatus } from '../../../common/runtime_types'; +import { ConfigKey, DataStream, LocationStatus } from '../../../common/runtime_types'; import { DEFAULT_FIELDS } from '../../../common/constants/monitor_defaults'; import { times } from 'lodash'; import { SyntheticsService } from '../synthetics_service'; @@ -18,7 +18,6 @@ import { UptimeServerSetup } from '../../legacy_uptime/lib/adapters'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { SyntheticsMonitorClient } from '../synthetics_monitor/synthetics_monitor_client'; import { httpServerMock } from '@kbn/core-http-server-mocks'; -import { Subject } from 'rxjs'; import { formatSecrets } from '../utils'; import * as telemetryHooks from '../../routes/telemetry/monitor_upgrade_sender'; @@ -141,14 +140,9 @@ describe('ProjectMonitorFormatter', () => { const monitorClient = new SyntheticsMonitorClient(syntheticsService, serverMock); it('should return errors', async () => { - const testSubject = new Subject(); - - testSubject.next = jest.fn(); - const pushMonitorFormatter = new ProjectMonitorFormatter({ projectId: 'test-project', spaceId: 'default-space', - keepStale: false, locations, privateLocations, encryptedSavedObjectsClient, @@ -157,32 +151,18 @@ describe('ProjectMonitorFormatter', () => { server: serverMock, syntheticsMonitorClient: monitorClient, request: kibanaRequest, - subject: testSubject, }); pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); await pushMonitorFormatter.configureAllProjectMonitors(); - expect(testSubject.next).toHaveBeenNthCalledWith( - 1, - 'check if title is present 10 0: failed to create or update monitor' - ); - expect(testSubject.next).toHaveBeenNthCalledWith( - 2, - 'check if title is present 10 1: failed to create or update monitor' - ); - expect({ createdMonitors: pushMonitorFormatter.createdMonitors, updatedMonitors: pushMonitorFormatter.updatedMonitors, - staleMonitors: pushMonitorFormatter.staleMonitors, - deletedMonitors: pushMonitorFormatter.deletedMonitors, failedMonitors: pushMonitorFormatter.failedMonitors, - failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, }).toStrictEqual({ createdMonitors: [], - deletedMonitors: [], failedMonitors: [ { details: "Cannot read properties of undefined (reading 'authz')", @@ -197,15 +177,11 @@ describe('ProjectMonitorFormatter', () => { reason: 'Failed to create or update monitor', }, ], - failedStaleMonitors: [], - staleMonitors: [], updatedMonitors: [], }); }); it('throws fleet permission error', async () => { - const testSubject = new Subject(); - serverMock.fleet = { authz: { fromRequest: jest @@ -217,7 +193,6 @@ describe('ProjectMonitorFormatter', () => { const pushMonitorFormatter = new ProjectMonitorFormatter({ projectId: 'test-project', spaceId: 'default-space', - keepStale: false, locations, privateLocations, encryptedSavedObjectsClient, @@ -226,7 +201,6 @@ describe('ProjectMonitorFormatter', () => { server: serverMock, syntheticsMonitorClient: monitorClient, request: kibanaRequest, - subject: testSubject, }); pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); @@ -236,13 +210,9 @@ describe('ProjectMonitorFormatter', () => { expect({ createdMonitors: pushMonitorFormatter.createdMonitors, updatedMonitors: pushMonitorFormatter.updatedMonitors, - staleMonitors: pushMonitorFormatter.staleMonitors, - deletedMonitors: pushMonitorFormatter.deletedMonitors, failedMonitors: pushMonitorFormatter.failedMonitors, - failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, }).toStrictEqual({ createdMonitors: [], - deletedMonitors: [], failedMonitors: [ { details: INSUFFICIENT_FLEET_PERMISSIONS, @@ -257,15 +227,11 @@ describe('ProjectMonitorFormatter', () => { reason: 'Failed to create or update monitor', }, ], - failedStaleMonitors: [], - staleMonitors: [], updatedMonitors: [], }); }); it('catches errors from bulk edit method', async () => { - const testSubject = new Subject(); - serverMock.fleet = { authz: { fromRequest: jest @@ -277,7 +243,6 @@ describe('ProjectMonitorFormatter', () => { const pushMonitorFormatter = new ProjectMonitorFormatter({ projectId: 'test-project', spaceId: 'default-space', - keepStale: false, locations, privateLocations, encryptedSavedObjectsClient, @@ -286,7 +251,6 @@ describe('ProjectMonitorFormatter', () => { server: serverMock, syntheticsMonitorClient: monitorClient, request: kibanaRequest, - subject: testSubject, }); pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); @@ -296,15 +260,10 @@ describe('ProjectMonitorFormatter', () => { expect({ createdMonitors: pushMonitorFormatter.createdMonitors, updatedMonitors: pushMonitorFormatter.updatedMonitors, - staleMonitors: pushMonitorFormatter.staleMonitors, - deletedMonitors: pushMonitorFormatter.deletedMonitors, failedMonitors: pushMonitorFormatter.failedMonitors, - failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, }).toEqual({ createdMonitors: [], updatedMonitors: [], - staleMonitors: [], - deletedMonitors: [], failedMonitors: [ { details: "Cannot read properties of undefined (reading 'buildPackagePolicyFromPackage')", @@ -312,13 +271,10 @@ describe('ProjectMonitorFormatter', () => { reason: 'Failed to create 2 monitors', }, ], - failedStaleMonitors: [], }); }); it('configures project monitors when there are errors', async () => { - const testSubject = new Subject(); - serverMock.fleet = { authz: { fromRequest: jest @@ -332,7 +288,6 @@ describe('ProjectMonitorFormatter', () => { const pushMonitorFormatter = new ProjectMonitorFormatter({ projectId: 'test-project', spaceId: 'default-space', - keepStale: false, locations, privateLocations, encryptedSavedObjectsClient, @@ -341,7 +296,6 @@ describe('ProjectMonitorFormatter', () => { server: serverMock, syntheticsMonitorClient: monitorClient, request: kibanaRequest, - subject: testSubject, }); pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); @@ -351,15 +305,10 @@ describe('ProjectMonitorFormatter', () => { expect({ createdMonitors: pushMonitorFormatter.createdMonitors, updatedMonitors: pushMonitorFormatter.updatedMonitors, - staleMonitors: pushMonitorFormatter.staleMonitors, - deletedMonitors: pushMonitorFormatter.deletedMonitors, failedMonitors: pushMonitorFormatter.failedMonitors, - failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, }).toEqual({ createdMonitors: [], updatedMonitors: [], - staleMonitors: [], - deletedMonitors: [], failedMonitors: [ { details: "Cannot read properties of undefined (reading 'buildPackagePolicyFromPackage')", @@ -367,13 +316,10 @@ describe('ProjectMonitorFormatter', () => { reason: 'Failed to create 2 monitors', }, ], - failedStaleMonitors: [], }); }); it('shows errors thrown by fleet api', async () => { - const testSubject = new Subject(); - serverMock.fleet = { authz: { fromRequest: jest @@ -388,7 +334,6 @@ describe('ProjectMonitorFormatter', () => { const pushMonitorFormatter = new ProjectMonitorFormatter({ projectId: 'test-project', spaceId: 'default-space', - keepStale: false, locations, privateLocations, encryptedSavedObjectsClient, @@ -397,7 +342,6 @@ describe('ProjectMonitorFormatter', () => { server: serverMock, syntheticsMonitorClient: monitorClient, request: kibanaRequest, - subject: testSubject, }); pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); @@ -407,15 +351,10 @@ describe('ProjectMonitorFormatter', () => { expect({ createdMonitors: pushMonitorFormatter.createdMonitors, updatedMonitors: pushMonitorFormatter.updatedMonitors, - staleMonitors: pushMonitorFormatter.staleMonitors, - deletedMonitors: pushMonitorFormatter.deletedMonitors, failedMonitors: pushMonitorFormatter.failedMonitors, - failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, }).toEqual({ createdMonitors: [], updatedMonitors: [], - staleMonitors: [], - deletedMonitors: [], failedMonitors: [ { details: @@ -424,13 +363,10 @@ describe('ProjectMonitorFormatter', () => { payload: payloadData, }, ], - failedStaleMonitors: [], }); }); it('creates project monitors when no errors', async () => { - const testSubject = new Subject(); - serverMock.fleet = { authz: { fromRequest: jest @@ -450,7 +386,6 @@ describe('ProjectMonitorFormatter', () => { const pushMonitorFormatter = new ProjectMonitorFormatter({ projectId: 'test-project', spaceId: 'default-space', - keepStale: false, locations, privateLocations, encryptedSavedObjectsClient, @@ -459,7 +394,6 @@ describe('ProjectMonitorFormatter', () => { server: serverMock, syntheticsMonitorClient: monitorClient, request: kibanaRequest, - subject: testSubject, }); pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); @@ -468,8 +402,22 @@ describe('ProjectMonitorFormatter', () => { expect(soClient.bulkCreate).toHaveBeenCalledWith( expect.arrayContaining([ - expect.objectContaining(soData[0]), - expect.objectContaining(soData[1]), + expect.objectContaining({ + ...soData[0], + attributes: { + ...soData[0].attributes, + [ConfigKey.MONITOR_QUERY_ID]: expect.any(String), + [ConfigKey.CONFIG_ID]: expect.any(String), + }, + }), + expect.objectContaining({ + ...soData[1], + attributes: { + ...soData[1].attributes, + [ConfigKey.MONITOR_QUERY_ID]: expect.any(String), + [ConfigKey.CONFIG_ID]: expect.any(String), + }, + }), ]) ); @@ -478,17 +426,11 @@ describe('ProjectMonitorFormatter', () => { expect({ createdMonitors: pushMonitorFormatter.createdMonitors, updatedMonitors: pushMonitorFormatter.updatedMonitors, - staleMonitors: pushMonitorFormatter.staleMonitors, - deletedMonitors: pushMonitorFormatter.deletedMonitors, failedMonitors: pushMonitorFormatter.failedMonitors, - failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, }).toEqual({ createdMonitors: ['check if title is present 10 0', 'check if title is present 10 1'], updatedMonitors: [], - staleMonitors: [], - deletedMonitors: [], failedMonitors: [], - failedStaleMonitors: [], }); }); }); diff --git a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts index 6139b2fbe7959..35e85fe5cd03d 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts @@ -4,10 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { Subject } from 'rxjs'; -import { isEqual } from 'lodash'; -import pMap from 'p-map'; import { KibanaRequest } from '@kbn/core/server'; +import pMap from 'p-map'; import { SavedObjectsUpdateResponse, SavedObjectsClientContract, @@ -16,7 +14,6 @@ import { import { i18n } from '@kbn/i18n'; import { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; import { syncNewMonitorBulk } from '../../routes/monitor_cruds/bulk_cruds/add_monitor_bulk'; -import { deleteMonitorBulk } from '../../routes/monitor_cruds/bulk_cruds/delete_monitor_bulk'; import { SyntheticsMonitorClient } from '../synthetics_monitor/synthetics_monitor_client'; import { syncEditedMonitorBulk } from '../../routes/monitor_cruds/bulk_cruds/edit_monitor_bulk'; import { @@ -30,10 +27,7 @@ import { MonitorFields, PrivateLocation, } from '../../../common/runtime_types'; -import { - syntheticsMonitorType, - syntheticsMonitor, -} from '../../legacy_uptime/lib/saved_objects/synthetics_monitor'; +import { syntheticsMonitorType } from '../../legacy_uptime/lib/saved_objects/synthetics_monitor'; import type { UptimeServerSetup } from '../../legacy_uptime/lib/adapters'; import { formatSecrets, normalizeSecrets } from '../utils/secrets'; import { @@ -43,12 +37,6 @@ import { } from '../../routes/monitor_cruds/monitor_validation'; import { normalizeProjectMonitor } from './normalizers'; -interface StaleMonitor { - stale: boolean; - journeyId: string; - savedObjectId: string; -} -type StaleMonitorMap = Record<string, StaleMonitor>; type FailedError = Array<{ id?: string; reason: string; details: string; payload?: object }>; export const INSUFFICIENT_FLEET_PERMISSIONS = i18n.translate( @@ -59,34 +47,48 @@ export const INSUFFICIENT_FLEET_PERMISSIONS = i18n.translate( } ); +export const CANNOT_UPDATE_MONITOR_TO_DIFFERENT_TYPE = i18n.translate( + 'xpack.synthetics.service.projectMonitors.cannotUpdateMonitorToDifferentType', + { + defaultMessage: 'Cannot update monitor to different type.', + } +); + +export const FAILED_TO_UPDATE_MONITOR = i18n.translate( + 'xpack.synthetics.service.projectMonitors.failedToUpdateMonitor', + { + defaultMessage: 'Failed to create or update monitor', + } +); + +export const FAILED_TO_UPDATE_MONITORS = i18n.translate( + 'xpack.synthetics.service.projectMonitors.failedToUpdateMonitors', + { + defaultMessage: 'Failed to create or update monitors', + } +); + export class ProjectMonitorFormatter { private projectId: string; private spaceId: string; - private keepStale: boolean; private locations: Locations; private privateLocations: PrivateLocation[]; private savedObjectsClient: SavedObjectsClientContract; private encryptedSavedObjectsClient: EncryptedSavedObjectsClient; - private staleMonitorsMap: StaleMonitorMap = {}; private monitors: ProjectMonitor[] = []; public createdMonitors: string[] = []; - public deletedMonitors: string[] = []; public updatedMonitors: string[] = []; - public staleMonitors: string[] = []; public failedMonitors: FailedError = []; - public failedStaleMonitors: FailedError = []; private server: UptimeServerSetup; private projectFilter: string; private syntheticsMonitorClient: SyntheticsMonitorClient; private request: KibanaRequest; - private subject?: Subject<unknown>; private writeIntegrationPoliciesPermissions?: boolean; constructor({ locations, privateLocations, - keepStale, savedObjectsClient, encryptedSavedObjectsClient, projectId, @@ -95,11 +97,9 @@ export class ProjectMonitorFormatter { server, syntheticsMonitorClient, request, - subject, }: { locations: Locations; privateLocations: PrivateLocation[]; - keepStale: boolean; savedObjectsClient: SavedObjectsClientContract; encryptedSavedObjectsClient: EncryptedSavedObjectsClient; projectId: string; @@ -108,13 +108,11 @@ export class ProjectMonitorFormatter { server: UptimeServerSetup; syntheticsMonitorClient: SyntheticsMonitorClient; request: KibanaRequest; - subject?: Subject<unknown>; }) { this.projectId = projectId; this.spaceId = spaceId; this.locations = locations; this.privateLocations = privateLocations; - this.keepStale = keepStale; this.savedObjectsClient = savedObjectsClient; this.encryptedSavedObjectsClient = encryptedSavedObjectsClient; this.syntheticsMonitorClient = syntheticsMonitorClient; @@ -122,12 +120,10 @@ export class ProjectMonitorFormatter { this.server = server; this.projectFilter = `${syntheticsMonitorType}.attributes.${ConfigKey.PROJECT_ID}: "${this.projectId}"`; this.request = request; - this.subject = subject; } public configureAllProjectMonitors = async () => { const existingMonitors = await this.getProjectMonitorsForProject(); - this.staleMonitorsMap = await this.getStaleMonitorsMap(existingMonitors); const normalizedNewMonitors: SyntheticsMonitor[] = []; const normalizedUpdateMonitors: Array<{ @@ -145,11 +141,29 @@ export class ProjectMonitorFormatter { monitor, }); if (normM) { - if (previousMonitor) { + if ( + previousMonitor && + previousMonitor.attributes[ConfigKey.MONITOR_TYPE] !== normM[ConfigKey.MONITOR_TYPE] + ) { + this.failedMonitors.push({ + reason: CANNOT_UPDATE_MONITOR_TO_DIFFERENT_TYPE, + details: i18n.translate( + 'xpack.synthetics.service.projectMonitors.cannotUpdateMonitorToDifferentTypeDetails', + { + defaultMessage: + 'Monitor {monitorId} of type {previousType} cannot be updated to type {currentType}. Please delete the monitor first and try again.', + values: { + currentType: monitor.type, + previousType: previousMonitor.attributes[ConfigKey.MONITOR_TYPE], + monitorId: monitor.id, + }, + } + ), + payload: monitor, + }); + continue; + } else if (previousMonitor) { this.updatedMonitors.push(monitor.id); - if (this.staleMonitorsMap[monitor.id]) { - this.staleMonitorsMap[monitor.id].stale = false; - } normalizedUpdateMonitors.push({ monitor: normM as MonitorFields, previousMonitor }); } else { normalizedNewMonitors.push(normM as MonitorFields); @@ -159,28 +173,7 @@ export class ProjectMonitorFormatter { await this.createMonitorsBulk(normalizedNewMonitors); - const { updatedCount } = await this.updateMonitorsBulk(normalizedUpdateMonitors); - - if (normalizedUpdateMonitors.length > 0) { - let updateMessage = ''; - if (updatedCount > 0) { - updateMessage = `${updatedCount} monitor${ - updatedCount > 1 ? 's' : '' - } updated successfully.`; - } - - const noChanges = normalizedUpdateMonitors.length - updatedCount; - let noChangeMessage = ''; - if (noChanges > 0) { - noChangeMessage = `${noChanges} monitor${noChanges > 1 ? 's' : ''} found with no changes.`; - } - - this.handleStreamingMessage({ - message: `${updateMessage} ${noChangeMessage}`, - }); - } - - await this.handleStaleMonitors(); + await this.updateMonitorsBulk(normalizedUpdateMonitors); }; validatePermissions = async ({ monitor }: { monitor: ProjectMonitor }) => { @@ -208,14 +201,11 @@ export class ProjectMonitorFormatter { privateLocations: this.privateLocations, projectId: this.projectId, namespace: this.spaceId, - version: this.server.kibanaVersion, + version: this.server.stackVersion, }); if (errors.length) { this.failedMonitors.push(...errors); - this.handleStreamingMessage({ - message: `${monitor.id}: failed to create or update monitor`, - }); return null; } @@ -247,36 +237,13 @@ export class ProjectMonitorFormatter { this.server.logger.error(e); this.failedMonitors.push({ id: monitor.id, - reason: 'Failed to create or update monitor', + reason: FAILED_TO_UPDATE_MONITOR, details: e.message, payload: monitor, }); - this.handleStreamingMessage({ message: `${monitor.id}: failed to create or update monitor` }); - if (this.staleMonitorsMap[monitor.id]) { - this.staleMonitorsMap[monitor.id].stale = false; - } } }; - private getStaleMonitorsMap = async ( - existingMonitors: Array<SavedObjectsFindResult<EncryptedSyntheticsMonitor>> - ): Promise<StaleMonitorMap> => { - const staleMonitors: StaleMonitorMap = {}; - - existingMonitors.forEach((savedObject) => { - const journeyId = (savedObject.attributes as SyntheticsMonitor)[ConfigKey.JOURNEY_ID]; - if (journeyId) { - staleMonitors[journeyId] = { - stale: true, - savedObjectId: savedObject.id, - journeyId, - }; - } - }); - - return staleMonitors; - }; - public getProjectMonitorsForProject = async () => { const finder = this.savedObjectsClient.createPointInTimeFinder({ type: syntheticsMonitorType, @@ -311,32 +278,34 @@ export class ProjectMonitorFormatter { if (newMonitors && newMonitors.length === monitors.length) { this.createdMonitors.push(...monitors.map((monitor) => monitor[ConfigKey.JOURNEY_ID]!)); - this.handleStreamingMessage({ - message: `${monitors.length} monitor${ - monitors.length > 1 ? 's' : '' - } created successfully.`, - }); } else { this.failedMonitors.push({ - reason: `Failed to create ${monitors.length} monitors`, - details: 'Failed to create monitors', + reason: i18n.translate( + 'xpack.synthetics.service.projectMonitors.failedToCreateXMonitors', + { + defaultMessage: 'Failed to create {length} monitors', + values: { + length: monitors.length, + }, + } + ), + details: FAILED_TO_UPDATE_MONITORS, payload: monitors, }); - this.handleStreamingMessage({ - message: `Failed to create ${monitors.length} monitors`, - }); } } } catch (e) { this.server.logger.error(e); this.failedMonitors.push({ - reason: `Failed to create ${monitors.length} monitors`, + reason: i18n.translate('xpack.synthetics.service.projectMonitors.failedToCreateXMonitors', { + defaultMessage: 'Failed to create {length} monitors', + values: { + length: monitors.length, + }, + }), details: e.message, payload: monitors, }); - this.handleStreamingMessage({ - message: `Failed to create ${monitors.length} monitors`, - }); } }; @@ -347,7 +316,7 @@ export class ProjectMonitorFormatter { monitors, async (monitor) => this.encryptedSavedObjectsClient.getDecryptedAsInternalUser<SyntheticsMonitorWithSecrets>( - syntheticsMonitor.name, + syntheticsMonitorType, monitor.id, { namespace: monitor.namespaces?.[0], @@ -381,21 +350,18 @@ export class ProjectMonitorFormatter { const { attributes: { [ConfigKey.REVISION]: _, ...normalizedPreviousMonitorAttributes }, } = normalizeSecrets(decryptedPreviousMonitor); - const hasMonitorBeenEdited = !isEqual(normalizedMonitor, normalizedPreviousMonitorAttributes); - if (hasMonitorBeenEdited) { - const monitorWithRevision = formatSecrets({ - ...normalizedPreviousMonitorAttributes, - ...normalizedMonitor, - revision: (previousMonitor.attributes[ConfigKey.REVISION] || 0) + 1, - }); - monitorsToUpdate.push({ - normalizedMonitor, - previousMonitor, - monitorWithRevision, - decryptedPreviousMonitor, - }); - } + const monitorWithRevision = formatSecrets({ + ...normalizedPreviousMonitorAttributes, + ...normalizedMonitor, + revision: (previousMonitor.attributes[ConfigKey.REVISION] || 0) + 1, + }); + monitorsToUpdate.push({ + normalizedMonitor, + previousMonitor, + monitorWithRevision, + decryptedPreviousMonitor, + }); } const { editedMonitors } = await syncEditedMonitorBulk({ @@ -414,108 +380,6 @@ export class ProjectMonitorFormatter { }; }; - private handleStaleMonitors = async () => { - try { - const staleMonitorsList = Object.values(this.staleMonitorsMap).filter( - (monitor) => monitor.stale === true - ); - - const encryptedMonitors = await this.savedObjectsClient.bulkGet<SyntheticsMonitor>( - staleMonitorsList.map((staleMonitor) => ({ - id: staleMonitor.savedObjectId, - type: syntheticsMonitorType, - })) - ); - - let monitors = encryptedMonitors.saved_objects; - - const hasPrivateMonitor = monitors.some((monitor) => - monitor.attributes.locations.some((location) => !location.isServiceManaged) - ); - - if (hasPrivateMonitor) { - const { - integrations: { writeIntegrationPolicies }, - } = await this.server.fleet.authz.fromRequest(this.request); - if (!writeIntegrationPolicies) { - monitors = monitors.filter((monitor) => { - const hasPrivateLocation = monitor.attributes.locations.some( - (location) => !location.isServiceManaged - ); - if (hasPrivateLocation) { - const journeyId = (monitor.attributes as MonitorFields)[ConfigKey.JOURNEY_ID]!; - const monitorName = (monitor.attributes as MonitorFields)[ConfigKey.NAME]!; - this.handleStreamingMessage({ - message: `Monitor ${journeyId} could not be deleted`, - }); - this.failedStaleMonitors.push({ - id: journeyId, - reason: 'Failed to delete stale monitor', - details: `Unable to delete Synthetics package policy for monitor ${monitorName}. Fleet write permissions are needed to use Synthetics private locations.`, - }); - } - return !hasPrivateLocation; - }); - } - } - - const chunkSize = 100; - for (let i = 0; i < monitors.length; i += chunkSize) { - const chunkMonitors = monitors.slice(i, i + chunkSize); - try { - if (!this.keepStale) { - await deleteMonitorBulk({ - monitors: chunkMonitors, - savedObjectsClient: this.savedObjectsClient, - server: this.server, - syntheticsMonitorClient: this.syntheticsMonitorClient, - request: this.request, - }); - - for (const sm of chunkMonitors) { - const journeyId = (sm.attributes as MonitorFields)[ConfigKey.JOURNEY_ID]!; - - this.deletedMonitors.push(journeyId); - this.handleStreamingMessage({ - message: `Monitor ${journeyId} deleted successfully`, - }); - } - } else { - chunkMonitors.forEach((sm) => { - const journeyId = (sm.attributes as MonitorFields)[ConfigKey.JOURNEY_ID]!; - this.staleMonitors.push(journeyId); - }); - } - } catch (e) { - chunkMonitors.forEach((sm) => { - const journeyId = (sm.attributes as MonitorFields)[ConfigKey.JOURNEY_ID]!; - - this.handleStreamingMessage({ - message: `Monitor ${journeyId} could not be deleted`, - }); - this.failedStaleMonitors.push({ - id: journeyId, - reason: 'Failed to delete stale monitor', - details: e.message, - payload: staleMonitorsList.find( - (staleMonitor) => staleMonitor.savedObjectId === sm.id - ), - }); - }); - this.server.logger.error(e); - } - } - } catch (e) { - this.server.logger.error(e); - } - }; - - private handleStreamingMessage = ({ message }: { message: string }) => { - if (this.subject) { - this.subject?.next(message); - } - }; - private validateMonitor = ({ validationResult, monitorId, @@ -531,9 +395,6 @@ export class ProjectMonitorFormatter { details, payload: validationPayload, }); - if (this.staleMonitorsMap[monitorId]) { - this.staleMonitorsMap[monitorId].stale = false; - } } return validationResult; }; diff --git a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter_legacy.test.ts b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter_legacy.test.ts new file mode 100644 index 0000000000000..14df60edfc4e2 --- /dev/null +++ b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter_legacy.test.ts @@ -0,0 +1,653 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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'; +import { savedObjectsClientMock } from '@kbn/core/server/mocks'; +import { + INSUFFICIENT_FLEET_PERMISSIONS, + ProjectMonitorFormatterLegacy, +} from './project_monitor_formatter_legacy'; +import { ConfigKey, DataStream, LocationStatus } from '../../../common/runtime_types'; +import { DEFAULT_FIELDS } from '../../../common/constants/monitor_defaults'; +import { times } from 'lodash'; +import { SyntheticsService } from '../synthetics_service'; +import { UptimeServerSetup } from '../../legacy_uptime/lib/adapters'; +import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; +import { SyntheticsMonitorClient } from '../synthetics_monitor/synthetics_monitor_client'; +import { httpServerMock } from '@kbn/core-http-server-mocks'; +import { Subject } from 'rxjs'; +import { formatSecrets } from '../utils'; + +import * as telemetryHooks from '../../routes/telemetry/monitor_upgrade_sender'; + +const testMonitors = [ + { + type: 'browser', + throttling: { download: 5, upload: 3, latency: 20 }, + schedule: 3, + locations: [], + privateLocations: ['Test private location'], + params: { url: 'http://localhost:8080' }, + playwrightOptions: { + userAgent: + 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', + viewport: { width: 375, height: 667 }, + deviceScaleFactor: 2, + isMobile: true, + hasTouch: true, + headless: true, + }, + name: 'check if title is present 10 0', + id: 'check if title is present 10 0', + tags: [], + content: + 'UEsDBBQACAAIAAAAIQAAAAAAAAAAAAAAAAAQAAAAYmFzaWMuam91cm5leS50c2WQQU7DQAxF9znFV8QiUUOmXcCCUMQl2NdMnWbKJDMaO6Ilyt0JASQkNv9Z1teTZWNAIqwP5kU4iZGOug863u7uDXsSddbIddCOl0kMX6iPnsVoOAYxryTO1ucwpoGvtUrm+hiSYsLProIoxwp8iWwVM9oUeuTP/9V5k7UhofCscNhj2yx4xN2CzabElOHXWRxsx/YNroU69QwniImFB8Vui5vJzYcKxYRIJ66WTNQL5hL7p1WD9aYi9zQOtgPFGPNqecJ1sCj+tAB6J6erpj4FDcW3qh6TL5u1Mq/8yjn7BFBLBwhGDIWc4QAAAEkBAABQSwECLQMUAAgACAAAACEARgyFnOEAAABJAQAAEAAAAAAAAAAAACAApIEAAAAAYmFzaWMuam91cm5leS50c1BLBQYAAAAAAQABAD4AAAAfAQAAAAA=', + filter: { match: 'check if title is present 10 0' }, + hash: 'lleklrkelkj', + }, + { + type: 'browser', + throttling: { download: 5, upload: 3, latency: 20 }, + schedule: 3, + locations: [], + privateLocations: ['Test private location'], + params: { url: 'http://localhost:8080' }, + playwrightOptions: { + userAgent: + 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', + viewport: { width: 375, height: 667 }, + deviceScaleFactor: 2, + isMobile: true, + hasTouch: true, + headless: true, + }, + name: 'check if title is present 10 1', + id: 'check if title is present 10 1', + tags: [], + content: + 'UEsDBBQACAAIAAAAIQAAAAAAAAAAAAAAAAAQAAAAYmFzaWMuam91cm5leS50c2WQQU7DQAxF9znFV8QiUUOmXcCCUMQl2NdMnWbKJDMaO6Ilyt0JASQkNv9Z1teTZWNAIqwP5kU4iZGOug863u7uDXsSddbIddCOl0kMX6iPnsVoOAYxryTO1ucwpoGvtUrm+hiSYsLProIoxwp8iWwVM9oUeuTP/9V5k7UhofCscNhj2yx4xN2CzabElOHXWRxsx/YNroU69QwniImFB8Vui5vJzYcKxYRIJ66WTNQL5hL7p1WD9aYi9zQOtgPFGPNqecJ1sCj+tAB6J6erpj4FDcW3qh6TL5u1Mq/8yjn7BFBLBwhGDIWc4QAAAEkBAABQSwECLQMUAAgACAAAACEARgyFnOEAAABJAQAAEAAAAAAAAAAAACAApIEAAAAAYmFzaWMuam91cm5leS50c1BLBQYAAAAAAQABAD4AAAAfAQAAAAA=', + filter: { match: 'check if title is present 10 1' }, + hash: 'lleklrkelkj', + }, +]; + +const privateLocations = times(1).map((n) => { + return { + id: `loc-${n}`, + label: 'Test private location', + geo: { + lat: 0, + lon: 0, + }, + isServiceManaged: false, + agentPolicyId: `loc-${n}`, + concurrentMonitors: 1, + }; +}); + +describe('ProjectMonitorFormatterLegacy', () => { + const mockEsClient = { + search: jest.fn(), + }; + const logger = loggerMock.create(); + + const kibanaRequest = httpServerMock.createKibanaRequest(); + + const soClient = savedObjectsClientMock.create(); + + const serverMock: UptimeServerSetup = { + logger, + uptimeEsClient: mockEsClient, + authSavedObjectsClient: soClient, + config: { + service: { + username: 'dev', + password: '12345', + manifestUrl: 'http://localhost:8080/api/manifest', + }, + }, + spaces: { + spacesService: { + getSpaceId: jest.fn().mockReturnValue('test-space'), + }, + }, + } as unknown as UptimeServerSetup; + + const syntheticsService = new SyntheticsService(serverMock); + + syntheticsService.addConfig = jest.fn(); + syntheticsService.editConfig = jest.fn(); + syntheticsService.deleteConfigs = jest.fn(); + + const encryptedSavedObjectsClient = encryptedSavedObjectsMock.createStart().getClient(); + + const locations = times(3).map((n) => { + return { + id: `loc-${n}`, + label: `Location ${n}`, + url: `https://example.com/${n}`, + geo: { + lat: 0, + lon: 0, + }, + isServiceManaged: true, + status: LocationStatus.GA, + }; + }); + + const monitorClient = new SyntheticsMonitorClient(syntheticsService, serverMock); + + it('should return errors', async () => { + const testSubject = new Subject(); + + testSubject.next = jest.fn(); + + const pushMonitorFormatter = new ProjectMonitorFormatterLegacy({ + projectId: 'test-project', + spaceId: 'default-space', + keepStale: false, + locations, + privateLocations, + encryptedSavedObjectsClient, + savedObjectsClient: soClient, + monitors: testMonitors, + server: serverMock, + syntheticsMonitorClient: monitorClient, + request: kibanaRequest, + subject: testSubject, + }); + + pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); + + await pushMonitorFormatter.configureAllProjectMonitors(); + + expect(testSubject.next).toHaveBeenNthCalledWith( + 1, + 'check if title is present 10 0: failed to create or update monitor' + ); + expect(testSubject.next).toHaveBeenNthCalledWith( + 2, + 'check if title is present 10 1: failed to create or update monitor' + ); + + expect({ + createdMonitors: pushMonitorFormatter.createdMonitors, + updatedMonitors: pushMonitorFormatter.updatedMonitors, + staleMonitors: pushMonitorFormatter.staleMonitors, + deletedMonitors: pushMonitorFormatter.deletedMonitors, + failedMonitors: pushMonitorFormatter.failedMonitors, + failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, + }).toStrictEqual({ + createdMonitors: [], + deletedMonitors: [], + failedMonitors: [ + { + details: "Cannot read properties of undefined (reading 'authz')", + id: 'check if title is present 10 0', + payload: testMonitors[0], + reason: 'Failed to create or update monitor', + }, + { + details: "Cannot read properties of undefined (reading 'authz')", + id: 'check if title is present 10 1', + payload: testMonitors[1], + reason: 'Failed to create or update monitor', + }, + ], + failedStaleMonitors: [], + staleMonitors: [], + updatedMonitors: [], + }); + }); + + it('throws fleet permission error', async () => { + const testSubject = new Subject(); + + serverMock.fleet = { + authz: { + fromRequest: jest + .fn() + .mockResolvedValue({ integrations: { writeIntegrationPolicies: false } }), + }, + } as any; + + const pushMonitorFormatter = new ProjectMonitorFormatterLegacy({ + projectId: 'test-project', + spaceId: 'default-space', + keepStale: false, + locations, + privateLocations, + encryptedSavedObjectsClient, + savedObjectsClient: soClient, + monitors: testMonitors, + server: serverMock, + syntheticsMonitorClient: monitorClient, + request: kibanaRequest, + subject: testSubject, + }); + + pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); + + await pushMonitorFormatter.configureAllProjectMonitors(); + + expect({ + createdMonitors: pushMonitorFormatter.createdMonitors, + updatedMonitors: pushMonitorFormatter.updatedMonitors, + staleMonitors: pushMonitorFormatter.staleMonitors, + deletedMonitors: pushMonitorFormatter.deletedMonitors, + failedMonitors: pushMonitorFormatter.failedMonitors, + failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, + }).toStrictEqual({ + createdMonitors: [], + deletedMonitors: [], + failedMonitors: [ + { + details: INSUFFICIENT_FLEET_PERMISSIONS, + id: 'check if title is present 10 0', + payload: testMonitors[0], + reason: 'Failed to create or update monitor', + }, + { + details: INSUFFICIENT_FLEET_PERMISSIONS, + id: 'check if title is present 10 1', + payload: testMonitors[1], + reason: 'Failed to create or update monitor', + }, + ], + failedStaleMonitors: [], + staleMonitors: [], + updatedMonitors: [], + }); + }); + + it('catches errors from bulk edit method', async () => { + const testSubject = new Subject(); + + serverMock.fleet = { + authz: { + fromRequest: jest + .fn() + .mockResolvedValue({ integrations: { writeIntegrationPolicies: true } }), + }, + } as any; + + const pushMonitorFormatter = new ProjectMonitorFormatterLegacy({ + projectId: 'test-project', + spaceId: 'default-space', + keepStale: false, + locations, + privateLocations, + encryptedSavedObjectsClient, + savedObjectsClient: soClient, + monitors: testMonitors, + server: serverMock, + syntheticsMonitorClient: monitorClient, + request: kibanaRequest, + subject: testSubject, + }); + + pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); + + await pushMonitorFormatter.configureAllProjectMonitors(); + + expect({ + createdMonitors: pushMonitorFormatter.createdMonitors, + updatedMonitors: pushMonitorFormatter.updatedMonitors, + staleMonitors: pushMonitorFormatter.staleMonitors, + deletedMonitors: pushMonitorFormatter.deletedMonitors, + failedMonitors: pushMonitorFormatter.failedMonitors, + failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, + }).toEqual({ + createdMonitors: [], + updatedMonitors: [], + staleMonitors: [], + deletedMonitors: [], + failedMonitors: [ + { + details: "Cannot read properties of undefined (reading 'buildPackagePolicyFromPackage')", + payload: payloadData, + reason: 'Failed to create 2 monitors', + }, + ], + failedStaleMonitors: [], + }); + }); + + it('configures project monitors when there are errors', async () => { + const testSubject = new Subject(); + + serverMock.fleet = { + authz: { + fromRequest: jest + .fn() + .mockResolvedValue({ integrations: { writeIntegrationPolicies: true } }), + }, + } as any; + + soClient.bulkCreate = jest.fn().mockResolvedValue({ saved_objects: [] }); + + const pushMonitorFormatter = new ProjectMonitorFormatterLegacy({ + projectId: 'test-project', + spaceId: 'default-space', + keepStale: false, + locations, + privateLocations, + encryptedSavedObjectsClient, + savedObjectsClient: soClient, + monitors: testMonitors, + server: serverMock, + syntheticsMonitorClient: monitorClient, + request: kibanaRequest, + subject: testSubject, + }); + + pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); + + await pushMonitorFormatter.configureAllProjectMonitors(); + + expect({ + createdMonitors: pushMonitorFormatter.createdMonitors, + updatedMonitors: pushMonitorFormatter.updatedMonitors, + staleMonitors: pushMonitorFormatter.staleMonitors, + deletedMonitors: pushMonitorFormatter.deletedMonitors, + failedMonitors: pushMonitorFormatter.failedMonitors, + failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, + }).toEqual({ + createdMonitors: [], + updatedMonitors: [], + staleMonitors: [], + deletedMonitors: [], + failedMonitors: [ + { + details: "Cannot read properties of undefined (reading 'buildPackagePolicyFromPackage')", + payload: payloadData, + reason: 'Failed to create 2 monitors', + }, + ], + failedStaleMonitors: [], + }); + }); + + it('shows errors thrown by fleet api', async () => { + const testSubject = new Subject(); + + serverMock.fleet = { + authz: { + fromRequest: jest + .fn() + .mockResolvedValue({ integrations: { writeIntegrationPolicies: true } }), + }, + packagePolicyService: {}, + } as any; + + soClient.bulkCreate = jest.fn().mockResolvedValue({ saved_objects: soResult }); + + const pushMonitorFormatter = new ProjectMonitorFormatterLegacy({ + projectId: 'test-project', + spaceId: 'default-space', + keepStale: false, + locations, + privateLocations, + encryptedSavedObjectsClient, + savedObjectsClient: soClient, + monitors: testMonitors, + server: serverMock, + syntheticsMonitorClient: monitorClient, + request: kibanaRequest, + subject: testSubject, + }); + + pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); + + await pushMonitorFormatter.configureAllProjectMonitors(); + + expect({ + createdMonitors: pushMonitorFormatter.createdMonitors, + updatedMonitors: pushMonitorFormatter.updatedMonitors, + staleMonitors: pushMonitorFormatter.staleMonitors, + deletedMonitors: pushMonitorFormatter.deletedMonitors, + failedMonitors: pushMonitorFormatter.failedMonitors, + failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, + }).toEqual({ + createdMonitors: [], + updatedMonitors: [], + staleMonitors: [], + deletedMonitors: [], + failedMonitors: [ + { + details: + 'this.server.fleet.packagePolicyService.buildPackagePolicyFromPackage is not a function', + reason: 'Failed to create 2 monitors', + payload: payloadData, + }, + ], + failedStaleMonitors: [], + }); + }); + + it('creates project monitors when no errors', async () => { + const testSubject = new Subject(); + + serverMock.fleet = { + authz: { + fromRequest: jest + .fn() + .mockResolvedValue({ integrations: { writeIntegrationPolicies: true } }), + }, + } as any; + + soClient.bulkCreate = jest.fn().mockResolvedValue({ saved_objects: soResult }); + + monitorClient.addMonitors = jest.fn().mockReturnValue({}); + + const telemetrySpy = jest + .spyOn(telemetryHooks, 'sendTelemetryEvents') + .mockImplementation(jest.fn()); + + const pushMonitorFormatter = new ProjectMonitorFormatterLegacy({ + projectId: 'test-project', + spaceId: 'default-space', + keepStale: false, + locations, + privateLocations, + encryptedSavedObjectsClient, + savedObjectsClient: soClient, + monitors: testMonitors, + server: serverMock, + syntheticsMonitorClient: monitorClient, + request: kibanaRequest, + subject: testSubject, + }); + + pushMonitorFormatter.getProjectMonitorsForProject = jest.fn().mockResolvedValue([]); + + await pushMonitorFormatter.configureAllProjectMonitors(); + + expect(soClient.bulkCreate).toHaveBeenCalledWith( + expect.arrayContaining([ + expect.objectContaining({ + ...soData[0], + attributes: { + ...soData[0].attributes, + [ConfigKey.MONITOR_QUERY_ID]: expect.any(String), + [ConfigKey.CONFIG_ID]: expect.any(String), + }, + }), + expect.objectContaining({ + ...soData[1], + attributes: { + ...soData[1].attributes, + [ConfigKey.MONITOR_QUERY_ID]: expect.any(String), + [ConfigKey.CONFIG_ID]: expect.any(String), + }, + }), + ]) + ); + + expect(telemetrySpy).toHaveBeenCalledTimes(2); + + expect({ + createdMonitors: pushMonitorFormatter.createdMonitors, + updatedMonitors: pushMonitorFormatter.updatedMonitors, + staleMonitors: pushMonitorFormatter.staleMonitors, + deletedMonitors: pushMonitorFormatter.deletedMonitors, + failedMonitors: pushMonitorFormatter.failedMonitors, + failedStaleMonitors: pushMonitorFormatter.failedStaleMonitors, + }).toEqual({ + createdMonitors: ['check if title is present 10 0', 'check if title is present 10 1'], + updatedMonitors: [], + staleMonitors: [], + deletedMonitors: [], + failedMonitors: [], + failedStaleMonitors: [], + }); + }); +}); + +const payloadData = [ + { + ...DEFAULT_FIELDS[DataStream.BROWSER], + __ui: { + is_zip_url_tls_enabled: false, + script_source: { + file_name: '', + is_generated_script: false, + }, + }, + config_id: '', + custom_heartbeat_id: 'check if title is present 10 0-test-project-default-space', + enabled: true, + 'filter_journeys.match': 'check if title is present 10 0', + 'filter_journeys.tags': [], + form_monitor_type: 'multistep', + ignore_https_errors: false, + journey_id: 'check if title is present 10 0', + locations: privateLocations, + name: 'check if title is present 10 0', + namespace: 'default_space', + origin: 'project', + original_space: 'default-space', + params: '{"url":"http://localhost:8080"}', + playwright_options: + '{"userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1","viewport":{"width":375,"height":667},"deviceScaleFactor":2,"isMobile":true,"hasTouch":true,"headless":true}', + playwright_text_assertion: '', + project_id: 'test-project', + schedule: { + number: '3', + unit: 'm', + }, + screenshots: 'on', + 'service.name': '', + 'source.inline.script': '', + 'source.project.content': + 'UEsDBBQACAAIAAAAIQAAAAAAAAAAAAAAAAAQAAAAYmFzaWMuam91cm5leS50c2WQQU7DQAxF9znFV8QiUUOmXcCCUMQl2NdMnWbKJDMaO6Ilyt0JASQkNv9Z1teTZWNAIqwP5kU4iZGOug863u7uDXsSddbIddCOl0kMX6iPnsVoOAYxryTO1ucwpoGvtUrm+hiSYsLProIoxwp8iWwVM9oUeuTP/9V5k7UhofCscNhj2yx4xN2CzabElOHXWRxsx/YNroU69QwniImFB8Vui5vJzYcKxYRIJ66WTNQL5hL7p1WD9aYi9zQOtgPFGPNqecJ1sCj+tAB6J6erpj4FDcW3qh6TL5u1Mq/8yjn7BFBLBwhGDIWc4QAAAEkBAABQSwECLQMUAAgACAAAACEARgyFnOEAAABJAQAAEAAAAAAAAAAAACAApIEAAAAAYmFzaWMuam91cm5leS50c1BLBQYAAAAAAQABAD4AAAAfAQAAAAA=', + 'source.zip_url.folder': '', + 'source.zip_url.password': '', + 'source.zip_url.proxy_url': '', + 'source.zip_url.url': '', + 'source.zip_url.ssl.certificate': undefined, + 'source.zip_url.username': '', + 'ssl.certificate': '', + 'ssl.certificate_authorities': '', + 'ssl.key': '', + 'ssl.key_passphrase': '', + 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], + 'ssl.verification_mode': 'full', + synthetics_args: [], + tags: [], + 'throttling.config': '5d/3u/20l', + 'throttling.download_speed': '5', + 'throttling.is_enabled': true, + 'throttling.latency': '20', + 'throttling.upload_speed': '3', + timeout: null, + type: 'browser', + 'url.port': null, + urls: '', + id: '', + hash: 'lleklrkelkj', + }, + { + ...DEFAULT_FIELDS[DataStream.BROWSER], + __ui: { + is_zip_url_tls_enabled: false, + script_source: { + file_name: '', + is_generated_script: false, + }, + }, + config_id: '', + custom_heartbeat_id: 'check if title is present 10 1-test-project-default-space', + enabled: true, + 'filter_journeys.match': 'check if title is present 10 1', + 'filter_journeys.tags': [], + form_monitor_type: 'multistep', + ignore_https_errors: false, + journey_id: 'check if title is present 10 1', + locations: privateLocations, + name: 'check if title is present 10 1', + namespace: 'default_space', + origin: 'project', + original_space: 'default-space', + params: '{"url":"http://localhost:8080"}', + playwright_options: + '{"userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1","viewport":{"width":375,"height":667},"deviceScaleFactor":2,"isMobile":true,"hasTouch":true,"headless":true}', + playwright_text_assertion: '', + project_id: 'test-project', + schedule: { + number: '3', + unit: 'm', + }, + screenshots: 'on', + 'service.name': '', + 'source.inline.script': '', + 'source.project.content': + 'UEsDBBQACAAIAAAAIQAAAAAAAAAAAAAAAAAQAAAAYmFzaWMuam91cm5leS50c2WQQU7DQAxF9znFV8QiUUOmXcCCUMQl2NdMnWbKJDMaO6Ilyt0JASQkNv9Z1teTZWNAIqwP5kU4iZGOug863u7uDXsSddbIddCOl0kMX6iPnsVoOAYxryTO1ucwpoGvtUrm+hiSYsLProIoxwp8iWwVM9oUeuTP/9V5k7UhofCscNhj2yx4xN2CzabElOHXWRxsx/YNroU69QwniImFB8Vui5vJzYcKxYRIJ66WTNQL5hL7p1WD9aYi9zQOtgPFGPNqecJ1sCj+tAB6J6erpj4FDcW3qh6TL5u1Mq/8yjn7BFBLBwhGDIWc4QAAAEkBAABQSwECLQMUAAgACAAAACEARgyFnOEAAABJAQAAEAAAAAAAAAAAACAApIEAAAAAYmFzaWMuam91cm5leS50c1BLBQYAAAAAAQABAD4AAAAfAQAAAAA=', + 'source.zip_url.folder': '', + 'source.zip_url.password': '', + 'source.zip_url.proxy_url': '', + 'source.zip_url.url': '', + 'source.zip_url.username': '', + 'ssl.certificate': '', + 'ssl.certificate_authorities': '', + 'ssl.key': '', + 'ssl.key_passphrase': '', + 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], + 'ssl.verification_mode': 'full', + synthetics_args: [], + tags: [], + 'throttling.config': '5d/3u/20l', + 'throttling.download_speed': '5', + 'throttling.is_enabled': true, + 'throttling.latency': '20', + 'throttling.upload_speed': '3', + timeout: null, + type: 'browser', + 'url.port': null, + urls: '', + id: '', + hash: 'lleklrkelkj', + }, +]; + +const soData = [ + { + attributes: formatSecrets({ + ...payloadData[0], + revision: 1, + } as any), + type: 'synthetics-monitor', + }, + { + attributes: formatSecrets({ + ...payloadData[1], + revision: 1, + } as any), + type: 'synthetics-monitor', + }, +]; + +const soResult = soData.map((so) => ({ id: 'test-id', ...so })); diff --git a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter_legacy.ts b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter_legacy.ts new file mode 100644 index 0000000000000..82b29fe069c06 --- /dev/null +++ b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter_legacy.ts @@ -0,0 +1,534 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { Subject } from 'rxjs'; +import { omit, isEqual } from 'lodash'; +import { KibanaRequest } from '@kbn/core/server'; +import { + SavedObjectsUpdateResponse, + SavedObjectsClientContract, + SavedObjectsFindResult, +} from '@kbn/core/server'; +import pMap from 'p-map'; +import { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; +import { syncNewMonitorBulk } from '../../routes/monitor_cruds/bulk_cruds/add_monitor_bulk'; +import { deleteMonitorBulk } from '../../routes/monitor_cruds/bulk_cruds/delete_monitor_bulk'; +import { SyntheticsMonitorClient } from '../synthetics_monitor/synthetics_monitor_client'; +import { syncEditedMonitorBulk } from '../../routes/monitor_cruds/bulk_cruds/edit_monitor_bulk'; +import { + ConfigKey, + SyntheticsMonitorWithSecrets, + EncryptedSyntheticsMonitor, + ServiceLocationErrors, + ProjectMonitor, + Locations, + SyntheticsMonitor, + MonitorFields, + PrivateLocation, +} from '../../../common/runtime_types'; +import { syntheticsMonitorType } from '../../legacy_uptime/lib/saved_objects/synthetics_monitor'; +import type { UptimeServerSetup } from '../../legacy_uptime/lib/adapters'; +import { formatSecrets, normalizeSecrets } from '../utils/secrets'; +import { + validateProjectMonitor, + validateMonitor, + ValidationResult, +} from '../../routes/monitor_cruds/monitor_validation'; +import { normalizeProjectMonitor } from './normalizers'; + +interface StaleMonitor { + stale: boolean; + journeyId: string; + savedObjectId: string; +} +type StaleMonitorMap = Record<string, StaleMonitor>; +type FailedError = Array<{ id?: string; reason: string; details: string; payload?: object }>; + +export const INSUFFICIENT_FLEET_PERMISSIONS = + 'Insufficient permissions. In order to configure private locations, you must have Fleet and Integrations write permissions. To resolve, please generate a new API key with a user who has Fleet and Integrations write permissions.'; + +export class ProjectMonitorFormatterLegacy { + private projectId: string; + private spaceId: string; + private keepStale: boolean; + private locations: Locations; + private privateLocations: PrivateLocation[]; + private savedObjectsClient: SavedObjectsClientContract; + private encryptedSavedObjectsClient: EncryptedSavedObjectsClient; + private staleMonitorsMap: StaleMonitorMap = {}; + private monitors: ProjectMonitor[] = []; + public createdMonitors: string[] = []; + public deletedMonitors: string[] = []; + public updatedMonitors: string[] = []; + public staleMonitors: string[] = []; + public failedMonitors: FailedError = []; + public failedStaleMonitors: FailedError = []; + private server: UptimeServerSetup; + private projectFilter: string; + private syntheticsMonitorClient: SyntheticsMonitorClient; + private request: KibanaRequest; + private subject?: Subject<unknown>; + + private writeIntegrationPoliciesPermissions?: boolean; + + constructor({ + locations, + privateLocations, + keepStale, + savedObjectsClient, + encryptedSavedObjectsClient, + projectId, + spaceId, + monitors, + server, + syntheticsMonitorClient, + request, + subject, + }: { + locations: Locations; + privateLocations: PrivateLocation[]; + keepStale: boolean; + savedObjectsClient: SavedObjectsClientContract; + encryptedSavedObjectsClient: EncryptedSavedObjectsClient; + projectId: string; + spaceId: string; + monitors: ProjectMonitor[]; + server: UptimeServerSetup; + syntheticsMonitorClient: SyntheticsMonitorClient; + request: KibanaRequest; + subject?: Subject<unknown>; + }) { + this.projectId = projectId; + this.spaceId = spaceId; + this.locations = locations; + this.privateLocations = privateLocations; + this.keepStale = keepStale; + this.savedObjectsClient = savedObjectsClient; + this.encryptedSavedObjectsClient = encryptedSavedObjectsClient; + this.syntheticsMonitorClient = syntheticsMonitorClient; + this.monitors = monitors; + this.server = server; + this.projectFilter = `${syntheticsMonitorType}.attributes.${ConfigKey.PROJECT_ID}: "${this.projectId}"`; + this.request = request; + this.subject = subject; + } + + public configureAllProjectMonitors = async () => { + const existingMonitors = await this.getProjectMonitorsForProject(); + this.staleMonitorsMap = await this.getStaleMonitorsMap(existingMonitors); + + const normalizedNewMonitors: SyntheticsMonitor[] = []; + const normalizedUpdateMonitors: Array<{ + previousMonitor: SavedObjectsFindResult<EncryptedSyntheticsMonitor>; + monitor: SyntheticsMonitor; + }> = []; + + for (const monitor of this.monitors) { + const previousMonitor = existingMonitors.find( + (monitorObj) => + (monitorObj.attributes as SyntheticsMonitor)[ConfigKey.JOURNEY_ID] === monitor.id + ); + + const normM = await this.validateProjectMonitor({ + monitor, + }); + if (normM) { + if (previousMonitor) { + this.updatedMonitors.push(monitor.id); + if (this.staleMonitorsMap[monitor.id]) { + this.staleMonitorsMap[monitor.id].stale = false; + } + normalizedUpdateMonitors.push({ monitor: normM as MonitorFields, previousMonitor }); + } else { + normalizedNewMonitors.push(normM as MonitorFields); + } + } + } + + await this.createMonitorsBulk(normalizedNewMonitors); + + const { updatedCount } = await this.updateMonitorsBulk(normalizedUpdateMonitors); + + if (normalizedUpdateMonitors.length > 0) { + let updateMessage = ''; + if (updatedCount > 0) { + updateMessage = `${updatedCount} monitor${ + updatedCount > 1 ? 's' : '' + } updated successfully.`; + } + + const noChanges = normalizedUpdateMonitors.length - updatedCount; + let noChangeMessage = ''; + if (noChanges > 0) { + noChangeMessage = `${noChanges} monitor${noChanges > 1 ? 's' : ''} found with no changes.`; + } + + this.handleStreamingMessage({ + message: `${updateMessage} ${noChangeMessage}`, + }); + } + + await this.handleStaleMonitors(); + }; + + validatePermissions = async ({ monitor }: { monitor: ProjectMonitor }) => { + if (this.writeIntegrationPoliciesPermissions || (monitor.privateLocations ?? []).length === 0) { + return; + } + const { + integrations: { writeIntegrationPolicies }, + } = await this.server.fleet.authz.fromRequest(this.request); + + this.writeIntegrationPoliciesPermissions = writeIntegrationPolicies; + + if (!writeIntegrationPolicies) { + throw new Error(INSUFFICIENT_FLEET_PERMISSIONS); + } + }; + + validateProjectMonitor = async ({ monitor }: { monitor: ProjectMonitor }) => { + try { + await this.validatePermissions({ monitor }); + + const { normalizedFields: normalizedMonitor, errors } = normalizeProjectMonitor({ + monitor, + locations: this.locations, + privateLocations: this.privateLocations, + projectId: this.projectId, + namespace: this.spaceId, + version: this.server.stackVersion, + }); + + if (errors.length) { + this.failedMonitors.push(...errors); + this.handleStreamingMessage({ + message: `${monitor.id}: failed to create or update monitor`, + }); + return null; + } + + /* Validates that the payload sent from the synthetics agent is valid */ + const { valid: isMonitorPayloadValid } = this.validateMonitor({ + validationResult: validateProjectMonitor({ + ...monitor, + type: normalizedMonitor[ConfigKey.MONITOR_TYPE], + }), + monitorId: monitor.id, + }); + + if (!isMonitorPayloadValid) { + return null; + } + + /* Validates that the normalized monitor is a valid monitor saved object type */ + const { valid: isNormalizedMonitorValid, decodedMonitor } = this.validateMonitor({ + validationResult: validateMonitor(normalizedMonitor as MonitorFields), + monitorId: monitor.id, + }); + + if (!isNormalizedMonitorValid || !decodedMonitor) { + return null; + } + + return decodedMonitor; + } catch (e) { + this.server.logger.error(e); + this.failedMonitors.push({ + id: monitor.id, + reason: 'Failed to create or update monitor', + details: e.message, + payload: monitor, + }); + this.handleStreamingMessage({ message: `${monitor.id}: failed to create or update monitor` }); + if (this.staleMonitorsMap[monitor.id]) { + this.staleMonitorsMap[monitor.id].stale = false; + } + } + }; + + private getStaleMonitorsMap = async ( + existingMonitors: Array<SavedObjectsFindResult<EncryptedSyntheticsMonitor>> + ): Promise<StaleMonitorMap> => { + const staleMonitors: StaleMonitorMap = {}; + + existingMonitors.forEach((savedObject) => { + const journeyId = (savedObject.attributes as SyntheticsMonitor)[ConfigKey.JOURNEY_ID]; + if (journeyId) { + staleMonitors[journeyId] = { + stale: true, + savedObjectId: savedObject.id, + journeyId, + }; + } + }); + + return staleMonitors; + }; + + public getProjectMonitorsForProject = async () => { + const finder = this.savedObjectsClient.createPointInTimeFinder({ + type: syntheticsMonitorType, + perPage: 1000, + filter: this.projectFilter, + }); + + const hits: Array<SavedObjectsFindResult<EncryptedSyntheticsMonitor>> = []; + for await (const result of finder.find()) { + hits.push( + ...(result.saved_objects as Array<SavedObjectsFindResult<EncryptedSyntheticsMonitor>>) + ); + } + + await finder.close(); + + return hits; + }; + + private createMonitorsBulk = async (monitors: SyntheticsMonitor[]) => { + try { + if (monitors.length > 0) { + const { newMonitors } = await syncNewMonitorBulk({ + normalizedMonitors: monitors, + server: this.server, + syntheticsMonitorClient: this.syntheticsMonitorClient, + soClient: this.savedObjectsClient, + request: this.request, + privateLocations: this.privateLocations, + spaceId: this.spaceId, + }); + + if (newMonitors && newMonitors.length === monitors.length) { + this.createdMonitors.push(...monitors.map((monitor) => monitor[ConfigKey.JOURNEY_ID]!)); + this.handleStreamingMessage({ + message: `${monitors.length} monitor${ + monitors.length > 1 ? 's' : '' + } created successfully.`, + }); + } else { + this.failedMonitors.push({ + reason: `Failed to create ${monitors.length} monitors`, + details: 'Failed to create monitors', + payload: monitors, + }); + this.handleStreamingMessage({ + message: `Failed to create ${monitors.length} monitors`, + }); + } + } + } catch (e) { + this.server.logger.error(e); + this.failedMonitors.push({ + reason: `Failed to create ${monitors.length} monitors`, + details: e.message, + payload: monitors, + }); + this.handleStreamingMessage({ + message: `Failed to create ${monitors.length} monitors`, + }); + } + }; + + private getDecryptedMonitors = async ( + monitors: Array<SavedObjectsFindResult<EncryptedSyntheticsMonitor>> + ) => { + return await pMap( + monitors, + async (monitor) => + this.encryptedSavedObjectsClient.getDecryptedAsInternalUser<SyntheticsMonitorWithSecrets>( + syntheticsMonitorType, + monitor.id, + { + namespace: monitor.namespaces?.[0], + } + ), + { concurrency: 500 } + ); + }; + + private updateMonitorsBulk = async ( + monitors: Array<{ + monitor: SyntheticsMonitor; + previousMonitor: SavedObjectsFindResult<EncryptedSyntheticsMonitor>; + }> + ): Promise<{ + editedMonitors: Array<SavedObjectsUpdateResponse<EncryptedSyntheticsMonitor>>; + errors: ServiceLocationErrors; + updatedCount: number; + }> => { + const decryptedPreviousMonitors = await this.getDecryptedMonitors( + monitors.map((m) => m.previousMonitor) + ); + + const monitorsToUpdate = []; + + for (let i = 0; i < decryptedPreviousMonitors.length; i++) { + const decryptedPreviousMonitor = decryptedPreviousMonitors[i]; + const previousMonitor = monitors[i].previousMonitor; + const normalizedMonitor = monitors[i].monitor; + + const keysToOmit = [ConfigKey.REVISION, ConfigKey.MONITOR_QUERY_ID, ConfigKey.CONFIG_ID]; + const { attributes: normalizedPreviousMonitorAttributes } = + normalizeSecrets(decryptedPreviousMonitor); + const hasMonitorBeenEdited = !isEqual( + omit(normalizedMonitor, keysToOmit), + omit(normalizedPreviousMonitorAttributes, keysToOmit) + ); + + if (hasMonitorBeenEdited) { + const monitorWithRevision = formatSecrets({ + ...normalizedPreviousMonitorAttributes, + ...normalizedMonitor, + revision: (previousMonitor.attributes[ConfigKey.REVISION] || 0) + 1, + }); + monitorsToUpdate.push({ + normalizedMonitor, + previousMonitor, + monitorWithRevision, + decryptedPreviousMonitor, + }); + } + } + + const { editedMonitors } = await syncEditedMonitorBulk({ + monitorsToUpdate, + server: this.server, + syntheticsMonitorClient: this.syntheticsMonitorClient, + savedObjectsClient: this.savedObjectsClient, + request: this.request, + privateLocations: this.privateLocations, + spaceId: this.spaceId, + }); + return { + editedMonitors: editedMonitors ?? [], + errors: [], + updatedCount: monitorsToUpdate.length, + }; + }; + + private handleStaleMonitors = async () => { + try { + const staleMonitorsList = Object.values(this.staleMonitorsMap).filter( + (monitor) => monitor.stale === true + ); + + const encryptedMonitors = await this.savedObjectsClient.bulkGet<SyntheticsMonitor>( + staleMonitorsList.map((staleMonitor) => ({ + id: staleMonitor.savedObjectId, + type: syntheticsMonitorType, + })) + ); + + let monitors = encryptedMonitors.saved_objects; + + const hasPrivateMonitor = monitors.some((monitor) => + monitor.attributes.locations.some((location) => !location.isServiceManaged) + ); + + if (hasPrivateMonitor) { + const { + integrations: { writeIntegrationPolicies }, + } = await this.server.fleet.authz.fromRequest(this.request); + if (!writeIntegrationPolicies) { + monitors = monitors.filter((monitor) => { + const hasPrivateLocation = monitor.attributes.locations.some( + (location) => !location.isServiceManaged + ); + if (hasPrivateLocation) { + const journeyId = (monitor.attributes as MonitorFields)[ConfigKey.JOURNEY_ID]!; + const monitorName = (monitor.attributes as MonitorFields)[ConfigKey.NAME]!; + this.handleStreamingMessage({ + message: `Monitor ${journeyId} could not be deleted`, + }); + this.failedStaleMonitors.push({ + id: journeyId, + reason: 'Failed to delete stale monitor', + details: `Unable to delete Synthetics package policy for monitor ${monitorName}. Fleet write permissions are needed to use Synthetics private locations.`, + }); + } + return !hasPrivateLocation; + }); + } + } + + const chunkSize = 100; + for (let i = 0; i < monitors.length; i += chunkSize) { + const chunkMonitors = monitors.slice(i, i + chunkSize); + try { + if (!this.keepStale) { + await deleteMonitorBulk({ + monitors: chunkMonitors, + savedObjectsClient: this.savedObjectsClient, + server: this.server, + syntheticsMonitorClient: this.syntheticsMonitorClient, + request: this.request, + }); + + for (const sm of chunkMonitors) { + const journeyId = (sm.attributes as MonitorFields)[ConfigKey.JOURNEY_ID]!; + + this.deletedMonitors.push(journeyId); + this.handleStreamingMessage({ + message: `Monitor ${journeyId} deleted successfully`, + }); + } + } else { + chunkMonitors.forEach((sm) => { + const journeyId = (sm.attributes as MonitorFields)[ConfigKey.JOURNEY_ID]!; + this.staleMonitors.push(journeyId); + }); + } + } catch (e) { + chunkMonitors.forEach((sm) => { + const journeyId = (sm.attributes as MonitorFields)[ConfigKey.JOURNEY_ID]!; + + this.handleStreamingMessage({ + message: `Monitor ${journeyId} could not be deleted`, + }); + this.failedStaleMonitors.push({ + id: journeyId, + reason: 'Failed to delete stale monitor', + details: e.message, + payload: staleMonitorsList.find( + (staleMonitor) => staleMonitor.savedObjectId === sm.id + ), + }); + }); + this.server.logger.error(e); + } + } + } catch (e) { + this.server.logger.error(e); + } + }; + + private handleStreamingMessage = ({ message }: { message: string }) => { + if (this.subject) { + this.subject?.next(message); + } + }; + + private validateMonitor = ({ + validationResult, + monitorId, + }: { + validationResult: ValidationResult; + monitorId: string; + }) => { + const { reason: message, details, payload: validationPayload, valid } = validationResult; + if (!valid) { + this.failedMonitors.push({ + id: monitorId, + reason: message, + details, + payload: validationPayload, + }); + if (this.staleMonitorsMap[monitorId]) { + this.staleMonitorsMap[monitorId].stale = false; + } + } + return validationResult; + }; +} diff --git a/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.test.ts b/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.test.ts index f66cfb28136fd..f9b32c8ba80cc 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.test.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.test.ts @@ -74,7 +74,7 @@ describe('checkAccountAccessStatus', () => { const apiClient = new ServiceAPIClient( jest.fn() as unknown as Logger, { tls: { certificate: 'crt', key: 'k' } } as ServiceConfig, - { isDev: false, kibanaVersion: '8.4' } as UptimeServerSetup + { isDev: false, stackVersion: '8.4' } as UptimeServerSetup ); apiClient.locations = [ diff --git a/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.ts b/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.ts index f447a21c3bee7..7597797be8482 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.ts @@ -35,14 +35,14 @@ export class ServiceAPIClient { public locations: PublicLocations; private logger: Logger; private readonly config?: ServiceConfig; - private readonly kibanaVersion: string; + private readonly stackVersion: string; private readonly server: UptimeServerSetup; constructor(logger: Logger, config: ServiceConfig, server: UptimeServerSetup) { this.config = config; const { username, password } = config ?? {}; this.username = username; - this.kibanaVersion = server.kibanaVersion; + this.stackVersion = server.stackVersion; if (username && password) { this.authorization = 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'); @@ -96,7 +96,7 @@ export class ServiceAPIClient { } addVersionHeader(req: AxiosRequestConfig) { - req.headers = { ...req.headers, 'x-kibana-version': this.kibanaVersion }; + req.headers = { ...req.headers, 'x-kibana-version': this.stackVersion }; return req; } @@ -157,7 +157,7 @@ export class ServiceAPIClient { data: { monitors: monitorsStreams, output, - stack_version: this.kibanaVersion, + stack_version: this.stackVersion, is_edit: isEdit, }, headers: this.authorization @@ -197,7 +197,7 @@ export class ServiceAPIClient { code: err.code, status: err.response?.data?.status, url, - kibanaVersion: this.server.kibanaVersion, + stackVersion: this.server.stackVersion, }); if (err.response?.data?.reason) { this.logger.error(err.response?.data?.reason); diff --git a/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts b/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts index 457d4e79e418e..1634f3f18a67f 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts @@ -21,10 +21,7 @@ import { UptimeServerSetup } from '../legacy_uptime/lib/adapters'; import { installSyntheticsIndexTemplates } from '../routes/synthetics_service/install_index_templates'; import { SyntheticsServiceApiKey } from '../../common/runtime_types/synthetics_service_api_key'; import { getAPIKeyForSyntheticsService } from './get_api_key'; -import { - syntheticsMonitorType, - syntheticsMonitor, -} from '../legacy_uptime/lib/saved_objects/synthetics_monitor'; +import { syntheticsMonitorType } from '../legacy_uptime/lib/saved_objects/synthetics_monitor'; import { getEsHosts } from './get_es_hosts'; import { ServiceConfig } from '../../common/config'; import { ServiceAPIClient } from './service_api_client'; @@ -180,7 +177,7 @@ export class SyntheticsService { type: 'runTaskError', code: e?.code, status: e.status, - kibanaVersion: service.server.kibanaVersion, + stackVersion: service.server.stackVersion, }); throw e; } @@ -226,7 +223,7 @@ export class SyntheticsService { type: 'scheduleTaskError', code: e?.code, status: e.status, - kibanaVersion: this.server.kibanaVersion, + stackVersion: this.server.stackVersion, }); this.logger?.error( @@ -422,7 +419,7 @@ export class SyntheticsService { new Promise((resolve) => { encryptedClient .getDecryptedAsInternalUser<SyntheticsMonitorWithSecrets>( - syntheticsMonitor.name, + syntheticsMonitorType, monitor.id, { namespace: monitor.namespaces?.[0], @@ -437,7 +434,7 @@ export class SyntheticsService { type: 'runTaskError', code: e?.code, status: e.status, - kibanaVersion: this.server.kibanaVersion, + stackVersion: this.server.stackVersion, }); resolve(null); }); diff --git a/x-pack/plugins/synthetics/tsconfig.json b/x-pack/plugins/synthetics/tsconfig.json index 2ee6d15a4f074..7544cd171ef04 100644 --- a/x-pack/plugins/synthetics/tsconfig.json +++ b/x-pack/plugins/synthetics/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -15,7 +14,7 @@ "server/legacy_uptime/lib/requests/__fixtures__/monitor_charts_mock.json", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../alerting/tsconfig.json" }, diff --git a/x-pack/plugins/task_manager/server/lib/adhoc_task_counter.test.ts b/x-pack/plugins/task_manager/server/lib/adhoc_task_counter.test.ts new file mode 100644 index 0000000000000..d8cb08127b592 --- /dev/null +++ b/x-pack/plugins/task_manager/server/lib/adhoc_task_counter.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 { AdHocTaskCounter } from './adhoc_task_counter'; + +describe('AdHocTaskCounter', () => { + const counter = new AdHocTaskCounter(); + + afterAll(() => { + counter.reset(); + }); + + it('increments counter', async () => { + counter.increment(10); + await expect(counter.count).toEqual(10); + }); + + it('resets counter', async () => { + counter.increment(10); + counter.reset(); + await expect(counter.count).toEqual(0); + }); +}); diff --git a/x-pack/plugins/task_manager/server/lib/adhoc_task_counter.ts b/x-pack/plugins/task_manager/server/lib/adhoc_task_counter.ts new file mode 100644 index 0000000000000..dc035ba890175 --- /dev/null +++ b/x-pack/plugins/task_manager/server/lib/adhoc_task_counter.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. + */ + +/** + * Keeps track of how many tasks have been created. + * + * @export + * @class AdHocTaskCounter + * + */ +export class AdHocTaskCounter { + /** + * Gets the number of created tasks. + */ + public get count() { + return this._count; + } + + private _count: number; + + constructor() { + this._count = 0; + } + + public increment(by: number = 1) { + this._count += by; + } + + public reset() { + this._count = 0; + } +} diff --git a/x-pack/plugins/task_manager/server/lib/bulk_remove_if_exist.test.ts b/x-pack/plugins/task_manager/server/lib/bulk_remove_if_exist.test.ts new file mode 100644 index 0000000000000..ac71653c31c8f --- /dev/null +++ b/x-pack/plugins/task_manager/server/lib/bulk_remove_if_exist.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 uuid from 'uuid'; +import { SavedObjectsErrorHelpers } from '@kbn/core/server'; +import { bulkRemoveIfExist } from './bulk_remove_if_exist'; +import { taskStoreMock } from '../task_store.mock'; + +describe('removeIfExists', () => { + const ids = [uuid.v4(), uuid.v4()]; + + test('removes the tasks by its IDs', async () => { + const ts = taskStoreMock.create({}); + + expect(await bulkRemoveIfExist(ts, ids)).toBe(undefined); + expect(ts.bulkRemove).toHaveBeenCalledWith(ids); + }); + + test('handles 404 errors caused by the task not existing', async () => { + const ts = taskStoreMock.create({}); + + ts.bulkRemove.mockRejectedValue( + SavedObjectsErrorHelpers.createGenericNotFoundError('task', ids[0]) + ); + + expect(await bulkRemoveIfExist(ts, ids)).toBe(undefined); + expect(ts.bulkRemove).toHaveBeenCalledWith(ids); + }); + + test('throws if any other error is caused by task removal', async () => { + const ts = taskStoreMock.create({}); + + const error = SavedObjectsErrorHelpers.createInvalidVersionError(uuid.v4()); + ts.bulkRemove.mockRejectedValue(error); + + expect(bulkRemoveIfExist(ts, ids)).rejects.toBe(error); + expect(ts.bulkRemove).toHaveBeenCalledWith(ids); + }); +}); diff --git a/x-pack/plugins/task_manager/server/lib/bulk_remove_if_exist.ts b/x-pack/plugins/task_manager/server/lib/bulk_remove_if_exist.ts new file mode 100644 index 0000000000000..c3c1a61868e60 --- /dev/null +++ b/x-pack/plugins/task_manager/server/lib/bulk_remove_if_exist.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 { SavedObjectsErrorHelpers } from '@kbn/core/server'; +import { TaskStore } from '../task_store'; + +/** + * Removes a task from the store, ignoring a not found error + * Other errors are re-thrown + * + * @param taskStore + * @param taskIds + */ +export async function bulkRemoveIfExist(taskStore: TaskStore, taskIds: string[]) { + try { + return await taskStore.bulkRemove(taskIds); + } catch (err) { + if (!SavedObjectsErrorHelpers.isNotFoundError(err)) { + throw err; + } + } +} diff --git a/x-pack/plugins/task_manager/server/lib/intervals.test.ts b/x-pack/plugins/task_manager/server/lib/intervals.test.ts index 416be4c1946e5..0d139fe5dfccf 100644 --- a/x-pack/plugins/task_manager/server/lib/intervals.test.ts +++ b/x-pack/plugins/task_manager/server/lib/intervals.test.ts @@ -16,6 +16,7 @@ import { secondsFromDate, asInterval, maxIntervalFromDate, + parseIntervalAsMinute, } from './intervals'; let fakeTimer: sinon.SinonFakeTimers; @@ -65,6 +66,44 @@ describe('taskIntervals', () => { }); }); + describe('parseIntervalAsMinute', () => { + test('it accepts intervals in the form `Nm`', () => { + expect(() => parseIntervalAsMinute(`${_.random(1, 1000)}m`)).not.toThrow(); + }); + + test('it accepts intervals in the form `Ns`', () => { + expect(() => parseIntervalAsMinute(`${_.random(1, 1000)}s`)).not.toThrow(); + }); + + test('it rejects 0 based intervals', () => { + expect(() => parseIntervalAsMinute('0m')).toThrow( + /Invalid interval "0m"\. Intervals must be of the form {number}m. Example: 5m/ + ); + expect(() => parseIntervalAsMinute('0s')).toThrow( + /Invalid interval "0s"\. Intervals must be of the form {number}m. Example: 5m/ + ); + }); + + test('it rejects intervals are not of the form `Nm` or `Ns`', () => { + expect(() => parseIntervalAsMinute(`5m 2s`)).toThrow( + /Invalid interval "5m 2s"\. Intervals must be of the form {number}m. Example: 5m/ + ); + expect(() => parseIntervalAsMinute(`hello`)).toThrow( + /Invalid interval "hello"\. Intervals must be of the form {number}m. Example: 5m/ + ); + }); + + test('returns an interval as m', () => { + expect(parseIntervalAsMinute('5s')).toEqual(5 / 60); + expect(parseIntervalAsMinute('15s')).toEqual(15 / 60); + expect(parseIntervalAsMinute('20m')).toEqual(20); + expect(parseIntervalAsMinute('61m')).toEqual(61); + expect(parseIntervalAsMinute('90m')).toEqual(90); + expect(parseIntervalAsMinute('2h')).toEqual(2 * 60); + expect(parseIntervalAsMinute('9d')).toEqual(9 * 60 * 24); + }); + }); + describe('parseIntervalAsMillisecond', () => { test('it accepts intervals in the form `Nm`', () => { expect(() => parseIntervalAsMillisecond(`${_.random(1, 1000)}m`)).not.toThrow(); diff --git a/x-pack/plugins/task_manager/server/lib/intervals.ts b/x-pack/plugins/task_manager/server/lib/intervals.ts index f876c60fe5435..4ebb1e70a18bf 100644 --- a/x-pack/plugins/task_manager/server/lib/intervals.ts +++ b/x-pack/plugins/task_manager/server/lib/intervals.ts @@ -114,6 +114,10 @@ export const parseIntervalAsSecond = memoize((interval: Interval): number => { return Math.round(parseIntervalAsMillisecond(interval) / 1000); }); +export const parseIntervalAsMinute = memoize((interval: Interval): number => { + return parseIntervalAsMillisecond(interval) / (1000 * 60); +}); + export const parseIntervalAsMillisecond = memoize((interval: Interval): number => { const numericAsStr: string = interval.slice(0, -1); const numeric: number = parseInt(numericAsStr, 10); diff --git a/x-pack/plugins/task_manager/server/mocks.ts b/x-pack/plugins/task_manager/server/mocks.ts index 6cf405c4a1b28..571149f08aa2a 100644 --- a/x-pack/plugins/task_manager/server/mocks.ts +++ b/x-pack/plugins/task_manager/server/mocks.ts @@ -27,11 +27,13 @@ const createStartMock = () => { ephemeralRunNow: jest.fn(), ensureScheduled: jest.fn(), removeIfExists: jest.fn(), + bulkRemoveIfExist: jest.fn(), supportsEphemeralTasks: jest.fn(), bulkUpdateSchedules: jest.fn(), bulkSchedule: jest.fn(), bulkDisable: jest.fn(), bulkEnable: jest.fn(), + getRegisteredTypes: jest.fn(), }; return mock; }; diff --git a/x-pack/plugins/task_manager/server/monitoring/background_task_utilization_statistics.test.ts b/x-pack/plugins/task_manager/server/monitoring/background_task_utilization_statistics.test.ts new file mode 100644 index 0000000000000..875c7cf735836 --- /dev/null +++ b/x-pack/plugins/task_manager/server/monitoring/background_task_utilization_statistics.test.ts @@ -0,0 +1,542 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import uuid from 'uuid'; +import { Subject, Observable } from 'rxjs'; +import { take, bufferCount, skip, map } from 'rxjs/operators'; +import { ConcreteTaskInstance, TaskStatus } from '../task'; +import { asTaskRunEvent, TaskTiming, TaskPersistence } from '../task_events'; +import { asOk } from '../lib/result_type'; +import { TaskLifecycleEvent } from '../polling_lifecycle'; +import { TaskRunResult } from '../task_running'; +import { AggregatedStat } from './runtime_statistics_aggregator'; +import { taskPollingLifecycleMock } from '../polling_lifecycle.mock'; +import { + BackgroundTaskUtilizationStat, + createBackgroundTaskUtilizationAggregator, + SummarizedBackgroundTaskUtilizationStat, + summarizeUtilizationStat, +} from './background_task_utilization_statistics'; +import { parseIntervalAsMinute } from '../lib/intervals'; +import { AdHocTaskCounter } from '../lib/adhoc_task_counter'; +import { sum } from 'lodash'; + +describe('Task Run Statistics', () => { + const pollInterval = 3000; + + beforeAll(() => { + jest.resetAllMocks(); + }); + + test('returns a running count of adhoc actual service_time', async () => { + const serviceTimes = [1000, 2000, 500, 300, 400, 15000, 20000, 200]; + const events$ = new Subject<TaskLifecycleEvent>(); + const taskPollingLifecycle = taskPollingLifecycleMock.create({ + events$: events$ as Observable<TaskLifecycleEvent>, + }); + const adHocTaskCounter = new AdHocTaskCounter(); + + const runningAverageWindowSize = 5; + const BackgroundTaskUtilizationAggregator = createBackgroundTaskUtilizationAggregator( + taskPollingLifecycle, + runningAverageWindowSize, + adHocTaskCounter, + pollInterval + ); + + function expectWindowEqualsUpdate( + taskStat: AggregatedStat<SummarizedBackgroundTaskUtilizationStat>, + window: number[] + ) { + expect(taskStat.value.adhoc.ran.service_time.actual).toEqual(sum(window)); + } + + return new Promise<void>((resolve) => { + const events = []; + const now = Date.now(); + for (const time of serviceTimes) { + events.push({ start: runAtMillisecondsAgo(now, time).getTime(), stop: now }); + } + BackgroundTaskUtilizationAggregator.pipe( + // skip initial stat which is just initialized data which + // ensures we don't stall on combineLatest + skip(1), + // Use 'summarizeUtilizationStat' to receive summarize stats + map(({ key, value }: AggregatedStat<BackgroundTaskUtilizationStat>) => ({ + key, + value: summarizeUtilizationStat(value).value, + })), + take(serviceTimes.length), + bufferCount(serviceTimes.length) + ).subscribe((taskStats: Array<AggregatedStat<SummarizedBackgroundTaskUtilizationStat>>) => { + expectWindowEqualsUpdate(taskStats[0], serviceTimes.slice(0, 1)); + expectWindowEqualsUpdate(taskStats[1], serviceTimes.slice(0, 2)); + expectWindowEqualsUpdate(taskStats[2], serviceTimes.slice(0, 3)); + expectWindowEqualsUpdate(taskStats[3], serviceTimes.slice(0, 4)); + expectWindowEqualsUpdate(taskStats[4], serviceTimes.slice(0, 5)); + // from the 6th value, begin to drop old values as out window is 5 + expectWindowEqualsUpdate(taskStats[5], serviceTimes.slice(1, 6)); + expectWindowEqualsUpdate(taskStats[6], serviceTimes.slice(2, 7)); + expectWindowEqualsUpdate(taskStats[7], serviceTimes.slice(3, 8)); + resolve(); + }); + + for (const event of events) { + events$.next(mockTaskRunEvent({}, event)); + } + }); + }); + + test('returns a running count of adhoc adjusted service_time', async () => { + const serviceTimes = [1000, 2000, 500, 300, 400, 15000, 20000, 200]; + const events$ = new Subject<TaskLifecycleEvent>(); + const taskPollingLifecycle = taskPollingLifecycleMock.create({ + events$: events$ as Observable<TaskLifecycleEvent>, + }); + const adHocTaskCounter = new AdHocTaskCounter(); + + const runningAverageWindowSize = 5; + const BackgroundTaskUtilizationAggregator = createBackgroundTaskUtilizationAggregator( + taskPollingLifecycle, + runningAverageWindowSize, + adHocTaskCounter, + pollInterval + ); + + function expectWindowEqualsUpdate( + taskStat: AggregatedStat<SummarizedBackgroundTaskUtilizationStat>, + window: number[] + ) { + expect(taskStat.value.adhoc.ran.service_time.adjusted).toEqual(sum(window)); + } + + return new Promise<void>((resolve) => { + const events = []; + const now = Date.now(); + for (const time of serviceTimes) { + events.push({ start: runAtMillisecondsAgo(now, time).getTime(), stop: now }); + } + BackgroundTaskUtilizationAggregator.pipe( + // skip initial stat which is just initialized data which + // ensures we don't stall on combineLatest + skip(1), + // Use 'summarizeUtilizationStat' to receive summarize stats + map(({ key, value }: AggregatedStat<BackgroundTaskUtilizationStat>) => ({ + key, + value: summarizeUtilizationStat(value).value, + })), + take(serviceTimes.length), + bufferCount(serviceTimes.length) + ).subscribe((taskStats: Array<AggregatedStat<SummarizedBackgroundTaskUtilizationStat>>) => { + expectWindowEqualsUpdate(taskStats[0], roundUpToNearestSec(serviceTimes.slice(0, 1), 3)); + expectWindowEqualsUpdate(taskStats[1], roundUpToNearestSec(serviceTimes.slice(0, 2), 3)); + expectWindowEqualsUpdate(taskStats[2], roundUpToNearestSec(serviceTimes.slice(0, 3), 3)); + expectWindowEqualsUpdate(taskStats[3], roundUpToNearestSec(serviceTimes.slice(0, 4), 3)); + expectWindowEqualsUpdate(taskStats[4], roundUpToNearestSec(serviceTimes.slice(0, 5), 3)); + // from the 6th value, begin to drop old values as out window is 5 + expectWindowEqualsUpdate(taskStats[5], roundUpToNearestSec(serviceTimes.slice(1, 6), 3)); + expectWindowEqualsUpdate(taskStats[6], roundUpToNearestSec(serviceTimes.slice(2, 7), 3)); + expectWindowEqualsUpdate(taskStats[7], roundUpToNearestSec(serviceTimes.slice(3, 8), 3)); + resolve(); + }); + + for (const event of events) { + events$.next(mockTaskRunEvent({}, event)); + } + }); + }); + + test('returns a running count of adhoc task_counter', async () => { + const tasks = [0, 0, 0, 0, 0, 0, 0, 0]; + const events$ = new Subject<TaskLifecycleEvent>(); + const taskPollingLifecycle = taskPollingLifecycleMock.create({ + events$: events$ as Observable<TaskLifecycleEvent>, + }); + const adHocTaskCounter = new AdHocTaskCounter(); + + const runningAverageWindowSize = 5; + const BackgroundTaskUtilizationAggregator = createBackgroundTaskUtilizationAggregator( + taskPollingLifecycle, + runningAverageWindowSize, + adHocTaskCounter, + pollInterval + ); + + function expectWindowEqualsUpdate( + taskStat: AggregatedStat<SummarizedBackgroundTaskUtilizationStat>, + window: number[] + ) { + expect(taskStat.value.adhoc.ran.service_time.task_counter).toEqual(window.length); + } + + return new Promise<void>((resolve) => { + BackgroundTaskUtilizationAggregator.pipe( + // skip initial stat which is just initialized data which + // ensures we don't stall on combineLatest + skip(1), + // Use 'summarizeUtilizationStat' to receive summarize stats + map(({ key, value }: AggregatedStat<BackgroundTaskUtilizationStat>) => ({ + key, + value: summarizeUtilizationStat(value).value, + })), + take(tasks.length), + bufferCount(tasks.length) + ).subscribe((taskStats: Array<AggregatedStat<SummarizedBackgroundTaskUtilizationStat>>) => { + expectWindowEqualsUpdate(taskStats[0], tasks.slice(0, 1)); + expectWindowEqualsUpdate(taskStats[1], tasks.slice(0, 2)); + expectWindowEqualsUpdate(taskStats[2], tasks.slice(0, 3)); + expectWindowEqualsUpdate(taskStats[3], tasks.slice(0, 4)); + expectWindowEqualsUpdate(taskStats[4], tasks.slice(0, 5)); + // from the 6th value, begin to drop old values as out window is 5 + expectWindowEqualsUpdate(taskStats[5], tasks.slice(1, 6)); + expectWindowEqualsUpdate(taskStats[6], tasks.slice(2, 7)); + expectWindowEqualsUpdate(taskStats[7], tasks.slice(3, 8)); + resolve(); + }); + + for (const task of tasks) { + events$.next(mockTaskRunEvent({}, { start: task, stop: task })); + } + }); + }); + + test('returns a running count of adhoc created counter', async () => { + const tasks = [1000, 2000, 500, 300, 400, 15000, 20000, 200]; + const events$ = new Subject<TaskLifecycleEvent>(); + const taskPollingLifecycle = taskPollingLifecycleMock.create({ + events$: events$ as Observable<TaskLifecycleEvent>, + }); + const adHocTaskCounter = new AdHocTaskCounter(); + + const runningAverageWindowSize = 5; + const BackgroundTaskUtilizationAggregator = createBackgroundTaskUtilizationAggregator( + taskPollingLifecycle, + runningAverageWindowSize, + adHocTaskCounter, + pollInterval + ); + + function expectWindowEqualsUpdate( + taskStat: AggregatedStat<SummarizedBackgroundTaskUtilizationStat>, + window: number[] + ) { + expect(taskStat.value.adhoc.created.counter).toEqual(sum(window)); + } + + return new Promise<void>((resolve) => { + BackgroundTaskUtilizationAggregator.pipe( + // skip initial stat which is just initialized data which + // ensures we don't stall on combineLatest + skip(1), + // Use 'summarizeUtilizationStat' to receive summarize stats + map(({ key, value }: AggregatedStat<BackgroundTaskUtilizationStat>) => ({ + key, + value: summarizeUtilizationStat(value).value, + })), + take(tasks.length), + bufferCount(tasks.length) + ).subscribe((taskStats: Array<AggregatedStat<SummarizedBackgroundTaskUtilizationStat>>) => { + expectWindowEqualsUpdate(taskStats[0], tasks.slice(0, 1)); + expectWindowEqualsUpdate(taskStats[1], tasks.slice(0, 2)); + expectWindowEqualsUpdate(taskStats[2], tasks.slice(0, 3)); + expectWindowEqualsUpdate(taskStats[3], tasks.slice(0, 4)); + expectWindowEqualsUpdate(taskStats[4], tasks.slice(0, 5)); + // from the 6th value, begin to drop old values as out window is 5 + expectWindowEqualsUpdate(taskStats[5], tasks.slice(1, 6)); + expectWindowEqualsUpdate(taskStats[6], tasks.slice(2, 7)); + expectWindowEqualsUpdate(taskStats[7], tasks.slice(3, 8)); + resolve(); + }); + + for (const task of tasks) { + adHocTaskCounter.increment(task); + events$.next(mockTaskRunEvent({}, { start: 0, stop: 0 })); + } + }); + }); + + test('returns a running count of recurring actual service_time', async () => { + const serviceTimes = [1000, 2000, 500, 300, 400, 15000, 20000, 200]; + const events$ = new Subject<TaskLifecycleEvent>(); + const taskPollingLifecycle = taskPollingLifecycleMock.create({ + events$: events$ as Observable<TaskLifecycleEvent>, + }); + const adHocTaskCounter = new AdHocTaskCounter(); + + const runningAverageWindowSize = 5; + const BackgroundTaskUtilizationAggregator = createBackgroundTaskUtilizationAggregator( + taskPollingLifecycle, + runningAverageWindowSize, + adHocTaskCounter, + pollInterval + ); + + function expectWindowEqualsUpdate( + taskStat: AggregatedStat<SummarizedBackgroundTaskUtilizationStat>, + window: number[] + ) { + expect(taskStat.value.recurring.ran.service_time.actual).toEqual(sum(window)); + } + + return new Promise<void>((resolve) => { + const events = []; + const now = Date.now(); + for (const time of serviceTimes) { + events.push({ start: runAtMillisecondsAgo(now, time).getTime(), stop: now }); + } + BackgroundTaskUtilizationAggregator.pipe( + // skip initial stat which is just initialized data which + // ensures we don't stall on combineLatest + skip(1), + // Use 'summarizeUtilizationStat' to receive summarize stats + map(({ key, value }: AggregatedStat<BackgroundTaskUtilizationStat>) => ({ + key, + value: summarizeUtilizationStat(value).value, + })), + take(serviceTimes.length), + bufferCount(serviceTimes.length) + ).subscribe((taskStats: Array<AggregatedStat<SummarizedBackgroundTaskUtilizationStat>>) => { + expectWindowEqualsUpdate(taskStats[0], serviceTimes.slice(0, 1)); + expectWindowEqualsUpdate(taskStats[1], serviceTimes.slice(0, 2)); + expectWindowEqualsUpdate(taskStats[2], serviceTimes.slice(0, 3)); + expectWindowEqualsUpdate(taskStats[3], serviceTimes.slice(0, 4)); + expectWindowEqualsUpdate(taskStats[4], serviceTimes.slice(0, 5)); + // from the 6th value, begin to drop old values as out window is 5 + expectWindowEqualsUpdate(taskStats[5], serviceTimes.slice(1, 6)); + expectWindowEqualsUpdate(taskStats[6], serviceTimes.slice(2, 7)); + expectWindowEqualsUpdate(taskStats[7], serviceTimes.slice(3, 8)); + resolve(); + }); + + for (const event of events) { + events$.next(mockTaskRunEvent({ schedule: { interval: '1h' } }, event)); + } + }); + }); + + test('returns a running count of recurring adjusted service_time', async () => { + const serviceTimes = [1000, 2000, 500, 300, 400, 15000, 20000, 200]; + const events$ = new Subject<TaskLifecycleEvent>(); + const taskPollingLifecycle = taskPollingLifecycleMock.create({ + events$: events$ as Observable<TaskLifecycleEvent>, + }); + const adHocTaskCounter = new AdHocTaskCounter(); + + const runningAverageWindowSize = 5; + const BackgroundTaskUtilizationAggregator = createBackgroundTaskUtilizationAggregator( + taskPollingLifecycle, + runningAverageWindowSize, + adHocTaskCounter, + pollInterval + ); + + function expectWindowEqualsUpdate( + taskStat: AggregatedStat<SummarizedBackgroundTaskUtilizationStat>, + window: number[] + ) { + expect(taskStat.value.recurring.ran.service_time.adjusted).toEqual(sum(window)); + } + + return new Promise<void>((resolve) => { + const events = []; + const now = Date.now(); + for (const time of serviceTimes) { + events.push({ start: runAtMillisecondsAgo(now, time).getTime(), stop: now }); + } + BackgroundTaskUtilizationAggregator.pipe( + // skip initial stat which is just initialized data which + // ensures we don't stall on combineLatest + skip(1), + // Use 'summarizeUtilizationStat' to receive summarize stats + map(({ key, value }: AggregatedStat<BackgroundTaskUtilizationStat>) => ({ + key, + value: summarizeUtilizationStat(value).value, + })), + take(serviceTimes.length), + bufferCount(serviceTimes.length) + ).subscribe((taskStats: Array<AggregatedStat<SummarizedBackgroundTaskUtilizationStat>>) => { + expectWindowEqualsUpdate(taskStats[0], roundUpToNearestSec(serviceTimes.slice(0, 1), 3)); + expectWindowEqualsUpdate(taskStats[1], roundUpToNearestSec(serviceTimes.slice(0, 2), 3)); + expectWindowEqualsUpdate(taskStats[2], roundUpToNearestSec(serviceTimes.slice(0, 3), 3)); + expectWindowEqualsUpdate(taskStats[3], roundUpToNearestSec(serviceTimes.slice(0, 4), 3)); + expectWindowEqualsUpdate(taskStats[4], roundUpToNearestSec(serviceTimes.slice(0, 5), 3)); + // from the 6th value, begin to drop old values as out window is 5 + expectWindowEqualsUpdate(taskStats[5], roundUpToNearestSec(serviceTimes.slice(1, 6), 3)); + expectWindowEqualsUpdate(taskStats[6], roundUpToNearestSec(serviceTimes.slice(2, 7), 3)); + expectWindowEqualsUpdate(taskStats[7], roundUpToNearestSec(serviceTimes.slice(3, 8), 3)); + resolve(); + }); + + for (const event of events) { + events$.next(mockTaskRunEvent({ schedule: { interval: '1h' } }, event)); + } + }); + }); + + test('returns a running count of recurring task_counter', async () => { + const tasks = [0, 0, 0, 0, 0, 0, 0, 0]; + const events$ = new Subject<TaskLifecycleEvent>(); + const taskPollingLifecycle = taskPollingLifecycleMock.create({ + events$: events$ as Observable<TaskLifecycleEvent>, + }); + const adHocTaskCounter = new AdHocTaskCounter(); + + const runningAverageWindowSize = 5; + const BackgroundTaskUtilizationAggregator = createBackgroundTaskUtilizationAggregator( + taskPollingLifecycle, + runningAverageWindowSize, + adHocTaskCounter, + pollInterval + ); + + function expectWindowEqualsUpdate( + taskStat: AggregatedStat<SummarizedBackgroundTaskUtilizationStat>, + window: number[] + ) { + expect(taskStat.value.recurring.ran.service_time.task_counter).toEqual(window.length); + } + + return new Promise<void>((resolve) => { + BackgroundTaskUtilizationAggregator.pipe( + // skip initial stat which is just initialized data which + // ensures we don't stall on combineLatest + skip(1), + // Use 'summarizeUtilizationStat' to receive summarize stats + map(({ key, value }: AggregatedStat<BackgroundTaskUtilizationStat>) => ({ + key, + value: summarizeUtilizationStat(value).value, + })), + take(tasks.length), + bufferCount(tasks.length) + ).subscribe((taskStats: Array<AggregatedStat<SummarizedBackgroundTaskUtilizationStat>>) => { + expectWindowEqualsUpdate(taskStats[0], tasks.slice(0, 1)); + expectWindowEqualsUpdate(taskStats[1], tasks.slice(0, 2)); + expectWindowEqualsUpdate(taskStats[2], tasks.slice(0, 3)); + expectWindowEqualsUpdate(taskStats[3], tasks.slice(0, 4)); + expectWindowEqualsUpdate(taskStats[4], tasks.slice(0, 5)); + // from the 6th value, begin to drop old values as out window is 5 + expectWindowEqualsUpdate(taskStats[5], tasks.slice(1, 6)); + expectWindowEqualsUpdate(taskStats[6], tasks.slice(2, 7)); + expectWindowEqualsUpdate(taskStats[7], tasks.slice(3, 8)); + resolve(); + }); + + for (const task of tasks) { + events$.next( + mockTaskRunEvent({ schedule: { interval: '1h' } }, { start: task, stop: task }) + ); + } + }); + }); + + test('returns a running count of recurring tasks_per_min', async () => { + const intervals = ['1h', '5m', '2h', '30m', '10m', '1m', '5h', '120m']; + const events$ = new Subject<TaskLifecycleEvent>(); + const taskPollingLifecycle = taskPollingLifecycleMock.create({ + events$: events$ as Observable<TaskLifecycleEvent>, + }); + const adHocTaskCounter = new AdHocTaskCounter(); + + const runningAverageWindowSize = 5; + const BackgroundTaskUtilizationAggregator = createBackgroundTaskUtilizationAggregator( + taskPollingLifecycle, + runningAverageWindowSize, + adHocTaskCounter, + pollInterval + ); + + function expectWindowEqualsUpdate( + taskStat: AggregatedStat<SummarizedBackgroundTaskUtilizationStat>, + window: number[] + ) { + expect(taskStat.value.recurring.tasks_per_min).toEqual(sum(window)); + } + + return new Promise<void>((resolve) => { + BackgroundTaskUtilizationAggregator.pipe( + // skip initial stat which is just initialized data which + // ensures we don't stall on combineLatest + skip(1), + // Use 'summarizeUtilizationStat' to receive summarize stats + map(({ key, value }: AggregatedStat<BackgroundTaskUtilizationStat>) => ({ + key, + value: summarizeUtilizationStat(value).value, + })), + take(intervals.length), + bufferCount(intervals.length) + ).subscribe((taskStats: Array<AggregatedStat<SummarizedBackgroundTaskUtilizationStat>>) => { + expectWindowEqualsUpdate(taskStats[0], mapInterval(intervals.slice(0, 1))); + expectWindowEqualsUpdate(taskStats[1], mapInterval(intervals.slice(0, 2))); + expectWindowEqualsUpdate(taskStats[2], mapInterval(intervals.slice(0, 3))); + expectWindowEqualsUpdate(taskStats[3], mapInterval(intervals.slice(0, 4))); + expectWindowEqualsUpdate(taskStats[4], mapInterval(intervals.slice(0, 5))); + // from the 6th value, begin to drop old values as out window is 5 + expectWindowEqualsUpdate(taskStats[5], mapInterval(intervals.slice(1, 6))); + expectWindowEqualsUpdate(taskStats[6], mapInterval(intervals.slice(2, 7))); + expectWindowEqualsUpdate(taskStats[7], mapInterval(intervals.slice(3, 8))); + resolve(); + }); + + for (const i of intervals) { + events$.next(mockTaskRunEvent({ schedule: { interval: i } }, { start: 0, stop: 0 })); + } + }); + }); +}); + +function runAtMillisecondsAgo(now: number, ms: number): Date { + return new Date(now - ms); +} + +function roundUpToNearestSec(duration: number[], s: number): number[] { + const pollInterval = s * 1000; + return duration.map((d) => Math.ceil(d / pollInterval) * pollInterval); +} + +function mapInterval(intervals: string[]): number[] { + return intervals.map((i) => { + const interval = parseIntervalAsMinute(i); + return 1 / interval; + }); +} + +const mockTaskRunEvent = ( + overrides: Partial<ConcreteTaskInstance> = {}, + timing: TaskTiming, + result: TaskRunResult = TaskRunResult.Success, + persistence?: TaskPersistence +) => { + const task = mockTaskInstance(overrides); + return asTaskRunEvent( + task.id, + asOk({ + task, + persistence: + persistence ?? (task.schedule ? TaskPersistence.Recurring : TaskPersistence.NonRecurring), + result, + }), + timing + ); +}; + +const mockTaskInstance = (overrides: Partial<ConcreteTaskInstance> = {}): ConcreteTaskInstance => ({ + id: uuid.v4(), + attempts: 0, + status: TaskStatus.Running, + version: '123', + runAt: new Date(), + scheduledAt: new Date(), + startedAt: new Date(), + retryAt: new Date(Date.now() + 5 * 60 * 1000), + state: {}, + taskType: 'alerting:test', + params: { + alertId: '1', + }, + ownerId: null, + ...overrides, +}); diff --git a/x-pack/plugins/task_manager/server/monitoring/background_task_utilization_statistics.ts b/x-pack/plugins/task_manager/server/monitoring/background_task_utilization_statistics.ts new file mode 100644 index 0000000000000..3d096cd366e72 --- /dev/null +++ b/x-pack/plugins/task_manager/server/monitoring/background_task_utilization_statistics.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 { JsonObject } from '@kbn/utility-types'; +import { get } from 'lodash'; +import { combineLatest, filter, map, Observable, startWith } from 'rxjs'; +import { AdHocTaskCounter } from '../lib/adhoc_task_counter'; +import { parseIntervalAsMinute } from '../lib/intervals'; +import { unwrap } from '../lib/result_type'; +import { TaskLifecycleEvent, TaskPollingLifecycle } from '../polling_lifecycle'; +import { ConcreteTaskInstance } from '../task'; +import { isTaskRunEvent, TaskRun, TaskTiming } from '../task_events'; +import { MonitoredStat } from './monitoring_stats_stream'; +import { AggregatedStat, AggregatedStatProvider } from './runtime_statistics_aggregator'; +import { createRunningAveragedStat } from './task_run_calcultors'; + +export interface BackgroundTaskUtilizationStat extends JsonObject { + adhoc: AdhocTaskStat; + recurring: RecurringTaskStat; +} + +interface TaskStat extends JsonObject { + ran: { + service_time: { + actual: number[]; // total service time for running recurring tasks + adjusted: number[]; // total service time adjusted for polling interval + task_counter: number[]; // recurring tasks counter, only increases for the lifetime of the process + }; + }; +} + +interface AdhocTaskStat extends TaskStat { + created: { + counter: number[]; // counter for number of ad hoc tasks created + }; +} + +interface RecurringTaskStat extends TaskStat { + tasks_per_min: number[]; +} + +export interface SummarizedBackgroundTaskUtilizationStat extends JsonObject { + adhoc: { + created: { + counter: number; + }; + ran: { + service_time: { + actual: number; + adjusted: number; + task_counter: number; + }; + }; + }; + recurring: { + tasks_per_min: number; + ran: { + service_time: { + actual: number; + adjusted: number; + task_counter: number; + }; + }; + }; +} + +export function createBackgroundTaskUtilizationAggregator( + taskPollingLifecycle: TaskPollingLifecycle, + runningAverageWindowSize: number, + adHocTaskCounter: AdHocTaskCounter, + pollInterval: number +): AggregatedStatProvider<BackgroundTaskUtilizationStat> { + const taskRunEventToAdhocStat = createTaskRunEventToAdhocStat(runningAverageWindowSize); + const taskRunAdhocEvents$: Observable<Pick<BackgroundTaskUtilizationStat, 'adhoc'>> = + taskPollingLifecycle.events.pipe( + filter((taskEvent: TaskLifecycleEvent) => isTaskRunEvent(taskEvent) && hasTiming(taskEvent)), + map((taskEvent: TaskLifecycleEvent) => ({ + taskEvent, + ...unwrap((taskEvent as TaskRun).event), + })), + filter(({ task }) => get(task, 'schedule.interval', null) == null), + map(({ taskEvent }) => { + return taskRunEventToAdhocStat(taskEvent.timing!, adHocTaskCounter, pollInterval); + }) + ); + + const taskRunEventToRecurringStat = createTaskRunEventToRecurringStat(runningAverageWindowSize); + const taskRunRecurringEvents$: Observable<Pick<BackgroundTaskUtilizationStat, 'recurring'>> = + taskPollingLifecycle.events.pipe( + filter((taskEvent: TaskLifecycleEvent) => isTaskRunEvent(taskEvent) && hasTiming(taskEvent)), + map((taskEvent: TaskLifecycleEvent) => ({ + taskEvent, + ...unwrap((taskEvent as TaskRun).event), + })), + filter(({ task }) => get(task, 'schedule.interval', null) != null), + map(({ taskEvent, task }) => { + return taskRunEventToRecurringStat(taskEvent.timing!, task, pollInterval); + }) + ); + + return combineLatest([ + taskRunAdhocEvents$.pipe( + startWith({ + adhoc: { + created: { + counter: [], + }, + ran: { + service_time: { + actual: [], + adjusted: [], + task_counter: [], + }, + }, + }, + }) + ), + taskRunRecurringEvents$.pipe( + startWith({ + recurring: { + tasks_per_min: [], + ran: { + service_time: { + actual: [], + adjusted: [], + task_counter: [], + }, + }, + }, + }) + ), + ]).pipe( + map( + ([adhoc, recurring]: [ + Pick<BackgroundTaskUtilizationStat, 'adhoc'>, + Pick<BackgroundTaskUtilizationStat, 'recurring'> + ]) => { + return { + key: 'utilization', + value: { + ...adhoc, + ...recurring, + }, + } as AggregatedStat<BackgroundTaskUtilizationStat>; + } + ) + ); +} + +function hasTiming(taskEvent: TaskLifecycleEvent) { + return !!taskEvent?.timing; +} + +export function summarizeUtilizationStat({ adhoc, recurring }: BackgroundTaskUtilizationStat): { + value: SummarizedBackgroundTaskUtilizationStat; +} { + return { + value: { + adhoc: { + created: { + counter: calculateSum(adhoc.created.counter), + }, + ran: { + service_time: { + actual: calculateSum(adhoc.ran.service_time.actual), + adjusted: calculateSum(adhoc.ran.service_time.adjusted), + task_counter: calculateSum(adhoc.ran.service_time.task_counter), + }, + }, + }, + recurring: { + tasks_per_min: calculateSum(recurring.tasks_per_min), + ran: { + service_time: { + actual: calculateSum(recurring.ran.service_time.actual), + adjusted: calculateSum(recurring.ran.service_time.adjusted), + task_counter: calculateSum(recurring.ran.service_time.task_counter), + }, + }, + }, + }, + }; +} + +export function summarizeUtilizationStats({ + // eslint-disable-next-line @typescript-eslint/naming-convention + last_update, + stats, +}: { + last_update: string; + stats: MonitoredStat<BackgroundTaskUtilizationStat> | undefined; +}): { + last_update: string; + stats: MonitoredStat<SummarizedBackgroundTaskUtilizationStat> | null; +} { + return { + last_update, + stats: stats + ? { + timestamp: stats.timestamp, + ...summarizeUtilizationStat(stats.value), + } + : null, + }; +} + +function createTaskRunEventToAdhocStat(runningAverageWindowSize: number) { + const createdCounterQueue = createRunningAveragedStat<number>(runningAverageWindowSize); + const actualQueue = createRunningAveragedStat<number>(runningAverageWindowSize); + const adjustedQueue = createRunningAveragedStat<number>(runningAverageWindowSize); + const taskCounterQueue = createRunningAveragedStat<number>(runningAverageWindowSize); + return ( + timing: TaskTiming, + adHocTaskCounter: AdHocTaskCounter, + pollInterval: number + ): Pick<BackgroundTaskUtilizationStat, 'adhoc'> => { + const { duration, adjusted } = getServiceTimeStats(timing, pollInterval); + const created = adHocTaskCounter.count; + adHocTaskCounter.reset(); + return { + adhoc: { + created: { + counter: createdCounterQueue(created), + }, + ran: { + service_time: { + actual: actualQueue(duration), + adjusted: adjustedQueue(adjusted), + task_counter: taskCounterQueue(1), + }, + }, + }, + }; + }; +} + +function createTaskRunEventToRecurringStat(runningAverageWindowSize: number) { + const tasksPerMinQueue = createRunningAveragedStat<number>(runningAverageWindowSize); + const actualQueue = createRunningAveragedStat<number>(runningAverageWindowSize); + const adjustedQueue = createRunningAveragedStat<number>(runningAverageWindowSize); + const taskCounterQueue = createRunningAveragedStat<number>(runningAverageWindowSize); + return ( + timing: TaskTiming, + task: ConcreteTaskInstance, + pollInterval: number + ): Pick<BackgroundTaskUtilizationStat, 'recurring'> => { + const { duration, adjusted } = getServiceTimeStats(timing, pollInterval); + const interval = parseIntervalAsMinute(task.schedule?.interval!); + return { + recurring: { + tasks_per_min: tasksPerMinQueue(1 / interval), + ran: { + service_time: { + actual: actualQueue(duration), + adjusted: adjustedQueue(adjusted), + task_counter: taskCounterQueue(1), + }, + }, + }, + }; + }; +} + +function getServiceTimeStats(timing: TaskTiming, pollInterval: number) { + const duration = timing!.stop - timing!.start; + const adjusted = Math.ceil(duration / pollInterval) * pollInterval; + return { duration, adjusted }; +} + +function calculateSum(arr: number[]) { + return arr.reduce((acc, s) => (acc += s), 0); +} diff --git a/x-pack/plugins/task_manager/server/monitoring/index.ts b/x-pack/plugins/task_manager/server/monitoring/index.ts index de1bea796c038..9ee32e97d7758 100644 --- a/x-pack/plugins/task_manager/server/monitoring/index.ts +++ b/x-pack/plugins/task_manager/server/monitoring/index.ts @@ -17,6 +17,7 @@ import { TaskStore } from '../task_store'; import { TaskPollingLifecycle } from '../polling_lifecycle'; import { ManagedConfiguration } from '../lib/create_managed_configuration'; import { EphemeralTaskLifecycle } from '../ephemeral_task_lifecycle'; +import { AdHocTaskCounter } from '../lib/adhoc_task_counter'; export type { MonitoringStats, RawMonitoringStats } from './monitoring_stats_stream'; export { @@ -32,6 +33,7 @@ export function createMonitoringStats( config: TaskManagerConfig, managedConfig: ManagedConfiguration, logger: Logger, + adHocTaskCounter: AdHocTaskCounter, taskPollingLifecycle?: TaskPollingLifecycle, ephemeralTaskLifecycle?: EphemeralTaskLifecycle ): Observable<MonitoringStats> { @@ -42,6 +44,7 @@ export function createMonitoringStats( config, managedConfig, logger, + adHocTaskCounter, taskPollingLifecycle, ephemeralTaskLifecycle ), diff --git a/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.ts b/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.ts index a16e01189f4c7..19485e41c2ae2 100644 --- a/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.ts +++ b/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.ts @@ -30,12 +30,18 @@ import { TaskRunStat, SummarizedTaskRunStat, } from './task_run_statistics'; +import { + BackgroundTaskUtilizationStat, + createBackgroundTaskUtilizationAggregator, +} from './background_task_utilization_statistics'; + import { ConfigStat, createConfigurationAggregator } from './configuration_statistics'; import { TaskManagerConfig } from '../config'; import { AggregatedStatProvider } from './runtime_statistics_aggregator'; import { ManagedConfiguration } from '../lib/create_managed_configuration'; import { EphemeralTaskLifecycle } from '../ephemeral_task_lifecycle'; import { CapacityEstimationStat, withCapacityEstimate } from './capacity_estimation'; +import { AdHocTaskCounter } from '../lib/adhoc_task_counter'; export type { AggregatedStatProvider, AggregatedStat } from './runtime_statistics_aggregator'; @@ -46,6 +52,7 @@ export interface MonitoringStats { workload?: MonitoredStat<WorkloadStat>; runtime?: MonitoredStat<TaskRunStat>; ephemeral?: MonitoredStat<EphemeralTaskStat>; + utilization?: MonitoredStat<BackgroundTaskUtilizationStat>; }; } @@ -55,7 +62,7 @@ export enum HealthStatus { Error = 'error', } -interface MonitoredStat<T> { +export interface MonitoredStat<T> { timestamp: string; value: T; } @@ -80,6 +87,7 @@ export function createAggregators( config: TaskManagerConfig, managedConfig: ManagedConfiguration, logger: Logger, + adHocTaskCounter: AdHocTaskCounter, taskPollingLifecycle?: TaskPollingLifecycle, ephemeralTaskLifecycle?: EphemeralTaskLifecycle ): AggregatedStatProvider { @@ -96,7 +104,13 @@ export function createAggregators( ]; if (taskPollingLifecycle) { aggregators.push( - createTaskRunAggregator(taskPollingLifecycle, config.monitored_stats_running_average_window) + createTaskRunAggregator(taskPollingLifecycle, config.monitored_stats_running_average_window), + createBackgroundTaskUtilizationAggregator( + taskPollingLifecycle, + config.monitored_stats_running_average_window, + adHocTaskCounter, + config.poll_interval + ) ); } if (ephemeralTaskLifecycle && ephemeralTaskLifecycle.enabled) { @@ -145,7 +159,7 @@ export function summarizeMonitoringStats( { // eslint-disable-next-line @typescript-eslint/naming-convention last_update, - stats: { runtime, workload, configuration, ephemeral }, + stats: { runtime, workload, configuration, ephemeral, utilization }, }: MonitoringStats, config: TaskManagerConfig ): RawMonitoringStats { diff --git a/x-pack/plugins/task_manager/server/monitoring/workload_statistics.test.ts b/x-pack/plugins/task_manager/server/monitoring/workload_statistics.test.ts index 947f8e397a2cf..f60531886453f 100644 --- a/x-pack/plugins/task_manager/server/monitoring/workload_statistics.test.ts +++ b/x-pack/plugins/task_manager/server/monitoring/workload_statistics.test.ts @@ -123,6 +123,7 @@ describe('Workload Statistics Aggregator', () => { schedule: { terms: { field: 'task.schedule.interval', + size: 100, }, }, nonRecurringTasks: { diff --git a/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts b/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts index c79a5660b20f7..bacd05dcb6a06 100644 --- a/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts +++ b/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts @@ -62,7 +62,7 @@ export interface WorkloadAggregation { }; }; schedule: { - terms: { field: string }; + terms: { field: string; size: number }; }; idleTasks: { filter: { @@ -141,7 +141,7 @@ export function createWorkloadAggregator( }, }, schedule: { - terms: { field: 'task.schedule.interval' }, + terms: { field: 'task.schedule.interval', size: 100 }, }, nonRecurringTasks: { missing: { field: 'task.schedule' }, diff --git a/x-pack/plugins/task_manager/server/plugin.ts b/x-pack/plugins/task_manager/server/plugin.ts index e4cf8730f6dbc..275f1e845bcd8 100644 --- a/x-pack/plugins/task_manager/server/plugin.ts +++ b/x-pack/plugins/task_manager/server/plugin.ts @@ -18,21 +18,25 @@ import { ServiceStatusLevels, CoreStatus, } from '@kbn/core/server'; +import type { SavedObjectsBulkDeleteResponse } from '@kbn/core/server'; import { TaskPollingLifecycle } from './polling_lifecycle'; import { TaskManagerConfig } from './config'; import { createInitialMiddleware, addMiddlewareToChain, Middleware } from './lib/middleware'; import { removeIfExists } from './lib/remove_if_exists'; +import { bulkRemoveIfExist } from './lib/bulk_remove_if_exist'; import { setupSavedObjects } from './saved_objects'; import { TaskDefinitionRegistry, TaskTypeDictionary, REMOVED_TYPES } from './task_type_dictionary'; import { AggregationOpts, FetchResult, SearchOpts, TaskStore } from './task_store'; import { createManagedConfiguration } from './lib/create_managed_configuration'; import { TaskScheduling } from './task_scheduling'; -import { healthRoute } from './routes'; +import { backgroundTaskUtilizationRoute, healthRoute } from './routes'; import { createMonitoringStats, MonitoringStats } from './monitoring'; import { EphemeralTaskLifecycle } from './ephemeral_task_lifecycle'; import { EphemeralTask, ConcreteTaskInstance } from './task'; import { registerTaskManagerUsageCollector } from './usage'; import { TASK_MANAGER_INDEX } from './constants'; +import { AdHocTaskCounter } from './lib/adhoc_task_counter'; + export interface TaskManagerSetupContract { /** * @deprecated @@ -59,7 +63,12 @@ export type TaskManagerStartContract = Pick< > & Pick<TaskStore, 'fetch' | 'aggregate' | 'get' | 'remove'> & { removeIfExists: TaskStore['remove']; - } & { supportsEphemeralTasks: () => boolean }; + } & { + bulkRemoveIfExist: (ids: string[]) => Promise<SavedObjectsBulkDeleteResponse | undefined>; + } & { + supportsEphemeralTasks: () => boolean; + getRegisteredTypes: () => string[]; + }; export class TaskManagerPlugin implements Plugin<TaskManagerSetupContract, TaskManagerStartContract> @@ -76,6 +85,7 @@ export class TaskManagerPlugin private monitoringStats$ = new Subject<MonitoringStats>(); private shouldRunBackgroundTasks: boolean; private readonly kibanaVersion: PluginInitializerContext['env']['packageInfo']['version']; + private adHocTaskCounter: AdHocTaskCounter; constructor(private readonly initContext: PluginInitializerContext) { this.initContext = initContext; @@ -84,6 +94,7 @@ export class TaskManagerPlugin this.definitions = new TaskTypeDictionary(this.logger); this.kibanaVersion = initContext.env.packageInfo.version; this.shouldRunBackgroundTasks = initContext.node.roles.backgroundTasks; + this.adHocTaskCounter = new AdHocTaskCounter(); } public setup( @@ -125,6 +136,18 @@ export class TaskManagerPlugin startServicesPromise.then(({ elasticsearch }) => elasticsearch.client), shouldRunTasks: this.shouldRunBackgroundTasks, }); + const monitoredUtilization$ = backgroundTaskUtilizationRoute({ + router, + monitoringStats$: this.monitoringStats$, + logger: this.logger, + taskManagerId: this.taskManagerId, + config: this.config!, + usageCounter: this.usageCounter!, + kibanaVersion: this.kibanaVersion, + kibanaIndexName: core.savedObjects.getKibanaIndex(), + getClusterClient: () => + startServicesPromise.then(({ elasticsearch }) => elasticsearch.client), + }); core.status.derivedStatus$.subscribe((status) => this.logger.debug(`status core.status.derivedStatus now set to ${status.level}`) @@ -147,6 +170,7 @@ export class TaskManagerPlugin registerTaskManagerUsageCollector( usageCollection, monitoredHealth$, + monitoredUtilization$, this.config.ephemeral_tasks.enabled, this.config.ephemeral_tasks.request_capacity, this.config.unsafe.exclude_task_types @@ -187,6 +211,7 @@ export class TaskManagerPlugin index: TASK_MANAGER_INDEX, definitions: this.definitions, taskManagerId: `kibana:${this.taskManagerId!}`, + adHocTaskCounter: this.adHocTaskCounter, }); const managedConfiguration = createManagedConfiguration({ @@ -229,6 +254,7 @@ export class TaskManagerPlugin this.config!, managedConfiguration, this.logger, + this.adHocTaskCounter, this.taskPollingLifecycle, this.ephemeralTaskLifecycle ).subscribe((stat) => this.monitoringStats$.next(stat)); @@ -248,6 +274,7 @@ export class TaskManagerPlugin taskStore.aggregate(opts), get: (id: string) => taskStore.get(id), remove: (id: string) => taskStore.remove(id), + bulkRemoveIfExist: (ids: string[]) => bulkRemoveIfExist(taskStore, ids), removeIfExists: (id: string) => removeIfExists(taskStore, id), schedule: (...args) => taskScheduling.schedule(...args), bulkSchedule: (...args) => taskScheduling.bulkSchedule(...args), @@ -259,6 +286,7 @@ export class TaskManagerPlugin ephemeralRunNow: (task: EphemeralTask) => taskScheduling.ephemeralRunNow(task), supportsEphemeralTasks: () => this.config.ephemeral_tasks.enabled && this.shouldRunBackgroundTasks, + getRegisteredTypes: () => this.definitions.getAllTypes(), }; } diff --git a/x-pack/plugins/task_manager/server/polling/delay_on_claim_conflicts.test.ts b/x-pack/plugins/task_manager/server/polling/delay_on_claim_conflicts.test.ts index cdfebd1156c55..c57c1b2b7bbc3 100644 --- a/x-pack/plugins/task_manager/server/polling/delay_on_claim_conflicts.test.ts +++ b/x-pack/plugins/task_manager/server/polling/delay_on_claim_conflicts.test.ts @@ -16,7 +16,7 @@ import { TaskLifecycleEvent } from '../polling_lifecycle'; import { FillPoolResult } from '../lib/fill_pool'; describe('delayOnClaimConflicts', () => { - beforeEach(() => jest.useFakeTimers()); + beforeEach(() => jest.useFakeTimers('legacy')); test( 'initializes with a delay of 0', diff --git a/x-pack/plugins/task_manager/server/polling/task_poller.test.ts b/x-pack/plugins/task_manager/server/polling/task_poller.test.ts index f01ea2f018cb9..396cef0cfa7a6 100644 --- a/x-pack/plugins/task_manager/server/polling/task_poller.test.ts +++ b/x-pack/plugins/task_manager/server/polling/task_poller.test.ts @@ -14,7 +14,7 @@ import { loggingSystemMock } from '@kbn/core/server/mocks'; import { asOk, asErr } from '../lib/result_type'; describe('TaskPoller', () => { - beforeEach(() => jest.useFakeTimers()); + beforeEach(() => jest.useFakeTimers('legacy')); test( 'intializes the poller with the provided interval', diff --git a/x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts b/x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts new file mode 100644 index 0000000000000..a10952ddd0463 --- /dev/null +++ b/x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts @@ -0,0 +1,206 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { of, Subject } from 'rxjs'; +import uuid from 'uuid'; +import { httpServiceMock } from '@kbn/core/server/mocks'; +import { mockHandlerArguments } from './_mock_handler_arguments'; +import { sleep } from '../test_utils'; +import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; +import { usageCountersServiceMock } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counters_service.mock'; +import { MonitoringStats } from '../monitoring'; +import { configSchema, TaskManagerConfig } from '../config'; +import { backgroundTaskUtilizationRoute } from './background_task_utilization'; +import { SecurityHasPrivilegesResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; + +const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); +const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + +const createMockClusterClient = (response: SecurityHasPrivilegesResponse) => { + const mockScopedClusterClient = elasticsearchServiceMock.createScopedClusterClient(); + mockScopedClusterClient.asCurrentUser.security.hasPrivileges.mockResponse(response); + + const mockClusterClient = elasticsearchServiceMock.createClusterClient(); + mockClusterClient.asScoped.mockReturnValue(mockScopedClusterClient); + + return { mockClusterClient, mockScopedClusterClient }; +}; + +describe('backgroundTaskUtilizationRoute', () => { + const logger = loggingSystemMock.create().get(); + + beforeEach(() => { + jest.resetAllMocks(); + }); + + it('registers the route', async () => { + const router = httpServiceMock.createRouter(); + backgroundTaskUtilizationRoute({ + router, + monitoringStats$: of(), + logger, + taskManagerId: uuid.v4(), + config: getTaskManagerConfig(), + kibanaVersion: '8.0', + kibanaIndexName: '.kibana', + getClusterClient: () => Promise.resolve(elasticsearchServiceMock.createClusterClient()), + usageCounter: mockUsageCounter, + }); + + const [config] = router.get.mock.calls[0]; + + expect(config.path).toMatchInlineSnapshot( + `"/internal/task_manager/_background_task_utilization"` + ); + }); + + it('checks user privileges and increments usage counter when API is accessed', async () => { + const { mockClusterClient, mockScopedClusterClient } = createMockClusterClient({ + has_all_requested: false, + } as SecurityHasPrivilegesResponse); + const router = httpServiceMock.createRouter(); + backgroundTaskUtilizationRoute({ + router, + monitoringStats$: of(), + logger, + taskManagerId: uuid.v4(), + config: getTaskManagerConfig(), + kibanaVersion: '8.0', + kibanaIndexName: 'foo', + getClusterClient: () => Promise.resolve(mockClusterClient), + usageCounter: mockUsageCounter, + }); + + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({}, {}, ['ok']); + await handler(context, req, res); + + expect(mockScopedClusterClient.asCurrentUser.security.hasPrivileges).toHaveBeenCalledWith({ + body: { + application: [ + { + application: `kibana-foo`, + resources: ['*'], + privileges: [`api:8.0:taskManager`], + }, + ], + }, + }); + expect(mockUsageCounter.incrementCounter).toHaveBeenCalledTimes(1); + expect(mockUsageCounter.incrementCounter).toHaveBeenNthCalledWith(1, { + counterName: `taskManagerBackgroundTaskUtilApiAccess`, + counterType: 'taskManagerBackgroundTaskUtilApi', + incrementBy: 1, + }); + }); + + it('checks user privileges and increments admin usage counter when API is accessed when user has access to task manager feature', async () => { + const { mockClusterClient, mockScopedClusterClient } = createMockClusterClient({ + has_all_requested: true, + } as SecurityHasPrivilegesResponse); + const router = httpServiceMock.createRouter(); + backgroundTaskUtilizationRoute({ + router, + monitoringStats$: of(), + logger, + taskManagerId: uuid.v4(), + config: getTaskManagerConfig(), + kibanaVersion: '8.0', + kibanaIndexName: 'foo', + getClusterClient: () => Promise.resolve(mockClusterClient), + usageCounter: mockUsageCounter, + }); + + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({}, {}, ['ok']); + await handler(context, req, res); + + expect(mockScopedClusterClient.asCurrentUser.security.hasPrivileges).toHaveBeenCalledWith({ + body: { + application: [ + { + application: `kibana-foo`, + resources: ['*'], + privileges: [`api:8.0:taskManager`], + }, + ], + }, + }); + + expect(mockUsageCounter.incrementCounter).toHaveBeenCalledTimes(2); + expect(mockUsageCounter.incrementCounter).toHaveBeenNthCalledWith(1, { + counterName: `taskManagerBackgroundTaskUtilApiAccess`, + counterType: 'taskManagerBackgroundTaskUtilApi', + incrementBy: 1, + }); + expect(mockUsageCounter.incrementCounter).toHaveBeenNthCalledWith(2, { + counterName: `taskManagerBackgroundTaskUtilApiAdminAccess`, + counterType: 'taskManagerBackgroundTaskUtilApi', + incrementBy: 1, + }); + }); + + it('skips checking user privileges if usage counter is undefined', async () => { + const { mockClusterClient, mockScopedClusterClient } = createMockClusterClient({ + has_all_requested: false, + } as SecurityHasPrivilegesResponse); + const router = httpServiceMock.createRouter(); + backgroundTaskUtilizationRoute({ + router, + monitoringStats$: of(), + logger, + taskManagerId: uuid.v4(), + config: getTaskManagerConfig(), + kibanaVersion: '8.0', + kibanaIndexName: 'foo', + getClusterClient: () => Promise.resolve(mockClusterClient), + }); + + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({}, {}, ['ok']); + await handler(context, req, res); + + expect(mockScopedClusterClient.asCurrentUser.security.hasPrivileges).not.toHaveBeenCalled(); + }); + + it(`logs an error if the utilization stats are null`, async () => { + const router = httpServiceMock.createRouter(); + const stats$ = new Subject<MonitoringStats>(); + const id = uuid.v4(); + backgroundTaskUtilizationRoute({ + router, + monitoringStats$: stats$, + logger, + taskManagerId: id, + config: getTaskManagerConfig(), + kibanaVersion: '8.0', + kibanaIndexName: '.kibana', + getClusterClient: () => Promise.resolve(elasticsearchServiceMock.createClusterClient()), + usageCounter: mockUsageCounter, + }); + + stats$.next({ stats: {} } as MonitoringStats); + await sleep(1001); + + expect(logger.debug).toHaveBeenNthCalledWith( + 1, + 'Unable to get Task Manager background task utilization metrics.' + ); + }); +}); + +const getTaskManagerConfig = (overrides: Partial<TaskManagerConfig> = {}) => + configSchema.validate( + overrides.monitored_stats_required_freshness + ? { + // use `monitored_stats_required_freshness` as poll interval otherwise we might + // fail validation as it must be greather than the poll interval + poll_interval: overrides.monitored_stats_required_freshness, + ...overrides, + } + : overrides + ); diff --git a/x-pack/plugins/task_manager/server/routes/background_task_utilization.ts b/x-pack/plugins/task_manager/server/routes/background_task_utilization.ts new file mode 100644 index 0000000000000..a5ceaf5e5ca77 --- /dev/null +++ b/x-pack/plugins/task_manager/server/routes/background_task_utilization.ts @@ -0,0 +1,149 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + IRouter, + RequestHandlerContext, + KibanaRequest, + IKibanaResponse, + KibanaResponseFactory, + Logger, +} from '@kbn/core/server'; +import { IClusterClient } from '@kbn/core/server'; +import { Observable, Subject } from 'rxjs'; +import { throttleTime, tap, map } from 'rxjs/operators'; +import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import { MonitoringStats } from '../monitoring'; +import { TaskManagerConfig } from '../config'; +import { + SummarizedBackgroundTaskUtilizationStat, + summarizeUtilizationStats, +} from '../monitoring/background_task_utilization_statistics'; +import { MonitoredStat } from '../monitoring/monitoring_stats_stream'; + +export interface MonitoredUtilization { + process_uuid: string; + timestamp: string; + last_update: string; + stats: MonitoredStat<SummarizedBackgroundTaskUtilizationStat> | null; +} + +export interface BackgroundTaskUtilRouteParams { + router: IRouter; + monitoringStats$: Observable<MonitoringStats>; + logger: Logger; + taskManagerId: string; + config: TaskManagerConfig; + kibanaVersion: string; + kibanaIndexName: string; + getClusterClient: () => Promise<IClusterClient>; + usageCounter?: UsageCounter; +} + +export function backgroundTaskUtilizationRoute( + params: BackgroundTaskUtilRouteParams +): Observable<MonitoredUtilization> { + const { + router, + monitoringStats$, + logger, + taskManagerId, + config, + kibanaVersion, + kibanaIndexName, + getClusterClient, + usageCounter, + } = params; + + const requiredHotStatsFreshness: number = config.monitored_stats_required_freshness; + + function getBackgroundTaskUtilization(monitoredStats: MonitoringStats) { + const summarizedStats = summarizeUtilizationStats({ + last_update: monitoredStats.last_update, + stats: monitoredStats.stats.utilization, + }); + const now = Date.now(); + const timestamp = new Date(now).toISOString(); + return { process_uuid: taskManagerId, timestamp, ...summarizedStats }; + } + + const monitoredUtilization$: Subject<MonitoredUtilization> = new Subject<MonitoredUtilization>(); + /* keep track of last utilization summary, as we'll return that to the next call to _background_task_utilization */ + let lastMonitoredStats: MonitoringStats | null = null; + + monitoringStats$ + .pipe( + throttleTime(requiredHotStatsFreshness), + tap((stats) => { + lastMonitoredStats = stats; + }), + // Only calculate the summarized stats (calculates all running averages and evaluates state) + // when needed by throttling down to the requiredHotStatsFreshness + map((stats) => getBackgroundTaskUtilization(stats)) + ) + .subscribe((utilizationStats) => { + monitoredUtilization$.next(utilizationStats); + if (utilizationStats.stats == null) { + logger.debug('Unable to get Task Manager background task utilization metrics.'); + } + }); + + router.get( + { + path: '/internal/task_manager/_background_task_utilization', + // Uncomment when we determine that we can restrict API usage to Global admins based on telemetry + // options: { tags: ['access:taskManager'] }, + validate: false, + }, + async function ( + context: RequestHandlerContext, + req: KibanaRequest<unknown, unknown, unknown>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse> { + // If we are able to count usage, we want to check whether the user has access to + // the `taskManager` feature, which is only available as part of the Global All privilege. + if (usageCounter) { + const clusterClient = await getClusterClient(); + const hasPrivilegesResponse = await clusterClient + .asScoped(req) + .asCurrentUser.security.hasPrivileges({ + body: { + application: [ + { + application: `kibana-${kibanaIndexName}`, + resources: ['*'], + privileges: [`api:${kibanaVersion}:taskManager`], + }, + ], + }, + }); + + // Keep track of total access vs admin access + usageCounter.incrementCounter({ + counterName: `taskManagerBackgroundTaskUtilApiAccess`, + counterType: 'taskManagerBackgroundTaskUtilApi', + incrementBy: 1, + }); + if (hasPrivilegesResponse.has_all_requested) { + usageCounter.incrementCounter({ + counterName: `taskManagerBackgroundTaskUtilApiAdminAccess`, + counterType: 'taskManagerBackgroundTaskUtilApi', + incrementBy: 1, + }); + } + } + + return res.ok({ + body: lastMonitoredStats + ? getBackgroundTaskUtilization(lastMonitoredStats) + : { process_uuid: taskManagerId, timestamp: new Date().toISOString(), stats: {} }, + }); + } + ); + + return monitoredUtilization$; +} diff --git a/x-pack/plugins/task_manager/server/routes/index.ts b/x-pack/plugins/task_manager/server/routes/index.ts index a3b39bc8eb752..f3ba539323f8e 100644 --- a/x-pack/plugins/task_manager/server/routes/index.ts +++ b/x-pack/plugins/task_manager/server/routes/index.ts @@ -6,3 +6,4 @@ */ export { healthRoute } from './health'; +export { backgroundTaskUtilizationRoute } from './background_task_utilization'; diff --git a/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts b/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts index a9c58b1302f56..b66f4bc418640 100644 --- a/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts +++ b/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts @@ -28,6 +28,7 @@ import apm from 'elastic-apm-node'; import { executionContextServiceMock } from '@kbn/core/server/mocks'; import { usageCountersServiceMock } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counters_service.mock'; import { + calculateDelay, TASK_MANAGER_RUN_TRANSACTION_TYPE, TASK_MANAGER_TRANSACTION_TYPE, TASK_MANAGER_TRANSACTION_TYPE_MARK_AS_RUNNING, @@ -300,9 +301,8 @@ describe('TaskManagerRunner', () => { expect(instance.attempts).toEqual(initialAttempts + 1); expect(instance.status).toBe('running'); expect(instance.startedAt!.getTime()).toEqual(Date.now()); - expect(instance.retryAt!.getTime()).toEqual( - minutesFromNow((initialAttempts + 1) * 5).getTime() + timeoutMinutes * 60 * 1000 - ); + const expectedRunAt = Date.now() + calculateDelay(initialAttempts + 1); + expect(instance.retryAt!.getTime()).toEqual(expectedRunAt + timeoutMinutes * 60 * 1000); expect(instance.enabled).not.toBeDefined(); }); @@ -569,7 +569,7 @@ describe('TaskManagerRunner', () => { sinon.assert.calledWith(getRetryStub, initialAttempts + 1); const instance = store.update.mock.calls[0][0]; - const attemptDelay = (initialAttempts + 1) * 5 * 60 * 1000; + const attemptDelay = calculateDelay(initialAttempts + 1); const timeoutDelay = timeoutMinutes * 60 * 1000; expect(instance.retryAt!.getTime()).toEqual( new Date(Date.now() + attemptDelay + timeoutDelay).getTime() @@ -817,7 +817,8 @@ describe('TaskManagerRunner', () => { const instance = store.update.mock.calls[0][0]; expect(instance.id).toEqual(id); - expect(instance.runAt.getTime()).toEqual(minutesFromNow(initialAttempts * 5).getTime()); + const expectedRunAt = new Date(Date.now() + calculateDelay(initialAttempts)); + expect(instance.runAt.getTime()).toEqual(expectedRunAt.getTime()); expect(instance.params).toEqual({ a: 'b' }); expect(instance.state).toEqual({ hey: 'there' }); expect(instance.enabled).not.toBeDefined(); @@ -1169,7 +1170,7 @@ describe('TaskManagerRunner', () => { sinon.assert.calledWith(getRetryStub, initialAttempts, error); const instance = store.update.mock.calls[0][0]; - const expectedRunAt = new Date(Date.now() + initialAttempts * 5 * 60 * 1000); + const expectedRunAt = new Date(Date.now() + calculateDelay(initialAttempts)); expect(instance.runAt.getTime()).toEqual(expectedRunAt.getTime()); expect(instance.enabled).not.toBeDefined(); }); diff --git a/x-pack/plugins/task_manager/server/task_running/task_runner.ts b/x-pack/plugins/task_manager/server/task_running/task_runner.ts index a5865abc46bbe..d2038621d6dbe 100644 --- a/x-pack/plugins/task_manager/server/task_running/task_runner.ts +++ b/x-pack/plugins/task_manager/server/task_running/task_runner.ts @@ -53,8 +53,6 @@ import { import { TaskTypeDictionary } from '../task_type_dictionary'; import { isUnrecoverableError } from './errors'; import type { EventLoopDelayConfig } from '../config'; - -const defaultBackoffPerFailure = 5 * 60 * 1000; export const EMPTY_RUN_RESULT: SuccessfulRunResult = { state: {} }; export const TASK_MANAGER_RUN_TRANSACTION_TYPE = 'task-run'; @@ -654,7 +652,7 @@ export class TaskManagerRunner implements TaskRunner { if (retry instanceof Date) { result = retry; } else if (retry === true) { - result = new Date(Date.now() + attempts * defaultBackoffPerFailure); + result = new Date(Date.now() + calculateDelay(attempts)); } // Add a duration to the result @@ -717,3 +715,13 @@ export function asRan(task: InstanceOf<TaskRunningStage.RAN, RanTask>): RanTask task, }; } + +export function calculateDelay(attempts: number) { + if (attempts === 1) { + return 30 * 1000; // 30s + } else { + // get multiples of 5 min + const defaultBackoffPerFailure = 5 * 60 * 1000; + return defaultBackoffPerFailure * Math.pow(2, attempts - 2); + } +} diff --git a/x-pack/plugins/task_manager/server/task_store.mock.ts b/x-pack/plugins/task_manager/server/task_store.mock.ts index 4e9c5dda39527..cc9aac708b2de 100644 --- a/x-pack/plugins/task_manager/server/task_store.mock.ts +++ b/x-pack/plugins/task_manager/server/task_store.mock.ts @@ -20,6 +20,7 @@ export const taskStoreMock = { schedule: jest.fn(), bulkSchedule: jest.fn(), bulkUpdate: jest.fn(), + bulkRemove: jest.fn(), get: jest.fn(), getLifecycle: jest.fn(), fetch: jest.fn(), diff --git a/x-pack/plugins/task_manager/server/task_store.test.ts b/x-pack/plugins/task_manager/server/task_store.test.ts index 561d4ac6a0989..dfc21a7142ece 100644 --- a/x-pack/plugins/task_manager/server/task_store.test.ts +++ b/x-pack/plugins/task_manager/server/task_store.test.ts @@ -21,9 +21,13 @@ import { savedObjectsRepositoryMock } from '@kbn/core/server/mocks'; import { SavedObjectAttributes, SavedObjectsErrorHelpers } from '@kbn/core/server'; import { TaskTypeDictionary } from './task_type_dictionary'; import { mockLogger } from './test_utils'; +import { AdHocTaskCounter } from './lib/adhoc_task_counter'; const savedObjectsClient = savedObjectsRepositoryMock.create(); const serializer = savedObjectsServiceMock.createSerializer(); +const adHocTaskCounter = new AdHocTaskCounter(); + +const randomId = () => `id-${_.random(1, 20)}`; beforeEach(() => jest.resetAllMocks()); @@ -67,9 +71,14 @@ describe('TaskStore', () => { esClient: elasticsearchServiceMock.createClusterClient().asInternalUser, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); }); + afterEach(() => { + adHocTaskCounter.reset(); + }); + async function testSchedule(task: unknown) { savedObjectsClient.create.mockImplementation(async (type: string, attributes: unknown) => ({ id: 'testid', @@ -187,6 +196,31 @@ describe('TaskStore', () => { await expect(store.schedule(task)).rejects.toThrowErrorMatchingInlineSnapshot(`"Failure"`); expect(await firstErrorPromise).toMatchInlineSnapshot(`[Error: Failure]`); }); + + test('increments adHocTaskCounter', async () => { + const task: TaskInstance = { + id: 'id', + params: { hello: 'world' }, + state: { foo: 'bar' }, + taskType: 'report', + }; + + await testSchedule(task); + expect(adHocTaskCounter.count).toEqual(1); + }); + + test('does not increment adHocTaskCounter if the task is recurring', async () => { + const task: TaskInstance = { + id: 'id', + params: { hello: 'world' }, + state: { foo: 'bar' }, + taskType: 'report', + schedule: { interval: '1m' }, + }; + + await testSchedule(task); + expect(adHocTaskCounter.count).toEqual(0); + }); }); describe('fetch', () => { @@ -202,6 +236,7 @@ describe('TaskStore', () => { esClient, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); }); @@ -270,6 +305,7 @@ describe('TaskStore', () => { esClient, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); }); @@ -367,6 +403,7 @@ describe('TaskStore', () => { esClient, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); }); @@ -469,6 +506,7 @@ describe('TaskStore', () => { esClient: elasticsearchServiceMock.createClusterClient().asInternalUser, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); }); @@ -509,6 +547,7 @@ describe('TaskStore', () => { esClient: elasticsearchServiceMock.createClusterClient().asInternalUser, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); }); @@ -529,6 +568,42 @@ describe('TaskStore', () => { }); }); + describe('bulkRemove', () => { + let store: TaskStore; + + const tasksIdsToDelete = [randomId(), randomId()]; + + beforeAll(() => { + store = new TaskStore({ + index: 'tasky', + taskManagerId: '', + serializer, + esClient: elasticsearchServiceMock.createClusterClient().asInternalUser, + definitions: taskDefinitions, + savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, + }); + }); + + test('removes the tasks with the specified ids', async () => { + const result = await store.bulkRemove(tasksIdsToDelete); + expect(result).toBeUndefined(); + expect(savedObjectsClient.bulkDelete).toHaveBeenCalledWith([ + { type: 'task', id: tasksIdsToDelete[0] }, + { type: 'task', id: tasksIdsToDelete[1] }, + ]); + }); + + test('pushes error from saved objects client to errors$', async () => { + const firstErrorPromise = store.errors$.pipe(first()).toPromise(); + savedObjectsClient.bulkDelete.mockRejectedValue(new Error('Failure')); + await expect(store.bulkRemove(tasksIdsToDelete)).rejects.toThrowErrorMatchingInlineSnapshot( + `"Failure"` + ); + expect(await firstErrorPromise).toMatchInlineSnapshot(`[Error: Failure]`); + }); + }); + describe('get', () => { let store: TaskStore; @@ -540,6 +615,7 @@ describe('TaskStore', () => { esClient: elasticsearchServiceMock.createClusterClient().asInternalUser, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); }); @@ -624,6 +700,7 @@ describe('TaskStore', () => { esClient: elasticsearchServiceMock.createClusterClient().asInternalUser, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); expect(await store.getLifecycle(task.id)).toEqual(status); @@ -643,6 +720,7 @@ describe('TaskStore', () => { esClient: elasticsearchServiceMock.createClusterClient().asInternalUser, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); expect(await store.getLifecycle(randomId())).toEqual(TaskLifecycleResult.NotFound); @@ -660,6 +738,7 @@ describe('TaskStore', () => { esClient: elasticsearchServiceMock.createClusterClient().asInternalUser, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); return expect(store.getLifecycle(randomId())).rejects.toThrow('Bad Request'); @@ -677,9 +756,14 @@ describe('TaskStore', () => { esClient: elasticsearchServiceMock.createClusterClient().asInternalUser, definitions: taskDefinitions, savedObjectsRepository: savedObjectsClient, + adHocTaskCounter, }); }); + afterEach(() => { + adHocTaskCounter.reset(); + }); + async function testBulkSchedule(task: unknown) { savedObjectsClient.bulkCreate.mockImplementation(async () => ({ saved_objects: [ @@ -800,7 +884,30 @@ describe('TaskStore', () => { ); expect(await firstErrorPromise).toMatchInlineSnapshot(`[Error: Failure]`); }); + + test('increments adHocTaskCounter', async () => { + const task: TaskInstance = { + id: 'id', + params: { hello: 'world' }, + state: { foo: 'bar' }, + taskType: 'report', + }; + + const result = await testBulkSchedule([task]); + expect(adHocTaskCounter.count).toEqual(result.length); + }); + + test('does not increment adHocTaskCounter if the task is recurring', async () => { + const task: TaskInstance = { + id: 'id', + params: { hello: 'world' }, + state: { foo: 'bar' }, + taskType: 'report', + schedule: { interval: '1m' }, + }; + + await testBulkSchedule([task]); + expect(adHocTaskCounter.count).toEqual(0); + }); }); }); - -const randomId = () => `id-${_.random(1, 20)}`; diff --git a/x-pack/plugins/task_manager/server/task_store.ts b/x-pack/plugins/task_manager/server/task_store.ts index 5d1a7246440f4..e810ea5c1ef3e 100644 --- a/x-pack/plugins/task_manager/server/task_store.ts +++ b/x-pack/plugins/task_manager/server/task_store.ts @@ -9,9 +9,10 @@ * This module contains helpers for managing the task manager storage layer. */ import { Subject } from 'rxjs'; -import { omit, defaults } from 'lodash'; +import { omit, defaults, get } from 'lodash'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type { SavedObjectsBulkDeleteResponse } from '@kbn/core/server'; import { SavedObject, @@ -33,6 +34,7 @@ import { } from './task'; import { TaskTypeDictionary } from './task_type_dictionary'; +import { AdHocTaskCounter } from './lib/adhoc_task_counter'; export interface StoreOpts { esClient: ElasticsearchClient; @@ -41,6 +43,7 @@ export interface StoreOpts { definitions: TaskTypeDictionary; savedObjectsRepository: ISavedObjectsRepository; serializer: ISavedObjectsSerializer; + adHocTaskCounter: AdHocTaskCounter; } export interface SearchOpts { @@ -94,6 +97,7 @@ export class TaskStore { private definitions: TaskTypeDictionary; private savedObjectsRepository: ISavedObjectsRepository; private serializer: ISavedObjectsSerializer; + private adHocTaskCounter: AdHocTaskCounter; /** * Constructs a new TaskStore. @@ -111,6 +115,7 @@ export class TaskStore { this.definitions = opts.definitions; this.serializer = opts.serializer; this.savedObjectsRepository = opts.savedObjectsRepository; + this.adHocTaskCounter = opts.adHocTaskCounter; } /** @@ -139,6 +144,9 @@ export class TaskStore { taskInstanceToAttributes(taskInstance), { id: taskInstance.id, refresh: false } ); + if (get(taskInstance, 'schedule.interval', null) == null) { + this.adHocTaskCounter.increment(); + } } catch (e) { this.errors$.next(e); throw e; @@ -168,6 +176,11 @@ export class TaskStore { objects, { refresh: false } ); + this.adHocTaskCounter.increment( + taskInstances.filter((task) => { + return get(task, 'schedule.interval', null) == null; + }).length + ); } catch (e) { this.errors$.next(e); throw e; @@ -294,6 +307,22 @@ export class TaskStore { } } + /** + * Bulk removes the specified tasks from the index. + * + * @param {SavedObjectsBulkDeleteObject[]} savedObjectsToDelete + * @returns {Promise<SavedObjectsBulkDeleteResponse>} + */ + public async bulkRemove(taskIds: string[]): Promise<SavedObjectsBulkDeleteResponse> { + try { + const savedObjectsToDelete = taskIds.map((taskId) => ({ id: taskId, type: 'task' })); + return await this.savedObjectsRepository.bulkDelete(savedObjectsToDelete); + } catch (e) { + this.errors$.next(e); + throw e; + } + } + /** * Gets a task by id * diff --git a/x-pack/plugins/task_manager/server/usage/task_manager_usage_collector.test.ts b/x-pack/plugins/task_manager/server/usage/task_manager_usage_collector.test.ts index 9fdd0c4988575..7931de8aaa48e 100644 --- a/x-pack/plugins/task_manager/server/usage/task_manager_usage_collector.test.ts +++ b/x-pack/plugins/task_manager/server/usage/task_manager_usage_collector.test.ts @@ -18,6 +18,7 @@ import { TaskPersistence } from '../task_events'; import { registerTaskManagerUsageCollector } from './task_manager_usage_collector'; import { sleep } from '../test_utils'; import { TaskManagerUsage } from './types'; +import { MonitoredUtilization } from '../routes/background_task_utilization'; describe('registerTaskManagerUsageCollector', () => { let collector: Collector<unknown>; @@ -25,6 +26,7 @@ describe('registerTaskManagerUsageCollector', () => { it('should report telemetry on the ephemeral queue', async () => { const monitoringStats$ = new Subject<MonitoredHealth>(); + const monitoringUtilization$ = new Subject<MonitoredUtilization>(); const usageCollectionMock = createUsageCollectionSetupMock(); const fetchContext = createCollectorFetchContextMock(); usageCollectionMock.makeUsageCollector.mockImplementation((config) => { @@ -32,10 +34,19 @@ describe('registerTaskManagerUsageCollector', () => { return createUsageCollectionSetupMock().makeUsageCollector(config); }); - registerTaskManagerUsageCollector(usageCollectionMock, monitoringStats$, true, 10, []); + registerTaskManagerUsageCollector( + usageCollectionMock, + monitoringStats$, + monitoringUtilization$, + true, + 10, + [] + ); const mockHealth = getMockMonitoredHealth(); monitoringStats$.next(mockHealth); + const mockUtilization = getMockMonitoredUtilization(); + monitoringUtilization$.next(mockUtilization); await sleep(1001); expect(usageCollectionMock.makeUsageCollector).toBeCalled(); @@ -52,6 +63,7 @@ describe('registerTaskManagerUsageCollector', () => { it('should report telemetry on the excluded task types', async () => { const monitoringStats$ = new Subject<MonitoredHealth>(); + const monitoringUtilization$ = new Subject<MonitoredUtilization>(); const usageCollectionMock = createUsageCollectionSetupMock(); const fetchContext = createCollectorFetchContextMock(); usageCollectionMock.makeUsageCollector.mockImplementation((config) => { @@ -59,18 +71,92 @@ describe('registerTaskManagerUsageCollector', () => { return createUsageCollectionSetupMock().makeUsageCollector(config); }); - registerTaskManagerUsageCollector(usageCollectionMock, monitoringStats$, true, 10, [ - 'actions:*', - ]); + registerTaskManagerUsageCollector( + usageCollectionMock, + monitoringStats$, + monitoringUtilization$, + true, + 10, + ['actions:*'] + ); const mockHealth = getMockMonitoredHealth(); monitoringStats$.next(mockHealth); + const mockUtilization = getMockMonitoredUtilization(); + monitoringUtilization$.next(mockUtilization); await sleep(1001); expect(usageCollectionMock.makeUsageCollector).toBeCalled(); const telemetry: TaskManagerUsage = (await collector.fetch(fetchContext)) as TaskManagerUsage; expect(telemetry.task_type_exclusion).toEqual(['actions:*']); }); + + it('should report telemetry on background task utilization', async () => { + const monitoringStats$ = new Subject<MonitoredHealth>(); + const monitoringUtilization$ = new Subject<MonitoredUtilization>(); + const usageCollectionMock = createUsageCollectionSetupMock(); + const fetchContext = createCollectorFetchContextMock(); + usageCollectionMock.makeUsageCollector.mockImplementation((config) => { + collector = new Collector(logger, config); + return createUsageCollectionSetupMock().makeUsageCollector(config); + }); + + registerTaskManagerUsageCollector( + usageCollectionMock, + monitoringStats$, + monitoringUtilization$, + true, + 10, + ['actions:*'] + ); + + const mockHealth = getMockMonitoredHealth(); + monitoringStats$.next(mockHealth); + const mockUtilization = getMockMonitoredUtilization(); + monitoringUtilization$.next(mockUtilization); + await sleep(1001); + + expect(usageCollectionMock.makeUsageCollector).toBeCalled(); + const telemetry: TaskManagerUsage = (await collector.fetch(fetchContext)) as TaskManagerUsage; + expect(telemetry.recurring_tasks).toEqual({ + actual_service_time: mockUtilization.stats?.value.recurring.ran.service_time.actual, + adjusted_service_time: mockUtilization.stats?.value.recurring.ran.service_time.adjusted, + }); + expect(telemetry.adhoc_tasks).toEqual({ + actual_service_time: mockUtilization.stats?.value.adhoc.ran.service_time.actual, + adjusted_service_time: mockUtilization.stats?.value.adhoc.ran.service_time.adjusted, + }); + }); + + it('should report telemetry on capacity', async () => { + const monitoringStats$ = new Subject<MonitoredHealth>(); + const monitoringUtilization$ = new Subject<MonitoredUtilization>(); + const usageCollectionMock = createUsageCollectionSetupMock(); + const fetchContext = createCollectorFetchContextMock(); + usageCollectionMock.makeUsageCollector.mockImplementation((config) => { + collector = new Collector(logger, config); + return createUsageCollectionSetupMock().makeUsageCollector(config); + }); + + registerTaskManagerUsageCollector( + usageCollectionMock, + monitoringStats$, + monitoringUtilization$, + true, + 10, + ['actions:*'] + ); + + const mockHealth = getMockMonitoredHealth(); + monitoringStats$.next(mockHealth); + const mockUtilization = getMockMonitoredUtilization(); + monitoringUtilization$.next(mockUtilization); + await sleep(1001); + + expect(usageCollectionMock.makeUsageCollector).toBeCalled(); + const telemetry: TaskManagerUsage = (await collector.fetch(fetchContext)) as TaskManagerUsage; + expect(telemetry.capacity).toEqual(10); + }); }); function getMockMonitoredHealth(overrides = {}): MonitoredHealth { @@ -187,7 +273,65 @@ function getMockMonitoredHealth(overrides = {}): MonitoredHealth { }, }, }, + capacity_estimation: { + timestamp: new Date().toISOString(), + status: HealthStatus.OK, + value: { + observed: { + observed_kibana_instances: 10, + max_throughput_per_minute: 10, + max_throughput_per_minute_per_kibana: 10, + minutes_to_drain_overdue: 10, + avg_required_throughput_per_minute: 10, + avg_required_throughput_per_minute_per_kibana: 10, + avg_recurring_required_throughput_per_minute: 10, + avg_recurring_required_throughput_per_minute_per_kibana: 10, + }, + proposed: { + provisioned_kibana: 10, + min_required_kibana: 10, + avg_recurring_required_throughput_per_minute_per_kibana: 10, + avg_required_throughput_per_minute_per_kibana: 10, + }, + }, + }, }, }; return merge(stub, overrides) as unknown as MonitoredHealth; } + +function getMockMonitoredUtilization(overrides = {}): MonitoredUtilization { + const stub: MonitoredUtilization = { + process_uuid: '1', + timestamp: new Date().toISOString(), + last_update: new Date().toISOString(), + stats: { + timestamp: new Date().toISOString(), + value: { + adhoc: { + created: { + counter: 5, + }, + ran: { + service_time: { + actual: 3000, + adjusted: 2500, + task_counter: 10, + }, + }, + }, + recurring: { + tasks_per_min: 2500, + ran: { + service_time: { + actual: 1000, + adjusted: 2000, + task_counter: 10, + }, + }, + }, + }, + }, + }; + return merge(stub, overrides) as unknown as MonitoredUtilization; +} diff --git a/x-pack/plugins/task_manager/server/usage/task_manager_usage_collector.ts b/x-pack/plugins/task_manager/server/usage/task_manager_usage_collector.ts index 82e9eb95dd760..a4bd3049a0b49 100644 --- a/x-pack/plugins/task_manager/server/usage/task_manager_usage_collector.ts +++ b/x-pack/plugins/task_manager/server/usage/task_manager_usage_collector.ts @@ -4,22 +4,28 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { Observable } from 'rxjs'; +import { combineLatest, Observable } from 'rxjs'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { MonitoredHealth } from '../routes/health'; import { TaskManagerUsage } from './types'; +import { MonitoredUtilization } from '../routes/background_task_utilization'; export function createTaskManagerUsageCollector( usageCollection: UsageCollectionSetup, monitoringStats$: Observable<MonitoredHealth>, + monitoredUtilization$: Observable<MonitoredUtilization>, ephemeralTasksEnabled: boolean, ephemeralRequestCapacity: number, excludeTaskTypes: string[] ) { let lastMonitoredHealth: MonitoredHealth | null = null; - monitoringStats$.subscribe((health) => { - lastMonitoredHealth = health; - }); + let lastMonitoredUtilization: MonitoredUtilization | null = null; + combineLatest([monitoringStats$, monitoredUtilization$]) + .pipe() + .subscribe(([health, utilization]) => { + lastMonitoredHealth = health; + lastMonitoredUtilization = utilization; + }); return usageCollection.makeUsageCollector<TaskManagerUsage>({ type: 'task_manager', @@ -61,6 +67,21 @@ export function createTaskManagerUsageCollector( }, 0 ), + recurring_tasks: { + actual_service_time: + lastMonitoredUtilization?.stats?.value.recurring.ran.service_time.actual ?? 0, + adjusted_service_time: + lastMonitoredUtilization?.stats?.value.recurring.ran.service_time.adjusted ?? 0, + }, + adhoc_tasks: { + actual_service_time: + lastMonitoredUtilization?.stats?.value.adhoc.ran.service_time.actual ?? 0, + adjusted_service_time: + lastMonitoredUtilization?.stats?.value.adhoc.ran.service_time.adjusted ?? 0, + }, + capacity: + lastMonitoredHealth?.stats.capacity_estimation?.value.observed + .max_throughput_per_minute_per_kibana ?? 0, }; }, schema: { @@ -89,6 +110,15 @@ export function createTaskManagerUsageCollector( }, task_type_exclusion: { type: 'array', items: { type: 'keyword' } }, failed_tasks: { type: 'long' }, + recurring_tasks: { + actual_service_time: { type: 'long' }, + adjusted_service_time: { type: 'long' }, + }, + adhoc_tasks: { + actual_service_time: { type: 'long' }, + adjusted_service_time: { type: 'long' }, + }, + capacity: { type: 'long' }, }, }); } @@ -96,6 +126,7 @@ export function createTaskManagerUsageCollector( export function registerTaskManagerUsageCollector( usageCollection: UsageCollectionSetup, monitoringStats$: Observable<MonitoredHealth>, + monitoredUtilization$: Observable<MonitoredUtilization>, ephemeralTasksEnabled: boolean, ephemeralRequestCapacity: number, excludeTaskTypes: string[] @@ -103,6 +134,7 @@ export function registerTaskManagerUsageCollector( const collector = createTaskManagerUsageCollector( usageCollection, monitoringStats$, + monitoredUtilization$, ephemeralTasksEnabled, ephemeralRequestCapacity, excludeTaskTypes diff --git a/x-pack/plugins/task_manager/server/usage/types.ts b/x-pack/plugins/task_manager/server/usage/types.ts index f9ac823a58124..0e98d1d0685a0 100644 --- a/x-pack/plugins/task_manager/server/usage/types.ts +++ b/x-pack/plugins/task_manager/server/usage/types.ts @@ -31,4 +31,13 @@ export interface TaskManagerUsage { }; }; failed_tasks: number; + recurring_tasks: { + actual_service_time: number; + adjusted_service_time: number; + }; + adhoc_tasks: { + actual_service_time: number; + adjusted_service_time: number; + }; + capacity: number; } diff --git a/x-pack/plugins/task_manager/tsconfig.json b/x-pack/plugins/task_manager/tsconfig.json index 42ebd42b4f7a5..cb2a5fb3c8f56 100644 --- a/x-pack/plugins/task_manager/tsconfig.json +++ b/x-pack/plugins/task_manager/tsconfig.json @@ -4,14 +4,13 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "server/**/*", // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 "server/**/*.json", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, 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 5eb2c8d5a5869..6bf88ebf5e53d 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -4991,13 +4991,9 @@ } }, "flags": { - "properties": { - "DYNAMIC_KEY": { - "type": "keyword", - "_meta": { - "description": "Flags received by the client" - } - } + "type": "pass_through", + "_meta": { + "description": "Flags received by the client" } }, "flagNames": { @@ -5116,83 +5112,6 @@ } } }, - "files": { - "properties": { - "countByExtension": { - "type": "array", - "items": { - "properties": { - "extension": { - "type": "keyword" - }, - "count": { - "type": "long" - } - } - } - }, - "countByStatus": { - "properties": { - "AWAITING_UPLOAD": { - "type": "long", - "_meta": { - "description": "Number of files awaiting upload" - } - }, - "DELETED": { - "type": "long", - "_meta": { - "description": "Number of files that are marked as deleted" - } - }, - "READY": { - "type": "long", - "_meta": { - "description": "Number of files that are ready for download" - } - }, - "UPLOADING": { - "type": "long", - "_meta": { - "description": "Number of files that are currently uploading" - } - }, - "UPLOAD_ERROR": { - "type": "long", - "_meta": { - "description": "Number of files that failed to upload" - } - } - } - }, - "storage": { - "properties": { - "esFixedSizeIndex": { - "properties": { - "capacity": { - "type": "long", - "_meta": { - "description": "Capacity of the fixed size index" - } - }, - "available": { - "type": "long", - "_meta": { - "description": "Available storage in bytes" - } - }, - "used": { - "type": "long", - "_meta": { - "description": "Used storage in bytes" - } - } - } - } - } - } - } - }, "fleet": { "properties": { "agents_enabled": { @@ -5695,6 +5614,34 @@ } } }, + "layer_group": { + "properties": { + "min": { + "type": "long", + "_meta": { + "description": "min number of layer groups per map" + } + }, + "max": { + "type": "long", + "_meta": { + "description": "max number of layer groups per map" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "avg number of layer groups per map" + } + }, + "total": { + "type": "long", + "_meta": { + "description": "total number of layer groups in cluster" + } + } + } + }, "ux_tms_mvt": { "properties": { "min": { @@ -13385,6 +13332,29 @@ }, "failed_tasks": { "type": "long" + }, + "recurring_tasks": { + "properties": { + "actual_service_time": { + "type": "long" + }, + "adjusted_service_time": { + "type": "long" + } + } + }, + "adhoc_tasks": { + "properties": { + "actual_service_time": { + "type": "long" + }, + "adjusted_service_time": { + "type": "long" + } + } + }, + "capacity": { + "type": "long" } } }, diff --git a/x-pack/plugins/telemetry_collection_xpack/tsconfig.json b/x-pack/plugins/telemetry_collection_xpack/tsconfig.json index 03ca7efad22a4..6278cbf832236 100644 --- a/x-pack/plugins/telemetry_collection_xpack/tsconfig.json +++ b/x-pack/plugins/telemetry_collection_xpack/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, "isolatedModules": true }, "include": [ @@ -15,7 +14,7 @@ "schema/xpack_plugins.json", "schema/xpack_root.json", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/telemetry_collection_manager/tsconfig.json" }, { "path": "../../../src/plugins/telemetry/tsconfig.json" } diff --git a/x-pack/plugins/threat_intelligence/common/constants.ts b/x-pack/plugins/threat_intelligence/common/constants.ts new file mode 100644 index 0000000000000..e5aa41d8ad2f4 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/common/constants.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 THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME = 'threatIntelligenceSearchStrategy'; + +export const BARCHART_AGGREGATION_NAME = 'barchartAggregation'; + +/** + * Used inside custom search strategy + */ +export const enum FactoryQueryType { + IndicatorGrid = 'indicatorGrid', + Barchart = 'barchart', +} diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/types/indicator.ts b/x-pack/plugins/threat_intelligence/common/types/indicator.ts similarity index 92% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/types/indicator.ts rename to x-pack/plugins/threat_intelligence/common/types/indicator.ts index 823809a7750a0..c742096639990 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/types/indicator.ts +++ b/x-pack/plugins/threat_intelligence/common/types/indicator.ts @@ -100,6 +100,20 @@ export const generateMockIndicator = (): Indicator => { return indicator; }; +/** + * Used to create an Indicator with tlp marking + */ +export const generateMockIndicatorWithTlp = (): Indicator => { + const indicator = generateMockBaseIndicator(); + + indicator.fields['threat.indicator.type'] = ['type']; + indicator.fields['threat.indicator.ip'] = ['0.0.0.0']; + indicator.fields['threat.indicator.name'] = ['0.0.0.0']; + indicator.fields['threat.indicator.marking.tlp'] = ['RED']; + + return indicator; +}; + /** * Used to create a Url Indicator. */ diff --git a/x-pack/plugins/threat_intelligence/cypress/e2e/indicators.cy.ts b/x-pack/plugins/threat_intelligence/cypress/e2e/indicators.cy.ts index 17c4d79e60dcc..4de89a37f8833 100644 --- a/x-pack/plugins/threat_intelligence/cypress/e2e/indicators.cy.ts +++ b/x-pack/plugins/threat_intelligence/cypress/e2e/indicators.cy.ts @@ -53,6 +53,15 @@ describe('Indicators', () => { esArchiverUnload('threat_intelligence'); }); + describe('Indicators page loading', () => { + it('verify the fleet plugin integrations endpoint exists', () => { + cy.request({ + method: 'GET', + url: '/api/fleet/epm/packages', + }).should((response) => expect(response.status).to.eq(200)); + }); + }); + describe('Indicators page basics', () => { before(() => { cy.visit(THREAT_INTELLIGENCE); diff --git a/x-pack/plugins/threat_intelligence/cypress/e2e/query_bar.cy.ts b/x-pack/plugins/threat_intelligence/cypress/e2e/query_bar.cy.ts index e2a0459dc3fd6..4c55a0505d34c 100644 --- a/x-pack/plugins/threat_intelligence/cypress/e2e/query_bar.cy.ts +++ b/x-pack/plugins/threat_intelligence/cypress/e2e/query_bar.cy.ts @@ -6,23 +6,23 @@ */ import { - INDICATOR_TYPE_CELL, - TOGGLE_FLYOUT_BUTTON, - FLYOUT_CLOSE_BUTTON, - KQL_FILTER, - INDICATORS_TABLE_CELL_FILTER_IN_BUTTON, - INDICATORS_TABLE_CELL_FILTER_OUT_BUTTON, - FLYOUT_TABLE_TAB_ROW_FILTER_IN_BUTTON, - FLYOUT_TABLE_TAB_ROW_FILTER_OUT_BUTTON, - BARCHART_POPOVER_BUTTON, BARCHART_FILTER_IN_BUTTON, BARCHART_FILTER_OUT_BUTTON, + BARCHART_POPOVER_BUTTON, + FLYOUT_CLOSE_BUTTON, FLYOUT_OVERVIEW_TAB_BLOCKS_FILTER_IN_BUTTON, FLYOUT_OVERVIEW_TAB_BLOCKS_FILTER_OUT_BUTTON, + FLYOUT_OVERVIEW_TAB_BLOCKS_ITEM, FLYOUT_OVERVIEW_TAB_TABLE_ROW_FILTER_IN_BUTTON, FLYOUT_OVERVIEW_TAB_TABLE_ROW_FILTER_OUT_BUTTON, - FLYOUT_OVERVIEW_TAB_BLOCKS_ITEM, + FLYOUT_TABLE_TAB_ROW_FILTER_IN_BUTTON, + FLYOUT_TABLE_TAB_ROW_FILTER_OUT_BUTTON, FLYOUT_TABS, + INDICATOR_TYPE_CELL, + INDICATORS_TABLE_CELL_FILTER_IN_BUTTON, + INDICATORS_TABLE_CELL_FILTER_OUT_BUTTON, + KQL_FILTER, + TOGGLE_FLYOUT_BUTTON, } from '../screens/indicators'; import { selectRange } from '../tasks/select_range'; import { login } from '../tasks/login'; diff --git a/x-pack/plugins/threat_intelligence/cypress/e2e/timeline.cy.ts b/x-pack/plugins/threat_intelligence/cypress/e2e/timeline.cy.ts index de3d0adf72c81..eb24ecaaa5a5f 100644 --- a/x-pack/plugins/threat_intelligence/cypress/e2e/timeline.cy.ts +++ b/x-pack/plugins/threat_intelligence/cypress/e2e/timeline.cy.ts @@ -9,18 +9,18 @@ import { BARCHART_POPOVER_BUTTON, BARCHART_TIMELINE_BUTTON, FLYOUT_CLOSE_BUTTON, + FLYOUT_OVERVIEW_TAB_BLOCKS_ITEM, + FLYOUT_OVERVIEW_TAB_BLOCKS_TIMELINE_BUTTON, FLYOUT_OVERVIEW_TAB_TABLE_ROW_TIMELINE_BUTTON, FLYOUT_TABLE_TAB_ROW_TIMELINE_BUTTON, FLYOUT_TABS, + INDICATOR_FLYOUT_INVESTIGATE_IN_TIMELINE_BUTTON, INDICATOR_TYPE_CELL, INDICATORS_TABLE_CELL_TIMELINE_BUTTON, + INDICATORS_TABLE_INVESTIGATE_IN_TIMELINE_BUTTON_ICON, TIMELINE_DRAGGABLE_ITEM, TOGGLE_FLYOUT_BUTTON, UNTITLED_TIMELINE_BUTTON, - FLYOUT_OVERVIEW_TAB_BLOCKS_TIMELINE_BUTTON, - FLYOUT_OVERVIEW_TAB_BLOCKS_ITEM, - INDICATORS_TABLE_INVESTIGATE_IN_TIMELINE_BUTTON_ICON, - INDICATOR_FLYOUT_INVESTIGATE_IN_TIMELINE_BUTTON, } from '../screens/indicators'; import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver'; import { login } from '../tasks/login'; diff --git a/x-pack/plugins/threat_intelligence/cypress/tasks/login.ts b/x-pack/plugins/threat_intelligence/cypress/tasks/login.ts index f33034dccb9c5..accbed00a47e9 100644 --- a/x-pack/plugins/threat_intelligence/cypress/tasks/login.ts +++ b/x-pack/plugins/threat_intelligence/cypress/tasks/login.ts @@ -5,8 +5,8 @@ * 2.0. */ -import Url from 'url'; import type { UrlObject } from 'url'; +import Url from 'url'; import * as yaml from 'js-yaml'; diff --git a/x-pack/plugins/threat_intelligence/cypress/tsconfig.json b/x-pack/plugins/threat_intelligence/cypress/tsconfig.json index 55ba3de538060..a0d03c742d07c 100644 --- a/x-pack/plugins/threat_intelligence/cypress/tsconfig.json +++ b/x-pack/plugins/threat_intelligence/cypress/tsconfig.json @@ -17,7 +17,7 @@ "node", ], }, - "references": [ + "kbn_references": [ { "path": "../tsconfig.json" } ] } diff --git a/x-pack/plugins/threat_intelligence/kibana.json b/x-pack/plugins/threat_intelligence/kibana.json index c640782b90f3c..16fcf4eeb5c4c 100644 --- a/x-pack/plugins/threat_intelligence/kibana.json +++ b/x-pack/plugins/threat_intelligence/kibana.json @@ -3,7 +3,7 @@ "version": "1.0.0", "kibanaVersion": "kibana", "ui": true, - "server": false, + "server": true, "owner": { "name": "Protections Experience Team", "githubTeam": "protections-experience" diff --git a/x-pack/plugins/threat_intelligence/public/common/utils/dates.test.ts b/x-pack/plugins/threat_intelligence/public/common/utils/dates.test.ts index 0fba6d4088de0..3f8882a29c988 100644 --- a/x-pack/plugins/threat_intelligence/public/common/utils/dates.test.ts +++ b/x-pack/plugins/threat_intelligence/public/common/utils/dates.test.ts @@ -7,12 +7,7 @@ import moment from 'moment-timezone'; import { TimeRangeBounds } from '@kbn/data-plugin/common'; -import { - barChartTimeAxisLabelFormatter, - calculateBarchartColumnTimeInterval, - dateFormatter, - getDateDifferenceInDays, -} from './dates'; +import { dateFormatter, getDateDifferenceInDays, barChartTimeAxisLabelFormatter } from './dates'; import { EMPTY_VALUE } from '../constants'; const mockValidStringDate = '1 Jan 2022 00:00:00 GMT'; @@ -88,32 +83,4 @@ describe('dates', () => { expect(typeof barChartTimeAxisLabelFormatter(dateRange)).toBe('function'); }); }); - - describe('calculateBarchartTimeInterval', () => { - it('should handle number dates', () => { - const from = moment(mockValidStringDate).valueOf(); - const to = moment(mockValidStringDate).add(1, 'days').valueOf(); - - const interval = calculateBarchartColumnTimeInterval(from, to); - expect(interval).toContain('ms'); - expect(parseInt(interval, 10) > 0).toBeTruthy(); - }); - - it('should handle moment dates', () => { - const from = moment(mockValidStringDate); - const to = moment(mockValidStringDate).add(1, 'days'); - - const interval = calculateBarchartColumnTimeInterval(from, to); - expect(interval).toContain('ms'); - expect(parseInt(interval, 10) > 0).toBeTruthy(); - }); - - it('should handle dateTo older than dateFrom', () => { - const from = moment(mockValidStringDate).add(1, 'days'); - const to = moment(mockValidStringDate); - - const interval = calculateBarchartColumnTimeInterval(from, to); - expect(parseInt(interval, 10) > 0).toBeFalsy(); - }); - }); }); diff --git a/x-pack/plugins/threat_intelligence/public/common/utils/dates.tsx b/x-pack/plugins/threat_intelligence/public/common/utils/dates.tsx index 8adb49b3e95a7..2f5ab5d4c07e2 100644 --- a/x-pack/plugins/threat_intelligence/public/common/utils/dates.tsx +++ b/x-pack/plugins/threat_intelligence/public/common/utils/dates.tsx @@ -14,7 +14,6 @@ import { EMPTY_VALUE } from '../constants'; moment.suppressDeprecationWarnings = true; export const FULL_DATE = 'MMMM Do YYYY @ HH:mm:ss'; -export const BARCHART_NUMBER_OF_COLUMNS = 16; /** * Converts a string or moment date to the 'MMMM Do YYYY @ HH:mm:ss' format. @@ -62,20 +61,3 @@ export const barChartTimeAxisLabelFormatter = (dateRange: TimeRangeBounds): Tick const format = niceTimeFormatByDay(diff); return timeFormatter(format); }; - -/** - * Calculates the time interval in ms for a specific number of columns - * @param dateFrom Min (older) date for the barchart - * @param dateTo Max (newer) date for the barchart - * @param numberOfColumns Desired number of columns (defaulted to {@link BARCHART_NUMBER_OF_COLUMNS}) - * @returns The interval in ms for a column (for example '100000ms') - */ -export const calculateBarchartColumnTimeInterval = ( - dateFrom: number | moment.Moment, - dateTo: number | moment.Moment, - numberOfColumns = BARCHART_NUMBER_OF_COLUMNS -): string => { - const from: number = moment.isMoment(dateFrom) ? dateFrom.valueOf() : dateFrom; - const to: number = moment.isMoment(dateTo) ? dateTo.valueOf() : dateTo; - return `${Math.floor(moment(to).diff(moment(from)) / numberOfColumns)}ms`; -}; diff --git a/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.tsx b/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.tsx index 370c28e8d50f9..e87edb2a35162 100644 --- a/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.tsx +++ b/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.tsx @@ -7,7 +7,8 @@ import React, { FC } from 'react'; import { Paywall } from '../../components/paywall'; -import { useKibana, useSecurityContext } from '../../hooks'; +import { useKibana } from '../../hooks/use_kibana'; +import { useSecurityContext } from '../../hooks/use_security_context'; import { SecuritySolutionPluginTemplateWrapper } from '../security_solution_plugin_template_wrapper'; export const EnterpriseGuard: FC = ({ children }) => { diff --git a/x-pack/plugins/threat_intelligence/public/containers/indicators_page_wrapper.tsx b/x-pack/plugins/threat_intelligence/public/containers/indicators_page_wrapper.tsx new file mode 100644 index 0000000000000..f5fe0d496ace3 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/containers/indicators_page_wrapper.tsx @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { Suspense, VFC } from 'react'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { IndicatorsPage } from '../modules/indicators/pages'; +import { SecuritySolutionPluginTemplateWrapper } from './security_solution_plugin_template_wrapper'; + +export const IndicatorsPageWrapper: VFC = () => { + const queryClient = new QueryClient(); + + return ( + <QueryClientProvider client={queryClient}> + <SecuritySolutionPluginTemplateWrapper> + <Suspense fallback={<div />}> + <IndicatorsPage /> + </Suspense> + </SecuritySolutionPluginTemplateWrapper> + </QueryClientProvider> + ); +}; + +// Note: This is for lazy loading +// eslint-disable-next-line import/no-default-export +export default IndicatorsPageWrapper; diff --git a/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/__snapshots__/integrations_guard.test.tsx.snap b/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/__snapshots__/integrations_guard.test.tsx.snap index 95785cffd6ad3..1fcca470c6f15 100644 --- a/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/__snapshots__/integrations_guard.test.tsx.snap +++ b/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/__snapshots__/integrations_guard.test.tsx.snap @@ -1,24 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`checking if the page should be visible (based on indicator count) when indicator count is being loaded should render nothing at all: loading 1`] = ` -<DocumentFragment> - <span - aria-label="Loading" - class="euiLoadingLogo emotion-euiLoadingLogo-xl" - role="progressbar" - > - <span - class="emotion-euiLoadingLogo__icon" - > - <span - data-euiicon-type="logoSecurity" - /> - </span> - </span> -</DocumentFragment> -`; - -exports[`checking if the page should be visible (based on indicator count) when indicator count is loaded and there are no indicators should render empty page when no indicators are found: no indicators 1`] = ` +exports[`IntegrationsGuard should render empty page when no indicators are found and no ti integrations are installed 1`] = ` <DocumentFragment> <div class="euiPanel euiPanel--transparent euiEmptyPrompt euiEmptyPrompt--horizontal euiEmptyPrompt--paddingLarge emotion-euiPanel-m-transparent" @@ -118,8 +100,68 @@ exports[`checking if the page should be visible (based on indicator count) when </DocumentFragment> `; -exports[`checking if the page should be visible (based on indicator count) when loading is done and we have some indicators should render indicators table: indicators are present 1`] = ` +exports[`IntegrationsGuard should render indicators page when we have some ti integrations installed 1`] = ` <DocumentFragment> should be restricted </DocumentFragment> `; + +exports[`IntegrationsGuard should render indicators table when we have some indicators 1`] = ` +<DocumentFragment> + should be restricted +</DocumentFragment> +`; + +exports[`IntegrationsGuard should render loading when indicator count and integrations are being loaded 1`] = ` +<DocumentFragment> + <span + aria-label="Loading" + class="euiLoadingLogo emotion-euiLoadingLogo-xl" + role="progressbar" + > + <span + class="emotion-euiLoadingLogo__icon" + > + <span + data-euiicon-type="logoSecurity" + /> + </span> + </span> +</DocumentFragment> +`; + +exports[`IntegrationsGuard should render loading when indicator only is loading 1`] = ` +<DocumentFragment> + <span + aria-label="Loading" + class="euiLoadingLogo emotion-euiLoadingLogo-xl" + role="progressbar" + > + <span + class="emotion-euiLoadingLogo__icon" + > + <span + data-euiicon-type="logoSecurity" + /> + </span> + </span> +</DocumentFragment> +`; + +exports[`IntegrationsGuard should render loading when integrations only are loading 1`] = ` +<DocumentFragment> + <span + aria-label="Loading" + class="euiLoadingLogo emotion-euiLoadingLogo-xl" + role="progressbar" + > + <span + class="emotion-euiLoadingLogo__icon" + > + <span + data-euiicon-type="logoSecurity" + /> + </span> + </span> +</DocumentFragment> +`; diff --git a/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/integrations_guard.test.tsx b/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/integrations_guard.test.tsx index ce8b3b9aaaa98..b0976721311fc 100644 --- a/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/integrations_guard.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/integrations_guard.test.tsx @@ -5,76 +5,164 @@ * 2.0. */ +import { UseQueryResult } from '@tanstack/react-query'; import { render } from '@testing-library/react'; import React from 'react'; import { IntegrationsGuard } from '.'; import { TestProvidersComponent } from '../../common/mocks/test_providers'; -import { useIntegrationsPageLink, useTIDocumentationLink } from '../../hooks'; +import { + Integration, + useIntegrations, + useIntegrationsPageLink, + useTIDocumentationLink, +} from '../../hooks'; import { useIndicatorsTotalCount } from '../../modules/indicators'; +import { INSTALLATION_STATUS, THREAT_INTELLIGENCE_CATEGORY } from '../../utils'; jest.mock('../../modules/indicators/hooks/use_total_count'); jest.mock('../../hooks/use_integrations_page_link'); jest.mock('../../hooks/use_documentation_link'); +jest.mock('../../hooks/use_integrations'); -describe('checking if the page should be visible (based on indicator count)', () => { - describe('when indicator count is being loaded', () => { - it('should render nothing at all', () => { - ( - useIndicatorsTotalCount as jest.MockedFunction<typeof useIndicatorsTotalCount> - ).mockReturnValue({ - count: 0, - isLoading: true, - }); - ( - useIntegrationsPageLink as jest.MockedFunction<typeof useIntegrationsPageLink> - ).mockReturnValue(''); - ( - useTIDocumentationLink as jest.MockedFunction<typeof useTIDocumentationLink> - ).mockReturnValue(''); - - const { asFragment } = render(<IntegrationsGuard>should be restricted</IntegrationsGuard>, { - wrapper: TestProvidersComponent, - }); - - expect(asFragment()).toMatchSnapshot('loading'); +describe('IntegrationsGuard', () => { + it('should render loading when indicator count and integrations are being loaded', async () => { + ( + useIndicatorsTotalCount as jest.MockedFunction<typeof useIndicatorsTotalCount> + ).mockReturnValue({ + count: 0, + isLoading: true, }); + ( + useIntegrationsPageLink as jest.MockedFunction<typeof useIntegrationsPageLink> + ).mockReturnValue(''); + (useTIDocumentationLink as jest.MockedFunction<typeof useTIDocumentationLink>).mockReturnValue( + '' + ); + (useIntegrations as jest.MockedFunction<typeof useIntegrations>).mockReturnValue({ + isLoading: true, + data: [], + } as unknown as UseQueryResult<Integration[]>); + + const { asFragment } = render(<IntegrationsGuard>should be restricted</IntegrationsGuard>, { + wrapper: TestProvidersComponent, + }); + + expect(asFragment()).toMatchSnapshot(); + }); + + it('should render loading when indicator only is loading', async () => { + ( + useIndicatorsTotalCount as jest.MockedFunction<typeof useIndicatorsTotalCount> + ).mockReturnValue({ + count: 0, + isLoading: true, + }); + ( + useIntegrationsPageLink as jest.MockedFunction<typeof useIntegrationsPageLink> + ).mockReturnValue(''); + (useTIDocumentationLink as jest.MockedFunction<typeof useTIDocumentationLink>).mockReturnValue( + '' + ); + (useIntegrations as jest.MockedFunction<typeof useIntegrations>).mockReturnValue({ + isLoading: false, + data: [], + } as unknown as UseQueryResult<Integration[]>); + + const { asFragment } = render(<IntegrationsGuard>should be restricted</IntegrationsGuard>, { + wrapper: TestProvidersComponent, + }); + + expect(asFragment()).toMatchSnapshot(); + }); + + it('should render loading when integrations only are loading', async () => { + ( + useIndicatorsTotalCount as jest.MockedFunction<typeof useIndicatorsTotalCount> + ).mockReturnValue({ + count: 0, + isLoading: true, + }); + ( + useIntegrationsPageLink as jest.MockedFunction<typeof useIntegrationsPageLink> + ).mockReturnValue(''); + (useTIDocumentationLink as jest.MockedFunction<typeof useTIDocumentationLink>).mockReturnValue( + '' + ); + (useIntegrations as jest.MockedFunction<typeof useIntegrations>).mockReturnValue({ + isLoading: true, + data: [], + } as unknown as UseQueryResult<Integration[]>); + + const { asFragment } = render(<IntegrationsGuard>should be restricted</IntegrationsGuard>, { + wrapper: TestProvidersComponent, + }); + + expect(asFragment()).toMatchSnapshot(); + }); + + it('should render empty page when no indicators are found and no ti integrations are installed', async () => { + ( + useIndicatorsTotalCount as jest.MockedFunction<typeof useIndicatorsTotalCount> + ).mockReturnValue({ + count: 0, + isLoading: false, + }); + ( + useIntegrationsPageLink as jest.MockedFunction<typeof useIntegrationsPageLink> + ).mockReturnValue(''); + (useTIDocumentationLink as jest.MockedFunction<typeof useTIDocumentationLink>).mockReturnValue( + '' + ); + (useIntegrations as jest.MockedFunction<typeof useIntegrations>).mockReturnValue({ + isLoading: false, + data: [], + } as unknown as UseQueryResult<Integration[]>); + + const { asFragment } = render(<IntegrationsGuard>should be restricted</IntegrationsGuard>, { + wrapper: TestProvidersComponent, + }); + expect(asFragment()).toMatchSnapshot(); }); - describe('when indicator count is loaded and there are no indicators', () => { - it('should render empty page when no indicators are found', async () => { - ( - useIndicatorsTotalCount as jest.MockedFunction<typeof useIndicatorsTotalCount> - ).mockReturnValue({ - count: 0, - isLoading: false, - }); - ( - useIntegrationsPageLink as jest.MockedFunction<typeof useIntegrationsPageLink> - ).mockReturnValue(''); - ( - useTIDocumentationLink as jest.MockedFunction<typeof useTIDocumentationLink> - ).mockReturnValue(''); - - const { asFragment } = render(<IntegrationsGuard>should be restricted</IntegrationsGuard>, { - wrapper: TestProvidersComponent, - }); - expect(asFragment()).toMatchSnapshot('no indicators'); + it('should render indicators table when we have some indicators', async () => { + ( + useIndicatorsTotalCount as jest.MockedFunction<typeof useIndicatorsTotalCount> + ).mockReturnValue({ + count: 7, + isLoading: false, + }); + (useIntegrations as jest.MockedFunction<typeof useIntegrations>).mockReturnValue({ + isLoading: false, + data: [], + } as unknown as UseQueryResult<Integration[]>); + + const { asFragment } = render(<IntegrationsGuard>should be restricted</IntegrationsGuard>, { + wrapper: TestProvidersComponent, }); + expect(asFragment()).toMatchSnapshot(); }); - describe('when loading is done and we have some indicators', () => { - it('should render indicators table', async () => { - ( - useIndicatorsTotalCount as jest.MockedFunction<typeof useIndicatorsTotalCount> - ).mockReturnValue({ - count: 7, - isLoading: false, - }); - - const { asFragment } = render(<IntegrationsGuard>should be restricted</IntegrationsGuard>, { - wrapper: TestProvidersComponent, - }); - expect(asFragment()).toMatchSnapshot('indicators are present'); + it('should render indicators page when we have some ti integrations installed', async () => { + ( + useIndicatorsTotalCount as jest.MockedFunction<typeof useIndicatorsTotalCount> + ).mockReturnValue({ + count: 0, + isLoading: false, + }); + (useIntegrations as jest.MockedFunction<typeof useIntegrations>).mockReturnValue({ + isLoading: false, + data: [ + { + categories: [THREAT_INTELLIGENCE_CATEGORY], + id: '123', + status: INSTALLATION_STATUS.Installed, + }, + ], + } as unknown as UseQueryResult<Integration[]>); + + const { asFragment } = render(<IntegrationsGuard>should be restricted</IntegrationsGuard>, { + wrapper: TestProvidersComponent, }); + expect(asFragment()).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/integrations_guard.tsx b/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/integrations_guard.tsx index eb639d6c50f75..4c225e283b919 100644 --- a/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/integrations_guard.tsx +++ b/x-pack/plugins/threat_intelligence/public/containers/integrations_guard/integrations_guard.tsx @@ -7,18 +7,24 @@ import { EuiLoadingLogo } from '@elastic/eui'; import React, { FC } from 'react'; +import { useIntegrations } from '../../hooks'; import { EmptyPage } from '../../modules/empty_page'; import { useIndicatorsTotalCount } from '../../modules/indicators'; import { SecuritySolutionPluginTemplateWrapper } from '../security_solution_plugin_template_wrapper'; /** - * Renders children only if TI integrations are enabled + * Renders the indicators page if the user has some Threat Intelligence integrations installed or + * the user is receiving indicators. + * If none are received, show the EmptyPage with a link to go install integrations. + * While the indicators call and the integrations call are loading, display a loading screen. */ export const IntegrationsGuard: FC = ({ children }) => { - const { count: indicatorsTotalCount, isLoading: isIndicatorsTotalCountLoading } = + const { isLoading: indicatorsTotalCountLoading, count: indicatorsTotalCount } = useIndicatorsTotalCount(); - if (isIndicatorsTotalCountLoading) { + const { isLoading: integrationLoading, data: installedTIIntegrations } = useIntegrations(); + + if (integrationLoading || indicatorsTotalCountLoading) { return ( <SecuritySolutionPluginTemplateWrapper isEmptyState> <EuiLoadingLogo logo="logoSecurity" size="xl" /> @@ -26,7 +32,7 @@ export const IntegrationsGuard: FC = ({ children }) => { ); } - const showEmptyPage = indicatorsTotalCount === 0; - - return showEmptyPage ? <EmptyPage /> : <>{children}</>; + // show indicators page if there are indicators, or if some ti integrations have been added + const showIndicatorsPage = indicatorsTotalCount > 0 || (installedTIIntegrations || []).length > 0; + return showIndicatorsPage ? <>{children}</> : <EmptyPage />; }; diff --git a/x-pack/plugins/threat_intelligence/public/containers/security_solution_plugin_template_wrapper.tsx b/x-pack/plugins/threat_intelligence/public/containers/security_solution_plugin_template_wrapper.tsx index e2e1a735b0c71..c4b97d1b7e722 100644 --- a/x-pack/plugins/threat_intelligence/public/containers/security_solution_plugin_template_wrapper.tsx +++ b/x-pack/plugins/threat_intelligence/public/containers/security_solution_plugin_template_wrapper.tsx @@ -8,7 +8,7 @@ import type { FC } from 'react'; import React from 'react'; import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template-types'; -import { useKibana } from '../hooks'; +import { useKibana } from '../hooks/use_kibana'; /** * Uses securityLayout service to retrieve shared plugin wrapper component and renders plugin routes / children inside of it. diff --git a/x-pack/plugins/threat_intelligence/public/hooks/index.ts b/x-pack/plugins/threat_intelligence/public/hooks/index.ts index 369a364e99ac9..29c019274e946 100644 --- a/x-pack/plugins/threat_intelligence/public/hooks/index.ts +++ b/x-pack/plugins/threat_intelligence/public/hooks/index.ts @@ -8,6 +8,7 @@ export * from './use_documentation_link'; export * from './use_field_types'; export * from './use_inspector'; +export * from './use_integrations'; export * from './use_integrations_page_link'; export * from './use_kibana'; export * from './use_security_context'; diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_integrations.test.tsx b/x-pack/plugins/threat_intelligence/public/hooks/use_integrations.test.tsx new file mode 100644 index 0000000000000..ee868cc9803d6 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/hooks/use_integrations.test.tsx @@ -0,0 +1,53 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { renderHook } from '@testing-library/react-hooks'; +import { QueryClient, QueryClientProvider, useQuery } from '@tanstack/react-query'; +import { INSTALLATION_STATUS, THREAT_INTELLIGENCE_CATEGORY } from '../utils'; + +const createWrapper = () => { + const queryClient = new QueryClient(); + return ({ children }: { children: any }) => ( + <QueryClientProvider client={queryClient}>{children}</QueryClientProvider> + ); +}; + +const renderUseQuery = (result: { items: any[] }) => + renderHook(() => useQuery(['integrations'], () => result), { + wrapper: createWrapper(), + }); + +describe('useIntegrations', () => { + it('should have undefined data during loading state', async () => { + const mockIntegrations = { items: [] }; + const { result, waitFor } = renderUseQuery(mockIntegrations); + + await waitFor(() => result.current.isLoading); + + expect(result.current.isLoading).toBeTruthy(); + expect(result.current.data).toBeUndefined(); + }); + + it('should return integrations on success', async () => { + const mockIntegrations = { + items: [ + { + categories: [THREAT_INTELLIGENCE_CATEGORY], + id: '123', + status: INSTALLATION_STATUS.Installed, + }, + ], + }; + const { result, waitFor } = renderUseQuery(mockIntegrations); + + await waitFor(() => result.current.isSuccess); + + expect(result.current.isLoading).toBeFalsy(); + expect(result.current.data).toEqual(mockIntegrations); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_integrations.ts b/x-pack/plugins/threat_intelligence/public/hooks/use_integrations.ts new file mode 100644 index 0000000000000..a5d1f8f45bdcd --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/hooks/use_integrations.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 { useQuery, useQueryClient } from '@tanstack/react-query'; +import { filterIntegrations } from '../utils'; +import { useKibana } from './use_kibana'; + +type IntegrationInstallStatus = 'installed' | 'installing' | 'install_failed'; + +const INTEGRATIONS_URL = '/api/fleet/epm/packages'; + +const INTEGRATIONS_CALL_TIMEOUT = 2000; + +export interface IntegrationResponse { + items: Integration[]; +} + +export interface Integration { + categories: string[]; + id: string; + status: IntegrationInstallStatus; +} + +/** + * Retrieves integrations from the Fleet plugin endpoint /api/fleet/epm/packages. + * The integrations are then filtered, and we only keep the installed ones, + * with category threat_intel and excluding the ti_utils integration. + * We cancel the query in case it's taking too long to not block the Indicators page for the user. + */ +export const useIntegrations = () => { + const { http } = useKibana().services; + const queryKey = ['integrations']; + + // retrieving the list of integrations from the fleet plugin's endpoint + const fetchIntegrations = () => http.get<IntegrationResponse>(INTEGRATIONS_URL); + + const query = useQuery(queryKey, fetchIntegrations, { + select: (data: IntegrationResponse) => (data ? filterIntegrations(data.items) : []), + }); + + const queryClient = useQueryClient(); + + // cancel slow integrations call to unblock the UI + setTimeout(() => queryClient.cancelQueries(queryKey), INTEGRATIONS_CALL_TIMEOUT); + + return query; +}; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.stories.tsx index 792e31ce109fe..e58dc9a7dcc81 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Story } from '@storybook/react'; import { DataView, DataViewField } from '@kbn/data-views-plugin/common'; -import { RawIndicatorFieldId } from '../../../types'; +import { RawIndicatorFieldId } from '../../../../../../common/types/indicator'; import { IndicatorsFieldSelector } from '.'; const mockIndexPattern: DataView = { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.tsx index 29af51472bd12..2707ba250784f 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.tsx @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n'; import { DataViewField } from '@kbn/data-views-plugin/common'; import { EuiComboBoxOptionOption } from '@elastic/eui/src/components/combo_box/types'; import { SecuritySolutionDataViewBase } from '../../../../../types'; -import { RawIndicatorFieldId } from '../../../types'; +import { RawIndicatorFieldId } from '../../../../../../common/types/indicator'; import { useStyles } from './styles'; export const DROPDOWN_TEST_ID = 'tiIndicatorFieldSelectorDropdown'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx index 472bc7934bab2..30170d50ca266 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx @@ -14,10 +14,11 @@ import { DataView, DataViewField } from '@kbn/data-views-plugin/common'; import { TimeRange } from '@kbn/es-query'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { IUiSettingsClient } from '@kbn/core/public'; +import { BARCHART_AGGREGATION_NAME } from '../../../../../common/constants'; import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; import { mockKibanaTimelinesService } from '../../../../common/mocks/mock_kibana_timelines_service'; import { IndicatorsBarChartWrapper } from '.'; -import { Aggregation, AGGREGATION_NAME, ChartSeries } from '../../services'; +import { Aggregation, ChartSeries } from '../../services'; export default { component: IndicatorsBarChartWrapper, @@ -84,7 +85,7 @@ const dataServiceMock = { of({ rawResponse: { aggregations: { - [AGGREGATION_NAME]: { + [BARCHART_AGGREGATION_NAME]: { buckets: [aggregation1, aggregation2], }, }, diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx index 6df40e3150094..57ec76d17bd41 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx @@ -18,7 +18,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { TimeRange } from '@kbn/es-query'; import { TimeRangeBounds } from '@kbn/data-plugin/common'; import { SecuritySolutionDataViewBase } from '../../../../types'; -import { RawIndicatorFieldId } from '../../types'; +import { RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { IndicatorsFieldSelector } from './field_selector'; import { IndicatorsBarChart } from './barchart'; import { ChartSeries } from '../../services'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_label/field_label.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_label/field_label.tsx index cf55e5ad9c809..64e85bc8c5d7e 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_label/field_label.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_label/field_label.tsx @@ -7,7 +7,7 @@ import React, { VFC } from 'react'; import { i18n } from '@kbn/i18n'; -import { RawIndicatorFieldId } from '../../types'; +import { RawIndicatorFieldId } from '../../../../../common/types/indicator'; interface IndicatorFieldLabelProps { field: string; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/__snapshots__/field.test.tsx.snap b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/__snapshots__/field.test.tsx.snap index f90ff68de3b14..8dd105a299838 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/__snapshots__/field.test.tsx.snap +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/__snapshots__/field.test.tsx.snap @@ -1,196 +1,39 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`<IndicatorField /> should render tlp marking badge 1`] = ` +<DocumentFragment> + <span + class="euiBadge euiBadge--iconLeft" + style="background-color: rgb(255, 126, 98); color: rgb(0, 0, 0);" + title="Red" + > + <span + class="euiBadge__content" + > + <span + class="euiBadge__text" + > + Red + </span> + </span> + </span> +</DocumentFragment> +`; + exports[`<IndicatorField /> should return - 1`] = ` -Object { - "asFragment": [Function], - "baseElement": <body> - <div> - - - </div> - </body>, - "container": <div> - - - </div>, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} +<DocumentFragment> + - +</DocumentFragment> `; exports[`<IndicatorField /> should return date-formatted value 1`] = ` -Object { - "asFragment": [Function], - "baseElement": <body> - <div> - Dec 31, 2021 @ 20:01:01.000 - </div> - </body>, - "container": <div> - Dec 31, 2021 @ 20:01:01.000 - </div>, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} +<DocumentFragment> + Dec 31, 2021 @ 20:01:01.000 +</DocumentFragment> `; exports[`<IndicatorField /> should return non formatted value 1`] = ` -Object { - "asFragment": [Function], - "baseElement": <body> - <div> - 0.0.0.0 - </div> - </body>, - "container": <div> - 0.0.0.0 - </div>, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} +<DocumentFragment> + 0.0.0.0 +</DocumentFragment> `; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.stories.tsx index b652ebe92e9fa..da56583404a15 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; -import { generateMockIndicator } from '../../types'; +import { generateMockIndicator } from '../../../../../common/types/indicator'; import { IndicatorFieldValue } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx index da78e8db55bc0..94751080fa005 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx @@ -8,7 +8,10 @@ import React from 'react'; import { render } from '@testing-library/react'; import { IndicatorFieldValue } from '.'; -import { generateMockIndicator } from '../../types'; +import { + generateMockIndicator, + generateMockIndicatorWithTlp, +} from '../../../../../common/types/indicator'; import { EMPTY_VALUE } from '../../../../common/constants'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; @@ -19,23 +22,37 @@ describe('<IndicatorField />', () => { it('should return non formatted value', () => { const mockField = 'threat.indicator.ip'; - const component = render(<IndicatorFieldValue indicator={mockIndicator} field={mockField} />); - expect(component).toMatchSnapshot(); + const { asFragment } = render( + <IndicatorFieldValue indicator={mockIndicator} field={mockField} /> + ); + expect(asFragment()).toMatchSnapshot(); }); it(`should return ${EMPTY_VALUE}`, () => { const mockField = 'abc'; - const component = render(<IndicatorFieldValue indicator={mockIndicator} field={mockField} />); - expect(component).toMatchSnapshot(); + const { asFragment } = render( + <IndicatorFieldValue indicator={mockIndicator} field={mockField} /> + ); + expect(asFragment()).toMatchSnapshot(); }); it('should return date-formatted value', () => { const mockField = 'threat.indicator.first_seen'; - const component = render( + const { asFragment } = render( <TestProvidersComponent> <IndicatorFieldValue indicator={mockIndicator} field={mockField} /> </TestProvidersComponent> ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); + }); + + it('should render tlp marking badge', () => { + const mockField = 'threat.indicator.marking.tlp'; + const { asFragment } = render( + <TestProvidersComponent> + <IndicatorFieldValue indicator={generateMockIndicatorWithTlp()} field={mockField} /> + </TestProvidersComponent> + ); + expect(asFragment()).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx index c46e08eac302f..ff3d09fe45906 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx @@ -8,9 +8,10 @@ import React, { VFC } from 'react'; import { useFieldTypes } from '../../../../hooks'; import { EMPTY_VALUE } from '../../../../common/constants'; -import { Indicator, RawIndicatorFieldId } from '../../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { DateFormatter } from '../../../../components/date_formatter'; import { unwrapValue } from '../../utils'; +import { TLPBadge } from '../tlp_badge'; export interface IndicatorFieldValueProps { /** @@ -29,8 +30,12 @@ export interface IndicatorFieldValueProps { */ export const IndicatorFieldValue: VFC<IndicatorFieldValueProps> = ({ indicator, field }) => { const fieldType = useFieldTypes()[field]; - const value = unwrapValue(indicator, field as RawIndicatorFieldId); + + if (field === RawIndicatorFieldId.MarkingTLP) { + return <TLPBadge value={value} />; + } + return fieldType === 'date' ? ( <DateFormatter date={value as string} /> ) : value ? ( diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.stories.tsx index 7cb9254351beb..80bd24d59adc9 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { mockIndicatorsFiltersContext } from '../../../../../common/mocks/mock_indicators_filters_context'; import { IndicatorFieldsTable } from '.'; -import { generateMockIndicator } from '../../../types'; +import { generateMockIndicator } from '../../../../../../common/types/indicator'; import { StoryProvidersComponent } from '../../../../../common/mocks/story_providers'; import { IndicatorsFiltersContext } from '../../../containers/filters'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.tsx index e5d89910dca3b..3fe1f62599059 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.tsx @@ -8,7 +8,7 @@ import { EuiBasicTableColumn, EuiInMemoryTable, EuiInMemoryTableProps } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo, VFC } from 'react'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { IndicatorFieldValue } from '../../field_value'; import { IndicatorValueActions } from '../indicator_value_actions'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx index d697338d70bad..b23dfca2e61d6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx @@ -7,50 +7,35 @@ import React from 'react'; import { Story } from '@storybook/react'; -import { CoreStart } from '@kbn/core/public'; -import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; -import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; -import { mockUiSettingsService } from '../../../../common/mocks/mock_kibana_ui_settings_service'; -import { mockKibanaTimelinesService } from '../../../../common/mocks/mock_kibana_timelines_service'; -import { generateMockIndicator, Indicator } from '../../types'; +import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { IndicatorsFlyout } from '.'; -import { IndicatorsFiltersContext } from '../../containers/filters'; export default { component: IndicatorsFlyout, title: 'IndicatorsFlyout', }; -const coreMock = { - uiSettings: mockUiSettingsService(), - timelines: mockKibanaTimelinesService, -} as unknown as CoreStart; -const KibanaReactContext = createKibanaReactContext(coreMock); - export const Default: Story<void> = () => { const mockIndicator: Indicator = generateMockIndicator(); return ( - <KibanaReactContext.Provider> - <IndicatorsFiltersContext.Provider value={mockIndicatorsFiltersContext}> - <IndicatorsFlyout - indicator={mockIndicator} - closeFlyout={() => window.alert('Closing flyout')} - /> - </IndicatorsFiltersContext.Provider> - </KibanaReactContext.Provider> + <StoryProvidersComponent> + <IndicatorsFlyout + indicator={mockIndicator} + closeFlyout={() => window.alert('Closing flyout')} + /> + </StoryProvidersComponent> ); }; export const EmptyIndicator: Story<void> = () => { return ( - <KibanaReactContext.Provider> - <IndicatorsFiltersContext.Provider value={mockIndicatorsFiltersContext}> - <IndicatorsFlyout - indicator={{ fields: {} } as Indicator} - closeFlyout={() => window.alert('Closing flyout')} - /> - </IndicatorsFiltersContext.Provider> - </KibanaReactContext.Provider> + <StoryProvidersComponent> + <IndicatorsFlyout + indicator={{ fields: {} } as Indicator} + closeFlyout={() => window.alert('Closing flyout')} + /> + </StoryProvidersComponent> ); }; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx index fab9d2ed6d465..a50cf08b3f2b5 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { cleanup, render, screen } from '@testing-library/react'; import { IndicatorsFlyout, SUBTITLE_TEST_ID, TITLE_TEST_ID } from '.'; -import { generateMockIndicator, Indicator } from '../../types'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; const mockIndicator = generateMockIndicator(); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx index 97c5592b05e42..485ba92f61932 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx @@ -23,7 +23,7 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import { InvestigateInTimelineButton } from '../../../timeline'; import { DateFormatter } from '../../../../components/date_formatter/date_formatter'; -import { Indicator, RawIndicatorFieldId } from '../../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { IndicatorsFlyoutJson } from './json_tab'; import { IndicatorsFlyoutTable } from './table_tab'; import { unwrapValue } from '../../utils'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions/indicator_value_actions.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions/indicator_value_actions.tsx index e64592cbea079..4d4f1d94d84e5 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions/indicator_value_actions.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions/indicator_value_actions.tsx @@ -14,7 +14,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { FilterInButtonIcon, FilterOutButtonIcon } from '../../../../query_bar'; import { AddToTimelineContextMenu } from '../../../../timeline'; import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../../utils'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.stories.tsx index 9ae8576c8706e..8d2eead239f4e 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { Story } from '@storybook/react'; -import { generateMockIndicator, Indicator } from '../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../common/types/indicator'; import { IndicatorsFlyoutJson } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.test.tsx index 496e362c1a384..d56b328c61597 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { TestProvidersComponent } from '../../../../../common/mocks/test_providers'; -import { generateMockIndicator, Indicator } from '../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../common/types/indicator'; import { CODE_BLOCK_TEST_ID, IndicatorsFlyoutJson } from '.'; import { EMPTY_PROMPT_TEST_ID } from '../empty_prompt'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.tsx index b3791edc5b9fe..f7dc6ad59de00 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.tsx @@ -7,7 +7,7 @@ import React, { VFC } from 'react'; import { EuiCodeBlock } from '@elastic/eui'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { IndicatorEmptyPrompt } from '../empty_prompt'; export const CODE_BLOCK_TEST_ID = 'tiFlyoutJsonCodeBlock'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.stories.tsx index 0a0db7b114929..0ae9c8b962d9a 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { IndicatorsFiltersContext } from '../../../../containers/filters'; import { StoryProvidersComponent } from '../../../../../../common/mocks/story_providers'; -import { generateMockIndicator } from '../../../../types'; +import { generateMockIndicator } from '../../../../../../../common/types/indicator'; import { IndicatorBlock } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.tsx index 48ac9867181b3..3baa182530b86 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.tsx @@ -8,7 +8,7 @@ import { EuiPanel, EuiSpacer, EuiText } from '@elastic/eui'; import React, { VFC } from 'react'; import { css, euiStyled } from '@kbn/kibana-react-plugin/common'; -import { Indicator } from '../../../../types'; +import { Indicator } from '../../../../../../../common/types/indicator'; import { IndicatorFieldValue } from '../../../field_value'; import { IndicatorFieldLabel } from '../../../field_label'; import { IndicatorValueActions } from '../../indicator_value_actions'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/highlighted_values_table/highlighted_values_table.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/highlighted_values_table/highlighted_values_table.tsx index 193e550fc4012..5c60ed4684d9b 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/highlighted_values_table/highlighted_values_table.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/highlighted_values_table/highlighted_values_table.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo, VFC } from 'react'; -import { Indicator, RawIndicatorFieldId } from '../../../../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../../../../common/types/indicator'; import { unwrapValue } from '../../../../utils'; import { IndicatorFieldsTable } from '../../fields_table'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.stories.tsx index 3b1c57b19c73f..4c74ea25330d7 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Story } from '@storybook/react'; import { StoryProvidersComponent } from '../../../../../common/mocks/story_providers'; -import { generateMockIndicator, Indicator } from '../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../common/types/indicator'; import { IndicatorsFlyoutOverview } from '.'; import { IndicatorsFiltersContext } from '../../../containers/filters'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.test.tsx index 94bdba9ea06fa..df4201761a98e 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.test.tsx @@ -8,7 +8,7 @@ import { TestProvidersComponent } from '../../../../../common/mocks/test_providers'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { generateMockIndicator, Indicator } from '../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../common/types/indicator'; import { IndicatorsFlyoutOverview, TI_FLYOUT_OVERVIEW_HIGH_LEVEL_BLOCKS, diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.tsx index def4049aeee5c..2c3e6dee5ffcb 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.tsx @@ -17,7 +17,7 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo, VFC } from 'react'; import { EMPTY_VALUE } from '../../../../../common/constants'; -import { Indicator, RawIndicatorFieldId } from '../../../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../../../common/types/indicator'; import { unwrapValue } from '../../../utils'; import { IndicatorEmptyPrompt } from '../empty_prompt'; import { IndicatorBlock } from './block'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.stories.tsx index a8cea2e06ca2b..1842d52171db3 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.stories.tsx @@ -12,7 +12,7 @@ import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import { mockIndicatorsFiltersContext } from '../../../../../common/mocks/mock_indicators_filters_context'; import { mockUiSettingsService } from '../../../../../common/mocks/mock_kibana_ui_settings_service'; import { mockKibanaTimelinesService } from '../../../../../common/mocks/mock_kibana_timelines_service'; -import { generateMockIndicator, Indicator } from '../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../common/types/indicator'; import { IndicatorsFlyoutTable } from '.'; import { IndicatorsFiltersContext } from '../../../containers/filters'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.test.tsx index c70232da887ff..aae9aa41cbf2f 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.test.tsx @@ -8,7 +8,11 @@ import React from 'react'; import { render } from '@testing-library/react'; import { TestProvidersComponent } from '../../../../../common/mocks/test_providers'; -import { generateMockIndicator, Indicator, RawIndicatorFieldId } from '../../../types'; +import { + generateMockIndicator, + Indicator, + RawIndicatorFieldId, +} from '../../../../../../common/types/indicator'; import { IndicatorsFlyoutTable, TABLE_TEST_ID } from '.'; import { unwrapValue } from '../../../utils'; import { EMPTY_PROMPT_TEST_ID } from '../empty_prompt'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.tsx index 5c152684f0fa9..0f0a699733ccb 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.tsx @@ -6,7 +6,7 @@ */ import React, { VFC } from 'react'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { IndicatorEmptyPrompt } from '../empty_prompt'; import { IndicatorFieldsTable } from '../fields_table'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx index 05b4f5b64c263..e8a58f2797669 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx @@ -8,7 +8,7 @@ import React, { useContext, VFC } from 'react'; import { EuiFlexGroup } from '@elastic/eui'; import { InvestigateInTimelineButtonIcon } from '../../../../timeline'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { OpenIndicatorFlyoutButton } from './open_flyout_button'; import { IndicatorsTableContext } from '../contexts'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx index 8342a013bb112..2f606df1a8f12 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx @@ -7,7 +7,7 @@ import React, { VFC } from 'react'; import { EuiDataGridColumnCellActionProps } from '@elastic/eui/src/components/datagrid/data_grid_types'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { AddToTimelineCellAction } from '../../../../timeline'; import { FilterInCellAction, FilterOutCellAction } from '../../../../query_bar'; import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../../utils'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_popover_renderer.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_popover_renderer.tsx index 95067ce87bc19..eba86eb4e8c35 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_popover_renderer.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_popover_renderer.tsx @@ -16,7 +16,7 @@ import { CopyToClipboardButtonEmpty } from '../../copy_to_clipboard/copy_to_clip import { FilterInButtonEmpty, FilterOutButtonEmpty } from '../../../../query_bar'; import { AddToTimelineButtonEmpty } from '../../../../timeline'; import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../../utils/field_value'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { Pagination } from '../../../services/fetch_indicators'; import { useStyles } from './styles'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx index d4aa529f5dfc1..7a33c4d21dde6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx @@ -9,7 +9,7 @@ import { EuiDataGridCellValueElementProps } from '@elastic/eui'; import React, { useContext, useEffect } from 'react'; import { euiDarkVars as themeDark, euiLightVars as themeLight } from '@kbn/ui-theme'; import { useKibana } from '../../../../../hooks'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { IndicatorFieldValue } from '../../field_value'; import { IndicatorsTableContext } from '../contexts'; import { ActionsRowCell } from '.'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx index e7f62b73042df..d0bcec7068c21 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { ComponentStory } from '@storybook/react'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import { mockUiSettingsService } from '../../../../../../common/mocks/mock_kibana_ui_settings_service'; -import { generateMockIndicator, Indicator } from '../../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../../common/types/indicator'; import { OpenIndicatorFlyoutButton } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx index fe3fcca21129c..f68be6d7ea553 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { BUTTON_TEST_ID, OpenIndicatorFlyoutButton } from '.'; -import { generateMockIndicator } from '../../../../types'; +import { generateMockIndicator } from '../../../../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../../../../common/mocks/test_providers'; const mockIndicator = generateMockIndicator(); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx index dee079463f056..7ae0584447a5b 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx @@ -8,7 +8,7 @@ import React, { VFC } from 'react'; import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { Indicator } from '../../../../types'; +import { Indicator } from '../../../../../../../common/types/indicator'; export const BUTTON_TEST_ID = 'tiToggleIndicatorFlyoutButton'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts index 9bb89968c75ae..e0125544a6453 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts @@ -6,7 +6,7 @@ */ import { createContext, Dispatch, SetStateAction } from 'react'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; export interface IndicatorsTableContextValue { expanded: Indicator | undefined; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.ts index 680661f04d411..33f73922a3aa0 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.ts @@ -8,7 +8,7 @@ import { EuiDataGridColumn, EuiDataGridSorting } from '@elastic/eui'; import { useCallback, useEffect, useMemo, useState } from 'react'; import negate from 'lodash/negate'; -import { RawIndicatorFieldId } from '../../../types'; +import { RawIndicatorFieldId } from '../../../../../../common/types/indicator'; import { useKibana } from '../../../../../hooks'; import { translateFieldLabel } from '../../field_label'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx index a4eccb880f6c1..4822d403e3f4b 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { DataView } from '@kbn/data-views-plugin/common'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; -import { generateMockIndicator, Indicator } from '../../types'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { IndicatorsTable } from '.'; import { IndicatorsFiltersContext } from '../../containers/filters/context'; import { DEFAULT_COLUMNS } from './hooks'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx index af28ac88a4d44..2d51a75cd2c83 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx @@ -9,7 +9,7 @@ import { act, render, screen } from '@testing-library/react'; import React from 'react'; import { IndicatorsTable, IndicatorsTableProps, TABLE_UPDATE_PROGRESS_TEST_ID } from '.'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; -import { generateMockIndicator, Indicator } from '../../types'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { BUTTON_TEST_ID } from './components/open_flyout_button'; import { TITLE_TEST_ID } from '../flyout'; import { SecuritySolutionDataViewBase } from '../../../../types'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx index 62e142075305f..d27aaf0ea233d 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx @@ -21,7 +21,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDataGridColumn } from '@elastic/eui/src/components/datagrid/data_grid_types'; import { CellActions, cellPopoverRendererFactory, cellRendererFactory } from './components'; import { BrowserFields, SecuritySolutionDataViewBase } from '../../../../types'; -import { Indicator, RawIndicatorFieldId } from '../../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { EmptyState } from '../../../../components/empty_state'; import { IndicatorsTableContext, IndicatorsTableContextValue } from './contexts'; import { IndicatorsFlyout } from '../flyout'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/__snapshots__/tlp_badge.test.tsx.snap b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/__snapshots__/tlp_badge.test.tsx.snap new file mode 100644 index 0000000000000..22522c97624ae --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/__snapshots__/tlp_badge.test.tsx.snap @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TLPBadge should handle proper value 1`] = ` +<DocumentFragment> + <span + class="euiBadge euiBadge--iconLeft" + style="background-color: rgb(109, 204, 177); color: rgb(0, 0, 0);" + title="Green" + > + <span + class="euiBadge__content" + > + <span + class="euiBadge__text" + > + Green + </span> + </span> + </span> +</DocumentFragment> +`; + +exports[`TLPBadge should handle value in various casing with extra spaces 1`] = ` +<DocumentFragment> + <span + class="euiBadge euiBadge--iconLeft" + style="background-color: rgb(255, 126, 98); color: rgb(0, 0, 0);" + title="Red" + > + <span + class="euiBadge__content" + > + <span + class="euiBadge__text" + > + Red + </span> + </span> + </span> +</DocumentFragment> +`; + +exports[`TLPBadge should return - if color doesn't exist 1`] = ` +<DocumentFragment> + - +</DocumentFragment> +`; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/index.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/index.tsx new file mode 100644 index 0000000000000..1fbe78837f77a --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/index.tsx @@ -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 './tlp_badge'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.stories.tsx new file mode 100644 index 0000000000000..dd70fd29ee861 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.stories.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 { ComponentStory } from '@storybook/react'; +import React from 'react'; +import { TLPBadge, TLPBadgeProps } from './tlp_badge'; + +export default { + component: TLPBadge, + title: 'TLPBadge', +}; + +const Template: ComponentStory<typeof TLPBadge> = (args: TLPBadgeProps) => <TLPBadge {...args} />; + +export const Red = Template.bind({}); +Red.args = { + value: 'RED', +}; + +export const Amber = Template.bind({}); +Amber.args = { + value: 'AMBER', +}; + +export const AmberStrict = Template.bind({}); +AmberStrict.args = { + value: 'AMBER+STRICT', +}; + +export const Green = Template.bind({}); +Green.args = { + value: 'GREEN', +}; + +export const White = Template.bind({}); +White.args = { + value: 'WHITE', +}; + +export const Clear = Template.bind({}); +Clear.args = { + value: 'CLEAR', +}; + +export const Empty = Template.bind({}); +Empty.args = { + value: undefined, +}; + +export const Other = Template.bind({}); +Other.args = { + value: 'other', +}; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.test.tsx new file mode 100644 index 0000000000000..6f18c84640b78 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.test.tsx @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { EMPTY_VALUE } from '../../../../common/constants'; +import { TLPBadge } from './tlp_badge'; + +describe('TLPBadge', () => { + it(`should return ${EMPTY_VALUE} if color doesn't exist`, () => { + const invalidValue = 'abc'; + const { asFragment } = render(<TLPBadge value={invalidValue} />); + expect(asFragment()).toMatchSnapshot(); + }); + + it('should handle value in various casing with extra spaces', () => { + const value = ' RED '; + const { asFragment } = render(<TLPBadge value={value} />); + expect(asFragment()).toMatchSnapshot(); + }); + + it('should handle proper value', () => { + const value = 'green'; + const { asFragment } = render(<TLPBadge value={value} />); + expect(asFragment()).toMatchSnapshot(); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.tsx new file mode 100644 index 0000000000000..d8d4d6ca6dc50 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.tsx @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiBadge } from '@elastic/eui'; +import capitalize from 'lodash/capitalize'; +import React, { useMemo, VFC } from 'react'; +import { EMPTY_VALUE } from '../../../../common/constants'; + +export interface TLPBadgeProps { + value: string | undefined | null; +} + +const LEVEL_TO_COLOR: Record<string, string> = { + red: 'danger', + amber: 'warning', + 'amber+strict': 'warning', + green: 'success', + white: 'hollow', + clear: 'hollow', +} as const; + +export const TLPBadge: VFC<TLPBadgeProps> = ({ value }) => { + const normalizedValue = value?.toLowerCase().trim(); + const color = LEVEL_TO_COLOR[normalizedValue || '']; + + const displayValue = useMemo( + () => normalizedValue?.replaceAll(/\W/g, ' ').split(' ').map(capitalize).join(' '), + [normalizedValue] + ); + + if (!color) { + return <>{EMPTY_VALUE}</>; + } + + return <EuiBadge color={color}>{displayValue}</EuiBadge>; +}; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts index 52f7c01cac736..bdfd9fafa77e0 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts @@ -10,7 +10,7 @@ import { Filter, Query, TimeRange } from '@kbn/es-query'; import { useMemo, useState } from 'react'; import { TimeRangeBounds } from '@kbn/data-plugin/common'; import { useInspector, useKibana } from '../../../hooks'; -import { RawIndicatorFieldId } from '../types'; +import { RawIndicatorFieldId } from '../../../../common/types/indicator'; import { useSourcererDataView } from '.'; import { ChartSeries, diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts index 399254fe75688..3011d9b5101f6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts @@ -10,7 +10,7 @@ import { Filter, Query, TimeRange } from '@kbn/es-query'; import { useQuery } from '@tanstack/react-query'; import { EuiDataGridSorting } from '@elastic/eui'; import { useInspector, useKibana } from '../../../hooks'; -import { Indicator } from '../types'; +import { Indicator } from '../../../../common/types/indicator'; import { useSourcererDataView } from './use_sourcerer_data_view'; import { createFetchIndicators, FetchParams, Pagination } from '../services/fetch_indicators'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts index 5128f47ee1a79..94e8c7a489fe9 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts @@ -7,7 +7,7 @@ import { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { RawIndicatorFieldId } from '../types'; +import { RawIndicatorFieldId } from '../../../../common/types/indicator'; import { SecuritySolutionDataViewBase } from '../../../types'; import { useSecurityContext } from '../../../hooks/use_security_context'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/index.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/index.ts index a88503e53cc7b..73affbb6e8a63 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/index.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/index.ts @@ -11,4 +11,3 @@ export * from './hooks/use_sourcerer_data_view'; export * from './hooks/use_total_count'; export * from './utils/field_value'; export * from './utils/unwrap_value'; -export * from './types/indicator'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/pages/indicators.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/pages/indicators.tsx index 1e1f713957fb8..f161b7ac1d85c 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/pages/indicators.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/pages/indicators.tsx @@ -6,32 +6,25 @@ */ import React, { FC, VFC } from 'react'; -import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { IndicatorsBarChartWrapper } from '../components/barchart'; import { IndicatorsTable } from '../components/table'; -import { useIndicators } from '../hooks/use_indicators'; +import { useAggregatedIndicators, useIndicators, useSourcererDataView } from '../hooks'; import { DefaultPageLayout } from '../../../components/layout'; import { useFilters } from '../../query_bar'; import { FiltersGlobal } from '../../../containers/filters_global'; -import { useSourcererDataView } from '../hooks/use_sourcerer_data_view'; import { FieldTypesProvider } from '../../../containers/field_types_provider'; import { InspectorProvider } from '../../../containers/inspector'; import { useColumnSettings } from '../components/table/hooks'; -import { useAggregatedIndicators } from '../hooks/use_aggregated_indicators'; import { IndicatorsFilters } from '../containers/filters'; -import { useSecurityContext } from '../../../hooks/use_security_context'; +import { useSecurityContext } from '../../../hooks'; import { UpdateStatus } from '../../../components/update_status'; -const queryClient = new QueryClient(); - const IndicatorsPageProviders: FC = ({ children }) => ( - <QueryClientProvider client={queryClient}> - <IndicatorsFilters> - <FieldTypesProvider> - <InspectorProvider>{children}</InspectorProvider> - </FieldTypesProvider> - </IndicatorsFilters> - </QueryClientProvider> + <IndicatorsFilters> + <FieldTypesProvider> + <InspectorProvider>{children}</InspectorProvider> + </FieldTypesProvider> + </IndicatorsFilters> ); const IndicatorsPageContent: VFC = () => { @@ -115,7 +108,3 @@ export const IndicatorsPage: VFC = () => ( <IndicatorsPageContent /> </IndicatorsPageProviders> ); - -// Note: This is for lazy loading -// eslint-disable-next-line import/no-default-export -export default IndicatorsPage; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts index 007623943c531..45190d813714b 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts @@ -8,15 +8,11 @@ import { mockedQueryService, mockedSearchService } from '../../../common/mocks/test_providers'; import { BehaviorSubject, throwError } from 'rxjs'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; -import { - Aggregation, - AGGREGATION_NAME, - convertAggregationToChartSeries, - createFetchAggregatedIndicators, -} from '.'; +import { Aggregation, convertAggregationToChartSeries, createFetchAggregatedIndicators } from '.'; +import { BARCHART_AGGREGATION_NAME, FactoryQueryType } from '../../../../common/constants'; const aggregationResponse = { - rawResponse: { aggregations: { [AGGREGATION_NAME]: { buckets: [] } } }, + rawResponse: { aggregations: { [BARCHART_AGGREGATION_NAME]: { buckets: [] } } }, }; const aggregation1: Aggregation = { @@ -88,33 +84,13 @@ describe('FetchAggregatedIndicatorsService', () => { expect.objectContaining({ params: expect.objectContaining({ body: expect.objectContaining({ - size: 0, query: expect.objectContaining({ bool: expect.anything() }), - runtime_mappings: { - 'threat.indicator.name': { script: expect.anything(), type: 'keyword' }, - 'threat.indicator.name_origin': { script: expect.anything(), type: 'keyword' }, - }, - aggregations: { - [AGGREGATION_NAME]: { - terms: { - field: 'myField', - }, - aggs: { - events: { - date_histogram: { - field: '@timestamp', - fixed_interval: expect.anything(), - min_doc_count: 0, - extended_bounds: expect.anything(), - }, - }, - }, - }, - }, - fields: ['@timestamp', 'myField'], }), index: [], }), + factoryQueryType: FactoryQueryType.Barchart, + dateRange: expect.anything(), + field: 'myField', }), expect.anything() ); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts index f64b0eb7a6684..88f880122e426 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts @@ -9,14 +9,13 @@ import { TimeRangeBounds } from '@kbn/data-plugin/common'; import type { ISearchStart, QueryStart } from '@kbn/data-plugin/public'; import type { Filter, Query, TimeRange } from '@kbn/es-query'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; -import { calculateBarchartColumnTimeInterval } from '../../../common/utils/dates'; -import { RawIndicatorFieldId } from '../types'; -import { getIndicatorQueryParams, search } from '../utils'; +import { BARCHART_AGGREGATION_NAME, FactoryQueryType } from '../../../../common/constants'; +import { RawIndicatorFieldId } from '../../../../common/types/indicator'; +import { search } from '../utils/search'; +import { getIndicatorQueryParams } from '../utils/get_indicator_query_params'; const TIMESTAMP_FIELD = RawIndicatorFieldId.TimeStamp; -export const AGGREGATION_NAME = 'barchartAggregation'; - export interface AggregationValue { doc_count: number; key: number; @@ -33,7 +32,7 @@ export interface Aggregation { export interface RawAggregatedIndicatorsResponse { aggregations: { - [AGGREGATION_NAME]: { + [BARCHART_AGGREGATION_NAME]: { buckets: Aggregation[]; }; }; @@ -90,45 +89,33 @@ export const createFetchAggregatedIndicators = const dateFrom: number = (dateRange.min as moment.Moment).toDate().getTime(); const dateTo: number = (dateRange.max as moment.Moment).toDate().getTime(); - const interval = calculateBarchartColumnTimeInterval(dateFrom, dateTo); const sharedParams = getIndicatorQueryParams({ timeRange, filters, filterQuery }); const searchRequestBody = { - aggregations: { - [AGGREGATION_NAME]: { - terms: { - field, - }, - aggs: { - events: { - date_histogram: { - field: TIMESTAMP_FIELD, - fixed_interval: interval, - min_doc_count: 0, - extended_bounds: { - min: dateFrom, - max: dateTo, - }, - }, - }, - }, - }, - }, fields: [TIMESTAMP_FIELD, field], size: 0, ...sharedParams, }; const { - aggregations: { [AGGREGATION_NAME]: aggregation }, - } = await search<RawAggregatedIndicatorsResponse>( + aggregations: { [BARCHART_AGGREGATION_NAME]: aggregation }, + } = await search< + RawAggregatedIndicatorsResponse, + { dateRange: { from: number; to: number }; field: string } + >( searchService, { params: { index: selectedPatterns, body: searchRequestBody, }, + factoryQueryType: FactoryQueryType.Barchart, + dateRange: { + from: dateFrom, + to: dateTo, + }, + field, }, { signal, inspectorAdapter, requestName: 'Indicators barchart' } ); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts index 388b1c9c9e7c5..73cde89df4c74 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts @@ -9,6 +9,7 @@ import { mockedSearchService } from '../../../common/mocks/test_providers'; import { BehaviorSubject, throwError } from 'rxjs'; import { createFetchIndicators } from './fetch_indicators'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; +import { FactoryQueryType } from '../../../../common/constants'; const indicatorsResponse = { rawResponse: { hits: { hits: [], total: 0 } } }; @@ -47,15 +48,12 @@ describe('FetchIndicatorsService', () => { fields: [{ field: '*', include_unmapped: true }], from: 0, query: expect.objectContaining({ bool: expect.anything() }), - runtime_mappings: { - 'threat.indicator.name': { script: expect.anything(), type: 'keyword' }, - 'threat.indicator.name_origin': { script: expect.anything(), type: 'keyword' }, - }, size: 25, sort: [], }, index: [], }, + factoryQueryType: FactoryQueryType.IndicatorGrid, }), expect.anything() ); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts index 0bdd5c52f4133..c8dfd374920c5 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts @@ -8,8 +8,10 @@ import { ISearchStart } from '@kbn/data-plugin/public'; import type { Filter, Query, TimeRange } from '@kbn/es-query'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; -import { Indicator } from '../types'; -import { getIndicatorQueryParams, search } from '../utils'; +import { FactoryQueryType } from '../../../../common/constants'; +import { Indicator } from '../../../../common/types/indicator'; +import { getIndicatorQueryParams } from '../utils/get_indicator_query_params'; +import { search } from '../utils/search'; export interface RawIndicatorsResponse { hits: { @@ -75,6 +77,7 @@ export const createFetchIndicators = index: selectedPatterns, body: searchRequestBody, }, + factoryQueryType: FactoryQueryType.IndicatorGrid, }, { inspectorAdapter, requestName: 'Indicators table', signal } ); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/types/index.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/types/index.ts deleted file mode 100644 index 4ea5306322ded..0000000000000 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/types/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 './indicator'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.test.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.test.ts deleted file mode 100644 index cfc7f73a8d7f3..0000000000000 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.test.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 { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './display_name'; - -describe('display name generation', () => { - describe('threatIndicatorNamesScript()', () => { - it('should generate a valid painless script', () => { - expect(threatIndicatorNamesScript()).toMatchInlineSnapshot(` - "if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='ipv4-addr') { if (doc['threat.indicator.ip'].value!=null) { return emit(doc['threat.indicator.ip'].value) } } - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='ipv6-addr') { if (doc['threat.indicator.ip'].value!=null) { return emit(doc['threat.indicator.ip'].value) } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='file') { if (doc['threat.indicator.file.hash.sha256'].value!=null) { return emit(doc['threat.indicator.file.hash.sha256'].value) } - if (doc['threat.indicator.file.hash.md5'].value!=null) { return emit(doc['threat.indicator.file.hash.md5'].value) } - if (doc['threat.indicator.file.hash.sha1'].value!=null) { return emit(doc['threat.indicator.file.hash.sha1'].value) } - if (doc['threat.indicator.file.hash.sha224'].value!=null) { return emit(doc['threat.indicator.file.hash.sha224'].value) } - if (doc['threat.indicator.file.hash.sha3-224'].value!=null) { return emit(doc['threat.indicator.file.hash.sha3-224'].value) } - if (doc['threat.indicator.file.hash.sha3-256'].value!=null) { return emit(doc['threat.indicator.file.hash.sha3-256'].value) } - if (doc['threat.indicator.file.hash.sha384'].value!=null) { return emit(doc['threat.indicator.file.hash.sha384'].value) } - if (doc['threat.indicator.file.hash.sha3-384'].value!=null) { return emit(doc['threat.indicator.file.hash.sha3-384'].value) } - if (doc['threat.indicator.file.hash.sha512'].value!=null) { return emit(doc['threat.indicator.file.hash.sha512'].value) } - if (doc['threat.indicator.file.hash.sha3-512'].value!=null) { return emit(doc['threat.indicator.file.hash.sha3-512'].value) } - if (doc['threat.indicator.file.hash.sha512/224'].value!=null) { return emit(doc['threat.indicator.file.hash.sha512/224'].value) } - if (doc['threat.indicator.file.hash.sha512/256'].value!=null) { return emit(doc['threat.indicator.file.hash.sha512/256'].value) } - if (doc['threat.indicator.file.ssdeep'].value!=null) { return emit(doc['threat.indicator.file.ssdeep'].value) } - if (doc['threat.indicator.file.tlsh'].value!=null) { return emit(doc['threat.indicator.file.tlsh'].value) } - if (doc['threat.indicator.file.impfuzzy'].value!=null) { return emit(doc['threat.indicator.file.impfuzzy'].value) } - if (doc['threat.indicator.file.imphash'].value!=null) { return emit(doc['threat.indicator.file.imphash'].value) } - if (doc['threat.indicator.file.pehash'].value!=null) { return emit(doc['threat.indicator.file.pehash'].value) } - if (doc['threat.indicator.file.vhash'].value!=null) { return emit(doc['threat.indicator.file.vhash'].value) } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='url') { if (doc['threat.indicator.url.full'].value!=null) { return emit(doc['threat.indicator.url.full'].value) } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='domain') { if (doc['threat.indicator.url.domain'].value!=null) { return emit(doc['threat.indicator.url.domain'].value) } } - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='domain-name') { if (doc['threat.indicator.url.domain'].value!=null) { return emit(doc['threat.indicator.url.domain'].value) } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='x509-certificate') { if (doc['threat.indicator.x509.serial_number'].value!=null) { return emit(doc['threat.indicator.x509.serial_number'].value) } } - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='x509 serial') { if (doc['threat.indicator.x509.serial_number'].value!=null) { return emit(doc['threat.indicator.x509.serial_number'].value) } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email-addr') { if (doc['threat.indicator.email.address'].value!=null) { return emit(doc['threat.indicator.email.address'].value) } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='unknown') { if (doc['_id'].value!=null) { return emit(doc['_id'].value) } } - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email') { if (doc['_id'].value!=null) { return emit(doc['_id'].value) } } - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email-message') { if (doc['_id'].value!=null) { return emit(doc['_id'].value) } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='windows-registry-key') { if (doc['threat.indicator.registry.key'].value!=null) { return emit(doc['threat.indicator.registry.key'].value) } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='autonomous-system') { if (doc['threat.indicator.as.number'].value!=null) { return emit(doc['threat.indicator.as.number'].value) } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='mac-addr') { if (doc['threat.indicator.mac'].value!=null) { return emit(doc['threat.indicator.mac'].value) } } - - return emit('')" - `); - }); - }); - - describe('threatIndicatorNamesOriginScript()', () => { - it('should generate a valid painless script', () => { - expect(threatIndicatorNamesOriginScript()).toMatchInlineSnapshot(` - "if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='ipv4-addr') { if (doc['threat.indicator.ip'].value!=null) { return emit('threat.indicator.ip') } } - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='ipv6-addr') { if (doc['threat.indicator.ip'].value!=null) { return emit('threat.indicator.ip') } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='file') { if (doc['threat.indicator.file.hash.sha256'].value!=null) { return emit('threat.indicator.file.hash.sha256') } - if (doc['threat.indicator.file.hash.md5'].value!=null) { return emit('threat.indicator.file.hash.md5') } - if (doc['threat.indicator.file.hash.sha1'].value!=null) { return emit('threat.indicator.file.hash.sha1') } - if (doc['threat.indicator.file.hash.sha224'].value!=null) { return emit('threat.indicator.file.hash.sha224') } - if (doc['threat.indicator.file.hash.sha3-224'].value!=null) { return emit('threat.indicator.file.hash.sha3-224') } - if (doc['threat.indicator.file.hash.sha3-256'].value!=null) { return emit('threat.indicator.file.hash.sha3-256') } - if (doc['threat.indicator.file.hash.sha384'].value!=null) { return emit('threat.indicator.file.hash.sha384') } - if (doc['threat.indicator.file.hash.sha3-384'].value!=null) { return emit('threat.indicator.file.hash.sha3-384') } - if (doc['threat.indicator.file.hash.sha512'].value!=null) { return emit('threat.indicator.file.hash.sha512') } - if (doc['threat.indicator.file.hash.sha3-512'].value!=null) { return emit('threat.indicator.file.hash.sha3-512') } - if (doc['threat.indicator.file.hash.sha512/224'].value!=null) { return emit('threat.indicator.file.hash.sha512/224') } - if (doc['threat.indicator.file.hash.sha512/256'].value!=null) { return emit('threat.indicator.file.hash.sha512/256') } - if (doc['threat.indicator.file.ssdeep'].value!=null) { return emit('threat.indicator.file.ssdeep') } - if (doc['threat.indicator.file.tlsh'].value!=null) { return emit('threat.indicator.file.tlsh') } - if (doc['threat.indicator.file.impfuzzy'].value!=null) { return emit('threat.indicator.file.impfuzzy') } - if (doc['threat.indicator.file.imphash'].value!=null) { return emit('threat.indicator.file.imphash') } - if (doc['threat.indicator.file.pehash'].value!=null) { return emit('threat.indicator.file.pehash') } - if (doc['threat.indicator.file.vhash'].value!=null) { return emit('threat.indicator.file.vhash') } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='url') { if (doc['threat.indicator.url.full'].value!=null) { return emit('threat.indicator.url.full') } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='domain') { if (doc['threat.indicator.url.domain'].value!=null) { return emit('threat.indicator.url.domain') } } - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='domain-name') { if (doc['threat.indicator.url.domain'].value!=null) { return emit('threat.indicator.url.domain') } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='x509-certificate') { if (doc['threat.indicator.x509.serial_number'].value!=null) { return emit('threat.indicator.x509.serial_number') } } - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='x509 serial') { if (doc['threat.indicator.x509.serial_number'].value!=null) { return emit('threat.indicator.x509.serial_number') } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email-addr') { if (doc['threat.indicator.email.address'].value!=null) { return emit('threat.indicator.email.address') } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='unknown') { if (doc['_id'].value!=null) { return emit('_id') } } - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email') { if (doc['_id'].value!=null) { return emit('_id') } } - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email-message') { if (doc['_id'].value!=null) { return emit('_id') } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='windows-registry-key') { if (doc['threat.indicator.registry.key'].value!=null) { return emit('threat.indicator.registry.key') } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='autonomous-system') { if (doc['threat.indicator.as.number'].value!=null) { return emit('threat.indicator.as.number') } } - - if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='mac-addr') { if (doc['threat.indicator.mac'].value!=null) { return emit('threat.indicator.mac') } } - - return emit('')" - `); - }); - }); -}); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.ts deleted file mode 100644 index 31a149322efa9..0000000000000 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.ts +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import dedent from 'dedent'; -import { RawIndicatorFieldId } from '../types'; - -/** - * Mapping connects one ore more types to field values that should be used to generate threat.indicator.name field. - */ -type Mapping = [types: string[], paths: RawIndicatorFieldId[]]; - -type Mappings = Mapping[]; - -const mappingsArray: Mappings = [ - [['ipv4-addr', 'ipv6-addr'], [RawIndicatorFieldId.Ip]], - // For example, `file` indicator will have `threat.indicator.name` computed out of the first - // hash value field defined below, in order of occurrence - [ - ['file'], - [ - RawIndicatorFieldId.FileSha256, - RawIndicatorFieldId.FileMd5, - RawIndicatorFieldId.FileSha1, - RawIndicatorFieldId.FileSha224, - RawIndicatorFieldId.FileSha3224, - RawIndicatorFieldId.FileSha3256, - RawIndicatorFieldId.FileSha384, - RawIndicatorFieldId.FileSha3384, - RawIndicatorFieldId.FileSha512, - RawIndicatorFieldId.FileSha3512, - RawIndicatorFieldId.FileSha512224, - RawIndicatorFieldId.FileSha512256, - RawIndicatorFieldId.FileSSDeep, - RawIndicatorFieldId.FileTlsh, - RawIndicatorFieldId.FileImpfuzzy, - RawIndicatorFieldId.FileImphash, - RawIndicatorFieldId.FilePehash, - RawIndicatorFieldId.FileVhash, - ], - ], - [['url'], [RawIndicatorFieldId.UrlFull]], - [['domain', 'domain-name'], [RawIndicatorFieldId.UrlDomain]], - [['x509-certificate', 'x509 serial'], [RawIndicatorFieldId.X509Serial]], - [['email-addr'], [RawIndicatorFieldId.EmailAddress]], - [['unknown', 'email', 'email-message'], [RawIndicatorFieldId.Id]], - [['windows-registry-key'], [RawIndicatorFieldId.WindowsRegistryKey]], - [['autonomous-system'], [RawIndicatorFieldId.AutonomousSystemNumber]], - [['mac-addr'], [RawIndicatorFieldId.MacAddress]], -]; - -/** - * Generates Painless condition checking if given `type` is matched - */ -const fieldTypeCheck = (type: string) => - `if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='${type.toLowerCase()}')`; - -/** - * Generates Painless condition checking if given `field` has value - */ -const fieldValueCheck = (field: string) => `if (doc['${field}'].value!=null)`; - -/** - * Converts Mapping to Painless script, computing `threat.indicator.name` value for given indicator types. - */ -const mappingToIndicatorNameScript = ([types, paths]: Mapping) => { - return dedent`${types - .map( - (t) => - `${fieldTypeCheck(t)} { ${paths - .map((p) => `${fieldValueCheck(p)} { return emit(doc['${p}'].value) }`) - .join('\n')} }` - ) - .join('\n')}`; -}; - -/** - * Converts Mapping to Painless script, computing `threat.indicator.name_origin` used to determine which document field has - * been used to obtain `threat.indicator.name`. - */ -const mappingToIndicatorNameOriginScript = ([types, paths]: Mapping) => { - return dedent`${types - .map( - (t) => - `${fieldTypeCheck(t)} { ${paths - .map((p) => `${fieldValueCheck(p)} { return emit('${p}') }`) - .join('\n')} }` - ) - .join('\n')}`; -}; - -/** - * Generates the runtime field script computing display name for the given indicator - */ -export const threatIndicatorNamesScript = (mappings: Mappings = mappingsArray) => { - const combined = mappings.map(mappingToIndicatorNameScript).join('\n\n'); - - return `${combined}\n\nreturn emit('')`; -}; - -/** - * Generates the runtime field script computing the display name origin path for given indicator - */ -export const threatIndicatorNamesOriginScript = (mappings: Mappings = mappingsArray) => { - const combined = mappings.map(mappingToIndicatorNameOriginScript).join('\n\n'); - - return `${combined}\n\nreturn emit('')`; -}; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts index 8c38d85955331..6bdbca5b51877 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts @@ -6,7 +6,10 @@ */ import { fieldAndValueValid, getIndicatorFieldAndValue } from './field_value'; -import { generateMockFileIndicator, generateMockUrlIndicator } from '../types'; +import { + generateMockFileIndicator, + generateMockUrlIndicator, +} from '../../../../common/types/indicator'; import { EMPTY_VALUE } from '../../../common/constants'; describe('field_value', () => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts index 5756248a61f55..1211ebb48ffba 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts @@ -7,7 +7,7 @@ import { EMPTY_VALUE } from '../../../common/constants'; import { unwrapValue } from './unwrap_value'; -import { Indicator, RawIndicatorFieldId } from '../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../common/types/indicator'; /** * Retrieves a field/value pair from an Indicator diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts index cdf4e846c2ca2..4bd091195fd6c 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts @@ -7,13 +7,12 @@ import { buildEsQuery, Filter, Query, TimeRange } from '@kbn/es-query'; import { THREAT_QUERY_BASE } from '../../../common/constants'; -import { RawIndicatorFieldId } from '..'; -import { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './display_name'; +import { RawIndicatorFieldId } from '../../../../common/types/indicator'; const TIMESTAMP_FIELD = RawIndicatorFieldId.TimeStamp; /** - * Prepare shared `runtime_mappings` and `query` fields used within indicator search request + * Prepare shared `query` fields used within indicator search request */ export const getIndicatorQueryParams = ({ filters, @@ -25,20 +24,6 @@ export const getIndicatorQueryParams = ({ timeRange?: TimeRange; }) => { return { - runtime_mappings: { - [RawIndicatorFieldId.Name]: { - type: 'keyword', - script: { - source: threatIndicatorNamesScript(), - }, - }, - [RawIndicatorFieldId.NameOrigin]: { - type: 'keyword', - script: { - source: threatIndicatorNamesOriginScript(), - }, - }, - } as const, query: buildEsQuery( undefined, [ diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts index 9a542d2960bd1..04ca3df2a509e 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts @@ -5,10 +5,8 @@ * 2.0. */ -export * from './display_name'; export * from './field_value'; export * from './get_field_schema'; export * from './get_indicator_query_params'; -export * from './get_runtime_mappings'; export * from './search'; export * from './unwrap_value'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts index 49cd371680ce0..92ede2d4f3d92 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts @@ -13,6 +13,7 @@ import { } from '@kbn/data-plugin/common'; import { ISearchStart } from '@kbn/data-plugin/public'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; +import { THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME } from '../../../../common/constants'; interface SearchOptions { /** @@ -35,9 +36,9 @@ interface SearchOptions { * This is a searchService wrapper that will instrument your query with `inspector` and turn it into a Promise, * resolved when complete result set is returned or rejected on any error, other than Abort. */ -export const search = async <TResponse>( +export const search = async <TResponse, T = {}>( searchService: ISearchStart, - searchRequest: IEsSearchRequest, + searchRequest: IEsSearchRequest & { factoryQueryType: string } & T, { inspectorAdapter, requestName, signal }: SearchOptions ): Promise<TResponse> => { const requestId = `${Date.now()}`; @@ -47,6 +48,7 @@ export const search = async <TResponse>( searchService .search<IEsSearchRequest, IKibanaSearchResponse<TResponse>>(searchRequest, { abortSignal: signal, + strategy: THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME, }) .subscribe({ next: (response) => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts index 85d2e9b147871..8edb6b5397209 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RawIndicatorFieldId } from '../types'; +import { RawIndicatorFieldId } from '../../../../common/types/indicator'; import { unwrapValue } from './unwrap_value'; describe('unwrapValue()', () => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts index a79e17c99c498..8d3ef63ec9f0b 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Indicator, RawIndicatorFieldId } from '../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../common/types/indicator'; /** * Unpacks field value from raw indicator fields. Will return null if fields are missing entirely diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.stories.tsx index 7ce8a72c17516..6c0619492cac1 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.stories.tsx @@ -10,7 +10,8 @@ import { Story } from '@storybook/react'; import { EuiContextMenuPanel, EuiDataGrid, EuiDataGridColumn } from '@elastic/eui'; import { EuiDataGridColumnVisibility } from '@elastic/eui/src/components/datagrid/data_grid_types'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; -import { generateMockIndicator, Indicator, IndicatorsFiltersContext } from '../../../indicators'; +import { IndicatorsFiltersContext } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { FilterInButtonIcon, FilterInCellAction, FilterInContextMenu } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.test.tsx index 9273ea007cb43..0bcb4d0a33581 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.test.tsx @@ -8,7 +8,8 @@ import React, { FunctionComponent } from 'react'; import { render } from '@testing-library/react'; import { EuiButtonIcon } from '@elastic/eui'; -import { generateMockIndicator, Indicator, useIndicatorsFiltersContext } from '../../../indicators'; +import { useIndicatorsFiltersContext } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; import { FilterInButtonEmpty, diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.tsx index 43fb9d06a79da..f87bb0813249d 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { EuiButtonEmpty, EuiButtonIcon, EuiContextMenuItem, EuiToolTip } from '@elastic/eui'; import { useFilterInOut } from '../../hooks'; import { FilterIn } from '../../utils'; -import { Indicator } from '../../../indicators'; +import { Indicator } from '../../../../../common/types/indicator'; import { useStyles } from './styles'; const ICON_TYPE = 'plusInCircle'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.stories.tsx index 93cba542f8988..1585741bfbfa7 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.stories.tsx @@ -10,7 +10,8 @@ import { Story } from '@storybook/react'; import { EuiContextMenuPanel, EuiDataGrid, EuiDataGridColumn } from '@elastic/eui'; import { EuiDataGridColumnVisibility } from '@elastic/eui/src/components/datagrid/data_grid_types'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; -import { generateMockIndicator, Indicator, IndicatorsFiltersContext } from '../../../indicators'; +import { IndicatorsFiltersContext } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { FilterOutButtonIcon, FilterOutCellAction, FilterOutContextMenu } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.test.tsx index 0f58416a25a82..ff9997960ef8f 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.test.tsx @@ -8,7 +8,8 @@ import React, { FunctionComponent } from 'react'; import { render } from '@testing-library/react'; import { EuiButtonIcon } from '@elastic/eui'; -import { generateMockIndicator, Indicator, useIndicatorsFiltersContext } from '../../../indicators'; +import { useIndicatorsFiltersContext } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; import { FilterOutButtonEmpty, diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.tsx index b2ed00a6f0f55..590cee62b1e26 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { EuiButtonEmpty, EuiButtonIcon, EuiContextMenuItem, EuiToolTip } from '@elastic/eui'; import { useFilterInOut } from '../../hooks'; import { FilterOut } from '../../utils'; -import { Indicator } from '../../../indicators'; +import { Indicator } from '../../../../../common/types/indicator'; import { useStyles } from './styles'; const ICON_TYPE = 'minusInCircle'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts b/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts index bd301c3b8d7c8..369c6758df278 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts @@ -6,7 +6,11 @@ */ import { Renderer, renderHook, RenderHookResult } from '@testing-library/react-hooks'; -import { generateMockIndicator, generateMockUrlIndicator, Indicator } from '../../indicators'; +import { + generateMockIndicator, + generateMockUrlIndicator, + Indicator, +} from '../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../common/mocks/test_providers'; import { useFilterInOut, UseFilterInValue } from '.'; import { FilterIn } from '../utils'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts b/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts index d869271025d7d..d45a5e3dd231f 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts @@ -10,9 +10,9 @@ import { Filter } from '@kbn/es-query'; import { fieldAndValueValid, getIndicatorFieldAndValue, - Indicator, useIndicatorsFiltersContext, } from '../../indicators'; +import { Indicator } from '../../../../common/types/indicator'; import { FilterIn, FilterOut, updateFiltersArray } from '../utils'; export interface UseFilterInParam { diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.stories.tsx index 2f5cb1707388e..eef3b90782f6b 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.stories.tsx @@ -11,7 +11,7 @@ import { CoreStart } from '@kbn/core/public'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import { EuiContextMenuPanel } from '@elastic/eui'; import { mockKibanaTimelinesService } from '../../../../common/mocks/mock_kibana_timelines_service'; -import { generateMockIndicator, Indicator } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { AddToTimelineButtonIcon, AddToTimelineContextMenu } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.test.tsx index c69336cfa27a6..2147987b9e1c1 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { render } from '@testing-library/react'; -import { generateMockIndicator, Indicator } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { EMPTY_VALUE } from '../../../../common/constants'; import { AddToTimelineButtonIcon } from '.'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.tsx index 98b46b8cd9e0d..d15c06426311f 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.tsx @@ -17,7 +17,8 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { generateDataProvider } from '../../utils'; -import { fieldAndValueValid, getIndicatorFieldAndValue, Indicator } from '../../../indicators'; +import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../../indicators'; +import { Indicator } from '../../../../../common/types/indicator'; import { useKibana } from '../../../../hooks'; import { useStyles } from './styles'; import { useAddToTimeline } from '../../hooks'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.stories.tsx index 572675e9d2328..08fe4b782c2c0 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Story } from '@storybook/react'; import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; -import { generateMockUrlIndicator } from '../../../indicators'; +import { generateMockUrlIndicator } from '../../../../../common/types/indicator'; import { InvestigateInTimelineButton, InvestigateInTimelineButtonIcon } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.test.tsx index c155fba23a0f0..81850d049d830 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.test.tsx @@ -7,7 +7,11 @@ import React from 'react'; import { render } from '@testing-library/react'; -import { generateMockIndicator, generateMockUrlIndicator, Indicator } from '../../../indicators'; +import { + generateMockIndicator, + generateMockUrlIndicator, + Indicator, +} from '../../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; import { InvestigateInTimelineButton, InvestigateInTimelineButtonIcon } from '.'; import { EMPTY_VALUE } from '../../../../common/constants'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.tsx index 2ded440b80c41..c99c02ac8f8a2 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.tsx @@ -10,7 +10,7 @@ import { EuiButton, EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useInvestigateInTimeline } from '../../hooks'; -import { Indicator } from '../../../indicators'; +import { Indicator } from '../../../../../common/types/indicator'; const BUTTON_ICON_LABEL: string = i18n.translate( 'xpack.threatIntelligence.timeline.investigateInTimelineButtonIcon', diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx index 94c7914c98698..f77219f7f5c6d 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx @@ -7,7 +7,11 @@ import { EMPTY_VALUE } from '../../../common/constants'; import { Renderer, renderHook, RenderHookResult } from '@testing-library/react-hooks'; -import { generateMockIndicator, generateMockUrlIndicator, Indicator } from '../../indicators'; +import { + generateMockIndicator, + generateMockUrlIndicator, + Indicator, +} from '../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../common/mocks/test_providers'; import { useAddToTimeline, UseAddToTimelineValue } from '.'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts index 0cc0daf1a40d8..f23866ac5e3ea 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts @@ -8,7 +8,8 @@ import { DataProvider } from '@kbn/timelines-plugin/common'; import { AddToTimelineButtonProps } from '@kbn/timelines-plugin/public'; import { generateDataProvider } from '../utils'; -import { fieldAndValueValid, getIndicatorFieldAndValue, Indicator } from '../../indicators'; +import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../indicators'; +import { Indicator } from '../../../../common/types/indicator'; export interface UseAddToTimelineParam { /** diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx index 661d8188eb878..b8c45e2095204 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx @@ -7,7 +7,11 @@ import { Renderer, renderHook, RenderHookResult } from '@testing-library/react-hooks'; import { useInvestigateInTimeline, UseInvestigateInTimelineValue } from '.'; -import { generateMockIndicator, generateMockUrlIndicator, Indicator } from '../../indicators'; +import { + generateMockIndicator, + generateMockUrlIndicator, + Indicator, +} from '../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../common/mocks/test_providers'; describe('useInvestigateInTimeline()', () => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts index 5717b831d7951..d656976cfa4b2 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts @@ -10,14 +10,12 @@ import moment from 'moment'; import { DataProvider } from '@kbn/timelines-plugin/common'; import { generateDataProvider } from '../utils'; import { SecuritySolutionContext } from '../../../containers/security_solution_context'; +import { fieldAndValueValid, getIndicatorFieldAndValue, unwrapValue } from '../../indicators'; import { - fieldAndValueValid, - getIndicatorFieldAndValue, Indicator, IndicatorFieldEventEnrichmentMap, RawIndicatorFieldId, - unwrapValue, -} from '../../indicators'; +} from '../../../../common/types/indicator'; export interface UseInvestigateInTimelineParam { /** diff --git a/x-pack/plugins/threat_intelligence/public/plugin.tsx b/x-pack/plugins/threat_intelligence/public/plugin.tsx index 88214b3abe3f1..d1e4391edfc0a 100755 --- a/x-pack/plugins/threat_intelligence/public/plugin.tsx +++ b/x-pack/plugins/threat_intelligence/public/plugin.tsx @@ -8,9 +8,9 @@ import { CoreStart, Plugin } from '@kbn/core/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { Provider as ReduxStoreProvider } from 'react-redux'; -import React, { Suspense, VFC } from 'react'; +import React from 'react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { KibanaContextProvider } from './hooks'; +import { KibanaContextProvider } from './hooks/use_kibana'; import { SecuritySolutionPluginContext, Services, @@ -20,22 +20,12 @@ import { } from './types'; import { SecuritySolutionContext } from './containers/security_solution_context'; import { EnterpriseGuard } from './containers/enterprise_guard'; -import { SecuritySolutionPluginTemplateWrapper } from './containers/security_solution_plugin_template_wrapper'; -import { IntegrationsGuard } from './containers/integrations_guard'; interface AppProps { securitySolutionContext: SecuritySolutionPluginContext; } -const LazyIndicatorsPage = React.lazy(() => import('./modules/indicators/pages/indicators')); - -const IndicatorsPage: VFC = () => ( - <SecuritySolutionPluginTemplateWrapper> - <Suspense fallback={<div />}> - <LazyIndicatorsPage /> - </Suspense> - </SecuritySolutionPluginTemplateWrapper> -); +const LazyIndicatorsPageWrapper = React.lazy(() => import('./containers/indicators_page_wrapper')); /** * This is used here: @@ -51,9 +41,7 @@ export const createApp = <SecuritySolutionContext.Provider value={securitySolutionContext}> <KibanaContextProvider services={services}> <EnterpriseGuard> - <IntegrationsGuard> - <IndicatorsPage /> - </IntegrationsGuard> + <LazyIndicatorsPageWrapper /> </EnterpriseGuard> </KibanaContextProvider> </SecuritySolutionContext.Provider> diff --git a/x-pack/plugins/threat_intelligence/public/utils/filter_integrations.test.ts b/x-pack/plugins/threat_intelligence/public/utils/filter_integrations.test.ts new file mode 100644 index 0000000000000..507bdb5ca4ab2 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/utils/filter_integrations.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 { Integration } from '../hooks'; +import { filterIntegrations, THREAT_INTELLIGENCE_CATEGORY, THREAT_INTELLIGENCE_UTILITIES } from '.'; + +describe('filterIntegrations', () => { + it('should empty array', async () => { + const mockIntegrations: Integration[] = []; + const result = filterIntegrations(mockIntegrations); + expect(result).toEqual(mockIntegrations); + }); + + it('should return only installed ti integrations (excluding ti_utils)', async () => { + const tiInstalledIntegration: Integration = { + categories: [THREAT_INTELLIGENCE_CATEGORY], + id: '123', + status: 'installed', + }; + const tiNotInstalledIntegration: Integration = { + categories: [THREAT_INTELLIGENCE_CATEGORY], + id: '456', + status: 'install_failed', + }; + const nonTIInstalledIntegration: Integration = { + categories: ['abc'], + id: '789', + status: 'installed', + }; + const tiUtilsIntegration: Integration = { + categories: [THREAT_INTELLIGENCE_CATEGORY], + id: THREAT_INTELLIGENCE_UTILITIES, + status: 'installed', + }; + const randomIntegration: Integration = { + categories: ['abc'], + id: 'def', + status: 'installing', + }; + const mockIntegrations: Integration[] = [ + tiInstalledIntegration, + tiNotInstalledIntegration, + nonTIInstalledIntegration, + tiUtilsIntegration, + randomIntegration, + ]; + + const result = filterIntegrations(mockIntegrations); + + expect(result).toEqual([tiInstalledIntegration]); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/public/utils/filter_integrations.ts b/x-pack/plugins/threat_intelligence/public/utils/filter_integrations.ts new file mode 100644 index 0000000000000..075c34344cbc9 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/utils/filter_integrations.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 { Integration } from '../hooks'; + +export const INSTALLATION_STATUS = { + Installed: 'installed', + Installing: 'installing', + InstallFailed: 'install_failed', + NotInstalled: 'not_installed', +}; + +export const THREAT_INTELLIGENCE_CATEGORY = 'threat_intel'; + +export const THREAT_INTELLIGENCE_UTILITIES = 'ti_util'; + +/** + * Filter an array of integrations: + * - of status `installed` + * - with `threat_intel` category + * - excluding `ti_util` integration + * + * For more details see https://github.com/elastic/security-team/issues/4374 + * + * @param integrations the response from the packages endpoint in the Fleet plugin + */ +export const filterIntegrations = (integrations: Integration[]): Integration[] => + integrations.filter( + (pkg: any) => + pkg.status === INSTALLATION_STATUS.Installed && + pkg.categories.find((category: string) => category === THREAT_INTELLIGENCE_CATEGORY) != + null && + pkg.id !== THREAT_INTELLIGENCE_UTILITIES + ); diff --git a/x-pack/plugins/threat_intelligence/public/utils/index.ts b/x-pack/plugins/threat_intelligence/public/utils/index.ts new file mode 100644 index 0000000000000..6459678cb8073 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/utils/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 './filter_integrations'; diff --git a/x-pack/plugins/threat_intelligence/server/index.ts b/x-pack/plugins/threat_intelligence/server/index.ts new file mode 100644 index 0000000000000..c658a352a6077 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PluginInitializerContext } from '@kbn/core/server'; +import { ThreatIntelligencePlugin } from './plugin'; + +export const plugin = (context: PluginInitializerContext) => { + return new ThreatIntelligencePlugin(context); +}; diff --git a/x-pack/plugins/threat_intelligence/server/plugin.ts b/x-pack/plugins/threat_intelligence/server/plugin.ts new file mode 100644 index 0000000000000..731659208dacc --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/plugin.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 type { PluginInitializerContext, Logger } from '@kbn/core/server'; +import { THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME } from '../common/constants'; +import { + IThreatIntelligencePlugin, + ThreatIntelligencePluginCoreSetupDependencies, + ThreatIntelligencePluginSetupDependencies, +} from './types'; +import { threatIntelligenceSearchStrategyProvider } from './search_strategy'; + +export class ThreatIntelligencePlugin implements IThreatIntelligencePlugin { + private readonly logger: Logger; + + constructor(context: PluginInitializerContext) { + this.logger = context.logger.get(); + } + + setup( + core: ThreatIntelligencePluginCoreSetupDependencies, + plugins: ThreatIntelligencePluginSetupDependencies + ) { + this.logger.debug('setup'); + + core.getStartServices().then(([_, { data: dataStartService }]) => { + const threatIntelligenceSearchStrategy = + threatIntelligenceSearchStrategyProvider(dataStartService); + + plugins.data.search.registerSearchStrategy( + THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME, + threatIntelligenceSearchStrategy + ); + + this.logger.debug(`search strategy "${THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME}" registered`); + }); + + return {}; + } + + start() { + this.logger.debug('start'); + + return {}; + } + + stop() { + this.logger.debug('stop'); + } +} diff --git a/x-pack/plugins/threat_intelligence/server/search_strategy.ts b/x-pack/plugins/threat_intelligence/server/search_strategy.ts new file mode 100644 index 0000000000000..0ea7a7a9458a8 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/search_strategy.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 { + ENHANCED_ES_SEARCH_STRATEGY, + IEsSearchRequest, + ISearchRequestParams, +} from '@kbn/data-plugin/common'; +import { ISearchStrategy, PluginStart, shimHitsTotal } from '@kbn/data-plugin/server'; +import { map } from 'rxjs/operators'; +import { BARCHART_AGGREGATION_NAME, FactoryQueryType } from '../common/constants'; +import { RawIndicatorFieldId } from '../common/types/indicator'; +import { calculateBarchartColumnTimeInterval } from './utils/calculate_barchart_time_interval'; +import { createRuntimeMappings } from './utils/get_indicator_query_params'; + +const TIMESTAMP_FIELD = RawIndicatorFieldId.TimeStamp; + +function isObj(req: unknown): req is Record<string, unknown> { + return typeof req === 'object' && req !== null; +} + +function assertValidRequestType(req: unknown): asserts req is Record<string, {}> { + if (!isObj(req) || req.factoryQueryType == null) { + throw new Error('factoryQueryType is required'); + } +} + +type BarchartAggregationRequest = IEsSearchRequest & { + dateRange: { + from: number; + to: number; + }; + field: string; +}; + +function isBarchartRequest(req: unknown): req is BarchartAggregationRequest { + return isObj(req) && req.factoryQueryType === FactoryQueryType.Barchart; +} + +const getAggregationsQuery = (request: BarchartAggregationRequest) => { + const { + dateRange: { from: min, to: max }, + field, + } = request; + + const interval = calculateBarchartColumnTimeInterval(min, max); + + return { + aggregations: { + [BARCHART_AGGREGATION_NAME]: { + terms: { + field, + }, + aggs: { + events: { + date_histogram: { + field: TIMESTAMP_FIELD, + fixed_interval: interval, + min_doc_count: 0, + extended_bounds: { + min, + max, + }, + }, + }, + }, + }, + }, + fields: [TIMESTAMP_FIELD, field], + size: 0, + }; +}; + +export const threatIntelligenceSearchStrategyProvider = (data: PluginStart): ISearchStrategy => { + const es = data.search.getSearchStrategy(ENHANCED_ES_SEARCH_STRATEGY); + + return { + search: (request, options, deps) => { + assertValidRequestType(request); + + const runtimeMappings = createRuntimeMappings(); + + const dsl = { + ...request.params, + runtime_mappings: runtimeMappings, + ...(isBarchartRequest(request) ? getAggregationsQuery(request) : {}), + } as unknown as ISearchRequestParams; + + return es.search({ ...request, params: dsl }, options, deps).pipe( + map((response) => { + return { + ...response, + ...{ + rawResponse: shimHitsTotal(response.rawResponse, options), + }, + }; + }) + ); + }, + cancel: async (id, options, deps) => { + if (es.cancel) { + return es.cancel(id, options, deps); + } + }, + }; +}; diff --git a/x-pack/plugins/threat_intelligence/server/types.ts b/x-pack/plugins/threat_intelligence/server/types.ts new file mode 100644 index 0000000000000..a9ad87a3f27c5 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/types.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 { CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; + +import { DataPluginSetup, DataPluginStart } from '@kbn/data-plugin/server/plugin'; + +export interface ThreatIntelligencePluginSetupDependencies { + data: DataPluginSetup; +} + +export interface ThreatIntelligencePluginStartDependencies { + data: DataPluginStart; +} + +export type ThreatIntelligencePluginCoreSetupDependencies = CoreSetup< + ThreatIntelligencePluginStartDependencies, + {} +>; + +export type ThreatIntelligencePluginCoreStartDependencies = CoreStart; + +export type IThreatIntelligencePlugin = Plugin< + {}, + {}, + ThreatIntelligencePluginSetupDependencies, + ThreatIntelligencePluginStartDependencies +>; diff --git a/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts b/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts new file mode 100644 index 0000000000000..98f705bf9d111 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import moment from 'moment'; +import { calculateBarchartColumnTimeInterval } from './calculate_barchart_time_interval'; + +const mockValidStringDate = '1 Jan 2022 00:00:00 GMT'; + +describe('calculateBarchartTimeInterval', () => { + it('should handle number dates', () => { + const from = moment(mockValidStringDate).valueOf(); + const to = moment(mockValidStringDate).add(1, 'days').valueOf(); + + const interval = calculateBarchartColumnTimeInterval(from, to); + expect(interval).toContain('ms'); + expect(parseInt(interval, 10) > 0).toBeTruthy(); + }); + + it('should handle moment dates', () => { + const from = moment(mockValidStringDate); + const to = moment(mockValidStringDate).add(1, 'days'); + + const interval = calculateBarchartColumnTimeInterval(from, to); + expect(interval).toContain('ms'); + expect(parseInt(interval, 10) > 0).toBeTruthy(); + }); + + it('should handle dateTo older than dateFrom', () => { + const from = moment(mockValidStringDate).add(1, 'days'); + const to = moment(mockValidStringDate); + + const interval = calculateBarchartColumnTimeInterval(from, to); + expect(parseInt(interval, 10) > 0).toBeFalsy(); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.ts b/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.ts new file mode 100644 index 0000000000000..111e47bb6d193 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.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 moment from 'moment'; + +export const BARCHART_NUMBER_OF_COLUMNS = 16; + +/** + * Calculates the time interval in ms for a specific number of columns + * @param dateFrom Min (older) date for the barchart + * @param dateTo Max (newer) date for the barchart + * @param numberOfColumns Desired number of columns (defaulted to {@link BARCHART_NUMBER_OF_COLUMNS}) + * @returns The interval in ms for a column (for example '100000ms') + */ +export const calculateBarchartColumnTimeInterval = ( + dateFrom: number | moment.Moment, + dateTo: number | moment.Moment, + numberOfColumns = BARCHART_NUMBER_OF_COLUMNS +): string => { + const from: number = moment.isMoment(dateFrom) ? dateFrom.valueOf() : dateFrom; + const to: number = moment.isMoment(dateTo) ? dateTo.valueOf() : dateTo; + return `${Math.floor(moment(to).diff(moment(from)) / numberOfColumns)}ms`; +}; diff --git a/x-pack/plugins/threat_intelligence/server/utils/get_indicator_query_params.ts b/x-pack/plugins/threat_intelligence/server/utils/get_indicator_query_params.ts new file mode 100644 index 0000000000000..5142c543c1871 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/utils/get_indicator_query_params.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 { RawIndicatorFieldId } from '../../common/types/indicator'; +import { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './indicator_name'; + +/** + * Prepare `runtime_mappings` used within TI search + */ +export const createRuntimeMappings = () => ({ + [RawIndicatorFieldId.Name]: { + type: 'keyword', + script: { + source: threatIndicatorNamesScript(), + }, + }, + [RawIndicatorFieldId.NameOrigin]: { + type: 'keyword', + script: { + source: threatIndicatorNamesOriginScript(), + }, + }, +}); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_runtime_mappings.ts b/x-pack/plugins/threat_intelligence/server/utils/get_runtime_mappings.ts similarity index 95% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_runtime_mappings.ts rename to x-pack/plugins/threat_intelligence/server/utils/get_runtime_mappings.ts index ed62b18e7c9b2..36380ffeaf0ab 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_runtime_mappings.ts +++ b/x-pack/plugins/threat_intelligence/server/utils/get_runtime_mappings.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './display_name'; +import { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './indicator_name'; export const getRuntimeMappings = () => ({ diff --git a/x-pack/plugins/threat_intelligence/server/utils/indicator_name.test.ts b/x-pack/plugins/threat_intelligence/server/utils/indicator_name.test.ts new file mode 100644 index 0000000000000..a3b11eed667c4 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/utils/indicator_name.test.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 { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './indicator_name'; + +describe('display name generation', () => { + describe('threatIndicatorNamesScript()', () => { + it('should generate a valid painless script', () => { + expect(threatIndicatorNamesScript()).toMatchInlineSnapshot(` + "if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='ipv4-addr') { if (doc['threat.indicator.ip'].value!=null) { return emit(doc['threat.indicator.ip'].value) } } + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='ipv6-addr') { if (doc['threat.indicator.ip'].value!=null) { return emit(doc['threat.indicator.ip'].value) } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='file') { if (doc['threat.indicator.file.hash.sha256'].value!=null) { return emit(doc['threat.indicator.file.hash.sha256'].value) } + if (doc['threat.indicator.file.hash.md5'].value!=null) { return emit(doc['threat.indicator.file.hash.md5'].value) } + if (doc['threat.indicator.file.hash.sha1'].value!=null) { return emit(doc['threat.indicator.file.hash.sha1'].value) } + if (doc['threat.indicator.file.hash.sha224'].value!=null) { return emit(doc['threat.indicator.file.hash.sha224'].value) } + if (doc['threat.indicator.file.hash.sha3-224'].value!=null) { return emit(doc['threat.indicator.file.hash.sha3-224'].value) } + if (doc['threat.indicator.file.hash.sha3-256'].value!=null) { return emit(doc['threat.indicator.file.hash.sha3-256'].value) } + if (doc['threat.indicator.file.hash.sha384'].value!=null) { return emit(doc['threat.indicator.file.hash.sha384'].value) } + if (doc['threat.indicator.file.hash.sha3-384'].value!=null) { return emit(doc['threat.indicator.file.hash.sha3-384'].value) } + if (doc['threat.indicator.file.hash.sha512'].value!=null) { return emit(doc['threat.indicator.file.hash.sha512'].value) } + if (doc['threat.indicator.file.hash.sha3-512'].value!=null) { return emit(doc['threat.indicator.file.hash.sha3-512'].value) } + if (doc['threat.indicator.file.hash.sha512/224'].value!=null) { return emit(doc['threat.indicator.file.hash.sha512/224'].value) } + if (doc['threat.indicator.file.hash.sha512/256'].value!=null) { return emit(doc['threat.indicator.file.hash.sha512/256'].value) } + if (doc['threat.indicator.file.ssdeep'].value!=null) { return emit(doc['threat.indicator.file.ssdeep'].value) } + if (doc['threat.indicator.file.tlsh'].value!=null) { return emit(doc['threat.indicator.file.tlsh'].value) } + if (doc['threat.indicator.file.impfuzzy'].value!=null) { return emit(doc['threat.indicator.file.impfuzzy'].value) } + if (doc['threat.indicator.file.imphash'].value!=null) { return emit(doc['threat.indicator.file.imphash'].value) } + if (doc['threat.indicator.file.pehash'].value!=null) { return emit(doc['threat.indicator.file.pehash'].value) } + if (doc['threat.indicator.file.vhash'].value!=null) { return emit(doc['threat.indicator.file.vhash'].value) } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='url') { if (doc['threat.indicator.url.full'].value!=null) { return emit(doc['threat.indicator.url.full'].value) } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='domain') { if (doc['threat.indicator.url.domain'].value!=null) { return emit(doc['threat.indicator.url.domain'].value) } } + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='domain-name') { if (doc['threat.indicator.url.domain'].value!=null) { return emit(doc['threat.indicator.url.domain'].value) } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='x509-certificate') { if (doc['threat.indicator.x509.serial_number'].value!=null) { return emit(doc['threat.indicator.x509.serial_number'].value) } } + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='x509 serial') { if (doc['threat.indicator.x509.serial_number'].value!=null) { return emit(doc['threat.indicator.x509.serial_number'].value) } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email-addr') { if (doc['threat.indicator.email.address'].value!=null) { return emit(doc['threat.indicator.email.address'].value) } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='unknown') { if (doc['_id'].value!=null) { return emit(doc['_id'].value) } } + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email') { if (doc['_id'].value!=null) { return emit(doc['_id'].value) } } + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email-message') { if (doc['_id'].value!=null) { return emit(doc['_id'].value) } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='windows-registry-key') { if (doc['threat.indicator.registry.key'].value!=null) { return emit(doc['threat.indicator.registry.key'].value) } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='autonomous-system') { if (doc['threat.indicator.as.number'].value!=null) { return emit(doc['threat.indicator.as.number'].value) } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='mac-addr') { if (doc['threat.indicator.mac'].value!=null) { return emit(doc['threat.indicator.mac'].value) } } + + return emit('')" + `); + }); + }); + + describe('threatIndicatorNamesOriginScript()', () => { + it('should generate a valid painless script', () => { + expect(threatIndicatorNamesOriginScript()).toMatchInlineSnapshot(` + "if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='ipv4-addr') { if (doc['threat.indicator.ip'].value!=null) { return emit('threat.indicator.ip') } } + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='ipv6-addr') { if (doc['threat.indicator.ip'].value!=null) { return emit('threat.indicator.ip') } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='file') { if (doc['threat.indicator.file.hash.sha256'].value!=null) { return emit('threat.indicator.file.hash.sha256') } + if (doc['threat.indicator.file.hash.md5'].value!=null) { return emit('threat.indicator.file.hash.md5') } + if (doc['threat.indicator.file.hash.sha1'].value!=null) { return emit('threat.indicator.file.hash.sha1') } + if (doc['threat.indicator.file.hash.sha224'].value!=null) { return emit('threat.indicator.file.hash.sha224') } + if (doc['threat.indicator.file.hash.sha3-224'].value!=null) { return emit('threat.indicator.file.hash.sha3-224') } + if (doc['threat.indicator.file.hash.sha3-256'].value!=null) { return emit('threat.indicator.file.hash.sha3-256') } + if (doc['threat.indicator.file.hash.sha384'].value!=null) { return emit('threat.indicator.file.hash.sha384') } + if (doc['threat.indicator.file.hash.sha3-384'].value!=null) { return emit('threat.indicator.file.hash.sha3-384') } + if (doc['threat.indicator.file.hash.sha512'].value!=null) { return emit('threat.indicator.file.hash.sha512') } + if (doc['threat.indicator.file.hash.sha3-512'].value!=null) { return emit('threat.indicator.file.hash.sha3-512') } + if (doc['threat.indicator.file.hash.sha512/224'].value!=null) { return emit('threat.indicator.file.hash.sha512/224') } + if (doc['threat.indicator.file.hash.sha512/256'].value!=null) { return emit('threat.indicator.file.hash.sha512/256') } + if (doc['threat.indicator.file.ssdeep'].value!=null) { return emit('threat.indicator.file.ssdeep') } + if (doc['threat.indicator.file.tlsh'].value!=null) { return emit('threat.indicator.file.tlsh') } + if (doc['threat.indicator.file.impfuzzy'].value!=null) { return emit('threat.indicator.file.impfuzzy') } + if (doc['threat.indicator.file.imphash'].value!=null) { return emit('threat.indicator.file.imphash') } + if (doc['threat.indicator.file.pehash'].value!=null) { return emit('threat.indicator.file.pehash') } + if (doc['threat.indicator.file.vhash'].value!=null) { return emit('threat.indicator.file.vhash') } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='url') { if (doc['threat.indicator.url.full'].value!=null) { return emit('threat.indicator.url.full') } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='domain') { if (doc['threat.indicator.url.domain'].value!=null) { return emit('threat.indicator.url.domain') } } + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='domain-name') { if (doc['threat.indicator.url.domain'].value!=null) { return emit('threat.indicator.url.domain') } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='x509-certificate') { if (doc['threat.indicator.x509.serial_number'].value!=null) { return emit('threat.indicator.x509.serial_number') } } + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='x509 serial') { if (doc['threat.indicator.x509.serial_number'].value!=null) { return emit('threat.indicator.x509.serial_number') } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email-addr') { if (doc['threat.indicator.email.address'].value!=null) { return emit('threat.indicator.email.address') } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='unknown') { if (doc['_id'].value!=null) { return emit('_id') } } + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email') { if (doc['_id'].value!=null) { return emit('_id') } } + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='email-message') { if (doc['_id'].value!=null) { return emit('_id') } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='windows-registry-key') { if (doc['threat.indicator.registry.key'].value!=null) { return emit('threat.indicator.registry.key') } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='autonomous-system') { if (doc['threat.indicator.as.number'].value!=null) { return emit('threat.indicator.as.number') } } + + if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='mac-addr') { if (doc['threat.indicator.mac'].value!=null) { return emit('threat.indicator.mac') } } + + return emit('')" + `); + }); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/server/utils/indicator_name.ts b/x-pack/plugins/threat_intelligence/server/utils/indicator_name.ts new file mode 100644 index 0000000000000..60486ab767a80 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/utils/indicator_name.ts @@ -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 dedent from 'dedent'; +import { RawIndicatorFieldId } from '../../common/types/indicator'; + +/** + * Mapping connects one ore more types to field values that should be used to generate threat.indicator.name field. + */ +type Mapping = [types: string[], paths: RawIndicatorFieldId[]]; + +type Mappings = Mapping[]; + +const mappingsArray: Mappings = [ + [['ipv4-addr', 'ipv6-addr'], [RawIndicatorFieldId.Ip]], + // For example, `file` indicator will have `threat.indicator.name` computed out of the first + // hash value field defined below, in order of occurrence + [ + ['file'], + [ + RawIndicatorFieldId.FileSha256, + RawIndicatorFieldId.FileMd5, + RawIndicatorFieldId.FileSha1, + RawIndicatorFieldId.FileSha224, + RawIndicatorFieldId.FileSha3224, + RawIndicatorFieldId.FileSha3256, + RawIndicatorFieldId.FileSha384, + RawIndicatorFieldId.FileSha3384, + RawIndicatorFieldId.FileSha512, + RawIndicatorFieldId.FileSha3512, + RawIndicatorFieldId.FileSha512224, + RawIndicatorFieldId.FileSha512256, + RawIndicatorFieldId.FileSSDeep, + RawIndicatorFieldId.FileTlsh, + RawIndicatorFieldId.FileImpfuzzy, + RawIndicatorFieldId.FileImphash, + RawIndicatorFieldId.FilePehash, + RawIndicatorFieldId.FileVhash, + ], + ], + [['url'], [RawIndicatorFieldId.UrlFull]], + [['domain', 'domain-name'], [RawIndicatorFieldId.UrlDomain]], + [['x509-certificate', 'x509 serial'], [RawIndicatorFieldId.X509Serial]], + [['email-addr'], [RawIndicatorFieldId.EmailAddress]], + [['unknown', 'email', 'email-message'], [RawIndicatorFieldId.Id]], + [['windows-registry-key'], [RawIndicatorFieldId.WindowsRegistryKey]], + [['autonomous-system'], [RawIndicatorFieldId.AutonomousSystemNumber]], + [['mac-addr'], [RawIndicatorFieldId.MacAddress]], +]; + +/** + * Generates Painless condition checking if given `type` is matched + */ +const fieldTypeCheck = (type: string) => + `if (doc['threat.indicator.type'].value != null && doc['threat.indicator.type'].value.toLowerCase()=='${type.toLowerCase()}')`; + +/** + * Generates Painless condition checking if given `field` has value + */ +const fieldValueCheck = (field: string) => `if (doc['${field}'].value!=null)`; + +/** + * Converts Mapping to Painless script, computing `threat.indicator.name` value for given indicator types. + */ +const mappingToIndicatorNameScript = ([types, paths]: Mapping) => { + return dedent`${types + .map( + (t) => + `${fieldTypeCheck(t)} { ${paths + .map((p) => `${fieldValueCheck(p)} { return emit(doc['${p}'].value) }`) + .join('\n')} }` + ) + .join('\n')}`; +}; + +/** + * Converts Mapping to Painless script, computing `threat.indicator.name_origin` used to determine which document field has + * been used to obtain `threat.indicator.name`. + */ +const mappingToIndicatorNameOriginScript = ([types, paths]: Mapping) => { + return dedent`${types + .map( + (t) => + `${fieldTypeCheck(t)} { ${paths + .map((p) => `${fieldValueCheck(p)} { return emit('${p}') }`) + .join('\n')} }` + ) + .join('\n')}`; +}; + +/** + * Generates the runtime field script computing display name for the given indicator + */ +export const threatIndicatorNamesScript = (mappings: Mappings = mappingsArray) => { + const combined = mappings.map(mappingToIndicatorNameScript).join('\n\n'); + + return `${combined}\n\nreturn emit('')`; +}; + +/** + * Generates the runtime field script computing the display name origin path for given indicator + */ +export const threatIndicatorNamesOriginScript = (mappings: Mappings = mappingsArray) => { + const combined = mappings.map(mappingToIndicatorNameOriginScript).join('\n\n'); + + return `${combined}\n\nreturn emit('')`; +}; diff --git a/x-pack/plugins/threat_intelligence/tsconfig.json b/x-pack/plugins/threat_intelligence/tsconfig.json index 8d19be714a8de..ccdf417105b16 100644 --- a/x-pack/plugins/threat_intelligence/tsconfig.json +++ b/x-pack/plugins/threat_intelligence/tsconfig.json @@ -4,16 +4,18 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true, + "declarationMap": true }, "include": [ "common/**/*", "public/**/*", + "server/**/*", "scripts/**/*", "public/**/*.json", + "server/**/*.json", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../timelines/tsconfig.json" }, { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, diff --git a/x-pack/plugins/timelines/common/types/timeline/actions/index.ts b/x-pack/plugins/timelines/common/types/timeline/actions/index.ts index cde9b04d0e707..76bd03b3a6725 100644 --- a/x-pack/plugins/timelines/common/types/timeline/actions/index.ts +++ b/x-pack/plugins/timelines/common/types/timeline/actions/index.ts @@ -22,7 +22,7 @@ import { ColumnHeaderOptions } from '../columns'; import { TimelineItem, TimelineNonEcsData } from '../../../search_strategy'; import { Ecs } from '../../../ecs'; -export { +export type { FieldBrowserOptions, CreateFieldComponent, GetFieldTableColumns, diff --git a/x-pack/plugins/timelines/public/store/t_grid/types.ts b/x-pack/plugins/timelines/public/store/t_grid/types.ts index 3e8f998003774..b0c82c2abf637 100644 --- a/x-pack/plugins/timelines/public/store/t_grid/types.ts +++ b/x-pack/plugins/timelines/public/store/t_grid/types.ts @@ -46,6 +46,7 @@ export enum TableId { export enum TimelineId { active = 'timeline-1', casePage = 'timeline-case', + detectionsAlertDetailsPage = 'detections-alert-details-page', test = 'timeline-test', // Reserved for testing purposes } diff --git a/x-pack/plugins/timelines/tsconfig.json b/x-pack/plugins/timelines/tsconfig.json index 3063c1acda545..15961117840ae 100644 --- a/x-pack/plugins/timelines/tsconfig.json +++ b/x-pack/plugins/timelines/tsconfig.json @@ -5,7 +5,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -16,7 +15,7 @@ "public/**/*.json", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, diff --git a/x-pack/plugins/transform/server/routes/api/transforms.ts b/x-pack/plugins/transform/server/routes/api/transforms.ts index 7c4df878456ba..580f0f54aabf7 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms.ts @@ -155,10 +155,13 @@ export function registerTransformsRoutes(routeDependencies: RouteDependencies) { async (ctx, req, res) => { try { const esClient = (await ctx.core).elasticsearch.client; - const body = await esClient.asCurrentUser.transform.getTransformStats({ - size: 1000, - transform_id: '_all', - }); + const body = await esClient.asCurrentUser.transform.getTransformStats( + { + size: 1000, + transform_id: '_all', + }, + { maxRetries: 0 } + ); return res.ok({ body }); } catch (e) { return res.customError(wrapError(wrapEsError(e))); @@ -185,9 +188,12 @@ export function registerTransformsRoutes(routeDependencies: RouteDependencies) { const { transformId } = req.params; try { const esClient = (await ctx.core).elasticsearch.client; - const body = await esClient.asCurrentUser.transform.getTransformStats({ - transform_id: transformId, - }); + const body = await esClient.asCurrentUser.transform.getTransformStats( + { + transform_id: transformId, + }, + { maxRetries: 0 } + ); return res.ok({ body }); } catch (e) { return res.customError(wrapError(wrapEsError(e))); @@ -452,7 +458,7 @@ export function registerTransformsRoutes(routeDependencies: RouteDependencies) { license.guardApiRoute(async (ctx, req, res) => { try { const esClient = (await ctx.core).elasticsearch.client; - const body = await esClient.asCurrentUser.search(req.body); + const body = await esClient.asCurrentUser.search(req.body, { maxRetries: 0 }); return res.ok({ body }); } catch (e) { return res.customError(wrapError(wrapEsError(e))); @@ -643,16 +649,22 @@ const previewTransformHandler: RequestHandler< try { const reqBody = req.body; const esClient = (await ctx.core).elasticsearch.client; - const body = await esClient.asCurrentUser.transform.previewTransform({ - body: reqBody, - }); + const body = await esClient.asCurrentUser.transform.previewTransform( + { + body: reqBody, + }, + { maxRetries: 0 } + ); if (isLatestTransform(reqBody)) { // for the latest transform mappings properties have to be retrieved from the source - const fieldCapsResponse = await esClient.asCurrentUser.fieldCaps({ - index: reqBody.source.index, - fields: '*', - include_unmapped: false, - }); + const fieldCapsResponse = await esClient.asCurrentUser.fieldCaps( + { + index: reqBody.source.index, + fields: '*', + include_unmapped: false, + }, + { maxRetries: 0 } + ); const fieldNamesSet = new Set(Object.keys(fieldCapsResponse.fields)); diff --git a/x-pack/plugins/transform/tsconfig.json b/x-pack/plugins/transform/tsconfig.json index 01bb29d5f4374..3298fc0e3b406 100644 --- a/x-pack/plugins/transform/tsconfig.json +++ b/x-pack/plugins/transform/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "common/**/*", @@ -14,7 +13,7 @@ // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 "public/**/*.json", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../features/tsconfig.json" }, { "path": "../license_management/tsconfig.json" }, diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 0bf0d3908eeb9..13e8d52f36c6f 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -1163,7 +1163,6 @@ "data.advancedSettings.timepicker.refreshIntervalDefaultsText": "L'intervalle d'actualisation par défaut du filtre temporel. La valeur doit être spécifiée en millisecondes.", "data.advancedSettings.timepicker.refreshIntervalDefaultsTitle": "Intervalle d'actualisation du filtre temporel", "data.advancedSettings.timepicker.thisWeek": "Cette semaine", - "data.advancedSettings.timepicker.timeDefaultsText": "L’option de filtre temporel à utiliser lorsque Kibana est démarré sans filtre", "data.advancedSettings.timepicker.timeDefaultsTitle": "Filtre temporel par défaut", "data.advancedSettings.timepicker.today": "Aujourd'hui", "data.errors.fetchError": "Vérifiez votre réseau et la configuration de votre proxy. Si le problème persiste, contactez votre administrateur réseau.", @@ -1921,7 +1920,6 @@ "discover.context.olderDocumentsWarning": "Seuls {docCount} documents plus anciens que le document ancré ont été trouvés.", "discover.context.pageTitle": "Les documents relatifs à #{anchorId}", "discover.contextViewRoute.errorMessage": "Aucune donnée correspondante pour l'ID {dataViewId}", - "discover.discoverError.missingQueryParamsError": "La chaîne de requête URL est manquante {missingParamsList}.", "discover.doc.pageTitle": "Document unique - #{id}", "discover.doc.somethingWentWrongDescription": "Index {indexName} manquant.", "discover.docExplorerCallout.bodyMessage": "Triez, sélectionnez et comparez rapidement les données, redimensionnez les colonnes et affichez les documents en plein écran grâce à l'{documentExplorer}.", @@ -6142,7 +6140,7 @@ "visualizations.deprecatedTag": "Déclassé", "visualizations.disabledLabVisualizationLink": "Lire la documentation", "visualizations.disabledLabVisualizationMessage": "Veuillez activer le mode lab dans les paramètres avancés pour consulter les visualisations lab.", - "visualizations.displayName": "Visualisation", + "visualizations.displayName": "visualisation", "visualizations.editor.createBreadcrumb": "Créer", "visualizations.editor.defaultEditBreadcrumbText": "Modifier la visualisation", "visualizations.embeddable.inspectorTitle": "Inspecteur", @@ -6177,7 +6175,6 @@ "visualizations.listing.table.typeColumnName": "Type", "visualizations.listingPageTitle": "Bibliothèque Visualize", "visualizations.missedDataView.dataViewReconfigure": "Recréez-la dans la page de gestion des vues de données.", - "visualizations.missedDataView.editInVisualizeEditor": "Effectuer des modifications dans l'éditeur Visualize pour corriger l'erreur", "visualizations.newChart.conditionalMessage.advancedSettingsLink": "Paramètres avancés.", "visualizations.newChart.libraryMode.new": "nouveau", "visualizations.newChart.libraryMode.old": "âge", @@ -6733,7 +6730,6 @@ "xpack.aiops.dataGrid.field.documentCountChartSplit.seriesLabel": "autre compte du document", "xpack.aiops.documentCountContent.clearSelectionAriaLabel": "Effacer la sélection", "xpack.aiops.explainLogRateSpikes.loadingState.doneMessage": "Terminé.", - "xpack.aiops.explainLogRateSpikes.loadingState.loadingFieldCandidates": "Chargement des champs candidats.", "xpack.aiops.explainLogRateSpikes.loadingState.loadingHistogramData": "Chargement des données d’histogramme.", "xpack.aiops.explainLogRateSpikesPage.emptyPromptBody": "La fonction Expliquer les pics de taux de log identifie les combinaisons champ/valeur statistiquement significatives qui contribuent à un pic de taux de log.", "xpack.aiops.explainLogRateSpikesPage.emptyPromptTitle": "Cliquez sur un pic dans l'histogramme pour lancer l'analyse.", @@ -6861,7 +6857,6 @@ "xpack.apm.tutorial.config_otel.description3": "La liste exhaustive des variables d'environnement, les paramètres de ligne de commande et les extraits de code de configuration (conformes à la spécification OpenTelemetry) se trouvent dans le {otelInstrumentationGuide}. Certains clients OpenTelemetry instables peuvent ne pas prendre en charge toutes les fonctionnalités et nécessitent peut-être d'autres mécanismes de configuration.", "xpack.apm.tutorial.djangoClient.configure.commands.setCustomApmServerUrlComment": "Définir l'URL personnalisée du serveur APM (par défaut : {defaultApmServerUrl})", "xpack.apm.tutorial.djangoClient.configure.textPost": "Consultez la [documentation]({documentationLink}) pour une utilisation avancée.", - "xpack.apm.tutorial.dotNetClient.configureAgent.textPost": "Si vous ne transférez pas une instance \"IConfiguration\" à l'agent (par ex., pour les applications non ASP.NET Core) vous pouvez également configurer l'agent par le biais de variables d'environnement. \n Consultez [the documentation]({documentationLink}) pour une utilisation avancée.", "xpack.apm.tutorial.dotNetClient.download.textPre": "Ajoutez le(s) package(s) d'agent depuis [NuGet]({allNuGetPackagesLink}) à votre application .NET. Plusieurs packages NuGet sont disponibles pour différents cas d'utilisation. \n\nPour une application ASP.NET Core avec Entity Framework Core, téléchargez le package [Elastic.Apm.NetCoreAll]({netCoreAllApmPackageLink}). Ce package ajoutera automatiquement chaque composant d'agent à votre application. \n\n Si vous souhaitez minimiser les dépendances, vous pouvez utiliser le package [Elastic.Apm.AspNetCore]({aspNetCorePackageLink}) uniquement pour le monitoring d'ASP.NET Core ou le package [Elastic.Apm.EfCore]({efCorePackageLink}) uniquement pour le monitoring d'Entity Framework Core. \n\n Si vous souhaitez seulement utiliser l'API d'agent publique pour l'instrumentation manuelle, utilisez le package [Elastic.Apm]({elasticApmPackageLink}).", "xpack.apm.tutorial.downloadServerRpm": "Vous cherchez les packages 32 bits ? Consultez la [Download page]({downloadPageLink}).", "xpack.apm.tutorial.downloadServerTitle": "Vous cherchez les packages 32 bits ? Consultez la [Download page]({downloadPageLink}).", @@ -7166,7 +7161,6 @@ "xpack.apm.dependencyOperationDetailTraceListOutcomeColumn": "Résultat", "xpack.apm.dependencyOperationDetailTraceListServiceNameColumn": "Service d'origine", "xpack.apm.dependencyOperationDetailTraceListTimestampColumn": "Horodatage", - "xpack.apm.dependencyOperationDetailTraceListTraceIdColumn": "Trace", "xpack.apm.dependencyOperationDetailTraceListTransactionNameColumn": "Nom de la transaction", "xpack.apm.dependencyOperationDistributionChart.allSpansLegendLabel": "Tous les intervalles", "xpack.apm.dependencyOperationDistributionChart.failedSpansLegendLabel": "Intervalles ayant échoué", @@ -7435,7 +7429,6 @@ "xpack.apm.mlCallout.updateAvailableCalloutButtonText": "Mettre à jour les tâches", "xpack.apm.mlCallout.updateAvailableCalloutText": "Nous avons mis à jour les tâches de détection des anomalies qui fournissent des indications sur la dégradation des performances et ajouté des détecteurs de débit et de taux de transactions ayant échoué. Si vous choisissez de mettre à jour, nous créerons les nouvelles tâches et fermerons les tâches héritées. Les données affichées dans l'application APM passeront automatiquement aux nouvelles. Veuillez noter que l'option de migration de toutes les tâches existantes ne sera pas disponible si vous choisissez de créer une nouvelle tâche.", "xpack.apm.mlCallout.updateAvailableCalloutTitle": "Mises à jour disponibles", - "xpack.apm.navigation.allServicesTitle": "Tous les services", "xpack.apm.navigation.apmSettingsTitle": "Paramètres", "xpack.apm.navigation.dependenciesTitle": "Dépendances", "xpack.apm.navigation.serviceMapTitle": "Carte des services", @@ -7470,14 +7463,16 @@ "xpack.apm.serviceGroup.serviceInventory": "Inventory", "xpack.apm.serviceGroup.serviceMap": "Carte des services", "xpack.apm.serviceGroups.breadcrumb.title": "Services", + "xpack.apm.serviceGroups.buttonGroup.allServices": "Tous les services", + "xpack.apm.serviceGroups.buttonGroup.serviceGroups": "Groupes de services", "xpack.apm.serviceGroups.cardsList.emptyDescription": "Aucune description disponible", "xpack.apm.serviceGroups.createGroupLabel": "Créer un groupe", "xpack.apm.serviceGroups.createSuccess.toast.text": "Votre groupe est maintenant visible dans la nouvelle vue Services pour les groupes.", "xpack.apm.serviceGroups.deleteFailure.unknownId.toast.text": "Impossible de supprimer le groupe : id du groupe de service inconnu.", "xpack.apm.serviceGroups.editGroupLabel": "Modifier un groupe", "xpack.apm.serviceGroups.editSuccess.toast.text": "Nouveaux changements dans le groupe de services enregistrés.", - "xpack.apm.serviceGroups.emptyPrompt.message": "Aucun groupe trouvé pour ce filtre", - "xpack.apm.serviceGroups.emptyPrompt.serviceGroups": "Groupes de services", + "xpack.apm.serviceGroups.filtered.emptyPrompt.message": "Aucun groupe trouvé pour ce filtre", + "xpack.apm.serviceGroups.filtered.emptyPrompt.serviceGroups": "Groupes de services", "xpack.apm.serviceGroups.groupDetailsForm.cancel": "Annuler", "xpack.apm.serviceGroups.groupDetailsForm.color": "Couleur", "xpack.apm.serviceGroups.groupDetailsForm.create.title": "Créer un groupe", @@ -7488,8 +7483,6 @@ "xpack.apm.serviceGroups.groupDetailsForm.invalidColorError": "Veuillez fournir une valeur de couleur valide", "xpack.apm.serviceGroups.groupDetailsForm.name": "Nom", "xpack.apm.serviceGroups.groupDetailsForm.selectServices": "Sélectionner des services", - "xpack.apm.serviceGroups.list.allServices.description": "Afficher tous les services", - "xpack.apm.serviceGroups.list.allServices.name": "Tous les services", "xpack.apm.serviceGroups.list.sort.alphabetical": "Alphabétique", "xpack.apm.serviceGroups.list.sort.recentlyAdded": "Récemment ajouté", "xpack.apm.serviceGroups.selectServicesForm.cancel": "Annuler", @@ -7510,8 +7503,6 @@ "xpack.apm.serviceGroups.tour.dismiss": "Rejeter", "xpack.apm.serviceGroups.tour.editGroups.content": "Utilisez l'option de modification pour changer le nom, la requête ou les détails de ce groupe de services.", "xpack.apm.serviceGroups.tour.editGroups.title": "Modifier ce groupe de services", - "xpack.apm.serviceGroups.tour.serviceGroups.content": "Maintenant que vous avez créé un groupe de services, votre inventaire Tous les services a été déplacé ici. Ce groupe ne peut être ni modifié ni retiré.", - "xpack.apm.serviceGroups.tour.serviceGroups.title": "Groupe Tous les services", "xpack.apm.serviceHealthStatus.critical": "Critique", "xpack.apm.serviceHealthStatus.healthy": "Intègre", "xpack.apm.serviceHealthStatus.unknown": "Inconnu", @@ -11685,7 +11676,7 @@ "xpack.enterpriseSearch.nav.contentTitle": "Contenu", "xpack.enterpriseSearch.nav.elasticsearchTitle": "Elasticsearch", "xpack.enterpriseSearch.nav.enterpriseSearchOverviewTitle": "Aperçu", - "xpack.enterpriseSearch.nav.searchExperiencesTitle": "Recherche", + "xpack.enterpriseSearch.nav.searchTitle": "Recherche", "xpack.enterpriseSearch.nav.searchIndicesTitle": "Index", "xpack.enterpriseSearch.nav.workplaceSearchTitle": "Workplace Search", "xpack.enterpriseSearch.notFound.action1": "Retour à votre tableau de bord", @@ -12703,7 +12694,6 @@ "xpack.fleet.epmList.verificationWarningCalloutIntroText": "Une ou plusieurs des intégrations installées contiennent un package non signé à l'authenticité inconnue. En savoir plus sur {learnMoreLink}.", "xpack.fleet.fleetServerCloudRequiredCallout.calloutDescription": "Un serveur Fleet intègre est nécessaire pour enregistrer des agents avec Fleet. Activez un serveur Fleet dans votre {cloudDeploymentLink}. Pour en savoir plus, consultez le {guideLink}.", "xpack.fleet.fleetServerFlyout.generateFleetServerPolicySuccessInstructions": "La politique du serveur Fleet et le token de service ont été générés. Hôte configuré sur {hostUrl}. Vous pouvez modifier les hôtes de votre serveur Fleet dans {fleetSettingsLink}.", - "xpack.fleet.fleetServerFlyout.getStartedInstructions": "Tout d'abord, définissez l'IP public ou le nom d'hôte et le port que les agents utiliseront pour atteindre le serveur Fleet. Par défaut, le port {port} est utilisé. Nous générerons ensuite automatiquement une politique à votre place.", "xpack.fleet.fleetServerFlyout.installFleetServerInstructions": "Installez l'agent du serveur Fleet sur un hôte centralisé afin que les autres hôtes que vous souhaitez monitorer puissent s'y connecter. En production, nous recommandons d'utiliser un ou plusieurs hôtes dédiés. Pour une aide supplémentaire, consultez nos {installationLink}.", "xpack.fleet.fleetServerFlyout.instructions": "Un serveur Fleet est nécessaire pour enregistrer des agents avec Fleet. Suivez les instructions ci-après pour configurer un serveur Fleet. Pour en savoir plus, consultez le {userGuideLink}", "xpack.fleet.fleetServerOnPremRequiredCallout.calloutDescription": "Suivez les instructions ci-après pour configurer un serveur Fleet. Pour en savoir plus, consultez le {guideLink}.", @@ -12782,9 +12772,6 @@ "xpack.fleet.settings.editOutputFlyout.defaultOutputSwitchLabel": "Choisissez cette sortie par défaut pour les {boldAgentIntegrations}.", "xpack.fleet.settings.editOutputFlyout.logstashHostsInputDescription": "Spécifiez les adresses que vos agents utiliseront pour se connecter à Logstash. {guideLink}.", "xpack.fleet.settings.fleetServerHostSectionSubtitle": "Précisez les URL que vos agents doivent utiliser pour se connecter à un serveur Fleet. Si plusieurs URL existent, Fleet affichera la première URL fournie à des fins d'enregistrement. Pour en savoir plus, consultez le {guideLink}.", - "xpack.fleet.settings.fleetServerHostsFlyout.agentPolicyCount": "{agentPolicyCount, plural, one {# stratégie d’agent} other {# stratégies d’agent}}", - "xpack.fleet.settings.fleetServerHostsFlyout.agentsCount": "{agentCount, plural, one {# agent} other {# agents}}", - "xpack.fleet.settings.fleetServerHostsFlyout.confirmModalText": "Cette action mettra à jour les {policies} et {agents}. Impossible d'annuler cette action. Voulez-vous vraiment continuer ?", "xpack.fleet.settings.fleetServerHostsFlyout.description": "Précisez les URL que vos agents doivent utiliser pour se connecter à un serveur Fleet. Si plusieurs URL existent, Fleet affiche la première URL fournie à des fins d'enregistrement. Le serveur Fleet utilise le port 8220 par défaut. Reportez-vous à {link}.", "xpack.fleet.settings.logstashInstructions.addPipelineStepDescription": "Dans le répertoire de configuration Logstash, ouvrez le fichier {pipelineFile} et ajoutez la configuration suivante. Remplacez le chemin d’accès à votre fichier.", "xpack.fleet.settings.logstashInstructions.description": "Ajoutez une configuration de pipeline Elastic Agent à Logstash pour recevoir les événements du framework Elastic Agent. {documentationLink}.", @@ -13364,8 +13351,6 @@ "xpack.fleet.epm.pageSubtitle": "Choisissez une intégration pour commencer à collecter et à analyser vos données.", "xpack.fleet.epm.releaseBadge.betaDescription": "Il n'est pas recommandé d'utiliser cette intégration dans les environnements de production.", "xpack.fleet.epm.releaseBadge.betaLabel": "Bêta", - "xpack.fleet.epm.releaseBadge.experimentalDescription": "Cette fonctionnalité est en version d'évaluation technique et pourra être modifiée ou retirée complètement dans une future version. Elastic s'efforcera au maximum de corriger tout problème, mais les fonctionnalités en version d'évaluation technique ne sont pas soumises aux accords de niveau de service d'assistance des fonctionnalités officielles en disponibilité générale.", - "xpack.fleet.epm.releaseBadge.experimentalLabel": "Version d'évaluation technique", "xpack.fleet.epm.screenshotErrorText": "Impossible de charger cette capture d'écran", "xpack.fleet.epm.screenshotsTitle": "Captures d'écran", "xpack.fleet.epm.updateAvailableTooltip": "Mise à jour disponible", @@ -13402,8 +13387,6 @@ "xpack.fleet.fleetServerFlyout.getStartedTitle": "Démarrer avec le serveur Fleet", "xpack.fleet.fleetServerFlyout.installFleetServerTitle": "Installer le serveur Fleet sur un hôte centralisé", "xpack.fleet.fleetServerFlyout.title": "Ajouter un serveur Fleet", - "xpack.fleet.fleetServerHost.requiredError": "L'hôte du serveur Fleet est requis.", - "xpack.fleet.fleetServerHost.requiresHttpsError": "L'hôte du serveur Fleet doit commencer par \"https\"", "xpack.fleet.fleetServerOnPremRequiredCallout.calloutTitle": "Un serveur Fleet est nécessaire pour enregistrer des agents avec Fleet.", "xpack.fleet.fleetServerOnPremRequiredCallout.guideLink": "Guide de Fleet et d’Elastic Agent", "xpack.fleet.fleetServerOnPremUnhealthyCallout.addFleetServerButtonLabel": "Ajouter un serveur Fleet", @@ -13411,7 +13394,6 @@ "xpack.fleet.fleetServerOnPremUnhealthyCallout.guideLink": "Guide de Fleet et d’Elastic Agent", "xpack.fleet.fleetServerSetup.addFleetServerHostButton": "Ajouter un hôte", "xpack.fleet.fleetServerSetup.addFleetServerHostInputLabel": "Hôte du serveur Fleet", - "xpack.fleet.fleetServerSetup.addFleetServerHostInvalidUrlError": "URL non valide", "xpack.fleet.fleetServerSetup.addFleetServerHostStepTitle": "Ajouter l'hôte de votre serveur Fleet", "xpack.fleet.fleetServerSetup.addFleetServerHostSuccessTitle": "Hôte du serveur Fleet ajouté", "xpack.fleet.fleetServerSetup.cloudDeploymentLink": "Modifier le déploiement", @@ -13612,7 +13594,6 @@ "xpack.fleet.settings.editOutputFlyout.typeInputPlaceholder": "Indiquer le type", "xpack.fleet.settings.editOutputFlyout.yamlConfigInputLabel": "Configuration YAML avancée", "xpack.fleet.settings.editOutputFlyout.yamlConfigInputPlaceholder": "Ces # paramètres YAML seront ajoutés à la section de sortie de chaque stratégie d’agent.", - "xpack.fleet.settings.fleetServerHostEditButtonLabel": "Modifier les hôtes", "xpack.fleet.settings.fleetServerHostsDifferentPathOrProtocolError": "Le protocole et le chemin doivent être identiques pour chaque URL", "xpack.fleet.settings.fleetServerHostsDuplicateError": "URL en double", "xpack.fleet.settings.fleetServerHostSectionTitle": "Hôtes du serveur Fleet", @@ -13624,11 +13605,8 @@ "xpack.fleet.settings.fleetServerHostsFlyout.fleetServerHostsInputPlaceholder": "Indiquer l’URL de l’hôte", "xpack.fleet.settings.fleetServerHostsFlyout.saveButton": "Enregistrer et appliquer les paramètres", "xpack.fleet.settings.fleetServerHostsFlyout.successToastTitle": "Paramètres enregistrés", - "xpack.fleet.settings.fleetServerHostsFlyout.title": "Hôtes du serveur Fleet", "xpack.fleet.settings.fleetServerHostsFlyout.userGuideLink": "Guide de Fleet et d'Elastic Agent", - "xpack.fleet.settings.fleetServerHostsPreconfiguredTooltipContent": "Les hôtes du serveur Fleet sont configurés en dehors de Fleet. Reportez-vous à votre configuration Kibana pour en savoir plus.", "xpack.fleet.settings.fleetServerHostsRequiredError": "L'URL de l'hôte est requise", - "xpack.fleet.settings.fleetServerHostUrlColumnTitle": "URL de l’hôte", "xpack.fleet.settings.fleetSettingsLink": "En savoir plus", "xpack.fleet.settings.fleetUserGuideLink": "Guide de Fleet et d'Elastic Agent", "xpack.fleet.settings.logstashInstructions.apiKeyStepDescription": "Nous recommandons d'autoriser Logstash à effectuer la sortie vers Elasticsearch avec les privilèges minimum pour Elastic Agent.", @@ -15597,15 +15575,15 @@ "xpack.infra.homePage.noMetricsIndicesInstructionsActionLabel": "Voir les instructions de configuration", "xpack.infra.homePage.settingsTabTitle": "Paramètres", "xpack.infra.homePage.toolbar.kqlSearchFieldPlaceholder": "Rechercher des données d'infrastructure… (par exemple host.name:host-1)", + "xpack.infra.hostsTable.averageMemoryTotalColumnHeader": "Total de la mémoire (moy.)", + "xpack.infra.hostsTable.averageMemoryUsageColumnHeader": "Utilisation de la mémoire (moy.)", + "xpack.infra.hostsTable.averageRxColumnHeader": "", + "xpack.infra.hostsTable.averageTxColumnHeader": "", + "xpack.infra.hostsTable.diskLatencyColumnHeader": "", "xpack.infra.hostsTable.nameColumnHeader": "Nom", - "xpack.infra.hostsTable.operatingSystemColumnHeader": "Système d'exploitation", "xpack.infra.hostsTable.numberOfCpusColumnHeader": "Nombre de processeurs", - "xpack.infra.hostsTable.diskLatencyColumnHeader": "", - "xpack.infra.hostsTable.averageTxColumnHeader": "", - "xpack.infra.hostsTable.averageRxColumnHeader": "", - "xpack.infra.hostsTable.averageMemoryTotalColumnHeader": "Total de la mémoire (moy.)", + "xpack.infra.hostsTable.operatingSystemColumnHeader": "Système d'exploitation", "xpack.infra.hostsTable.servicesOnHostColumnHeader": "", - "xpack.infra.hostsTable.averageMemoryUsageColumnHeader": "Utilisation de la mémoire (moy.)", "xpack.infra.infra.nodeDetails.apmTabLabel": "APM", "xpack.infra.infra.nodeDetails.createAlertLink": "Créer une règle d'inventaire", "xpack.infra.infra.nodeDetails.openAsPage": "Ouvrir en tant que page", @@ -17268,7 +17246,6 @@ "xpack.lens.indexPattern.timeShiftSmallWarning": "{label} utilise un décalage temporel de {columnTimeShift} qui est inférieur à l'intervalle de l'histogramme des dates de {interval}. Pour éviter une non-correspondance des données, utilisez un multiple de {interval} comme décalage.", "xpack.lens.indexPattern.uniqueLabel": "{label} [{num}]", "xpack.lens.indexPattern.valueCountOf": "Nombre de {name}", - "xpack.lens.indexPatterns.fieldSearchLiveRegion": "{availableFields} {availableFields, plural, one {champ} other {champs}} disponible(s). {emptyFields} {emptyFields, plural, one {champ} other {champs}} vide(s). {metaFields} {metaFields, plural, one {champ} other {champs}} méta.", "xpack.lens.indexPatternSuggestion.removeLayerLabel": "Afficher uniquement {indexPatternTitle}", "xpack.lens.indexPatternSuggestion.removeLayerPositionLabel": "Afficher uniquement le calque {layerNumber}", "xpack.lens.modalTitle.title.clear": "Effacer le calque {layerType} ?", @@ -17470,7 +17447,7 @@ "xpack.lens.embeddable.missingTimeRangeParam.longMessage": "La propriété timeRange est requise pour cette configuration.", "xpack.lens.embeddable.missingTimeRangeParam.shortMessage": "Propriété timeRange manquante", "xpack.lens.embeddable.moreErrors": "Effectuez des modifications dans l'éditeur Lens pour afficher plus d'erreurs", - "xpack.lens.embeddableDisplayName": "lens", + "xpack.lens.embeddableDisplayName": "Lens", "xpack.lens.endValue.nearest": "La plus proche", "xpack.lens.endValue.none": "Masquer", "xpack.lens.endValue.zero": "Zéro", @@ -17576,7 +17553,6 @@ "xpack.lens.heatmapVisualization.missingXAccessorLongMessage": "La configuration de l'axe horizontal est manquante.", "xpack.lens.heatmapVisualization.missingXAccessorShortMessage": "Axe horizontal manquant.", "xpack.lens.indexPattern.advancedSettings": "Avancé", - "xpack.lens.indexPattern.allFieldsLabel": "Tous les champs", "xpack.lens.indexPattern.allFieldsLabelHelp": "Glissez-déposez les champs disponibles dans l’espace de travail et créez des visualisations. Pour modifier les champs disponibles, sélectionnez une vue de données différente, modifiez vos requêtes ou utilisez une plage temporelle différente. Certains types de champ ne peuvent pas être visualisés dans Lens, y compris les champ de texte intégral et champs géographiques.", "xpack.lens.indexPattern.allFieldsSamplingLabelHelp": "Les champs disponibles contiennent les données des 500 premiers documents correspondant aux filtres. Pour afficher tous les filtres, développez les champs vides. Vous ne pouvez pas créer de visualisations avec des champs de texte intégral, géographiques, lissés et d’objet.", "xpack.lens.indexPattern.ascendingCountPrecisionErrorWarning.link": "veuillez consulter la documentation", @@ -17623,12 +17599,7 @@ "xpack.lens.indexPattern.differences.signature": "indicateur : nombre", "xpack.lens.indexPattern.emptyDimensionButton": "Dimension vide", "xpack.lens.indexPattern.emptyFieldsLabel": "Champs vides", - "xpack.lens.indexPattern.emptyFieldsLabelHelp": "Les champs vides ne contenaient aucune valeur dans les 500 premiers documents basés sur vos filtres.", "xpack.lens.indexPattern.enableAccuracyMode": "Activer le mode de précision", - "xpack.lens.indexPattern.existenceErrorAriaLabel": "La récupération de l'existence a échoué", - "xpack.lens.indexPattern.existenceErrorLabel": "Impossible de charger les informations de champ", - "xpack.lens.indexPattern.existenceTimeoutAriaLabel": "La récupération de l'existence a expiré", - "xpack.lens.indexPattern.existenceTimeoutLabel": "Les informations de champ ont pris trop de temps", "xpack.lens.indexPattern.fieldItemTooltip": "Effectuez un glisser-déposer pour visualiser.", "xpack.lens.indexPattern.fieldPlaceholder": "Champ", "xpack.lens.indexPattern.fieldStatsButtonEmptyLabel": "Ce champ ne comporte aucune donnée mais vous pouvez toujours effectuer un glisser-déposer pour visualiser.", @@ -17806,16 +17777,6 @@ "xpack.lens.indexPattern.useAsTopLevelAgg": "Regrouper d'abord en fonction de ce champ", "xpack.lens.indexPatterns.clearFiltersLabel": "Effacer le nom et saisissez les filtres", "xpack.lens.indexPatterns.filterByNameLabel": "Rechercher les noms de champs", - "xpack.lens.indexPatterns.noAvailableDataLabel": "Aucun champ disponible ne contient de données.", - "xpack.lens.indexPatterns.noDataLabel": "Aucun champ.", - "xpack.lens.indexPatterns.noEmptyDataLabel": "Aucun champ vide.", - "xpack.lens.indexPatterns.noFields.extendTimeBullet": "Extension de la plage temporelle", - "xpack.lens.indexPatterns.noFields.fieldTypeFilterBullet": "Utilisation de différents filtres de champ", - "xpack.lens.indexPatterns.noFields.globalFiltersBullet": "Modification des filtres globaux", - "xpack.lens.indexPatterns.noFields.tryText": "Essayer :", - "xpack.lens.indexPatterns.noFieldsLabel": "Aucun champ n'existe dans cette vue de données.", - "xpack.lens.indexPatterns.noFilteredFieldsLabel": "Aucun champ ne correspond aux filtres sélectionnés.", - "xpack.lens.indexPatterns.noMetaDataLabel": "Aucun champ méta.", "xpack.lens.label.gauge.labelMajor.header": "Titre", "xpack.lens.label.gauge.labelMinor.header": "Sous-titre", "xpack.lens.label.header": "Étiquette", @@ -21618,8 +21579,6 @@ "xpack.ml.trainedModels.modelsList.pipelines.processorStats.typeHeader": "Type de processeur", "xpack.ml.trainedModels.modelsList.selectableMessage": "Sélectionner un modèle", "xpack.ml.trainedModels.modelsList.startDeployment.cancelButton": "Annuler", - "xpack.ml.trainedModels.modelsList.startDeployment.cloudWarningHeader": "À l'avenir, les déploiements cloud seront mis à l'échelle automatiquement afin de disposer du nombre requis de processeurs.", - "xpack.ml.trainedModels.modelsList.startDeployment.cloudWarningText": "Dans cette version, cependant, vous devez augmenter la taille de vos nœuds ML manuellement dans la console cloud pour obtenir plus de processeurs.", "xpack.ml.trainedModels.modelsList.startDeployment.docLinkTitle": "En savoir plus", "xpack.ml.trainedModels.modelsList.startDeployment.maxNumOfProcessorsWarning": "Le produit du nombre d'allocations et de threads par allocation doit être inférieur au nombre total de processeurs sur vos nœuds ML.", "xpack.ml.trainedModels.modelsList.startDeployment.numbersOfAllocationsHelp": "Augmentez pour améliorer le débit de toutes les requêtes.", @@ -23331,7 +23290,6 @@ "xpack.observability.alerts.ruleStats.loadError": "Impossible de charger les statistiques de règles", "xpack.observability.alerts.ruleStats.muted": "Répété", "xpack.observability.alerts.ruleStats.ruleCount": "Nombre de règles", - "xpack.observability.alerts.searchBarPlaceholder": "Alertes de recherche (par exemple, kibana.alert.evaluation.threshold > 75)", "xpack.observability.alerts.workflowStatusFilter.acknowledgedButtonLabel": "Reconnue(s)", "xpack.observability.alerts.workflowStatusFilter.closedButtonLabel": "Fermé", "xpack.observability.alerts.workflowStatusFilter.openButtonLabel": "Ouvrir", @@ -23405,7 +23363,6 @@ "xpack.observability.enableInspectEsQueriesExperimentName": "Inspecter les recherches ES", "xpack.observability.enableNewSyntheticsViewExperimentDescription": "Activez la nouvelle application de monitoring synthétique dans Observability. Actualisez la page pour appliquer le paramètre.", "xpack.observability.enableNewSyntheticsViewExperimentName": "Activer la nouvelle application de monitoring synthétique", - "xpack.observability.enableServiceGroups": "Fonctionnalité de groupes de services", "xpack.observability.exp.breakDownFilter.noBreakdown": "Pas de répartition", "xpack.observability.exp.breakDownFilter.unavailable": "La répartition par nom d'étape n'est pas disponible pour l'indicateur de durée de monitoring. Utilisez l'indicateur de durée d'étape pour répartir par nom d'étape.", "xpack.observability.exp.breakDownFilter.warning": "Les répartitions ne peuvent être appliquées qu’à une seule série à la fois.", @@ -28237,21 +28194,7 @@ "xpack.securitySolution.getCurrentUser.unknownUser": "Inconnu", "xpack.securitySolution.globalHeader.buttonAddData": "Ajouter des intégrations", "xpack.securitySolution.goToDocumentationButton": "Afficher la documentation", - "xpack.securitySolution.guided_onboarding.endTour.buttonLabel": "Terminer la visite", "xpack.securitySolution.guided_onboarding.nextStep.buttonLabel": "Suivant", - "xpack.securitySolution.guided_onboarding.skipTour.buttonLabel": "Ignorer la visite", - "xpack.securitySolution.guided_onboarding.tour.alertsStep.imageAltText": "Démonstration des alertes", - "xpack.securitySolution.guided_onboarding.tour.alertsStep.tourContent": "Sachez quand les conditions d'une règle sont remplies, afin de pouvoir commencer votre investigation immédiatement. Configurez des notifications avec des plateformes tierces telles que Slack, PagerDuty et ServiceNow.", - "xpack.securitySolution.guided_onboarding.tour.alertsStep.tourTitle": "Soyez informé en cas de modification", - "xpack.securitySolution.guided_onboarding.tour.casesStep.imageAltText": "Démonstration des cas", - "xpack.securitySolution.guided_onboarding.tour.casesStep.tourContent": "Recueillez des éléments probants, ajoutez des collaborateurs et transmettez même les détails de l'affaire à des systèmes tiers de gestion des cas.", - "xpack.securitySolution.guided_onboarding.tour.casesStep.tourTitle": "Créez un cas pour suivre votre investigation", - "xpack.securitySolution.guided_onboarding.tour.dataStep.tourContent": "Recueillez des données à partir de vos points de terminaison en utilisant l'agent Elastic et une variété d'intégrations tierces.", - "xpack.securitySolution.guided_onboarding.tour.dataStep.tourTitle": "Commencez à collecter vos données !", - "xpack.securitySolution.guided_onboarding.tour.manageStep.tourContent": "Décidez de ce qui est important pour vous et votre environnement, et créez des règles pour détecter et prévenir les activités malveillantes. ", - "xpack.securitySolution.guided_onboarding.tour.manageStep.tourTitle": "Protégez votre écosystème", - "xpack.securitySolution.guided_onboarding.tour.overviewStep.tourContent": "Faites une visite rapide pour découvrir un flux de travail unifié pour enquêter sur les activités suspectes.", - "xpack.securitySolution.guided_onboarding.tour.overviewStep.tourTitle": "Bienvenue dans Elastic Security", "xpack.securitySolution.handleInputAreaState.inputPlaceholderText": "Soumettre l’action de réponse", "xpack.securitySolution.header.editableTitle.cancel": "Annuler", "xpack.securitySolution.header.editableTitle.save": "Enregistrer", @@ -31189,7 +31132,6 @@ "xpack.synthetics.monitorManagement.monitorSync.failure.reasonLabel": "Raison", "xpack.synthetics.monitorManagement.monitorSync.failure.statusLabel": "Statut", "xpack.synthetics.monitorManagement.monitorSync.failure.title": "Impossible de synchroniser les moniteurs avec le service Synthetics", - "xpack.synthetics.monitorManagement.myFirstMonitor": "Mon premier moniteur", "xpack.synthetics.monitorManagement.nameRequired": "Le nom de l’emplacement est requis", "xpack.synthetics.monitorManagement.needFleetReadAgentPoliciesPermission": "Vous n'êtes pas autorisé à accéder à Fleet. Des autorisations Fleet sont nécessaires pour créer de nouveaux emplacements privés.", "xpack.synthetics.monitorManagement.needPermissions": "Permissions requises", @@ -31271,7 +31213,6 @@ "xpack.synthetics.overview.heading": "Moniteurs", "xpack.synthetics.overview.monitors.label": "Moniteurs", "xpack.synthetics.overview.pageHeader.title": "Aperçu", - "xpack.synthetics.overview.pagination.ariaLabel": "Pagination pour l’aperçu du moniteur", "xpack.synthetics.overviewPage.overviewCrumb": "Aperçu", "xpack.synthetics.overviewPageLink.disabled.ariaLabel": "Bouton de pagination désactivé indiquant qu'aucune autre navigation ne peut être effectuée dans la liste des moniteurs.", "xpack.synthetics.overviewPageLink.next.ariaLabel": "Page de résultats suivante", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 91d6ae6f2bcb5..b4dafbf2af6ca 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -1161,7 +1161,6 @@ "data.advancedSettings.timepicker.refreshIntervalDefaultsText": "時間フィルターのデフォルト更新間隔「値」はミリ秒で指定する必要があります。", "data.advancedSettings.timepicker.refreshIntervalDefaultsTitle": "タイムピッカーの更新間隔", "data.advancedSettings.timepicker.thisWeek": "今週", - "data.advancedSettings.timepicker.timeDefaultsText": "時間フィルターが選択されずにKibanaが起動した際に使用される時間フィルターです", "data.advancedSettings.timepicker.timeDefaultsTitle": "デフォルトのタイムピッカー", "data.advancedSettings.timepicker.today": "今日", "data.errors.fetchError": "ネットワークとプロキシ構成を確認してください。問題が解決しない場合は、ネットワーク管理者に問い合わせてください。", @@ -1919,7 +1918,6 @@ "discover.context.olderDocumentsWarning": "アンカーよりも古いドキュメントは{docCount}件しか見つかりませんでした。", "discover.context.pageTitle": "#{anchorId}の周りのドキュメント", "discover.contextViewRoute.errorMessage": "ID {dataViewId}の一致するデータビューが見つかりません", - "discover.discoverError.missingQueryParamsError": "URLクエリ文字列が見つかりません{missingParamsList}。", "discover.doc.pageTitle": "1つのドキュメント - #{id}", "discover.doc.somethingWentWrongDescription": "{indexName}が見つかりません。", "discover.docTable.limitedSearchResultLabel": "{resultCount}件の結果のみが表示されます。検索結果を絞り込みます。", @@ -6171,7 +6169,6 @@ "visualizations.listing.table.typeColumnName": "型", "visualizations.listingPageTitle": "Visualizeライブラリ", "visualizations.missedDataView.dataViewReconfigure": "データビュー管理ページで再作成", - "visualizations.missedDataView.editInVisualizeEditor": "Visualizeエディターで編集し、エラーを修正", "visualizations.newChart.conditionalMessage.advancedSettingsLink": "高度な設定", "visualizations.newChart.libraryMode.new": "新規", "visualizations.newChart.libraryMode.old": "古", @@ -6727,7 +6724,6 @@ "xpack.aiops.dataGrid.field.documentCountChartSplit.seriesLabel": "他のドキュメントカウント", "xpack.aiops.documentCountContent.clearSelectionAriaLabel": "選択した項目をクリア", "xpack.aiops.explainLogRateSpikes.loadingState.doneMessage": "完了しました。", - "xpack.aiops.explainLogRateSpikes.loadingState.loadingFieldCandidates": "フィールド候補を読み込んでいます。", "xpack.aiops.explainLogRateSpikes.loadingState.loadingHistogramData": "ヒストグラムデータを読み込んでいます。", "xpack.aiops.explainLogRateSpikesPage.emptyPromptBody": "explainログレートスパイク機能は、ログレートのスパイクに寄与する統計的に有意なフィールド/値の組み合わせを特定します。", "xpack.aiops.explainLogRateSpikesPage.emptyPromptTitle": "ヒストグラム図のスパイクをクリックすると、分析が開始します。", @@ -6849,7 +6845,6 @@ "xpack.apm.tutorial.config_otel.description3": "環境変数、コマンドラインパラメーター、構成コードスニペット(OpenTelemetry仕様に準拠)の網羅的な一覧は、{otelInstrumentationGuide}をご覧ください。一部の不安定なOpenTelemetryクライアントでは、一部の機能がサポートされておらず、別の構成メカニズムが必要になる場合があります。", "xpack.apm.tutorial.djangoClient.configure.commands.setCustomApmServerUrlComment": "カスタム APM Server URL(デフォルト:{defaultApmServerUrl})を設定します", "xpack.apm.tutorial.djangoClient.configure.textPost": "高度な用途に関しては [ドキュメンテーション]({documentationLink})をご覧ください。", - "xpack.apm.tutorial.dotNetClient.configureAgent.textPost": "エージェントに「IConfiguration」インスタンスが渡されていない場合、(例:非 ASP.NET Core アプリケーションの場合)、エージェントを環境変数で構成することもできます。\n 高度な用途に関しては [ドキュメンテーション]({documentationLink})をご覧ください。", "xpack.apm.tutorial.dotNetClient.download.textPre": "[NuGet]({allNuGetPackagesLink})から .NET アプリケーションにエージェントパッケージを追加してください。用途の異なる複数の NuGet パッケージがあります。\n\nEntity Framework Core の ASP.NET Core アプリケーションの場合は、[Elastic.Apm.NetCoreAll]({netCoreAllApmPackageLink})パッケージをダウンロードしてください。このパッケージは、自動的にすべてのエージェントコンポーネントをアプリケーションに追加します。\n\n 依存性を最低限に抑えたい場合、ASP.NET Coreの監視のみに[Elastic.Apm.AspNetCore]({aspNetCorePackageLink})パッケージ、またはEntity Framework Coreの監視のみに[Elastic.Apm.EfCore]({efCorePackageLink})パッケージを使用することができます。\n\n 手動インストルメンテーションのみにパブリック Agent API を使用する場合は、[Elastic.Apm]({elasticApmPackageLink})パッケージを使用してください。", "xpack.apm.tutorial.downloadServerRpm": "32 ビットパッケージをお探しですか?[ダウンロードページ]({downloadPageLink})をご覧ください。", "xpack.apm.tutorial.downloadServerTitle": "32 ビットパッケージをお探しですか?[ダウンロードページ]({downloadPageLink})をご覧ください。", @@ -7154,7 +7149,6 @@ "xpack.apm.dependencyOperationDetailTraceListOutcomeColumn": "成果", "xpack.apm.dependencyOperationDetailTraceListServiceNameColumn": "発生元サービス", "xpack.apm.dependencyOperationDetailTraceListTimestampColumn": "タイムスタンプ", - "xpack.apm.dependencyOperationDetailTraceListTraceIdColumn": "トレース", "xpack.apm.dependencyOperationDetailTraceListTransactionNameColumn": "トランザクション名", "xpack.apm.dependencyOperationDistributionChart.allSpansLegendLabel": "すべてのスパン", "xpack.apm.dependencyOperationDistributionChart.failedSpansLegendLabel": "失敗したスパン", @@ -7423,7 +7417,6 @@ "xpack.apm.mlCallout.updateAvailableCalloutButtonText": "ジョブの更新", "xpack.apm.mlCallout.updateAvailableCalloutText": "劣化したパフォーマンスに関する詳細な分析を提供する異常検知ジョブを更新し、スループットと失敗したトランザクションレートの検知機能を追加しました。アップグレードを選択する場合は、新しいジョブが作成され、既存のレガシージョブが終了します。APMアプリに表示されるデータは自動的に新しいジョブに切り替わります。新しいジョブの作成を選択した場合は、すべての既存のジョブを移行するオプションを使用できません。", "xpack.apm.mlCallout.updateAvailableCalloutTitle": "更新が可能です", - "xpack.apm.navigation.allServicesTitle": "すべてのサービス", "xpack.apm.navigation.apmSettingsTitle": "設定", "xpack.apm.navigation.dependenciesTitle": "依存関係", "xpack.apm.navigation.serviceMapTitle": "サービスマップ", @@ -7457,14 +7450,16 @@ "xpack.apm.serviceGroup.serviceInventory": "インベントリ", "xpack.apm.serviceGroup.serviceMap": "サービスマップ", "xpack.apm.serviceGroups.breadcrumb.title": "サービス", + "xpack.apm.serviceGroups.buttonGroup.allServices": "すべてのサービス", + "xpack.apm.serviceGroups.buttonGroup.serviceGroups": "サービスグループ", "xpack.apm.serviceGroups.cardsList.emptyDescription": "説明がありません", "xpack.apm.serviceGroups.createGroupLabel": "グループを作成", "xpack.apm.serviceGroups.createSuccess.toast.text": "グループは、グループの新しいサービスビューに表示されます。", "xpack.apm.serviceGroups.deleteFailure.unknownId.toast.text": "グループを削除できません。不明なサービスグループIDです。", "xpack.apm.serviceGroups.editGroupLabel": "グループを編集", "xpack.apm.serviceGroups.editSuccess.toast.text": "サービスグループの新しいグループが保存されました。", - "xpack.apm.serviceGroups.emptyPrompt.message": "このフィルターのグループが見つかりません", - "xpack.apm.serviceGroups.emptyPrompt.serviceGroups": "サービスグループ", + "xpack.apm.serviceGroups.filtered.emptyPrompt.message": "このフィルターのグループが見つかりません", + "xpack.apm.serviceGroups.filtered.emptyPrompt.serviceGroups": "サービスグループ", "xpack.apm.serviceGroups.groupDetailsForm.cancel": "キャンセル", "xpack.apm.serviceGroups.groupDetailsForm.color": "色", "xpack.apm.serviceGroups.groupDetailsForm.create.title": "グループを作成", @@ -7475,8 +7470,6 @@ "xpack.apm.serviceGroups.groupDetailsForm.invalidColorError": "有効な色値を指定してください", "xpack.apm.serviceGroups.groupDetailsForm.name": "名前", "xpack.apm.serviceGroups.groupDetailsForm.selectServices": "サービスを選択", - "xpack.apm.serviceGroups.list.allServices.description": "すべてのサービスを表示", - "xpack.apm.serviceGroups.list.allServices.name": "すべてのサービス", "xpack.apm.serviceGroups.list.sort.alphabetical": "アルファベット順", "xpack.apm.serviceGroups.list.sort.recentlyAdded": "最近追加された項目", "xpack.apm.serviceGroups.selectServicesForm.cancel": "キャンセル", @@ -7497,8 +7490,6 @@ "xpack.apm.serviceGroups.tour.dismiss": "閉じる", "xpack.apm.serviceGroups.tour.editGroups.content": "編集オプションを使用して、名前、クエリ、このサービスグループの詳細を変更します。", "xpack.apm.serviceGroups.tour.editGroups.title": "このサービスグループを編集", - "xpack.apm.serviceGroups.tour.serviceGroups.content": "サービスグループが作成されたため、すべてのサービスインベントリがここに移動されました。このグループは編集または削除できません。", - "xpack.apm.serviceGroups.tour.serviceGroups.title": "すべてのサービスグループ", "xpack.apm.serviceHealthStatus.critical": "重大", "xpack.apm.serviceHealthStatus.healthy": "正常", "xpack.apm.serviceHealthStatus.unknown": "不明", @@ -11671,7 +11662,7 @@ "xpack.enterpriseSearch.nav.contentTitle": "コンテンツ", "xpack.enterpriseSearch.nav.elasticsearchTitle": "Elasticsearch", "xpack.enterpriseSearch.nav.enterpriseSearchOverviewTitle": "概要", - "xpack.enterpriseSearch.nav.searchExperiencesTitle": "検索", + "xpack.enterpriseSearch.nav.searchTitle": "検索", "xpack.enterpriseSearch.nav.searchIndicesTitle": "インデックス", "xpack.enterpriseSearch.nav.workplaceSearchTitle": "Workplace Search", "xpack.enterpriseSearch.notFound.action1": "ダッシュボードに戻す", @@ -12688,7 +12679,6 @@ "xpack.fleet.epmList.verificationWarningCalloutIntroText": "1つ以上のインストールされた統合には、真正が不明な未署名のパッケージが含まれています。{learnMoreLink}の詳細をご覧ください。", "xpack.fleet.fleetServerCloudRequiredCallout.calloutDescription": "Fleetにエージェントを登録するには、Fleetサーバーが必要です。{cloudDeploymentLink}でFleetサーバーを有効にします。詳細については、{guideLink}を参照してください。", "xpack.fleet.fleetServerFlyout.generateFleetServerPolicySuccessInstructions": "Fleetサーバーポリシーとサービストークンが生成されました。ホストが{hostUrl}で構成されました。 {fleetSettingsLink}でFleetサーバーを編集できます。", - "xpack.fleet.fleetServerFlyout.getStartedInstructions": "まず、エージェントがFleetサーバーに接続するために使用する、公開IPまたはホスト名とポートを設定します。デフォルトでは、ポート{port}が使用されます。これで、自動的にポリシーが生成されます。", "xpack.fleet.fleetServerFlyout.installFleetServerInstructions": "Fleetサーバーエージェントを一元化されたホストにインストールし、監視する他のホストがそれに接続できるようにします。本番では、1つ以上の専用ホストを使用することをお勧めします。詳細なガイダンスについては、{installationLink}を参照してください。", "xpack.fleet.fleetServerFlyout.instructions": "Fleetにエージェントを登録する前に、Fleetサーバーが必要です。Fleetサーバーのセットアップについては、次の手順に従ってください。詳細については、{userGuideLink}を参照してください。", "xpack.fleet.fleetServerOnPremRequiredCallout.calloutDescription": "Fleetサーバーのセットアップについては、次の手順に従ってください。詳細については、{guideLink}を参照してください。", @@ -12768,9 +12758,6 @@ "xpack.fleet.settings.editOutputFlyout.defaultOutputSwitchLabel": "この出力を{boldAgentIntegrations}のデフォルトにします。", "xpack.fleet.settings.editOutputFlyout.logstashHostsInputDescription": "エージェントがLogstashに接続するために使用するアドレスを指定します。{guideLink}。", "xpack.fleet.settings.fleetServerHostSectionSubtitle": "エージェントがFleetサーバーに接続するために使用するURLを指定します。複数のURLが存在する場合、Fleetは登録目的で最初に指定されたURLを表示します。詳細については、{guideLink}を参照してください。", - "xpack.fleet.settings.fleetServerHostsFlyout.agentPolicyCount": "{agentPolicyCount, plural, other {# 件のエージェントポリシー}}", - "xpack.fleet.settings.fleetServerHostsFlyout.agentsCount": "{agentCount, plural, other {# 個のエージェント}}", - "xpack.fleet.settings.fleetServerHostsFlyout.confirmModalText": "{policies}と{agents}が更新されます。このアクションは元に戻せません。続行していいですか?", "xpack.fleet.settings.fleetServerHostsFlyout.description": "エージェントがFleetサーバーに接続するために使用するURLを指定します。複数のURLが存在する場合、Fleetは登録目的で最初に指定されたURLを表示します。Fleetサーバーはデフォルトで8220番ポートを使用します。{link}を参照してください。", "xpack.fleet.settings.logstashInstructions.addPipelineStepDescription": "Logstash構成ディレクトリの{pipelineFile}ファイルを開き、次の構成を追加します。ファイルへのパスを置換します。", "xpack.fleet.settings.logstashInstructions.description": "Elasticエージェントパイプライン構成をLogstashに追加し、Elasticエージェントフレームワークからイベントを受信します。{documentationLink}。", @@ -13350,8 +13337,6 @@ "xpack.fleet.epm.pageSubtitle": "データの収集と分析を開始するには、統合を選択します。", "xpack.fleet.epm.releaseBadge.betaDescription": "この統合は本番環境用ではありません。", "xpack.fleet.epm.releaseBadge.betaLabel": "ベータ", - "xpack.fleet.epm.releaseBadge.experimentalDescription": "この機能はテクニカルプレビュー中であり、将来のリリースでは変更されたり完全に削除されたりする場合があります。Elasticは最善の努力を講じてすべての問題の修正に努めますが、テクニカルプレビュー中の機能には正式なGA機能のサポートSLAが適用されません。", - "xpack.fleet.epm.releaseBadge.experimentalLabel": "テクニカルプレビュー", "xpack.fleet.epm.screenshotErrorText": "このスクリーンショットを読み込めません", "xpack.fleet.epm.screenshotsTitle": "スクリーンショット", "xpack.fleet.epm.updateAvailableTooltip": "更新が利用可能です", @@ -13388,8 +13373,6 @@ "xpack.fleet.fleetServerFlyout.getStartedTitle": "Fleetサーバーの基本", "xpack.fleet.fleetServerFlyout.installFleetServerTitle": "Fleetサーバーを一元化されたホストにインストール", "xpack.fleet.fleetServerFlyout.title": "Fleetサーバーを追加", - "xpack.fleet.fleetServerHost.requiredError": "Fleetサーバーホストは必須です。", - "xpack.fleet.fleetServerHost.requiresHttpsError": "Fleetサーバーホストの先頭は「https」でなければなりません", "xpack.fleet.fleetServerOnPremRequiredCallout.calloutTitle": "Fleetにエージェントを登録する前に、Fleetサーバーが必要です。", "xpack.fleet.fleetServerOnPremRequiredCallout.guideLink": "FleetおよびElasticエージェントガイド", "xpack.fleet.fleetServerOnPremUnhealthyCallout.addFleetServerButtonLabel": "Fleetサーバーの追加", @@ -13397,7 +13380,6 @@ "xpack.fleet.fleetServerOnPremUnhealthyCallout.guideLink": "FleetおよびElasticエージェントガイド", "xpack.fleet.fleetServerSetup.addFleetServerHostButton": "ホストの追加", "xpack.fleet.fleetServerSetup.addFleetServerHostInputLabel": "Fleetサーバーホスト", - "xpack.fleet.fleetServerSetup.addFleetServerHostInvalidUrlError": "無効なURL", "xpack.fleet.fleetServerSetup.addFleetServerHostStepTitle": "Fleetサーバーホストの追加", "xpack.fleet.fleetServerSetup.addFleetServerHostSuccessTitle": "追加されたFleetサーバーホスト", "xpack.fleet.fleetServerSetup.cloudDeploymentLink": "デプロイを編集", @@ -13598,7 +13580,6 @@ "xpack.fleet.settings.editOutputFlyout.typeInputPlaceholder": "タイプを指定", "xpack.fleet.settings.editOutputFlyout.yamlConfigInputLabel": "詳細YAML構成", "xpack.fleet.settings.editOutputFlyout.yamlConfigInputPlaceholder": "# このYAML設定は、各エージェントポリシーの出力セクションに追加されます。", - "xpack.fleet.settings.fleetServerHostEditButtonLabel": "ホストを編集", "xpack.fleet.settings.fleetServerHostsDifferentPathOrProtocolError": "各URLのプロトコルとパスは同じでなければなりません", "xpack.fleet.settings.fleetServerHostsDuplicateError": "重複するURL", "xpack.fleet.settings.fleetServerHostSectionTitle": "Fleetサーバーホスト", @@ -13610,11 +13591,8 @@ "xpack.fleet.settings.fleetServerHostsFlyout.fleetServerHostsInputPlaceholder": "ホストURLを指定", "xpack.fleet.settings.fleetServerHostsFlyout.saveButton": "設定を保存して適用", "xpack.fleet.settings.fleetServerHostsFlyout.successToastTitle": "設定が保存されました", - "xpack.fleet.settings.fleetServerHostsFlyout.title": "Fleetサーバーホスト", "xpack.fleet.settings.fleetServerHostsFlyout.userGuideLink": "FleetおよびElasticエージェントガイド", - "xpack.fleet.settings.fleetServerHostsPreconfiguredTooltipContent": "Fleet Serverホストは、Fleet外で構成されます。詳細については、Kibana構成を参照してください。", "xpack.fleet.settings.fleetServerHostsRequiredError": "ホストURLは必須です", - "xpack.fleet.settings.fleetServerHostUrlColumnTitle": "ホストURL", "xpack.fleet.settings.fleetSettingsLink": "詳細", "xpack.fleet.settings.fleetUserGuideLink": "FleetおよびElasticエージェントガイド", "xpack.fleet.settings.logstashInstructions.apiKeyStepDescription": "Elasticエージェントの最小限の権限で、LogstashがElasticsearchに出力できるようにすることをお勧めします。", @@ -15582,15 +15560,15 @@ "xpack.infra.homePage.noMetricsIndicesInstructionsActionLabel": "セットアップの手順を表示", "xpack.infra.homePage.settingsTabTitle": "設定", "xpack.infra.homePage.toolbar.kqlSearchFieldPlaceholder": "インフラストラクチャデータを検索…(例:host.name:host-1)", - "xpack.infra.hostsTable.nameColumnHeader": "名前", - "xpack.infra.hostsTable.operatingSystemColumnHeader": "オペレーティングシステム", - "xpack.infra.hostsTable.numberOfCpusColumnHeader": "CPU数", - "xpack.infra.hostsTable.diskLatencyColumnHeader": "", + "xpack.infra.hostsTable.averageMemoryTotalColumnHeader": "メモリ合計 (平均) ", + "xpack.infra.hostsTable.averageMemoryUsageColumnHeader": "メモリー使用状況(平均)", "xpack.infra.hostsTable.averageTxColumnHeader": "", "xpack.infra.hostsTable.averageRxColumnHeader": "", - "xpack.infra.hostsTable.averageMemoryTotalColumnHeader": "メモリ合計 (平均) ", + "xpack.infra.hostsTable.diskLatencyColumnHeader": "", + "xpack.infra.hostsTable.nameColumnHeader": "名前", + "xpack.infra.hostsTable.numberOfCpusColumnHeader": "CPU数", + "xpack.infra.hostsTable.operatingSystemColumnHeader": "オペレーティングシステム", "xpack.infra.hostsTable.servicesOnHostColumnHeader": "", - "xpack.infra.hostsTable.averageMemoryUsageColumnHeader": "メモリー使用状況(平均)", "xpack.infra.infra.nodeDetails.apmTabLabel": "APM", "xpack.infra.infra.nodeDetails.createAlertLink": "インベントリルールの作成", "xpack.infra.infra.nodeDetails.openAsPage": "ページとして開く", @@ -17249,7 +17227,6 @@ "xpack.lens.indexPattern.timeShiftSmallWarning": "{label}は{columnTimeShift}の時間シフトを使用しています。これは{interval}の日付ヒストグラム間隔よりも小さいです。不一致のデータを防止するには、時間シフトとして{interval}を使用します。", "xpack.lens.indexPattern.uniqueLabel": "{label} [{num}]", "xpack.lens.indexPattern.valueCountOf": "{name}のカウント", - "xpack.lens.indexPatterns.fieldSearchLiveRegion": "{availableFields}使用可能な{availableFields, plural, other {フィールド}}。{emptyFields}空の{emptyFields, plural, other {フィールド}}。 {metaFields}メタ{metaFields, plural, other {フィールド}}。", "xpack.lens.indexPatternSuggestion.removeLayerLabel": "{indexPatternTitle}のみを表示", "xpack.lens.indexPatternSuggestion.removeLayerPositionLabel": "レイヤー{layerNumber}のみを表示", "xpack.lens.modalTitle.title.clear": "{layerType}レイヤーをクリアしますか?", @@ -17559,7 +17536,6 @@ "xpack.lens.heatmapVisualization.missingXAccessorLongMessage": "横軸の構成がありません。", "xpack.lens.heatmapVisualization.missingXAccessorShortMessage": "横軸がありません。", "xpack.lens.indexPattern.advancedSettings": "高度な設定", - "xpack.lens.indexPattern.allFieldsLabel": "すべてのフィールド", "xpack.lens.indexPattern.allFieldsLabelHelp": "使用可能なフィールドをワークスペースまでドラッグし、ビジュアライゼーションを作成します。使用可能なフィールドを変更するには、別のデータビューを選択するか、クエリを編集するか、別の時間範囲を使用します。一部のフィールドタイプは、完全なテキストおよびグラフィックフィールドを含む Lens では、ビジュアライゼーションできません。", "xpack.lens.indexPattern.allFieldsSamplingLabelHelp": "使用可能なフィールドには、フィルターと一致する最初の 500 件のドキュメントのデータがあります。すべてのフィールドを表示するには、空のフィールドを展開します。全文、地理、フラット化、オブジェクトフィールドでビジュアライゼーションを作成できません。", "xpack.lens.indexPattern.ascendingCountPrecisionErrorWarning.link": "ドキュメントをご覧ください", @@ -17606,12 +17582,7 @@ "xpack.lens.indexPattern.differences.signature": "メトリック:数値", "xpack.lens.indexPattern.emptyDimensionButton": "空のディメンション", "xpack.lens.indexPattern.emptyFieldsLabel": "空のフィールド", - "xpack.lens.indexPattern.emptyFieldsLabelHelp": "空のフィールドには、フィルターに基づく最初の 500 件のドキュメントの値が含まれていませんでした。", "xpack.lens.indexPattern.enableAccuracyMode": "精度モードを有効にする", - "xpack.lens.indexPattern.existenceErrorAriaLabel": "存在の取り込みに失敗しました", - "xpack.lens.indexPattern.existenceErrorLabel": "フィールド情報を読み込めません", - "xpack.lens.indexPattern.existenceTimeoutAriaLabel": "存在の取り込みがタイムアウトしました", - "xpack.lens.indexPattern.existenceTimeoutLabel": "フィールド情報に時間がかかりすぎました", "xpack.lens.indexPattern.fieldItemTooltip": "可視化するには、ドラッグアンドドロップします。", "xpack.lens.indexPattern.fieldPlaceholder": "フィールド", "xpack.lens.indexPattern.fieldStatsButtonEmptyLabel": "このフィールドにはデータがありませんが、ドラッグアンドドロップで可視化できます。", @@ -17789,16 +17760,6 @@ "xpack.lens.indexPattern.useAsTopLevelAgg": "最初にこのフィールドでグループ化", "xpack.lens.indexPatterns.clearFiltersLabel": "名前とタイプフィルターを消去", "xpack.lens.indexPatterns.filterByNameLabel": "検索フィールド名", - "xpack.lens.indexPatterns.noAvailableDataLabel": "データを含むフィールドはありません。", - "xpack.lens.indexPatterns.noDataLabel": "フィールドがありません。", - "xpack.lens.indexPatterns.noEmptyDataLabel": "空のフィールドがありません。", - "xpack.lens.indexPatterns.noFields.extendTimeBullet": "時間範囲を拡張中", - "xpack.lens.indexPatterns.noFields.fieldTypeFilterBullet": "別のフィールドフィルターを使用", - "xpack.lens.indexPatterns.noFields.globalFiltersBullet": "グローバルフィルターを変更", - "xpack.lens.indexPatterns.noFields.tryText": "試行対象:", - "xpack.lens.indexPatterns.noFieldsLabel": "このデータビューにはフィールドがありません。", - "xpack.lens.indexPatterns.noFilteredFieldsLabel": "選択したフィルターと一致するフィールドはありません。", - "xpack.lens.indexPatterns.noMetaDataLabel": "メタフィールドがありません。", "xpack.lens.label.gauge.labelMajor.header": "タイトル", "xpack.lens.label.gauge.labelMinor.header": "サブタイトル", "xpack.lens.label.header": "ラベル", @@ -21599,8 +21560,6 @@ "xpack.ml.trainedModels.modelsList.pipelines.processorStats.typeHeader": "プロセッサータイプ", "xpack.ml.trainedModels.modelsList.selectableMessage": "モデルを選択", "xpack.ml.trainedModels.modelsList.startDeployment.cancelButton": "キャンセル", - "xpack.ml.trainedModels.modelsList.startDeployment.cloudWarningHeader": "将来は、必要な数のプロセッサーになるように、クラウドデプロイが自動スケーリングされる予定です。", - "xpack.ml.trainedModels.modelsList.startDeployment.cloudWarningText": "ただし、このリリースでは、クラウドコンソールで手動でMLノードのサイズを増やし、プロセッサーを増やす必要があります。", "xpack.ml.trainedModels.modelsList.startDeployment.docLinkTitle": "詳細", "xpack.ml.trainedModels.modelsList.startDeployment.maxNumOfProcessorsWarning": "割り当て数と割り当てごとのスレッドの積は、MLノードのプロセッサーの合計数未満でなければなりません。", "xpack.ml.trainedModels.modelsList.startDeployment.numbersOfAllocationsHelp": "増やすと、すべてのリクエストのスループットを改善します。", @@ -23310,7 +23269,6 @@ "xpack.observability.alerts.ruleStats.loadError": "ルール統計情報を読み込めません", "xpack.observability.alerts.ruleStats.muted": "スヌーズ済み", "xpack.observability.alerts.ruleStats.ruleCount": "ルール数", - "xpack.observability.alerts.searchBarPlaceholder": "検索アラート(例:kibana.alert.evaluation.threshold > 75)", "xpack.observability.alerts.workflowStatusFilter.acknowledgedButtonLabel": "認識", "xpack.observability.alerts.workflowStatusFilter.closedButtonLabel": "終了", "xpack.observability.alerts.workflowStatusFilter.openButtonLabel": "開く", @@ -23384,7 +23342,6 @@ "xpack.observability.enableInspectEsQueriesExperimentName": "ESクエリを調査", "xpack.observability.enableNewSyntheticsViewExperimentDescription": "オブザーバビリティで新しい合成監視アプリケーションを有効にします。設定を適用するにはページを更新してください。", "xpack.observability.enableNewSyntheticsViewExperimentName": "新しい合成監視アプリケーションを有効にする", - "xpack.observability.enableServiceGroups": "サービスグループ機能", "xpack.observability.exp.breakDownFilter.noBreakdown": "内訳なし", "xpack.observability.exp.breakDownFilter.unavailable": "モニター期間メトリックでは、ステップ名内訳を使用できません。ステップ期間メトリックを使用して、ステップ名で分解します。", "xpack.observability.exp.breakDownFilter.warning": "内訳は一度に1つの系列にのみ適用できます。", @@ -28212,21 +28169,7 @@ "xpack.securitySolution.getCurrentUser.unknownUser": "不明", "xpack.securitySolution.globalHeader.buttonAddData": "統合の追加", "xpack.securitySolution.goToDocumentationButton": "ドキュメンテーションを表示", - "xpack.securitySolution.guided_onboarding.endTour.buttonLabel": "ツアーを終了", "xpack.securitySolution.guided_onboarding.nextStep.buttonLabel": "次へ", - "xpack.securitySolution.guided_onboarding.skipTour.buttonLabel": "ツアーをスキップ", - "xpack.securitySolution.guided_onboarding.tour.alertsStep.imageAltText": "アラートデモ", - "xpack.securitySolution.guided_onboarding.tour.alertsStep.tourContent": "ルールの条件が満たされているときを把握し、調査をすぐに開始できるようにします。Slack、PagerDuty、ServiceNowなどのサードパーティプラットフォームで通知を設定します。", - "xpack.securitySolution.guided_onboarding.tour.alertsStep.tourTitle": "変更が発生したときに通知", - "xpack.securitySolution.guided_onboarding.tour.casesStep.imageAltText": "ケースのデモ", - "xpack.securitySolution.guided_onboarding.tour.casesStep.tourContent": "エビデンスを収集し、その他のコラボレーターを追加し、さらにケース詳細をサードパーティケース管理システムにプッシュします。", - "xpack.securitySolution.guided_onboarding.tour.casesStep.tourTitle": "調査を追跡するには、ケースを作成します", - "xpack.securitySolution.guided_onboarding.tour.dataStep.tourContent": "Elasticエージェントとさまざまなサードパーティ統合を使用して、エンドポイントからデータを収集します。", - "xpack.securitySolution.guided_onboarding.tour.dataStep.tourTitle": "データの収集を開始してください。", - "xpack.securitySolution.guided_onboarding.tour.manageStep.tourContent": "重要な項目と環境を決定し、悪意のあるアクティビティを検出および防御するルールを作成します。", - "xpack.securitySolution.guided_onboarding.tour.manageStep.tourTitle": "エコシステムを保護", - "xpack.securitySolution.guided_onboarding.tour.overviewStep.tourContent": "不審なアクティビティの調査については、統合ワークフローを説明するクイックガイドを表示してください。", - "xpack.securitySolution.guided_onboarding.tour.overviewStep.tourTitle": "Elastic Securityへようこそ", "xpack.securitySolution.handleInputAreaState.inputPlaceholderText": "対応アクションを送信", "xpack.securitySolution.header.editableTitle.cancel": "キャンセル", "xpack.securitySolution.header.editableTitle.save": "保存", @@ -31165,7 +31108,6 @@ "xpack.synthetics.monitorManagement.monitorSync.failure.reasonLabel": "理由", "xpack.synthetics.monitorManagement.monitorSync.failure.statusLabel": "ステータス", "xpack.synthetics.monitorManagement.monitorSync.failure.title": "モニターをSyntheticsサービスと同期できませんでした", - "xpack.synthetics.monitorManagement.myFirstMonitor": "最初のモニター", "xpack.synthetics.monitorManagement.nameRequired": "場所名は必須です", "xpack.synthetics.monitorManagement.needFleetReadAgentPoliciesPermission": "Fleet へのアクセスが許可されていません。新しい非公開の場所を作成するには、Fleet権限が必要です。", "xpack.synthetics.monitorManagement.needPermissions": "権限が必要です", @@ -31247,7 +31189,6 @@ "xpack.synthetics.overview.heading": "監視", "xpack.synthetics.overview.monitors.label": "監視", "xpack.synthetics.overview.pageHeader.title": "概要", - "xpack.synthetics.overview.pagination.ariaLabel": "監視概要のページネーション", "xpack.synthetics.overviewPage.overviewCrumb": "概要", "xpack.synthetics.overviewPageLink.disabled.ariaLabel": "無効になったページ付けボタンです。モニターリストがこれ以上ナビゲーションできないことを示しています。", "xpack.synthetics.overviewPageLink.next.ariaLabel": "次の結果ページ", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index c929f0f0d80ba..6fd802162e941 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1163,7 +1163,6 @@ "data.advancedSettings.timepicker.refreshIntervalDefaultsText": "时间筛选的默认刷新时间间隔。需要使用毫秒单位指定“值”。", "data.advancedSettings.timepicker.refreshIntervalDefaultsTitle": "时间筛选刷新时间间隔", "data.advancedSettings.timepicker.thisWeek": "本周", - "data.advancedSettings.timepicker.timeDefaultsText": "在未使用时间筛选的情况下启动 Kibana 时要使用的时间筛选选项", "data.advancedSettings.timepicker.timeDefaultsTitle": "时间筛选默认值", "data.advancedSettings.timepicker.today": "今日", "data.errors.fetchError": "请检查您的网络和代理配置。如果问题持续存在,请联系网络管理员。", @@ -1921,7 +1920,6 @@ "discover.context.olderDocumentsWarning": "仅可以找到 {docCount} 个比定位标记旧的文档。", "discover.context.pageTitle": "#{anchorId} 周围的文档", "discover.contextViewRoute.errorMessage": "没有与 ID {dataViewId} 相匹配的数据视图", - "discover.discoverError.missingQueryParamsError": "URL 查询字符串缺少 {missingParamsList}。", "discover.doc.pageTitle": "单个文档 - #{id}", "discover.doc.somethingWentWrongDescription": "{indexName} 缺失。", "discover.docExplorerCallout.bodyMessage": "使用 {documentExplorer} 快速排序、选择和比较数据,调整列大小并以全屏方式查看文档。", @@ -6178,7 +6176,6 @@ "visualizations.listing.table.typeColumnName": "类型", "visualizations.listingPageTitle": "Visualize 库", "visualizations.missedDataView.dataViewReconfigure": "在数据视图管理页面中重新创建", - "visualizations.missedDataView.editInVisualizeEditor": "在 Visualize 编辑器中编辑以修复该错误", "visualizations.newChart.conditionalMessage.advancedSettingsLink": "免费的 API 密钥。", "visualizations.newChart.libraryMode.new": "新", "visualizations.newChart.libraryMode.old": "以前", @@ -6737,7 +6734,6 @@ "xpack.aiops.dataGrid.field.documentCountChartSplit.seriesLabel": "其他文档计数", "xpack.aiops.documentCountContent.clearSelectionAriaLabel": "清除所选内容", "xpack.aiops.explainLogRateSpikes.loadingState.doneMessage": "完成。", - "xpack.aiops.explainLogRateSpikes.loadingState.loadingFieldCandidates": "正在加载字段候选项。", "xpack.aiops.explainLogRateSpikes.loadingState.loadingHistogramData": "正在加载直方图数据。", "xpack.aiops.explainLogRateSpikesPage.emptyPromptBody": "“解释日志速率峰值”功能会从统计上识别有助于达到日志速率峰值的重要字段/值组合。", "xpack.aiops.explainLogRateSpikesPage.emptyPromptTitle": "单击直方图中的某个峰值可开始分析。", @@ -6865,7 +6861,6 @@ "xpack.apm.tutorial.config_otel.description3": "{otelInstrumentationGuide}中提供了环境变量、命令行参数和配置代码片段(根据 OpenTelemetry 规范)的详细列表。某些不稳定的 OpenTelemetry 客户端可能不支持所有功能,并可能需要备选配置机制。", "xpack.apm.tutorial.djangoClient.configure.commands.setCustomApmServerUrlComment": "设置定制 APM Server URL(默认值:{defaultApmServerUrl})", "xpack.apm.tutorial.djangoClient.configure.textPost": "有关高级用法,请参阅[文档]({documentationLink})。", - "xpack.apm.tutorial.dotNetClient.configureAgent.textPost": "如果您未将 `IConfiguration` 实例传递给代理(例如非 ASP.NET Core 应用程序), 您还可以通过环境变量配置代理。\n 有关高级用法,请参阅[文档]({documentationLink})。", "xpack.apm.tutorial.dotNetClient.download.textPre": "将来自 [NuGet]({allNuGetPackagesLink}) 的代理软件包添加到 .NET 应用程序。有多个 NuGet 软件包可用于不同的用例。\n\n对于具有 Entity Framework Core 的 ASP.NET Core 应用程序,请下载 [Elastic.Apm.NetCoreAll]({netCoreAllApmPackageLink}) 软件包。此软件包将自动将每个 代理组件添加到您的应用程序。\n\n 如果您希望最大程度减少依存关系,您可以将 [Elastic.Apm.AspNetCore]({aspNetCorePackageLink}) 软件包仅用于 ASP.NET Core 监测,或将 [Elastic.Apm.EfCore]({efCorePackageLink}) 软件包仅用于 Entity Framework Core 监测。\n\n 如果 仅希望将公共代理 API 用于手动检测,请使用 [Elastic.Apm]({elasticApmPackageLink}) 软件包。", "xpack.apm.tutorial.downloadServerRpm": "寻找 32 位软件包?请参阅[下载页面]({downloadPageLink})。", "xpack.apm.tutorial.downloadServerTitle": "寻找 32 位软件包?请参阅[下载页面]({downloadPageLink})。", @@ -7170,7 +7165,6 @@ "xpack.apm.dependencyOperationDetailTraceListOutcomeColumn": "结果", "xpack.apm.dependencyOperationDetailTraceListServiceNameColumn": "发起服务", "xpack.apm.dependencyOperationDetailTraceListTimestampColumn": "时间戳", - "xpack.apm.dependencyOperationDetailTraceListTraceIdColumn": "跟踪", "xpack.apm.dependencyOperationDetailTraceListTransactionNameColumn": "事务名称", "xpack.apm.dependencyOperationDistributionChart.allSpansLegendLabel": "所有跨度", "xpack.apm.dependencyOperationDistributionChart.failedSpansLegendLabel": "失败的跨度", @@ -7439,7 +7433,6 @@ "xpack.apm.mlCallout.updateAvailableCalloutButtonText": "更新作业", "xpack.apm.mlCallout.updateAvailableCalloutText": "我们已更新有助于深入了解性能降级的异常检测作业,并添加了检测工具以获取吞吐量和失败事务率。如果您选择进行升级,我们将创建新作业,并关闭现有的旧版作业。APM 应用中显示的数据将自动切换到新数据。请注意,如果您选择创建新作业,用于迁移所有现有作业的选项将不可用。", "xpack.apm.mlCallout.updateAvailableCalloutTitle": "可用更新", - "xpack.apm.navigation.allServicesTitle": "所有服务", "xpack.apm.navigation.apmSettingsTitle": "设置", "xpack.apm.navigation.dependenciesTitle": "依赖项", "xpack.apm.navigation.serviceMapTitle": "服务地图", @@ -7474,14 +7467,16 @@ "xpack.apm.serviceGroup.serviceInventory": "库存", "xpack.apm.serviceGroup.serviceMap": "服务地图", "xpack.apm.serviceGroups.breadcrumb.title": "服务", + "xpack.apm.serviceGroups.buttonGroup.allServices": "所有服务", + "xpack.apm.serviceGroups.buttonGroup.serviceGroups": "服务组", "xpack.apm.serviceGroups.cardsList.emptyDescription": "描述不可用", "xpack.apm.serviceGroups.createGroupLabel": "创建组", "xpack.apm.serviceGroups.createSuccess.toast.text": "您的组当前在组的新服务视图中可见。", "xpack.apm.serviceGroups.deleteFailure.unknownId.toast.text": "无法删除组:服务组 ID 未知。", "xpack.apm.serviceGroups.editGroupLabel": "编辑组", "xpack.apm.serviceGroups.editSuccess.toast.text": "已将新更改保存到服务组。", - "xpack.apm.serviceGroups.emptyPrompt.message": "找不到此筛选的组", - "xpack.apm.serviceGroups.emptyPrompt.serviceGroups": "服务组", + "xpack.apm.serviceGroups.filtered.emptyPrompt.message": "找不到此筛选的组", + "xpack.apm.serviceGroups.filtered.emptyPrompt.serviceGroups": "服务组", "xpack.apm.serviceGroups.groupDetailsForm.cancel": "取消", "xpack.apm.serviceGroups.groupDetailsForm.color": "颜色", "xpack.apm.serviceGroups.groupDetailsForm.create.title": "创建组", @@ -7492,8 +7487,6 @@ "xpack.apm.serviceGroups.groupDetailsForm.invalidColorError": "请提供有效的颜色值", "xpack.apm.serviceGroups.groupDetailsForm.name": "名称", "xpack.apm.serviceGroups.groupDetailsForm.selectServices": "选择服务", - "xpack.apm.serviceGroups.list.allServices.description": "查看所有服务", - "xpack.apm.serviceGroups.list.allServices.name": "所有服务", "xpack.apm.serviceGroups.list.sort.alphabetical": "按字母顺序", "xpack.apm.serviceGroups.list.sort.recentlyAdded": "最近添加", "xpack.apm.serviceGroups.selectServicesForm.cancel": "取消", @@ -7514,8 +7507,6 @@ "xpack.apm.serviceGroups.tour.dismiss": "关闭", "xpack.apm.serviceGroups.tour.editGroups.content": "使用编辑选项更改此服务组的名称、查询或详情。", "xpack.apm.serviceGroups.tour.editGroups.title": "编辑此服务组", - "xpack.apm.serviceGroups.tour.serviceGroups.content": "既然您已创建服务组,您的所有服务库存已移到此处。无法编辑或移除该组。", - "xpack.apm.serviceGroups.tour.serviceGroups.title": "所有服务组", "xpack.apm.serviceHealthStatus.critical": "紧急", "xpack.apm.serviceHealthStatus.healthy": "运行正常", "xpack.apm.serviceHealthStatus.unknown": "未知", @@ -11690,7 +11681,7 @@ "xpack.enterpriseSearch.nav.contentTitle": "内容", "xpack.enterpriseSearch.nav.elasticsearchTitle": "Elasticsearch", "xpack.enterpriseSearch.nav.enterpriseSearchOverviewTitle": "概览", - "xpack.enterpriseSearch.nav.searchExperiencesTitle": "搜索", + "xpack.enterpriseSearch.nav.searchTitle": "搜索", "xpack.enterpriseSearch.nav.searchIndicesTitle": "索引", "xpack.enterpriseSearch.nav.workplaceSearchTitle": "Workplace Search", "xpack.enterpriseSearch.notFound.action1": "返回到您的仪表板", @@ -12708,7 +12699,6 @@ "xpack.fleet.epmList.verificationWarningCalloutIntroText": "一个或多个已安装的集成包含真实性未知的未签名软件包。详细了解 {learnMoreLink}。", "xpack.fleet.fleetServerCloudRequiredCallout.calloutDescription": "需要提供运行正常的 Fleet 服务器,才能使用 Fleet 注册代理。在 {cloudDeploymentLink} 中启用 Fleet 服务器。有关详细信息,请参阅 {guideLink}。", "xpack.fleet.fleetServerFlyout.generateFleetServerPolicySuccessInstructions": "已生成 Fleet 服务器策略和服务令牌。已在 {hostUrl} 配置主机。您可以在{fleetSettingsLink}中编辑 Fleet 服务器主机。", - "xpack.fleet.fleetServerFlyout.getStartedInstructions": "首先,设置代理将用于访问 Fleet 服务器的公共 IP 或主机名和端口。它默认使用端口 {port}。然后,将自动为您生成策略。", "xpack.fleet.fleetServerFlyout.installFleetServerInstructions": "在集中式主机上安装 Fleet 服务器代理,以便您希望监测的其他主机与其建立连接。在生产环境中,我们建议使用一台或多台专用主机。如需其他指南,请参阅我们的 {installationLink}。", "xpack.fleet.fleetServerFlyout.instructions": "需要提供 Fleet 服务器,才能使用 Fleet 注册代理。按照下面的说明设置 Fleet 服务器。有关详细信息,请参阅{userGuideLink}", "xpack.fleet.fleetServerOnPremRequiredCallout.calloutDescription": "按照下面的说明设置 Fleet 服务器。有关详细信息,请参阅 {guideLink}。", @@ -12788,9 +12778,6 @@ "xpack.fleet.settings.editOutputFlyout.defaultOutputSwitchLabel": "将此输出设为 {boldAgentIntegrations} 的默认值。", "xpack.fleet.settings.editOutputFlyout.logstashHostsInputDescription": "指定代理将用于连接到 Logstash 的地址。{guideLink}。", "xpack.fleet.settings.fleetServerHostSectionSubtitle": "指定代理用于连接 Fleet 服务器的 URL。如果存在多个 URL,Fleet 将显示提供的第一个 URL 用于注册。有关详细信息,请参阅 {guideLink}。", - "xpack.fleet.settings.fleetServerHostsFlyout.agentPolicyCount": "{agentPolicyCount, plural, other {# 个代理策略}}", - "xpack.fleet.settings.fleetServerHostsFlyout.agentsCount": "{agentCount, plural, other {# 个代理}}", - "xpack.fleet.settings.fleetServerHostsFlyout.confirmModalText": "此操作将更新 {policies} 和 {agents}。此操作无法撤消。是否确定要继续?", "xpack.fleet.settings.fleetServerHostsFlyout.description": "指定代理用于连接 Fleet 服务器的 URL。如果多个 URL 存在,Fleet 显示提供的第一个 URL 用于注册。Fleet 服务器默认使用端口 8220。请参阅 {link}。", "xpack.fleet.settings.logstashInstructions.addPipelineStepDescription": "在 Logstash 配置目录中,打开 {pipelineFile} 文件并添加以下配置。替换您文件的路径。", "xpack.fleet.settings.logstashInstructions.description": "将 Elastic 代理管道配置添加到 Logstash,以从 Elastic 代理框架接收事件。{documentationLink}。", @@ -13370,8 +13357,6 @@ "xpack.fleet.epm.pageSubtitle": "选择集成以开始收集并分析数据。", "xpack.fleet.epm.releaseBadge.betaDescription": "在生产环境中不推荐使用此集成。", "xpack.fleet.epm.releaseBadge.betaLabel": "公测版", - "xpack.fleet.epm.releaseBadge.experimentalDescription": "此功能处于技术预览状态,在未来版本中可能会更改或完全移除。Elastic 将尽最大努力来修复任何问题,但处于技术预览状态的功能不受正式 GA 功能支持 SLA 的约束。", - "xpack.fleet.epm.releaseBadge.experimentalLabel": "技术预览", "xpack.fleet.epm.screenshotErrorText": "无法加载此屏幕截图", "xpack.fleet.epm.screenshotsTitle": "屏幕截图", "xpack.fleet.epm.updateAvailableTooltip": "有可用更新", @@ -13408,8 +13393,6 @@ "xpack.fleet.fleetServerFlyout.getStartedTitle": "开始使用 Fleet 服务器", "xpack.fleet.fleetServerFlyout.installFleetServerTitle": "将 Fleet 服务器安装到集中式主机", "xpack.fleet.fleetServerFlyout.title": "添加 Fleet 服务器", - "xpack.fleet.fleetServerHost.requiredError": "Fleet 服务器主机必填。", - "xpack.fleet.fleetServerHost.requiresHttpsError": "Fleet 服务器主机必须以“https”开头", "xpack.fleet.fleetServerOnPremRequiredCallout.calloutTitle": "在使用 Fleet 注册代理之前,需要提供 Fleet 服务器。", "xpack.fleet.fleetServerOnPremRequiredCallout.guideLink": "Fleet 和 Elastic 代理指南", "xpack.fleet.fleetServerOnPremUnhealthyCallout.addFleetServerButtonLabel": "添加 Fleet 服务器", @@ -13417,7 +13400,6 @@ "xpack.fleet.fleetServerOnPremUnhealthyCallout.guideLink": "Fleet 和 Elastic 代理指南", "xpack.fleet.fleetServerSetup.addFleetServerHostButton": "添加主机", "xpack.fleet.fleetServerSetup.addFleetServerHostInputLabel": "Fleet 服务器主机", - "xpack.fleet.fleetServerSetup.addFleetServerHostInvalidUrlError": "URL 无效", "xpack.fleet.fleetServerSetup.addFleetServerHostStepTitle": "添加您的 Fleet 服务器主机", "xpack.fleet.fleetServerSetup.addFleetServerHostSuccessTitle": "已添加 Fleet 服务器主机", "xpack.fleet.fleetServerSetup.cloudDeploymentLink": "编辑部署", @@ -13618,7 +13600,6 @@ "xpack.fleet.settings.editOutputFlyout.typeInputPlaceholder": "指定类型", "xpack.fleet.settings.editOutputFlyout.yamlConfigInputLabel": "高级 YAML 配置", "xpack.fleet.settings.editOutputFlyout.yamlConfigInputPlaceholder": "此处的 # 个 YAML 设置将添加到每个代理策略的输出部分。", - "xpack.fleet.settings.fleetServerHostEditButtonLabel": "编辑主机", "xpack.fleet.settings.fleetServerHostsDifferentPathOrProtocolError": "对于每个 URL,协议和路径必须相同", "xpack.fleet.settings.fleetServerHostsDuplicateError": "复制 URL", "xpack.fleet.settings.fleetServerHostSectionTitle": "Fleet 服务器主机", @@ -13630,11 +13611,8 @@ "xpack.fleet.settings.fleetServerHostsFlyout.fleetServerHostsInputPlaceholder": "指定主机 URL", "xpack.fleet.settings.fleetServerHostsFlyout.saveButton": "保存并应用设置", "xpack.fleet.settings.fleetServerHostsFlyout.successToastTitle": "设置已保存", - "xpack.fleet.settings.fleetServerHostsFlyout.title": "Fleet 服务器主机", "xpack.fleet.settings.fleetServerHostsFlyout.userGuideLink": "Fleet 和 Elastic 代理指南", - "xpack.fleet.settings.fleetServerHostsPreconfiguredTooltipContent": "Fleet 服务器主机在 Fleet 以外进行配置。请参阅 Kibana 配置了解详情。", "xpack.fleet.settings.fleetServerHostsRequiredError": "主机 URL 必填", - "xpack.fleet.settings.fleetServerHostUrlColumnTitle": "主机 URL", "xpack.fleet.settings.fleetSettingsLink": "了解详情", "xpack.fleet.settings.fleetUserGuideLink": "Fleet 和 Elastic 代理指南", "xpack.fleet.settings.logstashInstructions.apiKeyStepDescription": "建议授权 Logstash 以 Elastic 代理的最低权限输出到 Elasticsearch。", @@ -15603,15 +15581,15 @@ "xpack.infra.homePage.noMetricsIndicesInstructionsActionLabel": "查看设置说明", "xpack.infra.homePage.settingsTabTitle": "设置", "xpack.infra.homePage.toolbar.kqlSearchFieldPlaceholder": "搜索基础设施数据……(例如 host.name:host-1)", + "xpack.infra.hostsTable.averageMemoryTotalColumnHeader": "内存合计 (平均值)", + "xpack.infra.hostsTable.averageMemoryUsageColumnHeader": "内存使用率(平均值)", + "xpack.infra.hostsTable.averageRxColumnHeader": "", + "xpack.infra.hostsTable.averageTxColumnHeader": "", + "xpack.infra.hostsTable.diskLatencyColumnHeader": "", "xpack.infra.hostsTable.nameColumnHeader": "名称", - "xpack.infra.hostsTable.operatingSystemColumnHeader": "操作系统", "xpack.infra.hostsTable.numberOfCpusColumnHeader": "# 个 CPU", - "xpack.infra.hostsTable.diskLatencyColumnHeader": "", - "xpack.infra.hostsTable.averageTxColumnHeader": "", - "xpack.infra.hostsTable.averageRxColumnHeader": "", - "xpack.infra.hostsTable.averageMemoryTotalColumnHeader": "内存合计 (平均值)", + "xpack.infra.hostsTable.operatingSystemColumnHeader": "操作系统", "xpack.infra.hostsTable.servicesOnHostColumnHeader": "", - "xpack.infra.hostsTable.averageMemoryUsageColumnHeader": "内存使用率(平均值)", "xpack.infra.infra.nodeDetails.apmTabLabel": "APM", "xpack.infra.infra.nodeDetails.createAlertLink": "创建库存规则", "xpack.infra.infra.nodeDetails.openAsPage": "以页面形式打开", @@ -17274,7 +17252,6 @@ "xpack.lens.indexPattern.timeShiftSmallWarning": "{label} 使用的时间偏移 {columnTimeShift} 小于 Date Histogram 时间间隔 {interval} 。要防止数据不匹配,请使用 {interval} 的倍数作为时间偏移。", "xpack.lens.indexPattern.uniqueLabel": "{label} [{num}]", "xpack.lens.indexPattern.valueCountOf": "{name} 的计数", - "xpack.lens.indexPatterns.fieldSearchLiveRegion": "{availableFields} 个可用{availableFields, plural, other {字段}}。{emptyFields} 个空{emptyFields, plural, other {字段}}。{metaFields} 个元{metaFields, plural,other {字段}}。", "xpack.lens.indexPatternSuggestion.removeLayerLabel": "仅显示 {indexPatternTitle}", "xpack.lens.indexPatternSuggestion.removeLayerPositionLabel": "仅显示图层 {layerNumber}", "xpack.lens.modalTitle.title.clear": "清除 {layerType} 图层?", @@ -17478,7 +17455,7 @@ "xpack.lens.embeddable.missingTimeRangeParam.longMessage": "给定配置需要包含 timeRange 属性", "xpack.lens.embeddable.missingTimeRangeParam.shortMessage": "缺少 timeRange 属性", "xpack.lens.embeddable.moreErrors": "在 Lens 编辑器中编辑以查看更多错误", - "xpack.lens.embeddableDisplayName": "lens", + "xpack.lens.embeddableDisplayName": "Lens", "xpack.lens.endValue.nearest": "最近", "xpack.lens.endValue.none": "隐藏", "xpack.lens.endValue.zero": "零", @@ -17584,7 +17561,6 @@ "xpack.lens.heatmapVisualization.missingXAccessorLongMessage": "水平轴配置缺失。", "xpack.lens.heatmapVisualization.missingXAccessorShortMessage": "缺失水平轴。", "xpack.lens.indexPattern.advancedSettings": "高级", - "xpack.lens.indexPattern.allFieldsLabel": "所有字段", "xpack.lens.indexPattern.allFieldsLabelHelp": "将可用字段拖放到工作区并创建可视化。要更改可用字段,请选择不同数据视图,编辑您的查询或使用不同时间范围。一些字段类型无法在 Lens 中可视化,包括全文本字段和地理字段。", "xpack.lens.indexPattern.allFieldsSamplingLabelHelp": "可用字段包含与您的筛选匹配的前 500 个文档中的数据。要查看所有字段,请展开空字段。无法使用全文本、地理、扁平和对象字段创建可视化。", "xpack.lens.indexPattern.ascendingCountPrecisionErrorWarning.link": "访问文档", @@ -17631,12 +17607,7 @@ "xpack.lens.indexPattern.differences.signature": "指标:数字", "xpack.lens.indexPattern.emptyDimensionButton": "空维度", "xpack.lens.indexPattern.emptyFieldsLabel": "空字段", - "xpack.lens.indexPattern.emptyFieldsLabelHelp": "空字段在基于您的筛选的前 500 个文档中不包含任何值。", "xpack.lens.indexPattern.enableAccuracyMode": "启用准确性模式", - "xpack.lens.indexPattern.existenceErrorAriaLabel": "现有内容提取失败", - "xpack.lens.indexPattern.existenceErrorLabel": "无法加载字段信息", - "xpack.lens.indexPattern.existenceTimeoutAriaLabel": "现有内容提取超时", - "xpack.lens.indexPattern.existenceTimeoutLabel": "字段信息花费时间过久", "xpack.lens.indexPattern.fieldItemTooltip": "拖放以可视化。", "xpack.lens.indexPattern.fieldPlaceholder": "字段", "xpack.lens.indexPattern.fieldStatsButtonEmptyLabel": "此字段不包含任何数据,但您仍然可以拖放以进行可视化。", @@ -17814,16 +17785,6 @@ "xpack.lens.indexPattern.useAsTopLevelAgg": "先按此字段分组", "xpack.lens.indexPatterns.clearFiltersLabel": "清除名称和类型筛选", "xpack.lens.indexPatterns.filterByNameLabel": "搜索字段名称", - "xpack.lens.indexPatterns.noAvailableDataLabel": "没有包含数据的可用字段。", - "xpack.lens.indexPatterns.noDataLabel": "无字段。", - "xpack.lens.indexPatterns.noEmptyDataLabel": "无空字段。", - "xpack.lens.indexPatterns.noFields.extendTimeBullet": "延伸时间范围", - "xpack.lens.indexPatterns.noFields.fieldTypeFilterBullet": "使用不同的字段筛选", - "xpack.lens.indexPatterns.noFields.globalFiltersBullet": "更改全局筛选", - "xpack.lens.indexPatterns.noFields.tryText": "尝试:", - "xpack.lens.indexPatterns.noFieldsLabel": "在此数据视图中不存在任何字段。", - "xpack.lens.indexPatterns.noFilteredFieldsLabel": "没有字段匹配选定筛选。", - "xpack.lens.indexPatterns.noMetaDataLabel": "无元字段。", "xpack.lens.label.gauge.labelMajor.header": "标题", "xpack.lens.label.gauge.labelMinor.header": "子标题", "xpack.lens.label.header": "标签", @@ -21629,8 +21590,6 @@ "xpack.ml.trainedModels.modelsList.pipelines.processorStats.typeHeader": "处理器类型", "xpack.ml.trainedModels.modelsList.selectableMessage": "选择模型", "xpack.ml.trainedModels.modelsList.startDeployment.cancelButton": "取消", - "xpack.ml.trainedModels.modelsList.startDeployment.cloudWarningHeader": "将来,云部署会自动扩展以提供所需数量的处理器。", - "xpack.ml.trainedModels.modelsList.startDeployment.cloudWarningText": "但是,在本版本中,您必须在云控制台中手动增加 ML 节点的大小,以获得更多处理器。", "xpack.ml.trainedModels.modelsList.startDeployment.docLinkTitle": "了解详情", "xpack.ml.trainedModels.modelsList.startDeployment.maxNumOfProcessorsWarning": "产品的分配次数和每次分配的线程数应小于 ML 节点上处理器的总数。", "xpack.ml.trainedModels.modelsList.startDeployment.numbersOfAllocationsHelp": "增加以提高所有请求的吞吐量。", @@ -23341,7 +23300,6 @@ "xpack.observability.alerts.ruleStats.loadError": "无法加载规则统计信息", "xpack.observability.alerts.ruleStats.muted": "已暂停", "xpack.observability.alerts.ruleStats.ruleCount": "规则计数", - "xpack.observability.alerts.searchBarPlaceholder": "搜索告警(例如 kibana.alert.evaluation.threshold > 75)", "xpack.observability.alerts.workflowStatusFilter.acknowledgedButtonLabel": "已确认", "xpack.observability.alerts.workflowStatusFilter.closedButtonLabel": "已关闭", "xpack.observability.alerts.workflowStatusFilter.openButtonLabel": "打开", @@ -23415,7 +23373,6 @@ "xpack.observability.enableInspectEsQueriesExperimentName": "检查 ES 查询", "xpack.observability.enableNewSyntheticsViewExperimentDescription": "在 Observability 中启用新的组合监测应用程序。刷新页面可应用该设置。", "xpack.observability.enableNewSyntheticsViewExperimentName": "启用新的组合监测应用程序", - "xpack.observability.enableServiceGroups": "服务组功能", "xpack.observability.exp.breakDownFilter.noBreakdown": "无细目", "xpack.observability.exp.breakDownFilter.unavailable": "步骤名称细目不可用于监测持续时间指标。使用步骤持续时间指标以按步骤名称细分。", "xpack.observability.exp.breakDownFilter.warning": "一次只能将细目应用于一个序列。", @@ -28246,21 +28203,7 @@ "xpack.securitySolution.getCurrentUser.unknownUser": "未知", "xpack.securitySolution.globalHeader.buttonAddData": "添加集成", "xpack.securitySolution.goToDocumentationButton": "查看文档", - "xpack.securitySolution.guided_onboarding.endTour.buttonLabel": "结束教程", "xpack.securitySolution.guided_onboarding.nextStep.buttonLabel": "下一步", - "xpack.securitySolution.guided_onboarding.skipTour.buttonLabel": "跳过教程", - "xpack.securitySolution.guided_onboarding.tour.alertsStep.imageAltText": "告警演示", - "xpack.securitySolution.guided_onboarding.tour.alertsStep.tourContent": "知道何时满足规则条件,以便您立即开始调查。通过 Slack、PagerDuty 和 ServiceNow 等第三方平台设置通知。", - "xpack.securitySolution.guided_onboarding.tour.alertsStep.tourTitle": "发生更改时接收通知", - "xpack.securitySolution.guided_onboarding.tour.casesStep.imageAltText": "案例演示", - "xpack.securitySolution.guided_onboarding.tour.casesStep.tourContent": "收集证据,添加更多协作者,甚至将案例详情推送到第三方案例管理系统。", - "xpack.securitySolution.guided_onboarding.tour.casesStep.tourTitle": "创建案例以跟踪您的调查", - "xpack.securitySolution.guided_onboarding.tour.dataStep.tourContent": "使用 Elastic 代理和一系列第三方集成从您的终端收集数据。", - "xpack.securitySolution.guided_onboarding.tour.dataStep.tourTitle": "开始收集您的数据!", - "xpack.securitySolution.guided_onboarding.tour.manageStep.tourContent": "确定对您和您的环境至关重要的事项,并创建规则来检测并防止恶意活动。", - "xpack.securitySolution.guided_onboarding.tour.manageStep.tourTitle": "保护您的生态系统", - "xpack.securitySolution.guided_onboarding.tour.overviewStep.tourContent": "学习快速教程以浏览调查可疑活动的统一工作流。", - "xpack.securitySolution.guided_onboarding.tour.overviewStep.tourTitle": "欢迎使用 Elastic Security", "xpack.securitySolution.handleInputAreaState.inputPlaceholderText": "提交响应操作", "xpack.securitySolution.header.editableTitle.cancel": "取消", "xpack.securitySolution.header.editableTitle.save": "保存", @@ -31200,7 +31143,6 @@ "xpack.synthetics.monitorManagement.monitorSync.failure.reasonLabel": "原因", "xpack.synthetics.monitorManagement.monitorSync.failure.statusLabel": "状态", "xpack.synthetics.monitorManagement.monitorSync.failure.title": "监测无法与 Synthetics 服务同步", - "xpack.synthetics.monitorManagement.myFirstMonitor": "我的第一个监测", "xpack.synthetics.monitorManagement.nameRequired": "“位置名称”必填", "xpack.synthetics.monitorManagement.needFleetReadAgentPoliciesPermission": "您无权访问 Fleet。需要 Fleet 权限才能创建新的专用位置。", "xpack.synthetics.monitorManagement.needPermissions": "需要权限", @@ -31282,7 +31224,6 @@ "xpack.synthetics.overview.heading": "监测", "xpack.synthetics.overview.monitors.label": "监测", "xpack.synthetics.overview.pageHeader.title": "概览", - "xpack.synthetics.overview.pagination.ariaLabel": "监测概述的分页", "xpack.synthetics.overviewPage.overviewCrumb": "概览", "xpack.synthetics.overviewPageLink.disabled.ariaLabel": "禁用的分页按钮表示在监测列表中无法进行进一步导航。", "xpack.synthetics.overviewPageLink.next.ariaLabel": "下页结果", diff --git a/x-pack/plugins/translations/tsconfig.json b/x-pack/plugins/translations/tsconfig.json index 6b09de638f3f9..4397d0f0b146e 100644 --- a/x-pack/plugins/translations/tsconfig.json +++ b/x-pack/plugins/translations/tsconfig.json @@ -4,8 +4,7 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": ["server/**/*", "translations/ja-JP.json", "translations/zh-CN.json"], - "references": [{ "path": "../../../src/core/tsconfig.json" }] + "kbn_references": [{ "path": "../../../src/core/tsconfig.json" }] } diff --git a/x-pack/plugins/triggers_actions_ui/README.md b/x-pack/plugins/triggers_actions_ui/README.md index 0643a7d266a88..225fc6ff978e5 100644 --- a/x-pack/plugins/triggers_actions_ui/README.md +++ b/x-pack/plugins/triggers_actions_ui/README.md @@ -83,7 +83,7 @@ ruleParamsExpression should be a lazy loaded React component extending an expres ``` interface IndexThresholdProps { - ruleParams: IndexThresholdAlertParams; + ruleParams: IndexThresholdRuleParams; setRuleParams: (property: string, value: any) => void; setRuleProperty: (key: string, value: any) => void; errors: { [key: string]: string[] }; @@ -175,7 +175,7 @@ export const alertReducer = (state: any, action: AlertReducerAction) => { The Expression component should be lazy loaded which means it'll have to be the default export in `index_threshold_expression.ts`: ``` -export const IndexThresholdAlertTypeExpression: React.FunctionComponent<IndexThresholdProps> = ({ +export const IndexThresholdRuleTypeExpression: React.FunctionComponent<IndexThresholdProps> = ({ ruleParams, setRuleParams, setRuleProperty, @@ -227,7 +227,7 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent<IndexThr }; // Export as default in order to support lazy loading -export {IndexThresholdAlertTypeExpression as default}; +export {IndexThresholdRuleTypeExpression as default}; ``` Index Threshold Alert form with validation: diff --git a/x-pack/plugins/triggers_actions_ui/public/application/constants/index.ts b/x-pack/plugins/triggers_actions_ui/public/application/constants/index.ts index 19d3b038c6350..a8b15215632c1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/constants/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/constants/index.ts @@ -44,6 +44,7 @@ export const DEFAULT_RULE_INTERVAL = '1m'; export const RULE_EXECUTION_LOG_COLUMN_IDS = [ 'rule_id', 'rule_name', + 'space_ids', 'id', 'timestamp', 'execution_duration', diff --git a/x-pack/plugins/observability/public/hooks/use_alert_data_view.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_alert_data_view.test.ts similarity index 78% rename from x-pack/plugins/observability/public/hooks/use_alert_data_view.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/hooks/use_alert_data_view.test.ts index 77db2492d4227..05696e19c618a 100644 --- a/x-pack/plugins/observability/public/hooks/use_alert_data_view.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_alert_data_view.test.ts @@ -6,35 +6,41 @@ */ import { DataView } from '@kbn/data-views-plugin/common'; +import { AlertConsumers } from '@kbn/rule-data-utils'; +import { createStartServicesMock } from '../../common/lib/kibana/kibana_react.mock'; import type { ValidFeatureId } from '@kbn/rule-data-utils'; import { act, renderHook } from '@testing-library/react-hooks'; import { AsyncState } from 'react-use/lib/useAsync'; -import { kibanaStartMock } from '../utils/kibana_react.mock'; -import { observabilityAlertFeatureIds } from '../config'; import { useAlertDataView } from './use_alert_data_view'; -const mockUseKibanaReturnValue = kibanaStartMock.startContract(); +const mockUseKibanaReturnValue = createStartServicesMock(); jest.mock('@kbn/kibana-react-plugin/public', () => ({ __esModule: true, - useKibana: jest.fn(() => mockUseKibanaReturnValue), + useKibana: jest.fn(() => ({ + services: mockUseKibanaReturnValue, + })), })); describe('useAlertDataView', () => { const mockedDataView = 'dataView'; + const observabilityAlertFeatureIds: ValidFeatureId[] = [ + AlertConsumers.APM, + AlertConsumers.INFRASTRUCTURE, + AlertConsumers.LOGS, + AlertConsumers.UPTIME, + ]; beforeEach(() => { - mockUseKibanaReturnValue.services.http.get.mockImplementation(async () => ({ + mockUseKibanaReturnValue.http.get = jest.fn().mockReturnValue({ index_name: [ '.alerts-observability.uptime.alerts-*', '.alerts-observability.metrics.alerts-*', '.alerts-observability.logs.alerts-*', '.alerts-observability.apm.alerts-*', ], - })); - mockUseKibanaReturnValue.services.data.dataViews.create.mockImplementation( - async () => mockedDataView - ); + }); + mockUseKibanaReturnValue.data.dataViews.create = jest.fn().mockReturnValue(mockedDataView); }); afterEach(() => { @@ -77,7 +83,7 @@ describe('useAlertDataView', () => { it('returns error with no data when error happens', async () => { const error = new Error('http error'); - mockUseKibanaReturnValue.services.http.get.mockImplementation(async () => { + mockUseKibanaReturnValue.http.get = jest.fn().mockImplementation(async () => { throw error; }); diff --git a/x-pack/plugins/observability/public/hooks/use_alert_data_view.ts b/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_alert_data_view.ts similarity index 87% rename from x-pack/plugins/observability/public/hooks/use_alert_data_view.ts rename to x-pack/plugins/triggers_actions_ui/public/application/hooks/use_alert_data_view.ts index aad2a8e030eba..9da62ed75243d 100644 --- a/x-pack/plugins/observability/public/hooks/use_alert_data_view.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_alert_data_view.ts @@ -11,11 +11,10 @@ import { BASE_RAC_ALERTS_API_PATH } from '@kbn/rule-registry-plugin/common'; import type { ValidFeatureId } from '@kbn/rule-data-utils'; import useAsync from 'react-use/lib/useAsync'; import type { AsyncState } from 'react-use/lib/useAsync'; - -import { ObservabilityAppServices } from '../application/types'; +import { TriggersAndActionsUiServices } from '../..'; export function useAlertDataView(featureIds: ValidFeatureId[]): AsyncState<DataView> { - const { http, data: dataService } = useKibana<ObservabilityAppServices>().services; + const { http, data: dataService } = useKibana<TriggersAndActionsUiServices>().services; const features = featureIds.sort().join(','); const dataView = useAsync(async () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.test.ts index 56de4f5c4c890..de273fbf394e5 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.test.ts @@ -118,9 +118,11 @@ describe('loadActionErrorLog', () => { "date_end": "2022-03-23T16:17:53.482Z", "date_start": "2022-03-23T16:17:53.482Z", "filter": "(message: \\"test\\" OR error.message: \\"test\\") and kibana.alert.rule.execution.uuid: 123", + "namespace": undefined, "page": 1, "per_page": 10, "sort": "[{\\"@timestamp\\":{\\"order\\":\\"asc\\"}}]", + "with_auth": false, }, }, ] diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.ts index 10f2879085cd0..7bfef44335a4c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.ts @@ -28,6 +28,8 @@ export interface LoadActionErrorLogProps { perPage?: number; page?: number; sort?: SortField[]; + namespace?: string; + withAuth?: boolean; } const SORT_MAP: Record<string, string> = { @@ -60,6 +62,8 @@ export const loadActionErrorLog = ({ perPage = 10, page = 0, sort, + namespace, + withAuth = false, }: LoadActionErrorLogProps & { http: HttpSetup }) => { const renamedSort = getRenamedSort(sort); const filter = getFilter({ runId, message }); @@ -76,6 +80,8 @@ export const loadActionErrorLog = ({ // whereas data grid sorts are 0 indexed. page: page + 1, sort: renamedSort.length ? JSON.stringify(renamedSort) : undefined, + namespace, + with_auth: withAuth, }, } ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts index bf5e529499b42..671a1edce467d 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts @@ -59,7 +59,10 @@ export interface LoadExecutionLogAggregationsProps { sort?: SortField[]; } -export type LoadGlobalExecutionLogAggregationsProps = Omit<LoadExecutionLogAggregationsProps, 'id'>; +export type LoadGlobalExecutionLogAggregationsProps = Omit< + LoadExecutionLogAggregationsProps, + 'id' +> & { namespaces?: Array<string | undefined> }; export const loadExecutionLogAggregations = async ({ id, @@ -103,6 +106,7 @@ export const loadGlobalExecutionLogAggregations = async ({ perPage = 10, page = 0, sort = [], + namespaces, }: LoadGlobalExecutionLogAggregationsProps & { http: HttpSetup }) => { const sortField: any[] = sort; const filter = getFilter({ outcomeFilter, message }); @@ -119,6 +123,7 @@ export const loadGlobalExecutionLogAggregations = async ({ // whereas data grid sorts are 0 indexed. page: page + 1, sort: sortField.length ? JSON.stringify(sortField) : undefined, + namespaces: namespaces ? JSON.stringify(namespaces) : undefined, }, } ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_global_execution_kpi_aggregations.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_global_execution_kpi_aggregations.ts index 332e14ad4383f..7052257d1fc87 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_global_execution_kpi_aggregations.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_global_execution_kpi_aggregations.ts @@ -16,6 +16,7 @@ export interface LoadGlobalExecutionKPIAggregationsProps { message?: string; dateStart: string; dateEnd?: string; + namespaces?: Array<string | undefined>; } export const loadGlobalExecutionKPIAggregations = ({ @@ -25,6 +26,7 @@ export const loadGlobalExecutionKPIAggregations = ({ message, dateStart, dateEnd, + namespaces, }: LoadGlobalExecutionKPIAggregationsProps & { http: HttpSetup }) => { const filter = getFilter({ outcomeFilter, message }); @@ -33,6 +35,7 @@ export const loadGlobalExecutionKPIAggregations = ({ filter: filter.length ? filter.join(' and ') : undefined, date_start: dateStart, date_end: dateEnd, + namespaces: namespaces ? JSON.stringify(namespaces) : namespaces, }, }); }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx index 0112f2296ee05..f937663cd27a3 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx @@ -181,7 +181,7 @@ describe('action_type_form', () => { // Verify that the tooltip renders // Use fake timers so we don't have to wait for the EuiToolTip timeout - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); wrapper.find('[data-test-subj="action-group-error-icon"]').first().simulate('mouseOver'); // Run the timers so the EuiTooltip will be visible jest.runAllTimers(); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/alerts_search_bar.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/alerts_search_bar.tsx new file mode 100644 index 0000000000000..193d6abf1433b --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/alerts_search_bar.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, { useCallback, useState } from 'react'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { NO_INDEX_PATTERNS } from './constants'; +import { SEARCH_BAR_PLACEHOLDER } from './translations'; +import { AlertsSearchBarProps, QueryLanguageType } from './types'; +import { useAlertDataView } from '../../hooks/use_alert_data_view'; +import { TriggersAndActionsUiServices } from '../../..'; + +// TODO Share buildEsQuery to be used between AlertsSearchBar and AlertsStateTable component https://github.com/elastic/kibana/issues/144615 +export function AlertsSearchBar({ + appName, + featureIds, + query, + onQueryChange, + rangeFrom, + rangeTo, +}: AlertsSearchBarProps) { + const { + unifiedSearch: { + ui: { SearchBar }, + }, + } = useKibana<TriggersAndActionsUiServices>().services; + + const [queryLanguage, setQueryLanguage] = useState<QueryLanguageType>('kuery'); + const { value: dataView, loading, error } = useAlertDataView(featureIds); + + const onQuerySubmit = useCallback( + (payload) => { + const { dateRange, query: nextQuery } = payload; + onQueryChange({ + dateRange, + query: typeof nextQuery?.query === 'string' ? nextQuery.query : '', + }); + setQueryLanguage((nextQuery?.language ?? 'kuery') as QueryLanguageType); + }, + [onQueryChange, setQueryLanguage] + ); + + return ( + <SearchBar + appName={appName} + indexPatterns={loading || error ? NO_INDEX_PATTERNS : [dataView!]} + placeholder={SEARCH_BAR_PLACEHOLDER} + query={{ query: query ?? '', language: queryLanguage }} + dateRangeFrom={rangeFrom} + dateRangeTo={rangeTo} + displayStyle="inPage" + showFilterBar={false} + onQuerySubmit={onQuerySubmit} + /> + ); +} + +// eslint-disable-next-line import/no-default-export +export { AlertsSearchBar as default }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/constants.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/constants.ts new file mode 100644 index 0000000000000..e1eca7239cc9d --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/constants.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { DataView } from '@kbn/data-views-plugin/common'; + +export const NO_INDEX_PATTERNS: DataView[] = []; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/index.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/index.ts new file mode 100644 index 0000000000000..bfc3f022c37cf --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/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 { AlertsSearchBar } from './alerts_search_bar'; + +export type { AlertsSearchBarProps } from './types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/translations.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/translations.ts new file mode 100644 index 0000000000000..a5f4fc4b5754e --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/translations.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const SEARCH_BAR_PLACEHOLDER = i18n.translate( + 'xpack.triggersActionsUI.alertsSearchBar.placeholder', + { + defaultMessage: 'Search alerts (e.g. kibana.alert.evaluation.threshold > 75)', + } +); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/types.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/types.ts new file mode 100644 index 0000000000000..86e3e60ef059e --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_search_bar/types.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 { ValidFeatureId } from '@kbn/rule-data-utils'; + +export type QueryLanguageType = 'lucene' | 'kuery'; + +export interface AlertsSearchBarProps { + appName: string; + featureIds: ValidFeatureId[]; + rangeFrom?: string; + rangeTo?: string; + query?: string; + onQueryChange: ({}: { + dateRange: { from: string; to: string; mode?: 'absolute' | 'relative' }; + query?: string; + }) => void; +} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.test.tsx index fbe2b25437d88..107f92434704f 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.test.tsx @@ -363,32 +363,4 @@ describe('AlertsTableState', () => { expect(result.getByTestId('alertsStateTableEmptyState')).toBeTruthy(); }); }); - - describe('refresh alerts', () => { - beforeEach(() => { - refecthMock.mockClear(); - hookUseFetchAlerts.mockClear(); - hookUseFetchAlerts.mockImplementation(() => [ - false, - { - alerts: [], - isInitializing: false, - getInspectQuery: jest.fn(), - refetch: refecthMock, - totalAlerts: 0, - }, - ]); - }); - - it('should NOT refetch the alert at initialization', async () => { - render(<AlertsTableWithLocale {...tableProps} />); - expect(refecthMock).toBeCalledTimes(0); - }); - it('should refetch the alert when refreshNow is updated', async () => { - const result = render(<AlertsTableWithLocale {...tableProps} />); - const props = { ...tableProps, refreshNow: 123456789 }; - result.rerender(<AlertsTableWithLocale {...props} />); - expect(refecthMock).toBeCalledTimes(1); - }); - }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.tsx index b99568cfb6bce..f75aee03afcf0 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.tsx @@ -4,7 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useState, useCallback, useRef, useMemo, useReducer, useEffect } from 'react'; + +import React, { useState, useCallback, useRef, useMemo, useReducer } from 'react'; import { isEmpty } from 'lodash'; import { EuiDataGridColumn, @@ -56,7 +57,6 @@ export interface AlertsTableStateProps { flyoutSize?: EuiFlyoutSize; query: Pick<QueryDslQueryContainer, 'bool' | 'ids'>; pageSize?: number; - refreshNow?: number; showExpandToDetails: boolean; } @@ -104,7 +104,6 @@ const AlertsTableState = ({ flyoutSize, query, pageSize, - refreshNow, showExpandToDetails, }: AlertsTableStateProps) => { const { cases } = useKibana<{ cases: CaseUi }>().services; @@ -287,13 +286,6 @@ const AlertsTableState = ({ const CasesContext = cases?.ui.getCasesContext(); const userCasesPermissions = useGetUserCasesPermissions(alertsTableConfiguration.casesFeatureId); - useEffect(() => { - if (!isLoading && refreshNow) { - refresh(); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [refreshNow]); - return hasAlertsTableConfiguration ? ( <> {!isLoading && alertsCount === 0 && <EmptyState />} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/field_browser/components/field_name/field_name.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/field_browser/components/field_name/field_name.test.tsx index 8a0b52b082ea9..1fafae26032c0 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/field_browser/components/field_name/field_name.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/field_browser/components/field_name/field_name.test.tsx @@ -18,7 +18,7 @@ const defaultProps = { describe('FieldName', () => { beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); test('it renders the field name', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/logs_list/components/logs_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/logs_list/components/logs_list.tsx index 79e617ee05a49..404457af8fd01 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/logs_list/components/logs_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/logs_list/components/logs_list.tsx @@ -20,6 +20,7 @@ export const LogsList = () => { refreshToken: 0, initialPageSize: 50, hasRuleNames: true, + hasAllSpaceSwitch: true, localStorageKey: GLOBAL_EVENT_LOG_LIST_STORAGE_KEY, }); }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_action_error_log_flyout.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_action_error_log_flyout.tsx index 8c46e3574560c..aa914e2818c03 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_action_error_log_flyout.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_action_error_log_flyout.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React from 'react'; +import React, { useMemo } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, @@ -28,17 +28,29 @@ export interface RuleActionErrorLogFlyoutProps { runLog: IExecutionLog; refreshToken?: number; onClose: () => void; + activeSpaceId?: string; } export const RuleActionErrorLogFlyout = (props: RuleActionErrorLogFlyoutProps) => { - const { runLog, refreshToken, onClose } = props; + const { runLog, refreshToken, onClose, activeSpaceId } = props; const { euiTheme } = useEuiTheme(); - const { id, rule_id: ruleId, message, num_errored_actions: totalErrors } = runLog; + const { + id, + rule_id: ruleId, + message, + num_errored_actions: totalErrors, + space_ids: spaceIds = [], + } = runLog; const isFlyoutPush = useIsWithinBreakpoints(['xl']); + const logFromDifferentSpace = useMemo( + () => Boolean(activeSpaceId && !spaceIds?.includes(activeSpaceId)), + [activeSpaceId, spaceIds] + ); + return ( <EuiFlyout type={isFlyoutPush ? 'push' : 'overlay'} @@ -82,7 +94,13 @@ export const RuleActionErrorLogFlyout = (props: RuleActionErrorLogFlyoutProps) = }} /> </div> - <RuleErrorLogWithApi ruleId={ruleId} runId={id} refreshToken={refreshToken} /> + <RuleErrorLogWithApi + ruleId={ruleId} + runId={id} + spaceId={spaceIds[0]} + logFromDifferentSpace={logFromDifferentSpace} + refreshToken={refreshToken} + /> <EuiSpacer /> </EuiFlyoutBody> <EuiFlyoutFooter> diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx index 7c14b17f8d12b..e07dd0ce5f6ed 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx @@ -63,11 +63,13 @@ export type RuleErrorLogProps = { ruleId: string; runId?: string; refreshToken?: number; + spaceId?: string; + logFromDifferentSpace?: boolean; requestRefresh?: () => Promise<void>; } & Pick<RuleApis, 'loadActionErrorLog'>; export const RuleErrorLog = (props: RuleErrorLogProps) => { - const { ruleId, runId, loadActionErrorLog, refreshToken } = props; + const { ruleId, runId, loadActionErrorLog, refreshToken, spaceId, logFromDifferentSpace } = props; const { uiSettings, notifications } = useKibana().services; @@ -138,6 +140,8 @@ export const RuleErrorLog = (props: RuleErrorLogProps) => { page: pagination.pageIndex, perPage: pagination.pageSize, sort: formattedSort, + namespace: spaceId, + withAuth: logFromDifferentSpace, }); setLogs(result.errors); setPagination({ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_data_grid.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_data_grid.tsx index 0f6dcc13b1667..20f3612f3a41b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_data_grid.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_data_grid.tsx @@ -60,6 +60,7 @@ export interface RuleEventLogDataGrid { pageSizeOptions?: number[]; selectedRunLog?: IExecutionLog; showRuleNameAndIdColumns?: boolean; + showSpaceColumns?: boolean; onChangeItemsPerPage: (pageSize: number) => void; onChangePage: (pageIndex: number) => void; onFilterChange: (filter: string[]) => void; @@ -162,6 +163,7 @@ export const RuleEventLogDataGrid = (props: RuleEventLogDataGrid) => { visibleColumns, selectedRunLog, showRuleNameAndIdColumns = false, + showSpaceColumns = false, setVisibleColumns, setSortingColumns, onChangeItemsPerPage, @@ -215,6 +217,25 @@ export const RuleEventLogDataGrid = (props: RuleEventLogDataGrid) => { }, ] : []), + ...(showSpaceColumns + ? [ + { + id: 'space_ids', + displayAsText: i18n.translate( + 'xpack.triggersActionsUI.sections.ruleDetails.eventLogColumn.spaceIds', + { + defaultMessage: 'Space', + } + ), + isSortable: getIsColumnSortable('space_ids'), + actions: { + showSortAsc: false, + showSortDesc: false, + showHide: false, + }, + }, + ] + : []), { id: 'id', displayAsText: i18n.translate( @@ -429,16 +450,22 @@ export const RuleEventLogDataGrid = (props: RuleEventLogDataGrid) => { isSortable: getIsColumnSortable('timed_out'), }, ], - [getPaginatedRowIndex, onFlyoutOpen, onFilterChange, showRuleNameAndIdColumns, logs] + [ + getPaginatedRowIndex, + onFlyoutOpen, + onFilterChange, + showRuleNameAndIdColumns, + showSpaceColumns, + logs, + ] ); - const columnVisibilityProps = useMemo( - () => ({ + const columnVisibilityProps = useMemo(() => { + return { visibleColumns, setVisibleColumns, - }), - [visibleColumns, setVisibleColumns] - ); + }; + }, [visibleColumns, setVisibleColumns]); const sortingProps = useMemo( () => ({ @@ -560,6 +587,7 @@ export const RuleEventLogDataGrid = (props: RuleEventLogDataGrid) => { const actionErrors = logs[pagedRowIndex]?.num_errored_actions || (0 as number); const version = logs?.[pagedRowIndex]?.version; const ruleId = runLog?.rule_id; + const spaceIds = runLog?.space_ids; if (columnId === 'num_errored_actions' && runLog) { return ( @@ -592,6 +620,7 @@ export const RuleEventLogDataGrid = (props: RuleEventLogDataGrid) => { version={version} dateFormat={dateFormat} ruleId={ruleId} + spaceIds={spaceIds} /> </EuiFlexItem> </EuiFlexGroup> diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.test.tsx index de9cd783c1ff6..08362962890e5 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import moment from 'moment'; -import { EuiIcon } from '@elastic/eui'; +import { EuiIcon, EuiLink } from '@elastic/eui'; import { shallow, mount } from 'enzyme'; import { RuleEventLogListCellRenderer, @@ -16,7 +16,53 @@ import { import { RuleEventLogListStatus } from './rule_event_log_list_status'; import { RuleDurationFormat } from '../../rules_list/components/rule_duration_format'; +jest.mock('react-router-dom', () => ({ + useHistory: () => ({ + location: { + pathname: '/logs', + }, + }), +})); + +jest.mock('../../../../common/lib/kibana', () => ({ + useSpacesData: () => ({ + spacesMap: new Map([ + ['space1', { id: 'space1' }], + ['space2', { id: 'space2' }], + ]), + activeSpaceId: 'space1', + }), + useKibana: () => ({ + services: { + http: { + basePath: { + get: () => '/basePath', + }, + }, + }, + }), +})); + describe('rule_event_log_list_cell_renderer', () => { + const savedLocation = window.location; + beforeAll(() => { + // @ts-ignore Mocking window.location + delete window.location; + // @ts-ignore + window.location = Object.assign( + new URL('https://localhost/app/management/insightsAndAlerting/triggersActions/logs'), + { + ancestorOrigins: '', + assign: jest.fn(), + reload: jest.fn(), + replace: jest.fn(), + } + ); + }); + afterAll(() => { + window.location = savedLocation; + }); + it('renders primitive values correctly', () => { const wrapper = mount(<RuleEventLogListCellRenderer columnId="message" value="test" />); @@ -67,4 +113,31 @@ describe('rule_event_log_list_cell_renderer', () => { expect(wrapper.find(RuleEventLogListStatus).text()).toEqual('newOutcome'); expect(wrapper.find(EuiIcon).props().color).toEqual('gray'); }); + + it('links to rules on the correct space', () => { + const wrapper1 = shallow( + <RuleEventLogListCellRenderer + columnId="rule_name" + value="Rule" + ruleId="1" + spaceIds={['space1']} + /> + ); + // @ts-ignore data-href is not a native EuiLink prop + expect(wrapper1.find(EuiLink).props()['data-href']).toEqual('/rule/1'); + const wrapper2 = shallow( + <RuleEventLogListCellRenderer + columnId="rule_name" + value="Rule" + ruleId="1" + spaceIds={['space2']} + /> + ); + // @ts-ignore data-href is not a native EuiLink prop + expect(wrapper2.find(EuiLink).props()['data-href']).toEqual( + '/basePath/s/space2/app/management/insightsAndAlerting/triggersActions/rule/1' + ); + + window.location = savedLocation; + }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.tsx index 0f6e0477642b3..bcca56ad0027e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.tsx @@ -5,13 +5,14 @@ * 2.0. */ -import React, { useCallback } from 'react'; +import React, { useCallback, useMemo } from 'react'; import moment from 'moment'; import { EuiLink } from '@elastic/eui'; import { RuleAlertingOutcome } from '@kbn/alerting-plugin/common'; import { useHistory } from 'react-router-dom'; import { routeToRuleDetails } from '../../../constants'; import { formatRuleAlertCount } from '../../../../common/lib/format_rule_alert_count'; +import { useKibana, useSpacesData } from '../../../../common/lib/kibana'; import { RuleEventLogListStatus } from './rule_event_log_list_status'; import { RuleDurationFormat } from '../../rules_list/components/rule_duration_format'; import { @@ -27,20 +28,58 @@ export type ColumnId = typeof RULE_EXECUTION_LOG_COLUMN_IDS[number]; interface RuleEventLogListCellRendererProps { columnId: ColumnId; version?: string; - value?: string; + value?: string | string[]; dateFormat?: string; ruleId?: string; + spaceIds?: string[]; } export const RuleEventLogListCellRenderer = (props: RuleEventLogListCellRendererProps) => { - const { columnId, value, version, dateFormat = DEFAULT_DATE_FORMAT, ruleId } = props; + const { columnId, value, version, dateFormat = DEFAULT_DATE_FORMAT, ruleId, spaceIds } = props; + const spacesData = useSpacesData(); + const { http } = useKibana().services; + const history = useHistory(); - const onClickRuleName = useCallback( - () => ruleId && history.push(routeToRuleDetails.replace(':ruleId', ruleId)), - [ruleId, history] + const activeSpace = useMemo( + () => spacesData?.spacesMap.get(spacesData?.activeSpaceId), + [spacesData] + ); + + const ruleOnDifferentSpace = useMemo( + () => activeSpace && !spaceIds?.includes(activeSpace.id), + [activeSpace, spaceIds] ); + const ruleNamePathname = useMemo(() => { + if (!ruleId) return ''; + const ruleRoute = routeToRuleDetails.replace(':ruleId', ruleId); + if (ruleOnDifferentSpace) { + const [linkedSpaceId] = spaceIds ?? []; + const basePath = http.basePath.get(); + const spacePath = linkedSpaceId !== 'default' ? `/s/${linkedSpaceId}` : ''; + const historyPathname = history.location.pathname; + const newPathname = `${basePath.replace( + `/s/${activeSpace!.id}`, + '' + )}${spacePath}${window.location.pathname + .replace(basePath, '') + .replace(historyPathname, ruleRoute)}`; + return newPathname; + } + return ruleRoute; + }, [ruleId, ruleOnDifferentSpace, history, activeSpace, http, spaceIds]); + + const onClickRuleName = useCallback(() => { + if (!ruleId) return; + if (ruleOnDifferentSpace) { + const newUrl = window.location.href.replace(window.location.pathname, ruleNamePathname); + window.open(newUrl, '_blank'); + return; + } + history.push(ruleNamePathname); + }, [ruleNamePathname, history, ruleOnDifferentSpace, ruleId]); + if (typeof value === 'undefined') { return null; } @@ -54,15 +93,24 @@ export const RuleEventLogListCellRenderer = (props: RuleEventLogListCellRenderer } if (columnId === 'rule_name' && ruleId) { - return <EuiLink onClick={onClickRuleName}>{value}</EuiLink>; + return ( + <EuiLink onClick={onClickRuleName} data-href={ruleNamePathname}> + {value} + </EuiLink> + ); + } + + if (columnId === 'space_ids') { + if (activeSpace && value.includes(activeSpace.id)) return <>{activeSpace.name}</>; + if (spacesData) return <>{spacesData.spacesMap.get(value[0])?.name ?? value[0]}</>; } if (RULE_EXECUTION_LOG_ALERT_COUNT_COLUMNS.includes(columnId)) { - return <>{formatRuleAlertCount(value, version)}</>; + return <>{formatRuleAlertCount(value as string, version)}</>; } if (RULE_EXECUTION_LOG_DURATION_COLUMNS.includes(columnId)) { - return <RuleDurationFormat duration={parseInt(value, 10)} />; + return <RuleDurationFormat duration={parseInt(value as string, 10)} />; } return <>{value}</>; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_kpi.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_kpi.tsx index 970390359f0d7..0696f857261ec 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_kpi.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_kpi.tsx @@ -84,6 +84,7 @@ export type RuleEventLogListKPIProps = { outcomeFilter?: string[]; message?: string; refreshToken?: number; + namespaces?: Array<string | undefined>; } & Pick<RuleApis, 'loadExecutionKPIAggregations' | 'loadGlobalExecutionKPIAggregations'>; export const RuleEventLogListKPI = (props: RuleEventLogListKPIProps) => { @@ -94,6 +95,7 @@ export const RuleEventLogListKPI = (props: RuleEventLogListKPIProps) => { outcomeFilter, message, refreshToken, + namespaces, loadExecutionKPIAggregations, loadGlobalExecutionKPIAggregations, } = props; @@ -122,6 +124,7 @@ export const RuleEventLogListKPI = (props: RuleEventLogListKPIProps) => { dateEnd: getParsedDate(dateEnd), outcomeFilter, message, + ...(namespaces ? { namespaces } : {}), }); setKpi(newKpi); } catch (e) { @@ -136,7 +139,7 @@ export const RuleEventLogListKPI = (props: RuleEventLogListKPIProps) => { useEffect(() => { loadKPIs(); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [ruleId, dateStart, dateEnd, outcomeFilter, message]); + }, [ruleId, dateStart, dateEnd, outcomeFilter, message, namespaces]); useEffect(() => { if (isInitialized.current) { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_table.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_table.tsx index 58cd6447ca737..1ea613e20055f 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_table.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_table.tsx @@ -18,9 +18,11 @@ import { Pagination, EuiSuperDatePicker, OnTimeChangeProps, + EuiSwitch, } from '@elastic/eui'; import { IExecutionLog } from '@kbn/alerting-plugin/common'; -import { useKibana } from '../../../../common/lib/kibana'; +import { SpacesContextProps } from '@kbn/spaces-plugin/public'; +import { useKibana, useSpacesData } from '../../../../common/lib/kibana'; import { RULE_EXECUTION_DEFAULT_INITIAL_VISIBLE_COLUMNS, GLOBAL_EXECUTION_DEFAULT_INITIAL_VISIBLE_COLUMNS, @@ -38,6 +40,8 @@ import { withBulkRuleOperations, } from '../../common/components/with_bulk_rule_api_operations'; +const getEmptyFunctionComponent: React.FC<SpacesContextProps> = ({ children }) => <>{children}</>; + const getParsedDate = (date: string) => { if (date.includes('now')) { return datemath.parse(date)?.format() || date; @@ -66,6 +70,13 @@ const getDefaultColumns = (columns: string[]) => { return [...LOCKED_COLUMNS, ...columnsWithoutLockedColumn]; }; +const ALL_SPACES_LABEL = i18n.translate( + 'xpack.triggersActionsUI.ruleEventLogList.showAllSpacesToggle', + { + defaultMessage: 'Show rules from all spaces', + } +); + const updateButtonProps = { iconOnly: true, fill: false, @@ -84,6 +95,7 @@ export type RuleEventLogListCommonProps = { overrideLoadExecutionLogAggregations?: RuleApis['loadExecutionLogAggregations']; overrideLoadGlobalExecutionLogAggregations?: RuleApis['loadGlobalExecutionLogAggregations']; hasRuleNames?: boolean; + hasAllSpaceSwitch?: boolean; } & Pick<RuleApis, 'loadExecutionLogAggregations' | 'loadGlobalExecutionLogAggregations'>; export type RuleEventLogListTableProps<T extends RuleEventLogListOptions = 'default'> = @@ -106,6 +118,7 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( overrideLoadExecutionLogAggregations, initialPageSize = 10, hasRuleNames = false, + hasAllSpaceSwitch = false, } = props; const { uiSettings, notifications } = useKibana().services; @@ -117,6 +130,7 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( const [internalRefreshToken, setInternalRefreshToken] = useState<number | undefined>( refreshToken ); + const [showFromAllSpaces, setShowFromAllSpaces] = useState(false); // Data grid states const [logs, setLogs] = useState<IExecutionLog[]>(); @@ -153,6 +167,24 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( ); }); + const spacesData = useSpacesData(); + const accessibleSpaceIds = useMemo( + () => (spacesData ? [...spacesData.spacesMap.values()].map((e) => e.id) : []), + [spacesData] + ); + const areMultipleSpacesAccessible = useMemo( + () => accessibleSpaceIds.length > 1, + [accessibleSpaceIds] + ); + const namespaces = useMemo( + () => (showFromAllSpaces && spacesData ? accessibleSpaceIds : undefined), + [showFromAllSpaces, spacesData, accessibleSpaceIds] + ); + const activeSpace = useMemo( + () => spacesData?.spacesMap.get(spacesData?.activeSpaceId), + [spacesData] + ); + const isInitialized = useRef(false); const isOnLastPage = useMemo(() => { @@ -197,6 +229,7 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( dateEnd: getParsedDate(dateEnd), page: pagination.pageIndex, perPage: pagination.pageSize, + namespaces, }); setLogs(result.data); setPagination({ @@ -290,6 +323,20 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( [search, setSearchText] ); + const onShowAllSpacesChange = useCallback(() => { + setShowFromAllSpaces((prev) => !prev); + const nextShowFromAllSpaces = !showFromAllSpaces; + + if (nextShowFromAllSpaces && !visibleColumns.includes('space_ids')) { + const ruleNameIndex = visibleColumns.findIndex((c) => c === 'rule_name'); + const newVisibleColumns = [...visibleColumns]; + newVisibleColumns.splice(ruleNameIndex + 1, 0, 'space_ids'); + setVisibleColumns(newVisibleColumns); + } else if (!nextShowFromAllSpaces && visibleColumns.includes('space_ids')) { + setVisibleColumns(visibleColumns.filter((c) => c !== 'space_ids')); + } + }, [setShowFromAllSpaces, showFromAllSpaces, visibleColumns]); + const renderList = () => { if (!logs) { return <CenterJustifiedSpinner />; @@ -307,6 +354,7 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( dateFormat={dateFormat} selectedRunLog={selectedRunLog} showRuleNameAndIdColumns={hasRuleNames} + showSpaceColumns={showFromAllSpaces} onChangeItemsPerPage={onChangeItemsPerPage} onChangePage={onChangePage} onFlyoutOpen={onFlyoutOpen} @@ -329,6 +377,7 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( pagination.pageIndex, pagination.pageSize, searchText, + showFromAllSpaces, ]); useEffect(() => { @@ -350,7 +399,7 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( return ( <EuiFlexGroup gutterSize="none" direction="column"> <EuiFlexItem grow={false}> - <EuiFlexGroup> + <EuiFlexGroup alignItems="center"> <EuiFlexItem grow={false}> <EuiFieldSearch fullWidth @@ -378,6 +427,15 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( updateButtonProps={updateButtonProps} /> </EuiFlexItem> + {hasAllSpaceSwitch && areMultipleSpacesAccessible && ( + <EuiFlexItem> + <EuiSwitch + label={ALL_SPACES_LABEL} + checked={showFromAllSpaces} + onChange={onShowAllSpacesChange} + /> + </EuiFlexItem> + )} </EuiFlexGroup> <EuiSpacer /> </EuiFlexItem> @@ -389,6 +447,7 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( outcomeFilter={filter} message={searchText} refreshToken={internalRefreshToken} + namespaces={namespaces} /> <EuiSpacer /> </EuiFlexItem> @@ -407,13 +466,29 @@ export const RuleEventLogListTable = <T extends RuleEventLogListOptions>( runLog={selectedRunLog} refreshToken={refreshToken} onClose={onFlyoutClose} + activeSpaceId={activeSpace?.id} /> )} </EuiFlexGroup> ); }; -export const RuleEventLogListTableWithApi = withBulkRuleOperations(RuleEventLogListTable); +const RuleEventLogListTableWithSpaces: React.FC<RuleEventLogListTableProps> = (props) => { + const { spaces } = useKibana().services; + + // eslint-disable-next-line react-hooks/exhaustive-deps + const SpacesContextWrapper = useCallback( + spaces ? spaces.ui.components.getSpacesContextProvider : getEmptyFunctionComponent, + [spaces] + ); + return ( + <SpacesContextWrapper feature="triggersActions"> + <RuleEventLogListTable {...props} /> + </SpacesContextWrapper> + ); +}; + +export const RuleEventLogListTableWithApi = withBulkRuleOperations(RuleEventLogListTableWithSpaces); // eslint-disable-next-line import/no-default-export export { RuleEventLogListTableWithApi as default }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.test.tsx index dfebee8e5d6ff..58ca1fb0193cd 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.test.tsx @@ -232,7 +232,7 @@ describe('rule_edit', () => { it('should render an alert icon next to save button stating the potential change in permissions', async () => { // Use fake timers so we don't have to wait for the EuiToolTip timeout - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); await setup(); expect(wrapper.find('[data-test-subj="changeInPrivilegesTip"]').exists()).toBeTruthy(); @@ -241,7 +241,7 @@ describe('rule_edit', () => { }); // Run the timers so the EuiTooltip will be visible - jest.runAllTimers(); + jest.runOnlyPendingTimers(); wrapper.update(); expect(wrapper.find('.euiToolTipPopover').text()).toBe( 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 6bfe953e28696..39613e456157d 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 @@ -1106,7 +1106,7 @@ describe('rules_list component with items', () => { it('renders table of rules', async () => { // Use fake timers so we don't have to wait for the EuiToolTip timeout - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); await setup(); expect(wrapper.find('EuiBasicTable')).toHaveLength(1); expect(wrapper.find('EuiTableRow')).toHaveLength(mockedRulesData.length); diff --git a/x-pack/plugins/triggers_actions_ui/public/common/get_alerts_search_bar.tsx b/x-pack/plugins/triggers_actions_ui/public/common/get_alerts_search_bar.tsx new file mode 100644 index 0000000000000..ddeb5e5c4c067 --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/common/get_alerts_search_bar.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 { EuiLoadingSpinner } from '@elastic/eui'; +import React, { lazy, Suspense } from 'react'; +import type { AlertsSearchBarProps } from '../application/sections/alerts_search_bar'; + +const AlertsSearchBarLazy: React.FC<AlertsSearchBarProps> = lazy( + () => import('../application/sections/alerts_search_bar/alerts_search_bar') +); + +export const getAlertsSearchBarLazy = (props: AlertsSearchBarProps) => ( + <Suspense fallback={<EuiLoadingSpinner />}> + <AlertsSearchBarLazy {...props} /> + </Suspense> +); diff --git a/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/__mocks__/index.ts b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/__mocks__/index.ts index 6772eacc2aaed..e7c8215fd4625 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/__mocks__/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/__mocks__/index.ts @@ -31,3 +31,4 @@ export const useCurrentUser = jest.fn(); export const withKibana = jest.fn(createWithKibanaMock()); export const KibanaContextProvider = jest.fn(createKibanaContextProviderMock()); export const useGetUserSavedObjectPermissions = jest.fn(); +export const useSpacesData = jest.fn(); diff --git a/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/index.ts b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/index.ts index 3970993a0c732..de8f3b63d1c5c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/index.ts @@ -6,3 +6,4 @@ */ export * from './kibana_react'; +export * from './use_spaces_data'; diff --git a/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/use_spaces_data.tsx b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/use_spaces_data.tsx new file mode 100644 index 0000000000000..54f2baafa21c3 --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/use_spaces_data.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 { useState, useEffect } from 'react'; +import { SpacesData } from '@kbn/spaces-plugin/public'; +import { useKibana } from './kibana_react'; + +export const useSpacesData = () => { + const { spaces } = useKibana().services; + const [spacesData, setSpacesData] = useState<SpacesData | undefined>(undefined); + const spacesService = spaces?.ui.useSpaces(); + + useEffect(() => { + (async () => { + const result = await spacesService?.spacesDataPromise; + setSpacesData(result); + })(); + }, [spaces, spacesService, setSpacesData]); + return spacesData; +}; diff --git a/x-pack/plugins/triggers_actions_ui/public/index.ts b/x-pack/plugins/triggers_actions_ui/public/index.ts index 7500a66b70f16..0a560be762eb5 100644 --- a/x-pack/plugins/triggers_actions_ui/public/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/index.ts @@ -142,7 +142,7 @@ export { loadRule } from './application/lib/rule_api/get_rule'; export { loadAllActions } from './application/lib/action_connector_api'; export { suspendedComponentWithProps } from './application/lib/suspended_component_with_props'; export { loadActionTypes } from './application/lib/action_connector_api/connector_types'; -export type { TIME_UNITS } from './application/constants'; +export { TIME_UNITS } from './application/constants'; export { getTimeUnitLabel } from './common/lib/get_time_unit_label'; export type { TriggersAndActionsUiServices } from './application/app'; diff --git a/x-pack/plugins/triggers_actions_ui/public/mocks.ts b/x-pack/plugins/triggers_actions_ui/public/mocks.ts index 7c18ea1b6fa2c..d753feb597a6c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/mocks.ts +++ b/x-pack/plugins/triggers_actions_ui/public/mocks.ts @@ -33,8 +33,10 @@ import { getRuleTagBadgeLazy } from './common/get_rule_tag_badge'; import { getRuleEventLogListLazy } from './common/get_rule_event_log_list'; import { getRulesListLazy } from './common/get_rules_list'; import { getAlertsTableStateLazy } from './common/get_alerts_table_state'; +import { getAlertsSearchBarLazy } from './common/get_alerts_search_bar'; import { getRulesListNotifyBadgeLazy } from './common/get_rules_list_notify_badge'; import { AlertsTableStateProps } from './application/sections/alerts_table/alerts_table_state'; +import { AlertsSearchBarProps } from './application/sections/alerts_search_bar'; import { CreateConnectorFlyoutProps } from './application/sections/action_connector_form/create_connector_flyout'; import { EditConnectorFlyoutProps } from './application/sections/action_connector_form/edit_connector_flyout'; import { getActionFormLazy } from './common/get_action_form'; @@ -86,6 +88,9 @@ function createStartMock(): TriggersAndActionsUIPublicPluginStart { getAlertsStateTable: (props: AlertsTableStateProps) => { return getAlertsTableStateLazy(props); }, + getAlertsSearchBar: (props: AlertsSearchBarProps) => { + return getAlertsSearchBarLazy(props); + }, getAlertsTable: (props: AlertsTableProps) => { return getAlertsTableLazy(props); }, diff --git a/x-pack/plugins/triggers_actions_ui/public/plugin.ts b/x-pack/plugins/triggers_actions_ui/public/plugin.ts index 9e4645b164f21..d8ebc2298dca9 100644 --- a/x-pack/plugins/triggers_actions_ui/public/plugin.ts +++ b/x-pack/plugins/triggers_actions_ui/public/plugin.ts @@ -23,6 +23,7 @@ import type { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import type { SpacesPluginStart } from '@kbn/spaces-plugin/public'; import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; +import type { AlertsSearchBarProps } from './application/sections/alerts_search_bar'; import { TypeRegistry } from './application/type_registry'; import { getAddConnectorFlyoutLazy } from './common/get_add_connector_flyout'; @@ -72,6 +73,7 @@ import { registerAlertsTableConfiguration } from './application/sections/alerts_ import { PLUGIN_ID, CONNECTORS_PLUGIN_ID } from './common/constants'; import type { AlertsTableStateProps } from './application/sections/alerts_table/alerts_table_state'; import { getAlertsTableStateLazy } from './common/get_alerts_table_state'; +import { getAlertsSearchBarLazy } from './common/get_alerts_search_bar'; import { ActionAccordionFormProps } from './application/sections/action_connector_form/action_form'; import type { FieldBrowserProps } from './application/sections/field_browser/types'; import { getRuleDefinitionLazy } from './common/get_rule_definition'; @@ -108,6 +110,7 @@ export interface TriggersAndActionsUIPublicPluginStart { ) => ReactElement<RuleEditProps>; getAlertsTable: (props: AlertsTableProps) => ReactElement<AlertsTableProps>; getAlertsStateTable: (props: AlertsTableStateProps) => ReactElement<AlertsTableStateProps>; + getAlertsSearchBar: (props: AlertsSearchBarProps) => ReactElement<AlertsSearchBarProps>; getFieldBrowser: (props: FieldBrowserProps) => ReactElement<FieldBrowserProps>; getRuleStatusDropdown: (props: RuleStatusDropdownProps) => ReactElement<RuleStatusDropdownProps>; getRuleTagFilter: (props: RuleTagFilterProps) => ReactElement<RuleTagFilterProps>; @@ -378,6 +381,9 @@ export class Plugin getAlertsStateTable: (props: AlertsTableStateProps) => { return getAlertsTableStateLazy(props); }, + getAlertsSearchBar: (props: AlertsSearchBarProps) => { + return getAlertsSearchBarLazy(props); + }, getAlertsTable: (props: AlertsTableProps) => { return getAlertsTableLazy(props); }, diff --git a/x-pack/plugins/triggers_actions_ui/tsconfig.json b/x-pack/plugins/triggers_actions_ui/tsconfig.json index c98e5f1dfd511..a433af59649a1 100644 --- a/x-pack/plugins/triggers_actions_ui/tsconfig.json +++ b/x-pack/plugins/triggers_actions_ui/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ ".storybook/**/*", @@ -14,7 +13,7 @@ "config.ts", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../alerting/tsconfig.json" }, { "path": "../features/tsconfig.json" }, 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 f4b07c6f2f5ad..6de4d8095d267 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 @@ -361,7 +361,7 @@ describe('ES deprecation logs', () => { describe('Poll for logs count', () => { beforeEach(async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); // First request should make the step be complete httpRequestsMockHelpers.setLoadDeprecationLogsCountResponse({ diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/deprecations_list.test.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/deprecations_list.test.ts index 457c0c4ec2be5..3af99109510a8 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/deprecations_list.test.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/deprecations_list.test.ts @@ -103,9 +103,9 @@ describe('ES deprecations table', () => { (deprecation) => deprecation.isCritical === false ); - expect(find('criticalDeprecationsCount').text()).toContain(criticalDeprecations.length); + expect(find('criticalDeprecationsCount').text()).toContain(String(criticalDeprecations.length)); - expect(find('warningDeprecationsCount').text()).toContain(warningDeprecations.length); + expect(find('warningDeprecationsCount').text()).toContain(String(warningDeprecations.length)); }); describe('remote clusters callout', () => { diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/reindex_deprecation_flyout.test.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/reindex_deprecation_flyout.test.ts index 845141fb7784f..f181aef4f7c05 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/reindex_deprecation_flyout.test.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/reindex_deprecation_flyout.test.ts @@ -27,7 +27,7 @@ describe('Reindex deprecation flyout', () => { let testBed: ElasticsearchTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/time_manipulation.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/time_manipulation.ts index 65cec19549736..9789fa3a8f52e 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/time_manipulation.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/time_manipulation.ts @@ -8,7 +8,7 @@ import { act } from 'react-dom/test-utils'; /** - * These helpers are intended to be used in conjunction with jest.useFakeTimers(). + * These helpers are intended to be used in conjunction with jest.useFakeTimers('legacy'). */ const flushPromiseJobQueue = async () => { diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/deprecations_table.test.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/deprecations_table.test.ts index 7a62fa33bb876..e4c85d47bc464 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/deprecations_table.test.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/deprecations_table.test.ts @@ -69,10 +69,10 @@ describe('Kibana deprecations - Deprecations table', () => { const { find } = testBed; expect(find('criticalDeprecationsCount').text()).toContain( - mockedCriticalKibanaDeprecations.length + String(mockedCriticalKibanaDeprecations.length) ); expect(find('warningDeprecationsCount').text()).toContain( - mockedWarningKibanaDeprecations.length + String(mockedWarningKibanaDeprecations.length) ); }); diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/backup_step/backup_step.test.tsx b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/backup_step/backup_step.test.tsx index 688e060705ee4..bc93c05fb7e7a 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/backup_step/backup_step.test.tsx +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/backup_step/backup_step.test.tsx @@ -153,7 +153,7 @@ describe('Overview - Backup Step', () => { describe('poll for new status', () => { beforeEach(async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); // First request will succeed. httpRequestsMockHelpers.setLoadCloudBackupStatusResponse({ diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_issues_step/kibana_deprecation_issues.test.tsx b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_issues_step/kibana_deprecation_issues.test.tsx index 77c8a9e998edf..cead46f258c4a 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_issues_step/kibana_deprecation_issues.test.tsx +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_issues_step/kibana_deprecation_issues.test.tsx @@ -57,8 +57,8 @@ describe('Overview - Fix deprecation issues step - Kibana deprecations', () => { const { exists, find } = testBed; expect(exists('kibanaStatsPanel')).toBe(true); - expect(find('kibanaStatsPanel.criticalDeprecations').text()).toContain(1); - expect(find('kibanaStatsPanel.warningDeprecations').text()).toContain(2); + expect(find('kibanaStatsPanel.criticalDeprecations').text()).toContain('1'); + expect(find('kibanaStatsPanel.warningDeprecations').text()).toContain('2'); }); test('panel links to Kibana deprecations page', () => { @@ -77,7 +77,7 @@ describe('Overview - Fix deprecation issues step - Kibana deprecations', () => { const { exists, find } = testBed; expect(exists('kibanaStatsPanel')).toBe(true); - expect(find('kibanaStatsPanel.criticalDeprecations').text()).toContain(1); + expect(find('kibanaStatsPanel.criticalDeprecations').text()).toContain('1'); expect(exists('kibanaStatsPanel.noWarningDeprecationIssues')).toBe(true); }); diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/migrate_system_indices/step_completion.test.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/migrate_system_indices/step_completion.test.ts index cbece74355d6d..9c69b4bb18475 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/migrate_system_indices/step_completion.test.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/migrate_system_indices/step_completion.test.ts @@ -55,7 +55,7 @@ describe('Overview - Migrate system indices - Step completion', () => { describe('Poll for new status', () => { beforeEach(async () => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); // First request should make the step be incomplete httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({ diff --git a/x-pack/plugins/upgrade_assistant/tsconfig.json b/x-pack/plugins/upgrade_assistant/tsconfig.json index 4336acb77c2eb..2663859f207c0 100644 --- a/x-pack/plugins/upgrade_assistant/tsconfig.json +++ b/x-pack/plugins/upgrade_assistant/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "../../../typings/**/*", @@ -16,7 +15,7 @@ "public/**/*.json", "server/**/*.json" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/management/tsconfig.json" }, { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, diff --git a/x-pack/plugins/ux/e2e/journeys/ux_js_errors.journey.ts b/x-pack/plugins/ux/e2e/journeys/ux_js_errors.journey.ts index 8e124d8a5e4b7..e29807a3edd5d 100644 --- a/x-pack/plugins/ux/e2e/journeys/ux_js_errors.journey.ts +++ b/x-pack/plugins/ux/e2e/journeys/ux_js_errors.journey.ts @@ -45,7 +45,8 @@ journey('UX JsErrors', async ({ page, params }) => { step('Confirm error count', async () => { // Wait until chart data is loaded - page.waitForLoadState('networkidle'); + await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)); + await page.waitForLoadState('networkidle'); await page.waitForSelector(`text=${jsErrorCount}`); const jsErrors = await ( diff --git a/x-pack/plugins/ux/e2e/journeys/ux_long_task_metric_journey.ts b/x-pack/plugins/ux/e2e/journeys/ux_long_task_metric_journey.ts index ba4cb014379e1..803a18e379e5e 100644 --- a/x-pack/plugins/ux/e2e/journeys/ux_long_task_metric_journey.ts +++ b/x-pack/plugins/ux/e2e/journeys/ux_long_task_metric_journey.ts @@ -54,9 +54,9 @@ journey('UX LongTaskMetrics', async ({ page, params }) => { step('Confirm metrics values', async () => { // Wait until chart data is loaded - page.waitForLoadState('networkidle'); + await page.waitForLoadState('networkidle'); // wait for first metric to be shown - page.waitForSelector(`text="237 ms"`); + await page.waitForSelector(`text="237 ms"`); let metric = await ( await page.waitForSelector(byTestId(longestMetric)) diff --git a/x-pack/plugins/ux/e2e/journeys/ux_visitor_breakdown.journey.ts b/x-pack/plugins/ux/e2e/journeys/ux_visitor_breakdown.journey.ts index 88e0b90120ec7..be655789b2596 100644 --- a/x-pack/plugins/ux/e2e/journeys/ux_visitor_breakdown.journey.ts +++ b/x-pack/plugins/ux/e2e/journeys/ux_visitor_breakdown.journey.ts @@ -45,7 +45,9 @@ journey('UX Visitor Breakdown', async ({ page, params }) => { step('Confirm charts are visible', async () => { // Wait until chart data is loaded + await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)); await page.waitForLoadState('networkidle'); + await waitForLoadingToFinish({ page }); await Promise.all( chartIds.map( diff --git a/x-pack/plugins/ux/e2e/tsconfig.json b/x-pack/plugins/ux/e2e/tsconfig.json index d93edaa58f749..bde3d9cb57da7 100644 --- a/x-pack/plugins/ux/e2e/tsconfig.json +++ b/x-pack/plugins/ux/e2e/tsconfig.json @@ -6,7 +6,7 @@ "outDir": "target/types", "types": [ "node"], }, - "references": [ + "kbn_references": [ { "path": "../../apm/tsconfig.json", }, diff --git a/x-pack/plugins/ux/public/components/app/rum_dashboard/rum_dashboard.tsx b/x-pack/plugins/ux/public/components/app/rum_dashboard/rum_dashboard.tsx index d6b454bd948f7..a05915dc816b6 100644 --- a/x-pack/plugins/ux/public/components/app/rum_dashboard/rum_dashboard.tsx +++ b/x-pack/plugins/ux/public/components/app/rum_dashboard/rum_dashboard.tsx @@ -7,6 +7,8 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React from 'react'; +import { LoadWhenInView } from '@kbn/observability-plugin/public'; +import { I18LABELS } from './translations'; import { UXMetrics } from './ux_metrics'; import { ImpactfulMetrics } from './impactful_metrics'; import { PageLoadAndViews } from './panels/page_load_and_views'; @@ -29,10 +31,20 @@ export function RumDashboard() { <PageLoadAndViews /> </EuiFlexItem> <EuiFlexItem> - <VisitorBreakdownsPanel /> + <LoadWhenInView + initialHeight={300} + placeholderTitle={I18LABELS.pageLoadDurationByRegion} + > + <VisitorBreakdownsPanel /> + </LoadWhenInView> </EuiFlexItem> <EuiFlexItem> - <ImpactfulMetrics /> + <LoadWhenInView + initialHeight={300} + placeholderTitle={I18LABELS.jsErrors} + > + <ImpactfulMetrics /> + </LoadWhenInView> </EuiFlexItem> </EuiFlexGroup> ); diff --git a/x-pack/plugins/ux/tsconfig.json b/x-pack/plugins/ux/tsconfig.json index 34fe9482984c3..a07702fc36407 100644 --- a/x-pack/plugins/ux/tsconfig.json +++ b/x-pack/plugins/ux/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "../../../typings/**/*", @@ -13,7 +12,7 @@ "typings/**/*", "public/**/*.json", ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, diff --git a/x-pack/plugins/watcher/__jest__/client_integration/watch_create_json_page.test.ts b/x-pack/plugins/watcher/__jest__/client_integration/watch_create_json_page.test.ts index 54352e278770b..b7e80808cfb82 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/watch_create_json_page.test.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/watch_create_json_page.test.ts @@ -21,7 +21,7 @@ describe('<JsonWatchEditPage /> create route', () => { let testBed: WatchCreateJsonTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/watcher/__jest__/client_integration/watch_create_threshold_page.test.tsx b/x-pack/plugins/watcher/__jest__/client_integration/watch_create_threshold_page.test.tsx index 4fe5fb3445da8..3395e8d95de7c 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/watch_create_threshold_page.test.tsx +++ b/x-pack/plugins/watcher/__jest__/client_integration/watch_create_threshold_page.test.tsx @@ -84,7 +84,7 @@ describe('<ThresholdWatchEditPage /> create route', () => { let testBed: WatchCreateThresholdTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/watcher/__jest__/client_integration/watch_edit_page.test.ts b/x-pack/plugins/watcher/__jest__/client_integration/watch_edit_page.test.ts index f57dcb6788fe1..f392806b854ff 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/watch_edit_page.test.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/watch_edit_page.test.ts @@ -21,7 +21,7 @@ describe('<WatchEditPage />', () => { let testBed: WatchEditTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/watcher/__jest__/client_integration/watch_list_page.test.ts b/x-pack/plugins/watcher/__jest__/client_integration/watch_list_page.test.ts index b856002775188..995b363504685 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/watch_list_page.test.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/watch_list_page.test.ts @@ -18,7 +18,7 @@ describe('<WatchListPage />', () => { let testBed: WatchListTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/watcher/__jest__/client_integration/watch_status_page.test.ts b/x-pack/plugins/watcher/__jest__/client_integration/watch_status_page.test.ts index 1d00b6c699721..3ae7415630750 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/watch_status_page.test.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/watch_status_page.test.ts @@ -45,7 +45,7 @@ describe('<WatchStatusPage />', () => { let testBed: WatchStatusTestBed; beforeAll(() => { - jest.useFakeTimers(); + jest.useFakeTimers('legacy'); }); afterAll(() => { diff --git a/x-pack/plugins/watcher/tsconfig.json b/x-pack/plugins/watcher/tsconfig.json index e17e7e753592a..045ed49f24a42 100644 --- a/x-pack/plugins/watcher/tsconfig.json +++ b/x-pack/plugins/watcher/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true }, "include": [ "__jest__/**/*", @@ -14,7 +13,7 @@ "__fixtures__/*", "../../../typings/**/*" ], - "references": [ + "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, { "path": "../../../src/plugins/management/tsconfig.json" }, diff --git a/x-pack/test/accessibility/apps/cross_cluster_replication.ts b/x-pack/test/accessibility/apps/cross_cluster_replication.ts index e3cbc4d48f845..8081c8fd142b0 100644 --- a/x-pack/test/accessibility/apps/cross_cluster_replication.ts +++ b/x-pack/test/accessibility/apps/cross_cluster_replication.ts @@ -46,7 +46,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('crossClusterReplication'); await PageObjects.crossClusterReplication.clickCreateFollowerIndexButton(); await a11y.testAppSnapshot(); - await PageObjects.crossClusterReplication.createFollowerIndex(testLeader, testFollower); + await PageObjects.crossClusterReplication.createFollowerIndex( + testLeader, + testFollower, + false + ); }); it('follower index flyout', async () => { // https://github.com/elastic/kibana/issues/135503 diff --git a/x-pack/test/accessibility/apps/spaces.ts b/x-pack/test/accessibility/apps/spaces.ts index 482429071e3bb..2a4923a15d08c 100644 --- a/x-pack/test/accessibility/apps/spaces.ts +++ b/x-pack/test/accessibility/apps/spaces.ts @@ -20,8 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const toasts = getService('toasts'); const kibanaServer = getService('kibanaServer'); - // FLAKY: https://github.com/elastic/kibana/issues/137136 - describe.skip('Kibana Spaces Accessibility', () => { + describe('Kibana Spaces Accessibility', () => { before(async () => { await kibanaServer.savedObjects.cleanStandardList(); await PageObjects.common.navigateToApp('home'); @@ -86,29 +85,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); // creating space b and making it the current space so space selector page gets displayed when space b gets deleted - // FLAKY: https://github.com/elastic/kibana/issues/135341 - it.skip('a11y test for delete space button', async () => { - await PageObjects.spaceSelector.clickCreateSpace(); - await PageObjects.spaceSelector.clickEnterSpaceName(); - await PageObjects.spaceSelector.addSpaceName('space_b'); - await PageObjects.spaceSelector.clickSaveSpaceCreation(); - await PageObjects.common.navigateToApp('home'); - await PageObjects.spaceSelector.openSpacesNav(); - await PageObjects.spaceSelector.clickSpaceAvatar('space_b'); - await PageObjects.header.waitUntilLoadingHasFinished(); - await PageObjects.spaceSelector.openSpacesNav(); - await PageObjects.spaceSelector.clickManageSpaces(); - await PageObjects.spaceSelector.clickOnDeleteSpaceButton('space_b'); - await a11y.testAppSnapshot(); - }); - - // test starts with deleting space b so we can get the space selection page instead of logging out in the test - it('a11y test for space selection page', async () => { - await PageObjects.spaceSelector.confirmDeletingSpace(); - await retry.try(async () => { + // Skipped due to an a11y violation + // https://github.com/elastic/kibana/issues/144155 + describe.skip('Create Space B and Verify', async () => { + it('a11y test for delete space button', async () => { + await PageObjects.spaceSelector.clickCreateSpace(); + await PageObjects.spaceSelector.clickEnterSpaceName(); + await PageObjects.spaceSelector.addSpaceName('space_b'); + await PageObjects.spaceSelector.clickSaveSpaceCreation(); + await PageObjects.common.navigateToApp('home'); + await PageObjects.spaceSelector.openSpacesNav(); + await PageObjects.spaceSelector.clickSpaceAvatar('space_b'); + await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.spaceSelector.openSpacesNav(); + await PageObjects.spaceSelector.clickManageSpaces(); + await PageObjects.spaceSelector.clickOnDeleteSpaceButton('space_b'); await a11y.testAppSnapshot(); }); - await PageObjects.spaceSelector.clickSpaceCard('default'); + + // test starts with deleting space b so we can get the space selection page instead of logging out in the test + it('a11y test for space selection page', async () => { + await PageObjects.spaceSelector.confirmDeletingSpace(); + await retry.try(async () => { + await a11y.testAppSnapshot(); + }); + await PageObjects.spaceSelector.clickSpaceCard('default'); + }); }); }); } diff --git a/x-pack/test/alerting_api_integration/common/config.ts b/x-pack/test/alerting_api_integration/common/config.ts index 090e48f7a8a2d..d2831b61799f5 100644 --- a/x-pack/test/alerting_api_integration/common/config.ts +++ b/x-pack/test/alerting_api_integration/common/config.ts @@ -197,6 +197,18 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ])}`, `--xpack.actions.preconfiguredAlertHistoryEsIndex=${preconfiguredAlertHistoryEsIndex}`, `--xpack.actions.preconfigured=${JSON.stringify({ + 'my-test-email': { + actionTypeId: '.email', + name: 'TestEmail#xyz', + config: { + from: 'me@test.com', + service: '__json', + }, + secrets: { + user: 'user', + password: 'password', + }, + }, 'my-slack1': { actionTypeId: '.slack', name: 'Slack#xyz', diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin.ts index ae874d942e75b..316d1916b4af2 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin.ts +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin.ts @@ -7,10 +7,13 @@ import http from 'http'; import https from 'https'; -import { Plugin, CoreSetup, IRouter } from '@kbn/core/server'; +import { Plugin, CoreSetup } from '@kbn/core/server'; import { EncryptedSavedObjectsPluginStart } from '@kbn/encrypted-saved-objects-plugin/server'; import { PluginSetupContract as FeaturesPluginSetup } from '@kbn/features-plugin/server'; -import { PluginSetupContract as ActionsPluginSetupContract } from '@kbn/actions-plugin/server/plugin'; +import { + PluginSetupContract as ActionsPluginSetupContract, + PluginStartContract as ActionsPluginStartContract, +} from '@kbn/actions-plugin/server/plugin'; import { ActionType } from '@kbn/actions-plugin/server'; import { initPlugin as initPagerduty } from './pagerduty_simulation'; import { initPlugin as initSwimlane } from './swimlane_simulation'; @@ -22,6 +25,7 @@ import { initPlugin as initSlack } from './slack_simulation'; import { initPlugin as initWebhook } from './webhook_simulation'; import { initPlugin as initMSExchange } from './ms_exchage_server_simulation'; import { initPlugin as initXmatters } from './xmatters_simulation'; +import { initPlugin as initUnsecuredAction } from './unsecured_actions_simulation'; export const NAME = 'actions-FTS-external-service-simulators'; @@ -82,8 +86,9 @@ interface FixtureSetupDeps { features: FeaturesPluginSetup; } -interface FixtureStartDeps { +export interface FixtureStartDeps { encryptedSavedObjects: EncryptedSavedObjectsPluginStart; + actions: ActionsPluginStartContract; } export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps, FixtureStartDeps> { @@ -126,7 +131,7 @@ export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps, Fixtu }, }); - const router: IRouter = core.http.createRouter(); + const router = core.http.createRouter(); initXmatters(router, getExternalServiceSimulatorPath(ExternalServiceSimulator.XMATTERS)); initPagerduty(router, getExternalServiceSimulatorPath(ExternalServiceSimulator.PAGERDUTY)); @@ -137,8 +142,10 @@ export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps, Fixtu router, getExternalServiceSimulatorPath(ExternalServiceSimulator.SERVICENOW) ); + initUnsecuredAction(router, core); } public start() {} + public stop() {} } diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/unsecured_actions_simulation.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/unsecured_actions_simulation.ts new file mode 100644 index 0000000000000..5900f698045a0 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/unsecured_actions_simulation.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 { schema } from '@kbn/config-schema'; +import { + CoreSetup, + RequestHandlerContext, + KibanaRequest, + KibanaResponseFactory, + IKibanaResponse, + IRouter, +} from '@kbn/core/server'; +import { FixtureStartDeps } from './plugin'; + +export function initPlugin(router: IRouter, coreSetup: CoreSetup<FixtureStartDeps>) { + router.post( + { + path: `/api/sample_unsecured_action`, + validate: { + body: schema.object({ + requesterId: schema.string(), + id: schema.string(), + params: schema.recordOf(schema.string(), schema.any()), + }), + }, + }, + async function ( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + const [_, { actions }] = await coreSetup.getStartServices(); + const { body } = req; + + try { + const unsecuredActionsClient = actions.getUnsecuredActionsClient(); + const { requesterId, id, params } = body; + await unsecuredActionsClient.bulkEnqueueExecution(requesterId, [{ id, params }]); + + return res.ok({ body: { status: 'success' } }); + } catch (err) { + return res.ok({ body: { status: 'error', error: `${err}` } }); + } + } + ); +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts index 068c516618616..d41d7a699e6ef 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts @@ -95,21 +95,9 @@ function getAlwaysFiringAlertType() { } async function alwaysFiringExecutor(alertExecutorOptions: any) { - const { - services, - params, - state, - alertId, - spaceId, - namespace, - name, - tags, - createdBy, - updatedBy, - rule, - } = alertExecutorOptions; + const { services, params, state, spaceId, namespace, rule } = alertExecutorOptions; let group: string | null = 'default'; - const alertInfo = { alertId, spaceId, namespace, name, tags, createdBy, updatedBy, ...rule }; + const alertInfo = { spaceId, namespace, ...rule }; if (params.groupsToScheduleActionsInSeries) { const index = state.groupInSeriesIndex || 0; diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/plugin.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/plugin.ts index 2f24648cff73f..57ba67f4a4eb2 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/plugin.ts +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/plugin.ts @@ -8,7 +8,10 @@ import { Plugin, CoreSetup, CoreStart, Logger, PluginInitializerContext } from '@kbn/core/server'; import { firstValueFrom, Subject } from 'rxjs'; import { PluginSetupContract as ActionsPluginSetup } from '@kbn/actions-plugin/server/plugin'; -import { PluginSetupContract as AlertingPluginSetup } from '@kbn/alerting-plugin/server/plugin'; +import { + PluginStartContract as AlertingPluginsStart, + PluginSetupContract as AlertingPluginSetup, +} from '@kbn/alerting-plugin/server/plugin'; import { TaskManagerSetupContract, TaskManagerStartContract, @@ -30,6 +33,7 @@ export interface FixtureSetupDeps { } export interface FixtureStartDeps { + alerting: AlertingPluginsStart; encryptedSavedObjects: EncryptedSavedObjectsPluginStart; security?: SecurityPluginStart; spaces?: SpacesPluginStart; diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/routes.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/routes.ts index e69265eb3f054..cc6403613c3b5 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/routes.ts +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/routes.ts @@ -32,6 +32,26 @@ export function defineRoutes( { logger }: { logger: Logger } ) { const router = core.http.createRouter(); + router.get( + { + path: '/api/alerts_fixture/registered_rule_types', + validate: {}, + }, + async ( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> => { + try { + const [_, { alerting }] = await core.getStartServices(); + return res.ok({ + body: alerting.getAllTypes(), + }); + } catch (err) { + return res.badRequest({ body: err }); + } + } + ); router.put( { path: '/api/alerts_fixture/{id}/replace_api_key', diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_delete.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_delete.ts new file mode 100644 index 0000000000000..91de3084993ff --- /dev/null +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_delete.ts @@ -0,0 +1,563 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { UserAtSpaceScenarios, SuperuserAtSpace1 } from '../../../scenarios'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; +import { getUrlPrefix, getTestRuleData, ObjectRemover } from '../../../../common/lib'; + +const defaultSuccessfulResponse = { errors: [], total: 1, taskIdsFailedToBeDeleted: [] }; + +// eslint-disable-next-line import/no-default-export +export default ({ getService }: FtrProviderContext) => { + const supertest = getService('supertest'); + const es = getService('es'); + const supertestWithoutAuth = getService('supertestWithoutAuth'); + + describe('bulkDelete', () => { + const objectRemover = new ObjectRemover(supertest); + + after(() => objectRemover.removeAll()); + + const getScheduledTask = async (id: string) => { + return await es.get({ + id: `task:${id}`, + index: '.kibana_task_manager', + }); + }; + + for (const scenario of UserAtSpaceScenarios) { + const { user, space } = scenario; + + describe(scenario.id, () => { + afterEach(() => objectRemover.removeAll()); + it('should handle bulk delete of one rule appropriately based on id', async () => { + const { body: createdRule1 } = await supertest + .post(`${getUrlPrefix(space.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send(getTestRuleData()) + .expect(200); + + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({ ids: [createdRule1.id] }) + .auth(user.username, user.password); + + switch (scenario.id) { + case 'no_kibana_privileges at space1': + case 'space_1_all at space2': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to find rules for any rule types', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + objectRemover.add(space.id, createdRule1.id, 'rule', 'alerting'); + // Ensure task still exists + await getScheduledTask(createdRule1.scheduled_task_id); + break; + case 'global_read at space1': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to bulkDelete a "test.noop" rule for "alertsFixture"', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + objectRemover.add(space.id, createdRule1.id, 'rule', 'alerting'); + // Ensure task still exists + await getScheduledTask(createdRule1.scheduled_task_id); + break; + case 'space_1_all_alerts_none_actions at space1': + case 'superuser at space1': + case 'space_1_all at space1': + case 'space_1_all_with_restricted_fixture at space1': + expect(response.body).to.eql(defaultSuccessfulResponse); + expect(response.statusCode).to.eql(200); + try { + await getScheduledTask(createdRule1.scheduled_task_id); + throw new Error('Should have removed scheduled task'); + } catch (e) { + expect(e.meta.statusCode).to.eql(404); + } + break; + default: + throw new Error(`Scenario untested: ${JSON.stringify(scenario)}`); + } + }); + + it('should handle bulk delete of one rule appropriately based on id when consumer is the same as producer', async () => { + const { body: createdRule1 } = await supertest + .post(`${getUrlPrefix(space.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send( + getTestRuleData({ + rule_type_id: 'test.restricted-noop', + consumer: 'alertsRestrictedFixture', + }) + ) + .expect(200); + + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({ ids: [createdRule1.id] }) + .auth(user.username, user.password); + + switch (scenario.id) { + case 'no_kibana_privileges at space1': + case 'space_1_all at space2': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to find rules for any rule types', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + objectRemover.add(space.id, createdRule1.id, 'rule', 'alerting'); + // Ensure task still exists + await getScheduledTask(createdRule1.scheduled_task_id); + break; + case 'global_read at space1': + expect(response.body).to.eql({ + error: 'Forbidden', + message: + 'Unauthorized to bulkDelete a "test.restricted-noop" rule for "alertsRestrictedFixture"', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + objectRemover.add(space.id, createdRule1.id, 'rule', 'alerting'); + // Ensure task still exists + await getScheduledTask(createdRule1.scheduled_task_id); + break; + case 'space_1_all at space1': + case 'space_1_all_alerts_none_actions at space1': + expect(response.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: 'No rules found for bulk delete', + }); + expect(response.statusCode).to.eql(400); + objectRemover.add(space.id, createdRule1.id, 'rule', 'alerting'); + // Ensure task still exists + await getScheduledTask(createdRule1.scheduled_task_id); + break; + case 'superuser at space1': + case 'space_1_all_with_restricted_fixture at space1': + expect(response.body).to.eql(defaultSuccessfulResponse); + expect(response.statusCode).to.eql(200); + try { + await getScheduledTask(createdRule1.scheduled_task_id); + throw new Error('Should have removed scheduled task'); + } catch (e) { + expect(e.meta.statusCode).to.eql(404); + } + break; + default: + throw new Error(`Scenario untested: ${JSON.stringify(scenario)}`); + } + }); + + it('should handle delete alert request appropriately when consumer is not the producer', async () => { + const { body: createdRule1 } = await supertest + .post(`${getUrlPrefix(space.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send( + getTestRuleData({ + rule_type_id: 'test.restricted-noop', + consumer: 'alertsFixture', + }) + ) + .expect(200); + + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({ ids: [createdRule1.id] }) + .auth(user.username, user.password); + + switch (scenario.id) { + case 'no_kibana_privileges at space1': + case 'space_1_all at space2': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to find rules for any rule types', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + objectRemover.add(space.id, createdRule1.id, 'rule', 'alerting'); + // Ensure task still exists + await getScheduledTask(createdRule1.scheduled_task_id); + break; + case 'space_1_all at space1': + case 'space_1_all_alerts_none_actions at space1': + case 'space_1_all_with_restricted_fixture at space1': + case 'global_read at space1': + expect(response.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: 'No rules found for bulk delete', + }); + expect(response.statusCode).to.eql(400); + objectRemover.add(space.id, createdRule1.id, 'rule', 'alerting'); + // Ensure task still exists + await getScheduledTask(createdRule1.scheduled_task_id); + break; + case 'superuser at space1': + expect(response.body).to.eql(defaultSuccessfulResponse); + expect(response.statusCode).to.eql(200); + try { + await getScheduledTask(createdRule1.scheduled_task_id); + throw new Error('Should have removed scheduled task'); + } catch (e) { + expect(e.meta.statusCode).to.eql(404); + } + break; + default: + throw new Error(`Scenario untested: ${JSON.stringify(scenario)}`); + } + }); + + it('should handle delete alert request appropriately when consumer is "alerts"', async () => { + const { body: createdRule1 } = await supertest + .post(`${getUrlPrefix(space.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send( + getTestRuleData({ + rule_type_id: 'test.noop', + consumer: 'alerts', + }) + ) + .expect(200); + + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({ ids: [createdRule1.id] }) + .auth(user.username, user.password); + + switch (scenario.id) { + case 'no_kibana_privileges at space1': + case 'space_1_all at space2': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to find rules for any rule types', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + objectRemover.add(space.id, createdRule1.id, 'rule', 'alerting'); + // Ensure task still exists + await getScheduledTask(createdRule1.scheduled_task_id); + break; + case 'global_read at space1': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to bulkDelete a "test.noop" rule by "alertsFixture"', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + objectRemover.add(space.id, createdRule1.id, 'rule', 'alerting'); + // Ensure task still exists + await getScheduledTask(createdRule1.scheduled_task_id); + break; + case 'superuser at space1': + case 'space_1_all at space1': + case 'space_1_all_alerts_none_actions at space1': + case 'space_1_all_with_restricted_fixture at space1': + expect(response.body).to.eql(defaultSuccessfulResponse); + expect(response.statusCode).to.eql(200); + try { + await getScheduledTask(createdRule1.scheduled_task_id); + throw new Error('Should have removed scheduled task'); + } catch (e) { + expect(e.meta.statusCode).to.eql(404); + } + break; + default: + throw new Error(`Scenario untested: ${JSON.stringify(scenario)}`); + } + }); + + it('should handle bulk delete of several rules ids appropriately based on ids', async () => { + const rules = await Promise.all( + Array.from({ length: 3 }).map(() => + supertest + .post(`${getUrlPrefix(space.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send(getTestRuleData({ tags: ['multiple-rules-edit'] })) + .expect(200) + ) + ); + + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({ ids: rules.map((rule) => rule.body.id) }) + .auth(user.username, user.password); + + switch (scenario.id) { + case 'no_kibana_privileges at space1': + case 'space_1_all at space2': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to find rules for any rule types', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + await Promise.all( + rules.map((rule) => { + objectRemover.add(space.id, rule.body.id, 'rule', 'alerting'); + return getScheduledTask(rule.body.scheduled_task_id); + }) + ); + break; + case 'global_read at space1': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to bulkDelete a "test.noop" rule for "alertsFixture"', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + await Promise.all( + rules.map((rule) => { + objectRemover.add(space.id, rule.body.id, 'rule', 'alerting'); + return getScheduledTask(rule.body.scheduled_task_id); + }) + ); + break; + case 'space_1_all_alerts_none_actions at space1': + case 'superuser at space1': + case 'space_1_all at space1': + case 'space_1_all_with_restricted_fixture at space1': + expect(response.body).to.eql({ ...defaultSuccessfulResponse, total: 3 }); + expect(response.statusCode).to.eql(200); + for (const rule of rules) { + try { + await getScheduledTask(rule.body.scheduled_task_id); + throw new Error('Should have removed scheduled task'); + } catch (e) { + expect(e.meta.statusCode).to.eql(404); + } + } + break; + default: + throw new Error(`Scenario untested: ${JSON.stringify(scenario)}`); + } + }); + + it('should handle bulk delete of several rules ids appropriately based on filter', async () => { + const rules = await Promise.all( + Array.from({ length: 3 }).map(() => + supertest + .post(`${getUrlPrefix(space.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send(getTestRuleData({ tags: ['multiple-rules-delete'] })) + .expect(200) + ) + ); + + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({ filter: `alert.attributes.tags: "multiple-rules-delete"` }) + .auth(user.username, user.password); + + switch (scenario.id) { + case 'no_kibana_privileges at space1': + case 'space_1_all at space2': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to find rules for any rule types', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + await Promise.all( + rules.map((rule) => { + objectRemover.add(space.id, rule.body.id, 'rule', 'alerting'); + return getScheduledTask(rule.body.scheduled_task_id); + }) + ); + break; + case 'global_read at space1': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to bulkDelete a "test.noop" rule for "alertsFixture"', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + await Promise.all( + rules.map((rule) => { + objectRemover.add(space.id, rule.body.id, 'rule', 'alerting'); + return getScheduledTask(rule.body.scheduled_task_id); + }) + ); + break; + case 'space_1_all_alerts_none_actions at space1': + case 'superuser at space1': + case 'space_1_all at space1': + case 'space_1_all_with_restricted_fixture at space1': + expect(response.body).to.eql({ ...defaultSuccessfulResponse, total: 3 }); + expect(response.statusCode).to.eql(200); + for (const rule of rules) { + try { + await getScheduledTask(rule.body.scheduled_task_id); + throw new Error('Should have removed scheduled task'); + } catch (e) { + expect(e.meta.statusCode).to.eql(404); + } + } + break; + default: + throw new Error(`Scenario untested: ${JSON.stringify(scenario)}`); + } + }); + + it('should not delete rule from another space', async () => { + const { body: createdRule } = await supertest + .post(`${getUrlPrefix('other')}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send(getTestRuleData()) + .expect(200); + + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix('other')}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .auth(user.username, user.password) + .send({ ids: [createdRule.id] }); + + switch (scenario.id) { + // This superuser has more privileges that we think + case 'superuser at space1': + expect(response.body).to.eql(defaultSuccessfulResponse); + expect(response.statusCode).to.eql(200); + try { + await getScheduledTask(createdRule.scheduled_task_id); + throw new Error('Should have removed scheduled task'); + } catch (e) { + expect(e.meta.statusCode).to.eql(404); + } + break; + case 'global_read at space1': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to bulkDelete a "test.noop" rule for "alertsFixture"', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + objectRemover.add('other', createdRule.id, 'rule', 'alerting'); + await getScheduledTask(createdRule.scheduled_task_id); + break; + case 'no_kibana_privileges at space1': + case 'space_1_all at space2': + case 'space_1_all at space1': + case 'space_1_all_alerts_none_actions at space1': + case 'space_1_all_with_restricted_fixture at space1': + expect(response.body).to.eql({ + error: 'Forbidden', + message: 'Unauthorized to find rules for any rule types', + statusCode: 403, + }); + expect(response.statusCode).to.eql(403); + expect(response.statusCode).to.eql(403); + objectRemover.add('other', createdRule.id, 'rule', 'alerting'); + await getScheduledTask(createdRule.scheduled_task_id); + break; + default: + throw new Error(`Scenario untested: ${JSON.stringify(scenario)}`); + } + }); + }); + } + + describe('Validation tests', () => { + const { user, space } = SuperuserAtSpace1; + it('should throw an error when bulk delete of rules when both ids and filter supplied in payload', async () => { + const { body: createdRule1 } = await supertest + .post(`${getUrlPrefix(space.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send(getTestRuleData({ tags: ['foo'] })) + .expect(200); + + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({ filter: 'fake_filter', ids: [createdRule1.id] }) + .auth(user.username, user.password); + + expect(response.statusCode).to.eql(400); + expect(response.body.message).to.eql( + "Both 'filter' and 'ids' are supplied. Define either 'ids' or 'filter' properties in method's arguments" + ); + objectRemover.add(space.id, createdRule1.id, 'rule', 'alerting'); + await getScheduledTask(createdRule1.scheduled_task_id); + }); + + it('should return an error if we pass more than 1000 ids', async () => { + const ids = [...Array(1001)].map((_, i) => `rule${i}`); + + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({ ids }) + .auth(user.username, user.password); + + expect(response.body).to.eql({ + error: 'Bad Request', + message: '[request body.ids]: array size is [1001], but cannot be greater than [1000]', + statusCode: 400, + }); + }); + + it('should return an error if we do not pass any arguments', async () => { + await supertest + .post(`${getUrlPrefix(space.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send(getTestRuleData()) + .expect(200); + + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({}) + .auth(user.username, user.password); + + expect(response.body).to.eql({ + error: 'Bad Request', + message: "Either 'ids' or 'filter' property in method's arguments should be provided", + statusCode: 400, + }); + }); + + it('should return an error if we pass empty ids array', async () => { + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({ ids: [] }) + .auth(user.username, user.password); + + expect(response.body).to.eql({ + error: 'Bad Request', + message: '[request body.ids]: array size is [0], but cannot be smaller than [1]', + statusCode: 400, + }); + }); + + it('should return an error if we pass empty string instead of fiter', async () => { + const response = await supertestWithoutAuth + .patch(`${getUrlPrefix(space.id)}/internal/alerting/rules/_bulk_delete`) + .set('kbn-xsrf', 'foo') + .send({ filter: '' }) + .auth(user.username, user.password); + + expect(response.body).to.eql({ + error: 'Bad Request', + message: "Either 'ids' or 'filter' property in method's arguments should be provided", + statusCode: 400, + }); + }); + }); + }); +}; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/index.ts index 53b7e8e3fb2c0..6265cb7d34ff9 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/index.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/index.ts @@ -31,6 +31,7 @@ export default function alertingTests({ loadTestFile, getService }: FtrProviderC loadTestFile(require.resolve('./get_alert_summary')); loadTestFile(require.resolve('./rule_types')); loadTestFile(require.resolve('./bulk_edit')); + loadTestFile(require.resolve('./bulk_delete')); loadTestFile(require.resolve('./retain_api_key')); }); }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/get_all.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/get_all.ts index 69f618c804eb1..d4bfe3cbdd704 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/get_all.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/get_all.ts @@ -127,6 +127,14 @@ export default function getAllActionTests({ getService }: FtrProviderContext) { name: 'Test:_Preconfigured_Index_Record', referenced_by_count: 0, }, + { + id: 'my-test-email', + is_preconfigured: true, + is_deprecated: false, + connector_type_id: '.email', + name: 'TestEmail#xyz', + referenced_by_count: 0, + }, ]); break; default: @@ -262,6 +270,14 @@ export default function getAllActionTests({ getService }: FtrProviderContext) { name: 'Test:_Preconfigured_Index_Record', referenced_by_count: 0, }, + { + id: 'my-test-email', + is_preconfigured: true, + is_deprecated: false, + connector_type_id: '.email', + name: 'TestEmail#xyz', + referenced_by_count: 0, + }, ]); break; default: @@ -361,6 +377,14 @@ export default function getAllActionTests({ getService }: FtrProviderContext) { name: 'Test:_Preconfigured_Index_Record', referenced_by_count: 0, }, + { + id: 'my-test-email', + is_preconfigured: true, + is_deprecated: false, + connector_type_id: '.email', + name: 'TestEmail#xyz', + referenced_by_count: 0, + }, ]); break; default: diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/alerts.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/alerts.ts index 707fab5d57a3d..1dace147df4b3 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/alerts.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/alerts.ts @@ -144,7 +144,7 @@ export default function alertTests({ getService }: FtrProviderContext) { reference, }, alertInfo: { - alertId, + id: alertId, consumer: 'alertsFixture', spaceId: space.id, namespace: space.id, @@ -296,7 +296,7 @@ instanceStateValue: true reference, }, alertInfo: { - alertId, + id: alertId, consumer: 'alertsFixture', spaceId: space.id, namespace: space.id, @@ -428,7 +428,7 @@ instanceStateValue: true ['createdAt', 'updatedAt'] ); expect(alertSearchResultInfoWithoutDates).to.eql({ - alertId, + id: alertId, consumer: 'alertsFixture', spaceId: space.id, namespace: space.id, diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry.ts index b4cb36ab59d85..707f15534e663 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry.ts @@ -571,7 +571,7 @@ export default function createAlertingAndActionsTelemetryTests({ getService }: F expect(taskState).not.to.be(undefined); actionsTelemetry = JSON.parse(taskState!); expect(actionsTelemetry.runs).to.equal(2); - expect(actionsTelemetry.count_total).to.equal(19); + expect(actionsTelemetry.count_total).to.equal(20); }); // request alerting telemetry task to run diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/scenarios.ts b/x-pack/test/alerting_api_integration/security_and_spaces/scenarios.ts index ae8d52ecd5313..91d809bff04ca 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/scenarios.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/scenarios.ts @@ -196,7 +196,7 @@ const NoKibanaPrivilegesAtSpace1: NoKibanaPrivilegesAtSpace1 = { interface SuperuserAtSpace1 extends Scenario { id: 'superuser at space1'; } -const SuperuserAtSpace1: SuperuserAtSpace1 = { +export const SuperuserAtSpace1: SuperuserAtSpace1 = { id: 'superuser at space1', user: Superuser, space: Space1, diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/get_all.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/get_all.ts index 0632f48ed6e8d..7846c9512867e 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/get_all.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/get_all.ts @@ -115,6 +115,14 @@ export default function getAllActionTests({ getService }: FtrProviderContext) { name: 'Test:_Preconfigured_Index_Record', referenced_by_count: 0, }, + { + id: 'my-test-email', + is_preconfigured: true, + is_deprecated: false, + connector_type_id: '.email', + name: 'TestEmail#xyz', + referenced_by_count: 0, + }, ]); }); @@ -202,6 +210,14 @@ export default function getAllActionTests({ getService }: FtrProviderContext) { name: 'Test:_Preconfigured_Index_Record', referenced_by_count: 0, }, + { + id: 'my-test-email', + is_preconfigured: true, + is_deprecated: false, + connector_type_id: '.email', + name: 'TestEmail#xyz', + referenced_by_count: 0, + }, ]); }); @@ -302,6 +318,14 @@ export default function getAllActionTests({ getService }: FtrProviderContext) { name: 'Test:_Preconfigured_Index_Record', referencedByCount: 0, }, + { + id: 'my-test-email', + isPreconfigured: true, + isDeprecated: false, + actionTypeId: '.email', + name: 'TestEmail#xyz', + referencedByCount: 0, + }, ]); }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/index.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/index.ts index 866f13ed5294c..b4dbb42e8f993 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/index.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/index.ts @@ -28,6 +28,7 @@ export default function actionsTests({ loadTestFile, getService }: FtrProviderCo loadTestFile(require.resolve('./connector_types/stack/webhook')); loadTestFile(require.resolve('./connector_types/stack/preconfigured_alert_history_connector')); loadTestFile(require.resolve('./type_not_enabled')); + loadTestFile(require.resolve('./schedule_unsecured_action')); // note that this test will destroy existing spaces loadTestFile(require.resolve('./migrations')); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/schedule_unsecured_action.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/schedule_unsecured_action.ts new file mode 100644 index 0000000000000..9a5719b7fa700 --- /dev/null +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/schedule_unsecured_action.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 expect from '@kbn/expect'; +import type { SearchTotalHits } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { Spaces } from '../../scenarios'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; +import { getUrlPrefix, ObjectRemover } from '../../../common/lib'; + +// eslint-disable-next-line import/no-default-export +export default function createUnsecuredActionTests({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const kibanaServer = getService('kibanaServer'); + const es = getService('es'); + const retry = getService('retry'); + + describe('schedule unsecured action', () => { + const objectRemover = new ObjectRemover(supertest); + + // need to wait for kibanaServer to settle ... + before(() => { + kibanaServer.resolveUrl(`/api/sample_unsecured_action`); + }); + + after(() => objectRemover.removeAll()); + + it('should successfully schedule email action', async () => { + const testStart = new Date().toISOString(); + const { body: result } = await supertest + .post(`/api/sample_unsecured_action`) + .set('kbn-xsrf', 'xxx') + .send({ + requesterId: 'functional_tester', + id: 'my-test-email', + params: { + to: ['you@test.com'], + subject: 'hello from Kibana!', + message: 'does this work??', + }, + }) + .expect(200); + expect(result.status).to.eql('success'); + + await retry.try(async () => { + const searchResult = await es.search({ + index: '.kibana-event-log*', + body: { + query: { + bool: { + filter: [ + { + term: { + 'event.provider': { + value: 'actions', + }, + }, + }, + { + term: { + 'event.action': 'execute', + }, + }, + { + range: { + '@timestamp': { + gte: testStart, + }, + }, + }, + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + filter: [ + { + term: { + 'kibana.saved_objects.id': { + value: 'my-test-email', + }, + }, + }, + { + term: { + 'kibana.saved_objects.type': 'action', + }, + }, + ], + }, + }, + }, + }, + ], + }, + }, + }, + }); + expect((searchResult.hits.total as SearchTotalHits).value).to.eql(1); + + const hit = searchResult.hits.hits[0]; + // @ts-expect-error _source: unknown + expect(hit?._source?.event?.outcome).to.eql('success'); + // @ts-expect-error _source: unknown + expect(hit?._source?.message).to.eql( + `action executed: .email:my-test-email: TestEmail#xyz` + ); + }); + }); + + it('should not allow scheduling email action from unallowed requester', async () => { + const { body: result } = await supertest + .post(`/api/sample_unsecured_action`) + .set('kbn-xsrf', 'xxx') + .send({ + requesterId: 'not_allowed', + id: 'my-test-email', + params: { + to: ['you@test.com'], + subject: 'hello from Kibana!', + message: 'does this work??', + }, + }) + .expect(200); + expect(result.status).to.eql('error'); + expect(result.error).to.eql( + `Error: "not_allowed" feature is not allow-listed for UnsecuredActionsClient access.` + ); + }); + + it('should not allow scheduling action from unallowed connector types', async () => { + const { body: result } = await supertest + .post(`/api/sample_unsecured_action`) + .set('kbn-xsrf', 'xxx') + .send({ + requesterId: 'functional_tester', + id: 'my-slack1', + params: { + message: 'does this work??', + }, + }) + .expect(200); + expect(result.status).to.eql('error'); + expect(result.error).to.eql( + `Error: .slack actions cannot be scheduled for unsecured actions execution` + ); + }); + + it('should not allow scheduling action from non preconfigured connectors', async () => { + const response = await supertest + .post(`${getUrlPrefix(Spaces.space1.id)}/api/actions/connector`) + .set('kbn-xsrf', 'foo') + .send({ + name: 'My email action', + connector_type_id: '.email', + config: { + from: 'me@test.com', + service: '__json', + }, + secrets: { + user: 'user', + password: 'password', + }, + }); + expect(response.status).to.eql(200); + + const connectorId = response.body.id; + objectRemover.add(Spaces.space1.id, connectorId, 'action', 'actions'); + const { body: result } = await supertest + .post(`/api/sample_unsecured_action`) + .set('kbn-xsrf', 'xxx') + .send({ + requesterId: 'functional_tester', + id: connectorId, + params: { + to: ['you@test.com'], + subject: 'hello from Kibana!', + message: 'does this work??', + }, + }) + .expect(200); + expect(result.status).to.eql('error'); + expect(result.error).to.eql( + `Error: ${connectorId} are not preconfigured connectors and can't be scheduled for unsecured actions execution` + ); + }); + }); +} diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/alerts_base.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/alerts_base.ts index 53cb0a1f662ce..a0f3e48ed9c0e 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/alerts_base.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/alerts_base.ts @@ -98,7 +98,7 @@ export function alertTests({ getService }: FtrProviderContext, space: Space) { reference, }, alertInfo: { - alertId, + id: alertId, consumer: 'alertsFixture', spaceId: space.id, namespace: space.namespace, diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts index 86ea7a9c3a18e..abb3b8b43f02b 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts @@ -37,7 +37,8 @@ export default function ruleTests({ getService }: FtrProviderContext) { createEsDocumentsInGroups, } = getRuleServices(getService); - describe('rule', async () => { + // Failing: See https://github.com/elastic/kibana/issues/143870 + describe.skip('rule', async () => { let endDate: string; let connectorId: string; const objectRemover = new ObjectRemover(supertest); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/check_registered_rule_types.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/check_registered_rule_types.ts new file mode 100644 index 0000000000000..84fdcb7bbe95b --- /dev/null +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/check_registered_rule_types.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 expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; + +// eslint-disable-next-line import/no-default-export +export default function createRegisteredRuleTypeTests({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + + // This test is intended to fail when new rule types are registered. + // To resolve, add the new rule type ID to this list. This will trigger + // a CODEOWNERS review by Response Ops. + describe('check registered rule types', () => { + it('should list all registered rule types', async () => { + const registeredRuleTypes = await supertest + .get('/api/alerts_fixture/registered_rule_types') + .expect(200) + .then((response) => response.body); + + expect( + registeredRuleTypes.filter((ruleType: string) => !ruleType.startsWith('test.')) + ).to.eql([ + 'example.always-firing', + 'transform_health', + '.index-threshold', + '.geo-containment', + '.es-query', + 'xpack.ml.anomaly_detection_alert', + 'xpack.ml.anomaly_detection_jobs_health', + 'xpack.uptime.alerts.monitorStatus', + 'xpack.uptime.alerts.tlsCertificate', + 'xpack.uptime.alerts.durationAnomaly', + 'xpack.uptime.alerts.tls', + 'siem.eqlRule', + 'siem.savedQueryRule', + 'siem.indicatorRule', + 'siem.mlRule', + 'siem.queryRule', + 'siem.thresholdRule', + 'siem.newTermsRule', + 'siem.notifications', + 'metrics.alert.anomaly', + 'logs.alert.document.count', + 'metrics.alert.inventory.threshold', + 'metrics.alert.threshold', + 'monitoring_alert_cluster_health', + 'monitoring_alert_license_expiration', + 'monitoring_alert_cpu_usage', + 'monitoring_alert_missing_monitoring_data', + 'monitoring_alert_disk_usage', + 'monitoring_alert_thread_pool_search_rejections', + 'monitoring_alert_thread_pool_write_rejections', + 'monitoring_alert_jvm_memory_usage', + 'monitoring_alert_nodes_changed', + 'monitoring_alert_logstash_version_mismatch', + 'monitoring_alert_kibana_version_mismatch', + 'monitoring_alert_elasticsearch_version_mismatch', + 'monitoring_ccr_read_exceptions', + 'monitoring_shard_size', + 'apm.transaction_duration', + 'apm.anomaly', + 'apm.error_rate', + 'apm.transaction_error_rate', + ]); + }); + }); +} diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/disable.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/disable.ts index d4149c9cf2fb8..dab57143e0b6d 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/disable.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/disable.ts @@ -26,7 +26,8 @@ export default function createDisableRuleTests({ getService }: FtrProviderContex const retry = getService('retry'); const supertest = getService('supertest'); - describe('disable', () => { + // Failing: See https://github.com/elastic/kibana/issues/141864 + describe.skip('disable', () => { const objectRemover = new ObjectRemover(supertestWithoutAuth); const ruleUtils = new RuleUtils({ space: Spaces.space1, supertestWithoutAuth }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/index.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/index.ts index e09cf3121adec..d0981fbc1e93a 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/index.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/index.ts @@ -50,6 +50,7 @@ export default function alertingTests({ loadTestFile, getService }: FtrProviderC loadTestFile(require.resolve('./capped_action_type')); loadTestFile(require.resolve('./scheduled_task_id')); loadTestFile(require.resolve('./run_soon')); + loadTestFile(require.resolve('./check_registered_rule_types')); // Do not place test files here, due to https://github.com/elastic/kibana/issues/123059 // note that this test will destroy existing spaces diff --git a/x-pack/test/api_integration/apis/aiops/explain_log_rate_spikes.ts b/x-pack/test/api_integration/apis/aiops/explain_log_rate_spikes.ts index 2804fc3fc3e0e..79c5be4a93a34 100644 --- a/x-pack/test/api_integration/apis/aiops/explain_log_rate_spikes.ts +++ b/x-pack/test/api_integration/apis/aiops/explain_log_rate_spikes.ts @@ -34,8 +34,8 @@ export default ({ getService }: FtrProviderContext) => { }; const expected = { - chunksLength: 13, - actionsLength: 12, + chunksLength: 34, + actionsLength: 33, noIndexChunksLength: 4, noIndexActionsLength: 3, changePointFilter: 'add_change_points', @@ -276,7 +276,7 @@ export default ({ getService }: FtrProviderContext) => { const errorActions = data.filter((d) => d.type === expected.errorFilter); expect(errorActions.length).to.be(1); - expect(errorActions[0].payload).to.be('Failed to fetch field candidates.'); + expect(errorActions[0].payload).to.be('Failed to fetch index information.'); }); }); }; diff --git a/x-pack/test/api_integration/apis/index.ts b/x-pack/test/api_integration/apis/index.ts index 56c546e1349cd..0278c439c5995 100644 --- a/x-pack/test/api_integration/apis/index.ts +++ b/x-pack/test/api_integration/apis/index.ts @@ -22,6 +22,7 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./console')); loadTestFile(require.resolve('./management')); loadTestFile(require.resolve('./uptime')); + loadTestFile(require.resolve('./synthetics')); loadTestFile(require.resolve('./maps')); loadTestFile(require.resolve('./security_solution')); loadTestFile(require.resolve('./transform')); diff --git a/x-pack/test/api_integration/apis/metrics_ui/create_fake_logger.ts b/x-pack/test/api_integration/apis/metrics_ui/create_fake_logger.ts index b99ee3de96a43..ae591c51e767b 100644 --- a/x-pack/test/api_integration/apis/metrics_ui/create_fake_logger.ts +++ b/x-pack/test/api_integration/apis/metrics_ui/create_fake_logger.ts @@ -22,5 +22,6 @@ export const createFakeLogger = (log: ToolingLog) => { fatal: fakeLogger, log: sinon.stub(), get: sinon.stub(), + isLevelEnabled: sinon.stub(), } as Logger; }; diff --git a/x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts b/x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts index 5d6f38b368f2e..603eecd6a8b65 100644 --- a/x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts +++ b/x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts @@ -125,6 +125,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -174,6 +175,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'web' }, }, }, ]); @@ -206,7 +208,7 @@ export default function ({ getService }: FtrProviderContext) { logger, void 0, timeFrame, - ['middleware'] + [{ key: 'middleware', bucketKey: { groupBy0: 'middleware' } }] ); expect(results).to.eql([ { @@ -222,6 +224,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'web' }, }, middleware: { timeSize: 5, @@ -235,6 +238,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'middleware' }, }, }, ]); @@ -281,6 +285,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -312,6 +317,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -358,6 +364,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -388,7 +395,10 @@ export default function ({ getService }: FtrProviderContext) { logger, void 0, timeFrame, - ['web', 'prod'] + [ + { key: 'web', bucketKey: { groupBy0: 'web' } }, + { key: 'prod', bucketKey: { groupBy0: 'prod' } }, + ] ); expect(results).to.eql([ { @@ -404,6 +414,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, web: { timeSize: 5, @@ -417,6 +428,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'web' }, }, prod: { timeSize: 5, @@ -430,6 +442,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'prod' }, }, }, ]); @@ -480,6 +493,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -522,6 +536,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -553,6 +568,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -598,6 +614,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'dev' }, }, prod: { timeSize: 5, @@ -611,6 +628,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'prod' }, }, }, ]); @@ -645,6 +663,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'prod' }, }, }, ]); @@ -665,7 +684,7 @@ export default function ({ getService }: FtrProviderContext) { logger, void 0, timeFrame, - ['dev'] + [{ key: 'dev', bucketKey: { groupBy0: 'dev' } }] ); expect(results).to.eql([ { @@ -681,12 +700,13 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'dev' }, }, }, ]); }); - it('should NOT resport any alerts when missing group recovers', async () => { + it('should NOT report any alerts when missing group recovers', async () => { const params = { ...baseParams, criteria: [ @@ -711,7 +731,7 @@ export default function ({ getService }: FtrProviderContext) { logger, moment(gauge.midpoint).subtract(1, 'm').valueOf(), timeFrame, - ['dev'] + [{ key: 'dev', bucketKey: { groupBy0: 'dev' } }] ); expect(results).to.eql([{}]); }); @@ -746,6 +766,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'prod' }, }, dev: { timeSize: 5, @@ -759,6 +780,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'dev' }, }, }, ]); @@ -807,6 +829,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -851,6 +874,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -901,6 +925,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: true, isNoData: false, + bucketKey: { groupBy0: 'dev' }, }, }, ]); diff --git a/x-pack/test/api_integration/apis/security_solution/timeline_migrations.ts b/x-pack/test/api_integration/apis/security_solution/timeline_migrations.ts index 47c6e28d9bab7..fe47677040d73 100644 --- a/x-pack/test/api_integration/apis/security_solution/timeline_migrations.ts +++ b/x-pack/test/api_integration/apis/security_solution/timeline_migrations.ts @@ -36,6 +36,8 @@ export default function ({ getService }: FtrProviderContext) { describe('Timeline migrations', () => { const esArchiver = getService('esArchiver'); const es = getService('es'); + const kibanaServer = getService('kibanaServer'); + const spacesService = getService('spaces'); describe('8.0 id migration', () => { const resolveWithSpaceApi = '/s/awesome-space/api/timeline/resolve'; @@ -44,14 +46,14 @@ export default function ({ getService }: FtrProviderContext) { await esArchiver.load( 'x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space' ); - }); - - after(async () => { - await esArchiver.unload( - 'x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space' + await kibanaServer.importExport.load( + 'x-pack/test/functional/fixtures/kbn_archiver/security_solution/timelines/7.15.0_space', + { space: 'awesome-space' } ); }); + after(async () => await spacesService.delete('awesome-space')); + describe('resolve', () => { it('should return an aliasMatch outcome', async () => { const resp = await supertest diff --git a/x-pack/test/api_integration/apis/uptime/rest/add_monitor.ts b/x-pack/test/api_integration/apis/synthetics/add_monitor.ts similarity index 96% rename from x-pack/test/api_integration/apis/uptime/rest/add_monitor.ts rename to x-pack/test/api_integration/apis/synthetics/add_monitor.ts index f96479a50bc6f..e736a5cf79306 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/add_monitor.ts +++ b/x-pack/test/api_integration/apis/synthetics/add_monitor.ts @@ -4,9 +4,9 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import expect from '@kbn/expect'; import uuid from 'uuid'; import { omit } from 'lodash'; -import expect from '@kbn/expect'; import { secretKeys } from '@kbn/synthetics-plugin/common/constants/monitor_management'; import { ConfigKey, DataStream, HTTPFields } from '@kbn/synthetics-plugin/common/runtime_types'; import { formatKibanaNamespace } from '@kbn/synthetics-plugin/common/formatters'; @@ -15,10 +15,11 @@ import { DEFAULT_FIELDS } from '@kbn/synthetics-plugin/common/constants/monitor_ import { ALL_SPACES_ID } from '@kbn/security-plugin/common/constants'; import { syntheticsMonitorType } from '@kbn/synthetics-plugin/server/legacy_uptime/lib/saved_objects/synthetics_monitor'; import { format as formatUrl } from 'url'; + import supertest from 'supertest'; import { serviceApiKeyPrivileges } from '@kbn/synthetics-plugin/server/synthetics_service/get_api_key'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { getFixtureJson } from './helper/get_fixture_json'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { getFixtureJson } from '../uptime/rest/helper/get_fixture_json'; export default function ({ getService }: FtrProviderContext) { describe('AddNewMonitors', function () { @@ -48,7 +49,16 @@ export default function ({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'true') .send(newMonitor); - expect(apiResponse.body.attributes).eql(omit(newMonitor, secretKeys)); + expect(apiResponse.body.attributes).eql( + omit( + { + ...newMonitor, + [ConfigKey.MONITOR_QUERY_ID]: apiResponse.body.id, + [ConfigKey.CONFIG_ID]: apiResponse.body.id, + }, + secretKeys + ) + ); }); it('returns bad request if payload is invalid for HTTP monitor', async () => { @@ -106,6 +116,8 @@ export default function ({ getService }: FtrProviderContext) { { ...DEFAULT_FIELDS[DataStream.HTTP], ...newMonitor, + [ConfigKey.MONITOR_QUERY_ID]: apiResponse.body.id, + [ConfigKey.CONFIG_ID]: apiResponse.body.id, revision: 1, }, secretKeys diff --git a/x-pack/test/api_integration/apis/uptime/rest/add_monitor_private_location.ts b/x-pack/test/api_integration/apis/synthetics/add_monitor_private_location.ts similarity index 92% rename from x-pack/test/api_integration/apis/uptime/rest/add_monitor_private_location.ts rename to x-pack/test/api_integration/apis/synthetics/add_monitor_private_location.ts index 12ef5ac975406..e4835644bd935 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/add_monitor_private_location.ts +++ b/x-pack/test/api_integration/apis/synthetics/add_monitor_private_location.ts @@ -5,16 +5,16 @@ * 2.0. */ import uuid from 'uuid'; -import expect from '@kbn/expect'; import { ConfigKey, HTTPFields } from '@kbn/synthetics-plugin/common/runtime_types'; import { API_URLS } from '@kbn/synthetics-plugin/common/constants'; import { formatKibanaNamespace } from '@kbn/synthetics-plugin/common/formatters'; import { omit } from 'lodash'; import { secretKeys } from '@kbn/synthetics-plugin/common/constants/monitor_management'; import { PackagePolicy } from '@kbn/fleet-plugin/common'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { getFixtureJson } from './helper/get_fixture_json'; -import { comparePolicies, getTestSyntheticsPolicy } from './sample_data/test_policy'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { getFixtureJson } from '../uptime/rest/helper/get_fixture_json'; +import { comparePolicies, getTestSyntheticsPolicy } from '../uptime/rest/sample_data/test_policy'; import { PrivateLocationTestService } from './services/private_location_test_service'; export default function ({ getService }: FtrProviderContext) { @@ -100,7 +100,16 @@ export default function ({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'true') .send(newMonitor); - expect(apiResponse.body.attributes).eql(omit(newMonitor, secretKeys)); + expect(apiResponse.body.attributes).eql( + omit( + { + ...newMonitor, + [ConfigKey.MONITOR_QUERY_ID]: apiResponse.body.id, + [ConfigKey.CONFIG_ID]: apiResponse.body.id, + }, + secretKeys + ) + ); newMonitorId = apiResponse.body.id; }); @@ -266,7 +275,15 @@ export default function ({ getService }: FtrProviderContext) { .expect(200); expect(apiResponse.body.attributes).eql( - omit({ ...monitor, [ConfigKey.NAMESPACE]: formatKibanaNamespace(SPACE_ID) }, secretKeys) + omit( + { + ...monitor, + [ConfigKey.MONITOR_QUERY_ID]: apiResponse.body.id, + [ConfigKey.CONFIG_ID]: apiResponse.body.id, + [ConfigKey.NAMESPACE]: formatKibanaNamespace(SPACE_ID), + }, + secretKeys + ) ); monitorId = apiResponse.body.id; diff --git a/x-pack/test/api_integration/apis/synthetics/add_monitor_project.ts b/x-pack/test/api_integration/apis/synthetics/add_monitor_project.ts new file mode 100644 index 0000000000000..7911beea80a6e --- /dev/null +++ b/x-pack/test/api_integration/apis/synthetics/add_monitor_project.ts @@ -0,0 +1,1442 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import uuid from 'uuid'; +import expect from '@kbn/expect'; +import { ConfigKey, ProjectMonitorsRequest } from '@kbn/synthetics-plugin/common/runtime_types'; +import { API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { formatKibanaNamespace } from '@kbn/synthetics-plugin/common/formatters'; +import { syntheticsMonitorType } from '@kbn/synthetics-plugin/server/legacy_uptime/lib/saved_objects/synthetics_monitor'; +import { REQUEST_TOO_LARGE } from '@kbn/synthetics-plugin/server/routes/monitor_cruds/add_monitor_project'; +import { PackagePolicy } from '@kbn/fleet-plugin/common'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { getFixtureJson } from '../uptime/rest/helper/get_fixture_json'; +import { PrivateLocationTestService } from './services/private_location_test_service'; +import { + comparePolicies, + getTestProjectSyntheticsPolicy, +} from '../uptime/rest/sample_data/test_policy'; + +export default function ({ getService }: FtrProviderContext) { + describe('AddProjectMonitors', function () { + this.tags('skipCloud'); + + const supertest = getService('supertest'); + const supertestWithoutAuth = getService('supertestWithoutAuth'); + const security = getService('security'); + const kibanaServer = getService('kibanaServer'); + + let projectMonitors: ProjectMonitorsRequest; + let httpProjectMonitors: ProjectMonitorsRequest; + let tcpProjectMonitors: ProjectMonitorsRequest; + let icmpProjectMonitors: ProjectMonitorsRequest; + + let testPolicyId = ''; + const testPrivateLocations = new PrivateLocationTestService(getService); + + const setUniqueIds = (request: ProjectMonitorsRequest) => { + return { + ...request, + monitors: request.monitors.map((monitor) => ({ ...monitor, id: uuid.v4() })), + }; + }; + + const deleteMonitor = async ( + journeyId: string, + projectId: string, + space: string = 'default' + ) => { + try { + const response = await supertest + .get(`/s/${space}${API_URLS.SYNTHETICS_MONITORS}`) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: "${journeyId}" AND ${syntheticsMonitorType}.attributes.project_id: "${projectId}"`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + const { monitors } = response.body; + if (monitors[0]?.id) { + await supertest + .delete(`/s/${space}${API_URLS.SYNTHETICS_MONITORS}/${monitors[0].id}`) + .set('kbn-xsrf', 'true') + .send(projectMonitors) + .expect(200); + } + } catch (e) { + // eslint-disable-next-line no-console + console.error(e); + } + }; + + before(async () => { + await supertest.post('/api/fleet/setup').set('kbn-xsrf', 'true').send().expect(200); + await supertest + .post('/api/fleet/epm/packages/synthetics/0.10.3') + .set('kbn-xsrf', 'true') + .send({ force: true }) + .expect(200); + + const testPolicyName = 'Fleet test server policy' + Date.now(); + const apiResponse = await testPrivateLocations.addFleetPolicy(testPolicyName); + testPolicyId = apiResponse.body.item.id; + await testPrivateLocations.setTestLocations([testPolicyId]); + }); + + beforeEach(() => { + projectMonitors = setUniqueIds({ + monitors: getFixtureJson('project_browser_monitor').monitors, + }); + httpProjectMonitors = setUniqueIds({ + monitors: getFixtureJson('project_http_monitor').monitors, + }); + tcpProjectMonitors = setUniqueIds({ + monitors: getFixtureJson('project_tcp_monitor').monitors, + }); + icmpProjectMonitors = setUniqueIds({ + monitors: getFixtureJson('project_icmp_monitor').monitors, + }); + }); + + it('project monitors - handles browser monitors', async () => { + const successfulMonitors = [projectMonitors.monitors[0]]; + const project = `test-project-${uuid.v4()}`; + + try { + const { body } = await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .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(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set('kbn-xsrf', 'true') + .expect(200); + + const decryptedCreatedMonitor = await supertest + .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) + .set('kbn-xsrf', 'true') + .expect(200); + + expect(decryptedCreatedMonitor.body.attributes).to.eql({ + __ui: { + is_zip_url_tls_enabled: false, + script_source: { + file_name: '', + is_generated_script: false, + }, + }, + config_id: decryptedCreatedMonitor.body.id, + custom_heartbeat_id: `${journeyId}-${project}-default`, + 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: 'localhost', + isInvalid: false, + isServiceManaged: true, + label: 'Local Synthetics Service', + status: 'experimental', + url: 'mockDevUrl', + }, + ], + 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': '', + 'source.zip_url.folder': '', + 'source.zip_url.proxy_url': '', + 'source.zip_url.url': '', + 'source.zip_url.password': '', + 'source.zip_url.username': '', + synthetics_args: [], + tags: [], + 'throttling.config': '5d/3u/20l', + 'throttling.download_speed': '5', + 'throttling.is_enabled': true, + 'throttling.latency': '20', + 'throttling.upload_speed': '3', + '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', + }); + } + } 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-${uuid.v4()}`; + + try { + const { body } = await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send(httpProjectMonitors) + .expect(200); + + expect(body).eql({ + updatedMonitors: [], + createdMonitors: successfulMonitors.map((monitor) => monitor.id), + failedMonitors: [ + { + id: httpProjectMonitors.monitors[0].id, + details: `Multiple urls are not supported for http project monitors in ${kibanaVersion}. Please set only 1 url per monitor. You monitor was not created or updated.`, + reason: 'Unsupported Heartbeat option', + }, + { + 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 createdMonitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set('kbn-xsrf', 'true') + .expect(200); + + const decryptedCreatedMonitor = await supertest + .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) + .set('kbn-xsrf', 'true') + .expect(200); + + expect(decryptedCreatedMonitor.body.attributes).to.eql({ + __ui: { + is_tls_enabled: false, + }, + 'check.request.method': 'POST', + 'check.response.status': ['200'], + config_id: decryptedCreatedMonitor.body.id, + custom_heartbeat_id: `${journeyId}-${project}-default`, + 'check.response.body.negative': [], + 'check.response.body.positive': ['Saved', 'saved'], + 'check.response.headers': {}, + 'check.request.body': { + type: 'text', + value: '', + }, + 'check.request.headers': { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + enabled: false, + form_monitor_type: 'http', + journey_id: journeyId, + locations: [ + { + geo: { + lat: 0, + lon: 0, + }, + id: 'localhost', + isInvalid: false, + isServiceManaged: true, + label: 'Local Synthetics Service', + status: 'experimental', + url: 'mockDevUrl', + }, + ], + max_redirects: '0', + name: monitor.name, + namespace: 'default', + origin: 'project', + original_space: 'default', + project_id: project, + username: '', + password: '', + proxy_url: '', + 'response.include_body': 'always', + 'response.include_headers': false, + 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': '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', + }); + } + } 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-${uuid.v4()}`; + + try { + const { body } = await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send(tcpProjectMonitors) + .expect(200); + + expect(body).eql({ + updatedMonitors: [], + createdMonitors: successfulMonitors.map((monitor) => monitor.id), + failedMonitors: [ + { + id: tcpProjectMonitors.monitors[2].id, + details: `Multiple hosts are not supported for tcp project monitors in ${kibanaVersion}. Please set only 1 host per monitor. You monitor was not created or updated.`, + reason: 'Unsupported Heartbeat option', + }, + { + 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 createdMonitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set('kbn-xsrf', 'true') + .expect(200); + + const decryptedCreatedMonitor = await supertest + .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) + .set('kbn-xsrf', 'true') + .expect(200); + + expect(decryptedCreatedMonitor.body.attributes).to.eql({ + __ui: { + is_tls_enabled: false, + }, + config_id: decryptedCreatedMonitor.body.id, + custom_heartbeat_id: `${journeyId}-${project}-default`, + 'check.receive': '', + 'check.send': '', + enabled: true, + form_monitor_type: 'tcp', + journey_id: journeyId, + locations: [ + { + geo: { + lat: 0, + lon: 0, + }, + id: 'localhost', + isInvalid: false, + isServiceManaged: true, + label: 'Local Synthetics Service', + status: 'experimental', + url: 'mockDevUrl', + }, + ], + 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': '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', + }); + } + } 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-${uuid.v4()}`; + + try { + const { body } = await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send(icmpProjectMonitors) + .expect(200); + expect(body).eql({ + updatedMonitors: [], + createdMonitors: successfulMonitors.map((monitor) => monitor.id), + failedMonitors: [ + { + id: icmpProjectMonitors.monitors[2].id, + details: `Multiple hosts are not supported for icmp project monitors in ${kibanaVersion}. Please set only 1 host per monitor. You monitor was not created or updated.`, + reason: 'Unsupported Heartbeat option', + }, + { + 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(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set('kbn-xsrf', 'true') + .expect(200); + + const decryptedCreatedMonitor = await supertest + .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) + .set('kbn-xsrf', 'true') + .expect(200); + + expect(decryptedCreatedMonitor.body.attributes).to.eql({ + config_id: decryptedCreatedMonitor.body.id, + custom_heartbeat_id: `${journeyId}-${project}-default`, + enabled: true, + form_monitor_type: 'icmp', + journey_id: journeyId, + locations: [ + { + geo: { + lat: 0, + lon: 0, + }, + id: 'localhost', + isInvalid: false, + isServiceManaged: true, + label: 'Local Synthetics Service', + status: 'experimental', + url: 'mockDevUrl', + }, + { + agentPolicyId: testPolicyId, + concurrentMonitors: 1, + geo: { + lat: '', + lon: '', + }, + id: testPolicyId, + isInvalid: false, + isServiceManaged: false, + label: 'Test private location 0', + }, + ], + 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', + }); + } + } 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-${uuid.v4()}`; + try { + const { body } = await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .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-${uuid.v4()}`; + + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send(projectMonitors) + .expect(200); + const { body } = await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .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-${uuid.v4()}`; + + try { + const { body } = await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .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: ['localhost'], + 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', + }, + reason: 'Failed to save or update monitor. Configuration is not valid', + }, + ], + 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-${uuid.v4()}`; + const username = 'admin'; + const roleName = `synthetics_admin`; + const password = `${username}-password`; + const SPACE_ID = `test-space-${uuid.v4()}`; + const SPACE_NAME = `test-space-name ${uuid.v4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + try { + await security.role.create(roleName, { + kibana: [ + { + feature: { + uptime: ['all'], + }, + spaces: ['*'], + }, + ], + }); + await security.user.create(username, { + password, + roles: [roleName], + full_name: 'a kibana user', + }); + await supertestWithoutAuth + .put( + `/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .auth(username, password) + .set('kbn-xsrf', 'true') + .send(projectMonitors) + .expect(200); + // expect monitor not to have been deleted + const getResponse = await supertestWithoutAuth + .get(`/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS}`) + .auth(username, password) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + expect(monitors[0].attributes[ConfigKey.NAMESPACE]).eql(formatKibanaNamespace(SPACE_ID)); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project, SPACE_ID); + await security.user.delete(username); + await security.role.delete(roleName); + } + }); + + it('project monitors - formats custom id appropriately', async () => { + const project = `test project ${uuid.v4()}`; + const username = 'admin'; + const roleName = `synthetics_admin`; + const password = `${username}-password`; + const SPACE_ID = `test-space-${uuid.v4()}`; + const SPACE_NAME = `test-space-name ${uuid.v4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + try { + await security.role.create(roleName, { + kibana: [ + { + feature: { + uptime: ['all'], + }, + spaces: ['*'], + }, + ], + }); + await security.user.create(username, { + password, + roles: [roleName], + full_name: 'a kibana user', + }); + await supertestWithoutAuth + .put( + `/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .auth(username, password) + .set('kbn-xsrf', 'true') + .send(projectMonitors) + .expect(200); + const getResponse = await supertestWithoutAuth + .get(`/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS}`) + .auth(username, password) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + expect(monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]).eql( + `${projectMonitors.monitors[0].id}-${project}-${SPACE_ID}` + ); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project, SPACE_ID); + await security.user.delete(username); + await security.role.delete(roleName); + } + }); + + it('project monitors - is able to decrypt monitor when updated after hydration', async () => { + const project = `test-project-${uuid.v4()}`; + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send(projectMonitors) + .expect(200); + + const response = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const { monitors } = response.body; + + // add urls and ports to mimic hydration + const updates = { + [ConfigKey.URLS]: 'https://modified-host.com', + [ConfigKey.PORT]: 443, + }; + + const modifiedMonitor = { ...monitors[0]?.attributes, ...updates }; + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS + '/' + monitors[0]?.id) + .set('kbn-xsrf', 'true') + .send(modifiedMonitor) + .expect(200); + + // update project monitor via push api + const { body } = await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send(projectMonitors) + .expect(200); + + expect(body).eql({ + updatedMonitors: [projectMonitors.monitors[0].id], + createdMonitors: [], + failedMonitors: [], + }); + + // ensure that monitor can still be decrypted + await supertest + .get(API_URLS.SYNTHETICS_MONITORS + '/' + monitors[0]?.id) + .set('kbn-xsrf', 'true') + .expect(200); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - is able to enable and disable monitors', async () => { + const project = `test-project-${uuid.v4()}`; + + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send(projectMonitors); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [ + { + ...projectMonitors.monitors[0], + enabled: false, + }, + ], + }) + .expect(200); + const response = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + const { monitors } = response.body; + expect(monitors[0].attributes.enabled).eql(false); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - returns a failed monitor when user defines a private location without fleet permissions', async () => { + const project = `test-project-${uuid.v4()}`; + + const secondMonitor = { + ...projectMonitors.monitors[0], + id: 'test-id-2', + privateLocations: ['Test private location 0'], + }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + const username = 'admin'; + const roleName = 'uptime read only'; + const password = `${username}-password`; + try { + await security.role.create(roleName, { + kibana: [ + { + feature: { + uptime: ['all'], + }, + spaces: ['*'], + }, + ], + }); + await security.user.create(username, { + password, + roles: [roleName], + full_name: 'a kibana user', + }); + + const { body } = await supertestWithoutAuth + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .auth(username, password) + .set('kbn-xsrf', 'true') + .send({ monitors: testMonitors }) + .expect(200); + + expect(body).eql({ + createdMonitors: [testMonitors[0].id], + updatedMonitors: [], + failedMonitors: [ + { + details: + 'Insufficient permissions. In order to configure private locations, you must have Fleet and Integrations write permissions. To resolve, please generate a new API key with a user who has Fleet and Integrations write permissions.', + id: 'test-id-2', + payload: { + content: + 'UEsDBBQACAAIAON5qVQAAAAAAAAAAAAAAAAfAAAAZXhhbXBsZXMvdG9kb3MvYmFzaWMuam91cm5leS50c22Q0WrDMAxF3/sVF7MHB0LMXlc6RvcN+wDPVWNviW0sdUsp/fe5SSiD7UFCWFfHujIGlpnkybwxFTZfoY/E3hsaLEtwhs9RPNWKDU12zAOxkXRIbN4tB9d9pFOJdO6EN2HMqQguWN9asFBuQVMmJ7jiWNII9fIXrbabdUYr58l9IhwhQQZCYORCTFFUC31Btj21NRc7Mq4Nds+4bDD/pNVgT9F52Jyr2Fa+g75LAPttg8yErk+S9ELpTmVotlVwnfNCuh2lepl3+JflUmSBJ3uggt1v9INW/lHNLKze9dJe1J3QJK8pSvWkm6aTtCet5puq+x63+AFQSwcIAPQ3VfcAAACcAQAAUEsBAi0DFAAIAAgA43mpVAD0N1X3AAAAnAEAAB8AAAAAAAAAAAAgAKSBAAAAAGV4YW1wbGVzL3RvZG9zL2Jhc2ljLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBNAAAARAEAAAAA', + filter: { + match: 'check if title is present', + }, + id: 'test-id-2', + locations: ['localhost'], + name: 'check if title is present', + params: {}, + playwrightOptions: { + chromiumSandbox: false, + headless: true, + }, + privateLocations: ['Test private location 0'], + schedule: 10, + tags: [], + throttling: { + download: 5, + latency: 20, + upload: 3, + }, + hash: 'ekrjelkjrelkjre', + }, + reason: 'Failed to create or update monitor', + }, + ], + }); + } finally { + await Promise.all([ + testMonitors.map((monitor) => { + return deleteMonitor(monitor.id, project, 'default'); + }), + ]); + await security.user.delete(username); + await security.role.delete(roleName); + } + }); + + it('project monitors - returns a successful monitor when user defines a private location with fleet permissions', async () => { + const project = `test-project-${uuid.v4()}`; + const secondMonitor = { + ...projectMonitors.monitors[0], + id: 'test-id-2', + privateLocations: ['Test private location 0'], + }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + const username = 'admin'; + const roleName = 'uptime with fleet'; + const password = `${username}-password`; + try { + await security.role.create(roleName, { + kibana: [ + { + feature: { + uptime: ['all'], + fleetv2: ['all'], + fleet: ['all'], + }, + spaces: ['*'], + }, + ], + }); + await security.user.create(username, { + password, + roles: [roleName], + full_name: 'a kibana user', + }); + const { body } = await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send({ monitors: testMonitors }) + .expect(200); + + expect(body).to.eql({ + createdMonitors: [testMonitors[0].id, 'test-id-2'], + updatedMonitors: [], + failedMonitors: [], + }); + } finally { + await Promise.all([ + testMonitors.map((monitor) => { + return deleteMonitor(monitor.id, project, 'default'); + }), + ]); + await security.user.delete(username); + await security.role.delete(roleName); + } + }); + + it('creates integration policies for project monitors with private locations', async () => { + const project = `test-project-${uuid.v4()}`; + + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [ + { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, + ], + }) + .expect(200); + + const monitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + expect(packagePolicy.name).eql( + `${projectMonitors.monitors[0].id}-${project}-default-Test private location 0` + ); + expect(packagePolicy.policy_id).eql(testPolicyId); + + const configId = monitorsResponse.body.monitors[0].id; + const id = monitorsResponse.body.monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicy({ + inputs: {}, + name: 'check if title is present-Test private location 0', + id, + configId, + projectId: project, + }) + ); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project); + + const packagesResponse = await supertest.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-${uuid.v4()}`; + + const monitorRequest = { + monitors: [ + { ...httpProjectMonitors.monitors[1], privateLocations: ['Test private location 0'] }, + ], + }; + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send(monitorRequest) + .expect(200); + + const monitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitorRequest.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + + expect(packagePolicy.policy_id).eql(testPolicyId); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send({ + monitors: [{ ...monitorRequest.monitors[0], privateLocations: [] }], + }) + .expect(200); + + const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + + 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-${uuid.v4()}`; + + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send({ + monitors: [ + { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, + ], + }) + .expect(200); + + const monitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + + expect(packagePolicy.policy_id).eql(testPolicyId); + + const configId = monitorsResponse.body.monitors[0].id; + const id = monitorsResponse.body.monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicy({ + inputs: {}, + name: 'check if title is present-Test private location 0', + id, + configId, + projectId: project, + }) + ); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send({ + monitors: [{ ...projectMonitors.monitors[0], privateLocations: [] }], + }) + .expect(200); + + const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + + expect(packagePolicy2).eql(undefined); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project); + + const apiResponsePolicy2 = await supertest.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-${uuid.v4()}`; + + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send({ + monitors: [ + { + ...projectMonitors.monitors[0], + privateLocations: ['Test private location 0'], + }, + ], + }); + + const monitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; + const policyId = `${id}-${testPolicyId}`; + + const packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => pkgPolicy.id === policyId + ); + + expect(packagePolicy.policy_id).eql(testPolicyId); + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicy({ + inputs: {}, + name: 'check if title is present-Test private location 0', + id, + configId, + projectId: project, + }) + ); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send({ + monitors: [ + { + ...projectMonitors.monitors[0], + privateLocations: ['Test private location 0'], + enabled: false, + }, + ], + }); + + const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; + const policyId2 = `${id}-${testPolicyId}`; + + 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-Test private location 0', + id: id2, + configId: configId2, + projectId: project, + }) + ); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project); + + const apiResponsePolicy2 = await supertest.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 location formatting for both private and public locations', async () => { + const project = `test-project-${uuid.v4()}`; + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send({ + monitors: [ + { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, + ], + }); + + const updatedMonitorsResponse = await Promise.all( + projectMonitors.monitors.map((monitor) => { + return supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitor.id}` }) + .set('kbn-xsrf', 'true') + .expect(200); + }) + ); + + updatedMonitorsResponse.forEach((response) => { + expect(response.body.monitors[0].attributes.locations).eql([ + { + id: 'localhost', + label: 'Local Synthetics Service', + geo: { lat: 0, lon: 0 }, + url: 'mockDevUrl', + isServiceManaged: true, + status: 'experimental', + isInvalid: false, + }, + { + label: 'Test private location 0', + isServiceManaged: false, + isInvalid: false, + agentPolicyId: testPolicyId, + id: testPolicyId, + geo: { + lat: '', + lon: '', + }, + concurrentMonitors: 1, + }, + ]); + }); + } 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-${uuid.v4()}`; + 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(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send({ + monitors, + }) + .expect(400); + + expect(message).to.eql(REQUEST_TOO_LARGE); + } finally { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ ...projectMonitors, keep_stale: false, project }); + } + }); + + it('project monitors - cannot update a monitor of one type to another type', async () => { + const project = `test-project-${uuid.v4()}`; + + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .send(projectMonitors) + .expect(200); + const { body } = await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project)) + .set('kbn-xsrf', 'true') + .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: ['Saved', 'saved'], + }, + status: [200], + }, + enabled: false, + hash: 'ekrjelkjrelkjre', + id: projectMonitors.monitors[0].id, + locations: ['localhost'], + name: 'My Monitor 3', + response: { + include_body: 'always', + }, + 'response.include_headers': false, + schedule: 60, + timeout: '80s', + type: 'http', + tags: 'tag2,tag2', + urls: ['http://localhost:9200'], + }, + reason: 'Cannot update monitor to different type.', + }, + ], + }); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + }); +} diff --git a/x-pack/test/api_integration/apis/synthetics/add_monitor_project_legacy.ts b/x-pack/test/api_integration/apis/synthetics/add_monitor_project_legacy.ts new file mode 100644 index 0000000000000..9d5e4b45f4e7f --- /dev/null +++ b/x-pack/test/api_integration/apis/synthetics/add_monitor_project_legacy.ts @@ -0,0 +1,2127 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import fetch, { BodyInit, HeadersInit, Response } from 'node-fetch'; +import uuid from 'uuid'; +import expect from '@kbn/expect'; +import { format as formatUrl } from 'url'; +import { + ConfigKey, + LegacyProjectMonitorsRequest, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { formatKibanaNamespace } from '@kbn/synthetics-plugin/common/formatters'; +import { syntheticsMonitorType } from '@kbn/synthetics-plugin/server/legacy_uptime/lib/saved_objects/synthetics_monitor'; +import { PackagePolicy } from '@kbn/fleet-plugin/common'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { getFixtureJson } from '../uptime/rest/helper/get_fixture_json'; +import { PrivateLocationTestService } from './services/private_location_test_service'; +import { + comparePolicies, + getTestProjectSyntheticsPolicy, +} from '../uptime/rest/sample_data/test_policy'; + +export default function ({ getService }: FtrProviderContext) { + describe('AddProjectLegacyMonitors', function () { + this.tags('skipCloud'); + + const supertest = getService('supertest'); + const config = getService('config'); + const kibanaServerUrl = formatUrl(config.get('servers.kibana')); + const supertestWithoutAuth = getService('supertestWithoutAuth'); + const security = getService('security'); + const kibanaServer = getService('kibanaServer'); + const projectMonitorEndpoint = kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY; + + let projectMonitors: LegacyProjectMonitorsRequest; + let httpProjectMonitors: LegacyProjectMonitorsRequest; + let tcpProjectMonitors: LegacyProjectMonitorsRequest; + let icmpProjectMonitors: LegacyProjectMonitorsRequest; + + let testPolicyId = ''; + const testPrivateLocations = new PrivateLocationTestService(getService); + + const setUniqueIds = (request: LegacyProjectMonitorsRequest) => { + return { + ...request, + monitors: request.monitors.map((monitor) => ({ ...monitor, id: uuid.v4() })), + }; + }; + + const deleteMonitor = async ( + journeyId: string, + projectId: string, + space: string = 'default', + username: string = '', + password: string = '' + ) => { + try { + const response = await supertest + .get(`/s/${space}${API_URLS.SYNTHETICS_MONITORS}`) + .auth(username, password) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: "${journeyId}" AND ${syntheticsMonitorType}.attributes.project_id: "${projectId}"`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + const { monitors } = response.body; + if (monitors[0]?.id) { + await supertest + .delete(`/s/${space}${API_URLS.SYNTHETICS_MONITORS}/${monitors[0].id}`) + .set('kbn-xsrf', 'true') + .send(projectMonitors) + .expect(200); + } + } catch (e) { + // eslint-disable-next-line no-console + console.error(e); + } + }; + + before(async () => { + await supertest.post('/api/fleet/setup').set('kbn-xsrf', 'true').send().expect(200); + await supertest + .post('/api/fleet/epm/packages/synthetics/0.10.3') + .set('kbn-xsrf', 'true') + .send({ force: true }) + .expect(200); + + const testPolicyName = 'Fleet test server policy' + Date.now(); + const apiResponse = await testPrivateLocations.addFleetPolicy(testPolicyName); + testPolicyId = apiResponse.body.item.id; + await testPrivateLocations.setTestLocations([testPolicyId]); + }); + + beforeEach(() => { + projectMonitors = setUniqueIds(getFixtureJson('project_browser_monitor')); + httpProjectMonitors = setUniqueIds(getFixtureJson('project_http_monitor')); + tcpProjectMonitors = setUniqueIds(getFixtureJson('project_tcp_monitor')); + icmpProjectMonitors = setUniqueIds(getFixtureJson('project_icmp_monitor')); + }); + + it('project monitors - handles browser monitors', async () => { + const successfulMonitors = [projectMonitors.monitors[0]]; + + try { + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify(projectMonitors) + ); + + expect(messages).to.have.length(2); + expect(messages[1].updatedMonitors).eql([]); + expect(messages[1].createdMonitors).eql(successfulMonitors.map((monitor) => monitor.id)); + expect(messages[1].failedMonitors).eql([]); + + for (const monitor of successfulMonitors) { + const journeyId = monitor.id; + const createdMonitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set('kbn-xsrf', 'true') + .expect(200); + + const decryptedCreatedMonitor = await supertest + .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) + .set('kbn-xsrf', 'true') + .expect(200); + + expect(decryptedCreatedMonitor.body.attributes).to.eql({ + __ui: { + is_zip_url_tls_enabled: false, + script_source: { + file_name: '', + is_generated_script: false, + }, + }, + config_id: decryptedCreatedMonitor.body.id, + custom_heartbeat_id: `${journeyId}-test-suite-default`, + 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: 'localhost', + isInvalid: false, + isServiceManaged: true, + label: 'Local Synthetics Service', + status: 'experimental', + url: 'mockDevUrl', + }, + ], + name: 'check if title is present', + namespace: 'default', + origin: 'project', + original_space: 'default', + playwright_options: '{"headless":true,"chromiumSandbox":false}', + playwright_text_assertion: '', + project_id: 'test-suite', + params: '', + revision: 1, + schedule: { + number: '10', + unit: 'm', + }, + screenshots: 'on', + 'service.name': '', + 'source.zip_url.folder': '', + 'source.zip_url.proxy_url': '', + 'source.zip_url.url': '', + 'source.zip_url.password': '', + 'source.zip_url.username': '', + synthetics_args: [], + tags: [], + 'throttling.config': '5d/3u/20l', + 'throttling.download_speed': '5', + 'throttling.is_enabled': true, + 'throttling.latency': '20', + 'throttling.upload_speed': '3', + '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}-test-suite-default`, + hash: 'ekrjelkjrelkjre', + }); + } + } finally { + await Promise.all([ + successfulMonitors.map((monitor) => { + return deleteMonitor(monitor.id, httpProjectMonitors.project); + }), + ]); + } + }); + + it('project monitors - handles http monitors', async () => { + const kibanaVersion = await kibanaServer.version.get(); + const successfulMonitors = [httpProjectMonitors.monitors[1]]; + + try { + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify(httpProjectMonitors) + ); + + expect(messages).to.have.length(3); + expect(messages[2].updatedMonitors).eql([]); + expect(messages[2].createdMonitors).eql(successfulMonitors.map((monitor) => monitor.id)); + expect(messages[2].failedMonitors).eql([ + { + id: httpProjectMonitors.monitors[0].id, + details: `Multiple urls are not supported for http project monitors in ${kibanaVersion}. Please set only 1 url per monitor. You monitor was not created or updated.`, + reason: 'Unsupported Heartbeat option', + }, + { + 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 createdMonitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set('kbn-xsrf', 'true') + .expect(200); + + const decryptedCreatedMonitor = await supertest + .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) + .set('kbn-xsrf', 'true') + .expect(200); + + expect(decryptedCreatedMonitor.body.attributes).to.eql({ + __ui: { + is_tls_enabled: false, + }, + 'check.request.method': 'POST', + 'check.response.status': ['200'], + config_id: decryptedCreatedMonitor.body.id, + custom_heartbeat_id: `${journeyId}-test-suite-default`, + 'check.response.body.negative': [], + 'check.response.body.positive': ['Saved', 'saved'], + 'check.response.headers': {}, + 'check.request.body': { + type: 'text', + value: '', + }, + 'check.request.headers': { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + enabled: false, + form_monitor_type: 'http', + journey_id: journeyId, + locations: [ + { + geo: { + lat: 0, + lon: 0, + }, + id: 'localhost', + isInvalid: false, + isServiceManaged: true, + label: 'Local Synthetics Service', + status: 'experimental', + url: 'mockDevUrl', + }, + ], + max_redirects: '0', + name: monitor.name, + namespace: 'default', + origin: 'project', + original_space: 'default', + project_id: 'test-suite', + username: '', + password: '', + proxy_url: '', + 'response.include_body': 'always', + 'response.include_headers': false, + 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': '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}-test-suite-default`, + hash: 'ekrjelkjrelkjre', + }); + } + } finally { + await Promise.all([ + successfulMonitors.map((monitor) => { + return deleteMonitor(monitor.id, httpProjectMonitors.project); + }), + ]); + } + }); + + it('project monitors - handles tcp monitors', async () => { + const successfulMonitors = [tcpProjectMonitors.monitors[0], tcpProjectMonitors.monitors[1]]; + const kibanaVersion = await kibanaServer.version.get(); + + try { + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify(tcpProjectMonitors) + ); + + expect(messages).to.have.length(3); + expect(messages[2].updatedMonitors).eql([]); + expect(messages[2].createdMonitors).eql(successfulMonitors.map((monitor) => monitor.id)); + expect(messages[2].failedMonitors).eql([ + { + id: tcpProjectMonitors.monitors[2].id, + details: `Multiple hosts are not supported for tcp project monitors in ${kibanaVersion}. Please set only 1 host per monitor. You monitor was not created or updated.`, + reason: 'Unsupported Heartbeat option', + }, + { + 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 createdMonitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set('kbn-xsrf', 'true') + .expect(200); + + const decryptedCreatedMonitor = await supertest + .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) + .set('kbn-xsrf', 'true') + .expect(200); + + expect(decryptedCreatedMonitor.body.attributes).to.eql({ + __ui: { + is_tls_enabled: false, + }, + config_id: decryptedCreatedMonitor.body.id, + custom_heartbeat_id: `${journeyId}-test-suite-default`, + 'check.receive': '', + 'check.send': '', + enabled: true, + form_monitor_type: 'tcp', + journey_id: journeyId, + locations: [ + { + geo: { + lat: 0, + lon: 0, + }, + id: 'localhost', + isInvalid: false, + isServiceManaged: true, + label: 'Local Synthetics Service', + status: 'experimental', + url: 'mockDevUrl', + }, + ], + name: monitor.name, + namespace: 'default', + origin: 'project', + original_space: 'default', + project_id: 'test-suite', + 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': '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}-test-suite-default`, + hash: 'ekrjelkjrelkjre', + }); + } + } finally { + await Promise.all([ + successfulMonitors.map((monitor) => { + return deleteMonitor(monitor.id, tcpProjectMonitors.project); + }), + ]); + } + }); + + it('project monitors - handles icmp monitors', async () => { + const successfulMonitors = [icmpProjectMonitors.monitors[0], icmpProjectMonitors.monitors[1]]; + const kibanaVersion = await kibanaServer.version.get(); + + try { + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify(icmpProjectMonitors) + ); + + expect(messages).to.have.length(3); + expect(messages[2].updatedMonitors).eql([]); + expect(messages[2].createdMonitors).eql(successfulMonitors.map((monitor) => monitor.id)); + expect(messages[2].failedMonitors).eql([ + { + id: icmpProjectMonitors.monitors[2].id, + details: `Multiple hosts are not supported for icmp project monitors in ${kibanaVersion}. Please set only 1 host per monitor. You monitor was not created or updated.`, + reason: 'Unsupported Heartbeat option', + }, + { + 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(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set('kbn-xsrf', 'true') + .expect(200); + + const decryptedCreatedMonitor = await supertest + .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) + .set('kbn-xsrf', 'true') + .expect(200); + + expect(decryptedCreatedMonitor.body.attributes).to.eql({ + config_id: decryptedCreatedMonitor.body.id, + custom_heartbeat_id: `${journeyId}-test-suite-default`, + enabled: true, + form_monitor_type: 'icmp', + journey_id: journeyId, + locations: [ + { + geo: { + lat: 0, + lon: 0, + }, + id: 'localhost', + isInvalid: false, + isServiceManaged: true, + label: 'Local Synthetics Service', + status: 'experimental', + url: 'mockDevUrl', + }, + { + agentPolicyId: testPolicyId, + concurrentMonitors: 1, + geo: { + lat: '', + lon: '', + }, + id: testPolicyId, + isInvalid: false, + isServiceManaged: false, + label: 'Test private location 0', + }, + ], + name: monitor.name, + namespace: 'default', + origin: 'project', + original_space: 'default', + project_id: 'test-suite', + 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}-test-suite-default`, + hash: 'ekrjelkjrelkjre', + }); + } + } finally { + await Promise.all([ + successfulMonitors.map((monitor) => { + return deleteMonitor(monitor.id, icmpProjectMonitors.project); + }), + ]); + } + }); + + it('project monitors - returns a list of successfully created monitors', async () => { + try { + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify(projectMonitors) + ); + + expect(messages).to.have.length(2); + expect(messages[1].updatedMonitors).eql([]); + expect(messages[1].failedMonitors).eql([]); + expect(messages[1].createdMonitors).eql( + projectMonitors.monitors.map((monitor) => monitor.id) + ); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + } + }); + + it('project monitors - returns a list of successfully updated monitors', async () => { + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send(projectMonitors); + + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify(projectMonitors) + ); + + expect(messages).to.have.length(2); + expect(messages[0]).eql(' 1 monitor found with no changes.'); + expect(messages[1].createdMonitors).eql([]); + expect(messages[1].failedMonitors).eql([]); + expect(messages[1].updatedMonitors).eql( + projectMonitors.monitors.map((monitor) => monitor.id) + ); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + } + }); + + it('project monitors - does not increment monitor revision unless a change has been made', async () => { + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send(projectMonitors); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send(projectMonitors); + + const updatedMonitorsResponse = await Promise.all( + projectMonitors.monitors.map((monitor) => { + return supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitor.id}` }) + .set('kbn-xsrf', 'true') + .expect(200); + }) + ); + + updatedMonitorsResponse.forEach((response) => { + expect(response.body.monitors[0].attributes.revision).eql(1); + }); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + } + }); + + it('project monitors - increments monitor revision when a change has been made', async () => { + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send(projectMonitors); + + const editedMonitors = { + ...projectMonitors, + monitors: projectMonitors.monitors.map((monitor) => ({ + ...monitor, + content: 'changed content', + })), + }; + + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify(editedMonitors) + ); + + const updatedMonitorsResponse = await Promise.all( + projectMonitors.monitors.map((monitor) => { + return supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitor.id}` }) + .set('kbn-xsrf', 'true') + .expect(200); + }) + ); + + updatedMonitorsResponse.forEach((response) => { + expect(response.body.monitors[0].attributes.revision).eql(2); + }); + expect(messages[0]).eql('1 monitor updated successfully. '); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + } + }); + + it('project monitors - does not delete monitors when keep stale is true', async () => { + const secondMonitor = { ...projectMonitors.monitors[0], id: 'test-id-2' }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: testMonitors, + }); + + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify(projectMonitors) + ); + + expect(messages).to.have.length(2); + expect(messages[0]).eql(' 1 monitor found with no changes.'); + expect(messages[1].createdMonitors).eql([]); + expect(messages[1].failedMonitors).eql([]); + expect(messages[1].deletedMonitors).eql([]); + expect(messages[1].updatedMonitors).eql([projectMonitors.monitors[0].id]); + expect(messages[1].staleMonitors).eql([secondMonitor.id]); + // does not delete the stale monitor + const getResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${secondMonitor.id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const { monitors } = getResponse.body; + + expect(monitors.length).eql(1); + } finally { + await Promise.all([ + testMonitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + } + }); + + it('project monitors - deletes monitors when keep stale is false', async () => { + const secondMonitor = { ...projectMonitors.monitors[0], id: 'test-id-2' }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + keep_stale: false, + monitors: testMonitors, + project: 'test-project-2', + }); + + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify({ + ...projectMonitors, + keep_stale: false, + project: 'test-project-2', + }) + ); + + expect(messages).to.have.length(3); + + // expect monitor to have been deleted + const getResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${secondMonitor.id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const { monitors } = getResponse.body; + expect(monitors[0]).eql(undefined); + expect(messages[0]).eql(` 1 monitor found with no changes.`); + expect(messages[1]).eql(`Monitor ${secondMonitor.id} deleted successfully`); + expect(messages[2].createdMonitors).eql([]); + expect(messages[2].failedMonitors).eql([]); + expect(messages[2].updatedMonitors).eql([projectMonitors.monitors[0].id]); + expect(messages[2].deletedMonitors).eql([secondMonitor.id]); + expect(messages[2].staleMonitors).eql([]); + } finally { + await Promise.all([ + testMonitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + } + }); + + it('project monitors - does not delete monitors from different suites when keep stale is false', async () => { + const secondMonitor = { ...projectMonitors.monitors[0], id: 'test-id-2' }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + const testprojectId = 'test-suite-2'; + try { + await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify({ + ...projectMonitors, + keep_stale: false, + monitors: testMonitors, + }) + ); + + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify({ + ...projectMonitors, + keep_stale: false, + project: testprojectId, + }) + ); + + expect(messages).to.have.length(2); + expect(messages[1].createdMonitors).eql([projectMonitors.monitors[0].id]); + expect(messages[1].failedMonitors).eql([]); + expect(messages[1].deletedMonitors).eql([]); + expect(messages[1].updatedMonitors).eql([]); + expect(messages[1].staleMonitors).eql([]); + + // expect monitor not to have been deleted + const getResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${secondMonitor.id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const { monitors } = getResponse.body; + + expect(monitors.length).eql(1); + } finally { + await Promise.all([ + testMonitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + + await Promise.all([ + testMonitors.map((monitor) => { + return deleteMonitor(monitor.id, testprojectId); + }), + ]); + } + }); + + it('project monitors - does not delete a monitor from the same suite in a different space', async () => { + const secondMonitor = { ...projectMonitors.monitors[0], id: 'test-id-2' }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + const username = 'admin'; + const roleName = `synthetics_admin`; + const password = `${username}-password`; + const SPACE_ID = `test-space-${uuid.v4()}`; + const SPACE_NAME = `test-space-name ${uuid.v4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + try { + await security.role.create(roleName, { + kibana: [ + { + feature: { + uptime: ['all'], + }, + spaces: ['*'], + }, + ], + }); + await security.user.create(username, { + password, + roles: [roleName], + full_name: 'a kibana user', + }); + await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify({ ...projectMonitors, keep_stale: false, monitors: testMonitors }), + { + Authorization: + 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64'), + } + ); + + const spaceUrl = + kibanaServerUrl + `/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY}`; + + const messages = await parseStreamApiResponse( + spaceUrl, + JSON.stringify({ ...projectMonitors, keep_stale: false }), + { + Authorization: + 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64'), + } + ); + expect(messages).to.have.length(2); + expect(messages[1].createdMonitors).eql([projectMonitors.monitors[0].id]); + expect(messages[1].failedMonitors).eql([]); + expect(messages[1].deletedMonitors).eql([]); + expect(messages[1].updatedMonitors).eql([]); + expect(messages[1].staleMonitors).eql([]); + + const getResponse = await supertestWithoutAuth + .get(API_URLS.SYNTHETICS_MONITORS) + .auth(username, password) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${secondMonitor.id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + } finally { + await Promise.all([ + testMonitors.map((monitor) => { + return deleteMonitor( + monitor.id, + projectMonitors.project, + 'default', + username, + password + ); + }), + ]); + await deleteMonitor( + projectMonitors.monitors[0].id, + projectMonitors.project, + SPACE_ID, + username, + password + ); + await security.user.delete(username); + await security.role.delete(roleName); + } + }); + + it('project monitors - validates monitor type', async () => { + try { + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify({ + ...projectMonitors, + monitors: [{ ...projectMonitors.monitors[0], schedule: '3m', tags: '' }], + }) + ); + + expect(messages).to.have.length(1); + expect(messages[0].updatedMonitors).eql([]); + expect(messages[0].failedMonitors).eql([ + { + 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: ['localhost'], + 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', + }, + reason: 'Failed to save or update monitor. Configuration is not valid', + }, + ]); + expect(messages[0].createdMonitors).eql([]); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + } + }); + + it('project monitors - saves space as data stream namespace', async () => { + const username = 'admin'; + const roleName = `synthetics_admin`; + const password = `${username}-password`; + const SPACE_ID = `test-space-${uuid.v4()}`; + const SPACE_NAME = `test-space-name ${uuid.v4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + try { + await security.role.create(roleName, { + kibana: [ + { + feature: { + uptime: ['all'], + }, + spaces: ['*'], + }, + ], + }); + await security.user.create(username, { + password, + roles: [roleName], + full_name: 'a kibana user', + }); + await supertestWithoutAuth + .put(`/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY}`) + .auth(username, password) + .set('kbn-xsrf', 'true') + .send(projectMonitors) + .expect(200); + // expect monitor not to have been deleted + const getResponse = await supertestWithoutAuth + .get(`/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS}`) + .auth(username, password) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + expect(monitors[0].attributes[ConfigKey.NAMESPACE]).eql(formatKibanaNamespace(SPACE_ID)); + } finally { + await deleteMonitor( + projectMonitors.monitors[0].id, + projectMonitors.project, + SPACE_ID, + username, + password + ); + await security.user.delete(username); + await security.role.delete(roleName); + } + }); + + it('project monitors - formats custom id appropriately', async () => { + const username = 'admin'; + const roleName = `synthetics_admin`; + const password = `${username}-password`; + const SPACE_ID = `test-space-${uuid.v4()}`; + const SPACE_NAME = `test-space-name ${uuid.v4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + try { + await security.role.create(roleName, { + kibana: [ + { + feature: { + uptime: ['all'], + }, + spaces: ['*'], + }, + ], + }); + await security.user.create(username, { + password, + roles: [roleName], + full_name: 'a kibana user', + }); + await supertestWithoutAuth + .put(`/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY}`) + .auth(username, password) + .set('kbn-xsrf', 'true') + .send(projectMonitors) + .expect(200); + // expect monitor not to have been deleted + const getResponse = await supertestWithoutAuth + .get(`/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS}`) + .auth(username, password) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + expect(monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]).eql( + `${projectMonitors.monitors[0].id}-${projectMonitors.project}-${SPACE_ID}` + ); + } finally { + await deleteMonitor( + projectMonitors.monitors[0].id, + projectMonitors.project, + SPACE_ID, + username, + password + ); + await security.user.delete(username); + await security.role.delete(roleName); + } + }); + + it('project monitors - is able to decrypt monitor when updated after hydration', async () => { + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send(projectMonitors); + + const response = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const { monitors } = response.body; + + // add urls and ports to mimic hydration + const updates = { + [ConfigKey.URLS]: 'https://modified-host.com', + [ConfigKey.PORT]: 443, + }; + + const modifiedMonitor = { ...monitors[0]?.attributes, ...updates }; + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS + '/' + monitors[0]?.id) + .set('kbn-xsrf', 'true') + .send(modifiedMonitor) + .expect(200); + + // update project monitor via push api + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify(projectMonitors) + ); + expect(messages).to.have.length(2); + expect(messages[0]).eql('1 monitor updated successfully. '); + expect(messages[1].updatedMonitors).eql([projectMonitors.monitors[0].id]); + + // ensure that monitor can still be decrypted + await supertest + .get(API_URLS.SYNTHETICS_MONITORS + '/' + monitors[0]?.id) + .set('kbn-xsrf', 'true') + .expect(200); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + } + }); + + it('project monitors - is able to enable and disable monitors', async () => { + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send(projectMonitors); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [ + { + ...projectMonitors.monitors[0], + enabled: false, + }, + ], + }) + .expect(200); + const response = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + const { monitors } = response.body; + expect(monitors[0].attributes.enabled).eql(false); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + } + }); + + it('project monitors - returns a failed monitor when user defines a private location without fleet permissions', async () => { + const secondMonitor = { + ...projectMonitors.monitors[0], + id: 'test-id-2', + privateLocations: ['Test private location 0'], + }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + const username = 'admin'; + const roleName = 'uptime read only'; + const password = `${username}-password`; + try { + await security.role.create(roleName, { + kibana: [ + { + feature: { + uptime: ['all'], + }, + spaces: ['*'], + }, + ], + }); + await security.user.create(username, { + password, + roles: [roleName], + full_name: 'a kibana user', + }); + + const messages = await parseStreamApiResponse( + kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY, + JSON.stringify({ + ...projectMonitors, + keep_stale: false, + monitors: testMonitors, + }), + { + Authorization: + 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64'), + } + ); + + expect(messages).to.have.length(3); + expect(messages[0]).to.eql('test-id-2: failed to create or update monitor'); + expect(messages[1]).to.eql(`1 monitor created successfully.`); + expect(messages[2]).to.eql({ + createdMonitors: [testMonitors[0].id], + updatedMonitors: [], + staleMonitors: [], + deletedMonitors: [], + failedMonitors: [ + { + details: + 'Insufficient permissions. In order to configure private locations, you must have Fleet and Integrations write permissions. To resolve, please generate a new API key with a user who has Fleet and Integrations write permissions.', + id: 'test-id-2', + payload: { + content: + 'UEsDBBQACAAIAON5qVQAAAAAAAAAAAAAAAAfAAAAZXhhbXBsZXMvdG9kb3MvYmFzaWMuam91cm5leS50c22Q0WrDMAxF3/sVF7MHB0LMXlc6RvcN+wDPVWNviW0sdUsp/fe5SSiD7UFCWFfHujIGlpnkybwxFTZfoY/E3hsaLEtwhs9RPNWKDU12zAOxkXRIbN4tB9d9pFOJdO6EN2HMqQguWN9asFBuQVMmJ7jiWNII9fIXrbabdUYr58l9IhwhQQZCYORCTFFUC31Btj21NRc7Mq4Nds+4bDD/pNVgT9F52Jyr2Fa+g75LAPttg8yErk+S9ELpTmVotlVwnfNCuh2lepl3+JflUmSBJ3uggt1v9INW/lHNLKze9dJe1J3QJK8pSvWkm6aTtCet5puq+x63+AFQSwcIAPQ3VfcAAACcAQAAUEsBAi0DFAAIAAgA43mpVAD0N1X3AAAAnAEAAB8AAAAAAAAAAAAgAKSBAAAAAGV4YW1wbGVzL3RvZG9zL2Jhc2ljLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBNAAAARAEAAAAA', + filter: { + match: 'check if title is present', + }, + id: 'test-id-2', + locations: ['localhost'], + name: 'check if title is present', + params: {}, + playwrightOptions: { + chromiumSandbox: false, + headless: true, + }, + privateLocations: ['Test private location 0'], + schedule: 10, + tags: [], + throttling: { + download: 5, + latency: 20, + upload: 3, + }, + hash: 'ekrjelkjrelkjre', + }, + reason: 'Failed to create or update monitor', + }, + ], + failedStaleMonitors: [], + }); + } finally { + await Promise.all([ + testMonitors.map((monitor) => { + return deleteMonitor( + monitor.id, + projectMonitors.project, + 'default', + username, + password + ); + }), + ]); + await security.user.delete(username); + await security.role.delete(roleName); + } + }); + + it('project monitors - returns a failed monitor when user tries to delete a monitor without fleet permissions', async () => { + const secondMonitor = { + ...projectMonitors.monitors[0], + id: 'test-id-2', + privateLocations: ['Test private location 0'], + }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + const username = 'test-username'; + const roleName = 'uptime read only'; + const password = `test-password`; + try { + await security.role.create(roleName, { + kibana: [ + { + feature: { + uptime: ['all'], + }, + spaces: ['*'], + }, + ], + }); + await security.user.create(username, { + password, + roles: [roleName], + full_name: 'a kibana user', + }); + + await parseStreamApiResponse( + kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY, + JSON.stringify({ + ...projectMonitors, + keep_stale: false, + monitors: testMonitors, + }) + ); + + const messages = await parseStreamApiResponse( + kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY, + JSON.stringify({ + ...projectMonitors, + keep_stale: false, + monitors: [], + }), + { + Authorization: + 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64'), + } + ); + + expect(messages).to.have.length(3); + expect( + messages.filter((msg) => msg === `Monitor ${testMonitors[1].id} could not be deleted`) + ).to.have.length(1); + expect( + messages.filter((msg) => msg === `Monitor ${testMonitors[0].id} deleted successfully`) + ).to.have.length(1); + expect(messages[2]).to.eql({ + createdMonitors: [], + updatedMonitors: [], + staleMonitors: [], + deletedMonitors: [testMonitors[0].id], + failedMonitors: [], + failedStaleMonitors: [ + { + details: + 'Unable to delete Synthetics package policy for monitor check if title is present. Fleet write permissions are needed to use Synthetics private locations.', + id: 'test-id-2', + reason: 'Failed to delete stale monitor', + }, + ], + }); + + const messages2 = await parseStreamApiResponse( + kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY, + JSON.stringify({ + ...projectMonitors, + keep_stale: false, + monitors: [], + }) + ); + + expect(messages2).to.have.length(2); + expect(messages2[0]).to.eql(`Monitor ${testMonitors[1].id} deleted successfully`); + expect(messages2[1]).to.eql({ + createdMonitors: [], + updatedMonitors: [], + staleMonitors: [], + deletedMonitors: [testMonitors[1].id], + failedMonitors: [], + failedStaleMonitors: [], + }); + } finally { + await Promise.all([ + testMonitors.map((monitor) => { + return deleteMonitor( + monitor.id, + projectMonitors.project, + 'default', + username, + password + ); + }), + ]); + await security.user.delete(username); + await security.role.delete(roleName); + } + }); + + it('project monitors - returns a successful monitor when user defines a private location with fleet permissions', async () => { + const secondMonitor = { + ...projectMonitors.monitors[0], + id: 'test-id-2', + privateLocations: ['Test private location 0'], + }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + const username = 'admin'; + const roleName = 'uptime with fleet'; + const password = `${username}-password`; + try { + await security.role.create(roleName, { + kibana: [ + { + feature: { + uptime: ['all'], + fleetv2: ['all'], + fleet: ['all'], + }, + spaces: ['*'], + }, + ], + }); + await security.user.create(username, { + password, + roles: [roleName], + full_name: 'a kibana user', + }); + const messages = await parseStreamApiResponse( + projectMonitorEndpoint, + JSON.stringify({ + ...projectMonitors, + keep_stale: false, + monitors: testMonitors, + }) + ); + expect(messages).to.have.length(2); + expect(messages).to.eql([ + `2 monitors created successfully.`, + { + createdMonitors: [testMonitors[0].id, 'test-id-2'], + updatedMonitors: [], + staleMonitors: [], + deletedMonitors: [], + failedMonitors: [], + failedStaleMonitors: [], + }, + ]); + } finally { + await Promise.all([ + testMonitors.map((monitor) => { + return deleteMonitor( + monitor.id, + projectMonitors.project, + 'default', + username, + password + ); + }), + ]); + await security.user.delete(username); + await security.role.delete(roleName); + } + }); + + it('creates integration policies for project monitors with private locations', async () => { + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [ + { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, + ], + }); + + const monitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + expect(packagePolicy.name).eql( + `${projectMonitors.monitors[0].id}-${projectMonitors.project}-default-Test private location 0` + ); + expect(packagePolicy.policy_id).eql(testPolicyId); + + const configId = monitorsResponse.body.monitors[0].id; + const id = monitorsResponse.body.monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicy({ + inputs: {}, + name: 'check if title is present-Test private location 0', + id, + configId, + }) + ); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, projectMonitors.project); + + const packagesResponse = await supertest.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 monitorRequest = { + ...httpProjectMonitors, + monitors: [ + { ...httpProjectMonitors.monitors[1], privateLocations: ['Test private location 0'] }, + ], + }; + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send(monitorRequest); + + const monitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitorRequest.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + + expect(packagePolicy.policy_id).eql(testPolicyId); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...monitorRequest, + monitors: [{ ...monitorRequest.monitors[0], privateLocations: [] }], + }); + + const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + + expect(packagePolicy2).eql(undefined); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, projectMonitors.project); + } + }); + + it('deletes integration policies for project monitors when private location is removed from the monitor', async () => { + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [ + { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, + ], + }); + + const monitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + + expect(packagePolicy.policy_id).eql(testPolicyId); + + const configId = monitorsResponse.body.monitors[0].id; + const id = monitorsResponse.body.monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicy({ + inputs: {}, + name: 'check if title is present-Test private location 0', + id, + configId, + }) + ); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [{ ...projectMonitors.monitors[0], privateLocations: [] }], + }); + + const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + + expect(packagePolicy2).eql(undefined); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, projectMonitors.project); + + const apiResponsePolicy2 = await supertest.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('deletes integration policies when project monitors are deleted', async () => { + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [ + { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, + ], + }) + .expect(200); + + const monitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + + '-' + + testPolicyId + ); + + expect(packagePolicy.policy_id).eql(testPolicyId); + + const configId = monitorsResponse.body.monitors[0].id; + const id = monitorsResponse.body.monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicy({ + inputs: {}, + name: 'check if title is present-Test private location 0', + id, + configId, + }) + ); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [], + keep_stale: false, + }); + + const monitorsResponse2 = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + expect(monitorsResponse2.body.monitors.length).eql(0); + + await new Promise((resolve) => { + setTimeout(() => resolve(null), 3000); + }); + + const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + + '-' + + testPolicyId + ); + + expect(packagePolicy2).eql(undefined); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, projectMonitors.project); + + const apiResponsePolicy2 = await supertest.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('deletes integration policies when project monitors are deleted - lightweight', async () => { + const monitorRequest = { + ...httpProjectMonitors, + monitors: [ + { ...httpProjectMonitors.monitors[1], privateLocations: ['Test private location 0'] }, + ], + }; + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send(monitorRequest); + + const monitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitorRequest.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + }-${testPolicyId}` + ); + + expect(packagePolicy.policy_id).eql(testPolicyId); + + const configId = monitorsResponse.body.monitors[0].id; + const id = monitorsResponse.body.monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; + + const httpInput = packagePolicy.inputs.find( + (input: any) => input.type === 'synthetics/http' + ); + expect(httpInput).to.eql({ + type: 'synthetics/http', + policy_template: 'synthetics', + enabled: true, + streams: [ + { + enabled: true, + data_stream: { type: 'synthetics', dataset: 'http' }, + release: 'experimental', + vars: { + __ui: { value: '{"is_tls_enabled":false}', type: 'yaml' }, + enabled: { value: false, type: 'bool' }, + type: { value: 'http', type: 'text' }, + name: { value: 'My Monitor 3', type: 'text' }, + schedule: { value: '"@every 60m"', type: 'text' }, + urls: { value: 'http://localhost:9200', type: 'text' }, + 'service.name': { value: '', type: 'text' }, + timeout: { value: '80s', type: 'text' }, + max_redirects: { value: '0', type: 'integer' }, + proxy_url: { value: '', type: 'text' }, + tags: { value: '["tag2","tag2"]', type: 'yaml' }, + username: { value: '', type: 'text' }, + password: { value: '', type: 'password' }, + 'response.include_headers': { value: false, type: 'bool' }, + 'response.include_body': { value: 'always', type: 'text' }, + 'check.request.method': { value: 'POST', type: 'text' }, + 'check.request.headers': { + value: '{"Content-Type":"application/x-www-form-urlencoded"}', + type: 'yaml', + }, + 'check.request.body': { value: null, type: 'yaml' }, + 'check.response.status': { value: '["200"]', type: 'yaml' }, + 'check.response.headers': { value: null, type: 'yaml' }, + 'check.response.body.positive': { value: '["Saved","saved"]', type: 'yaml' }, + 'check.response.body.negative': { value: null, type: 'yaml' }, + 'ssl.certificate_authorities': { value: null, type: 'yaml' }, + 'ssl.certificate': { value: null, type: 'yaml' }, + 'ssl.key': { value: null, type: 'yaml' }, + 'ssl.key_passphrase': { value: null, type: 'text' }, + 'ssl.verification_mode': { value: 'full', type: 'text' }, + 'ssl.supported_protocols': { + value: '["TLSv1.1","TLSv1.2","TLSv1.3"]', + type: 'yaml', + }, + location_name: { value: 'Test private location 0', type: 'text' }, + id: { + value: id, + type: 'text', + }, + config_id: { value: configId, type: 'text' }, + run_once: { value: false, type: 'bool' }, + origin: { value: 'project', type: 'text' }, + 'monitor.project.id': { + type: 'text', + value: 'test-suite', + }, + 'monitor.project.name': { + type: 'text', + value: 'test-suite', + }, + }, + id: `synthetics/http-http-${id}-${testPolicyId}`, + compiled_stream: { + __ui: { is_tls_enabled: false }, + type: 'http', + name: 'My Monitor 3', + id, + origin: 'project', + enabled: false, + urls: 'http://localhost:9200', + schedule: '@every 60m', + timeout: '80s', + max_redirects: 0, + tags: ['tag2', 'tag2'], + 'response.include_headers': false, + 'response.include_body': 'always', + 'check.request.method': 'POST', + 'check.request.headers': { 'Content-Type': 'application/x-www-form-urlencoded' }, + 'check.response.status': ['200'], + 'check.response.body.positive': ['Saved', 'saved'], + 'ssl.verification_mode': 'full', + 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], + processors: [ + { add_observer_metadata: { geo: { name: 'Test private location 0' } } }, + { + add_fields: { + target: '', + fields: { + 'monitor.fleet_managed': true, + config_id: configId, + 'monitor.project.id': 'test-suite', + 'monitor.project.name': 'test-suite', + }, + }, + }, + ], + }, + }, + ], + }); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...monitorRequest, + monitors: [], + }); + + const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + } - ${testPolicyId}` + ); + + expect(packagePolicy2).eql(undefined); + } finally { + await deleteMonitor(httpProjectMonitors.monitors[1].id, httpProjectMonitors.project); + + const apiResponsePolicy2 = await supertest.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 () => { + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [ + { + ...projectMonitors.monitors[0], + privateLocations: ['Test private location 0'], + }, + ], + }); + + const monitorsResponse = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; + const policyId = `${id}-${testPolicyId}`; + + const packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => pkgPolicy.id === policyId + ); + + expect(packagePolicy.policy_id).eql(testPolicyId); + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicy({ + inputs: {}, + name: 'check if title is present-Test private location 0', + id, + configId, + }) + ); + + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [ + { + ...projectMonitors.monitors[0], + privateLocations: ['Test private location 0'], + enabled: false, + }, + ], + }); + + const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; + const policyId2 = `${id}-${testPolicyId}`; + + 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-Test private location 0', + id: id2, + configId: configId2, + }) + ); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, projectMonitors.project); + + const apiResponsePolicy2 = await supertest.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 location formatting for both private and public locations', async () => { + try { + await supertest + .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) + .set('kbn-xsrf', 'true') + .send({ + ...projectMonitors, + monitors: [ + { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, + ], + }); + + const updatedMonitorsResponse = await Promise.all( + projectMonitors.monitors.map((monitor) => { + return supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitor.id}` }) + .set('kbn-xsrf', 'true') + .expect(200); + }) + ); + + updatedMonitorsResponse.forEach((response) => { + expect(response.body.monitors[0].attributes.locations).eql([ + { + id: 'localhost', + label: 'Local Synthetics Service', + geo: { lat: 0, lon: 0 }, + url: 'mockDevUrl', + isServiceManaged: true, + status: 'experimental', + isInvalid: false, + }, + { + label: 'Test private location 0', + isServiceManaged: false, + isInvalid: false, + agentPolicyId: testPolicyId, + id: testPolicyId, + geo: { + lat: '', + lon: '', + }, + concurrentMonitors: 1, + }, + ]); + }); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, projectMonitors.project); + }), + ]); + } + }); + }); +} + +/** + * Borrowed from AIOPS test code: https://github.com/elastic/kibana/blob/23a7ac2c2e2b1f64daa17b914e86989b1fde750c/x-pack/test/api_integration/apis/aiops/explain_log_rate_spikes.ts + * Receives a stream and parses the messages until the stream closes. + */ +async function* parseStream(stream: NodeJS.ReadableStream) { + let partial = ''; + + try { + for await (const value of stream) { + const full = `${partial}${value}`; + const parts = full.split('\n'); + const last = parts.pop(); + + partial = last ?? ''; + + const event = parts.map((p) => JSON.parse(p)); + + for (const events of event) { + yield events; + } + } + } catch (error) { + yield { type: 'error', payload: error.toString() }; + } +} + +/** + * Helper function to process the results of the module's stream parsing helper function. + */ +async function getMessages(stream: NodeJS.ReadableStream | null) { + if (stream === null) return []; + const data: any[] = []; + for await (const action of parseStream(stream)) { + data.push(action); + } + return data; +} + +/** + * This type is intended to highlight any break between shared parameter contracts defined in + * the module's streaming endpoint helper functions. + */ +type StreamApiFunction<T = unknown> = ( + url: string, + body?: BodyInit, + extraHeaders?: HeadersInit, + method?: string +) => T; + +/** + * This helps the test file have DRY code when it comes to calling + * the same streaming endpoint over and over by defining some selective defaults. + */ +export const parseStreamApiResponse: StreamApiFunction<Promise<any[]>> = async ( + url: string, + body?: BodyInit, + extraHeaders?: HeadersInit, + method = 'PUT' +) => { + const streamResponse = await callStreamApi(url, body, extraHeaders, method); + return getMessages(streamResponse.body); +}; + +/** + * This helps the test file have DRY code when it comes to calling + * the same streaming endpoint over and over by defining some selective defaults. + */ +const callStreamApi: StreamApiFunction<Promise<Response>> = async ( + url: string, + body?: BodyInit, + extraHeaders?: HeadersInit, + method = 'PUT' +) => { + return fetch(url, { + method, + headers: { + 'Content-Type': 'application/json', + 'kbn-xsrf': 'stream', + ...extraHeaders, + }, + body, + }); +}; diff --git a/x-pack/test/api_integration/apis/uptime/rest/delete_monitor.ts b/x-pack/test/api_integration/apis/synthetics/delete_monitor.ts similarity index 97% rename from x-pack/test/api_integration/apis/uptime/rest/delete_monitor.ts rename to x-pack/test/api_integration/apis/synthetics/delete_monitor.ts index b9fd0fac8ac2a..175cf792a34e1 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/delete_monitor.ts +++ b/x-pack/test/api_integration/apis/synthetics/delete_monitor.ts @@ -5,11 +5,11 @@ * 2.0. */ import uuid from 'uuid'; -import expect from '@kbn/expect'; import { HTTPFields, MonitorFields } from '@kbn/synthetics-plugin/common/runtime_types'; import { API_URLS } from '@kbn/synthetics-plugin/common/constants'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { getFixtureJson } from './helper/get_fixture_json'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { getFixtureJson } from '../uptime/rest/helper/get_fixture_json'; import { PrivateLocationTestService } from './services/private_location_test_service'; export default function ({ getService }: FtrProviderContext) { diff --git a/x-pack/test/api_integration/apis/uptime/rest/delete_monitor_project.ts b/x-pack/test/api_integration/apis/synthetics/delete_monitor_project.ts similarity index 96% rename from x-pack/test/api_integration/apis/uptime/rest/delete_monitor_project.ts rename to x-pack/test/api_integration/apis/synthetics/delete_monitor_project.ts index 25afc4e665180..8024cd74a34c2 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/delete_monitor_project.ts +++ b/x-pack/test/api_integration/apis/synthetics/delete_monitor_project.ts @@ -5,7 +5,6 @@ * 2.0. */ import uuid from 'uuid'; -import expect from '@kbn/expect'; import { format as formatUrl } from 'url'; import { ConfigKey, ProjectMonitorsRequest } from '@kbn/synthetics-plugin/common/runtime_types'; import { INSUFFICIENT_FLEET_PERMISSIONS } from '@kbn/synthetics-plugin/server/synthetics_service/project_monitor/project_monitor_formatter'; @@ -13,10 +12,11 @@ import { REQUEST_TOO_LARGE } from '@kbn/synthetics-plugin/server/routes/monitor_ import { API_URLS } from '@kbn/synthetics-plugin/common/constants'; import { syntheticsMonitorType } from '@kbn/synthetics-plugin/server/legacy_uptime/lib/saved_objects/synthetics_monitor'; import { PackagePolicy } from '@kbn/fleet-plugin/common'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { getFixtureJson } from './helper/get_fixture_json'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { getFixtureJson } from '../uptime/rest/helper/get_fixture_json'; import { PrivateLocationTestService } from './services/private_location_test_service'; -import { parseStreamApiResponse } from './add_monitor_project'; +import { parseStreamApiResponse } from './add_monitor_project_legacy'; export default function ({ getService }: FtrProviderContext) { describe('DeleteProjectMonitors', function () { @@ -92,7 +92,7 @@ export default function ({ getService }: FtrProviderContext) { const monitorsToDelete = monitors.map((monitor) => monitor.id); const response = await supertest - .delete(API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .delete(API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project)) .set('kbn-xsrf', 'true') .send({ monitors: monitorsToDelete }) .expect(400); @@ -144,7 +144,7 @@ export default function ({ getService }: FtrProviderContext) { const monitorsToDelete = [monitorToDelete]; const response = await supertest - .delete(API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .delete(API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project)) .set('kbn-xsrf', 'true') .send({ monitors: monitorsToDelete }) .expect(200); @@ -218,7 +218,7 @@ export default function ({ getService }: FtrProviderContext) { const monitorsToDelete = monitors.map((monitor) => monitor.id); const response = await supertest - .delete(API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .delete(API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project)) .set('kbn-xsrf', 'true') .send({ monitors: monitorsToDelete }) .expect(200); @@ -315,7 +315,7 @@ export default function ({ getService }: FtrProviderContext) { const response = await supertest .delete( - `/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS_PROJECT.replace( + `/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace( '{projectName}', project )}` @@ -407,7 +407,7 @@ export default function ({ getService }: FtrProviderContext) { const monitorsToDelete = monitors.map((monitor) => monitor.id); const response = await supertest - .delete(API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .delete(API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project)) .set('kbn-xsrf', 'true') .send({ monitors: monitorsToDelete }) .expect(200); @@ -500,7 +500,7 @@ export default function ({ getService }: FtrProviderContext) { const { body: { message }, } = await supertestWithoutAuth - .delete(API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .delete(API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project)) .set('kbn-xsrf', 'true') .auth(username, password) .send({ monitors: monitorsToDelete }) diff --git a/x-pack/test/api_integration/apis/uptime/rest/edit_monitor.ts b/x-pack/test/api_integration/apis/synthetics/edit_monitor.ts similarity index 92% rename from x-pack/test/api_integration/apis/uptime/rest/edit_monitor.ts rename to x-pack/test/api_integration/apis/synthetics/edit_monitor.ts index eb44aa36a76c8..6d9b1db7a753f 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/edit_monitor.ts +++ b/x-pack/test/api_integration/apis/synthetics/edit_monitor.ts @@ -5,14 +5,14 @@ * 2.0. */ import uuid from 'uuid'; -import expect from '@kbn/expect'; import { omit } from 'lodash'; import { SimpleSavedObject } from '@kbn/core/public'; import { secretKeys } from '@kbn/synthetics-plugin/common/constants/monitor_management'; import { ConfigKey, HTTPFields, MonitorFields } from '@kbn/synthetics-plugin/common/runtime_types'; import { API_URLS } from '@kbn/synthetics-plugin/common/constants'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { getFixtureJson } from './helper/get_fixture_json'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { getFixtureJson } from '../uptime/rest/helper/get_fixture_json'; import { PrivateLocationTestService } from './services/private_location_test_service'; export default function ({ getService }: FtrProviderContext) { @@ -61,7 +61,16 @@ export default function ({ getService }: FtrProviderContext) { newMonitor as MonitorFields ); - expect(savedMonitor).eql(omit(newMonitor, secretKeys)); + expect(savedMonitor).eql( + omit( + { + ...newMonitor, + [ConfigKey.MONITOR_QUERY_ID]: monitorId, + [ConfigKey.CONFIG_ID]: monitorId, + }, + secretKeys + ) + ); const updates: Partial<HTTPFields> = { [ConfigKey.URLS]: 'https://modified-host.com', @@ -116,7 +125,16 @@ export default function ({ getService }: FtrProviderContext) { newMonitor as MonitorFields ); - expect(savedMonitor).eql(omit(newMonitor, secretKeys)); + expect(savedMonitor).eql( + omit( + { + ...newMonitor, + [ConfigKey.MONITOR_QUERY_ID]: monitorId, + [ConfigKey.CONFIG_ID]: monitorId, + }, + secretKeys + ) + ); const updates: Partial<HTTPFields> = { [ConfigKey.URLS]: 'https://modified-host.com', @@ -147,7 +165,6 @@ export default function ({ getService }: FtrProviderContext) { const modifiedMonitor = omit( { - ...newMonitor, ...updates, [ConfigKey.METADATA]: { ...newMonitor[ConfigKey.METADATA], @@ -164,7 +181,14 @@ export default function ({ getService }: FtrProviderContext) { .expect(200); expect(editResponse.body.attributes).eql( - omit({ ...modifiedMonitor, revision: 2 }, secretKeys) + omit( + { + ...savedMonitor, + ...modifiedMonitor, + revision: 2, + }, + secretKeys + ) ); expect(editResponse.body.attributes).not.to.have.keys('unknownkey'); }); diff --git a/x-pack/test/api_integration/apis/uptime/rest/get_monitor.ts b/x-pack/test/api_integration/apis/synthetics/get_monitor.ts similarity index 92% rename from x-pack/test/api_integration/apis/uptime/rest/get_monitor.ts rename to x-pack/test/api_integration/apis/synthetics/get_monitor.ts index b90014b657b4a..5394ca64545e6 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/get_monitor.ts +++ b/x-pack/test/api_integration/apis/synthetics/get_monitor.ts @@ -5,12 +5,12 @@ * 2.0. */ -import expect from '@kbn/expect'; import { SimpleSavedObject } from '@kbn/core/public'; -import { MonitorFields } from '@kbn/synthetics-plugin/common/runtime_types'; +import { ConfigKey, MonitorFields } from '@kbn/synthetics-plugin/common/runtime_types'; import { API_URLS } from '@kbn/synthetics-plugin/common/constants'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { getFixtureJson } from './helper/get_fixture_json'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { getFixtureJson } from '../uptime/rest/helper/get_fixture_json'; export default function ({ getService }: FtrProviderContext) { describe('getSyntheticsMonitors', function () { @@ -97,6 +97,8 @@ export default function ({ getService }: FtrProviderContext) { expect(apiResponse.body.attributes).eql({ ...monitors[0], + [ConfigKey.MONITOR_QUERY_ID]: apiResponse.body.id, + [ConfigKey.CONFIG_ID]: apiResponse.body.id, revision: 1, }); }); diff --git a/x-pack/test/api_integration/apis/synthetics/get_monitor_overview.ts b/x-pack/test/api_integration/apis/synthetics/get_monitor_overview.ts new file mode 100644 index 0000000000000..7477e4e48b3c1 --- /dev/null +++ b/x-pack/test/api_integration/apis/synthetics/get_monitor_overview.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 { SimpleSavedObject } from '@kbn/core/public'; +import { MonitorFields } from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS, API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { getFixtureJson } from '../uptime/rest/helper/get_fixture_json'; + +export default function ({ getService }: FtrProviderContext) { + describe('[GET] /internal/synthetics/overview', function () { + this.tags('skipCloud'); + + const supertest = getService('supertest'); + + let _monitors: MonitorFields[]; + let monitors: MonitorFields[]; + + const deleteMonitor = async (id: string) => { + try { + await supertest + .delete(`${API_URLS.SYNTHETICS_MONITORS}/${id}`) + .set('kbn-xsrf', 'true') + .expect(200); + } catch (e) { + // eslint-disable-next-line no-console + console.error(e); + } + }; + + const saveMonitor = async (monitor: MonitorFields) => { + const res = await supertest + .post(API_URLS.SYNTHETICS_MONITORS) + .set('kbn-xsrf', 'true') + .send(monitor); + + return res.body as SimpleSavedObject<MonitorFields>; + }; + + before(async () => { + await supertest.post(API_URLS.SYNTHETICS_ENABLEMENT).set('kbn-xsrf', 'true').expect(200); + const { body } = await supertest + .get(API_URLS.SYNTHETICS_MONITORS) + .set('kbn-xsrf', 'true') + .expect(200); + await Promise.all([ + (body.monitors as Array<SimpleSavedObject<MonitorFields>>).map((monitor) => { + return deleteMonitor(monitor.id); + }), + ]); + + _monitors = [getFixtureJson('http_monitor')]; + }); + + beforeEach(() => { + monitors = []; + for (let i = 0; i < 20; i++) { + monitors.push({ + ..._monitors[0], + name: `${_monitors[0].name}${i}`, + }); + } + }); + + describe('returns total number of monitor combinations', () => { + it('returns the correct response', async () => { + let savedMonitors: SimpleSavedObject[] = []; + try { + const savedResponse = await Promise.all(monitors.map(saveMonitor)); + savedMonitors = savedResponse; + + const apiResponse = await supertest.get( + SYNTHETICS_API_URLS.SYNTHETICS_OVERVIEW + '?perPage=20' + ); + + expect(apiResponse.body.total).eql(monitors.length * 2); + expect(apiResponse.body.allMonitorIds.sort()).eql( + savedMonitors.map((monitor) => monitor.id).sort() + ); + expect(apiResponse.body.monitors.length).eql(40); + } finally { + await Promise.all( + savedMonitors.map((monitor) => { + return deleteMonitor(monitor.id); + }) + ); + } + }); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/get_monitor_project.ts b/x-pack/test/api_integration/apis/synthetics/get_monitor_project.ts similarity index 96% rename from x-pack/test/api_integration/apis/uptime/rest/get_monitor_project.ts rename to x-pack/test/api_integration/apis/synthetics/get_monitor_project.ts index bbd0715c45739..dd2c71913c625 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/get_monitor_project.ts +++ b/x-pack/test/api_integration/apis/synthetics/get_monitor_project.ts @@ -5,19 +5,19 @@ * 2.0. */ import uuid from 'uuid'; -import expect from '@kbn/expect'; import type SuperTest from 'supertest'; import { format as formatUrl } from 'url'; import { - ProjectMonitorsRequest, + LegacyProjectMonitorsRequest, ProjectMonitor, ProjectMonitorMetaData, } from '@kbn/synthetics-plugin/common/runtime_types'; import { API_URLS } from '@kbn/synthetics-plugin/common/constants'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { getFixtureJson } from './helper/get_fixture_json'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { getFixtureJson } from '../uptime/rest/helper/get_fixture_json'; import { PrivateLocationTestService } from './services/private_location_test_service'; -import { parseStreamApiResponse } from './add_monitor_project'; +import { parseStreamApiResponse } from './add_monitor_project_legacy'; export default function ({ getService }: FtrProviderContext) { describe('GetProjectMonitors', function () { @@ -28,15 +28,15 @@ export default function ({ getService }: FtrProviderContext) { const kibanaServerUrl = formatUrl(config.get('servers.kibana')); const projectMonitorEndpoint = kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY; - let projectMonitors: ProjectMonitorsRequest; - let httpProjectMonitors: ProjectMonitorsRequest; - let tcpProjectMonitors: ProjectMonitorsRequest; - let icmpProjectMonitors: ProjectMonitorsRequest; + let projectMonitors: LegacyProjectMonitorsRequest; + let httpProjectMonitors: LegacyProjectMonitorsRequest; + let tcpProjectMonitors: LegacyProjectMonitorsRequest; + let icmpProjectMonitors: LegacyProjectMonitorsRequest; let testPolicyId = ''; const testPrivateLocations = new PrivateLocationTestService(getService); - const setUniqueIds = (request: ProjectMonitorsRequest) => { + const setUniqueIds = (request: LegacyProjectMonitorsRequest) => { return { ...request, monitors: request.monitors.map((monitor) => ({ ...monitor, id: uuid.v4() })), diff --git a/x-pack/test/api_integration/apis/synthetics/index.ts b/x-pack/test/api_integration/apis/synthetics/index.ts new file mode 100644 index 0000000000000..763afc371b045 --- /dev/null +++ b/x-pack/test/api_integration/apis/synthetics/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 '../../ftr_provider_context'; + +export default function ({ getService, loadTestFile }: FtrProviderContext) { + const esDeleteAllIndices = getService('esDeleteAllIndices'); + + describe('synthetics CRUD routes', () => { + before(async () => { + await esDeleteAllIndices('heartbeat*'); + await esDeleteAllIndices('synthetics*'); + }); + + loadTestFile(require.resolve('./get_monitor')); + loadTestFile(require.resolve('./get_monitor_overview')); + loadTestFile(require.resolve('./add_monitor')); + loadTestFile(require.resolve('./add_monitor_project_legacy')); + loadTestFile(require.resolve('./add_monitor_project')); + loadTestFile(require.resolve('./get_monitor_project')); + loadTestFile(require.resolve('./add_monitor_private_location')); + loadTestFile(require.resolve('./edit_monitor')); + loadTestFile(require.resolve('./delete_monitor')); + loadTestFile(require.resolve('./delete_monitor_project')); + loadTestFile(require.resolve('./synthetics_enablement')); + }); +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/services/private_location_test_service.ts b/x-pack/test/api_integration/apis/synthetics/services/private_location_test_service.ts similarity index 90% rename from x-pack/test/api_integration/apis/uptime/rest/services/private_location_test_service.ts rename to x-pack/test/api_integration/apis/synthetics/services/private_location_test_service.ts index 6fa082bff2c10..3be86d6e39414 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/services/private_location_test_service.ts +++ b/x-pack/test/api_integration/apis/synthetics/services/private_location_test_service.ts @@ -7,8 +7,8 @@ import { privateLocationsSavedObjectName } from '@kbn/synthetics-plugin/common/saved_objects/private_locations'; import { privateLocationsSavedObjectId } from '@kbn/synthetics-plugin/server/legacy_uptime/lib/saved_objects/private_locations'; -import { FtrProviderContext } from '../../../../ftr_provider_context'; -import { KibanaSupertestProvider } from '../../../../../../../test/api_integration/services/supertest'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { KibanaSupertestProvider } from '../../../../../../test/api_integration/services/supertest'; export class PrivateLocationTestService { private supertestAPI: ReturnType<typeof KibanaSupertestProvider>; diff --git a/x-pack/test/api_integration/apis/uptime/rest/synthetics_enablement.ts b/x-pack/test/api_integration/apis/synthetics/synthetics_enablement.ts similarity index 99% rename from x-pack/test/api_integration/apis/uptime/rest/synthetics_enablement.ts rename to x-pack/test/api_integration/apis/synthetics/synthetics_enablement.ts index 2a48e1e2ed10e..b3566f64574bf 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/synthetics_enablement.ts +++ b/x-pack/test/api_integration/apis/synthetics/synthetics_enablement.ts @@ -5,10 +5,10 @@ * 2.0. */ -import expect from '@kbn/expect'; import { API_URLS } from '@kbn/synthetics-plugin/common/constants'; import { serviceApiKeyPrivileges } from '@kbn/synthetics-plugin/server/synthetics_service/get_api_key'; -import { FtrProviderContext } from '../../../ftr_provider_context'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { describe('/internal/uptime/service/enablement', () => { diff --git a/x-pack/test/api_integration/apis/uptime/rest/add_monitor_project.ts b/x-pack/test/api_integration/apis/uptime/rest/add_monitor_project.ts deleted file mode 100644 index 02a40be5d2f40..0000000000000 --- a/x-pack/test/api_integration/apis/uptime/rest/add_monitor_project.ts +++ /dev/null @@ -1,2121 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import fetch, { BodyInit, HeadersInit, Response } from 'node-fetch'; -import uuid from 'uuid'; -import expect from '@kbn/expect'; -import { format as formatUrl } from 'url'; -import { ConfigKey, ProjectMonitorsRequest } from '@kbn/synthetics-plugin/common/runtime_types'; -import { API_URLS } from '@kbn/synthetics-plugin/common/constants'; -import { formatKibanaNamespace } from '@kbn/synthetics-plugin/common/formatters'; -import { syntheticsMonitorType } from '@kbn/synthetics-plugin/server/legacy_uptime/lib/saved_objects/synthetics_monitor'; -import { PackagePolicy } from '@kbn/fleet-plugin/common'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { getFixtureJson } from './helper/get_fixture_json'; -import { PrivateLocationTestService } from './services/private_location_test_service'; -import { comparePolicies, getTestProjectSyntheticsPolicy } from './sample_data/test_policy'; - -export default function ({ getService }: FtrProviderContext) { - describe('AddProjectMonitors', function () { - this.tags('skipCloud'); - - const supertest = getService('supertest'); - const config = getService('config'); - const kibanaServerUrl = formatUrl(config.get('servers.kibana')); - const supertestWithoutAuth = getService('supertestWithoutAuth'); - const security = getService('security'); - const kibanaServer = getService('kibanaServer'); - const projectMonitorEndpoint = kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY; - - let projectMonitors: ProjectMonitorsRequest; - let httpProjectMonitors: ProjectMonitorsRequest; - let tcpProjectMonitors: ProjectMonitorsRequest; - let icmpProjectMonitors: ProjectMonitorsRequest; - - let testPolicyId = ''; - const testPrivateLocations = new PrivateLocationTestService(getService); - - const setUniqueIds = (request: ProjectMonitorsRequest) => { - return { - ...request, - monitors: request.monitors.map((monitor) => ({ ...monitor, id: uuid.v4() })), - }; - }; - - const deleteMonitor = async ( - journeyId: string, - projectId: string, - space: string = 'default', - username: string = '', - password: string = '' - ) => { - try { - const response = await supertest - .get(`/s/${space}${API_URLS.SYNTHETICS_MONITORS}`) - .auth(username, password) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: "${journeyId}" AND ${syntheticsMonitorType}.attributes.project_id: "${projectId}"`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - const { monitors } = response.body; - if (monitors[0]?.id) { - await supertest - .delete(`/s/${space}${API_URLS.SYNTHETICS_MONITORS}/${monitors[0].id}`) - .set('kbn-xsrf', 'true') - .send(projectMonitors) - .expect(200); - } - } catch (e) { - // eslint-disable-next-line no-console - console.error(e); - } - }; - - before(async () => { - await supertest.post('/api/fleet/setup').set('kbn-xsrf', 'true').send().expect(200); - await supertest - .post('/api/fleet/epm/packages/synthetics/0.10.3') - .set('kbn-xsrf', 'true') - .send({ force: true }) - .expect(200); - - const testPolicyName = 'Fleet test server policy' + Date.now(); - const apiResponse = await testPrivateLocations.addFleetPolicy(testPolicyName); - testPolicyId = apiResponse.body.item.id; - await testPrivateLocations.setTestLocations([testPolicyId]); - }); - - beforeEach(() => { - projectMonitors = setUniqueIds(getFixtureJson('project_browser_monitor')); - httpProjectMonitors = setUniqueIds(getFixtureJson('project_http_monitor')); - tcpProjectMonitors = setUniqueIds(getFixtureJson('project_tcp_monitor')); - icmpProjectMonitors = setUniqueIds(getFixtureJson('project_icmp_monitor')); - }); - - it('project monitors - handles browser monitors', async () => { - const successfulMonitors = [projectMonitors.monitors[0]]; - - try { - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify(projectMonitors) - ); - - expect(messages).to.have.length(2); - expect(messages[1].updatedMonitors).eql([]); - expect(messages[1].createdMonitors).eql(successfulMonitors.map((monitor) => monitor.id)); - expect(messages[1].failedMonitors).eql([]); - - for (const monitor of successfulMonitors) { - const journeyId = monitor.id; - const createdMonitorsResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) - .set('kbn-xsrf', 'true') - .expect(200); - - const decryptedCreatedMonitor = await supertest - .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) - .set('kbn-xsrf', 'true') - .expect(200); - - expect(decryptedCreatedMonitor.body.attributes).to.eql({ - __ui: { - is_zip_url_tls_enabled: false, - script_source: { - file_name: '', - is_generated_script: false, - }, - }, - config_id: '', - custom_heartbeat_id: `${journeyId}-test-suite-default`, - 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: 'localhost', - isInvalid: false, - isServiceManaged: true, - label: 'Local Synthetics Service', - status: 'experimental', - url: 'mockDevUrl', - }, - ], - name: 'check if title is present', - namespace: 'default', - origin: 'project', - original_space: 'default', - playwright_options: '{"headless":true,"chromiumSandbox":false}', - playwright_text_assertion: '', - project_id: 'test-suite', - params: '', - revision: 1, - schedule: { - number: '10', - unit: 'm', - }, - screenshots: 'on', - 'service.name': '', - 'source.zip_url.folder': '', - 'source.zip_url.proxy_url': '', - 'source.zip_url.url': '', - 'source.zip_url.password': '', - 'source.zip_url.username': '', - synthetics_args: [], - tags: [], - 'throttling.config': '5d/3u/20l', - 'throttling.download_speed': '5', - 'throttling.is_enabled': true, - 'throttling.latency': '20', - 'throttling.upload_speed': '3', - '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: '', - hash: 'ekrjelkjrelkjre', - }); - } - } finally { - await Promise.all([ - successfulMonitors.map((monitor) => { - return deleteMonitor(monitor.id, httpProjectMonitors.project); - }), - ]); - } - }); - - it('project monitors - handles http monitors', async () => { - const kibanaVersion = await kibanaServer.version.get(); - const successfulMonitors = [httpProjectMonitors.monitors[1]]; - - try { - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify(httpProjectMonitors) - ); - - expect(messages).to.have.length(3); - expect(messages[2].updatedMonitors).eql([]); - expect(messages[2].createdMonitors).eql(successfulMonitors.map((monitor) => monitor.id)); - expect(messages[2].failedMonitors).eql([ - { - id: httpProjectMonitors.monitors[0].id, - details: `Multiple urls are not supported for http project monitors in ${kibanaVersion}. Please set only 1 url per monitor. You monitor was not created or updated.`, - reason: 'Unsupported Heartbeat option', - }, - { - 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 createdMonitorsResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) - .set('kbn-xsrf', 'true') - .expect(200); - - const decryptedCreatedMonitor = await supertest - .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) - .set('kbn-xsrf', 'true') - .expect(200); - - expect(decryptedCreatedMonitor.body.attributes).to.eql({ - __ui: { - is_tls_enabled: false, - }, - 'check.request.method': 'POST', - 'check.response.status': ['200'], - config_id: '', - custom_heartbeat_id: `${journeyId}-test-suite-default`, - 'check.response.body.negative': [], - 'check.response.body.positive': ['Saved', 'saved'], - 'check.response.headers': {}, - 'check.request.body': { - type: 'text', - value: '', - }, - 'check.request.headers': { - 'Content-Type': 'application/x-www-form-urlencoded', - }, - enabled: false, - form_monitor_type: 'http', - journey_id: journeyId, - locations: [ - { - geo: { - lat: 0, - lon: 0, - }, - id: 'localhost', - isInvalid: false, - isServiceManaged: true, - label: 'Local Synthetics Service', - status: 'experimental', - url: 'mockDevUrl', - }, - ], - max_redirects: '0', - name: monitor.name, - namespace: 'default', - origin: 'project', - original_space: 'default', - project_id: 'test-suite', - username: '', - password: '', - proxy_url: '', - 'response.include_body': 'always', - 'response.include_headers': false, - 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': '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: '', - hash: 'ekrjelkjrelkjre', - }); - } - } finally { - await Promise.all([ - successfulMonitors.map((monitor) => { - return deleteMonitor(monitor.id, httpProjectMonitors.project); - }), - ]); - } - }); - - it('project monitors - handles tcp monitors', async () => { - const successfulMonitors = [tcpProjectMonitors.monitors[0], tcpProjectMonitors.monitors[1]]; - const kibanaVersion = await kibanaServer.version.get(); - - try { - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify(tcpProjectMonitors) - ); - - expect(messages).to.have.length(3); - expect(messages[2].updatedMonitors).eql([]); - expect(messages[2].createdMonitors).eql(successfulMonitors.map((monitor) => monitor.id)); - expect(messages[2].failedMonitors).eql([ - { - id: tcpProjectMonitors.monitors[2].id, - details: `Multiple hosts are not supported for tcp project monitors in ${kibanaVersion}. Please set only 1 host per monitor. You monitor was not created or updated.`, - reason: 'Unsupported Heartbeat option', - }, - { - 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 createdMonitorsResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) - .set('kbn-xsrf', 'true') - .expect(200); - - const decryptedCreatedMonitor = await supertest - .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) - .set('kbn-xsrf', 'true') - .expect(200); - - expect(decryptedCreatedMonitor.body.attributes).to.eql({ - __ui: { - is_tls_enabled: false, - }, - config_id: '', - custom_heartbeat_id: `${journeyId}-test-suite-default`, - 'check.receive': '', - 'check.send': '', - enabled: true, - form_monitor_type: 'tcp', - journey_id: journeyId, - locations: [ - { - geo: { - lat: 0, - lon: 0, - }, - id: 'localhost', - isInvalid: false, - isServiceManaged: true, - label: 'Local Synthetics Service', - status: 'experimental', - url: 'mockDevUrl', - }, - ], - name: monitor.name, - namespace: 'default', - origin: 'project', - original_space: 'default', - project_id: 'test-suite', - 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': '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: '', - hash: 'ekrjelkjrelkjre', - }); - } - } finally { - await Promise.all([ - successfulMonitors.map((monitor) => { - return deleteMonitor(monitor.id, tcpProjectMonitors.project); - }), - ]); - } - }); - - it('project monitors - handles icmp monitors', async () => { - const successfulMonitors = [icmpProjectMonitors.monitors[0], icmpProjectMonitors.monitors[1]]; - const kibanaVersion = await kibanaServer.version.get(); - - try { - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify(icmpProjectMonitors) - ); - - expect(messages).to.have.length(3); - expect(messages[2].updatedMonitors).eql([]); - expect(messages[2].createdMonitors).eql(successfulMonitors.map((monitor) => monitor.id)); - expect(messages[2].failedMonitors).eql([ - { - id: icmpProjectMonitors.monitors[2].id, - details: `Multiple hosts are not supported for icmp project monitors in ${kibanaVersion}. Please set only 1 host per monitor. You monitor was not created or updated.`, - reason: 'Unsupported Heartbeat option', - }, - { - 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(API_URLS.SYNTHETICS_MONITORS) - .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) - .set('kbn-xsrf', 'true') - .expect(200); - - const decryptedCreatedMonitor = await supertest - .get(`${API_URLS.SYNTHETICS_MONITORS}/${createdMonitorsResponse.body.monitors[0].id}`) - .set('kbn-xsrf', 'true') - .expect(200); - - expect(decryptedCreatedMonitor.body.attributes).to.eql({ - config_id: '', - custom_heartbeat_id: `${journeyId}-test-suite-default`, - enabled: true, - form_monitor_type: 'icmp', - journey_id: journeyId, - locations: [ - { - geo: { - lat: 0, - lon: 0, - }, - id: 'localhost', - isInvalid: false, - isServiceManaged: true, - label: 'Local Synthetics Service', - status: 'experimental', - url: 'mockDevUrl', - }, - { - agentPolicyId: testPolicyId, - concurrentMonitors: 1, - geo: { - lat: '', - lon: '', - }, - id: testPolicyId, - isInvalid: false, - isServiceManaged: false, - label: 'Test private location 0', - }, - ], - name: monitor.name, - namespace: 'default', - origin: 'project', - original_space: 'default', - project_id: 'test-suite', - 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: '', - hash: 'ekrjelkjrelkjre', - }); - } - } finally { - await Promise.all([ - successfulMonitors.map((monitor) => { - return deleteMonitor(monitor.id, icmpProjectMonitors.project); - }), - ]); - } - }); - - it('project monitors - returns a list of successfully created monitors', async () => { - try { - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify(projectMonitors) - ); - - expect(messages).to.have.length(2); - expect(messages[1].updatedMonitors).eql([]); - expect(messages[1].failedMonitors).eql([]); - expect(messages[1].createdMonitors).eql( - projectMonitors.monitors.map((monitor) => monitor.id) - ); - } finally { - await Promise.all([ - projectMonitors.monitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - } - }); - - it('project monitors - returns a list of successfully updated monitors', async () => { - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send(projectMonitors); - - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify(projectMonitors) - ); - - expect(messages).to.have.length(2); - expect(messages[0]).eql(' 1 monitor found with no changes.'); - expect(messages[1].createdMonitors).eql([]); - expect(messages[1].failedMonitors).eql([]); - expect(messages[1].updatedMonitors).eql( - projectMonitors.monitors.map((monitor) => monitor.id) - ); - } finally { - await Promise.all([ - projectMonitors.monitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - } - }); - - it('project monitors - does not increment monitor revision unless a change has been made', async () => { - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send(projectMonitors); - - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send(projectMonitors); - - const updatedMonitorsResponse = await Promise.all( - projectMonitors.monitors.map((monitor) => { - return supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitor.id}` }) - .set('kbn-xsrf', 'true') - .expect(200); - }) - ); - - updatedMonitorsResponse.forEach((response) => { - expect(response.body.monitors[0].attributes.revision).eql(1); - }); - } finally { - await Promise.all([ - projectMonitors.monitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - } - }); - - it('project monitors - increments monitor revision when a change has been made', async () => { - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send(projectMonitors); - - const editedMonitors = { - ...projectMonitors, - monitors: projectMonitors.monitors.map((monitor) => ({ - ...monitor, - content: 'changed content', - })), - }; - - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify(editedMonitors) - ); - - const updatedMonitorsResponse = await Promise.all( - projectMonitors.monitors.map((monitor) => { - return supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitor.id}` }) - .set('kbn-xsrf', 'true') - .expect(200); - }) - ); - - updatedMonitorsResponse.forEach((response) => { - expect(response.body.monitors[0].attributes.revision).eql(2); - }); - expect(messages[0]).eql('1 monitor updated successfully. '); - } finally { - await Promise.all([ - projectMonitors.monitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - } - }); - - it('project monitors - does not delete monitors when keep stale is true', async () => { - const secondMonitor = { ...projectMonitors.monitors[0], id: 'test-id-2' }; - const testMonitors = [projectMonitors.monitors[0], secondMonitor]; - - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - monitors: testMonitors, - }); - - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify(projectMonitors) - ); - - expect(messages).to.have.length(2); - expect(messages[0]).eql(' 1 monitor found with no changes.'); - expect(messages[1].createdMonitors).eql([]); - expect(messages[1].failedMonitors).eql([]); - expect(messages[1].deletedMonitors).eql([]); - expect(messages[1].updatedMonitors).eql([projectMonitors.monitors[0].id]); - expect(messages[1].staleMonitors).eql([secondMonitor.id]); - // does not delete the stale monitor - const getResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${secondMonitor.id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - const { monitors } = getResponse.body; - - expect(monitors.length).eql(1); - } finally { - await Promise.all([ - testMonitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - } - }); - - it('project monitors - deletes monitors when keep stale is false', async () => { - const secondMonitor = { ...projectMonitors.monitors[0], id: 'test-id-2' }; - const testMonitors = [projectMonitors.monitors[0], secondMonitor]; - - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - keep_stale: false, - monitors: testMonitors, - project: 'test-project-2', - }); - - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify({ - ...projectMonitors, - keep_stale: false, - project: 'test-project-2', - }) - ); - - expect(messages).to.have.length(3); - - // expect monitor to have been deleted - const getResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${secondMonitor.id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - const { monitors } = getResponse.body; - expect(monitors[0]).eql(undefined); - expect(messages[0]).eql(` 1 monitor found with no changes.`); - expect(messages[1]).eql(`Monitor ${secondMonitor.id} deleted successfully`); - expect(messages[2].createdMonitors).eql([]); - expect(messages[2].failedMonitors).eql([]); - expect(messages[2].updatedMonitors).eql([projectMonitors.monitors[0].id]); - expect(messages[2].deletedMonitors).eql([secondMonitor.id]); - expect(messages[2].staleMonitors).eql([]); - } finally { - await Promise.all([ - testMonitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - } - }); - - it('project monitors - does not delete monitors from different suites when keep stale is false', async () => { - const secondMonitor = { ...projectMonitors.monitors[0], id: 'test-id-2' }; - const testMonitors = [projectMonitors.monitors[0], secondMonitor]; - const testprojectId = 'test-suite-2'; - try { - await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify({ - ...projectMonitors, - keep_stale: false, - monitors: testMonitors, - }) - ); - - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify({ - ...projectMonitors, - keep_stale: false, - project: testprojectId, - }) - ); - - expect(messages).to.have.length(2); - expect(messages[1].createdMonitors).eql([projectMonitors.monitors[0].id]); - expect(messages[1].failedMonitors).eql([]); - expect(messages[1].deletedMonitors).eql([]); - expect(messages[1].updatedMonitors).eql([]); - expect(messages[1].staleMonitors).eql([]); - - // expect monitor not to have been deleted - const getResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${secondMonitor.id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - const { monitors } = getResponse.body; - - expect(monitors.length).eql(1); - } finally { - await Promise.all([ - testMonitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - - await Promise.all([ - testMonitors.map((monitor) => { - return deleteMonitor(monitor.id, testprojectId); - }), - ]); - } - }); - - it('project monitors - does not delete a monitor from the same suite in a different space', async () => { - const secondMonitor = { ...projectMonitors.monitors[0], id: 'test-id-2' }; - const testMonitors = [projectMonitors.monitors[0], secondMonitor]; - const username = 'admin'; - const roleName = `synthetics_admin`; - const password = `${username}-password`; - const SPACE_ID = `test-space-${uuid.v4()}`; - const SPACE_NAME = `test-space-name ${uuid.v4()}`; - await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); - try { - await security.role.create(roleName, { - kibana: [ - { - feature: { - uptime: ['all'], - }, - spaces: ['*'], - }, - ], - }); - await security.user.create(username, { - password, - roles: [roleName], - full_name: 'a kibana user', - }); - await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify({ ...projectMonitors, keep_stale: false, monitors: testMonitors }), - { - Authorization: - 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64'), - } - ); - - const spaceUrl = - kibanaServerUrl + `/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY}`; - - const messages = await parseStreamApiResponse( - spaceUrl, - JSON.stringify({ ...projectMonitors, keep_stale: false }), - { - Authorization: - 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64'), - } - ); - expect(messages).to.have.length(2); - expect(messages[1].createdMonitors).eql([projectMonitors.monitors[0].id]); - expect(messages[1].failedMonitors).eql([]); - expect(messages[1].deletedMonitors).eql([]); - expect(messages[1].updatedMonitors).eql([]); - expect(messages[1].staleMonitors).eql([]); - - const getResponse = await supertestWithoutAuth - .get(API_URLS.SYNTHETICS_MONITORS) - .auth(username, password) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${secondMonitor.id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - const { monitors } = getResponse.body; - expect(monitors.length).eql(1); - } finally { - await Promise.all([ - testMonitors.map((monitor) => { - return deleteMonitor( - monitor.id, - projectMonitors.project, - 'default', - username, - password - ); - }), - ]); - await deleteMonitor( - projectMonitors.monitors[0].id, - projectMonitors.project, - SPACE_ID, - username, - password - ); - await security.user.delete(username); - await security.role.delete(roleName); - } - }); - - it('project monitors - validates monitor type', async () => { - try { - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify({ - ...projectMonitors, - monitors: [{ ...projectMonitors.monitors[0], schedule: '3m', tags: '' }], - }) - ); - - expect(messages).to.have.length(1); - expect(messages[0].updatedMonitors).eql([]); - expect(messages[0].failedMonitors).eql([ - { - 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: ['localhost'], - 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', - }, - reason: 'Failed to save or update monitor. Configuration is not valid', - }, - ]); - expect(messages[0].createdMonitors).eql([]); - } finally { - await Promise.all([ - projectMonitors.monitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - } - }); - - it('project monitors - saves space as data stream namespace', async () => { - const username = 'admin'; - const roleName = `synthetics_admin`; - const password = `${username}-password`; - const SPACE_ID = `test-space-${uuid.v4()}`; - const SPACE_NAME = `test-space-name ${uuid.v4()}`; - await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); - try { - await security.role.create(roleName, { - kibana: [ - { - feature: { - uptime: ['all'], - }, - spaces: ['*'], - }, - ], - }); - await security.user.create(username, { - password, - roles: [roleName], - full_name: 'a kibana user', - }); - await supertestWithoutAuth - .put(`/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY}`) - .auth(username, password) - .set('kbn-xsrf', 'true') - .send(projectMonitors) - .expect(200); - // expect monitor not to have been deleted - const getResponse = await supertestWithoutAuth - .get(`/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS}`) - .auth(username, password) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - const { monitors } = getResponse.body; - expect(monitors.length).eql(1); - expect(monitors[0].attributes[ConfigKey.NAMESPACE]).eql(formatKibanaNamespace(SPACE_ID)); - } finally { - await deleteMonitor( - projectMonitors.monitors[0].id, - projectMonitors.project, - SPACE_ID, - username, - password - ); - await security.user.delete(username); - await security.role.delete(roleName); - } - }); - - it('project monitors - formats custom id appropriately', async () => { - const username = 'admin'; - const roleName = `synthetics_admin`; - const password = `${username}-password`; - const SPACE_ID = `test-space-${uuid.v4()}`; - const SPACE_NAME = `test-space-name ${uuid.v4()}`; - await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); - try { - await security.role.create(roleName, { - kibana: [ - { - feature: { - uptime: ['all'], - }, - spaces: ['*'], - }, - ], - }); - await security.user.create(username, { - password, - roles: [roleName], - full_name: 'a kibana user', - }); - await supertestWithoutAuth - .put(`/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY}`) - .auth(username, password) - .set('kbn-xsrf', 'true') - .send(projectMonitors) - .expect(200); - // expect monitor not to have been deleted - const getResponse = await supertestWithoutAuth - .get(`/s/${SPACE_ID}${API_URLS.SYNTHETICS_MONITORS}`) - .auth(username, password) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - const { monitors } = getResponse.body; - expect(monitors.length).eql(1); - expect(monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]).eql( - `${projectMonitors.monitors[0].id}-${projectMonitors.project}-${SPACE_ID}` - ); - } finally { - await deleteMonitor( - projectMonitors.monitors[0].id, - projectMonitors.project, - SPACE_ID, - username, - password - ); - await security.user.delete(username); - await security.role.delete(roleName); - } - }); - - it('project monitors - is able to decrypt monitor when updated after hydration', async () => { - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send(projectMonitors); - - const response = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - const { monitors } = response.body; - - // add urls and ports to mimic hydration - const updates = { - [ConfigKey.URLS]: 'https://modified-host.com', - [ConfigKey.PORT]: 443, - }; - - const modifiedMonitor = { ...monitors[0]?.attributes, ...updates }; - - await supertest - .put(API_URLS.SYNTHETICS_MONITORS + '/' + monitors[0]?.id) - .set('kbn-xsrf', 'true') - .send(modifiedMonitor) - .expect(200); - - // update project monitor via push api - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify(projectMonitors) - ); - expect(messages).to.have.length(2); - expect(messages[0]).eql('1 monitor updated successfully. '); - expect(messages[1].updatedMonitors).eql([projectMonitors.monitors[0].id]); - - // ensure that monitor can still be decrypted - await supertest - .get(API_URLS.SYNTHETICS_MONITORS + '/' + monitors[0]?.id) - .set('kbn-xsrf', 'true') - .expect(200); - } finally { - await Promise.all([ - projectMonitors.monitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - } - }); - - it('project monitors - is able to enable and disable monitors', async () => { - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send(projectMonitors); - - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - monitors: [ - { - ...projectMonitors.monitors[0], - enabled: false, - }, - ], - }) - .expect(200); - const response = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - const { monitors } = response.body; - expect(monitors[0].attributes.enabled).eql(false); - } finally { - await Promise.all([ - projectMonitors.monitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - } - }); - - it('project monitors - returns a failed monitor when user defines a private location without fleet permissions', async () => { - const secondMonitor = { - ...projectMonitors.monitors[0], - id: 'test-id-2', - privateLocations: ['Test private location 0'], - }; - const testMonitors = [projectMonitors.monitors[0], secondMonitor]; - const username = 'admin'; - const roleName = 'uptime read only'; - const password = `${username}-password`; - try { - await security.role.create(roleName, { - kibana: [ - { - feature: { - uptime: ['all'], - }, - spaces: ['*'], - }, - ], - }); - await security.user.create(username, { - password, - roles: [roleName], - full_name: 'a kibana user', - }); - - const messages = await parseStreamApiResponse( - kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY, - JSON.stringify({ - ...projectMonitors, - keep_stale: false, - monitors: testMonitors, - }), - { - Authorization: - 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64'), - } - ); - - expect(messages).to.have.length(3); - expect(messages[0]).to.eql('test-id-2: failed to create or update monitor'); - expect(messages[1]).to.eql(`1 monitor created successfully.`); - expect(messages[2]).to.eql({ - createdMonitors: [testMonitors[0].id], - updatedMonitors: [], - staleMonitors: [], - deletedMonitors: [], - failedMonitors: [ - { - details: - 'Insufficient permissions. In order to configure private locations, you must have Fleet and Integrations write permissions. To resolve, please generate a new API key with a user who has Fleet and Integrations write permissions.', - id: 'test-id-2', - payload: { - content: - 'UEsDBBQACAAIAON5qVQAAAAAAAAAAAAAAAAfAAAAZXhhbXBsZXMvdG9kb3MvYmFzaWMuam91cm5leS50c22Q0WrDMAxF3/sVF7MHB0LMXlc6RvcN+wDPVWNviW0sdUsp/fe5SSiD7UFCWFfHujIGlpnkybwxFTZfoY/E3hsaLEtwhs9RPNWKDU12zAOxkXRIbN4tB9d9pFOJdO6EN2HMqQguWN9asFBuQVMmJ7jiWNII9fIXrbabdUYr58l9IhwhQQZCYORCTFFUC31Btj21NRc7Mq4Nds+4bDD/pNVgT9F52Jyr2Fa+g75LAPttg8yErk+S9ELpTmVotlVwnfNCuh2lepl3+JflUmSBJ3uggt1v9INW/lHNLKze9dJe1J3QJK8pSvWkm6aTtCet5puq+x63+AFQSwcIAPQ3VfcAAACcAQAAUEsBAi0DFAAIAAgA43mpVAD0N1X3AAAAnAEAAB8AAAAAAAAAAAAgAKSBAAAAAGV4YW1wbGVzL3RvZG9zL2Jhc2ljLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBNAAAARAEAAAAA', - filter: { - match: 'check if title is present', - }, - id: 'test-id-2', - locations: ['localhost'], - name: 'check if title is present', - params: {}, - playwrightOptions: { - chromiumSandbox: false, - headless: true, - }, - privateLocations: ['Test private location 0'], - schedule: 10, - tags: [], - throttling: { - download: 5, - latency: 20, - upload: 3, - }, - hash: 'ekrjelkjrelkjre', - }, - reason: 'Failed to create or update monitor', - }, - ], - failedStaleMonitors: [], - }); - } finally { - await Promise.all([ - testMonitors.map((monitor) => { - return deleteMonitor( - monitor.id, - projectMonitors.project, - 'default', - username, - password - ); - }), - ]); - await security.user.delete(username); - await security.role.delete(roleName); - } - }); - - it('project monitors - returns a failed monitor when user tries to delete a monitor without fleet permissions', async () => { - const secondMonitor = { - ...projectMonitors.monitors[0], - id: 'test-id-2', - privateLocations: ['Test private location 0'], - }; - const testMonitors = [projectMonitors.monitors[0], secondMonitor]; - const username = 'test-username'; - const roleName = 'uptime read only'; - const password = `test-password`; - try { - await security.role.create(roleName, { - kibana: [ - { - feature: { - uptime: ['all'], - }, - spaces: ['*'], - }, - ], - }); - await security.user.create(username, { - password, - roles: [roleName], - full_name: 'a kibana user', - }); - - await parseStreamApiResponse( - kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY, - JSON.stringify({ - ...projectMonitors, - keep_stale: false, - monitors: testMonitors, - }) - ); - - const messages = await parseStreamApiResponse( - kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY, - JSON.stringify({ - ...projectMonitors, - keep_stale: false, - monitors: [], - }), - { - Authorization: - 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64'), - } - ); - - expect(messages).to.have.length(3); - expect( - messages.filter((msg) => msg === `Monitor ${testMonitors[1].id} could not be deleted`) - ).to.have.length(1); - expect( - messages.filter((msg) => msg === `Monitor ${testMonitors[0].id} deleted successfully`) - ).to.have.length(1); - expect(messages[2]).to.eql({ - createdMonitors: [], - updatedMonitors: [], - staleMonitors: [], - deletedMonitors: [testMonitors[0].id], - failedMonitors: [], - failedStaleMonitors: [ - { - details: - 'Unable to delete Synthetics package policy for monitor check if title is present. Fleet write permissions are needed to use Synthetics private locations.', - id: 'test-id-2', - reason: 'Failed to delete stale monitor', - }, - ], - }); - - const messages2 = await parseStreamApiResponse( - kibanaServerUrl + API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY, - JSON.stringify({ - ...projectMonitors, - keep_stale: false, - monitors: [], - }) - ); - - expect(messages2).to.have.length(2); - expect(messages2[0]).to.eql(`Monitor ${testMonitors[1].id} deleted successfully`); - expect(messages2[1]).to.eql({ - createdMonitors: [], - updatedMonitors: [], - staleMonitors: [], - deletedMonitors: [testMonitors[1].id], - failedMonitors: [], - failedStaleMonitors: [], - }); - } finally { - await Promise.all([ - testMonitors.map((monitor) => { - return deleteMonitor( - monitor.id, - projectMonitors.project, - 'default', - username, - password - ); - }), - ]); - await security.user.delete(username); - await security.role.delete(roleName); - } - }); - - it('project monitors - returns a successful monitor when user defines a private location with fleet permissions', async () => { - const secondMonitor = { - ...projectMonitors.monitors[0], - id: 'test-id-2', - privateLocations: ['Test private location 0'], - }; - const testMonitors = [projectMonitors.monitors[0], secondMonitor]; - const username = 'admin'; - const roleName = 'uptime with fleet'; - const password = `${username}-password`; - try { - await security.role.create(roleName, { - kibana: [ - { - feature: { - uptime: ['all'], - fleetv2: ['all'], - fleet: ['all'], - }, - spaces: ['*'], - }, - ], - }); - await security.user.create(username, { - password, - roles: [roleName], - full_name: 'a kibana user', - }); - const messages = await parseStreamApiResponse( - projectMonitorEndpoint, - JSON.stringify({ - ...projectMonitors, - keep_stale: false, - monitors: testMonitors, - }) - ); - expect(messages).to.have.length(2); - expect(messages).to.eql([ - `2 monitors created successfully.`, - { - createdMonitors: [testMonitors[0].id, 'test-id-2'], - updatedMonitors: [], - staleMonitors: [], - deletedMonitors: [], - failedMonitors: [], - failedStaleMonitors: [], - }, - ]); - } finally { - await Promise.all([ - testMonitors.map((monitor) => { - return deleteMonitor( - monitor.id, - projectMonitors.project, - 'default', - username, - password - ); - }), - ]); - await security.user.delete(username); - await security.role.delete(roleName); - } - }); - - it('creates integration policies for project monitors with private locations', async () => { - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - monitors: [ - { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, - ], - }); - - const monitorsResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] - }-${testPolicyId}` - ); - expect(packagePolicy.name).eql( - `${projectMonitors.monitors[0].id}-${projectMonitors.project}-default-Test private location 0` - ); - expect(packagePolicy.policy_id).eql(testPolicyId); - - const configId = monitorsResponse.body.monitors[0].id; - const id = monitorsResponse.body.monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; - - comparePolicies( - packagePolicy, - getTestProjectSyntheticsPolicy({ - inputs: {}, - name: 'check if title is present-Test private location 0', - id, - configId, - }) - ); - } finally { - await deleteMonitor(projectMonitors.monitors[0].id, projectMonitors.project); - - const packagesResponse = await supertest.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 monitorRequest = { - ...httpProjectMonitors, - monitors: [ - { ...httpProjectMonitors.monitors[1], privateLocations: ['Test private location 0'] }, - ], - }; - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send(monitorRequest); - - const monitorsResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitorRequest.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] - }-${testPolicyId}` - ); - - expect(packagePolicy.policy_id).eql(testPolicyId); - - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...monitorRequest, - monitors: [{ ...monitorRequest.monitors[0], privateLocations: [] }], - }); - - const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] - }-${testPolicyId}` - ); - - expect(packagePolicy2).eql(undefined); - } finally { - await deleteMonitor(projectMonitors.monitors[0].id, projectMonitors.project); - } - }); - - it('deletes integration policies for project monitors when private location is removed from the monitor', async () => { - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - monitors: [ - { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, - ], - }); - - const monitorsResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] - }-${testPolicyId}` - ); - - expect(packagePolicy.policy_id).eql(testPolicyId); - - const configId = monitorsResponse.body.monitors[0].id; - const id = monitorsResponse.body.monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; - - comparePolicies( - packagePolicy, - getTestProjectSyntheticsPolicy({ - inputs: {}, - name: 'check if title is present-Test private location 0', - id, - configId, - }) - ); - - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - monitors: [{ ...projectMonitors.monitors[0], privateLocations: [] }], - }); - - const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] - }-${testPolicyId}` - ); - - expect(packagePolicy2).eql(undefined); - } finally { - await deleteMonitor(projectMonitors.monitors[0].id, projectMonitors.project); - - const apiResponsePolicy2 = await supertest.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('deletes integration policies when project monitors are deleted', async () => { - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - monitors: [ - { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, - ], - }) - .expect(200); - - const monitorsResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + - '-' + - testPolicyId - ); - - expect(packagePolicy.policy_id).eql(testPolicyId); - - const configId = monitorsResponse.body.monitors[0].id; - const id = monitorsResponse.body.monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; - - comparePolicies( - packagePolicy, - getTestProjectSyntheticsPolicy({ - inputs: {}, - name: 'check if title is present-Test private location 0', - id, - configId, - }) - ); - - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - monitors: [], - keep_stale: false, - }); - - const monitorsResponse2 = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - expect(monitorsResponse2.body.monitors.length).eql(0); - - await new Promise((resolve) => { - setTimeout(() => resolve(null), 3000); - }); - - const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] + - '-' + - testPolicyId - ); - - expect(packagePolicy2).eql(undefined); - } finally { - await deleteMonitor(projectMonitors.monitors[0].id, projectMonitors.project); - - const apiResponsePolicy2 = await supertest.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('deletes integration policies when project monitors are deleted - lightweight', async () => { - const monitorRequest = { - ...httpProjectMonitors, - monitors: [ - { ...httpProjectMonitors.monitors[1], privateLocations: ['Test private location 0'] }, - ], - }; - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send(monitorRequest); - - const monitorsResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitorRequest.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] - }-${testPolicyId}` - ); - - expect(packagePolicy.policy_id).eql(testPolicyId); - - const configId = monitorsResponse.body.monitors[0].id; - const id = monitorsResponse.body.monitors[0].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; - - const httpInput = packagePolicy.inputs.find( - (input: any) => input.type === 'synthetics/http' - ); - expect(httpInput).to.eql({ - type: 'synthetics/http', - policy_template: 'synthetics', - enabled: true, - streams: [ - { - enabled: true, - data_stream: { type: 'synthetics', dataset: 'http' }, - release: 'experimental', - vars: { - __ui: { value: '{"is_tls_enabled":false}', type: 'yaml' }, - enabled: { value: false, type: 'bool' }, - type: { value: 'http', type: 'text' }, - name: { value: 'My Monitor 3', type: 'text' }, - schedule: { value: '"@every 60m"', type: 'text' }, - urls: { value: 'http://localhost:9200', type: 'text' }, - 'service.name': { value: '', type: 'text' }, - timeout: { value: '80s', type: 'text' }, - max_redirects: { value: '0', type: 'integer' }, - proxy_url: { value: '', type: 'text' }, - tags: { value: '["tag2","tag2"]', type: 'yaml' }, - username: { value: '', type: 'text' }, - password: { value: '', type: 'password' }, - 'response.include_headers': { value: false, type: 'bool' }, - 'response.include_body': { value: 'always', type: 'text' }, - 'check.request.method': { value: 'POST', type: 'text' }, - 'check.request.headers': { - value: '{"Content-Type":"application/x-www-form-urlencoded"}', - type: 'yaml', - }, - 'check.request.body': { value: null, type: 'yaml' }, - 'check.response.status': { value: '["200"]', type: 'yaml' }, - 'check.response.headers': { value: null, type: 'yaml' }, - 'check.response.body.positive': { value: '["Saved","saved"]', type: 'yaml' }, - 'check.response.body.negative': { value: null, type: 'yaml' }, - 'ssl.certificate_authorities': { value: null, type: 'yaml' }, - 'ssl.certificate': { value: null, type: 'yaml' }, - 'ssl.key': { value: null, type: 'yaml' }, - 'ssl.key_passphrase': { value: null, type: 'text' }, - 'ssl.verification_mode': { value: 'full', type: 'text' }, - 'ssl.supported_protocols': { - value: '["TLSv1.1","TLSv1.2","TLSv1.3"]', - type: 'yaml', - }, - location_name: { value: 'Test private location 0', type: 'text' }, - id: { - value: id, - type: 'text', - }, - config_id: { value: configId, type: 'text' }, - run_once: { value: false, type: 'bool' }, - origin: { value: 'project', type: 'text' }, - 'monitor.project.id': { - type: 'text', - value: 'test-suite', - }, - 'monitor.project.name': { - type: 'text', - value: 'test-suite', - }, - }, - id: `synthetics/http-http-${id}-${testPolicyId}`, - compiled_stream: { - __ui: { is_tls_enabled: false }, - type: 'http', - name: 'My Monitor 3', - id, - origin: 'project', - enabled: false, - urls: 'http://localhost:9200', - schedule: '@every 60m', - timeout: '80s', - max_redirects: 0, - tags: ['tag2', 'tag2'], - 'response.include_headers': false, - 'response.include_body': 'always', - 'check.request.method': 'POST', - 'check.request.headers': { 'Content-Type': 'application/x-www-form-urlencoded' }, - 'check.response.status': ['200'], - 'check.response.body.positive': ['Saved', 'saved'], - 'ssl.verification_mode': 'full', - 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], - processors: [ - { add_observer_metadata: { geo: { name: 'Test private location 0' } } }, - { - add_fields: { - target: '', - fields: { - 'monitor.fleet_managed': true, - config_id: configId, - 'monitor.project.id': 'test-suite', - 'monitor.project.name': 'test-suite', - }, - }, - }, - ], - }, - }, - ], - }); - - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...monitorRequest, - monitors: [], - }); - - const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID] - } - ${testPolicyId}` - ); - - expect(packagePolicy2).eql(undefined); - } finally { - await deleteMonitor(httpProjectMonitors.monitors[1].id, httpProjectMonitors.project); - - const apiResponsePolicy2 = await supertest.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 () => { - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - monitors: [ - { - ...projectMonitors.monitors[0], - privateLocations: ['Test private location 0'], - }, - ], - }); - - const monitorsResponse = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ - filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, - }) - .set('kbn-xsrf', 'true') - .expect(200); - - const apiResponsePolicy = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; - const policyId = `${id}-${testPolicyId}`; - - const packagePolicy = apiResponsePolicy.body.items.find( - (pkgPolicy: PackagePolicy) => pkgPolicy.id === policyId - ); - - expect(packagePolicy.policy_id).eql(testPolicyId); - - comparePolicies( - packagePolicy, - getTestProjectSyntheticsPolicy({ - inputs: {}, - name: 'check if title is present-Test private location 0', - id, - configId, - }) - ); - - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - monitors: [ - { - ...projectMonitors.monitors[0], - privateLocations: ['Test private location 0'], - enabled: false, - }, - ], - }); - - const apiResponsePolicy2 = await supertest.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].attributes[ConfigKey.CUSTOM_HEARTBEAT_ID]; - const policyId2 = `${id}-${testPolicyId}`; - - 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-Test private location 0', - id: id2, - configId: configId2, - }) - ); - } finally { - await deleteMonitor(projectMonitors.monitors[0].id, projectMonitors.project); - - const apiResponsePolicy2 = await supertest.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 location formatting for both private and public locations', async () => { - try { - await supertest - .put(API_URLS.SYNTHETICS_MONITORS_PROJECT_LEGACY) - .set('kbn-xsrf', 'true') - .send({ - ...projectMonitors, - monitors: [ - { ...projectMonitors.monitors[0], privateLocations: ['Test private location 0'] }, - ], - }); - - const updatedMonitorsResponse = await Promise.all( - projectMonitors.monitors.map((monitor) => { - return supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitor.id}` }) - .set('kbn-xsrf', 'true') - .expect(200); - }) - ); - - updatedMonitorsResponse.forEach((response) => { - expect(response.body.monitors[0].attributes.locations).eql([ - { - id: 'localhost', - label: 'Local Synthetics Service', - geo: { lat: 0, lon: 0 }, - url: 'mockDevUrl', - isServiceManaged: true, - status: 'experimental', - isInvalid: false, - }, - { - label: 'Test private location 0', - isServiceManaged: false, - isInvalid: false, - agentPolicyId: testPolicyId, - id: testPolicyId, - geo: { - lat: '', - lon: '', - }, - concurrentMonitors: 1, - }, - ]); - }); - } finally { - await Promise.all([ - projectMonitors.monitors.map((monitor) => { - return deleteMonitor(monitor.id, projectMonitors.project); - }), - ]); - } - }); - }); -} - -/** - * Borrowed from AIOPS test code: https://github.com/elastic/kibana/blob/23a7ac2c2e2b1f64daa17b914e86989b1fde750c/x-pack/test/api_integration/apis/aiops/explain_log_rate_spikes.ts - * Receives a stream and parses the messages until the stream closes. - */ -async function* parseStream(stream: NodeJS.ReadableStream) { - let partial = ''; - - try { - for await (const value of stream) { - const full = `${partial}${value}`; - const parts = full.split('\n'); - const last = parts.pop(); - - partial = last ?? ''; - - const event = parts.map((p) => JSON.parse(p)); - - for (const events of event) { - yield events; - } - } - } catch (error) { - yield { type: 'error', payload: error.toString() }; - } -} - -/** - * Helper function to process the results of the module's stream parsing helper function. - */ -async function getMessages(stream: NodeJS.ReadableStream | null) { - if (stream === null) return []; - const data: any[] = []; - for await (const action of parseStream(stream)) { - data.push(action); - } - return data; -} - -/** - * This type is intended to highlight any break between shared parameter contracts defined in - * the module's streaming endpoint helper functions. - */ -type StreamApiFunction<T = unknown> = ( - url: string, - body?: BodyInit, - extraHeaders?: HeadersInit, - method?: string -) => T; - -/** - * This helps the test file have DRY code when it comes to calling - * the same streaming endpoint over and over by defining some selective defaults. - */ -export const parseStreamApiResponse: StreamApiFunction<Promise<any[]>> = async ( - url: string, - body?: BodyInit, - extraHeaders?: HeadersInit, - method = 'PUT' -) => { - const streamResponse = await callStreamApi(url, body, extraHeaders, method); - return getMessages(streamResponse.body); -}; - -/** - * This helps the test file have DRY code when it comes to calling - * the same streaming endpoint over and over by defining some selective defaults. - */ -const callStreamApi: StreamApiFunction<Promise<Response>> = async ( - url: string, - body?: BodyInit, - extraHeaders?: HeadersInit, - method = 'PUT' -) => { - return fetch(url, { - method, - headers: { - 'Content-Type': 'application/json', - 'kbn-xsrf': 'stream', - ...extraHeaders, - }, - body, - }); -}; diff --git a/x-pack/test/api_integration/apis/uptime/rest/get_monitor_overview.ts b/x-pack/test/api_integration/apis/uptime/rest/get_monitor_overview.ts deleted file mode 100644 index 408ab34f6e5bb..0000000000000 --- a/x-pack/test/api_integration/apis/uptime/rest/get_monitor_overview.ts +++ /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 expect from '@kbn/expect'; -import { SimpleSavedObject } from '@kbn/core/public'; -import { MonitorFields } from '@kbn/synthetics-plugin/common/runtime_types'; -import { SYNTHETICS_API_URLS, API_URLS } from '@kbn/synthetics-plugin/common/constants'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { getFixtureJson } from './helper/get_fixture_json'; - -export default function ({ getService }: FtrProviderContext) { - describe('[GET] /internal/synthetics/overview', function () { - this.tags('skipCloud'); - - const supertest = getService('supertest'); - - let _monitors: MonitorFields[]; - let monitors: MonitorFields[]; - - const deleteMonitor = async (id: string) => { - try { - await supertest - .delete(`${API_URLS.SYNTHETICS_MONITORS}/${id}`) - .set('kbn-xsrf', 'true') - .expect(200); - } catch (e) { - // eslint-disable-next-line no-console - console.error(e); - } - }; - - const saveMonitor = async (monitor: MonitorFields) => { - const res = await supertest - .post(API_URLS.SYNTHETICS_MONITORS) - .set('kbn-xsrf', 'true') - .send(monitor); - - return res.body as SimpleSavedObject<MonitorFields>; - }; - - before(async () => { - await supertest.post(API_URLS.SYNTHETICS_ENABLEMENT).set('kbn-xsrf', 'true').expect(200); - const { body } = await supertest - .get(API_URLS.SYNTHETICS_MONITORS) - .set('kbn-xsrf', 'true') - .expect(200); - await Promise.all([ - (body.monitors as Array<SimpleSavedObject<MonitorFields>>).map((monitor) => { - return deleteMonitor(monitor.id); - }), - ]); - - _monitors = [getFixtureJson('http_monitor')]; - }); - - beforeEach(() => { - monitors = []; - for (let i = 0; i < 20; i++) { - monitors.push({ - ..._monitors[0], - name: `${_monitors[0].name}${i}`, - }); - } - }); - - describe('returns total number of monitor combinations', () => { - it('returns the correct response', async () => { - let savedMonitors: SimpleSavedObject[] = []; - try { - const savedResponse = await Promise.all(monitors.map(saveMonitor)); - savedMonitors = savedResponse; - - const apiResponse = await supertest.get( - SYNTHETICS_API_URLS.SYNTHETICS_OVERVIEW + '?perPage=20' - ); - - expect(apiResponse.body.total).eql(monitors.length * 2); - expect(apiResponse.body.allMonitorIds.sort()).eql( - savedMonitors.map((monitor) => monitor.id).sort() - ); - expect(apiResponse.body.pages).to.have.keys(['0', '1']); - expect(apiResponse.body.pages[1].length).eql(20); - } finally { - await Promise.all( - savedMonitors.map((monitor) => { - return deleteMonitor(monitor.id); - }) - ); - } - }); - - it('adjusts pagination correctly', async () => { - let savedMonitors: SimpleSavedObject[] = []; - try { - const savedResponse = await Promise.all(monitors.map(saveMonitor)); - savedMonitors = savedResponse; - - const apiResponse = await supertest.get( - SYNTHETICS_API_URLS.SYNTHETICS_OVERVIEW + '?perPage=5' - ); - - expect(apiResponse.body.total).eql(monitors.length * 2); - expect(apiResponse.body.allMonitorIds.sort()).eql( - savedMonitors.map((monitor) => monitor.id).sort() - ); - expect(apiResponse.body.pages).to.have.keys(['0', '1', '2', '3', '4']); - expect(apiResponse.body.pages[1].length).eql(5); - } finally { - await Promise.all( - savedMonitors.map((monitor) => { - return deleteMonitor(monitor.id); - }) - ); - } - }); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/uptime/rest/index.ts b/x-pack/test/api_integration/apis/uptime/rest/index.ts index 2e3e6f21f34c2..e83283b730c73 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/index.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/index.ts @@ -72,18 +72,5 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./monitor_states_real_data')); loadTestFile(require.resolve('./uptime_zip_url_deprecation.ts')); }); - - describe('uptime CRUD routes', () => { - loadTestFile(require.resolve('./get_monitor')); - loadTestFile(require.resolve('./get_monitor_overview')); - loadTestFile(require.resolve('./add_monitor')); - loadTestFile(require.resolve('./add_monitor_project')); - loadTestFile(require.resolve('./get_monitor_project')); - loadTestFile(require.resolve('./add_monitor_private_location')); - loadTestFile(require.resolve('./edit_monitor')); - loadTestFile(require.resolve('./delete_monitor')); - loadTestFile(require.resolve('./delete_monitor_project')); - loadTestFile(require.resolve('./synthetics_enablement')); - }); }); } diff --git a/x-pack/test/api_integration/apis/uptime/rest/sample_data/test_policy.ts b/x-pack/test/api_integration/apis/uptime/rest/sample_data/test_policy.ts index 05bba2286e004..26418137fc23e 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/sample_data/test_policy.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/sample_data/test_policy.ts @@ -302,11 +302,13 @@ export const getTestProjectSyntheticsPolicy = ( inputs = {}, configId, id, + projectId = 'test-suite', }: { name?: string; inputs: Record<string, { value: string | boolean; type: string }>; configId: string; id: string; + projectId?: string; } = { name: 'check if title is present-Test private location 0', inputs: {}, @@ -314,9 +316,9 @@ export const getTestProjectSyntheticsPolicy = ( id: '', } ): PackagePolicy => ({ - id: '4b6abc6c-118b-4d93-a489-1135500d09f1-test-suite-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3', + id: `4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, version: 'WzEzMDksMV0=', - name: '4b6abc6c-118b-4d93-a489-1135500d09f1-test-suite-default-Test private location 0', + name: `4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-Test private location 0`, namespace: 'default', package: { name: 'synthetics', title: 'Elastic Synthetics', version: '0.10.3' }, enabled: true, @@ -368,7 +370,7 @@ export const getTestProjectSyntheticsPolicy = ( 'monitor.project.id': { type: 'text' }, 'monitor.project.name': { type: 'text' }, }, - id: 'synthetics/http-http-4b6abc6c-118b-4d93-a489-1135500d09f1-test-suite-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3', + id: `synthetics/http-http-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, }, ], }, @@ -409,7 +411,7 @@ export const getTestProjectSyntheticsPolicy = ( 'monitor.project.id': { type: 'text' }, 'monitor.project.name': { type: 'text' }, }, - id: 'synthetics/tcp-tcp-4b6abc6c-118b-4d93-a489-1135500d09f1-test-suite-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3', + id: `synthetics/tcp-tcp-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, }, ], }, @@ -441,7 +443,7 @@ export const getTestProjectSyntheticsPolicy = ( 'monitor.project.id': { type: 'text' }, 'monitor.project.name': { type: 'text' }, }, - id: 'synthetics/icmp-icmp-4b6abc6c-118b-4d93-a489-1135500d09f1-test-suite-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3', + id: `synthetics/icmp-icmp-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, }, ], }, @@ -500,11 +502,11 @@ export const getTestProjectSyntheticsPolicy = ( config_id: { value: configId, type: 'text' }, run_once: { value: false, type: 'bool' }, origin: { value: 'project', type: 'text' }, - 'monitor.project.id': { value: 'test-suite', type: 'text' }, - 'monitor.project.name': { value: 'test-suite', type: 'text' }, + 'monitor.project.id': { value: projectId, type: 'text' }, + 'monitor.project.name': { value: projectId, type: 'text' }, ...inputs, }, - id: 'synthetics/browser-browser-4b6abc6c-118b-4d93-a489-1135500d09f1-test-suite-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3', + 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: '' }, @@ -531,8 +533,8 @@ export const getTestProjectSyntheticsPolicy = ( fields: { 'monitor.fleet_managed': true, config_id: configId, - 'monitor.project.name': 'test-suite', - 'monitor.project.id': 'test-suite', + 'monitor.project.name': projectId, + 'monitor.project.id': projectId, }, }, }, @@ -547,7 +549,7 @@ export const getTestProjectSyntheticsPolicy = ( enabled: true, release: 'beta', data_stream: { type: 'synthetics', dataset: 'browser.network' }, - id: 'synthetics/browser-browser.network-4b6abc6c-118b-4d93-a489-1135500d09f1-test-suite-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3', + id: `synthetics/browser-browser.network-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, compiled_stream: { processors: [ { add_observer_metadata: { geo: { name: 'Fleet managed' } } }, @@ -559,7 +561,7 @@ export const getTestProjectSyntheticsPolicy = ( enabled: true, release: 'beta', data_stream: { type: 'synthetics', dataset: 'browser.screenshot' }, - id: 'synthetics/browser-browser.screenshot-4b6abc6c-118b-4d93-a489-1135500d09f1-test-suite-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3', + id: `synthetics/browser-browser.screenshot-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, compiled_stream: { processors: [ { add_observer_metadata: { geo: { name: 'Fleet managed' } } }, diff --git a/x-pack/test/apm_api_integration/common/config.ts b/x-pack/test/apm_api_integration/common/config.ts index 78fb376fa89b8..8b98fc9422c06 100644 --- a/x-pack/test/apm_api_integration/common/config.ts +++ b/x-pack/test/apm_api_integration/common/config.ts @@ -107,9 +107,9 @@ export function createTestConfig(config: ApmFtrConfig) { kibanaServer, username: ApmUsername.apmManageOwnAndCreateAgentKeys, }), - monitorIndicesUser: await getApmApiClient({ + monitorClusterAndIndicesUser: await getApmApiClient({ kibanaServer, - username: ApmUsername.apmMonitorIndices, + username: ApmUsername.apmMonitorClusterAndIndices, }), }; }, diff --git a/x-pack/test/apm_api_integration/common/fixtures/es_archiver/apm_8.0.0/mappings.json b/x-pack/test/apm_api_integration/common/fixtures/es_archiver/apm_8.0.0/mappings.json index 2d05717fa5725..ee8b97f7ac0ae 100644 --- a/x-pack/test/apm_api_integration/common/fixtures/es_archiver/apm_8.0.0/mappings.json +++ b/x-pack/test/apm_api_integration/common/fixtures/es_archiver/apm_8.0.0/mappings.json @@ -7196,10 +7196,6 @@ "handled": { "type": "boolean" }, - "message": { - "norms": false, - "type": "text" - }, "module": { "ignore_above": 1024, "type": "keyword" @@ -7232,20 +7228,12 @@ "ignore_above": 1024, "type": "keyword" }, - "message": { - "norms": false, - "type": "text" - }, "param_message": { "ignore_above": 1024, "type": "keyword" } } }, - "message": { - "norms": false, - "type": "text" - }, "stack_trace": { "fields": { "text": { @@ -8460,10 +8448,6 @@ } } }, - "message": { - "norms": false, - "type": "text" - }, "metricset": { "properties": { "name": { diff --git a/x-pack/test/apm_api_integration/common/fixtures/es_archiver/infra_metrics_and_apm/mappings.json b/x-pack/test/apm_api_integration/common/fixtures/es_archiver/infra_metrics_and_apm/mappings.json index 4333590036055..5695c2a8494af 100644 --- a/x-pack/test/apm_api_integration/common/fixtures/es_archiver/infra_metrics_and_apm/mappings.json +++ b/x-pack/test/apm_api_integration/common/fixtures/es_archiver/infra_metrics_and_apm/mappings.json @@ -464,10 +464,6 @@ "handled": { "type": "boolean" }, - "message": { - "norms": false, - "type": "text" - }, "module": { "ignore_above": 1024, "type": "keyword" @@ -496,20 +492,12 @@ "ignore_above": 1024, "type": "keyword" }, - "message": { - "norms": false, - "type": "text" - }, "param_message": { "ignore_above": 1024, "type": "keyword" } } }, - "message": { - "norms": false, - "type": "text" - }, "type": { "ignore_above": 1024, "type": "keyword" @@ -1158,10 +1146,6 @@ } } }, - "message": { - "norms": false, - "type": "text" - }, "network": { "properties": { "application": { @@ -17630,4 +17614,4 @@ } } } -} \ No newline at end of file +} diff --git a/x-pack/test/apm_api_integration/configs/index.ts b/x-pack/test/apm_api_integration/configs/index.ts index 3bc03eb5b4259..e4dfc0b8e387c 100644 --- a/x-pack/test/apm_api_integration/configs/index.ts +++ b/x-pack/test/apm_api_integration/configs/index.ts @@ -11,14 +11,21 @@ import { createTestConfig, CreateTestConfig } from '../common/config'; const apmFtrConfigs = { basic: { license: 'basic' as const, + kibanaConfig: { + 'xpack.apm.forceSyntheticSource': 'true', + }, }, trial: { license: 'trial' as const, + kibanaConfig: { + 'xpack.apm.forceSyntheticSource': 'true', + }, }, rules: { license: 'trial' as const, kibanaConfig: { 'xpack.ruleRegistry.write.enabled': 'true', + 'xpack.apm.forceSyntheticSource': 'true', }, }, }; diff --git a/x-pack/test/apm_api_integration/tests/data_view/static.spec.ts b/x-pack/test/apm_api_integration/tests/data_view/static.spec.ts index 0ed65724bfd4c..093fec9044606 100644 --- a/x-pack/test/apm_api_integration/tests/data_view/static.spec.ts +++ b/x-pack/test/apm_api_integration/tests/data_view/static.spec.ts @@ -140,6 +140,17 @@ export default function ApiTest({ getService }: FtrProviderContext) { labelTemplate: '{{value}}', }, }, + 'transaction.duration.us': { + id: 'duration', + params: { + inputFormat: 'microseconds', + outputFormat: 'asMilliseconds', + showSuffix: true, + useShortSuffix: true, + outputPrecision: 2, + includeSpaceWithSuffix: true, + }, + }, }) ); }); diff --git a/x-pack/test/apm_api_integration/tests/dependencies/top_spans.spec.ts b/x-pack/test/apm_api_integration/tests/dependencies/top_spans.spec.ts index e93af3051d451..fe244297f5d3c 100644 --- a/x-pack/test/apm_api_integration/tests/dependencies/top_spans.spec.ts +++ b/x-pack/test/apm_api_integration/tests/dependencies/top_spans.spec.ts @@ -155,7 +155,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(javaSpans.length + goSpans.length).to.eql(spans.length); - expect(omit(javaSpans[0], 'traceId', 'transactionId')).to.eql({ + expect(omit(javaSpans[0], 'spanId', 'traceId', 'transactionId')).to.eql({ '@timestamp': 1609459200000, agentName: 'java', duration: 100000, @@ -166,7 +166,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { outcome: 'success', }); - expect(omit(goSpans[0], 'traceId', 'transactionId')).to.eql({ + expect(omit(goSpans[0], 'spanId', 'traceId', 'transactionId')).to.eql({ '@timestamp': 1609459200000, agentName: 'go', duration: 50000, @@ -223,34 +223,6 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); }); - describe('when requesting spans without a transaction', () => { - it('should return the spans without transaction metadata', async () => { - const response = await callApi({ - dependencyName: 'elasticsearch', - spanName: 'without transaction', - }); - - const { spans } = response.body; - - const spanNames = uniq(spans.map((span) => span.spanName)); - - expect(spanNames).to.eql(['without transaction']); - - expect(omit(spans[0], 'traceId')).to.eql({ - '@timestamp': 1609459200000, - agentName: 'java', - duration: 200000, - serviceName: 'java', - spanName: 'without transaction', - outcome: 'unknown', - }); - - expect(spans[0].transactionType).not.to.be.ok(); - expect(spans[0].transactionId).not.to.be.ok(); - expect(spans[0].transactionName).not.to.be.ok(); - }); - }); - describe('when requesting spans within a specific sample range', () => { it('returns only spans whose duration falls into the requested range', async () => { const response = await callApi({ diff --git a/x-pack/test/apm_api_integration/tests/metrics_charts/metrics_charts.spec.ts b/x-pack/test/apm_api_integration/tests/metrics/metrics_charts.spec.ts similarity index 100% rename from x-pack/test/apm_api_integration/tests/metrics_charts/metrics_charts.spec.ts rename to x-pack/test/apm_api_integration/tests/metrics/metrics_charts.spec.ts diff --git a/x-pack/test/apm_api_integration/tests/metrics/serverless/generate_data.ts b/x-pack/test/apm_api_integration/tests/metrics/serverless/generate_data.ts new file mode 100644 index 0000000000000..07648d4e548a2 --- /dev/null +++ b/x-pack/test/apm_api_integration/tests/metrics/serverless/generate_data.ts @@ -0,0 +1,120 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { apm, timerange } from '@kbn/apm-synthtrace'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; + +export const config = { + memoryTotal: 536870912, // 0.5gb + memoryFree: 94371840, // ~0.08 gb + billedDurationMs: 4000, + faasTimeoutMs: 10000, + coldStartDurationPython: 4000, + faasDuration: 4000, + transactionDuration: 1000, + pythonServerlessFunctionNames: ['fn-lambda-python', 'fn-lambda-python-2'], + pythonInstanceName: 'instance_A', + serverlessId: 'arn:aws:lambda:us-west-2:001:function:', +}; + +export const expectedValues = { + expectedMemoryUsedRate: (config.memoryTotal - config.memoryFree) / config.memoryTotal, + expectedMemoryUsed: config.memoryTotal - config.memoryFree, +}; + +export async function generateData({ + synthtraceEsClient, + start, + end, +}: { + synthtraceEsClient: ApmSynthtraceEsClient; + start: number; + end: number; +}) { + const { + memoryTotal, + memoryFree, + billedDurationMs, + faasTimeoutMs, + coldStartDurationPython, + faasDuration, + transactionDuration, + pythonServerlessFunctionNames, + pythonInstanceName, + } = config; + + const cloudFields = { + 'cloud.provider': 'aws', + 'cloud.service.name': 'lambda', + 'cloud.region': 'us-west-2', + }; + + const [instanceLambdaPython, instanceLambdaPython2] = pythonServerlessFunctionNames.map( + (functionName) => { + return apm + .serverlessFunction({ + serviceName: 'lambda-python', + environment: 'test', + agentName: 'python', + functionName, + }) + .instance({ instanceName: pythonInstanceName, ...cloudFields }); + } + ); + + const instanceLambdaNode = apm + .serverlessFunction({ + serviceName: 'lambda-node', + environment: 'test', + agentName: 'nodejs', + functionName: 'fn-lambda-node', + }) + .instance({ instanceName: 'instance_B', ...cloudFields }); + + const systemMemory = { + free: memoryFree, + total: memoryTotal, + }; + + const transactionsEvents = timerange(start, end) + .ratePerMinute(1) + .generator((timestamp) => [ + instanceLambdaPython + .invocation() + .billedDuration(billedDurationMs) + .coldStart(true) + .coldStartDuration(coldStartDurationPython) + .faasDuration(faasDuration) + .faasTimeout(faasTimeoutMs) + .memory(systemMemory) + .timestamp(timestamp) + .duration(transactionDuration) + .success(), + instanceLambdaPython2 + .invocation() + .billedDuration(billedDurationMs) + .coldStart(true) + .coldStartDuration(coldStartDurationPython) + .faasDuration(faasDuration) + .faasTimeout(faasTimeoutMs) + .memory(systemMemory) + .timestamp(timestamp) + .duration(transactionDuration) + .success(), + instanceLambdaNode + .invocation() + .billedDuration(billedDurationMs) + .coldStart(false) + .faasDuration(faasDuration) + .faasTimeout(faasTimeoutMs) + .memory(systemMemory) + .timestamp(timestamp) + .duration(transactionDuration) + .success(), + ]); + + await synthtraceEsClient.index(transactionsEvents); +} diff --git a/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_active_instances.spec.ts b/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_active_instances.spec.ts new file mode 100644 index 0000000000000..4861313c377f1 --- /dev/null +++ b/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_active_instances.spec.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 { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; +import expect from '@kbn/expect'; +import { sumBy } from 'lodash'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; +import { config, expectedValues, generateData } from './generate_data'; + +export default function ApiTest({ getService }: FtrProviderContext) { + const registry = getService('registry'); + const apmApiClient = getService('apmApiClient'); + const synthtraceEsClient = getService('synthtraceEsClient'); + + const start = new Date('2021-01-01T00:00:00.000Z').getTime(); + const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; + const numberOfTransactionsCreated = 15; + + async function callApi(serviceName: string, serverlessId?: string) { + return await apmApiClient.readUser({ + endpoint: `GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances`, + params: { + path: { serviceName }, + query: { + environment: 'test', + kuery: '', + start: new Date(start).toISOString(), + end: new Date(end).toISOString(), + ...(serverlessId ? { serverlessId } : {}), + }, + }, + }); + } + + registry.when('Serverless active instances', { config: 'basic', archives: [] }, () => { + const { + memoryTotal, + billedDurationMs, + pythonServerlessFunctionNames, + faasDuration, + serverlessId, + } = config; + + const { expectedMemoryUsed } = expectedValues; + + before(async () => { + await generateData({ start, end, synthtraceEsClient }); + }); + + after(() => synthtraceEsClient.clean()); + + describe('Python service', () => { + let activeInstances: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances'>; + before(async () => { + const response = await callApi('lambda-python'); + activeInstances = response.body; + }); + + it('returns correct values for all serverless functions', () => { + pythonServerlessFunctionNames.forEach((name) => { + const activeInstanceOverview = activeInstances.activeInstances.find( + (item) => item.serverlessFunctionName === name + ); + + expect(activeInstanceOverview?.serverlessId).to.eql(`${serverlessId}${name}`); + expect(activeInstanceOverview?.serverlessDurationAvg).to.eql(faasDuration); + expect(activeInstanceOverview?.billedDurationAvg).to.eql(billedDurationMs); + expect(activeInstanceOverview?.avgMemoryUsed).to.eql(expectedMemoryUsed); + expect(activeInstanceOverview?.memorySize).to.eql(memoryTotal); + }); + }); + describe('timeseries', () => { + it('returns correct sum value', () => { + const sumValue = sumBy( + activeInstances?.timeseries?.filter((item) => item.y !== 0), + 'y' + ); + expect(sumValue).to.equal(numberOfTransactionsCreated); + }); + }); + }); + + describe('detailed metrics', () => { + let activeInstances: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances'>; + before(async () => { + const response = await callApi( + 'lambda-python', + `${serverlessId}${pythonServerlessFunctionNames[0]}` + ); + activeInstances = response.body; + }); + + it('returns correct values for all serverless functions', () => { + const activeInstanceOverview = activeInstances.activeInstances.find( + (item) => item.serverlessFunctionName === pythonServerlessFunctionNames[0] + ); + + expect(activeInstanceOverview?.serverlessId).to.eql( + `${serverlessId}${pythonServerlessFunctionNames[0]}` + ); + expect(activeInstanceOverview?.serverlessDurationAvg).to.eql(faasDuration); + expect(activeInstanceOverview?.billedDurationAvg).to.eql(billedDurationMs); + expect(activeInstanceOverview?.avgMemoryUsed).to.eql(expectedMemoryUsed); + expect(activeInstanceOverview?.memorySize).to.eql(memoryTotal); + }); + describe('timeseries', () => { + it('returns correct sum value', () => { + const sumValue = sumBy( + activeInstances?.timeseries?.filter((item) => item.y !== 0), + 'y' + ); + expect(sumValue).to.equal(numberOfTransactionsCreated); + }); + }); + }); + }); +} diff --git a/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_functions_overview.spec.ts b/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_functions_overview.spec.ts new file mode 100644 index 0000000000000..e58df3291f492 --- /dev/null +++ b/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_functions_overview.spec.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 { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; +import { config, expectedValues, generateData } from './generate_data'; + +export default function ApiTest({ getService }: FtrProviderContext) { + const registry = getService('registry'); + const apmApiClient = getService('apmApiClient'); + const synthtraceEsClient = getService('synthtraceEsClient'); + + const start = new Date('2021-01-01T00:00:00.000Z').getTime(); + const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; + const numberOfTransactionsCreated = 15; + + async function callApi(serviceName: string) { + return await apmApiClient.readUser({ + endpoint: `GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview`, + params: { + path: { serviceName }, + query: { + environment: 'test', + kuery: '', + start: new Date(start).toISOString(), + end: new Date(end).toISOString(), + }, + }, + }); + } + + registry.when('Serverless functions overview', { config: 'basic', archives: [] }, () => { + const { + memoryTotal, + billedDurationMs, + pythonServerlessFunctionNames, + faasDuration, + serverlessId, + } = config; + const { expectedMemoryUsed } = expectedValues; + + before(async () => { + await generateData({ start, end, synthtraceEsClient }); + }); + + after(() => synthtraceEsClient.clean()); + + describe('Python service', () => { + let functionsOverview: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview'>; + before(async () => { + const response = await callApi('lambda-python'); + functionsOverview = response.body; + }); + it('returns correct number of serverless functions', () => { + expect( + functionsOverview.serverlessFunctionsOverview.map((item) => { + return item.serverlessFunctionName; + }) + ).to.eql(pythonServerlessFunctionNames); + }); + it('returns correct values for all serverless functions', () => { + pythonServerlessFunctionNames.forEach((name) => { + const functionOverview = functionsOverview.serverlessFunctionsOverview.find( + (item) => item.serverlessFunctionName === name + ); + + expect(functionOverview?.serverlessId).to.eql(`${serverlessId}${name}`); + expect(functionOverview?.serverlessDurationAvg).to.eql(faasDuration); + expect(functionOverview?.billedDurationAvg).to.eql(billedDurationMs); + expect(functionOverview?.coldStartCount).to.eql(numberOfTransactionsCreated); + expect(functionOverview?.avgMemoryUsed).to.eql(expectedMemoryUsed); + expect(functionOverview?.memorySize).to.eql(memoryTotal); + }); + }); + }); + }); +} diff --git a/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_metrics_charts.spec.ts b/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_metrics_charts.spec.ts new file mode 100644 index 0000000000000..2915ff95e86cf --- /dev/null +++ b/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_metrics_charts.spec.ts @@ -0,0 +1,326 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { meanBy, sumBy } from 'lodash'; +import { Coordinate } from '@kbn/apm-plugin/typings/timeseries'; +import { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; +import { generateData, config } from './generate_data'; + +function isNotNullOrZeroCoordinate(coordinate: Coordinate) { + return coordinate.y !== null && coordinate.y !== 0; +} + +export default function ApiTest({ getService }: FtrProviderContext) { + const registry = getService('registry'); + const apmApiClient = getService('apmApiClient'); + const synthtraceEsClient = getService('synthtraceEsClient'); + + const start = new Date('2021-01-01T00:00:00.000Z').getTime(); + const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; + const numberOfTransactionsCreated = 15; + + async function callApi(serviceName: string, serverlessId?: string) { + return await apmApiClient.readUser({ + endpoint: 'GET /internal/apm/services/{serviceName}/metrics/serverless/charts', + params: { + path: { serviceName }, + query: { + environment: 'test', + kuery: '', + start: new Date(start).toISOString(), + end: new Date(end).toISOString(), + ...(serverlessId ? { serverlessId } : {}), + }, + }, + }); + } + + registry.when( + 'Serverless metrics charts when data is not loaded', + { config: 'basic', archives: [] }, + () => { + let serverlessMetrics: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/charts'>; + before(async () => { + const response = await callApi('lambda-python'); + serverlessMetrics = response.body; + }); + + it('returns empty', () => { + serverlessMetrics.charts.forEach((chart) => { + expect(chart.series).to.be.empty(); + }); + }); + } + ); + + registry.when('Serverless metrics charts', { config: 'basic', archives: [] }, () => { + const { + memoryTotal, + memoryFree, + billedDurationMs, + coldStartDurationPython, + transactionDuration, + pythonServerlessFunctionNames, + serverlessId, + } = config; + + before(async () => { + await generateData({ start, end, synthtraceEsClient }); + }); + + after(() => synthtraceEsClient.clean()); + + describe('Python service', () => { + let serverlessMetrics: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/charts'>; + before(async () => { + const response = await callApi('lambda-python'); + serverlessMetrics = response.body; + }); + + it('returns all metrics chart', () => { + expect(serverlessMetrics.charts.length).to.be.greaterThan(0); + expect(serverlessMetrics.charts.map(({ title }) => title).sort()).to.eql([ + 'Cold start duration', + 'Cold starts', + 'Compute usage', + 'Lambda Duration', + 'System memory usage', + ]); + }); + + describe('Avg. Duration', () => { + const transactionDurationInMicroSeconds = transactionDuration * 1000; + [ + { title: 'Billed Duration', expectedValue: billedDurationMs * 1000 }, + { title: 'Transaction Duration', expectedValue: transactionDurationInMicroSeconds }, + ].map(({ title, expectedValue }) => + it(`returns correct ${title} value`, () => { + const avgDurationMetric = serverlessMetrics.charts.find((chart) => { + return chart.key === 'avg_duration'; + }); + const series = avgDurationMetric?.series.find((item) => item.title === title); + expect(series?.overallValue).to.eql(expectedValue); + const meanValue = meanBy(series?.data.filter(isNotNullOrZeroCoordinate), 'y'); + expect(meanValue).to.eql(expectedValue); + }) + ); + }); + + let metricsChart: typeof serverlessMetrics.charts[0] | undefined; + + describe('Cold start duration', () => { + before(() => { + metricsChart = serverlessMetrics.charts.find((chart) => { + return chart.key === 'cold_start_duration'; + }); + }); + it('returns correct overall value', () => { + expect(metricsChart?.series[0].overallValue).to.equal(coldStartDurationPython * 1000); + }); + + it('returns correct mean value', () => { + const meanValue = meanBy( + metricsChart?.series[0]?.data.filter(isNotNullOrZeroCoordinate), + 'y' + ); + expect(meanValue).to.equal(coldStartDurationPython * 1000); + }); + }); + + describe('Cold start count', () => { + before(() => { + metricsChart = serverlessMetrics.charts.find((chart) => { + return chart.key === 'cold_start_count'; + }); + }); + + it('returns correct overall value', () => { + expect(metricsChart?.series[0].overallValue).to.equal( + numberOfTransactionsCreated * pythonServerlessFunctionNames.length + ); + }); + + it('returns correct sum value', () => { + const sumValue = sumBy( + metricsChart?.series[0]?.data.filter(isNotNullOrZeroCoordinate), + 'y' + ); + expect(sumValue).to.equal( + numberOfTransactionsCreated * pythonServerlessFunctionNames.length + ); + }); + }); + + describe('memory usage', () => { + const expectedFreeMemory = 1 - memoryFree / memoryTotal; + [ + { title: 'Max', expectedValue: expectedFreeMemory }, + { title: 'Average', expectedValue: expectedFreeMemory }, + ].map(({ title, expectedValue }) => + it(`returns correct ${title} value`, () => { + const memoryUsageMetric = serverlessMetrics.charts.find((chart) => { + return chart.key === 'memory_usage_chart'; + }); + const series = memoryUsageMetric?.series.find((item) => item.title === title); + expect(series?.overallValue).to.eql(expectedValue); + const meanValue = meanBy(series?.data.filter(isNotNullOrZeroCoordinate), 'y'); + expect(meanValue).to.eql(expectedValue); + }) + ); + }); + + describe('Compute usage', () => { + const GBSeconds = 1024 * 1024 * 1024 * 1000; + let computeUsageMetric: typeof serverlessMetrics.charts[0] | undefined; + before(() => { + computeUsageMetric = serverlessMetrics.charts.find((chart) => { + return chart.key === 'compute_usage'; + }); + }); + it('returns correct overall value', () => { + const expectedValue = + ((memoryTotal * billedDurationMs) / GBSeconds) * numberOfTransactionsCreated * 2; + expect(computeUsageMetric?.series[0].overallValue).to.equal(expectedValue); + }); + + it('returns correct mean value', () => { + const expectedValue = ((memoryTotal * billedDurationMs) / GBSeconds) * 2; + const meanValue = meanBy( + computeUsageMetric?.series[0]?.data.filter((item) => item.y !== 0), + 'y' + ); + expect(meanValue).to.equal(expectedValue); + }); + }); + }); + + describe('detailed metrics', () => { + let serverlessMetrics: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/charts'>; + before(async () => { + const response = await callApi( + 'lambda-python', + `${serverlessId}${pythonServerlessFunctionNames[0]}` + ); + serverlessMetrics = response.body; + }); + + it('returns all metrics chart', () => { + expect(serverlessMetrics.charts.length).to.be.greaterThan(0); + expect(serverlessMetrics.charts.map(({ title }) => title).sort()).to.eql([ + 'Cold start duration', + 'Cold starts', + 'Compute usage', + 'Lambda Duration', + 'System memory usage', + ]); + }); + + describe('Avg. Duration', () => { + const transactionDurationInMicroSeconds = transactionDuration * 1000; + [ + { title: 'Billed Duration', expectedValue: billedDurationMs * 1000 }, + { title: 'Transaction Duration', expectedValue: transactionDurationInMicroSeconds }, + ].map(({ title, expectedValue }) => + it(`returns correct ${title} value`, () => { + const avgDurationMetric = serverlessMetrics.charts.find((chart) => { + return chart.key === 'avg_duration'; + }); + const series = avgDurationMetric?.series.find((item) => item.title === title); + expect(series?.overallValue).to.eql(expectedValue); + const meanValue = meanBy(series?.data.filter(isNotNullOrZeroCoordinate), 'y'); + expect(meanValue).to.eql(expectedValue); + }) + ); + }); + + let metricsChart: typeof serverlessMetrics.charts[0] | undefined; + + describe('Cold start duration', () => { + before(() => { + metricsChart = serverlessMetrics.charts.find((chart) => { + return chart.key === 'cold_start_duration'; + }); + }); + it('returns correct overall value', () => { + expect(metricsChart?.series[0].overallValue).to.equal(coldStartDurationPython * 1000); + }); + + it('returns correct mean value', () => { + const meanValue = meanBy( + metricsChart?.series[0]?.data.filter(isNotNullOrZeroCoordinate), + 'y' + ); + expect(meanValue).to.equal(coldStartDurationPython * 1000); + }); + }); + + describe('Cold start count', () => { + before(() => { + metricsChart = serverlessMetrics.charts.find((chart) => { + return chart.key === 'cold_start_count'; + }); + }); + + it('returns correct overall value', () => { + expect(metricsChart?.series[0].overallValue).to.equal(numberOfTransactionsCreated); + }); + + it('returns correct sum value', () => { + const sumValue = sumBy( + metricsChart?.series[0]?.data.filter(isNotNullOrZeroCoordinate), + 'y' + ); + expect(sumValue).to.equal(numberOfTransactionsCreated); + }); + }); + + describe('memory usage', () => { + const expectedFreeMemory = 1 - memoryFree / memoryTotal; + [ + { title: 'Max', expectedValue: expectedFreeMemory }, + { title: 'Average', expectedValue: expectedFreeMemory }, + ].map(({ title, expectedValue }) => + it(`returns correct ${title} value`, () => { + const memoryUsageMetric = serverlessMetrics.charts.find((chart) => { + return chart.key === 'memory_usage_chart'; + }); + const series = memoryUsageMetric?.series.find((item) => item.title === title); + expect(series?.overallValue).to.eql(expectedValue); + const meanValue = meanBy(series?.data.filter(isNotNullOrZeroCoordinate), 'y'); + expect(meanValue).to.eql(expectedValue); + }) + ); + }); + + describe('Compute usage', () => { + const GBSeconds = 1024 * 1024 * 1024 * 1000; + let computeUsageMetric: typeof serverlessMetrics.charts[0] | undefined; + before(() => { + computeUsageMetric = serverlessMetrics.charts.find((chart) => { + return chart.key === 'compute_usage'; + }); + }); + it('returns correct overall value', () => { + const expectedValue = + ((memoryTotal * billedDurationMs) / GBSeconds) * numberOfTransactionsCreated; + expect(computeUsageMetric?.series[0].overallValue).to.equal(expectedValue); + }); + + it('returns correct mean value', () => { + const expectedValue = (memoryTotal * billedDurationMs) / GBSeconds; + const meanValue = meanBy( + computeUsageMetric?.series[0]?.data.filter((item) => item.y !== 0), + 'y' + ); + expect(meanValue).to.equal(expectedValue); + }); + }); + }); + }); +} diff --git a/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_summary.spec.ts b/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_summary.spec.ts new file mode 100644 index 0000000000000..223e7a448df4c --- /dev/null +++ b/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_summary.spec.ts @@ -0,0 +1,109 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; +import { config, expectedValues, generateData } from './generate_data'; + +export default function ApiTest({ getService }: FtrProviderContext) { + const registry = getService('registry'); + const apmApiClient = getService('apmApiClient'); + const synthtraceEsClient = getService('synthtraceEsClient'); + + const start = new Date('2021-01-01T00:00:00.000Z').getTime(); + const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; + async function callApi(serviceName: string, serverlessId?: string) { + return await apmApiClient.readUser({ + endpoint: `GET /internal/apm/services/{serviceName}/metrics/serverless/summary`, + params: { + path: { serviceName }, + query: { + environment: 'test', + kuery: '', + start: new Date(start).toISOString(), + end: new Date(end).toISOString(), + ...(serverlessId ? { serverlessId } : {}), + }, + }, + }); + } + + registry.when( + 'Serverless overview when data is not loaded', + { config: 'basic', archives: [] }, + () => { + let serverlessSummary: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/summary'>; + before(async () => { + const response = await callApi('lambda-python'); + serverlessSummary = response.body; + }); + + it('returns empty', () => { + expect(serverlessSummary).to.be.empty(); + }); + } + ); + + registry.when('Serverless overview', { config: 'basic', archives: [] }, () => { + const { billedDurationMs, pythonServerlessFunctionNames, faasDuration, serverlessId } = config; + const { expectedMemoryUsedRate } = expectedValues; + + before(async () => { + await generateData({ start, end, synthtraceEsClient }); + }); + + after(() => synthtraceEsClient.clean()); + + describe('Python service', () => { + let serverlessSummary: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/summary'>; + before(async () => { + const response = await callApi('lambda-python'); + serverlessSummary = response.body; + }); + + it('returns correct memory avg', () => { + expect(serverlessSummary.memoryUsageAvgRate).to.eql(expectedMemoryUsedRate); + }); + it('returns correct serverless function total', () => { + expect(serverlessSummary.serverlessFunctionsTotal).to.eql( + pythonServerlessFunctionNames.length + ); + }); + it('returns correct serverless duration avg', () => { + expect(serverlessSummary.serverlessDurationAvg).to.eql(faasDuration); + }); + it('returns correct billed duration avg', () => { + expect(serverlessSummary.billedDurationAvg).to.eql(billedDurationMs); + }); + }); + + describe('detailed metrics', () => { + let serverlessSummary: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/summary'>; + before(async () => { + const response = await callApi( + 'lambda-python', + `${serverlessId}${pythonServerlessFunctionNames[0]}` + ); + serverlessSummary = response.body; + }); + + it('returns correct memory avg', () => { + expect(serverlessSummary.memoryUsageAvgRate).to.eql(expectedMemoryUsedRate); + }); + it('returns correct serverless function total', () => { + expect(serverlessSummary.serverlessFunctionsTotal).to.eql(1); + }); + it('returns correct serverless duration avg', () => { + expect(serverlessSummary.serverlessDurationAvg).to.eql(faasDuration); + }); + it('returns correct billed duration avg', () => { + expect(serverlessSummary.billedDurationAvg).to.eql(billedDurationMs); + }); + }); + }); +} diff --git a/x-pack/test/apm_api_integration/tests/metrics_charts/serverless.spec.ts b/x-pack/test/apm_api_integration/tests/metrics_charts/serverless.spec.ts deleted file mode 100644 index be56277b5fad1..0000000000000 --- a/x-pack/test/apm_api_integration/tests/metrics_charts/serverless.spec.ts +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; -import { apm, timerange } from '@kbn/apm-synthtrace'; -import expect from '@kbn/expect'; -import { meanBy, sumBy } from 'lodash'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; - -export default function ApiTest({ getService }: FtrProviderContext) { - const registry = getService('registry'); - const apmApiClient = getService('apmApiClient'); - const synthtraceEsClient = getService('synthtraceEsClient'); - - const start = new Date('2021-01-01T00:00:00.000Z').getTime(); - const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; - - async function callApi(serviceName: string, agentName: string) { - return await apmApiClient.readUser({ - endpoint: `GET /internal/apm/services/{serviceName}/metrics/charts`, - params: { - path: { serviceName }, - query: { - environment: 'test', - agentName, - kuery: '', - start: new Date(start).toISOString(), - end: new Date(end).toISOString(), - serviceRuntimeName: 'aws_lambda', - }, - }, - }); - } - - registry.when( - 'Serverless metrics charts when data is loaded', - { config: 'basic', archives: [] }, - () => { - const MEMORY_TOTAL = 536870912; // 0.5gb; - const MEMORY_FREE = 94371840; // ~0.08 gb; - const BILLED_DURATION_MS = 4000; - const FAAS_TIMEOUT_MS = 10000; - const COLD_START_DURATION_PYTHON = 4000; - const COLD_START_DURATION_NODE = 0; - const FAAS_DURATION = 4000; - const TRANSACTION_DURATION = 1000; - - const numberOfTransactionsCreated = 15; - const numberOfPythonInstances = 2; - - before(async () => { - const cloudFields = { - 'cloud.provider': 'aws', - 'cloud.service.name': 'lambda', - 'cloud.region': 'us-west-2', - }; - - const instanceLambdaPython = apm - .serverlessFunction({ - serviceName: 'lambda-python', - environment: 'test', - agentName: 'python', - functionName: 'fn-lambda-python', - }) - .instance({ instanceName: 'instance python', ...cloudFields }); - - const instanceLambdaPython2 = apm - .serverlessFunction({ - serviceName: 'lambda-python', - environment: 'test', - agentName: 'python', - functionName: 'fn-lambda-python-2', - }) - .instance({ instanceName: 'instance python 2', ...cloudFields }); - - const instanceLambdaNode = apm - .serverlessFunction({ - serviceName: 'lambda-node', - environment: 'test', - agentName: 'nodejs', - functionName: 'fn-lambda-node', - }) - .instance({ instanceName: 'instance node', ...cloudFields }); - - const systemMemory = { - free: MEMORY_FREE, - total: MEMORY_TOTAL, - }; - - const transactionsEvents = timerange(start, end) - .interval('1m') - .rate(1) - .generator((timestamp) => [ - instanceLambdaPython - .invocation() - .billedDuration(BILLED_DURATION_MS) - .coldStart(true) - .coldStartDuration(COLD_START_DURATION_PYTHON) - .faasDuration(FAAS_DURATION) - .faasTimeout(FAAS_TIMEOUT_MS) - .memory(systemMemory) - .timestamp(timestamp) - .duration(TRANSACTION_DURATION) - .success(), - instanceLambdaPython2 - .invocation() - .billedDuration(BILLED_DURATION_MS) - .coldStart(true) - .coldStartDuration(COLD_START_DURATION_PYTHON) - .faasDuration(FAAS_DURATION) - .faasTimeout(FAAS_TIMEOUT_MS) - .memory(systemMemory) - .timestamp(timestamp) - .duration(TRANSACTION_DURATION) - .success(), - instanceLambdaNode - .invocation() - .billedDuration(BILLED_DURATION_MS) - .coldStart(false) - .coldStartDuration(COLD_START_DURATION_NODE) - .faasDuration(FAAS_DURATION) - .faasTimeout(FAAS_TIMEOUT_MS) - .memory(systemMemory) - .timestamp(timestamp) - .duration(TRANSACTION_DURATION) - .success(), - ]); - - await synthtraceEsClient.index(transactionsEvents); - }); - - after(() => synthtraceEsClient.clean()); - - describe('python', () => { - let metrics: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/charts'>; - before(async () => { - const { status, body } = await callApi('lambda-python', 'python'); - - expect(status).to.be(200); - metrics = body; - }); - - it('returns all metrics chart', () => { - expect(metrics.charts.length).to.be.greaterThan(0); - expect(metrics.charts.map(({ title }) => title).sort()).to.eql([ - 'Active instances', - 'Avg. Duration', - 'Cold start', - 'Cold start duration', - 'Compute usage', - 'System memory usage', - ]); - }); - - describe('Avg. Duration', () => { - const transactionDurationInMicroSeconds = TRANSACTION_DURATION * 1000; - [ - { title: 'Billed Duration', expectedValue: BILLED_DURATION_MS * 1000 }, - { title: 'Transaction Duration', expectedValue: transactionDurationInMicroSeconds }, - ].map(({ title, expectedValue }) => - it(`returns correct ${title} value`, () => { - const avgDurationMetric = metrics.charts.find((chart) => { - return chart.key === 'avg_duration'; - }); - const series = avgDurationMetric?.series.find((item) => item.title === title); - expect(series?.overallValue).to.eql(expectedValue); - const meanValue = meanBy( - series?.data.filter((item) => item.y !== null), - 'y' - ); - expect(meanValue).to.eql(expectedValue); - }) - ); - }); - - describe('Cold start duration', () => { - let coldStartDurationMetric: typeof metrics['charts'][0] | undefined; - before(() => { - coldStartDurationMetric = metrics.charts.find((chart) => { - return chart.key === 'cold_start_duration'; - }); - }); - it('returns correct overall value', () => { - expect(coldStartDurationMetric?.series[0].overallValue).to.equal( - COLD_START_DURATION_PYTHON * 1000 - ); - }); - - it('returns correct mean value', () => { - const meanValue = meanBy( - coldStartDurationMetric?.series[0]?.data.filter((item) => item.y !== null), - 'y' - ); - expect(meanValue).to.equal(COLD_START_DURATION_PYTHON * 1000); - }); - }); - - describe('Cold start count', () => { - let coldStartCountMetric: typeof metrics['charts'][0] | undefined; - before(() => { - coldStartCountMetric = metrics.charts.find((chart) => { - return chart.key === 'cold_start_count'; - }); - }); - - it('returns correct overall value', () => { - expect(coldStartCountMetric?.series[0].overallValue).to.equal( - numberOfTransactionsCreated * numberOfPythonInstances - ); - }); - - it('returns correct sum value', () => { - const sumValue = sumBy( - coldStartCountMetric?.series[0]?.data.filter((item) => item.y !== null), - 'y' - ); - expect(sumValue).to.equal(numberOfTransactionsCreated * numberOfPythonInstances); - }); - }); - - describe('memory usage', () => { - const expectedFreeMemory = 1 - MEMORY_FREE / MEMORY_TOTAL; - [ - { title: 'Max', expectedValue: expectedFreeMemory }, - { title: 'Average', expectedValue: expectedFreeMemory }, - ].map(({ title, expectedValue }) => - it(`returns correct ${title} value`, () => { - const memoryUsageMetric = metrics.charts.find((chart) => { - return chart.key === 'memory_usage_chart'; - }); - const series = memoryUsageMetric?.series.find((item) => item.title === title); - expect(series?.overallValue).to.eql(expectedValue); - const meanValue = meanBy( - series?.data.filter((item) => item.y !== null), - 'y' - ); - expect(meanValue).to.eql(expectedValue); - }) - ); - }); - - describe('Compute usage', () => { - const GBSeconds = 1024 * 1024 * 1024 * 1000; - const expectedValue = (MEMORY_TOTAL * BILLED_DURATION_MS) / GBSeconds; - let computeUsageMetric: typeof metrics['charts'][0] | undefined; - before(() => { - computeUsageMetric = metrics.charts.find((chart) => { - return chart.key === 'compute_usage'; - }); - }); - it('returns correct overall value', () => { - expect(computeUsageMetric?.series[0].overallValue).to.equal(expectedValue); - }); - - it('returns correct mean value', () => { - const meanValue = meanBy( - computeUsageMetric?.series[0]?.data.filter((item) => item.y !== 0), - 'y' - ); - expect(meanValue).to.equal(expectedValue); - }); - }); - - describe('Active instances', () => { - let activeInstancesMetric: typeof metrics['charts'][0] | undefined; - before(() => { - activeInstancesMetric = metrics.charts.find((chart) => { - return chart.key === 'active_instances'; - }); - }); - it('returns correct overall value', () => { - expect(activeInstancesMetric?.series[0].overallValue).to.equal(numberOfPythonInstances); - }); - - it('returns correct sum value', () => { - const sumValue = sumBy( - activeInstancesMetric?.series[0]?.data.filter((item) => item.y !== 0), - 'y' - ); - expect(sumValue).to.equal(numberOfTransactionsCreated * numberOfPythonInstances); - }); - }); - }); - - describe('nodejs', () => { - let metrics: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/charts'>; - before(async () => { - const { status, body } = await callApi('lambda-node', 'nodejs'); - expect(status).to.be(200); - metrics = body; - }); - - it('returns all metrics chart', () => { - expect(metrics.charts.length).to.be.greaterThan(0); - expect(metrics.charts.map(({ title }) => title).sort()).to.eql([ - 'Active instances', - 'Avg. Duration', - 'Cold start', - 'Cold start duration', - 'Compute usage', - 'System memory usage', - ]); - }); - describe('Avg. Duration', () => { - const transactionDurationInMicroSeconds = TRANSACTION_DURATION * 1000; - [ - { title: 'Billed Duration', expectedValue: BILLED_DURATION_MS * 1000 }, - { title: 'Transaction Duration', expectedValue: transactionDurationInMicroSeconds }, - ].map(({ title, expectedValue }) => - it(`returns correct ${title} value`, () => { - const avgDurationMetric = metrics.charts.find((chart) => { - return chart.key === 'avg_duration'; - }); - const series = avgDurationMetric?.series.find((item) => item.title === title); - expect(series?.overallValue).to.eql(expectedValue); - const meanValue = meanBy( - series?.data.filter((item) => item.y !== null), - 'y' - ); - expect(meanValue).to.eql(expectedValue); - }) - ); - }); - - describe('Cold start duration', () => { - let coldStartDurationMetric: typeof metrics['charts'][0] | undefined; - before(() => { - coldStartDurationMetric = metrics.charts.find((chart) => { - return chart.key === 'cold_start_duration'; - }); - }); - - it('returns 0 overall value', () => { - expect(coldStartDurationMetric?.series[0].overallValue).to.equal( - COLD_START_DURATION_NODE * 1000 - ); - }); - - it('returns 0 mean value', () => { - const meanValue = meanBy( - coldStartDurationMetric?.series[0]?.data.filter((item) => item.y !== null), - 'y' - ); - expect(meanValue).to.equal(COLD_START_DURATION_NODE * 1000); - }); - }); - - describe('Cold start count', () => { - let coldStartCountMetric: typeof metrics['charts'][0] | undefined; - before(() => { - coldStartCountMetric = metrics.charts.find((chart) => { - return chart.key === 'cold_start_count'; - }); - }); - - it('does not return cold start count', () => { - expect(coldStartCountMetric?.series).to.be.empty(); - }); - }); - - describe('memory usage', () => { - const expectedFreeMemory = 1 - MEMORY_FREE / MEMORY_TOTAL; - [ - { title: 'Max', expectedValue: expectedFreeMemory }, - { title: 'Average', expectedValue: expectedFreeMemory }, - ].map(({ title, expectedValue }) => - it(`returns correct ${title} value`, () => { - const memoryUsageMetric = metrics.charts.find((chart) => { - return chart.key === 'memory_usage_chart'; - }); - const series = memoryUsageMetric?.series.find((item) => item.title === title); - expect(series?.overallValue).to.eql(expectedValue); - const meanValue = meanBy( - series?.data.filter((item) => item.y !== null), - 'y' - ); - expect(meanValue).to.eql(expectedValue); - }) - ); - }); - - describe('Compute usage', () => { - const GBSeconds = 1024 * 1024 * 1024 * 1000; - const expectedValue = (MEMORY_TOTAL * BILLED_DURATION_MS) / GBSeconds; - let computeUsageMetric: typeof metrics['charts'][0] | undefined; - before(() => { - computeUsageMetric = metrics.charts.find((chart) => { - return chart.key === 'compute_usage'; - }); - }); - it('returns correct overall value', () => { - expect(computeUsageMetric?.series[0].overallValue).to.equal(expectedValue); - }); - - it('returns correct mean value', () => { - const meanValue = meanBy( - computeUsageMetric?.series[0]?.data.filter((item) => item.y !== 0), - 'y' - ); - expect(meanValue).to.equal(expectedValue); - }); - }); - - describe('Active instances', () => { - let activeInstancesMetric: typeof metrics['charts'][0] | undefined; - before(() => { - activeInstancesMetric = metrics.charts.find((chart) => { - return chart.key === 'active_instances'; - }); - }); - it('returns correct overall value', () => { - // there's only one node instance - expect(activeInstancesMetric?.series[0].overallValue).to.equal(1); - }); - - it('returns correct sum value', () => { - const sumValue = sumBy( - activeInstancesMetric?.series[0]?.data.filter((item) => item.y !== 0), - 'y' - ); - expect(sumValue).to.equal(numberOfTransactionsCreated); - }); - }); - }); - } - ); -} diff --git a/x-pack/test/apm_api_integration/tests/service_groups/save_service_group.spec.ts b/x-pack/test/apm_api_integration/tests/service_groups/save_service_group.spec.ts new file mode 100644 index 0000000000000..533d6079c1a6d --- /dev/null +++ b/x-pack/test/apm_api_integration/tests/service_groups/save_service_group.spec.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 expect from '@kbn/expect'; +import { ApmApiError } from '../../common/apm_api_supertest'; +import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { expectToReject } from '../../common/utils/expect_to_reject'; + +export default function ApiTest({ getService }: FtrProviderContext) { + const registry = getService('registry'); + const apmApiClient = getService('apmApiClient'); + const supertest = getService('supertest'); + + async function callApi({ + serviceGroupId, + groupName, + kuery, + description, + color, + }: { + serviceGroupId?: string; + groupName: string; + kuery: string; + description?: string; + color?: string; + }) { + const response = await apmApiClient.writeUser({ + endpoint: 'POST /internal/apm/service-group', + params: { + query: { + serviceGroupId, + }, + body: { + groupName, + kuery, + description, + color, + }, + }, + }); + return response; + } + + type SavedObjectsFindResults = Array<{ + id: string; + type: string; + }>; + + async function deleteServiceGroups() { + const response = await supertest + .get('/api/saved_objects/_find?type=apm-service-group') + .set('kbn-xsrf', 'true'); + const savedObjects: SavedObjectsFindResults = response.body.saved_objects; + const bulkDeleteBody = savedObjects.map(({ id, type }) => ({ id, type })); + return supertest + .post(`/api/saved_objects/_bulk_delete?force=true`) + .set('kbn-xsrf', 'foo') + .send(bulkDeleteBody); + } + + registry.when('Service group create', { config: 'basic', archives: [] }, () => { + afterEach(deleteServiceGroups); + + it('creates a new service group', async () => { + const response = await callApi({ + groupName: 'synthbeans', + kuery: 'service.name: synth*', + }); + expect(response.status).to.be(200); + expect(Object.keys(response.body).length).to.be(0); + }); + + it('handles invalid fields with error response', async () => { + const err = await expectToReject<ApmApiError>(() => + callApi({ + groupName: 'synthbeans', + kuery: 'service.name: synth* or transaction.type: request', + }) + ); + + expect(err.res.status).to.be(400); + expect(err.res.body.message).to.contain('transaction.type'); + }); + }); +} diff --git a/x-pack/test/apm_api_integration/tests/services/get_service_node_metadata.spec.ts b/x-pack/test/apm_api_integration/tests/services/get_service_node_metadata.spec.ts index faa160063dfa1..9e64bc127db7c 100644 --- a/x-pack/test/apm_api_integration/tests/services/get_service_node_metadata.spec.ts +++ b/x-pack/test/apm_api_integration/tests/services/get_service_node_metadata.spec.ts @@ -28,6 +28,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { start: new Date(start).toISOString(), end: new Date(end).toISOString(), kuery: '', + environment: 'production', }, }, }); diff --git a/x-pack/test/apm_api_integration/tests/storage_explorer/get_services.spec.ts b/x-pack/test/apm_api_integration/tests/storage_explorer/get_services.spec.ts new file mode 100644 index 0000000000000..7d036a7018de0 --- /dev/null +++ b/x-pack/test/apm_api_integration/tests/storage_explorer/get_services.spec.ts @@ -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 { apm, timerange } from '@kbn/apm-synthtrace'; +import expect from '@kbn/expect'; +import { IndexLifecyclePhaseSelectOption } from '@kbn/apm-plugin/common/storage_explorer_types'; +import { FtrProviderContext } from '../../common/ftr_provider_context'; + +export default function ApiTest({ getService }: FtrProviderContext) { + const registry = getService('registry'); + const synthtraceEsClient = getService('synthtraceEsClient'); + const apmApiClient = getService('apmApiClient'); + + const start = '2021-01-01T12:00:00.000Z'; + const end = '2021-08-01T12:00:00.000Z'; + + // The terms enum API may return terms from deleted documents + // so we add a prefix to make sure we don't get data from other tests + const SERVICE_NAME_PREFIX = 'storage_explorer_services_'; + + async function getServices({ + environment = 'ENVIRONMENT_ALL', + kuery = '', + indexLifecyclePhase = IndexLifecyclePhaseSelectOption.All, + }: { + environment?: string; + kuery?: string; + indexLifecyclePhase?: IndexLifecyclePhaseSelectOption; + } = {}) { + const response = await apmApiClient.readUser({ + endpoint: 'GET /internal/apm/storage_explorer/get_services', + params: { + query: { + environment, + kuery, + indexLifecyclePhase, + }, + }, + }); + + return response.body.services + .filter((service) => service.serviceName.startsWith(SERVICE_NAME_PREFIX)) + .map((service) => ({ + ...service, + serviceName: service.serviceName.replace(SERVICE_NAME_PREFIX, ''), + })); + } + + registry.when('Get services', { config: 'basic', archives: [] }, () => { + before(async () => { + const serviceA = apm + .service({ name: `${SERVICE_NAME_PREFIX}a`, environment: 'production', agentName: 'java' }) + .instance('a'); + + const serviceB = apm + .service({ name: `${SERVICE_NAME_PREFIX}b`, environment: 'development', agentName: 'go' }) + .instance('b'); + + const serviceC = apm + .service({ name: `${SERVICE_NAME_PREFIX}c`, environment: 'development', agentName: 'go' }) + .instance('c'); + + const eventsWithinTimerange = timerange(new Date(start).getTime(), new Date(end).getTime()) + .interval('15m') + .rate(1) + .generator((timestamp) => [ + serviceA.transaction({ transactionName: 'GET /api' }).duration(1000).timestamp(timestamp), + serviceB.transaction({ transactionName: 'GET /api' }).duration(1000).timestamp(timestamp), + ]); + + const eventsOutsideOfTimerange = timerange( + new Date('2021-01-01T00:00:00.000Z').getTime(), + new Date(start).getTime() - 1 + ) + .interval('15m') + .rate(1) + .generator((timestamp) => + serviceC.transaction({ transactionName: 'GET /api' }).duration(1000).timestamp(timestamp) + ); + + await synthtraceEsClient.index(eventsWithinTimerange.merge(eventsOutsideOfTimerange)); + }); + + after(() => synthtraceEsClient.clean()); + + it('with no kuery, environment or index lifecycle phase set it returns services based on the terms enum API', async () => { + const items = await getServices(); + const serviceNames = items.map((item) => item.serviceName); + expect(serviceNames.sort()).to.eql(['a', 'b', 'c']); + }); + + it('with kuery set does it does not return any services', async () => { + const services = await getServices({ + kuery: 'service.name:*', + }); + expect(services).to.be.empty(); + }); + + it('with environment set to production it does not return any services', async () => { + const services = await getServices({ + environment: 'production', + }); + expect(services).to.be.empty(); + }); + + it('with index lifecycle phase set to hot it does not return any services', async () => { + const services = await getServices({ + indexLifecyclePhase: IndexLifecyclePhaseSelectOption.Hot, + }); + expect(services).to.be.empty(); + }); + }); +} diff --git a/x-pack/test/apm_api_integration/tests/storage_explorer/storage_details.spec.ts b/x-pack/test/apm_api_integration/tests/storage_explorer/storage_details.spec.ts index a9ec2199c8b23..260c22eb68775 100644 --- a/x-pack/test/apm_api_integration/tests/storage_explorer/storage_details.spec.ts +++ b/x-pack/test/apm_api_integration/tests/storage_explorer/storage_details.spec.ts @@ -36,7 +36,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { APIClientRequestParamsOf<'GET /internal/apm/services/{serviceName}/storage_details'>['params'] > ) { - return await apmApiClient.monitorIndicesUser({ + return await apmApiClient.monitorClusterAndIndicesUser({ endpoint: 'GET /internal/apm/services/{serviceName}/storage_details', params: { path: { @@ -70,8 +70,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { } ); - registry.when('Storage details', { config: 'basic', archives: [] }, () => { - describe('when data is loaded', () => { + // FLAKY: https://github.com/elastic/kibana/issues/144025 + registry.when.skip('Storage details', { config: 'basic', archives: [] }, () => { + describe.skip('when data is loaded', () => { before(async () => { const serviceGo = apm .service({ name: serviceName, environment: 'production', agentName: 'go' }) diff --git a/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer.spec.ts b/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer.spec.ts index dc2429a5b8b3a..f54149665174b 100644 --- a/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer.spec.ts +++ b/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer.spec.ts @@ -27,7 +27,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { APIClientRequestParamsOf<'GET /internal/apm/storage_explorer'>['params'] > ) { - return await apmApiClient.monitorIndicesUser({ + return await apmApiClient.monitorClusterAndIndicesUser({ endpoint: 'GET /internal/apm/storage_explorer', params: { query: { diff --git a/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_privileges.spec.ts b/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_privileges.spec.ts index 4d7cc8655840f..087bacdc898b3 100644 --- a/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_privileges.spec.ts +++ b/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_privileges.spec.ts @@ -20,7 +20,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { registry.when('Storage explorer privileges', { config: 'basic', archives: [] }, () => { it('returns true when the user has the required indices privileges', async () => { - const { status, body } = await callApi(apmApiClient.monitorIndicesUser); + const { status, body } = await callApi(apmApiClient.monitorClusterAndIndicesUser); expect(status).to.be(200); expect(body.hasPrivileges).to.be(true); }); diff --git a/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_summary_stats.spec.ts b/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_summary_stats.spec.ts index afde7d243c227..37a747a3c3e76 100644 --- a/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_summary_stats.spec.ts +++ b/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_summary_stats.spec.ts @@ -27,7 +27,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { APIClientRequestParamsOf<'GET /internal/apm/storage_explorer_summary_stats'>['params'] > ) { - return await apmApiClient.monitorIndicesUser({ + return await apmApiClient.monitorClusterAndIndicesUser({ endpoint: 'GET /internal/apm/storage_explorer_summary_stats', params: { query: { @@ -53,7 +53,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(status).to.be(200); expect(body.tracesPerMinute).to.be(0); expect(body.numberOfServices).to.be(0); - expect(body.estimatedSize).to.be(0); + expect(body.totalSize).to.be(0); + expect(body.estimatedIncrementalSize).to.be(0); + expect(body.diskSpaceUsedPct).to.be(0); expect(body.dailyDataGeneration).to.be(0); }); } @@ -100,7 +102,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(status).to.be(200); expect(body.numberOfServices).to.be(2); expect(roundNumber(body.tracesPerMinute)).to.be(2); - expect(body.estimatedSize).to.be.greaterThan(0); + expect(body.totalSize).to.be.greaterThan(0); + expect(body.estimatedIncrementalSize).to.be.greaterThan(0); + expect(body.diskSpaceUsedPct).to.be.greaterThan(0); expect(body.dailyDataGeneration).to.be.greaterThan(0); }); @@ -114,7 +118,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(status).to.be(200); expect(body.numberOfServices).to.be(1); expect(roundNumber(body.tracesPerMinute)).to.be(1); - expect(body.estimatedSize).to.be.greaterThan(0); + expect(body.totalSize).to.be.greaterThan(0); + expect(body.estimatedIncrementalSize).to.be.greaterThan(0); + expect(body.diskSpaceUsedPct).to.be.greaterThan(0); expect(body.dailyDataGeneration).to.be.greaterThan(0); }); @@ -128,7 +134,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(status).to.be(200); expect(body.tracesPerMinute).to.be(0); expect(body.numberOfServices).to.be(0); - expect(body.estimatedSize).to.be(0); + expect(body.totalSize).to.be.greaterThan(0); + expect(body.estimatedIncrementalSize).to.be(0); + expect(body.diskSpaceUsedPct).to.be.greaterThan(0); expect(body.dailyDataGeneration).to.be(0); }); @@ -142,7 +150,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(status).to.be(200); expect(body.numberOfServices).to.be(1); expect(roundNumber(body.tracesPerMinute)).to.be(1); - expect(body.estimatedSize).to.be.greaterThan(0); + expect(body.totalSize).to.be.greaterThan(0); + expect(body.estimatedIncrementalSize).to.be.greaterThan(0); + expect(body.diskSpaceUsedPct).to.be.greaterThan(0); expect(body.dailyDataGeneration).to.be.greaterThan(0); }); }); diff --git a/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_timeseries_chart.spec.ts b/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_timeseries_chart.spec.ts index 632e17c37509a..f668b0ba71a5c 100644 --- a/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_timeseries_chart.spec.ts +++ b/x-pack/test/apm_api_integration/tests/storage_explorer/storage_explorer_timeseries_chart.spec.ts @@ -22,7 +22,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; async function callApi() { - return await apmApiClient.monitorIndicesUser({ + return await apmApiClient.monitorClusterAndIndicesUser({ endpoint: 'GET /internal/apm/storage_chart', params: { query: { diff --git a/x-pack/test/apm_api_integration/tests/traces/critical_path.spec.ts b/x-pack/test/apm_api_integration/tests/traces/critical_path.spec.ts new file mode 100644 index 0000000000000..ca2a1f8d72f89 --- /dev/null +++ b/x-pack/test/apm_api_integration/tests/traces/critical_path.spec.ts @@ -0,0 +1,426 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { getAggregatedCriticalPathRootNodes } from '@kbn/apm-plugin/common'; +import { apm, EntityArrayIterable, EntityIterable, timerange } from '@kbn/apm-synthtrace'; +import expect from '@kbn/expect'; +import { Assign } from '@kbn/utility-types'; +import { invert, sortBy, uniq } from 'lodash'; +import { SupertestReturnType } from '../../common/apm_api_supertest'; +import { FtrProviderContext } from '../../common/ftr_provider_context'; + +export default function ApiTest({ getService }: FtrProviderContext) { + const registry = getService('registry'); + const apmApiClient = getService('apmApiClient'); + const synthtraceEsClient = getService('synthtraceEsClient'); + + const start = new Date('2022-01-01T00:00:00.000Z').getTime(); + const end = new Date('2022-01-01T00:15:00.000Z').getTime() - 1; + + type Node = ReturnType<typeof getAggregatedCriticalPathRootNodes>['rootNodes'][0]; + type Metadata = NonNullable< + SupertestReturnType<'POST /internal/apm/traces/aggregated_critical_path'>['body']['criticalPath'] + >['metadata'][string]; + type HydratedNode = Assign<Node, { metadata?: Metadata; children: HydratedNode[] }>; + + interface FormattedNode { + name: string; + value: number; + children: FormattedNode[]; + } + + // format tree in somewhat concise format for easier testing + function formatTree(nodes: HydratedNode[]): FormattedNode[] { + return sortBy( + nodes.map((node) => { + const name = + node.metadata?.['processor.event'] === 'transaction' + ? node.metadata['transaction.name'] + : node.metadata?.['span.name'] || 'root'; + return { name, value: node.countExclusive, children: formatTree(node.children) }; + }), + (node) => node.name + ); + } + + async function fetchAndBuildCriticalPathTree( + options: { fn: () => EntityIterable } & ({ serviceName: string; transactionName: string } | {}) + ) { + const { fn } = options; + + const generator = fn(); + + const events = generator.toArray(); + + const traceIds = uniq(events.map((event) => event['trace.id']!)); + + await synthtraceEsClient.index(new EntityArrayIterable(events)); + + return apmApiClient + .readUser({ + endpoint: 'POST /internal/apm/traces/aggregated_critical_path', + params: { + body: { + start: new Date(start).toISOString(), + end: new Date(end).toISOString(), + traceIds, + serviceName: 'serviceName' in options ? options.serviceName : null, + transactionName: 'transactionName' in options ? options.transactionName : null, + }, + }, + }) + .then((response) => { + const criticalPath = response.body.criticalPath!; + + const nodeIdByOperationId = invert(criticalPath.operationIdByNodeId); + + const { rootNodes, maxDepth } = getAggregatedCriticalPathRootNodes({ + criticalPath, + }); + + function hydrateNode(node: Node): HydratedNode { + return { + ...node, + metadata: criticalPath.metadata[criticalPath.operationIdByNodeId[node.nodeId]], + children: node.children.map(hydrateNode), + }; + } + + return { + rootNodes: rootNodes.map(hydrateNode), + maxDepth, + criticalPath, + nodeIdByOperationId, + }; + }); + } + + registry.when('Aggregated critical path', { config: 'basic', archives: [] }, () => { + it('builds up the correct tree for a single transaction', async () => { + const java = apm + .service({ name: 'java', environment: 'production', agentName: 'java' }) + .instance('java'); + + const duration = 1000; + const rate = 10; + + const { rootNodes } = await fetchAndBuildCriticalPathTree({ + fn: () => + timerange(start, end) + .interval('15m') + .rate(rate) + .generator((timestamp) => { + return java.transaction('GET /api').timestamp(timestamp).duration(duration); + }), + }); + + expect(rootNodes.length).to.be(1); + + expect(rootNodes[0].countInclusive).to.eql(duration * rate * 1000); + expect(rootNodes[0].countExclusive).to.eql(duration * rate * 1000); + + expect(rootNodes[0].metadata).to.eql({ + 'processor.event': 'transaction', + 'transaction.type': 'request', + 'service.name': 'java', + 'agent.name': 'java', + 'transaction.name': 'GET /api', + }); + }); + + it('builds up the correct tree for a complicated trace', async () => { + const java = apm + .service({ name: 'java', environment: 'production', agentName: 'java' }) + .instance('java'); + + const rate = 10; + + const { rootNodes } = await fetchAndBuildCriticalPathTree({ + fn: () => + timerange(start, end) + .interval('15m') + .rate(rate) + .generator((timestamp) => { + return java + .transaction('GET /api') + .timestamp(timestamp) + .duration(1000) + .children( + java + .span('GET /_search', 'db', 'elasticsearch') + .timestamp(timestamp) + .duration(400), + java + .span('get index stats', 'custom') + .timestamp(timestamp) + .duration(500) + .children( + java + .span('GET /*/_stats', 'db', 'elasticsearch') + .timestamp(timestamp + 50) + .duration(450) + ) + ); + }), + }); + + expect(rootNodes.length).to.be(1); + + expect(rootNodes[0].countInclusive).to.eql(1000 * rate * 1000); + + expect(rootNodes[0].children.length).to.eql(1); + + expect(formatTree(rootNodes)).to.eql([ + { + name: 'GET /api', + value: 500 * 1000 * rate, + children: [ + { + name: 'get index stats', + value: 50 * 1000 * rate, + children: [{ name: 'GET /*/_stats', value: 450 * 1000 * rate, children: [] }], + }, + ], + }, + ]); + }); + + it('slices traces and merges root nodes if service name and transaction name are set', async () => { + // this test also fails when hashCode() is used in the scripted metric aggregation, + // due to collisions. + + const upstreamA = apm + .service({ name: 'upstreamA', environment: 'production', agentName: 'java' }) + .instance('upstreamA'); + + const upstreamB = apm + .service({ name: 'upstreamB', environment: 'production', agentName: 'java' }) + .instance('upstreamB'); + + const downstream = apm + .service({ name: 'downstream', environment: 'production', agentName: 'java' }) + .instance('downstream'); + + const rate = 10; + + function generateTrace() { + return timerange(start, end) + .interval('15m') + .rate(rate) + .generator((timestamp) => { + return [ + upstreamA + .transaction('GET /upstreamA') + .timestamp(timestamp) + .duration(500) + .children( + upstreamA + .span('GET /downstream', 'external', 'http') + .timestamp(timestamp) + .duration(500) + .children( + downstream + .transaction('downstream') + .timestamp(timestamp + 50) + .duration(400) + .children( + downstream + .span('from upstreamA', 'custom') + .timestamp(timestamp + 100) + .duration(300) + ) + ) + ), + upstreamB + .transaction('GET /upstreamB') + .timestamp(timestamp) + .duration(500) + .children( + upstreamB + .span('GET /downstream', 'external', 'http') + .timestamp(timestamp) + .duration(500) + .children( + downstream + .transaction('downstream') + .timestamp(timestamp + 50) + .duration(400) + .children( + downstream + .span('from upstreamB', 'custom') + .timestamp(timestamp + 100) + .duration(300) + ) + ) + ), + ]; + }); + } + + const { rootNodes: unfilteredRootNodes } = await fetchAndBuildCriticalPathTree({ + fn: () => generateTrace(), + }); + + await synthtraceEsClient.clean(); + + const { rootNodes: filteredRootNodes } = await fetchAndBuildCriticalPathTree({ + fn: () => generateTrace(), + serviceName: 'downstream', + transactionName: 'downstream', + }); + + expect(formatTree(unfilteredRootNodes)).eql([ + { + name: 'GET /upstreamA', + value: 0, + children: [ + { + name: 'GET /downstream', + value: 100 * 1000 * rate, + children: [ + { + name: 'downstream', + value: 100 * 1000 * rate, + children: [ + { + name: 'from upstreamA', + value: 300 * 1000 * rate, + children: [], + }, + ], + }, + ], + }, + ], + }, + { + name: 'GET /upstreamB', + value: 0, + children: [ + { + name: 'GET /downstream', + value: 100 * 1000 * rate, + children: [ + { + name: 'downstream', + value: 100 * 1000 * rate, + children: [ + { + name: 'from upstreamB', + value: 300 * 1000 * rate, + children: [], + }, + ], + }, + ], + }, + ], + }, + ]); + + expect(formatTree(filteredRootNodes)).eql([ + { + name: 'downstream', + value: 2 * 100 * 1000 * rate, + children: [ + { + name: 'from upstreamA', + value: 300 * 1000 * rate, + children: [], + }, + { + name: 'from upstreamB', + value: 300 * 1000 * rate, + children: [], + }, + ], + }, + ]); + }); + + it('calculates the critical path for a specific transaction if its not part of the critical path of the entire trace', async () => { + const upstream = apm + .service({ name: 'upstream', environment: 'production', agentName: 'java' }) + .instance('upstream'); + + const downstreamA = apm + .service({ name: 'downstreamA', environment: 'production', agentName: 'java' }) + .instance('downstreamB'); + + const downstreamB = apm + .service({ name: 'downstreamB', environment: 'production', agentName: 'java' }) + .instance('downstreamB'); + + const rate = 10; + + function generateTrace() { + return timerange(start, end) + .interval('15m') + .rate(rate) + .generator((timestamp) => { + return [ + upstream + .transaction('GET /upstream') + .timestamp(timestamp) + .duration(500) + .children( + upstream + .span('GET /downstreamA', 'external', 'http') + .timestamp(timestamp) + .duration(500) + .children( + downstreamA + .transaction('downstreamA') + .timestamp(timestamp + 50) + .duration(400) + ), + upstream + .span('GET /downstreamB', 'external', 'http') + .timestamp(timestamp) + .duration(400) + .children( + downstreamB + .transaction('downstreamB') + .timestamp(timestamp + 50) + .duration(400) + ) + ), + ]; + }); + } + + const { rootNodes: unfilteredRootNodes } = await fetchAndBuildCriticalPathTree({ + fn: () => generateTrace(), + }); + + expect(formatTree(unfilteredRootNodes)[0].children[0].children).to.eql([ + { + name: 'downstreamA', + value: 400 * rate * 1000, + children: [], + }, + ]); + + await synthtraceEsClient.clean(); + + const { rootNodes: filteredRootNodes } = await fetchAndBuildCriticalPathTree({ + fn: () => generateTrace(), + serviceName: 'downstreamB', + transactionName: 'downstreamB', + }); + + expect(formatTree(filteredRootNodes)).to.eql([ + { + name: 'downstreamB', + value: 400 * rate * 1000, + children: [], + }, + ]); + }); + + after(() => synthtraceEsClient.clean()); + }); +} diff --git a/x-pack/test/apm_api_integration/tests/traces/find_traces.spec.ts b/x-pack/test/apm_api_integration/tests/traces/find_traces.spec.ts index 470a68aeacc19..93416c7243f2d 100644 --- a/x-pack/test/apm_api_integration/tests/traces/find_traces.spec.ts +++ b/x-pack/test/apm_api_integration/tests/traces/find_traces.spec.ts @@ -1,9 +1,3 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License diff --git a/x-pack/test/cases_api_integration/common/lib/validation.ts b/x-pack/test/cases_api_integration/common/lib/validation.ts index a84c733586ec0..e022beb5a597a 100644 --- a/x-pack/test/cases_api_integration/common/lib/validation.ts +++ b/x-pack/test/cases_api_integration/common/lib/validation.ts @@ -6,26 +6,57 @@ */ import expect from '@kbn/expect'; -import { CaseResponse, CasesByAlertId } from '@kbn/cases-plugin/common/api'; +import { + AttachmentTotals, + CaseResponse, + CasesByAlertId, + RelatedCaseInfo, +} from '@kbn/cases-plugin/common/api'; import { xorWith, isEqual } from 'lodash'; +type AttachmentTotalsKeys = keyof AttachmentTotals; + +export interface TestCaseWithTotals { + caseInfo: CaseResponse; + totals?: Partial<AttachmentTotals>; +} + /** * Ensure that the result of the alerts API request matches with the cases created for the test. */ export function validateCasesFromAlertIDResponse( casesFromAPIResponse: CasesByAlertId, - createdCasesForTest: CaseResponse[] + createdCasesForTest: TestCaseWithTotals[] ) { - const idToTitle = new Map<string, string>( - createdCasesForTest.map((caseInfo) => [caseInfo.id, caseInfo.title]) + const idToResponse = new Map<string, RelatedCaseInfo>( + casesFromAPIResponse.map((response) => [response.id, response]) ); - for (const apiResCase of casesFromAPIResponse) { - // check that the title in the api response matches the title in the map from the created cases - expect(apiResCase.title).to.be(idToTitle.get(apiResCase.id)); + expect(idToResponse.size).to.be(createdCasesForTest.length); + + // only iterate over the test cases not the api response values + for (const expectedTestInfo of createdCasesForTest) { + expect(idToResponse.get(expectedTestInfo.caseInfo.id)?.title).to.be( + expectedTestInfo.caseInfo.title + ); + expect(idToResponse.get(expectedTestInfo.caseInfo.id)?.description).to.be( + expectedTestInfo.caseInfo.description + ); + expect(idToResponse.get(expectedTestInfo.caseInfo.id)?.status).to.be( + expectedTestInfo.caseInfo.status + ); + expect(idToResponse.get(expectedTestInfo.caseInfo.id)?.createdAt).to.be( + expectedTestInfo.caseInfo.created_at + ); + + // only check the totals that are defined in the test case + for (const totalKey of Object.keys(expectedTestInfo.totals ?? {}) as AttachmentTotalsKeys[]) { + expect(idToResponse.get(expectedTestInfo.caseInfo.id)?.totals[totalKey]).to.be( + expectedTestInfo.totals?.[totalKey] + ); + } } } - /** * Compares two arrays to determine if they are sort of equal. This function returns true if the arrays contain the same * elements but the ordering does not matter. diff --git a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/alerts/get_cases.ts b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/alerts/get_cases.ts index 4d6c20192442a..d0a5f45dae851 100644 --- a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/alerts/get_cases.ts +++ b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/alerts/get_cases.ts @@ -10,7 +10,11 @@ import { CASES_URL } from '@kbn/cases-plugin/common/constants'; import { CaseResponse } from '@kbn/cases-plugin/common/api'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; -import { getPostCaseRequest, postCommentAlertReq } from '../../../../common/lib/mock'; +import { + getPostCaseRequest, + postCommentAlertReq, + postCommentUserReq, +} from '../../../../common/lib/mock'; import { createCase, createComment, @@ -56,7 +60,11 @@ export default ({ getService }: FtrProviderContext): void => { const caseIDsWithAlert = await getCasesByAlert({ supertest, alertID: 'test-id' }); expect(caseIDsWithAlert.length).to.eql(3); - validateCasesFromAlertIDResponse(caseIDsWithAlert, [case1, case2, case3]); + validateCasesFromAlertIDResponse(caseIDsWithAlert, [ + { caseInfo: case1, totals: { alerts: 1, userComments: 0 } }, + { caseInfo: case2, totals: { alerts: 1, userComments: 0 } }, + { caseInfo: case3, totals: { alerts: 1, userComments: 0 } }, + ]); }); it('should return all cases with the same alert ID when more than 100 cases', async () => { @@ -83,7 +91,15 @@ export default ({ getService }: FtrProviderContext): void => { expect(caseIDsWithAlert.length).to.eql(numCases); - validateCasesFromAlertIDResponse(caseIDsWithAlert, cases); + const testResults = cases.map((caseInfo) => ({ + caseInfo, + totals: { + alerts: 1, + userComments: 0, + }, + })); + + validateCasesFromAlertIDResponse(caseIDsWithAlert, testResults); }); it('should return no cases when the alert ID is not found', async () => { @@ -131,6 +147,55 @@ export default ({ getService }: FtrProviderContext): void => { await supertest.get(`${CASES_URL}/alerts/`).expect(302); }); + describe('attachment stats', () => { + it('should only count unique alert ids in the alert totals', async () => { + const [case1, case2] = await Promise.all([ + createCase(supertest, getPostCaseRequest({ title: 'a' })), + createCase(supertest, getPostCaseRequest({ title: 'b' })), + ]); + + await Promise.all([ + createComment({ supertest, caseId: case1.id, params: postCommentAlertReq }), + createComment({ supertest, caseId: case2.id, params: postCommentAlertReq }), + ]); + + // two alerts with same alert id attached to case1 + await createComment({ supertest, caseId: case1.id, params: postCommentAlertReq }); + + const caseIDsWithAlert = await getCasesByAlert({ supertest, alertID: 'test-id' }); + + expect(caseIDsWithAlert.length).to.eql(2); + validateCasesFromAlertIDResponse(caseIDsWithAlert, [ + { caseInfo: case1, totals: { alerts: 1, userComments: 0 } }, + { caseInfo: case2, totals: { alerts: 1, userComments: 0 } }, + ]); + }); + + it('should get the total number of user comments attached to a case', async () => { + const [case1, case2] = await Promise.all([ + createCase(supertest, getPostCaseRequest({ title: 'a' })), + createCase(supertest, getPostCaseRequest({ title: 'b' })), + ]); + + await Promise.all([ + createComment({ supertest, caseId: case1.id, params: postCommentAlertReq }), + createComment({ supertest, caseId: case2.id, params: postCommentAlertReq }), + ]); + + // two user comments attached to case2 + await createComment({ supertest, caseId: case2.id, params: postCommentUserReq }); + await createComment({ supertest, caseId: case2.id, params: postCommentUserReq }); + + const caseIDsWithAlert = await getCasesByAlert({ supertest, alertID: 'test-id' }); + + expect(caseIDsWithAlert.length).to.eql(2); + validateCasesFromAlertIDResponse(caseIDsWithAlert, [ + { caseInfo: case1, totals: { alerts: 1, userComments: 0 } }, + { caseInfo: case2, totals: { alerts: 1, userComments: 2 } }, + ]); + }); + }); + describe('rbac', () => { const supertestWithoutAuth = getService('supertestWithoutAuth'); @@ -197,7 +262,15 @@ export default ({ getService }: FtrProviderContext): void => { }); expect(res.length).to.eql(scenario.cases.length); - validateCasesFromAlertIDResponse(res, scenario.cases); + const testResults = scenario.cases.map((caseInfo) => ({ + caseInfo, + totals: { + alerts: 1, + userComments: 0, + }, + })); + + validateCasesFromAlertIDResponse(res, testResults); } }); @@ -263,7 +336,19 @@ export default ({ getService }: FtrProviderContext): void => { query: { owner: 'securitySolutionFixture' }, }); - expect(res).to.eql([{ id: case1.id, title: case1.title }]); + expect(res).to.eql([ + { + id: case1.id, + title: case1.title, + description: case1.description, + status: case1.status, + createdAt: case1.created_at, + totals: { + userComments: 0, + alerts: 1, + }, + }, + ]); }); it('should return the correct cases info when the owner query parameter contains unprivileged values', async () => { @@ -301,7 +386,19 @@ export default ({ getService }: FtrProviderContext): void => { query: { owner: ['securitySolutionFixture', 'observabilityFixture'] }, }); - expect(res).to.eql([{ id: case1.id, title: case1.title }]); + expect(res).to.eql([ + { + id: case1.id, + title: case1.title, + description: case1.description, + status: case1.status, + createdAt: case1.created_at, + totals: { + userComments: 0, + alerts: 1, + }, + }, + ]); }); }); }); diff --git a/x-pack/test/cases_api_integration/spaces_only/tests/common/alerts/get_cases.ts b/x-pack/test/cases_api_integration/spaces_only/tests/common/alerts/get_cases.ts index 691d132aa1ede..be0a698a6b525 100644 --- a/x-pack/test/cases_api_integration/spaces_only/tests/common/alerts/get_cases.ts +++ b/x-pack/test/cases_api_integration/spaces_only/tests/common/alerts/get_cases.ts @@ -65,7 +65,11 @@ export default ({ getService }: FtrProviderContext): void => { }); expect(cases.length).to.eql(3); - validateCasesFromAlertIDResponse(cases, [case1, case2, case3]); + validateCasesFromAlertIDResponse(cases, [ + { caseInfo: case1, totals: { alerts: 1, userComments: 0 } }, + { caseInfo: case2, totals: { alerts: 1, userComments: 0 } }, + { caseInfo: case3, totals: { alerts: 1, userComments: 0 } }, + ]); }); it('should return 1 case in space2 when 2 cases were created in space1 and 1 in space2', async () => { @@ -103,7 +107,19 @@ export default ({ getService }: FtrProviderContext): void => { }); expect(casesByAlert.length).to.eql(1); - expect(casesByAlert).to.eql([{ id: case3.id, title: case3.title }]); + expect(casesByAlert).to.eql([ + { + id: case3.id, + title: case3.title, + description: case3.description, + status: case3.status, + createdAt: case3.created_at, + totals: { + userComments: 0, + alerts: 1, + }, + }, + ]); }); }); }; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/perform_bulk_action.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/perform_bulk_action.ts index 30b378d2a7eea..82cb42c0039c3 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/perform_bulk_action.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/perform_bulk_action.ts @@ -14,7 +14,7 @@ import { } from '@kbn/security-solution-plugin/common/constants'; import type { RuleResponse } from '@kbn/security-solution-plugin/common/detection_engine/rule_schema'; import { - BulkAction, + BulkActionType, BulkActionEditType, } from '@kbn/security-solution-plugin/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import { FtrProviderContext } from '../../common/ftr_provider_context'; @@ -83,7 +83,7 @@ export default ({ getService }: FtrProviderContext): void => { await createRule(supertest, log, getSimpleRule()); const { body } = await postBulkAction() - .send({ query: '', action: BulkAction.export }) + .send({ query: '', action: BulkActionType.export }) .expect(200) .expect('Content-Type', 'application/ndjson') .expect('Content-Disposition', 'attachment; filename="rules_export.ndjson"') @@ -115,7 +115,7 @@ export default ({ getService }: FtrProviderContext): void => { await createRule(supertest, log, testRule); const { body } = await postBulkAction() - .send({ query: '', action: BulkAction.delete }) + .send({ query: '', action: BulkActionType.delete }) .expect(200); expect(body.attributes.summary).to.eql({ failed: 0, succeeded: 1, total: 1 }); @@ -150,7 +150,7 @@ export default ({ getService }: FtrProviderContext): void => { expect(sidecarActionsResults.hits.hits[0]?._source?.references[0].id).to.eql(rule1.id); const { body } = await postBulkAction() - .send({ query: '', action: BulkAction.delete }) + .send({ query: '', action: BulkActionType.delete }) .expect(200); expect(body.attributes.summary).to.eql({ failed: 0, succeeded: 1, total: 1 }); @@ -171,7 +171,7 @@ export default ({ getService }: FtrProviderContext): void => { await createRule(supertest, log, getSimpleRule(ruleId)); const { body } = await postBulkAction() - .send({ query: '', action: BulkAction.enable }) + .send({ query: '', action: BulkActionType.enable }) .expect(200); expect(body.attributes.summary).to.eql({ failed: 0, succeeded: 1, total: 1 }); @@ -207,7 +207,7 @@ export default ({ getService }: FtrProviderContext): void => { expect(sidecarActionsResults.hits.hits[0]?._source?.references[0].id).to.eql(rule1.id); const { body } = await postBulkAction() - .send({ query: '', action: BulkAction.enable }) + .send({ query: '', action: BulkActionType.enable }) .expect(200); expect(body.attributes.summary).to.eql({ failed: 0, succeeded: 1, total: 1 }); @@ -240,7 +240,7 @@ export default ({ getService }: FtrProviderContext): void => { await createRule(supertest, log, getSimpleRule(ruleId, true)); const { body } = await postBulkAction() - .send({ query: '', action: BulkAction.disable }) + .send({ query: '', action: BulkActionType.disable }) .expect(200); expect(body.attributes.summary).to.eql({ failed: 0, succeeded: 1, total: 1 }); @@ -276,7 +276,7 @@ export default ({ getService }: FtrProviderContext): void => { expect(sidecarActionsResults.hits.hits[0]?._source?.references[0].id).to.eql(rule1.id); const { body } = await postBulkAction() - .send({ query: '', action: BulkAction.disable }) + .send({ query: '', action: BulkActionType.disable }) .expect(200); expect(body.attributes.summary).to.eql({ failed: 0, succeeded: 1, total: 1 }); @@ -310,7 +310,7 @@ export default ({ getService }: FtrProviderContext): void => { await createRule(supertest, log, ruleToDuplicate); const { body } = await postBulkAction() - .send({ query: '', action: BulkAction.duplicate }) + .send({ query: '', action: BulkActionType.duplicate }) .expect(200); expect(body.attributes.summary).to.eql({ failed: 0, succeeded: 1, total: 1 }); @@ -352,7 +352,7 @@ export default ({ getService }: FtrProviderContext): void => { ); const { body } = await postBulkAction() - .send({ query: '', action: BulkAction.duplicate }) + .send({ query: '', action: BulkActionType.duplicate }) .expect(200); expect(body.attributes.summary).to.eql({ failed: 0, succeeded: 1, total: 1 }); @@ -432,8 +432,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: bulkEditResponse } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_tags, value: tagsToOverwrite, @@ -506,8 +506,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: bulkEditResponse } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.delete_tags, value: tagsToDelete, @@ -573,8 +573,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: bulkEditResponse } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_tags, value: addedTags, @@ -608,8 +608,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: bulkEditResponse } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_index_patterns, value: ['initial-index-*'], @@ -638,8 +638,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: bulkEditResponse } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_index_patterns, value: ['index3-*'], @@ -670,8 +670,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: bulkEditResponse } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.delete_index_patterns, value: ['index2-*'], @@ -699,8 +699,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [mlRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_index_patterns, value: ['index-*'], @@ -732,8 +732,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [rule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.delete_index_patterns, value: ['simple-index-*'], @@ -765,8 +765,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [rule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_index_patterns, value: [], @@ -820,8 +820,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: setTagsBody } = await postBulkAction().send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_tags, value: ['reset-tag'], @@ -862,8 +862,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_timeline, value: { @@ -905,8 +905,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_timeline, value: { @@ -937,8 +937,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [mlRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_index_patterns, value: ['index-*'], @@ -970,8 +970,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [rule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.delete_index_patterns, value: ['simple-index-*'], @@ -999,8 +999,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [rule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_tags, value: ['test'], @@ -1060,8 +1060,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [prebuiltRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type, value, @@ -1104,8 +1104,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_rule_actions, value: { @@ -1160,8 +1160,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_rule_actions, value: { @@ -1218,8 +1218,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_rule_actions, value: { @@ -1252,8 +1252,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_rule_actions, value: { @@ -1310,8 +1310,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_rule_actions, value: { @@ -1377,8 +1377,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_rule_actions, value: { @@ -1436,8 +1436,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_rule_actions, value: { @@ -1481,8 +1481,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_rule_actions, value: { @@ -1522,8 +1522,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [prebuiltRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type, value: { @@ -1576,8 +1576,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [prebuiltRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_rule_actions, value: { @@ -1641,8 +1641,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_rule_actions, value: { @@ -1697,8 +1697,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_rule_actions, value: { @@ -1749,8 +1749,8 @@ export default ({ getService }: FtrProviderContext): void => { await postBulkAction() .send({ ids: [createdRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_rule_actions, value: { @@ -1783,8 +1783,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_schedule, value: { @@ -1813,8 +1813,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_schedule, value: { @@ -1851,8 +1851,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: setIndexBody } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_index_patterns, value: ['initial-index-*'], @@ -1887,8 +1887,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: setIndexBody } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.add_index_patterns, value: ['initial-index-*'], @@ -1924,8 +1924,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: setIndexBody } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_index_patterns, value: ['initial-index-*'], @@ -1960,8 +1960,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_index_patterns, value: [], @@ -1997,8 +1997,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body: setIndexBody } = await postBulkAction() .send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_index_patterns, value: ['initial-index-*'], @@ -2035,8 +2035,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [rule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.delete_index_patterns, value: ['simple-index-*'], @@ -2071,8 +2071,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [rule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.delete_index_patterns, value: ['simple-index-*'], @@ -2107,8 +2107,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [rule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.delete_index_patterns, value: ['simple-index-*'], @@ -2142,8 +2142,8 @@ export default ({ getService }: FtrProviderContext): void => { Array.from({ length: 10 }).map(() => postBulkAction().send({ query: '', - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_timeline, value: { @@ -2171,8 +2171,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postBulkAction() .send({ ids: [id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_timeline, value: { diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/perform_bulk_action_dry_run.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/perform_bulk_action_dry_run.ts index b893f38f20310..741839e707ea9 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/perform_bulk_action_dry_run.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/perform_bulk_action_dry_run.ts @@ -10,7 +10,7 @@ import { } from '@kbn/security-solution-plugin/common/constants'; import expect from 'expect'; import { - BulkAction, + BulkActionType, BulkActionEditType, } from '@kbn/security-solution-plugin/common/detection_engine/rule_management/api/rules/bulk_actions/request_schema'; import { FtrProviderContext } from '../../common/ftr_provider_context'; @@ -54,7 +54,9 @@ export default ({ getService }: FtrProviderContext): void => { it('should not support export action', async () => { await createRule(supertest, log, getSimpleRule()); - const { body } = await postDryRunBulkAction().send({ action: BulkAction.export }).expect(400); + const { body } = await postDryRunBulkAction() + .send({ action: BulkActionType.export }) + .expect(400); expect(body).toEqual({ message: "Export action doesn't support dry_run mode", @@ -67,7 +69,9 @@ export default ({ getService }: FtrProviderContext): void => { const testRule = getSimpleRule(ruleId); await createRule(supertest, log, testRule); - const { body } = await postDryRunBulkAction().send({ action: BulkAction.delete }).expect(200); + const { body } = await postDryRunBulkAction() + .send({ action: BulkActionType.delete }) + .expect(200); expect(body.attributes.summary).toEqual({ failed: 0, succeeded: 1, total: 1 }); // dry_run mode shouldn't return any rules in results @@ -81,7 +85,9 @@ export default ({ getService }: FtrProviderContext): void => { const ruleId = 'ruleId'; await createRule(supertest, log, getSimpleRule(ruleId)); - const { body } = await postDryRunBulkAction().send({ action: BulkAction.enable }).expect(200); + const { body } = await postDryRunBulkAction() + .send({ action: BulkActionType.enable }) + .expect(200); expect(body.attributes.summary).toEqual({ failed: 0, succeeded: 1, total: 1 }); // dry_run mode shouldn't return any rules in results @@ -97,7 +103,7 @@ export default ({ getService }: FtrProviderContext): void => { await createRule(supertest, log, getSimpleRule(ruleId, true)); const { body } = await postDryRunBulkAction() - .send({ action: BulkAction.disable }) + .send({ action: BulkActionType.disable }) .expect(200); expect(body.attributes.summary).toEqual({ failed: 0, succeeded: 1, total: 1 }); @@ -115,7 +121,7 @@ export default ({ getService }: FtrProviderContext): void => { await createRule(supertest, log, ruleToDuplicate); const { body } = await postDryRunBulkAction() - .send({ action: BulkAction.disable }) + .send({ action: BulkActionType.disable }) .expect(200); expect(body.attributes.summary).toEqual({ failed: 0, succeeded: 1, total: 1 }); @@ -136,8 +142,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postDryRunBulkAction() .send({ - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_tags, value: ['reset-tag'], @@ -167,8 +173,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postDryRunBulkAction() .send({ ids: [immutableRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: BulkActionEditType.set_tags, value: ['reset-tag'], @@ -208,8 +214,8 @@ export default ({ getService }: FtrProviderContext): void => { const { body } = await postDryRunBulkAction() .send({ ids: [mlRule.id], - action: BulkAction.edit, - [BulkAction.edit]: [ + action: BulkActionType.edit, + [BulkActionType.edit]: [ { type: editAction, value: [], diff --git a/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts b/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts index 277bafb998761..b8703cd5a1380 100644 --- a/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts +++ b/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts @@ -348,7 +348,7 @@ export default function (providerContext: FtrProviderContext) { return 0; } - const policyId = 'package-policy-test-1'; + const policyId = 'package-policy-test-'; packagePoliciesToDeleteIds.push(policyId); const getPkRes = await supertest .get(`/api/fleet/epm/packages/system`) @@ -438,6 +438,92 @@ export default function (providerContext: FtrProviderContext) { expect(await getSystemPackagePolicyCopyVersion(copy3Id)).to.be(3); }); + it('should work with package policy with space in name', async () => { + const policyId = 'package-policy-test-1'; + packagePoliciesToDeleteIds.push(policyId); + const getPkRes = await supertest + .get(`/api/fleet/epm/packages/system`) + .set('kbn-xsrf', 'xxxx') + .expect(200); + systemPkgVersion = getPkRes.body.item.version; + // we must first force install the system package to override package verification error on policy create + const installPromise = supertest + .post(`/api/fleet/epm/packages/system-${systemPkgVersion}`) + .set('kbn-xsrf', 'xxxx') + .send({ force: true }) + .expect(200); + + await Promise.all([ + installPromise, + kibanaServer.savedObjects.create({ + id: policyId, + type: PACKAGE_POLICY_SAVED_OBJECT_TYPE, + overwrite: true, + attributes: { + name: `system-1`, + package: { + name: 'system', + }, + }, + }), + ]); + + const { + body: { + item: { id: originalPolicyId }, + }, + } = await supertest + .post(`/api/fleet/agent_policies`) + .set('kbn-xsrf', 'xxxx') + .query({ + sys_monitoring: false, + }) + .send({ + name: 'original policy with package policy with space in name', + namespace: 'default', + }) + .expect(200); + + await supertest + .post(`/api/fleet/package_policies`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: 'Filetest with space in name', + description: '', + namespace: 'default', + policy_id: originalPolicyId, + enabled: true, + inputs: [], + package: { + name: 'filetest', + title: 'For File Tests', + version: '0.1.0', + }, + }) + .expect(200); + + const { + body: { + item: { id: copy1Id }, + }, + } = await supertest + .post(`/api/fleet/agent_policies/${originalPolicyId}/copy`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: 'copy 123', + description: 'Test', + }) + .expect(200); + + const { + body: { + item: { package_policies: packagePolicies }, + }, + } = await supertest.get(`/api/fleet/agent_policies/${copy1Id}`).expect(200); + + expect(packagePolicies[0].name).to.eql('Filetest with space in name (copy)'); + }); + it('should return a 404 with invalid source policy', async () => { await supertest .post(`/api/fleet/agent_policies/INVALID_POLICY_ID/copy`) diff --git a/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts b/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts index 29110f5807edf..fe875fe4e2565 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts @@ -62,7 +62,7 @@ export default function (providerContext: FtrProviderContext) { }); it('should return 200 and an array for upgrading a package', async function () { const { body }: { body: BulkInstallPackagesResponse } = await supertest - .post(`/api/fleet/epm/packages/_bulk`) + .post(`/api/fleet/epm/packages/_bulk?prerelease=true`) .set('kbn-xsrf', 'xxxx') .send({ packages: ['multiple_versions'] }) .expect(200); @@ -73,7 +73,7 @@ export default function (providerContext: FtrProviderContext) { }); it('should return an error for packages that do not exist', async function () { const { body }: { body: BulkInstallPackagesResponse } = await supertest - .post(`/api/fleet/epm/packages/_bulk`) + .post(`/api/fleet/epm/packages/_bulk?prerelease=true`) .set('kbn-xsrf', 'xxxx') .send({ packages: ['multiple_versions', 'blahblah'] }) .expect(200); @@ -88,7 +88,7 @@ export default function (providerContext: FtrProviderContext) { }); it('should upgrade multiple packages', async function () { const { body }: { body: BulkInstallPackagesResponse } = await supertest - .post(`/api/fleet/epm/packages/_bulk`) + .post(`/api/fleet/epm/packages/_bulk?prerelease=true`) .set('kbn-xsrf', 'xxxx') .send({ packages: ['multiple_versions', 'overrides'] }) .expect(200); @@ -110,7 +110,7 @@ export default function (providerContext: FtrProviderContext) { it('should return 200 and an array for upgrading a package', async function () { const { body }: { body: BulkInstallPackagesResponse } = await supertest - .post(`/api/fleet/epm/packages/_bulk`) + .post(`/api/fleet/epm/packages/_bulk?prerelease=true`) .set('kbn-xsrf', 'xxxx') .send({ packages: ['multiple_versions'] }) .expect(200); diff --git a/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts b/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts index 0ef5f648ab36d..8d7a6323d5f73 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts @@ -32,7 +32,7 @@ export default function (providerContext: FtrProviderContext) { // Use the custom log package to test the custom ingest pipeline before(async () => { const { body: getPackagesRes } = await supertest.get( - `/api/fleet/epm/packages?experimental=true` + `/api/fleet/epm/packages?prerelease=true` ); const logPackage = getPackagesRes.items.find((p: any) => p.name === 'log'); if (!logPackage) { diff --git a/x-pack/test/fleet_api_integration/apis/epm/delete.ts b/x-pack/test/fleet_api_integration/apis/epm/delete.ts index 076cc6bba4efc..9ec8b7318f6c9 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/delete.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/delete.ts @@ -34,6 +34,7 @@ export default function (providerContext: FtrProviderContext) { describe('delete and force delete scenarios', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + before(async () => { await installPackage(requiredPackage, pkgVersion); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts b/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts index e705aa1734cb0..5e677bd96d54a 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts @@ -43,7 +43,7 @@ export default function (providerContext: FtrProviderContext) { // Use the custom log package to test the fleet final pipeline before(async () => { const { body: getPackagesRes } = await supertest.get( - `/api/fleet/epm/packages?experimental=true` + `/api/fleet/epm/packages?prerelease=true` ); const logPackage = getPackagesRes.items.find((p: any) => p.name === 'log'); if (!logPackage) { diff --git a/x-pack/test/fleet_api_integration/apis/epm/get.ts b/x-pack/test/fleet_api_integration/apis/epm/get.ts index 280922b2e4a33..17f83b0b3c534 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/get.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/get.ts @@ -40,6 +40,7 @@ export default function (providerContext: FtrProviderContext) { describe('EPM - get', () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + it('returns package info from the registry if it was installed from the registry', async function () { // this will install through the registry by default await installPackage(testPkgName, testPkgVersion); @@ -149,7 +150,7 @@ export default function (providerContext: FtrProviderContext) { // not from the package registry. This is because they contain a field the registry // does not support const res = await supertest - .get(`/api/fleet/epm/packages/integration_to_input/0.9.1`) + .get(`/api/fleet/epm/packages/integration_to_input/0.9.1?prerelease=true`) .expect(200); const packageInfo = res.body.item; @@ -158,14 +159,16 @@ export default function (providerContext: FtrProviderContext) { }); describe('Pkg verification', () => { it('should return validation error for unverified input only pkg', async function () { - const res = await supertest.get(`/api/fleet/epm/packages/input_only/0.1.0`).expect(400); + const res = await supertest + .get(`/api/fleet/epm/packages/input_only/0.1.0?prerelease=true`) + .expect(400); const error = res.body; expect(error?.attributes?.type).to.equal('verification_failed'); }); it('should not return validation error for unverified input only pkg if ignoreUnverified is true', async function () { await supertest - .get(`/api/fleet/epm/packages/input_only/0.1.0?ignoreUnverified=true`) + .get(`/api/fleet/epm/packages/input_only/0.1.0?ignoreUnverified=true&prerelease=true`) .expect(200); }); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/index.js b/x-pack/test/fleet_api_integration/apis/epm/index.js index 137d7d59d8bfa..48af135f15ae2 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/index.js +++ b/x-pack/test/fleet_api_integration/apis/epm/index.js @@ -23,6 +23,7 @@ export default function loadTests({ loadTestFile }) { loadTestFile(require.resolve('./install_remove_kbn_assets_in_space')); loadTestFile(require.resolve('./install_remove_multiple')); loadTestFile(require.resolve('./install_update')); + loadTestFile(require.resolve('./install_tag_assets')); loadTestFile(require.resolve('./bulk_upgrade')); loadTestFile(require.resolve('./update_assets')); loadTestFile(require.resolve('./data_stream')); diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_by_upload.ts b/x-pack/test/fleet_api_integration/apis/epm/install_by_upload.ts index e4fd8f11141ae..d7c913fc8bc4b 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_by_upload.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_by_upload.ts @@ -60,6 +60,7 @@ export default function (providerContext: FtrProviderContext) { describe('installs packages from direct upload', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + afterEach(async () => { if (server) { // remove the packages just in case it being installed will affect other tests diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts b/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts index fba01e840cfd0..7649237f0ab4d 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts @@ -30,12 +30,15 @@ export default function (providerContext: FtrProviderContext) { }; const getPackageInfo = async (pkg: string, version: string) => { - return await supertest.get(`/api/fleet/epm/packages/${pkg}/${version}`).set('kbn-xsrf', 'xxxx'); + return await supertest + .get(`/api/fleet/epm/packages/${pkg}/${version}?prerelease=true`) + .set('kbn-xsrf', 'xxxx'); }; describe('package installation error handling and rollback', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + beforeEach(async () => { await kibanaServer.savedObjects.cleanStandardList(); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_overrides.ts b/x-pack/test/fleet_api_integration/apis/epm/install_overrides.ts index d33f9b8a922d9..7b691ca10b5a6 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_overrides.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_overrides.ts @@ -26,6 +26,7 @@ export default function (providerContext: FtrProviderContext) { describe('installs packages that include settings and mappings overrides', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + after(async () => { if (server.enabled) { // remove the package just in case it being installed will affect other tests @@ -122,6 +123,7 @@ export default function (providerContext: FtrProviderContext) { }, { meta: true } )); + // omit routings delete body.template.settings.index.routing; @@ -130,6 +132,7 @@ export default function (providerContext: FtrProviderContext) { settings: { index: { codec: 'best_compression', + default_pipeline: 'logs-overrides.test-0.1.0', lifecycle: { name: 'overridden by user', }, diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_prerelease.ts b/x-pack/test/fleet_api_integration/apis/epm/install_prerelease.ts index f375c9902317f..86e91d6707c5a 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_prerelease.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_prerelease.ts @@ -25,6 +25,7 @@ export default function (providerContext: FtrProviderContext) { describe('installs package that has a prerelease version', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + after(async () => { if (server.enabled) { // remove the package just in case it being installed will affect other tests diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_remove_kbn_assets_in_space.ts b/x-pack/test/fleet_api_integration/apis/epm/install_remove_kbn_assets_in_space.ts index 9e364f28f8b3e..08740ea5335b2 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_remove_kbn_assets_in_space.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_remove_kbn_assets_in_space.ts @@ -50,6 +50,7 @@ export default function (providerContext: FtrProviderContext) { describe('installs and uninstalls all assets (non default space)', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + before(async () => { await createSpace(testSpaceId); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_remove_multiple.ts b/x-pack/test/fleet_api_integration/apis/epm/install_remove_multiple.ts index 275a2abf744bc..48071d15436fd 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_remove_multiple.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_remove_multiple.ts @@ -62,6 +62,7 @@ export default function (providerContext: FtrProviderContext) { describe('installs and uninstalls multiple packages side effects', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + before(async () => { if (!server.enabled) return; await installPackages([ diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_tag_assets.ts b/x-pack/test/fleet_api_integration/apis/epm/install_tag_assets.ts new file mode 100644 index 0000000000000..aca56f5fce936 --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/epm/install_tag_assets.ts @@ -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 expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; +import { skipIfNoDockerRegistry } from '../../helpers'; +import { setupFleetAndAgents } from '../agents/services'; +const testSpaceId = 'fleet_test_space'; + +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; + const kibanaServer = getService('kibanaServer'); + const supertest = getService('supertest'); + const dockerServers = getService('dockerServers'); + const server = dockerServers.get('registry'); + const pkgName = 'only_dashboard'; + const pkgVersion = '0.1.0'; + + const uninstallPackage = async (pkg: string, version: string) => { + await supertest.delete(`/api/fleet/epm/packages/${pkg}/${version}`).set('kbn-xsrf', 'xxxx'); + }; + + const installPackageInSpace = async (pkg: string, version: string, spaceId: string) => { + await supertest + .post(`/s/${spaceId}/api/fleet/epm/packages/${pkg}/${version}`) + .set('kbn-xsrf', 'xxxx') + .send({ force: true }) + .expect(200); + }; + const createSpace = async (spaceId: string) => { + await supertest + .post(`/api/spaces/space`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: spaceId, + id: spaceId, + initials: 's', + color: '#D6BF57', + disabledFeatures: [], + imageUrl: '', + }) + .expect(200); + }; + + const getTag = async (id: string, space?: string) => + kibanaServer.savedObjects + .get({ + type: 'tag', + id, + ...(space && { space }), + }) + .catch(() => {}); + + const deleteTag = async (id: string) => + kibanaServer.savedObjects + .delete({ + type: 'tag', + id, + }) + .catch(() => {}); + + const deleteSpace = async (spaceId: string) => { + await supertest.delete(`/api/spaces/space/${spaceId}`).set('kbn-xsrf', 'xxxx').send(); + }; + describe('asset tagging', () => { + skipIfNoDockerRegistry(providerContext); + setupFleetAndAgents(providerContext); + + before(async () => { + await createSpace(testSpaceId); + }); + + after(async () => { + await deleteSpace(testSpaceId); + }); + describe('creates correct tags when installing a package in non default space after installing in default space', async () => { + before(async () => { + if (!server.enabled) return; + await installPackageInSpace('all_assets', pkgVersion, 'default'); + await installPackageInSpace(pkgName, pkgVersion, testSpaceId); + }); + after(async () => { + if (!server.enabled) return; + await uninstallPackage('all_assets', pkgVersion); + await uninstallPackage(pkgName, pkgVersion); + }); + + it('Should create managed tag saved objects', async () => { + const defaultTag = await getTag('fleet-managed-default'); + expect(defaultTag).not.equal(undefined); + + const spaceTag = await getTag('fleet-managed-fleet_test_space', testSpaceId); + expect(spaceTag).not.equal(undefined); + }); + it('Should create package tag saved objects', async () => { + const defaultTag = await getTag(`fleet-pkg-all_assets-default`); + expect(defaultTag).not.equal(undefined); + + const spaceTag = await getTag(`fleet-pkg-${pkgName}-fleet_test_space`, testSpaceId); + expect(spaceTag).not.equal(undefined); + }); + }); + + describe('Handles presence of legacy tags', async () => { + before(async () => { + if (!server.enabled) return; + + // first clean up any existing tag saved objects as they arent cleaned on uninstall + await deleteTag('fleet-managed-default'); + await deleteTag(`fleet-pkg-${pkgName}-default`); + + // now create the legacy tags + await kibanaServer.savedObjects.create({ + type: 'tag', + id: 'managed', + overwrite: false, + attributes: { + name: 'managed', + description: '', + color: '#FFFFFF', + }, + }); + await kibanaServer.savedObjects.create({ + type: 'tag', + id: pkgName, + overwrite: false, + attributes: { + name: pkgName, + description: '', + color: '#FFFFFF', + }, + }); + + await installPackageInSpace(pkgName, pkgVersion, 'default'); + }); + after(async () => { + if (!server.enabled) return; + await uninstallPackage(pkgName, pkgVersion); + await deleteTag('managed'); + await deleteTag('tag'); + }); + + it('Should not create space aware tag saved objects if legacy tags exist', async () => { + const managedTag = await getTag('fleet-managed-default'); + expect(managedTag).equal(undefined); + + const pkgTag = await getTag(`fleet-pkg-${pkgName}-default`); + expect(pkgTag).equal(undefined); + }); + }); + }); +} diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_update.ts b/x-pack/test/fleet_api_integration/apis/epm/install_update.ts index 669166b189789..c36efd6066b6e 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_update.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_update.ts @@ -26,6 +26,7 @@ export default function (providerContext: FtrProviderContext) { describe('installing and updating scenarios', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + after(async () => { await deletePackage('multiple_versions', '0.3.0'); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/list.ts b/x-pack/test/fleet_api_integration/apis/epm/list.ts index 51f003a7192d5..5727f7130f563 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/list.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/list.ts @@ -23,6 +23,7 @@ export default function (providerContext: FtrProviderContext) { describe('EPM - list', async function () { skipIfNoDockerRegistry(providerContext); + before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/package_install_complete.ts b/x-pack/test/fleet_api_integration/apis/epm/package_install_complete.ts index fdf90c636885d..f29e36daebdd2 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/package_install_complete.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/package_install_complete.ts @@ -26,6 +26,7 @@ export default function (providerContext: FtrProviderContext) { describe('setup checks packages completed install', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + describe('package install', async () => { before(async () => { if (!server.enabled) return; diff --git a/x-pack/test/fleet_api_integration/apis/epm/setup.ts b/x-pack/test/fleet_api_integration/apis/epm/setup.ts index 7720d915f6f13..f930166f4a74f 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/setup.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/setup.ts @@ -21,6 +21,7 @@ export default function (providerContext: FtrProviderContext) { describe('setup api', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + // FLAKY: https://github.com/elastic/kibana/issues/118479 describe.skip('setup performs upgrades', async () => { const oldEndpointVersion = '0.13.0'; diff --git a/x-pack/test/fleet_api_integration/apis/epm/update_assets.ts b/x-pack/test/fleet_api_integration/apis/epm/update_assets.ts index 9d01797db5b91..c8bde9dd076f8 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/update_assets.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/update_assets.ts @@ -217,6 +217,7 @@ export default function (providerContext: FtrProviderContext) { expect(resPackage.body.component_templates[0].component_template.template.settings).eql({ index: { codec: 'best_compression', + default_pipeline: 'logs-all_assets.test_logs-0.2.0', lifecycle: { name: 'reference2', }, diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.1.0/manifest.yml index 3c11b5103fbeb..fa6e65f497068 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.1.0/manifest.yml @@ -7,6 +7,8 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.2.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.2.0/manifest.yml index 70da51a14bce8..33c7c020b4c49 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.2.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.2.0/manifest.yml @@ -7,6 +7,8 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/datastreams/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/datastreams/0.1.0/manifest.yml index 28979cca0771b..9cddc5f1f863e 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/datastreams/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/datastreams/0.1.0/manifest.yml @@ -7,6 +7,8 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/datastreams/0.2.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/datastreams/0.2.0/manifest.yml index b389a86702fa8..55c50f340d110 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/datastreams/0.2.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/datastreams/0.2.0/manifest.yml @@ -7,6 +7,8 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/deprecated/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/deprecated/0.1.0/manifest.yml index 755c49e1af388..da357e14a0d45 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/deprecated/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/deprecated/0.1.0/manifest.yml @@ -7,6 +7,8 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet conditions: # Version number is not compatible with current version diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/error_handling/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/error_handling/0.1.0/manifest.yml index 312cd2874804c..4b5afcac953eb 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/error_handling/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/error_handling/0.1.0/manifest.yml @@ -7,6 +7,8 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/error_handling/0.2.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/error_handling/0.2.0/manifest.yml index c473ce29b87d5..d45489caee7b4 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/error_handling/0.2.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/error_handling/0.2.0/manifest.yml @@ -7,7 +7,9 @@ categories: [] release: beta type: integration license: basic - +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/experimental/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/experimental/0.1.0/manifest.yml index 62f605c5828f8..c626ae209c490 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/experimental/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/experimental/0.1.0/manifest.yml @@ -7,6 +7,8 @@ categories: [] release: experimental type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/experimental2/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/experimental2/0.1.0/manifest.yml index 766835dbde037..c72242b1bc7ce 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/experimental2/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/experimental2/0.1.0/manifest.yml @@ -7,6 +7,8 @@ categories: [] release: experimental type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/filetest/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/filetest/0.1.0/manifest.yml index c4fb3f967913d..f5b8ba129cb61 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/filetest/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/filetest/0.1.0/manifest.yml @@ -10,6 +10,8 @@ release: beta # The default type is integration and will be set if empty. type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.1.0/manifest.yml index f4b6eccbda957..16cb91526651f 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.1.0/manifest.yml @@ -7,7 +7,9 @@ categories: [] release: beta type: integration license: basic - +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.2.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.2.0/manifest.yml index be7c93484d987..d3f7f8b5f88d4 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.2.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.2.0/manifest.yml @@ -7,7 +7,9 @@ categories: [] release: beta type: integration license: basic - +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.3.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.3.0/manifest.yml index 630788b00fca7..15411c855cd09 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.3.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/multiple_versions/0.3.0/manifest.yml @@ -7,7 +7,9 @@ categories: [] release: beta type: integration license: basic - +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/only_dashboard/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/only_dashboard/0.1.0/manifest.yml index 129ee4e2c133c..48b7db29c8296 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/only_dashboard/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/only_dashboard/0.1.0/manifest.yml @@ -7,6 +7,8 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/overrides/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/overrides/0.1.0/manifest.yml index ba9fd0fada006..2189a9c30754c 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/overrides/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/overrides/0.1.0/manifest.yml @@ -7,6 +7,8 @@ categories: ['security'] release: beta type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.1.0/data_stream/test_stream/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.1.0/data_stream/test_stream/manifest.yml index 461d4fa941708..476a62174f644 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.1.0/data_stream/test_stream/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.1.0/data_stream/test_stream/manifest.yml @@ -2,3 +2,4 @@ title: Test stream type: logs streams: - input: test_input + title: test input diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.1.0/manifest.yml index 7856c6eb9df34..aa64596bba6a0 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.1.0/manifest.yml @@ -7,6 +7,8 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.0-add-non-required-test-var/data_stream/test_stream/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.0-add-non-required-test-var/data_stream/test_stream/manifest.yml index 3500fa8888ceb..5ad939f2c71be 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.0-add-non-required-test-var/data_stream/test_stream/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.0-add-non-required-test-var/data_stream/test_stream/manifest.yml @@ -2,6 +2,7 @@ title: Test stream type: logs streams: - input: test_input + title: test input vars: - name: test_var type: text diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.0-add-non-required-test-var/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.0-add-non-required-test-var/manifest.yml index 58688c78519f6..2d5dcb7f8d6d4 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.0-add-non-required-test-var/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.0-add-non-required-test-var/manifest.yml @@ -7,6 +7,9 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.5-non-breaking-change/data_stream/test_stream/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.5-non-breaking-change/data_stream/test_stream/manifest.yml index 95b72f0122aec..7ef056ac73595 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.5-non-breaking-change/data_stream/test_stream/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.5-non-breaking-change/data_stream/test_stream/manifest.yml @@ -2,6 +2,7 @@ title: Test stream type: logs streams: - input: test_input + title: test input vars: - name: test_var type: text diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.5-non-breaking-change/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.5-non-breaking-change/manifest.yml index 2105ee451ffae..04d03dd2b5b8d 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.5-non-breaking-change/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.2.5-non-breaking-change/manifest.yml @@ -7,6 +7,9 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.3.0-remove-test-var/data_stream/test_stream/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.3.0-remove-test-var/data_stream/test_stream/manifest.yml index 47c2fe0f32d33..476a62174f644 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.3.0-remove-test-var/data_stream/test_stream/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.3.0-remove-test-var/data_stream/test_stream/manifest.yml @@ -2,10 +2,4 @@ title: Test stream type: logs streams: - input: test_input - # vars: - # - name: test_var - # type: text - # title: Test Var - # required: true - # show_user: true - # default: Test Value + title: test input diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.3.0-remove-test-var/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.3.0-remove-test-var/manifest.yml index 5f3f493869273..e58b0406d75ab 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.3.0-remove-test-var/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.3.0-remove-test-var/manifest.yml @@ -7,6 +7,9 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.4.0-add-test-var-as-bool/data_stream/test_stream/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.4.0-add-test-var-as-bool/data_stream/test_stream/manifest.yml index f96486e1a1932..403a084a4e2d4 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.4.0-add-test-var-as-bool/data_stream/test_stream/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.4.0-add-test-var-as-bool/data_stream/test_stream/manifest.yml @@ -2,6 +2,7 @@ title: Test stream type: logs streams: - input: test_input + title: test input vars: - name: test_var type: bool diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.4.0-add-test-var-as-bool/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.4.0-add-test-var-as-bool/manifest.yml index 8cd629c98d3eb..b50e3d1378722 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.4.0-add-test-var-as-bool/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.4.0-add-test-var-as-bool/manifest.yml @@ -7,6 +7,9 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/data_stream/test_stream_new/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/data_stream/test_stream_new/manifest.yml index 42b5d8641c6cd..ec4b71337738a 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/data_stream/test_stream_new/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/data_stream/test_stream_new/manifest.yml @@ -2,6 +2,7 @@ title: Test stream type: logs streams: - input: test_input_new + title: test input new vars: - name: test_var_new type: text diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/data_stream/test_stream_new_2/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/data_stream/test_stream_new_2/manifest.yml index af942e7b6413a..df9bfa4e58ac6 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/data_stream/test_stream_new_2/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/data_stream/test_stream_new_2/manifest.yml @@ -2,6 +2,7 @@ title: Test stream type: logs streams: - input: test_input_new_2 + title: test input new 2 vars: - name: test_input_new_2_var_1 type: text diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/manifest.yml index 6c26bb545424d..d1967d77c6a2e 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.5.0-restructure-inputs/manifest.yml @@ -7,6 +7,9 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/data_stream/test_stream_new/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/data_stream/test_stream_new/manifest.yml index 42b5d8641c6cd..ec4b71337738a 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/data_stream/test_stream_new/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/data_stream/test_stream_new/manifest.yml @@ -2,6 +2,7 @@ title: Test stream type: logs streams: - input: test_input_new + title: test input new vars: - name: test_var_new type: text diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/data_stream/test_stream_new_2/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/data_stream/test_stream_new_2/manifest.yml index af942e7b6413a..df9bfa4e58ac6 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/data_stream/test_stream_new_2/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/data_stream/test_stream_new_2/manifest.yml @@ -2,6 +2,7 @@ title: Test stream type: logs streams: - input: test_input_new_2 + title: test input new 2 vars: - name: test_input_new_2_var_1 type: text diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/manifest.yml index 82c9d7059e2a6..a9b2a39028e3f 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.6.0-restructure-policy-templates/manifest.yml @@ -7,6 +7,9 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.7.0-add-stream-with-no-vars/data_stream/test_stream/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.7.0-add-stream-with-no-vars/data_stream/test_stream/manifest.yml index 461d4fa941708..476a62174f644 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.7.0-add-stream-with-no-vars/data_stream/test_stream/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.7.0-add-stream-with-no-vars/data_stream/test_stream/manifest.yml @@ -2,3 +2,4 @@ title: Test stream type: logs streams: - input: test_input + title: test input diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.7.0-add-stream-with-no-vars/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.7.0-add-stream-with-no-vars/manifest.yml index 346ea4d2bcfad..9ad64c2d8e54b 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.7.0-add-stream-with-no-vars/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.7.0-add-stream-with-no-vars/manifest.yml @@ -7,6 +7,9 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.8.0-add-vars-to-stream-with-no-vars/data_stream/test_stream/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.8.0-add-vars-to-stream-with-no-vars/data_stream/test_stream/manifest.yml index 8b8ea1987ccc3..15b6496c50d76 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.8.0-add-vars-to-stream-with-no-vars/data_stream/test_stream/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.8.0-add-vars-to-stream-with-no-vars/data_stream/test_stream/manifest.yml @@ -2,6 +2,7 @@ title: Test stream type: logs streams: - input: test_input + title: test input vars: - name: test_var_new type: text diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.8.0-add-vars-to-stream-with-no-vars/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.8.0-add-vars-to-stream-with-no-vars/manifest.yml index bd61453fdaac8..2ea0bfae993a1 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.8.0-add-vars-to-stream-with-no-vars/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/package_policy_upgrade/0.8.0-add-vars-to-stream-with-no-vars/manifest.yml @@ -7,6 +7,9 @@ categories: [] release: beta type: integration license: basic +owner: + github: elastic/fleet + requirement: elasticsearch: versions: '>7.7.0' diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/prerelease/0.1.0-dev.0+abc/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/prerelease/0.1.0-dev.0+abc/manifest.yml index a0adb184cfc59..a01ab8e438d55 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/prerelease/0.1.0-dev.0+abc/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/prerelease/0.1.0-dev.0+abc/manifest.yml @@ -7,6 +7,8 @@ categories: ['security'] release: beta type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/with_required_variables/0.1.0/data_stream/log/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/with_required_variables/0.1.0/data_stream/log/manifest.yml index 0b1ae9c6cb995..a4473a8b3fa2b 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/with_required_variables/0.1.0/data_stream/log/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/with_required_variables/0.1.0/data_stream/log/manifest.yml @@ -2,6 +2,7 @@ title: Test stream type: logs streams: - input: test_input + title: test input vars: - name: test_var_required type: string diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/with_required_variables/0.1.0/manifest.yml b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/with_required_variables/0.1.0/manifest.yml index 472888818e717..cb9799e4d04ef 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/with_required_variables/0.1.0/manifest.yml +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/with_required_variables/0.1.0/manifest.yml @@ -10,6 +10,8 @@ release: beta # The default type is integration and will be set if empty. type: integration license: basic +owner: + github: elastic/fleet requirement: elasticsearch: diff --git a/x-pack/test/fleet_api_integration/apis/fleet_setup.ts b/x-pack/test/fleet_api_integration/apis/fleet_setup.ts index e1e1f90f57eb6..3f76f4594592f 100644 --- a/x-pack/test/fleet_api_integration/apis/fleet_setup.ts +++ b/x-pack/test/fleet_api_integration/apis/fleet_setup.ts @@ -69,7 +69,7 @@ export default function (providerContext: FtrProviderContext) { await supertest.post(`/api/fleet/setup`).set('kbn-xsrf', 'xxxx').expect(200); const { body: apiResponse } = await supertest - .get(`/api/fleet/epm/packages?experimental=true`) + .get(`/api/fleet/epm/packages?prerelease=true`) .expect(200); const installedPackages = apiResponse.response .filter((p: any) => p.status === 'installed') diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/delete.ts b/x-pack/test/fleet_api_integration/apis/package_policy/delete.ts index 383a92fa164e8..b15b84dcfbee9 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/delete.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/delete.ts @@ -15,6 +15,7 @@ export default function (providerContext: FtrProviderContext) { describe('Package Policy - delete', () => { skipIfNoDockerRegistry(providerContext); + describe('Delete one', () => { let agentPolicy: any; let packagePolicy: any; diff --git a/x-pack/test/fleet_api_integration/helpers.ts b/x-pack/test/fleet_api_integration/helpers.ts index d3b623d0426f3..c21a9e01b3309 100644 --- a/x-pack/test/fleet_api_integration/helpers.ts +++ b/x-pack/test/fleet_api_integration/helpers.ts @@ -89,3 +89,19 @@ export async function generateAgent( refresh: 'wait_for', }); } + +export function setPrereleaseSetting(supertest: any) { + before(async () => { + await supertest + .put('/api/fleet/settings') + .set('kbn-xsrf', 'xxxx') + .send({ prerelease_integrations_enabled: true }); + }); + + after(async () => { + await supertest + .put('/api/fleet/settings') + .set('kbn-xsrf', 'xxxx') + .send({ prerelease_integrations_enabled: false }); + }); +} diff --git a/x-pack/test/functional/apps/infra/tour.ts b/x-pack/test/functional/apps/infra/tour.ts index 81ca07eef4c05..2f9dfa314c168 100644 --- a/x-pack/test/functional/apps/infra/tour.ts +++ b/x-pack/test/functional/apps/infra/tour.ts @@ -15,6 +15,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const pageObjects = getPageObjects(['common', 'infraHome']); const find = getService('find'); const supertest = getService('supertest'); + const deployment = getService('deployment'); const setInitialTourState = async (activeStep?: number) => { await browser.setLocalStorageItem(observTourStepStorageKey, String(activeStep || 1)); @@ -23,8 +24,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { describe('Onboarding Observability tour', function () { this.tags('includeFirefox'); - + let isCloud: boolean; before(async () => { + isCloud = await deployment.isCloud(); await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs'); await pageObjects.common.navigateToApp('observability'); // Need to increase the browser height so the tour steps fit to screen @@ -37,131 +39,134 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); describe('Tour enabled', () => { - beforeEach(async () => { - // Activate the Observability guide, step 3, in order to trigger the EuiTour - await supertest - .put(`/api/guided_onboarding/state`) - .set('kbn-xsrf', 'true') - .send({ - status: 'in_progress', - guideId: 'observability', - isActive: true, - steps: [ - { - id: 'add_data', - status: 'complete', - }, - { - id: 'view_dashboard', - status: 'complete', - }, - { - id: 'tour_observability', - status: 'in_progress', - }, - ], - }) - .expect(200); - }); - - it('can complete tour', async () => { - await setInitialTourState(); - - // Step 1: Overview - await pageObjects.infraHome.waitForTourStep('overviewStep'); - await pageObjects.infraHome.clickTourNextButton(); - await pageObjects.infraHome.ensureTourStepIsClosed('overviewStep'); - - // Step 2: Streams - await pageObjects.infraHome.waitForTourStep('streamStep'); - await pageObjects.infraHome.clickTourNextButton(); - await pageObjects.infraHome.ensureTourStepIsClosed('streamStep'); - - // Step 3: Metrics explorer - await pageObjects.infraHome.waitForTourStep('metricsExplorerStep'); - await pageObjects.infraHome.clickTourNextButton(); - await pageObjects.infraHome.ensureTourStepIsClosed('metricsExplorerStep'); - - // Step 4: Services - await pageObjects.infraHome.waitForTourStep('servicesStep'); - await pageObjects.infraHome.clickTourNextButton(); - await pageObjects.infraHome.ensureTourStepIsClosed('servicesStep'); - - // Step 5: Alerts - await pageObjects.infraHome.waitForTourStep('alertStep'); - await pageObjects.infraHome.clickTourNextButton(); - await pageObjects.infraHome.ensureTourStepIsClosed('alertStep'); - - // Step 6: Guided setup - await pageObjects.infraHome.waitForTourStep('guidedSetupStep'); - await pageObjects.infraHome.clickTourEndButton(); - await pageObjects.infraHome.ensureTourStepIsClosed('guidedSetupStep'); - }); - - it('can skip tour', async () => { - await setInitialTourState(); - - await pageObjects.infraHome.waitForTourStep('overviewStep'); - await pageObjects.infraHome.clickTourSkipButton(); - - // Verify current step ("Overview") is not displayed - await pageObjects.infraHome.ensureTourStepIsClosed('overviewStep'); - // Verify next step ("Streams") is not displayed - await pageObjects.infraHome.ensureTourStepIsClosed('streamStep'); - - await browser.refresh(); - - // Verify current step ("Overview") is not displayed after browser refresh, - // i.e., localStorage has been updated to not show the tour again - await pageObjects.infraHome.ensureTourStepIsClosed('overviewStep'); - }); - - it('can start mid-tour', async () => { - await setInitialTourState(5); - - // Step 5: Alerts - await pageObjects.infraHome.waitForTourStep('alertStep'); - await pageObjects.infraHome.clickTourNextButton(); - await pageObjects.infraHome.ensureTourStepIsClosed('alertStep'); - - // Step 6: Guided setup - await pageObjects.infraHome.waitForTourStep('guidedSetupStep'); - await pageObjects.infraHome.clickTourEndButton(); - await pageObjects.infraHome.ensureTourStepIsClosed('guidedSetupStep'); - }); - - it('navigates the user to the guided setup step', async () => { - // For brevity, starting the tour at step 5 - await setInitialTourState(5); - - await pageObjects.infraHome.waitForTourStep('alertStep'); - - // Click on Alerts link - await (await find.byCssSelector('[data-nav-id="alerts"]')).click(); - - // Verify user correctly navigated to the Alerts page - const alertsPageUrl = await browser.getCurrentUrl(); - expect(alertsPageUrl).to.contain('/app/observability/alerts'); - - // Verify Step 5 persists on Alerts page, then continue with tour - await pageObjects.infraHome.waitForTourStep('alertStep'); - await pageObjects.infraHome.clickTourNextButton(); - - // Verify user navigated back to the overview page, and guided setup step renders (Step 6) - await pageObjects.infraHome.waitForTourStep('guidedSetupStep'); - const overviewPageUrl = await browser.getCurrentUrl(); - expect(overviewPageUrl).to.contain('/app/observability/overview'); - }); - - it('ends the tour if the user clicks on the guided setup button', async () => { - // For brevity, starting the tour at step 5, "Alerts" - await setInitialTourState(5); - - await pageObjects.infraHome.clickTourNextButton(); - await pageObjects.infraHome.waitForTourStep('guidedSetupStep'); - await pageObjects.infraHome.clickGuidedSetupButton(); - await pageObjects.infraHome.ensureTourStepIsClosed('guidedSetupStep'); - }); + // only run these tests on Cloud + if (isCloud) { + beforeEach(async () => { + // Activate the Observability guide, step 3, in order to trigger the EuiTour + await supertest + .put(`/api/guided_onboarding/state`) + .set('kbn-xsrf', 'true') + .send({ + status: 'in_progress', + guideId: 'observability', + isActive: true, + steps: [ + { + id: 'add_data', + status: 'complete', + }, + { + id: 'view_dashboard', + status: 'complete', + }, + { + id: 'tour_observability', + status: 'in_progress', + }, + ], + }) + .expect(200); + }); + + it('can complete tour', async () => { + await setInitialTourState(); + + // Step 1: Overview + await pageObjects.infraHome.waitForTourStep('overviewStep'); + await pageObjects.infraHome.clickTourNextButton(); + await pageObjects.infraHome.ensureTourStepIsClosed('overviewStep'); + + // Step 2: Streams + await pageObjects.infraHome.waitForTourStep('streamStep'); + await pageObjects.infraHome.clickTourNextButton(); + await pageObjects.infraHome.ensureTourStepIsClosed('streamStep'); + + // Step 3: Metrics explorer + await pageObjects.infraHome.waitForTourStep('metricsExplorerStep'); + await pageObjects.infraHome.clickTourNextButton(); + await pageObjects.infraHome.ensureTourStepIsClosed('metricsExplorerStep'); + + // Step 4: Services + await pageObjects.infraHome.waitForTourStep('servicesStep'); + await pageObjects.infraHome.clickTourNextButton(); + await pageObjects.infraHome.ensureTourStepIsClosed('servicesStep'); + + // Step 5: Alerts + await pageObjects.infraHome.waitForTourStep('alertStep'); + await pageObjects.infraHome.clickTourNextButton(); + await pageObjects.infraHome.ensureTourStepIsClosed('alertStep'); + + // Step 6: Guided setup + await pageObjects.infraHome.waitForTourStep('guidedSetupStep'); + await pageObjects.infraHome.clickTourEndButton(); + await pageObjects.infraHome.ensureTourStepIsClosed('guidedSetupStep'); + }); + + it('can skip tour', async () => { + await setInitialTourState(); + + await pageObjects.infraHome.waitForTourStep('overviewStep'); + await pageObjects.infraHome.clickTourSkipButton(); + + // Verify current step ("Overview") is not displayed + await pageObjects.infraHome.ensureTourStepIsClosed('overviewStep'); + // Verify next step ("Streams") is not displayed + await pageObjects.infraHome.ensureTourStepIsClosed('streamStep'); + + await browser.refresh(); + + // Verify current step ("Overview") is not displayed after browser refresh, + // i.e., localStorage has been updated to not show the tour again + await pageObjects.infraHome.ensureTourStepIsClosed('overviewStep'); + }); + + it('can start mid-tour', async () => { + await setInitialTourState(5); + + // Step 5: Alerts + await pageObjects.infraHome.waitForTourStep('alertStep'); + await pageObjects.infraHome.clickTourNextButton(); + await pageObjects.infraHome.ensureTourStepIsClosed('alertStep'); + + // Step 6: Guided setup + await pageObjects.infraHome.waitForTourStep('guidedSetupStep'); + await pageObjects.infraHome.clickTourEndButton(); + await pageObjects.infraHome.ensureTourStepIsClosed('guidedSetupStep'); + }); + + it('navigates the user to the guided setup step', async () => { + // For brevity, starting the tour at step 5 + await setInitialTourState(5); + + await pageObjects.infraHome.waitForTourStep('alertStep'); + + // Click on Alerts link + await (await find.byCssSelector('[data-nav-id="alerts"]')).click(); + + // Verify user correctly navigated to the Alerts page + const alertsPageUrl = await browser.getCurrentUrl(); + expect(alertsPageUrl).to.contain('/app/observability/alerts'); + + // Verify Step 5 persists on Alerts page, then continue with tour + await pageObjects.infraHome.waitForTourStep('alertStep'); + await pageObjects.infraHome.clickTourNextButton(); + + // Verify user navigated back to the overview page, and guided setup step renders (Step 6) + await pageObjects.infraHome.waitForTourStep('guidedSetupStep'); + const overviewPageUrl = await browser.getCurrentUrl(); + expect(overviewPageUrl).to.contain('/app/observability/overview'); + }); + + it('ends the tour if the user clicks on the guided setup button', async () => { + // For brevity, starting the tour at step 5, "Alerts" + await setInitialTourState(5); + + await pageObjects.infraHome.clickTourNextButton(); + await pageObjects.infraHome.waitForTourStep('guidedSetupStep'); + await pageObjects.infraHome.clickGuidedSetupButton(); + await pageObjects.infraHome.ensureTourStepIsClosed('guidedSetupStep'); + }); + } }); }); }; diff --git a/x-pack/test/functional/apps/lens/group1/fields_list.ts b/x-pack/test/functional/apps/lens/group1/fields_list.ts new file mode 100644 index 0000000000000..3d571483bf9ac --- /dev/null +++ b/x-pack/test/functional/apps/lens/group1/fields_list.ts @@ -0,0 +1,233 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 ({ getService, getPageObjects }: FtrProviderContext) { + const PageObjects = getPageObjects(['visualize', 'lens', 'common', 'header']); + const find = getService('find'); + const log = getService('log'); + const testSubjects = getService('testSubjects'); + const filterBar = getService('filterBar'); + const fieldEditor = getService('fieldEditor'); + const retry = getService('retry'); + + describe('lens fields list tests', () => { + for (const datasourceType of ['form-based', 'ad-hoc', 'ad-hoc-no-timefield']) { + describe(`${datasourceType} datasource`, () => { + before(async () => { + await PageObjects.visualize.navigateToNewVisualization(); + await PageObjects.visualize.clickVisType('lens'); + + if (datasourceType !== 'form-based') { + await PageObjects.lens.createAdHocDataView( + '*stash*', + datasourceType !== 'ad-hoc-no-timefield' + ); + retry.try(async () => { + const selectedPattern = await PageObjects.lens.getDataPanelIndexPattern(); + expect(selectedPattern).to.eql('*stash*'); + }); + } + + if (datasourceType !== 'ad-hoc-no-timefield') { + await PageObjects.lens.goToTimeRange(); + } + + await retry.try(async () => { + await PageObjects.lens.clickAddField(); + await fieldEditor.setName('runtime_string'); + await fieldEditor.enableValue(); + await fieldEditor.typeScript("emit('abc')"); + await fieldEditor.save(); + await PageObjects.header.waitUntilLoadingHasFinished(); + }); + }); + + it('should show all fields as available', async () => { + expect( + await (await testSubjects.find('lnsIndexPatternAvailableFields-count')).getVisibleText() + ).to.eql(53); + }); + + it('should show a histogram and top values popover for numeric field', async () => { + const [fieldId] = await PageObjects.lens.findFieldIdsByType('number'); + await log.debug(`Opening field stats for ${fieldId}`); + await testSubjects.click(fieldId); + // check for popover + await testSubjects.exists('lnsFieldListPanel-title'); + // check for top values chart + await testSubjects.existOrFail('lnsFieldListPanel-topValues'); + const topValuesRows = await testSubjects.findAll('lnsFieldListPanel-topValues-bucket'); + expect(topValuesRows.length).to.eql(11); + // check for the Other entry + expect(await topValuesRows[10].getVisibleText()).to.eql('Other\n96.7%'); + // switch to date histogram + await testSubjects.click('lnsFieldListPanel-buttonGroup-distributionButton'); + // check for date histogram chart + expect( + await find.existsByCssSelector( + '[data-test-subj="lnsFieldListPanelFieldContent"] .echChart' + ) + ).to.eql(true); + }); + + it('should show a top values popover for a keyword field', async () => { + const [fieldId] = await PageObjects.lens.findFieldIdsByType('string'); + await log.debug(`Opening field stats for ${fieldId}`); + await testSubjects.click(fieldId); + // check for popover + await testSubjects.exists('lnsFieldListPanel-title'); + // check for top values chart + await testSubjects.existOrFail('lnsFieldListPanel-topValues'); + const topValuesRows = await testSubjects.findAll('lnsFieldListPanel-topValues-bucket'); + expect(topValuesRows.length).to.eql(11); + // check for the Other entry + expect(await topValuesRows[10].getVisibleText()).to.eql('Other\n99.9%'); + // check no date histogram + expect( + await find.existsByCssSelector( + '[data-test-subj="lnsFieldListPanelFieldContent"] .echChart' + ) + ).to.eql(false); + }); + + it('should show a date histogram popover for a date field', async () => { + const [fieldId] = await PageObjects.lens.findFieldIdsByType('date'); + await log.debug(`Opening field stats for ${fieldId}`); + await testSubjects.click(fieldId); + // check for popover + await testSubjects.exists('lnsFieldListPanel-title'); + // check for date histogram chart + expect( + await find.existsByCssSelector( + '[data-test-subj="lnsFieldListPanelFieldContent"] .echChart' + ) + ).to.eql(true); + // check no top values chart + await testSubjects.missingOrFail('lnsFieldListPanel-buttonGroup-topValuesButton'); + }); + + it('should show a placeholder message about geo points field', async () => { + const [fieldId] = await PageObjects.lens.findFieldIdsByType('geo_point'); + await log.debug(`Opening field stats for ${fieldId}`); + await testSubjects.click(fieldId); + const message = await testSubjects.getVisibleText('lnsFieldListPanel-missingFieldStats'); + expect(message).to.eql('Analysis is not available for this field.'); + }); + + it('should show stats for a numeric runtime field', async () => { + await PageObjects.lens.searchField('runtime'); + await PageObjects.lens.waitForField('runtime_number'); + const [fieldId] = await PageObjects.lens.findFieldIdsByType('number'); + await log.debug(`Opening field stats for ${fieldId}`); + await testSubjects.click(fieldId); + // check for popover + await testSubjects.exists('lnsFieldListPanel-title'); + // check for top values chart + await testSubjects.existOrFail('lnsFieldListPanel-topValues'); + // check values + const topValuesRows = await testSubjects.findAll('lnsFieldListPanel-topValues-bucket'); + expect(topValuesRows.length).to.eql(11); + // check for the Other entry + expect(await topValuesRows[10].getVisibleText()).to.eql('Other\n96.7%'); + // switch to date histogram + await testSubjects.click('lnsFieldListPanel-buttonGroup-distributionButton'); + // check for date histogram chart + expect( + await find.existsByCssSelector( + '[data-test-subj="lnsFieldListPanelFieldContent"] .echChart' + ) + ).to.eql(true); + }); + + it('should show stats for a keyword runtime field', async () => { + await PageObjects.lens.searchField('runtime'); + await PageObjects.lens.waitForField('runtime_string'); + const [fieldId] = await PageObjects.lens.findFieldIdsByType('string'); + await log.debug(`Opening field stats for ${fieldId}`); + await testSubjects.click(fieldId); + // check for popover + await testSubjects.exists('lnsFieldListPanel-title'); + // check for top values chart + await testSubjects.existOrFail('lnsFieldListPanel-topValues'); + // check no date histogram + expect( + await find.existsByCssSelector( + '[data-test-subj="lnsFieldListPanelFieldContent"] .echChart' + ) + ).to.eql(false); + await PageObjects.lens.searchField(''); + }); + + it('should change popover content if user defines a filter that affects field values', async () => { + // check the current records count for stats + const [fieldId] = await PageObjects.lens.findFieldIdsByType('string'); + await log.debug(`Opening field stats for ${fieldId}`); + await testSubjects.click(fieldId); + const valuesCount = parseInt( + (await testSubjects.getVisibleText('lnsFieldListPanel-statsFooter')) + .replaceAll(/(Calculated from | records\.)/g, '') + .replace(',', ''), + 10 + ); + // define a filter + await filterBar.addFilter('geo.src', 'is', 'CN'); + await retry.waitFor('Wait for the filter to take effect', async () => { + await testSubjects.click(fieldId); + // check for top values chart has changed compared to the previous test + const newValuesCount = parseInt( + (await testSubjects.getVisibleText('lnsFieldListPanel-statsFooter')) + .replaceAll(/(Calculated from | records\.)/g, '') + .replace(',', ''), + 10 + ); + return newValuesCount < valuesCount; + }); + }); + + // One Fields cap's limitation is to not know when an index has no fields based on filters + it('should detect fields have no data in popup if filter excludes them', async () => { + await filterBar.removeAllFilters(); + await filterBar.addFilter('bytes', 'is', '-1'); + // check via popup fields have no data + const [fieldId] = await PageObjects.lens.findFieldIdsByType('string'); + await log.debug(`Opening field stats for ${fieldId}`); + await retry.try(async () => { + await testSubjects.click(fieldId); + expect(await testSubjects.find('lnsFieldListPanel-missingFieldStats')).to.be.ok(); + // close the popover + await testSubjects.click(fieldId); + }); + }); + + if (datasourceType !== 'ad-hoc-no-timefield') { + it('should move some fields as empty when the time range excludes them', async () => { + // remove the filter + await filterBar.removeAllFilters(); + // tweak the time range to 17 Sept 2015 to 18 Sept 2015 + await PageObjects.lens.goToTimeRange( + 'Sep 17, 2015 @ 06:31:44.000', + 'Sep 18, 2015 @ 06:31:44.000' + ); + // check all fields are empty now + expect( + await (await testSubjects.find('lnsIndexPatternEmptyFields-count')).getVisibleText() + ).to.eql(52); + // check avaialble count is 0 + expect( + await ( + await testSubjects.find('lnsIndexPatternAvailableFields-count') + ).getVisibleText() + ).to.eql(1); + }); + } + }); + } + }); +} diff --git a/x-pack/test/functional/apps/lens/group1/index.ts b/x-pack/test/functional/apps/lens/group1/index.ts index 47f08a59e7341..302289319adbf 100644 --- a/x-pack/test/functional/apps/lens/group1/index.ts +++ b/x-pack/test/functional/apps/lens/group1/index.ts @@ -79,6 +79,7 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext loadTestFile(require.resolve('./table_dashboard')); loadTestFile(require.resolve('./table')); loadTestFile(require.resolve('./text_based_languages')); + loadTestFile(require.resolve('./fields_list')); loadTestFile(require.resolve('./layer_actions')); } }); diff --git a/x-pack/test/functional/apps/lens/group2/tsdb.ts b/x-pack/test/functional/apps/lens/group2/tsdb.ts index d19ab9d19db7d..debdd2cf03160 100644 --- a/x-pack/test/functional/apps/lens/group2/tsdb.ts +++ b/x-pack/test/functional/apps/lens/group2/tsdb.ts @@ -9,10 +9,8 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const queryBar = getService('queryBar'); const PageObjects = getPageObjects(['common', 'timePicker', 'lens', 'dashboard']); const testSubjects = getService('testSubjects'); - const retry = getService('retry'); const es = getService('es'); const log = getService('log'); const indexPatterns = getService('indexPatterns'); @@ -130,27 +128,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Median of kubernetes.container.memory.available.bytes uses a function that is unsupported by rolled up data. Select a different function or change the time range.' ); }); - it('still shows other warnings as toast', async () => { - await es.indices.delete({ index: [testRollupIndex] }); - // index a document which will produce a shard failure because a string field doesn't support median - await es.create({ - id: '1', - index: testRollupIndex, - document: { - 'kubernetes.container.memory.available.bytes': 'fsdfdsf', - '@timestamp': '2022-06-20', - }, - wait_for_active_shards: 1, - }); - await retry.try(async () => { - await queryBar.clickQuerySubmitButton(); - expect( - await (await testSubjects.find('euiToastHeader__title', 1000)).getVisibleText() - ).to.equal('1 of 3 shards failed'); - }); - // as the rollup index is gone, there is no inline warning left - await PageObjects.lens.assertNoInlineWarning(); - }); }); }); } diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/config.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/config.ts new file mode 100644 index 0000000000000..3bf1f38d29ca9 --- /dev/null +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/config.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrConfigProviderContext } from '@kbn/test'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const functionalConfig = await readConfigFile(require.resolve('../../../../config.base.js')); + + return { + ...functionalConfig.getAll(), + testFiles: [require.resolve('.')], + }; +} diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/gauge.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/gauge.ts index 35838915ede31..2ffaf120f175e 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/gauge.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/gauge.ts @@ -120,7 +120,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(textContent).to.contain('Maximum:15000000000'); expect(textContent).to.contain('Value:13104036080.615'); - dimensions[0].click(); + await dimensions[0].click(); await lens.openPalettePanel('lnsGauge'); const colorStops = await lens.getPaletteColorStops(); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/goal.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/goal.ts index d5b793b267131..d3dc518ceab06 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/goal.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/goal.ts @@ -40,8 +40,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should convert to Lens', async () => { await visualize.navigateToLensFromAnotherVisulization(); await lens.waitForVisualization('mtrVis'); - expect((await lens.getMetricVisualizationData()).length).to.be.equal(1); - expect(await lens.getMetricVisualizationData()).to.eql([ + const data = await lens.getMetricVisualizationData(); + expect(data.length).to.be.equal(1); + expect(data).to.eql([ { title: 'Count', subtitle: undefined, @@ -70,8 +71,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(await dimensions[0].getVisibleText()).to.be('Average machine.ram'); expect(await dimensions[1].getVisibleText()).to.be('Static value: 1'); - expect((await lens.getMetricVisualizationData()).length).to.be.equal(1); - expect(await lens.getMetricVisualizationData()).to.eql([ + const data = await lens.getMetricVisualizationData(); + expect(data.length).to.be.equal(1); + expect(data).to.eql([ { title: 'Average machine.ram', subtitle: undefined, @@ -100,8 +102,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(await dimensions[1].getVisibleText()).to.be('Static value: 1'); expect(await dimensions[2].getVisibleText()).to.be('@timestamp'); - expect((await lens.getMetricVisualizationData()).length).to.be.equal(1); - expect(await lens.getMetricVisualizationData()).to.eql([ + const data = await lens.getMetricVisualizationData(); + expect(data.length).to.be.equal(1); + expect(data).to.eql([ { title: 'Overall Max of Count', subtitle: undefined, @@ -142,8 +145,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(await dimensions[1].getVisibleText()).to.be('Static value: 1'); expect(await dimensions[2].getVisibleText()).to.be('machine.os.raw: Descending'); - expect((await lens.getMetricVisualizationData()).length).to.be.equal(6); - expect(await lens.getMetricVisualizationData()).to.eql([ + const data = await lens.getMetricVisualizationData(); + expect(data.length).to.be.equal(6); + expect(data).to.eql([ { title: 'ios', subtitle: 'Average machine.ram', @@ -200,7 +204,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }, ]); - dimensions[0].click(); + await dimensions[0].click(); await lens.openPalettePanel('lnsMetric'); const colorStops = await lens.getPaletteColorStops(); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/heatmap.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/heatmap.ts new file mode 100644 index 0000000000000..8556ae601daf9 --- /dev/null +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/heatmap.ts @@ -0,0 +1,219 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { visualize, lens, visChart, timePicker, visEditor } = getPageObjects([ + 'visualize', + 'lens', + 'visChart', + 'timePicker', + 'visEditor', + ]); + + describe('Heatmap', function describeIndexTests() { + const isNewChartsLibraryEnabled = true; + + before(async () => { + await visualize.initTests(isNewChartsLibraryEnabled); + }); + + beforeEach(async () => { + await visualize.navigateToNewAggBasedVisualization(); + await visualize.clickHeatmapChart(); + await visualize.clickNewSearch(); + await timePicker.setDefaultAbsoluteRange(); + }); + + it('should show the "Edit Visualization in Lens" menu item if no X-axis was specified', async () => { + await visChart.waitForVisualizationRenderingStabilized(); + + expect(await visualize.hasNavigateToLensButton()).to.eql(true); + }); + + it('should show the "Edit Visualization in Lens" menu item', async () => { + await visEditor.clickBucket('X-axis'); + await visEditor.selectAggregation('Terms'); + await visEditor.selectField('machine.os.raw'); + await visEditor.clickGo(); + + expect(await visualize.hasNavigateToLensButton()).to.eql(true); + }); + + it('should convert to Lens', async () => { + await visEditor.clickBucket('X-axis'); + await visEditor.selectAggregation('Terms'); + await visEditor.selectField('machine.os.raw'); + await visEditor.clickGo(); + + await visualize.navigateToLensFromAnotherVisulization(); + await lens.waitForVisualization('heatmapChart'); + const debugState = await lens.getCurrentChartDebugState('heatmapChart'); + + if (!debugState) { + throw new Error('Debug state is not available'); + } + + // assert axes + expect(debugState.axes!.x[0].labels).to.eql(['win 8', 'win xp', 'win 7', 'ios', 'osx']); + expect(debugState.axes!.y[0].labels).to.eql(['']); + expect(debugState.heatmap!.cells.length).to.eql(5); + expect(debugState.legend!.items).to.eql([ + { + color: '#006837', + key: '0 - 25', + name: '0 - 25', + }, + { color: '#86CB66', key: '25 - 50', name: '25 - 50' }, + { + color: '#FEFEBD', + key: '50 - 75', + name: '50 - 75', + }, + { + color: '#F88D52', + key: '75 - 100', + name: '75 - 100', + }, + ]); + }); + + it('should convert to Lens if Y-axis is defined, but X-axis is not', async () => { + await visEditor.clickBucket('Y-axis'); + await visEditor.selectAggregation('Terms'); + await visEditor.selectField('machine.os.raw'); + await visEditor.clickGo(); + + await visualize.navigateToLensFromAnotherVisulization(); + await lens.waitForVisualization('heatmapChart'); + const debugState = await lens.getCurrentChartDebugState('heatmapChart'); + + if (!debugState) { + throw new Error('Debug state is not available'); + } + + expect(debugState.axes!.x[0].labels).to.eql(['*']); + expect(debugState.axes!.y[0].labels).to.eql(['win 8', 'win xp', 'win 7', 'ios', 'osx']); + expect(debugState.heatmap!.cells.length).to.eql(5); + }); + + it('should respect heatmap colors number', async () => { + await visEditor.clickBucket('X-axis'); + await visEditor.selectAggregation('Terms'); + await visEditor.selectField('machine.os.raw'); + await visEditor.clickGo(); + + await visEditor.clickOptionsTab(); + await visEditor.changeHeatmapColorNumbers(6); + await visEditor.clickGo(); + await visChart.waitForVisualizationRenderingStabilized(); + + await visualize.navigateToLensFromAnotherVisulization(); + await lens.waitForVisualization('heatmapChart'); + const debugState = await lens.getCurrentChartDebugState('heatmapChart'); + + if (!debugState) { + throw new Error('Debug state is not available'); + } + + expect(debugState.legend!.items).to.eql([ + { + color: '#006837', + key: '0 - 16.67', + name: '0 - 16.67', + }, + { + color: '#4CB15D', + key: '16.67 - 33.33', + name: '16.67 - 33.33', + }, + { + color: '#B7E075', + key: '33.33 - 50', + name: '33.33 - 50', + }, + { + color: '#FEFEBD', + key: '50 - 66.67', + name: '50 - 66.67', + }, + { + color: '#FDBF6F', + key: '66.67 - 83.33', + name: '66.67 - 83.33', + }, + { + color: '#EA5839', + key: '83.33 - 100', + name: '83.33 - 100', + }, + ]); + }); + + it('should show respect heatmap custom color ranges', async () => { + await visEditor.clickBucket('X-axis'); + await visEditor.selectAggregation('Terms'); + await visEditor.selectField('machine.os.raw'); + await visEditor.clickGo(); + + await visEditor.clickOptionsTab(); + await visEditor.clickOptionsTab(); + await visEditor.clickEnableCustomRanges(); + await visEditor.clickAddRange(); + await visEditor.clickAddRange(); + await visEditor.clickAddRange(); + await visEditor.clickAddRange(); + await visEditor.clickAddRange(); + + await visEditor.clickGo(); + await visChart.waitForVisualizationRenderingStabilized(); + + await visualize.navigateToLensFromAnotherVisulization(); + await lens.waitForVisualization('heatmapChart'); + const debugState = await lens.getCurrentChartDebugState('heatmapChart'); + + if (!debugState) { + throw new Error('Debug state is not available'); + } + + expect(debugState.legend!.items).to.eql([ + { + color: '#006837', + key: '0 - 100', + name: '0 - 100', + }, + { + color: '#65BC62', + key: '100 - 200', + name: '100 - 200', + }, + { + color: '#D8EF8C', + key: '200 - 300', + name: '200 - 300', + }, + { + color: '#FEDF8B', + key: '300 - 400', + name: '300 - 400', + }, + { + color: '#F36D43', + key: '400 - 500', + name: '400 - 500', + }, + { + color: '#A50026', + key: '500 - 600', + name: '500 - 600', + }, + ]); + }); + }); +} diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/index.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/index.ts index 87c9d025893a1..c7380d2388a35 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/index.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/index.ts @@ -5,15 +5,76 @@ * 2.0. */ +import { EsArchiver } from '@kbn/es-archiver'; import { FtrProviderContext } from '../../../../ftr_provider_context'; -export default function ({ loadTestFile }: FtrProviderContext) { - describe('Agg based Vis to Lens', function () { +export default function ({ loadTestFile, getService, getPageObjects }: FtrProviderContext) { + const browser = getService('browser'); + const log = getService('log'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['timePicker']); + const config = getService('config'); + let remoteEsArchiver; + + describe('lens app - Agg based Vis Open in Lens', () => { + const esArchive = 'x-pack/test/functional/es_archives/logstash_functional'; + const localIndexPatternString = 'logstash-*'; + const remoteIndexPatternString = 'ftr-remote:logstash-*'; + const localFixtures = { + lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json', + lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/default', + }; + + const remoteFixtures = { + lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/lens_basic.json', + lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/default', + }; + let esNode: EsArchiver; + let fixtureDirs: { + lensBasic: string; + lensDefault: string; + }; + let indexPatternString: string; + before(async () => { + log.debug('Starting lens before method'); + await browser.setWindowSize(1280, 1200); + try { + config.get('esTestCluster.ccs'); + remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver'); + esNode = remoteEsArchiver; + fixtureDirs = remoteFixtures; + indexPatternString = remoteIndexPatternString; + } catch (error) { + esNode = esArchiver; + fixtureDirs = localFixtures; + indexPatternString = localIndexPatternString; + } + + await esNode.load(esArchive); + // changing the timepicker default here saves us from having to set it in Discover (~8s) + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.uiSettings.update({ + defaultIndex: indexPatternString, + 'dateFormat:tz': 'UTC', + }); + await kibanaServer.importExport.load(fixtureDirs.lensBasic); + await kibanaServer.importExport.load(fixtureDirs.lensDefault); + }); + + after(async () => { + await esArchiver.unload(esArchive); + await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.importExport.unload(fixtureDirs.lensBasic); + await kibanaServer.importExport.unload(fixtureDirs.lensDefault); + }); + loadTestFile(require.resolve('./pie')); loadTestFile(require.resolve('./metric')); loadTestFile(require.resolve('./xy')); loadTestFile(require.resolve('./gauge')); loadTestFile(require.resolve('./goal')); loadTestFile(require.resolve('./table')); + loadTestFile(require.resolve('./heatmap')); }); } diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/metric.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/metric.ts index 4958704801c8c..cd26a217dcca1 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/metric.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/metric.ts @@ -41,8 +41,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should convert to Lens', async () => { await visualize.navigateToLensFromAnotherVisulization(); await lens.waitForVisualization('mtrVis'); - expect((await lens.getMetricVisualizationData()).length).to.be.equal(1); - expect(await lens.getMetricVisualizationData()).to.eql([ + const data = await lens.getMetricVisualizationData(); + expect(data.length).to.be.equal(1); + expect(data).to.eql([ { title: 'Count', subtitle: undefined, @@ -70,8 +71,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(dimensions).to.have.length(1); expect(await dimensions[0].getVisibleText()).to.be('Average machine.ram'); - expect((await lens.getMetricVisualizationData()).length).to.be.equal(1); - expect(await lens.getMetricVisualizationData()).to.eql([ + const data = await lens.getMetricVisualizationData(); + expect(data.length).to.be.equal(1); + expect(data).to.eql([ { title: 'Average machine.ram', subtitle: undefined, @@ -99,8 +101,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(await dimensions[0].getVisibleText()).to.be('Overall Max of Count'); expect(await dimensions[1].getVisibleText()).to.be('@timestamp'); - expect((await lens.getMetricVisualizationData()).length).to.be.equal(1); - expect(await lens.getMetricVisualizationData()).to.eql([ + const data = await lens.getMetricVisualizationData(); + expect(data.length).to.be.equal(1); + expect(data).to.eql([ { title: 'Overall Max of Count', subtitle: undefined, @@ -152,9 +155,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(dimensions).to.have.length(2); expect(await dimensions[0].getVisibleText()).to.be('Average machine.ram'); expect(await dimensions[1].getVisibleText()).to.be('machine.os.raw: Descending'); - - expect((await lens.getMetricVisualizationData()).length).to.be.equal(6); - expect(await lens.getMetricVisualizationData()).to.eql([ + const data = await lens.getMetricVisualizationData(); + expect(data.length).to.be.equal(6); + expect(data).to.eql([ { title: 'osx', subtitle: 'Average machine.ram', @@ -211,7 +214,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }, ]); - dimensions[0].click(); + await dimensions[0].click(); await lens.openPalettePanel('lnsMetric'); const colorStops = await lens.getPaletteColorStops(); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/pie.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/pie.ts index 346aada45cea8..6a5bc5e6ce40a 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/pie.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/pie.ts @@ -127,7 +127,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(type).to.be('Donut'); const goBackBtn = await testSubjects.find('lnsApp_goBackToAppButton'); - goBackBtn.click(); + await goBackBtn.click(); await visEditor.clickOptionsTab(); const isDonutButton = await testSubjects.find('visTypePieIsDonut'); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/config.ts b/x-pack/test/functional/apps/lens/open_in_lens/config.ts deleted file mode 100644 index d927f93adeffd..0000000000000 --- a/x-pack/test/functional/apps/lens/open_in_lens/config.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FtrConfigProviderContext } from '@kbn/test'; - -export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js')); - - return { - ...functionalConfig.getAll(), - testFiles: [require.resolve('.')], - }; -} diff --git a/x-pack/test/functional/apps/lens/open_in_lens/index.ts b/x-pack/test/functional/apps/lens/open_in_lens/index.ts deleted file mode 100644 index 5d81bfcb9a927..0000000000000 --- a/x-pack/test/functional/apps/lens/open_in_lens/index.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 { EsArchiver } from '@kbn/es-archiver'; -import { FtrProviderContext } from '../../../ftr_provider_context'; - -export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext) => { - const browser = getService('browser'); - const log = getService('log'); - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - const PageObjects = getPageObjects(['timePicker']); - const config = getService('config'); - let remoteEsArchiver; - - describe('lens app - Open in Lens', () => { - const esArchive = 'x-pack/test/functional/es_archives/logstash_functional'; - const localIndexPatternString = 'logstash-*'; - const remoteIndexPatternString = 'ftr-remote:logstash-*'; - const localFixtures = { - lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json', - lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/default', - }; - - const remoteFixtures = { - lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/lens_basic.json', - lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/default', - }; - let esNode: EsArchiver; - let fixtureDirs: { - lensBasic: string; - lensDefault: string; - }; - let indexPatternString: string; - before(async () => { - log.debug('Starting lens before method'); - await browser.setWindowSize(1280, 1200); - try { - config.get('esTestCluster.ccs'); - remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver'); - esNode = remoteEsArchiver; - fixtureDirs = remoteFixtures; - indexPatternString = remoteIndexPatternString; - } catch (error) { - esNode = esArchiver; - fixtureDirs = localFixtures; - indexPatternString = localIndexPatternString; - } - - await esNode.load(esArchive); - // changing the timepicker default here saves us from having to set it in Discover (~8s) - await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); - await kibanaServer.uiSettings.update({ - defaultIndex: indexPatternString, - 'dateFormat:tz': 'UTC', - }); - await kibanaServer.importExport.load(fixtureDirs.lensBasic); - await kibanaServer.importExport.load(fixtureDirs.lensDefault); - }); - - after(async () => { - await esArchiver.unload(esArchive); - await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings(); - await kibanaServer.importExport.unload(fixtureDirs.lensBasic); - await kibanaServer.importExport.unload(fixtureDirs.lensDefault); - }); - - loadTestFile(require.resolve('./tsvb')); - loadTestFile(require.resolve('./agg_based')); - }); -}; diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/config.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/config.ts new file mode 100644 index 0000000000000..3bf1f38d29ca9 --- /dev/null +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/config.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrConfigProviderContext } from '@kbn/test'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const functionalConfig = await readConfigFile(require.resolve('../../../../config.base.js')); + + return { + ...functionalConfig.getAll(), + testFiles: [require.resolve('.')], + }; +} diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/gauge.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/gauge.ts index 4655fd34accfa..3778e3a6a79e1 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/gauge.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/gauge.ts @@ -26,9 +26,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); beforeEach(async () => { - await visualize.navigateToNewVisualization(); - await visualize.clickVisualBuilder(); - await visualBuilder.checkVisualBuilderIsPresent(); await visualBuilder.resetPage(); await visualBuilder.clickGauge(); await visualBuilder.clickDataTab('gauge'); @@ -39,6 +36,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); it('should convert to Lens', async () => { + await header.waitUntilLoadingHasFinished(); + await visualize.navigateToLensFromAnotherVisulization(); await lens.waitForVisualization('mtrVis'); @@ -76,7 +75,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should not allow converting of not valid panel', async () => { await visualBuilder.selectAggType('Value Count'); + await header.waitUntilLoadingHasFinished(); + expect(await visualize.hasNavigateToLensButton()).to.be(false); }); @@ -96,6 +97,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualBuilder.setColorPickerValue('#54A000', 4); await header.waitUntilLoadingHasFinished(); + await visualize.navigateToLensFromAnotherVisulization(); await lens.waitForVisualization('mtrVis'); @@ -111,7 +113,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const dimensions = await testSubjects.findAll('lns-dimensionTrigger'); expect(dimensions).to.have.length(3); - dimensions[0].click(); + await dimensions[0].click(); await lens.openPalettePanel('lnsMetric'); const colorStops = await lens.getPaletteColorStops(); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/index.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/index.ts index c0b5197983aa4..90b0eb2c88186 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/index.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/index.ts @@ -5,14 +5,75 @@ * 2.0. */ +import { EsArchiver } from '@kbn/es-archiver'; import { FtrProviderContext } from '../../../../ftr_provider_context'; -export default function ({ loadTestFile }: FtrProviderContext) { - describe('TSVB to Lens', function () { +export default function ({ loadTestFile, getService, getPageObjects }: FtrProviderContext) { + const browser = getService('browser'); + const log = getService('log'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['timePicker']); + const config = getService('config'); + let remoteEsArchiver; + + describe('lens app - TSVB Open in Lens', () => { + const esArchive = 'x-pack/test/functional/es_archives/logstash_functional'; + const localIndexPatternString = 'logstash-*'; + const remoteIndexPatternString = 'ftr-remote:logstash-*'; + const localFixtures = { + lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json', + lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/default', + }; + + const remoteFixtures = { + lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/lens_basic.json', + lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/default', + }; + let esNode: EsArchiver; + let fixtureDirs: { + lensBasic: string; + lensDefault: string; + }; + let indexPatternString: string; + before(async () => { + log.debug('Starting lens before method'); + await browser.setWindowSize(1280, 1200); + try { + config.get('esTestCluster.ccs'); + remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver'); + esNode = remoteEsArchiver; + fixtureDirs = remoteFixtures; + indexPatternString = remoteIndexPatternString; + } catch (error) { + esNode = esArchiver; + fixtureDirs = localFixtures; + indexPatternString = localIndexPatternString; + } + + await esNode.load(esArchive); + // changing the timepicker default here saves us from having to set it in Discover (~8s) + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.uiSettings.update({ + defaultIndex: indexPatternString, + 'dateFormat:tz': 'UTC', + }); + await kibanaServer.importExport.load(fixtureDirs.lensBasic); + await kibanaServer.importExport.load(fixtureDirs.lensDefault); + }); + + after(async () => { + await esArchiver.unload(esArchive); + await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.importExport.unload(fixtureDirs.lensBasic); + await kibanaServer.importExport.unload(fixtureDirs.lensDefault); + }); + loadTestFile(require.resolve('./metric')); loadTestFile(require.resolve('./gauge')); loadTestFile(require.resolve('./timeseries')); loadTestFile(require.resolve('./dashboard')); loadTestFile(require.resolve('./top_n')); + loadTestFile(require.resolve('./table')); }); } diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/metric.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/metric.ts index 081b3787e39a7..f4bb52b9ebb51 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/metric.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/metric.ts @@ -25,9 +25,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); beforeEach(async () => { - await visualize.navigateToNewVisualization(); - await visualize.clickVisualBuilder(); - await visualBuilder.checkVisualBuilderIsPresent(); await visualBuilder.resetPage(); await visualBuilder.clickMetric(); await visualBuilder.clickDataTab('metric'); @@ -90,7 +87,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should not allow converting of not valid panel', async () => { await visualBuilder.selectAggType('Value Count'); + await header.waitUntilLoadingHasFinished(); + expect(await visualize.hasNavigateToLensButton()).to.be(false); }); @@ -101,6 +100,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualBuilder.setColorPickerValue('#54B399'); await header.waitUntilLoadingHasFinished(); + await visualize.navigateToLensFromAnotherVisulization(); await lens.waitForVisualization('mtrVis'); @@ -116,7 +116,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const dimensions = await testSubjects.findAll('lns-dimensionTrigger'); expect(dimensions).to.have.length(1); - dimensions[0].click(); + await dimensions[0].click(); await lens.openPalettePanel('lnsMetric'); const colorStops = await lens.getPaletteColorStops(); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts new file mode 100644 index 0000000000000..e3d52852cd61b --- /dev/null +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts @@ -0,0 +1,218 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getPageObjects, getService }: FtrProviderContext) { + const { visualize, visualBuilder, lens, header } = getPageObjects([ + 'visualBuilder', + 'visualize', + 'header', + 'lens', + ]); + + const testSubjects = getService('testSubjects'); + const retry = getService('retry'); + + describe('Table', function describeIndexTests() { + before(async () => { + await visualize.initTests(); + }); + + beforeEach(async () => { + await visualBuilder.resetPage(); + await visualBuilder.clickTable(); + await header.waitUntilLoadingHasFinished(); + await visualBuilder.checkTableTabIsPresent(); + await visualBuilder.selectGroupByField('machine.os.raw'); + }); + + it('should not allow converting of not valid panel', async () => { + await visualBuilder.selectAggType('Max'); + await header.waitUntilLoadingHasFinished(); + expect(await visualize.hasNavigateToLensButton()).to.be(false); + }); + + it('should not allow converting of unsupported aggregations', async () => { + await visualBuilder.selectAggType('Sum of Squares'); + await visualBuilder.setFieldForAggregation('machine.ram'); + + await header.waitUntilLoadingHasFinished(); + expect(await visualize.hasNavigateToLensButton()).to.be(false); + }); + + it('should not allow converting sibling pipeline aggregations', async () => { + await visualBuilder.createNewAgg(); + + await visualBuilder.selectAggType('Overall Average', 1); + await visualBuilder.setFieldForAggregation('Count', 1); + await header.waitUntilLoadingHasFinished(); + expect(await visualize.hasNavigateToLensButton()).to.be(false); + }); + + it('should not allow converting parent pipeline aggregations', async () => { + await visualBuilder.clickPanelOptions('table'); + await visualBuilder.setMetricsDataTimerangeMode('Last value'); + await visualBuilder.clickDataTab('table'); + await visualBuilder.createNewAgg(); + + await visualBuilder.selectAggType('Cumulative Sum', 1); + await visualBuilder.setFieldForAggregation('Count', 1); + await header.waitUntilLoadingHasFinished(); + expect(await visualize.hasNavigateToLensButton()).to.be(false); + }); + + it('should not allow converting not valid aggregation function', async () => { + await visualBuilder.clickSeriesOption(); + await visualBuilder.setFieldForAggregateBy('clientip'); + await visualBuilder.setFunctionForAggregateFunction('Cumulative Sum'); + await header.waitUntilLoadingHasFinished(); + expect(await visualize.hasNavigateToLensButton()).to.be(false); + }); + + it('should not allow converting series with different aggregation fucntion or aggregation by', async () => { + await visualBuilder.createNewAggSeries(); + await visualBuilder.selectAggType('Static Value', 1); + await visualBuilder.setStaticValue(10); + await visualBuilder.clickSeriesOption(); + await visualBuilder.setFieldForAggregateBy('bytes'); + await visualBuilder.setFunctionForAggregateFunction('Sum'); + await visualBuilder.clickSeriesOption(1); + await visualBuilder.setFieldForAggregateBy('bytes'); + await visualBuilder.setFunctionForAggregateFunction('Min'); + await header.waitUntilLoadingHasFinished(); + expect(await visualize.hasNavigateToLensButton()).to.be(false); + }); + + it('should allow converting a count aggregation', async () => { + expect(await visualize.hasNavigateToLensButton()).to.be(true); + }); + + it('should convert last value mode to reduced time range', async () => { + await visualBuilder.clickPanelOptions('table'); + await visualBuilder.setMetricsDataTimerangeMode('Last value'); + await visualBuilder.setIntervalValue('1m'); + await visualBuilder.clickDataTab('table'); + await header.waitUntilLoadingHasFinished(); + + await visualize.navigateToLensFromAnotherVisulization(); + await lens.waitForVisualization('lnsDataTable'); + await lens.openDimensionEditor('lnsDatatable_metrics > lns-dimensionTrigger'); + await testSubjects.click('indexPattern-advanced-accordion'); + const reducedTimeRange = await testSubjects.find('indexPattern-dimension-reducedTimeRange'); + expect(await reducedTimeRange.getVisibleText()).to.be('1 minute (1m)'); + await retry.try(async () => { + const layerCount = await lens.getLayerCount(); + expect(layerCount).to.be(1); + const metricDimensionText = await lens.getDimensionTriggerText('lnsDatatable_metrics', 0); + expect(metricDimensionText).to.be('Count of records last 1m'); + }); + }); + + it('should convert static value to the metric dimension', async () => { + await visualBuilder.createNewAggSeries(); + await visualBuilder.selectAggType('Static Value', 1); + await visualBuilder.setStaticValue(10); + + await header.waitUntilLoadingHasFinished(); + + await visualize.navigateToLensFromAnotherVisulization(); + await lens.waitForVisualization('lnsDataTable'); + await retry.try(async () => { + const layerCount = await lens.getLayerCount(); + expect(layerCount).to.be(1); + const metricDimensionText1 = await lens.getDimensionTriggerText('lnsDatatable_metrics', 0); + const metricDimensionText2 = await lens.getDimensionTriggerText('lnsDatatable_metrics', 1); + expect(metricDimensionText1).to.be('Count of records'); + expect(metricDimensionText2).to.be('10'); + }); + }); + + it('should convert aggregate by to split row dimension', async () => { + await visualBuilder.clickSeriesOption(); + await visualBuilder.setFieldForAggregateBy('clientip'); + await visualBuilder.setFunctionForAggregateFunction('Sum'); + await header.waitUntilLoadingHasFinished(); + + await visualize.navigateToLensFromAnotherVisulization(); + await lens.waitForVisualization('lnsDataTable'); + await retry.try(async () => { + const layerCount = await lens.getLayerCount(); + expect(layerCount).to.be(1); + const splitRowsText1 = await lens.getDimensionTriggerText('lnsDatatable_rows', 0); + const splitRowsText2 = await lens.getDimensionTriggerText('lnsDatatable_rows', 1); + expect(splitRowsText1).to.be('Top 10 values of machine.os.raw'); + expect(splitRowsText2).to.be('Top 10 values of clientip'); + }); + + await lens.openDimensionEditor('lnsDatatable_rows > lns-dimensionTrigger', 0, 1); + const collapseBy = await testSubjects.find('indexPattern-collapse-by'); + expect(await collapseBy.getAttribute('value')).to.be('sum'); + }); + + it('should convert group by field with custom label', async () => { + await visualBuilder.setColumnLabelValue('test'); + await header.waitUntilLoadingHasFinished(); + + await visualize.navigateToLensFromAnotherVisulization(); + await lens.waitForVisualization('lnsDataTable'); + await retry.try(async () => { + const layerCount = await lens.getLayerCount(); + expect(layerCount).to.be(1); + const splitRowsText = await lens.getDimensionTriggerText('lnsDatatable_rows', 0); + expect(splitRowsText).to.be('test'); + }); + }); + + it('should convert color ranges', async () => { + await visualBuilder.clickSeriesOption(); + + await visualBuilder.setColorRuleOperator('>= greater than or equal'); + await visualBuilder.setColorRuleValue(10); + await visualBuilder.setColorPickerValue('#54B399'); + + await visualBuilder.createColorRule(1); + + await visualBuilder.setColorRuleOperator('>= greater than or equal'); + await visualBuilder.setColorRuleValue(100, 1); + await visualBuilder.setColorPickerValue('#54A000', 1); + + await header.waitUntilLoadingHasFinished(); + await visualize.navigateToLensFromAnotherVisulization(); + + await lens.waitForVisualization('lnsDataTable'); + await retry.try(async () => { + const closePalettePanels = await testSubjects.findAll( + 'lns-indexPattern-PalettePanelContainerBack' + ); + if (closePalettePanels.length) { + await lens.closePalettePanel(); + await lens.closeDimensionEditor(); + } + + await lens.openDimensionEditor('lnsDatatable_metrics > lns-dimensionTrigger'); + + await lens.openPalettePanel('lnsDatatable'); + const colorStops = await lens.getPaletteColorStops(); + + expect(colorStops).to.eql([ + { stop: '10', color: 'rgba(84, 179, 153, 1)' }, + { stop: '100', color: 'rgba(84, 160, 0, 1)' }, + { stop: '', color: undefined }, + ]); + }); + }); + }); +} diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/timeseries.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/timeseries.ts index dc77e9fcedb9a..8d86e8e6843e8 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/timeseries.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/timeseries.ts @@ -28,9 +28,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); beforeEach(async () => { - await visualize.navigateToNewVisualization(); - await visualize.clickVisualBuilder(); - await visualBuilder.checkVisualBuilderIsPresent(); await visualBuilder.resetPage(); }); @@ -39,6 +36,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); it('visualizes field to Lens and loads fields to the dimesion editor', async () => { + await header.waitUntilLoadingHasFinished(); + await visualize.navigateToLensFromAnotherVisulization(); await lens.waitForVisualization('xyVisChart'); await retry.try(async () => { @@ -50,11 +49,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); it('navigates back to TSVB when the Back button is clicked', async () => { + await header.waitUntilLoadingHasFinished(); + await visualize.navigateToLensFromAnotherVisulization(); await lens.waitForVisualization('xyVisChart'); const goBackBtn = await testSubjects.find('lnsApp_goBackToAppButton'); - goBackBtn.click(); + await goBackBtn.click(); await visualBuilder.checkVisualBuilderIsPresent(); await retry.try(async () => { const actualCount = await visualBuilder.getRhythmChartLegendValue(); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts index 1192b38b03c69..0716a1ac4a78b 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts @@ -27,9 +27,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); beforeEach(async () => { - await visualize.navigateToNewVisualization(); - await visualize.clickVisualBuilder(); - await visualBuilder.checkVisualBuilderIsPresent(); await visualBuilder.resetPage(); await visualBuilder.clickTopN(); await visualBuilder.checkTopNTabIsPresent(); @@ -160,7 +157,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualize.navigateToLensFromAnotherVisulization(); await lens.waitForVisualization('xyVisChart'); const goBackBtn = await testSubjects.find('lnsApp_goBackToAppButton'); - goBackBtn.click(); + await goBackBtn.click(); await visualBuilder.checkTopNTabIsPresent(); }); diff --git a/x-pack/test/functional/apps/maps/group4/geofile_wizard_auto_open.ts b/x-pack/test/functional/apps/maps/group4/geofile_wizard_auto_open.ts index ebe434b6afe6e..d60d7b89a0121 100644 --- a/x-pack/test/functional/apps/maps/group4/geofile_wizard_auto_open.ts +++ b/x-pack/test/functional/apps/maps/group4/geofile_wizard_auto_open.ts @@ -22,7 +22,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const geoFileCard = await find.byCssSelector( '[data-test-subj="integration-card:ui_link:ingest_geojson"]' ); - geoFileCard.click(); + await geoFileCard.click(); }); it('should navigate to maps app with url params', async () => { diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml.ts b/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml.ts index 935ae3c599ac0..1d0fb39bc3799 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml.ts @@ -36,7 +36,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardPanelActions.openContextMenuMorePanel(header); } - describe('create jobs from lens', function () { + // Failing: See https://github.com/elastic/kibana/issues/142762 + describe.skip('create jobs from lens', function () { this.tags(['ml']); before(async () => { diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml_with_wizard.ts b/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml_with_wizard.ts index 9c70e92a02026..5fc18c470a135 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml_with_wizard.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml_with_wizard.ts @@ -89,7 +89,8 @@ export default function ({ getService, getPageObject, getPageObjects }: FtrProvi await ml.jobTable.assertJobRowJobId(jobId); } - describe('create jobs from lens with wizard', function () { + // Failing: See https://github.com/elastic/kibana/issues/144186 + describe.skip('create jobs from lens with wizard', function () { this.tags(['ml']); before(async () => { diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/custom_urls.ts b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/custom_urls.ts index 5661a30362641..e5f181ea8414c 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/custom_urls.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/custom_urls.ts @@ -62,7 +62,8 @@ export default function ({ getService }: FtrProviderContext) { const ml = getService('ml'); const browser = getService('browser'); - describe('custom urls', function () { + // Failing: See https://github.com/elastic/kibana/issues/143933 + describe.skip('custom urls', function () { this.tags(['ml']); let testDashboardId: string | null = null; diff --git a/x-pack/test/functional/apps/remote_clusters/ccs/remote_clusters_index_management_flow.ts b/x-pack/test/functional/apps/remote_clusters/ccs/remote_clusters_index_management_flow.ts new file mode 100644 index 0000000000000..a0b35cbe1c2ef --- /dev/null +++ b/x-pack/test/functional/apps/remote_clusters/ccs/remote_clusters_index_management_flow.ts @@ -0,0 +1,114 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 ({ getPageObjects, getService }: FtrProviderContext) => { + const pageObjects = getPageObjects([ + 'common', + 'remoteClusters', + 'indexManagement', + 'crossClusterReplication', + ]); + const security = getService('security'); + const retry = getService('retry'); + const testSubjects = getService('testSubjects'); + const remoteEs = getService('remoteEs' as 'es'); + const localEs = getService('es'); + + describe('CCS Remote Clusters > Index Management', function () { + const leaderName = 'my-index'; + const followerName = 'my-follower'; + before(async () => { + await security.testUser.setRoles(['superuser']); + // This test is temporarily using superuser because of an issue with the permissions + // of the follower index creation wizard. There is an open issue to address the issue. + // We can change the permissions to use follower_index_user once the issue is fixed. + // https://github.com/elastic/kibana/issues/143720 + // await security.testUser.setRoles(['follower_index_user']); + }); + + describe('Remote Clusters', function () { + before(async () => { + await pageObjects.common.navigateToApp('remoteClusters'); + }); + + it('Verify "ftr-remote" remote cluster exists', async () => { + await retry.waitFor('table to be visible', async () => { + return await testSubjects.isDisplayed('remoteClusterListTable'); + }); + const remotes = await pageObjects.remoteClusters.getRemoteClustersList(); + expect(remotes.length).to.eql(1); + expect(remotes[0].remoteName).to.eql('ftr-remote'); + expect(remotes[0].remoteAddress).to.contain('localhost'); + expect(remotes[0].remoteStatus).to.eql('Connected'); + expect(remotes[0].remoteConnectionCount).to.eql('1'); + expect(remotes[0].remoteMode).to.eql('default'); + }); + }); + + describe('Cross Cluster Replication', function () { + before(async () => { + await remoteEs.indices.create({ + index: leaderName, + body: { + settings: { number_of_shards: 1, soft_deletes: { enabled: true } }, + }, + }); + await pageObjects.common.navigateToApp('crossClusterReplication'); + await retry.waitFor('indices table to be visible', async () => { + return await testSubjects.isDisplayed('createFollowerIndexButton'); + }); + }); + it('Create Follower Index', async () => { + await pageObjects.crossClusterReplication.clickCreateFollowerIndexButton(); + await pageObjects.crossClusterReplication.createFollowerIndex( + leaderName, + followerName, + true, + '1s' + ); + }); + }); + describe('Index Management', function () { + before(async () => { + await remoteEs.index({ + index: leaderName, + body: { a: 'b' }, + }); + await pageObjects.common.navigateToApp('indexManagement'); + await retry.waitForWithTimeout('indice table to be visible', 15000, async () => { + return await testSubjects.isDisplayed('indicesList'); + }); + }); + it('Verify that the follower index is duplicating from the remote.', async () => { + await pageObjects.indexManagement.clickIndiceAt(0); + await pageObjects.indexManagement.performIndexActionInDetailPanel('flush'); + await testSubjects.click('euiFlyoutCloseButton'); + await pageObjects.common.navigateToApp('indexManagement'); + await retry.waitForWithTimeout('indice table to be visible', 15000, async () => { + return await testSubjects.isDisplayed('indicesList'); + }); + + const indicesList = await pageObjects.indexManagement.getIndexList(); + const followerIndex = indicesList[0]; + expect(followerIndex.indexDocuments).to.eql('1'); + }); + }); + + after(async () => { + await localEs.indices.delete({ + index: followerName, + }); + await remoteEs.indices.delete({ + index: leaderName, + }); + await security.testUser.restoreDefaults(); + }); + }); +}; diff --git a/x-pack/test/functional/apps/rollup_job/index.js b/x-pack/test/functional/apps/rollup_job/index.js index 943536539c5ad..f65396db754cb 100644 --- a/x-pack/test/functional/apps/rollup_job/index.js +++ b/x-pack/test/functional/apps/rollup_job/index.js @@ -5,10 +5,13 @@ * 2.0. */ -export default function ({ loadTestFile }) { +export default function ({ loadTestFile, getService }) { + const config = getService('config'); describe('rollup app', function () { loadTestFile(require.resolve('./rollup_jobs')); - loadTestFile(require.resolve('./hybrid_index_pattern')); - loadTestFile(require.resolve('./tsvb')); + if (!config.get('esTestCluster.ccs')) { + loadTestFile(require.resolve('./hybrid_index_pattern')); + loadTestFile(require.resolve('./tsvb')); + } }); } diff --git a/x-pack/test/functional/apps/rollup_job/rollup_jobs.js b/x-pack/test/functional/apps/rollup_job/rollup_jobs.js index abf01f63c4676..1b2ba0457e02b 100644 --- a/x-pack/test/functional/apps/rollup_job/rollup_jobs.js +++ b/x-pack/test/functional/apps/rollup_job/rollup_jobs.js @@ -8,23 +8,33 @@ import datemath from '@kbn/datemath'; import expect from '@kbn/expect'; import { mockIndices } from './hybrid_index_helper'; +// import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }) { - const es = getService('es'); + const config = getService('config'); const PageObjects = getPageObjects(['rollup', 'common', 'security']); const security = getService('security'); const esDeleteAllIndices = getService('esDeleteAllIndices'); const kibanaServer = getService('kibanaServer'); + const es = getService('es'); + const isRunningCcs = config.get('esTestCluster.ccs') ? true : false; + let remoteEs; + if (isRunningCcs) { + remoteEs = getService('remoteEs'); + } describe('rollup job', function () { - //Since rollups can only be created once with the same name (even if you delete it), - //we add the Date.now() to avoid name collision. + // Since rollups can only be created once with the same name (even if you delete it), + // we add the Date.now() to avoid name collision. const rollupJobName = 'rollup-to-be-' + Date.now(); const targetIndexName = 'rollup-to-be'; - const rollupSourceIndexPattern = 'to-be*'; + const indexPatternToUse = 'to-be*'; + const rollupSourceIndexPattern = isRunningCcs + ? 'ftr-remote:' + indexPatternToUse + : indexPatternToUse; const rollupSourceDataPrepend = 'to-be'; - //make sure all dates have the same concept of "now" + // make sure all dates have the same concept of "now" const now = new Date(); const pastDates = [ datemath.parse('now-1d', { forceNow: now }), @@ -32,15 +42,18 @@ export default function ({ getService, getPageObjects }) { datemath.parse('now-3d', { forceNow: now }), ]; before(async () => { - await security.testUser.setRoles(['manage_rollups_role']); + // <issue for security roles not working as expected> + // https://github.com/elastic/kibana/issues/143720 + // await security.testUser.setRoles(['manage_rollups_role', 'global_ccr_role']); + await security.testUser.setRoles(['superuser']); await PageObjects.common.navigateToApp('rollupJob'); }); it('create new rollup job', async () => { const interval = '1000ms'; - + const esNode = isRunningCcs ? remoteEs : es; for (const day of pastDates) { - await es.index(mockIndices(day, rollupSourceDataPrepend)); + await esNode.index(mockIndices(day, rollupSourceDataPrepend)); } await PageObjects.rollup.createNewRollUpJob( @@ -58,7 +71,7 @@ export default function ({ getService, getPageObjects }) { }); after(async () => { - //Stop the running rollup job. + // Stop the running rollup job. await es.transport.request({ path: `/_rollup/job/${rollupJobName}/_stop?wait_for_completion=true`, method: 'POST', @@ -69,8 +82,13 @@ export default function ({ getService, getPageObjects }) { method: 'DELETE', }); - //Delete all data indices that were created. - await esDeleteAllIndices([targetIndexName, rollupSourceIndexPattern]); + // Delete all data indices that were created. + await esDeleteAllIndices([targetIndexName], false); + if (isRunningCcs) { + await esDeleteAllIndices([indexPatternToUse], true); + } else { + await esDeleteAllIndices([indexPatternToUse], false); + } await kibanaServer.savedObjects.cleanStandardList(); await security.testUser.restoreDefaults(); }); diff --git a/x-pack/test/functional/apps/spaces/spaces_selection.ts b/x-pack/test/functional/apps/spaces/spaces_selection.ts index 65fa1c9f00146..254a883ebf920 100644 --- a/x-pack/test/functional/apps/spaces/spaces_selection.ts +++ b/x-pack/test/functional/apps/spaces/spaces_selection.ts @@ -22,7 +22,8 @@ export default function spaceSelectorFunctionalTests({ ]); const spacesService = getService('spaces'); - describe('Spaces', function () { + // Failing: See https://github.com/elastic/kibana/issues/142155 + describe.skip('Spaces', function () { const testSpacesIds = ['another-space', ...Array.from('123456789', (idx) => `space-${idx}`)]; before(async () => { for (const testSpaceId of testSpacesIds) { diff --git a/x-pack/test/functional/config.base.js b/x-pack/test/functional/config.base.js index 11ba4d6ebd447..f9953dc861ea0 100644 --- a/x-pack/test/functional/config.base.js +++ b/x-pack/test/functional/config.base.js @@ -499,6 +499,33 @@ export default async function ({ readConfigFile }) { cluster: ['manage', 'manage_ccr'], }, }, + // There is an issue open for follower_index_user permissions not working correctly + // in kibana. + // https://github.com/elastic/kibana/issues/143720 + // follower_index_user: { + // elasticsearch: { + // cluster: ['monitor', 'manage', 'manage_ccr', 'transport_client', 'read_ccr', 'all'], + // indices: [ + // { + // names: ['*'], + // privileges: [ + // 'write', + // 'monitor', + // 'manage_follow_index', + // 'manage_leader_index', + // 'read', + // 'view_index_metadata', + // ], + // }, + // ], + // }, + // kibana: [ + // { + // base: ['all'], + // spaces: ['*'], + // }, + // ], + // }, manage_ilm: { elasticsearch: { diff --git a/x-pack/test/functional/config.ccs.ts b/x-pack/test/functional/config.ccs.ts index 6ed19292d9411..62f988d8f2f02 100644 --- a/x-pack/test/functional/config.ccs.ts +++ b/x-pack/test/functional/config.ccs.ts @@ -15,7 +15,12 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { return { ...functionalConfig.getAll(), - testFiles: [require.resolve('./apps/canvas'), require.resolve('./apps/lens/group1')], + testFiles: [ + require.resolve('./apps/canvas'), + require.resolve('./apps/lens/group1'), + require.resolve('./apps/remote_clusters/ccs/remote_clusters_index_management_flow'), + require.resolve('./apps/rollup_job'), + ], junit: { reportName: 'X-Pack CCS Tests', @@ -25,10 +30,11 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { ...functionalConfig.get('security'), remoteEsRoles: { ccs_remote_search: { + cluster: ['manage', 'manage_ccr'], indices: [ { names: ['*'], - privileges: ['read', 'view_index_metadata', 'read_cross_cluster'], + privileges: ['read', 'view_index_metadata', 'read_cross_cluster', 'monitor'], }, ], }, diff --git a/x-pack/test/functional/es_archives/fleet/agents/data.json b/x-pack/test/functional/es_archives/fleet/agents/data.json index 8708710321088..14f3704cdb623 100644 --- a/x-pack/test/functional/es_archives/fleet/agents/data.json +++ b/x-pack/test/functional/es_archives/fleet/agents/data.json @@ -89,6 +89,20 @@ } } +{ + "type": "doc", + "value": { + "id": "fleet-server-host-1", + "index": ".fleet-fleet-server-host", + "source": { + "id": "test-default-123", + "name": "Default", + "is_default": true, + "host_urls": ["https://test.fr:8080", "https://test.fr:8081"] + } + } +} + { "type": "doc", "value": { diff --git a/x-pack/test/functional/es_archives/reporting/big_int_id_field/data.json.gz b/x-pack/test/functional/es_archives/reporting/big_int_id_field/data.json.gz new file mode 100644 index 0000000000000..c42d21903c912 Binary files /dev/null and b/x-pack/test/functional/es_archives/reporting/big_int_id_field/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/reporting/big_int_id_field/mappings.json b/x-pack/test/functional/es_archives/reporting/big_int_id_field/mappings.json new file mode 100644 index 0000000000000..d2ee24696e0f1 --- /dev/null +++ b/x-pack/test/functional/es_archives/reporting/big_int_id_field/mappings.json @@ -0,0 +1,25 @@ +{ + "type": "index", + "value": { + "aliases": { + }, + "index": "test_elastic", + "mappings": { + "properties": { + "timestamp": { + "format": "yyyyMMddHHmmss||yyyyMMddHHmmssZ||strict_date_optional_time||epoch_millis", + "type": "date" + }, + "message_type": { + "type": "keyword" + } + } + }, + "settings": { + "index": { + "number_of_replicas": "1", + "number_of_shards": "1" + } + } + } +} diff --git a/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/data.json.gz b/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/data.json.gz index 9036d465e3fce..863d72c8f64d1 100644 Binary files a/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/data.json.gz and b/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/data.json.gz differ diff --git a/x-pack/test/functional/fixtures/kbn_archiver/reporting/big_int_id_field.json b/x-pack/test/functional/fixtures/kbn_archiver/reporting/big_int_id_field.json new file mode 100644 index 0000000000000..770758f52d0d3 --- /dev/null +++ b/x-pack/test/functional/fixtures/kbn_archiver/reporting/big_int_id_field.json @@ -0,0 +1,96 @@ +{ + "attributes": { + "fieldAttrs": "{}", + "fieldFormatMap": "{}", + "fields": "[]", + "name": "test_elastic*", + "runtimeFieldMap": "{}", + "sourceFilters": "[]", + "timeFieldName": "timestamp", + "title": "test_elastic*", + "typeMeta": "{}" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-25T20:55:46.970Z", + "id": "c424ce04-f440-4f48-aa0c-534da84d06f6", + "migrationVersion": { + "index-pattern": "8.0.0" + }, + "references": [], + "type": "index-pattern", + "updated_at": "2022-10-25T20:55:46.970Z", + "version": "WzIxOCwxXQ==" +} + +{ + "attributes": { + "columns": [], + "description": "", + "grid": {}, + "hideChart": false, + "isTextBasedQuery": false, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "sort": [ + [ + "timestamp", + "desc" + ] + ], + "timeRestore": false, + "title": "testsearch" + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-25T20:57:39.872Z", + "id": "a984aeb0-54a7-11ed-b3f3-41d5096a3cfd", + "migrationVersion": { + "search": "8.0.0" + }, + "references": [ + { + "id": "c424ce04-f440-4f48-aa0c-534da84d06f6", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + } + ], + "type": "search", + "updated_at": "2022-10-25T20:57:39.872Z", + "version": "WzI2MCwxXQ==" +} + +{ + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" + }, + "optionsJSON": "{\"useMargins\":true,\"syncColors\":false,\"syncCursor\":true,\"syncTooltips\":false,\"hidePanelTitles\":false}", + "panelsJSON": "[{\"version\":\"8.6.0\",\"type\":\"search\",\"gridData\":{\"x\":0,\"y\":0,\"w\":48,\"h\":18,\"i\":\"7307be50-603d-4091-b4b9-e76a96c6a33a\"},\"panelIndex\":\"7307be50-603d-4091-b4b9-e76a96c6a33a\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_7307be50-603d-4091-b4b9-e76a96c6a33a\"}]", + "refreshInterval": { + "pause": true, + "value": 0 + }, + "timeFrom": "now-15y", + "timeRestore": true, + "timeTo": "2022-10-30T00:00:00.000Z", + "title": "rbbaf", + "version": 1 + }, + "coreMigrationVersion": "8.6.0", + "created_at": "2022-10-25T21:01:17.780Z", + "id": "b78b1350-54a7-11ed-b3f3-41d5096a3cfd", + "migrationVersion": { + "dashboard": "8.6.0" + }, + "references": [ + { + "id": "a984aeb0-54a7-11ed-b3f3-41d5096a3cfd", + "name": "7307be50-603d-4091-b4b9-e76a96c6a33a:panel_7307be50-603d-4091-b4b9-e76a96c6a33a", + "type": "search" + } + ], + "type": "dashboard", + "updated_at": "2022-10-25T21:01:17.780Z", + "version": "WzMzNiwxXQ==" +} \ No newline at end of file diff --git a/x-pack/test/functional/fixtures/kbn_archiver/security_solution/timelines/7.15.0_space b/x-pack/test/functional/fixtures/kbn_archiver/security_solution/timelines/7.15.0_space new file mode 100644 index 0000000000000..53acfb24cb301 --- /dev/null +++ b/x-pack/test/functional/fixtures/kbn_archiver/security_solution/timelines/7.15.0_space @@ -0,0 +1,20 @@ +{ + "attributes": { + "fieldAttrs": "{}", + "fields": "[]", + "runtimeFieldMap": "{}", + "timeFieldName": "", + "title": ".kibana_7.15.0", + "typeMeta": "{}" + }, + "coreMigrationVersion": "8.6.0", + "id": "cf0a7895-d367-5eff-9d71-8d6b58b0b5d9", + "migrationVersion": { + "index-pattern": "8.0.0" + }, + "originId": "4f57d680-25f3-11ec-a981-b77847c6ef30", + "references": [], + "type": "index-pattern", + "updated_at": "2021-10-05T15:45:48.019Z", + "version": "WzIyLDJd" +} \ No newline at end of file diff --git a/x-pack/test/functional/page_objects/cross_cluster_replication_page.ts b/x-pack/test/functional/page_objects/cross_cluster_replication_page.ts index c51b764f2de06..558de0f6e6412 100644 --- a/x-pack/test/functional/page_objects/cross_cluster_replication_page.ts +++ b/x-pack/test/functional/page_objects/cross_cluster_replication_page.ts @@ -39,9 +39,23 @@ export function CrossClusterReplicationPageProvider({ getService }: FtrProviderC return await testSubjects.isDisplayed('nameInput'); }); }, - async createFollowerIndex(leader: string, follower: string) { + async createFollowerIndex( + leader: string, + follower: string, + advancedSettings: boolean = false, + readPollTimeout?: string + ) { await testSubjects.setValue('leaderIndexInput', leader); await testSubjects.setValue('followerIndexInput', follower); + if (advancedSettings) { + await this.clickAdvancedSettingsToggle(); + await retry.waitFor('advanced settings to be shown', async () => { + return await testSubjects.isDisplayed('readPollTimeoutInput'); + }); + if (readPollTimeout) { + await testSubjects.setValue('readPollTimeoutInput', readPollTimeout); + } + } await testSubjects.click('submitButton'); await retry.waitForWithTimeout('follower index to be in table', 45000, async () => { return await testSubjects.isDisplayed('maxReadReqSize'); @@ -55,5 +69,8 @@ export function CrossClusterReplicationPageProvider({ getService }: FtrProviderC return await testSubjects.isDisplayed('settingsValues'); }); }, + async clickAdvancedSettingsToggle() { + await testSubjects.click('advancedSettingsToggle'); + }, }; } diff --git a/x-pack/test/functional/page_objects/index_management_page.ts b/x-pack/test/functional/page_objects/index_management_page.ts index fc2382eb5a931..6872b9449a2eb 100644 --- a/x-pack/test/functional/page_objects/index_management_page.ts +++ b/x-pack/test/functional/page_objects/index_management_page.ts @@ -41,26 +41,46 @@ export function IndexManagementPageProvider({ getService }: FtrProviderContext) }); }, + async performIndexActionInDetailPanel(action: string) { + await this.clickContextMenuInDetailPanel(); + if (action === 'flush') { + await testSubjects.click('flushIndexMenuButton'); + } + }, + + async clickContextMenuInDetailPanel() { + await testSubjects.click('indexActionsContextMenuButton'); + }, + async getIndexList() { const table = await find.byCssSelector('table'); - const $ = await table.parseDomContent(); - const indexList = await $.findTestSubjects('indexTableRow') - .toArray() - .map((row) => { + const rows = await table.findAllByTestSubject('indexTableRow'); + return await Promise.all( + rows.map(async (row) => { return { - indexName: $(row).findTestSubject('indexTableIndexNameLink').text(), - indexHealth: $(row).findTestSubject('indexTableCell-health').text(), - indexStatus: $(row).findTestSubject('indexTableCell-status').text(), - indexPrimary: $(row).findTestSubject('indexTableCell-primary').text(), - indexReplicas: $(row).findTestSubject('indexTableCell-replica').text(), - indexDocuments: $(row) - .findTestSubject('indexTableCell-documents') - .text() - .replace('documents', ''), - indexSize: $(row).findTestSubject('indexTableCell-size').text(), + indexLink: await row.findByTestSubject('indexTableIndexNameLink'), + indexName: await ( + await row.findByTestSubject('indexTableIndexNameLink') + ).getVisibleText(), + indexHealth: await ( + await row.findByTestSubject('indexTableCell-health') + ).getVisibleText(), + indexStatus: await ( + await row.findByTestSubject('indexTableCell-status') + ).getVisibleText(), + indexPrimary: await ( + await row.findByTestSubject('indexTableCell-primary') + ).getVisibleText(), + indexReplicas: await ( + await row.findByTestSubject('indexTableCell-replica') + ).getVisibleText(), + indexDocuments: await ( + await (await row.findByTestSubject('indexTableCell-documents')).getVisibleText() + ).replace('documents', ''), + indexSize: await (await row.findByTestSubject('indexTableCell-size')).getVisibleText(), }; - }); - return indexList; + }) + ); }, async changeTabs( diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index 8dd95aa107929..2d200279f6fb9 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -1229,14 +1229,12 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont const tiles = await this.getMetricTiles(); const showingBar = Boolean(await findService.existsByCssSelector('.echSingleMetricProgress')); - const metricData = []; + const metricDataPromises = []; for (const tile of tiles) { - metricData.push({ - ...(await this.getMetricDatum(tile)), - showingBar, - }); + metricDataPromises.push(this.getMetricDatum(tile)); } - return metricData; + const metricData = await Promise.all(metricDataPromises); + return metricData.map((d) => ({ ...d, showingBar })); }, /** @@ -1335,9 +1333,9 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont await testSubjects.click('indexPattern-add-field'); }, - async createAdHocDataView(name: string) { + async createAdHocDataView(name: string, hasTimeField?: boolean) { await testSubjects.click('lns-dataView-switch-link'); - await PageObjects.unifiedSearch.createNewDataView(name, true); + await PageObjects.unifiedSearch.createNewDataView(name, true, hasTimeField); }, async switchToTextBasedLanguage(language: string) { @@ -1638,5 +1636,17 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont }) ); }, + + async findFieldIdsByType( + type: 'string' | 'number' | 'date' | 'geo_point' | 'ip_range', + group: 'available' | 'empty' | 'meta' = 'available' + ) { + const groupCapitalized = `${group[0].toUpperCase()}${group.slice(1).toLowerCase()}`; + const allFieldsForType = await find.allByCssSelector( + `[data-test-subj="lnsIndexPattern${groupCapitalized}Fields"] .lnsFieldItem--${type}` + ); + // map to testSubjId + return Promise.all(allFieldsForType.map((el) => el.getAttribute('data-test-subj'))); + }, }); } diff --git a/x-pack/test/functional/page_objects/remote_clusters_page.ts b/x-pack/test/functional/page_objects/remote_clusters_page.ts index 9dfa2db9ce6e8..b6ce2eb4a39bd 100644 --- a/x-pack/test/functional/page_objects/remote_clusters_page.ts +++ b/x-pack/test/functional/page_objects/remote_clusters_page.ts @@ -31,5 +31,31 @@ export function RemoteClustersPageProvider({ getService }: FtrProviderContext) { await comboBox.setCustom('comboBoxInput', seedNode); await testSubjects.click('remoteClusterFormSaveButton'); }, + async getRemoteClustersList() { + const table = await testSubjects.find('remoteClusterListTable'); + const rows = await table.findAllByCssSelector('.euiTableRow'); + return await Promise.all( + rows.map(async (row) => { + return { + remoteLink: await row.findByTestSubject('remoteClustersTableListClusterLink'), + remoteName: await ( + await row.findByTestSubject('remoteClustersTableListClusterLink') + ).getVisibleText(), + remoteStatus: await ( + await row.findByTestSubject('remoteClusterConnectionStatusMessage') + ).getVisibleText(), + remoteMode: await ( + await row.findByTestSubject('remoteClusterConnectionModeMessage') + ).getVisibleText(), + remoteAddress: await ( + await row.findByTestSubject('remoteClusterConnectionAddressMessage') + ).getVisibleText(), + remoteConnectionCount: await ( + await row.findByTestSubject('remoteClusterNodeCountMessage') + ).getVisibleText(), + }; + }) + ); + }, }; } diff --git a/x-pack/test/functional_cors/plugins/kibana_cors_test/tsconfig.json b/x-pack/test/functional_cors/plugins/kibana_cors_test/tsconfig.json new file mode 100644 index 0000000000000..9925e88e82877 --- /dev/null +++ b/x-pack/test/functional_cors/plugins/kibana_cors_test/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" } + ] +} diff --git a/x-pack/test/functional_embedded/plugins/iframe_embedded/tsconfig.json b/x-pack/test/functional_embedded/plugins/iframe_embedded/tsconfig.json new file mode 100644 index 0000000000000..9925e88e82877 --- /dev/null +++ b/x-pack/test/functional_embedded/plugins/iframe_embedded/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" } + ] +} diff --git a/x-pack/test/functional_synthetics/apps/uptime/synthetics_integration.ts b/x-pack/test/functional_synthetics/apps/uptime/synthetics_integration.ts index b99f42b33cbe8..b19d4fcb7668e 100644 --- a/x-pack/test/functional_synthetics/apps/uptime/synthetics_integration.ts +++ b/x-pack/test/functional_synthetics/apps/uptime/synthetics_integration.ts @@ -51,6 +51,11 @@ export default function (providerContext: FtrProviderContext) { { data_stream: { dataset: monitorType, + elasticsearch: { + privileges: { + indices: ['auto_configure', 'create_doc', 'read'], + }, + }, type: 'synthetics', }, id: `${getSyntheticsPolicy(agentFullPolicy)?.streams?.[0]?.id}`, @@ -81,6 +86,11 @@ export default function (providerContext: FtrProviderContext) { { data_stream: { dataset: 'browser.network', + elasticsearch: { + privileges: { + indices: ['auto_configure', 'create_doc', 'read'], + }, + }, type: 'synthetics', }, id: `${getSyntheticsPolicy(agentFullPolicy)?.streams?.[1]?.id}`, @@ -105,6 +115,11 @@ export default function (providerContext: FtrProviderContext) { { data_stream: { dataset: 'browser.screenshot', + elasticsearch: { + privileges: { + indices: ['auto_configure', 'create_doc', 'read'], + }, + }, type: 'synthetics', }, id: `${getSyntheticsPolicy(agentFullPolicy)?.streams?.[2]?.id}`, diff --git a/x-pack/test/functional_synthetics/services/uptime/synthetics_package.ts b/x-pack/test/functional_synthetics/services/uptime/synthetics_package.ts index 14c7abaa57343..5b9525bf2060b 100644 --- a/x-pack/test/functional_synthetics/services/uptime/synthetics_package.ts +++ b/x-pack/test/functional_synthetics/services/uptime/synthetics_package.ts @@ -50,7 +50,7 @@ export function SyntheticsPackageProvider({ getService }: FtrProviderContext) { apiRequest = retry.try(() => { return supertest .get(INGEST_API_EPM_PACKAGES) - .query({ experimental: true }) + .query({ prerelease: true }) .set('kbn-xsrf', 'xxx') .expect(200) .catch((error) => { diff --git a/x-pack/test/licensing_plugin/plugins/test_feature_usage/tsconfig.json b/x-pack/test/licensing_plugin/plugins/test_feature_usage/tsconfig.json new file mode 100644 index 0000000000000..1c8c99611ad56 --- /dev/null +++ b/x-pack/test/licensing_plugin/plugins/test_feature_usage/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" }, + { "path": "../../../../plugins/licensing/tsconfig.json" } + ] +} diff --git a/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/tsconfig.json b/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/tsconfig.json new file mode 100644 index 0000000000000..9925e88e82877 --- /dev/null +++ b/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" } + ] +} diff --git a/x-pack/test/plugin_api_integration/plugins/event_log/tsconfig.json b/x-pack/test/plugin_api_integration/plugins/event_log/tsconfig.json new file mode 100644 index 0000000000000..1eb7ab3f254cb --- /dev/null +++ b/x-pack/test/plugin_api_integration/plugins/event_log/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" }, + { "path": "../../../../plugins/event_log/tsconfig.json" } + ] +} diff --git a/x-pack/test/plugin_api_integration/plugins/feature_usage_test/tsconfig.json b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/tsconfig.json new file mode 100644 index 0000000000000..3c7a74893c545 --- /dev/null +++ b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" }, + { "path": "../../../../plugins/licensing/tsconfig.json" }, + ] +} diff --git a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/server/init_routes.ts b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/server/init_routes.ts index d44ace998e1e5..80da1e13712d2 100644 --- a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/server/init_routes.ts +++ b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/server/init_routes.ts @@ -374,4 +374,25 @@ export function initRoutes( } } ); + + router.get( + { + path: '/api/registered_tasks', + validate: {}, + }, + async ( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> => { + try { + const tm = await taskManagerStart; + return res.ok({ + body: tm.getRegisteredTypes(), + }); + } catch (err) { + return res.badRequest({ body: err }); + } + } + ); } diff --git a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/tsconfig.json b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/tsconfig.json new file mode 100644 index 0000000000000..0bbd4f56f7ce6 --- /dev/null +++ b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" }, + { "path": "../../../../plugins/task_manager/tsconfig.json" }, + ] +} diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/background_task_utilization_route.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/background_task_utilization_route.ts new file mode 100644 index 0000000000000..18314fe94fe44 --- /dev/null +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/background_task_utilization_route.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 url from 'url'; +import supertest from 'supertest'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +interface MonitoringStats { + last_update: string; + status: string; + stats: { + timestamp: string; + value: { + adhoc: { + created: { + counter: number; + }; + ran: { + service_time: { + actual: number; + adjusted: number; + task_counter: number; + }; + }; + }; + recurring: { + tasks_per_min: number; + ran: { + service_time: { + actual: number; + adjusted: number; + task_counter: number; + }; + }; + }; + }; + }; +} + +export default function ({ getService }: FtrProviderContext) { + const config = getService('config'); + const retry = getService('retry'); + const request = supertest(url.format(config.get('servers.kibana'))); + + const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + + function getUtilizationRequest() { + return request + .get('/internal/task_manager/_background_task_utilization') + .set('kbn-xsrf', 'foo'); + } + + function getUtilization(): Promise<MonitoringStats> { + return getUtilizationRequest() + .expect(200) + .then((response) => response.body); + } + + function getBackgroundTaskUtilization(): Promise<MonitoringStats> { + return retry.try(async () => { + const utilization = await getUtilization(); + + if (utilization.stats) { + return utilization; + } + + await delay(500); + throw new Error('Stats have not run yet'); + }); + } + + describe('background task utilization', () => { + it('should return the task manager background task utilization for recurring stats', async () => { + const { + value: { + // eslint-disable-next-line @typescript-eslint/naming-convention + recurring: { tasks_per_min, ran }, + }, + } = (await getBackgroundTaskUtilization()).stats; + const serviceTime = ran.service_time; + expect(typeof tasks_per_min).to.eql('number'); + + expect(typeof serviceTime.actual).to.eql('number'); + expect(typeof serviceTime.adjusted).to.eql('number'); + expect(typeof serviceTime.task_counter).to.eql('number'); + }); + + it('should return the task manager background task utilization for adhoc stats', async () => { + const { + value: { + adhoc: { created, ran }, + }, + } = (await getBackgroundTaskUtilization()).stats; + const serviceTime = ran.service_time; + expect(typeof created.counter).to.eql('number'); + + expect(typeof serviceTime.actual).to.eql('number'); + expect(typeof serviceTime.adjusted).to.eql('number'); + expect(typeof serviceTime.task_counter).to.eql('number'); + }); + }); +} diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts new file mode 100644 index 0000000000000..518d36bbdc9a5 --- /dev/null +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts @@ -0,0 +1,137 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { Response as SupertestResponse } from 'supertest'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + + function getRegisteredTypes() { + return supertest + .get(`/api/registered_tasks`) + .expect(200) + .then((response: SupertestResponse) => response.body); + } + + const TEST_TYPES = [ + 'sampleOneTimeTaskTimingOut', + 'sampleRecurringTaskTimingOut', + 'sampleRecurringTaskWhichHangs', + 'sampleTask', + 'sampleTaskWithLimitedConcurrency', + 'sampleTaskWithSingleConcurrency', + 'singleAttemptSampleTask', + 'taskWhichExecutesOtherTasksEphemerally', + 'timedTask', + 'timedTaskWithLimitedConcurrency', + 'timedTaskWithSingleConcurrency', + ]; + + // This test is meant to fail when any change is made in task manager registered types. + // The intent is to trigger a code review from the Response Ops team to review the new task type changes. + describe('check_registered_task_types', () => { + it('should check changes on all registered task types', async () => { + const types = (await getRegisteredTypes()) + .filter((t: string) => !TEST_TYPES.includes(t)) + .sort(); + expect(types).to.eql([ + 'Fleet-Usage-Logger', + 'Fleet-Usage-Sender', + 'ML:saved-objects-sync', + 'UPTIME:SyntheticsService:Sync-Saved-Monitor-Objects', + 'actions:.cases-webhook', + 'actions:.email', + 'actions:.index', + 'actions:.jira', + 'actions:.opsgenie', + 'actions:.pagerduty', + 'actions:.resilient', + 'actions:.server-log', + 'actions:.servicenow', + 'actions:.servicenow-itom', + 'actions:.servicenow-sir', + 'actions:.slack', + 'actions:.swimlane', + 'actions:.teams', + 'actions:.webhook', + 'actions:.xmatters', + 'actions_telemetry', + 'alerting:.es-query', + 'alerting:.geo-containment', + 'alerting:.index-threshold', + 'alerting:apm.anomaly', + 'alerting:apm.error_rate', + 'alerting:apm.transaction_duration', + 'alerting:apm.transaction_error_rate', + 'alerting:logs.alert.document.count', + 'alerting:metrics.alert.anomaly', + 'alerting:metrics.alert.inventory.threshold', + 'alerting:metrics.alert.threshold', + 'alerting:monitoring_alert_cluster_health', + 'alerting:monitoring_alert_cpu_usage', + 'alerting:monitoring_alert_disk_usage', + 'alerting:monitoring_alert_elasticsearch_version_mismatch', + 'alerting:monitoring_alert_jvm_memory_usage', + 'alerting:monitoring_alert_kibana_version_mismatch', + 'alerting:monitoring_alert_license_expiration', + 'alerting:monitoring_alert_logstash_version_mismatch', + 'alerting:monitoring_alert_missing_monitoring_data', + 'alerting:monitoring_alert_nodes_changed', + 'alerting:monitoring_alert_thread_pool_search_rejections', + 'alerting:monitoring_alert_thread_pool_write_rejections', + 'alerting:monitoring_ccr_read_exceptions', + 'alerting:monitoring_shard_size', + 'alerting:siem.eqlRule', + 'alerting:siem.indicatorRule', + 'alerting:siem.mlRule', + 'alerting:siem.newTermsRule', + 'alerting:siem.notifications', + 'alerting:siem.queryRule', + 'alerting:siem.savedQueryRule', + 'alerting:siem.thresholdRule', + 'alerting:transform_health', + 'alerting:xpack.ml.anomaly_detection_alert', + 'alerting:xpack.ml.anomaly_detection_jobs_health', + 'alerting:xpack.uptime.alerts.durationAnomaly', + 'alerting:xpack.uptime.alerts.monitorStatus', + 'alerting:xpack.uptime.alerts.tls', + 'alerting:xpack.uptime.alerts.tlsCertificate', + 'alerting_health_check', + 'alerting_telemetry', + 'alerts_invalidate_api_keys', + 'apm-telemetry-task', + 'cases-telemetry-task', + 'cleanup_failed_action_executions', + 'cloud_security_posture-stats_task', + 'dashboard_telemetry', + 'endpoint:metadata-check-transforms-task', + 'endpoint:user-artifact-packager', + 'fleet:check-deleted-files-task', + 'fleet:reassign_action:retry', + 'fleet:unenroll_action:retry', + 'fleet:update_agent_tags:retry', + 'fleet:upgrade_action:retry', + 'osquery:telemetry-configs', + 'osquery:telemetry-packs', + 'osquery:telemetry-saved-queries', + 'report:execute', + 'reports:monitor', + 'security:endpoint-diagnostics', + 'security:endpoint-meta-telemetry', + 'security:telemetry-configuration', + 'security:telemetry-detection-rules', + 'security:telemetry-filterlist-artifact', + 'security:telemetry-lists', + 'security:telemetry-prebuilt-rule-alerts', + 'security:telemetry-timelines', + 'session_cleanup', + ]); + }); + }); +} diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/index.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/index.ts index 2712069008598..e0a31a0f72fe8 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/index.ts +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/index.ts @@ -9,10 +9,12 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('task_manager', function taskManagerSuite() { + loadTestFile(require.resolve('./background_task_utilization_route')); loadTestFile(require.resolve('./health_route')); loadTestFile(require.resolve('./task_management')); loadTestFile(require.resolve('./task_management_scheduled_at')); loadTestFile(require.resolve('./task_management_removed_types')); + loadTestFile(require.resolve('./check_registered_task_types')); loadTestFile(require.resolve('./migrations')); }); diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management.ts index 9eb23f62e06fe..1c130e332fbc0 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management.ts +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management.ts @@ -54,6 +54,7 @@ export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const testHistoryIndex = '.kibana_task_manager_test_result'; + // FLAKY: https://github.com/elastic/kibana/issues/141055 describe('scheduling and running tasks', () => { beforeEach(async () => { // clean up before each test @@ -337,9 +338,9 @@ export default function ({ getService }: FtrProviderContext) { await retry.try(async () => { const scheduledTask = await currentTask(task.id); - expect(scheduledTask.attempts).to.be.greaterThan(0); + expect(scheduledTask.attempts).to.be.greaterThan(1); expect(Date.parse(scheduledTask.runAt)).to.be.greaterThan( - Date.parse(task.runAt) + 5 * 60 * 1000 + Date.parse(task.runAt) + 30 * 1000 ); }); }); @@ -656,11 +657,13 @@ export default function ({ getService }: FtrProviderContext) { expect(task.enabled).to.eql(true); }); - // disable the task - await bulkDisable([scheduledTask.id]); - await retry.try(async () => { + // disable the task + await bulkDisable([scheduledTask.id]); const task = await currentTask(scheduledTask.id); + log.debug( + `bulkDisable:task(${scheduledTask.id}) enabled: ${task.enabled}, when runSoon = true` + ); expect(task.enabled).to.eql(false); }); @@ -671,6 +674,9 @@ export default function ({ getService }: FtrProviderContext) { const task = await currentTask(scheduledTask.id); expect(task.enabled).to.eql(true); + log.debug( + `bulkEnable:task(${scheduledTask.id}) enabled: ${task.enabled}, when runSoon = true` + ); expect(Date.parse(task.scheduledAt)).to.be.greaterThan( Date.parse(scheduledTask.scheduledAt) ); @@ -699,6 +705,9 @@ export default function ({ getService }: FtrProviderContext) { let disabledTask: SerializedConcreteTaskInstance; await retry.try(async () => { disabledTask = await currentTask(scheduledTask.id); + log.debug( + `bulkDisable:task(${scheduledTask.id}) enabled: ${disabledTask.enabled}, when runSoon = false` + ); expect(disabledTask.enabled).to.eql(false); }); @@ -707,7 +716,9 @@ export default function ({ getService }: FtrProviderContext) { await retry.try(async () => { const task = await currentTask(scheduledTask.id); - + log.debug( + `bulkEnable:task(${scheduledTask.id}) enabled: ${task.enabled}, when runSoon = true` + ); expect(task.enabled).to.eql(true); expect(Date.parse(task.scheduledAt)).to.eql(Date.parse(disabledTask.scheduledAt)); }); diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/tsconfig.json b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/tsconfig.json new file mode 100644 index 0000000000000..0bbd4f56f7ce6 --- /dev/null +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" }, + { "path": "../../../../plugins/task_manager/tsconfig.json" }, + ] +} diff --git a/x-pack/test/plugin_functional/plugins/global_search_test/tsconfig.json b/x-pack/test/plugin_functional/plugins/global_search_test/tsconfig.json new file mode 100644 index 0000000000000..cf8ae37666cca --- /dev/null +++ b/x-pack/test/plugin_functional/plugins/global_search_test/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" }, + { "path": "../../../../plugins/global_search/tsconfig.json" }, + ] +} diff --git a/x-pack/test/plugin_functional/plugins/resolver_test/tsconfig.json b/x-pack/test/plugin_functional/plugins/resolver_test/tsconfig.json new file mode 100644 index 0000000000000..9034d94a86b7b --- /dev/null +++ b/x-pack/test/plugin_functional/plugins/resolver_test/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" }, + { "path": "../../../../../src/plugins/kibana_react/tsconfig.json" }, + { "path": "../../../../plugins/security_solution/tsconfig.json" }, + ] +} diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap b/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap index 43649d0ed7552..73c7a6ef4b542 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap +++ b/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap @@ -1,5 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Reporting APIs CSV Generation from SearchSource _id field is a big integer passes through the value without mutation 1`] = ` +"\\"_id\\",\\"_index\\",\\"_score\\",\\"message_type\\",timestamp +202209071000000604,\\"test_elastic\\",\\"-\\",OP,\\"Jan 1, 2020 @ 11:00:00.000\\" +202209071000000605,\\"test_elastic\\",\\"-\\",OP,\\"Jan 1, 2020 @ 11:00:00.000\\" +202209071000000606,\\"test_elastic\\",\\"-\\",OP,\\"Jan 1, 2020 @ 11:00:00.000\\" +202209071000000607,\\"test_elastic\\",\\"-\\",OP,\\"Jan 1, 2020 @ 11:00:00.000\\" +" +`; + exports[`Reporting APIs CSV Generation from SearchSource date formatting With filters and timebased data, default to UTC 1`] = ` "\\"@timestamp\\",clientip,extension \\"Sep 20, 2015 @ 10:26:48.725\\",\\"74.214.76.90\\",jpg diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/download_csv_dashboard.ts b/x-pack/test/reporting_api_integration/reporting_and_security/download_csv_dashboard.ts index 922ff565b4e29..3941037733c70 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/download_csv_dashboard.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/download_csv_dashboard.ts @@ -394,6 +394,85 @@ export default function ({ getService }: FtrProviderContext) { }); }); + describe('_id field is a big integer', () => { + before(async () => { + await Promise.all([ + esArchiver.load('x-pack/test/functional/es_archives/reporting/big_int_id_field'), + kibanaServer.importExport.load( + 'x-pack/test/functional/fixtures/kbn_archiver/reporting/big_int_id_field' + ), + ]); + }); + + after(async () => { + await Promise.all([ + esArchiver.unload('x-pack/test/functional/es_archives/reporting/big_int_id_field'), + kibanaServer.importExport.unload( + 'x-pack/test/functional/fixtures/kbn_archiver/reporting/big_int_id_field' + ), + ]); + }); + it('passes through the value without mutation', async () => { + const { text } = (await generateAPI.getCSVFromSearchSource( + getMockJobParams({ + browserTimezone: 'UTC', + version: '8.6.0', + searchSource: { + query: { query: '', language: 'kuery' }, + fields: [{ field: '*', include_unmapped: 'true' }], + index: 'c424ce04-f440-4f48-aa0c-534da84d06f6', + sort: [{ timestamp: 'desc' }], + filter: [ + { + meta: { + index: 'c424ce04-f440-4f48-aa0c-534da84d06f6', + params: {}, + field: 'timestamp', + }, + query: { + range: { + timestamp: { + format: 'strict_date_optional_time', + gte: '2007-10-25T21:18:23.905Z', + lte: '2022-10-30T00:00:00.000Z', + }, + }, + }, + }, + ], + parent: { + query: { query: '', language: 'kuery' }, + filter: [], + parent: { + filter: [ + { + meta: { + index: 'c424ce04-f440-4f48-aa0c-534da84d06f6', + params: {}, + field: 'timestamp', + }, + query: { + range: { + timestamp: { + format: 'strict_date_optional_time', + gte: '2007-10-25T21:18:23.905Z', + lte: '2022-10-30T00:00:00.000Z', + }, + }, + }, + }, + ], + }, + }, + }, + columns: [], + title: 'testsearch', + }) + )) as supertest.Response; + expectSnapshot(text).toMatch(); + }); + }); + describe('validation', () => { it('Return a 404', async () => { const { body } = (await generateAPI.getCSVFromSearchSource( diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/ilm_migration_apis.ts b/x-pack/test/reporting_api_integration/reporting_and_security/ilm_migration_apis.ts index 3a360ca0a1f5c..db131130f40ea 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/ilm_migration_apis.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/ilm_migration_apis.ts @@ -64,15 +64,16 @@ export default function ({ getService }: FtrProviderContext) { await runMigrate(); // ensure that the ILM policy exists for the first test }); - after(async () => { - await reportingAPI.teardownLogs(); - }); - afterEach(async () => { await reportingAPI.deleteAllReports(); await runMigrate(); // ensure that the ILM policy exists }); + after(async () => { + await reportingAPI.teardownLogs(); + await reportingAPI.makeAllReportingIndicesUnmanaged(); // ensure that a delete phase does not remove the index while future tests are running + }); + it('detects when no migration is needed', async () => { expect( await reportingAPI.checkIlmMigrationStatus( diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/validation.ts b/x-pack/test/reporting_api_integration/reporting_and_security/validation.ts index aafd24b7a08e2..dfd75d2e65248 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/validation.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/validation.ts @@ -27,8 +27,7 @@ export default function ({ getService }: FtrProviderContext) { } }; - // Failing: See https://github.com/elastic/kibana/issues/143717 - describe.skip('Job parameter validation', () => { + describe('Job parameter validation', () => { before(async () => { await reportingAPI.initEcommerce(); }); diff --git a/x-pack/test/rule_registry/spaces_only/tests/trial/lifecycle_executor.ts b/x-pack/test/rule_registry/spaces_only/tests/trial/lifecycle_executor.ts index dcad92db0d36a..66a6605d1d20c 100644 --- a/x-pack/test/rule_registry/spaces_only/tests/trial/lifecycle_executor.ts +++ b/x-pack/test/rule_registry/spaces_only/tests/trial/lifecycle_executor.ts @@ -49,6 +49,7 @@ export default function createLifecycleExecutorApiTest({ getService }: FtrProvid fatal: fakeLogger, log: sinon.stub(), get: sinon.stub(), + isLevelEnabled: sinon.stub(), } as Logger; const getClusterClient = () => { diff --git a/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts b/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts index 41b337ed6a8c2..e0c1f162371ce 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts @@ -69,9 +69,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await listingTable.expectItemsCount('dashboard', 2); const itemNames = await listingTable.getAllItemsNames(); - expect(itemNames).to.eql([ - 'dashboard 4 with real data (tag-1)', + expect(itemNames.sort()).to.eql([ 'dashboard 3 (tag-1 and tag-3)', + 'dashboard 4 with real data (tag-1)', ]); }); @@ -80,7 +80,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await listingTable.expectItemsCount('dashboard', 2); const itemNames = await listingTable.getAllItemsNames(); - expect(itemNames).to.eql(['dashboard 2 (tag-3)', 'dashboard 3 (tag-1 and tag-3)']); + expect(itemNames.sort()).to.eql(['dashboard 2 (tag-3)', 'dashboard 3 (tag-1 and tag-3)']); }); it('allows to filter by multiple tags', async () => { @@ -88,7 +88,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await listingTable.expectItemsCount('dashboard', 3); const itemNames = await listingTable.getAllItemsNames(); - expect(itemNames).to.eql([ + expect(itemNames.sort()).to.eql([ 'dashboard 1 (tag-2)', 'dashboard 2 (tag-3)', 'dashboard 3 (tag-1 and tag-3)', diff --git a/x-pack/test/security_solution_cypress/config.ts b/x-pack/test/security_solution_cypress/config.ts index e77ab1fe4d489..18d7577516fd9 100644 --- a/x-pack/test/security_solution_cypress/config.ts +++ b/x-pack/test/security_solution_cypress/config.ts @@ -49,7 +49,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { // See https://github.com/elastic/kibana/pull/125396 for details '--xpack.alerting.rules.minimumScheduleInterval.value=1s', '--xpack.ruleRegistry.unsafe.legacyMultiTenancy.enabled=true', - `--xpack.securitySolution.enableExperimental=${JSON.stringify([])}`, + `--xpack.securitySolution.enableExperimental=${JSON.stringify([ + 'alertDetailsPageEnabled', + ])}`, `--home.disableWelcomeScreen=true`, ], }, diff --git a/x-pack/test/security_solution_cypress/es_archives/risk_users/data.json b/x-pack/test/security_solution_cypress/es_archives/risk_users/data.json index dc182e631df99..b513f934aac6b 100644 --- a/x-pack/test/security_solution_cypress/es_archives/risk_users/data.json +++ b/x-pack/test/security_solution_cypress/es_archives/risk_users/data.json @@ -179,7 +179,7 @@ "id": "a4cf452c1e0375c3d4412cb550bd1783358468b3123314829d72c7df6fb74", "index": "ml_user_risk_score_latest_default", "source": { - "@timestamp": "2021-03-10T14:51:05.766Z", + "@timestamp": "2021-03-10T14:52:05.766Z", "user": { "name": "test", "risk": { diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_solution_integrations.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_solution_integrations.ts index 01c20030d2b85..314f8bcebd6dc 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_solution_integrations.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_solution_integrations.ts @@ -9,6 +9,7 @@ import { IndexedHostsAndAlertsResponse } from '@kbn/security-solution-plugin/com import { TimelineResponse } from '@kbn/security-solution-plugin/common/types'; import { kibanaPackageJson } from '@kbn/utils'; import { FtrProviderContext } from '../../ftr_provider_context'; +import { IndexedEndpointRuleAlerts } from '../../../security_solution_ftr/services/detections'; /** * Test suite is meant to cover usages of endpoint functionality or access to endpoint @@ -22,9 +23,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const testSubjects = getService('testSubjects'); const pageObjects = getPageObjects(['common', 'timeline']); - // FLAKY: https://github.com/elastic/kibana/issues/140701 - describe.skip('App level Endpoint functionality', () => { + describe('App level Endpoint functionality', () => { let indexedData: IndexedHostsAndAlertsResponse; + let indexedAlerts: IndexedEndpointRuleAlerts; let endpointAgentId: string; before(async () => { @@ -37,14 +38,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await endpointService.waitForUnitedEndpoints([endpointAgentId]); - // Ensure our Endpoint is for v8.0 (or whatever is running in kibana now) + // Ensure our Endpoint is for current version of kibana await endpointService.sendEndpointMetadataUpdate(endpointAgentId, { agent: { version: kibanaPackageJson.version }, }); - // start/stop the endpoint rule. This should cause the rule to run immediately - // and avoid us having to wait for the interval (of 5 minutes) - await detectionsTestService.stopStartEndpointRule(); + // Load alerts for our endpoint (so that we don't have to wait for the rule to run) + indexedAlerts = await detectionsTestService.loadEndpointRuleAlerts(endpointAgentId); }); after(async () => { @@ -52,6 +52,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { log.info('Cleaning up loaded endpoint data'); await endpointService.unloadEndpointData(indexedData); } + + if (indexedAlerts) { + await indexedAlerts.cleanup(); + } }); describe('from Timeline', () => { diff --git a/x-pack/test/security_solution_ftr/services/detections/alerts_security_index_mappings.ts b/x-pack/test/security_solution_ftr/services/detections/alerts_security_index_mappings.ts new file mode 100644 index 0000000000000..40aefa6093384 --- /dev/null +++ b/x-pack/test/security_solution_ftr/services/detections/alerts_security_index_mappings.ts @@ -0,0 +1,5366 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + IndexName, + IndicesAlias, + IndicesIndexSettings, + MappingTypeMapping, + Name, +} from '@elastic/elasticsearch/lib/api/types'; + +interface IndexMappings { + type: string; + value: { + index: IndexName; + aliases: Record<Name, IndicesAlias>; + mappings: MappingTypeMapping; + settings: IndicesIndexSettings; + }; +} + +export const getAlertsIndexMappings = (): IndexMappings => { + // Mapping below was generated by running `esArchiver()`: + // node ./scripts/es_archiver.js save ~/tmp/es_archive_alerts .internal.alerts-security.alerts-default-* + + return { + type: 'index', + value: { + aliases: { + '.alerts-security.alerts-default': { + is_write_index: true, + }, + '.siem-signals-default': { + is_write_index: false, + }, + }, + index: '.internal.alerts-security.alerts-default-000001', + mappings: { + _meta: { + kibana: { + version: '8.6.0', + }, + namespace: 'default', + }, + dynamic: 'false', + properties: { + '@timestamp': { + type: 'date', + }, + agent: { + properties: { + build: { + properties: { + original: { + type: 'keyword', + }, + }, + }, + ephemeral_id: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + client: { + properties: { + address: { + type: 'keyword', + }, + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + bytes: { + type: 'long', + }, + domain: { + type: 'keyword', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + nat: { + properties: { + ip: { + type: 'ip', + }, + port: { + type: 'long', + }, + }, + }, + packets: { + type: 'long', + }, + port: { + type: 'long', + }, + registered_domain: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + user: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + }, + }, + cloud: { + properties: { + account: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + availability_zone: { + type: 'keyword', + }, + instance: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + machine: { + properties: { + type: { + type: 'keyword', + }, + }, + }, + origin: { + properties: { + account: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + availability_zone: { + type: 'keyword', + }, + instance: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + machine: { + properties: { + type: { + type: 'keyword', + }, + }, + }, + project: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + provider: { + type: 'keyword', + }, + region: { + type: 'keyword', + }, + service: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + project: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + provider: { + type: 'keyword', + }, + region: { + type: 'keyword', + }, + service: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + target: { + properties: { + account: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + availability_zone: { + type: 'keyword', + }, + instance: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + machine: { + properties: { + type: { + type: 'keyword', + }, + }, + }, + project: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + provider: { + type: 'keyword', + }, + region: { + type: 'keyword', + }, + service: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + }, + }, + container: { + properties: { + id: { + type: 'keyword', + }, + image: { + properties: { + name: { + type: 'keyword', + }, + tag: { + type: 'keyword', + }, + }, + }, + labels: { + type: 'object', + }, + name: { + type: 'keyword', + }, + runtime: { + type: 'keyword', + }, + }, + }, + destination: { + properties: { + address: { + type: 'keyword', + }, + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + bytes: { + type: 'long', + }, + domain: { + type: 'keyword', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + nat: { + properties: { + ip: { + type: 'ip', + }, + port: { + type: 'long', + }, + }, + }, + packets: { + type: 'long', + }, + port: { + type: 'long', + }, + registered_domain: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + user: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + }, + }, + dll: { + properties: { + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + name: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + }, + }, + dns: { + properties: { + answers: { + properties: { + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + ttl: { + type: 'long', + }, + type: { + type: 'keyword', + }, + }, + }, + header_flags: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + op_code: { + type: 'keyword', + }, + question: { + properties: { + class: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + registered_domain: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + }, + resolved_ip: { + type: 'ip', + }, + response_code: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + }, + ecs: { + properties: { + version: { + type: 'keyword', + }, + }, + }, + error: { + properties: { + code: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + message: { + type: 'match_only_text', + }, + stack_trace: { + type: 'wildcard', + }, + type: { + type: 'keyword', + }, + }, + }, + event: { + properties: { + action: { + type: 'keyword', + }, + agent_id_status: { + type: 'keyword', + }, + category: { + type: 'keyword', + }, + code: { + type: 'keyword', + }, + created: { + type: 'date', + }, + dataset: { + type: 'keyword', + }, + duration: { + type: 'long', + }, + end: { + type: 'date', + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + ingested: { + type: 'date', + }, + kind: { + type: 'keyword', + }, + module: { + type: 'keyword', + }, + original: { + type: 'keyword', + }, + outcome: { + type: 'keyword', + }, + provider: { + type: 'keyword', + }, + reason: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + risk_score: { + type: 'float', + }, + risk_score_norm: { + type: 'float', + }, + sequence: { + type: 'long', + }, + severity: { + type: 'long', + }, + start: { + type: 'date', + }, + timezone: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + url: { + type: 'keyword', + }, + }, + }, + faas: { + properties: { + coldstart: { + type: 'boolean', + }, + execution: { + type: 'keyword', + }, + trigger: { + properties: { + request_id: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + }, + }, + file: { + properties: { + accessed: { + type: 'date', + }, + attributes: { + type: 'keyword', + }, + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + created: { + type: 'date', + }, + ctime: { + type: 'date', + }, + device: { + type: 'keyword', + }, + directory: { + type: 'keyword', + }, + drive_letter: { + type: 'keyword', + }, + elf: { + properties: { + architecture: { + type: 'keyword', + }, + byte_order: { + type: 'keyword', + }, + cpu_type: { + type: 'keyword', + }, + creation_date: { + type: 'date', + }, + exports: { + type: 'flattened', + }, + header: { + properties: { + abi_version: { + type: 'keyword', + }, + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + entrypoint: { + type: 'long', + }, + object_version: { + type: 'keyword', + }, + os_abi: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + imports: { + type: 'flattened', + }, + sections: { + properties: { + chi2: { + type: 'long', + }, + entropy: { + type: 'long', + }, + flags: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + physical_offset: { + type: 'keyword', + }, + physical_size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + virtual_address: { + type: 'long', + }, + virtual_size: { + type: 'long', + }, + }, + type: 'nested', + }, + segments: { + properties: { + sections: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + shared_libraries: { + type: 'keyword', + }, + telfhash: { + type: 'keyword', + }, + }, + }, + extension: { + type: 'keyword', + }, + fork_name: { + type: 'keyword', + }, + gid: { + type: 'keyword', + }, + group: { + type: 'keyword', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + inode: { + type: 'keyword', + }, + mime_type: { + type: 'keyword', + }, + mode: { + type: 'keyword', + }, + mtime: { + type: 'date', + }, + name: { + type: 'keyword', + }, + owner: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + size: { + type: 'long', + }, + target_path: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + uid: { + type: 'keyword', + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + host: { + properties: { + architecture: { + type: 'keyword', + }, + boot: { + properties: { + id: { + type: 'keyword', + }, + }, + }, + cpu: { + properties: { + usage: { + scaling_factor: 1000, + type: 'scaled_float', + }, + }, + }, + disk: { + properties: { + read: { + properties: { + bytes: { + type: 'long', + }, + }, + }, + write: { + properties: { + bytes: { + type: 'long', + }, + }, + }, + }, + }, + domain: { + type: 'keyword', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + hostname: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + network: { + properties: { + egress: { + properties: { + bytes: { + type: 'long', + }, + packets: { + type: 'long', + }, + }, + }, + ingress: { + properties: { + bytes: { + type: 'long', + }, + packets: { + type: 'long', + }, + }, + }, + }, + }, + os: { + properties: { + family: { + type: 'keyword', + }, + full: { + type: 'keyword', + }, + kernel: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + platform: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + pid_ns_ino: { + type: 'keyword', + }, + risk: { + properties: { + calculated_level: { + type: 'keyword', + }, + calculated_score: { + type: 'float', + }, + calculated_score_norm: { + type: 'float', + }, + static_level: { + type: 'keyword', + }, + static_score: { + type: 'float', + }, + static_score_norm: { + type: 'float', + }, + }, + }, + type: { + type: 'keyword', + }, + uptime: { + type: 'long', + }, + }, + }, + http: { + properties: { + request: { + properties: { + body: { + properties: { + bytes: { + type: 'long', + }, + content: { + type: 'wildcard', + }, + }, + }, + bytes: { + type: 'long', + }, + id: { + type: 'keyword', + }, + method: { + type: 'keyword', + }, + mime_type: { + type: 'keyword', + }, + referrer: { + type: 'keyword', + }, + }, + }, + response: { + properties: { + body: { + properties: { + bytes: { + type: 'long', + }, + content: { + type: 'wildcard', + }, + }, + }, + bytes: { + type: 'long', + }, + mime_type: { + type: 'keyword', + }, + status_code: { + type: 'long', + }, + }, + }, + version: { + type: 'keyword', + }, + }, + }, + kibana: { + properties: { + alert: { + properties: { + action_group: { + type: 'keyword', + }, + ancestors: { + properties: { + depth: { + type: 'long', + }, + id: { + type: 'keyword', + }, + index: { + type: 'keyword', + }, + rule: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + }, + building_block_type: { + type: 'keyword', + }, + depth: { + type: 'long', + }, + duration: { + properties: { + us: { + type: 'long', + }, + }, + }, + end: { + type: 'date', + }, + group: { + properties: { + id: { + type: 'keyword', + }, + index: { + type: 'integer', + }, + }, + }, + instance: { + properties: { + id: { + type: 'keyword', + }, + }, + }, + new_terms: { + type: 'keyword', + }, + original_event: { + properties: { + action: { + type: 'keyword', + }, + agent_id_status: { + type: 'keyword', + }, + category: { + type: 'keyword', + }, + code: { + type: 'keyword', + }, + created: { + type: 'date', + }, + dataset: { + type: 'keyword', + }, + duration: { + type: 'keyword', + }, + end: { + type: 'date', + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + ingested: { + type: 'date', + }, + kind: { + type: 'keyword', + }, + module: { + type: 'keyword', + }, + original: { + type: 'keyword', + }, + outcome: { + type: 'keyword', + }, + provider: { + type: 'keyword', + }, + reason: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + risk_score: { + type: 'float', + }, + risk_score_norm: { + type: 'float', + }, + sequence: { + type: 'long', + }, + severity: { + type: 'long', + }, + start: { + type: 'date', + }, + timezone: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + url: { + type: 'keyword', + }, + }, + }, + original_time: { + type: 'date', + }, + reason: { + type: 'keyword', + }, + risk_score: { + type: 'float', + }, + rule: { + properties: { + author: { + type: 'keyword', + }, + building_block_type: { + type: 'keyword', + }, + category: { + type: 'keyword', + }, + consumer: { + type: 'keyword', + }, + created_at: { + type: 'date', + }, + created_by: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + enabled: { + type: 'keyword', + }, + exceptions_list: { + type: 'object', + }, + execution: { + properties: { + uuid: { + type: 'keyword', + }, + }, + }, + false_positives: { + type: 'keyword', + }, + from: { + type: 'keyword', + }, + immutable: { + type: 'keyword', + }, + interval: { + type: 'keyword', + }, + license: { + type: 'keyword', + }, + max_signals: { + type: 'long', + }, + name: { + type: 'keyword', + }, + note: { + type: 'keyword', + }, + parameters: { + ignore_above: 4096, + type: 'flattened', + }, + producer: { + type: 'keyword', + }, + references: { + type: 'keyword', + }, + rule_id: { + type: 'keyword', + }, + rule_name_override: { + type: 'keyword', + }, + rule_type_id: { + type: 'keyword', + }, + tags: { + type: 'keyword', + }, + threat: { + properties: { + framework: { + type: 'keyword', + }, + tactic: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + }, + }, + technique: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + subtechnique: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + }, + }, + }, + }, + }, + }, + timeline_id: { + type: 'keyword', + }, + timeline_title: { + type: 'keyword', + }, + timestamp_override: { + type: 'keyword', + }, + to: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + updated_at: { + type: 'date', + }, + updated_by: { + type: 'keyword', + }, + uuid: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + severity: { + type: 'keyword', + }, + start: { + type: 'date', + }, + status: { + type: 'keyword', + }, + system_status: { + type: 'keyword', + }, + threshold_result: { + properties: { + cardinality: { + properties: { + field: { + type: 'keyword', + }, + value: { + type: 'long', + }, + }, + }, + count: { + type: 'long', + }, + from: { + type: 'date', + }, + terms: { + properties: { + field: { + type: 'keyword', + }, + value: { + type: 'keyword', + }, + }, + }, + }, + }, + time_range: { + format: 'epoch_millis||strict_date_optional_time', + type: 'date_range', + }, + uuid: { + type: 'keyword', + }, + workflow_reason: { + type: 'keyword', + }, + workflow_status: { + type: 'keyword', + }, + workflow_user: { + type: 'keyword', + }, + }, + }, + space_ids: { + type: 'keyword', + }, + version: { + type: 'version', + }, + }, + }, + labels: { + type: 'object', + }, + log: { + properties: { + file: { + properties: { + path: { + type: 'keyword', + }, + }, + }, + level: { + type: 'keyword', + }, + logger: { + type: 'keyword', + }, + origin: { + properties: { + file: { + properties: { + line: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }, + function: { + type: 'keyword', + }, + }, + }, + syslog: { + properties: { + facility: { + properties: { + code: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }, + priority: { + type: 'long', + }, + severity: { + properties: { + code: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }, + }, + }, + }, + }, + message: { + type: 'match_only_text', + }, + network: { + properties: { + application: { + type: 'keyword', + }, + bytes: { + type: 'long', + }, + community_id: { + type: 'keyword', + }, + direction: { + type: 'keyword', + }, + forwarded_ip: { + type: 'ip', + }, + iana_number: { + type: 'keyword', + }, + inner: { + properties: { + vlan: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + }, + }, + name: { + type: 'keyword', + }, + packets: { + type: 'long', + }, + protocol: { + type: 'keyword', + }, + transport: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + vlan: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + }, + }, + observer: { + properties: { + egress: { + properties: { + interface: { + properties: { + alias: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + vlan: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + zone: { + type: 'keyword', + }, + }, + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + hostname: { + type: 'keyword', + }, + ingress: { + properties: { + interface: { + properties: { + alias: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + vlan: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + zone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + os: { + properties: { + family: { + type: 'keyword', + }, + full: { + type: 'keyword', + }, + kernel: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + platform: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + product: { + type: 'keyword', + }, + serial_number: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + vendor: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + orchestrator: { + properties: { + api_version: { + type: 'keyword', + }, + cluster: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + url: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + namespace: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + resource: { + properties: { + id: { + type: 'keyword', + }, + ip: { + type: 'ip', + }, + name: { + type: 'keyword', + }, + parent: { + properties: { + type: { + type: 'keyword', + }, + }, + }, + type: { + type: 'keyword', + }, + }, + }, + type: { + type: 'keyword', + }, + }, + }, + organization: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + package: { + properties: { + architecture: { + type: 'keyword', + }, + build_version: { + type: 'keyword', + }, + checksum: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + install_scope: { + type: 'keyword', + }, + installed: { + type: 'date', + }, + license: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + process: { + properties: { + args: { + type: 'keyword', + }, + args_count: { + type: 'long', + }, + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + command_line: { + type: 'wildcard', + }, + elf: { + properties: { + architecture: { + type: 'keyword', + }, + byte_order: { + type: 'keyword', + }, + cpu_type: { + type: 'keyword', + }, + creation_date: { + type: 'date', + }, + exports: { + type: 'flattened', + }, + header: { + properties: { + abi_version: { + type: 'keyword', + }, + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + entrypoint: { + type: 'long', + }, + object_version: { + type: 'keyword', + }, + os_abi: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + imports: { + type: 'flattened', + }, + sections: { + properties: { + chi2: { + type: 'long', + }, + entropy: { + type: 'long', + }, + flags: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + physical_offset: { + type: 'keyword', + }, + physical_size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + virtual_address: { + type: 'long', + }, + virtual_size: { + type: 'long', + }, + }, + type: 'nested', + }, + segments: { + properties: { + sections: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + shared_libraries: { + type: 'keyword', + }, + telfhash: { + type: 'keyword', + }, + }, + }, + end: { + type: 'date', + }, + entity_id: { + type: 'keyword', + }, + entry_leader: { + properties: { + entity_id: { + type: 'keyword', + }, + }, + }, + executable: { + type: 'keyword', + }, + exit_code: { + type: 'long', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + name: { + type: 'keyword', + }, + parent: { + properties: { + args: { + type: 'keyword', + }, + args_count: { + type: 'long', + }, + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + command_line: { + type: 'wildcard', + }, + elf: { + properties: { + architecture: { + type: 'keyword', + }, + byte_order: { + type: 'keyword', + }, + cpu_type: { + type: 'keyword', + }, + creation_date: { + type: 'date', + }, + exports: { + type: 'flattened', + }, + header: { + properties: { + abi_version: { + type: 'keyword', + }, + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + entrypoint: { + type: 'long', + }, + object_version: { + type: 'keyword', + }, + os_abi: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + imports: { + type: 'flattened', + }, + sections: { + properties: { + chi2: { + type: 'long', + }, + entropy: { + type: 'long', + }, + flags: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + physical_offset: { + type: 'keyword', + }, + physical_size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + virtual_address: { + type: 'long', + }, + virtual_size: { + type: 'long', + }, + }, + type: 'nested', + }, + segments: { + properties: { + sections: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + shared_libraries: { + type: 'keyword', + }, + telfhash: { + type: 'keyword', + }, + }, + }, + end: { + type: 'date', + }, + entity_id: { + type: 'keyword', + }, + executable: { + type: 'keyword', + }, + exit_code: { + type: 'long', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + name: { + type: 'keyword', + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + pgid: { + type: 'long', + }, + pid: { + type: 'long', + }, + start: { + type: 'date', + }, + thread: { + properties: { + id: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }, + title: { + type: 'keyword', + }, + uptime: { + type: 'long', + }, + working_directory: { + type: 'keyword', + }, + }, + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + pgid: { + type: 'long', + }, + pid: { + type: 'long', + }, + session_leader: { + properties: { + entity_id: { + type: 'keyword', + }, + }, + }, + start: { + type: 'date', + }, + thread: { + properties: { + id: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }, + title: { + type: 'keyword', + }, + uptime: { + type: 'long', + }, + working_directory: { + type: 'keyword', + }, + }, + }, + registry: { + properties: { + data: { + properties: { + bytes: { + type: 'keyword', + }, + strings: { + type: 'wildcard', + }, + type: { + type: 'keyword', + }, + }, + }, + hive: { + type: 'keyword', + }, + key: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + value: { + type: 'keyword', + }, + }, + }, + related: { + properties: { + hash: { + type: 'keyword', + }, + hosts: { + type: 'keyword', + }, + ip: { + type: 'ip', + }, + user: { + type: 'keyword', + }, + }, + }, + rule: { + properties: { + author: { + type: 'keyword', + }, + category: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + license: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + ruleset: { + type: 'keyword', + }, + uuid: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + server: { + properties: { + address: { + type: 'keyword', + }, + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + bytes: { + type: 'long', + }, + domain: { + type: 'keyword', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + nat: { + properties: { + ip: { + type: 'ip', + }, + port: { + type: 'long', + }, + }, + }, + packets: { + type: 'long', + }, + port: { + type: 'long', + }, + registered_domain: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + user: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + }, + }, + service: { + properties: { + address: { + type: 'keyword', + }, + environment: { + type: 'keyword', + }, + ephemeral_id: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + node: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + origin: { + properties: { + address: { + type: 'keyword', + }, + environment: { + type: 'keyword', + }, + ephemeral_id: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + node: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + state: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + state: { + type: 'keyword', + }, + target: { + properties: { + address: { + type: 'keyword', + }, + environment: { + type: 'keyword', + }, + ephemeral_id: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + node: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + state: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + signal: { + properties: { + ancestors: { + properties: { + depth: { + path: 'kibana.alert.ancestors.depth', + type: 'alias', + }, + id: { + path: 'kibana.alert.ancestors.id', + type: 'alias', + }, + index: { + path: 'kibana.alert.ancestors.index', + type: 'alias', + }, + type: { + path: 'kibana.alert.ancestors.type', + type: 'alias', + }, + }, + }, + depth: { + path: 'kibana.alert.depth', + type: 'alias', + }, + group: { + properties: { + id: { + path: 'kibana.alert.group.id', + type: 'alias', + }, + index: { + path: 'kibana.alert.group.index', + type: 'alias', + }, + }, + }, + original_event: { + properties: { + action: { + path: 'kibana.alert.original_event.action', + type: 'alias', + }, + category: { + path: 'kibana.alert.original_event.category', + type: 'alias', + }, + code: { + path: 'kibana.alert.original_event.code', + type: 'alias', + }, + created: { + path: 'kibana.alert.original_event.created', + type: 'alias', + }, + dataset: { + path: 'kibana.alert.original_event.dataset', + type: 'alias', + }, + duration: { + path: 'kibana.alert.original_event.duration', + type: 'alias', + }, + end: { + path: 'kibana.alert.original_event.end', + type: 'alias', + }, + hash: { + path: 'kibana.alert.original_event.hash', + type: 'alias', + }, + id: { + path: 'kibana.alert.original_event.id', + type: 'alias', + }, + kind: { + path: 'kibana.alert.original_event.kind', + type: 'alias', + }, + module: { + path: 'kibana.alert.original_event.module', + type: 'alias', + }, + outcome: { + path: 'kibana.alert.original_event.outcome', + type: 'alias', + }, + provider: { + path: 'kibana.alert.original_event.provider', + type: 'alias', + }, + reason: { + path: 'kibana.alert.original_event.reason', + type: 'alias', + }, + risk_score: { + path: 'kibana.alert.original_event.risk_score', + type: 'alias', + }, + risk_score_norm: { + path: 'kibana.alert.original_event.risk_score_norm', + type: 'alias', + }, + sequence: { + path: 'kibana.alert.original_event.sequence', + type: 'alias', + }, + severity: { + path: 'kibana.alert.original_event.severity', + type: 'alias', + }, + start: { + path: 'kibana.alert.original_event.start', + type: 'alias', + }, + timezone: { + path: 'kibana.alert.original_event.timezone', + type: 'alias', + }, + type: { + path: 'kibana.alert.original_event.type', + type: 'alias', + }, + }, + }, + original_time: { + path: 'kibana.alert.original_time', + type: 'alias', + }, + reason: { + path: 'kibana.alert.reason', + type: 'alias', + }, + rule: { + properties: { + author: { + path: 'kibana.alert.rule.author', + type: 'alias', + }, + building_block_type: { + path: 'kibana.alert.building_block_type', + type: 'alias', + }, + created_at: { + path: 'kibana.alert.rule.created_at', + type: 'alias', + }, + created_by: { + path: 'kibana.alert.rule.created_by', + type: 'alias', + }, + description: { + path: 'kibana.alert.rule.description', + type: 'alias', + }, + enabled: { + path: 'kibana.alert.rule.enabled', + type: 'alias', + }, + false_positives: { + path: 'kibana.alert.rule.false_positives', + type: 'alias', + }, + from: { + path: 'kibana.alert.rule.from', + type: 'alias', + }, + id: { + path: 'kibana.alert.rule.uuid', + type: 'alias', + }, + immutable: { + path: 'kibana.alert.rule.immutable', + type: 'alias', + }, + interval: { + path: 'kibana.alert.rule.interval', + type: 'alias', + }, + license: { + path: 'kibana.alert.rule.license', + type: 'alias', + }, + max_signals: { + path: 'kibana.alert.rule.max_signals', + type: 'alias', + }, + name: { + path: 'kibana.alert.rule.name', + type: 'alias', + }, + note: { + path: 'kibana.alert.rule.note', + type: 'alias', + }, + references: { + path: 'kibana.alert.rule.references', + type: 'alias', + }, + risk_score: { + path: 'kibana.alert.risk_score', + type: 'alias', + }, + rule_id: { + path: 'kibana.alert.rule.rule_id', + type: 'alias', + }, + rule_name_override: { + path: 'kibana.alert.rule.rule_name_override', + type: 'alias', + }, + severity: { + path: 'kibana.alert.severity', + type: 'alias', + }, + tags: { + path: 'kibana.alert.rule.tags', + type: 'alias', + }, + threat: { + properties: { + framework: { + path: 'kibana.alert.rule.threat.framework', + type: 'alias', + }, + tactic: { + properties: { + id: { + path: 'kibana.alert.rule.threat.tactic.id', + type: 'alias', + }, + name: { + path: 'kibana.alert.rule.threat.tactic.name', + type: 'alias', + }, + reference: { + path: 'kibana.alert.rule.threat.tactic.reference', + type: 'alias', + }, + }, + }, + technique: { + properties: { + id: { + path: 'kibana.alert.rule.threat.technique.id', + type: 'alias', + }, + name: { + path: 'kibana.alert.rule.threat.technique.name', + type: 'alias', + }, + reference: { + path: 'kibana.alert.rule.threat.technique.reference', + type: 'alias', + }, + subtechnique: { + properties: { + id: { + path: 'kibana.alert.rule.threat.technique.subtechnique.id', + type: 'alias', + }, + name: { + path: 'kibana.alert.rule.threat.technique.subtechnique.name', + type: 'alias', + }, + reference: { + path: 'kibana.alert.rule.threat.technique.subtechnique.reference', + type: 'alias', + }, + }, + }, + }, + }, + }, + }, + timeline_id: { + path: 'kibana.alert.rule.timeline_id', + type: 'alias', + }, + timeline_title: { + path: 'kibana.alert.rule.timeline_title', + type: 'alias', + }, + timestamp_override: { + path: 'kibana.alert.rule.timestamp_override', + type: 'alias', + }, + to: { + path: 'kibana.alert.rule.to', + type: 'alias', + }, + type: { + path: 'kibana.alert.rule.type', + type: 'alias', + }, + updated_at: { + path: 'kibana.alert.rule.updated_at', + type: 'alias', + }, + updated_by: { + path: 'kibana.alert.rule.updated_by', + type: 'alias', + }, + version: { + path: 'kibana.alert.rule.version', + type: 'alias', + }, + }, + }, + status: { + path: 'kibana.alert.workflow_status', + type: 'alias', + }, + threshold_result: { + properties: { + cardinality: { + properties: { + field: { + path: 'kibana.alert.threshold_result.cardinality.field', + type: 'alias', + }, + value: { + path: 'kibana.alert.threshold_result.cardinality.value', + type: 'alias', + }, + }, + }, + count: { + path: 'kibana.alert.threshold_result.count', + type: 'alias', + }, + from: { + path: 'kibana.alert.threshold_result.from', + type: 'alias', + }, + terms: { + properties: { + field: { + path: 'kibana.alert.threshold_result.terms.field', + type: 'alias', + }, + value: { + path: 'kibana.alert.threshold_result.terms.value', + type: 'alias', + }, + }, + }, + }, + }, + }, + }, + source: { + properties: { + address: { + type: 'keyword', + }, + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + bytes: { + type: 'long', + }, + domain: { + type: 'keyword', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + nat: { + properties: { + ip: { + type: 'ip', + }, + port: { + type: 'long', + }, + }, + }, + packets: { + type: 'long', + }, + port: { + type: 'long', + }, + registered_domain: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + user: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + }, + }, + span: { + properties: { + id: { + type: 'keyword', + }, + }, + }, + tags: { + type: 'keyword', + }, + threat: { + properties: { + enrichments: { + properties: { + indicator: { + properties: { + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + confidence: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + email: { + properties: { + address: { + type: 'keyword', + }, + }, + }, + file: { + properties: { + accessed: { + type: 'date', + }, + attributes: { + type: 'keyword', + }, + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + created: { + type: 'date', + }, + ctime: { + type: 'date', + }, + device: { + type: 'keyword', + }, + directory: { + type: 'keyword', + }, + drive_letter: { + type: 'keyword', + }, + elf: { + properties: { + architecture: { + type: 'keyword', + }, + byte_order: { + type: 'keyword', + }, + cpu_type: { + type: 'keyword', + }, + creation_date: { + type: 'date', + }, + exports: { + type: 'flattened', + }, + header: { + properties: { + abi_version: { + type: 'keyword', + }, + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + entrypoint: { + type: 'long', + }, + object_version: { + type: 'keyword', + }, + os_abi: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + imports: { + type: 'flattened', + }, + sections: { + properties: { + chi2: { + type: 'long', + }, + entropy: { + type: 'long', + }, + flags: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + physical_offset: { + type: 'keyword', + }, + physical_size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + virtual_address: { + type: 'long', + }, + virtual_size: { + type: 'long', + }, + }, + type: 'nested', + }, + segments: { + properties: { + sections: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + shared_libraries: { + type: 'keyword', + }, + telfhash: { + type: 'keyword', + }, + }, + }, + extension: { + type: 'keyword', + }, + fork_name: { + type: 'keyword', + }, + gid: { + type: 'keyword', + }, + group: { + type: 'keyword', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + inode: { + type: 'keyword', + }, + mime_type: { + type: 'keyword', + }, + mode: { + type: 'keyword', + }, + mtime: { + type: 'date', + }, + name: { + type: 'keyword', + }, + owner: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + size: { + type: 'long', + }, + target_path: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + uid: { + type: 'keyword', + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + first_seen: { + type: 'date', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + last_seen: { + type: 'date', + }, + marking: { + properties: { + tlp: { + type: 'keyword', + }, + }, + }, + modified_at: { + type: 'date', + }, + port: { + type: 'long', + }, + provider: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + registry: { + properties: { + data: { + properties: { + bytes: { + type: 'keyword', + }, + strings: { + type: 'wildcard', + }, + type: { + type: 'keyword', + }, + }, + }, + hive: { + type: 'keyword', + }, + key: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + value: { + type: 'keyword', + }, + }, + }, + scanner_stats: { + type: 'long', + }, + sightings: { + type: 'long', + }, + type: { + type: 'keyword', + }, + url: { + properties: { + domain: { + type: 'keyword', + }, + extension: { + type: 'keyword', + }, + fragment: { + type: 'keyword', + }, + full: { + type: 'wildcard', + }, + original: { + type: 'wildcard', + }, + password: { + type: 'keyword', + }, + path: { + type: 'wildcard', + }, + port: { + type: 'long', + }, + query: { + type: 'keyword', + }, + registered_domain: { + type: 'keyword', + }, + scheme: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + username: { + type: 'keyword', + }, + }, + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + matched: { + properties: { + atomic: { + type: 'keyword', + }, + field: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + index: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + }, + }, + type: 'nested', + }, + framework: { + type: 'keyword', + }, + group: { + properties: { + alias: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + }, + }, + indicator: { + properties: { + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + confidence: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + email: { + properties: { + address: { + type: 'keyword', + }, + }, + }, + file: { + properties: { + accessed: { + type: 'date', + }, + attributes: { + type: 'keyword', + }, + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + created: { + type: 'date', + }, + ctime: { + type: 'date', + }, + device: { + type: 'keyword', + }, + directory: { + type: 'keyword', + }, + drive_letter: { + type: 'keyword', + }, + elf: { + properties: { + architecture: { + type: 'keyword', + }, + byte_order: { + type: 'keyword', + }, + cpu_type: { + type: 'keyword', + }, + creation_date: { + type: 'date', + }, + exports: { + type: 'flattened', + }, + header: { + properties: { + abi_version: { + type: 'keyword', + }, + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + entrypoint: { + type: 'long', + }, + object_version: { + type: 'keyword', + }, + os_abi: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + imports: { + type: 'flattened', + }, + sections: { + properties: { + chi2: { + type: 'long', + }, + entropy: { + type: 'long', + }, + flags: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + physical_offset: { + type: 'keyword', + }, + physical_size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + virtual_address: { + type: 'long', + }, + virtual_size: { + type: 'long', + }, + }, + type: 'nested', + }, + segments: { + properties: { + sections: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + shared_libraries: { + type: 'keyword', + }, + telfhash: { + type: 'keyword', + }, + }, + }, + extension: { + type: 'keyword', + }, + fork_name: { + type: 'keyword', + }, + gid: { + type: 'keyword', + }, + group: { + type: 'keyword', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + inode: { + type: 'keyword', + }, + mime_type: { + type: 'keyword', + }, + mode: { + type: 'keyword', + }, + mtime: { + type: 'date', + }, + name: { + type: 'keyword', + }, + owner: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + size: { + type: 'long', + }, + target_path: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + uid: { + type: 'keyword', + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + first_seen: { + type: 'date', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + last_seen: { + type: 'date', + }, + marking: { + properties: { + tlp: { + type: 'keyword', + }, + }, + }, + modified_at: { + type: 'date', + }, + port: { + type: 'long', + }, + provider: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + registry: { + properties: { + data: { + properties: { + bytes: { + type: 'keyword', + }, + strings: { + type: 'wildcard', + }, + type: { + type: 'keyword', + }, + }, + }, + hive: { + type: 'keyword', + }, + key: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + value: { + type: 'keyword', + }, + }, + }, + scanner_stats: { + type: 'long', + }, + sightings: { + type: 'long', + }, + type: { + type: 'keyword', + }, + url: { + properties: { + domain: { + type: 'keyword', + }, + extension: { + type: 'keyword', + }, + fragment: { + type: 'keyword', + }, + full: { + type: 'wildcard', + }, + original: { + type: 'wildcard', + }, + password: { + type: 'keyword', + }, + path: { + type: 'wildcard', + }, + port: { + type: 'long', + }, + query: { + type: 'keyword', + }, + registered_domain: { + type: 'keyword', + }, + scheme: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + username: { + type: 'keyword', + }, + }, + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + software: { + properties: { + alias: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + platforms: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + }, + tactic: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + }, + }, + technique: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + subtechnique: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + }, + }, + }, + }, + }, + }, + tls: { + properties: { + cipher: { + type: 'keyword', + }, + client: { + properties: { + certificate: { + type: 'keyword', + }, + certificate_chain: { + type: 'keyword', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + }, + }, + issuer: { + type: 'keyword', + }, + ja3: { + type: 'keyword', + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + server_name: { + type: 'keyword', + }, + subject: { + type: 'keyword', + }, + supported_ciphers: { + type: 'keyword', + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + curve: { + type: 'keyword', + }, + established: { + type: 'boolean', + }, + next_protocol: { + type: 'keyword', + }, + resumed: { + type: 'boolean', + }, + server: { + properties: { + certificate: { + type: 'keyword', + }, + certificate_chain: { + type: 'keyword', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + }, + }, + issuer: { + type: 'keyword', + }, + ja3s: { + type: 'keyword', + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + subject: { + type: 'keyword', + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + version: { + type: 'keyword', + }, + version_protocol: { + type: 'keyword', + }, + }, + }, + trace: { + properties: { + id: { + type: 'keyword', + }, + }, + }, + transaction: { + properties: { + id: { + type: 'keyword', + }, + }, + }, + url: { + properties: { + domain: { + type: 'keyword', + }, + extension: { + type: 'keyword', + }, + fragment: { + type: 'keyword', + }, + full: { + type: 'wildcard', + }, + original: { + type: 'wildcard', + }, + password: { + type: 'keyword', + }, + path: { + type: 'wildcard', + }, + port: { + type: 'long', + }, + query: { + type: 'keyword', + }, + registered_domain: { + type: 'keyword', + }, + scheme: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + username: { + type: 'keyword', + }, + }, + }, + user: { + properties: { + changes: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + domain: { + type: 'keyword', + }, + effective: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + risk: { + properties: { + calculated_level: { + type: 'keyword', + }, + calculated_score: { + type: 'float', + }, + calculated_score_norm: { + type: 'float', + }, + static_level: { + type: 'keyword', + }, + static_score: { + type: 'float', + }, + static_score_norm: { + type: 'float', + }, + }, + }, + roles: { + type: 'keyword', + }, + target: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + }, + }, + user_agent: { + properties: { + device: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + name: { + type: 'keyword', + }, + original: { + type: 'keyword', + }, + os: { + properties: { + family: { + type: 'keyword', + }, + full: { + type: 'keyword', + }, + kernel: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + platform: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + version: { + type: 'keyword', + }, + }, + }, + vulnerability: { + properties: { + category: { + type: 'keyword', + }, + classification: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + enumeration: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + report_id: { + type: 'keyword', + }, + scanner: { + properties: { + vendor: { + type: 'keyword', + }, + }, + }, + score: { + properties: { + base: { + type: 'float', + }, + environmental: { + type: 'float', + }, + temporal: { + type: 'float', + }, + version: { + type: 'keyword', + }, + }, + }, + severity: { + type: 'keyword', + }, + }, + }, + }, + }, + settings: { + index: { + auto_expand_replicas: '0-1', + hidden: 'true', + lifecycle: { + name: '.alerts-ilm-policy', + rollover_alias: '.alerts-security.alerts-default', + }, + mapping: { + total_fields: { + limit: 1900, + }, + }, + number_of_replicas: '0', + number_of_shards: '1', + }, + }, + }, + }; +}; diff --git a/x-pack/test/security_solution_ftr/services/detections/endpoint_rule_alert_generator.ts b/x-pack/test/security_solution_ftr/services/detections/endpoint_rule_alert_generator.ts new file mode 100644 index 0000000000000..a02a1a2469578 --- /dev/null +++ b/x-pack/test/security_solution_ftr/services/detections/endpoint_rule_alert_generator.ts @@ -0,0 +1,274 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { BaseDataGenerator } from '@kbn/security-solution-plugin/common/endpoint/data_generators/base_data_generator'; +import endpointPrePackagedRule from '@kbn/security-solution-plugin/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/elastic_endpoint_security.json'; +import { kibanaPackageJson } from '@kbn/utils'; +import { mergeWith } from 'lodash'; +import { EndpointMetadataGenerator } from '@kbn/security-solution-plugin/common/endpoint/data_generators/endpoint_metadata_generator'; +import { HostMetadata } from '@kbn/security-solution-plugin/common/endpoint/types'; +import { DeepPartial } from 'utility-types'; + +const mergeAndReplaceArrays = <T, S>(destinationObj: T, srcObj: S): T => { + const customizer = (objValue: T[keyof T], srcValue: S[keyof S]) => { + if (Array.isArray(objValue)) { + return srcValue; + } + }; + + return mergeWith(destinationObj, srcObj, customizer); +}; + +type EndpointRuleAlert = Pick< + HostMetadata, + 'Endpoint' | 'agent' | 'elastic' | 'host' | 'data_stream' +> & { + [key: string]: any; +}; + +export class EndpointRuleAlertGenerator extends BaseDataGenerator { + /** Generates an Endpoint Rule Alert document */ + generate(overrides: DeepPartial<EndpointRuleAlert> = {}): EndpointRuleAlert { + const endpointMetadataGenerator = new EndpointMetadataGenerator(); + const endpointMetadata = endpointMetadataGenerator.generate({ + agent: { version: kibanaPackageJson.version }, + }); + const now = overrides['@timestamp'] ?? new Date().toISOString(); + const endpointAgentId = overrides?.agent?.id ?? this.seededUUIDv4(); + + return mergeAndReplaceArrays( + { + '@timestamp': now, + Endpoint: endpointMetadata.Endpoint, + agent: { + id: endpointAgentId, + type: 'endpoint', + version: kibanaPackageJson.version, + }, + elastic: endpointMetadata.elastic, + host: endpointMetadata.host, + data_stream: { + dataset: 'endpoint.alerts', + namespace: 'default', + type: 'logs', + }, + ecs: { + version: '1.4.0', + }, + file: { + Ext: { + code_signature: [ + { + subject_name: 'bad signer', + trusted: false, + }, + ], + malware_classification: { + identifier: 'endpointpe', + score: 1, + threshold: 0.66, + version: '3.0.33', + }, + quarantine_message: 'fake quarantine message', + quarantine_result: true, + temp_file_path: 'C:/temp/fake_malware.exe', + }, + accessed: 1666818167432, + created: 1666818167432, + hash: { + md5: 'fake file md5', + sha1: 'fake file sha1', + sha256: 'fake file sha256', + }, + mtime: 1666818167432, + name: 'fake_malware.exe', + owner: 'SYSTEM', + path: 'C:/fake_malware.exe', + size: 3456, + }, + dll: [ + { + Ext: { + compile_time: 1534424710, + malware_classification: { + identifier: 'Whitelisted', + score: 0, + threshold: 0, + version: '3.0.0', + }, + mapped_address: 5362483200, + mapped_size: 0, + }, + code_signature: { + subject_name: 'Cybereason Inc', + trusted: true, + }, + hash: { + md5: '1f2d082566b0fc5f2c238a5180db7451', + sha1: 'ca85243c0af6a6471bdaa560685c51eefd6dbc0d', + sha256: '8ad40c90a611d36eb8f9eb24fa04f7dbca713db383ff55a03aa0f382e92061a2', + }, + path: 'C:\\Program Files\\Cybereason ActiveProbe\\AmSvc.exe', + pe: { + architecture: 'x64', + }, + }, + ], + process: { + Ext: { + ancestry: ['epyg8z2d21', '26qhqfy8a1'], + code_signature: [ + { + subject_name: 'bad signer', + trusted: false, + }, + ], + token: { + domain: 'NT AUTHORITY', + integrity_level: 16384, + integrity_level_name: 'system', + privileges: [ + { + description: 'Replace a process level token', + enabled: false, + name: 'SeAssignPrimaryTokenPrivilege', + }, + ], + sid: 'S-1-5-18', + type: 'tokenPrimary', + user: 'SYSTEM', + }, + user: 'SYSTEM', + }, + entity_id: '0gwuy9lpud', + entry_leader: { + entity_id: '8kfl83q6vl', + name: 'fake entry', + pid: 945, + }, + executable: 'C:/malware.exe', + group_leader: { + entity_id: '8kfl83q6vl', + name: 'fake leader', + pid: 120, + }, + hash: { + md5: 'fake md5', + sha1: 'fake sha1', + sha256: 'fake sha256', + }, + name: 'malware writer', + parent: { + entity_id: 'epyg8z2d21', + pid: 1, + }, + pid: 2, + session_leader: { + entity_id: '8kfl83q6vl', + name: 'fake session', + pid: 279, + }, + start: 1666818167432, + uptime: 0, + }, + 'event.action': 'creation', + 'event.agent_id_status': 'auth_metadata_missing', + 'event.category': 'malware', + 'event.code': 'malicious_file', + 'event.dataset': 'endpoint', + 'event.id': this.seededUUIDv4(), + 'event.ingested': now, + 'event.kind': 'signal', + 'event.module': 'endpoint', + 'event.sequence': 5, + 'event.type': 'creation', + 'kibana.alert.ancestors': [ + { + depth: 0, + id: 'QBUaFoQBGSAAfHJkxoRQ', + index: '.ds-logs-endpoint.alerts-default-2022.10.26-000001', + type: 'event', + }, + ], + 'kibana.alert.depth': 1, + 'kibana.alert.original_event.action': 'creation', + 'kibana.alert.original_event.agent_id_status': 'auth_metadata_missing', + 'kibana.alert.original_event.category': 'malware', + 'kibana.alert.original_event.code': 'malicious_file', + 'kibana.alert.original_event.dataset': 'endpoint', + 'kibana.alert.original_event.id': this.seededUUIDv4(), + 'kibana.alert.original_event.ingested': now, + 'kibana.alert.original_event.kind': 'alert', + 'kibana.alert.original_event.module': 'endpoint', + 'kibana.alert.original_event.sequence': 5, + 'kibana.alert.original_event.type': 'creation', + 'kibana.alert.original_time': this.randomPastDate(), + 'kibana.alert.reason': + 'malware event with process malware writer, file fake_malware.exe, on Host-4xu9tiwmfp created medium alert Endpoint Security.', + 'kibana.alert.risk_score': 47, + 'kibana.alert.rule.actions': [], + 'kibana.alert.rule.author': ['Elastic'], + 'kibana.alert.rule.category': 'Custom Query Rule', + 'kibana.alert.rule.consumer': 'siem', + 'kibana.alert.rule.created_at': '2022-10-26T21:02:00.237Z', + 'kibana.alert.rule.created_by': 'some_user', + 'kibana.alert.rule.description': + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + 'kibana.alert.rule.enabled': true, + 'kibana.alert.rule.exceptions_list': [ + { + id: 'endpoint_list', + list_id: 'endpoint_list', + namespace_type: 'agnostic', + type: 'endpoint', + }, + ], + 'kibana.alert.rule.execution.uuid': this.seededUUIDv4(), + 'kibana.alert.rule.false_positives': [], + 'kibana.alert.rule.from': endpointPrePackagedRule.from, + 'kibana.alert.rule.immutable': true, + 'kibana.alert.rule.indices': endpointPrePackagedRule.index, + 'kibana.alert.rule.interval': '5m', + 'kibana.alert.rule.license': 'Elastic License v2', + 'kibana.alert.rule.max_signals': 10000, + 'kibana.alert.rule.name': endpointPrePackagedRule.name, + 'kibana.alert.rule.parameters': endpointPrePackagedRule, + 'kibana.alert.rule.producer': 'siem', + 'kibana.alert.rule.references': [], + 'kibana.alert.rule.risk_score': endpointPrePackagedRule.risk_score, + 'kibana.alert.rule.risk_score_mapping': [ + { + field: 'event.risk_score', + operator: 'equals', + value: '', + }, + ], + 'kibana.alert.rule.rule_id': endpointPrePackagedRule.rule_id, + 'kibana.alert.rule.rule_name_override': 'message', + 'kibana.alert.rule.rule_type_id': 'siem.queryRule', + 'kibana.alert.rule.severity': 'medium', + 'kibana.alert.rule.severity_mapping': endpointPrePackagedRule.severity_mapping, + 'kibana.alert.rule.tags': endpointPrePackagedRule.tags, + 'kibana.alert.rule.threat': [], + 'kibana.alert.rule.timestamp_override': endpointPrePackagedRule.timestamp_override, + 'kibana.alert.rule.to': 'now', + 'kibana.alert.rule.type': 'query', + 'kibana.alert.rule.updated_at': '2022-10-26T21:02:00.237Z', + 'kibana.alert.rule.updated_by': 'some_user', + 'kibana.alert.rule.uuid': '6eae8572-5571-11ed-a602-953b659b2e32', + 'kibana.alert.rule.version': 100, + 'kibana.alert.severity': 'medium', + 'kibana.alert.status': 'active', + 'kibana.alert.uuid': 'e25f166b83234cbcfc41600a0191ee6a0efec0f959c6899a325d8026711e6c02', + 'kibana.alert.workflow_status': 'open', + 'kibana.space_ids': ['default'], + 'kibana.version': kibanaPackageJson.version, + }, + overrides + ); + } +} diff --git a/x-pack/test/security_solution_ftr/services/detections/index.ts b/x-pack/test/security_solution_ftr/services/detections/index.ts index 024dede892be5..2fbc8c158640c 100644 --- a/x-pack/test/security_solution_ftr/services/detections/index.ts +++ b/x-pack/test/security_solution_ftr/services/detections/index.ts @@ -8,6 +8,7 @@ import { Response } from 'superagent'; import { EndpointError } from '@kbn/security-solution-plugin/common/endpoint/errors'; import { + DEFAULT_ALERTS_INDEX, DETECTION_ENGINE_QUERY_SIGNALS_URL, DETECTION_ENGINE_RULES_BULK_ACTION, DETECTION_ENGINE_RULES_URL, @@ -15,13 +16,23 @@ import { import { estypes } from '@elastic/elasticsearch'; import endpointPrePackagedRule from '@kbn/security-solution-plugin/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/elastic_endpoint_security.json'; import { Rule } from '@kbn/security-solution-plugin/public/detection_engine/rule_management/logic/types'; +import { kibanaPackageJson } from '@kbn/utils'; +import { wrapErrorIfNeeded } from '@kbn/security-solution-plugin/common/endpoint/data_loaders/utils'; import { FtrService } from '../../../functional/ftr_provider_context'; +import { EndpointRuleAlertGenerator } from './endpoint_rule_alert_generator'; +import { getAlertsIndexMappings } from './alerts_security_index_mappings'; + +export interface IndexedEndpointRuleAlerts { + alerts: estypes.WriteResponseBase[]; + cleanup: () => Promise<void>; +} export class DetectionsTestService extends FtrService { private readonly supertest = this.ctx.getService('supertest'); private readonly log = this.ctx.getService('log'); private readonly retry = this.ctx.getService('retry'); private readonly config = this.ctx.getService('config'); + private readonly esClient = this.ctx.getService('es'); private readonly defaultTimeout = this.config.get('timeouts.waitFor'); /** @@ -51,6 +62,36 @@ export class DetectionsTestService extends FtrService { }; } + private async ensureEndpointRuleAlertsIndexExists(): Promise<void> { + const indexMappings = getAlertsIndexMappings().value; + + if (indexMappings.mappings?._meta?.kibana.version) { + indexMappings.mappings._meta.kibana.version = kibanaPackageJson.version; + } + + try { + await this.esClient.indices.create({ + index: indexMappings.index, + body: { + settings: indexMappings.settings, + mappings: indexMappings.mappings, + aliases: indexMappings.aliases, + }, + }); + } catch (error) { + // ignore error that indicate index is already created + if ( + ['resource_already_exists_exception', 'invalid_alias_name_exception'].includes( + error?.body?.error?.type + ) + ) { + return; + } + + throw wrapErrorIfNeeded(error); + } + } + /** * Fetches the endpoint security rule using the pre-packaged `rule_id` */ @@ -99,10 +140,11 @@ export class DetectionsTestService extends FtrService { } /** - * Waits for alerts to have been loaded into `.alerts-security.alerts-default` index + * Waits for alerts to have been loaded by continuously calling the alerts api until data shows up * @param query + * @param timeoutMs */ - async waitForAlerts(query: object = { match_all: {} }, timeoutMs?: number) { + async waitForAlerts(query: object = { match_all: {} }, timeoutMs?: number): Promise<void> { await this.retry.waitForWithTimeout( 'Checking alerts index for data', timeoutMs ?? this.defaultTimeout, @@ -128,4 +170,62 @@ export class DetectionsTestService extends FtrService { } ); } + + /** + * Loads alerts for Endpoint directly into the internal index that the Endpoint Rule + * would have written them to for a given endpoint + * @param endpointAgentId + * @param count + */ + async loadEndpointRuleAlerts( + endpointAgentId: string, + count: number = 2 + ): Promise<IndexedEndpointRuleAlerts> { + this.log.info(`Loading ${count} endpoint rule alerts`); + + await this.ensureEndpointRuleAlertsIndexExists(); + + const alertsGenerator = new EndpointRuleAlertGenerator(); + const esClient = this.esClient; + const indexedAlerts: estypes.IndexResponse[] = []; + + for (let n = 0; n < count; n++) { + const alert = alertsGenerator.generate({ agent: { id: endpointAgentId } }); + const indexedAlert = await esClient.index({ + index: `${DEFAULT_ALERTS_INDEX}-default`, + refresh: 'wait_for', + body: alert, + }); + + indexedAlerts.push(indexedAlert); + } + + this.log.info(`Endpoint rule alerts created:`, indexedAlerts); + + return { + alerts: indexedAlerts, + cleanup: async (): Promise<void> => { + if (indexedAlerts.length) { + this.log.info('cleaning up loaded endpoint rule alerts'); + + await esClient.bulk({ + body: indexedAlerts.map((indexedDoc) => { + return { + delete: { + _index: indexedDoc._index, + _id: indexedDoc._id, + }, + }; + }), + }); + + this.log.info( + `Deleted ${indexedAlerts.length} endpoint rule alerts. Ids: [${indexedAlerts + .map((alert) => alert._id) + .join()}]` + ); + } + }, + }; + } } diff --git a/x-pack/test/stack_functional_integration/apps/ccs/ccs_console.js b/x-pack/test/stack_functional_integration/apps/ccs/ccs_console.js new file mode 100644 index 0000000000000..8a86c5fc65f15 --- /dev/null +++ b/x-pack/test/stack_functional_integration/apps/ccs/ccs_console.js @@ -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 expect from '@kbn/expect'; + +export default function ({ getService, getPageObjects }) { + const retry = getService('retry'); + const log = getService('log'); + const PageObjects = getPageObjects(['common', 'console']); + + describe('Integration Tests - Console App CCS', function describeIndexTests() { + this.tags('includeFirefox'); + before(async () => { + log.debug('navigateTo console'); + await PageObjects.common.navigateToApp('console'); + await retry.try(async () => { + await PageObjects.console.collapseHelp(); + }); + }); + + describe('Perform CCS Search in Console', () => { + before(async () => { + await PageObjects.console.clearTextArea(); + }); + it('it should be able to access remote data', async () => { + await PageObjects.console.enterRequest( + '\nGET data:makelogs工程-*/_search\n {\n "query": {\n "bool": {\n "must": [\n {"match": {"extension" : "jpg"' + ); + await PageObjects.console.clickPlay(); + await retry.try(async () => { + const actualResponse = await PageObjects.console.getResponse(); + expect(actualResponse).to.contain('"_index": "data:makelogs工程-0"'); + }); + }); + }); + }); +} diff --git a/x-pack/test/stack_functional_integration/apps/ccs/index.js b/x-pack/test/stack_functional_integration/apps/ccs/index.js index ac82ca0dfda65..2f24a0e31d7dc 100644 --- a/x-pack/test/stack_functional_integration/apps/ccs/index.js +++ b/x-pack/test/stack_functional_integration/apps/ccs/index.js @@ -8,5 +8,6 @@ export default function ({ loadTestFile }) { describe('ccs test', function () { loadTestFile(require.resolve('./ccs_discover')); + loadTestFile(require.resolve('./ccs_console')); }); } diff --git a/x-pack/test/stack_functional_integration/apps/filebeat/filebeat.ts b/x-pack/test/stack_functional_integration/apps/filebeat/filebeat.ts index c8ddb8aabec30..5539125d770a8 100644 --- a/x-pack/test/stack_functional_integration/apps/filebeat/filebeat.ts +++ b/x-pack/test/stack_functional_integration/apps/filebeat/filebeat.ts @@ -18,7 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.selectIndexPattern('filebeat-*'); await PageObjects.timePicker.setCommonlyUsedTime('Last_1 year'); await retry.try(async () => { - const hitCount = parseInt(await PageObjects.discover.getHitCount(), 10); + const hitCount = await PageObjects.discover.getHitCountInt(); expect(hitCount).to.be.greaterThan(0); }); }); diff --git a/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat.ts b/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat.ts index f6a8aa7875302..50b254a65559e 100644 --- a/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat.ts +++ b/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat.ts @@ -28,7 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.selectIndexPattern('metricbeat-*'); await PageObjects.timePicker.setCommonlyUsedTime('Last_1 year'); await retry.try(async function () { - const hitCount = parseInt(await PageObjects.discover.getHitCount(), 10); + const hitCount = await PageObjects.discover.getHitCountInt(); expect(hitCount).to.be.greaterThan(0); }); }); diff --git a/x-pack/test/stack_functional_integration/apps/packetbeat/_packetbeat.ts b/x-pack/test/stack_functional_integration/apps/packetbeat/_packetbeat.ts index e4bf8288a2093..367f7a34f7003 100644 --- a/x-pack/test/stack_functional_integration/apps/packetbeat/_packetbeat.ts +++ b/x-pack/test/stack_functional_integration/apps/packetbeat/_packetbeat.ts @@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.selectIndexPattern('packetbeat-*'); await PageObjects.timePicker.setCommonlyUsedTime('Last_1 year'); await retry.try(async function () { - const hitCount = parseInt(await PageObjects.discover.getHitCount(), 10); + const hitCount = await PageObjects.discover.getHitCountInt(); expect(hitCount).to.be.greaterThan(0); }); }); diff --git a/x-pack/test/stack_functional_integration/apps/winlogbeat/_winlogbeat.ts b/x-pack/test/stack_functional_integration/apps/winlogbeat/_winlogbeat.ts index 4f8107f937a77..99bcf4e15dcd6 100644 --- a/x-pack/test/stack_functional_integration/apps/winlogbeat/_winlogbeat.ts +++ b/x-pack/test/stack_functional_integration/apps/winlogbeat/_winlogbeat.ts @@ -27,7 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.selectIndexPattern('winlogbeat-*'); await PageObjects.timePicker.setCommonlyUsedTime('Last_1 year'); await retry.try(async function () { - const hitCount = parseInt(await PageObjects.discover.getHitCount(), 10); + const hitCount = await PageObjects.discover.getHitCountInt(); expect(hitCount).to.be.greaterThan(0); }); }); diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 7267b31905c95..402b915247fc3 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -5,7 +5,12 @@ "emitDeclarationOnly": true, "declaration": true, "declarationMap": true, - "types": ["node"] + "types": ["node"], + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "**/*", @@ -15,8 +20,11 @@ "../../typings/**/*", "../../packages/kbn-test/types/ftr_globals/**/*", ], - "exclude": ["target/**/*"], - "references": [ + "exclude": [ + "target/**/*", + "*/plugins/**/*", + ], + "kbn_references": [ { "path": "../../test/tsconfig.json" }, { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/bfetch/tsconfig.json" }, @@ -101,6 +109,7 @@ { "path": "../plugins/remote_clusters/tsconfig.json" }, { "path": "../plugins/cross_cluster_replication/tsconfig.json" }, { "path": "../plugins/index_lifecycle_management/tsconfig.json"}, - { "path": "../plugins/synthetics/tsconfig.json"} + { "path": "../plugins/synthetics/tsconfig.json" }, + { "path": "./plugin_functional/plugins/global_search_test/tsconfig.json" } ] } 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 3791de8e8d7ef..2844483018e10 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 @@ -68,6 +68,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { 'elasticsearch', 'appSearch', 'workplaceSearch', + 'searchExperiences', 'spaces', ...esFeatureExceptions, ]; @@ -94,6 +95,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { 'elasticsearch', 'appSearch', 'workplaceSearch', + 'searchExperiences', 'spaces', ...esFeatureExceptions, ]; 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 c2f6087420e26..4b585e4b95c81 100644 --- a/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts @@ -32,6 +32,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { 'elasticsearch', 'appSearch', 'workplaceSearch', + 'searchExperiences', ]; describe('catalogue', () => { diff --git a/x-pack/test/upgrade/apps/discover/discover_smoke_tests.ts b/x-pack/test/upgrade/apps/discover/discover_smoke_tests.ts index bfb51f3e5336d..64adb488ca2b9 100644 --- a/x-pack/test/upgrade/apps/discover/discover_smoke_tests.ts +++ b/x-pack/test/upgrade/apps/discover/discover_smoke_tests.ts @@ -40,12 +40,12 @@ export default function ({ getPageObjects }: FtrProviderContext) { await PageObjects.discover.selectIndexPattern(String(index)); await PageObjects.discover.waitUntilSearchingHasFinished(); if (timefield) { - await PageObjects.timePicker.setCommonlyUsedTime('Last_24 hours'); + await PageObjects.timePicker.setCommonlyUsedTime('Last_1 year'); await PageObjects.discover.waitUntilSearchingHasFinished(); } }); it('shows hit count greater than zero', async () => { - const hitCount = await PageObjects.discover.getHitCount(); + const hitCount = await PageObjects.discover.getHitCountInt(); if (hits === '') { expect(hitCount).to.be.greaterThan(0); } else { @@ -69,12 +69,12 @@ export default function ({ getPageObjects }: FtrProviderContext) { await PageObjects.home.launchSampleDiscover(name); await PageObjects.header.waitUntilLoadingHasFinished(); if (timefield) { - await PageObjects.timePicker.setCommonlyUsedTime('Last_24 hours'); + await PageObjects.timePicker.setCommonlyUsedTime('Last_1 year'); await PageObjects.discover.waitUntilSearchingHasFinished(); } }); it('shows hit count greater than zero', async () => { - const hitCount = await PageObjects.discover.getHitCount(); + const hitCount = await PageObjects.discover.getHitCountInt(); if (hits === '') { expect(hitCount).to.be.greaterThan(0); } else { diff --git a/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts b/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts index f7b0eef003c91..2aa1cf113b35b 100644 --- a/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts +++ b/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts @@ -22,6 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'header', 'home', 'dashboard', 'share']); const testSubjects = getService('testSubjects'); const log = getService('log'); + const retry = getService('retry'); const spaces = [ { space: 'default', basePath: '' }, @@ -40,7 +41,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { { name: 'ecommerce', type: 'png', link: 'PNG Reports' }, ]; - describe('upgrade reporting smoke tests', () => { + describe('reporting ', () => { let completedReportCount: number; let usage: UsageStats; describe('initial state', () => { @@ -54,7 +55,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); spaces.forEach(({ space, basePath }) => { - describe('generate report for space ' + space, () => { + describe('space ' + space, () => { beforeEach(async () => { await PageObjects.common.navigateToActualUrl('home', '/tutorial_directory/sampleData', { basePath, @@ -65,44 +66,62 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); reportingTests.forEach(({ name, type, link }) => { it('name: ' + name + ' type: ' + type, async () => { + let startTime; await PageObjects.home.launchSampleDashboard(name); await PageObjects.share.openShareMenuItem(link); if (type === 'pdf_optimize') { await testSubjects.click('usePrintLayout'); } - const advOpt = await find.byXPath(`//button[descendant::*[text()='Advanced options']]`); - await advOpt.click(); - // Workaround for: https://github.com/elastic/kibana/issues/126540 - const isUrlTooLong = await testSubjects.exists('urlTooLongErrorMessage'); - if (isUrlTooLong) { - // Save dashboard - await PageObjects.dashboard.switchToEditMode(); - await PageObjects.dashboard.clickQuickSave(); - await PageObjects.share.openShareMenuItem(link); - if (type === 'pdf_optimize') { - await testSubjects.click('usePrintLayout'); - } - const advOpt2 = await find.byXPath( + const canReadClipboard = await browser.checkBrowserPermission('clipboard-read'); + // if we can read the clipboard (not Chrome headless) then get the reporting URL and post it + // else click the reporting button and wait for the count of completed reports to increment + if (canReadClipboard) { + log.debug('We have clipboard access. Getting the POST URL and posting it via API'); + const advOpt = await find.byXPath( `//button[descendant::*[text()='Advanced options']]` ); - await advOpt2.click(); - } - const postUrl = await find.byXPath(`//button[descendant::*[text()='Copy POST URL']]`); - await postUrl.click(); - const url = await browser.getClipboardValue(); - // Add try/catch for https://github.com/elastic/elastic-stack-testing/issues/1199 - // Waiting for job to finish sometimes gets socket hang up error, from what I - // observed during debug testing the command does complete. - // Checking expected report count will still fail if the job did not finish. - try { - await reportingAPI.expectAllJobsToFinishSuccessfully([ - await reportingAPI.postJob(parse(url).pathname + '?' + parse(url).query), - ]); - } catch (e) { - log.debug(`Error waiting for job to finish: ${e}`); + await advOpt.click(); + // Workaround for: https://github.com/elastic/kibana/issues/126540 + const isUrlTooLong = await testSubjects.exists('urlTooLongErrorMessage'); + if (isUrlTooLong) { + // Save dashboard + await PageObjects.dashboard.switchToEditMode(); + await PageObjects.dashboard.clickQuickSave(); + await PageObjects.share.openShareMenuItem(link); + if (type === 'pdf_optimize') { + await testSubjects.click('usePrintLayout'); + } + const advOpt2 = await find.byXPath( + `//button[descendant::*[text()='Advanced options']]` + ); + await advOpt2.click(); + } + const postUrl = await find.byXPath(`//button[descendant::*[text()='Copy POST URL']]`); + await postUrl.click(); + const url = await browser.getClipboardValue(); + // Add try/catch for https://github.com/elastic/elastic-stack-testing/issues/1199 + // Waiting for job to finish sometimes gets socket hang up error, from what I + // observed during debug testing the command does complete. + // Checking expected report count will still fail if the job did not finish. + try { + await reportingAPI.expectAllJobsToFinishSuccessfully([ + await reportingAPI.postJob(parse(url).pathname + '?' + parse(url).query), + ]); + } catch (e) { + log.debug(`Error waiting for job to finish: ${e}`); + } + startTime = new Date(); + } else { + log.debug(`We don't have clipboard access. Clicking the Generate report button`); + await testSubjects.click('generateReportButton'); + startTime = new Date(); } - usage = (await usageAPI.getUsageStats()) as UsageStats; - reportingAPI.expectCompletedReportCount(usage, completedReportCount + 1); + + await retry.tryForTime(50000, async () => { + usage = (await usageAPI.getUsageStats()) as UsageStats; + reportingAPI.expectCompletedReportCount(usage, completedReportCount + 1); + }); + log.debug(`Elapsed Time: ${new Date().getTime() - startTime.getTime()}`); }); }); }); diff --git a/x-pack/test/usage_collection/plugins/application_usage_test/tsconfig.json b/x-pack/test/usage_collection/plugins/application_usage_test/tsconfig.json index 02a6929fb8539..9915d6a039072 100644 --- a/x-pack/test/usage_collection/plugins/application_usage_test/tsconfig.json +++ b/x-pack/test/usage_collection/plugins/application_usage_test/tsconfig.json @@ -7,8 +7,10 @@ "public/**/*.ts", "public/**/*.tsx", ], - "exclude": [], - "references": [ + "exclude": [ + "./target" + ], + "kbn_references": [ { "path": "../../../../../src/core/tsconfig.json" }, ] } diff --git a/x-pack/test/usage_collection/plugins/stack_management_usage_test/tsconfig.json b/x-pack/test/usage_collection/plugins/stack_management_usage_test/tsconfig.json index e625acbc569cf..d14f3df51ff9c 100644 --- a/x-pack/test/usage_collection/plugins/stack_management_usage_test/tsconfig.json +++ b/x-pack/test/usage_collection/plugins/stack_management_usage_test/tsconfig.json @@ -7,5 +7,10 @@ "public/**/*.ts", "public/**/*.tsx", ], - "exclude": [] + "exclude": [ + "./target" + ], + "kbn_references": [ + { "path": "../../../../../src/core/tsconfig.json" } + ] } diff --git a/x-pack/test/usage_collection/test_suites/application_usage/index.ts b/x-pack/test/usage_collection/test_suites/application_usage/index.ts index 9311e554832e0..4b820f6ff01c2 100644 --- a/x-pack/test/usage_collection/test_suites/application_usage/index.ts +++ b/x-pack/test/usage_collection/test_suites/application_usage/index.ts @@ -17,7 +17,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('keys in the schema match the registered application IDs', async () => { await common.navigateToApp('home'); // Navigate to Home await common.isChromeVisible(); // Make sure the page is fully loaded - const appIds = await browser.execute(() => window.__applicationIds__); + const appIds: unknown = await browser.execute(() => { + // @ts-expect-error this code runs in the browser + return window.__applicationIds__; + }); if (!appIds || !Array.isArray(appIds)) { throw new Error( 'Failed to retrieve all the existing applications in Kibana. Did it fail to boot or to navigate to home?' diff --git a/x-pack/test/usage_collection/test_suites/stack_management_usage/index.ts b/x-pack/test/usage_collection/test_suites/stack_management_usage/index.ts index 724c38a2b06e5..e1e83cb0a4584 100644 --- a/x-pack/test/usage_collection/test_suites/stack_management_usage/index.ts +++ b/x-pack/test/usage_collection/test_suites/stack_management_usage/index.ts @@ -19,7 +19,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await common.navigateToApp('home'); // Navigate to Home to make sure all the appIds are loaded await common.isChromeVisible(); // Make sure the page is fully loaded - registeredSettings = await browser.execute(() => window.__registeredUiSettings__); + registeredSettings = await browser.execute(() => { + // @ts-expect-error this code runs in the browser + return window.__registeredUiSettings__; + }); }); it('registers all UI Settings in the UsageStats interface', () => { diff --git a/yarn.lock b/yarn.lock index 1770a163d752c..9a7142b7d14db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@adobe/css-tools@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.0.1.tgz#b38b444ad3aa5fedbb15f2f746dcd934226a12dd" + integrity sha512-+u76oB43nOHrF4DDWRLWDCtci7f3QJoEBigemIdIeTi1ODqjx6Tad9NCVnPRwewWlKkVab5PlK8DCtPTyX7S8g== + "@ampproject/remapping@^2.1.0": version "2.1.2" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.2.tgz#4edca94973ded9630d20101cd8559cedb8d8bd34" @@ -108,7 +113,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.19.6", "@babel/core@^7.7.5": +"@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.19.6", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.8.0": version "7.19.6" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.6.tgz#7122ae4f5c5a37c0946c066149abd8e75f81540f" integrity sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg== @@ -145,7 +150,7 @@ dependencies: eslint-rule-composer "^0.3.0" -"@babel/generator@^7.12.11", "@babel/generator@^7.12.5", "@babel/generator@^7.19.6": +"@babel/generator@^7.12.11", "@babel/generator@^7.12.5", "@babel/generator@^7.19.6", "@babel/generator@^7.7.2": version "7.19.6" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.6.tgz#9e481a3fe9ca6261c972645ae3904ec0f9b34a1d" integrity sha512-oHGRUQeoX1QrKeJIKVe0hwjGqNnVYsM5Nep5zo0uE0m42sLH+Fsd2pStJ5sRM1bNyTUUoz0pe2lTeMJrb/taTA== @@ -713,7 +718,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.18.6": +"@babel/plugin-syntax-typescript@^7.18.6", "@babel/plugin-syntax-typescript@^7.7.2": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz#1c09cd25795c7c2b8a4ba9ae49394576d4133285" integrity sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA== @@ -1191,7 +1196,7 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.10.3", "@babel/traverse@^7.12.11", "@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.18.9", "@babel/traverse@^7.19.4", "@babel/traverse@^7.19.6", "@babel/traverse@^7.4.5": +"@babel/traverse@^7.10.3", "@babel/traverse@^7.12.11", "@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.18.9", "@babel/traverse@^7.19.4", "@babel/traverse@^7.19.6", "@babel/traverse@^7.4.5", "@babel/traverse@^7.7.2": version "7.19.6" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.6.tgz#7b4c865611df6d99cb131eec2e8ac71656a490dc" integrity sha512-6l5HrUCzFM04mfbG09AagtYyR2P0B71B1wN7PfSPiksDPz2k5H9CBC1tcZpz2M8OxbKTPccByoOJ22rUKbpmQQ== @@ -1292,17 +1297,12 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== -"@cspotcode/source-map-consumer@0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b" - integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg== - -"@cspotcode/source-map-support@0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz#4789840aa859e46d2f3173727ab707c66bf344f5" - integrity sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA== +"@cspotcode/source-map-support@^0.8.0", "@cspotcode/source-map-support@^0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== dependencies: - "@cspotcode/source-map-consumer" "0.8.0" + "@jridgewell/trace-mapping" "0.3.9" "@csstools/selector-specificity@^2.0.1": version "2.0.1" @@ -1580,22 +1580,10 @@ resolved "https://registry.yarnpkg.com/@elastic/filesaver/-/filesaver-1.1.2.tgz#1998ffb3cd89c9da4ec12a7793bfcae10e30c77a" integrity sha512-YZbSufYFBhAj+S2cJgiKALoxIJevqXN2MSr6Yqr42rJdaPuM31cj6pUDwflkql1oDjupqD9la+MfxPFjXI1JFQ== -"@elastic/github-checks-reporter@0.0.20b3": - version "0.0.20-b3" - resolved "https://registry.yarnpkg.com/@elastic/github-checks-reporter/-/github-checks-reporter-0.0.20-b3.tgz#025ac0e152cda03d947faec190c244fbbe59bdfc" - integrity sha512-OmhbddqNkFZMYVQxMqpqLj7NJhqphN+wQb68IeiewxvWXq8NEPaBpaZ9f+nUbixmMY2Q/XA0JgtuE4EhMGIljg== - dependencies: - "@octokit/app" "^2.2.2" - "@octokit/plugin-retry" "^2.2.0" - "@octokit/request" "^2.4.2" - "@octokit/rest" "^16.23.2" - async-retry "^1.2.3" - strip-ansi "^5.2.0" - -"@elastic/makelogs@^6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@elastic/makelogs/-/makelogs-6.0.0.tgz#d6d74d5d0f020123c54160370d49ca5e0aab1fe1" - integrity sha512-i+BMxM3pKy9CAqcvMvdHLxvM0Dlnx+4JeScWHM9fFn4+2rAHGCqWflm/UGhTgQh3xn+yXKMLoEbfMIi5Aw1ysw== +"@elastic/makelogs@^6.1.1": + version "6.1.1" + resolved "https://registry.yarnpkg.com/@elastic/makelogs/-/makelogs-6.1.1.tgz#5bc173b16acdfd7844fd85c97824ddcffd67cfb3" + integrity sha512-cmfXFQITwyT4SV+Ryerg/vVbGQ9E2BhYKQ9flG85Ba3blGVmOjkgv7TYQam6xAIvGXFGBBrcyqEwmuw7xZ5ZNQ== dependencies: async "^1.4.2" commander "^5.0.0" @@ -1604,7 +1592,6 @@ moment "^2.10.6" progress "^1.1.8" through2 "^2.0.0" - update-notifier "^0.5.0" "@elastic/node-crypto@1.1.1": version "1.1.1" @@ -1666,24 +1653,31 @@ history "^4.9.0" qs "^6.7.0" -"@elastic/synthetics@^1.0.0-beta.22": - version "1.0.0-beta.22" - resolved "https://registry.yarnpkg.com/@elastic/synthetics/-/synthetics-1.0.0-beta.22.tgz#1ec60e212e925ffaf7fd63619858ad6ce6dfa85d" - integrity sha512-hDFPqBuY30naAZct8UNRMhKNtsVbPV5nYApkwRf/7y3/SgQBXPnMkxUBlxy+2vkPR4QnKusvWROUxMMwgVnXyA== +"@elastic/synthetics@^1.0.0-beta.23": + version "1.0.0-beta.37" + resolved "https://registry.yarnpkg.com/@elastic/synthetics/-/synthetics-1.0.0-beta.37.tgz#ba89918107c7aa166bcf43bbd0cbe4ad6a3b4430" + integrity sha512-MSYu+n4SuZ31AbxWpha5WBS33Y/YTVEvOc8g3WkCIxSqa8iSAPgGEAOZimk/pHOzPZNXJcRKIpL01HnKvqd14g== dependencies: - commander "^9.0.0" + "@cspotcode/source-map-support" "^0.8.1" + "@esbuild-plugins/node-resolve" "^0.1.4" + archiver "^5.3.1" + commander "^9.4.0" deepmerge "^4.2.2" - expect "^27.0.2" + enquirer "^2.3.6" + esbuild "^0.14.54" + expect "^28.1.3" http-proxy "^1.18.1" - kleur "^4.1.4" - micromatch "^4.0.4" - playwright-chromium "=1.14.0" - sharp "^0.30.1" - snakecase-keys "^3.2.1" - sonic-boom "^2.6.0" - source-map-support "^0.5.21" - ts-node "^10.5.0" - typescript "^4.5.5" + kleur "^4.1.5" + micromatch "^4.0.5" + playwright-chromium "=1.26.0" + playwright-core "=1.26.0" + sharp "^0.31.1" + snakecase-keys "^4.0.0" + sonic-boom "^3.2.0" + ts-node "^10.9.1" + typescript "^4.8.3" + undici "^5.10.0" + yaml "^2.1.1" "@elastic/transport@^8.2.0": version "8.2.0" @@ -1927,6 +1921,21 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz#ea89004119dc42db2e1dba0f97d553f7372f6fcb" integrity sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg== +"@esbuild-plugins/node-resolve@^0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@esbuild-plugins/node-resolve/-/node-resolve-0.1.4.tgz#2257ef3b233c9cb3acd2ebde7d5a3d6874046d38" + integrity sha512-haFQ0qhxEpqtWWY0kx1Y5oE3sMyO1PcoSiWEPrAw6tm/ZOOLXjSs6Q+v1v9eyuVF0nNt50YEvrcrvENmyoMv5g== + dependencies: + "@types/resolve" "^1.17.1" + debug "^4.3.1" + escape-string-regexp "^4.0.0" + resolve "^1.19.0" + +"@esbuild/linux-loong64@0.14.54": + version "0.14.54" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz#de2a4be678bd4d0d1ffbb86e6de779cde5999028" + integrity sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw== + "@eslint/eslintrc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" @@ -2348,61 +2357,61 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== -"@jest/console@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.6.2.tgz#4e04bc464014358b03ab4937805ee36a0aeb98f2" - integrity sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g== +"@jest/console@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.1.tgz#260fe7239602fe5130a94f1aa386eff54b014bba" + integrity sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^26.6.2" - jest-util "^26.6.2" + jest-message-util "^27.5.1" + jest-util "^27.5.1" slash "^3.0.0" -"@jest/core@^26.6.3": - version "26.6.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.6.3.tgz#7639fcb3833d748a4656ada54bde193051e45fad" - integrity sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw== - dependencies: - "@jest/console" "^26.6.2" - "@jest/reporters" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" +"@jest/core@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.1.tgz#267ac5f704e09dc52de2922cbf3af9edcd64b626" + integrity sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ== + dependencies: + "@jest/console" "^27.5.1" + "@jest/reporters" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" + emittery "^0.8.1" exit "^0.1.2" - graceful-fs "^4.2.4" - jest-changed-files "^26.6.2" - jest-config "^26.6.3" - jest-haste-map "^26.6.2" - jest-message-util "^26.6.2" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-resolve-dependencies "^26.6.3" - jest-runner "^26.6.3" - jest-runtime "^26.6.3" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" - jest-watcher "^26.6.2" - micromatch "^4.0.2" - p-each-series "^2.1.0" + graceful-fs "^4.2.9" + jest-changed-files "^27.5.1" + jest-config "^27.5.1" + jest-haste-map "^27.5.1" + jest-message-util "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-resolve-dependencies "^27.5.1" + jest-runner "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" + jest-watcher "^27.5.1" + micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.6.2.tgz#ba364cc72e221e79cc8f0a99555bf5d7577cf92c" - integrity sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA== +"@jest/environment@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.1.tgz#d7425820511fe7158abbecc010140c3fd3be9c74" + integrity sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA== dependencies: - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-mock "^26.6.2" + jest-mock "^27.5.1" "@jest/expect-utils@^28.1.1": version "28.1.1" @@ -2411,58 +2420,64 @@ dependencies: jest-get-type "^28.0.2" -"@jest/fake-timers@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.6.2.tgz#459c329bcf70cee4af4d7e3f3e67848123535aad" - integrity sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA== +"@jest/expect-utils@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.3.tgz#58561ce5db7cd253a7edddbc051fb39dda50f525" + integrity sha512-wvbi9LUrHJLn3NlDW6wF2hvIMtd4JUl2QNVrjq+IBSHirgfrR3o9RnVtxzdEGO2n9JyIWwHnLfby5KzqBGg2YA== dependencies: - "@jest/types" "^26.6.2" - "@sinonjs/fake-timers" "^6.0.1" + jest-get-type "^28.0.2" + +"@jest/fake-timers@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" + integrity sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ== + dependencies: + "@jest/types" "^27.5.1" + "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^26.6.2" - jest-mock "^26.6.2" - jest-util "^26.6.2" + jest-message-util "^27.5.1" + jest-mock "^27.5.1" + jest-util "^27.5.1" -"@jest/globals@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.6.2.tgz#5b613b78a1aa2655ae908eba638cc96a20df720a" - integrity sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA== +"@jest/globals@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.1.tgz#7ac06ce57ab966566c7963431cef458434601b2b" + integrity sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q== dependencies: - "@jest/environment" "^26.6.2" - "@jest/types" "^26.6.2" - expect "^26.6.2" + "@jest/environment" "^27.5.1" + "@jest/types" "^27.5.1" + expect "^27.5.1" -"@jest/reporters@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.6.2.tgz#1f518b99637a5f18307bd3ecf9275f6882a667f6" - integrity sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw== +"@jest/reporters@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.1.tgz#ceda7be96170b03c923c37987b64015812ffec04" + integrity sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/console" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" + "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.2" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.3" + istanbul-lib-instrument "^5.1.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.2" - jest-haste-map "^26.6.2" - jest-resolve "^26.6.2" - jest-util "^26.6.2" - jest-worker "^26.6.2" + istanbul-reports "^3.1.3" + jest-haste-map "^27.5.1" + jest-resolve "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" - v8-to-istanbul "^7.0.0" - optionalDependencies: - node-notifier "^8.0.0" + v8-to-istanbul "^8.1.0" "@jest/schemas@^28.0.2": version "28.0.2" @@ -2471,35 +2486,41 @@ dependencies: "@sinclair/typebox" "^0.23.3" -"@jest/source-map@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.6.2.tgz#29af5e1e2e324cafccc936f218309f54ab69d535" - integrity sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA== +"@jest/schemas@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.1.3.tgz#ad8b86a66f11f33619e3d7e1dcddd7f2d40ff905" + integrity sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg== + dependencies: + "@sinclair/typebox" "^0.24.1" + +"@jest/source-map@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" + integrity sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg== dependencies: callsites "^3.0.0" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" source-map "^0.6.0" -"@jest/test-result@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.6.2.tgz#55da58b62df134576cc95476efa5f7949e3f5f18" - integrity sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ== +"@jest/test-result@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.1.tgz#56a6585fa80f7cdab72b8c5fc2e871d03832f5bb" + integrity sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag== dependencies: - "@jest/console" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/console" "^27.5.1" + "@jest/types" "^27.5.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^26.6.3": - version "26.6.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz#98e8a45100863886d074205e8ffdc5a7eb582b17" - integrity sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw== +"@jest/test-sequencer@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz#4057e0e9cea4439e544c6353c6affe58d095745b" + integrity sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ== dependencies: - "@jest/test-result" "^26.6.2" - graceful-fs "^4.2.4" - jest-haste-map "^26.6.2" - jest-runner "^26.6.3" - jest-runtime "^26.6.3" + "@jest/test-result" "^27.5.1" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.1" + jest-runtime "^27.5.1" "@jest/transform@^26.6.2": version "26.6.2" @@ -2522,7 +2543,28 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^26", "@jest/types@^26.6.2": +"@jest/transform@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.1.tgz#6c3501dcc00c4c08915f292a600ece5ecfe1f409" + integrity sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^27.5.1" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.1" + jest-regex-util "^27.5.1" + jest-util "^27.5.1" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + source-map "^0.6.1" + write-file-atomic "^3.0.0" + +"@jest/types@^26.6.2": version "26.6.2" resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== @@ -2533,10 +2575,10 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jest/types@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.1.tgz#77a3fc014f906c65752d12123a0134359707c0ad" - integrity sha512-yqJPDDseb0mXgKqmNqypCsb85C22K1aY5+LUxh7syIM9n/b0AsaltxNy+o6tt29VcfGDpYEve175bm3uOhcehA== +"@jest/types@^27", "@jest/types@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" + integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -2544,12 +2586,12 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@jest/types@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.1.tgz#d059bbc80e6da6eda9f081f293299348bd78ee0b" - integrity sha512-vRXVqSg1VhDnB8bWcmvLzmg0Bt9CRKVgHPXqYwvWMX3TvAjeO+nRuK6+VdTKCtWOvYlmkF/HqNAL/z+N3B53Kw== +"@jest/types@^28.1.1", "@jest/types@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" + integrity sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ== dependencies: - "@jest/schemas" "^28.0.2" + "@jest/schemas" "^28.1.3" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -2588,6 +2630,14 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.0", "@jridgewell/trace-mapping@^0.3.14", "@jridgewell/trace-mapping@^0.3.8", "@jridgewell/trace-mapping@^0.3.9": version "0.3.15" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" @@ -2777,6 +2827,10 @@ version "0.0.0" uid "" +"@kbn/core-apps-server-internal@link:bazel-bin/packages/core/apps/core-apps-server-internal": + version "0.0.0" + uid "" + "@kbn/core-base-browser-internal@link:bazel-bin/packages/core/base/core-base-browser-internal": version "0.0.0" uid "" @@ -3093,6 +3147,30 @@ version "0.0.0" uid "" +"@kbn/core-lifecycle-server-internal@link:bazel-bin/packages/core/lifecycle/core-lifecycle-server-internal": + version "0.0.0" + uid "" + +"@kbn/core-lifecycle-server-mocks@link:bazel-bin/packages/core/lifecycle/core-lifecycle-server-mocks": + version "0.0.0" + uid "" + +"@kbn/core-lifecycle-server@link:bazel-bin/packages/core/lifecycle/core-lifecycle-server": + version "0.0.0" + uid "" + +"@kbn/core-logging-browser-internal@link:bazel-bin/packages/core/logging/core-logging-browser-internal": + version "0.0.0" + uid "" + +"@kbn/core-logging-browser-mocks@link:bazel-bin/packages/core/logging/core-logging-browser-mocks": + version "0.0.0" + uid "" + +"@kbn/core-logging-common-internal@link:bazel-bin/packages/core/logging/core-logging-common-internal": + version "0.0.0" + uid "" + "@kbn/core-logging-server-internal@link:bazel-bin/packages/core/logging/core-logging-server-internal": version "0.0.0" uid "" @@ -3185,6 +3263,18 @@ version "0.0.0" uid "" +"@kbn/core-plugins-server-internal@link:bazel-bin/packages/core/plugins/core-plugins-server-internal": + version "0.0.0" + uid "" + +"@kbn/core-plugins-server-mocks@link:bazel-bin/packages/core/plugins/core-plugins-server-mocks": + version "0.0.0" + uid "" + +"@kbn/core-plugins-server@link:bazel-bin/packages/core/plugins/core-plugins-server": + version "0.0.0" + uid "" + "@kbn/core-preboot-server-internal@link:bazel-bin/packages/core/preboot/core-preboot-server-internal": version "0.0.0" uid "" @@ -4312,16 +4402,6 @@ dependencies: mkdirp "^1.0.4" -"@octokit/app@^2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@octokit/app/-/app-2.2.2.tgz#a1b8248f64159eeccbe4000d888fdae4163c4ad8" - integrity sha512-nUwS8jW107ROGuI0Tq4Ga+Zno6CovwaS+Oen6BOKJmoFMLqqB3oXeGZ6InkidtdmUNiYhMtNq2lydb0WVLT8Zg== - dependencies: - "@octokit/request" "^2.1.2" - "@types/lru-cache" "^5.1.0" - jsonwebtoken "^8.3.0" - lru-cache "^5.1.1" - "@octokit/auth-token@^2.4.0": version "2.4.4" resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.4.tgz#ee31c69b01d0378c12fd3ffe406030f3d94d3b56" @@ -4349,16 +4429,6 @@ before-after-hook "^2.2.0" universal-user-agent "^6.0.0" -"@octokit/endpoint@^3.2.0": - version "3.2.3" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-3.2.3.tgz#bd9aea60cd94ce336656b57a5c9cb7f10be8f4f3" - integrity sha512-yUPCt4vMIOclox13CUxzuKiPJIFo46b/6GhUnUTw5QySczN1L0DtSxgmIZrZV4SAb9EyAqrceoyrWoYVnfF2AA== - dependencies: - deepmerge "3.2.0" - is-plain-object "^2.0.4" - universal-user-agent "^2.0.1" - url-template "^2.0.8" - "@octokit/endpoint@^6.0.1": version "6.0.6" resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.6.tgz#4f09f2b468976b444742a1d5069f6fa45826d999" @@ -4431,13 +4501,6 @@ "@octokit/types" "6.40.0" deprecation "^2.3.1" -"@octokit/plugin-retry@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-retry/-/plugin-retry-2.2.0.tgz#11f3957a46ccdb7b7f33caabf8c17e57b25b80b2" - integrity sha512-x5Kd8Lke+a4hTDCe5akZxpGmVwu1eeVt2FJX0jeo3CxHGbfHbXb4zhN5quKfGL9oBLV/EdHQIJ6zwIMjuzxOlw== - dependencies: - bottleneck "^2.15.3" - "@octokit/request-error@^1.0.2": version "1.2.1" resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-1.2.1.tgz#ede0714c773f32347576c25649dc013ae6b31801" @@ -4465,18 +4528,6 @@ deprecation "^2.0.0" once "^1.4.0" -"@octokit/request@^2.1.2", "@octokit/request@^2.4.2": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-2.4.2.tgz#87c36e820dd1e43b1629f4f35c95b00cd456320b" - integrity sha512-lxVlYYvwGbKSHXfbPk5vxEA8w4zHOH1wobado4a9EfsyD3Cbhuhus1w0Ye9Ro0eMubGO8kNy5d+xNFisM3Tvaw== - dependencies: - "@octokit/endpoint" "^3.2.0" - deprecation "^1.0.1" - is-plain-object "^2.0.4" - node-fetch "^2.3.0" - once "^1.4.0" - universal-user-agent "^2.0.1" - "@octokit/request@^5.2.0": version "5.6.2" resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.2.tgz#1aa74d5da7b9e04ac60ef232edd9a7438dcf32d8" @@ -4501,7 +4552,7 @@ node-fetch "^2.6.7" universal-user-agent "^6.0.0" -"@octokit/rest@^16.23.2", "@octokit/rest@^16.35.0": +"@octokit/rest@^16.35.0": version "16.43.2" resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.43.2.tgz#c53426f1e1d1044dee967023e3279c50993dd91b" integrity sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ== @@ -4851,6 +4902,11 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.23.5.tgz#93f7b9f4e3285a7a9ade7557d9a8d36809cbc47d" integrity sha512-AFBVi/iT4g20DHoujvMH1aEDn8fGJh4xsRGCP6d8RpLPMqsNPvW01Jcn0QysXTsg++/xj25NmJsGyH9xug/wKg== +"@sinclair/typebox@^0.24.1": + version "0.24.46" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.46.tgz#57501b58023776dbbae9e25619146286440be34c" + integrity sha512-ng4ut1z2MCBhK/NwDVwIQp3pAUOCs/KNaW3cBxdFB2xTDrOuo1xuNmpr/9HHFhxqIvHrs1NTH3KJg6q+JSy1Kw== + "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -4868,10 +4924,10 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" - integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== +"@sinonjs/fake-timers@^8.0.1": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz#3fdc2b6cb58935b21bfb8d1625eb1300484316e7" + integrity sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg== dependencies: "@sinonjs/commons" "^1.7.0" @@ -5818,34 +5874,33 @@ dependencies: defer-to-connect "^2.0.0" -"@tanstack/match-sorter-utils@^8.0.0-alpha.82": +"@tanstack/match-sorter-utils@8.1.1", "@tanstack/match-sorter-utils@^8.1.1": version "8.1.1" resolved "https://registry.yarnpkg.com/@tanstack/match-sorter-utils/-/match-sorter-utils-8.1.1.tgz#895f407813254a46082a6bbafad9b39b943dc834" integrity sha512-IdmEekEYxQsoLOR0XQyw3jD1GujBpRRYaGJYQUw1eOT1eUugWxdc7jomh1VQ1EKHcdwDLpLaCz/8y4KraU4T9A== dependencies: remove-accents "0.4.2" -"@tanstack/query-core@^4.0.0-beta.1", "@tanstack/query-core@^4.2.1": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.2.1.tgz#21ff3a33f27bf038c990ea53af89cf7c7e8078fc" - integrity sha512-UOyOhHKLS/5i9qG2iUnZNVV3R9riJJmG9eG+hnMFIPT/oRh5UzAfjxCtBneNgPQZLDuP8y6YtRYs/n4qVAD5Ng== +"@tanstack/query-core@4.13.4": + version "4.13.4" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.13.4.tgz#77043e066586359eca40859803acc4a44e2a2dc8" + integrity sha512-DMIy6tgGehYoRUFyoR186+pQspOicyZNSGvBWxPc2CinHjWOQ7DPnGr9zmn/kE9xK4Zd3GXd25Nj3X20+TF6Lw== -"@tanstack/react-query-devtools@^4.2.1": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@tanstack/react-query-devtools/-/react-query-devtools-4.2.1.tgz#decee3d1d174b253fa303d5baaa478fb0e2c0e63" - integrity sha512-k7Ch3qvs8U74aRMMRvNisxcxZFTzk8FDdvpQKXxSZ8fsD4ZwpM0MoUSqKsCXbfTvUI7MJiGxavy1YlvImPNO+Q== +"@tanstack/react-query-devtools@^4.13.4": + version "4.13.4" + resolved "https://registry.yarnpkg.com/@tanstack/react-query-devtools/-/react-query-devtools-4.13.4.tgz#d631961fbb0803d2246cdf39dd2e35f443a88b6e" + integrity sha512-G0ZG+ZUk8ktJoi6Mzn4U7LnSOVbVFPyBJGB3dX4+SukkcKhWmErsYv2H1plRCL+V01Cg+dOg9RDfGYqsNbJszQ== dependencies: - "@tanstack/match-sorter-utils" "^8.0.0-alpha.82" - "@types/use-sync-external-store" "^0.0.3" + "@tanstack/match-sorter-utils" "^8.1.1" + superjson "^1.10.0" use-sync-external-store "^1.2.0" -"@tanstack/react-query@^4.2.1": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-4.2.1.tgz#1f00f03573b35a353e62fa64f904bbb0286a1808" - integrity sha512-w02oTOYpoxoBzD/onAGRQNeLAvggLn7WZjS811cT05WAE/4Q3br0PTp388M7tnmyYGbgOOhFq0MkhH0wIfAKqA== +"@tanstack/react-query@^4.13.4": + version "4.13.4" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-4.13.4.tgz#6264e5513245a8cbec1195ba6ed9647d9230a520" + integrity sha512-OHkUulPorHDiWNcUrcSUNxedeZ28z9kCKRG3JY+aJ8dFH/o4fixtac4ys0lwCP/n/VL1XMPnu+/CXEhbXHyJZA== dependencies: - "@tanstack/query-core" "^4.0.0-beta.1" - "@types/use-sync-external-store" "^0.0.3" + "@tanstack/query-core" "4.13.4" use-sync-external-store "^1.2.0" "@testim/chrome-version@^1.1.3": @@ -5853,10 +5908,10 @@ resolved "https://registry.yarnpkg.com/@testim/chrome-version/-/chrome-version-1.1.3.tgz#fbb68696899d7b8c1b9b891eded9c04fe2cd5529" integrity sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A== -"@testing-library/dom@^8.0.0", "@testing-library/dom@^8.12.0": - version "8.12.0" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.12.0.tgz#fef5e545533fb084175dda6509ee71d7d2f72e23" - integrity sha512-rBrJk5WjI02X1edtiUcZhgyhgBhiut96r5Jp8J5qktKdcvLcZpKDW8i2hkGMMItxrghjXuQ5AM6aE0imnFawaw== +"@testing-library/dom@^8.0.0", "@testing-library/dom@^8.17.1": + version "8.17.1" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.17.1.tgz#2d7af4ff6dad8d837630fecd08835aee08320ad7" + integrity sha512-KnH2MnJUzmFNPW6RIKfd+zf2Wue8mEKX0M3cpX6aKl5ZXrJM1/c/Pc8c2xDNYQCnJO48Sm5ITbMXgqTr3h4jxQ== dependencies: "@babel/code-frame" "^7.10.4" "@babel/runtime" "^7.12.5" @@ -5867,30 +5922,27 @@ lz-string "^1.4.4" pretty-format "^27.0.2" -"@testing-library/jest-dom@^5.16.3": - version "5.16.3" - resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.16.3.tgz#b76851a909586113c20486f1679ffb4d8ec27bfa" - integrity sha512-u5DfKj4wfSt6akfndfu1eG06jsdyA/IUrlX2n3pyq5UXgXMhXY+NJb8eNK/7pqPWAhCKsCGWDdDO0zKMKAYkEA== +"@testing-library/jest-dom@^5.16.5": + version "5.16.5" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.16.5.tgz#3912846af19a29b2dbf32a6ae9c31ef52580074e" + integrity sha512-N5ixQ2qKpi5OLYfwQmUb/5mSV9LneAcaUfp32pn4yCnpb8r/Yz0pXFPck21dIicKmi+ta5WRAknkZCfA8refMA== dependencies: + "@adobe/css-tools" "^4.0.1" "@babel/runtime" "^7.9.2" "@types/testing-library__jest-dom" "^5.9.1" aria-query "^5.0.0" chalk "^3.0.0" - css "^3.0.0" css.escape "^1.5.1" dom-accessibility-api "^0.5.6" lodash "^4.17.15" redent "^3.0.0" -"@testing-library/react-hooks@^7.0.2": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-7.0.2.tgz#3388d07f562d91e7f2431a4a21b5186062ecfee0" - integrity sha512-dYxpz8u9m4q1TuzfcUApqi8iFfR6R0FaMbr2hjZJy1uC8z+bO/K4v8Gs9eogGKYQop7QsrBTFkv/BCF7MzD2Cg== +"@testing-library/react-hooks@^8.0.1": + version "8.0.1" + resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-8.0.1.tgz#0924bbd5b55e0c0c0502d1754657ada66947ca12" + integrity sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g== dependencies: "@babel/runtime" "^7.12.5" - "@types/react" ">=16.9.0" - "@types/react-dom" ">=16.9.0" - "@types/react-test-renderer" ">=16.9.0" react-error-boundary "^3.1.0" "@testing-library/react@^12.1.5": @@ -5914,6 +5966,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + "@trysound/sax@0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" @@ -6127,7 +6184,12 @@ resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.0.tgz#14264692a9d6e2fa4db3df5e56e94b5e25647ac0" integrity sha512-iIgQNzCm0v7QMhhe4Jjn9uRh+I6GoPmt03CbEtwx3ao8/EfoQcmgtqH4vQ5Db/lxiIGaWDv6nwvunuh0RyX0+A== -"@types/babel__core@*", "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.19", "@types/babel__core@^7.1.7": +"@types/async@^3.2.3": + version "3.2.15" + resolved "https://registry.yarnpkg.com/@types/async/-/async-3.2.15.tgz#26d4768fdda0e466f18d6c9918ca28cc89a4e1fe" + integrity sha512-PAmPfzvFA31mRoqZyTVsgJMsvbynR429UTTxhmfsUCrWGh3/fxOrzqBtaTPJsn4UtzTv4Vb0+/O7CARWb69N4g== + +"@types/babel__core@*", "@types/babel__core@^7.1.14", "@types/babel__core@^7.1.19": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== @@ -6138,7 +6200,25 @@ "@types/babel__template" "*" "@types/babel__traverse" "*" -"@types/babel__generator@*", "@types/babel__generator@^7.6.4": +"@types/babel__core@^7.0.0": + version "7.1.10" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.10.tgz#ca58fc195dd9734e77e57c6f2df565623636ab40" + integrity sha512-x8OM8XzITIMyiwl5Vmo2B1cR1S1Ipkyv4mdlbJjMa1lmuKvKY9FrBbEANIaMlnWn5Rf7uO+rC/VgYabNkE17Hw== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" + integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__generator@^7.6.4": version "7.6.4" resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== @@ -6649,13 +6729,6 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A== -"@types/http-proxy-agent@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@types/http-proxy-agent/-/http-proxy-agent-2.0.2.tgz#942c1f35c7e1f0edd1b6ffae5d0f9051cfb32be1" - integrity sha512-2S6IuBRhqUnH1/AUx9k8KWtY3Esg4eqri946MnxTG5HwehF1S5mqLln8fcyMiuQkY72p2gH3W+rIPqp5li0LyQ== - dependencies: - "@types/node" "*" - "@types/http-proxy@^1.17.4", "@types/http-proxy@^1.17.8": version "1.17.9" resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.9.tgz#7f0e7931343761efde1e2bf48c40f02f3f75705a" @@ -6715,7 +6788,7 @@ dependencies: "@types/jest" "*" -"@types/jest@*", "@types/jest@^26.0.16", "@types/jest@^26.0.22": +"@types/jest@*", "@types/jest@^26.0.16": version "26.0.22" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.22.tgz#8308a1debdf1b807aa47be2838acdcd91e88fbe6" integrity sha512-eeWwWjlqxvBxc4oQdkueW5OF/gtfSceKk4OnOAGlUSwS/liBRtZppbJuz1YkgbrbfGOoeBHun9fOvXnjNwrSOw== @@ -6723,6 +6796,14 @@ jest-diff "^26.0.0" pretty-format "^26.0.0" +"@types/jest@^27.4.1": + version "27.5.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.5.2.tgz#ec49d29d926500ffb9fd22b84262e862049c026c" + integrity sha512-mpT8LJJ4CMeeahobofYWIjFo0xonRS/HfxnVEPMPFSQdGUt1uHCnoPT7Zhb+sjDU2wz0oKV0OLUR0WzrHNgfeA== + dependencies: + jest-matcher-utils "^27.0.0" + pretty-format "^27.0.0" + "@types/joi@^17.2.3": version "17.2.3" resolved "https://registry.yarnpkg.com/@types/joi/-/joi-17.2.3.tgz#b7768ed9d84f1ebd393328b9f97c1cf3d2b94798" @@ -6760,1374 +6841,38 @@ "@types/jsdom@^16.2.14": version "16.2.14" resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-16.2.14.tgz#26fe9da6a8870715b154bb84cd3b2e53433d8720" - integrity sha512-6BAy1xXEmMuHeAJ4Fv4yXKwBDTGTOseExKE3OaHiNycdHdZw59KfYzrt0DkDluvwmik1HRt6QS7bImxUmpSy+w== - dependencies: - "@types/node" "*" - "@types/parse5" "*" - "@types/tough-cookie" "*" - -"@types/json-schema@*", "@types/json-schema@^7", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": - version "7.0.11" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" - integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== - -"@types/json-stable-stringify@^1.0.32": - version "1.0.32" - resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.32.tgz#121f6917c4389db3923640b2e68de5fa64dda88e" - integrity sha512-q9Q6+eUEGwQkv4Sbst3J4PNgDOvpuVuKj79Hl/qnmBMEIPzB5QoFRUtjcgcg2xNUZyYUGXBk5wYIBKHt0A+Mxw== - -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= - -"@types/json5@^0.0.30": - version "0.0.30" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.30.tgz#44cb52f32a809734ca562e685c6473b5754a7818" - integrity sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA== - -"@types/jsonwebtoken@^8.5.6": - version "8.5.6" - resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.6.tgz#1913e5a61e70a192c5a444623da4901a7b1a9d42" - integrity sha512-+P3O/xC7nzVizIi5VbF34YtqSonFsdnbXBnWUCYRiKOi1f9gA4sEFvXkrGr/QVV23IbMYvcoerI7nnhDUiWXRQ== - dependencies: - "@types/node" "*" - -"@types/kbn__ace@link:bazel-bin/packages/kbn-ace/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__aiops-components@link:bazel-bin/x-pack/packages/ml/aiops_components/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__aiops-utils@link:bazel-bin/x-pack/packages/ml/aiops_utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__alerts@link:bazel-bin/packages/kbn-alerts/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__analytics-client@link:bazel-bin/packages/analytics/client/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__analytics-shippers-elastic-v3-browser@link:bazel-bin/packages/analytics/shippers/elastic_v3/browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__analytics-shippers-elastic-v3-common@link:bazel-bin/packages/analytics/shippers/elastic_v3/common/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__analytics-shippers-elastic-v3-server@link:bazel-bin/packages/analytics/shippers/elastic_v3/server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__analytics-shippers-fullstory@link:bazel-bin/packages/analytics/shippers/fullstory/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__analytics-shippers-gainsight@link:bazel-bin/packages/analytics/shippers/gainsight/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__analytics@link:bazel-bin/packages/kbn-analytics/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__apm-config-loader@link:bazel-bin/packages/kbn-apm-config-loader/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__apm-synthtrace@link:bazel-bin/packages/kbn-apm-synthtrace/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__apm-utils@link:bazel-bin/packages/kbn-apm-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__axe-config@link:bazel-bin/packages/kbn-axe-config/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__bazel-packages@link:bazel-bin/packages/kbn-bazel-packages/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__bazel-runner@link:bazel-bin/packages/kbn-bazel-runner/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__cases-components@link:bazel-bin/packages/kbn-cases-components/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__chart-icons@link:bazel-bin/packages/kbn-chart-icons/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ci-stats-core@link:bazel-bin/packages/kbn-ci-stats-core/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ci-stats-performance-metrics@link:bazel-bin/packages/kbn-ci-stats-performance-metrics/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ci-stats-reporter@link:bazel-bin/packages/kbn-ci-stats-reporter/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__cli-dev-mode@link:bazel-bin/packages/kbn-cli-dev-mode/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__coloring@link:bazel-bin/packages/kbn-coloring/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__config-mocks@link:bazel-bin/packages/kbn-config-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__config-schema@link:bazel-bin/packages/kbn-config-schema/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__config@link:bazel-bin/packages/kbn-config/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__content-management-table-list@link:bazel-bin/packages/content-management/table_list/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-analytics-browser-internal@link:bazel-bin/packages/core/analytics/core-analytics-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-analytics-browser-mocks@link:bazel-bin/packages/core/analytics/core-analytics-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-analytics-browser@link:bazel-bin/packages/core/analytics/core-analytics-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-analytics-server-internal@link:bazel-bin/packages/core/analytics/core-analytics-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-analytics-server-mocks@link:bazel-bin/packages/core/analytics/core-analytics-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-analytics-server@link:bazel-bin/packages/core/analytics/core-analytics-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-application-browser-internal@link:bazel-bin/packages/core/application/core-application-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-application-browser-mocks@link:bazel-bin/packages/core/application/core-application-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-application-browser@link:bazel-bin/packages/core/application/core-application-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-application-common@link:bazel-bin/packages/core/application/core-application-common/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-apps-browser-internal@link:bazel-bin/packages/core/apps/core-apps-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-apps-browser-mocks@link:bazel-bin/packages/core/apps/core-apps-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-base-browser-internal@link:bazel-bin/packages/core/base/core-base-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-base-browser-mocks@link:bazel-bin/packages/core/base/core-base-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-base-browser@link:bazel-bin/packages/core/base/core-base-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-base-common-internal@link:bazel-bin/packages/core/base/core-base-common-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-base-common@link:bazel-bin/packages/core/base/core-base-common/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-base-server-internal@link:bazel-bin/packages/core/base/core-base-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-base-server-mocks@link:bazel-bin/packages/core/base/core-base-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-base-server@link:bazel-bin/packages/core/base/core-base-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-capabilities-browser-internal@link:bazel-bin/packages/core/capabilities/core-capabilities-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-capabilities-browser-mocks@link:bazel-bin/packages/core/capabilities/core-capabilities-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-capabilities-common@link:bazel-bin/packages/core/capabilities/core-capabilities-common/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-capabilities-server-internal@link:bazel-bin/packages/core/capabilities/core-capabilities-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-capabilities-server-mocks@link:bazel-bin/packages/core/capabilities/core-capabilities-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-capabilities-server@link:bazel-bin/packages/core/capabilities/core-capabilities-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-chrome-browser-internal@link:bazel-bin/packages/core/chrome/core-chrome-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-chrome-browser-mocks@link:bazel-bin/packages/core/chrome/core-chrome-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-chrome-browser@link:bazel-bin/packages/core/chrome/core-chrome-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-common-internal-base@link:bazel-bin/packages/core/common/internal-base/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-config-server-internal@link:bazel-bin/packages/core/config/core-config-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-config-server-mocks@link:bazel-bin/packages/core/config/core-config-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-deprecations-browser-internal@link:bazel-bin/packages/core/deprecations/core-deprecations-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-deprecations-browser-mocks@link:bazel-bin/packages/core/deprecations/core-deprecations-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-deprecations-browser@link:bazel-bin/packages/core/deprecations/core-deprecations-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-deprecations-common@link:bazel-bin/packages/core/deprecations/core-deprecations-common/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-deprecations-server-internal@link:bazel-bin/packages/core/deprecations/core-deprecations-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-deprecations-server-mocks@link:bazel-bin/packages/core/deprecations/core-deprecations-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-deprecations-server@link:bazel-bin/packages/core/deprecations/core-deprecations-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-doc-links-browser-internal@link:bazel-bin/packages/core/doc-links/core-doc-links-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-doc-links-browser-mocks@link:bazel-bin/packages/core/doc-links/core-doc-links-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-doc-links-browser@link:bazel-bin/packages/core/doc-links/core-doc-links-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-doc-links-server-internal@link:bazel-bin/packages/core/doc-links/core-doc-links-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-doc-links-server-mocks@link:bazel-bin/packages/core/doc-links/core-doc-links-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-doc-links-server@link:bazel-bin/packages/core/doc-links/core-doc-links-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-elasticsearch-client-server-internal@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-elasticsearch-client-server-mocks@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-elasticsearch-client-server@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-elasticsearch-server-internal@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-elasticsearch-server-mocks@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-elasticsearch-server@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-environment-server-internal@link:bazel-bin/packages/core/environment/core-environment-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-environment-server-mocks@link:bazel-bin/packages/core/environment/core-environment-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-execution-context-browser-internal@link:bazel-bin/packages/core/execution-context/core-execution-context-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-execution-context-browser-mocks@link:bazel-bin/packages/core/execution-context/core-execution-context-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-execution-context-browser@link:bazel-bin/packages/core/execution-context/core-execution-context-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-execution-context-common@link:bazel-bin/packages/core/execution-context/core-execution-context-common/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-execution-context-server-internal@link:bazel-bin/packages/core/execution-context/core-execution-context-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-execution-context-server-mocks@link:bazel-bin/packages/core/execution-context/core-execution-context-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-execution-context-server@link:bazel-bin/packages/core/execution-context/core-execution-context-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-fatal-errors-browser-internal@link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-fatal-errors-browser-mocks@link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-fatal-errors-browser@link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-browser-internal@link:bazel-bin/packages/core/http/core-http-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-browser-mocks@link:bazel-bin/packages/core/http/core-http-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-browser@link:bazel-bin/packages/core/http/core-http-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-common@link:bazel-bin/packages/core/http/core-http-common/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-context-server-internal@link:bazel-bin/packages/core/http/core-http-context-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-context-server-mocks@link:bazel-bin/packages/core/http/core-http-context-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-request-handler-context-server-internal@link:bazel-bin/packages/core/http/core-http-request-handler-context-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-request-handler-context-server@link:bazel-bin/packages/core/http/core-http-request-handler-context-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-resources-server-internal@link:bazel-bin/packages/core/http/core-http-resources-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-resources-server-mocks@link:bazel-bin/packages/core/http/core-http-resources-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-resources-server@link:bazel-bin/packages/core/http/core-http-resources-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-router-server-internal@link:bazel-bin/packages/core/http/core-http-router-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-router-server-mocks@link:bazel-bin/packages/core/http/core-http-router-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-server-internal@link:bazel-bin/packages/core/http/core-http-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-server-mocks@link:bazel-bin/packages/core/http/core-http-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-http-server@link:bazel-bin/packages/core/http/core-http-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-i18n-browser-internal@link:bazel-bin/packages/core/i18n/core-i18n-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-i18n-browser-mocks@link:bazel-bin/packages/core/i18n/core-i18n-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-i18n-browser@link:bazel-bin/packages/core/i18n/core-i18n-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-i18n-server-internal@link:bazel-bin/packages/core/i18n/core-i18n-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-i18n-server-mocks@link:bazel-bin/packages/core/i18n/core-i18n-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-i18n-server@link:bazel-bin/packages/core/i18n/core-i18n-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-injected-metadata-browser-internal@link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-injected-metadata-browser-mocks@link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-injected-metadata-browser@link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-injected-metadata-common-internal@link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-common-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-integrations-browser-internal@link:bazel-bin/packages/core/integrations/core-integrations-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-integrations-browser-mocks@link:bazel-bin/packages/core/integrations/core-integrations-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-lifecycle-browser-internal@link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-lifecycle-browser-mocks@link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-lifecycle-browser@link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-logging-server-internal@link:bazel-bin/packages/core/logging/core-logging-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-logging-server-mocks@link:bazel-bin/packages/core/logging/core-logging-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-logging-server@link:bazel-bin/packages/core/logging/core-logging-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-metrics-collectors-server-internal@link:bazel-bin/packages/core/metrics/core-metrics-collectors-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-metrics-collectors-server-mocks@link:bazel-bin/packages/core/metrics/core-metrics-collectors-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-metrics-server-internal@link:bazel-bin/packages/core/metrics/core-metrics-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-metrics-server-mocks@link:bazel-bin/packages/core/metrics/core-metrics-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-metrics-server@link:bazel-bin/packages/core/metrics/core-metrics-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-mount-utils-browser-internal@link:bazel-bin/packages/core/mount-utils/core-mount-utils-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-mount-utils-browser@link:bazel-bin/packages/core/mount-utils/core-mount-utils-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-node-server-internal@link:bazel-bin/packages/core/node/core-node-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-node-server-mocks@link:bazel-bin/packages/core/node/core-node-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-node-server@link:bazel-bin/packages/core/node/core-node-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-notifications-browser-internal@link:bazel-bin/packages/core/notifications/core-notifications-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-notifications-browser-mocks@link:bazel-bin/packages/core/notifications/core-notifications-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-notifications-browser@link:bazel-bin/packages/core/notifications/core-notifications-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-overlays-browser-internal@link:bazel-bin/packages/core/overlays/core-overlays-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-overlays-browser-mocks@link:bazel-bin/packages/core/overlays/core-overlays-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-overlays-browser@link:bazel-bin/packages/core/overlays/core-overlays-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-plugins-base-server-internal@link:bazel-bin/packages/core/plugins/core-plugins-base-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-plugins-browser-internal@link:bazel-bin/packages/core/plugins/core-plugins-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-plugins-browser-mocks@link:bazel-bin/packages/core/plugins/core-plugins-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-plugins-browser@link:bazel-bin/packages/core/plugins/core-plugins-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-preboot-server-internal@link:bazel-bin/packages/core/preboot/core-preboot-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-preboot-server-mocks@link:bazel-bin/packages/core/preboot/core-preboot-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-preboot-server@link:bazel-bin/packages/core/preboot/core-preboot-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-public-internal-base@link:bazel-bin/packages/core/public/internal-base/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-rendering-browser-internal@link:bazel-bin/packages/core/rendering/core-rendering-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-rendering-browser-mocks@link:bazel-bin/packages/core/rendering/core-rendering-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-rendering-server-internal@link:bazel-bin/packages/core/rendering/core-rendering-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-rendering-server-mocks@link:bazel-bin/packages/core/rendering/core-rendering-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-root-browser-internal@link:bazel-bin/packages/core/root/core-root-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-api-browser@link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-api-server-internal@link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-api-server-mocks@link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-api-server@link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-base-server-internal@link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-base-server-mocks@link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-browser-internal@link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-browser-mocks@link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-browser@link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-common@link:bazel-bin/packages/core/saved-objects/core-saved-objects-common/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-import-export-server-internal@link:bazel-bin/packages/core/saved-objects/core-saved-objects-import-export-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-import-export-server-mocks@link:bazel-bin/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-migration-server-internal@link:bazel-bin/packages/core/saved-objects/core-saved-objects-migration-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-migration-server-mocks@link:bazel-bin/packages/core/saved-objects/core-saved-objects-migration-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-server-internal@link:bazel-bin/packages/core/saved-objects/core-saved-objects-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-server-mocks@link:bazel-bin/packages/core/saved-objects/core-saved-objects-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-server@link:bazel-bin/packages/core/saved-objects/core-saved-objects-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-saved-objects-utils-server@link:bazel-bin/packages/core/saved-objects/core-saved-objects-utils-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-server-internal-base@link:bazel-bin/packages/core/server/internal-base/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-status-common-internal@link:bazel-bin/packages/core/status/core-status-common-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-status-common@link:bazel-bin/packages/core/status/core-status-common/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-status-server-internal@link:bazel-bin/packages/core/status/core-status-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-status-server-mocks@link:bazel-bin/packages/core/status/core-status-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-status-server@link:bazel-bin/packages/core/status/core-status-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-test-helpers-deprecations-getters@link:bazel-bin/packages/core/test-helpers/core-test-helpers-deprecations-getters/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-test-helpers-http-setup-browser@link:bazel-bin/packages/core/test-helpers/core-test-helpers-http-setup-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-test-helpers-so-type-serializer@link:bazel-bin/packages/core/test-helpers/core-test-helpers-so-type-serializer/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-test-helpers-test-utils@link:bazel-bin/packages/core/test-helpers/core-test-helpers-test-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-theme-browser-internal@link:bazel-bin/packages/core/theme/core-theme-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-theme-browser-mocks@link:bazel-bin/packages/core/theme/core-theme-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-theme-browser@link:bazel-bin/packages/core/theme/core-theme-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-ui-settings-browser-internal@link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-ui-settings-browser-mocks@link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-ui-settings-browser@link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-ui-settings-common@link:bazel-bin/packages/core/ui-settings/core-ui-settings-common/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-ui-settings-server-internal@link:bazel-bin/packages/core/ui-settings/core-ui-settings-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-ui-settings-server-mocks@link:bazel-bin/packages/core/ui-settings/core-ui-settings-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-ui-settings-server@link:bazel-bin/packages/core/ui-settings/core-ui-settings-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-usage-data-base-server-internal@link:bazel-bin/packages/core/usage-data/core-usage-data-base-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-usage-data-server-internal@link:bazel-bin/packages/core/usage-data/core-usage-data-server-internal/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-usage-data-server-mocks@link:bazel-bin/packages/core/usage-data/core-usage-data-server-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__core-usage-data-server@link:bazel-bin/packages/core/usage-data/core-usage-data-server/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__crypto-browser@link:bazel-bin/packages/kbn-crypto-browser/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__crypto@link:bazel-bin/packages/kbn-crypto/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__datemath@link:bazel-bin/packages/kbn-datemath/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__dev-cli-errors@link:bazel-bin/packages/kbn-dev-cli-errors/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__dev-cli-runner@link:bazel-bin/packages/kbn-dev-cli-runner/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__dev-proc-runner@link:bazel-bin/packages/kbn-dev-proc-runner/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__dev-utils@link:bazel-bin/packages/kbn-dev-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__doc-links@link:bazel-bin/packages/kbn-doc-links/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__docs-utils@link:bazel-bin/packages/kbn-docs-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ebt-tools@link:bazel-bin/packages/kbn-ebt-tools/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__es-archiver@link:bazel-bin/packages/kbn-es-archiver/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__es-errors@link:bazel-bin/packages/kbn-es-errors/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__es-query@link:bazel-bin/packages/kbn-es-query/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__es-types@link:bazel-bin/packages/kbn-es-types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__eslint-plugin-disable@link:bazel-bin/packages/kbn-eslint-plugin-disable/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__eslint-plugin-imports@link:bazel-bin/packages/kbn-eslint-plugin-imports/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__failed-test-reporter-cli@link:bazel-bin/packages/kbn-failed-test-reporter-cli/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__field-types@link:bazel-bin/packages/kbn-field-types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__find-used-node-modules@link:bazel-bin/packages/kbn-find-used-node-modules/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ftr-common-functional-services@link:bazel-bin/packages/kbn-ftr-common-functional-services/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ftr-screenshot-filename@link:bazel-bin/packages/kbn-ftr-screenshot-filename/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__generate@link:bazel-bin/packages/kbn-generate/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__get-repo-files@link:bazel-bin/packages/kbn-get-repo-files/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__guided-onboarding@link:bazel-bin/packages/kbn-guided-onboarding/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__handlebars@link:bazel-bin/packages/kbn-handlebars/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__hapi-mocks@link:bazel-bin/packages/kbn-hapi-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__home-sample-data-card@link:bazel-bin/packages/home/sample_data_card/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__home-sample-data-tab@link:bazel-bin/packages/home/sample_data_tab/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__home-sample-data-types@link:bazel-bin/packages/home/sample_data_types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__i18n-react@link:bazel-bin/packages/kbn-i18n-react/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__i18n@link:bazel-bin/packages/kbn-i18n/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__import-resolver@link:bazel-bin/packages/kbn-import-resolver/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__interpreter@link:bazel-bin/packages/kbn-interpreter/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__io-ts-utils@link:bazel-bin/packages/kbn-io-ts-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__jest-serializers@link:bazel-bin/packages/kbn-jest-serializers/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__journeys@link:bazel-bin/packages/kbn-journeys/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__kbn-ci-stats-performance-metrics@link:bazel-bin/packages/kbn-kbn-ci-stats-performance-metrics/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__kibana-manifest-schema@link:bazel-bin/packages/kbn-kibana-manifest-schema/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__language-documentation-popover@link:bazel-bin/packages/kbn-language-documentation-popover/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__logging-mocks@link:bazel-bin/packages/kbn-logging-mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__logging@link:bazel-bin/packages/kbn-logging/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__managed-vscode-config-cli@link:bazel-bin/packages/kbn-managed-vscode-config-cli/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__managed-vscode-config@link:bazel-bin/packages/kbn-managed-vscode-config/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__mapbox-gl@link:bazel-bin/packages/kbn-mapbox-gl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ml-agg-utils@link:bazel-bin/x-pack/packages/ml/agg_utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ml-is-populated-object@link:bazel-bin/x-pack/packages/ml/is_populated_object/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ml-string-hash@link:bazel-bin/x-pack/packages/ml/string_hash/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__monaco@link:bazel-bin/packages/kbn-monaco/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__optimizer-webpack-helpers@link:bazel-bin/packages/kbn-optimizer-webpack-helpers/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__optimizer@link:bazel-bin/packages/kbn-optimizer/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__osquery-io-ts-types@link:bazel-bin/packages/kbn-osquery-io-ts-types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__performance-testing-dataset-extractor@link:bazel-bin/packages/kbn-performance-testing-dataset-extractor/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__plugin-discovery@link:bazel-bin/packages/kbn-plugin-discovery/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__plugin-generator@link:bazel-bin/packages/kbn-plugin-generator/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__plugin-helpers@link:bazel-bin/packages/kbn-plugin-helpers/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__react-field@link:bazel-bin/packages/kbn-react-field/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__repo-source-classifier-cli@link:bazel-bin/packages/kbn-repo-source-classifier-cli/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__repo-source-classifier@link:bazel-bin/packages/kbn-repo-source-classifier/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__rule-data-utils@link:bazel-bin/packages/kbn-rule-data-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-autocomplete@link:bazel-bin/packages/kbn-securitysolution-autocomplete/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-es-utils@link:bazel-bin/packages/kbn-securitysolution-es-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-exception-list-components@link:bazel-bin/packages/kbn-securitysolution-exception-list-components/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-hook-utils@link:bazel-bin/packages/kbn-securitysolution-hook-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-io-ts-alerting-types@link:bazel-bin/packages/kbn-securitysolution-io-ts-alerting-types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-io-ts-list-types@link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-io-ts-types@link:bazel-bin/packages/kbn-securitysolution-io-ts-types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-io-ts-utils@link:bazel-bin/packages/kbn-securitysolution-io-ts-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-list-api@link:bazel-bin/packages/kbn-securitysolution-list-api/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-list-constants@link:bazel-bin/packages/kbn-securitysolution-list-constants/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-list-hooks@link:bazel-bin/packages/kbn-securitysolution-list-hooks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-list-utils@link:bazel-bin/packages/kbn-securitysolution-list-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-rules@link:bazel-bin/packages/kbn-securitysolution-rules/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-t-grid@link:bazel-bin/packages/kbn-securitysolution-t-grid/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__securitysolution-utils@link:bazel-bin/packages/kbn-securitysolution-utils/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__server-http-tools@link:bazel-bin/packages/kbn-server-http-tools/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__server-route-repository@link:bazel-bin/packages/kbn-server-route-repository/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-svg@link:bazel-bin/packages/kbn-shared-svg/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-avatar-solution@link:bazel-bin/packages/shared-ux/avatar/solution/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-avatar-user-profile-components@link:bazel-bin/packages/shared-ux/avatar/user_profile/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-button-exit-full-screen-mocks@link:bazel-bin/packages/shared-ux/button/exit_full_screen/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-button-exit-full-screen-types@link:bazel-bin/packages/shared-ux/button/exit_full_screen/types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-button-exit-full-screen@link:bazel-bin/packages/shared-ux/button/exit_full_screen/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-button-toolbar@link:bazel-bin/packages/shared-ux/button_toolbar/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-card-no-data-mocks@link:bazel-bin/packages/shared-ux/card/no_data/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-card-no-data-types@link:bazel-bin/packages/shared-ux/card/no_data/types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-card-no-data@link:bazel-bin/packages/shared-ux/card/no_data/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-link-redirect-app-mocks@link:bazel-bin/packages/shared-ux/link/redirect_app/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-link-redirect-app-types@link:bazel-bin/packages/shared-ux/link/redirect_app/types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-link-redirect-app@link:bazel-bin/packages/shared-ux/link/redirect_app/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-markdown-mocks@link:bazel-bin/packages/shared-ux/markdown/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-markdown-types@link:bazel-bin/packages/shared-ux/markdown/types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-markdown@link:bazel-bin/packages/shared-ux/markdown/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-analytics-no-data-mocks@link:bazel-bin/packages/shared-ux/page/analytics_no_data/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-analytics-no-data-types@link:bazel-bin/packages/shared-ux/page/analytics_no_data/types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-analytics-no-data@link:bazel-bin/packages/shared-ux/page/analytics_no_data/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-kibana-no-data-mocks@link:bazel-bin/packages/shared-ux/page/kibana_no_data/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-kibana-no-data-types@link:bazel-bin/packages/shared-ux/page/kibana_no_data/types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-kibana-no-data@link:bazel-bin/packages/shared-ux/page/kibana_no_data/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-kibana-template-mocks@link:bazel-bin/packages/shared-ux/page/kibana_template/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-kibana-template-types@link:bazel-bin/packages/shared-ux/page/kibana_template/types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-kibana-template@link:bazel-bin/packages/shared-ux/page/kibana_template/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-no-data-config-mocks@link:bazel-bin/packages/shared-ux/page/no_data_config/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-no-data-config-types@link:bazel-bin/packages/shared-ux/page/no_data_config/types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-no-data-config@link:bazel-bin/packages/shared-ux/page/no_data_config/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-no-data-mocks@link:bazel-bin/packages/shared-ux/page/no_data/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-no-data-types@link:bazel-bin/packages/shared-ux/page/no_data/types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-no-data@link:bazel-bin/packages/shared-ux/page/no_data/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-page-solution-nav@link:bazel-bin/packages/shared-ux/page/solution_nav/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-prompt-no-data-views-mocks@link:bazel-bin/packages/shared-ux/prompt/no_data_views/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-prompt-no-data-views-types@link:bazel-bin/packages/shared-ux/prompt/no_data_views/types/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-prompt-no-data-views@link:bazel-bin/packages/shared-ux/prompt/no_data_views/impl/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-router-mocks@link:bazel-bin/packages/shared-ux/router/mocks/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-services@link:bazel-bin/packages/kbn-shared-ux-services/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-storybook-mock@link:bazel-bin/packages/shared-ux/storybook/mock/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-storybook@link:bazel-bin/packages/kbn-shared-ux-storybook/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__shared-ux-utility@link:bazel-bin/packages/kbn-shared-ux-utility/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__some-dev-log@link:bazel-bin/packages/kbn-some-dev-log/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__sort-package-json@link:bazel-bin/packages/kbn-sort-package-json/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__std@link:bazel-bin/packages/kbn-std/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__stdio-dev-helpers@link:bazel-bin/packages/kbn-stdio-dev-helpers/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__storybook@link:bazel-bin/packages/kbn-storybook/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__telemetry-tools@link:bazel-bin/packages/kbn-telemetry-tools/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__test-jest-helpers@link:bazel-bin/packages/kbn-test-jest-helpers/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__test-subj-selector@link:bazel-bin/packages/kbn-test-subj-selector/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__test@link:bazel-bin/packages/kbn-test/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__tooling-log@link:bazel-bin/packages/kbn-tooling-log/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__type-summarizer-cli@link:bazel-bin/packages/kbn-type-summarizer-cli/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__type-summarizer-core@link:bazel-bin/packages/kbn-type-summarizer-core/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__type-summarizer@link:bazel-bin/packages/kbn-type-summarizer/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__typed-react-router-config@link:bazel-bin/packages/kbn-typed-react-router-config/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ui-shared-deps-npm@link:bazel-bin/packages/kbn-ui-shared-deps-npm/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ui-shared-deps-src@link:bazel-bin/packages/kbn-ui-shared-deps-src/npm_module_types": - version "0.0.0" - uid "" - -"@types/kbn__ui-theme@link:bazel-bin/packages/kbn-ui-theme/npm_module_types": - version "0.0.0" - uid "" + integrity sha512-6BAy1xXEmMuHeAJ4Fv4yXKwBDTGTOseExKE3OaHiNycdHdZw59KfYzrt0DkDluvwmik1HRt6QS7bImxUmpSy+w== + dependencies: + "@types/node" "*" + "@types/parse5" "*" + "@types/tough-cookie" "*" -"@types/kbn__user-profile-components@link:bazel-bin/packages/kbn-user-profile-components/npm_module_types": - version "0.0.0" - uid "" +"@types/json-schema@*", "@types/json-schema@^7", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== -"@types/kbn__utility-types-jest@link:bazel-bin/packages/kbn-utility-types-jest/npm_module_types": - version "0.0.0" - uid "" +"@types/json-stable-stringify@^1.0.32": + version "1.0.32" + resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.32.tgz#121f6917c4389db3923640b2e68de5fa64dda88e" + integrity sha512-q9Q6+eUEGwQkv4Sbst3J4PNgDOvpuVuKj79Hl/qnmBMEIPzB5QoFRUtjcgcg2xNUZyYUGXBk5wYIBKHt0A+Mxw== -"@types/kbn__utility-types@link:bazel-bin/packages/kbn-utility-types/npm_module_types": - version "0.0.0" - uid "" +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/kbn__utils@link:bazel-bin/packages/kbn-utils/npm_module_types": - version "0.0.0" - uid "" +"@types/json5@^0.0.30": + version "0.0.30" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.30.tgz#44cb52f32a809734ca562e685c6473b5754a7818" + integrity sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA== -"@types/kbn__yarn-lock-validator@link:bazel-bin/packages/kbn-yarn-lock-validator/npm_module_types": - version "0.0.0" - uid "" +"@types/jsonwebtoken@^8.5.6": + version "8.5.6" + resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.6.tgz#1913e5a61e70a192c5a444623da4901a7b1a9d42" + integrity sha512-+P3O/xC7nzVizIi5VbF34YtqSonFsdnbXBnWUCYRiKOi1f9gA4sEFvXkrGr/QVV23IbMYvcoerI7nnhDUiWXRQ== + dependencies: + "@types/node" "*" "@types/keyv@*": version "3.1.1" @@ -8451,7 +7196,7 @@ dependencies: "@types/node" "*" -"@types/prettier@^2.0.0", "@types/prettier@^2.3.2": +"@types/prettier@^2.0.0", "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.3.2" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3" integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== @@ -8515,7 +7260,7 @@ dependencies: "@types/react" "*" -"@types/react-dom@<18.0.0", "@types/react-dom@>=16.9.0", "@types/react-dom@^17.0.17": +"@types/react-dom@<18.0.0", "@types/react-dom@^17.0.17": version "17.0.17" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.17.tgz#2e3743277a793a96a99f1bf87614598289da68a1" integrity sha512-VjnqEmqGnasQKV0CWLevqMTXBYG9GbwuE6x3VetERLh0cq2LTptFE73MrQi2S7GkKXCf2GgwItB/melLnxfnsg== @@ -8606,7 +7351,7 @@ dependencies: "@types/react" "*" -"@types/react-test-renderer@>=16.9.0", "@types/react-test-renderer@^17.0.2": +"@types/react-test-renderer@^17.0.2": version "17.0.2" resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-17.0.2.tgz#5f800a39b12ac8d2a2149e7e1885215bcf4edbbf" integrity sha512-+F1KONQTBHDBBhbHuT2GNydeMpPuviduXIVJRB7Y4nma4NR5DrTJfMMZ+jbhEHbpwL+Uqhs1WXh4KHiyrtYTPg== @@ -8649,7 +7394,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17", "@types/react@^17.0.45": +"@types/react@*", "@types/react@^17", "@types/react@^17.0.45": version "17.0.45" resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.45.tgz#9b3d5b661fd26365fefef0e766a1c6c30ccf7b3f" integrity sha512-YfhQ22Lah2e3CHPsb93tRwIGNiSwkuz1/blk4e6QrWS0jQzCSNbGLtOEYhPg02W0yGTTmpajp7dCTbBAMN3qsg== @@ -8696,7 +7441,7 @@ resolved "https://registry.yarnpkg.com/@types/resize-observer-browser/-/resize-observer-browser-0.1.5.tgz#36d897708172ac2380cd486da7a3daf1161c1e23" integrity sha512-8k/67Z95Goa6Lznuykxkfhq9YU3l1Qe6LNZmwde1u7802a3x8v44oq0j91DICclxatTr0rNnhXx7+VTIetSrSQ== -"@types/resolve@^1.20.1": +"@types/resolve@^1.17.1", "@types/resolve@^1.20.1": version "1.20.1" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.1.tgz#3727e48042fda81e374f5d5cf2fa92288bf698f8" integrity sha512-Ku5+GPFa12S3W26Uwtw+xyrtIpaZsGYHH6zxNbZlstmlvMYSZRzOwzwsXbxlVUbHyUucctSyuFtu6bNxwYomIw== @@ -8938,11 +7683,6 @@ dependencies: "@types/react" "*" -"@types/use-sync-external-store@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz#b6725d5f4af24ace33b36fafd295136e75509f43" - integrity sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA== - "@types/uuid@^3.4.4": version "3.4.4" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-3.4.4.tgz#7af69360fa65ef0decb41fd150bf4ca5c0cefdf5" @@ -9559,7 +8299,7 @@ JSONStream@1.3.5: jsonparse "^1.2.0" through ">=2.2.7 <3" -abab@^2.0.3, abab@^2.0.4: +abab@^2.0.3, abab@^2.0.4, abab@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" integrity sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q== @@ -9636,7 +8376,7 @@ acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.0, acorn@^7.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1: +acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1: version "8.8.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== @@ -9656,13 +8396,6 @@ after-all-results@^2.0.0: resolved "https://registry.yarnpkg.com/after-all-results/-/after-all-results-2.0.0.tgz#6ac2fc202b500f88da8f4f5530cfa100f4c6a2d0" integrity sha1-asL8ICtQD4jaj09VMM+hAPTGotA= -agent-base@4: - version "4.3.0" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" - integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== - dependencies: - es6-promisify "^5.0.0" - agent-base@6, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -10294,13 +9027,6 @@ async-foreach@^0.1.3: resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" integrity sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI= -async-retry@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.2.3.tgz#a6521f338358d322b1a0012b79030c6f411d1ce0" - integrity sha512-tfDb02Th6CE6pJUF2gjW5ZVjsgwlucVXOEQMvEX9JgSJMs9gAX+Nz3xRuJBKuUYjTSYORqvDBORdAQ3LU59g7Q== - dependencies: - retry "0.12.0" - async-value-promise@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/async-value-promise/-/async-value-promise-1.1.1.tgz#68957819e3eace804f3b4b69477e2bd276c15378" @@ -10338,7 +9064,7 @@ atob-lite@^2.0.0: resolved "https://registry.yarnpkg.com/atob-lite/-/atob-lite-2.0.0.tgz#0fef5ad46f1bd7a8502c65727f0367d5ee43d696" integrity sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY= -atob@^2.1.1, atob@^2.1.2: +atob@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== @@ -10451,18 +9177,18 @@ axobject-query@^2.2.0: resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== -babel-jest@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.6.3.tgz#d87d25cb0037577a0c89f82e5755c5d293c01056" - integrity sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA== - dependencies: - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/babel__core" "^7.1.7" - babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^26.6.2" +babel-jest@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" + integrity sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg== + dependencies: + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.1.1" + babel-preset-jest "^27.5.1" chalk "^4.0.0" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" slash "^3.0.0" babel-loader@^8.0.0, babel-loader@^8.2.5: @@ -10534,10 +9260,10 @@ babel-plugin-istanbul@^6.0.0, babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz#8185bd030348d254c6d7dd974355e6a28b21e62d" - integrity sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw== +babel-plugin-jest-hoist@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz#9be98ecf28c331eb9f5df9c72d6f89deb8181c2e" + integrity sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -10656,12 +9382,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz#747872b1171df032252426586881d62d31798fee" - integrity sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ== +babel-preset-jest@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz#91f10f58034cb7989cb4f962b69fa6eef6a6bc81" + integrity sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag== dependencies: - babel-plugin-jest-hoist "^26.6.2" + babel-plugin-jest-hoist "^27.5.1" babel-preset-current-node-syntax "^1.0.0" babel-runtime@6.x, babel-runtime@^6.26.0: @@ -10883,11 +9609,6 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= -bottleneck@^2.15.3: - version "2.18.0" - resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-2.18.0.tgz#41fa63ae185b65435d789d1700334bc48222dacf" - integrity sha512-U1xiBRaokw4yEguzikOl0VrnZp6uekjpmfrh6rKtr1D+/jFjYCL6J83ZXlGtlBDwVdTmJJ+4Lg5FpB3xmLSiyA== - bowser@^1.7.3: version "1.9.4" resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.4.tgz#890c58a2813a9d3243704334fa81b96a5c150c9a" @@ -11158,6 +9879,13 @@ builtin-status-codes@^3.0.0: resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= +busboy@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" + integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== + dependencies: + streamsearch "^1.1.0" + byte-size@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-8.1.0.tgz#6353d0bc14ab7a69abcefbf11f8db0145a862cb5" @@ -11591,13 +10319,14 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -chromedriver@^105.0.1: - version "105.0.1" - resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-105.0.1.tgz#325cf05aca200328176438991d236ddb6c61711b" - integrity sha512-QqylH9mvl4Ybq3mmHsym7jeq/LhEi2sPtD8ffd9ixiDFdPRlh2F4vzrzK+myj1MiXb0TYJK7+OCcMEmsB3Sm/Q== +chromedriver@^107.0.0: + version "107.0.0" + resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-107.0.0.tgz#9443ceb6020190f1a0f96ae6b5fad5453c0cd582" + integrity sha512-/VpGc83szXYUu9gBhCl6tg6XvtVwj2RQjOZ4wDA5TPSqudTMgWcMbkjeZbCfHwReJ9Qqo0hJ1jipG1IXWDxg3g== dependencies: "@testim/chrome-version" "^1.1.3" axios "^0.27.2" + compare-versions "^5.0.1" del "^6.1.1" extract-zip "^2.0.1" https-proxy-agent "^5.0.1" @@ -11622,10 +10351,10 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -cjs-module-lexer@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" - integrity sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw== +cjs-module-lexer@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" + integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== clamp@^1.0.1: version "1.0.1" @@ -11977,20 +10706,15 @@ commander@^5.0.0, commander@^5.1.0: resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== -commander@^6.1.0, commander@^6.2.1: +commander@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== -commander@^8.2.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" - integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== - -commander@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-9.0.0.tgz#86d58f24ee98126568936bd1d3574e0308a99a40" - integrity sha512-JJfP2saEKbQqvW+FI93OYUB4ByV5cizMpFMiiJI8xDbBvQvSkIk0VvQdn1CZ8mqAO8Loq2h0gYTYtDFUZUeERw== +commander@^9.4.0: + version "9.4.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" + integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw== common-path-prefix@^3.0.0: version "3.0.0" @@ -12012,6 +10736,11 @@ compare-versions@3.5.1: resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.5.1.tgz#26e1f5cf0d48a77eced5046b9f67b6b61075a393" integrity sha512-9fGPIB7C6AyM18CJJBHt5EnCZDG3oiTJYy0NjfIAGjKpzv0tkxWko7TNQHF5ymqm7IH03tqmeuBxtvD+Izh6mg== +compare-versions@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-5.0.1.tgz#14c6008436d994c3787aba38d4087fabe858555e" + integrity sha512-v8Au3l0b+Nwkp4G142JcgJFh1/TUhdxut7wzD1Nq1dyp5oa3tXaqb03EXOAB6jS4gMlalkjAUPZBMiAfKUixHQ== + component-emitter@^1.2.0, component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" @@ -12096,20 +10825,6 @@ config-chain@^1.1.12: ini "^1.3.4" proto-list "~1.2.1" -configstore@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-1.4.0.tgz#c35781d0501d268c25c54b8b17f6240e8a4fb021" - integrity sha1-w1eB0FAdJowlxUuLF/YkDopPsCE= - dependencies: - graceful-fs "^4.1.2" - mkdirp "^0.5.0" - object-assign "^4.0.1" - os-tmpdir "^1.0.0" - osenv "^0.1.0" - uuid "^2.0.1" - write-file-atomic "^1.1.2" - xdg-basedir "^2.0.0" - configstore@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" @@ -12159,7 +10874,7 @@ container-info@^1.0.1: resolved "https://registry.yarnpkg.com/container-info/-/container-info-1.0.1.tgz#6b383cb5e197c8d921e88983388facb04124b56b" integrity sha512-wk/+uJvPHOFG+JSwQS+fw6H6yw3Oyc8Kw9L4O2MN817uA90OqJ59nlZbbLPqDudsjJ7Tetee3pwExdKpd2ahjQ== -content-disposition@0.5.4, content-disposition@^0.5.4: +content-disposition@0.5.4: version "0.5.4" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== @@ -12205,6 +10920,13 @@ cookiejar@^2.1.0: resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.1.tgz#41ad57b1b555951ec171412a81942b1e8200d34a" integrity sha1-Qa1XsbVVlR7BcUEqgZQrHoIA00o= +copy-anything@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/copy-anything/-/copy-anything-3.0.2.tgz#7189171ff5e1893b2287e8bf574b8cd448ed50b1" + integrity sha512-CzATjGXzUQ0EvuvgOCI6A4BGOo2bcVx8B+eC2nF862iv9fopnPQwlrbACakNCHRIJbCSBj+J/9JeDf60k64MkA== + dependencies: + is-what "^4.1.6" + copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" @@ -12268,10 +10990,10 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.9: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== -core-js@^3.0.4, core-js@^3.25.5, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3: - version "3.25.5" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.25.5.tgz#e86f651a2ca8a0237a5f064c2fe56cef89646e27" - integrity sha512-nbm6eZSjm+ZuBQxCUPQKQCoUEfFOXjUZ8dTTyikyKaWrTYmAVbykQfwsKE5dBK88u3QCkCrzsx/PPlKfhsvgpw== +core-js@^3.0.4, core-js@^3.26.0, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3: + version "3.26.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.26.0.tgz#a516db0ed0811be10eac5d94f3b8463d03faccfe" + integrity sha512-+DkDrhoR4Y0PxDz6rurahuB+I45OsEUv8E1maPTB6OuHRohMMcznBq9TMpdpDMm/hUPob/mJJS3PqgbHpMTQgw== core-util-is@1.0.2, core-util-is@^1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -12573,15 +11295,6 @@ css@2.X, css@^2.2.1, css@^2.2.4: source-map-resolve "^0.5.2" urix "^0.1.0" -css@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d" - integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ== - dependencies: - inherits "^2.0.4" - source-map "^0.6.1" - source-map-resolve "^0.6.0" - csscolorparser@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/csscolorparser/-/csscolorparser-1.0.3.tgz#b34f391eea4da8f3e98231e2ccd8df9c041f171b" @@ -12663,7 +11376,7 @@ cssom@~0.3.6: resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== -cssstyle@^2.2.0: +cssstyle@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== @@ -12734,20 +11447,20 @@ cypress-react-selector@^3.0.0: dependencies: resq "1.10.2" -cypress-real-events@^1.7.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.7.1.tgz#8f430d67c29ea4f05b9c5b0311780120cbc9b935" - integrity sha512-/Bg15RgJ0SYsuXc6lPqH08x19z6j2vmhWN4wXfJqm3z8BTAFiK2MvipZPzxT8Z0jJP0q7kuniWrLIvz/i/8lCQ== +cypress-real-events@^1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.7.2.tgz#d04e6d3f15117ef485eb49f9c9b361f3a3413002" + integrity sha512-tOANHbFRlqVL5Lu8OozvxTsrYgHwCnWmXAULGc1kdBF+k1gxrrvT/42uez3AhGoT+HcytyxieXAVt0jNP4yrvA== cypress-recurse@^1.23.0: version "1.23.0" resolved "https://registry.yarnpkg.com/cypress-recurse/-/cypress-recurse-1.23.0.tgz#f87334747516de6737bc4708754e8f429057bc6d" integrity sha512-CAsdvynhuR3SUEXVJRO2jBEnZRJ6nJp7nMXHwzV4UQq9Lap3Bj72AwcJK0cl51fJXcTaGDXYTQQ9zvGe3TyaQA== -cypress@^10.9.0: - version "10.9.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.9.0.tgz#273a61a6304766f9d6423e5ac8d4a9a11ed8b485" - integrity sha512-MjIWrRpc+bQM9U4kSSdATZWZ2hUqHGFEQTF7dfeZRa4MnalMtc88FIE49USWP2ZVtfy5WPBcgfBX+YorFqGElA== +cypress@^10.10.0: + version "10.11.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.11.0.tgz#e9fbdd7638bae3d8fb7619fd75a6330d11ebb4e8" + integrity sha512-lsaE7dprw5DoXM00skni6W5ElVVLGAdRUUdZjX2dYsGjbY/QnpzWZ95Zom1mkGg0hAaO/QVTZoFVS7Jgr/GUPA== dependencies: "@cypress/request" "^2.88.10" "@cypress/xvfb" "^1.2.4" @@ -13288,7 +12001,7 @@ decamelize@^4.0.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== -decimal.js@^10.2.0: +decimal.js@^10.2.1: version "10.3.1" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== @@ -13369,7 +12082,7 @@ deep-is@^0.1.3, deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -deepmerge@3.2.0, deepmerge@^2.1.1, deepmerge@^4.2.2: +deepmerge@^2.1.1, deepmerge@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== @@ -13526,11 +12239,6 @@ dependency-check@^4.1.0: read-package-json "^2.0.10" resolve "^1.1.7" -deprecation@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-1.0.1.tgz#2df79b79005752180816b7b6e079cbd80490d711" - integrity sha512-ccVHpE72+tcIKaGMql33x5MAjKQIZrk+3x2GbJ7TeraUCZWHoT+KSZpoC+JQFsUBlSTXUrBaGiF0j6zVTepPLg== - deprecation@^2.0.0, deprecation@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" @@ -13852,6 +12560,14 @@ dot-case@^3.0.3: no-case "^3.0.3" tslib "^1.10.0" +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + dot-prop@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.2.0.tgz#c34ecc29556dc45f1f4c22697b6f4904e0cc4fcb" @@ -13924,7 +12640,7 @@ duplexer@^0.1.2: resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== -duplexify@^3.2.0, duplexify@^3.4.2, duplexify@^3.5.3: +duplexify@^3.4.2, duplexify@^3.5.3: version "3.7.1" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== @@ -14074,10 +12790,10 @@ email-addresses@^5.0.0: resolved "https://registry.yarnpkg.com/email-addresses/-/email-addresses-5.0.0.tgz#7ae9e7f58eef7d5e3e2c2c2d3ea49b78dc854fa6" integrity sha512-4OIPYlA6JXqtVn8zpHpGiI7vE6EQOAg16aGnDMIAlZVinnoZ8208tW1hAbjWydgN/4PLTT9q+O1K6AH/vALJGw== -emittery@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.1.tgz#c02375a927a40948c0345cc903072597f5270451" - integrity sha512-d34LN4L6h18Bzz9xpoku2nPwKxCPlPMr3EEKTkoEBi+1/+b0lcRkRJ1UVyyZaKNeqGR3swcGl6s390DNO4YVgQ== +emittery@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" + integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== "emoji-regex@>=6.0.0 <=6.1.1": version "6.1.1" @@ -14204,13 +12920,13 @@ enzyme-shallow-equal@^1.0.0, enzyme-shallow-equal@^1.0.1: has "^1.0.3" object-is "^1.1.2" -enzyme-to-json@^3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.6.1.tgz#d60740950bc7ca6384dfe6fe405494ec5df996bc" - integrity sha512-15tXuONeq5ORoZjV/bUo2gbtZrN2IH+Z6DvL35QmZyKHgbY1ahn6wcnLd9Xv9OjiwbAXiiP8MRZwbZrCv1wYNg== +enzyme-to-json@^3.6.2: + version "3.6.2" + resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.6.2.tgz#94f85c413bcae8ab67be53b0a94b69a560e27823" + integrity sha512-Ynm6Z6R6iwQ0g2g1YToz6DWhxVnt8Dy1ijR2zynRKxTyBGA8rCDXU3rs2Qc4OKvUvc2Qoe1bcFK6bnPs20TrTg== dependencies: "@types/cheerio" "^0.22.22" - lodash "^4.17.15" + lodash "^4.17.21" react-is "^16.12.0" enzyme@^3.11.0: @@ -14377,18 +13093,11 @@ es6-map@^0.1.5: es6-symbol "~3.1.1" event-emitter "~0.3.5" -es6-promise@^4.0.3, es6-promise@^4.2.8: +es6-promise@^4.2.8: version "4.2.8" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - es6-set@^0.1.5, es6-set@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" @@ -14423,6 +13132,133 @@ es6-weak-map@^2.0.2: es6-iterator "^2.0.1" es6-symbol "^3.1.1" +esbuild-android-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.54.tgz#505f41832884313bbaffb27704b8bcaa2d8616be" + integrity sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ== + +esbuild-android-arm64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.54.tgz#8ce69d7caba49646e009968fe5754a21a9871771" + integrity sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg== + +esbuild-darwin-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.54.tgz#24ba67b9a8cb890a3c08d9018f887cc221cdda25" + integrity sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug== + +esbuild-darwin-arm64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.54.tgz#3f7cdb78888ee05e488d250a2bdaab1fa671bf73" + integrity sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw== + +esbuild-freebsd-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.54.tgz#09250f997a56ed4650f3e1979c905ffc40bbe94d" + integrity sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg== + +esbuild-freebsd-arm64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.54.tgz#bafb46ed04fc5f97cbdb016d86947a79579f8e48" + integrity sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q== + +esbuild-linux-32@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.54.tgz#e2a8c4a8efdc355405325033fcebeb941f781fe5" + integrity sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw== + +esbuild-linux-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.54.tgz#de5fdba1c95666cf72369f52b40b03be71226652" + integrity sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg== + +esbuild-linux-arm64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.54.tgz#dae4cd42ae9787468b6a5c158da4c84e83b0ce8b" + integrity sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig== + +esbuild-linux-arm@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.54.tgz#a2c1dff6d0f21dbe8fc6998a122675533ddfcd59" + integrity sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw== + +esbuild-linux-mips64le@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.54.tgz#d9918e9e4cb972f8d6dae8e8655bf9ee131eda34" + integrity sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw== + +esbuild-linux-ppc64le@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.54.tgz#3f9a0f6d41073fb1a640680845c7de52995f137e" + integrity sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ== + +esbuild-linux-riscv64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.54.tgz#618853c028178a61837bc799d2013d4695e451c8" + integrity sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg== + +esbuild-linux-s390x@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.54.tgz#d1885c4c5a76bbb5a0fe182e2c8c60eb9e29f2a6" + integrity sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA== + +esbuild-netbsd-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.54.tgz#69ae917a2ff241b7df1dbf22baf04bd330349e81" + integrity sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w== + +esbuild-openbsd-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.54.tgz#db4c8495287a350a6790de22edea247a57c5d47b" + integrity sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw== + +esbuild-sunos-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.54.tgz#54287ee3da73d3844b721c21bc80c1dc7e1bf7da" + integrity sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw== + +esbuild-windows-32@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.54.tgz#f8aaf9a5667630b40f0fb3aa37bf01bbd340ce31" + integrity sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w== + +esbuild-windows-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.54.tgz#bf54b51bd3e9b0f1886ffdb224a4176031ea0af4" + integrity sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ== + +esbuild-windows-arm64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.54.tgz#937d15675a15e4b0e4fafdbaa3a01a776a2be982" + integrity sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg== + +esbuild@^0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.54.tgz#8b44dcf2b0f1a66fc22459943dccf477535e9aa2" + integrity sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA== + optionalDependencies: + "@esbuild/linux-loong64" "0.14.54" + esbuild-android-64 "0.14.54" + esbuild-android-arm64 "0.14.54" + esbuild-darwin-64 "0.14.54" + esbuild-darwin-arm64 "0.14.54" + esbuild-freebsd-64 "0.14.54" + esbuild-freebsd-arm64 "0.14.54" + esbuild-linux-32 "0.14.54" + esbuild-linux-64 "0.14.54" + esbuild-linux-arm "0.14.54" + esbuild-linux-arm64 "0.14.54" + esbuild-linux-mips64le "0.14.54" + esbuild-linux-ppc64le "0.14.54" + esbuild-linux-riscv64 "0.14.54" + esbuild-linux-s390x "0.14.54" + esbuild-netbsd-64 "0.14.54" + esbuild-openbsd-64 "0.14.54" + esbuild-sunos-64 "0.14.54" + esbuild-windows-32 "0.14.54" + esbuild-windows-64 "0.14.54" + esbuild-windows-arm64 "0.14.54" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -14453,7 +13289,7 @@ 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== -escodegen@^1.11.1, escodegen@^1.14.1: +escodegen@^1.11.1: version "1.14.3" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== @@ -14890,7 +13726,7 @@ exec-sh@^0.3.2: resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== -execa@4.1.0, execa@^4.0.0, execa@^4.0.2: +execa@4.1.0, execa@^4.0.2: version "4.1.0" resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== @@ -14992,17 +13828,15 @@ expect@^26.6.2: jest-message-util "^26.6.2" jest-regex-util "^26.0.0" -expect@^27.0.2: - version "27.2.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.0.tgz#40eb89a492afb726a3929ccf3611ee0799ab976f" - integrity sha512-oOTbawMQv7AK1FZURbPTgGSzmhxkjFzoARSvDjOMnOpeWuYQx1tP6rXu9MIX5mrACmyCAM7fSNP8IJO2f1p0CQ== +expect@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" + integrity sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw== dependencies: - "@jest/types" "^27.1.1" - ansi-styles "^5.0.0" - jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.0" - jest-message-util "^27.2.0" - jest-regex-util "^27.0.6" + "@jest/types" "^27.5.1" + jest-get-type "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" expect@^28.1.1: version "28.1.1" @@ -15015,6 +13849,17 @@ expect@^28.1.1: jest-message-util "^28.1.1" jest-util "^28.1.1" +expect@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.3.tgz#90a7c1a124f1824133dd4533cce2d2bdcb6603ec" + integrity sha512-eEh0xn8HlsuOBxFgIss+2mX85VAS4Qy3OSkjV7rlBWljtA4oWH37glVGyOZSZvErDT/yBywZdPGwCXuTvSG85g== + dependencies: + "@jest/expect-utils" "^28.1.3" + jest-get-type "^28.0.2" + jest-matcher-utils "^28.1.3" + jest-message-util "^28.1.3" + jest-util "^28.1.3" + expiry-js@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/expiry-js/-/expiry-js-0.1.7.tgz#76be8c05e572bf936df40c1766448d0b3b2f555f" @@ -15612,6 +14457,15 @@ form-data@^2.3.1, form-data@^2.3.3: combined-stream "^1.0.6" mime-types "^2.1.12" +form-data@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -15791,7 +14645,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^2.1.2, fsevents@~2.3.2: +fsevents@^2.1.2, fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -16301,22 +15155,6 @@ got@11.8.5, got@^11.8.2: p-cancelable "^2.0.0" responselike "^2.0.0" -got@^3.2.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/got/-/got-3.3.1.tgz#e5d0ed4af55fc3eef4d56007769d98192bcb2eca" - integrity sha1-5dDtSvVfw+701WAHdp2YGSvLLso= - dependencies: - duplexify "^3.2.0" - infinity-agent "^2.0.0" - is-redirect "^1.0.0" - is-stream "^1.0.0" - lowercase-keys "^1.0.0" - nested-error-stacks "^1.0.0" - object-assign "^3.0.0" - prepend-http "^1.0.0" - read-all-stream "^3.0.0" - timed-out "^2.0.0" - got@^9.6.0: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" @@ -16358,11 +15196,6 @@ graphql@^16.6.0: resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.6.0.tgz#c2dcffa4649db149f6282af726c8c83f1c7c5fdb" integrity sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw== -growly@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" - integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= - gulp-brotli@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/gulp-brotli/-/gulp-brotli-3.0.0.tgz#7f5a1d8a6d43cab28056f9e56f29ae071dcfe4b4" @@ -16962,14 +15795,6 @@ http-parser-js@>=0.5.1: resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9" integrity sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg== -http-proxy-agent@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" - integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== - dependencies: - agent-base "4" - debug "3.1.0" - http-proxy-agent@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" @@ -16979,6 +15804,15 @@ http-proxy-agent@^4.0.1: agent-base "6" debug "4" +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + http-proxy-middleware@^2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" @@ -17194,11 +16028,6 @@ infer-owner@^1.0.3, infer-owner@^1.0.4: resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== -infinity-agent@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/infinity-agent/-/infinity-agent-2.0.3.tgz#45e0e2ff7a9eb030b27d62b74b3744b7a7ac4216" - integrity sha1-ReDi/3qesDCyfWK3SzdEt6esQhY= - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -17693,11 +16522,6 @@ is-nil@^1.0.0: resolved "https://registry.yarnpkg.com/is-nil/-/is-nil-1.0.1.tgz#2daba29e0b585063875e7b539d071f5b15937969" integrity sha1-LauingtYUGOHXntTnQcfWxWTeWk= -is-npm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" - integrity sha1-8vtjpl5JBbQGyGBydloaTceTufQ= - is-npm@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-5.0.0.tgz#43e8d65cc56e1b67f8d47262cf667099193f45a8" @@ -17807,7 +16631,7 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-potential-custom-element-name@^1.0.0: +is-potential-custom-element-name@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== @@ -17822,11 +16646,6 @@ is-promise@^2.1, is-promise@^2.1.0: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= -is-redirect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" - integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= - is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.2, is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -17857,7 +16676,7 @@ is-shared-array-buffer@^1.0.1: resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== -is-stream@^1.0.0, is-stream@^1.1.0: +is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= @@ -17945,6 +16764,11 @@ is-weakset@^2.0.1: resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.1.tgz#e9a0af88dbd751589f5e50d80f4c98b780884f83" integrity sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw== +is-what@^4.1.6: + version "4.1.7" + resolved "https://registry.yarnpkg.com/is-what/-/is-what-4.1.7.tgz#c41dc1d2d2d6a9285c624c2505f61849c8b1f9cc" + integrity sha512-DBVOQNiPKnGMxRMLIYSwERAS5MVY1B7xYiGnpgctsOFvVDz9f9PFXXxMcTOHuoqYp4NK9qFYQaIC1NRRxLMpBQ== + is-whitespace-character@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.1.tgz#9ae0176f3282b65457a1992cdb084f8a5f833e3b" @@ -18071,7 +16895,7 @@ istanbul-lib-hook@^3.0.0: dependencies: append-transform "^2.0.0" -istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: +istanbul-lib-instrument@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== @@ -18081,7 +16905,7 @@ istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: istanbul-lib-coverage "^3.0.0" semver "^6.3.0" -istanbul-lib-instrument@^5.0.4: +istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz#7b49198b657b27a730b8e9cb601f1e1bff24c59a" integrity sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q== @@ -18123,10 +16947,10 @@ istanbul-lib-source-maps@^4.0.0: istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" -istanbul-reports@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" - integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== +istanbul-reports@^3.0.2, istanbul-reports@^3.1.3: + version "3.1.4" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.4.tgz#1b6f068ecbc6c331040aab5741991273e609e40c" + integrity sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -18169,92 +16993,95 @@ jest-axe@^5.0.0: jest-matcher-utils "27.0.2" lodash.merge "4.6.2" -jest-canvas-mock@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/jest-canvas-mock/-/jest-canvas-mock-2.3.1.tgz#9535d14bc18ccf1493be36ac37dd349928387826" - integrity sha512-5FnSZPrX3Q2ZfsbYNE3wqKR3+XorN8qFzDzB5o0golWgt6EOX1+emBnpOc9IAQ+NXFj8Nzm3h7ZdE/9H0ylBcg== +jest-canvas-mock@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jest-canvas-mock/-/jest-canvas-mock-2.4.0.tgz#947b71442d7719f8e055decaecdb334809465341" + integrity sha512-mmMpZzpmLzn5vepIaHk5HoH3Ka4WykbSoLuG/EKoJd0x0ID/t+INo1l8ByfcUJuDM+RIsL4QDg/gDnBbrj2/IQ== dependencies: cssfontparser "^1.2.1" moo-color "^1.0.2" -jest-changed-files@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0" - integrity sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ== +jest-changed-files@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.1.tgz#a348aed00ec9bf671cc58a66fcbe7c3dfd6a68f5" + integrity sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw== dependencies: - "@jest/types" "^26.6.2" - execa "^4.0.0" - throat "^5.0.0" + "@jest/types" "^27.5.1" + execa "^5.0.0" + throat "^6.0.1" -jest-circus@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-26.6.3.tgz#3cc7ef2a6a3787e5d7bfbe2c72d83262154053e7" - integrity sha512-ACrpWZGcQMpbv13XbzRzpytEJlilP/Su0JtNCi5r/xLpOUhnaIJr8leYYpLEMgPFURZISEHrnnpmB54Q/UziPw== +jest-circus@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.1.tgz#37a5a4459b7bf4406e53d637b49d22c65d125ecc" + integrity sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw== dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/babel__traverse" "^7.0.4" + "@jest/environment" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^26.6.2" + expect "^27.5.1" is-generator-fn "^2.0.0" - jest-each "^26.6.2" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-runner "^26.6.3" - jest-runtime "^26.6.3" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - pretty-format "^26.6.2" - stack-utils "^2.0.2" - throat "^5.0.0" + jest-each "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" + slash "^3.0.0" + stack-utils "^2.0.3" + throat "^6.0.1" -jest-cli@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.6.3.tgz#43117cfef24bc4cd691a174a8796a532e135e92a" - integrity sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg== +jest-cli@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.1.tgz#278794a6e6458ea8029547e6c6cbf673bd30b145" + integrity sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw== dependencies: - "@jest/core" "^26.6.3" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/core" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" chalk "^4.0.0" exit "^0.1.2" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" import-local "^3.0.2" - is-ci "^2.0.0" - jest-config "^26.6.3" - jest-util "^26.6.2" - jest-validate "^26.6.2" + jest-config "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" prompts "^2.0.1" - yargs "^15.4.1" + yargs "^16.2.0" -jest-config@^26, jest-config@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.6.3.tgz#64f41444eef9eb03dc51d5c53b75c8c71f645349" - integrity sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg== +jest-config@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.1.tgz#5c387de33dca3f99ad6357ddeccd91bf3a0e4a41" + integrity sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA== dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^26.6.3" - "@jest/types" "^26.6.2" - babel-jest "^26.6.3" + "@babel/core" "^7.8.0" + "@jest/test-sequencer" "^27.5.1" + "@jest/types" "^27.5.1" + babel-jest "^27.5.1" chalk "^4.0.0" + ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" - graceful-fs "^4.2.4" - jest-environment-jsdom "^26.6.2" - jest-environment-node "^26.6.2" - jest-get-type "^26.3.0" - jest-jasmine2 "^26.6.3" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" - micromatch "^4.0.2" - pretty-format "^26.6.2" + graceful-fs "^4.2.9" + jest-circus "^27.5.1" + jest-environment-jsdom "^27.5.1" + jest-environment-node "^27.5.1" + jest-get-type "^27.5.1" + jest-jasmine2 "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-runner "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^27.5.1" + slash "^3.0.0" + strip-json-comments "^3.1.1" jest-diff@^26.0.0, jest-diff@^26.6.2: version "26.6.2" @@ -18266,7 +17093,7 @@ jest-diff@^26.0.0, jest-diff@^26.6.2: jest-get-type "^26.3.0" pretty-format "^26.6.2" -jest-diff@^27.0.2, jest-diff@^27.2.0: +jest-diff@^27.0.2, jest-diff@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== @@ -18286,55 +17113,65 @@ jest-diff@^28.1.1: jest-get-type "^28.0.2" pretty-format "^28.1.1" -jest-docblock@^26.0.0: - version "26.0.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-26.0.0.tgz#3e2fa20899fc928cb13bd0ff68bd3711a36889b5" - integrity sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w== +jest-diff@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.3.tgz#948a192d86f4e7a64c5264ad4da4877133d8792f" + integrity sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw== + dependencies: + chalk "^4.0.0" + diff-sequences "^28.1.1" + jest-get-type "^28.0.2" + pretty-format "^28.1.3" + +jest-docblock@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" + integrity sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ== dependencies: detect-newline "^3.0.0" -jest-each@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.6.2.tgz#02526438a77a67401c8a6382dfe5999952c167cb" - integrity sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A== +jest-each@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.1.tgz#5bc87016f45ed9507fed6e4702a5b468a5b2c44e" + integrity sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.5.1" chalk "^4.0.0" - jest-get-type "^26.3.0" - jest-util "^26.6.2" - pretty-format "^26.6.2" + jest-get-type "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" -jest-environment-jsdom@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz#78d09fe9cf019a357009b9b7e1f101d23bd1da3e" - integrity sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q== +jest-environment-jsdom@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz#ea9ccd1fc610209655a77898f86b2b559516a546" + integrity sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw== dependencies: - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-mock "^26.6.2" - jest-util "^26.6.2" - jsdom "^16.4.0" + jest-mock "^27.5.1" + jest-util "^27.5.1" + jsdom "^16.6.0" -jest-environment-node@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.6.2.tgz#824e4c7fb4944646356f11ac75b229b0035f2b0c" - integrity sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag== +jest-environment-node@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.1.tgz#dedc2cfe52fab6b8f5714b4808aefa85357a365e" + integrity sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw== dependencies: - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-mock "^26.6.2" - jest-util "^26.6.2" + jest-mock "^27.5.1" + jest-util "^27.5.1" jest-get-type@^26.3.0: version "26.3.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== -jest-get-type@^27.0.1, jest-get-type@^27.0.6, jest-get-type@^27.5.1: +jest-get-type@^27.0.1, jest-get-type@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== @@ -18365,37 +17202,56 @@ jest-haste-map@^26.6.2: optionalDependencies: fsevents "^2.1.2" -jest-jasmine2@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz#adc3cf915deacb5212c93b9f3547cd12958f2edd" - integrity sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg== +jest-haste-map@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" + integrity sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng== dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^26.6.2" - "@jest/source-map" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/types" "^27.5.1" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^27.5.1" + jest-serializer "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" + micromatch "^4.0.4" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.3.2" + +jest-jasmine2@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz#a037b0034ef49a9f3d71c4375a796f3b230d1ac4" + integrity sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ== + dependencies: + "@jest/environment" "^27.5.1" + "@jest/source-map" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^26.6.2" + expect "^27.5.1" is-generator-fn "^2.0.0" - jest-each "^26.6.2" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-runtime "^26.6.3" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - pretty-format "^26.6.2" - throat "^5.0.0" + jest-each "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" + throat "^6.0.1" -jest-leak-detector@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz#7717cf118b92238f2eba65054c8a0c9c653a91af" - integrity sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg== +jest-leak-detector@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" + integrity sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ== dependencies: - jest-get-type "^26.3.0" - pretty-format "^26.6.2" + jest-get-type "^27.5.1" + pretty-format "^27.5.1" jest-matcher-utils@27.0.2: version "27.0.2" @@ -18417,15 +17273,15 @@ jest-matcher-utils@^26.6.2: jest-get-type "^26.3.0" pretty-format "^26.6.2" -jest-matcher-utils@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.0.tgz#b4d224ab88655d5fab64b96b989ac349e2f5da43" - integrity sha512-F+LG3iTwJ0gPjxBX6HCyrARFXq6jjiqhwBQeskkJQgSLeF1j6ui1RTV08SR7O51XTUhtc8zqpDj8iCG4RGmdKw== +jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" + integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== dependencies: chalk "^4.0.0" - jest-diff "^27.2.0" - jest-get-type "^27.0.6" - pretty-format "^27.2.0" + jest-diff "^27.5.1" + jest-get-type "^27.5.1" + pretty-format "^27.5.1" jest-matcher-utils@^28.1.1: version "28.1.1" @@ -18437,6 +17293,16 @@ jest-matcher-utils@^28.1.1: jest-get-type "^28.0.2" pretty-format "^28.1.1" +jest-matcher-utils@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz#5a77f1c129dd5ba3b4d7fc20728806c78893146e" + integrity sha512-kQeJ7qHemKfbzKoGjHHrRKH6atgxMk8Enkk2iPQ3XwO6oE/KYD8lMYOziCkeSB9G4adPM4nR1DE8Tf5JeWH6Bw== + dependencies: + chalk "^4.0.0" + jest-diff "^28.1.3" + jest-get-type "^28.0.2" + pretty-format "^28.1.3" + jest-message-util@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.2.tgz#58173744ad6fc0506b5d21150b9be56ef001ca07" @@ -18452,42 +17318,42 @@ jest-message-util@^26.6.2: slash "^3.0.0" stack-utils "^2.0.2" -jest-message-util@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.0.tgz#2f65c71df55267208686b1d7514e18106c91ceaf" - integrity sha512-y+sfT/94CiP8rKXgwCOzO1mUazIEdEhrLjuiu+RKmCP+8O/TJTSne9dqQRbFIHBtlR2+q7cddJlWGir8UATu5w== +jest-message-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" + integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.1.1" + "@jest/types" "^27.5.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^27.2.0" + pretty-format "^27.5.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-message-util@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.1.tgz#60aa0b475cfc08c8a9363ed2fb9108514dd9ab89" - integrity sha512-xoDOOT66fLfmTRiqkoLIU7v42mal/SqwDKvfmfiWAdJMSJiU+ozgluO7KbvoAgiwIrrGZsV7viETjc8GNrA/IQ== +jest-message-util@^28.1.1, jest-message-util@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.3.tgz#232def7f2e333f1eecc90649b5b94b0055e7c43d" + integrity sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^28.1.1" + "@jest/types" "^28.1.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^28.1.1" + pretty-format "^28.1.3" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.6.2.tgz#d6cb712b041ed47fe0d9b6fc3474bc6543feb302" - integrity sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew== +jest-mock@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" + integrity sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.5.1" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -18505,19 +17371,19 @@ jest-regex-util@^26.0.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== -jest-regex-util@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" - integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== +jest-regex-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.1.tgz#4da143f7e9fd1e542d4aa69617b38e4a78365b95" + integrity sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg== -jest-resolve-dependencies@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz#6680859ee5d22ee5dcd961fe4871f59f4c784fb6" - integrity sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg== +jest-resolve-dependencies@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz#d811ecc8305e731cc86dd79741ee98fed06f1da8" + integrity sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg== dependencies: - "@jest/types" "^26.6.2" - jest-regex-util "^26.0.0" - jest-snapshot "^26.6.2" + "@jest/types" "^27.5.1" + jest-regex-util "^27.5.1" + jest-snapshot "^27.5.1" jest-resolve@^26.6.2: version "26.6.2" @@ -18533,64 +17399,76 @@ jest-resolve@^26.6.2: resolve "^1.18.1" slash "^3.0.0" -jest-runner@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.6.3.tgz#2d1fed3d46e10f233fd1dbd3bfaa3fe8924be159" - integrity sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ== +jest-resolve@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" + integrity sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw== dependencies: - "@jest/console" "^26.6.2" - "@jest/environment" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/node" "*" + "@jest/types" "^27.5.1" chalk "^4.0.0" - emittery "^0.7.1" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-config "^26.6.3" - jest-docblock "^26.0.0" - jest-haste-map "^26.6.2" - jest-leak-detector "^26.6.2" - jest-message-util "^26.6.2" - jest-resolve "^26.6.2" - jest-runtime "^26.6.3" - jest-util "^26.6.2" - jest-worker "^26.6.2" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.1" + jest-pnp-resolver "^1.2.2" + jest-util "^27.5.1" + jest-validate "^27.5.1" + resolve "^1.20.0" + resolve.exports "^1.1.0" + slash "^3.0.0" + +jest-runner@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.1.tgz#071b27c1fa30d90540805c5645a0ec167c7b62e5" + integrity sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ== + dependencies: + "@jest/console" "^27.5.1" + "@jest/environment" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.8.1" + graceful-fs "^4.2.9" + jest-docblock "^27.5.1" + jest-environment-jsdom "^27.5.1" + jest-environment-node "^27.5.1" + jest-haste-map "^27.5.1" + jest-leak-detector "^27.5.1" + jest-message-util "^27.5.1" + jest-resolve "^27.5.1" + jest-runtime "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" source-map-support "^0.5.6" - throat "^5.0.0" - -jest-runtime@^26, jest-runtime@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.6.3.tgz#4f64efbcfac398331b74b4b3c82d27d401b8fa2b" - integrity sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw== - dependencies: - "@jest/console" "^26.6.2" - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/globals" "^26.6.2" - "@jest/source-map" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/yargs" "^15.0.0" + throat "^6.0.1" + +jest-runtime@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.1.tgz#4896003d7a334f7e8e4a53ba93fb9bcd3db0a1af" + integrity sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A== + dependencies: + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/globals" "^27.5.1" + "@jest/source-map" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" chalk "^4.0.0" - cjs-module-lexer "^0.6.0" + cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" - exit "^0.1.2" + execa "^5.0.0" glob "^7.1.3" - graceful-fs "^4.2.4" - jest-config "^26.6.3" - jest-haste-map "^26.6.2" - jest-message-util "^26.6.2" - jest-mock "^26.6.2" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.1" + jest-message-util "^27.5.1" + jest-mock "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" slash "^3.0.0" strip-bom "^4.0.0" - yargs "^15.4.1" jest-serializer@^26.6.2: version "26.6.2" @@ -18600,6 +17478,14 @@ jest-serializer@^26.6.2: "@types/node" "*" graceful-fs "^4.2.4" +jest-serializer@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.1.tgz#81438410a30ea66fd57ff730835123dea1fb1f64" + integrity sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w== + dependencies: + "@types/node" "*" + graceful-fs "^4.2.9" + jest-silent-reporter@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jest-silent-reporter/-/jest-silent-reporter-0.5.0.tgz#5fd8ccd61665227e3bf19d908b7350719d06ff38" @@ -18608,7 +17494,7 @@ jest-silent-reporter@^0.5.0: chalk "^4.0.0" jest-util "^26.0.0" -jest-snapshot@^26.3.0, jest-snapshot@^26.6.2: +jest-snapshot@^26.3.0: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.2.tgz#f3b0af1acb223316850bd14e1beea9837fb39c84" integrity sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og== @@ -18630,6 +17516,34 @@ jest-snapshot@^26.3.0, jest-snapshot@^26.6.2: pretty-format "^26.6.2" semver "^7.3.2" +jest-snapshot@^27.0.2, jest-snapshot@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.1.tgz#b668d50d23d38054a51b42c4039cab59ae6eb6a1" + integrity sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA== + dependencies: + "@babel/core" "^7.7.2" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/traverse" "^7.7.2" + "@babel/types" "^7.0.0" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.1.5" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^27.5.1" + graceful-fs "^4.2.9" + jest-diff "^27.5.1" + jest-get-type "^27.5.1" + jest-haste-map "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-util "^27.5.1" + natural-compare "^1.4.0" + pretty-format "^27.5.1" + semver "^7.3.2" + jest-specific-snapshot@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jest-specific-snapshot/-/jest-specific-snapshot-4.0.0.tgz#a52a2e223e7576e610dbeaf341207c557ac20554" @@ -18637,7 +17551,14 @@ jest-specific-snapshot@^4.0.0: dependencies: jest-snapshot "^26.3.0" -jest-styled-components@^7.0.3: +jest-specific-snapshot@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/jest-specific-snapshot/-/jest-specific-snapshot-5.0.0.tgz#48f72d5613af7f3e30df75b6b3534db6bab32ea0" + integrity sha512-V65vuPxZQExD3tGbv+Du5tbG1E3H3Dq/HFbsCEkPJP27w5vr/nATQJl61Dx5doBfu54OrJak0JaeYVSeZubDKg== + dependencies: + jest-snapshot "^27.0.2" + +jest-styled-components@7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/jest-styled-components/-/jest-styled-components-7.0.3.tgz#cc0b031f910484e68f175568682f3969ff774b2c" integrity sha512-jj9sWyshehUnB0P9WFUaq9Bkh6RKYO8aD8lf3gUrXRwg/MRddTFk7U9D9pC4IAI3v9fbz4vmrMxwaecTpG8NKA== @@ -18656,6 +17577,18 @@ jest-util@^26.0.0, jest-util@^26.6.2: is-ci "^2.0.0" micromatch "^4.0.2" +jest-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" + integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== + dependencies: + "@jest/types" "^27.5.1" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + jest-util@^28.1.1: version "28.1.1" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.1.tgz#ff39e436a1aca397c0ab998db5a51ae2b7080d05" @@ -18668,29 +17601,41 @@ jest-util@^28.1.1: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.6.2.tgz#23d380971587150467342911c3d7b4ac57ab20ec" - integrity sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ== +jest-util@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.3.tgz#f4f932aa0074f0679943220ff9cbba7e497028b0" + integrity sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ== dependencies: - "@jest/types" "^26.6.2" - camelcase "^6.0.0" + "@jest/types" "^28.1.3" + "@types/node" "*" chalk "^4.0.0" - jest-get-type "^26.3.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-validate@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" + integrity sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ== + dependencies: + "@jest/types" "^27.5.1" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^27.5.1" leven "^3.1.0" - pretty-format "^26.6.2" + pretty-format "^27.5.1" -jest-watcher@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.6.2.tgz#a5b683b8f9d68dbcb1d7dae32172d2cca0592975" - integrity sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ== +jest-watcher@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.1.tgz#71bd85fb9bde3a2c2ec4dc353437971c43c642a2" + integrity sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw== dependencies: - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^26.6.2" + jest-util "^27.5.1" string-length "^4.0.1" jest-worker@^26.5.0, jest-worker@^26.6.2: @@ -18702,7 +17647,7 @@ jest-worker@^26.5.0, jest-worker@^26.6.2: merge-stream "^2.0.0" supports-color "^7.0.0" -jest-worker@^27.4.5: +jest-worker@^27.4.5, jest-worker@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== @@ -18711,14 +17656,14 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-26.6.3.tgz#40e8fdbe48f00dfa1f0ce8121ca74b88ac9148ef" - integrity sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q== +jest@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.1.tgz#dadf33ba70a779be7a6fc33015843b51494f63fc" + integrity sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ== dependencies: - "@jest/core" "^26.6.3" + "@jest/core" "^27.5.1" import-local "^3.0.2" - jest-cli "^26.6.3" + jest-cli "^27.5.1" joi@*, joi@^17.3.0, joi@^17.4.0: version "17.4.0" @@ -18741,11 +17686,6 @@ jpeg-js@^0.3.2: resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.3.7.tgz#471a89d06011640592d314158608690172b1028d" integrity sha512-9IXdWudL61npZjvLuVe/ktHiA41iE8qFyLB+4VDTblEsWBzeg8WQTlktdUK4CdncUqtUgUg0bbOmTE2bKBKaBQ== -jpeg-js@^0.4.2: - version "0.4.3" - resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.3.tgz#6158e09f1983ad773813704be80680550eff977b" - integrity sha512-ru1HWKek8octvUHFHvE5ZzQ1yAsJmIvRdGWvSoKV52XKyuyYA437QWDttXT8eZXDSbuMpHlLzPDZUPd6idIz+Q== - jquery@^3.5.0: version "3.6.0" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470" @@ -18817,36 +17757,37 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= -jsdom@^16.4.0: - version "16.4.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.4.0.tgz#36005bde2d136f73eee1a830c6d45e55408edddb" - integrity sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w== +jsdom@^16.4.0, jsdom@^16.6.0: + version "16.7.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" + integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== dependencies: - abab "^2.0.3" - acorn "^7.1.1" + abab "^2.0.5" + acorn "^8.2.4" acorn-globals "^6.0.0" cssom "^0.4.4" - cssstyle "^2.2.0" + cssstyle "^2.3.0" data-urls "^2.0.0" - decimal.js "^10.2.0" + decimal.js "^10.2.1" domexception "^2.0.1" - escodegen "^1.14.1" + escodegen "^2.0.0" + form-data "^3.0.0" html-encoding-sniffer "^2.0.1" - is-potential-custom-element-name "^1.0.0" + http-proxy-agent "^4.0.1" + https-proxy-agent "^5.0.0" + is-potential-custom-element-name "^1.0.1" nwsapi "^2.2.0" - parse5 "5.1.1" - request "^2.88.2" - request-promise-native "^1.0.8" - saxes "^5.0.0" + parse5 "6.0.1" + saxes "^5.0.1" symbol-tree "^3.2.4" - tough-cookie "^3.0.1" + tough-cookie "^4.0.0" w3c-hr-time "^1.0.2" w3c-xmlserializer "^2.0.0" webidl-conversions "^6.1.0" whatwg-encoding "^1.0.5" whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" - ws "^7.2.3" + whatwg-url "^8.5.0" + ws "^7.4.6" xml-name-validator "^3.0.0" jsesc@^2.5.1: @@ -19142,10 +18083,10 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -kleur@^4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.4.tgz#8c202987d7e577766d039a8cd461934c01cda04d" - integrity sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA== +kleur@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780" + integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== klona@^2.0.4: version "2.0.4" @@ -19174,13 +18115,6 @@ language-tags@^1.0.5: dependencies: language-subtag-registry "~0.3.2" -latest-version@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-1.0.1.tgz#72cfc46e3e8d1be651e1ebb54ea9f6ea96f374bb" - integrity sha1-cs/Ebj6NG+ZR4eu1Tqn26pbzdLs= - dependencies: - package-json "^1.0.0" - latest-version@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" @@ -19745,6 +18679,13 @@ lower-case@^2.0.1: dependencies: tslib "^1.10.0" +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" @@ -20384,7 +19325,7 @@ mime@1.6.0, mime@^1.4.1: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@^2.4.4, mime@^2.4.6: +mime@^2.4.4: version "2.5.2" resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== @@ -20552,7 +19493,7 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== -mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1: +mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1: version "0.5.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" integrity sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw== @@ -20672,10 +19613,10 @@ moment-timezone@*, moment-timezone@^0.5.34: resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== -monaco-editor@*, monaco-editor@^0.22.3: - version "0.22.3" - resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.22.3.tgz#69b42451d3116c6c08d9b8e052007ff891fd85d7" - integrity sha512-RM559z2CJbczZ3k2b+ouacMINkAYWwRit4/vs0g2X/lkYefDiu0k2GmgWjAuiIpQi+AqASPOKvXNmYc8KUSvVQ== +monaco-editor@*, monaco-editor@^0.24.0: + version "0.24.0" + resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.24.0.tgz#990b55096bcc95d08d8d28e55264c6eb17707269" + integrity sha512-o1f0Lz6ABFNTtnEqqqvlY9qzNx24rQZx1RgYNQ8SkWkE+Ka63keHH/RqxQ4QhN4fs/UYOnvAtEUZsPrzccH++A== monitor-event-loop-delay@^1.0.0: version "1.0.0" @@ -20898,13 +19839,6 @@ neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1, neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -nested-error-stacks@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz#19f619591519f096769a5ba9a86e6eeec823c3cf" - integrity sha1-GfYZWRUZ8JZ2mlupqG5u7sgjw88= - dependencies: - inherits "~2.0.1" - nested-error-stacks@^2.0.0, nested-error-stacks@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz#0fbdcf3e13fe4994781280524f8b96b0cdff9c61" @@ -20952,6 +19886,14 @@ no-case@^3.0.3: lower-case "^2.0.1" tslib "^1.10.0" +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + nock@12.0.3: version "12.0.3" resolved "https://registry.yarnpkg.com/nock/-/nock-12.0.3.tgz#83f25076dbc4c9aa82b5cdf54c9604c7a778d1c9" @@ -21005,7 +19947,7 @@ node-emoji@^1.10.0: dependencies: lodash.toarray "^4.4.0" -node-fetch@2.6.7, node-fetch@^1.0.1, node-fetch@^2.3.0, node-fetch@^2.6.1, node-fetch@^2.6.7: +node-fetch@2.6.7, node-fetch@^1.0.1, node-fetch@^2.6.1, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -21092,18 +20034,6 @@ node-libs-browser@^2.2.1: util "^0.11.0" vm-browserify "^1.0.1" -node-notifier@^8.0.0: - version "8.0.1" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.1.tgz#f86e89bbc925f2b068784b31f382afdc6ca56be1" - integrity sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA== - dependencies: - growly "^1.3.0" - is-wsl "^2.2.0" - semver "^7.3.2" - shellwords "^0.1.1" - uuid "^8.3.0" - which "^2.0.2" - node-preload@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/node-preload/-/node-preload-0.2.1.tgz#c03043bb327f417a18fee7ab7ee57b408a144301" @@ -21311,9 +20241,9 @@ numeral@^2.0.6: integrity sha1-StCAk21EPCVhrtnyGX7//iX05QY= nwsapi@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" - integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== + version "2.2.2" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.2.tgz#e5418863e7905df67d51ec95938d67bf801f0bb0" + integrity sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw== nyc@15.1.0, nyc@^15.1.0: version "15.1.0" @@ -21358,11 +20288,6 @@ object-assign@4.X, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4. resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" - integrity sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I= - object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" @@ -21694,7 +20619,7 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-name@^3.0.0, os-name@^3.1.0: +os-name@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801" integrity sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg== @@ -21707,7 +20632,7 @@ os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -osenv@^0.1.0, osenv@^0.1.4: +osenv@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== @@ -21737,11 +20662,6 @@ p-cancelable@^2.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e" integrity sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg== -p-each-series@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.1.0.tgz#961c8dd3f195ea96c747e636b262b800a6b1af48" - integrity sha512-ZuRs1miPT4HrjFa+9fRfOFXxGJfORgelKV9f9nNOWw2gl6gVsRaVDOQP0+MI0G0wGKns1Yacsu0GjOFbTK0JFQ== - p-event@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-event/-/p-event-4.1.0.tgz#e92bb866d7e8e5b732293b1c8269d38e9982bf8e" @@ -21864,14 +20784,6 @@ package-hash@^4.0.0: lodash.flattendeep "^4.4.0" release-zalgo "^1.0.0" -package-json@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-1.2.0.tgz#c8ecac094227cdf76a316874ed05e27cc939a0e0" - integrity sha1-yOysCUInzfdqMWh07QXifMk5oOA= - dependencies: - got "^3.2.0" - registry-url "^3.0.0" - package-json@^6.3.0: version "6.5.0" resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" @@ -21971,7 +20883,7 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" -parse-json@^5.0.0: +parse-json@^5.0.0, parse-json@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== @@ -21998,12 +20910,7 @@ parse5-htmlparser2-tree-adapter@^6.0.1: dependencies: parse5 "^6.0.1" -parse5@5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" - integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== - -parse5@^6.0.0, parse5@^6.0.1: +parse5@6.0.1, parse5@^6.0.0, parse5@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== @@ -22236,7 +21143,7 @@ pino@^6.11.2: quick-format-unescaped "^4.0.3" sonic-boom "^1.0.2" -pirates@^4.0.1, pirates@^4.0.5: +pirates@^4.0.1, pirates@^4.0.4, pirates@^4.0.5: version "4.0.5" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== @@ -22306,54 +21213,29 @@ platform@^1.3.0: resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.5.tgz#fb6958c696e07e2918d2eeda0f0bc9448d733444" integrity sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q== -playwright-chromium@=1.14.0: - version "1.14.0" - resolved "https://registry.yarnpkg.com/playwright-chromium/-/playwright-chromium-1.14.0.tgz#b153eb96412fd6a4fa8d9233a4fdf694fc9f3139" - integrity sha512-qWQN9VTPhvEZdRpn1564EOtiNU+hRHhogKg1heBX9VsfGy6WHytR9XPFJjD4M6fhNAV1WKM2McVPYIbi1EOYww== +playwright-chromium@=1.26.0: + version "1.26.0" + resolved "https://registry.yarnpkg.com/playwright-chromium/-/playwright-chromium-1.26.0.tgz#fa4e75a2034a016b9e2e825fc6577f3efb0d2792" + integrity sha512-4hDiVmMKmtuHW5ne11S1HCQTdL+wytprQMhWYecEjMSIKBR1DJ3JLrcUDgqA0L5Jzi/CBKYQQk6TOVlTjXybXQ== dependencies: - commander "^6.1.0" - debug "^4.1.1" - extract-zip "^2.0.1" - https-proxy-agent "^5.0.0" - jpeg-js "^0.4.2" - mime "^2.4.6" - pngjs "^5.0.0" - progress "^2.0.3" - proper-lockfile "^4.1.1" - proxy-from-env "^1.1.0" - rimraf "^3.0.2" - stack-utils "^2.0.3" - ws "^7.4.6" - yazl "^2.5.1" + playwright-core "1.26.0" -playwright-core@=1.17.1: - version "1.17.1" - resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.17.1.tgz#a16e0f89284a0ed8ae6d77e1c905c84b8a2ba022" - integrity sha512-C3c8RpPiC3qr15fRDN6dx6WnUkPLFmST37gms2aoHPDRvp7EaGDPMMZPpqIm/QWB5J40xDrQCD4YYHz2nBTojQ== - dependencies: - commander "^8.2.0" - debug "^4.1.1" - extract-zip "^2.0.1" - https-proxy-agent "^5.0.0" - jpeg-js "^0.4.2" - mime "^2.4.6" - pngjs "^5.0.0" - progress "^2.0.3" - proper-lockfile "^4.1.1" - proxy-from-env "^1.1.0" - rimraf "^3.0.2" - socks-proxy-agent "^6.1.0" - stack-utils "^2.0.3" - ws "^7.4.6" - yauzl "^2.10.0" - yazl "^2.5.1" +playwright-core@1.26.0, playwright-core@=1.26.0: + version "1.26.0" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.26.0.tgz#850228f0638d410a5cdd69800d552f60e4d295cd" + integrity sha512-p8huU8eU4gD3VkJd3DA1nA7R3XA6rFvFL+1RYS96cSljCF2yJE9CWEHTPF4LqX8KN9MoWCrAfVKP5381X3CZqg== -playwright@^1.17.1: - version "1.17.1" - resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.17.1.tgz#a6d63302ee40f41283c4bf869de261c4743a787c" - integrity sha512-DisCkW9MblDJNS3rG61p8LiLA2WA7IY/4A4W7DX4BphWe/HuWjKmGQptuk4NVIh5UuSwXpW/jaH2+ZgjHs3GMA== +playwright-core@1.27.1: + version "1.27.1" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.27.1.tgz#840ef662e55a3ed759d8b5d3d00a5f885a7184f4" + integrity sha512-9EmeXDncC2Pmp/z+teoVYlvmPWUC6ejSSYZUln7YaP89Z6lpAaiaAnqroUt/BoLo8tn7WYShcfaCh+xofZa44Q== + +playwright@^1.26.0: + version "1.27.1" + resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.27.1.tgz#4eecac5899566c589d4220ca8acc16abe8a67450" + integrity sha512-xXYZ7m36yTtC+oFgqH0eTgullGztKSRMb4yuwLPl8IYSmgBM88QiB+3IWb1mRIC9/NNwcgbG0RwtFlg+EAFQHQ== dependencies: - playwright-core "=1.17.1" + playwright-core "1.27.1" plugin-error@^1.0.1: version "1.0.1" @@ -22392,11 +21274,6 @@ pngjs@^3.3.3, pngjs@^3.4.0: resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f" integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w== -pngjs@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" - integrity sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw== - pngjs@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-6.0.0.tgz#ca9e5d2aa48db0228a52c419c3308e87720da821" @@ -22784,11 +21661,6 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prepend-http@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= - prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" @@ -22834,7 +21706,7 @@ pretty-format@^26.0.0, pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" -pretty-format@^27.0.2, pretty-format@^27.2.0, pretty-format@^27.5.1: +pretty-format@^27.0.0, pretty-format@^27.0.2, pretty-format@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== @@ -22853,6 +21725,16 @@ pretty-format@^28.1.1: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-format@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.3.tgz#c9fba8cedf99ce50963a11b27d982a9ae90970d5" + integrity sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q== + dependencies: + "@jest/schemas" "^28.1.3" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^18.0.0" + pretty-format@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385" @@ -22904,7 +21786,7 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= -progress@2.0.3, progress@^2.0.0, progress@^2.0.3: +progress@2.0.3, progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== @@ -22989,15 +21871,6 @@ propagate@^2.0.0: resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== -proper-lockfile@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-4.1.2.tgz#c8b9de2af6b2f1601067f98e01ac66baa223141f" - integrity sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA== - dependencies: - graceful-fs "^4.2.4" - retry "^0.12.0" - signal-exit "^3.0.2" - property-information@^5.0.0, property-information@^5.0.1, property-information@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.5.0.tgz#4dc075d493061a82e2b7d096f406e076ed859943" @@ -23358,7 +22231,7 @@ rc-pagination@^1.20.1: prop-types "^15.5.7" react-lifecycles-compat "^3.0.4" -rc@^1.0.1, rc@^1.2.7, rc@^1.2.8: +rc@^1.2.7, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -23552,10 +22425,10 @@ react-grid-layout@^1.3.4: react-draggable "^4.0.0" react-resizable "^3.0.4" -react-hook-form@^7.37.0: - version "7.37.0" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.37.0.tgz#4d1738f092d3d8a3ade34ee892d97350b1032b19" - integrity sha512-6NFTxsnw+EXSpNNvLr5nFMjPdYKRryQcelTHg7zwBB6vAzfPIcZq4AExP4heVlwdzntepQgwiOQW4z7Mr99Lsg== +react-hook-form@^7.38.0: + version "7.38.0" + resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.38.0.tgz#53d6a68df587ce4ce88352f63e0ecc7fc8779320" + integrity sha512-gxWW1kMeru9xR1GoR+Iw4hA+JBOM3SHfr4DWCUKY0xc7Vv1MLsF109oHtBeWl9shcyPFx67KHru44DheN0XY5A== react-input-autosize@^3.0.0: version "3.0.0" @@ -23964,14 +22837,6 @@ reactcss@^1.2.0: dependencies: lodash "^4.0.1" -read-all-stream@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa" - integrity sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po= - dependencies: - pinkie-promise "^2.0.0" - readable-stream "^2.0.0" - read-installed@~4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/read-installed/-/read-installed-4.0.3.tgz#ff9b8b67f187d1e4c29b9feb31f6b223acd19067" @@ -24310,13 +23175,6 @@ registry-auth-token@^4.0.0: dependencies: rc "^1.2.8" -registry-url@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" - integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= - dependencies: - rc "^1.0.1" - registry-url@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" @@ -24556,13 +23414,6 @@ repeat-string@^1.0.0, repeat-string@^1.5.4, repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -repeating@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-1.1.3.tgz#3d4114218877537494f97f77f9785fab810fa4ac" - integrity sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw= - dependencies: - is-finite "^1.0.0" - repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" @@ -24582,23 +23433,7 @@ request-progress@^3.0.0: dependencies: throttleit "^1.0.0" -request-promise-core@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" - integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== - dependencies: - lodash "^4.17.19" - -request-promise-native@^1.0.8: - version "1.0.9" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" - integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== - dependencies: - request-promise-core "1.1.4" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - -request@^2.44.0, request@^2.88.0, request@^2.88.2: +request@^2.44.0, request@^2.88.0: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -24714,6 +23549,11 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= +resolve.exports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" + integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== + resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" @@ -24786,7 +23626,7 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -retry@0.12.0, retry@^0.12.0: +retry@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= @@ -25043,7 +23883,7 @@ sax@>=0.6.0, sax@^1.2.1: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -saxes@^5.0.0: +saxes@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== @@ -25160,13 +24000,6 @@ selfsigned@^2.0.1: dependencies: node-forge "^1" -semver-diff@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" - integrity sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY= - dependencies: - semver "^5.0.3" - semver-diff@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" @@ -25174,7 +24007,7 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: +"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -25362,10 +24195,10 @@ shallowequal@^1.1.0: resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== -sharp@^0.30.1: - version "0.30.7" - resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.30.7.tgz#7862bda98804fdd1f0d5659c85e3324b90d94c7c" - integrity sha512-G+MY2YW33jgflKPTXXptVO28HvNOo9G3j0MybYAHeEmby+QuD2U98dT6ueht9cv/XDqZspSpIhoSW+BAKJ7Hig== +sharp@^0.31.1: + version "0.31.1" + resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.31.1.tgz#b2f7076d381a120761aa93700cadefcf90a22458" + integrity sha512-GR8M1wBwOiFKLkm9JPun27OQnNRZdHfSf9VwcdZX6UrRmM1/XnOrLFTF0GAil+y/YK4E6qcM/ugxs80QirsHxg== dependencies: color "^4.2.3" detect-libc "^2.0.1" @@ -25400,11 +24233,6 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shellwords@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" - integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== - side-channel@^1.0.2, side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -25514,7 +24342,7 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" -slide@^1.1.5, slide@~1.1.3: +slide@~1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= @@ -25524,13 +24352,21 @@ smart-buffer@^4.1.0: resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== -snakecase-keys@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/snakecase-keys/-/snakecase-keys-3.2.1.tgz#ce5d1a2de8a93c939d7992f76f2743aa59f3d5ad" - integrity sha512-CjU5pyRfwOtaOITYv5C8DzpZ8XA/ieRsDpr93HI2r6e3YInC6moZpSQbmUtg8cTk58tq2x3jcG2gv+p1IZGmMA== +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +snakecase-keys@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/snakecase-keys/-/snakecase-keys-4.0.2.tgz#72e28112b77753a68a4eeb110efec05ab391e190" + integrity sha512-ZFCo3zZtNN43cy2j4fQDHPxS557Uuzn887FBmDdaSB41D8l/MayuvaSrIlCXGFhZ8sXwrHiNaZiIPpKzi88gog== dependencies: map-obj "^4.1.0" - to-snake-case "^1.0.0" + snake-case "^3.0.4" snap-shot-compare@2.8.3: version "2.8.3" @@ -25595,7 +24431,7 @@ sockjs@^0.3.24: uuid "^8.3.2" websocket-driver "^0.7.4" -socks-proxy-agent@^6.0.0, socks-proxy-agent@^6.1.0: +socks-proxy-agent@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz#e664e8f1aaf4e1fb3df945f09e3d94f911137f87" integrity sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew== @@ -25620,10 +24456,10 @@ sonic-boom@^1.0.2: atomic-sleep "^1.0.0" flatstr "^1.0.12" -sonic-boom@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-2.6.0.tgz#8786fc78be07c18a90381acd816d1d4afe3537a2" - integrity sha512-6xYZFRmDEtxGqfOKcDQ4cPLrNa0SPEDI+wlzDAHowXE6YV42NeXqg9mP2KkiM8JVu3lHfZ2iQKYlGOz+kTpphg== +sonic-boom@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-3.2.0.tgz#ce9f2de7557e68be2e52c8df6d9b052e7d348143" + integrity sha512-SbbZ+Kqj/XIunvIAgUZRlqd6CGQYq71tRRbXR92Za8J/R3Yh4Av+TWENiSiEgnlwckYLyP0YZQWVfyNC0dzLaA== dependencies: atomic-sleep "^1.0.0" @@ -25665,14 +24501,6 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: source-map-url "^0.4.0" urix "^0.1.0" -source-map-resolve@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" - integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" @@ -25681,7 +24509,7 @@ source-map-support@0.5.9: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-support@^0.5.16, source-map-support@^0.5.19, source-map-support@^0.5.20, source-map-support@^0.5.21, source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.20: +source-map-support@^0.5.16, source-map-support@^0.5.19, source-map-support@^0.5.20, source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== @@ -26016,11 +24844,6 @@ stdout-stream@^1.4.0: dependencies: readable-stream "^2.0.1" -stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= - store2@^2.12.0: version "2.12.0" resolved "https://registry.yarnpkg.com/store2/-/store2-2.12.0.tgz#e1f1b7e1a59b6083b2596a8d067f6ee88fd4d3cf" @@ -26075,18 +24898,16 @@ stream-to-async-iterator@^0.2.0: resolved "https://registry.yarnpkg.com/stream-to-async-iterator/-/stream-to-async-iterator-0.2.0.tgz#bef5c885e9524f98b2fa5effecc357bd58483780" integrity sha1-vvXIhelST5iy+l7/7MNXvVhIN4A= +streamsearch@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" + integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== + strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= -string-length@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" - integrity sha1-VpcPscOFWOnnC3KL894mmsRa36w= - dependencies: - strip-ansi "^3.0.0" - string-length@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.1.tgz#4a973bf31ef77c4edbceadd6af2611996985f8a1" @@ -26462,6 +25283,13 @@ supercluster@^7.1.4: dependencies: kdbush "^3.0.0" +superjson@^1.10.0: + version "1.10.1" + resolved "https://registry.yarnpkg.com/superjson/-/superjson-1.10.1.tgz#9c73e9393489dddab89d638694eadcbf4bda2f36" + integrity sha512-7fvPVDHmkTKg6641B9c6vr6Zz5CwPtF9j0XFExeLxJxrMaeLU2sqebY3/yrI3l0K5zJ+H9QA3H+lIYj5ooCOkg== + dependencies: + copy-anything "^3.0.2" + supertest@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/supertest/-/supertest-3.1.0.tgz#f9ebaf488e60f2176021ec580bdd23ad269e7bc6" @@ -26783,10 +25611,10 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -throat@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" - integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== +throat@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" + integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== throttle-debounce@^2.1.0: version "2.1.0" @@ -26864,11 +25692,6 @@ time-stamp@^1.0.0: resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= -timed-out@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-2.0.0.tgz#f38b0ae81d3747d628001f41dafc652ace671c0a" - integrity sha1-84sK6B03R9YoAB9B2vxlKs5nHAo= - timers-browserify@^2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.6.tgz#241e76927d9ca05f4d959819022f5b3664b64bae" @@ -27003,13 +25826,6 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -to-snake-case@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-snake-case/-/to-snake-case-1.0.0.tgz#ce746913897946019a87e62edfaeaea4c608ab8c" - integrity sha1-znRpE4l5RgGah+Yu366upMYIq4w= - dependencies: - to-space-case "^1.0.0" - to-source-code@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/to-source-code/-/to-source-code-1.0.2.tgz#dd136bdb1e1dbd80bbeacf088992678e9070bfea" @@ -27060,24 +25876,7 @@ touch@^3.1.0: dependencies: nopt "~1.0.10" -tough-cookie@^2.3.3, tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -tough-cookie@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" - integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg== - dependencies: - ip-regex "^2.1.0" - psl "^1.1.28" - punycode "^2.1.1" - -tough-cookie@^4.1.2: +tough-cookie@^4.0.0, tough-cookie@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.2.tgz#e53e84b85f24e0b65dd526f46628db6c85f6b874" integrity sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ== @@ -27087,6 +25886,14 @@ tough-cookie@^4.1.2: universalify "^0.2.0" url-parse "^1.5.3" +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" @@ -27127,9 +25934,9 @@ trim-newlines@^1.0.0: integrity sha512-Nm4cF79FhSTzrLKGDMi3I4utBtFv8qKy4sq1enftf2gMdpqI8oVQTAfySkTz5r49giVzDj88SVZXP4CeYQwjaw== trim-newlines@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.0.tgz#79726304a6a898aa8373427298d54c2ee8b1cb30" - integrity sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA== + version "3.0.1" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" + integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== trim-trailing-lines@^1.0.0: version "1.1.0" @@ -27192,12 +25999,12 @@ ts-morph@^13.0.2: "@ts-morph/common" "~0.12.2" code-block-writer "^11.0.0" -ts-node@^10.5.0: - version "10.7.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5" - integrity sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A== +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== dependencies: - "@cspotcode/source-map-support" "0.7.0" + "@cspotcode/source-map-support" "^0.8.0" "@tsconfig/node10" "^1.0.7" "@tsconfig/node12" "^1.0.7" "@tsconfig/node14" "^1.0.0" @@ -27208,7 +26015,7 @@ ts-node@^10.5.0: create-require "^1.1.0" diff "^4.0.1" make-error "^1.1.1" - v8-compile-cache-lib "^3.0.0" + v8-compile-cache-lib "^3.0.1" yn "3.1.1" ts-pnp@^1.1.6: @@ -27380,7 +26187,7 @@ typescript-tuple@^2.2.1: dependencies: typescript-compare "^0.0.2" -typescript@4.6.3, typescript@^3.3.3333, typescript@^3.5.3, typescript@^4.5.5: +typescript@4.6.3, typescript@^3.3.3333, typescript@^3.5.3, typescript@^4.8.3: version "4.6.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c" integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw== @@ -27433,6 +26240,13 @@ undici@^5.1.1: resolved "https://registry.yarnpkg.com/undici/-/undici-5.8.2.tgz#071fc8a6a5d24db0ad510ad442f607d9b09d5eec" integrity sha512-3KLq3pXMS0Y4IELV045fTxqz04Nk9Ms7yfBBHum3yxsTR4XNn+ZCaUbf/mWitgYDAhsplQ0B1G4S5D345lMO3A== +undici@^5.10.0: + version "5.11.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.11.0.tgz#1db25f285821828fc09d3804b9e2e934ae86fc13" + integrity sha512-oWjWJHzFet0Ow4YZBkyiJwiK5vWqEYoH7BINzJAJOLedZ++JpAlCbUktW2GQ2DS2FpKmxD/JMtWUUWl1BtghGw== + dependencies: + busboy "^1.6.0" + unfetch@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" @@ -27650,13 +26464,6 @@ unist-util-visit@^1.3.0: dependencies: unist-util-visit-parents "^2.0.0" -universal-user-agent@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-2.0.3.tgz#9f6f09f9cc33de867bb720d84c08069b14937c6c" - integrity sha512-eRHEHhChCBHrZsA4WEhdgiOKgdvgrMIHwnwnqD0r5C6AO8kwKcG7qSku3iXdhvHL3YvsS9ZkSGN8h/hIpoFC8g== - dependencies: - os-name "^3.0.0" - universal-user-agent@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-4.0.1.tgz#fd8d6cb773a679a709e967ef8288a31fcc03e557" @@ -27717,19 +26524,6 @@ update-browserslist-db@^1.0.9: escalade "^3.1.1" picocolors "^1.0.0" -update-notifier@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-0.5.0.tgz#07b5dc2066b3627ab3b4f530130f7eddda07a4cc" - integrity sha1-B7XcIGazYnqztPUwEw9+3doHpMw= - dependencies: - chalk "^1.0.0" - configstore "^1.0.0" - is-npm "^1.0.0" - latest-version "^1.0.0" - repeating "^1.1.2" - semver-diff "^2.0.0" - string-length "^1.0.0" - update-notifier@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-5.1.0.tgz#4ab0d7c7f36a231dd7316cf7729313f0214d9ad9" @@ -27795,11 +26589,6 @@ url-parse@^1.5.10, url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" -url-template@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" - integrity sha1-/FZaPMy/93MMd19WQflVV5FDnyE= - url@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" @@ -27938,11 +26727,6 @@ uuid@3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -uuid@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" - integrity sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho= - uuid@^3.3.2, uuid@^3.3.3: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -27953,20 +26737,20 @@ uuid@^8.3.0, uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -v8-compile-cache-lib@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz#0582bcb1c74f3a2ee46487ceecf372e46bce53e8" - integrity sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA== +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== v8-compile-cache@^2.0.3, v8-compile-cache@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -v8-to-istanbul@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.0.0.tgz#b4fe00e35649ef7785a9b7fcebcea05f37c332fc" - integrity sha512-fLL2rFuQpMtm9r8hrAV2apXX/WqHJ6+IC4/eQVdMDGBUgH/YMV4Gv3duk3kjmyg6uiQWBAA9nJwue4iJUOkHeA== +v8-to-istanbul@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz#0aeb763894f1a0a1676adf8a8b7612a38902446c" + integrity sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" @@ -28847,7 +27631,7 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" -whatwg-url@^8.0.0: +whatwg-url@^8.0.0, whatwg-url@^8.5.0: version "8.7.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== @@ -29047,15 +27831,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@^1.1.2: - version "1.3.4" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" - integrity sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8= - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - slide "^1.1.5" - write-file-atomic@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" @@ -29079,7 +27854,7 @@ ws@8.9.0, ws@>=8.7.0, ws@^8.2.3, ws@^8.4.2: resolved "https://registry.yarnpkg.com/ws/-/ws-8.9.0.tgz#2a994bb67144be1b53fe2d23c53c028adeb7f45e" integrity sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg== -ws@^7.2.3, ws@^7.3.1, ws@^7.4.6: +ws@^7.3.1, ws@^7.4.6: version "7.5.6" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== @@ -29091,13 +27866,6 @@ x-default-browser@^0.4.0: optionalDependencies: default-browser-id "^1.0.4" -xdg-basedir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz#edbc903cc385fc04523d966a335504b5504d1bd2" - integrity sha1-7byQPMOF/ARSPZZqM1UEtVBNG9I= - dependencies: - os-homedir "^1.0.0" - xdg-basedir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" @@ -29174,10 +27942,10 @@ xtend@~2.1.1: dependencies: object-keys "~0.4.0" -xterm@^4.18.0: - version "4.18.0" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.18.0.tgz#a1f6ab2c330c3918fb094ae5f4c2562987398ea1" - integrity sha512-JQoc1S0dti6SQfI0bK1AZvGnAxH4MVw45ZPFSO6FHTInAiau3Ix77fSxNx3mX4eh9OL4AYa8+4C8f5UvnSfppQ== +xterm@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.0.0.tgz#0af50509b33d0dc62fde7a4ec17750b8e453cc5c" + integrity sha512-tmVsKzZovAYNDIaUinfz+VDclraQpPUnAME+JawosgWRMphInDded/PuY0xmU5dOhyeYZsI0nz5yd8dPYsdLTA== y18n@^3.2.0: version "3.2.2" @@ -29214,6 +27982,11 @@ yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yaml@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.1.3.tgz#9b3a4c8aff9821b696275c79a8bee8399d945207" + integrity sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg== + 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"